diff --git a/src/android/i_sound.c b/src/android/i_sound.c index ecf96f2f..77f8e6a5 100644 --- a/src/android/i_sound.c +++ b/src/android/i_sound.c @@ -21,13 +21,14 @@ void I_ShutdownSound(void){} // SFX I/O // -INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority) +INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel) { (void)id; (void)vol; (void)sep; (void)pitch; (void)priority; + (void)channel; return -1; } diff --git a/src/d_clisrv.c b/src/d_clisrv.c index df8487f2..0c2a92e5 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1568,8 +1568,6 @@ static void CL_LoadReceivedSavegame(void) automapactive = false; // load a base level - playerdeadview = false; - if (P_LoadNetGame()) { const INT32 actnum = mapheaderinfo[gamemap-1]->actnum; diff --git a/src/d_main.c b/src/d_main.c index df339875..f807e307 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -720,7 +720,6 @@ void D_StartTitle(void) maptol = 0; gameaction = ga_nothing; - playerdeadview = false; displayplayer = consoleplayer = 0; //demosequence = -1; gametype = GT_COOP; diff --git a/src/d_main.h b/src/d_main.h index 6dc273b1..d73b19d1 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -34,7 +34,7 @@ void D_SRB2Loop(void) FUNCNORETURN; // D_SRB2Main() // Not a globally visible function, just included for source reference, // calls all startup code, parses command line options. -// If not overrided by user input, calls N_AdvanceDemo. +// If not overrided by user input, calls D_AdvanceDemo. // void D_SRB2Main(void); @@ -51,9 +51,6 @@ const char *D_Home(void); // // BASE LEVEL // -void D_PageTicker(void); -// pagename is lumpname of a 320x200 patch to fill the screen -void D_PageDrawer(const char *pagename); void D_AdvanceDemo(void); void D_StartTitle(void); diff --git a/src/d_net.c b/src/d_net.c index 643c41ac..8de5cf08 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -49,7 +49,9 @@ doomcom_t *doomcom = NULL; /// \brief network packet data, points inside doomcom doomdata_t *netbuffer = NULL; +#ifdef DEBUGFILE FILE *debugfile = NULL; // put some net info in a file during the game +#endif #define MAXREBOUND 8 static doomdata_t reboundstore[MAXREBOUND]; diff --git a/src/d_netcmd.h b/src/d_netcmd.h index d8fae72f..023bbd09 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -212,7 +212,6 @@ void Command_ExitGame_f(void); void Command_Retry_f(void); void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect); -void ObjectPlace_OnChange(void); void ItemFinder_OnChange(void); void D_SetPassword(const char *pw); diff --git a/src/djgppdos/i_sound.c b/src/djgppdos/i_sound.c index 88fc807f..ec6f4412 100644 --- a/src/djgppdos/i_sound.c +++ b/src/djgppdos/i_sound.c @@ -165,9 +165,11 @@ INT32 I_StartSound ( sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, - INT32 priority ) + INT32 priority, + INT32 channel) { int voice; + (void)channel; if (nosound) return 0; diff --git a/src/doomstat.h b/src/doomstat.h index 8072a155..341cc70a 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -445,19 +445,17 @@ extern mapthing_t *redctfstarts[MAXPLAYERS]; // CTF #if defined (macintosh) #define DEBFILE(msg) I_OutputMsg(msg) -extern FILE *debugfile; #else #define DEBUGFILE #ifdef DEBUGFILE #define DEBFILE(msg) { if (debugfile) { fputs(msg, debugfile); fflush(debugfile); } } -extern FILE *debugfile; #else #define DEBFILE(msg) {} -extern FILE *debugfile; #endif #endif #ifdef DEBUGFILE +extern FILE *debugfile; extern INT32 debugload; #endif diff --git a/src/dummy/i_sound.c b/src/dummy/i_sound.c index 51dbb610..143da186 100644 --- a/src/dummy/i_sound.c +++ b/src/dummy/i_sound.c @@ -23,13 +23,14 @@ void I_UpdateSound(void){}; // SFX I/O // -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { (void)id; (void)vol; (void)sep; (void)pitch; (void)priority; + (void)channel; return -1; } diff --git a/src/f_finale.c b/src/f_finale.c index a8b27bb8..fb1387c1 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -442,7 +442,6 @@ void F_StartIntro(void) G_SetGamestate(GS_INTRO); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1130,7 +1129,6 @@ void F_StartCredits(void) } gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1277,7 +1275,6 @@ void F_StartGameEvaluation(void) G_SaveGame((UINT32)cursaveslot); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1388,7 +1385,6 @@ void F_StartGameEnd(void) G_SetGamestate(GS_GAMEEND); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1591,7 +1587,6 @@ void F_StartContinue(void) gameaction = ga_nothing; keypressed = false; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1760,7 +1755,6 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset G_SetGamestate(GS_CUTSCENE); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); diff --git a/src/g_game.c b/src/g_game.c index 4f1c49b4..0e8c14f6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3616,7 +3616,6 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean mapmusflags |= MUSIC_RELOADRESET; ultimatemode = pultmode; - playerdeadview = false; automapactive = false; imcontinuing = false; diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index 17eb8761..a32609fc 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -564,8 +564,6 @@ static inline void HWR_SubsecPoly(INT32 num, poly_t *poly) subsector_t *sub; seg_t *lseg; - sscount++; - sub = &subsectors[num]; count = sub->numlines; lseg = &segs[sub->firstline]; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 871a6a49..ecb70a0f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3264,7 +3264,6 @@ static void HWR_Subsector(size_t num) if (num < numsubsectors) { - sscount++; // subsector sub = &subsectors[num]; // sector diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 7b22f33f..5356ba8a 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -78,9 +78,6 @@ extern boolean chat_on; // set true whenever the tab rankings are being shown for any reason extern boolean hu_showscores; -// P_DeathThink sets this true to show scores while dead, in multiplayer -extern boolean playerdeadview; - // init heads up data at game startup. void HU_Init(void); diff --git a/src/i_sound.h b/src/i_sound.h index 084479ee..098c9be1 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -64,7 +64,7 @@ void I_ShutdownSound(void); \return sfx handle */ -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority); +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel); /** \brief Stops a sound channel. diff --git a/src/m_anigif.c b/src/m_anigif.c index 2540665a..e2af7009 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -492,7 +492,9 @@ static void GIF_framewrite(void) // screen regions are handled in GIF_lzw { - UINT16 delay = 3; // todo + int d1 = (int)((100.0/NEWTICRATE)*(gif_frames+1)); + int d2 = (int)((100.0/NEWTICRATE)*(gif_frames)); + UINT16 delay = d1-d2; INT32 startline; WRITEMEM(p, gifframe_gchead, 4); diff --git a/src/nds/i_sound.c b/src/nds/i_sound.c index 8dea4ad7..a17c7f66 100644 --- a/src/nds/i_sound.c +++ b/src/nds/i_sound.c @@ -21,13 +21,14 @@ void I_ShutdownSound(void){} // SFX I/O // -INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority) +INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel) { (void)id; (void)vol; (void)sep; (void)pitch; (void)priority; + (void)channel; return -1; } diff --git a/src/p_local.h b/src/p_local.h index 1fd7ada0..b82bcf0e 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -68,7 +68,6 @@ // both the head and tail of the thinker list extern thinker_t thinkercap; -extern INT32 runcount; void P_InitThinkers(void); void P_AddThinker(thinker_t *thinker); diff --git a/src/p_user.c b/src/p_user.c index 91b5feb8..11d610a8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8654,8 +8654,6 @@ void P_DoPityCheck(player_t *player) // P_PlayerThink // -boolean playerdeadview; // show match/chaos/tag/capture the flag rankings while in death view - void P_PlayerThink(player_t *player) { ticcmd_t *cmd; @@ -8844,10 +8842,6 @@ void P_PlayerThink(player_t *player) if (player->playerstate == PST_DEAD) { player->mo->flags2 &= ~MF2_SHADOW; - // show the multiplayer rankings while dead - if (player == &players[displayplayer]) - playerdeadview = true; - P_DeathThink(player); return; @@ -8868,9 +8862,6 @@ void P_PlayerThink(player_t *player) player->lives = cv_startinglives.value; } - if (player == &players[displayplayer]) - playerdeadview = false; - if ((gametype == GT_RACE || gametype == GT_COMPETITION) && leveltime < 4*TICRATE) { cmd->buttons &= BT_USE; // Remove all buttons except BT_USE diff --git a/src/r_main.c b/src/r_main.c index f2a0c889..d1cd71b3 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -60,7 +60,6 @@ fixed_t projectiony; // aspect ratio // just for profiling purposes size_t framecount; -size_t sscount; size_t loopcount; fixed_t viewx, viewy, viewz; @@ -492,9 +491,6 @@ static void R_InitTextureMapping(void) // Take out the fencepost cases from viewangletox. for (i = 0; i < FINEANGLES/2; i++) { - t = FixedMul(FINETANGENT(i), focallength); - t = centerx - t; - if (viewangletox[i] == -1) viewangletox[i] = 0; else if (viewangletox[i] == viewwidth+1) @@ -964,8 +960,6 @@ void R_SkyboxFrame(player_t *player) viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); - sscount = 0; - // recalc necessary stuff for mouseaiming // slopes are already calculated for the full possible view (which is 4*viewheight). @@ -1089,8 +1083,6 @@ void R_SetupFrame(player_t *player, boolean skybox) viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); - sscount = 0; - // recalc necessary stuff for mouseaiming // slopes are already calculated for the full possible view (which is 4*viewheight). diff --git a/src/r_state.h b/src/r_state.h index 49d0457b..ac3e1fa4 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -108,7 +108,4 @@ extern angle_t rw_normalangle; // angle to line origin extern angle_t rw_angle1; -// Segs count? -extern size_t sscount; - #endif diff --git a/src/s_sound.c b/src/s_sound.c index 76ee4c64..3b35b36f 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -529,7 +529,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) // Assigns the handle to one of the channels in the // mix/output buffer. - channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); + channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum); } dontplay: @@ -579,7 +579,7 @@ dontplay: // Assigns the handle to one of the channels in the // mix/output buffer. - channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); + channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum); } void S_StartSound(const void *origin, sfxenum_t sfx_id) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index cfdb3230..4b4ad3e6 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -419,10 +419,10 @@ void I_FreeSfx(sfxinfo_t *sfx) sfx->lumpnum = LUMPERROR; } -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 - INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0); + INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0); Mix_Volume(handle, volume); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); (void)pitch; // Mixer can't handle pitch diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index 6c70c163..a7c8383a 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -604,10 +604,11 @@ void I_FreeSfx(sfxinfo_t * sfx) // Pitching (that is, increased speed of playback) // is set, but currently not used by mixing. // -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { (void)priority; (void)pitch; + (void)channel; if (nosound) return 0; diff --git a/src/sdl12/mixer_sound.c b/src/sdl12/mixer_sound.c index 542a6716..daf09ab9 100644 --- a/src/sdl12/mixer_sound.c +++ b/src/sdl12/mixer_sound.c @@ -376,10 +376,10 @@ void I_FreeSfx(sfxinfo_t *sfx) sfx->data = NULL; } -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 - INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0); + INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0); Mix_Volume(handle, volume); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); (void)pitch; // Mixer can't handle pitch diff --git a/src/sdl12/sdl_sound.c b/src/sdl12/sdl_sound.c index 6ba83104..01a27153 100644 --- a/src/sdl12/sdl_sound.c +++ b/src/sdl12/sdl_sound.c @@ -621,10 +621,11 @@ void I_FreeSfx(sfxinfo_t * sfx) // Pitching (that is, increased speed of playback) // is set, but currently not used by mixing. // -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { (void)priority; (void)pitch; + (void)channel; if (nosound) return 0; diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index 58644457..e50a4737 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -353,12 +353,13 @@ void I_FreeSfx(sfxinfo_t *sfx) sfx->data = NULL; } -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { FMOD_SOUND *sound; FMOD_CHANNEL *chan; INT32 i; float frequency; + (void)channel; sound = (FMOD_SOUND *)S_sfx[id].data; I_Assert(sound != NULL); diff --git a/src/win32ce/win_snd.c b/src/win32ce/win_snd.c index f9c65217..14ce4add 100644 --- a/src/win32ce/win_snd.c +++ b/src/win32ce/win_snd.c @@ -538,7 +538,8 @@ INT32 I_StartSound (sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, - INT32 priority) + INT32 priority, + INT32 channel) { HRESULT hr; LPDIRECTSOUNDBUFFER dsbuffer; @@ -549,6 +550,7 @@ INT32 I_StartSound (sfxenum_t id, #ifdef SURROUND LPDIRECTSOUNDBUFFER dssurround; #endif + (void)channel; if (nosound) return -1;