360 Commits

Author SHA1 Message Date
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
Jens Ayton
693bf7ac0d Removed OOS script support.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1089 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-17 10:48:43 +00:00
Jens Ayton
a3cee138b8 Bumped version number to 1.69.2. Removed support for deprecated shader features. Added caching of GL texture names to avoid expensive glGenTextures()/glDeleteTextures() call. Set texture cache size to something sensible (50 at the moment), but textures are being leaked. Fixed loss-of-precision bug in OOCollectionExtractors' double methods. Added collection extractor methods for vectors, quaternions, and non-negative floats/doubles. Switched on -Werror for OS X build.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1088 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-17 10:42:36 +00:00
Jens Ayton
569b690990 Synching project in preparation for tagging.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1086 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-14 14:36:49 +00:00
Jens Ayton
1f8d82b8ee Switched to JavaScript implementation of cloaking device mission.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1085 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-14 13:53:50 +00:00
Jens Ayton
9e7a3be090 Fixed problem where docking did not work properly after scooping certain canisters. Fix addresses specific problem and also catches more general case. Also fixed exceptions being thrown (and ignored, but logged) when pressing or releasing a dead key (e.g., accent key) under Mac OS X.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1084 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-14 12:06:49 +00:00
Jens Ayton
3676998564 Files accidentally excluded from r1080.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1082 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-14 09:57:10 +00:00
Jens Ayton
c7b6b5f144 Fixed minor Xcode project glitches
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1078 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-13 14:45:43 +00:00
Jens Ayton
dd79b5dba9 Added some debug code. (OS X Only:) added support for Smart Crash Reports (to all builds) and SCR installation support (test releases only).
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1076 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-13 14:31:07 +00:00
Jens Ayton
839cc06cf0 Fiddled with logging, made OS X debug menu load a little later so that its file lookup is affected by data cache rebuilding.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1075 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-12 15:10:56 +00:00
Jens Ayton
78275bee85 Implemented auto_ai ship attribute. Clamped laser head values for shaders. Tweaked logging to avoid sporadic 'logging not inited' message while quitting.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1074 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-12 11:33:26 +00:00
Jens Ayton
2c03f45ffb Attempted fix to crash in CollisionRegion led to cascade of other dangling-pointer crashes. Reverted, and brute-forced it by ensuring entities do not die until the end of an update cycle.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1072 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-11 13:13:01 +00:00
Jens Ayton
bfc5cae918 Broke queue mechanism out of OOTextureLoader into separate class, partly for neatness and partly because I need it for something else.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1065 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-08 09:04:43 +00:00
Jens Ayton
b3b04859ab Enabled more warning flags (-Wextra -Wno-unused-parameter -Wno-missing-field-initializers) in OS X build, and fixed several hundred resulting warnings (mostly by using more appropriate types). Bumped version number to 1.69.1. Fixed unable-to-buy-in-shipyard bug. Attempt to fix dockEscorts crash bugs (needs testing). Sundry cleanup, especially of AI and GuiDisplayGen; all exception throws now in standard form. Removed some dead code. Use correct key for Advanced Nav Array if no keyconfig.plist found. Changed OOCollectionExtractors to always clamp integer values to the requested type's range rather than truncating like NSNumber. Removed inconsistently-used and apparently-unneeded NSLock from AI.
git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@1063 127b21dd-08f5-0310-b4b7-95ae10353056
2007-07-07 15:44:50 +00:00