Search
lxdream.org :: lxdream :: r890:a9896953e9a1
lxdream 0.9.1
released Jun 29
Download Now
changeset890:a9896953e9a1
parent889:5baaea6d9722
child891:de9d08282160
authornkeynes
dateThu Oct 23 08:30:47 2008 +0000 (11 years ago)
Fix save-state load in headless mode
src/pvr2/pvr2.c
1.1 --- a/src/pvr2/pvr2.c Mon Oct 20 06:19:07 2008 +0000
1.2 +++ b/src/pvr2/pvr2.c Thu Oct 23 08:30:47 2008 +0000
1.3 @@ -212,12 +212,14 @@
1.4
1.5 }
1.6
1.7 -render_buffer_t pvr2_load_render_buffer( FILE *f )
1.8 +render_buffer_t pvr2_load_render_buffer( FILE *f, gboolean *status )
1.9 {
1.10 frame_buffer_t frame = read_png_from_stream( f );
1.11 if( frame == NULL ) {
1.12 + *status = FALSE;
1.13 return NULL;
1.14 }
1.15 + *status = TRUE;
1.16
1.17 render_buffer_t buffer = pvr2_frame_buffer_to_render_buffer(frame);
1.18 if( buffer != NULL ) {
1.19 @@ -263,6 +265,7 @@
1.20 gboolean pvr2_load_render_buffers( FILE *f )
1.21 {
1.22 uint32_t count, has_frontbuffer;
1.23 + gboolean loadok;
1.24 int i;
1.25
1.26 fread( &count, sizeof(count), 1, f );
1.27 @@ -277,15 +280,17 @@
1.28 render_buffer_count = 0;
1.29
1.30 if( has_frontbuffer ) {
1.31 - displayed_render_buffer = pvr2_load_render_buffer(f);
1.32 - if( displayed_render_buffer == NULL )
1.33 - return FALSE;
1.34 - display_driver->display_render_buffer( displayed_render_buffer );
1.35 + displayed_render_buffer = pvr2_load_render_buffer(f, &loadok);
1.36 + if( displayed_render_buffer != NULL )
1.37 + display_driver->display_render_buffer( displayed_render_buffer );
1.38 + else if( !loadok )
1.39 + return FALSE;
1.40 count--;
1.41 }
1.42
1.43 for( i=0; i<count; i++ ) {
1.44 - if( pvr2_load_render_buffer( f ) == NULL )
1.45 + pvr2_load_render_buffer( f, &loadok );
1.46 + if( !loadok )
1.47 return FALSE;
1.48 }
1.49 return TRUE;
.