Added missile_load_time to shipdataEntrySchema. Cleaned up planet miniature LOD stuff.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@2846 127b21dd-08f5-0310-b4b7-95ae10353056
master
Jens Ayton 2009-12-05 20:39:24 +00:00
parent 46896e81ed
commit 9e69f069ac
4 changed files with 14 additions and 9 deletions

View File

@ -114,6 +114,7 @@
valueType = "$customViewSpec";
};
max_missiles = "positiveInteger";
missile_load_time = "positiveFloat";
script = "$scriptFileName";
has_npc_traffic = "fuzzyBoolean";
script_info = "dictionary";

View File

@ -231,6 +231,9 @@ static OOColor *ColorWithHSBColor(Vector c)
_atmosphereDrawable = [planet->_atmosphereDrawable copy];
[_atmosphereDrawable setRadius:collision_radius + ATMOSPHERE_DEPTH * PLANET_MINIATURE_FACTOR * 2.0]; //not to scale: invisible otherwise
[_planetDrawable setLevelOfDetail:0.8f];
[_atmosphereDrawable setLevelOfDetail:0.8f];
return self;
}
@ -302,15 +305,11 @@ static OOColor *ColorWithHSBColor(Vector c)
if ([UNIVERSE wireframeGraphics]) GLDebugWireframeModeOn();
if (_miniature)
{
[_planetDrawable setLevelOfDetail:0.8f];
}
else
if (!_miniature)
{
[_planetDrawable calculateLevelOfDetailForViewDistance:zero_distance];
[_atmosphereDrawable setLevelOfDetail:[_planetDrawable levelOfDetail]];
}
[_atmosphereDrawable setLevelOfDetail:[_planetDrawable levelOfDetail]];
[_planetDrawable renderOpaqueParts];
[_atmosphereDrawable renderOpaqueParts];

View File

@ -205,8 +205,8 @@ MA 02110-1301, USA.
unsigned missiles; // number of on-board missiles
unsigned max_missiles; // number of missile pylons
NSString *missileRole;
OOTimeAbsolute missile_load_time; // minimum time interval between missile launches
OOTimeAbsolute missile_launch_time; // time since last missile launch
OOTimeDelta missile_load_time; // minimum time interval between missile launches
OOTimeAbsolute missile_launch_time; // time of last missile launch
#ifdef OO_BRAIN_AI
OOBrain *brain; // brain controlling ship, could be a character brain or the autopilot

View File

@ -72,7 +72,7 @@ static FloatRGBA PlanetMix(float q, float maxQ, FloatRGB landColor, FloatRGB sea
[[planetInfo objectForKey:@"noise_map_seed"] getValue:&_seed];
_width = 512;
_height = 512;
_height = _width; // Ideally, aspect ratio would be 2:1, but current code only handles squares.
}
return self;
@ -214,6 +214,11 @@ static FloatRGBA PlanetMix(float q, float maxQ, FloatRGB landColor, FloatRGB sea
/* Terrain shading
was: _powf(norm.z, 3.2). Changing exponent to 3 makes very
little difference, other than being faster.
FIXME: need to work out a decent way to scale this with texture
size, so overall darkness is constant. As an experiment, I used
a size of 128 << k and shade = pow(norm.z, k + 1); this was
better, but still darker at smaller resolutions.
*/
GLfloat shade = norm.z * norm.z * norm.z;