From d00001fed20941e3ebf8cfde5ca5807b0f264ec8 Mon Sep 17 00:00:00 2001 From: IntelOrca Date: Sun, 30 Nov 2014 20:26:53 +0000 Subject: [PATCH] remove unnecessary header includes --- src/config.c | 1 - src/drawing/drawing.c | 6 ------ src/interface/viewport.c | 1 - src/interface/widget.c | 3 --- src/interface/window.c | 1 - src/localisation/language.c | 2 -- src/management/news_item.c | 1 - src/object.c | 1 - src/peep/peep.c | 2 -- src/platform/osinterface.c | 1 - src/platform/platform.h | 1 + src/platform/windows.c | 5 +++++ src/rct2.c | 6 ------ src/rct2.h | 6 ++++++ src/ride/ride.c | 1 - src/ride/ride_data.c | 1 - src/ride/ride_data.h | 1 - src/scenario.c | 8 ++++---- src/title.c | 1 - src/util/sawyercoding.c | 2 -- src/util/sawyercoding.h | 1 - src/windows/about.c | 2 -- src/windows/banner.c | 1 - src/windows/cheats.c | 3 --- src/windows/dropdown.c | 2 -- src/windows/editor_bottom_toolbar.c | 1 - src/windows/footpath.c | 1 - src/windows/game_bottom_toolbar.c | 2 -- src/windows/game_top_toolbar.c | 1 - src/windows/guest_list.c | 2 -- src/windows/map.c | 1 - src/windows/map_tooltip.c | 1 - src/windows/music_credits.c | 2 -- src/windows/new_campaign.c | 1 - src/windows/new_ride.c | 1 - src/windows/news.c | 1 - src/windows/options.c | 2 -- src/windows/park.c | 1 - src/windows/publisher_credits.c | 2 -- src/windows/ride.c | 1 - src/windows/ride_list.c | 1 - src/windows/scenery.c | 2 -- src/windows/sign.c | 1 - src/windows/staff_list.c | 1 - src/windows/title_scenarioselect.c | 1 - src/windows/tooltip.c | 2 -- src/windows/track_list.c | 1 - src/windows/track_place.c | 1 - src/windows/viewport.c | 1 - src/world/park.c | 1 - src/world/sprite.c | 3 +-- 51 files changed, 17 insertions(+), 78 deletions(-) diff --git a/src/config.c b/src/config.c index 53f11dac90..cdbb1d0e44 100644 --- a/src/config.c +++ b/src/config.c @@ -19,7 +19,6 @@ *****************************************************************************/ #include -#include #include "addresses.h" #include "config.h" #include "localisation/localisation.h" diff --git a/src/drawing/drawing.c b/src/drawing/drawing.c index c206a26834..c0a4ddd3f8 100644 --- a/src/drawing/drawing.c +++ b/src/drawing/drawing.c @@ -18,12 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include -#include -#include -#include -#include #include "../addresses.h" #include "../common.h" #include "../localisation/localisation.h" diff --git a/src/interface/viewport.c b/src/interface/viewport.c index dd756181ae..8903cd157c 100644 --- a/src/interface/viewport.c +++ b/src/interface/viewport.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../config.h" #include "../drawing/drawing.h" diff --git a/src/interface/widget.c b/src/interface/widget.c index 910f349bfa..b4c6ac0072 100644 --- a/src/interface/widget.c +++ b/src/interface/widget.c @@ -18,9 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include -#include #include "../addresses.h" #include "../drawing/drawing.h" #include "../input.h" diff --git a/src/interface/window.c b/src/interface/window.c index c1b5822142..c94ebff4e1 100644 --- a/src/interface/window.c +++ b/src/interface/window.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../game.h" diff --git a/src/localisation/language.c b/src/localisation/language.c index 17e24edd57..3168bf185f 100644 --- a/src/localisation/language.c +++ b/src/localisation/language.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "localisation.h" diff --git a/src/management/news_item.c b/src/management/news_item.c index 37c2996afd..6c315cdbb0 100644 --- a/src/management/news_item.c +++ b/src/management/news_item.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../input.h" diff --git a/src/object.c b/src/object.c index 45603c3f62..4a2dfb05b4 100644 --- a/src/object.c +++ b/src/object.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "addresses.h" #include "localisation/localisation.h" #include "object.h" diff --git a/src/peep/peep.c b/src/peep/peep.c index 444e309368..1a7dde9345 100644 --- a/src/peep/peep.c +++ b/src/peep/peep.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../audio/audio.h" #include "../audio/mixer.h" diff --git a/src/platform/osinterface.c b/src/platform/osinterface.c index 9e5f2eb0e7..a7d6577071 100644 --- a/src/platform/osinterface.c +++ b/src/platform/osinterface.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include #include #include diff --git a/src/platform/platform.h b/src/platform/platform.h index 4c29800160..0cd62e38db 100644 --- a/src/platform/platform.h +++ b/src/platform/platform.h @@ -38,5 +38,6 @@ void platform_hide_cursor(); void platform_show_cursor(); void platform_get_cursor_position(int *x, int *y); void platform_set_cursor_position(int x, int y); +unsigned int platform_get_ticks(); #endif \ No newline at end of file diff --git a/src/platform/windows.c b/src/platform/windows.c index a6647bce99..302f151e97 100644 --- a/src/platform/windows.c +++ b/src/platform/windows.c @@ -215,6 +215,11 @@ void platform_set_cursor_position(int x, int y) SetCursorPos(x, y); } +unsigned int platform_get_ticks() +{ + return GetTickCount(); +} + /** * http://alter.org.ua/en/docs/win/args/ */ diff --git a/src/rct2.c b/src/rct2.c index 90f200b10c..e14868fcb2 100644 --- a/src/rct2.c +++ b/src/rct2.c @@ -21,12 +21,6 @@ #pragma warning(disable : 4996) // GetVersionExA deprecated #include -#ifdef _MSC_VER -#include -#endif -#include -#include -#include #include "addresses.h" #include "audio/audio.h" #include "audio/mixer.h" diff --git a/src/rct2.h b/src/rct2.h index 428e6e5812..af4c77fe19 100644 --- a/src/rct2.h +++ b/src/rct2.h @@ -22,12 +22,18 @@ #define _RCT2_H_ #include +#include +#include #include #include #include #include #include +#ifdef _MSC_VER + #include +#endif + typedef signed char sint8; typedef signed short sint16; typedef signed long sint32; diff --git a/src/ride/ride.c b/src/ride/ride.c index 17af180237..0ddf613ac3 100644 --- a/src/ride/ride.c +++ b/src/ride/ride.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../audio/mixer.h" diff --git a/src/ride/ride_data.c b/src/ride/ride_data.c index d6645eef1a..5ba1213a73 100644 --- a/src/ride/ride_data.c +++ b/src/ride/ride_data.c @@ -8,7 +8,6 @@ * https://gist.github.com/kevinburke/eaeb1d8149a6eef0dcc1 */ -#include #include "ride.h" #include "ride_data.h" diff --git a/src/ride/ride_data.h b/src/ride/ride_data.h index d45438480d..c2e81cc9f8 100644 --- a/src/ride/ride_data.h +++ b/src/ride/ride_data.h @@ -21,7 +21,6 @@ #ifndef _RIDE_DATA_H_ #define _RIDE_DATA_H_ -#include #include "../common.h" typedef struct { diff --git a/src/scenario.c b/src/scenario.c index ea494e8a2e..0409a4aadf 100644 --- a/src/scenario.c +++ b/src/scenario.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include "title.h" #include "addresses.h" #include "game.h" #include "interface/viewport.h" @@ -30,8 +28,10 @@ #include "management/marketing.h" #include "management/news_item.h" #include "object.h" +#include "platform/platform.h" #include "ride/ride.h" #include "scenario.h" +#include "title.h" #include "util/sawyercoding.h" #include "util/util.h" #include "world/map.h" @@ -201,8 +201,8 @@ int scenario_load_and_play_from_path(const char *path) // Create the scenario pseduo-random seeds using the current time uint32 srand0, srand1; - srand0 = RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_SRAND_0, uint32) ^ timeGetTime(); - srand1 = RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_SRAND_1, uint32) ^ timeGetTime(); + srand0 = RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_SRAND_0, uint32) ^ platform_get_ticks(); + srand1 = RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_SRAND_1, uint32) ^ platform_get_ticks(); window_close_construction_windows(); diff --git a/src/title.c b/src/title.c index ff224451b7..018277050d 100644 --- a/src/title.c +++ b/src/title.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "addresses.h" #include "audio/audio.h" #include "config.h" diff --git a/src/util/sawyercoding.c b/src/util/sawyercoding.c index 36c21860d1..221d7761fa 100644 --- a/src/util/sawyercoding.c +++ b/src/util/sawyercoding.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "sawyercoding.h" diff --git a/src/util/sawyercoding.h b/src/util/sawyercoding.h index 2845e7368f..d7993d391a 100644 --- a/src/util/sawyercoding.h +++ b/src/util/sawyercoding.h @@ -21,7 +21,6 @@ #ifndef _SAWYERCODING_H_ #define _SAWYERCODING_H_ -#include #include "../common.h" typedef struct { diff --git a/src/windows/about.c b/src/windows/about.c index 29d433724e..78922b0c05 100644 --- a/src/windows/about.c +++ b/src/windows/about.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../localisation/localisation.h" #include "../sprites.h" diff --git a/src/windows/banner.c b/src/windows/banner.c index 7c28249050..3fc77ed2f1 100644 --- a/src/windows/banner.c +++ b/src/windows/banner.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../game.h" #include "../config.h" diff --git a/src/windows/cheats.c b/src/windows/cheats.c index 42a5dd085e..c400bb42ed 100644 --- a/src/windows/cheats.c +++ b/src/windows/cheats.c @@ -18,9 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include -#include #include "../addresses.h" #include "../game.h" #include "../interface/widget.h" diff --git a/src/windows/dropdown.c b/src/windows/dropdown.c index e6fe3b9326..a4cf76fc46 100644 --- a/src/windows/dropdown.c +++ b/src/windows/dropdown.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../input.h" #include "../interface/widget.h" diff --git a/src/windows/editor_bottom_toolbar.c b/src/windows/editor_bottom_toolbar.c index 5a357a8209..8cce5e0074 100644 --- a/src/windows/editor_bottom_toolbar.c +++ b/src/windows/editor_bottom_toolbar.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../config.h" diff --git a/src/windows/footpath.c b/src/windows/footpath.c index a857e58866..0c483e4df9 100644 --- a/src/windows/footpath.c +++ b/src/windows/footpath.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../game.h" diff --git a/src/windows/game_bottom_toolbar.c b/src/windows/game_bottom_toolbar.c index 1691e5cf4c..4374968647 100644 --- a/src/windows/game_bottom_toolbar.c +++ b/src/windows/game_bottom_toolbar.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../localisation/date.h" #include "../localisation/localisation.h" diff --git a/src/windows/game_top_toolbar.c b/src/windows/game_top_toolbar.c index 92a77f1e6c..79b47e9139 100644 --- a/src/windows/game_top_toolbar.c +++ b/src/windows/game_top_toolbar.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../game.h" #include "../input.h" diff --git a/src/windows/guest_list.c b/src/windows/guest_list.c index dba63db5a2..1d9ec23465 100644 --- a/src/windows/guest_list.c +++ b/src/windows/guest_list.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../game.h" #include "../interface/widget.h" diff --git a/src/windows/map.c b/src/windows/map.c index 3ad06cf042..47128823da 100644 --- a/src/windows/map.c +++ b/src/windows/map.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../localisation/localisation.h" #include "../input.h" diff --git a/src/windows/map_tooltip.c b/src/windows/map_tooltip.c index 6301b322cc..3832471df4 100644 --- a/src/windows/map_tooltip.c +++ b/src/windows/map_tooltip.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../localisation/localisation.h" #include "../input.h" diff --git a/src/windows/music_credits.c b/src/windows/music_credits.c index 352c04d02d..63158c5bbe 100644 --- a/src/windows/music_credits.c +++ b/src/windows/music_credits.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../localisation/localisation.h" #include "../sprites.h" diff --git a/src/windows/new_campaign.c b/src/windows/new_campaign.c index 51d5a03340..b21dc913e7 100644 --- a/src/windows/new_campaign.c +++ b/src/windows/new_campaign.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../game.h" #include "../localisation/localisation.h" diff --git a/src/windows/new_ride.c b/src/windows/new_ride.c index 40040a2c3a..a05f4277e3 100644 --- a/src/windows/new_ride.c +++ b/src/windows/new_ride.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../game.h" diff --git a/src/windows/news.c b/src/windows/news.c index ee5e69845e..38948473e1 100644 --- a/src/windows/news.c +++ b/src/windows/news.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../management/news_item.h" diff --git a/src/windows/options.c b/src/windows/options.c index cd1d11cc48..b91ea8c68a 100644 --- a/src/windows/options.c +++ b/src/windows/options.c @@ -26,8 +26,6 @@ * Padding between the widgets and the window needs reducing, an artifact from originally being inside group boxes. */ -#include - #include "../addresses.h" #include "../audio/audio.h" #include "../audio/mixer.h" diff --git a/src/windows/park.c b/src/windows/park.c index e9dc5d9290..19fe4eb853 100644 --- a/src/windows/park.c +++ b/src/windows/park.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../config.h" #include "../game.h" diff --git a/src/windows/publisher_credits.c b/src/windows/publisher_credits.c index 4bc9d810d9..1a77ac8a52 100644 --- a/src/windows/publisher_credits.c +++ b/src/windows/publisher_credits.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../localisation/localisation.h" #include "../sprites.h" diff --git a/src/windows/ride.c b/src/windows/ride.c index 4134380b6c..3d279f5a6f 100644 --- a/src/windows/ride.c +++ b/src/windows/ride.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../game.h" #include "../input.h" diff --git a/src/windows/ride_list.c b/src/windows/ride_list.c index bbd21870b1..d4e169c9bd 100644 --- a/src/windows/ride_list.c +++ b/src/windows/ride_list.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../game.h" #include "../ride/ride.h" diff --git a/src/windows/scenery.c b/src/windows/scenery.c index 06f53d71ad..02ad9a6ac3 100644 --- a/src/windows/scenery.c +++ b/src/windows/scenery.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../audio/audio.h" #include "../drawing/drawing.h" diff --git a/src/windows/sign.c b/src/windows/sign.c index ae512242a3..aafae6f398 100644 --- a/src/windows/sign.c +++ b/src/windows/sign.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../game.h" #include "../config.h" diff --git a/src/windows/staff_list.c b/src/windows/staff_list.c index f3fd9129c8..a173993971 100644 --- a/src/windows/staff_list.c +++ b/src/windows/staff_list.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../game.h" #include "../drawing/drawing.h" diff --git a/src/windows/title_scenarioselect.c b/src/windows/title_scenarioselect.c index 8bb1cbfec5..acc362dc7d 100644 --- a/src/windows/title_scenarioselect.c +++ b/src/windows/title_scenarioselect.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../localisation/date.h" diff --git a/src/windows/tooltip.c b/src/windows/tooltip.c index 2031f6b2e5..507e9db2f3 100644 --- a/src/windows/tooltip.c +++ b/src/windows/tooltip.c @@ -18,8 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include -#include #include "../addresses.h" #include "../drawing/drawing.h" #include "../localisation/localisation.h" diff --git a/src/windows/track_list.c b/src/windows/track_list.c index b651bb7c04..ee5f4a6686 100644 --- a/src/windows/track_list.c +++ b/src/windows/track_list.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../editor.h" diff --git a/src/windows/track_place.c b/src/windows/track_place.c index a6e73936eb..e5e586f2d1 100644 --- a/src/windows/track_place.c +++ b/src/windows/track_place.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../game.h" diff --git a/src/windows/viewport.c b/src/windows/viewport.c index b340128525..924926ad1b 100644 --- a/src/windows/viewport.c +++ b/src/windows/viewport.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../audio/audio.h" #include "../game.h" diff --git a/src/world/park.c b/src/world/park.c index 641f90fe47..7115b5b88d 100644 --- a/src/world/park.c +++ b/src/world/park.c @@ -18,7 +18,6 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" #include "../interface/window.h" #include "../localisation/localisation.h" diff --git a/src/world/sprite.c b/src/world/sprite.c index 965a821d34..b21927e1e3 100644 --- a/src/world/sprite.c +++ b/src/world/sprite.c @@ -18,10 +18,9 @@ * along with this program. If not, see . *****************************************************************************/ -#include #include "../addresses.h" -#include "sprite.h" #include "../interface/viewport.h" +#include "sprite.h" rct_sprite* g_sprite_list = RCT2_ADDRESS(RCT2_ADDRESS_SPRITE_LIST, rct_sprite);