1
0
forked from 0ad/0ad
Commit Graph

5797 Commits

Author SHA1 Message Date
d644845ae5 Fixes Atlas on Linux with SDL2 by reordering OpenGL init, based on patch by yashi, fixes #2847
This was SVN commit r16356.
2015-02-20 05:46:24 +00:00
a5e940430f Suppresses libpng warning "iCCP: known incorrect sRGB profile" by manually handling warning messages (errors still use default handler), fixes #2184
This was SVN commit r16350.
2015-02-17 10:50:19 +00:00
70219ab61f Fixes GLSL terrain decal flicker by initializing normal vectors, fixes #2064
This was SVN commit r16349.
2015-02-17 08:13:24 +00:00
ba210c4d59 Fix c229b46ac2.
This was SVN commit r16343.
2015-02-16 14:38:13 +00:00
c229b46ac2 Move visibility component activation check to C++. Patch by Itms.
This improves performance quite a lot because it avoids a huge number of
calls from C++ to JS. Check the ticket for performance measurements.
Refs #2913

This was SVN commit r16337.
2015-02-14 17:13:50 +00:00
49222a4c6a Fix Windows build
This was SVN commit r16334.
2015-02-14 02:22:22 +00:00
bb9de80dd4 Convert CConsole to take UTF-8 strings.
This avoids vswprintf failures when printing non-ASCII char* strings
from CLogger into the console.

Also convert ScriptInterface::ToString to return UTF-8, to avoid some
utf8_from_wstring calls.

Also remove some unused and redundant CConsole functions.

