mirror of https://github.com/OpenTTD/OpenTTD
(svn r20705) -Fix: graphic glitch when switching to a different-sized font while the chat message box was visible
parent
1906dc80af
commit
0068c02244
|
@ -112,16 +112,22 @@ void CDECL NetworkAddChatMessage(TextColour colour, uint8 duration, const char *
|
||||||
_chatmessage_dirty = true;
|
_chatmessage_dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Initialize all font-dependent chat box sizes. */
|
||||||
|
void NetworkReInitChatBoxSize()
|
||||||
|
{
|
||||||
|
_chatmsg_box.y = 3 * FONT_HEIGHT_NORMAL;
|
||||||
|
_chatmsg_box.height = MAX_CHAT_MESSAGES * (FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING) + 2;
|
||||||
|
_chatmessage_backup = ReallocT(_chatmessage_backup, _chatmsg_box.width * _chatmsg_box.height * BlitterFactoryBase::GetCurrentBlitter()->GetBytesPerPixel());
|
||||||
|
}
|
||||||
|
|
||||||
void NetworkInitChatMessage()
|
void NetworkInitChatMessage()
|
||||||
{
|
{
|
||||||
MAX_CHAT_MESSAGES = _settings_client.gui.network_chat_box_height;
|
MAX_CHAT_MESSAGES = _settings_client.gui.network_chat_box_height;
|
||||||
|
|
||||||
_chatmsg_list = ReallocT(_chatmsg_list, _settings_client.gui.network_chat_box_height);
|
_chatmsg_list = ReallocT(_chatmsg_list, _settings_client.gui.network_chat_box_height);
|
||||||
_chatmsg_box.x = 10;
|
_chatmsg_box.x = 10;
|
||||||
_chatmsg_box.y = 3 * FONT_HEIGHT_NORMAL;
|
|
||||||
_chatmsg_box.width = _settings_client.gui.network_chat_box_width;
|
_chatmsg_box.width = _settings_client.gui.network_chat_box_width;
|
||||||
_chatmsg_box.height = _settings_client.gui.network_chat_box_height * (FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING) + 2;
|
NetworkReInitChatBoxSize();
|
||||||
_chatmessage_backup = ReallocT(_chatmessage_backup, _chatmsg_box.width * _chatmsg_box.height * BlitterFactoryBase::GetCurrentBlitter()->GetBytesPerPixel());
|
|
||||||
_chatmessage_visible = false;
|
_chatmessage_visible = false;
|
||||||
|
|
||||||
for (uint i = 0; i < MAX_CHAT_MESSAGES; i++) {
|
for (uint i = 0; i < MAX_CHAT_MESSAGES; i++) {
|
||||||
|
|
|
@ -2619,6 +2619,10 @@ void ReInitAllWindows()
|
||||||
FOR_ALL_WINDOWS_FROM_BACK(w) {
|
FOR_ALL_WINDOWS_FROM_BACK(w) {
|
||||||
w->ReInit();
|
w->ReInit();
|
||||||
}
|
}
|
||||||
|
#ifdef ENABLE_NETWORK
|
||||||
|
void NetworkReInitChatBoxSize();
|
||||||
|
NetworkReInitChatBoxSize();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Make sure essential parts of all windows are visible */
|
/* Make sure essential parts of all windows are visible */
|
||||||
RelocateAllWindows(_cur_resolution.width, _cur_resolution.height);
|
RelocateAllWindows(_cur_resolution.width, _cur_resolution.height);
|
||||||
|
|
Loading…
Reference in New Issue