--- hatari/src/gui-sdl/dlgMain.c 2019/04/01 07:11:38 1.1.1.1 +++ hatari/src/gui-sdl/dlgMain.c 2019/04/01 07:11:58 1.1.1.2 @@ -6,7 +6,7 @@ The main dialog. */ -char DlgMain_rcsid[] = "Hatari $Id: dlgMain.c,v 1.1.1.1 2019/04/01 07:11:38 root Exp $"; +char DlgMain_rcsid[] = "Hatari $Id: dlgMain.c,v 1.1.1.2 2019/04/01 07:11:58 root Exp $"; #include "main.h" #include "configuration.h" @@ -14,22 +14,10 @@ char DlgMain_rcsid[] = "Hatari $Id: dlgM #include "sdlgui.h" #include "screen.h" -/* Prototypes of the dialog functions: */ -void Dialog_AboutDlg(void); -void Dialog_DiscDlg(void); -void Dialog_TosGemDlg(void); -void Dialog_ScreenDlg(void); -void Dialog_SoundDlg(void); -void Dialog_SystemDlg(void); -void Dialog_MemDlg(void); -void Dialog_JoyDlg(void); -void Dialog_KeyboardDlg(void); -void Dialog_DeviceDlg(void); - #define MAINDLG_ABOUT 2 #define MAINDLG_DISCS 3 -#define MAINDLG_TOSGEM 4 +#define MAINDLG_ROM 4 #define MAINDLG_SCREEN 5 #define MAINDLG_SOUND 6 #define MAINDLG_CPU 7 @@ -53,7 +41,7 @@ static SGOBJ maindlg[] = { SGTEXT, 0, 0, 10,1, 16,1, "Hatari main menu" }, { SGBUTTON, 0, 0, 4,4, 12,1, "About" }, { SGBUTTON, 0, 0, 4,6, 12,1, "Discs" }, - { SGBUTTON, 0, 0, 4,8, 12,1, "TOS/GEM" }, + { SGBUTTON, 0, 0, 4,8, 12,1, "ROM" }, { SGBUTTON, 0, 0, 4,10, 12,1, "Screen" }, { SGBUTTON, 0, 0, 4,12, 12,1, "Sound" }, { SGBUTTON, 0, 0, 20,4, 12,1, "System" }, @@ -79,13 +67,18 @@ static SGOBJ maindlg[] = int Dialog_MainDlg(BOOL *bReset) { int retbut; + BOOL bOldMouseVisibility; + int nOldMouseX, nOldMouseY; if(SDLGui_PrepareFont()) return FALSE; - SDLGui_CenterDlg(maindlg); + SDL_GetMouseState(&nOldMouseX, &nOldMouseY); + bOldMouseVisibility = SDL_ShowCursor(SDL_QUERY); SDL_ShowCursor(SDL_ENABLE); + SDLGui_CenterDlg(maindlg); + maindlg[MAINDLG_NORESET].state |= SG_SELECTED; maindlg[MAINDLG_RESET].state &= ~SG_SELECTED; @@ -100,8 +93,8 @@ int Dialog_MainDlg(BOOL *bReset) case MAINDLG_DISCS: Dialog_DiscDlg(); break; - case MAINDLG_TOSGEM: - Dialog_TosGemDlg(); + case MAINDLG_ROM: + DlgRom_Main(); break; case MAINDLG_SCREEN: Dialog_ScreenDlg(); @@ -150,17 +143,17 @@ int Dialog_MainDlg(BOOL *bReset) bQuitProgram = TRUE; break; } - - SDL_UpdateRect(sdlscrn, 0,0,0,0); } while(retbut!=MAINDLG_OK && retbut!=MAINDLG_CANCEL && !bQuitProgram); - SDL_ShowCursor(SDL_DISABLE); if( maindlg[MAINDLG_RESET].state & SG_SELECTED ) *bReset = TRUE; else *bReset = FALSE; + SDL_ShowCursor(bOldMouseVisibility); + Main_WarpMouse(nOldMouseX, nOldMouseY); + return(retbut == MAINDLG_OK); }