fix(warning cleanup): casting earlier in spritesheet_from_texture
Decreases chance of overflow
This commit is contained in:
parent
686c3c7578
commit
663d6e36c2
|
@ -43,8 +43,8 @@ Spritesheet* spritesheet_from_texture(SDL_Texture* texture, IVector tile_size) {
|
|||
SDL_QueryTexture(self->texture, NULL, NULL, &self->resolution.x, &self->resolution.y);
|
||||
|
||||
self->tile_size = tile_size;
|
||||
self->tile_shear = self->resolution.x / self->tile_size.x;
|
||||
self->tile_count = self->resolution.x / self->tile_size.x * self->resolution.y / self->tile_size.y;
|
||||
self->tile_shear = (size_t)self->resolution.x / self->tile_size.x;
|
||||
self->tile_count = (size_t)self->resolution.x / self->tile_size.x * self->resolution.y / self->tile_size.y;
|
||||
return self;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue