1
0
forked from 0ad/0ad
Commit Graph

634 Commits

Author SHA1 Message Date
c094e72ede Fixes scoping for icons in GUI text, instead of using only the top page on the stack, which caused errors when dialog boxes popped up over text containing icons
This was SVN commit r14591.
2014-01-17 02:54:57 +00:00
8195e767ef Fixes an occasional crash when hotloading GUI files.
Refs #2241

This was SVN commit r14573.
2014-01-11 20:53:01 +00:00
8226d75715 Make PickEntitiesAtPoint faster yielding 1-3% overall performance improvement. Fixes #2358. Also removes some trailing whitespace.
This was SVN commit r14532.
2014-01-07 04:05:10 +00:00
6ca6a5f779 The patch in 4b65f77438 seems to have fixed the crash, but the initData value doesn't match the JSContext's compartment, so it's theoretically wrong.
This should fix it correctly.

#Refs 2241

This was SVN commit r14508.
2014-01-04 21:49:36 +00:00
4b65f77438 Fixes an occasional crash introduced in #2241 (hopefully).
Refs #2241

This was SVN commit r14507.
2014-01-04 21:36:12 +00:00
4b1297b328 Removes g_ScriptingHost and implements global to compartment 1 to 1 relation.
Each GUI Page gets its own compartment and all ScriptInterfaces in the
same thread should now use the same JS Runtime.
This is required for the SpiderMonkey upgrade.
Check the ticket for details.

Closes #2241
Refs #1886
Refs #1966

This was SVN commit r14496.
2014-01-04 10:14:53 +00:00
fb8032043b Use pointers instead of copying sprites in the GUI. Fixes #1984. Patch by jP_wanN.
This was SVN commit r14493.
2014-01-03 20:19:43 +00:00
b1422137e5 Cleanup GUI Checkbox C++ code by removing broken, non-obvious internal text rendering.
This was SVN commit r14476.
2014-01-02 03:28:15 +00:00
67570be8fa Make GUI button-based objects to behave more expectedly when doubleclicked, also some style tweaks.
This was SVN commit r14468.
2014-01-01 06:05:41 +00:00
1e522f9b2c Fix bug with rating in lobby bot, remove superfluous GUI typedef, and change the lobby chat autocompletion to use tab.
This was SVN commit r14467.
2014-01-01 00:23:18 +00:00
c0472f0de5 Fix trivial comment typo caught by wraitii.
This was SVN commit r14460.
2013-12-31 11:06:00 +00:00
c7ff0bb486 Tweak some lobby login UI bits, rework scrollbar mousewheel handling, add ability to scroll through closed dropdowns with scrollwheel, general C++ GUI cleanup, and fix broken random map script 'Unknown Nomad'.
This was SVN commit r14458.
2013-12-31 04:54:16 +00:00
5e23445339 Make ConfigDB properly thread-safe.
Replace CreateValue with SetValueString so we don't pass pointers to
internal
 ConfigDB structures around. Refs #1810.
Remove some splash screen related functions since we can achieve the
same
 with the ConfigDB functions exposed to scripts.

This was SVN commit r14437.
2013-12-29 23:56:18 +00:00
92fba32c5e Some more C++ GUI cleanup.
This was SVN commit r14436.
2013-12-29 20:46:02 +00:00
e729f46789 Make button-type GUI elements more responsive and cleanup in IGUIButtonBehavior.cpp
This was SVN commit r14435.
2013-12-29 19:31:48 +00:00
6fba293088 In #2241 I'm going to change the GUI to have one ScriptInterface for each GUI page because that will be required for the Spidermonkey upgrade (#1886).
The Multiplayer lobby needs some changes to avoid compartment
mismatches. Instead of initializing it with a ScriptInterface and
storing script values at different locations, it takes a ScriptInterface
argument in the functions that really need to read or write some script
values and avoids storing values as script values with an associated
compartment where possible.
The scripting interface of the lobby is also adjusted to use
JSInterface_Lobby.h/cpp files as other components instead of adding all
functions to ScriptFunctions.cpp. This makes it a bit more clearly
arranged IMO.

Fixes #2267
Refs #2241
Refs #1886

This was SVN commit r14199.
2013-11-16 18:38:40 +00:00
7cb4c0dcfc Partial fix of minimap rendering for GLES.
Replaces glBegin/End with glDrawArrays, GL_QUADS with GL_TRIANGLES, and
modifies shaders as needed.

This was SVN commit r14153.
2013-11-12 01:31:52 +00:00
0682c23fe3 Replaces BGRA textures with RGBA textures supported by GLES
This was SVN commit r14148.
2013-11-12 01:11:08 +00:00
d7ec8c47a6 Fix Unicode support in lobby.
Fix EncryptPassword being called with the wrong argument order, and
encrypting username instead of password. (This will break all existing
lobby accounts.)

Fix EncryptPassword not using all of salt_base.

This was SVN commit r14123.
2013-11-09 23:26:17 +00:00
9cc172b164 Fixes --without-lobby for MSVC and clang, refs #2249.
Cleans up some whitespace.
Removes obsolete PCH files.

This was SVN commit r14117.
2013-11-09 02:57:10 +00:00
81cf02cc13 Fix building with --without-lobby. Fixes #2249.
This was SVN commit r14113.
2013-11-08 15:28:44 +00:00
bffe917914 Multiplayer lobby based on the XmPP protocol. Special thanks to Philip, alpha123, scythetwirler, and anyone else who has helped build, debug or test the lobby.
This was SVN commit r14098.
2013-11-07 20:07:24 +00:00
1fa2fc9739 CClientArea parsing test
This was SVN commit r14064.
2013-11-02 14:39:08 +00:00
701508922f Use CStrIntern for font names to reduce lookup cost
This was SVN commit r14020.
2013-10-18 16:15:42 +00:00
91169c82c7 Optimise rendering of scrollable text boxes by clipping
Add optional clipping rectangle to CTextRenderer. Strings that are
printed
outside the vertical extent of the clipping rectangle will be
immediately
skipped. This greatly reduces the cost of large scrollable text boxes.

This was SVN commit r14019.
2013-10-18 16:05:02 +00:00
751558d894 Optimise text rendering by batching
When CTextRenderer is given multiple strings with no differences other
than position, render them in a single glDrawElements call to reduce
driver overhead.

Also avoid some unnecessary copies of std::wstrings.

This helps performance a bit with large GUI text boxes.

This was SVN commit r14018.
2013-10-18 16:02:48 +00:00
5778484a77 Refactor text renderer
Replace unifont with CFont and CFontManager, since the h_mgr interface
was
needlessly inconvenient.

