Skip to content

Commit ed8a6e6

Browse files
authored
Merge pull request #2178 from Semphriss/tilemap_light_tint
Tilemap tint also affect their lighting
2 parents f85adf9 + ac2d85b commit ed8a6e6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/object/tilemap.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ class TileMap final :
192192
Destination opacity will be reached after @c seconds seconds. Doesn't influence solidity. */
193193
void tint_fade(const Color& new_tint, float seconds = 0);
194194

195+
Color get_current_tint() const { return m_current_tint; }
196+
195197
/** Instantly switch tilemap's opacity to @c alpha. Also influences solidity. */
196198
void set_alpha(float alpha);
197199

src/supertux/sector.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,13 +686,13 @@ Sector::convert_tiles2gameobject()
686686
&& (tm.get_tile(x, y-1).get_attributes() != attributes || y%3 == 0)) {
687687
float pseudo_rnd = static_cast<float>(static_cast<int>(pos.x) % 10) / 10;
688688
add<PulsingLight>(center, 1.0f + pseudo_rnd, 0.8f, 1.0f,
689-
Color(1.0f, 0.3f, 0.0f, 1.0f));
689+
(Color(1.0f, 0.3f, 0.0f, 1.0f) * tm.get_current_tint()).validate());
690690
}
691691
} else {
692692
// torch
693693
float pseudo_rnd = static_cast<float>(static_cast<int>(pos.x) % 10) / 10;
694694
add<PulsingLight>(center, 1.0f + pseudo_rnd, 0.9f, 1.0f,
695-
Color(1.0f, 1.0f, 0.6f, 1.0f));
695+
(Color(1.0f, 1.0f, 0.6f, 1.0f) * tm.get_current_tint()).validate());
696696
}
697697
}
698698
}

0 commit comments

Comments
 (0)