diff --git a/comptime.sh b/comptime.sh index ce771f631..86117d9d2 100755 --- a/comptime.sh +++ b/comptime.sh @@ -17,7 +17,7 @@ EOF versiongit() { gitbranch="$(git rev-parse --abbrev-ref HEAD)" - gitversion="$(git rev-parse HEAD | cut -c -8)" + gitversion="$(git show --pretty=format:'%h %s' -s HEAD)" version "$gitbranch" "$gitversion"; exit 0 } diff --git a/src/Makefile b/src/Makefile index 32b782267..99854cde5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -87,7 +87,6 @@ ifeq ($(OS),Windows_NT) # all windows are Windows_NT... MINGW=1 SDL=1 WINDOWSHELL=1 - HAVE_DISCORDRPC=1 NOUPX=1 else # if you on the *nix @@ -140,7 +139,6 @@ endif ifdef LINUX64 LINUX=1 NONX86=1 -HAVE_DISCORDRPC=1 # LINUX64 does not imply X86_64=1; could mean ARM64 or Itanium endif diff --git a/src/discord.c b/src/discord.c index 8f312f63a..e1cacdded 100644 --- a/src/discord.c +++ b/src/discord.c @@ -10,7 +10,7 @@ /// \file discord.h /// \brief Discord Rich Presence handling -//#ifdef HAVE_DISCORDRPC +#ifdef HAVE_DISCORDRPC #include @@ -735,4 +735,4 @@ void DRPC_UpdatePresence(void) Discord_UpdatePresence(&discordPresence); } -//#endif // HAVE_DISCORDRPC +#endif // HAVE_DISCORDRPC diff --git a/src/hardware/hw_shaders.h b/src/hardware/hw_shaders.h index 4fe046a61..2666a1413 100644 --- a/src/hardware/hw_shaders.h +++ b/src/hardware/hw_shaders.h @@ -277,15 +277,15 @@ #define GLSL_WATER_TEXEL \ "float water_z = (gl_FragCoord.z / gl_FragCoord.w) / 2.0;\n" \ "float a = -pi * (water_z * freq) + (leveltime * speed);\n" \ - "float sdistort = sin(a) * amp * 1.5;\n" \ - "float cdistort = cos(a) * amp * 2.2;\n" \ + "float sdistort = sin(a) * amp;\n" \ + "float cdistort = cos(a) * amp;\n" \ "vec4 texel = texture2D(tex, vec2(gl_TexCoord[0].s - sdistort, gl_TexCoord[0].t - cdistort));\n" #define GLSL_WATER_FRAGMENT_SHADER \ GLSL_FLOOR_FUDGES \ "const float freq = 0.03;\n" \ "const float amp = 0.025;\n" \ - "const float speed = 1.6;\n" \ + "const float speed = 2.0;\n" \ "const float pi = 3.14159;\n" \ "#ifdef SRB2_PALETTE_RENDERING\n" \ "uniform sampler2D tex;\n" \ diff --git a/src/i_time.c b/src/i_time.c index b082d73ae..a1ef580bd 100644 --- a/src/i_time.c +++ b/src/i_time.c @@ -55,20 +55,18 @@ void I_UpdateTime(fixed_t timescale) { double ticratescaled; double elapsedseconds; - double inverse_ticratescaled; tic_t realtics; // get real tics ticratescaled = (double)TICRATE * FIXED_TO_FLOAT(timescale); - inverse_ticratescaled = 1.0 / ticratescaled; enterprecise = I_GetPreciseTime(); elapsedseconds = (double)(enterprecise - oldenterprecise) / I_GetPrecisePrecision(); tictimer += elapsedseconds; - while (tictimer > inverse_ticratescaled) + while (tictimer > 1.0/ticratescaled) { entertic += 1; - tictimer -= inverse_ticratescaled; + tictimer -= 1.0/ticratescaled; } realtics = entertic - oldentertics; oldentertics = entertic; diff --git a/src/m_menu.c b/src/m_menu.c index 8e9164e0b..1ab2c157b 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4345,12 +4345,13 @@ void M_Drawer(void) } else { -//#ifdef DEVELOP // Development -- show revision / branch info - //V_DrawThinString(vid.dupx, vid.height - 20*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch); +#ifdef DEVELOP // Development -- show revision / branch info + V_DrawThinString(vid.dupx, vid.height - 20*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch); V_DrawThinString(vid.dupx, vid.height - 10*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision); -//#else // Regular build - V_DrawThinString(vid.dupx, vid.height - 20*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING)); -//#endif +#else // Regular build + V_DrawThinString(vid.dupx, vid.height - 20*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision); // Removeur this for release! im just lazy to make a new flag or smth + V_DrawThinString(vid.dupx, vid.height - 10*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING)); +#endif #ifdef HWRENDER if (rendermode == render_opengl) diff --git a/src/r_bsp.c b/src/r_bsp.c index f87e10ae8..29a13c897 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -47,8 +47,12 @@ boolean g_walloffscreen; boolean R_NoEncore(sector_t *sector, boolean ceiling) { boolean invertencore = (GETSECSPECIAL(sector->special, 2) == 15); - +#if 0 // perfect implementation + INT32 val = GETSECSPECIAL(sector->special, 3); + if (val != 1 && val != 3 // spring panel +#else // optimised, see #define GETSECSPECIAL(i,j) ((i >> ((j-1)*4))&15) if ((!(sector->special & (1<<8)) || (sector->special & ((4|8)<<8))) // spring panel +#endif && GETSECSPECIAL(sector->special, 4) != 6) // sneaker panel return invertencore; diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 6a912a1f6..321401d08 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -48,6 +48,12 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); #undef SystemFunction036 #endif +// A little more than the minimum sleep duration on Windows. +// May be incorrect for other platforms, but we don't currently have a way to +// query the scheduler granularity. SDL will do what's needed to make this as +// low as possible though. +#define MIN_SLEEP_DURATION_MS 2.1 + #include #include #include @@ -198,16 +204,6 @@ static char returnWadPath[256]; #include "../byteptr.h" #endif -// A little more than the minimum sleep duration on Windows. -// May be incorrect for other platforms, but we don't currently have a way to -// query the scheduler granularity. SDL will do what's needed to make this as -// low as possible though. -#if defined(_WIN32) -#define MIN_SLEEP_DURATION_MS 1.6 -#else -#define MIN_SLEEP_DURATION_MS 2.1 -#endif - #ifdef HAVE_LIBBACKTRACE #include // TODO - move this to some header file instead diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 118042393..ced911eba 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -938,24 +938,24 @@ boolean I_SetSongPosition(UINT32 position) if (gme) { // this is unstable, so fail silently - //return true; + return true; // this isn't required technically, but GME thread-locks for a second // if you seek too high from the counter - length = I_GetSongLength(); - if (length) - position = get_adjusted_position(position); + // length = I_GetSongLength(); + // if (length) + // position = get_adjusted_position(position); - SDL_LockAudio(); - gme_err_t gme_e = gme_seek(gme, position); - SDL_UnlockAudio(); + // SDL_LockAudio(); + // gme_err_t gme_e = gme_seek(gme, position); + // SDL_UnlockAudio(); - if (gme_e != NULL) - { - CONS_Alert(CONS_ERROR, "GME error: %s\n", gme_e); - return false; - } - else - return true; + // if (gme_e != NULL) + // { + // CONS_Alert(CONS_ERROR, "GME error: %s\n", gme_e); + // return false; + // } + // else + // return true; } else #endif diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index 34b5553c3..0e08ac582 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -274,7 +274,7 @@ void OglSdlFinishUpdate(boolean waitvbl) oldwaitvbl = waitvbl; - SDL_GL_GetDrawableSize(window, &sdlw, &sdlh); + SDL_GetWindowSize(window, &sdlw, &sdlh); HWR_MakeScreenFinalTexture(); #ifdef USE_FBO_OGL diff --git a/src/sdl/ogl_sdl.h b/src/sdl/ogl_sdl.h index aa70e86da..6d614cd22 100644 --- a/src/sdl/ogl_sdl.h +++ b/src/sdl/ogl_sdl.h @@ -20,12 +20,6 @@ boolean OglSdlSurface(INT32 w, INT32 h); -#ifdef USE_FBO_OGL -#if defined (__unix__) -extern boolean isnvidiagpu; -#endif -#endif - void OglSdlFinishUpdate(boolean vidwait); boolean VID_LoadOGLAPI(void);