1 // ------------------------------------------------------------------
3 // ------------------------------------------------------------------
4 // This saves screenshoots of the current screen
5 // ------------------------------------------------------------------
6 // By Kronoman - In loving memory of my father
7 // Copyright (c) 2004, Kronoman
8 // ------------------------------------------------------------------
12 // ------------------------------------------------------------------
13 // This captures the screenshoot, using the file format
14 // of file extension (can be PCX, BMP, TGA)
16 // Will use [name][hex number].[extension] for the name
17 // The hex number starts counting at hex_start
18 // Will *not* overwrite files
19 // ------------------------------------------------------------------
20 void save_screenshoot(char *name
, int hex_start
, char *extension
)
27 // will try at least 4096 numbers from hex_start before giving up trying to save
30 usprintf(fname
, "%s%x.%s", name
, hex_start
+i
, extension
);
33 while (exists(fname
) && i
< 4096);
36 bmp
= create_sub_bitmap(screen
, 0, 0, SCREEN_W
, SCREEN_H
);
37 save_bitmap(fname
, bmp
, pal
);