|
|
|
@ -25,7 +25,7 @@ GNU General Public License for more details.
@@ -25,7 +25,7 @@ GNU General Public License for more details.
|
|
|
|
|
#include "server.h" // LUMP_ error codes |
|
|
|
|
#include "ref_common.h" |
|
|
|
|
|
|
|
|
|
#define MIPTEX_CUSTOM_PALETTE_SIZE_BYTES 770 |
|
|
|
|
#define MIPTEX_CUSTOM_PALETTE_SIZE_BYTES ( sizeof( int16_t ) + 768 ) |
|
|
|
|
|
|
|
|
|
typedef struct wadlist_s |
|
|
|
|
{ |
|
|
|
@ -218,112 +218,95 @@ static mlumpinfo_t extlumps[EXTRA_LUMPS] =
@@ -218,112 +218,95 @@ static mlumpinfo_t extlumps[EXTRA_LUMPS] =
|
|
|
|
|
=============================================================================== |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
static mip_t* Mod_GetMipTexForTexture( dbspmodel_t* bmod, int textureIndex ) |
|
|
|
|
{ |
|
|
|
|
if( textureIndex < 0 || |
|
|
|
|
textureIndex >= bmod->textures->nummiptex || |
|
|
|
|
bmod->textures->dataofs[textureIndex] == -1 ) |
|
|
|
|
static mip_t *Mod_GetMipTexForTexture( dbspmodel_t *bmod, int i ) |
|
|
|
|
{ |
|
|
|
|
if( i < 0 || i >= bmod->textures->nummiptex ) |
|
|
|
|
return NULL; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return (mip_t*)((byte*)bmod->textures + bmod->textures->dataofs[textureIndex]); |
|
|
|
|
if( bmod->textures->dataofs[i] == -1 ) |
|
|
|
|
return NULL; |
|
|
|
|
|
|
|
|
|
return (mip_t *)((byte *)bmod->textures + bmod->textures->dataofs[i] ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Returns index of WAD that texture was found in, or -1 if not found.
|
|
|
|
|
static int Mod_FindTextureInWadList( |
|
|
|
|
wadlist_t* list, |
|
|
|
|
const char* textureName, |
|
|
|
|
char* foundPathBuffer, |
|
|
|
|
size_t foundPathBufferLength ) |
|
|
|
|
static int Mod_FindTextureInWadList( wadlist_t *list, const char *name, char *dst, size_t size ) |
|
|
|
|
{ |
|
|
|
|
char pathInWad[MAX_VA_STRING]; |
|
|
|
|
int wadIndex; |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
if( !list || !textureName || !(*textureName) ) |
|
|
|
|
{ |
|
|
|
|
if( !list || !COM_CheckString( name )) |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// check wads in reverse order
|
|
|
|
|
for( wadIndex = list->count - 1; wadIndex >= 0; --wadIndex ) |
|
|
|
|
for( i = list->count - 1; i >= 0; i-- ) |
|
|
|
|
{ |
|
|
|
|
Q_snprintf( pathInWad, sizeof(pathInWad), "%s.wad/%s.mip", list->wadnames[wadIndex], textureName ); |
|
|
|
|
char path[MAX_VA_STRING]; |
|
|
|
|
|
|
|
|
|
if( FS_FileExists( pathInWad, false ) ) |
|
|
|
|
{ |
|
|
|
|
if( foundPathBuffer && foundPathBufferLength > 0 ) |
|
|
|
|
Q_snprintf( path, sizeof( path ), "%s.wad/%s.mip", list->wadnames[i], name ); |
|
|
|
|
|
|
|
|
|
if( FS_FileExists( path, false )) |
|
|
|
|
{ |
|
|
|
|
Q_strncpy( foundPathBuffer, pathInWad, foundPathBufferLength ); |
|
|
|
|
} |
|
|
|
|
if( dst && size > 0 ) |
|
|
|
|
Q_strncpy( dst, path, size ); |
|
|
|
|
|
|
|
|
|
return wadIndex; |
|
|
|
|
return i; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static size_t Mod_CalculateMipTexSize( mip_t* mipTex, qboolean customPalette ) |
|
|
|
|
{ |
|
|
|
|
if( !mipTex ) |
|
|
|
|
static fs_offset_t Mod_CalculateMipTexSize( mip_t *mt, qboolean palette ) |
|
|
|
|
{ |
|
|
|
|
if( !mt ) |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return sizeof(*mipTex) + |
|
|
|
|
(( mipTex->width * mipTex->height * 85) >> 6) + |
|
|
|
|
(customPalette ? MIPTEX_CUSTOM_PALETTE_SIZE_BYTES : 0); |
|
|
|
|
return sizeof( *mt ) + (( mt->width * mt->height * 85 ) >> 6 ) + |
|
|
|
|
( palette ? MIPTEX_CUSTOM_PALETTE_SIZE_BYTES : 0 ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static qboolean Mod_CalcMipTexUsesCustomPalette( dbspmodel_t *bmod, int textureIndex ) |
|
|
|
|
{ |
|
|
|
|
int size = 0; |
|
|
|
|
int nextTextureIndex = 0; |
|
|
|
|
mip_t* mipTex = NULL; |
|
|
|
|
mip_t *mipTex; |
|
|
|
|
fs_offset_t size, remainingBytes; |
|
|
|
|
|
|
|
|
|
mipTex = Mod_GetMipTexForTexture( bmod, textureIndex ); |
|
|
|
|
|
|
|
|
|
if( !mipTex || mipTex->offsets[0] <= 0 ) |
|
|
|
|
{ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Calculate the size assuming we are not using a custom palette.
|
|
|
|
|
size = (int)Mod_CalculateMipTexSize( mipTex, false ); |
|
|
|
|
size = Mod_CalculateMipTexSize( mipTex, false ); |
|
|
|
|
|
|
|
|
|
// Compute next data offset to determine allocated miptex space
|
|
|
|
|
for( nextTextureIndex = textureIndex + 1; nextTextureIndex < loadmodel->numtextures; ++nextTextureIndex ) |
|
|
|
|
for( nextTextureIndex = textureIndex + 1; nextTextureIndex < loadmodel->numtextures; nextTextureIndex++ ) |
|
|
|
|
{ |
|
|
|
|
int nextOffset = bmod->textures->dataofs[nextTextureIndex]; |
|
|
|
|
|
|
|
|
|
if( nextOffset != -1 ) |
|
|
|
|
{ |
|
|
|
|
int remainingBytes = nextOffset - (bmod->textures->dataofs[textureIndex] + size); |
|
|
|
|
remainingBytes = nextOffset - ( bmod->textures->dataofs[textureIndex] + size ); |
|
|
|
|
return remainingBytes >= MIPTEX_CUSTOM_PALETTE_SIZE_BYTES; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// There was no other miptex after this one.
|
|
|
|
|
// See if there is enough space between the end and our offset.
|
|
|
|
|
return bmod->texdatasize - (bmod->textures->dataofs[textureIndex] + size) >= MIPTEX_CUSTOM_PALETTE_SIZE_BYTES; |
|
|
|
|
remainingBytes = bmod->texdatasize - ( bmod->textures->dataofs[textureIndex] + size ); |
|
|
|
|
return remainingBytes >= MIPTEX_CUSTOM_PALETTE_SIZE_BYTES; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static qboolean Mod_NameImpliesTextureIsAnimated( texture_t *tex ) |
|
|
|
|
{ |
|
|
|
|
if( !tex ) |
|
|
|
|
{ |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if( tex->name[0] != '-' && tex->name[0] != '+' ) |
|
|
|
|
{ |
|
|
|
|
// Not an animated texture name
|
|
|
|
|
if( tex->name[0] != '-' && tex->name[0] != '+' ) |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Name implies texture is animated - check second character is valid.
|
|
|
|
|
|
|
|
|
|
if( !( tex->name[1] >= '0' && tex->name[1] <= '9' ) && |
|
|
|
|
!( tex->name[1] >= 'a' && tex->name[1] <= 'j' )) |
|
|
|
|
{ |
|
|
|
@ -336,21 +319,21 @@ static qboolean Mod_NameImpliesTextureIsAnimated( texture_t* tex )
@@ -336,21 +319,21 @@ static qboolean Mod_NameImpliesTextureIsAnimated( texture_t* tex )
|
|
|
|
|
|
|
|
|
|
static void Mod_CreateDefaultTexture( texture_t **texture ) |
|
|
|
|
{ |
|
|
|
|
texture_t *tex; |
|
|
|
|
|
|
|
|
|
// Pointer must be valid, and value pointed to must be null.
|
|
|
|
|
if( !texture || *texture != NULL ) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
*texture = Mem_Calloc( loadmodel->mempool, sizeof(texture_t) ); |
|
|
|
|
Q_strncpy( (*texture)->name, REF_DEFAULT_TEXTURE, sizeof((*texture)->name) ); |
|
|
|
|
*texture = tex = Mem_Calloc( loadmodel->mempool, sizeof( *tex )); |
|
|
|
|
Q_strncpy( tex->name, REF_DEFAULT_TEXTURE, sizeof( tex->name )); |
|
|
|
|
|
|
|
|
|
#if !XASH_DEDICATED |
|
|
|
|
if( !Host_IsDedicated( )) |
|
|
|
|
{ |
|
|
|
|
(*texture)->gl_texturenum = R_GetBuiltinTexture( REF_DEFAULT_TEXTURE ); |
|
|
|
|
(*texture)->width = 16; |
|
|
|
|
(*texture)->height = 16; |
|
|
|
|
tex->gl_texturenum = R_GetBuiltinTexture( REF_DEFAULT_TEXTURE ); |
|
|
|
|
tex->width = 16; |
|
|
|
|
tex->height = 16; |
|
|
|
|
} |
|
|
|
|
#endif // XASH_DEDICATED
|
|
|
|
|
} |
|
|
|
@ -908,7 +891,7 @@ static void Mod_FindModelOrigin( const char *entities, const char *modelname, ve
@@ -908,7 +891,7 @@ static void Mod_FindModelOrigin( const char *entities, const char *modelname, ve
|
|
|
|
|
qboolean model_found; |
|
|
|
|
qboolean origin_found; |
|
|
|
|
|
|
|
|
|
if( !entities || !modelname || !*modelname ) |
|
|
|
|
if( !entities || !COM_CheckString( modelname )) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
if( !origin || !VectorIsNull( origin )) |
|
|
|
@ -2037,19 +2020,17 @@ static void Mod_LoadTextureData( dbspmodel_t* bmod, int textureIndex )
@@ -2037,19 +2020,17 @@ static void Mod_LoadTextureData( dbspmodel_t* bmod, int textureIndex )
|
|
|
|
|
qboolean usesCustomPalette = false; |
|
|
|
|
uint32_t txFlags = 0; |
|
|
|
|
|
|
|
|
|
if( Host_IsDedicated() ) |
|
|
|
|
{ |
|
|
|
|
// Don't load texture data on dedicated server, as there is no renderer.
|
|
|
|
|
// FIXME: for ENGINE_IMPROVED_LINETRACE we need to load textures on server too
|
|
|
|
|
// but there is no facility for this yet
|
|
|
|
|
if( Host_IsDedicated( )) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
texture = loadmodel->textures[textureIndex]; |
|
|
|
|
mipTex = Mod_GetMipTexForTexture( bmod, textureIndex ); |
|
|
|
|
|
|
|
|
|
if( FBitSet( host.features, ENGINE_IMPROVED_LINETRACE ) && mipTex->name[0] == '{' ) |
|
|
|
|
{ |
|
|
|
|
SetBits( txFlags, TF_KEEP_SOURCE ); // Paranoia2 texture alpha-tracing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
usesCustomPalette = Mod_CalcMipTexUsesCustomPalette( bmod, textureIndex ); |
|
|
|
|
|
|
|
|
@ -2059,9 +2040,7 @@ static void Mod_LoadTextureData( dbspmodel_t* bmod, int textureIndex )
@@ -2059,9 +2040,7 @@ static void Mod_LoadTextureData( dbspmodel_t* bmod, int textureIndex )
|
|
|
|
|
ref.dllFuncs.R_InitSkyClouds( mipTex, texture, usesCustomPalette ); // load quake sky
|
|
|
|
|
|
|
|
|
|
if( R_GetBuiltinTexture( REF_SOLIDSKY_TEXTURE ) && R_GetBuiltinTexture( REF_ALPHASKY_TEXTURE )) |
|
|
|
|
{ |
|
|
|
|
SetBits( world.flags, FWORLD_SKYSPHERE ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// No texture to load in this case, so just exit.
|
|
|
|
|
return; |
|
|
|
@ -2115,7 +2094,7 @@ static void Mod_LoadTextureData( dbspmodel_t* bmod, int textureIndex )
@@ -2115,7 +2094,7 @@ static void Mod_LoadTextureData( dbspmodel_t* bmod, int textureIndex )
|
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
char texpath[MAX_VA_STRING]; |
|
|
|
|
int wadIndex = -1; |
|
|
|
|
int wadIndex; |
|
|
|
|
fs_offset_t srcSize = 0; |
|
|
|
|
byte* src = NULL; |
|
|
|
|
|
|
|
|
@ -2135,23 +2114,19 @@ static void Mod_LoadTextureData( dbspmodel_t* bmod, int textureIndex )
@@ -2135,23 +2114,19 @@ static void Mod_LoadTextureData( dbspmodel_t* bmod, int textureIndex )
|
|
|
|
|
texture->fb_texturenum = ref.dllFuncs.GL_LoadTexture( texName, src, srcSize, TF_MAKELUMA ); |
|
|
|
|
|
|
|
|
|
if( src ) |
|
|
|
|
{ |
|
|
|
|
Mem_Free( src ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif // !XASH_DEDICATED
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void Mod_LoadTexture( dbspmodel_t *bmod, int textureIndex ) |
|
|
|
|
{ |
|
|
|
|
texture_t* texture = NULL; |
|
|
|
|
mip_t* mipTex = NULL; |
|
|
|
|
texture_t *texture; |
|
|
|
|
mip_t *mipTex; |
|
|
|
|
|
|
|
|
|
if( textureIndex < 0 || textureIndex >= loadmodel->numtextures ) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
mipTex = Mod_GetMipTexForTexture( bmod, textureIndex ); |
|
|
|
|
|
|
|
|
@ -2164,11 +2139,9 @@ static void Mod_LoadTexture( dbspmodel_t* bmod, int textureIndex )
@@ -2164,11 +2139,9 @@ static void Mod_LoadTexture( dbspmodel_t* bmod, int textureIndex )
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if( mipTex->name[0] == '\0' ) |
|
|
|
|
{ |
|
|
|
|
Q_snprintf( mipTex->name, sizeof( mipTex->name ), "miptex_%i", textureIndex ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
texture = (texture_t*)Mem_Calloc( loadmodel->mempool, sizeof(texture_t) ); |
|
|
|
|
texture = (texture_t *)Mem_Calloc( loadmodel->mempool, sizeof( *texture )); |
|
|
|
|
loadmodel->textures[textureIndex] = texture; |
|
|
|
|
|
|
|
|
|
// Ensure texture name is lowercase.
|
|
|
|
@ -2183,38 +2156,32 @@ static void Mod_LoadTexture( dbspmodel_t* bmod, int textureIndex )
@@ -2183,38 +2156,32 @@ static void Mod_LoadTexture( dbspmodel_t* bmod, int textureIndex )
|
|
|
|
|
|
|
|
|
|
static void Mod_LoadAllTextures( dbspmodel_t *bmod ) |
|
|
|
|
{ |
|
|
|
|
for( int index = 0; index < loadmodel->numtextures; ++index ) |
|
|
|
|
{ |
|
|
|
|
Mod_LoadTexture( bmod, index ); |
|
|
|
|
} |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
for( i = 0; i < loadmodel->numtextures; i++ ) |
|
|
|
|
Mod_LoadTexture( bmod, i ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void Mod_SequenceAnimatedTexture( int baseTextureIndex ) |
|
|
|
|
{ |
|
|
|
|
texture_t *anims[10]; |
|
|
|
|
texture_t *altanims[10]; |
|
|
|
|
texture_t* baseTexture = NULL; |
|
|
|
|
texture_t *baseTexture; |
|
|
|
|
int max = 0; |
|
|
|
|
int altmax = 0; |
|
|
|
|
int candidateIndex = 0; |
|
|
|
|
int candidateIndex; |
|
|
|
|
|
|
|
|
|
if( baseTextureIndex < 0 || baseTextureIndex >= loadmodel->numtextures ) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
baseTexture = loadmodel->textures[baseTextureIndex]; |
|
|
|
|
|
|
|
|
|
if( !Mod_NameImpliesTextureIsAnimated( baseTexture )) |
|
|
|
|
{ |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if( baseTexture->anim_next ) |
|
|
|
|
{ |
|
|
|
|
// Already sequenced
|
|
|
|
|
if( baseTexture->anim_next ) |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// find the number of frames in the animation
|
|
|
|
|
memset( anims, 0, sizeof( anims )); |
|
|
|
@ -2238,23 +2205,19 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
@@ -2238,23 +2205,19 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Now search the rest of the textures to find all other frames.
|
|
|
|
|
for( candidateIndex = baseTextureIndex + 1; candidateIndex < loadmodel->numtextures; ++candidateIndex ) |
|
|
|
|
for( candidateIndex = baseTextureIndex + 1; candidateIndex < loadmodel->numtextures; candidateIndex++ ) |
|
|
|
|
{ |
|
|
|
|
texture_t *altTexture = loadmodel->textures[candidateIndex]; |
|
|
|
|
|
|
|
|
|
if( !Mod_NameImpliesTextureIsAnimated( altTexture )) |
|
|
|
|
{ |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// This texture is animated, but is it part of the same group as
|
|
|
|
|
// the original texture we encountered? Check that the rest of
|
|
|
|
|
// the name matches the original (both will be valid for at least
|
|
|
|
|
// string index 2).
|
|
|
|
|
if( Q_strcmp( altTexture->name + 2, baseTexture->name + 2 ) != 0 ) |
|
|
|
|
{ |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if( altTexture->name[1] >= '0' && altTexture->name[1] <= '9' ) |
|
|
|
|
{ |
|
|
|
@ -2263,10 +2226,8 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
@@ -2263,10 +2226,8 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
|
|
|
|
|
anims[frameIndex] = altTexture; |
|
|
|
|
|
|
|
|
|
if( frameIndex >= max ) |
|
|
|
|
{ |
|
|
|
|
max = frameIndex + 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
// This texture is an alternate frame.
|
|
|
|
@ -2274,14 +2235,12 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
@@ -2274,14 +2235,12 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
|
|
|
|
|
altanims[frameIndex] = altTexture; |
|
|
|
|
|
|
|
|
|
if( frameIndex >= altmax ) |
|
|
|
|
{ |
|
|
|
|
altmax = frameIndex + 1; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Link all standard animated frames together.
|
|
|
|
|
for( candidateIndex = 0; candidateIndex < max; ++candidateIndex ) |
|
|
|
|
for( candidateIndex = 0; candidateIndex < max; candidateIndex++ ) |
|
|
|
|
{ |
|
|
|
|
texture_t *tex = anims[candidateIndex]; |
|
|
|
|
|
|
|
|
@ -2301,13 +2260,11 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
@@ -2301,13 +2260,11 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
|
|
|
|
|
tex->anim_next = anims[( candidateIndex + 1 ) % max]; |
|
|
|
|
|
|
|
|
|
if( altmax > 0 ) |
|
|
|
|
{ |
|
|
|
|
tex->alternate_anims = altanims[0]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Link all alternate animated frames together.
|
|
|
|
|
for( candidateIndex = 0; candidateIndex < altmax; ++candidateIndex ) |
|
|
|
|
for( candidateIndex = 0; candidateIndex < altmax; candidateIndex++ ) |
|
|
|
|
{ |
|
|
|
|
texture_t *tex = altanims[candidateIndex]; |
|
|
|
|
|
|
|
|
@ -2327,18 +2284,16 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
@@ -2327,18 +2284,16 @@ static void Mod_SequenceAnimatedTexture( int baseTextureIndex )
|
|
|
|
|
tex->anim_next = altanims[( candidateIndex + 1 ) % altmax]; |
|
|
|
|
|
|
|
|
|
if( max > 0 ) |
|
|
|
|
{ |
|
|
|
|
tex->alternate_anims = anims[0]; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
static void Mod_SequenceAllAnimatedTextures( void ) |
|
|
|
|
{ |
|
|
|
|
for( int index = 0; index < loadmodel->numtextures; ++index ) |
|
|
|
|
{ |
|
|
|
|
Mod_SequenceAnimatedTexture( index ); |
|
|
|
|
} |
|
|
|
|
int i; |
|
|
|
|
|
|
|
|
|
for( i = 0; i < loadmodel->numtextures; i++ ) |
|
|
|
|
Mod_SequenceAnimatedTexture( i ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -2348,7 +2303,7 @@ Mod_LoadTextures
@@ -2348,7 +2303,7 @@ Mod_LoadTextures
|
|
|
|
|
*/ |
|
|
|
|
static void Mod_LoadTextures( dbspmodel_t *bmod ) |
|
|
|
|
{ |
|
|
|
|
dmiptexlump_t* lump = NULL; |
|
|
|
|
dmiptexlump_t *lump; |
|
|
|
|
|
|
|
|
|
#if !XASH_DEDICATED |
|
|
|
|
// release old sky layers first
|
|
|
|
@ -2369,7 +2324,7 @@ static void Mod_LoadTextures( dbspmodel_t* bmod )
@@ -2369,7 +2324,7 @@ static void Mod_LoadTextures( dbspmodel_t* bmod )
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
loadmodel->textures = (texture_t **)Mem_Calloc( loadmodel->mempool, lump->nummiptex * sizeof( texture_t * )); |
|
|
|
|
loadmodel->numtextures = loadmodel->textures ? lump->nummiptex : 0; |
|
|
|
|
loadmodel->numtextures = lump->nummiptex; |
|
|
|
|
|
|
|
|
|
Mod_LoadAllTextures( bmod ); |
|
|
|
|
Mod_SequenceAllAnimatedTextures(); |
|
|
|
|