Don't know if it's a bug or a dev choice , but i noticed that the com display transparency
is not working ( we have a black background instead of the background ) .
Check the tutorial mission ( in Atlantis ) to verify that point .
I want to make cockpits parts , with 3d screen instead of nothing ( example llama cockpit ).
But the free space around the 3dscreen picture drawn in the texture will appear Black ,
instead of transparent .
My 3dscreen is :
Can you fix that ?
I made a search in the source code , and found that in vdu.cpp :
The problem may be in the DrawAsVSSprite() , i don't know enough gl stuff to identifyvoid VDU::DrawComm()
{
if (comm_ani != NULL) {
GFXDisable( TEXTURE1 ); // ??
GFXEnable( TEXTURE0 );
GFXDisable( LIGHTING ); // i understand why
...
...
comm_ani->DrawAsVSSprite( this ); // problem is here ?
...
the cause , but you certainly will :
in animation.cpp
Code: Select all
void Animation::DrawAsVSSprite( VSSprite *spr )
{
if (!spr)
return;
if (g_game.use_animations != 0 || g_game.use_textures != 0) {
//unsigned char alphamaps=ani_alpha;
GFXPushBlendMode();
if (options&ani_alpha)
GFXBlendMode( SRCALPHA, INVSRCALPHA );
else
GFXBlendMode( ONE, ZERO );
size_t lyr;
size_t numlayers = numLayers();
bool multitex = (numlayers > 1);
size_t numpasses = numPasses();
float ms = mintcoord.i, Ms = maxtcoord.i;
float mt = mintcoord.j, Mt = maxtcoord.j;
GFXDisable( CULLFACE );
Vector ll, lr, ur, ul;
spr->DrawHere( ll, lr, ur, ul );
BLENDFUNC src, dst;
GFXGetBlendMode( src, dst );
for (lyr = 0; (lyr < gl_options.Multitexture) || (lyr < numlayers); lyr++) {
GFXToggleTexture( (lyr < numlayers), lyr );
if (lyr < numlayers) GFXTextureCoordGenMode( lyr, NO_GEN, NULL, NULL );
}
for (size_t pass = 0; pass < numpasses; pass++)
if ( SetupPass( pass, 0, src, dst ) ) {
MakeActive( 0, pass );
GFXTextureEnv( 0, GFXMODULATETEXTURE );
GFXBegin( GFXQUAD );
if (!multitex) GFXTexCoord2f( ms, Mt );
else GFXTexCoord4f( ms, Mt, ms, Mt );
GFXVertexf( ll );
if (!multitex) GFXTexCoord2f( Ms, Mt );
else GFXTexCoord4f( Ms, Mt, Ms, Mt );
GFXVertexf( lr );
if (!multitex) GFXTexCoord2f( Ms, mt );
else GFXTexCoord4f( Ms, mt, Ms, mt );
GFXVertexf( ur );
if (!multitex) GFXTexCoord2f( ms, mt );
else GFXTexCoord4f( ms, mt, ms, mt );
GFXVertexf( ul );
GFXEnd();
}
SetupPass( -1, 0, src, dst );
for (lyr = 0; lyr < numlayers; lyr++)
GFXToggleTexture( false, lyr );
GFXEnable( CULLFACE );
GFXPopBlendMode();
}
}