Browse Source

engine: fixes for dedicated

pull/2/head
Alibek Omarov 4 years ago
parent
commit
d30605c09f
  1. 4
      engine/common/mod_studio.c
  2. 2
      engine/common/pm_surface.c
  3. 4
      public/xash3d_mathlib.h

4
engine/common/mod_studio.c

@ -1065,7 +1065,9 @@ void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded )
} }
else else
{ {
#if !XASH_DEDICATED
ref.dllFuncs.Mod_StudioLoadTextures( mod, thdr ); ref.dllFuncs.Mod_StudioLoadTextures( mod, thdr );
#endif
// give space for textures and skinrefs // give space for textures and skinrefs
size1 = thdr->numtextures * sizeof( mstudiotexture_t ); size1 = thdr->numtextures * sizeof( mstudiotexture_t );
@ -1092,7 +1094,9 @@ void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded )
loadmodel->cache.data = Mem_Calloc( loadmodel->mempool, phdr->length ); loadmodel->cache.data = Mem_Calloc( loadmodel->mempool, phdr->length );
memcpy( loadmodel->cache.data, buffer, phdr->length ); memcpy( loadmodel->cache.data, buffer, phdr->length );
phdr = (studiohdr_t *)loadmodel->cache.data; // get the new pointer on studiohdr phdr = (studiohdr_t *)loadmodel->cache.data; // get the new pointer on studiohdr
#if !XASH_DEDICATED
ref.dllFuncs.Mod_StudioLoadTextures( mod, phdr ); ref.dllFuncs.Mod_StudioLoadTextures( mod, phdr );
#endif
// NOTE: we wan't keep raw textures in memory. just cutoff model pointer above texture base // NOTE: we wan't keep raw textures in memory. just cutoff model pointer above texture base
loadmodel->cache.data = Mem_Realloc( loadmodel->mempool, loadmodel->cache.data, phdr->texturedataindex ); loadmodel->cache.data = Mem_Realloc( loadmodel->mempool, loadmodel->cache.data, phdr->texturedataindex );

2
engine/common/pm_surface.c

@ -73,6 +73,7 @@ int PM_SampleMiptex( const msurface_t *surf, const vec3_t point )
// TODO: this won't work under dedicated // TODO: this won't work under dedicated
// should we bring up imagelib and keep original buffers? // should we bring up imagelib and keep original buffers?
#if !XASH_DEDICATED
if( !Host_IsDedicated() ) if( !Host_IsDedicated() )
{ {
const byte *data; const byte *data;
@ -94,6 +95,7 @@ int PM_SampleMiptex( const msurface_t *surf, const vec3_t point )
return CONTENTS_EMPTY; return CONTENTS_EMPTY;
return CONTENTS_SOLID; return CONTENTS_SOLID;
} }
#endif // !XASH_DEDICATED
return contents; return contents;
} }

4
public/xash3d_mathlib.h

@ -21,7 +21,11 @@ GNU General Public License for more details.
#include <tgmath.h> #include <tgmath.h>
#endif #endif
#include "build.h"
#ifdef XASH_MSVC
#pragma warning(disable : 4201) // nonstandard extension used #pragma warning(disable : 4201) // nonstandard extension used
#endif
// euler angle order // euler angle order
#define PITCH 0 #define PITCH 0

Loading…
Cancel
Save