This was SVN commit r16333.
2015-02-14 01:49:34 +00:00
e06a7b37d8 Convert debug_printf to take UTF-8 strings instead of wchar_t.
This fixes the problem where passing a non-ASCII string to
debug_printf(L"%hs", s) caused vswprintf_s to fail on Linux (because it
doesn't know what encoding the char* is meant to have). Now debug
messages will remain as UTF-8 until they reach the OS.

Fixes #3021.

This was SVN commit r16332.
2015-02-14 01:45:13 +00:00
682a944d7e Little code tweak without performance impact
This was SVN commit r16329.
2015-02-12 23:24:48 +00:00
bd7b07cc80 Make the visibility cache a bit more clever, by making LoS tiles as dirty separately for each player.
It is necessary to rely on shared los masks, else some visibility
updates will be missing.

Refs #2913, see this ticket for a performance graph.

This was SVN commit r16328.
2015-02-12 23:22:29 +00:00
c049b0ae27 Treat \t as whitespace in config files. Fixes #3050.
This was SVN commit r16326.
2015-02-12 17:31:10 +00:00
1e54289aa8 Only check binaries/data for po/pot files.
This was SVN commit r16324.
2015-02-12 00:25:47 +00:00
143e199d45 Add a new function to update the water renderer textures when resizing the renderer window. Patch by pendingchaos.
This fixes #2692 though the same issue might appear in some other cases
(possibly Atlas) and those will have to be checked.

This was SVN commit r16315.
2015-02-10 19:41:29 +00:00
bb99c42aa5 Increase max VBO size back to 4MB.
Some meshes (e.g. pers_gardens_struct with gentangents enabled) have
>32K vertexes, and won't fit in a 2MB VBO. 0ef6c7555e had reduced them
from 4MB to 2MB. So just make the VBOs bigger again, and try not to
worry about the waste of memory.

Fixes #3026, #3042.

This was SVN commit r16309.
2015-02-08 23:39:02 +00:00
f9c95b6953 Do not send gaia stats for rated games.
This was SVN commit r16292.
2015-02-08 01:59:02 +00:00
5e7b55996c Fixes build with libmozjs-31-dev package from Ubuntu PPA. Fixes #3039.
This was SVN commit r16283.
2015-02-07 18:28:44 +00:00
da0f33f137 Reduce drastically the number of mirages by making fogging conditional: entities will be miraged only if their health/resource amount is modified, or if they have a non-gaia owner.
Fixes the animals hidden in the FoW, and adds the missing status bars
for mirages.

Also small cleanup of the code.

Refs #2913

This was SVN commit r16281.
2015-02-07 15:48:32 +00:00
b66465de73 Improve code clarity after 0a53c5e06a by removing a fall-through.
Also fix the indentation to follow the coding conventions.

This was SVN commit r16280.
2015-02-07 15:38:22 +00:00
f6903393bd Add various rotation modes for multiple object selections (individual rotation, global rotation with or without individual rotation).
Patch by trompetin17, fixes #1213

This was SVN commit r16275.
2015-02-06 22:23:50 +00:00
0a53c5e06a Fix hero selection ring not cleared when the unit goes out of the world (when garrisoning for instance).
Patch by trompetin17, fixes #2627.

This was SVN commit r16274.
2015-02-06 20:47:31 +00:00
846fdc1ed8 Provide explicit spezializations of hash_value for CTexturePtr and CTextureProperties. Fixes #3036.
This was SVN commit r16271.
2015-02-06 02:03:20 +00:00
bf6323a71f Amend 7020d17886 and also fix observer mode. Fixes #3032.
This was SVN commit r16267.
2015-02-04 09:20:00 +00:00
53b335f5ae Improve auto-completition of nick names and add it to the in-game chat. Patch by trompetin17. Refs #1767.
This was SVN commit r16261.
2015-02-02 23:44:06 +00:00
e75498a655 Fix d71161fe4c on WxWidgets 2.8
This was SVN commit r16258.
2015-02-02 20:20:37 +00:00
ec7c8f2d65 Move gain config setting retrieval to the sound manager. Fixes #3030.
Also clean up the sound manager a bit.

This was SVN commit r16257.
2015-02-02 13:44:06 +00:00
d71161fe4c Add a list of selected entities, grouped by template.
Patch by trompetin17, fixes #1392

This was SVN commit r16255.
2015-02-01 21:23:06 +00:00
3225e564fe Fix 1564a10120, plus code cleanup
This was SVN commit r16254.
2015-02-01 19:04:21 +00:00
7020d17886 Fix Gaia perspective, in which one could only see entities with a dirty visibility cache.
This was SVN commit r16250.
2015-01-30 18:08:16 +00:00
f52e3ea052 Fix uninitialized variable, fix by trompetin17, fixes #3027.
This was SVN commit r16249.
2015-01-30 17:37:40 +00:00
1564a10120 Move back the computation of most of the visibilities from JS to engine, to improve performance.
Also fix the remaining TODO left by #958, as a use case of the scripted
Visibility component.

Refs #2913, #958.

This was SVN commit r16248.
2015-01-30 15:28:06 +00:00
df2e077870 Trailing spaces cleanup, based on patch by trompetin17, refs #1767.
This was SVN commit r16244.
2015-01-29 16:10:03 +00:00
6a70e3a62f Updates checkrefs.pl to support mod mod and GUI XML change
This was SVN commit r16242.
2015-01-28 03:26:39 +00:00
0ef6c7555e Optimise VBO updates.
Some drivers (at least the Intel drivers on Windows) are slow at
incrementally updating a VBO with hundreds of calls to glBufferSubData
every frame. Performance is significantly better if you use
glBufferData(NULL) to tell it to discard all the previous contents, and
then re-upload all the data at once.

Update CVertexBuffer so that GL_DYNAMIC_DRAW/GL_STREAM_DRAW buffers are
handled with the new mechanism. This requires the caller to hold onto
the backing store so it can be re-uploaded when necessary, and needs a
bit more signalling to indicate exactly what needs uploading.

I see an improvement from roughly 60 to 75 fps on Intel HD Graphics
3000, Windows, 1024x768, Siwa Oasis.

This was SVN commit r16241.
2015-01-28 00:48:00 +00:00
0a34e6106d Improve readability printing a single error message.
This was SVN commit r16237.
2015-01-27 09:14:30 +00:00
ee08dff5ad Updates Windows installer config, making the SM debug dll exclusion more generic
This was SVN commit r16234.
2015-01-26 05:01:53 +00:00
4473ed5c88 glext_funcs: Support glMapBuffer, glMapBufferRange
This was SVN commit r16231.
2015-01-25 16:36:23 +00:00
a8499e89eb Pad vertex data to power-of-two sizes.
This reduces the total number of different vertex sizes in the system,
allowing more data to share a single CVertexBuffer, therefore reducing
the amount of wasted space in each CVertexBuffer and reducing VRAM
usage.

This was SVN commit r16230.
2015-01-25 15:38:51 +00:00
123bab6793 Replace use of safe bool by explicit bool operator.
This was SVN commit r16228.
2015-01-25 03:11:24 +00:00
4c1903500b Switch to std::shared_ptr and std::weak_ptr.
This was SVN commit r16227.
2015-01-25 03:10:58 +00:00
0843100d11 Remove partial emulation of some C++11 features for older compilers.
This was SVN commit r16226.
2015-01-24 20:37:18 +00:00
0261d12727 Remove some checks for usupported VS versions (<2013).
This was SVN commit r16225.
2015-01-24 20:37:16 +00:00
fc902df07c Remove checks for unsupported GCC versions (<4.6).
This was SVN commit r16224.
2015-01-24 20:37:07 +00:00
59503b9ae9 Add basic support for GUI scaling factor, to help with high-res displays (e.g. 4K monitors and 1080p tablets).
Use the config setting "gui.scale = 0.5" to make the GUI bigger.

This was SVN commit r16223.
2015-01-24 20:06:37 +00:00
c976366590 Added a script for i18n maintenance tasks
The script updates the local repository, regenerates the POT files,
downloads the
latest PO files, reverts any change that Pology determines as not
meaningful, and
adds the modified files to the local VCS.

The script does not actually perform the final commit, that is left for
the user.

Ref #2492

This was SVN commit r16222.
2015-01-24 19:57:44 +00:00
67956f969e Make ARRAY_SIZE(pointer) complain in GCC, not just in MSVC.
The ArraySizeDeducer trick has worked since at least GCC 4.4, so it's
fine to rely on it now.

This was SVN commit r16218.
2015-01-24 17:35:25 +00:00
de25e536c3 Update NONCOPYABLE to use C++11 "=delete".
This gives slightly better error messages.

This was SVN commit r16217.
2015-01-24 17:33:49 +00:00
3ce38e536e Update cassert to use C++11 static_assert.
This gives clearer error messages, and simplifies the code.

This was SVN commit r16216.
2015-01-24 17:29:19 +00:00
15e8637b67 Fix build with Visual Studio
I've reverted this workaround before the SM31 commit because I thought
it's only a problem with VS2010. Actually VS2013 still doesn't support
C++11 well enough and still requires the workaround.

Refs #2669, #2462

This was SVN commit r16215.
2015-01-24 16:33:27 +00:00
c02a7e1a7b SpiderMonkey 31 upgrade
This upgrade also introduces exact stack rooting (see to the wiki:
JSRootingGuide) and fixes problems with moving GC. This allows us to
enable generational garbage collection (GGC).
Measurements a few months ago have shown a performance improvement of a
non-visual replay of around 13.5%. This probably varies quite a bit, but
it should be somewhere between 5-20%. Memory usage has also been
improved. Check the forum thread for details.

Thanks to everyone from the team who helped with this directly or
indirectly (review, finding and fixing issues, the required C++11
upgrade, the new autobuilder etc.)! Also thanks to the SpiderMonkey
developers who helped on the #jsapi channel or elsewhere!

Fixes #2462, #2415, #2428, #2684, #1374
Refs #2973, #2669

This was SVN commit r16214.
2015-01-24 14:46:52 +00:00
8f0ace2658 Make Android %ls/%hs workaround work on secure_crt as well as wsecure_crt.
Refs #2996.

This was SVN commit r16210.
2015-01-24 00:22:12 +00:00
4d4ddb5978 Add workaround for Android libc++ swprintf bug.
Based on patch by BogDan. Refs #2996.

This was SVN commit r16209.
2015-01-24 00:20:15 +00:00
8ca674d461 cppformat: Fix Android build.
The NDK only exposes the BSD-style strerror_r, not the GNU-style, so
select the appropriate code path.

This was SVN commit r16208.
2015-01-23 21:15:48 +00:00
2e01b157d6 Fix build error in GLES configurations
This was SVN commit r16207.
2015-01-23 20:54:14 +00:00
c9dee72667 GLES doesn't have glDisable(GL_TEXTURE_2D).
Patch by BogDan. Refs #2996.

This was SVN commit r16206.
2015-01-23 20:40:02 +00:00
8a39ea5543 Avoid misaligned pointer dereferences, which can fail on ARM.
Based on patch by BogDan. Refs #2996.

This was SVN commit r16205.
2015-01-23 20:39:40 +00:00
c9c80a9d94 SDL_SetWindowGammaRamp fails on Android, so don't bother using it.
Based on patch by BogDan. Refs #2996.

This was SVN commit r16204.
2015-01-23 20:39:02 +00:00
ad3e330861 Workaround for limitations of Android's vswprintf implementation.
Based on patch by BogDan. Refs #2996.

This was SVN commit r16203.
2015-01-23 20:38:13 +00:00
b64ff8d09a Remove Android hack to autoload a map.
Patch by BogDan. Refs #2996.

This was SVN commit r16202.
2015-01-23 20:36:52 +00:00
adcd9191a6 Updates Windows installer config for 65cc47f6c0
This was SVN commit r16200.
2015-01-23 03:38:02 +00:00
65cc47f6c0 Deletes unused bundled MSVC runtime libs for old 2005 and 2008 versions.
Removes VC80 manifest info.

This was SVN commit r16199.
2015-01-23 03:21:48 +00:00
f3f2717c66 Fix tests on 32-bit builds.
This was SVN commit r16193.
2015-01-22 21:13:09 +00:00
f350a24c73 Disable "assignment operator could not be generated" warning globally on Windows, since it's never useful.
This was SVN commit r16192.
2015-01-22 21:09:33 +00:00
d7926eb612 Add basic tests for %s/%hs/%ls in sprintf_s, swprintf_s.
This was SVN commit r16191.
2015-01-22 20:39:53 +00:00
ef2a358f87 Remove sys_vswprintf.
The implementation on Windows was gross. The only user was CLogger,
which no longer uses it.

Also fix vswprintf_s to handle truncated output correctly (by returning
"") on Linux, now that CLogger is no longer relying on the buggy
behaviour.

This was SVN commit r16190.
2015-01-22 20:39:28 +00:00
afa492f473 Preprocessor: Avoid using "%.*hs" in log format string, since cppformat doesn't support it.
This was SVN commit r16189.
2015-01-22 20:38:16 +00:00
568c415d0a Convert wchar_t*/wstring arguments to UTF-8 strings in CLogger messages.
This was SVN commit r16188.
2015-01-22 20:37:38 +00:00
e02d7ad949 Automatically replace %hs/%ls with %s in CLogger format strings.
Everything is char* now, so we don't need to mess around with different
string types.

Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs perl
-pi -e'1 while
s/(LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR).*)%[hl]s/$1%s/g'

This was SVN commit r16187.
2015-01-22 20:36:24 +00:00
38a8e2e0d6 Automatically convert most path.string().c_str() to path.string8()
Done with:

  ag -l 'LOG.*string\(\).c_str\(\)' source | xargs perl -pi -e'1 while
s/(LOG.*string)\(\)\.c_str\(\)/${1}8()/g'

This was SVN commit r16186.
2015-01-22 20:35:17 +00:00
b90bc147c9 Add Path::string8 (which returns a UTF-8 encoded std::string).
This saves the hassle of writing utf8_from_wstring(path.string()) in
places like log messages, and can be extended to better handle
non-ISO-8859-1 paths on Linux.

This was SVN commit r16185.
2015-01-22 20:33:11 +00:00
e9a33b71ae Manually fix the less trivial CLogger format strings.
This was SVN commit r16184.
2015-01-22 20:32:06 +00:00
49e2ecea63 Automatically convert all CLogger format strings from wchar_t* to char*.
Done with:

  ag -ls 'LOG(MESSAGE|MESSAGERENDER|WARNING|ERROR)' source | xargs sed
-i 's/LOG\(MESSAGE\|MESSAGERENDER\|WARNING\|ERROR\)(L/LOG\1(/g'

This was SVN commit r16183.
2015-01-22 20:31:30 +00:00
dcf5a2667f CLogger: Use cppformat instead of sys_vswprintf.
sys_vswprintf relies on platform-specific printf implementations, which
vary widely between platforms (in handling of truncation, return values,
use of %s/%S/%hs/%ls for mixing char and wchar_t strings, etc) and are
therefore a pain.

