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
07fc2a25b6
Fixed some bugs in OXP verifier.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1325 127b21dd-08f5-0310-b4b7-95ae10353056
2008-01-28 01:24:40 +00:00
Jens Ayton
c812e61ad9
More data-driven text rendering with eight-bit encoding support.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1323 127b21dd-08f5-0310-b4b7-95ae10353056
2008-01-27 23:37:56 +00:00
Jens Ayton
f2f194ee49
Fixed a bunch of warnings under Windows, some of which even made sense.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1294 127b21dd-08f5-0310-b4b7-95ae10353056
2008-01-02 14:35:54 +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
4919cb197e
Changed OOCreditsQuantity to uint64_t.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1274 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-13 11:53:25 +00:00
Jens Ayton
c1dd9c5b1a
Fix for bug where awardEquipment:EQ_TRUMBLE while a trumble infection is in progress would innoculate the player against future trumble infections. Also added code to un-innoculate existing saved games.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1264 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-04 21:43:18 +00:00
Jens Ayton
ea5d5fc9e9
Fix for error messages when loading TestRelease build of Debug OXP (Mac only).
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1263 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-04 17:44:06 +00:00
Jens Ayton
4546eb0baa
Fix for OXP verifier turning of log message classes. Exterminated all uses of NSLog that turn up in Mac builds.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1257 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-03 17:53:37 +00:00
Jens Ayton
df05fbd65f
Updated version numbers.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1250 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-02 20:43:08 +00:00
Jens Ayton
2ca470e07f
Fix for bug 011691 Cancelling load game dialog handled badly, work-around for bug 011893 Full-screen mode menu input broken reinstated and cleaned up.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1248 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-02 14:21:46 +00:00
Jens Ayton
56eb8f1738
Renamed a bunch of script handlers and gave NPC scripts some events that only player scripts got before. Added compatibility mechanism to point out uses of old handlers.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1247 127b21dd-08f5-0310-b4b7-95ae10353056
2007-12-02 00:50:06 +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
9d9128bcb1
* Got Game Options submenu working under OS X.
...
* Save reduced detail, wireframe and shader settings in preferences.
* Implemented variable shader complexity support.
Added default shader, used for all otherwise-unshaded ships with full shaders on, and for smooth ships or ships with effect maps specified in material dictionary with simple shaders.
* All ships now drawn with slight specular highlight by default (shininess = 10, intensity = 0.2) except in reduced detail mode.
* (JS) Made Ship.shipDescription read-write (except for the player).
* (JS) Added global function ExpandDescription(string : String), to perform substitutions like %H, [commander_name] and so forth.
* (JS) Added global function RandomName(), intended to be like %R substitution. In so doing, I discovered that %R is broken, but left it as-is so it will generate the same name for existing descriptions. Added %X to do the same thing, but without the bugs. RandomName() is different from either in that it doesn't use the "predictable" PRNG, so it will provide a new name each time. To use the "predictable" variant in JavaScript, use ExpandDescription("%X").
* Ships that hyperspace out are no longer replenished in interstellar space.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1228 127b21dd-08f5-0310-b4b7-95ae10353056
2007-10-22 12:18:18 +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
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
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
8b098b3b76
Implemented Player.commsMessage() and player.consoleMessage() JS methods. Mucked about with key_dump_target_state -- now debug/test build only.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1183 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-23 14:32:40 +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
7b061ad0f7
Work on script timers.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1172 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-14 15:21:06 +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
693c27e2c2
Added OORoleSet to manage sets of ship roles and probabilities. Now used in -[Universe newShipWithRole:]. Next step: replace ShipEntity.roles with an OORoleSet. Future step: store role sets -- and other attributes -- in 'ship type' objects instead of parsing on the fly.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1165 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-07 10:14:30 +00:00
Jens Ayton
d47bf18321
Refactored debug OXP into a client-server design, potentially allowing external versions of the JavaScript console over Distributed Objects or TCP/IP.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1164 127b21dd-08f5-0310-b4b7-95ae10353056
2007-09-06 22:56:58 +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
803aa63c67
Mac JS console: implemented history (option-up/down arrow).
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1150 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-28 16:55:52 +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
3cb87b1aab
Fixed Mac breakage due to previous fix for non-Mac breakage.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1145 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-25 02:21:31 +00:00
Jens Ayton
a1451d4a3e
Dicking around with Mac-specific debug stuff instead of doing real work. Added JavaScript console window (intended to be interactive, but isn't yet; shows errors, warnings and JS-generated log messages a bit more prettily than the standard log). Added F-Script support (F-Script is not yet another OXP scripting language, it's an interactive language integrated with the ObjC runtime, making a useful debug tool for poking around).
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1141 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-25 01:15:40 +00:00
Jens Ayton
f5e3b4894e
Made Mac debug OXP a loadable module instead of including code in Oolite itself.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1139 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-23 20:18:22 +00:00
Jens Ayton
0ffb248771
For the past two weeks I've been procrastinating from fixing a double-free bug in the JS accessor for Ship.escorts (or, more precisely, in the code constructing a JS array). The bug was in r1129, so not checking stuff in doesn't really make much sense.
...
Fixes in that time:
* Clean, integrated model for JS ship scripts and world scripts.
* Player ships support JS ship scripts (but not ones synthesized from legacy actions).
* Subentity shader uniform bindings bind to owning ship as intended.
* Fixed like_ship recursion limiter in -[Universe getDictionaryForShip:].
* Fixed a bug in material configuration parsing.
* Fixed a material bug where a shader material with textures, followed by a shader material with no textures, followed by a basic material with no textures would leave a texture bound.
* Cleaned up NSArray -> JS array conversion, without fixing aforementioned bug.
* Made JS Ship property "target" read/write, and made property setting work.
* Added JS Quaternion.random() static method.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1136 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-19 23:05:48 +00:00
Jens Ayton
892c271501
Split JS system into separate file. Started on support for ship scripts (incomplete).
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1129 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-05 11:47:09 +00:00
Jens Ayton
5c6e674fa2
Made OOJavaScriptConversion an informal protocol with a default implementation (returning JSVAL_NULL) for NSObject. Work on rewriting JS player proxy, moving properties up into Ship and Entity as appropriate. Reimplemented player.call(), allowing it to return values, and applying to entities in general. Ensured correct and consistent type conversion in JavaScript property getters/setters. Fixed bug where script-awarded missiles/mines would use two slots. Made blowUpStation actually blow up the station.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1119 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-02 16:41:55 +00:00
Jens Ayton
15255d19c0
JavaScript: entity class hierarchy now reflected in JS object prototype relationships (player is a Player is a Ship is an Entity). Fix for enery units being unbuyable; moved some hardcoded equipment requirements into equipment.plist; made -[PlayerEntity hasExtraEquipment:] accept arrays and sets of strings as well as individual strings.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1118 127b21dd-08f5-0310-b4b7-95ae10353056
2007-08-02 00:31:44 +00:00
Jens Ayton
122102af4f
Cleanup; merged some very similar methods; made most HUD parameter reading use OOCollectionExtractors; made most of Universe use OOCollectionExtractors; added some schemata; moved schemata to separate folder. GNUmakefile.postamble has been updated to copy this folder into Resources/, but note that it isn't needed in final builds.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1112 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-29 14:17:30 +00:00
Jens Ayton
8a6252398d
Redesigned plist verifier to allow recursive definitions. As a bonus, this simplified the code by removing the -normalize... methods. Shipdata.plist entry schema and schema schema now conform to working schema schema. Schema.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1108 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-27 16:33:28 +00:00
Jens Ayton
97fc89995b
Reworked plist schema verifier to use NSError, allowing more informative error messages. Wrote a schema for plist schemas, but it can't currently be used because it has recursive references. (Fix: resolve macros at run time instead of preprocessing.)
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1107 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-27 00:53:44 +00:00
Jens Ayton
40355e0032
Fix for really dumb bug in Validate_Array(); removed redundant, shadowing variable in ErrorWithDictionary().
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1106 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-26 13:52:13 +00:00
Jens Ayton
9c66ca113c
Added some verifier stages that don't actually do anything yet but make my auto-generated Graphviz file of the dependency graph look much cooler.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1102 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-20 22:44:37 +00:00
Jens Ayton
8898364de2
OXP verifier: architectural changes, added design note, generate Graphviz file instead of text dump to debug dependency graph.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1099 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-20 16:29:40 +00:00
Jens Ayton
de2b1b194c
OXP verifier validates equipment.plist, ignores .svn and CVS directories.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1097 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-19 12:09:01 +00:00
Jens Ayton
5d858a99f2
Added Read Me file detection and demoships.plist validation to OXP verifier.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1096 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-19 11:21:01 +00:00
Jens Ayton
675f2918e5
OXP verifier now checks requires.plist; added infrastructure to handle plists in verifier and fixed dependency management.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1095 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-19 10:44:52 +00:00
Jens Ayton
7780ef63bb
OXP verifier can now identify bad case in standard folder names and config file names. Infrastructure is in place for general case mismatch detection. Fixed Windows build warnings reported by Sotho Tal Ker in forum.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1094 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-18 23:53:51 +00:00
Jens Ayton
9aa1e3947e
Removed lingering bits of OOS code.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1093 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-18 21:21:06 +00:00
Jens Ayton
e7c18ce0e8
Beginings of -verify-oxp support. Fix for freeze when like_ships refers to unknown ship. Ship set-up now fails if subentity set-up fails.
...
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1091 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-18 15:42:58 +00:00