66625 Commits

Author SHA1 Message Date
Celtic Minstrel
00e412f3af Update XCode project (and minor comment fixups) 2016-10-17 23:23:40 -04:00
Charles Dang
2640caa16a Updated CB projectfile for Lua upgrade
The option -U__STRICT_ANSI__ was required to get this building (see http://stackoverflow.com/a/22167294).
There remain some warnings that need to be squashed.
2016-10-18 14:00:30 +11:00
Charles Dang
e8a499fcec Merge pull request #822 from GregoryLundberg/GL_Upgrade_Lua
Upgrade to Lua 5.3.3+
2016-10-18 12:58:12 +11:00
mattsc
1bed30c8c3 High XP Attack CA: respect the attacks aspect 2016-10-17 17:59:03 -07:00
mattsc
a333b9a5b7 High XP Attack CA: correctly deal with hidden and petrified units 2016-10-17 17:59:03 -07:00
mattsc
12b03397a9 TRoW S15: make custom AI robust against ambushes 2016-10-17 17:59:03 -07:00
mattsc
d99ee0fc88 Lurkers MAI test scenario: keep side leaders hidden after reload 2016-10-17 17:59:02 -07:00
mattsc
ba6973f543 High XP Attack CA test scenario: use new syntax for [option] 2016-10-17 17:59:02 -07:00
Chris Beck
30b8a2c036 attempt to fix #25192
ubsan is reporting that a reference is binding to nullptr here, it seems
likely that the font pr caused bad behavior when the ttext object is
empty. this should hopefully correct it
2016-10-17 18:56:32 -04:00
Chris Beck
37bef71f7c add code comment about width calculation 2016-10-17 18:36:32 -04:00
Chris Beck
d08991db34 fixup ctor when pango version is very old
this would not have compiled i think
2016-10-17 18:32:59 -04:00
Nils Kneuper
39893c21d8 fixed players_changelog formatting to "old style" 2016-10-17 23:59:24 +02:00
Nils Kneuper
48325a2b46 updated Finnish and Russian translation 2016-10-17 23:59:24 +02:00
Celtic Minstrel
4f8d99f96b AI Attacks Aspect: Better exclusion of invalid units
Previously the aspect did not check whether a potential attacker belongs to the AI's side,
or whether a potential target is an enemy. This generally isn't a problem, but should probably
be fixed anyway. In particular, it affects the new ai.aspects.attacks result.
2016-10-17 16:26:26 -04:00
Celtic Minstrel
e81131fcc5 Add deprecation messages for old AI aspect fetchers
This commit also updates uses of these fetchers in mainline Lua code.
2016-10-17 14:24:51 -04:00
Celtic Minstrel
ce4fd8a14d Lua: Make ai.aspects.attacks return only the units rather than the attack analysis
ai.get_attacks() still returns the attack analysis

Also fix a minor issue with ai.aspects.advancements
2016-10-17 13:56:39 -04:00
Jyrki Vesterinen
bb157f9fa3 Fix build with Visual Studio 2016-10-17 19:45:19 +03:00
Gregory A Lundberg
ccc7d730f7 Wrote Markdown instructions
Documented the basic process used to install Lua 5.3.3
2016-10-17 11:33:30 -05:00
Gregory A Lundberg
fc6774289e Upgrade deprecated Lua
loadstring was removed, load does the same thing.
atan2 was remvoed, atan works instead
2016-10-17 10:34:43 -05:00
Gregory A Lundberg
a90ef4a1cb Fix Travis
test/test_lua no longer applies

All it did was check rounding coming from Lua matched the expected values.

You can no long obtain an integer value from a Lua NUMBER (float), unless that float value has no fractional part and is in the range of valid integers. To obtain a rounded value, instead, use luaL_checknumber to obtain the float value and round it as needed (with a cast, floor or ceil, usually) in your program.
2016-10-17 10:34:43 -05:00
GregoryLundberg
8839a5ee8e Only on gcc
Use #if guard to prevent gcc pragma being seen elsewhere.
2016-10-17 10:34:43 -05:00
GregoryLundberg
ecdfb81d78 Use static cast
The lua_toint macro was deprecated for Lua 5.3.3; originally, Wesnoth changed the macro to use a static_cast<int>.

After upgrading to the lua_tointeger function, add the static_cast<int> at each call site to suppress warnings about possible loss of precision due to defining LUA_INTEGER as long long.
2016-10-17 10:34:43 -05:00
Gregory A Lundberg
f97436b96e Update COPYRIGHT 2016-10-17 10:34:43 -05:00
Gregory A Lundberg
757ffc9e44 README is ancient 2016-10-17 10:34:42 -05:00
Gregory A Lundberg
3f22ff8adf changelog 2016-10-17 10:34:42 -05:00
Gregory A Lundberg
fb82f6a259 Add Lua utf8 library
Safe for scripting. Let the users have it.
2016-10-17 10:34:42 -05:00
Gregory A Lundberg
0c13f7ea20 Update project files
Update for Visual Studio, CMake and SCons.
2016-10-17 10:34:42 -05:00
Gregory A Lundberg
82661505d1 Apply Lua.org patch
Lua can generate wrong code in functions with too many constants.

reported by Marco Schöpl on 17 Jul 2016. existed since 5.3.3.

Example:
    See http://lua-users.org/lists/lua-l/2016-07/msg00303.html.
2016-10-17 10:34:42 -05:00
Gregory A Lundberg
ca883fe7bf Apply Lua.org patch
Checking a format for os.date may read pass the format string.

reported by Nagaev Boris on 10 Jul 2016. existed since 5.3.3.

Example:
    This bug does not seem to happen with regular compilers. It needs an "interceptor" 'memcmp' function that continues reading memory after a difference is found.
2016-10-17 10:34:42 -05:00
Gregory A Lundberg
63be2a0d2e Apply Lua.org patch
Expression list with four or more expressions in a 'for' loop can crash the interpreter.

reported by Marco Schöpl on 17 Jun 2016. existed since 5.2.

Example:
    -- the next loop will probably crash the interpreter
    repeat until load "for _ in _,_,_,_ do local function _() end"
2016-10-17 10:34:41 -05:00
Gregory A Lundberg
90d48e3725 -Wpermissive reports two errors
Reported upstream.
2016-10-17 10:34:41 -05:00
Gregory A Lundberg
475c31b10e Enable Lua 5.1 and 5.2 compatability 2016-10-17 10:34:41 -05:00
Gregory A Lundberg
841d17af31 Replace Lua 5.2.3 with Lua 5.3.3 2016-10-17 10:34:41 -05:00
Gregory A Lundberg
8e7b28cde2 Move local changes to proper place
luaconf.h provides a place for us to make changes, avoiding the need to change the original definitions. Move everything down there. This encompases the following changes:

1) Disable compatibility with old versions of Lua in the C++. Compatability is maintained only for the Lua runtime. Only one correction was needed: in application_lua_kernel.cpp

2) Change how the backpointer is defined, for forward compatability with Lua 5.3. This effected only one line: in lua_kernel_base.cpp. Using the Lua 5.3 macro caused a GCC warning, suppressed it for that line.

3) Certain Windows-only features are no longer available in the Lua runtime. These features are all in the Lua io module, which we don't allow access to, so this is a non-change for the runtime.

4) Lua will behave as if it is a standard C environment. This, again, mainly effects the Windows environment and features we don't allow access to in the runtime.
2016-10-17 10:34:41 -05:00
Gregory A Lundberg
f00357d7db Revert change
Rather than change the source, if the proplem still exists, use a compiler flag to suppress the messages.

This reverts the commit

commit 12a7a5a1e0fee21e0c88042c6b3c7be1c73f30e3
Author: Mark de Wever <koraq@xs4all.nl>
Date:   Sun Oct 6 17:35:11 2013 +0200

    Remove unused const variables.

    The issue was detected by the upcomming Clang 3.4.
2016-10-17 10:34:41 -05:00
Gregory A Lundberg
b8244b0694 Correct the calls instead
Do not change the released Lua source code. Lua is written as standard C, but we compile it as C++ so we can use exceptions. Change the call sites to avoid the warnings about using a C cast instead of static_cast<int>().

NB: The changes to Wesnoth C++ code will be required to upgrade to Lua 5.3, anyway.

This reverts:

commit cee3ab208401a439e15004b79b4fa5c5bf9a9e5a
Author: Mark de Wever <koraq@xs4all.nl>
Date:   Sun Feb 5 19:55:32 2012 +0000

    Fix compiler warnings.
2016-10-17 10:34:41 -05:00
Gregory A Lundberg
f88c3b22b8 Refactor lua_jailbreak_exception
Revert the changes to the stock Lua source code and move them into the Wesnoth-specific header.
2016-10-17 10:34:41 -05:00
GregoryLundberg
160a4611d6 Use strcmp instead of strcoll
This works for Visual Studio, CMake and SCons.
Still need to get it working on: CodeBlocks and Xcode
2016-10-17 10:34:41 -05:00
Charles Dang
42b684b124 Chatbox: slight room joined/whisper started message formatting 2016-10-18 02:26:44 +11:00
Charles Dang
497dcac47a Chatbox: allow new rooms to specify if they can be closed or not
This removes the hardcoded "room name is 'lobby" predicate.
2016-10-18 02:15:54 +11:00
Jyrki Vesterinen
7edad9669a Update Visual Studio project 2016-10-17 17:14:58 +03:00
Charles Dang
1964d71023 Updated GUI2 schema for fb6c85e70b0c 2016-10-18 00:59:22 +11:00
Charles Dang
fb6c85e70b Added interface for using a light font variation (still not functional) 2016-10-17 23:28:53 +11:00
Charles Dang
ed6758d933 Added Lato light variations 2016-10-17 23:28:52 +11:00
gfgtdf
ac9729f612 fix assertion failure when shroud/FoW update undelayed
https://gna.org/bugs/?25106

was broken in ae19588a37
2016-10-17 14:24:33 +02:00
Wedge009
7b42ba2bea Add some missing Release build locations.
Correct build location for sp_options_configure.cpp.
2016-10-17 23:00:59 +11:00
Charles Dang
e4640ddc17 Some constructor formatting 2016-10-17 22:58:34 +11:00
Charles Dang
ac17531476 Restore bitwise checks for font style (fixup 188231cd030e) 2016-10-17 21:33:43 +11:00
Charles Dang
188231cd03 Refactored SDL_TTF constants out of ttext
Do note that for some reason using the default_bold label definition with this change made an underline
appear. I changed the style checks to use == instead of & (bitwise AND) and that fixed the problem. If
that's wrong, someone feel free to fix that.
2016-10-17 20:53:48 +11:00
Charles Dang
8a9d546e27 Slight contrast bump to swamp water 2016-10-17 18:22:02 +11:00