mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-05 11:35:05 +08:00
Compare commits
11 Commits
continuous
...
continuous
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
29c9393da3 | ||
|
|
bf6829189e | ||
|
|
a62a9429c9 | ||
|
|
f2c080e736 | ||
|
|
ea55e78855 | ||
|
|
f7c536b81c | ||
|
|
6c40104c66 | ||
|
|
4d7d592918 | ||
|
|
c5e91f299b | ||
|
|
cff276db71 | ||
|
|
30d1492b93 |
@@ -57,6 +57,7 @@ typedef uint64_t longtime_t;
|
||||
#define MAX_USERMSG_LENGTH 2048 // don't modify it's relies on a client-side definitions
|
||||
|
||||
#define BIT( n ) ( 1U << ( n ))
|
||||
#define BIT64( n ) ( 1ULL << ( n ))
|
||||
#define GAMMA ( 2.2f ) // Valve Software gamma
|
||||
#define INVGAMMA ( 1.0f / 2.2f ) // back to 1.0
|
||||
#define TEXGAMMA ( 0.9f ) // compensate dim textures
|
||||
|
||||
@@ -659,7 +659,7 @@ static void make_hull_windings( hull_t *hull, hull_model_t *model )
|
||||
Con_Reportf( "%i hull polys\n", model->num_polys );
|
||||
}
|
||||
|
||||
void Mod_InitDebugHulls( void )
|
||||
void Mod_InitDebugHulls( model_t *loadmodel )
|
||||
{
|
||||
int i;
|
||||
|
||||
|
||||
@@ -98,16 +98,6 @@ static void *pfnMod_Extradata( int type, model_t *m )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static model_t *pfnMod_GetCurrentLoadingModel( void )
|
||||
{
|
||||
return loadmodel;
|
||||
}
|
||||
|
||||
static void pfnMod_SetCurrentLoadingModel( model_t *m )
|
||||
{
|
||||
loadmodel = m;
|
||||
}
|
||||
|
||||
static void pfnGetPredictedOrigin( vec3_t v )
|
||||
{
|
||||
VectorCopy( cl.simorg, v );
|
||||
@@ -282,8 +272,6 @@ static ref_api_t gEngfuncs =
|
||||
Mod_ForName,
|
||||
pfnMod_Extradata,
|
||||
CL_ModelHandle,
|
||||
pfnMod_GetCurrentLoadingModel,
|
||||
pfnMod_SetCurrentLoadingModel,
|
||||
|
||||
CL_GetRemapInfoForEntity,
|
||||
CL_AllocRemapInfo,
|
||||
|
||||
@@ -23,15 +23,6 @@ GNU General Public License for more details.
|
||||
|
||||
#if XASH_EMSCRIPTEN
|
||||
#include <emscripten.h>
|
||||
#elif XASH_WIN32
|
||||
extern "C"
|
||||
{
|
||||
// Enable NVIDIA High Performance Graphics while using Integrated Graphics.
|
||||
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
|
||||
|
||||
// Enable AMD High Performance Graphics while using Integrated Graphics.
|
||||
__declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define E_GAME "XASH3D_GAME" // default env dir to start from
|
||||
@@ -39,6 +30,10 @@ __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1;
|
||||
#define XASH_GAMEDIR "valve"
|
||||
#endif
|
||||
|
||||
#if XASH_WIN32
|
||||
#error "Single-binary or dedicated builds aren't supported for Windows!"
|
||||
#endif
|
||||
|
||||
static char szGameDir[128]; // safe place to keep gamedir
|
||||
static int szArgc;
|
||||
static char **szArgv;
|
||||
@@ -47,7 +42,7 @@ static void Sys_ChangeGame( const char *progname )
|
||||
{
|
||||
// a1ba: may never be called within engine
|
||||
// if platform supports execv() function
|
||||
Q_strncpy( szGameDir, progname, sizeof( szGameDir ) - 1 );
|
||||
Q_strncpy( szGameDir, progname, sizeof( szGameDir ));
|
||||
Host_Shutdown( );
|
||||
exit( Host_Main( szArgc, szArgv, szGameDir, 1, &Sys_ChangeGame ) );
|
||||
}
|
||||
@@ -88,7 +83,6 @@ _inline int Sys_Start( void )
|
||||
return ret;
|
||||
}
|
||||
|
||||
#if !XASH_WIN32
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
#if XASH_PSVITA
|
||||
@@ -100,36 +94,4 @@ int main( int argc, char **argv )
|
||||
#endif // XASH_PSVITA
|
||||
return Sys_Start();
|
||||
}
|
||||
#else
|
||||
int __stdcall WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdLine, int nShow)
|
||||
{
|
||||
LPWSTR* lpArgv;
|
||||
int ret, i;
|
||||
|
||||
lpArgv = CommandLineToArgvW( GetCommandLineW(), &szArgc );
|
||||
szArgv = ( char** )malloc( (szArgc + 1) * sizeof( char* ));
|
||||
|
||||
for( i = 0; i < szArgc; ++i )
|
||||
{
|
||||
size_t size = wcslen(lpArgv[i]) + 1;
|
||||
|
||||
// just in case, allocate some more memory
|
||||
szArgv[i] = ( char * )malloc( size * sizeof( wchar_t ));
|
||||
wcstombs( szArgv[i], lpArgv[i], size );
|
||||
}
|
||||
szArgv[szArgc] = 0;
|
||||
|
||||
LocalFree( lpArgv );
|
||||
|
||||
ret = Sys_Start();
|
||||
|
||||
for( ; i < szArgc; ++i )
|
||||
free( szArgv[i] );
|
||||
free( szArgv );
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif // XASH_WIN32
|
||||
|
||||
|
||||
#endif
|
||||
#endif // SINGLE_BINARY
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -118,7 +118,6 @@ typedef struct world_static_s
|
||||
#ifndef REF_DLL
|
||||
extern world_static_t world;
|
||||
extern poolhandle_t com_studiocache;
|
||||
extern model_t *loadmodel;
|
||||
extern convar_t mod_studiocache;
|
||||
extern convar_t r_wadtextures;
|
||||
extern convar_t r_showhull;
|
||||
@@ -164,7 +163,7 @@ void Mod_PrintWorldStats_f( void );
|
||||
//
|
||||
// mod_dbghulls.c
|
||||
//
|
||||
void Mod_InitDebugHulls( void );
|
||||
void Mod_InitDebugHulls( model_t *mod );
|
||||
void Mod_CreatePolygonsForHull( int hullnum );
|
||||
void Mod_ReleaseHullPolygons( void );
|
||||
|
||||
|
||||
@@ -851,11 +851,11 @@ void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded )
|
||||
char poolname[MAX_VA_STRING];
|
||||
studiohdr_t *phdr;
|
||||
|
||||
Q_snprintf( poolname, sizeof( poolname ), "^2%s^7", loadmodel->name );
|
||||
Q_snprintf( poolname, sizeof( poolname ), "^2%s^7", mod->name );
|
||||
|
||||
if( loaded ) *loaded = false;
|
||||
loadmodel->mempool = Mem_AllocPool( poolname );
|
||||
loadmodel->type = mod_studio;
|
||||
mod->mempool = Mem_AllocPool( poolname );
|
||||
mod->type = mod_studio;
|
||||
|
||||
phdr = R_StudioLoadHeader( mod, buffer );
|
||||
if( !phdr ) return; // bad model
|
||||
@@ -886,9 +886,9 @@ void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded )
|
||||
// give space for textures and skinrefs
|
||||
size1 = thdr->numtextures * sizeof( mstudiotexture_t );
|
||||
size2 = thdr->numskinfamilies * thdr->numskinref * sizeof( short );
|
||||
mod->cache.data = Mem_Calloc( loadmodel->mempool, phdr->length + size1 + size2 );
|
||||
memcpy( loadmodel->cache.data, buffer, phdr->length ); // copy main mdl buffer
|
||||
phdr = (studiohdr_t *)loadmodel->cache.data; // get the new pointer on studiohdr
|
||||
mod->cache.data = Mem_Calloc( mod->mempool, phdr->length + size1 + size2 );
|
||||
memcpy( mod->cache.data, buffer, phdr->length ); // copy main mdl buffer
|
||||
phdr = (studiohdr_t *)mod->cache.data; // get the new pointer on studiohdr
|
||||
phdr->numskinfamilies = thdr->numskinfamilies;
|
||||
phdr->numtextures = thdr->numtextures;
|
||||
phdr->numskinref = thdr->numskinref;
|
||||
@@ -905,52 +905,52 @@ void Mod_LoadStudioModel( model_t *mod, const void *buffer, qboolean *loaded )
|
||||
else
|
||||
{
|
||||
// NOTE: don't modify source buffer because it's used for CRC computing
|
||||
loadmodel->cache.data = Mem_Calloc( loadmodel->mempool, phdr->length );
|
||||
memcpy( loadmodel->cache.data, buffer, phdr->length );
|
||||
phdr = (studiohdr_t *)loadmodel->cache.data; // get the new pointer on studiohdr
|
||||
mod->cache.data = Mem_Calloc( mod->mempool, phdr->length );
|
||||
memcpy( mod->cache.data, buffer, phdr->length );
|
||||
phdr = (studiohdr_t *)mod->cache.data; // get the new pointer on studiohdr
|
||||
#if !XASH_DEDICATED
|
||||
ref.dllFuncs.Mod_StudioLoadTextures( mod, phdr );
|
||||
#endif
|
||||
|
||||
// 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 );
|
||||
phdr = (studiohdr_t *)loadmodel->cache.data; // get the new pointer on studiohdr
|
||||
mod->cache.data = Mem_Realloc( mod->mempool, mod->cache.data, phdr->texturedataindex );
|
||||
phdr = (studiohdr_t *)mod->cache.data; // get the new pointer on studiohdr
|
||||
phdr->length = phdr->texturedataindex; // update model size
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// just copy model into memory
|
||||
loadmodel->cache.data = Mem_Calloc( loadmodel->mempool, phdr->length );
|
||||
memcpy( loadmodel->cache.data, buffer, phdr->length );
|
||||
mod->cache.data = Mem_Calloc( mod->mempool, phdr->length );
|
||||
memcpy( mod->cache.data, buffer, phdr->length );
|
||||
|
||||
phdr = loadmodel->cache.data;
|
||||
phdr = mod->cache.data;
|
||||
}
|
||||
|
||||
// setup bounding box
|
||||
if( !VectorCompare( vec3_origin, phdr->bbmin ))
|
||||
{
|
||||
// clipping bounding box
|
||||
VectorCopy( phdr->bbmin, loadmodel->mins );
|
||||
VectorCopy( phdr->bbmax, loadmodel->maxs );
|
||||
VectorCopy( phdr->bbmin, mod->mins );
|
||||
VectorCopy( phdr->bbmax, mod->maxs );
|
||||
}
|
||||
else if( !VectorCompare( vec3_origin, phdr->min ))
|
||||
{
|
||||
// movement bounding box
|
||||
VectorCopy( phdr->min, loadmodel->mins );
|
||||
VectorCopy( phdr->max, loadmodel->maxs );
|
||||
VectorCopy( phdr->min, mod->mins );
|
||||
VectorCopy( phdr->max, mod->maxs );
|
||||
}
|
||||
else
|
||||
{
|
||||
// well compute bounds from vertices and round to nearest even values
|
||||
Mod_StudioComputeBounds( phdr, loadmodel->mins, loadmodel->maxs, true );
|
||||
RoundUpHullSize( loadmodel->mins );
|
||||
RoundUpHullSize( loadmodel->maxs );
|
||||
Mod_StudioComputeBounds( phdr, mod->mins, mod->maxs, true );
|
||||
RoundUpHullSize( mod->mins );
|
||||
RoundUpHullSize( mod->maxs );
|
||||
}
|
||||
|
||||
loadmodel->numframes = Mod_StudioBodyVariations( loadmodel );
|
||||
loadmodel->radius = RadiusFromBounds( loadmodel->mins, loadmodel->maxs );
|
||||
loadmodel->flags = phdr->flags; // copy header flags
|
||||
mod->numframes = Mod_StudioBodyVariations( mod );
|
||||
mod->radius = RadiusFromBounds( mod->mins, mod->maxs );
|
||||
mod->flags = phdr->flags; // copy header flags
|
||||
|
||||
if( loaded ) *loaded = true;
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ poolhandle_t com_studiocache; // cache for submodels
|
||||
CVAR_DEFINE( mod_studiocache, "r_studiocache", "1", FCVAR_ARCHIVE, "enables studio cache for speedup tracing hitboxes" );
|
||||
CVAR_DEFINE_AUTO( r_wadtextures, "0", 0, "completely ignore textures in the bsp-file if enabled" );
|
||||
CVAR_DEFINE_AUTO( r_showhull, "0", 0, "draw collision hulls 1-3" );
|
||||
model_t *loadmodel;
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
@@ -287,7 +286,6 @@ model_t *Mod_LoadModel( model_t *mod, qboolean crash )
|
||||
Con_Reportf( "loading %s\n", mod->name );
|
||||
mod->needload = NL_PRESENT;
|
||||
mod->type = mod_bad;
|
||||
loadmodel = mod;
|
||||
|
||||
// call the apropriate loader
|
||||
switch( *(uint *)buf )
|
||||
|
||||
@@ -330,8 +330,6 @@ typedef struct ref_api_s
|
||||
model_t *(*Mod_ForName)( const char *name, qboolean crash, qboolean trackCRC );
|
||||
void *(*Mod_Extradata)( int type, model_t *model );
|
||||
struct model_s *(*pfnGetModelByIndex)( int index ); // CL_ModelHandle
|
||||
struct model_s *(*Mod_GetCurrentLoadingModel)( void ); // loadmodel
|
||||
void (*Mod_SetCurrentLoadingModel)( struct model_s* ); // loadmodel
|
||||
|
||||
// remap
|
||||
struct remap_info_s *(*CL_GetRemapInfoForEntity)( cl_entity_t *e );
|
||||
@@ -506,7 +504,7 @@ typedef struct ref_interface_s
|
||||
|
||||
// bmodel
|
||||
void (*R_InitSkyClouds)( struct mip_s *mt, struct texture_s *tx, qboolean custom_palette );
|
||||
void (*GL_SubdivideSurface)( msurface_t *fa );
|
||||
void (*GL_SubdivideSurface)( model_t *mod, msurface_t *fa );
|
||||
void (*CL_RunLightStyles)( void );
|
||||
|
||||
// sprites
|
||||
|
||||
@@ -1041,8 +1041,9 @@ qboolean SV_SpawnServer( const char *mapname, const char *startspot, qboolean ba
|
||||
// force normal player collisions for single player
|
||||
if( svs.maxclients == 1 ) Cvar_SetValue( "sv_clienttrace", 1 );
|
||||
|
||||
// make sure what server name doesn't contain path and extension
|
||||
COM_FileBase( mapname, sv.name, sizeof( sv.name ));
|
||||
// allow loading maps from subdirectories, strip extension anyway
|
||||
Q_strncpy( sv.name, mapname, sizeof( sv.name ));
|
||||
COM_StripExtension( sv.name );
|
||||
|
||||
// precache and static commands can be issued during map initialization
|
||||
Host_SetServerState( ss_loading );
|
||||
|
||||
@@ -642,20 +642,13 @@ COM_ExtractFilePath
|
||||
*/
|
||||
void COM_ExtractFilePath( const char *path, char *dest )
|
||||
{
|
||||
size_t len = Q_strlen( path );
|
||||
const char *src = path + len - 1;
|
||||
|
||||
if( len == 0 )
|
||||
{
|
||||
dest[0] = 0;
|
||||
return;
|
||||
}
|
||||
const char *src = path + Q_strlen( path ) - 1;
|
||||
|
||||
// back up until a \ or the start
|
||||
while( src != path && !(*(src - 1) == '\\' || *(src - 1) == '/' ))
|
||||
while( src > path && !(*(src - 1) == '\\' || *(src - 1) == '/' ))
|
||||
src--;
|
||||
|
||||
if( src != path )
|
||||
if( src > path )
|
||||
{
|
||||
memcpy( dest, path, src - path );
|
||||
dest[src - path - 1] = 0; // cutoff backslash
|
||||
|
||||
40
public/tests/test_efp.c
Normal file
40
public/tests/test_efp.c
Normal file
@@ -0,0 +1,40 @@
|
||||
#include <stdlib.h>
|
||||
#include "crtlib.h"
|
||||
#include <stdio.h>
|
||||
|
||||
int Test_ExtractFilePath( void )
|
||||
{
|
||||
char dst[64];
|
||||
const char *strings[] =
|
||||
{
|
||||
"dir/file", "dir",
|
||||
"bark\\meow", "bark",
|
||||
"nopath", "",
|
||||
"knee/deep/in/paths", "knee/deep/in",
|
||||
// yes, it removes the behavior/ even if it might be technically a directory
|
||||
"keep/the/original/func/behavior/", "keep/the/original/func",
|
||||
"backslashes\\are\\annoying\\af", "backslashes\\are\\annoying",
|
||||
"", ""
|
||||
};
|
||||
size_t i;
|
||||
|
||||
for( i = 0; i < sizeof( strings ) / sizeof( strings[0] ); i += 2 )
|
||||
{
|
||||
COM_ExtractFilePath( strings[i], dst );
|
||||
if( Q_strcmp( dst, strings[i+1] ))
|
||||
{
|
||||
printf( "%s %s %s\n", strings[i], strings[i+1], dst );
|
||||
return (i >> 1) + 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main( void )
|
||||
{
|
||||
if( Test_ExtractFilePath( ))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
@@ -12,8 +12,7 @@ def options(opt):
|
||||
return
|
||||
|
||||
def configure(conf):
|
||||
# stub
|
||||
return
|
||||
conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')
|
||||
|
||||
def build(bld):
|
||||
bld(name = 'sdk_includes', export_includes = '. ../common ../pm_shared ../engine')
|
||||
@@ -28,6 +27,7 @@ def build(bld):
|
||||
'strings': 'tests/test_strings.c',
|
||||
'build': 'tests/test_build.c',
|
||||
'filebase': 'tests/test_filebase.c',
|
||||
'efp': 'tests/test_efp.c',
|
||||
}
|
||||
|
||||
for i in tests:
|
||||
|
||||
@@ -1309,9 +1309,9 @@ static void GL2_Mul4x4( const GLfloat *in0, const GLfloat *in1, GLfloat *out )
|
||||
static void GL2_UpdateMVP( gl2wrap_prog_t *prog )
|
||||
{
|
||||
// use bitset to determine if need update matrix for this prog
|
||||
if( FBitSet( gl2wrap_matrix.update, BIT( prog->flags )))
|
||||
if( FBitSet( gl2wrap_matrix.update, BIT64( prog->flags )))
|
||||
{
|
||||
ClearBits( gl2wrap_matrix.update, BIT( prog->flags ));
|
||||
ClearBits( gl2wrap_matrix.update, BIT64( prog->flags ));
|
||||
GL2_Mul4x4( gl2wrap_matrix.mv, gl2wrap_matrix.pr, gl2wrap_matrix.mvp );
|
||||
pglUniformMatrix4fvARB( prog->uMVP, 1, false, (void *)gl2wrap_matrix.mvp );
|
||||
}
|
||||
|
||||
@@ -418,7 +418,6 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height )
|
||||
static rgbdata_t skin;
|
||||
char name[MAX_QPATH];
|
||||
int i;
|
||||
model_t *loadmodel = gEngfuncs.Mod_GetCurrentLoadingModel();
|
||||
|
||||
skin.width = width;
|
||||
skin.height = height;
|
||||
@@ -443,7 +442,7 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height )
|
||||
}
|
||||
}
|
||||
|
||||
COM_FileBase( loadmodel->name, name, sizeof( name ));
|
||||
COM_FileBase( mod->name, name, sizeof( name ));
|
||||
|
||||
// for alias models only player can have remap textures
|
||||
if( mod != NULL && !Q_stricmp( name, "player" ))
|
||||
@@ -476,12 +475,11 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height )
|
||||
return gEngfuncs.FS_CopyImage( &skin );
|
||||
}
|
||||
|
||||
void *Mod_LoadSingleSkin( daliasskintype_t *pskintype, int skinnum, int size )
|
||||
void *Mod_LoadSingleSkin( model_t *loadmodel, daliasskintype_t *pskintype, int skinnum, int size )
|
||||
{
|
||||
string name, lumaname;
|
||||
string checkname;
|
||||
rgbdata_t *pic;
|
||||
model_t *loadmodel = gEngfuncs.Mod_GetCurrentLoadingModel();
|
||||
|
||||
Q_snprintf( name, sizeof( name ), "%s:frame%i", loadmodel->name, skinnum );
|
||||
Q_snprintf( lumaname, sizeof( lumaname ), "%s:luma%i", loadmodel->name, skinnum );
|
||||
@@ -508,14 +506,13 @@ void *Mod_LoadSingleSkin( daliasskintype_t *pskintype, int skinnum, int size )
|
||||
return ((byte *)(pskintype + 1) + size);
|
||||
}
|
||||
|
||||
void *Mod_LoadGroupSkin( daliasskintype_t *pskintype, int skinnum, int size )
|
||||
void *Mod_LoadGroupSkin( model_t *loadmodel, daliasskintype_t *pskintype, int skinnum, int size )
|
||||
{
|
||||
daliasskininterval_t *pinskinintervals;
|
||||
daliasskingroup_t *pinskingroup;
|
||||
string name, lumaname;
|
||||
rgbdata_t *pic;
|
||||
int i, j;
|
||||
model_t *loadmodel = gEngfuncs.Mod_GetCurrentLoadingModel();
|
||||
|
||||
// animating skin group. yuck.
|
||||
pskintype++;
|
||||
@@ -555,7 +552,7 @@ void *Mod_LoadGroupSkin( daliasskintype_t *pskintype, int skinnum, int size )
|
||||
Mod_LoadAllSkins
|
||||
===============
|
||||
*/
|
||||
void *Mod_LoadAllSkins( int numskins, daliasskintype_t *pskintype )
|
||||
void *Mod_LoadAllSkins( model_t *mod, int numskins, daliasskintype_t *pskintype )
|
||||
{
|
||||
int i, size;
|
||||
|
||||
@@ -568,11 +565,11 @@ void *Mod_LoadAllSkins( int numskins, daliasskintype_t *pskintype )
|
||||
{
|
||||
if( pskintype->type == ALIAS_SKIN_SINGLE )
|
||||
{
|
||||
pskintype = (daliasskintype_t *)Mod_LoadSingleSkin( pskintype, i, size );
|
||||
pskintype = (daliasskintype_t *)Mod_LoadSingleSkin( mod, pskintype, i, size );
|
||||
}
|
||||
else
|
||||
{
|
||||
pskintype = (daliasskintype_t *)Mod_LoadGroupSkin( pskintype, i, size );
|
||||
pskintype = (daliasskintype_t *)Mod_LoadGroupSkin( mod, pskintype, i, size );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -680,7 +677,7 @@ void Mod_LoadAliasModel( model_t *mod, const void *buffer, qboolean *loaded )
|
||||
|
||||
// load the skins
|
||||
pskintype = (daliasskintype_t *)&pinmodel[1];
|
||||
pskintype = Mod_LoadAllSkins( m_pAliasHeader->numskins, pskintype );
|
||||
pskintype = Mod_LoadAllSkins( mod, m_pAliasHeader->numskins, pskintype );
|
||||
|
||||
// load base s and t vertices
|
||||
pinstverts = (stvert_t *)pskintype;
|
||||
@@ -725,7 +722,7 @@ void Mod_LoadAliasModel( model_t *mod, const void *buffer, qboolean *loaded )
|
||||
GL_MakeAliasModelDisplayLists( mod );
|
||||
|
||||
// move the complete, relocatable alias model to the cache
|
||||
gEngfuncs.Mod_GetCurrentLoadingModel()->cache.data = m_pAliasHeader;
|
||||
mod->cache.data = m_pAliasHeader;
|
||||
|
||||
if( loaded ) *loaded = true; // done
|
||||
}
|
||||
|
||||
@@ -426,7 +426,7 @@ void R_MarkLeaves( void );
|
||||
void R_DrawWorld( void );
|
||||
void R_DrawWaterSurfaces( void );
|
||||
void R_DrawBrushModel( cl_entity_t *e );
|
||||
void GL_SubdivideSurface( msurface_t *fa );
|
||||
void GL_SubdivideSurface( model_t *mod, msurface_t *fa );
|
||||
void GL_BuildPolygonFromSurface( model_t *mod, msurface_t *fa );
|
||||
void DrawGLPoly( glpoly_t *p, float xScale, float yScale );
|
||||
texture_t *R_TextureAnimation( msurface_t *s );
|
||||
|
||||
@@ -78,7 +78,7 @@ static void BoundPoly( int numverts, float *verts, vec3_t mins, vec3_t maxs )
|
||||
}
|
||||
}
|
||||
|
||||
static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts )
|
||||
static void SubdividePolygon_r( model_t *loadmodel, msurface_t *warpface, int numverts, float *verts )
|
||||
{
|
||||
vec3_t front[SUBDIVIDE_SIZE], back[SUBDIVIDE_SIZE];
|
||||
mextrasurf_t *warpinfo = warpface->info;
|
||||
@@ -88,7 +88,6 @@ static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts
|
||||
float sample_size;
|
||||
vec3_t mins, maxs;
|
||||
glpoly_t *poly;
|
||||
model_t *loadmodel = gEngfuncs.Mod_GetCurrentLoadingModel();
|
||||
|
||||
if( numverts > ( SUBDIVIDE_SIZE - 4 ))
|
||||
gEngfuncs.Host_Error( "Mod_SubdividePolygon: too many vertexes on face ( %i )\n", numverts );
|
||||
@@ -143,8 +142,8 @@ static void SubdividePolygon_r( msurface_t *warpface, int numverts, float *verts
|
||||
}
|
||||
}
|
||||
|
||||
SubdividePolygon_r( warpface, f, front[0] );
|
||||
SubdividePolygon_r( warpface, b, back[0] );
|
||||
SubdividePolygon_r( loadmodel, warpface, f, front[0] );
|
||||
SubdividePolygon_r( loadmodel, warpface, b, back[0] );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -238,13 +237,12 @@ boundaries so that turbulent and sky warps
|
||||
can be done reasonably.
|
||||
================
|
||||
*/
|
||||
void GL_SubdivideSurface( msurface_t *fa )
|
||||
void GL_SubdivideSurface( model_t *loadmodel, msurface_t *fa )
|
||||
{
|
||||
vec3_t verts[SUBDIVIDE_SIZE];
|
||||
int numverts;
|
||||
int i, lindex;
|
||||
float *vec;
|
||||
model_t *loadmodel = gEngfuncs.Mod_GetCurrentLoadingModel();
|
||||
|
||||
// convert edges back to a normal polygon
|
||||
numverts = 0;
|
||||
@@ -261,7 +259,7 @@ void GL_SubdivideSurface( msurface_t *fa )
|
||||
SetBits( fa->flags, SURF_DRAWTURB_QUADS ); // predict state
|
||||
|
||||
// do subdivide
|
||||
SubdividePolygon_r( fa, numverts, verts[0] );
|
||||
SubdividePolygon_r( loadmodel, fa, numverts, verts[0] );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -877,7 +875,7 @@ void DrawGLPolyChain( glpoly_t *p, float soffset, float toffset )
|
||||
}
|
||||
}
|
||||
|
||||
_inline qboolean R_HasLightmap( void )
|
||||
static qboolean R_HasLightmap( void )
|
||||
{
|
||||
if( r_fullbright->value || !WORLDMODEL->lightdata )
|
||||
return false;
|
||||
|
||||
@@ -1726,7 +1726,7 @@ static void R_LightLambert( vec4_t light[MAX_LOCALLIGHTS], const vec3_t normal,
|
||||
out[2] = Q_min( (int)( finalLight[2] ), 255 );
|
||||
}
|
||||
|
||||
static void R_StudioSetColorArray(short *ptricmds, vec3_t *pstudionorms, byte *color )
|
||||
static void R_StudioSetColorArray( short *ptricmds, vec3_t *pstudionorms, byte *color )
|
||||
{
|
||||
float *lv = (float *)g_studio.lightvalues[ptricmds[1]];
|
||||
|
||||
@@ -1896,9 +1896,8 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioDrawNormalMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t )
|
||||
static void R_StudioDrawNormalMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t )
|
||||
{
|
||||
float *lv;
|
||||
int i;
|
||||
|
||||
while(( i = *( ptricmds++ )))
|
||||
@@ -1929,9 +1928,8 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioDrawFloatMesh( short *ptricmds, vec3_t *pstudionorms )
|
||||
static void R_StudioDrawFloatMesh( short *ptricmds, vec3_t *pstudionorms )
|
||||
{
|
||||
float *lv;
|
||||
int i;
|
||||
|
||||
while(( i = *( ptricmds++ )))
|
||||
@@ -1961,7 +1959,7 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t, float scale )
|
||||
static void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t, float scale )
|
||||
{
|
||||
float *lv, *av;
|
||||
int i, idx;
|
||||
@@ -2006,7 +2004,7 @@ _inline void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, floa
|
||||
}
|
||||
|
||||
|
||||
_inline int R_StudioBuildIndices( qboolean tri_strip, int vertexState )
|
||||
static int R_StudioBuildIndices( qboolean tri_strip, int vertexState )
|
||||
{
|
||||
// build in indices
|
||||
if( vertexState++ < 3 )
|
||||
@@ -2049,7 +2047,7 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioBuildArrayNormalMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t )
|
||||
static void R_StudioBuildArrayNormalMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t )
|
||||
{
|
||||
float *lv;
|
||||
int i;
|
||||
@@ -2092,7 +2090,7 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioBuildArrayFloatMesh( short *ptricmds, vec3_t *pstudionorms )
|
||||
static void R_StudioBuildArrayFloatMesh( short *ptricmds, vec3_t *pstudionorms )
|
||||
{
|
||||
float *lv;
|
||||
int i;
|
||||
@@ -2135,7 +2133,7 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioBuildArrayChromeMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t, float scale )
|
||||
static void R_StudioBuildArrayChromeMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t, float scale )
|
||||
{
|
||||
float *lv, *av;
|
||||
int i, idx;
|
||||
@@ -2192,7 +2190,7 @@ _inline void R_StudioBuildArrayChromeMesh( short *ptricmds, vec3_t *pstudionorms
|
||||
}
|
||||
}
|
||||
|
||||
_inline void R_StudioDrawArrays( uint startverts, uint startelems )
|
||||
static void R_StudioDrawArrays( uint startverts, uint startelems )
|
||||
{
|
||||
pglEnableClientState( GL_VERTEX_ARRAY );
|
||||
pglVertexPointer( 3, GL_FLOAT, 12, g_studio.arrayverts );
|
||||
|
||||
@@ -329,7 +329,7 @@ void R_InitSkyClouds(mip_t *mt, texture_t *tx, qboolean custom_palette)
|
||||
|
||||
}
|
||||
|
||||
void GAME_EXPORT GL_SubdivideSurface(msurface_t *fa)
|
||||
void GAME_EXPORT GL_SubdivideSurface( model_t *mod, msurface_t *fa )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@@ -1891,7 +1891,7 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioDrawNormalMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t )
|
||||
static void R_StudioDrawNormalMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t )
|
||||
{
|
||||
float *lv;
|
||||
int i;
|
||||
@@ -1924,7 +1924,7 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioDrawFloatMesh( short *ptricmds, vec3_t *pstudionorms )
|
||||
static void R_StudioDrawFloatMesh( short *ptricmds, vec3_t *pstudionorms )
|
||||
{
|
||||
float *lv;
|
||||
int i;
|
||||
@@ -1956,7 +1956,7 @@ R_StudioDrawNormalMesh
|
||||
generic path
|
||||
===============
|
||||
*/
|
||||
_inline void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t, float scale )
|
||||
static void R_StudioDrawChromeMesh( short *ptricmds, vec3_t *pstudionorms, float s, float t, float scale )
|
||||
{
|
||||
float *lv, *av;
|
||||
int i, idx;
|
||||
|
||||
3
wscript
3
wscript
@@ -167,7 +167,7 @@ def configure(conf):
|
||||
conf.env.MSVC_TARGETS = ['x86' if not conf.options.ALLOW64 else 'x64']
|
||||
|
||||
# Load compilers early
|
||||
conf.load('xshlib xcompile compiler_c compiler_cxx cmake')
|
||||
conf.load('xshlib xcompile compiler_c compiler_cxx cmake gccdeps msvcdeps')
|
||||
|
||||
if conf.options.NSWITCH:
|
||||
conf.load('nswitch')
|
||||
@@ -476,7 +476,6 @@ int main(void) { return !opus_custom_encoder_init(0, 0, 0); }'''
|
||||
if conf.check_cc(msg='Checking if opus supports custom modes', defines='CUSTOM_MODES=1', use='opus', fragment=frag, mandatory=False):
|
||||
conf.env.HAVE_SYSTEM_OPUS = True
|
||||
|
||||
conf.define('XASH_BUILD_COMMIT', conf.env.GIT_VERSION if conf.env.GIT_VERSION else 'notset')
|
||||
conf.define('XASH_LOW_MEMORY', conf.options.LOW_MEMORY)
|
||||
|
||||
for i in SUBDIRS:
|
||||
|
||||
Reference in New Issue
Block a user