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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user