From be8447519f1d242296e9335c52acba4281daabda Mon Sep 17 00:00:00 2001 From: Steve Date: Fri, 12 May 2017 18:07:52 +0100 Subject: [PATCH 1/2] Reduced damage by missiles by 25pts, and decreased recharge times of ECM and Boost by 2.5 seconds. --- data/battle/bullets.json | 2 +- src/defs.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/battle/bullets.json b/data/battle/bullets.json index ceb516e..fcabc70 100644 --- a/data/battle/bullets.json +++ b/data/battle/bullets.json @@ -17,7 +17,7 @@ { "type" : "BT_MISSILE", - "damage" : 75, + "damage" : 50, "texture" : "gfx/bullets/missile.png", "sound" : "SND_MISSILE", "flags" : "BF_ENGINE+BF_EXPLODES" diff --git a/src/defs.h b/src/defs.h index 5f81eb7..bbdd582 100644 --- a/src/defs.h +++ b/src/defs.h @@ -137,9 +137,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define AIF_SURRENDERED (2 << 23) /* player abilities */ -#define BOOST_RECHARGE_TIME (FPS * 7) +#define BOOST_RECHARGE_TIME (FPS * 4.5) #define BOOST_FINISHED_TIME (FPS * 0.75) -#define ECM_RECHARGE_TIME (FPS * 7) +#define ECM_RECHARGE_TIME (FPS * 4.5) #define MB_NORMAL 0 #define MB_IMPORTANT 1 From 80ec8ff039447c3ce1c3e90d7298741ec7175a73 Mon Sep 17 00:00:00 2001 From: Cong Date: Sun, 14 May 2017 14:47:54 +1000 Subject: [PATCH 2/2] Pause music when lost window focus --- src/main.c | 12 ++++++++++++ src/main.h | 1 + src/system/sound.c | 15 +++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/src/main.c b/src/main.c index 4655d1b..739077e 100644 --- a/src/main.c +++ b/src/main.c @@ -100,6 +100,18 @@ int main(int argc, char *argv[]) case SDL_QUIT: exit(0); break; + + case SDL_WINDOWEVENT: + switch (event.window.event) + { + case SDL_WINDOWEVENT_FOCUS_GAINED: + musicSetPlaying(1); + break; + case SDL_WINDOWEVENT_FOCUS_LOST: + musicSetPlaying(0); + break; + } + break; } } diff --git a/src/main.h b/src/main.h index dbe1d8d..8ad4b2a 100644 --- a/src/main.h +++ b/src/main.h @@ -54,6 +54,7 @@ extern void saveGame(void); extern void initCredits(void); extern void doTrophyAlerts(void); extern void drawTrophyAlert(void); +extern void musicSetPlaying(int playing); App app; Colors colors; diff --git a/src/system/sound.c b/src/system/sound.c index f16a578..ed2727f 100644 --- a/src/system/sound.c +++ b/src/system/sound.c @@ -56,6 +56,21 @@ void stopMusic(void) Mix_HaltMusic(); } +void musicSetPlaying(int playing) +{ + if (music != NULL) + { + if (playing) + { + Mix_ResumeMusic(); + } + else + { + Mix_PauseMusic(); + } + } +} + void playSound(int id) { Mix_PlayChannel(-1, sounds[id], 0);