This commit is contained in:
thedaneeffect committed 2023-01-07 20:15:43 -05:00
1 parent ed6390f148
commit 2e7e22aced
55 files changed
+9627 -9613

No files matched your search

+21 -21
View File
@@ -8,30 +8,30 @@ import java.awt.image.DataBufferInt;
public class DrawArea {
public final int[] pixels;
public final int width;
public final int height;
public final BufferedImage image;
public final int[] pixels;
public final int width;
public final int height;
public final BufferedImage image;
public DrawArea(int width, int height) {
this.width = width;
this.height = height;
this.image = new BufferedImage(this.width, this.height, BufferedImage.TYPE_INT_RGB);
this.pixels = ((DataBufferInt) this.image.getRaster().getDataBuffer()).getData();
bind();
}
public DrawArea(int width, int height) {
this.width = width;
this.height = height;
this.image = new BufferedImage(this.width, this.height, BufferedImage.TYPE_INT_RGB);
this.pixels = ((DataBufferInt) this.image.getRaster().getDataBuffer()).getData();
bind();
}
public DrawArea(Image24 image) {
this(image.width, image.height);
image.blitOpaque(0, 0);
}
public DrawArea(Image24 image) {
this(image.width, image.height);
image.blitOpaque(0, 0);
}
public void bind() {
Draw2D.bind(pixels, width, height);
}
public void bind() {
Draw2D.bind(pixels, width, height);
}
public void draw(Graphics g, int x, int y) {
g.drawImage(image, x, y, null);
}
public void draw(Graphics g, int x, int y) {
g.drawImage(image, x, y, null);
}
}