Merge branch 'master' of github.com:OoliteProject/oolite into steady-state-ecosystem

This commit is contained in:
cim 2013-09-14 17:43:52 +01:00
commit d7b187db22
21 changed files with 135 additions and 51 deletions

2
.gitignore vendored
View File

@ -22,7 +22,9 @@ deps/Cocoa-deps/sparkle
build/ build/
oolite.app oolite.app
obj.spk obj.spk
obj.win.spk
obj.spk.dbg obj.spk.dbg
obj.win.spk.dbg
DebugOXP/requires.plist DebugOXP/requires.plist
AddOns/ AddOns/

View File

@ -85,7 +85,7 @@ The entire source code of the library can be downloaded from ftp://anonymous@ftp
4. eSpeak v1.43.03 (Windows) 4. eSpeak v1.43.03 (Windows)
- The libespeak.dll has been custom-built for the Windows port of Oolite to enable asynchronous playback and to also default the eSpeak data files folder to Resources/espeak-data. The source files that need to be changed for this to happen can be found inside deps/Windows-x86-deps/OOeSpeakWin32DLLBuild. The instructions for building this library, for those interested, are as follows: - The libespeak.dll has been custom-built for the Windows port of Oolite to enable asynchronous playback and to also default the eSpeak data files folder to Resources/espeak-data. The source files that need to be changed for this to happen can be found inside deps/Windows-x86-deps/OOeSpeakWin32DLLBuild. The instructions for building this library, for those interested, are as follows:
- You will need to have OoliteDevelopmentEnvironment - Light Edition installed, downloadable from http://terrastorage.ath.cx/Marmagka/c0a11a8fe8b5124823a91ff1d90065ff/OoliteDevelopmentEnvironment_LE_20110212.zip. Instructions for setting it up can be found at http://www.aegidian.org/bb/viewtopic.php?t=5943. - You will need to have OoliteDevelopmentEnvironment - Light Edition installed, downloadable from http://terrastorage.dyndns.info/Marmagka/c0a11a8fe8b5124823a91ff1d90065ff/OoliteDevelopmentEnvironment_LE_20110212.zip. Instructions for setting it up can be found at http://www.aegidian.org/bb/viewtopic.php?t=5943.
- Download espeak-1.43.03-source.zip from http://espeak.sourceforge.net/download.html - Download espeak-1.43.03-source.zip from http://espeak.sourceforge.net/download.html
- Unzip the file to a folder of choice, maintaining the directory structure. We'll refer to this folder as <espeakSourceFolder>. - Unzip the file to a folder of choice, maintaining the directory structure. We'll refer to this folder as <espeakSourceFolder>.
- Copy the files - Copy the files

View File

@ -20,9 +20,9 @@ ifeq ($(GNUSTEP_HOST_OS),mingw32)
endif endif
ADDITIONAL_INCLUDE_DIRS = -Ideps/Windows-x86-deps/include -I$(JS_INC_DIR) -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables ADDITIONAL_INCLUDE_DIRS = -Ideps/Windows-x86-deps/include -I$(JS_INC_DIR) -Isrc/SDL -Isrc/Core -Isrc/BSDCompat -Isrc/Core/Scripting -Isrc/Core/Materials -Isrc/Core/Entities -Isrc/Core/OXPVerifier -Isrc/Core/Debug -Isrc/Core/Tables
ADDITIONAL_OBJC_LIBS = -lglu32 -lopengl32 -lpng14.dll -lmingw32 -lSDLmain -lSDL -lSDL_mixer -lgnustep-base -l$(JS_IMPORT_LIBRARY) -lwinmm -mwindows ADDITIONAL_OBJC_LIBS = -lglu32 -lopengl32 -lpng14.dll -lmingw32 -lSDLmain -lSDL -lSDL_mixer -lgnustep-base -l$(JS_IMPORT_LIBRARY) -lwinmm -mwindows
ADDITIONAL_CFLAGS = -DWIN32 -DNEED_STRLCPY `sdl-config --cflags` ADDITIONAL_CFLAGS = -DWIN32 -DNEED_STRLCPY `sdl-config --cflags` -mtune=generic
# note the vpath stuff above isn't working for me, so adding src/SDL and src/Core explicitly # note the vpath stuff above isn't working for me, so adding src/SDL and src/Core explicitly
ADDITIONAL_OBJCFLAGS = -DLOADSAVEGUI -DWIN32 -DXP_WIN -Wno-import -std=gnu99 `sdl-config --cflags` ADDITIONAL_OBJCFLAGS = -DLOADSAVEGUI -DWIN32 -DXP_WIN -Wno-import -std=gnu99 `sdl-config --cflags` -mtune=generic
ADDITIONAL_LDFLAGS += -Wl,--large-address-aware ADDITIONAL_LDFLAGS += -Wl,--large-address-aware
oolite_LIB_DIRS += -L$(GNUSTEP_LOCAL_ROOT)/lib -Ldeps/Windows-x86-deps/lib -L$(JS_LIB_DIR) oolite_LIB_DIRS += -L$(GNUSTEP_LOCAL_ROOT)/lib -Ldeps/Windows-x86-deps/lib -L$(JS_LIB_DIR)
ifeq ($(ESPEAK),yes) ifeq ($(ESPEAK),yes)

