Merge remote-tracking branch 'origin/missiles' into easy-mode

This commit is contained in:
Steve 2017-05-14 14:03:28 +01:00
commit 9bce24d9bd
4 changed files with 30 additions and 2 deletions

View File

@ -140,9 +140,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

View File

@ -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;
}
}

View File

@ -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;

View File

@ -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);