aboutsummaryrefslogtreecommitdiff
path: root/scumm/smush
diff options
context:
space:
mode:
authorPaweł Kołodziejski2003-08-18 06:29:39 +0000
committerPaweł Kołodziejski2003-08-18 06:29:39 +0000
commit4bad55da8cc8e205df7222e2cf4d81780f4bd0af (patch)
tree28011991e4b3b58ccfae77bd5d9133f104db26c4 /scumm/smush
parentf29fbda7acebea50262c0e47adf6e4af227ca1fd (diff)
downloadscummvm-rg350-4bad55da8cc8e205df7222e2cf4d81780f4bd0af.tar.gz
scummvm-rg350-4bad55da8cc8e205df7222e2cf4d81780f4bd0af.tar.bz2
scummvm-rg350-4bad55da8cc8e205df7222e2cf4d81780f4bd0af.zip
fixed white spaces
svn-id: r9751
Diffstat (limited to 'scumm/smush')
-rw-r--r--scumm/smush/smush_player.cpp70
1 files changed, 35 insertions, 35 deletions
diff --git a/scumm/smush/smush_player.cpp b/scumm/smush/smush_player.cpp
index f60b23b3f5..214c8d9812 100644
--- a/scumm/smush/smush_player.cpp
+++ b/scumm/smush/smush_player.cpp
@@ -893,48 +893,48 @@ void SmushPlayer::updateScreen() {
FILE *file = fopen(fileName, "wb");
if (file == NULL)
error("can't open file for writing png");
-
- png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
+
+ png_structp png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, 0, 0, 0);
if (png_ptr == NULL) {
- fclose(file);
- error("can't write png header");
- }
- png_infop info_ptr = png_create_info_struct(png_ptr);
+ fclose(file);
+ error("can't write png header");
+ }
+ png_infop info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) {
- fclose(file);
- error("can't create png info struct");
- }
- if (setjmp(png_ptr->jmpbuf)) {
- fclose(file);
- error("png jmpbuf error");
- }
-
- png_init_io(png_ptr, file);
-
- png_set_IHDR(png_ptr, info_ptr, _width, _height, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
- PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+ fclose(file);
+ error("can't create png info struct");
+ }
+ if (setjmp(png_ptr->jmpbuf)) {
+ fclose(file);
+ error("png jmpbuf error");
+ }
+
+ png_init_io(png_ptr, file);
+
+ png_set_IHDR(png_ptr, info_ptr, _width, _height, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE,
+ PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
png_colorp palette = (png_colorp)png_malloc(png_ptr, PNG_MAX_PALETTE_LENGTH * sizeof (png_color));
for (int i = 0; i != 256; ++i) {
- (palette + i)->red = _pal[i * 3 + 0];
- (palette + i)->green = _pal[i * 3 + 1];
- (palette + i)->blue = _pal[i * 3 + 2];
+ (palette + i)->red = _pal[i * 3 + 0];
+ (palette + i)->green = _pal[i * 3 + 1];
+ (palette + i)->blue = _pal[i * 3 + 2];
}
-
+
png_set_PLTE(png_ptr, info_ptr, palette, PNG_MAX_PALETTE_LENGTH);
-
- png_write_info(png_ptr, info_ptr);
- png_set_flush(png_ptr, 10);
-
- png_bytep row_pointers[480];
- for (int y = 0 ; y < _height ; y++)
- row_pointers[y] = (png_byte *) (_dst + y * _width);
- png_write_image(png_ptr, row_pointers);
- png_write_end(png_ptr, info_ptr);
- png_free(png_ptr, palette);
-
- fclose(file);
- png_destroy_write_struct(&png_ptr, &info_ptr);
+
+ png_write_info(png_ptr, info_ptr);
+ png_set_flush(png_ptr, 10);
+
+ png_bytep row_pointers[480];
+ for (int y = 0 ; y < _height ; y++)
+ row_pointers[y] = (png_byte *) (_dst + y * _width);
+ png_write_image(png_ptr, row_pointers);
+ png_write_end(png_ptr, info_ptr);
+ png_free(png_ptr, palette);
+
+ fclose(file);
+ png_destroy_write_struct(&png_ptr, &info_ptr);
#endif
uint32 end_time, start_time = _scumm->_system->get_msecs();