View File

@ -7,7 +7,14 @@ VER_MIN := $(shell echo "${VERSION}" | cut -d '.' -f 2)
VER_REV := $(shell echo "${VERSION}" | cut -d '.' -f 3) VER_REV := $(shell echo "${VERSION}" | cut -d '.' -f 3)
VER_REV := $(if ${VER_REV},${VER_REV},0) VER_REV := $(if ${VER_REV},${VER_REV},0)
VER_DATE := $(shell date +%y%m%d) VER_DATE := $(shell date +%y%m%d)
VER := $(shell echo "${VER_MAJ}.${VER_MIN}.${VER_REV}-${VER_DATE}") # VER_GITREV: Make sure git is in the command path
# VER_GITREV is the count of commits since the establishment of the repository on github. Used
# as replacement for SVN incremental revision number, since we require the version number to be
# of format X.X.X.X.
# VER_GITHASH are the first ten digits of the actual hash of the commit being built.
VER_GITREV := $(shell git rev-list --count HEAD)
VER_GITHASH := $(shell git rev-parse --short=10 HEAD)
VER := $(shell echo "${VER_MAJ}.${VER_MIN}.${VER_REV}.${VER_GITREV}-${VER_DATE}")
BUILDTIME := $(shell date "+%Y.%m.%d %H:%M") BUILDTIME := $(shell date "+%Y.%m.%d %H:%M")
DEB_BUILDTIME := $(shell date "+%a, %d %b %Y %H:%M:%S %z") DEB_BUILDTIME := $(shell date "+%a, %d %b %Y %H:%M:%S %z")
ifeq (${VER_REV},0) ifeq (${VER_REV},0)
@ -189,7 +196,8 @@ ${NSISVERSIONS}:
@echo "!define VER_MAJ ${VER_MAJ}" >> $@ @echo "!define VER_MAJ ${VER_MAJ}" >> $@
@echo "!define VER_MIN ${VER_MIN}" >> $@ @echo "!define VER_MIN ${VER_MIN}" >> $@
@echo "!define VER_REV ${VER_REV}" >> $@ @echo "!define VER_REV ${VER_REV}" >> $@
@echo "!define SVNREV ${SVNREVISION}" >> $@ @echo "!define VER_GITREV ${VER_GITREV}" >> $@
@echo "!define VER_GITHASH ${VER_GITHASH}" >> $@
@echo "!define VERSION ${VER}" >> $@ @echo "!define VERSION ${VER}" >> $@
@echo "!define BUILDTIME \"${BUILDTIME}\"" >> $@ @echo "!define BUILDTIME \"${BUILDTIME}\"" >> $@

View File

@ -130,8 +130,6 @@
display.mode.unknown = $error; display.mode.unknown = $error;
display.initGL = no; display.initGL = no;
display.macLegacy = no; // TEMP
effectData.load.progress = no; effectData.load.progress = no;
effectData.load.done = no; effectData.load.done = no;

View File