Use cppformat's fmt::sprintf instead, which has very similar syntax to
sprintf but is more C++ish and is portable.

Also, wchar_t is stupid, so use char* strings (which are expected to be
UTF-8) in CLogger. This creates a bit of a pain with changing all
callers to convert to char* strings, but that's their fault for not
using UTF-8 already.

Refs #3011.

This was SVN commit r16182.
2015-01-22 20:30:05 +00:00
ca7b890e16 cppformat: Add basic tests for the functionality we use.
This was SVN commit r16181.
2015-01-22 20:28:57 +00:00
47b9a043b2 cppformat: Permit NULL arguments for %s.
Throwing exception on NULL is a bit extreme, and unhelpful when it
happens in rarely-tested error paths. Printing "(null)" is safer and
provides compatibility with glibc sprintf.

This was SVN commit r16180.
2015-01-22 20:27:58 +00:00
9c8798b592 cppformat: Remove support for CUSTOM types.
These cause a lot of type-safety trouble - unsupported types passed into
fmt::sprintf (like CStr or enums) will be accepted at compile time, but
trigger an exception at runtime. Remove them, so we'll get either an
implicit conversion to a supported type, or a compile-time error.

This was SVN commit r16179.
2015-01-22 20:27:34 +00:00
8875ae9cdf cppformat: Fix compatibility with our build system on Windows.
This was SVN commit r16178.
2015-01-22 20:26:58 +00:00
f16407f6e9 cppformat: Fix -Wundef build warnings from GCC.
This was SVN commit r16177.
2015-01-22 20:26:32 +00:00
f96593a9f3 Import cppformat v0.11.0
Refs #3011.

