Changeset - r15264:ccfbc4196c34
[Not reviewed]
master
0 5 0
alberth - 14 years ago 2010-05-30 13:05:36
alberth@openttd.org
(svn r19909) -Doc: Typo fixes, small doxygen improvements.
5 files changed with 18 insertions and 18 deletions:
0 comments (0 inline, 0 general)
src/core/smallvec_type.hpp
Show inline comments
 
@@ -27,13 +27,13 @@
 
 */
 
template <typename T, uint S>
 
class SmallVector {
 
protected:
 
	T *data;       ///< The pointer to the first item
 
	uint items;    ///< The number of items stored
 
	uint capacity; ///< The avalible space for storing items
 
	uint capacity; ///< The available space for storing items
 

	
 
public:
 
	SmallVector() : data(NULL), items(0), capacity(0) { }
 

	
 
	~SmallVector()
 
	{
 
@@ -90,13 +90,13 @@ public:
 
		}
 

	
 
		return &this->data[begin];
 
	}
 

	
 
	/**
 
	 * Search for the first occurence of an item.
 
	 * Search for the first occurrence of an item.
 
	 * The '!=' operator of T is used for comparison.
 
	 * @param item Item to search for
 
	 * @return The position of the item, or End() when not present
 
	 */
 
	FORCEINLINE const T *Find(const T &item) const
 
	{
 
@@ -104,13 +104,13 @@ public:
 
		const T *end = this->End();
 
		while (pos != end && *pos != item) pos++;
 
		return pos;
 
	}
 

	
 
	/**
 
	 * Search for the first occurence of an item.
 
	 * Search for the first occurrence of an item.
 
	 * The '!=' operator of T is used for comparison.
 
	 * @param item Item to search for
 
	 * @return The position of the item, or End() when not present
 
	 */
 
	FORCEINLINE T *Find(const T &item)
 
	{
 
@@ -118,13 +118,13 @@ public:
 
		const T *end = this->End();
 
		while (pos != end && *pos != item) pos++;
 
		return pos;
 
	}
 

	
 
	/**
 
	 * Search for the first occurence of an item.
 
	 * Search for the first occurrence of an item.
 
	 * The '!=' operator of T is used for comparison.
 
	 * @param item Item to search for
 
	 * @return The position of the item, or -1 when not present
 
	 */
 
	FORCEINLINE int FindIndex(const T &item)
 
	{
 
@@ -247,25 +247,25 @@ public:
 
		return &this->data[index];
 
	}
 

	
 
	/**
 
	 * Get item "number" (const)
 
	 *
 
	 * @param index the positon of the item
 
	 * @param index the position of the item
 
	 * @return the item
 
	 */
 
	FORCEINLINE const T &operator[](uint index) const
 
	{
 
		assert(index < this->items);
 
		return this->data[index];
 
	}
 

	
 
	/**
 
	 * Get item "number"
 
	 *
 
	 * @param index the positon of the item
 
	 * @param index the position of the item
 
	 * @return the item
 
	 */
 
	FORCEINLINE T &operator[](uint index)
 
	{
 
		assert(index < this->items);
 
		return this->data[index];
src/core/sort_func.hpp
Show inline comments
 
@@ -35,13 +35,13 @@ static FORCEINLINE void QSortT(T *base, 
 
}
 

	
 
/**
 
 * Type safe Gnome Sort.
 
 *
 
 * This is a slightly modifyied Gnome search. The basic
 
 * Gnome search trys to sort already sorted list parts.
 
 * Gnome search tries to sort already sorted list parts.
 
 * The modification skips these.
 
 *
 
 * @note Use this sort for presorted / regular sorted data.
 
 *
 
 * @param base Pointer to the first element of the array to be sorted.
 
 * @param num Number of elements in the array pointed by base.
src/tree_map.h
Show inline comments
 
@@ -30,22 +30,22 @@ enum TreeType {
 
	TREE_CACTUS       = 0x1B, ///< a catus for the 'desert part' on a sub-tropical map
 
	TREE_SUB_TROPICAL = 0x1C, ///< tree on a sub-tropical map, non-rainforest, non-desert
 
	TREE_TOYLAND      = 0x20, ///< tree on a toyland map
 
	TREE_INVALID      = 0xFF, ///< An invalid tree
 
};
 

	
 
/**
 
/*
 
 * Counts the number of treetypes for each landscape.
 
 *
 
 * This list contains the counts of different treetypes for each landscape. This list contains
 
 * 5 entries instead of 4 (as there are only 4 landscape types) as the sub tropic landscape
 
 * got two types of area, one for normal trees and one only for cacti.
 
 * has two types of area, one for normal trees and one only for cacti.
 
 */
 
static const uint TREE_COUNT_TEMPERATE    = TREE_SUB_ARCTIC - TREE_TEMPERATE;    ///< number of treetypes on a temperate map
 
static const uint TREE_COUNT_SUB_ARCTIC   = TREE_RAINFOREST - TREE_SUB_ARCTIC;   ///< number of treetypes on a sub arctic map
 
static const uint TREE_COUNT_RAINFOREST   = TREE_CACTUS     - TREE_RAINFOREST;   ///< number of treetypes for the 'rainforrest part' of a sub-tropic map
 
static const uint TREE_COUNT_RAINFOREST   = TREE_CACTUS     - TREE_RAINFOREST;   ///< number of treetypes for the 'rainforest part' of a sub-tropic map
 
static const uint TREE_COUNT_SUB_TROPICAL = TREE_TOYLAND    - TREE_SUB_TROPICAL; ///< number of treetypes for the 'sub-tropic part' of a sub-tropic map
 
static const uint TREE_COUNT_TOYLAND      = 9;                                   ///< number of treetypes on a toyland map
 

	
 
/**
 
 * Enumeration for ground types of tiles with trees.
 
 *
src/viewport.cpp
Show inline comments
 
@@ -138,13 +138,13 @@ struct ViewportDrawer {
 

	
 
	SpriteCombineMode combine_sprites;               ///< Current mode of "sprite combining". @see StartSpriteCombine
 

	
 
	int foundation[FOUNDATION_PART_END];             ///< Foundation sprites (index into parent_sprites_to_draw).
 
	FoundationPart foundation_part;                  ///< Currently active foundation for ground sprite drawing.
 
	int *last_foundation_child[FOUNDATION_PART_END]; ///< Tail of ChildSprite list of the foundations. (index into child_screen_sprites_to_draw)
 
	Point foundation_offset[FOUNDATION_PART_END];    ///< Pixeloffset for ground sprites on the foundations.
 
	Point foundation_offset[FOUNDATION_PART_END];    ///< Pixel offset for ground sprites on the foundations.
 
};
 

	
 
static ViewportDrawer _vd;
 

	
 
TileHighlightData _thd;
 
static TileInfo *_cur_ti;
 
@@ -294,13 +294,13 @@ static void SetViewportPosition(Window *
 
	int i;
 
	int left, top, width, height;
 

	
 
	vp->virtual_left = x;
 
	vp->virtual_top = y;
 

	
 
	/* viewport is bound to its left top corner, so it must be rounded down (UnScaleByZoomLower)
 
	/* Viewport is bound to its left top corner, so it must be rounded down (UnScaleByZoomLower)
 
	 * else glitch described in FS#1412 will happen (offset by 1 pixel with zoom level > NORMAL)
 
	 */
 
	old_left = UnScaleByZoomLower(old_left, vp->zoom);
 
	old_top = UnScaleByZoomLower(old_top, vp->zoom);
 
	x = UnScaleByZoomLower(x, vp->zoom);
 
	y = UnScaleByZoomLower(y, vp->zoom);
 
@@ -462,13 +462,13 @@ void HandleZoomMessage(Window *w, const 
 

	
 
	w->SetWidgetDisabledState(widget_zoom_out, vp->zoom == ZOOM_LVL_MAX);
 
	w->SetWidgetDirty(widget_zoom_out);
 
}
 

	
 
/**
 
 * Shedules a tile sprite for drawing.
 
 * Schedules a tile sprite for drawing.
 
 *
 
 * @param image the image to draw.
 
 * @param pal the provided palette.
 
 * @param x position x (world coordinates) of the sprite.
 
 * @param y position y (world coordinates) of the sprite.
 
 * @param z position z (world coordinates) of the sprite.
 
@@ -865,13 +865,13 @@ static bool IsPartOfAutoLine(int px, int
 

	
 
	switch (_thd.drawstyle & HT_DIR_MASK) {
 
		case HT_DIR_X:  return py == 0; // x direction
 
		case HT_DIR_Y:  return px == 0; // y direction
 
		case HT_DIR_HU: return px == -py || px == -py - 16; // horizontal upper
 
		case HT_DIR_HL: return px == -py || px == -py + 16; // horizontal lower
 
		case HT_DIR_VL: return px == py || px == py + 16; // vertival left
 
		case HT_DIR_VL: return px == py || px == py + 16; // vertical left
 
		case HT_DIR_VR: return px == py || px == py - 16; // vertical right
 
		default:
 
			NOT_REACHED();
 
	}
 
}
 

	
 
@@ -1082,13 +1082,13 @@ static void ViewportAddLandscape()
 
 * Add a string to draw in the viewport
 
 * @param dpi current viewport area
 
 * @param small_from Zoomlevel from when the small font should be used
 
 * @param sign sign position and dimension
 
 * @param string_normal String for normal and 2x zoom level
 
 * @param string_small String for 4x and 8x zoom level
 
 * @param string_small_shadow Shadow string for 4x and 8x zoom level; or STR_NULL if no shadow
 
 * @param string_small_shadow Shadow string for 4x and 8x zoom level; or #STR_NULL if no shadow
 
 * @param colour colour of the sign background; or 0 if transparent
 
 */
 
void ViewportAddString(const DrawPixelInfo *dpi, ZoomLevel small_from, const ViewportSign *sign, StringID string_normal, StringID string_small, StringID string_small_shadow, uint64 params_1, uint64 params_2, Colours colour)
 
{
 
	bool small = dpi->zoom >= small_from;
 

	
 
@@ -1496,13 +1496,13 @@ static inline void ClampViewportToMap(co
 
	vy = Clamp(vy, 0, MapMaxY() * TILE_SIZE * 4);
 

	
 
	/* Convert map coordinates to viewport coordinates */
 
	x = (-vx + vy) / 2;
 
	y = ( vx + vy) / 4;
 

	
 
	/* Remove centreing */
 
	/* Remove centering */
 
	x -= vp->virtual_width / 2;
 
	y -= vp->virtual_height / 2;
 
}
 

	
 
/**
 
 * Update the viewport position being displayed.
 
@@ -1526,13 +1526,13 @@ void UpdateViewportPosition(Window *w)
 
		int delta_x = w->viewport->dest_scrollpos_x - w->viewport->scrollpos_x;
 
		int delta_y = w->viewport->dest_scrollpos_y - w->viewport->scrollpos_y;
 

	
 
		if (delta_x != 0 || delta_y != 0) {
 
			if (_settings_client.gui.smooth_scroll) {
 
				int max_scroll = ScaleByMapSize1D(512);
 
				/* Not at our desired positon yet... */
 
				/* Not at our desired position yet... */
 
				w->viewport->scrollpos_x += Clamp(delta_x / 4, -max_scroll, max_scroll);
 
				w->viewport->scrollpos_y += Clamp(delta_y / 4, -max_scroll, max_scroll);
 
			} else {
 
				w->viewport->scrollpos_x = w->viewport->dest_scrollpos_x;
 
				w->viewport->scrollpos_y = w->viewport->dest_scrollpos_y;
 
			}
src/window.cpp
Show inline comments
 
@@ -41,13 +41,13 @@ static Window *_mouseover_last_w = NULL;
 
/** List of windows opened at the screen sorted from the front. */
 
Window *_z_front_window = NULL;
 
/** List of windows opened at the screen sorted from the back. */
 
Window *_z_back_window  = NULL;
 

	
 
/*
 
 * Window that currently have focus. - The main purpose is to generate
 
 * Window that currently has focus. - The main purpose is to generate
 
 * FocusLost events, not to give next window in z-order focus when a
 
 * window is closed.
 
 */
 
Window *_focused_window;
 

	
 
Point _cursorpos_drag_start;
0 comments (0 inline, 0 general)