equal
deleted
inserted
replaced
11 #include "viewport.h" |
11 #include "viewport.h" |
12 #include "player.h" |
12 #include "player.h" |
13 #include "screenshot.h" |
13 #include "screenshot.h" |
14 #include "variables.h" |
14 #include "variables.h" |
15 #include "date.h" |
15 #include "date.h" |
|
16 #include "helpers.hpp" |
16 |
17 |
17 char _screenshot_format_name[8]; |
18 char _screenshot_format_name[8]; |
18 uint _num_screenshot_formats; |
19 uint _num_screenshot_formats; |
19 uint _cur_screenshot_format; |
20 uint _cur_screenshot_format; |
20 ScreenshotType current_screenshot_type; |
21 ScreenshotType current_screenshot_type; |
116 |
117 |
117 // use by default 64k temp memory |
118 // use by default 64k temp memory |
118 maxlines = clamp(65536 / padw, 16, 128); |
119 maxlines = clamp(65536 / padw, 16, 128); |
119 |
120 |
120 // now generate the bitmap bits |
121 // now generate the bitmap bits |
121 buff = malloc(padw * maxlines); // by default generate 128 lines at a time. |
122 MallocT(&buff, padw * maxlines); // by default generate 128 lines at a time. |
122 if (buff == NULL) { |
123 if (buff == NULL) { |
123 fclose(f); |
124 fclose(f); |
124 return false; |
125 return false; |
125 } |
126 } |
126 memset(buff, 0, padw * maxlines); // zero the buffer to have the padding bytes set to 0 |
127 memset(buff, 0, padw * maxlines); // zero the buffer to have the padding bytes set to 0 |
223 |
224 |
224 // use by default 64k temp memory |
225 // use by default 64k temp memory |
225 maxlines = clamp(65536 / w, 16, 128); |
226 maxlines = clamp(65536 / w, 16, 128); |
226 |
227 |
227 // now generate the bitmap bits |
228 // now generate the bitmap bits |
228 buff = malloc(w * maxlines); // by default generate 128 lines at a time. |
229 MallocT(&buff, w * maxlines); // by default generate 128 lines at a time. |
229 if (buff == NULL) { |
230 if (buff == NULL) { |
230 png_destroy_write_struct(&png_ptr, &info_ptr); |
231 png_destroy_write_struct(&png_ptr, &info_ptr); |
231 fclose(f); |
232 fclose(f); |
232 return false; |
233 return false; |
233 } |
234 } |
320 |
321 |
321 // use by default 64k temp memory |
322 // use by default 64k temp memory |
322 maxlines = clamp(65536 / w, 16, 128); |
323 maxlines = clamp(65536 / w, 16, 128); |
323 |
324 |
324 // now generate the bitmap bits |
325 // now generate the bitmap bits |
325 buff = malloc(w * maxlines); // by default generate 128 lines at a time. |
326 MallocT(&buff, w * maxlines); // by default generate 128 lines at a time. |
326 if (buff == NULL) { |
327 if (buff == NULL) { |
327 fclose(f); |
328 fclose(f); |
328 return false; |
329 return false; |
329 } |
330 } |
330 memset(buff, 0, w * maxlines); // zero the buffer to have the padding bytes set to 0 |
331 memset(buff, 0, w * maxlines); // zero the buffer to have the padding bytes set to 0 |