From a95f6f19546b44e387fece18aa1b76a98d3ea920 Mon Sep 17 00:00:00 2001 From: IR4T4 Date: Sun, 14 Oct 2012 21:25:57 +0200 Subject: [PATCH] refs #31 --- src/client/cl_cgame.c | 2 +- src/client/cl_console.c | 28 +++++---------- src/client/cl_input.c | 51 ++------------------------- src/client/client.h | 72 +++++++++++++------------------------- src/client/snd_adpcm.c | 5 --- src/client/snd_codec.h | 1 - src/client/snd_codec_wav.c | 9 ++--- src/client/snd_dma.c | 33 +++-------------- src/client/snd_local.h | 33 ++++++++--------- src/client/snd_main.c | 4 --- src/client/snd_mem.c | 3 +- src/client/snd_mix.c | 7 ---- 12 files changed, 59 insertions(+), 189 deletions(-) diff --git a/src/client/cl_cgame.c b/src/client/cl_cgame.c index 1b9c70731..a54cace7f 100644 --- a/src/client/cl_cgame.c +++ b/src/client/cl_cgame.c @@ -594,7 +594,7 @@ void CL_ShutdownCGame(void) cgvm = NULL; } -static int FloatAsInt(float f) +static int FloatAsInt(float f) { floatint_t fi; fi.f = f; diff --git a/src/client/cl_console.c b/src/client/cl_console.c index 3de46adb0..40b916bd0 100644 --- a/src/client/cl_console.c +++ b/src/client/cl_console.c @@ -34,7 +34,6 @@ #include "client.h" - int g_console_field_width = 78; #define COLNSOLE_COLOR COLOR_WHITE //COLOR_BLACK @@ -53,7 +52,6 @@ cvar_t *con_restricted; vec4_t console_color = { 1.0, 1.0, 1.0, 1.0 }; vec4_t console_highlightcolor = { 0.5, 0.5, 0.2, 0.45 }; - /* ================ Con_ToggleConsole_f @@ -83,7 +81,7 @@ void Con_ToggleConsole_f(void) if (cls.keyCatchers & KEYCATCH_CONSOLE) { cls.keyCatchers &= ~KEYCATCH_CONSOLE; - con.desiredFrac = 0.0; + con.desiredFrac = 0.0f; } else { @@ -148,7 +146,6 @@ void Con_MessageMode3_f(void) cls.keyCatchers ^= KEYCATCH_MESSAGE; } - /* ================ Con_Clear_f @@ -235,7 +232,6 @@ void Con_Dump_f(void) FS_FCloseFile(f); } - /* ================ Con_ClearNotify @@ -251,8 +247,6 @@ void Con_ClearNotify(void) } } - - /* ================ Con_CheckResize @@ -369,7 +363,6 @@ void Con_Init(void) Cmd_SetCommandCompletionFunc("condump", Cmd_CompleteTxtName); } - /* =============== Con_Linefeed @@ -541,7 +534,6 @@ DRAWING ============================================================================== */ - /* ================ Con_DrawInput @@ -583,7 +575,6 @@ void Con_DrawInput(void) SCREEN_WIDTH - 3 * SMALLCHAR_WIDTH, qtrue); } - /* ================ Con_DrawNotify @@ -598,7 +589,7 @@ void Con_DrawNotify(void) int i; int time; int skip; - int currentColor; + int currentColor = 7; currentColor = 7; re.SetColor(g_color_table[currentColor]); @@ -681,7 +672,6 @@ void Con_DrawNotify(void) v += BIGCHAR_HEIGHT; } - } /* @@ -742,13 +732,13 @@ void Con_DrawSolidConsole(float frac) } // ydnar: matching light text - color[0] = 0.75; - color[1] = 0.75; - color[2] = 0.75; + color[0] = 0.75f; + color[1] = 0.75f; + color[2] = 0.75f; color[3] = 1.0f; - if (frac < 1.0) + if (frac < 1) { - SCR_FillRect(0, y, SCREEN_WIDTH, 1.25, color); + SCR_FillRect(0, y, SCREEN_WIDTH, 1.25f, color); } @@ -845,7 +835,7 @@ void Con_DrawConsole(void) { if (!(cls.keyCatchers & (KEYCATCH_UI | KEYCATCH_CGAME))) { - Con_DrawSolidConsole(1.0); + Con_DrawSolidConsole(1.0f); return; } } @@ -907,7 +897,6 @@ void Con_RunConsole(void) } - void Con_PageUp(void) { con.display -= 2; @@ -940,7 +929,6 @@ void Con_Bottom(void) con.display = con.current; } - void Con_Close(void) { if (!com_cl_running->integer) diff --git a/src/client/cl_input.c b/src/client/cl_input.c index 16ec17b9f..c9c283978 100644 --- a/src/client/cl_input.c +++ b/src/client/cl_input.c @@ -80,10 +80,6 @@ void IN_MLookDown(void) void IN_MLookUp(void) { kb[KB_MLOOK].active = qfalse; - if (!cl_freelook->integer) - { -// IN_CenterView (); - } } void IN_KeyDown(kbutton_t *b) @@ -186,8 +182,6 @@ void IN_KeyUp(kbutton_t *b) b->active = qfalse; } - - /* =============== CL_KeyState @@ -237,8 +231,6 @@ float CL_KeyState(kbutton_t *key) return val; } - - void IN_UpDown(void) { IN_KeyDown(&kb[KB_UP]); @@ -396,7 +388,6 @@ void IN_SprintUp(void) IN_KeyUp(&kb[KB_BUTTONS5]); } - // wbuttons (wolf buttons) void IN_Wbutton0Down(void) { @@ -459,19 +450,6 @@ void IN_ButtonUp(void) IN_KeyUp(&kb[KB_BUTTONS1]); } -/* -void IN_CenterView (void) { - cl.viewangles[PITCH] = -SHORT2ANGLE(cl.snap.ps.delta_angles[PITCH]); -} -*/ - -void IN_Notebook(void) -{ - //if ( cls.state == CA_ACTIVE && !clc.demoplaying ) { - //VM_Call( uivm, UI_SET_ACTIVE_MENU, UIMENU_NOTEBOOK); // startup notebook - //} -} - void IN_Help(void) { if (cls.state == CA_ACTIVE && !clc.demoplaying) @@ -480,7 +458,6 @@ void IN_Help(void) } } - //========================================================================== cvar_t *cl_yawspeed; cvar_t *cl_pitchspeed; @@ -537,11 +514,10 @@ void CL_KeyMove(usercmd_t *cmd) int movespeed; int forward, side, up; - // // adjust for speed key / running // the walking flag is to keep animations consistant // even during acceleration and develeration - // + if (kb[KB_SPEED].active ^ cl_run->integer) { movespeed = 127; @@ -642,7 +618,6 @@ void CL_MouseEvent(int dx, int dy, int time) { if (cls.keyCatchers & KEYCATCH_UI) { - // NERVE - SMF - if we just want to pass it along to game if (cl_bypassMouseInput->integer == 1) { @@ -653,7 +628,6 @@ void CL_MouseEvent(int dx, int dy, int time) { VM_Call(uivm, UI_MOUSE_EVENT, dx, dy); } - } else if (cls.keyCatchers & KEYCATCH_CGAME) { @@ -769,22 +743,12 @@ void CL_MouseMove(usercmd_t *cmd) // scale by FOV accelSensitivity *= cl.cgameSensitivity; - /* NERVE - SMF - this has moved to CG_CalcFov to fix zoomed-in/out transition movement bug - if ( cl.snap.ps.stats[STAT_ZOOMED_VIEW] ) { - if(cl.snap.ps.weapon == WP_SNIPERRIFLE) { - accelSensitivity *= 0.1; - } - else if(cl.snap.ps.weapon == WP_SNOOPERSCOPE) { - accelSensitivity *= 0.2; - } - } - */ if (rate && cl_showMouseRate->integer) { Com_Printf("%f : %f\n", rate, accelSensitivity); } -// Ridah, experimenting with a slow tracking gun + // Ridah, experimenting with a slow tracking gun // Rafael - mg42 if (cl.snap.ps.persistant[PERS_HWEAPON_USE]) @@ -823,7 +787,6 @@ void CL_MouseMove(usercmd_t *cmd) } } - /* ============== CL_CmdButtons @@ -833,11 +796,10 @@ void CL_CmdButtons(usercmd_t *cmd) { int i; - // // figure button bits // send a button bit even if the key was pressed and released in // less than a frame - // + for (i = 0 ; i < 7 ; i++) { if (kb[KB_BUTTONS0 + i].active || kb[KB_BUTTONS0 + i].wasPressed) @@ -875,7 +837,6 @@ void CL_CmdButtons(usercmd_t *cmd) } } - /* ============== CL_FinishMove @@ -902,7 +863,6 @@ void CL_FinishMove(usercmd_t *cmd) } } - /* ================= CL_CreateCmd @@ -970,7 +930,6 @@ usercmd_t CL_CreateCmd(void) return cmd; } - /* ================= CL_CreateNewCommands @@ -1198,9 +1157,7 @@ void CL_WritePacket(void) } } - // // deliver the message - // packetNum = clc.netchan.outgoingSequence & PACKET_MASK; cl.outPackets[packetNum].p_realtime = cls.realtime; cl.outPackets[packetNum].p_serverTime = oldcmd->serverTime; @@ -1336,14 +1293,12 @@ void CL_InitInput(void) Cmd_AddCommand("+mlook", IN_MLookDown); Cmd_AddCommand("-mlook", IN_MLookUp); - //Cmd_AddCommand ("notebook",IN_Notebook); Cmd_AddCommand("help", IN_Help); cl_nodelta = Cvar_Get("cl_nodelta", "0", 0); cl_debugMove = Cvar_Get("cl_debugMove", "0", 0); } - /* ============ CL_ClearKeys diff --git a/src/client/client.h b/src/client/client.h index 8949e57c4..67d6dcfd5 100644 --- a/src/client/client.h +++ b/src/client/client.h @@ -190,7 +190,6 @@ demo through a file. ============================================================================= */ - typedef struct { @@ -393,10 +392,8 @@ extern vm_t *cgvm; // interface to cgame dll or vm extern vm_t *uivm; // interface to ui dll or vm extern refexport_t re; // interface to refresh .dll - -// // cvars -// + extern cvar_t *cl_nodelta; extern cvar_t *cl_debugMove; extern cvar_t *cl_noprint; @@ -449,7 +446,6 @@ extern cvar_t *cl_waitForFire; // NERVE - SMF - localization extern cvar_t *cl_language; -// -NERVE - SMF extern cvar_t *cl_profile; extern cvar_t *cl_defaultProfile; @@ -461,9 +457,7 @@ extern qboolean sv_cheats; //================================================= -// // cl_main -// void CL_Init(void); void CL_FlushMemory(void); @@ -510,9 +504,8 @@ void CL_OpenURL(const char *url); // TTimo void CL_Record(const char *name); -// // cl_input -// + typedef struct { int down[2]; // key nums holding it down @@ -556,7 +549,6 @@ typedef enum NUM_BUTTONS } kbuttons_t; - void CL_ClearKeys(void); void CL_InitInput(void); @@ -565,13 +557,10 @@ void CL_ClearState(void); void CL_ReadPackets(void); void CL_WritePacket(void); -//void IN_CenterView (void); -void IN_Notebook(void); void IN_Help(void); //----(SA) salute void IN_Salute(void); -//----(SA) void CL_VerifyCode(void); @@ -579,9 +568,8 @@ float CL_KeyState(kbutton_t *key); int Key_StringToKeynum(char *str); char *Key_KeynumToString(int keynum); -// // cl_parse.c -// + extern int cl_connectedToPureServer; void CL_SystemInfoChanged(void); @@ -589,19 +577,17 @@ void CL_ParseServerMessage(msg_t *msg); //==================================================================== -void CL_UpdateInfoPacket(netadr_t from); // DHM - Nerve +void CL_UpdateInfoPacket(netadr_t from); // DHM - Nerve -void CL_ServerInfoPacket(netadr_t from, msg_t *msg); -void CL_LocalServers_f(void); -void CL_GlobalServers_f(void); +void CL_ServerInfoPacket(netadr_t from, msg_t *msg); +void CL_LocalServers_f(void); +void CL_GlobalServers_f(void); //FIXME: void CL_FavoriteServers_f( void ); -void CL_Ping_f(void); +void CL_Ping_f(void); qboolean CL_UpdateVisiblePings_f(int source); - -// // console -// + #define NUM_CON_TIMES 4 //#define CON_TEXTSIZE 32768 @@ -652,31 +638,27 @@ void Con_Top(void); void Con_Bottom(void); void Con_Close(void); -// // cl_scrn.c -// -void SCR_Init(void); -void SCR_UpdateScreen(void); -void SCR_DebugGraph(float value); +void SCR_Init(void); +void SCR_UpdateScreen(void); -int SCR_GetBigStringWidth(const char *str); // returns in virtual 640x480 coordinates +void SCR_DebugGraph(float value); -void SCR_AdjustFrom640(float *x, float *y, float *w, float *h); -void SCR_FillRect(float x, float y, float width, float height, - const float *color); -void SCR_DrawPic(float x, float y, float width, float height, qhandle_t hShader); -void SCR_DrawNamedPic(float x, float y, float width, float height, const char *picname); +int SCR_GetBigStringWidth(const char *str); // returns in virtual 640x480 coordinates -void SCR_DrawBigString(int x, int y, const char *s, float alpha); // draws a string with embedded color control characters with fade -void SCR_DrawBigStringColor(int x, int y, const char *s, vec4_t color); // ignores embedded color control characters -void SCR_DrawSmallStringExt(int x, int y, const char *string, float *setColor, qboolean forceColor); -void SCR_DrawSmallChar(int x, int y, int ch); +void SCR_AdjustFrom640(float *x, float *y, float *w, float *h); +void SCR_FillRect(float x, float y, float width, float height, + const float *color); +void SCR_DrawPic(float x, float y, float width, float height, qhandle_t hShader); +void SCR_DrawNamedPic(float x, float y, float width, float height, const char *picname); +void SCR_DrawBigString(int x, int y, const char *s, float alpha); // draws a string with embedded color control characters with fade +void SCR_DrawBigStringColor(int x, int y, const char *s, vec4_t color); // ignores embedded color control characters +void SCR_DrawSmallStringExt(int x, int y, const char *string, float *setColor, qboolean forceColor); +void SCR_DrawSmallChar(int x, int y, int ch); -// // cl_cin.c -// void CL_PlayCinematic_f(void); void SCR_DrawCinematic(void); @@ -691,9 +673,8 @@ void CIN_SetLooping(int handle, qboolean loop); void CIN_UploadCinematic(int handle); void CIN_CloseAllVideos(void); -// // cl_cgame.c -// + void CL_InitCGame(void); void CL_ShutdownCGame(void); qboolean CL_GameCommand(void); @@ -704,9 +685,8 @@ void CL_ShaderStateChanged(void); void CL_UpdateLevelHunkUsage(void); void CL_CGameBinaryMessageReceived(const char *buf, int buflen, int serverTime); -// // cl_ui.c -// + void CL_InitUI(void); void CL_ShutdownUI(void); int Key_GetCatcher(void); @@ -714,10 +694,8 @@ void Key_SetCatcher(int catcher); void LAN_LoadCachedServers(void); void LAN_SaveServersToCache(void); - -// // cl_net_chan.c -// + void CL_Netchan_Transmit(netchan_t *chan, msg_t *msg); //int length, const byte *data ); void CL_Netchan_TransmitNextFragment(netchan_t *chan); qboolean CL_Netchan_Process(netchan_t *chan, msg_t *msg); diff --git a/src/client/snd_adpcm.c b/src/client/snd_adpcm.c index e405f6e69..f13f13423 100644 --- a/src/client/snd_adpcm.c +++ b/src/client/snd_adpcm.c @@ -37,7 +37,6 @@ #include "snd_local.h" - /* Intel ADPCM step variation table */ static int indexTable[16] = { @@ -184,7 +183,6 @@ void S_AdpcmEncode(short indata[], char outdata[], int len, struct adpcm_state * state->index = index; } - /* static */ void S_AdpcmDecode(const char indata[], short *outdata, int len, struct adpcm_state *state) { signed char *inp; /* Input buffer pointer */ @@ -287,7 +285,6 @@ void S_AdpcmEncode(short indata[], char outdata[], int len, struct adpcm_state * state->index = index; } - /* ==================== S_AdpcmMemoryNeeded @@ -325,7 +322,6 @@ int S_AdpcmMemoryNeeded(const wavinfo_t *info) return sampleMemory + headerMemory; } - /* ==================== S_AdpcmGetSamples @@ -345,7 +341,6 @@ void S_AdpcmGetSamples(sndBuffer *chunk, short *to) S_AdpcmDecode((char *) out, to, SND_CHUNK_SIZE_BYTE * 2, &state); } - /* ==================== S_AdpcmEncodeSound diff --git a/src/client/snd_codec.h b/src/client/snd_codec.h index f80fa107a..776fa4d69 100644 --- a/src/client/snd_codec.h +++ b/src/client/snd_codec.h @@ -31,7 +31,6 @@ * @file snd_codec.h */ - #ifndef _SND_CODEC_H_ #define _SND_CODEC_H_ diff --git a/src/client/snd_codec_wav.c b/src/client/snd_codec_wav.c index 28ba56fa8..3ffaf75d0 100644 --- a/src/client/snd_codec_wav.c +++ b/src/client/snd_codec_wav.c @@ -228,8 +228,7 @@ void *S_WAV_CodecLoad(const char *filename, snd_info_t *info) FS_FOpenFileRead(filename, &file, qtrue); if (!file) { - Com_Printf(S_COLOR_RED "ERROR: Could not open \"%s\"\n", - filename); + Com_Printf(S_COLOR_RED "ERROR: Could not open \"%s\"\n", filename); return NULL; } @@ -237,8 +236,7 @@ void *S_WAV_CodecLoad(const char *filename, snd_info_t *info) if (!S_ReadRIFFHeader(file, info)) { FS_FCloseFile(file); - Com_Printf(S_COLOR_RED "ERROR: Incorrect/unsupported format in \"%s\"\n", - filename); + Com_Printf(S_COLOR_RED "ERROR: Incorrect/unsupported format in \"%s\"\n", filename); return NULL; } @@ -247,8 +245,7 @@ void *S_WAV_CodecLoad(const char *filename, snd_info_t *info) if (!buffer) { FS_FCloseFile(file); - Com_Printf(S_COLOR_RED "ERROR: Out of memory reading \"%s\"\n", - filename); + Com_Printf(S_COLOR_RED "ERROR: Out of memory reading \"%s\"\n", filename); return NULL; } diff --git a/src/client/snd_dma.c b/src/client/snd_dma.c index d4230b19e..b5e818caf 100644 --- a/src/client/snd_dma.c +++ b/src/client/snd_dma.c @@ -100,12 +100,10 @@ static int numLoopSounds; int s_rawend[MAX_RAW_STREAMS]; portable_samplepair_t s_rawsamples[MAX_RAW_STREAMS][MAX_RAW_SAMPLES]; - // ==================================================================== // User-setable variables // ==================================================================== - void S_Base_SoundInfo(void) { // TODO: do more info here @@ -135,7 +133,6 @@ void S_Base_SoundInfo(void) Com_Printf("----------------------\n"); } - #ifdef USE_VOIP static void S_Base_StartCapture(void) @@ -169,8 +166,6 @@ void S_Base_MasterGain(float val) } #endif - - /* ================= S_Base_SoundList @@ -202,8 +197,6 @@ void S_Base_SoundList(void) S_DisplayFreeMemory(); } - - void S_ChannelFree(channel_t *v) { v->thesfx = NULL; @@ -243,8 +236,6 @@ void S_ChannelSetup(void) Com_DPrintf("Channel memory manager started\n"); } - - // ======================================================================= // Load a sound // ======================================================================= @@ -256,12 +247,10 @@ return a hash value for the sfx name */ static long S_HashSFXName(const char *name) { - int i; - long hash; + int i = 0; + long hash = 0; char letter; - hash = 0; - i = 0; while (name[i] != '\0') { letter = tolower(name[i]); @@ -359,14 +348,12 @@ S_DefaultSound */ void S_DefaultSound(sfx_t *sfx) { - int i; sfx->soundLength = 512; sfx->soundData = SND_malloc(); sfx->soundData->next = NULL; - for (i = 0 ; i < sfx->soundLength ; i++) { sfx->soundData->sndChunk[i] = i; @@ -512,8 +499,8 @@ Used for spatializing s_channels void S_SpatializeOrigin(vec3_t origin, int master_vol, int *left_vol, int *right_vol, float range, int no_attenuation) { vec_t lscale, rscale; - float dist_fullvol; + dist_fullvol = range * 0.064f; if (dma.channels == 1 || no_attenuation) // no attenuation = no spatialization @@ -758,7 +745,6 @@ void S_Base_StartLocalSound(sfxHandle_t sfxHandle, int channelNum, int volume) S_Base_StartSound(NULL, listener_number, channelNum, sfxHandle, volume); } - /* ================= S_ClearSounds @@ -834,7 +820,6 @@ void S_Base_ClearSounds(qboolean clearStreaming, qboolean clearMusic) } } - /* ================== S_ClearSoundBuffer @@ -860,7 +845,6 @@ S_StopAllSounds */ void S_Base_StopAllSounds(void) { - if (!s_soundStarted) { return; @@ -878,6 +862,7 @@ S_ClearLoopingSounds void S_Base_ClearLoopingSounds(void) { int i; + for (i = 0 ; i < numLoopSounds ; i++) { loopSounds[i].active = qfalse; @@ -1043,8 +1028,6 @@ void S_Base_AddRealLoopingSound(const vec3_t origin, const vec3_t velocity, int numLoopSounds++; } - - /* ================== S_AddLoopSounds @@ -1332,7 +1315,6 @@ void S_Base_UpdateEntityPosition(int entnum, const vec3_t origin) VectorCopy(origin, entityPositions[entnum]); } - /* ============ S_Respatialize @@ -1390,7 +1372,6 @@ void S_Base_Respatialize(int entnum, const vec3_t head, vec3_t axis[3], int inwa S_AddLoopSounds(); } - /* ======================== S_ScanChannelStarts @@ -1452,9 +1433,7 @@ void S_Base_Update(void) return; } - // // debugging output - // if (s_show->integer == 2) { total = 0; @@ -1531,7 +1510,6 @@ void S_GetSoundtime(void) } } - void S_Update_(void) { unsigned endtime; @@ -1624,8 +1602,6 @@ void S_Update_(void) lastTime = thisTime; } - - /* =============================================================================== @@ -1825,7 +1801,6 @@ void S_FreeStreamingSound(int stream) ss->queueStreamType = 0; } - /* ============== S_StopStreamingSound diff --git a/src/client/snd_local.h b/src/client/snd_local.h index 58d2d40c5..4a520a291 100644 --- a/src/client/snd_local.h +++ b/src/client/snd_local.h @@ -40,8 +40,8 @@ #define PAINTBUFFER_SIZE 4096 // this is in samples #define SND_CHUNK_SIZE 1024 // samples -#define SND_CHUNK_SIZE_FLOAT (SND_CHUNK_SIZE / 2) // floats -#define SND_CHUNK_SIZE_BYTE (SND_CHUNK_SIZE * 2) // floats +#define SND_CHUNK_SIZE_FLOAT (SND_CHUNK_SIZE / 2) // floats +#define SND_CHUNK_SIZE_BYTE (SND_CHUNK_SIZE * 2) // floats typedef struct { @@ -127,10 +127,6 @@ typedef struct int flags; } channel_t; - -#define WAV_FORMAT_PCM 1 - - typedef struct { int format; @@ -182,7 +178,6 @@ typedef struct #endif } soundInterface_t; - /* ==================================================================== @@ -195,14 +190,14 @@ typedef struct qboolean SNDDMA_Init(void); // gets the current DMA position -int SNDDMA_GetDMAPos(void); +int SNDDMA_GetDMAPos(void); // shutdown the DMA xfer. -void SNDDMA_Shutdown(void); +void SNDDMA_Shutdown(void); -void SNDDMA_BeginPainting(void); +void SNDDMA_BeginPainting(void); -void SNDDMA_Submit(void); +void SNDDMA_Submit(void); //==================================================================== @@ -263,10 +258,10 @@ extern float s_volCurrent; qboolean S_LoadSound(sfx_t *sfx); -void SND_free(sndBuffer *v); +void SND_free(sndBuffer *v); sndBuffer *SND_malloc(void); -void SND_setup(void); -void SND_shutdown(void); +void SND_setup(void); +void SND_shutdown(void); void S_PaintChannels(int endtime); @@ -276,7 +271,7 @@ void S_memoryLoad(sfx_t *sfx); void S_Spatialize(channel_t *ch); // adpcm functions -int S_AdpcmMemoryNeeded(const wavinfo_t *info); +int S_AdpcmMemoryNeeded(const wavinfo_t *info); void S_AdpcmEncodeSound(sfx_t *sfx, short *samples); void S_AdpcmGetSamples(sndBuffer *chunk, short *to); @@ -305,10 +300,10 @@ qboolean S_Base_Init(soundInterface_t *si); typedef enum { SRCPRI_AMBIENT = 0, // Ambient sound effects - SRCPRI_ENTITY, // Entity sound effects - SRCPRI_ONESHOT, // One-shot sounds - SRCPRI_LOCAL, // Local sounds - SRCPRI_STREAM // Streams (music, cutscenes) + SRCPRI_ENTITY, // Entity sound effects + SRCPRI_ONESHOT, // One-shot sounds + SRCPRI_LOCAL, // Local sounds + SRCPRI_STREAM // Streams (music, cutscenes) } alSrcPriority_t; typedef int srcHandle_t; diff --git a/src/client/snd_main.c b/src/client/snd_main.c index 326a3d989..b54e897ec 100644 --- a/src/client/snd_main.c +++ b/src/client/snd_main.c @@ -344,7 +344,6 @@ void S_UpdateEntityPosition(int entityNum, const vec3_t origin) void S_Update(void) { - if (s_muted->integer) { if (!(s_muteWhenMinimized->integer && Cvar_VariableIntegerValue("com_minimized")) && @@ -567,7 +566,6 @@ void S_Music_f(void) Com_Printf("music [loopfile] [fadeupTime]\n"); return; } - } void S_Stream_f(void) @@ -612,7 +610,6 @@ void S_Stream_f(void) Com_Printf("stream [loopfile] [entnum] [channel] [attenuation]\n"); return; } - } void S_StopMusic_f(void) @@ -650,7 +647,6 @@ void S_Init(void) } else { - S_CodecInit(); Cmd_AddCommand("play", S_Play_f); diff --git a/src/client/snd_mem.c b/src/client/snd_mem.c index b210ff3ff..f9e540992 100644 --- a/src/client/snd_mem.c +++ b/src/client/snd_mem.c @@ -54,7 +54,7 @@ short *sfxScratchBuffer = NULL; sfx_t *sfxScratchPointer = NULL; int sfxScratchIndex = 0; -void SND_free(sndBuffer *v) +void SND_free(sndBuffer *v) { *(sndBuffer **)v = freelist; freelist = (sndBuffer *)v; @@ -225,7 +225,6 @@ qboolean S_LoadSound(sfx_t *sfx) byte *data; short *samples; snd_info_t info; -// int size; // player specific sounds are never directly loaded if (sfx->soundName[0] == '*') diff --git a/src/client/snd_mix.c b/src/client/snd_mix.c index 286c6f919..f7609bbaa 100644 --- a/src/client/snd_mix.c +++ b/src/client/snd_mix.c @@ -188,7 +188,6 @@ void S_TransferPaintBuffer(int endtime) pbuf = (unsigned long *)dma.buffer; - if (s_testsound->integer) { int i; @@ -200,7 +199,6 @@ void S_TransferPaintBuffer(int endtime) paintbuffer[i].left = paintbuffer[i].right = sin((s_paintedtime + i) * 0.1) * 20000 * 256; } - if (dma.samplebits == 16 && dma.channels == 2) // optimized case { S_TransferStereo16(pbuf, endtime); @@ -254,7 +252,6 @@ void S_TransferPaintBuffer(int endtime) } } - /* =============================================================================== @@ -504,12 +501,8 @@ static void S_PaintChannelFrom16_scalar(channel_t *ch, const sfx_t *sc, int coun ooff = sampleOffset; samples = chunk->sndChunk; - - - for (i = 0 ; i < count ; i++) { - aoff = ooff; ooff = ooff + ch->dopplerScale; boff = ooff;