Some more touch-ups.
This commit is contained in:
parent
95d31b8039
commit
60968c7b0e
2
Makefile
2
Makefile
|
@ -1,7 +1,7 @@
|
|||
CXXFLAGS ?= -O2 -Wall -g
|
||||
CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer`
|
||||
LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer`
|
||||
OBJS = alien.o audio.o bullet.o cargo.o collectable.o events.o explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o ship.o shop.o Starfighter.o title.o weapons.o
|
||||
OBJS = alien.o audio.o bullet.o cargo.o collectable.o explosions.o game.o globals.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o ship.o shop.o Starfighter.o title.o weapons.o
|
||||
|
||||
VERSION = 1.3.2-dev
|
||||
PROG = starfighter
|
||||
|
|
|
@ -40,7 +40,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "bullet.h"
|
||||
#include "cargo.h"
|
||||
#include "collectable.h"
|
||||
#include "events.h"
|
||||
#include "explosions.h"
|
||||
#include "game.h"
|
||||
#include "globals.h"
|
||||
|
|
|
@ -422,7 +422,7 @@ extern const char *systemNames[];
|
|||
|
||||
extern const char *systemBackground[];
|
||||
|
||||
const char rate2reload[6] = {15, 15, 13, 11, 9, 7};
|
||||
const int rate2reload[6] = {15, 15, 13, 11, 9, 7};
|
||||
const int screenWidth = 800;
|
||||
const int screenHeight = 600;
|
||||
const int xViewBorder = 100;
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011, 2013 Guus Sliepen
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 3
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "Starfighter.h"
|
||||
|
||||
/*
|
||||
Checked during the main game loop. When the game is paused
|
||||
it goes into a constant loop checking this routine. If escape is
|
||||
pressed, the game automatically ends and goes back to the title screen
|
||||
*/
|
||||
bool checkPauseRequest()
|
||||
{
|
||||
getPlayerInput();
|
||||
|
||||
if (engine.keyState[KEY_ESCAPE])
|
||||
{
|
||||
engine.paused = false;
|
||||
engine.done = 1;
|
||||
player.shield = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (engine.keyState[KEY_PAUSE])
|
||||
{
|
||||
engine.paused = false;
|
||||
engine.keyState[KEY_PAUSE] = 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
25
src/events.h
25
src/events.h
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2003 Parallel Realities
|
||||
Copyright (C) 2011 Guus Sliepen
|
||||
Copyright (C) 2015 Julian Marchant
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 3
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef EVENTS_H
|
||||
#define EVENTS_H
|
||||
|
||||
extern bool checkPauseRequest();
|
||||
|
||||
#endif
|
28
src/game.cpp
28
src/game.cpp
|
@ -1433,6 +1433,32 @@ static void game_doDebris()
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Checked during the main game loop. When the game is paused
|
||||
it goes into a constant loop checking this routine. If escape is
|
||||
pressed, the game automatically ends and goes back to the title screen
|
||||
*/
|
||||
static bool game_checkPauseRequest()
|
||||
{
|
||||
getPlayerInput();
|
||||
|
||||
if (engine.keyState[KEY_ESCAPE])
|
||||
{
|
||||
engine.paused = false;
|
||||
engine.done = 1;
|
||||
player.shield = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (engine.keyState[KEY_PAUSE])
|
||||
{
|
||||
engine.paused = false;
|
||||
engine.keyState[KEY_PAUSE] = 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
int mainGameLoop()
|
||||
{
|
||||
resetLists();
|
||||
|
@ -1722,7 +1748,7 @@ int mainGameLoop()
|
|||
|
||||
while (engine.paused)
|
||||
{
|
||||
engine.done = checkPauseRequest();
|
||||
engine.done = game_checkPauseRequest();
|
||||
delayFrame();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue