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

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-07-11 10:09:41 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20130711100941-f0rwuvcwgl8ulqo8
Tags: 1.3.7.7.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
87
87
{
88
88
    setFrameSize(2);
89
89
 
90
 
    if (Theme::instance())
 
90
    Theme *const theme = Theme::instance();
 
91
    if (theme)
91
92
    {
92
93
        if (name.empty())
93
94
            name = "playerbox.xml";
94
 
        mSkin = Theme::instance()->loadSkinRect(mBackground,
 
95
        mSkin = theme->loadSkinRect(mBackground,
95
96
            name, "playerbox_background.xml");
96
97
        if (mSkin)
97
98
        {
102
103
        }
103
104
        if (selectedName.empty())
104
105
            selectedName = "playerboxselected.xml";
105
 
        mSelectedSkin = Theme::instance()->loadSkinRect(mSelectedBackground,
 
106
        mSelectedSkin = theme->loadSkinRect(mSelectedBackground,
106
107
            selectedName, "playerbox_background.xml");
107
108
    }
108
109
    else
119
120
    BLOCK_START("PlayerBox::draw")
120
121
    if (mBeing)
121
122
    {
122
 
        // Draw character
123
 
        const int bs = getFrameSize();
124
 
        const int x = getWidth() / 2 + bs + mOffsetX;
125
 
        const int y = getHeight() - bs + mOffsetY;
 
123
        const int bs = mFrameSize;
 
124
        const int x = mDimension.width / 2 + bs + mOffsetX;
 
125
        const int y = mDimension.height - bs + mOffsetY;
126
126
        mBeing->drawSpriteAt(static_cast<Graphics*>(graphics), x, y);
127
127
    }
128
128
 
129
129
    if (Client::getGuiAlpha() != mAlpha)
130
130
    {
 
131
        const float alpha = Client::getGuiAlpha();
131
132
        for (int a = 0; a < 9; a++)
132
133
        {
133
134
            if (mBackground.grid[a])
134
 
                mBackground.grid[a]->setAlpha(Client::getGuiAlpha());
 
135
                mBackground.grid[a]->setAlpha(alpha);
135
136
        }
136
137
    }
137
138
    BLOCK_END("PlayerBox::draw")
142
143
    BLOCK_START("PlayerBox::drawFrame")
143
144
    if (mDrawBackground)
144
145
    {
145
 
        int w, h, bs;
146
 
        bs = getFrameSize();
147
 
        w = getWidth() + bs * 2;
148
 
        h = getHeight() + bs * 2;
 
146
        const int bs = mFrameSize * 2;
 
147
        const int w = mDimension.width + bs;
 
148
        const int h = mDimension.height + bs;
149
149
 
150
150
        if (!mSelected)
151
151
        {