Merge branch 'settings-screenshot-enum-extension' of https://github.com/atmaxinger/OpenRCT2 into atmaxinger-settings-screenshot-enum-extension

This commit is contained in:
IntelOrca 2014-05-03 23:35:25 +01:00
commit 7e6800dc0d
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();