Search
lxdream.org :: lxdream/src/pvr2/rendsave.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/rendsave.c
changeset 736:a02d1475ccfd
prev677:3ee62740ff8f
next934:3acd3b3ee6d1
author nkeynes
date Mon Sep 29 06:34:25 2008 +0000 (14 years ago)
permissions -rw-r--r--
last change Tidy up punchout handling slightly (doesn't really seem to need sorting...)
file annotate diff log raw
1.1 --- a/src/pvr2/rendsave.c Thu May 29 10:50:25 2008 +0000
1.2 +++ b/src/pvr2/rendsave.c Mon Sep 29 06:34:25 2008 +0000
1.3 @@ -49,20 +49,20 @@
1.4 int pvr2_render_save_scene( const gchar *filename )
1.5 {
1.6 struct header {
1.7 - char magic[16];
1.8 - uint32_t version;
1.9 - uint32_t timestamp;
1.10 - uint32_t frame_count;
1.11 + char magic[16];
1.12 + uint32_t version;
1.13 + uint32_t timestamp;
1.14 + uint32_t frame_count;
1.15 } scene_header;
1.16
1.17 char page_map[SAVE_PAGE_COUNT];
1.18 int i,j;
1.19 pvr2_find_referenced_pages(page_map);
1.20 -
1.21 +
1.22 FILE *f = fopen( filename, "wo" );
1.23 if( f == NULL ) {
1.24 - ERROR( "Unable to open file '%s' to write scene data: %s", filename, strerror(errno) );
1.25 - return -1;
1.26 + ERROR( "Unable to open file '%s' to write scene data: %s", filename, strerror(errno) );
1.27 + return -1;
1.28 }
1.29
1.30 /* Header */
1.31 @@ -81,16 +81,16 @@
1.32
1.33 /* Write out the VRAM pages we care about */
1.34 for( i=0; i<SAVE_PAGE_COUNT; i++ ) {
1.35 - if( page_map[i] != 0 ) {
1.36 - for( j=i+1; j<SAVE_PAGE_COUNT && page_map[j] != 0; j++ );
1.37 - /* Write region from i..j-1 */
1.38 - uint32_t start = i * SAVE_PAGE_SIZE;
1.39 - uint32_t length = (j-i) * SAVE_PAGE_SIZE;
1.40 - fwrite( &start, sizeof(uint32_t), 1, f );
1.41 - fwrite( &length, sizeof(uint32_t), 1, f );
1.42 - fwrite( video_base + start, 1, length, f );
1.43 - i = j-1;
1.44 - }
1.45 + if( page_map[i] != 0 ) {
1.46 + for( j=i+1; j<SAVE_PAGE_COUNT && page_map[j] != 0; j++ );
1.47 + /* Write region from i..j-1 */
1.48 + uint32_t start = i * SAVE_PAGE_SIZE;
1.49 + uint32_t length = (j-i) * SAVE_PAGE_SIZE;
1.50 + fwrite( &start, sizeof(uint32_t), 1, f );
1.51 + fwrite( &length, sizeof(uint32_t), 1, f );
1.52 + fwrite( video_base + start, 1, length, f );
1.53 + i = j-1;
1.54 + }
1.55 }
1.56 /* Write out the EOF marker */
1.57 uint32_t eof = 0xFFFFFFFF;
.