1
0
forked from 0ad/0ad
Commit Graph

634 Commits

Author SHA1 Message Date
8ce8e6ba9a Exact stack rooting for IGUIObject.
Refs #2415
Refs #2462

This was SVN commit r15623.
2014-08-08 13:41:47 +00:00
c662a4e9e9 Fixes #2713
This was SVN commit r15615.
2014-08-05 19:03:10 +00:00
e41f010f91 Fixes crash when loading maps in Atlas.
The ScriptInterface pointer can be NULL there, so using it without
checking is not safe.
This fixes the problem by continuing with the exact stack rooting
changes, which makes the temporary solution unnecessary.

Fixes #2707
Refs #2415

This was SVN commit r15611.
2014-08-04 20:14:17 +00:00
efb889b79a Exact stack rooting for WriteStructuredClone and functions that use it.
Refs #2415

This was SVN commit r15607.
2014-08-03 19:32:39 +00:00
a2bd44b23a Exact stack rooting for JSON related ScriptInterface functions.
Refs #2415
Refs #2462

This was SVN commit r15603.
2014-08-02 22:21:50 +00:00
608c27fe10 Exact stack rooting for structured cloning functions.
Refs #2415
Refs #2462

This was SVN commit r15597.
2014-08-01 20:55:16 +00:00
5c07a25ddc More exact stack rooting (CallFunction object).
Changes CallFunction and CallFunctionVoid to use a HandleValue as object
parameter. Also changes some JS serialization/deserialization functions
to only support the JSAPI rooted types (drop support for CScriptVal and
CScriptValRooted there). Some other functions got changed too because
they were closely related.

Refs #2415
Refs #2462

This was SVN commit r15592.
2014-07-31 19:18:40 +00:00
2ae74221c7 Fixes saving/loading problems introduced in 28bdd8540f.
* CGameLoader created a new JS::Value when assigning to m_Metadata.
This means it didn't actually update metadata in SavedGames::Load. The
new approach solves this problem and should work well if
CScriptValRooted gets replaced in the future.
 * The cloning in ScriptFunctions.cpp was required. Removing it caused
compartment mismatches.
 * Now CGameLoader loads the metadata unconditinally because we didn't
actually use the option to not load load it.

Ref #2415

This was SVN commit r15589.
2014-07-31 14:44:51 +00:00
28bdd8540f Quite a lot of stack rooting related changes.
Changes GetProperty, SetProperty and HasProperty and a few other
functions to take handles. The conversions to CScriptVal or
CScriptValRooted at some places should be removed in the future. I've
done that to avoid an even larger patch.

Refs #2415
Refs #2462

This was SVN commit r15568.
2014-07-26 22:33:16 +00:00
31f9ca9ebf Implements CallFunction with JS::MutableHandle<T> return type.
Changes the CallFunction implementation to use macros because otherwise
we'd have to write twice as many functions manually.
Adapts GetSavedGameData to use the new function template. Additional
callers will be changed in future commits.

Refs #2415
Refs #2462

This was SVN commit r15541.
2014-07-20 15:08:28 +00:00
52f4cda439 Changes ToJSVal to take JS::MutableHandleValue instead of JS::Value&.
JS::MutableHandleValue is similar to JS::HandleValue, but the whole
JS::Value it points to can be replaced.
This change is needed for support of exact stack rooting and moving GC.
Contains a few other trivial API adjustments and style improvements too.

Refs #2462
Refs #2415

This was SVN commit r15534.
2014-07-14 19:52:35 +00:00
17634d7507 Move the minimap to only use the shader pipeline. Should make it OpenGL ES compatible (untested).
This was SVN commit r15533.
2014-07-14 17:15:22 +00:00
1b5ab8142e Makes custom JS objects compatible with SpiderMonkey ESR31.
In v24 you called JS_InitClass and passed in a definition of JSNative
functions. Later you could call JS_NewObject with this class and the
object would get a prototype with the specified JSNative functions.
In ESR31 you now have to explicitly store the prototype object returned
by JS_InitClass and pass it as prototype argument to JS_NewObject to
achieve the same.
This change modifies our existing ScriptInterface implementation for
custom object types a bit and uses it at places where the JSAPI was used
directly before.

Refs #2462

This was SVN commit r15524.
2014-07-13 15:31:48 +00:00
db9c20e0a9 Changes FromJSVal to take a JS::HandleValue instead of JS::Value.
JS::HandleValue is basically a wrapper around a JS::Value that is safe
for exact stack rooting and moving GC.
I've tried to keep this changeset rather small and isolated and
therefore create additional JS::Rooted<T> values at some places where
the function should eventually directly take a JS::Handle<T>.
The functions "CallFunction" and "CallFunctionVoid" put their arguments
inside a JS::AutoValueVector because this will be passed directly to
"CallFunction_" with ESR31.

