Add option to disable weather gloom and rain effects

This commit is contained in:
wolfreak99 2016-08-16 18:23:16 -04:00
parent 843d865f01
commit c60396cb53
9 changed files with 38 additions and 13 deletions

View File

@ -4228,6 +4228,9 @@ STR_5916 :{COMMA16} player
STR_5917 :{COMMA16} players
STR_5918 :{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{POP16}{COMMA16}
STR_5919 :{COMMA16}
STR_5920 :Render weather effects
STR_5921 :{SMALLFONT}{BLACK}If enabled, rain and gloomy colours will be rendered during storms.
#############
# Scenarios #

View File

@ -1,5 +1,6 @@
0.0.5 (in development)
------------------------------------------------------------------------
- Feature: Ability to disable rendering of weather effects and gloom
- Feature: New view option: "See-Through Paths"
- Feature: Add cheat to reset date.
- Feature: Add OpenGL drawing engine.
@ -8,7 +9,7 @@
- Feature: Add ride console command for diagnostics and changing vehicle type.
- Feature: Allow selecting corners when using the mountain tool.
- Feature: Allow setting ownership of map edges.
- Feature: Allow up to 255 cars per train.
- Feature: Allow up to 255 cars per train and 32 track units per station
- Feature: Importing SV4 and SC4 files with rides.
- Feature: Filter Object Selection Window by "Selected only" and "Non-selected only"
- Feature: Allow raising terrain to 64 in-game units.

View File

@ -227,6 +227,8 @@ config_property_definition _generalDefinitions[] = {
{ offsetof(general_configuration, last_save_track_directory), "last_track_directory", CONFIG_VALUE_TYPE_STRING, { .value_string = NULL }, NULL },
{ offsetof(general_configuration, window_limit), "window_limit", CONFIG_VALUE_TYPE_UINT8, WINDOW_LIMIT_MAX, NULL },
{ offsetof(general_configuration, zoom_to_cursor), "zoom_to_cursor", CONFIG_VALUE_TYPE_BOOLEAN, true, NULL },
{ offsetof(general_configuration, render_weather_effects), "render_weather_effects", CONFIG_VALUE_TYPE_BOOLEAN, true, NULL },
{ offsetof(general_configuration, render_weather_gloom), "render_weather_gloom", CONFIG_VALUE_TYPE_BOOLEAN, true, NULL },
};
config_property_definition _interfaceDefinitions[] = {

View File

@ -200,6 +200,8 @@ typedef struct general_configuration {
utf8string last_save_track_directory;
uint8 window_limit;
uint8 zoom_to_cursor;
uint8 render_weather_effects;
uint8 render_weather_gloom;
} general_configuration;
typedef struct interface_configuration {

View File

@ -19,6 +19,7 @@ extern "C"
#include "../interface/window.h"
#include "../world/climate.h"
#include "drawing.h"
#include "../config.h"
}
#include "IDrawingEngine.h"
@ -86,6 +87,9 @@ static void DrawRainWindow(IRainDrawer * rainDrawer,
sint16 bottom,
uint32 rainType)
{
if (!gConfigGeneral.render_weather_effects)
return;
rct_window * newWindow = gWindowNextSlot;
rct_window * w = original_w + 1; // Start from second window
for (; ; w++)

View File

@ -186,7 +186,7 @@ void update_palette_effects()
int q = 0;
extern const sint32 WeatherColours[4];
int weather_colour = WeatherColours[gClimateCurrentWeatherGloom];
if (weather_colour != -1) {
if (weather_colour != -1 && gConfigGeneral.render_weather_gloom) {
q = 1;
if (weather_colour != 0x2000031) {
q = 2;

View File

@ -777,7 +777,7 @@ void viewport_paint(rct_viewport* viewport, rct_drawpixelinfo* dpi, int left, in
paint_quadrant_ps();
int weather_colour = WeatherColours[gClimateCurrentWeatherGloom];
if ((weather_colour != -1) && (!(gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES)) && !gTrackDesignSaveMode) {
if ((weather_colour != -1) && (!(gCurrentViewportFlags & VIEWPORT_FLAG_INVISIBLE_SPRITES)) && !gTrackDesignSaveMode && gConfigGeneral.render_weather_gloom) {
gfx_fill_rect(dpi2, dpi2->x, dpi2->y, dpi2->width + dpi2->x - 1, dpi2->height + dpi2->y - 1, weather_colour);
}
viewport_draw_money_effects();

View File

@ -3570,6 +3570,8 @@ enum {
STR_MULTIPLAYER_PLAYER_COUNT_PLURAL = 5917,
STR_SERVER_MAX_PLAYERS_VALUE = 5918,
STR_COMMA16 = 5919,
STR_RENDER_WEATHER_EFFECTS = 5920,
STR_RENDER_WEATHER_EFFECTS_TIP = 5921,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
STR_COUNT = 32768

View File

@ -97,7 +97,8 @@ enum WINDOW_OPTIONS_WIDGET_IDX {
WIDX_DAY_NIGHT_CHECKBOX,
WIDX_UPPER_CASE_BANNERS_CHECKBOX,
WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX,
WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX,
// Culture / Units
WIDX_LANGUAGE = WIDX_PAGE_START,
WIDX_LANGUAGE_DROPDOWN,
@ -224,14 +225,15 @@ static rct_widget window_options_display_widgets[] = {
static rct_widget window_options_rendering_widgets[] = {
MAIN_OPTIONS_WIDGETS,
#define FRAME_RENDERING_START 53
{ WWT_GROUPBOX, 1, 5, 304, FRAME_RENDERING_START + 0, FRAME_RENDERING_START + 106, STR_RENDERING_GROUP, STR_NONE }, // Rendering group
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 15, FRAME_RENDERING_START + 26, STR_TILE_SMOOTHING, STR_TILE_SMOOTHING_TIP }, // Landscape smoothing
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 30, FRAME_RENDERING_START + 41, STR_GRIDLINES, STR_GRIDLINES_TIP }, // Gridlines
{ WWT_DROPDOWN, 1, 155, 299, FRAME_RENDERING_START + 45, FRAME_RENDERING_START + 55, STR_NONE, STR_NONE }, // Construction marker
{ WWT_DROPDOWN_BUTTON, 1, 288, 298, FRAME_RENDERING_START + 46, FRAME_RENDERING_START + 54, STR_DROPDOWN_GLYPH, STR_CONSTRUCTION_MARKER_COLOUR_TIP },
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 60, FRAME_RENDERING_START + 71, STR_CYCLE_DAY_NIGHT, STR_CYCLE_DAY_NIGHT_TIP }, // Cycle day-night
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 75, FRAME_RENDERING_START + 86, STR_UPPERCASE_BANNERS, STR_UPPERCASE_BANNERS_TIP }, // Uppercase banners
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 90, FRAME_RENDERING_START + 101, STR_DISABLE_LIGHTNING_EFFECT, STR_DISABLE_LIGHTNING_EFFECT_TIP }, // Disable lightning effect
{ WWT_GROUPBOX, 1, 5, 304, FRAME_RENDERING_START + 0, FRAME_RENDERING_START + 136, STR_RENDERING_GROUP, STR_NONE }, // Rendering group
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 15, FRAME_RENDERING_START + 26, STR_TILE_SMOOTHING, STR_TILE_SMOOTHING_TIP }, // Landscape smoothing
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 30, FRAME_RENDERING_START + 41, STR_GRIDLINES, STR_GRIDLINES_TIP }, // Gridlines
{ WWT_DROPDOWN, 1, 155, 299, FRAME_RENDERING_START + 45, FRAME_RENDERING_START + 55, STR_NONE, STR_NONE }, // Construction marker
{ WWT_DROPDOWN_BUTTON, 1, 288, 298, FRAME_RENDERING_START + 46, FRAME_RENDERING_START + 54, STR_DROPDOWN_GLYPH, STR_CONSTRUCTION_MARKER_COLOUR_TIP },
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 60, FRAME_RENDERING_START + 71, STR_CYCLE_DAY_NIGHT, STR_CYCLE_DAY_NIGHT_TIP }, // Cycle day-night
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 75, FRAME_RENDERING_START + 86, STR_UPPERCASE_BANNERS, STR_UPPERCASE_BANNERS_TIP }, // Uppercase banners
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 90, FRAME_RENDERING_START + 101, STR_DISABLE_LIGHTNING_EFFECT, STR_DISABLE_LIGHTNING_EFFECT_TIP }, // Disable lightning effect
{ WWT_CHECKBOX, 1, 10, 290, FRAME_RENDERING_START + 105, FRAME_RENDERING_START + 116, STR_RENDER_WEATHER_EFFECTS, STR_RENDER_WEATHER_EFFECTS_TIP }, // Render weather effects
#undef FRAME_RENDERING_START
{ WIDGETS_END },
};
@ -463,7 +465,8 @@ static uint32 window_options_page_enabled_widgets[] = {
(1 << WIDX_CONSTRUCTION_MARKER_DROPDOWN) |
(1 << WIDX_DAY_NIGHT_CHECKBOX) |
(1 << WIDX_UPPER_CASE_BANNERS_CHECKBOX) |
(1 << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX),
(1 << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX) |
(1 << WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX),
MAIN_OPTIONS_ENABLED_WIDGETS |
(1 << WIDX_LANGUAGE) |
@ -651,6 +654,12 @@ static void window_options_mouseup(rct_window *w, int widgetIndex)
config_save_default();
window_invalidate(w);
break;
case WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX:
gConfigGeneral.render_weather_effects ^= 1;
gConfigGeneral.render_weather_gloom = gConfigGeneral.render_weather_effects;
config_save_default();
gfx_invalidate_screen();
break;
}
break;
@ -1462,6 +1471,7 @@ static void window_options_invalidate(rct_window *w)
widget_set_checkbox_value(w, WIDX_DAY_NIGHT_CHECKBOX, gConfigGeneral.day_night_cycle);
widget_set_checkbox_value(w, WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.upper_case_banners);
widget_set_checkbox_value(w, WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, gConfigGeneral.disable_lightning_effect);
widget_set_checkbox_value(w, WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX, gConfigGeneral.render_weather_effects || gConfigGeneral.render_weather_gloom);
// construction marker: white/translucent
static const rct_string_id construction_marker_colours[] = {
@ -1477,6 +1487,7 @@ static void window_options_invalidate(rct_window *w)
window_options_rendering_widgets[WIDX_DAY_NIGHT_CHECKBOX].type = WWT_CHECKBOX;
window_options_rendering_widgets[WIDX_UPPER_CASE_BANNERS_CHECKBOX].type = WWT_CHECKBOX;
window_options_rendering_widgets[WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX].type = WWT_CHECKBOX;
window_options_rendering_widgets[WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX].type = WWT_CHECKBOX;
break;
case WINDOW_OPTIONS_PAGE_CULTURE: