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 <sigonasr2@gmail.com>
main
sigonasr2 2 years ago
parent 6f0a423e21
commit c5db6a2585
  1. 16
      src/sig/DrawLoop.java
  2. 6
      src/sig/engine/objects/Object.java
  3. 1
      src/sig/objects/BunnyGirls.java
  4. 4
      src/sig/objects/EditorRenderer.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<xe) {
x=x+1;
if (px<0) {
@ -93,7 +93,7 @@ public class DrawLoop {
}
px=px+2*(dy1-dx1);
}
Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha);
Draw(canvas,y*RabiClone.BASE_WIDTH+x,col);
}
} else {
if (dy>=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<ye) {
y=y+1;
if (py<=0) {
@ -114,7 +114,7 @@ public class DrawLoop {
}
py=py+2*(dx1-dy1);
}
Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha);
Draw(canvas,y*RabiClone.BASE_WIDTH+x,col);
}
}
}
@ -124,7 +124,7 @@ public class DrawLoop {
for (int yy=0;yy<h;yy++) {
if (x+xx>=0&&y+yy>=0&&x+xx<RabiClone.BASE_WIDTH&&y+yy<RabiClone.BASE_HEIGHT) {
int index = ((int)y+yy)*RabiClone.BASE_WIDTH+(int)x+xx;
Draw(p,index,col, Alpha.ALPHA0);
Draw(p,index,col);
}
}
}
@ -193,7 +193,7 @@ public class DrawLoop {
if (sprite.getBi_array()[Y*sprite.getCanvasWidth()+X]==32||index<0||index>=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);
}
}

@ -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) {

@ -1,5 +1,6 @@
package sig.objects;
import sig.engine.Alpha;
import sig.engine.AnimatedSprite;
import sig.engine.Panel;
import sig.engine.Rectangle;

@ -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);
}
}
}

Loading…
Cancel
Save