# HG changeset patch # User rubidium # Date 1198366228 0 # Node ID 3bc6351e73690c4d43af1536fccac7621348ec96 # Parent 7128bb2b57a3a1942dac1fd50c2beab25c8a76b9 (svn r11682) -Codechange: move some 'generic' geometry related types into a single file and do not include gfx.h everywhere to get a Point type. diff -r 7128bb2b57a3 -r 3bc6351e7369 src/aircraft_gui.cpp --- a/src/aircraft_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/aircraft_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -12,7 +12,6 @@ #include "map.h" #include "gui.h" #include "vehicle.h" -#include "gfx.h" #include "engine.h" #include "viewport.h" #include "player.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/airport_gui.cpp --- a/src/airport_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/airport_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -12,7 +12,6 @@ #include "gui.h" #include "station_gui.h" #include "viewport.h" -#include "gfx.h" #include "sound.h" #include "command_func.h" #include "vehicle.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/blitter/base.hpp --- a/src/blitter/base.hpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/blitter/base.hpp Sat Dec 22 23:30:28 2007 +0000 @@ -5,6 +5,7 @@ #include "../spritecache.h" #include "../spriteloader/spriteloader.hpp" +#include "../zoom.hpp" enum BlitterMode { BM_NORMAL, diff -r 7128bb2b57a3 -r 3bc6351e7369 src/bridge_gui.cpp --- a/src/bridge_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/bridge_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -10,7 +10,6 @@ #include "gui.h" #include "window_gui.h" #include "viewport.h" -#include "gfx.h" #include "command_func.h" #include "economy_func.h" #include "sound.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/build_vehicle_gui.cpp --- a/src/build_vehicle_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/build_vehicle_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -15,7 +15,6 @@ #include "gui.h" #include "vehicle.h" #include "articulated_vehicles.h" -#include "gfx.h" #include "textbuf_gui.h" #include "station.h" #include "command_func.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/console.cpp --- a/src/console.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/console.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -9,7 +9,6 @@ #include "gui.h" #include "textbuf_gui.h" #include "window_gui.h" -#include "gfx.h" #include "player.h" #include "variables.h" #include "string.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/console_cmds.cpp --- a/src/console_cmds.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/console_cmds.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -27,6 +27,7 @@ #include "date.h" #include "network/network.h" #include "strings_func.h" +#include "viewport.h" // ** scriptfile handling ** // static FILE *_script_file; diff -r 7128bb2b57a3 -r 3bc6351e7369 src/core/geometry_type.hpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/core/geometry_type.hpp Sat Dec 22 23:30:28 2007 +0000 @@ -0,0 +1,37 @@ +/* $Id$ */ + +/** @file geometry_type.hpp All geometry types in OpenTTD. */ + +#ifndef GEOMETRY_TYPE_HPP +#define GEOMETRY_TYPE_HPP + +struct Point { + int x; + int y; +}; + +struct Dimension { + int width; + int height; +}; + +struct Rect { + int left; + int top; + int right; + int bottom; +}; + +struct PointDimension { + int x; + int y; + int width; + int height; +}; + +struct Pair { + int a; + int b; +}; + +#endif /* GEOMETRY_TYPE_HPP */ diff -r 7128bb2b57a3 -r 3bc6351e7369 src/depot_gui.cpp --- a/src/depot_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/depot_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -13,7 +13,6 @@ #include "table/sprites.h" #include "gui.h" #include "textbuf_gui.h" -#include "gfx.h" #include "vehicle.h" #include "viewport.h" #include "command_func.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/disaster_cmd.cpp --- a/src/disaster_cmd.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/disaster_cmd.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -18,7 +18,6 @@ #include "stdafx.h" #include "openttd.h" -#include "gfx.h" #include "landscape.h" #include "industry_map.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/dock_gui.cpp --- a/src/dock_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/dock_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -14,7 +14,6 @@ #include "window_gui.h" #include "station_gui.h" #include "viewport.h" -#include "gfx.h" #include "sound.h" #include "command_func.h" #include "variables.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/economy.cpp --- a/src/economy.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/economy.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -14,7 +14,6 @@ #include "player.h" #include "station.h" #include "vehicle.h" -#include "gfx.h" #include "command_func.h" #include "saveload.h" #include "industry.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/economy_func.h --- a/src/economy_func.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/economy_func.h Sat Dec 22 23:30:28 2007 +0000 @@ -5,6 +5,7 @@ #ifndef ECONOMY_FUNC_H #define ECONOMY_FUNC_H +#include "core/geometry_type.hpp" #include "economy_type.h" #include "cargo_type.h" #include "vehicle_type.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/engine.cpp --- a/src/engine.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/engine.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -8,7 +8,6 @@ #include "functions.h" #include "table/strings.h" #include "engine.h" -#include "gfx.h" #include "player.h" #include "command_func.h" #include "vehicle.h" @@ -24,6 +23,7 @@ #include "string.h" #include "misc/autoptr.hpp" #include "strings_func.h" +#include "viewport.h" EngineInfo _engine_info[TOTAL_NUM_ENGINES]; RailVehicleInfo _rail_vehicle_info[NUM_TRAIN_ENGINES]; diff -r 7128bb2b57a3 -r 3bc6351e7369 src/engine_gui.cpp --- a/src/engine_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/engine_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -10,7 +10,6 @@ #include "gui.h" #include "window_gui.h" #include "viewport.h" -#include "gfx.h" #include "engine.h" #include "command_func.h" #include "economy_func.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/fontcache.cpp --- a/src/fontcache.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/fontcache.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -9,7 +9,6 @@ #include "table/sprites.h" #include "table/control_codes.h" #include "spritecache.h" -#include "gfx.h" #include "string.h" #include "fontcache.h" #include "helpers.hpp" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/fontcache.h --- a/src/fontcache.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/fontcache.h Sat Dec 22 23:30:28 2007 +0000 @@ -3,6 +3,8 @@ #ifndef FONTCACHE_H #define FONTCACHE_H +#include "gfx.h" + /** Get the SpriteID mapped to the given font size and key */ SpriteID GetUnicodeGlyph(FontSize size, uint32 key); diff -r 7128bb2b57a3 -r 3bc6351e7369 src/functions.h --- a/src/functions.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/functions.h Sat Dec 22 23:30:28 2007 +0000 @@ -5,10 +5,9 @@ #ifndef FUNCTIONS_H #define FUNCTIONS_H -#include "gfx.h" -#include "viewport.h" #include "core/random_func.hpp" #include "command_type.h" +#include "window_type.h" void UpdateTownMaxPass(Town *t); @@ -74,15 +73,6 @@ void DeleteWindowById(WindowClass cls, WindowNumber number); void DeleteWindowByClass(WindowClass cls); -void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, ViewportHighlightMode mode, Window *w); -void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, WindowClass window_class, WindowNumber window_num); - -void ResetObjectToPlace(); - -bool ScrollWindowTo(int x, int y, Window *w, bool instant = false); - -bool ScrollMainWindowToTile(TileIndex tile, bool instant = false); -bool ScrollMainWindowTo(int x, int y, bool instant = false); bool EnsureNoVehicleOnGround(TileIndex tile); /** diff -r 7128bb2b57a3 -r 3bc6351e7369 src/genworld.cpp --- a/src/genworld.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/genworld.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -12,7 +12,6 @@ #include "thread.h" #include "command_func.h" #include "genworld.h" -#include "gfx.h" #include "gfxinit.h" #include "window_func.h" #include "network/network.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/genworld_gui.cpp --- a/src/genworld_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/genworld_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -11,7 +11,6 @@ #include "gui.h" #include "window_gui.h" #include "textbuf_gui.h" -#include "gfx.h" #include "gfxinit.h" #include "player.h" #include "command_func.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/gfx.cpp --- a/src/gfx.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/gfx.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -5,9 +5,9 @@ #include "stdafx.h" #include "openttd.h" #include "functions.h" +#include "gfx.h" #include "spritecache.h" #include "string.h" -#include "gfx.h" #include "table/palettes.h" #include "table/sprites.h" #include "variables.h" @@ -514,16 +514,16 @@ } /** Return the string dimension in pixels. The height and width are returned - * in a single BoundingRect value. TINYFONT, BIGFONT modifiers are only + * in a single Dimension value. TINYFONT, BIGFONT modifiers are only * supported as the first character of the string. The returned dimensions * are therefore a rough estimation correct for all the current strings * but not every possible combination * @param str string to calculate pixel-width * @return string width and height in pixels */ -BoundingRect GetStringBoundingBox(const char *str) +Dimension GetStringBoundingBox(const char *str) { FontSize size = _cur_fontsize; - BoundingRect br; + Dimension br; int max_width; WChar c; diff -r 7128bb2b57a3 -r 3bc6351e7369 src/gfx.h --- a/src/gfx.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/gfx.h Sat Dec 22 23:30:28 2007 +0000 @@ -37,6 +37,8 @@ #include "openttd.h" #include "core/math_func.hpp" +#include "core/geometry_type.hpp" +#include "core/enum_type.hpp" #include "zoom.hpp" enum WindowKeyCodes { @@ -125,26 +127,10 @@ WKC_MINUS = 153, ///< - Minus }; -enum GameModes { - GM_MENU, - GM_NORMAL, - GM_EDITOR -}; - void GameLoop(); void CreateConsole(); -typedef int32 CursorID; - -struct Point { - int x, y; -}; - -struct Rect { - int left,top,right,bottom; -}; - /** A single sprite of a list of animated cursors */ struct AnimCursor { static const CursorID LAST = MAX_UVALUE(CursorID); @@ -203,10 +189,6 @@ extern bool _right_button_clicked; extern DrawPixelInfo _screen; -extern bool _exit_game; -extern bool _networking; ///< are we in networking mode? -extern byte _game_mode; -extern byte _pause_game; extern int _pal_first_dirty; extern int _pal_count_dirty; @@ -229,15 +211,12 @@ void GameSizeChanged(); void UndrawMouseCursor(); -#include "helpers.hpp" - enum FontSize { FS_NORMAL, FS_SMALL, FS_LARGE, FS_END, }; - DECLARE_POSTFIX_INCREMENT(FontSize); void RedrawScreenRect(int left, int top, int right, int bottom); @@ -281,7 +260,7 @@ void GfxDrawLine(int left, int top, int right, int bottom, int color); void DrawBox(int x, int y, int dx1, int dy1, int dx2, int dy2, int dx3, int dy3); -BoundingRect GetStringBoundingBox(const char *str); +Dimension GetStringBoundingBox(const char *str); uint32 FormatStringLinebreaks(char *str, int maxw); void LoadStringWidthTable(); void DrawStringMultiCenter(int x, int y, StringID str, int maxw); diff -r 7128bb2b57a3 -r 3bc6351e7369 src/gfxinit.cpp --- a/src/gfxinit.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/gfxinit.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -6,7 +6,6 @@ #include "openttd.h" #include "debug.h" #include "functions.h" -#include "gfx.h" #include "gfxinit.h" #include "spritecache.h" #include "table/sprites.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/graph_gui.cpp --- a/src/graph_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/graph_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -9,7 +9,6 @@ #include "functions.h" #include "gui.h" #include "window_gui.h" -#include "gfx.h" #include "player.h" #include "economy_func.h" #include "variables.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/group_gui.cpp --- a/src/group_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/group_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -10,7 +10,6 @@ #include "gui.h" #include "window_gui.h" #include "textbuf_gui.h" -#include "gfx.h" #include "vehicle.h" #include "command_func.h" #include "engine.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/gui.h --- a/src/gui.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/gui.h Sat Dec 22 23:30:28 2007 +0000 @@ -7,6 +7,7 @@ #include "string.h" #include "window_type.h" +#include "vehicle_type.h" #include "gfx.h" /* main_gui.cpp */ diff -r 7128bb2b57a3 -r 3bc6351e7369 src/heightmap.cpp --- a/src/heightmap.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/heightmap.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -11,7 +11,6 @@ #include "table/strings.h" #include "void_map.h" #include "debug.h" -#include "gfx.h" #include "gui.h" #include "saveload.h" #include "bmp.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/industry_gui.cpp --- a/src/industry_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/industry_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -12,7 +12,6 @@ #include "gui.h" #include "window_gui.h" #include "textbuf_gui.h" -#include "gfx.h" #include "command_func.h" #include "viewport.h" #include "industry.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/intro_gui.cpp --- a/src/intro_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/intro_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -10,7 +10,6 @@ #include "gui.h" #include "window_gui.h" #include "textbuf_gui.h" -#include "gfx.h" #include "player.h" #include "network/network.h" #include "variables.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/landscape.h --- a/src/landscape.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/landscape.h Sat Dec 22 23:30:28 2007 +0000 @@ -5,7 +5,7 @@ #ifndef LANDSCAPE_H #define LANDSCAPE_H -#include "gfx.h" +#include "core/geometry_type.hpp" enum { SNOW_LINE_MONTHS = 12, diff -r 7128bb2b57a3 -r 3bc6351e7369 src/main_gui.cpp --- a/src/main_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/main_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -17,7 +17,6 @@ #include "window_func.h" #include "textbuf_gui.h" #include "viewport.h" -#include "gfx.h" #include "player.h" #include "command_func.h" #include "news.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/misc_cmd.cpp --- a/src/misc_cmd.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/misc_cmd.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -10,7 +10,6 @@ #include "command_func.h" #include "economy_func.h" #include "player.h" -#include "gfx.h" #include "gui.h" #include "window_func.h" #include "textbuf_gui.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/misc_gui.cpp --- a/src/misc_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/misc_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -21,7 +21,6 @@ #include "station_gui.h" #include "textbuf_gui.h" #include "viewport.h" -#include "gfx.h" #include "station.h" #include "command_func.h" #include "player.h" @@ -728,7 +727,7 @@ void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[]) { char buffer[512]; - BoundingRect br; + Dimension br; Window *w; uint i; int x, y; diff -r 7128bb2b57a3 -r 3bc6351e7369 src/music_gui.cpp --- a/src/music_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/music_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -8,7 +8,6 @@ #include "table/sprites.h" #include "functions.h" #include "fileio.h" -#include "gfx.h" #include "sound.h" #include "variables.h" #include "music.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/network/network.h --- a/src/network/network.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/network/network.h Sat Dec 22 23:30:28 2007 +0000 @@ -216,6 +216,7 @@ bool IsNetworkCompatibleVersion(const char *version); +extern bool _networking; ///< are we in networking mode? VARDEF bool _network_server; ///< network-server is active VARDEF bool _network_available; ///< is network mode available? VARDEF bool _network_dedicated; ///< are we a dedicated server? @@ -235,7 +236,7 @@ #endif /* ENABLE_NETWORK */ -/* Thss variable must always be registered! */ +/* This variable must always be registered! */ VARDEF PlayerID _network_playas; ///< an id to play as.. (see players.h:Players) #endif /* NETWORK_H */ diff -r 7128bb2b57a3 -r 3bc6351e7369 src/newgrf.cpp --- a/src/newgrf.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/newgrf.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -8,7 +8,6 @@ #include "openttd.h" #include "debug.h" -#include "gfx.h" #include "fileio.h" #include "functions.h" #include "engine.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/newgrf_gui.cpp --- a/src/newgrf_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/newgrf_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -6,7 +6,6 @@ #include "openttd.h" #include "functions.h" #include "variables.h" -#include "gfx.h" #include "gui.h" #include "window_gui.h" #include "textbuf_gui.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/newgrf_station.cpp --- a/src/newgrf_station.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/newgrf_station.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -23,6 +23,7 @@ #include "cargotype.h" #include "town_map.h" #include "newgrf_town.h" +#include "gfx.h" static StationClass station_classes[STAT_CLASS_MAX]; diff -r 7128bb2b57a3 -r 3bc6351e7369 src/news_gui.cpp --- a/src/news_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/news_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -9,7 +9,6 @@ #include "gui.h" #include "window_gui.h" #include "viewport.h" -#include "gfx.h" #include "news.h" #include "vehicle.h" #include "sound.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/oldloader.cpp --- a/src/oldloader.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/oldloader.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -24,6 +24,7 @@ #include "newgrf_config.h" #include "ai/ai.h" #include "date.h" +#include "zoom.hpp" enum { HEADER_SIZE = 49, diff -r 7128bb2b57a3 -r 3bc6351e7369 src/openttd.cpp --- a/src/openttd.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/openttd.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -17,7 +17,6 @@ #include "functions.h" #include "mixer.h" #include "spritecache.h" -#include "gfx.h" #include "gfxinit.h" #include "gui.h" #include "landscape.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/openttd.h --- a/src/openttd.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/openttd.h Sat Dec 22 23:30:28 2007 +0000 @@ -11,21 +11,6 @@ #include "helpers.hpp" #include "strings_type.h" -struct Oblong { - int x, y; - int width, height; -}; - -struct BoundingRect { - int width; - int height; -}; - -struct Pair { - int a; - int b; -}; - #include "map.h" #include "slope_type.h" @@ -46,6 +31,7 @@ SpriteID sprite; SpriteID pal; }; +typedef int32 CursorID; typedef uint16 EngineID; typedef uint16 UnitID; @@ -83,6 +69,12 @@ typedef uint32 PlayerFace; ///< player face bits, info see in player_face.h +enum GameModes { + GM_MENU, + GM_NORMAL, + GM_EDITOR +}; + enum SwitchModes { SM_NONE = 0, SM_NEWGAME = 1, @@ -282,4 +274,8 @@ void OTTD_SendThreadMessage(ThreadMsg msg); +extern byte _game_mode; +extern bool _exit_game; +extern byte _pause_game; + #endif /* OPENTTD_H */ diff -r 7128bb2b57a3 -r 3bc6351e7369 src/order_gui.cpp --- a/src/order_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/order_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -12,7 +12,6 @@ #include "map.h" #include "gui.h" #include "window_gui.h" -#include "gfx.h" #include "vehicle.h" #include "station.h" #include "town.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/os2.cpp --- a/src/os2.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/os2.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -7,7 +7,6 @@ #include "variables.h" #include "string.h" #include "table/strings.h" -#include "gfx.h" #include "gui.h" #include "functions.h" #include "fileio.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/player.h --- a/src/player.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/player.h Sat Dec 22 23:30:28 2007 +0000 @@ -14,7 +14,6 @@ #include "engine.h" #include "livery.h" #include "genworld.h" -#include "gfx.h" struct PlayerEconomyEntry { Money income; diff -r 7128bb2b57a3 -r 3bc6351e7369 src/player_gui.cpp --- a/src/player_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/player_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -11,7 +11,6 @@ #include "window_gui.h" #include "textbuf_gui.h" #include "viewport.h" -#include "gfx.h" #include "player.h" #include "command_func.h" #include "vehicle.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/players.cpp --- a/src/players.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/players.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -14,7 +14,6 @@ #include "town.h" #include "vehicle.h" #include "station.h" -#include "gfx.h" #include "news.h" #include "saveload.h" #include "command_func.h" @@ -30,6 +29,7 @@ #include "window_func.h" #include "tile_map.h" #include "strings_func.h" +#include "gfx.h" /** * Sets the local player and updates the patch settings that are set on a diff -r 7128bb2b57a3 -r 3bc6351e7369 src/rail.h --- a/src/rail.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/rail.h Sat Dec 22 23:30:28 2007 +0000 @@ -5,7 +5,6 @@ #ifndef RAIL_H #define RAIL_H -#include "gfx.h" #include "rail_type.h" #include "track_type.h" #include "vehicle_type.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/rail_gui.cpp --- a/src/rail_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/rail_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -15,7 +15,6 @@ #include "window_gui.h" #include "station_gui.h" #include "viewport.h" -#include "gfx.h" #include "sound.h" #include "command_func.h" #include "vehicle.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/road_cmd.cpp --- a/src/road_cmd.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/road_cmd.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -22,7 +22,6 @@ #include "command_func.h" #include "player.h" #include "town.h" -#include "gfx.h" #include "sound.h" #include "yapf/yapf.h" #include "depot.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/road_gui.cpp --- a/src/road_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/road_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -12,7 +12,6 @@ #include "window_gui.h" #include "station_gui.h" #include "viewport.h" -#include "gfx.h" #include "sound.h" #include "command_func.h" #include "variables.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/saveload.cpp --- a/src/saveload.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/saveload.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -1100,7 +1100,6 @@ ********************************************/ #include "table/sprites.h" -#include "gfx.h" #include "gui.h" struct ThreadedSave { diff -r 7128bb2b57a3 -r 3bc6351e7369 src/screenshot.cpp --- a/src/screenshot.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/screenshot.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -5,7 +5,6 @@ #include "debug.h" #include "functions.h" #include "table/strings.h" -#include "gfx.h" #include "fileio.h" #include "viewport.h" #include "player.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/settings.cpp --- a/src/settings.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/settings.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -45,7 +45,6 @@ #include "window_func.h" #include "strings_func.h" #ifdef WITH_FREETYPE -#include "gfx.h" #include "fontcache.h" #endif #include "spritecache.h" @@ -1087,7 +1086,6 @@ /* Begin - Callback Functions for the various settings */ #include "gui.h" #include "town.h" -#include "gfx.h" /* virtual PositionMainToolbar function, calls the right one.*/ static int32 v_PositionMainToolbar(int32 p1) { diff -r 7128bb2b57a3 -r 3bc6351e7369 src/settings_gui.cpp --- a/src/settings_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/settings_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -12,7 +12,6 @@ #include "gui.h" #include "window_gui.h" #include "textbuf_gui.h" -#include "gfx.h" #include "command_func.h" #include "engine.h" #include "screenshot.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/signs.cpp --- a/src/signs.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/signs.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -15,6 +15,7 @@ #include "string.h" #include "misc/autoptr.hpp" #include "strings_func.h" +#include "viewport.h" SignID _new_sign_id; uint _total_signs; diff -r 7128bb2b57a3 -r 3bc6351e7369 src/signs_gui.cpp --- a/src/signs_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/signs_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -10,7 +10,6 @@ #include "gui.h" #include "textbuf_gui.h" #include "window_gui.h" -#include "gfx.h" #include "player.h" #include "signs.h" #include "debug.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/smallmap_gui.cpp --- a/src/smallmap_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/smallmap_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -18,7 +18,6 @@ #include "window_gui.h" #include "tree_map.h" #include "tunnel_map.h" -#include "gfx.h" #include "viewport.h" #include "player.h" #include "vehicle.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/station.cpp --- a/src/station.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/station.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -12,7 +12,6 @@ #include "table/strings.h" #include "map.h" #include "station.h" -#include "gfx.h" #include "viewport.h" #include "town.h" #include "vehicle.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/station.h --- a/src/station.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/station.h Sat Dec 22 23:30:28 2007 +0000 @@ -13,6 +13,7 @@ #include "newgrf_station.h" #include "cargopacket.h" #include "cargo_type.h" +#include "core/geometry_type.hpp" #include #include diff -r 7128bb2b57a3 -r 3bc6351e7369 src/station_cmd.cpp --- a/src/station_cmd.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/station_cmd.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -16,7 +16,6 @@ #include "table/strings.h" #include "map.h" #include "station.h" -#include "gfx.h" #include "viewport.h" #include "command_func.h" #include "town.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/station_gui.cpp --- a/src/station_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/station_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -11,7 +11,6 @@ #include "window_gui.h" #include "textbuf_gui.h" #include "station.h" -#include "gfx.h" #include "player.h" #include "economy_func.h" #include "town.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/subsidy_gui.cpp --- a/src/subsidy_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/subsidy_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -10,7 +10,6 @@ #include "industry.h" #include "town.h" #include "player.h" -#include "gfx.h" #include "economy_func.h" #include "variables.h" #include "date.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/terraform_gui.cpp --- a/src/terraform_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/terraform_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -13,7 +13,6 @@ #include "gui.h" #include "window_gui.h" #include "viewport.h" -#include "gfx.h" #include "sound.h" #include "command_func.h" #include "vehicle.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/texteff.cpp --- a/src/texteff.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/texteff.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -6,7 +6,6 @@ #include "openttd.h" #include "functions.h" #include "tile_cmd.h" -#include "gfx.h" #include "landscape.h" #include "viewport.h" #include "saveload.h" @@ -58,7 +57,7 @@ /* The chatbox grows from the bottom so the coordinates are pixels from * the left and pixels from the bottom. The height is the maximum height */ -static const Oblong _chatmsg_box = {10, 30, 500, 150}; +static const PointDimension _chatmsg_box = {10, 30, 500, 150}; static uint8 _chatmessage_backup[150 * 500 * 6]; // (height * width) static inline uint GetChatMessageCount() diff -r 7128bb2b57a3 -r 3bc6351e7369 src/town_cmd.cpp --- a/src/town_cmd.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/town_cmd.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -17,7 +17,6 @@ #include "viewport.h" #include "town.h" #include "command_func.h" -#include "gfx.h" #include "industry.h" #include "station.h" #include "vehicle.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/town_gui.cpp --- a/src/town_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/town_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -9,7 +9,6 @@ #include "table/sprites.h" #include "table/strings.h" #include "town.h" -#include "gfx.h" #include "viewport.h" #include "gui.h" #include "window_gui.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/transparency_gui.cpp --- a/src/transparency_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/transparency_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -8,7 +8,6 @@ #include "gui.h" #include "window_gui.h" #include "viewport.h" -#include "gfx.h" #include "sound.h" #include "variables.h" #include "transparency.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/variables.h --- a/src/variables.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/variables.h Sat Dec 22 23:30:28 2007 +0000 @@ -6,11 +6,10 @@ #define VARIABLES_H #include "yapf/yapf_settings.h" +#include "openttd.h" /* ********* START OF SAVE REGION */ -#include "gfx.h" - struct GameOptions { GameDifficulty diff; byte diff_level; diff -r 7128bb2b57a3 -r 3bc6351e7369 src/vehicle.cpp --- a/src/vehicle.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/vehicle.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -15,7 +15,6 @@ #include "map.h" #include "vehicle.h" #include "timetable.h" -#include "gfx.h" #include "viewport.h" #include "news.h" #include "command_func.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/vehicle_gui.cpp --- a/src/vehicle_gui.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/vehicle_gui.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -16,7 +16,6 @@ #include "window_gui.h" #include "textbuf_gui.h" #include "command_func.h" -#include "gfx.h" #include "variables.h" #include "vehicle_gui.h" #include "viewport.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/video/sdl_v.cpp --- a/src/video/sdl_v.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/video/sdl_v.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -11,6 +11,7 @@ #include "../sdl.h" #include "../variables.h" #include "../blitter/factory.hpp" +#include "../network/network.h" #include "sdl_v.h" #include diff -r 7128bb2b57a3 -r 3bc6351e7369 src/video/win32_v.cpp --- a/src/video/win32_v.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/video/win32_v.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -7,6 +7,7 @@ #include "../variables.h" #include "../win32.h" #include "../blitter/factory.hpp" +#include "../network/network.h" #include "win32_v.h" #include #include diff -r 7128bb2b57a3 -r 3bc6351e7369 src/viewport.cpp --- a/src/viewport.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/viewport.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -15,7 +15,6 @@ #include "viewport.h" #include "vehicle.h" #include "station.h" -#include "gfx.h" #include "town.h" #include "signs.h" #include "waypoint.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/viewport.h --- a/src/viewport.h Sat Dec 22 21:01:49 2007 +0000 +++ b/src/viewport.h Sat Dec 22 23:30:28 2007 +0000 @@ -168,4 +168,14 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom); +void SetObjectToPlaceWnd(CursorID icon, SpriteID pal, ViewportHighlightMode mode, Window *w); +void SetObjectToPlace(CursorID icon, SpriteID pal, ViewportHighlightMode mode, WindowClass window_class, WindowNumber window_num); + +void ResetObjectToPlace(); + +bool ScrollWindowTo(int x, int y, Window *w, bool instant = false); + +bool ScrollMainWindowToTile(TileIndex tile, bool instant = false); +bool ScrollMainWindowTo(int x, int y, bool instant = false); + #endif /* VIEWPORT_H */ diff -r 7128bb2b57a3 -r 3bc6351e7369 src/waypoint.cpp --- a/src/waypoint.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/waypoint.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -7,7 +7,6 @@ #include "command_func.h" #include "functions.h" -#include "gfx.h" #include "landscape.h" #include "map.h" #include "order.h" @@ -26,6 +25,7 @@ #include "string.h" #include "misc/autoptr.hpp" #include "strings_func.h" +#include "viewport.h" enum { MAX_WAYPOINTS_PER_TOWN = 64, diff -r 7128bb2b57a3 -r 3bc6351e7369 src/widget.cpp --- a/src/widget.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/widget.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -8,7 +8,6 @@ #include "player.h" #include "table/sprites.h" #include "table/strings.h" -#include "gfx.h" #include "viewport.h" #include "window_gui.h" diff -r 7128bb2b57a3 -r 3bc6351e7369 src/win32.cpp --- a/src/win32.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/win32.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -9,7 +9,6 @@ #include "helpers.hpp" #include "saveload.h" #include "string.h" -#include "gfx.h" #include "textbuf_gui.h" #include "fileio.h" #include diff -r 7128bb2b57a3 -r 3bc6351e7369 src/window.cpp --- a/src/window.cpp Sat Dec 22 21:01:49 2007 +0000 +++ b/src/window.cpp Sat Dec 22 23:30:28 2007 +0000 @@ -9,7 +9,6 @@ #include "functions.h" #include "map.h" #include "player.h" -#include "gfx.h" #include "viewport.h" #include "console.h" #include "variables.h"