Author: alink
Date: Wed May 13 02:37:32 2009
New Revision: 35615
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35615&view=rev
Log:
Optimize terrain rendering.
An old option allow to use Time-of-Day terrain mask, also affected by local ToD
(like cavern).
But the used ToD function uselessly calculated lawful bonus given by adjacent
units having
the illuminates ability, which was not cheap and done for each hex. Fixed now,
no visible change.
Modified:
trunk/src/game_display.cpp
Modified: trunk/src/game_display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game_display.cpp?rev=35615&r1=35614&r2=35615&view=diff
==============================================================================
--- trunk/src/game_display.cpp (original)
+++ trunk/src/game_display.cpp Wed May 13 02:37:32 2009
@@ -342,11 +342,11 @@
// Draw the time-of-day mask on top of the terrain in the hex.
// tod may differ from tod if hex is illuminated.
- std::string tod_hex_mask =
timeofday_at(status_,units_,loc,get_map()).image_mask;
+ const std::string& tod_hex_mask = status_.get_time_of_day(0,
loc).image_mask;
if(tod_hex_mask1 != NULL || tod_hex_mask2 != NULL) {
drawing_buffer_add(LAYER_TERRAIN_FG, loc, tblit(xpos, ypos,
tod_hex_mask1));
drawing_buffer_add(LAYER_TERRAIN_FG, loc, tblit(xpos, ypos,
tod_hex_mask2));
- } else if(tod_hex_mask != "") {
+ } else if(!tod_hex_mask.empty()) {
drawing_buffer_add(LAYER_TERRAIN_FG, loc, tblit(xpos, ypos,
image::get_image(tod_hex_mask,image::UNMASKED)));
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits