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
Jens Ayton
3fbc24887d
* All ships now have a JavaScript script attached, allowing JS scripts to
...
add behaviours to any ship.
* Legacy script_actions, setup_actions, launch_actions and death_actions
handled through default JavaScript script.
* In order to implement the above, JS Ship now has a runLegacyScriptActions
method. This is not to be exposed as an "official" method, though, since
we might want to change the mechanism -- for instance, to "compile"
legacy scripts into JS. Handling dynamically-generated legacy scripts in
that case would be a significant complication.
* Updates for Mac OS X 10.5 "Leopard".
- Errors on reading/writing plist will not cause a crash if building
against the Leopard SDK. (I have no intention of requiring Leopard any
time soon, but future-proofing is good.)
- OOWeakReference is now more efficient when running under Leopard, by
implementing the new "fast forwarding" mechanism.
- Threads now have names set under Leopard, which may provide debugging
advantages.
- Fixed some new build warnings for new version of apple-gcc.
- Updated type declarations to identify Oolite saved games as property
lists.
* Cleaned up PlayerEntityControls.m somewhat. Moved method declarations
into files, fixed indentation, broke up monster giant method of doom.
* Script-generated asteroids now behave like system populator-generated
asteroids (As Seen on BB[TM]).
* Minor optimizations and simplifications of legacy script engine.
* JS System.filteredEntities() now has sensible behaviour if predicate
throws an exception: the predicate is not called again, and null is
returned. The exception is reported and not rethrown.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1240 127b21dd-08f5-0310-b4b7-95ae10353056
2007-11-23 15:04:14 +00:00
Jens Ayton
8dac1d08cd
Split JS Planet into Planet and Sun in anticipation of splitting PlanetEntity in same way.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1214 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-15 13:20:27 +00:00
Jens Ayton
6a8c7976dd
Added scriptInfo dictionary to ships, and global JS objects worldScripts and worldScriptNames. Fiddled with messages on both sides of debug console. Fiddled with flags on JavaScript classes, hopefully for the better.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1211 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-13 15:10:16 +00:00
Jens Ayton
c69733ac93
Changed to using a pool of JavaScript contexts instead of a single one, so that JS -> ObjC -> JS call chains work. I'm not sure I fully trust this, but it appears to work. Need to think up some serious stress tests.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1207 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-09 18:02:18 +00:00
Jens Ayton
d675db1622
JS entity-searching functions now return results sorted by proximity to reference entity, if specified. Cleaned up implementation, too.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1200 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-08 12:06:39 +00:00
Jens Ayton
160cd8b94d
Implemented JS class Planet. Added JS System attributes mainPlanet, sun, planets and allShips, and methods shipsWithPrimaryRole(), shipsWithRole(), entitiesWithScanClass() and filteredEntities() (the latter disabled due to an architectural flaw -- we need more than one JSContext). In support of this, added/exposed generic predicate-based entity counters and getters to Universe.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1198 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-07 21:41:18 +00:00
Jens Ayton
9994475a5a
Fixed Mac debug console. Added auto-generated stripped-down debug.oxp to trigger TCP console support.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1192 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-06 13:25:59 +00:00
Jens Ayton
8904c39401
Oolite should now build with external debug console support on all platforms. Mac debug OXP is broken.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1191 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-06 11:03:01 +00:00
Jens Ayton
3c16a7cdaf
Added clearMissionScreen scripting method (legacy and JS). Scripting tweaks. Ported trumble mission to JavaScript. Attempted to address JS Ship.escorts bug but couldn't reproduce it.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1187 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-29 12:27:31 +00:00
Jens Ayton
ff941ad9ff
More explicit message about the need to set JS_C_STRINGS_ARE_UTF8. Explicitly set scanClass of 'barrel' to CLASS_CARGO for scripted creation.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1186 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-29 09:08:31 +00:00
Jens Ayton
7d99e403a5
Experimental support for caching of compiled JavaScript (can be disabled with -DOO_CACHE_JS_SCRIPTS=0). Implemented JS Vector.rotateBy(quaternionExpression).
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1181 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-22 15:16:40 +00:00
Jens Ayton
fca7042527
More consistent use of JS-friendly description mechanism. Cleaned out redundant and unused particle types, and improved encapsulation of ParticleEntity.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1178 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-16 11:58:13 +00:00
Nikos Barkas
9051c61d31
Fixed a compile error when ALLOW_PROCEDURAL_PLANETS was defined. Eliminated some build warnings.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1177 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-16 11:01:16 +00:00
Jens Ayton
7e4b1b0880
Implemented JS clock global object, unbroke makefile.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1175 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-15 15:09:19 +00:00
Jens Ayton
0da77044e5
Implemented JS Timer object. Updated priority queue test case.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1173 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-15 13:53:30 +00:00
Jens Ayton
77df587d1a
Split out remaining JS classes from OOJavaScriptEngine.* into new files. Added expandable pirate-victim recognition via pirate-victim-roles.plist. Added a number of AI methods for searching for entities by role and scan class.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1169 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-12 17:00:59 +00:00
Jens Ayton
51afdc0a40
Fixes for minor build problems.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1159 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-05 14:43:53 +00:00
Jens Ayton
a265c06344
* Work on generic-ish JavaScript object bridging.
...
* Fixed potential crashing bug in JS memory management (OOJSScript was not releasing its JS GC root).
* Fixed bug with several shipdata.plist settings being ignored in StationEntitys (bug #11684 ).
* Added JS Oolite object for app and JS version number checking; may add other facilities.
* Require latest version of SpiderMonkey (Gecko 1.8/FireFox 2 version) with JavaScript 1.7 support, built with JS_C_STRINGS_ARE_UTF8.
*Made SpiderMonkey build as a subproject in Xcode for ease of debugging.
* Further fiddling with Mac debug console.
* Added has_npc_traffic attribute to StationEntity.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1157 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-04 23:04:09 +00:00
Jens Ayton
2df17375b1
Missing files from r1153.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1154 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-01 12:07:02 +00:00
Jens Ayton
6980e1d9d6
Various JS scripting fixes. Threw out all Convert ops and replaced them with toString methods, which is simpler and actually works.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1148 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-28 00:22:12 +00:00
Jens Ayton
699e5f5ff6
Fixed bug where player's dockedStation was nil at startup (due to circular dependencies). Added Build All target to Xcode project to avoid circular dependency between Oolite and Debug.oxp. (The Oolite target now no longer builds Debug.oxp. Build All builds Oolite, then builds Debug.oxp, then copies Debug.oxp into AddOns.)
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1147 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-27 13:17:43 +00:00
Jens Ayton
b455b2b8fd
Interactive JS console working, with some bugs (failure to convert certain types to string, bugs in Oolite NSArray <-> JS array bridge). Basic macro system (implemented in JavaScript) works. A few debugging functions.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1146 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-25 18:15:41 +00:00