From c703bc2fd7823c170ec5c40e7f89b40b8c6b2c80 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 6 Aug 2018 22:37:44 +0100 Subject: [PATCH 001/138] Trim off any extra null bytes off the end of sector floorpic/ceiling when you access them in Lua --- src/lua_maplib.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 208aebe3..4e9dbd5a 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -327,6 +327,7 @@ static int sector_get(lua_State *L) { sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR)); enum sector_e field = luaL_checkoption(L, 2, sector_opt[0], sector_opt); + INT16 i; if (!sector) { @@ -349,11 +350,23 @@ static int sector_get(lua_State *L) lua_pushfixed(L, sector->ceilingheight); return 1; case sector_floorpic: // floorpic - lua_pushlstring(L, levelflats[sector->floorpic].name, 8); + { + levelflat_t *levelflat = &levelflats[sector->floorpic]; + for (i = 0; i < 8; i++) + if (!levelflat->name[i]) + break; + lua_pushlstring(L, levelflat->name, i); return 1; + } case sector_ceilingpic: // ceilingpic - lua_pushlstring(L, levelflats[sector->ceilingpic].name, 8); + { + levelflat_t *levelflat = &levelflats[sector->ceilingpic]; + for (i = 0; i < 8; i++) + if (!levelflat->name[i]) + break; + lua_pushlstring(L, levelflat->name, i); return 1; + } case sector_lightlevel: lua_pushinteger(L, sector->lightlevel); return 1; From 710550bb9dc3332e20dc3849161d6c1296b68d0e Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 26 Aug 2018 12:38:53 +0100 Subject: [PATCH 002/138] Missed one! --- src/v_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index 7541402a..aa2852c0 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -470,7 +470,7 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t { // same thing here if ((scrn & (V_SPLITSCREEN|V_SNAPTOBOTTOM)) == (V_SPLITSCREEN|V_SNAPTOBOTTOM)) - y += (vid.height/2 - (BASEVIDHEIGHT/2 * dupy)) * vid.width; + y += (vid.height/2 - (BASEVIDHEIGHT/2 * dupy)); else if (scrn & V_SNAPTOBOTTOM) y += (vid.height - (BASEVIDHEIGHT * dupy)); else if (!(scrn & V_SNAPTOTOP)) From 0f5d685d1f61c3db55b820dc56f3c46f4b2fecc8 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 30 Aug 2018 18:32:26 -0400 Subject: [PATCH 003/138] Only do this if the admin player isn't the server host also. --- src/d_netcmd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index bf26ca61..74212400 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2697,6 +2697,12 @@ static void Command_Login_f(void) XBOXSTATIC UINT8 finalmd5[16]; const char *pw; + if (!netgame) + { + CONS_Printf(M_GetText("This only works in a netgame.\n")); + return; + } + // If the server uses login, it will effectively just remove admin privileges // from whoever has them. This is good. if (COM_Argc() != 2) @@ -2764,6 +2770,12 @@ static void Command_Verify_f(void) return; } + if (!netgame) + { + CONS_Printf(M_GetText("This only works in a netgame.\n")); + return; + } + if (COM_Argc() != 2) { CONS_Printf(M_GetText("verify : give admin privileges to a node\n")); @@ -3075,7 +3087,7 @@ static void Command_Addfile(void) WRITEMEM(buf_p, md5sum, 16); } - if (adminplayer == consoleplayer) // Request to add file + if (adminplayer == consoleplayer && (!server)) // Request to add file SendNetXCmd(XD_REQADDFILE, buf, buf_p - buf); else SendNetXCmd(XD_ADDFILE, buf, buf_p - buf); From 322da62b3c1eb9bbab46adc344100b13b8fa602b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 31 Aug 2018 17:14:44 +0100 Subject: [PATCH 004/138] Fix HOM removal not working properly for non-green resolutions --- src/r_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_main.c b/src/r_main.c index e50e8001..f2a0c889 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1235,9 +1235,9 @@ void R_RenderPlayerView(player_t *player) if (cv_homremoval.value && player == &players[displayplayer]) // if this is display player 1 { if (cv_homremoval.value == 1) - V_DrawFill(0, 0, vid.width, vid.height, 31); // No HOM effect! + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); // No HOM effect! else //'development' HOM removal -- makes it blindingly obvious if HOM is spotted. - V_DrawFill(0, 0, vid.width, vid.height, 128+(timeinmap&15)); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 128+(timeinmap&15)); } // load previous saved value of skyVisible for the player From 24aafa6dacaa03a73674ef049ceeae102693438f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 3 Sep 2018 15:43:36 +0100 Subject: [PATCH 005/138] UDP_Socket: Add missing limit checks for s, for client and broadcast addresses --- src/i_tcp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/i_tcp.c b/src/i_tcp.c index 6488e984..5c660666 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -1044,7 +1044,7 @@ static boolean UDP_Socket(void) if (gaie == 0) { runp = ai; - while (runp != NULL) + while (runp != NULL && s < MAXNETNODES+1) { memcpy(&clientaddress[s], runp->ai_addr, runp->ai_addrlen); s++; @@ -1064,7 +1064,7 @@ static boolean UDP_Socket(void) if (gaie == 0) { runp = ai; - while (runp != NULL) + while (runp != NULL && s < MAXNETNODES+1) { memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen); s++; @@ -1087,7 +1087,7 @@ static boolean UDP_Socket(void) if (gaie == 0) { runp = ai; - while (runp != NULL) + while (runp != NULL && s < MAXNETNODES+1) { memcpy(&broadcastaddress[s], runp->ai_addr, runp->ai_addrlen); s++; From 846bddfdcf9514e8164bd1157c58ab2ac614ae8a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 3 Sep 2018 15:52:22 +0100 Subject: [PATCH 006/138] SOCK_Send: Fix what appears to be a mistaken use of i instead of j --- src/i_tcp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/i_tcp.c b/src/i_tcp.c index 5c660666..3b609914 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -707,10 +707,10 @@ static void SOCK_Send(void) { if (myfamily[i] == broadcastaddress[j].any.sa_family) { - if (broadcastaddress[i].any.sa_family == AF_INET) + if (broadcastaddress[j].any.sa_family == AF_INET) d = d4; #ifdef HAVE_IPV6 - else if (broadcastaddress[i].any.sa_family == AF_INET6) + else if (broadcastaddress[j].any.sa_family == AF_INET6) d = d6; #endif else From 7b083f07cd306ca8790427b0257ca1f06f7d3a3e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 3 Sep 2018 15:56:02 +0100 Subject: [PATCH 007/138] UDP_Socket: I doubt client addresses are meant to be included in the total for broadcast addresses --- src/i_tcp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/i_tcp.c b/src/i_tcp.c index 3b609914..d11be428 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -1059,6 +1059,9 @@ static boolean UDP_Socket(void) clientaddress[s].ip4.sin_addr.s_addr = htonl(INADDR_LOOPBACK); //GetLocalAddress(); // my own ip s++; } + + s = 0; + // setup broadcast adress to BROADCASTADDR entry gaie = I_getaddrinfo("255.255.255.255", "0", &hints, &ai); if (gaie == 0) From ea06e8a62b42d4e85112742ca668a7a6495beaf9 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 3 Sep 2018 20:53:40 +0100 Subject: [PATCH 008/138] SOCK_Send: Split the actual sending data parts into a new function, SOCK_SendToAddr, to make everything look a bit neater in general --- src/i_tcp.c | 59 ++++++++++++++++++----------------------------------- 1 file changed, 20 insertions(+), 39 deletions(-) diff --git a/src/i_tcp.c b/src/i_tcp.c index d11be428..16e7bf2f 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -686,14 +686,29 @@ static boolean SOCK_CanGet(void) #endif #ifndef NONET -static void SOCK_Send(void) +static inline ssize_t SOCK_SendToAddr(SOCKET_TYPE socket, mysockaddr_t *sockaddr) { - ssize_t c = ERRSOCKET; socklen_t d4 = (socklen_t)sizeof(struct sockaddr_in); #ifdef HAVE_IPV6 socklen_t d6 = (socklen_t)sizeof(struct sockaddr_in6); #endif socklen_t d, da = (socklen_t)sizeof(mysockaddr_t); + + switch (sockaddr->any.sa_family) + { + case AF_INET: d = d4; break; +#ifdef HAVE_IPV6 + case AF_INET6: d = d6; break; +#endif + default: d = da; break; + } + + return sendto(socket, (char *)&doomcom->data, doomcom->datalength, 0, &sockaddr->any, d); +} + +static void SOCK_Send(void) +{ + ssize_t c = ERRSOCKET; size_t i, j; if (!nodeconnected[doomcom->remotenode]) @@ -706,19 +721,7 @@ static void SOCK_Send(void) for (j = 0; j < broadcastaddresses; j++) { if (myfamily[i] == broadcastaddress[j].any.sa_family) - { - if (broadcastaddress[j].any.sa_family == AF_INET) - d = d4; -#ifdef HAVE_IPV6 - else if (broadcastaddress[j].any.sa_family == AF_INET6) - d = d6; -#endif - else - d = da; - - c = sendto(mysockets[i], (char *)&doomcom->data, doomcom->datalength, 0, - &broadcastaddress[j].any, d); - } + SOCK_SendToAddr(mysockets[i], &broadcastaddress[j]); } } return; @@ -728,35 +731,13 @@ static void SOCK_Send(void) for (i = 0; i < mysocketses; i++) { if (myfamily[i] == clientaddress[doomcom->remotenode].any.sa_family) - { - if (clientaddress[doomcom->remotenode].any.sa_family == AF_INET) - d = d4; -#ifdef HAVE_IPV6 - else if (clientaddress[doomcom->remotenode].any.sa_family == AF_INET6) - d = d6; -#endif - else - d = da; - - sendto(mysockets[i], (char *)&doomcom->data, doomcom->datalength, 0, - &clientaddress[doomcom->remotenode].any, d); - } + SOCK_SendToAddr(mysockets[i], &clientaddress[doomcom->remotenode]); } return; } else { - if (clientaddress[doomcom->remotenode].any.sa_family == AF_INET) - d = d4; -#ifdef HAVE_IPV6 - else if (clientaddress[doomcom->remotenode].any.sa_family == AF_INET6) - d = d6; -#endif - else - d = da; - - c = sendto(nodesocket[doomcom->remotenode], (char *)&doomcom->data, doomcom->datalength, 0, - &clientaddress[doomcom->remotenode].any, d); + c = SOCK_SendToAddr(nodesocket[doomcom->remotenode], &clientaddress[doomcom->remotenode]); } if (c == ERRSOCKET && errno != ECONNREFUSED && errno != EWOULDBLOCK) From c0bf79ad8e8230bb315035f6be7d93d137d3d176 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 9 Sep 2018 22:48:09 +0100 Subject: [PATCH 009/138] R_CreateColormap2 and R_MakeColormaps have been made obsolete, it's just R_CreateColormap now, like it used to be! With that, I moved R_CreateColormap2's exclusive software colormap malloc code to R_CreateColormap, and merged the two software-only blocks of code into one. I also disabled any unneeded variables and fixed a preprocessor-related goofup --- src/p_setup.c | 2 +- src/r_data.c | 88 +++++++++++++++++++++++++++++++++++++++------------ src/r_data.h | 4 +-- 3 files changed, 71 insertions(+), 23 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index d8c913e0..58170e26 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2673,7 +2673,7 @@ boolean P_SetupLevel(boolean skipprecip) P_CreateBlockMap(); // Graue 02-29-2004 P_LoadSideDefs2(lastloadedmaplumpnum + ML_SIDEDEFS); - R_MakeColormaps(); + //R_MakeColormaps(); P_LoadLineDefs2(); P_LoadSubsectors(lastloadedmaplumpnum + ML_SSECTORS); P_LoadNodes(lastloadedmaplumpnum + ML_NODES); diff --git a/src/r_data.c b/src/r_data.c index e1d4b893..2551a294 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1038,8 +1038,8 @@ void R_ReInitColormaps(UINT16 num) static lumpnum_t foundcolormaps[MAXCOLORMAPS]; -static char colormapFixingArray[MAXCOLORMAPS][3][9]; -static size_t carrayindex; +//static char colormapFixingArray[MAXCOLORMAPS][3][9]; +//static size_t carrayindex; // // R_ClearColormaps @@ -1052,7 +1052,7 @@ void R_ClearColormaps(void) num_extra_colormaps = 0; - carrayindex = 0; + //carrayindex = 0; for (i = 0; i < MAXCOLORMAPS; i++) foundcolormaps[i] = LUMPERROR; @@ -1110,7 +1110,7 @@ static int RoundUp(double number); INT32 R_CreateColormap(char *p1, char *p2, char *p3) { double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb; - double r, g, b, cbrightness, maskamt = 0, othermask = 0; + double maskamt = 0, othermask = 0; int mask, fog = 0; size_t mapnum = num_extra_colormaps; size_t i; @@ -1163,7 +1163,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) fadedist = fadeend - fadestart; fog = NUMFROMCHAR(p2[1]); } -#undef getnum +#undef NUMFROMCHAR if (p3[0] == '#') { @@ -1194,14 +1194,35 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) if (num_extra_colormaps == MAXCOLORMAPS) I_Error("R_CreateColormap: Too many colormaps! the limit is %d\n", MAXCOLORMAPS); - strncpy(colormapFixingArray[num_extra_colormaps][0], p1, 8); - strncpy(colormapFixingArray[num_extra_colormaps][1], p2, 8); - strncpy(colormapFixingArray[num_extra_colormaps][2], p3, 8); + //strncpy(colormapFixingArray[num_extra_colormaps][0], p1, 8); + //strncpy(colormapFixingArray[num_extra_colormaps][1], p2, 8); + //strncpy(colormapFixingArray[num_extra_colormaps][2], p3, 8); num_extra_colormaps++; + foundcolormaps[mapnum] = LUMPERROR; + + // aligned on 8 bit for asm code + extra_colormaps[mapnum].colormap = NULL; + extra_colormaps[mapnum].maskcolor = (UINT16)maskcolor; + extra_colormaps[mapnum].fadecolor = (UINT16)fadecolor; + extra_colormaps[mapnum].maskamt = maskamt; + extra_colormaps[mapnum].fadestart = (UINT16)fadestart; + extra_colormaps[mapnum].fadeend = (UINT16)fadeend; + extra_colormaps[mapnum].fog = fog; + + // This code creates the colormap array used by software renderer if (rendermode == render_soft) { + double r, g, b, cbrightness; + int p; + char *colormap_p; + + // Initialise the map and delta arrays + // map[i] stores an RGB color (as double) for index i, + // which is then converted to SRB2's palette later + // deltas[i] stores a corresponding fade delta between the RGB color and the final fade color; + // map[i]'s values are decremented by after each use for (i = 0; i < 256; i++) { r = pLocalPalette[i].s.red; @@ -1224,22 +1245,48 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) map[i][2] = 255.0l; deltas[i][2] = (map[i][2] - cdestb) / (double)fadedist; } + + // Now allocate memory for the actual colormap array itself! + colormap_p = Z_MallocAlign((256 * 34) + 10, PU_LEVEL, NULL, 8); + extra_colormaps[mapnum].colormap = (UINT8 *)colormap_p; + + // Calculate the palette index for each palette index, for each light level + // (as well as the two unused colormap lines we inherited from Doom) + for (p = 0; p < 34; p++) + { + for (i = 0; i < 256; i++) + { + *colormap_p = NearestColor((UINT8)RoundUp(map[i][0]), + (UINT8)RoundUp(map[i][1]), + (UINT8)RoundUp(map[i][2])); + colormap_p++; + + if ((UINT32)p < fadestart) + continue; +#define ABS2(x) ((x) < 0 ? -(x) : (x)) + if (ABS2(map[i][0] - cdestr) > ABS2(deltas[i][0])) + map[i][0] -= deltas[i][0]; + else + map[i][0] = cdestr; + + if (ABS2(map[i][1] - cdestg) > ABS2(deltas[i][1])) + map[i][1] -= deltas[i][1]; + else + map[i][1] = cdestg; + + if (ABS2(map[i][2] - cdestb) > ABS2(deltas[i][1])) + map[i][2] -= deltas[i][2]; + else + map[i][2] = cdestb; +#undef ABS2 + } + } } - foundcolormaps[mapnum] = LUMPERROR; - - // aligned on 8 bit for asm code - extra_colormaps[mapnum].colormap = NULL; - extra_colormaps[mapnum].maskcolor = (UINT16)maskcolor; - extra_colormaps[mapnum].fadecolor = (UINT16)fadecolor; - extra_colormaps[mapnum].maskamt = maskamt; - extra_colormaps[mapnum].fadestart = (UINT16)fadestart; - extra_colormaps[mapnum].fadeend = (UINT16)fadeend; - extra_colormaps[mapnum].fog = fog; - return (INT32)mapnum; } +/* void R_MakeColormaps(void) { size_t i; @@ -1310,7 +1357,7 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) fadedist = fadeend - fadestart; fog = NUMFROMCHAR(p2[1]); } -#undef getnum +#undef NUMFROMCHAR if (p3[0] == '#') { @@ -1419,6 +1466,7 @@ void R_CreateColormap2(char *p1, char *p2, char *p3) return; } +*/ // Thanks to quake2 source! // utils3/qdata/images.c diff --git a/src/r_data.h b/src/r_data.h index 1e9e0eb5..c1f2a73d 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -93,8 +93,8 @@ void R_ReInitColormaps(UINT16 num); void R_ClearColormaps(void); INT32 R_ColormapNumForName(char *name); INT32 R_CreateColormap(char *p1, char *p2, char *p3); -void R_CreateColormap2(char *p1, char *p2, char *p3); -void R_MakeColormaps(void); +//void R_CreateColormap2(char *p1, char *p2, char *p3); +//void R_MakeColormaps(void); const char *R_ColormapNameForNum(INT32 num); extern INT32 numtextures; From 40ff43682971987413b56721d03b5bd8a2daba9a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 10 Sep 2018 15:49:21 +0100 Subject: [PATCH 010/138] Remove commented out stuff, now I've confirmed everything works fine without them --- src/p_setup.c | 1 - src/r_data.c | 191 -------------------------------------------------- src/r_data.h | 2 - 3 files changed, 194 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 58170e26..17a6797f 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2673,7 +2673,6 @@ boolean P_SetupLevel(boolean skipprecip) P_CreateBlockMap(); // Graue 02-29-2004 P_LoadSideDefs2(lastloadedmaplumpnum + ML_SIDEDEFS); - //R_MakeColormaps(); P_LoadLineDefs2(); P_LoadSubsectors(lastloadedmaplumpnum + ML_SSECTORS); P_LoadNodes(lastloadedmaplumpnum + ML_NODES); diff --git a/src/r_data.c b/src/r_data.c index 2551a294..f2c9b146 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -1038,9 +1038,6 @@ void R_ReInitColormaps(UINT16 num) static lumpnum_t foundcolormaps[MAXCOLORMAPS]; -//static char colormapFixingArray[MAXCOLORMAPS][3][9]; -//static size_t carrayindex; - // // R_ClearColormaps // @@ -1052,8 +1049,6 @@ void R_ClearColormaps(void) num_extra_colormaps = 0; - //carrayindex = 0; - for (i = 0; i < MAXCOLORMAPS; i++) foundcolormaps[i] = LUMPERROR; @@ -1194,10 +1189,6 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) if (num_extra_colormaps == MAXCOLORMAPS) I_Error("R_CreateColormap: Too many colormaps! the limit is %d\n", MAXCOLORMAPS); - //strncpy(colormapFixingArray[num_extra_colormaps][0], p1, 8); - //strncpy(colormapFixingArray[num_extra_colormaps][1], p2, 8); - //strncpy(colormapFixingArray[num_extra_colormaps][2], p3, 8); - num_extra_colormaps++; foundcolormaps[mapnum] = LUMPERROR; @@ -1286,188 +1277,6 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3) return (INT32)mapnum; } -/* -void R_MakeColormaps(void) -{ - size_t i; - - carrayindex = num_extra_colormaps; - num_extra_colormaps = 0; - - for (i = 0; i < carrayindex; i++) - R_CreateColormap2(colormapFixingArray[i][0], colormapFixingArray[i][1], - colormapFixingArray[i][2]); -} - -void R_CreateColormap2(char *p1, char *p2, char *p3) -{ - double cmaskr, cmaskg, cmaskb, cdestr, cdestg, cdestb; - double r, g, b, cbrightness; - double maskamt = 0, othermask = 0; - int mask, p, fog = 0; - size_t mapnum = num_extra_colormaps; - size_t i; - char *colormap_p; - UINT32 cr, cg, cb, maskcolor, fadecolor; - UINT32 fadestart = 0, fadeend = 31, fadedist = 31; - -#define HEX2INT(x) (UINT32)(x >= '0' && x <= '9' ? x - '0' : x >= 'a' && x <= 'f' ? x - 'a' + 10 : x >= 'A' && x <= 'F' ? x - 'A' + 10 : 0) - if (p1[0] == '#') - { - cr = ((HEX2INT(p1[1]) * 16) + HEX2INT(p1[2])); - cmaskr = cr; - cg = ((HEX2INT(p1[3]) * 16) + HEX2INT(p1[4])); - cmaskg = cg; - cb = ((HEX2INT(p1[5]) * 16) + HEX2INT(p1[6])); - cmaskb = cb; - // Create a rough approximation of the color (a 16 bit color) - maskcolor = ((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11); - if (p1[7] >= 'a' && p1[7] <= 'z') - mask = (p1[7] - 'a'); - else if (p1[7] >= 'A' && p1[7] <= 'Z') - mask = (p1[7] - 'A'); - else - mask = 24; - - maskamt = (double)(mask/24.0l); - - othermask = 1 - maskamt; - maskamt /= 0xff; - cmaskr *= maskamt; - cmaskg *= maskamt; - cmaskb *= maskamt; - } - else - { - cmaskr = cmaskg = cmaskb = 0xff; - maskamt = 0; - maskcolor = ((0xff) >> 3) + (((0xff) >> 2) << 5) + (((0xff) >> 3) << 11); - } - -#define NUMFROMCHAR(c) (c >= '0' && c <= '9' ? c - '0' : 0) - if (p2[0] == '#') - { - // Get parameters like fadestart, fadeend, and the fogflag - fadestart = NUMFROMCHAR(p2[3]) + (NUMFROMCHAR(p2[2]) * 10); - fadeend = NUMFROMCHAR(p2[5]) + (NUMFROMCHAR(p2[4]) * 10); - if (fadestart > 30) - fadestart = 0; - if (fadeend > 31 || fadeend < 1) - fadeend = 31; - fadedist = fadeend - fadestart; - fog = NUMFROMCHAR(p2[1]); - } -#undef NUMFROMCHAR - - if (p3[0] == '#') - { - cdestr = cr = ((HEX2INT(p3[1]) * 16) + HEX2INT(p3[2])); - cdestg = cg = ((HEX2INT(p3[3]) * 16) + HEX2INT(p3[4])); - cdestb = cb = ((HEX2INT(p3[5]) * 16) + HEX2INT(p3[6])); - fadecolor = (((cb) >> 3) + (((cg) >> 2) << 5) + (((cr) >> 3) << 11)); - } - else - cdestr = cdestg = cdestb = fadecolor = 0; -#undef HEX2INT - - for (i = 0; i < num_extra_colormaps; i++) - { - if (foundcolormaps[i] != LUMPERROR) - continue; - if (maskcolor == extra_colormaps[i].maskcolor - && fadecolor == extra_colormaps[i].fadecolor - && (float)maskamt == (float)extra_colormaps[i].maskamt - && fadestart == extra_colormaps[i].fadestart - && fadeend == extra_colormaps[i].fadeend - && fog == extra_colormaps[i].fog) - { - return; - } - } - - if (num_extra_colormaps == MAXCOLORMAPS) - I_Error("R_CreateColormap: Too many colormaps! the limit is %d\n", MAXCOLORMAPS); - - num_extra_colormaps++; - - if (rendermode == render_soft) - { - for (i = 0; i < 256; i++) - { - r = pLocalPalette[i].s.red; - g = pLocalPalette[i].s.green; - b = pLocalPalette[i].s.blue; - cbrightness = sqrt((r*r) + (g*g) + (b*b)); - - map[i][0] = (cbrightness * cmaskr) + (r * othermask); - if (map[i][0] > 255.0l) - map[i][0] = 255.0l; - deltas[i][0] = (map[i][0] - cdestr) / (double)fadedist; - - map[i][1] = (cbrightness * cmaskg) + (g * othermask); - if (map[i][1] > 255.0l) - map[i][1] = 255.0l; - deltas[i][1] = (map[i][1] - cdestg) / (double)fadedist; - - map[i][2] = (cbrightness * cmaskb) + (b * othermask); - if (map[i][2] > 255.0l) - map[i][2] = 255.0l; - deltas[i][2] = (map[i][2] - cdestb) / (double)fadedist; - } - } - - foundcolormaps[mapnum] = LUMPERROR; - - // aligned on 8 bit for asm code - extra_colormaps[mapnum].colormap = NULL; - extra_colormaps[mapnum].maskcolor = (UINT16)maskcolor; - extra_colormaps[mapnum].fadecolor = (UINT16)fadecolor; - extra_colormaps[mapnum].maskamt = maskamt; - extra_colormaps[mapnum].fadestart = (UINT16)fadestart; - extra_colormaps[mapnum].fadeend = (UINT16)fadeend; - extra_colormaps[mapnum].fog = fog; - -#define ABS2(x) ((x) < 0 ? -(x) : (x)) - if (rendermode == render_soft) - { - colormap_p = Z_MallocAlign((256 * 34) + 10, PU_LEVEL, NULL, 8); - extra_colormaps[mapnum].colormap = (UINT8 *)colormap_p; - - for (p = 0; p < 34; p++) - { - for (i = 0; i < 256; i++) - { - *colormap_p = NearestColor((UINT8)RoundUp(map[i][0]), - (UINT8)RoundUp(map[i][1]), - (UINT8)RoundUp(map[i][2])); - colormap_p++; - - if ((UINT32)p < fadestart) - continue; - - if (ABS2(map[i][0] - cdestr) > ABS2(deltas[i][0])) - map[i][0] -= deltas[i][0]; - else - map[i][0] = cdestr; - - if (ABS2(map[i][1] - cdestg) > ABS2(deltas[i][1])) - map[i][1] -= deltas[i][1]; - else - map[i][1] = cdestg; - - if (ABS2(map[i][2] - cdestb) > ABS2(deltas[i][1])) - map[i][2] -= deltas[i][2]; - else - map[i][2] = cdestb; - } - } - } -#undef ABS2 - - return; -} -*/ - // Thanks to quake2 source! // utils3/qdata/images.c static UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b) diff --git a/src/r_data.h b/src/r_data.h index c1f2a73d..a656e5db 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -93,8 +93,6 @@ void R_ReInitColormaps(UINT16 num); void R_ClearColormaps(void); INT32 R_ColormapNumForName(char *name); INT32 R_CreateColormap(char *p1, char *p2, char *p3); -//void R_CreateColormap2(char *p1, char *p2, char *p3); -//void R_MakeColormaps(void); const char *R_ColormapNameForNum(INT32 num); extern INT32 numtextures; From d26ba2ee5451bb53bf15384b1ad7af12ecd665ff Mon Sep 17 00:00:00 2001 From: PrisimaTheFox Date: Sun, 9 Sep 2018 23:16:28 -0500 Subject: [PATCH 011/138] Update m_anigif.c More accurate GIF delay. --- src/m_anigif.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index 2540665a..5c7cfbd6 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -492,7 +492,9 @@ static void GIF_framewrite(void) // screen regions are handled in GIF_lzw { - UINT16 delay = 3; // todo + int d1 = (int)((100.0/NEWTICRATE)*gif_frames); + int d2 = (int)((100.0/NEWTICRATE)*(gif_frames-1)); + UINT16 delay = d1-d2; INT32 startline; WRITEMEM(p, gifframe_gchead, 4); From 4ada0b0a9e42f5b3b71cf509bc66f7881104b4aa Mon Sep 17 00:00:00 2001 From: PrisimaTheFox Date: Sun, 9 Sep 2018 23:33:51 -0500 Subject: [PATCH 012/138] Update m_anigif.c Remember gif_frames starts at 0 --- src/m_anigif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index 5c7cfbd6..d46d889b 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -492,8 +492,8 @@ static void GIF_framewrite(void) // screen regions are handled in GIF_lzw { - int d1 = (int)((100.0/NEWTICRATE)*gif_frames); - int d2 = (int)((100.0/NEWTICRATE)*(gif_frames-1)); + int d1 = (int)((100.0/NEWTICRATE)*gif_frames+1); + int d2 = (int)((100.0/NEWTICRATE)*(gif_frames)); UINT16 delay = d1-d2; INT32 startline; From c32c72c401b16d15184b1821cb52ff9e80717910 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Fri, 7 Sep 2018 18:14:52 -0400 Subject: [PATCH 013/138] Thwomp fix: Don't trigger (look for players) when ~FF_EXISTS --- src/p_floor.c | 44 ++++++++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 14 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index f3063765..f3dda23b 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1818,6 +1818,7 @@ void T_ThwompSector(levelspecthink_t *thwomp) #define ceilingwasheight vars[5] fixed_t thwompx, thwompy; sector_t *actionsector; + ffloor_t *rover = NULL; INT32 secnum; // If you just crashed down, wait a second before coming back up. @@ -1832,7 +1833,16 @@ void T_ThwompSector(levelspecthink_t *thwomp) secnum = P_FindSectorFromTag((INT16)thwomp->vars[0], -1); if (secnum > 0) + { actionsector = §ors[secnum]; + + // Look for thwomp FFloor + for (rover = actionsector->ffloors; rover; rover = rover->next) + { + if (rover->master == thwomp->sourceline) + break; + } + } else return; // Bad bad bad! @@ -1921,10 +1931,13 @@ void T_ThwompSector(levelspecthink_t *thwomp) { mobj_t *mp = (void *)&actionsector->soundorg; - if (thwomp->sourceline->flags & ML_EFFECT4) - S_StartSound(mp, sides[thwomp->sourceline->sidenum[0]].textureoffset>>FRACBITS); - else - S_StartSound(mp, sfx_thwomp); + if (!rover || (rover->flags & FF_EXISTS)) + { + if (thwomp->sourceline->flags & ML_EFFECT4) + S_StartSound(mp, sides[thwomp->sourceline->sidenum[0]].textureoffset>>FRACBITS); + else + S_StartSound(mp, sfx_thwomp); + } thwomp->direction = 1; // start heading back up thwomp->distance = TICRATE; // but only after a small delay @@ -1938,18 +1951,21 @@ void T_ThwompSector(levelspecthink_t *thwomp) thinker_t *th; mobj_t *mo; - // scan the thinkers to find players! - for (th = thinkercap.next; th != &thinkercap; th = th->next) + if (!rover || (rover->flags & FF_EXISTS)) { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - mo = (mobj_t *)th; - if (mo->type == MT_PLAYER && mo->health && mo->z <= thwomp->sector->ceilingheight - && P_AproxDistance(thwompx - mo->x, thwompy - mo->y) <= 96*FRACUNIT) + // scan the thinkers to find players! + for (th = thinkercap.next; th != &thinkercap; th = th->next) { - thwomp->direction = -1; - break; + if (th->function.acp1 != (actionf_p1)P_MobjThinker) + continue; + + mo = (mobj_t *)th; + if (mo->type == MT_PLAYER && mo->health && mo->z <= thwomp->sector->ceilingheight + && P_AproxDistance(thwompx - mo->x, thwompy - mo->y) <= 96*FRACUNIT) + { + thwomp->direction = -1; + break; + } } } From 89a6694d6743375e3dbaaabfec48f7e12d1f9cfb Mon Sep 17 00:00:00 2001 From: Digiku Date: Thu, 13 Sep 2018 11:30:00 -0400 Subject: [PATCH 014/138] Don't trigger thwomp on spectators --- src/p_floor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_floor.c b/src/p_floor.c index f3dda23b..e613b5ed 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1960,7 +1960,8 @@ void T_ThwompSector(levelspecthink_t *thwomp) continue; mo = (mobj_t *)th; - if (mo->type == MT_PLAYER && mo->health && mo->z <= thwomp->sector->ceilingheight + if (mo->type == MT_PLAYER && mo->health && mo->player && !mo->player->spectator + && mo->z <= thwomp->sector->ceilingheight && P_AproxDistance(thwompx - mo->x, thwompy - mo->y) <= 96*FRACUNIT) { thwomp->direction = -1; From 546fa383c1c74499552e031b11020ed71a6d8561 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 14 Sep 2018 21:01:07 +0100 Subject: [PATCH 015/138] Make sure that T_MarioBlockChecker is synced in netgames, so that the textures of Mario Blocks can change when there are no more items --- src/p_saveg.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/p_saveg.c b/src/p_saveg.c index d1ec8e5a..6e0c704f 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -950,6 +950,7 @@ typedef enum tc_bouncecheese, tc_startcrumble, tc_marioblock, + tc_marioblockchecker, tc_spikesector, tc_floatsector, tc_bridgethinker, @@ -1774,6 +1775,11 @@ static void P_NetArchiveThinkers(void) SaveSpecialLevelThinker(th, tc_marioblock); continue; } + else if (th->function.acp1 == (actionf_p1)T_MarioBlockChecker) + { + SaveSpecialLevelThinker(th, tc_marioblockchecker); + continue; + } else if (th->function.acp1 == (actionf_p1)T_SpikeSector) { SaveSpecialLevelThinker(th, tc_spikesector); @@ -2730,6 +2736,10 @@ static void P_NetUnArchiveThinkers(void) LoadSpecialLevelThinker((actionf_p1)T_MarioBlock, 3); break; + case tc_marioblockchecker: + LoadSpecialLevelThinker((actionf_p1)T_MarioBlockChecker, 0); + break; + case tc_spikesector: LoadSpecialLevelThinker((actionf_p1)T_SpikeSector, 0); break; From 1b7b1f3f796eb08385f86e817b4486ec3a25361a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 16 Sep 2018 20:25:07 +0100 Subject: [PATCH 016/138] Fix order of operations messups by adding brackets --- src/m_anigif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index d46d889b..e2af7009 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -492,7 +492,7 @@ static void GIF_framewrite(void) // screen regions are handled in GIF_lzw { - int d1 = (int)((100.0/NEWTICRATE)*gif_frames+1); + int d1 = (int)((100.0/NEWTICRATE)*(gif_frames+1)); int d2 = (int)((100.0/NEWTICRATE)*(gif_frames)); UINT16 delay = d1-d2; INT32 startline; From 20c4702986f6f3f99d30bf3efe19a10bc13141cc Mon Sep 17 00:00:00 2001 From: mazmazz Date: Mon, 17 Sep 2018 14:12:16 -0400 Subject: [PATCH 017/138] Line exec trigger netsync: Save var2s in addition to vars --- src/p_saveg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_saveg.c b/src/p_saveg.c index 6e0c704f..6010a1d2 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1260,7 +1260,10 @@ static void SaveSpecialLevelThinker(const thinker_t *th, const UINT8 type) size_t i; WRITEUINT8(save_p, type); for (i = 0; i < 16; i++) + { WRITEFIXED(save_p, ht->vars[i]); //var[16] + WRITEFIXED(save_p, ht->var2s[i]); //var[16] + } WRITEUINT32(save_p, SaveLine(ht->sourceline)); WRITEUINT32(save_p, SaveSector(ht->sector)); } @@ -2163,7 +2166,10 @@ static void LoadSpecialLevelThinker(actionf_p1 thinker, UINT8 floorOrCeiling) size_t i; ht->thinker.function.acp1 = thinker; for (i = 0; i < 16; i++) + { ht->vars[i] = READFIXED(save_p); //var[16] + ht->var2s[i] = READFIXED(save_p); //var[16] + } ht->sourceline = LoadLine(READUINT32(save_p)); ht->sector = LoadSector(READUINT32(save_p)); From a53f036149a4ff1d7c9371f9f082fbfe5b65a5b7 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 20 Sep 2018 18:26:59 -0400 Subject: [PATCH 018/138] Use MemAvailable instead --- src/sdl/i_system.c | 49 +++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index e86a39ca..984f6dd2 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -124,6 +124,10 @@ typedef LPVOID (WINAPI *p_MapViewOfFile) (HANDLE, DWORD, DWORD, DWORD, SIZE_T); #include "macosx/mac_resources.h" #endif +#ifndef errno +#include +#endif + // Locations for searching the srb2.srb #if defined (__unix__) || defined(__APPLE__) || defined (UNIXCOMMON) #define DEFAULTWADLOCATION1 "/usr/local/share/games/SRB2" @@ -2712,9 +2716,31 @@ const char *I_LocateWad(void) #ifdef __linux__ #define MEMINFO_FILE "/proc/meminfo" #define MEMTOTAL "MemTotal:" +#define MEMAVAILABLE "MemAvailable:" #define MEMFREE "MemFree:" +#define CACHED "Cached:" +#define BUFFERS "Buffers:" +#define SHMEM "Shmem:" #endif +/* Parse the contents of /proc/meminfo (in buf), return value of "name" + * (example: MemTotal) */ +static long get_entry(const char* name, const char* buf) +{ + char* hit = strstr(buf, name); + if (hit == NULL) { + return -1; + } + + errno = 0; + long val = strtol(hit + strlen(name), NULL, 10); + if (errno != 0) { + CONS_Alert(CONS_ERROR, M_GetText("get_entry: strtol() failed: %s\n"), strerror(errno)); + return -1; + } + return val; +} + // quick fix for compil UINT32 I_GetFreeMem(UINT32 *total) { @@ -2809,7 +2835,17 @@ UINT32 I_GetFreeMem(UINT32 *total) memTag += sizeof (MEMTOTAL); totalKBytes = atoi(memTag); - if ((memTag = strstr(buf, MEMFREE)) == NULL) + if ((memTag = strstr(buf, MEMAVAILABLE)) == NULL) + { + Cached = get_entry(CACHED, buf); + MemFree = get_entry(MEMFREE, buf); + Buffers = get_entry(BUFFERS, buf); + Shmem = get_entry(SHMEM, buf); + MemAvailable = Cached + MemFree + Buffers - Shmem; + guessed = true; + } + + if (MemAvailable == -1 && guessed) { // Error if (total) @@ -2817,8 +2853,15 @@ UINT32 I_GetFreeMem(UINT32 *total) return 0; } - memTag += sizeof (MEMFREE); - freeKBytes = atoi(memTag); + if (guessed) + { + freeKBytes = MemAvailable; + } + else + { + memTag += sizeof (MEMAVAILABLE); + freeKBytes = atoi(memTag); + } if (total) *total = totalKBytes << 10; From 378495cb2b8337c37b6bfefc3f510cf9b6117e61 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 20 Sep 2018 18:33:50 -0400 Subject: [PATCH 019/138] Add some stuff --- src/sdl/i_system.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 984f6dd2..3610a534 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -2810,6 +2810,12 @@ UINT32 I_GetFreeMem(UINT32 *total) UINT32 totalKBytes; INT32 n; INT32 meminfo_fd = -1; + long Cached; + long MemFree; + long Buffers; + long Shmem; + long MemAvailable = -1; + boolean guessed = false; // Stupid way to verify if the amount was guessed or not. meminfo_fd = open(MEMINFO_FILE, O_RDONLY); n = read(meminfo_fd, buf, 1023); From be74b4e58b93974bc56a7f96f3f175b541b04230 Mon Sep 17 00:00:00 2001 From: Steel Date: Fri, 21 Sep 2018 07:16:54 -0400 Subject: [PATCH 020/138] Fix up errors with buildbots --- src/sdl/i_system.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 3610a534..e9e1ae92 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1,6 +1,6 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- -// +- // // Copyright (C) 1993-1996 by id Software, Inc. // Portions Copyright (C) 1998-2000 by DooM Legacy Team. // @@ -2095,7 +2095,6 @@ INT32 I_StartupSystem(void) return 0; } - // // I_Quit // @@ -2721,25 +2720,26 @@ const char *I_LocateWad(void) #define CACHED "Cached:" #define BUFFERS "Buffers:" #define SHMEM "Shmem:" -#endif /* Parse the contents of /proc/meminfo (in buf), return value of "name" * (example: MemTotal) */ static long get_entry(const char* name, const char* buf) { + long val; char* hit = strstr(buf, name); if (hit == NULL) { return -1; } errno = 0; - long val = strtol(hit + strlen(name), NULL, 10); + val = strtol(hit + strlen(name), NULL, 10); if (errno != 0) { CONS_Alert(CONS_ERROR, M_GetText("get_entry: strtol() failed: %s\n"), strerror(errno)); return -1; } return val; } +#endif // quick fix for compil UINT32 I_GetFreeMem(UINT32 *total) From af58ba9ae3fa661ea406bca3b134ae2ac6b76a2c Mon Sep 17 00:00:00 2001 From: Steel Date: Fri, 21 Sep 2018 07:21:49 -0400 Subject: [PATCH 021/138] Remove this that somehow slipped in. --- src/sdl/i_system.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index e9e1ae92..b7326b06 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1,6 +1,6 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- -- // +// // Copyright (C) 1993-1996 by id Software, Inc. // Portions Copyright (C) 1998-2000 by DooM Legacy Team. // From 68ec8119096c3744e25115337fd03ea3e124df2a Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 21 Sep 2018 11:26:08 -0400 Subject: [PATCH 022/138] Rearrange the code. Thanks again MonsterIestyn! --- src/sdl/i_system.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index b7326b06..05d9e092 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -2815,7 +2815,6 @@ UINT32 I_GetFreeMem(UINT32 *total) long Buffers; long Shmem; long MemAvailable = -1; - boolean guessed = false; // Stupid way to verify if the amount was guessed or not. meminfo_fd = open(MEMINFO_FILE, O_RDONLY); n = read(meminfo_fd, buf, 1023); @@ -2848,26 +2847,21 @@ UINT32 I_GetFreeMem(UINT32 *total) Buffers = get_entry(BUFFERS, buf); Shmem = get_entry(SHMEM, buf); MemAvailable = Cached + MemFree + Buffers - Shmem; - guessed = true; - } - if (MemAvailable == -1 && guessed) - { - // Error - if (total) - *total = 0L; - return 0; - } - - if (guessed) - { + if (MemAvailable == -1) + { + // Error + if (total) + *total = 0L; + return 0; + } freeKBytes = MemAvailable; - } - else - { + } + else + { memTag += sizeof (MEMAVAILABLE); freeKBytes = atoi(memTag); - } + } if (total) *total = totalKBytes << 10; From f88708bb75810e5ef089b5cf5246d3a2f9154d02 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Fri, 21 Sep 2018 12:05:52 -0400 Subject: [PATCH 023/138] Fix the weird indentation --- src/sdl/i_system.c | 76 +++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 05d9e092..f92cd4b6 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1683,7 +1683,7 @@ static void I_ShutdownMouse2(void) EscapeCommFunction(mouse2filehandle, CLRRTS); PurgeComm(mouse2filehandle, PURGE_TXABORT | PURGE_RXABORT | - PURGE_TXCLEAR | PURGE_RXCLEAR); + PURGE_TXCLEAR | PURGE_RXCLEAR); CloseHandle(mouse2filehandle); @@ -1876,11 +1876,11 @@ void I_StartupMouse2(void) { // COM file handle mouse2filehandle = CreateFileA(cv_mouse2port.string, GENERIC_READ | GENERIC_WRITE, - 0, // exclusive access - NULL, // no security attrs - OPEN_EXISTING, - FILE_ATTRIBUTE_NORMAL, - NULL); + 0, // exclusive access + NULL, // no security attrs + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL, + NULL); if (mouse2filehandle == INVALID_HANDLE_VALUE) { INT32 e = GetLastError(); @@ -1900,7 +1900,7 @@ void I_StartupMouse2(void) // purge buffers PurgeComm(mouse2filehandle, PURGE_TXABORT | PURGE_RXABORT - | PURGE_TXCLEAR | PURGE_RXCLEAR); + | PURGE_TXCLEAR | PURGE_RXCLEAR); // setup port to 1200 7N1 dcb.DCBlength = sizeof (DCB); @@ -2029,7 +2029,7 @@ static void I_ShutdownTimer(void) tic_t I_GetTime (void) { static Uint32 basetime = 0; - Uint32 ticks = SDL_GetTicks(); + Uint32 ticks = SDL_GetTicks(); if (!basetime) basetime = ticks; @@ -2373,7 +2373,7 @@ void I_GetDiskFreeSpace(INT64 *freespace) { DWORD SectorsPerCluster, BytesPerSector, NumberOfFreeClusters, TotalNumberOfClusters; GetDiskFreeSpace(NULL, &SectorsPerCluster, &BytesPerSector, - &NumberOfFreeClusters, &TotalNumberOfClusters); + &NumberOfFreeClusters, &TotalNumberOfClusters); *freespace = BytesPerSector*SectorsPerCluster*NumberOfFreeClusters; } #else // Dummy for platform independent; 1GB should be enough @@ -2595,22 +2595,22 @@ static const char *locateWad(void) #ifdef CMAKECONFIG #ifndef NDEBUG - I_OutputMsg(","CMAKE_ASSETS_DIR); - strcpy(returnWadPath, CMAKE_ASSETS_DIR); - if (isWadPathOk(returnWadPath)) - { - return returnWadPath; - } + I_OutputMsg(","CMAKE_ASSETS_DIR); + strcpy(returnWadPath, CMAKE_ASSETS_DIR); + if (isWadPathOk(returnWadPath)) + { + return returnWadPath; + } #endif #endif #ifdef __APPLE__ - OSX_GetResourcesPath(returnWadPath); - I_OutputMsg(",%s", returnWadPath); - if (isWadPathOk(returnWadPath)) - { - return returnWadPath; - } + OSX_GetResourcesPath(returnWadPath); + I_OutputMsg(",%s", returnWadPath); + if (isWadPathOk(returnWadPath)) + { + return returnWadPath; + } #endif // examine default dirs @@ -2725,19 +2725,19 @@ const char *I_LocateWad(void) * (example: MemTotal) */ static long get_entry(const char* name, const char* buf) { - long val; - char* hit = strstr(buf, name); - if (hit == NULL) { - return -1; - } + long val; + char* hit = strstr(buf, name); + if (hit == NULL) { + return -1; + } - errno = 0; - val = strtol(hit + strlen(name), NULL, 10); - if (errno != 0) { - CONS_Alert(CONS_ERROR, M_GetText("get_entry: strtol() failed: %s\n"), strerror(errno)); - return -1; - } - return val; + errno = 0; + val = strtol(hit + strlen(name), NULL, 10); + if (errno != 0) { + CONS_Alert(CONS_ERROR, M_GetText("get_entry: strtol() failed: %s\n"), strerror(errno)); + return -1; + } + return val; } #endif @@ -2850,18 +2850,18 @@ UINT32 I_GetFreeMem(UINT32 *total) if (MemAvailable == -1) { - // Error + // Error if (total) *total = 0L; return 0; } freeKBytes = MemAvailable; - } - else - { + } + else + { memTag += sizeof (MEMAVAILABLE); freeKBytes = atoi(memTag); - } + } if (total) *total = totalKBytes << 10; From 3949d0fcdba173b3593a7c86aa72604794b92f42 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 22 Sep 2018 22:22:44 -0400 Subject: [PATCH 024/138] Obvious first commit: enable the NOCLIPCAM define again --- src/doomdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index b5519f6f..31eb1877 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -546,6 +546,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// SRB2Kart: Camera always has noclip. /// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes. -//#define NOCLIPCAM +#define NOCLIPCAM #endif // __DOOMDEF__ From 9f42e74fe2db52fbe18e28675feb9034ad80d18b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 22 Sep 2018 22:46:06 -0400 Subject: [PATCH 025/138] Attempt to not let the camera into thok barriers Doesn't really work right now; it'll still go into thok barriers and get caught up at its floor height --- src/p_map.c | 19 ++++++++++++++----- src/p_mobj.c | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 41d61cb0..e9d38272 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2181,6 +2181,12 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) mapcampointer = thiscam; +#ifdef NOCLIPCAM + if (newsubsec->sector->floorheight >= newsubsec->sector->ceilingheight + || newsubsec->sector->ceilingheight <= newsubsec->sector->floorheight) + return false; +#endif + if (GETSECSPECIAL(newsubsec->sector->special, 4) == 12) { // Camera noclip on entire sector. tmfloorz = tmdropoffz = thiscam->z; @@ -2378,12 +2384,15 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam) fixed_t tryx = thiscam->x; fixed_t tryy = thiscam->y; -#ifndef NOCLIPCAM +#ifdef NOCLIPCAM + if (!(s->sector->floorheight >= s->sector->ceilingheight + || s->sector->ceilingheight <= s->sector->floorheight)) +#else if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) - || (leveltime < introtime)) + || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) + || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) + || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) + || (leveltime < introtime)) #endif { // Noclipping player camera noclips too!! floatok = true; diff --git a/src/p_mobj.c b/src/p_mobj.c index d39e3876..233b307f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3701,6 +3701,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled { if (!P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y + thiscam->momy, thiscam)) { // Never fails for 2D mode. +#ifndef NOCLIPCAM mobj_t dummy; dummy.thinker.function.acp1 = (actionf_p1)P_MobjThinker; dummy.subsector = thiscam->subsector; @@ -3711,6 +3712,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead. P_ResetCamera(player, thiscam); else +#endif P_SlideCameraMove(thiscam); if (resetcalled) // Okay this means the camera is fully reset. return true; From a85682983bc0dacc52af79d5e34f0ee5c6ae8ff7 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 25 Sep 2018 22:33:22 +0100 Subject: [PATCH 026/138] Manual has more pages and less terrible large-size support. --- src/m_menu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 5d0448ce..071fdc42 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -663,7 +663,8 @@ static menuitem_t MISC_HelpMenu[] = {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL09", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL10", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL11", M_HandleImageDef, 1}, - {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 0}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL99", M_HandleImageDef, 0}, }; // -------------------------------- @@ -4264,7 +4265,7 @@ static void M_DrawImageDef(void) else { patch_t *patch = W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE); - if (patch->width <= BASEVIDWIDTH) + if (patch->height <= BASEVIDHEIGHT) V_DrawScaledPatch(0,0,0,patch); else V_DrawSmallScaledPatch(0,0,0,patch); From 8aff76b8c301861edb0f574b17d1d41b539fd6a0 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 25 Sep 2018 22:37:04 +0100 Subject: [PATCH 027/138] Just realised the inputwheel jittering in Sryder's videos was my fault, so fix this even better --- src/k_kart.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index ed91616b..f4b9e93a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7096,10 +7096,7 @@ static void K_drawInput(void) } if (pn < 0) - { splitflags |= V_FLIP; // right turn - x--; - } target = abs(pn); if (target > 4) From a223375cc0fa0af051b9eb8cdf7ffa5fe13e55e7 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 26 Sep 2018 20:40:26 -0400 Subject: [PATCH 028/138] Remove the commented out SALLYALTRAINBOW define The relative luminance tweak fixes what it was meant to fix, but without changing the core functionality --- src/k_kart.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index ed91616b..c2a678d3 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -256,8 +256,6 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { */ }; -//#define SALLYALTRAINBOW // Sal's edited version of the below, which keeps a colors' lightness, and looks better with hue-shifted colors like Ruby & Dream. Not strictly *better*, just different... - // Define for getting accurate color brightness readings according to how the human eye sees them. // https://en.wikipedia.org/wiki/Relative_luminance // 0.2126 to red @@ -277,7 +275,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) INT32 i; RGBA_t color; UINT8 brightness; -#ifndef SALLYALTRAINBOW INT32 j; UINT8 colorbrightnesses[16]; UINT16 brightdif; @@ -289,7 +286,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) color = V_GetColor(colortranslations[skincolor][i]); SETBRIGHTNESS(colorbrightnesses[i], color.s.red, color.s.green, color.s.blue); } -#endif // next, for every colour in the palette, choose the transcolor that has the closest brightness for (i = 0; i < NUM_PALETTE_ENTRIES; i++) @@ -301,10 +297,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) } color = V_GetColor(i); SETBRIGHTNESS(brightness, color.s.red, color.s.green, color.s.blue); -#ifdef SALLYALTRAINBOW - brightness = 15-(brightness/16); // Yes, 15. - dest_colormap[i] = colortranslations[skincolor][brightness]; -#else brightdif = 256; for (j = 0; j < 16; j++) { @@ -315,7 +307,6 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor) dest_colormap[i] = colortranslations[skincolor][j]; } } -#endif } } From 1a37335675f7fe6f3c645af2bc986354b0a57003 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 26 Sep 2018 20:51:25 -0400 Subject: [PATCH 029/138] ESC rebind works on both bound keys --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 5d0448ce..72773580 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2547,7 +2547,7 @@ boolean M_Responder(event_t *ev) if (ch == -1) return false; - else if (ch == gamecontrol[gc_systemmenu][0]) // allow remappable ESC key + else if (ch == gamecontrol[gc_systemmenu][0] || ch == gamecontrol[gc_systemmenu][1]) // allow remappable ESC key ch = KEY_ESCAPE; // F-Keys From 3d582bc98f10c654b3d9c8850a1a1ee70f712e2c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 26 Sep 2018 21:35:57 -0400 Subject: [PATCH 030/138] Viewpoint key improvements - Don't cycle through exiting players - Don't cycle through karma players in Battle - Disable console print on switch, it's already got a HUD element --- src/g_game.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index e501fa56..7edd7725 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1831,6 +1831,7 @@ boolean G_Responder(event_t *ev) if (players[displayplayer].spectator) continue; + // SRB2Kart: we have no team-based modes, YET... /*if (G_GametypeHasTeams()) { if (players[consoleplayer].ctfteam @@ -1855,12 +1856,16 @@ boolean G_Responder(event_t *ev) continue; }*/ - // SRB2Kart: Ehhh, who cares, Mario Kart's designed around screen-cheating anyway - /*if (gametype != GT_RACE) + // SRB2Kart: Only go through players who are actually playing + if (players[displayplayer].exiting) + continue; + + // I don't know if we want this actually, but I'll humor the suggestion anyway + if (G_BattleGametype()) { - if (players[consoleplayer].kartstuff[k_bumper] > 0) + if (players[displayplayer].kartstuff[k_bumper] <= 0) continue; - }*/ + } break; } while (displayplayer != consoleplayer); @@ -1869,10 +1874,6 @@ boolean G_Responder(event_t *ev) if (singledemo) ST_changeDemoView(); - // tell who's the view - CONS_Printf(M_GetText("Viewpoint: %s\n"), player_names[displayplayer]); - P_ResetCamera(&players[displayplayer], &camera); - return true; } } From e4f6015b50a3d9e8ef01f73340504364afd6692c Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 27 Sep 2018 18:11:43 +0100 Subject: [PATCH 031/138] Revamp flat alignment to be consistent across all renderer functions except for the software slope renderer, which me and fickle tried our best at but couldn't get to work. (This is a backport of 2.2 code that slightly postdates the improved flat alignment Kart's had for a while.) This fixes #11. --- src/hardware/hw_main.c | 18 ++++---- src/p_spec.c | 6 +-- src/r_bsp.c | 44 +++----------------- src/r_plane.c | 93 ++++++++++++++++++++++++++++++++++-------- 4 files changed, 94 insertions(+), 67 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 6a664d39..54362762 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -643,13 +643,13 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is { scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize; - angle = FOFsector->floorpic_angle>>ANGLETOFINESHIFT; + angle = FOFsector->floorpic_angle; } else // it's a ceiling { scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatsize; - angle = FOFsector->ceilingpic_angle>>ANGLETOFINESHIFT; + angle = FOFsector->ceilingpic_angle; } } else if (gr_frontsector) @@ -658,24 +658,26 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is { scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize; - angle = gr_frontsector->floorpic_angle>>ANGLETOFINESHIFT; + angle = gr_frontsector->floorpic_angle; } else // it's a ceiling { scrollx = FIXED_TO_FLOAT(gr_frontsector->ceiling_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->ceiling_yoffs)/fflatsize; - angle = gr_frontsector->ceilingpic_angle>>ANGLETOFINESHIFT; + angle = gr_frontsector->ceilingpic_angle; } } if (angle) // Only needs to be done if there's an altered angle { + 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); + /*tempxsow = FLOAT_TO_FIXED(scrollx); tempytow = FLOAT_TO_FIXED(scrolly); scrollx = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); - scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle)))); + scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));*/ // This needs to be done so everything aligns after rotation // It would be done so that rotation is done, THEN the translation, but I couldn't get it to rotate AND scroll like software does @@ -689,7 +691,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is { // Hurdler: add scrolling texture on floor/ceiling v3d->sow = (float)((pv->x / fflatsize) - flatxref + scrollx); - v3d->tow = (float)(flatyref - (pv->y / fflatsize) + scrolly); + v3d->tow = (float)(-(pv->y / fflatsize) + flatyref + scrolly); //v3d->sow = (float)(pv->x / fflatsize); //v3d->tow = (float)(pv->y / fflatsize); @@ -700,7 +702,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is tempxsow = FLOAT_TO_FIXED(v3d->sow); tempytow = FLOAT_TO_FIXED(v3d->tow); v3d->sow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); - v3d->tow = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle)))); + v3d->tow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle)))); } //v3d->sow = (float)(v3d->sow - flatxref + scrollx); diff --git a/src/p_spec.c b/src/p_spec.c index 17cd1f88..86ac8f00 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5821,10 +5821,8 @@ void P_SpawnSpecials(INT32 fromnetsave) } else // Otherwise, set calculated offsets such that line's v1 is the apparent origin { - fixed_t cosinecomponent = FINECOSINE(flatangle>>ANGLETOFINESHIFT); - fixed_t sinecomponent = FINESINE(flatangle>>ANGLETOFINESHIFT); - xoffs = (-FixedMul(lines[i].v1->x, cosinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, sinecomponent) % MAXFLATSIZE); // No danger of overflow thanks to the strategically placed modulo operations. - yoffs = (FixedMul(lines[i].v1->x, sinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, cosinecomponent) % MAXFLATSIZE); // Ditto. + xoffs = -lines[i].v1->x; + yoffs = lines[i].v1->y; } for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) diff --git a/src/r_bsp.c b/src/r_bsp.c index 34b082ca..82a7624b 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -1126,30 +1126,12 @@ static void R_Subsector(size_t num, UINT8 viewnumber) && polysec->floorheight >= floorcenterz && (viewz < polysec->floorheight)) { - fixed_t xoff, yoff; - xoff = polysec->floor_xoffs; - yoff = polysec->floor_yoffs; - - if (po->angle != 0) { - angle_t fineshift = po->angle >> ANGLETOFINESHIFT; - - xoff -= FixedMul(FINECOSINE(fineshift), po->centerPt.x)+FixedMul(FINESINE(fineshift), po->centerPt.y); - yoff -= FixedMul(FINESINE(fineshift), po->centerPt.x)-FixedMul(FINECOSINE(fineshift), po->centerPt.y); - } else { - xoff -= po->centerPt.x; - yoff += po->centerPt.y; - } - light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight); light = 0; ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic, - polysec->lightlevel, xoff, yoff, + polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs, polysec->floorpic_angle-po->angle, - NULL, - NULL -#ifdef POLYOBJECTS_PLANES - , po -#endif + NULL, NULL, po #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif @@ -1174,28 +1156,12 @@ static void R_Subsector(size_t num, UINT8 viewnumber) && polysec->ceilingheight <= ceilingcenterz && (viewz > polysec->ceilingheight)) { - fixed_t xoff, yoff; - xoff = polysec->ceiling_xoffs; - yoff = polysec->ceiling_yoffs; - - if (po->angle != 0) { - angle_t fineshift = po->angle >> ANGLETOFINESHIFT; - - xoff -= FixedMul(FINECOSINE(fineshift), po->centerPt.x)+FixedMul(FINESINE(fineshift), po->centerPt.y); - yoff -= FixedMul(FINESINE(fineshift), po->centerPt.x)-FixedMul(FINECOSINE(fineshift), po->centerPt.y); - } else { - xoff -= po->centerPt.x; - yoff += po->centerPt.y; - } - light = R_GetPlaneLight(frontsector, polysec->ceilingheight, viewz < polysec->ceilingheight); light = 0; ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic, - polysec->lightlevel, xoff, yoff, polysec->ceilingpic_angle-po->angle, - NULL, NULL -#ifdef POLYOBJECTS_PLANES - , po -#endif + polysec->lightlevel, polysec->ceiling_xoffs, polysec->ceiling_yoffs, + polysec->ceilingpic_angle-po->angle, + NULL, NULL, po #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif diff --git a/src/r_plane.c b/src/r_plane.c index 0f0e2f7a..c884a9c3 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -450,19 +450,37 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef ESLOPE if (slope); else // Don't mess with this right now if a slope is involved #endif - if (plangle != 0) - { - // Add the view offset, rotated by the plane angle. - angle_t angle = plangle>>ANGLETOFINESHIFT; - xoff += FixedMul(viewx,FINECOSINE(angle))-FixedMul(viewy,FINESINE(angle)); - yoff += -FixedMul(viewx,FINESINE(angle))-FixedMul(viewy,FINECOSINE(angle)); - } - else { xoff += viewx; yoff -= viewy; + if (plangle != 0) + { + // Add the view offset, rotated by the plane angle. + fixed_t cosinecomponent = FINECOSINE(plangle>>ANGLETOFINESHIFT); + fixed_t sinecomponent = FINESINE(plangle>>ANGLETOFINESHIFT); + fixed_t oldxoff = xoff; + xoff = FixedMul(xoff,cosinecomponent)+FixedMul(yoff,sinecomponent); + yoff = -FixedMul(oldxoff,sinecomponent)+FixedMul(yoff,cosinecomponent); + } } +#ifdef POLYOBJECTS_PLANES + if (polyobj) + { + if (polyobj->angle != 0) + { + angle_t fineshift = polyobj->angle >> ANGLETOFINESHIFT; + xoff -= FixedMul(FINECOSINE(fineshift), polyobj->centerPt.x)+FixedMul(FINESINE(fineshift), polyobj->centerPt.y); + yoff -= FixedMul(FINESINE(fineshift), polyobj->centerPt.x)-FixedMul(FINECOSINE(fineshift), polyobj->centerPt.y); + } + else + { + xoff -= polyobj->centerPt.x; + yoff += polyobj->centerPt.y; + } + } +#endif + // This appears to fix the Nimbus Ruins sky bug. if (picnum == skyflatnum && pfloor) { @@ -488,6 +506,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, && !pfloor && !check->ffloor && check->viewx == viewx && check->viewy == viewy && check->viewz == viewz && check->viewangle == viewangle + && check->plangle == plangle #ifdef ESLOPE && check->slope == slope #endif @@ -974,23 +993,65 @@ void R_DrawSinglePlane(visplane_t *pl) #ifdef ESLOPE if (pl->slope) { // Potentially override other stuff for now cus we're mean. :< But draw a slope plane! - // I copied ZDoom's code and adapted it to SRB2... -Red + // I copied ZDoom's code and adapted it to SRB2... -fickle floatv3_t p, m, n; float ang; float vx, vy, vz; - float fudge; // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly // use this as a temp var to store P_GetZAt's return value each time fixed_t temp; + // Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -fickle + const float fudge = ((1<plangle & (ANGLE_90-1)); - xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); - yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); + if (hack) + { + /* + Essentially: We can't & the components along the regular axes when the plane is rotated. + This is because the distance on each regular axis in order to loop is different. + We rotate them, & the components, add them together, & them again, and then rotate them back. + These three seperate & operations are done per axis in order to prevent overflows. + toast 10/04/17 + --- + ...of coooourse, this still isn't perfect. but it looks... merely kind of grody, rather than + completely wrong? idk. i'm just backporting this to kart right now. if anyone else wants to + ever try dig around: it's drifting towards 0,0, and no, multiplying by fudge doesn't fix it. + toast 27/09/18 + */ - // Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red - fudge = ((1<>ANGLETOFINESHIFT); + const fixed_t sinecomponent = FINESINE(hack>>ANGLETOFINESHIFT); + + const fixed_t modmask = ((1 << (32-nflatshiftup)) - 1); + + fixed_t ox = (FixedMul(pl->slope->o.x,cosinecomponent) & modmask) - (FixedMul(pl->slope->o.y,sinecomponent) & modmask); + fixed_t oy = (-FixedMul(pl->slope->o.x,sinecomponent) & modmask) - (FixedMul(pl->slope->o.y,cosinecomponent) & modmask); + + temp = ox & modmask; + oy &= modmask; + ox = FixedMul(temp,cosinecomponent)+FixedMul(oy,-sinecomponent); // negative sine for opposite direction + oy = -FixedMul(temp,-sinecomponent)+FixedMul(oy,cosinecomponent); + + temp = xoffs; + xoffs = (FixedMul(temp,cosinecomponent) & modmask) + (FixedMul(yoffs,sinecomponent) & modmask); + yoffs = (-FixedMul(temp,sinecomponent) & modmask) + (FixedMul(yoffs,cosinecomponent) & modmask); + + temp = xoffs & modmask; + yoffs &= modmask; + xoffs = FixedMul(temp,cosinecomponent)+FixedMul(yoffs,-sinecomponent); // ditto + yoffs = -FixedMul(temp,-sinecomponent)+FixedMul(yoffs,cosinecomponent); + + xoffs -= (pl->slope->o.x - ox); + yoffs += (pl->slope->o.y + oy); + } + else + { + xoffs &= ((1 << (32-nflatshiftup))-1); + yoffs &= ((1 << (32-nflatshiftup))-1); + xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); + yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); + } xoffs = (fixed_t)(xoffs*fudge); yoffs = (fixed_t)(yoffs/fudge); From 7f5b5ecb60ee7c63da3de30f9000922388707c5c Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 27 Sep 2018 18:32:07 +0100 Subject: [PATCH 032/138] Spring *panels* now use `sfx_kc2f` again (but pogo spring *items* still do `sfx_kpogos`, in case you were worried). --- src/k_kart.c | 8 ++++---- src/k_kart.h | 2 +- src/lua_baselib.c | 4 ++-- src/p_map.c | 2 +- src/p_mobj.c | 6 +++--- src/p_spec.c | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f4b9e93a..20313da9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3031,7 +3031,7 @@ static void K_DoSPB(player_t *victim, player_t *source) P_DamageMobj(victim->mo, source->mo, source->mo, 65); } -void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute) +void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) { const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (mo->scale - mapheaderinfo[gamemap-1]->mobj_scale); @@ -3083,8 +3083,8 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute) else mo->momz = FixedMul(vertispeed, vscale); - if (!mute) - S_StartSound(mo, sfx_kpogos); + if (sound) + S_StartSound(mo, (sound == 1 ? sfx_kc2f : sfx_kpogos)); } void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source) @@ -4775,7 +4775,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) && !player->kartstuff[k_pogospring]) { K_PlayBoostTaunt(player->mo); - K_DoPogoSpring(player->mo, 32<mo, 32<kartstuff[k_pogospring] = 1; player->kartstuff[k_itemamount]--; } diff --git a/src/k_kart.h b/src/k_kart.h index 7c37ef67..7cab42a5 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -37,7 +37,7 @@ void K_SpawnSparkleTrail(mobj_t *mo); void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent); void K_DriftDustHandling(mobj_t *spawner); void K_DoSneaker(player_t *player, boolean doPFlag); -void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute); +void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound); void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); void K_UpdateHnextList(player_t *player, boolean clean); void K_DropHnextList(player_t *player); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 7c44c796..2d287d0f 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2231,11 +2231,11 @@ static int lib_kDoPogoSpring(lua_State *L) { mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); fixed_t vertispeed = luaL_checkfixed(L, 2); - boolean mute = luaL_checkboolean(L, 3); + UINT8 sound = luaL_checkinteger(L, 3); NOHUD if (!mo) return LUA_ErrInvalid(L, "mobj_t"); - K_DoPogoSpring(mo, vertispeed, mute); + K_DoPogoSpring(mo, vertispeed, sound); return 0; } diff --git a/src/p_map.c b/src/p_map.c index b249f362..f6f6b9b5 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -316,7 +316,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) break; if (object->player) object->player->kartstuff[k_pogospring] = 1; - K_DoPogoSpring(object, 0, true); + K_DoPogoSpring(object, 0, 0); return; } else diff --git a/src/p_mobj.c b/src/p_mobj.c index 0f065733..6058267d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8035,7 +8035,7 @@ void P_MobjThinker(mobj_t *mobj) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) - K_DoPogoSpring(mobj, 0, false); + K_DoPogoSpring(mobj, 0, 1); } if (mobj->threshold > 0) @@ -8110,7 +8110,7 @@ void P_MobjThinker(mobj_t *mobj) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) - K_DoPogoSpring(mobj, 0, false); + K_DoPogoSpring(mobj, 0, 1); break; } @@ -8139,7 +8139,7 @@ void P_MobjThinker(mobj_t *mobj) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) - K_DoPogoSpring(mobj, 0, false); + K_DoPogoSpring(mobj, 0, 1); } if (mobj->threshold > 0) diff --git a/src/p_spec.c b/src/p_spec.c index 86ac8f00..ab47fec3 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3790,7 +3790,7 @@ DoneSection2: P_InstaThrust(player->mo, player->mo->angle, minspeed); player->kartstuff[k_pogospring] = 1; - K_DoPogoSpring(player->mo, 0, false); + K_DoPogoSpring(player->mo, 0, 1); } break; @@ -3813,7 +3813,7 @@ DoneSection2: P_InstaThrust(player->mo, player->mo->angle, minspeed); player->kartstuff[k_pogospring] = 2; - K_DoPogoSpring(player->mo, 0, false); + K_DoPogoSpring(player->mo, 0, 1); } break; From fb102f8131cf534898a04afb525694e239153f47 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 27 Sep 2018 18:39:54 +0100 Subject: [PATCH 033/138] Fix dash-dust spawning not happening when drop-dashing, despite its function being called. --- 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 20313da9..650a2149 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1277,7 +1277,7 @@ static void K_SpawnDashDustRelease(player_t *player) if (!P_IsObjectOnGround(player->mo)) return; - if (player->speed == 0) + if (!player->speed && !player->kartstuff[k_startboost]) return; travelangle = player->mo->angle; From 169411e3dac6f5c9fa4f9d4526ce0d0d39551e54 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 27 Sep 2018 21:38:19 +0100 Subject: [PATCH 034/138] Disable `cv_joinnextround` behind `#define VANILLAJOINNEXTROUND`. --- src/d_clisrv.c | 6 ++++++ src/d_clisrv.h | 6 +++++- src/m_menu.c | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 63393690..97e6e700 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2920,7 +2920,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) } consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; +#ifdef VANILLAJOINNEXTROUND consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done +#endif static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}}; consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}}; @@ -2966,7 +2968,9 @@ void D_ClientServerInit(void) RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer); #ifndef NONET CV_RegisterVar(&cv_allownewplayer); +#ifdef VANILLAJOINNEXTROUND CV_RegisterVar(&cv_joinnextround); +#endif CV_RegisterVar(&cv_showjoinaddress); CV_RegisterVar(&cv_resynchattempts); CV_RegisterVar(&cv_blamecfail); @@ -3519,8 +3523,10 @@ static void HandleConnect(SINT8 node) // you get a free second before desynch checks. use it wisely. SV_InitResynchVars(node); +#ifdef VANILLAJOINNEXTROUND if (cv_joinnextround.value && gameaction == ga_nothing) G_SetGamestate(GS_WAITINGPLAYERS); +#endif if (!SV_SendServerConfig(node)) { G_SetGamestate(backupstate); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index c8e8b008..e2a6ed7c 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -497,7 +497,11 @@ extern UINT32 realpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS]; #endif -extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed; +extern consvar_t +#ifdef VANILLAJOINNEXTROUND + cv_joinnextround, +#endif + cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed; // Used in d_net, the only dependence tic_t ExpandTics(INT32 low); diff --git a/src/m_menu.c b/src/m_menu.c index 071fdc42..bfb039c4 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1537,7 +1537,9 @@ static menuitem_t OP_ServerOptionsMenu[] = #ifndef NONET {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100}, - //{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110}, +#ifdef VANILLAJOINNEXTROUND + {IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110}, +#endif {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 110}, {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 120}, From cf5c0a7a6a6ffb2e533c086cc0cc40ee640a2369 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 27 Sep 2018 16:55:21 -0400 Subject: [PATCH 035/138] New bindable keys You can now remap Change Viewpoint, Screenshot, and Toggle GIF Recording to other keys, mainly for gamepads They also pushed me to my breaking point and I couldn't tolerate the control menu anymore, thanks to toaster for the scrolling backport --- src/g_game.c | 11 +- src/g_input.c | 10 +- src/g_input.h | 3 + src/hu_stuff.c | 8 +- src/m_menu.c | 413 ++++++++++++++++++++++++++----------------------- src/m_misc.c | 5 +- src/st_stuff.c | 9 +- 7 files changed, 251 insertions(+), 208 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 7edd7725..42baee93 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -428,10 +428,10 @@ consvar_t cv_chatbacktint = {"chatbacktint", "Off", CV_SAVE, CV_OnOff, NULL, 0, static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {0, NULL}}; consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_crosshair = {"crosshair", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_crosshair2 = {"crosshair2", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_crosshair3 = {"crosshair3", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_crosshair4 = {"crosshair4", "Cross", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_crosshair2 = {"crosshair2", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_crosshair3 = {"crosshair3", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_crosshair4 = {"crosshair4", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_invertmouse = {"invertmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_alwaysfreelook = {"alwaysmlook", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_invertmouse2 = {"invertmouse2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -1812,7 +1812,8 @@ static INT32 spectatedelay, spectatedelay2, spectatedelay3, spectatedelay4 = 0; boolean G_Responder(event_t *ev) { // allow spy mode changes even during the demo - if (gamestate == GS_LEVEL && ev->type == ev_keydown && ev->data1 == KEY_F12) + if (gamestate == GS_LEVEL && ev->type == ev_keydown + && (ev->data1 == gamecontrol[gc_viewpoint][0] || ev->data1 == gamecontrol[gc_viewpoint][1])) { if (splitscreen || !netgame) displayplayer = consoleplayer; diff --git a/src/g_input.c b/src/g_input.c index 279ee56b..101fa8e4 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -1209,6 +1209,9 @@ static const char *gamecontrolname[num_gamecontrols] = "console", "pause", "systemmenu", + "screenshot", + "recordgif", + "viewpoint", "custom1", "custom2", "custom3", @@ -1293,6 +1296,9 @@ void G_Controldefault(void) // Extra controls gamecontrol[gc_pause ][0] = KEY_PAUSE; gamecontrol[gc_console ][0] = KEY_CONSOLE; + gamecontrol[gc_screenshot ][0] = KEY_F8; + gamecontrol[gc_recordgif ][0] = KEY_F9; + gamecontrol[gc_viewpoint ][0] = KEY_F12; gamecontrol[gc_talkkey ][0] = 't'; //gamecontrol[gc_teamkey ][0] = 'y'; gamecontrol[gc_scores ][0] = KEY_TAB; @@ -1303,11 +1309,11 @@ void G_Controldefault(void) gamecontrol[gc_camreset ][0] = KEY_HOME; gamecontrol[gc_camtoggle ][0] = KEY_BACKSPACE; - //gamecontrol[gc_viewpoint ][1] = KEY_JOY1+3; // Y + gamecontrol[gc_viewpoint ][1] = KEY_JOY1+3; // Y gamecontrol[gc_pause ][1] = KEY_JOY1+6; // Back gamecontrol[gc_systemmenu ][0] = KEY_JOY1+7; // Start gamecontrol[gc_camtoggle ][1] = KEY_HAT1+0; // D-Pad Up - //gamecontrol[gc_screenshot ][1] = KEY_HAT1+1; // D-Pad Down + gamecontrol[gc_screenshot ][1] = KEY_HAT1+1; // D-Pad Down gamecontrol[gc_talkkey ][1] = KEY_HAT1+2; // D-Pad Left gamecontrol[gc_scores ][1] = KEY_HAT1+3; // D-Pad Right diff --git a/src/g_input.h b/src/g_input.h index 6bbadf3e..3bdd9799 100644 --- a/src/g_input.h +++ b/src/g_input.h @@ -115,6 +115,9 @@ typedef enum gc_console, gc_pause, gc_systemmenu, + gc_screenshot, + gc_recordgif, + gc_viewpoint, gc_custom1, // Lua scriptable gc_custom2, // Lua scriptable gc_custom3, // Lua scriptable diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ab427b48..60b4e07f 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1695,7 +1695,7 @@ static void HU_DrawChat_Old(void) // // Crosshairs are pre-cached at HU_Init -static inline void HU_DrawCrosshair(void) +/*static inline void HU_DrawCrosshair(void) { INT32 i, x, y; @@ -1847,7 +1847,7 @@ static inline void HU_DrawCrosshair4(void) V_DrawScaledPatch(x, y, V_NOSCALESTART|V_OFFSET|V_TRANSLUCENT, crosshair[i - 1]); } -} +}*/ static void HU_DrawCEcho(void) { @@ -2018,7 +2018,7 @@ void HU_Drawer(void) return; // draw the crosshair, not when viewing demos nor with chasecam - if (!automapactive && !demoplayback) + /*if (!automapactive && !demoplayback) { if (cv_crosshair.value && !camera.chase && !players[displayplayer].spectator) HU_DrawCrosshair(); @@ -2031,7 +2031,7 @@ void HU_Drawer(void) if (cv_crosshair4.value && !camera4.chase && !players[fourthdisplayplayer].spectator) HU_DrawCrosshair4(); - } + }*/ // draw desynch text if (hu_resynching) diff --git a/src/m_menu.c b/src/m_menu.c index 72773580..61d1fba9 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -288,8 +288,7 @@ static void M_SetupMultiPlayer4(INT32 choice); // Options // Split into multiple parts due to size // Controls -menu_t OP_ControlsDef, /*OP_ControlListDef,*/ OP_MoveControlsDef; -menu_t /*OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef,*/ OP_CustomControlsDef, OP_SpectateControlsDef; +menu_t OP_ControlsDef, OP_AllControlsDef; menu_t OP_MouseOptionsDef, OP_Mouse2OptionsDef; menu_t OP_Joystick1Def, OP_Joystick2Def; #ifndef NOFOURPLAYER @@ -1112,88 +1111,47 @@ static menuitem_t OP_ControlsMenu[] = #endif }; -static menuitem_t OP_MoveControlsMenu[] = +static menuitem_t OP_AllControlsMenu[] = { - {IT_CONTROL, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, - {IT_CONTROL, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, - {IT_CONTROL, NULL, "Turn Right", M_ChangeControl, gc_turnright }, - {IT_CONTROL, NULL, "Drift", M_ChangeControl, gc_drift }, - {IT_CONTROL, NULL, "Brake", M_ChangeControl, gc_brake }, - {IT_CONTROL, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, - {IT_CONTROL, NULL, "Aim Forward", M_ChangeControl, gc_aimforward }, - {IT_CONTROL, NULL, "Aim Backward", M_ChangeControl, gc_aimbackward}, - {IT_CONTROL, NULL, "Look Backward", M_ChangeControl, gc_lookback }, - - {IT_SPACE, NULL, "", NULL, 76}, - {IT_CONTROL, NULL, "Talk key", M_ChangeControl, gc_talkkey }, - //{IT_CONTROL, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, - {IT_CONTROL, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, - {IT_CONTROL, NULL, "Open/Close Menu (ESC)", M_ChangeControl, gc_systemmenu}, - {IT_CONTROL, NULL, "Pause", M_ChangeControl, gc_pause }, - {IT_CONTROL, NULL, "Console", M_ChangeControl, gc_console }, - - {IT_SUBMENU | IT_STRING, NULL, "Gamepad Options...", &OP_Joystick1Def, 120}, - {IT_SUBMENU | IT_STRING, NULL, "Spectator Controls...", &OP_SpectateControlsDef, 128}, - {IT_SUBMENU | IT_STRING, NULL, "Custom Lua Actions...", &OP_CustomControlsDef, 136}, + {IT_SUBMENU|IT_STRING, NULL, "Gamepad Options...", &OP_Joystick1Def, 0}, + //{IT_SPACE, NULL, NULL, NULL, 0}, + {IT_HEADER, NULL, "Gameplay Controls", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, + {IT_CONTROL, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, + {IT_CONTROL, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, + {IT_CONTROL, NULL, "Turn Right", M_ChangeControl, gc_turnright }, + {IT_CONTROL, NULL, "Drift", M_ChangeControl, gc_drift }, + {IT_CONTROL, NULL, "Brake", M_ChangeControl, gc_brake }, + {IT_CONTROL, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, + {IT_CONTROL, NULL, "Aim Forward", M_ChangeControl, gc_aimforward }, + {IT_CONTROL, NULL, "Aim Backward", M_ChangeControl, gc_aimbackward}, + {IT_CONTROL, NULL, "Look Backward", M_ChangeControl, gc_lookback }, + {IT_HEADER, NULL, "Miscelleanous Controls", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, + {IT_CONTROL, NULL, "Chat", M_ChangeControl, gc_talkkey }, + //{IT_CONTROL, NULL, "Team Chat", M_ChangeControl, gc_teamkey }, + {IT_CONTROL, NULL, "Show Rankings", M_ChangeControl, gc_scores }, + {IT_CONTROL, NULL, "Change Viewpoint", M_ChangeControl, gc_viewpoint }, + {IT_CONTROL, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, + {IT_CONTROL, NULL, "Toggle First-Person", M_ChangeControl, gc_camtoggle }, + {IT_CONTROL, NULL, "Pause", M_ChangeControl, gc_pause }, + {IT_CONTROL, NULL, "Screenshot", M_ChangeControl, gc_screenshot }, + {IT_CONTROL, NULL, "Toggle GIF Recording", M_ChangeControl, gc_recordgif }, + {IT_CONTROL, NULL, "Open/Close Menu (ESC)", M_ChangeControl, gc_systemmenu }, + {IT_CONTROL, NULL, "Developer Console", M_ChangeControl, gc_console }, + {IT_HEADER, NULL, "Spectator Controls", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, + {IT_CONTROL, NULL, "Become Spectator", M_ChangeControl, gc_spectate }, + {IT_CONTROL, NULL, "Look Up", M_ChangeControl, gc_lookup }, + {IT_CONTROL, NULL, "Look Down", M_ChangeControl, gc_lookdown }, + {IT_CONTROL, NULL, "Center View", M_ChangeControl, gc_centerview }, + {IT_HEADER, NULL, "Custom Lua Actions", NULL, 0}, + {IT_SPACE, NULL, NULL, NULL, 0}, + {IT_CONTROL, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 }, + {IT_CONTROL, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 }, + {IT_CONTROL, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 }, }; -static menuitem_t OP_SpectateControlsMenu[] = -{ - {IT_CONTROL, NULL, "Become Spectator", M_ChangeControl, gc_spectate }, - {IT_CONTROL, NULL, "Look Up", M_ChangeControl, gc_lookup }, - {IT_CONTROL, NULL, "Look Down", M_ChangeControl, gc_lookdown }, - {IT_CONTROL, NULL, "Center View", M_ChangeControl, gc_centerview}, - {IT_CONTROL, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, - {IT_CONTROL, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, - - {IT_STRING | IT_CVAR, NULL, "Chasecam" , &cv_chasecam , 52}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 60}, -}; - -static menuitem_t OP_CustomControlsMenu[] = -{ - {IT_CONTROL, NULL, "Custom Action 1", M_ChangeControl, gc_custom1}, - {IT_CONTROL, NULL, "Custom Action 2", M_ChangeControl, gc_custom2}, - {IT_CONTROL, NULL, "Custom Action 3", M_ChangeControl, gc_custom3}, -}; - -// Obsolete thanks to Kart -/*static menuitem_t OP_MPControlsMenu[] = -{ -// {IT_CALL | IT_STRING2, NULL, "Next Weapon", M_ChangeControl, gc_driftleft }, -// {IT_CALL | IT_STRING2, NULL, "Prev Weapon", M_ChangeControl, gc_driftright }, -// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 1", M_ChangeControl, gc_wepslot1 }, -// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 2", M_ChangeControl, gc_wepslot2 }, -// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 3", M_ChangeControl, gc_wepslot3 }, -// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 4", M_ChangeControl, gc_wepslot4 }, -// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 5", M_ChangeControl, gc_wepslot5 }, -// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 6", M_ChangeControl, gc_wepslot6 }, -// {IT_CALL | IT_STRING2, NULL, "Weapon Slot 7", M_ChangeControl, gc_wepslot7 }, -}; - -static menuitem_t OP_CameraControlsMenu[] = -{ -// {IT_CALL | IT_STRING2, NULL, "Look Up", M_ChangeControl, gc_lookup }, -// {IT_CALL | IT_STRING2, NULL, "Look Down", M_ChangeControl, gc_lookdown }, -// {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview }, -// {IT_CALL | IT_STRING2, NULL, "Mouselook", M_ChangeControl, gc_mouseaiming }, -}; - -static menuitem_t OP_MiscControlsMenu[] = -{ - {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1 }, - {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2 }, - {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3 }, - - {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, - {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, - - {IT_CALL | IT_STRING2, NULL, "Talk key", M_ChangeControl, gc_talkkey }, - {IT_CALL | IT_STRING2, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, - {IT_CALL | IT_STRING2, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, - {IT_CALL | IT_STRING2, NULL, "Spectate", M_ChangeControl, gc_spectate }, -};*/ - static menuitem_t OP_Joystick1Menu[] = { {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup1PJoystickMenu, 10}, @@ -1950,28 +1908,12 @@ menu_t OP_MainDef = }; menu_t OP_ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlsMenu, &OP_MainDef, 60, 30); -//menu_t OP_ControlListDef = DEFAULTMENUSTYLE("M_CONTRO", OP_ControlListMenu, &OP_ControlsDef, 60, 30); -menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlsDef); -//menu_t OP_MPControlsDef = CONTROLMENUSTYLE(OP_MPControlsMenu, &OP_ControlListDef); -//menu_t OP_CameraControlsDef = CONTROLMENUSTYLE(OP_CameraControlsMenu, &OP_ControlListDef); -//menu_t OP_MiscControlsDef = CONTROLMENUSTYLE(OP_MiscControlsMenu, &OP_ControlListDef); -menu_t OP_CustomControlsDef = CONTROLMENUSTYLE(OP_CustomControlsMenu, &OP_MoveControlsDef); -menu_t OP_SpectateControlsDef = CONTROLMENUSTYLE(OP_SpectateControlsMenu, &OP_MoveControlsDef); -/* -menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_ControlsDef, 60, 30); -menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_ControlsDef, 60, 30); +menu_t OP_AllControlsDef = CONTROLMENUSTYLE(OP_AllControlsMenu, &OP_ControlsDef); +menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_AllControlsDef, 60, 30); +menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_AllControlsDef, 60, 30); #ifndef NOFOURPLAYER -menu_t OP_P3ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P3ControlsMenu, &OP_ControlsDef, 60, 30); -menu_t OP_P4ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P4ControlsMenu, &OP_ControlsDef, 60, 30); -#endif -menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 60, 30); -menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 60, 30); -*/ -menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_MoveControlsDef, 60, 30); -menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_MoveControlsDef, 60, 30); -#ifndef NOFOURPLAYER -menu_t OP_Joystick3Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_MoveControlsDef, 60, 30); -menu_t OP_Joystick4Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_MoveControlsDef, 60, 30); +menu_t OP_Joystick3Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_AllControlsDef, 60, 30); +menu_t OP_Joystick4Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_AllControlsDef, 60, 30); #endif menu_t OP_JoystickSetDef = { @@ -8468,19 +8410,28 @@ static void M_Setup1PControlsMenu(INT32 choice) setupcontrols = gamecontrol; // was called from main Options (for console player, then) currentMenu->lastOn = itemOn; + // Set proper gamepad options + OP_AllControlsMenu[0].itemaction = &OP_Joystick1Def; + // Unhide P1-only controls - OP_MoveControlsMenu[10].status = IT_CONTROL; // Talk - //OP_MoveControlsMenu[11].status = IT_CONTROL; // Team-talk - OP_MoveControlsMenu[11].status = IT_CONTROL; // Rankings - OP_MoveControlsMenu[12].status = IT_CONTROL; // Pause - OP_MoveControlsMenu[13].status = IT_CONTROL; // Console - OP_MoveControlsMenu[14].itemaction = &OP_Joystick1Def; // Gamepad + OP_AllControlsMenu[14].status = IT_CONTROL; // Chat + //OP_AllControlsMenu[15].status = IT_CONTROL; // Team-chat + OP_AllControlsMenu[15].status = IT_CONTROL; // Rankings + OP_AllControlsMenu[16].status = IT_CONTROL; // Viewpoint + // 17 is Reset Camera, 18 is Toggle Chasecam + OP_AllControlsMenu[19].status = IT_CONTROL; // Pause + OP_AllControlsMenu[20].status = IT_CONTROL; // Screenshot + OP_AllControlsMenu[21].status = IT_CONTROL; // GIF + OP_AllControlsMenu[22].status = IT_CONTROL; // System Menu + OP_AllControlsMenu[23].status = IT_CONTROL; // Console + OP_AllControlsMenu[24].status = IT_HEADER; // Spectator Controls header + OP_AllControlsMenu[25].status = IT_SPACE; // Spectator Controls space + OP_AllControlsMenu[26].status = IT_CONTROL; // Spectate + OP_AllControlsMenu[27].status = IT_CONTROL; // Look Up + OP_AllControlsMenu[28].status = IT_CONTROL; // Look Down + OP_AllControlsMenu[29].status = IT_CONTROL; // Center View - // Set cvars - OP_SpectateControlsMenu[6].itemaction = &cv_chasecam; // Chasecam - OP_SpectateControlsMenu[7].itemaction = &cv_crosshair; // Crosshair - - M_SetupNextMenu(&OP_MoveControlsDef); + M_SetupNextMenu(&OP_AllControlsDef); } static void M_Setup2PControlsMenu(INT32 choice) @@ -8491,19 +8442,28 @@ static void M_Setup2PControlsMenu(INT32 choice) setupcontrols = gamecontrolbis; currentMenu->lastOn = itemOn; + // Set proper gamepad options + OP_AllControlsMenu[0].itemaction = &OP_Joystick2Def; + // Hide P1-only controls - OP_MoveControlsMenu[10].status = IT_GRAYEDOUT2; // Talk - //OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Team-talk - OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Rankings - OP_MoveControlsMenu[12].status = IT_GRAYEDOUT2; // Pause - OP_MoveControlsMenu[13].status = IT_GRAYEDOUT2; // Console - OP_MoveControlsMenu[14].itemaction = &OP_Joystick2Def; // Gamepad + OP_AllControlsMenu[14].status = IT_GRAYEDOUT2; // Chat + //OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Team-chat + OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Rankings + OP_AllControlsMenu[16].status = IT_GRAYEDOUT2; // Viewpoint + // 17 is Reset Camera, 18 is Toggle Chasecam + OP_AllControlsMenu[19].status = IT_GRAYEDOUT2; // Pause + OP_AllControlsMenu[20].status = IT_GRAYEDOUT2; // Screenshot + OP_AllControlsMenu[21].status = IT_GRAYEDOUT2; // GIF + OP_AllControlsMenu[22].status = IT_GRAYEDOUT2; // System Menu + OP_AllControlsMenu[23].status = IT_GRAYEDOUT2; // Console + OP_AllControlsMenu[24].status = IT_GRAYEDOUT2; // Spectator Controls header + OP_AllControlsMenu[25].status = IT_GRAYEDOUT2; // Spectator Controls space + OP_AllControlsMenu[26].status = IT_GRAYEDOUT2; // Spectate + OP_AllControlsMenu[27].status = IT_GRAYEDOUT2; // Look Up + OP_AllControlsMenu[28].status = IT_GRAYEDOUT2; // Look Down + OP_AllControlsMenu[29].status = IT_GRAYEDOUT2; // Center View - // Set cvars - OP_SpectateControlsMenu[6].itemaction = &cv_chasecam2; // Chasecam - OP_SpectateControlsMenu[7].itemaction = &cv_crosshair2; // Crosshair - - M_SetupNextMenu(&OP_MoveControlsDef); + M_SetupNextMenu(&OP_AllControlsDef); } #ifndef NOFOURPLAYER @@ -8515,19 +8475,28 @@ static void M_Setup3PControlsMenu(INT32 choice) setupcontrols = gamecontrol3; currentMenu->lastOn = itemOn; + // Set proper gamepad options + OP_AllControlsMenu[0].itemaction = &OP_Joystick3Def; + // Hide P1-only controls - OP_MoveControlsMenu[10].status = IT_GRAYEDOUT2; // Talk - //OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Team-talk - OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Rankings - OP_MoveControlsMenu[12].status = IT_GRAYEDOUT2; // Pause - OP_MoveControlsMenu[13].status = IT_GRAYEDOUT2; // Console - OP_MoveControlsMenu[14].itemaction = &OP_Joystick3Def; // Gamepad + OP_AllControlsMenu[14].status = IT_GRAYEDOUT2; // Chat + //OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Team-chat + OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Rankings + OP_AllControlsMenu[16].status = IT_GRAYEDOUT2; // Viewpoint + // 17 is Reset Camera, 18 is Toggle Chasecam + OP_AllControlsMenu[19].status = IT_GRAYEDOUT2; // Pause + OP_AllControlsMenu[20].status = IT_GRAYEDOUT2; // Screenshot + OP_AllControlsMenu[21].status = IT_GRAYEDOUT2; // GIF + OP_AllControlsMenu[22].status = IT_GRAYEDOUT2; // System Menu + OP_AllControlsMenu[23].status = IT_GRAYEDOUT2; // Console + OP_AllControlsMenu[24].status = IT_GRAYEDOUT2; // Spectator Controls header + OP_AllControlsMenu[25].status = IT_GRAYEDOUT2; // Spectator Controls space + OP_AllControlsMenu[26].status = IT_GRAYEDOUT2; // Spectate + OP_AllControlsMenu[27].status = IT_GRAYEDOUT2; // Look Up + OP_AllControlsMenu[28].status = IT_GRAYEDOUT2; // Look Down + OP_AllControlsMenu[29].status = IT_GRAYEDOUT2; // Center View - // Set cvars - OP_SpectateControlsMenu[6].itemaction = &cv_chasecam3; // Chasecam - OP_SpectateControlsMenu[7].itemaction = &cv_crosshair3; // Crosshair - - M_SetupNextMenu(&OP_MoveControlsDef); + M_SetupNextMenu(&OP_AllControlsDef); } static void M_Setup4PControlsMenu(INT32 choice) @@ -8538,80 +8507,144 @@ static void M_Setup4PControlsMenu(INT32 choice) setupcontrols = gamecontrol4; currentMenu->lastOn = itemOn; + // Set proper gamepad options + OP_AllControlsMenu[0].itemaction = &OP_Joystick4Def; + // Hide P1-only controls - OP_MoveControlsMenu[10].status = IT_GRAYEDOUT2; // Talk - //OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Team-talk - OP_MoveControlsMenu[11].status = IT_GRAYEDOUT2; // Rankings - OP_MoveControlsMenu[12].status = IT_GRAYEDOUT2; // Pause - OP_MoveControlsMenu[13].status = IT_GRAYEDOUT2; // Console - OP_MoveControlsMenu[14].itemaction = &OP_Joystick4Def; // Gamepad + OP_AllControlsMenu[14].status = IT_GRAYEDOUT2; // Chat + //OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Team-chat + OP_AllControlsMenu[15].status = IT_GRAYEDOUT2; // Rankings + OP_AllControlsMenu[16].status = IT_GRAYEDOUT2; // Viewpoint + // 17 is Reset Camera, 18 is Toggle Chasecam + OP_AllControlsMenu[19].status = IT_GRAYEDOUT2; // Pause + OP_AllControlsMenu[20].status = IT_GRAYEDOUT2; // Screenshot + OP_AllControlsMenu[21].status = IT_GRAYEDOUT2; // GIF + OP_AllControlsMenu[22].status = IT_GRAYEDOUT2; // System Menu + OP_AllControlsMenu[23].status = IT_GRAYEDOUT2; // Console + OP_AllControlsMenu[24].status = IT_GRAYEDOUT2; // Spectator Controls header + OP_AllControlsMenu[25].status = IT_GRAYEDOUT2; // Spectator Controls space + OP_AllControlsMenu[26].status = IT_GRAYEDOUT2; // Spectate + OP_AllControlsMenu[27].status = IT_GRAYEDOUT2; // Look Up + OP_AllControlsMenu[28].status = IT_GRAYEDOUT2; // Look Down + OP_AllControlsMenu[29].status = IT_GRAYEDOUT2; // Center View - // Set cvars - OP_SpectateControlsMenu[6].itemaction = &cv_chasecam4; // Chasecam - OP_SpectateControlsMenu[7].itemaction = &cv_crosshair4; // Crosshair - - M_SetupNextMenu(&OP_MoveControlsDef); + M_SetupNextMenu(&OP_AllControlsDef); } #endif +#define controlheight 18 + // Draws the Customise Controls menu static void M_DrawControl(void) { - char tmp[50]; - INT32 i, y; - INT32 keys[2]; - const char *ctrl; + char tmp[50]; + INT32 x, y, i, max, cursory = 0, iter; + INT32 keys[2]; - // draw title, strings and submenu - M_DrawGenericMenu(); + x = currentMenu->x; + y = currentMenu->y; - if (setupcontrols_secondaryplayer) - ctrl = "\x86""SET ""\x82""CONTROLS""\x86"" FOR ""\x82""SECONDARY PLAYER"; - else if (setupcontrols_thirdplayer) - ctrl = "\x86""SET ""\x82""CONTROLS""\x86"" FOR ""\x82""THIRD PLAYER"; - else if (setupcontrols_fourthplayer) - ctrl = "\x86""SET ""\x82""CONTROLS""\x86"" FOR ""\x82""FOURTH PLAYER"; - else - ctrl = "\x86""PRESS ""\x82""ENTER""\x86"" TO CHANGE, ""\x82""BACKSPACE""\x86"" TO CLEAR"; + /*i = itemOn - (controlheight/2); + if (i < 0) + i = 0; + */ - M_CentreText(28, ctrl); + iter = (controlheight/2); + for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--) + { + if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2) + iter--; + } + if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + i--; - y = currentMenu->y; + iter += (controlheight/2); + for (max = itemOn; (iter && max < currentMenu->numitems); max++) + { + if (currentMenu->menuitems[max].status != IT_GRAYEDOUT2) + iter--; + } - for (i = 0; i < currentMenu->numitems;i++) - { - if (currentMenu->menuitems[i].status != IT_CONTROL) - { - y = currentMenu->y+currentMenu->menuitems[i].alphaKey; - continue; - } - if (currentMenu->menuitems[i].status != IT_CONTROL) - continue; + if (iter) + { + iter += (controlheight/2); + for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--) + { + if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2) + iter--; + } + } - keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0]; - keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1]; + /*max = i + controlheight; + if (max > currentMenu->numitems) + { + max = currentMenu->numitems; + if (max < controlheight) + i = 0; + else + i = max - controlheight; + }*/ - tmp[0] ='\0'; - if (keys[0] == KEY_NULL && keys[1] == KEY_NULL) - { - strcpy(tmp, "---"); - } - else - { - if (keys[0] != KEY_NULL) - strcat (tmp, G_KeynumToString (keys[0])); + // draw title (or big pic) + M_DrawMenuTitle(); - if (keys[0] != KEY_NULL && keys[1] != KEY_NULL) - strcat(tmp," or "); + M_CentreText(30, + (setupcontrols_fourthplayer ? "Set controls for Player 4" : + (setupcontrols_thirdplayer ? "Set controls for Player 3" : + (setupcontrols_secondaryplayer ? "Set controls for Player 2" : + "Press ENTER to change, BACKSPACE to clear")))); - if (keys[1] != KEY_NULL) - strcat (tmp, G_KeynumToString (keys[1])); + if (i) + V_DrawString(currentMenu->x - 16, y-(skullAnimCounter/5), highlightflags, "\x1A"); // up arrow + if (max != currentMenu->numitems) + V_DrawString(currentMenu->x - 16, y+(SMALLLINEHEIGHT*(controlheight-1))+(skullAnimCounter/5), highlightflags, "\x1B"); // down arrow + + for (; i < max; i++) + { + if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + continue; + + if (i == itemOn) + cursory = y; + + if (currentMenu->menuitems[i].status == IT_CONTROL) + { + V_DrawString(x, y, ((i == itemOn) ? highlightflags : 0), currentMenu->menuitems[i].text); + keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0]; + keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1]; + + tmp[0] ='\0'; + if (keys[0] == KEY_NULL && keys[1] == KEY_NULL) + { + strcpy(tmp, "---"); + } + else + { + if (keys[0] != KEY_NULL) + strcat (tmp, G_KeynumToString (keys[0])); + + if (keys[0] != KEY_NULL && keys[1] != KEY_NULL) + strcat(tmp,", "); + + if (keys[1] != KEY_NULL) + strcat (tmp, G_KeynumToString (keys[1])); - } - V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, highlightflags, tmp); - y += SMALLLINEHEIGHT; - } + } + V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, highlightflags, tmp); + } + /*else if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);*/ + else if ((currentMenu->menuitems[i].status == IT_HEADER) && (i != max-1)) + V_DrawString(19, y+6, highlightflags, currentMenu->menuitems[i].text); + else if (currentMenu->menuitems[i].status & IT_STRING) + V_DrawString(x, y, ((i == itemOn) ? highlightflags : 0), currentMenu->menuitems[i].text); + + y += SMALLLINEHEIGHT; + } + + V_DrawScaledPatch(currentMenu->x - 20, cursory, 0, + W_CachePatchName("M_CURSOR", PU_CACHE)); } static INT32 controltochange; diff --git a/src/m_misc.c b/src/m_misc.c index 766db72d..7b176fd9 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1480,9 +1480,10 @@ boolean M_ScreenshotResponder(event_t *ev) return false; ch = ev->data1; - if (ch == KEY_F8) + + if (ch == gamecontrol[gc_screenshot][0] || ch == gamecontrol[gc_screenshot][1]) // remappable F8 M_ScreenShot(); - else if (ch == KEY_F9) + else if (ch == gamecontrol[gc_recordgif][0] || ch == gamecontrol[gc_recordgif][1]) // remappable F9 ((moviemode) ? M_StopMovie : M_StartMovie)(); else return false; diff --git a/src/st_stuff.c b/src/st_stuff.c index 72266ba2..45e0deb5 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1952,14 +1952,13 @@ static void ST_overlayDrawer(void) ) { // SRB2kart: changed positions & text - V_DrawString(2, BASEVIDHEIGHT-50, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -")); + V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -")); if (stplyr->pflags & PF_WANTSTOJOIN) - V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Cancel Join")); + V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - Cancel Join")); /*else if (G_GametypeHasTeams()) - V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Team"));*/ + V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - Join Team"));*/ else - V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Game")); - V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("F12 - Change View")); + V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("Item - Join Game")); V_DrawString(2, BASEVIDHEIGHT-20, V_HUDTRANSHALF, M_GetText("Accelerate - Float")); V_DrawString(2, BASEVIDHEIGHT-10, V_HUDTRANSHALF, M_GetText("Brake - Sink")); } From 30005ad39bfb3aeb187212a4912dd013126006c0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 27 Sep 2018 17:17:04 -0400 Subject: [PATCH 036/138] Scale fixes --- src/k_kart.c | 44 +++++++++----------------------------------- src/m_menu.c | 2 ++ src/p_mobj.c | 1 + 3 files changed, 12 insertions(+), 35 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index c2a678d3..f8d02292 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2522,7 +2522,7 @@ void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent) I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); - dust = P_SpawnMobj(mo->x + (P_RandomRange(-25,25)<y + (P_RandomRange(-25,25)<z, MT_WIPEOUTTRAIL); + dust = P_SpawnMobj(mo->x + (P_RandomRange(-25,25) * mo->scale), mo->y + (P_RandomRange(-25,25) * mo->scale), mo->z, MT_WIPEOUTTRAIL); P_SetTarget(&dust->target, mo); dust->angle = R_PointToAngle2(0,0,mo->momx,mo->momy); @@ -2591,45 +2591,17 @@ void K_DriftDustHandling(mobj_t *spawner) { dust->z += spawner->height - dust->height; } - dust->momx = FixedMul(spawner->momx + (P_RandomRange(-speedrange, speedrange)<momy = FixedMul(spawner->momy + (P_RandomRange(-speedrange, speedrange)<momz = P_MobjFlip(spawner) * P_RandomRange(1, 4)<momx = FixedMul(spawner->momx + (P_RandomRange(-speedrange, speedrange)<scale)/4); + dust->momy = FixedMul(spawner->momy + (P_RandomRange(-speedrange, speedrange)<scale)/4); + dust->momz = P_MobjFlip(spawner) * (P_RandomRange(1, 4) * (spawner->scale)); P_SetScale(dust, spawner->scale/2); dust->destscale = spawner->scale * 3; + dust->scalespeed = FixedMul(dust->scalespeed, spawner->scale); if (leveltime % 6 == 0) S_StartSound(spawner, sfx_screec); - // Now time for a bunch of flag shit, groooooaann... - if (spawner->flags2 & MF2_DONTDRAW) - dust->flags2 |= MF2_DONTDRAW; - else - dust->flags2 &= ~MF2_DONTDRAW; - - if (spawner->eflags & MFE_VERTICALFLIP) - dust->eflags |= MFE_VERTICALFLIP; - else - dust->eflags &= ~MFE_VERTICALFLIP; - - if (spawner->eflags & MFE_DRAWONLYFORP1) - dust->eflags |= MFE_DRAWONLYFORP1; - else - dust->eflags &= ~MFE_DRAWONLYFORP1; - - if (spawner->eflags & MFE_DRAWONLYFORP2) - dust->eflags |= MFE_DRAWONLYFORP2; - else - dust->eflags &= ~MFE_DRAWONLYFORP2; - - if (spawner->eflags & MFE_DRAWONLYFORP3) - dust->eflags |= MFE_DRAWONLYFORP3; - else - dust->eflags &= ~MFE_DRAWONLYFORP3; - - if (spawner->eflags & MFE_DRAWONLYFORP4) - dust->eflags |= MFE_DRAWONLYFORP4; - else - dust->eflags &= ~MFE_DRAWONLYFORP4; + K_MatchGenericExtraFlags(dust, spawner); } } @@ -2965,7 +2937,10 @@ void K_DoSneaker(player_t *player, boolean doPFlag) const fixed_t prevboost = player->kartstuff[k_speedboost]; if (!player->kartstuff[k_floorboost] || player->kartstuff[k_floorboost] == 3) + { S_StartSound(player->mo, sfx_cdfm01); + K_SpawnDashDustRelease(player); + } if (!player->kartstuff[k_sneakertimer]) { @@ -2976,7 +2951,6 @@ void K_DoSneaker(player_t *player, boolean doPFlag) } player->kartstuff[k_sneakertimer] = sneakertime; - K_SpawnDashDustRelease(player); if (doPFlag) { diff --git a/src/m_menu.c b/src/m_menu.c index 61d1fba9..9957f1eb 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8647,6 +8647,8 @@ static void M_DrawControl(void) W_CachePatchName("M_CURSOR", PU_CACHE)); } +#undef controlheight + static INT32 controltochange; static void M_ChangecontrolResponse(event_t *ev) diff --git a/src/p_mobj.c b/src/p_mobj.c index 0f065733..205a5501 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8266,6 +8266,7 @@ void P_MobjThinker(mobj_t *mobj) P_SetScale(smoke, mobj->target->scale/2); smoke->destscale = 3*mobj->target->scale/2; + smoke->scalespeed = FixedMul(smoke->scalespeed, mobj->target->scale); smoke->momx = mobj->target->momx/2; smoke->momy = mobj->target->momy/2; From 5419ac82ee9055bd0d76158f0fe27bdb8a43b549 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 27 Sep 2018 17:21:06 -0400 Subject: [PATCH 037/138] 1 more fix --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 205a5501..baa21d45 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8272,7 +8272,7 @@ void P_MobjThinker(mobj_t *mobj) smoke->momy = mobj->target->momy/2; smoke->momz = mobj->target->momz/2; - P_Thrust(smoke, mobj->target->angle+FixedAngle(P_RandomRange(135, 225)<mobj_scale); + P_Thrust(smoke, mobj->target->angle+FixedAngle(P_RandomRange(135, 225)<target->scale); } break; case MT_SPARKLETRAIL: From 6d798f00e7cb3b7f089d37ed9e5ce3d23cb292b3 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 27 Sep 2018 18:26:37 -0400 Subject: [PATCH 038/138] Yet another scale fix --- src/k_kart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f8d02292..e6467dea 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3607,9 +3607,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) // Speed lines if ((player->kartstuff[k_sneakertimer] || player->kartstuff[k_driftboost] || player->kartstuff[k_startboost]) && player->speed > 0) { - mobj_t *fast = P_SpawnMobj(player->mo->x + (P_RandomRange(-36,36)<mo->y + (P_RandomRange(-36,36)<mo->z + (player->mo->height/2) + (P_RandomRange(-20,20)<mo->x + (P_RandomRange(-36,36) * player->mo->scale), + player->mo->y + (P_RandomRange(-36,36) * player->mo->scale), + player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale), MT_FASTLINE); fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy); fast->momx = 3*player->mo->momx/4; From 7de6a6320744dd754e74a28e358c35b78817839c Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 27 Sep 2018 18:32:48 -0400 Subject: [PATCH 039/138] Talk key is a two-way toggle for non-keyboard binds --- src/hu_stuff.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 60b4e07f..a5d598d0 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -1155,7 +1155,10 @@ boolean HU_Responder(event_t *ev) c_input = 0; // reset input cursor chat_scrollmedown = true; // you hit enter, so you might wanna autoscroll to see what you just sent. :) } - else if (c == KEY_ESCAPE) + else if (c == KEY_ESCAPE + || ((c == gamecontrol[gc_talkkey][0] || c == gamecontrol[gc_talkkey][1] + || c == gamecontrol[gc_teamkey][0] || c == gamecontrol[gc_teamkey][1]) + && c >= KEY_MOUSE1)) // If it's not a keyboard key, then the chat button is used as a toggle. { chat_on = false; c_input = 0; // reset input cursor From 7c5d47deb510dce1cce7e59d0fbf4c4c0a1dcfe5 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 27 Sep 2018 18:42:42 -0400 Subject: [PATCH 040/138] No mashing in Record Attack --- 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 e6467dea..96e8f64f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -901,7 +901,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) // If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item. // I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think. // Finally, if you get past this check, now you can actually start calculating what item you get. - if ((cmd->buttons & BT_ATTACK) && !(player->kartstuff[k_eggmanheld] || player->kartstuff[k_itemheld]) && player->kartstuff[k_itemroulette] >= roulettestop) + if ((cmd->buttons & BT_ATTACK) && !(player->kartstuff[k_eggmanheld] || player->kartstuff[k_itemheld]) && player->kartstuff[k_itemroulette] >= roulettestop && !modeattacking) { // Mashing reduces your chances for the good items mashed = FixedDiv((player->kartstuff[k_itemroulette])*FRACUNIT, ((TICRATE*3)+roulettestop)*FRACUNIT) - FRACUNIT; From 68bf1f60f3007eac58b979265a7430c32428c94e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 27 Sep 2018 18:44:14 -0400 Subject: [PATCH 041/138] "TICRATE*1"?! --- 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 96e8f64f..aadfd2d2 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -896,7 +896,7 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd) if ((player->kartstuff[k_itemroulette] % 3) == 1 && P_IsLocalPlayer(player)) S_StartSound(NULL, sfx_mkitm1 + ((player->kartstuff[k_itemroulette] / 3) % 8)); - roulettestop = (TICRATE*1) + (3*(pingame - player->kartstuff[k_position])); + roulettestop = TICRATE + (3*(pingame - player->kartstuff[k_position])); // If the roulette finishes or the player presses BT_ATTACK, stop the roulette and calculate the item. // I'm returning via the exact opposite, however, to forgo having another bracket embed. Same result either way, I think. From 8ccaa1fceeb058de8b0edacf0359584e3ec7f10d Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 28 Sep 2018 12:58:07 +0100 Subject: [PATCH 042/138] Flip dynamic slope toggle. --- src/p_slopes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index c516fa97..35d4c423 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -251,7 +251,7 @@ void P_SpawnSlope_Line(int linenum) UINT8 flags = 0; // Slope flags if (line->flags & ML_NOSONIC) flags |= SL_NOPHYSICS; - if (line->flags & ML_NOTAILS) + if (!(line->flags & ML_NOTAILS)) flags |= SL_NODYNAMIC; if (line->flags & ML_NOKNUX) flags |= SL_ANCHORVERTEX; From 21ba9921da532f2dee3cf55fd4f4125166579f8a Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 28 Sep 2018 20:10:22 +0100 Subject: [PATCH 043/138] Some credits tweaks (alphabetical ordering plus new names, plus slight downwards adjustment of `TYLER52`) --- src/f_finale.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 6fabcd96..1cfc1835 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -525,10 +525,13 @@ static const char *credits[] = { "\1Special Thanks", "Sonic Team Jr. & SRB2", "Bandit \"Bobby\" Cochenour", // i <3 my dog + "Bear", // i <3 MY dog too + "\"Chrispy\"", + "\"DirkTheHusky\"", + "\"fickle\"", // and my sharki "\"Nev3r\"", "\"Ritz\"", "\"Spherallic\"", - "\"DirkTheHusky\"", "", "\1Produced By", "Kart Krew", @@ -554,7 +557,7 @@ static struct { {112, 80+200* 7, "CREDIT10"}, {240, 80+200* 8, "CREDIT05"}, {120, 80+200* 9, "CREDIT06"},*/ - {112, 80+200*10, "TYLER52"}, + {112, 80+100+200*10, "TYLER52"}, {0, 0, NULL} }; From 2c1db167da6dab70819b4064cf88c915a5a8183c Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 29 Sep 2018 16:18:16 +0100 Subject: [PATCH 044/138] Correct that thing Lat` found where sometimes the controls menus'd get "stuck" replacing the second key every time, effectively only allowing one key until you clear it and try again. Also, sounds. --- src/m_menu.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 5d0448ce..8be0b479 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2795,6 +2795,7 @@ boolean M_Responder(event_t *ev) { // detach any keys associated with the game control G_ClearControlKeys(setupcontrols, currentMenu->menuitems[itemOn].alphaKey); + S_StartSound(NULL, sfx_shldls); return true; } @@ -8673,23 +8674,22 @@ static void M_ChangecontrolResponse(event_t *ev) setupcontrols[control][found] = ch-KEY_4JOY1+KEY_DBL4JOY1; } else - { - // check if change key1 or key2, or replace the two by the new - found = 0; - if (setupcontrols[control][0] == KEY_NULL) - found++; - if (setupcontrols[control][1] == KEY_NULL) - found++; - if (found == 2) - { - found = 0; - setupcontrols[control][1] = KEY_NULL; //replace key 1,clear key2 - } - G_CheckDoubleUsage(ch); - setupcontrols[control][found] = ch; - } - + { + // check if change key1 or key2, or shuffle them along in a queue + found = 0; + if (setupcontrols[control][0] != KEY_NULL) + { + found++; + if (setupcontrols[control][1] != KEY_NULL) + setupcontrols[control][0] = setupcontrols[control][1]; + } + G_CheckDoubleUsage(ch); + setupcontrols[control][found] = ch; + } + S_StartSound(NULL, sfx_strpst); } + else + S_StartSound(NULL, sfx_skid); M_StopMessage(0); } From 1be13e8e2d1d3baacddff4e081e17aebe7a3406c Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 29 Sep 2018 16:43:00 +0100 Subject: [PATCH 045/138] Fix dehacked list incongruence. --- src/dehacked.c | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ src/info.h | 10 +++++----- 2 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8b60ab61..99d95259 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6704,6 +6704,54 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_KARMAWHEEL", // Karma player wheels + // Thunder shield use stuff; + "S_KSPARK1", // Sparkling Radius + "S_KSPARK2", + "S_KSPARK3", + "S_KSPARK4", + "S_KSPARK5", + "S_KSPARK6", + "S_KSPARK7", + "S_KSPARK8", + "S_KSPARK9", + "S_KSPARK10", + "S_KSPARK11", + "S_KSPARK12", + "S_KSPARK13", // ... that's an awful lot. + + "S_LZIO11", // Straight lightning bolt + "S_LZIO12", + "S_LZIO13", + "S_LZIO14", + "S_LZIO15", + "S_LZIO16", + "S_LZIO17", + "S_LZIO18", + "S_LZIO19", + + "S_LZIO21", // Straight lightning bolt (flipped) + "S_LZIO22", + "S_LZIO23", + "S_LZIO24", + "S_LZIO25", + "S_LZIO26", + "S_LZIO27", + "S_LZIO28", + "S_LZIO29", + + "S_KLIT1", // Diagonal lightning. No, it not being straight doesn't make it gay. + "S_KLIT2", + "S_KLIT3", + "S_KLIT4", + "S_KLIT5", + "S_KLIT6", + "S_KLIT7", + "S_KLIT8", + "S_KLIT9", + "S_KLIT10", + "S_KLIT11", + "S_KLIT12", + #ifdef SEENAMES "S_NAMECHECK", #endif diff --git a/src/info.h b/src/info.h index cfda742c..d0f4be59 100644 --- a/src/info.h +++ b/src/info.h @@ -3557,8 +3557,8 @@ typedef enum state S_KARMAWHEEL, - // Lightning shield use stuff; - S_KSPARK1, // Sparkling Radius + // Thunder shield use stuff; + S_KSPARK1, // Sparkling Radius S_KSPARK2, S_KSPARK3, S_KSPARK4, @@ -3571,7 +3571,7 @@ typedef enum state S_KSPARK11, S_KSPARK12, S_KSPARK13, // ... that's an awful lot. - + S_LZIO11, // Straight lightning bolt S_LZIO12, S_LZIO13, @@ -3581,7 +3581,7 @@ typedef enum state S_LZIO17, S_LZIO18, S_LZIO19, - + S_LZIO21, // Straight lightning bolt (flipped) S_LZIO22, S_LZIO23, @@ -3591,7 +3591,7 @@ typedef enum state S_LZIO27, S_LZIO28, S_LZIO29, - + S_KLIT1, // Diagonal lightning. No, it not being straight doesn't make it gay. S_KLIT2, S_KLIT3, From ab59504be0e5682e72f2353a9498e957f8ccdc9c Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 29 Sep 2018 20:28:27 +0100 Subject: [PATCH 046/138] Experimental: Making the ghetto waypoints we have right now their own mobj list in order to make them slightly less bullshit --- src/info.c | 2 +- src/k_kart.c | 11 +---------- src/p_mobj.c | 3 +++ src/p_mobj.h | 2 ++ src/p_saveg.c | 12 ++++++++---- src/p_tick.c | 1 + 6 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/info.c b/src/info.c index b3e4e7c7..c0fb24fb 100644 --- a/src/info.c +++ b/src/info.c @@ -4089,7 +4089,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 4, // mass 0, // damage sfx_None, // activesound - MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY, // flags + MF_NOBLOCKMAP|MF_NOSECTOR|MF_NOGRAVITY|MF_SCENERY, // flags S_NULL // raisestate }, diff --git a/src/k_kart.c b/src/k_kart.c index ed91616b..db317803 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4235,7 +4235,6 @@ static void K_KartUpdatePosition(player_t *player) fixed_t oldposition = player->kartstuff[k_position]; fixed_t i, ppcd, pncd, ipcd, incd; fixed_t pmo, imo; - thinker_t *th; mobj_t *mo; if (player->spectator || !player->mo) @@ -4260,16 +4259,8 @@ static void K_KartUpdatePosition(player_t *player) player->kartstuff[k_nextcheck] = players[i].kartstuff[k_nextcheck] = 0; // This checks every thing on the map, and looks for MT_BOSS3WAYPOINT (the thing we're using for checkpoint wp's, for now) - for (th = thinkercap.next; th != &thinkercap; th = th->next) + for (mo = waypointcap; mo != NULL; mo = mo->tracer) { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) // Not a mobj at all, shoo - continue; - - mo = (mobj_t *)th; - - if (mo->type != MT_BOSS3WAYPOINT) // TODO: Change to 'MT_WAYPOINT'? - continue; - pmo = P_AproxDistance(P_AproxDistance( mo->x - player->mo->x, mo->y - player->mo->y), mo->z - player->mo->z) / FRACUNIT; diff --git a/src/p_mobj.c b/src/p_mobj.c index 0f065733..d22d5cb6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -48,6 +48,7 @@ actioncache_t actioncachehead; static mobj_t *overlaycap = NULL; static mobj_t *shadowcap = NULL; +mobj_t *waypointcap = NULL; void P_InitCachedActions(void) { @@ -11076,6 +11077,8 @@ ML_NOCLIMB : Direction not controllable else if (i == MT_BOSS3WAYPOINT) // SRB2kart 120217 - Used to store checkpoint num { mobj->health = mthing->angle; + P_SetTarget(&mobj->tracer, waypointcap); + P_SetTarget(&waypointcap, mobj); } else if (i == MT_SPIKE) { diff --git a/src/p_mobj.h b/src/p_mobj.h index 34d1f644..df6e7642 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -429,6 +429,8 @@ typedef struct actioncache_s extern actioncache_t actioncachehead; +extern mobj_t *waypointcap; + void P_InitCachedActions(void); void P_RunCachedActions(void); void P_AddCachedAction(mobj_t *mobj, INT32 statenum); diff --git a/src/p_saveg.c b/src/p_saveg.c index d9f43000..ffcc8789 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -945,11 +945,10 @@ typedef enum MD2_EXTVAL2 = 1<<6, MD2_HNEXT = 1<<7, MD2_HPREV = 1<<8, + MD2_COLORIZED = 1<<9, + MD2_WAYPOINTCAP = 1<<10 #ifdef ESLOPE - MD2_SLOPE = 1<<9, - MD2_COLORIZED = 1<<10 -#else - MD2_COLORIZED = 1<<9 + , MD2_SLOPE = 1<<11 #endif } mobj_diff2_t; @@ -1146,6 +1145,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) #endif if (mobj->colorized) diff2 |= MD2_COLORIZED; + if (mobj == waypointcap) + diff2 |= MD2_WAYPOINTCAP; if (diff2 != 0) diff |= MD_MORE; @@ -2165,6 +2166,9 @@ static void LoadMobjThinker(actionf_p1 thinker) P_AddThinker(&mobj->thinker); + if (diff2 & MD2_WAYPOINTCAP) + P_SetTarget(&waypointcap, mobj); + mobj->info = (mobjinfo_t *)next; // temporarily, set when leave this function } diff --git a/src/p_tick.c b/src/p_tick.c index 3a55353d..3c5ed0b9 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -180,6 +180,7 @@ void Command_CountMobjs_f(void) void P_InitThinkers(void) { thinkercap.prev = thinkercap.next = &thinkercap; + waypointcap = NULL; } // From 800b3bb2407f793730b88f2b6c70c583f3a2f8a8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 30 Sep 2018 22:18:48 +0100 Subject: [PATCH 047/138] Move player + player mobj existence checks to top of P_MoveChaseCamera. This is the only place it makes sense to even check them tbh. While I'm at it, let's also use the "mo" variable instead of player->mo throughout the function (to be consistent) --- src/p_user.c | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index da8e19ca..91b5feb8 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7853,7 +7853,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall subsector_t *newsubsec; fixed_t f1, f2; - cameranoclip = (player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) || (player->mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!! + // We probably shouldn't move the camera if there is no player or player mobj somehow + if (!player || !player->mo) + return true; + + mo = player->mo; + + cameranoclip = (player->pflags & (PF_NOCLIP|PF_NIGHTSMODE)) || (mo->flags & (MF_NOCLIP|MF_NOCLIPHEIGHT)); // Noclipping player camera noclips too!! if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) { @@ -7874,7 +7880,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall else if (player == &players[secondarydisplayplayer]) focusangle = localangle2; else - focusangle = player->mo->angle; + focusangle = mo->angle; if (thiscam == &camera) camrotate = cv_cam_rotate.value; else if (thiscam == &camera2) @@ -7886,17 +7892,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall return true; } - if (!player || !player->mo) - return true; - - mo = player->mo; - thiscam->radius = FixedMul(20*FRACUNIT, mo->scale); thiscam->height = FixedMul(16*FRACUNIT, mo->scale); - if (!mo) - return true; - // Don't run while respawning from a starpost // Inu 4/8/13 Why not?! // if (leveltime > 0 && timeinmap <= 0) @@ -7904,7 +7902,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (player->pflags & PF_NIGHTSMODE) { - focusangle = player->mo->angle; + focusangle = mo->angle; focusaiming = 0; } else if (player == &players[consoleplayer]) @@ -7919,7 +7917,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } else { - focusangle = player->mo->angle; + focusangle = mo->angle; focusaiming = player->aiming; } @@ -7966,12 +7964,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall angle = R_PointToAngle2(player->axis1->x, player->axis1->y, player->axis2->x, player->axis2->y); angle += ANGLE_90; } - else if (player->mo->target) + else if (mo->target) { - if (player->mo->target->flags & MF_AMBUSH) - angle = R_PointToAngle2(player->mo->target->x, player->mo->target->y, player->mo->x, player->mo->y); + if (mo->target->flags & MF_AMBUSH) + angle = R_PointToAngle2(mo->target->x, mo->target->y, mo->x, mo->y); else - angle = R_PointToAngle2(player->mo->x, player->mo->y, player->mo->target->x, player->mo->target->y); + angle = R_PointToAngle2(mo->x, mo->y, mo->target->x, mo->target->y); } } else if (P_AnalogMove(player)) // Analog @@ -8066,7 +8064,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (twodlevel || (mo->flags2 & MF2_TWOD)) { // Camera doesn't ALWAYS need to move, only when running... - if (abs(player->mo->momx) > 10) + if (abs(mo->momx) > 10) { // Move the camera all smooth-like, not jerk it around... if (mo->momx > 0) @@ -8384,13 +8382,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall vy = thiscam->y; } - if (P_AproxDistance(vx - player->mo->x, vy - player->mo->y) < FixedMul(48*FRACUNIT, mo->scale)) - player->mo->flags2 |= MF2_SHADOW; + if (P_AproxDistance(vx - mo->x, vy - mo->y) < FixedMul(48*FRACUNIT, mo->scale)) + mo->flags2 |= MF2_SHADOW; else - player->mo->flags2 &= ~MF2_SHADOW; + mo->flags2 &= ~MF2_SHADOW; } else - player->mo->flags2 &= ~MF2_SHADOW; + mo->flags2 &= ~MF2_SHADOW; /* if (!resetcalled && (player->pflags & PF_NIGHTSMODE && player->exiting)) { From 73100b22d54f6385c363a73376b0aad3183259ec Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 30 Sep 2018 21:46:12 -0400 Subject: [PATCH 048/138] Please don't punish offline practice --- src/g_game.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 42baee93..c14f1b1f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2282,28 +2282,11 @@ static inline void G_PlayerFinishLevel(INT32 player) { if (legitimateexit && !demoplayback && !mapreset) // (yes you're allowed to unlock stuff this way when the game is modified) { - UINT8 i = 0; - - if (netgame) + matchesplayed++; + if (M_UpdateUnlockablesAndExtraEmblems(true)) { - // check to see if there's anyone else at all - for (; i < MAXPLAYERS; i++) - { - if (i == consoleplayer) - continue; - if (playeringame[i] && !stplyr->spectator) - break; - } - } - - if (i != MAXPLAYERS) // Not FREE PLAY - { - matchesplayed++; - if (M_UpdateUnlockablesAndExtraEmblems(true)) - { - S_StartSound(NULL, sfx_ncitem); - G_SaveGameData(true); // only save if unlocked something - } + S_StartSound(NULL, sfx_ncitem); + G_SaveGameData(true); // only save if unlocked something } } From 0ec952d019aabc2db8ea45afeaf0c2acfd0ef907 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 12:12:48 +0100 Subject: [PATCH 049/138] Add a `SECTIONRACE` map flag. So far, all it does is prevent the number of laps from exceeding the map default, but it's a base to work off of if we want to add any other changes specifically for section races in future. --- src/dehacked.c | 8 ++++++++ src/doomstat.h | 1 + src/p_setup.c | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 99d95259..2efdb6bc 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1308,6 +1308,13 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_NOZONE; } + else if (fastcmp(word, "SECTIONRACE")) + { + if (i || word2[0] == 'T' || word2[0] == 'Y') + mapheaderinfo[num-1]->levelflags |= LF_SECTIONRACE; + else + mapheaderinfo[num-1]->levelflags &= ~LF_SECTIONRACE; + } // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) @@ -7943,6 +7950,7 @@ struct { {"LF_NOSSMUSIC",LF_NOSSMUSIC}, {"LF_NORELOAD",LF_NORELOAD}, {"LF_NOZONE",LF_NOZONE}, + {"LF_SECTIONRACE",LF_SECTIONRACE}, // And map flags {"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, diff --git a/src/doomstat.h b/src/doomstat.h index fc13b0e8..296c11bf 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -272,6 +272,7 @@ typedef struct #define LF_NOSSMUSIC 4 ///< Disable Super Sonic music #define LF_NORELOAD 8 ///< Don't reload level on death #define LF_NOZONE 16 ///< Don't include "ZONE" on level title +#define LF_SECTIONRACE 32 ///< Section race level #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/p_setup.c b/src/p_setup.c index 6c7b6e92..e705a3f0 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2916,7 +2916,9 @@ boolean P_SetupLevel(boolean skipprecip) } else if (G_RaceGametype() && server) CV_StealthSetValue(&cv_numlaps, - ((netgame || multiplayer) && cv_basenumlaps.value) + ((netgame || multiplayer) && cv_basenumlaps.value + && (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) + || (mapheaderinfo[gamemap - 1]->numlaps > cv_basenumlaps.value))) ? cv_basenumlaps.value : mapheaderinfo[gamemap - 1]->numlaps); From 96506359f16a2bccbe3bff3559657bef7480018d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 1 Oct 2018 07:21:02 -0400 Subject: [PATCH 050/138] Goodbye cvar --- src/d_netcmd.c | 8 ++++---- src/g_game.c | 4 ++-- src/g_game.h | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 144e4bf9..6d1ccb8d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -796,10 +796,10 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_consolechat); CV_RegisterVar(&cv_chatnotifications); CV_RegisterVar(&cv_chatbacktint); - CV_RegisterVar(&cv_crosshair); - CV_RegisterVar(&cv_crosshair2); - CV_RegisterVar(&cv_crosshair3); - CV_RegisterVar(&cv_crosshair4); + //CV_RegisterVar(&cv_crosshair); + //CV_RegisterVar(&cv_crosshair2); + //CV_RegisterVar(&cv_crosshair3); + //CV_RegisterVar(&cv_crosshair4); //CV_RegisterVar(&cv_alwaysfreelook); //CV_RegisterVar(&cv_alwaysfreelook2); diff --git a/src/g_game.c b/src/g_game.c index c14f1b1f..f20ccdc5 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -428,10 +428,10 @@ consvar_t cv_chatbacktint = {"chatbacktint", "Off", CV_SAVE, CV_OnOff, NULL, 0, static CV_PossibleValue_t consolechat_cons_t[] = {{0, "Window"}, {1, "Console"}, {0, NULL}}; consvar_t cv_consolechat = {"chatmode", "Window", CV_SAVE, consolechat_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +/*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair2 = {"crosshair2", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_crosshair3 = {"crosshair3", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_crosshair4 = {"crosshair4", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_crosshair4 = {"crosshair4", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};*/ consvar_t cv_invertmouse = {"invertmouse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_alwaysfreelook = {"alwaysmlook", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_invertmouse2 = {"invertmouse2", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/g_game.h b/src/g_game.h index 10eb4c68..e34a6986 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -55,7 +55,7 @@ extern INT16 rw_maximums[NUM_WEAPONS]; // used in game menu extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatspamprotection, cv_chatbacktint; -extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4; +//extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4; extern consvar_t cv_invertmouse, cv_alwaysfreelook, cv_mousemove; extern consvar_t cv_turnaxis,cv_moveaxis,cv_brakeaxis,cv_aimaxis,cv_lookaxis,cv_fireaxis,cv_driftaxis; extern consvar_t cv_turnaxis2,cv_moveaxis2,cv_brakeaxis2,cv_aimaxis2,cv_lookaxis2,cv_fireaxis2,cv_driftaxis2; From f1267f8ae1f23e72bda195bdbc767da6fc83b533 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 12:27:35 +0100 Subject: [PATCH 051/138] Don't allow a new driftboost of lesser magnitude to completely cancel an existing driftboost. --- src/k_kart.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 650a2149..d3abfcb5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4113,7 +4113,8 @@ static void K_KartDrift(player_t *player, boolean onground) && (player->kartstuff[k_driftcharge] >= dsone && player->kartstuff[k_driftcharge] < dstwo) && onground) { - player->kartstuff[k_driftboost] = 20; + if (player->kartstuff[k_driftboost] < 20) + player->kartstuff[k_driftboost] = 20; S_StartSound(player->mo, sfx_s23c); //K_SpawnDashDustRelease(player); player->kartstuff[k_driftcharge] = 0; @@ -4123,7 +4124,8 @@ static void K_KartDrift(player_t *player, boolean onground) && player->kartstuff[k_driftcharge] < dsthree && onground) { - player->kartstuff[k_driftboost] = 50; + if (player->kartstuff[k_driftboost] < 50) + player->kartstuff[k_driftboost] = 50; S_StartSound(player->mo, sfx_s23c); //K_SpawnDashDustRelease(player); player->kartstuff[k_driftcharge] = 0; @@ -4133,7 +4135,8 @@ static void K_KartDrift(player_t *player, boolean onground) && player->kartstuff[k_driftcharge] >= dsthree && onground) { - player->kartstuff[k_driftboost] = 125; + if (player->kartstuff[k_driftboost] < 125) + player->kartstuff[k_driftboost] = 125; S_StartSound(player->mo, sfx_s23c); //K_SpawnDashDustRelease(player); player->kartstuff[k_driftcharge] = 0; From 14a5ffbfd81e75505c8a7824c2141ca69ca03e91 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 12:52:54 +0100 Subject: [PATCH 052/138] Based on netgame comments last night, update the tab rankings info to show less information in race. --- src/hu_stuff.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ab427b48..fe2eb359 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2226,22 +2226,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (G_RaceGametype()) { -#define timestring(time) va("%i:%02i.%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time)) +#define timestring(time) va("%i'%02i\"%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time)) if (players[tab[i].num].exiting) - { - V_DrawRightAlignedString(x, y-4, hilicol, "FIN"); V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime)); - } else if (players[tab[i].num].pflags & PF_TIMEOVER) - V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "TIME OVER..."); + V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "NO CONTEST."); else if (circuitmap) - { - V_DrawRightAlignedString(x, y-4, 0, "Lap"); - V_DrawRightAlignedString(x, y+4, 0, va("%d", tab[i].count)); - V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(players[tab[i].num].starposttime)); - } - else - V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(tab[i].count)); + V_DrawRightAlignedString(x+rightoffset, y, 0, va("Lap %d", tab[i].count)); #undef timestring } else From 379772e5aa941c17e7105d953413b2d09365a7d8 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 13:25:13 +0100 Subject: [PATCH 053/138] Allow respawning spectators before starttime is up because they no longer spawn in a condition that allows them to get an unfair advantage (drop dash or its ghetto 2.0-esque predecessor) Also, some camera tweaks: * Force chasecam when exiting, just like it's forced when you're dead and not a spectator. * Force a horizontal camera angle aiming when spectator and dead, to avoid skybox bugs. --- src/p_user.c | 7 ++++--- src/r_main.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index d3407bd6..7646ca6d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7915,7 +7915,7 @@ static void P_DeathThink(player_t *player) /*if (player->deadtimer > 30*TICRATE && !G_RaceGametype()) player->playerstate = PST_REBORN; else if (player->lives > 0 && !G_IsSpecialStage(gamemap)*/ - if (player->lives > 0 && leveltime >= starttime) // *could* you respawn? + if (player->lives > 0 /*&& leveltime >= starttime*/) // *could* you respawn? { // SRB2kart - spawn automatically after 1 second if (player->deadtimer > ((netgame || multiplayer) @@ -8681,9 +8681,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall { // Don't let the camera match your movement. thiscam->momz = 0; - + if (player->spectator) + thiscam->aiming = 0; // Only let the camera go a little bit downwards. - if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming < ANGLE_337h && thiscam->aiming > ANGLE_180) + else if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming < ANGLE_337h && thiscam->aiming > ANGLE_180) thiscam->aiming = ANGLE_337h; else if (mo->eflags & MFE_VERTICALFLIP && thiscam->aiming > ANGLE_22h && thiscam->aiming < ANGLE_180) thiscam->aiming = ANGLE_22h; diff --git a/src/r_main.c b/src/r_main.c index 5990224c..5da98c8e 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1094,7 +1094,7 @@ void R_SetupFrame(player_t *player, boolean skybox) chasecam = (cv_chasecam.value != 0); } - if (player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD) + if (player->playerstate == PST_DEAD || player->exiting) chasecam = true; // force chasecam on else if (player->spectator) // no spectator chasecam chasecam = false; // force chasecam off From e6fd41339adc2680a2fe4a91359b253daf7e9a0e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 1 Oct 2018 08:41:44 -0400 Subject: [PATCH 054/138] DrawFill supports splitscreen offset flags --- src/g_game.c | 2 +- src/hardware/hw_draw.c | 8 ++++++++ src/v_video.c | 8 ++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index f20ccdc5..bd55ea9f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -340,7 +340,7 @@ void SendWeaponPref2(void); void SendWeaponPref3(void); void SendWeaponPref4(void); -static CV_PossibleValue_t crosshair_cons_t[] = {{0, "Off"}, {1, "Cross"}, {2, "Angle"}, {3, "Point"}, {0, NULL}}; +//static CV_PossibleValue_t crosshair_cons_t[] = {{0, "Off"}, {1, "Cross"}, {2, "Angle"}, {3, "Point"}, {0, NULL}}; static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"}, #ifdef _WII {1, "LStick.X"}, {2, "LStick.Y"}, {-1, "LStick.X-"}, {-2, "LStick.Y-"}, diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index f1949325..98bb434a 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -857,6 +857,10 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color) else if (!(color & V_SNAPTOTOP)) fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2; } + if (color & V_SPLITSCREEN) + fy += ((float)BASEVIDHEIGHT * dupy)/2; + if (color & V_HORZSCREEN) + fx += ((float)BASEVIDWIDTH * dupx)/2; } if (fx >= vid.width || fy >= vid.height) @@ -963,6 +967,10 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 else if (!(options & V_SNAPTOTOP)) fy += ((float)vid.height - ((float)BASEVIDHEIGHT * dupy)) / 2; } + if (options & V_SPLITSCREEN) + fy += ((float)BASEVIDHEIGHT * dupy)/2; + if (options & V_HORZSCREEN) + fx += ((float)BASEVIDWIDTH * dupx)/2; } if (fx >= vid.width || fy >= vid.height) diff --git a/src/v_video.c b/src/v_video.c index 46d34acc..9d4fca45 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -820,6 +820,10 @@ void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c) else if (!(c & V_SNAPTOTOP)) y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2; } + if (c & V_SPLITSCREEN) + y += (BASEVIDHEIGHT * dupy)/2; + if (c & V_HORZSCREEN) + x += (BASEVIDWIDTH * dupx)/2; } if (x >= vid.width || y >= vid.height) @@ -901,6 +905,10 @@ void V_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 c) else if (!(c & V_SNAPTOTOP)) y += (vid.height - (BASEVIDHEIGHT * dupy)) / 2; } + if (c & V_SPLITSCREEN) + y += (BASEVIDHEIGHT * dupy)/2; + if (c & V_HORZSCREEN) + x += (BASEVIDWIDTH * dupx)/2; } if (x >= vid.width || y >= vid.height) From d0e629a8e284d811b68f1296bbb148b52028b3a7 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 13:51:23 +0100 Subject: [PATCH 055/138] Correct some inconsistencies I missed in the previous commit. --- src/p_user.c | 2 +- src/r_main.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 7646ca6d..f34b1a2e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8188,7 +8188,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall || (leveltime < introtime)); // Kart intro cam #endif - if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) + if (!(player->playerstate == PST_DEAD || player->exiting)) { if (player->spectator) // force cam off for spectators return true; diff --git a/src/r_main.c b/src/r_main.c index 5da98c8e..d83ce8d0 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1094,10 +1094,10 @@ void R_SetupFrame(player_t *player, boolean skybox) chasecam = (cv_chasecam.value != 0); } - if (player->playerstate == PST_DEAD || player->exiting) - chasecam = true; // force chasecam on - else if (player->spectator) // no spectator chasecam + if (player->spectator) // no spectator chasecam chasecam = false; // force chasecam off + else if (player->playerstate == PST_DEAD || player->exiting) + chasecam = true; // force chasecam on if (chasecam && !thiscam->chase) { From c9da6cd8562191391e7a730519429e381bffb8e5 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 18:10:12 +0100 Subject: [PATCH 056/138] Minor HUD offset tweak for splitscreen eggnum. --- 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 d3abfcb5..5c99a040 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5929,7 +5929,7 @@ static void K_drawKartItem(void) // Quick Eggman numbers if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/) - V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); + V_DrawScaledPatch(ITEM_X+17-offset, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); } void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing) From 49acbe9beeee8ab8e55681329f77c74ac754da60 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Mon, 1 Oct 2018 20:23:56 +0200 Subject: [PATCH 057/138] Fix /me and sayteam, except sayteam now actually doesn't do anything anymore. --- src/hu_stuff.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ab427b48..67a65645 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -721,7 +721,20 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) { cstart = "\x86"; // grey name textcolor = "\x86"; - } + } + else if (target == -1) // say team + { + if (players[playernum].ctfteam == 1) // red + { + cstart = "\x85"; + textcolor = "\x85"; + } + else // blue + { + cstart = "\x84"; + textcolor = "\x84"; + } + } else { const UINT8 color = players[playernum].skincolor; @@ -783,13 +796,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) // '\4' makes the message yellow and beeps; '\3' just beeps. if (action) { - fmt = "\3* %s%s%s%s \x82%s\n"; // don't make /me yellow, yellow will be for mentions and PMs! - fmt2 = "* %s%s%s%s \x82%s"; - } - else if (target == 0) // To everyone - { - fmt = "\3%s<%s%s%s>\x80 %s%s\n"; - fmt2 = "%s<%s%s%s>\x80 %s%s"; + fmt = "\3* %s%s%s%s \x82%s%s\n"; // don't make /me yellow, yellow will be for mentions and PMs! + fmt2 = "* %s%s%s%s \x82%s%s"; } else if (target-1 == consoleplayer) // To you { @@ -809,7 +817,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) fmt2 = "%s<%s%s>%s\x80 %s%s"; } - else // To your team + else // To everyone or sayteam, it doesn't change anything. + { + fmt = "\3%s<%s%s%s>\x80 %s%s\n"; + fmt2 = "%s<%s%s%s>\x80 %s%s"; + } + /*else // To your team { if (players[playernum].ctfteam == 1) // red prefix = "\x85[TEAM]"; @@ -820,8 +833,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) fmt = "\3%s<%s%s>\x80%s %s%s\n"; fmt2 = "%s<%s%s>\x80%s %s%s"; - - } + }*/ HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg)); // add it reguardless, in case we decide to change our mind about our chat type. @@ -1070,7 +1082,8 @@ boolean HU_Responder(event_t *ev) return false; chat_on = true; w_chat[0] = 0; - teamtalk = true; + teamtalk = false; // CHANGE THIS TO TRUE TO MAKE SAYTEAM WORK AGAIN + //teamtalk = true; chat_scrollmedown = true; return true; } @@ -1955,10 +1968,13 @@ void HU_Drawer(void) } else { + if (netgame) // Don't draw it outside, I know it leads to stupid stuff. + { chat_scrolltime = 0; // do scroll anyway. typelines = 1; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time. if (!OLDCHAT) HU_drawMiniChat(); // draw messages in a cool fashion. + } } if (netgame) // would handle that in hu_drawminichat, but it's actually kinda awkward when you're typing a lot of messages. (only handle that in netgames duh) From d42736fe3d871de36b7f50c56b561cfb3f75ad44 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 21:23:00 +0100 Subject: [PATCH 058/138] Include srb2.org in the credits per Rob's wishes. --- src/f_finale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index 1cfc1835..484ffcff 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -523,7 +523,7 @@ static const char *credits[] = { "\"VirtAnderson\"", "", "\1Special Thanks", - "Sonic Team Jr. & SRB2", + "Sonic Team Jr. & SRB2 (www.srb2.org)", "Bandit \"Bobby\" Cochenour", // i <3 my dog "Bear", // i <3 MY dog too "\"Chrispy\"", From 147b7a5786c14ad4426888253041d3de9e111fab Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 21:48:52 +0100 Subject: [PATCH 059/138] Modified SPB to not route through P_DamageMobj (so wehave more control over the shield dropping/item obliteration, given Sryder picking up his own Thundershield...) --- src/k_kart.c | 25 +++++++++++++++++++++---- src/p_inter.c | 13 ------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 5c99a040..f51abb1a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3016,7 +3016,7 @@ static void K_DoShrink(player_t *player) } } -static void K_DoSPB(player_t *victim, player_t *source) +static void K_DoSPB(player_t *victim) { //INT32 i; S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG! @@ -3027,8 +3027,25 @@ static void K_DoSPB(player_t *victim, player_t *source) P_FlashPal(&players[i], PAL_NUKE, 10); }*/ - if (victim->mo && !victim->spectator) - P_DamageMobj(victim->mo, source->mo, source->mo, 65); + if (!victim->mo || !victim->mo->health || victim->spectator) + return; + + { + mobj_t *spbexplode; + + if (!victim->kartstuff[k_invincibilitytimer] && !victim->kartstuff[k_growshrinktimer]) + { + K_DropHnextList(victim); + K_StripItems(victim); + } + + victim->powers[pw_flashing] = 0; + + spbexplode = P_SpawnMobj(victim->mo->x, victim->mo->y, victim->mo->z, MT_BLUEEXPLOSION); + + if (playeringame[spbplayer] && !players[spbplayer].spectator && players[spbplayer].mo) + P_SetTarget(&spbexplode->target, players[spbplayer].mo); + } } void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) @@ -3820,7 +3837,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_deathsentence]) { if (player->kartstuff[k_deathsentence] == 1) - K_DoSPB(player, &players[spbplayer]); + K_DoSPB(player); player->kartstuff[k_deathsentence]--; } diff --git a/src/p_inter.c b/src/p_inter.c index 4a120a42..bd02da42 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3385,19 +3385,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da S_StartSound(player->mo, sfx_kc59); return true; } - - // Self-Propelled Bomb - if (damage == 65) - { - mobj_t *spbexplode; - if (player == source->player) - return false; - // Just need to do this now! Being thrown upwards is done by the explosion. - //P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING); - spbexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION); - P_SetTarget(&spbexplode->target, source); - return true; - } //} // Sudden-Death mode From 445013b0f91730e934c4be722dfc1f023d846147 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 22:44:17 +0100 Subject: [PATCH 060/138] Wrong bracket level for flashing-set. --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f51abb1a..6d1ef8af 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3037,9 +3037,9 @@ static void K_DoSPB(player_t *victim) { K_DropHnextList(victim); K_StripItems(victim); - } - victim->powers[pw_flashing] = 0; + victim->powers[pw_flashing] = 0; + } spbexplode = P_SpawnMobj(victim->mo->x, victim->mo->y, victim->mo->z, MT_BLUEEXPLOSION); From 58b52adf7eec10c52e8492122750d43a143c0bb0 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 1 Oct 2018 19:23:38 -0400 Subject: [PATCH 061/138] Address toast review - Re-add highlighting to the header text, and shift it back up slightly - Move the viewpoint loop break out of a while and into the main loop --- src/g_game.c | 27 +++++++++++++++------------ src/m_menu.c | 10 +++++----- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index bd55ea9f..d77d04f8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1826,12 +1826,26 @@ boolean G_Responder(event_t *ev) if (displayplayer == MAXPLAYERS) displayplayer = 0; + if (displayplayer == consoleplayer) + break; // End loop + if (!playeringame[displayplayer]) continue; if (players[displayplayer].spectator) continue; + // SRB2Kart: Only go through players who are actually playing + if (players[displayplayer].exiting) + continue; + + // I don't know if we want this actually, but I'll humor the suggestion anyway + if (G_BattleGametype()) + { + if (players[displayplayer].kartstuff[k_bumper] <= 0) + continue; + } + // SRB2Kart: we have no team-based modes, YET... /*if (G_GametypeHasTeams()) { @@ -1857,19 +1871,8 @@ boolean G_Responder(event_t *ev) continue; }*/ - // SRB2Kart: Only go through players who are actually playing - if (players[displayplayer].exiting) - continue; - - // I don't know if we want this actually, but I'll humor the suggestion anyway - if (G_BattleGametype()) - { - if (players[displayplayer].kartstuff[k_bumper] <= 0) - continue; - } - break; - } while (displayplayer != consoleplayer); + } // change statusbar also if playing back demo if (singledemo) diff --git a/src/m_menu.c b/src/m_menu.c index 9957f1eb..1e952d1a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8588,11 +8588,11 @@ static void M_DrawControl(void) // draw title (or big pic) M_DrawMenuTitle(); - M_CentreText(30, - (setupcontrols_fourthplayer ? "Set controls for Player 4" : - (setupcontrols_thirdplayer ? "Set controls for Player 3" : - (setupcontrols_secondaryplayer ? "Set controls for Player 2" : - "Press ENTER to change, BACKSPACE to clear")))); + M_CentreText(28, + (setupcontrols_fourthplayer ? "\x86""Set controls for ""\x82""Player 4" : + (setupcontrols_thirdplayer ? "\x86""Set controls for ""\x82""Player 3" : + (setupcontrols_secondaryplayer ? "\x86""Set controls for ""\x82""Player 2" : + "\x86""Press ""\x82""ENTER""\x86"" to change, ""\x82""BACKSPACE""\x86"" to clear")))); if (i) V_DrawString(currentMenu->x - 16, y-(skullAnimCounter/5), highlightflags, "\x1A"); // up arrow From 4b9d5f251e0eba8168f54784f608f51d76fad693 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 2 Oct 2018 16:51:17 +0100 Subject: [PATCH 062/138] Fix incorrect alignment of selected-level Ruby in vote drawer. --- src/y_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index e26d4973..46e15e39 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1137,7 +1137,7 @@ void Y_VoteDrawer(void) else { V_DrawFixedPatch((x+40)< Date: Tue, 2 Oct 2018 16:52:02 +0100 Subject: [PATCH 063/138] Revert "Just realised the inputwheel jittering in Sryder's videos was my fault, so fix this even better" This reverts commit 8aff76b8c301861edb0f574b17d1d41b539fd6a0. --- src/k_kart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index 6d1ef8af..ef909b5f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7116,7 +7116,10 @@ static void K_drawInput(void) } if (pn < 0) + { splitflags |= V_FLIP; // right turn + x--; + } target = abs(pn); if (target > 4) From cfd2b021a40434d17cdcd5217b8f899c6038ed3c Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 17:04:41 +0100 Subject: [PATCH 064/138] Nuke a bunch of iteration things that have no purpose in SRB2Kart. A full explanation of my reasoning and what it affects is as follows. p_inter.c - Everything to do with setting states for starposts In SRB2Kart, starposts are invisble. We don't need to loop through all thinkers just to set their states when there's no visible effect of the state-setting. In addition, it has no consequences for gameplay - starposts have long been silent here, and all checking is done regarding their health, not their state. Remove extremely low-traffic conditionals (MT_FLINGEMERALD collision height extension, for example) These objects serve no functional purpose during regular SRB2Kart gameplay. Why should every other object have to pay an admittedly minor performance hit just for them? Disable all mechanisms of damaging bosses or enemies with the player's physical contact With the exception of Sapphire Coast, no MF_ENEMY objects exist in the entirety of the standard roster. In addition, the conditions for damaging the enemies were impossible to achieve, because they required vanilla SRB2 mechanics such as "jumping", "spindashing", or "super". Therefore, they can be safely commented out. Disable NiGHTS-related material (excepting bumper, hoop, and wing-emblem objects) NiGHTS is fundamentally incompatible with regular kart gameplay and I believe was already broken. Therefore, any mechanism which enters, aids, or abets it can be safely disabled. Comment out Tag mechanisms Tag is the only vanilla multiplayer gametype which has sufficient gameplay depth and complexity (HEYOOOOOOOOO) to require dedicated thinking in and of itself in order to manage. This thinking is irrelevant to Kart's functioning, and can be neutered easily. d_clisrv.c Comment out Tag mechanisms See p_inter.c d_netcmd.c Disable several devmode commands which are irrelevant to SRB2Kart gameplay When investigating for references to NiGHTS material, I discovered that these remained untouched. In order to present a more coherent game, I have hidden the ones that serve no purpose for us. Comment out Tag mechanisms See p_inter.c g_game.c Disable NiGHTS-related material See p_inter.c Disable some team-related material Teams are not present in SRB2Kart at present. Obviously we'd want to reconsider for future, but it doesn't need to be run right now. Everything to do with setting states for starposts See p_inter.c m_cheat.c Disable several devmode commands which are irrelevant to SRB2Kart gameplay See d_netcmd.c p_map.c Remove extremely low-traffic conditionals (MT_EGGSHIELD collision, for example) See p_inter.c Disable NiGHTS-related material See p_inter.c p_mobj.c Disable P_EmeraldManager Power stones, despite their relevance in vanilla Match, are not in SRB2Kart's Battle. No management of nonexistent emeralds is required. p_setup.c Everything to do with setting states for starposts See p_inter.c p_spec.c Disable NiGHTS-related material See p_inter.c Everything to do with setting states for starposts See p_inter.c p_telept.c Everything to do with setting states for starposts See p_inter.c p_tick.c Disable some team-related material See g_game.c Disable P_EmeraldManager See p_mobj.c Do not run shields Shield objects are not run under the vanilla system; the Thunder Shield is a domain-specific recreation using a standard mobjthinker. Do not run special stages SRB2Kart does not have special stages. Comment out Tag mechanisms See p_inter.c y_inter.c Disable some team-related material See g_game.c p_user.c Disable NiGHTS-related material See p_inter.c Disable 2d movement for players 2D mode? In a kart racer? :nick: --- src/d_clisrv.c | 4 +- src/d_netcmd.c | 12 ++--- src/g_game.c | 10 ++--- src/m_cheat.c | 12 ++--- src/m_cheat.h | 8 ++-- src/p_inter.c | 120 +++++++++---------------------------------------- src/p_local.h | 13 +++--- src/p_map.c | 41 ++++++++--------- src/p_mobj.c | 4 +- src/p_setup.c | 1 - src/p_spec.c | 9 ++-- src/p_telept.c | 4 -- src/p_tick.c | 16 +++---- src/p_user.c | 56 ++++++++--------------- src/y_inter.c | 4 +- 15 files changed, 102 insertions(+), 212 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 63393690..4dc5ed7e 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2491,9 +2491,9 @@ static void CL_RemovePlayer(INT32 playernum) LUA_InvalidatePlayer(&players[playernum]); #endif - if (G_TagGametype()) //Check if you still have a game. Location flexible. =P + /*if (G_TagGametype()) //Check if you still have a game. Location flexible. =P P_CheckSurvivors(); - else if (G_BattleGametype()) // SRB2Kart + else*/ if (G_BattleGametype()) // SRB2Kart K_CheckBumpers(); else if (G_RaceGametype()) P_CheckRacers(); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 144e4bf9..76ea3d6f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -915,19 +915,19 @@ void D_RegisterClientCommands(void) COM_AddCommand("noclip", Command_CheatNoClip_f); COM_AddCommand("god", Command_CheatGod_f); COM_AddCommand("notarget", Command_CheatNoTarget_f); - COM_AddCommand("getallemeralds", Command_Getallemeralds_f); + /*COM_AddCommand("getallemeralds", Command_Getallemeralds_f); COM_AddCommand("resetemeralds", Command_Resetemeralds_f); COM_AddCommand("setrings", Command_Setrings_f); COM_AddCommand("setlives", Command_Setlives_f); - COM_AddCommand("setcontinues", Command_Setcontinues_f); + COM_AddCommand("setcontinues", Command_Setcontinues_f);*/ COM_AddCommand("devmode", Command_Devmode_f); COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f); COM_AddCommand("scale", Command_Scale_f); COM_AddCommand("gravflip", Command_Gravflip_f); COM_AddCommand("hurtme", Command_Hurtme_f); - COM_AddCommand("jumptoaxis", Command_JumpToAxis_f); + /*COM_AddCommand("jumptoaxis", Command_JumpToAxis_f); COM_AddCommand("charability", Command_Charability_f); - COM_AddCommand("charspeed", Command_Charspeed_f); + COM_AddCommand("charspeed", Command_Charspeed_f);*/ COM_AddCommand("teleport", Command_Teleport_f); COM_AddCommand("rteleport", Command_RTeleport_f); COM_AddCommand("skynum", Command_Skynum_f); @@ -3260,9 +3260,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) } // In tag, check to see if you still have a game. - if (G_TagGametype()) + /*if (G_TagGametype()) P_CheckSurvivors(); - else if (G_BattleGametype()) + else*/ if (G_BattleGametype()) K_CheckBumpers(); // SRB2Kart else if (G_RaceGametype()) P_CheckRacers(); // also SRB2Kart diff --git a/src/g_game.c b/src/g_game.c index e501fa56..5c9af3ed 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2554,15 +2554,15 @@ void G_PlayerReborn(INT32 player) p->maxlink = 0; // If NiGHTS, find lowest mare to start with. - p->mare = P_FindLowestMare(); + p->mare = 0; /*P_FindLowestMare(); CONS_Debug(DBG_NIGHTS, M_GetText("Current mare is %d\n"), p->mare); if (p->mare == 255) - p->mare = 0; + p->mare = 0;*/ // Check to make sure their color didn't change somehow... - if (G_GametypeHasTeams()) + /*if (G_GametypeHasTeams()) { if (p->ctfteam == 1 && p->skincolor != skincolor_redteam) { @@ -2586,7 +2586,7 @@ void G_PlayerReborn(INT32 player) else if (p == &players[fourthdisplayplayer]) CV_SetValue(&cv_playercolor4, skincolor_blueteam); } - } + }*/ } // @@ -2967,8 +2967,6 @@ void G_DoReborn(INT32 playernum) P_LoadThingsOnly(); - P_ClearStarPost(player->starpostnum); - // Do a wipe wipegamestate = -1; diff --git a/src/m_cheat.c b/src/m_cheat.c index 99b96d99..e57a85ae 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -377,7 +377,7 @@ void Command_Hurtme_f(void) } // Moves the NiGHTS player to another axis within the current mare -void Command_JumpToAxis_f(void) +/*void Command_JumpToAxis_f(void) { REQUIRE_DEVMODE; REQUIRE_INLEVEL; @@ -438,7 +438,7 @@ void Command_Charspeed_f(void) players[consoleplayer].actionspd = atoi(COM_Argv(2))< : set character speed\n")); -} +}*/ void Command_RTeleport_f(void) { @@ -683,7 +683,7 @@ void Command_Savecheckpoint_f(void) } // Like M_GetAllEmeralds() but for console devmode junkies. -void Command_Getallemeralds_f(void) +/*void Command_Getallemeralds_f(void) { REQUIRE_SINGLEPLAYER; REQUIRE_NOULTIMATE; @@ -702,7 +702,7 @@ void Command_Resetemeralds_f(void) emeralds = 0; CONS_Printf(M_GetText("Emeralds reset to zero.\n")); -} +}*/ void Command_Devmode_f(void) { @@ -730,7 +730,7 @@ void Command_Devmode_f(void) G_SetGameModified(multiplayer); } -void Command_Setrings_f(void) +/*void Command_Setrings_f(void) { REQUIRE_INLEVEL; REQUIRE_SINGLEPLAYER; @@ -785,7 +785,7 @@ void Command_Setcontinues_f(void) G_SetGameModified(multiplayer); } -} +}*/ // // OBJECTPLACE (and related variables) diff --git a/src/m_cheat.h b/src/m_cheat.h index 951c7a16..3b5a1d0f 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -48,18 +48,18 @@ void Command_CheatNoClip_f(void); void Command_CheatGod_f(void); void Command_CheatNoTarget_f(void); void Command_Savecheckpoint_f(void); -void Command_Getallemeralds_f(void); +/*void Command_Getallemeralds_f(void); void Command_Resetemeralds_f(void); void Command_Setrings_f(void); void Command_Setlives_f(void); -void Command_Setcontinues_f(void); +void Command_Setcontinues_f(void);*/ void Command_Devmode_f(void); void Command_Scale_f(void); void Command_Gravflip_f(void); void Command_Hurtme_f(void); -void Command_JumpToAxis_f(void); +/*void Command_JumpToAxis_f(void); void Command_Charability_f(void); -void Command_Charspeed_f(void); +void Command_Charspeed_f(void);*/ void Command_Teleport_f(void); void Command_RTeleport_f(void); void Command_Skynum_f(void); diff --git a/src/p_inter.c b/src/p_inter.c index 4a120a42..23c6ffbd 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -96,55 +96,6 @@ void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End) // GET STUFF // -/** Makes sure all previous starposts are cleared. - * For instance, hitting starpost 5 will clear starposts 1 through 4, even if - * you didn't touch them. This is how the classic games work, although it can - * lead to bizarre situations on levels that allow you to make a circuit. - * - * \param postnum The number of the starpost just touched. - */ -void P_ClearStarPost(INT32 postnum) -{ - thinker_t *th; - mobj_t *mo2; - - // scan the thinkers - for (th = thinkercap.next; th != &thinkercap; th = th->next) - { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - mo2 = (mobj_t *)th; - - if (mo2->type == MT_STARPOST && mo2->health <= postnum) - P_SetMobjState(mo2, mo2->info->seestate); - } - return; -} - -// -// P_ResetStarposts -// -// Resets all starposts back to their spawn state, used on A_Mixup and some other things. -// -void P_ResetStarposts(void) -{ - // Search through all the thinkers. - thinker_t *th; - mobj_t *post; - - for (th = thinkercap.next; th != &thinkercap; th = th->next) - { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - post = (mobj_t *)th; - - if (post->type == MT_STARPOST) - P_SetMobjState(post, post->info->spawnstate); - } -} - // // P_CanPickupItem // @@ -299,14 +250,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (heightcheck) { - if (special->type == MT_FLINGEMERALD) // little hack here... + /*if (special->type == MT_FLINGEMERALD) // little hack here... { // flingemerald sprites are low to the ground, so extend collision radius down some. if (toucher->z > (special->z + special->height)) return; if (special->z - special->height > (toucher->z + toucher->height)) return; } - else + else*/ { if (toucher->momz < 0) { if (toucher->z + toucher->momz > special->z + special->height) @@ -341,7 +292,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (special->flags & MF_BOSS) { - if (special->type == MT_BLACKEGGMAN) + /*if (special->type == MT_BLACKEGGMAN) { P_DamageMobj(toucher, special, special, 1); // ouch return; @@ -357,7 +308,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) toucher->momy = -toucher->momy; P_DamageMobj(special, toucher, toucher, 1); } - /* else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP)) || (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) && player->charability == CA_FLY @@ -368,8 +318,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DamageMobj(special, toucher, toucher, 1); } - */ // SRB2kart - Removed: No more fly states - else + // SRB2kart - Removed: No more fly states + else*/ P_DamageMobj(toucher, special, special, 1); return; @@ -379,7 +329,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) //////////////////////////////////////////////////////// /////ENEMIES!!////////////////////////////////////////// //////////////////////////////////////////////////////// - if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) + /*if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) || player->powers[pw_invulnerability] || player->powers[pw_super]) && toucher->z < special->z + special->height && toucher->z + toucher->height > special->z) { @@ -401,7 +351,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DamageMobj(special, toucher, toucher, 1); } - /* else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP)) || (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) // Flame is bad at logic - JTE && player->charability == CA_FLY @@ -413,8 +362,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DamageMobj(special, toucher, toucher, 1); } - */ // SRB2kart - Removed: No more fly states - else + // SRB2kart - Removed: No more fly states + else*/ P_DamageMobj(toucher, special, special, 1); return; @@ -843,7 +792,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // ********************************** // // NiGHTS gameplay items and powerups // // ********************************** // - case MT_NIGHTSDRONE: + /*case MT_NIGHTSDRONE: if (player->bot) return; if (player->exiting) @@ -1034,7 +983,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // Clear text player->texttimer = 0; - return; + return;*/ case MT_NIGHTSBUMPER: // Don't trigger if the stage is ended/failed if (player->exiting) @@ -1102,7 +1051,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } } return; - case MT_NIGHTSSUPERLOOP: + /*case MT_NIGHTSSUPERLOOP: if (player->bot || !(player->pflags & PF_NIGHTSMODE)) return; if (!G_IsSpecialStage(gamemap)) @@ -1235,7 +1184,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) HU_SetCEchoDuration(4); HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Link Freeze")); } - break; + break;*/ case MT_NIGHTSWING: if (G_IsSpecialStage(gamemap) && useNightsSS) { // Pseudo-ring. @@ -1387,35 +1336,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) player->starpostangle = special->angle; player->starpostnum = special->health; player->starpostcount++; - P_ClearStarPost(special->health); - // Find all starposts in the level with this value. - { - thinker_t *th; - mobj_t *mo2; - - for (th = thinkercap.next; th != &thinkercap; th = th->next) - { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - mo2 = (mobj_t *)th; - - if (mo2 == special) - continue; - - if (mo2->type == MT_STARPOST && mo2->health == special->health) - { - if (!(netgame && circuitmap && player != &players[consoleplayer])) - P_SetMobjState(mo2, mo2->info->painstate); - } - } - } - - S_StartSound(toucher, special->info->painsound); - - if (!(netgame && circuitmap && player != &players[consoleplayer])) - P_SetMobjState(special, special->info->painstate); + //S_StartSound(toucher, special->info->painsound); return; case MT_FAKEMOBILE: @@ -1914,7 +1836,7 @@ void P_CheckTimeLimit(void) //Tagmode round end but only on the tic before the //XD_EXITLEVEL packet is received by all players. - if (G_TagGametype()) + /*if (G_TagGametype()) { if (leveltime == (timelimitintics + 1)) { @@ -1931,7 +1853,7 @@ void P_CheckTimeLimit(void) } //Optional tie-breaker for Match/CTF - else if (cv_overtime.value) + else*/ if (cv_overtime.value) { INT32 playerarray[MAXPLAYERS]; INT32 tempplayer = 0; @@ -2064,7 +1986,7 @@ void P_CheckPointLimit(void) /*Checks for untagged remaining players in both tag derivitave modes. *If no untagged players remain, end the round. *Also serves as error checking if the only IT player leaves.*/ -void P_CheckSurvivors(void) +/*void P_CheckSurvivors(void) { INT32 i; INT32 survivors = 0; @@ -2144,7 +2066,7 @@ void P_CheckSurvivors(void) if (server) SendNetXCmd(XD_EXITLEVEL, NULL, 0); } -} +}*/ // Checks whether or not to end a race netgame. boolean P_CheckRacers(void) @@ -2444,7 +2366,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) localaiming4 = 0; //tag deaths handled differently in suicide cases. Don't count spectators! - if (G_TagGametype() + /*if (G_TagGametype() && !(target->player->pflags & PF_TAGIT) && (!source || !source->player) && !(target->player->spectator)) { // if you accidentally die before you run out of time to hide, ignore it. @@ -2478,7 +2400,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } } } - else if (G_BattleGametype()) + else*/ if (G_BattleGametype()) K_CheckBumpers(); target->player->kartstuff[k_pogospring] = 0; @@ -2841,7 +2763,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou } // The tag occurs so long as you aren't shooting another tagger with friendlyfire on. - if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT)) + /*if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT)) { P_AddPlayerScore(source->player, 1); //award points to tagger. P_HitDeathMessages(player, inflictor, source); @@ -2859,7 +2781,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou //checks if tagger has tagged all players, if so, end round early. P_CheckSurvivors(); - } + }*/ P_DoPlayerPain(player, source, inflictor); diff --git a/src/p_local.h b/src/p_local.h index 51676a2c..30bf3851 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -172,7 +172,7 @@ void P_PlayerThink(player_t *player); void P_PlayerAfterThink(player_t *player); void P_DoPlayerExit(player_t *player); void P_DoTimeOver(player_t *player); -void P_NightserizePlayer(player_t *player, INT32 ptime); +//void P_NightserizePlayer(player_t *player, INT32 ptime); void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move); fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move); @@ -185,12 +185,12 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in //boolean P_SuperReady(player_t *player); void P_DoJump(player_t *player, boolean soundandstate); boolean P_AnalogMove(player_t *player); -boolean P_TransferToNextMare(player_t *player); -UINT8 P_FindLowestMare(void); +/*boolean P_TransferToNextMare(player_t *player); +UINT8 P_FindLowestMare(void);*/ UINT8 P_FindLowestLap(void); UINT8 P_FindHighestLap(void); void P_FindEmerald(void); -void P_TransferToAxis(player_t *player, INT32 axisnum); +//void P_TransferToAxis(player_t *player, INT32 axisnum); boolean P_PlayerMoving(INT32 pnum); void P_SpawnThokMobj(player_t *player); void P_SpawnSpinMobj(player_t *player, mobjtype_t type); @@ -406,12 +406,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck); void P_PlayerFlagBurst(player_t *player, boolean toss); void P_CheckTimeLimit(void); void P_CheckPointLimit(void); -void P_CheckSurvivors(void); +//void P_CheckSurvivors(void); boolean P_CheckRacers(void); -void P_ClearStarPost(INT32 postnum); -void P_ResetStarposts(void); - boolean P_CanPickupItem(player_t *player, UINT8 weapon); void P_DoNightsScore(player_t *player); diff --git a/src/p_map.c b/src/p_map.c index b249f362..0b4d8225 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -469,7 +469,7 @@ static boolean PIT_CheckThing(mobj_t *thing) #endif // Metal Sonic destroys tiny baby objects. - if (tmthing->type == MT_METALSONIC_RACE + /*if (tmthing->type == MT_METALSONIC_RACE && (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE)) { if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) @@ -495,7 +495,7 @@ static boolean PIT_CheckThing(mobj_t *thing) P_KillMobj(thing, tmthing, tmthing); } return true; - } + }*/ if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING)) return true; @@ -647,9 +647,9 @@ static boolean PIT_CheckThing(mobj_t *thing) // check for skulls slamming into things if (tmthing->flags2 & MF2_SKULLFLY) { - if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop! + /*if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop! return true; // Let him RUN YOU RIGHT OVER. >:3 - else + else*/ { // see if it went over / under if (tmthing->z > thing->z + thing->height) @@ -1133,7 +1133,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // Missiles ignore Brak's helper. - if (thing->type == MT_BLACKEGGMAN_HELPER) + /*if (thing->type == MT_BLACKEGGMAN_HELPER) return true; // Hurting Brak @@ -1144,9 +1144,9 @@ static boolean PIT_CheckThing(mobj_t *thing) if (!(thing->state >= &states[S_BLACKEGG_PAIN1] && thing->state <= &states[S_BLACKEGG_PAIN35])) P_SetMobjState(thing, thing->info->painstate); return false; - } + }*/ - if (!(thing->flags & MF_SHOOTABLE) && !(thing->type == MT_EGGSHIELD)) + if (!(thing->flags & MF_SHOOTABLE)/* && !(thing->type == MT_EGGSHIELD)*/) { // didn't do any damage return !(thing->flags & MF_SOLID); @@ -1157,7 +1157,7 @@ static boolean PIT_CheckThing(mobj_t *thing) && thing->player->pflags & PF_CARRIED && thing->tracer == tmthing->target) return true; // Don't give rings to your carry player by accident. - if (thing->type == MT_EGGSHIELD) + /*if (thing->type == MT_EGGSHIELD) { fixed_t touchx, touchy; angle_t angle; @@ -1183,14 +1183,14 @@ static boolean PIT_CheckThing(mobj_t *thing) P_KillMobj(thing, tmthing, tmthing); return false; } - } + }*/ if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE) return true; // damage / explode if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example) P_DamageMobj(thing, tmthing, tmthing, 1); - else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player + /*else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player && (thing->player->pflags & PF_JUMPED) && !thing->player->powers[pw_flashing] && thing->tracer != tmthing @@ -1230,16 +1230,13 @@ static boolean PIT_CheckThing(mobj_t *thing) tmthing->x = thing->x; tmthing->y = thing->y; P_SetThingPosition(tmthing); - } + }*/ else P_DamageMobj(thing, tmthing, tmthing->target, 1); // don't traverse any more - if (tmthing->type == MT_SHELL) - return true; - else - return false; + return (tmthing->type == MT_SHELL); } if (thing->flags & MF_PUSHABLE && (tmthing->player || tmthing->flags & MF_PUSHABLE) @@ -1303,7 +1300,7 @@ static boolean PIT_CheckThing(mobj_t *thing) } // Respawn rings and items - if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE) + /*if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE) && (tmthing->player || thing->player)) { mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing; @@ -1323,7 +1320,7 @@ static boolean PIT_CheckThing(mobj_t *thing) } droneobj->extravalue1 = pl->anotherflyangle; droneobj->extravalue2 = (INT32)leveltime + TICRATE; - } + }*/ // check for special pickup if (thing->flags & MF_SPECIAL && tmthing->player && thing->type != MT_POKEY) @@ -1394,7 +1391,7 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->scale > tmthing->scale + (FRACUNIT/8)) K_SquishPlayer(tmthing->player, thing); - // SRB2kart - Starpower! + // SRB2kart - Invincibility! if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer]) P_DamageMobj(thing, tmthing, tmthing, 1); else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer]) @@ -1440,7 +1437,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->player) { // Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only - if (tmthing->eflags & MFE_VERTICALFLIP + /*if (tmthing->eflags & MFE_VERTICALFLIP && (tmthing->z + tmthing->height + tmthing->momz < thing->z || tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height)) ; @@ -1462,7 +1459,7 @@ static boolean PIT_CheckThing(mobj_t *thing) // The tmthing->target allows the pusher of the object // to get the point if he topples it on an opponent. } - } + }*/ if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM) P_DoFanAndGasJet(tmthing, thing); @@ -1585,9 +1582,9 @@ static boolean PIT_CheckThing(mobj_t *thing) ; // Fix a few nasty spring-jumping bugs that happen sometimes. // Monitors are not treated as solid to players who are jumping, spinning or gliding, // unless it's a CTF team monitor and you're on the wrong team - else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) + /*else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) && !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2))) - ; + ;*/ // z checking at last // Treat noclip things as non-solid! else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID diff --git a/src/p_mobj.c b/src/p_mobj.c index d22d5cb6..deeb737d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -495,7 +495,7 @@ boolean P_WeaponOrPanel(mobjtype_t type) // // Power Stone emerald management // -void P_EmeraldManager(void) +/*void P_EmeraldManager(void) { thinker_t *think; mobj_t *mo; @@ -664,7 +664,7 @@ void P_EmeraldManager(void) break; } } -} +}*/ // // P_ExplodeMissile diff --git a/src/p_setup.c b/src/p_setup.c index 6c7b6e92..98be2480 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2865,7 +2865,6 @@ boolean P_SetupLevel(boolean skipprecip) if (players[i].starposttime) { G_SpawnPlayer(i, true); - P_ClearStarPost(players[i].starpostnum); } else G_SpawnPlayer(i, false); diff --git a/src/p_spec.c b/src/p_spec.c index 17cd1f88..bce18999 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1707,16 +1707,16 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller if (actor && actor->player && triggerline->flags & ML_EFFECT4) { - if (maptol & TOL_NIGHTS) + /*if (maptol & TOL_NIGHTS) lap = actor->player->mare; - else + else*/ lap = actor->player->laps; } else { - if (maptol & TOL_NIGHTS) + /*if (maptol & TOL_NIGHTS) lap = P_FindLowestMare(); - else + else*/ lap = P_FindLowestLap(); } @@ -4252,7 +4252,6 @@ DoneSection2: // //player->starpostangle = player->starposttime = player->starpostnum = 0; //player->starpostx = player->starposty = player->starpostz = 0; - P_ResetStarposts(); // Play the starpost sound for 'consistency' // S_StartSound(player->mo, sfx_strpst); diff --git a/src/p_telept.c b/src/p_telept.c index 69573640..89a28ddc 100644 --- a/src/p_telept.c +++ b/src/p_telept.c @@ -96,10 +96,6 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, thing->player->starpostangle = starpostangle; thing->player->starpostnum = starpostnum; - // Reset map starposts for the player's new info. - P_ResetStarposts(); - P_ClearStarPost(starpostnum); - P_ResetPlayer(thing->player); P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND diff --git a/src/p_tick.c b/src/p_tick.c index 3c5ed0b9..bbb90f63 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -310,7 +310,7 @@ static inline void P_RunThinkers(void) // // Determine if the teams are unbalanced, and if so, move a player to the other team. // -static void P_DoAutobalanceTeams(void) +/*static void P_DoAutobalanceTeams(void) { changeteam_union NetPacket; UINT16 usvalue; @@ -562,7 +562,7 @@ static inline void P_DoCTFStuff(void) if (cv_teamscramble.value && server) P_DoTeamscrambling(); } -} +}*/ // // P_Ticker @@ -612,11 +612,11 @@ void P_Ticker(boolean run) if (!demoplayback) // Don't increment if a demo is playing. totalplaytime++; - if (!useNightsSS && G_IsSpecialStage(gamemap)) + /*if (!useNightsSS && G_IsSpecialStage(gamemap)) P_DoSpecialStageStuff(); if (runemeraldmanager) - P_EmeraldManager(); // Power stone mode + P_EmeraldManager(); // Power stone mode*/ if (run) { @@ -633,7 +633,7 @@ void P_Ticker(boolean run) } // Run shield positioning - P_RunShields(); + //P_RunShields(); P_RunOverlays(); P_RunShadows(); @@ -648,11 +648,11 @@ void P_Ticker(boolean run) leveltime++; timeinmap++; - if (G_TagGametype()) + /*if (G_TagGametype()) P_DoTagStuff(); if (G_GametypeHasTeams()) - P_DoCTFStuff(); + P_DoCTFStuff();*/ if (run) { @@ -793,7 +793,7 @@ void P_PreTicker(INT32 frames) #endif // Run shield positioning - P_RunShields(); + //P_RunShields(); P_RunOverlays(); P_UpdateSpecials(); diff --git a/src/p_user.c b/src/p_user.c index d3407bd6..50267054 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -344,7 +344,7 @@ void P_ResetScore(player_t *player) // // Returns the lowest open mare available // -UINT8 P_FindLowestMare(void) +/*UINT8 P_FindLowestMare(void) { thinker_t *th; mobj_t *mo2; @@ -375,7 +375,7 @@ UINT8 P_FindLowestMare(void) CONS_Debug(DBG_NIGHTS, "Lowest mare found: %d\n", mare); return mare; -} +}*/ // // P_FindLowestLap @@ -438,7 +438,7 @@ UINT8 P_FindHighestLap(void) // (Finds the lowest mare # for capsules that have not been destroyed). // Returns true if successful, false if there is no other mare. // -boolean P_TransferToNextMare(player_t *player) +/*boolean P_TransferToNextMare(player_t *player) { thinker_t *th; mobj_t *mo2; @@ -759,7 +759,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) if (G_IsSpecialStage(gamemap)) { for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i]/* && players[i].pflags & PF_NIGHTSMODE*/) + if (playeringame[i]) total_rings += players[i].health-1; } @@ -782,10 +782,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) P_AddPlayerScore(&players[i], (players[i].health - 1) * 50); } - // Add score to leaderboards now - /*if (!(netgame||multiplayer) && P_IsLocalPlayer(&players[i])) - G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);*/ - // transfer scores anyway players[i].mo->health = players[i].health = 1; @@ -803,10 +799,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->textvar = 4; // Score and grades player->finishedrings = (INT16)(player->health - 1); - // Add score to temp leaderboards - /*if (!(netgame||multiplayer) && P_IsLocalPlayer(player)) - G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));*/ - // Starting a new mare, transfer scores player->marebegunat = leveltime; @@ -824,7 +816,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) } player->pflags |= PF_NIGHTSMODE; -} +}*/ // // P_PlayerInPain @@ -4536,7 +4528,7 @@ INT32 P_GetPlayerControlDirection(player_t *player) } // Control scheme for 2d levels. -static void P_2dMovement(player_t *player) +/*static void P_2dMovement(player_t *player) { ticcmd_t *cmd; INT32 topspeed, acceleration, thrustfactor; @@ -4713,7 +4705,7 @@ static void P_2dMovement(player_t *player) else if (player->rmomx > -topspeed && cmd->sidemove < 0) P_Thrust(player->mo, movepushangle, movepushforward); } -} +}*/ //#define OLD_MOVEMENT_CODE 1 static void P_3dMovement(player_t *player) @@ -5004,7 +4996,7 @@ static void P_SpectatorMovement(player_t *player) // graphical indicator // for building/debugging // NiGHTS levels! -static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height) +/*static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height) { mobj_t *mo; INT32 i; @@ -5578,16 +5570,6 @@ static void P_DoNiGHTSCapsule(player_t *player) UINT8 em = P_GetNextEmerald(); tic_t lowest_time; - /*for (i = 0; i < MAXPLAYERS; i++) - { - if (!playeringame[i] || players[i].spectator || !players[i].mo || !players[i].mo->tracer) - continue; - - emmo = P_SpawnMobj(players[i].mo->x, players[i].mo->y, players[i].mo->z + players[i].mo->info->height, MT_GOTEMERALD); - P_SetTarget(&emmo->target, players[i].mo); - P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em); - }*/ - if (player->mo->tracer) { // Only give it to ONE person, and THAT player has to get to the goal! @@ -5683,7 +5665,7 @@ static void P_NiGHTSMovement(player_t *player) boolean capsule = false; // NiGHTS special stages have a pseudo-shared timer, so check if ANYONE is feeding the capsule. for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/ + if (playeringame[i] && (players[i].capsule && players[i].capsule->reactiontime)) capsule = true; if (!capsule @@ -6238,7 +6220,7 @@ static void P_NiGHTSMovement(player_t *player) if (objectplacing) OP_NightsObjectplace(player); -} +}*/ // May be used in future for CTF #if 0 @@ -6457,7 +6439,7 @@ void P_ElementalFireTrail(player_t *player) static void P_MovePlayer(player_t *player) { ticcmd_t *cmd; - INT32 i; + //INT32 i; fixed_t runspd; @@ -6532,7 +6514,7 @@ static void P_MovePlayer(player_t *player) } // Locate the capsule for this mare. - else if (maptol & TOL_NIGHTS) + /*else if (maptol & TOL_NIGHTS) { if (!player->capsule && !player->bonustime) { @@ -6585,15 +6567,15 @@ static void P_MovePlayer(player_t *player) P_DamageMobj(player->mo, NULL, NULL, 1); player->pflags &= ~PF_NIGHTSFALL; } - } + }*/ ////////////////////// // MOVEMENT CODE // ////////////////////// - if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies. + /*if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies. P_2dMovement(player); - else + else*/ { if (!player->climbing && (!P_AnalogMove(player))) player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */); @@ -9441,8 +9423,8 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (!(player->pflags & PF_NIGHTSMODE - || player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should. + if (!(//player->pflags & PF_NIGHTSMODE || + player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should. || player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either. || player->kartstuff[k_respawn] // Respawn timer (for drop dash effect) || (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]) @@ -9454,13 +9436,13 @@ void P_PlayerThink(player_t *player) else player->mo->flags2 &= ~MF2_DONTDRAW; } - else if (player->mo->tracer) + /*else if (player->mo->tracer) { if (player->powers[pw_flashing] & 1) player->mo->tracer->flags2 |= MF2_DONTDRAW; else player->mo->tracer->flags2 &= ~MF2_DONTDRAW; - } + }*/ player->pflags &= ~PF_SLIDING; diff --git a/src/y_inter.c b/src/y_inter.c index e26d4973..3228f8a3 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -560,13 +560,13 @@ void Y_Ticker(void) // Team scramble code for team match and CTF. // Don't do this if we're going to automatically scramble teams next round. - if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server) + /*if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server) { // If we run out of time in intermission, the beauty is that // the P_Ticker() team scramble code will pick it up. if ((intertic % (TICRATE/7)) == 0) P_DoTeamscrambling(); - } + }*/ // multiplayer uses timer (based on cv_inttime) if (timer) From ecfe8e507009c420d8f493f9cfd2c511c928bd61 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 17:14:25 +0100 Subject: [PATCH 065/138] Complete the disabling of the traditional shield mechanism (oversight from initial commit). --- src/p_local.h | 2 +- src/p_mobj.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 30bf3851..5fd37248 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -231,7 +231,7 @@ boolean P_MobjWasRemoved(mobj_t *th); void P_RemoveSavegameMobj(mobj_t *th); boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state); boolean P_SetMobjState(mobj_t *mobj, statenum_t state); -void P_RunShields(void); +//void P_RunShields(void); void P_RunOverlays(void); void P_RunShadows(void); void P_MobjThinker(mobj_t *mobj); diff --git a/src/p_mobj.c b/src/p_mobj.c index deeb737d..ed794b0f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6127,7 +6127,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) return true; } -mobj_t *shields[MAXPLAYERS*2]; +/*mobj_t *shields[MAXPLAYERS*2]; INT32 numshields = 0; void P_RunShields(void) @@ -6175,7 +6175,7 @@ static boolean P_AddShield(mobj_t *thing) P_SetTarget(&shields[numshields++], thing); return true; -} +}*/ void P_RunOverlays(void) { @@ -6609,8 +6609,8 @@ void P_MobjThinker(mobj_t *mobj) P_RemoveMobj(mobj); return; } - else - P_AddOverlay(mobj); + + P_AddOverlay(mobj); break; case MT_SHADOW: if (!mobj->target) @@ -6618,10 +6618,10 @@ void P_MobjThinker(mobj_t *mobj) P_RemoveMobj(mobj); return; } - else - P_AddShadow(mobj); + + P_AddShadow(mobj); break; - case MT_BLACKORB: + /*case MT_BLACKORB: case MT_WHITEORB: case MT_GREENORB: case MT_YELLOWORB: @@ -6629,7 +6629,7 @@ void P_MobjThinker(mobj_t *mobj) case MT_PITYORB: if (!P_AddShield(mobj)) return; - break; + break;*/ //{ SRB2kart mobs case MT_ORBINAUT_SHIELD: // Kart orbit/trail items case MT_JAWZ_SHIELD: From a16b9cfc1f48c798fc7e0571edab59e806ecf292 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 17:16:23 +0100 Subject: [PATCH 066/138] Incorrect comment starting location. --- src/p_mobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index ed794b0f..b0aba1ec 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6059,7 +6059,7 @@ static void P_NightsItemChase(mobj_t *thing) P_Attract(thing, thing->tracer, true); } -static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) +/*static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) { if (!thing->target || thing->target->health <= 0 || !thing->target->player || (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super] @@ -6127,7 +6127,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) return true; } -/*mobj_t *shields[MAXPLAYERS*2]; +mobj_t *shields[MAXPLAYERS*2]; INT32 numshields = 0; void P_RunShields(void) From d7892266e4cb8034692d1a37ab3abb7165f88afb Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 17:26:56 +0100 Subject: [PATCH 067/138] Improve A_MineExplode. * Re-order the conditions within it such that it quickly checks for shootability and absence of scenery BEFORE it performs the more costly range or parentage checks. * Make its explosion radius take mapscale into account. (This is the only off-topic change made in this branch. I have made it here because half of this commit, which doing the other half in a seperate branch would conflict with, is on-topic.) --- src/p_enemy.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 7cdc354d..8073a2c2 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8247,12 +8247,14 @@ void A_MineExplode(mobj_t *actor) INT32 d; INT32 locvar1 = var1; mobjtype_t type; + fixed_t range; #ifdef HAVE_BLUA if (LUA_CallAction("A_MineExplode", actor)) return; #endif type = (mobjtype_t)locvar1; + range = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale); for (th = thinkercap.next; th != &thinkercap; th = th->next) { @@ -8267,27 +8269,25 @@ void A_MineExplode(mobj_t *actor) if (mo2 == actor || mo2->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop! continue; + if (!(mo2->flags & MF_SHOOTABLE) || (mo2->flags & MF_SCENERY)) + continue; + if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_bumper] <= 0 && mo2 == actor->target) continue; - if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance) + if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > range) continue; - if ((mo2->flags & MF_SHOOTABLE) && !(mo2->flags & MF_SCENERY)) - { - actor->flags2 |= MF2_DEBRIS; + actor->flags2 |= MF2_DEBRIS; - if (mo2->player) // Looks like we're going to have to need a seperate function for this too - K_ExplodePlayer(mo2->player, actor->target); - else - P_DamageMobj(mo2, actor, actor->target, 1); - - continue; - } + if (mo2->player) // Looks like we're going to have to need a seperate function for this too + K_ExplodePlayer(mo2->player, actor->target); + else + P_DamageMobj(mo2, actor, actor->target, 1); } for (d = 0; d < 16; d++) - K_SpawnKartExplosion(actor->x, actor->y, actor->z, actor->info->painchance + 32*FRACUNIT, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64 + K_SpawnKartExplosion(actor->x, actor->y, actor->z, range + 32*mapheaderinfo[gamemap-1]->mobj_scale, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64 if (actor->target && actor->target->player) K_SpawnMineExplosion(actor, actor->target->player->skincolor); From 4aea053c2fd07b47131b74b44d9c8e9425d753a0 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Wed, 3 Oct 2018 20:09:32 +0200 Subject: [PATCH 068/138] Allow client to open chat and scroll even if muted. --- src/hu_stuff.c | 59 +++++++++++++++++++++++++++++++++----------------- src/hu_stuff.h | 2 ++ 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 67a65645..255d8512 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -435,7 +435,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) numwords = COM_Argc() - usedargs; I_Assert(numwords > 0); - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // TODO: Per Player mute. + if (CHAT_MUTE) // TODO: Per Player mute. { HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); return; @@ -962,7 +962,7 @@ static void HU_queueChatChar(INT32 c) c_input = 0; // last minute mute check - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + if (CHAT_MUTE) { HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); return; @@ -1055,20 +1055,20 @@ static boolean justscrolledup; boolean HU_Responder(event_t *ev) { INT32 c=0; - + if (ev->type != ev_keydown) return false; // only KeyDown events now... - + if (!chat_on) { // enter chat mode if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1]) - && netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) + && netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise. { - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) - return false; + //if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + // return false; chat_on = true; w_chat[0] = 0; teamtalk = false; @@ -1076,10 +1076,10 @@ boolean HU_Responder(event_t *ev) return true; } if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1]) - && netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) + && netgame && !OLD_MUTE) { - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) - return false; + //if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + // return false; chat_on = true; w_chat[0] = 0; teamtalk = false; // CHANGE THIS TO TRUE TO MAKE SAYTEAM WORK AGAIN @@ -1090,7 +1090,7 @@ boolean HU_Responder(event_t *ev) } else // if chat_on { - + // Ignore modifier keys // Note that we do this here so users can still set // their chat keys to one of these, if they so desire. @@ -1118,7 +1118,7 @@ boolean HU_Responder(event_t *ev) // TODO: make chat behave like the console, so that we can go back and edit stuff when we fuck up. // pasting. pasting is cool. chat is a bit limited, though :( - if ((c == 'v' || c == 'V') && ctrldown) + if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE) { const char *paste = I_ClipboardPaste(); @@ -1158,7 +1158,7 @@ boolean HU_Responder(event_t *ev) } } - if (HU_keyInChatString(w_chat,c)) + if (!CHAT_MUTE && HU_keyInChatString(w_chat,c)) { HU_queueChatChar(c); } @@ -1173,21 +1173,21 @@ boolean HU_Responder(event_t *ev) chat_on = false; c_input = 0; // reset input cursor } - else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0) // CHAT SCROLLING YAYS! + else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS! { chat_scroll--; justscrolledup = true; chat_scrolltime = 4; } - else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0) + else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0 && !OLDCHAT) { chat_scroll++; justscrolleddown = true; chat_scrolltime = 4; } - else if (c == KEY_LEFTARROW && c_input != 0) // i said go back + else if (c == KEY_LEFTARROW && c_input != 0 && !OLDCHAT) // i said go back c_input--; - else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat)) + else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat) && !OLDCHAT) // don't need to check for admin or w/e here since the chat won't ever contain anything if it's muted. c_input++; return true; } @@ -1498,8 +1498,10 @@ static void HU_DrawChat(void) INT32 charwidth = 4, charheight = 6; INT32 t = 0, c = 0, y = chaty - (typelines*charheight) - (cv_kartspeedometer.value ? 16 : 0); UINT32 i = 0, saylen = strlen(w_chat); // You learn new things everyday! + INT32 cflag = 0; const char *ntalk = "Say: ", *ttalk = "Team: "; const char *talk = ntalk; + const char *mute = "Chat has been muted."; if (teamtalk) { @@ -1511,7 +1513,14 @@ static void HU_DrawChat(void) t = 0x400; // Blue #endif } - + + if (CHAT_MUTE) + { + talk = mute; + typelines = 1; + cflag = V_GRAYMAP; // set text in gray if chat is muted. + } + V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); while (talk[i]) @@ -1519,11 +1528,21 @@ static void HU_DrawChat(void) if (talk[i] < HU_FONTSTART) ++i; else - V_DrawChatCharacter(chatx + c + 2, y, talk[i++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT, !cv_allcaps.value, NULL); + { + V_DrawChatCharacter(chatx + c + 2, y, talk[i] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|cflag, !cv_allcaps.value, V_GetStringColormap(talk[i]|cflag)); + i++; + } c += charwidth; } - + + // if chat is muted, just draw the log and get it over with: + if (CHAT_MUTE) + { + HU_drawChatLog(0); + return; + } + i = 0; typelines = 1; diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 90ffeb42..28a31d4b 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -81,6 +81,8 @@ extern patch_t *iconprefix[MAXSKINS]; #define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand. #define OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640) +#define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot. +#define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted. // some functions void HU_AddChatText(const char *text); From 4c1a068bd79f464cce9be2d62e1916ddaf858b15 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 20:23:59 +0100 Subject: [PATCH 069/138] Update A_GrenadeRing to also take the mapheader scale into account. --- src/p_enemy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 8073a2c2..28dcf7b9 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3913,6 +3913,7 @@ void A_ThrownRing(mobj_t *actor) //{ SRB2kart - A_GRENADERING static mobj_t *grenade; +static fixed_t explodedist; static inline boolean PIT_GrenadeRing(mobj_t *thing) { @@ -3935,9 +3936,9 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) return true; // see if it went over / under - if (grenade->z - grenade->info->painchance > thing->z + thing->height) + if (grenade->z - explodedist > thing->z + thing->height) return true; // overhead - if (grenade->z + grenade->height + grenade->info->painchance < thing->z) + if (grenade->z + grenade->height + explodedist < thing->z) return true; // underneath if (netgame && thing->player && thing->player->spectator) @@ -3950,7 +3951,7 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) } if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), - thing->z - grenade->z) > grenade->info->painchance) + thing->z - grenade->z) > explodedist) return true; // Too far away // Explode! @@ -3961,7 +3962,7 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) void A_GrenadeRing(mobj_t *actor) { INT32 bx, by, xl, xh, yl, yh; - const fixed_t explodedist = actor->info->painchance; + explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale); if (leveltime % 35 == 0) S_StartSound(actor, actor->info->activesound); From 60a26fcaa4ca55b5c0a6b9f0e5437d5760e844d8 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 20:51:15 +0100 Subject: [PATCH 070/138] * Modify PIT_GrenadeRing to place less-complicated checks near the start of the function. * Add the customary LUA_CallAction call to A_GrenadeRing. * Revamp A_MineExplode into using a blockmap iterator. Having tested it it might be less laggy in some situations, but I think the drawing is causing the bulk of the problems here. --- src/p_enemy.c | 101 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 11 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 28dcf7b9..001b9e54 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3918,11 +3918,20 @@ static fixed_t explodedist; static inline boolean PIT_GrenadeRing(mobj_t *thing) { if (!grenade) - return true; + return false; if (thing->type != MT_PLAYER) // Don't explode for anything but an actual player. return true; + if (!(thing->flags & MF_SHOOTABLE)) + { + // didn't do any damage + return true; + } + + if (netgame && thing->player && thing->player->spectator) + return true; + if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner. return true; @@ -3941,15 +3950,6 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) if (grenade->z + grenade->height + explodedist < thing->z) return true; // underneath - if (netgame && thing->player && thing->player->spectator) - return true; - - if (!(thing->flags & MF_SHOOTABLE)) - { - // didn't do any damage - return true; - } - if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), thing->z - grenade->z) > explodedist) return true; // Too far away @@ -3963,6 +3963,10 @@ void A_GrenadeRing(mobj_t *actor) { INT32 bx, by, xl, xh, yl, yh; explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale); +#ifdef HAVE_BLUA + if (LUA_CallAction("A_GrenadeRing", actor)) + return; +#endif if (leveltime % 35 == 0) S_StartSound(actor, actor->info->activesound); @@ -3979,6 +3983,80 @@ void A_GrenadeRing(mobj_t *actor) for (bx = xl; bx <= xh; bx++) P_BlockThingsIterator(bx, by, PIT_GrenadeRing); } + +static inline boolean PIT_MineExplode(mobj_t *thing) +{ + if (!grenade || P_MobjWasRemoved(grenade)) + return false; // There's the possibility these can chain react onto themselves after they've already died if there are enough all in one spot + + if (thing == grenade || thing->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop! + return true; + + if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY)) + return true; + + if (netgame && thing->player && thing->player->spectator) + return true; + + if (G_BattleGametype() && grenade->target && grenade->target->player && grenade->target->player->kartstuff[k_bumper] <= 0 && thing == grenade->target) + return true; + + // see if it went over / under + if (grenade->z - explodedist > thing->z + thing->height) + return true; // overhead + if (grenade->z + grenade->height + explodedist < thing->z) + return true; // underneath + + if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), + thing->z - grenade->z) > explodedist) + return true; // Too far away + + grenade->flags2 |= MF2_DEBRIS; + + if (thing->player) // Looks like we're going to have to need a seperate function for this too + K_ExplodePlayer(thing->player, grenade->target); + else + P_DamageMobj(thing, grenade, grenade->target, 1); + + return true; +} + +void A_MineExplode(mobj_t *actor) +{ + INT32 bx, by, xl, xh, yl, yh; + explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale); + INT32 d; + INT32 locvar1 = var1; + mobjtype_t type; +#ifdef HAVE_BLUA + if (LUA_CallAction("A_MineExplode", actor)) + return; +#endif + + type = (mobjtype_t)locvar1; + + // Use blockmap to check for nearby shootables + yh = (unsigned)(actor->y + explodedist - bmaporgy)>>MAPBLOCKSHIFT; + yl = (unsigned)(actor->y - explodedist - bmaporgy)>>MAPBLOCKSHIFT; + xh = (unsigned)(actor->x + explodedist - bmaporgx)>>MAPBLOCKSHIFT; + xl = (unsigned)(actor->x - explodedist - bmaporgx)>>MAPBLOCKSHIFT; + + grenade = actor; + + for (by = yl; by <= yh; by++) + for (bx = xl; bx <= xh; bx++) + P_BlockThingsIterator(bx, by, PIT_MineExplode); + + for (d = 0; d < 16; d++) + K_SpawnKartExplosion(actor->x, actor->y, actor->z, explodedist + 32*mapheaderinfo[gamemap-1]->mobj_scale, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64 + + if (actor->target && actor->target->player) + K_SpawnMineExplosion(actor, actor->target->player->skincolor); + else + K_SpawnMineExplosion(actor, SKINCOLOR_RED); + + P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND); +} //} // Function: A_SetSolidSteam @@ -8241,6 +8319,7 @@ void A_JawzExplode(mobj_t *actor) return; } +/* old A_MineExplode - see elsewhere in the file void A_MineExplode(mobj_t *actor) { mobj_t *mo2; @@ -8298,7 +8377,7 @@ void A_MineExplode(mobj_t *actor) P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND); return; -} +}*/ void A_BallhogExplode(mobj_t *actor) { From dcdbf911a5f1f9a363e9a624ad070f02f5ad5302 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 20:56:43 +0100 Subject: [PATCH 071/138] Don't have all of your mines disappear into the aether if you have to shield-drop ONE, because they're not all out at once. (This is only really relevant to debug testing, given picking up additional HUD-dropped mines isn't very likely. --- src/k_kart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index db317803..823cbf97 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3140,7 +3140,7 @@ void K_DropHnextList(player_t *player) mobj_t *work = player->mo, *nextwork, *dropwork; INT32 flip; mobjtype_t type; - boolean orbit, ponground; + boolean orbit, ponground, dropall = true; if (!work) return; @@ -3180,6 +3180,7 @@ void K_DropHnextList(player_t *player) break; case MT_SSMINE_SHIELD: orbit = false; + dropall = false; type = MT_SSMINE; break; case MT_FAKESHIELD: @@ -3258,7 +3259,8 @@ void K_DropHnextList(player_t *player) player->kartstuff[k_bananadrag] = 0; if (player->kartstuff[k_eggmanheld]) player->kartstuff[k_eggmanheld] = 0; - else if (player->kartstuff[k_itemheld]) + else if (player->kartstuff[k_itemheld] + && (dropall || (--player->kartstuff[k_itemamount] <= 0))) { player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0; player->kartstuff[k_itemtype] = KITEM_NONE; From ad64279d2829a165abb3d54d0ba9515f94d87ee4 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 3 Oct 2018 20:48:44 -0400 Subject: [PATCH 072/138] Edit Pink, Navy, and Jet --- src/k_kart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index db317803..00cb29a9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -189,7 +189,7 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN { 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON - {121, 121, 144, 144, 145, 145, 146, 146, 147, 148, 149, 150, 151, 134, 136, 138}, // SKINCOLOR_PINK + {120, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 134, 136, 138, 140}, // SKINCOLOR_PINK {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED @@ -228,10 +228,10 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN {120, 120, 208, 209, 210, 226, 215, 216, 217, 229, 229, 205, 205, 206, 207, 31}, // SKINCOLOR_JAWZ {208, 209, 211, 213, 215, 216, 216, 217, 217, 218, 218, 219, 205, 206, 207, 207}, // SKINCOLOR_CERULEAN - {215, 215, 215, 216, 216, 217, 218, 204, 204, 205, 205, 206, 207, 29, 30, 31}, // SKINCOLOR_NAVY + {211, 212, 213, 215, 216, 218, 219, 205, 206, 206, 207, 207, 28, 29, 30, 31}, // SKINCOLOR_NAVY {120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL - {200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_JET + {225, 226, 227, 228, 229, 205, 205, 206, 207, 207, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE From fef3c6374073b3c0f46951cc72ef5b9d96fc449e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 3 Oct 2018 21:18:07 -0400 Subject: [PATCH 073/138] Moved colors around yet again for nicer invincibility effect - Ruby is closer to the pinks (and where purples would be if it wrapped around) - Sapphire is closer to the cyans - Dream is right before the teals --- src/dehacked.c | 32 +++++++++++------------ src/doomdef.h | 6 ++--- src/k_kart.c | 70 +++++++++++++++++++++++++------------------------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 99d95259..baa35b74 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7613,9 +7613,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "SALMON", // 10 // SKINCOLOR_SALMON "PINK", // 11 // SKINCOLOR_PINK "ROSE", // 12 // SKINCOLOR_ROSE - "RASPBERRY", // 13 // SKINCOLOR_RASPBERRY - "RED", // 14 // SKINCOLOR_RED - "RUBY", // 15 // SKINCOLOR_RUBY + "RUBY", // 13 // SKINCOLOR_RUBY + "RASPBERRY", // 14 // SKINCOLOR_RASPBERRY + "RED", // 15 // SKINCOLOR_RED "CRIMSON", // 16 // SKINCOLOR_CRIMSON "KETCHUP", // 17 // SKINCOLOR_KETCHUP "DAWN", // 18 // SKINCOLOR_DAWN @@ -7635,16 +7635,16 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "VOMIT", // 32 // SKINCOLOR_VOMIT "GARDEN", // 33 // SKINCOLOR_GARDEN "LIME", // 34 // SKINCOLOR_LIME - "DREAM", // 35 // SKINCOLOR_DREAM - "TEA", // 36 // SKINCOLOR_TEA - "PISTACHIO", // 37 // SKINCOLOR_PISTACHIO - "ROBOHOOD", // 38 // SKINCOLOR_ROBOHOOD - "MOSS", // 39 // SKINCOLOR_MOSS - "MINT", // 40 // SKINCOLOR_MINT - "GREEN", // 41 // SKINCOLOR_GREEN - "PINETREE", // 42 // SKINCOLOR_PINETREE - "EMERALD", // 43 // SKINCOLOR_EMERALD - "SWAMP", // 44 // SKINCOLOR_SWAMP + "TEA", // 35 // SKINCOLOR_TEA + "PISTACHIO", // 36 // SKINCOLOR_PISTACHIO + "ROBOHOOD", // 37 // SKINCOLOR_ROBOHOOD + "MOSS", // 38 // SKINCOLOR_MOSS + "MINT", // 39 // SKINCOLOR_MINT + "GREEN", // 40 // SKINCOLOR_GREEN + "PINETREE", // 41 // SKINCOLOR_PINETREE + "EMERALD", // 42 // SKINCOLOR_EMERALD + "SWAMP", // 43 // SKINCOLOR_SWAMP + "DREAM", // 44 // SKINCOLOR_DREAM "AQUA", // 45 // SKINCOLOR_AQUA "TEAL", // 46 // SKINCOLOR_TEAL "CYAN", // 47 // SKINCOLOR_CYAN @@ -7654,9 +7654,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "SLATE", // 51 // SKINCOLOR_SLATE "STEEL", // 52 // SKINCOLOR_STEEL "JET", // 53 // SKINCOLOR_JET - "PERIWINKLE", // 54 // SKINCOLOR_PERIWINKLE - "BLUE", // 55 // SKINCOLOR_BLUE - "SAPPHIRE", // 56 // SKINCOLOR_SAPPHIRE + "SAPPHIRE", // 54 // SKINCOLOR_SAPPHIRE + "PERIWINKLE", // 55 // SKINCOLOR_PERIWINKLE + "BLUE", // 56 // SKINCOLOR_BLUE "BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY "DUSK", // 58 // SKINCOLOR_DUSK "PURPLE", // 59 // SKINCOLOR_PURPLE diff --git a/src/doomdef.h b/src/doomdef.h index b5519f6f..c051a58b 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -244,9 +244,9 @@ typedef enum SKINCOLOR_SALMON, SKINCOLOR_PINK, SKINCOLOR_ROSE, + SKINCOLOR_RUBY, SKINCOLOR_RASPBERRY, SKINCOLOR_RED, - SKINCOLOR_RUBY, SKINCOLOR_CRIMSON, SKINCOLOR_KETCHUP, SKINCOLOR_DAWN, @@ -266,7 +266,6 @@ typedef enum SKINCOLOR_VOMIT, SKINCOLOR_GARDEN, SKINCOLOR_LIME, - SKINCOLOR_DREAM, SKINCOLOR_TEA, SKINCOLOR_PISTACHIO, SKINCOLOR_ROBOHOOD, @@ -276,6 +275,7 @@ typedef enum SKINCOLOR_PINETREE, SKINCOLOR_EMERALD, SKINCOLOR_SWAMP, + SKINCOLOR_DREAM, SKINCOLOR_AQUA, SKINCOLOR_TEAL, SKINCOLOR_CYAN, @@ -285,9 +285,9 @@ typedef enum SKINCOLOR_SLATE, SKINCOLOR_STEEL, SKINCOLOR_JET, + SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave – slender aphrodite has overcome me with longing for a girl SKINCOLOR_PERIWINKLE, SKINCOLOR_BLUE, - SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave – slender aphrodite has overcome me with longing for a girl SKINCOLOR_BLUEBERRY, SKINCOLOR_DUSK, SKINCOLOR_PURPLE, diff --git a/src/k_kart.c b/src/k_kart.c index 00cb29a9..bed5a86e 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -55,9 +55,9 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Salmon", // 10 // SKINCOLOR_SALMON "Pink", // 11 // SKINCOLOR_PINK "Rose", // 12 // SKINCOLOR_ROSE - "Raspberry", // 13 // SKINCOLOR_RASPBERRY - "Red", // 14 // SKINCOLOR_RED - "Ruby", // 15 // SKINCOLOR_RUBY + "Ruby", // 13 // SKINCOLOR_RUBY + "Raspberry", // 14 // SKINCOLOR_RASPBERRY + "Red", // 15 // SKINCOLOR_RED "Crimson", // 16 // SKINCOLOR_CRIMSON "Ketchup", // 17 // SKINCOLOR_KETCHUP "Dawn", // 18 // SKINCOLOR_DAWN @@ -77,16 +77,16 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Vomit", // 32 // SKINCOLOR_VOMIT "Garden", // 33 // SKINCOLOR_GARDEN "Lime", // 34 // SKINCOLOR_LIME - "Dream", // 35 // SKINCOLOR_DREAM - "Tea", // 36 // SKINCOLOR_TEA - "Pistachio", // 37 // SKINCOLOR_PISTACHIO - "Robo-Hood", // 38 // SKINCOLOR_ROBOHOOD - "Moss", // 39 // SKINCOLOR_MOSS - "Mint", // 40 // SKINCOLOR_MINT - "Green", // 41 // SKINCOLOR_GREEN - "Pinetree", // 42 // SKINCOLOR_PINETREE - "Emerald", // 43 // SKINCOLOR_EMERALD - "Swamp", // 44 // SKINCOLOR_SWAMP + "Tea", // 35 // SKINCOLOR_TEA + "Pistachio", // 36 // SKINCOLOR_PISTACHIO + "Robo-Hood", // 37 // SKINCOLOR_ROBOHOOD + "Moss", // 38 // SKINCOLOR_MOSS + "Mint", // 39 // SKINCOLOR_MINT + "Green", // 40 // SKINCOLOR_GREEN + "Pinetree", // 41 // SKINCOLOR_PINETREE + "Emerald", // 42 // SKINCOLOR_EMERALD + "Swamp", // 43 // SKINCOLOR_SWAMP + "Dream", // 44 // SKINCOLOR_DREAM "Aqua", // 45 // SKINCOLOR_AQUA "Teal", // 46 // SKINCOLOR_TEAL "Cyan", // 47 // SKINCOLOR_CYAN @@ -96,9 +96,9 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Slate", // 51 // SKINCOLOR_SLATE "Steel", // 52 // SKINCOLOR_STEEL "Jet", // 53 // SKINCOLOR_JET - "Periwinkle", // 54 // SKINCOLOR_PERIWINKLE - "Blue", // 55 // SKINCOLOR_BLUE - "Sapphire", // 56 // SKINCOLOR_SAPPHIRE + "Sapphire", // 54 // SKINCOLOR_SAPPHIRE + "Periwinkle", // 55 // SKINCOLOR_PERIWINKLE + "Blue", // 56 // SKINCOLOR_BLUE "Blueberry", // 57 // SKINCOLOR_BLUEBERRY "Dusk", // 58 // SKINCOLOR_DUSK "Purple", // 59 // SKINCOLOR_PURPLE @@ -124,9 +124,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE - SKINCOLOR_MINT,8, // 13 // SKINCOLOR_RASPBERRY - SKINCOLOR_GREEN,6, // 14 // SKINCOLOR_RED - SKINCOLOR_SAPPHIRE,8, // 15 // SKINCOLOR_RUBY + SKINCOLOR_SAPPHIRE,8, // 13 // SKINCOLOR_RUBY + SKINCOLOR_MINT,8, // 14 // SKINCOLOR_RASPBERRY + SKINCOLOR_GREEN,6, // 15 // SKINCOLOR_RED SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON SKINCOLOR_MUSTARD,10, // 17 // SKINCOLOR_KETCHUP SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN @@ -146,16 +146,16 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT SKINCOLOR_LAVENDER,6, // 33 // SKINCOLOR_GARDEN SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME - SKINCOLOR_POMEGRANATE,8, // 35 // SKINCOLOR_DREAM - SKINCOLOR_SALMON,8, // 36 // SKINCOLOR_TEA - SKINCOLOR_PINK,6, // 37 // SKINCOLOR_PISTACHIO - SKINCOLOR_VOMIT,8, // 38 // SKINCOLOR_ROBOHOOD - SKINCOLOR_ROSE,8, // 39 // SKINCOLOR_MOSS - SKINCOLOR_RASPBERRY,8, // 40 // SKINCOLOR_MINT - SKINCOLOR_RED,8, // 41 // SKINCOLOR_GREEN - SKINCOLOR_CRIMSON,8, // 42 // SKINCOLOR_PINETREE - SKINCOLOR_PURPLE,8, // 43 // SKINCOLOR_EMERALD - SKINCOLOR_BYZANTIUM,8, // 44 // SKINCOLOR_SWAMP + SKINCOLOR_SALMON,8, // 35 // SKINCOLOR_TEA + SKINCOLOR_PINK,6, // 36 // SKINCOLOR_PISTACHIO + SKINCOLOR_VOMIT,8, // 37 // SKINCOLOR_ROBOHOOD + SKINCOLOR_ROSE,8, // 38 // SKINCOLOR_MOSS + SKINCOLOR_RASPBERRY,8, // 39 // SKINCOLOR_MINT + SKINCOLOR_RED,8, // 40 // SKINCOLOR_GREEN + SKINCOLOR_CRIMSON,8, // 41 // SKINCOLOR_PINETREE + SKINCOLOR_PURPLE,8, // 42 // SKINCOLOR_EMERALD + SKINCOLOR_BYZANTIUM,8, // 43 // SKINCOLOR_SWAMP + SKINCOLOR_POMEGRANATE,8, // 44 // SKINCOLOR_DREAM SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN @@ -165,9 +165,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_GOLD,10, // 51 // SKINCOLOR_SLATE SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL SKINCOLOR_BURGUNDY,8, // 53 // SKINCOLOR_JET - SKINCOLOR_CREAMSICLE,8, // 54 // SKINCOLOR_PERIWINKLE - SKINCOLOR_ORANGE,8, // 55 // SKINCOLOR_BLUE - SKINCOLOR_RUBY,6, // 56 // SKINCOLOR_SAPPHIRE + SKINCOLOR_RUBY,6, // 54 // SKINCOLOR_SAPPHIRE + SKINCOLOR_CREAMSICLE,8, // 55 // SKINCOLOR_PERIWINKLE + SKINCOLOR_ORANGE,8, // 56 // SKINCOLOR_BLUE SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY SKINCOLOR_DAWN,6, // 58 // SKINCOLOR_DUSK SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE @@ -191,9 +191,9 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON {120, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 134, 136, 138, 140}, // SKINCOLOR_PINK {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE + {121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED - {121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY {130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP {120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN @@ -213,7 +213,6 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT { 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN { 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME - {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM {120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA {120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO {176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD @@ -223,6 +222,7 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD {186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP + {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM {120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA {210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN @@ -232,9 +232,9 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL {225, 226, 227, 228, 229, 205, 205, 206, 207, 207, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET + {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE - {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE {228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY {192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK {192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE From 1cb2c22cbda621b58a8e41bb4164beee5b505c35 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 14:28:38 -0400 Subject: [PATCH 074/138] Dream is green, Olive is yellow --- src/hu_stuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ab427b48..133db0c8 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -741,11 +741,11 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x8f"; // V_PEACHMAP else if (color <= SKINCOLOR_BRONZE) cstart = "\x8A"; // V_GOLDMAP - else if (color <= SKINCOLOR_MUSTARD) + else if (color <= SKINCOLOR_OLIVE) cstart = "\x82"; // V_YELLOWMAP else if (color <= SKINCOLOR_PISTACHIO) cstart = "\x8b"; // V_TEAMAP - else if (color <= SKINCOLOR_SWAMP || color == SKINCOLOR_LIME) + else if (color <= SKINCOLOR_DREAM || color == SKINCOLOR_LIME) cstart = "\x83"; // V_GREENMAP else if (color <= SKINCOLOR_TEAL) cstart = "\x8e"; // V_TEALMAP From 744c41bc8a4dc38b4c644212ce10ab1e41dd3408 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 14:30:54 -0400 Subject: [PATCH 075/138] Edit the text remaps Lighter sky, lighter pink, steel is now called steel-blue --- src/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/console.c b/src/console.c index ab8635b6..adc94d8a 100644 --- a/src/console.c +++ b/src/console.c @@ -154,7 +154,7 @@ static CV_PossibleValue_t menuhighlight_cons_t[] = {V_GOLDMAP, "Always gold"}, {V_LAVENDERMAP, "Always lavender"}, {V_TEAMAP, "Always tea-green"}, - {V_STEELMAP, "Always steel"}, + {V_STEELMAP, "Always steel-blue"}, {V_PINKMAP, "Always pink"}, {V_TEALMAP, "Always teal"}, {V_PEACHMAP, "Always peach"}, @@ -330,12 +330,12 @@ static void CON_SetupColormaps(void) redmap[120] = (UINT8)126; // battle graymap[120] = (UINT8)10; orangemap[120] = (UINT8)85; // record attack - skymap[120] = (UINT8)214; // race + skymap[120] = (UINT8)212; // race lavendermap[120] = (UINT8)248; goldmap[120] = (UINT8)114; teamap[120] = (UINT8)177; steelmap[120] = (UINT8)201; - pinkmap[120] = (UINT8)124; + pinkmap[120] = (UINT8)144; tealmap[120] = (UINT8)220; peachmap[120] = (UINT8)69; // nice From 8afdda82492fac89ed6445da541b57ef567024ec Mon Sep 17 00:00:00 2001 From: Sryder Date: Thu, 4 Oct 2018 21:08:47 +0100 Subject: [PATCH 076/138] Disable VSync by default. I wouldn't be surprised if there are issues that arise from it, and I'm fairly sure its always been slightly spotty. --- src/android/i_video.c | 2 +- src/djgppdos/vid_vesa.c | 6 +++--- src/dummy/i_video.c | 2 +- src/nds/i_video.c | 2 +- src/sdl/i_video.c | 2 +- src/sdl12/i_video.c | 2 +- src/win32/win_vid.c | 2 +- src/win32ce/win_vid.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/android/i_video.c b/src/android/i_video.c index 2d0151f5..8b4bee31 100644 --- a/src/android/i_video.c +++ b/src/android/i_video.c @@ -16,7 +16,7 @@ boolean allow_fullscreen = false; -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; void I_StartupGraphics(void){} diff --git a/src/djgppdos/vid_vesa.c b/src/djgppdos/vid_vesa.c index ec7b8b88..01a27dce 100644 --- a/src/djgppdos/vid_vesa.c +++ b/src/djgppdos/vid_vesa.c @@ -46,7 +46,7 @@ static void VID_Command_ModeInfo_f (void); static void VID_Command_ModeList_f (void); static void VID_Command_Mode_f (void); -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #define VBEVERSION 2 // we need vesa2 or higher @@ -92,8 +92,8 @@ static vmode_t *pcurrentmode; // the current active videomode. // table des modes videos. -// seul le mode 320x200x256c standard VGA est support‚ sans le VESA. -// ce mode est le mode num‚ro 0 dans la liste. +// seul le mode 320x200x256c standard VGA est support� sans le VESA. +// ce mode est le mode num�ro 0 dans la liste. typedef struct { int modenum; // vesa vbe2.0 modenum diff --git a/src/dummy/i_video.c b/src/dummy/i_video.c index e167e833..93ba6b75 100644 --- a/src/dummy/i_video.c +++ b/src/dummy/i_video.c @@ -8,7 +8,7 @@ boolean highcolor = false; boolean allow_fullscreen = false; -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; void I_StartupGraphics(void){} diff --git a/src/nds/i_video.c b/src/nds/i_video.c index 3dfb9955..06969dfd 100644 --- a/src/nds/i_video.c +++ b/src/nds/i_video.c @@ -32,7 +32,7 @@ boolean highcolor = false; boolean allow_fullscreen = false; -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; void I_StartupGraphics(void) { diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 5cb319f6..590158c8 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -94,7 +94,7 @@ rendermode_t rendermode=render_soft; boolean highcolor = false; // synchronize page flipping with screen refresh -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; UINT8 graphics_started = 0; // Is used in console.c and screen.c diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index ac9d4ffc..69cf5ca9 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -150,7 +150,7 @@ boolean highcolor = false; #if defined(DC) || (defined(GP2X) && !defined(HAVE_GP2XSDL)) consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #else -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 30fada8e..f355eaea 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -51,7 +51,7 @@ rendermode_t rendermode = render_soft; static void OnTop_OnChange(void); // synchronize page flipping with screen refresh static CV_PossibleValue_t CV_NeverOnOff[] = {{-1, "Never"}, {0, "Off"}, {1, "On"}, {0, NULL}}; -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, OnTop_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, OnTop_OnChange, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index b9c2e131..5e8e7e1f 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -48,7 +48,7 @@ rendermode_t rendermode = render_soft; // synchronize page flipping with screen refresh -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; boolean highcolor; From 71efda2b20acc0ff4fa44a3a60e2c74bb134182f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 17:50:50 -0400 Subject: [PATCH 077/138] Always move the camera According to wolfs, this improves fps. Let's confirm, shall we? --- src/d_main.c | 14 -------------- src/p_tick.c | 10 ++++++++++ src/p_user.c | 8 -------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index e56a631a..6e3d4d73 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -723,20 +723,6 @@ void D_SRB2Loop(void) } else if (rendertimeout < entertic) // in case the server hang or netsplit { - // Lagless camera! Yay! - /* Not yay, it ruins Kart's drift :y - if (gamestate == GS_LEVEL && netgame) - { - if (camera.chase) - P_MoveChaseCamera(&players[displayplayer], &camera, false); - if (splitscreen && camera2.chase) - P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false); - if (splitscreen > 1 && camera3.chase) - P_MoveChaseCamera(&players[thirddisplayplayer], &camera3, false); - if (splitscreen > 2 && camera4.chase) - P_MoveChaseCamera(&players[fourthdisplayplayer], &camera4, false); - } - */ D_Display(); if (moviemode) diff --git a/src/p_tick.c b/src/p_tick.c index 3c5ed0b9..c9c32433 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -748,6 +748,16 @@ void P_Ticker(boolean run) D_MapChange(gamemap, gametype, encoremode, true, 0, false, false); } + // Always move the camera. + if (camera.chase) + P_MoveChaseCamera(&players[displayplayer], &camera, false); + if (splitscreen && camera2.chase) + P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false); + if (splitscreen > 1 && camera3.chase) + P_MoveChaseCamera(&players[thirddisplayplayer], &camera3, false); + if (splitscreen > 2 && camera4.chase) + P_MoveChaseCamera(&players[fourthdisplayplayer], &camera4, false); + P_MapEnd(); // Z_CheckMemCleanup(); diff --git a/src/p_user.c b/src/p_user.c index d3407bd6..f33b46d2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9546,12 +9546,6 @@ void P_PlayerAfterThink(player_t *player) if (player->playerstate == PST_DEAD) { - // camera may still move when guy is dead - //if (!netgame) - { - if (thiscam && thiscam->chase) - P_MoveChaseCamera(player, thiscam, false); - } return; } @@ -9833,8 +9827,6 @@ void P_PlayerAfterThink(player_t *player) player->viewz = player->mo->z + player->mo->height - player->viewheight; else player->viewz = player->mo->z + player->viewheight; - if (server || addedtogame) - P_MoveChaseCamera(player, thiscam, false); // calculate the camera movement } } From 6bae5e952b9abb93c9f9fa4590b9816ed564fd69 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 18:07:56 -0400 Subject: [PATCH 078/138] Brown text colormap instead of teal, revert sky-blue --- src/console.c | 14 +++++++------- src/console.h | 2 +- src/dehacked.c | 2 +- src/hu_stuff.c | 6 ++---- src/v_video.c | 4 ++-- src/v_video.h | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/console.c b/src/console.c index adc94d8a..f79a6faf 100644 --- a/src/console.c +++ b/src/console.c @@ -156,7 +156,7 @@ static CV_PossibleValue_t menuhighlight_cons_t[] = {V_TEAMAP, "Always tea-green"}, {V_STEELMAP, "Always steel-blue"}, {V_PINKMAP, "Always pink"}, - {V_TEALMAP, "Always teal"}, + {V_BROWNMAP, "Always brown"}, {V_PEACHMAP, "Always peach"}, {0, NULL} }; @@ -291,7 +291,7 @@ static void CONS_backcolor_Change(void) // TODO: This could probably be improved somehow... // These colormaps are 99% identical, with just a few changed bytes UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\ - *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *tealmap, *peachmap; + *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap; static void CON_SetupColormaps(void) { @@ -311,8 +311,8 @@ static void CON_SetupColormaps(void) teamap = (goldmap+256); steelmap = (teamap+256); pinkmap = (steelmap+256); - tealmap = (pinkmap+256); - peachmap = (tealmap+256); + brownmap = (pinkmap+256); + peachmap = (brownmap+256); // setup the other colormaps, for console text @@ -330,13 +330,13 @@ static void CON_SetupColormaps(void) redmap[120] = (UINT8)126; // battle graymap[120] = (UINT8)10; orangemap[120] = (UINT8)85; // record attack - skymap[120] = (UINT8)212; // race + skymap[120] = (UINT8)214; // race lavendermap[120] = (UINT8)248; goldmap[120] = (UINT8)114; teamap[120] = (UINT8)177; steelmap[120] = (UINT8)201; - pinkmap[120] = (UINT8)144; - tealmap[120] = (UINT8)220; + pinkmap[120] = (UINT8)145; + brownmap[120] = (UINT8)48; peachmap[120] = (UINT8)69; // nice // Init back colormap diff --git a/src/console.h b/src/console.h index b15ccb6f..e4f01c8e 100644 --- a/src/console.h +++ b/src/console.h @@ -39,7 +39,7 @@ extern UINT32 con_scalefactor; // console text scale factor extern consvar_t cons_backcolor, cons_menuhighlight; extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\ - *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *tealmap, *peachmap; + *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap; // Console bg color (auto updated to match) extern UINT8 *consolebgmap; diff --git a/src/dehacked.c b/src/dehacked.c index baa35b74..04301ef2 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8264,7 +8264,7 @@ struct { {"V_TEAMAP",V_TEAMAP}, {"V_STEELMAP",V_STEELMAP}, {"V_PINKMAP",V_PINKMAP}, - {"V_TEALMAP",V_TEALMAP}, + {"V_BROWNMAP",V_BROWNMAP}, {"V_PEACHMAP",V_PEACHMAP}, {"V_TRANSLUCENT",V_TRANSLUCENT}, {"V_10TRANS",V_10TRANS}, diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 133db0c8..838e8129 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -727,10 +727,10 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) const UINT8 color = players[playernum].skincolor; if (color <= SKINCOLOR_SILVER || color == SKINCOLOR_SLATE) cstart = "\x80"; // white - else if (color <= SKINCOLOR_BEIGE || color == SKINCOLOR_JET) + else if (color <= SKINCOLOR_BLACK || color == SKINCOLOR_JET) cstart = "\x86"; // V_GRAYMAP else if (color <= SKINCOLOR_LEATHER) - cstart = "\x8A"; // V_GOLDMAP + cstart = "\x8e"; // V_BROWNMAP else if (color <= SKINCOLOR_ROSE || color == SKINCOLOR_LILAC) cstart = "\x8d"; // V_PINKMAP else if (color <= SKINCOLOR_KETCHUP) @@ -747,8 +747,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x8b"; // V_TEAMAP else if (color <= SKINCOLOR_DREAM || color == SKINCOLOR_LIME) cstart = "\x83"; // V_GREENMAP - else if (color <= SKINCOLOR_TEAL) - cstart = "\x8e"; // V_TEALMAP else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE) cstart = "\x88"; // V_SKYMAP else if (color <= SKINCOLOR_STEEL) diff --git a/src/v_video.c b/src/v_video.c index 46d34acc..8a1a3737 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1282,8 +1282,8 @@ UINT8 *V_GetStringColormap(INT32 colorflags) return steelmap; case 13: // 0x8D, pink return pinkmap; - case 14: // 0x8E, teal - return tealmap; + case 14: // 0x8E, brown + return brownmap; case 15: // 0x8F, peach return peachmap; default: // reset diff --git a/src/v_video.h b/src/v_video.h index f6826cf7..734b8037 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -82,7 +82,7 @@ extern UINT8 hudtrans; #define V_TEAMAP 0x0000B000 #define V_STEELMAP 0x0000C000 #define V_PINKMAP 0x0000D000 -#define V_TEALMAP 0x0000E000 +#define V_BROWNMAP 0x0000E000 #define V_PEACHMAP 0x0000F000 // use bits 17-20 for alpha transparency From 79f5f4885c70e373cd6d4afc275c2141aa545736 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 4 Oct 2018 19:47:19 -0400 Subject: [PATCH 079/138] Split zlib and libpng --- src/Makefile | 22 +++++++++++++++------- src/sdl/mixer_sound.c | 17 ++++++++--------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/Makefile b/src/Makefile index dd250b0b..7a67c3f0 100644 --- a/src/Makefile +++ b/src/Makefile @@ -66,6 +66,7 @@ # Compile without 3D sound support, add 'NOHS=1' # Compile with GDBstubs, add 'RDB=1' # Compile without PNG, add 'NOPNG=1' +# Compile without zlib, add 'NOZLIB=1' # # Addon for SDL: # To Cross-Compile, add 'SDL_CONFIG=/usr/*/bin/sdl-config' @@ -119,6 +120,7 @@ include Makefile.cfg ifdef DUMMY NOPNG=1 +NOZLIB=1 NONET=1 NOHW=1 NOHS=1 @@ -199,6 +201,7 @@ endif ifdef NDS NOPNG=1 +NOZLIB=1 NONET=1 #NOHW=1 NOHS=1 @@ -325,13 +328,6 @@ LIBS+=$(PNG_LDFLAGS) CFLAGS+=$(PNG_CFLAGS) endif -ZLIB_PKGCONFIG?=zlib -ZLIB_CFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --cflags) -ZLIB_LDFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --libs) - -LIBS+=$(ZLIB_LDFLAGS) -CFLAGS+=$(ZLIB_CFLAGS) - ifdef HAVE_LIBGME OPTS+=-DHAVE_LIBGME @@ -343,6 +339,18 @@ LIBS+=$(LIBGME_LDFLAGS) CFLAGS+=$(LIBGME_CFLAGS) endif +ifndef NOZLIB +OPTS+=-DHAVE_ZLIB +ZLIB_PKGCONFIG?=zlib +ZLIB_CFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --cflags) +ZLIB_LDFLAGS?=$(shell $(PKG_CONFIG) $(ZLIB_PKGCONFIG) --libs) + +LIBS+=$(ZLIB_LDFLAGS) +CFLAGS+=$(ZLIB_CFLAGS) +else +NOPNG=1 +endif + ifdef STATIC LIBS:=-static $(LIBS) endif diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 5211efe0..362d7f26 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -38,9 +38,6 @@ #include "gme/gme.h" #define GME_TREBLE 5.0 #define GME_BASS 1.0 -#ifdef HAVE_PNG /// TODO: compile with zlib support without libpng - -#define HAVE_ZLIB #ifndef _MSC_VER #ifndef _LARGEFILE64_SOURCE @@ -56,10 +53,13 @@ #define _FILE_OFFSET_BITS 0 #endif -#include "zlib.h" #endif #endif +#ifdef HAVE_ZLIB +#include "zlib.h" +#endif + UINT8 sound_started = false; static boolean midimode; @@ -361,7 +361,7 @@ void *I_GetSfx(sfxinfo_t *sfx) } Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up #else - //CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n"); + return NULL; // No zlib support #endif } // Try to read it as a GME sound @@ -621,7 +621,8 @@ boolean I_StartDigSong(const char *musicname, boolean looping) } Z_Free(inflatedData); // GME didn't open jack, but don't let that stop us from freeing this up #else - //CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n"); + CONS_Alert(CONS_ERROR,"Cannot decompress VGZ; no zlib support\n"); + return true; #endif } else if (!gme_open_data(data, len, &gme, 44100)) @@ -840,6 +841,4 @@ void I_UnRegisterSong(INT32 handle) (void)handle; Mix_FreeMusic(music); music = NULL; -} - -#endif +} \ No newline at end of file From 7de16e2528bd5c80b0752cc6684f91070eb061b7 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 20:06:55 -0400 Subject: [PATCH 080/138] Foolish --- src/g_game.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index d77d04f8..9b413ee8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1819,8 +1819,8 @@ boolean G_Responder(event_t *ev) displayplayer = consoleplayer; else { - // spy mode - do + UINT8 i = 0; // spy mode + for (i = 0; i < MAXPLAYERS; i++) { displayplayer++; if (displayplayer == MAXPLAYERS) From 376656343a032d6612067315abf3270998b63dc6 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 20:08:29 -0400 Subject: [PATCH 081/138] Revert "Attempt to not let the camera into thok barriers" This reverts commit 9f42e74fe2db52fbe18e28675feb9034ad80d18b. --- src/p_map.c | 19 +++++-------------- src/p_mobj.c | 2 -- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 11dda089..b249f362 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2181,12 +2181,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) mapcampointer = thiscam; -#ifdef NOCLIPCAM - if (newsubsec->sector->floorheight >= newsubsec->sector->ceilingheight - || newsubsec->sector->ceilingheight <= newsubsec->sector->floorheight) - return false; -#endif - if (GETSECSPECIAL(newsubsec->sector->special, 4) == 12) { // Camera noclip on entire sector. tmfloorz = tmdropoffz = thiscam->z; @@ -2384,15 +2378,12 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam) fixed_t tryx = thiscam->x; fixed_t tryy = thiscam->y; -#ifdef NOCLIPCAM - if (!(s->sector->floorheight >= s->sector->ceilingheight - || s->sector->ceilingheight <= s->sector->floorheight)) -#else +#ifndef NOCLIPCAM if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) - || (leveltime < introtime)) + || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) + || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) + || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) + || (leveltime < introtime)) #endif { // Noclipping player camera noclips too!! floatok = true; diff --git a/src/p_mobj.c b/src/p_mobj.c index 456c0acf..d22d5cb6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3702,7 +3702,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled { if (!P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y + thiscam->momy, thiscam)) { // Never fails for 2D mode. -#ifndef NOCLIPCAM mobj_t dummy; dummy.thinker.function.acp1 = (actionf_p1)P_MobjThinker; dummy.subsector = thiscam->subsector; @@ -3713,7 +3712,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead. P_ResetCamera(player, thiscam); else -#endif P_SlideCameraMove(thiscam); if (resetcalled) // Okay this means the camera is fully reset. return true; From c5e30aa01879294cf14511496476364d0e783a91 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 22:06:56 -0400 Subject: [PATCH 082/138] Don't allow non-keyboard keys to screenshot/gif in menus --- src/m_misc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/m_misc.c b/src/m_misc.c index 7b176fd9..f1a81bb3 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1481,6 +1481,9 @@ boolean M_ScreenshotResponder(event_t *ev) ch = ev->data1; + if (ch >= KEY_MOUSE1 && menuactive) // If it's not a keyboard key, then don't allow it in the menus! + return false; + if (ch == gamecontrol[gc_screenshot][0] || ch == gamecontrol[gc_screenshot][1]) // remappable F8 M_ScreenShot(); else if (ch == gamecontrol[gc_recordgif][0] || ch == gamecontrol[gc_recordgif][1]) // remappable F9 From d51e4c3140d56b8da92bb94026abdc7db4ea3552 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 22:09:12 -0400 Subject: [PATCH 083/138] Scale explosions properly --- src/k_kart.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index 16d1cbce..0756b307 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2168,6 +2168,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) dust->angle = (ANGLE_180/16) * i; P_SetScale(dust, source->scale); dust->destscale = source->scale*10; + dust->scalespeed = FixedMul(dust->scalespeed, source->scale); P_InstaThrust(dust, dust->angle, FixedMul(20*FRACUNIT, source->scale)); truc = P_SpawnMobj(source->x + P_RandomRange(-radius, radius)*FRACUNIT, @@ -2175,6 +2176,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMEXPLODE); P_SetScale(truc, source->scale); truc->destscale = source->scale*6; + truc->scalespeed = FixedMul(truc->scalespeed, source->scale); speed = FixedMul(10*FRACUNIT, source->scale)>>FRACBITS; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; @@ -2190,6 +2192,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) source->z + P_RandomRange(0, height)*FRACUNIT, MT_SMOKE); P_SetScale(dust, source->scale); dust->destscale = source->scale*10; + dust->scalespeed = FixedMul(dust->scalespeed, source->scale); dust->tics = 30; dust->momz = P_RandomRange(FixedMul(3*FRACUNIT, source->scale)>>FRACBITS, FixedMul(7*FRACUNIT, source->scale)>>FRACBITS)*FRACUNIT; @@ -2198,6 +2201,7 @@ void K_SpawnMineExplosion(mobj_t *source, UINT8 color) source->z + P_RandomRange(0, height)*FRACUNIT, MT_BOOMPARTICLE); P_SetScale(truc, source->scale); truc->destscale = source->scale*5; + truc->scalespeed = FixedMul(truc->scalespeed, source->scale); speed = FixedMul(20*FRACUNIT, source->scale)>>FRACBITS; truc->momx = P_RandomRange(-speed, speed)*FRACUNIT; truc->momy = P_RandomRange(-speed, speed)*FRACUNIT; From 49cb1ffe9fb578f8abb29a3f45355ded6211dc03 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 4 Oct 2018 22:38:59 -0400 Subject: [PATCH 084/138] Restore deleted endif --- src/sdl/mixer_sound.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 362d7f26..d1083518 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -51,8 +51,6 @@ #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 0 -#endif - #endif #endif @@ -841,4 +839,6 @@ void I_UnRegisterSong(INT32 handle) (void)handle; Mix_FreeMusic(music); music = NULL; -} \ No newline at end of file +} + +#endif \ No newline at end of file From fc5d969642f57f54c12acd137355473f14d84acd Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 4 Oct 2018 22:44:26 -0400 Subject: [PATCH 085/138] Fix DD compiling --- src/win32/win_snd.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index f168f1fe..c030eec5 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -17,9 +17,6 @@ #include "gme/gme.h" #define GME_TREBLE 5.0 #define GME_BASS 1.0 -#ifdef HAVE_PNG /// TODO: compile with zlib support without libpng - -#define HAVE_ZLIB #ifndef _MSC_VER #ifndef _WII From b812a6a4abdf705d65c6f204291ec6645fe5d729 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Thu, 4 Oct 2018 22:56:11 -0400 Subject: [PATCH 086/138] Really fix DD compiling this time. --- src/win32/win_snd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index c030eec5..bc04bd6d 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -34,6 +34,7 @@ #define _FILE_OFFSET_BITS 0 #endif +#ifdef HAVE_ZLIB #include "zlib.h" #endif #endif From 3417f57e92d60c0a17c9b7b82bf4e76009b4194a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 23:58:44 -0400 Subject: [PATCH 087/138] -skill launcher option Requested by Sev(?), for map editing; sets kartspeed using the same name as Doom's difficulty launcher option --- src/d_main.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/d_main.c b/src/d_main.c index e56a631a..214bfac6 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1484,6 +1484,29 @@ void D_SRB2Main(void) } } + if (M_CheckParm("-skill") && M_IsNextParm()) + { + INT32 j; + INT16 newskill = -1; + const char *sskill = M_GetNextParm(); + + for (j = 0; kartspeed_cons_t[j].strvalue; j++) + if (!strcasecmp(kartspeed_cons_t[j].strvalue, sskill)) + { + newskill = (INT16)kartspeed_cons_t[j].value; + break; + } + if (!kartspeed_cons_t[j].strvalue) // reached end of the list with no match + { + j = atoi(sskill); // assume they gave us a skill number, which is okay too + if (j >= 0 && j <= 2) + newskill = (INT16)j; + } + + if (newskill != -1) + CV_SetValue(&cv_kartspeed, newskill); + } + if (server && !M_CheckParm("+map")) { // Prevent warping to nonexistent levels From df824eb3703d54251be1bd048857faf4025befbf Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Fri, 5 Oct 2018 12:13:11 +0200 Subject: [PATCH 088/138] Say-team (key and command) now depend of G_GametypeHasTeams(), so you'll only have to modify this function to have say-team work in the gametypes of your choice. --- src/hu_stuff.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 255d8512..adecc8cb 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -567,8 +567,11 @@ static void Command_Sayteam_f(void) CONS_Alert(CONS_NOTICE, M_GetText("Dedicated servers can't send team messages. Use \"say\".\n")); return; } - - DoSayCommand(-1, 1, 0); + + if (G_GametypeHasTeams()) // revert to normal say if we don't have teams in this gametype. + DoSayCommand(-1, 1, 0); + else + DoSayCommand(0, 1, 0); } /** Send a message to everyone, to be displayed by CECHO. Only @@ -1067,8 +1070,6 @@ boolean HU_Responder(event_t *ev) if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1]) && netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise. { - //if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) - // return false; chat_on = true; w_chat[0] = 0; teamtalk = false; @@ -1078,12 +1079,9 @@ boolean HU_Responder(event_t *ev) if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1]) && netgame && !OLD_MUTE) { - //if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) - // return false; chat_on = true; w_chat[0] = 0; - teamtalk = false; // CHANGE THIS TO TRUE TO MAKE SAYTEAM WORK AGAIN - //teamtalk = true; + teamtalk = G_GametypeHasTeams(); // Don't teamtalk if we don't have teams. chat_scrollmedown = true; return true; } From 1ec601af6b989f7ebdc0fa89f4bc2452977ae209 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 5 Oct 2018 22:42:36 +0100 Subject: [PATCH 089/138] Draw a star for continues if invalid skin numbers are somehow supplied --- src/v_video.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index aa2852c0..802a4d38 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -653,14 +653,10 @@ void V_DrawCroppedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_ // void V_DrawContinueIcon(INT32 x, INT32 y, INT32 flags, INT32 skinnum, UINT8 skincolor) { - if (skins[skinnum].flags & SF_HIRES -#ifdef HWRENDER -// || (rendermode != render_soft && rendermode != render_none) -#endif - ) - V_DrawScaledPatch(x - 10, y - 14, flags, W_CachePatchName("CONTINS", PU_CACHE)); + if (skinnum < 0 || skinnum >= numskins || (skins[skinnum].flags & SF_HIRES)) + V_DrawScaledPatch(x - 10, y - 14, flags, W_CachePatchName("CONTINS", PU_CACHE)); // Draw a star else - { + { // Find front angle of the first waiting frame of the character's actual sprites spriteframe_t *sprframe = &skins[skinnum].spritedef.spriteframes[2 & FF_FRAMEMASK]; patch_t *patch = W_CachePatchNum(sprframe->lumppat[0], PU_CACHE); const UINT8 *colormap = R_GetTranslationColormap(skinnum, skincolor, GTC_CACHE); From 2effb6adc36787879516b8cb2b13023fc4c423d2 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 5 Oct 2018 23:24:26 +0100 Subject: [PATCH 090/138] Halt frame-perfect egg crash. (The code is slightly modified from what I put in bug-reports as a potential fix, but I'm glad I was on the right track.) --- src/p_inter.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index bd02da42..5ca9a104 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -494,11 +494,19 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) K_StripOther(player); player->kartstuff[k_itemroulette] = 1; player->kartstuff[k_roulettetype] = 2; - if (special->target && special->target->player - && (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)) - player->kartstuff[k_eggmanblame] = special->target->player-players; - else - player->kartstuff[k_eggmanblame] = player-players; + if (special->target && special->target->player) + { + if (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0) + player->kartstuff[k_eggmanblame] = special->target->player-players; + else + player->kartstuff[k_eggmanblame] = player-players; + + if (special->target->hnext == special) + { + P_SetTarget(&special->target->hnext, NULL); + special->target->player->kartstuff[k_eggmanheld] = 0; + } + } P_RemoveMobj(special); return; From ea6bdca9497fca3d93b61ed4f5ee2ff23c7fbc6e Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 15:13:57 -0400 Subject: [PATCH 091/138] Remove R_DoorClosed This function has caused me, so much unexpected pain because of just how out of the way it is, and NOTHING else uses it --- src/r_bsp.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index 34b082ca..d47c1140 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -222,30 +222,6 @@ void R_PortalClearClipSegs(INT32 start, INT32 end) newend = solidsegs + 2; } - -// R_DoorClosed -// -// This function is used to fix the automap bug which -// showed lines behind closed doors simply because the door had a dropoff. -// -// It assumes that Doom has already ruled out a door being closed because -// of front-back closure (e.g. front floor is taller than back ceiling). -static INT32 R_DoorClosed(void) -{ - return - - // if door is closed because back is shut: - backsector->ceilingheight <= backsector->floorheight - - // preserve a kind of transparent door/lift special effect: - && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) - - && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) - - // properly render skies (consider door "open" if both ceilings are sky): - && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum); -} - // // If player's view height is underneath fake floor, lower the // drawn ceiling to be just under the floor height, and replace @@ -534,7 +510,11 @@ static void R_AddLine(seg_t *line) } // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = R_DoorClosed(); + doorclosed = (backsector->ceilingheight <= backsector->floorheight + && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) + && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + if (doorclosed) goto clipsolid; From 41ad3de9997667ff4231cf1d808e342eec527a58 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 6 Oct 2018 21:08:09 +0100 Subject: [PATCH 092/138] Access to map hell maps in record attack. Currently dependent on 50 emblems. Also: temporarily cleaned up the M_CanShowLevelInList record attack conditions to automatically match what we want, instead of requiring us to apply a bunch of vanilla flags just to emulate our "available unless explicitly hidden" MP mechanism like is currently in maps.kart. --- src/dehacked.c | 2 ++ src/m_cond.c | 18 +++++++++++------- src/m_cond.h | 1 + src/m_menu.c | 33 ++++++++++++++++++++++----------- 4 files changed, 36 insertions(+), 18 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 2efdb6bc..c00a6b23 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2428,6 +2428,8 @@ static void readunlockable(MYFILE *f, INT32 num) unlockables[num].type = SECRET_SOUNDTEST; else if (fastcmp(word2, "ENCORE")) unlockables[num].type = SECRET_ENCORE; + else if (fastcmp(word2, "HELLATTACK")) + unlockables[num].type = SECRET_HELLATTACK; else unlockables[num].type = (INT16)i; } diff --git a/src/m_cond.c b/src/m_cond.c index 63f88cb6..e3229f39 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -97,13 +97,14 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = unlockable_t unlockables[MAXUNLOCKABLES] = { // Name, Objective, Showing Conditionset, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist - /* 01 */ {"Egg Cup", "", -1, 1, SECRET_NONE, 0, false, false, 0}, - /* 02 */ {"SMK Cup", "", -1, 2, SECRET_NONE, 0, false, false, 0}, - /* 03 */ {"Chao Cup", "", -1, 3, SECRET_NONE, 0, false, false, 0}, + /* 01 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0}, - /* 04 */ {"Encore Mode", "", 3, 4, SECRET_ENCORE, 0, false, false, 0}, + /* 02 */ {"Egg Cup", "", -1, 1, SECRET_NONE, 0, false, false, 0}, + /* 03 */ {"SMK Cup", "", -1, 2, SECRET_NONE, 0, false, false, 0}, + /* 04 */ {"Chao Cup", "", -1, 3, SECRET_NONE, 0, false, false, 0}, - /* 05 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 05 */ {"Encore Mode", "", 3, 4, SECRET_ENCORE, 0, false, false, 0}, + /* 06 */ {"Hell Attack", "", 5, 5, SECRET_HELLATTACK, 0, false, false, 0}, }; // Default number of emblems and extra emblems @@ -127,10 +128,13 @@ void M_SetupDefaultConditionSets(void) M_AddRawCondition(3, 1, UC_TOTALEMBLEMS, 30, 0, 0); M_AddRawCondition(3, 2, UC_MATCHESPLAYED, 50, 0, 0); - // -- 4: Collect 50 emblems OR play 150 matches - M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 50, 0, 0); + // -- 4: Collect 40 emblems OR play 150 matches + M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 40, 0, 0); M_AddRawCondition(4, 2, UC_MATCHESPLAYED, 150, 0, 0); + // -- 4: Collect 50 emblems ONLY + M_AddRawCondition(5, 1, UC_TOTALEMBLEMS, 50, 0, 0); + // -- 10: Play 100 matches M_AddRawCondition(10, 1, UC_MATCHESPLAYED, 100, 0, 0); } diff --git a/src/m_cond.h b/src/m_cond.h index 5c8762ad..81b6803c 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -125,6 +125,7 @@ typedef struct #define SECRET_SOUNDTEST 3 // Sound Test #define SECRET_CREDITS 4 // Enables Credits #define SECRET_ENCORE 5 // Enables Encore mode cvar +#define SECRET_HELLATTACK 6 // Map Hell in record attack // If you have more secrets than these variables allow in your game, // you seriously need to get a life. diff --git a/src/m_menu.c b/src/m_menu.c index 6071ba16..5ad7a6c3 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3969,7 +3969,7 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) if (M_MapLocked(mapnum+1)) return false; // not unlocked - if (gt == GT_COOP && (mapheaderinfo[mapnum]->typeoflevel & TOL_COOP)) + /*if (gt == GT_COOP && (mapheaderinfo[mapnum]->typeoflevel & TOL_COOP)) return true; if (gt == GT_COMPETITION && (mapheaderinfo[mapnum]->typeoflevel & TOL_COMPETITION)) @@ -3978,10 +3978,10 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) if (gt == GT_CTF && (mapheaderinfo[mapnum]->typeoflevel & TOL_CTF)) return true; - if ((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH)) - return true; - if ((gt == GT_TAG || gt == GT_HIDEANDSEEK) && (mapheaderinfo[mapnum]->typeoflevel & TOL_TAG)) + return true;*/ + + if ((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH)) return true; if (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE)) @@ -3989,29 +3989,38 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) return false; - case LLM_LEVELSELECT: + /*case LLM_LEVELSELECT: if (mapheaderinfo[mapnum]->levelselect != maplistoption) return false; if (M_MapLocked(mapnum+1)) return false; // not unlocked - return true; + return true;*/ case LLM_RECORDATTACK: - if (!(mapheaderinfo[mapnum]->menuflags & LF2_RECORDATTACK)) + /*if (!(mapheaderinfo[mapnum]->menuflags & LF2_RECORDATTACK)) + return false;*/ + + if (!(mapheaderinfo[mapnum]->typeoflevel & TOL_RACE)) return false; if (M_MapLocked(mapnum+1)) return false; // not unlocked - if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED) + if (M_SecretUnlocked(SECRET_HELLATTACK)) + return true; // now you're in hell + + if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU) + return false; // map hell + + /*if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED) return true; if (!mapvisited[mapnum]) - return false; + return false;*/ return true; - case LLM_NIGHTSATTACK: + /*case LLM_NIGHTSATTACK: if (!(mapheaderinfo[mapnum]->menuflags & LF2_NIGHTSATTACK)) return false; @@ -4024,7 +4033,9 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) if (!mapvisited[mapnum]) return false; - return true; + return true;*/ + default: + return false; } // Hmm? Couldn't decide? From 3d7a1d44d506aa50e0a3c67da67e3e4ca09be15b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 16:22:36 -0400 Subject: [PATCH 093/138] Do clipsolid for doorclosed only while your camera is outside of the sector --- src/r_bsp.c | 55 +++++++++++++++++++++++++------------------- src/r_segs.c | 65 ++++++++++++++++++++++++++++------------------------ 2 files changed, 66 insertions(+), 54 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index d47c1140..da9ad665 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -374,6 +374,7 @@ static void R_AddLine(seg_t *line) INT32 x1, x2; angle_t angle1, angle2, span, tspan; static sector_t tempsec; // ceiling/water hack + sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -478,21 +479,24 @@ static void R_AddLine(seg_t *line) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) #undef SLOPEPARAMS - if ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) + if (thissec != backsector && thissec != frontsector) { - goto clipsolid; + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } + + // Check for automap fix. Store in doorclosed for r_segs.c + doorclosed = (backc1 <= backf1 && backc2 <= backf2 + && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) + && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + + if (doorclosed) + goto clipsolid; } - // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = (backc1 <= backf1 && backc2 <= backf2 - && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) - && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture) - && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); - - if (doorclosed) - goto clipsolid; - // Window. if (backc1 != frontc1 || backc2 != frontc2 || backf1 != frontf1 || backf2 != frontf2) @@ -503,21 +507,24 @@ static void R_AddLine(seg_t *line) else #endif { - if (backsector->ceilingheight <= frontsector->floorheight - || backsector->floorheight >= frontsector->ceilingheight) + if (thissec != backsector && thissec != frontsector) { - goto clipsolid; + if (backsector->ceilingheight <= frontsector->floorheight + || backsector->floorheight >= frontsector->ceilingheight) + { + goto clipsolid; + } + + // Check for automap fix. Store in doorclosed for r_segs.c + doorclosed = (backsector->ceilingheight <= backsector->floorheight + && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) + && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + + if (doorclosed) + goto clipsolid; } - // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = (backsector->ceilingheight <= backsector->floorheight - && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) - && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) - && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); - - if (doorclosed) - goto clipsolid; - // Window. if (backsector->ceilingheight != frontsector->ceilingheight || backsector->floorheight != frontsector->floorheight) diff --git a/src/r_segs.c b/src/r_segs.c index 11287f16..84bb119f 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2020,6 +2020,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) { // two sided line + sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; + #ifdef ESLOPE if (backsector->c_slope) { worldhigh = P_GetZAt(backsector->c_slope, segleft.x, segleft.y) - viewz; @@ -2113,52 +2115,55 @@ void R_StoreWallRange(INT32 start, INT32 stop) // ds_p->sprtopclip = screenheightarray; } -#ifdef ESLOPE - if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) -#else - if (worldhigh <= worldbottom) -#endif - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } - -#ifdef ESLOPE - if (worldlow >= worldtop && worldlowslope >= worldtopslope) -#else - if (worldlow >= worldtop) -#endif - { - ds_p->sprtopclip = screenheightarray; - ds_p->tsilheight = INT32_MIN; - ds_p->silhouette |= SIL_TOP; - } - - //SoM: 3/25/2000: This code fixes an automap bug that didn't check - // frontsector->ceiling and backsector->floor to see if a door was closed. - // Without the following code, sprites get displayed behind closed doors. + if (thissec != frontsector && thissec != backsector) { #ifdef ESLOPE - if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) + if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) #else - if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) + if (worldhigh <= worldbottom) #endif { ds_p->sprbottomclip = negonearray; ds_p->bsilheight = INT32_MAX; ds_p->silhouette |= SIL_BOTTOM; } + #ifdef ESLOPE - if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) + if (worldlow >= worldtop && worldlowslope >= worldtopslope) #else - if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) + if (worldlow >= worldtop) #endif - { // killough 1/17/98, 2/8/98 + { ds_p->sprtopclip = screenheightarray; ds_p->tsilheight = INT32_MIN; ds_p->silhouette |= SIL_TOP; } + + //SoM: 3/25/2000: This code fixes an automap bug that didn't check + // frontsector->ceiling and backsector->floor to see if a door was closed. + // Without the following code, sprites get displayed behind closed doors. + { +#ifdef ESLOPE + if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) +#else + if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) +#endif + { + ds_p->sprbottomclip = negonearray; + ds_p->bsilheight = INT32_MAX; + ds_p->silhouette |= SIL_BOTTOM; + } +#ifdef ESLOPE + if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) +#else + if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) +#endif + { // killough 1/17/98, 2/8/98 + ds_p->sprtopclip = screenheightarray; + ds_p->tsilheight = INT32_MIN; + ds_p->silhouette |= SIL_TOP; + } + } } if (worldlow != worldbottom From 031f142459337617f82b9e173e0339e8fbfe3914 Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 6 Oct 2018 21:53:39 +0100 Subject: [PATCH 094/138] You got it, Sal --- src/m_cond.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/m_cond.c b/src/m_cond.c index e3229f39..762b103a 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -97,14 +97,14 @@ extraemblem_t extraemblems[MAXEXTRAEMBLEMS] = unlockable_t unlockables[MAXUNLOCKABLES] = { // Name, Objective, Showing Conditionset, ConditionSet, Unlock Type, Variable, NoCecho, NoChecklist - /* 01 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0}, + /* 01 */ {"Egg Cup", "", -1, 1, SECRET_NONE, 0, false, false, 0}, + /* 02 */ {"SMK Cup", "", -1, 2, SECRET_NONE, 0, false, false, 0}, + /* 03 */ {"Chao Cup", "", -1, 3, SECRET_NONE, 0, false, false, 0}, - /* 02 */ {"Egg Cup", "", -1, 1, SECRET_NONE, 0, false, false, 0}, - /* 03 */ {"SMK Cup", "", -1, 2, SECRET_NONE, 0, false, false, 0}, - /* 04 */ {"Chao Cup", "", -1, 3, SECRET_NONE, 0, false, false, 0}, + /* 04 */ {"Encore Mode", "", 3, 4, SECRET_ENCORE, 0, false, false, 0}, + /* 05 */ {"Hell Attack", "", 5, 5, SECRET_HELLATTACK, 0, false, false, 0}, - /* 05 */ {"Encore Mode", "", 3, 4, SECRET_ENCORE, 0, false, false, 0}, - /* 06 */ {"Hell Attack", "", 5, 5, SECRET_HELLATTACK, 0, false, false, 0}, + /* 06 */ {"Record Attack", "", -1, -1, SECRET_RECORDATTACK, 0, true, true, 0}, }; // Default number of emblems and extra emblems From 725a65c1f7eff77e5632b6a7d7fdb11c47ee0c3f Mon Sep 17 00:00:00 2001 From: Sryder Date: Sat, 6 Oct 2018 21:44:40 +0100 Subject: [PATCH 095/138] Call SDL_RWclose after an SDL_RWFromMem call to close the RWops. --- src/sdl/mixer_sound.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 5211efe0..e835a55c 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -387,7 +387,15 @@ void *I_GetSfx(sfxinfo_t *sfx) #endif // Try to load it as a WAVE or OGG using Mixer. - return Mix_LoadWAV_RW(SDL_RWFromMem(lump, sfx->length), 1); + SDL_RWops *rw = SDL_RWFromMem(lump, sfx->length); + if (rw != NULL) + { + Mix_Chunk *chunk = Mix_LoadWAV_RW(rw, 1); + SDL_RWclose(rw); + return chunk; + } + + return NULL; // haven't been able to get anything } void I_FreeSfx(sfxinfo_t *sfx) @@ -635,7 +643,12 @@ boolean I_StartDigSong(const char *musicname, boolean looping) } #endif - music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE); + SDL_RWops *rw = SDL_RWFromMem(data, len); + if (rw != NULL) + { + music = Mix_LoadMUS_RW(rw, SDL_FALSE); + SDL_RWclose(rw); + } if (!music) { CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError()); @@ -798,7 +811,12 @@ void I_SetMIDIMusicVolume(UINT8 volume) INT32 I_RegisterSong(void *data, size_t len) { - music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE); + SDL_RWops *rw = SDL_RWFromMem(data, len); + if (rw != NULL) + { + music = Mix_LoadMUS_RW(rw, SDL_FALSE); + SDL_RWclose(rw); + } if (!music) { CONS_Alert(CONS_ERROR, "Mix_LoadMUS_RW: %s\n", Mix_GetError()); From 7b417b573c61eeaeb325366196d78ace780f1b5a Mon Sep 17 00:00:00 2001 From: Sryder Date: Sat, 6 Oct 2018 23:59:39 +0100 Subject: [PATCH 096/138] Mix_QuickLoad_RAW sets a flag in the Mix_Chunk so that Mix_FreeChunk doesn't actually Free the sound. Checks for the flag when freeing, and if it's 0, we free the data manually after Mix_FreeChunk. I went back to Z_Malloc and Z_Free for this because they still work after this. --- src/sdl/mixer_sound.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index e835a55c..15f1595c 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -178,7 +178,7 @@ static Mix_Chunk *ds2chunk(void *stream) return NULL; // would and/or did wrap, can't store. break; } - sound = malloc(newsamples<<2); // samples * frequency shift * bytes per sample * channels + sound = Z_Malloc(newsamples<<2, PU_SOUND, 0); // samples * frequency shift * bytes per sample * channels s = (SINT8 *)stream; d = (INT16 *)sound; @@ -401,7 +401,22 @@ void *I_GetSfx(sfxinfo_t *sfx) void I_FreeSfx(sfxinfo_t *sfx) { if (sfx->data) + { + Mix_Chunk *chunk = (Mix_Chunk*)sfx->data; + UINT8 *abufdata = NULL; + if (chunk->allocated == 0) + { + // We allocated the data in this chunk, so get the abuf from mixer, then let it free the chunk, THEN we free the data + // I believe this should ensure the sound is not playing when we free it + abufdata = chunk->abuf; + } Mix_FreeChunk(sfx->data); + if (abufdata) + { + // I'm going to assume we used Z_Malloc to allocate this data. + Z_Free(abufdata); + } + } sfx->data = NULL; sfx->lumpnum = LUMPERROR; } From d072dd27254596c7c8925b4f6d08c151e57535f2 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 7 Oct 2018 00:22:23 +0100 Subject: [PATCH 097/138] I think that should be NULL, not 0 actually. --- src/sdl/mixer_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 15f1595c..9fef1646 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -178,7 +178,7 @@ static Mix_Chunk *ds2chunk(void *stream) return NULL; // would and/or did wrap, can't store. break; } - sound = Z_Malloc(newsamples<<2, PU_SOUND, 0); // samples * frequency shift * bytes per sample * channels + sound = Z_Malloc(newsamples<<2, PU_SOUND, NULL); // samples * frequency shift * bytes per sample * channels s = (SINT8 *)stream; d = (INT16 *)sound; From ff7b402dc572396fba11c23d48bbd6180a08663d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 19:25:59 -0400 Subject: [PATCH 098/138] OGL support --- src/hardware/hw_main.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 6a664d39..774ff8c1 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2690,6 +2690,8 @@ static void HWR_AddLine(seg_t * line) // SoM: Backsector needs to be run through R_FakeFlat static sector_t tempsec; + sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; + if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -2811,11 +2813,14 @@ static void HWR_AddLine(seg_t * line) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) #undef SLOPEPARAMS - // Closed door. - if ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) + if (thissec != gr_backsector && thissec != gr_frontsector) { - goto clipsolid; + // Closed door. + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } } // Window. @@ -2828,10 +2833,13 @@ static void HWR_AddLine(seg_t * line) else #endif { - // Closed door. - if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || - gr_backsector->floorheight >= gr_frontsector->ceilingheight) - goto clipsolid; + if (thissec != gr_backsector && thissec != gr_frontsector) + { + // Closed door. + if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || + gr_backsector->floorheight >= gr_frontsector->ceilingheight) + goto clipsolid; + } // Window. if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight || From 8ba3f8855355c19fe499c383369e28bac3cbf177 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 23:37:27 -0400 Subject: [PATCH 099/138] Don't need thissec --- src/hardware/hw_main.c | 6 ++---- src/r_bsp.c | 5 ++--- src/r_segs.c | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 774ff8c1..2e4c733b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2690,8 +2690,6 @@ static void HWR_AddLine(seg_t * line) // SoM: Backsector needs to be run through R_FakeFlat static sector_t tempsec; - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; - if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -2813,7 +2811,7 @@ static void HWR_AddLine(seg_t * line) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) #undef SLOPEPARAMS - if (thissec != gr_backsector && thissec != gr_frontsector) + if (viewsector != gr_backsector && viewsector != gr_frontsector) { // Closed door. if ((backc1 <= frontf1 && backc2 <= frontf2) @@ -2833,7 +2831,7 @@ static void HWR_AddLine(seg_t * line) else #endif { - if (thissec != gr_backsector && thissec != gr_frontsector) + if (viewsector != gr_backsector && viewsector != gr_frontsector) { // Closed door. if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || diff --git a/src/r_bsp.c b/src/r_bsp.c index da9ad665..0c48ae8b 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -374,7 +374,6 @@ static void R_AddLine(seg_t *line) INT32 x1, x2; angle_t angle1, angle2, span, tspan; static sector_t tempsec; // ceiling/water hack - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -479,7 +478,7 @@ static void R_AddLine(seg_t *line) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) #undef SLOPEPARAMS - if (thissec != backsector && thissec != frontsector) + if (viewsector != backsector && viewsector != frontsector) { if ((backc1 <= frontf1 && backc2 <= frontf2) || (backf1 >= frontc1 && backf2 >= frontc2)) @@ -507,7 +506,7 @@ static void R_AddLine(seg_t *line) else #endif { - if (thissec != backsector && thissec != frontsector) + if (viewsector != backsector && viewsector != frontsector) { if (backsector->ceilingheight <= frontsector->floorheight || backsector->floorheight >= frontsector->ceilingheight) diff --git a/src/r_segs.c b/src/r_segs.c index 84bb119f..231a84f7 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1365,7 +1365,7 @@ static void R_RenderSegLoop (void) if (bottom >= floorclip[rw_x]) bottom = floorclip[rw_x]-1; - if (top <= bottom) + if (top <= bottom && ceilingplane) { ceilingplane->top[rw_x] = (INT16)top; ceilingplane->bottom[rw_x] = (INT16)bottom; @@ -2020,8 +2020,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) { // two sided line - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; - #ifdef ESLOPE if (backsector->c_slope) { worldhigh = P_GetZAt(backsector->c_slope, segleft.x, segleft.y) - viewz; @@ -2115,7 +2113,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) // ds_p->sprtopclip = screenheightarray; } - if (thissec != frontsector && thissec != backsector) + if (viewsector != frontsector && viewsector != backsector) { #ifdef ESLOPE if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) From 02597e0bf923c76cb1aed2bd15c285371bdd71ff Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 7 Oct 2018 09:26:18 +0100 Subject: [PATCH 100/138] Fix compiler warnings. --- src/sdl/mixer_sound.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 9fef1646..ed15fcda 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -246,6 +246,7 @@ void *I_GetSfx(sfxinfo_t *sfx) { void *lump; Mix_Chunk *chunk; + SDL_RWops *rw; #ifdef HAVE_LIBGME Music_Emu *emu; gme_info_t *info; @@ -387,10 +388,10 @@ void *I_GetSfx(sfxinfo_t *sfx) #endif // Try to load it as a WAVE or OGG using Mixer. - SDL_RWops *rw = SDL_RWFromMem(lump, sfx->length); + rw = SDL_RWFromMem(lump, sfx->length); if (rw != NULL) { - Mix_Chunk *chunk = Mix_LoadWAV_RW(rw, 1); + chunk = Mix_LoadWAV_RW(rw, 1); SDL_RWclose(rw); return chunk; } @@ -547,6 +548,7 @@ boolean I_StartDigSong(const char *musicname, boolean looping) char *data; size_t len; lumpnum_t lumpnum = W_CheckNumForName(va("O_%s",musicname)); + SDL_RWops *rw; I_Assert(!music); #ifdef HAVE_LIBGME @@ -658,7 +660,7 @@ boolean I_StartDigSong(const char *musicname, boolean looping) } #endif - SDL_RWops *rw = SDL_RWFromMem(data, len); + rw = SDL_RWFromMem(data, len); if (rw != NULL) { music = Mix_LoadMUS_RW(rw, SDL_FALSE); From fb6c3298702e76ee8a167264cc7dc0e86936f862 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 7 Oct 2018 10:37:45 +0100 Subject: [PATCH 101/138] Fix the crashing bug hopefully A value of 1 in freesrc for Mix_LoadWAV_RW and Mix_LoadMus_RW calls SDL_RWclose on the RWops anyway. For Mix_LoadWAV_RW the RWops is freed right after the data is loaded (because it makes a copy of the data in memory) For Mix_LoadMUS_RW the RWops is freed when Mix_FreeMusic is called (because the data is not a copy) So setting 1 on freesrc doesn't actually free the RWops immediately on Mix_LoadMus_RW *unless* it failed to load any music. --- src/sdl/mixer_sound.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index ed15fcda..53a767df 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -392,7 +392,6 @@ void *I_GetSfx(sfxinfo_t *sfx) if (rw != NULL) { chunk = Mix_LoadWAV_RW(rw, 1); - SDL_RWclose(rw); return chunk; } @@ -663,8 +662,7 @@ boolean I_StartDigSong(const char *musicname, boolean looping) rw = SDL_RWFromMem(data, len); if (rw != NULL) { - music = Mix_LoadMUS_RW(rw, SDL_FALSE); - SDL_RWclose(rw); + music = Mix_LoadMUS_RW(rw, 1); } if (!music) { @@ -831,8 +829,7 @@ INT32 I_RegisterSong(void *data, size_t len) SDL_RWops *rw = SDL_RWFromMem(data, len); if (rw != NULL) { - music = Mix_LoadMUS_RW(rw, SDL_FALSE); - SDL_RWclose(rw); + music = Mix_LoadMUS_RW(rw, 1); } if (!music) { From 2f061a531a8bca5ba5558d38d61e44008d18dbb7 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 7 Oct 2018 11:40:06 +0100 Subject: [PATCH 102/138] Karma Eggman. Does what it says on the egg. Tried very hard not to merge conflict with `frameperfectegg`. Also includes some adjustments to: * Horizontal offset of Eggman countdown in splitscreen again. It's not perfectly centered either way, but on second thought I like this better. * Sound of Lat`'s Mine/SPB explosions - now uses same sound as Karma bombing, instead of that shitty paraloop. * Correctly wipe k_eggmanblame when it is appropriate to do so. --- src/dehacked.c | 1 + src/g_game.c | 1 + src/info.c | 3 ++- src/info.h | 1 + src/k_kart.c | 34 +++++++++++++++++++++++-------- src/p_inter.c | 55 ++++++++++++++++++++++++++++++++++++++------------ src/p_mobj.c | 11 ++++++---- 7 files changed, 80 insertions(+), 26 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 2efdb6bc..e0ec5b6c 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6708,6 +6708,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PLAYERBOMB", // Player bomb overlay "S_PLAYERITEM", // Player item overlay + "S_PLAYERFAKE", // Player fake overlay "S_KARMAWHEEL", // Karma player wheels diff --git a/src/g_game.c b/src/g_game.c index e501fa56..cfffd689 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2519,6 +2519,7 @@ void G_PlayerReborn(INT32 player) p->kartstuff[k_comebackpoints] = comebackpoints; p->kartstuff[k_comebacktimer] = comebacktime; p->kartstuff[k_wanted] = wanted; + p->kartstuff[k_eggmanblame] = -1; // Don't do anything immediately p->pflags |= PF_USEDOWN; diff --git a/src/info.c b/src/info.c index c0fb24fb..40327462 100644 --- a/src/info.c +++ b/src/info.c @@ -3006,6 +3006,7 @@ state_t states[NUMSTATES] = {SPR_PBOM, FF_ANIMATE, -1, {NULL}, 3, 3, S_NULL}, // S_PLAYERBOMB {SPR_RNDM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERITEM + {SPR_FITM, FF_ANIMATE, -1, {NULL}, 23, 3, S_NULL}, // S_PLAYERFAKE {SPR_PBOM, 4, -1, {NULL}, 0, 0, S_NULL}, // S_KARMAWHEEL @@ -17132,7 +17133,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = sfx_kc2e, // seesound 8, // reactiontime sfx_s3k4e, // attacksound - S_NULL, // painstate + S_PLAYERFAKE, // painstate 0, // painchance sfx_None, // painsound S_NULL, // meleestate diff --git a/src/info.h b/src/info.h index d0f4be59..9241363e 100644 --- a/src/info.h +++ b/src/info.h @@ -3554,6 +3554,7 @@ typedef enum state S_PLAYERBOMB, S_PLAYERITEM, + S_PLAYERFAKE, S_KARMAWHEEL, diff --git a/src/k_kart.c b/src/k_kart.c index b032f0fe..d0235223 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4398,8 +4398,11 @@ void K_StripOther(player_t *player) player->kartstuff[k_invincibilitytimer] = 0; player->kartstuff[k_growshrinktimer] = 0; - player->kartstuff[k_eggmanexplode] = 0; - player->kartstuff[k_eggmanblame] = 0; + if (player->kartstuff[k_eggmanexplode]) + { + player->kartstuff[k_eggmanexplode] = 0; + player->kartstuff[k_eggmanblame] = -1; + } } // @@ -4444,14 +4447,29 @@ void K_MoveKartPlayer(player_t *player, boolean onground) { mobj_t *newitem; + if (player->kartstuff[k_comebackmode] == 1) + { + newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RANDOMITEM); + newitem->threshold = 69; // selected "randomly". + } + else + { + newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_FAKEITEM); + if (player->kartstuff[k_eggmanblame] >= 0 + && player->kartstuff[k_eggmanblame] < MAXPLAYERS + && playeringame[player->kartstuff[k_eggmanblame]] + && !players[player->kartstuff[k_eggmanblame]].spectator + && players[player->kartstuff[k_eggmanblame]].mo) + P_SetTarget(&newitem->target, players[player->kartstuff[k_eggmanblame]].mo); + player->kartstuff[k_eggmanblame] = -1; + } + + newitem->flags2 = (player->mo->flags2 & MF2_OBJECTFLIP); + newitem->fuse = 15*TICRATE; // selected randomly. + player->kartstuff[k_comebackmode] = 0; player->kartstuff[k_comebacktimer] = comebacktime; S_StartSound(player->mo, sfx_s254); - - newitem = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_RANDOMITEM); - newitem->flags2 = (player->mo->flags2 & MF2_OBJECTFLIP); - newitem->fuse = 15*TICRATE; // selected randomly. - newitem->threshold = 69; // selected "randomly". } // Eggman Monitor exploding else if (player->kartstuff[k_eggmanexplode]) @@ -5937,7 +5955,7 @@ static void K_drawKartItem(void) // Quick Eggman numbers if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/) - V_DrawScaledPatch(ITEM_X+17-offset, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); + V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); } void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing) diff --git a/src/p_inter.c b/src/p_inter.c index bd02da42..6ee1dfdf 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -456,10 +456,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) { - if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer]) + if (player->kartstuff[k_comebackmode] || player->kartstuff[k_comebacktimer]) return; - if (player->kartstuff[k_comebackmode] == 0) - player->kartstuff[k_comebackmode] = 1; + player->kartstuff[k_comebackmode] = 1; } special->momx = special->momy = special->momz = 0; @@ -479,21 +478,22 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) { - /*if (player->kartstuff[k_comebackmode] != 0 || player->kartstuff[k_comebacktimer]) + if (player->kartstuff[k_comebackmode] || player->kartstuff[k_comebacktimer]) return; - if (player->kartstuff[k_comebackmode] == 0) - player->kartstuff[k_comebackmode] = 2;*/ - return; + player->kartstuff[k_comebackmode] = 2; + } + else + { + K_DropItems(player); //K_StripItems(player); + K_StripOther(player); + player->kartstuff[k_itemroulette] = 1; + player->kartstuff[k_roulettetype] = 2; } { mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE); S_StartSound(poof, special->info->deathsound); - K_DropItems(player); //K_StripItems(player); - K_StripOther(player); - player->kartstuff[k_itemroulette] = 1; - player->kartstuff[k_roulettetype] = 2; if (special->target && special->target->player && (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)) player->kartstuff[k_eggmanblame] = special->target->player-players; @@ -503,7 +503,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_RemoveMobj(special); return; } - break; case MT_KARMAHITBOX: if (!special->target->player) return; @@ -519,7 +518,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) || special->target->player->kartstuff[k_squishedtimer]) return; - if (special->target->player->kartstuff[k_comebackmode] == 0) + if (!special->target->player->kartstuff[k_comebackmode]) { if (player->kartstuff[k_growshrinktimer] || player->kartstuff[k_squishedtimer] || player->kartstuff[k_hyudorotimer] || player->kartstuff[k_spinouttimer] @@ -580,6 +579,36 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) player->kartstuff[k_itemroulette] = 1; player->kartstuff[k_roulettetype] = 1; } + else if (special->target->player->kartstuff[k_comebackmode] == 2 && P_CanPickupItem(player, 2)) + { + mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE); + S_StartSound(poof, special->info->seesound); + + special->target->player->kartstuff[k_comebackmode] = 0; + special->target->player->kartstuff[k_comebackpoints]++; + + if (netgame && cv_hazardlog.value) + CONS_Printf(M_GetText("%s gave an \"item\" to %s.\n"), player_names[special->target->player-players], player_names[player-players]); + if (special->target->player->kartstuff[k_comebackpoints] >= 3) + K_StealBumper(special->target->player, player, true); + special->target->player->kartstuff[k_comebacktimer] = comebacktime; + + K_DropItems(player); //K_StripItems(player); + K_StripOther(player); + + player->kartstuff[k_itemroulette] = 1; + player->kartstuff[k_roulettetype] = 2; + + if (special->target->player->kartstuff[k_eggmanblame] >= 0 + && special->target->player->kartstuff[k_eggmanblame] < MAXPLAYERS + && playeringame[special->target->player->kartstuff[k_eggmanblame]] + && !players[special->target->player->kartstuff[k_eggmanblame]].spectator) + player->kartstuff[k_eggmanblame] = special->target->player->kartstuff[k_eggmanblame]; + else + player->kartstuff[k_eggmanblame] = -1; + + special->target->player->kartstuff[k_eggmanblame] = -1; + } return; // ***************************************** // diff --git a/src/p_mobj.c b/src/p_mobj.c index d400f013..ac5794ef 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8239,7 +8239,7 @@ void P_MobjThinker(mobj_t *mobj) return; case MT_MINEEXPLOSIONSOUND: if (mobj->health == 100) - S_StartSound(mobj, sfx_prloop); + S_StartSound(mobj, sfx_s3k4e); mobj->health--; break; case MT_BOOSTFLAME: @@ -8363,7 +8363,7 @@ void P_MobjThinker(mobj_t *mobj) mobj->destscale = mobj->target->destscale; P_SetScale(mobj, mobj->target->scale); mobj->color = mobj->target->color; - mobj->colorized = (mobj->target->player->kartstuff[k_comebackmode] == 1); + mobj->colorized = (mobj->target->player->kartstuff[k_comebackmode]); if (mobj->target->player->kartstuff[k_comebacktimer] > 0) { @@ -8377,12 +8377,15 @@ void P_MobjThinker(mobj_t *mobj) } else { - if (mobj->target->player->kartstuff[k_comebackmode] == 0 + if (!mobj->target->player->kartstuff[k_comebackmode] && mobj->state != &states[mobj->info->spawnstate]) P_SetMobjState(mobj, mobj->info->spawnstate); else if (mobj->target->player->kartstuff[k_comebackmode] == 1 && mobj->state != &states[mobj->info->seestate]) P_SetMobjState(mobj, mobj->info->seestate); + else if (mobj->target->player->kartstuff[k_comebackmode] == 2 + && mobj->state != &states[mobj->info->painstate]) + P_SetMobjState(mobj, mobj->info->painstate); if (mobj->target->player->powers[pw_flashing] && (leveltime & 1)) mobj->flags2 |= MF2_DONTDRAW; @@ -8749,7 +8752,7 @@ for (i = ((mobj->flags2 & MF2_STRONGBOX) ? strongboxamt : weakboxamt); i; --i) s if (P_MobjWasRemoved(mobj)) return; } - else if (mobj->type == MT_RANDOMITEM && mobj->threshold == 69 && mobj->fuse <= TICRATE) + else if (((mobj->type == MT_RANDOMITEM && mobj->threshold == 69) || mobj->type == MT_FAKEITEM) && mobj->fuse <= TICRATE) mobj->flags2 ^= MF2_DONTDRAW; } From b1e02467bfc009d1b08d83a12181fde87869bae0 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 7 Oct 2018 15:00:58 +0100 Subject: [PATCH 103/138] Weather is already run client-side. What if we ran it render-side, for major performance gains? This commit will answer all your questions - and more! --- src/hardware/hw_main.c | 22 ++++++++++++++++++---- src/p_mobj.c | 37 ++++++++++++++++++++----------------- src/p_mobj.h | 4 ++++ src/p_saveg.c | 6 ++---- src/p_spec.c | 34 ++++++++++------------------------ src/p_tick.c | 24 ++++++++++++------------ src/r_things.c | 23 +++++++++++++++++++---- 7 files changed, 85 insertions(+), 65 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index d7c73415..871a6a49 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5140,8 +5140,10 @@ static void HWR_AddSprites(sector_t *sec) approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y); - if (approx_dist <= limit_dist) - HWR_ProjectSprite(thing); + if (approx_dist > limit_dist) + continue; + + HWR_ProjectSprite(thing); } } else @@ -5163,8 +5165,10 @@ static void HWR_AddSprites(sector_t *sec) approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y); - if (approx_dist <= limit_dist) - HWR_ProjectPrecipitationSprite(precipthing); + if (approx_dist > limit_dist) + continue; + + HWR_ProjectPrecipitationSprite(precipthing); } } else @@ -5449,6 +5453,16 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing) x1 = tr_x + x1 * rightcos; x2 = tr_x - x2 * rightcos; + // okay, we can't return now... this is a hack, but weather isn't networked, so it should be ok + if (!(thing->precipflags & PCF_THUNK)) + { + if (thing->precipflags & PCF_RAIN) + P_RainThinker(thing); + else + P_SnowThinker(thing); + thing->precipflags |= PCF_THUNK; + } + // // store information in a vissprite // diff --git a/src/p_mobj.c b/src/p_mobj.c index 5f85474c..bb9483d1 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3840,7 +3840,8 @@ void P_RecalcPrecipInSector(sector_t *sector) // void P_NullPrecipThinker(precipmobj_t *mobj) { - (void)mobj; + //(void)mobj; + mobj->precipflags &= ~PCF_THUNK; } void P_SnowThinker(precipmobj_t *mobj) @@ -3860,25 +3861,26 @@ void P_RainThinker(precipmobj_t *mobj) { // cycle through states, // calling action functions at transitions - if (mobj->tics > 0 && --mobj->tics == 0) - { - // you can cycle through multiple states in a tic - if (!P_SetPrecipMobjState(mobj, mobj->state->nextstate)) - return; // freed itself - } + if (mobj->tics <= 0) + return; + + if (--mobj->tics) + return; + + if (!P_SetPrecipMobjState(mobj, mobj->state->nextstate)) + return; + + if (mobj->state != &states[S_RAINRETURN]) + return; + + mobj->z = mobj->ceilingz; + P_SetPrecipMobjState(mobj, S_RAIN1); - if (mobj->state == &states[S_RAINRETURN]) - { - mobj->z = mobj->ceilingz; - P_SetPrecipMobjState(mobj, S_RAIN1); - } return; } // adjust height - mobj->z += mobj->momz; - - if (mobj->z <= mobj->floorz) + if ((mobj->z += mobj->momz) <= mobj->floorz) { // no splashes on sky or bottomless pits if (mobj->precipflags & PCF_PIT) @@ -7926,14 +7928,15 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype static inline precipmobj_t *P_SpawnRainMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) { precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type); - mo->thinker.function.acp1 = (actionf_p1)P_RainThinker; + mo->precipflags |= PCF_RAIN; + //mo->thinker.function.acp1 = (actionf_p1)P_RainThinker; return mo; } static inline precipmobj_t *P_SpawnSnowMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) { precipmobj_t *mo = P_SpawnPrecipMobj(x,y,z,type); - mo->thinker.function.acp1 = (actionf_p1)P_SnowThinker; + //mo->thinker.function.acp1 = (actionf_p1)P_SnowThinker; return mo; } diff --git a/src/p_mobj.h b/src/p_mobj.h index 79cffae8..620028d8 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -252,6 +252,10 @@ typedef enum { PCF_FOF = 4, // Above MOVING FOF (this means we need to keep floorz up to date...) PCF_MOVINGFOF = 8, + // Is rain. + PCF_RAIN = 16, + // Ran the thinker this tic. + PCF_THUNK = 32, } precipflag_t; // Map Object definition. typedef struct mobj_s diff --git a/src/p_saveg.c b/src/p_saveg.c index d1ec8e5a..17d28302 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1661,8 +1661,7 @@ static void P_NetArchiveThinkers(void) for (th = thinkercap.next; th != &thinkercap; th = th->next) { if (!(th->function.acp1 == (actionf_p1)P_RemoveThinkerDelayed - || th->function.acp1 == (actionf_p1)P_RainThinker - || th->function.acp1 == (actionf_p1)P_SnowThinker)) + || th->function.acp1 == (actionf_p1)P_NullPrecipThinker)) numsaved++; if (th->function.acp1 == (actionf_p1)P_MobjThinker) @@ -1671,8 +1670,7 @@ static void P_NetArchiveThinkers(void) continue; } #ifdef PARANOIA - else if (th->function.acp1 == (actionf_p1)P_RainThinker - || th->function.acp1 == (actionf_p1)P_SnowThinker); + else if (th->function.acp1 == (actionf_p1)P_NullPrecipThinker); #endif else if (th->function.acp1 == (actionf_p1)T_MoveCeiling) { diff --git a/src/p_spec.c b/src/p_spec.c index c62c3b20..ff6691a9 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2039,8 +2039,7 @@ void P_SwitchWeather(INT32 weathernum) for (think = thinkercap.next; think != &thinkercap; think = think->next) { - if ((think->function.acp1 != (actionf_p1)P_SnowThinker) - && (think->function.acp1 != (actionf_p1)P_RainThinker)) + if (think->function.acp1 != (actionf_p1)P_NullPrecipThinker) continue; // not a precipmobj thinker precipmobj = (precipmobj_t *)think; @@ -2056,14 +2055,12 @@ void P_SwitchWeather(INT32 weathernum) for (think = thinkercap.next; think != &thinkercap; think = think->next) { + if (think->function.acp1 != (actionf_p1)P_NullPrecipThinker) + continue; // not a precipmobj thinker + precipmobj = (precipmobj_t *)think; + if (swap == PRECIP_RAIN) // Snow To Rain { - if (!(think->function.acp1 == (actionf_p1)P_SnowThinker - || think->function.acp1 == (actionf_p1)P_NullPrecipThinker)) - continue; // not a precipmobj thinker - - precipmobj = (precipmobj_t *)think; - precipmobj->flags = mobjinfo[MT_RAIN].flags; st = &states[mobjinfo[MT_RAIN].spawnstate]; precipmobj->state = st; @@ -2074,18 +2071,13 @@ void P_SwitchWeather(INT32 weathernum) precipmobj->precipflags &= ~PCF_INVISIBLE; - think->function.acp1 = (actionf_p1)P_RainThinker; + precipmobj->precipflags |= PCF_RAIN; + //think->function.acp1 = (actionf_p1)P_RainThinker; } else if (swap == PRECIP_SNOW) // Rain To Snow { INT32 z; - if (!(think->function.acp1 == (actionf_p1)P_RainThinker - || think->function.acp1 == (actionf_p1)P_NullPrecipThinker)) - continue; // not a precipmobj thinker - - precipmobj = (precipmobj_t *)think; - precipmobj->flags = mobjinfo[MT_SNOWFLAKE].flags; z = M_RandomByte(); @@ -2103,19 +2095,13 @@ void P_SwitchWeather(INT32 weathernum) precipmobj->frame = st->frame; precipmobj->momz = mobjinfo[MT_SNOWFLAKE].speed; - precipmobj->precipflags &= ~PCF_INVISIBLE; + precipmobj->precipflags &= ~(PCF_INVISIBLE|PCF_RAIN); - think->function.acp1 = (actionf_p1)P_SnowThinker; + //think->function.acp1 = (actionf_p1)P_SnowThinker; } else if (swap == PRECIP_BLANK || swap == PRECIP_STORM_NORAIN) // Remove precip, but keep it around for reuse. { - if (!(think->function.acp1 == (actionf_p1)P_RainThinker - || think->function.acp1 == (actionf_p1)P_SnowThinker)) - continue; - - precipmobj = (precipmobj_t *)think; - - think->function.acp1 = (actionf_p1)P_NullPrecipThinker; + //think->function.acp1 = (actionf_p1)P_NullPrecipThinker; precipmobj->precipflags |= PCF_INVISIBLE; } diff --git a/src/p_tick.c b/src/p_tick.c index f4bc5932..5ba74707 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -56,12 +56,12 @@ void Command_Numthinkers_f(void) CONS_Printf(M_GetText("numthinkers <#>: Count number of thinkers\n")); CONS_Printf( "\t1: P_MobjThinker\n" - "\t2: P_RainThinker\n" - "\t3: P_SnowThinker\n" - "\t4: P_NullPrecipThinker\n" - "\t5: T_Friction\n" - "\t6: T_Pusher\n" - "\t7: P_RemoveThinkerDelayed\n"); + /*"\t2: P_RainThinker\n" + "\t3: P_SnowThinker\n"*/ + "\t2: P_NullPrecipThinker\n" + "\t3: T_Friction\n" + "\t4: T_Pusher\n" + "\t5: P_RemoveThinkerDelayed\n"); return; } @@ -73,27 +73,27 @@ void Command_Numthinkers_f(void) action = (actionf_p1)P_MobjThinker; CONS_Printf(M_GetText("Number of %s: "), "P_MobjThinker"); break; - case 2: + /*case 2: action = (actionf_p1)P_RainThinker; CONS_Printf(M_GetText("Number of %s: "), "P_RainThinker"); break; case 3: action = (actionf_p1)P_SnowThinker; CONS_Printf(M_GetText("Number of %s: "), "P_SnowThinker"); - break; - case 4: + break;*/ + case 2: action = (actionf_p1)P_NullPrecipThinker; CONS_Printf(M_GetText("Number of %s: "), "P_NullPrecipThinker"); break; - case 5: + case 3: action = (actionf_p1)T_Friction; CONS_Printf(M_GetText("Number of %s: "), "T_Friction"); break; - case 6: + case 4: action = (actionf_p1)T_Pusher; CONS_Printf(M_GetText("Number of %s: "), "T_Pusher"); break; - case 7: + case 5: action = (actionf_p1)P_RemoveThinkerDelayed; CONS_Printf(M_GetText("Number of %s: "), "P_RemoveThinkerDelayed"); break; diff --git a/src/r_things.c b/src/r_things.c index 0b176416..910a52b3 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -1451,6 +1451,17 @@ static void R_ProjectPrecipitationSprite(precipmobj_t *thing) return; } + // okay, we can't return now except for vertical clipping... this is a hack, but weather isn't networked, so it should be ok + if (!(thing->precipflags & PCF_THUNK)) + { + if (thing->precipflags & PCF_RAIN) + P_RainThinker(thing); + else + P_SnowThinker(thing); + thing->precipflags |= PCF_THUNK; + } + + //SoM: 3/17/2000: Disregard sprites that are out of view.. gzt = thing->z + spritecachedinfo[lump].topoffset; gz = gzt - spritecachedinfo[lump].height; @@ -1569,8 +1580,10 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel) approx_dist = P_AproxDistance(viewx-thing->x, viewy-thing->y); - if (approx_dist <= limit_dist) - R_ProjectSprite(thing); + if (approx_dist > limit_dist) + continue; + + R_ProjectSprite(thing); } } else @@ -1591,8 +1604,10 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel) approx_dist = P_AproxDistance(viewx-precipthing->x, viewy-precipthing->y); - if (approx_dist <= limit_dist) - R_ProjectPrecipitationSprite(precipthing); + if (approx_dist > limit_dist) + continue; + + R_ProjectPrecipitationSprite(precipthing); } } else From d3e489e9863e75100dbbd5404badab92fcec69a5 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 7 Oct 2018 15:35:54 +0100 Subject: [PATCH 104/138] Fix the mixed declaration and code warnings that only don't appear currently because of a tiny Makefile issue. --- src/hu_stuff.c | 99 ++++++++++++++++++++++++++--------------------- src/k_kart.c | 17 ++++---- src/lua_baselib.c | 13 ++++--- src/p_enemy.c | 6 +-- 4 files changed, 74 insertions(+), 61 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index e503e2a6..7080ab6a 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -465,6 +465,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) { // what we're gonna do now is check if the node exists // with that logic, characters 4 and 5 are our numbers: + const char *newmsg; int spc = 1; // used if nodenum[1] is a space. char *nodenum = (char*) malloc(3); strncpy(nodenum, msg+3, 5); @@ -503,7 +504,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) return; } buf[0] = target; - const char *newmsg = msg+5+spc; + newmsg = msg+5+spc; memcpy(msg, newmsg, 252); } @@ -567,10 +568,10 @@ static void Command_Sayteam_f(void) CONS_Alert(CONS_NOTICE, M_GetText("Dedicated servers can't send team messages. Use \"say\".\n")); return; } - + if (G_GametypeHasTeams()) // revert to normal say if we don't have teams in this gametype. DoSayCommand(-1, 1, 0); - else + else DoSayCommand(0, 1, 0); } @@ -607,6 +608,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) char *msg; boolean action = false; char *ptr; + int spam_eatmsg = 0; CONS_Debug(DBG_NETPLAY,"Received SAY cmd from Player %d (%s)\n", playernum+1, player_names[playernum]); @@ -653,8 +655,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) } } - int spam_eatmsg = 0; - // before we do anything, let's verify the guy isn't spamming, get this easier on us. //if (stop_spamming_you_cunt[playernum] != 0 && cv_chatspamprotection.value && !(flags & HU_CSAY)) @@ -721,7 +721,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) // player is a spectator? if (players[playernum].spectator) - { + { cstart = "\x86"; // grey name textcolor = "\x86"; } @@ -731,12 +731,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) { cstart = "\x85"; textcolor = "\x85"; - } + } else // blue { cstart = "\x84"; textcolor = "\x84"; - } + } } else { @@ -775,7 +775,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x89"; // V_LAVENDERMAP } prefix = cstart; - + // Give admins and remote admins their symbols. if (playernum == serverplayer) tempchar = (char *)Z_Calloc(strlen(cstart) + strlen(adminchar) + 1, PU_STATIC, NULL); @@ -883,7 +883,7 @@ static inline boolean HU_keyInChatString(char *s, char ch) { if (s[m]) s[m+1] = (s[m]); - + if (m < 1) break; // fix the chat going ham if your replace the first character. (For whatever reason this didn't happen in vanilla????) } @@ -896,9 +896,10 @@ static inline boolean HU_keyInChatString(char *s, char ch) } else if (ch == KEY_BACKSPACE) { + size_t i; if (c_input <= 0) return false; - size_t i = c_input; + i = c_input; if (!s[i-1]) return false; @@ -951,12 +952,14 @@ static void HU_queueChatChar(INT32 c) char buf[2+256]; size_t ci = 2; char *msg = &buf[2]; + size_t i; + INT32 target = 0; do { c = w_chat[-2+ci++]; if (!c || (c >= ' ' && !(c & 0x80))) // copy printable characters and terminating '\0' only. buf[ci-1]=c; } while (c); - size_t i = 0; + i = 0; for (;(i 4 && strnicmp(msg, "/pm", 3) == 0) // used /pm { + int spc; + char *nodenum; + const char *newmsg; // what we're gonna do now is check if the node exists // with that logic, characters 4 and 5 are our numbers: @@ -983,8 +987,8 @@ static void HU_queueChatChar(INT32 c) return; } - int spc = 1; // used if nodenum[1] is a space. - char *nodenum = (char*) malloc(3); + spc = 1; // used if nodenum[1] is a space. + nodenum = (char*) malloc(3); strncpy(nodenum, msg+3, 5); // check for undesirable characters in our "number" if (((nodenum[0] < '0') || (nodenum[0] > '9')) || ((nodenum[1] < '0') || (nodenum[1] > '9'))) @@ -1021,7 +1025,7 @@ static void HU_queueChatChar(INT32 c) return; } // we need to get rid of the /pm - const char *newmsg = msg+5+spc; + newmsg = msg+5+spc; memcpy(msg, newmsg, 255); } if (ci > 3) // don't send target+flags+empty message. @@ -1056,12 +1060,12 @@ static boolean justscrolledup; boolean HU_Responder(event_t *ev) { INT32 c=0; - + if (ev->type != ev_keydown) return false; // only KeyDown events now... - + if (!chat_on) { // enter chat mode @@ -1086,7 +1090,7 @@ boolean HU_Responder(event_t *ev) } else // if chat_on { - + // Ignore modifier keys // Note that we do this here so users can still set // their chat keys to one of these, if they so desire. @@ -1117,14 +1121,16 @@ boolean HU_Responder(event_t *ev) if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE) { const char *paste = I_ClipboardPaste(); + size_t chatlen; + size_t pastelen; // create a dummy string real quickly if (paste == NULL) return true; - size_t chatlen = strlen(w_chat); - size_t pastelen = strlen(paste); + chatlen = strlen(w_chat); + pastelen = strlen(paste); if (chatlen+pastelen > HU_MAXMSGLEN) return true; // we can't paste this!! @@ -1258,9 +1264,6 @@ INT16 chatx = 13, chaty = 169; // let's use this as our coordinates, shh static void HU_drawMiniChat(void) { - if (!chat_nummsg_min) - return; // needless to say it's useless to do anything if we don't have anything to draw. - INT32 x = chatx+2; INT32 charwidth = 4, charheight = 6; INT32 dx = 0, dy = 0; @@ -1269,6 +1272,10 @@ static void HU_drawMiniChat(void) INT32 msglines = 0; // process all messages once without rendering anything or doing anything fancy so that we know how many lines each message has... + INT32 y; + + if (!chat_nummsg_min) + return; // needless to say it's useless to do anything if we don't have anything to draw. for (; i>0; i--) { @@ -1284,10 +1291,10 @@ static void HU_drawMiniChat(void) { ++j; if (!prev_linereturn) - { + { linescount += 1; dx = 0; - } + } prev_linereturn = true; continue; } @@ -1316,7 +1323,7 @@ static void HU_drawMiniChat(void) msglines += linescount+1; } - INT32 y = chaty - charheight*(msglines+1) - (cv_kartspeedometer.value ? 16 : 0); + y = chaty - charheight*(msglines+1) - (cv_kartspeedometer.value ? 16 : 0); dx = 0; dy = 0; i = 0; @@ -1339,10 +1346,10 @@ static void HU_drawMiniChat(void) { ++j; if (!prev_linereturn) - { + { dy += charheight; dx = 0; - } + } prev_linereturn = true; continue; } @@ -1509,36 +1516,36 @@ static void HU_DrawChat(void) t = 0x400; // Blue #endif } - + if (CHAT_MUTE) { talk = mute; typelines = 1; cflag = V_GRAYMAP; // set text in gray if chat is muted. - } - + } + V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); - + while (talk[i]) { if (talk[i] < HU_FONTSTART) ++i; else - { + { V_DrawChatCharacter(chatx + c + 2, y, talk[i] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|cflag, !cv_allcaps.value, V_GetStringColormap(talk[i]|cflag)); i++; - } + } c += charwidth; } - + // if chat is muted, just draw the log and get it over with: if (CHAT_MUTE) - { + { HU_drawChatLog(0); return; - } - + } + i = 0; typelines = 1; @@ -1581,24 +1588,25 @@ static void HU_DrawChat(void) // handle /pm list. if (strnicmp(w_chat, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai { - i = 0; INT32 count = 0; INT32 p_dispy = chaty - charheight -1; + i = 0; for(i=0; (i '9'))) || ((w_chat[4] != 0) && (((w_chat[4] < '0') || (w_chat[4] > '9'))))) && (w_chat[4] != ' ')) break; - char *nodenum = (char*) malloc(3); + nodenum = (char*) malloc(3); strncpy(nodenum, w_chat+3, 4); - UINT32 n = atoi((const char*) nodenum); // turn that into a number + n = atoi((const char*) nodenum); // turn that into a number // special cases: if ((n == 0) && !(w_chat[4] == '0')) @@ -2164,6 +2172,7 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) UINT8 barcolor = 128; // color we use for the bars (green, yellow or red) SINT8 i = 0; SINT8 yoffset = 6; + INT32 dx; if (ping < 128) { numbars = 3; @@ -2175,7 +2184,7 @@ void HU_drawPing(INT32 x, INT32 y, INT32 ping, boolean notext) barcolor = 103; } - INT32 dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); + dx = x+1 - (V_SmallStringWidth(va("%dms", ping), V_ALLOWLOWERCASE)/2); if (!notext || vid.width >= 640) // how sad, we're using a shit resolution. V_DrawSmallString(dx, y+4, V_ALLOWLOWERCASE, va("%dms", ping)); diff --git a/src/k_kart.c b/src/k_kart.c index b37c8f49..d369c1d0 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2850,24 +2850,25 @@ static void K_DoThunderShield(player_t *player) int i = 0; fixed_t sx; fixed_t sy; - + angle_t an; + S_StartSound(player->mo, sfx_zio3); //player->kartstuff[k_thunderanim] = 35; P_NukeEnemies(player->mo, player->mo, RING_DIST/4); - + // spawn vertical bolt mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK); P_SetTarget(&mo->target, player->mo); P_SetMobjState(mo, S_LZIO11); mo->color = SKINCOLOR_TEAL; mo->scale = player->mo->scale*3 + (player->mo->scale/2); - + mo = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_THOK); P_SetTarget(&mo->target, player->mo); P_SetMobjState(mo, S_LZIO21); mo->color = SKINCOLOR_CYAN; mo->scale = player->mo->scale*3 + (player->mo->scale/2); - + // spawn horizontal bolts; for (i=0; i<7; i++) { @@ -2877,9 +2878,9 @@ static void K_DoThunderShield(player_t *player) P_SetTarget(&mo->target, player->mo); P_SetMobjState(mo, S_KLIT1); } - - // spawn the radius thing: - angle_t an = ANGLE_22h; + + // spawn the radius thing: + an = ANGLE_22h; for (i=0; i<15; i++) { sx = player->mo->x + FixedMul((player->mo->scale*THUNDERRADIUS), FINECOSINE((an*i)>>ANGLETOFINESHIFT)); @@ -7235,7 +7236,7 @@ static void K_drawDistributionDebugger(void) if (stplyr != &players[displayplayer]) // only for p1 return; - // The only code duplication from the Kart, just to avoid the actual item function from calculating pingame twice + // The only code duplication from the Kart, just to avoid the actual item function from calculating pingame twice for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i] || players[i].spectator) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 2d287d0f..240db71c 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -92,9 +92,10 @@ static int lib_print(lua_State *L) static int lib_chatprint(lua_State *L) { const char *str = luaL_checkstring(L, 1); // retrieve string + int len; if (str == NULL) // error if we don't have a string! return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprint")); - int len = strlen(str); + len = strlen(str); if (len > 255) // string is too long!!! return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer."); @@ -113,19 +114,21 @@ static int lib_chatprintf(lua_State *L) { int n = lua_gettop(L); /* number of arguments */ player_t *plr; + const char *str; + int len; if (n < 2) return luaL_error(L, "chatprintf requires at least two arguments: player and text."); - + plr = *((player_t **)luaL_checkudata(L, 1, META_PLAYER)); // retrieve player if (!plr) return LUA_ErrInvalid(L, "player_t"); if (plr != &players[consoleplayer]) return 0; - - const char *str = luaL_checkstring(L, 2); // retrieve string + + str = luaL_checkstring(L, 2); // retrieve string if (str == NULL) // error if we don't have a string! return luaL_error(L, LUA_QL("tostring") " must return a string to " LUA_QL("chatprintf")); - int len = strlen(str); + len = strlen(str); if (len > 255) // string is too long!!! return luaL_error(L, "String exceeds the 255 characters limit of the chat buffer."); diff --git a/src/p_enemy.c b/src/p_enemy.c index 7cdc354d..a9871ab7 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8318,13 +8318,13 @@ void A_BallhogExplode(mobj_t *actor) // Dumb simple function that gives a mobj its target's momentums without updating its angle. void A_LightningFollowPlayer(mobj_t *actor) { + fixed_t sx, sy; #ifdef HAVE_BLUA if (LUA_CallAction("A_LightningFollowPlayer", actor)) return; #endif - fixed_t sx, sy; if (actor->target) - { + { if (actor->extravalue1) // Make the radius also follow the player somewhat accuratly { sx = actor->target->x + FixedMul((actor->target->scale*actor->extravalue1), FINECOSINE((actor->angle)>>ANGLETOFINESHIFT)); @@ -8333,7 +8333,7 @@ void A_LightningFollowPlayer(mobj_t *actor) } else // else just teleport to player directly P_TeleportMove(actor, actor->target->x, actor->target->y, actor->target->z); - + actor->momx = actor->target->momx; actor->momy = actor->target->momy; actor->momz = actor->target->momz; // Give momentum since we don't teleport to our player literally every frame. From def090c9f0245c148d2313c30c4ef398578d1738 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 7 Oct 2018 14:45:03 -0400 Subject: [PATCH 105/138] Move the ifdef --- src/sdl/mixer_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index d1083518..1b0974b1 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -52,11 +52,11 @@ #ifndef _FILE_OFFSET_BITS #define _FILE_OFFSET_BITS 0 #endif -#endif #ifdef HAVE_ZLIB #include "zlib.h" #endif +#endif UINT8 sound_started = false; From 232a7ae7b713c5c5854d0d0205a4fbd5dea9ee47 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 7 Oct 2018 14:52:25 -0400 Subject: [PATCH 106/138] Change order of the ifdef --- src/sdl/mixer_sound.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 1b0974b1..c4d2a8b0 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -39,6 +39,7 @@ #define GME_TREBLE 5.0 #define GME_BASS 1.0 +#ifdef HAVE_ZLIB #ifndef _MSC_VER #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE @@ -53,10 +54,9 @@ #define _FILE_OFFSET_BITS 0 #endif -#ifdef HAVE_ZLIB #include "zlib.h" -#endif -#endif +#endif // HAVE_ZLIB +#endif // HAVE_LIBGME UINT8 sound_started = false; From 027e6e8e3c91777efa302c63ab5eab23e315925d Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 7 Oct 2018 15:00:48 -0400 Subject: [PATCH 107/138] Change win_snd.c also --- src/win32/win_snd.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index bc04bd6d..58644457 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -18,13 +18,12 @@ #define GME_TREBLE 5.0 #define GME_BASS 1.0 +#ifdef HAVE_ZLIB #ifndef _MSC_VER -#ifndef _WII #ifndef _LARGEFILE64_SOURCE #define _LARGEFILE64_SOURCE #endif #endif -#endif #ifndef _LFS64_LARGEFILE #define _LFS64_LARGEFILE @@ -34,10 +33,9 @@ #define _FILE_OFFSET_BITS 0 #endif -#ifdef HAVE_ZLIB #include "zlib.h" -#endif -#endif +#endif // HAVE_ZLIB +#endif // HAVE_LIBGME static FMOD_SYSTEM *fsys; static FMOD_SOUND *music_stream; From 1324e0bfcd945651a90c339042523d4f35e89a24 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 8 Oct 2018 18:50:17 +0100 Subject: [PATCH 108/138] * Fix a memory leak regarding implementation of SOC_ (improperly copypasted code from LUA_LoadLump!!) * Optimise the repeated strlen usage into a single call, which is stored for later. --- src/lua_script.c | 12 +++++++----- src/w_wad.c | 15 ++++++++++----- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index ce96878b..1c1b01f6 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -182,19 +182,21 @@ void LUA_LoadLump(UINT16 wad, UINT16 lump) { MYFILE f; char *name; + size_t len; f.wad = wad; f.size = W_LumpLengthPwad(wad, lump); f.data = Z_Malloc(f.size, PU_LUA, NULL); W_ReadLumpPwad(wad, lump, f.data); f.curpos = f.data; - name = malloc(strlen(wadfiles[wad]->filename)+10); + len = strlen(wadfiles[wad]->filename); + name = malloc(len+10); strcpy(name, wadfiles[wad]->filename); - if (!fasticmp(&name[strlen(name) - 4], ".lua")) { + if (!fasticmp(&name[len - 4], ".lua")) { // If it's not a .lua file, copy the lump name in too. - name[strlen(wadfiles[wad]->filename)] = '|'; - M_Memcpy(name+strlen(wadfiles[wad]->filename)+1, wadfiles[wad]->lumpinfo[lump].name, 8); - name[strlen(wadfiles[wad]->filename)+9] = '\0'; + name[len] = '|'; + M_Memcpy(name+len+1, wadfiles[wad]->lumpinfo[lump].name, 8); + name[len+9] = '\0'; } LUA_LoadFile(&f, name); diff --git a/src/w_wad.c b/src/w_wad.c index 3a828559..3f0082a1 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -194,16 +194,21 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum) for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++) if (memcmp(lump_p->name,"SOC_",4)==0) // Check for generic SOC lump { // shameless copy+paste of code from LUA_LoadLump - char *name = malloc(strlen(wadfiles[wadnum]->filename)+10); + size_t len = strlen(wadfiles[wadnum]->filename); + char *name = malloc(len+10); + strcpy(name, wadfiles[wadnum]->filename); - if (!fasticmp(&name[strlen(name) - 4], ".soc")) { + if (!fasticmp(&name[len - 4], ".soc")) { // If it's not a .soc file, copy the lump name in too. - name[strlen(wadfiles[wadnum]->filename)] = '|'; - M_Memcpy(name+strlen(wadfiles[wadnum]->filename)+1, lump_p->name, 8); - name[strlen(wadfiles[wadnum]->filename)+9] = '\0'; + name[len] = '|'; + M_Memcpy(name+len+1, lump_p->name, 8); + name[len+9] = '\0'; } + CONS_Printf(M_GetText("Loading SOC from %s\n"), name); DEH_LoadDehackedLumpPwad(wadnum, lump); + + free(name); } else if (memcmp(lump_p->name,"MAINCFG",8)==0) // Check for MAINCFG { From bb3d01495a782be5d3789e69bbae711360209dd9 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 8 Oct 2018 21:31:55 -0400 Subject: [PATCH 109/138] New engine sounds 9 unique engine classes with 13 sounds each, which smoothly change. Each character sounds distinct now! --- src/d_player.h | 1 + src/dehacked.c | 1 + src/k_kart.c | 34 +++++++++++++ src/p_user.c | 39 ++++----------- src/sounds.c | 131 ++++++++++++++++++++++++++++++++++++++++++++++-- src/sounds.h | 132 +++++++++++++++++++++++++++++++++++++++++++++++-- 6 files changed, 303 insertions(+), 35 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 373110dd..02f7f45e 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -284,6 +284,7 @@ typedef enum k_voices, // Used to stop the player saying more voices than it should k_tauntvoices, // Used to specifically stop taunt voice spam k_instashield, // Instashield no-damage animation timer + k_enginesnd, // Engine sound number you're on. k_floorboost, // Prevents Sneaker sounds for a breif duration when triggered by a floor panel k_spinouttype, // Determines whether to thrust forward or not while spinning out; 0 = move forwards, 1 = stay still diff --git a/src/dehacked.c b/src/dehacked.c index 67071d88..8429d401 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7744,6 +7744,7 @@ static const char *const KARTSTUFF_LIST[] = { "VOICES", "TAUNTVOICES", "INSTASHIELD", + "ENGINESND", "FLOORBOOST", "SPINOUTTYPE", diff --git a/src/k_kart.c b/src/k_kart.c index b37c8f49..c8203e8b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3646,6 +3646,39 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source) return wtarg; } +// Engine Sounds. +static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) +{ + INT32 forwardamount = (6*cmd->forwardmove) / 25; // max of 50 is 12 + INT32 momamount = ((player->speed>>FRACBITS) / 5); + INT32 targetsnd = (forwardamount+momamount)/2; + INT32 class = ((player->kartspeed-1)/3) + (3*((player->kartweight-1)/3)); // engine class (3*weight/3 LOOKS redundant, but it's to reduce the precision and get things into 3 unique categories) + const INT32 numsnds = 13; + + if (leveltime < 6) // stats may not be set on level start, so it plays class A sounds + return; + + if (leveltime % 6) + return; + + if (targetsnd < 0) + targetsnd = 0; + if (targetsnd > 12) + targetsnd = 12; + + if (player->kartstuff[k_enginesnd] < targetsnd) + player->kartstuff[k_enginesnd]++; + if (player->kartstuff[k_enginesnd] > targetsnd) + player->kartstuff[k_enginesnd]--; + + if (player->kartstuff[k_enginesnd] < 0) + player->kartstuff[k_enginesnd] = 0; + if (player->kartstuff[k_enginesnd] > 12) + player->kartstuff[k_enginesnd] = 12; + + S_StartSound(player->mo, (sfx_krta00 + player->kartstuff[k_enginesnd]) + (class*numsnds)); +} + /** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c \param player player object passed from P_PlayerThink @@ -3656,6 +3689,7 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source) void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) { K_UpdateOffroad(player); + K_UpdateEngineSounds(player, cmd); K_GetKartBoostPower(player); // Speed lines diff --git a/src/p_user.c b/src/p_user.c index dfc56a8c..e49c8fda 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6662,36 +6662,17 @@ static void P_MovePlayer(player_t *player) P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND //{ SRB2kart - // Engine Sounds. - if (!player->exiting) - { - if (player->speed == 0 && onground && player->speed == 0 && leveltime % 6 == 0) - S_StartSound(player->mo, sfx_kart1); - if ((player->speed < runspd && player->speed != 0) && leveltime % 8 == 0) - S_StartSound(player->mo, sfx_kart2); - - if ((player->speed > runspd) && leveltime % 8 == 0) - S_StartSound(player->mo, sfx_kart3); - - // Drifting sound - { - // Start looping the sound now. - if (leveltime % 50 == 0 && onground - && player->kartstuff[k_drift] != 0) - S_StartSound(player->mo, sfx_mkdrft); - // Leveltime being 50 might take a while at times. We'll start it up once, isntantly. - else if ((player->kartstuff[k_drift] >= 1 || player->kartstuff[k_drift] <= -1) && !S_SoundPlaying(player->mo, sfx_mkdrft) && onground) - S_StartSound(player->mo, sfx_mkdrft); - // Ok, we'll stop now. - else if ((player->kartstuff[k_drift] == 0) - && (player == &players[consoleplayer] - || (splitscreen && player == &players[secondarydisplayplayer]) - || (splitscreen > 1 && player == &players[thirddisplayplayer]) - || (splitscreen > 2 && player == &players[fourthdisplayplayer]))) - S_StopSoundByID(player->mo, sfx_mkdrft); - } - } + // Drifting sound + // Start looping the sound now. + if (leveltime % 50 == 0 && onground && player->kartstuff[k_drift] != 0) + S_StartSound(player->mo, sfx_mkdrft); + // Leveltime being 50 might take a while at times. We'll start it up once, isntantly. + else if (!S_SoundPlaying(player->mo, sfx_mkdrft) && onground && player->kartstuff[k_drift] != 0) + S_StartSound(player->mo, sfx_mkdrft); + // Ok, we'll stop now. + else if (player->kartstuff[k_drift] == 0) + S_StopSoundByID(player->mo, sfx_mkdrft); K_MoveKartPlayer(player, onground); //} diff --git a/src/sounds.c b/src/sounds.c index 8e0ed4e0..6e102186 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -771,9 +771,6 @@ sfxinfo_t S_sfx[NUMSFX] = {"lkt1", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"lkt2", true, 192, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"lkt3", true, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kart1", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kart2", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"kart3", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mlap", true, 127, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"sboost", true, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"mush", false, 90, 0, -1, NULL, 0, -1, -1, LUMPERROR}, @@ -821,6 +818,134 @@ sfxinfo_t S_sfx[NUMSFX] = {"itfree", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR}, {"dbgsal", false, 110, 8, -1, NULL, 0, -1, -1, LUMPERROR}, + // SRB2Kart - Engine sounds + // Engine class A + {"krta00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // Engine class B + {"krtb00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // Engine class C + {"krtc00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // Engine class D + {"krtd00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // Engine class E + {"krte00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // Engine class F + {"krtf00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // Engine class G + {"krtg00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // Engine class H + {"krth00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // Engine class I + {"krti00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + // SRB2kart - Skin sounds {"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR}, {"klose", false, 64, 96, -1, NULL, 0, SKSKLOSE, -1, LUMPERROR}, diff --git a/src/sounds.h b/src/sounds.h index 301b3912..2516b646 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -846,9 +846,6 @@ typedef enum sfx_lkt1, sfx_lkt2, sfx_lkt3, - sfx_kart1, - sfx_kart2, - sfx_kart3, sfx_mlap, sfx_sboost, sfx_mush, @@ -896,6 +893,135 @@ typedef enum sfx_itfree, sfx_dbgsal, + // Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy... + // Engine class A - Low Speed, Low Weight + sfx_krta00, + sfx_krta01, + sfx_krta02, + sfx_krta03, + sfx_krta04, + sfx_krta05, + sfx_krta06, + sfx_krta07, + sfx_krta08, + sfx_krta09, + sfx_krta10, + sfx_krta11, + sfx_krta12, + // Engine class B - Average Speed, Low Weight + sfx_krtb00, + sfx_krtb01, + sfx_krtb02, + sfx_krtb03, + sfx_krtb04, + sfx_krtb05, + sfx_krtb06, + sfx_krtb07, + sfx_krtb08, + sfx_krtb09, + sfx_krtb10, + sfx_krtb11, + sfx_krtb12, + // Engine class C - High Speed, Low Weight + sfx_krtc00, + sfx_krtc01, + sfx_krtc02, + sfx_krtc03, + sfx_krtc04, + sfx_krtc05, + sfx_krtc06, + sfx_krtc07, + sfx_krtc08, + sfx_krtc09, + sfx_krtc10, + sfx_krtc11, + sfx_krtc12, + // Engine class D - Low Speed, Average Weight + sfx_krtd00, + sfx_krtd01, + sfx_krtd02, + sfx_krtd03, + sfx_krtd04, + sfx_krtd05, + sfx_krtd06, + sfx_krtd07, + sfx_krtd08, + sfx_krtd09, + sfx_krtd10, + sfx_krtd11, + sfx_krtd12, + // Engine class E - Average Speed, Average Weight + sfx_krte00, + sfx_krte01, + sfx_krte02, + sfx_krte03, + sfx_krte04, + sfx_krte05, + sfx_krte06, + sfx_krte07, + sfx_krte08, + sfx_krte09, + sfx_krte10, + sfx_krte11, + sfx_krte12, + // Engine class F - High Speed, Average Weight + sfx_krtf00, + sfx_krtf01, + sfx_krtf02, + sfx_krtf03, + sfx_krtf04, + sfx_krtf05, + sfx_krtf06, + sfx_krtf07, + sfx_krtf08, + sfx_krtf09, + sfx_krtf10, + sfx_krtf11, + sfx_krtf12, + // Engine class G - Low Speed, High Weight + sfx_krtg00, + sfx_krtg01, + sfx_krtg02, + sfx_krtg03, + sfx_krtg04, + sfx_krtg05, + sfx_krtg06, + sfx_krtg07, + sfx_krtg08, + sfx_krtg09, + sfx_krtg10, + sfx_krtg11, + sfx_krtg12, + // Engine class H - Average Speed, High Weight + sfx_krth00, + sfx_krth01, + sfx_krth02, + sfx_krth03, + sfx_krth04, + sfx_krth05, + sfx_krth06, + sfx_krth07, + sfx_krth08, + sfx_krth09, + sfx_krth10, + sfx_krth11, + sfx_krth12, + // Engine class I - High Speed, High Weight + sfx_krti00, + sfx_krti01, + sfx_krti02, + sfx_krti03, + sfx_krti04, + sfx_krti05, + sfx_krti06, + sfx_krti07, + sfx_krti08, + sfx_krti09, + sfx_krti10, + sfx_krti11, + sfx_krti12, + + // And LASTLY, Kart's skin sounds. sfx_kwin, sfx_klose, sfx_khurt1, From 3a1d58ceb6a8732d3519203c154324bae3fd0d31 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 8 Oct 2018 22:35:17 -0400 Subject: [PATCH 110/138] Reduce update frequency to match the sfx length better --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index c8203e8b..2232ab82 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3655,10 +3655,10 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) INT32 class = ((player->kartspeed-1)/3) + (3*((player->kartweight-1)/3)); // engine class (3*weight/3 LOOKS redundant, but it's to reduce the precision and get things into 3 unique categories) const INT32 numsnds = 13; - if (leveltime < 6) // stats may not be set on level start, so it plays class A sounds + if (leveltime < 8) // stats may not be set on level start, so it plays class A sounds return; - if (leveltime % 6) + if (leveltime % 8) return; if (targetsnd < 0) From 5811ff521cf78254a5a94481fbe0142793ff0d46 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 9 Oct 2018 14:07:05 -0400 Subject: [PATCH 111/138] Many adjustments - Volume of your own engine is lower than default - Engine sounds get quieter with more people around, ala SMK. 16 player servers should hopefully not be loud as fuck :V - Starting countdown and drop dash revs up your engine now - Doubled sound distance --- src/k_kart.c | 48 +++++++++-- src/sounds.c | 234 +++++++++++++++++++++++++-------------------------- 2 files changed, 158 insertions(+), 124 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 2232ab82..d8aa9d7a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3649,18 +3649,27 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source) // Engine Sounds. static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) { - INT32 forwardamount = (6*cmd->forwardmove) / 25; // max of 50 is 12 - INT32 momamount = ((player->speed>>FRACBITS) / 5); - INT32 targetsnd = (forwardamount+momamount)/2; - INT32 class = ((player->kartspeed-1)/3) + (3*((player->kartweight-1)/3)); // engine class (3*weight/3 LOOKS redundant, but it's to reduce the precision and get things into 3 unique categories) const INT32 numsnds = 13; + INT32 class = ((player->kartspeed-1)/3) + (3*((player->kartweight-1)/3)); // engine class number + INT32 numcloseplayers = 0; + UINT8 volume = 255; + INT32 targetsnd = 0; + INT32 i; - if (leveltime < 8) // stats may not be set on level start, so it plays class A sounds + if (player->spectator || player->exiting) return; - if (leveltime % 8) + if (leveltime < 8) // stats may not be set on level start, so it might play class A sounds return; + if (leveltime % 8) // .25 seconds of wait time + return; + + if (leveltime <= starttime || player->kartstuff[k_respawn] == 1) // Startup boosts + targetsnd = ((cmd->buttons & BT_ACCELERATE) ? 6 : 0); + else + targetsnd = (((6*cmd->forwardmove)/25) + ((player->speed>>FRACBITS)/5))/2; + if (targetsnd < 0) targetsnd = 0; if (targetsnd > 12) @@ -3676,7 +3685,32 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_enginesnd] > 12) player->kartstuff[k_enginesnd] = 12; - S_StartSound(player->mo, (sfx_krta00 + player->kartstuff[k_enginesnd]) + (class*numsnds)); + // Display player's engines are quieter + if ((player == &players[displayplayer]) + || (player == &players[secondarydisplayplayer] && splitscreen) + || (player == &players[thirddisplayplayer] && splitscreen > 1) + || (player == &players[fourthdisplayplayer] && splitscreen > 2)) + volume = FixedDiv(volume<>FRACBITS; + else + { + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i] || !players[i].mo || players[i].spectator || players[i].exiting) + continue; + if ((i == displayplayer) + || (i == secondarydisplayplayer && splitscreen) + || (i == thirddisplayplayer && splitscreen > 1) + || (i == fourthdisplayplayer && splitscreen > 2)) + continue; + if (P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x, + player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) <= 12288< 1) + volume = FixedDiv(volume<>FRACBITS; + } + + S_StartSoundAtVolume(player->mo, (sfx_krta00 + player->kartstuff[k_enginesnd]) + (class*numsnds), volume); } /** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c diff --git a/src/sounds.c b/src/sounds.c index 6e102186..ea9df112 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -820,131 +820,131 @@ sfxinfo_t S_sfx[NUMSFX] = // SRB2Kart - Engine sounds // Engine class A - {"krta00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class B - {"krtb00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class C - {"krtc00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class D - {"krtd00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class E - {"krte00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class F - {"krtf00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class G - {"krtg00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class H - {"krth00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class I - {"krti00", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti01", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti02", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti03", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti04", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti05", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti06", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti07", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti08", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti09", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti10", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti11", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti12", false, 48, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds {"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR}, From 497314fdc44551a46395f41cd579d845d92b270e Mon Sep 17 00:00:00 2001 From: Sryder Date: Tue, 9 Oct 2018 19:43:18 +0100 Subject: [PATCH 112/138] Tiny fix so that joystick2 being closed can let the JoystickSubSystem close before game close. No memory leak here, just a very tiny thing I noticed. --- src/sdl/i_system.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index f92cd4b6..7b14f1f1 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -1154,6 +1154,7 @@ static void I_ShutdownJoystick2(void) D_PostEvent(&event); } + joystick2_started = 0; JoyReset(&JoyInfo2); if (!joystick_started && !joystick2_started && SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK) { From aa12bbf039d21a99766c2639ba4e938cdb1b5357 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 9 Oct 2018 15:28:52 -0400 Subject: [PATCH 113/138] Fix tabbing --- src/m_menu.c | 169 +++++++++++++++++++++++++-------------------------- 1 file changed, 84 insertions(+), 85 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 2e1704dc..0bc0f213 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8541,114 +8541,113 @@ static void M_Setup4PControlsMenu(INT32 choice) // Draws the Customise Controls menu static void M_DrawControl(void) { - char tmp[50]; - INT32 x, y, i, max, cursory = 0, iter; - INT32 keys[2]; + char tmp[50]; + INT32 x, y, i, max, cursory = 0, iter; + INT32 keys[2]; - x = currentMenu->x; - y = currentMenu->y; + x = currentMenu->x; + y = currentMenu->y; - /*i = itemOn - (controlheight/2); - if (i < 0) - i = 0; - */ + /*i = itemOn - (controlheight/2); + if (i < 0) + i = 0; + */ - iter = (controlheight/2); - for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--) - { - if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2) - iter--; - } - if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) - i--; + iter = (controlheight/2); + for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--) + { + if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2) + iter--; + } + if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + i--; - iter += (controlheight/2); - for (max = itemOn; (iter && max < currentMenu->numitems); max++) - { - if (currentMenu->menuitems[max].status != IT_GRAYEDOUT2) - iter--; - } + iter += (controlheight/2); + for (max = itemOn; (iter && max < currentMenu->numitems); max++) + { + if (currentMenu->menuitems[max].status != IT_GRAYEDOUT2) + iter--; + } - if (iter) - { - iter += (controlheight/2); - for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--) - { - if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2) - iter--; - } - } + if (iter) + { + iter += (controlheight/2); + for (i = itemOn; ((iter || currentMenu->menuitems[i].status == IT_GRAYEDOUT2) && i > 0); i--) + { + if (currentMenu->menuitems[i].status != IT_GRAYEDOUT2) + iter--; + } + } - /*max = i + controlheight; - if (max > currentMenu->numitems) - { - max = currentMenu->numitems; - if (max < controlheight) - i = 0; - else - i = max - controlheight; - }*/ + /*max = i + controlheight; + if (max > currentMenu->numitems) + { + max = currentMenu->numitems; + if (max < controlheight) + i = 0; + else + i = max - controlheight; + }*/ - // draw title (or big pic) - M_DrawMenuTitle(); + // draw title (or big pic) + M_DrawMenuTitle(); - M_CentreText(28, + M_CentreText(28, (setupcontrols_fourthplayer ? "\x86""Set controls for ""\x82""Player 4" : (setupcontrols_thirdplayer ? "\x86""Set controls for ""\x82""Player 3" : - (setupcontrols_secondaryplayer ? "\x86""Set controls for ""\x82""Player 2" : - "\x86""Press ""\x82""ENTER""\x86"" to change, ""\x82""BACKSPACE""\x86"" to clear")))); + (setupcontrols_secondaryplayer ? "\x86""Set controls for ""\x82""Player 2" : + "\x86""Press ""\x82""ENTER""\x86"" to change, ""\x82""BACKSPACE""\x86"" to clear")))); - if (i) - V_DrawString(currentMenu->x - 16, y-(skullAnimCounter/5), highlightflags, "\x1A"); // up arrow - if (max != currentMenu->numitems) - V_DrawString(currentMenu->x - 16, y+(SMALLLINEHEIGHT*(controlheight-1))+(skullAnimCounter/5), highlightflags, "\x1B"); // down arrow + if (i) + V_DrawString(currentMenu->x - 16, y-(skullAnimCounter/5), highlightflags, "\x1A"); // up arrow + if (max != currentMenu->numitems) + V_DrawString(currentMenu->x - 16, y+(SMALLLINEHEIGHT*(controlheight-1))+(skullAnimCounter/5), highlightflags, "\x1B"); // down arrow - for (; i < max; i++) - { - if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) - continue; + for (; i < max; i++) + { + if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + continue; - if (i == itemOn) - cursory = y; + if (i == itemOn) + cursory = y; - if (currentMenu->menuitems[i].status == IT_CONTROL) - { - V_DrawString(x, y, ((i == itemOn) ? highlightflags : 0), currentMenu->menuitems[i].text); - keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0]; - keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1]; + if (currentMenu->menuitems[i].status == IT_CONTROL) + { + V_DrawString(x, y, ((i == itemOn) ? highlightflags : 0), currentMenu->menuitems[i].text); + keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0]; + keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1]; - tmp[0] ='\0'; - if (keys[0] == KEY_NULL && keys[1] == KEY_NULL) - { - strcpy(tmp, "---"); - } - else - { - if (keys[0] != KEY_NULL) - strcat (tmp, G_KeynumToString (keys[0])); + tmp[0] ='\0'; + if (keys[0] == KEY_NULL && keys[1] == KEY_NULL) + { + strcpy(tmp, "---"); + } + else + { + if (keys[0] != KEY_NULL) + strcat (tmp, G_KeynumToString (keys[0])); - if (keys[0] != KEY_NULL && keys[1] != KEY_NULL) - strcat(tmp,", "); + if (keys[0] != KEY_NULL && keys[1] != KEY_NULL) + strcat(tmp,", "); - if (keys[1] != KEY_NULL) - strcat (tmp, G_KeynumToString (keys[1])); + if (keys[1] != KEY_NULL) + strcat (tmp, G_KeynumToString (keys[1])); - - } - V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, highlightflags, tmp); - } - /*else if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) - V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);*/ - else if ((currentMenu->menuitems[i].status == IT_HEADER) && (i != max-1)) + } + V_DrawRightAlignedString(BASEVIDWIDTH-currentMenu->x, y, highlightflags, tmp); + } + /*else if (currentMenu->menuitems[i].status == IT_GRAYEDOUT2) + V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text);*/ + else if ((currentMenu->menuitems[i].status == IT_HEADER) && (i != max-1)) V_DrawString(19, y+6, highlightflags, currentMenu->menuitems[i].text); else if (currentMenu->menuitems[i].status & IT_STRING) V_DrawString(x, y, ((i == itemOn) ? highlightflags : 0), currentMenu->menuitems[i].text); - y += SMALLLINEHEIGHT; - } + y += SMALLLINEHEIGHT; + } - V_DrawScaledPatch(currentMenu->x - 20, cursory, 0, - W_CachePatchName("M_CURSOR", PU_CACHE)); + V_DrawScaledPatch(currentMenu->x - 20, cursory, 0, + W_CachePatchName("M_CURSOR", PU_CACHE)); } #undef controlheight From 76eebe6cf771c95a016c0e5c78c4cfc1b7e60a15 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 9 Oct 2018 21:09:39 +0100 Subject: [PATCH 114/138] If you hit a one-bumper person with a karma fake, you get to come back immediately! --- src/p_inter.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/p_inter.c b/src/p_inter.c index e6527f30..ca467933 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -592,6 +592,22 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) mobj_t *poof = P_SpawnMobj(special->x, special->y, special->z, MT_EXPLODE); S_StartSound(poof, special->info->seesound); + if (player->kartstuff[k_bumper] == 1) // If you have only one bumper left, and see if it's a 1v1 + { + INT32 numingame = 0; + INT32 i; + + for (i = 0; i < MAXPLAYERS; i++) + { + if (!playeringame[i] || players[i].spectator || players[i].kartstuff[k_bumper] <= 0) + continue; + numingame++; + } + + if (numingame <= 2) // If so, then an extra two karma points so they are 100% certain to switch places; it's annoying to end matches with a fake kill + special->target->player->kartstuff[k_comebackpoints] += 2; + } + special->target->player->kartstuff[k_comebackmode] = 0; special->target->player->kartstuff[k_comebackpoints]++; From 66d00b7cc66b95996e10e5fd5577766407d4dae7 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 9 Oct 2018 22:24:44 +0100 Subject: [PATCH 115/138] HitEm sound for K_ExplodePlayer --- src/k_kart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index 427a780d..9f70f0f6 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1924,6 +1924,9 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju return; } + if (source && source != player->mo && source->player) + K_PlayHitEmSound(source); + player->mo->momz = 18*(mapheaderinfo[gamemap-1]->mobj_scale); player->mo->momx = player->mo->momy = 0; From a8a1f1b4445c6ec08ca58a17478a98a2d1e304f6 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 9 Oct 2018 22:40:42 +0100 Subject: [PATCH 116/138] Spawn a poof if you get hit while karmegg. (I've moved the comebacktimer set into one level up from that conditional; don't worry, I checked - there's nowhere that accesses this field while you have bumpers, it's just always set here for some dastardly reason.) --- src/k_kart.c | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 9f70f0f6..dbf8f796 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1796,11 +1796,20 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem K_CalculateBattleWanted(); } + if (!player->kartstuff[k_bumper]) + { + player->kartstuff[k_comebacktimer] = comebacktime; + if (player->kartstuff[k_comebackmode]) + { + mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE); + S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound); + player->kartstuff[k_comebackmode] = 0; + } + } + K_CheckBumpers(); } - player->kartstuff[k_comebacktimer] = comebacktime; - player->kartstuff[k_spinouttype] = type; if (player->kartstuff[k_spinouttype] <= 0) @@ -1878,11 +1887,20 @@ void K_SquishPlayer(player_t *player, mobj_t *source) K_CalculateBattleWanted(); } + if (!player->kartstuff[k_bumper]) + { + player->kartstuff[k_comebacktimer] = comebacktime; + if (player->kartstuff[k_comebackmode]) + { + mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE); + S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound); + player->kartstuff[k_comebackmode] = 0; + } + } + K_CheckBumpers(); } - player->kartstuff[k_comebacktimer] = comebacktime; - player->kartstuff[k_squishedtimer] = 2*TICRATE; player->powers[pw_flashing] = K_GetKartFlashing(player); @@ -1957,11 +1975,20 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju K_CalculateBattleWanted(); } + if (!player->kartstuff[k_bumper]) + { + player->kartstuff[k_comebacktimer] = comebacktime; + if (player->kartstuff[k_comebackmode]) + { + mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE); + S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound); + player->kartstuff[k_comebackmode] = 0; + } + } + K_CheckBumpers(); } - player->kartstuff[k_comebacktimer] = comebacktime; - player->kartstuff[k_spinouttype] = 1; player->kartstuff[k_spinouttimer] = 2*TICRATE+(TICRATE/2); From e248cf9421979581ad205aa6f41f5328f9de8b27 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 9 Oct 2018 22:44:43 +0100 Subject: [PATCH 117/138] Sal's request --- src/k_kart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index dbf8f796..89882425 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1799,7 +1799,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem if (!player->kartstuff[k_bumper]) { player->kartstuff[k_comebacktimer] = comebacktime; - if (player->kartstuff[k_comebackmode]) + if (player->kartstuff[k_comebackmode] == 2) { mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE); S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound); @@ -1890,7 +1890,7 @@ void K_SquishPlayer(player_t *player, mobj_t *source) if (!player->kartstuff[k_bumper]) { player->kartstuff[k_comebacktimer] = comebacktime; - if (player->kartstuff[k_comebackmode]) + if (player->kartstuff[k_comebackmode] == 2) { mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE); S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound); @@ -1978,7 +1978,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source) // A bit of a hack, we ju if (!player->kartstuff[k_bumper]) { player->kartstuff[k_comebacktimer] = comebacktime; - if (player->kartstuff[k_comebackmode]) + if (player->kartstuff[k_comebackmode] == 2) { mobj_t *poof = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_EXPLODE); S_StartSound(poof, mobjinfo[MT_KARMAHITBOX].seesound); From 52dc945804c3fd08e2e228947a9a64d3dd2e4a77 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 9 Oct 2018 23:02:21 +0100 Subject: [PATCH 118/138] 4 -> 5 --- src/m_cond.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_cond.c b/src/m_cond.c index 762b103a..80b86331 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -132,7 +132,7 @@ void M_SetupDefaultConditionSets(void) M_AddRawCondition(4, 1, UC_TOTALEMBLEMS, 40, 0, 0); M_AddRawCondition(4, 2, UC_MATCHESPLAYED, 150, 0, 0); - // -- 4: Collect 50 emblems ONLY + // -- 5: Collect 50 emblems ONLY M_AddRawCondition(5, 1, UC_TOTALEMBLEMS, 50, 0, 0); // -- 10: Play 100 matches From 94c92c22623a4321b6d3018538bbb91e4f83789d Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 9 Oct 2018 18:04:25 -0400 Subject: [PATCH 119/138] x2 distance, fix priority --- src/k_kart.c | 2 +- src/sounds.c | 234 +++++++++++++++++++++++++-------------------------- 2 files changed, 118 insertions(+), 118 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 236f35b0..9d73ff84 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3673,7 +3673,7 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) || (i == fourthdisplayplayer && splitscreen > 2)) continue; if (P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x, - player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) <= 12288<mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) <= 3072< 1) diff --git a/src/sounds.c b/src/sounds.c index ea9df112..75c0793c 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -820,131 +820,131 @@ sfxinfo_t S_sfx[NUMSFX] = // SRB2Kart - Engine sounds // Engine class A - {"krta00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class B - {"krtb00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class C - {"krtc00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class D - {"krtd00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class E - {"krte00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class F - {"krtf00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class G - {"krtg00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class H - {"krth00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class I - {"krti00", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti01", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti02", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti03", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti04", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti05", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti06", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti07", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti08", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti09", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti10", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti11", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti12", false, 112, 0, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds {"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR}, From 543573725815aaba898f8cbe2953255279e20ebb Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 9 Oct 2018 21:11:00 -0400 Subject: [PATCH 120/138] Some code cleanup & minor adjustments --- src/k_kart.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 9d73ff84..481e107c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3626,19 +3626,24 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) INT32 targetsnd = 0; INT32 i; - if (player->spectator || player->exiting) + // Silence the engines + if (leveltime < 8 || player->spectator || player->exiting) + { + player->kartstuff[k_enginesnd] = 0; // Reset sound number + return; + } + +#if 0 + if ((leveltime % 8) != ((player-players) % 8)) // Per-player offset, to make engines sound distinct! +#else + if (leveltime % 8) // .25 seconds of wait time between engine sounds +#endif return; - if (leveltime < 8) // stats may not be set on level start, so it might play class A sounds - return; - - if (leveltime % 8) // .25 seconds of wait time - return; - - if (leveltime <= starttime || player->kartstuff[k_respawn] == 1) // Startup boosts - targetsnd = ((cmd->buttons & BT_ACCELERATE) ? 6 : 0); + if ((leveltime >= starttime-(2*TICRATE) && leveltime <= starttime) || (player->kartstuff[k_respawn] == 1)) // Startup boosts + targetsnd = ((cmd->buttons & BT_ACCELERATE) ? 12 : 0); else - targetsnd = (((6*cmd->forwardmove)/25) + ((player->speed>>FRACBITS)/5))/2; + targetsnd = (((6*cmd->forwardmove)/25) + ((player->speed / mapheaderinfo[gamemap-1]->mobj_scale)/5))/2; if (targetsnd < 0) targetsnd = 0; From a4419abfdc21d0d0ec69e3d73528a4c9bb68205e Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 25 Jan 2017 19:36:32 +0000 Subject: [PATCH 121/138] 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 643c41ac..8de5cf08 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -49,7 +49,9 @@ doomcom_t *doomcom = NULL; /// \brief network packet data, points inside doomcom doomdata_t *netbuffer = NULL; +#ifdef DEBUGFILE FILE *debugfile = NULL; // put some net info in a file during the game +#endif #define MAXREBOUND 8 static doomdata_t reboundstore[MAXREBOUND]; diff --git a/src/doomstat.h b/src/doomstat.h index 8072a155..341cc70a 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -445,19 +445,17 @@ extern mapthing_t *redctfstarts[MAXPLAYERS]; // CTF #if defined (macintosh) #define DEBFILE(msg) I_OutputMsg(msg) -extern FILE *debugfile; #else #define DEBUGFILE #ifdef DEBUGFILE #define DEBFILE(msg) { if (debugfile) { fputs(msg, debugfile); fflush(debugfile); } } -extern FILE *debugfile; #else #define DEBFILE(msg) {} -extern FILE *debugfile; #endif #endif #ifdef DEBUGFILE +extern FILE *debugfile; extern INT32 debugload; #endif From 61a29bed853a737f79fb5aac2c1ceb4ddd758aeb Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 11 Feb 2017 22:41:15 +0000 Subject: [PATCH 122/138] 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 17eb8761..a32609fc 100644 --- a/src/hardware/hw_bsp.c +++ b/src/hardware/hw_bsp.c @@ -564,8 +564,6 @@ static inline void HWR_SubsecPoly(INT32 num, poly_t *poly) subsector_t *sub; seg_t *lseg; - sscount++; - sub = &subsectors[num]; count = sub->numlines; lseg = &segs[sub->firstline]; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 871a6a49..ecb70a0f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3264,7 +3264,6 @@ static void HWR_Subsector(size_t num) if (num < numsubsectors) { - sscount++; // subsector sub = &subsectors[num]; // sector diff --git a/src/r_main.c b/src/r_main.c index f2a0c889..6c92983f 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; @@ -964,8 +963,6 @@ void R_SkyboxFrame(player_t *player) viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); - sscount = 0; - // recalc necessary stuff for mouseaiming // slopes are already calculated for the full possible view (which is 4*viewheight). @@ -1089,8 +1086,6 @@ void R_SetupFrame(player_t *player, boolean skybox) viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); - sscount = 0; - // recalc necessary stuff for mouseaiming // slopes are already calculated for the full possible view (which is 4*viewheight). diff --git a/src/r_state.h b/src/r_state.h index 49d0457b..ac3e1fa4 100644 --- a/src/r_state.h +++ b/src/r_state.h @@ -108,7 +108,4 @@ extern angle_t rw_normalangle; // angle to line origin extern angle_t rw_angle1; -// Segs count? -extern size_t sscount; - #endif From 07dd527e7e58e06ce621e80357bef7ae91424f76 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 11 Feb 2017 22:56:08 +0000 Subject: [PATCH 123/138] 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 6dc273b1..d73b19d1 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -34,7 +34,7 @@ void D_SRB2Loop(void) FUNCNORETURN; // D_SRB2Main() // Not a globally visible function, just included for source reference, // calls all startup code, parses command line options. -// If not overrided by user input, calls N_AdvanceDemo. +// If not overrided by user input, calls D_AdvanceDemo. // void D_SRB2Main(void); @@ -51,9 +51,6 @@ const char *D_Home(void); // // BASE LEVEL // -void D_PageTicker(void); -// pagename is lumpname of a 320x200 patch to fill the screen -void D_PageDrawer(const char *pagename); void D_AdvanceDemo(void); void D_StartTitle(void); From 91b2f5e570b1b3783b54ca014a11ed07d0570ef4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 11 Feb 2017 23:24:12 +0000 Subject: [PATCH 124/138] "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 6c92983f..d1cd71b3 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -491,9 +491,6 @@ static void R_InitTextureMapping(void) // Take out the fencepost cases from viewangletox. for (i = 0; i < FINEANGLES/2; i++) { - t = FixedMul(FINETANGENT(i), focallength); - t = centerx - t; - if (viewangletox[i] == -1) viewangletox[i] = 0; else if (viewangletox[i] == viewwidth+1) From 49c5a6f7e474ff6aa30a726ae7cbcf9e224fb533 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 11 Feb 2017 23:28:42 +0000 Subject: [PATCH 125/138] 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 1fd7ada0..b82bcf0e 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -68,7 +68,6 @@ // both the head and tail of the thinker list extern thinker_t thinkercap; -extern INT32 runcount; void P_InitThinkers(void); void P_AddThinker(thinker_t *thinker); From ef78c942f798e0d736cc84de8b912889d9232fbc Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 15 Feb 2017 21:16:56 +0000 Subject: [PATCH 126/138] 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 d8fae72f..023bbd09 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -212,7 +212,6 @@ void Command_ExitGame_f(void); void Command_Retry_f(void); void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect); -void ObjectPlace_OnChange(void); void ItemFinder_OnChange(void); void D_SetPassword(const char *pw); From 9c464742b7d0b10b35ef27dcdad2e72d33e4f8da Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 22 Feb 2017 21:07:29 +0000 Subject: [PATCH 127/138] 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 6e22dde2..95003823 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1568,8 +1568,6 @@ static void CL_LoadReceivedSavegame(void) automapactive = false; // load a base level - playerdeadview = false; - if (P_LoadNetGame()) { const INT32 actnum = mapheaderinfo[gamemap-1]->actnum; diff --git a/src/d_main.c b/src/d_main.c index df339875..f807e307 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -720,7 +720,6 @@ void D_StartTitle(void) maptol = 0; gameaction = ga_nothing; - playerdeadview = false; displayplayer = consoleplayer = 0; //demosequence = -1; gametype = GT_COOP; diff --git a/src/f_finale.c b/src/f_finale.c index a8b27bb8..fb1387c1 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -442,7 +442,6 @@ void F_StartIntro(void) G_SetGamestate(GS_INTRO); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1130,7 +1129,6 @@ void F_StartCredits(void) } gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1277,7 +1275,6 @@ void F_StartGameEvaluation(void) G_SaveGame((UINT32)cursaveslot); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1388,7 +1385,6 @@ void F_StartGameEnd(void) G_SetGamestate(GS_GAMEEND); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1591,7 +1587,6 @@ void F_StartContinue(void) gameaction = ga_nothing; keypressed = false; - playerdeadview = false; paused = false; CON_ToggleOff(); CON_ClearHUD(); @@ -1760,7 +1755,6 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset G_SetGamestate(GS_CUTSCENE); gameaction = ga_nothing; - playerdeadview = false; paused = false; CON_ToggleOff(); diff --git a/src/g_game.c b/src/g_game.c index 4f1c49b4..0e8c14f6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3616,7 +3616,6 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean mapmusflags |= MUSIC_RELOADRESET; ultimatemode = pultmode; - playerdeadview = false; automapactive = false; imcontinuing = false; diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 7b22f33f..5356ba8a 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -78,9 +78,6 @@ extern boolean chat_on; // set true whenever the tab rankings are being shown for any reason extern boolean hu_showscores; -// P_DeathThink sets this true to show scores while dead, in multiplayer -extern boolean playerdeadview; - // init heads up data at game startup. void HU_Init(void); diff --git a/src/p_user.c b/src/p_user.c index 7abf8534..7e206930 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8648,8 +8648,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; @@ -8838,10 +8836,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; @@ -8862,9 +8856,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 c1d5c711a940fc2e66cbfe53571be01f8bee9420 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 19 Apr 2017 20:00:19 +0100 Subject: [PATCH 128/138] Be gone ye old texture hack --- src/r_data.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index f2c9b146..ee9144b7 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -472,40 +472,22 @@ void R_LoadTextures(void) } else { - UINT16 patchcount = 1; //CONS_Printf("\n\"%s\" is a single patch, dimensions %d x %d",W_CheckNameForNumPwad((UINT16)w,texstart+j),patchlump->width, patchlump->height); - if (SHORT(patchlump->width) == 64 - && SHORT(patchlump->height) == 64) - { // 64x64 patch - const column_t *column; - for (k = 0; k < SHORT(patchlump->width); k++) - { // Find use of transparency. - column = (const column_t *)((const UINT8 *)patchlump + LONG(patchlump->columnofs[k])); - if (column->length != SHORT(patchlump->height)) - break; - } - if (k == SHORT(patchlump->width)) - patchcount = 2; // No transparency? 64x128 texture. - } - texture = textures[i] = Z_Calloc(sizeof(texture_t) + (sizeof(texpatch_t) * patchcount), PU_STATIC, NULL); + texture = textures[i] = Z_Calloc(sizeof(texture_t) + sizeof(texpatch_t), PU_STATIC, NULL); // Set texture properties. M_Memcpy(texture->name, W_CheckNameForNumPwad((UINT16)w, texstart + j), sizeof(texture->name)); texture->width = SHORT(patchlump->width); - texture->height = SHORT(patchlump->height)*patchcount; - texture->patchcount = patchcount; + texture->height = SHORT(patchlump->height); + texture->patchcount = 1; texture->holes = false; // Allocate information for the texture's patches. - for (k = 0; k < patchcount; k++) - { - patch = &texture->patches[k]; + patch = &texture->patches[0]; - patch->originx = 0; - patch->originy = (INT16)(k*patchlump->height); - patch->wad = (UINT16)w; - patch->lump = texstart + j; - } + patch->originx = patch->originy = 0; + patch->wad = (UINT16)w; + patch->lump = texstart + j; Z_Unlock(patchlump); From c4d1b80e97baab75f5d34f416ff7693dbd645771 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 13 Oct 2018 17:07:30 -0400 Subject: [PATCH 129/138] Engine tweak --- src/k_kart.c | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 24acd3f2..402ee021 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3690,31 +3690,22 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_enginesnd] > 12) player->kartstuff[k_enginesnd] = 12; - // Display player's engines are quieter - if ((player == &players[displayplayer]) - || (player == &players[secondarydisplayplayer] && splitscreen) - || (player == &players[thirddisplayplayer] && splitscreen > 1) - || (player == &players[fourthdisplayplayer] && splitscreen > 2)) - volume = FixedDiv(volume<>FRACBITS; - else + for (i = 0; i < MAXPLAYERS; i++) { - for (i = 0; i < MAXPLAYERS; i++) - { - if (!playeringame[i] || !players[i].mo || players[i].spectator || players[i].exiting) - continue; - if ((i == displayplayer) - || (i == secondarydisplayplayer && splitscreen) - || (i == thirddisplayplayer && splitscreen > 1) - || (i == fourthdisplayplayer && splitscreen > 2)) - continue; - if (P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x, - player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) <= 3072< 1) - volume = FixedDiv(volume<>FRACBITS; + if (!playeringame[i] || !players[i].mo || players[i].spectator || players[i].exiting) + continue; + if (((i == displayplayer) + || (i == secondarydisplayplayer && splitscreen) + || (i == thirddisplayplayer && splitscreen > 1) + || (i == fourthdisplayplayer && splitscreen > 2)) + || (P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x, + player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) <= 3072< 1) + volume /= numcloseplayers; + S_StartSoundAtVolume(player->mo, (sfx_krta00 + player->kartstuff[k_enginesnd]) + (class*numsnds), volume); } From 6184f91dd3bd82164282c7379d457ffcea5e5a8c Mon Sep 17 00:00:00 2001 From: Sryder Date: Sat, 13 Oct 2018 23:01:11 +0100 Subject: [PATCH 130/138] Add an int to I_PlaySound to tell an interface which channel number SRB2 is using. I've voided this out on other sound interfaces than SDL Mixer ones because I'm both not sure whether they need it, and not sure how to make them work with it if they do. --- src/djgppdos/i_sound.c | 4 +++- src/dummy/i_sound.c | 3 ++- src/i_sound.h | 2 +- src/nds/i_sound.c | 3 ++- src/s_sound.c | 4 ++-- src/sdl/mixer_sound.c | 4 ++-- src/sdl/sdl_sound.c | 3 ++- src/sdl12/mixer_sound.c | 4 ++-- src/sdl12/sdl_sound.c | 3 ++- src/win32/win_snd.c | 3 ++- src/win32ce/win_snd.c | 4 +++- 11 files changed, 23 insertions(+), 14 deletions(-) diff --git a/src/djgppdos/i_sound.c b/src/djgppdos/i_sound.c index 88fc807f..f1e2ad2b 100644 --- a/src/djgppdos/i_sound.c +++ b/src/djgppdos/i_sound.c @@ -165,9 +165,11 @@ INT32 I_StartSound ( sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, - INT32 priority ) + INT32 priority + INT32 channel) { int voice; + (void)channel; if (nosound) return 0; diff --git a/src/dummy/i_sound.c b/src/dummy/i_sound.c index 51dbb610..143da186 100644 --- a/src/dummy/i_sound.c +++ b/src/dummy/i_sound.c @@ -23,13 +23,14 @@ void I_UpdateSound(void){}; // SFX I/O // -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { (void)id; (void)vol; (void)sep; (void)pitch; (void)priority; + (void)channel; return -1; } diff --git a/src/i_sound.h b/src/i_sound.h index 084479ee..098c9be1 100644 --- a/src/i_sound.h +++ b/src/i_sound.h @@ -64,7 +64,7 @@ void I_ShutdownSound(void); \return sfx handle */ -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority); +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel); /** \brief Stops a sound channel. diff --git a/src/nds/i_sound.c b/src/nds/i_sound.c index 8dea4ad7..a17c7f66 100644 --- a/src/nds/i_sound.c +++ b/src/nds/i_sound.c @@ -21,13 +21,14 @@ void I_ShutdownSound(void){} // SFX I/O // -INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority) +INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel) { (void)id; (void)vol; (void)sep; (void)pitch; (void)priority; + (void)channel; return -1; } diff --git a/src/s_sound.c b/src/s_sound.c index 76ee4c64..3b35b36f 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -529,7 +529,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) // Assigns the handle to one of the channels in the // mix/output buffer. - channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); + channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum); } dontplay: @@ -579,7 +579,7 @@ dontplay: // Assigns the handle to one of the channels in the // mix/output buffer. - channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority); + channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum); } void S_StartSound(const void *origin, sfxenum_t sfx_id) diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index cfdb3230..4b4ad3e6 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -419,10 +419,10 @@ void I_FreeSfx(sfxinfo_t *sfx) sfx->lumpnum = LUMPERROR; } -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 - INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0); + INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0); Mix_Volume(handle, volume); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); (void)pitch; // Mixer can't handle pitch diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index 6c70c163..a7c8383a 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -604,10 +604,11 @@ void I_FreeSfx(sfxinfo_t * sfx) // Pitching (that is, increased speed of playback) // is set, but currently not used by mixing. // -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { (void)priority; (void)pitch; + (void)channel; if (nosound) return 0; diff --git a/src/sdl12/mixer_sound.c b/src/sdl12/mixer_sound.c index 542a6716..daf09ab9 100644 --- a/src/sdl12/mixer_sound.c +++ b/src/sdl12/mixer_sound.c @@ -376,10 +376,10 @@ void I_FreeSfx(sfxinfo_t *sfx) sfx->data = NULL; } -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127 - INT32 handle = Mix_PlayChannel(-1, S_sfx[id].data, 0); + INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0); Mix_Volume(handle, volume); Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff)); (void)pitch; // Mixer can't handle pitch diff --git a/src/sdl12/sdl_sound.c b/src/sdl12/sdl_sound.c index 6ba83104..01a27153 100644 --- a/src/sdl12/sdl_sound.c +++ b/src/sdl12/sdl_sound.c @@ -621,10 +621,11 @@ void I_FreeSfx(sfxinfo_t * sfx) // Pitching (that is, increased speed of playback) // is set, but currently not used by mixing. // -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { (void)priority; (void)pitch; + (void)channel; if (nosound) return 0; diff --git a/src/win32/win_snd.c b/src/win32/win_snd.c index 58644457..e50a4737 100644 --- a/src/win32/win_snd.c +++ b/src/win32/win_snd.c @@ -353,12 +353,13 @@ void I_FreeSfx(sfxinfo_t *sfx) sfx->data = NULL; } -INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) +INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel) { FMOD_SOUND *sound; FMOD_CHANNEL *chan; INT32 i; float frequency; + (void)channel; sound = (FMOD_SOUND *)S_sfx[id].data; I_Assert(sound != NULL); diff --git a/src/win32ce/win_snd.c b/src/win32ce/win_snd.c index f9c65217..a58bbc3c 100644 --- a/src/win32ce/win_snd.c +++ b/src/win32ce/win_snd.c @@ -538,7 +538,8 @@ INT32 I_StartSound (sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, - INT32 priority) + INT32 priority + INT32 channel) { HRESULT hr; LPDIRECTSOUNDBUFFER dsbuffer; @@ -549,6 +550,7 @@ INT32 I_StartSound (sfxenum_t id, #ifdef SURROUND LPDIRECTSOUNDBUFFER dssurround; #endif + (void)channel; if (nosound) return -1; From 3886888b3014da650aa2ae5bd843b8ef7dcea28f Mon Sep 17 00:00:00 2001 From: Sryder Date: Sun, 14 Oct 2018 10:14:07 +0100 Subject: [PATCH 131/138] Fix missing commas and missed interface --- src/android/i_sound.c | 3 ++- src/djgppdos/i_sound.c | 2 +- src/win32ce/win_snd.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/android/i_sound.c b/src/android/i_sound.c index ecf96f2f..77f8e6a5 100644 --- a/src/android/i_sound.c +++ b/src/android/i_sound.c @@ -21,13 +21,14 @@ void I_ShutdownSound(void){} // SFX I/O // -INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority) +INT32 I_StartSound(sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, INT32 priority, INT32 channel) { (void)id; (void)vol; (void)sep; (void)pitch; (void)priority; + (void)channel; return -1; } diff --git a/src/djgppdos/i_sound.c b/src/djgppdos/i_sound.c index f1e2ad2b..ec6f4412 100644 --- a/src/djgppdos/i_sound.c +++ b/src/djgppdos/i_sound.c @@ -165,7 +165,7 @@ INT32 I_StartSound ( sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, - INT32 priority + INT32 priority, INT32 channel) { int voice; diff --git a/src/win32ce/win_snd.c b/src/win32ce/win_snd.c index a58bbc3c..14ce4add 100644 --- a/src/win32ce/win_snd.c +++ b/src/win32ce/win_snd.c @@ -538,7 +538,7 @@ INT32 I_StartSound (sfxenum_t id, INT32 vol, INT32 sep, INT32 pitch, - INT32 priority + INT32 priority, INT32 channel) { HRESULT hr; From 880e4c06313feee422d09da72d065e2ea2e5d326 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 14 Oct 2018 22:32:34 +0100 Subject: [PATCH 132/138] Final weather stuff. * Multiplied rain speed by 3, per Oni's request. * Disable weather density - force to 1 if weather draw distance, otherwise zero * Move the ceilingpic check into a more convenient part of the weather spawning loop. * `drawdist_precip_cons_t` - replaces "Infinite" with "None". * Disable the lowest normal draw distance (256), given... both kart and srb2 are basically unplayable like that. * Disable cv_drawdist_nights entirely. --- src/hardware/hw_main.c | 2 +- src/info.c | 2 +- src/m_menu.c | 12 ++++++------ src/p_mobj.c | 23 ++++++++--------------- src/r_main.c | 23 ++++++++++++++++------- src/r_main.h | 2 +- src/r_things.c | 2 +- 7 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 2a23a4d6..c0a3514e 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -5147,7 +5147,7 @@ static void HWR_AddSprites(sector_t *sec, UINT8 ssplayer) // Handle all things in sector. // If a limit exists, handle things a tiny bit different. - if ((limit_dist = (fixed_t)((maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : cv_drawdist.value) << FRACBITS)) + if ((limit_dist = (fixed_t)(/*(maptol & TOL_NIGHTS) ? cv_drawdist_nights.value : */cv_drawdist.value) << FRACBITS)) { for (thing = sec->thinglist; thing; thing = thing->snext) { diff --git a/src/info.c b/src/info.c index 40327462..932ff21a 100644 --- a/src/info.c +++ b/src/info.c @@ -10755,7 +10755,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL, // deathstate S_NULL, // xdeathstate sfx_None, // deathsound - -24*FRACUNIT, // speed + -72*FRACUNIT, // speed -- -24*FRACUNIT originally, srb2kart x3 (nya) 1*FRACUNIT, // radius 8*FRACUNIT, // height 0, // display offset diff --git a/src/m_menu.c b/src/m_menu.c index 03e74a9a..2f848a2a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1255,14 +1255,14 @@ static menuitem_t OP_VideoOptionsMenu[] = {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 45}, //{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 55}, {IT_STRING | IT_CVAR, NULL, "Weather Draw Distance",&cv_drawdist_precip, 55}, - {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 65}, - {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 75}, + //{IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 65}, + {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 65}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 90}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100}, + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 80}, + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 90}, #ifdef HWRENDER - {IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 115}, + {IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 105}, #endif }; @@ -1275,7 +1275,7 @@ enum op_video_gamma, op_video_dd, op_video_wdd, - op_video_wd, + //op_video_wd, op_video_skybox, op_video_fps, op_video_vsync, diff --git a/src/p_mobj.c b/src/p_mobj.c index face1cd3..32ac6550 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -9744,13 +9744,12 @@ consvar_t cv_suddendeath = {"suddendeath", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, void P_SpawnPrecipitation(void) { - INT32 i, j, mrand; + INT32 i, mrand; fixed_t basex, basey, x, y, height; subsector_t *precipsector = NULL; precipmobj_t *rainmo = NULL; - if (dedicated || !cv_precipdensity.value || curWeather == PRECIP_NONE - || netgame) // SRB2Kart + if (dedicated || /*!cv_precipdensity*/!cv_drawdist_precip.value || curWeather == PRECIP_NONE) // SRB2Kart return; // Use the blockmap to narrow down our placing patterns @@ -9759,7 +9758,7 @@ void P_SpawnPrecipitation(void) basex = bmaporgx + (i % bmapwidth) * MAPBLOCKSIZE; basey = bmaporgy + (i / bmapwidth) * MAPBLOCKSIZE; - for (j = 0; j < cv_precipdensity.value; ++j) + //for (j = 0; j < cv_precipdensity.value; ++j) -- density is 1 for kart always { x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<>3); y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<>3); @@ -9769,7 +9768,11 @@ void P_SpawnPrecipitation(void) // No sector? Stop wasting time, // move on to the next entry in the blockmap if (!precipsector) - break; + continue; + + // Not in a sector with visible sky? + if (precipsector->sector->ceilingpic != skyflatnum) + continue; // Exists, but is too small for reasonable precipitation. if (!(precipsector->sector->floorheight <= precipsector->sector->ceilingheight - (32<sector->ceilingpic != skyflatnum) - continue; - rainmo = P_SpawnSnowMobj(x, y, height, MT_SNOWFLAKE); mrand = M_RandomByte(); if (mrand < 64) @@ -9792,13 +9791,7 @@ void P_SpawnPrecipitation(void) P_SetPrecipMobjState(rainmo, S_SNOW2); } else // everything else. - { - // Not in a sector with visible sky. - if (precipsector->sector->ceilingpic != skyflatnum) - continue; - rainmo = P_SpawnRainMobj(x, y, height, MT_RAIN); - } // Randomly assign a height, now that floorz is set. rainmo->z = M_RandomRange(rainmo->floorz>>FRACBITS, rainmo->ceilingz>>FRACBITS)<thinglist; thing; thing = thing->snext) { From 6098a36bfe9d1d3ca136277bfee77a42e680e933 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 14 Oct 2018 23:13:11 +0100 Subject: [PATCH 133/138] More sensible `drawdist_precip_cons_t` maximum (slightly more conservative than Sryder's suggestion) --- src/r_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/r_main.c b/src/r_main.c index 68d9cf4d..bd1cd477 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -132,8 +132,7 @@ static CV_PossibleValue_t drawdist_cons_t[] = { static CV_PossibleValue_t drawdist_precip_cons_t[] = { {256, "256"}, {512, "512"}, {768, "768"}, {1024, "1024"}, {1536, "1536"}, {2048, "2048"}, - {3072, "3072"}, {4096, "4096"}, {6144, "6144"}, - {8192, "8192"}, {0, "None"}, {0, NULL}}; + {0, "None"}, {0, NULL}}; //static CV_PossibleValue_t precipdensity_cons_t[] = {{0, "None"}, {1, "Light"}, {2, "Moderate"}, {4, "Heavy"}, {6, "Thick"}, {8, "V.Thick"}, {0, NULL}}; static CV_PossibleValue_t translucenthud_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}}; From d158b3848e90ed4cacf8c0da41a51cf44867a5fe Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 15 Oct 2018 19:05:23 -0400 Subject: [PATCH 134/138] Fix the earlier attempt at patching over this --- src/g_game.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 8d706bbf..aee0d255 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3413,6 +3413,8 @@ static void G_DoCompleted(void) // nextmap is 0-based, unlike gamemap if (nextmapoverride != 0) nextmap = (INT16)(nextmapoverride-1); + else if (mapheaderinfo[gamemap-1]->nextlevel == 1101) // SRB2Kart: !!! WHENEVER WE GET GRAND PRIX, GO TO AWARDS MAP INSTEAD !!! + nextmap = (INT16)(mapheaderinfo[gamemap] ? gamemap : (spstage_start-1)); // (gamemap-1)+1 == gamemap :V else nextmap = (INT16)(mapheaderinfo[gamemap-1]->nextlevel-1); @@ -3441,9 +3443,6 @@ static void G_DoCompleted(void) else cm = (INT16)(mapheaderinfo[cm]->nextlevel-1); - if (cm == 1100-1) // !!! WHENEVER WE GET GRAND PRIX, GO TO AWARDS MAP INSTEAD !!! - cm = cm+1; - if (cm >= NUMMAPS || cm < 0) // out of range (either 1100-1102 or error) { cm = nextmap; //Start the loop again so that the error checking below is executed. From 496e0df9d048dcd8fbcb6cce970df1b93056e577 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Mon, 15 Oct 2018 23:13:59 -0400 Subject: [PATCH 135/138] Smoother NOW this is good enough to ship --- src/k_kart.c | 37 ++++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 402ee021..fccb6867 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3651,8 +3651,8 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) { const INT32 numsnds = 13; INT32 class = ((player->kartspeed-1)/3) + (3*((player->kartweight-1)/3)); // engine class number - INT32 numcloseplayers = 0; UINT8 volume = 255; + fixed_t volumedampen = 0; INT32 targetsnd = 0; INT32 i; @@ -3692,19 +3692,42 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd) for (i = 0; i < MAXPLAYERS; i++) { + UINT8 thisvol = 0; + fixed_t dist; + if (!playeringame[i] || !players[i].mo || players[i].spectator || players[i].exiting) continue; - if (((i == displayplayer) + + if ((i == displayplayer) || (i == secondarydisplayplayer && splitscreen) || (i == thirddisplayplayer && splitscreen > 1) || (i == fourthdisplayplayer && splitscreen > 2)) - || (P_AproxDistance(P_AproxDistance(player->mo->x-players[i].mo->x, - player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) <= 3072<mo->x-players[i].mo->x, + player->mo->y-players[i].mo->y), player->mo->z-players[i].mo->z) / 2; + + if (dist > 1536<>FRACBITS)) / (((1536<>(FRACBITS+4)); + + if (thisvol == 0) + continue; + + volumedampen += (thisvol * 257); // 255 * 257 = FRACUNIT } - if (numcloseplayers > 1) - volume /= numcloseplayers; + if (volumedampen > FRACUNIT) + volume = FixedDiv(volume<>FRACBITS; + + if (volume <= 0) // Might as well + return; S_StartSoundAtVolume(player->mo, (sfx_krta00 + player->kartstuff[k_enginesnd]) + (class*numsnds), volume); } From 5701fe8a51cba33eeed72e3659567828dd8f175a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Oct 2018 12:30:47 -0400 Subject: [PATCH 136/138] Give engines SF_TOTALLYSINGLE, and bug-fix it so that it can work like a flag Sryder's request --- src/s_sound.c | 2 +- src/sounds.c | 234 +++++++++++++++++++++++++------------------------- 2 files changed, 118 insertions(+), 118 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index 74cca98a..7b9f0597 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -186,7 +186,7 @@ static INT32 S_getChannel(const void *origin, sfxinfo_t *sfxinfo) } else if (origin && channels[cnum].origin == origin && channels[cnum].sfxinfo->name != sfxinfo->name - && channels[cnum].sfxinfo->pitch == SF_TOTALLYSINGLE && sfxinfo->pitch == SF_TOTALLYSINGLE) + && (channels[cnum].sfxinfo->pitch & SF_TOTALLYSINGLE) && (sfxinfo->pitch & SF_TOTALLYSINGLE)) { S_StopChannel(cnum); break; diff --git a/src/sounds.c b/src/sounds.c index 75c0793c..69413978 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -820,131 +820,131 @@ sfxinfo_t S_sfx[NUMSFX] = // SRB2Kart - Engine sounds // Engine class A - {"krta00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krta12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krta12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class B - {"krtb00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtb12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtb12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class C - {"krtc00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtc12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtc12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class D - {"krtd00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtd12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtd12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class E - {"krte00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krte12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krte12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class F - {"krtf00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtf12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtf12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class G - {"krtg00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krtg12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krtg12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class H - {"krth00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krth12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krth12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // Engine class I - {"krti00", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti01", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti02", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti03", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti04", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti05", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti06", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti07", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti08", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti09", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti10", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti11", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, - {"krti12", false, 48, 64, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti01", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti02", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti03", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti04", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti05", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti06", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti07", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti08", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti09", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti10", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti11", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, + {"krti12", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR}, // SRB2kart - Skin sounds {"kwin", false, 64, 96, -1, NULL, 0, SKSKWIN, -1, LUMPERROR}, From b23a79897887891e7eeea12eed82c61eb982ab7a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Oct 2018 12:48:46 -0400 Subject: [PATCH 137/138] 1 minor, non-engine related change I wanted to make while I was at it: Minor priority change to two voice lines; the "passing someone" line has the same priority as every other line, and gave it's boosted priority to the way more gameplay-important "hit 'em" line. --- src/sounds.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sounds.c b/src/sounds.c index 69413978..02ad0853 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -955,8 +955,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"kattk2", false, 64, 96, -1, NULL, 0, SKSKATK2, -1, LUMPERROR}, {"kbost1", false, 64, 96, -1, NULL, 0, SKSKBST1, -1, LUMPERROR}, {"kbost2", false, 64, 96, -1, NULL, 0, SKSKBST2, -1, LUMPERROR}, - {"kslow", false, 128, 32, -1, NULL, 0, SKSKSLOW, -1, LUMPERROR}, - {"khitem", false, 64, 32, -1, NULL, 0, SKSKHITM, -1, LUMPERROR}, + {"kslow", false, 64, 32, -1, NULL, 0, SKSKSLOW, -1, LUMPERROR}, + {"khitem", false, 128, 32, -1, NULL, 0, SKSKHITM, -1, LUMPERROR}, {"kgloat", false, 64, 48, -1, NULL, 0, SKSKPOWR, -1, LUMPERROR}, // skin sounds free slots to add sounds at run time (Boris HACK!!!) From a919260fd28d9e088245563170da680f12c8e5a6 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 16 Oct 2018 13:26:03 -0400 Subject: [PATCH 138/138] Default sound channels Now that we figured out that the sound cut-outs were due to a race condition and not this option, I feel content putting it with these other engine tweaks. --- src/s_sound.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.c b/src/s_sound.c index 7b9f0597..ba137a3d 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -85,7 +85,7 @@ consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons #if defined (_WIN32_WCE) || defined (DC) || defined (PSP) || defined(GP2X) consvar_t cv_numChannels = {"snd_channels", "8", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; #else -consvar_t cv_numChannels = {"snd_channels", "32", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_numChannels = {"snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL}; #endif consvar_t surround = {"surround", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};