Changeset - r16300:dae54be93b98
[Not reviewed]
master
0 3 0
alberth - 14 years ago 2010-10-23 18:28:20
alberth@openttd.org
(svn r21018) -Doc: Add Doxygen comments to some function.
3 files changed with 24 insertions and 5 deletions:
0 comments (0 inline, 0 general)
src/main_gui.cpp
Show inline comments
 
@@ -119,26 +119,31 @@ void CcPlaySound10(const CommandCost &re
 
}
 

	
 
#ifdef ENABLE_NETWORK
 
void ShowNetworkGiveMoneyWindow(CompanyID company)
 
{
 
	_rename_id = company;
 
	_rename_what = 3;
 
	ShowQueryString(STR_EMPTY, STR_NETWORK_GIVE_MONEY_CAPTION, 30, 180, NULL, CS_NUMERAL, QSF_NONE);
 
}
 
#endif /* ENABLE_NETWORK */
 

	
 

	
 
/* Zooms a viewport in a window in or out
 
 * No button handling or what so ever */
 
/**
 
 * Zooms a viewport in a window in or out.
 
 * @param how Zooming direction.
 
 * @param w   Window owning the viewport.
 
 * @return Returns \c true if zooming step could be done, \c false if further zooming is not possible.
 
 * @note No button handling or what so ever is done.
 
 */
 
bool DoZoomInOutWindow(ZoomStateChange how, Window *w)
 
{
 
	ViewPort *vp;
 

	
 
	assert(w != NULL);
 
	vp = w->viewport;
 

	
 
	switch (how) {
 
		case ZOOM_NONE:
 
			/* On initialisation of the viewport we don't do anything. */
 
			break;
 

	
src/viewport.cpp
Show inline comments
 
@@ -1877,29 +1877,39 @@ bool ScrollWindowTo(int x, int y, int z,
 
	if (w->viewport->dest_scrollpos_x == pt.x && w->viewport->dest_scrollpos_y == pt.y) return false;
 

	
 
	if (instant) {
 
		w->viewport->scrollpos_x = pt.x;
 
		w->viewport->scrollpos_y = pt.y;
 
	}
 

	
 
	w->viewport->dest_scrollpos_x = pt.x;
 
	w->viewport->dest_scrollpos_y = pt.y;
 
	return true;
 
}
 

	
 
/**
 
 * Scrolls the viewport of the main window to a given location.
 
 * @param tile    Desired tile to center on.
 
 * @param instant Jump to the location instead of slowly moving to it.
 
 * @return Destination of the viewport was changed (to activate other actions when the viewport is already at the desired position).
 
 */
 
bool ScrollMainWindowToTile(TileIndex tile, bool instant)
 
{
 
	return ScrollMainWindowTo(TileX(tile) * TILE_SIZE + TILE_SIZE / 2, TileY(tile) * TILE_SIZE + TILE_SIZE / 2, -1, instant);
 
}
 

	
 
/**
 
 * Set a tile to display a red error square.
 
 * @param tile Tile that should show the red error square.
 
 */
 
void SetRedErrorSquare(TileIndex tile)
 
{
 
	TileIndex old;
 

	
 
	old = _thd.redsq;
 
	_thd.redsq = tile;
 

	
 
	if (tile != old) {
 
		if (tile != INVALID_TILE) MarkTileDirtyByTile(tile);
 
		if (old  != INVALID_TILE) MarkTileDirtyByTile(old);
 
	}
 
}
src/viewport_type.h
Show inline comments
 
@@ -42,28 +42,32 @@ enum ViewportSignMargin {
 

	
 
/** Location information about a sign as seen on the viewport */
 
struct ViewportSign {
 
	int32 center;        ///< The center position of the sign
 
	int32 top;           ///< The top of the sign
 
	uint16 width_normal; ///< The width when not zoomed out (normal font)
 
	uint16 width_small;  ///< The width when zoomed out (small font)
 

	
 
	void UpdatePosition(int center, int top, StringID str);
 
	void MarkDirty() const;
 
};
 

	
 
/**
 
 * Directions of zooming.
 
 * @see DoZoomInOutWindow
 
 */
 
enum ZoomStateChange {
 
	ZOOM_IN   = 0,
 
	ZOOM_OUT  = 1,
 
	ZOOM_NONE = 2, // hack, used to update the button status
 
	ZOOM_IN   = 0, ///< Zoom in (get more detailed view).
 
	ZOOM_OUT  = 1, ///< Zoom out (get helicopter view).
 
	ZOOM_NONE = 2, ///< Hack, used to update the button status.
 
};
 

	
 
/**
 
 * Some values for constructing bounding boxes (BB). The Z positions under bridges are:
 
 * z=0..5  Everything that can be built under low bridges.
 
 * z=6     reserved, currently unused.
 
 * z=7     Z separator between bridge/tunnel and the things under/above it.
 
 */
 
static const uint BB_HEIGHT_UNDER_BRIDGE = 6; ///< Everything that can be built under low bridges, must not exceed this Z height.
 
static const uint BB_Z_SEPARATOR         = 7; ///< Separates the bridge/tunnel from the things under/above it.
 

	
 
/** Viewport place method (type of highlighted area and placed objects) */
0 comments (0 inline, 0 general)