mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-03-04 09:11:27 +01:00
character: honor x/y values from frames when calculating animation size
This commit is contained in:
parent
71ec8b396e
commit
897aa8b52f
1 changed files with 2 additions and 2 deletions
|
@ -114,11 +114,11 @@ SYMBOL_EXPORT void LoadSpritesheets(struct Game* game, struct Character* charact
|
|||
char filename[255] = {0};
|
||||
snprintf(filename, 255, "sprites/%s/%s", character->name, tmp->frames[i].file);
|
||||
tmp->frames[i].bitmap = al_load_bitmap(GetDataFilePath(game, filename));
|
||||
int width = al_get_bitmap_width(tmp->frames[i].bitmap);
|
||||
int width = al_get_bitmap_width(tmp->frames[i].bitmap) + tmp->frames[i].x;
|
||||
if (width > tmp->width) {
|
||||
tmp->width = width;
|
||||
}
|
||||
int height = al_get_bitmap_height(tmp->frames[i].bitmap);
|
||||
int height = al_get_bitmap_height(tmp->frames[i].bitmap) + tmp->frames[i].y;
|
||||
if (height > tmp->height) {
|
||||
tmp->height = height;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue