1
0
forked from 0ad/0ad
Commit Graph

5675 Commits

Author SHA1 Message Date
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
a472944689 Clean up LoadPlayerSettings.
Include gaia to make iteration easier.
Add TemplateExists() to the TemplateLoader. Refs #2877.

This was SVN commit r16099.
2015-01-01 23:10:24 +00:00
8e30410109 Improve PickEntitiesAtPoint
First, do a ray intersection test with the bounding-sphere for all
entities on the map and then check the more detailed selection shape for
the remaining candidates. Do checks that require component lookups after
the ray intersection tests because these are relatively expensive.
The old method for figuring out which entities are below the mouse
cursor was incorrect because it does a 2D check to filter out the first
candidates which can lead to incorrect results with lower camera angles
and high buildings or buildings with a large footprint. Such problems
were avoided with quite a large radius for this 2D test and resulted in
a large number of candiate entities after this first test (200-500).
Also rename PickEntitiesAtPoint to PickEntityAtPoint and make it return
only one (the closest) match.

I've tested performance with the tracelogger by starting a map and then
moving the mouse in circles for one minute. The results were relatively
stable. I've compared the total time percentage of input.js:836, which
spends nearly all of the time in PickEntityAtPoint.
Ardennes Forest - Normal size:       Original: 41.46%    Patched: 31.6%
Ardennes Forest - Giant size:        Original: 40.59%    Patched: 51.55%

As we see, it's faster on normal map sizes but slower on giant maps with
a lot of entities.
This approach can be further improved with some kind of spatial
subdivision for the culling (like an octree), which would help the unit
renderer too. This way it should be possible to make it faster (and
still correct) on all map sizes and with a large total numbers of
entities.

This was SVN commit r16098.
2015-01-01 23:05:26 +00:00
9329506e0d add support for civ specific player template, see #2877
This was SVN commit r16092.
2014-12-31 09:31:41 +00:00
913674a202 Remove useless call.
This was SVN commit r16090.
2014-12-31 00:21:41 +00:00
2c20936ce3 Save map settings. Patch by @aBothe. Fixes #2963.
This was SVN commit r16089.
2014-12-31 00:21:24 +00:00
8f387e0044 Remove code duplication and some cleanup.
This was SVN commit r16088.
2014-12-30 18:21:02 +00:00
992169c3ab Fix indentation in daaddaf433.
This was SVN commit r16087.
2014-12-30 17:27:18 +00:00
daaddaf433 Stop music in Atlas when reloading a map, patch by trompetin17, fixes #1712.
This was SVN commit r16084.
2014-12-29 21:01:54 +00:00
354bd8b088 Only delete/create players until the needed number is reached. Patch by trompetin17. Fixes #1953.
Previously we removed all players and created them anew. This caused
issues in Atlas,
as some components were recreated, but did not get informed about
already existing
entities (eg cmpTechnologyManager). By only creating/deleting players
until we obtain
the new number of players we do not have this issue.

This was SVN commit r16080.
2014-12-29 17:33:39 +00:00
d68a057153 Fix warning.
This was SVN commit r16077.
2014-12-28 16:45:06 +00:00
4c12440868 Give access to the templates to the GUI. This will be useful for eventually displaying factions specificities in main menus.
This was SVN commit r16075.
2014-12-28 16:21:07 +00:00
2ef3c0c42e Compute the actual percentage of map explored by the team in the summary screen.
Fixes #2587.

This was SVN commit r16071.
2014-12-26 19:13:40 +00:00
1e17cbe33c Use the range manager to pick entities when drawing a selection box during a game. This allows for a significant performance improvement.
Fixes #2961, patch by @aBothe.

This was SVN commit r16068.
2014-12-26 13:07:49 +00:00
49187dd990 Drop support for AIs that are not using modules.
This was SVN commit r16061.
2014-12-23 01:20:50 +00:00
d21cf8f3aa Clarify some comments.
This was SVN commit r16060.
2014-12-23 00:46:00 +00:00
ce0c1e4302 Report names of components or interfaces in case of error when registering those.
This was SVN commit r16059.
2014-12-23 00:29:14 +00:00
efce88b97b Call setlocale(3) on BSDs so that we can log unicode strings. Patch by Teiresias. Fixes #1142.
This was SVN commit r16058.
2014-12-22 00:23:07 +00:00
71ba68e3a3 Fix performance problem with unnecessary global message subscription
On my ESR31 branch, I've made two measurements with different replays
(both around 15000 turns).
In the first, I got around 3% performance improvement and in the second
about 7.5%. It mainly depends on how often aura changes related to the
female citizen aura happen.

This was SVN commit r16055.
2014-12-21 01:44:00 +00:00
a9c6b7080a Fixes intermittent error messages caused by uninitialized variable
This was SVN commit r16049.
2014-12-14 17:43:40 +00:00
add113a2a1 Remove duplicated layers of unescaping which required multiple escapes in some places.
This was SVN commit r16043.
2014-12-13 01:08:29 +00:00
eb8a6c9427 Explictly use GMT when displaying a localized time that is not a date. Patch by lafferjm. Fixes #2938.
Also make some parameters const references.

This was SVN commit r16037.
2014-12-12 01:11:00 +00:00
622614de02 Allow nesting repeat tags in the GUI.
This was SVN commit r16034.
2014-12-10 20:10:02 +00:00