1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-22 14:24:33 +01:00

Removed support for BMP screenshots

This commit is contained in:
Gymnasiast
2016-05-24 20:05:12 +02:00
parent 07beb2db84
commit 476cebca53
5 changed files with 6 additions and 54 deletions

View File

@@ -892,7 +892,7 @@ STR_0886 :Quit Game
STR_0887 :Quit Scenario Editor
STR_0888 :Quit Roller Coaster Designer
STR_0889 :Quit Track Designs Manager
STR_0890 :SCR{COMMA16}.BMP
STR_0890 :<removed string - do not use>
STR_0891 :Screenshot
STR_0892 :Screenshot saved to disk as '{STRINGID}'
STR_0893 :Screenshot failed !

View File

@@ -90,12 +90,6 @@ typedef struct config_section_definition {
#pragma region Enum definitions
config_enum_definition _screenShotFormatEnum[] = {
{ "BMP", SCREENSHOT_FORMAT_BMP },
{ "PNG", SCREENSHOT_FORMAT_PNG },
END_OF_ENUM
};
config_enum_definition _measurementFormatEnum[] = {
{ "IMPERIAL", MEASUREMENT_FORMAT_IMPERIAL },
{ "METRIC", MEASUREMENT_FORMAT_METRIC },
@@ -180,7 +174,6 @@ config_property_definition _generalDefinitions[] = {
{ offsetof(general_configuration, play_intro), "play_intro", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
{ offsetof(general_configuration, save_plugin_data), "save_plugin_data", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
{ offsetof(general_configuration, debugging_tools), "debugging_tools", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
{ offsetof(general_configuration, screenshot_format), "screenshot_format", CONFIG_VALUE_TYPE_UINT8, SCREENSHOT_FORMAT_PNG, _screenShotFormatEnum },
{ offsetof(general_configuration, show_height_as_units), "show_height_as_units", CONFIG_VALUE_TYPE_BOOLEAN, false, NULL },
{ offsetof(general_configuration, temperature_format), "temperature_format", CONFIG_VALUE_TYPE_UINT8, TEMPERATURE_FORMAT_C, _temperatureFormatEnum },
{ offsetof(general_configuration, window_height), "window_height", CONFIG_VALUE_TYPE_SINT32, -1, NULL },

View File

@@ -82,11 +82,6 @@ enum {
SHORTCUT_COUNT
};
enum {
SCREENSHOT_FORMAT_BMP,
SCREENSHOT_FORMAT_PNG
};
enum {
TEMPERATURE_FORMAT_C,
TEMPERATURE_FORMAT_F

View File

@@ -29,9 +29,6 @@
#include "screenshot.h"
#include "viewport.h"
static const char *_screenshot_format_extension[] = { ".bmp", ".png" };
static int screenshot_dump_bmp();
static int screenshot_dump_png();
/**
@@ -75,7 +72,7 @@ static void screenshot_get_rendered_palette(rct_palette* palette) {
}
}
static int screenshot_get_next_path(char *path, int format)
static int screenshot_get_next_path(char *path)
{
char screenshotPath[MAX_PATH];
@@ -90,7 +87,7 @@ static int screenshot_get_next_path(char *path, int format)
set_format_arg(0, uint16, i);
// Glue together path and filename
sprintf(path, "%sSCR%d%s", screenshotPath, i, _screenshot_format_extension[format]);
sprintf(path, "%sSCR%d.png", screenshotPath, i);
if (!platform_file_exists(path)) {
return i;
@@ -103,39 +100,7 @@ static int screenshot_get_next_path(char *path, int format)
int screenshot_dump()
{
switch (gConfigGeneral.screenshot_format) {
case SCREENSHOT_FORMAT_BMP:
return screenshot_dump_bmp();
case SCREENSHOT_FORMAT_PNG:
return screenshot_dump_png();
default:
return -1;
}
}
/**
*
* rct2: 0x00683D20
*/
int screenshot_dump_bmp()
{
// Get a free screenshot path
int index;
char path[MAX_PATH] = "";
if ((index = screenshot_get_next_path(path, SCREENSHOT_FORMAT_BMP)) == -1) {
return -1;
}
rct_drawpixelinfo *dpi = &gScreenDPI;
rct_palette renderedPalette;
screenshot_get_rendered_palette(&renderedPalette);
if (image_io_bmp_write(dpi, &renderedPalette, path)) {
return index;
} else {
return -1;
}
return screenshot_dump_png();
}
int screenshot_dump_png()
@@ -143,7 +108,7 @@ int screenshot_dump_png()
// Get a free screenshot path
int index;
char path[MAX_PATH] = "";
if ((index = screenshot_get_next_path(path, SCREENSHOT_FORMAT_PNG)) == -1) {
if ((index = screenshot_get_next_path(path)) == -1) {
return -1;
}
@@ -233,7 +198,7 @@ void screenshot_giant()
// Get a free screenshot path
char path[MAX_PATH];
int index;
if ((index = screenshot_get_next_path(path, SCREENSHOT_FORMAT_PNG)) == -1) {
if ((index = screenshot_get_next_path(path)) == -1) {
log_error("Giant screenshot failed, unable to find a suitable destination path.");
window_error_open(STR_SCREENSHOT_FAILED, -1);
return;

View File

@@ -120,7 +120,6 @@ enum {
STR_QUIT_SCENARIO_EDITOR = 887,
STR_QUIT_ROLLERCOASTER_DESIGNER = 888,
STR_QUIT_TRACK_DESIGNS_MANAGER = 889,
STR_SCR_BMP = 890,
STR_SCREENSHOT = 891,
STR_SCREENSHOT_SAVED_AS = 892,
STR_SCREENSHOT_FAILED = 893,