diff options
author | peter1138 <peter1138@openttd.org> | 2009-04-11 10:38:00 +0000 |
---|---|---|
committer | peter1138 <peter1138@openttd.org> | 2009-04-11 10:38:00 +0000 |
commit | be7215497c6da65e0754bdfd2f03b67f80df7956 (patch) | |
tree | 7fe06d6ad5e3624823e272daf0d30542f2545ecd /src/network | |
parent | f16aa9f50988bbee22c10f48eff2e2c9528db30d (diff) | |
download | openttd-be7215497c6da65e0754bdfd2f03b67f80df7956.tar.xz |
(svn r16026) -Codechange: Use font height for chat line spacing instead of fixed value.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/network_chat_gui.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index 18870b0ce..94d88412a 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -27,7 +27,7 @@ assert_compile((int)DRAW_STRING_BUFFER >= (int)NETWORK_CHAT_LENGTH + NETWORK_NAME_LENGTH + 40); enum { - NETWORK_CHAT_LINE_HEIGHT = 13, + NETWORK_CHAT_LINE_SPACING = 3, }; struct ChatMessage { @@ -113,7 +113,7 @@ void NetworkInitChatMessage() _chatmsg_box.x = 10; _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 + 2; + _chatmsg_box.height = _settings_client.gui.network_chat_box_height * (FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING) + 2; _chatmessage_backup = ReallocT(_chatmessage_backup, _chatmsg_box.width * _chatmsg_box.height * BlitterFactoryBase::GetCurrentBlitter()->GetBytesPerPixel()); for (uint i = 0; i < MAX_CHAT_MESSAGES; i++) { @@ -229,14 +229,14 @@ void NetworkDrawChatMessage() /* Paint a half-transparent box behind the chat messages */ GfxFillRect( _chatmsg_box.x, - _screen.height - _chatmsg_box.y - count * NETWORK_CHAT_LINE_HEIGHT - 2, + _screen.height - _chatmsg_box.y - count * (FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING) - 2, _chatmsg_box.x + _chatmsg_box.width - 1, _screen.height - _chatmsg_box.y - 2, PALETTE_TO_TRANSPARENT, FILLRECT_RECOLOUR // black, but with some alpha for background ); /* Paint the chat messages starting with the lowest at the bottom */ - for (uint y = NETWORK_CHAT_LINE_HEIGHT; count-- != 0; y += NETWORK_CHAT_LINE_HEIGHT) { + for (uint y = FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING; count-- != 0; y += (FONT_HEIGHT_NORMAL + NETWORK_CHAT_LINE_SPACING)) { DrawString(_chatmsg_box.x + 3, _chatmsg_box.x + _chatmsg_box.width - 1, _screen.height - _chatmsg_box.y - y + 1, _chatmsg_list[count].message, _chatmsg_list[count].colour); } |