|
|
@ -433,6 +433,8 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height ) |
|
|
|
skin.palette = (byte *)&clgame.palette; |
|
|
|
skin.palette = (byte *)&clgame.palette; |
|
|
|
skin.size = width * height; |
|
|
|
skin.size = width * height; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( !Image_CustomPalette() ) |
|
|
|
|
|
|
|
{ |
|
|
|
for( i = 0; i < skin.width * skin.height; i++ ) |
|
|
|
for( i = 0; i < skin.width * skin.height; i++ ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if( data[i] > 224 && data[i] != 255 ) |
|
|
|
if( data[i] > 224 && data[i] != 255 ) |
|
|
@ -441,6 +443,7 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height ) |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
COM_FileBase( loadmodel->name, name ); |
|
|
|
COM_FileBase( loadmodel->name, name ); |
|
|
|
|
|
|
|
|
|
|
@ -478,10 +481,13 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height ) |
|
|
|
void *Mod_LoadSingleSkin( daliasskintype_t *pskintype, int skinnum, int size ) |
|
|
|
void *Mod_LoadSingleSkin( daliasskintype_t *pskintype, int skinnum, int size ) |
|
|
|
{ |
|
|
|
{ |
|
|
|
string name, lumaname; |
|
|
|
string name, lumaname; |
|
|
|
|
|
|
|
string checkname; |
|
|
|
rgbdata_t *pic; |
|
|
|
rgbdata_t *pic; |
|
|
|
|
|
|
|
|
|
|
|
Q_snprintf( name, sizeof( name ), "%s:frame%i", loadmodel->name, skinnum ); |
|
|
|
Q_snprintf( name, sizeof( name ), "%s:frame%i", loadmodel->name, skinnum ); |
|
|
|
Q_snprintf( lumaname, sizeof( lumaname ), "%s:luma%i", loadmodel->name, skinnum ); |
|
|
|
Q_snprintf( lumaname, sizeof( lumaname ), "%s:luma%i", loadmodel->name, skinnum ); |
|
|
|
|
|
|
|
Q_snprintf( checkname, sizeof( checkname ), "%s_%i.tga", loadmodel->name, skinnum ); |
|
|
|
|
|
|
|
if( !FS_FileExists( checkname, false ) || ( pic = FS_LoadImage( checkname, NULL, 0 )) == NULL ) |
|
|
|
pic = Mod_CreateSkinData( loadmodel, (byte *)(pskintype + 1), m_pAliasHeader->skinwidth, m_pAliasHeader->skinheight ); |
|
|
|
pic = Mod_CreateSkinData( loadmodel, (byte *)(pskintype + 1), m_pAliasHeader->skinwidth, m_pAliasHeader->skinheight ); |
|
|
|
|
|
|
|
|
|
|
|
m_pAliasHeader->gl_texturenum[skinnum][0] = |
|
|
|
m_pAliasHeader->gl_texturenum[skinnum][0] = |
|
|
@ -1445,7 +1451,17 @@ void R_DrawAliasModel( cl_entity_t *e ) |
|
|
|
GL_Bind( GL_TEXTURE0, tr.whiteTexture ); |
|
|
|
GL_Bind( GL_TEXTURE0, tr.whiteTexture ); |
|
|
|
else if( pinfo != NULL && pinfo->textures[skin] != 0 ) |
|
|
|
else if( pinfo != NULL && pinfo->textures[skin] != 0 ) |
|
|
|
GL_Bind( GL_TEXTURE0, pinfo->textures[skin] ); // FIXME: allow remapping for skingroups someday
|
|
|
|
GL_Bind( GL_TEXTURE0, pinfo->textures[skin] ); // FIXME: allow remapping for skingroups someday
|
|
|
|
else GL_Bind( GL_TEXTURE0, m_pAliasHeader->gl_texturenum[skin][anim] ); |
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
GL_Bind( GL_TEXTURE0, m_pAliasHeader->gl_texturenum[skin][anim] ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( FBitSet( R_GetTexture( m_pAliasHeader->gl_texturenum[skin][anim] )->flags, TF_HAS_ALPHA )) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
pglEnable( GL_ALPHA_TEST ); |
|
|
|
|
|
|
|
pglAlphaFunc( GL_GREATER, 0.0f ); |
|
|
|
|
|
|
|
tr.blend = 1.0f; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); |
|
|
|
pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); |
|
|
|
|
|
|
|
|
|
|
@ -1472,6 +1488,8 @@ void R_DrawAliasModel( cl_entity_t *e ) |
|
|
|
R_AliasDrawLightTrace( e ); |
|
|
|
R_AliasDrawLightTrace( e ); |
|
|
|
|
|
|
|
|
|
|
|
pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); |
|
|
|
pglTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE ); |
|
|
|
|
|
|
|
pglAlphaFunc( GL_GREATER, DEFAULT_ALPHATEST ); |
|
|
|
|
|
|
|
pglDisable( GL_ALPHA_TEST ); |
|
|
|
|
|
|
|
|
|
|
|
if( r_shadows.value ) |
|
|
|
if( r_shadows.value ) |
|
|
|
{ |
|
|
|
{ |
|
|
|