Compare commits

..
17 Commits
Author SHA1 Message Date
Alug ca47e2edb7 Merge branch 'Saturn-Next' into Saturn 2023-12-20 18:21:57 +01:00
Alug 54ed45f531 remove pal postprocess shader
it never worked, and isnt the right one to do things anyways
the normal GLSL_PALETTE_FRAGMENT_SHADER already does a good job as a postprocess shader, and works similar to srb2´s newer paletterenderer branch
2023-12-20 17:38:20 +01:00
Alug 6ca2087dbc better wall and floor colormap calc
values taken from based on https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1516
2023-12-20 05:53:36 +01:00
Alug 51166640f5 proper water shader for palette renderer
based on https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1516
2023-12-20 05:15:27 +01:00
Alug ed3b1ea353 use floor light for fog shader
how it should be
2023-12-20 04:02:15 +01:00
Alug 8555d38283 v5.1 2023-12-19 20:54:46 +01:00
Alug d66f7fb369 forgor to add those 2023-12-19 20:20:42 +01:00
Alug 7818f17b27 show localskin option menu in options even when youre host
this is not the pause menu one, but the options one
since some may still want to apply a localskin to a player for some reason
2023-12-19 20:09:48 +01:00
Alug dd833097b3 fix some colour hud stuff not being greyed out if its unavailable 2023-12-19 20:08:20 +01:00
Alug dddb88db92 timeout sticker uses wrong patch 2023-12-19 19:04:05 +01:00
Alug 769d93c7da dont prep shaders if theyre uneeded 2023-12-19 17:38:13 +01:00
indev 661dfde6af Don't print discord username in streamer mode at all since discriminators are not a thing anymore 2023-12-18 22:04:41 +03:00
indev 71dea0161d Only warn about custom master server when failed to connect to it 2023-12-18 14:15:01 +03:00
indev 37e9f54af9 Merge branch 'Saturn-Next' of ssh://github.com/Indev450/SRB2Kart-Saturn into Saturn-Next 2023-12-18 02:47:56 +03:00
Alug 5651219d2f Merge branch 'Saturn' into Saturn-Next 2023-12-18 00:47:12 +01:00
indev c544cf9a7c Fix static memory being re-tagged as purgable
Fixes crashes caused by lua-cached patches becoming invalid, may fix other crashes related to that
2023-12-18 02:45:40 +03:00
Alug 69c10365e5 menu stuff is the worst 2023-12-17 21:04:54 +01:00
9 changed files with 95 additions and 48 deletions

No files matched your search

+1 -1
View File
@@ -101,7 +101,7 @@ static void DRPC_HandleReady(const DiscordUser *user)
{
if (cv_discordstreamer.value)
{
CONS_Printf("Discord: connected to %s\n", user->username);
CONS_Printf("Discord: connection successful\n");
}
else
{
+2 -2
View File
@@ -127,8 +127,8 @@ extern char logfilename[1024];
#else
#define VERSION 1 // Game version
#define SUBVERSION 6 // more precise version number
#define VERSIONSTRING "Saturn v5 "
#define VERSIONSTRINGW L"Saturn v5"
#define VERSIONSTRING "Saturn v5.1 "
#define VERSIONSTRINGW L"Saturn v5.1"
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
// And change CMakeLists.txt (not src/, but in root), for CMake users!
// AND appveyor.yml, for the build bots!
+1 -3
View File
@@ -892,7 +892,7 @@ void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, boolean isc
if (PolyFlags & PF_Fog)
HWD.pfnSetShader(6); // fog shader
else if (PolyFlags & PF_Ripple)
HWD.pfnSetShader(5); // water shader
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 11 : 5); // water shader
else
HWD.pfnSetShader(HWR_ShouldUsePaletteRendering() ? 9 : 1); // floor shader
@@ -6838,8 +6838,6 @@ void HWR_MakeScreenFinalTexture(void)
void HWR_DrawScreenFinalTexture(int width, int height)
{
if (HWR_ShouldUsePaletteRendering())
HWD.pfnSetShader(11); //post processing
HWD.pfnDrawScreenFinalTexture(width, height);
}
+42 -18
View File
@@ -693,11 +693,10 @@ static float shader_leveltime = 0;
"float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \
"float startmap = (15.0 - lightnum) * 4.0;\n" \
"float scale = 160.0 / (lightz + 1.0);\n" \
"return startmap * 1.06 - scale * 0.5 * 1.15;\n" \
"float cap = (155.0 - light) * 0.26;\n" \
"return max(startmap * 1.06 - scale * 0.5 * 1.15, cap);\n" \
"}\n"
// 1.06 and 1.15 were chosen when trying to match software lighting in a test map
#define GLSL_DOOM_COLORMAP \
"float R_DoomColormap(float light, float z)\n" \
"{\n" \
@@ -715,7 +714,8 @@ static float shader_leveltime = 0;
"float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \
"float startmap = (15.0 - lightnum) * 4.0;\n" \
"float scale = 160.0 / (lightz + 1.0);\n" \
"return startmap * 1.05 - scale * 1.0 * 1.1;\n" \
"float cap = (155.0 - light) * 0.26;\n" \
"return max(startmap * 1.05 - scale * 0.5 * 2.2, cap);\n" \
"}\n"
#define GLSL_DOOM_LIGHT_EQUATION \
@@ -812,11 +812,6 @@ static float shader_leveltime = 0;
GLSL_SOFTWARE_PAL_MAIN \
"\0"
#define GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_POSTPROCESS \
GLSL_SOFTWARE_PAL_UNIFORMS \
GLSL_SOFTWARE_PAL_MAIN \
"\0"
//
// Water surface shader
//
@@ -852,6 +847,34 @@ static float shader_leveltime = 0;
"final_color.a = texel.a * poly_color.a;\n" \
"gl_FragColor = final_color;\n" \
"}\0"
#define GLSL_PALETTE_WATER_FRAGMENT_SHADER \
"uniform sampler2D tex;\n" \
"uniform sampler2D lighttable_tex;\n" \
"uniform sampler3D lookup_tex;\n" \
"uniform int palette[768];\n" \
"uniform vec4 poly_color;\n" \
"uniform float lighting;\n" \
"uniform float leveltime;\n" \
"const float freq = 0.025;\n" \
"const float amp = 0.025;\n" \
"const float speed = 2.0;\n" \
"const float pi = 3.14159;\n" \
GLSL_DOOM_COLORMAP_floors \
"void main(void) {\n" \
"float z = (gl_FragCoord.z / gl_FragCoord.w) / 2.0;\n" \
"float a = -pi * (z * freq) + (leveltime * speed);\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" \
"int tex_pal_idx = int(texture3D(lookup_tex, vec3((texel * 63.0 + 0.5) / 64.0))[0] * 255.0);\n" \
"int light_y = int(clamp(floor(R_DoomColormap(lighting, z)), 0.0, 31.0));\n" \
"vec2 lighttable_coord = vec2((float(tex_pal_idx) + 0.5) / 256.0, (float(light_y) + 0.5) / 32.0);\n" \
"int final_idx = int(texture2D(lighttable_tex, lighttable_coord)[0] * 255.0);\n" \
"vec4 final_color = vec4(float(palette[final_idx*3])/255.0, float(palette[final_idx*3+1])/255.0, float(palette[final_idx*3+2])/255.0, 1.0);\n" \
"final_color.a = texel.a * poly_color.a;\n" \
"gl_FragColor = final_color;\n" \
"}\0"
//
// Fog block shader
@@ -865,7 +888,7 @@ static float shader_leveltime = 0;
"uniform float lighting;\n" \
"uniform float fade_start;\n" \
"uniform float fade_end;\n" \
GLSL_DOOM_COLORMAP \
GLSL_DOOM_COLORMAP_floors \
GLSL_DOOM_LIGHT_EQUATION \
"void main(void) {\n" \
"vec4 base_color = gl_Color;\n" \
@@ -927,15 +950,18 @@ static const char *fragment_shaders[] = {
"void main(void) {\n"
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n"
"}\0",
// Palette fragment shader
GLSL_PALETTE_FRAGMENT_SHADER,
// Palette floor fudge shader
GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_FLOORS,
// Palette wall fudge shader
GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_WALLS,
GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_POSTPROCESS,
// Palette water shader
GLSL_PALETTE_WATER_FRAGMENT_SHADER,
NULL,
};
@@ -984,9 +1010,8 @@ static const char *vertex_shaders[] = {
// Palette vertex shader
GLSL_DEFAULT_VERTEX_SHADER,
GLSL_DEFAULT_VERTEX_SHADER,
GLSL_DEFAULT_VERTEX_SHADER,
GLSL_DEFAULT_VERTEX_SHADER,
NULL,
@@ -4453,12 +4478,11 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int width, int height)
clearColour.alpha = 1;
ClearBuffer(true, false, false, &clearColour);
pglBindTexture(GL_TEXTURE_2D, finalScreenTexture);
// prepare shader, if it is enabled
Shader_SetUniforms(NULL, NULL, NULL, NULL);
if (HWR_ShouldUsePaletteRendering())
{
Shader_SetUniforms(NULL, NULL, NULL, NULL); // prepare shader, if it is enabled
pglUseProgram(gl_shaderprograms[8].program); // palette shader
pglActiveTexture(GL_TEXTURE1);
}
+1 -1
View File
@@ -9402,7 +9402,7 @@ static void K_drawBattleFullscreen(void)
else
{
if (!K_UseColorHud())
V_DrawFixedPatch(x<<FRACBITS, ty<<FRACBITS, scale, 0, kp_timeoutstickerclr, NULL);
V_DrawFixedPatch(x<<FRACBITS, ty<<FRACBITS, scale, 0, kp_timeoutsticker, NULL);
else //Colourized hud
{
UINT8 *colormap = R_GetTranslationColormap(TC_DEFAULT, K_GetHudColor(), GTC_CACHE);
+40 -22
View File
@@ -2000,12 +2000,15 @@ static menuitem_t OP_SaturnMenu[] =
{IT_STRING | IT_CVAR, NULL, "Show Lap Emblem", &cv_showlapemblem, 60},
{IT_STRING | IT_CVAR, NULL, "Show Minimap Names", &cv_showminimapnames, 65},
{IT_STRING | IT_CVAR, NULL, "Small Minimap Players", &cv_minihead, 70},
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 75},
{IT_STRING | IT_CVAR, NULL, "Show Cecho Messages", &cv_cechotoggle, 80},
{IT_STRING | IT_CVAR, NULL, "Show Localskin Menus", &cv_showlocalskinmenus, 85},
{IT_STRING | IT_CVAR, NULL, "Midnight Channel Flicker Effect", &cv_lessflicker, 95},
{IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 85},
{IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 90},
{IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 105},
{IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 110},
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 105}, // uwu
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 120}, // uwu
};
static const char* OP_SaturnTooltips[] =
@@ -2023,6 +2026,8 @@ static const char* OP_SaturnTooltips[] =
"Show the big 'LAP' text on a lap change.",
"Show player names on the minimap.",
"Minimize the player icons on the minimap.",
"Show the big Cecho Messages.",
"Show Localskin Menus.",
"Disables the flicker effect on Midnight Channel.",
"Options for player distortion effects.",
"Move position of HUD elements.",
@@ -4117,7 +4122,12 @@ void M_StartControlPanel(void)
// Reset these in case splitscreen messes things up
MPauseMenu[mpause_addons].alphaKey = 8;
MPauseMenu[mpause_addlocalskins].alphaKey = 24;
if (IsPlayerAdmin(consoleplayer))
MPauseMenu[mpause_addlocalskins].alphaKey = 8;
else
MPauseMenu[mpause_addlocalskins].alphaKey = 24;
MPauseMenu[mpause_scramble].alphaKey = 8;
MPauseMenu[mpause_switchmap].alphaKey = 24;
@@ -4432,10 +4442,10 @@ void M_Init(void)
if (snw_speedo && !kartzspeedo)
OP_SaturnMenu[sm_speedometer].text = "Speedometer (No PMeter)";
if (!clr_hud){ // uhguauhauguuhee
if (!clr_hud){ // uhguauhauguuhee
OP_SaturnMenu[sm_colorhud].status = IT_GRAYEDOUT;
OP_SaturnMenu[sm_coloritem].status = IT_GRAYEDOUT;
OP_SaturnMenu[sm_colorhud_customcolor].status = IT_GRAYEDOUT;
}
@@ -7773,6 +7783,8 @@ static void M_Options(INT32 choice)
OP_MainMenu[4].status = OP_MainMenu[5].status = (Playing() && !(server || IsPlayerAdmin(consoleplayer))) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU);
OP_MainMenu[8].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_CALL); // Play credits
OP_MainMenu[11].status = (!cv_showlocalskinmenus.value) ? (IT_DISABLED) : (IT_CALL|IT_STRING);
#ifdef HAVE_DISCORDRPC
OP_DataOptionsMenu[4].status = (Playing()) ? (IT_GRAYEDOUT) : (IT_STRING|IT_SUBMENU); // Erase data
@@ -7785,8 +7797,6 @@ static void M_Options(INT32 choice)
OP_MainDef.prevMenu = currentMenu;
M_SetupNextMenu(&OP_MainDef);
OP_MainMenu[11].status = ((Playing() &&(server &&(!IsPlayerAdmin(consoleplayer)))) || (!cv_showlocalskinmenus.value)) ? (IT_DISABLED) : (IT_CALL|IT_STRING);
}
static void M_Manual(INT32 choice)
@@ -10819,6 +10829,12 @@ static void M_ConnectMenuModChecks(INT32 choice)
boolean firstDismissedNagThisBoot = true;
#ifdef MASTERSERVER
enum {
CONNECT_MENU,
STARTSERVER_MENU,
} connect_error_continue = CONNECT_MENU;
static void M_HandleMasterServerResetChoice(event_t *ev)
{
INT32 choice = -1;
@@ -10847,6 +10863,18 @@ static void M_HandleMasterServerResetChoice(event_t *ev)
}
}
void M_PopupMasterServerConnectError(void)
{
if (!CV_IsSetToDefault(&cv_masterserver) && cv_masterserver_nagattempts.value > 0)
{
M_StartMessage(M_GetText("There was a problem connecting to\ncustom Master Server\n\nYou've changed the Server Browser address.\nUnless you're from the future, this probably isn't what you want.\n\n\x83Press Accel\x80 to fix this and continue.\n"), connect_error_continue == STARTSERVER_MENU ? M_PreStartServerMenuChoice : M_PreConnectMenuChoice,MM_EVENTHANDLER);
}
else
{
M_StartMessage(M_GetText("There was a problem connecting to\nthe Master Server\n\nCheck the console for details.\n"), NULL, MM_NOTHING);
}
}
#endif
static void M_PreStartServerMenu(INT32 choice)
@@ -10854,11 +10882,7 @@ static void M_PreStartServerMenu(INT32 choice)
(void)choice;
#ifdef MASTERSERVER
if (!CV_IsSetToDefault(&cv_masterserver) && cv_masterserver_nagattempts.value > 0)
{
M_StartMessage(M_GetText("Hey! You've changed the Server Browser address.\n\nYou won't be able to host games on the official Server Browser.\nUnless you're from the future, this probably isn't what you want.\n\n\x83Press Accel\x80 to fix this and continue.\x80\nPress any other key to continue anyway.\n"),M_PreStartServerMenuChoice,MM_EVENTHANDLER);
return;
}
connect_error_continue = STARTSERVER_MENU;
#endif
M_StartServerMenu(-1);
@@ -10867,13 +10891,7 @@ static void M_PreStartServerMenu(INT32 choice)
static void M_PreConnectMenu(INT32 choice)
{
(void)choice;
if (!CV_IsSetToDefault(&cv_masterserver) && cv_masterserver_nagattempts.value > 0)
{
M_StartMessage(M_GetText("Hey! You've changed the Server Browser address.\n\nYou won't be able to see games from the official Server Browser.\nUnless you're from the future, this probably isn't what you want.\n\n\x83Press Accel\x80 to fix this and continue.\x80\nPress any other key to continue anyway.\n"),M_PreConnectMenuChoice,MM_EVENTHANDLER);
return;
}
connect_error_continue = CONNECT_MENU;
M_ConnectMenuModChecks(-1);
}
+4
View File
@@ -285,6 +285,10 @@ INT32 HU_GetHighlightColor(void);
void M_PopupMasterServerRules(void);
#ifdef MASTERSERVER
void M_PopupMasterServerConnectError(void);
#endif
// These defines make it a little easier to make menus
#define DEFAULTMENUSTYLE(header, source, prev, x, y)\
{\
+1 -1
View File
@@ -140,7 +140,7 @@ static void WarnGUI (void)
#ifdef HAVE_THREADS
I_lock_mutex(&m_menu_mutex);
#endif
M_StartMessage(M_GetText("There was a problem connecting to\nthe Master Server\n\nCheck the console for details.\n"), NULL, MM_NOTHING);
M_PopupMasterServerConnectError();
#ifdef HAVE_THREADS
I_unlock_mutex(m_menu_mutex);
#endif
+3
View File
@@ -574,6 +574,9 @@ void Z_ChangeTag(void *ptr, INT32 tag)
I_Error("Internal memory management error: "
"tried to make block purgable but it has no owner");
// No, please, don't make my PU_STATIC patch NULL! It supposed to be always valid!
if (block->tag < 10) return;
block->tag = tag;
}