68335 Commits

Author SHA1 Message Date
Charles Dang
7fac80f586 Story Viewer: added sound and music handling 2017-04-06 14:18:51 +11:00
Celtic Minstrel
30447aa7f7 Make the fallback() FormulaAI action transfer control only until end of turn 2017-04-05 22:25:13 -04:00
Charles Dang
0fe6c32951 Small fixup to 5efc6a807f06
Forgot that using a static lambda w/ name capture wouldn't work since 'name' is different every draw.
2017-04-06 09:43:39 +11:00
Charles Dang
5efc6a807f GUI2/Canvas: cleaned up some formatting 2017-04-06 09:36:13 +11:00
Charles Dang
733e8db8a2 Story Viewer: implement correct location calculation for floating images 2017-04-06 09:06:02 +11:00
Charles Dang
8b14059e8b GUI2/Canvas: added override specifiers 2017-04-06 09:04:39 +11:00
Charles Dang
c8ac77da42 GUI2/Canvas: implement WFL action context
Right now this is only for the image shape, but it can be expanded later.
2017-04-06 09:04:21 +11:00
Jyrki Vesterinen
9a09e2b783 Fix wrong add-on often being selected after install/uninstall
The problem was that reloading the add-on list invalidated the string
reference. Fixed by receiving the add-on ID by value instead.

I also fixed that status and type filters weren't honored after reloading
the list.
2017-04-05 20:11:27 +03:00
Celtic Minstrel
36dbd7cf02 Fix garbage showing up in WFL stack traces 2017-04-04 14:34:33 -04:00
Charles Dang
cd0e015a8d Story Viewer: implemented floating image handling 2017-04-05 03:15:57 +11:00
Jyrki Vesterinen
3e0a22ec9f Remove the Debug_with_VLD configuration from the Visual Studio project
No one has used the configuration for a long time. In addition, the code
specific to that configuration was removed in commit 19e0d86e6dc3387196d8c2a8b5236b0828d97178:
after that, the configuration no longer had any differences relative to
Debug.
2017-04-04 19:06:09 +03:00
Charles Dang
8fe671481a Added missing override specifiers 2017-04-04 21:14:14 +11:00
Charles Dang
ff38db42ab Small fixup to c4064f6
[ci skip]
2017-04-04 21:12:12 +11:00
Charles Dang
2304148302 Use emplace_back in cases of push_back + config_of
Again, to make use of the move ctor.
2017-04-04 21:10:43 +11:00
Charles Dang
c4064f68f6 GUI2: deployed map (and minor vector) emplace where appropriate
Only includes at one or two uses of vector::emplace
2017-04-04 21:09:29 +11:00
Celtic Minstrel
1216adb837 Fix potential access to invalid memory in FormulaAI 2017-04-04 04:35:27 -04:00
Celtic Minstrel
56b26d2616 Typo fixes 2017-04-04 04:35:27 -04:00
Charles Dang
f8d13b3f56 GUI2: deployed emplace_back en-masse where appropriate
Note that like in 8bf345c, using emplace_back with config_of doesn't actually allow for in-place construction,
but does allow for use of the move ctor, which is more efficient.
2017-04-04 18:41:46 +11:00
Charles Dang
8bf345cb4f GUI2/Canvas: use emplace_back when constructing shapes 2017-04-04 17:51:18 +11:00
Charles Dang
ee454a8f54 Marked a few things as static
[ci skip]

Probably not necessary, but it makes their status clearer.
2017-04-04 17:26:21 +11:00
Charles Dang
19e0d86e6d Removed some Visual Leak Detector-related code
[ci skip]

These should really be included only locally when testing, if anyone happens to use that tool.
2017-04-04 17:25:42 +11:00
Celtic Minstrel
aca6cae04b Refactored variant_iterator implementation
This generalizes the iterator interface beyond only TYPE_LIST and TYPE_MAP. The new implementation also
makes TYPE_CALLABLE iterable.
2017-04-04 16:04:10 +11:00
Charles Dang
30e0f14863 Updated ancient Copyright notices
[ci ckip]

