From c5db6a25857c6ea3906d16e915acbe010617ae67 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Tue, 28 Jun 2022 16:00:23 -0500 Subject: [PATCH] Remove extraneous old alpha calculations now that proper transparency is incorporated. Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 --- src/sig/DrawLoop.java | 16 ++++++++-------- src/sig/engine/objects/Object.java | 6 +++--- src/sig/objects/BunnyGirls.java | 1 + src/sig/objects/EditorRenderer.java | 4 ++-- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/sig/DrawLoop.java b/src/sig/DrawLoop.java index 56aa752..ee28ca5 100644 --- a/src/sig/DrawLoop.java +++ b/src/sig/DrawLoop.java @@ -80,7 +80,7 @@ public class DrawLoop { } else { x=x2-1;y=y2-1;xe=x1; } - Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); + Draw(canvas,y*RabiClone.BASE_WIDTH+x,col); while (x=0) { @@ -101,7 +101,7 @@ public class DrawLoop { } else { x=x2-1;y=y2-1;ye=y1; } - Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); + Draw(canvas,y*RabiClone.BASE_WIDTH+x,col); while (y=0&&y+yy>=0&&x+xx=p.length) { continue; } else { - Draw(p,index,(col==PaletteColor.NORMAL)?sprite.getBi_array()[Y*sprite.getCanvasWidth()+X]:(byte)col.ordinal(),alpha); + Draw(p,index,(col==PaletteColor.NORMAL)?sprite.getBi_array()[Y*sprite.getCanvasWidth()+X]:(byte)col.ordinal()); } } } @@ -201,7 +201,7 @@ public class DrawLoop { } } - public static void Draw(byte[] canvas,int index, byte col, Alpha alpha) { - canvas[index]=(byte)(((int)(col)&0xff)+(alpha.ordinal()*(32))); + public static void Draw(byte[] canvas,int index, byte col) { + canvas[index]=(byte)((int)(col)&0xff); } } diff --git a/src/sig/engine/objects/Object.java b/src/sig/engine/objects/Object.java index 7094f88..d175c5b 100644 --- a/src/sig/engine/objects/Object.java +++ b/src/sig/engine/objects/Object.java @@ -64,7 +64,7 @@ public abstract class Object implements GameEntity{ this.spr = spr; } public Alpha getTransparency() { - return getTransparency(); + return transparency; } public void setTransparency(Alpha alpha) { this.transparency=alpha; @@ -75,8 +75,8 @@ public abstract class Object implements GameEntity{ public void drawOverlay(byte[] p) { } - protected void Draw(byte[] canvas, int index, PaletteColor col, Alpha alpha) { - DrawLoop.Draw(canvas, index, (byte)col.ordinal(), alpha); + protected void Draw(byte[] canvas, int index, PaletteColor col) { + DrawLoop.Draw(canvas, index, (byte)col.ordinal()); } protected void Draw_Rect(byte[] p,PaletteColor col,double x,double y,double w,double h) { diff --git a/src/sig/objects/BunnyGirls.java b/src/sig/objects/BunnyGirls.java index ab7b0e3..b53c8b8 100644 --- a/src/sig/objects/BunnyGirls.java +++ b/src/sig/objects/BunnyGirls.java @@ -1,5 +1,6 @@ package sig.objects; +import sig.engine.Alpha; import sig.engine.AnimatedSprite; import sig.engine.Panel; import sig.engine.Rectangle; diff --git a/src/sig/objects/EditorRenderer.java b/src/sig/objects/EditorRenderer.java index 42584ed..6eb79a8 100644 --- a/src/sig/objects/EditorRenderer.java +++ b/src/sig/objects/EditorRenderer.java @@ -194,7 +194,7 @@ public class EditorRenderer extends LevelRenderer{ if (index<0||index>=p.length) { continue; } - Draw(p,index,PaletteColor.BLACK,Alpha.ALPHA0); + Draw(p,index,PaletteColor.BLACK); } } if (y%Tile.TILE_SCREEN_COUNT_Y==0) { @@ -205,7 +205,7 @@ public class EditorRenderer extends LevelRenderer{ if (xpos<0||xpos>=Map.MAP_WIDTH||ypos<0||ypos>=Map.MAP_HEIGHT||index<0||index>=p.length) { continue; } - Draw(p,index,PaletteColor.BLACK,Alpha.ALPHA0); + Draw(p,index,PaletteColor.BLACK); } } }