Changeset - r12424:d9959af3645c
[Not reviewed]
master
0 7 0
rubidium - 15 years ago 2009-07-18 08:41:58
rubidium@openttd.org
(svn r16868) -Codechange: unify UpdateAll[Station|Waypoint]VirtCoords
7 files changed with 11 insertions and 17 deletions:
0 comments (0 inline, 0 general)
src/saveload/afterload.cpp
Show inline comments
 
@@ -216,7 +216,6 @@ static bool InitializeWindowsAndCaches()
 
	UpdateAllStationVirtCoords();
 
	UpdateAllSignVirtCoords();
 
	UpdateAllTownVirtCoords();
 
	UpdateAllWaypointVirtCoords();
 

	
 
	Company *c;
 
	FOR_ALL_COMPANIES(c) {
src/settings_gui.cpp
Show inline comments
 
@@ -322,7 +322,6 @@ struct GameOptionsWindow : Window {
 
				ReadLanguagePack(index);
 
				CheckForMissingGlyphsInLoadedLanguagePack();
 
				UpdateAllStationVirtCoords();
 
				UpdateAllWaypointVirtCoords();
 
				ReInitAllWindows();
 
				MarkWholeScreenDirty();
 
				break;
src/station_base.h
Show inline comments
 
@@ -120,6 +120,11 @@ struct BaseStation {
 
	virtual uint32 GetNewGRFVariable(const struct ResolverObject *object, byte variable, byte parameter, bool *available) const = 0;
 

	
 
	/**
 
	 * Update the coordinated of the sign (as shown in the viewport).
 
	 */
 
	virtual void UpdateVirtCoord() = 0;
 

	
 
	/**
 
	 * Get the base station belonging to a specific tile.
 
	 * @param tile The tile to get the base station from.
 
	 * @return the station associated with that tile.
src/station_cmd.cpp
Show inline comments
 
@@ -33,6 +33,7 @@
 
#include "elrail_func.h"
 
#include "station_base.h"
 
#include "roadstop_base.h"
 
#include "waypoint.h"
 

	
 
#include "table/strings.h"
 

	
 
@@ -384,11 +385,15 @@ void Station::UpdateVirtCoord()
 
/** Update the virtual coords needed to draw the station sign for all stations. */
 
void UpdateAllStationVirtCoords()
 
{
 
	Station *st;
 
	BaseStation *st;
 

	
 
	FOR_ALL_STATIONS(st) {
 
		st->UpdateVirtCoord();
 
	}
 

	
 
	FOR_ALL_WAYPOINTS(st) {
 
		st->UpdateVirtCoord();
 
	}
 
}
 

	
 
/** Get a mask of the cargo types that the station accepts.
src/town_cmd.cpp
Show inline comments
 
@@ -2286,7 +2286,6 @@ CommandCost CmdRenameTown(TileIndex tile
 
		t->UpdateVirtCoord();
 
		InvalidateWindowData(WC_TOWN_DIRECTORY, 0, 1);
 
		UpdateAllStationVirtCoords();
 
		UpdateAllWaypointVirtCoords();
 
	}
 
	return CommandCost();
 
}
src/waypoint.cpp
Show inline comments
 
@@ -18,18 +18,6 @@ WaypointPool _waypoint_pool("Waypoint");
 
INSTANTIATE_POOL_METHODS(Waypoint)
 

	
 
/**
 
 * Update all signs
 
 */
 
void UpdateAllWaypointVirtCoords()
 
{
 
	Waypoint *wp;
 

	
 
	FOR_ALL_WAYPOINTS(wp) {
 
		wp->UpdateVirtCoord();
 
	}
 
}
 

	
 
/**
 
 * Daily loop for waypoints
 
 */
 
void WaypointsDailyLoop()
src/waypoint.h
Show inline comments
 
@@ -51,6 +51,5 @@ struct Waypoint : WaypointPool::PoolItem
 
CommandCost RemoveTrainWaypoint(TileIndex tile, DoCommandFlag flags, bool justremove);
 
void ShowWaypointWindow(const Waypoint *wp);
 
void DrawWaypointSprite(int x, int y, int stat_id, RailType railtype);
 
void UpdateAllWaypointVirtCoords();
 

	
 
#endif /* WAYPOINT_H */
0 comments (0 inline, 0 general)