summaryrefslogtreecommitdiff
path: root/src/newgrf_house.cpp
diff options
context:
space:
mode:
authorbelugas <belugas@openttd.org>2007-11-10 01:17:15 +0000
committerbelugas <belugas@openttd.org>2007-11-10 01:17:15 +0000
commitf55fdfb7c42b2e2e39b165fd17f7671e14516303 (patch)
tree07b6a8f97a15f768d33fc0b7a3405373f3745b3b /src/newgrf_house.cpp
parent3a84801f5563ca73c47c56f9682582abe990abb7 (diff)
downloadopenttd-f55fdfb7c42b2e2e39b165fd17f7671e14516303.tar.xz
(svn r11399) -Feature(ette): transparency settings can now be saved and thus remembered.
-Codechange: Wrap all transparency settings in accessors, hiding the implementation -Change: Clicking "transparent building" menu will toggle Houses And Trees only. The other options can be used in the transparency gui. Initial patch by Smatz (FS#1349), with some rework by BigBB and your humble servant.
Diffstat (limited to 'src/newgrf_house.cpp')
-rw-r--r--src/newgrf_house.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/newgrf_house.cpp b/src/newgrf_house.cpp
index 568225667..a284abb67 100644
--- a/src/newgrf_house.cpp
+++ b/src/newgrf_house.cpp
@@ -25,6 +25,7 @@
#include "newgrf_town.h"
#include "newgrf_sound.h"
#include "newgrf_commons.h"
+#include "transparency.h"
static BuildingCounts _building_counts;
static HouseClassMapping _class_mapping[HOUSE_CLASS_MAX];
@@ -320,7 +321,7 @@ void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, Ho
if (IS_CUSTOM_SPRITE(image)) image += stage;
- if ((HASBIT(image, SPRITE_MODIFIER_OPAQUE) || !HASBIT(_transparent_opt, TO_HOUSES)) && HASBIT(image, PALETTE_MODIFIER_COLOR)) {
+ if ((HASBIT(image, SPRITE_MODIFIER_OPAQUE) || !IsTransparencySet(TO_HOUSES)) && HASBIT(image, PALETTE_MODIFIER_COLOR)) {
if (pal == 0) {
const HouseSpec *hs = GetHouseSpecs(house_id);
if (HASBIT(hs->callback_mask, CBM_HOUSE_COLOUR)) {
@@ -343,10 +344,10 @@ void DrawTileLayout(const TileInfo *ti, const SpriteGroup *group, byte stage, Ho
ti->x + dtss->delta_x, ti->y + dtss->delta_y,
dtss->size_x, dtss->size_y,
dtss->size_z, ti->z + dtss->delta_z,
- HASBIT(_transparent_opt, TO_HOUSES)
+ IsTransparencySet(TO_HOUSES)
);
} else {
- AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, HASBIT(_transparent_opt, TO_HOUSES));
+ AddChildSpriteScreen(image, pal, (byte)dtss->delta_x, (byte)dtss->delta_y, IsTransparencySet(TO_HOUSES));
}
}
}