# HG changeset patch # User rubidium # Date 1206722090 0 # Node ID ea070bc7bdadb61755cde2348b22a386cba2e6b4 # Parent b554c4996eb184f243a6e5d579e5817745677e15 (svn r12469) -Codechange: split type related stuff from group.h (and openttd.h) to group_type.h. diff -r b554c4996eb1 -r ea070bc7bdad projects/openttd_vs80.vcproj --- a/projects/openttd_vs80.vcproj Fri Mar 28 16:33:28 2008 +0000 +++ b/projects/openttd_vs80.vcproj Fri Mar 28 16:34:50 2008 +0000 @@ -984,6 +984,10 @@ > + + diff -r b554c4996eb1 -r ea070bc7bdad projects/openttd_vs90.vcproj --- a/projects/openttd_vs90.vcproj Fri Mar 28 16:33:28 2008 +0000 +++ b/projects/openttd_vs90.vcproj Fri Mar 28 16:34:50 2008 +0000 @@ -981,6 +981,10 @@ > + + diff -r b554c4996eb1 -r ea070bc7bdad source.list --- a/source.list Fri Mar 28 16:33:28 2008 +0000 +++ b/source.list Fri Mar 28 16:34:50 2008 +0000 @@ -154,6 +154,7 @@ gfxinit.h group.h group_gui.h +group_type.h gui.h heightmap.h industry.h diff -r b554c4996eb1 -r ea070bc7bdad src/autoreplace_gui.cpp --- a/src/autoreplace_gui.cpp Fri Mar 28 16:33:28 2008 +0000 +++ b/src/autoreplace_gui.cpp Fri Mar 28 16:34:50 2008 +0000 @@ -23,6 +23,19 @@ #include "table/sprites.h" #include "table/strings.h" +struct replaceveh_d { + byte sel_index[2]; + EngineID sel_engine[2]; + uint16 count[2]; + bool wagon_btnstate; ///< true means engine is selected + EngineList list[2]; + bool update_left; + bool update_right; + bool init_lists; + GroupID sel_group; +}; +assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(replaceveh_d)); + static RailType _railtype_selected_in_replace_gui; static bool _rebuild_left_list; diff -r b554c4996eb1 -r ea070bc7bdad src/group.h --- a/src/group.h Fri Mar 28 16:33:28 2008 +0000 +++ b/src/group.h Fri Mar 28 16:34:50 2008 +0000 @@ -5,18 +5,12 @@ #ifndef GROUP_H #define GROUP_H +#include "group_type.h" #include "oldpool.h" #include "player_type.h" #include "vehicle_type.h" #include "engine.h" -enum { - ALL_GROUP = 0xFFFD, - DEFAULT_GROUP = 0xFFFE, ///< ungrouped vehicles are in this group. - INVALID_GROUP = 0xFFFF, -}; - -struct Group; DECLARE_OLD_POOL(Group, Group, 5, 2047) struct Group : PoolItem { diff -r b554c4996eb1 -r ea070bc7bdad src/group_gui.cpp --- a/src/group_gui.cpp Fri Mar 28 16:33:28 2008 +0000 +++ b/src/group_gui.cpp Fri Mar 28 16:34:50 2008 +0000 @@ -29,6 +29,20 @@ #include "table/strings.h" #include "table/sprites.h" +struct grouplist_d { + const Group **sort_list; + list_d l; // General list struct +}; +assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(grouplist_d)); + +struct groupveh_d : vehiclelist_d { + GroupID group_sel; + VehicleID vehicle_sel; + + grouplist_d gl; +}; +assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(groupveh_d)); + struct Sorting { Listing aircraft; Listing roadveh; diff -r b554c4996eb1 -r ea070bc7bdad src/group_type.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/group_type.h Fri Mar 28 16:34:50 2008 +0000 @@ -0,0 +1,18 @@ +/* $Id$ */ + +/** @file group_type.h Types of a group. */ + +#ifndef GROUP_TYPE_H +#define GROUP_TYPE_H + +typedef uint16 GroupID; + +enum { + ALL_GROUP = 0xFFFD, + DEFAULT_GROUP = 0xFFFE, ///< ungrouped vehicles are in this group. + INVALID_GROUP = 0xFFFF, +}; + +struct Group; + +#endif /* GROUP_TYPE_H */ diff -r b554c4996eb1 -r ea070bc7bdad src/openttd.h --- a/src/openttd.h Fri Mar 28 16:33:28 2008 +0000 +++ b/src/openttd.h Fri Mar 28 16:34:50 2008 +0000 @@ -12,7 +12,6 @@ struct Waypoint; struct ViewPort; struct DrawPixelInfo; -struct Group; typedef byte VehicleOrderID; ///< The index of an order within its current vehicle (not pool related) typedef byte LandscapeID; typedef uint16 EngineID; @@ -24,7 +23,6 @@ typedef uint16 WaypointID; typedef uint16 OrderID; typedef uint16 SignID; -typedef uint16 GroupID; typedef uint16 EngineRenewID; enum GameModes { diff -r b554c4996eb1 -r ea070bc7bdad src/order.h --- a/src/order.h Fri Mar 28 16:33:28 2008 +0000 +++ b/src/order.h Fri Mar 28 16:34:50 2008 +0000 @@ -11,6 +11,7 @@ #include "vehicle_type.h" #include "tile_type.h" #include "date_type.h" +#include "group_type.h" typedef uint16 DestinationID; diff -r b554c4996eb1 -r ea070bc7bdad src/vehicle_base.h --- a/src/vehicle_base.h Fri Mar 28 16:33:28 2008 +0000 +++ b/src/vehicle_base.h Fri Mar 28 16:34:50 2008 +0000 @@ -20,6 +20,7 @@ #include "order.h" #include "cargopacket.h" #include "texteff.hpp" +#include "group_type.h" /** Road vehicle states */ enum RoadVehicleStates { diff -r b554c4996eb1 -r ea070bc7bdad src/window_gui.h --- a/src/window_gui.h Fri Mar 28 16:33:28 2008 +0000 +++ b/src/window_gui.h Fri Mar 28 16:34:50 2008 +0000 @@ -331,19 +331,6 @@ }; assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(tooltips_d)); -struct replaceveh_d { - byte sel_index[2]; - EngineID sel_engine[2]; - uint16 count[2]; - bool wagon_btnstate; ///< true means engine is selected - EngineList list[2]; - bool update_left; - bool update_right; - bool init_lists; - GroupID sel_group; -}; -assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(replaceveh_d)); - struct depot_d { VehicleID sel; VehicleType type; @@ -443,20 +430,6 @@ }; assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(vehiclelist_d)); -struct grouplist_d { - const Group **sort_list; - list_d l; // General list struct -}; -assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(grouplist_d)); - -struct groupveh_d : vehiclelist_d { - GroupID group_sel; - VehicleID vehicle_sel; - - grouplist_d gl; -}; -assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(groupveh_d)); - /****************** THESE ARE NOT WIDGET TYPES!!!!! *******************/ enum WindowWidgetBehaviours { WWB_PUSHBUTTON = 1 << 5,