Attached Files |
-
alphaThresholdExplode.patch (1,617 bytes) 2007-09-21 10:30
Index: Sim/Projectiles/PieceProjectile.cpp
===================================================================
--- Sim/Projectiles/PieceProjectile.cpp (revision 4413)
+++ Sim/Projectiles/PieceProjectile.cpp (working copy)
@@ -37,6 +37,7 @@
CR_MEMBER(spinPos),
CR_MEMBER(oldSmoke),
CR_MEMBER(oldSmokeDir),
+ CR_MEMBER(alphaThreshold),
// CR_MEMBER(target),
CR_MEMBER(drawTrail),
CR_MEMBER(curCallback),
@@ -61,7 +62,8 @@
oldSmoke(pos),
curCallback(0),
spinPos(0),
- age(0)
+ age(0),
+ alphaThreshold(0.1f)
{
checkCol=false;
if(owner){
@@ -71,6 +73,8 @@
/* If we're part of an S3O unit, save this so we can
draw with the right teamcolour. */
colorTeam=owner->team;
+ // copy the owner's alphaThreshold value
+ alphaThreshold = owner->alphaThreshold;
}
/* Don't store piece; owner may be a dying unit, so piece could be freed. */
@@ -347,6 +351,7 @@
void CPieceProjectile::DrawUnitPart(void)
{
+ glAlphaFunc(GL_GEQUAL, alphaThreshold);
glPushMatrix();
glTranslatef(pos.x,pos.y,pos.z);
glRotatef(spinPos,spinVec.x,spinVec.y,spinVec.z);
@@ -354,6 +359,7 @@
glCallList(dispList);
glPopMatrix();
*numCallback=0;
+// glAlphaFunc(GL_GEQUAL, 0.1);
}
void CPieceProjectile::DrawS3O(void)
Index: Sim/Projectiles/PieceProjectile.h
===================================================================
--- Sim/Projectiles/PieceProjectile.h (revision 4413)
+++ Sim/Projectiles/PieceProjectile.h (working copy)
@@ -26,6 +26,7 @@
float3 spinVec;
float spinSpeed;
float spinPos;
+ float alphaThreshold;
float3 oldSmoke,oldSmokeDir;
// CUnit* target;
-
alphaThresholdExplode1.patch (1,461 bytes) 2007-09-21 10:49
Index: Sim/Projectiles/PieceProjectile.cpp
===================================================================
--- Sim/Projectiles/PieceProjectile.cpp (revision 4413)
+++ Sim/Projectiles/PieceProjectile.cpp (working copy)
@@ -37,6 +37,7 @@
CR_MEMBER(spinPos),
CR_MEMBER(oldSmoke),
CR_MEMBER(oldSmokeDir),
+ CR_MEMBER(alphaThreshold),
// CR_MEMBER(target),
CR_MEMBER(drawTrail),
CR_MEMBER(curCallback),
@@ -61,7 +62,8 @@
oldSmoke(pos),
curCallback(0),
spinPos(0),
- age(0)
+ age(0),
+ alphaThreshold(0.1f)
{
checkCol=false;
if(owner){
@@ -71,6 +73,8 @@
/* If we're part of an S3O unit, save this so we can
draw with the right teamcolour. */
colorTeam=owner->team;
+ // copy the owner's alphaThreshold value
+ alphaThreshold = owner->alphaThreshold;
}
/* Don't store piece; owner may be a dying unit, so piece could be freed. */
@@ -347,6 +351,7 @@
void CPieceProjectile::DrawUnitPart(void)
{
+ glAlphaFunc(GL_GEQUAL, alphaThreshold);
glPushMatrix();
glTranslatef(pos.x,pos.y,pos.z);
glRotatef(spinPos,spinVec.x,spinVec.y,spinVec.z);
Index: Sim/Projectiles/PieceProjectile.h
===================================================================
--- Sim/Projectiles/PieceProjectile.h (revision 4413)
+++ Sim/Projectiles/PieceProjectile.h (working copy)
@@ -26,6 +26,7 @@
float3 spinVec;
float spinSpeed;
float spinPos;
+ float alphaThreshold;
float3 oldSmoke,oldSmokeDir;
// CUnit* target;
|
---|