97 Commits

Author SHA1 Message Date
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
Jens Ayton
fd530bd5c6 Workaround for a nasty little SpiderMonkey bug/misfeature (supposedly fixed in 1.8): converting a JSObject or jsval to a JSFunction discards its context information, so effectively callbacks implemented using JS_CallFunction() were not closures. The workaround is to use jsvalues and JS_CallFunctionValue() instead.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2404 127b21dd-08f5-0310-b4b7-95ae10353056
2009-09-05 20:21:45 +00:00
Jens Ayton
0586f0a832 JS SystemInfo changes: added read-only properties coordinates, galaxyID and system, method distanceToSystem(), and static method filteredSystems(). Undefined SystemInfo properties are now undefined rather than null. Also added prefix helper function to get SystemInfo for all systems in a given range (default: 7 ly).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2403 127b21dd-08f5-0310-b4b7-95ae10353056
2009-09-05 18:19:23 +00:00
Jens Ayton
6aaf7a1e75 Committed unspeakable necromancy on the graveyard of the repository.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2331 127b21dd-08f5-0310-b4b7-95ae10353056
2009-08-29 23:09:22 +00:00
Jens Ayton
999fe7e969 Trying to convince svn that this deleted directory is really deleted.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2330 127b21dd-08f5-0310-b4b7-95ae10353056
2009-08-29 22:50:59 +00:00
Jens Ayton
9781d2b9d1 Fixed possible but unlikely cause of crashes in JavaScript error handling, and improved log message classes for JS errors (symbolic names instead of magic numbers).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2308 127b21dd-08f5-0310-b4b7-95ae10353056
2009-08-23 20:49:25 +00:00
Marc
021e398a64 * procedural texturing for planets reset to OFF by default.
* bugfix: JS system.info.xx & system.infoForSystem([present galaxy],[system number]).xx are readable, as originally intended. infoForSystem now returns null - and a warning - if trying to access any info outside the present galaxy.
* bugfixed the 'nil' javascript delayed crash described in http://aegidian.org/bb/viewtopic.php?p=8271182711 - required extensive code replace.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2282 127b21dd-08f5-0310-b4b7-95ae10353056
2009-08-12 23:51:16 +00:00
Nikos Barkas
d20853c290 Better fix for crash happening when a non existing jsvalue was passed to JSValToNSString. Fixes also a problem with the nova mission, where mission.setInstructions would not accept null as a parameter.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2135 127b21dd-08f5-0310-b4b7-95ae10353056
2009-04-20 23:56:38 +00:00
Marc
df8e39c8f0 Planets:
- planet now redrawn when detailed planets settings change.
- tweaks to F7 to show more planet details.

