include non-transparent drawing code

Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com>
Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent 8bee6dd30c
commit 9ba0af090e
  1. 11
      src/sig/DrawLoop.java
  2. 2
      src/sig/RabiClone.java

@ -28,14 +28,19 @@ public class DrawLoop {
if (index<0||index>=p.length||p[index]==sprite.getBi_array()[Y*sprite.getWidth()+X]) { if (index<0||index>=p.length||p[index]==sprite.getBi_array()[Y*sprite.getWidth()+X]) {
continue; continue;
} else { } else {
Draw(p,index,sprite.getBi_array()[Y*sprite.getWidth()+X]); Draw(p,index,sprite.getBi_array()[Y*sprite.getWidth()+X],true);
//Draw(p,index,sprite.getBi_array()[Y*sprite.getWidth()+X],false);
} }
} }
} }
} }
public static void Draw(int[] canvas,int index, int col) { public static void Draw(int[] canvas,int index, int col,boolean transparency) {
int alpha = col>>>24; if (!transparency) {
canvas[index]=col;
return;
}
int alpha = col>>>24;
if (alpha==0) { if (alpha==0) {
return;} return;}
else else

@ -44,7 +44,7 @@ public class RabiClone{
p.render(); p.render();
for (int i=0;i<10;i++) { for (int i=0;i<10;i++) {
OBJ.add(new Player(p)); OBJ.add(new Player(p));
} }
long lastGameTime = System.nanoTime(); long lastGameTime = System.nanoTime();

Loading…
Cancel
Save