comparison src/industry_cmd.cpp @ 7333:7110c41ab174 draft

(svn r10696) -Codechange: remove duplication of the "make sprite transparent" code.
author rubidium <rubidium@openttd.org>
date Thu, 26 Jul 2007 14:07:11 +0000
parents d2b2514b2a5f
children e9bc6de8292f
comparison
equal deleted inserted replaced
7332:4be280f53ee9 7333:7110c41ab174
297 DrawGroundSprite(image, pal); 297 DrawGroundSprite(image, pal);
298 298
299 /* Add industry on top of the ground? */ 299 /* Add industry on top of the ground? */
300 image = dits->building.sprite; 300 image = dits->building.sprite;
301 if (image != 0) { 301 if (image != 0) {
302 if (HASBIT(_transparent_opt, TO_INDUSTRIES)) { 302 AddSortableSpriteToDraw(image,
303 SETBIT(image, PALETTE_MODIFIER_TRANSPARENT); 303 (HASBIT(image, PALETTE_MODIFIER_COLOR) && dits->building.pal == PAL_NONE) ? GENERAL_SPRITE_COLOR(ind->random_color) : dits->building.pal,
304 pal = PALETTE_TO_TRANSPARENT;
305 } else if (HASBIT(image, PALETTE_MODIFIER_COLOR) && dits->building.pal == PAL_NONE) {
306 pal = GENERAL_SPRITE_COLOR(ind->random_color);
307 } else {
308 pal = dits->building.pal;
309 }
310
311 AddSortableSpriteToDraw(image, pal,
312 ti->x + dits->subtile_x, 304 ti->x + dits->subtile_x,
313 ti->y + dits->subtile_y, 305 ti->y + dits->subtile_y,
314 dits->width + 1, 306 dits->width + 1,
315 dits->height + 1, 307 dits->height + 1,
316 dits->dz, 308 dits->dz,
317 z); 309 z,
310 HASBIT(_transparent_opt, TO_INDUSTRIES));
318 311
319 if (HASBIT(_transparent_opt, TO_INDUSTRIES)) return; 312 if (HASBIT(_transparent_opt, TO_INDUSTRIES)) return;
320 } 313 }
321 314
322 { 315 {