1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-17 09:22:42 +01:00

Codefix: Use SpriteID when passing sprite IDs. (#13037)

This commit is contained in:
Peter Nelson
2024-10-27 18:54:49 +00:00
committed by GitHub
parent e1697a6ad1
commit e076aaf740
6 changed files with 14 additions and 14 deletions

View File

@@ -573,7 +573,7 @@ void ReadGRFSpriteOffsets(SpriteFile &file)
/* Loop over all sprite section entries and store the file
* offset for each newly encountered ID. */
uint32_t id, prev_id = 0;
SpriteID id, prev_id = 0;
while ((id = file.ReadDword()) != 0) {
if (id != prev_id) {
_grf_sprite_offsets[prev_id] = offset;
@@ -615,7 +615,7 @@ void ReadGRFSpriteOffsets(SpriteFile &file)
* @param container_version Container version of the GRF.
* @return True if a valid sprite was loaded, false on any error.
*/
bool LoadNextSprite(int load_index, SpriteFile &file, uint file_sprite_id)
bool LoadNextSprite(SpriteID load_index, SpriteFile &file, uint file_sprite_id)
{
size_t file_pos = file.GetPos();
@@ -661,7 +661,7 @@ bool LoadNextSprite(int load_index, SpriteFile &file, uint file_sprite_id)
if (type == SpriteType::Invalid) return false;
if (static_cast<uint>(load_index) >= MAX_SPRITES) {
if (load_index >= MAX_SPRITES) {
UserError("Tried to load too many sprites (#{}; max {})", load_index, MAX_SPRITES);
}