summaryrefslogtreecommitdiff
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
commit6db3e0bf4aa2c69851f8a8ddc7deff888becd5df (patch)
treedd111ab67624dcf6659b19b75405c107d84c5420
parentfce635719a95a73110b34e59f6f548f02262ecb7 (diff)
downloadopenttd-6db3e0bf4aa2c69851f8a8ddc7deff888becd5df.tar.xz
(svn r6957) -Cleanup: comments, coding style
-rw-r--r--gfx.c12
-rw-r--r--misc_gui.c3
-rw-r--r--texteff.c5
3 files changed, 16 insertions, 4 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;
diff --git a/misc_gui.c b/misc_gui.c
index 3b736a334..168255c15 100644
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -886,7 +886,8 @@ bool MoveTextBufferPos(Textbuf *tb, int navmode)
* @param buf the buffer that will be holding the data for input
* @param maxlength maximum length in characters of this buffer
* @param maxwidth maximum length in pixels of this buffer. If reached, buffer
- * cannot grow, even if maxlength would allow because there is space */
+ * cannot grow, even if maxlength would allow because there is space. A length
+ * of zero '0' means the buffer is only restricted by maxlength */
void InitializeTextBuffer(Textbuf *tb, const char *buf, uint16 maxlength, uint16 maxwidth)
{
tb->buf = (char*)buf;
diff --git a/texteff.c b/texteff.c
index 6295448b3..84d22726a 100644
--- a/texteff.c
+++ b/texteff.c
@@ -48,7 +48,7 @@ static bool _textmessage_visible = false;
static const Oblong _textmsg_box = {10, 30, 500, 150};
static Pixel _textmessage_backup[150 * 500]; // (height * width)
-extern void memcpy_pitch(void *d, void *s, int w, int h, int spitch, int dpitch);
+extern void memcpy_pitch(void *dst, void *src, int w, int h, int srcpitch, int dstpitch);
static inline uint GetTextMessageCount(void)
{
@@ -240,8 +240,7 @@ void AddTextEffect(StringID msg, int x, int y, uint16 duration)
int w;
char buffer[100];
- if (_game_mode == GM_MENU)
- return;
+ if (_game_mode == GM_MENU) return;
for (te = _text_effect_list; te->string_id != INVALID_STRING_ID; ) {
if (++te == endof(_text_effect_list)) return;