mirror of
https://github.com/DarkStore-3DS/Universal-Core.git
synced 2026-07-03 00:39:23 +00:00
Fix scaled things
This commit is contained in:
+8
-8
@@ -159,11 +159,11 @@ void Sprite::drawImage(int x, int y, const Image &image, float scaleX, float sca
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(float i = 0.0f; i < image.height(); i += 1 / scaleY) {
|
||||
for(float j = 0.0f; j < image.width(); j += 1 / scaleX) {
|
||||
u16 px = image.palette()[image.bitmap()[int(i * image.width() + j)] - image.palOfs()];
|
||||
for(int i = 0; i < image.height() * scaleY; i++) {
|
||||
for(int j = 0; j < image.width() * scaleX; j++) {
|
||||
u16 px = image.palette()[image.bitmap()[int(i / scaleY) * image.width() + int(j / scaleX)] - image.palOfs()];
|
||||
if(px & 0x8000)
|
||||
toncset16(_gfx + int((y + i) * _height + j) + x, px, 1);
|
||||
toncset16(_gfx + (y + i) * _height + j + x, px, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,11 +181,11 @@ void Sprite::drawImageSegment(int x, int y, int imageX, int imageY, int w, int h
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for(float i = 0; i < h; i += 1 / scaleX) {
|
||||
for(float j = 0; j < image.width(); j += 1 / scaleY) {
|
||||
u16 px = image.palette()[image.bitmap()[(imageY + i) * image.width() + imageX + j] - image.palOfs()];
|
||||
for(int i = 0; i < h * scaleY; i++) {
|
||||
for(int j = 0; j < w * scaleX; j++) {
|
||||
u16 px = image.palette()[image.bitmap()[(imageY + int(i / scaleY)) * image.width() + imageX + int(j / scaleX)] - image.palOfs()];
|
||||
if(px & 0x8000)
|
||||
toncset16(_gfx + int((y + i) * _height + x + j), px, 1);
|
||||
toncset16(_gfx + (y + i) * _height + x + j, px, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user