mirror of
https://github.com/OpenTTD/OpenTTD
synced 2026-01-16 17:02:37 +01:00
(svn r14268) [0.6] -Backport from trunk:
- Fix: Properly update the current timetable's travel/wait times instead of only doing it for one vehicle in the shared order chain and only when some bit has not been set [FS#2236] (r14192)
- Fix: Sprite payload skipping would not skip enough bytes in a very small subset of compressed sprites (r14191)
- Fix: After applying NewGRF settings, all rail and road types were available as the engine availability check was performed too early (r14182)
- Fix: Close all related vehicle lists when closing a station window (and not only the train list) (r14180)
- Fix: RemoveOrderFromAllVehicles() did not mark enough windows dirty (r14179)
- Fix: Incorrect cargo weights (r14144)
- Fix: GetSlopeZ() gets a virtual coordinate, not a tile (r14139)
- Fix: Close the 'manage vehicles' dropdown once the number of vehicles in the list reaches 0 [FS#2249] (r14133)
- Fix: [strgen] Changing order of parameters {X:...} did not work for strings including some {StringY} (r14111)
- Fix: Desync due to bubbles in toyland (r14110)
- Fix: Make NewGRF action 0x06's changes persistent over the several loading stages [FS#1986] (r14102)
This commit is contained in:
@@ -72,6 +72,35 @@ static int _compact_cache_counter;
|
||||
|
||||
static void CompactSpriteCache();
|
||||
|
||||
/**
|
||||
* Skip the given amount of sprite graphics data.
|
||||
* @param type the type of sprite (compressed etc)
|
||||
* @param num the amount of sprites to skip
|
||||
*/
|
||||
void SkipSpriteData(byte type, uint16 num)
|
||||
{
|
||||
if (type & 2) {
|
||||
FioSkipBytes(num);
|
||||
} else {
|
||||
while (num > 0) {
|
||||
int8 i = FioReadByte();
|
||||
if (i >= 0) {
|
||||
int size = (i == 0) ? 0x80 : i;
|
||||
num -= size;
|
||||
FioSkipBytes(size);
|
||||
} else {
|
||||
i = -(i >> 3);
|
||||
num -= i;
|
||||
FioReadByte();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the sprite header data and then skip the real payload.
|
||||
* @return true if the sprite is a pseudo sprite.
|
||||
*/
|
||||
static bool ReadSpriteHeaderSkipData()
|
||||
{
|
||||
uint16 num = FioReadWord();
|
||||
@@ -88,24 +117,7 @@ static bool ReadSpriteHeaderSkipData()
|
||||
}
|
||||
|
||||
FioSkipBytes(7);
|
||||
num -= 8;
|
||||
if (num == 0) return true;
|
||||
|
||||
if (type & 2) {
|
||||
FioSkipBytes(num);
|
||||
} else {
|
||||
while (num > 0) {
|
||||
int8 i = FioReadByte();
|
||||
if (i >= 0) {
|
||||
num -= i;
|
||||
FioSkipBytes(i);
|
||||
} else {
|
||||
i = -(i >> 3);
|
||||
num -= i;
|
||||
FioReadByte();
|
||||
}
|
||||
}
|
||||
}
|
||||
SkipSpriteData(type, num - 8);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user