it turns out it's trivial to implement double sided-ness on a per texture. basically i just extended the blend flag to mean one for transparent blended texture and 2 for double sided texture.
Code:
Index: include/objects.h
===================================================================
--- include/objects.h (revision 1989)
+++ include/objects.h (working copy)
@@ -72,7 +72,7 @@
list <OBJECTNODE> object_list;
- OBJECTMODEL * AddModel(string modelname, string texname, bool mip, bool fullbright, bool skybox, bool blend, JOEPACK * pack);
+ OBJECTMODEL * AddModel(string modelname, string texname, bool mip, bool fullbright, bool skybox, int tex, JOEPACK * pack);
string path;
@@ -86,7 +86,7 @@
OBJECTS();
~OBJECTS();
void UpdateSettings();
- OBJECTNODE * Add(VERTEX pos, float rotation, string modelname, string texname, bool mip, bool fullbright, bool skybox, bool drv, bool col, bool blend, JOEPACK * pack, float f1, float f2, float bl, float bm, float rr, float rd, SCENENODE * parent);
+ OBJECTNODE * Add(VERTEX pos, float rotation, string modelname, string texname, bool mip, bool fullbright, bool skybox, bool drv, bool col, int tex, JOEPACK * pack, float f1, float f2, float bl, float bm, float rr, float rd, SCENENODE * parent);
void DeleteAll();
void LoadObjectsFromFolder(string objectpath);
void SetVerticalSkyboxTracking(bool vtsky) {verticaltrackingskyboxes = vtsky;}
Index: src/objects.cpp
===================================================================
--- src/objects.cpp (revision 1989)
+++ src/objects.cpp (working copy)
@@ -58,7 +58,7 @@
game.settings.Get( "display.FOV", field_of_view );
}
-OBJECTNODE * OBJECTS::Add(VERTEX pos, float rotation, string modelname, string texname, bool mip, bool fullbright, bool skybox, bool drv, bool col, bool blend, JOEPACK * pack, float f1, float f2, float bl, float bm, float rr, float rd, SCENENODE * parent)
+OBJECTNODE * OBJECTS::Add(VERTEX pos, float rotation, string modelname, string texname, bool mip, bool fullbright, bool skybox, bool drv, bool col, int tex, JOEPACK * pack, float f1, float f2, float bl, float bm, float rr, float rd, SCENENODE * parent)
{
{
OBJECTNODE newnode;
@@ -107,7 +107,7 @@
if (!found)
{
- object_list.back().model = AddModel(modelname, texname, mip, fullbright, skybox, blend, pack);
+ object_list.back().model = AddModel(modelname, texname, mip, fullbright, skybox, tex, pack);
object_list.back().texture = texname;
}
@@ -118,7 +118,7 @@
d.SetToList(object_list.back().model->jmodel.GetDrawList());
d.SetLit(!fullbright);
- d.SetPartialTransparency(blend);
+ d.SetPartialTransparency((tex==1)?true:false);
//d.SetDiffuseMap(object_list.back().model->jmodel.GetTextureHandle(0).GetTexture().GetTextureInfo());
TEXTUREINFO texinfo;
texinfo.SetName(path + "/" + texname);
@@ -139,7 +139,7 @@
d.SetMiscMap1(texinfo);
}
//d.SetCull(game.track.GetCullFaces(), true);
- d.SetCull(game.track.GetCullFaces(), false);
+ d.SetCull((tex==2)?false:true, false);
//cout << "**************" << game.track.GetCullFaces() <<endl>jmodel.GetRadius());
VERTEX objcenter = object_list.back().model->jmodel.GetBBOX().GetCenter();
@@ -161,7 +161,7 @@
dir.LoadMultIdent();
}
-OBJECTMODEL * OBJECTS::AddModel(string modelname, string texname, bool mip, bool fullbright, bool skybox, bool blend, JOEPACK * pack)
+OBJECTMODEL * OBJECTS::AddModel(string modelname, string texname, bool mip, bool fullbright, bool skybox, int tex, JOEPACK * pack)
{
OBJECTMODEL * oldfirst = model_list;
model_list = new OBJECTMODEL;
@@ -171,7 +171,7 @@
model_list->jmodel.Load(path + "/" + modelname, pack, true);
model_list->fullbright = fullbright;
- model_list->blend = blend;
+ model_list->blend = (tex==1)?true:false;
model_list->skybox = skybox;
//search for the texture in our texture db
@@ -239,7 +239,7 @@
string extra;
bool mip;
bool fb, sb;
- bool blend;
+ int tex;
VERTEX p;
float r;
bool c, d;
@@ -282,7 +282,7 @@
fb = game.utility.bGetParam(o);
sb = game.utility.bGetParam(o);
//p.x = game.utility.fGetParam(o);
- blend = game.utility.bGetParam(o);
+ tex = game.utility.iGetParam(o);
//p.y = game.utility.fGetParam(o);
//p.z = game.utility.fGetParam(o);
bl = game.utility.fGetParam(o);
@@ -307,7 +307,7 @@
if (m != "" && m != game.utility.GetEOFString())
{
- added = Add(p, r, m, t, mip, fb, sb, d, c, blend, packptr, f1, f2, bl, bm, rr, rd, parentnode.GetPtr());
+ added = Add(p, r, m, t, mip, fb, sb, d, c, tex, packptr, f1, f2, bl, bm, rr, rd, parentnode.GetPtr());
//collision.AddCollision(added);
count++;
}
if there are no objections i can commit it to svn and start updating the tracks to take advantage of this feature.