Search
lxdream.org :: lxdream/src/main.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/main.c
changeset 370:3131ba1440fc
prev209:ff67a7b9aa17
next372:86aa060ddcec
author nkeynes
date Sat Sep 08 04:05:35 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Handle video driver init failure cleanly (fallback to headless)
Hookup shutdown for the GTK driver
file annotate diff log raw
1.1 --- a/src/main.c Mon Aug 07 13:18:16 2006 +0000
1.2 +++ b/src/main.c Sat Sep 08 04:05:35 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: main.c,v 1.20 2006-08-07 13:18:16 nkeynes Exp $
1.6 + * $Id: main.c,v 1.21 2007-09-08 04:05:35 nkeynes Exp $
1.7 *
1.8 * Main program, initializes dreamcast and gui, then passes control off to
1.9 * the gtk main loop (currently).
1.10 @@ -145,14 +145,19 @@
1.11 if( headless ) {
1.12 display_set_driver( &display_null_driver );
1.13 } else {
1.14 + gboolean initialized = FALSE;
1.15 for( i=0; display_driver_list[i] != NULL; i++ ) {
1.16 if( strcasecmp( display_driver_list[i]->name, display_driver_name ) == 0 ) {
1.17 - display_set_driver( display_driver_list[i] );
1.18 + initialized = display_set_driver( display_driver_list[i] );
1.19 break;
1.20 }
1.21 }
1.22 - if( display_driver_list[i] == NULL ) {
1.23 - ERROR( "Video driver '%s' not found, using null driver", display_driver_name );
1.24 + if( !initialized ) {
1.25 + if( display_driver_list[i] == NULL ) {
1.26 + ERROR( "Video driver '%s' not found, using null driver", display_driver_name );
1.27 + } else {
1.28 + ERROR( "Video driver '%s' failed to initialize, falling back to null driver", display_driver_name );
1.29 + }
1.30 display_set_driver( &display_null_driver );
1.31 }
1.32 }
.