Compare commits

..

No commits in common. "4a16dbfc9fe20f25ad52afe355c8d64455e5f4ee" and "ba42f2d3bf6bf1f0a9904fdbb9e00720b1b0089a" have entirely different histories.

2 changed files with 8 additions and 27 deletions

View File

@ -57,21 +57,4 @@ public class Image {
data[i + 2] = (byte)(col.b & 0xFF);
data[i + 3] = (byte)(col.a & 0xFF);
}
public void drawImage(Image srcImage, Vec2i destPos) {
drawImage(srcImage, destPos, new Recti(Vec2i.ZERO, srcImage.getSize()));
}
public void drawImage(Image srcImage, Vec2i destPos, Recti srcRect) {
//todo: check bounds
//todo: write in faster way than pixel stuff
for(int y = 0; y < srcRect.getHeight(); ++y) {
for(int x = 0; x < srcRect.getWidth(); ++x) {
var iterPos = new Vec2i(x, y);
var to = Vec2i.add(destPos, iterPos);
var from = Vec2i.add(srcRect.getPos(), iterPos);
setPixel(to, srcImage.getPixel(from));
}
}
}
}

View File

@ -3,8 +3,6 @@ package com.danitheskunk.skunkworks;
public final class Vec2i {
final int x, y;
public final static Vec2i ZERO = new Vec2i(0, 0);
//constructors
public Vec2i(int x, int y) {