54 Commits

Author SHA1 Message Date
Mark de Wever
43b71f2ff0 New year copyright update. 2013-01-01 09:22:03 +00:00
Ignacio R. Morelle
6ca69b2df5 New year copyright update 2012-01-07 02:35:17 +00:00
Ali El Gariani
62cd03c405 Clean get_time_of_day function names:
get_time_of_day() = global ToD

get_time_of_day(loc) = local ToD using ToD areas

get_illuminated_time_of_day(loc) = local ToD using ToD areas and illumination
2011-12-12 03:02:01 +00:00
Ali El Gariani
4d0972b7c4 Use better parameters order for get_time_of_day() 2011-12-11 22:02:42 +00:00
Ali El Gariani
86d535e36e Optimize get_time_of_day()
Split in 2 functions depending if illumination is needed.

This allows to use reference for the common case.
2011-12-11 22:02:39 +00:00
Alexander van Gessel
81e0a2007f Revert token t_token commits from 2011-09-08T19:15:40Z!thonsew@yahoo.com on. 2011-10-10 03:43:29 +01:00
Thonsew
787e123761 Updated tod_manager to use t_tokens. 2011-09-08 19:16:57 +00:00
Thonsew
fcba175936 Updated terrain_filter to
1. Use t_token in place of string literals to improve speed

2. Use unordered_set in place of std::set to improve terrain filter
lookup times.
2011-09-08 19:16:12 +00:00
Thonsew
14a2e2bec1 Fix for bug #18017 FADE_TO_BLACK and local tod don't play nice.
Implemented a local per tile color adjustment to go along with the
local per tile time of day (tod) adjustment, during fades.  Also fixed
scaling of tod lightmap, which was issuing errors.
2011-08-06 11:32:19 +00:00
Mark de Wever
1d0448c472 Pass parameter by const ref instead of const value.
Issue found by cppcheck.
2011-07-07 19:15:58 +00:00
Anonymissimus
041ce87a7a make one of the tod getters private and rename it 2011-06-08 19:00:03 +00:00
Anonymissimus
cceff3a8fd renamed a tod getter function 2011-06-08 18:59:59 +00:00
Anonymissimus
398b6cf4bb concentrated some time of day getting variants for a lua tod getter 2011-06-08 18:59:51 +00:00
Anonymissimus
c2336806ec removed unused function tod_manager::get_time_of_day_of_next_turn
@Crab: once you need this function just revert the commit;
however, the < in the comparison at the start should be > imo
2011-05-28 12:18:09 +00:00
Anonymissimus
88aa3dbc35 improved questionable way of processing turn_at= attribute...
...using silene's config::to_int()

Literal numbers work, variables don't and attempting to support it at
that place is probably a bad idea from the engine point of view and
led to the crash. See e.g. bug #7236, apparently it did never work
well.  wml authors can use modify_turns in prestart for the same
effect (with variable support).

TBH I don't understand why the previous way crashed and this one not.
Converting game_state* into string_map* seems strange enough however.
(fix for bug #11307)
2011-05-24 13:48:48 +00:00
Anonymissimus
fd0a50421d fixed part 5) of bug #16534
(and another mistake in a previous revision of mine)
2011-05-24 13:48:14 +00:00
Sergey Popov
1699ed73b1 Fixed compile warnings. 2011-05-23 11:59:04 +00:00
Anonymissimus
fd053cbdd3 fixed random_start_time=<comma-separated integer list> being treated as
random_start_time=yes

There are major problems related to this function remaining:

- bug #15948

- The start time randomization result gets written into a const
config& in order to sent it to network clients in a MP game.
2011-05-22 21:23:33 +00:00
Anonymissimus
bbf11e0a20 introduced member variable currentTime...
...for all time areas, refactored functions, comments

(fix for bug #17543 and bug #16584)
2011-05-22 21:23:17 +00:00
Iurii Chernyi
fad3df6dda add a function to tod_manager to get time of day...
...at the next turn of a particular enemy team
2011-01-03 16:06:17 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Mark de Wever
9261d4aed5 Remove unneeded includes. 2010-11-21 13:58:08 +00:00
Ali El Gariani
b5a595775c Skip local light calculation on map not using any ToD areas 2010-09-11 00:36:15 +00:00
Ali El Gariani
162fc599fd Fix bug #16584 (Time of day doesn't change in time area) 2010-09-10 01:50:56 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Guillaume Melquiond
a48d16687d Avoided costly roundtrip through strings. 2010-07-22 20:05:55 +00:00
Guillaume Melquiond
ccb8eadb3f Simplified code by changing access to number of turns from relative to absolute. 2010-07-22 20:05:42 +00:00
Ali El Gariani
ffab40fb13 Optimize local ToD access by using reference 2010-07-20 19:46:04 +00:00
Ali El Gariani
569386d5e1 Use default parameter to combine 2 functions 2010-07-20 19:46:01 +00:00
Ali El Gariani
a0fe68705e Remove now unused parameter 2010-07-20 19:45:57 +00:00
Ali El Gariani
2ec0c400f6 Use resources in tod_manager 2010-07-20 19:45:45 +00:00
Ali El Gariani
7a5f83fbf5 return const reference when possible 2010-07-20 19:45:40 +00:00
Ali El Gariani
0398b4fe9a More robust set_time_of_day (always set a valid value) 2010-07-07 12:47:01 +00:00
Ali El Gariani
2e4083d81c Remove one-use-only function 2010-07-07 12:46:46 +00:00
Alexander van Gessel
9464b75ba7 Add [replace_schedule] tag, to replace ToD schedule 2010-04-12 03:45:01 +01:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Mark de Wever
ede9e3b12a Cleanup map_location.hpp. 2009-11-27 23:01:00 +00:00
Eugen Jiresch
b555c8d6a1 added namespace 'savegame' for savegame related code 2009-09-01 12:49:15 +00:00
Mark de Wever
671b0b256c Strip trailing whitespace. 2009-08-29 18:46:38 +00:00
Iurii Chernyi
963f73ff2f renamed tod_manager::is_turns_left to tod_manager::is_time_left 2009-08-21 20:38:50 +00:00
Iurii Chernyi
4319830a5f renamed tod_manager::is_time_not_over() to tod_manager::is_turns_left 2009-08-21 19:52:49 +00:00
Iurii Chernyi
d8e8317150 allow 'time over' handling to take into account...
...the possibility of changing the number of turns in the 'time over'
event handler
2009-08-20 17:20:36 +00:00
Guillaume Melquiond
b181364752 Cleaned code a bit. 2009-07-19 16:30:17 +00:00
Eugen Jiresch
919e8df58e added const modifier to savegame_config::to_config() 2009-06-23 14:05:03 +00:00
Eugen Jiresch
5e331e8542 removed gamestatus member from game_display 2009-06-11 13:53:07 +00:00
Eugen Jiresch
4e3d1f840c added time_of_day_at() to tod_manager (copied from actions.cpp) 2009-06-11 12:48:50 +00:00
Eugen Jiresch
eb792b62ec added tod_manager member to game_display...
...and removed most references to gamestatus in game_display
2009-06-11 11:27:51 +00:00
Eugen Jiresch
3842034843 added assignment operator to tod_manager 2009-06-11 08:36:08 +00:00
Eugen Jiresch
ad65cf8d44 added turn members to tod_manager 2009-06-10 20:50:42 +00:00
Eugen Jiresch
96bae44ec1 removed unnecessary argument from tod_manager::get_previous_time_of_day() 2009-06-10 08:37:46 +00:00