Compare commits

...
Author SHA1 Message Date
Alibek Omarov f67736180b engine: client: allow nearest filtering for loading and pause icons 2024-01-29 05:59:29 +03:00
Alibek Omarov 725b7ea7f9 common: render_api: rename TF_ALLOW_NEAREST_TOGGLE to just TF_ALLOW_NEAREST, it's just shorter 2024-01-29 05:59:06 +03:00
Alibek Omarov 600d574376 ref: gl: make use of new TF_ALLOW_NEAREST_TOGGLE flag 2024-01-29 05:50:59 +03:00
Alibek Omarov 04f42df7d5 common: render_api: new flag TF_ALLOW_NEAREST_TOGGLE that allows toggling nearest filtering for TF_NOMIPMAP textures 2024-01-29 05:48:42 +03:00
Alibek Omarov ab15662d78 ref: gl: fix toggling nearest filter on TF_NOMIPMAP textures 2024-01-29 05:48:08 +03:00
Alibek Omarov 072b0cef27 ref: gl: small refactoring on filter choosing for newly uploaded texture 2024-01-29 05:47:10 +03:00
Alibek Omarov e274c62cfc ref: gl: use TextureFilteringEnabled to decide whether texture will have nearest filtering or linear 2024-01-29 05:44:14 +03:00
Alibek Omarov a28d45fdb2 engine: console: fix TF_NEAREST missing from quake fixed font 2024-01-29 05:42:22 +03:00
Alibek Omarov 6ca5f7c6fb engine: client: request if font texture has nearest filtering from the renderer 2024-01-29 05:41:16 +03:00
Alibek Omarov af316bff14 engine: client: add hud_scale_minimal_width to limit scaling factor and potentially avoid unsupported hud sprites resolutions 2024-01-29 04:58:07 +03:00
Alibek Omarov c8945caefc engine: net_buffer: remove unused MSG_SeekToByte 2024-01-28 20:01:29 +03:00
Alibek Omarov 8c61a2f021 engine: server: cleanup server.h header from unused functions prototypes 2024-01-28 11:35:53 +03:00
Alibek Omarov 0b24810927 engine: client: clean up client.h from unused function prototypes, or move them to appropriate C file 2024-01-28 11:17:06 +03:00
Alibek Omarov b3d8fb03bf engine: client: add generic handler for simple types of screenshots commands 2024-01-28 10:43:37 +03:00
Alibek Omarov 02c5890c2f ref: soft: cleanup after RefAPI changes, remove unused functions 2024-01-28 10:00:51 +03:00
Alibek Omarov 0579e40857 engine: server: remove unused DumpHashString function 2024-01-28 10:00:51 +03:00
Alibek Omarov c77f290bc6 engine: remove Netsplit_SendLong, as we're not planning to support old protocol on server side 2024-01-28 10:00:51 +03:00
Alibek Omarov 7bf9407177 ref: gl: remove R_TextureRandomTiling, it's handled by R_TextureAnimation (random tiling as a feature still broken) 2024-01-28 10:00:51 +03:00
Alibek Omarov b41fe076ae engine: server: exclude expired IP filters from check 2024-01-28 10:00:51 +03:00
Alibek Omarov a7c422fde6 engine: platform: make Platform_SetTimer static inline to not fix unused-function 2024-01-28 10:00:51 +03:00
Alibek Omarov 568a394a40 wscript: enable -Wunused-functions 2024-01-28 10:00:51 +03:00
Alibek Omarov 2b6a550405 engine: clean up common.h header from unused function prototypes, or move them to appropriate header or C file 2024-01-28 10:00:17 +03:00
Alibek Omarov 7200f0da7e 3rdparty: gl-wes-v2: update 2024-01-28 09:55:18 +03:00
Alibek Omarov d3c3c26618 ref: gl: vgl_shim: fix -Wmissing-prototypes 2024-01-28 09:55:18 +03:00
Alibek Omarov 7152393089 ref: soft: fix -Wmissing-prototypes 2024-01-28 09:55:18 +03:00
Alibek Omarov 661e60720d ref: gl: fix -Wmissing-prototypes 2024-01-28 09:55:18 +03:00
Alibek Omarov bf959da7ff engine: libmpg: fix -Wmissing-prototypes 2024-01-28 09:55:18 +03:00
Alibek Omarov 75d476f9df engine: fix -Wmissing-prototypes 2024-01-28 09:55:18 +03:00
Alibek Omarov b077822f4d filesystem: fix -Wmissing-prototypes 2024-01-28 09:55:18 +03:00
Alibek Omarov 6d3f188675 public: fix -Wmissing-prototypes 2024-01-28 09:55:18 +03:00
Alibek Omarov 0231f5e8ac wscript: warn about missing-prototypes by default for C 2024-01-28 09:55:18 +03:00
Alibek Omarov 901b35d4b1 ref: soft: rework @SNMetamorph's fix for avoiding crash when no world is set (like Customize menu with enabled 3D view) 2024-01-27 17:31:34 +03:00
Alibek Omarov eaafd0ff13 ref: gl: rework @SNMetamorph's fix for avoiding crash when no world is set (like Customize menu with enabled 3D view) 2024-01-27 17:31:26 +03:00
Alibek Omarov 963d9b8f2a ref: soft: remove useless R_CountDynamicLights function 2024-01-27 17:16:01 +03:00
Alibek Omarov 5696c9c96a ref: gl: remove useless R_CountDynamicLights function 2024-01-27 17:15:57 +03:00
Alibek Omarov 862b9e68be engine: server: fix possible null pointer dereference 2024-01-25 16:21:55 +03:00
Alibek Omarov 2f2890cd11 engine: client: use PARM_TEX_FILTERING to figure out whether we should apply half-texel trick to HUD textures when scaling 2024-01-25 05:50:11 +03:00
Alibek Omarov 482aa840e7 ref: soft: add PARM_TEX_FILTERING handler (stub) 2024-01-25 05:47:12 +03:00
Alibek Omarov 4599983c8e ref: gl: add PARM_TEX_FILTERING handler 2024-01-25 05:46:54 +03:00
Alibek Omarov 11172838f2 engine: ref_api: add PARM_TEX_FILTERING into RefAPI to query if filtering is enabled for selected texture 2024-01-25 05:43:51 +03:00
Alibek Omarov 47bc50b8c6 engine: client: fix taking console color from colors.lst 2024-01-25 04:22:20 +03:00
Alibek Omarov 7c82766a5c readme: add sourcehut builds badge [skip ci] 2024-01-24 21:10:21 +03:00
Alibek Omarov 5d6cf62405 engine: client: voice: open microphone only after server sends svc_voiceinit to us and shutdown immediately after disconnect 2024-01-24 20:52:21 +03:00
Alibek Omarov edc08e39ef common: move FORCEINLINE from port.h to xash3d_types.h, alongside other compiler-specific attributes 2024-01-24 20:51:34 +03:00
Alibek Omarov a9846e765d waf: upgrade to latest waifu 2024-01-23 21:34:49 +03:00
Alibek Omarov aa54309d5c engine: wscript: fix pthreads check by explicitly checking it in C mode 2024-01-23 21:23:23 +03:00
Alibek Omarov 443317bedf wscript: fix RPATH under OpenBSD 2024-01-23 21:03:10 +03:00
Alibek Omarov ffd320507f ci: enable builds.sr.ht 2024-01-23 20:42:09 +03:00
Alibek Omarov 60df08c11c engine: crashhandler: fix build for NetBSD AMD64 2024-01-23 20:25:17 +03:00
Alibek Omarov 7d464df107 engine: platform: linux: define portability macro for sigevent (oh, glibc...) 2024-01-23 19:22:56 +03:00
Alibek Omarov 296f89acf9 engine: platform: linux: fix build with musl (and probably other libcs) using portability macro 2024-01-23 18:57:33 +03:00
mittornandAlibek Omarov 5f31417bae ref_gl: fix missing vboarray split transition on some maps 2024-01-19 21:28:49 +03:00
Alibek Omarov 150d98bd15 ref: gl: fix stuck single lightmap texture object when using VBO after updating lightmap 2024-01-19 09:57:11 +03:00
Alibek Omarov f162fbd806 ref: gl: fix fog with enabled overbrights and no vbo 2024-01-19 06:19:42 +03:00
134 changed files with 1378 additions and 1529 deletions
+27
View File
@@ -0,0 +1,27 @@
image: alpine/latest
packages:
- build-base
- sdl2-dev
- freetype-dev
- fontconfig-dev
- opus-dev
sources:
- https://git.sr.ht/~a1batross/xash3d-fwgs
tasks:
- client: |
cd xash3d-fwgs
./waf configure -8 --enable-tests --enable-engine-tests build install --destdir=bin
- server: |
cd xash3d-fwgs
./waf configure --reconfigure --dedicated build install --destdir=bin
- run-tests: |
cd xash3d-fwgs/bin
export SDL_VIDEODRIVER=wayland
./xash3d -runtests
./xash -runtests
rm -rf valve/gameinfo.txt test_*
- package: |
cd xash3d-fwgs/bin
tar -cjvf xash3d-fwgs-alpine-amd64.tar.bz2 *
artifacts:
- xash3d-fwgs/bin/xash3d-fwgs-alpine-amd64.tar.bz2
+30
View File
@@ -0,0 +1,30 @@
image: debian/sid
arch: amd64
packages:
- build-essential
- python-is-python3
- libsdl2-dev
- libfreetype-dev
- libfontconfig-dev
- libopus-dev
sources:
- https://git.sr.ht/~a1batross/xash3d-fwgs
tasks:
- client: |
cd xash3d-fwgs
./waf configure -8 --enable-tests --enable-engine-tests build install --destdir=bin
- server: |
cd xash3d-fwgs
./waf configure --reconfigure --dedicated build install --destdir=bin
- run-tests: |
cd xash3d-fwgs/bin
export SDL_VIDEODRIVER=wayland
./xash3d -runtests
./xash -runtests
rm -rf valve/gameinfo.txt test_*
- package: |
cd xash3d-fwgs/bin
tar -cjvf xash3d-fwgs-debian-arm64.tar.bz2 *
artifacts:
- xash3d-fwgs/bin/xash3d-fwgs-debian-arm64.tar.bz2
+29
View File
@@ -0,0 +1,29 @@
image: debian/sid
packages:
- build-essential
- python-is-python3
- libsdl2-dev
- libfreetype-dev
- libfontconfig-dev
- libopus-dev
sources:
- https://git.sr.ht/~a1batross/xash3d-fwgs
tasks:
- client: |
cd xash3d-fwgs
./waf configure -8 --enable-tests --enable-engine-tests build install --destdir=bin
- server: |
cd xash3d-fwgs
./waf configure --reconfigure --dedicated build install --destdir=bin
- run-tests: |
cd xash3d-fwgs/bin
export SDL_VIDEODRIVER=wayland
./xash3d -runtests
./xash -runtests
rm -rf valve/gameinfo.txt test_*
- package: |
cd xash3d-fwgs/bin
tar -cjvf xash3d-fwgs-debian-amd64.tar.bz2 *
artifacts:
- xash3d-fwgs/bin/xash3d-fwgs-debian-amd64.tar.bz2
+29
View File
@@ -0,0 +1,29 @@
image: freebsd/latest
packages:
- lang/python
- devel/pkgconf
- devel/sdl20
- print/freetype2
- x11-fonts/fontconfig
- audio/opus
sources:
- https://git.sr.ht/~a1batross/xash3d-fwgs
tasks:
- client: |
cd xash3d-fwgs
./waf configure --enable-tests --enable-engine-tests build install --destdir=bin
- server: |
cd xash3d-fwgs
./waf configure --reconfigure --dedicated build install --destdir=bin
- run-tests: |
cd xash3d-fwgs/bin
export SDL_VIDEODRIVER=wayland
./xash3d -runtests
./xash -runtests
rm -rf valve/gameinfo.txt test_*
- package: |
cd xash3d-fwgs/bin
tar -cjvf xash3d-fwgs-freebsd-amd64.tar.bz2 *
artifacts:
- xash3d-fwgs/bin/xash3d-fwgs-freebsd-amd64.tar.bz2
+29
View File
@@ -0,0 +1,29 @@
image: netbsd/latest
packages:
- python311
- SDL2
- freetype2
- fontconfig
- libopus
- pkgconf
sources:
- https://git.sr.ht/~a1batross/xash3d-fwgs
tasks:
- client: |
cd xash3d-fwgs
python3.11 waf configure --enable-tests --enable-engine-tests build install --destdir=bin
- server: |
cd xash3d-fwgs
python3.11 waf configure --reconfigure --dedicated build install --destdir=bin
- run-tests: |
cd xash3d-fwgs/bin
export SDL_VIDEODRIVER=wayland
./xash3d -runtests
./xash -runtests
rm -rf valve/gameinfo.txt test_*
- package: |
cd xash3d-fwgs/bin
tar -cjvf xash3d-fwgs-netbsd-amd64.tar.bz2 *
artifacts:
- xash3d-fwgs/bin/xash3d-fwgs-netbsd-amd64.tar.bz2
+26
View File
@@ -0,0 +1,26 @@
image: openbsd/latest
packages:
- python3
- sdl2
- opus
sources:
- https://git.sr.ht/~a1batross/xash3d-fwgs
tasks:
- client: |
cd xash3d-fwgs
python3 waf configure --enable-tests --enable-engine-tests build install --destdir=bin
- server: |
cd xash3d-fwgs
python3 waf configure --reconfigure --dedicated build install --destdir=bin
- run-tests: |
cd xash3d-fwgs/bin
export SDL_VIDEODRIVER=wayland
./xash3d -runtests
./xash -runtests
rm -rf valve/gameinfo.txt test_*
- package: |
cd xash3d-fwgs/bin
tar -cjvf xash3d-fwgs-openbsd-amd64.tar.bz2 *
artifacts:
- xash3d-fwgs/bin/xash3d-fwgs-openbsd-amd64.tar.bz2
+1 -1
View File
@@ -18,7 +18,7 @@ def build(bld):
target = 'gl4es', target = 'gl4es',
features = 'c', features = 'c',
includes = ['gl4es/src', 'gl4es/src/gl', 'gl4es/src/glx', 'gl4es/include'], includes = ['gl4es/src', 'gl4es/src/gl', 'gl4es/src/glx', 'gl4es/include'],
defines = ['NOX11', 'NO_GBM', 'NO_INIT_CONSTRUCTOR', 'DEFAULT_ES=2', 'NOEGL', 'EXTERNAL_GETPROCADDRESS=GL4ES_GetProcAddress', 'NO_LOADER', 'STATICLIB'], defines = ['NOX11', 'NO_GBM', 'NO_INIT_CONSTRUCTOR', 'DEFAULT_ES=2', 'NOEGL', 'NO_LOADER', 'STATICLIB'],
cflags = ['-w', '-fvisibility=hidden', '-std=gnu99'], cflags = ['-w', '-fvisibility=hidden', '-std=gnu99'],
subsystem = bld.env.MSVC_SUBSYSTEM, subsystem = bld.env.MSVC_SUBSYSTEM,
export_includes = '.') export_includes = '.')
+1 -1
View File
@@ -1,5 +1,5 @@
# Xash3D FWGS Engine <img align="right" width="128" height="128" src="https://github.com/FWGS/xash3d-fwgs/raw/master/game_launch/icon-xash-material.png" alt="Xash3D FWGS icon" /> # Xash3D FWGS Engine <img align="right" width="128" height="128" src="https://github.com/FWGS/xash3d-fwgs/raw/master/game_launch/icon-xash-material.png" alt="Xash3D FWGS icon" />
[![GitHub Actions Status](https://github.com/FWGS/xash3d-fwgs/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/FWGS/xash3d-fwgs/actions/workflows/c-cpp.yml) [![FreeBSD Build Status](https://img.shields.io/cirrus/github/FWGS/xash3d-fwgs?label=freebsd%20build)](https://cirrus-ci.com/github/FWGS/xash3d-fwgs) [![Discord Server](https://img.shields.io/discord/355697768582610945.svg)](http://fwgsdiscord.mentality.rip/) \ [![builds.sr.ht status](https://builds.sr.ht/~a1batross/xash3d-fwgs.svg)](https://builds.sr.ht/~a1batross/xash3d-fwgs?) [![GitHub Actions Status](https://github.com/FWGS/xash3d-fwgs/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/FWGS/xash3d-fwgs/actions/workflows/c-cpp.yml) [![FreeBSD Build Status](https://img.shields.io/cirrus/github/FWGS/xash3d-fwgs?label=freebsd%20build)](https://cirrus-ci.com/github/FWGS/xash3d-fwgs) [![Discord Server](https://img.shields.io/discord/355697768582610945.svg)](http://fwgsdiscord.mentality.rip/) \
[![Download Stable](https://img.shields.io/badge/download-stable-yellow)](https://github.com/FWGS/xash3d-fwgs/releases/latest) [![Download Testing](https://img.shields.io/badge/downloads-testing-orange)](https://github.com/FWGS/xash3d-fwgs/releases/tag/continuous) [![Download Stable](https://img.shields.io/badge/download-stable-yellow)](https://github.com/FWGS/xash3d-fwgs/releases/latest) [![Download Testing](https://img.shields.io/badge/downloads-testing-orange)](https://github.com/FWGS/xash3d-fwgs/releases/tag/continuous)
Xash3D FWGS is a game engine, aimed to provide compatibility with Half-Life Engine and extend it, as well as to give game developers well known workflow. Xash3D FWGS is a game engine, aimed to provide compatibility with Half-Life Engine and extend it, as well as to give game developers well known workflow.
-8
View File
@@ -35,7 +35,6 @@ GNU General Public License for more details.
#define __cdecl #define __cdecl
#define __stdcall #define __stdcall
#define _inline static inline #define _inline static inline
#define FORCEINLINE inline __attribute__((always_inline))
#if XASH_POSIX #if XASH_POSIX
#include <unistd.h> #include <unistd.h>
@@ -63,13 +62,6 @@ GNU General Public License for more details.
int x, y; int x, y;
} POINT; } POINT;
#else // WIN32 #else // WIN32
#ifdef __MINGW32__
#define _inline static inline
#define FORCEINLINE inline __attribute__((always_inline))
#else
#define FORCEINLINE __forceinline
#endif
#define open _open #define open _open
#define read _read #define read _read
#define alloca _alloca #define alloca _alloca
+2 -1
View File
@@ -107,7 +107,8 @@ typedef enum
TF_ARB_FLOAT = (1<<26), // float textures TF_ARB_FLOAT = (1<<26), // float textures
TF_NOCOMPARE = (1<<27), // disable comparing for depth textures TF_NOCOMPARE = (1<<27), // disable comparing for depth textures
TF_ARB_16BIT = (1<<28), // keep image as 16-bit (not 24) TF_ARB_16BIT = (1<<28), // keep image as 16-bit (not 24)
TF_MULTISAMPLE = (1<<29) // multisampling texture TF_MULTISAMPLE = (1<<29), // multisampling texture
TF_ALLOW_NEAREST = (1<<30), // allows toggling nearest filtering for TF_NOMIPMAP textures
} texFlags_t; } texFlags_t;
typedef enum typedef enum
+6
View File
@@ -86,6 +86,8 @@ typedef uint64_t longtime_t;
#define NORETURN __attribute__((noreturn)) #define NORETURN __attribute__((noreturn))
#define NONNULL __attribute__((nonnull)) #define NONNULL __attribute__((nonnull))
#define ALLOC_CHECK(x) __attribute__((alloc_size(x))) #define ALLOC_CHECK(x) __attribute__((alloc_size(x)))
#define FORCEINLINE inline __attribute__((always_inline))
#define NOINLINE __attribute__((noinline))
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define EXPORT __declspec( dllexport ) #define EXPORT __declspec( dllexport )
#define GAME_EXPORT #define GAME_EXPORT
@@ -93,6 +95,8 @@ typedef uint64_t longtime_t;
#define NORETURN #define NORETURN
#define NONNULL #define NONNULL
#define ALLOC_CHECK(x) #define ALLOC_CHECK(x)
#define FORCEINLINE __forceinline
#define NOINLINE __declspec( noinline )
#else #else
#define EXPORT #define EXPORT
#define GAME_EXPORT #define GAME_EXPORT
@@ -100,6 +104,8 @@ typedef uint64_t longtime_t;
#define NORETURN #define NORETURN
#define NONNULL #define NONNULL
#define ALLOC_CHECK(x) #define ALLOC_CHECK(x)
#define FORCEINLINE
#define NOINLINE
#endif #endif
#if ( __GNUC__ >= 3 ) #if ( __GNUC__ >= 3 )
+92 -156
View File
@@ -157,32 +157,12 @@ void CL_PlayCDTrack_f( void )
CL_ScreenshotGetName CL_ScreenshotGetName
================== ==================
*/ */
static qboolean CL_ScreenshotGetName( int lastnum, char *filename, size_t size ) static qboolean CL_ScreenshotGetName( const char *fmt, int lastnum, char *filename, size_t size )
{ {
if( lastnum < 0 || lastnum > 9999 ) if( lastnum < 0 || lastnum > 9999 )
{
Con_Printf( S_ERROR "unable to write screenshot\n" );
return false; return false;
}
return Q_snprintf( filename, size, "scrshots/%s_shot%04d.png", clgame.mapname, lastnum ) > 0; return Q_snprintf( filename, size, fmt, clgame.mapname, lastnum ) > 0;
}
/*
==================
CL_SnapshotGetName
==================
*/
static qboolean CL_SnapshotGetName( int lastnum, char *filename, size_t size )
{
if( lastnum < 0 || lastnum > 9999 )
{
Con_Printf( S_ERROR "unable to write snapshot\n" );
FS_AllowDirectPaths( false );
return false;
}
return Q_snprintf( filename, size, "../%s_%04d.png", clgame.mapname, lastnum ) > 0;
} }
/* /*
@@ -192,127 +172,6 @@ static qboolean CL_SnapshotGetName( int lastnum, char *filename, size_t size )
============================================================================== ==============================================================================
*/ */
/*
==================
CL_ScreenShot_f
normal screenshot
==================
*/
void CL_ScreenShot_f( void )
{
int i;
string checkname;
if( CL_IsDevOverviewMode() == 1 )
{
// special case for write overview image and script file
Q_snprintf( cls.shotname, sizeof( cls.shotname ), "overviews/%s.bmp", clgame.mapname );
cls.scrshot_action = scrshot_mapshot; // build new frame for mapshot
}
else
{
// scan for a free filename
for( i = 0; i < 9999; i++ )
{
if( !CL_ScreenshotGetName( i, checkname, sizeof( checkname )))
return; // no namespace
if( !FS_FileExists( checkname, true ))
break;
}
Q_strncpy( cls.shotname, checkname, sizeof( cls.shotname ));
cls.scrshot_action = scrshot_normal; // build new frame for screenshot
}
cls.envshot_vieworg = NULL; // no custom view
cls.envshot_viewsize = 0;
}
/*
==================
CL_SnapShot_f
save screenshots into root dir
==================
*/
void CL_SnapShot_f( void )
{
int i;
string checkname;
if( CL_IsDevOverviewMode() == 1 )
{
// special case for write overview image and script file
Q_snprintf( cls.shotname, sizeof( cls.shotname ), "overviews/%s.bmp", clgame.mapname );
cls.scrshot_action = scrshot_mapshot; // build new frame for mapshot
}
else
{
FS_AllowDirectPaths( true );
// scan for a free filename
for( i = 0; i < 9999; i++ )
{
if( !CL_SnapshotGetName( i, checkname, sizeof( checkname )))
return; // no namespace
if( !FS_FileExists( checkname, true ))
break;
}
FS_AllowDirectPaths( false );
Q_strncpy( cls.shotname, checkname, sizeof( cls.shotname ));
cls.scrshot_action = scrshot_snapshot; // build new frame for screenshot
}
cls.envshot_vieworg = NULL; // no custom view
cls.envshot_viewsize = 0;
}
/*
==================
CL_EnvShot_f
cubemap view
==================
*/
void CL_EnvShot_f( void )
{
if( Cmd_Argc() < 2 )
{
Con_Printf( S_USAGE "envshot <shotname>\n" );
return;
}
Q_snprintf( cls.shotname, sizeof( cls.shotname ), "gfx/env/%s", Cmd_Argv( 1 ));
cls.scrshot_action = scrshot_envshot; // build new frame for envshot
cls.envshot_vieworg = NULL; // no custom view
cls.envshot_viewsize = 0;
}
/*
==================
CL_SkyShot_f
skybox view
==================
*/
void CL_SkyShot_f( void )
{
if( Cmd_Argc() < 2 )
{
Con_Printf( S_USAGE "skyshot <shotname>\n" );
return;
}
Q_snprintf( cls.shotname, sizeof( cls.shotname ),"gfx/env/%s", Cmd_Argv( 1 ));
cls.scrshot_action = scrshot_skyshot; // build new frame for skyshot
cls.envshot_vieworg = NULL; // no custom view
cls.envshot_viewsize = 0;
}
/* /*
================== ==================
CL_LevelShot_f CL_LevelShot_f
@@ -355,23 +214,100 @@ void CL_LevelShot_f( void )
else cls.scrshot_action = scrshot_inactive; // disable - not needs else cls.scrshot_action = scrshot_inactive; // disable - not needs
} }
/* static scrshot_t CL_GetScreenshotTypeFromString( const char *string )
==================
CL_SaveShot_f
mini-pic in loadgame menu
==================
*/
void CL_SaveShot_f( void )
{ {
if( Cmd_Argc() < 2 ) if( !Q_stricmp( string, "snapshot" ))
return scrshot_snapshot;
if( !Q_stricmp( string, "screenshot" ))
return scrshot_normal;
if( !Q_stricmp( string, "saveshot" ))
return scrshot_savegame;
if( !Q_stricmp( string, "envshot" ))
return scrshot_envshot;
if( !Q_stricmp( string, "skyshot" ))
return scrshot_skyshot;
return scrshot_inactive;
}
void CL_GenericShot_f( void )
{
const char *argv0 = Cmd_Argv( 0 );
scrshot_t type;
type = CL_GetScreenshotTypeFromString( argv0 );
if( type == scrshot_normal || type == scrshot_snapshot )
{ {
Con_Printf( S_USAGE "saveshot <savename>\n" ); if( CL_IsDevOverviewMode() == 1 )
return; type = scrshot_mapshot;
}
else
{
if( Cmd_Argc() < 2 )
{
Con_Printf( S_USAGE "%s <shotname>\n", argv0 );
return;
}
} }
Q_snprintf( cls.shotname, sizeof( cls.shotname ), DEFAULT_SAVE_DIRECTORY "%s.bmp", Cmd_Argv( 1 )); switch( type )
cls.scrshot_action = scrshot_savegame; // build new frame for saveshot {
case scrshot_envshot:
case scrshot_skyshot:
Q_snprintf( cls.shotname, sizeof( cls.shotname ), "gfx/env/%s", Cmd_Argv( 1 ));
break;
case scrshot_savegame:
Q_snprintf( cls.shotname, sizeof( cls.shotname ), DEFAULT_SAVE_DIRECTORY "%s.bmp", Cmd_Argv( 1 ));
break;
case scrshot_mapshot:
Q_snprintf( cls.shotname, sizeof( cls.shotname ), "overviews/%s.bmp", clgame.mapname );
break;
case scrshot_normal:
case scrshot_snapshot:
{
const char *fmt;
string checkname;
int i;
if( type == scrshot_snapshot )
{
fmt = "../%s_%04d.png";
FS_AllowDirectPaths( true );
}
else fmt = "scrshots/%s_shot%04d.png";
for( i = 0; i < 9999; i++ )
{
if( !CL_ScreenshotGetName( fmt, i, checkname, sizeof( checkname )))
{
Con_Printf( S_ERROR "unable to write %s\n", argv0 );
FS_AllowDirectPaths( false );
return;
}
if( !FS_FileExists( checkname, true ))
break;
}
FS_AllowDirectPaths( false );
Q_strncpy( cls.shotname, checkname, sizeof( cls.shotname ));
break;
}
case scrshot_inactive:
case scrshot_plaque:
default:
return; // shouldn't happen
}
cls.scrshot_action = type; // build new frame for saveshot
cls.envshot_vieworg = NULL;
cls.envshot_viewsize = 0;
} }
/* /*
+1 -1
View File
@@ -127,7 +127,7 @@ void CL_MoveToOnHandList( resource_t *pResource )
CL_AddToResourceList( pResource, &cl.resourcesonhand ); CL_AddToResourceList( pResource, &cl.resourcesonhand );
} }
void CL_ClearResourceList( resource_t *pList ) static void CL_ClearResourceList( resource_t *pList )
{ {
resource_t *p, *n; resource_t *p, *n;
+19 -17
View File
@@ -107,6 +107,8 @@ struct
int angle_position; int angle_position;
} demo; } demo;
static qboolean CL_NextDemo( void );
/* /*
==================== ====================
CL_StartupDemoHeader CL_StartupDemoHeader
@@ -156,7 +158,7 @@ CL_GetDemoRecordClock
write time while demo is recording write time while demo is recording
==================== ====================
*/ */
float CL_GetDemoRecordClock( void ) static float CL_GetDemoRecordClock( void )
{ {
return cl.mtime[0]; return cl.mtime[0];
} }
@@ -168,7 +170,7 @@ CL_GetDemoPlaybackClock
overwrite host.realtime overwrite host.realtime
==================== ====================
*/ */
float CL_GetDemoPlaybackClock( void ) static float CL_GetDemoPlaybackClock( void )
{ {
return host.realtime + host.frametime; return host.realtime + host.frametime;
} }
@@ -194,7 +196,7 @@ CL_WriteDemoCmdHeader
Writes the demo command header and time-delta Writes the demo command header and time-delta
==================== ====================
*/ */
void CL_WriteDemoCmdHeader( byte cmd, file_t *file ) static void CL_WriteDemoCmdHeader( byte cmd, file_t *file )
{ {
float dt; float dt;
@@ -267,7 +269,7 @@ Save state of cls.netchan sequences
so that we can play the demo correctly. so that we can play the demo correctly.
==================== ====================
*/ */
void CL_WriteDemoSequence( file_t *file ) static void CL_WriteDemoSequence( file_t *file )
{ {
Assert( file != NULL ); Assert( file != NULL );
@@ -348,7 +350,7 @@ CL_WriteDemoHeader
Write demo header Write demo header
==================== ====================
*/ */
void CL_WriteDemoHeader( const char *name ) static void CL_WriteDemoHeader( const char *name )
{ {
int copysize; int copysize;
int savepos; int savepos;
@@ -436,7 +438,7 @@ CL_StopRecord
finish recording demo finish recording demo
================= =================
*/ */
void CL_StopRecord( void ) static void CL_StopRecord( void )
{ {
int i, curpos; int i, curpos;
float stoptime; float stoptime;
@@ -518,7 +520,7 @@ CL_ReadDemoCmdHeader
read the demo command read the demo command
================= =================
*/ */
qboolean CL_ReadDemoCmdHeader( byte *cmd, float *dt ) static qboolean CL_ReadDemoCmdHeader( byte *cmd, float *dt )
{ {
// read the command // read the command
// HACKHACK: skip NOPs // HACKHACK: skip NOPs
@@ -548,7 +550,7 @@ read the demo usercmd for predicting
and smooth movement during playback the demo and smooth movement during playback the demo
================= =================
*/ */
void CL_ReadDemoUserCmd( qboolean discard ) static void CL_ReadDemoUserCmd( qboolean discard )
{ {
byte data[1024]; byte data[1024];
int cmdnumber; int cmdnumber;
@@ -613,7 +615,7 @@ CL_ReadDemoSequence
read netchan sequences read netchan sequences
================= =================
*/ */
void CL_ReadDemoSequence( qboolean discard ) static void CL_ReadDemoSequence( qboolean discard )
{ {
int incoming_sequence; int incoming_sequence;
int incoming_acknowledged; int incoming_acknowledged;
@@ -647,7 +649,7 @@ void CL_ReadDemoSequence( qboolean discard )
CL_DemoStartPlayback CL_DemoStartPlayback
================= =================
*/ */
void CL_DemoStartPlayback( int mode ) static void CL_DemoStartPlayback( int mode )
{ {
if( cls.changedemo ) if( cls.changedemo )
{ {
@@ -692,7 +694,7 @@ void CL_DemoStartPlayback( int mode )
CL_DemoAborted CL_DemoAborted
================= =================
*/ */
void CL_DemoAborted( void ) static void CL_DemoAborted( void )
{ {
if( cls.demofile ) if( cls.demofile )
FS_Close( cls.demofile ); FS_Close( cls.demofile );
@@ -732,7 +734,7 @@ returns true on success, false on failure
g-cont. probably captain obvious mode is ON g-cont. probably captain obvious mode is ON
================= =================
*/ */
qboolean CL_DemoMoveToNextSection( void ) static qboolean CL_DemoMoveToNextSection( void )
{ {
if( ++demo.entryIndex >= demo.directory.numentries ) if( ++demo.entryIndex >= demo.directory.numentries )
{ {
@@ -754,7 +756,7 @@ qboolean CL_DemoMoveToNextSection( void )
return true; return true;
} }
qboolean CL_ReadRawNetworkData( byte *buffer, size_t *length ) static qboolean CL_ReadRawNetworkData( byte *buffer, size_t *length )
{ {
int msglen = 0; int msglen = 0;
@@ -805,7 +807,7 @@ CL_DemoReadMessageQuake
reads demo data and write it to client reads demo data and write it to client
================= =================
*/ */
qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length ) static qboolean CL_DemoReadMessageQuake( byte *buffer, size_t *length )
{ {
vec3_t viewangles; vec3_t viewangles;
int msglen = 0; int msglen = 0;
@@ -1020,7 +1022,7 @@ qboolean CL_DemoReadMessage( byte *buffer, size_t *length )
return CL_ReadRawNetworkData( buffer, length ); return CL_ReadRawNetworkData( buffer, length );
} }
void CL_DemoFindInterpolatedViewAngles( float t, float *frac, demoangle_t **prev, demoangle_t **next ) static void CL_DemoFindInterpolatedViewAngles( float t, float *frac, demoangle_t **prev, demoangle_t **next )
{ {
int i, i0, i1, imod; int i, i0, i1, imod;
float at; float at;
@@ -1115,7 +1117,7 @@ CL_FinishTimeDemo
show stats show stats
============== ==============
*/ */
void CL_FinishTimeDemo( void ) static void CL_FinishTimeDemo( void )
{ {
int frames; int frames;
double time; double time;
@@ -1264,7 +1266,7 @@ CL_NextDemo
Called when a demo finishes Called when a demo finishes
================== ==================
*/ */
qboolean CL_NextDemo( void ) static qboolean CL_NextDemo( void )
{ {
char str[MAX_QPATH]; char str[MAX_QPATH];
+5 -5
View File
@@ -218,7 +218,7 @@ R_AllocTracer
can return NULL if particles is out can return NULL if particles is out
================ ================
*/ */
particle_t *R_AllocTracer( const vec3_t org, const vec3_t vel, float life ) static particle_t *R_AllocTracer( const vec3_t org, const vec3_t vel, float life )
{ {
particle_t *p; particle_t *p;
@@ -300,7 +300,7 @@ R_BeamAlloc
============== ==============
*/ */
BEAM *R_BeamAlloc( void ) static BEAM *R_BeamAlloc( void )
{ {
BEAM *pBeam; BEAM *pBeam;
@@ -323,7 +323,7 @@ R_BeamFree
============== ==============
*/ */
void R_BeamFree( BEAM *pBeam ) static void R_BeamFree( BEAM *pBeam )
{ {
// free particles that have died off. // free particles that have died off.
R_FreeDeadParticles( &pBeam->particles ); R_FreeDeadParticles( &pBeam->particles );
@@ -605,7 +605,7 @@ CL_BeamAttemptToDie
Check for expired beams Check for expired beams
============== ==============
*/ */
qboolean CL_BeamAttemptToDie( BEAM *pBeam ) static qboolean CL_BeamAttemptToDie( BEAM *pBeam )
{ {
Assert( pBeam != NULL ); Assert( pBeam != NULL );
@@ -2040,7 +2040,7 @@ void CL_ReadPointFile_f( void )
else Con_Printf( "map %s has no leaks!\n", clgame.mapname ); else Con_Printf( "map %s has no leaks!\n", clgame.mapname );
} }
void CL_FreeDeadBeams( void ) static void CL_FreeDeadBeams( void )
{ {
BEAM *pBeam, *pNext, *pPrev = NULL; BEAM *pBeam, *pNext, *pPrev = NULL;
// draw temporary entity beams // draw temporary entity beams
+6 -6
View File
@@ -40,7 +40,7 @@ CL_CalcPlayerVelocity
compute velocity for a given client compute velocity for a given client
============= =============
*/ */
void CL_CalcPlayerVelocity( int idx, vec3_t velocity ) static void CL_CalcPlayerVelocity( int idx, vec3_t velocity )
{ {
clientdata_t *pcd; clientdata_t *pcd;
vec3_t delta; vec3_t delta;
@@ -78,7 +78,7 @@ CL_DescribeEvent
============= =============
*/ */
void CL_DescribeEvent( event_info_t *ei, int slot ) static void CL_DescribeEvent( event_info_t *ei, int slot )
{ {
int idx = (slot & 63) * 2; int idx = (slot & 63) * 2;
con_nprint_t info; con_nprint_t info;
@@ -202,7 +202,7 @@ CL_FireEvent
============= =============
*/ */
qboolean CL_FireEvent( event_info_t *ei, int slot ) static qboolean CL_FireEvent( event_info_t *ei, int slot )
{ {
cl_user_event_t *ev; cl_user_event_t *ev;
const char *name; const char *name;
@@ -292,7 +292,7 @@ CL_FindEvent
find first empty event find first empty event
============= =============
*/ */
event_info_t *CL_FindEmptyEvent( void ) static event_info_t *CL_FindEmptyEvent( void )
{ {
int i; int i;
event_state_t *es; event_state_t *es;
@@ -320,7 +320,7 @@ CL_FindEvent
replace only unreliable events replace only unreliable events
============= =============
*/ */
event_info_t *CL_FindUnreliableEvent( void ) static event_info_t *CL_FindUnreliableEvent( void )
{ {
event_state_t *es; event_state_t *es;
event_info_t *ei; event_info_t *ei;
@@ -350,7 +350,7 @@ CL_QueueEvent
============= =============
*/ */
void CL_QueueEvent( int flags, int index, float delay, event_args_t *args ) static void CL_QueueEvent( int flags, int index, float delay, event_args_t *args )
{ {
event_info_t *ei; event_info_t *ei;
+1 -3
View File
@@ -60,7 +60,6 @@ qboolean Con_LoadFixedWidthFont( const char *fontname, cl_font_t *font, float sc
font->type = FONT_FIXED; font->type = FONT_FIXED;
font->valid = true; font->valid = true;
font->scale = scale; font->scale = scale;
font->nearest = FBitSet( texFlags, TF_NEAREST );
font->rendermode = rendermode; font->rendermode = rendermode;
font->charHeight = Q_rint( font_width / 16 * scale ); font->charHeight = Q_rint( font_width / 16 * scale );
@@ -107,7 +106,6 @@ qboolean Con_LoadVariableWidthFont( const char *fontname, cl_font_t *font, float
font->type = FONT_VARIABLE; font->type = FONT_VARIABLE;
font->valid = true; font->valid = true;
font->scale = scale; font->scale = scale;
font->nearest = FBitSet( texFlags, TF_NEAREST );
font->rendermode = rendermode; font->rendermode = rendermode;
font->charHeight = Q_rint( src.rowheight * scale ); font->charHeight = Q_rint( src.rowheight * scale );
@@ -179,7 +177,7 @@ int CL_DrawCharacter( float x, float y, int number, rgba_t color, cl_font_t *fon
return font->charWidths[number]; return font->charWidths[number];
rc = &font->fontRc[number]; rc = &font->fontRc[number];
if( font->nearest || font->scale <= 1.0f ) if( font->scale <= 1.0f || REF_GET_PARM( PARM_TEX_FILTERING, font->hFontTexture ))
half = 0; half = 0;
s1 = ((float)rc->left + half ) / texw; s1 = ((float)rc->left + half ) / texw;
+15 -21
View File
@@ -52,7 +52,7 @@ CL_UpdatePositions
Store another position into interpolation circular buffer Store another position into interpolation circular buffer
================== ==================
*/ */
void CL_UpdatePositions( cl_entity_t *ent ) static void CL_UpdatePositions( cl_entity_t *ent )
{ {
position_history_t *ph, *prev; position_history_t *ph, *prev;
@@ -85,7 +85,7 @@ CL_ResetPositions
Interpolation init or reset after teleporting Interpolation init or reset after teleporting
================== ==================
*/ */
void CL_ResetPositions( cl_entity_t *ent ) static void CL_ResetPositions( cl_entity_t *ent )
{ {
position_history_t store; position_history_t store;
@@ -107,7 +107,7 @@ check for instant movement in case
we don't want interpolate this we don't want interpolate this
================== ==================
*/ */
qboolean CL_EntityTeleported( cl_entity_t *ent ) static qboolean CL_EntityTeleported( cl_entity_t *ent )
{ {
float len, maxlen; float len, maxlen;
vec3_t delta; vec3_t delta;
@@ -128,7 +128,7 @@ CL_CompareTimestamps
round-off floating errors round-off floating errors
================== ==================
*/ */
qboolean CL_CompareTimestamps( float t1, float t2 ) static qboolean CL_CompareTimestamps( float t1, float t2 )
{ {
int iTime1 = t1 * 1000; int iTime1 = t1 * 1000;
int iTime2 = t2 * 1000; int iTime2 = t2 * 1000;
@@ -143,7 +143,7 @@ CL_EntityIgnoreLerp
some ents will be ignore lerping some ents will be ignore lerping
================== ==================
*/ */
qboolean CL_EntityIgnoreLerp( cl_entity_t *e ) static qboolean CL_EntityIgnoreLerp( cl_entity_t *e )
{ {
if( cl_nointerp.value > 0.f ) if( cl_nointerp.value > 0.f )
return true; return true;
@@ -160,7 +160,7 @@ CL_EntityCustomLerp
================== ==================
*/ */
qboolean CL_EntityCustomLerp( cl_entity_t *e ) static qboolean CL_EntityCustomLerp( cl_entity_t *e )
{ {
switch( e->curstate.movetype ) switch( e->curstate.movetype )
{ {
@@ -226,7 +226,7 @@ CL_UpdateLatchedVars
==================== ====================
*/ */
void CL_UpdateLatchedVars( cl_entity_t *ent ) static void CL_UpdateLatchedVars( cl_entity_t *ent )
{ {
if( !ent->model || ( ent->model->type != mod_alias && ent->model->type != mod_studio )) if( !ent->model || ( ent->model->type != mod_alias && ent->model->type != mod_studio ))
return; // below fields used only for alias and studio interpolation return; // below fields used only for alias and studio interpolation
@@ -321,7 +321,7 @@ CL_ProcessEntityUpdate
apply changes since new frame received apply changes since new frame received
================== ==================
*/ */
void CL_ProcessEntityUpdate( cl_entity_t *ent ) static void CL_ProcessEntityUpdate( cl_entity_t *ent )
{ {
qboolean parametric; qboolean parametric;
@@ -585,7 +585,7 @@ CL_ProcessPlayerState
process player states after the new packet has received process player states after the new packet has received
================= =================
*/ */
void CL_ProcessPlayerState( int playerindex, entity_state_t *state ) static void CL_ProcessPlayerState( int playerindex, entity_state_t *state )
{ {
entity_state_t *ps; entity_state_t *ps;
@@ -605,7 +605,7 @@ reset latched state if this frame entity was teleported
or just EF_NOINTERP was set or just EF_NOINTERP was set
================= =================
*/ */
void CL_ResetLatchedState( int pnum, frame_t *frame, cl_entity_t *ent ) static void CL_ResetLatchedState( int pnum, frame_t *frame, cl_entity_t *ent )
{ {
if( CHECKVISBIT( frame->flags, pnum )) if( CHECKVISBIT( frame->flags, pnum ))
{ {
@@ -695,7 +695,7 @@ CL_FlushEntityPacket
Read and ignore whole entity packet. Read and ignore whole entity packet.
================= =================
*/ */
void CL_FlushEntityPacket( sizebuf_t *msg ) static void CL_FlushEntityPacket( sizebuf_t *msg )
{ {
int newnum; int newnum;
entity_state_t from, to; entity_state_t from, to;
@@ -725,7 +725,7 @@ CL_DeltaEntity
processing delta update processing delta update
================= =================
*/ */
void CL_DeltaEntity( sizebuf_t *msg, frame_t *frame, int newnum, entity_state_t *old, qboolean has_update ) static void CL_DeltaEntity( sizebuf_t *msg, frame_t *frame, int newnum, entity_state_t *old, qboolean has_update )
{ {
cl_entity_t *ent; cl_entity_t *ent;
entity_state_t *state; entity_state_t *state;
@@ -1057,7 +1057,7 @@ CL_LinkCustomEntity
Add server beam to draw list Add server beam to draw list
============= =============
*/ */
void CL_LinkCustomEntity( cl_entity_t *ent, entity_state_t *state ) static void CL_LinkCustomEntity( cl_entity_t *ent, entity_state_t *state )
{ {
ent->curstate.movetype = state->modelindex; // !!! ent->curstate.movetype = state->modelindex; // !!!
@@ -1080,7 +1080,7 @@ Create visible entities in the correct position
for all current players for all current players
============= =============
*/ */
void CL_LinkPlayers( frame_t *frame ) static void CL_LinkPlayers( frame_t *frame )
{ {
entity_state_t *state; entity_state_t *state;
cl_entity_t *ent; cl_entity_t *ent;
@@ -1163,7 +1163,7 @@ CL_LinkPacketEntities
=============== ===============
*/ */
void CL_LinkPacketEntities( frame_t *frame ) static void CL_LinkPacketEntities( frame_t *frame )
{ {
cl_entity_t *ent; cl_entity_t *ent;
entity_state_t *state; entity_state_t *state;
@@ -1492,9 +1492,3 @@ qboolean CL_GetMovieSpatialization( rawchan_t *ch )
return true; return true;
} }
void CL_ExtraUpdate( void )
{
clgame.dllFuncs.IN_Accumulate();
S_ExtraUpdate();
}
+107 -21
View File
@@ -357,20 +357,23 @@ void SPR_AdjustSize( float *x, float *y, float *w, float *h )
*h *= yscale; *h *= yscale;
} }
void SPR_AdjustTexCoords( float width, float height, float *s1, float *t1, float *s2, float *t2 ) static void SPR_AdjustTexCoords( int texnum, float width, float height, float *s1, float *t1, float *s2, float *t2 )
{ {
if( refState.width != clgame.scrInfo.iWidth ) if( REF_GET_PARM( PARM_TEX_FILTERING, texnum ))
{ {
// align to texel if scaling if( refState.width != clgame.scrInfo.iWidth )
*s1 += 0.5f; {
*s2 -= 0.5f; // align to texel if scaling
} *s1 += 0.5f;
*s2 -= 0.5f;
}
if( refState.height != clgame.scrInfo.iHeight ) if( refState.height != clgame.scrInfo.iHeight )
{ {
// align to texel if scaling // align to texel if scaling
*t1 += 0.5f; *t1 += 0.5f;
*t2 -= 0.5f; *t2 -= 0.5f;
}
} }
*s1 /= width; *s1 /= width;
@@ -402,6 +405,8 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
height = h; height = h;
} }
texnum = ref.dllFuncs.R_GetSpriteTexture( clgame.ds.pSprite, frame );
if( prc ) if( prc )
{ {
wrect_t rc = *prc; wrect_t rc = *prc;
@@ -418,7 +423,7 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
t2 = rc.bottom; t2 = rc.bottom;
// calc user-defined rectangle // calc user-defined rectangle
SPR_AdjustTexCoords( width, height, &s1, &t1, &s2, &t2 ); SPR_AdjustTexCoords( texnum, width, height, &s1, &t1, &s2, &t2 );
width = rc.right - rc.left; width = rc.right - rc.left;
height = rc.bottom - rc.top; height = rc.bottom - rc.top;
} }
@@ -434,7 +439,6 @@ static void SPR_DrawGeneric( int frame, float x, float y, float width, float hei
// scale for screen sizes // scale for screen sizes
SPR_AdjustSize( &x, &y, &width, &height ); SPR_AdjustSize( &x, &y, &width, &height );
texnum = ref.dllFuncs.R_GetSpriteTexture( clgame.ds.pSprite, frame );
ref.dllFuncs.Color4ub( clgame.ds.spriteColor[0], clgame.ds.spriteColor[1], clgame.ds.spriteColor[2], clgame.ds.spriteColor[3] ); ref.dllFuncs.Color4ub( clgame.ds.spriteColor[0], clgame.ds.spriteColor[1], clgame.ds.spriteColor[2], clgame.ds.spriteColor[3] );
ref.dllFuncs.R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, texnum ); ref.dllFuncs.R_DrawStretchPic( x, y, width, height, s1, t1, s2, t2, texnum );
} }
@@ -547,7 +551,7 @@ fill screen with specfied color
can be modulated can be modulated
============= =============
*/ */
void CL_DrawScreenFade( void ) static void CL_DrawScreenFade( void )
{ {
screenfade_t *sf = &clgame.fade; screenfade_t *sf = &clgame.fade;
int alpha; int alpha;
@@ -763,7 +767,7 @@ CL_SoundFromIndex
return soundname from index return soundname from index
==================== ====================
*/ */
const char *CL_SoundFromIndex( int index ) static const char *CL_SoundFromIndex( int index )
{ {
sfx_t *sfx = NULL; sfx_t *sfx = NULL;
int hSound; int hSound;
@@ -909,7 +913,7 @@ CL_DrawCrosshair
Render crosshair Render crosshair
==================== ====================
*/ */
void CL_DrawCrosshair( void ) static void CL_DrawCrosshair( void )
{ {
int x, y, width, height; int x, y, width, height;
float xscale, yscale; float xscale, yscale;
@@ -1326,6 +1330,7 @@ pfnSPR_Load
function exported for support GoldSrc Monitor utility function exported for support GoldSrc Monitor utility
========= =========
*/ */
HSPRITE EXPORT pfnSPR_Load( const char *szPicName );
HSPRITE EXPORT pfnSPR_Load( const char *szPicName ) HSPRITE EXPORT pfnSPR_Load( const char *szPicName )
{ {
model_t *spr; model_t *spr;
@@ -1375,6 +1380,7 @@ pfnSPR_Frames
function exported for support GoldSrc Monitor utility function exported for support GoldSrc Monitor utility
========= =========
*/ */
int EXPORT pfnSPR_Frames( HSPRITE hPic );
int EXPORT pfnSPR_Frames( HSPRITE hPic ) int EXPORT pfnSPR_Frames( HSPRITE hPic )
{ {
int numFrames = 0; int numFrames = 0;
@@ -1593,7 +1599,7 @@ CL_FillRGBA
============= =============
*/ */
void GAME_EXPORT CL_FillRGBA( int x, int y, int w, int h, int r, int g, int b, int a ) static void GAME_EXPORT CL_FillRGBA( int x, int y, int w, int h, int r, int g, int b, int a )
{ {
float _x = x, _y = y, _w = w, _h = h; float _x = x, _y = y, _w = w, _h = h;
@@ -1635,6 +1641,7 @@ get actual screen info
*/ */
int GAME_EXPORT CL_GetScreenInfo( SCREENINFO *pscrinfo ) int GAME_EXPORT CL_GetScreenInfo( SCREENINFO *pscrinfo )
{ {
qboolean apply_scale_factor = false;
float scale_factor = hud_scale.value; float scale_factor = hud_scale.value;
if( FBitSet( hud_fontscale.flags, FCVAR_CHANGED )) if( FBitSet( hud_fontscale.flags, FCVAR_CHANGED ))
@@ -1649,17 +1656,24 @@ int GAME_EXPORT CL_GetScreenInfo( SCREENINFO *pscrinfo )
clgame.scrInfo.iSize = sizeof( clgame.scrInfo ); clgame.scrInfo.iSize = sizeof( clgame.scrInfo );
clgame.scrInfo.iFlags = SCRINFO_SCREENFLASH; clgame.scrInfo.iFlags = SCRINFO_SCREENFLASH;
if( scale_factor && scale_factor != 1.0f) if( scale_factor && scale_factor != 1.0f )
{
float scaled_width = (float)refState.width / scale_factor;
if( scaled_width >= hud_scale_minimal_width.value )
apply_scale_factor = true;
}
if( apply_scale_factor )
{ {
clgame.scrInfo.iWidth = (float)refState.width / scale_factor; clgame.scrInfo.iWidth = (float)refState.width / scale_factor;
clgame.scrInfo.iHeight = (float)refState.height / scale_factor; clgame.scrInfo.iHeight = (float)refState.height / scale_factor;
clgame.scrInfo.iFlags |= SCRINFO_STRETCHED; SetBits( clgame.scrInfo.iFlags, SCRINFO_STRETCHED );
} }
else else
{ {
clgame.scrInfo.iWidth = refState.width; clgame.scrInfo.iWidth = refState.width;
clgame.scrInfo.iHeight = refState.height; clgame.scrInfo.iHeight = refState.height;
clgame.scrInfo.iFlags &= ~SCRINFO_STRETCHED; ClearBits( clgame.scrInfo.iFlags, SCRINFO_STRETCHED );
} }
if( !pscrinfo ) return 0; if( !pscrinfo ) return 0;
@@ -2121,7 +2135,7 @@ pfnGetViewModel
============= =============
*/ */
cl_entity_t* GAME_EXPORT CL_GetViewModel( void ) static cl_entity_t* GAME_EXPORT CL_GetViewModel( void )
{ {
return &clgame.viewent; return &clgame.viewent;
} }
@@ -2470,6 +2484,36 @@ static physent_t *pfnGetVisent( int idx )
return NULL; return NULL;
} }
static int GAME_EXPORT CL_TestLine( const vec3_t start, const vec3_t end, int flags )
{
return PM_TestLineExt( clgame.pmove, clgame.pmove->physents, clgame.pmove->numphysent, start, end, flags );
}
/*
=============
CL_PushTraceBounds
=============
*/
static void GAME_EXPORT CL_PushTraceBounds( int hullnum, const float *mins, const float *maxs )
{
hullnum = bound( 0, hullnum, 3 );
VectorCopy( mins, clgame.pmove->player_mins[hullnum] );
VectorCopy( maxs, clgame.pmove->player_maxs[hullnum] );
}
/*
=============
CL_PopTraceBounds
=============
*/
static void GAME_EXPORT CL_PopTraceBounds( void )
{
memcpy( clgame.pmove->player_mins, host.player_mins, sizeof( host.player_mins ));
memcpy( clgame.pmove->player_maxs, host.player_maxs, sizeof( host.player_maxs ));
}
/* /*
============= =============
pfnSetTraceHull pfnSetTraceHull
@@ -2665,6 +2709,48 @@ static model_t *pfnLoadMapSprite( const char *filename )
return NULL; return NULL;
} }
/*
=============
COM_AddAppDirectoryToSearchPath
=============
*/
static void GAME_EXPORT COM_AddAppDirectoryToSearchPath( const char *pszBaseDir, const char *appName )
{
FS_AddGameHierarchy( pszBaseDir, FS_NOWRITE_PATH );
}
/*
===========
COM_ExpandFilename
Finds the file in the search path, copies over the name with the full path name.
This doesn't search in the pak file.
===========
*/
static int GAME_EXPORT COM_ExpandFilename( const char *fileName, char *nameOutBuffer, int nameOutBufferSize )
{
char result[MAX_SYSPATH];
if( !COM_CheckString( fileName ) || !nameOutBuffer || nameOutBufferSize <= 0 )
return 0;
// filename examples:
// media\sierra.avi - D:\Xash3D\valve\media\sierra.avi
// models\barney.mdl - D:\Xash3D\bshift\models\barney.mdl
if( g_fsapi.GetFullDiskPath( result, sizeof( result ), fileName, false ))
{
// check for enough room
if( Q_strlen( result ) > nameOutBufferSize )
return 0;
Q_strncpy( nameOutBuffer, result, nameOutBufferSize );
return 1;
}
return 0;
}
/* /*
============= =============
PlayerInfo_ValueForKey PlayerInfo_ValueForKey
+12 -7
View File
@@ -542,7 +542,7 @@ pfnPIC_Set
========= =========
*/ */
void GAME_EXPORT pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a ) static void GAME_EXPORT pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a )
{ {
gameui.ds.gl_texturenum = hPic; gameui.ds.gl_texturenum = hPic;
r = bound( 0, r, 255 ); r = bound( 0, r, 255 );
@@ -558,7 +558,7 @@ pfnPIC_Draw
========= =========
*/ */
void GAME_EXPORT pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc ) static void GAME_EXPORT pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc )
{ {
ref.dllFuncs.GL_SetRenderMode( kRenderNormal ); ref.dllFuncs.GL_SetRenderMode( kRenderNormal );
PIC_DrawGeneric( x, y, width, height, prc ); PIC_DrawGeneric( x, y, width, height, prc );
@@ -570,7 +570,7 @@ pfnPIC_DrawTrans
========= =========
*/ */
void GAME_EXPORT pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc ) static void GAME_EXPORT pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc )
{ {
ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture ); ref.dllFuncs.GL_SetRenderMode( kRenderTransTexture );
PIC_DrawGeneric( x, y, width, height, prc ); PIC_DrawGeneric( x, y, width, height, prc );
@@ -582,7 +582,7 @@ pfnPIC_DrawHoles
========= =========
*/ */
void GAME_EXPORT pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc ) static void GAME_EXPORT pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc )
{ {
ref.dllFuncs.GL_SetRenderMode( kRenderTransAlpha ); ref.dllFuncs.GL_SetRenderMode( kRenderTransAlpha );
PIC_DrawGeneric( x, y, width, height, prc ); PIC_DrawGeneric( x, y, width, height, prc );
@@ -594,7 +594,7 @@ pfnPIC_DrawAdditive
========= =========
*/ */
void GAME_EXPORT pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc ) static void GAME_EXPORT pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc )
{ {
ref.dllFuncs.GL_SetRenderMode( kRenderTransAdd ); ref.dllFuncs.GL_SetRenderMode( kRenderTransAdd );
PIC_DrawGeneric( x, y, width, height, prc ); PIC_DrawGeneric( x, y, width, height, prc );
@@ -984,7 +984,7 @@ pfnCheckGameDll
========= =========
*/ */
int GAME_EXPORT pfnCheckGameDll( void ) static int GAME_EXPORT pfnCheckGameDll( void )
{ {
#ifdef XASH_INTERNAL_GAMELIBS #ifdef XASH_INTERNAL_GAMELIBS
return true; return true;
@@ -1092,6 +1092,11 @@ static int pfnDelete( const char *path )
return FS_Delete( path ); return FS_Delete( path );
} }
static void GAME_EXPORT pfnCon_DefaultColor( int r, int g, int b )
{
Con_DefaultColor( r, g, b, true );
}
// engine callbacks // engine callbacks
static ui_enginefuncs_t gEngfuncs = static ui_enginefuncs_t gEngfuncs =
{ {
@@ -1131,7 +1136,7 @@ static ui_enginefuncs_t gEngfuncs =
UI_DrawConsoleString, UI_DrawConsoleString,
UI_DrawSetTextColor, UI_DrawSetTextColor,
Con_DrawStringLen, Con_DrawStringLen,
Con_DefaultColor, pfnCon_DefaultColor,
pfnGetPlayerModel, pfnGetPlayerModel,
pfnSetPlayerModel, pfnSetPlayerModel,
pfnClearScene, pfnClearScene,
+48 -46
View File
@@ -62,6 +62,7 @@ CVAR_DEFINE_AUTO( cl_clockreset, "0.1", FCVAR_ARCHIVE, "frametime delta maximum
CVAR_DEFINE_AUTO( cl_fixtimerate, "7.5", FCVAR_ARCHIVE, "time in msec to client clock adjusting" ); CVAR_DEFINE_AUTO( cl_fixtimerate, "7.5", FCVAR_ARCHIVE, "time in msec to client clock adjusting" );
CVAR_DEFINE_AUTO( hud_fontscale, "1.0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud font texture" ); CVAR_DEFINE_AUTO( hud_fontscale, "1.0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud font texture" );
CVAR_DEFINE_AUTO( hud_scale, "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" ); CVAR_DEFINE_AUTO( hud_scale, "0", FCVAR_ARCHIVE|FCVAR_LATCH, "scale hud at current resolution" );
CVAR_DEFINE_AUTO( hud_scale_minimal_width, "640", FCVAR_ARCHIVE|FCVAR_LATCH, "if hud_scale results in a HUD virtual screen smaller than this value, it won't be applied" );
CVAR_DEFINE_AUTO( cl_solid_players, "1", 0, "Make all players not solid (can't traceline them)" ); CVAR_DEFINE_AUTO( cl_solid_players, "1", 0, "Make all players not solid (can't traceline them)" );
CVAR_DEFINE_AUTO( cl_updaterate, "20", FCVAR_USERINFO|FCVAR_ARCHIVE, "refresh rate of server messages" ); CVAR_DEFINE_AUTO( cl_updaterate, "20", FCVAR_USERINFO|FCVAR_ARCHIVE, "refresh rate of server messages" );
CVAR_DEFINE_AUTO( cl_showevents, "0", FCVAR_ARCHIVE, "show events playback" ); CVAR_DEFINE_AUTO( cl_showevents, "0", FCVAR_ARCHIVE, "show events playback" );
@@ -178,7 +179,7 @@ finalize connection process and begin new frame
with new cls.state with new cls.state
=============== ===============
*/ */
void CL_CheckClientState( void ) static void CL_CheckClientState( void )
{ {
// first update is the pre-final signon stage // first update is the pre-final signon stage
if(( cls.state == ca_connected || cls.state == ca_validate ) && ( cls.signon == SIGNONS )) if(( cls.state == ca_connected || cls.state == ca_validate ) && ( cls.signon == SIGNONS ))
@@ -278,7 +279,7 @@ CL_DriftInterpolationAmount
Drift interpolation value (this is used for server unlag system) Drift interpolation value (this is used for server unlag system)
=============== ===============
*/ */
int CL_DriftInterpolationAmount( int goal ) static int CL_DriftInterpolationAmount( int goal )
{ {
float fgoal, maxmove, diff; float fgoal, maxmove, diff;
int msec; int msec;
@@ -306,7 +307,7 @@ CL_ComputeClientInterpolationAmount
Validate interpolation cvars, calc interpolation window Validate interpolation cvars, calc interpolation window
=============== ===============
*/ */
void CL_ComputeClientInterpolationAmount( usercmd_t *cmd ) static void CL_ComputeClientInterpolationAmount( usercmd_t *cmd )
{ {
const float epsilon = 0.001f; // to avoid float invalid comparision const float epsilon = 0.001f; // to avoid float invalid comparision
float min_interp; float min_interp;
@@ -352,7 +353,7 @@ CL_ComputePacketLoss
================= =================
*/ */
void CL_ComputePacketLoss( void ) static void CL_ComputePacketLoss( void )
{ {
int i, frm; int i, frm;
frame_t *frame; frame_t *frame;
@@ -397,7 +398,7 @@ void CL_UpdateFrameLerp( void )
cl.commands[(cls.netchan.outgoing_sequence - 1) & CL_UPDATE_MASK].frame_lerp = cl.lerpFrac; cl.commands[(cls.netchan.outgoing_sequence - 1) & CL_UPDATE_MASK].frame_lerp = cl.lerpFrac;
} }
void CL_FindInterpolatedAddAngle( float t, float *frac, pred_viewangle_t **prev, pred_viewangle_t **next ) static void CL_FindInterpolatedAddAngle( float t, float *frac, pred_viewangle_t **prev, pred_viewangle_t **next )
{ {
int i, i0, i1, imod; int i, i0, i1, imod;
float at; float at;
@@ -439,7 +440,7 @@ void CL_FindInterpolatedAddAngle( float t, float *frac, pred_viewangle_t **prev,
*frac = bound( 0.0f, *frac, 1.0f ); *frac = bound( 0.0f, *frac, 1.0f );
} }
void CL_ApplyAddAngle( void ) static void CL_ApplyAddAngle( void )
{ {
pred_viewangle_t *prev = NULL, *next = NULL; pred_viewangle_t *prev = NULL, *next = NULL;
float addangletotal = 0.0f; float addangletotal = 0.0f;
@@ -475,7 +476,7 @@ CL_ProcessShowTexturesCmds
navigate around texture atlas navigate around texture atlas
=============== ===============
*/ */
qboolean CL_ProcessShowTexturesCmds( usercmd_t *cmd ) static qboolean CL_ProcessShowTexturesCmds( usercmd_t *cmd )
{ {
static int oldbuttons; static int oldbuttons;
int changed; int changed;
@@ -504,7 +505,7 @@ CL_ProcessOverviewCmds
Transform user movement into overview adjust Transform user movement into overview adjust
=============== ===============
*/ */
qboolean CL_ProcessOverviewCmds( usercmd_t *cmd ) static qboolean CL_ProcessOverviewCmds( usercmd_t *cmd )
{ {
ref_overview_t *ov = &clgame.overView; ref_overview_t *ov = &clgame.overView;
int sign = 1; int sign = 1;
@@ -556,7 +557,7 @@ CL_UpdateClientData
tell the client.dll about player origin, angles, fov, etc tell the client.dll about player origin, angles, fov, etc
================= =================
*/ */
void CL_UpdateClientData( void ) static void CL_UpdateClientData( void )
{ {
client_data_t cdat; client_data_t cdat;
@@ -583,7 +584,7 @@ void CL_UpdateClientData( void )
CL_CreateCmd CL_CreateCmd
================= =================
*/ */
void CL_CreateCmd( void ) static void CL_CreateCmd( void )
{ {
usercmd_t nullcmd, *cmd; usercmd_t nullcmd, *cmd;
runcmd_t *pcmd; runcmd_t *pcmd;
@@ -687,7 +688,7 @@ Create and send the command packet to the server
Including both the reliable commands and the usercmds Including both the reliable commands and the usercmds
=================== ===================
*/ */
void CL_WritePacket( void ) static void CL_WritePacket( void )
{ {
sizebuf_t buf; sizebuf_t buf;
qboolean send_command = false; qboolean send_command = false;
@@ -879,7 +880,7 @@ CL_SendCommand
Called every frame to builds and sends a command packet to the server. Called every frame to builds and sends a command packet to the server.
================= =================
*/ */
void CL_SendCommand( void ) static void CL_SendCommand( void )
{ {
// we create commands even if a demo is playing, // we create commands even if a demo is playing,
CL_CreateCmd(); CL_CreateCmd();
@@ -893,7 +894,7 @@ void CL_SendCommand( void )
CL_BeginUpload_f CL_BeginUpload_f
================== ==================
*/ */
void CL_BeginUpload_f( void ) static void CL_BeginUpload_f( void )
{ {
const char *name; const char *name;
resource_t custResource; resource_t custResource;
@@ -990,7 +991,7 @@ We have gotten a challenge from the server, so try and
connect. connect.
====================== ======================
*/ */
void CL_SendConnectPacket( void ) static void CL_SendConnectPacket( void )
{ {
char protinfo[MAX_INFO_STRING]; char protinfo[MAX_INFO_STRING];
const char *qport; const char *qport;
@@ -1076,7 +1077,7 @@ CL_CheckForResend
Resend a connect message if the last one has timed out Resend a connect message if the last one has timed out
================= =================
*/ */
void CL_CheckForResend( void ) static void CL_CheckForResend( void )
{ {
netadr_t adr; netadr_t adr;
net_gai_state_t res; net_gai_state_t res;
@@ -1162,7 +1163,7 @@ void CL_CheckForResend( void )
Netchan_OutOfBandPrint( NS_CLIENT, adr, "getchallenge\n" ); Netchan_OutOfBandPrint( NS_CLIENT, adr, "getchallenge\n" );
} }
resource_t *CL_AddResource( resourcetype_t type, const char *name, int size, qboolean bFatalIfMissing, int index ) static resource_t *CL_AddResource( resourcetype_t type, const char *name, int size, qboolean bFatalIfMissing, int index )
{ {
resource_t *r = &cl.resourcelist[cl.num_resources]; resource_t *r = &cl.resourcelist[cl.num_resources];
@@ -1179,7 +1180,7 @@ resource_t *CL_AddResource( resourcetype_t type, const char *name, int size, qbo
return r; return r;
} }
void CL_CreateResourceList( void ) static void CL_CreateResourceList( void )
{ {
char szFileName[MAX_OSPATH]; char szFileName[MAX_OSPATH];
byte rgucMD5_hash[16]; byte rgucMD5_hash[16];
@@ -1227,7 +1228,7 @@ CL_Connect_f
================ ================
*/ */
void CL_Connect_f( void ) static void CL_Connect_f( void )
{ {
string server; string server;
qboolean legacyconnect = false; qboolean legacyconnect = false;
@@ -1274,7 +1275,7 @@ Send the rest of the command line over as
an unconnected command. an unconnected command.
===================== =====================
*/ */
void CL_Rcon_f( void ) static void CL_Rcon_f( void )
{ {
char message[1024]; char message[1024];
netadr_t to; netadr_t to;
@@ -1381,7 +1382,7 @@ CL_SendDisconnectMessage
Sends a disconnect message to the server Sends a disconnect message to the server
===================== =====================
*/ */
void CL_SendDisconnectMessage( void ) static void CL_SendDisconnectMessage( void )
{ {
sizebuf_t buf; sizebuf_t buf;
byte data[32]; byte data[32];
@@ -1426,7 +1427,7 @@ CL_Reconnect
build a request to reconnect client build a request to reconnect client
===================== =====================
*/ */
void CL_Reconnect( qboolean setup_netchan ) static void CL_Reconnect( qboolean setup_netchan )
{ {
if( setup_netchan ) if( setup_netchan )
{ {
@@ -1553,7 +1554,7 @@ void CL_Crashed( void )
CL_LocalServers_f CL_LocalServers_f
================= =================
*/ */
void CL_LocalServers_f( void ) static void CL_LocalServers_f( void )
{ {
netadr_t adr; netadr_t adr;
@@ -1622,7 +1623,7 @@ static void CL_SendMasterServerScanRequest( void )
CL_InternetServers_f CL_InternetServers_f
================= =================
*/ */
void CL_InternetServers_f( void ) static void CL_InternetServers_f( void )
{ {
qboolean nat = cl_nat.value != 0.0f; qboolean nat = cl_nat.value != 0.0f;
uint32_t key; uint32_t key;
@@ -1651,7 +1652,7 @@ CL_Reconnect_f
The server is changing levels The server is changing levels
================= =================
*/ */
void CL_Reconnect_f( void ) static void CL_Reconnect_f( void )
{ {
if( cls.state == ca_disconnected ) if( cls.state == ca_disconnected )
return; return;
@@ -1688,7 +1689,7 @@ CL_FixupColorStringsForInfoString
all the keys and values must be ends with ^7 all the keys and values must be ends with ^7
================= =================
*/ */
void CL_FixupColorStringsForInfoString( const char *in, char *out ) static void CL_FixupColorStringsForInfoString( const char *in, char *out )
{ {
qboolean hasPrefix = false; qboolean hasPrefix = false;
qboolean endOfKeyVal = false; qboolean endOfKeyVal = false;
@@ -1752,7 +1753,7 @@ CL_ParseStatusMessage
Handle a reply from a info Handle a reply from a info
================= =================
*/ */
void CL_ParseStatusMessage( netadr_t from, sizebuf_t *msg ) static void CL_ParseStatusMessage( netadr_t from, sizebuf_t *msg )
{ {
static char infostring[MAX_INFO_STRING+8]; static char infostring[MAX_INFO_STRING+8];
char *s = MSG_ReadString( msg ); char *s = MSG_ReadString( msg );
@@ -1801,7 +1802,7 @@ CL_ParseNETInfoMessage
Handle a reply from a netinfo Handle a reply from a netinfo
================= =================
*/ */
void CL_ParseNETInfoMessage( netadr_t from, sizebuf_t *msg, const char *s ) static void CL_ParseNETInfoMessage( netadr_t from, sizebuf_t *msg, const char *s )
{ {
net_request_t *nr; net_request_t *nr;
static char infostring[MAX_INFO_STRING+8]; static char infostring[MAX_INFO_STRING+8];
@@ -1856,7 +1857,7 @@ CL_ProcessNetRequests
check for timeouts check for timeouts
================= =================
*/ */
void CL_ProcessNetRequests( void ) static void CL_ProcessNetRequests( void )
{ {
net_request_t *nr; net_request_t *nr;
int i; int i;
@@ -1938,7 +1939,7 @@ CL_ConnectionlessPacket
Responses to broadcasts, etc Responses to broadcasts, etc
================= =================
*/ */
void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ) static void CL_ConnectionlessPacket( netadr_t from, sizebuf_t *msg )
{ {
char *args; char *args;
const char *c; const char *c;
@@ -2235,7 +2236,7 @@ CL_GetMessage
Handles recording and playback of demos, on top of NET_ code Handles recording and playback of demos, on top of NET_ code
==================== ====================
*/ */
int CL_GetMessage( byte *data, size_t *length ) static int CL_GetMessage( byte *data, size_t *length )
{ {
if( cls.demoplayback ) if( cls.demoplayback )
{ {
@@ -2254,7 +2255,7 @@ int CL_GetMessage( byte *data, size_t *length )
CL_ReadNetMessage CL_ReadNetMessage
================= =================
*/ */
void CL_ReadNetMessage( void ) static void CL_ReadNetMessage( void )
{ {
size_t curSize; size_t curSize;
@@ -2338,7 +2339,7 @@ Updates the local time and reads/handles messages
on client net connection. on client net connection.
================= =================
*/ */
void CL_ReadPackets( void ) static void CL_ReadPackets( void )
{ {
// decide the simulation time // decide the simulation time
cl.oldtime = cl.time; cl.oldtime = cl.time;
@@ -2402,7 +2403,7 @@ CL_CleanFileName
Replace the displayed name for some resources Replace the displayed name for some resources
==================== ====================
*/ */
const char *CL_CleanFileName( const char *filename ) static const char *CL_CleanFileName( const char *filename )
{ {
if( COM_CheckString( filename ) && filename[0] == '!' ) if( COM_CheckString( filename ) && filename[0] == '!' )
return "customization"; return "customization";
@@ -2418,7 +2419,7 @@ CL_RegisterCustomization
register custom resource for player register custom resource for player
==================== ====================
*/ */
void CL_RegisterCustomization( resource_t *resource ) static void CL_RegisterCustomization( resource_t *resource )
{ {
qboolean bFound = false; qboolean bFound = false;
customization_t *pList; customization_t *pList;
@@ -2624,7 +2625,7 @@ void CL_ServerCommand( qboolean reliable, const char *fmt, ... )
CL_SetInfo_f CL_SetInfo_f
============== ==============
*/ */
void CL_SetInfo_f( void ) static void CL_SetInfo_f( void )
{ {
convar_t *var; convar_t *var;
@@ -2664,7 +2665,7 @@ void CL_SetInfo_f( void )
CL_Physinfo_f CL_Physinfo_f
============== ==============
*/ */
void CL_Physinfo_f( void ) static void CL_Physinfo_f( void )
{ {
Con_Printf( "Phys info settings:\n" ); Con_Printf( "Phys info settings:\n" );
Info_Print( cls.physinfo ); Info_Print( cls.physinfo );
@@ -2819,7 +2820,7 @@ CL_FullServerinfo_f
Sent by server when serverinfo changes Sent by server when serverinfo changes
================== ==================
*/ */
void CL_FullServerinfo_f( void ) static void CL_FullServerinfo_f( void )
{ {
if( Cmd_Argc() != 2 ) if( Cmd_Argc() != 2 )
{ {
@@ -2837,7 +2838,7 @@ CL_Escape_f
Escape to menu from game Escape to menu from game
================= =================
*/ */
void CL_Escape_f( void ) static void CL_Escape_f( void )
{ {
if( cls.key_dest == key_menu ) if( cls.key_dest == key_menu )
return; return;
@@ -2855,7 +2856,7 @@ void CL_Escape_f( void )
CL_InitLocal CL_InitLocal
================= =================
*/ */
void CL_InitLocal( void ) static void CL_InitLocal( void )
{ {
cls.state = ca_disconnected; cls.state = ca_disconnected;
cls.signon = 0; cls.signon = 0;
@@ -2926,6 +2927,7 @@ void CL_InitLocal( void )
Cvar_RegisterVariable( &cl_fixtimerate ); Cvar_RegisterVariable( &cl_fixtimerate );
Cvar_RegisterVariable( &hud_fontscale ); Cvar_RegisterVariable( &hud_fontscale );
Cvar_RegisterVariable( &hud_scale ); Cvar_RegisterVariable( &hud_scale );
Cvar_RegisterVariable( &hud_scale_minimal_width );
Cvar_Get( "cl_background", "0", FCVAR_READ_ONLY, "indicate what background map is running" ); Cvar_Get( "cl_background", "0", FCVAR_READ_ONLY, "indicate what background map is running" );
Cvar_RegisterVariable( &cl_showevents ); Cvar_RegisterVariable( &cl_showevents );
Cvar_Get( "lastdemo", "", FCVAR_ARCHIVE, "last played demo" ); Cvar_Get( "lastdemo", "", FCVAR_ARCHIVE, "last played demo" );
@@ -2981,12 +2983,12 @@ void CL_InitLocal( void )
Cmd_AddRestrictedCommand ("quit", CL_Quit_f, "quit from game" ); Cmd_AddRestrictedCommand ("quit", CL_Quit_f, "quit from game" );
Cmd_AddRestrictedCommand ("exit", CL_Quit_f, "quit from game" ); Cmd_AddRestrictedCommand ("exit", CL_Quit_f, "quit from game" );
Cmd_AddCommand ("screenshot", CL_ScreenShot_f, "takes a screenshot of the next rendered frame" ); Cmd_AddCommand ("screenshot", CL_GenericShot_f, "takes a screenshot of the next rendered frame" );
Cmd_AddCommand ("snapshot", CL_SnapShot_f, "takes a snapshot of the next rendered frame" ); Cmd_AddCommand ("snapshot", CL_GenericShot_f, "takes a snapshot of the next rendered frame" );
Cmd_AddCommand ("envshot", CL_EnvShot_f, "takes a six-sides cubemap shot with specified name" ); Cmd_AddCommand ("envshot", CL_GenericShot_f, "takes a six-sides cubemap shot with specified name" );
Cmd_AddCommand ("skyshot", CL_SkyShot_f, "takes a six-sides envmap (skybox) shot with specified name" ); Cmd_AddCommand ("skyshot", CL_GenericShot_f, "takes a six-sides envmap (skybox) shot with specified name" );
Cmd_AddCommand ("levelshot", CL_LevelShot_f, "same as \"screenshot\", used for create plaque images" ); Cmd_AddCommand ("levelshot", CL_LevelShot_f, "same as \"screenshot\", used for create plaque images" );
Cmd_AddCommand ("saveshot", CL_SaveShot_f, "used for create save previews with LoadGame menu" ); Cmd_AddCommand ("saveshot", CL_GenericShot_f, "used for create save previews with LoadGame menu" );
Cmd_AddCommand ("connect", CL_Connect_f, "connect to a server by hostname" ); Cmd_AddCommand ("connect", CL_Connect_f, "connect to a server by hostname" );
Cmd_AddCommand ("reconnect", CL_Reconnect_f, "reconnect to current level" ); Cmd_AddCommand ("reconnect", CL_Reconnect_f, "reconnect to current level" );
@@ -3005,7 +3007,7 @@ slowly adjuct client clock
to smooth lag effect to smooth lag effect
================== ==================
*/ */
void CL_AdjustClock( void ) static void CL_AdjustClock( void )
{ {
if( cl.timedelta == 0.0f || !cl_fixtimerate.value ) if( cl.timedelta == 0.0f || !cl_fixtimerate.value )
return; return;
@@ -3139,7 +3141,7 @@ void CL_Init( void )
VID_Init(); // init video VID_Init(); // init video
S_Init(); // init sound S_Init(); // init sound
Voice_Init( VOICE_DEFAULT_CODEC, 3 ); // init voice Voice_Init( VOICE_DEFAULT_CODEC, 3, true ); // init voice (do not open the device)
// unreliable buffer. unsed for unreliable commands and voice stream // unreliable buffer. unsed for unreliable commands and voice stream
MSG_Init( &cls.datagram, "cls.datagram", cls.datagram_buf, sizeof( cls.datagram_buf )); MSG_Init( &cls.datagram, "cls.datagram", cls.datagram_buf, sizeof( cls.datagram_buf ));
+15 -16
View File
@@ -21,7 +21,6 @@ GNU General Public License for more details.
#include "shake.h" #include "shake.h"
#include "hltv.h" #include "hltv.h"
#include "input.h" #include "input.h"
#include "server.h"
#if XASH_LOW_MEMORY != 2 #if XASH_LOW_MEMORY != 2
int CL_UPDATE_BACKUP = SINGLEPLAYER_BACKUP; int CL_UPDATE_BACKUP = SINGLEPLAYER_BACKUP;
#endif #endif
@@ -32,7 +31,7 @@ CL_UserMsgStub
Default stub for missed callbacks Default stub for missed callbacks
=============== ===============
*/ */
int CL_UserMsgStub( const char *pszName, int iSize, void *pbuf ) static int CL_UserMsgStub( const char *pszName, int iSize, void *pbuf )
{ {
return 1; return 1;
} }
@@ -58,7 +57,7 @@ CL_ParseSoundPacket
================== ==================
*/ */
void CL_ParseSoundPacket( sizebuf_t *msg ) static void CL_ParseSoundPacket( sizebuf_t *msg )
{ {
vec3_t pos; vec3_t pos;
int chan, sound; int chan, sound;
@@ -305,7 +304,7 @@ CL_ParseStaticEntity
static client entity static client entity
================== ==================
*/ */
void CL_ParseStaticEntity( sizebuf_t *msg ) static void CL_ParseStaticEntity( sizebuf_t *msg )
{ {
int i, newnum; int i, newnum;
entity_state_t from, to; entity_state_t from, to;
@@ -619,7 +618,7 @@ static void CL_StartResourceDownloading( const char *pszMessage, qboolean bCusto
CL_BatchResourceRequest( !bCustom ); CL_BatchResourceRequest( !bCustom );
} }
customization_t *CL_PlayerHasCustomization( int nPlayerNum, resourcetype_t type ) static customization_t *CL_PlayerHasCustomization( int nPlayerNum, resourcetype_t type )
{ {
customization_t *pList; customization_t *pList;
@@ -631,7 +630,7 @@ customization_t *CL_PlayerHasCustomization( int nPlayerNum, resourcetype_t type
return NULL; return NULL;
} }
void CL_RemoveCustomization( int nPlayerNum, customization_t *pRemove ) static void CL_RemoveCustomization( int nPlayerNum, customization_t *pRemove )
{ {
customization_t *pList; customization_t *pList;
customization_t *pNext; customization_t *pNext;
@@ -802,7 +801,7 @@ CL_CreateCustomizationList
loading custom decal for self loading custom decal for self
================== ==================
*/ */
void CL_CreateCustomizationList( void ) static void CL_CreateCustomizationList( void )
{ {
resource_t *pResource; resource_t *pResource;
player_info_t *pPlayer; player_info_t *pPlayer;
@@ -1494,7 +1493,7 @@ void CL_UpdateUserPings( sizebuf_t *msg )
} }
} }
void CL_SendConsistencyInfo( sizebuf_t *msg ) static void CL_SendConsistencyInfo( sizebuf_t *msg )
{ {
qboolean user_changed_diskfile; qboolean user_changed_diskfile;
vec3_t mins, maxs; vec3_t mins, maxs;
@@ -1671,7 +1670,7 @@ void CL_RegisterResources( sizebuf_t *msg )
} }
} }
void CL_ParseConsistencyInfo( sizebuf_t *msg ) static void CL_ParseConsistencyInfo( sizebuf_t *msg )
{ {
int lastcheck; int lastcheck;
int delta; int delta;
@@ -1736,7 +1735,7 @@ CL_ParseResourceList
============== ==============
*/ */
void CL_ParseResourceList( sizebuf_t *msg ) static void CL_ParseResourceList( sizebuf_t *msg )
{ {
resource_t *pResource; resource_t *pResource;
int i, total; int i, total;
@@ -1773,12 +1772,12 @@ CL_ParseVoiceInit
================== ==================
*/ */
void CL_ParseVoiceInit( sizebuf_t *msg ) static void CL_ParseVoiceInit( sizebuf_t *msg )
{ {
char *pszCodec = MSG_ReadString( msg ); char *pszCodec = MSG_ReadString( msg );
int quality = MSG_ReadByte( msg ); int quality = MSG_ReadByte( msg );
Voice_Init( pszCodec, quality ); Voice_Init( pszCodec, quality, false ); // init requested codec and the device
} }
/* /*
@@ -1787,7 +1786,7 @@ CL_ParseVoiceData
================== ==================
*/ */
void CL_ParseVoiceData( sizebuf_t *msg ) static void CL_ParseVoiceData( sizebuf_t *msg )
{ {
int size, idx, frames; int size, idx, frames;
byte received[8192]; byte received[8192];
@@ -1904,7 +1903,7 @@ CL_ParseScreenShake
Set screen shake Set screen shake
============== ==============
*/ */
void CL_ParseScreenShake( sizebuf_t *msg ) static void CL_ParseScreenShake( sizebuf_t *msg )
{ {
float amplitude = (float)(word)MSG_ReadShort( msg ) * ( 1.0f / (float)( 1 << 12 )); float amplitude = (float)(word)MSG_ReadShort( msg ) * ( 1.0f / (float)( 1 << 12 ));
float duration = (float)(word)MSG_ReadShort( msg ) * ( 1.0f / (float)( 1 << 12 )); float duration = (float)(word)MSG_ReadShort( msg ) * ( 1.0f / (float)( 1 << 12 ));
@@ -1927,7 +1926,7 @@ CL_ParseScreenFade
Set screen fade Set screen fade
============== ==============
*/ */
void CL_ParseScreenFade( sizebuf_t *msg ) static void CL_ParseScreenFade( sizebuf_t *msg )
{ {
float duration, holdTime; float duration, holdTime;
screenfade_t *sf = &clgame.fade; screenfade_t *sf = &clgame.fade;
@@ -2026,7 +2025,7 @@ CL_ParseExec
Exec map/class specific configs Exec map/class specific configs
============== ==============
*/ */
void CL_ParseExec( sizebuf_t *msg ) static void CL_ParseExec( sizebuf_t *msg )
{ {
qboolean is_class; qboolean is_class;
int class_idx; int class_idx;
+6 -6
View File
@@ -30,7 +30,7 @@ CL_ParseStaticEntity
static client entity static client entity
================== ==================
*/ */
void CL_LegacyParseStaticEntity( sizebuf_t *msg ) static void CL_LegacyParseStaticEntity( sizebuf_t *msg )
{ {
int i; int i;
entity_state_t state; entity_state_t state;
@@ -98,7 +98,7 @@ void CL_LegacyParseStaticEntity( sizebuf_t *msg )
R_AddEfrags( ent ); // add link R_AddEfrags( ent ); // add link
} }
void CL_LegacyParseSoundPacket( sizebuf_t *msg, qboolean is_ambient ) static void CL_LegacyParseSoundPacket( sizebuf_t *msg, qboolean is_ambient )
{ {
vec3_t pos; vec3_t pos;
int chan, sound; int chan, sound;
@@ -167,7 +167,7 @@ CL_PrecacheSound
prceache sound from server prceache sound from server
================ ================
*/ */
void CL_LegacyPrecacheSound( sizebuf_t *msg ) static void CL_LegacyPrecacheSound( sizebuf_t *msg )
{ {
int soundIndex; int soundIndex;
@@ -184,7 +184,7 @@ void CL_LegacyPrecacheSound( sizebuf_t *msg )
cl.sound_index[soundIndex] = S_RegisterSound( cl.sound_precache[soundIndex] ); cl.sound_index[soundIndex] = S_RegisterSound( cl.sound_precache[soundIndex] );
} }
void CL_LegacyPrecacheModel( sizebuf_t *msg ) static void CL_LegacyPrecacheModel( sizebuf_t *msg )
{ {
int modelIndex; int modelIndex;
string model; string model;
@@ -214,7 +214,7 @@ void CL_LegacyPrecacheModel( sizebuf_t *msg )
cl.nummodels = Q_max( cl.nummodels, modelIndex ); cl.nummodels = Q_max( cl.nummodels, modelIndex );
} }
void CL_LegacyPrecacheEvent( sizebuf_t *msg ) static void CL_LegacyPrecacheEvent( sizebuf_t *msg )
{ {
int eventIndex; int eventIndex;
@@ -242,7 +242,7 @@ CL_ParseResourceList
============== ==============
*/ */
void CL_LegacyParseResourceList( sizebuf_t *msg ) static void CL_LegacyParseResourceList( sizebuf_t *msg )
{ {
int i = 0; int i = 0;
static struct static struct
+3 -33
View File
@@ -54,31 +54,6 @@ void GAME_EXPORT CL_PopPMStates( void )
clgame.pushed = false; clgame.pushed = false;
} }
/*
=============
CL_PushTraceBounds
=============
*/
void GAME_EXPORT CL_PushTraceBounds( int hullnum, const float *mins, const float *maxs )
{
hullnum = bound( 0, hullnum, 3 );
VectorCopy( mins, clgame.pmove->player_mins[hullnum] );
VectorCopy( maxs, clgame.pmove->player_maxs[hullnum] );
}
/*
=============
CL_PopTraceBounds
=============
*/
void GAME_EXPORT CL_PopTraceBounds( void )
{
memcpy( clgame.pmove->player_mins, host.player_mins, sizeof( host.player_mins ));
memcpy( clgame.pmove->player_maxs, host.player_maxs, sizeof( host.player_maxs ));
}
/* /*
=============== ===============
CL_IsPredicted CL_IsPredicted
@@ -417,7 +392,7 @@ CL_AddLinksToPmove
collect solid entities collect solid entities
==================== ====================
*/ */
void CL_AddLinksToPmove( frame_t *frame ) static void CL_AddLinksToPmove( frame_t *frame )
{ {
entity_state_t *state; entity_state_t *state;
model_t *model; model_t *model;
@@ -687,11 +662,6 @@ cl_entity_t *CL_GetWaterEntity( const float *rgflPos )
return CL_GetEntityByIndex( entnum ); return CL_GetEntityByIndex( entnum );
} }
int GAME_EXPORT CL_TestLine( const vec3_t start, const vec3_t end, int flags )
{
return PM_TestLineExt( clgame.pmove, clgame.pmove->physents, clgame.pmove->numphysent, start, end, flags );
}
static int GAME_EXPORT pfnTestPlayerPosition( float *pos, pmtrace_t *ptrace ) static int GAME_EXPORT pfnTestPlayerPosition( float *pos, pmtrace_t *ptrace )
{ {
return PM_TestPlayerPosition( clgame.pmove, pos, ptrace, NULL ); return PM_TestPlayerPosition( clgame.pmove, pos, ptrace, NULL );
@@ -897,7 +867,7 @@ static void CL_SetupPMove( playermove_t *pmove, const local_state_t *from, const
Q_strncpy( pmove->physinfo, cls.physinfo, MAX_INFO_STRING ); Q_strncpy( pmove->physinfo, cls.physinfo, MAX_INFO_STRING );
} }
const void CL_FinishPMove( const playermove_t *pmove, local_state_t *to ) static const void CL_FinishPMove( const playermove_t *pmove, local_state_t *to )
{ {
entity_state_t *ps; entity_state_t *ps;
clientdata_t *cd; clientdata_t *cd;
@@ -950,7 +920,7 @@ CL_RunUsercmd
Runs prediction code for user cmd Runs prediction code for user cmd
================= =================
*/ */
void CL_RunUsercmd( local_state_t *from, local_state_t *to, usercmd_t *u, qboolean runfuncs, double *time, unsigned int random_seed ) static void CL_RunUsercmd( local_state_t *from, local_state_t *to, usercmd_t *u, qboolean runfuncs, double *time, unsigned int random_seed )
{ {
usercmd_t cmd; usercmd_t cmd;
+5 -5
View File
@@ -414,7 +414,7 @@ If an entities model or origin changes from frame to frame, it must be
relinked. Other attributes can change without relinking. relinked. Other attributes can change without relinking.
================== ==================
*/ */
void CL_ParseQuakeEntityData( sizebuf_t *msg, int bits ) static void CL_ParseQuakeEntityData( sizebuf_t *msg, int bits )
{ {
int i, newnum, pack; int i, newnum, pack;
qboolean forcelink; qboolean forcelink;
@@ -565,7 +565,7 @@ CL_ParseQuakeParticles
================== ==================
*/ */
void CL_ParseQuakeParticle( sizebuf_t *msg ) static void CL_ParseQuakeParticle( sizebuf_t *msg )
{ {
int count, color; int count, color;
vec3_t org, dir; vec3_t org, dir;
@@ -587,7 +587,7 @@ CL_ParseQuakeStaticSound
=================== ===================
*/ */
void CL_ParseQuakeStaticSound( sizebuf_t *msg ) static void CL_ParseQuakeStaticSound( sizebuf_t *msg )
{ {
int sound_num; int sound_num;
float vol, attn; float vol, attn;
@@ -816,7 +816,7 @@ CL_QuakeStuffText
================== ==================
*/ */
void CL_QuakeStuffText( const char *text ) static void CL_QuakeStuffText( const char *text )
{ {
Q_strncat( cmd_buf, text, sizeof( cmd_buf )); Q_strncat( cmd_buf, text, sizeof( cmd_buf ));
@@ -831,7 +831,7 @@ CL_QuakeExecStuff
================== ==================
*/ */
void CL_QuakeExecStuff( void ) static void CL_QuakeExecStuff( void )
{ {
char *text = cmd_buf; char *text = cmd_buf;
char token[256]; char token[256];
+1 -1
View File
@@ -126,7 +126,7 @@ CL_GenericHandle
============= =============
*/ */
const char *CL_GenericHandle( int fileindex ) static const char *CL_GenericHandle( int fileindex )
{ {
if( fileindex < 0 || fileindex >= MAX_CUSTOM ) if( fileindex < 0 || fileindex >= MAX_CUSTOM )
return 0; return 0;
+12 -12
View File
@@ -252,7 +252,7 @@ VID_WriteOverviewScript
Create overview script file Create overview script file
=============== ===============
*/ */
void VID_WriteOverviewScript( void ) static void VID_WriteOverviewScript( void )
{ {
ref_overview_t *ov = &clgame.overView; ref_overview_t *ov = &clgame.overView;
string filename; string filename;
@@ -344,7 +344,7 @@ void SCR_MakeScreenShot( void )
SCR_DrawPlaque SCR_DrawPlaque
================ ================
*/ */
void SCR_DrawPlaque( void ) static void SCR_DrawPlaque( void )
{ {
if(( cl_allow_levelshots.value && !cls.changelevel ) || cl.background ) if(( cl_allow_levelshots.value && !cls.changelevel ) || cl.background )
{ {
@@ -415,7 +415,7 @@ void SCR_EndLoadingPlaque( void )
SCR_AddDirtyPoint SCR_AddDirtyPoint
================= =================
*/ */
void SCR_AddDirtyPoint( int x, int y ) static void SCR_AddDirtyPoint( int x, int y )
{ {
if( x < scr_dirty.x1 ) scr_dirty.x1 = x; if( x < scr_dirty.x1 ) scr_dirty.x1 = x;
if( x > scr_dirty.x2 ) scr_dirty.x2 = x; if( x > scr_dirty.x2 ) scr_dirty.x2 = x;
@@ -602,7 +602,7 @@ SCR_InstallParticlePalette
INTERNAL RESOURCE INTERNAL RESOURCE
================ ================
*/ */
void SCR_InstallParticlePalette( void ) static void SCR_InstallParticlePalette( void )
{ {
rgbdata_t *pic; rgbdata_t *pic;
int i; int i;
@@ -648,21 +648,21 @@ void SCR_RegisterTextures( void )
// register gfx.wad images // register gfx.wad images
if( FS_FileExists( "gfx/paused.lmp", false )) if( FS_FileExists( "gfx/paused.lmp", false ))
cls.pauseIcon = ref.dllFuncs.GL_LoadTexture( "gfx/paused.lmp", NULL, 0, TF_IMAGE ); cls.pauseIcon = ref.dllFuncs.GL_LoadTexture( "gfx/paused.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
else if( FS_FileExists( "gfx/pause.lmp", false )) else if( FS_FileExists( "gfx/pause.lmp", false ))
cls.pauseIcon = ref.dllFuncs.GL_LoadTexture( "gfx/pause.lmp", NULL, 0, TF_IMAGE ); cls.pauseIcon = ref.dllFuncs.GL_LoadTexture( "gfx/pause.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
if( FS_FileExists( "gfx/lambda.lmp", false )) if( FS_FileExists( "gfx/lambda.lmp", false ))
{ {
if( cl_allow_levelshots.value ) if( cl_allow_levelshots.value )
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE ); cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE|TF_ALLOW_NEAREST );
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE ); else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/lambda.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
} }
else if( FS_FileExists( "gfx/loading.lmp", false )) else if( FS_FileExists( "gfx/loading.lmp", false ))
{ {
if( cl_allow_levelshots.value ) if( cl_allow_levelshots.value )
cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE ); cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_LUMINANCE|TF_ALLOW_NEAREST );
else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE ); else cls.loadingBar = ref.dllFuncs.GL_LoadTexture( "gfx/loading.lmp", NULL, 0, TF_IMAGE|TF_ALLOW_NEAREST );
} }
cls.tileImage = ref.dllFuncs.GL_LoadTexture( "gfx/backtile.lmp", NULL, 0, TF_NOMIPMAP ); cls.tileImage = ref.dllFuncs.GL_LoadTexture( "gfx/backtile.lmp", NULL, 0, TF_NOMIPMAP );
@@ -675,7 +675,7 @@ SCR_SizeUp_f
Keybinding command Keybinding command
================= =================
*/ */
void SCR_SizeUp_f( void ) static void SCR_SizeUp_f( void )
{ {
Cvar_SetValue( "viewsize", Q_min( scr_viewsize.value + 10, 120 )); Cvar_SetValue( "viewsize", Q_min( scr_viewsize.value + 10, 120 ));
} }
@@ -688,7 +688,7 @@ SCR_SizeDown_f
Keybinding command Keybinding command
================= =================
*/ */
void SCR_SizeDown_f( void ) static void SCR_SizeDown_f( void )
{ {
Cvar_SetValue( "viewsize", Q_max( scr_viewsize.value - 10, 30 )); Cvar_SetValue( "viewsize", Q_max( scr_viewsize.value - 10, 30 ));
} }
+9 -7
View File
@@ -87,6 +87,8 @@ const char *cl_explode_sounds[] =
"weapons/explode5.wav", "weapons/explode5.wav",
}; };
static void CL_PlayerDecal( int playerIndex, int textureIndex, int entityIndex, float *pos );
/* /*
================ ================
CL_LoadClientSprites CL_LoadClientSprites
@@ -255,7 +257,7 @@ CL_PrepareTEnt
set default values set default values
============== ==============
*/ */
void CL_PrepareTEnt( TEMPENTITY *pTemp, model_t *pmodel ) static void CL_PrepareTEnt( TEMPENTITY *pTemp, model_t *pmodel )
{ {
int frameCount = 0; int frameCount = 0;
int modelIndex = 0; int modelIndex = 0;
@@ -296,7 +298,7 @@ CL_TempEntPlaySound
play collide sound play collide sound
============== ==============
*/ */
void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp ) static void CL_TempEntPlaySound( TEMPENTITY *pTemp, float damp )
{ {
float fvol; float fvol;
char soundname[32]; char soundname[32];
@@ -380,7 +382,7 @@ CL_TEntAddEntity
add entity to renderlist add entity to renderlist
============== ==============
*/ */
int CL_TempEntAddEntity( cl_entity_t *pEntity ) static int CL_TempEntAddEntity( cl_entity_t *pEntity )
{ {
vec3_t mins, maxs; vec3_t mins, maxs;
@@ -432,7 +434,7 @@ CL_TEntAddEntity
free the first low priority tempent it finds. free the first low priority tempent it finds.
============== ==============
*/ */
qboolean CL_FreeLowPriorityTempEnt( void ) static qboolean CL_FreeLowPriorityTempEnt( void )
{ {
TEMPENTITY *pActive = cl_active_tents; TEMPENTITY *pActive = cl_active_tents;
TEMPENTITY *pPrev = NULL; TEMPENTITY *pPrev = NULL;
@@ -2414,7 +2416,7 @@ LIGHT STYLE MANAGEMENT
CL_ClearLightStyles CL_ClearLightStyles
================ ================
*/ */
void CL_ClearLightStyles( void ) static void CL_ClearLightStyles( void )
{ {
memset( cl.lightstyles, 0, sizeof( cl.lightstyles )); memset( cl.lightstyles, 0, sizeof( cl.lightstyles ));
} }
@@ -2472,7 +2474,7 @@ dlight_t cl_elights[MAX_ELIGHTS];
CL_ClearDlights CL_ClearDlights
================ ================
*/ */
void CL_ClearDlights( void ) static void CL_ClearDlights( void )
{ {
memset( cl_dlights, 0, sizeof( cl_dlights )); memset( cl_dlights, 0, sizeof( cl_dlights ));
memset( cl_elights, 0, sizeof( cl_elights )); memset( cl_elights, 0, sizeof( cl_elights ));
@@ -2919,7 +2921,7 @@ CL_PlayerDecal
spray custom colored decal (clan logo etc) spray custom colored decal (clan logo etc)
=============== ===============
*/ */
void CL_PlayerDecal( int playernum, int customIndex, int entityIndex, float *pos ) static void CL_PlayerDecal( int playernum, int customIndex, int entityIndex, float *pos )
{ {
int textureIndex = 0; int textureIndex = 0;
customization_t *pCust = NULL; customization_t *pCust = NULL;
+1 -1
View File
@@ -68,7 +68,7 @@ qboolean SCR_NextMovie( void )
return true; return true;
} }
void SCR_CreateStartupVids( void ) static void SCR_CreateStartupVids( void )
{ {
file_t *f; file_t *f;
+9 -9
View File
@@ -29,7 +29,7 @@ V_CalcViewRect
calc frame rectangle (Quake1 style) calc frame rectangle (Quake1 style)
=============== ===============
*/ */
void V_CalcViewRect( void ) static void V_CalcViewRect( void )
{ {
qboolean full = false; qboolean full = false;
int sb_lines; int sb_lines;
@@ -88,7 +88,7 @@ void V_CalcViewRect( void )
V_SetupViewModel V_SetupViewModel
=============== ===============
*/ */
void V_SetupViewModel( void ) static void V_SetupViewModel( void )
{ {
cl_entity_t *view = &clgame.viewent; cl_entity_t *view = &clgame.viewent;
player_info_t *info = &cl.players[cl.playernum]; player_info_t *info = &cl.players[cl.playernum];
@@ -118,7 +118,7 @@ void V_SetupViewModel( void )
V_SetRefParams V_SetRefParams
=============== ===============
*/ */
void V_SetRefParams( ref_params_t *fd ) static void V_SetRefParams( ref_params_t *fd )
{ {
memset( fd, 0, sizeof( ref_params_t )); memset( fd, 0, sizeof( ref_params_t ));
@@ -182,7 +182,7 @@ V_MergeOverviewRefdef
merge refdef with overview settings merge refdef with overview settings
=============== ===============
*/ */
void V_RefApplyOverview( ref_viewpass_t *rvp ) static void V_RefApplyOverview( ref_viewpass_t *rvp )
{ {
ref_overview_t *ov = &clgame.overView; ref_overview_t *ov = &clgame.overView;
float aspect; float aspect;
@@ -281,7 +281,7 @@ static void V_AdjustFov( float *fov_x, float *fov_y, float width, float height,
V_GetRefParams V_GetRefParams
============= =============
*/ */
void V_GetRefParams( ref_params_t *fd, ref_viewpass_t *rvp ) static void V_GetRefParams( ref_params_t *fd, ref_viewpass_t *rvp )
{ {
// part1: deniable updates // part1: deniable updates
VectorCopy( fd->simvel, cl.simvel ); VectorCopy( fd->simvel, cl.simvel );
@@ -408,14 +408,14 @@ void V_RenderView( void )
#define NODE_INTERVAL_X(x) (x * 16.0f) #define NODE_INTERVAL_X(x) (x * 16.0f)
#define NODE_INTERVAL_Y(x) (x * 16.0f) #define NODE_INTERVAL_Y(x) (x * 16.0f)
void R_DrawLeafNode( float x, float y, float scale ) static void R_DrawLeafNode( float x, float y, float scale )
{ {
float downScale = scale * 0.25f;// * POINT_SIZE; float downScale = scale * 0.25f;// * POINT_SIZE;
ref.dllFuncs.R_DrawStretchPic( x - downScale * 0.5f, y - downScale * 0.5f, downScale, downScale, 0, 0, 1, 1, R_GetBuiltinTexture( REF_PARTICLE_TEXTURE ) ); ref.dllFuncs.R_DrawStretchPic( x - downScale * 0.5f, y - downScale * 0.5f, downScale, downScale, 0, 0, 1, 1, R_GetBuiltinTexture( REF_PARTICLE_TEXTURE ) );
} }
void R_DrawNodeConnection( float x, float y, float x2, float y2 ) static void R_DrawNodeConnection( float x, float y, float x2, float y2 )
{ {
ref.dllFuncs.Begin( TRI_LINES ); ref.dllFuncs.Begin( TRI_LINES );
ref.dllFuncs.Vertex3f( x, y, 0 ); ref.dllFuncs.Vertex3f( x, y, 0 );
@@ -423,7 +423,7 @@ void R_DrawNodeConnection( float x, float y, float x2, float y2 )
ref.dllFuncs.End( ); ref.dllFuncs.End( );
} }
void R_ShowTree_r( mnode_t *node, float x, float y, float scale, int shownodes, mleaf_t *viewleaf ) static void R_ShowTree_r( mnode_t *node, float x, float y, float scale, int shownodes, mleaf_t *viewleaf )
{ {
float downScale = scale * 0.8f; float downScale = scale * 0.8f;
@@ -470,7 +470,7 @@ void R_ShowTree_r( mnode_t *node, float x, float y, float scale, int shownodes,
world.recursion_level--; world.recursion_level--;
} }
void R_ShowTree( void ) static void R_ShowTree( void )
{ {
float x = (float)((refState.width - (int)POINT_SIZE) >> 1); float x = (float)((refState.width - (int)POINT_SIZE) >> 1);
float y = NODE_INTERVAL_Y(1.0f); float y = NODE_INTERVAL_Y(1.0f);
+12 -43
View File
@@ -343,7 +343,6 @@ typedef struct
int charHeight; // scaled height int charHeight; // scaled height
int type; // fixed width font or variable int type; // fixed width font or variable
int rendermode; // default rendermode int rendermode; // default rendermode
qboolean nearest; // nearest filtering enabled
qboolean valid; // all rectangles are valid qboolean valid; // all rectangles are valid
} cl_font_t; } cl_font_t;
@@ -683,6 +682,7 @@ extern convar_t cl_clockreset;
extern convar_t cl_fixtimerate; extern convar_t cl_fixtimerate;
extern convar_t hud_fontscale; extern convar_t hud_fontscale;
extern convar_t hud_scale; extern convar_t hud_scale;
extern convar_t hud_scale_minimal_width;
extern convar_t r_showtextures; extern convar_t r_showtextures;
extern convar_t cl_bmodelinterp; extern convar_t cl_bmodelinterp;
extern convar_t cl_lw; // local weapons extern convar_t cl_lw; // local weapons
@@ -705,7 +705,6 @@ extern convar_t cl_fixmodelinterpolationartifacts;
//============================================================================= //=============================================================================
void CL_SetLightstyle( int style, const char* s, float f ); void CL_SetLightstyle( int style, const char* s, float f );
void CL_RunLightStyles( void );
void CL_DecayLights( void ); void CL_DecayLights( void );
dlight_t *CL_GetDynamicLight( int number ); dlight_t *CL_GetDynamicLight( int number );
dlight_t *CL_GetEntityLight( int number ); dlight_t *CL_GetEntityLight( int number );
@@ -716,12 +715,8 @@ dlight_t *CL_GetEntityLight( int number );
// cl_cmds.c // cl_cmds.c
// //
void CL_Quit_f( void ); void CL_Quit_f( void );
void CL_ScreenShot_f( void ); void CL_GenericShot_f( void );
void CL_SnapShot_f( void );
void CL_PlayCDTrack_f( void ); void CL_PlayCDTrack_f( void );
void CL_EnvShot_f( void );
void CL_SkyShot_f( void );
void CL_SaveShot_f( void );
void CL_LevelShot_f( void ); void CL_LevelShot_f( void );
void CL_SetSky_f( void ); void CL_SetSky_f( void );
void SCR_Viewpos_f( void ); void SCR_Viewpos_f( void );
@@ -742,8 +737,6 @@ void CL_ClearResourceLists( void );
void CL_Parse_Debug( qboolean enable ); void CL_Parse_Debug( qboolean enable );
void CL_Parse_RecordCommand( int cmd, int startoffset ); void CL_Parse_RecordCommand( int cmd, int startoffset );
void CL_ResetFrame( frame_t *frame ); void CL_ResetFrame( frame_t *frame );
void CL_WriteMessageHistory( void );
const char *CL_MsgInfo( int cmd );
// //
// cl_efx.c // cl_efx.c
@@ -754,7 +747,6 @@ void CL_Particle( const vec3_t org, int color, float life, int zpos, int zvel );
// cl_main.c // cl_main.c
// //
void CL_Init( void ); void CL_Init( void );
void CL_SendCommand( void );
void CL_Disconnect_f( void ); void CL_Disconnect_f( void );
void CL_ProcessFile( qboolean successfully_received, const char *filename ); void CL_ProcessFile( qboolean successfully_received, const char *filename );
void CL_WriteUsercmd( sizebuf_t *msg, int from, int to ); void CL_WriteUsercmd( sizebuf_t *msg, int from, int to );
@@ -763,7 +755,6 @@ qboolean CL_PrecacheResources( void );
void CL_SetupOverviewParams( void ); void CL_SetupOverviewParams( void );
void CL_UpdateFrameLerp( void ); void CL_UpdateFrameLerp( void );
int CL_IsDevOverviewMode( void ); int CL_IsDevOverviewMode( void );
void CL_PingServers_f( void );
void CL_SignonReply( void ); void CL_SignonReply( void );
void CL_ClearState( void ); void CL_ClearState( void );
@@ -781,8 +772,6 @@ void CL_CheckStartupDemos( void );
void CL_WriteDemoJumpTime( void ); void CL_WriteDemoJumpTime( void );
void CL_CloseDemoHeader( void ); void CL_CloseDemoHeader( void );
void CL_DemoCompleted( void ); void CL_DemoCompleted( void );
void CL_StopPlayback( void );
void CL_StopRecord( void );
void CL_PlayDemo_f( void ); void CL_PlayDemo_f( void );
void CL_TimeDemo_f( void ); void CL_TimeDemo_f( void );
void CL_StartDemos_f( void ); void CL_StartDemos_f( void );
@@ -790,6 +779,7 @@ void CL_Demos_f( void );
void CL_DeleteDemo_f( void ); void CL_DeleteDemo_f( void );
void CL_Record_f( void ); void CL_Record_f( void );
void CL_Stop_f( void ); void CL_Stop_f( void );
int CL_GetDemoComment( const char *demoname, char *comment );
// //
// cl_events.c // cl_events.c
@@ -797,12 +787,9 @@ void CL_Stop_f( void );
void CL_ParseEvent( sizebuf_t *msg ); void CL_ParseEvent( sizebuf_t *msg );
void CL_ParseReliableEvent( sizebuf_t *msg ); void CL_ParseReliableEvent( sizebuf_t *msg );
void CL_SetEventIndex( const char *szEvName, int ev_index ); void CL_SetEventIndex( const char *szEvName, int ev_index );
void CL_QueueEvent( int flags, int index, float delay, event_args_t *args );
void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, float delay, float *origin, void CL_PlaybackEvent( int flags, const edict_t *pInvoker, word eventindex, float delay, float *origin,
float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 ); float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
void CL_RegisterEvent( int lastnum, const char *szEvName, pfnEventHook func ); void CL_RegisterEvent( int lastnum, const char *szEvName, pfnEventHook func );
void CL_BatchResourceRequest( qboolean initialize );
int CL_EstimateNeededResources( void );
void CL_ResetEvent( event_info_t *ei ); void CL_ResetEvent( event_info_t *ei );
word CL_EventIndex( const char *name ); word CL_EventIndex( const char *name );
void CL_FireEvents( void ); void CL_FireEvents( void );
@@ -826,10 +813,7 @@ int CL_DrawStringf( cl_font_t *font, float x, float y, rgba_t color, int flags,
// //
void CL_UnloadProgs( void ); void CL_UnloadProgs( void );
qboolean CL_LoadProgs( const char *name ); qboolean CL_LoadProgs( const char *name );
void CL_ParseUserMessage( sizebuf_t *msg, int svc_num );
void CL_LinkUserMessage( char *pszName, const int svc_num, int iSize ); void CL_LinkUserMessage( char *pszName, const int svc_num, int iSize );
void CL_ParseFinaleCutscene( sizebuf_t *msg, int level );
void CL_ParseTextMessage( sizebuf_t *msg );
void CL_DrawHUD( int state ); void CL_DrawHUD( int state );
void CL_InitEdicts( int maxclients ); void CL_InitEdicts( int maxclients );
void CL_FreeEdicts( void ); void CL_FreeEdicts( void );
@@ -846,20 +830,17 @@ model_t *CL_LoadClientSprite( const char *filename );
model_t *CL_LoadModel( const char *modelname, int *index ); model_t *CL_LoadModel( const char *modelname, int *index );
HSPRITE pfnSPR_LoadExt( const char *szPicName, uint texFlags ); HSPRITE pfnSPR_LoadExt( const char *szPicName, uint texFlags );
void SPR_AdjustSize( float *x, float *y, float *w, float *h ); void SPR_AdjustSize( float *x, float *y, float *w, float *h );
void SPR_AdjustTexCoords( float width, float height, float *s1, float *t1, float *s2, float *t2 );
int CL_GetScreenInfo( SCREENINFO *pscrinfo ); int CL_GetScreenInfo( SCREENINFO *pscrinfo );
void CL_FillRGBA( int x, int y, int width, int height, int r, int g, int b, int a );
pmtrace_t *PM_CL_TraceLine( float *start, float *end, int flags, int usehull, int ignore_pe ); pmtrace_t *PM_CL_TraceLine( float *start, float *end, int flags, int usehull, int ignore_pe );
const char *PM_CL_TraceTexture( int ground, float *vstart, float *vend ); const char *PM_CL_TraceTexture( int ground, float *vstart, float *vend );
int PM_CL_PointContents( const float *p, int *truecontents ); int PM_CL_PointContents( const float *p, int *truecontents );
void CL_GetMousePosition( int *mx, int *my ); // TODO: move to input
cl_entity_t* CL_GetViewModel( void );
physent_t *pfnGetPhysent( int idx ); physent_t *pfnGetPhysent( int idx );
struct msurface_s *pfnTraceSurface( int ground, float *vstart, float *vend ); struct msurface_s *pfnTraceSurface( int ground, float *vstart, float *vend );
movevars_t *pfnGetMoveVars( void ); movevars_t *pfnGetMoveVars( void );
void CL_EnableScissor( scissor_state_t *scissor, int x, int y, int width, int height ); void CL_EnableScissor( scissor_state_t *scissor, int x, int y, int width, int height );
void CL_DisableScissor( scissor_state_t *scissor ); void CL_DisableScissor( scissor_state_t *scissor );
qboolean CL_Scissor( const scissor_state_t *scissor, float *x, float *y, float *width, float *height, float *u0, float *v0, float *u1, float *v1 ); qboolean CL_Scissor( const scissor_state_t *scissor, float *x, float *y, float *width, float *height, float *u0, float *v0, float *u1, float *v1 );
struct cl_entity_s *CL_GetEntityByIndex( int index );
_inline cl_entity_t *CL_EDICT_NUM( int n ) _inline cl_entity_t *CL_EDICT_NUM( int n )
{ {
@@ -911,6 +892,11 @@ qboolean CL_RequestMissingResources( void );
void CL_RegisterResources ( sizebuf_t *msg ); void CL_RegisterResources ( sizebuf_t *msg );
void CL_ParseViewEntity( sizebuf_t *msg ); void CL_ParseViewEntity( sizebuf_t *msg );
void CL_ParseServerTime( sizebuf_t *msg ); void CL_ParseServerTime( sizebuf_t *msg );
void CL_ParseUserMessage( sizebuf_t *msg, int svc_num );
void CL_ParseFinaleCutscene( sizebuf_t *msg, int level );
void CL_ParseTextMessage( sizebuf_t *msg );
void CL_BatchResourceRequest( qboolean initialize );
int CL_EstimateNeededResources( void );
// //
// cl_parse_48.c // cl_parse_48.c
@@ -924,8 +910,6 @@ void CL_LegacyPrecache_f( void );
void SCR_VidInit( void ); void SCR_VidInit( void );
void SCR_TileClear( void ); void SCR_TileClear( void );
void SCR_DirtyScreen( void ); void SCR_DirtyScreen( void );
void SCR_AddDirtyPoint( int x, int y );
void SCR_InstallParticlePalette( void );
void SCR_EndLoadingPlaque( void ); void SCR_EndLoadingPlaque( void );
void SCR_RegisterTextures( void ); void SCR_RegisterTextures( void );
void SCR_LoadCreditsFont( void ); void SCR_LoadCreditsFont( void );
@@ -961,20 +945,17 @@ void CL_InitClientMove( void );
void CL_PredictMovement( qboolean repredicting ); void CL_PredictMovement( qboolean repredicting );
void CL_CheckPredictionError( void ); void CL_CheckPredictionError( void );
qboolean CL_IsPredicted( void ); qboolean CL_IsPredicted( void );
int CL_TruePointContents( const vec3_t p );
int CL_WaterEntity( const float *rgflPos ); int CL_WaterEntity( const float *rgflPos );
cl_entity_t *CL_GetWaterEntity( const float *rgflPos ); cl_entity_t *CL_GetWaterEntity( const float *rgflPos );
int CL_TestLine( const vec3_t start, const vec3_t end, int flags );
pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags ); pmtrace_t *CL_VisTraceLine( vec3_t start, vec3_t end, int flags );
pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags ); pmtrace_t CL_TraceLine( vec3_t start, vec3_t end, int flags );
void CL_PushTraceBounds( int hullnum, const float *mins, const float *maxs );
void CL_PopTraceBounds( void );
void CL_MoveSpectatorCamera( void ); void CL_MoveSpectatorCamera( void );
void CL_SetLastUpdate( void ); void CL_SetLastUpdate( void );
void CL_RedoPrediction( void ); void CL_RedoPrediction( void );
void CL_PushPMStates( void ); void CL_PushPMStates( void );
void CL_PopPMStates( void ); void CL_PopPMStates( void );
void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient ); void CL_SetUpPlayerPrediction( int dopred, int bIncludeLocalClient );
void CL_SetIdealPitch( void );
// //
// cl_qparse.c // cl_qparse.c
@@ -991,12 +972,10 @@ qboolean CL_AddVisibleEntity( cl_entity_t *ent, int entityType );
void CL_ResetLatchedVars( cl_entity_t *ent, qboolean full_reset ); void CL_ResetLatchedVars( cl_entity_t *ent, qboolean full_reset );
qboolean CL_GetEntitySpatialization( struct channel_s *ch ); qboolean CL_GetEntitySpatialization( struct channel_s *ch );
qboolean CL_GetMovieSpatialization( struct rawchan_s *ch ); qboolean CL_GetMovieSpatialization( struct rawchan_s *ch );
void CL_ProcessPlayerState( int playerindex, entity_state_t *state );
void CL_ComputePlayerOrigin( cl_entity_t *clent ); void CL_ComputePlayerOrigin( cl_entity_t *clent );
void CL_ProcessPacket( frame_t *frame ); void CL_ProcessPacket( frame_t *frame );
void CL_MoveThirdpersonCamera( void ); void CL_MoveThirdpersonCamera( void );
qboolean CL_IsPlayerIndex( int idx ); qboolean CL_IsPlayerIndex( int idx );
void CL_SetIdealPitch( void );
void CL_EmitEntities( void ); void CL_EmitEntities( void );
// //
@@ -1020,6 +999,7 @@ const ref_overview_t *GL_GetOverviewParms( void );
// //
void R_StoreEfrags( efrag_t **ppefrag, int framecount ); void R_StoreEfrags( efrag_t **ppefrag, int framecount );
void R_AddEfrags( cl_entity_t *ent ); void R_AddEfrags( cl_entity_t *ent );
// //
// cl_tent.c // cl_tent.c
// //
@@ -1030,7 +1010,6 @@ void CL_ClearEfrags( void );
void CL_TestLights( void ); void CL_TestLights( void );
void CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale ); void CL_FireCustomDecal( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags, float scale );
void CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags ); void CL_DecalShoot( int textureIndex, int entityIndex, int modelIndex, float *pos, int flags );
void CL_PlayerDecal( int playerIndex, int textureIndex, int entityIndex, float *pos );
void R_FreeDeadParticles( struct particle_s **ppparticles ); void R_FreeDeadParticles( struct particle_s **ppparticles );
void CL_AddClientResource( const char *filename, int type ); void CL_AddClientResource( const char *filename, int type );
void CL_AddClientResources( void ); void CL_AddClientResources( void );
@@ -1052,7 +1031,6 @@ void CL_ReadPointFile_f( void );
void CL_DrawEFX( float time, qboolean fTrans ); void CL_DrawEFX( float time, qboolean fTrans );
void CL_ThinkParticle( double frametime, particle_t *p ); void CL_ThinkParticle( double frametime, particle_t *p );
void CL_ReadLineFile_f( void ); void CL_ReadLineFile_f( void );
void CL_RunLightStyles( void );
// //
// console.c // console.c
@@ -1072,27 +1050,23 @@ int Con_UtfProcessChar( int in );
int Con_UtfProcessCharForce( int in ); int Con_UtfProcessCharForce( int in );
int Con_UtfMoveLeft( char *str, int pos ); int Con_UtfMoveLeft( char *str, int pos );
int Con_UtfMoveRight( char *str, int pos, int length ); int Con_UtfMoveRight( char *str, int pos, int length );
void Con_DefaultColor( int r, int g, int b ); void Con_DefaultColor( int r, int g, int b, qboolean gameui );
void Con_InvalidateFonts( void );
cl_font_t *Con_GetCurFont( void ); cl_font_t *Con_GetCurFont( void );
cl_font_t *Con_GetFont( int num ); cl_font_t *Con_GetFont( int num );
void Con_DrawCharacterLen( int number, int *width, int *height ); void Con_DrawCharacterLen( int number, int *width, int *height );
int Con_DrawString( int x, int y, const char *string, rgba_t setColor ); // legacy, use cl_font.c int Con_DrawString( int x, int y, const char *string, rgba_t setColor ); // legacy, use cl_font.c
void GAME_EXPORT Con_DrawStringLen( const char *pText, int *length, int *height ); // legacy, use cl_font.c void GAME_EXPORT Con_DrawStringLen( const char *pText, int *length, int *height ); // legacy, use cl_font.c
void Con_CharEvent( int key ); void Con_CharEvent( int key );
void Con_RestoreFont( void );
void Key_Console( int key ); void Key_Console( int key );
void Key_Message( int key ); void Key_Message( int key );
void Con_FastClose( void ); void Con_FastClose( void );
void Con_Bottom( void ); void Con_Bottom( void );
void Con_Top( void );
void Con_PageDown( int lines ); void Con_PageDown( int lines );
void Con_PageUp( int lines ); void Con_PageUp( int lines );
// //
// s_main.c // s_main.c
// //
void S_StreamRawSamples( int samples, int rate, int width, int channels, const byte *data );
void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float synctime ); void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float synctime );
void S_StartBackgroundTrack( const char *intro, const char *loop, int position, qboolean fullpath ); void S_StartBackgroundTrack( const char *intro, const char *loop, int position, qboolean fullpath );
void S_StopBackgroundTrack( void ); void S_StopBackgroundTrack( void );
@@ -1139,11 +1113,6 @@ void UI_ConnectionProgress_Precache( void );
void UI_ConnectionProgress_Connect( const char *server ); void UI_ConnectionProgress_Connect( const char *server );
void UI_ConnectionProgress_ChangeLevel( void ); void UI_ConnectionProgress_ChangeLevel( void );
void UI_ConnectionProgress_ParseServerInfo( const char *server ); void UI_ConnectionProgress_ParseServerInfo( const char *server );
void pfnPIC_Set( HIMAGE hPic, int r, int g, int b, int a );
void pfnPIC_Draw( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawTrans( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawHoles( int x, int y, int width, int height, const wrect_t *prc );
void pfnPIC_DrawAdditive( int x, int y, int width, int height, const wrect_t *prc );
// //
// cl_mobile.c // cl_mobile.c
+37 -27
View File
@@ -140,8 +140,9 @@ typedef struct
static console_t con; static console_t con;
void Con_ClearField( field_t *edit ); static void Con_ClearField( field_t *edit );
void Field_CharEvent( field_t *edit, int ch ); static void Field_CharEvent( field_t *edit, int ch );
static void Con_InvalidateFonts( void );
static void Con_LoadHistory( con_history_t *self ); static void Con_LoadHistory( con_history_t *self );
static void Con_SaveHistory( con_history_t *self ); static void Con_SaveHistory( con_history_t *self );
@@ -151,7 +152,7 @@ static void Con_SaveHistory( con_history_t *self );
Con_Clear_f Con_Clear_f
================ ================
*/ */
void Con_Clear_f( void ) static void Con_Clear_f( void )
{ {
con.lines_count = 0; con.lines_count = 0;
con.backscroll = 0; // go to end con.backscroll = 0; // go to end
@@ -175,10 +176,10 @@ static void Con_SetColor( void )
switch( num ) switch( num )
{ {
case 1: case 1:
Con_DefaultColor( r, r, r ); Con_DefaultColor( r, r, r, false );
break; break;
case 3: case 3:
Con_DefaultColor( r, g, b ); Con_DefaultColor( r, g, b, false );
break; break;
default: default:
Cvar_DirectSet( &con_color, con_color.def_string ); Cvar_DirectSet( &con_color, con_color.def_string );
@@ -206,7 +207,7 @@ void Con_ClearNotify( void )
Con_ClearTyping Con_ClearTyping
================ ================
*/ */
void Con_ClearTyping( void ) static void Con_ClearTyping( void )
{ {
Con_ClearField( &con.input ); Con_ClearField( &con.input );
con.input.widthInChars = con.linewidth; con.input.widthInChars = con.linewidth;
@@ -219,7 +220,7 @@ void Con_ClearTyping( void )
Con_MessageMode_f Con_MessageMode_f
================ ================
*/ */
void Con_MessageMode_f( void ) static void Con_MessageMode_f( void )
{ {
g_messagemode_privileged = Cmd_CurrentCommandIsPrivileged(); g_messagemode_privileged = Cmd_CurrentCommandIsPrivileged();
@@ -235,7 +236,7 @@ void Con_MessageMode_f( void )
Con_MessageMode2_f Con_MessageMode2_f
================ ================
*/ */
void Con_MessageMode2_f( void ) static void Con_MessageMode2_f( void )
{ {
g_messagemode_privileged = Cmd_CurrentCommandIsPrivileged(); g_messagemode_privileged = Cmd_CurrentCommandIsPrivileged();
@@ -280,7 +281,7 @@ void Con_ToggleConsole_f( void )
Con_SetTimes_f Con_SetTimes_f
================ ================
*/ */
void Con_SetTimes_f( void ) static void Con_SetTimes_f( void )
{ {
int newtimes; int newtimes;
@@ -303,7 +304,7 @@ Notifies the console code about the current time
went backwards) went backwards)
================ ================
*/ */
void Con_FixTimes( void ) static void Con_FixTimes( void )
{ {
double diff; double diff;
int i; int i;
@@ -324,7 +325,7 @@ Con_DeleteLine
Deletes the first line from the console history. Deletes the first line from the console history.
================ ================
*/ */
void Con_DeleteLine( void ) static void Con_DeleteLine( void )
{ {
if( con.lines_count == 0 ) if( con.lines_count == 0 )
return; return;
@@ -339,7 +340,7 @@ Con_DeleteLastLine
Deletes the last line from the console history. Deletes the last line from the console history.
================ ================
*/ */
void Con_DeleteLastLine( void ) static void Con_DeleteLastLine( void )
{ {
if( con.lines_count == 0 ) if( con.lines_count == 0 )
return; return;
@@ -398,7 +399,7 @@ Con_AddLine
Appends a given string as a new line to the console. Appends a given string as a new line to the console.
================ ================
*/ */
void Con_AddLine( const char *line, int length, qboolean newline ) static void Con_AddLine( const char *line, int length, qboolean newline )
{ {
char *putpos; char *putpos;
con_lineinfo_t *p; con_lineinfo_t *p;
@@ -444,7 +445,7 @@ Con_CheckResize
If the line width has changed, reformat the buffer. If the line width has changed, reformat the buffer.
================ ================
*/ */
void Con_CheckResize( void ) static void Con_CheckResize( void )
{ {
int charWidth = 8; int charWidth = 8;
int i, width; int i, width;
@@ -493,7 +494,7 @@ void Con_PageDown( int lines )
Con_Top Con_Top
================ ================
*/ */
void Con_Top( void ) static void Con_Top( void )
{ {
con.backscroll = CON_MAXLINES; con.backscroll = CON_MAXLINES;
} }
@@ -574,7 +575,7 @@ static void Con_LoadConsoleFont( int fontNumber, cl_font_t *font )
{ {
// quake fixed font as fallback // quake fixed font as fallback
// keep source to print directly into conback image // keep source to print directly into conback image
if( !Con_LoadFixedWidthFont( "gfx/conchars", font, scale, kRenderTransTexture, TF_FONT|TF_KEEP_SOURCE )) if( !Con_LoadFixedWidthFont( "gfx/conchars", font, scale, kRenderTransTexture, TF_FONT|TF_NEAREST|TF_KEEP_SOURCE ))
Con_DPrintf( S_ERROR "failed to load console font\n" ); Con_DPrintf( S_ERROR "failed to load console font\n" );
} }
} }
@@ -1120,7 +1121,7 @@ EDIT FIELDS
Con_ClearField Con_ClearField
================ ================
*/ */
void Con_ClearField( field_t *edit ) static void Con_ClearField( field_t *edit )
{ {
memset( edit->buffer, 0, MAX_STRING ); memset( edit->buffer, 0, MAX_STRING );
edit->cursor = 0; edit->cursor = 0;
@@ -1143,7 +1144,7 @@ static void Field_Set( field_t *f, const char *string )
Field_Paste Field_Paste
================ ================
*/ */
void Field_Paste( field_t *edit ) static void Field_Paste( field_t *edit )
{ {
char *cbd; char *cbd;
int i, pasteLen; int i, pasteLen;
@@ -1179,7 +1180,7 @@ in-game talk, and menu fields
Key events are used for non-printable characters, others are gotten from char events. Key events are used for non-printable characters, others are gotten from char events.
================= =================
*/ */
void Field_KeyDownEvent( field_t *edit, int key ) static void Field_KeyDownEvent( field_t *edit, int key )
{ {
int len; int len;
@@ -1250,7 +1251,7 @@ void Field_KeyDownEvent( field_t *edit, int key )
Field_CharEvent Field_CharEvent
================== ==================
*/ */
void Field_CharEvent( field_t *edit, int ch ) static void Field_CharEvent( field_t *edit, int ch )
{ {
int len; int len;
@@ -1311,7 +1312,7 @@ void Field_CharEvent( field_t *edit, int ch )
Field_DrawInputLine Field_DrawInputLine
================== ==================
*/ */
void Field_DrawInputLine( int x, int y, field_t *edit ) static void Field_DrawInputLine( int x, int y, field_t *edit )
{ {
int len, cursorChar; int len, cursorChar;
int drawLen; int drawLen;
@@ -1683,7 +1684,7 @@ Con_DrawInput
The input line scrolls horizontally if typing goes beyond the right edge The input line scrolls horizontally if typing goes beyond the right edge
================ ================
*/ */
void Con_DrawInput( int lines ) static void Con_DrawInput( int lines )
{ {
int y; int y;
@@ -1703,7 +1704,7 @@ Con_DrawDebugLines
Custom debug messages Custom debug messages
================ ================
*/ */
int Con_DrawDebugLines( void ) static int Con_DrawDebugLines( void )
{ {
notify_t *notify = con.notify; notify_t *notify = con.notify;
int i, count = 0; int i, count = 0;
@@ -1788,7 +1789,7 @@ Con_DrawNotify
Draws the last few lines of output transparently over the game top Draws the last few lines of output transparently over the game top
================ ================
*/ */
void Con_DrawNotify( void ) static void Con_DrawNotify( void )
{ {
double time = cl.time; double time = cl.time;
int i, x, y = 0; int i, x, y = 0;
@@ -1840,7 +1841,7 @@ If alpha is 0, the line is not drawn, but still wrapped and its height
returned. returned.
================ ================
*/ */
int Con_DrawConsoleLine( int y, int lineno ) static int Con_DrawConsoleLine( int y, int lineno )
{ {
con_lineinfo_t *li = &CON_LINES( lineno ); con_lineinfo_t *li = &CON_LINES( lineno );
@@ -1895,7 +1896,7 @@ Con_DrawConsole
Draws the console with the solid background Draws the console with the solid background
================ ================
*/ */
void Con_DrawSolidConsole( int lines ) static void Con_DrawSolidConsole( int lines )
{ {
int i, x, y; int i, x, y;
float fraction; float fraction;
@@ -2310,11 +2311,20 @@ Con_DefaultColor
called from MainUI called from MainUI
========= =========
*/ */
void GAME_EXPORT Con_DefaultColor( int r, int g, int b ) void Con_DefaultColor( int r, int g, int b, qboolean gameui )
{ {
r = bound( 0, r, 255 ); r = bound( 0, r, 255 );
g = bound( 0, g, 255 ); g = bound( 0, g, 255 );
b = bound( 0, b, 255 ); b = bound( 0, b, 255 );
// gameui wants to override console color... check if it's not default
if( gameui && ( g_color_table[7][0] != r || g_color_table[7][1] != g || g_color_table[7][2] != b ))
{
// yes, different from default orange, disable con_color
SetBits( con_color.flags, FCVAR_READ_ONLY );
ClearBits( con_color.flags, FCVAR_CHANGED );
}
MakeRGBA( g_color_table[7], r, g, b, 255 ); MakeRGBA( g_color_table[7], r, g, b, 255 );
} }
+1 -1
View File
@@ -252,7 +252,7 @@ Touch_DumpConfig
Dump config to file Dump config to file
================= =================
*/ */
qboolean Touch_DumpConfig( const char *name, const char *profilename ) static qboolean Touch_DumpConfig( const char *name, const char *profilename )
{ {
file_t *f; file_t *f;
touch_button_t *button; touch_button_t *button;
+4 -4
View File
@@ -107,7 +107,7 @@ void IN_LockInputDevices( qboolean lock )
IN_StartupMouse IN_StartupMouse
=========== ===========
*/ */
void IN_StartupMouse( void ) static void IN_StartupMouse( void )
{ {
Cvar_RegisterVariable( &m_ignore ); Cvar_RegisterVariable( &m_ignore );
@@ -206,7 +206,7 @@ void IN_ToggleClientMouse( int newstate, int oldstate )
} }
} }
void IN_CheckMouseState( qboolean active ) static void IN_CheckMouseState( qboolean active )
{ {
static qboolean s_bRawInput, s_bMouseGrab; static qboolean s_bRawInput, s_bMouseGrab;
@@ -313,7 +313,7 @@ void IN_DeactivateMouse( void )
IN_MouseMove IN_MouseMove
================ ================
*/ */
void IN_MouseMove( void ) static void IN_MouseMove( void )
{ {
int x, y; int x, y;
@@ -588,7 +588,7 @@ void IN_EngineAppendMove( float frametime, void *cmd1, qboolean active )
} }
} }
void IN_Commands( void ) static void IN_Commands( void )
{ {
#if XASH_USE_EVDEV #if XASH_USE_EVDEV
IN_EvdevFrame(); IN_EvdevFrame();
+6 -6
View File
@@ -332,7 +332,7 @@ int Key_GetKey( const char *pBinding )
Key_Unbind_f Key_Unbind_f
=================== ===================
*/ */
void Key_Unbind_f( void ) static void Key_Unbind_f( void )
{ {
int b; int b;
@@ -358,7 +358,7 @@ void Key_Unbind_f( void )
Key_Unbindall_f Key_Unbindall_f
=================== ===================
*/ */
void Key_Unbindall_f( void ) static void Key_Unbindall_f( void )
{ {
int i; int i;
@@ -378,7 +378,7 @@ void Key_Unbindall_f( void )
Key_Reset_f Key_Reset_f
=================== ===================
*/ */
void Key_Reset_f( void ) static void Key_Reset_f( void )
{ {
keyname_t *kn; keyname_t *kn;
int i; int i;
@@ -400,7 +400,7 @@ void Key_Reset_f( void )
Key_Bind_f Key_Bind_f
=================== ===================
*/ */
void Key_Bind_f( void ) static void Key_Bind_f( void )
{ {
char cmd[1024]; char cmd[1024];
int i, c, b; int i, c, b;
@@ -473,7 +473,7 @@ Key_Bindlist_f
============ ============
*/ */
void Key_Bindlist_f( void ) static void Key_Bindlist_f( void )
{ {
int i; int i;
@@ -523,7 +523,7 @@ void Key_Init( void )
Key_AddKeyCommands Key_AddKeyCommands
=================== ===================
*/ */
void Key_AddKeyCommands( int key, const char *kb, qboolean down ) static void Key_AddKeyCommands( int key, const char *kb, qboolean down )
{ {
char button[1024]; char button[1024];
char *buttonPtr; char *buttonPtr;
+6
View File
@@ -109,6 +109,12 @@ static void *pfnMod_Extradata( int type, model_t *m )
return NULL; return NULL;
} }
static void CL_ExtraUpdate( void )
{
clgame.dllFuncs.IN_Accumulate();
S_ExtraUpdate();
}
static void pfnCL_GetScreenInfo( int *width, int *height ) // clgame.scrInfo, ptrs may be NULL static void pfnCL_GetScreenInfo( int *width, int *height ) // clgame.scrInfo, ptrs may be NULL
{ {
if( width ) *width = clgame.scrInfo.iWidth; if( width ) *width = clgame.scrInfo.iWidth;
+20 -20
View File
@@ -91,7 +91,7 @@ void S_FadeClientVolume( float fadePercent, float fadeOutSeconds, float holdTime
S_IsClient S_IsClient
================= =================
*/ */
qboolean S_IsClient( int entnum ) static qboolean S_IsClient( int entnum )
{ {
return ( entnum == s_listener.entnum ); return ( entnum == s_listener.entnum );
} }
@@ -124,7 +124,7 @@ void S_FreeChannel( channel_t *ch )
S_UpdateSoundFade S_UpdateSoundFade
================= =================
*/ */
void S_UpdateSoundFade( void ) static void S_UpdateSoundFade( void )
{ {
float f, totaltime, elapsed; float f, totaltime, elapsed;
@@ -184,7 +184,7 @@ override any other sound playing on the same channel (see code comments below fo
exceptions). exceptions).
================= =================
*/ */
qboolean SND_FStreamIsPlaying( sfx_t *sfx ) static qboolean SND_FStreamIsPlaying( sfx_t *sfx )
{ {
int ch_idx; int ch_idx;
@@ -399,7 +399,7 @@ returns TRUE if sound was altered,
returns FALSE if sound was not found (sound is not playing) returns FALSE if sound was not found (sound is not playing)
================= =================
*/ */
int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int flags ) static int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int flags )
{ {
channel_t *ch; channel_t *ch;
int i; int i;
@@ -457,7 +457,7 @@ int S_AlterChannel( int entnum, int channel, sfx_t *sfx, int vol, int pitch, int
S_SpatializeChannel S_SpatializeChannel
================= =================
*/ */
void S_SpatializeChannel( int *left_vol, int *right_vol, int master_vol, float gain, float dot, float dist ) static void S_SpatializeChannel( int *left_vol, int *right_vol, int master_vol, float gain, float dot, float dist )
{ {
float lscale, rscale, scale; float lscale, rscale, scale;
@@ -480,7 +480,7 @@ void S_SpatializeChannel( int *left_vol, int *right_vol, int master_vol, float g
SND_Spatialize SND_Spatialize
================= =================
*/ */
void SND_Spatialize( channel_t *ch ) static void SND_Spatialize( channel_t *ch )
{ {
vec3_t source_vec; vec3_t source_vec;
float dist, dot, gain = 1.0f; float dist, dot, gain = 1.0f;
@@ -953,7 +953,7 @@ int S_GetCurrentDynamicSounds( soundlist_t *pout, int size )
S_InitAmbientChannels S_InitAmbientChannels
=================== ===================
*/ */
void S_InitAmbientChannels( void ) static void S_InitAmbientChannels( void )
{ {
int ambient_channel; int ambient_channel;
channel_t *chan; channel_t *chan;
@@ -975,7 +975,7 @@ void S_InitAmbientChannels( void )
S_UpdateAmbientSounds S_UpdateAmbientSounds
=================== ===================
*/ */
void S_UpdateAmbientSounds( void ) static void S_UpdateAmbientSounds( void )
{ {
mleaf_t *leaf; mleaf_t *leaf;
float vol; float vol;
@@ -1407,7 +1407,7 @@ static void S_FreeRawChannels( void )
S_ClearBuffer S_ClearBuffer
================== ==================
*/ */
void S_ClearBuffer( void ) static void S_ClearBuffer( void )
{ {
S_ClearRawChannels(); S_ClearRawChannels();
@@ -1506,7 +1506,7 @@ static int S_GetSoundtime( void )
} }
//============================================================================= //=============================================================================
void S_UpdateChannels( void ) static void S_UpdateChannels( void )
{ {
uint endtime; uint endtime;
int samps; int samps;
@@ -1695,7 +1695,7 @@ console functions
=============================================================================== ===============================================================================
*/ */
void S_Play_f( void ) static void S_Play_f( void )
{ {
if( Cmd_Argc() == 1 ) if( Cmd_Argc() == 1 )
{ {
@@ -1706,7 +1706,7 @@ void S_Play_f( void )
S_StartLocalSound( Cmd_Argv( 1 ), VOL_NORM, false ); S_StartLocalSound( Cmd_Argv( 1 ), VOL_NORM, false );
} }
void S_Play2_f( void ) static void S_Play2_f( void )
{ {
int i = 1; int i = 1;
@@ -1723,7 +1723,7 @@ void S_Play2_f( void )
} }
} }
void S_PlayVol_f( void ) static void S_PlayVol_f( void )
{ {
if( Cmd_Argc() == 1 ) if( Cmd_Argc() == 1 )
{ {
@@ -1749,7 +1749,7 @@ static void S_Say( const char *name, qboolean reliable )
S_StartLocalSound( sentence, 1.0f, reliable ); S_StartLocalSound( sentence, 1.0f, reliable );
} }
void S_Say_f( void ) static void S_Say_f( void )
{ {
if( Cmd_Argc() == 1 ) if( Cmd_Argc() == 1 )
{ {
@@ -1760,7 +1760,7 @@ void S_Say_f( void )
S_Say( Cmd_Argv( 1 ), false ); S_Say( Cmd_Argv( 1 ), false );
} }
void S_SayReliable_f( void ) static void S_SayReliable_f( void )
{ {
if( Cmd_Argc() == 1 ) if( Cmd_Argc() == 1 )
{ {
@@ -1776,7 +1776,7 @@ void S_SayReliable_f( void )
S_Music_f S_Music_f
================= =================
*/ */
void S_Music_f( void ) static void S_Music_f( void )
{ {
int c = Cmd_Argc(); int c = Cmd_Argc();
@@ -1840,7 +1840,7 @@ void S_Music_f( void )
S_StopSound_f S_StopSound_f
================= =================
*/ */
void S_StopSound_f( void ) static void S_StopSound_f( void )
{ {
S_StopAllSounds( true ); S_StopAllSounds( true );
} }
@@ -1850,7 +1850,7 @@ void S_StopSound_f( void )
S_SoundFade_f S_SoundFade_f
================= =================
*/ */
void S_SoundFade_f( void ) static void S_SoundFade_f( void )
{ {
int c = Cmd_Argc(); int c = Cmd_Argc();
float fadeTime = 5.0f; float fadeTime = 5.0f;
@@ -1884,7 +1884,7 @@ void S_SoundInfo_f( void )
S_VoiceRecordStart_f S_VoiceRecordStart_f
================= =================
*/ */
void S_VoiceRecordStart_f( void ) static void S_VoiceRecordStart_f( void )
{ {
if( cls.state != ca_active || cls.legacymode ) if( cls.state != ca_active || cls.legacymode )
return; return;
@@ -1897,7 +1897,7 @@ void S_VoiceRecordStart_f( void )
S_VoiceRecordStop_f S_VoiceRecordStop_f
================= =================
*/ */
void S_VoiceRecordStop_f( void ) static void S_VoiceRecordStop_f( void )
{ {
if( cls.state != ca_active || !Voice_IsRecording() ) if( cls.state != ca_active || !Voice_IsRecording() )
return; return;
+21 -21
View File
@@ -58,7 +58,7 @@ S_TransferPaintBuffer
=================== ===================
*/ */
void S_TransferPaintBuffer( int endtime ) static void S_TransferPaintBuffer( int endtime )
{ {
int *snd_p, snd_linear_count; int *snd_p, snd_linear_count;
int lpos, lpaintedtime; int lpos, lpaintedtime;
@@ -201,7 +201,7 @@ CHANNEL MIXING
=============================================================================== ===============================================================================
*/ */
void S_PaintMonoFrom8( portable_samplepair_t *pbuf, int *volume, byte *pData, int outCount ) static void S_PaintMonoFrom8( portable_samplepair_t *pbuf, int *volume, byte *pData, int outCount )
{ {
int *lscale, *rscale; int *lscale, *rscale;
int i, data; int i, data;
@@ -217,7 +217,7 @@ void S_PaintMonoFrom8( portable_samplepair_t *pbuf, int *volume, byte *pData, in
} }
} }
void S_PaintStereoFrom8( portable_samplepair_t *pbuf, int *volume, byte *pData, int outCount ) static void S_PaintStereoFrom8( portable_samplepair_t *pbuf, int *volume, byte *pData, int outCount )
{ {
int *lscale, *rscale; int *lscale, *rscale;
uint left, right; uint left, right;
@@ -237,7 +237,7 @@ void S_PaintStereoFrom8( portable_samplepair_t *pbuf, int *volume, byte *pData,
} }
} }
void S_PaintMonoFrom16( portable_samplepair_t *pbuf, int *volume, short *pData, int outCount ) static void S_PaintMonoFrom16( portable_samplepair_t *pbuf, int *volume, short *pData, int outCount )
{ {
int left, right; int left, right;
int i, data; int i, data;
@@ -252,7 +252,7 @@ void S_PaintMonoFrom16( portable_samplepair_t *pbuf, int *volume, short *pData,
} }
} }
void S_PaintStereoFrom16( portable_samplepair_t *pbuf, int *volume, short *pData, int outCount ) static void S_PaintStereoFrom16( portable_samplepair_t *pbuf, int *volume, short *pData, int outCount )
{ {
uint *data; uint *data;
int left, right; int left, right;
@@ -273,11 +273,11 @@ void S_PaintStereoFrom16( portable_samplepair_t *pbuf, int *volume, short *pData
} }
} }
void S_Mix8MonoTimeCompress( portable_samplepair_t *pbuf, int *volume, byte *pData, int inputOffset, uint rateScale, int outCount, int timecompress ) static void S_Mix8MonoTimeCompress( portable_samplepair_t *pbuf, int *volume, byte *pData, int inputOffset, uint rateScale, int outCount, int timecompress )
{ {
} }
void S_Mix8Mono( portable_samplepair_t *pbuf, int *volume, byte *pData, int inputOffset, uint rateScale, int outCount, int timecompress ) static void S_Mix8Mono( portable_samplepair_t *pbuf, int *volume, byte *pData, int inputOffset, uint rateScale, int outCount, int timecompress )
{ {
int i, sampleIndex = 0; int i, sampleIndex = 0;
uint sampleFrac = inputOffset; uint sampleFrac = inputOffset;
@@ -309,7 +309,7 @@ void S_Mix8Mono( portable_samplepair_t *pbuf, int *volume, byte *pData, int inpu
} }
} }
void S_Mix8Stereo( portable_samplepair_t *pbuf, int *volume, byte *pData, int inputOffset, uint rateScale, int outCount ) static void S_Mix8Stereo( portable_samplepair_t *pbuf, int *volume, byte *pData, int inputOffset, uint rateScale, int outCount )
{ {
int i, sampleIndex = 0; int i, sampleIndex = 0;
uint sampleFrac = inputOffset; uint sampleFrac = inputOffset;
@@ -335,7 +335,7 @@ void S_Mix8Stereo( portable_samplepair_t *pbuf, int *volume, byte *pData, int in
} }
} }
void S_Mix16Mono( portable_samplepair_t *pbuf, int *volume, short *pData, int inputOffset, uint rateScale, int outCount ) static void S_Mix16Mono( portable_samplepair_t *pbuf, int *volume, short *pData, int inputOffset, uint rateScale, int outCount )
{ {
int i, sampleIndex = 0; int i, sampleIndex = 0;
uint sampleFrac = inputOffset; uint sampleFrac = inputOffset;
@@ -357,7 +357,7 @@ void S_Mix16Mono( portable_samplepair_t *pbuf, int *volume, short *pData, int in
} }
} }
void S_Mix16Stereo( portable_samplepair_t *pbuf, int *volume, short *pData, int inputOffset, uint rateScale, int outCount ) static void S_Mix16Stereo( portable_samplepair_t *pbuf, int *volume, short *pData, int inputOffset, uint rateScale, int outCount )
{ {
int i, sampleIndex = 0; int i, sampleIndex = 0;
uint sampleFrac = inputOffset; uint sampleFrac = inputOffset;
@@ -379,7 +379,7 @@ void S_Mix16Stereo( portable_samplepair_t *pbuf, int *volume, short *pData, int
} }
} }
void S_MixChannel( channel_t *pChannel, void *pData, int outputOffset, int inputOffset, uint fracRate, int outCount, int timecompress ) static void S_MixChannel( channel_t *pChannel, void *pData, int outputOffset, int inputOffset, uint fracRate, int outCount, int timecompress )
{ {
int pvol[CCHANVOLUMES]; int pvol[CCHANVOLUMES];
paintbuffer_t *ppaint = MIX_GetCurrentPaintbufferPtr(); paintbuffer_t *ppaint = MIX_GetCurrentPaintbufferPtr();
@@ -496,7 +496,7 @@ int S_MixDataToDevice( channel_t *pChannel, int sampleCount, int outRate, int ou
return outOffset - startingOffset; return outOffset - startingOffset;
} }
qboolean S_ShouldContinueMixing( channel_t *ch ) static qboolean S_ShouldContinueMixing( channel_t *ch )
{ {
if( ch->isSentence ) if( ch->isSentence )
{ {
@@ -517,7 +517,7 @@ qboolean S_ShouldContinueMixing( channel_t *ch )
// this routine will fill the paintbuffer to endtime. Otherwise, fewer samples are mixed. // this routine will fill the paintbuffer to endtime. Otherwise, fewer samples are mixed.
// if( endtime - paintedtime ) is not aligned on boundaries of 4, // if( endtime - paintedtime ) is not aligned on boundaries of 4,
// we'll miss data if outputRate < SOUND_DMA_SPEED! // we'll miss data if outputRate < SOUND_DMA_SPEED!
void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate ) static void MIX_MixChannelsToPaintbuffer( int endtime, int rate, int outputRate )
{ {
channel_t *ch; channel_t *ch;
wavdata_t *pSource; wavdata_t *pSource;
@@ -647,7 +647,7 @@ _inline portable_samplepair_t *S_GetNextpFilter( int i, portable_samplepair_t *p
// if NULL then perform no filtering. // if NULL then perform no filtering.
// count: how many samples to upsample. will become count*2 samples in buffer, in place. // count: how many samples to upsample. will become count*2 samples in buffer, in place.
void S_Interpolate2xCubic( portable_samplepair_t *pbuffer, portable_samplepair_t *pfiltermem, int cfltmem, int count ) static void S_Interpolate2xCubic( portable_samplepair_t *pbuffer, portable_samplepair_t *pfiltermem, int cfltmem, int count )
{ {
// implement cubic interpolation on 2x upsampled buffer. Effectively delays buffer contents by 2 samples. // implement cubic interpolation on 2x upsampled buffer. Effectively delays buffer contents by 2 samples.
@@ -740,7 +740,7 @@ void S_Interpolate2xCubic( portable_samplepair_t *pbuffer, portable_samplepair_t
// prevfilter: filter memory. NOTE: this must match the filtertype ie: filterlinear[] for FILTERTYPE_LINEAR // prevfilter: filter memory. NOTE: this must match the filtertype ie: filterlinear[] for FILTERTYPE_LINEAR
// if NULL then perform no filtering. // if NULL then perform no filtering.
// count: how many samples to upsample. will become count*2 samples in buffer, in place. // count: how many samples to upsample. will become count*2 samples in buffer, in place.
void S_Interpolate2xLinear( portable_samplepair_t *pbuffer, portable_samplepair_t *pfiltermem, int cfltmem, int count ) static void S_Interpolate2xLinear( portable_samplepair_t *pbuffer, portable_samplepair_t *pfiltermem, int cfltmem, int count )
{ {
int i, upCount = count<<1; int i, upCount = count<<1;
@@ -769,7 +769,7 @@ void S_Interpolate2xLinear( portable_samplepair_t *pbuffer, portable_samplepair_
// if NULL then perform no filtering. // if NULL then perform no filtering.
// cfltmem: max number of sample pairs filter can use // cfltmem: max number of sample pairs filter can use
// filtertype: FILTERTYPE_NONE, _LINEAR, _CUBIC etc. Must match prevfilter. // filtertype: FILTERTYPE_NONE, _LINEAR, _CUBIC etc. Must match prevfilter.
void S_MixBufferUpsample2x( int count, portable_samplepair_t *pbuffer, portable_samplepair_t *pfiltermem, int cfltmem, int filtertype ) static void S_MixBufferUpsample2x( int count, portable_samplepair_t *pbuffer, portable_samplepair_t *pfiltermem, int cfltmem, int filtertype )
{ {
int upCount = count<<1; int upCount = count<<1;
int i, j; int i, j;
@@ -822,7 +822,7 @@ void MIX_ClearAllPaintBuffers( int SampleCount, qboolean clearFilters )
// mixes pbuf1 + pbuf2 into pbuf3, count samples // mixes pbuf1 + pbuf2 into pbuf3, count samples
// fgain is output gain 0-1.0 // fgain is output gain 0-1.0
// NOTE: pbuf3 may equal pbuf1 or pbuf2! // NOTE: pbuf3 may equal pbuf1 or pbuf2!
void MIX_MixPaintbuffers( int ibuf1, int ibuf2, int ibuf3, int count, float fgain ) static void MIX_MixPaintbuffers( int ibuf1, int ibuf2, int ibuf3, int count, float fgain )
{ {
portable_samplepair_t *pbuf1, *pbuf2, *pbuf3; portable_samplepair_t *pbuf1, *pbuf2, *pbuf3;
int i, gain; int i, gain;
@@ -855,7 +855,7 @@ void MIX_MixPaintbuffers( int ibuf1, int ibuf2, int ibuf3, int count, float fgai
} }
} }
void MIX_CompressPaintbuffer( int ipaint, int count ) static void MIX_CompressPaintbuffer( int ipaint, int count )
{ {
portable_samplepair_t *pbuf; portable_samplepair_t *pbuf;
paintbuffer_t *ppaint; paintbuffer_t *ppaint;
@@ -871,7 +871,7 @@ void MIX_CompressPaintbuffer( int ipaint, int count )
} }
} }
void S_MixUpsample( int sampleCount, int filtertype ) static void S_MixUpsample( int sampleCount, int filtertype )
{ {
paintbuffer_t *ppaint = MIX_GetCurrentPaintbufferPtr(); paintbuffer_t *ppaint = MIX_GetCurrentPaintbufferPtr();
int ifilter = ppaint->ifilter; int ifilter = ppaint->ifilter;
@@ -884,7 +884,7 @@ void S_MixUpsample( int sampleCount, int filtertype )
ppaint->ifilter++; ppaint->ifilter++;
} }
void MIX_MixRawSamplesBuffer( int end ) static void MIX_MixRawSamplesBuffer( int end )
{ {
portable_samplepair_t *pbuf, *roombuf, *streambuf; portable_samplepair_t *pbuf, *roombuf, *streambuf;
uint i, j, stop; uint i, j, stop;
@@ -928,7 +928,7 @@ void MIX_MixRawSamplesBuffer( int end )
// IROOMBUFFER, IFACINGBUFFER, IFACINGAWAY // IROOMBUFFER, IFACINGBUFFER, IFACINGAWAY
// dsp fx are then applied to these buffers by the caller. // dsp fx are then applied to these buffers by the caller.
// caller also remixes all into final IPAINTBUFFER output. // caller also remixes all into final IPAINTBUFFER output.
void MIX_UpsampleAllPaintbuffers( int end, int count ) static void MIX_UpsampleAllPaintbuffers( int end, int count )
{ {
// 11khz sounds are mixed into 3 buffers based on distance from listener, and facing direction // 11khz sounds are mixed into 3 buffers based on distance from listener, and facing direction
// These buffers are facing, facingaway, room // These buffers are facing, facingaway, room
+39 -31
View File
@@ -428,6 +428,9 @@ void Voice_Disconnect( void )
voice.players_status[i].talking_ack = false; voice.players_status[i].talking_ack = false;
} }
} }
VoiceCapture_Shutdown();
voice.device_opened = false;
} }
/* /*
@@ -588,48 +591,53 @@ Voice_Init
Initialize the voice subsystem Initialize the voice subsystem
========================= =========================
*/ */
qboolean Voice_Init( const char *pszCodecName, int quality ) qboolean Voice_Init( const char *pszCodecName, int quality, qboolean preinit )
{ {
if( !voice_enable.value ) if( !voice_enable.value )
return false; return false;
if( Q_strcmp( pszCodecName, VOICE_OPUS_CUSTOM_CODEC ))
{
Con_Printf( S_ERROR "Server requested unsupported codec: %s\n", pszCodecName );
return false;
}
// reinitialize only if codec parameters are different // reinitialize only if codec parameters are different
if( !Q_strcmp( voice.codec, pszCodecName ) && voice.quality == quality ) if( Q_strcmp( pszCodecName, voice.codec ) || voice.quality != quality )
return true;
Voice_Shutdown();
voice.autogain.block_size = 128;
if( !Voice_InitOpusDecoder( ))
{ {
// no reason to init encoder and open audio device
// if we can't hear other players
Con_Printf( S_ERROR "Voice chat disabled.\n" );
Voice_Shutdown(); Voice_Shutdown();
return false;
if( Q_strcmp( pszCodecName, VOICE_OPUS_CUSTOM_CODEC ))
{
Con_Printf( S_ERROR "Server requested unsupported codec: %s\n", pszCodecName );
return false;
}
voice.autogain.block_size = 128;
if( !Voice_InitOpusDecoder( ))
{
// no reason to init encoder and open audio device
// if we can't hear other players
Con_Printf( S_ERROR "Voice chat disabled.\n" );
Voice_Shutdown();
return false;
}
// we can hear others players, so it's fine to fail now
voice.initialized = true;
Q_strncpy( voice.codec, pszCodecName, sizeof( voice.codec ));
if( !Voice_InitOpusEncoder( quality ))
{
Con_Printf( S_WARN "Other players will not be able to hear you.\n" );
return false;
}
voice.quality = quality;
} }
// we can hear others players, so it's fine to fail now if( !preinit )
voice.initialized = true;
Q_strncpy( voice.codec, pszCodecName, sizeof( voice.codec ));
if( !Voice_InitOpusEncoder( quality ))
{ {
Con_Printf( S_WARN "Other players will not be able to hear you.\n" ); voice.device_opened = VoiceCapture_Init();
return false;
if( !voice.device_opened )
Con_Printf( S_WARN "No microphone is available.\n" );
} }
voice.quality = quality;
if( !VoiceCapture_Init( ))
Con_Printf( S_WARN "No microphone is available.\n" );
return true; return true;
} }
+2 -1
View File
@@ -53,6 +53,7 @@ typedef struct voice_state_s
qboolean initialized; qboolean initialized;
qboolean is_recording; qboolean is_recording;
qboolean device_opened;
double start_time; double start_time;
voice_status_t local; voice_status_t local;
@@ -92,7 +93,7 @@ extern voice_state_t voice;
void CL_AddVoiceToDatagram( void ); void CL_AddVoiceToDatagram( void );
void Voice_RegisterCvars( void ); void Voice_RegisterCvars( void );
qboolean Voice_Init( const char *pszCodecName, int quality ); qboolean Voice_Init( const char *pszCodecName, int quality, qboolean preinit );
void Voice_Idle( double frametime ); void Voice_Idle( double frametime );
qboolean Voice_IsRecording( void ); qboolean Voice_IsRecording( void );
void Voice_RecordStop( void ); void Voice_RecordStop( void );
+4 -4
View File
@@ -52,7 +52,7 @@ CSCR_ExpectString
Return true if next token is pExpext and skip it Return true if next token is pExpext and skip it
=================== ===================
*/ */
qboolean CSCR_ExpectString( parserstate_t *ps, const char *pExpect, qboolean skip, qboolean error ) static qboolean CSCR_ExpectString( parserstate_t *ps, const char *pExpect, qboolean skip, qboolean error )
{ {
char *tmp = COM_ParseFile( ps->buf, ps->token, sizeof( ps->token )); char *tmp = COM_ParseFile( ps->buf, ps->token, sizeof( ps->token ));
@@ -75,7 +75,7 @@ CSCR_ParseType
Determine script variable type Determine script variable type
=================== ===================
*/ */
cvartype_t CSCR_ParseType( parserstate_t *ps ) static cvartype_t CSCR_ParseType( parserstate_t *ps )
{ {
int i; int i;
@@ -96,7 +96,7 @@ cvartype_t CSCR_ParseType( parserstate_t *ps )
CSCR_ParseSingleCvar CSCR_ParseSingleCvar
========================= =========================
*/ */
qboolean CSCR_ParseSingleCvar( parserstate_t *ps, scrvardef_t *result ) static qboolean CSCR_ParseSingleCvar( parserstate_t *ps, scrvardef_t *result )
{ {
// read the name // read the name
ps->buf = COM_ParseFile( ps->buf, result->name, sizeof( result->name )); ps->buf = COM_ParseFile( ps->buf, result->name, sizeof( result->name ));
@@ -170,7 +170,7 @@ CSCR_ParseHeader
Check version and seek to first cvar name Check version and seek to first cvar name
====================== ======================
*/ */
qboolean CSCR_ParseHeader( parserstate_t *ps ) static qboolean CSCR_ParseHeader( parserstate_t *ps )
{ {
if( !CSCR_ExpectString( ps, "VERSION", false, true )) if( !CSCR_ExpectString( ps, "VERSION", false, true ))
return false; return false;
+10 -10
View File
@@ -53,7 +53,7 @@ static void Cmd_ExecuteStringWithPrivilegeCheck( const char *text, qboolean isPr
Cbuf_Init Cbuf_Init
============ ============
*/ */
void Cbuf_Init( void ) static void Cbuf_Init( void )
{ {
cmd_text.data = cmd_text_buf; cmd_text.data = cmd_text_buf;
filteredcmd_text.data = filteredcmd_text_buf; filteredcmd_text.data = filteredcmd_text_buf;
@@ -79,7 +79,7 @@ void Cbuf_Clear( void )
Cbuf_GetSpace Cbuf_GetSpace
============ ============
*/ */
void *Cbuf_GetSpace( cmdbuf_t *buf, int length ) static void *Cbuf_GetSpace( cmdbuf_t *buf, int length )
{ {
void *data; void *data;
@@ -176,7 +176,7 @@ void Cbuf_InsertText( const char *text )
Cbuf_Execute Cbuf_Execute
============ ============
*/ */
void Cbuf_ExecuteCommandsFromBuffer( cmdbuf_t *buf, qboolean isPrivileged, int cmdsToExecute ) static void Cbuf_ExecuteCommandsFromBuffer( cmdbuf_t *buf, qboolean isPrivileged, int cmdsToExecute )
{ {
char *text; char *text;
char line[MAX_CMD_LINE]; char line[MAX_CMD_LINE];
@@ -356,7 +356,7 @@ hl.exe -dev 3 +map c1a0d
hl.exe -nosound -game bshift hl.exe -nosound -game bshift
=============== ===============
*/ */
void Cmd_StuffCmds_f( void ) static void Cmd_StuffCmds_f( void )
{ {
host.stuffcmds_pending = true; host.stuffcmds_pending = true;
} }
@@ -370,7 +370,7 @@ next frame. This allows commands like:
bind g "cmd use rocket ; +attack ; wait ; -attack ; cmd use blaster" bind g "cmd use rocket ; +attack ; wait ; -attack ; cmd use blaster"
============ ============
*/ */
void Cmd_Wait_f( void ) static void Cmd_Wait_f( void )
{ {
cmd_wait = true; cmd_wait = true;
} }
@@ -382,7 +382,7 @@ Cmd_Echo_f
Just prints the rest of the line to the console Just prints the rest of the line to the console
=============== ===============
*/ */
void Cmd_Echo_f( void ) static void Cmd_Echo_f( void )
{ {
int i; int i;
@@ -398,7 +398,7 @@ Cmd_Alias_f
Creates a new command that executes a command string (possibly ; seperated) Creates a new command that executes a command string (possibly ; seperated)
=============== ===============
*/ */
void Cmd_Alias_f( void ) static void Cmd_Alias_f( void )
{ {
cmdalias_t *a; cmdalias_t *a;
char cmd[MAX_CMD_LINE]; char cmd[MAX_CMD_LINE];
@@ -882,7 +882,7 @@ Cmd_If_f
Compare and et condition bit if true Compare and et condition bit if true
============ ============
*/ */
void Cmd_If_f( void ) static void Cmd_If_f( void )
{ {
// reset bit first // reset bit first
cmd_condition &= ~BIT( cmd_condlevel ); cmd_condition &= ~BIT( cmd_condlevel );
@@ -943,7 +943,7 @@ Cmd_Else_f
Invert condition bit Invert condition bit
============ ============
*/ */
void Cmd_Else_f( void ) static void Cmd_Else_f( void )
{ {
cmd_condition ^= BIT( cmd_condlevel ); cmd_condition ^= BIT( cmd_condlevel );
} }
@@ -1179,7 +1179,7 @@ void Cmd_ForwardToServer( void )
Cmd_List_f Cmd_List_f
============ ============
*/ */
void Cmd_List_f( void ) static void Cmd_List_f( void )
{ {
cmd_t *cmd; cmd_t *cmd;
int i = 0; int i = 0;
-68
View File
@@ -531,47 +531,6 @@ int GAME_EXPORT COM_FileSize( const char *filename )
return FS_FileSize( filename, false ); return FS_FileSize( filename, false );
} }
/*
=============
COM_AddAppDirectoryToSearchPath
=============
*/
void GAME_EXPORT COM_AddAppDirectoryToSearchPath( const char *pszBaseDir, const char *appName )
{
FS_AddGameHierarchy( pszBaseDir, FS_NOWRITE_PATH );
}
/*
===========
COM_ExpandFilename
Finds the file in the search path, copies over the name with the full path name.
This doesn't search in the pak file.
===========
*/
int GAME_EXPORT COM_ExpandFilename( const char *fileName, char *nameOutBuffer, int nameOutBufferSize )
{
char result[MAX_SYSPATH];
if( !COM_CheckString( fileName ) || !nameOutBuffer || nameOutBufferSize <= 0 )
return 0;
// filename examples:
// media\sierra.avi - D:\Xash3D\valve\media\sierra.avi
// models\barney.mdl - D:\Xash3D\bshift\models\barney.mdl
if( g_fsapi.GetFullDiskPath( result, sizeof( result ), fileName, false ))
{
// check for enough room
if( Q_strlen( result ) > nameOutBufferSize )
return 0;
Q_strncpy( nameOutBuffer, result, nameOutBufferSize );
return 1;
}
return 0;
}
/* /*
============= =============
COM_TrimSpace COM_TrimSpace
@@ -869,18 +828,6 @@ cvar_t *GAME_EXPORT pfnCVarGetPointer( const char *szVarName )
return (cvar_t *)Cvar_FindVar( szVarName ); return (cvar_t *)Cvar_FindVar( szVarName );
} }
/*
=============
pfnCVarDirectSet
allow to set cvar directly
=============
*/
void GAME_EXPORT pfnCVarDirectSet( cvar_t *var, const char *szValue )
{
Cvar_DirectSet( (convar_t *)var, szValue );
}
/* /*
============= =============
COM_CompareFileTime COM_CompareFileTime
@@ -996,21 +943,6 @@ qboolean COM_IsSafeFileToDownload( const char *filename )
return true; return true;
} }
const char *COM_GetResourceTypeName( resourcetype_t restype )
{
switch( restype )
{
case t_decal: return "decal";
case t_eventscript: return "eventscript";
case t_generic: return "generic";
case t_model: return "model";
case t_skin: return "skin";
case t_sound: return "sound";
case t_world: return "world";
default: return "unknown";
}
}
char *_copystring( poolhandle_t mempool, const char *s, const char *filename, int fileline ) char *_copystring( poolhandle_t mempool, const char *s, const char *filename, int fileline )
{ {
size_t size; size_t size;
+2 -26
View File
@@ -388,7 +388,6 @@ void *FS_GetNativeObject( const char *obj );
// //
// cmd.c // cmd.c
// //
void Cbuf_Init( void );
void Cbuf_Clear( void ); void Cbuf_Clear( void );
void Cbuf_AddText( const char *text ); void Cbuf_AddText( const char *text );
void Cbuf_AddTextf( const char *text, ... ) _format( 1 ); void Cbuf_AddTextf( const char *text, ... ) _format( 1 );
@@ -412,9 +411,6 @@ void Cmd_RemoveCommand( const char *cmd_name );
qboolean Cmd_Exists( const char *cmd_name ); qboolean Cmd_Exists( const char *cmd_name );
void Cmd_LookupCmds( void *buffer, void *ptr, setpair_t callback ); void Cmd_LookupCmds( void *buffer, void *ptr, setpair_t callback );
int Cmd_ListMaps( search_t *t , char *lastmapname, size_t len ); int Cmd_ListMaps( search_t *t , char *lastmapname, size_t len );
qboolean Cmd_GetMapList( const char *s, char *completedname, int length );
qboolean Cmd_GetDemoList( const char *s, char *completedname, int length );
qboolean Cmd_GetMovieList( const char *s, char *completedname, int length );
void Cmd_TokenizeString( const char *text ); void Cmd_TokenizeString( const char *text );
void Cmd_ExecuteString( const char *text ); void Cmd_ExecuteString( const char *text );
void Cmd_ForwardToServer( void ); void Cmd_ForwardToServer( void );
@@ -461,13 +457,12 @@ void FS_FreeImage( rgbdata_t *pack );
extern const bpc_desc_t PFDesc[]; // image get pixelformat extern const bpc_desc_t PFDesc[]; // image get pixelformat
qboolean Image_Process( rgbdata_t **pix, int width, int height, uint flags, float reserved ); qboolean Image_Process( rgbdata_t **pix, int width, int height, uint flags, float reserved );
void Image_PaletteHueReplace( byte *palSrc, int newHue, int start, int end, int pal_size ); void Image_PaletteHueReplace( byte *palSrc, int newHue, int start, int end, int pal_size );
void Image_PaletteTranslate( byte *palSrc, int top, int bottom, int pal_size );
void Image_SetForceFlags( uint flags ); // set image force flags on loading void Image_SetForceFlags( uint flags ); // set image force flags on loading
size_t Image_DXTGetLinearSize( int type, int width, int height, int depth );
qboolean Image_CustomPalette( void ); qboolean Image_CustomPalette( void );
void Image_ClearForceFlags( void ); void Image_ClearForceFlags( void );
void Image_SetMDLPointer( byte *p ); void Image_SetMDLPointer( byte *p );
void Image_CheckPaletteQ1( void ); void Image_CheckPaletteQ1( void );
/* /*
======================================================================== ========================================================================
@@ -543,7 +538,6 @@ qboolean Host_IsQuakeCompatible( void );
void EXPORT Host_Shutdown( void ); void EXPORT Host_Shutdown( void );
int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGame, pfnChangeGame func ); int EXPORT Host_Main( int argc, char **argv, const char *progname, int bChangeGame, pfnChangeGame func );
int Host_CompareFileTime( int ft1, int ft2 ); int Host_CompareFileTime( int ft1, int ft2 );
void Host_NewInstance( const char *name, const char *finalmsg );
void Host_EndGame( qboolean abort, const char *message, ... ) _format( 2 ); void Host_EndGame( qboolean abort, const char *message, ... ) _format( 2 );
void Host_AbortCurrentFrame( void ) NORETURN; void Host_AbortCurrentFrame( void ) NORETURN;
void Host_WriteServerConfig( const char *name ); void Host_WriteServerConfig( const char *name );
@@ -556,7 +550,6 @@ void Host_ShutdownServer( void );
void Host_Error( const char *error, ... ) _format( 1 ); void Host_Error( const char *error, ... ) _format( 1 );
void Host_ValidateEngineFeatures( uint32_t features ); void Host_ValidateEngineFeatures( uint32_t features );
void Host_Frame( float time ); void Host_Frame( float time );
void Host_InitDecals( void );
void Host_Credits( void ); void Host_Credits( void );
// //
@@ -600,7 +593,6 @@ void COM_HexConvert( const char *pszInput, int nInputLength, byte *pOutput );
int COM_SaveFile( const char *filename, const void *data, int len ); int COM_SaveFile( const char *filename, const void *data, int len );
byte* COM_LoadFileForMe( const char *filename, int *pLength ); byte* COM_LoadFileForMe( const char *filename, int *pLength );
qboolean COM_IsSafeFileToDownload( const char *filename ); qboolean COM_IsSafeFileToDownload( const char *filename );
const char *COM_GetResourceTypeName( resourcetype_t restype );
cvar_t *pfnCVarGetPointer( const char *szVarName ); cvar_t *pfnCVarGetPointer( const char *szVarName );
int pfnDrawConsoleString( int x, int y, char *string ); int pfnDrawConsoleString( int x, int y, char *string );
void pfnDrawSetTextColor( float r, float g, float b ); void pfnDrawSetTextColor( float r, float g, float b );
@@ -608,7 +600,6 @@ void pfnDrawConsoleStringLen( const char *pText, int *length, int *height );
void *Cache_Check( poolhandle_t mempool, struct cache_user_s *c ); void *Cache_Check( poolhandle_t mempool, struct cache_user_s *c );
void COM_TrimSpace( const char *source, char *dest ); void COM_TrimSpace( const char *source, char *dest );
void pfnGetModelBounds( model_t *mod, float *mins, float *maxs ); void pfnGetModelBounds( model_t *mod, float *mins, float *maxs );
void pfnCVarDirectSet( cvar_t *var, const char *szValue );
int COM_CheckParm( char *parm, char **ppnext ); int COM_CheckParm( char *parm, char **ppnext );
void pfnGetGameDir( char *szGetGameDir ); void pfnGetGameDir( char *szGetGameDir );
int pfnGetModelType( model_t *mod ); int pfnGetModelType( model_t *mod );
@@ -650,7 +641,6 @@ void pfnResetTutorMessageDecayData( void );
// //
// con_utils.c // con_utils.c
// //
qboolean Cmd_AutocompleteName( const char *source, int arg, char *buffer, size_t bufsize );
void Con_CompleteCommand( field_t *field ); void Con_CompleteCommand( field_t *field );
void Cmd_AutoComplete( char *complete_string ); void Cmd_AutoComplete( char *complete_string );
void Cmd_AutoCompleteClear( void ); void Cmd_AutoCompleteClear( void );
@@ -706,24 +696,15 @@ void CL_LegacyUpdateInfo( void );
void CL_CharEvent( int key ); void CL_CharEvent( int key );
qboolean CL_DisableVisibility( void ); qboolean CL_DisableVisibility( void );
byte *COM_LoadFile( const char *filename, int usehunk, int *pLength ); byte *COM_LoadFile( const char *filename, int usehunk, int *pLength );
int CL_GetDemoComment( const char *demoname, char *comment );
void COM_AddAppDirectoryToSearchPath( const char *pszBaseDir, const char *appName );
int COM_ExpandFilename( const char *fileName, char *nameOutBuffer, int nameOutBufferSize );
struct cmd_s *Cmd_GetFirstFunctionHandle( void ); struct cmd_s *Cmd_GetFirstFunctionHandle( void );
struct cmd_s *Cmd_GetNextFunctionHandle( struct cmd_s *cmd ); struct cmd_s *Cmd_GetNextFunctionHandle( struct cmd_s *cmd );
struct cmdalias_s *Cmd_AliasGetList( void ); struct cmdalias_s *Cmd_AliasGetList( void );
const char *Cmd_GetName( struct cmd_s *cmd ); const char *Cmd_GetName( struct cmd_s *cmd );
void SV_StartSound( edict_t *ent, int chan, const char *sample, float vol, float attn, int flags, int pitch );
void SV_CreateDecal( sizebuf_t *msg, const float *origin, int decalIndex, int entityIndex, int modelIndex, int flags, float scale );
void Log_Printf( const char *fmt, ... ) _format( 1 ); void Log_Printf( const char *fmt, ... ) _format( 1 );
void SV_BroadcastCommand( const char *fmt, ... ) _format( 1 ); void SV_BroadcastCommand( const char *fmt, ... ) _format( 1 );
qboolean SV_RestoreCustomDecal( struct decallist_s *entry, edict_t *pEdict, qboolean adjacent );
void SV_BroadcastPrintf( struct sv_client_s *ignore, const char *fmt, ... ) _format( 2 ); void SV_BroadcastPrintf( struct sv_client_s *ignore, const char *fmt, ... ) _format( 2 );
int R_CreateDecalList( struct decallist_s *pList );
void R_ClearAllDecals( void );
void CL_ClearStaticEntities( void ); void CL_ClearStaticEntities( void );
qboolean S_StreamGetCurrentState( char *currentTrack, char *loopTrack, int *position ); qboolean S_StreamGetCurrentState( char *currentTrack, char *loopTrack, int *position );
struct cl_entity_s *CL_GetEntityByIndex( int index );
void CL_ServerCommand( qboolean reliable, const char *fmt, ... ) _format( 2 ); void CL_ServerCommand( qboolean reliable, const char *fmt, ... ) _format( 2 );
void CL_HudMessage( const char *pMessage ); void CL_HudMessage( const char *pMessage );
const char *CL_MsgInfo( int cmd ); const char *CL_MsgInfo( int cmd );
@@ -732,17 +713,14 @@ void SV_DrawOrthoTriangles( void );
double CL_GetDemoFramerate( void ); double CL_GetDemoFramerate( void );
qboolean UI_CreditsActive( void ); qboolean UI_CreditsActive( void );
void CL_StopPlayback( void ); void CL_StopPlayback( void );
void CL_ExtraUpdate( void );
int CL_GetMaxClients( void ); int CL_GetMaxClients( void );
int SV_GetMaxClients( void ); int SV_GetMaxClients( void );
qboolean CL_IsRecordDemo( void ); qboolean CL_IsRecordDemo( void );
qboolean CL_IsTimeDemo( void ); qboolean CL_IsTimeDemo( void );
qboolean CL_IsPlaybackDemo( void ); qboolean CL_IsPlaybackDemo( void );
qboolean SV_Initialized( void ); qboolean SV_Initialized( void );
qboolean CL_LoadProgs( const char *name );
void CL_ProcessFile( qboolean successfully_received, const char *filename ); void CL_ProcessFile( qboolean successfully_received, const char *filename );
int SV_GetSaveComment( const char *savename, char *comment ); int SV_GetSaveComment( const char *savename, char *comment );
qboolean SV_NewGame( const char *mapName, qboolean loadGame );
void SV_ClipPMoveToEntity( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr ); void SV_ClipPMoveToEntity( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
void CL_ClipPMoveToEntity( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr ); void CL_ClipPMoveToEntity( struct physent_s *pe, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, struct pmtrace_s *tr );
void SV_SysError( const char *error_string ); void SV_SysError( const char *error_string );
@@ -751,11 +729,9 @@ void SV_ExecLoadLevel( void );
void SV_ExecLoadGame( void ); void SV_ExecLoadGame( void );
void SV_ExecChangeLevel( void ); void SV_ExecChangeLevel( void );
void CL_WriteMessageHistory( void ); void CL_WriteMessageHistory( void );
void CL_SendCmd( void );
void CL_Disconnect( void ); void CL_Disconnect( void );
void CL_ClearEdicts( void ); void CL_ClearEdicts( void );
void CL_Crashed( void ); void CL_Crashed( void );
qboolean CL_NextDemo( void );
char *SV_Serverinfo( void ); char *SV_Serverinfo( void );
void CL_Drop( void ); void CL_Drop( void );
void Con_Init( void ); void Con_Init( void );
@@ -780,7 +756,6 @@ qboolean Info_SetValueForStarKey( char *s, const char *key, const char *value, i
qboolean Info_IsValid( const char *s ); qboolean Info_IsValid( const char *s );
void Info_WriteVars( file_t *f ); void Info_WriteVars( file_t *f );
void Info_Print( const char *s ); void Info_Print( const char *s );
void Cmd_WriteVariables( file_t *f );
int Cmd_CheckMapsList( int fRefresh ); int Cmd_CheckMapsList( int fRefresh );
void COM_SetRandomSeed( int lSeed ); void COM_SetRandomSeed( int lSeed );
int COM_RandomLong( int lMin, int lMax ); int COM_RandomLong( int lMin, int lMax );
@@ -802,6 +777,7 @@ int COM_FileSize( const char *filename );
void COM_FreeFile( void *buffer ); void COM_FreeFile( void *buffer );
int COM_CompareFileTime( const char *filename1, const char *filename2, int *iCompare ); int COM_CompareFileTime( const char *filename1, const char *filename2, int *iCompare );
char *va( const char *format, ... ) _format( 1 ); char *va( const char *format, ... ) _format( 1 );
qboolean CRC32_MapFile( dword *crcvalue, const char *filename, qboolean multiplayer );
// soundlib shared exports // soundlib shared exports
qboolean S_Init( void ); qboolean S_Init( void );
+17 -21
View File
@@ -184,7 +184,7 @@ Cmd_GetMapList
Prints or complete map filename Prints or complete map filename
===================================== =====================================
*/ */
qboolean Cmd_GetMapList( const char *s, char *completedname, int length ) static qboolean Cmd_GetMapList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -220,7 +220,7 @@ Cmd_GetDemoList
Prints or complete demo filename Prints or complete demo filename
===================================== =====================================
*/ */
qboolean Cmd_GetDemoList( const char *s, char *completedname, int length ) static qboolean Cmd_GetDemoList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -267,7 +267,7 @@ Cmd_GetMovieList
Prints or complete movie filename Prints or complete movie filename
===================================== =====================================
*/ */
qboolean Cmd_GetMovieList( const char *s, char *completedname, int length ) static qboolean Cmd_GetMovieList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -314,7 +314,7 @@ Cmd_GetMusicList
Prints or complete background track filename Prints or complete background track filename
===================================== =====================================
*/ */
qboolean Cmd_GetMusicList( const char *s, char *completedname, int length ) static qboolean Cmd_GetMusicList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -362,7 +362,7 @@ Cmd_GetSavesList
Prints or complete savegame filename Prints or complete savegame filename
===================================== =====================================
*/ */
qboolean Cmd_GetSavesList( const char *s, char *completedname, int length ) static qboolean Cmd_GetSavesList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -409,7 +409,7 @@ Cmd_GetConfigList
Prints or complete .cfg filename Prints or complete .cfg filename
===================================== =====================================
*/ */
qboolean Cmd_GetConfigList( const char *s, char *completedname, int length ) static qboolean Cmd_GetConfigList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -456,7 +456,7 @@ Cmd_GetSoundList
Prints or complete sound filename Prints or complete sound filename
===================================== =====================================
*/ */
qboolean Cmd_GetSoundList( const char *s, char *completedname, int length ) static qboolean Cmd_GetSoundList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -508,7 +508,7 @@ Cmd_GetItemsList
Prints or complete item classname (weapons only) Prints or complete item classname (weapons only)
===================================== =====================================
*/ */
qboolean Cmd_GetItemsList( const char *s, char *completedname, int length ) static qboolean Cmd_GetItemsList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -555,7 +555,7 @@ Cmd_GetKeysList
Autocomplete for bind command Autocomplete for bind command
===================================== =====================================
*/ */
qboolean Cmd_GetKeysList( const char *s, char *completedname, int length ) static qboolean Cmd_GetKeysList( const char *s, char *completedname, int length )
{ {
size_t i, numkeys; size_t i, numkeys;
string keys[256]; string keys[256];
@@ -636,7 +636,7 @@ Cmd_GetCommandsList
Autocomplete for bind command Autocomplete for bind command
===================================== =====================================
*/ */
qboolean Cmd_GetCommandsList( const char *s, char *completedname, int length ) static qboolean Cmd_GetCommandsList( const char *s, char *completedname, int length )
{ {
size_t i; size_t i;
string matchbuf; string matchbuf;
@@ -701,7 +701,7 @@ Cmd_GetCustomList
Prints or complete .HPK filenames Prints or complete .HPK filenames
===================================== =====================================
*/ */
qboolean Cmd_GetCustomList( const char *s, char *completedname, int length ) static qboolean Cmd_GetCustomList( const char *s, char *completedname, int length )
{ {
search_t *t; search_t *t;
string matchbuf; string matchbuf;
@@ -747,17 +747,13 @@ Cmd_GetGameList
Prints or complete gamedir name Prints or complete gamedir name
===================================== =====================================
*/ */
qboolean Cmd_GetGamesList( const char *s, char *completedname, int length ) static qboolean Cmd_GetGamesList( const char *s, char *completedname, int length )
{ {
int i, numgamedirs; int i, numgamedirs;
string gamedirs[MAX_MODS]; string gamedirs[MAX_MODS];
string matchbuf; string matchbuf;
int len; int len;
// stand-alone games doesn't have cmd "game"
if( !Cmd_Exists( "game" ))
return false;
// compare gamelist with current keyword // compare gamelist with current keyword
len = Q_strlen( s ); len = Q_strlen( s );
@@ -800,7 +796,7 @@ Cmd_GetCDList
Prints or complete CD command name Prints or complete CD command name
===================================== =====================================
*/ */
qboolean Cmd_GetCDList( const char *s, char *completedname, int length ) static qboolean Cmd_GetCDList( const char *s, char *completedname, int length )
{ {
int i, numcdcommands; int i, numcdcommands;
string cdcommands[8]; string cdcommands[8];
@@ -854,7 +850,7 @@ qboolean Cmd_GetCDList( const char *s, char *completedname, int length )
return true; return true;
} }
qboolean Cmd_CheckMapsList_R( qboolean fRefresh, qboolean onlyingamedir ) static qboolean Cmd_CheckMapsList_R( qboolean fRefresh, qboolean onlyingamedir )
{ {
qboolean use_filter = false; qboolean use_filter = false;
byte buf[MAX_SYSPATH]; byte buf[MAX_SYSPATH];
@@ -1061,7 +1057,7 @@ Autocomplete filename
for various cmds for various cmds
============ ============
*/ */
qboolean Cmd_AutocompleteName( const char *source, int arg, char *buffer, size_t bufsize ) static qboolean Cmd_AutocompleteName( const char *source, int arg, char *buffer, size_t bufsize )
{ {
autocomplete_list_t *list; autocomplete_list_t *list;
@@ -1345,13 +1341,13 @@ static void Cmd_WriteHelp(const char *name, const char *unused, const char *desc
if( length == 0 ) FS_Printf( f, "%s \"%s\"\n", name, desc ); if( length == 0 ) FS_Printf( f, "%s \"%s\"\n", name, desc );
} }
void Cmd_WriteOpenGLVariables( file_t *f ) static void Cmd_WriteOpenGLVariables( file_t *f )
{ {
Cvar_LookupVars( FCVAR_GLCONFIG, NULL, f, (setpair_t)Cmd_WriteOpenGLCvar ); Cvar_LookupVars( FCVAR_GLCONFIG, NULL, f, (setpair_t)Cmd_WriteOpenGLCvar );
} }
#if !XASH_DEDICATED #if !XASH_DEDICATED
void Host_FinalizeConfig( file_t *f, const char *config ) static void Host_FinalizeConfig( file_t *f, const char *config )
{ {
string backup, newcfg; string backup, newcfg;
+3 -3
View File
@@ -372,9 +372,9 @@ static void Sys_Crash( int signal, siginfo_t *si, void *context)
bp = (void**)ucontext->uc_mcontext.mc_rbp; bp = (void**)ucontext->uc_mcontext.mc_rbp;
sp = (void**)ucontext->uc_mcontext.mc_rsp; sp = (void**)ucontext->uc_mcontext.mc_rsp;
#elif XASH_NETBSD #elif XASH_NETBSD
pc = (void*)ucontext->uc_mcontext.__gregs[REG_RIP]; pc = (void*)ucontext->uc_mcontext.__gregs[_REG_RIP];
bp = (void**)ucontext->uc_mcontext.__gregs[REG_RBP]; bp = (void**)ucontext->uc_mcontext.__gregs[_REG_RBP];
sp = (void**)ucontext->uc_mcontext.__gregs[REG_RSP]; sp = (void**)ucontext->uc_mcontext.__gregs[_REG_RSP];
#elif XASH_OPENBSD #elif XASH_OPENBSD
pc = (void*)ucontext->sc_rip; pc = (void*)ucontext->sc_rip;
bp = (void**)ucontext->sc_rbp; bp = (void**)ucontext->sc_rbp;
+8 -8
View File
@@ -195,7 +195,7 @@ Cvar_ValidateString
deal with userinfo etc deal with userinfo etc
============ ============
*/ */
const char *Cvar_ValidateString( convar_t *var, const char *value ) static const char *Cvar_ValidateString( convar_t *var, const char *value )
{ {
const char *pszValue; const char *pszValue;
static char szNew[MAX_STRING]; static char szNew[MAX_STRING];
@@ -278,7 +278,7 @@ Cvar_UnlinkVar
unlink the variable unlink the variable
============ ============
*/ */
int Cvar_UnlinkVar( const char *var_name, int group ) static int Cvar_UnlinkVar( const char *var_name, int group )
{ {
int count = 0; int count = 0;
convar_t **prev; convar_t **prev;
@@ -685,7 +685,7 @@ Cvar_DirectSet
way to change value for many cvars way to change value for many cvars
============ ============
*/ */
void Cvar_DirectSet( convar_t *var, const char *value ) void GAME_EXPORT Cvar_DirectSet( convar_t *var, const char *value )
{ {
const char *pszValue; const char *pszValue;
@@ -1091,7 +1091,7 @@ Cvar_Toggle_f
Toggles a cvar for easy single key binding Toggles a cvar for easy single key binding
============ ============
*/ */
void Cvar_Toggle_f( void ) static void Cvar_Toggle_f( void )
{ {
int v; int v;
@@ -1114,7 +1114,7 @@ Allows setting and defining of arbitrary cvars from console, even if they
weren't declared in C code. weren't declared in C code.
============ ============
*/ */
void Cvar_Set_f( void ) static void Cvar_Set_f( void )
{ {
int i, c, l = 0, len; int i, c, l = 0, len;
char combined[MAX_CMD_TOKENS]; char combined[MAX_CMD_TOKENS];
@@ -1147,7 +1147,7 @@ Cvar_SetGL_f
As Cvar_Set, but also flags it as glconfig As Cvar_Set, but also flags it as glconfig
============ ============
*/ */
void Cvar_SetGL_f( void ) static void Cvar_SetGL_f( void )
{ {
if( Cmd_Argc() != 3 ) if( Cmd_Argc() != 3 )
{ {
@@ -1163,7 +1163,7 @@ void Cvar_SetGL_f( void )
Cvar_Reset_f Cvar_Reset_f
============ ============
*/ */
void Cvar_Reset_f( void ) static void Cvar_Reset_f( void )
{ {
if( Cmd_Argc() != 2 ) if( Cmd_Argc() != 2 )
{ {
@@ -1179,7 +1179,7 @@ void Cvar_Reset_f( void )
Cvar_List_f Cvar_List_f
============ ============
*/ */
void Cvar_List_f( void ) static void Cvar_List_f( void )
{ {
convar_t *var; convar_t *var;
const char *match = NULL; const char *match = NULL;
-9
View File
@@ -134,15 +134,6 @@ void Con_Init( void )
} }
void R_ClearAllDecals( void )
{
}
int R_CreateDecalList( struct decallist_s *pList )
{
return 0;
}
void GAME_EXPORT S_StopSound(int entnum, int channel, const char *soundname) void GAME_EXPORT S_StopSound(int entnum, int channel, const char *soundname)
{ {
+16 -16
View File
@@ -65,7 +65,7 @@ static CVAR_DEFINE( host_sleeptime, "sleeptime", "1", FCVAR_ARCHIVE|FCVAR_FILTER
static CVAR_DEFINE_AUTO( host_sleeptime_debug, "0", 0, "print sleeps between frames" ); static CVAR_DEFINE_AUTO( host_sleeptime_debug, "0", 0, "print sleeps between frames" );
CVAR_DEFINE( con_gamemaps, "con_mapfilter", "1", FCVAR_ARCHIVE, "when true show only maps in game folder" ); CVAR_DEFINE( con_gamemaps, "con_mapfilter", "1", FCVAR_ARCHIVE, "when true show only maps in game folder" );
void Sys_PrintUsage( void ) static void Sys_PrintUsage( void )
{ {
string version_str; string version_str;
const char *usage_str; const char *usage_str;
@@ -348,7 +348,7 @@ static int Host_CalcSleep( void )
return host_sleeptime.value; return host_sleeptime.value;
} }
void Host_NewInstance( const char *name, const char *finalmsg ) static void Host_NewInstance( const char *name, const char *finalmsg )
{ {
if( !pChangeGame ) return; if( !pChangeGame ) return;
@@ -366,7 +366,7 @@ Host_ChangeGame_f
Change game modification Change game modification
================= =================
*/ */
void Host_ChangeGame_f( void ) static void Host_ChangeGame_f( void )
{ {
int i; int i;
@@ -405,7 +405,7 @@ void Host_ChangeGame_f( void )
Host_Exec_f Host_Exec_f
=============== ===============
*/ */
void Host_Exec_f( void ) static void Host_Exec_f( void )
{ {
string cfgpath; string cfgpath;
byte *f; byte *f;
@@ -491,7 +491,7 @@ void Host_Exec_f( void )
Host_MemStats_f Host_MemStats_f
=============== ===============
*/ */
void Host_MemStats_f( void ) static void Host_MemStats_f( void )
{ {
switch( Cmd_Argc( )) switch( Cmd_Argc( ))
{ {
@@ -509,7 +509,7 @@ void Host_MemStats_f( void )
} }
} }
void Host_Minimize_f( void ) static void Host_Minimize_f( void )
{ {
#ifdef XASH_SDL #ifdef XASH_SDL
if( host.hWnd ) SDL_MinimizeWindow( host.hWnd ); if( host.hWnd ) SDL_MinimizeWindow( host.hWnd );
@@ -548,7 +548,7 @@ qboolean Host_IsLocalClient( void )
Host_RegisterDecal Host_RegisterDecal
================= =================
*/ */
qboolean Host_RegisterDecal( const char *name, int *count ) static qboolean Host_RegisterDecal( const char *name, int *count )
{ {
char shortname[MAX_QPATH]; char shortname[MAX_QPATH];
int i; int i;
@@ -582,7 +582,7 @@ qboolean Host_RegisterDecal( const char *name, int *count )
Host_InitDecals Host_InitDecals
================= =================
*/ */
void Host_InitDecals( void ) static void Host_InitDecals( void )
{ {
int i, num_decals = 0; int i, num_decals = 0;
search_t *t; search_t *t;
@@ -613,7 +613,7 @@ Host_GetCommands
Add them exactly as if they had been typed at the console Add them exactly as if they had been typed at the console
=================== ===================
*/ */
void Host_GetCommands( void ) static void Host_GetCommands( void )
{ {
char *cmd; char *cmd;
@@ -631,7 +631,7 @@ Host_CalcFPS
compute actual FPS for various modes compute actual FPS for various modes
=================== ===================
*/ */
double Host_CalcFPS( void ) static double Host_CalcFPS( void )
{ {
double fps = 0.0; double fps = 0.0;
@@ -748,7 +748,7 @@ Host_FilterTime
Returns false if the time is too short to run a frame Returns false if the time is too short to run a frame
=================== ===================
*/ */
qboolean Host_FilterTime( float time ) static qboolean Host_FilterTime( float time )
{ {
static double oldtime; static double oldtime;
double dt; double dt;
@@ -873,7 +873,7 @@ void GAME_EXPORT Host_Error( const char *error, ... )
Host_AbortCurrentFrame(); Host_AbortCurrentFrame();
} }
void Host_Error_f( void ) static void Host_Error_f( void )
{ {
const char *error = Cmd_Argv( 1 ); const char *error = Cmd_Argv( 1 );
@@ -881,7 +881,7 @@ void Host_Error_f( void )
Host_Error( "%s\n", error ); Host_Error( "%s\n", error );
} }
void Sys_Error_f( void ) static void Sys_Error_f( void )
{ {
const char *error = Cmd_Argv( 1 ); const char *error = Cmd_Argv( 1 );
@@ -904,7 +904,7 @@ static void Host_Crash_f( void )
Host_Userconfigd_f Host_Userconfigd_f
================= =================
*/ */
void Host_Userconfigd_f( void ) static void Host_Userconfigd_f( void )
{ {
search_t *t; search_t *t;
int i; int i;
@@ -948,7 +948,7 @@ static void Host_RunTests( int stage )
Host_InitCommon Host_InitCommon
================= =================
*/ */
void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bChangeGame ) static void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bChangeGame )
{ {
char dev_level[4]; char dev_level[4];
int developer = DEFAULT_DEV; int developer = DEFAULT_DEV;
@@ -1240,7 +1240,7 @@ void Host_InitCommon( int argc, char **argv, const char *progname, qboolean bCha
Key_Init(); Key_Init();
} }
void Host_FreeCommon( void ) static void Host_FreeCommon( void )
{ {
Image_Shutdown(); Image_Shutdown();
Sound_Shutdown(); Sound_Shutdown();
+2 -2
View File
@@ -121,7 +121,7 @@ void COM_ChangeLevel( char const *pNewLevel, char const *pLandmarkName, qboolean
GameState->newGame = false; GameState->newGame = false;
} }
void Host_ShutdownGame( void ) static void Host_ShutdownGame( void )
{ {
SV_ShutdownGame(); SV_ShutdownGame();
@@ -137,7 +137,7 @@ void Host_ShutdownGame( void )
} }
} }
void Host_RunFrame( float time ) static void Host_RunFrame( float time )
{ {
// at this time, we don't need to get events from OS on dedicated // at this time, we don't need to get events from OS on dedicated
#if !XASH_DEDICATED #if !XASH_DEDICATED
+6 -6
View File
@@ -34,7 +34,7 @@ static hash_pack_queue_t *gp_hpak_queue = NULL;
static hpak_header_t hash_pack_header; static hpak_header_t hash_pack_header;
static hpak_info_t hash_pack_info; static hpak_info_t hash_pack_info;
const char *HPAK_TypeFromIndex( int type ) static const char *HPAK_TypeFromIndex( int type )
{ {
switch( type ) switch( type )
{ {
@@ -94,7 +94,7 @@ void HPAK_FlushHostQueue( void )
gp_hpak_queue = NULL; gp_hpak_queue = NULL;
} }
void HPAK_CreatePak( const char *filename, resource_t *pResource, byte *pData, file_t *fin ) static void HPAK_CreatePak( const char *filename, resource_t *pResource, byte *pData, file_t *fin )
{ {
int filelocation; int filelocation;
string pakname; string pakname;
@@ -872,7 +872,7 @@ void HPAK_RemoveLump( const char *name, resource_t *pResource )
FS_Rename( save_path, read_path ); FS_Rename( save_path, read_path );
} }
void HPAK_List_f( void ) static void HPAK_List_f( void )
{ {
int nCurrent; int nCurrent;
hpak_header_t header; hpak_header_t header;
@@ -950,7 +950,7 @@ void HPAK_List_f( void )
FS_Close( f ); FS_Close( f );
} }
void HPAK_Extract_f( void ) static void HPAK_Extract_f( void )
{ {
int nCurrent; int nCurrent;
hpak_header_t header; hpak_header_t header;
@@ -1061,7 +1061,7 @@ void HPAK_Extract_f( void )
FS_Close( f ); FS_Close( f );
} }
void HPAK_Remove_f( void ) static void HPAK_Remove_f( void )
{ {
resource_t resource; resource_t resource;
@@ -1083,7 +1083,7 @@ void HPAK_Remove_f( void )
} }
} }
void HPAK_Validate_f( void ) static void HPAK_Validate_f( void )
{ {
if( Cmd_Argc() != 2 ) if( Cmd_Argc() != 2 )
{ {
+6 -6
View File
@@ -17,7 +17,7 @@ GNU General Public License for more details.
#include "xash3d_mathlib.h" #include "xash3d_mathlib.h"
#include "img_dds.h" #include "img_dds.h"
qboolean Image_CheckDXT3Alpha( dds_t *hdr, byte *fin ) static qboolean Image_CheckDXT3Alpha( dds_t *hdr, byte *fin )
{ {
word sAlpha; word sAlpha;
byte *alpha; byte *alpha;
@@ -50,7 +50,7 @@ qboolean Image_CheckDXT3Alpha( dds_t *hdr, byte *fin )
return false; return false;
} }
qboolean Image_CheckDXT5Alpha( dds_t *hdr, byte *fin ) static qboolean Image_CheckDXT5Alpha( dds_t *hdr, byte *fin )
{ {
uint bits, bitmask; uint bits, bitmask;
byte *alphamask; byte *alphamask;
@@ -91,7 +91,7 @@ qboolean Image_CheckDXT5Alpha( dds_t *hdr, byte *fin )
return false; return false;
} }
void Image_DXTGetPixelFormat( dds_t *hdr, dds_header_dxt10_t *headerExt ) static void Image_DXTGetPixelFormat( dds_t *hdr, dds_header_dxt10_t *headerExt )
{ {
uint bits = hdr->dsPixelFormat.dwRGBBitCount; uint bits = hdr->dsPixelFormat.dwRGBBitCount;
@@ -215,7 +215,7 @@ void Image_DXTGetPixelFormat( dds_t *hdr, dds_header_dxt10_t *headerExt )
image.num_mips = hdr->dwMipMapCount; // get actual mip count image.num_mips = hdr->dwMipMapCount; // get actual mip count
} }
size_t Image_DXTCalcMipmapSize( dds_t *hdr ) static size_t Image_DXTCalcMipmapSize( dds_t *hdr )
{ {
size_t buffsize = 0; size_t buffsize = 0;
int i, width, height; int i, width, height;
@@ -231,7 +231,7 @@ size_t Image_DXTCalcMipmapSize( dds_t *hdr )
return buffsize; return buffsize;
} }
uint Image_DXTCalcSize( const char *name, dds_t *hdr, size_t filesize ) static uint Image_DXTCalcSize( const char *name, dds_t *hdr, size_t filesize )
{ {
size_t buffsize = 0; size_t buffsize = 0;
int w = image.width; int w = image.width;
@@ -269,7 +269,7 @@ uint Image_DXTCalcSize( const char *name, dds_t *hdr, size_t filesize )
return buffsize; return buffsize;
} }
void Image_DXTAdjustVolume( dds_t *hdr ) static void Image_DXTAdjustVolume( dds_t *hdr )
{ {
if( hdr->dwDepth <= 1 ) if( hdr->dwDepth <= 1 )
return; return;
+1
View File
@@ -597,6 +597,7 @@ void Test_RunImagelib( void )
} }
#define IMPLEMENT_IMAGELIB_FUZZ_TARGET( export, target ) \ #define IMPLEMENT_IMAGELIB_FUZZ_TARGET( export, target ) \
int export( const uint8_t *Data, size_t Size ); \
int EXPORT export( const uint8_t *Data, size_t Size ) \ int EXPORT export( const uint8_t *Data, size_t Size ) \
{ \ { \
rgbdata_t *rgb; \ rgbdata_t *rgb; \
+8 -8
View File
@@ -65,7 +65,7 @@ static int bias[netsize]; // bias and freq arrays for learning
static int freq[netsize]; static int freq[netsize];
static int radpower[initrad]; // radpower for precomputation static int radpower[initrad]; // radpower for precomputation
void initnet( byte *thepic, int len, int sample ) static void initnet( byte *thepic, int len, int sample )
{ {
register int i, *p; register int i, *p;
@@ -83,7 +83,7 @@ void initnet( byte *thepic, int len, int sample )
} }
// Unbias network to give byte values 0..255 and record position i to prepare for sort // Unbias network to give byte values 0..255 and record position i to prepare for sort
void unbiasnet( void ) static void unbiasnet( void )
{ {
int i, j, temp; int i, j, temp;
@@ -103,7 +103,7 @@ void unbiasnet( void )
} }
// Insertion sort of network and building of netindex[0..255] (to do after unbias) // Insertion sort of network and building of netindex[0..255] (to do after unbias)
void inxbuild( void ) static void inxbuild( void )
{ {
register int *p, *q; register int *p, *q;
register int i, j, smallpos, smallval; register int i, j, smallpos, smallval;
@@ -162,7 +162,7 @@ void inxbuild( void )
// Search for BGR values 0..255 (after net is unbiased) and return colour index // Search for BGR values 0..255 (after net is unbiased) and return colour index
int inxsearch( int r, int g, int b ) static int inxsearch( int r, int g, int b )
{ {
register int i, j, dist, a, bestd; register int i, j, dist, a, bestd;
register int *p; register int *p;
@@ -243,7 +243,7 @@ int inxsearch( int r, int g, int b )
} }
// Search for biased BGR values // Search for biased BGR values
int contest( int r, int g, int b ) static int contest( int r, int g, int b )
{ {
register int *p, *f, *n; register int *p, *f, *n;
register int i, dist, a, biasdist, betafreq; register int i, dist, a, biasdist, betafreq;
@@ -298,7 +298,7 @@ int contest( int r, int g, int b )
} }
// Move neuron i towards biased (b,g,r) by factor alpha // Move neuron i towards biased (b,g,r) by factor alpha
void altersingle( int alpha, int i, int r, int g, int b ) static void altersingle( int alpha, int i, int r, int g, int b )
{ {
register int *n; register int *n;
@@ -311,7 +311,7 @@ void altersingle( int alpha, int i, int r, int g, int b )
} }
// Move adjacent neurons by precomputed alpha*(1-((i-j)^2/[r]^2)) in radpower[|i-j|] // Move adjacent neurons by precomputed alpha*(1-((i-j)^2/[r]^2)) in radpower[|i-j|]
void alterneigh( int rad, int i, int r, int g, int b ) static void alterneigh( int rad, int i, int r, int g, int b )
{ {
register int j, k, lo, hi, a; register int j, k, lo, hi, a;
register int *p, *q; register int *p, *q;
@@ -354,7 +354,7 @@ void alterneigh( int rad, int i, int r, int g, int b )
} }
// Main Learning Loop // Main Learning Loop
void learn( void ) static void learn( void )
{ {
register byte *p; register byte *p;
register int i, j, r, g, b; register int i, j, r, g, b;
+12 -12
View File
@@ -281,7 +281,7 @@ int Image_ComparePalette( const byte *pal )
return PAL_CUSTOM; return PAL_CUSTOM;
} }
void Image_SetPalette( const byte *pal, uint *d_table ) static void Image_SetPalette( const byte *pal, uint *d_table )
{ {
byte rgba[4]; byte rgba[4];
uint uirgba; // TODO: palette looks byte-swapped on big-endian uint uirgba; // TODO: palette looks byte-swapped on big-endian
@@ -530,7 +530,7 @@ void Image_PaletteHueReplace( byte *palSrc, int newHue, int start, int end, int
} }
} }
void Image_PaletteTranslate( byte *palSrc, int top, int bottom, int pal_size ) static void Image_PaletteTranslate( byte *palSrc, int top, int bottom, int pal_size )
{ {
byte dst[256], src[256]; byte dst[256], src[256];
int i; int i;
@@ -726,7 +726,7 @@ static void Image_Resample24LerpLine( const byte *in, byte *out, int inwidth, in
} }
} }
void Image_Resample32Lerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight ) static void Image_Resample32Lerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight )
{ {
const byte *inrow; const byte *inrow;
int i, j, r, yi, oldy = 0, f, fstep, lerp, endy = (inheight - 1); int i, j, r, yi, oldy = 0, f, fstep, lerp, endy = (inheight - 1);
@@ -834,7 +834,7 @@ void Image_Resample32Lerp( const void *indata, int inwidth, int inheight, void *
Mem_Free( resamplerow1 ); Mem_Free( resamplerow1 );
} }
void Image_Resample32Nolerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight ) static void Image_Resample32Nolerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight )
{ {
int i, j; int i, j;
uint frac, fracstep; uint frac, fracstep;
@@ -873,7 +873,7 @@ void Image_Resample32Nolerp( const void *indata, int inwidth, int inheight, void
} }
} }
void Image_Resample24Lerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight ) static void Image_Resample24Lerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight )
{ {
const byte *inrow; const byte *inrow;
int i, j, r, yi, oldy, f, fstep, lerp, endy = (inheight - 1); int i, j, r, yi, oldy, f, fstep, lerp, endy = (inheight - 1);
@@ -974,7 +974,7 @@ void Image_Resample24Lerp( const void *indata, int inwidth, int inheight, void *
Mem_Free( resamplerow1 ); Mem_Free( resamplerow1 );
} }
void Image_Resample24Nolerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight ) static void Image_Resample24Nolerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight )
{ {
uint frac, fracstep; uint frac, fracstep;
int i, j, f, inwidth3 = inwidth * 3; int i, j, f, inwidth3 = inwidth * 3;
@@ -1040,7 +1040,7 @@ void Image_Resample24Nolerp( const void *indata, int inwidth, int inheight, void
} }
} }
void Image_Resample8Nolerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight ) static void Image_Resample8Nolerp( const void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight )
{ {
int i, j; int i, j;
byte *in, *inrow; byte *in, *inrow;
@@ -1179,7 +1179,7 @@ byte *Image_FlipInternal( const byte *in, word *srcwidth, word *srcheight, int t
return image.tempbuffer; return image.tempbuffer;
} }
byte *Image_CreateLumaInternal( byte *fin, int width, int height, int type, int flags ) static byte *Image_CreateLumaInternal( byte *fin, int width, int height, int type, int flags )
{ {
byte *out; byte *out;
int i; int i;
@@ -1235,7 +1235,7 @@ Image_Decompress
force to unpack any image to 32-bit buffer force to unpack any image to 32-bit buffer
============= =============
*/ */
qboolean Image_Decompress( const byte *data ) static qboolean Image_Decompress( const byte *data )
{ {
byte *fin, *fout; byte *fin, *fout;
int i, size; int i, size;
@@ -1303,7 +1303,7 @@ qboolean Image_Decompress( const byte *data )
return true; return true;
} }
rgbdata_t *Image_DecompressInternal( rgbdata_t *pic ) static rgbdata_t *Image_DecompressInternal( rgbdata_t *pic )
{ {
// quick case to reject unneeded conversions // quick case to reject unneeded conversions
if( pic->type == PF_RGBA_32 ) if( pic->type == PF_RGBA_32 )
@@ -1326,7 +1326,7 @@ rgbdata_t *Image_DecompressInternal( rgbdata_t *pic )
return pic; return pic;
} }
rgbdata_t *Image_LightGamma( rgbdata_t *pic ) static rgbdata_t *Image_LightGamma( rgbdata_t *pic )
{ {
byte *in = (byte *)pic->buffer; byte *in = (byte *)pic->buffer;
int i; int i;
@@ -1344,7 +1344,7 @@ rgbdata_t *Image_LightGamma( rgbdata_t *pic )
return pic; return pic;
} }
qboolean Image_RemapInternal( rgbdata_t *pic, int topColor, int bottomColor ) static qboolean Image_RemapInternal( rgbdata_t *pic, int topColor, int bottomColor )
{ {
if( !pic->palette ) if( !pic->palette )
return false; return false;
+2 -2
View File
@@ -333,7 +333,7 @@ void Info_RemovePrefixedKeys( char *start, char prefix )
} }
} }
qboolean Info_IsKeyImportant( const char *key ) static qboolean Info_IsKeyImportant( const char *key )
{ {
if( key[0] == '*' ) if( key[0] == '*' )
return true; return true;
@@ -358,7 +358,7 @@ qboolean Info_IsKeyImportant( const char *key )
return false; return false;
} }
char *Info_FindLargestKey( char *s ) static char *Info_FindLargestKey( char *s )
{ {
char key[MAX_KV_SIZE]; char key[MAX_KV_SIZE];
char value[MAX_KV_SIZE]; char value[MAX_KV_SIZE];
+1 -1
View File
@@ -166,7 +166,7 @@ Some modders use _i?86 suffix in game library name
So strip it to follow library naming for non-Intel CPUs So strip it to follow library naming for non-Intel CPUs
============== ==============
*/ */
static void COM_StripIntelSuffix( char *out ) static inline void COM_StripIntelSuffix( char *out )
{ {
char *suffix = Q_strrchr( out, '_' ); char *suffix = Q_strrchr( out, '_' );
+1 -1
View File
@@ -583,7 +583,7 @@ void Mod_PrintWorldStats_f( void )
Mod_DecompressPVS Mod_DecompressPVS
=================== ===================
*/ */
byte *Mod_DecompressPVS( const byte *in, int visbytes ) static byte *Mod_DecompressPVS( const byte *in, int visbytes )
{ {
byte *out; byte *out;
int c; int c;
+1
View File
@@ -20,6 +20,7 @@ GNU General Public License for more details.
#if !XASH_DEDICATED #if !XASH_DEDICATED
#include "ref_common.h" #include "ref_common.h"
#endif // XASH_DEDICATED #endif // XASH_DEDICATED
#include "mod_local.h"
/* /*
-5
View File
@@ -188,11 +188,6 @@ int MSG_SeekToBit( sizebuf_t *sb, int bitPos, int whence )
return 0; return 0;
} }
void MSG_SeekToByte( sizebuf_t *sb, int bytePos )
{
sb->iCurBit = bytePos << 3;
}
void MSG_WriteOneBit( sizebuf_t *sb, int nValue ) void MSG_WriteOneBit( sizebuf_t *sb, int nValue )
{ {
if( !MSG_Overflow( sb, 1 )) if( !MSG_Overflow( sb, 1 ))
+9 -47
View File
@@ -198,44 +198,6 @@ qboolean NetSplit_GetLong( netsplit_t *ns, netadr_t *from, byte *data, size_t *l
return false; return false;
} }
/*
======================
NetSplit_SendLong
Send parts that are less or equal maxpacket
======================
*/
void NetSplit_SendLong( netsrc_t sock, size_t length, void *data, netadr_t to, unsigned int maxpacket, unsigned int id)
{
netsplit_packet_t packet = {0};
unsigned int part = maxpacket - NETSPLIT_HEADER_SIZE;
packet.signature = LittleLong(0xFFFFFFFE);
packet.id = LittleLong(id);
packet.length = LittleLong(length);
packet.part = LittleLong(part);
packet.count = ( length - 1 ) / part + 1;
//Con_Reportf( S_NOTE "NetSplit_SendLong: packet to %s, count %d, length %d\n", NET_AdrToString( to ), (int)packet.count, (int)packet.length );
while( packet.index < packet.count )
{
unsigned int size = part;
if( size > length )
size = length;
length -= size;
memcpy( packet.data, (const byte*)data + packet.index * part, size );
//Con_Reportf( S_NOTE "NetSplit_SendLong: packet to %s, id %d, index %d\n", NET_AdrToString( to ), (int)packet.id, (int)packet.index );
NET_SendPacket( sock, size + NETSPLIT_HEADER_SIZE, &packet, to );
packet.index++;
}
}
/* /*
=============== ===============
Netchan_Init Netchan_Init
@@ -367,7 +329,7 @@ Netchan_UnlinkFragment
============================== ==============================
*/ */
void Netchan_UnlinkFragment( fragbuf_t *buf, fragbuf_t **list ) static void Netchan_UnlinkFragment( fragbuf_t *buf, fragbuf_t **list )
{ {
fragbuf_t *search; fragbuf_t *search;
@@ -405,7 +367,7 @@ Netchan_ClearFragbufs
============================== ==============================
*/ */
void Netchan_ClearFragbufs( fragbuf_t **ppbuf ) static void Netchan_ClearFragbufs( fragbuf_t **ppbuf )
{ {
fragbuf_t *buf, *n; fragbuf_t *buf, *n;
@@ -431,7 +393,7 @@ Netchan_ClearFragments
============================== ==============================
*/ */
void Netchan_ClearFragments( netchan_t *chan ) static void Netchan_ClearFragments( netchan_t *chan )
{ {
fragbufwaiting_t *wait, *next; fragbufwaiting_t *wait, *next;
int i; int i;
@@ -539,7 +501,7 @@ Netchan_AllocFragbuf
============================== ==============================
*/ */
fragbuf_t *Netchan_AllocFragbuf( int fragment_size ) static fragbuf_t *Netchan_AllocFragbuf( int fragment_size )
{ {
fragbuf_t *buf; fragbuf_t *buf;
@@ -556,7 +518,7 @@ Netchan_AddFragbufToTail
============================== ==============================
*/ */
void Netchan_AddFragbufToTail( fragbufwaiting_t *wait, fragbuf_t *buf ) static void Netchan_AddFragbufToTail( fragbufwaiting_t *wait, fragbuf_t *buf )
{ {
fragbuf_t *p; fragbuf_t *p;
@@ -579,7 +541,7 @@ Netchan_UpdateFlow
============================== ==============================
*/ */
void Netchan_UpdateFlow( netchan_t *chan ) static void Netchan_UpdateFlow( netchan_t *chan )
{ {
float faccumulatedtime = 0.0; float faccumulatedtime = 0.0;
int i, bytes = 0; int i, bytes = 0;
@@ -791,7 +753,7 @@ Netchan_FindBufferById
============================== ==============================
*/ */
fragbuf_t *Netchan_FindBufferById( fragbuf_t **pplist, int id, qboolean allocate ) static fragbuf_t *Netchan_FindBufferById( fragbuf_t **pplist, int id, qboolean allocate )
{ {
fragbuf_t *list = *pplist; fragbuf_t *list = *pplist;
fragbuf_t *pnewbuf; fragbuf_t *pnewbuf;
@@ -821,7 +783,7 @@ Netchan_CheckForCompletion
============================== ==============================
*/ */
void Netchan_CheckForCompletion( netchan_t *chan, int stream, int intotalbuffers ) static void Netchan_CheckForCompletion( netchan_t *chan, int stream, int intotalbuffers )
{ {
int c, id; int c, id;
int size; int size;
@@ -1287,7 +1249,7 @@ qboolean Netchan_CopyFileFragments( netchan_t *chan, sizebuf_t *msg )
return true; return true;
} }
qboolean Netchan_Validate( netchan_t *chan, sizebuf_t *sb, qboolean *frag_message, uint *fragid, int *frag_offset, int *frag_length ) static qboolean Netchan_Validate( netchan_t *chan, sizebuf_t *sb, qboolean *frag_message, uint *fragid, int *frag_offset, int *frag_length )
{ {
int i, buffer, offset; int i, buffer, offset;
int count, length; int count, length;
+6 -6
View File
@@ -317,7 +317,7 @@ static void NET_SockadrToNetadr( const struct sockaddr_storage *s, netadr_t *a )
NET_GetHostByName NET_GetHostByName
============ ============
*/ */
qboolean NET_GetHostByName( const char *hostname, int family, struct sockaddr_storage *addr ) static qboolean NET_GetHostByName( const char *hostname, int family, struct sockaddr_storage *addr )
{ {
#if defined HAVE_GETADDRINFO #if defined HAVE_GETADDRINFO
struct addrinfo *ai = NULL, *cur; struct addrinfo *ai = NULL, *cur;
@@ -372,7 +372,7 @@ static void NET_ResolveThread( void );
#define detach_thread( x ) pthread_detach(x) #define detach_thread( x ) pthread_detach(x)
#define mutex_t pthread_mutex_t #define mutex_t pthread_mutex_t
#define thread_t pthread_t #define thread_t pthread_t
void *NET_ThreadStart( void *unused ) static void *NET_ThreadStart( void *unused )
{ {
NET_ResolveThread(); NET_ResolveThread();
return NULL; return NULL;
@@ -1018,7 +1018,7 @@ idnewt
192.246.40.70 192.246.40.70
============= =============
*/ */
qboolean NET_StringToAdrEx( const char *string, netadr_t *adr, int family ) static qboolean NET_StringToAdrEx( const char *string, netadr_t *adr, int family )
{ {
struct sockaddr_storage s; struct sockaddr_storage s;
@@ -1339,7 +1339,7 @@ NET_GetLong
receive long packet from network receive long packet from network
================== ==================
*/ */
qboolean NET_GetLong( byte *pData, int size, size_t *outSize, int splitsize ) static qboolean NET_GetLong( byte *pData, int size, size_t *outSize, int splitsize )
{ {
int i, sequence_number, offset; int i, sequence_number, offset;
SPLITPACKET *pHeader = (SPLITPACKET *)pData; SPLITPACKET *pHeader = (SPLITPACKET *)pData;
@@ -1534,7 +1534,7 @@ NET_SendLong
Fragment long packets, send short directly Fragment long packets, send short directly
================== ==================
*/ */
int NET_SendLong( netsrc_t sock, int net_socket, const char *buf, size_t len, int flags, const struct sockaddr_storage *to, size_t tolen, size_t splitsize ) static int NET_SendLong( netsrc_t sock, int net_socket, const char *buf, size_t len, int flags, const struct sockaddr_storage *to, size_t tolen, size_t splitsize )
{ {
#ifdef NET_USE_FRAGMENTS #ifdef NET_USE_FRAGMENTS
// do we need to break this packet up? // do we need to break this packet up?
@@ -1864,7 +1864,7 @@ NET_GetLocalAddress
Returns the servers' ip address as a string. Returns the servers' ip address as a string.
================ ================
*/ */
void NET_GetLocalAddress( void ) static void NET_GetLocalAddress( void )
{ {
char hostname[512]; char hostname[512];
char buff[512]; char buff[512];
+2 -2
View File
@@ -48,7 +48,7 @@ SampleMiptex
fence texture testing fence texture testing
============= =============
*/ */
int PM_SampleMiptex( const msurface_t *surf, const vec3_t point ) static int PM_SampleMiptex( const msurface_t *surf, const vec3_t point )
{ {
mextrasurf_t *info = surf->info; mextrasurf_t *info = surf->info;
mfacebevel_t *fb = info->bevel; mfacebevel_t *fb = info->bevel;
@@ -221,7 +221,7 @@ PM_TestLine_r
optimized trace for light gathering optimized trace for light gathering
================== ==================
*/ */
int PM_TestLine_r( model_t *mod, mnode_t *node, vec_t p1f, vec_t p2f, const vec3_t start, const vec3_t stop, linetrace_t *trace ) static int PM_TestLine_r( model_t *mod, mnode_t *node, vec_t p1f, vec_t p2f, const vec3_t start, const vec3_t stop, linetrace_t *trace )
{ {
float front, back; float front, back;
float frac, midf; float frac, midf;
+2 -2
View File
@@ -105,7 +105,7 @@ To keep everything totally uniform, bounding boxes are turned into small
BSP trees instead of being compared directly. BSP trees instead of being compared directly.
=================== ===================
*/ */
hull_t *PM_HullForBox( const vec3_t mins, const vec3_t maxs ) static hull_t *PM_HullForBox( const vec3_t mins, const vec3_t maxs )
{ {
pm_boxplanes[0].dist = maxs[0]; pm_boxplanes[0].dist = maxs[0];
pm_boxplanes[1].dist = mins[0]; pm_boxplanes[1].dist = mins[0];
@@ -199,7 +199,7 @@ PM_HullForStudio
generate multiple hulls as hitboxes generate multiple hulls as hitboxes
================== ==================
*/ */
hull_t *PM_HullForStudio( physent_t *pe, playermove_t *pmove, int *numhitboxes ) static hull_t *PM_HullForStudio( physent_t *pe, playermove_t *pmove, int *numhitboxes )
{ {
vec3_t size; vec3_t size;
+4 -4
View File
@@ -56,20 +56,20 @@ static int good_enc( const int enc )
return FALSE; return FALSE;
} }
void mpg123_rates( const long **list, size_t *number ) static void mpg123_rates( const long **list, size_t *number )
{ {
if( number != NULL ) *number = sizeof( my_rates ) / sizeof( long ); if( number != NULL ) *number = sizeof( my_rates ) / sizeof( long );
if( list != NULL ) *list = my_rates; if( list != NULL ) *list = my_rates;
} }
// now that's a bit tricky... One build of the library knows only a subset of the encodings. // now that's a bit tricky... One build of the library knows only a subset of the encodings.
void mpg123_encodings( const int **list, size_t *number ) static void mpg123_encodings( const int **list, size_t *number )
{ {
if( number != NULL ) *number = sizeof( good_encodings ) / sizeof( int ); if( number != NULL ) *number = sizeof( good_encodings ) / sizeof( int );
if( list != NULL ) *list = good_encodings; if( list != NULL ) *list = good_encodings;
} }
int mpg123_encsize( int encoding ) static int mpg123_encsize( int encoding )
{ {
return sizeof( short ); return sizeof( short );
} }
@@ -364,7 +364,7 @@ int mpg123_format( mpg123_handle_t *mh, long rate, int channels, int encodings )
return r; return r;
} }
int mpg123_format_support( mpg123_handle_t *mh, long rate, int encoding ) static int mpg123_format_support( mpg123_handle_t *mh, long rate, int encoding )
{ {
if( mh == NULL ) if( mh == NULL )
return 0; return 0;
+2 -2
View File
@@ -393,7 +393,7 @@ void frame_exit( mpg123_handle_t *fr )
bc_cleanup( &fr->rdat.buffer ); bc_cleanup( &fr->rdat.buffer );
} }
int mpg123_framedata( mpg123_handle_t *mh, ulong *header, byte **bodydata, size_t *bodybytes ) static int mpg123_framedata( mpg123_handle_t *mh, ulong *header, byte **bodydata, size_t *bodybytes )
{ {
if( mh == NULL ) if( mh == NULL )
return MPG123_BAD_HANDLE; return MPG123_BAD_HANDLE;
@@ -512,7 +512,7 @@ mpg_off_t frame_index_find( mpg123_handle_t *fr, mpg_off_t want_frame, mpg_off_t
return gopos; return gopos;
} }
mpg_off_t frame_ins2outs( mpg123_handle_t *fr, mpg_off_t ins ) static mpg_off_t frame_ins2outs( mpg123_handle_t *fr, mpg_off_t ins )
{ {
mpg_off_t outs = 0; mpg_off_t outs = 0;
+10 -7
View File
@@ -15,6 +15,7 @@ GNU General Public License for more details.
#include "mpg123.h" #include "mpg123.h"
#include "sample.h" #include "sample.h"
#include "libmpg.h"
static int initialized = 0; static int initialized = 0;
@@ -83,7 +84,7 @@ mpg123_handle_t *mpg123_parnew( mpg123_parm_t *mp, int *error )
return fr; return fr;
} }
int mpg123_par( mpg123_parm_t *mp, enum mpg123_parms key, long val ) static int mpg123_par( mpg123_parm_t *mp, enum mpg123_parms key, long val )
{ {
int ret = MPG123_OK; int ret = MPG123_OK;
@@ -189,7 +190,7 @@ int mpg123_param( mpg123_handle_t *mh, enum mpg123_parms key, long val )
} }
} }
int mpg123_close( mpg123_handle_t *mh ) static int mpg123_close( mpg123_handle_t *mh )
{ {
if( mh == NULL ) if( mh == NULL )
return MPG123_BAD_HANDLE; return MPG123_BAD_HANDLE;
@@ -263,7 +264,7 @@ int mpg123_replace_reader_handle( mpg123_handle_t *mh, mpg_ssize_t (*fread)( voi
// a) a new choice of decoder // a) a new choice of decoder
// b) a changed native format of the MPEG stream // b) a changed native format of the MPEG stream
// ... calls are only valid after parsing some MPEG frame! // ... calls are only valid after parsing some MPEG frame!
int decode_update( mpg123_handle_t *mh ) static int decode_update( mpg123_handle_t *mh )
{ {
long native_rate; long native_rate;
int b; int b;
@@ -320,13 +321,13 @@ int decode_update( mpg123_handle_t *mh )
return 0; return 0;
} }
size_t mpg123_safe_buffer( void ) static size_t mpg123_safe_buffer( void )
{ {
// real is the largest possible output // real is the largest possible output
return sizeof( float ) * 2 * 1152; return sizeof( float ) * 2 * 1152;
} }
size_t mpg123_outblock( mpg123_handle_t *mh ) static size_t mpg123_outblock( mpg123_handle_t *mh )
{ {
// try to be helpful and never return zero output block size. // try to be helpful and never return zero output block size.
if( mh != NULL && mh->outblock > 0 ) if( mh != NULL && mh->outblock > 0 )
@@ -697,7 +698,7 @@ int mpg123_getformat( mpg123_handle_t *mh, int *rate, int *channels, int *encodi
return MPG123_OK; return MPG123_OK;
} }
int mpg123_scan( mpg123_handle_t *mh ) static int mpg123_scan( mpg123_handle_t *mh )
{ {
mpg_off_t track_frames = 0; mpg_off_t track_frames = 0;
mpg_off_t track_samples = 0; mpg_off_t track_samples = 0;
@@ -963,8 +964,10 @@ const char *mpg123_plain_strerror( int errcode )
} }
} }
const char *get_error( mpg123_handle_t *mh ) const char *get_error( void *handle )
{ {
mpg123_handle_t *mh = handle;
if( !mh ) return mpg123_plain_strerror( MPG123_BAD_HANDLE ); if( !mh ) return mpg123_plain_strerror( MPG123_BAD_HANDLE );
return mpg123_plain_strerror( mh->err ); return mpg123_plain_strerror( mh->err );
} }
+2 -2
View File
@@ -68,7 +68,7 @@ void set_pointer( mpg123_handle_t *fr, long backstep )
fr->bitindex = 0; fr->bitindex = 0;
} }
int frame_bitrate( mpg123_handle_t *fr ) static int frame_bitrate( mpg123_handle_t *fr )
{ {
return tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index]; return tabsel_123[fr->lsf][fr->lay-1][fr->bitrate_index];
} }
@@ -643,7 +643,7 @@ static int forget_head_shift( mpg123_handle_t *fr, ulong *newheadp, int forget )
// returns: 0: bad or just unparseable tag // returns: 0: bad or just unparseable tag
// 1: good, (possibly) new tag info // 1: good, (possibly) new tag info
// <0: reader error (may need more data feed, try again) // <0: reader error (may need more data feed, try again)
int parse_new_id3( mpg123_handle_t *fr, ulong first4bytes ) static int parse_new_id3( mpg123_handle_t *fr, ulong first4bytes )
{ {
byte buf[6]; byte buf[6];
ulong length=0; ulong length=0;
+3 -3
View File
@@ -25,7 +25,7 @@ GNU General Public License for more details.
else { *(samples) = REAL_TO_SHORT( sum ); } else { *(samples) = REAL_TO_SHORT( sum ); }
// main synth function, uses the plain dct64 // main synth function, uses the plain dct64
int synth_1to1( float *bandPtr, int channel, mpg123_handle_t *fr, int final ) static int synth_1to1( float *bandPtr, int channel, mpg123_handle_t *fr, int final )
{ {
static const int step = 2; static const int step = 2;
short *samples = (short *) (fr->buffer.data + fr->buffer.fill); short *samples = (short *) (fr->buffer.data + fr->buffer.fill);
@@ -147,7 +147,7 @@ static int synth_stereo( float *bandPtr_l, float *bandPtr_r, mpg123_handle_t *fr
} }
// mono to stereo synth, wrapping over synth_1to1 // mono to stereo synth, wrapping over synth_1to1
int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr ) static int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr )
{ {
byte *samples = fr->buffer.data; byte *samples = fr->buffer.data;
int i, ret; int i, ret;
@@ -165,7 +165,7 @@ int synth_1to1_m2s(float *bandPtr, mpg123_handle_t *fr )
} }
// mono synth, wrapping over synth_1to1 // mono synth, wrapping over synth_1to1
int synth_1to1_mono( float *bandPtr, mpg123_handle_t *fr ) static int synth_1to1_mono( float *bandPtr, mpg123_handle_t *fr )
{ {
short samples_tmp[BLOCK]; short samples_tmp[BLOCK];
short *tmp1 = samples_tmp; short *tmp1 = samples_tmp;
+3 -2
View File
@@ -18,7 +18,7 @@ GNU General Public License for more details.
// global sound variables // global sound variables
sndlib_t sound; sndlib_t sound;
void Sound_Reset( void ) static void Sound_Reset( void )
{ {
// reset global variables // reset global variables
sound.width = sound.rate = 0; sound.width = sound.rate = 0;
@@ -30,7 +30,7 @@ void Sound_Reset( void )
sound.size = 0; sound.size = 0;
} }
wavdata_t *SoundPack( void ) static wavdata_t *SoundPack( void )
{ {
wavdata_t *pack = Mem_Calloc( host.soundpool, sizeof( wavdata_t )); wavdata_t *pack = Mem_Calloc( host.soundpool, sizeof( wavdata_t ));
@@ -294,6 +294,7 @@ void FS_FreeStream( stream_t *stream )
#if XASH_ENGINE_TESTS #if XASH_ENGINE_TESTS
#define IMPLEMENT_SOUNDLIB_FUZZ_TARGET( export, target ) \ #define IMPLEMENT_SOUNDLIB_FUZZ_TARGET( export, target ) \
int EXPORT export( const uint8_t *Data, size_t Size ); \
int EXPORT export( const uint8_t *Data, size_t Size ) \ int EXPORT export( const uint8_t *Data, size_t Size ) \
{ \ { \
wavdata_t *wav; \ wavdata_t *wav; \
+2 -1
View File
@@ -186,6 +186,7 @@ static qboolean Sound_ParseID3Tag( const byte *buffer, fs_offset_t filesize )
} }
#if XASH_ENGINE_TESTS #if XASH_ENGINE_TESTS
int EXPORT Fuzz_Sound_ParseID3Tag( const uint8_t *Data, size_t Size );
int EXPORT Fuzz_Sound_ParseID3Tag( const uint8_t *Data, size_t Size ) int EXPORT Fuzz_Sound_ParseID3Tag( const uint8_t *Data, size_t Size )
{ {
memset( &sound, 0, sizeof( sound )); memset( &sound, 0, sizeof( sound ));
@@ -294,7 +295,7 @@ qboolean Sound_LoadMPG( const char *name, const byte *buffer, fs_offset_t filesi
FS_SeekEx FS_SeekEx
================= =================
*/ */
fs_offset_t FS_SeekEx( file_t *file, fs_offset_t offset, int whence ) static fs_offset_t FS_SeekEx( file_t *file, fs_offset_t offset, int whence )
{ {
return FS_Seek( file, offset, whence ) == -1 ? -1 : FS_Tell( file ); return FS_Seek( file, offset, whence ) == -1 ? -1 : FS_Tell( file );
} }
+2 -2
View File
@@ -83,7 +83,7 @@ void Sound_Shutdown( void )
Mem_FreePool( &host.soundpool ); Mem_FreePool( &host.soundpool );
} }
byte *Sound_Copy( size_t size ) static byte *Sound_Copy( size_t size )
{ {
byte *out; byte *out;
@@ -139,7 +139,7 @@ Sound_ResampleInternal
We need convert sound to signed even if nothing to resample We need convert sound to signed even if nothing to resample
================ ================
*/ */
qboolean Sound_ResampleInternal( wavdata_t *sc, int inrate, int inwidth, int outrate, int outwidth ) static qboolean Sound_ResampleInternal( wavdata_t *sc, int inrate, int inwidth, int outrate, int outwidth )
{ {
double stepscale, j; double stepscale, j;
int outcount; int outcount;
+1 -1
View File
@@ -117,7 +117,7 @@ static void FindChunk( const char *filename, const char *name )
StreamFindNextChunk StreamFindNextChunk
============ ============
*/ */
qboolean StreamFindNextChunk( file_t *file, const char *name, int *last_chunk ) static qboolean StreamFindNextChunk( file_t *file, const char *name, int *last_chunk )
{ {
char chunkName[4]; char chunkName[4];
int iff_chunk_len; int iff_chunk_len;
+1 -1
View File
@@ -362,7 +362,7 @@ Sys_WaitForQuit
wait for 'Esc' key will be hit wait for 'Esc' key will be hit
================ ================
*/ */
void Sys_WaitForQuit( void ) static void Sys_WaitForQuit( void )
{ {
#if XASH_WIN32 #if XASH_WIN32
MSG msg; MSG msg;
+11 -3
View File
@@ -29,7 +29,8 @@ GNU General Public License for more details.
#include "platform/platform.h" #include "platform/platform.h"
#include <sys/types.h> #include <sys/types.h>
#if defined(__GLIBC__) && (__GLIBC__ <= 2) && (__GLIBC_MINOR__ <= 30) #if defined( __GLIBC__ )
#if ( __GLIBC__ <= 2 ) && ( __GLIBC_MINOR__ <= 30 )
// Library support was added in glibc 2.30. // Library support was added in glibc 2.30.
// Earlier glibc versions did not provide a wrapper for this system call, // Earlier glibc versions did not provide a wrapper for this system call,
// necessitating the use of syscall(2). // necessitating the use of syscall(2).
@@ -39,7 +40,14 @@ static pid_t gettid( void )
{ {
return syscall( SYS_gettid ); return syscall( SYS_gettid );
} }
#endif #endif // ( __GLIBC__ <= 2 ) && ( __GLIBC_MINOR__ <= 30 )
// Glibc misses this macro in POSIX headers (bits/types/sigevent_t.h)
// but it does present in Linux headers (asm-generic/siginfo.h) and musl
#if !defined( sigev_notify_thread_id )
#define sigev_notify_thread_id _sigev_un._tid
#endif // !defined( sigev_notify_thread_id )
#endif // defined(__GLIBC__)
static void *g_hsystemd; static void *g_hsystemd;
static int (*g_pfn_sd_notify)( int unset_environment, const char *state ); static int (*g_pfn_sd_notify)( int unset_environment, const char *state );
@@ -150,7 +158,7 @@ void Linux_SetTimer( float tm )
// this path availiable in POSIX, but may signal wrong thread... // this path availiable in POSIX, but may signal wrong thread...
// sev.sigev_notify = SIGEV_SIGNAL; // sev.sigev_notify = SIGEV_SIGNAL;
sev.sigev_notify = SIGEV_THREAD_ID; sev.sigev_notify = SIGEV_THREAD_ID;
sev._sigev_un._tid = gettid(); sev.sigev_notify_thread_id = gettid();
sev.sigev_signo = DEBUG_TIMER_SIGNAL; sev.sigev_signo = DEBUG_TIMER_SIGNAL;
sev.sigev_value.sival_ptr = &timerid; sev.sigev_value.sival_ptr = &timerid;
timer_create( CLOCK_REALTIME, &sev, &timerid ); timer_create( CLOCK_REALTIME, &sev, &timerid );
+1 -1
View File
@@ -183,7 +183,7 @@ void Platform_SetClipboardText( const char *buffer );
#define SDL_VERSION_ATLEAST( x, y, z ) 0 #define SDL_VERSION_ATLEAST( x, y, z ) 0
#endif #endif
static void Platform_SetTimer( float time ) static inline void Platform_SetTimer( float time )
{ {
#if XASH_LINUX #if XASH_LINUX
Linux_SetTimer( time ); Linux_SetTimer( time );
+2 -2
View File
@@ -49,7 +49,7 @@ static SDL_AudioDeviceID in_dev = 0;
static SDL_AudioFormat sdl_format; static SDL_AudioFormat sdl_format;
static char sdl_backend_name[32]; static char sdl_backend_name[32];
void SDL_SoundCallback( void *userdata, Uint8 *stream, int len ) static void SDL_SoundCallback( void *userdata, Uint8 *stream, int len )
{ {
const int size = dma.samples << 1; const int size = dma.samples << 1;
int pos; int pos;
@@ -244,7 +244,7 @@ void SNDDMA_Activate( qboolean active )
SDL_SoundInputCallback SDL_SoundInputCallback
=========== ===========
*/ */
void SDL_SoundInputCallback( void *userdata, Uint8 *stream, int len ) static void SDL_SoundInputCallback( void *userdata, Uint8 *stream, int len )
{ {
int size = Q_min( len, sizeof( voice.input_buffer ) - voice.input_buffer_pos ); int size = Q_min( len, sizeof( voice.input_buffer ) - voice.input_buffer_pos );
+8 -2
View File
@@ -46,8 +46,8 @@ GNU General Public License for more details.
#define REF_API_VERSION 7 #define REF_API_VERSION 7
#define TF_SKY (TF_SKYSIDE|TF_NOMIPMAP) #define TF_SKY (TF_SKYSIDE|TF_NOMIPMAP|TF_ALLOW_NEAREST)
#define TF_FONT (TF_NOMIPMAP|TF_CLAMP) #define TF_FONT (TF_NOMIPMAP|TF_CLAMP|TF_ALLOW_NEAREST)
#define TF_IMAGE (TF_NOMIPMAP|TF_CLAMP) #define TF_IMAGE (TF_NOMIPMAP|TF_CLAMP)
#define TF_DECAL (TF_CLAMP) #define TF_DECAL (TF_CLAMP)
@@ -283,6 +283,12 @@ typedef enum
PARM_GET_MOVEVARS_PTR = -13, // clgame.movevars PARM_GET_MOVEVARS_PTR = -13, // clgame.movevars
PARM_GET_PALETTE_PTR = -14, // clgame.palette PARM_GET_PALETTE_PTR = -14, // clgame.palette
PARM_GET_VIEWENT_PTR = -15, // clgame.viewent PARM_GET_VIEWENT_PTR = -15, // clgame.viewent
// implemented by ref_dll
// returns non-null integer if filtering is enabled for texture
// pass -1 to query global filtering settings
PARM_TEX_FILTERING = -65536,
} ref_parm_e; } ref_parm_e;
typedef struct ref_api_s typedef struct ref_api_s
+3 -21
View File
@@ -487,25 +487,16 @@ int SV_ModelIndex( const char *name );
int SV_SoundIndex( const char *name ); int SV_SoundIndex( const char *name );
int SV_EventIndex( const char *name ); int SV_EventIndex( const char *name );
int SV_GenericIndex( const char *name ); int SV_GenericIndex( const char *name );
int SV_CalcPacketLoss( sv_client_t *cl );
void SV_ExecuteUserCommand (char *s);
void SV_InitOperatorCommands( void ); void SV_InitOperatorCommands( void );
void SV_KillOperatorCommands( void ); void SV_KillOperatorCommands( void );
void SV_RemoteCommand( netadr_t from, sizebuf_t *msg ); void SV_RemoteCommand( netadr_t from, sizebuf_t *msg );
void SV_PrepWorldFrame( void );
void SV_ProcessFile( sv_client_t *cl, const char *filename );
void SV_SendResource( resource_t *pResource, sizebuf_t *msg ); void SV_SendResource( resource_t *pResource, sizebuf_t *msg );
void SV_SendResourceList( sv_client_t *cl );
void SV_AddToMaster( netadr_t from, sizebuf_t *msg ); void SV_AddToMaster( netadr_t from, sizebuf_t *msg );
qboolean SV_ProcessUserAgent( netadr_t from, const char *useragent ); qboolean SV_ProcessUserAgent( netadr_t from, const char *useragent );
void Host_SetServerState( int state );
qboolean SV_IsSimulating( void );
void SV_FreeClients( void );
// //
// sv_init.c // sv_init.c
// //
qboolean CRC32_MapFile( dword *crcvalue, const char *filename, qboolean multiplayer );
qboolean SV_InitGame( void ); qboolean SV_InitGame( void );
void SV_ActivateServer( int runPhysics ); void SV_ActivateServer( int runPhysics );
qboolean SV_SpawnServer( const char *server, const char *startspot, qboolean background ); qboolean SV_SpawnServer( const char *server, const char *startspot, qboolean background );
@@ -537,14 +528,11 @@ void SV_WaterMove( edict_t *ent );
// //
void SV_SendClientMessages( void ); void SV_SendClientMessages( void );
void SV_ClientPrintf( sv_client_t *cl, const char *fmt, ... ) _format( 2 ); void SV_ClientPrintf( sv_client_t *cl, const char *fmt, ... ) _format( 2 );
void SV_BroadcastCommand( const char *fmt, ... ) _format( 1 );
// //
// sv_client.c // sv_client.c
// //
char *SV_StatusString( void );
void SV_RefreshUserinfo( void ); void SV_RefreshUserinfo( void );
void SV_GetChallenge( netadr_t from );
void SV_TogglePause( const char *msg ); void SV_TogglePause( const char *msg );
qboolean SV_ShouldUpdatePing( sv_client_t *cl ); qboolean SV_ShouldUpdatePing( sv_client_t *cl );
const char *SV_GetClientIDString( sv_client_t *cl ); const char *SV_GetClientIDString( sv_client_t *cl );
@@ -554,15 +542,12 @@ void SV_FullClientUpdate( sv_client_t *cl, sizebuf_t *msg );
void SV_FullUpdateMovevars( sv_client_t *cl, sizebuf_t *msg ); void SV_FullUpdateMovevars( sv_client_t *cl, sizebuf_t *msg );
void SV_GetPlayerStats( sv_client_t *cl, int *ping, int *packet_loss ); void SV_GetPlayerStats( sv_client_t *cl, int *ping, int *packet_loss );
void SV_SendServerdata( sizebuf_t *msg, sv_client_t *cl ); void SV_SendServerdata( sizebuf_t *msg, sv_client_t *cl );
void SV_ClientThink( sv_client_t *cl, usercmd_t *cmd );
void SV_ExecuteClientMessage( sv_client_t *cl, sizebuf_t *msg ); void SV_ExecuteClientMessage( sv_client_t *cl, sizebuf_t *msg );
void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg ); void SV_ConnectionlessPacket( netadr_t from, sizebuf_t *msg );
edict_t *SV_FakeConnect( const char *netname ); edict_t *SV_FakeConnect( const char *netname );
void SV_ExecuteClientCommand( sv_client_t *cl, const char *s );
void SV_BuildReconnect( sizebuf_t *msg ); void SV_BuildReconnect( sizebuf_t *msg );
qboolean SV_IsPlayerIndex( int idx ); qboolean SV_IsPlayerIndex( int idx );
int SV_CalcPing( sv_client_t *cl ); int SV_CalcPing( sv_client_t *cl );
void SV_InitClientMove( void );
void SV_UpdateServerInfo( void ); void SV_UpdateServerInfo( void );
void SV_EndRedirect( host_redirect_t *rd ); void SV_EndRedirect( host_redirect_t *rd );
void SV_RejectConnection( netadr_t from, const char *fmt, ... ) _format( 2 ); void SV_RejectConnection( netadr_t from, const char *fmt, ... ) _format( 2 );
@@ -571,8 +556,6 @@ void SV_GetPlayerCount( int *clients, int *bots );
// //
// sv_cmds.c // sv_cmds.c
// //
void SV_Status_f( void );
void SV_Newgame_f( void );
void SV_InitHostCommands( void ); void SV_InitHostCommands( void );
// //
@@ -594,7 +577,6 @@ void SV_RequestMissingResources( void );
// sv_filter.c // sv_filter.c
// //
void SV_InitFilter( void ); void SV_InitFilter( void );
void SV_ShutdownFilter( void );
qboolean SV_CheckIP( netadr_t *adr ); qboolean SV_CheckIP( netadr_t *adr );
qboolean SV_CheckID( const char *id ); qboolean SV_CheckID( const char *id );
@@ -603,8 +585,6 @@ qboolean SV_CheckID( const char *id );
// //
void SV_InactivateClients( void ); void SV_InactivateClients( void );
int SV_FindBestBaselineForStatic( int index, entity_state_t **baseline, entity_state_t *to ); int SV_FindBestBaselineForStatic( int index, entity_state_t **baseline, entity_state_t *to );
void SV_WriteFrameToClient( sv_client_t *client, sizebuf_t *msg );
void SV_BuildClientFrame( sv_client_t *client );
void SV_SkipUpdates( void ); void SV_SkipUpdates( void );
// //
@@ -651,6 +631,8 @@ int pfnDropToFloor( edict_t* e );
edict_t *SV_EdictNum( int n ); edict_t *SV_EdictNum( int n );
void SV_SetModel( edict_t *ent, const char *name ); void SV_SetModel( edict_t *ent, const char *name );
int pfnDecalIndex( const char *m ); int pfnDecalIndex( const char *m );
void SV_CreateDecal( sizebuf_t *msg, const float *origin, int decalIndex, int entityIndex, int modelIndex, int flags, float scale );
qboolean SV_RestoreCustomDecal( struct decallist_s *entry, edict_t *pEdict, qboolean adjacent );
// //
// sv_log.c // sv_log.c
@@ -675,6 +657,7 @@ void SV_ClearGameState( void );
// //
// sv_pmove.c // sv_pmove.c
// //
void SV_InitClientMove( void );
qboolean SV_PlayerIsFrozen( edict_t *pClient ); qboolean SV_PlayerIsFrozen( edict_t *pClient );
void SV_RunCmd( sv_client_t *cl, usercmd_t *ucmd, int random_seed ); void SV_RunCmd( sv_client_t *cl, usercmd_t *ucmd, int random_seed );
@@ -685,7 +668,6 @@ void SV_ClearWorld( void );
void SV_UnlinkEdict( edict_t *ent ); void SV_UnlinkEdict( edict_t *ent );
void SV_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, trace_t *trace ); void SV_ClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, trace_t *trace );
void SV_CustomClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, trace_t *trace ); void SV_CustomClipMoveToEntity( edict_t *ent, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, trace_t *trace );
trace_t SV_TraceHull( edict_t *ent, int hullNum, const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end );
trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e, qboolean monsterclip ); trace_t SV_Move( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e, qboolean monsterclip );
trace_t SV_MoveNoEnts( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e ); trace_t SV_MoveNoEnts( const vec3_t start, vec3_t mins, vec3_t maxs, const vec3_t end, int type, edict_t *e );
const char *SV_TraceTexture( edict_t *ent, const vec3_t start, const vec3_t end ); const char *SV_TraceTexture( edict_t *ent, const vec3_t start, const vec3_t end );
+23 -22
View File
@@ -43,6 +43,7 @@ typedef struct ucmd_s
static int g_userid = 1; static int g_userid = 1;
static void SV_UserinfoChanged( sv_client_t *cl ); static void SV_UserinfoChanged( sv_client_t *cl );
static void SV_ExecuteClientCommand( sv_client_t *cl, const char *s );
/* /*
================= =================
@@ -84,7 +85,7 @@ flood the server with invalid connection IPs. With a
challenge, they must give a valid IP address. challenge, they must give a valid IP address.
================= =================
*/ */
void SV_GetChallenge( netadr_t from ) static void SV_GetChallenge( netadr_t from )
{ {
int i, oldest = 0; int i, oldest = 0;
double oldestTime; double oldestTime;
@@ -118,7 +119,7 @@ void SV_GetChallenge( netadr_t from )
Netchan_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "challenge %i", svs.challenges[i].challenge ); Netchan_OutOfBandPrint( NS_SERVER, svs.challenges[i].adr, "challenge %i", svs.challenges[i].challenge );
} }
int SV_GetFragmentSize( void *pcl, fragsize_t mode ) static int SV_GetFragmentSize( void *pcl, fragsize_t mode )
{ {
sv_client_t *cl = (sv_client_t*)pcl; sv_client_t *cl = (sv_client_t*)pcl;
int cl_frag_size; int cl_frag_size;
@@ -191,7 +192,7 @@ for some reasons file can't be downloaded
tell the client about this problem tell the client about this problem
================ ================
*/ */
void SV_FailDownload( sv_client_t *cl, const char *filename ) static void SV_FailDownload( sv_client_t *cl, const char *filename )
{ {
if( !COM_CheckString( filename )) if( !COM_CheckString( filename ))
return; return;
@@ -207,7 +208,7 @@ SV_CheckChallenge
Make sure connecting client is not spoofing Make sure connecting client is not spoofing
================ ================
*/ */
int SV_CheckChallenge( netadr_t from, int challenge ) static int SV_CheckChallenge( netadr_t from, int challenge )
{ {
int i; int i;
@@ -247,7 +248,7 @@ SV_CheckIPRestrictions
Determine if client is outside appropriate address range Determine if client is outside appropriate address range
================ ================
*/ */
int SV_CheckIPRestrictions( netadr_t from ) static int SV_CheckIPRestrictions( netadr_t from )
{ {
if( sv_lan.value ) if( sv_lan.value )
{ {
@@ -265,7 +266,7 @@ Get slot # and set client_t pointer for player, if possible
We don't do this search on a "reconnect, we just reuse the slot We don't do this search on a "reconnect, we just reuse the slot
================ ================
*/ */
int SV_FindEmptySlot( netadr_t from, int *pslot, sv_client_t **ppClient ) static int SV_FindEmptySlot( netadr_t from, int *pslot, sv_client_t **ppClient )
{ {
sv_client_t *cl; sv_client_t *cl;
int i; int i;
@@ -291,7 +292,7 @@ SV_ConnectClient
A connection request that did not come from the master A connection request that did not come from the master
================== ==================
*/ */
void SV_ConnectClient( netadr_t from ) static void SV_ConnectClient( netadr_t from )
{ {
char userinfo[MAX_INFO_STRING]; char userinfo[MAX_INFO_STRING];
char protinfo[MAX_INFO_STRING]; char protinfo[MAX_INFO_STRING];
@@ -831,7 +832,7 @@ SV_TestBandWidth
================ ================
*/ */
void SV_TestBandWidth( netadr_t from ) static void SV_TestBandWidth( netadr_t from )
{ {
const int version = Q_atoi( Cmd_Argv( 1 )); const int version = Q_atoi( Cmd_Argv( 1 ));
const int packetsize = Q_atoi( Cmd_Argv( 2 )); const int packetsize = Q_atoi( Cmd_Argv( 2 ));
@@ -876,7 +877,7 @@ SV_Ack
================ ================
*/ */
void SV_Ack( netadr_t from ) static void SV_Ack( netadr_t from )
{ {
Con_Printf( "ping %s\n", NET_AdrToString( from )); Con_Printf( "ping %s\n", NET_AdrToString( from ));
} }
@@ -889,7 +890,7 @@ Responds with short info for broadcast scans
The second parameter should be the current protocol version number. The second parameter should be the current protocol version number.
================ ================
*/ */
void SV_Info( netadr_t from, int protocolVersion ) static void SV_Info( netadr_t from, int protocolVersion )
{ {
char s[512]; char s[512];
@@ -947,7 +948,7 @@ SV_BuildNetAnswer
Responds with long info for local and broadcast requests Responds with long info for local and broadcast requests
================ ================
*/ */
void SV_BuildNetAnswer( netadr_t from ) static void SV_BuildNetAnswer( netadr_t from )
{ {
char string[MAX_INFO_STRING]; char string[MAX_INFO_STRING];
int version, context, type; int version, context, type;
@@ -1043,7 +1044,7 @@ SV_Ping
Just responds with an acknowledgement Just responds with an acknowledgement
================ ================
*/ */
void SV_Ping( netadr_t from ) static void SV_Ping( netadr_t from )
{ {
Netchan_OutOfBandPrint( NS_SERVER, from, "ack" ); Netchan_OutOfBandPrint( NS_SERVER, from, "ack" );
} }
@@ -1053,7 +1054,7 @@ void SV_Ping( netadr_t from )
Rcon_Validate Rcon_Validate
================ ================
*/ */
qboolean Rcon_Validate( void ) static qboolean Rcon_Validate( void )
{ {
if( !COM_CheckString( rcon_password.string )) if( !COM_CheckString( rcon_password.string ))
return false; return false;
@@ -1156,7 +1157,7 @@ SV_EstablishTimeBase
Finangles latency and the like. Finangles latency and the like.
=================== ===================
*/ */
void SV_EstablishTimeBase( sv_client_t *cl, usercmd_t *cmds, int dropped, int numbackup, int numcmds ) static void SV_EstablishTimeBase( sv_client_t *cl, usercmd_t *cmds, int dropped, int numbackup, int numcmds )
{ {
double runcmd_time = 0.0; double runcmd_time = 0.0;
int i, cmdnum = dropped; int i, cmdnum = dropped;
@@ -1190,7 +1191,7 @@ SV_CalcClientTime
compute latency for client compute latency for client
=================== ===================
*/ */
float SV_CalcClientTime( sv_client_t *cl ) static float SV_CalcClientTime( sv_client_t *cl )
{ {
float minping, maxping; float minping, maxping;
float ping = 0.0f; float ping = 0.0f;
@@ -1389,7 +1390,7 @@ Called when a player connects to a server or respawns in
a deathmatch. a deathmatch.
============ ============
*/ */
void SV_PutClientInServer( sv_client_t *cl ) static void SV_PutClientInServer( sv_client_t *cl )
{ {
static byte msg_buf[MAX_INIT_MSG + 0x200]; // MAX_INIT_MSG + some space static byte msg_buf[MAX_INIT_MSG + 0x200]; // MAX_INIT_MSG + some space
edict_t *ent = cl->edict; edict_t *ent = cl->edict;
@@ -1522,7 +1523,7 @@ SV_UpdateClientView
Resend the client viewentity (used for demos) Resend the client viewentity (used for demos)
============ ============
*/ */
void SV_UpdateClientView( sv_client_t *cl ) static void SV_UpdateClientView( sv_client_t *cl )
{ {
int viewEnt; int viewEnt;
@@ -3040,7 +3041,7 @@ ucmd_t enttoolscmds[] =
SV_ExecuteUserCommand SV_ExecuteUserCommand
================== ==================
*/ */
void SV_ExecuteClientCommand( sv_client_t *cl, const char *s ) static void SV_ExecuteClientCommand( sv_client_t *cl, const char *s )
{ {
ucmd_t *u; ucmd_t *u;
@@ -3306,7 +3307,7 @@ SV_ParseResourceList
Parse resource list Parse resource list
=================== ===================
*/ */
void SV_ParseResourceList( sv_client_t *cl, sizebuf_t *msg ) static void SV_ParseResourceList( sv_client_t *cl, sizebuf_t *msg )
{ {
int totalsize; int totalsize;
resource_t *resource; resource_t *resource;
@@ -3395,7 +3396,7 @@ SV_ParseCvarValue
Parse a requested value from client cvar Parse a requested value from client cvar
=================== ===================
*/ */
void SV_ParseCvarValue( sv_client_t *cl, sizebuf_t *msg ) static void SV_ParseCvarValue( sv_client_t *cl, sizebuf_t *msg )
{ {
const char *value = MSG_ReadString( msg ); const char *value = MSG_ReadString( msg );
@@ -3411,7 +3412,7 @@ SV_ParseCvarValue2
Parse a requested value from client cvar Parse a requested value from client cvar
=================== ===================
*/ */
void SV_ParseCvarValue2( sv_client_t *cl, sizebuf_t *msg ) static void SV_ParseCvarValue2( sv_client_t *cl, sizebuf_t *msg )
{ {
string name, value; string name, value;
int requestID = MSG_ReadLong( msg ); int requestID = MSG_ReadLong( msg );
@@ -3429,7 +3430,7 @@ void SV_ParseCvarValue2( sv_client_t *cl, sizebuf_t *msg )
SV_ParseVoiceData SV_ParseVoiceData
=================== ===================
*/ */
void SV_ParseVoiceData( sv_client_t *cl, sizebuf_t *msg ) static void SV_ParseVoiceData( sv_client_t *cl, sizebuf_t *msg )
{ {
char received[4096]; char received[4096];
sv_client_t *cur; sv_client_t *cur;
+30 -30
View File
@@ -169,7 +169,7 @@ SV_ValidateMap
check map for typically errors check map for typically errors
================== ==================
*/ */
qboolean SV_ValidateMap( const char *pMapName, qboolean check_spawn ) static qboolean SV_ValidateMap( const char *pMapName, qboolean check_spawn )
{ {
char *spawn_entity; char *spawn_entity;
int flags; int flags;
@@ -210,7 +210,7 @@ Goes directly to a given map without any savegame archiving.
For development work For development work
================== ==================
*/ */
void SV_Map_f( void ) static void SV_Map_f( void )
{ {
char mapname[MAX_QPATH]; char mapname[MAX_QPATH];
@@ -240,7 +240,7 @@ Lists maps according to given substring.
TODO: Make it more convenient. (Timestamp check, temporary file, ...) TODO: Make it more convenient. (Timestamp check, temporary file, ...)
================== ==================
*/ */
void SV_Maps_f( void ) static void SV_Maps_f( void )
{ {
const char *separator = "-------------------"; const char *separator = "-------------------";
const char *argStr = Cmd_Argv( 1 ); // Substr const char *argStr = Cmd_Argv( 1 ); // Substr
@@ -275,7 +275,7 @@ SV_MapBackground_f
Set background map (enable physics in menu) Set background map (enable physics in menu)
================== ==================
*/ */
void SV_MapBackground_f( void ) static void SV_MapBackground_f( void )
{ {
char mapname[MAX_QPATH]; char mapname[MAX_QPATH];
@@ -315,7 +315,7 @@ Change map for next in alpha-bethical ordering
For development work For development work
================== ==================
*/ */
void SV_NextMap_f( void ) static void SV_NextMap_f( void )
{ {
char nextmap[MAX_QPATH]; char nextmap[MAX_QPATH];
int i, next; int i, next;
@@ -366,7 +366,7 @@ SV_NewGame_f
============== ==============
*/ */
void SV_NewGame_f( void ) static void SV_NewGame_f( void )
{ {
if( Cmd_Argc() != 1 ) if( Cmd_Argc() != 1 )
{ {
@@ -383,7 +383,7 @@ SV_HazardCourse_f
============== ==============
*/ */
void SV_HazardCourse_f( void ) static void SV_HazardCourse_f( void )
{ {
if( Cmd_Argc() != 1 ) if( Cmd_Argc() != 1 )
{ {
@@ -406,7 +406,7 @@ SV_Load_f
============== ==============
*/ */
void SV_Load_f( void ) static void SV_Load_f( void )
{ {
char path[MAX_QPATH]; char path[MAX_QPATH];
@@ -426,7 +426,7 @@ SV_QuickLoad_f
============== ==============
*/ */
void SV_QuickLoad_f( void ) static void SV_QuickLoad_f( void )
{ {
Cbuf_AddText( "echo Quick Loading...; wait; load quick" ); Cbuf_AddText( "echo Quick Loading...; wait; load quick" );
} }
@@ -437,7 +437,7 @@ SV_Save_f
============== ==============
*/ */
void SV_Save_f( void ) static void SV_Save_f( void )
{ {
qboolean ret = false; qboolean ret = false;
@@ -464,7 +464,7 @@ SV_QuickSave_f
============== ==============
*/ */
void SV_QuickSave_f( void ) static void SV_QuickSave_f( void )
{ {
Cbuf_AddText( "echo Quick Saving...; wait; save quick" ); Cbuf_AddText( "echo Quick Saving...; wait; save quick" );
} }
@@ -475,7 +475,7 @@ SV_DeleteSave_f
============== ==============
*/ */
void SV_DeleteSave_f( void ) static void SV_DeleteSave_f( void )
{ {
if( Cmd_Argc() != 2 ) if( Cmd_Argc() != 2 )
{ {
@@ -494,7 +494,7 @@ SV_AutoSave_f
============== ==============
*/ */
void SV_AutoSave_f( void ) static void SV_AutoSave_f( void )
{ {
if( Cmd_Argc() != 1 ) if( Cmd_Argc() != 1 )
{ {
@@ -513,7 +513,7 @@ SV_Restart_f
restarts current level restarts current level
================== ==================
*/ */
void SV_Restart_f( void ) static void SV_Restart_f( void )
{ {
// because restart can be multiple issued // because restart can be multiple issued
if( sv.state != ss_active ) if( sv.state != ss_active )
@@ -528,7 +528,7 @@ SV_Reload_f
continue from latest savedgame continue from latest savedgame
================== ==================
*/ */
void SV_Reload_f( void ) static void SV_Reload_f( void )
{ {
// because reload can be multiple issued // because reload can be multiple issued
if( GameState->nextstate != STATE_RUNFRAME ) if( GameState->nextstate != STATE_RUNFRAME )
@@ -545,7 +545,7 @@ SV_ChangeLevel_f
classic change level classic change level
================== ==================
*/ */
void SV_ChangeLevel_f( void ) static void SV_ChangeLevel_f( void )
{ {
if( Cmd_Argc() != 2 ) if( Cmd_Argc() != 2 )
{ {
@@ -563,7 +563,7 @@ SV_ChangeLevel2_f
smooth change level smooth change level
================== ==================
*/ */
void SV_ChangeLevel2_f( void ) static void SV_ChangeLevel2_f( void )
{ {
if( Cmd_Argc() != 3 ) if( Cmd_Argc() != 3 )
{ {
@@ -581,7 +581,7 @@ SV_Kick_f
Kick a user off of the server Kick a user off of the server
================== ==================
*/ */
void SV_Kick_f( void ) static void SV_Kick_f( void )
{ {
sv_client_t *cl; sv_client_t *cl;
const char *param; const char *param;
@@ -612,7 +612,7 @@ void SV_Kick_f( void )
SV_EntPatch_f SV_EntPatch_f
================== ==================
*/ */
void SV_EntPatch_f( void ) static void SV_EntPatch_f( void )
{ {
const char *mapname; const char *mapname;
@@ -638,7 +638,7 @@ void SV_EntPatch_f( void )
SV_Status_f SV_Status_f
================ ================
*/ */
void SV_Status_f( void ) static void SV_Status_f( void )
{ {
sv_client_t *cl; sv_client_t *cl;
int i; int i;
@@ -687,7 +687,7 @@ void SV_Status_f( void )
SV_ConSay_f SV_ConSay_f
================== ==================
*/ */
void SV_ConSay_f( void ) static void SV_ConSay_f( void )
{ {
const char *p; const char *p;
char text[MAX_SYSPATH]; char text[MAX_SYSPATH];
@@ -730,7 +730,7 @@ SV_ServerInfo_f
Examine or change the serverinfo string Examine or change the serverinfo string
=========== ===========
*/ */
void SV_ServerInfo_f( void ) static void SV_ServerInfo_f( void )
{ {
convar_t *var; convar_t *var;
@@ -774,7 +774,7 @@ SV_LocalInfo_f
Examine or change the localinfo string Examine or change the localinfo string
=========== ===========
*/ */
void SV_LocalInfo_f( void ) static void SV_LocalInfo_f( void )
{ {
if( Cmd_Argc() == 1 ) if( Cmd_Argc() == 1 )
{ {
@@ -806,7 +806,7 @@ SV_ClientInfo_f
Examine all a users info strings Examine all a users info strings
=========== ===========
*/ */
void SV_ClientInfo_f( void ) static void SV_ClientInfo_f( void )
{ {
sv_client_t *cl; sv_client_t *cl;
@@ -832,7 +832,7 @@ SV_ClientUserAgent_f
Examine useragent strings Examine useragent strings
=========== ===========
*/ */
void SV_ClientUserAgent_f( void ) static void SV_ClientUserAgent_f( void )
{ {
sv_client_t *cl; sv_client_t *cl;
@@ -857,7 +857,7 @@ SV_KillServer_f
Kick everyone off, possibly in preparation for a new game Kick everyone off, possibly in preparation for a new game
=============== ===============
*/ */
void SV_KillServer_f( void ) static void SV_KillServer_f( void )
{ {
Host_ShutdownServer(); Host_ShutdownServer();
} }
@@ -869,7 +869,7 @@ SV_PlayersOnly_f
disable plhysics but players disable plhysics but players
=============== ===============
*/ */
void SV_PlayersOnly_f( void ) static void SV_PlayersOnly_f( void )
{ {
if( !Cvar_VariableInteger( "sv_cheats" )) return; if( !Cvar_VariableInteger( "sv_cheats" )) return;
@@ -884,7 +884,7 @@ SV_EdictUsage_f
=============== ===============
*/ */
void SV_EdictUsage_f( void ) static void SV_EdictUsage_f( void )
{ {
int active; int active;
@@ -906,7 +906,7 @@ SV_EntityInfo_f
=============== ===============
*/ */
void SV_EntityInfo_f( void ) static void SV_EntityInfo_f( void )
{ {
edict_t *ent; edict_t *ent;
int i; int i;
@@ -950,7 +950,7 @@ Rcon_Redirect_f
Force redirect N lines of console output to client Force redirect N lines of console output to client
================ ================
*/ */
void Rcon_Redirect_f( void ) static void Rcon_Redirect_f( void )
{ {
int lines = 2000; int lines = 2000;
+9 -9
View File
@@ -16,7 +16,7 @@ GNU General Public License for more details.
#include "common.h" #include "common.h"
#include "server.h" #include "server.h"
void SV_CreateCustomizationList( sv_client_t *cl ) static void SV_CreateCustomizationList( sv_client_t *cl )
{ {
resource_t *pResource; resource_t *pResource;
customization_t *pList, *pCust; customization_t *pList, *pCust;
@@ -61,7 +61,7 @@ void SV_CreateCustomizationList( sv_client_t *cl )
} }
} }
qboolean SV_FileInConsistencyList( const char *filename, consistency_t **ppout ) static qboolean SV_FileInConsistencyList( const char *filename, consistency_t **ppout )
{ {
int i; int i;
@@ -246,7 +246,7 @@ void SV_TransferConsistencyInfo( void )
sv.num_consistency = total; sv.num_consistency = total;
} }
void SV_SendConsistencyList( sv_client_t *cl, sizebuf_t *msg ) static void SV_SendConsistencyList( sv_client_t *cl, sizebuf_t *msg )
{ {
int i, lastcheck; int i, lastcheck;
int delta; int delta;
@@ -288,7 +288,7 @@ void SV_SendConsistencyList( sv_client_t *cl, sizebuf_t *msg )
MSG_WriteOneBit( msg, 0 ); MSG_WriteOneBit( msg, 0 );
} }
qboolean SV_CheckFile( sizebuf_t *msg, const char *filename ) static qboolean SV_CheckFile( sizebuf_t *msg, const char *filename )
{ {
resource_t p; resource_t p;
@@ -337,7 +337,7 @@ void SV_AddToResourceList( resource_t *pResource, resource_t *pList )
pList->pPrev = pResource; pList->pPrev = pResource;
} }
void SV_SendCustomization( sv_client_t *cl, int playernum, resource_t *pResource ) static void SV_SendCustomization( sv_client_t *cl, int playernum, resource_t *pResource )
{ {
MSG_BeginServerCmd( &cl->netchan.message, svc_customization ); MSG_BeginServerCmd( &cl->netchan.message, svc_customization );
MSG_WriteByte( &cl->netchan.message, playernum ); // playernum MSG_WriteByte( &cl->netchan.message, playernum ); // playernum
@@ -410,7 +410,7 @@ int SV_EstimateNeededResources( sv_client_t *cl )
return size; return size;
} }
void SV_Customization( sv_client_t *pClient, resource_t *pResource, qboolean bSkipPlayer ) static void SV_Customization( sv_client_t *pClient, resource_t *pResource, qboolean bSkipPlayer )
{ {
int i, nPlayerNumber = -1; int i, nPlayerNumber = -1;
sv_client_t *cl; sv_client_t *cl;
@@ -435,7 +435,7 @@ void SV_Customization( sv_client_t *pClient, resource_t *pResource, qboolean bSk
} }
} }
void SV_PropagateCustomizations( sv_client_t *pHost ) static void SV_PropagateCustomizations( sv_client_t *pHost )
{ {
customization_t *pCust; customization_t *pCust;
resource_t *pResource; resource_t *pResource;
@@ -459,7 +459,7 @@ void SV_PropagateCustomizations( sv_client_t *pHost )
} }
} }
void SV_RegisterResources( sv_client_t *pHost ) static void SV_RegisterResources( sv_client_t *pHost )
{ {
resource_t *pResource; resource_t *pResource;
@@ -470,7 +470,7 @@ void SV_RegisterResources( sv_client_t *pHost )
} }
} }
qboolean SV_UploadComplete( sv_client_t *cl ) static qboolean SV_UploadComplete( sv_client_t *cl )
{ {
if( &cl->resourcesneeded != cl->resourcesneeded.pNext ) if( &cl->resourcesneeded != cl->resourcesneeded.pNext )
return false; return false;
+5 -25
View File
@@ -286,31 +286,8 @@ typedef struct ipfilter_s
static ipfilter_t *ipfilter = NULL; static ipfilter_t *ipfilter = NULL;
static void SV_CleanExpiredIPFilters( void )
{
ipfilter_t *f, **back;
back = &ipfilter;
while( 1 )
{
f = *back;
if( !f ) return;
if( f->endTime && host.realtime > f->endTime )
{
*back = f->next;
back = &f->next;
Mem_Free( f );
}
else back = &f->next;
}
}
static int SV_FilterToString( char *dest, size_t size, qboolean config, ipfilter_t *f ) static int SV_FilterToString( char *dest, size_t size, qboolean config, ipfilter_t *f )
{ {
const char *strformat;
if( config ) if( config )
{ {
return Q_snprintf( dest, size, "addip 0 %s/%d\n", NET_AdrToString( f->adr ), f->prefixlen ); return Q_snprintf( dest, size, "addip 0 %s/%d\n", NET_AdrToString( f->adr ), f->prefixlen );
@@ -379,6 +356,9 @@ qboolean SV_CheckIP( netadr_t *adr )
for( ; entry; entry = entry->next ) for( ; entry; entry = entry->next )
{ {
if( entry->endTime && host.realtime > entry->endTime )
continue; // expired
switch( entry->adr.type6 ) switch( entry->adr.type6 )
{ {
case NA_IP: case NA_IP:
@@ -600,7 +580,7 @@ void SV_ShutdownFilter( void )
#include "tests.h" #include "tests.h"
void Test_StringToFilterAdr( void ) static void Test_StringToFilterAdr( void )
{ {
ipfilter_t f1; ipfilter_t f1;
int i; int i;
@@ -669,7 +649,7 @@ void Test_StringToFilterAdr( void )
} }
} }
void Test_IPFilterIncludesIPFilter( void ) static void Test_IPFilterIncludesIPFilter( void )
{ {
qboolean ret; qboolean ret;
const char *adrs[] = const char *adrs[] =
+7 -7
View File
@@ -180,7 +180,7 @@ SV_FindBestBaseline
trying to deltas with previous entities trying to deltas with previous entities
============= =============
*/ */
int SV_FindBestBaseline( sv_client_t *cl, int index, entity_state_t **baseline, entity_state_t *to, client_frame_t *frame, qboolean player ) static int SV_FindBestBaseline( sv_client_t *cl, int index, entity_state_t **baseline, entity_state_t *to, client_frame_t *frame, qboolean player )
{ {
int bestBitCount; int bestBitCount;
int i, bitCount; int i, bitCount;
@@ -515,7 +515,7 @@ SV_EmitPings
============= =============
*/ */
void SV_EmitPings( sizebuf_t *msg ) static void SV_EmitPings( sizebuf_t *msg )
{ {
sv_client_t *cl; sv_client_t *cl;
int packet_loss; int packet_loss;
@@ -547,7 +547,7 @@ SV_WriteClientdataToMessage
================== ==================
*/ */
void SV_WriteClientdataToMessage( sv_client_t *cl, sizebuf_t *msg ) static void SV_WriteClientdataToMessage( sv_client_t *cl, sizebuf_t *msg )
{ {
clientdata_t nullcd; clientdata_t nullcd;
clientdata_t *from_cd, *to_cd; clientdata_t *from_cd, *to_cd;
@@ -634,7 +634,7 @@ SV_WriteEntitiesToClient
================== ==================
*/ */
void SV_WriteEntitiesToClient( sv_client_t *cl, sizebuf_t *msg ) static void SV_WriteEntitiesToClient( sv_client_t *cl, sizebuf_t *msg )
{ {
client_frame_t *frame; client_frame_t *frame;
entity_state_t *state; entity_state_t *state;
@@ -706,7 +706,7 @@ FRAME UPDATES
SV_SendClientDatagram SV_SendClientDatagram
======================= =======================
*/ */
void SV_SendClientDatagram( sv_client_t *cl ) static void SV_SendClientDatagram( sv_client_t *cl )
{ {
byte msg_buf[MAX_DATAGRAM]; byte msg_buf[MAX_DATAGRAM];
sizebuf_t msg; sizebuf_t msg;
@@ -752,7 +752,7 @@ void SV_SendClientDatagram( sv_client_t *cl )
SV_UpdateUserInfo SV_UpdateUserInfo
======================= =======================
*/ */
void SV_UpdateUserInfo( sv_client_t *cl ) static void SV_UpdateUserInfo( sv_client_t *cl )
{ {
SV_FullClientUpdate( cl, &sv.reliable_datagram ); SV_FullClientUpdate( cl, &sv.reliable_datagram );
ClearBits( cl->flags, FCL_RESEND_USERINFO ); ClearBits( cl->flags, FCL_RESEND_USERINFO );
@@ -764,7 +764,7 @@ void SV_UpdateUserInfo( sv_client_t *cl )
SV_UpdateToReliableMessages SV_UpdateToReliableMessages
======================= =======================
*/ */
void SV_UpdateToReliableMessages( void ) static void SV_UpdateToReliableMessages( void )
{ {
sv_client_t *cl; sv_client_t *cl;
int i; int i;
+1 -1
View File
@@ -4796,7 +4796,7 @@ static enginefuncs_t gEngfuncs =
Delta_UnsetFieldByIndex, Delta_UnsetFieldByIndex,
pfnSetGroupMask, pfnSetGroupMask,
pfnCreateInstancedBaseline, pfnCreateInstancedBaseline,
pfnCVarDirectSet, (void*)Cvar_DirectSet,
pfnForceUnmodified, pfnForceUnmodified,
pfnGetPlayerStats, pfnGetPlayerStats,
Cmd_AddServerCommand, Cmd_AddServerCommand,
+35 -9
View File
@@ -27,6 +27,17 @@ server_t sv; // local server
server_static_t svs; // persistant server info server_static_t svs; // persistant server info
svgame_static_t svgame; // persistant game info svgame_static_t svgame; // persistant game info
/*
==================
Host_SetServerState
==================
*/
static void Host_SetServerState( int state )
{
Cvar_FullSet( "host_serverstate", va( "%i", state ), FCVAR_READ_ONLY );
sv.state = state;
}
/* /*
================ ================
SV_AddResource SV_AddResource
@@ -56,7 +67,7 @@ SV_SendSingleResource
hot precache on a flying hot precache on a flying
================ ================
*/ */
void SV_SendSingleResource( const char *name, resourcetype_t type, int index, byte flags ) static void SV_SendSingleResource( const char *name, resourcetype_t type, int index, byte flags )
{ {
resource_t *pResource = &sv.resources[sv.num_resources]; resource_t *pResource = &sv.resources[sv.num_resources];
int nSize = 0; int nSize = 0;
@@ -284,7 +295,22 @@ static resourcetype_t SV_DetermineResourceType( const char *filename )
return t_generic; return t_generic;
} }
void SV_ReadResourceList( const char *filename ) static const char *SV_GetResourceTypeName( resourcetype_t restype )
{
switch( restype )
{
case t_decal: return "decal";
case t_eventscript: return "eventscript";
case t_generic: return "generic";
case t_model: return "model";
case t_skin: return "skin";
case t_sound: return "sound";
case t_world: return "world";
default: return "unknown";
}
}
static void SV_ReadResourceList( const char *filename )
{ {
string token; string token;
byte *afile; byte *afile;
@@ -306,7 +332,7 @@ void SV_ReadResourceList( const char *filename )
COM_FixSlashes( token ); COM_FixSlashes( token );
restype = SV_DetermineResourceType( token ); restype = SV_DetermineResourceType( token );
Con_DPrintf( " %s (%s)\n", token, COM_GetResourceTypeName( restype )); Con_DPrintf( " %s (%s)\n", token, SV_GetResourceTypeName( restype ));
switch( restype ) switch( restype )
{ {
// TODO do we need to handle other resource types specifically too? // TODO do we need to handle other resource types specifically too?
@@ -334,7 +360,7 @@ SV_CreateGenericResources
loads external resource list loads external resource list
================ ================
*/ */
void SV_CreateGenericResources( void ) static void SV_CreateGenericResources( void )
{ {
string filename; string filename;
@@ -353,7 +379,7 @@ SV_CreateResourceList
add resources to common list add resources to common list
================ ================
*/ */
void SV_CreateResourceList( void ) static void SV_CreateResourceList( void )
{ {
qboolean ffirstsent = false; qboolean ffirstsent = false;
int i, nSize; int i, nSize;
@@ -418,7 +444,7 @@ void SV_CreateResourceList( void )
SV_WriteVoiceCodec SV_WriteVoiceCodec
================ ================
*/ */
void SV_WriteVoiceCodec( sizebuf_t *msg ) static void SV_WriteVoiceCodec( sizebuf_t *msg )
{ {
MSG_BeginServerCmd( msg, svc_voiceinit ); MSG_BeginServerCmd( msg, svc_voiceinit );
MSG_WriteString( msg, VOICE_DEFAULT_CODEC ); MSG_WriteString( msg, VOICE_DEFAULT_CODEC );
@@ -436,7 +462,7 @@ baseline will be transmitted
INTERNAL RESOURCE INTERNAL RESOURCE
================ ================
*/ */
void SV_CreateBaseline( void ) static void SV_CreateBaseline( void )
{ {
entity_state_t nullstate, *base; entity_state_t nullstate, *base;
int playermodel; int playermodel;
@@ -545,7 +571,7 @@ void SV_FreeOldEntities( void )
} }
// decrement svgame.numEntities if the highest number entities died // decrement svgame.numEntities if the highest number entities died
for( ; EDICT_NUM( svgame.numEntities - 1 )->free; svgame.numEntities-- ); for( ; ( ent = EDICT_NUM( svgame.numEntities - 1 )) && ent->free; svgame.numEntities-- );
} }
/* /*
@@ -758,7 +784,7 @@ SV_SetupClients
determine the game type and prepare clients determine the game type and prepare clients
================ ================
*/ */
void SV_SetupClients( void ) static void SV_SetupClients( void )
{ {
qboolean changed_maxclients = false; qboolean changed_maxclients = false;
+9 -20
View File
@@ -156,7 +156,7 @@ SV_HasActivePlayers
returns true if server have spawned players returns true if server have spawned players
================ ================
*/ */
qboolean SV_HasActivePlayers( void ) static qboolean SV_HasActivePlayers( void )
{ {
int i; int i;
@@ -244,7 +244,7 @@ void SV_UpdateMovevars( qboolean initialize )
SV_CheckCmdTimes SV_CheckCmdTimes
================= =================
*/ */
void SV_CheckCmdTimes( void ) static void SV_CheckCmdTimes( void )
{ {
sv_client_t *cl; sv_client_t *cl;
static double lastreset = 0; static double lastreset = 0;
@@ -299,7 +299,7 @@ SV_ProcessFile
process incoming file (customization) process incoming file (customization)
================= =================
*/ */
void SV_ProcessFile( sv_client_t *cl, const char *filename ) static void SV_ProcessFile( sv_client_t *cl, const char *filename )
{ {
customization_t *pList; customization_t *pList;
resource_t *resource; resource_t *resource;
@@ -370,7 +370,7 @@ void SV_ProcessFile( sv_client_t *cl, const char *filename )
SV_ReadPackets SV_ReadPackets
================= =================
*/ */
void SV_ReadPackets( void ) static void SV_ReadPackets( void )
{ {
sv_client_t *cl; sv_client_t *cl;
int i, qport; int i, qport;
@@ -488,7 +488,7 @@ for a few seconds to make sure any final reliable message gets resent
if necessary if necessary
================== ==================
*/ */
void SV_CheckTimeouts( void ) static void SV_CheckTimeouts( void )
{ {
sv_client_t *cl; sv_client_t *cl;
double droppoint; double droppoint;
@@ -541,7 +541,7 @@ This has to be done before the world logic, because
player processing happens outside RunWorldFrame player processing happens outside RunWorldFrame
================ ================
*/ */
void SV_PrepWorldFrame( void ) static void SV_PrepWorldFrame( void )
{ {
edict_t *ent; edict_t *ent;
int i; int i;
@@ -563,7 +563,7 @@ void SV_PrepWorldFrame( void )
SV_IsSimulating SV_IsSimulating
================= =================
*/ */
qboolean SV_IsSimulating( void ) static qboolean SV_IsSimulating( void )
{ {
if( sv.background && SV_Active() && CL_Active()) if( sv.background && SV_Active() && CL_Active())
{ {
@@ -593,7 +593,7 @@ qboolean SV_IsSimulating( void )
SV_RunGameFrame SV_RunGameFrame
================= =================
*/ */
qboolean SV_RunGameFrame( void ) static qboolean SV_RunGameFrame( void )
{ {
sv.simulating = SV_IsSimulating(); sv.simulating = SV_IsSimulating();
@@ -712,17 +712,6 @@ void Host_ServerFrame( void )
NET_MasterHeartbeat (); NET_MasterHeartbeat ();
} }
/*
==================
Host_SetServerState
==================
*/
void Host_SetServerState( int state )
{
Cvar_FullSet( "host_serverstate", va( "%i", state ), FCVAR_READ_ONLY );
sv.state = state;
}
//============================================================================ //============================================================================
/* /*
================= =================
@@ -1053,7 +1042,7 @@ SV_FreeClients
release server clients release server clients
================ ================
*/ */
void SV_FreeClients( void ) static void SV_FreeClients( void )
{ {
if( svs.maxclients != 0 ) if( svs.maxclients != 0 )
{ {
+3 -3
View File
@@ -429,7 +429,7 @@ qboolean SV_MoveTest( edict_t *ent, vec3_t move, qboolean relink )
} }
} }
qboolean SV_StepDirection( edict_t *ent, float yaw, float dist ) static qboolean SV_StepDirection( edict_t *ent, float yaw, float dist )
{ {
int ret; int ret;
float cSin, cCos; float cSin, cCos;
@@ -445,7 +445,7 @@ qboolean SV_StepDirection( edict_t *ent, float yaw, float dist )
return ret; return ret;
} }
qboolean SV_FlyDirection( edict_t *ent, vec3_t move ) static qboolean SV_FlyDirection( edict_t *ent, vec3_t move )
{ {
int ret; int ret;
@@ -455,7 +455,7 @@ qboolean SV_FlyDirection( edict_t *ent, vec3_t move )
return ret; return ret;
} }
void SV_NewChaseDir( edict_t *actor, vec3_t destination, float dist ) static void SV_NewChaseDir( edict_t *actor, vec3_t destination, float dist )
{ {
float deltax, deltay; float deltax, deltay;
float tempdir, olddir, turnaround; float tempdir, olddir, turnaround;
+4 -2
View File
@@ -1842,8 +1842,10 @@ void SV_Physics( void )
// increase framecount // increase framecount
sv.framecount++; sv.framecount++;
#if 0 // figure out why this causes memory corruption
// decrement svgame.numEntities if the highest number entities died // decrement svgame.numEntities if the highest number entities died
for( ; EDICT_NUM( svgame.numEntities - 1 )->free; svgame.numEntities-- ); for( ; ( ent = EDICT_NUM( svgame.numEntities - 1 )) && ent->free; svgame.numEntities-- );
#endif
} }
/* /*
@@ -1956,7 +1958,7 @@ SV_GetLightStyle
needs to get correct working SV_LightPoint needs to get correct working SV_LightPoint
================== ==================
*/ */
const char *GAME_EXPORT SV_GetLightStyle( int style ) static const char *GAME_EXPORT SV_GetLightStyle( int style )
{ {
if( style < 0 ) style = 0; if( style < 0 ) style = 0;
if( style >= MAX_LIGHTSTYLES ) if( style >= MAX_LIGHTSTYLES )
-27
View File
@@ -766,33 +766,6 @@ static void SaveFinish( SAVERESTOREDATA *pSaveData )
Mem_Free( pSaveData ); Mem_Free( pSaveData );
} }
/*
=============
DumpHashStrings
debug thing
=============
*/
static void DumpHashStrings( SAVERESTOREDATA *pSaveData, const char *pMessage )
{
int i, count = 0;
if( pSaveData && pSaveData->pTokens )
{
Con_Printf( "%s\n", pMessage );
for( i = 0; i < pSaveData->tokenCount; i++ )
{
if( !pSaveData->pTokens[i] )
continue;
Con_Printf( "#%i %s\n", count, pSaveData->pTokens[i] );
count++;
}
Con_Printf( "total %i actual %i\n", pSaveData->tokenCount, count );
}
}
/* /*
============= =============
StoreHashTable StoreHashTable
+1 -1
View File
@@ -90,7 +90,7 @@ def configure(conf):
conf.define('XASH_NO_LIBDL',1) conf.define('XASH_NO_LIBDL',1)
if not conf.env.DEST_OS in ['win32', 'android'] and not conf.options.NO_ASYNC_RESOLVE: if not conf.env.DEST_OS in ['win32', 'android'] and not conf.options.NO_ASYNC_RESOLVE:
conf.check_pthreads() conf.check_pthreads(mode='c')
if conf.env.DEST_OS == 'linux': if conf.env.DEST_OS == 'linux':
conf.check_cc(lib='rt') conf.check_cc(lib='rt')
+4 -3
View File
@@ -627,7 +627,7 @@ static void FS_WriteGameInfo( const char *filepath, gameinfo_t *GameInfo )
FS_Close( f ); // all done FS_Close( f ); // all done
} }
void FS_InitGameInfo( gameinfo_t *GameInfo, const char *gamedir ) static void FS_InitGameInfo( gameinfo_t *GameInfo, const char *gamedir )
{ {
memset( GameInfo, 0, sizeof( *GameInfo )); memset( GameInfo, 0, sizeof( *GameInfo ));
@@ -658,7 +658,7 @@ void FS_InitGameInfo( gameinfo_t *GameInfo, const char *gamedir )
GameInfo->max_particles = 4096; GameInfo->max_particles = 4096;
} }
void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qboolean isGameInfo ) static void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qboolean isGameInfo )
{ {
char *pfile = (char*) buf; char *pfile = (char*) buf;
qboolean found_linux = false, found_osx = false; qboolean found_linux = false, found_osx = false;
@@ -919,7 +919,7 @@ void FS_ParseGenericGameInfo( gameinfo_t *GameInfo, const char *buf, const qbool
FS_CreateDefaultGameInfo FS_CreateDefaultGameInfo
================ ================
*/ */
void FS_CreateDefaultGameInfo( const char *filename ) static void FS_CreateDefaultGameInfo( const char *filename )
{ {
gameinfo_t defGI; gameinfo_t defGI;
@@ -3022,6 +3022,7 @@ fs_api_t g_api =
FS_GetFullDiskPath, FS_GetFullDiskPath,
}; };
int EXPORT GetFSAPI( int version, fs_api_t *api, fs_globals_t **globals, fs_interface_t *engfuncs );
int EXPORT GetFSAPI( int version, fs_api_t *api, fs_globals_t **globals, fs_interface_t *engfuncs ) int EXPORT GetFSAPI( int version, fs_api_t *api, fs_globals_t **globals, fs_interface_t *engfuncs )
{ {
if( engfuncs && !FS_InitInterface( version, engfuncs )) if( engfuncs && !FS_InitInterface( version, engfuncs ))
+2 -2
View File
@@ -527,7 +527,7 @@ make sure quaternions are within 180 degrees of one another,
if not, reverse q if not, reverse q
==================== ====================
*/ */
void QuaternionAlign( const vec4_t p, const vec4_t q, vec4_t qt ) static void QuaternionAlign( const vec4_t p, const vec4_t q, vec4_t qt )
{ {
// decide if one of the quaternions is backwards // decide if one of the quaternions is backwards
float a = 0.0f; float a = 0.0f;
@@ -557,7 +557,7 @@ void QuaternionAlign( const vec4_t p, const vec4_t q, vec4_t qt )
QuaternionSlerpNoAlign QuaternionSlerpNoAlign
==================== ====================
*/ */
void QuaternionSlerpNoAlign( const vec4_t p, const vec4_t q, float t, vec4_t qt ) static void QuaternionSlerpNoAlign( const vec4_t p, const vec4_t q, float t, vec4_t qt )
{ {
float omega, cosom, sinom, sclp, sclq; float omega, cosom, sinom, sclp, sclq;
int i; int i;
+1 -1
View File
@@ -495,7 +495,7 @@ static void GL2_InitIncrementalBuffer( int i, GLuint size )
} }
qboolean GL2_InitProgs( void ) static qboolean GL2_InitProgs( void )
{ {
static const GLuint precache_progs[] = { static const GLuint precache_progs[] = {
BIT( GL2_ATTR_POS ), // out = ucolor BIT( GL2_ATTR_POS ), // out = ucolor
+16 -16
View File
@@ -225,7 +225,7 @@ Generate a list of trifans or strips
for the model, which holds for all frames for the model, which holds for all frames
================ ================
*/ */
void BuildTris( void ) static void BuildTris( void )
{ {
int len, bestlen, besttype = 0; int len, bestlen, besttype = 0;
int bestverts[1024]; int bestverts[1024];
@@ -305,7 +305,7 @@ void BuildTris( void )
GL_MakeAliasModelDisplayLists GL_MakeAliasModelDisplayLists
================ ================
*/ */
void GL_MakeAliasModelDisplayLists( model_t *m ) static void GL_MakeAliasModelDisplayLists( model_t *m )
{ {
trivertex_t *verts; trivertex_t *verts;
int i, j; int i, j;
@@ -340,7 +340,7 @@ ALIAS MODELS
Mod_LoadAliasFrame Mod_LoadAliasFrame
================= =================
*/ */
void *Mod_LoadAliasFrame( void *pin, maliasframedesc_t *frame ) static void *Mod_LoadAliasFrame( void *pin, maliasframedesc_t *frame )
{ {
daliasframe_t *pdaliasframe; daliasframe_t *pdaliasframe;
trivertex_t *pinframe; trivertex_t *pinframe;
@@ -372,7 +372,7 @@ void *Mod_LoadAliasFrame( void *pin, maliasframedesc_t *frame )
Mod_LoadAliasGroup Mod_LoadAliasGroup
================= =================
*/ */
void *Mod_LoadAliasGroup( void *pin, maliasframedesc_t *frame ) static void *Mod_LoadAliasGroup( void *pin, maliasframedesc_t *frame )
{ {
daliasgroup_t *pingroup; daliasgroup_t *pingroup;
int i, numframes; int i, numframes;
@@ -413,7 +413,7 @@ void *Mod_LoadAliasGroup( void *pin, maliasframedesc_t *frame )
Mod_CreateSkinData Mod_CreateSkinData
=============== ===============
*/ */
rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height ) static rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height )
{ {
static rgbdata_t skin; static rgbdata_t skin;
char name[MAX_QPATH]; char name[MAX_QPATH];
@@ -475,7 +475,7 @@ rgbdata_t *Mod_CreateSkinData( model_t *mod, byte *data, int width, int height )
return gEngfuncs.FS_CopyImage( &skin ); return gEngfuncs.FS_CopyImage( &skin );
} }
void *Mod_LoadSingleSkin( model_t *loadmodel, daliasskintype_t *pskintype, int skinnum, int size ) static void *Mod_LoadSingleSkin( model_t *loadmodel, daliasskintype_t *pskintype, int skinnum, int size )
{ {
string name, lumaname; string name, lumaname;
string checkname; string checkname;
@@ -506,7 +506,7 @@ void *Mod_LoadSingleSkin( model_t *loadmodel, daliasskintype_t *pskintype, int s
return ((byte *)(pskintype + 1) + size); return ((byte *)(pskintype + 1) + size);
} }
void *Mod_LoadGroupSkin( model_t *loadmodel, daliasskintype_t *pskintype, int skinnum, int size ) static void *Mod_LoadGroupSkin( model_t *loadmodel, daliasskintype_t *pskintype, int skinnum, int size )
{ {
daliasskininterval_t *pinskinintervals; daliasskininterval_t *pinskinintervals;
daliasskingroup_t *pinskingroup; daliasskingroup_t *pinskingroup;
@@ -552,7 +552,7 @@ void *Mod_LoadGroupSkin( model_t *loadmodel, daliasskintype_t *pskintype, int sk
Mod_LoadAllSkins Mod_LoadAllSkins
=============== ===============
*/ */
void *Mod_LoadAllSkins( model_t *mod, int numskins, daliasskintype_t *pskintype ) static void *Mod_LoadAllSkins( model_t *mod, int numskins, daliasskintype_t *pskintype )
{ {
int i, size; int i, size;
@@ -582,7 +582,7 @@ void *Mod_LoadAllSkins( model_t *mod, int numskins, daliasskintype_t *pskintype
Mod_CalcAliasBounds Mod_CalcAliasBounds
================= =================
*/ */
void Mod_CalcAliasBounds( model_t *mod ) static void Mod_CalcAliasBounds( model_t *mod )
{ {
int i, j, k; int i, j, k;
float radius; float radius;
@@ -763,7 +763,7 @@ R_AliasDynamicLight
similar to R_StudioDynamicLight similar to R_StudioDynamicLight
=============== ===============
*/ */
void R_AliasDynamicLight( cl_entity_t *ent, alight_t *plight ) static void R_AliasDynamicLight( cl_entity_t *ent, alight_t *plight )
{ {
movevars_t *mv = tr.movevars; movevars_t *mv = tr.movevars;
vec3_t lightDir, vecSrc, vecEnd; vec3_t lightDir, vecSrc, vecEnd;
@@ -943,7 +943,7 @@ R_AliasSetupLighting
=============== ===============
*/ */
void R_AliasSetupLighting( alight_t *plight ) static void R_AliasSetupLighting( alight_t *plight )
{ {
if( !m_pAliasHeader || !plight ) if( !m_pAliasHeader || !plight )
return; return;
@@ -964,7 +964,7 @@ R_AliasLighting
=============== ===============
*/ */
void R_AliasLighting( float *lv, const vec3_t normal ) static void R_AliasLighting( float *lv, const vec3_t normal )
{ {
float illum = g_alias.ambientlight; float illum = g_alias.ambientlight;
float r, lightcos; float r, lightcos;
@@ -1013,7 +1013,7 @@ static void R_AliasSetRemapColors( int newTop, int newBottom )
GL_DrawAliasFrame GL_DrawAliasFrame
============= =============
*/ */
void GL_DrawAliasFrame( aliashdr_t *paliashdr ) static void GL_DrawAliasFrame( aliashdr_t *paliashdr )
{ {
float lv_tmp; float lv_tmp;
trivertex_t *verts0; trivertex_t *verts0;
@@ -1075,7 +1075,7 @@ void GL_DrawAliasFrame( aliashdr_t *paliashdr )
GL_DrawAliasShadow GL_DrawAliasShadow
============= =============
*/ */
void GL_DrawAliasShadow( aliashdr_t *paliashdr ) static void GL_DrawAliasShadow( aliashdr_t *paliashdr )
{ {
trivertex_t *verts0; trivertex_t *verts0;
trivertex_t *verts1; trivertex_t *verts1;
@@ -1153,7 +1153,7 @@ R_AliasLerpMovement
==================== ====================
*/ */
void R_AliasLerpMovement( cl_entity_t *e ) static void R_AliasLerpMovement( cl_entity_t *e )
{ {
float f = 1.0f; float f = 1.0f;
@@ -1196,7 +1196,7 @@ R_SetupAliasFrame
================= =================
*/ */
void R_SetupAliasFrame( cl_entity_t *e, aliashdr_t *paliashdr ) static void R_SetupAliasFrame( cl_entity_t *e, aliashdr_t *paliashdr )
{ {
int newpose, oldpose; int newpose, oldpose;
int newframe, oldframe; int newframe, oldframe;
+1 -1
View File
@@ -49,7 +49,7 @@ R_Speeds_Printf
helper to print into r_speeds message helper to print into r_speeds message
============== ==============
*/ */
void R_Speeds_Printf( const char *msg, ... ) static void R_Speeds_Printf( const char *msg, ... )
{ {
va_list argptr; va_list argptr;
char text[2048]; char text[2048];
+8 -8
View File
@@ -370,7 +370,7 @@ R_DrawTorus
Draw beamtours Draw beamtours
================ ================
*/ */
void R_DrawTorus( vec3_t source, vec3_t delta, float width, float scale, float freq, float speed, int segments ) static void R_DrawTorus( vec3_t source, vec3_t delta, float width, float scale, float freq, float speed, int segments )
{ {
int i, noiseIndex, noiseStep; int i, noiseIndex, noiseStep;
float div, length, fraction, factor, vLast, vStep; float div, length, fraction, factor, vLast, vStep;
@@ -459,7 +459,7 @@ R_DrawDisk
Draw beamdisk Draw beamdisk
================ ================
*/ */
void R_DrawDisk( vec3_t source, vec3_t delta, float width, float scale, float freq, float speed, int segments ) static void R_DrawDisk( vec3_t source, vec3_t delta, float width, float scale, float freq, float speed, int segments )
{ {
float div, length, fraction; float div, length, fraction;
float w, vLast, vStep; float w, vLast, vStep;
@@ -517,7 +517,7 @@ R_DrawCylinder
Draw beam cylinder Draw beam cylinder
================ ================
*/ */
void R_DrawCylinder( vec3_t source, vec3_t delta, float width, float scale, float freq, float speed, int segments ) static void R_DrawCylinder( vec3_t source, vec3_t delta, float width, float scale, float freq, float speed, int segments )
{ {
float div, length, fraction; float div, length, fraction;
float vLast, vStep; float vLast, vStep;
@@ -574,7 +574,7 @@ R_DrawBeamFollow
drawi followed beam drawi followed beam
============== ==============
*/ */
void R_DrawBeamFollow( BEAM *pbeam, float frametime ) static void R_DrawBeamFollow( BEAM *pbeam, float frametime )
{ {
particle_t *pnew, *particles; particle_t *pnew, *particles;
float fraction, div, vLast, vStep; float fraction, div, vLast, vStep;
@@ -724,7 +724,7 @@ R_DrawRing
Draw beamring Draw beamring
================ ================
*/ */
void R_DrawRing( vec3_t source, vec3_t delta, float width, float amplitude, float freq, float speed, int segments ) static void R_DrawRing( vec3_t source, vec3_t delta, float width, float amplitude, float freq, float speed, int segments )
{ {
int i, j, noiseIndex, noiseStep; int i, j, noiseIndex, noiseStep;
float div, length, fraction, factor, vLast, vStep; float div, length, fraction, factor, vLast, vStep;
@@ -881,7 +881,7 @@ R_BeamRecomputeEndpoints
Recomputes beam endpoints.. Recomputes beam endpoints..
============== ==============
*/ */
qboolean R_BeamRecomputeEndpoints( BEAM *pbeam ) static qboolean R_BeamRecomputeEndpoints( BEAM *pbeam )
{ {
if( FBitSet( pbeam->flags, FBEAM_STARTENTITY )) if( FBitSet( pbeam->flags, FBEAM_STARTENTITY ))
{ {
@@ -934,7 +934,7 @@ R_BeamDraw
Update beam vars and draw it Update beam vars and draw it
============== ==============
*/ */
void R_BeamDraw( BEAM *pbeam, float frametime ) static void R_BeamDraw( BEAM *pbeam, float frametime )
{ {
model_t *model; model_t *model;
vec3_t delta; vec3_t delta;
@@ -1180,7 +1180,7 @@ R_BeamDrawCustomEntity
initialize beam from server entity initialize beam from server entity
============== ==============
*/ */
void R_BeamDrawCustomEntity( cl_entity_t *ent ) static void R_BeamDrawCustomEntity( cl_entity_t *ent )
{ {
BEAM beam; BEAM beam;
float amp = ent->curstate.body / 100.0f; float amp = ent->curstate.body / 100.0f;
+12 -6
View File
@@ -95,7 +95,7 @@ static void GAME_EXPORT CL_FillRGBABlend( float _x, float _y, float _w, float _h
pglDisable( GL_BLEND ); pglDisable( GL_BLEND );
} }
void Mod_BrushUnloadTextures( model_t *mod ) static void Mod_BrushUnloadTextures( model_t *mod )
{ {
int i; int i;
@@ -110,7 +110,7 @@ void Mod_BrushUnloadTextures( model_t *mod )
} }
} }
void Mod_UnloadTextures( model_t *mod ) static void Mod_UnloadTextures( model_t *mod )
{ {
Assert( mod != NULL ); Assert( mod != NULL );
@@ -134,7 +134,7 @@ void Mod_UnloadTextures( model_t *mod )
} }
} }
qboolean Mod_ProcessRenderData( model_t *mod, qboolean create, const byte *buf ) static qboolean Mod_ProcessRenderData( model_t *mod, qboolean create, const byte *buf )
{ {
qboolean loaded = true; qboolean loaded = true;
@@ -237,6 +237,11 @@ static int GL_RefGetParm( int parm, int arg )
return glState.stencilEnabled; return glState.stencilEnabled;
case PARM_SKY_SPHERE: case PARM_SKY_SPHERE:
return FBitSet( tr.world->flags, FWORLD_SKYSPHERE ) && !FBitSet( tr.world->flags, FWORLD_CUSTOM_SKYBOX ); return FBitSet( tr.world->flags, FWORLD_SKYSPHERE ) && !FBitSet( tr.world->flags, FWORLD_CUSTOM_SKYBOX );
case PARM_TEX_FILTERING:
if( arg < 0 )
return gl_texture_nearest.value == 0.0f;
return GL_TextureFilteringEnabled( R_GetTexture( arg ));
default: default:
return ENGINE_GET_PARM_( parm, arg ); return ENGINE_GET_PARM_( parm, arg );
} }
@@ -288,7 +293,7 @@ static const char *GL_TextureName( unsigned int texnum )
return R_GetTexture( texnum )->name; return R_GetTexture( texnum )->name;
} }
const byte *GL_TextureData( unsigned int texnum ) static const byte *GL_TextureData( unsigned int texnum )
{ {
rgbdata_t *pic = R_GetTexture( texnum )->original; rgbdata_t *pic = R_GetTexture( texnum )->original;
@@ -297,7 +302,7 @@ const byte *GL_TextureData( unsigned int texnum )
return NULL; return NULL;
} }
void R_ProcessEntData( qboolean allocate, cl_entity_t *entities, unsigned int max_entities ) static void R_ProcessEntData( qboolean allocate, cl_entity_t *entities, unsigned int max_entities )
{ {
if( !allocate ) if( !allocate )
{ {
@@ -323,7 +328,7 @@ static void GAME_EXPORT R_Flush( unsigned int flags )
// stub // stub
} }
qboolean R_SetDisplayTransform( ref_screen_rotation_t rotate, int offset_x, int offset_y, float scale_x, float scale_y ) static qboolean R_SetDisplayTransform( ref_screen_rotation_t rotate, int offset_x, int offset_y, float scale_x, float scale_y )
{ {
qboolean ret = true; qboolean ret = true;
if( rotate > 0 ) if( rotate > 0 )
@@ -511,6 +516,7 @@ ref_interface_t gReffuncs =
VGUI_GenerateTexture, VGUI_GenerateTexture,
}; };
int EXPORT GetRefAPI( int version, ref_interface_t *funcs, ref_api_t *engfuncs, ref_globals_t *globals );
int EXPORT GetRefAPI( int version, ref_interface_t *funcs, ref_api_t *engfuncs, ref_globals_t *globals ) int EXPORT GetRefAPI( int version, ref_interface_t *funcs, ref_api_t *engfuncs, ref_globals_t *globals )
{ {
if( version != REF_API_VERSION ) if( version != REF_API_VERSION )
+10 -10
View File
@@ -143,7 +143,7 @@ static void R_GetDecalDimensions( int texture, int *width, int *height )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// compute the decal basis based on surface normal // compute the decal basis based on surface normal
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
void R_DecalComputeBasis( msurface_t *surf, int flags, vec3_t textureSpaceBasis[3] ) static void R_DecalComputeBasis( msurface_t *surf, int flags, vec3_t textureSpaceBasis[3] )
{ {
vec3_t surfaceNormal; vec3_t surfaceNormal;
@@ -179,7 +179,7 @@ void R_DecalComputeBasis( msurface_t *surf, int flags, vec3_t textureSpaceBasis[
VectorNormalize2( surf->texinfo->vecs[1], textureSpaceBasis[1] ); VectorNormalize2( surf->texinfo->vecs[1], textureSpaceBasis[1] );
} }
void R_SetupDecalTextureSpaceBasis( decal_t *pDecal, msurface_t *surf, int texture, vec3_t textureSpaceBasis[3], float decalWorldScale[2] ) static void R_SetupDecalTextureSpaceBasis( decal_t *pDecal, msurface_t *surf, int texture, vec3_t textureSpaceBasis[3], float decalWorldScale[2] )
{ {
int width, height; int width, height;
@@ -199,7 +199,7 @@ void R_SetupDecalTextureSpaceBasis( decal_t *pDecal, msurface_t *surf, int textu
} }
// Build the initial list of vertices from the surface verts into the global array, 'verts'. // Build the initial list of vertices from the surface verts into the global array, 'verts'.
void R_SetupDecalVertsForMSurface( decal_t *pDecal, msurface_t *surf, vec3_t textureSpaceBasis[3], float *verts ) static void R_SetupDecalVertsForMSurface( decal_t *pDecal, msurface_t *surf, vec3_t textureSpaceBasis[3], float *verts )
{ {
float *v; float *v;
int i; int i;
@@ -214,7 +214,7 @@ void R_SetupDecalVertsForMSurface( decal_t *pDecal, msurface_t *surf, vec3_t tex
} }
// Figure out where the decal maps onto the surface. // Figure out where the decal maps onto the surface.
void R_SetupDecalClip( decal_t *pDecal, msurface_t *surf, int texture, vec3_t textureSpaceBasis[3], float decalWorldScale[2] ) static void R_SetupDecalClip( decal_t *pDecal, msurface_t *surf, int texture, vec3_t textureSpaceBasis[3], float decalWorldScale[2] )
{ {
R_SetupDecalTextureSpaceBasis( pDecal, surf, texture, textureSpaceBasis, decalWorldScale ); R_SetupDecalTextureSpaceBasis( pDecal, surf, texture, textureSpaceBasis, decalWorldScale );
@@ -229,7 +229,7 @@ void R_SetupDecalClip( decal_t *pDecal, msurface_t *surf, int texture, vec3_t te
// Clip polygon to decal in texture space // Clip polygon to decal in texture space
// JAY: This code is lame, change it later. It does way too much work per frame // JAY: This code is lame, change it later. It does way too much work per frame
// It can be made to recursively call the clipping code and only copy the vertex list once // It can be made to recursively call the clipping code and only copy the vertex list once
int R_ClipInside( float *vert, int edge ) static int R_ClipInside( float *vert, int edge )
{ {
switch( edge ) switch( edge )
{ {
@@ -253,7 +253,7 @@ int R_ClipInside( float *vert, int edge )
return 0; return 0;
} }
void R_ClipIntersect( float *one, float *two, float *out, int edge ) static void R_ClipIntersect( float *one, float *two, float *out, int edge )
{ {
float t; float t;
@@ -354,7 +354,7 @@ static int SHClip( float *vert, int vertCount, float *out, int edge )
return outCount; return outCount;
} }
float *R_DoDecalSHClip( float *pInVerts, decal_t *pDecal, int nStartVerts, int *pVertCount ) static float *R_DoDecalSHClip( float *pInVerts, decal_t *pDecal, int nStartVerts, int *pVertCount )
{ {
float *pOutVerts = g_DecalClipVerts[0]; float *pOutVerts = g_DecalClipVerts[0];
int outCount; int outCount;
@@ -374,7 +374,7 @@ float *R_DoDecalSHClip( float *pInVerts, decal_t *pDecal, int nStartVerts, int *
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Generate clipped vertex list for decal pdecal projected onto polygon psurf // Generate clipped vertex list for decal pdecal projected onto polygon psurf
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
float *R_DecalVertsClip( decal_t *pDecal, msurface_t *surf, int texture, int *pVertCount ) static float *R_DecalVertsClip( decal_t *pDecal, msurface_t *surf, int texture, int *pVertCount )
{ {
float decalWorldScale[2]; float decalWorldScale[2];
vec3_t textureSpaceBasis[3]; vec3_t textureSpaceBasis[3];
@@ -492,7 +492,7 @@ R_DecalCreatePoly
creates mesh for decal on first rendering creates mesh for decal on first rendering
==================== ====================
*/ */
glpoly_t *R_DecalCreatePoly( decalinfo_t *decalinfo, decal_t *pdecal, msurface_t *surf ) static glpoly_t *R_DecalCreatePoly( decalinfo_t *decalinfo, decal_t *pdecal, msurface_t *surf )
{ {
int lnumverts; int lnumverts;
glpoly_t *poly; glpoly_t *poly;
@@ -595,7 +595,7 @@ static void R_DecalCreate( decalinfo_t *decalinfo, msurface_t *surf, float x, fl
R_AddDecalToSurface( pdecal, surf, decalinfo ); R_AddDecalToSurface( pdecal, surf, decalinfo );
} }
void R_DecalSurface( msurface_t *surf, decalinfo_t *decalinfo ) static void R_DecalSurface( msurface_t *surf, decalinfo_t *decalinfo )
{ {
// get the texture associated with this surface // get the texture associated with this surface
mtexinfo_t *tex = surf->texinfo; mtexinfo_t *tex = surf->texinfo;

Some files were not shown because too many files have changed in this diff Show More