changeset 4958:1298c13d9fcb draft

(svn r6957) -Cleanup: comments, coding style
author Darkvater <Darkvater@openttd.org>
date Fri, 27 Oct 2006 11:09:24 +0000
parents 407284f992ba
children e48a8345528b
files gfx.c misc_gui.c texteff.c
diffstat 3 files changed, 16 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gfx.c
+++ b/gfx.c
@@ -1906,6 +1906,18 @@
 	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;
--- a/misc_gui.c
+++ b/misc_gui.c
@@ -886,7 +886,8 @@
  * @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;
--- a/texteff.c
+++ b/texteff.c
@@ -48,7 +48,7 @@
 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 @@
 	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;