forked from speed-dreams/speed-dreams-code
- added pit panel in Mile Speedway
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@6121 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 780860603ec76561b357d0fc3ee205f41fa02e68 Former-commit-id: 54253d3e6f640d24336e11995feb4da6fffea960
This commit is contained in:
parent
2dbe8f8d9c
commit
d1a3be0d50
2 changed files with 851 additions and 823 deletions
File diff suppressed because it is too large
Load diff
|
@ -279,10 +279,12 @@ void grCustomizePits(void)
|
||||||
|
|
||||||
|
|
||||||
// Draw the pit identification on the wall if any.
|
// Draw the pit identification on the wall if any.
|
||||||
switch (pits->type) {
|
switch (pits->type)
|
||||||
|
{
|
||||||
case TR_PIT_ON_TRACK_SIDE:
|
case TR_PIT_ON_TRACK_SIDE:
|
||||||
GfLogTrace("Creating track side pit buildings (%d slots) ...\n", pits->nMaxPits);
|
GfLogTrace("Creating track side pit buildings (%d slots) ...\n", pits->nMaxPits);
|
||||||
for (int i = 0; i < pits->nMaxPits; i++) {
|
for (int i = 0; i < pits->nMaxPits; i++)
|
||||||
|
{
|
||||||
//GfLogDebug("Pit Nbr: %d\n", i);
|
//GfLogDebug("Pit Nbr: %d\n", i);
|
||||||
ssgVertexArray *pit_vtx = new ssgVertexArray(4);
|
ssgVertexArray *pit_vtx = new ssgVertexArray(4);
|
||||||
ssgTexCoordArray *pit_tex = new ssgTexCoordArray(4);
|
ssgTexCoordArray *pit_tex = new ssgTexCoordArray(4);
|
||||||
|
@ -297,7 +299,8 @@ void grCustomizePits(void)
|
||||||
|
|
||||||
// If we have at least one car in the pit, use the team pit logo of driver 0.
|
// If we have at least one car in the pit, use the team pit logo of driver 0.
|
||||||
ssgState *st = 0;
|
ssgState *st = 0;
|
||||||
if (pits->driversPits[i].car[0]) {
|
if (pits->driversPits[i].car[0])
|
||||||
|
{
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"%sdrivers/%s/%d;%sdrivers/%s;drivers/%s/%d;drivers/%s",
|
"%sdrivers/%s/%d;%sdrivers/%s;drivers/%s/%d;drivers/%s",
|
||||||
GfLocalDir(),
|
GfLocalDir(),
|
||||||
|
@ -313,7 +316,8 @@ void grCustomizePits(void)
|
||||||
// update the logo file name accordingly.
|
// update the logo file name accordingly.
|
||||||
int skinnedLogo = FALSE;
|
int skinnedLogo = FALSE;
|
||||||
if (strlen(pits->driversPits[i].car[0]->_skinName) != 0
|
if (strlen(pits->driversPits[i].car[0]->_skinName) != 0
|
||||||
&& pits->driversPits[i].car[0]->_skinTargets & RM_CAR_SKIN_TARGET_PIT_DOOR) {
|
&& pits->driversPits[i].car[0]->_skinTargets & RM_CAR_SKIN_TARGET_PIT_DOOR)
|
||||||
|
{
|
||||||
skinnedLogo = TRUE;
|
skinnedLogo = TRUE;
|
||||||
strLogoFileName += '-';
|
strLogoFileName += '-';
|
||||||
strLogoFileName += pits->driversPits[i].car[0]->_skinName;
|
strLogoFileName += pits->driversPits[i].car[0]->_skinName;
|
||||||
|
@ -325,18 +329,21 @@ void grCustomizePits(void)
|
||||||
const std::string strPNGLogoFileName = strLogoFileName + ".png";
|
const std::string strPNGLogoFileName = strLogoFileName + ".png";
|
||||||
st = grSsgLoadTexStateEx(strPNGLogoFileName.c_str(), buf, FALSE, FALSE, FALSE);
|
st = grSsgLoadTexStateEx(strPNGLogoFileName.c_str(), buf, FALSE, FALSE, FALSE);
|
||||||
#endif
|
#endif
|
||||||
if (!st) {
|
if (!st)
|
||||||
|
{
|
||||||
const std::string strRGBLogoFileName = strLogoFileName + ".rgb";
|
const std::string strRGBLogoFileName = strLogoFileName + ".rgb";
|
||||||
st = grSsgLoadTexStateEx(strRGBLogoFileName.c_str(), buf, FALSE, FALSE, skinnedLogo);
|
st = grSsgLoadTexStateEx(strRGBLogoFileName.c_str(), buf, FALSE, FALSE, skinnedLogo);
|
||||||
}
|
}
|
||||||
} // if pits->driverPits[i].car[0]
|
} // if pits->driverPits[i].car[0]
|
||||||
|
|
||||||
// If no car in the pit, or logo file not found, hope for the .rgb in data/textures.
|
// If no car in the pit, or logo file not found, hope for the .rgb in data/textures.
|
||||||
if (!st) {
|
if (!st)
|
||||||
|
{
|
||||||
snprintf(buf, sizeof(buf), "data/textures");
|
snprintf(buf, sizeof(buf), "data/textures");
|
||||||
const std::string strRGBLogoFileName = strLogoFileName + ".rgb";
|
const std::string strRGBLogoFileName = strLogoFileName + ".rgb";
|
||||||
st = grSsgLoadTexStateEx(strRGBLogoFileName.c_str(), buf, FALSE, FALSE, TRUE);
|
st = grSsgLoadTexStateEx(strRGBLogoFileName.c_str(), buf, FALSE, FALSE, TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
st->setOpaque();
|
st->setOpaque();
|
||||||
reinterpret_cast<ssgSimpleState*>(st)->setShininess(50);
|
reinterpret_cast<ssgSimpleState*>(st)->setShininess(50);
|
||||||
reinterpret_cast<ssgSimpleState*>(st)->disable(GL_BLEND);
|
reinterpret_cast<ssgSimpleState*>(st)->disable(GL_BLEND);
|
||||||
|
@ -436,6 +443,14 @@ void grCustomizePits(void)
|
||||||
// Done.
|
// Done.
|
||||||
ThePits->addKid(pit);
|
ThePits->addKid(pit);
|
||||||
} // for i
|
} // for i
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
char buf3[256];
|
||||||
|
snprintf(buf3, sizeof(buf3), "%strack-pit.ac", GfLocalDir());
|
||||||
|
|
||||||
|
ssgSaveAC ( buf3, PitsAnchor );
|
||||||
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TR_PIT_NO_BUILDING:
|
case TR_PIT_NO_BUILDING:
|
||||||
|
@ -505,7 +520,8 @@ void grCustomizePits(void)
|
||||||
else
|
else
|
||||||
bHasPitIndicator = false;
|
bHasPitIndicator = false;
|
||||||
|
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
snprintf(buf, sizeof(buf), "data/textures");
|
snprintf(buf, sizeof(buf), "data/textures");
|
||||||
strLogoFileName = "tr-wall-gr";
|
strLogoFileName = "tr-wall-gr";
|
||||||
|
@ -703,24 +719,32 @@ void grCustomizePits(void)
|
||||||
pit3->setCullFace(0);
|
pit3->setCullFace(0);
|
||||||
ThePits->addKid(pit3);
|
ThePits->addKid(pit3);
|
||||||
|
|
||||||
if (bHasPitIndicator)
|
if (bHasPitIndicator)
|
||||||
{
|
{
|
||||||
int PitInt = pits->pitindicator;
|
int PitInt = pits->pitindicator;
|
||||||
snprintf(buf, sizeof(buf), "%sdrivers/%s/%d;%sdrivers/%s;drivers/%s/%d;drivers/%s;tracks/%s/%s;data/textures;data/img",
|
snprintf(buf, sizeof(buf), "%sdrivers/%s/%d;%sdrivers/%s;drivers/%s/%d;drivers/%s;tracks/%s/%s;data/textures;data/img",
|
||||||
GfLocalDir(),
|
GfLocalDir(),
|
||||||
act_pit->car[0]->_modName,
|
act_pit->car[0]->_modName,
|
||||||
act_pit->car[0]->_driverIndex,
|
act_pit->car[0]->_driverIndex,
|
||||||
GfLocalDir(),
|
GfLocalDir(),
|
||||||
act_pit->car[0]->_modName,
|
act_pit->car[0]->_modName,
|
||||||
act_pit->car[0]->_modName,
|
act_pit->car[0]->_modName,
|
||||||
act_pit->car[0]->_driverIndex,
|
act_pit->car[0]->_driverIndex,
|
||||||
act_pit->car[0]->_modName,
|
act_pit->car[0]->_modName,
|
||||||
grTrack->category, grTrack->internalname);
|
grTrack->category, grTrack->internalname);
|
||||||
|
|
||||||
grLoadPitsIndicator(x3, y3, z3, buf, PitInt);
|
grLoadPitsIndicator(x3, y3, z3, buf, PitInt);
|
||||||
}
|
}
|
||||||
} // for i
|
} // for i
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
|
char buf2[256];
|
||||||
|
snprintf(buf2, sizeof(buf2), "%strack-pit.ac", GfLocalDir());
|
||||||
|
|
||||||
|
ssgSaveAC ( buf2, PitsAnchor );
|
||||||
|
#endif
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TR_PIT_ON_SEPARATE_PATH:
|
case TR_PIT_ON_SEPARATE_PATH:
|
||||||
|
@ -739,23 +763,23 @@ void grCustomizePits(void)
|
||||||
// Load New Pit Indicator in Scene
|
// Load New Pit Indicator in Scene
|
||||||
void grLoadPitsIndicator(tdble x, tdble y, tdble z, char *buf, int Pitind)
|
void grLoadPitsIndicator(tdble x, tdble y, tdble z, char *buf, int Pitind)
|
||||||
{
|
{
|
||||||
char buf2[256];
|
char buf2[256];
|
||||||
ssgEntity *desc;
|
ssgEntity *desc;
|
||||||
sgCoord PitIndicatorPos;
|
sgCoord PitIndicatorPos;
|
||||||
ssgTransform *PitIndicatorLoc = new ssgTransform;
|
ssgTransform *PitIndicatorLoc = new ssgTransform;
|
||||||
|
|
||||||
ssgTexturePath(buf);
|
ssgTexturePath(buf);
|
||||||
snprintf(buf2, sizeof(buf2), "tracks/%s/%s;data/objects", grTrack->category, grTrack->internalname);
|
snprintf(buf2, sizeof(buf2), "tracks/%s/%s;data/objects", grTrack->category, grTrack->internalname);
|
||||||
ssgModelPath(buf2);
|
ssgModelPath(buf2);
|
||||||
|
|
||||||
sgSetCoord(&PitIndicatorPos, x, y, z, 0, 0, 0.0);
|
sgSetCoord(&PitIndicatorPos, x, y, z, 0, 0, 0.0);
|
||||||
PitIndicatorLoc->setTransform( &PitIndicatorPos);
|
PitIndicatorLoc->setTransform( &PitIndicatorPos);
|
||||||
|
|
||||||
if (Pitind == 1)
|
if (Pitind == 1)
|
||||||
desc = grssgLoadAC3D("pit_indicator.ac", NULL);
|
desc = grssgLoadAC3D("pit_indicator.ac", NULL);
|
||||||
else
|
else
|
||||||
desc = grssgLoadAC3D("normal_pit_indicator.ac", NULL);
|
desc = grssgLoadAC3D("normal_pit_indicator.ac", NULL);
|
||||||
|
|
||||||
PitIndicatorLoc->addKid(desc);
|
PitIndicatorLoc->addKid(desc);
|
||||||
PitsAnchor->addKid(PitIndicatorLoc);
|
ThePits->addKid(PitIndicatorLoc);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue