214 Commits

Author SHA1 Message Date
cim
5a84795861 Make ship.weaponPosition* return an array of vectors 2015-08-22 15:34:22 +01:00
cim
92c0482aad Show JS error locations when showLocation is true
That ! has been in there a very long time so I'm not sure how this ever worked.
2014-10-23 18:03:47 +01:00
cim
293e74fd05 system.allDemoShips property 2014-05-27 21:20:51 +01:00
cim
dd0e7194ea Possible fix for weakref/JS bug on GCC 4.6 - issue #76 2014-03-16 11:01:47 +00:00
cim
fb53a45ff2 JS interfaces to exhausts, flashers - closes #43
ship.exhausts
ship.flashers

Exhausts and flashers both have r/w .size property and .remove() method

Flashers might get some more properties later for colour/phase/etc.
2013-11-26 23:00:36 +00:00
cim
cbc0ac982e JS representation of waypoints
Change waypoint addition syntax to (label,position,orientation,definition) so that intuitive way of specifying position and orientation works.
2013-10-02 21:54:44 +01:00
cim
6f37e2fe16 Fix crash bug when second parameter to expandDescription is 'null' 2013-08-12 21:32:58 +01:00
cim
67c8f40349 JS garbage collection
Force garbage collection at more points where a short pause is okay. Log garbage collections called in update() for tracking purposes. So far they don't seem to have been needed with the additional planned ones.
2013-08-04 20:37:08 +01:00
cim
bc97187a11 Add read-only representation for wormholes (issue #34)
wormhole.arrivalTime
wormhole.expiryTime
wormhole.destination
wormhole.origin
entity.isWormhole
2013-06-30 10:22:15 +01:00
Chris Morris
a6e2f76f36 Skip applying thrust and rotation for subentities. They should never have anything to do there anyway, and it *might* be what's causing the strange rotation problems on some Macs. (It probably isn't, though)
Also note a few other areas profiling suggests might be good to optimise later.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5639 127b21dd-08f5-0310-b4b7-95ae10353056
2013-02-15 23:32:04 +00:00
Chris Morris
1d4986a063 Fix crash with non-string keys in a missionscreen choices dict.
A better fix might be possible, but might potentially break other things: see comments.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5638 127b21dd-08f5-0310-b4b7-95ae10353056
2013-02-15 20:37:40 +00:00
Nikos Barkas
afb09f9a7e Here goes another year. Happy 2013. The Reference Sheet and the Readme still need to have year references bumped.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5596 127b21dd-08f5-0310-b4b7-95ae10353056
2012-12-31 09:00:28 +00:00
Chris Morris
fa66877d65 Fix some more warnings.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5490 127b21dd-08f5-0310-b4b7-95ae10353056
2012-11-12 22:10:45 +00:00
Jens Ayton
cf71ebe559 Misc cleanup.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5434 127b21dd-08f5-0310-b4b7-95ae10353056
2012-10-18 20:13:35 +00:00
Jens Ayton
d217eee59d Eliminated OOInteger and OOUInteger.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5273 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-29 17:28:01 +00:00
Jens Ayton
8a760f99dd Modernized exception handling.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5271 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-29 16:08:10 +00:00
Jens Ayton
1b794459d3 Fixed a bad declaration and a GCC syntax incompatibility.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5262 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-26 20:27:42 +00:00
Jens Ayton
fd44f97b5b Deleted a bunch of #ifed-out and commented-out code that doesn't look likely to be reinstated.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5257 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-26 16:51:31 +00:00
Jens Ayton
83c9df2ed4 More integer truncation hunting.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5256 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-26 16:13:26 +00:00
Jens Ayton
c3eaa2d60e Eliminated deprecated JS string conversion methods.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5229 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-24 17:19:14 +00:00
Jens Ayton
0450f6c21c * Style and type safety cleanup.
* Added compatibility shim for instancetype keyword; see OOCocoa.h.
* Removed two -play methods in CoreAudio sound implementation which would cause an exception if actually used.
* Removed unused -[OOBreakPatternEntity breakPatternWithCircle.]
* Cleaned up header comments in debug OXP.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5225 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-24 16:02:30 +00:00
Chris Morris
44f1494b13 Initial addition of "Visual Effect" entities.
- effectdata.plist defines them
 - VisualEffect JS representation
 - System.addVisualEffect()
 - System.breakPattern and Station.breakPattern properties to allow override of usual break pattern
 - No appearance on scanner yet
src/Core/Entities/OOVisualEffectEntity and src/Core/Scripting/OOJSVisualEffectEntity will need adding to XCode project, please.


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5212 127b21dd-08f5-0310-b4b7-95ae10353056
2012-08-19 17:09:51 +00:00
Jens Ayton
90fe22a980 Updates for Xcode 4.4 and Apple LLVM Compiler 4.0 (~= clang 3.1):
* Fixed numerous format string problems, many of them real bugs.
* Added format attribute to OOLog, and fixed more format string problems.
* Cleaned up misuse of +[NSString stringWithString:].
* Updated OS X SDK to 10.7. Deployment target is still 10.5, although ideally
  it should bet 10.6 for 64-bit. (See also long comment in
  oolite-targets.xcconfig.)


git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5139 127b21dd-08f5-0310-b4b7-95ae10353056
2012-07-28 14:26:00 +00:00
Chris Morris
b66fbebcc0 Add basic JS representation of DockEntity
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5064 127b21dd-08f5-0310-b4b7-95ae10353056
2012-07-11 11:52:23 +00:00
Jens Ayton
1dce047d0f Cleanup.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5054 127b21dd-08f5-0310-b4b7-95ae10353056
2012-07-08 20:02:17 +00:00
Jens Ayton
8266c8b099 Raised JavaScript heap limit (intended to do it a while ago but forgot).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5023 127b21dd-08f5-0310-b4b7-95ae10353056
2012-06-21 06:56:20 +00:00
Jens Ayton
5faafd0020 Fixed various memory issues flagged by new Clang checker.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4790 127b21dd-08f5-0310-b4b7-95ae10353056
2012-02-24 02:08:01 +00:00
Michael Werle
7312ad733c Bump copyright to 2012. Happy New Year!
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4692 127b21dd-08f5-0310-b4b7-95ae10353056
2012-01-03 16:08:14 +00:00
Marc
47786d1f79 - fix: in debug mode, Oolite would occasionally CTD after non-fatal linkedlist errors.
- fix: only call frameCallBacks when game is actually running.
- fix: js reset problems should not stall/crash the game anymore. Kept test harness (#if 0-ed) for further tests.
- yep, some code cleanup.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4664 127b21dd-08f5-0310-b4b7-95ae10353056
2011-11-27 12:42:09 +00:00
Marc
8714d26cd1 * Broken galdrive fix part II: broken or removed galdrive equipment during countdown generates the .playerJumpFailed('malfunction') event.
* Tentative fix for [ Bug #18322 ] Can't reset javascript.
- Improved log messaging: somewhat clearer 'can't reset javascript' log message, also initial speech synth status now written to the log.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4648 127b21dd-08f5-0310-b4b7-95ae10353056
2011-11-16 02:00:26 +00:00
Michael Werle
200902f9da Applied a (slightly tweaked) patchset sent in by Nicolas Boulenguez, the Debian maintainer of Oolite.
Changes consist of:
 - use #include instead of #import for C header files.
 - explicitly #include <assert.h> in various source files.
 - tweaks to build process for Debian.
 - deleted obsolete src/SDL/make* package building scripts.

"Works for me" - please check build process still works for you; esp. on Windows
.



git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4433 127b21dd-08f5-0310-b4b7-95ae10353056
2011-03-05 03:14:05 +00:00
Jens Ayton
2e788a219d Converted all unguarded oo_jsValueInContext:s to OOJSValueFromNativeObject().
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4356 127b21dd-08f5-0310-b4b7-95ae10353056
2011-02-14 21:57:58 +00:00
Jens Ayton
3c8bc3c3ef OOJSValue objects now relinquish their JS values when JS environment resets.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4301 127b21dd-08f5-0310-b4b7-95ae10353056
2011-02-11 16:42:46 +00:00
Jens Ayton
8101d17c8c JavaScript environment is now reset when auto-reloading player.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4300 127b21dd-08f5-0310-b4b7-95ae10353056
2011-02-11 13:29:46 +00:00
Jens Ayton
e20c9cc512 Removed support for old-style exceptions.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4298 127b21dd-08f5-0310-b4b7-95ae10353056
2011-02-11 11:46:01 +00:00
Nikos Barkas
722ae918fd Fixed missing terminating ' character warning.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4294 127b21dd-08f5-0310-b4b7-95ae10353056
2011-02-11 07:45:26 +00:00
Jens Ayton
435c218d6e JS audit: OOJSEntity. Also cleaned up some redundant [entity isPlanet] && ![entity isSun] checks - -[OOSunEntity isPlanet] is false.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4289 127b21dd-08f5-0310-b4b7-95ae10353056
2011-02-10 23:47:42 +00:00
Jens Ayton
150dd2b9a5 JavaScript console and global object are now rebuilt when resetting the game, to make it impossible to smuggle information across sections. There seem to be minor JS-related leaks as a result. Be on the lookout for exciting new crashers! As an arguably unfortunate side-effect, the console currently doesn't work when resetting into strict mode.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4210 127b21dd-08f5-0310-b4b7-95ae10353056
2011-02-01 21:12:38 +00:00
Jens Ayton
5e4d3e5695 Purged OO_NEW_JS. Now would be a good time for comprehensive test builds.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4197 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-30 17:27:40 +00:00
Jens Ayton
c997498109 Found the random combination of documentation and source code comments that makes it clear that DOUBLE_TO_JSVAL is invalid when value may be an integer, and switched everything to JS_NewNumberValue() (which is like JS_NewDoubleValue() only different, since JS_NewDoubleValue() was also invalid for potentially-integer values).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4196 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-30 16:30:06 +00:00
Jens Ayton
177ffb9baf Took a detour to improve printing of values in error messages and debug things.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4195 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-30 15:33:06 +00:00
Jens Ayton
69444e6943 Oldjs removal: various thin wrappers and stuff.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4194 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-30 14:49:46 +00:00
Jens Ayton
45de8ac142 Oldjs removal: started on replacing JS_NewDoubleValue() with DOUBLE_TO_JSVAL(), ended up reforming accessor error handling. Lots more to come.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4193 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-30 14:33:39 +00:00
Jens Ayton
019f71973e Further JavaScript streamlining.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4156 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-25 20:19:35 +00:00
Jens Ayton
a9fda60269 Belatedly remembered that the whole multiple-JavaScript-context thing was a completely bogus hack to work around bad exception handling, and ripped it out for the slight simplicity win.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4142 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-24 17:17:43 +00:00
Jens Ayton
ade28ce185 Work on reducing the number of object translations involved in script dispatch. Also, hid every single JS_BeginRequest()/JS_EndRequest() pair inside OOJavaScriptEngine by baking them into acquireContext and releaseContext:.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4140 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-24 16:28:46 +00:00
Jens Ayton
b368c831af Aforementioned oldjs shenanigans, now with usefulness.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4139 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-23 22:35:05 +00:00
Jens Ayton
babf28f15b Workaround for defective ObjC type checking in gnu-gcc.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4138 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-23 22:33:45 +00:00
Jens Ayton
19c2ad245a More oldjs shenanigans.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4137 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-23 22:29:49 +00:00
Jens Ayton
d1c880e315 Converters defined with DEFINE_JS_OBJECT_GETTER() now show up with their real name in profiles.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4134 127b21dd-08f5-0310-b4b7-95ae10353056
2011-01-23 21:20:00 +00:00