43#include <espeak-ng/speak_lib.h>
53#ifndef OO_SCANCLASS_TYPE
54#define OO_SCANCLASS_TYPE
58#define CROSSHAIR_SIZE 32.0
95#define SHADERS_MIN SHADERS_OFF
99#define PROXIMITY_WARN_DISTANCE 4
100#define PROXIMITY_WARN_DISTANCE2 (PROXIMITY_WARN_DISTANCE * PROXIMITY_WARN_DISTANCE)
101#define PROXIMITY_AVOID_DISTANCE_FACTOR 10.0
102#define SAFE_ADDITION_FACTOR2 800
104#define SUN_SKIM_RADIUS_FACTOR 1.15470053838
105#define SUN_SPARKS_RADIUS_FACTOR 2.0
107#define KEY_TECHLEVEL @"techlevel"
108#define KEY_ECONOMY @"economy"
109#define KEY_ECONOMY_DESC @"economy_description"
110#define KEY_GOVERNMENT @"government"
111#define KEY_GOVERNMENT_DESC @"government_description"
112#define KEY_POPULATION @"population"
113#define KEY_POPULATION_DESC @"population_description"
114#define KEY_PRODUCTIVITY @"productivity"
115#define KEY_RADIUS @"radius"
116#define KEY_NAME @"name"
117#define KEY_INHABITANT @"inhabitant"
118#define KEY_INHABITANTS @"inhabitants"
119#define KEY_DESCRIPTION @"description"
120#define KEY_SHORT_DESCRIPTION @"short_description"
121#define KEY_PLANETNAME @"planet_name"
122#define KEY_SUNNAME @"sun_name"
124#define KEY_CHANCE @"chance"
125#define KEY_PRICE @"price"
126#define KEY_OPTIONAL_EQUIPMENT @"optional_equipment"
127#define KEY_STANDARD_EQUIPMENT @"standard_equipment"
128#define KEY_EQUIPMENT_MISSILES @"missiles"
129#define KEY_EQUIPMENT_FORWARD_WEAPON @"forward_weapon_type"
130#define KEY_EQUIPMENT_AFT_WEAPON @"aft_weapon_type"
131#define KEY_EQUIPMENT_PORT_WEAPON @"port_weapon_type"
132#define KEY_EQUIPMENT_STARBOARD_WEAPON @"starboard_weapon_type"
133#define KEY_EQUIPMENT_EXTRAS @"extras"
134#define KEY_WEAPON_FACINGS @"weapon_facings"
135#define KEY_RENOVATION_MULTIPLIER @"renovation_multiplier"
137#define SHIPYARD_KEY_ID @"id"
138#define SHIPYARD_KEY_SHIPDATA_KEY @"shipdata_key"
139#define SHIPYARD_KEY_SHIP @"ship"
140#define SHIPYARD_KEY_PRICE @"price"
141#define SHIPYARD_KEY_PERSONALITY @"personality"
143#define PASSENGER_BERTH_SPACE 5
145#define PLANETINFO_UNIVERSAL_KEY @"universal"
146#define PLANETINFO_INTERSTELLAR_KEY @"interstellar space"
148#define OOLITE_EXCEPTION_LOOPING @"OoliteLoopingException"
149#define OOLITE_EXCEPTION_DATA_NOT_FOUND @"OoliteDataNotFoundException"
150#define OOLITE_EXCEPTION_FATAL @"OoliteFatalException"
154#define BILLBOARD_DEPTH 75000.0
156#define TIME_ACCELERATION_FACTOR_MIN 0.0625f
157#define TIME_ACCELERATION_FACTOR_DEFAULT 1.0f
158#define TIME_ACCELERATION_FACTOR_MAX 16.0f
160#define DEMO_LIGHT_POSITION 5000.0f, 25000.0f, -10000.0f
162#define MIN_DISTANCE_TO_BUOY 750.0f
163#define MIN_DISTANCE_TO_BUOY2 (MIN_DISTANCE_TO_BUOY * MIN_DISTANCE_TO_BUOY)
167#define SYSTEM_REPOPULATION_INTERVAL 20.0f;
169#ifndef OO_LOCALIZATION_TOOLS
170#define OO_LOCALIZATION_TOOLS 1
173#ifndef MASS_DEPENDENT_FUEL_PRICES
174#define MASS_DEPENDENT_FUEL_PRICES 1
302#ifdef OO_DEBUG_MONITOR_ENABLED
321#if OOLITE_SPEECH_SYNTH
322#if OOLITE_MAC_COCOA_UI
323 NSSpeechSynthesizer* speechSynthesizer;
325 const espeak_VOICE** espeak_voices;
326 unsigned int espeak_voice_count;
328 NSArray* speechArray;
332 NSMutableArray* _preloadingPlanetMaterials;
371- (void)setBloom:(BOOL)newBloom;
374- (void)setCurrentPostFX:(
int)newCurrentPostFX;
375- (void)terminatePostFX:(
int)postFX;
380- (NSUInteger)sessionID;
383- (void)setDoProcedurallyTexturedPlanets:(BOOL)value;
386- (BOOL)setUseAddOns:(NSString*)newUse fromSaveGame:(BOOL)saveGame;
387- (BOOL)setUseAddOns:(NSString*)newUse fromSaveGame:(BOOL)saveGame forceReinit:(BOOL)force;
391- (BOOL)reinitAndShowDemo:(BOOL)showDemo;
396#ifdef OO_DEBUG_MONITOR_ENABLED
397- (void)debugDumpEntities;
398- (NSArray*)entityList;
414- (void)populateSystemFromDictionariesWithSun:(
OOSunEntity*)sun andPlanet:(OOPlanetEntity*)planet;
416- (void)setPopulatorSetting:(NSString*)key to:(NSDictionary*)setting;
417- (
HPVector)locationByCode:(NSString*)code withSun:(
OOSunEntity*)sun andPlanet:(OOPlanetEntity*)planet;
418- (void)setAmbientLightLevel:(
float)newValue;
422- (void)setMainLightPosition:(
Vector)sunPos;
425- (void)makeSunSkimmer:(
ShipEntity*)ship andSetAI:(BOOL)setAI;
426- (void)addShipWithRole:(NSString*)desc nearRouteOneAt:(
double)route_fraction;
427- (
HPVector)coordinatesForPosition:(
HPVector)pos withCoordinateSystem:(NSString*)system returningScalar:(GLfloat*)my_scalar;
428- (NSString*)expressPosition:(
HPVector)pos inCoordinateSystem:(NSString*)system;
429- (
HPVector)legacyPositionFrom:(
HPVector)pos asCoordinateSystem:(NSString*)system;
430- (
HPVector)coordinatesFromCoordinateSystemString:(NSString*)system_x_y_z;
431- (BOOL)addShipWithRole:(NSString*)desc nearPosition:(
HPVector)pos withCoordinateSystem:(NSString*)system;
432- (BOOL)addShips:(
int)howMany withRole:(NSString*)desc atPosition:(
HPVector)pos withCoordinateSystem:(NSString*)system;
433- (BOOL)addShips:(
int)howMany withRole:(NSString*)desc nearPosition:(
HPVector)pos withCoordinateSystem:(NSString*)system;
434- (BOOL)addShips:(
int)howMany withRole:(NSString*)desc nearPosition:(
HPVector)pos withCoordinateSystem:(NSString*)system withinRadius:(GLfloat)radius;
435- (BOOL)addShips:(
int)howMany withRole:(NSString*)desc intoBoundingBox:(
BoundingBox)bbox;
436- (BOOL)spawnShip:(NSString*)shipdesc;
437- (void)witchspaceShipWithPrimaryRole:(NSString*)role;
441- (
ShipEntity*)addShipAt:(
HPVector)pos withRole:(NSString*)role withinRadius:(GLfloat)radius;
442- (NSArray*)addShipsAt:(
HPVector)pos withRole:(NSString*)role quantity:(
unsigned)count withinRadius:(GLfloat)radius asGroup:(BOOL)isGroup;
443- (NSArray*)addShipsToRoute:(NSString*)route withRole:(NSString*)role quantity:(
unsigned)count routeFraction:(
double)routeFraction asGroup:(BOOL)isGroup;
445- (BOOL)roleIsPirateVictim:(NSString*)role;
446- (BOOL)role:(NSString*)role isInCategory:(NSString*)category;
449- (void)addWitchspaceJumpEffectForShip:(
ShipEntity*)ship;
452- (void)setUpBreakPattern:(
HPVector)pos orientation:(
Quaternion)q forDocking:(BOOL)forDocking;
454- (void)setWitchspaceBreakPattern:(BOOL)newValue;
457- (void)setDockingClearanceProtocolActive:(BOOL)newValue;
461- (void)setupIntroFirstGo:(BOOL)justCobra;
483- (void)setNextBeacon:(
Entity<OOBeaconEntity>*)beaconShip;
484- (void)clearBeacon:(
Entity<OOBeaconEntity>*)beaconShip;
487- (void)defineWaypoint:(NSDictionary*)definition forKey:(NSString*)key;
491- (void)setSkyColorRed:(GLfloat)red green:(GLfloat)green blue:(GLfloat)blue alpha:(GLfloat)alpha;
496- (NSString*)randomShipKeyForRoleRespectingConditions:(NSString*)role;
497- (
ShipEntity*)newShipWithRole:(NSString*)role OO_RETURNS_RETAINED;
498- (
ShipEntity*)newShipWithName:(NSString*)shipKey OO_RETURNS_RETAINED;
499- (
ShipEntity*)newSubentityWithName:(NSString*)shipKey andScaleFactor:(
float)scale OO_RETURNS_RETAINED;
501- (
DockEntity*)newDockWithName:(NSString*)shipKey andScaleFactor:(
float)scale OO_RETURNS_RETAINED;
502- (
ShipEntity*)newShipWithName:(NSString*)shipKey usePlayerProxy:(BOOL)usePlayerProxy OO_RETURNS_RETAINED;
503- (
ShipEntity*)newShipWithName:(NSString*)shipKey usePlayerProxy:(BOOL)usePlayerProxy isSubentity:(BOOL)isSubentity OO_RETURNS_RETAINED;
504- (
ShipEntity*)newShipWithName:(NSString*)shipKey usePlayerProxy:(BOOL)usePlayerProxy isSubentity:(BOOL)isSubentity andScaleFactor:(
float)scale OO_RETURNS_RETAINED;
506- (Class)shipClassForShipDictionary:(NSDictionary*)dict;
508- (NSString*)defaultAIForRole:(NSString*)role;
518- (NSArray*)getContainersOfGoods:(
OOCargoQuantity)how_many scarce:(BOOL)scarce legal:(BOOL)legal;
520- (void)fillCargopodWithRandomCargo:(
ShipEntity*)cargopod;
534- (void)useGUILightSource:(BOOL)GUILight;
539- (BOOL)viewFrustumIntersectsSphereAt:(
Vector)position withRadius:(GLfloat)radius;
543- (void)drawWatermarkString:(NSString*)watermarkString;
550- (BOOL)addEntity:(
Entity*)entity;
551- (BOOL)removeEntity:(
Entity*)entity;
552- (void)ensureEntityReallyRemoved:(
Entity*)entity;
556- (
ShipEntity*)makeDemoShipWithRole:(NSString*)role spinning:(BOOL)spinning;
558- (BOOL)isVectorClearFromEntity:(
Entity*)e1 toDistance:(
double)dist fromPoint:(
HPVector)p2;
562- (
ShipEntity*)addWreckageFrom:(
ShipEntity*)ship withRole:(NSString*)wreckRole at:(
HPVector)rpos scale:(GLfloat)scale lifetime:(GLfloat)lifetime;
568- (NSArray*)entitiesWithinRange:(
double)range ofEntity:(
Entity*)entity;
569- (unsigned)countShipsWithRole:(NSString*)role inRange:(
double)range ofEntity:(
Entity*)entity;
570- (unsigned)countShipsWithRole:(NSString*)role;
571- (unsigned)countShipsWithPrimaryRole:(NSString*)role inRange:(
double)range ofEntity:(
Entity*)entity;
572- (unsigned)countShipsWithPrimaryRole:(NSString*)role;
573- (unsigned)countShipsWithScanClass:(
OOScanClass)scanClass inRange:(
double)range ofEntity:(
Entity*)entity;
577 parameter:(
void*)parameter
578 inRange:(
double)range
581 parameter:(
void*)parameter
582 inRange:(
double)range
585 parameter:(
void*)parameter
586 inRange:(
double)range
589 parameter:(
void*)parameter;
591 parameter:(
void*)parameter
592 inRange:(
double)range
595 parameter:(
void*)parameter
596 inRange:(
double)range
599 parameter:(
void*)parameter
600 relativeToEntity:(
Entity*)entity;
602 parameter:(
void*)parameter
603 relativeToEntity:(
Entity*)entity;
613- (void)setViewDirection:(
OOViewID)vd;
614- (void)enterGUIViewModeWithMouseInteraction:(BOOL)mouseInteraction;
616- (NSString*)soundNameForCustomSoundKey:(NSString*)key;
617- (NSDictionary*)screenTextureDescriptorForKey:(NSString*)key;
618- (void)setScreenTextureDescriptorForKey:(NSString*)key descriptor:(NSDictionary*)desc;
621- (void)setMessageGuiBackgroundColor:(
OOColor*)some_color;
622- (void)displayMessage:(NSString*)text forCount:(
OOTimeDelta)count;
623- (void)displayCountdownMessage:(NSString*)text forCount:(
OOTimeDelta)count;
625- (void)addDelayedMessage:(NSDictionary*)textdict;
626- (void)addMessage:(NSString*)text forCount:(
OOTimeDelta)count;
627- (void)addMessage:(NSString*)text forCount:(
OOTimeDelta)count forceDisplay:(BOOL)forceDisplay;
628- (void)addCommsMessage:(NSString*)text forCount:(
OOTimeDelta)count;
629- (void)addCommsMessage:(NSString*)text forCount:(
OOTimeDelta)count andShowComms:(BOOL)showComms logOnly:(BOOL)logOnly;
631- (void)showGUIMessage:(NSString*)text withScroll:(BOOL)scroll andColor:(
OOColor*)selectedColor overDuration:(
OOTimeDelta)how_long;
637- (void)setTimeAccelerationFactor:(
double)newTimeAccelerationFactor;
640- (void)setECMVisualFXEnabled:(BOOL)isEnabled;
647- (void)setGalaxyTo:(
OOGalaxyID)g andReinit:(BOOL)forced;
657- (NSDictionary*)explosionSetting:(NSString*)explosion;
661- (NSString*)descriptionForKey:(NSString*)key;
662- (NSString*)descriptionForArrayKey:(NSString*)key index:(
unsigned)index;
663- (BOOL)descriptionBooleanForKey:(NSString*)key;
667- (NSDictionary*)generateSystemData:(
OOSystemID)s;
668- (NSDictionary*)generateSystemData:(
OOSystemID)s useCache:(BOOL)useCache;
673- (void)setSystemDataKey:(NSString*)key value:(NSObject*)object fromManifest:(NSString*)manifest;
674- (void)setSystemDataForGalaxy:(
OOGalaxyID)gnum planet:(
OOSystemID)pnum key:(NSString*)key value:(
id)object fromManifest:(NSString*)manifest forLayer:(
OOSystemLayer)layer;
680- (NSString*)getSystemInhabitants:(
OOSystemID)sys;
681- (NSString*)getSystemInhabitants:(
OOSystemID)sys plural:(BOOL)plural;
684- (
OOSystemID)findSystemFromName:(NSString*)sysName;
689- (NSMutableArray*)nearbyDestinationsWithinRange:(
double)range;
695- (
OOSystemID)findSystemNumberAtCoords:(NSPoint)coords withGalaxy:(
OOGalaxyID)gal includingHidden:(BOOL)hidden;
696- (NSPoint)findSystemCoordinatesWithPrefix:(NSString*)p_fix;
697- (NSPoint)findSystemCoordinatesWithPrefix:(NSString*)p_fix exactMatch:(BOOL)exactMatch;
699- (NSString*)systemNameIndex:(
OOSystemID)index;
701- (NSArray*)neighboursToSystem:(
OOSystemID)system_number;
703- (void)preloadPlanetTexturesForSystem:(
OOSystemID)system;
714- (NSString*)shortTimeDescription:(
OOTimeDelta)interval;
716- (void)loadStationMarkets:(NSArray*)marketData;
724- (NSString*)brochureDescriptionWithDictionary:(NSDictionary*)dict standardEquipment:(NSArray*)extras optionalEquipment:(NSArray*)options;
732- (NSArray*)listBeaconsWithCode:(NSString*)code;
734- (void)allShipsDoScriptEvent:(
OOJSPropID)event andReactToAIMessage:(NSString*)message;
746- (void)setDisplayText:(BOOL)value;
749- (void)setDisplayFPS:(BOOL)value;
752- (void)setAutoSave:(BOOL)value;
755- (void)setWireframeGraphics:(BOOL)value;
763- (void)handleOoliteException:(NSException*)ooliteException;
766- (void)setAirResistanceFactor:(GLfloat)newFactor;
770- (void)startSpeakingString:(NSString*)text;
777- (NSString*)voiceName:(
unsigned int)index;
778- (
unsigned int)voiceNumber:(NSString*)name;
779- (
unsigned int)nextVoice:(
unsigned int)index;
780- (
unsigned int)prevVoice:(
unsigned int)index;
781- (
unsigned int)setVoice:(
unsigned int)index withGenderM:(BOOL)isMale;
783- (
int)nextColorblindMode:(
int)index;
784- (
int)prevColorblindMode:(
int)index;
790- (void)setAutoSaveNow:(BOOL)value;
798- (void)setPauseMessageVisible:(BOOL)value;
801- (void)setPermanentCommLog:(BOOL)value;
802- (void)setAutoCommLog:(BOOL)value;
804- (void)setPermanentMessageLog:(BOOL)value;
806- (void)setAutoMessageLogBg:(BOOL)value;
809- (void)setBlockJSPlayerShipProps:(BOOL)value;
812- (void)addConditionScripts:(NSEnumerator*)scripts;
813- (
OOJSScript*)getConditionScript:(NSString*)scriptname;
827#define UNIVERSE OOGetUniverse()
832#define DESC(key) (OOLookUpDescriptionPRIV(key ""))
833#define DESC_PLURAL(key, count) (OOLookUpPluralDescriptionPRIV(key "", count))
842@interface OOSound (OOCustomSounds)
844+ (id)soundWithCustomSoundKey:(NSString*)key;
845- (id)initWithCustomSoundKey:(NSString*)key;
849@interface OOSoundSource (OOCustomSounds)
851+ (id)sourceWithCustomSoundKey:(NSString*)key;
852- (id)initWithCustomSoundKey:(NSString*)key;
854- (void)playCustomSoundWithKey:(NSString*)key;
NSString * OODisplayStringFromEconomyID(OOEconomyID economy)
NSString * OODisplayStringFromGovernmentID(OOGovernmentID government)
#define INLINE_CONST_FUNC
NSString * OOCommodityType
uint64_t OOCreditsQuantity
@ OO_POSTFX_COLORBLINDNESS_PROTAN
@ OO_POSTFX_COLORBLINDNESS_TRITAN
@ OO_POSTFX_COLORBLINDNESS_DEUTER
OOINLINE Universe * OOGetUniverse(void) INLINE_CONST_FUNC
@ MARKET_ECO_ADJUST_QUANTITY
@ MARKET_ECO_ADJUST_PRICE
@ EQUIPMENT_SHORT_DESC_INDEX
@ EQUIPMENT_LONG_DESC_INDEX
@ EQUIPMENT_TECH_LEVEL_INDEX
@ EQUIPMENT_EXTRA_INFO_INDEX
NSString * OOLookUpDescriptionPRIV(NSString *key)
NSString * OOLookUpPluralDescriptionPRIV(NSString *key, NSInteger count)
NSComparisonResult populatorPrioritySort(id a, id b, void *context)
NSComparisonResult equipmentSortOutfitting(id a, id b, void *context)
NSComparisonResult equipmentSort(id a, id b, void *context)
BOOL(* EntityFilterPredicate)(Entity *entity, void *parameter)
Universe * gSharedUniverse
GLuint targetDepthBufferID
OOGraphicsDetail detailLevel
GLuint pingpongColorbuffers[2]
OOShaderProgram * finalProgram
void populateNormalSpace()
OOWeakReference * _firstBeacon
Entity< OOBeaconEntity > * lastBeacon()
NSMutableDictionary * conditionScripts
Entity * firstEntityTargetedByPlayerPrecisely()
OOTimeDelta getTimeDelta()
void setUpUniverseFromWitchspace()
void resetCommsLogColor()
NSString * collisionDescription()
NSString * system_repopulator
OOTimeAbsolute demo_start_time
OOSystemID targetSystemID
NSString * system_names[256]
void selectIntro2Previous()
GuiDisplayGen * messageGUI()
void forceWitchspaceEntries()
NSUInteger demo_ship_index
BOOL dockingClearanceProtocolActive()
NSDictionary * customSounds
BOOL doProcedurallyTexturedPlanets
NSDictionary * currentSystemData()
NSDictionary * descriptions()
OOCommodities * commodities
OOShaderProgram * blurProgram
NSMutableSet * allStations
NSDictionary * roleCategories
GuiDisplayGen * comm_log_gui
void removeAllEntitiesExceptPlayer()
NSUInteger demo_ship_subindex
NSDictionary * gameSettings()
GLuint targetFramebufferID
NSDictionary * _descriptions
void resetFramesDoneThisUpdate()
BOOL doLinkedListMaintenanceThisUpdate
NSArray * getStationMarkets()
NSDictionary * characters
NSMutableDictionary * waypoints
OOShaderProgram * textureProgram
OOTimeAbsolute demo_stage_time
BOOL deterministic_population
void setUpUniverseFromStation()
NSMutableDictionary * populatorSettings
NSDictionary * screenBackgrounds
void unMagicMainStation()
NSDictionary * globalSettings
GuiDisplayGen * message_gui
HPVector getWitchspaceExitPosition()
NSString * currentMessage
CollisionRegion * universeRegion
void setUpUniverseFromMisjump()
NSDictionary * explosionSettings
void clearSystemPopulator()
OOPlanetEntity * cachedPlanet
NSSize targetFramebufferSize
NSDictionary * getPopulatorSettings()
NSMutableArray * activeWormholes
void clearPreviousMessage()
NSMutableArray * entities
BOOL deterministicPopulation()
OOPlanetEntity * setUpPlanet()
Entity * firstEntityTargetedByPlayer()
OOCommodityMarket * commodityMarket
OOPlanetEntity * planet()
OOSystemDescriptionManager * systemManager
BOOL _permanentMessageLog
BOOL inInterstellarSpace()
GLuint passthroughTextureID[2]
BOOL _witchspaceBreakPattern
void loadConditionScripts()
GLuint passthroughFramebufferID
OOTimeDelta next_repopulation
Entity * sortedEntities[UNIVERSE_MAX_ENTITIES+1]
GLfloat main_light_position[4]
BOOL _dockingClearanceProtocolActive
OOTimeAbsolute countdown_messageRepeatTime
NSMutableSet * entitiesDeadThisUpdate
NSString * getRandomCommodity()
NSMutableArray * characterPool
GLfloat airResistanceFactor
double timeAccelerationFactor()
NSDictionary * currentWaypoints()
OOTimeAbsolute messageRepeatTime
NSMutableArray * allPlanets
GameController * gameController()
StationEntity * station()
Entity< OOBeaconEntity > * firstBeacon()
GLfloat safeWitchspaceExitDistance()
Quaternion getWitchspaceExitRotation()
void selectIntro2NextCategory()
BOOL blockJSPlayerShipProps()
BOOL permanentMessageLog()
void findCollisionsAndShadows()
Entity * entity_for_uid[MAX_ENTITY_UID]
BOOL pauseMessageVisible()
OOTimeAbsolute universal_time
GuiDisplayGen * commLogGUI()
StationEntity * cachedStation
OOWeakReference * _lastBeacon
OOSystemID currentSystemID()
BOOL witchspaceBreakPattern()
void selectIntro2PreviousCategory()
NSDictionary * missiontext
NSArray * equipmentDataOutfitting
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque