Skip to content

Commit

Permalink
misc: unused code removed, refs #31
Browse files Browse the repository at this point in the history
Credit goes to /dev/humancontroller and the Unvanquished project
  • Loading branch information
JanSimek committed Jan 12, 2013
1 parent b88044b commit cf4f814
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 132 deletions.
10 changes: 2 additions & 8 deletions src/client/snd_local.h
Expand Up @@ -208,11 +208,8 @@ extern channel_t s_channels[MAX_CHANNELS];
extern channel_t loop_channels[MAX_CHANNELS];
extern int numLoopChannels;

extern int s_paintedtime;
extern vec3_t listener_forward;
extern vec3_t listener_right;
extern vec3_t listener_up;
extern dma_t dma;
extern int s_paintedtime;
extern dma_t dma;

typedef struct
{
Expand Down Expand Up @@ -268,9 +265,6 @@ void S_PaintChannels(int endtime);

void S_memoryLoad(sfx_t *sfx);

// spatializes a channel
void S_Spatialize(channel_t *ch);

// adpcm functions
int S_AdpcmMemoryNeeded(const wavinfo_t *info);
void S_AdpcmEncodeSound(sfx_t *sfx, short *samples);
Expand Down
1 change: 0 additions & 1 deletion src/game/bg_public.h
Expand Up @@ -1494,7 +1494,6 @@ qboolean BG_AddMagicAmmo(playerState_t *ps, int *skill, int teamNum, int numOfCl

void PM_ClipVelocity(vec3_t in, vec3_t normal, vec3_t out, float overbounce);

//#define ARENAS_PER_TIER 4
#define MAX_ARENAS 64
#define MAX_ARENAS_TEXT 8192

Expand Down
82 changes: 0 additions & 82 deletions src/qcommon/q_shared.c
Expand Up @@ -221,34 +221,6 @@ void COM_BitClear(int array[], int bitNum)
}
//============================================================================

/*
============================================================================
BYTE ORDER FUNCTIONS
============================================================================
*/
/*
// can't just use function pointers, or dll linkage can
// mess up when qcommon is included in multiple places
static short ( *_BigShort )( short l ) = NULL;
static short ( *_LittleShort )( short l ) = NULL;
static int ( *_BigLong )( int l ) = NULL;
static int ( *_LittleLong )( int l ) = NULL;
static qint64 ( *_BigLong64 )( qint64 l ) = NULL;
static qint64 ( *_LittleLong64 )( qint64 l ) = NULL;
static float ( *_BigFloat )( float l ) = NULL;
static float ( *_LittleFloat )( float l ) = NULL;
short LittleShort( short l ) {return _LittleShort( l );}
int LittleLong( int l ) {return _LittleLong( l );}
qint64 LittleLong64( qint64 l ) {return _LittleLong64( l );}
float LittleFloat( float l ) {return _LittleFloat( l );}
short BigShort( short l ) {return _BigShort( l );}
int BigLong( int l ) {return _BigLong( l );}
qint64 BigLong64( qint64 l ) {return _BigLong64( l );}
float BigFloat( float l ) {return _BigFloat( l );}
*/

short ShortSwap(short l)
{
byte b1, b2;
Expand Down Expand Up @@ -281,27 +253,6 @@ int LongNoSwap(int l)
return l;
}

qint64 Long64Swap(qint64 ll)
{
qint64 result;

result.b0 = ll.b7;
result.b1 = ll.b6;
result.b2 = ll.b5;
result.b3 = ll.b4;
result.b4 = ll.b3;
result.b5 = ll.b2;
result.b6 = ll.b1;
result.b7 = ll.b0;

return result;
}

qint64 Long64NoSwap(qint64 ll)
{
return ll;
}

float FloatSwap(const float *f)
{
floatint_t out;
Expand All @@ -317,39 +268,6 @@ float FloatNoSwap(float f)
return f;
}

/*
================
Swap_Init
================
*/
/*
void Swap_Init( void ) {
byte swaptest[2] = {1,0};
// set the byte swapping variables in a portable manner
if ( *(short *)swaptest == 1 ) {
_BigShort = ShortSwap;
_LittleShort = ShortNoSwap;
_BigLong = LongSwap;
_LittleLong = LongNoSwap;
_BigLong64 = Long64Swap;
_LittleLong64 = Long64NoSwap;
_BigFloat = FloatSwap;
_LittleFloat = FloatNoSwap;
} else
{
_BigShort = ShortNoSwap;
_LittleShort = ShortSwap;
_BigLong = LongNoSwap;
_LittleLong = LongSwap;
_BigLong64 = Long64NoSwap;
_LittleLong64 = Long64Swap;
_BigFloat = FloatNoSwap;
_LittleFloat = FloatSwap;
}
}
*/

/*
============================================================================
PARSING
Expand Down
23 changes: 0 additions & 23 deletions src/qcommon/q_shared.h
Expand Up @@ -988,20 +988,6 @@ char *Q_CleanDirName(char *dirname);

//=============================================

// 64-bit integers for global rankings interface
// implemented as a struct for qvm compatibility
typedef struct
{
byte b0;
byte b1;
byte b2;
byte b3;
byte b4;
byte b5;
byte b6;
byte b7;
} qint64;

float *tv(float x, float y, float z);

#define rc(x) va("%s^7", x) // shortcut for color reset after printing variable
Expand Down Expand Up @@ -1766,15 +1752,6 @@ typedef enum
FMV_ID_WAIT
} e_status;

typedef enum _flag_status
{
FLAG_ATBASE = 0,
FLAG_TAKEN, // CTF
FLAG_TAKEN_RED, // One Flag CTF
FLAG_TAKEN_BLUE, // One Flag CTF
FLAG_DROPPED
} flagStatus_t;

#define MAX_GLOBAL_SERVERS 4096
#define MAX_OTHER_SERVERS 128
#define MAX_PINGREQUESTS 16
Expand Down
5 changes: 3 additions & 2 deletions src/qcommon/vm.c
Expand Up @@ -436,8 +436,9 @@ vm_t *VM_Create(const char *module, intptr_t (*systemCalls)(intptr_t *), vmInter
if (interpret == VMI_NATIVE)
{
// try to load as a system dll
vm->dllHandle = Sys_LoadDll(module, vm->fqpath, &vm->entryPoint, VM_DllSyscall);
// TTimo - never try qvm
vm->dllHandle = Sys_LoadDll(module, &vm->entryPoint, VM_DllSyscall);

// never try qvm
if (vm->dllHandle)
{
return vm;
Expand Down
7 changes: 0 additions & 7 deletions src/renderer/tr_local.h
Expand Up @@ -1424,10 +1424,6 @@ void R_SwapBuffers(int);
void R_RenderView(viewParms_t *parms);

void R_AddMD3Surfaces(trRefEntity_t *e);
void R_AddNullModelSurfaces(trRefEntity_t *e);
void R_AddBeamSurfaces(trRefEntity_t *e);
void R_AddRailSurfaces(trRefEntity_t *e, qboolean isUnderwater);
void R_AddLightningBoltSurfaces(trRefEntity_t *e);

void R_TagInfo_f(void);

Expand Down Expand Up @@ -1554,7 +1550,6 @@ qhandle_t RE_RegisterShaderFromImage(const char *name, int lightmapIndex, image_

shader_t *R_FindShader(const char *name, int lightmapIndex, qboolean mipRawImage);
shader_t *R_GetShaderByHandle(qhandle_t hShader);
shader_t *R_GetShaderByState(int index, long *cycleTime);
shader_t *R_FindShaderByName(const char *name);
void R_InitShaders(void);
void R_ShaderList_f(void);
Expand Down Expand Up @@ -1713,7 +1708,6 @@ SKIES

void R_BuildCloudData(shaderCommands_t *shader);
void R_InitSkyTexCoords(float cloudLayerHeight);
void R_DrawSkyBox(shaderCommands_t *shader);
void RB_DrawSun(void);
void RB_ClipSkyPolygons(shaderCommands_t *shader);

Expand Down Expand Up @@ -1792,7 +1786,6 @@ ANIMATED MODELS
=============================================================
*/

void R_MakeAnimModel(model_t *model);
void R_AddAnimSurfaces(trRefEntity_t *ent);
void RB_SurfaceAnim(mdsSurface_t *surfType);
int R_GetBoneTag(orientation_t *outTag, mdsHeader_t *mds, int startTagIndex, const refEntity_t *refent, const char *tagName);
Expand Down
2 changes: 1 addition & 1 deletion src/sys/sys_local.h
Expand Up @@ -65,7 +65,7 @@ void Sys_AnsiColorPrint(const char *msg);
int Sys_PID(void);
qboolean Sys_PIDIsRunning(int pid);

void *Sys_LoadDll(const char *name, char *fqpath,
void *Sys_LoadDll(const char *name,
intptr_t(**entryPoint) (int, ...),
intptr_t (*systemcalls)(intptr_t, ...));
void Sys_UnloadDll(void *dllHandle);
Expand Down
12 changes: 5 additions & 7 deletions src/sys/sys_main.c
Expand Up @@ -529,11 +529,10 @@ void Sys_UnloadDll(void *dllHandle)
* @brief Used by Sys_LoadDll to get handle on a mod library
* @return Handle to a mod library
*/
static void *Sys_TryLibraryLoad(const char *base, const char *gamedir, const char *fname, char *fqpath)
static void *Sys_TryLibraryLoad(const char *base, const char *gamedir, const char *fname)
{
void *libHandle;
char *fn;
*fqpath = 0;

fn = FS_BuildOSPath(base, gamedir, fname);

Expand All @@ -556,7 +555,6 @@ static void *Sys_TryLibraryLoad(const char *base, const char *gamedir, const cha
return NULL;
}
Com_Printf("succeeded\n");
Q_strncpyz(fqpath, fn, MAX_QPATH) ;

return libHandle;
}
Expand All @@ -567,7 +565,7 @@ static void *Sys_TryLibraryLoad(const char *base, const char *gamedir, const cha
* #2 look in fs_basepath
* #3 try to revert to the default mod library
*/
void *Sys_LoadDll(const char *name, char *fqpath,
void *Sys_LoadDll(const char *name,
intptr_t(**entryPoint) (int, ...),
intptr_t (*systemcalls)(intptr_t, ...))
{
Expand Down Expand Up @@ -596,18 +594,18 @@ void *Sys_LoadDll(const char *name, char *fqpath,
}
#endif

libHandle = Sys_TryLibraryLoad(homepath, gamedir, fname, fqpath);
libHandle = Sys_TryLibraryLoad(homepath, gamedir, fname);

if (!libHandle && basepath)
{
libHandle = Sys_TryLibraryLoad(basepath, gamedir, fname, fqpath);
libHandle = Sys_TryLibraryLoad(basepath, gamedir, fname);
}

// HACK: sometimes a library is loaded from the mod dir when it shouldn't. Why?
if (!libHandle && strcmp(gamedir, DEFAULT_MODGAME))
{
Com_Printf("Sys_LoadDll: failed to load the mod library. Trying to revert to the default one.\n");
libHandle = Sys_TryLibraryLoad(basepath, DEFAULT_MODGAME, fname, fqpath);
libHandle = Sys_TryLibraryLoad(basepath, DEFAULT_MODGAME, fname);
}

if (!libHandle)
Expand Down
1 change: 0 additions & 1 deletion src/ui/ui_shared.h
Expand Up @@ -504,7 +504,6 @@ const char *String_Alloc(const char *p);
void String_Init(void);
void String_Report(void);
void Init_Display(displayContextDef_t *dc);
void Display_ExpandMacros(char *buff);
void Menu_Init(menuDef_t *menu);
void Item_Init(itemDef_t *item);
void Menu_PostParse(menuDef_t *menu);
Expand Down

0 comments on commit cf4f814

Please sign in to comment.