mirror of https://github.com/OpenTTD/OpenTTD
(svn r20040) -Codechange: some coding style + using proper types
parent
939145c50b
commit
7062bb0bd7
|
@ -482,12 +482,13 @@ static const ScreenshotFormat _screenshot_formats[] = {
|
||||||
|
|
||||||
void InitializeScreenshotFormats()
|
void InitializeScreenshotFormats()
|
||||||
{
|
{
|
||||||
int i, j;
|
uint j = 0;
|
||||||
for (i = 0, j = 0; i != lengthof(_screenshot_formats); i++)
|
for (uint i = 0; i < lengthof(_screenshot_formats); i++) {
|
||||||
if (!strcmp(_screenshot_format_name, _screenshot_formats[i].extension)) {
|
if (!strcmp(_screenshot_format_name, _screenshot_formats[i].extension)) {
|
||||||
j = i;
|
j = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
_cur_screenshot_format = j;
|
_cur_screenshot_format = j;
|
||||||
_num_screenshot_formats = lengthof(_screenshot_formats);
|
_num_screenshot_formats = lengthof(_screenshot_formats);
|
||||||
}
|
}
|
||||||
|
@ -497,8 +498,9 @@ const char *GetScreenshotFormatDesc(int i)
|
||||||
return _screenshot_formats[i].name;
|
return _screenshot_formats[i].name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetScreenshotFormat(int i)
|
void SetScreenshotFormat(uint i)
|
||||||
{
|
{
|
||||||
|
assert(i < _num_screenshot_formats);
|
||||||
_cur_screenshot_format = i;
|
_cur_screenshot_format = i;
|
||||||
strecpy(_screenshot_format_name, _screenshot_formats[i].extension, lastof(_screenshot_format_name));
|
strecpy(_screenshot_format_name, _screenshot_formats[i].extension, lastof(_screenshot_format_name));
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
void InitializeScreenshotFormats();
|
void InitializeScreenshotFormats();
|
||||||
|
|
||||||
const char *GetScreenshotFormatDesc(int i);
|
const char *GetScreenshotFormatDesc(int i);
|
||||||
void SetScreenshotFormat(int i);
|
void SetScreenshotFormat(uint i);
|
||||||
|
|
||||||
/** Type of requested screenshot */
|
/** Type of requested screenshot */
|
||||||
enum ScreenshotType {
|
enum ScreenshotType {
|
||||||
|
|
Loading…
Reference in New Issue