~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/network/network_chat_gui.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Kooijman, Matthijs Kooijman
  • Date: 2009-10-01 22:52:59 UTC
  • mfrom: (1.1.8 upstream) (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091001225259-5kpkp4sthbszpyif
[ Matthijs Kooijman ]
* New upstream release
* Use printf instead of echo -en in openttd-wrapper to make it POSIX
  compatible (Closes: #547758).
* Remove three patches that are now included in upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: network_chat_gui.cpp 15912 2009-04-01 14:24:54Z rubidium $ */
 
1
/* $Id: network_chat_gui.cpp 16598 2009-06-18 22:16:52Z rubidium $ */
2
2
 
3
3
/** @file network_chat_gui.cpp GUI for handling chat messages. */
4
4
 
124
124
/** Hide the chatbox */
125
125
void NetworkUndrawChatMessage()
126
126
{
 
127
        /* Sometimes we also need to hide the cursor
 
128
         *   This is because both textmessage and the cursor take a shot of the
 
129
         *   screen before drawing.
 
130
         *   Now the textmessage takes his shot and paints his data before the cursor
 
131
         *   does, so in the shot of the cursor is the screen-data of the textmessage
 
132
         *   included when the cursor hangs somewhere over the textmessage. To
 
133
         *   avoid wrong repaints, we undraw the cursor in that case, and everything
 
134
         *   looks nicely ;)
 
135
         * (and now hope this story above makes sense to you ;))
 
136
         */
 
137
        if (_cursor.visible &&
 
138
                        _cursor.draw_pos.x + _cursor.draw_size.x >= _chatmsg_box.x &&
 
139
                        _cursor.draw_pos.x <= _chatmsg_box.x + _chatmsg_box.width &&
 
140
                        _cursor.draw_pos.y + _cursor.draw_size.y >= _screen.height - _chatmsg_box.y - _chatmsg_box.height &&
 
141
                        _cursor.draw_pos.y <= _screen.height - _chatmsg_box.y) {
 
142
                UndrawMouseCursor();
 
143
        }
 
144
 
127
145
        if (_chatmessage_visible) {
128
146
                Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter();
129
 
                /* Sometimes we also need to hide the cursor
130
 
                 *   This is because both textmessage and the cursor take a shot of the
131
 
                 *   screen before drawing.
132
 
                 *   Now the textmessage takes his shot and paints his data before the cursor
133
 
                 *   does, so in the shot of the cursor is the screen-data of the textmessage
134
 
                 *   included when the cursor hangs somewhere over the textmessage. To
135
 
                 *   avoid wrong repaints, we undraw the cursor in that case, and everything
136
 
                 *   looks nicely ;)
137
 
                 * (and now hope this story above makes sense to you ;))
138
 
                 */
139
 
 
140
 
                if (_cursor.visible) {
141
 
                        if (_cursor.draw_pos.x + _cursor.draw_size.x >= _chatmsg_box.x &&
142
 
                                _cursor.draw_pos.x <= _chatmsg_box.x + _chatmsg_box.width &&
143
 
                                _cursor.draw_pos.y + _cursor.draw_size.y >= _screen.height - _chatmsg_box.y - _chatmsg_box.height &&
144
 
                                _cursor.draw_pos.y <= _screen.height - _chatmsg_box.y) {
145
 
                                UndrawMouseCursor();
146
 
                        }
147
 
                }
148
 
 
149
147
                int x      = _chatmsg_box.x;
150
148
                int y      = _screen.height - _chatmsg_box.y - _chatmsg_box.height;
151
149
                int width  = _chatmsg_box.width;