mirror of https://github.com/OpenTTD/OpenTTD
(svn r6957) -Cleanup: comments, coding style
parent
2543ab6b27
commit
bc3c56ffeb
12
gfx.c
12
gfx.c
|
@ -1906,6 +1906,18 @@ void MarkWholeScreenDirty(void)
|
||||||
SetDirtyBlocks(0, 0, _screen.width, _screen.height);
|
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)
|
bool FillDrawPixelInfo(DrawPixelInfo *n, int left, int top, int width, int height)
|
||||||
{
|
{
|
||||||
const DrawPixelInfo *o = _cur_dpi;
|
const DrawPixelInfo *o = _cur_dpi;
|
||||||
|
|
|
@ -886,7 +886,8 @@ bool MoveTextBufferPos(Textbuf *tb, int navmode)
|
||||||
* @param buf the buffer that will be holding the data for input
|
* @param buf the buffer that will be holding the data for input
|
||||||
* @param maxlength maximum length in characters of this buffer
|
* @param maxlength maximum length in characters of this buffer
|
||||||
* @param maxwidth maximum length in pixels of this buffer. If reached, 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)
|
void InitializeTextBuffer(Textbuf *tb, const char *buf, uint16 maxlength, uint16 maxwidth)
|
||||||
{
|
{
|
||||||
tb->buf = (char*)buf;
|
tb->buf = (char*)buf;
|
||||||
|
|
|
@ -48,7 +48,7 @@ static bool _textmessage_visible = false;
|
||||||
static const Oblong _textmsg_box = {10, 30, 500, 150};
|
static const Oblong _textmsg_box = {10, 30, 500, 150};
|
||||||
static Pixel _textmessage_backup[150 * 500]; // (height * width)
|
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)
|
static inline uint GetTextMessageCount(void)
|
||||||
{
|
{
|
||||||
|
@ -240,8 +240,7 @@ void AddTextEffect(StringID msg, int x, int y, uint16 duration)
|
||||||
int w;
|
int w;
|
||||||
char buffer[100];
|
char buffer[100];
|
||||||
|
|
||||||
if (_game_mode == GM_MENU)
|
if (_game_mode == GM_MENU) return;
|
||||||
return;
|
|
||||||
|
|
||||||
for (te = _text_effect_list; te->string_id != INVALID_STRING_ID; ) {
|
for (te = _text_effect_list; te->string_id != INVALID_STRING_ID; ) {
|
||||||
if (++te == endof(_text_effect_list)) return;
|
if (++te == endof(_text_effect_list)) return;
|
||||||
|
|
Loading…
Reference in New Issue