~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/gui/widgets/avatarlistbox.cpp

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-09-17 10:35:51 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130917103551-az7p3nz9jgxwqjfn
Tags: 1.3.9.15-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
#include "actorspritemanager.h"
25
25
#include "configuration.h"
26
 
#include "guild.h"
27
 
#include "localplayer.h"
 
26
#include "graphicsvertexes.h"
28
27
#include "maplayer.h"
29
28
 
 
29
#include "being/localplayer.h"
 
30
 
30
31
#include "gui/chatwindow.h"
31
32
#include "gui/gui.h"
32
33
#include "gui/sdlfont.h"
33
34
#include "gui/viewport.h"
34
35
 
35
36
#include "resources/image.h"
36
 
#include "resources/resourcemanager.h"
37
37
 
38
38
#include <guichan/font.hpp>
39
39
 
110
110
 
111
111
    // Draw the list elements
112
112
    graphics->setColorAll(mForegroundColor, mForegroundColor2);
 
113
    ImageCollection vertexes;
 
114
    const bool useCaching = openGLMode != RENDER_SAFE_OPENGL;
 
115
 
113
116
    for (int i = 0, y = 0;
114
117
         i < model->getNumberOfElements();
115
118
         ++i, y += fontHeight)
124
127
            const Image *const icon = a->getOnline()
125
128
                ? onlineIcon : offlineIcon;
126
129
            if (icon)
127
 
                graphics->drawImage(icon, mImagePadding, y + mPadding);
 
130
            {
 
131
                if (useCaching)
 
132
                {
 
133
                    graphics->calcTile(&vertexes, icon,
 
134
                        mImagePadding, y + mPadding);
 
135
                }
 
136
                else
 
137
                {
 
138
                    graphics->drawImage(icon, mImagePadding, y + mPadding);
 
139
                }
 
140
            }
128
141
        }
129
142
 
130
143
        std::string text;
289
302
        }
290
303
    }
291
304
 
 
305
    if (useCaching)
 
306
        graphics->drawTile(&vertexes);
 
307
 
292
308
    if (parent)
293
309
        setWidth(parent->getWidth() - 10);
294
310
    BLOCK_END("AvatarListBox::draw")