diff options
author | frosch <frosch@openttd.org> | 2008-02-15 18:40:42 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2008-02-15 18:40:42 +0000 |
commit | a40d761d7fc608359b46694f7259c2699ef8cf0c (patch) | |
tree | 2cd7d2f6b962e9d7a99091f185e1a5aa591f0784 /src/newgrf.cpp | |
parent | fd0f57a79485641b632da4525e28ae397c892e54 (diff) | |
download | openttd-a40d761d7fc608359b46694f7259c2699ef8cf0c.tar.xz |
(svn r12149) -Codechange: Merge 'ground_sprite' and 'ground_pal' of DrawTileSprites into one PalSpriteID
Diffstat (limited to 'src/newgrf.cpp')
-rw-r--r-- | src/newgrf.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/src/newgrf.cpp b/src/newgrf.cpp index b054dba8e..f18e900e2 100644 --- a/src/newgrf.cpp +++ b/src/newgrf.cpp @@ -929,24 +929,24 @@ static bool StationChangeInfo(uint stid, int numinfo, int prop, byte **bufp, int uint seq_count = 0; dts->seq = NULL; - dts->ground_sprite = grf_load_word(&buf); - dts->ground_pal = grf_load_word(&buf); - if (dts->ground_sprite == 0) continue; - if (HasBit(dts->ground_pal, 15)) { - ClrBit(dts->ground_pal, 15); - SetBit(dts->ground_sprite, SPRITE_MODIFIER_USE_OFFSET); + dts->ground.sprite = grf_load_word(&buf); + dts->ground.pal = grf_load_word(&buf); + if (dts->ground.sprite == 0) continue; + if (HasBit(dts->ground.pal, 15)) { + ClrBit(dts->ground.pal, 15); + SetBit(dts->ground.sprite, SPRITE_MODIFIER_USE_OFFSET); } - if (HasBit(dts->ground_pal, 14)) { - ClrBit(dts->ground_pal, 14); - SetBit(dts->ground_sprite, SPRITE_MODIFIER_OPAQUE); + if (HasBit(dts->ground.pal, 14)) { + ClrBit(dts->ground.pal, 14); + SetBit(dts->ground.sprite, SPRITE_MODIFIER_OPAQUE); } - if (HasBit(dts->ground_sprite, 15)) { - ClrBit(dts->ground_sprite, 15); - SetBit(dts->ground_sprite, PALETTE_MODIFIER_COLOR); + if (HasBit(dts->ground.sprite, 15)) { + ClrBit(dts->ground.sprite, 15); + SetBit(dts->ground.sprite, PALETTE_MODIFIER_COLOR); } - if (HasBit(dts->ground_sprite, 14)) { - ClrBit(dts->ground_sprite, 14); - SetBit(dts->ground_sprite, PALETTE_MODIFIER_TRANSPARENT); + if (HasBit(dts->ground.sprite, 14)) { + ClrBit(dts->ground.sprite, 14); + SetBit(dts->ground.sprite, PALETTE_MODIFIER_TRANSPARENT); } while (buf < *bufp + len) { @@ -2652,27 +2652,27 @@ static void NewSpriteGroup(byte *buf, int len) group->g.layout.dts = CallocT<DrawTileSprites>(1); /* Groundsprite */ - group->g.layout.dts->ground_sprite = grf_load_word(&buf); - group->g.layout.dts->ground_pal = grf_load_word(&buf); + group->g.layout.dts->ground.sprite = grf_load_word(&buf); + group->g.layout.dts->ground.pal = grf_load_word(&buf); /* Remap transparent/colour modifier bits */ - if (HasBit(group->g.layout.dts->ground_sprite, 14)) { - ClrBit(group->g.layout.dts->ground_sprite, 14); - SetBit(group->g.layout.dts->ground_sprite, PALETTE_MODIFIER_TRANSPARENT); + if (HasBit(group->g.layout.dts->ground.sprite, 14)) { + ClrBit(group->g.layout.dts->ground.sprite, 14); + SetBit(group->g.layout.dts->ground.sprite, PALETTE_MODIFIER_TRANSPARENT); } - if (HasBit(group->g.layout.dts->ground_sprite, 15)) { - ClrBit(group->g.layout.dts->ground_sprite, 15); - SetBit(group->g.layout.dts->ground_sprite, PALETTE_MODIFIER_COLOR); + if (HasBit(group->g.layout.dts->ground.sprite, 15)) { + ClrBit(group->g.layout.dts->ground.sprite, 15); + SetBit(group->g.layout.dts->ground.sprite, PALETTE_MODIFIER_COLOR); } - if (HasBit(group->g.layout.dts->ground_pal, 14)) { - ClrBit(group->g.layout.dts->ground_pal, 14); - SetBit(group->g.layout.dts->ground_sprite, SPRITE_MODIFIER_OPAQUE); + if (HasBit(group->g.layout.dts->ground.pal, 14)) { + ClrBit(group->g.layout.dts->ground.pal, 14); + SetBit(group->g.layout.dts->ground.sprite, SPRITE_MODIFIER_OPAQUE); } - if (HasBit(group->g.layout.dts->ground_pal, 15)) { + if (HasBit(group->g.layout.dts->ground.pal, 15)) { /* Bit 31 set means this is a custom sprite, so rewrite it to the * last spriteset defined. */ - SpriteID sprite = _cur_grffile->spriteset_start + GB(group->g.layout.dts->ground_sprite, 0, 14) * sprites; - SB(group->g.layout.dts->ground_sprite, 0, SPRITE_WIDTH, sprite); - ClrBit(group->g.layout.dts->ground_pal, 15); + SpriteID sprite = _cur_grffile->spriteset_start + GB(group->g.layout.dts->ground.sprite, 0, 14) * sprites; + SB(group->g.layout.dts->ground.sprite, 0, SPRITE_WIDTH, sprite); + ClrBit(group->g.layout.dts->ground.pal, 15); } group->g.layout.dts->seq = CallocT<DrawTileSeqStruct>(num_sprites + 1); |