- the restored planet shader files from r4818 now also work on mac builds

- escorts launching from stations, now correctly have their mothers scanClass

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@4825 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Eric Walch 2012-04-01 09:59:08 +00:00
parent fe661015b3
commit 2c2e3b416a
6 changed files with 19 additions and 9 deletions

View File

@ -724,6 +724,8 @@
2B4CDFEC107B3D8400526C98 /* OOJSManifest.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B4CDFEA107B3D8400526C98 /* OOJSManifest.h */; };
2B4CDFED107B3D8400526C98 /* OOJSManifest.m in Sources */ = {isa = PBXBuildFile; fileRef = 2B4CDFEB107B3D8400526C98 /* OOJSManifest.m */; };
2B9A108A105D527C00EE2AE6 /* javascript-errors.plist in Copy Config */ = {isa = PBXBuildFile; fileRef = 2B9A1088105D526200EE2AE6 /* javascript-errors.plist */; };
B3460D4515285BF1002592D0 /* oolite-default-planet.fragment in Copy Shaders */ = {isa = PBXBuildFile; fileRef = B3460D4315285BDE002592D0 /* oolite-default-planet.fragment */; };
B3460D4615285BF1002592D0 /* oolite-default-planet.vertex in Copy Shaders */ = {isa = PBXBuildFile; fileRef = B3460D4415285BDE002592D0 /* oolite-default-planet.vertex */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -1208,6 +1210,8 @@
dstPath = Shaders;
dstSubfolderSpec = 7;
files = (
B3460D4515285BF1002592D0 /* oolite-default-planet.fragment in Copy Shaders */,
B3460D4615285BF1002592D0 /* oolite-default-planet.vertex in Copy Shaders */,
1A0C3EEB11933274007935E5 /* oolite-dust.fragment in Copy Shaders */,
1A0C3EDE11933076007935E5 /* oolite-dust.vertex in Copy Shaders */,
1A6515100CCC9E2E0054D01B /* oolite-standard-vertex.vertex in Copy Shaders */,
@ -1997,6 +2001,8 @@
2B4CDFEA107B3D8400526C98 /* OOJSManifest.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OOJSManifest.h; sourceTree = "<group>"; };
2B4CDFEB107B3D8400526C98 /* OOJSManifest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = OOJSManifest.m; sourceTree = "<group>"; };
2B9A1088105D526200EE2AE6 /* javascript-errors.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = "javascript-errors.plist"; sourceTree = "<group>"; };
B3460D4315285BDE002592D0 /* oolite-default-planet.fragment */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "oolite-default-planet.fragment"; sourceTree = "<group>"; };
B3460D4415285BDE002592D0 /* oolite-default-planet.vertex */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "oolite-default-planet.vertex"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -2627,6 +2633,8 @@
1A6514F90CCC9D670054D01B /* Shaders */ = {
isa = PBXGroup;
children = (
B3460D4315285BDE002592D0 /* oolite-default-planet.fragment */,
B3460D4415285BDE002592D0 /* oolite-default-planet.vertex */,
1A65150D0CCC9E220054D01B /* oolite-standard-vertex.vertex */,
1A02FD340EE048E8008F9B09 /* oolite-tangent-space-vertex.vertex */,
1A65150E0CCC9E220054D01B /* oolite-default-shader.fragment */,

View File

@ -62,8 +62,8 @@ this.shipWillExitWitchspace = function ()
if (missionVariables.cloakcounter > 6 && system.countShipsWithRole("asp-cloaked") === 0)
{
// Then trigger the ambush!
system.legacy_addShips("asp-cloaked", 1);
system.legacy_addShips("asp-pirate", 2);
system.addShips("asp-cloaked", 1);
system.addShips("asp-pirate", 2);
}
}
}

View File

@ -5181,9 +5181,9 @@ static GLfloat sBaseMass = 0.0;
Vector whpos, exitpos;
quaternion_set_random(&q1);
if (abs((int)d1) < 750)
if (abs((int)d1) < MIN_DISTANCE_TO_BUOY)
{
d1 += ((d1 > 0.0)? 750.0f: -750.0f); // not to close to the buoy.
d1 += ((d1 > 0.0)? MIN_DISTANCE_TO_BUOY: -MIN_DISTANCE_TO_BUOY); // not to close to the buoy.
}
Vector v1 = vector_forward_from_quaternion(q1);
exitpos = vector_add(pos, vector_multiply_scalar(v1, d1)); // randomise exit position
@ -5211,11 +5211,11 @@ static GLfloat sBaseMass = 0.0;
}
distance = vector_subtract(whpos, pos);
if (magnitude2(distance) < 562500.0f ) // within 750 meters from the buoy?
if (magnitude2(distance) < MIN_DISTANCE_TO_BUOY2 ) // within safety distance from the buoy?
{
// the wormhole is to close to the buoy. Move both player and wormhole away from it in the x-y plane.
distance.z = 0;
distance = vector_multiply_scalar(vector_normal(distance), 750.0f);
distance = vector_multiply_scalar(vector_normal(distance), MIN_DISTANCE_TO_BUOY);
whpos = vector_add(whpos, distance);
position = vector_add(position, distance);
}

View File

@ -39,6 +39,9 @@ MA 02110-1301, USA.
@protocol OOHUDBeaconIcon;
#define MIN_DISTANCE_TO_BUOY 750.0f // don't add ships within this distance
#define MIN_DISTANCE_TO_BUOY2 (MIN_DISTANCE_TO_BUOY * MIN_DISTANCE_TO_BUOY)
#define MAX_TARGETS 24
#define RAIDER_MAX_CARGO 5
#define MERCHANTMAN_MAX_CARGO 125

View File

@ -9141,8 +9141,7 @@ Vector positionOffsetForShipInRotationToAlignment(ShipEntity* ship, Quaternion q
Vector v1 = vector_forward_from_quaternion(q1);
double d1 = 0.0;
// no closer than 750m, same as the player.
while (abs(d1) < 750.0)
while (abs(d1) < MIN_DISTANCE_TO_BUOY)
{
d1 = SCANNER_MAX_RANGE * (randf() - randf());
}

View File

@ -1676,7 +1676,7 @@ static NSDictionary* instructions(int station_id, Vector coords, float speed, fl
[OOCharacter randomCharacterWithRole: @"hunter"
andOriginalSystem: [UNIVERSE systemSeed]]]];
[escort_ship setScanClass: CLASS_NEUTRAL];
[escort_ship setScanClass: [ship scanClass]];
[escort_ship setCargoFlag: CARGO_FLAG_FULL_PLENTIFUL];
[escort_ship setPrimaryRole:@"escort"];
if ((sunskimmer || trader) && [escort_ship heatInsulation] < [ship heatInsulation])