diff options
author | tron <tron@openttd.org> | 2004-11-22 11:01:30 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2004-11-22 11:01:30 +0000 |
commit | 8a3d7cce1c94fd12a4c05a1672868c56c7ff0d14 (patch) | |
tree | 9f598bd9e7fb89af2cdf88e9ef08686b7681ecee /town_cmd.c | |
parent | a744e8e375d2ac6da60fbd3607ee88f37a285ff5 (diff) | |
download | openttd-8a3d7cce1c94fd12a4c05a1672868c56c7ff0d14.tar.xz |
(svn r760) Replace some bit-juggling with bit fields
Diffstat (limited to 'town_cmd.c')
-rw-r--r-- | town_cmd.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/town_cmd.c b/town_cmd.c index 7174d454c..4536c1541 100644 --- a/town_cmd.c +++ b/town_cmd.c @@ -24,8 +24,10 @@ typedef struct DrawTownTileStruct { uint32 sprite_1; uint32 sprite_2; - byte subtile_xy; - byte width_height; + byte subtile_x:4; + byte subtile_y:4; + byte width:4; + byte height:4; byte dz; byte proc; } DrawTownTileStruct; @@ -82,10 +84,10 @@ static void DrawTile_Town(TileInfo *ti) image = (image & 0x3FFF) | 0x3224000; AddSortableSpriteToDraw(image, - ti->x | (dcts->subtile_xy>>4), - ti->y | (dcts->subtile_xy&0xF), - (dcts->width_height>>4)+1, - (dcts->width_height&0xF)+1, + ti->x + dcts->subtile_x, + ti->y + dcts->subtile_y, + dcts->width + 1, + dcts->height + 1, dcts->dz, z); |