diff options
author | glx <glx@openttd.org> | 2008-08-15 22:06:58 +0000 |
---|---|---|
committer | glx <glx@openttd.org> | 2008-08-15 22:06:58 +0000 |
commit | c7453851d3b0d479f86933290bf68299138ee928 (patch) | |
tree | eaf62e145b2293b076052608efe28f50ee6f32d7 /src/network | |
parent | 6957fbb5d01147f59a5676964a0c48c3f7075ec4 (diff) | |
download | openttd-c7453851d3b0d479f86933290bf68299138ee928.tar.xz |
(svn r14080) -Fix (r14052): assert triggered when drawing chat window with 32bpp-anim blitter (backup buffer was too small)
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_chat_gui.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index e2ee3e230..38bb2ee9b 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -119,7 +119,7 @@ void NetworkInitChatMessage() _chatmsg_box.y = 30; _chatmsg_box.width = _settings_client.gui.network_chat_box_width; _chatmsg_box.height = _settings_client.gui.network_chat_box_height * NETWORK_CHAT_LINE_HEIGHT; - _chatmessage_backup = ReallocT(_chatmessage_backup, _chatmsg_box.width * _chatmsg_box.height * sizeof(uint32)); + _chatmessage_backup = ReallocT(_chatmessage_backup, _chatmsg_box.width * _chatmsg_box.height * BlitterFactoryBase::GetCurrentBlitter()->GetBytesPerPixel()); for (uint i = 0; i < MAX_CHAT_MESSAGES; i++) { _chatmsg_list[i].message[0] = '\0'; @@ -224,7 +224,7 @@ void NetworkDrawChatMessage() } if (width <= 0 || height <= 0) return; - assert(blitter->BufferSize(width, height) < (int)(_chatmsg_box.width * _chatmsg_box.height * sizeof(uint32))); + assert(blitter->BufferSize(width, height) <= (int)(_chatmsg_box.width * _chatmsg_box.height * blitter->GetBytesPerPixel())); /* Make a copy of the screen as it is before painting (for undraw) */ blitter->CopyToBuffer(blitter->MoveTo(_screen.dst_ptr, x, y), _chatmessage_backup, width, height); |