# HG changeset patch # User Darkvater # Date 1161947364 0 # Node ID aaa8a92059bf4bd0abc3a82455b7989029b8a9e3 # Parent 8588d2e7f409eea3f0a3ee0332628ad338a0c2ca (svn r6957) -Cleanup: comments, coding style diff -r 8588d2e7f409 -r aaa8a92059bf gfx.c --- a/gfx.c Fri Oct 27 11:08:17 2006 +0000 +++ b/gfx.c Fri Oct 27 11:09:24 2006 +0000 @@ -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; diff -r 8588d2e7f409 -r aaa8a92059bf misc_gui.c --- a/misc_gui.c Fri Oct 27 11:08:17 2006 +0000 +++ b/misc_gui.c Fri Oct 27 11:09:24 2006 +0000 @@ -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; diff -r 8588d2e7f409 -r aaa8a92059bf texteff.c --- a/texteff.c Fri Oct 27 11:08:17 2006 +0000 +++ b/texteff.c Fri Oct 27 11:09:24 2006 +0000 @@ -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;