Fixed initialization order warnings

ver1_5_1
Toti 2006-09-12 14:24:55 +00:00
parent 555a3e5bf7
commit 1cce187e70
5 changed files with 51 additions and 49 deletions

View File

@ -79,7 +79,7 @@ void CommandGoto::process(ExecutionEnvironment& env)
////////////////
// GotoLongLat command: go to the selected body and hover over
// GotoLongLat command: go to the selected body and hover over
CommandGotoLongLat::CommandGotoLongLat(double t,
double dist,
@ -189,7 +189,7 @@ void CommandSynchronous::process(ExecutionEnvironment& env)
////////////////
// Chase command:
// Chase command:
CommandChase::CommandChase()
{
@ -202,7 +202,7 @@ void CommandChase::process(ExecutionEnvironment& env)
////////////////
// Track command:
// Track command:
CommandTrack::CommandTrack()
{
@ -445,7 +445,7 @@ void CommandSetOrientation::process(ExecutionEnvironment& env)
////////////////
// Look back command: reverse observer orientation
CommandLookBack::CommandLookBack()
CommandLookBack::CommandLookBack()
{
}
@ -689,7 +689,7 @@ void CommandCapture::process(ExecutionEnvironment& env)
// Get the dimensions of the current viewport
int viewport[4];
glGetIntegerv(GL_VIEWPORT, viewport);
if (compareIgnoringCase(type, "jpeg") == 0)
{
success = CaptureGLBufferToJPEG(filename,
@ -731,8 +731,8 @@ void CommandRenderPath::process(ExecutionEnvironment& env)
RepeatCommand::RepeatCommand(CommandSequence* _body, int _repeatCount) :
body(_body),
repeatCount(_repeatCount),
bodyDuration(0.0),
repeatCount(_repeatCount),
execution(NULL)
{
for (CommandSequence::const_iterator iter = body->begin();

View File

@ -2546,10 +2546,12 @@ class UranianSatelliteOrbit : public CachingOrbit
double* _zeta_k, double* _zeta_theta,
double* _zeta_phi) :
a(_a), n(_n), L0(_L0), L1(_L1),
LTerms(_LTerms), zTerms(_zTerms), zetaTerms(_zetaTerms),
L_k(_L_k), L_theta(_L_theta), L_phi(_L_phi),
LTerms(_LTerms),
z_k(_z_k), z_theta(_z_theta), z_phi(_z_phi),
zeta_k(_zeta_k), zeta_theta(_zeta_theta), zeta_phi(_zeta_phi)
zTerms(_zTerms),
zeta_k(_zeta_k), zeta_theta(_zeta_theta), zeta_phi(_zeta_phi),
zetaTerms(_zetaTerms)
{
};

View File

@ -266,7 +266,7 @@ static void LoadMipmapSet(Image& img, GLenum target)
{
uint mipWidth = max((uint) img.getWidth() >> mip, 1u);
uint mipHeight = max((uint) img.getHeight() >> mip, 1u);
if (img.isCompressed())
{
glx::glCompressedTexImage2DARB(target,
@ -342,7 +342,7 @@ static int CalcMipLevelCount(int w, int h)
Texture::Texture(int w, int h, int d) :
width(w), height(h), depth(d), alpha(false), compressed(false)
alpha(false), compressed(false), width(w), height(h), depth(d)
{
}
@ -409,23 +409,23 @@ ImageTexture::ImageTexture(Image& img,
glGenTextures(1, (GLuint*) &glName);
glBindTexture(GL_TEXTURE_2D, glName);
bool mipmap = mipMapMode != NoMipMaps;
bool precomputedMipMaps = false;
// Use precomputed mipmaps only if a complete set is supplied
int mipLevelCount = img.getMipLevelCount();
if (mipmap && mipLevelCount == CalcMipLevelCount(img.getWidth(), img.getHeight()))
{
{
precomputedMipMaps = true;
}
}
// We can't automatically generate mipmaps for compressed textures.
// If a precomputed mipmap set isn't provided, turn off mipmapping entirely.
if (!precomputedMipMaps && img.isCompressed())
{
mipmap = false;
}
}
GLenum texAddress = GetGLTexAddressMode(addressMode);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, texAddress);
@ -433,7 +433,7 @@ ImageTexture::ImageTexture(Image& img,
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
mipmap ? GL_LINEAR_MIPMAP_LINEAR : GL_LINEAR);
if (mipMapMode == AutoMipMaps)
glTexParameteri(GL_TEXTURE_2D, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
@ -505,7 +505,7 @@ void ImageTexture::setBorderColor(Color borderColor)
}
TiledTexture::TiledTexture(Image& img,
TiledTexture::TiledTexture(Image& img,
int _uSplit, int _vSplit,
MipMapMode mipMapMode) :
Texture(img.getWidth(), img.getHeight()),
@ -656,7 +656,7 @@ TiledTexture::TiledTexture(Image& img,
}
}
}
delete tile;
}
@ -708,7 +708,7 @@ int TiledTexture::getVTileCount(int) const
const TextureTile TiledTexture::getTile(int lod, int u, int v)
{
if (lod != 0 || u >= uSplit || u < 0 || v >= vSplit || v < 0)
return TextureTile(0);
return TextureTile(0);
else
{
return TextureTile(glNames[v * uSplit + u]);

View File

@ -1,5 +1,5 @@
// universe.cpp
//
//
// Copyright (C) 2001, Chris Laurel <claurel@shatters.net>
//
// A container for catalogs of galaxies, stars, and planets.
@ -26,8 +26,8 @@ using namespace std;
Universe::Universe() :
starCatalog(NULL),
solarSystemCatalog(NULL),
dsoCatalog(NULL),
solarSystemCatalog(NULL),
asterisms(NULL),
/*boundaries(NULL),*/
markers(NULL)
@ -317,8 +317,8 @@ static bool ApproxPlanetPickTraversal(Body* body, void* info)
// the planet rather than one of its satellites.
float appOrbitRadius = (float) (body->getOrbit()->getBoundingRadius() /
distance);
if ((pickInfo->atanTolerance > ANGULAR_RES ? pickInfo->atanTolerance:
if ((pickInfo->atanTolerance > ANGULAR_RES ? pickInfo->atanTolerance:
ANGULAR_RES) > appOrbitRadius)
{
return true;
@ -330,7 +330,7 @@ static bool ApproxPlanetPickTraversal(Body* body, void* info)
if (sinAngle2 <= pickInfo->sinAngle2Closest)
{
pickInfo->sinAngle2Closest = sinAngle2 > ANGULAR_RES ? sinAngle2 :
pickInfo->sinAngle2Closest = sinAngle2 > ANGULAR_RES ? sinAngle2 :
ANGULAR_RES;
pickInfo->closestBody = body;
pickInfo->closestApproxDistance = distance;
@ -409,7 +409,7 @@ static bool ExactPlanetPickTraversal(Body* body, void* info)
double sinAngle2 = sqrt(bodyMiss * bodyMiss)/2.0;
if (sinAngle2 < sin(PI/4.0) && distance > 0.0 &&
if (sinAngle2 < sin(PI/4.0) && distance > 0.0 &&
distance <= pickInfo->closestDistance)
{
pickInfo->closestDistance = distance;
@ -428,7 +428,7 @@ Selection Universe::pickPlanet(SolarSystem& solarSystem,
float faintestMag,
float tolerance)
{
double sinTol2 = (sin(tolerance/2.0) > ANGULAR_RES ?
double sinTol2 = (sin(tolerance/2.0) > ANGULAR_RES ?
sin(tolerance/2.0) : ANGULAR_RES);
PlanetPickInfo pickInfo;
@ -444,7 +444,7 @@ Selection Universe::pickPlanet(SolarSystem& solarSystem,
pickInfo.pickRay = Ray3d(astrocentricOrigin,
Vec3d(direction.x, direction.y, direction.z));
pickInfo.sinAngle2Closest = 1.0;
pickInfo.closestDistance = 1.0e50;
pickInfo.closestApproxDistance = 1.0e50;
@ -464,22 +464,22 @@ Selection Universe::pickPlanet(SolarSystem& solarSystem,
Body* closestBody = pickInfo.closestBody;
// Check if there is a satellite in front of the primary body that is
// sufficiently close to the pickRay
// sufficiently close to the pickRay
solarSystem.getPlanets()->traverse(ApproxPlanetPickTraversal,
(void*) &pickInfo);
if (pickInfo.closestBody == closestBody)
return Selection(closestBody);
return Selection(closestBody);
// Nothing else around, select the body and return
// Are we close enough to the satellite and is it in front of the body?
if ((pickInfo.sinAngle2Closest <= sinTol2) &&
(pickInfo.closestDistance > pickInfo.closestApproxDistance))
if ((pickInfo.sinAngle2Closest <= sinTol2) &&
(pickInfo.closestDistance > pickInfo.closestApproxDistance))
return Selection(pickInfo.closestBody);
// Yes, select the satellite
else
return Selection(closestBody);
// No, select the primary body
return Selection(closestBody);
// No, select the primary body
}
// If no planet was intersected by the pick ray, choose the planet|moon
@ -522,7 +522,7 @@ StarPicker::StarPicker(const Point3f& _pickOrigin,
pickedStar(NULL),
pickOrigin(_pickOrigin),
pickRay(_pickRay),
sinAngle2Closest(sin(angle/2.0) > ANGULAR_RES ? sin(angle/2.0) :
sinAngle2Closest(sin(angle/2.0) > ANGULAR_RES ? sin(angle/2.0) :
ANGULAR_RES ),
when(_when)
{
@ -560,7 +560,7 @@ void StarPicker::process(const Star& star, float distance, float appMag)
}
Vec3f starMiss = starDir - pickRay;
Vec3d sMd = Vec3d(starMiss.x, starMiss.y, starMiss.z);
Vec3d sMd = Vec3d(starMiss.x, starMiss.y, starMiss.z);
sinAngle2 = sqrt(sMd * sMd)/2.0;
if (sinAngle2 <= sinAngle2Closest)
@ -604,7 +604,7 @@ CloseStarPicker::CloseStarPicker(const UniversalCoord& pos,
maxDistance(_maxDistance),
closestStar(NULL),
closestDistance(0.0f),
sinAngle2Closest(sin(angle/2.0) > ANGULAR_RES ? sin(angle/2.0) :
sinAngle2Closest(sin(angle/2.0) > ANGULAR_RES ? sin(angle/2.0) :
ANGULAR_RES )
{
}
@ -616,7 +616,7 @@ void CloseStarPicker::process(const Star& star,
if (lowPrecDistance > maxDistance)
return;
Vec3d hPos = (star.getPosition(now) - pickOrigin) *
Vec3d hPos = (star.getPosition(now) - pickOrigin) *
astro::microLightYearsToKilometers(1.0);
Vec3f starDir((float) hPos.x, (float) hPos.y, (float) hPos.z);
float distance = 0.0f;
@ -631,7 +631,7 @@ void CloseStarPicker::process(const Star& star,
{
closestStar = &star;
closestDistance = starDir.length();
sinAngle2Closest = ANGULAR_RES;
sinAngle2Closest = ANGULAR_RES;
// An exact hit--set the angle to "zero"
}
}
@ -642,8 +642,8 @@ void CloseStarPicker::process(const Star& star,
float distance = starDir.length();
starDir.normalize();
Vec3f starMiss = starDir - pickDir;
Vec3d sMd = Vec3d(starMiss.x, starMiss.y, starMiss.z );
Vec3d sMd = Vec3d(starMiss.x, starMiss.y, starMiss.z );
double sinAngle2 = sqrt(sMd * sMd)/2.0;
if (sinAngle2 <= sinAngle2Closest &&
@ -685,7 +685,7 @@ Selection Universe::pickStar(const UniversalCoord& origin,
Quatf rotation;
Vec3f n(0, 0, -1);
Vec3f Missf = n - direction;
Vec3d Miss = Vec3d(Missf.x, Missf.y, Missf.z);
Vec3d Miss = Vec3d(Missf.x, Missf.y, Missf.z);
double sinAngle2 = sqrt(Miss * Miss)/2.0;
if (sinAngle2 <= ANGULAR_RES)
@ -909,7 +909,7 @@ Selection Universe::pick(const UniversalCoord& origin,
break;
}
}
#if 0
SolarSystem* closestSolarSystem = getNearestSolarSystem(origin);
if (closestSolarSystem != NULL)
@ -1080,7 +1080,7 @@ Selection Universe::findPath(const string& s,
Selection contexts[],
int nContexts,
bool i18n)
{
{
string::size_type pos = s.find('/', 0);
// No delimiter found--just do a normal find.

View File

@ -58,8 +58,8 @@ VirtualTexture::VirtualTexture(const string& _tilePath,
const string& _tileType) :
Texture(_tileSize << (_baseSplit + 1), _tileSize << _baseSplit),
tilePath(_tilePath),
baseSplit(_baseSplit),
tilePrefix(_tilePrefix),
baseSplit(_baseSplit),
tileSize(_tileSize),
ticks(0),
nResolutionLevels(0)
@ -85,8 +85,8 @@ const TextureTile VirtualTexture::getTile(int lod, int u, int v)
#endif
lod += baseSplit;
if (lod < 0 || (uint) lod >= nResolutionLevels ||
if (lod < 0 || (uint) lod >= nResolutionLevels ||
u < 0 || u >= (2 << lod) ||
v < 0 || v >= (1 << lod))
{
@ -215,10 +215,10 @@ ImageTexture* VirtualTexture::loadTileTexture(uint lod, uint u, uint v)
lod >>= baseSplit;
assert(lod < (unsigned)MaxResolutionLevels);
char filename[64];
sprintf(filename, "level%d/%s%d_%d", lod, tilePrefix.c_str(), u, v);
string pathname = tilePath + filename + tileExt;
Image* img = LoadImageFromFile(pathname);
if (img == NULL)
@ -281,7 +281,7 @@ void VirtualTexture::populateTileTree()
maxLevel = i + baseSplit;
int uLimit = 2 << maxLevel;
int vLimit = 1 << maxLevel;
string filename;
while (dir->nextFile(filename))
{
@ -395,7 +395,7 @@ static VirtualTexture* LoadVirtualTexture(istream& in, const string& path)
}
Hash* texParams = texParamsValue->getHash();
return CreateVirtualTexture(texParams, path);
}