summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-11-24 10:19:56 +0000
committerrubidium <rubidium@openttd.org>2007-11-24 10:19:56 +0000
commit3ff1cf32c39e9e11d783b973c64a33c098705304 (patch)
tree29c8f0e9eb59ea31bd1b03626f0a4a214fddd6b2
parentd8e9bb4089303882cf362841c73169cb54a07d2d (diff)
downloadopenttd-3ff1cf32c39e9e11d783b973c64a33c098705304.tar.xz
(svn r11509) -Fix: off-by-one error in some sprite numbers; increase sprite number counter before loading the next sprite instead of after doing so.
-rw-r--r--src/newgrf.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp
index 65590d870..8279a7610 100644
--- a/src/newgrf.cpp
+++ b/src/newgrf.cpp
@@ -2321,8 +2321,8 @@ static void NewSpriteSet(byte *buf, int len)
);
for (uint16 i = 0; i < num_sets * num_ents; i++) {
- LoadNextSprite(_cur_spriteid++, _file_index, _nfo_line);
_nfo_line++;
+ LoadNextSprite(_cur_spriteid++, _file_index, _nfo_line);
}
}
@@ -3392,8 +3392,8 @@ static void GraphicsNew(byte *buf, int len)
}
for (; num > 0; num--) {
- LoadNextSprite(replace == 0 ? _cur_spriteid++ : replace++, _file_index, _nfo_line);
_nfo_line++;
+ LoadNextSprite(replace == 0 ? _cur_spriteid++ : replace++, _file_index, _nfo_line);
}
_skip_sprites = skip_num;
@@ -3806,8 +3806,8 @@ static void SpriteReplace(byte *buf, int len)
);
for (uint j = 0; j < num_sprites; j++) {
- LoadNextSprite(first_sprite + j, _file_index, _nfo_line); // XXX
_nfo_line++;
+ LoadNextSprite(first_sprite + j, _file_index, _nfo_line); // XXX
}
}
}
@@ -4642,8 +4642,8 @@ static void LoadFontGlyph(byte *buf, int len)
for (uint c = 0; c < num_char; c++) {
SetUnicodeGlyph(size, base_char + c, _cur_spriteid);
- LoadNextSprite(_cur_spriteid++, _file_index, _nfo_line);
_nfo_line++;
+ LoadNextSprite(_cur_spriteid++, _file_index, _nfo_line);
}
}
}