Canvas scaling in OpenGL, refactor GameShell and some graphics classes

This commit is contained in:
Pazaz 2022-04-21 02:53:11 -04:00
parent 3c58eb3a01
commit bded93da5f
26 changed files with 336 additions and 291 deletions

View file

@ -43,8 +43,8 @@ public final class GlIndexedSprite extends IndexedSprite {
@OriginalMember(owner = "client!oh", name = "a", descriptor = "([B[I)V")
private void method3337(@OriginalArg(0) byte[] arg0, @OriginalArg(1) int[] arg1) {
this.anInt4287 = Static165.method3164(this.anInt4270);
this.anInt4286 = Static165.method3164(this.anInt4278);
this.anInt4287 = Static165.clp2(this.anInt4270);
this.anInt4286 = Static165.clp2(this.anInt4278);
@Pc(20) byte[] local20 = new byte[this.anInt4287 * this.anInt4286 * 4];
@Pc(22) int local22 = 0;
@Pc(24) int local24 = 0;
@ -69,11 +69,11 @@ public final class GlIndexedSprite extends IndexedSprite {
@Pc(102) int[] local102 = new int[1];
local95.glGenTextures(1, local102, 0);
this.anInt4281 = local102[0];
this.anInt4285 = Static63.anInt1943;
this.anInt4285 = Static63.contextId;
}
GlRenderer.setTextureId(this.anInt4281);
local95.glTexImage2D(GL2.GL_TEXTURE_2D, 0, GL2.GL_RGBA, this.anInt4287, this.anInt4286, 0, GL2.GL_RGBA, GL2.GL_UNSIGNED_BYTE, local93);
Static63.anInt1944 += local93.limit() - this.anInt4284;
Static63.onCard2d += local93.limit() - this.anInt4284;
this.anInt4284 = local93.limit();
}
@ -120,12 +120,12 @@ public final class GlIndexedSprite extends IndexedSprite {
@Override
public final void finalize() throws Throwable {
if (this.anInt4281 != -1) {
Static63.method1491(this.anInt4281, this.anInt4284, this.anInt4285);
Static63.deleteTexture2d(this.anInt4281, this.anInt4284, this.anInt4285);
this.anInt4281 = -1;
this.anInt4284 = 0;
}
if (this.anInt4282 != -1) {
Static63.method1486(this.anInt4282, this.anInt4285);
Static63.deleteList(this.anInt4282, this.anInt4285);
this.anInt4282 = -1;
}
super.finalize();
@ -138,7 +138,7 @@ public final class GlIndexedSprite extends IndexedSprite {
@Pc(17) GL2 local17 = GlRenderer.gl;
if (this.anInt4282 == -1) {
this.anInt4282 = local17.glGenLists(1);
this.anInt4285 = Static63.anInt1943;
this.anInt4285 = Static63.contextId;
}
local17.glNewList(this.anInt4282, GL2.GL_COMPILE);
local17.glBegin(GL2.GL_TRIANGLE_FAN);