Merge remote-tracking branch 'origin/missiles' into easy-mode
This commit is contained in:
commit
9bce24d9bd
|
@ -140,9 +140,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#define AIF_SURRENDERED (2 << 23)
|
#define AIF_SURRENDERED (2 << 23)
|
||||||
|
|
||||||
/* player abilities */
|
/* player abilities */
|
||||||
#define BOOST_RECHARGE_TIME (FPS * 7)
|
#define BOOST_RECHARGE_TIME (FPS * 4.5)
|
||||||
#define BOOST_FINISHED_TIME (FPS * 0.75)
|
#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_NORMAL 0
|
||||||
#define MB_IMPORTANT 1
|
#define MB_IMPORTANT 1
|
||||||
|
|
12
src/main.c
12
src/main.c
|
@ -100,6 +100,18 @@ int main(int argc, char *argv[])
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
exit(0);
|
exit(0);
|
||||||
break;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ extern void saveGame(void);
|
||||||
extern void initCredits(void);
|
extern void initCredits(void);
|
||||||
extern void doTrophyAlerts(void);
|
extern void doTrophyAlerts(void);
|
||||||
extern void drawTrophyAlert(void);
|
extern void drawTrophyAlert(void);
|
||||||
|
extern void musicSetPlaying(int playing);
|
||||||
|
|
||||||
App app;
|
App app;
|
||||||
Colors colors;
|
Colors colors;
|
||||||
|
|
|
@ -56,6 +56,21 @@ void stopMusic(void)
|
||||||
Mix_HaltMusic();
|
Mix_HaltMusic();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void musicSetPlaying(int playing)
|
||||||
|
{
|
||||||
|
if (music != NULL)
|
||||||
|
{
|
||||||
|
if (playing)
|
||||||
|
{
|
||||||
|
Mix_ResumeMusic();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Mix_PauseMusic();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void playSound(int id)
|
void playSound(int id)
|
||||||
{
|
{
|
||||||
Mix_PlayChannel(-1, sounds[id], 0);
|
Mix_PlayChannel(-1, sounds[id], 0);
|
||||||
|
|
Loading…
Reference in New Issue