char * m_setupfile = ".sfrotzrc";
extern int m_frequency;
+bool sdl_active;
+
static int countedpics = 0;
static int maxlegalpic = 0;
static int releaseno = 0;
// if (theWnd != NULL)
// theWnd->FlushDisplay();
- os_set_text_style(0);
-
-
- os_display_string((zchar *)"\n\n");
- os_beep(BEEP_HIGH);
- os_set_text_style(BOLDFACE_STYLE);
-
fprintf(stderr,"\n%s: ",sf_msgstring(IDS_FATAL));
va_start( m, s);
vfprintf( stderr, s, m);
va_end(m);
fprintf(stderr,"\n");
- os_display_string((zchar *)"Fatal error: ");
- os_set_text_style(0);
- os_display_string((zchar *)s);
- os_display_string((zchar *)"\n\n");
- new_line();
- flush_buffer();
+ if (sdl_active) {
+ os_set_text_style(0);
+ os_display_string((zchar *)"\n\n");
+ os_beep(BEEP_HIGH);
+ os_set_text_style(BOLDFACE_STYLE);
- if (f_setup.ignore_errors) {
- os_display_string((zchar *)"Continuing anyway...");
- new_line();
+ os_display_string((zchar *)"Fatal error: ");
+ os_set_text_style(0);
+ os_display_string((zchar *)s);
+ os_display_string((zchar *)"\n\n");
new_line();
+ flush_buffer();
+ }
+
+ if (f_setup.ignore_errors) {
+ if (sdl_active) {
+ os_display_string((zchar *)"Continuing anyway...");
+ new_line();
+ new_line();
+ }
fprintf(stderr, "Continuing anyway...\n");
return;
}
- os_reset_screen();
+ if (sdl_active) {
+ os_reset_screen();
+ SDL_Quit();
+ }
sf_cleanup_all();
- SDL_Quit();
exit(EXIT_FAILURE);
// ::MessageBox(AfxGetMainWnd()->GetSafeHwnd(),s,CResString(IDS_FATAL),MB_ICONERROR|MB_OK);
f_setup.sound = 1;
f_setup.err_report_mode = ERR_DEFAULT_REPORT_MODE;
f_setup.restore_mode = 0;
+
+ sdl_active = FALSE;
}
static SDL_Texture *texture = NULL;
int m_timerinterval = 100;
+bool sdl_active;
+
static void sf_quitconf();
// clipping region
if ( SDL_Init(initflags) < 0 ) {
os_fatal("Couldn't initialize SDL: %s", SDL_GetError());
}
+
+ sdl_active = TRUE;
+
/* We don't handle text edit events. Not that I know why anyone would
want to use such an IME with Frotz. */
SDL_SetHint(SDL_HINT_IME_INTERNAL_EDITING, "1");