summaryrefslogtreecommitdiff
path: root/gfx.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2005-02-10 12:26:41 +0000
committertron <tron@openttd.org>2005-02-10 12:26:41 +0000
commit9031e0369eeb2c11c5a4a671fb812645b2ea69a2 (patch)
tree766da7d41bc990ffcc65918aba7c705d6e3c0571 /gfx.c
parent94c75f33bb896b32866fd062242067d773b0f7b1 (diff)
downloadopenttd-9031e0369eeb2c11c5a4a671fb812645b2ea69a2.tar.xz
(svn r1855) Handle endianness of sprite headers when loading a sprite, not everytime when accessing it
Diffstat (limited to 'gfx.c')
-rw-r--r--gfx.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/gfx.c b/gfx.c
index 48614f97f..c6fb1e1da 100644
--- a/gfx.c
+++ b/gfx.c
@@ -1335,9 +1335,9 @@ static void GfxMainBlitter(Sprite *sprite, int x, int y, int mode)
};
/* decode sprite header */
- x += (int16)TO_LE16(sprite->x_offs);
- y += (int16)TO_LE16(sprite->y_offs);
- bp.width_org = bp.width = TO_LE16(sprite->width);
+ x += sprite->x_offs;
+ y += sprite->y_offs;
+ bp.width_org = bp.width = sprite->width;
bp.height_org = bp.height = sprite->height;
info = sprite->info;
bp.info = info;
@@ -1628,15 +1628,15 @@ void LoadStringWidthTable(void)
// 2 equals space.
for(i=2; i != 0xE2; i++) {
- *b++ = (byte)((i < 93 || i >= 129 || i == 98) ? TO_LE16(GetSprite(i)->width) : 0);
+ *b++ = (byte)((i < 93 || i >= 129 || i == 98) ? GetSprite(i)->width : 0);
}
for(i=0xE2; i != 0x1C2; i++) {
- *b++ = (byte)((i < 317 || i >= 353) ? TO_LE16(GetSprite(i)->width) + 1 : 0);
+ *b++ = (byte)((i < 317 || i >= 353) ? GetSprite(i)->width + 1 : 0);
}
for(i=0x1C2; i != 0x2A2; i++) {
- *b++ = (byte)((i < 541 || i >= 577) ? TO_LE16(GetSprite(i)->width) + 1 : 0);
+ *b++ = (byte)((i < 541 || i >= 577) ? GetSprite(i)->width + 1 : 0);
}
}
@@ -1914,9 +1914,9 @@ static void SetCursorSprite(uint cursor)
p = GetSprite(cursor & 0x3FFF);
cv->sprite = cursor;
cv->size.y = p->height;
- cv->size.x = TO_LE16(p->width);
- cv->offs.x = (int16)TO_LE16(p->x_offs);
- cv->offs.y = (int16)TO_LE16(p->y_offs);
+ cv->size.x = p->width;
+ cv->offs.x = p->x_offs;
+ cv->offs.y = p->y_offs;
cv->dirty = true;
}