From c699807532e4ba34819da5c6c7d4a050e5846973 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 19 Sep 2019 20:29:51 -0700 Subject: [PATCH 01/18] Also apply HUD translucency to FREE PLAY --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 10d772ba0..bf938232f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -8634,7 +8634,7 @@ void K_drawKartFreePlay(UINT32 flashtime) return; V_DrawKartString((BASEVIDWIDTH - (LAPS_X+1)) - (12*9), // mirror the laps thingy - LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY"); + LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, "FREE PLAY"); } static void K_drawDistributionDebugger(void) From c646d4d8d095954fb50c8b88be9094e79732dd94 Mon Sep 17 00:00:00 2001 From: Sryder Date: Thu, 14 May 2020 13:16:49 +0100 Subject: [PATCH 02/18] Remove now unsupported distros from deployer Add new supported distros to deployer --- .travis.yml | 106 ++++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4959e4d2d..f2693236b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -451,7 +451,31 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: xenial + dist: focal + if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") + AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) + AND env(DPL_TERMINATE_MAIN) != "1" + env: + - _DPL_JOB_ENABLED=1 + - _DPL_JOB_NAME=focal + - _DPL_DPUT_TARGET=1 + - _DPL_PACKAGE_SOURCE=1 + - PACKAGE_DISTRO=focal + - PACKAGE_SUBVERSION=~20.04focal + #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 + - os: linux + addons: + apt: + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - libcurl4-openssl-dev + - p7zip-full + - gcc-4.8 + compiler: gcc-4.8 + dist: bionic if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" @@ -463,6 +487,30 @@ matrix: - PACKAGE_DISTRO=bionic - PACKAGE_SUBVERSION=~18.04bionic #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 + - os: linux + addons: + apt: + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - libcurl4-openssl-dev + - p7zip-full + - gcc-4.8 + compiler: gcc-4.8 + dist: xenial + if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") + AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) + AND env(DPL_TERMINATE_MAIN) != "1" + env: + - _DPL_JOB_ENABLED=1 + - _DPL_JOB_NAME=xenial + - _DPL_DPUT_TARGET=1 + - _DPL_PACKAGE_SOURCE=1 + - PACKAGE_DISTRO=xenial + - PACKAGE_SUBVERSION=~16.04xenial + #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - os: linux addons: apt: @@ -499,65 +547,17 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: xenial + dist: bionic if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" env: - _DPL_JOB_ENABLED=1 - - _DPL_JOB_NAME=disco + - _DPL_JOB_NAME=eoan - _DPL_DPUT_TARGET=1 - _DPL_PACKAGE_SOURCE=1 - - PACKAGE_DISTRO=disco - - PACKAGE_SUBVERSION=~19.04disco - #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - - os: linux - addons: - apt: - packages: - - libsdl2-mixer-dev - - libpng-dev - - libgl1-mesa-dev - - libgme-dev - - libcurl4-openssl-dev - - p7zip-full - - gcc-4.8 - compiler: gcc-4.8 - dist: xenial - if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") - AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) - AND env(DPL_TERMINATE_MAIN) != "1" - env: - - _DPL_JOB_ENABLED=1 - - _DPL_JOB_NAME=cosmic - - _DPL_DPUT_TARGET=1 - - _DPL_PACKAGE_SOURCE=1 - - PACKAGE_DISTRO=cosmic - - PACKAGE_SUBVERSION=~18.10cosmic - #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - - os: linux - addons: - apt: - packages: - - libsdl2-mixer-dev - - libpng-dev - - libgl1-mesa-dev - - libgme-dev - - libcurl4-openssl-dev - - p7zip-full - - gcc-4.8 - compiler: gcc-4.8 - dist: xenial - if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") - AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) - AND env(DPL_TERMINATE_MAIN) != "1" - env: - - _DPL_JOB_ENABLED=1 - - _DPL_JOB_NAME=xenial - - _DPL_DPUT_TARGET=1 - - _DPL_PACKAGE_SOURCE=1 - - PACKAGE_DISTRO=xenial - - PACKAGE_SUBVERSION=~16.04xenial + - PACKAGE_DISTRO=eoan + - PACKAGE_SUBVERSION=~19.10eoan #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 allow_failures: - compiler: clang-3.5 From 389e7d415df7e77af59f0858d4eb5d93b8fd67e8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:37:15 +0100 Subject: [PATCH 03/18] make savegamename in doomdef.h an extern, put the actual definition in d_main.c (cherry picked from commit 89cd756cd83e4a03a34d1f16da18142d8167d889) --- src/d_main.c | 2 ++ src/doomdef.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index 15116b530..5acfb610a 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -143,6 +143,8 @@ boolean advancedemo; INT32 debugload = 0; #endif +char savegamename[256]; + #ifdef _arch_dreamcast char srb2home[256] = "/cd"; char srb2path[256] = "/cd"; diff --git a/src/doomdef.h b/src/doomdef.h index ed41e346e..392ba7605 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -506,7 +506,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG; // Things that used to be in dstrings.h #define SAVEGAMENAME "srb2sav" -char savegamename[256]; +extern char savegamename[256]; // m_misc.h #ifdef GETTEXT From 166b06b589a7b0c792149d6e416096420b7a5aab Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:40:51 +0100 Subject: [PATCH 04/18] turn all non-extern variables in s_sound.h into externs (and put their real definitions in the .c file) (cherry picked from commit dab212dc56936dd92a935d0c81003ff1d35ee2ee) --- src/s_sound.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.h b/src/s_sound.h index 2a904faff..eeb1f0ab0 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -236,7 +236,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum); #ifdef MUSICSLOT_COMPATIBILITY // For compatibility with code/scripts relying on older versions // This is a list of all the "special" slot names and their associated numbers -const char *compat_special_music_slots[16]; +extern const char *compat_special_music_slots[16]; #endif #endif From f0fa25a24331d4f116958c5f29cf2703ffda86e3 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:42:16 +0100 Subject: [PATCH 05/18] added missing extern keyword for ms_RoomId in mserv.h (the definition is already in the .c file in this case) (cherry picked from commit 064f4bcf349e9600552a0b99bd0fbfb3cbcf0958) --- src/mserv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mserv.h b/src/mserv.h index 09cd4f089..8f8152a7c 100644 --- a/src/mserv.h +++ b/src/mserv.h @@ -68,7 +68,7 @@ extern consvar_t cv_masterserver, cv_servername; // < 0 to not connect (usually -1) (offline mode) // == 0 to show all rooms, not a valid hosting room // anything else is whatever room the MS assigns to that number (online mode) -INT16 ms_RoomId; +extern INT16 ms_RoomId; const char *GetMasterServerPort(void); const char *GetMasterServerIP(void); From 41f0f34d3534d90e5eb64188cf46c470dda7016f Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 15 May 2020 10:00:05 -0700 Subject: [PATCH 06/18] Add missing extern to colortranslations --- src/k_kart.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.h b/src/k_kart.h index 2ba5d1bdc..86ae0fcc5 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -11,7 +11,7 @@ #define KART_FULLTURN 800 -UINT8 colortranslations[MAXTRANSLATIONS][16]; +extern UINT8 colortranslations[MAXTRANSLATIONS][16]; extern const char *KartColor_Names[MAXSKINCOLORS]; extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2]; void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor); From 4eb7540cb333d0b4e23f78fd1215cf2858d2966c Mon Sep 17 00:00:00 2001 From: Sryder Date: Sat, 16 May 2020 00:02:33 +0100 Subject: [PATCH 07/18] Use bionic to build focal version because it has GCC 4.8? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f2693236b..380145250 100644 --- a/.travis.yml +++ b/.travis.yml @@ -451,7 +451,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: focal + dist: bionic if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" From ac314d5f34d401d42495f9b33571526d9276513e Mon Sep 17 00:00:00 2001 From: filpAM Date: Sat, 16 May 2020 00:20:52 +0000 Subject: [PATCH 08/18] Fix visplane getting allocated twice --- src/r_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_plane.c b/src/r_plane.c index db5bfbda2..659481ec8 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -402,7 +402,7 @@ static visplane_t *new_visplane(unsigned hash) visplane_t *check = freetail; if (!check) { - check = calloc(2, sizeof (*check)); + check = calloc(1, sizeof (*check)); if (check == NULL) I_Error("%s: Out of memory", "new_visplane"); // FIXME: ugly } else From 5f6e3b0e0f47e862f05604a7e036becbcf5edd42 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Tue, 31 Mar 2020 19:42:15 +0300 Subject: [PATCH 09/18] Fix wrong orientation some boost pads in ogl --- src/hardware/hw_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 1bad26ee1..c7ff5a4af 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -407,7 +407,7 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei if (angle) // Only needs to be done if there's an altered angle { - angle = (InvAngle(angle)+ANGLE_180)>>ANGLETOFINESHIFT; + angle = InvAngle(angle)>>ANGLETOFINESHIFT; // This needs to be done so that it scrolls in a different direction after rotation like software /*tempxsow = FLOAT_TO_FIXED(scrollx); @@ -439,7 +439,7 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei tempxsow = FLOAT_TO_FIXED(v3d->s); tempytow = FLOAT_TO_FIXED(v3d->t); v3d->s = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); - v3d->t = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle)))); + v3d->t = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle)))); } //v3d->s = (float)(v3d->s - flatxref + scrollx); From ba706e8409f1002ac5b322eb72cc4cebaa17aa9e Mon Sep 17 00:00:00 2001 From: Sryder Date: Tue, 19 May 2020 20:45:49 +0100 Subject: [PATCH 10/18] Use xenial to build all the versions newer than trusty I'm not 100% sure why we can't use newer series to build the newer installers. But this seems to be what vanilla does --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 380145250..663498901 100644 --- a/.travis.yml +++ b/.travis.yml @@ -451,7 +451,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: bionic + dist: xenial if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" @@ -475,7 +475,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: bionic + dist: xenial if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" @@ -547,7 +547,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: bionic + dist: xenial if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" From 8e39dfa5c6001814aa05e238744f45bd8b2add56 Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 20 May 2020 11:37:38 +0100 Subject: [PATCH 11/18] D_ModifierKeyResponder is unused now so remove it. --- src/d_main.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 5acfb610a..85b363e0e 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -187,35 +187,6 @@ UINT8 shiftdown = 0; // 0x1 left, 0x2 right UINT8 ctrldown = 0; // 0x1 left, 0x2 right UINT8 altdown = 0; // 0x1 left, 0x2 right boolean capslock = 0; // gee i wonder what this does. -// -// D_ModifierKeyResponder -// Sets global shift/ctrl/alt variables, never actually eats events -// -static inline void D_ModifierKeyResponder(event_t *ev) -{ - if (ev->type == ev_keydown || ev->type == ev_console) switch (ev->data1) - { - case KEY_LSHIFT: shiftdown |= 0x1; return; - case KEY_RSHIFT: shiftdown |= 0x2; return; - case KEY_LCTRL: ctrldown |= 0x1; return; - case KEY_RCTRL: ctrldown |= 0x2; return; - case KEY_LALT: altdown |= 0x1; return; - case KEY_RALT: altdown |= 0x2; return; - case KEY_CAPSLOCK: capslock = !capslock; return; - - default: return; - } - else if (ev->type == ev_keyup) switch (ev->data1) - { - case KEY_LSHIFT: shiftdown &= ~0x1; return; - case KEY_RSHIFT: shiftdown &= ~0x2; return; - case KEY_LCTRL: ctrldown &= ~0x1; return; - case KEY_RCTRL: ctrldown &= ~0x2; return; - case KEY_LALT: altdown &= ~0x1; return; - case KEY_RALT: altdown &= ~0x2; return; - default: return; - } -} // // D_ProcessEvents @@ -282,7 +253,7 @@ static void D_Display(void) { if (nodrawers) return; // for comparative timing/profiling - + // check for change of screen size (video mode) if (setmodeneeded && !wipe) SCR_SetMode(); // change video mode From b2674a3cd08eb2ccc2da58bb0dfc978d4b7cb2c3 Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 20 May 2020 11:47:22 +0100 Subject: [PATCH 12/18] Initialise these to 0 just to stop GCC 4.4 from complaining. This should be okay since 0 generally means "nothing" for these, and they should always be set before being used later on. --- src/hardware/r_opengl/r_opengl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 5dc460996..e0503ba07 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -823,7 +823,7 @@ EXPORT boolean HWRAPI(LoadShaders) (void) #ifdef GL_SHADERS GLuint gl_vertShader, gl_fragShader; GLint i, result; - + if (!pglUseProgram) return false; gl_customvertexshaders[0] = NULL; @@ -2002,11 +2002,11 @@ EXPORT void HWRAPI(RenderBatches) (int *sNumPolys, int *sNumVerts, int *sNumCall boolean stopFlag = false; boolean changeState = false; boolean changeShader = false; - GLuint nextShader; + GLuint nextShader = 0U; boolean changeTexture = false; - GLuint nextTexture; + GLuint nextTexture = 0U; boolean changePolyFlags = false; - FBITFIELD nextPolyFlags; + FBITFIELD nextPolyFlags = 0U; boolean changeSurfaceInfo = false; FSurfaceInfo nextSurfaceInfo; @@ -2307,7 +2307,7 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI pglColor4ubv((GLubyte*)&pSurf->PolyColor.s); } - + // Tint color tint.red = byte2float[pSurf->TintColor.s.red]; tint.green = byte2float[pSurf->TintColor.s.green]; From 52c8ba5d494bc9641973ee415d6642d747273e7f Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 23 May 2020 16:21:26 -0400 Subject: [PATCH 13/18] Fix opengl crashing on startup due to lack of checks Also fixes the log file not being written to the home directory. --- src/hardware/r_opengl/r_opengl.c | 16 ++++++++-------- src/sdl/ogl_sdl.c | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index e0503ba07..eef723e51 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -143,7 +143,7 @@ static const GLfloat byte2float[256] = { // -----------------+ #ifdef DEBUG_TO_FILE -FILE *gllogstream; +FILE *gllogstream = NULL; #endif FUNCPRINTF void GL_DBG_Printf(const char *format, ...) @@ -152,14 +152,14 @@ FUNCPRINTF void GL_DBG_Printf(const char *format, ...) char str[4096] = ""; va_list arglist; - if (!gllogstream) - gllogstream = fopen("ogllog.txt", "w"); + if (gllogstream) + { + va_start(arglist, format); + vsnprintf(str, 4096, format, arglist); + va_end(arglist); - va_start(arglist, format); - vsnprintf(str, 4096, format, arglist); - va_end(arglist); - - fwrite(str, strlen(str), 1, gllogstream); + fwrite(str, strlen(str), 1, gllogstream); + } #else (void)format; #endif diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index b006047f5..eb8e12cbc 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -33,6 +33,7 @@ #endif #include "../doomdef.h" +#include "../d_main.h" #ifdef HWRENDER #include "../hardware/r_opengl/r_opengl.h" @@ -154,11 +155,26 @@ boolean OglSdlSurface(INT32 w, INT32 h) { INT32 cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value; static boolean first_init = false; + const char *gllogdir = NULL; oglflags = 0; if (!first_init) { + if (!gllogstream) + { + gllogdir = D_Home(); + +#ifdef DEBUG_TO_FILE +#ifdef DEFAULTDIR + if (gllogdir) + gllogstream = fopen(va("%s/"DEFAULTDIR"/ogllog.txt",gllogdir), "wt"); + else +#endif + gllogstream = fopen("./ogllog.txt", "wt"); +#endif + } + gl_version = pglGetString(GL_VERSION); gl_renderer = pglGetString(GL_RENDERER); gl_extensions = pglGetString(GL_EXTENSIONS); From eba79e77fcf64c03800982db9741977b6cf8a5a1 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 31 May 2020 20:31:55 +0100 Subject: [PATCH 14/18] Serialise shadowscale. --- src/p_saveg.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/p_saveg.c b/src/p_saveg.c index 5aa988075..4e786a65f 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -955,10 +955,11 @@ typedef enum MD2_COLORIZED = 1<<9, MD2_WAYPOINTCAP = 1<<10, MD2_KITEMCAP = 1<<11, - MD2_ITNEXT = 1<<12 + MD2_ITNEXT = 1<<12, #ifdef ESLOPE - , MD2_SLOPE = 1<<13 + MD2_SLOPE = 1<<13, #endif + MD2_SHADOWSCALE = 1<<14, } mobj_diff2_t; typedef enum @@ -1155,6 +1156,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) if (mobj->standingslope) diff2 |= MD2_SLOPE; #endif + if (mobj->shadowscale) + diff2 |= MD2_SHADOWSCALE; if (mobj->colorized) diff2 |= MD2_COLORIZED; if (mobj == waypointcap) @@ -1284,6 +1287,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) #endif if (diff2 & MD2_COLORIZED) WRITEUINT8(save_p, mobj->colorized); + if (diff2 & MD2_SHADOWSCALE) + WRITEFIXED(save_p, mobj->shadowscale); WRITEUINT32(save_p, mobj->mobjnum); } @@ -2211,6 +2216,8 @@ static void LoadMobjThinker(actionf_p1 thinker) #endif if (diff2 & MD2_COLORIZED) mobj->colorized = READUINT8(save_p); + if (diff2 & MD2_SHADOWSCALE) + mobj->shadowscale = READFIXED(save_p); if (diff & MD_REDFLAG) { From 0f9872fc27b2ab81bf525639ca03402185411a7f Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 3 Jun 2020 20:26:52 +0100 Subject: [PATCH 15/18] Draw radius for waypoint debug on "best" waypoint. Fix scale of waypoint connections on mapmobjscale maps --- src/dehacked.c | 2 ++ src/info.c | 5 ++++- src/info.h | 4 ++++ src/k_waypoint.c | 41 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 50 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index ac7c213f7..f735b22e9 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7100,6 +7100,8 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BATTLECAPSULE_SUPPORT", "S_BATTLECAPSULE_SUPPORTFLY", + "S_EGOORB", + #ifdef SEENAMES "S_NAMECHECK", #endif diff --git a/src/info.c b/src/info.c index 6c695e705..8f6989247 100644 --- a/src/info.c +++ b/src/info.c @@ -69,7 +69,8 @@ char sprnames[NUMSPRITES + 1][5] = "ICEB","CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS", "ZTCH","MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH", "BFRT","OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN", - "FWRK","MXCL","RGSP","DRAF","GRES","OTFG","DBOS","XMS4","XMS5","VIEW" + "FWRK","MXCL","RGSP","DRAF","GRES","OTFG","DBOS","EGOO","XMS4","XMS5", + "VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -3497,6 +3498,8 @@ state_t states[NUMSTATES] = {SPR_CAPS, 4, -1, {NULL}, 0, 0, S_NULL}, // S_BATTLECAPSULE_SUPPORT {SPR_CAPS, FF_ANIMATE|5, -1, {NULL}, 3, 1, S_NULL}, // S_BATTLECAPSULE_SUPPORTFLY + {SPR_EGOO, 0, 1, {NULL}, 0, 0, S_NULL}, // S_EGOO + #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif diff --git a/src/info.h b/src/info.h index 2ccf6415a..a1db87946 100644 --- a/src/info.h +++ b/src/info.h @@ -796,6 +796,8 @@ typedef enum sprite SPR_DBOS, // Drift boost flame + SPR_EGOO, + // Xmas-specific sprites that don't fit aboxe SPR_XMS4, SPR_XMS5, @@ -4184,6 +4186,8 @@ typedef enum state S_BATTLECAPSULE_SUPPORT, S_BATTLECAPSULE_SUPPORTFLY, + S_EGOORB, + #ifdef SEENAMES S_NAMECHECK, #endif diff --git a/src/k_waypoint.c b/src/k_waypoint.c index 69b488dd6..2f43ea792 100644 --- a/src/k_waypoint.c +++ b/src/k_waypoint.c @@ -474,7 +474,7 @@ static void K_DebugWaypointsSpawnLine(waypoint_t *const waypoint1, waypoint_t *c spawnedmobj->state->tics = 1; spawnedmobj->frame = spawnedmobj->frame & ~FF_TRANSMASK; spawnedmobj->color = linkcolours[linkcolour]; - spawnedmobj->scale = FixedMul(FRACUNIT/4, FixedDiv((15 - ((leveltime + n) % 16))*FRACUNIT, 15*FRACUNIT)); + spawnedmobj->scale = FixedMul(spawnedmobj->scale, FixedMul(FRACUNIT/4, FixedDiv((15 - ((leveltime + n) % 16))*FRACUNIT, 15*FRACUNIT))); } x += stepx; @@ -483,6 +483,40 @@ static void K_DebugWaypointsSpawnLine(waypoint_t *const waypoint1, waypoint_t *c } while (n--); } +static void K_DebugWaypointDrawRadius(waypoint_t *waypoint) +{ + mobj_t *radiusOrb; + mobj_t *waypointmobj; + const INT32 numRadiusMobjs = 64; + INT32 i = 0; + angle_t spawnAngle = 0U; + fixed_t spawnX= 0; + fixed_t spawnY= 0; + fixed_t spawnZ= 0; + + I_Assert(waypoint != NULL); + I_Assert(waypoint->mobj != NULL); + + waypointmobj = waypoint->mobj; + + for (i = 0; i < numRadiusMobjs; i++) + { + spawnAngle = (ANGLE_MAX / numRadiusMobjs) * i; + + spawnZ = waypointmobj->z; + spawnX = waypointmobj->x + P_ReturnThrustX(waypointmobj, spawnAngle, waypointmobj->radius); + spawnY = waypointmobj->y + P_ReturnThrustY(waypointmobj, spawnAngle, waypointmobj->radius); + + radiusOrb = P_SpawnMobj(spawnX, spawnY, spawnZ, MT_SPARK); + P_SetMobjState(radiusOrb, S_THOK); + radiusOrb->state->nextstate = S_NULL; + radiusOrb->state->tics = 1; + radiusOrb->frame = radiusOrb->frame & ~FF_TRANSMASK; + radiusOrb->color = SKINCOLOR_PURPLE; + radiusOrb->scale = radiusOrb->scale / 4; + } +} + /*-------------------------------------------------- void K_DebugWaypointsVisualise(void) @@ -523,15 +557,20 @@ void K_DebugWaypointsVisualise(void) { if (waypoint->numnextwaypoints == 0 && waypoint->numprevwaypoints == 0) { + P_SetMobjState(debugmobj, S_EGOORB); debugmobj->color = SKINCOLOR_RED; + debugmobj->colorized = true; } else if (waypoint->numnextwaypoints == 0 || waypoint->numprevwaypoints == 0) { + P_SetMobjState(debugmobj, S_EGOORB); debugmobj->color = SKINCOLOR_YELLOW; + debugmobj->colorized = true; } else if (waypoint == players[displayplayers[0]].nextwaypoint) { debugmobj->color = SKINCOLOR_GREEN; + K_DebugWaypointDrawRadius(waypoint); } else { From 648fa66d825c6aeeb2b6e143c58a6878d9945df4 Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 3 Jun 2020 20:29:13 +0100 Subject: [PATCH 16/18] Add function comment --- src/info.c | 2 +- src/k_waypoint.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/info.c b/src/info.c index 8f6989247..fcdeffcd6 100644 --- a/src/info.c +++ b/src/info.c @@ -3498,7 +3498,7 @@ state_t states[NUMSTATES] = {SPR_CAPS, 4, -1, {NULL}, 0, 0, S_NULL}, // S_BATTLECAPSULE_SUPPORT {SPR_CAPS, FF_ANIMATE|5, -1, {NULL}, 3, 1, S_NULL}, // S_BATTLECAPSULE_SUPPORTFLY - {SPR_EGOO, 0, 1, {NULL}, 0, 0, S_NULL}, // S_EGOO + {SPR_EGOO, 0, 1, {NULL}, 0, 0, S_NULL}, // S_EGOORB #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK diff --git a/src/k_waypoint.c b/src/k_waypoint.c index 2f43ea792..50ab94ef6 100644 --- a/src/k_waypoint.c +++ b/src/k_waypoint.c @@ -483,6 +483,14 @@ static void K_DebugWaypointsSpawnLine(waypoint_t *const waypoint1, waypoint_t *c } while (n--); } +/*-------------------------------------------------- + void K_DebugWaypointDrawRadius(waypoint_t *waypoint) + + Draw a debugging circle to represent a waypoint's radius + + Input Arguments:- + waypoint - A waypoint to draw the radius of +--------------------------------------------------*/ static void K_DebugWaypointDrawRadius(waypoint_t *waypoint) { mobj_t *radiusOrb; From 6620fa96f28e03d24425977e7b4b3ae47957302a Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 3 Jun 2020 20:30:01 +0100 Subject: [PATCH 17/18] const pointer to waypoint --- src/k_waypoint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_waypoint.c b/src/k_waypoint.c index 50ab94ef6..7d119498a 100644 --- a/src/k_waypoint.c +++ b/src/k_waypoint.c @@ -484,14 +484,14 @@ static void K_DebugWaypointsSpawnLine(waypoint_t *const waypoint1, waypoint_t *c } /*-------------------------------------------------- - void K_DebugWaypointDrawRadius(waypoint_t *waypoint) + void K_DebugWaypointDrawRadius(waypoint_t *const waypoint) Draw a debugging circle to represent a waypoint's radius Input Arguments:- waypoint - A waypoint to draw the radius of --------------------------------------------------*/ -static void K_DebugWaypointDrawRadius(waypoint_t *waypoint) +static void K_DebugWaypointDrawRadius(waypoint_t *const waypoint) { mobj_t *radiusOrb; mobj_t *waypointmobj; From d13d923a922429f6c3b596db516fe995659c62bc Mon Sep 17 00:00:00 2001 From: Sryder Date: Thu, 4 Jun 2020 01:47:56 +0100 Subject: [PATCH 18/18] New water trail for skimming Out with the old splish splish. Bring on the SKKKKSSSSSSS --- src/dehacked.c | 20 +++++++++++++ src/info.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++-- src/info.h | 22 ++++++++++++++ src/p_user.c | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 194 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index f735b22e9..48f561a32 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7102,6 +7102,23 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_EGOORB", + "S_WATERTRAIL1", + "S_WATERTRAIL2", + "S_WATERTRAIL3", + "S_WATERTRAIL4", + "S_WATERTRAIL5", + "S_WATERTRAIL6", + "S_WATERTRAIL7", + "S_WATERTRAIL8", + "S_WATERTRAILUNDERLAY1", + "S_WATERTRAILUNDERLAY2", + "S_WATERTRAILUNDERLAY3", + "S_WATERTRAILUNDERLAY4", + "S_WATERTRAILUNDERLAY5", + "S_WATERTRAILUNDERLAY6", + "S_WATERTRAILUNDERLAY7", + "S_WATERTRAILUNDERLAY8", + #ifdef SEENAMES "S_NAMECHECK", #endif @@ -7914,6 +7931,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_BATTLECAPSULE", "MT_BATTLECAPSULE_PIECE", + "MT_WATERTRAIL", + "MT_WATERTRAILUNDERLAY", + #ifdef SEENAMES "MT_NAMECHECK", #endif diff --git a/src/info.c b/src/info.c index fcdeffcd6..795885f92 100644 --- a/src/info.c +++ b/src/info.c @@ -69,8 +69,8 @@ char sprnames[NUMSPRITES + 1][5] = "ICEB","CNDL","DOCH","DUCK","GTRE","CHES","CHIM","DRGN","LZMN","PGSS", "ZTCH","MKMA","MKMP","RTCH","BOWL","BOWH","BRRL","BRRR","HRSE","TOAH", "BFRT","OFRT","RFRT","PFRT","ASPK","HBST","HBSO","HBSF","WBLZ","WBLN", - "FWRK","MXCL","RGSP","DRAF","GRES","OTFG","DBOS","EGOO","XMS4","XMS5", - "VIEW" + "FWRK","MXCL","RGSP","DRAF","GRES","OTFG","DBOS","EGOO","WTRL","XMS4", + "XMS5","VIEW" }; // Doesn't work with g++, needs actionf_p1 (don't modify this comment) @@ -3500,6 +3500,24 @@ state_t states[NUMSTATES] = {SPR_EGOO, 0, 1, {NULL}, 0, 0, S_NULL}, // S_EGOORB + // Water Trail + {SPR_WTRL, FF_PAPERSPRITE , 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL1 + {SPR_WTRL, FF_PAPERSPRITE|1, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL2 + {SPR_WTRL, FF_PAPERSPRITE|2, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL3 + {SPR_WTRL, FF_PAPERSPRITE|3, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL4 + {SPR_WTRL, FF_PAPERSPRITE|4, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL5 + {SPR_WTRL, FF_PAPERSPRITE|5, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL6 + {SPR_WTRL, FF_PAPERSPRITE|6, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL7 + {SPR_WTRL, FF_PAPERSPRITE|7, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAIL8 + {SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|8, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY1 + {SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|9, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY2 + {SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|10, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY3 + {SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|11, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY4 + {SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|12, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY5 + {SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|13, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY6 + {SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|14, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY7 + {SPR_WTRL, FF_TRANS50|FF_PAPERSPRITE|15, 2, {NULL}, 0, 0, S_NULL}, // S_WATERTRAILUNDERLAY8 + #ifdef SEENAMES {SPR_NULL, 0, 1, {NULL}, 0, 0, S_NULL}, // S_NAMECHECK #endif @@ -20778,6 +20796,60 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_WATERTRAIL + -1, // doomednum + S_WATERTRAIL1, // 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 + 48*FRACUNIT, // radius + 32*FRACUNIT, // height + 1, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + + { // MT_WATERTRAILUNDERLAY + -1, // doomednum + S_WATERTRAILUNDERLAY1, // 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 + 48*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 100, // mass + 1, // damage + sfx_None, // activesound + MF_NOBLOCKMAP|MF_NOCLIP|MF_NOGRAVITY|MF_SCENERY|MF_DONTENCOREMAP, // flags + S_NULL // raisestate + }, + // ============================================================================================================================// #ifdef SEENAMES diff --git a/src/info.h b/src/info.h index a1db87946..183d1f941 100644 --- a/src/info.h +++ b/src/info.h @@ -798,6 +798,8 @@ typedef enum sprite SPR_EGOO, + SPR_WTRL, // Water Trail + // Xmas-specific sprites that don't fit aboxe SPR_XMS4, SPR_XMS5, @@ -4188,6 +4190,23 @@ typedef enum state S_EGOORB, + S_WATERTRAIL1, + S_WATERTRAIL2, + S_WATERTRAIL3, + S_WATERTRAIL4, + S_WATERTRAIL5, + S_WATERTRAIL6, + S_WATERTRAIL7, + S_WATERTRAIL8, + S_WATERTRAILUNDERLAY1, + S_WATERTRAILUNDERLAY2, + S_WATERTRAILUNDERLAY3, + S_WATERTRAILUNDERLAY4, + S_WATERTRAILUNDERLAY5, + S_WATERTRAILUNDERLAY6, + S_WATERTRAILUNDERLAY7, + S_WATERTRAILUNDERLAY8, + #ifdef SEENAMES S_NAMECHECK, #endif @@ -5017,6 +5036,9 @@ typedef enum mobj_type MT_BATTLECAPSULE, MT_BATTLECAPSULE_PIECE, + MT_WATERTRAIL, + MT_WATERTRAILUNDERLAY, + #ifdef SEENAMES MT_NAMECHECK, #endif diff --git a/src/p_user.c b/src/p_user.c index 28273ca82..0fdfd7120 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6045,6 +6045,7 @@ static void P_MovePlayer(player_t *player) */ // If you're running fast enough, you can create splashes as you run in shallow water. +#if 0 if (!player->climbing && ((!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z + player->mo->height >= player->mo->watertop && player->mo->z <= player->mo->watertop) || (player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height >= player->mo->waterbottom && player->mo->z <= player->mo->waterbottom)) @@ -6065,6 +6066,83 @@ static void P_MovePlayer(player_t *player) water->destscale = player->mo->scale; P_SetScale(water, player->mo->scale); } +#endif + + if (!player->climbing + && ((!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z + player->mo->height >= player->mo->watertop && player->mo->z <= player->mo->watertop) + || (player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height >= player->mo->waterbottom && player->mo->z <= player->mo->waterbottom)) + && (player->speed > runspd || (player->pflags & PF_STARTDASH)) + && player->mo->momz == 0 && !(player->pflags & PF_SLIDING) && !player->spectator) + { + fixed_t trailScale = FixedMul(FixedDiv(player->speed - runspd, K_GetKartSpeed(player, false) - runspd), mapobjectscale); + fixed_t playerTopSpeed = K_GetKartSpeed(player, false); + + if (playerTopSpeed > runspd) + trailScale = FixedMul(FixedDiv(player->speed - runspd, playerTopSpeed - runspd), mapobjectscale); + else + trailScale = mapobjectscale; // Scaling is based off difference between runspeed and top speed + + if (trailScale > 0) + { + const angle_t forwardangle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); + const fixed_t playerVisualRadius = player->mo->radius + 8*FRACUNIT; + const size_t numFrames = S_WATERTRAIL8 - S_WATERTRAIL1; + const statenum_t curOverlayFrame = S_WATERTRAIL1 + (leveltime % numFrames); + const statenum_t curUnderlayFrame = S_WATERTRAILUNDERLAY1 + (leveltime % numFrames); + fixed_t x1, x2, y1, y2; + mobj_t *water; + + x1 = player->mo->x + player->mo->momx + P_ReturnThrustX(player->mo, forwardangle + ANGLE_90, playerVisualRadius); + y1 = player->mo->y + player->mo->momy + P_ReturnThrustY(player->mo, forwardangle + ANGLE_90, playerVisualRadius); + x1 = x1 + P_ReturnThrustX(player->mo, forwardangle, playerVisualRadius); + y1 = y1 + P_ReturnThrustY(player->mo, forwardangle, playerVisualRadius); + + x2 = player->mo->x + player->mo->momx + P_ReturnThrustX(player->mo, forwardangle - ANGLE_90, playerVisualRadius); + y2 = player->mo->y + player->mo->momy + P_ReturnThrustY(player->mo, forwardangle - ANGLE_90, playerVisualRadius); + x2 = x2 + P_ReturnThrustX(player->mo, forwardangle, playerVisualRadius); + y2 = y2 + P_ReturnThrustY(player->mo, forwardangle, playerVisualRadius); + + // Left + // underlay + water = P_SpawnMobj(x1, y1, + ((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAILUNDERLAY].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAILUNDERLAY); + water->angle = forwardangle - ANGLE_180 - ANGLE_22h; + water->destscale = trailScale; + P_SetScale(water, trailScale); + P_SetMobjState(water, curUnderlayFrame); + + // overlay + water = P_SpawnMobj(x1, y1, + ((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAIL].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAIL); + water->angle = forwardangle - ANGLE_180 - ANGLE_22h; + water->destscale = trailScale; + P_SetScale(water, trailScale); + P_SetMobjState(water, curOverlayFrame); + + // Right + // Underlay + water = P_SpawnMobj(x2, y2, + ((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAILUNDERLAY].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAILUNDERLAY); + water->angle = forwardangle - ANGLE_180 + ANGLE_22h; + water->destscale = trailScale; + P_SetScale(water, trailScale); + P_SetMobjState(water, curUnderlayFrame); + + // Overlay + water = P_SpawnMobj(x2, y2, + ((player->mo->eflags & MFE_VERTICALFLIP) ? player->mo->waterbottom - FixedMul(mobjinfo[MT_WATERTRAIL].height, player->mo->scale) : player->mo->watertop), MT_WATERTRAIL); + water->angle = forwardangle - ANGLE_180 + ANGLE_22h; + water->destscale = trailScale; + P_SetScale(water, trailScale); + P_SetMobjState(water, curOverlayFrame); + + if (!S_SoundPlaying(player->mo, sfx_s3kdbs)) + { + const INT32 volume = (min(trailScale, FRACUNIT) * 255) / FRACUNIT; + S_StartSoundAtVolume(player->mo, sfx_s3kdbs, volume); + } + } + } // Little water sound while touching water - just a nicety. if ((player->mo->eflags & MFE_TOUCHWATER) && !(player->mo->eflags & MFE_UNDERWATER) && !player->spectator)