mirror of
https://github.com/FranLMSP/pokemon_sprite_decompress.git
synced 2024-11-23 09:31:33 +00:00
Fix centering bug
This commit is contained in:
parent
8398cf5bb1
commit
641392842b
@ -112,7 +112,8 @@ impl Buffer {
|
|||||||
// vertical offset = 7 - height
|
// vertical offset = 7 - height
|
||||||
// horizontal offset = ((7 - width) / 2) + (1/2) -> then round the result down
|
// horizontal offset = ((7 - width) / 2) + (1/2) -> then round the result down
|
||||||
self.vertical_offset = MAX_SPRITE_SIZE - width;
|
self.vertical_offset = MAX_SPRITE_SIZE - width;
|
||||||
self.horizontal_offset = ((MAX_SPRITE_SIZE - height) / 2) + (1 / 2);
|
let res = (((MAX_SPRITE_SIZE as f32 - height as f32) / 2.0) + (1.0 / 2.0)) as f32;
|
||||||
|
self.horizontal_offset = res.floor() as u8;
|
||||||
// We need 3 bitplanes, the first and second ones are where the
|
// We need 3 bitplanes, the first and second ones are where the
|
||||||
// decompressed bytes will be, which are 7 x 7 each.
|
// decompressed bytes will be, which are 7 x 7 each.
|
||||||
// The third one is usually 7 x 7 maximum too, but glitched pokemon could
|
// The third one is usually 7 x 7 maximum too, but glitched pokemon could
|
||||||
|
Loading…
Reference in New Issue
Block a user