Merge branch 'master' of github.com:OoliteProject/oolite into javascript-ai
This commit is contained in:
commit
1811b2a3f7
2
.gitignore
vendored
2
.gitignore
vendored
@ -27,4 +27,4 @@ DebugOXP/requires.plist
|
||||
AddOns/
|
||||
|
||||
# Debug output
|
||||
core
|
||||
/core
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 78e78821865f8751378e695ccd37598c0e0f31b8
|
||||
Subproject commit 624478f8d255e171fde9ce63401ce9ce7bc2603d
|
@ -663,6 +663,10 @@
|
||||
1AD1F4FF0CD9E83700EAE520 /* NSThreadOOExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD1F4C80CD9E42A00EAE520 /* NSThreadOOExtensions.m */; };
|
||||
1AD1F5000CD9E83800EAE520 /* NSThreadOOExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD1F4C70CD9E42A00EAE520 /* NSThreadOOExtensions.h */; };
|
||||
1AD3C339163A92F600469C4D /* OOOpenGLStateManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD3C338163A92F600469C4D /* OOOpenGLStateManager.m */; };
|
||||
1AD8522517947BD600CBE743 /* OOHPVector.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD8522317947BD600CBE743 /* OOHPVector.h */; };
|
||||
1AD8522617947BD600CBE743 /* OOHPVector.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8522417947BD600CBE743 /* OOHPVector.m */; };
|
||||
1AD8522E17947C9500CBE743 /* OOJSPopulatorDefinition.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD8522C17947C9400CBE743 /* OOJSPopulatorDefinition.h */; };
|
||||
1AD8522F17947C9500CBE743 /* OOJSPopulatorDefinition.m in Sources */ = {isa = PBXBuildFile; fileRef = 1AD8522D17947C9500CBE743 /* OOJSPopulatorDefinition.m */; };
|
||||
1ADA564810CD68D800E891B8 /* OOStellarBody.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ADA564710CD68D800E891B8 /* OOStellarBody.h */; };
|
||||
1ADA8AB30F42DBA80001BEC9 /* OODeepCopy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1ADA8AB10F42DBA80001BEC9 /* OODeepCopy.h */; };
|
||||
1ADA8AB40F42DBA80001BEC9 /* OODeepCopy.m in Sources */ = {isa = PBXBuildFile; fileRef = 1ADA8AB20F42DBA80001BEC9 /* OODeepCopy.m */; };
|
||||
@ -1972,6 +1976,10 @@
|
||||
1AD3C338163A92F600469C4D /* OOOpenGLStateManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOOpenGLStateManager.m; sourceTree = "<group>"; };
|
||||
1AD5A81A12D3A9FD00B62503 /* exports-debug-32.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; name = "exports-debug-32.exp"; path = "src/Cocoa/exports-debug-32.exp"; sourceTree = "<group>"; };
|
||||
1AD5A81B12D3A9FD00B62503 /* exports-debug-64.exp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.exports; name = "exports-debug-64.exp"; path = "src/Cocoa/exports-debug-64.exp"; sourceTree = "<group>"; };
|
||||
1AD8522317947BD600CBE743 /* OOHPVector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOHPVector.h; sourceTree = "<group>"; };
|
||||
1AD8522417947BD600CBE743 /* OOHPVector.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOHPVector.m; sourceTree = "<group>"; };
|
||||
1AD8522C17947C9400CBE743 /* OOJSPopulatorDefinition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOJSPopulatorDefinition.h; sourceTree = "<group>"; };
|
||||
1AD8522D17947C9500CBE743 /* OOJSPopulatorDefinition.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOJSPopulatorDefinition.m; sourceTree = "<group>"; };
|
||||
1AD88FAF103F29D300AA36F4 /* oolite-options.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = "oolite-options.xcconfig"; path = "src/Cocoa/oolite-options.xcconfig"; sourceTree = "<group>"; };
|
||||
1ADA564710CD68D800E891B8 /* OOStellarBody.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOStellarBody.h; sourceTree = "<group>"; };
|
||||
1ADA8AB10F42DBA80001BEC9 /* OODeepCopy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OODeepCopy.h; sourceTree = "<group>"; };
|
||||
@ -2732,6 +2740,8 @@
|
||||
1A0942C812D7C011003B6273 /* OOJSFrameCallbacks.m */,
|
||||
1A38E9E11603C7A500EE19F1 /* OOJSInterfaceDefinition.h */,
|
||||
1A38E9E21603C7A500EE19F1 /* OOJSInterfaceDefinition.m */,
|
||||
1AD8522C17947C9400CBE743 /* OOJSPopulatorDefinition.h */,
|
||||
1AD8522D17947C9500CBE743 /* OOJSPopulatorDefinition.m */,
|
||||
);
|
||||
name = JavaScript;
|
||||
sourceTree = "<group>";
|
||||
@ -3110,6 +3120,8 @@
|
||||
1A9404920BAF4582005F6CF3 /* OOMaths.h */,
|
||||
1A9404A10BAF462D005F6CF3 /* OOVector.h */,
|
||||
1A9404A20BAF462D005F6CF3 /* OOVector.m */,
|
||||
1AD8522317947BD600CBE743 /* OOHPVector.h */,
|
||||
1AD8522417947BD600CBE743 /* OOHPVector.m */,
|
||||
1A9405360BAF4FA6005F6CF3 /* OOMatrix.h */,
|
||||
1A9405370BAF4FA6005F6CF3 /* OOMatrix.m */,
|
||||
1A94057D0BAF52AD005F6CF3 /* OOQuaternion.h */,
|
||||
@ -3580,6 +3592,8 @@
|
||||
1A401F8815E7AF7B004CDF95 /* OOPrimaryWindow.h in Headers */,
|
||||
1A38E9E31603C7A500EE19F1 /* OOJSInterfaceDefinition.h in Headers */,
|
||||
1AAEE9DA161F7523003A5A1E /* OOStringExpander.h in Headers */,
|
||||
1AD8522517947BD600CBE743 /* OOHPVector.h in Headers */,
|
||||
1AD8522E17947C9500CBE743 /* OOJSPopulatorDefinition.h in Headers */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
@ -4058,6 +4072,8 @@
|
||||
1A38E9E41603C7A500EE19F1 /* OOJSInterfaceDefinition.m in Sources */,
|
||||
1AAEE9DB161F7523003A5A1E /* OOStringExpander.m in Sources */,
|
||||
1AD3C339163A92F600469C4D /* OOOpenGLStateManager.m in Sources */,
|
||||
1AD8522617947BD600CBE743 /* OOHPVector.m in Sources */,
|
||||
1AD8522F17947C9500CBE743 /* OOJSPopulatorDefinition.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -161,9 +161,6 @@ enum
|
||||
if (shaderMode == kShaderModeOn) return;
|
||||
#endif
|
||||
|
||||
PlayerEntity* player = PLAYER;
|
||||
assert(player != nil);
|
||||
|
||||
zero_distance = 0.0;
|
||||
|
||||
Vector offset = vector_flip(cameraRelativePosition);
|
||||
|
@ -112,7 +112,9 @@ static OOTexture *sPlumeTexture = nil;
|
||||
_trackTime = now;
|
||||
}
|
||||
|
||||
GLfloat ex_emissive[4] = {0.7f, 0.9, 1.0f, 0.9f * kOverallAlpha}; // pale blue
|
||||
//GLfloat ex_emissive[4] = {0.7f, 0.9, 1.0f, 0.9f * kOverallAlpha}; // pale blue - old definition
|
||||
GLfloat ex_emissive[4];
|
||||
[[ship exhaustEmissiveColor] getRed:&ex_emissive[0] green:&ex_emissive[1] blue:&ex_emissive[2] alpha:&ex_emissive[3]];
|
||||
const GLfloat s1[8] = { 0.0, M_SQRT1_2, 1.0, M_SQRT1_2, 0.0, -M_SQRT1_2, -1.0, -M_SQRT1_2};
|
||||
const GLfloat c1[8] = { 1.0, M_SQRT1_2, 0.0, -M_SQRT1_2, -1.0, -M_SQRT1_2, 0.0, M_SQRT1_2};
|
||||
|
||||
|
@ -212,6 +212,7 @@ typedef enum
|
||||
NSDictionary *dockingInstructions;
|
||||
|
||||
OOColor *laser_color;
|
||||
OOColor *exhaust_emissive_color;
|
||||
OOColor *scanner_display_color1;
|
||||
OOColor *scanner_display_color2;
|
||||
|
||||
@ -971,7 +972,9 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q
|
||||
- (BOOL) fireStarboardWeapon:(double)range;
|
||||
- (BOOL) fireTurretCannon:(double)range;
|
||||
- (void) setLaserColor:(OOColor *)color;
|
||||
- (void) setExhaustEmissiveColor:(OOColor *)color;
|
||||
- (OOColor *)laserColor;
|
||||
- (OOColor *)exhaustEmissiveColor;
|
||||
- (BOOL) fireSubentityLaserShot:(double)range;
|
||||
- (BOOL) fireDirectLaserShot:(double)range;
|
||||
- (BOOL) fireDirectLaserDefensiveShot;
|
||||
|
@ -362,9 +362,20 @@ static ShipEntity *doOctreesCollide(ShipEntity *prime, ShipEntity *other);
|
||||
if (octree) mass = (GLfloat)(density * 20.0 * [octree volume]);
|
||||
|
||||
OOColor *color = [OOColor brightColorWithDescription:[shipDict objectForKey:@"laser_color"]];
|
||||
|
||||
if (color == nil) color = [OOColor redColor];
|
||||
[self setLaserColor:color];
|
||||
|
||||
// exhaust emissive color
|
||||
OORGBAComponents defaultExhaustEmissiveColorComponents; // pale blue is exhaust default color
|
||||
defaultExhaustEmissiveColorComponents.r = 0.7f;
|
||||
defaultExhaustEmissiveColorComponents.g = 0.9f;
|
||||
defaultExhaustEmissiveColorComponents.b = 1.0f;
|
||||
defaultExhaustEmissiveColorComponents.a = 0.9f;
|
||||
color = [OOColor brightColorWithDescription:[shipDict objectForKey:@"exhaust_emissive_color"]];
|
||||
if (color == nil) color = [OOColor colorWithRGBAComponents:defaultExhaustEmissiveColorComponents];
|
||||
[self setExhaustEmissiveColor:color];
|
||||
|
||||
[self clearSubEntities];
|
||||
[self setUpSubEntities];
|
||||
|
||||
@ -936,6 +947,7 @@ static ShipEntity *doOctreesCollide(ShipEntity *prime, ShipEntity *other);
|
||||
DESTROY(roleSet);
|
||||
DESTROY(primaryRole);
|
||||
DESTROY(laser_color);
|
||||
DESTROY(exhaust_emissive_color);
|
||||
DESTROY(scanner_display_color1);
|
||||
DESTROY(scanner_display_color2);
|
||||
DESTROY(script);
|
||||
@ -10141,12 +10153,28 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q
|
||||
}
|
||||
|
||||
|
||||
- (void) setExhaustEmissiveColor:(OOColor *) color
|
||||
{
|
||||
if (color)
|
||||
{
|
||||
[exhaust_emissive_color release];
|
||||
exhaust_emissive_color = [color retain];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
- (OOColor *)laserColor
|
||||
{
|
||||
return [[laser_color retain] autorelease];
|
||||
}
|
||||
|
||||
|
||||
- (OOColor *)exhaustEmissiveColor
|
||||
{
|
||||
return [[exhaust_emissive_color retain] autorelease];
|
||||
}
|
||||
|
||||
|
||||
- (BOOL) fireSubentityLaserShot:(double)range
|
||||
{
|
||||
[self setShipHitByLaser:nil];
|
||||
@ -12405,7 +12433,6 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q
|
||||
|
||||
- (NSDictionary *) dockingInstructions
|
||||
{
|
||||
OOLog(@"docking.debug",@"%@",dockingInstructions);
|
||||
return dockingInstructions;
|
||||
}
|
||||
|
||||
|
@ -568,7 +568,6 @@
|
||||
message = [dockingInstructions objectForKey:@"comms_message"];
|
||||
if (message != nil) [station sendExpandedMessage:message toShip:self];
|
||||
}
|
||||
OOLog(@"docking.debug",@"%@",dockingInstructions);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -38,12 +38,6 @@ SOFTWARE.
|
||||
#import "OOShaderUniformMethodType.h"
|
||||
|
||||
|
||||
OOINLINE BOOL ValidBindingType(OOShaderUniformType type)
|
||||
{
|
||||
return kOOShaderUniformTypeInt <= type && type <= kOOShaderUniformTypeDouble;
|
||||
}
|
||||
|
||||
|
||||
@interface OOShaderUniform (OOPrivate)
|
||||
|
||||
- (id)initWithName:(NSString *)uniformName shaderProgram:(OOShaderProgram *)shaderProgram;
|
||||
|
@ -184,6 +184,7 @@ enum
|
||||
kShip_equipment, // the ship's equipment, array of EquipmentInfo, read only
|
||||
kShip_escortGroup, // group, ShipGroup, read-only
|
||||
kShip_escorts, // deployed escorts, array of Ship, read-only
|
||||
kShip_exhaustEmissiveColor, // exhaust emissive color, array, read/write
|
||||
kShip_extraCargo, // cargo space increase granted by large cargo bay, int, read-only
|
||||
kShip_forwardWeapon, // the ship's forward weapon, equipmentType, read/write
|
||||
kShip_fuel, // fuel, float, read/write
|
||||
@ -305,13 +306,14 @@ static JSPropertySpec sShipProperties[] =
|
||||
{ "desiredSpeed", kShip_desiredSpeed, OOJS_PROP_READWRITE_CB },
|
||||
{ "destination", kShip_destination, OOJS_PROP_READWRITE_CB },
|
||||
{ "displayName", kShip_displayName, OOJS_PROP_READWRITE_CB },
|
||||
{ "dockingInstructions", kShip_dockingInstructions, OOJS_PROP_READONLY_CB },
|
||||
{ "dockingInstructions", kShip_dockingInstructions, OOJS_PROP_READONLY_CB },
|
||||
{ "energyRechargeRate", kShip_energyRechargeRate, OOJS_PROP_READONLY_CB },
|
||||
{ "entityPersonality", kShip_entityPersonality, OOJS_PROP_READONLY_CB },
|
||||
{ "equipment", kShip_equipment, OOJS_PROP_READONLY_CB },
|
||||
{ "escorts", kShip_escorts, OOJS_PROP_READONLY_CB },
|
||||
{ "escortGroup", kShip_escortGroup, OOJS_PROP_READONLY_CB },
|
||||
{ "extraCargo", kShip_extraCargo, OOJS_PROP_READONLY_CB },
|
||||
{ "exhaustEmissiveColor", kShip_exhaustEmissiveColor, OOJS_PROP_READWRITE_CB },
|
||||
{ "extraCargo", kShip_extraCargo, OOJS_PROP_READONLY_CB },
|
||||
{ "forwardWeapon", kShip_forwardWeapon, OOJS_PROP_READWRITE_CB },
|
||||
{ "fuel", kShip_fuel, OOJS_PROP_READWRITE_CB },
|
||||
{ "fuelChargeRate", kShip_fuelChargeRate, OOJS_PROP_READONLY_CB },
|
||||
@ -944,6 +946,10 @@ static JSBool ShipGetProperty(JSContext *context, JSObject *this, jsid propID, j
|
||||
result = [[entity scannerDisplayColor2] normalizedArray];
|
||||
break;
|
||||
|
||||
case kShip_exhaustEmissiveColor:
|
||||
result = [[entity exhaustEmissiveColor] normalizedArray];
|
||||
break;
|
||||
|
||||
case kShip_maxThrust:
|
||||
return JS_NewNumberValue(context, [entity maxThrust], value);
|
||||
|
||||
@ -1314,6 +1320,15 @@ static JSBool ShipSetProperty(JSContext *context, JSObject *this, jsid propID, J
|
||||
}
|
||||
break;
|
||||
|
||||
case kShip_exhaustEmissiveColor:
|
||||
colorForScript = [OOColor colorWithDescription:OOJSNativeObjectFromJSValue(context, *value)];
|
||||
if (colorForScript != nil || JSVAL_IS_NULL(*value))
|
||||
{
|
||||
[entity setExhaustEmissiveColor:colorForScript];
|
||||
return YES;
|
||||
}
|
||||
break;
|
||||
|
||||
case kShip_scriptedMisjump:
|
||||
if (JS_ValueToBoolean(context, *value, &bValue))
|
||||
{
|
||||
|
@ -104,8 +104,6 @@ enum
|
||||
|
||||
#define MAX_NUMBER_OF_ENTITIES 200
|
||||
#define STANDARD_STATION_ROLL 0.4
|
||||
#define WOLFPACK_SHIPS_DISTANCE 0.1
|
||||
#define FIXED_ASTEROID_FIELDS 0
|
||||
// currently twice scanner radius
|
||||
#define LANE_WIDTH 51200.0
|
||||
|
||||
@ -1270,18 +1268,18 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
|
||||
NSEnumerator *enumerator = [[blocks sortedArrayUsingFunction:populatorPrioritySort context:nil] objectEnumerator];
|
||||
NSDictionary *populator;
|
||||
HPVector location;
|
||||
int locationSeed, groupCount, rndvalue;
|
||||
unsigned i;
|
||||
unsigned i, locationSeed, groupCount, rndvalue;
|
||||
RANROTSeed rndcache, rndlocal;
|
||||
NSString *locationCode;
|
||||
OOJSPopulatorDefinition *pdef;
|
||||
while ((populator = [enumerator nextObject])) {
|
||||
while ((populator = [enumerator nextObject]))
|
||||
{
|
||||
// for now, the "deterministic" setting does nothing
|
||||
|
||||
locationSeed = [populator oo_intForKey:@"locationSeed" defaultValue:0];
|
||||
groupCount = [populator oo_intForKey:@"groupCount" defaultValue:1];
|
||||
locationSeed = [populator oo_unsignedIntForKey:@"locationSeed" defaultValue:0];
|
||||
groupCount = [populator oo_unsignedIntForKey:@"groupCount" defaultValue:1];
|
||||
|
||||
for (i=0;i<groupCount;i++)
|
||||
for (i = 0; i < groupCount; i++)
|
||||
{
|
||||
locationCode = [populator oo_stringForKey:@"location" defaultValue:@"COORDINATES"];
|
||||
if ([locationCode isEqualToString:@"COORDINATES"])
|
||||
@ -1290,7 +1288,7 @@ GLfloat docked_light_specular[4] = { DOCKED_ILLUM_LEVEL, DOCKED_ILLUM_LEVEL, DOC
|
||||
}
|
||||
else
|
||||
{
|
||||
if(locationSeed != 0)
|
||||
if (locationSeed != 0)
|
||||
{
|
||||
rndcache = RANROTGetFullSeed();
|
||||
// different place for each system
|
||||
|
Loading…
x
Reference in New Issue
Block a user