This was SVN commit r16176.
2015-01-22 20:25:10 +00:00
1857c33602 Remove use of __attribute__ that breaks the Windows build. Refs #2522.
This was SVN commit r16172.
2015-01-21 22:37:25 +00:00
b5b9c0f2ae Improve template code style for the Decay component.
This was SVN commit r16171.
2015-01-21 21:45:05 +00:00
76120d888b Add some tinygettext changes from SuperTuxKart. Refs #2522.
Move some data to RO. Pass some parameters as references.
Taken from https://github.com/Grumbel/tinygettext/issues/3.

This was SVN commit r16169.
2015-01-21 21:17:45 +00:00
aeb18239c3 Update tinygettext to upstream commit ca0f3ff640. Refs #2522.
Keeps our addition of precompiled.h (fd3d335265), win32/dirent,
4c9d99ff68, de6823d23f, and 8fc14655b5.

This was SVN commit r16168.
2015-01-21 20:37:37 +00:00
852cd11305 Improve the performance of the GetLosVisibility function by using the cache (currently used for mirages only) whenever possible.
This was SVN commit r16166.
2015-01-20 16:29:50 +00:00
7a48606471 GLES compatibility for particle shader
This needs to use the model-view matrix, not model-view-projection (the
transform uniform), else the axes won't be unit vectors and the particle
sizes will be wrong. But GLES doesn't have the pre-defined matrices, so
pass it in explicitly.

This was SVN commit r16165.
2015-01-19 21:44:53 +00:00
e1e163b3f7 Improve ogl_WarnIfError() to report the file/line where the error was detected
This was SVN commit r16164.
2015-01-19 20:06:16 +00:00
b74e853144 Fix typo which caused GLES errors
This was SVN commit r16163.
2015-01-19 20:04:46 +00:00
a72d490759 Fix Atlas compile problems with C++11 and clang. Thanks to trompetin17 for investigating this.
Refs #2669

This was SVN commit r16158.
2015-01-18 09:48:41 +00:00
840c8215b6 Fixes build error 'no viable conversion' on OS X with clang, libc++ and c++11, refs #2462.
Removes explicit use of _Unwrap(), prefer deference operator * instead

This was SVN commit r16157.
2015-01-18 06:36:15 +00:00
8976fb7646 Fixes MSVC warning C4100 unreferenced formal parameter
This was SVN commit r16156.
2015-01-18 06:26:00 +00:00
02a50fce62 Notify map makers when they are placing obstructed entities (overlapping other ones or placed outside the borders of the map). Patch by trompetin17
Fix #1163, refs #2829.

This was SVN commit r16149.
2015-01-14 09:11:11 +00:00
755ec45a14 Use correct format specifiers. Patch by bog_dan_ro.
This was SVN commit r16148.
2015-01-13 18:37:50 +00:00
851d3d964a Fixes MSVC build warnings about unhanded cases in switch statement (C4062) and missing parameter in macro (C4003)
This was SVN commit r16141.
2015-01-11 21:37:53 +00:00
8fc14655b5 Improve 524a942b52. Refs #2637.
This was SVN commit r16140.
2015-01-11 19:14:03 +00:00
524a942b52 Only print add_translation warning when translations do not match
FIXES 2637

This was SVN commit r16138.
2015-01-11 14:08:01 +00:00
5cf2086a33 Fix the initial exploration of territories, which shouldn't be performed in Atlas.
Also clean up the code a bit.

Fixes #2969

This was SVN commit r16129.
2015-01-08 22:36:13 +00:00
57033850a8 Check for unsaved changes in Atlas. Patch by trompetin17, fixes #2819.
This was SVN commit r16126.
2015-01-08 21:29:27 +00:00
b36c78b4c4 Fix build warning
This was SVN commit r16115.
2015-01-05 20:05:53 +00:00
045fea23aa Properly adjust Atlas for the init changes.
This was SVN commit r16112.
2015-01-03 17:42:42 +00:00
f0d7346b8f Happy New Year! :D
This was SVN commit r16103.
2015-01-02 14:22:23 +00:00
8441a3f8d6 Fix compilation failure with GCC and C++98/03.
Local types shall not be used as a template argument. So move it
to a higher scope. This restriction was lifted in C++11, so we
might want to change this back when we switch to that.

This was SVN commit r16101.
2015-01-01 23:57:04 +00:00