Silver Tree was an ancient project of Dave's. I've updated the notices with his permission.
2017-04-04 11:25:05 +11:00
Jyrki Vesterinen
d6efed0939 Fix build of unit tests 2017-04-03 20:00:47 +03:00
Charles Dang
dcec01b812 Fixup 48d111a 2017-04-04 01:29:39 +11:00
Celtic Minstrel
bcb014c931 Don't use virtual inheritance for variant value hierarchy 2017-04-03 10:03:08 -04:00
Celtic Minstrel
48d111aef4 Handle the unlikely case of null callables in variant_callable 2017-04-03 10:03:06 -04:00
Celtic Minstrel
e8dc9a37e1 Minor cleanup of formula call stack manager 2017-04-03 10:03:05 -04:00
Charles Dang
2181493559 YOU get an override specifier and YOU get an override specifier and YOU get an override specifier 2017-04-04 00:35:58 +11:00
Charles Dang
b00ad5044a Added more of the million override specifiers the AI code needs 2017-04-04 00:09:03 +11:00
Charles Dang
6687ac5436 Added more override specifiers 2017-04-03 23:02:15 +11:00
Celtic Minstrel
ee36b6c1d2 Fix formula tests 2017-04-03 07:59:41 -04:00
Celtic Minstrel
cf73c8dca4 Fix GUI2 test 2017-04-03 07:56:09 -04:00
Charles Dang
a736f8714e Deployed override keyword in formula_callable derived classes 2017-04-03 22:22:34 +11:00
Charles Dang
488f953578 Use emplace_back in formula_callable::add_input 2017-04-03 21:48:13 +11:00
Charles Dang
92d0be3941 Made formula_callable::get_inputs and add_input take a reference instead of a pointer 2017-04-03 21:37:58 +11:00
Charles Dang
766008978f Bunch of formula code cleanup, mostly formatting and moving stuff around
Includes a few minor syntax changes such as range-for deployment.

Also moves the implementation of formula_callable::get_value and various map_formula_callable functions to their
appropriate places.
2017-04-03 21:15:06 +11:00
Celtic Minstrel
e6045b17c6 Rename game_logic namespace to wfl and move variant class into it 2017-04-03 04:31:38 -04:00
Charles Dang
fd63d06d89 Moved common functions in variant_integer and variant_decimal to a common base class 2017-04-03 17:16:32 +11:00
Charles Dang
e1e9cf6b4f Removed some typedefs we shouldn't really be using 2017-04-03 16:55:49 +11:00
Celtic Minstrel
651861d2f5 Fix variant::operator< not producing a strict ordering 2017-04-03 01:32:54 -04:00
Celtic Minstrel
f12696d3d2 Fix bug in formula debugger
The debugger used a deque, but added elements to it while iterating over it.
Since it didn't rely on the random access property, I simply replaced it with list.

Also, there was an incorrect use of erase().
2017-04-03 16:08:29 +11:00
Celtic Minstrel
aedf953d28 Implement WFL function symbol table inheritance
This also adds a new intermediary "action" function table between the
FormulaAI function table and the builtins function table.

This "actions" function table could be used in other areas of the code
where action objects are desired, for example in scenario events or
in the GUI2 Canvas.
2017-04-03 16:08:29 +11:00
Celtic Minstrel
c2ba1c5c6f Generalizing the FAI concept of action objects 2017-04-03 16:08:29 +11:00
Matthias Krüger
f6800c6025 floating label: remove dead code. Found by cppcheck.
[src/floating_label.cpp:261]: (style) Condition 'screen!=nullptr' is always false
[src/floating_label.cpp:281]: (style) Condition 'screen!=nullptr' is always false
2017-04-03 06:26:15 +11:00
Charles Dang
0af91c4990 Avoid unnecessary copying when fetching variant value type
With a simple enum it would be acceptable to create a new copy every time this is called. However, given that VARIANT_TYPE
is a more complex struct generated yb MAKE_ENUM, it makes sense to keep the creation/copying to a minimum.
2017-04-03 04:39:22 +11:00
Celtic Minstrel
d2caa16515 Swap the arguments to variant::to_debug_string
The seen stack is an implementation detail that should generally only be
non-null when called recursively from the implementation, so it makes
more sense for it to be the second argument rather than the first.

I did not swap the arguments for variant_value_base::get_debug_string,
because that's entirely internal anyway so it doesn't really matter.
2017-04-02 12:05:08 -04:00
mattsc
35917891e9 Update Xcode project 2017-04-02 07:52:37 -07:00
Jyrki Vesterinen
27817d2f4a Fix build with Visual Studio 2017-04-02 16:36:28 +03:00
Jyrki Vesterinen
a37ce62f30 Revert "Refactored handling of the callable variant debug stack"
This reverts commit 725bd6291f33928d625535f644fe0b1e88774090.

Xcode doesn't support thread local variables until Xcode 8, and Visual
Studio doesn't allow thread-local non-POD objects until Visual Studio
2015. Because it's desirable to keep
variant_callable::get_debug_string() thread-safe, it's best to revert to
the previous implementation that explicitly passes the call stack as a
function parameter.
2017-04-02 16:01:47 +03:00