nothing much
This commit is contained in:
@@ -85,17 +85,17 @@ public class NoosaScript extends Script {
|
||||
|
||||
public void drawElements( FloatBuffer vertices, ShortBuffer indices, int size ) {
|
||||
if (DeviceCompat.isWeb()) {
|
||||
Gdx.gl30.glBindBuffer(Gdx.gl30.GL_ARRAY_BUFFER, vertexBufferId);
|
||||
activeGL.glBindBuffer(GL20.GL_ARRAY_BUFFER, vertexBufferId);
|
||||
((Buffer)vertices).position( 0 );
|
||||
Gdx.gl30.glBufferSubData(Gdx.gl30.GL_ARRAY_BUFFER, 0, vertices.remaining() * 4, vertices);
|
||||
activeGL.glBufferSubData(GL20.GL_ARRAY_BUFFER, 0, vertices.remaining() * 4, vertices);
|
||||
|
||||
aXY.vertexBuffer(2, 4, 0);
|
||||
aUV.vertexBuffer(2, 4, 2);
|
||||
|
||||
Quad.releaseIndices();
|
||||
Gdx.gl30.glDrawElements( Gdx.gl30.GL_TRIANGLES, size, Gdx.gl30.GL_UNSIGNED_SHORT, indices );
|
||||
activeGL.glDrawElements( GL20.GL_TRIANGLES, size, GL20.GL_UNSIGNED_SHORT, indices );
|
||||
Quad.bindIndices();
|
||||
Gdx.gl30.glBindBuffer(Gdx.gl30.GL_ARRAY_BUFFER, 0);
|
||||
activeGL.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
|
||||
} else {
|
||||
((Buffer)vertices).position( 0 );
|
||||
aXY.vertexPointer( 2, 4, vertices );
|
||||
@@ -111,14 +111,14 @@ public class NoosaScript extends Script {
|
||||
|
||||
public void drawQuad( FloatBuffer vertices ) {
|
||||
if (DeviceCompat.isWeb()) {
|
||||
Gdx.gl30.glBindBuffer(Gdx.gl30.GL_ARRAY_BUFFER, vertexBufferId);
|
||||
activeGL.glBindBuffer(GL20.GL_ARRAY_BUFFER, vertexBufferId);
|
||||
((Buffer)vertices).position( 0 );
|
||||
Gdx.gl30.glBufferSubData(Gdx.gl30.GL_ARRAY_BUFFER, 0, vertices.remaining() * 4, vertices);
|
||||
activeGL.glBufferSubData(GL20.GL_ARRAY_BUFFER, 0, vertices.remaining() * 4, vertices);
|
||||
|
||||
Gdx.gl30.glVertexAttribPointer(aXY.location(), 2, Gdx.gl30.GL_FLOAT, false, 4 * 4, 0);
|
||||
Gdx.gl30.glVertexAttribPointer(aUV.location(), 2, Gdx.gl30.GL_FLOAT, false, 4 * 4, 2 * 4);
|
||||
Gdx.gl30.glDrawElements( Gdx.gl30.GL_TRIANGLES, Quad.SIZE, Gdx.gl30.GL_UNSIGNED_SHORT, 0 );
|
||||
Gdx.gl30.glBindBuffer(Gdx.gl30.GL_ARRAY_BUFFER, 0);
|
||||
activeGL.glVertexAttribPointer(aXY.location(), 2, GL20.GL_FLOAT, false, 4 * 4, 0);
|
||||
activeGL.glVertexAttribPointer(aUV.location(), 2, GL20.GL_FLOAT, false, 4 * 4, 2 * 4);
|
||||
activeGL.glDrawElements( GL20.GL_TRIANGLES, Quad.SIZE, GL20.GL_UNSIGNED_SHORT, 0 );
|
||||
activeGL.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
|
||||
} else {
|
||||
((Buffer)vertices).position( 0 );
|
||||
aXY.vertexPointer( 2, 4, vertices );
|
||||
@@ -151,16 +151,16 @@ public class NoosaScript extends Script {
|
||||
}
|
||||
|
||||
if (DeviceCompat.isWeb()) {
|
||||
Gdx.gl30.glBindBuffer(Gdx.gl30.GL_ARRAY_BUFFER, vertexBufferId);
|
||||
activeGL.glBindBuffer(GL20.GL_ARRAY_BUFFER, vertexBufferId);
|
||||
((Buffer)vertices).position( 0 );
|
||||
Gdx.gl30.glBufferSubData(Gdx.gl30.GL_ARRAY_BUFFER, 0, vertices.remaining() * 4, vertices);
|
||||
activeGL.glBufferSubData(GL20.GL_ARRAY_BUFFER, 0, vertices.remaining() * 4, vertices);
|
||||
|
||||
Gdx.gl30.glVertexAttribPointer(aXY.location(), 2, Gdx.gl30.GL_FLOAT, false, 4 * 4, 0);
|
||||
Gdx.gl30.glVertexAttribPointer(aUV.location(), 2, Gdx.gl30.GL_FLOAT, false, 4 * 4, 2 * 4);
|
||||
activeGL.glVertexAttribPointer(aXY.location(), 2, GL20.GL_FLOAT, false, 4 * 4, 0);
|
||||
activeGL.glVertexAttribPointer(aUV.location(), 2, GL20.GL_FLOAT, false, 4 * 4, 2 * 4);
|
||||
|
||||
Gdx.gl30.glDrawElements( Gdx.gl30.GL_TRIANGLES, Quad.SIZE * size, Gdx.gl30.GL_UNSIGNED_SHORT, 0 );
|
||||
activeGL.glDrawElements( GL20.GL_TRIANGLES, Quad.SIZE * size, GL20.GL_UNSIGNED_SHORT, 0 );
|
||||
|
||||
Gdx.gl30.glBindBuffer(Gdx.gl30.GL_ARRAY_BUFFER, 0);
|
||||
activeGL.glBindBuffer(GL20.GL_ARRAY_BUFFER, 0);
|
||||
} else {
|
||||
((Buffer)vertices).position( 0 );
|
||||
aXY.vertexPointer( 2, 4, vertices );
|
||||
|
||||
@@ -41,4 +41,4 @@ allprojects {
|
||||
maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ repositories {
|
||||
tasks.register('compileClient', JavaExec) {
|
||||
classpath(sourceSets.main.runtimeClasspath)
|
||||
mainClass.set('com.shatteredpixel.shatteredpixeldungeon.html.Compile')
|
||||
jvmArgs('-Xms8g', '-Xmx14g', '-Xss16m', '-XX:MaxMetaspaceSize=12g', '-Dfile.encoding=UTF-8')
|
||||
outputs.dir '../release/webapp'
|
||||
doFirst {
|
||||
println "Running compileClient..."
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
../gradlew :html:build
|
||||
wait
|
||||
if [[ -d ../release/webapp/ ]]; then
|
||||
python3 -m http.server 8100 -d ../release/webapp/
|
||||
python3 -m http.server 8000 -d ../release/webapp/
|
||||
fi
|
||||
|
||||
9
html/deployWeb.sh
Executable file
9
html/deployWeb.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
TARGET_FOLDER="shatteredPixelDungeon"
|
||||
|
||||
# shellcheck disable=SC2029
|
||||
if ssh vps "[[ -d /var/www/$TARGET_FOLDER ]]"; then
|
||||
ssh vps "find /var/www/$TARGET_FOLDER -mindepth 1 -delete"
|
||||
scp -r ../release/webapp/* vps:/var/www/$TARGET_FOLDER
|
||||
fi
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at:
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
* This file is derived from micronaut-libgdx-teavm (https://github.com/hollingsworthd/micronaut-libgdx-teavm),
|
||||
* originally licensed under the Apache License, Version 2.0.
|
||||
*
|
||||
*
|
||||
* Modifications made by Konsthol on 13/4/25:
|
||||
* - Adjusted to compile Shattered Pixel Dungeon
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user