Changeset - r6374:befc514fb4d4
[Not reviewed]
master
0 1 0
rubidium - 18 years ago 2007-03-25 00:13:22
rubidium@openttd.org
(svn r9437) -Fix (r9420): dedicated server crashed when the y part of the resolution was less than 10.
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/texteff.cpp
Show inline comments
 
@@ -153,12 +153,13 @@ void UndrawTextMessage()
 
			height = max(height + y, min(_textmsg_box.height, _screen.height));
 
			y = 0;
 
		}
 
		if (x + width >= _screen.width) {
 
			width = _screen.width - x;
 
		}
 
		if (width <= 0 || height <= 0) return;
 

	
 
		_textmessage_visible = false;
 
		/* Put our 'shot' back to the screen */
 
		memcpy_pitch(
 
			_screen.dst_ptr + x + y * _screen.pitch,
 
			_textmessage_backup,
 
@@ -217,12 +218,14 @@ void DrawTextMessage()
 
		height = max(height + y, min(_textmsg_box.height, _screen.height));
 
		y = 0;
 
	}
 
	if (x + width >= _screen.width) {
 
		width = _screen.width - x;
 
	}
 
	if (width <= 0 || height <= 0) return;
 

	
 
	/* Make a copy of the screen as it is before painting (for undraw) */
 
	memcpy_pitch(
 
		_textmessage_backup,
 
		_screen.dst_ptr + x + y * _screen.pitch,
 
		width, height, _screen.pitch, _textmsg_box.width);
 

	
0 comments (0 inline, 0 general)