175 Commits

Author SHA1 Message Date
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
Marc
89df01f9bb * fix: js timers should now stop and be garbage collected when the script they're attached to goes out of scope.
* fix: timer related windows DEP crashes should now be a thing of the past. Tested with timer-crash-test oxp & windows XP Data Execution Prevention turned on.

Both fixes seem fine, but we'll need to test them thoroughly.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2724 127b21dd-08f5-0310-b4b7-95ae10353056
2009-11-06 03:14:32 +00:00
Marc
47f9f2c920 * corrected manifest miscount when ship in flight.
* last change to player.ship.manifest: manifest.food & similar are now read/write manifest quantities. Internally all commodities are now going to be referenced by the canonical identifiers, commodities.plist still overrides the displayName - the .manifest.list array is unchanged, and still read-only.
* renamed 2 ship properties for consistency: ship.availableCargoSpace & ship.cargoCapacity now become ship.cargoSpaceAvailable & ship.cargoSpaceCapacity.

- more code tidying.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2637 127b21dd-08f5-0310-b4b7-95ae10353056
2009-10-06 09:09:08 +00:00
Jens Ayton
c090222c17 Abstracted away testing of different NSNumber types.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2527 127b21dd-08f5-0310-b4b7-95ae10353056
2009-09-19 17:52:38 +00:00
Jens Ayton
6769ee509f Renamed oolite-javascript-errors.plist to javascript-errors.plist for internal consistency (config files aren't subject to namespace issues).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2495 127b21dd-08f5-0310-b4b7-95ae10353056
2009-09-13 15:42:34 +00:00
Jens Ayton
33c3787b58 Yet more static analyzer fun: removed an unused ivar from Cocoa MyOpenGLView. Fixed bug where AI method dropMessages: didn't work if more than one message was specified. Fixed missing break; in a switch in energy unit trade-in handling. Removed some bits of dead code.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2440 127b21dd-08f5-0310-b4b7-95ae10353056
2009-09-08 20:07:57 +00:00
Jens Ayton
6244814f2f Fixed Mac Deployment configuration (it isn't supposed to be exporting anything). Log header now lists [GLSL Shaders] and [OXP Debug Features] as appropriate.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2429 127b21dd-08f5-0310-b4b7-95ae10353056
2009-09-08 13:54:06 +00:00
Marc
e93b8aa9ee Mac build:
- really removed all traces of 10.3 from the build settings now(probably)
- changes to codebase to enable Deployment builds to link properly, might affect other platforms builds.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2428 127b21dd-08f5-0310-b4b7-95ae10353056
2009-09-08 13:37:28 +00:00
Jens Ayton
4b8e979dbd Because I'm an idiot, this commit contains two completely unrelated big changesets.
1. Cache tweaks:
* No longer try to delete 1.67-era cache file.
* On-disk cache is ignored when switching to strict mode (instead of nuking it).
* Avoid redundant caching of AIs, mesh file contents (in-memory only) and resolved paths for meshes.
* Cache sanitized scripts.
Also, factored out lots of copying in script sanitizer into one OODeepCopy() at the end (which coalesces identical strings across the whole script).

2. CollectionExtractors cleanup:
All OOCollectionExtractors category methods on Foundation classes now have an oo_ prefix. This is good design anyway, but sort of came to a head when it turned out Zbond-Zbond's crash was caused by an incompatible -[NSMutableDictionary setFloat:forKey:] method from a third-party input manager hack.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2411 127b21dd-08f5-0310-b4b7-95ae10353056
2009-09-06 15:56:32 +00:00