summaryrefslogtreecommitdiff
path: root/gfx.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-10-27 11:09:24 +0000
committerDarkvater <darkvater@openttd.org>2006-10-27 11:09:24 +0000
commitbc3c56ffeb832f45fc8009b586697e27f3f1c49a (patch)
treedd111ab67624dcf6659b19b75405c107d84c5420 /gfx.c
parent2543ab6b27be1b3bfdded804a1a628bdc996179a (diff)
downloadopenttd-bc3c56ffeb832f45fc8009b586697e27f3f1c49a.tar.xz
(svn r6957) -Cleanup: comments, coding style
Diffstat (limited to 'gfx.c')
-rw-r--r--gfx.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gfx.c b/gfx.c
index 749131a67..0f446abbd 100644
--- a/gfx.c
+++ b/gfx.c
@@ -1906,6 +1906,18 @@ void MarkWholeScreenDirty(void)
SetDirtyBlocks(0, 0, _screen.width, _screen.height);
}
+/** Set up a clipping area for only drawing into a certain area. To do this,
+ * Fill a DrawPixelInfo object with the supplied relative rectangle, backup
+ * the original (calling) _cur_dpi and assign the just returned DrawPixelInfo
+ * _cur_dpi. When you are done, give restore _cur_dpi's original value
+ * @param *n the DrawPixelInfo that will be the clipping rectangle box allowed
+ * for drawing
+ * @param left,top,width,height the relative coordinates of the clipping
+ * rectangle relative to the current _cur_dpi. This will most likely be the
+ * offset from the calling window coordinates
+ * @return return false if the requested rectangle is not possible with the
+ * current dpi pointer. Only continue of the return value is true, or you'll
+ * get some nasty results */
bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
{
const DrawPixelInfo *o = _cur_dpi;