Scripting: bugfix for rare js crash to desktop.
Subentities: committed Screet's subentities fix.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2130 127b21dd-08f5-0310-b4b7-95ae10353056
2009-04-18 01:02:56 +00:00
Marc
1ca32740d8 Interface change: While in flight, pressing h from the local galaxy map will initiate hyperspace jumps - before, the player had to exit the map to do so. Partial refactoring of planet generation code: main planet positions are now consistent across platforms. Warning issued when 'abs' coordinates are used inside plists for spawning in normal space. Begun normalising errors & warnings, created OOLogERR & OOLogWARN as specialised OOLog cases.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2099 127b21dd-08f5-0310-b4b7-95ae10353056
2009-03-21 18:42:16 +00:00
Jens Ayton
18abac1954 Fixed stupid bug preventing JS ShipGroup from working.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2030 127b21dd-08f5-0310-b4b7-95ae10353056
2009-02-06 16:51:39 +00:00
Jens Ayton
dbde672d01 "Small" change to group and escort handling, now with explicit group objects. I really must stop making "small" changes. (N.b.: JavaScript ShipGroup currently fails to work in interesting ways.)
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2028 127b21dd-08f5-0310-b4b7-95ae10353056
2009-02-06 16:13:36 +00:00
Jens Ayton
3b1db9072d Work towards securing legacy scripts, AIs and shader uniform bindings by whitelisting methods. Game will now print an error message if non-whitelisted methods are used in AIs; in 1.74, this will be changed to dropping non-whitelisted commands from AI actions. My intention is to have similiar mechanisms in place for scripts and uniform bindings by 1.73 release.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1991 127b21dd-08f5-0310-b4b7-95ae10353056
2009-01-11 15:53:01 +00:00
Jens Ayton
8d22e3c41c Work on cleaning up Clang Static Analyzer diagnostics. In particular, moved away from redundant and broken JSFooGetFoo functions.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1850 127b21dd-08f5-0310-b4b7-95ae10353056
2008-11-10 23:41:00 +00:00
Jens Ayton
f575d75530 Added JS EquipmentInfo, wrapper around OOEquipementType.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1796 127b21dd-08f5-0310-b4b7-95ae10353056
2008-10-16 22:04:29 +00:00
Jens Ayton
87d724fc8a Fix for bug in prefix script adding player compatibility aliases to all objects.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1716 127b21dd-08f5-0310-b4b7-95ae10353056
2008-08-02 19:19:01 +00:00
Jens Ayton
3315272c00 Split JS Player object into Player and PlayerShip. Made curved sides of arc-detail smooth.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1710 127b21dd-08f5-0310-b4b7-95ae10353056
2008-07-28 17:34:37 +00:00
Jens Ayton
0b7f46ef3c Fixed invalid use of return inside NS_DURING block (must use NS_VALUERETURN/NS_VOIDRETURN).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1695 127b21dd-08f5-0310-b4b7-95ae10353056
2008-07-18 14:39:31 +00:00
Jens Ayton
717e72ffae New compiler, new warnings about problems that don't really exist.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1690 127b21dd-08f5-0310-b4b7-95ae10353056
2008-07-10 21:11:28 +00:00
Jens Ayton
6110052f8a Added JS system.info property and System.infoForSystem() function to replace setPlanetInfo: and setSpecificPlanetInfo:. Currently these are write-only, should be read/write.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1668 127b21dd-08f5-0310-b4b7-95ae10353056
2008-06-03 10:16:40 +00:00
Jens Ayton
b148cfd85d More work on JavaScript error checking. More rigourous! More informative! More not buggy! And, conversely, probably also more buggy. I've almost certainly broken something silly. Also moved JS nova-related functionality into Sun.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1648 127b21dd-08f5-0310-b4b7-95ae10353056
2008-05-23 07:51:00 +00:00
Jens Ayton
3c82f379e0 Fix for incorrect error handling in OOJSVector and OOJSQuaternion. Only 20 pseudo-classes left to handle! Also fixed Quaternion.rotate(), this time for real.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1646 127b21dd-08f5-0310-b4b7-95ae10353056
2008-05-20 17:15:41 +00:00
Jens Ayton
0bda7466a6 Changes to pave the way for JavaScript 1.8 upgrade.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1642 127b21dd-08f5-0310-b4b7-95ae10353056
2008-05-18 16:22:00 +00:00
Jens Ayton
9fb7456e20 (Woops, thought I did this last night.) Implemented stack for temporary local variables for non-world legacy scripts. (Previous approach was quite thoroughly broken, as it didn't allow reentrancy and broke locals for world scripts.) Moved -descriptionComponents and such into new OOCocoa.m, and added -shortDescription.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1433 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-29 15:48:00 +00:00
Jens Ayton
a420a4dbe6 Global JavaScript methods (which aren't constructors) now have names starting with lowercase letters, in accordance with JavaScript norms. There are compatibility aliases for the old forms. Log() and LogWithClass() merged into single log(). All JavaScript compatibility aliases for deprecated forms are now implemented in JavaScript, in the new oolite-global-prefix.js script. Changed all copyright notices regarding the project as a whole from 2004-2007 to 2004-2008.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1414 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-24 21:07:20 +00:00
Jens Ayton
98a4baf994 Tweaked SpiderMonkey build setup warning message. Fixed a cosmetic problem with -[AI dumpState].
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1372 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-13 11:55:19 +00:00
Jens Ayton
65574daac5 Fix for ReferenceErrors when more than one JavaScript context active. Added various logs and script messages to debug escort issues.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1355 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-09 16:37:34 +00:00
Jens Ayton
f11b6fae14 Implemented JS sound interface. Moved some more generic JS ObjC wrapper stuff into OOJavaScriptEngine.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1340 127b21dd-08f5-0310-b4b7-95ae10353056
2008-02-03 02:16:23 +00:00
Jens Ayton
a97c9fd093 Fixed a few leaks, notably one that became serious on the short-range chart screen. Fixed some warnings when building for Windows.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1282 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-24 13:59:30 +00:00