From ca7f9dec8eec3a5d5e508be37cace60d3eb3aa44 Mon Sep 17 00:00:00 2001 From: Ted John Date: Fri, 12 Jan 2018 22:53:41 +0000 Subject: [PATCH] Move function out of C extern --- src/openrct2/Game.cpp | 2 +- src/openrct2/interface/Viewport.cpp | 2 +- src/openrct2/world/Climate.cpp | 22 +++++++++++----------- src/openrct2/world/Climate.h | 4 +--- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index f2d7654941..1924783ec5 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -231,7 +231,7 @@ void update_palette_effects() uint32 shade = 0; if (gConfigGeneral.render_weather_gloom) { - auto paletteId = climate_get_weather_gloom_palette_id(&gClimateCurrent); + auto paletteId = climate_get_weather_gloom_palette_id(gClimateCurrent); if (paletteId != PALETTE_NULL) { shade = 1; diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 85936a5937..2beace9649 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -914,7 +914,7 @@ static void viewport_paint_column(rct_drawpixelinfo * dpi, uint32 viewFlags) static void viewport_paint_weather_gloom(rct_drawpixelinfo * dpi) { - FILTER_PALETTE_ID paletteId = climate_get_weather_gloom_palette_id(&gClimateCurrent); + auto paletteId = climate_get_weather_gloom_palette_id(gClimateCurrent); if (paletteId != PALETTE_NULL) { gfx_filter_rect( diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index 59ea981708..1dbac0c7f4 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -208,17 +208,6 @@ extern "C" climate_update_rain_sound(); climate_update_thunder_sound(); } - - FILTER_PALETTE_ID climate_get_weather_gloom_palette_id(const ClimateState * state) - { - auto paletteId = PALETTE_NULL; - auto gloom = state->WeatherGloom; - if (gloom < Util::CountOf(ClimateWeatherGloomColours)) - { - paletteId = ClimateWeatherGloomColours[gloom]; - } - return paletteId; - } } bool climate_is_raining() @@ -226,6 +215,17 @@ bool climate_is_raining() return gClimateCurrent.RainLevel != RAIN_LEVEL_NONE; } +FILTER_PALETTE_ID climate_get_weather_gloom_palette_id(const ClimateState &state) +{ + auto paletteId = PALETTE_NULL; + auto gloom = state.WeatherGloom; + if (gloom < Util::CountOf(ClimateWeatherGloomColours)) + { + paletteId = ClimateWeatherGloomColours[gloom]; + } + return paletteId; +} + uint32 climate_get_weather_sprite_id(const ClimateState &state) { uint32 spriteId = SPR_WEATHER_SUN; diff --git a/src/openrct2/world/Climate.h b/src/openrct2/world/Climate.h index a98537dee1..63d1e845b6 100644 --- a/src/openrct2/world/Climate.h +++ b/src/openrct2/world/Climate.h @@ -85,13 +85,11 @@ extern "C" void climate_update(); void climate_update_sound(); void climate_force_weather(uint8 weather); - - FILTER_PALETTE_ID climate_get_weather_gloom_palette_id(const ClimateState * state); - #ifdef __cplusplus } bool climate_is_raining(); +FILTER_PALETTE_ID climate_get_weather_gloom_palette_id(const ClimateState &state); uint32 climate_get_weather_sprite_id(const ClimateState &state); #endif