From b418ac0acba5bec043a6612d7e43df4e4106ca18 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 22 Mar 2017 12:59:16 -0400 Subject: [PATCH 01/19] Level completion emblems Simple port of something I made for a 2.1 exe mod that Mystic mentioned needed doing on the 2.2 Priorities topic (http://mb.srb2.org/showpost.php?p=790613&postcount=4). Adds emblem type "map", which gives you an emblem upon beating the map it's for. Var sets more specific conditions; 1 for all emeralds completion, 2 for Ultimate mode completion, 3 for Perfect Bonus completion. (These can be easily removed if requested; these were added simply because it was easy to implement for modders.) Criticism on the way it's coded and/or how it is implemented is highly encouraged. Test wad is /TehRealSalt/levelemblems.wad, pre-compiled exe is /TehRealSalt/levelemblems.exe. --- src/dehacked.c | 2 ++ src/m_cond.c | 41 ++++++++++++++++++++++++++++++++++++++++- src/m_cond.h | 2 ++ src/m_menu.c | 2 ++ src/y_inter.c | 11 +++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 5ba5d75d4..cfc711fb2 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -2277,6 +2277,8 @@ static void reademblemdata(MYFILE *f, INT32 num) emblemlocations[num-1].type = ET_NGRADE; else if (fastcmp(word2, "NTIME")) emblemlocations[num-1].type = ET_NTIME; + else if (fastcmp(word2, "MAP")) + emblemlocations[num-1].type = ET_MAP; else emblemlocations[num-1].type = (UINT8)value; } diff --git a/src/m_cond.c b/src/m_cond.c index 5e23d4080..0955f9506 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -929,7 +929,7 @@ UINT8 M_CheckLevelEmblems(void) // Update Score, Time, Rings emblems for (i = 0; i < numemblems; ++i) { - if (emblemlocations[i].type <= ET_SKIN || emblemlocations[i].collected) + if (emblemlocations[i].type <= ET_SKIN || emblemlocations[i].type == ET_MAP || emblemlocations[i].collected) continue; levelnum = emblemlocations[i].level; @@ -963,6 +963,45 @@ UINT8 M_CheckLevelEmblems(void) return somethingUnlocked; } +UINT8 M_CompletionEmblems(void) // Bah! Duplication! :/ +{ + INT32 i; + INT32 embtype; + INT16 levelnum; + UINT8 res; + UINT8 somethingUnlocked = 0; + + for (i = 0; i < numemblems; ++i) + { + if (emblemlocations[i].type != ET_MAP || emblemlocations[i].collected) + continue; + + levelnum = emblemlocations[i].level; + embtype = emblemlocations[i].var; + + switch (embtype) + { + case 1: // Requires map to be beaten with all emeralds + res = ((mapvisited[levelnum - 1] & MV_ALLEMERALDS) == MV_ALLEMERALDS); + break; + case 2: // Requires map to be beaten in Ultimate mode + res = ((mapvisited[levelnum - 1] & MV_ULTIMATE) == MV_ULTIMATE); + break; + case 3: // Requires map to be beaten with a perfect bonus + res = ((mapvisited[levelnum - 1] & MV_PERFECT) == MV_PERFECT); + break; + default: // Requires map to be beaten, no special requirements + res = ((mapvisited[levelnum - 1] & MV_BEATEN) == MV_BEATEN); + break; + } + + emblemlocations[i].collected = res; + if (res) + ++somethingUnlocked; + } + return somethingUnlocked; +} + // ------------------- // Quick unlock checks // ------------------- diff --git a/src/m_cond.h b/src/m_cond.h index e61ff1f79..521e1d1f4 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -73,6 +73,7 @@ typedef struct #define ET_RINGS 4 #define ET_NGRADE 5 #define ET_NTIME 6 +#define ET_MAP 7 typedef struct { @@ -153,6 +154,7 @@ void M_CheckUnlockConditions(void); UINT8 M_UpdateUnlockablesAndExtraEmblems(void); void M_SilentUpdateUnlockablesAndEmblems(void); UINT8 M_CheckLevelEmblems(void); +UINT8 M_CompletionEmblems(void); // Checking unlockable status UINT8 M_AnySecretUnlocked(void); diff --git a/src/m_menu.c b/src/m_menu.c index f682cd1b5..a269768cb 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2940,6 +2940,8 @@ static void M_DrawMapEmblems(INT32 mapnum, INT32 x, INT32 y) curtype = 1; break; case ET_NGRADE: case ET_NTIME: curtype = 2; break; + case ET_MAP: + curtype = 3; break; default: curtype = 0; break; } diff --git a/src/y_inter.c b/src/y_inter.c index 3b14f2837..2e8808d49 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1007,6 +1007,10 @@ void Y_StartIntermission(void) if (modeattacking == ATTACKING_RECORD) Y_UpdateRecordReplays(); + + UINT8 completionEmblems = M_CompletionEmblems(); + if (completionEmblems) + CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)completionEmblems, completionEmblems > 1 ? "s" : ""); } for (i = 0; i < 4; ++i) @@ -1106,6 +1110,13 @@ void Y_StartIntermission(void) { if (!stagefailed) mapvisited[gamemap-1] |= MV_BEATEN; + + // all emeralds/ultimate/perfect emblems won't be possible in ss, oh well? + { + UINT8 completionEmblems = M_CompletionEmblems(); + if (completionEmblems) + CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)completionEmblems, completionEmblems > 1 ? "s" : ""); + } } // give out ring bonuses From 92e785a9f2b01c34e5869e9429e429e31621d4a3 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 22 Mar 2017 14:45:26 -0400 Subject: [PATCH 02/19] Map emblem type flags As per toaster's request --- src/dehacked.c | 7 ++++++- src/m_cond.c | 33 +++++++++++++++------------------ src/m_cond.h | 5 +++++ 3 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index cfc711fb2..cc3f196a6 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7426,7 +7426,12 @@ struct { {"SF_X8AWAYSOUND",SF_X8AWAYSOUND}, {"SF_NOINTERRUPT",SF_NOINTERRUPT}, {"SF_X2AWAYSOUND",SF_X2AWAYSOUND}, - + + // Map emblem var flags + {"ME_ALLEMERALDS",ME_ALLEMERALDS}, + {"ME_ULTIMATE",ME_ULTIMATE}, + {"ME_PERFECT",ME_PERFECT}, + #ifdef HAVE_BLUA // p_local.h constants {"FLOATSPEED",FLOATSPEED}, diff --git a/src/m_cond.c b/src/m_cond.c index 0955f9506..14d678d8e 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -963,7 +963,7 @@ UINT8 M_CheckLevelEmblems(void) return somethingUnlocked; } -UINT8 M_CompletionEmblems(void) // Bah! Duplication! :/ +UINT8 M_CompletionEmblems(void) // Bah! Duplication sucks, but it's for a separate print when awarding emblems and it's sorta different enough. { INT32 i; INT32 embtype; @@ -978,23 +978,20 @@ UINT8 M_CompletionEmblems(void) // Bah! Duplication! :/ levelnum = emblemlocations[i].level; embtype = emblemlocations[i].var; - - switch (embtype) - { - case 1: // Requires map to be beaten with all emeralds - res = ((mapvisited[levelnum - 1] & MV_ALLEMERALDS) == MV_ALLEMERALDS); - break; - case 2: // Requires map to be beaten in Ultimate mode - res = ((mapvisited[levelnum - 1] & MV_ULTIMATE) == MV_ULTIMATE); - break; - case 3: // Requires map to be beaten with a perfect bonus - res = ((mapvisited[levelnum - 1] & MV_PERFECT) == MV_PERFECT); - break; - default: // Requires map to be beaten, no special requirements - res = ((mapvisited[levelnum - 1] & MV_BEATEN) == MV_BEATEN); - break; - } - + + UINT8 flags = MV_BEATEN; + + if (embtype & ME_ALLEMERALDS) + flags |= MV_ALLEMERALDS; + + if (embtype & ME_ULTIMATE) + flags |= MV_ULTIMATE; + + if (embtype & ME_PERFECT) + flags |= MV_PERFECT; + + res = ((mapvisited[levelnum - 1] & flags) == flags); + emblemlocations[i].collected = res; if (res) ++somethingUnlocked; diff --git a/src/m_cond.h b/src/m_cond.h index 521e1d1f4..94802f665 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -75,6 +75,11 @@ typedef struct #define ET_NTIME 6 #define ET_MAP 7 +// Map emblem flags +#define ME_ALLEMERALDS 1 +#define ME_ULTIMATE 2 +#define ME_PERFECT 4 + typedef struct { UINT8 type; ///< Emblem type From 965846b0da68ae9624af98a4e768d4c641872e26 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 23 Mar 2017 01:17:31 -0400 Subject: [PATCH 03/19] More consistency As per MI's request --- src/y_inter.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 2e8808d49..5548fe346 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -912,7 +912,8 @@ static void Y_UpdateRecordReplays(void) void Y_StartIntermission(void) { INT32 i; - + UINT8 completionEmblems = M_CompletionEmblems(); + intertic = -1; #ifdef PARANOIA @@ -1008,7 +1009,6 @@ void Y_StartIntermission(void) if (modeattacking == ATTACKING_RECORD) Y_UpdateRecordReplays(); - UINT8 completionEmblems = M_CompletionEmblems(); if (completionEmblems) CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)completionEmblems, completionEmblems > 1 ? "s" : ""); } @@ -1112,11 +1112,8 @@ void Y_StartIntermission(void) mapvisited[gamemap-1] |= MV_BEATEN; // all emeralds/ultimate/perfect emblems won't be possible in ss, oh well? - { - UINT8 completionEmblems = M_CompletionEmblems(); - if (completionEmblems) - CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)completionEmblems, completionEmblems > 1 ? "s" : ""); - } + if (completionEmblems) + CONS_Printf(M_GetText("\x82" "Earned %hu emblem%s for level completion.\n"), (UINT16)completionEmblems, completionEmblems > 1 ? "s" : ""); } // give out ring bonuses From b29193aa98eaa2fe9abc8192162e731a0cac28e5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 23 Mar 2017 21:24:31 -0400 Subject: [PATCH 04/19] CircleCI: first try --- .circleci/config.yml | 53 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 000000000..8b954bc70 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,53 @@ +version: 2 +jobs: + build: + working_directory: /root/SRB2 + docker: + - image: debian:jessie + environment: + CC: ccache gcc -m32 + PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig + LIBGME_CFLAGS: -I/usr/include/ + LIBGME_LDFLAGS: -lgme + CCACHE_COMPRESS: true + steps: + - run: + name: Add i386 arch + command: dpkg --add-architecture i386 + #- restore_cache: + # keys: + # - v1-SRB2-APT + - run: + name: Update APT listing + command: apt-get -qq update + - run: + name: Install SDK + command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib ca-certificates + #- save_cache: + # key: v1-SRB2-APT + # paths: + # - /var/cache/apt/ + - checkout + #- restore_cache: + # keys: + # - v1-SRB2-{{ .Branch }} + - run: + name: Setup cache + command: mkdir -p /root/srb2_cache + #- run: + # name: Download SRB2 Resources + # command: wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O /root/srb2_cache/SRB2-v2115-assets-2.7z + - run: + name: Compile + command: make -C src LINUX=1 GCC49=1 WARNINGMODE=1 -k + - store_artifacts: + path: /root/SRB2/bin/Linux/Release/ + destination: bin + #- save_cache: + # key: v1-SRB2-{{ .Branch }} + # paths: + # - /root/.ccache + # - /root/srb2_cache + + + From 59d91e0793f61b7dbb93a4cb17db89a1b5892999 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 23 Mar 2017 23:13:31 -0400 Subject: [PATCH 05/19] build: r_bsp.c:213:23: warning: inlining failed in call to 'R_DoorClosed': call is unlikely and code size would grow [-Winline] --- src/r_bsp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index 2562cff66..44cb991a7 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -210,7 +210,7 @@ void R_PortalClearClipSegs(INT32 start, INT32 end) // // 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 inline INT32 R_DoorClosed(void) +static INT32 R_DoorClosed(void) { return From c5d15ad5978ae3c99880789d92f4e1a06ac8f1f6 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 23 Mar 2017 23:15:01 -0400 Subject: [PATCH 06/19] CircleCI: force -Wno-unsuffixed-float-constants --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8b954bc70..61c9ce501 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -10,6 +10,7 @@ jobs: LIBGME_CFLAGS: -I/usr/include/ LIBGME_LDFLAGS: -lgme CCACHE_COMPRESS: true + WFLAGS: -Wno-unsuffixed-float-constants steps: - run: name: Add i386 arch From ade354c27d19fb7a561bc3538304a24c137cbabc Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 23 Mar 2017 23:19:25 -0400 Subject: [PATCH 07/19] CircleCI: error on warnings --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 61c9ce501..288468230 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ jobs: # command: wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O /root/srb2_cache/SRB2-v2115-assets-2.7z - run: name: Compile - command: make -C src LINUX=1 GCC49=1 WARNINGMODE=1 -k + command: make -C src LINUX=1 GCC49=1 ERRORMODE=1 -k - store_artifacts: path: /root/SRB2/bin/Linux/Release/ destination: bin From aaaab40f6c35adfb284e4eff88520cdb944c2324 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 23 Mar 2017 23:42:28 -0400 Subject: [PATCH 08/19] CircleCI: cache APT and ccache --- .circleci/config.yml | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 288468230..34b0faa7d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -15,23 +15,26 @@ jobs: - run: name: Add i386 arch command: dpkg --add-architecture i386 - #- restore_cache: - # keys: - # - v1-SRB2-APT - run: name: Update APT listing command: apt-get -qq update + - run: + name: Support S3 upload + command: apt-get -qq -y install ca-certificates + - restore_cache: + keys: + - v1-SRB2-APT - run: name: Install SDK - command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib ca-certificates - #- save_cache: - # key: v1-SRB2-APT - # paths: - # - /var/cache/apt/ + command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib + - save_cache: + key: v1-SRB2-APT + paths: + - /var/cache/apt/archives - checkout - #- restore_cache: - # keys: - # - v1-SRB2-{{ .Branch }} + - restore_cache: + keys: + - v1-SRB2-{{ .Branch }} - run: name: Setup cache command: mkdir -p /root/srb2_cache @@ -44,11 +47,11 @@ jobs: - store_artifacts: path: /root/SRB2/bin/Linux/Release/ destination: bin - #- save_cache: - # key: v1-SRB2-{{ .Branch }} - # paths: - # - /root/.ccache - # - /root/srb2_cache + - save_cache: + key: v1-SRB2-{{ .Branch }} + paths: + - /root/.ccache + - /root/srb2_cache From c85c277a48dd6b1b98c3e89027e1a52587c8d2e3 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 24 Mar 2017 08:27:41 -0400 Subject: [PATCH 09/19] CircleCI: move GCC49 check to debian's env --- .circleci/config.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34b0faa7d..dff58840b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,10 +7,11 @@ jobs: environment: CC: ccache gcc -m32 PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig - LIBGME_CFLAGS: -I/usr/include/ + LIBGME_CFLAGS: -I/usr/include LIBGME_LDFLAGS: -lgme CCACHE_COMPRESS: true WFLAGS: -Wno-unsuffixed-float-constants + GCC49: true steps: - run: name: Add i386 arch @@ -43,7 +44,7 @@ jobs: # command: wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O /root/srb2_cache/SRB2-v2115-assets-2.7z - run: name: Compile - command: make -C src LINUX=1 GCC49=1 ERRORMODE=1 -k + command: make -C src LINUX=1 ERRORMODE=1 -k - store_artifacts: path: /root/SRB2/bin/Linux/Release/ destination: bin From 99b2c888212c3211e0bf0335e934f5228246ad9f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 24 Mar 2017 08:28:31 -0400 Subject: [PATCH 10/19] README: add CircleCI's Status badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index eb06156b4..d16071454 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ [![Build status](https://ci.appveyor.com/api/projects/status/399d4hcw9yy7hg2y?svg=true)](https://ci.appveyor.com/project/STJr/srb2) [![Build status](https://travis-ci.org/STJr/SRB2.svg?branch=master)](https://travis-ci.org/STJr/SRB2) +[![CircleCI](https://circleci.com/gh/STJr/SRB2/tree/master.svg?style=svg)](https://circleci.com/gh/STJr/SRB2/tree/master) [Sonic Robo Blast 2](https://srb2.org/) is a 3D Sonic the Hedgehog fangame based on a modified version of [Doom Legacy](http://doomlegacy.sourceforge.net/). From ac75267ef2964c57b8956ecdbfffb96a1456c407 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 24 Mar 2017 08:29:54 -0400 Subject: [PATCH 11/19] CircleCI: build on Ubuntu as well --- .circleci/config.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index dff58840b..6330d86c5 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,6 +12,15 @@ jobs: CCACHE_COMPRESS: true WFLAGS: -Wno-unsuffixed-float-constants GCC49: true + - image: ubuntu:trusty + environment: + CC: ccache gcc -m32 + PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig + LIBGME_CFLAGS: -I/usr/include + LIBGME_LDFLAGS: -lgme + CCACHE_COMPRESS: true + WFLAGS: -Wno-unsuffixed-float-constants + GCC48: true steps: - run: name: Add i386 arch From 29c19b62ef16b9f8867f24bb1b306e8287a97a4c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 24 Mar 2017 08:33:14 -0400 Subject: [PATCH 12/19] CircleCi: Ubuntu docker image is broken --- .circleci/config.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6330d86c5..5efcaab4a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,15 +12,15 @@ jobs: CCACHE_COMPRESS: true WFLAGS: -Wno-unsuffixed-float-constants GCC49: true - - image: ubuntu:trusty - environment: - CC: ccache gcc -m32 - PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig - LIBGME_CFLAGS: -I/usr/include - LIBGME_LDFLAGS: -lgme - CCACHE_COMPRESS: true - WFLAGS: -Wno-unsuffixed-float-constants - GCC48: true + #- image: ubuntu:trusty + # environment: + # CC: ccache gcc -m32 + # PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig + # LIBGME_CFLAGS: -I/usr/include + # LIBGME_LDFLAGS: -lgme + # CCACHE_COMPRESS: true + # WFLAGS: -Wno-unsuffixed-float-constants + # GCC48: true steps: - run: name: Add i386 arch From 03ecb0d1644e58fa306d56f6dc226cff979a3bdc Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 24 Mar 2017 09:10:18 -0400 Subject: [PATCH 13/19] CircleCI: add upx --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5efcaab4a..18a95b8a9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ jobs: - v1-SRB2-APT - run: name: Install SDK - command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib + command: apt-get -qq -y install git build-essential nasm libpng12-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 gettext ccache wget gcc-multilib upx - save_cache: key: v1-SRB2-APT paths: From 52a79754d344a419a8edb9aa719e8cda78258978 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 24 Mar 2017 09:12:00 -0400 Subject: [PATCH 14/19] CircleCI: keep build cache with checksum of depend.dep --- .circleci/config.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 18a95b8a9..b5c43d017 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -42,15 +42,12 @@ jobs: paths: - /var/cache/apt/archives - checkout + - run: + name: Clean build + command: make -C src LINUX=1 clean - restore_cache: keys: - - v1-SRB2-{{ .Branch }} - - run: - name: Setup cache - command: mkdir -p /root/srb2_cache - #- run: - # name: Download SRB2 Resources - # command: wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O /root/srb2_cache/SRB2-v2115-assets-2.7z + - v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }} - run: name: Compile command: make -C src LINUX=1 ERRORMODE=1 -k @@ -58,10 +55,9 @@ jobs: path: /root/SRB2/bin/Linux/Release/ destination: bin - save_cache: - key: v1-SRB2-{{ .Branch }} + key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }} paths: - /root/.ccache - - /root/srb2_cache From dbcbcf5da3af1f6e8cb6b46102613b3cb0818780 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 25 Mar 2017 03:13:02 -0400 Subject: [PATCH 15/19] Changed defaults, camera settings save Camera settings: distance from 128 to 160, height from 20 to 32, speed from 0.25 to 0.3 Mouse sensitivity from 35 to 12 Default control setup is Mystic's proposed scheme from the New Player Experiences topic (https://mb.srb2.org/showthread.php?t=42095) Also, camera settings now save to config, and they no longer try to reset back to the default at every chance it gets (you can die, start a new game, or exit, all while still keeping your preferred setting) --- src/g_game.c | 12 +++++++----- src/g_input.c | 23 ++++++++++------------- src/p_setup.c | 11 ++++++----- src/p_user.c | 16 ++++++++-------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 1eef85ada..f3ccbce99 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1565,11 +1565,12 @@ static void Analog_OnChange(void) return; // cameras are not initialized at this point + // Salt: Grooooaaan... I know that cameras aren't initalized yet and that analog needs a farther camera, but directly overwriting someone's settings should not be the way to do it! - if (leveltime > 1) + /*if (leveltime > 1) CV_SetValue(&cv_cam_dist, 128); if (cv_analog.value || demoplayback) - CV_SetValue(&cv_cam_dist, 192); + CV_SetValue(&cv_cam_dist, 192);*/ if (!cv_chasecam.value && cv_analog.value) { CV_SetValue(&cv_analog, 0); @@ -1590,11 +1591,12 @@ static void Analog2_OnChange(void) return; // cameras are not initialized at this point - - if (leveltime > 1) + // Salt: Grooooaaan... I know that cameras aren't initalized yet and that analog needs a farther camera, but directly overwriting someone's settings should not be the way to do it! + + /*if (leveltime > 1) CV_SetValue(&cv_cam2_dist, 128); if (cv_analog2.value) - CV_SetValue(&cv_cam2_dist, 192); + CV_SetValue(&cv_cam2_dist, 192);*/ if (!cv_chasecam2.value && cv_analog2.value) { CV_SetValue(&cv_analog2, 0); diff --git a/src/g_input.c b/src/g_input.c index b004384c0..a538df06c 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -25,10 +25,10 @@ static CV_PossibleValue_t mousesens_cons_t[] = {{1, "MIN"}, {MAXMOUSESENSITIVITY static CV_PossibleValue_t onecontrolperkey_cons_t[] = {{1, "One"}, {2, "Several"}, {0, NULL}}; // mouse values are used once -consvar_t cv_mousesens = {"mousesens", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_mousesens2 = {"mousesens2", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_mouseysens = {"mouseysens", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_mouseysens2 = {"mouseysens2", "35", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mousesens = {"mousesens", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mousesens2 = {"mousesens2", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mouseysens = {"mouseysens", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_mouseysens2 = {"mouseysens2", "12", CV_SAVE, mousesens_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_controlperkey = {"controlperkey", "One", CV_SAVE, onecontrolperkey_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; INT32 mousex, mousey; @@ -1154,10 +1154,8 @@ void G_Controldefault(void) #else void G_Controldefault(void) { - gamecontrol[gc_forward ][0] = KEY_UPARROW; - gamecontrol[gc_forward ][1] = 'w'; - gamecontrol[gc_backward ][0] = KEY_DOWNARROW; - gamecontrol[gc_backward ][1] = 's'; + gamecontrol[gc_forward ][0] = 'w'; + gamecontrol[gc_backward ][0] = 's'; gamecontrol[gc_strafeleft ][0] = 'a'; gamecontrol[gc_straferight][0] = 'd'; gamecontrol[gc_turnleft ][0] = KEY_LEFTARROW; @@ -1178,19 +1176,18 @@ void G_Controldefault(void) gamecontrol[gc_fire ][1] = KEY_MOUSE1+0; gamecontrol[gc_firenormal ][0] = 'c'; gamecontrol[gc_tossflag ][0] = '\''; - gamecontrol[gc_use ][0] = 'x'; + gamecontrol[gc_use ][0] = KEY_LSHIFT; gamecontrol[gc_camtoggle ][0] = 'v'; gamecontrol[gc_camleft ][0] = '['; gamecontrol[gc_camright ][0] = ']'; gamecontrol[gc_camreset ][0] = 'r'; - gamecontrol[gc_lookup ][0] = KEY_PGUP; - gamecontrol[gc_lookdown ][0] = KEY_PGDN; + gamecontrol[gc_lookup ][0] = KEY_UPARROW; + gamecontrol[gc_lookdown ][0] = KEY_DOWNARROW; gamecontrol[gc_centerview ][0] = KEY_END; gamecontrol[gc_talkkey ][0] = 't'; gamecontrol[gc_teamkey ][0] = 'y'; gamecontrol[gc_scores ][0] = KEY_TAB; - gamecontrol[gc_jump ][0] = 'z'; - gamecontrol[gc_jump ][1] = KEY_MOUSE1+1; + gamecontrol[gc_jump ][0] = KEY_SPACE; gamecontrol[gc_console ][0] = KEY_CONSOLE; gamecontrol[gc_pause ][0] = KEY_PAUSE; #ifdef WMINPUT diff --git a/src/p_setup.c b/src/p_setup.c index 6df103255..97bcb61f1 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2583,8 +2583,8 @@ boolean P_SetupLevel(boolean skipprecip) if (!dedicated) { - if (!cv_cam_speed.changed) - CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue); + //if (!cv_cam_speed.changed) + //CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue); if (!cv_chasecam.changed) CV_SetValue(&cv_chasecam, chase); @@ -2880,8 +2880,9 @@ boolean P_SetupLevel(boolean skipprecip) camera.angle = FixedAngle((fixed_t)thing->angle << FRACBITS); } } - - if (!cv_cam_height.changed) + + // Salt: I don't understand *why* it does this, but this overwrites the player's setting, even though it looks like it shouldn't do that unless if it's already the default + /*if (!cv_cam_height.changed) CV_Set(&cv_cam_height, cv_cam_height.defaultvalue); if (!cv_cam_dist.changed) @@ -2897,7 +2898,7 @@ boolean P_SetupLevel(boolean skipprecip) CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue); if (!cv_cam2_rotate.changed) - CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue); + CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);*/ if (!cv_analog.changed) CV_SetValue(&cv_analog, 0); diff --git a/src/p_user.c b/src/p_user.c index 905c3be62..8b1589c42 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8020,18 +8020,18 @@ static CV_PossibleValue_t CV_CamSpeed[] = {{0, "MIN"}, {1*FRACUNIT, "MAX"}, {0, static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {45, "MAX"}, {0, NULL}}; static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}}; -consvar_t cv_cam_dist = {"cam_dist", "128", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam_height = {"cam_height", "20", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_dist = {"cam_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_height = {"cam_height", "32", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam_speed = {"cam_speed", "0.25", CV_FLOAT, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_speed = {"cam_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_rotate = {"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", 0, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_dist = {"cam2_dist", "128", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_height = {"cam2_height", "20", CV_FLOAT, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_dist = {"cam2_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_height = {"cam2_height", "32", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_speed = {"cam2_speed", "0.25", CV_FLOAT, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_speed = {"cam2_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_rotate = {"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_rotspeed = {"cam2_rotspeed", "10", 0, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_rotspeed = {"cam2_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; fixed_t t_cam_dist = -42; fixed_t t_cam_height = -42; From e5245c508dc0a1fe86b6409101b16c6e3082cfea Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sun, 26 Mar 2017 17:11:04 -0400 Subject: [PATCH 16/19] Reimplemented analog mode cam_dist increase, slight comment updates Analog mode's camera is now x1.2 of your actual cam_dist setting, instead of being strictly 192. "analog on" seems to reset this modifier every once in a while, but "useranalog on" prevents this. The wiki itself says that you should only change useranalog though, so it shouldn't be too big of a deal. --- src/g_game.c | 12 ------------ src/p_setup.c | 23 +++++++++++------------ src/p_user.c | 4 ++++ 3 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index f3ccbce99..137f8609a 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1565,12 +1565,6 @@ static void Analog_OnChange(void) return; // cameras are not initialized at this point - // Salt: Grooooaaan... I know that cameras aren't initalized yet and that analog needs a farther camera, but directly overwriting someone's settings should not be the way to do it! - - /*if (leveltime > 1) - CV_SetValue(&cv_cam_dist, 128); - if (cv_analog.value || demoplayback) - CV_SetValue(&cv_cam_dist, 192);*/ if (!cv_chasecam.value && cv_analog.value) { CV_SetValue(&cv_analog, 0); @@ -1591,12 +1585,6 @@ static void Analog2_OnChange(void) return; // cameras are not initialized at this point - // Salt: Grooooaaan... I know that cameras aren't initalized yet and that analog needs a farther camera, but directly overwriting someone's settings should not be the way to do it! - - /*if (leveltime > 1) - CV_SetValue(&cv_cam2_dist, 128); - if (cv_analog2.value) - CV_SetValue(&cv_cam2_dist, 192);*/ if (!cv_chasecam2.value && cv_analog2.value) { CV_SetValue(&cv_analog2, 0); diff --git a/src/p_setup.c b/src/p_setup.c index 97bcb61f1..e718637c9 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2583,8 +2583,9 @@ boolean P_SetupLevel(boolean skipprecip) if (!dedicated) { - //if (!cv_cam_speed.changed) - //CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue); + // Salt: CV_ClearChangedFlags() messes with your settings :( + /*if (!cv_cam_speed.changed) + CV_Set(&cv_cam_speed, cv_cam_speed.defaultvalue);*/ if (!cv_chasecam.changed) CV_SetValue(&cv_chasecam, chase); @@ -2881,24 +2882,22 @@ boolean P_SetupLevel(boolean skipprecip) } } - // Salt: I don't understand *why* it does this, but this overwrites the player's setting, even though it looks like it shouldn't do that unless if it's already the default + // Salt: CV_ClearChangedFlags() messes with your settings :( /*if (!cv_cam_height.changed) CV_Set(&cv_cam_height, cv_cam_height.defaultvalue); - - if (!cv_cam_dist.changed) - CV_Set(&cv_cam_dist, cv_cam_dist.defaultvalue); - - if (!cv_cam_rotate.changed) - CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue); - if (!cv_cam2_height.changed) CV_Set(&cv_cam2_height, cv_cam2_height.defaultvalue); + if (!cv_cam_dist.changed) + CV_Set(&cv_cam_dist, cv_cam_dist.defaultvalue); if (!cv_cam2_dist.changed) - CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue); + CV_Set(&cv_cam2_dist, cv_cam2_dist.defaultvalue);*/ + // Though, I don't think anyone would care about cam_rotate being reset back to the only value that makes sense :P + if (!cv_cam_rotate.changed) + CV_Set(&cv_cam_rotate, cv_cam_rotate.defaultvalue); if (!cv_cam2_rotate.changed) - CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue);*/ + CV_Set(&cv_cam2_rotate, cv_cam2_rotate.defaultvalue); if (!cv_analog.changed) CV_SetValue(&cv_analog, 0); diff --git a/src/p_user.c b/src/p_user.c index 8b1589c42..1e527607e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8289,6 +8289,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall { dist = camdist; + // x1.2 dist for analog + if (P_AnalogMove(player)) + dist = FixedMul(dist, 6*FRACUNIT/5); + if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->powers[pw_carry] && player->powers[pw_carry] != CR_PLAYER)) dist <<= 1; } From d7b4b05d9ad79a41165ff19bfed148b25193238d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 28 Mar 2017 21:30:31 +0100 Subject: [PATCH 17/19] Fix remaining mixed-declaration-and-code issue detected when compiling --- src/m_cond.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/m_cond.c b/src/m_cond.c index 14d678d8e..7f977c15d 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -970,6 +970,7 @@ UINT8 M_CompletionEmblems(void) // Bah! Duplication sucks, but it's for a separa INT16 levelnum; UINT8 res; UINT8 somethingUnlocked = 0; + UINT8 flags; for (i = 0; i < numemblems; ++i) { @@ -978,8 +979,7 @@ UINT8 M_CompletionEmblems(void) // Bah! Duplication sucks, but it's for a separa levelnum = emblemlocations[i].level; embtype = emblemlocations[i].var; - - UINT8 flags = MV_BEATEN; + flags = MV_BEATEN; if (embtype & ME_ALLEMERALDS) flags |= MV_ALLEMERALDS; From 48777e60ed8a13aaa397279b683979f9dd462a1f Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 29 Mar 2017 21:27:44 +0100 Subject: [PATCH 18/19] check i not add, silly --- src/m_misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_misc.c b/src/m_misc.c index cfe73d88f..d88643ec4 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -585,7 +585,7 @@ static const char *Newsnapshotfile(const char *pathname, const char *ext) i += add * result; - if (add < 0 || add > 9999) + if (i < 0 || i > 9999) return NULL; } From b5d1bff18abffc07c10829aa6a8cabfb82a3c221 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 29 Mar 2017 18:30:45 -0400 Subject: [PATCH 19/19] Scaled down cam_height default 25 was picked over 24 due to 160/25 being exactly proportional to 128/20. --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 1e527607e..a6df976fe 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8021,13 +8021,13 @@ static CV_PossibleValue_t rotation_cons_t[] = {{1, "MIN"}, {45, "MAX"}, {0, NULL static CV_PossibleValue_t CV_CamRotate[] = {{-720, "MIN"}, {720, "MAX"}, {0, NULL}}; consvar_t cv_cam_dist = {"cam_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam_height = {"cam_height", "32", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam_height = {"cam_height", "25", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_still = {"cam_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_speed = {"cam_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_rotate = {"cam_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate_OnChange, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam_rotspeed = {"cam_rotspeed", "10", CV_SAVE, rotation_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_dist = {"cam2_dist", "160", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_cam2_height = {"cam2_height", "32", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_cam2_height = {"cam2_height", "25", CV_FLOAT|CV_SAVE, NULL, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_still = {"cam2_still", "Off", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_speed = {"cam2_speed", "0.3", CV_FLOAT|CV_SAVE, CV_CamSpeed, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_cam2_rotate = {"cam2_rotate", "0", CV_CALL|CV_NOINIT, CV_CamRotate, CV_CamRotate2_OnChange, 0, NULL, NULL, 0, 0, NULL};