Fixes #389 Moved the graphics code for skidmarks, car rear, front and brake lights, back fire and smoke textures to load the PNG textures, and removed the now useless RGB ones

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@3575 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 084e635ef67f6aac6e49e458d0031676528104bd
Former-commit-id: 038960095404d5c72325cb9a986b4271ee004326
This commit is contained in:
pouillot 2011-05-15 17:08:26 +00:00
parent 1e9d30111a
commit b8b3d8e53c
4 changed files with 21 additions and 26 deletions

View file

@ -225,10 +225,11 @@ void grInitCarlight(int index)
theCarslight[i].lightAnchor= new ssgBranch();
}
sprintf(buf, "data/textures;data/img;.");
if (!frontlight1) {
sprintf(buf, "data/textures;data/img;.");
frontlight1 = (ssgSimpleState*)grSsgLoadTexStateEx("frontlight1.rgb", buf, FALSE, FALSE);
if (frontlight1 != NULL) {
frontlight1 = (ssgSimpleState*)grSsgLoadTexStateEx("frontlight1.png", buf, FALSE, FALSE);
if (frontlight1) {
frontlight1->disable(GL_LIGHTING);
frontlight1->enable(GL_BLEND);
frontlight1->disable(GL_CULL_FACE);
@ -238,9 +239,8 @@ void grInitCarlight(int index)
}
if (!frontlight2) {
sprintf(buf, "data/textures;data/img;.");
frontlight2 = (ssgSimpleState*)grSsgLoadTexStateEx("frontlight2.rgb", buf, FALSE, FALSE);
if (frontlight2 != NULL) {
frontlight2 = (ssgSimpleState*)grSsgLoadTexStateEx("frontlight2.png", buf, FALSE, FALSE);
if (frontlight2) {
frontlight2->disable(GL_LIGHTING);
frontlight2->enable(GL_BLEND);
frontlight2->disable(GL_CULL_FACE);
@ -250,9 +250,8 @@ void grInitCarlight(int index)
}
if (!rearlight1) {
sprintf(buf, "data/textures;data/img;.");
rearlight1 = (ssgSimpleState*)grSsgLoadTexStateEx("rearlight1.rgb", buf, FALSE, FALSE);
if (rearlight1 != NULL) {
rearlight1 = (ssgSimpleState*)grSsgLoadTexStateEx("rearlight1.png", buf, FALSE, FALSE);
if (rearlight1) {
rearlight1->disable(GL_LIGHTING);
rearlight1->enable(GL_BLEND);
rearlight1->disable(GL_CULL_FACE);
@ -262,9 +261,8 @@ void grInitCarlight(int index)
}
if (!rearlight2) {
sprintf(buf, "data/textures;data/img;.");
rearlight2 = (ssgSimpleState*)grSsgLoadTexStateEx("rearlight2.rgb", buf, FALSE, FALSE);
if (rearlight2 != NULL) {
rearlight2 = (ssgSimpleState*)grSsgLoadTexStateEx("rearlight2.png", buf, FALSE, FALSE);
if (rearlight2) {
rearlight2->disable(GL_LIGHTING);
rearlight2->enable(GL_BLEND);
rearlight2->disable(GL_CULL_FACE);
@ -274,9 +272,8 @@ void grInitCarlight(int index)
}
if (!breaklight1) {
sprintf(buf, "data/textures;data/img;.");
breaklight1 = (ssgSimpleState*)grSsgLoadTexStateEx("breaklight1.rgb", buf, FALSE, FALSE);
if (breaklight1 != NULL) {
breaklight1 = (ssgSimpleState*)grSsgLoadTexStateEx("breaklight1.png", buf, FALSE, FALSE);
if (breaklight1) {
breaklight1->disable(GL_LIGHTING);
breaklight1->enable(GL_BLEND);
breaklight1->disable(GL_CULL_FACE);
@ -286,9 +283,8 @@ void grInitCarlight(int index)
}
if (!breaklight2) {
sprintf(buf, "data/textures;data/img;.");
breaklight2 = (ssgSimpleState*)grSsgLoadTexStateEx("breaklight2.rgb", buf, FALSE, FALSE);
if (breaklight2 != NULL) {
breaklight2 = (ssgSimpleState*)grSsgLoadTexStateEx("breaklight2.png", buf, FALSE, FALSE);
if (breaklight2) {
breaklight2->disable(GL_LIGHTING);
breaklight2->enable(GL_BLEND);
breaklight2->disable(GL_CULL_FACE);

View file

@ -478,13 +478,12 @@ void grCustomizePits(void) {
ThePits->addKid(pit);
// Let's draw the logo
// Load logo texture (.rgb first, for backwards compatibility,
// then .png)
const std::string strRGBLogoFileName = strLogoFileName + ".rgb";
// Load logo texture (.png first, then .rgb for backwards compatibility)
const std::string strRGBLogoFileName = strLogoFileName + ".png";
ssgState *stLogo = grSsgLoadTexStateEx(strRGBLogoFileName.c_str(),
buf, FALSE, FALSE, FALSE);
if (!stLogo) {
const std::string strPNGLogoFileName = strLogoFileName + ".png";
const std::string strPNGLogoFileName = strLogoFileName + ".rgb";
stLogo = grSsgLoadTexStateEx(strPNGLogoFileName.c_str(), buf,
FALSE, FALSE);
}

View file

@ -70,7 +70,7 @@ grInitSkidmarks(const tCarElt *car)
// add texture
skidState->enable(GL_TEXTURE_2D);
skidState->setColourMaterial(GL_AMBIENT_AND_DIFFUSE);
skidState->setTexture ("data/textures/grey-tracks.rgb", TRUE, TRUE, TRUE);
skidState->setTexture ("data/textures/grey-tracks.png", TRUE, TRUE, TRUE);
}//if skidState
}//if skidState NULL

View file

@ -116,7 +116,7 @@ grInitSmoke(const int index)
// add temp object to get a reference on the states
if (!mst) {
sprintf(buf, "data/textures;data/img;.");
mst = (ssgSimpleState*)grSsgLoadTexStateEx("smoke.rgb", buf, FALSE, FALSE);
mst = (ssgSimpleState*)grSsgLoadTexStateEx("smoke.png", buf, FALSE, FALSE);
if (mst) {
mst->disable(GL_LIGHTING);
mst->enable(GL_BLEND);
@ -128,7 +128,7 @@ grInitSmoke(const int index)
if (!mstf0) {
sprintf(buf, "data/textures;data/img;.");
mstf0 = (ssgSimpleState*)grSsgLoadTexStateEx("fire0.rgb", buf, FALSE, FALSE);
mstf0 = (ssgSimpleState*)grSsgLoadTexStateEx("fire0.png", buf, FALSE, FALSE);
if (mstf0) {
mstf0->disable(GL_LIGHTING);
mstf0->enable(GL_BLEND);
@ -140,7 +140,7 @@ grInitSmoke(const int index)
if (!mstf1) {
sprintf(buf, "data/textures;data/img;.");
mstf1 = (ssgSimpleState*)grSsgLoadTexStateEx("fire1.rgb", buf, FALSE, FALSE);
mstf1 = (ssgSimpleState*)grSsgLoadTexStateEx("fire1.png", buf, FALSE, FALSE);
if (mstf1) {
mstf1->disable(GL_LIGHTING);
mstf1->enable(GL_BLEND);