NXEngine v1.0.0.5
[NXEngine.git] / pause / pause.cpp
blobad5b296f05eb0a9e00d5f4797dc47f0964cdf7ff
2 #include "../nx.h"
3 #include "pause.fdh"
5 bool pause_init(int param)
7 memset(lastinputs, 1, sizeof(lastinputs));
8 return 0;
11 void pause_tick()
13 ClearScreen(BLACK);
15 int cx = (SCREEN_WIDTH / 2) - (sprites[SPR_RESETPROMPT].w / 2);
16 int cy = (SCREEN_HEIGHT / 2) - (sprites[SPR_RESETPROMPT].h / 2);
17 draw_sprite(cx, cy, SPR_RESETPROMPT);
19 const char *str = "F3:Options";
20 cx = (SCREEN_WIDTH / 2) - (GetFontWidth(str, 0) / 2) - 4;
21 cy = (SCREEN_HEIGHT - 8) - GetFontHeight();
22 int f3wd = font_draw(cx, cy, "F3", 0);
23 font_draw(cx + f3wd, cy, ":Options", 0, &bluefont);
25 // resume
26 if (justpushed(F1KEY))
28 lastinputs[F1KEY] = true;
29 game.pause(false);
30 return;
33 // reset
34 if (justpushed(F2KEY))
36 lastinputs[F2KEY] = true;
37 game.reset();
38 return;
41 // exit
42 if (justpushed(ESCKEY))
44 lastinputs[ESCKEY] = true;
45 game.running = false;
46 return;