# HG changeset patch # User tron # Date 1132142106 0 # Node ID 4173d9a0a27ef10fcc6cf819d9b0ff19e68d3554 # Parent e179c95e54647b8ad793fbbc7ccf336d6d0edd8f (svn r3195) Use bitfields instead of explicit shifting/masking diff -r e179c95e5464 -r 4173d9a0a27e industry_cmd.c --- a/industry_cmd.c Wed Nov 16 11:52:21 2005 +0000 +++ b/industry_cmd.c Wed Nov 16 11:55:06 2005 +0000 @@ -48,8 +48,10 @@ 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; } DrawIndustryTileStruct; @@ -377,10 +379,10 @@ if (_display_opt & DO_TRANS_BUILDINGS) MAKE_TRANSPARENT(image); AddSortableSpriteToDraw(image, - ti->x | (dits->subtile_xy>>4), - ti->y | (dits->subtile_xy&0xF), - (dits->width_height>>4)+1, - (dits->width_height&0xF)+1, + ti->x + dits->subtile_x, + ti->y + dits->subtile_y, + dits->width + 1, + dits->height + 1, dits->dz, z); diff -r e179c95e5464 -r 4173d9a0a27e table/industry_land.h --- a/table/industry_land.h Wed Nov 16 11:52:21 2005 +0000 +++ b/table/industry_land.h Wed Nov 16 11:55:06 2005 +0000 @@ -1,6 +1,6 @@ /* $Id$ */ -#define M(s1,s2,sx,sy,w,h,dz,p) {s1,s2,(sx<<4)|sy,((w-1)<<4)|(h-1),dz,p} +#define M(s1, s2, sx, sy, w, h, dz, p) { s1, s2, sx, sy, w - 1, h - 1, dz, p } static const DrawIndustryTileStruct _industry_draw_tile_data[700] = { M( 0xf54, 0x7db, 7, 0, 9, 9, 10, 0),