Refs #2462
Refs #2415

This was SVN commit r15517.
2014-07-12 19:08:39 +00:00
cfa59fc4e1 Changes our JSNative functions to use JS::CallReceiver/JS::CallArgs.
This is the new way for working with arguments in JSNative functions.
JS_THIS_VALUE, JS_ARGV, JS_SET_RVAL and direct access to vp or argc are
deprecated and will probably be removed in future versions of
SpiderMonkey.
CallArgs also takes care of proper rooting and you can get the values as
Handles or MutableHandles. The interface changes a little bit for ESR
31, but commiting this now still makes it easier and the changes shout
be straigtforward (search and replace more or less).

Refs #2462
Refs #2415

This was SVN commit r15516.
2014-07-12 16:55:09 +00:00
8b493c2739 Revert obsolete workaround for structured clones.
Reverts 8195e767ef because that workaround isn't needed anymore with
SpiderMonkey 24 (and 31).

Refs #2241
Refs #1886

This was SVN commit r15495.
2014-07-05 11:35:00 +00:00
ffd6e10edf Make CGUIManager register a callback function for hotloading instead of specifically calling it.
This was SVN commit r15482.
2014-07-02 23:44:39 +00:00
c793da5368 Don't allow changeing disabled dropdowns using the scrollwheel. Also corrects some things in b9a4af4cc6.
This was SVN commit r15406.
2014-06-21 00:25:12 +00:00
02fd235bbd Make hotkeys and top panel fully moddable by splitting up the xml file. Allow entire directories to be loaded via an 'include' to provide extra moddability (modders don't have to edit any files, they can just add new ones).
This was SVN commit r15380.
2014-06-17 13:03:55 +00:00
b469983c58 Fix for 89f5e7b260. Refs #2622
This was SVN commit r15353.
2014-06-14 16:12:41 +00:00
89f5e7b260 Improve gui moddability by allowing to load an entire directory of scripts at once, and being able to split up big gui XML files. Fixes #2622
This was SVN commit r15330.
2014-06-11 17:14:35 +00:00
fd8ffb506b Remove commented out code and add licence headers to COList.cpp/.h.
This was SVN commit r15300.
2014-06-05 14:33:44 +00:00
2c14d94559 Replace usage of CParser for CColor.
Switches format to use integers only.
Adds logging if the string is invalid.
Refs #2589.

This was SVN commit r15278.
2014-06-04 00:58:05 +00:00
5ce12c2263 Start phasing out the use of CParser in the GUI. Makes GUI parsing generally faster and stricter while adding better tests and debug information.
This was SVN commit r15213.
2014-05-25 03:16:52 +00:00
f15160412a Enlarge the ideographic ranges in the word boundaries, fixes Japanese rendering a bit
This was SVN commit r15138.
2014-05-09 12:13:42 +00:00
62f5476dec Add support for adding translation context to XML elements. Patch by Gallaecio.
Add translation context to some lobby headers.

This was SVN commit r15078.
2014-04-30 22:33:08 +00:00
2ad7187f92 Move XMPP polling to the mainloop. Should reduce lobby disconnects. Fixes #2491
This was SVN commit r15018.
2014-04-27 05:37:34 +00:00
d1d7afe46c Implements ready status into gamesetup. Fixes #2447.
This was SVN commit r15006.
2014-04-26 18:34:34 +00:00
dc0deb5f52 Fixed bad fix in bc1ed335e2
Note: l777 had given me the right fix (%s), I fixed it wrong for no good
reason…

This was SVN commit r14989.
2014-04-25 02:56:08 +00:00
bc1ed335e2 Fix GCC warning on “source/gui/scripting/ScriptFunctions.cpp”
Reported by JoshuaJB at Github: https://github.com/leper/0ad/issues/27
Fix provided by l777 (who I believe to be leper but I don’t really know)
on IRC.

This was SVN commit r14985.
2014-04-25 00:38:30 +00:00
510ad15e6c Adds missing libs, fixes some svn properties and a build-problem on Windows.
In 1b3261b8f4 empty text files were committed instead of the libs.
The text files had svn:eol-style properties set and the mime-type was
text.
This removes the eol-style properties, changes the mime type and addes
the content of the files.

This was SVN commit r14959.
2014-04-20 23:47:52 +00:00
e05c8263c5 Internationalization of the public mod (JavaScript and GUI XML side)
It includes a marvelous language selection menu developed by Yves.

It also includes the introduction of a sprintf implementation for
JavaScript, as well as
translation helper functions that use JavaScript-side translation
caching.

This patch includes code by Yves, sanderd17, leper and Gallaecio.

Ref #67

This was SVN commit r14954.
2014-04-20 20:51:48 +00:00
d6db5a466d Internationalization of the C++ side
Provides the logic to detect the system language, load translations, and
use
loaded translations both in the C++ and the JavaScript side.

This patch includes code by Yves, sanderd17, leper, historic_bruno and
Gallaecio. It’s worth noting that Yves and historic_bruno were also the
main
contributors behind the changes in 1b3261b8f4 as well.

This was SVN commit r14953.
2014-04-20 20:03:57 +00:00
9e2d0b9506 Fix #2404. Rating auto-configure TODO (eg 2v2 games do not automatically show as being unrated). See #2276.
This was SVN commit r14934.
2014-04-16 06:03:49 +00:00
180aa5c60d Makes the moderator prefix visible in the chatbox.
This was SVN commit r14922.
2014-04-12 23:40:36 +00:00
833c2bac7a save/restore camera position and orientation in saved games, fixes #2354
This was SVN commit r14905.
2014-04-06 16:27:57 +00:00
e9e05f4efc Second (main) commit for the SpiderMonkey upgrade.
This commit contains all the required changes to our source files and
build scripts (hopefully).
A next commit will remove the old stuff of SpiderMonkey 1.8.5.

Spcial thanks to:
 - H4writer who helped a lot mainly with the performance issues we
had/have, but also with other problems or questions.
 - Leper for the review.
 - Historic_bruno for implementing the build scripts on Mac OS X and
testing on the Mac.
 - The people from the #jsapi channel and from
mozilla.dev.tech.js-engine who answered a lot of questions and helped
solving problems.
 - All the other people who helped

Refs #1886
Fixes #2442
Fixes #2416

This was SVN commit r14877.
2014-03-28 20:26:32 +00:00
cde72788a2 * Add support for fallback fonts in the font builder.
* Replace DejaVu with Biolinium for the existign sans-styles.
* Add additional sans-styles using Biolinum.
* Update the GUI style definitions to use the sans-styles instead of
serif styles.
(Wait with updating custom defined fonts in strings, as it will cause a
mess with the internationalisation that's about to be included)
* Add fonts from the quite complete FreeFont family as fallback fonts.
* Render all glyphs supported by the different fonts to support as many
scripts as possible.
* Fixes #2457.
(Now hope I included all needed files)

This was SVN commit r14853.
2014-03-17 10:13:49 +00:00
fb65288463 Fix hover effect not regenerating after mousedown events, minor GUI code cleanup, and fix #2414
This was SVN commit r14819.
2014-03-07 22:43:57 +00:00
8f30e722ab Some inconsequential style adjustments.
This was SVN commit r14809.
2014-03-06 02:24:06 +00:00
02024370d8 Fix a warning in Visual Studio 2010 related to some of my recent changes.
This was SVN commit r14805.
2014-03-05 01:06:13 +00:00
e182b4ddd2 Fix a valgrind warning about uninitilized variables in the scrollbar code and some comment/style fixes.
This was SVN commit r14764.
2014-02-19 21:59:07 +00:00
72d306873f Correctly handle the keypad enter in CInput.cpp and make the return key case catch SDLK_RETURN instead of '/r' for consistancy and readability.
This was SVN commit r14730.
2014-02-03 21:46:27 +00:00
39fef5c299 Add the ability to display chat messages when joining the lobby and quickly mostly update the options window to the new UI style.
This was SVN commit r14679.
2014-01-26 05:39:55 +00:00
041c6ab1b3 More lobby cleanup.
This was SVN commit r14677.
2014-01-26 04:25:35 +00:00
b46a6de335 Allow using the XMPP room subject to display lobby information to user, make the lobby GUI code more readable, and cleanup the modern styles.
This was SVN commit r14656.
2014-01-24 18:20:15 +00:00
dd274113bc Fix #2403
This was SVN commit r14655.
2014-01-24 18:15:42 +00:00
e5e634f768 Displays ratings in the userlist. Fixes #2371.
This was SVN commit r14650.
2014-01-23 23:13:13 +00:00
41d3366f6a check version and mods before loading a file, fixes #2361 and #2385.
This was SVN commit r14630.
2014-01-21 22:49:42 +00:00
377c780ddd Fixes the problem that functions in globalscripts aren't available from GUI scripts anymore since 4b1297b328.
Refs #2241

This was SVN commit r14592.
2014-01-17 18:21:27 +00:00