@ -42,6 +42,15 @@
*/ */
//shield_charge_energybank_threshold = 0.75; //shield_charge_energybank_threshold = 0.75;
/* The sun colour affects the lighting on the start up ship
* parade. Therefore, give the initial system a neutral lighting
* colour. */
"0 7" =
{
// Lave
sun_color = "1.0 1.0 1.0";
};
/* Worlds with "pink oceans" or "vast oceans" according to system /* Worlds with "pink oceans" or "vast oceans" according to system
description. "Unusual oceans" are ignored. description. "Unusual oceans" are ignored.
In theory, oceans could also be "ancient", "great", "funny", "weird", In theory, oceans could also be "ancient", "great", "funny", "weird",

View File

@ -40,12 +40,15 @@ this.version = "1.79";
this.startUp = this.shipWillExitWitchspace = function() this.startUp = this.shipWillExitWitchspace = function()
{ {
if (system.mainStation)
{
system.mainStation.setInterface("oolite-registership",{ system.mainStation.setInterface("oolite-registership",{
title: expandMissionText("oolite-registership-interface-title"), title: expandMissionText("oolite-registership-interface-title"),
category: expandMissionText("oolite-registership-interface-category"), category: expandMissionText("oolite-registership-interface-category"),
summary: expandMissionText("oolite-registership-interface-summary"), summary: expandMissionText("oolite-registership-interface-summary"),
callback: this._registerShip.bind(this) callback: this._registerShip.bind(this)
}); });
}
} }

2
deps/Linux-deps vendored

@ -1 +1 @@
Subproject commit 04e01b3eccb9e174e6821c8f7cbb0d08e9304466 Subproject commit e741062d81dd799c19b8b168d87aaa45f591a9dd

View File

@ -10,9 +10,9 @@
; and it's too much work to try to dynamically edit this file ; and it's too much work to try to dynamically edit this file
!include /NONFATAL "OoliteVersions.nsh" !include /NONFATAL "OoliteVersions.nsh"
!ifndef SVNREV !ifndef VER_GITREV
!warning "No SVN Revision supplied" !warning "No GIT Revision supplied"
!define SVNREV 0 !define VER_GITREV 0
!endif !endif
!ifndef VERSION !ifndef VERSION
!warning "No Version information supplied" !warning "No Version information supplied"
@ -49,10 +49,10 @@ SetCompress auto
SetCompressor LZMA SetCompressor LZMA
SetCompressorDictSize 32 SetCompressorDictSize 32
SetDatablockOptimize on SetDatablockOptimize on
OutFile "${OUTDIR}\OoliteInstall-${VER}${EXTVER}.exe" OutFile "${OUTDIR}\OoliteInstall-${VER_MAJ}.${VER_MIN}.${VER_REV}.${VER_GITHASH}${EXTVER}.exe"
BrandingText "(C) 2003-2013 Giles Williams, Jens Ayton and contributors" BrandingText "(C) 2003-2013 Giles Williams, Jens Ayton and contributors"
Name "Oolite" Name "Oolite"
Caption "Oolite ${VER}${EXTVER} Setup" Caption "Oolite ${VER}${EXTVER} (git ${VER_GITHASH}) Setup"
SubCaption 0 " " SubCaption 0 " "
SubCaption 1 " " SubCaption 1 " "
SubCaption 2 " " SubCaption 2 " "
@ -68,18 +68,20 @@ InstProgressFlags smooth
AutoCloseWindow false AutoCloseWindow false
SetOverwrite on SetOverwrite on
VIAddVersionKey "ProductName" "Oolite" VIAddVersionKey "ProductName" "Oolite"
VIAddVersionKey "FileDescription" "A space combat/trading game, inspired by Elite." VIAddVersionKey "FileDescription" "A space combat/trading game, inspired by Elite."
VIAddVersionKey "LegalCopyright" "© 2003-2013 Giles Williams, Jens Ayton and contributors" VIAddVersionKey "LegalCopyright" "© 2003-2013 Giles Williams, Jens Ayton and contributors"
VIAddVersionKey "FileVersion" "${VER}" VIAddVersionKey "FileVersion" "${VER}"
!ifdef SNAPSHOT !ifdef SNAPSHOT
VIAddVersionKey "SVN Revision" "${SVNREV}" VIAddVersionKey "GIT Revision" "${VER_GITHASH}"
!endif !endif
!ifdef BUILDTIME !ifdef BUILDTIME
VIAddVersionKey "Build Time" "${BUILDTIME}" VIAddVersionKey "Build Time" "${BUILDTIME}"
!endif !endif
VIProductVersion "${VER}" VIProductVersion "${VER}"
!define MUI_HEADERIMAGE !define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP ".\OoliteInstallerHeaderBitmap_ModernUI.bmp" !define MUI_HEADERIMAGE_BITMAP ".\OoliteInstallerHeaderBitmap_ModernUI.bmp"
!define MUI_HEADERIMAGE_UNBITMAP ".\OoliteInstallerHeaderBitmap_ModernUI.bmp" !define MUI_HEADERIMAGE_UNBITMAP ".\OoliteInstallerHeaderBitmap_ModernUI.bmp"

View File

@ -713,11 +713,14 @@ MA 02110-1301, USA.
{ {
if ([ship status] != STATUS_LAUNCHING && !allow_docking_thisship) if ([ship status] != STATUS_LAUNCHING && !allow_docking_thisship)
{ // launch-only dock: will collide! { // launch-only dock: will collide!
if (arbb.min.z < dd)
{
[ship takeScrapeDamage: 5 * [UNIVERSE getTimeDelta]*[ship flightSpeed] from:station]; [ship takeScrapeDamage: 5 * [UNIVERSE getTimeDelta]*[ship flightSpeed] from:station];
// and bounce // and bounce
HPVector rel = HPvector_subtract([ship position],port_pos); HPVector rel = HPvector_subtract([ship position],port_pos);
rel = HPvector_multiply_scalar(HPvector_normal(rel),[ship flightSpeed]*0.4); rel = HPvector_multiply_scalar(HPvector_normal(rel),[ship flightSpeed]*0.4);
[ship adjustVelocity:HPVectorToVector(rel)]; [ship adjustVelocity:HPVectorToVector(rel)];
}
if (arbb.max.z < 0.0) if (arbb.max.z < 0.0)
{ // give some warning before exploding... { // give some warning before exploding...

View File

@ -492,6 +492,7 @@ typedef enum
// trumbles // trumbles
NSUInteger trumbleCount; NSUInteger trumbleCount;
OOTrumble *trumble[PLAYER_MAX_TRUMBLES]; OOTrumble *trumble[PLAYER_MAX_TRUMBLES];
float _trumbleAppetiteAccumulator;
// smart zoom // smart zoom
GLfloat scanner_zoom_rate; GLfloat scanner_zoom_rate;
@ -838,7 +839,10 @@ typedef enum
- (NSUInteger) trumbleCount; - (NSUInteger) trumbleCount;
// loading and saving trumbleCount // loading and saving trumbleCount
- (id) trumbleValue; - (id) trumbleValue;
- (void) setTrumbleValueFrom:(NSObject*) trumbleValue; - (void) setTrumbleValueFrom:(NSObject *)trumbleValue;
- (float) trumbleAppetiteAccumulator;
- (void) setTrumbleAppetiteAccumulator:(float)value;
- (void) mungChecksumWithNSString:(NSString *)str; - (void) mungChecksumWithNSString:(NSString *)str;

View File

@ -9127,7 +9127,7 @@ static NSString *last_outfitting_key=nil;
- (void) setUpTrumbles - (void) setUpTrumbles
{ {
NSMutableString* trumbleDigrams = [NSMutableString stringWithCapacity:256]; NSMutableString *trumbleDigrams = [NSMutableString stringWithCapacity:256];
unichar xchar = (unichar)0; unichar xchar = (unichar)0;
unichar digramchars[2]; unichar digramchars[2];
@ -9156,7 +9156,7 @@ static NSString *last_outfitting_key=nil;
trumbleCount = 0; trumbleCount = 0;
trumbleAppetiteAccumulator = 0.0f; [self setTrumbleAppetiteAccumulator:0.0f];
} }
@ -9335,6 +9335,18 @@ static NSString *last_outfitting_key=nil;
} }
- (float) trumbleAppetiteAccumulator
{
return _trumbleAppetiteAccumulator;
}
- (void) setTrumbleAppetiteAccumulator:(float)value
{
_trumbleAppetiteAccumulator = value;
}
- (void) mungChecksumWithNSString:(NSString *)str - (void) mungChecksumWithNSString:(NSString *)str
{ {
if (str == nil) return; if (str == nil) return;

View File

@ -826,7 +826,7 @@ static ShipEntity *doOctreesCollide(ShipEntity *prime, ShipEntity *other);
} }
else else
{ {
subentity = [UNIVERSE newShipWithName:subentKey]; subentity = [UNIVERSE newSubentityWithName:subentKey];
} }
if (subentity == nil) { if (subentity == nil) {
OOLog(@"setup.ship.badEntry.subentities",@"Failed to set up entity %@",subentKey); OOLog(@"setup.ship.badEntry.subentities",@"Failed to set up entity %@",subentKey);

View File

@ -348,9 +348,7 @@
return; return;
} }
// -memberArray creates a new collection, which is needed because the group might be mutated by the members' AIs. for (shipEnum = [[self group] mutationSafeEnumerator]; (ship = [shipEnum nextObject]); )
NSArray *groupMembers = [[self group] memberArray];
for (shipEnum = [groupMembers objectEnumerator]; (ship = [shipEnum nextObject]); )
{ {
[ship setFoundTarget:target]; [ship setFoundTarget:target];
[ship reactToAIMessage:@"GROUP_ATTACK_TARGET" context:@"groupAttackTarget"]; [ship reactToAIMessage:@"GROUP_ATTACK_TARGET" context:@"groupAttackTarget"];

View File

@ -758,8 +758,21 @@ NSDictionary *OOMakeDockingInstructions(StationEntity *station, HPVector coords,
{ {
return NO; return NO;
} }
// and now check for docks
NSEnumerator *subEnum = nil; NSEnumerator *subEnum = nil;
#ifndef NDEBUG
ShipEntity *subEntity = nil;
for (subEnum = [self shipSubEntityEnumerator]; (subEntity = [subEnum nextObject]); )
{
if ([subEntity isStation])
{
OOLog(@"setup.ship.badType.subentities",@"Subentity %@ (%@) of station %@ is itself a StationEntity. This is an internal error - please report it. ",subEntity,[subEntity shipDataKey],[self displayName]);
}
}
#endif
// and now check for docks
DockEntity *sub = nil; DockEntity *sub = nil;
for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); ) for (subEnum = [self dockSubEntityEnumerator]; (sub = [subEnum nextObject]); )
{ {
@ -1141,7 +1154,7 @@ NSDictionary *OOMakeDockingInstructions(StationEntity *station, HPVector coords,
} }
OOLog(@"station.launchShip.failed", @"Cancelled launch for a %@ with role %@, as it is too large for the docking port of the %@.", OOLog(@"station.launchShip.failed", @"Cancelled launch for a %@ with role %@, as it is too large for the docking port of the %@.",
[ship displayName], [ship primaryRole], [self displayName]); [ship displayName], [ship primaryRole], self);
return NO; return NO;
} }

View File

@ -55,13 +55,11 @@ MA 02110-1301, USA.
if ([OOMacSystemStandardFullScreenController shouldUseSystemStandardFullScreenController]) if ([OOMacSystemStandardFullScreenController shouldUseSystemStandardFullScreenController])
{ {
fullScreenController = [[OOMacSystemStandardFullScreenController alloc] initWithGameView:gameView]; fullScreenController = [[OOMacSystemStandardFullScreenController alloc] initWithGameView:gameView];
if (fullScreenController != nil) OOLog(@"display.fullScreen.temp", @"Selecting modern full-screen controller.");
} }
#endif #endif
if (fullScreenController == nil) if (fullScreenController == nil)
{ {
OOLog(@"display.fullScreen.temp", @"Selecting Snow Leopard full-screen controller.");
fullScreenController = [[OOMacSnowLeopardFullScreenController alloc] initWithGameView:gameView]; fullScreenController = [[OOMacSnowLeopardFullScreenController alloc] initWithGameView:gameView];
} }
#endif #endif

View File

@ -66,9 +66,8 @@ enum trumble_mouth
TRUMBLE_MOUTH_NORMAL TRUMBLE_MOUTH_NORMAL
}; };
float trumbleAppetiteAccumulator;
@interface OOTrumble : NSObject @interface OOTrumble: NSObject
{ {
@private @private
PlayerEntity *player; // owning entity (not retained) PlayerEntity *player; // owning entity (not retained)
@ -115,12 +114,12 @@ float trumbleAppetiteAccumulator;
BOOL readyToSpawn; BOOL readyToSpawn;
} }
- (id) initForPlayer:(PlayerEntity*) p1; - (id) initForPlayer:(PlayerEntity *)p1;
- (id) initForPlayer:(PlayerEntity*) p1 digram:(NSString*) digramString; - (id) initForPlayer:(PlayerEntity *)p1 digram:(NSString*) digramString;
- (void) setupForPlayer:(PlayerEntity*) p1 digram:(NSString*) digramString; - (void) setupForPlayer:(PlayerEntity *)p1 digram:(NSString*) digramString;
- (void) spawnFrom:(OOTrumble*) parentTrumble; - (void) spawnFrom:(OOTrumble *)parentTrumble;
- (void) calcGrowthRate; - (void) calcGrowthRate;
@ -159,7 +158,7 @@ float trumbleAppetiteAccumulator;
- (void) updateSleep:(double) delta_t; - (void) updateSleep:(double) delta_t;
- (void) updateSpawn:(double) delta_t; - (void) updateSpawn:(double) delta_t;
- (NSDictionary*) dictionary; - (NSDictionary *)dictionary;
- (void) setFromDictionary:(NSDictionary*) dict; - (void) setFromDictionary:(NSDictionary *)dict;
@end @end

View File

@ -601,6 +601,8 @@ static void PlayTrumbleSqueal(void);
if (selectedCargopod) if (selectedCargopod)
{ {
// feed // feed
float trumbleAppetiteAccumulator = [player trumbleAppetiteAccumulator];
trumbleAppetiteAccumulator += hunger; trumbleAppetiteAccumulator += hunger;
hunger = 0.0; hunger = 0.0;
discomfort -= mostYummy * 0.5; discomfort -= mostYummy * 0.5;
@ -621,6 +623,8 @@ static void PlayTrumbleSqueal(void);
{ {
readyToSpawn = YES; readyToSpawn = YES;
} }
[player setTrumbleAppetiteAccumulator:trumbleAppetiteAccumulator];
} }
} }
} }

View File

@ -434,9 +434,11 @@ enum
- (NSString *) randomShipKeyForRoleRespectingConditions:(NSString *)role; - (NSString *) randomShipKeyForRoleRespectingConditions:(NSString *)role;
- (ShipEntity *) newShipWithRole:(NSString *)role OO_RETURNS_RETAINED; // Selects ship using role weights, applies auto_ai, respects conditions - (ShipEntity *) newShipWithRole:(NSString *)role OO_RETURNS_RETAINED; // Selects ship using role weights, applies auto_ai, respects conditions
- (ShipEntity *) newShipWithName:(NSString *)shipKey OO_RETURNS_RETAINED; // Does not apply auto_ai or respect conditions - (ShipEntity *) newShipWithName:(NSString *)shipKey OO_RETURNS_RETAINED; // Does not apply auto_ai or respect conditions
- (ShipEntity *) newSubentityWithName:(NSString *)shipKey OO_RETURNS_RETAINED; // Does not apply auto_ai or respect conditions
- (OOVisualEffectEntity *) newVisualEffectWithName:(NSString *)effectKey OO_RETURNS_RETAINED; - (OOVisualEffectEntity *) newVisualEffectWithName:(NSString *)effectKey OO_RETURNS_RETAINED;
- (DockEntity *) newDockWithName:(NSString *)shipKey OO_RETURNS_RETAINED; // Does not apply auto_ai or respect conditions - (DockEntity *) newDockWithName:(NSString *)shipKey OO_RETURNS_RETAINED; // Does not apply auto_ai or respect conditions
- (ShipEntity *) newShipWithName:(NSString *)shipKey usePlayerProxy:(BOOL)usePlayerProxy OO_RETURNS_RETAINED; // If usePlayerProxy, non-carriers are instantiated as ProxyPlayerEntity. - (ShipEntity *) newShipWithName:(NSString *)shipKey usePlayerProxy:(BOOL)usePlayerProxy OO_RETURNS_RETAINED; // If usePlayerProxy, non-carriers are instantiated as ProxyPlayerEntity.
- (ShipEntity *) newShipWithName:(NSString *)shipKey usePlayerProxy:(BOOL)usePlayerProxy isSubentity:(BOOL)isSubentity OO_RETURNS_RETAINED;
- (Class) shipClassForShipDictionary:(NSDictionary *)dict; - (Class) shipClassForShipDictionary:(NSDictionary *)dict;

View File

@ -905,6 +905,7 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
HPVector stationPos; HPVector stationPos;
Vector vf; Vector vf;
id dict_object;
NSDictionary *systeminfo = [self generateSystemData:system_seed useCache:NO]; NSDictionary *systeminfo = [self generateSystemData:system_seed useCache:NO];
unsigned techlevel = [systeminfo oo_unsignedIntForKey:KEY_TECHLEVEL]; unsigned techlevel = [systeminfo oo_unsignedIntForKey:KEY_TECHLEVEL];
@ -950,7 +951,16 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
} }
// pick a main sequence colour // pick a main sequence colour
dict_object=[systeminfo objectForKey:@"sun_color"];
if (dict_object!=nil)
{
bgcolor = [OOColor colorWithDescription:dict_object];
}
else
{
bgcolor = [OOColor colorWithHue:h1 saturation:0.75*randf() brightness:0.65+randf()/5.0 alpha:1.0]; bgcolor = [OOColor colorWithHue:h1 saturation:0.75*randf() brightness:0.65+randf()/5.0 alpha:1.0];
}
pale_bgcolor = [bgcolor blendedColorWithFraction:0.5 ofColor:[OOColor whiteColor]]; pale_bgcolor = [bgcolor blendedColorWithFraction:0.5 ofColor:[OOColor whiteColor]];
[thing release]; [thing release];
/*--*/ /*--*/
@ -984,7 +994,6 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
double sunDistanceModifier; double sunDistanceModifier;
double safeDistance; double safeDistance;
int posIterator=0; int posIterator=0;
id dict_object;
Quaternion q_sun; Quaternion q_sun;
HPVector sunPos; HPVector sunPos;
@ -2759,7 +2768,7 @@ static BOOL IsFriendlyStationPredicate(Entity *entity, void *parameter)
} }
- (StationEntity *) stationWithRole:(NSString *)role andPosition:(HPVector)position; - (StationEntity *) stationWithRole:(NSString *)role andPosition:(HPVector)position
{ {
if ([role isEqualToString:@""]) if ([role isEqualToString:@""])
{ {
@ -3140,7 +3149,19 @@ static BOOL IsFriendlyStationPredicate(Entity *entity, void *parameter)
} }
- (ShipEntity *) newSubentityWithName:(NSString *)shipKey
{
return [self newShipWithName:shipKey usePlayerProxy:NO isSubentity:YES];
}
- (ShipEntity *) newShipWithName:(NSString *)shipKey usePlayerProxy:(BOOL)usePlayerProxy - (ShipEntity *) newShipWithName:(NSString *)shipKey usePlayerProxy:(BOOL)usePlayerProxy
{
return [self newShipWithName:shipKey usePlayerProxy:usePlayerProxy isSubentity:NO];
}
- (ShipEntity *) newShipWithName:(NSString *)shipKey usePlayerProxy:(BOOL)usePlayerProxy isSubentity:(BOOL)isSubentity
{ {
OOJS_PROFILE_ENTER OOJS_PROFILE_ENTER
@ -3150,11 +3171,19 @@ static BOOL IsFriendlyStationPredicate(Entity *entity, void *parameter)
shipDict = [[OOShipRegistry sharedRegistry] shipInfoForKey:shipKey]; shipDict = [[OOShipRegistry sharedRegistry] shipInfoForKey:shipKey];
if (shipDict == nil) return nil; if (shipDict == nil) return nil;
volatile Class shipClass = [self shipClassForShipDictionary:shipDict]; volatile Class shipClass = nil;
if (isSubentity)
{
shipClass = [ShipEntity class];
}
else
{
shipClass = [self shipClassForShipDictionary:shipDict];
if (usePlayerProxy && shipClass == [ShipEntity class]) if (usePlayerProxy && shipClass == [ShipEntity class])
{ {
shipClass = [ProxyPlayerEntity class]; shipClass = [ProxyPlayerEntity class];
} }
}
@try @try
{ {