summaryrefslogtreecommitdiff
path: root/src/viewport.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-04-19 13:05:05 +0000
committerrubidium <rubidium@openttd.org>2008-04-19 13:05:05 +0000
commitc84fe27ca9ece2909a8b0f01d10f1e9704f9d8ae (patch)
tree63e2bd0279fba7a1ae215dcd1df8b5ad092a0cd4 /src/viewport.cpp
parent118a680fd34aae6ab48d553d76237fe93e350759 (diff)
downloadopenttd-c84fe27ca9ece2909a8b0f01d10f1e9704f9d8ae.tar.xz
(svn r12787) -Documentation: add/fix documentation of some functions. Patch by Alberth.
Diffstat (limited to 'src/viewport.cpp')
-rw-r--r--src/viewport.cpp40
1 files changed, 34 insertions, 6 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index ad9e140d7..582943b64 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -158,6 +158,18 @@ void DeleteWindowViewport(Window *w)
w->viewport = NULL;
}
+/**
+ * Initialize viewport of the window for use.
+ * @param w Window to use/display the viewport in
+ * @param x Offset of left edge of viewport with respect to left edge window \a w
+ * @param y Offset of top edge of viewport with respect to top edge window \a w
+ * @param width Width of the viewport
+ * @param height Height of the viewport
+ * @param follow_flags Flags controlling the viewport.
+ * - If bit 31 is set, the lower 16 bits are the vehicle that the viewport should follow.
+ * - If bit 31 is clear, it is a tile position.
+ * @param zoom Zoomlevel to display
+ */
void AssignWindowViewport(Window *w, int x, int y,
int width, int height, uint32 follow_flags, ZoomLevel zoom)
{
@@ -324,7 +336,14 @@ static void SetViewportPosition(Window *w, int x, int y)
}
}
-
+/**
+ * Is a xy position inside the viewport of the window?
+ * @param w Window to examine its viewport
+ * @param x X coordinate of the xy position
+ * @param y Y coordinate of the xy position
+ * @return Pointer to the viewport if the xy position is in the viewport of the window,
+ * otherwise \c NULL is returned.
+ */
ViewPort *IsPtInWindowViewport(const Window *w, int x, int y)
{
ViewPort *vp = w->viewport;
@@ -1591,11 +1610,12 @@ void UpdateViewportPosition(Window *w)
}
/**
- * Marks a viewport as dirty for repaint.
- *
- * @param vp The viewport to mark as dirty
- * @todo documents the missing parameters @c left, @c top, @c right and @c bottom
- * @todo detailed description missing
+ * Marks a viewport as dirty for repaint if it displays (a part of) the area the needs to be repainted.
+ * @param vp The viewport to mark as dirty
+ * @param left Left edge of area to repaint
+ * @param top Top edge of area to repaint
+ * @param right Right edge of area to repaint
+ * @param bottom Bottom edge of area to repaint
* @ingroup dirty
*/
static void MarkViewportDirty(const ViewPort *vp, int left, int top, int right, int bottom)
@@ -1622,6 +1642,14 @@ static void MarkViewportDirty(const ViewPort *vp, int left, int top, int right,
);
}
+/**
+ * Mark all viewports that display an area as dirty (in need of repaint).
+ * @param left Left edge of area to repaint
+ * @param top Top edge of area to repaint
+ * @param right Right edge of area to repaint
+ * @param bottom Bottom edge of area to repaint
+ * @ingroup dirty
+ */
void MarkAllViewportsDirty(int left, int top, int right, int bottom)
{
Window **wz;