diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-09-09 19:43:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-09-09 19:43:40 +0300 |
commit | 4484b433abc8f07bcf7d4d22fd946e00b66b078d (patch) | |
tree | d8d04c6ea9526b90334e7b0a4abf44e2508a3597 /src/gui | |
parent | c1fb0bf9dc98e2a30f33cbbf4f74604b36efbcba (diff) | |
download | mv-4484b433abc8f07bcf7d4d22fd946e00b66b078d.tar.gz mv-4484b433abc8f07bcf7d4d22fd946e00b66b078d.tar.bz2 mv-4484b433abc8f07bcf7d4d22fd946e00b66b078d.tar.xz mv-4484b433abc8f07bcf7d4d22fd946e00b66b078d.zip |
Fix first part of shadow variables/methods errors.
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/changeemaildialog.cpp | 18 | ||||
-rw-r--r-- | src/gui/changeemaildialog.h | 2 | ||||
-rw-r--r-- | src/gui/changepassworddialog.cpp | 20 | ||||
-rw-r--r-- | src/gui/changepassworddialog.h | 2 | ||||
-rw-r--r-- | src/gui/charselectdialog.cpp | 10 | ||||
-rw-r--r-- | src/gui/charselectdialog.h | 2 | ||||
-rw-r--r-- | src/gui/chatwindow.cpp | 4 | ||||
-rw-r--r-- | src/gui/palette.h | 13 | ||||
-rw-r--r-- | src/gui/popupmenu.cpp | 8 | ||||
-rw-r--r-- | src/gui/setup_video.cpp | 30 | ||||
-rw-r--r-- | src/gui/spellpopup.cpp | 8 | ||||
-rw-r--r-- | src/gui/statuspopup.cpp | 6 | ||||
-rw-r--r-- | src/gui/textpopup.cpp | 6 | ||||
-rw-r--r-- | src/gui/widgets/avatarlistbox.cpp | 3 | ||||
-rw-r--r-- | src/gui/widgets/browserbox.cpp | 14 | ||||
-rw-r--r-- | src/gui/widgets/popup.cpp | 10 | ||||
-rw-r--r-- | src/gui/widgets/progressbar.h | 4 | ||||
-rw-r--r-- | src/gui/widgets/window.cpp | 84 | ||||
-rw-r--r-- | src/gui/windowmenu.cpp | 8 |
19 files changed, 124 insertions, 128 deletions
diff --git a/src/gui/changeemaildialog.cpp b/src/gui/changeemaildialog.cpp index c24624bc2..69af649e2 100644 --- a/src/gui/changeemaildialog.cpp +++ b/src/gui/changeemaildialog.cpp @@ -44,10 +44,10 @@ #include "debug.h" -ChangeEmailDialog::ChangeEmailDialog(LoginData *loginData): +ChangeEmailDialog::ChangeEmailDialog(LoginData *data): Window(_("Change Email Address"), true), mWrongDataNoticeListener(new WrongDataNoticeListener), - mLoginData(loginData) + mLoginData(data) { gcn::Label *accountLabel = new Label(strprintf(_("Account: %s"), mLoginData->username.c_str())); @@ -120,7 +120,7 @@ void ChangeEmailDialog::action(const gcn::ActionEvent &event) logger->log("ChangeEmailDialog::Email change, Username is %s", username.c_str()); - std::stringstream errorMessage; + std::stringstream errorMsg; int error = 0; unsigned int min = Net::getLoginHandler()->getMinPasswordLength(); @@ -129,21 +129,21 @@ void ChangeEmailDialog::action(const gcn::ActionEvent &event) if (newFirstEmail.length() < min) { // First email address too short - errorMessage << strprintf(_("The new email address needs to be at " - "least %d characters long."), min); + errorMsg << strprintf(_("The new email address needs to be at " + "least %d characters long."), min); error = 1; } else if (newFirstEmail.length() > max - 1 ) { // First email address too long - errorMessage << strprintf(_("The new email address needs to be " - "less than %d characters long."), max); + errorMsg << strprintf(_("The new email address needs to be " + "less than %d characters long."), max); error = 1; } else if (newFirstEmail != newSecondEmail) { // Second Pass mismatch - errorMessage << _("The email address entries mismatch."); + errorMsg << _("The email address entries mismatch."); error = 2; } @@ -154,7 +154,7 @@ void ChangeEmailDialog::action(const gcn::ActionEvent &event) else if (error == 2) mWrongDataNoticeListener->setTarget(this->mSecondEmailField); - OkDialog *dlg = new OkDialog(_("Error"), errorMessage.str()); + OkDialog *dlg = new OkDialog(_("Error"), errorMsg.str()); if (dlg) dlg->addActionListener(mWrongDataNoticeListener); } diff --git a/src/gui/changeemaildialog.h b/src/gui/changeemaildialog.h index e130a9074..fccb5cb1c 100644 --- a/src/gui/changeemaildialog.h +++ b/src/gui/changeemaildialog.h @@ -46,7 +46,7 @@ class ChangeEmailDialog : public Window, public gcn::ActionListener * * @see Window::Window */ - ChangeEmailDialog(LoginData *loginData); + ChangeEmailDialog(LoginData *data); /** * Destructor. diff --git a/src/gui/changepassworddialog.cpp b/src/gui/changepassworddialog.cpp index 30012ae52..56db37ebb 100644 --- a/src/gui/changepassworddialog.cpp +++ b/src/gui/changepassworddialog.cpp @@ -46,10 +46,10 @@ #include "debug.h" -ChangePasswordDialog::ChangePasswordDialog(LoginData *loginData): +ChangePasswordDialog::ChangePasswordDialog(LoginData *data): Window(_("Change Password"), true), mWrongDataNoticeListener(new WrongDataNoticeListener), - mLoginData(loginData) + mLoginData(data) { gcn::Label *accountLabel = new Label( strprintf(_("Account: %s"), mLoginData->username.c_str())); @@ -101,7 +101,7 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event) logger->log("ChangePasswordDialog::Password change, Username is %s", username.c_str()); - std::stringstream errorMessage; + std::stringstream errorMsg; int error = 0; unsigned int min = Net::getLoginHandler()->getMinPasswordLength(); @@ -111,27 +111,27 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event) if (oldPassword.empty()) { // No old password - errorMessage << _("Enter the old password first."); + errorMsg << _("Enter the old password first."); error = 1; } else if (newFirstPass.length() < min) { // First password too short - errorMessage << strprintf(_("The new password needs to be at least" - " %d characters long."), min); + errorMsg << strprintf(_("The new password needs to be at least" + " %d characters long."), min); error = 2; } else if (newFirstPass.length() > max - 1 ) { // First password too long - errorMessage << strprintf(_("The new password needs to be less " - "than %d characters long."), max); + errorMsg << strprintf(_("The new password needs to be less " + "than %d characters long."), max); error = 2; } else if (newFirstPass != newSecondPass) { // Second Pass mismatch - errorMessage << _("The new password entries mismatch."); + errorMsg << _("The new password entries mismatch."); error = 3; } @@ -144,7 +144,7 @@ void ChangePasswordDialog::action(const gcn::ActionEvent &event) else if (error == 3) mWrongDataNoticeListener->setTarget(this->mSecondPassField); - OkDialog *dlg = new OkDialog(_("Error"), errorMessage.str()); + OkDialog *dlg = new OkDialog(_("Error"), errorMsg.str()); dlg->addActionListener(mWrongDataNoticeListener); } else diff --git a/src/gui/changepassworddialog.h b/src/gui/changepassworddialog.h index 3b0626922..fca8b4946 100644 --- a/src/gui/changepassworddialog.h +++ b/src/gui/changepassworddialog.h @@ -46,7 +46,7 @@ class ChangePasswordDialog : public Window, public gcn::ActionListener * * @see Window::Window */ - ChangePasswordDialog(LoginData *loginData); + ChangePasswordDialog(LoginData *data); /** * Destructor diff --git a/src/gui/charselectdialog.cpp b/src/gui/charselectdialog.cpp index 75468d1ab..f926a90aa 100644 --- a/src/gui/charselectdialog.cpp +++ b/src/gui/charselectdialog.cpp @@ -121,20 +121,20 @@ class CharacterDisplay : public Container Button *mDelete; }; -CharSelectDialog::CharSelectDialog(LoginData *loginData): +CharSelectDialog::CharSelectDialog(LoginData *data): Window(_("Account and Character Management")), mLocked(false), mUnregisterButton(0), mChangeEmailButton(0), mCharacterEntries(0), - mLoginData(loginData), + mLoginData(data), mCharHandler(Net::getCharHandler()), mDeleteDialog(0), mDeleteIndex(-1) { setCloseButton(false); - mAccountNameLabel = new Label(loginData->username); + mAccountNameLabel = new Label(mLoginData->username); mSwitchLoginButton = new Button(_("Switch Login"), "switch", this); mChangePasswordButton = new Button(_("Change Password"), "change_password", this); @@ -373,7 +373,7 @@ void CharSelectDialog::setLocked(bool locked) } bool CharSelectDialog::selectByName(const std::string &name, - SelectAction action) + SelectAction selAction) { if (mLocked) return false; @@ -387,7 +387,7 @@ bool CharSelectDialog::selectByName(const std::string &name, { if (mCharacterEntries[i]) mCharacterEntries[i]->requestFocus(); - if (action == Choose) + if (selAction == Choose) attemptCharacterSelect(i); return true; } diff --git a/src/gui/charselectdialog.h b/src/gui/charselectdialog.h index bcbbb7679..0dfe90733 100644 --- a/src/gui/charselectdialog.h +++ b/src/gui/charselectdialog.h @@ -60,7 +60,7 @@ class CharSelectDialog : public Window, public gcn::ActionListener, /** * Constructor. */ - CharSelectDialog(LoginData *loginData); + CharSelectDialog(LoginData *data); ~CharSelectDialog(); diff --git a/src/gui/chatwindow.cpp b/src/gui/chatwindow.cpp index 639125739..1b9877363 100644 --- a/src/gui/chatwindow.cpp +++ b/src/gui/chatwindow.cpp @@ -666,8 +666,8 @@ void ChatWindow::mouseDragged(gcn::MouseEvent &event) { int newX = std::max(0, getX() + event.getX() - mDragOffsetX); int newY = std::max(0, getY() + event.getY() - mDragOffsetY); - newX = std::min(graphics->mWidth - getWidth(), newX); - newY = std::min(graphics->mHeight - getHeight(), newY); + newX = std::min(mainGraphics->mWidth - getWidth(), newX); + newY = std::min(mainGraphics->mHeight - getHeight(), newY); setPosition(newX, newY); } } diff --git a/src/gui/palette.h b/src/gui/palette.h index 1cebe236f..645260280 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -182,13 +182,14 @@ class Palette int delay; int committedDelay; - void set(int type, gcn::Color& color, GradientType grad, int delay) + void set(int type0, gcn::Color& color0, GradientType grad0, + int delay0) { - ColorElem::type = type; - ColorElem::color = color; - ColorElem::testColor = color; - ColorElem::grad = grad; - ColorElem::delay = delay; + ColorElem::type = type0; + ColorElem::color = color0; + ColorElem::testColor = color0; + ColorElem::grad = grad0; + ColorElem::delay = delay0; ColorElem::gradientIndex = rand(); } diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp index a329488ce..7e43c9954 100644 --- a/src/gui/popupmenu.cpp +++ b/src/gui/popupmenu.cpp @@ -2029,10 +2029,10 @@ void PopupMenu::showUndressPopup(int x, int y, Being *being, Item *item) void PopupMenu::showPopup(int x, int y) { setContentSize(mBrowserBox->getWidth() + 8, mBrowserBox->getHeight() + 8); - if (graphics->mWidth < (x + getWidth() + 5)) - x = graphics->mWidth - getWidth(); - if (graphics->mHeight < (y + getHeight() + 5)) - y = graphics->mHeight - getHeight(); + if (mainGraphics->mWidth < (x + getWidth() + 5)) + x = mainGraphics->mWidth - getWidth(); + if (mainGraphics->mHeight < (y + getHeight() + 5)) + y = mainGraphics->mHeight - getHeight(); setPosition(x, y); setVisible(true); requestMoveToTop(); diff --git a/src/gui/setup_video.cpp b/src/gui/setup_video.cpp index 0bfab1438..7bbcd9a2c 100644 --- a/src/gui/setup_video.cpp +++ b/src/gui/setup_video.cpp @@ -59,7 +59,7 @@ #include "debug.h" -extern Graphics *graphics; +extern Graphics *mainGraphics; /** * The list model for mode list. @@ -157,8 +157,8 @@ ModeListModel::ModeListModel() addCustomMode("1280x1024"); addCustomMode("1400x900"); addCustomMode("1500x990"); - addCustomMode(toString(graphics->mWidth) + "x" - + toString(graphics->mHeight)); + addCustomMode(toString(mainGraphics->mWidth) + "x" + + toString(mainGraphics->mHeight)); std::sort(mVideoModes.begin(), mVideoModes.end(), modeSorter); mVideoModes.push_back("custom"); @@ -348,8 +348,8 @@ Setup_Video::Setup_Video(): mFpsCheckBox->setSelected(mFps > 0); // Pre-select the current video mode. - std::string videoMode = toString(graphics->mWidth) + "x" - + toString(graphics->mHeight); + std::string videoMode = toString(mainGraphics->mWidth) + "x" + + toString(mainGraphics->mHeight); mModeList->setSelected(mModeListModel->getIndexOf(videoMode)); mModeList->setActionEventId("videomode"); @@ -473,10 +473,10 @@ void Setup_Video::apply() if (!config.getIntValue("opengl")) { #endif - if (!graphics->setFullscreen(fullscreen)) + if (!mainGraphics->setFullscreen(fullscreen)) { fullscreen = !fullscreen; - if (!graphics->setFullscreen(fullscreen)) + if (!mainGraphics->setFullscreen(fullscreen)) { std::stringstream errorMessage; if (fullscreen) @@ -564,11 +564,11 @@ void Setup_Video::cancel() config.setValue("screen", mFullScreenEnabled); // Set back to the current video mode. - std::string videoMode = toString(graphics->mWidth) + "x" - + toString(graphics->mHeight); + std::string videoMode = toString(mainGraphics->mWidth) + "x" + + toString(mainGraphics->mHeight); mModeList->setSelected(mModeListModel->getIndexOf(videoMode)); - config.setValue("screenwidth", graphics->mWidth); - config.setValue("screenheight", graphics->mHeight); + config.setValue("screenwidth", mainGraphics->mWidth); + config.setValue("screenheight", mainGraphics->mHeight); config.setValue("customcursor", mCustomCursorEnabled); config.setValue("particleeffects", mParticleEffectsEnabled); @@ -612,9 +612,9 @@ void Setup_Video::action(const gcn::ActionEvent &event) return; // TODO: Find out why the drawing area doesn't resize without a restart. - if (width != graphics->mWidth || height != graphics->mHeight) + if (width != mainGraphics->mWidth || height != mainGraphics->mHeight) { - if (width < graphics->mWidth || height < graphics->mHeight) + if (width < mainGraphics->mWidth || height < mainGraphics->mHeight) new OkDialog(_("Screen Resolution Changed"), _("Restart your client for the change to take effect.") + std::string("\n") + @@ -625,8 +625,8 @@ void Setup_Video::action(const gcn::ActionEvent &event) } config.setValue("oldscreen", config.getBoolValue("screen")); - config.setValue("oldscreenwidth", graphics->mWidth); - config.setValue("oldscreenheight", graphics->mHeight); + config.setValue("oldscreenwidth", mainGraphics->mWidth); + config.setValue("oldscreenheight", mainGraphics->mHeight); config.setValue("screenwidth", width); config.setValue("screenheight", height); } diff --git a/src/gui/spellpopup.cpp b/src/gui/spellpopup.cpp index a918e037d..f87e691de 100644 --- a/src/gui/spellpopup.cpp +++ b/src/gui/spellpopup.cpp @@ -80,14 +80,14 @@ void SpellPopup::view(int x, int y) int posX = std::max(0, x - getWidth() / 2); int posY = y + distance; - if (posX + getWidth() > graphics->mWidth) + if (posX + getWidth() > mainGraphics->mWidth) { - if (graphics->mWidth > getWidth()) - posX = graphics->mWidth - getWidth(); + if (mainGraphics->mWidth > getWidth()) + posX = mainGraphics->mWidth - getWidth(); else posX = 0; } - if (posY + getHeight() > graphics->mHeight) + if (posY + getHeight() > mainGraphics->mHeight) { if (y > getHeight() + distance) posY = y - getHeight() - distance; diff --git a/src/gui/statuspopup.cpp b/src/gui/statuspopup.cpp index bb7a295ab..9214f1406 100644 --- a/src/gui/statuspopup.cpp +++ b/src/gui/statuspopup.cpp @@ -169,9 +169,9 @@ void StatusPopup::view(int x, int y) int posX = std::max(0, x - getWidth() / 2); int posY = y + distance; - if (posX + getWidth() > graphics->mWidth) - posX = graphics->mWidth - getWidth(); - if (posY + getHeight() > graphics->mHeight) + if (posX + getWidth() > mainGraphics->mWidth) + posX = mainGraphics->mWidth - getWidth(); + if (posY + getHeight() > mainGraphics->mHeight) posY = y - getHeight() - distance; update(); diff --git a/src/gui/textpopup.cpp b/src/gui/textpopup.cpp index 1ff601154..65c712461 100644 --- a/src/gui/textpopup.cpp +++ b/src/gui/textpopup.cpp @@ -96,9 +96,9 @@ void TextPopup::show(int x, int y, const std::string &str1, int posX = std::max(0, x - getWidth() / 2); int posY = y + distance; - if (posX + getWidth() > graphics->mWidth) - posX = graphics->mWidth - getWidth(); - if (posY + getHeight() > graphics->mHeight) + if (posX + getWidth() > mainGraphics->mWidth) + posX = mainGraphics->mWidth - getWidth(); + if (posY + getHeight() > mainGraphics->mHeight) posY = y - getHeight() - distance; setPosition(posX, posY); diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index d4764cba5..29fca7662 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -373,7 +373,7 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) default: { Map *map = viewport->getMap(); - Avatar *ava = model->getAvatarAt(selected); + ava = model->getAvatarAt(selected); if (map && ava) { MapItem *mapItem = map->findPortalXY( @@ -384,7 +384,6 @@ void AvatarListBox::mousePressed(gcn::MouseEvent &event) } } } - else if (event.getButton() == gcn::MouseEvent::MIDDLE) { if (ava->getType() == AVATAR_PLAYER && chatWindow) diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index 65a25363d..c20eb4622 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -210,23 +210,23 @@ void BrowserBox::addRow(const std::string &row, bool atTop) for (TextRowIterator i = mTextRows.begin(); i != mTextRows.end(); ++i) { - std::string row = *i; - for (unsigned int j = 0; j < row.size(); j++) + std::string tempRow = *i; + for (unsigned int j = 0; j < tempRow.size(); j++) { - std::string character = row.substr(j, 1); + std::string character = tempRow.substr(j, 1); x += font->getWidth(character); nextChar = j + 1; // Wraping between words (at blank spaces) - if ((nextChar < row.size()) && (row.at(nextChar) == ' ')) + if (nextChar < tempRow.size() && tempRow.at(nextChar) == ' ') { int nextSpacePos = static_cast<int>( - row.find(" ", (nextChar + 1))); + tempRow.find(" ", (nextChar + 1))); if (nextSpacePos <= 0) - nextSpacePos = static_cast<int>(row.size()) - 1; + nextSpacePos = static_cast<int>(tempRow.size()) - 1; unsigned nextWordWidth = font->getWidth( - row.substr(nextChar, + tempRow.substr(nextChar, (nextSpacePos - nextChar))); if ((x + nextWordWidth + 10) > (unsigned)getWidth()) diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 38088770b..ebfdbe303 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -44,8 +44,8 @@ Popup::Popup(const std::string &name, const std::string &skin): mPopupName(name), mMinWidth(100), mMinHeight(40), - mMaxWidth(graphics->mWidth), - mMaxHeight(graphics->mHeight), + mMaxWidth(mainGraphics->mWidth), + mMaxHeight(mainGraphics->mHeight), mVertexes(new GraphicsVertexes()), mRedraw(true) { @@ -190,9 +190,9 @@ void Popup::position(int x, int y) int posX = std::max(0, x - getWidth() / 2); int posY = y + distance; - if (posX + getWidth() > graphics->mWidth) - posX = graphics->mWidth - getWidth(); - if (posY + getHeight() > graphics->mHeight) + if (posX + getWidth() > mainGraphics->mWidth) + posX = mainGraphics->mWidth - getWidth(); + if (posY + getHeight() > mainGraphics->mHeight) posY = y - getHeight() - distance; setPosition(posX, posY); diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h index 52a26ddac..36ed96bd2 100644 --- a/src/gui/widgets/progressbar.h +++ b/src/gui/widgets/progressbar.h @@ -94,8 +94,8 @@ class ProgressBar : public gcn::Widget, public gcn::WidgetListener /** * Sets the text shown on the progress bar. */ - void setText(const std::string &text) - { mText = text; } + void setText(const std::string &str) + { mText = str; } /** * Returns the text shown on the progress bar. diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 9709f4c8a..05509ab39 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -63,8 +63,8 @@ Window::Window(const std::string &caption, bool modal, Window *parent, mStickyButtonLock(false), mMinWinWidth(100), mMinWinHeight(40), - mMaxWinWidth(graphics->mWidth), - mMaxWinHeight(graphics->mHeight), + mMaxWinWidth(mainGraphics->mWidth), + mMaxWinHeight(mainGraphics->mHeight), mVertexes(new GraphicsVertexes()), mRedraw(true) { @@ -244,39 +244,39 @@ void Window::setLocationRelativeTo(ImageRect::ImagePosition position, } else if (position == ImageRect::UPPER_CENTER) { - offsetX += (graphics->mWidth - getWidth()) / 2; + offsetX += (mainGraphics->mWidth - getWidth()) / 2; } else if (position == ImageRect::UPPER_RIGHT) { - offsetX += graphics->mWidth - getWidth(); + offsetX += mainGraphics->mWidth - getWidth(); } else if (position == ImageRect::LEFT) { - offsetY += (graphics->mHeight - getHeight()) / 2; + offsetY += (mainGraphics->mHeight - getHeight()) / 2; } else if (position == ImageRect::CENTER) { - offsetX += (graphics->mWidth - getWidth()) / 2; - offsetY += (graphics->mHeight - getHeight()) / 2; + offsetX += (mainGraphics->mWidth - getWidth()) / 2; + offsetY += (mainGraphics->mHeight - getHeight()) / 2; } else if (position == ImageRect::RIGHT) { - offsetX += graphics->mWidth - getWidth(); - offsetY += (graphics->mHeight - getHeight()) / 2; + offsetX += mainGraphics->mWidth - getWidth(); + offsetY += (mainGraphics->mHeight - getHeight()) / 2; } else if (position == ImageRect::LOWER_LEFT) { - offsetY += graphics->mHeight - getHeight(); + offsetY += mainGraphics->mHeight - getHeight(); } else if (position == ImageRect::LOWER_CENTER) { - offsetX += (graphics->mWidth - getWidth()) / 2; - offsetY += graphics->mHeight - getHeight(); + offsetX += (mainGraphics->mWidth - getWidth()) / 2; + offsetY += mainGraphics->mHeight - getHeight(); } else if (position == ImageRect::LOWER_RIGHT) { - offsetX += graphics->mWidth - getWidth(); - offsetY += graphics->mHeight - getHeight(); + offsetX += mainGraphics->mWidth - getWidth(); + offsetY += mainGraphics->mHeight - getHeight(); } setPosition(offsetX, offsetY); @@ -579,8 +579,8 @@ void Window::mouseDragged(gcn::MouseEvent &event) { int newX = std::max(0, getX()); int newY = std::max(0, getY()); - newX = std::min(graphics->mWidth - getWidth(), newX); - newY = std::min(graphics->mHeight - getHeight(), newY); + newX = std::min(mainGraphics->mWidth - getWidth(), newX); + newY = std::min(mainGraphics->mHeight - getHeight(), newY); setPosition(newX, newY); } @@ -621,14 +621,10 @@ void Window::mouseDragged(gcn::MouseEvent &event) newDim.height += newDim.y; newDim.y = 0; } - if (newDim.x + newDim.width > graphics->mWidth) - { - newDim.width = graphics->mWidth - newDim.x; - } - if (newDim.y + newDim.height > graphics->mHeight) - { - newDim.height = graphics->mHeight - newDim.y; - } + if (newDim.x + newDim.width > mainGraphics->mWidth) + newDim.width = mainGraphics->mWidth - newDim.x; + if (newDim.y + newDim.height > mainGraphics->mHeight) + newDim.height = mainGraphics->mHeight - newDim.y; // Update mouse offset when dragging bottom or right border if (mouseResize & BOTTOM) @@ -790,39 +786,39 @@ void Window::setDefaultSize(int defaultWidth, int defaultHeight, } else if (position == ImageRect::UPPER_CENTER) { - x = (graphics->mWidth - defaultWidth) / 2; + x = (mainGraphics->mWidth - defaultWidth) / 2; } else if (position == ImageRect::UPPER_RIGHT) { - x = graphics->mWidth - defaultWidth; + x = mainGraphics->mWidth - defaultWidth; } else if (position == ImageRect::LEFT) { - y = (graphics->mHeight - defaultHeight) / 2; + y = (mainGraphics->mHeight - defaultHeight) / 2; } else if (position == ImageRect::CENTER) { - x = (graphics->mWidth - defaultWidth) / 2; - y = (graphics->mHeight - defaultHeight) / 2; + x = (mainGraphics->mWidth - defaultWidth) / 2; + y = (mainGraphics->mHeight - defaultHeight) / 2; } else if (position == ImageRect::RIGHT) { - x = graphics->mWidth - defaultWidth; - y = (graphics->mHeight - defaultHeight) / 2; + x = mainGraphics->mWidth - defaultWidth; + y = (mainGraphics->mHeight - defaultHeight) / 2; } else if (position == ImageRect::LOWER_LEFT) { - y = graphics->mHeight - defaultHeight; + y = mainGraphics->mHeight - defaultHeight; } else if (position == ImageRect::LOWER_CENTER) { - x = (graphics->mWidth - defaultWidth) / 2; - y = graphics->mHeight - defaultHeight; + x = (mainGraphics->mWidth - defaultWidth) / 2; + y = mainGraphics->mHeight - defaultHeight; } else if (position == ImageRect::LOWER_RIGHT) { - x = graphics->mWidth - defaultWidth; - y = graphics->mHeight - defaultHeight; + x = mainGraphics->mWidth - defaultWidth; + y = mainGraphics->mHeight - defaultHeight; } mDefaultX = x - offsetX; @@ -994,11 +990,11 @@ void Window::checkIfIsOffScreen(bool partially, bool entirely) // Look if the window is partially off-screen limits... if (partially) { - if (winDimension.x + winDimension.width > graphics->mWidth) - winDimension.x = graphics->mWidth - winDimension.width; + if (winDimension.x + winDimension.width > mainGraphics->mWidth) + winDimension.x = mainGraphics->mWidth - winDimension.width; - if (winDimension.y + winDimension.height > graphics->mHeight) - winDimension.y = graphics->mHeight - winDimension.height; + if (winDimension.y + winDimension.height > mainGraphics->mHeight) + winDimension.y = mainGraphics->mHeight - winDimension.height; setDimension(winDimension); return; @@ -1006,11 +1002,11 @@ void Window::checkIfIsOffScreen(bool partially, bool entirely) if (entirely) { - if (winDimension.x > graphics->mWidth) - winDimension.x = graphics->mWidth - winDimension.width; + if (winDimension.x > mainGraphics->mWidth) + winDimension.x = mainGraphics->mWidth - winDimension.width; - if (winDimension.y > graphics->mHeight) - winDimension.y = graphics->mHeight - winDimension.height; + if (winDimension.y > mainGraphics->mHeight) + winDimension.y = mainGraphics->mHeight - winDimension.height; } setDimension(winDimension); } diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index 8431cece1..eaec791ee 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -99,9 +99,9 @@ WindowMenu::WindowMenu(): KeyboardConfig::KEY_WINDOW_DIDYOUKNOW); addButton(N_("SET"), _("Setup"), x, h, KeyboardConfig::KEY_WINDOW_SETUP); - if (graphics) + if (mainGraphics) { - setDimension(gcn::Rectangle(graphics->mWidth - x - 3, + setDimension(gcn::Rectangle(mainGraphics->mWidth - x - 3, 3, x - 3, h)); } @@ -345,9 +345,9 @@ void WindowMenu::updateButtons() h = btn->getHeight(); } } - if (graphics) + if (mainGraphics) { - setDimension(gcn::Rectangle(graphics->mWidth - x - 3, + setDimension(gcn::Rectangle(mainGraphics->mWidth - x - 3, 3, x - 3, h)); } } |