Core reset option (moronimo)
This commit is contained in:
parent
722d249916
commit
e8b3b712a5
1 changed files with 16 additions and 4 deletions
|
|
@ -25,6 +25,7 @@
|
||||||
|
|
||||||
static SDL_Surface* screen;
|
static SDL_Surface* screen;
|
||||||
static int quit;
|
static int quit;
|
||||||
|
static int reset_flag;
|
||||||
static int show_menu;
|
static int show_menu;
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
@ -2946,7 +2947,7 @@ void Core_close(void) {
|
||||||
|
|
||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
|
|
||||||
#define MENU_ITEM_COUNT 5
|
#define MENU_ITEM_COUNT 6
|
||||||
#define MENU_SLOT_COUNT 8
|
#define MENU_SLOT_COUNT 8
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
|
@ -2954,6 +2955,7 @@ enum {
|
||||||
ITEM_SAVE,
|
ITEM_SAVE,
|
||||||
ITEM_LOAD,
|
ITEM_LOAD,
|
||||||
ITEM_OPTS,
|
ITEM_OPTS,
|
||||||
|
ITEM_RSET,
|
||||||
ITEM_QUIT,
|
ITEM_QUIT,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2963,6 +2965,7 @@ enum {
|
||||||
STATUS_LOAD = 11,
|
STATUS_LOAD = 11,
|
||||||
STATUS_OPTS = 23,
|
STATUS_OPTS = 23,
|
||||||
STATUS_DISC = 24,
|
STATUS_DISC = 24,
|
||||||
|
STATUS_RSET = 25,
|
||||||
STATUS_QUIT = 30
|
STATUS_QUIT = 30
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2977,6 +2980,7 @@ static struct {
|
||||||
[ITEM_SAVE] = "Save",
|
[ITEM_SAVE] = "Save",
|
||||||
[ITEM_LOAD] = "Load",
|
[ITEM_LOAD] = "Load",
|
||||||
[ITEM_OPTS] = "Options",
|
[ITEM_OPTS] = "Options",
|
||||||
|
[ITEM_RSET] = "Reset",
|
||||||
[ITEM_QUIT] = "Quit",
|
[ITEM_QUIT] = "Quit",
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -4045,6 +4049,10 @@ static void Menu_loop(void) {
|
||||||
Menu_options(&options_menu);
|
Menu_options(&options_menu);
|
||||||
dirty = 1;
|
dirty = 1;
|
||||||
break;
|
break;
|
||||||
|
case ITEM_RSET:
|
||||||
|
reset_flag = 1;
|
||||||
|
show_menu = 0;
|
||||||
|
break;
|
||||||
case ITEM_QUIT:
|
case ITEM_QUIT:
|
||||||
status = STATUS_QUIT;
|
status = STATUS_QUIT;
|
||||||
show_menu = 0;
|
show_menu = 0;
|
||||||
|
|
@ -4125,7 +4133,7 @@ static void Menu_loop(void) {
|
||||||
// pill
|
// pill
|
||||||
GFX_blitPill(ASSET_WHITE_PILL, screen, &(SDL_Rect){
|
GFX_blitPill(ASSET_WHITE_PILL, screen, &(SDL_Rect){
|
||||||
SCALE1(PADDING),
|
SCALE1(PADDING),
|
||||||
SCALE1(oy + PADDING + (i * PILL_SIZE)),
|
SCALE1(oy + PADDING + (i * (PILL_SIZE - 5))),
|
||||||
ow,
|
ow,
|
||||||
SCALE1(PILL_SIZE)
|
SCALE1(PILL_SIZE)
|
||||||
});
|
});
|
||||||
|
|
@ -4136,7 +4144,7 @@ static void Menu_loop(void) {
|
||||||
text = TTF_RenderUTF8_Blended(font.large, item, COLOR_BLACK);
|
text = TTF_RenderUTF8_Blended(font.large, item, COLOR_BLACK);
|
||||||
SDL_BlitSurface(text, NULL, screen, &(SDL_Rect){
|
SDL_BlitSurface(text, NULL, screen, &(SDL_Rect){
|
||||||
SCALE1(2 + PADDING + BUTTON_PADDING),
|
SCALE1(2 + PADDING + BUTTON_PADDING),
|
||||||
SCALE1(1 + PADDING + oy + (i * PILL_SIZE) + 4)
|
SCALE1(1 + PADDING + oy + (i * (PILL_SIZE - 5)) + 4)
|
||||||
});
|
});
|
||||||
SDL_FreeSurface(text);
|
SDL_FreeSurface(text);
|
||||||
}
|
}
|
||||||
|
|
@ -4145,7 +4153,7 @@ static void Menu_loop(void) {
|
||||||
text = TTF_RenderUTF8_Blended(font.large, item, text_color);
|
text = TTF_RenderUTF8_Blended(font.large, item, text_color);
|
||||||
SDL_BlitSurface(text, NULL, screen, &(SDL_Rect){
|
SDL_BlitSurface(text, NULL, screen, &(SDL_Rect){
|
||||||
SCALE1(PADDING + BUTTON_PADDING),
|
SCALE1(PADDING + BUTTON_PADDING),
|
||||||
SCALE1(oy + PADDING + (i * PILL_SIZE) + 4)
|
SCALE1(oy + PADDING + (i * (PILL_SIZE - 5)) + 4)
|
||||||
});
|
});
|
||||||
SDL_FreeSurface(text);
|
SDL_FreeSurface(text);
|
||||||
}
|
}
|
||||||
|
|
@ -4351,6 +4359,10 @@ int main(int argc , char* argv[]) {
|
||||||
POW_disableAutosleep();
|
POW_disableAutosleep();
|
||||||
sec_start = SDL_GetTicks();
|
sec_start = SDL_GetTicks();
|
||||||
while (!quit) {
|
while (!quit) {
|
||||||
|
if (reset_flag) {
|
||||||
|
core.reset();
|
||||||
|
reset_flag = 0;
|
||||||
|
}
|
||||||
GFX_startFrame();
|
GFX_startFrame();
|
||||||
|
|
||||||
core.run();
|
core.run();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue