From 3838700f2c1fe33aae26ad7db920a923f99551be Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 22 Aug 2019 15:18:14 -0700 Subject: [PATCH 01/20] Save bans when cleared too (Why doesn't it work for I_Quit?) --- src/d_clisrv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 213f5dde..9a2d1877 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2465,6 +2465,7 @@ static void Command_ClearBans(void) return; I_ClearBans(); + D_SaveBan(); reasontail = NULL; while (reasonhead) { From fe4cbd7ba1292dd498121cf7fa29f1f91e7ab32a Mon Sep 17 00:00:00 2001 From: filpAM Date: Fri, 13 Sep 2019 13:20:44 -0400 Subject: [PATCH 02/20] Fix "NOMIXER" flag compiling --- src/sdl/sdl_sound.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sdl/sdl_sound.c b/src/sdl/sdl_sound.c index d9967ae0..4bb1b567 100644 --- a/src/sdl/sdl_sound.c +++ b/src/sdl/sdl_sound.c @@ -1173,7 +1173,10 @@ void I_StartupSound(void) const char *sdrv_name = NULL; #endif #ifndef HAVE_MIXER - midi_disabled = digital_disabled = true; +#ifndef NO_MIDI + midi_disabled = +#endif + digital_disabled = true; #endif memset(channels, 0, sizeof (channels)); //Alam: Clean it From 3801f931811a9c8811c3ac43afaa221ddfc70454 Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 15 Sep 2019 00:32:01 -0700 Subject: [PATCH 03/20] Let first person camera work in demos --- src/r_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_main.c b/src/r_main.c index 358a24bb..faf03c4b 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1143,7 +1143,7 @@ void R_SetupFrame(player_t *player, boolean skybox) aimingangle = player->aiming; viewangle = viewmobj->angle; - if (/*!demo.playback && */player->playerstate != PST_DEAD) + if (!demo.playback && player->playerstate != PST_DEAD) { if (player == &players[consoleplayer]) { From 5e9082fb77ec21e9e1b5b12e36fd7e883b8c01b5 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 19 Sep 2019 20:29:51 -0700 Subject: [PATCH 04/20] Also apply HUD translucency to FREE PLAY --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 10d772ba..bf938232 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -8634,7 +8634,7 @@ void K_drawKartFreePlay(UINT32 flashtime) return; V_DrawKartString((BASEVIDWIDTH - (LAPS_X+1)) - (12*9), // mirror the laps thingy - LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT, "FREE PLAY"); + LAPS_Y+3, V_SNAPTOBOTTOM|V_SNAPTORIGHT|V_HUDTRANS, "FREE PLAY"); } static void K_drawDistributionDebugger(void) From abaefa05b1e3fd6026ec99d66985ed55b9ca6abd Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 7 Oct 2019 17:55:31 -0700 Subject: [PATCH 05/20] ferror does not return errno, are you stupid? Use M_FileError to return the proper error description, or "end-of-file". --- src/d_netfil.c | 4 ++-- src/m_argv.c | 2 +- src/m_misc.c | 10 ++++++++++ src/m_misc.h | 2 ++ src/sdl12/sdl_sound.c | 2 +- src/w_wad.c | 12 ++++++------ 6 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/d_netfil.c b/src/d_netfil.c index 76b66836..b72d9c55 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -743,7 +743,7 @@ void SV_FileSendTicker(void) if (ram) M_Memcpy(p->data, &f->id.ram[transfer[i].position], size); else if (fread(p->data, 1, size, transfer[i].currentfile) != size) - I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s", sizeu1(size), f->id.filename, transfer[i].position, strerror(ferror(transfer[i].currentfile))); + I_Error("SV_FileSendTicker: can't read %s byte on %s at %d because %s", sizeu1(size), f->id.filename, transfer[i].position, M_FileError(transfer[i].currentfile)); p->position = LONG(transfer[i].position); // Put flag so receiver knows the total size if (transfer[i].position + size == f->size) @@ -822,7 +822,7 @@ void Got_Filetxpak(void) // We can receive packet in the wrong order, anyway all os support gaped file fseek(file->file, pos, SEEK_SET); if (fwrite(netbuffer->u.filetxpak.data,size,1,file->file) != 1) - I_Error("Can't write to %s: %s\n",filename, strerror(ferror(file->file))); + I_Error("Can't write to %s: %s\n",filename, M_FileError(file->file)); file->currentsize += size; // Finished? diff --git a/src/m_argv.c b/src/m_argv.c index e8bfdd3d..a23f938a 100644 --- a/src/m_argv.c +++ b/src/m_argv.c @@ -166,7 +166,7 @@ void M_FindResponseFile(void) if (!file) I_Error("No more free memory for the response file"); if (fread(file, size, 1, handle) != 1) - I_Error("Couldn't read response file because %s", strerror(ferror(handle))); + I_Error("Couldn't read response file because %s", M_FileError(handle)); fclose(handle); // keep all the command line arguments following @responsefile diff --git a/src/m_misc.c b/src/m_misc.c index f4a4ec29..b83d4034 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -2355,3 +2355,13 @@ void M_SetupMemcpy(void) M_Memcpy = cpu_cpy; #endif } + +/** Return the appropriate message for a file error or end of file. +*/ +const char *M_FileError(FILE *fp) +{ + if (ferror(fp)) + return strerror(errno); + else + return "end-of-file"; +} diff --git a/src/m_misc.h b/src/m_misc.h index 658028b4..1e7befb1 100644 --- a/src/m_misc.h +++ b/src/m_misc.h @@ -100,6 +100,8 @@ void strcatbf(char *s1, const char *s2, const char *s3); void M_SetupMemcpy(void); +const char *M_FileError(FILE *handle); + // counting bits, for weapon ammo code, usually FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size); diff --git a/src/sdl12/sdl_sound.c b/src/sdl12/sdl_sound.c index ed1afd8e..1a7525fe 100644 --- a/src/sdl12/sdl_sound.c +++ b/src/sdl12/sdl_sound.c @@ -1435,7 +1435,7 @@ static boolean LoadSong(void *data, size_t lumplength, size_t selectpos) if (fwrite(data, lumplength, 1, midfile) == 0) { - CONS_Printf(M_GetText("Couldn't write music into file %s because %s\n"), tempname, strerror(ferror(midfile))); + CONS_Printf(M_GetText("Couldn't write music into file %s because %s\n"), tempname, M_FileError(midfile)); Z_Free(data); fclose(midfile); return false; diff --git a/src/w_wad.c b/src/w_wad.c index da82a276..73430895 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -366,7 +366,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen // read the header if (fread(&header, 1, sizeof header, handle) < sizeof header) { - CONS_Alert(CONS_ERROR, M_GetText("Can't read wad header because %s\n"), strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, M_GetText("Can't read wad header because %s\n"), M_FileError(handle)); return NULL; } @@ -389,7 +389,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen if (fseek(handle, header.infotableofs, SEEK_SET) == -1 || fread(fileinfo, 1, i, handle) < i) { - CONS_Alert(CONS_ERROR, M_GetText("Corrupt wadfile directory (%s)\n"), strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, M_GetText("Corrupt wadfile directory (%s)\n"), M_FileError(handle)); free(fileinfov); return NULL; } @@ -410,7 +410,7 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen handle) < sizeof realsize) { I_Error("corrupt compressed file: %s; maybe %s", /// \todo Avoid the bailout? - filename, strerror(ferror(handle))); + filename, M_FileError(handle)); } realsize = LONG(realsize); if (realsize != 0) @@ -548,7 +548,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) fseek(handle, -4, SEEK_CUR); if (fread(&zend, 1, sizeof zend, handle) < sizeof zend) { - CONS_Alert(CONS_ERROR, "Corrupt central directory (%s)\n", strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, "Corrupt central directory (%s)\n", M_FileError(handle)); return NULL; } numlumps = zend.entries; @@ -565,7 +565,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) if (fread(zentry, 1, sizeof(zentry_t), handle) < sizeof(zentry_t)) { - CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", M_FileError(handle)); Z_Free(lumpinfo); free(zentry); return NULL; @@ -585,7 +585,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp) fullname = malloc(zentry->namelen + 1); if (fgets(fullname, zentry->namelen + 1, handle) != fullname) { - CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", strerror(ferror(handle))); + CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", M_FileError(handle)); Z_Free(lumpinfo); free(zentry); free(fullname); From 1d6020883c129f2ed51ab4a712b7c9f4e405dae0 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 7 Oct 2019 18:10:33 -0700 Subject: [PATCH 06/20] Forgot includes --- src/m_argv.c | 1 + src/m_misc.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/m_argv.c b/src/m_argv.c index a23f938a..e1046f8a 100644 --- a/src/m_argv.c +++ b/src/m_argv.c @@ -16,6 +16,7 @@ #include "doomdef.h" #include "command.h" #include "m_argv.h" +#include "m_misc.h" /** \brief number of arg */ diff --git a/src/m_misc.c b/src/m_misc.c index b83d4034..a8c55be5 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -23,6 +23,8 @@ #include #endif +#include + // Extended map support. #include From db5cb986ee641bfba7f13ff81397d88af7509274 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 14 Apr 2019 16:39:14 +0100 Subject: [PATCH 07/20] Detect infinite alias self-recursion mixed with other commands, such as in the case of `alias a "echo test; a"; a`. (Unfortunately, this does not work if "wait" is used instead of "echo", but oh well) (cherry picked from commit 797ca99f42a05e6f2b491983cd7f0222b9bfc519) --- src/command.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/command.c b/src/command.c index bd3a2243..95fd5ef4 100644 --- a/src/command.c +++ b/src/command.c @@ -543,10 +543,7 @@ static void COM_ExecuteString(char *ptext) if (!stricmp(com_argv[0], a->name)) { if (recursion > MAX_ALIAS_RECURSION) - { CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n")); - recursion = 0; - } else { char buf[1024]; @@ -578,8 +575,10 @@ static void COM_ExecuteString(char *ptext) } WRITESTRING(write, read); + // Monster Iestyn: keep track of how many levels of recursion we're in recursion++; COM_BufInsertText(buf); + recursion--; } return; } From dbcbbf1ae4484b8f12d6ab0ef5b474afeb1c6de4 Mon Sep 17 00:00:00 2001 From: Sryder Date: Thu, 14 May 2020 13:16:49 +0100 Subject: [PATCH 08/20] Remove now unsupported distros from deployer Add new supported distros to deployer --- .travis.yml | 106 ++++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4959e4d2..f2693236 100644 --- a/.travis.yml +++ b/.travis.yml @@ -451,7 +451,31 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: xenial + dist: focal + if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") + AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) + AND env(DPL_TERMINATE_MAIN) != "1" + env: + - _DPL_JOB_ENABLED=1 + - _DPL_JOB_NAME=focal + - _DPL_DPUT_TARGET=1 + - _DPL_PACKAGE_SOURCE=1 + - PACKAGE_DISTRO=focal + - PACKAGE_SUBVERSION=~20.04focal + #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 + - os: linux + addons: + apt: + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - libcurl4-openssl-dev + - p7zip-full + - gcc-4.8 + compiler: gcc-4.8 + dist: bionic if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" @@ -463,6 +487,30 @@ matrix: - PACKAGE_DISTRO=bionic - PACKAGE_SUBVERSION=~18.04bionic #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 + - os: linux + addons: + apt: + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - libcurl4-openssl-dev + - p7zip-full + - gcc-4.8 + compiler: gcc-4.8 + dist: xenial + if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") + AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) + AND env(DPL_TERMINATE_MAIN) != "1" + env: + - _DPL_JOB_ENABLED=1 + - _DPL_JOB_NAME=xenial + - _DPL_DPUT_TARGET=1 + - _DPL_PACKAGE_SOURCE=1 + - PACKAGE_DISTRO=xenial + - PACKAGE_SUBVERSION=~16.04xenial + #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - os: linux addons: apt: @@ -499,65 +547,17 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: xenial + dist: bionic if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" env: - _DPL_JOB_ENABLED=1 - - _DPL_JOB_NAME=disco + - _DPL_JOB_NAME=eoan - _DPL_DPUT_TARGET=1 - _DPL_PACKAGE_SOURCE=1 - - PACKAGE_DISTRO=disco - - PACKAGE_SUBVERSION=~19.04disco - #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - - os: linux - addons: - apt: - packages: - - libsdl2-mixer-dev - - libpng-dev - - libgl1-mesa-dev - - libgme-dev - - libcurl4-openssl-dev - - p7zip-full - - gcc-4.8 - compiler: gcc-4.8 - dist: xenial - if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") - AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) - AND env(DPL_TERMINATE_MAIN) != "1" - env: - - _DPL_JOB_ENABLED=1 - - _DPL_JOB_NAME=cosmic - - _DPL_DPUT_TARGET=1 - - _DPL_PACKAGE_SOURCE=1 - - PACKAGE_DISTRO=cosmic - - PACKAGE_SUBVERSION=~18.10cosmic - #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - - os: linux - addons: - apt: - packages: - - libsdl2-mixer-dev - - libpng-dev - - libgl1-mesa-dev - - libgme-dev - - libcurl4-openssl-dev - - p7zip-full - - gcc-4.8 - compiler: gcc-4.8 - dist: xenial - if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") - AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) - AND env(DPL_TERMINATE_MAIN) != "1" - env: - - _DPL_JOB_ENABLED=1 - - _DPL_JOB_NAME=xenial - - _DPL_DPUT_TARGET=1 - - _DPL_PACKAGE_SOURCE=1 - - PACKAGE_DISTRO=xenial - - PACKAGE_SUBVERSION=~16.04xenial + - PACKAGE_DISTRO=eoan + - PACKAGE_SUBVERSION=~19.10eoan #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 allow_failures: - compiler: clang-3.5 From 05c8865528bec9edbc8f2ceb48ca66c3bdd546dc Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:37:15 +0100 Subject: [PATCH 09/20] make savegamename in doomdef.h an extern, put the actual definition in d_main.c (cherry picked from commit 89cd756cd83e4a03a34d1f16da18142d8167d889) --- src/d_main.c | 2 ++ src/doomdef.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index 15116b53..5acfb610 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -143,6 +143,8 @@ boolean advancedemo; INT32 debugload = 0; #endif +char savegamename[256]; + #ifdef _arch_dreamcast char srb2home[256] = "/cd"; char srb2path[256] = "/cd"; diff --git a/src/doomdef.h b/src/doomdef.h index ed41e346..392ba760 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -506,7 +506,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG; // Things that used to be in dstrings.h #define SAVEGAMENAME "srb2sav" -char savegamename[256]; +extern char savegamename[256]; // m_misc.h #ifdef GETTEXT From f89400c7282854bf89493d7ddd40167869f2878b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:40:51 +0100 Subject: [PATCH 10/20] turn all non-extern variables in s_sound.h into externs (and put their real definitions in the .c file) (cherry picked from commit dab212dc56936dd92a935d0c81003ff1d35ee2ee) --- src/s_sound.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.h b/src/s_sound.h index 2a904faf..eeb1f0ab 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -236,7 +236,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum); #ifdef MUSICSLOT_COMPATIBILITY // For compatibility with code/scripts relying on older versions // This is a list of all the "special" slot names and their associated numbers -const char *compat_special_music_slots[16]; +extern const char *compat_special_music_slots[16]; #endif #endif From 697c7f859efe0850ac71fa64983da4eac26cec1b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:42:16 +0100 Subject: [PATCH 11/20] added missing extern keyword for ms_RoomId in mserv.h (the definition is already in the .c file in this case) (cherry picked from commit 064f4bcf349e9600552a0b99bd0fbfb3cbcf0958) --- src/mserv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mserv.h b/src/mserv.h index 09cd4f08..8f8152a7 100644 --- a/src/mserv.h +++ b/src/mserv.h @@ -68,7 +68,7 @@ extern consvar_t cv_masterserver, cv_servername; // < 0 to not connect (usually -1) (offline mode) // == 0 to show all rooms, not a valid hosting room // anything else is whatever room the MS assigns to that number (online mode) -INT16 ms_RoomId; +extern INT16 ms_RoomId; const char *GetMasterServerPort(void); const char *GetMasterServerIP(void); From 6bd6b3f38e81bae3704815febcb086c5d3f0acec Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 15 May 2020 10:00:05 -0700 Subject: [PATCH 12/20] Add missing extern to colortranslations --- src/k_kart.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.h b/src/k_kart.h index 2ba5d1bd..86ae0fcc 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -11,7 +11,7 @@ #define KART_FULLTURN 800 -UINT8 colortranslations[MAXTRANSLATIONS][16]; +extern UINT8 colortranslations[MAXTRANSLATIONS][16]; extern const char *KartColor_Names[MAXSKINCOLORS]; extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2]; void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor); From e0aa6ef252d707cff68ce0dd51a3debec5765a39 Mon Sep 17 00:00:00 2001 From: Sryder Date: Sat, 16 May 2020 00:02:33 +0100 Subject: [PATCH 13/20] Use bionic to build focal version because it has GCC 4.8? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f2693236..38014525 100644 --- a/.travis.yml +++ b/.travis.yml @@ -451,7 +451,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: focal + dist: bionic if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" From 5acafa5a87e1a4411aa540a879f6814ec5baf5db Mon Sep 17 00:00:00 2001 From: filpAM Date: Sat, 16 May 2020 00:20:52 +0000 Subject: [PATCH 14/20] Fix visplane getting allocated twice --- src/r_plane.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_plane.c b/src/r_plane.c index db5bfbda..659481ec 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -402,7 +402,7 @@ static visplane_t *new_visplane(unsigned hash) visplane_t *check = freetail; if (!check) { - check = calloc(2, sizeof (*check)); + check = calloc(1, sizeof (*check)); if (check == NULL) I_Error("%s: Out of memory", "new_visplane"); // FIXME: ugly } else From c3e1e1df2624ebdf4dcdb03dbf2f27745054dea1 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Tue, 31 Mar 2020 19:42:15 +0300 Subject: [PATCH 15/20] Fix wrong orientation some boost pads in ogl --- src/hardware/hw_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 1bad26ee..c7ff5a4a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -407,7 +407,7 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei if (angle) // Only needs to be done if there's an altered angle { - angle = (InvAngle(angle)+ANGLE_180)>>ANGLETOFINESHIFT; + angle = InvAngle(angle)>>ANGLETOFINESHIFT; // This needs to be done so that it scrolls in a different direction after rotation like software /*tempxsow = FLOAT_TO_FIXED(scrollx); @@ -439,7 +439,7 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei tempxsow = FLOAT_TO_FIXED(v3d->s); tempytow = FLOAT_TO_FIXED(v3d->t); v3d->s = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); - v3d->t = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle)))); + v3d->t = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle)))); } //v3d->s = (float)(v3d->s - flatxref + scrollx); From bca1dd42a3ef30a869d0c3868caba187eb10ffd5 Mon Sep 17 00:00:00 2001 From: Sryder Date: Tue, 19 May 2020 20:45:49 +0100 Subject: [PATCH 16/20] Use xenial to build all the versions newer than trusty I'm not 100% sure why we can't use newer series to build the newer installers. But this seems to be what vanilla does --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 38014525..66349890 100644 --- a/.travis.yml +++ b/.travis.yml @@ -451,7 +451,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: bionic + dist: xenial if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" @@ -475,7 +475,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: bionic + dist: xenial if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" @@ -547,7 +547,7 @@ matrix: - p7zip-full - gcc-4.8 compiler: gcc-4.8 - dist: bionic + dist: xenial if: env(DPL_ENABLED) = "1" AND (env(_DPL_JOB_ENABLED) = "1" OR env(DPL_JOB_ENABLE_ALL) = "1") AND (branch =~ /^.*deployer.*$/ OR (tag IS present AND env(DPL_TAG_ENABLED) = "1")) AND env(DPL_TERMINATE_MAIN) != "1" From 290abe4fced997e47730318e2d3b87cc66db9a99 Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 20 May 2020 11:37:38 +0100 Subject: [PATCH 17/20] D_ModifierKeyResponder is unused now so remove it. --- src/d_main.c | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 5acfb610..85b363e0 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -187,35 +187,6 @@ UINT8 shiftdown = 0; // 0x1 left, 0x2 right UINT8 ctrldown = 0; // 0x1 left, 0x2 right UINT8 altdown = 0; // 0x1 left, 0x2 right boolean capslock = 0; // gee i wonder what this does. -// -// D_ModifierKeyResponder -// Sets global shift/ctrl/alt variables, never actually eats events -// -static inline void D_ModifierKeyResponder(event_t *ev) -{ - if (ev->type == ev_keydown || ev->type == ev_console) switch (ev->data1) - { - case KEY_LSHIFT: shiftdown |= 0x1; return; - case KEY_RSHIFT: shiftdown |= 0x2; return; - case KEY_LCTRL: ctrldown |= 0x1; return; - case KEY_RCTRL: ctrldown |= 0x2; return; - case KEY_LALT: altdown |= 0x1; return; - case KEY_RALT: altdown |= 0x2; return; - case KEY_CAPSLOCK: capslock = !capslock; return; - - default: return; - } - else if (ev->type == ev_keyup) switch (ev->data1) - { - case KEY_LSHIFT: shiftdown &= ~0x1; return; - case KEY_RSHIFT: shiftdown &= ~0x2; return; - case KEY_LCTRL: ctrldown &= ~0x1; return; - case KEY_RCTRL: ctrldown &= ~0x2; return; - case KEY_LALT: altdown &= ~0x1; return; - case KEY_RALT: altdown &= ~0x2; return; - default: return; - } -} // // D_ProcessEvents @@ -282,7 +253,7 @@ static void D_Display(void) { if (nodrawers) return; // for comparative timing/profiling - + // check for change of screen size (video mode) if (setmodeneeded && !wipe) SCR_SetMode(); // change video mode From 66930a0277919e75b95545e5cf24aa665769e80b Mon Sep 17 00:00:00 2001 From: Sryder Date: Wed, 20 May 2020 11:47:22 +0100 Subject: [PATCH 18/20] Initialise these to 0 just to stop GCC 4.4 from complaining. This should be okay since 0 generally means "nothing" for these, and they should always be set before being used later on. --- src/hardware/r_opengl/r_opengl.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 5dc46099..e0503ba0 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -823,7 +823,7 @@ EXPORT boolean HWRAPI(LoadShaders) (void) #ifdef GL_SHADERS GLuint gl_vertShader, gl_fragShader; GLint i, result; - + if (!pglUseProgram) return false; gl_customvertexshaders[0] = NULL; @@ -2002,11 +2002,11 @@ EXPORT void HWRAPI(RenderBatches) (int *sNumPolys, int *sNumVerts, int *sNumCall boolean stopFlag = false; boolean changeState = false; boolean changeShader = false; - GLuint nextShader; + GLuint nextShader = 0U; boolean changeTexture = false; - GLuint nextTexture; + GLuint nextTexture = 0U; boolean changePolyFlags = false; - FBITFIELD nextPolyFlags; + FBITFIELD nextPolyFlags = 0U; boolean changeSurfaceInfo = false; FSurfaceInfo nextSurfaceInfo; @@ -2307,7 +2307,7 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI pglColor4ubv((GLubyte*)&pSurf->PolyColor.s); } - + // Tint color tint.red = byte2float[pSurf->TintColor.s.red]; tint.green = byte2float[pSurf->TintColor.s.green]; From 3f3cb2c97637cff11f0f67e2ee84e8b28258c188 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 23 May 2020 16:21:26 -0400 Subject: [PATCH 19/20] Fix opengl crashing on startup due to lack of checks Also fixes the log file not being written to the home directory. --- src/hardware/r_opengl/r_opengl.c | 16 ++++++++-------- src/sdl/ogl_sdl.c | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index e0503ba0..eef723e5 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -143,7 +143,7 @@ static const GLfloat byte2float[256] = { // -----------------+ #ifdef DEBUG_TO_FILE -FILE *gllogstream; +FILE *gllogstream = NULL; #endif FUNCPRINTF void GL_DBG_Printf(const char *format, ...) @@ -152,14 +152,14 @@ FUNCPRINTF void GL_DBG_Printf(const char *format, ...) char str[4096] = ""; va_list arglist; - if (!gllogstream) - gllogstream = fopen("ogllog.txt", "w"); + if (gllogstream) + { + va_start(arglist, format); + vsnprintf(str, 4096, format, arglist); + va_end(arglist); - va_start(arglist, format); - vsnprintf(str, 4096, format, arglist); - va_end(arglist); - - fwrite(str, strlen(str), 1, gllogstream); + fwrite(str, strlen(str), 1, gllogstream); + } #else (void)format; #endif diff --git a/src/sdl/ogl_sdl.c b/src/sdl/ogl_sdl.c index b006047f..eb8e12cb 100644 --- a/src/sdl/ogl_sdl.c +++ b/src/sdl/ogl_sdl.c @@ -33,6 +33,7 @@ #endif #include "../doomdef.h" +#include "../d_main.h" #ifdef HWRENDER #include "../hardware/r_opengl/r_opengl.h" @@ -154,11 +155,26 @@ boolean OglSdlSurface(INT32 w, INT32 h) { INT32 cbpp = cv_scr_depth.value < 16 ? 16 : cv_scr_depth.value; static boolean first_init = false; + const char *gllogdir = NULL; oglflags = 0; if (!first_init) { + if (!gllogstream) + { + gllogdir = D_Home(); + +#ifdef DEBUG_TO_FILE +#ifdef DEFAULTDIR + if (gllogdir) + gllogstream = fopen(va("%s/"DEFAULTDIR"/ogllog.txt",gllogdir), "wt"); + else +#endif + gllogstream = fopen("./ogllog.txt", "wt"); +#endif + } + gl_version = pglGetString(GL_VERSION); gl_renderer = pglGetString(GL_RENDERER); gl_extensions = pglGetString(GL_EXTENSIONS); From d9e2336277eec805b66362bbed96f10c4a592646 Mon Sep 17 00:00:00 2001 From: Hannu Hanhi Date: Mon, 1 Jun 2020 21:14:17 +0300 Subject: [PATCH 20/20] Guil's encore color bugfix with some additional cleanup --- src/p_setup.c | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index decdc529..c0254bf4 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1408,7 +1408,7 @@ static void P_LoadRawSideDefs2(void *data) UINT16 i; INT32 num; size_t j; - UINT32 cr, cg, cb; + RGBA_t color; for (i = 0; i < numsides; i++) { @@ -1490,23 +1490,21 @@ static void P_LoadRawSideDefs2(void *data) // encore mode colormaps! // do it like software by aproximating a color to a palette index, and then convert it to its encore variant and then back to a color code. // do this for both the start and fade colormaps. - - cr = (HEX2INT(col[1]) << 4) + (HEX2INT(col[2]) << 0); - cg = (HEX2INT(col[3]) << 12) + (HEX2INT(col[4]) << 8); - cb = (HEX2INT(col[5]) << 20) + (HEX2INT(col[6]) << 16); + + color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]); + color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]); + color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]); #ifdef GLENCORE if (encoremap) { - j = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + j = encoremap[NearestColor(color.s.red, color.s.green, color.s.blue)]; //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation - cr = pLocalPalette[j].s.red; - cg = pLocalPalette[j].s.green; - cb = pLocalPalette[j].s.blue; + color = pLocalPalette[j]; } #endif - - sec->extra_colormap->rgba = cr + cg + cb; + + sec->extra_colormap->rgba = color.rgba; // alpha if (msd->toptexture[7]) @@ -1533,23 +1531,21 @@ static void P_LoadRawSideDefs2(void *data) col = msd->bottomtexture; // do the exact same thing as above here. - - cr = (HEX2INT(col[1]) << 4) + (HEX2INT(col[2]) << 0); - cg = (HEX2INT(col[3]) << 12) + (HEX2INT(col[4]) << 8); - cb = (HEX2INT(col[5]) << 20) + (HEX2INT(col[6]) << 16); + + color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]); + color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]); + color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]); #ifdef GLENCORE if (encoremap) { - j = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + j = encoremap[NearestColor(color.s.red, color.s.green, color.s.blue)]; //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation - cr = pLocalPalette[j].s.red; - cg = pLocalPalette[j].s.green; - cb = pLocalPalette[j].s.blue; + color = pLocalPalette[j]; } #endif - sec->extra_colormap->fadergba = cr + cg + cb; + sec->extra_colormap->fadergba = color.rgba; // alpha if (msd->bottomtexture[7])