Merge remote-tracking branch 'origin/master' into HEAD
This commit is contained in:
commit
687e0b46d0
|
@ -652,6 +652,11 @@ qboolean R_Init( void )
|
|||
r_showtree = Cvar_Get( "r_showtree", "0", FCVAR_ARCHIVE, "build the graph of visible BSP tree" );
|
||||
r_refdll = Cvar_Get( "r_refdll", "", FCVAR_RENDERINFO|FCVAR_VIDRESTART, "choose renderer implementation, if supported" );
|
||||
|
||||
// cvars that are expected to exist by client.dll
|
||||
// refdll should just get pointer to them
|
||||
Cvar_Get( "r_drawentities", "1", FCVAR_CHEAT, "render entities" );
|
||||
Cvar_Get( "cl_himodels", "1", FCVAR_ARCHIVE, "draw high-resolution player models in multiplayer" );
|
||||
|
||||
// cvars are created, execute video config
|
||||
Cbuf_AddText( "exec video.cfg" );
|
||||
Cbuf_Execute();
|
||||
|
|
|
@ -679,6 +679,21 @@ pack_t *FS_LoadPackPAK( const char *packfile, int *error )
|
|||
return pack;
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
FS_SortZip
|
||||
============
|
||||
*/
|
||||
static int FS_SortZip( const void *a, const void *b )
|
||||
{
|
||||
return Q_stricmp( ( ( zipfile_t* )a )->name, ( ( zipfile_t* )b )->name );
|
||||
}
|
||||
|
||||
/*
|
||||
============
|
||||
FS_LoadZip
|
||||
============
|
||||
*/
|
||||
static zip_t *FS_LoadZip( const char *zipfile, int *error )
|
||||
{
|
||||
int numpackfiles = 0, i;
|
||||
|
@ -838,6 +853,8 @@ static zip_t *FS_LoadZip( const char *zipfile, int *error )
|
|||
zip->numfiles = numpackfiles;
|
||||
zip->files = info;
|
||||
|
||||
qsort( zip->files, zip->numfiles, sizeof( zipfile_t ), FS_SortZip );
|
||||
|
||||
#ifdef XASH_REDUCE_FD
|
||||
// will reopen when needed
|
||||
close(zip->handle);
|
||||
|
@ -2499,15 +2516,33 @@ static searchpath_t *FS_FindFile( const char *name, int *index, qboolean gamedir
|
|||
}
|
||||
else if( search->zip )
|
||||
{
|
||||
int i;
|
||||
for( i = 0; search->zip->numfiles > i; i++)
|
||||
int left, right, middle;
|
||||
zip_t *zip;
|
||||
|
||||
zip = search->zip;
|
||||
|
||||
// look for the file (binary search)
|
||||
left = 0;
|
||||
right = zip->numfiles - 1;
|
||||
|
||||
while( left <= right )
|
||||
{
|
||||
if( !Q_stricmp( search->zip->files[i].name, name ) )
|
||||
int diff;
|
||||
|
||||
middle = (left + right) / 2;
|
||||
diff = Q_stricmp( zip->files[middle].name, name );
|
||||
|
||||
// Found it
|
||||
if( !diff )
|
||||
{
|
||||
if( index )
|
||||
*index = i;
|
||||
if( index ) *index = middle;
|
||||
return search;
|
||||
}
|
||||
|
||||
// if we're too far in the list
|
||||
if( diff > 0 )
|
||||
right = middle - 1;
|
||||
else left = middle + 1;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -218,6 +218,83 @@ static TYPEDESCRIPTION gTempEntvars[] =
|
|||
DEFINE_ENTITY_GLOBAL_FIELD( globalname, FIELD_STRING ),
|
||||
};
|
||||
|
||||
struct
|
||||
{
|
||||
const char *mapname;
|
||||
const char *titlename;
|
||||
} gTitleComments[] =
|
||||
{
|
||||
// default Half-Life map titles
|
||||
// ordering is important
|
||||
// strings hw.so| grep T0A0TITLE -B 50 -A 150
|
||||
{ "T0A0", "#T0A0TITLE" },
|
||||
{ "C0A0", "#C0A0TITLE" },
|
||||
{ "C1A0", "#C0A1TITLE" },
|
||||
{ "C1A1", "#C1A1TITLE" },
|
||||
{ "C1A2", "#C1A2TITLE" },
|
||||
{ "C1A3", "#C1A3TITLE" },
|
||||
{ "C1A4", "#C1A4TITLE" },
|
||||
{ "C2A1", "#C2A1TITLE" },
|
||||
{ "C2A2", "#C2A2TITLE" },
|
||||
{ "C2A3", "#C2A3TITLE" },
|
||||
{ "C2A4D", "#C2A4TITLE2" },
|
||||
{ "C2A4E", "#C2A4TITLE2" },
|
||||
{ "C2A4F", "#C2A4TITLE2" },
|
||||
{ "C2A4G", "#C2A4TITLE2" },
|
||||
{ "C2A4", "#C2A4TITLE1" },
|
||||
{ "C2A5", "#C2A5TITLE" },
|
||||
{ "C3A1", "#C3A1TITLE" },
|
||||
{ "C3A2", "#C3A2TITLE" },
|
||||
{ "C4A1A", "#C4A1ATITLE" },
|
||||
{ "C4A1B", "#C4A1ATITLE" },
|
||||
{ "C4A1C", "#C4A1ATITLE" },
|
||||
{ "C4A1D", "#C4A1ATITLE" },
|
||||
{ "C4A1E", "#C4A1ATITLE" },
|
||||
{ "C4A1", "#C4A1TITLE" },
|
||||
{ "C4A2", "#C4A2TITLE" },
|
||||
{ "C4A3", "#C4A3TITLE" },
|
||||
{ "C5A1", "#C5TITLE" },
|
||||
{ "OFBOOT", "#OF_BOOT0TITLE" },
|
||||
{ "OF0A", "#OF1A1TITLE" },
|
||||
{ "OF1A1", "#OF1A3TITLE" },
|
||||
{ "OF1A2", "#OF1A3TITLE" },
|
||||
{ "OF1A3", "#OF1A3TITLE" },
|
||||
{ "OF1A4", "#OF1A3TITLE" },
|
||||
{ "OF1A", "#OF1A5TITLE" },
|
||||
{ "OF2A1", "#OF2A1TITLE" },
|
||||
{ "OF2A2", "#OF2A1TITLE" },
|
||||
{ "OF2A3", "#OF2A1TITLE" },
|
||||
{ "OF2A", "#OF2A4TITLE" },
|
||||
{ "OF3A1", "#OF3A1TITLE" },
|
||||
{ "OF3A2", "#OF3A1TITLE" },
|
||||
{ "OF3A", "#OF3A3TITLE" },
|
||||
{ "OF4A1", "#OF4A1TITLE" },
|
||||
{ "OF4A2", "#OF4A1TITLE" },
|
||||
{ "OF4A3", "#OF4A1TITLE" },
|
||||
{ "OF4A", "#OF4A4TITLE" },
|
||||
{ "OF5A", "#OF5A1TITLE" },
|
||||
{ "OF6A1", "#OF6A1TITLE" },
|
||||
{ "OF6A2", "#OF6A1TITLE" },
|
||||
{ "OF6A3", "#OF6A1TITLE" },
|
||||
{ "OF6A4b", "#OF6A4TITLE" },
|
||||
{ "OF6A4", "#OF6A4TITLE" },
|
||||
{ "OF6A5", "#OF6A4TITLE" },
|
||||
{ "OF6A", "#OF6A4TITLE" },
|
||||
{ "OF7A", "#OF7A0TITLE" },
|
||||
{ "ba_tram", "#BA_TRAMTITLE" },
|
||||
{ "ba_security", "#BA_SECURITYTITLE" },
|
||||
{ "ba_main", "#BA_SECURITYTITLE" },
|
||||
{ "ba_elevator", "#BA_SECURITYTITLE" },
|
||||
{ "ba_canal", "#BA_CANALSTITLE" },
|
||||
{ "ba_yard", "#BA_YARDTITLE" },
|
||||
{ "ba_xen", "#BA_XENTITLE" },
|
||||
{ "ba_hazard", "#BA_HAZARD" },
|
||||
{ "ba_power", "#BA_POWERTITLE" },
|
||||
{ "ba_teleport1", "#BA_POWERTITLE" },
|
||||
{ "ba_teleport", "#BA_TELEPORTTITLE" },
|
||||
{ "ba_outro", "#BA_OUTRO" },
|
||||
};
|
||||
|
||||
/*
|
||||
=============
|
||||
SaveBuildComment
|
||||
|
@ -228,30 +305,49 @@ typically it writes world message and level time
|
|||
*/
|
||||
static void SaveBuildComment( char *text, int maxlength )
|
||||
{
|
||||
const char *pName;
|
||||
string comment;
|
||||
const char *pName = NULL;
|
||||
|
||||
text[0] = '\0'; // clear
|
||||
|
||||
if( pfnSaveGameComment != NULL )
|
||||
{
|
||||
// get save comment from gamedll
|
||||
pfnSaveGameComment( text, maxlength );
|
||||
pfnSaveGameComment( comment, MAX_STRING );
|
||||
pName = comment;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( svgame.edicts->v.message != 0 )
|
||||
size_t i;
|
||||
const char *mapname = STRING( svgame.globals->mapname );
|
||||
|
||||
for( i = 0; i < ARRAYSIZE( gTitleComments ); i++ )
|
||||
{
|
||||
// trying to extract message from the world
|
||||
pName = STRING( svgame.edicts->v.message );
|
||||
}
|
||||
else
|
||||
{
|
||||
// or use mapname
|
||||
pName = STRING( svgame.globals->mapname );
|
||||
// compare if strings are equal at beginning
|
||||
size_t len = strlen( gTitleComments[i].mapname );
|
||||
if( !Q_strnicmp( mapname, gTitleComments[i].mapname, len ))
|
||||
{
|
||||
pName = gTitleComments[i].titlename;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Q_snprintf( text, maxlength, "%-64.64s %02d:%02d", pName, (int)(sv.time / 60.0 ), (int)fmod( sv.time, 60.0 ));
|
||||
if( !pName )
|
||||
{
|
||||
if( svgame.edicts->v.message != 0 )
|
||||
{
|
||||
// trying to extract message from the world
|
||||
pName = STRING( svgame.edicts->v.message );
|
||||
}
|
||||
else
|
||||
{
|
||||
// or use mapname
|
||||
pName = STRING( svgame.globals->mapname );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Q_snprintf( text, maxlength, "%-64.64s %02d:%02d", pName, (int)(sv.time / 60.0 ), (int)fmod( sv.time, 60.0 ));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -2276,6 +2372,7 @@ int GAME_EXPORT SV_GetSaveComment( const char *savename, char *comment )
|
|||
// each field is a short (size), short (index of name), binary string of "size" bytes (data)
|
||||
for( i = 0; i < nNumberOfFields; i++ )
|
||||
{
|
||||
size_t size;
|
||||
// Data order is:
|
||||
// Size
|
||||
// szName
|
||||
|
@ -2286,13 +2383,15 @@ int GAME_EXPORT SV_GetSaveComment( const char *savename, char *comment )
|
|||
pFieldName = pTokenList[*(short *)pData];
|
||||
pData += sizeof( short );
|
||||
|
||||
size = Q_min( nFieldSize, MAX_STRING );
|
||||
|
||||
if( !Q_stricmp( pFieldName, "comment" ))
|
||||
{
|
||||
Q_strncpy( description, pData, nFieldSize );
|
||||
Q_strncpy( description, pData, size );
|
||||
}
|
||||
else if( !Q_stricmp( pFieldName, "mapName" ))
|
||||
{
|
||||
Q_strncpy( mapName, pData, nFieldSize );
|
||||
Q_strncpy( mapName, pData, size );
|
||||
}
|
||||
|
||||
// move to start of next field.
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
# mittorn, 2018
|
||||
|
||||
from waflib import Logs
|
||||
from waflib.extras import pthread
|
||||
import os
|
||||
|
||||
top = '.'
|
||||
|
@ -69,8 +70,7 @@ def configure(conf):
|
|||
conf.define('XASH_NO_LIBDL',1)
|
||||
|
||||
if not conf.env.DEST_OS in ['win32', 'android'] and not conf.options.NO_ASYNC_RESOLVE:
|
||||
conf.load('pthreads')
|
||||
conf.check_pthread_flag()
|
||||
conf.check_pthreads()
|
||||
|
||||
if hasattr(conf.options, 'DLLEMU'):
|
||||
conf.define_cond('XASH_DLL_LOADER', conf.options.DLLEMU)
|
||||
|
|
2
mainui
2
mainui
|
@ -1 +1 @@
|
|||
Subproject commit 5c687e8e2b47464d930a09a4dfa7fee5e8f722cb
|
||||
Subproject commit aa22e7075b86d2f2af9ac724903d6172a203d689
|
|
@ -842,7 +842,7 @@ void GL_InitCommands( void )
|
|||
r_dynamic = gEngfuncs.Cvar_Get( "r_dynamic", "1", FCVAR_ARCHIVE, "allow dynamic lighting (dlights, lightstyles)" );
|
||||
r_traceglow = gEngfuncs.Cvar_Get( "r_traceglow", "1", FCVAR_ARCHIVE, "cull flares behind models" );
|
||||
r_lightmap = gEngfuncs.Cvar_Get( "r_lightmap", "0", FCVAR_CHEAT, "lightmap debugging tool" );
|
||||
r_drawentities = gEngfuncs.Cvar_Get( "r_drawentities", "1", FCVAR_CHEAT, "render entities" );
|
||||
r_drawentities = gEngfuncs.pfnGetCvarPointer( "r_drawentities", 0 );
|
||||
r_decals = gEngfuncs.pfnGetCvarPointer( "r_decals", 0 );
|
||||
r_showhull = gEngfuncs.pfnGetCvarPointer( "r_showhull", 0 );
|
||||
|
||||
|
|
|
@ -152,7 +152,9 @@ R_StudioInit
|
|||
*/
|
||||
void R_StudioInit( void )
|
||||
{
|
||||
cl_himodels = gEngfuncs.Cvar_Get( "cl_himodels", "1", FCVAR_ARCHIVE, "draw high-resolution player models in multiplayer" );
|
||||
// guaranteed to exist by engine
|
||||
cl_himodels = gEngfuncs.pfnGetCvarPointer( "cl_himodels", 0 );
|
||||
|
||||
r_studio_sort_textures = gEngfuncs.Cvar_Get( "r_studio_sort_textures", "0", FCVAR_ARCHIVE, "change draw order for additive meshes" );
|
||||
r_drawviewmodel = gEngfuncs.Cvar_Get( "r_drawviewmodel", "1", 0, "draw firstperson weapon model" );
|
||||
r_studio_drawelements = gEngfuncs.Cvar_Get( "r_studio_drawelements", "1", FCVAR_ARCHIVE, "use glDrawElements for studiomodels" );
|
||||
|
|
|
@ -1930,7 +1930,7 @@ qboolean GAME_EXPORT R_Init( void )
|
|||
gl_emboss_scale = gEngfuncs.Cvar_Get( "gl_emboss_scale", "0", FCVAR_ARCHIVE|FCVAR_LATCH, "fake bumpmapping scale" );
|
||||
vid_gamma = gEngfuncs.pfnGetCvarPointer( "gamma", 0 );
|
||||
r_norefresh = gEngfuncs.Cvar_Get( "r_norefresh", "0", 0, "disable 3D rendering (use with caution)" );
|
||||
r_drawentities = gEngfuncs.Cvar_Get( "r_drawentities", "1", FCVAR_CHEAT, "render entities" );
|
||||
r_drawentities = gEngfuncs.pfnGetCvarPointer( "r_drawentities", 0 );
|
||||
vid_brightness = gEngfuncs.pfnGetCvarPointer( "brightness", 0 );
|
||||
r_fullbright = gEngfuncs.Cvar_Get( "r_fullbright", "0", FCVAR_CHEAT, "disable lightmaps, get fullbright for entities" );
|
||||
|
||||
|
|
|
@ -149,11 +149,13 @@ R_StudioInit
|
|||
*/
|
||||
void R_StudioInit( void )
|
||||
{
|
||||
cl_himodels = gEngfuncs.Cvar_Get( "cl_himodels", "1", FCVAR_ARCHIVE, "draw high-resolution player models in multiplayer" );
|
||||
r_studio_sort_textures = gEngfuncs.Cvar_Get( "r_studio_sort_textures", "0", FCVAR_ARCHIVE, "change draw order for additive meshes" );
|
||||
r_drawviewmodel = gEngfuncs.Cvar_Get( "r_drawviewmodel", "1", 0, "draw firstperson weapon model" );
|
||||
r_studio_drawelements = gEngfuncs.Cvar_Get( "r_studio_drawelements", "1", FCVAR_ARCHIVE, "use glDrawElements for studiomodels" );
|
||||
|
||||
// guaranteed to exist by engine
|
||||
cl_himodels = gEngfuncs.pfnGetCvarPointer( "cl_himodels", 0 );
|
||||
|
||||
Matrix3x4_LoadIdentity( g_studio.rotationmatrix );
|
||||
r_glowshellfreq = gEngfuncs.Cvar_Get( "r_glowshellfreq", "2.2", 0, "glowing shell frequency update" );
|
||||
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
# encoding: utf-8
|
||||
# enforce_pic.py -- enforcing PIC if requested
|
||||
# Copyright (C) 2021 a1batross
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
from waflib.Configure import conf
|
||||
|
||||
def options(opt):
|
||||
pass
|
||||
|
||||
def configure(conf):
|
||||
pass
|
||||
|
||||
@conf
|
||||
def check_pic(conf, enable):
|
||||
if enable:
|
||||
# Every static library must have fPIC
|
||||
if conf.env.DEST_OS != 'win32' and '-fPIC' in conf.env.CFLAGS_cshlib:
|
||||
conf.env.append_unique('CFLAGS_cstlib', '-fPIC')
|
||||
conf.env.append_unique('CXXFLAGS_cxxstlib', '-fPIC')
|
||||
else:
|
||||
if '-fPIC' in conf.env.CFLAGS_cshlib:
|
||||
conf.env.CFLAGS_cshlib.remove('-fPIC')
|
||||
if '-fPIC' in conf.env.CXXFLAGS_cshlib:
|
||||
conf.env.CXXFLAGS_cxxshlib.remove('-fPIC')
|
||||
if '-fPIC' in conf.env.CFLAGS_MACBUNDLE:
|
||||
conf.env.CFLAGS_MACBUNDLE.remove('-fPIC')
|
||||
if '-fPIC' in conf.env.CXXFLAGS_MACBUNDLE:
|
||||
conf.env.CXXFLAGS_MACBUNDLE.remove('-fPIC')
|
Loading…
Reference in New Issue