Load the font textures through CTextureManager, to support dynamic
reloading (e.g. when resetting GL state - see #741).

Add CFontMetrics as a convenient wrapper for code that just wants to
measure text.

Fixes #1117.

This was SVN commit r14016.
2013-10-18 15:53:07 +00:00
754e794f9b Implements attack notifications based on patch by madmax and zoot, fixes #1719
This was SVN commit r13951.
2013-10-06 04:49:38 +00:00
7901ed51d4 Implements skirmish maps, based on patch by sanderd17, fixes #1198. Skirmish maps are like scenarios, except the player can choose their civ during match setup. To create a skirmish map: place some skirmish entities for each player in Atlas (see templates/skirmish/* for examples), uncheck the player's civ in Atlas' player panel if desired, and save in the maps/skirmishes directory. The map will appear in match setup under the "Skirmish" match type.
Implements custom, VFS-based map load/save dialogs for Atlas (replaces
broken native file dialogs), fixes #631, #889.
Fixes map loading/saving to handle arbitrary subdirectories for better
organization.
Adds default settings to Atlas player panel, fixes #1872. Each setting
now has a checkbox to choose whether it should be saved with the map
(avoids writing lots of useless default data for each map).
Adds map preview setting to Atlas, refs #1745.
Cleans up and simplifies some duplicate code.
Fixes optional serialization performance test.

This was SVN commit r13938.
2013-10-04 02:29:16 +00:00
6a97bbd4c3 Fixes dropdowns opening with empty list, caused assertion failure about vector subscript range in MSVC debug build
This was SVN commit r13936.
2013-10-04 00:31:36 +00:00
238b7f84d8 Changes the ConfigDB to expose global functions to scripts instead of properties and custom objects.
Fixes #2172
Refs #1886

This was SVN commit r13914.
2013-09-29 18:56:50 +00:00
994ebd9836 Add a list of statically-constructed CStrIntern strings
Switch all the constant strings in graphics code to use the new
variables.
This avoids the cost of instantiating CStrInterns at runtime every
frame.

This was SVN commit r13906.
2013-09-29 13:19:52 +00:00
9781b67cf4 Changes the Console to expose global functions to scripts instead of properties.
Fixes #2140
Refs #1886

This was SVN commit r13884.
2013-09-21 14:48:19 +00:00
12e2428495 Changes the Renderer to expose global functions to scripts instead of using CJSObject.
Fixes #2137
Refs #1886

This was SVN commit r13877.
2013-09-21 08:24:45 +00:00
c28151c1c1 Put tooltips on a diet.
This was SVN commit r13835.
2013-09-13 23:49:46 +00:00
5304bc9d6a Changes GameView to expose global functions to scripts instead of using CJSObject.
Fixes #2126
Refs #1886

This was SVN commit r13826.
2013-09-12 12:40:05 +00:00
89430de468 Okay, do what f5ab6255d0 was supposed to do.
This was SVN commit r13773.
2013-08-26 04:17:26 +00:00
b10a01645f Revert f5ab6255d0. I accidentally somehow committed my whole working tree on this computer....
This was SVN commit r13772.
2013-08-26 04:15:36 +00:00
f5ab6255d0 General scrollbar improvements. Patch by Josh. Fixes #2080.
- Don't show the scrollbar when the contents aren't overflowing the
visible area.
- Fix bugs in minimum bar sizing.
- Add capability to set a maximum bar size.
- Correct outdated/incorrect comments.

This was SVN commit r13771.
2013-08-26 03:06:08 +00:00
7ff167e7de Removes more unused variables, based on patch by Markus, refs #1852.
Adds TODOs to use POT textures in fancy water rendering.

This was SVN commit r13663.
2013-08-15 18:25:32 +00:00
20e7d2224a Implement a developer overlay command to change the current player ID (very useful for AI development).
This was SVN commit r13606.
2013-07-29 00:53:44 +00:00
e0ea53a8ee Adds saved game descriptions and in-game save dialog, based on patch by Crynux, fixes #2030
This was SVN commit r13579.
2013-07-21 00:23:57 +00:00
38cdc38bba Fixes a build error with SDL2, refs #2041
This was SVN commit r13572.
2013-07-17 06:33:11 +00:00
595c964d77 Make water specular more visible and fixes a few cases where it would actually hardly appear when it should.
Adds the ability to access an element in a dropdown box by typing the
first letters (Refs #1532).

This was SVN commit r13556.
2013-07-14 12:17:07 +00:00
93e8ccda64 Fix crash in VC++11 debug builds. Fixes #2028. Patch by RedFox.
This was SVN commit r13539.
2013-07-07 20:02:20 +00:00
9565c60a14 Adds UI sounds for buttons, dropdowns, lists, and checkboxes, fixes #948
This was SVN commit r13521.
2013-07-01 04:15:09 +00:00
6f3a0e1378 Implement location hotkeys. Fix #1882.
This was SVN commit r13463.
2013-06-09 20:21:19 +00:00
1341b88468 Adds VBO support to minimap entity rendering to improve performance, patch by kuranes. Refs #1923
This was SVN commit r13454.
2013-06-06 00:10:58 +00:00
a8a968d32c Catch exceptions by reference (by convention), based on patch from Markus, refs #1852
This was SVN commit r13421.
2013-05-22 22:27:53 +00:00
72a8b88b7d Fixes some unconventional assignment operators, patch by Markus, refs #1852.
Fixes typo in test_ShaderManager

This was SVN commit r13420.
2013-05-22 22:04:58 +00:00
94c57085e9 Makes some classes NONCOPYABLE, based on patch by Markus, refs #1852
This was SVN commit r13419.
2013-05-22 21:40:56 +00:00
3f00d4d997 Change some size() > 0 to Based on patches by kuranes and Markus. Refs #1852, #1923.
This was SVN commit r13413.
2013-05-21 22:11:47 +00:00
16de5c75ac Adds game speed option to match setup, adds in-game control for single player games, fixes #785.
Refactors some GUI utility functions.

This was SVN commit r13340.
2013-04-03 23:24:22 +00:00
73951b75fc Adds the server-side part of the javascript debugger. Refs #410
This was SVN commit r13238.
2013-03-07 13:49:49 +00:00
75a23856cf Fix some static analysis warnings
This was SVN commit r13101.
2013-01-21 20:33:25 +00:00
a074eb814a Adds blinking cursors with configurable rate, based on patch by kingadami. Fixes #876
This was SVN commit r13068.
2013-01-12 01:20:01 +00:00
8a2baec240 Fixes multiline text alignment, fixes #723. Patch by kingadami.
Adds text alignment to tooltips, fixes text alignment for dropdowns.

This was SVN commit r13051.
2013-01-06 01:46:44 +00:00
0d204037b6 Added right click selection removal. Fixes #1028. Thanks to kingadami and GerbilOfDoom for the patch.
This was SVN commit r13040.
2013-01-03 22:53:46 +00:00
276f0a41a0 New Year's clean-up.
Throw a warning if a invalid (not present) AI is specified in a map.
Replace the last occurences of jubot with qbot.
Exclude the common siege templates from the Units Demo map.
Fix an error with flying units.
Replace CFG_GET_SYS_VAL with CFG_GET_USER_VAL and rename it to
CFG_GET_VAL to reflect its behaviour better.
Fix linker error with clang 3.2. Refs 1588.
Remove some useless includes.

This was SVN commit r13031.
2013-01-01 18:33:53 +00:00
adc4012944 Save last multiplayer server. Based on patch by Aurium. Fixes #1778.
Fix bug in ConfigDB: Creating a value could result in changing a value
in a different namespace.

This was SVN commit r13021.
2012-12-25 22:49:18 +00:00
9a2dfa3fc0 Read default multiplayer server name/IP address from config. Patch by Aurium. Refs #1778.
This was SVN commit r13003.
2012-12-20 21:44:56 +00:00
5ce5ef9286 Adds a splashscreen that appears on startup and informs the player about the status of the game (bugs, missing features). The splashscreen can be disabled for future startups by unckecking a checkbox on the splashscreen.
This was SVN commit r12735.
2012-10-07 12:43:08 +00:00
f91111aec8 Load default MP player name from the config.
This was SVN commit r12673.
2012-09-14 05:38:29 +00:00
fef2bdf39b Removed unused file
This was SVN commit r12658.
2012-09-09 19:41:32 +00:00
affe91b52c Fixed fixed renderpath: green water, broken minimap
This was SVN commit r12588.
2012-09-01 22:34:36 +00:00
38c1a4c4a1 Modified sky, minimap and healthbar renderers to use shaders, to fix a bug reported by historic_bruno
This was SVN commit r12551.
2012-08-29 23:07:53 +00:00
9dc838bed5 Add support for cropped images in the GUI code and update game setup to use cropped map previews. Refs #1343.
This was SVN commit r12348.
2012-08-10 19:59:20 +00:00
166255b744 Remember scroll position when re-opening dropdown lists.
This was SVN commit r12319.
2012-08-08 17:22:52 +00:00
2eb49be1a3 Show shallows (walkable water) on the minimap in a lighter color.
This was SVN commit r12277.
2012-08-04 18:52:02 +00:00
b8b6ebb6ec Properly re-initialize drop-down lists when the list items changes. Fixes #1558.
This was SVN commit r12244.
2012-07-31 03:34:09 +00:00
99d04e93bb Implements global tech modification function. Fixes #1358, refs #1520.
Applies tech modifications to template data returned by GuiInterface.
Extends engine to load arbitrary global scripts, separates this from RNG
replacement. Refs #1193.
Loads global scripts for most script contexts for consistency.
Adds simulation tests for global scripts.

This was SVN commit r12056.
2012-07-03 02:16:45 +00:00
vts
490182ddd0 Wall placement. Closes #786.
This was SVN commit r11760.
2012-05-05 19:22:22 +00:00
32d2927449 Adds UTF-8 support for JavaScript files.
This was SVN commit r11750.
2012-05-04 21:48:46 +00:00
d0784bd314 Fix minimap issue caused by 5b7027ec53. Fixes #1372.
This was SVN commit r11748.
2012-05-04 17:44:28 +00:00
5b7027ec53 Fix tech overlay issue.
This was SVN commit r11725.
2012-05-02 22:57:35 +00:00
c8745ee41f Handle game ending in Atlas a bit more gracefully, it now continues until the user stops the simulation test. Fixes #641.
This was SVN commit r11575.
2012-04-20 01:41:54 +00:00
769350a3e7 Compute camera height and zoom limits based on smoothed terrain heightmap. Fixes #794, based on patch by Dietger.
This was SVN commit r11556.
2012-04-18 20:39:00 +00:00
5a21140093 Added grayscale option for ui textures
This was SVN commit r11364.
2012-03-18 19:43:03 +00:00
4eec2bf5d2 Fixes some bugs related to deleting saved games (in particular, load/delete was broken if the file was deleted externally while the game was running).
Adds saved game directory to the hotload watch list.
Logs error instead of crashing when saved game is not found.
Changes Atlas double-click selection to only pick units from the same
player.

This was SVN commit r11332.
2012-03-14 00:23:28 +00:00
894dc30c69 Trade. Closes #30.
This was SVN commit r11279.
2012-03-08 20:42:28 +00:00
98c8a47192 Fix crash on Clang
This was SVN commit r11269.
2012-03-07 20:40:38 +00:00
dc715fe57f Remove some unused includes
This was SVN commit r11250.
2012-03-05 16:15:07 +00:00
d60df4b127 Adds saved game deletion. Refs #1090
Documents a few things related to saved games.

This was SVN commit r11233.
2012-03-04 05:27:17 +00:00
vts
649cb7ee7b Added PickFriendlyEntitiesOnScreen function to the JS side for #1187.
This was SVN commit r11230.
2012-03-03 21:42:23 +00:00
7fa6afac37 Corrects some Doxygen comments and adds a few others of interest.
This was SVN commit r11209.
2012-03-01 03:55:05 +00:00
2d65ee60f3 Tweaks minimap water color.
This was SVN commit r11202.
2012-02-29 01:12:52 +00:00
d755af157f Fixes constant logical operand warning on OS X build.
This was SVN commit r11190.
2012-02-28 03:34:33 +00:00
7d9e98b00e Adds multiple entity selection to Atlas (including move/delete). Fixes #678.
Makes all actors selectable in Atlas and gives them selection rings (an
EditorOnly flag is used in the template for Atlas-only selectables).
Adds player colors to Atlas selection rings.
Fixes decal selection by falling back to old-style AABBs. Refs #1032.
Replaces UnitManager selections with EntitySelection helpers.
Adds DrawOverlays to Atlas views, for Atlas-specific rendering.
Fixes bug where selection rings conflicted with Move/rotate tool in
Atlas simulation test.

This was SVN commit r11177.
2012-02-27 05:32:35 +00:00
c888c00377 Avoid unnecessary use of printf in text renderer.
This was SVN commit r11154.
2012-02-25 17:14:47 +00:00
832a51da80 GLSL text support
This was SVN commit r11080.
2012-02-15 21:53:13 +00:00
9972eb8cae Enough GLES compatibility to reach the menu screen
This was SVN commit r11064.
2012-02-13 20:53:24 +00:00
531b40578a More GLES compatibility.
Add config option to disable hardware cursors on Windows.

This was SVN commit r11053.
2012-02-12 20:45:31 +00:00
2bf3383624 Attempt to fix minimap rendering issues
This was SVN commit r11041.
2012-02-09 20:45:19 +00:00
a3f168b887 Initial support for GLSL generic vertex attributes in shader API, for GLES compatibility.
Specify GLSL version in shader files, for better error detection.

This was SVN commit r11040.
2012-02-09 17:55:25 +00:00
1f5b8f1c9a Move GUI renderer towards using shader infrastructure.
Remove support for unused GUI sprite effects.
Use vertex arrays for bounding box rendering.

This was SVN commit r11039.
2012-02-08 20:43:38 +00:00
08bd07ddd6 Adds safe bool operator to ICmpPtr, replacing the null() method, based on patch by leper. Also changes bool operator in AtSmartPtr to safe bool. Fixes #1077.
Changes some CmpPtr variable names for consistency.

This was SVN commit r11036.
2012-02-08 02:46:15 +00:00
3fab2729b5 Partial SDL2 compatibility
This was SVN commit r11033.
2012-02-06 22:47:35 +00:00
ba84c54535 Render GUI quads with consistent winding order, to stop them vanishing with negative sizes.
This was SVN commit r11030.
2012-02-05 22:57:58 +00:00
b9c406551b Cache shader effects. Fixes #1143.
This was SVN commit r11006.
2012-02-02 22:58:42 +00:00
cc5a0fba4e Use shader API for GUI text.
Flip GUI quads so we don't have to disable back-face culling.

This was SVN commit r10989.
2012-01-30 00:27:23 +00:00