Changeset - r15387:70dc7e2af543
[Not reviewed]
master
0 2 0
rubidium - 14 years ago 2010-06-30 22:17:53
rubidium@openttd.org
(svn r20040) -Codechange: some coding style + using proper types
2 files changed with 6 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/screenshot.cpp
Show inline comments
 
@@ -479,29 +479,31 @@ static const ScreenshotFormat _screensho
 
	{"BMP", "bmp", &MakeBMPImage},
 
	{"PCX", "pcx", &MakePCXImage},
 
};
 

	
 
void InitializeScreenshotFormats()
 
{
 
	int i, j;
 
	for (i = 0, j = 0; i != lengthof(_screenshot_formats); i++)
 
	uint j = 0;
 
	for (uint i = 0; i < lengthof(_screenshot_formats); i++) {
 
		if (!strcmp(_screenshot_format_name, _screenshot_formats[i].extension)) {
 
			j = i;
 
			break;
 
		}
 
	}
 
	_cur_screenshot_format = j;
 
	_num_screenshot_formats = lengthof(_screenshot_formats);
 
}
 

	
 
const char *GetScreenshotFormatDesc(int i)
 
{
 
	return _screenshot_formats[i].name;
 
}
 

	
 
void SetScreenshotFormat(int i)
 
void SetScreenshotFormat(uint i)
 
{
 
	assert(i < _num_screenshot_formats);
 
	_cur_screenshot_format = i;
 
	strecpy(_screenshot_format_name, _screenshot_formats[i].extension, lastof(_screenshot_format_name));
 
}
 

	
 
/* screenshot generator that dumps the current video buffer */
 
static void CurrentScreenCallback(void *userdata, void *buf, uint y, uint pitch, uint n)
src/screenshot.h
Show inline comments
 
@@ -12,13 +12,13 @@
 
#ifndef SCREENSHOT_H
 
#define SCREENSHOT_H
 

	
 
void InitializeScreenshotFormats();
 

	
 
const char *GetScreenshotFormatDesc(int i);
 
void SetScreenshotFormat(int i);
 
void SetScreenshotFormat(uint i);
 

	
 
/** Type of requested screenshot */
 
enum ScreenshotType {
 
	SC_VIEWPORT, ///< Screenshot of viewport
 
	SC_RAW,      ///< Raw screenshot from blitter buffer
 
	SC_WORLD,    ///< World screenshot
0 comments (0 inline, 0 general)