1
0
forked from 0ad/0ad
Commit Graph

701 Commits

Author SHA1 Message Date
9819b23529 I should not commit half-finished debug code.
This was SVN commit r17276.
2015-11-16 18:48:05 +00:00
70164a02c4 Handle double-clicks on list elements better. Patch by elexis.
Fixes #3574

This was SVN commit r17274.
2015-11-16 18:23:21 +00:00
6b8dc7684a Return in case we do not have any available JS timer slots instead of accessing OOB memory.
This was SVN commit r17263.
2015-11-15 01:09:35 +00:00
32da740f14 Allow kicking/banning players from gamesetup and session. Patch by elexis. Fixes #3241.
This was SVN commit r17217.
2015-11-11 02:05:23 +00:00
108633affd Fix #3415. Removes 'ghost' scrollbar bounding to enable extreme-right hover and selection in dropdowns. Patch by elexis.
This was SVN commit r17149.
2015-10-31 05:40:43 +00:00
d64b95b28c An awesome Visual Replay menu, made by elexis. Fixes #3258.
This was SVN commit r17054.
2015-09-21 17:00:21 +00:00
9816e7c92d Rename some variables to point out that they are only used in visual replay. Add script function IsVisualReplay. Refs #9 #3355, patch by elexis
This was SVN commit r17017.
2015-09-13 19:03:33 +00:00
7d6553099f Fix wrong offset when clicking too close to the header of sortable lists. Also added some code comments.
Patch by elexis, fixes #3391

This was SVN commit r16976.
2015-09-02 17:55:02 +00:00
74c420f658 GUI code cleanup. Fixes #3354.
Lots of code style fixes:
 * type [*&]varname -> type[*&] varname
 * else
   if (...)
   ->
   else if (...)
 * Spaces around some ops.
 * i++ -> ++i.
 * switch-case style fixes.
 * Indentation fixes.
 * Removing some commented out code.
 * include header sorting
 * Changed multiple pointer var declarations to be one per line.
 * Removed strange spaces in some places.
 * Changed some include header guards to be consistent with the rest of
the codebase.
 * Use UNUSED() instead of UNUSED2().

Some small code fixes:
 * Using .find() instead of .count() == 0.
 * !.empty() instead of .size() == 0.
 * Range-based for loops.
 * Making some member functions const by small changes.
   * Adds GetScrollBarPos(idx) const for this.
 * Using early returns/continues in some places.
 * Uses size_t for some loops in CList and COList.
 * Removes unused heading element (not attribute) from COList.
 * Use ENSURE in one case where some custom code did something similar.
 * Made some parameters const ptrs/refs.
 * Change removal loop in GUItext.cpp to erase-unique.
 * Made some static things const.
 * Allow iterating over children of IGUIObject with range-based for
loops by
   exposing begin() and end() (rename from ChildrenIt{Begin,End}()) and
use it.

Comments:
 * Comment COList.
 * Update a few comments.
 * Remove useless or duplicated comments.

This was SVN commit r16931.
2015-08-21 17:08:41 +00:00
ec96c737ee Actually use vpObj instead of obj, and use it in all cases. Refs #3354.
This was SVN commit r16909.
2015-08-02 14:40:51 +00:00
47336b770f Add clipping to OList cells. Patch by elexis. Fixes #3353.
This was SVN commit r16895.
2015-07-30 01:33:48 +00:00
c5eb9b7bb7 Range-based for for VfsPath loops.
This was SVN commit r16893.
2015-07-29 23:44:12 +00:00
04982b0bf5 Fix compiler warning
This was SVN commit r16849.
2015-07-12 16:49:26 +00:00
edf6e909b2 ...aaaaand I forgot this guy.
This was SVN commit r16846.
2015-07-12 08:11:30 +00:00
0d32afd688 Improve the style of GUI string text call functions.
This was SVN commit r16845.
2015-07-12 08:09:55 +00:00
0682190def Don't postpone rendering of icons when they are at the end of a GUI string.
Fixes #2502

This was SVN commit r16844.
2015-07-12 07:38:04 +00:00
1793a96c14 Actually remove the unused expression.
This was SVN commit r16805.
2015-06-21 20:44:31 +00:00
5a0b9b0e70 Fix some issues found by static analysis (clang-analyzer and cppcheck).
This was SVN commit r16801.
2015-06-21 18:46:31 +00:00
b8fce56821 Implement sortable columns for the gui, and use them in the lobby. Patch by Vladislav. Fixes #2405.
This was SVN commit r16781.
2015-06-17 09:10:50 +00:00
fd3d697edf Make it easier to add different backgrounds
This was SVN commit r16747.
2015-06-11 09:08:46 +00:00
a18fbd12ec XML validation. Based on patch by historic_bruno. Refs #245.
This was SVN commit r16733.
2015-06-07 21:56:52 +00:00
f71be3c764 Use iterators for XMBAttributeList and XMBElementList. Fixes #3269.
This was SVN commit r16704.
2015-06-01 00:29:35 +00:00
d3da00dc99 Fix some issues found by static analysis.
Actually abort in case of recursive includes again. Refs #2622.

This was SVN commit r16703.
2015-06-01 00:29:23 +00:00
7a70c475df Improve rejoin messages. Patch by elexis. Fixes #1949.
This was SVN commit r16614.
2015-05-03 02:06:17 +00:00
535d612e06 Small fixes.
This was SVN commit r16552.
2015-04-20 14:51:06 +00:00
120ff2c60c Fix the structure tree a second time, this should also work on Windows.
This was SVN commit r16542.
2015-04-15 09:10:05 +00:00
a980d8fdfc Fix structure tree by allowing undefined templates in the productionqueue
This was SVN commit r16537.
2015-04-14 18:45:02 +00:00
96410ee9a4 Fix heightmap rectangle. Take the water plain height as the base plane, instead of a hardcoded value.
This was SVN commit r16482.
2015-04-01 14:17:18 +00:00
b1c4e29ac8 Fixes inconsistencies in spelling of colour/color by preferring "color" (only wxWidgets remains with some API that requires "colour"), fixes #1029.
NOTE: requires update-workspaces and may require correction of some
modded actors/scenarios

This was SVN commit r16438.
2015-03-15 23:59:48 +00:00
caf89fa04e Rename ps/Overlay(.h|.cpp) to ps/Shapes(.h|.cpp), fixes a TODO located in graphics/Overlay.h.
The file name did not match the content.

Also little cleanup of some unnecessary includes.

This was SVN commit r16431.
2015-03-15 18:06:32 +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
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
df2e077870 Trailing spaces cleanup, based on patch by trompetin17, refs #1767.
This was SVN commit r16244.
2015-01-29 16:10:03 +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
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
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
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
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
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
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
2c20936ce3 Save map settings. Patch by @aBothe. Fixes #2963.
This was SVN commit r16089.
2014-12-31 00:21:24 +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
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
622614de02 Allow nesting repeat tags in the GUI.
This was SVN commit r16034.
2014-12-10 20:10:02 +00:00
c385a88c88 Remove unused overload of GetSavedGameData
This was SVN commit r16001.
2014-11-22 19:46:24 +00:00