2024-04-23 13:50 CEST

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0000640Spring engineGeneralpublic2007-09-21 14:25
ReporterKDR_11k 
Assigned ToKloot 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0000640: [patch]Make ALPHA_THRESHOLD apply to exploded pieces
DescriptionCurrently a unit with a set ALPHA_THRESHOLD will still have pieces that are thrown with explode use the default threshold, this patch makes them inherit the unit's threshold.
Additional InformationI really should have thought of this earlier...
TagsNo tags attached.
Checked infolog.txt for Errors
Attached Files
  • patch file icon 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;
    
    patch file icon alphaThresholdExplode.patch (1,617 bytes) 2007-09-21 10:30 +
  • patch file icon 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;
    
    patch file icon alphaThresholdExplode1.patch (1,461 bytes) 2007-09-21 10:49 +

-Relationships
+Relationships

-Notes

~0001283

KDR_11k (reporter)

Ooops, noticed I left a commented out line of code in there.

~0001284

Kloot (developer)

thank you, fixed in r4414
+Notes

-Issue History
Date Modified Username Field Change
2007-09-21 10:30 KDR_11k New Issue
2007-09-21 10:30 KDR_11k File Added: alphaThresholdExplode.patch
2007-09-21 10:49 KDR_11k File Added: alphaThresholdExplode1.patch
2007-09-21 10:50 KDR_11k Note Added: 0001283
2007-09-21 14:25 Kloot Note Added: 0001284
2007-09-21 14:25 Kloot Status new => resolved
2007-09-21 14:25 Kloot Resolution open => fixed
2007-09-21 14:25 Kloot Assigned To => Kloot
+Issue History