Moved prepareScene / presentScene into main loop.

This commit is contained in:
Steve 2016-02-22 17:27:36 +00:00
parent 66874a1720
commit a7f9585a9a
8 changed files with 6 additions and 18 deletions

View File

@ -187,8 +187,6 @@ static void doBattle(void)
static void draw(void) static void draw(void)
{ {
prepareScene();
if (player != NULL) if (player != NULL)
{ {
battle.camera.x = player->x - (SCREEN_WIDTH / 2); battle.camera.x = player->x - (SCREEN_WIDTH / 2);
@ -233,8 +231,6 @@ static void draw(void)
drawOptions(); drawOptions();
break; break;
} }
presentScene();
} }
static void drawMenu(void) static void drawMenu(void)

View File

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SHOW_OBJECTIVES 2 #define SHOW_OBJECTIVES 2
#define SHOW_OPTIONS 3 #define SHOW_OPTIONS 3
extern void prepareScene(void);
extern void presentScene(void);
extern void doBullets(void); extern void doBullets(void);
extern void drawBullets(void); extern void drawBullets(void);
extern void doStars(float dx, float dy); extern void doStars(float dx, float dy);

View File

@ -312,8 +312,6 @@ static void doPulses(void)
static void draw(void) static void draw(void)
{ {
prepareScene();
drawBackground(background); drawBackground(background);
drawStars(); drawStars();
@ -346,8 +344,6 @@ static void draw(void)
drawFallenView(); drawFallenView();
break; break;
} }
presentScene();
} }
static void drawPulses(void) static void drawPulses(void)

View File

@ -27,8 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define SHOW_STATS 4 #define SHOW_STATS 4
#define SHOW_FALLEN_MESSAGE 5 #define SHOW_FALLEN_MESSAGE 5
extern void prepareScene(void);
extern void presentScene(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern void initBattle(void); extern void initBattle(void);
extern void loadMission(char *filename); extern void loadMission(char *filename);

View File

@ -157,8 +157,6 @@ static void doFighters(void)
static void draw(void) static void draw(void)
{ {
prepareScene();
drawBackground(background); drawBackground(background);
drawStars(); drawStars();
@ -184,8 +182,6 @@ static void draw(void)
{ {
drawOptions(); drawOptions();
} }
presentScene();
} }
static void drawFighters(void) static void drawFighters(void)

View File

@ -22,8 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define NUM_FIGHTERS 12 #define NUM_FIGHTERS 12
extern void prepareScene(void);
extern void presentScene(void);
extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...); extern void drawText(int x, int y, int size, int align, SDL_Color c, const char *format, ...);
extern SDL_Texture *getTexture(const char *filename); extern SDL_Texture *getTexture(const char *filename);
extern void startSectionTransition(void); extern void startSectionTransition(void);

View File

@ -103,9 +103,13 @@ int main(int argc, char *argv[])
game.stats[STAT_TIME]++; game.stats[STAT_TIME]++;
} }
prepareScene();
app.delegate.draw(); app.delegate.draw();
presentScene();
doDevKeys(); doDevKeys();
frames++; frames++;

View File

@ -37,6 +37,8 @@ extern void doMouseWheel(SDL_MouseWheelEvent *event);
extern void doMouseMotion(SDL_MouseMotionEvent *event); extern void doMouseMotion(SDL_MouseMotionEvent *event);
extern void doDevKeys(void); extern void doDevKeys(void);
extern void expireTexts(int all); extern void expireTexts(int all);
extern void prepareScene(void);
extern void presentScene(void);
App app; App app;
Colors colors; Colors colors;