From 08baf2ebb8e3f13bd840a35d630cb0d1f4a9fe53 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 25 Jan 2017 19:36:32 +0000 Subject: [PATCH 01/16] debugfile is only used by DEBUGFILE code, no need to declare/define it for anything else --- src/d_net.c | 2 ++ src/doomstat.h | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/d_net.c b/src/d_net.c index fae1ea311..3e3cdc76d 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/doomstat.h b/src/doomstat.h index f1b7d2169..428ec9340 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -449,19 +449,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 From f4e5233c7e7ec7af0db87a6f747b14d9a8ca0e2c Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 11 Feb 2017 22:41:15 +0000 Subject: [PATCH 02/16] Remove unused sscount variable (it's only set to 0 in software, and only ++'d in OpenGL, what kind of sense does that make?) --- src/hardware/hw_bsp.c | 2 -- src/hardware/hw_main.c | 1 - src/r_main.c | 5 ----- src/r_state.h | 3 --- 4 files changed, 11 deletions(-) diff --git a/src/hardware/hw_bsp.c b/src/hardware/hw_bsp.c index 17eb8761c..a32609fc8 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 7bc12ba75..e15713e27 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3367,7 +3367,6 @@ static void HWR_Subsector(size_t num) if (num < numsubsectors) { - sscount++; // subsector sub = &subsectors[num]; // sector diff --git a/src/r_main.c b/src/r_main.c index 4cff0ff83..4c06dd87e 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; @@ -963,8 +962,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). @@ -1088,8 +1085,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 49d0457b2..ac3e1fa42 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 From a5001a6af99e86f24104cdab98a54c773318a0bf Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 11 Feb 2017 22:56:08 +0000 Subject: [PATCH 03/16] Removed unused function prototypes in d_main.h Also corrected what appears to be a typo in some comments above? --- src/d_main.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/d_main.h b/src/d_main.h index 6dc273b15..d73b19d1f 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); From a51548abea44446fff4df070ec9c879ba85c4f44 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 11 Feb 2017 23:24:12 +0000 Subject: [PATCH 04/16] "t" is not needed to take out fencepost cases from viewangletox --- src/r_main.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/r_main.c b/src/r_main.c index 4c06dd87e..bf916ccb8 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -490,9 +490,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) From 8f1deb912896d9259ecbe02d8adf87c2f8524e1b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 11 Feb 2017 23:28:42 +0000 Subject: [PATCH 05/16] Remove unused "runcount" variable from p_local.h --- src/p_local.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/p_local.h b/src/p_local.h index 9b7c16702..7d5c3c966 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -72,7 +72,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); From a27367cdd475b5689052a8e0d6b4ca8cbc380384 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 15 Feb 2017 21:16:56 +0000 Subject: [PATCH 06/16] Remove unused ObjectPlace_OnChange prototype (from when Objectplace was a consvar, which it is not anymore) --- src/d_netcmd.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 08fc8b831..7eb3f97f9 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -211,7 +211,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); From 6f2f244aeffbafcd516beec9d02e77fe67756e0d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 22 Feb 2017 21:07:29 +0000 Subject: [PATCH 07/16] Remove "playerdeadview" variable; it's not been used for its stated purpose for who knows how long now Besides rankings popping up when you die just sounds weird anyway, maybe I'm just used to SRB2 not doing it I guess --- src/d_clisrv.c | 2 -- src/d_main.c | 1 - src/f_finale.c | 6 ------ src/g_game.c | 1 - src/hu_stuff.h | 3 --- src/p_user.c | 9 --------- 6 files changed, 22 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 574cce7ab..841b7d8c6 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1561,8 +1561,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 63f6bd02c..c534daf4c 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/f_finale.c b/src/f_finale.c index 167fdd880..c78db4df0 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -434,7 +434,6 @@ void F_StartIntro(void) G_SetGamestate(GS_INTRO); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1125,7 +1124,6 @@ void F_StartCredits(void) } gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1272,7 +1270,6 @@ void F_StartGameEvaluation(void) G_SaveGame((UINT32)cursaveslot); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1383,7 +1380,6 @@ void F_StartGameEnd(void) G_SetGamestate(GS_GAMEEND); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1586,7 +1582,6 @@ void F_StartContinue(void) gameaction = ga_nothing; keypressed = false; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1755,7 +1750,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 5e04af496..8865462cd 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3625,7 +3625,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/hu_stuff.h b/src/hu_stuff.h index 7b22f33f1..5356ba8ac 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/p_user.c b/src/p_user.c index 905c3be62..2f7ba7949 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8875,8 +8875,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; @@ -9068,10 +9066,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; @@ -9092,9 +9086,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 From 887e7e0b7d4d36852a6ed92334bf752782510ca8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 14 Apr 2017 17:45:27 +0100 Subject: [PATCH 08/16] Moved most of d_netcmd.h's 2P mouse consvar externs to the files with their 1P counterparts --- src/d_netcmd.h | 5 ----- src/g_game.h | 1 + src/g_input.h | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 08fc8b831..c25623085 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -40,11 +40,6 @@ extern consvar_t cv_usemouse2; #if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) extern consvar_t cv_mouse2opt; #endif -extern consvar_t cv_invertmouse2; -extern consvar_t cv_alwaysfreelook2; -extern consvar_t cv_mousemove2; -extern consvar_t cv_mousesens2; -extern consvar_t cv_mouseysens2; // normally in p_mobj but the .h is not read extern consvar_t cv_itemrespawntime; diff --git a/src/g_game.h b/src/g_game.h index bfde7698a..f6b96c7ac 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -56,6 +56,7 @@ extern INT16 rw_maximums[NUM_WEAPONS]; // used in game menu extern consvar_t cv_crosshair, cv_crosshair2; extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; +extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2; extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_fireaxis,cv_firenaxis; extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_fireaxis2,cv_firenaxis2; extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest; diff --git a/src/g_input.h b/src/g_input.h index d65339321..2f86e5928 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -126,6 +126,7 @@ typedef enum // mouse values are used once extern consvar_t cv_mousesens, cv_mouseysens; +extern consvar_t cv_mousesens2, cv_mouseysens2; extern INT32 mousex, mousey; extern INT32 mlooky; //mousey with mlookSensitivity From 46c3c42eba69727592f7f632ca2a160974898dae Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 14 Apr 2017 18:02:35 +0100 Subject: [PATCH 09/16] cv_controlperkey probably belongs in g_input.h too --- src/d_netcmd.h | 1 - src/g_input.h | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index c25623085..3f9ff4b22 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -32,7 +32,6 @@ extern consvar_t cv_joyport2; #endif extern consvar_t cv_joyscale; extern consvar_t cv_joyscale2; -extern consvar_t cv_controlperkey; // splitscreen with second mouse extern consvar_t cv_mouse2port; diff --git a/src/g_input.h b/src/g_input.h index 2f86e5928..f42ad89d8 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -127,6 +127,7 @@ typedef enum // mouse values are used once extern consvar_t cv_mousesens, cv_mouseysens; extern consvar_t cv_mousesens2, cv_mouseysens2; +extern consvar_t cv_controlperkey; extern INT32 mousex, mousey; extern INT32 mlooky; //mousey with mlookSensitivity From 488c4071ba8a3067f72855b92951288b45e00e68 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 14 Apr 2017 18:14:15 +0100 Subject: [PATCH 10/16] Moved screenshot/movie consvar externs to m_misc.h --- src/d_netcmd.h | 12 +----------- src/m_misc.h | 7 +++++++ 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 3f9ff4b22..e1f56f284 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -114,17 +114,7 @@ extern consvar_t cv_maxping; extern consvar_t cv_skipmapcheck; -extern consvar_t cv_sleep, cv_screenshot_option, cv_screenshot_folder; - -extern consvar_t cv_moviemode; - -extern consvar_t cv_zlib_level, cv_zlib_memory, cv_zlib_strategy; - -extern consvar_t cv_zlib_window_bits, cv_zlib_levela, cv_zlib_memorya; - -extern consvar_t cv_zlib_strategya, cv_zlib_window_bitsa; - -extern consvar_t cv_apng_delay; +extern consvar_t cv_sleep; typedef enum { diff --git a/src/m_misc.h b/src/m_misc.h index dc540dc16..5bd7401e1 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -19,6 +19,7 @@ #include "tables.h" #include "d_event.h" // Screenshot responder +#include "command.h" typedef enum { MM_OFF = 0, @@ -28,6 +29,12 @@ typedef enum { } moviemode_t; extern moviemode_t moviemode; +extern consvar_t cv_screenshot_option, cv_screenshot_folder; +extern consvar_t cv_moviemode; +extern consvar_t cv_zlib_memory, cv_zlib_level, cv_zlib_strategy, cv_zlib_window_bits; +extern consvar_t cv_zlib_memorya, cv_zlib_levela, cv_zlib_strategya, cv_zlib_window_bitsa; +extern consvar_t cv_apng_delay; + void M_StartMovie(void); void M_SaveFrame(void); void M_StopMovie(void); From 0921244ba44600a15e353b635691b4d60d620ff1 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 14 Apr 2017 19:00:46 +0100 Subject: [PATCH 11/16] Move analog consvars to g_game.h --- src/d_netcmd.h | 3 --- src/g_game.h | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index e1f56f284..4b7b86841 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -71,9 +71,6 @@ extern consvar_t cv_autobalance; extern consvar_t cv_teamscramble; extern consvar_t cv_scrambleonchange; -extern consvar_t cv_useranalog, cv_useranalog2; -extern consvar_t cv_analog, cv_analog2; - extern consvar_t cv_netstat; #ifdef WALLSPLATS extern consvar_t cv_splats; diff --git a/src/g_game.h b/src/g_game.h index f6b96c7ac..2cb527ba2 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -57,6 +57,8 @@ extern INT16 rw_maximums[NUM_WEAPONS]; extern consvar_t cv_crosshair, cv_crosshair2; extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; extern consvar_t cv_invertmouse2, cv_alwaysfreelook2, cv_mousemove2; +extern consvar_t cv_useranalog, cv_useranalog2; +extern consvar_t cv_analog, cv_analog2; extern consvar_t cv_sideaxis,cv_turnaxis,cv_moveaxis,cv_lookaxis,cv_fireaxis,cv_firenaxis; extern consvar_t cv_sideaxis2,cv_turnaxis2,cv_moveaxis2,cv_lookaxis2,cv_fireaxis2,cv_firenaxis2; extern consvar_t cv_ghost_bestscore, cv_ghost_besttime, cv_ghost_bestrings, cv_ghost_last, cv_ghost_guest; From 181c8bd7423a4f27fe582ba520b8c711cb35dbcb Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 14 Apr 2017 19:56:51 +0100 Subject: [PATCH 12/16] These convar externs aren't moving files, I'm just shifting them up to live with their relatives --- src/d_netcmd.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 4b7b86841..6fc4c66d2 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -20,6 +20,12 @@ // console vars extern consvar_t cv_playername; extern consvar_t cv_playercolor; +extern consvar_t cv_skin; +// secondary splitscreen player +extern consvar_t cv_playername2; +extern consvar_t cv_playercolor2; +extern consvar_t cv_skin2; + #ifdef SEENAMES extern consvar_t cv_seenames, cv_allowseenames; #endif @@ -47,13 +53,6 @@ extern consvar_t cv_itemrespawn; extern consvar_t cv_flagtime; extern consvar_t cv_suddendeath; -extern consvar_t cv_skin; - -// secondary splitscreen player -extern consvar_t cv_playername2; -extern consvar_t cv_playercolor2; -extern consvar_t cv_skin2; - extern consvar_t cv_touchtag; extern consvar_t cv_hidetime; From 7629a0710e8e09736913d6a11c1cf6609839720d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 15 Apr 2017 20:21:54 +0100 Subject: [PATCH 13/16] Make sure quakes are scaled for skyboxes While I was at it I also refactored most of the skybox view scaling code so it isn't needlessly duplicated --- src/r_main.c | 194 +++++++++++++++------------------------------------ 1 file changed, 58 insertions(+), 136 deletions(-) diff --git a/src/r_main.c b/src/r_main.c index f970762f4..d84a5d295 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -806,153 +806,75 @@ void R_SkyboxFrame(player_t *player) if (viewmobj->spawnpoint) viewz = ((fixed_t)viewmobj->spawnpoint->angle)<awayviewtics) - { - if (skyboxmo[1]) - { - fixed_t x = 0, y = 0; - if (mh->skybox_scalex > 0) - x = (player->awayviewmobj->x - skyboxmo[1]->x) / mh->skybox_scalex; - else if (mh->skybox_scalex < 0) - x = (player->awayviewmobj->x - skyboxmo[1]->x) * -mh->skybox_scalex; + vector3_t campos = {0,0,0}; // Position of player's actual view point - if (mh->skybox_scaley > 0) - y = (player->awayviewmobj->y - skyboxmo[1]->y) / mh->skybox_scaley; - else if (mh->skybox_scaley < 0) - y = (player->awayviewmobj->y - skyboxmo[1]->y) * -mh->skybox_scaley; - - if (viewmobj->angle == 0) - { - viewx += x; - viewy += y; - } - else if (viewmobj->angle == ANGLE_90) - { - viewx -= y; - viewy += x; - } - else if (viewmobj->angle == ANGLE_180) - { - viewx -= x; - viewy -= y; - } - else if (viewmobj->angle == ANGLE_270) - { - viewx += y; - viewy -= x; - } - else - { - angle_t ang = viewmobj->angle>>ANGLETOFINESHIFT; - viewx += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang)); - viewy += FixedMul(x, FINESINE(ang)) + FixedMul(y,FINECOSINE(ang)); - } - } - if (mh->skybox_scalez > 0) - viewz += (player->awayviewmobj->z + 20*FRACUNIT) / mh->skybox_scalez; - else if (mh->skybox_scalez < 0) - viewz += (player->awayviewmobj->z + 20*FRACUNIT) * -mh->skybox_scalez; + if (player->awayviewtics) { + campos.x = player->awayviewmobj->x; + campos.y = player->awayviewmobj->y; + campos.z = player->awayviewmobj->z + 20*FRACUNIT; + } else if (thiscam->chase) { + campos.x = thiscam->x; + campos.y = thiscam->y; + campos.z = thiscam->z + (thiscam->height>>1); + } else { + campos.x = player->mo->x; + campos.y = player->mo->y; + campos.z = player->viewz; } - else if (thiscam->chase) + + // Earthquake effects should be scaled in the skybox + // (if an axis isn't used, the skybox won't shake in that direction) + campos.x += quake.x; + campos.y += quake.y; + campos.z += quake.z; + + if (skyboxmo[1]) // Is there a viewpoint? { - if (skyboxmo[1]) + fixed_t x = 0, y = 0; + if (mh->skybox_scalex > 0) + x = (campos.x - skyboxmo[1]->x) / mh->skybox_scalex; + else if (mh->skybox_scalex < 0) + x = (campos.x - skyboxmo[1]->x) * -mh->skybox_scalex; + + if (mh->skybox_scaley > 0) + y = (campos.y - skyboxmo[1]->y) / mh->skybox_scaley; + else if (mh->skybox_scaley < 0) + y = (campos.y - skyboxmo[1]->y) * -mh->skybox_scaley; + + if (viewmobj->angle == 0) { - fixed_t x = 0, y = 0; - if (mh->skybox_scalex > 0) - x = (thiscam->x - skyboxmo[1]->x) / mh->skybox_scalex; - else if (mh->skybox_scalex < 0) - x = (thiscam->x - skyboxmo[1]->x) * -mh->skybox_scalex; - - if (mh->skybox_scaley > 0) - y = (thiscam->y - skyboxmo[1]->y) / mh->skybox_scaley; - else if (mh->skybox_scaley < 0) - y = (thiscam->y - skyboxmo[1]->y) * -mh->skybox_scaley; - - if (viewmobj->angle == 0) - { - viewx += x; - viewy += y; - } - else if (viewmobj->angle == ANGLE_90) - { - viewx -= y; - viewy += x; - } - else if (viewmobj->angle == ANGLE_180) - { - viewx -= x; - viewy -= y; - } - else if (viewmobj->angle == ANGLE_270) - { - viewx += y; - viewy -= x; - } - else - { - angle_t ang = viewmobj->angle>>ANGLETOFINESHIFT; - viewx += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang)); - viewy += FixedMul(x, FINESINE(ang)) + FixedMul(y,FINECOSINE(ang)); - } + viewx += x; + viewy += y; } - if (mh->skybox_scalez > 0) - viewz += (thiscam->z + (thiscam->height>>1)) / mh->skybox_scalez; - else if (mh->skybox_scalez < 0) - viewz += (thiscam->z + (thiscam->height>>1)) * -mh->skybox_scalez; - } - else - { - if (skyboxmo[1]) + else if (viewmobj->angle == ANGLE_90) { - fixed_t x = 0, y = 0; - if (mh->skybox_scalex > 0) - x = (player->mo->x - skyboxmo[1]->x) / mh->skybox_scalex; - else if (mh->skybox_scalex < 0) - x = (player->mo->x - skyboxmo[1]->x) * -mh->skybox_scalex; - if (mh->skybox_scaley > 0) - y = (player->mo->y - skyboxmo[1]->y) / mh->skybox_scaley; - else if (mh->skybox_scaley < 0) - y = (player->mo->y - skyboxmo[1]->y) * -mh->skybox_scaley; - - if (viewmobj->angle == 0) - { - viewx += x; - viewy += y; - } - else if (viewmobj->angle == ANGLE_90) - { - viewx -= y; - viewy += x; - } - else if (viewmobj->angle == ANGLE_180) - { - viewx -= x; - viewy -= y; - } - else if (viewmobj->angle == ANGLE_270) - { - viewx += y; - viewy -= x; - } - else - { - angle_t ang = viewmobj->angle>>ANGLETOFINESHIFT; - viewx += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang)); - viewy += FixedMul(x, FINESINE(ang)) + FixedMul(y,FINECOSINE(ang)); - } + viewx -= y; + viewy += x; + } + else if (viewmobj->angle == ANGLE_180) + { + viewx -= x; + viewy -= y; + } + else if (viewmobj->angle == ANGLE_270) + { + viewx += y; + viewy -= x; + } + else + { + angle_t ang = viewmobj->angle>>ANGLETOFINESHIFT; + viewx += FixedMul(x,FINECOSINE(ang)) - FixedMul(y, FINESINE(ang)); + viewy += FixedMul(x, FINESINE(ang)) + FixedMul(y,FINECOSINE(ang)); } - if (mh->skybox_scalez > 0) - viewz += player->viewz / mh->skybox_scalez; - else if (mh->skybox_scalez < 0) - viewz += player->viewz * -mh->skybox_scalez; } + if (mh->skybox_scalez > 0) + viewz += campos.z / mh->skybox_scalez; + else if (mh->skybox_scalez < 0) + viewz += campos.z * -mh->skybox_scalez; } if (viewmobj->subsector) From 0e358b3d9fdbb2426abce44078f6ee99792d39cc Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 18 Apr 2017 17:36:04 +0100 Subject: [PATCH 14/16] Add new Pity shield orb state info, remove unused Pity states --- src/dehacked.c | 4 ---- src/info.c | 16 ++++++---------- src/info.h | 4 ---- 3 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 32b1c1ca3..8eb248baa 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5530,10 +5530,6 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PITY4", "S_PITY5", "S_PITY6", - "S_PITY7", - "S_PITY8", - "S_PITY9", - "S_PITY10", "S_FIRS1", "S_FIRS2", diff --git a/src/info.c b/src/info.c index 7d6e1fede..1d807ac1a 100644 --- a/src/info.c +++ b/src/info.c @@ -2122,16 +2122,12 @@ state_t states[NUMSTATES] = {SPR_ELEM, FF_FULLBRIGHT|20, 1, {NULL}, 0, 0, S_ELEMF10}, // S_ELEMF9 {SPR_NULL, 0, 1, {NULL}, 0, 0, S_ELEMF1 }, // S_ELEMF10 - {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY2 }, // S_PITY1 - {SPR_PITY, FF_TRANS20|1, 1, {NULL}, 0, 0, S_PITY3 }, // S_PITY2 - {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY4 }, // S_PITY3 - {SPR_PITY, FF_TRANS20|2, 1, {NULL}, 0, 0, S_PITY5 }, // S_PITY4 - {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY6 }, // S_PITY5 - {SPR_PITY, FF_TRANS20|3, 1, {NULL}, 0, 0, S_PITY7 }, // S_PITY6 - {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY8 }, // S_PITY7 - {SPR_PITY, FF_TRANS20|4, 1, {NULL}, 0, 0, S_PITY9 }, // S_PITY8 - {SPR_PITY, FF_TRANS20 , 1, {NULL}, 0, 0, S_PITY10}, // S_PITY9 - {SPR_PITY, FF_TRANS20|5, 1, {NULL}, 0, 0, S_PITY1 }, // S_PITY10 + {SPR_PITY, FF_TRANS30 , 2, {NULL}, 0, 0, S_PITY2}, // S_PITY1 + {SPR_PITY, FF_TRANS30|1, 2, {NULL}, 0, 0, S_PITY3}, // S_PITY2 + {SPR_PITY, FF_TRANS30|2, 2, {NULL}, 0, 0, S_PITY4}, // S_PITY3 + {SPR_PITY, FF_TRANS20|3, 2, {NULL}, 0, 0, S_PITY5}, // S_PITY4 + {SPR_PITY, FF_TRANS30|4, 2, {NULL}, 0, 0, S_PITY6}, // S_PITY5 + {SPR_PITY, FF_TRANS20|5, 2, {NULL}, 0, 0, S_PITY1}, // S_PITY6 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40 , 2, {NULL}, 0, 0, S_FIRS2}, // S_FIRS1 {SPR_FIRS, FF_FULLBRIGHT|FF_TRANS40|1, 2, {NULL}, 0, 0, S_FIRS3}, // S_FIRS2 diff --git a/src/info.h b/src/info.h index 4b21e98ec..33bfcf19e 100644 --- a/src/info.h +++ b/src/info.h @@ -2325,10 +2325,6 @@ typedef enum state S_PITY4, S_PITY5, S_PITY6, - S_PITY7, - S_PITY8, - S_PITY9, - S_PITY10, S_FIRS1, S_FIRS2, From 941ab722045ab0115f5e96ca85cabe683eb05c34 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 18 Apr 2017 18:32:52 +0100 Subject: [PATCH 15/16] Hardcode new/updated xmas scenery object type/state info --- src/dehacked.c | 18 ++++- src/info.c | 179 +++++++++++++++++++++++++++++++++++++++++++++++-- src/info.h | 26 +++++-- src/p_mobj.c | 4 ++ 4 files changed, 216 insertions(+), 11 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8eb248baa..b6f7db571 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5338,7 +5338,14 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // Xmas-specific stuff "S_XMASPOLE", "S_CANDYCANE", - "S_SNOWMAN", + "S_SNOWMAN", // normal + "S_SNOWMANHAT", // with hat + scarf + "S_LAMPPOST1", // normal + "S_LAMPPOST2", // with snow + "S_HANGSTAR", + // Xmas GFZ bushes + "S_XMASBERRYBUSH", + "S_XMASBUSH", // Botanic Serenity's loads of scenery states "S_BSZTALLFLOWER_RED", @@ -6616,7 +6623,14 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s // Christmas Scenery "MT_XMASPOLE", "MT_CANDYCANE", - "MT_SNOWMAN", + "MT_SNOWMAN", // normal + "MT_SNOWMANHAT", // with hat + scarf + "MT_LAMPPOST1", // normal + "MT_LAMPPOST2", // with snow + "MT_HANGSTAR", + // Xmas GFZ bushes + "MT_XMASBERRYBUSH", + "MT_XMASBUSH", // Botanic Serenity "MT_BSZTALLFLOWER_RED", diff --git a/src/info.c b/src/info.c index 1d807ac1a..cb0cde996 100644 --- a/src/info.c +++ b/src/info.c @@ -219,9 +219,11 @@ char sprnames[NUMSPRITES + 1][5] = // Egg Rock Scenery // Christmas Scenery - "XMS1", - "XMS2", - "XMS3", + "XMS1", // Christmas Pole + "XMS2", // Candy Cane + "XMS3", // Snowman + "XMS4", // Lamppost + "XMS5", // Hanging Star // Botanic Serenity Scenery "BSZ1", // Tall flowers @@ -1933,6 +1935,13 @@ state_t states[NUMSTATES] = {SPR_XMS1, 0, -1, {NULL}, 0, 0, S_NULL}, // S_XMASPOLE {SPR_XMS2, 0, -1, {NULL}, 0, 0, S_NULL}, // S_CANDYCANE {SPR_XMS3, 0, -1, {NULL}, 0, 0, S_NULL}, // S_SNOWMAN + {SPR_XMS3, 1, -1, {NULL}, 0, 0, S_NULL}, // S_SNOWMANHAT + {SPR_XMS4, 0, -1, {NULL}, 0, 0, S_NULL}, // S_LAMPPOST1 + {SPR_XMS4, 1, -1, {NULL}, 0, 0, S_NULL}, // S_LAMPPOST2 + {SPR_XMS5, 0, -1, {NULL}, 0, 0, S_NULL}, // S_HANGSTAR + // Xmas GFZ bushes + {SPR_BUS1, 1, -1, {NULL}, 0, 0, S_NULL}, // S_BERRYBUSH + {SPR_BUS2, 1, -1, {NULL}, 0, 0, S_NULL}, // S_BUSH // Loads of Botanic Serenity bullshit {SPR_BSZ1, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BSZTALLFLOWER_RED @@ -9511,7 +9520,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_None, // deathsound 25*FRACUNIT, // speed 16*FRACUNIT, // radius - 40*FRACUNIT, // height + 64*FRACUNIT, // height 0, // display offset 100, // mass 1, // damage @@ -9520,6 +9529,168 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_SNOWMANHAT + 1853, // doomednum + S_SNOWMANHAT, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 25*FRACUNIT, // speed + 16*FRACUNIT, // radius + 80*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_SLIDEME|MF_SOLID|MF_PUSHABLE, // flags + S_NULL // raisestate + }, + + { // MT_LAMPPOST1 + 1854, // doomednum + S_LAMPPOST1, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 8*FRACUNIT, // radius + 120*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_SOLID, // flags + S_NULL // raisestate + }, + + { // MT_LAMPPOST2 + 1855, // doomednum + S_LAMPPOST2, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 8*FRACUNIT, // radius + 120*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_SOLID, // flags + S_NULL // raisestate + }, + + { // MT_HANGSTAR + 1856, // doomednum + S_HANGSTAR, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 4*FRACUNIT, // radius + 80*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_SPAWNCEILING|MF_NOGRAVITY|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_XMASBERRYBUSH + 1857, // doomednum + S_XMASBERRYBUSH, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags + S_NULL // raisestate + }, + + { // MT_XMASBUSH + 1858, // doomednum + S_XMASBUSH, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + 0, // damage + sfx_None, // activesound + MF_NOTHINK|MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY, // flags + S_NULL // raisestate + }, + // No, I did not do all of this by hand. // I made a script to make all of these for me. // Ha HA. ~Inuyasha diff --git a/src/info.h b/src/info.h index 33bfcf19e..a123ba81c 100644 --- a/src/info.h +++ b/src/info.h @@ -425,9 +425,11 @@ typedef enum sprite // Egg Rock Scenery // Christmas Scenery - SPR_XMS1, - SPR_XMS2, - SPR_XMS3, + SPR_XMS1, // Christmas Pole + SPR_XMS2, // Candy Cane + SPR_XMS3, // Snowman + SPR_XMS4, // Lamppost + SPR_XMS5, // Hanging Star // Botanic Serenity Scenery SPR_BSZ1, // Tall flowers @@ -2133,7 +2135,14 @@ typedef enum state // Xmas-specific stuff S_XMASPOLE, S_CANDYCANE, - S_SNOWMAN, + S_SNOWMAN, // normal + S_SNOWMANHAT, // with hat + scarf + S_LAMPPOST1, // normal + S_LAMPPOST2, // with snow + S_HANGSTAR, + // Xmas GFZ bushes + S_XMASBERRYBUSH, + S_XMASBUSH, // Botanic Serenity's loads of scenery states S_BSZTALLFLOWER_RED, @@ -3430,7 +3439,14 @@ typedef enum mobj_type // Christmas Scenery MT_XMASPOLE, MT_CANDYCANE, - MT_SNOWMAN, + MT_SNOWMAN, // normal + MT_SNOWMANHAT, // with hat + scarf + MT_LAMPPOST1, // normal + MT_LAMPPOST2, // with snow + MT_HANGSTAR, + // Xmas GFZ bushes + MT_XMASBERRYBUSH, + MT_XMASBUSH, // Botanic Serenity scenery MT_BSZTALLFLOWER_RED, diff --git a/src/p_mobj.c b/src/p_mobj.c index 520f9ad07..b7cb83881 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8434,6 +8434,10 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) case MT_SPIKE: mobj->flags2 |= MF2_STANDONME; break; + case MT_LAMPPOST1: + case MT_LAMPPOST2: + mobj->flags2 |= MF2_STANDONME; + break; case MT_DETON: mobj->movedir = 0; break; From 0f2c9c40a2faa6c050c0255d52d7ca1bae228641 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 18 Apr 2017 20:38:13 +0100 Subject: [PATCH 16/16] Hardcoded the big gargoyle --- src/dehacked.c | 2 ++ src/info.c | 28 ++++++++++++++++++++++++++++ src/info.h | 2 ++ 3 files changed, 32 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index b6f7db571..82ce0a4b4 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5180,6 +5180,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit // Deep Sea Gargoyle "S_GARGOYLE", + "S_BIGGARGOYLE", // DSZ Seaweed "S_SEAWEED1", @@ -6555,6 +6556,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s // Deep Sea Scenery "MT_GARGOYLE", // Deep Sea Gargoyle + "MT_BIGGARGOYLE", // Deep Sea Gargoyle (Big) "MT_SEAWEED", // DSZ Seaweed "MT_WATERDRIP", // Dripping Water source "MT_WATERDROP", // Water drop from dripping water diff --git a/src/info.c b/src/info.c index cb0cde996..2d3161a3c 100644 --- a/src/info.c +++ b/src/info.c @@ -1769,6 +1769,7 @@ state_t states[NUMSTATES] = // Deep Sea Gargoyle {SPR_GARG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_GARGOYLE + {SPR_GARG, 1, -1, {NULL}, 0, 0, S_NULL}, // S_BIGGARGOYLE // DSZ Seaweed {SPR_SEWE, 0, -1, {NULL}, 0, 0, S_SEAWEED2}, // S_SEAWEED1 @@ -8152,6 +8153,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_BIGGARGOYLE + 1009, // doomednum + S_BIGGARGOYLE, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 12*FRACUNIT, // speed + 32*FRACUNIT, // radius + 80*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_statu2, // activesound + MF_SLIDEME|MF_SOLID|MF_PUSHABLE, // flags + S_NULL // raisestate + }, + { // MT_SEAWEED 1001, // doomednum S_SEAWEED1, // spawnstate diff --git a/src/info.h b/src/info.h index a123ba81c..75484081e 100644 --- a/src/info.h +++ b/src/info.h @@ -1977,6 +1977,7 @@ typedef enum state // Deep Sea Gargoyle S_GARGOYLE, + S_BIGGARGOYLE, // DSZ Seaweed S_SEAWEED1, @@ -3371,6 +3372,7 @@ typedef enum mobj_type // Deep Sea Scenery MT_GARGOYLE, // Deep Sea Gargoyle + MT_BIGGARGOYLE, // Deep Sea Gargoyle (Big) MT_SEAWEED, // DSZ Seaweed MT_WATERDRIP, // Dripping Water source MT_WATERDROP, // Water drop from dripping water