1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Settings: Use enum for screenshot format, Extension name for screenshot format in config file

This commit is contained in:
atmaxinger
2014-05-03 22:30:29 +02:00
parent e5c79f051c
commit 5360a207b5
3 changed files with 11 additions and 8 deletions

View File

@@ -223,7 +223,7 @@ static void config_create_default(char *path)
fp = fopen(path, "w");
fprintf(fp, "[general]\n");
fprintf(fp, "game_path = %s\n", gConfig.game_path);
fprintf(fp, "screenshot_format = 1\n");
fprintf(fp, "screenshot_format = PNG\n");
fclose(fp);
}
@@ -245,10 +245,12 @@ static void config_parse_settings(FILE *fp)
if (strcmp(setting, "game_path") == 0){
strcpy(gConfig.game_path, value); // TODO: change to copy correct amount of bytes
} else if(strcmp(setting, "screenshot_format") == 0) {
if (strcmp(value, "1") == 0) {
gConfig.screenshot_format = 1;
if (strcmp(value, "png") == 0 || strcmp(value, "PNG") == 0) {
gConfig.screenshot_format = SCREENSHOT_FORMAT_PNG;
} else if (strcmp(value, "1") == 0) { // Maybe remove that? WARNING: Breaks existing config files
gConfig.screenshot_format = SCREENSHOT_FORMAT_PNG;
} else {
gConfig.screenshot_format = 0;
gConfig.screenshot_format = SCREENSHOT_FORMAT_BMP;
}
}
}

View File

@@ -66,6 +66,11 @@ enum {
SHORTCUT_COUNT
};
enum {
SCREENSHOT_FORMAT_BMP,
SCREENSHOT_FORMAT_PNG
};
extern uint16 gShortcutKeys[SHORTCUT_COUNT];
void config_reset_shortcut_keys();

View File

@@ -29,10 +29,6 @@
#include "strings.h"
#include "window_error.h"
enum {
SCREENSHOT_FORMAT_BMP,
SCREENSHOT_FORMAT_PNG
};
static int screenshot_dump_bmp();
static int screenshot_dump_png();