I have the below code in HUD_DrawTransparentTriangles() in tri.cpp, but
whenever certain temp entities like breakable gibs, or serverside sprites
appear on the screen the code has no effect (I.e the sprite disappears). I
know the code is still being executed but I just see no sprite while one or
more of these thigns are present. Is this a known issue in tri API?
CODE:
cl_entity_t *player;
player = gEngfuncs.GetLocalPlayer();
if (player->player && !player->curstate.spectator &&
player->curstate.solid)
{
vec3_t origin = player->origin;
vec3_t camForward, camRight, camUp;
pmtrace_t tr;
AngleVectors(player->angles, camForward, camRight, camUp );
gEngfuncs.pEventAPI->EV_PlayerTrace( origin, origin + (camUp * - 500),
PM_NORMAL, -1, &tr );
if (tr.fraction < 1.0)
{
HSPRITE hsprTexture;
const model_s *pTexture;
hsprTexture = LoadSprite( "sprites/playershadow.spr" );
pTexture = gEngfuncs.GetSpritePointer( hsprTexture );
gEngfuncs.pTriAPI->SpriteTexture( (struct model_s *)pTexture, 0 );
gEngfuncs.pTriAPI->Color4f( 1.0, 1.0, 1.0, 1.0 );
gEngfuncs.pTriAPI->RenderMode( kRenderTransAlpha );
gEngfuncs.pTriAPI->CullFace( TRI_NONE );
gEngfuncs.pTriAPI->Begin( TRI_QUADS );
vec3_t org;
VectorCopy(tr.endpos,org);
org.z -= 35;
gEngfuncs.pTriAPI->Brightness( 1 );
gEngfuncs.pTriAPI->TexCoord2f( 0, 0 );
gEngfuncs.pTriAPI->Vertex3f( org.x - 25, org.y + 25, org.z );
gEngfuncs.pTriAPI->Brightness( 1 );
gEngfuncs.pTriAPI->TexCoord2f( 0, 1 );
gEngfuncs.pTriAPI->Vertex3f( org.x - 25, org.y - 25, org.z );
gEngfuncs.pTriAPI->Brightness( 1 );
gEngfuncs.pTriAPI->TexCoord2f( 1, 1 );
gEngfuncs.pTriAPI->Vertex3f( org.x + 25, org.y - 25, org.z );
gEngfuncs.pTriAPI->Brightness( 1 );
gEngfuncs.pTriAPI->TexCoord2f( 1, 0 );
gEngfuncs.pTriAPI->Vertex3f( org.x + 25, org.y + 25, org.z );
gEngfuncs.pTriAPI->End();
}
}
thanks,
Rob.
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders