Jens Ayton
8589c5a13e
Optimized JS-to-native string converters to avoid up to three unnecessary class method calls. Informally deprecated stringWithJavaScriptString:, stringWithJavaScriptValue:inContext: and stringOrNilWithJavaScriptValue:inContext: in favour of OOStringFromJSString(), OOStringFromJSValueEvenIfNull() and OOStringFromJSValue() (formerly OOJSValToNSString()).
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4011 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 22:13:17 +00:00
Jens Ayton
7fd1f70f04
Implemented watchdog timer for newjs.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4008 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 21:47:45 +00:00
Jens Ayton
124ba843b5
New OOJS_BEGIN_FULL_NATIVE()/OOJS_END_FULL_NATIVE macros bracket potentially-slow blocks of ObjC code called from JS callbacks, mostly replacing OOJSPauseTimeLimiter()/OOJSResumeTimeLimiter(). In addition to frobbing the time limiter, they handle JS request management.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4005 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 14:29:30 +00:00
Jens Ayton
6e515e60ed
Big renaming of JavaScript helpers for internal consistency and clarity.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4004 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-05 12:58:27 +00:00
Jens Ayton
ec371a8511
JS expandDescription() and expandMissionText() override parameters are now stringified the JavaScript way rather than by coercing them to ObjC objects and calling -description.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3999 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-04 17:40:47 +00:00
Jens Ayton
cb8597bc7d
JavaScript warnings (but not errors) which are squelched in logcontrol.plist are now hidden from the JS console too.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3993 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-04 15:24:45 +00:00
Jens Ayton
4fac70192f
Cleaned up oolite-default-ship-script.js for strict mode.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3963 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-03 00:27:00 +00:00
Jens Ayton
c7e0b2d17e
Fixed non-debug builds.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3948 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 15:48:38 +00:00
Jens Ayton
ecfef79f97
File and line information is now suppressed for code called through the console.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3946 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 13:41:50 +00:00
Jens Ayton
96df45381e
Further tightened new JS underlying object accessors, and fixed test case regressions for the implicit-conversion-from-entity case.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3943 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 12:26:36 +00:00
Nikos Barkas
b57f41acaf
Fixed build breakage when JS_THREADSAFE was not defined.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3942 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-01 09:44:17 +00:00
Jens Ayton
9aa698b483
All JS Ship methods now get their "this" value consistently, including treating the player ship as non-existent during the escape pod sequence, and in a way that isn't trivially crashed - for example, Ship.setAI.call(new Vector3D, "") now works as expected, i.e. raises a JS exception.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3938 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-31 16:08:04 +00:00
Jens Ayton
ded11b65a3
Made JSEntityGetEntity() and similar accessors more efficient. Started work of making native callbacks explicitly return VOID when necessary, as this is no longer handled implicitly when not setting a return value.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3937 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-31 15:30:07 +00:00
Jens Ayton
b057dcfeb3
Enabled method JIT (JaegerMonkey) in Mac newjs builds. Activated JIT in non-debug builds on all platforms.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3924 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-30 14:30:11 +00:00
Jens Ayton
fc134f42c9
Fixed oldjs NSDictionary -> JS Object coersion handler. Fixed return value of console.getProfile().
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3911 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-26 15:39:38 +00:00
Jens Ayton
6d86b802e8
JS String and Number objects can now be coerced to NSString and NSNumber using JSObjectToObject(). In practical terms, this means callObjC() now works on them. Also cleaned up some error messages pertaining to callObjC().
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3910 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-26 14:04:32 +00:00
Jens Ayton
049ac7a1bf
Fixed JS timers in newjs.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3892 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-19 20:08:43 +00:00
Jens Ayton
2aa48deafc
Fixed newjs method calls. Game now runs and console works, but crashes in unit tests because constructors are written wrong.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3886 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-19 13:52:00 +00:00
Jens Ayton
abdf19a77a
More requestificiation.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3884 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-18 23:01:06 +00:00
Jens Ayton
25b8310c6c
New JS work: fixed a rooting error and added a bunch of requests.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3883 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-18 22:15:27 +00:00
Jens Ayton
cf81db538f
Work on JavaScript API update: began work on meeting thread-safe API requirements. Game now loads and runs with trunk libjs.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3861 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-17 14:45:55 +00:00
Jens Ayton
10639d6f52
Work on JavaScript API update.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3859 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-17 12:47:53 +00:00
Jens Ayton
a655c81d87
Work on JavaScript API update: updated all property callbacks.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3850 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 20:13:39 +00:00
Jens Ayton
75381a4f59
Work on JavaScript API update; all use of JSExtendedClass/JSEqualityOp removed. ==/!= no longer works for distinct Oolite-defined objects. This primarily affects Vector3D and Quaternion.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3849 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 19:10:23 +00:00
Jens Ayton
07c6aa06c9
Work on JavaScript API update.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3848 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 18:58:07 +00:00
Jens Ayton
1242dfdd67
Work on JavaScript API update.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3845 127b21dd-08f5-0310-b4b7-95ae10353056
2010-12-12 16:22:26 +00:00
Marc
ec4a512194
* Primable equipment! Use shift-n to select, and n to activate the equipment.
...
- New primed equipment key in savegames.
- Equipment scripts only respond to the activate event.
- Equipment scripts have access to this.equipmentKey, which contains the equipment type the script is associated to (e.g. 'EQ_WHATEVER')
* More commsMessage stuff:
- new parameter: ship.commsMessage(message [, toShip]) the second - optional - parameter now allows for narrowcast, as opposed to generic broadcast within scanner range - in crowded systems it's faster to narrowcast to a couple of ships, than to just broadcast the message to all ships in range!
- commsMessageReceived event: the ship sending the message is now passed as a second parameter to the event handler.
* new equipmentInfo property: scriptName
* new ship property: isPiloted
* assorted code cleanup...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3799 127b21dd-08f5-0310-b4b7-95ae10353056
2010-11-10 21:49:23 +00:00
Jens Ayton
0ffdb23b86
Fixed a JS crash.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3726 127b21dd-08f5-0310-b4b7-95ae10353056
2010-07-28 14:32:05 +00:00
Marc
2448a4f38f
- OK, now all copyright notices inside the code should be up to date!
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3654 127b21dd-08f5-0310-b4b7-95ae10353056
2010-07-03 18:45:37 +00:00
Jens Ayton
18bebd07c7
Started deploying profiling and thread-safety macros - even if they don't work in Windows, they're useful elsewhere. Profiling is now used on all Vector3D and Quaternion methods, all System methods, and the hot path for System.addShips(). Disabled aggressive JS GC testing in Mac TestRelease builds, so that profiling results are vaguely useful.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3623 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-27 13:25:08 +00:00
Jens Ayton
5ea3215c1c
Cleaned up JS exception wrapper stuff.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3588 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-22 18:08:10 +00:00
Jens Ayton
32e1884e05
Groovy yet horrible macros to automate conversion of ObjC macros to JavaScript macros, and also profile individual native callbacks. More info in the Top Secret Mailing List Treehouse.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3586 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-21 18:07:47 +00:00
Jens Ayton
b2120abb35
Sorted some JS property and method declarations alphabetically to make checking their corresponding wiki pages easier.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3560 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-17 22:57:31 +00:00
Jens Ayton
2d7a435327
Include full path in stack trace for files named script.js/. Extended time limit for script loading and startUp().
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3550 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-15 22:36:48 +00:00
Jens Ayton
00ffca2f26
Implemented rudimentary stack backtrace for JavaScript.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3548 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-15 20:28:22 +00:00
Jens Ayton
844b875396
Added basic profiling facility for JavaScript. Examples of use:
...
console.profile(function(){ console.shaderMode = "SHADERS_OFF"; });
or
:profile console.shaderMode = "SHADERS_OFF"
either of which print a string like:
0.94239 seconds (2.00559e-05 seconds JavaScript, 0.94237 seconds extension
time)
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3543 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-15 16:28:42 +00:00
Jens Ayton
2d9346496c
Fixed JS time limiter behaviour for system.filteredEntities().
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3542 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-15 14:14:20 +00:00
Jens Ayton
217273cc7a
Pause time limiter when logging.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3535 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-13 21:39:29 +00:00
Jens Ayton
3472aabce9
[Mac] Added dock tile menu to show log, screen shots etc. In Snow Leopard, it sticks around when the app quits if it's still in the dock. Also, option->show log shows the log folder.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3530 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-13 20:08:57 +00:00
Jens Ayton
0e9ee84562
Added some documentation for JS script limiter in OOJavaScriptEngine.h. Pause limiter while spawning ships or planets, and while searching entities.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3529 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-13 19:13:09 +00:00
Jens Ayton
528abd2ac6
Implemented time limiter for JavaScript scripts. Set to be extremely aggressive for testing.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3528 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-13 18:51:07 +00:00
Jens Ayton
1edaad2aba
Fixed temporary object rooting problems when converting dictionaries and arrays to JS representations.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3509 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-12 19:36:22 +00:00
Jens Ayton
b2220bf4f8
Fixed crash with repeated transient uses of JS EquipmentTypes - triggered by Cataclysm and almost certainly lots of others.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3496 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-11 10:36:08 +00:00
Jens Ayton
dcd183bae9
Fixed bad GC roots in OOJSFunction. Avoid extra allocation in JS Timer constructor.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3472 127b21dd-08f5-0310-b4b7-95ae10353056
2010-06-06 12:31:51 +00:00
Jens Ayton
141bd16b1a
Actually disabled the thing I said I disabled in 3403.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3404 127b21dd-08f5-0310-b4b7-95ae10353056
2010-05-24 19:38:05 +00:00
Jens Ayton
c1bf8843ae
Disabled attempt to distiguish between boolean and integer NSNumbers when converting to JS values, because that distinction cannot be made in GNUstep.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3403 127b21dd-08f5-0310-b4b7-95ae10353056
2010-05-24 19:25:58 +00:00
Jens Ayton
3684e96da8
Added optional explicit this parameter to Mission.runScreen. Avoid potential GC-related crash in mission screen completion callback.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@3137 127b21dd-08f5-0310-b4b7-95ae10353056
2010-04-10 10:06:15 +00:00
Jens Ayton
1e2e56b4b1
NEW_PLANETS now applies to scripted planets. If NEW_PLANETS, the old PlanetEntity and TextureStore are now completely excluded. Most of the kludges for dealing with both types of planet are gone.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2857 127b21dd-08f5-0310-b4b7-95ae10353056
2009-12-07 18:43:48 +00:00
Marc
f7affbc01a
MissionScreen RFC part II:
...
* missionScreenOpportunity now fires up after loading a savegame & at startup, as well as after docking.
* fixed a mission callback related crash.
* fixed clash with fines and mission screens.
* name change for new mission.runScreen parameter shipModel: is now showModel.
* the foreground & background images now display correctly in relation to the spinning demo ship.
- code cleanup
- added missing keys to the shipdata entry schema
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2758 127b21dd-08f5-0310-b4b7-95ae10353056
2009-11-17 18:27:11 +00:00
Marc
7bb627586f
* New mission.setInstructions to go with mission.setInstructionsKey, analogous to the mission.addText / mission.addTextKey pair.
...
* mission RFC part I. Initial implementation of the changes proposed in the forum. Will need tweaking.
* added new parameters to mission: title & foregroundImage (identical to backgroundImage atm)
* assorted code tidying up.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2750 127b21dd-08f5-0310-b4b7-95ae10353056
2009-11-15 00:24:23 +00:00