diff options
| author | Andrei Karas <akaras@inbox.ru> | 2014-01-04 21:57:32 +0300 |
|---|---|---|
| committer | Andrei Karas <akaras@inbox.ru> | 2014-01-04 21:57:32 +0300 |
| commit | 8a5603e487f682f5f67bc2cedae81249aa138f5b (patch) | |
| tree | 697535ca4d8e50ee6da8cf364cad814fa5f7603a /src | |
| parent | 80f7177ea4ce0185e1ef3355e91dcf14617d0f09 (diff) | |
| parent | f2d1d2b43a0ebdb625aea94cb4b8ff7fce6bf8f4 (diff) | |
| download | plus-8a5603e487f682f5f67bc2cedae81249aa138f5b.tar.gz plus-8a5603e487f682f5f67bc2cedae81249aa138f5b.tar.bz2 plus-8a5603e487f682f5f67bc2cedae81249aa138f5b.tar.xz plus-8a5603e487f682f5f67bc2cedae81249aa138f5b.zip | |
Merge branch 'master' into stable
Diffstat (limited to 'src')
872 files changed, 4377 insertions, 2763 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e2e019117..65f5a0f44 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -422,6 +422,7 @@ SET(SRCS net/net.h net/netconsts.h net/partyhandler.h + net/pethandler.h net/playerhandler.h net/sdltcpnet.cpp net/sdltcpnet.h @@ -695,8 +696,11 @@ SET(SRCS notifications.h notifymanager.cpp notifymanager.h + render/graphics_calcImageRect.hpp + render/graphics_drawImageRect.hpp render/nullopenglgraphics.cpp render/nullopenglgraphics.h + render/openglgraphicsdef.hpp render/renderers.cpp render/renderers.h render/rendererslistsdl.h @@ -917,6 +921,8 @@ SET(SRCS_TMWA net/tmwa/npchandler.h net/tmwa/partyhandler.cpp net/tmwa/partyhandler.h + net/tmwa/pethandler.cpp + net/tmwa/pethandler.h net/tmwa/playerhandler.cpp net/tmwa/playerhandler.h net/tmwa/protocol.h diff --git a/src/Makefile.am b/src/Makefile.am index 267fda7b3..c7ee06128 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -559,6 +559,7 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ net/netconsts.h \ net/npchandler.h \ net/partyhandler.h \ + net/pethandler.h \ net/playerhandler.h \ net/sdltcpnet.cpp \ net/sdltcpnet.h \ @@ -832,8 +833,11 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \ notifications.h \ notifymanager.cpp \ notifymanager.h \ + render/graphics_calcImageRect.hpp \ + render/graphics_drawImageRect.hpp \ render/nullopenglgraphics.cpp \ render/nullopenglgraphics.h \ + render/openglgraphicsdef.hpp \ render/renderers.cpp \ render/renderers.h \ render/rendererslistsdl.h \ @@ -975,6 +979,8 @@ manaplus_SOURCES += \ net/tmwa/npchandler.h \ net/tmwa/partyhandler.cpp \ net/tmwa/partyhandler.h \ + net/tmwa/pethandler.cpp \ + net/tmwa/pethandler.h \ net/tmwa/playerhandler.cpp \ net/tmwa/playerhandler.h \ net/tmwa/protocol.h \ diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index 7d3b653a8..9152dfe7a 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/actionmanager.h b/src/actionmanager.h index 2088eddf7..a2df14202 100644 --- a/src/actionmanager.h +++ b/src/actionmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/actormanager.cpp b/src/actormanager.cpp index d7a272284..f55875351 100644 --- a/src/actormanager.cpp +++ b/src/actormanager.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -792,8 +792,9 @@ void ActorManager::logic() FOR_EACH (ActorSpritesConstIterator, it, mDeleteActors) { - mActors.erase(*it); - delete *it; + ActorSprite *actor = *it; + mActors.erase(actor); + delete actor; } mDeleteActors.clear(); diff --git a/src/actormanager.h b/src/actormanager.h index 83971b60c..9ccd5eaa6 100644 --- a/src/actormanager.h +++ b/src/actormanager.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index 0d3755617..93f8c6009 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -294,7 +294,7 @@ void AnimatedSprite::draw(Graphics *const graphics, if (image->getAlpha() != mAlpha) image->setAlpha(mAlpha); - DRAW_IMAGE(graphics, image, + graphics->drawImage2(image, posX + mFrame->offsetX, posY + mFrame->offsetY); } diff --git a/src/animatedsprite.h b/src/animatedsprite.h index 45af4eea2..4bef6face 100644 --- a/src/animatedsprite.h +++ b/src/animatedsprite.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/animationdelayload.cpp b/src/animationdelayload.cpp index 01663cbc6..b5b2989c0 100644 --- a/src/animationdelayload.cpp +++ b/src/animationdelayload.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/animationdelayload.h b/src/animationdelayload.h index 9a12a527f..1fd4731ef 100644 --- a/src/animationdelayload.h +++ b/src/animationdelayload.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/auctionmanager.cpp b/src/auctionmanager.cpp index 0fd3441d5..1ce20a733 100644 --- a/src/auctionmanager.cpp +++ b/src/auctionmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/auctionmanager.h b/src/auctionmanager.h index 682903317..6814d4c51 100644 --- a/src/auctionmanager.h +++ b/src/auctionmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/avatar.cpp b/src/avatar.cpp index f05e715ad..4c936ba7f 100644 --- a/src/avatar.cpp +++ b/src/avatar.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/avatar.h b/src/avatar.h index daabdd44a..9804b318e 100644 --- a/src/avatar.h +++ b/src/avatar.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/actor.cpp b/src/being/actor.cpp index 62ab4fc83..1416b5481 100644 --- a/src/being/actor.cpp +++ b/src/being/actor.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/actor.h b/src/being/actor.h index 5f508dfa6..c29986bee 100644 --- a/src/being/actor.h +++ b/src/being/actor.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/actorsprite.cpp b/src/being/actorsprite.cpp index 8f80f21a7..1426e481e 100644 --- a/src/being/actorsprite.cpp +++ b/src/being/actorsprite.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/actorsprite.h b/src/being/actorsprite.h index 709e1f27b..f9876fa79 100644 --- a/src/being/actorsprite.h +++ b/src/being/actorsprite.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/actorspritelistener.h b/src/being/actorspritelistener.h index 3d5a48443..c89495c85 100644 --- a/src/being/actorspritelistener.h +++ b/src/being/actorspritelistener.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/being.cpp b/src/being/being.cpp index ba2108402..e155dc886 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -51,6 +51,7 @@ #include "net/gamehandler.h" #include "net/net.h" #include "net/npchandler.h" +#include "net/pethandler.h" #include "net/playerhandler.h" #include "resources/iteminfo.h" @@ -243,7 +244,12 @@ Being::~Being() if (mOwner) mOwner->setPet(nullptr); if (mPet) + { mPet->setOwner(nullptr); + actorManager->erase(mPet); + delete mPet; + mPet = nullptr; + } removeAllItemsParticles(); } @@ -290,8 +296,19 @@ void Being::setSubtype(const uint16_t subtype, const uint8_t look) mInfo = PETDB::get(mId); if (mInfo) { + setName(mInfo->getName()); setupSpriteDisplay(mInfo->getDisplay(), false); mYDiff = mInfo->getSortOffsetY(); + const int speed = mInfo->getWalkSpeed(); + if (!speed) + { + setWalkSpeed(Net::getPlayerHandler() + ->getDefaultWalkSpeed()); + } + else + { + setWalkSpeed(Vector(speed, speed, 0)); + } } } else if (mType == PLAYER) @@ -1592,6 +1609,9 @@ void Being::logic() actorManager->destroy(this); } + if (mPet) + mPet->petLogic(); + const SoundInfo *const sound = mNextSound.sound; if (sound) { @@ -1608,6 +1628,149 @@ void Being::logic() BLOCK_END("Being::logic") } +void Being::petLogic() +{ + if (!mOwner || !mMap || !mInfo) + return; + + const int time = tick_time; + const int thinkTime = mInfo->getThinkTime(); + if (abs(mMoveTime - time) < thinkTime) + return; + + mMoveTime = time; + + const int dstX0 = mOwner->getTileX(); + const int dstY0 = mOwner->getTileY(); + int dstX = dstX0; + int dstY = dstY0; + const int followDist = mInfo->getStartFollowDist(); + const int warpDist = mInfo->getWarpDist(); + const int dist = mInfo->getFollowDist(); + const int divX = abs(dstX - mX); + const int divY = abs(dstY - mY); + + if (divX >= warpDist || divY >= warpDist) + { + setAction(Being::STAND, 0); + fixPetSpawnPos(dstX, dstY); + setTileCoords(dstX, dstY); + Net::getPetHandler()->spawn(mOwner, dstX, dstY); + } + else if (divX > followDist || divY > followDist) + { + if (!dist) + { + fixPetSpawnPos(dstX, dstY); + } + else + { + if (divX > followDist) + { + if (dstX > mX + dist) + dstX -= dist; + else if (dstX + dist <= mX) + dstX += dist; + } + else + { + dstX = mX; + } + if (divY > followDist) + { + if (dstY > mY + dist) + dstY -= dist; + else if (dstX + dist <= mX) + dstY += dist; + } + else + { + dstY = mY; + } + } + + const int walkMask = getWalkMask(); + if (!mMap->getWalk(dstX, dstY, walkMask)) + { + if (dstX != dstX0) + { + dstX = dstX0; + if (!mMap->getWalk(dstX, dstY, walkMask)) + dstY = dstY0; + } + else if (dstY != dstY0) + { + dstY = dstY0; + if (!mMap->getWalk(dstX, dstY, walkMask)) + dstX = dstX0; + } + } + if (mX != dstX || mY != dstY) + { + setPath(mMap->findPath(mX, mY, dstX, dstY, walkMask)); + Net::getPetHandler()->move(mOwner, mX, mY, dstX, dstY); + return; + } + } + if (mAction == STAND) + { + int directionType = 0; + switch (mOwner->getCurrentAction()) + { + case STAND: + case MOVE: + case ATTACK: + case HURT: + case SPAWN: + default: + directionType = mInfo->getDirectionType(); + break; + case SIT: + directionType = mInfo->getSitDirectionType(); + break; + case DEAD: + directionType = mInfo->getDeadDirectionType(); + break; + } + + int newDir = 0; + switch (directionType) + { + case 0: + default: + return; + + case 1: + newDir = mOwner->getDirection(); + break; + + case 2: + if (dstX > dstX0) + newDir |= LEFT; + else if (dstX < dstX0) + newDir |= RIGHT; + if (dstY > dstY0) + newDir |= UP; + else if (dstY < dstY0) + newDir |= DOWN; + break; + + case 3: + if (dstX > dstX0) + newDir |= RIGHT; + else if (dstX < dstX0) + newDir |= LEFT; + if (dstY > dstY0) + newDir |= DOWN; + else if (dstY < dstY0) + newDir |= UP; + break; + } + if (newDir && newDir != getDirection()) + setDirection(newDir); + } +} + void Being::drawEmotion(Graphics *const graphics, const int offsetX, const int offsetY) const { @@ -1643,6 +1806,7 @@ void Being::drawSpeech(const int offsetX, const int offsetY) mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() / 2), py - getHeight() - (mSpeechBubble->getHeight())); mSpeechBubble->setVisible(true); + mSpeechBubble->requestMoveToBackground(); } else if (mSpeechTime > 0 && speech == TEXT_OVERHEAD) { @@ -2843,7 +3007,6 @@ std::string Being::loadComment(const std::string &name, const int type) } str.append(stringToHexPath(name)).append("/comment.txt"); - logger->log("load from: %s", str.c_str()); const ResourceManager *const resman = ResourceManager::getInstance(); if (resman->existsLocal(str)) @@ -3041,7 +3204,7 @@ void Being::addEffect(const std::string &name) void Being::addPet(const int id) { - if (!actorManager) + if (!actorManager || !config.getBoolValue("usepets")) return; removePet(); @@ -3049,10 +3212,14 @@ void Being::addPet(const int id) id, ActorSprite::PET, 0); if (being) { - being->setTileCoords(getTileX(), getTileY()); being->setOwner(this); mPetId = id; mPet = being; + int dstX = mX; + int dstY = mY; + being->fixPetSpawnPos(dstX, dstY); + being->setTileCoords(dstX, dstY); + Net::getPetHandler()->spawn(this, dstX, dstY); } } @@ -3065,7 +3232,8 @@ void Being::removePet() if (mPet) { mPet->setOwner(nullptr); - actorManager->destroy(mPet); + actorManager->erase(mPet); + delete mPet; mPet = nullptr; } } @@ -3088,6 +3256,72 @@ void Being::updatePets() } } +void Being::fixPetSpawnPos(int &dstX, int &dstY) const +{ + if (!mInfo || !mOwner) + return; + + int offsetX1; + int offsetY1; + switch (mOwner->getCurrentAction()) + { + case SIT: + offsetX1 = mInfo->getSitOffsetX(); + offsetY1 = mInfo->getSitOffsetY(); + break; + + case MOVE: + offsetX1 = mInfo->getMoveOffsetX(); + offsetY1 = mInfo->getMoveOffsetY(); + break; + + case DEAD: + offsetX1 = mInfo->getDeadOffsetX(); + offsetY1 = mInfo->getDeadOffsetY(); + break; + + case ATTACK: + case SPAWN: + case HURT: + case STAND: + default: + offsetX1 = mInfo->getTargetOffsetX(); + offsetY1 = mInfo->getTargetOffsetY(); + break; + } + + int offsetX = offsetX1; + int offsetY = offsetY1; + switch (mOwner->getDirection()) + { + case LEFT: + offsetX = -offsetY1; + offsetY = offsetX1; + break; + case RIGHT: + offsetX = offsetY1; + offsetY = -offsetX1; + break; + case UP: + offsetY = -offsetY; + offsetX = -offsetX; + break; + default: + case DOWN: + break; + } + dstX += offsetX; + dstY += offsetY; + if (mMap) + { + if (!mMap->getWalk(dstX, dstY, getWalkMask())) + { + dstX = mOwner->getTileX(); + dstY = mOwner->getTileY(); + } + } +} + void Being::playSfx(const SoundInfo &sound, Being *const being, const bool main, const int x, const int y) const { diff --git a/src/being/being.h b/src/being/being.h index 08ac81e9e..634c26d23 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -412,6 +412,8 @@ class Being : public ActorSprite, public ConfigListener */ virtual void logic() override; + void petLogic(); + /** * Draws the speech text above the being. */ @@ -476,7 +478,7 @@ class Being : public ActorSprite, public ConfigListener * in pixels per second for eAthena, * in tiles per second for Manaserv. */ - void setWalkSpeed(const Vector &speed) + void setWalkSpeed(Vector speed) { mWalkSpeed = speed; mSpeed = speed.x; } /** @@ -879,6 +881,8 @@ class Being : public ActorSprite, public ConfigListener void updatePets(); + void fixPetSpawnPos(int &dstX, int &dstY) const; + Being *getPet() { return mPet; } diff --git a/src/being/beingcacheentry.h b/src/being/beingcacheentry.h index 2890d44a6..af60a9090 100644 --- a/src/being/beingcacheentry.h +++ b/src/being/beingcacheentry.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index ef489c166..27e48caa7 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -123,12 +123,12 @@ void CompoundSprite::draw(Graphics *const graphics, if (mAlpha == 1.0F && mImage) { - DRAW_IMAGE(graphics, mImage, posX + mOffsetX, posY + mOffsetY); + graphics->drawImage2(mImage, posX + mOffsetX, posY + mOffsetY); } else if (mAlpha && mAlphaImage) { mAlphaImage->setAlpha(mAlpha); - DRAW_IMAGE(graphics, mAlphaImage, + graphics->drawImage2(mAlphaImage, posX + mOffsetX, posY + mOffsetY); } else diff --git a/src/being/compoundsprite.h b/src/being/compoundsprite.h index 0ac2c90fc..20f5a376a 100644 --- a/src/being/compoundsprite.h +++ b/src/being/compoundsprite.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index e32b2d818..41688cbf3 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/localplayer.h b/src/being/localplayer.h index 95194a781..0e6ebe8a4 100644 --- a/src/being/localplayer.h +++ b/src/being/localplayer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp index a59acce38..c9b10b4a6 100644 --- a/src/being/playerinfo.cpp +++ b/src/being/playerinfo.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h index bd4bff1b1..6437017b5 100644 --- a/src/being/playerinfo.h +++ b/src/being/playerinfo.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/playerrelations.cpp b/src/being/playerrelations.cpp index db9d46314..f3e921be3 100644 --- a/src/being/playerrelations.cpp +++ b/src/being/playerrelations.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/being/playerrelations.h b/src/being/playerrelations.h index 830991924..f37e33d89 100644 --- a/src/being/playerrelations.h +++ b/src/being/playerrelations.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/beingequipbackend.cpp b/src/beingequipbackend.cpp index 9e0516610..03d882665 100644 --- a/src/beingequipbackend.cpp +++ b/src/beingequipbackend.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/beingequipbackend.h b/src/beingequipbackend.h index 09bd9fe14..cf11b7b2f 100644 --- a/src/beingequipbackend.h +++ b/src/beingequipbackend.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/chatlogger.cpp b/src/chatlogger.cpp index 2f3bc457b..c3da6e0b1 100644 --- a/src/chatlogger.cpp +++ b/src/chatlogger.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/chatlogger.h b/src/chatlogger.h index 9eff21094..c95cea7fe 100644 --- a/src/chatlogger.h +++ b/src/chatlogger.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * Copyright (C) 2009-2010 Andrei Karas * * This file is part of The ManaPlus Client. diff --git a/src/client.cpp b/src/client.cpp index b16ad2a22..43c474dab 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -110,6 +110,7 @@ #include "utils/files.h" #include "utils/fuzzer.h" #include "utils/gettext.h" +#include "utils/files.h" #include "utils/mkdir.h" #include "utils/paths.h" #include "utils/physfstools.h" @@ -297,6 +298,7 @@ void Client::gameInit() #ifdef USE_FUZZER Fuzzer::init(); #endif + backupConfig(); initConfiguration(); paths.setDefaultValues(getPathsDefaults()); initFeatures(); @@ -354,6 +356,10 @@ void Client::gameInit() SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE); SDL_EventState(SDL_USEREVENT, SDL_IGNORE); +#ifdef WIN32 + setIcon(); +#endif + initGraphics(); extractDataDir(); mountDataDir(); @@ -584,7 +590,9 @@ void Client::initTitle() } SDL::SetWindowTitle(mainGraphics->getWindow(), mCaption.c_str()); +#ifndef WIN32 setIcon(); +#endif } #ifdef ANDROID @@ -1292,11 +1300,11 @@ int Client::gameExec() case STATE_LOGIN_ATTEMPT: BLOCK_START("Client::gameExec STATE_LOGIN_ATTEMPT") logger->log1("State: LOGIN ATTEMPT"); - accountLogin(&loginData); mCurrentDialog = new ConnectionDialog( // TRANSLATORS: connection dialog header _("Logging in"), STATE_SWITCH_SERVER); mCurrentDialog->postInit(); + accountLogin(&loginData); BLOCK_END("Client::gameExec STATE_LOGIN_ATTEMPT") break; @@ -1457,12 +1465,12 @@ int Client::gameExec() case STATE_GET_CHARACTERS: BLOCK_START("Client::gameExec STATE_GET_CHARACTERS") logger->log1("State: GET CHARACTERS"); - Net::getCharServerHandler()->requestCharacters(); mCurrentDialog = new ConnectionDialog( // TRANSLATORS: connection dialog header _("Requesting characters"), STATE_SWITCH_SERVER); mCurrentDialog->postInit(); + Net::getCharServerHandler()->requestCharacters(); BLOCK_END("Client::gameExec STATE_GET_CHARACTERS") break; @@ -1497,27 +1505,25 @@ int Client::gameExec() case STATE_CONNECT_GAME: BLOCK_START("Client::gameExec STATE_CONNECT_GAME") logger->log1("State: CONNECT GAME"); - - Net::getGameHandler()->connect(); mCurrentDialog = new ConnectionDialog( // TRANSLATORS: connection dialog header _("Connecting to the game server"), Net::getNetworkType() != ServerInfo::MANASERV ? STATE_CHOOSE_SERVER : STATE_SWITCH_CHARACTER); mCurrentDialog->postInit(); + Net::getGameHandler()->connect(); BLOCK_END("Client::gameExec STATE_CONNECT_GAME") break; case STATE_CHANGE_MAP: BLOCK_START("Client::gameExec STATE_CHANGE_MAP") logger->log1("State: CHANGE_MAP"); - - Net::getGameHandler()->connect(); mCurrentDialog = new ConnectionDialog( // TRANSLATORS: connection dialog header _("Changing game servers"), STATE_SWITCH_CHARACTER); mCurrentDialog->postInit(); + Net::getGameHandler()->connect(); BLOCK_END("Client::gameExec STATE_CHANGE_MAP") break; @@ -1596,11 +1602,11 @@ int Client::gameExec() case STATE_REGISTER_PREP: BLOCK_START("Client::gameExec STATE_REGISTER_PREP") logger->log1("State: REGISTER_PREP"); - Net::getLoginHandler()->getRegistrationDetails(); mCurrentDialog = new ConnectionDialog( // TRANSLATORS: connection dialog header _("Requesting registration details"), STATE_LOGIN); mCurrentDialog->postInit(); + Net::getLoginHandler()->getRegistrationDetails(); BLOCK_END("Client::gameExec STATE_REGISTER_PREP") break; @@ -1705,6 +1711,7 @@ int Client::gameExec() Net::getGameHandler()->disconnect(); Net::getGameHandler()->clear(); mServerName.clear(); + serverConfig.write(); serverConfig.unload(); mState = STATE_CHOOSE_SERVER; @@ -2144,6 +2151,22 @@ void Client::initConfiguration() const } } +void Client::backupConfig() const +{ + const std::string confName = mConfigDir + "/config.xml.bak"; + const int maxFileIndex = 5; + ::remove((confName + toString(maxFileIndex)).c_str()); + for (int f = maxFileIndex; f > 1; f --) + { + const std::string fileName1 = confName + toString(f - 1); + const std::string fileName2 = confName + toString(f); + Files::renameFile(fileName1, fileName2); + } + const std::string fileName3 = mConfigDir + "/config.xml"; + const std::string fileName4 = confName + toString(1); + Files::copyFile(fileName3, fileName4); +} + /** * Parse the update host and determine the updates directory * Then verify that the directory exists (creating if needed). @@ -2948,6 +2971,8 @@ void Client::setIcon() // Attempt to load icon from .ico file HICON icon = (HICON) LoadImage(nullptr, iconFile.c_str(), IMAGE_ICON, 64, 64, LR_LOADFROMFILE); + if (!icon) + logger->log("icon load error"); // If it's failing, we load the default resource file. if (!icon) icon = LoadIcon(GetModuleHandle(nullptr), "A"); diff --git a/src/client.h b/src/client.h index dcf761847..b89996e26 100644 --- a/src/client.h +++ b/src/client.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -366,6 +366,8 @@ private: void storeSafeParameters() const; + void backupConfig() const; + void gameClear(); void testsClear(); diff --git a/src/commandhandler.cpp b/src/commandhandler.cpp index fe64b47bf..8409b8d58 100644 --- a/src/commandhandler.cpp +++ b/src/commandhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/commandhandler.h b/src/commandhandler.h index 725434ef7..02ced5630 100644 --- a/src/commandhandler.h +++ b/src/commandhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/commands.cpp b/src/commands.cpp index 75347a9aa..827eebe92 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -62,6 +62,7 @@ #include "net/guildhandler.h" #include "net/net.h" #include "net/partyhandler.h" +#include "net/pethandler.h" #include "net/tradehandler.h" #ifdef DEBUG_DUMP_LEAKS1 @@ -723,6 +724,11 @@ impHandler1(emote) player_node->emote(static_cast<uint8_t>(atoi(args.c_str()))); } +impHandler1(emotePet) +{ + Net::getPetHandler()->emote(static_cast<uint8_t>(atoi(args.c_str()))); +} + impHandler1(away) { if (player_node) @@ -1252,6 +1258,15 @@ impHandler1(talkRaw) Net::getChatHandler()->talkRaw(args); } +impHandler1(talkPet) +{ + // in future probably need add channel detection + if (player_node->getPet()) + Net::getChatHandler()->talkPet(args, GENERAL_CHANNEL); + else + Net::getChatHandler()->talk(args, GENERAL_CHANNEL); +} + impHandler0(testsdlfont) { #if defined USE_OPENGL && defined DEBUG_SDLFONT diff --git a/src/commands.h b/src/commands.h index 851789282..a31dfe292 100644 --- a/src/commands.h +++ b/src/commands.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -81,6 +81,7 @@ namespace Commands decHandler(ignoreAll); decHandler(outfit); decHandler(emote); + decHandler(emotePet); decHandler(away); decHandler(pseudoAway); decHandler(follow); @@ -127,6 +128,7 @@ namespace Commands decHandler(testParticle); decHandler(createItems); decHandler(talkRaw); + decHandler(talkPet); void replaceVars(std::string &str); } // namespace Commands @@ -169,6 +171,7 @@ enum COMMAND_ATKHUMAN, COMMAND_OUTFIT, COMMAND_EMOTE, + COMMAND_EMOTEPET, COMMAND_AWAY, COMMAND_PSEUDOAWAY, COMMAND_FOLLOW, @@ -221,6 +224,7 @@ enum COMMAND_TEST_PARTICLE, COMMAND_CREATEITEMS, COMMAND_TALKRAW, + COMMAND_TALKPET, COMMAND_HACK, END_COMMANDS }; @@ -263,6 +267,7 @@ static const CommandInfo commands[] = {"atkhuman", &Commands::attackHuman, -1, true}, {"outfit", &Commands::outfit, -1, true}, {"emote", &Commands::emote, -1, true}, + {"emotepet", &Commands::emotePet, -1, true}, {"away", &Commands::away, -1, true}, {"pseudoaway", &Commands::pseudoAway, -1, true}, {"follow", &Commands::follow, -1, true}, @@ -315,6 +320,7 @@ static const CommandInfo commands[] = {"testparticle", &Commands::testParticle, -1, true}, {"createitems", &Commands::createItems, -1, false}, {"talkraw", &Commands::talkRaw, -1, true}, + {"talkpet", &Commands::talkPet, -1, true}, {"hack", &Commands::hack, -1, true} }; diff --git a/src/configlistener.h b/src/configlistener.h index 47d4897b0..3de898692 100644 --- a/src/configlistener.h +++ b/src/configlistener.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/configuration.cpp b/src/configuration.cpp index 55ad392f3..cb7adf8f1 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -801,6 +801,9 @@ void ConfigurationObject::writeToXML(const XmlTextWriterPtr writer) void Configuration::write() { + if (mConfigPath.empty()) + return; + // Do not attempt to write to file that cannot be opened for writing FILE *const testFile = fopen(mConfigPath.c_str(), "w"); if (!testFile) diff --git a/src/configuration.h b/src/configuration.h index 774678b50..71f59d2fd 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/debug.h b/src/debug.h index bd304c4bd..d803a6d74 100644 --- a/src/debug.h +++ b/src/debug.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/debug/debug_new.cpp b/src/debug/debug_new.cpp index 572a96e08..4c133c1ac 100644 --- a/src/debug/debug_new.cpp +++ b/src/debug/debug_new.cpp @@ -26,7 +26,7 @@ * * original version changed for ManaPlus * - * Copyright (C) 2011-2013 ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers */ /** diff --git a/src/debug/debug_new.h b/src/debug/debug_new.h index 00861f0bf..c3f833d28 100644 --- a/src/debug/debug_new.h +++ b/src/debug/debug_new.h @@ -26,7 +26,7 @@ * * original version changed for ManaPlus * - * Copyright (C) 2011-2013 ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers */ /** diff --git a/src/debug/fast_mutex.h b/src/debug/fast_mutex.h index d54f2e353..5c6471fae 100644 --- a/src/debug/fast_mutex.h +++ b/src/debug/fast_mutex.h @@ -26,7 +26,7 @@ * * original version changed for ManaPlus * - * Copyright (C) 2011-2013 ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers */ /** diff --git a/src/debug/static_assert.h b/src/debug/static_assert.h index 5d5a148e7..e7f03d689 100644 --- a/src/debug/static_assert.h +++ b/src/debug/static_assert.h @@ -26,7 +26,7 @@ * * original version changed for ManaPlus * - * Copyright (C) 2011-2013 ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers */ /** diff --git a/src/defaults.cpp b/src/defaults.cpp index 360e6e469..8aa64fcec 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -354,6 +354,7 @@ DefaultsData* getConfigDefaults() AddDEF("buySortOrder", 0); AddDEF("showmotd", false); AddDEF("playMapAnimations", true); + AddDEF("usepets", true); return configData; } diff --git a/src/defaults.h b/src/defaults.h index 73d0a703a..e4ba4d5ae 100644 --- a/src/defaults.h +++ b/src/defaults.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/depricatedevent.cpp b/src/depricatedevent.cpp index b303db4dd..8d021e2f3 100644 --- a/src/depricatedevent.cpp +++ b/src/depricatedevent.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/depricatedevent.h b/src/depricatedevent.h index 3b2f1e50a..2ade91bd7 100644 --- a/src/depricatedevent.h +++ b/src/depricatedevent.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/depricatedlistener.cpp b/src/depricatedlistener.cpp index 376a85d92..0cd473852 100644 --- a/src/depricatedlistener.cpp +++ b/src/depricatedlistener.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/depricatedlistener.h b/src/depricatedlistener.h index 34470a36b..52596b70f 100644 --- a/src/depricatedlistener.h +++ b/src/depricatedlistener.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/dragdrop.h b/src/dragdrop.h index 72c39a766..42d01c238 100644 --- a/src/dragdrop.h +++ b/src/dragdrop.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/dropshortcut.cpp b/src/dropshortcut.cpp index 0817c8933..90245d5af 100644 --- a/src/dropshortcut.cpp +++ b/src/dropshortcut.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/dropshortcut.h b/src/dropshortcut.h index a15fd423d..b4450127f 100644 --- a/src/dropshortcut.h +++ b/src/dropshortcut.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/dyetool/dyemain.cpp b/src/dyetool/dyemain.cpp index 7952f841c..c11cdd162 100644 --- a/src/dyetool/dyemain.cpp +++ b/src/dyetool/dyemain.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/effectmanager.cpp b/src/effectmanager.cpp index 346a51d52..6790cf61f 100644 --- a/src/effectmanager.cpp +++ b/src/effectmanager.cpp @@ -2,7 +2,7 @@ * An effects manager * Copyright (C) 2008 Fate <fate.tmw@googlemail.com> * Copyright (C) 2008 Chuck Miller <shadowmil@gmail.com> - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/effectmanager.h b/src/effectmanager.h index c972b760f..57181a750 100644 --- a/src/effectmanager.h +++ b/src/effectmanager.h @@ -2,7 +2,7 @@ * An effects manager * Copyright (C) 2008 Fate <fate.tmw@googlemail.com> * Copyright (C) 2008 Chuck Miller <shadowmil@gmail.com> - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/emoteshortcut.cpp b/src/emoteshortcut.cpp index 9a7acaeb1..34e68b9f8 100644 --- a/src/emoteshortcut.cpp +++ b/src/emoteshortcut.cpp @@ -1,7 +1,7 @@ /* * Extended support for activating emotes * Copyright (C) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/emoteshortcut.h b/src/emoteshortcut.h index 0957d7c81..0b5859fe9 100644 --- a/src/emoteshortcut.h +++ b/src/emoteshortcut.h @@ -1,7 +1,7 @@ /* * Extended support for activating emotes * Copyright (C) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/equipment.h b/src/equipment.h index 93c488bdf..f831a3c51 100644 --- a/src/equipment.h +++ b/src/equipment.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/eventsmanager.cpp b/src/eventsmanager.cpp index 17cb11ae6..6c102bdc1 100644 --- a/src/eventsmanager.cpp +++ b/src/eventsmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/eventsmanager.h b/src/eventsmanager.h index 8ca6aa974..7bf1eea24 100644 --- a/src/eventsmanager.h +++ b/src/eventsmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/flooritem.cpp b/src/flooritem.cpp index bd97f0ff8..bf8b54f0b 100644 --- a/src/flooritem.cpp +++ b/src/flooritem.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/flooritem.h b/src/flooritem.h index 4078fbaff..65fdbcfb4 100644 --- a/src/flooritem.h +++ b/src/flooritem.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/game.cpp b/src/game.cpp index 5766f724f..d17407b51 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/game.h b/src/game.h index 77df0a15b..08349cdaa 100644 --- a/src/game.h +++ b/src/game.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/graphicsmanager.cpp b/src/graphicsmanager.cpp index 07b59c71c..552f5a018 100644 --- a/src/graphicsmanager.cpp +++ b/src/graphicsmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/graphicsmanager.h b/src/graphicsmanager.h index 7629408be..744514ed2 100644 --- a/src/graphicsmanager.h +++ b/src/graphicsmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/graphicsvertexes.cpp b/src/graphicsvertexes.cpp index a8c3cf3e8..f8de08c8f 100644 --- a/src/graphicsvertexes.cpp +++ b/src/graphicsvertexes.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/graphicsvertexes.h b/src/graphicsvertexes.h index 9fa822ffd..15256113f 100644 --- a/src/graphicsvertexes.h +++ b/src/graphicsvertexes.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp index d0d4f1280..cd780e12d 100644 --- a/src/gui/focushandler.cpp +++ b/src/gui/focushandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/focushandler.h b/src/gui/focushandler.h index de61db3c4..e32b9afa1 100644 --- a/src/gui/focushandler.h +++ b/src/gui/focushandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 47a533bf8..db3faa314 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -468,7 +468,7 @@ void Gui::draw() { const int posX = mouseX - (image->mBounds.w / 2); const int posY = mouseY - (image->mBounds.h / 2); - DRAW_IMAGE(g2, image, posX, posY); + g2->drawImage2(image, posX, posY); } if (mGuiFont) { @@ -486,7 +486,7 @@ void Gui::draw() if (mouseCursor) { mouseCursor->setAlpha(mMouseCursorAlpha); - DRAW_IMAGE(g2, mouseCursor, mouseX - 15, mouseY - 17); + g2->drawImage2(mouseCursor, mouseX - 15, mouseY - 17); } } diff --git a/src/gui/gui.h b/src/gui/gui.h index b854a43de..56895b699 100644 --- a/src/gui/gui.h +++ b/src/gui/gui.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/palette.cpp b/src/gui/palette.cpp index b47203f8f..9d6c19095 100644 --- a/src/gui/palette.cpp +++ b/src/gui/palette.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 Douglas Boffey <dougaboffey@netscape.net> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/palette.h b/src/gui/palette.h index fdde01737..26ea6817c 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -3,7 +3,7 @@ * Copyright (C) 2008 Douglas Boffey <dougaboffey@netscape.net> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp index 4699fc5fe..6d3077130 100644 --- a/src/gui/popups/beingpopup.cpp +++ b/src/gui/popups/beingpopup.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -48,6 +48,7 @@ BeingPopup::BeingPopup() : mBeingName->setPosition(0, 0); const int fontHeight = mBeingName->getHeight(); + setMinHeight(fontHeight); // Being's party mBeingParty->setPosition(0, fontHeight); diff --git a/src/gui/popups/beingpopup.h b/src/gui/popups/beingpopup.h index cf9291db1..76789dbea 100644 --- a/src/gui/popups/beingpopup.h +++ b/src/gui/popups/beingpopup.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp index a2998cacb..1fd496dec 100644 --- a/src/gui/popups/itempopup.cpp +++ b/src/gui/popups/itempopup.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -53,6 +53,7 @@ ItemPopup::ItemPopup() : mItemType(ITEM_UNUSABLE), mIcon(new Icon(this, nullptr)), mLastName(), + mLastId(0), mLastColor(1) { // Item Name @@ -112,6 +113,7 @@ void ItemPopup::setItem(const Item *const item, const bool showImage) { mLastName = ii.getName(); mLastColor = item->getColor(); + mLastId = item->getId(); if (serverVersion > 0) { mItemName->setCaption(strprintf("%s (+%d), %d", ii.getName( @@ -132,8 +134,11 @@ void ItemPopup::setItem(const Item *const item, const bool showImage) void ItemPopup::setItem(const ItemInfo &item, const unsigned char color, const bool showImage, int id) { - if (!mIcon || (item.getName() == mLastName && color == mLastColor)) + if (!mIcon || (item.getName() == mLastName && color == mLastColor + && id == mLastId)) + { return; + } if (id == -1) id = item.getId(); @@ -167,6 +172,7 @@ void ItemPopup::setItem(const ItemInfo &item, const unsigned char color, mLastName = item.getName(); mLastColor = color; + mLastId = id; if (serverVersion > 0) { @@ -267,4 +273,5 @@ void ItemPopup::mouseMoved(gcn::MouseEvent &event) setVisible(false); mLastName.clear(); mLastColor = 1; + mLastId = 0; } diff --git a/src/gui/popups/itempopup.h b/src/gui/popups/itempopup.h index 4a4eca008..ac4683938 100644 --- a/src/gui/popups/itempopup.h +++ b/src/gui/popups/itempopup.h @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -70,6 +70,7 @@ class ItemPopup final : public Popup ItemType mItemType; Icon *mIcon; std::string mLastName; + int mLastId; unsigned char mLastColor; void setLabelColor(Label *label, const ItemType type) const; diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp index a9ca65b36..b1f7b8c8a 100644 --- a/src/gui/popups/popupmenu.cpp +++ b/src/gui/popups/popupmenu.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h index 56ecb860b..0970f34b6 100644 --- a/src/gui/popups/popupmenu.h +++ b/src/gui/popups/popupmenu.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/speechbubble.cpp b/src/gui/popups/speechbubble.cpp index 0c40676f6..e32a6bb4d 100644 --- a/src/gui/popups/speechbubble.cpp +++ b/src/gui/popups/speechbubble.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -24,6 +24,7 @@ #include "gui/popups/speechbubble.h" #include "gui/sdlfont.h" +#include "gui/viewport.h" #include "gui/widgets/browserbox.h" #include "gui/widgets/label.h" @@ -89,3 +90,8 @@ void SpeechBubble::setText(const std::string &text, const bool showName) mCaption->setPosition(0, 0); mSpeechBox->setPosition(0, nameHeight); } + +void SpeechBubble::requestMoveToBackground() +{ + windowContainer->moveWidgetAfter(viewport, this); +} diff --git a/src/gui/popups/speechbubble.h b/src/gui/popups/speechbubble.h index 41c210eab..62da9b146 100644 --- a/src/gui/popups/speechbubble.h +++ b/src/gui/popups/speechbubble.h @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -57,6 +57,8 @@ class SpeechBubble final : public Popup */ void setText(const std::string &text, const bool showName = true); + void requestMoveToBackground(); + private: std::string mText; int mSpacing; diff --git a/src/gui/popups/spellpopup.cpp b/src/gui/popups/spellpopup.cpp index b522f0d0a..df25739f2 100644 --- a/src/gui/popups/spellpopup.cpp +++ b/src/gui/popups/spellpopup.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/spellpopup.h b/src/gui/popups/spellpopup.h index faac5b355..c8123a4ce 100644 --- a/src/gui/popups/spellpopup.h +++ b/src/gui/popups/spellpopup.h @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/statuspopup.cpp b/src/gui/popups/statuspopup.cpp index 4b0361e2c..7944d1400 100644 --- a/src/gui/popups/statuspopup.cpp +++ b/src/gui/popups/statuspopup.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/statuspopup.h b/src/gui/popups/statuspopup.h index 40890325e..8904b6acc 100644 --- a/src/gui/popups/statuspopup.h +++ b/src/gui/popups/statuspopup.h @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/textpopup.cpp b/src/gui/popups/textpopup.cpp index 73f5fbad0..9a7f1d3e4 100644 --- a/src/gui/popups/textpopup.cpp +++ b/src/gui/popups/textpopup.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/popups/textpopup.h b/src/gui/popups/textpopup.h index cca690e35..131921b7b 100644 --- a/src/gui/popups/textpopup.h +++ b/src/gui/popups/textpopup.h @@ -3,7 +3,7 @@ * Copyright (C) 2008 The Legend of Mazzeroth Development Team * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index 3998ffcd2..8ef78c262 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers * Copyright (C) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -398,15 +398,15 @@ SDLFont::~SDLFont() TTF_Font *SDLFont::openFont(const char *const name, const int size) { // disabled for now because some systems like gentoo cant use it -//#ifdef USE_SDL2 +// #ifdef USE_SDL2 // SDL_RWops *const rw = MPHYSFSRWOPS_openRead(name); // if (!rw) // return nullptr; // return TTF_OpenFontIndexRW(rw, 1, size, 0); -//#else +// #else return TTF_OpenFontIndex(ResourceManager::getInstance()->getPath( name).c_str(), size, 0); -//#endif +// #endif } void SDLFont::loadFont(std::string filename, @@ -482,7 +482,7 @@ void SDLFont::drawString(gcn::Graphics *const graphics, if (image) { image->setAlpha(alpha); - DRAW_IMAGE(g, image, x, y); + g->drawImage2(image, x, y); } } else @@ -504,7 +504,7 @@ void SDLFont::drawString(gcn::Graphics *const graphics, const Image *const image = chunk2->img; if (image) - DRAW_IMAGE(g, image, x, y); + g->drawImage2(image, x, y); } BLOCK_END("SDLFont::drawString") } diff --git a/src/gui/sdlfont.h b/src/gui/sdlfont.h index 58a22871f..b2638f835 100644 --- a/src/gui/sdlfont.h +++ b/src/gui/sdlfont.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * Copyright (C) 2009 Aethyra Development Team * * This file is part of The ManaPlus Client. diff --git a/src/gui/sdlinput.cpp b/src/gui/sdlinput.cpp index 52d7a8fec..19b37a7d6 100644 --- a/src/gui/sdlinput.cpp +++ b/src/gui/sdlinput.cpp @@ -8,7 +8,7 @@ * * Copyright (c) 2004, 2005, 2006, 2007 Olof Naessén and Per Larsson * Copyright (C) 2007-2010 The Mana World Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * Js_./ * Per Larsson a.k.a finalman _RqZ{a<^_aa diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h index 65e0a78ce..a957ffa86 100644 --- a/src/gui/sdlinput.h +++ b/src/gui/sdlinput.h @@ -8,7 +8,7 @@ * * Copyright (c) 2004, 2005, 2006, 2007 Olof Naessén and Per Larsson * Copyright (C) 2007-2010 The Mana World Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * Js_./ * Per Larsson a.k.a finalman _RqZ{a<^_aa diff --git a/src/gui/setupactiondata.h b/src/gui/setupactiondata.h index 97a81ce6c..b80052b30 100644 --- a/src/gui/setupactiondata.h +++ b/src/gui/setupactiondata.h @@ -3,7 +3,7 @@ * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 183ef13a6..45c6db5ba 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -4,7 +4,7 @@ * Copyright (C) 2009 Aethyra Development Team * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/theme.h b/src/gui/theme.h index 564c94bb5..95511dc59 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -4,7 +4,7 @@ * Copyright (C) 2009 Aethyra Development Team * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/userpalette.cpp b/src/gui/userpalette.cpp index ff4789e9a..69125f8e2 100644 --- a/src/gui/userpalette.cpp +++ b/src/gui/userpalette.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 Douglas Boffey <dougaboffey@netscape.net> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/userpalette.h b/src/gui/userpalette.h index 8fd251747..18fe1cbe2 100644 --- a/src/gui/userpalette.h +++ b/src/gui/userpalette.h @@ -3,7 +3,7 @@ * Copyright (C) 2008 Douglas Boffey <dougaboffey@netscape.net> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index d2dddb4d8..933c00040 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -849,7 +849,8 @@ void Viewport::mouseMoved(gcn::MouseEvent &event A_UNUSED) mHoverBeing = actorManager->findBeingByPixel(x, y, true); if (mHoverBeing && (mHoverBeing->getType() == Being::PLAYER - || mHoverBeing->getType() == Being::NPC)) + || mHoverBeing->getType() == Being::NPC + || mHoverBeing->getType() == Being::PET)) { mTextPopup->setVisible(false); if (mShowBeingPopup) diff --git a/src/gui/viewport.h b/src/gui/viewport.h index 8827bd52f..2ccb5ddac 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index cc9b1a262..b676a7e94 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -137,7 +137,7 @@ void AvatarListBox::draw(gcn::Graphics *gcnGraphics) } else { - DRAW_IMAGE(graphics, icon, mImagePadding, y + mPadding); + graphics->drawImage2(icon, mImagePadding, y + mPadding); } } } diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h index c208824e7..99c1132b2 100644 --- a/src/gui/widgets/avatarlistbox.h +++ b/src/gui/widgets/avatarlistbox.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index d3e2efc67..b91c095b7 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * Copyright (C) 2009 Aethyra Development Team * * This file is part of The ManaPlus Client. @@ -508,7 +508,7 @@ void BrowserBox::draw(gcn::Graphics *graphics) } else if (part.mImage) { - DRAW_IMAGE(graphics2, part.mImage, part.mX, part.mY); + graphics2->drawImage2(part.mImage, part.mX, part.mY); } } diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h index 5a09f60d6..09f06bc39 100644 --- a/src/gui/widgets/browserbox.h +++ b/src/gui/widgets/browserbox.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * Copyright (C) 2009 Aethyra Development Team * * This file is part of The ManaPlus Client. diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index c8ac617c0..0042b07e3 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -508,11 +508,11 @@ void Button::draw(gcn::Graphics *graphics) { if (isPressed()) { - DRAW_IMAGE(g2, mImages[mode], imageX + 1, imageY + 1); + g2->drawImage2(mImages[mode], imageX + 1, imageY + 1); } else { - DRAW_IMAGE(g2, mImages[mode], imageX, imageY); + g2->drawImage2(mImages[mode], imageX, imageY); } } } diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h index 2e233cee5..a2333d581 100644 --- a/src/gui/widgets/button.h +++ b/src/gui/widgets/button.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp index fb2ec9e2f..52f56ae69 100644 --- a/src/gui/widgets/characterdisplay.cpp +++ b/src/gui/widgets/characterdisplay.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/characterdisplay.h b/src/gui/widgets/characterdisplay.h index 0ee533004..eb5ec6dfc 100644 --- a/src/gui/widgets/characterdisplay.h +++ b/src/gui/widgets/characterdisplay.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/characterviewbase.h b/src/gui/widgets/characterviewbase.h index 21e20e37d..a7c9d2240 100644 --- a/src/gui/widgets/characterviewbase.h +++ b/src/gui/widgets/characterviewbase.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/characterviewnormal.cpp b/src/gui/widgets/characterviewnormal.cpp index b24828fcc..78c538b8c 100644 --- a/src/gui/widgets/characterviewnormal.cpp +++ b/src/gui/widgets/characterviewnormal.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/characterviewnormal.h b/src/gui/widgets/characterviewnormal.h index 1c72f62d3..50001a61d 100644 --- a/src/gui/widgets/characterviewnormal.h +++ b/src/gui/widgets/characterviewnormal.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/characterviewsmall.cpp b/src/gui/widgets/characterviewsmall.cpp index 010bb3bba..ce218646b 100644 --- a/src/gui/widgets/characterviewsmall.cpp +++ b/src/gui/widgets/characterviewsmall.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/characterviewsmall.h b/src/gui/widgets/characterviewsmall.h index 8b89318f7..3a326134b 100644 --- a/src/gui/widgets/characterviewsmall.h +++ b/src/gui/widgets/characterviewsmall.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp index 0dfd45745..47d9f2b57 100644 --- a/src/gui/widgets/checkbox.cpp +++ b/src/gui/widgets/checkbox.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -167,7 +167,7 @@ void CheckBox::drawBox(gcn::Graphics *const graphics) if (box) { - DRAW_IMAGE(static_cast<Graphics*>(graphics), + static_cast<Graphics*>(graphics)->drawImage2( box, mImagePadding, (getHeight() - mImageSize) / 2); } } diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h index 3728d58bf..2d4581327 100644 --- a/src/gui/widgets/checkbox.h +++ b/src/gui/widgets/checkbox.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/colormodel.cpp b/src/gui/widgets/colormodel.cpp index 68d31cf81..7e59553e3 100644 --- a/src/gui/widgets/colormodel.cpp +++ b/src/gui/widgets/colormodel.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/colormodel.h b/src/gui/widgets/colormodel.h index 2c3fd4232..8b9226159 100644 --- a/src/gui/widgets/colormodel.h +++ b/src/gui/widgets/colormodel.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/colorpage.cpp b/src/gui/widgets/colorpage.cpp index 617084917..ee5a37c3c 100644 --- a/src/gui/widgets/colorpage.cpp +++ b/src/gui/widgets/colorpage.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/colorpage.h b/src/gui/widgets/colorpage.h index 348746fc6..06699cbbd 100644 --- a/src/gui/widgets/colorpage.h +++ b/src/gui/widgets/colorpage.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/container.cpp b/src/gui/widgets/container.cpp index 066e1c652..4b0fc60f7 100644 --- a/src/gui/widgets/container.cpp +++ b/src/gui/widgets/container.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/container.h b/src/gui/widgets/container.h index fb0dfb15c..efcdb70a7 100644 --- a/src/gui/widgets/container.h +++ b/src/gui/widgets/container.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 1aed4a825..8ccfcb982 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -1,7 +1,7 @@ /* * Desktop widget * Copyright (c) 2009-2010 The Mana World Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -124,15 +124,13 @@ void Desktop::draw(gcn::Graphics *graphics) if (imageHelper->useOpenGL() == RENDER_SOFTWARE) { - DRAW_IMAGE(g, mWallpaper, + g->drawImage2(mWallpaper, (width - wallpWidth) / 2, (height - wallpHeight) / 2); } else { - g->drawRescaledImage(mWallpaper, 0, 0, 0, 0, - wallpWidth, wallpHeight, - width, height, false); + g->drawRescaledImage(mWallpaper, 0, 0, width, height); } } else diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h index 824620f3b..b62ae96ef 100644 --- a/src/gui/widgets/desktop.h +++ b/src/gui/widgets/desktop.h @@ -1,7 +1,7 @@ /* * Desktop widget * Copyright (c) 2009-2010 The Mana World Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 0cfcb2a6f..068ffe1fc 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -250,7 +250,7 @@ void DropDown::draw(gcn::Graphics* graphics) } else { - DRAW_IMAGE(static_cast<Graphics*>(graphics), + static_cast<Graphics*>(graphics)->drawImage2( image, mImagePadding, (mDimension.height - image->getHeight()) / 2 + mPadding); font->drawString(graphics, model->getElementAt(sel), @@ -303,7 +303,7 @@ void DropDown::drawButton(gcn::Graphics *graphics) Image *image = buttons[mDroppedDown][mPushed]; if (image) { - DRAW_IMAGE(static_cast<Graphics*>(graphics), image, + static_cast<Graphics*>(graphics)->drawImage2(image, mDimension.width - image->getWidth() - mImagePadding, (height - image->getHeight()) / 2); } diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index f2266ceda..ed93dc358 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 9775b0fb0..73547b770 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -144,7 +144,7 @@ void DropShortcutContainer::draw(gcn::Graphics *graphics) caption = "Eq."; image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); if (item->isEquipped()) g->setColorAll(mEquipedColor, mEquipedColor2); else diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h index 958721ebb..b5a144cba 100644 --- a/src/gui/widgets/dropshortcutcontainer.h +++ b/src/gui/widgets/dropshortcutcontainer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp index 3c7d1a842..f2f84ed56 100644 --- a/src/gui/widgets/emotepage.cpp +++ b/src/gui/widgets/emotepage.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -103,7 +103,7 @@ void EmotePage::draw(gcn::Graphics *graphics) const Image *const image = *it; if (image) { - DRAW_IMAGE(g, image, x, y); + g->drawImage2(image, x, y); x += emoteWidth; if (x + emoteWidth > width) { diff --git a/src/gui/widgets/emotepage.h b/src/gui/widgets/emotepage.h index 7001027fd..8cef8f058 100644 --- a/src/gui/widgets/emotepage.h +++ b/src/gui/widgets/emotepage.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index 256c2a666..fa413452f 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -1,7 +1,7 @@ /* * Extended support for activating emotes * Copyright (C) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h index fd6550cc1..2c99aaf87 100644 --- a/src/gui/widgets/emoteshortcutcontainer.h +++ b/src/gui/widgets/emoteshortcutcontainer.h @@ -1,7 +1,7 @@ /* * Extended support for activating emotes * Copyright (C) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp index 0363b73a0..bd3a35964 100644 --- a/src/gui/widgets/extendedlistbox.cpp +++ b/src/gui/widgets/extendedlistbox.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -89,9 +89,23 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) if (insideWidth < strWidth) { const int strSize = str.size(); + int divPos = strSize / 2; + if (divPos > 0 && static_cast<unsigned char>( + str[divPos - 1]) >= 0xc0) + { + divPos --; + } + for (int d = divPos; d > 10; d --) + { + if (str[d] == 32) + { + divPos = d + 1; + break; + } + } list.push_back(ExtendedListBoxItem(row, - str.substr(0, strSize / 2), useImage, y)); - str = str.substr(strSize / 2); + str.substr(0, divPos), useImage, y)); + str = str.substr(divPos); y += height; useImage = false; } @@ -132,7 +146,7 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) const Image *const image = model->getImageAt(row1); if (image) { - DRAW_IMAGE(g, image, mImagePadding, item.y + (height + g->drawImage2(image, mImagePadding, item.y + (height - image->getHeight()) / 2 + mPadding); } } @@ -166,7 +180,7 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) const Image *const image = model->getImageAt(row1); if (image) { - DRAW_IMAGE(g, image, mImagePadding, item.y + (height + g->drawImage2(image, mImagePadding, item.y + (height - image->getHeight()) / 2 + mPadding); } } diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h index 778db3b20..30e7a32fb 100644 --- a/src/gui/widgets/extendedlistbox.h +++ b/src/gui/widgets/extendedlistbox.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/extendedlistmodel.h b/src/gui/widgets/extendedlistmodel.h index 40decf9d3..0299ef7ed 100644 --- a/src/gui/widgets/extendedlistmodel.h +++ b/src/gui/widgets/extendedlistmodel.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/extendednamesmodel.cpp b/src/gui/widgets/extendednamesmodel.cpp index 38acf55f7..a8a21d98d 100644 --- a/src/gui/widgets/extendednamesmodel.cpp +++ b/src/gui/widgets/extendednamesmodel.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/extendednamesmodel.h b/src/gui/widgets/extendednamesmodel.h index 2fff7e608..93e87cfa0 100644 --- a/src/gui/widgets/extendednamesmodel.h +++ b/src/gui/widgets/extendednamesmodel.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/flowcontainer.cpp b/src/gui/widgets/flowcontainer.cpp index 80a746dd4..d39a7124a 100644 --- a/src/gui/widgets/flowcontainer.cpp +++ b/src/gui/widgets/flowcontainer.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/flowcontainer.h b/src/gui/widgets/flowcontainer.h index 3a92d06e5..81043b450 100644 --- a/src/gui/widgets/flowcontainer.h +++ b/src/gui/widgets/flowcontainer.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index c18e6decf..ae0dd14c5 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index d41e5589b..5529ce842 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/horizontcontainer.cpp b/src/gui/widgets/horizontcontainer.cpp index 1d48c7159..a4c95169a 100644 --- a/src/gui/widgets/horizontcontainer.cpp +++ b/src/gui/widgets/horizontcontainer.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/horizontcontainer.h b/src/gui/widgets/horizontcontainer.h index 6c3305d91..be30220e8 100644 --- a/src/gui/widgets/horizontcontainer.h +++ b/src/gui/widgets/horizontcontainer.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp index e4985d68f..4fb511c85 100644 --- a/src/gui/widgets/icon.cpp +++ b/src/gui/widgets/icon.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -73,7 +73,7 @@ void Icon::draw(gcn::Graphics *g) if (mImage) { Graphics *const graphics = static_cast<Graphics*>(g); - DRAW_IMAGE(graphics, mImage, + graphics->drawImage2(mImage, (mDimension.width - mImage->mBounds.w) / 2, (mDimension.height - mImage->mBounds.h) / 2); } diff --git a/src/gui/widgets/icon.h b/src/gui/widgets/icon.h index 03f3cce8e..1cbd3158c 100644 --- a/src/gui/widgets/icon.h +++ b/src/gui/widgets/icon.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/inttextfield.cpp b/src/gui/widgets/inttextfield.cpp index 521d26d59..e50bd232b 100644 --- a/src/gui/widgets/inttextfield.cpp +++ b/src/gui/widgets/inttextfield.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/inttextfield.h b/src/gui/widgets/inttextfield.h index 5c17f40b9..3493cf52b 100644 --- a/src/gui/widgets/inttextfield.h +++ b/src/gui/widgets/inttextfield.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 8ba9707a4..2014d3ffe 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -278,15 +278,15 @@ void ItemContainer::draw(gcn::Graphics *graphics) if (mShowMatrix[itemIndex] == mSelectedIndex) { if (mSelImg) - DRAW_IMAGE(g, mSelImg, itemX, itemY); + g->drawImage2(mSelImg, itemX, itemY); } image->setAlpha(1.0F); // ensure the image if fully drawn... - DRAW_IMAGE(g, image, itemX + mPaddingItemX, + g->drawImage2(image, itemX + mPaddingItemX, itemY + mPaddingItemY); if (mProtectedImg && PlayerInfo::isItemProtected( item->getId())) { - DRAW_IMAGE(g, mProtectedImg, + g->drawImage2(mProtectedImg, itemX + mPaddingItemX, itemY + mPaddingItemY); } } diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h index ed6c1a44e..272536c87 100644 --- a/src/gui/widgets/itemcontainer.h +++ b/src/gui/widgets/itemcontainer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp index 0ce9408bf..cb74a658b 100644 --- a/src/gui/widgets/itemlinkhandler.cpp +++ b/src/gui/widgets/itemlinkhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/itemlinkhandler.h b/src/gui/widgets/itemlinkhandler.h index 6c1682ef4..4e55a8f72 100644 --- a/src/gui/widgets/itemlinkhandler.h +++ b/src/gui/widgets/itemlinkhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 7271f3943..cdeb83af7 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -175,7 +175,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) caption = "Eq."; image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); if (item->isEquipped()) g->setColorAll(mEquipedColor, mEquipedColor2); else @@ -199,7 +199,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) if (image) { image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); } } @@ -218,7 +218,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) if (image) { image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); } font->drawString(g, skill->data->shortName, itemX + 2, diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h index abeda6ecf..f9ec24589 100644 --- a/src/gui/widgets/itemshortcutcontainer.h +++ b/src/gui/widgets/itemshortcutcontainer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp index 50bd3ad41..7a16b800c 100644 --- a/src/gui/widgets/label.cpp +++ b/src/gui/widgets/label.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (c) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/label.h b/src/gui/widgets/label.h index 9654161d5..3546f17b4 100644 --- a/src/gui/widgets/label.h +++ b/src/gui/widgets/label.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (c) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp index 8d42d07ff..d9a818e0f 100644 --- a/src/gui/widgets/layout.cpp +++ b/src/gui/widgets/layout.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h index 7888b0759..b03c10c1f 100644 --- a/src/gui/widgets/layout.h +++ b/src/gui/widgets/layout.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/layouthelper.cpp b/src/gui/widgets/layouthelper.cpp index 196b60415..b0fb75adc 100644 --- a/src/gui/widgets/layouthelper.cpp +++ b/src/gui/widgets/layouthelper.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h index 57eb33576..4f8ed8708 100644 --- a/src/gui/widgets/layouthelper.h +++ b/src/gui/widgets/layouthelper.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/linkhandler.h b/src/gui/widgets/linkhandler.h index 1114f5a21..744ff0b29 100644 --- a/src/gui/widgets/linkhandler.h +++ b/src/gui/widgets/linkhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index ba6b47e22..9a1a074b3 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h index 15a521b77..83a33eb62 100644 --- a/src/gui/widgets/listbox.h +++ b/src/gui/widgets/listbox.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/mouseevent.h b/src/gui/widgets/mouseevent.h index fd3bb0ac8..b7c0cc94c 100644 --- a/src/gui/widgets/mouseevent.h +++ b/src/gui/widgets/mouseevent.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/namesmodel.cpp b/src/gui/widgets/namesmodel.cpp index a44caf11c..339f835d5 100644 --- a/src/gui/widgets/namesmodel.cpp +++ b/src/gui/widgets/namesmodel.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/namesmodel.h b/src/gui/widgets/namesmodel.h index 8c2a7f1ca..76f668f10 100644 --- a/src/gui/widgets/namesmodel.h +++ b/src/gui/widgets/namesmodel.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/passwordfield.cpp b/src/gui/widgets/passwordfield.cpp index 13e5e5773..b2ee6ccad 100644 --- a/src/gui/widgets/passwordfield.cpp +++ b/src/gui/widgets/passwordfield.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/passwordfield.h b/src/gui/widgets/passwordfield.h index 7e23a4d70..322d71b8b 100644 --- a/src/gui/widgets/passwordfield.h +++ b/src/gui/widgets/passwordfield.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp index 21617c57b..2e078c088 100644 --- a/src/gui/widgets/playerbox.cpp +++ b/src/gui/widgets/playerbox.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h index d88a83b37..3ebae9be4 100644 --- a/src/gui/widgets/playerbox.h +++ b/src/gui/widgets/playerbox.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index def641755..1ba4083cd 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * Copyright (C) 2009 Aethyra Development Team * * This file is part of The ManaPlus Client. diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 04a4562ed..711ac97b7 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * Copyright (C) 2009 Aethyra Development Team * * This file is part of The ManaPlus Client. diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index 5fd1e90cd..f7f8afc66 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/popuplist.h b/src/gui/widgets/popuplist.h index 39caf7748..f41b9f631 100644 --- a/src/gui/widgets/popuplist.h +++ b/src/gui/widgets/popuplist.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 33011f9fc..97c29bd8c 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -37,10 +37,12 @@ float ProgressBar::mAlpha = 1.0; ProgressBar::ProgressBar(const Widget2 *const widget, float progress, const int width, const int height, - const int backColor): + const int backColor, + const std::string &skin, const std::string &skinFill): gcn::Widget(), Widget2(widget), gcn::WidgetListener(), + mFillRect(), mSkin(nullptr), mProgress(progress), mProgressToGo(progress), @@ -53,6 +55,7 @@ ProgressBar::ProgressBar(const Widget2 *const widget, float progress, mProgressPalette(backColor), mPadding(2), mFillPadding(3), + mFillImage(false), mSmoothProgress(true), mSmoothColorChange(true), mRedraw(true) @@ -68,11 +71,14 @@ ProgressBar::ProgressBar(const Widget2 *const widget, float progress, Theme *const theme = Theme::instance(); if (theme) { - mSkin = theme->load("progressbar.xml", ""); + mSkin = theme->load(skin, "progressbar.xml"); if (mSkin) { setPadding(mSkin->getPadding()); mFillPadding = mSkin->getOption("fillPadding"); + mFillImage = mSkin->getOption("fillImage") != 0; + if (mFillImage) + theme->loadRect(mFillRect, skinFill, "progressbar_fill.xml"); } setHeight(2 * mPadding + getFont()->getHeight() + 2); } @@ -86,13 +92,15 @@ ProgressBar::~ProgressBar() gui->removeDragged(this); mInstances--; + Theme *const theme = Theme::instance(); if (mSkin) { - Theme *const theme = Theme::instance(); if (theme) theme->unload(mSkin); mSkin = nullptr; } + if (theme) + theme->unloadRect(mFillRect); delete mVertexes; mVertexes = nullptr; } @@ -115,6 +123,7 @@ void ProgressBar::logic() mBackgroundColor.g--; if (mBackgroundColorToGo.b < mBackgroundColor.b) mBackgroundColor.b--; + mRedraw = true; } if (mSmoothProgress && mProgressToGo != mProgress) @@ -124,6 +133,7 @@ void ProgressBar::logic() mProgress = std::min(1.0F, mProgress + 0.005F); if (mProgressToGo < mProgress) mProgress = std::max(0.0F, mProgress - 0.005F); + mRedraw = true; } BLOCK_END("ProgressBar::logic") } @@ -148,6 +158,7 @@ void ProgressBar::setProgress(const float progress) { const float p = std::min(1.0F, std::max(0.0F, progress)); mProgressToGo = p; + mRedraw = true; if (!mSmoothProgress) mProgress = p; @@ -163,6 +174,7 @@ void ProgressBar::setProgressPalette(const int progressPalette) { const int oldPalette = mProgressPalette; mProgressPalette = progressPalette; + mRedraw = true; if (mProgressPalette != oldPalette && mProgressPalette >= 0) { @@ -173,6 +185,7 @@ void ProgressBar::setProgressPalette(const int progressPalette) void ProgressBar::setBackgroundColor(const gcn::Color &color) { + mRedraw = true; mBackgroundColorToGo = color; if (!mSmoothColorChange) @@ -198,6 +211,20 @@ void ProgressBar::render(Graphics *graphics) mVertexes->clear(); graphics->calcWindow(mVertexes, 0, 0, mDimension.width, mDimension.height, mSkin->getBorder()); + if (mFillImage) + { + const unsigned int pad = 2 * mFillPadding; + const int maxWidth = mDimension.width - pad; + int width = static_cast<int>(mProgress + * static_cast<float>(maxWidth)); + if (width > 0) + { + if (width > maxWidth) + width = maxWidth; + graphics->calcWindow(mVertexes, mFillPadding, mFillPadding, + width, mDimension.height - pad, mFillRect); + } + } } graphics->drawTileCollection(mVertexes); @@ -206,10 +233,24 @@ void ProgressBar::render(Graphics *graphics) { graphics->drawImageRect(0, 0, mDimension.width, mDimension.height, mSkin->getBorder()); + if (mFillImage) + { + const unsigned int pad = 2 * mFillPadding; + const int maxWidth = mDimension.width - pad; + int width = static_cast<int>(mProgress + * static_cast<float>(maxWidth)); + if (width > 0) + { + if (width > maxWidth) + width = maxWidth; + graphics->drawImageRect(mFillPadding, mFillPadding, + width, mDimension.height - pad, mFillRect); + } + } } // The bar - if (mProgress > 0) + if (!mFillImage && mProgress > 0) { graphics->setColor(mBackgroundColor); const unsigned int pad = 2 * mFillPadding; diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h index 954d9f7d2..9e503526c 100644 --- a/src/gui/widgets/progressbar.h +++ b/src/gui/widgets/progressbar.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -32,7 +32,6 @@ #include "localconsts.h" -class Graphics; class ImageCollection; class Skin; @@ -51,7 +50,8 @@ class ProgressBar final : public gcn::Widget, */ ProgressBar(const Widget2 *const widget, float progress, const int width, const int height, - const int backColor); + const int backColor, + const std::string &skin, const std::string &skinFill); A_DELETE_COPY(ProgressBar) @@ -139,6 +139,7 @@ class ProgressBar final : public gcn::Widget, { mPadding = padding; } private: + ImageRect mFillRect; Skin *mSkin; float mProgress; float mProgressToGo; @@ -156,6 +157,7 @@ class ProgressBar final : public gcn::Widget, static int mInstances; static float mAlpha; + bool mFillImage; bool mSmoothProgress; bool mSmoothColorChange; bool mRedraw; diff --git a/src/gui/widgets/progressindicator.cpp b/src/gui/widgets/progressindicator.cpp index 4d39becf1..d89ff7f2a 100644 --- a/src/gui/widgets/progressindicator.cpp +++ b/src/gui/widgets/progressindicator.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/progressindicator.h b/src/gui/widgets/progressindicator.h index 353de1ff4..61a72dd67 100644 --- a/src/gui/widgets/progressindicator.h +++ b/src/gui/widgets/progressindicator.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp index 6ef7439b4..e0643a8ac 100644 --- a/src/gui/widgets/radiobutton.cpp +++ b/src/gui/widgets/radiobutton.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -149,7 +149,7 @@ void RadioButton::drawBox(gcn::Graphics* graphics) if (box) { - DRAW_IMAGE(static_cast<Graphics*>(graphics), + static_cast<Graphics*>(graphics)->drawImage2( box, mImagePadding, (getHeight() - mImageSize) / 2); } } diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h index f701a6335..f5ff43f4c 100644 --- a/src/gui/widgets/radiobutton.h +++ b/src/gui/widgets/radiobutton.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/radiogroup.cpp b/src/gui/widgets/radiogroup.cpp index 73d34afce..d2f130c1b 100644 --- a/src/gui/widgets/radiogroup.cpp +++ b/src/gui/widgets/radiogroup.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/radiogroup.h b/src/gui/widgets/radiogroup.h index 0d65365c8..1863a348c 100644 --- a/src/gui/widgets/radiogroup.h +++ b/src/gui/widgets/radiogroup.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index ebb91f518..6d7695198 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -429,7 +429,7 @@ void ScrollArea::drawButton(gcn::Graphics *const graphics, if (buttons[dir][state]) { - DRAW_IMAGE(static_cast<Graphics*>(graphics), + static_cast<Graphics*>(graphics)->drawImage2( buttons[dir][state], dim.x, dim.y); } } @@ -479,17 +479,17 @@ void ScrollArea::drawVBar(gcn::Graphics *const graphics) if (vBackground.grid[4]) { - g->drawImagePattern(vBackground.grid[4], + g->drawPattern(vBackground.grid[4], dim.x, dim.y, dim.width, dim.height); } if (vBackground.grid[1]) { - g->drawImagePattern(vBackground.grid[1], + g->drawPattern(vBackground.grid[1], dim.x, dim.y, dim.width, vBackground.grid[1]->getHeight()); } if (vBackground.grid[7]) { - g->drawImagePattern(vBackground.grid[7], + g->drawPattern(vBackground.grid[7], dim.x, dim.height - vBackground.grid[7]->getHeight() + dim.y, dim.width, vBackground.grid[7]->getHeight()); } @@ -502,17 +502,17 @@ void ScrollArea::calcVBar(gcn::Graphics *const graphics) if (vBackground.grid[4]) { - g->calcImagePattern(mVertexes, vBackground.grid[4], + g->calcPattern(mVertexes, vBackground.grid[4], dim.x, dim.y, dim.width, dim.height); } if (vBackground.grid[1]) { - g->calcImagePattern(mVertexes, vBackground.grid[1], + g->calcPattern(mVertexes, vBackground.grid[1], dim.x, dim.y, dim.width, vBackground.grid[1]->getHeight()); } if (vBackground.grid[7]) { - g->calcImagePattern(mVertexes, vBackground.grid[7], + g->calcPattern(mVertexes, vBackground.grid[7], dim.x, dim.height - vBackground.grid[7]->getHeight() + dim.y, dim.width, vBackground.grid[7]->getHeight()); } @@ -525,19 +525,19 @@ void ScrollArea::drawHBar(gcn::Graphics *const graphics) if (hBackground.grid[4]) { - g->drawImagePattern(hBackground.grid[4], + g->drawPattern(hBackground.grid[4], dim.x, dim.y, dim.width, dim.height); } if (hBackground.grid[3]) { - g->drawImagePattern(hBackground.grid[3], + g->drawPattern(hBackground.grid[3], dim.x, dim.y, hBackground.grid[3]->getWidth(), dim.height); } if (hBackground.grid[5]) { - g->drawImagePattern(hBackground.grid[5], + g->drawPattern(hBackground.grid[5], dim.x + dim.width - hBackground.grid[5]->getWidth(), dim.y, hBackground.grid[5]->getWidth(), dim.height); } @@ -550,19 +550,19 @@ void ScrollArea::calcHBar(gcn::Graphics *const graphics) if (hBackground.grid[4]) { - g->calcImagePattern(mVertexes, hBackground.grid[4], + g->calcPattern(mVertexes, hBackground.grid[4], dim.x, dim.y, dim.width, dim.height); } if (hBackground.grid[3]) { - g->calcImagePattern(mVertexes, hBackground.grid[3], + g->calcPattern(mVertexes, hBackground.grid[3], dim.x, dim.y, hBackground.grid[3]->getWidth(), dim.height); } if (hBackground.grid[5]) { - g->calcImagePattern(mVertexes, hBackground.grid[5], + g->calcPattern(mVertexes, hBackground.grid[5], dim.x + dim.width - hBackground.grid[5]->getWidth(), dim.y, hBackground.grid[5]->getWidth(), dim.height); } diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 165b1f131..13e5e3665 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp index 2dd16cf81..09717bc8b 100644 --- a/src/gui/widgets/setupitem.cpp +++ b/src/gui/widgets/setupitem.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h index a7f2fc900..561265729 100644 --- a/src/gui/widgets/setupitem.h +++ b/src/gui/widgets/setupitem.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp index 58a34de45..b080de428 100644 --- a/src/gui/widgets/setuptouchitem.cpp +++ b/src/gui/widgets/setuptouchitem.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/setuptouchitem.h b/src/gui/widgets/setuptouchitem.h index 65ad48642..f15c0d43d 100644 --- a/src/gui/widgets/setuptouchitem.h +++ b/src/gui/widgets/setuptouchitem.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/shopitems.cpp b/src/gui/widgets/shopitems.cpp index 2f8d31111..2ac65253d 100644 --- a/src/gui/widgets/shopitems.cpp +++ b/src/gui/widgets/shopitems.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/shopitems.h b/src/gui/widgets/shopitems.h index 219ada7cd..4803d6fed 100644 --- a/src/gui/widgets/shopitems.h +++ b/src/gui/widgets/shopitems.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 5bf56c842..9b368a10c 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -157,7 +157,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) if (icon) { icon->setAlpha(1.0F); - DRAW_IMAGE(graphics, icon, mPadding, y + mPadding); + graphics->drawImage2(icon, mPadding, y + mPadding); } } if (mSelected == i) diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h index 7f91c3e3a..5cbc66158 100644 --- a/src/gui/widgets/shoplistbox.h +++ b/src/gui/widgets/shoplistbox.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index c4a6fe249..a3030b035 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -109,7 +109,7 @@ void ShortcutContainer::drawBackground(Graphics *g) { for (unsigned i = 0; i < mMaxItems; i ++) { - DRAW_IMAGE(g, mBackgroundImg, (i % mGridWidth) * mBoxWidth, + g->drawImage2(mBackgroundImg, (i % mGridWidth) * mBoxWidth, (i / mGridWidth) * mBoxHeight); } } diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h index 11aa0fe86..8bd84758d 100644 --- a/src/gui/widgets/shortcutcontainer.h +++ b/src/gui/widgets/shortcutcontainer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/skilldata.cpp b/src/gui/widgets/skilldata.cpp index 66c662a21..0d8b2b7a9 100644 --- a/src/gui/widgets/skilldata.cpp +++ b/src/gui/widgets/skilldata.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/skilldata.h b/src/gui/widgets/skilldata.h index 3830ed764..eb8de62f6 100644 --- a/src/gui/widgets/skilldata.h +++ b/src/gui/widgets/skilldata.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/skillinfo.cpp b/src/gui/widgets/skillinfo.cpp index 48ead9c6c..46a3f425f 100644 --- a/src/gui/widgets/skillinfo.cpp +++ b/src/gui/widgets/skillinfo.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/skillinfo.h b/src/gui/widgets/skillinfo.h index 69a63dbba..d268b3438 100644 --- a/src/gui/widgets/skillinfo.h +++ b/src/gui/widgets/skillinfo.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/skillmodel.cpp b/src/gui/widgets/skillmodel.cpp index fab83cb46..3244feec4 100644 --- a/src/gui/widgets/skillmodel.cpp +++ b/src/gui/widgets/skillmodel.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/skillmodel.h b/src/gui/widgets/skillmodel.h index 733407eaa..0f77dccfe 100644 --- a/src/gui/widgets/skillmodel.h +++ b/src/gui/widgets/skillmodel.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp index 039af9743..37b696a4e 100644 --- a/src/gui/widgets/slider.cpp +++ b/src/gui/widgets/slider.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -156,7 +156,7 @@ void Slider::draw(gcn::Graphics *graphics) if (buttons[0].grid[HMID]) { const Image *const hMid = buttons[0].grid[HMID]; - g->calcImagePattern(mVertexes, hMid, x, y, + g->calcPattern(mVertexes, hMid, x, y, w, hMid->getHeight()); } @@ -184,7 +184,7 @@ void Slider::draw(gcn::Graphics *graphics) if (buttons[1].grid[HMID]) { const Image *const hMid = buttons[1].grid[HMID]; - g->calcImagePattern(mVertexes, hMid, x, y, + g->calcPattern(mVertexes, hMid, x, y, w, hMid->getHeight()); } @@ -209,7 +209,7 @@ void Slider::draw(gcn::Graphics *graphics) { if (!mHasMouse) { - DRAW_IMAGE(g, buttons[0].grid[HSTART], x, y); + g->drawImage2(buttons[0].grid[HSTART], x, y); const int width = buttons[0].grid[HSTART]->getWidth(); w -= width + buttons[0].grid[HEND]->getWidth(); x += width; @@ -217,22 +217,22 @@ void Slider::draw(gcn::Graphics *graphics) if (buttons[0].grid[HMID]) { const Image *const hMid = buttons[0].grid[HMID]; - g->drawImagePattern(hMid, x, y, w, hMid->getHeight()); + g->drawPattern(hMid, x, y, w, hMid->getHeight()); } x += w; - DRAW_IMAGE(g, buttons[0].grid[HEND], x, y); + g->drawImage2(buttons[0].grid[HEND], x, y); const Image *const img = buttons[0].grid[HGRIP]; if (img) { - DRAW_IMAGE(g, img, getMarkerPosition(), + g->drawImage2(img, getMarkerPosition(), (mDimension.height - img->getHeight()) / 2); } } else { - DRAW_IMAGE(g, buttons[1].grid[HSTART], x, y); + g->drawImage2(buttons[1].grid[HSTART], x, y); const int width = buttons[1].grid[HSTART]->getWidth(); w -= width; @@ -243,17 +243,17 @@ void Slider::draw(gcn::Graphics *graphics) if (buttons[1].grid[HMID]) { const Image *const hMid = buttons[1].grid[HMID]; - g->drawImagePattern(hMid, x, y, w, hMid->getHeight()); + g->drawPattern(hMid, x, y, w, hMid->getHeight()); } x += w; if (buttons[1].grid[HEND]) - DRAW_IMAGE(g, buttons[1].grid[HEND], x, y); + g->drawImage2(buttons[1].grid[HEND], x, y); const Image *const img = buttons[1].grid[HGRIP]; if (img) { - DRAW_IMAGE(g, img, getMarkerPosition(), + g->drawImage2(img, getMarkerPosition(), (mDimension.height - img->getHeight()) / 2); } } diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h index 79ef2b961..a0f7829ac 100644 --- a/src/gui/widgets/slider.h +++ b/src/gui/widgets/slider.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp index d41927f82..6dd968eef 100644 --- a/src/gui/widgets/sliderlist.cpp +++ b/src/gui/widgets/sliderlist.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -46,9 +46,6 @@ SliderList::SliderList(const Widget2 *const widget, mSelectedIndex(0) { setHeight(sliderHeight); - - mButtons[0] = new Button(this, "<", mPrevEventId, this); - mButtons[1] = new Button(this, ">", mNextEventId, this); } void SliderList::postInit(gcn::ActionListener *const listener, @@ -57,6 +54,9 @@ void SliderList::postInit(gcn::ActionListener *const listener, mPrevEventId = eventId + "_prev"; mNextEventId = eventId + "_next"; + mButtons[0] = new Button(this, "<", mPrevEventId, this); + mButtons[1] = new Button(this, ">", mNextEventId, this); + add(mButtons[0]); add(mLabel); add(mButtons[1]); @@ -83,7 +83,6 @@ void SliderList::updateAlpha() void SliderList::mouseWheelMovedUp(gcn::MouseEvent& mouseEvent) { - logger->log("SliderList::mouseWheelMovedUp"); setSelected(mSelectedIndex - 1); mouseEvent.consume(); } diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h index 28c469e34..4ef673b83 100644 --- a/src/gui/widgets/sliderlist.h +++ b/src/gui/widgets/sliderlist.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 7d9ba6d0f..c4e4b0671 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -135,7 +135,7 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics) if (image) { image->setAlpha(1.0F); - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); } } diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h index 30617e736..31e98a592 100644 --- a/src/gui/widgets/spellshortcutcontainer.h +++ b/src/gui/widgets/spellshortcutcontainer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 9526c58bd..70e098cd3 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 449d8c51a..37950e204 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tablemodel.cpp b/src/gui/widgets/tablemodel.cpp index 87c620afc..f244f51f4 100644 --- a/src/gui/widgets/tablemodel.cpp +++ b/src/gui/widgets/tablemodel.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tablemodel.h b/src/gui/widgets/tablemodel.h index b6122fcb8..1273c6873 100644 --- a/src/gui/widgets/tablemodel.h +++ b/src/gui/widgets/tablemodel.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/battletab.cpp b/src/gui/widgets/tabs/battletab.cpp index fa7e252f0..9d29c198e 100644 --- a/src/gui/widgets/tabs/battletab.cpp +++ b/src/gui/widgets/tabs/battletab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/battletab.h b/src/gui/widgets/tabs/battletab.h index 54f7f2b30..52f44cf40 100644 --- a/src/gui/widgets/tabs/battletab.h +++ b/src/gui/widgets/tabs/battletab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp index 5235f8667..1795fd03e 100644 --- a/src/gui/widgets/tabs/chattab.cpp +++ b/src/gui/widgets/tabs/chattab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/chattab.h b/src/gui/widgets/tabs/chattab.h index b9f0dff10..9790c33e4 100644 --- a/src/gui/widgets/tabs/chattab.h +++ b/src/gui/widgets/tabs/chattab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -122,8 +122,8 @@ class ChatTab : public Tab * @returns true if the command was handled * false if the command was not handled */ - virtual bool handleCommand(const std::string &type A_UNUSED, - const std::string &args A_UNUSED) + virtual bool handleCommand(const std::string &restrict type A_UNUSED, + const std::string &restrict args A_UNUSED) { return false; } /** diff --git a/src/gui/widgets/tabs/gmtab.cpp b/src/gui/widgets/tabs/gmtab.cpp index 25ec67f19..7b6e1e07c 100644 --- a/src/gui/widgets/tabs/gmtab.cpp +++ b/src/gui/widgets/tabs/gmtab.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/gmtab.h b/src/gui/widgets/tabs/gmtab.h index b3fd601d6..0685c3808 100644 --- a/src/gui/widgets/tabs/gmtab.h +++ b/src/gui/widgets/tabs/gmtab.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/guildchattab.cpp b/src/gui/widgets/tabs/guildchattab.cpp index 69a4faaf3..364b83968 100644 --- a/src/gui/widgets/tabs/guildchattab.cpp +++ b/src/gui/widgets/tabs/guildchattab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -52,8 +52,8 @@ GuildChatTab::~GuildChatTab() CHECKLISTENERS } -bool GuildChatTab::handleCommand(const std::string &type, - const std::string &args) +bool GuildChatTab::handleCommand(const std::string &restrict type, + const std::string &restrict args) { if (type == "help") { diff --git a/src/gui/widgets/tabs/guildchattab.h b/src/gui/widgets/tabs/guildchattab.h index 469a10936..7fac06843 100644 --- a/src/gui/widgets/tabs/guildchattab.h +++ b/src/gui/widgets/tabs/guildchattab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -37,8 +37,8 @@ class GuildChatTab final : public ChatTab, public ConfigListener ~GuildChatTab(); - bool handleCommand(const std::string &type, - const std::string &args) override final; + bool handleCommand(const std::string &restrict type, + const std::string &restrict args) override final; void showHelp() override; diff --git a/src/gui/widgets/tabs/langtab.cpp b/src/gui/widgets/tabs/langtab.cpp index 7bea453c7..fb6a5e12b 100644 --- a/src/gui/widgets/tabs/langtab.cpp +++ b/src/gui/widgets/tabs/langtab.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/langtab.h b/src/gui/widgets/tabs/langtab.h index bef59792f..275b69399 100644 --- a/src/gui/widgets/tabs/langtab.h +++ b/src/gui/widgets/tabs/langtab.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp index 219cf30f2..1bb119ee4 100644 --- a/src/gui/widgets/tabs/setup_audio.cpp +++ b/src/gui/widgets/tabs/setup_audio.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_audio.h b/src/gui/widgets/tabs/setup_audio.h index ef8ab04f7..839734b39 100644 --- a/src/gui/widgets/tabs/setup_audio.h +++ b/src/gui/widgets/tabs/setup_audio.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_chat.cpp b/src/gui/widgets/tabs/setup_chat.cpp index 99b470a2c..3aa6d39d2 100644 --- a/src/gui/widgets/tabs/setup_chat.cpp +++ b/src/gui/widgets/tabs/setup_chat.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_chat.h b/src/gui/widgets/tabs/setup_chat.h index 2a465673f..22b0130ce 100644 --- a/src/gui/widgets/tabs/setup_chat.h +++ b/src/gui/widgets/tabs/setup_chat.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp index 2629d084d..1094f5e29 100644 --- a/src/gui/widgets/tabs/setup_colors.cpp +++ b/src/gui/widgets/tabs/setup_colors.cpp @@ -1,7 +1,7 @@ /* * Configurable text colors * Copyright (C) 2008 Douglas Boffey <dougaboffey@netscape.net> - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_colors.h b/src/gui/widgets/tabs/setup_colors.h index ba8dfa03e..b2f860415 100644 --- a/src/gui/widgets/tabs/setup_colors.h +++ b/src/gui/widgets/tabs/setup_colors.h @@ -1,7 +1,7 @@ /* * Configurable text colors * Copyright (C) 2008 Douglas Boffey <dougaboffey@netscape.net> - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp index 9df05582f..2ce99d971 100644 --- a/src/gui/widgets/tabs/setup_input.cpp +++ b/src/gui/widgets/tabs/setup_input.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_input.h b/src/gui/widgets/tabs/setup_input.h index 9ed9d3d47..cb2e5cac0 100644 --- a/src/gui/widgets/tabs/setup_input.h +++ b/src/gui/widgets/tabs/setup_input.h @@ -3,7 +3,7 @@ * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_joystick.cpp b/src/gui/widgets/tabs/setup_joystick.cpp index 571d53b6f..6f023a488 100644 --- a/src/gui/widgets/tabs/setup_joystick.cpp +++ b/src/gui/widgets/tabs/setup_joystick.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_joystick.h b/src/gui/widgets/tabs/setup_joystick.h index a9109e0f6..5c7b764ec 100644 --- a/src/gui/widgets/tabs/setup_joystick.h +++ b/src/gui/widgets/tabs/setup_joystick.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp index b03cf5f41..7dea0021f 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -243,6 +243,10 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : new SetupItemCheckBox(_("Enable advert protocol"), "", "enableAdvert", this, "enableAdvertEvent"); + // TRANSLATORS: settings option + new SetupItemCheckBox(_("Enabled pets support"), + "", "usepets", this, "usepetsEvent"); + new SetupItemCheckBox(_("Enable weight notifications"), "", "weightMsg", this, "weightMsgEvent"); diff --git a/src/gui/widgets/tabs/setup_other.h b/src/gui/widgets/tabs/setup_other.h index a3801b21d..101cfa101 100644 --- a/src/gui/widgets/tabs/setup_other.h +++ b/src/gui/widgets/tabs/setup_other.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_perfomance.cpp b/src/gui/widgets/tabs/setup_perfomance.cpp index 4f9105beb..271501e38 100644 --- a/src/gui/widgets/tabs/setup_perfomance.cpp +++ b/src/gui/widgets/tabs/setup_perfomance.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_perfomance.h b/src/gui/widgets/tabs/setup_perfomance.h index cc226daa4..5ea88a362 100644 --- a/src/gui/widgets/tabs/setup_perfomance.h +++ b/src/gui/widgets/tabs/setup_perfomance.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_players.cpp b/src/gui/widgets/tabs/setup_players.cpp index 68d1b2eb8..d4f29fa2c 100644 --- a/src/gui/widgets/tabs/setup_players.cpp +++ b/src/gui/widgets/tabs/setup_players.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_players.h b/src/gui/widgets/tabs/setup_players.h index c942c1a03..853cc2a0f 100644 --- a/src/gui/widgets/tabs/setup_players.h +++ b/src/gui/widgets/tabs/setup_players.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp index 8f5802371..89d1f5beb 100644 --- a/src/gui/widgets/tabs/setup_relations.cpp +++ b/src/gui/widgets/tabs/setup_relations.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_relations.h b/src/gui/widgets/tabs/setup_relations.h index 092c9bb5d..c9d8e50a3 100644 --- a/src/gui/widgets/tabs/setup_relations.h +++ b/src/gui/widgets/tabs/setup_relations.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp index 65bb059bc..c80ec3aac 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_theme.h b/src/gui/widgets/tabs/setup_theme.h index 41c49e18c..daf0a6f72 100644 --- a/src/gui/widgets/tabs/setup_theme.h +++ b/src/gui/widgets/tabs/setup_theme.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_touch.cpp b/src/gui/widgets/tabs/setup_touch.cpp index 6e3c12a02..5d995f914 100644 --- a/src/gui/widgets/tabs/setup_touch.cpp +++ b/src/gui/widgets/tabs/setup_touch.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_touch.h b/src/gui/widgets/tabs/setup_touch.h index dee9905b6..9adc2d5cd 100644 --- a/src/gui/widgets/tabs/setup_touch.h +++ b/src/gui/widgets/tabs/setup_touch.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index d6532fb86..feebb774a 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_video.h b/src/gui/widgets/tabs/setup_video.h index 9421017ca..22d55c121 100644 --- a/src/gui/widgets/tabs/setup_video.h +++ b/src/gui/widgets/tabs/setup_video.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_visual.cpp b/src/gui/widgets/tabs/setup_visual.cpp index f19b3508f..7e565a291 100644 --- a/src/gui/widgets/tabs/setup_visual.cpp +++ b/src/gui/widgets/tabs/setup_visual.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setup_visual.h b/src/gui/widgets/tabs/setup_visual.h index 371657956..3967fd1de 100644 --- a/src/gui/widgets/tabs/setup_visual.h +++ b/src/gui/widgets/tabs/setup_visual.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setuptab.cpp b/src/gui/widgets/tabs/setuptab.cpp index 79df5e4bb..ab015f9a2 100644 --- a/src/gui/widgets/tabs/setuptab.cpp +++ b/src/gui/widgets/tabs/setuptab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setuptab.h b/src/gui/widgets/tabs/setuptab.h index d42b27a9f..9d1362faf 100644 --- a/src/gui/widgets/tabs/setuptab.h +++ b/src/gui/widgets/tabs/setuptab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setuptabscroll.cpp b/src/gui/widgets/tabs/setuptabscroll.cpp index 48a27a550..f01d691b6 100644 --- a/src/gui/widgets/tabs/setuptabscroll.cpp +++ b/src/gui/widgets/tabs/setuptabscroll.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/setuptabscroll.h b/src/gui/widgets/tabs/setuptabscroll.h index 3d77b716d..578fba861 100644 --- a/src/gui/widgets/tabs/setuptabscroll.h +++ b/src/gui/widgets/tabs/setuptabscroll.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp index 3fa27bbe8..4f1703d31 100644 --- a/src/gui/widgets/tabs/tab.cpp +++ b/src/gui/widgets/tabs/tab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -242,7 +242,7 @@ void Tab::draw(gcn::Graphics *graphics) if (skin1) { const int padding = skin1->getPadding(); - DRAW_IMAGE(g, mImage, padding, padding); + g->drawImage2(mImage, padding, padding); } } } diff --git a/src/gui/widgets/tabs/tab.h b/src/gui/widgets/tabs/tab.h index 0dd5478ce..118b1f0e2 100644 --- a/src/gui/widgets/tabs/tab.h +++ b/src/gui/widgets/tabs/tab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/tradetab.cpp b/src/gui/widgets/tabs/tradetab.cpp index f9e1dc9e0..fbf10dc9b 100644 --- a/src/gui/widgets/tabs/tradetab.cpp +++ b/src/gui/widgets/tabs/tradetab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/tradetab.h b/src/gui/widgets/tabs/tradetab.h index c0670adc4..07d95844e 100644 --- a/src/gui/widgets/tabs/tradetab.h +++ b/src/gui/widgets/tabs/tradetab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabs/whispertab.cpp b/src/gui/widgets/tabs/whispertab.cpp index 58849b623..659704638 100644 --- a/src/gui/widgets/tabs/whispertab.cpp +++ b/src/gui/widgets/tabs/whispertab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -102,8 +102,8 @@ void WhisperTab::showHelp() chatLog(_("/close > Close the whisper tab")); } -bool WhisperTab::handleCommand(const std::string &type, - const std::string &args) +bool WhisperTab::handleCommand(const std::string &restrict type, + const std::string &restrict args) { if (type == "help") { diff --git a/src/gui/widgets/tabs/whispertab.h b/src/gui/widgets/tabs/whispertab.h index db7233525..b3936ab01 100644 --- a/src/gui/widgets/tabs/whispertab.h +++ b/src/gui/widgets/tabs/whispertab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -38,8 +38,8 @@ class WhisperTab final : public ChatTab void showHelp() override final; - bool handleCommand(const std::string &type, - const std::string &args) override final; + bool handleCommand(const std::string &restrict type, + const std::string &restrict args) override final; int getType() const override final A_WARN_UNUSED { return ChatTab::TAB_WHISPER; } diff --git a/src/gui/widgets/tabstrip.cpp b/src/gui/widgets/tabstrip.cpp index 8efd7002f..24c33c614 100644 --- a/src/gui/widgets/tabstrip.cpp +++ b/src/gui/widgets/tabstrip.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/tabstrip.h b/src/gui/widgets/tabstrip.h index 77cc83055..622ccba81 100644 --- a/src/gui/widgets/tabstrip.h +++ b/src/gui/widgets/tabstrip.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index bf79f80ba..f59bc0ceb 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h index fc6f4098a..501744515 100644 --- a/src/gui/widgets/textbox.h +++ b/src/gui/widgets/textbox.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index f176b08fa..ddee77233 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h index 6ee427147..675e9761d 100644 --- a/src/gui/widgets/textfield.h +++ b/src/gui/widgets/textfield.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index bb31993bd..8d473dd46 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h index 8fe6f0e43..eeb6805fb 100644 --- a/src/gui/widgets/textpreview.h +++ b/src/gui/widgets/textpreview.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/vertcontainer.cpp b/src/gui/widgets/vertcontainer.cpp index 947080762..a91f20657 100644 --- a/src/gui/widgets/vertcontainer.cpp +++ b/src/gui/widgets/vertcontainer.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/vertcontainer.h b/src/gui/widgets/vertcontainer.h index 6ba62c254..76f6354dd 100644 --- a/src/gui/widgets/vertcontainer.h +++ b/src/gui/widgets/vertcontainer.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h index 0ab171b3e..f6e94556a 100644 --- a/src/gui/widgets/widget2.h +++ b/src/gui/widgets/widget2.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/widgetgroup.cpp b/src/gui/widgets/widgetgroup.cpp index a85250701..34cbeebb5 100644 --- a/src/gui/widgets/widgetgroup.cpp +++ b/src/gui/widgets/widgetgroup.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/widgetgroup.h b/src/gui/widgets/widgetgroup.h index 94c14c285..3d63b02f8 100644 --- a/src/gui/widgets/widgetgroup.h +++ b/src/gui/widgets/widgetgroup.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 963288a03..cd00d2568 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -278,18 +278,18 @@ void Window::draw(gcn::Graphics *graphics) const Image *const button = mSkin->getCloseImage( mResizeHandles == CLOSE); if (button) - DRAW_IMAGE(g, button, mCloseRect.x, mCloseRect.y); + g->drawImage2(button, mCloseRect.x, mCloseRect.y); } // Draw Sticky Button if (mStickyButton) { const Image *const button = mSkin->getStickyImage(mSticky); if (button) - DRAW_IMAGE(g, button, mStickyRect.x, mStickyRect.y); + g->drawImage2(button, mStickyRect.x, mStickyRect.y); } if (mGrip) - DRAW_IMAGE(g, mGrip, mGripRect.x, mGripRect.y); + g->drawImage2(mGrip, mGripRect.x, mGripRect.y); } // Draw title diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index cad035a1e..757ec8c58 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/widgets/windowcontainer.cpp b/src/gui/widgets/windowcontainer.cpp index cba565cc4..d23f29bad 100644 --- a/src/gui/widgets/windowcontainer.cpp +++ b/src/gui/widgets/windowcontainer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -58,6 +58,26 @@ void WindowContainer::adjustAfterResize(const int oldScreenWidth, } } +void WindowContainer::moveWidgetAfter(gcn::Widget *const after, + gcn::Widget *const widget) +{ + const WidgetListIterator widgetIter = std::find( + mWidgets.begin(), mWidgets.end(), widget); + + if (widgetIter == mWidgets.end()) + return; + + WidgetListIterator afterIter = std::find( + mWidgets.begin(), mWidgets.end(), after); + + if (afterIter == mWidgets.end()) + return; + + ++ afterIter; + mWidgets.erase(widgetIter); + mWidgets.insert(afterIter, widget); +} + #ifdef USE_PROFILER void WindowContainer::draw(gcn::Graphics* graphics) { diff --git a/src/gui/widgets/windowcontainer.h b/src/gui/widgets/windowcontainer.h index 3645b94b6..2ee4ea37d 100644 --- a/src/gui/widgets/windowcontainer.h +++ b/src/gui/widgets/windowcontainer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -53,6 +53,9 @@ class WindowContainer : public Container void adjustAfterResize(const int oldScreenWidth, const int oldScreenHeight); + void moveWidgetAfter(gcn::Widget *const before, + gcn::Widget *const widget); + #ifdef USE_PROFILER void draw(gcn::Graphics* graphics); #endif diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index b69c624fa..a094b5b08 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h index d66ccd184..38ee090a7 100644 --- a/src/gui/windowmenu.h +++ b/src/gui/windowmenu.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/botcheckerwindow.cpp b/src/gui/windows/botcheckerwindow.cpp index 57c3c3712..b94093ebb 100644 --- a/src/gui/windows/botcheckerwindow.cpp +++ b/src/gui/windows/botcheckerwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/botcheckerwindow.h b/src/gui/windows/botcheckerwindow.h index 853cce587..d3615957d 100644 --- a/src/gui/windows/botcheckerwindow.h +++ b/src/gui/windows/botcheckerwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/buydialog.cpp b/src/gui/windows/buydialog.cpp index 21c3aedf7..cfefa8159 100644 --- a/src/gui/windows/buydialog.cpp +++ b/src/gui/windows/buydialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/buydialog.h b/src/gui/windows/buydialog.h index 9fdf2e4d6..e11317cde 100644 --- a/src/gui/windows/buydialog.h +++ b/src/gui/windows/buydialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/buyselldialog.cpp b/src/gui/windows/buyselldialog.cpp index d26b0ceb8..22f39f449 100644 --- a/src/gui/windows/buyselldialog.cpp +++ b/src/gui/windows/buyselldialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/buyselldialog.h b/src/gui/windows/buyselldialog.h index dfcd761d4..34a716ee1 100644 --- a/src/gui/windows/buyselldialog.h +++ b/src/gui/windows/buyselldialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/changeemaildialog.cpp b/src/gui/windows/changeemaildialog.cpp index 0de011722..a9f3b3449 100644 --- a/src/gui/windows/changeemaildialog.cpp +++ b/src/gui/windows/changeemaildialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/changeemaildialog.h b/src/gui/windows/changeemaildialog.h index ebb9ee8a7..31ffa7b39 100644 --- a/src/gui/windows/changeemaildialog.h +++ b/src/gui/windows/changeemaildialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/changepassworddialog.cpp b/src/gui/windows/changepassworddialog.cpp index 59e95be4b..4646947fa 100644 --- a/src/gui/windows/changepassworddialog.cpp +++ b/src/gui/windows/changepassworddialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/changepassworddialog.h b/src/gui/windows/changepassworddialog.h index cd1596ab3..ce45e6f47 100644 --- a/src/gui/windows/changepassworddialog.h +++ b/src/gui/windows/changepassworddialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 5164c89b6..cbce28db7 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h index 0204c9622..0d73bf805 100644 --- a/src/gui/windows/charcreatedialog.h +++ b/src/gui/windows/charcreatedialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp index c7ea77784..3f44617f8 100644 --- a/src/gui/windows/charselectdialog.cpp +++ b/src/gui/windows/charselectdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/charselectdialog.h b/src/gui/windows/charselectdialog.h index 34d7c155e..3ac5d664f 100644 --- a/src/gui/windows/charselectdialog.h +++ b/src/gui/windows/charselectdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index ea7a372d4..015e58b61 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -1452,7 +1452,7 @@ std::string ChatWindow::autoCompleteHistory(const std::string &partName) const return autoComplete(nameList, partName); } -void ChatWindow::resortChatLog(std::string line, Own own, +bool ChatWindow::resortChatLog(std::string line, Own own, const std::string &channel, const bool ignoreRecord, const bool tryRemoveColors) @@ -1470,7 +1470,7 @@ void ChatWindow::resortChatLog(std::string line, Own own, { tradeChatTab->chatLog(prefix + line, own, ignoreRecord, tryRemoveColors); - return; + return false; } size_t idx2 = line.find(": "); @@ -1479,13 +1479,35 @@ void ChatWindow::resortChatLog(std::string line, Own own, const size_t idx = line.find(": \302\202"); if (idx == idx2) { - // ignore special message formats. if (line.find(": \302\202\302") != std::string::npos) - return; + { + if (line.find(": \302\202\302e") != std::string::npos) + { + const std::string nick = line.substr(0, idx2 - 1); + line = line.substr(idx2 + 6); + localPetEmote(nick, atoi(line.c_str())); + } + // ignore other special message formats. + return false; + } + + // pet talk message detected + if (line.find(": \302\202\303 ") != std::string::npos) + { + if (actorManager && idx2 > 1) + { + const std::string nick = line.substr(0, idx2 - 1); + line = line.substr(idx2 + 6); + localPetSay(nick, line); + } + + return false; + } + line = line.erase(idx + 2, 2); tradeChatTab->chatLog(prefix + line, own, ignoreRecord, tryRemoveColors); - return; + return false; } } @@ -1502,7 +1524,7 @@ void ChatWindow::resortChatLog(std::string line, Own own, { tradeChatTab->chatLog(prefix + line, own, ignoreRecord, tryRemoveColors); - return; + return false; } } } @@ -1533,6 +1555,7 @@ void ChatWindow::resortChatLog(std::string line, Own own, { localChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors); } + return true; } void ChatWindow::battleChatLog(const std::string &line, Own own, @@ -1547,6 +1570,43 @@ void ChatWindow::battleChatLog(const std::string &line, Own own, debugChatTab->chatLog(line, own, ignoreRecord, tryRemoveColors); } +void ChatWindow::localPetSay(const std::string &nick, const std::string &text) +{ + Being *const being = actorManager->findBeingByName( + nick, ActorSprite::PLAYER); + Being *pet = nullptr; + if (being) + { + pet = being->getPet(); + if (pet) + pet->setSpeech(text, GENERAL_CHANNEL); + } + + if (!localChatTab) + return; + if (pet) + { + // TRANSLATORS: owners pet name. For example: 4144's pet + localChatTab->chatLog(strprintf(_("%s's pet"), nick.c_str()), text); + } + else + { + localChatTab->chatLog(nick, text); + } +} + +void ChatWindow::localPetEmote(const std::string &nick, const uint8_t emoteId) +{ + Being *const being = actorManager->findBeingByName( + nick, ActorSprite::PLAYER); + if (being) + { + Being *const pet = being->getPet(); + if (pet) + pet->setEmote(emoteId, 0); + } +} + void ChatWindow::initTradeFilter() { const std::string tradeListName = client->getServerConfigDirectory() diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h index d93e2ce94..014eceb5a 100644 --- a/src/gui/windows/chatwindow.h +++ b/src/gui/windows/chatwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -233,7 +233,7 @@ class ChatWindow final : public Window, void ignoreAllWhispers(); - void resortChatLog(std::string line, Own own, + bool resortChatLog(std::string line, Own own, const std::string &channel, const bool ignoreRecord, const bool tryRemoveColors); @@ -292,6 +292,12 @@ class ChatWindow final : public Window, void postInit() override final; + static void localPetSay(const std::string &nick, + const std::string &text); + + static void localPetEmote(const std::string &nick, + const uint8_t emoteId); + #ifdef USE_PROFILER void logicChildren(); #endif diff --git a/src/gui/windows/confirmdialog.cpp b/src/gui/windows/confirmdialog.cpp index 57be72105..e48427a5b 100644 --- a/src/gui/windows/confirmdialog.cpp +++ b/src/gui/windows/confirmdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/confirmdialog.h b/src/gui/windows/confirmdialog.h index c864b1bb8..0b092e234 100644 --- a/src/gui/windows/confirmdialog.h +++ b/src/gui/windows/confirmdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/connectiondialog.cpp b/src/gui/windows/connectiondialog.cpp index 9b777f7e5..6d01dcaae 100644 --- a/src/gui/windows/connectiondialog.cpp +++ b/src/gui/windows/connectiondialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/connectiondialog.h b/src/gui/windows/connectiondialog.h index 677134bc0..2f861bc52 100644 --- a/src/gui/windows/connectiondialog.h +++ b/src/gui/windows/connectiondialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp index cb5e06c3d..02a79d0de 100644 --- a/src/gui/windows/debugwindow.cpp +++ b/src/gui/windows/debugwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/debugwindow.h b/src/gui/windows/debugwindow.h index 43b4dbc74..13e73c29e 100644 --- a/src/gui/windows/debugwindow.h +++ b/src/gui/windows/debugwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp index 7dfc2e681..37c970562 100644 --- a/src/gui/windows/didyouknowwindow.cpp +++ b/src/gui/windows/didyouknowwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/didyouknowwindow.h b/src/gui/windows/didyouknowwindow.h index 0af9d7f24..942bcf41c 100644 --- a/src/gui/windows/didyouknowwindow.h +++ b/src/gui/windows/didyouknowwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/editdialog.cpp b/src/gui/windows/editdialog.cpp index 872ba83f5..502b71ecb 100644 --- a/src/gui/windows/editdialog.cpp +++ b/src/gui/windows/editdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/editdialog.h b/src/gui/windows/editdialog.h index a8916e760..74242ed52 100644 --- a/src/gui/windows/editdialog.h +++ b/src/gui/windows/editdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/editserverdialog.cpp b/src/gui/windows/editserverdialog.cpp index 402f31e8d..900fe840b 100644 --- a/src/gui/windows/editserverdialog.cpp +++ b/src/gui/windows/editserverdialog.cpp @@ -1,7 +1,7 @@ /* * The Mana Client * Copyright (C) 2011-2012 The Mana Developers - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/editserverdialog.h b/src/gui/windows/editserverdialog.h index 8d519af33..525005429 100644 --- a/src/gui/windows/editserverdialog.h +++ b/src/gui/windows/editserverdialog.h @@ -1,7 +1,7 @@ /* * The Mana Client * Copyright (C) 2011-2012 The Mana Developers - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The Mana Client. * diff --git a/src/gui/windows/emotewindow.cpp b/src/gui/windows/emotewindow.cpp index b2b702e4b..9dd5f648c 100644 --- a/src/gui/windows/emotewindow.cpp +++ b/src/gui/windows/emotewindow.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/emotewindow.h b/src/gui/windows/emotewindow.h index b73184546..0f15b7bc6 100644 --- a/src/gui/windows/emotewindow.h +++ b/src/gui/windows/emotewindow.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 9fe03d1cc..f521f4b9b 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -202,13 +202,9 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) if (!box) continue; if (i == mSelected) - { - DRAW_IMAGE(g, mSlotHighlightedBackground, box->x, box->y); - } + g->drawImage2(mSlotHighlightedBackground, box->x, box->y); else - { - DRAW_IMAGE(g, mSlotBackground, box->x, box->y); - } + g->drawImage2(mSlotBackground, box->x, box->y); } } @@ -234,7 +230,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) { image->setAlpha(1.0F); // Ensure the image is drawn // with maximum opacity - DRAW_IMAGE(g, image, box->x + mItemPadding, + g->drawImage2(image, box->x + mItemPadding, box->y + mItemPadding); if (i == EQUIP_PROJECTILE_SLOT) { @@ -248,7 +244,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) } else if (box->image) { - DRAW_IMAGE(g, box->image, box->x + mItemPadding, + g->drawImage2(box->image, box->x + mItemPadding, box->y + mItemPadding); } } diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h index e3508e504..1877d1309 100644 --- a/src/gui/windows/equipmentwindow.h +++ b/src/gui/windows/equipmentwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp index 7be2f65b1..854ac8cbd 100644 --- a/src/gui/windows/helpwindow.cpp +++ b/src/gui/windows/helpwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/helpwindow.h b/src/gui/windows/helpwindow.h index 7261d8875..72c0d4aba 100644 --- a/src/gui/windows/helpwindow.h +++ b/src/gui/windows/helpwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index bdc0b342e..da91b84be 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -117,7 +117,8 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): mRetrieveButton(nullptr), mInvCloseButton(nullptr), mWeightBar(nullptr), - mSlotsBar(new ProgressBar(this, 0.0F, 100, 0, Theme::PROG_INVY_SLOTS)), + mSlotsBar(new ProgressBar(this, 0.0F, 100, 0, Theme::PROG_INVY_SLOTS, + "slotsprogressbar.xml", "slotsprogressbar_fill.xml")), mFilter(nullptr), mSortModel(new SortListModelInv), mSortDropDown(new DropDown(this, mSortModel, false, false, this, "sort")), @@ -225,7 +226,8 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): mShopButton = new Button(this, _("Shop"), "shop", this); // TRANSLATORS: inventory button mEquipmentButton = new Button(this, _("Equipment"), "equipment", this); - mWeightBar = new ProgressBar(this, 0.0F, 100, 0, Theme::PROG_WEIGHT); + mWeightBar = new ProgressBar(this, 0.0F, 100, 0, Theme::PROG_WEIGHT, + "weightprogressbar.xml", "weightprogressbar_fill.xml"); mWeightBar->setColor(Theme::getThemeColor(Theme::WEIGHT_BAR), Theme::getThemeColor(Theme::WEIGHT_BAR_OUTLINE)); diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h index a5fabe8f2..4e32f6fa2 100644 --- a/src/gui/windows/inventorywindow.h +++ b/src/gui/windows/inventorywindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp index 5e613cc62..975892888 100644 --- a/src/gui/windows/itemamountwindow.cpp +++ b/src/gui/windows/itemamountwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/itemamountwindow.h b/src/gui/windows/itemamountwindow.h index 68953fbc9..7625c4a71 100644 --- a/src/gui/windows/itemamountwindow.h +++ b/src/gui/windows/itemamountwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/killstats.cpp b/src/gui/windows/killstats.cpp index 821577d25..0adabc3ad 100644 --- a/src/gui/windows/killstats.cpp +++ b/src/gui/windows/killstats.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/killstats.h b/src/gui/windows/killstats.h index 18453e2ff..094147383 100644 --- a/src/gui/windows/killstats.h +++ b/src/gui/windows/killstats.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/logindialog.cpp b/src/gui/windows/logindialog.cpp index 4162af961..8ec6144a0 100644 --- a/src/gui/windows/logindialog.cpp +++ b/src/gui/windows/logindialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/logindialog.h b/src/gui/windows/logindialog.h index 937e4a31d..c9d2ad61f 100644 --- a/src/gui/windows/logindialog.h +++ b/src/gui/windows/logindialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 6db0b5388..177be8a74 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -286,7 +286,7 @@ void Minimap::draw(gcn::Graphics *graphics) mMapOriginY = 0; } - DRAW_IMAGE(graph, mMapImage, mMapOriginX, mMapOriginY); + graph->drawImage2(mMapImage, mMapOriginX, mMapOriginY); } const ActorSprites &actors = actorManager->getAll(); diff --git a/src/gui/windows/minimap.h b/src/gui/windows/minimap.h index d5fdef841..90c08db0f 100644 --- a/src/gui/windows/minimap.h +++ b/src/gui/windows/minimap.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index 4d1a0ba82..cfc8f1e12 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -63,33 +63,45 @@ MiniStatusWindow::MiniStatusWindow() : mMaxX(0), // TRANSLATORS: status bar name mHpBar(createBar(0, 100, 0, Theme::HP_BAR, Theme::PROG_HP, + "hpprogressbar.xml", "hpprogressbar_fill.xml", "hp bar", _("health bar"))), mMpBar(Net::getGameHandler()->canUseMagicBar() ? createBar(0, 100, 0, Net::getPlayerHandler()->canUseMagic() ? Theme::MP_BAR : Theme::NO_MP_BAR, Net::getPlayerHandler()->canUseMagic() + ? Theme::PROG_MP : Theme::PROG_NO_MP, + Net::getPlayerHandler()->canUseMagic() + ? "mpprogressbar.xml" : "nompprogressbar.xml", + Net::getPlayerHandler()->canUseMagic() + ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml", // TRANSLATORS: status bar name - ? Theme::PROG_MP : Theme::PROG_NO_MP, "mp bar", _("mana bar")) - : nullptr), + "mp bar", _("mana bar")) : nullptr), mXpBar(createBar(0, 100, 0, Theme::XP_BAR, Theme::PROG_EXP, + "xpprogressbar.xml", "xpprogressbar_fill.xml", // TRANSLATORS: status bar name "xp bar", _("experience bar"))), mJobBar(nullptr), mWeightBar(createBar(0, 140, 0, Theme::WEIGHT_BAR, Theme::PROG_WEIGHT, + "weightprogressbar.xml", "weightprogressbar_fill.xml", // TRANSLATORS: status bar name "weight bar", _("weight bar"))), mInvSlotsBar(createBar(0, 45, 0, Theme::SLOTS_BAR, Theme::PROG_INVY_SLOTS, + "slotsprogressbar.xml", "slotsprogressbar_fill.xml", + "inventory slots bar", // TRANSLATORS: status bar name - "inventory slots bar", _("inventory slots bar"))), + _("inventory slots bar"))), mMoneyBar(createBar(0, 130, 0, Theme::MONEY_BAR, Theme::PROG_MONEY, + "moneyprogressbar.xml", "moneyprogressbar_fill.xml", // TRANSLATORS: status bar name "money bar", _("money bar"))), mArrowsBar(createBar(0, 50, 0, Theme::ARROWS_BAR, Theme::PROG_ARROWS, + "arrowsprogressbar.xml", "arrowsprogressbar_fill.xml", // TRANSLATORS: status bar name "arrows bar", _("arrows bar"))), mStatusBar(createBar(100, (config.getIntValue("fontSize") > 16 ? 250 : 165), 0, Theme::STATUS_BAR, Theme::PROG_STATUS, + "statusprogressbar.xml", "statusprogressbar_fill.xml", // TRANSLATORS: status bar name "status bar", _("status bar"))), mTextPopup(new TextPopup), @@ -114,6 +126,7 @@ MiniStatusWindow::MiniStatusWindow() : { mJobBar = createBar(0, 100, 0, Theme::JOB_BAR, Theme::PROG_JOB, // TRANSLATORS: status bar name + "jobprogressbar.xml", "jobprogressbar_fill.xml", "job bar", _("job bar")); StatusWindow::updateJobBar(mJobBar); } @@ -160,12 +173,14 @@ ProgressBar *MiniStatusWindow::createBar(const float progress, const int width, const int height, const int textColor, const int backColor, + const std::string &restrict skin, + const std::string &restrict skinFill, const std::string &restrict name, const std::string &restrict description) { ProgressBar *const bar = new ProgressBar(this, - progress, width, height, backColor); + progress, width, height, backColor, skin, skinFill); bar->setActionEventId(name); bar->setId(description); bar->setColor(Theme::getThemeColor(textColor), diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index f40518d9b..2a5903eca 100644 --- a/src/gui/windows/ministatuswindow.h +++ b/src/gui/windows/ministatuswindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -99,6 +99,8 @@ class MiniStatusWindow final : public Popup, ProgressBar *createBar(const float progress, const int width, const int height, const int textColor, const int backColor, + const std::string &restrict skin, + const std::string &restrict skinFill, const std::string &restrict name, const std::string &restrict description) A_WARN_UNUSED; diff --git a/src/gui/windows/npcdialog.cpp b/src/gui/windows/npcdialog.cpp index 36f7bedc8..b441b724c 100644 --- a/src/gui/windows/npcdialog.cpp +++ b/src/gui/windows/npcdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h index 1736f5567..af68594cd 100644 --- a/src/gui/windows/npcdialog.h +++ b/src/gui/windows/npcdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/npcpostdialog.cpp b/src/gui/windows/npcpostdialog.cpp index de1f2b0e7..63ae6f53b 100644 --- a/src/gui/windows/npcpostdialog.cpp +++ b/src/gui/windows/npcpostdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/npcpostdialog.h b/src/gui/windows/npcpostdialog.h index b40eaf334..e111f150e 100644 --- a/src/gui/windows/npcpostdialog.h +++ b/src/gui/windows/npcpostdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/okdialog.cpp b/src/gui/windows/okdialog.cpp index 93739ba26..c16123abd 100644 --- a/src/gui/windows/okdialog.cpp +++ b/src/gui/windows/okdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/okdialog.h b/src/gui/windows/okdialog.h index c33400c34..7d2ff070b 100644 --- a/src/gui/windows/okdialog.h +++ b/src/gui/windows/okdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index c242f5d85..c5df4b652 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -348,7 +348,7 @@ void OutfitWindow::draw(gcn::Graphics *graphics) const Image *const image = item->getImage(); if (image) { - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); foundItem = true; } } @@ -359,7 +359,7 @@ void OutfitWindow::draw(gcn::Graphics *graphics) mItemColors[mCurrentOutfit][i]); if (image) { - DRAW_IMAGE(g, image, itemX, itemY); + g->drawImage2(image, itemX, itemY); image->decRef(); } } diff --git a/src/gui/windows/outfitwindow.h b/src/gui/windows/outfitwindow.h index 96f3329a1..4f6e5c0bf 100644 --- a/src/gui/windows/outfitwindow.h +++ b/src/gui/windows/outfitwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp index 42a7b0bf4..0cd04dbc1 100644 --- a/src/gui/windows/questswindow.cpp +++ b/src/gui/windows/questswindow.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/questswindow.h b/src/gui/windows/questswindow.h index fe970715a..5b008e93e 100644 --- a/src/gui/windows/questswindow.h +++ b/src/gui/windows/questswindow.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/quitdialog.cpp b/src/gui/windows/quitdialog.cpp index 03a7697db..ff9f669b7 100644 --- a/src/gui/windows/quitdialog.cpp +++ b/src/gui/windows/quitdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -195,6 +195,7 @@ void QuitDialog::action(const gcn::ActionEvent &event) { Net::getCharServerHandler()->switchCharacter(); Game::closeDialogs(); + serverConfig.write(); } } } diff --git a/src/gui/windows/quitdialog.h b/src/gui/windows/quitdialog.h index 1870554f6..ab395c7f4 100644 --- a/src/gui/windows/quitdialog.h +++ b/src/gui/windows/quitdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/registerdialog.cpp b/src/gui/windows/registerdialog.cpp index d0d504f8a..1867b6b40 100644 --- a/src/gui/windows/registerdialog.cpp +++ b/src/gui/windows/registerdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/registerdialog.h b/src/gui/windows/registerdialog.h index 3cded7d58..66c3e40b7 100644 --- a/src/gui/windows/registerdialog.h +++ b/src/gui/windows/registerdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/selldialog.cpp b/src/gui/windows/selldialog.cpp index bded5bc24..15389a9c3 100644 --- a/src/gui/windows/selldialog.cpp +++ b/src/gui/windows/selldialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/selldialog.h b/src/gui/windows/selldialog.h index eae33531f..15db28f10 100644 --- a/src/gui/windows/selldialog.h +++ b/src/gui/windows/selldialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index dfe7d3052..971f3c5a5 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h index a07ab0339..ad6f554c6 100644 --- a/src/gui/windows/serverdialog.h +++ b/src/gui/windows/serverdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/setup.cpp b/src/gui/windows/setup.cpp index 8b7605374..995e6beac 100644 --- a/src/gui/windows/setup.cpp +++ b/src/gui/windows/setup.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/setup.h b/src/gui/windows/setup.h index 9d3696f7f..1b484b726 100644 --- a/src/gui/windows/setup.h +++ b/src/gui/windows/setup.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/shopwindow.cpp b/src/gui/windows/shopwindow.cpp index c4facdc02..48bfedb06 100644 --- a/src/gui/windows/shopwindow.cpp +++ b/src/gui/windows/shopwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/shopwindow.h b/src/gui/windows/shopwindow.h index 02395ba3a..590a05dcc 100644 --- a/src/gui/windows/shopwindow.h +++ b/src/gui/windows/shopwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/shortcutwindow.cpp b/src/gui/windows/shortcutwindow.cpp index 0bbd77401..1d9fa88c2 100644 --- a/src/gui/windows/shortcutwindow.cpp +++ b/src/gui/windows/shortcutwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/shortcutwindow.h b/src/gui/windows/shortcutwindow.h index f7fc01c9f..b7d7f70a1 100644 --- a/src/gui/windows/shortcutwindow.h +++ b/src/gui/windows/shortcutwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index b21f0c09b..fc44fdf65 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -134,7 +134,7 @@ class SkillListBox final : public ListBox const SkillData *const data = e->data; const int yPad = y + mPadding; const std::string &description = data->description; - DRAW_IMAGE(graphics, data->icon, mPadding, yPad); + graphics->drawImage2(data->icon, mPadding, yPad); font->drawString(graphics, data->name, mTextPadding, yPad); if (!description.empty()) { diff --git a/src/gui/windows/skilldialog.h b/src/gui/windows/skilldialog.h index ac81d9084..600ea4d34 100644 --- a/src/gui/windows/skilldialog.h +++ b/src/gui/windows/skilldialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp index 1ce3fbd07..1c6b85153 100644 --- a/src/gui/windows/socialwindow.cpp +++ b/src/gui/windows/socialwindow.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/socialwindow.h b/src/gui/windows/socialwindow.h index 6cb1b252f..018b5f32c 100644 --- a/src/gui/windows/socialwindow.h +++ b/src/gui/windows/socialwindow.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/statuswindow.cpp b/src/gui/windows/statuswindow.cpp index 2cf1e9168..567460927 100644 --- a/src/gui/windows/statuswindow.cpp +++ b/src/gui/windows/statuswindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -191,15 +191,16 @@ StatusWindow::StatusWindow() : max = 1; mHpBar = new ProgressBar(this, static_cast<float>(PlayerInfo::getAttribute( - PlayerInfo::HP)) / static_cast<float>(max), 80, 0, Theme::PROG_HP); + PlayerInfo::HP)) / static_cast<float>(max), 80, 0, Theme::PROG_HP, + "hpprogressbar.xml", "hpprogressbar_fill.xml"); mHpBar->setColor(Theme::getThemeColor(Theme::HP_BAR), Theme::getThemeColor(Theme::HP_BAR_OUTLINE)); max = PlayerInfo::getAttribute(PlayerInfo::EXP_NEEDED); mXpBar = new ProgressBar(this, max ? static_cast<float>(PlayerInfo::getAttribute(PlayerInfo::EXP)) - / static_cast<float>(max): - static_cast<float>(0), 80, 0, Theme::PROG_EXP); + / static_cast<float>(max) : static_cast<float>(0), 80, 0, + Theme::PROG_EXP, "xpprogressbar.xml", "xpprogressbar_fill.xml"); mXpBar->setColor(Theme::getThemeColor(Theme::XP_BAR), Theme::getThemeColor(Theme::XP_BAR_OUTLINE)); @@ -216,7 +217,9 @@ StatusWindow::StatusWindow() : mMpBar = new ProgressBar(this, max ? static_cast<float>( PlayerInfo::getAttribute(PlayerInfo::MAX_MP)) / static_cast<float>(max) : static_cast<float>(0), - 80, 0, useMagic ? Theme::PROG_MP : Theme::PROG_NO_MP); + 80, 0, useMagic ? Theme::PROG_MP : Theme::PROG_NO_MP, + useMagic ? "mpprogressbar.xml" : "nompprogressbar.xml", + useMagic ? "mpprogressbar_fill.xml" : "nompprogressbar_fill.xml"); if (useMagic) { mMpBar->setColor(Theme::getThemeColor(Theme::MP_BAR), @@ -255,7 +258,8 @@ StatusWindow::StatusWindow() : mJobLvlLabel = new Label(this, strprintf(_("Job: %d"), 0)); // TRANSLATORS: status window label mJobLabel = new Label(this, _("Job:")); - mJobBar = new ProgressBar(this, 0.0F, 80, 0, Theme::PROG_JOB); + mJobBar = new ProgressBar(this, 0.0F, 80, 0, Theme::PROG_JOB, + "jobprogressbar.xml", "jobprogressbar_fill.xml"); mJobBar->setColor(Theme::getThemeColor(Theme::JOB_BAR), Theme::getThemeColor(Theme::JOB_BAR_OUTLINE)); diff --git a/src/gui/windows/statuswindow.h b/src/gui/windows/statuswindow.h index 762ce4e08..414449df0 100644 --- a/src/gui/windows/statuswindow.h +++ b/src/gui/windows/statuswindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/textcommandeditor.cpp b/src/gui/windows/textcommandeditor.cpp index e7302e527..4ae098a3c 100644 --- a/src/gui/windows/textcommandeditor.cpp +++ b/src/gui/windows/textcommandeditor.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/textcommandeditor.h b/src/gui/windows/textcommandeditor.h index fb16ff4bb..a31cdbaf2 100644 --- a/src/gui/windows/textcommandeditor.h +++ b/src/gui/windows/textcommandeditor.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/textdialog.cpp b/src/gui/windows/textdialog.cpp index 51bd46d82..936f08c76 100644 --- a/src/gui/windows/textdialog.cpp +++ b/src/gui/windows/textdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/textdialog.h b/src/gui/windows/textdialog.h index 6c18cace2..9bfb4ae5f 100644 --- a/src/gui/windows/textdialog.h +++ b/src/gui/windows/textdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp index f0052e46b..dfdc53a5c 100644 --- a/src/gui/windows/tradewindow.cpp +++ b/src/gui/windows/tradewindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/tradewindow.h b/src/gui/windows/tradewindow.h index d9970f083..ac49c1f52 100644 --- a/src/gui/windows/tradewindow.h +++ b/src/gui/windows/tradewindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/unregisterdialog.cpp b/src/gui/windows/unregisterdialog.cpp index 4372ee94d..76afb1539 100644 --- a/src/gui/windows/unregisterdialog.cpp +++ b/src/gui/windows/unregisterdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/unregisterdialog.h b/src/gui/windows/unregisterdialog.h index 5cd612214..fd40810ac 100644 --- a/src/gui/windows/unregisterdialog.h +++ b/src/gui/windows/unregisterdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/updaterwindow.cpp b/src/gui/windows/updaterwindow.cpp index 003529fbc..099142cbe 100644 --- a/src/gui/windows/updaterwindow.cpp +++ b/src/gui/windows/updaterwindow.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -179,7 +179,8 @@ UpdaterWindow::UpdaterWindow(const std::string &restrict updateHost, mCancelButton(new Button(this, _("Cancel"), "cancel", this)), // TRANSLATORS: updater window button mPlayButton(new Button(this, _("Play"), "play", this)), - mProgressBar(new ProgressBar(this, 0.0, 310, 0, Theme::PROG_UPDATE)), + mProgressBar(new ProgressBar(this, 0.0, 310, 0, Theme::PROG_UPDATE, + "updateprogressbar.xml", "updateprogressbar_fill.xml")), mBrowserBox(new BrowserBox(this, BrowserBox::AUTO_SIZE, true, "browserbox.xml")), mScrollArea(new ScrollArea(mBrowserBox, true, "update_background.xml")), diff --git a/src/gui/windows/updaterwindow.h b/src/gui/windows/updaterwindow.h index e15a6d9e8..433ab82ad 100644 --- a/src/gui/windows/updaterwindow.h +++ b/src/gui/windows/updaterwindow.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 52b515c81..fd54076ed 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/whoisonline.h b/src/gui/windows/whoisonline.h index 5be22c73d..1057f1898 100644 --- a/src/gui/windows/whoisonline.h +++ b/src/gui/windows/whoisonline.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/worldselectdialog.cpp b/src/gui/windows/worldselectdialog.cpp index e5ddbee6d..a3fd0fc73 100644 --- a/src/gui/windows/worldselectdialog.cpp +++ b/src/gui/windows/worldselectdialog.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/gui/windows/worldselectdialog.h b/src/gui/windows/worldselectdialog.h index 21156d613..f7491689b 100644 --- a/src/gui/windows/worldselectdialog.h +++ b/src/gui/windows/worldselectdialog.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/guichan/actionevent.cpp b/src/guichan/actionevent.cpp index a2f80b19d..66e9c4529 100644 --- a/src/guichan/actionevent.cpp +++ b/src/guichan/actionevent.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/basiccontainer.cpp b/src/guichan/basiccontainer.cpp index 12093b19f..9fc57672f 100644 --- a/src/guichan/basiccontainer.cpp +++ b/src/guichan/basiccontainer.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/cliprectangle.cpp b/src/guichan/cliprectangle.cpp index bb5547211..666782eb3 100644 --- a/src/guichan/cliprectangle.cpp +++ b/src/guichan/cliprectangle.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/color.cpp b/src/guichan/color.cpp index 42e4a3f57..cda98c8e2 100644 --- a/src/guichan/color.cpp +++ b/src/guichan/color.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/event.cpp b/src/guichan/event.cpp index ecd309f87..e25c8cce1 100644 --- a/src/guichan/event.cpp +++ b/src/guichan/event.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/exception.cpp b/src/guichan/exception.cpp index b55ae6b0a..9d233c935 100644 --- a/src/guichan/exception.cpp +++ b/src/guichan/exception.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/focushandler.cpp b/src/guichan/focushandler.cpp index 2b8079eb7..10a0ff542 100644 --- a/src/guichan/focushandler.cpp +++ b/src/guichan/focushandler.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/font.cpp b/src/guichan/font.cpp index 32968bc84..72c378344 100644 --- a/src/guichan/font.cpp +++ b/src/guichan/font.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/graphics.cpp b/src/guichan/graphics.cpp index 0f4af464b..26098ecb5 100644 --- a/src/guichan/graphics.cpp +++ b/src/guichan/graphics.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/gui.cpp b/src/guichan/gui.cpp index 4ba60089a..57d149b8b 100644 --- a/src/guichan/gui.cpp +++ b/src/guichan/gui.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/image.cpp b/src/guichan/image.cpp index 5e3af0716..26764630f 100644 --- a/src/guichan/image.cpp +++ b/src/guichan/image.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/actionevent.hpp b/src/guichan/include/guichan/actionevent.hpp index 4d130501d..02ef089b6 100644 --- a/src/guichan/include/guichan/actionevent.hpp +++ b/src/guichan/include/guichan/actionevent.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/actionlistener.hpp b/src/guichan/include/guichan/actionlistener.hpp index 37970af5f..7d8ff33a8 100644 --- a/src/guichan/include/guichan/actionlistener.hpp +++ b/src/guichan/include/guichan/actionlistener.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/basiccontainer.hpp b/src/guichan/include/guichan/basiccontainer.hpp index 40140b887..a17b7314c 100644 --- a/src/guichan/include/guichan/basiccontainer.hpp +++ b/src/guichan/include/guichan/basiccontainer.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/cliprectangle.hpp b/src/guichan/include/guichan/cliprectangle.hpp index 51887c032..bda344897 100644 --- a/src/guichan/include/guichan/cliprectangle.hpp +++ b/src/guichan/include/guichan/cliprectangle.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/color.hpp b/src/guichan/include/guichan/color.hpp index 6fb650655..56d72a387 100644 --- a/src/guichan/include/guichan/color.hpp +++ b/src/guichan/include/guichan/color.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/deathlistener.hpp b/src/guichan/include/guichan/deathlistener.hpp index 360032289..3e7884021 100644 --- a/src/guichan/include/guichan/deathlistener.hpp +++ b/src/guichan/include/guichan/deathlistener.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/event.hpp b/src/guichan/include/guichan/event.hpp index b4c5abcf7..fa3220d51 100644 --- a/src/guichan/include/guichan/event.hpp +++ b/src/guichan/include/guichan/event.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/exception.hpp b/src/guichan/include/guichan/exception.hpp index bbf8b31ce..63809196d 100644 --- a/src/guichan/include/guichan/exception.hpp +++ b/src/guichan/include/guichan/exception.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/focushandler.hpp b/src/guichan/include/guichan/focushandler.hpp index 3e1402264..2eba92d1c 100644 --- a/src/guichan/include/guichan/focushandler.hpp +++ b/src/guichan/include/guichan/focushandler.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/focuslistener.hpp b/src/guichan/include/guichan/focuslistener.hpp index 7e95ceb4d..32d891800 100644 --- a/src/guichan/include/guichan/focuslistener.hpp +++ b/src/guichan/include/guichan/focuslistener.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/font.hpp b/src/guichan/include/guichan/font.hpp index b400b9cb6..b4550e4fe 100644 --- a/src/guichan/include/guichan/font.hpp +++ b/src/guichan/include/guichan/font.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/graphics.hpp b/src/guichan/include/guichan/graphics.hpp index a8217d50d..831e2601a 100644 --- a/src/guichan/include/guichan/graphics.hpp +++ b/src/guichan/include/guichan/graphics.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/gui.hpp b/src/guichan/include/guichan/gui.hpp index d42a11255..0aa843653 100644 --- a/src/guichan/include/guichan/gui.hpp +++ b/src/guichan/include/guichan/gui.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/image.hpp b/src/guichan/include/guichan/image.hpp index 2baa06fb2..ec2b37188 100644 --- a/src/guichan/include/guichan/image.hpp +++ b/src/guichan/include/guichan/image.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/input.hpp b/src/guichan/include/guichan/input.hpp index 2a22ce965..538e78e3c 100644 --- a/src/guichan/include/guichan/input.hpp +++ b/src/guichan/include/guichan/input.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/inputevent.hpp b/src/guichan/include/guichan/inputevent.hpp index 670b7099b..732886de8 100644 --- a/src/guichan/include/guichan/inputevent.hpp +++ b/src/guichan/include/guichan/inputevent.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/key.hpp b/src/guichan/include/guichan/key.hpp index 8a2a9a13d..086969b65 100644 --- a/src/guichan/include/guichan/key.hpp +++ b/src/guichan/include/guichan/key.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/keyevent.hpp b/src/guichan/include/guichan/keyevent.hpp index 61848192d..4ccb1bf8e 100644 --- a/src/guichan/include/guichan/keyevent.hpp +++ b/src/guichan/include/guichan/keyevent.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/keyinput.hpp b/src/guichan/include/guichan/keyinput.hpp index 09d46857c..f38bd4d58 100644 --- a/src/guichan/include/guichan/keyinput.hpp +++ b/src/guichan/include/guichan/keyinput.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/keylistener.hpp b/src/guichan/include/guichan/keylistener.hpp index 427a8adbb..68657dd0a 100644 --- a/src/guichan/include/guichan/keylistener.hpp +++ b/src/guichan/include/guichan/keylistener.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/listmodel.hpp b/src/guichan/include/guichan/listmodel.hpp index 640c3fcc5..7e46dae4d 100644 --- a/src/guichan/include/guichan/listmodel.hpp +++ b/src/guichan/include/guichan/listmodel.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/mouseevent.hpp b/src/guichan/include/guichan/mouseevent.hpp index ca39e388c..dd385106a 100644 --- a/src/guichan/include/guichan/mouseevent.hpp +++ b/src/guichan/include/guichan/mouseevent.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/mouseinput.hpp b/src/guichan/include/guichan/mouseinput.hpp index 287e905ec..5037f786a 100644 --- a/src/guichan/include/guichan/mouseinput.hpp +++ b/src/guichan/include/guichan/mouseinput.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/mouselistener.hpp b/src/guichan/include/guichan/mouselistener.hpp index 2ed75e5ba..18bf5c062 100644 --- a/src/guichan/include/guichan/mouselistener.hpp +++ b/src/guichan/include/guichan/mouselistener.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/platform.hpp b/src/guichan/include/guichan/platform.hpp index e27d87def..a1a730d53 100644 --- a/src/guichan/include/guichan/platform.hpp +++ b/src/guichan/include/guichan/platform.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/rectangle.hpp b/src/guichan/include/guichan/rectangle.hpp index 5df69fec5..de32fbb99 100644 --- a/src/guichan/include/guichan/rectangle.hpp +++ b/src/guichan/include/guichan/rectangle.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/sdl/sdlpixel.hpp b/src/guichan/include/guichan/sdl/sdlpixel.hpp index 4ec6b2386..ab457bc48 100644 --- a/src/guichan/include/guichan/sdl/sdlpixel.hpp +++ b/src/guichan/include/guichan/sdl/sdlpixel.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/selectionevent.hpp b/src/guichan/include/guichan/selectionevent.hpp index 553091bc8..5880be79e 100644 --- a/src/guichan/include/guichan/selectionevent.hpp +++ b/src/guichan/include/guichan/selectionevent.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/selectionlistener.hpp b/src/guichan/include/guichan/selectionlistener.hpp index 173fbf9af..298a11e3d 100644 --- a/src/guichan/include/guichan/selectionlistener.hpp +++ b/src/guichan/include/guichan/selectionlistener.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widget.hpp b/src/guichan/include/guichan/widget.hpp index 8a49a9e3b..f4d316b25 100644 --- a/src/guichan/include/guichan/widget.hpp +++ b/src/guichan/include/guichan/widget.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgetlistener.hpp b/src/guichan/include/guichan/widgetlistener.hpp index ab8a2b791..65cb7fc1d 100644 --- a/src/guichan/include/guichan/widgetlistener.hpp +++ b/src/guichan/include/guichan/widgetlistener.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/button.hpp b/src/guichan/include/guichan/widgets/button.hpp index b34e5f921..225a3c23f 100644 --- a/src/guichan/include/guichan/widgets/button.hpp +++ b/src/guichan/include/guichan/widgets/button.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/checkbox.hpp b/src/guichan/include/guichan/widgets/checkbox.hpp index 8fee9ba19..f89ac355e 100644 --- a/src/guichan/include/guichan/widgets/checkbox.hpp +++ b/src/guichan/include/guichan/widgets/checkbox.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/container.hpp b/src/guichan/include/guichan/widgets/container.hpp index 2fe1cf169..21a612379 100644 --- a/src/guichan/include/guichan/widgets/container.hpp +++ b/src/guichan/include/guichan/widgets/container.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/label.hpp b/src/guichan/include/guichan/widgets/label.hpp index a99912de3..804842a07 100644 --- a/src/guichan/include/guichan/widgets/label.hpp +++ b/src/guichan/include/guichan/widgets/label.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/listbox.hpp b/src/guichan/include/guichan/widgets/listbox.hpp index 05eb0d78e..e19427a1e 100644 --- a/src/guichan/include/guichan/widgets/listbox.hpp +++ b/src/guichan/include/guichan/widgets/listbox.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/radiobutton.hpp b/src/guichan/include/guichan/widgets/radiobutton.hpp index ba81c1f8e..32ec1fdbf 100644 --- a/src/guichan/include/guichan/widgets/radiobutton.hpp +++ b/src/guichan/include/guichan/widgets/radiobutton.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/scrollarea.hpp b/src/guichan/include/guichan/widgets/scrollarea.hpp index 50549e370..c0d16456b 100644 --- a/src/guichan/include/guichan/widgets/scrollarea.hpp +++ b/src/guichan/include/guichan/widgets/scrollarea.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/slider.hpp b/src/guichan/include/guichan/widgets/slider.hpp index c925df45f..28c3af0d0 100644 --- a/src/guichan/include/guichan/widgets/slider.hpp +++ b/src/guichan/include/guichan/widgets/slider.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/textbox.hpp b/src/guichan/include/guichan/widgets/textbox.hpp index 8900936ab..49b2a5d02 100644 --- a/src/guichan/include/guichan/widgets/textbox.hpp +++ b/src/guichan/include/guichan/widgets/textbox.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/textfield.hpp b/src/guichan/include/guichan/widgets/textfield.hpp index 6b048a03b..7b7528c46 100644 --- a/src/guichan/include/guichan/widgets/textfield.hpp +++ b/src/guichan/include/guichan/widgets/textfield.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/include/guichan/widgets/window.hpp b/src/guichan/include/guichan/widgets/window.hpp index 436664e24..5fe1bfb21 100644 --- a/src/guichan/include/guichan/widgets/window.hpp +++ b/src/guichan/include/guichan/widgets/window.hpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/inputevent.cpp b/src/guichan/inputevent.cpp index 844ef2cbd..51dcbcd83 100644 --- a/src/guichan/inputevent.cpp +++ b/src/guichan/inputevent.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/key.cpp b/src/guichan/key.cpp index e1e72c436..559bfa3be 100644 --- a/src/guichan/key.cpp +++ b/src/guichan/key.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/keyevent.cpp b/src/guichan/keyevent.cpp index bfcc6dc9e..8fdcc837d 100644 --- a/src/guichan/keyevent.cpp +++ b/src/guichan/keyevent.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/keyinput.cpp b/src/guichan/keyinput.cpp index 2d936f28b..32c1a7234 100644 --- a/src/guichan/keyinput.cpp +++ b/src/guichan/keyinput.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/mouseevent.cpp b/src/guichan/mouseevent.cpp index 352623d61..37ebf65c1 100644 --- a/src/guichan/mouseevent.cpp +++ b/src/guichan/mouseevent.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/mouseinput.cpp b/src/guichan/mouseinput.cpp index 929e2886b..e4917c33f 100644 --- a/src/guichan/mouseinput.cpp +++ b/src/guichan/mouseinput.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/rectangle.cpp b/src/guichan/rectangle.cpp index ce5b72bfe..4f37e5e19 100644 --- a/src/guichan/rectangle.cpp +++ b/src/guichan/rectangle.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/selectionevent.cpp b/src/guichan/selectionevent.cpp index eec84c5b0..fce001cb7 100644 --- a/src/guichan/selectionevent.cpp +++ b/src/guichan/selectionevent.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widget.cpp b/src/guichan/widget.cpp index e7838e4d9..3ccec0730 100644 --- a/src/guichan/widget.cpp +++ b/src/guichan/widget.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/button.cpp b/src/guichan/widgets/button.cpp index b0627c4bd..96994aded 100644 --- a/src/guichan/widgets/button.cpp +++ b/src/guichan/widgets/button.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/checkbox.cpp b/src/guichan/widgets/checkbox.cpp index da6776d31..4e2fdbc3a 100644 --- a/src/guichan/widgets/checkbox.cpp +++ b/src/guichan/widgets/checkbox.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/container.cpp b/src/guichan/widgets/container.cpp index 19f992519..bd19224aa 100644 --- a/src/guichan/widgets/container.cpp +++ b/src/guichan/widgets/container.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/label.cpp b/src/guichan/widgets/label.cpp index 5e7c714f3..16afcb044 100644 --- a/src/guichan/widgets/label.cpp +++ b/src/guichan/widgets/label.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/listbox.cpp b/src/guichan/widgets/listbox.cpp index 5dd1509f5..bc4647ef0 100644 --- a/src/guichan/widgets/listbox.cpp +++ b/src/guichan/widgets/listbox.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/radiobutton.cpp b/src/guichan/widgets/radiobutton.cpp index 55de52a99..77d672cc0 100644 --- a/src/guichan/widgets/radiobutton.cpp +++ b/src/guichan/widgets/radiobutton.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/scrollarea.cpp b/src/guichan/widgets/scrollarea.cpp index 324afece8..aae116462 100644 --- a/src/guichan/widgets/scrollarea.cpp +++ b/src/guichan/widgets/scrollarea.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/slider.cpp b/src/guichan/widgets/slider.cpp index 9a328f2cc..4f370545d 100644 --- a/src/guichan/widgets/slider.cpp +++ b/src/guichan/widgets/slider.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/textbox.cpp b/src/guichan/widgets/textbox.cpp index 512471391..4f104833f 100644 --- a/src/guichan/widgets/textbox.cpp +++ b/src/guichan/widgets/textbox.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/textfield.cpp b/src/guichan/widgets/textfield.cpp index f0d464995..64a0209b5 100644 --- a/src/guichan/widgets/textfield.cpp +++ b/src/guichan/widgets/textfield.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guichan/widgets/window.cpp b/src/guichan/widgets/window.cpp index 025021a41..3ed6d969f 100644 --- a/src/guichan/widgets/window.cpp +++ b/src/guichan/widgets/window.cpp @@ -7,7 +7,7 @@ * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * * Per Larsson a.k.a finalman diff --git a/src/guild.cpp b/src/guild.cpp index f53739e2f..7ee97aaa9 100644 --- a/src/guild.cpp +++ b/src/guild.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/guild.h b/src/guild.h index b17b7d8e1..48b3d17b2 100644 --- a/src/guild.h +++ b/src/guild.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/guildmanager.cpp b/src/guildmanager.cpp index ab79337ed..a1fab3b1e 100644 --- a/src/guildmanager.cpp +++ b/src/guildmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/guildmanager.h b/src/guildmanager.h index b96580567..4c7c80c4c 100644 --- a/src/guildmanager.h +++ b/src/guildmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/imagesprite.cpp b/src/imagesprite.cpp index 71592566c..c40e49856 100644 --- a/src/imagesprite.cpp +++ b/src/imagesprite.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -56,5 +56,5 @@ void ImageSprite::draw(Graphics *const graphics, return; mImage->setAlpha(mAlpha); - DRAW_IMAGE(graphics, mImage, posX, posY); + graphics->drawImage2(mImage, posX, posY); } diff --git a/src/imagesprite.h b/src/imagesprite.h index 24df11aab..fb542c951 100644 --- a/src/imagesprite.h +++ b/src/imagesprite.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/inputevent.cpp b/src/input/inputevent.cpp index 61e5dc2b1..b87e4fe0a 100644 --- a/src/input/inputevent.cpp +++ b/src/input/inputevent.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/inputevent.h b/src/input/inputevent.h index b65a4b8f2..61f80c8e2 100644 --- a/src/input/inputevent.h +++ b/src/input/inputevent.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/inputmanager.cpp b/src/input/inputmanager.cpp index 74515e21d..c0d3a1d0f 100644 --- a/src/input/inputmanager.cpp +++ b/src/input/inputmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/inputmanager.h b/src/input/inputmanager.h index cb775ee9c..1a65220c6 100644 --- a/src/input/inputmanager.h +++ b/src/input/inputmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/joystick.cpp b/src/input/joystick.cpp index aa7aa3ee9..3e52d6ffe 100644 --- a/src/input/joystick.cpp +++ b/src/input/joystick.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/joystick.h b/src/input/joystick.h index f5f97cc09..06823ca27 100644 --- a/src/input/joystick.h +++ b/src/input/joystick.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/keyboardconfig.cpp b/src/input/keyboardconfig.cpp index 16e4f3c48..a5e3674ed 100644 --- a/src/input/keyboardconfig.cpp +++ b/src/input/keyboardconfig.cpp @@ -2,7 +2,7 @@ * Custom keyboard shortcuts configuration * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/keyboardconfig.h b/src/input/keyboardconfig.h index 39ecf8909..5e8232508 100644 --- a/src/input/keyboardconfig.h +++ b/src/input/keyboardconfig.h @@ -2,7 +2,7 @@ * Custom keyboard shortcuts configuration * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/keyboarddata.h b/src/input/keyboarddata.h index ce4f35510..5dd9e84a3 100644 --- a/src/input/keyboarddata.h +++ b/src/input/keyboarddata.h @@ -2,7 +2,7 @@ * Custom keyboard shortcuts configuration * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/keydata.h b/src/input/keydata.h index 6c2d6901c..52bc7f6be 100644 --- a/src/input/keydata.h +++ b/src/input/keydata.h @@ -2,7 +2,7 @@ * Custom keyboard shortcuts configuration * Copyright (C) 2007 Joshua Langley <joshlangley@optusnet.com.au> * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/keyevent.cpp b/src/input/keyevent.cpp index 6947af04a..5695cd99b 100644 --- a/src/input/keyevent.cpp +++ b/src/input/keyevent.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/keyevent.h b/src/input/keyevent.h index a9d9cd1a8..e0b2e8e17 100644 --- a/src/input/keyevent.h +++ b/src/input/keyevent.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/keyinput.cpp b/src/input/keyinput.cpp index b7ffd3ac1..d04305e0e 100644 --- a/src/input/keyinput.cpp +++ b/src/input/keyinput.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/keyinput.h b/src/input/keyinput.h index 24545ed1d..25deeae19 100644 --- a/src/input/keyinput.h +++ b/src/input/keyinput.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/multitouchmanager.cpp b/src/input/multitouchmanager.cpp index 49bc7bc12..7e6798807 100644 --- a/src/input/multitouchmanager.cpp +++ b/src/input/multitouchmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/input/multitouchmanager.h b/src/input/multitouchmanager.h index 34a536e50..076ccb3a8 100644 --- a/src/input/multitouchmanager.h +++ b/src/input/multitouchmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/inventory.cpp b/src/inventory.cpp index 9a82f192b..90fd1c94a 100644 --- a/src/inventory.cpp +++ b/src/inventory.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/inventory.h b/src/inventory.h index 17855a064..4da805b50 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/item.cpp b/src/item.cpp index 6bb6f206e..fe2fcaa92 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/item.h b/src/item.h index ceec48ebc..adb6ec03e 100644 --- a/src/item.h +++ b/src/item.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/itemshortcut.cpp b/src/itemshortcut.cpp index 7f63eeb93..a1f74a154 100644 --- a/src/itemshortcut.cpp +++ b/src/itemshortcut.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/itemshortcut.h b/src/itemshortcut.h index 1121007fa..2293a1583 100644 --- a/src/itemshortcut.h +++ b/src/itemshortcut.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/itemsoundmanager.cpp b/src/itemsoundmanager.cpp index 5fdd09ccb..8132395aa 100644 --- a/src/itemsoundmanager.cpp +++ b/src/itemsoundmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/itemsoundmanager.h b/src/itemsoundmanager.h index 3341178ca..4654074d8 100644 --- a/src/itemsoundmanager.h +++ b/src/itemsoundmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/localconsts.h b/src/localconsts.h index f05cef44a..92c36d92a 100644 --- a/src/localconsts.h +++ b/src/localconsts.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/logger.cpp b/src/logger.cpp index 972d333e4..bac895954 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/logger.h b/src/logger.h index 71a194467..0941a0e63 100644 --- a/src/logger.h +++ b/src/logger.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/main.cpp b/src/main.cpp index 65b6e98ef..75305233f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/main.h b/src/main.h index 34ea5f09e..b88c8b795 100644 --- a/src/main.h +++ b/src/main.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -45,8 +45,8 @@ * different interfaces, which have different implementations for each server. */ -#define SMALL_VERSION "1.3.12.22" -#define CHECK_VERSION "01.03.12.22" +#define SMALL_VERSION "1.4.1.4" +#define CHECK_VERSION "01.04.01.04" #ifdef HAVE_CONFIG_H #include "../config.h" diff --git a/src/map.cpp b/src/map.cpp index d080406c6..0bbb21271 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/mapheights.cpp b/src/mapheights.cpp index 31662d85e..06d71a38a 100644 --- a/src/mapheights.cpp +++ b/src/mapheights.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/mapheights.h b/src/mapheights.h index 2fd4c44ab..a674d2334 100644 --- a/src/mapheights.h +++ b/src/mapheights.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/maplayer.cpp b/src/maplayer.cpp index ac33e8bd5..2bb7884d8 100644 --- a/src/maplayer.cpp +++ b/src/maplayer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -139,11 +139,11 @@ void MapLayer::draw(Graphics *const graphics, if (!c) { - DRAW_IMAGE(graphics, img, px, py); + graphics->drawImage2(img, px, py); } else { - graphics->drawImagePattern(img, px, py, + graphics->drawPattern(img, px, py, width, img->mBounds.h); } } @@ -455,11 +455,11 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY, if (!c) { - DRAW_IMAGE(graphics, img, px, py); + graphics->drawImage2(img, px, py); } else { - graphics->drawImagePattern(img, px, py, + graphics->drawPattern(img, px, py, width, img->mBounds.h); } } @@ -796,7 +796,7 @@ void MapItem::draw(Graphics *const graphics, const int x, const int y, { BLOCK_START("MapItem::draw") if (mImage) - DRAW_IMAGE(graphics, mImage, x, y); + graphics->drawImage2(mImage, x, y); switch (mType) { diff --git a/src/maplayer.h b/src/maplayer.h index 0706e438e..697f52c89 100644 --- a/src/maplayer.h +++ b/src/maplayer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/mouseinput.cpp b/src/mouseinput.cpp index 7c7bd297a..208690935 100644 --- a/src/mouseinput.cpp +++ b/src/mouseinput.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/mouseinput.h b/src/mouseinput.h index 9fe1c73eb..1ed155aa8 100644 --- a/src/mouseinput.h +++ b/src/mouseinput.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp index b69094519..43b10b76b 100644 --- a/src/mumblemanager.cpp +++ b/src/mumblemanager.cpp @@ -4,7 +4,7 @@ * All code listed below is in the public domain and can be used, shared or * modified freely * - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers */ #ifdef USE_MUMBLE diff --git a/src/mumblemanager.h b/src/mumblemanager.h index 8c5354a6c..12de869e4 100644 --- a/src/mumblemanager.h +++ b/src/mumblemanager.h @@ -4,7 +4,7 @@ * All code listed below is in the public domain and can be used, shared or * modified freely * - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers */ #ifndef MUMBLEMANAGER_H diff --git a/src/navigationmanager.cpp b/src/navigationmanager.cpp index c6d091fa2..b999fe769 100644 --- a/src/navigationmanager.cpp +++ b/src/navigationmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/navigationmanager.h b/src/navigationmanager.h index 155d83c9d..fde5fb94d 100644 --- a/src/navigationmanager.h +++ b/src/navigationmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index 81e32062e..5d5ec271e 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h index cf5b285b1..57f5cda72 100644 --- a/src/net/beinghandler.h +++ b/src/net/beinghandler.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2004 The Mana World Development Team - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h index 62167f439..fd7c7b355 100644 --- a/src/net/buysellhandler.h +++ b/src/net/buysellhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/charserverhandler.cpp b/src/net/charserverhandler.cpp index 56ec0bf79..4d3cbc7ea 100644 --- a/src/net/charserverhandler.cpp +++ b/src/net/charserverhandler.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h index 1c53fd3a0..625bf57fc 100644 --- a/src/net/charserverhandler.h +++ b/src/net/charserverhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/chathandler.h b/src/net/chathandler.h index e91be671c..bcea62cfe 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -26,6 +26,8 @@ #include <iosfwd> #include <string> +#include "localconsts.h" + namespace Net { class ChatHandler @@ -34,16 +36,19 @@ class ChatHandler virtual ~ChatHandler() { } - virtual void talk(const std::string &text, - const std::string &channel) const = 0; + virtual void talk(const std::string &restrict text, + const std::string &restrict channel) const = 0; + + virtual void talkPet(const std::string &restrict text, + const std::string &restrict channel) const = 0; virtual void talkRaw(const std::string &text) const = 0; - virtual void me(const std::string &text, - const std::string &channel) const = 0; + virtual void me(const std::string &restrict text, + const std::string &restrict channel) const = 0; - virtual void privateMessage(const std::string &recipient, - const std::string &text) = 0; + virtual void privateMessage(const std::string &restrict recipient, + const std::string &restrict text) = 0; virtual void who() const = 0; diff --git a/src/net/download.cpp b/src/net/download.cpp index 38b8d2873..e9b6dd6d7 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -26,6 +26,7 @@ #include "logger.h" #include "main.h" +#include "utils/files.h" #include "utils/sdlhelper.h" #include <curl/curl.h> @@ -364,12 +365,7 @@ int Download::downloadThread(void *ptr) if (!d->mOptions.cancel) { ::remove(d->mFileName.c_str()); -#if defined __native_client__ - Files::renameFile( -#else - ::rename( -#endif - outFilename.c_str(), d->mFileName.c_str()); + Files::renameFile(outFilename, d->mFileName); // Check if we can open it and no errors were encountered // during renaming diff --git a/src/net/download.h b/src/net/download.h index 43821a0e2..4fe0f67db 100644 --- a/src/net/download.h +++ b/src/net/download.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/adminhandler.cpp b/src/net/ea/adminhandler.cpp index d9c4e0d88..f024394db 100644 --- a/src/net/ea/adminhandler.cpp +++ b/src/net/ea/adminhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/adminhandler.h b/src/net/ea/adminhandler.h index fc49b0a2c..5ec72e912 100644 --- a/src/net/ea/adminhandler.h +++ b/src/net/ea/adminhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/beinghandler.cpp b/src/net/ea/beinghandler.cpp index 0a864bbac..a5cc7cb75 100644 --- a/src/net/ea/beinghandler.cpp +++ b/src/net/ea/beinghandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/beinghandler.h b/src/net/ea/beinghandler.h index 41cc2842b..4d59c2f48 100644 --- a/src/net/ea/beinghandler.h +++ b/src/net/ea/beinghandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/buysellhandler.cpp b/src/net/ea/buysellhandler.cpp index 581e706b3..0f592b123 100644 --- a/src/net/ea/buysellhandler.cpp +++ b/src/net/ea/buysellhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/buysellhandler.h b/src/net/ea/buysellhandler.h index 7635f4f2c..0aa984d43 100644 --- a/src/net/ea/buysellhandler.h +++ b/src/net/ea/buysellhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/charserverhandler.cpp b/src/net/ea/charserverhandler.cpp index b59c2b536..a11c157fd 100644 --- a/src/net/ea/charserverhandler.cpp +++ b/src/net/ea/charserverhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -232,9 +232,9 @@ void CharServerHandler::clear() mCharacters.clear(); } -void CharServerHandler::processCharMapInfo(Net::MessageIn &msg, - Network *const network, - ServerInfo &server) +void CharServerHandler::processCharMapInfo(Net::MessageIn &restrict msg, + Network *restrict const network, + ServerInfo &restrict server) { BLOCK_START("CharServerHandler::processCharMapInfo") // msg.skip(4); // CharID, must be the same as player_node->charID @@ -267,9 +267,10 @@ void CharServerHandler::processCharMapInfo(Net::MessageIn &msg, BLOCK_END("CharServerHandler::processCharMapInfo") } -void CharServerHandler::processChangeMapServer(Net::MessageIn &msg, - Network *const network, - ServerInfo &server) const +void CharServerHandler::processChangeMapServer(Net::MessageIn &restrict msg, + Network *restrict const network, + ServerInfo &restrict server) + const { BLOCK_START("CharServerHandler::processChangeMapServer") GameHandler *const gh = static_cast<GameHandler*>(Net::getGameHandler()); diff --git a/src/net/ea/charserverhandler.h b/src/net/ea/charserverhandler.h index 004dde8c4..5ffd714f2 100644 --- a/src/net/ea/charserverhandler.h +++ b/src/net/ea/charserverhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -72,13 +72,14 @@ class CharServerHandler : public Net::CharServerHandler virtual void processCharDeleteFailed(Net::MessageIn &msg); - virtual void processCharMapInfo(Net::MessageIn &msg, - Network *const network, - ServerInfo &mapServer); + virtual void processCharMapInfo(Net::MessageIn &restrict msg, + Network *restrict const network, + ServerInfo &restrict mapServer); - virtual void processChangeMapServer(Net::MessageIn &msg, - Network *const network, - ServerInfo &mapServer) const; + virtual void processChangeMapServer(Net::MessageIn &restrict msg, + Network *restrict const network, + ServerInfo &restrict mapServer) + const; virtual void clear() override final; diff --git a/src/net/ea/chathandler.cpp b/src/net/ea/chathandler.cpp index a10bf931d..6654950f2 100644 --- a/src/net/ea/chathandler.cpp +++ b/src/net/ea/chathandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -62,13 +62,22 @@ void ChatHandler::clear() mSkipping = true; } -void ChatHandler::me(const std::string &text, const std::string &channel) const +void ChatHandler::me(const std::string &restrict text, + const std::string &restrict channel) const { // here need string duplication std::string action = strprintf("*%s*", text.c_str()); talk(action, channel); } +void ChatHandler::talkPet(const std::string &restrict text, + const std::string &restrict channel) const +{ + // here need string duplication + std::string action = strprintf("\302\202\303 %s", text.c_str()); + talk(action, channel); +} + void ChatHandler::processWhisperResponse(Net::MessageIn &msg) { BLOCK_START("ChatHandler::processWhisperResponse") @@ -310,17 +319,18 @@ void ChatHandler::processBeingChat(Net::MessageIn &msg, trim(chatMsg); + bool allow(true); // We use getIgnorePlayer instead of ignoringPlayer here // because ignorePlayer' side effects are triggered // right below for Being::IGNORE_SPEECH_FLOAT. if (player_relations.checkPermissionSilently(sender_name, PlayerRelation::SPEECH_LOG) && chatWindow) { - chatWindow->resortChatLog(removeColors(sender_name) + allow = chatWindow->resortChatLog(removeColors(sender_name) .append(" : ").append(chatMsg), BY_OTHER, channel, false, true); } - if (player_relations.hasPermission(sender_name, + if (allow && player_relations.hasPermission(sender_name, PlayerRelation::SPEECH_FLOAT)) { being->setSpeech(chatMsg, channel); @@ -352,9 +362,10 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat, if (normalChat) { + bool allow(true); if (chatWindow) { - chatWindow->resortChatLog(chatMsg, BY_PLAYER, + allow = chatWindow->resortChatLog(chatMsg, BY_PLAYER, channel, false, true); } @@ -386,7 +397,7 @@ void ChatHandler::processChat(Net::MessageIn &msg, const bool normalChat, if (player_node) { - if (chatWindow || mShowMotd) + if ((chatWindow || mShowMotd) && allow) player_node->setSpeech(chatMsg, channel); } } diff --git a/src/net/ea/chathandler.h b/src/net/ea/chathandler.h index ead5dac98..1fabda09d 100644 --- a/src/net/ea/chathandler.h +++ b/src/net/ea/chathandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -38,8 +38,11 @@ class ChatHandler : public Net::ChatHandler A_DELETE_COPY(ChatHandler) - void me(const std::string &text, - const std::string &channel) const override final; + void talkPet(const std::string &restrict text, + const std::string &restrict channel) const override final; + + void me(const std::string &restrict text, + const std::string &restrict channel) const override final; virtual void processWhisperResponse(Net::MessageIn &msg); diff --git a/src/net/ea/eaprotocol.h b/src/net/ea/eaprotocol.h index e448a19db..aeeebefde 100644 --- a/src/net/ea/eaprotocol.h +++ b/src/net/ea/eaprotocol.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/gamehandler.cpp b/src/net/ea/gamehandler.cpp index 54371d247..6e1982b6d 100644 --- a/src/net/ea/gamehandler.cpp +++ b/src/net/ea/gamehandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/gamehandler.h b/src/net/ea/gamehandler.h index d9ed8cc63..8a31ee030 100644 --- a/src/net/ea/gamehandler.h +++ b/src/net/ea/gamehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/gui/guildtab.cpp b/src/net/ea/gui/guildtab.cpp index e0a8937d1..6a801bba4 100644 --- a/src/net/ea/gui/guildtab.cpp +++ b/src/net/ea/gui/guildtab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -60,7 +60,8 @@ GuildTab::~GuildTab() CHECKLISTENERS } -bool GuildTab::handleCommand(const std::string &type, const std::string &args) +bool GuildTab::handleCommand(const std::string &restrict type, + const std::string &restrict args) { if (type == "help") { diff --git a/src/net/ea/gui/guildtab.h b/src/net/ea/gui/guildtab.h index edc8ca973..442ad62d0 100644 --- a/src/net/ea/gui/guildtab.h +++ b/src/net/ea/gui/guildtab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -40,8 +40,8 @@ class GuildTab : public ChatTab, public ConfigListener virtual ~GuildTab(); - bool handleCommand(const std::string &type, - const std::string &args) override final; + bool handleCommand(const std::string &restrict type, + const std::string &restrict args) override final; void showHelp() override; diff --git a/src/net/ea/gui/partytab.cpp b/src/net/ea/gui/partytab.cpp index f3c1d0377..76e204205 100644 --- a/src/net/ea/gui/partytab.cpp +++ b/src/net/ea/gui/partytab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -86,7 +86,8 @@ void PartyTab::showHelp() chatLog(_("/exp > Show/change party experience sharing options")); } -bool PartyTab::handleCommand(const std::string &type, const std::string &args) +bool PartyTab::handleCommand(const std::string &restrict type, + const std::string &restrict args) { if (type == "help") { diff --git a/src/net/ea/gui/partytab.h b/src/net/ea/gui/partytab.h index 1ab50a1b7..a73fbaaeb 100644 --- a/src/net/ea/gui/partytab.h +++ b/src/net/ea/gui/partytab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -42,8 +42,8 @@ class PartyTab : public ChatTab, public ConfigListener void showHelp() override final; - bool handleCommand(const std::string &type, - const std::string &args) override final; + bool handleCommand(const std::string &restrict type, + const std::string &restrict args) override final; int getType() const override final A_WARN_UNUSED { return ChatTab::TAB_PARTY; } diff --git a/src/net/ea/guildhandler.cpp b/src/net/ea/guildhandler.cpp index 10663db57..536c93263 100644 --- a/src/net/ea/guildhandler.cpp +++ b/src/net/ea/guildhandler.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/guildhandler.h b/src/net/ea/guildhandler.h index c3f51b81e..191d6fd44 100644 --- a/src/net/ea/guildhandler.h +++ b/src/net/ea/guildhandler.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/inventoryhandler.cpp b/src/net/ea/inventoryhandler.cpp index 8130eb259..94b81adb0 100644 --- a/src/net/ea/inventoryhandler.cpp +++ b/src/net/ea/inventoryhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/inventoryhandler.h b/src/net/ea/inventoryhandler.h index 818c63061..eea4dde12 100644 --- a/src/net/ea/inventoryhandler.h +++ b/src/net/ea/inventoryhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/itemhandler.cpp b/src/net/ea/itemhandler.cpp index ccc8c92cd..aaab0ca3e 100644 --- a/src/net/ea/itemhandler.cpp +++ b/src/net/ea/itemhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/itemhandler.h b/src/net/ea/itemhandler.h index ec45cfba3..8b07789f9 100644 --- a/src/net/ea/itemhandler.h +++ b/src/net/ea/itemhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/loginhandler.cpp b/src/net/ea/loginhandler.cpp index d67f1d37a..57edcefbf 100644 --- a/src/net/ea/loginhandler.cpp +++ b/src/net/ea/loginhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/loginhandler.h b/src/net/ea/loginhandler.h index 4659c65c2..8fea9d49f 100644 --- a/src/net/ea/loginhandler.h +++ b/src/net/ea/loginhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/network.cpp b/src/net/ea/network.cpp index 7c2963671..4ca79b87e 100644 --- a/src/net/ea/network.cpp +++ b/src/net/ea/network.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/network.h b/src/net/ea/network.h index c608358cd..08f9d7c71 100644 --- a/src/net/ea/network.h +++ b/src/net/ea/network.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/npchandler.cpp b/src/net/ea/npchandler.cpp index b3af53e87..70c4ce08a 100644 --- a/src/net/ea/npchandler.cpp +++ b/src/net/ea/npchandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/npchandler.h b/src/net/ea/npchandler.h index 4eeaac7c0..b8a10bc18 100644 --- a/src/net/ea/npchandler.h +++ b/src/net/ea/npchandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/partyhandler.cpp b/src/net/ea/partyhandler.cpp index 73e2569ab..98dec750a 100644 --- a/src/net/ea/partyhandler.cpp +++ b/src/net/ea/partyhandler.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/partyhandler.h b/src/net/ea/partyhandler.h index 59efa77b7..e7ab8f8ef 100644 --- a/src/net/ea/partyhandler.h +++ b/src/net/ea/partyhandler.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/playerhandler.cpp b/src/net/ea/playerhandler.cpp index d3667b78a..c6d20573d 100644 --- a/src/net/ea/playerhandler.cpp +++ b/src/net/ea/playerhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/playerhandler.h b/src/net/ea/playerhandler.h index 3e97994ce..2bac97ac1 100644 --- a/src/net/ea/playerhandler.h +++ b/src/net/ea/playerhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/skillhandler.cpp b/src/net/ea/skillhandler.cpp index 34848077a..3f5b38c68 100644 --- a/src/net/ea/skillhandler.cpp +++ b/src/net/ea/skillhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/skillhandler.h b/src/net/ea/skillhandler.h index 54566135e..251388969 100644 --- a/src/net/ea/skillhandler.h +++ b/src/net/ea/skillhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/token.h b/src/net/ea/token.h index 0de35d379..dadc341c7 100644 --- a/src/net/ea/token.h +++ b/src/net/ea/token.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/tradehandler.cpp b/src/net/ea/tradehandler.cpp index 0b2508983..45948f963 100644 --- a/src/net/ea/tradehandler.cpp +++ b/src/net/ea/tradehandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/ea/tradehandler.h b/src/net/ea/tradehandler.h index 2d37ed0c8..c3f759ef4 100644 --- a/src/net/ea/tradehandler.h +++ b/src/net/ea/tradehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/adminhandler.cpp b/src/net/eathena/adminhandler.cpp index 80263949d..6a68446f3 100644 --- a/src/net/eathena/adminhandler.cpp +++ b/src/net/eathena/adminhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/adminhandler.h b/src/net/eathena/adminhandler.h index a5ad87364..b7b48fcbb 100644 --- a/src/net/eathena/adminhandler.h +++ b/src/net/eathena/adminhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/beinghandler.cpp b/src/net/eathena/beinghandler.cpp index 108e6b50f..c7d903c32 100644 --- a/src/net/eathena/beinghandler.cpp +++ b/src/net/eathena/beinghandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/beinghandler.h b/src/net/eathena/beinghandler.h index ce5288eca..9d288b053 100644 --- a/src/net/eathena/beinghandler.h +++ b/src/net/eathena/beinghandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/buysellhandler.cpp b/src/net/eathena/buysellhandler.cpp index bd9264415..8a637e435 100644 --- a/src/net/eathena/buysellhandler.cpp +++ b/src/net/eathena/buysellhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/buysellhandler.h b/src/net/eathena/buysellhandler.h index 171a1c4e3..b18df810a 100644 --- a/src/net/eathena/buysellhandler.h +++ b/src/net/eathena/buysellhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/charserverhandler.cpp b/src/net/eathena/charserverhandler.cpp index d65b77144..f24c984ed 100644 --- a/src/net/eathena/charserverhandler.cpp +++ b/src/net/eathena/charserverhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/charserverhandler.h b/src/net/eathena/charserverhandler.h index 058644849..326921a99 100644 --- a/src/net/eathena/charserverhandler.h +++ b/src/net/eathena/charserverhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/chathandler.cpp b/src/net/eathena/chathandler.cpp index 53b98f6a9..61e0a8404 100644 --- a/src/net/eathena/chathandler.cpp +++ b/src/net/eathena/chathandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -92,8 +92,8 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) } } -void ChatHandler::talk(const std::string &text, - const std::string &channel A_UNUSED) const +void ChatHandler::talk(const std::string &restrict text, + const std::string &restrict channel A_UNUSED) const { if (!player_node) return; @@ -114,8 +114,8 @@ void ChatHandler::talkRaw(const std::string &mes) const outMsg.writeString(mes, static_cast<int>(mes.length())); } -void ChatHandler::privateMessage(const std::string &recipient, - const std::string &text) +void ChatHandler::privateMessage(const std::string &restrict recipient, + const std::string &restrict text) { MessageOut outMsg(CMSG_CHAT_WHISPER); outMsg.writeInt16(static_cast<int16_t>(text.length() + 28)); @@ -165,7 +165,8 @@ void ChatHandler::sendRaw(const std::string &args) const delete outMsg; } -void ChatHandler::processRaw(MessageOut &outMsg, const std::string &line) +void ChatHandler::processRaw(MessageOut &restrict outMsg, + const std::string &restrict line) { size_t pos = line.find(":"); if (pos == std::string::npos) diff --git a/src/net/eathena/chathandler.h b/src/net/eathena/chathandler.h index 9e6f1608d..9c6b8ea0c 100644 --- a/src/net/eathena/chathandler.h +++ b/src/net/eathena/chathandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -40,13 +40,13 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void handleMessage(Net::MessageIn &msg) override final; - void talk(const std::string &text, - const std::string &channel) const override final; + void talk(const std::string &restrict text, + const std::string &restrict channel) const override final; void talkRaw(const std::string &text) const override final; - void privateMessage(const std::string &recipient, - const std::string &text) override final; + void privateMessage(const std::string &restrict recipient, + const std::string &restrict text) override final; void who() const override final; @@ -56,7 +56,8 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void unIgnoreAll() const override final; - static void processRaw(MessageOut &outMsg, const std::string &line); + static void processRaw(MessageOut &restrict outMsg, + const std::string &restrict line); }; } // namespace EAthena diff --git a/src/net/eathena/gamehandler.cpp b/src/net/eathena/gamehandler.cpp index f94bebde4..75cbf11e8 100644 --- a/src/net/eathena/gamehandler.cpp +++ b/src/net/eathena/gamehandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/gamehandler.h b/src/net/eathena/gamehandler.h index 69c12538e..2307eb089 100644 --- a/src/net/eathena/gamehandler.h +++ b/src/net/eathena/gamehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/generalhandler.cpp b/src/net/eathena/generalhandler.cpp index 0e1cfebb4..ebb5d46d7 100644 --- a/src/net/eathena/generalhandler.cpp +++ b/src/net/eathena/generalhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/generalhandler.h b/src/net/eathena/generalhandler.h index 5da041dfc..d636b9c90 100644 --- a/src/net/eathena/generalhandler.h +++ b/src/net/eathena/generalhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/gui/guildtab.cpp b/src/net/eathena/gui/guildtab.cpp index 01a10bd8a..7704c06ce 100644 --- a/src/net/eathena/gui/guildtab.cpp +++ b/src/net/eathena/gui/guildtab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/gui/guildtab.h b/src/net/eathena/gui/guildtab.h index 154d5d74c..572ea4bac 100644 --- a/src/net/eathena/gui/guildtab.h +++ b/src/net/eathena/gui/guildtab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/gui/partytab.cpp b/src/net/eathena/gui/partytab.cpp index 8b43b28aa..0f1531470 100644 --- a/src/net/eathena/gui/partytab.cpp +++ b/src/net/eathena/gui/partytab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/gui/partytab.h b/src/net/eathena/gui/partytab.h index 0dd9bc8b9..31dc26787 100644 --- a/src/net/eathena/gui/partytab.h +++ b/src/net/eathena/gui/partytab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/guildhandler.cpp b/src/net/eathena/guildhandler.cpp index 7a682105f..edde95a89 100644 --- a/src/net/eathena/guildhandler.cpp +++ b/src/net/eathena/guildhandler.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -250,8 +250,8 @@ void GuildHandler::leave(const int guildId) const msg.writeString("", 40); // Message } -void GuildHandler::kick(const GuildMember *const member, - const std::string &reason) const +void GuildHandler::kick(const GuildMember *restrict const member, + const std::string &restrict reason) const { if (!member || !member->getGuild()) return; @@ -314,8 +314,9 @@ void GuildHandler::changeMemberPostion(const GuildMember *const member, msg.writeInt32(level); // pos } -void GuildHandler::changeNotice(const int guildId, const std::string &msg1, - const std::string &msg2) const +void GuildHandler::changeNotice(const int guildId, + const std::string &restrict msg1, + const std::string &restrict msg2) const { MessageOut msg(CMSG_GUILD_CHANGE_NOTICE); msg.writeInt32(guildId); diff --git a/src/net/eathena/guildhandler.h b/src/net/eathena/guildhandler.h index f8ee35fd6..ca52caea1 100644 --- a/src/net/eathena/guildhandler.h +++ b/src/net/eathena/guildhandler.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -53,8 +53,8 @@ class GuildHandler final : public Ea::GuildHandler, public MessageHandler void leave(const int guildId) const override final; - void kick(const GuildMember *const member, - const std::string &reason) const override final; + void kick(const GuildMember *restrict const member, + const std::string &restrict reason) const override final; void chat(const int guildId, const std::string &text) const override final; @@ -66,8 +66,10 @@ class GuildHandler final : public Ea::GuildHandler, public MessageHandler void changeMemberPostion(const GuildMember *const member, const int level) const override final; - void changeNotice(const int guildId, const std::string &msg1, - const std::string &msg2) const override final; + void changeNotice(const int guildId, + const std::string &restrict msg1, + const std::string &restrict msg2) + const override final; }; extern Ea::GuildTab *guildTab; diff --git a/src/net/eathena/inventoryhandler.cpp b/src/net/eathena/inventoryhandler.cpp index 2bf70e00a..df447c683 100644 --- a/src/net/eathena/inventoryhandler.cpp +++ b/src/net/eathena/inventoryhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/inventoryhandler.h b/src/net/eathena/inventoryhandler.h index a5df6ee90..53051a4f9 100644 --- a/src/net/eathena/inventoryhandler.h +++ b/src/net/eathena/inventoryhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/itemhandler.cpp b/src/net/eathena/itemhandler.cpp index c1f157160..10a773c13 100644 --- a/src/net/eathena/itemhandler.cpp +++ b/src/net/eathena/itemhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/itemhandler.h b/src/net/eathena/itemhandler.h index 491985a90..e8aa1b626 100644 --- a/src/net/eathena/itemhandler.h +++ b/src/net/eathena/itemhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/loginhandler.cpp b/src/net/eathena/loginhandler.cpp index a19a859ec..685626d98 100644 --- a/src/net/eathena/loginhandler.cpp +++ b/src/net/eathena/loginhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -118,18 +118,21 @@ void LoginHandler::disconnect() mNetwork->disconnect(); } -void LoginHandler::changePassword(const std::string &username A_UNUSED, - const std::string &oldPassword, - const std::string &newPassword) const +void LoginHandler::changePassword(const std::string &restrict username + A_UNUSED, + const std::string &restrict oldPassword, + const std::string &restrict newPassword) + const { MessageOut outMsg(CMSG_CHAR_PASSWORD_CHANGE); outMsg.writeStringNoLog(oldPassword, 24); outMsg.writeStringNoLog(newPassword, 24); } -void LoginHandler::sendLoginRegister(const std::string &username, - const std::string &password, - const std::string &email A_UNUSED) const +void LoginHandler::sendLoginRegister(const std::string &restrict username, + const std::string &restrict password, + const std::string &restrict email + A_UNUSED) const { MessageOut outMsg(0x0064); outMsg.writeInt32(0); // client version diff --git a/src/net/eathena/loginhandler.h b/src/net/eathena/loginhandler.h index d8556af63..14d432585 100644 --- a/src/net/eathena/loginhandler.h +++ b/src/net/eathena/loginhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -57,9 +57,9 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler unsigned int getMaxPasswordLength() const override final A_WARN_UNUSED { return 24; } - void changePassword(const std::string &username, - const std::string &oldPassword, - const std::string &newPassword) + void changePassword(const std::string &restrict username, + const std::string &restrict oldPassword, + const std::string &restrict newPassword) const override final; ServerInfo *getCharServer() const override final A_WARN_UNUSED; @@ -71,9 +71,10 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler void processUpdateHost2(Net::MessageIn &msg) const; private: - void sendLoginRegister(const std::string &username, - const std::string &password, - const std::string &email) const override final; + void sendLoginRegister(const std::string &restrict username, + const std::string &restrict password, + const std::string &restrict email) + const override final; }; } // namespace EAthena diff --git a/src/net/eathena/messagehandler.cpp b/src/net/eathena/messagehandler.cpp index 222c86390..83145a23d 100644 --- a/src/net/eathena/messagehandler.cpp +++ b/src/net/eathena/messagehandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/messagehandler.h b/src/net/eathena/messagehandler.h index fb2178d72..1b7f9e737 100644 --- a/src/net/eathena/messagehandler.h +++ b/src/net/eathena/messagehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/messagein.cpp b/src/net/eathena/messagein.cpp index bd24d8d04..e8e9049d9 100644 --- a/src/net/eathena/messagein.cpp +++ b/src/net/eathena/messagein.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/messagein.h b/src/net/eathena/messagein.h index 377ab7b33..ad7fd7663 100644 --- a/src/net/eathena/messagein.h +++ b/src/net/eathena/messagein.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/messageout.cpp b/src/net/eathena/messageout.cpp index 451f62304..3ac6a417e 100644 --- a/src/net/eathena/messageout.cpp +++ b/src/net/eathena/messageout.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/messageout.h b/src/net/eathena/messageout.h index d41d48e49..121d5a88f 100644 --- a/src/net/eathena/messageout.h +++ b/src/net/eathena/messageout.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/network.cpp b/src/net/eathena/network.cpp index 9fde34fd0..56d4f5aae 100644 --- a/src/net/eathena/network.cpp +++ b/src/net/eathena/network.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/network.h b/src/net/eathena/network.h index 01caad450..4c9349f96 100644 --- a/src/net/eathena/network.h +++ b/src/net/eathena/network.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/npchandler.cpp b/src/net/eathena/npchandler.cpp index a1ea47d8a..f4f4eada5 100644 --- a/src/net/eathena/npchandler.cpp +++ b/src/net/eathena/npchandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/npchandler.h b/src/net/eathena/npchandler.h index 1afa3c7bc..fd565a5ed 100644 --- a/src/net/eathena/npchandler.h +++ b/src/net/eathena/npchandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/partyhandler.cpp b/src/net/eathena/partyhandler.cpp index 8af0e4aaa..fcc650171 100644 --- a/src/net/eathena/partyhandler.cpp +++ b/src/net/eathena/partyhandler.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/partyhandler.h b/src/net/eathena/partyhandler.h index e2ea6ee20..d24c46683 100644 --- a/src/net/eathena/partyhandler.h +++ b/src/net/eathena/partyhandler.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/playerhandler.cpp b/src/net/eathena/playerhandler.cpp index aac729040..54b4322d0 100644 --- a/src/net/eathena/playerhandler.cpp +++ b/src/net/eathena/playerhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/playerhandler.h b/src/net/eathena/playerhandler.h index 86217c980..ee7bd1e39 100644 --- a/src/net/eathena/playerhandler.h +++ b/src/net/eathena/playerhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/protocol.h b/src/net/eathena/protocol.h index 3fbab016f..dfe3cc979 100644 --- a/src/net/eathena/protocol.h +++ b/src/net/eathena/protocol.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/skillhandler.cpp b/src/net/eathena/skillhandler.cpp index 0d654bbc8..34b44e9f1 100644 --- a/src/net/eathena/skillhandler.cpp +++ b/src/net/eathena/skillhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/skillhandler.h b/src/net/eathena/skillhandler.h index 057926504..3b63bcfc5 100644 --- a/src/net/eathena/skillhandler.h +++ b/src/net/eathena/skillhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/tradehandler.cpp b/src/net/eathena/tradehandler.cpp index f495e618f..b04446775 100644 --- a/src/net/eathena/tradehandler.cpp +++ b/src/net/eathena/tradehandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/eathena/tradehandler.h b/src/net/eathena/tradehandler.h index ddaa3d1f8..16a7669e2 100644 --- a/src/net/eathena/tradehandler.h +++ b/src/net/eathena/tradehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/gamehandler.h b/src/net/gamehandler.h index 4639e5eae..6cbd43af6 100644 --- a/src/net/gamehandler.h +++ b/src/net/gamehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h index 371be3afb..016ae4c28 100644 --- a/src/net/generalhandler.h +++ b/src/net/generalhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/guildhandler.h b/src/net/guildhandler.h index 3a825c550..fc07ba07a 100644 --- a/src/net/guildhandler.h +++ b/src/net/guildhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -53,8 +53,8 @@ class GuildHandler virtual void leave(const int guildId) const = 0; - virtual void kick(const GuildMember *const member, - const std::string &reason) const = 0; + virtual void kick(const GuildMember *restrict const member, + const std::string &restrict reason) const = 0; virtual void chat(const int guildId, const std::string &text) const = 0; @@ -76,8 +76,9 @@ class GuildHandler virtual void endAlliance(const int guildId, const int otherGuildId) const = 0; - virtual void changeNotice(const int guildId, const std::string &msg1, - const std::string &msg2) const = 0; + virtual void changeNotice(const int guildId, + const std::string &restrict msg1, + const std::string &restrict msg2) const = 0; virtual void clear() const = 0; diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index f725a4ce5..53e7d15b1 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/logindata.h b/src/net/logindata.h index 9964c9842..f1660a64d 100644 --- a/src/net/logindata.h +++ b/src/net/logindata.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index 229e9a4c6..0c3fa27ff 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -88,9 +88,10 @@ class LoginHandler virtual void changeEmail(const std::string &email) const = 0; - virtual void changePassword(const std::string &username, - const std::string &oldPassword, - const std::string &newPassword) const = 0; + virtual void changePassword(const std::string &restrict username, + const std::string &restrict oldPassword, + const std::string &restrict newPassword) + const = 0; virtual void chooseServer(unsigned int server) const = 0; diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h index 497934bd8..726fbbe64 100644 --- a/src/net/messagehandler.h +++ b/src/net/messagehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/messagein.cpp b/src/net/messagein.cpp index 28a16cfbd..9d9c68b94 100644 --- a/src/net/messagein.cpp +++ b/src/net/messagein.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -59,7 +59,7 @@ unsigned char MessageIn::readInt8() return value; } -void MessageIn::readCoordinates(uint16_t &x, uint16_t &y) +void MessageIn::readCoordinates(uint16_t &restrict x, uint16_t &restrict y) { if (mPos + 3 <= mLength) { @@ -108,7 +108,8 @@ uint8_t MessageIn::fromServerDirection(const uint8_t serverDir) } } -void MessageIn::readCoordinates(uint16_t &x, uint16_t &y, uint8_t &direction) +void MessageIn::readCoordinates(uint16_t &restrict x, uint16_t &restrict y, + uint8_t &restrict direction) { uint8_t serverDir = 0; if (mPos + 3 <= mLength) @@ -138,8 +139,10 @@ void MessageIn::readCoordinates(uint16_t &x, uint16_t &y, uint8_t &direction) PacketCounters::incInBytes(3); } -void MessageIn::readCoordinatePair(uint16_t &srcX, uint16_t &srcY, - uint16_t &dstX, uint16_t &dstY) +void MessageIn::readCoordinatePair(uint16_t &restrict srcX, + uint16_t &restrict srcY, + uint16_t &restrict dstX, + uint16_t &restrict dstY) { if (mPos + 5 <= mLength) { diff --git a/src/net/messagein.h b/src/net/messagein.h index 47527a879..c3ed294c3 100644 --- a/src/net/messagein.h +++ b/src/net/messagein.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -68,21 +68,25 @@ class MessageIn * Reads a 3-byte block containing tile-based coordinates. Used by * manaserv. */ - virtual void readCoordinates(uint16_t &x, uint16_t &y); + virtual void readCoordinates(uint16_t &restrict x, + uint16_t &restrict y); /** * Reads a special 3 byte block used by eAthena, containing x and y * coordinates and direction. */ - virtual void readCoordinates(uint16_t &x, uint16_t &y, - uint8_t &direction); + virtual void readCoordinates(uint16_t &restrict x, + uint16_t &restrict y, + uint8_t &restrict direction); /** * Reads a special 5 byte block used by eAthena, containing a source * and destination coordinate pair. */ - virtual void readCoordinatePair(uint16_t &srcX, uint16_t &srcY, - uint16_t &dstX, uint16_t &dstY); + virtual void readCoordinatePair(uint16_t &restrict srcX, + uint16_t &restrict srcY, + uint16_t &restrict dstX, + uint16_t &restrict dstY); /** * Skips a given number of bytes. diff --git a/src/net/messageout.cpp b/src/net/messageout.cpp index 1a295a066..aeb409f14 100644 --- a/src/net/messageout.cpp +++ b/src/net/messageout.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/messageout.h b/src/net/messageout.h index 75d7061b8..b48cb2244 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/net.cpp b/src/net/net.cpp index 964c0e76d..c7a4f33f7 100644 --- a/src/net/net.cpp +++ b/src/net/net.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -48,6 +48,7 @@ Net::GameHandler *gameHandler = nullptr; Net::GuildHandler *guildHandler = nullptr; Net::NpcHandler *npcHandler = nullptr; Net::PartyHandler *partyHandler = nullptr; +Net::PetHandler *petHandler = nullptr; Net::PlayerHandler *playerHandler = nullptr; Net::SkillHandler *skillHandler = nullptr; Net::TradeHandler *tradeHandler = nullptr; @@ -104,6 +105,11 @@ Net::PartyHandler *Net::getPartyHandler() return partyHandler; } +Net::PetHandler *Net::getPetHandler() +{ + return petHandler; +} + Net::PlayerHandler *Net::getPlayerHandler() { return playerHandler; diff --git a/src/net/net.h b/src/net/net.h index 7d25df5e3..376bf63e3 100644 --- a/src/net/net.h +++ b/src/net/net.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -47,6 +47,7 @@ class InventoryHandler; class LoginHandler; class NpcHandler; class PartyHandler; +class PetHandler; class PlayerHandler; class SkillHandler; class TradeHandler; @@ -63,6 +64,7 @@ InventoryHandler *getInventoryHandler() A_WARN_UNUSED; LoginHandler *getLoginHandler() A_WARN_UNUSED; NpcHandler *getNpcHandler() A_WARN_UNUSED; PartyHandler *getPartyHandler() A_WARN_UNUSED; +PetHandler *getPetHandler() A_WARN_UNUSED; PlayerHandler *getPlayerHandler() A_WARN_UNUSED; SkillHandler *getSkillHandler() A_WARN_UNUSED; TradeHandler *getTradeHandler() A_WARN_UNUSED; diff --git a/src/net/netconsts.h b/src/net/netconsts.h index 00c91fda5..1ea1c579e 100644 --- a/src/net/netconsts.h +++ b/src/net/netconsts.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/npchandler.h b/src/net/npchandler.h index 8ed0c26c6..5cf2970e5 100644 --- a/src/net/npchandler.h +++ b/src/net/npchandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/packetcounters.cpp b/src/net/packetcounters.cpp index 65ece62f8..93b961b0b 100644 --- a/src/net/packetcounters.cpp +++ b/src/net/packetcounters.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -104,7 +104,9 @@ int PacketCounters::getOutPackets() } -void PacketCounters::updateCounter(int ¤tSec, int &calc, int &counter) +void PacketCounters::updateCounter(int &restrict currentSec, + int &restrict calc, + int &restrict counter) { const int idx = cur_time % 60; if (currentSec != idx) diff --git a/src/net/packetcounters.h b/src/net/packetcounters.h index 713a13451..40e104794 100644 --- a/src/net/packetcounters.h +++ b/src/net/packetcounters.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -58,7 +58,9 @@ public: static int mOutPacketsCalc; private: - static void updateCounter(int ¤tSec, int &calc, int &counter); + static void updateCounter(int &restrict currentSec, + int &restrict calc, + int &restrict counter); }; #endif // NET_PACKETCOUNTERS_H diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index 6ff85e9df..f92c148c4 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/pethandler.h b/src/net/pethandler.h new file mode 100644 index 000000000..05816acc4 --- /dev/null +++ b/src/net/pethandler.h @@ -0,0 +1,47 @@ +/* + * The ManaPlus Client + * Copyright (C) 2013-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef NET_PETHANDLER_H +#define NET_PETHANDLER_H + +#include "being/being.h" + +namespace Net +{ + +class PetHandler +{ + public: + virtual ~PetHandler() + { } + + virtual void move(const Being *const being, + const int x1, const int y1, + const int x2, const int y2) const = 0; + + virtual void spawn(const Being *const being, + const int x, const int y) const = 0; + + virtual void emote(const uint8_t emoteId) const = 0; +}; + +} // namespace Net + +#endif // NET_PETHANDLER_H diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index 3bb1df208..fcb853198 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/sdltcpnet.cpp b/src/net/sdltcpnet.cpp index b891ee3e5..c07ba569b 100644 --- a/src/net/sdltcpnet.cpp +++ b/src/net/sdltcpnet.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/sdltcpnet.h b/src/net/sdltcpnet.h index a61c218b8..6b42ee1f7 100644 --- a/src/net/sdltcpnet.h +++ b/src/net/sdltcpnet.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/serverinfo.h b/src/net/serverinfo.h index 2a2659569..0b17184fd 100644 --- a/src/net/serverinfo.h +++ b/src/net/serverinfo.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h index 9a13cb97c..9f827a11d 100644 --- a/src/net/skillhandler.h +++ b/src/net/skillhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/adminhandler.cpp b/src/net/tmwa/adminhandler.cpp index 99d0f8935..c7b437944 100644 --- a/src/net/tmwa/adminhandler.cpp +++ b/src/net/tmwa/adminhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/adminhandler.h b/src/net/tmwa/adminhandler.h index 72c23cc4a..ad3475a44 100644 --- a/src/net/tmwa/adminhandler.h +++ b/src/net/tmwa/adminhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index cfb25fa49..043321cd5 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/beinghandler.h b/src/net/tmwa/beinghandler.h index 5507fc2f7..f35921256 100644 --- a/src/net/tmwa/beinghandler.h +++ b/src/net/tmwa/beinghandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/buysellhandler.cpp b/src/net/tmwa/buysellhandler.cpp index de4a03631..71891bdec 100644 --- a/src/net/tmwa/buysellhandler.cpp +++ b/src/net/tmwa/buysellhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/buysellhandler.h b/src/net/tmwa/buysellhandler.h index 12e2cd719..9fa6caddc 100644 --- a/src/net/tmwa/buysellhandler.h +++ b/src/net/tmwa/buysellhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/charserverhandler.cpp b/src/net/tmwa/charserverhandler.cpp index c20ac2513..a245372c5 100644 --- a/src/net/tmwa/charserverhandler.cpp +++ b/src/net/tmwa/charserverhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/charserverhandler.h b/src/net/tmwa/charserverhandler.h index 3a8f75ab0..c2f6596be 100644 --- a/src/net/tmwa/charserverhandler.h +++ b/src/net/tmwa/charserverhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/chathandler.cpp b/src/net/tmwa/chathandler.cpp index 164b0ddc3..af236f00b 100644 --- a/src/net/tmwa/chathandler.cpp +++ b/src/net/tmwa/chathandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -107,8 +107,8 @@ void ChatHandler::handleMessage(Net::MessageIn &msg) BLOCK_END("ChatHandler::handleMessage") } -void ChatHandler::talk(const std::string &text, - const std::string &channel) const +void ChatHandler::talk(const std::string &restrict text, + const std::string &restrict channel) const { if (!player_node) return; @@ -142,8 +142,8 @@ void ChatHandler::talkRaw(const std::string &mes) const outMsg.writeString(mes, static_cast<int>(mes.length())); } -void ChatHandler::privateMessage(const std::string &recipient, - const std::string &text) +void ChatHandler::privateMessage(const std::string &restrict recipient, + const std::string &restrict text) { MessageOut outMsg(CMSG_CHAT_WHISPER); outMsg.writeInt16(static_cast<int16_t>(text.length() + 28)); @@ -193,7 +193,8 @@ void ChatHandler::sendRaw(const std::string &args) const delete outMsg; } -void ChatHandler::processRaw(MessageOut &outMsg, const std::string &line) +void ChatHandler::processRaw(MessageOut &restrict outMsg, + const std::string &restrict line) { size_t pos = line.find(":"); if (pos == std::string::npos) diff --git a/src/net/tmwa/chathandler.h b/src/net/tmwa/chathandler.h index a21c0afe1..a7226c52c 100644 --- a/src/net/tmwa/chathandler.h +++ b/src/net/tmwa/chathandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -40,13 +40,13 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void handleMessage(Net::MessageIn &msg) override final; - void talk(const std::string &text, - const std::string &channel) const override final; + void talk(const std::string &restrict text, + const std::string &restrict channel) const override final; void talkRaw(const std::string &text) const override final; - void privateMessage(const std::string &recipient, - const std::string &text) override final; + void privateMessage(const std::string &restrict recipient, + const std::string &restrict text) override final; void who() const override final; @@ -56,7 +56,8 @@ class ChatHandler final : public MessageHandler, public Ea::ChatHandler void unIgnoreAll() const override final; - static void processRaw(MessageOut &outMsg, const std::string &line); + static void processRaw(MessageOut &restrict outMsg, + const std::string &restrict line); }; } // namespace TmwAthena diff --git a/src/net/tmwa/gamehandler.cpp b/src/net/tmwa/gamehandler.cpp index a8d72897d..2cb8aa999 100644 --- a/src/net/tmwa/gamehandler.cpp +++ b/src/net/tmwa/gamehandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index 6be2084d7..fdbb4cf17 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/generalhandler.cpp b/src/net/tmwa/generalhandler.cpp index 725393790..683eb0711 100644 --- a/src/net/tmwa/generalhandler.cpp +++ b/src/net/tmwa/generalhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -48,6 +48,7 @@ #include "net/tmwa/network.h" #include "net/tmwa/npchandler.h" #include "net/tmwa/partyhandler.h" +#include "net/tmwa/pethandler.h" #include "net/tmwa/playerhandler.h" #include "net/tmwa/protocol.h" #include "net/tmwa/tradehandler.h" @@ -80,6 +81,7 @@ GeneralHandler::GeneralHandler() : mLoginHandler(new LoginHandler), mNpcHandler(new NpcHandler), mPartyHandler(new PartyHandler), + mPetHandler(new PetHandler), mPlayerHandler(new PlayerHandler), mSkillHandler(new SkillHandler), mTradeHandler(new TradeHandler), @@ -195,6 +197,7 @@ void GeneralHandler::load() mNetwork->registerHandler(mSkillHandler.get()); mNetwork->registerHandler(mTradeHandler.get()); mNetwork->registerHandler(mPartyHandler.get()); + mNetwork->registerHandler(mPetHandler.get()); mNetwork->registerHandler(mQuestHandler.get()); } diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index 24b17c6f5..083483b11 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -71,6 +71,7 @@ class GeneralHandler final : public MessageHandler, MessageHandlerPtr mLoginHandler; MessageHandlerPtr mNpcHandler; MessageHandlerPtr mPartyHandler; + MessageHandlerPtr mPetHandler; MessageHandlerPtr mPlayerHandler; MessageHandlerPtr mSkillHandler; MessageHandlerPtr mTradeHandler; diff --git a/src/net/tmwa/gui/guildtab.cpp b/src/net/tmwa/gui/guildtab.cpp index dcfa97d21..a08555e91 100644 --- a/src/net/tmwa/gui/guildtab.cpp +++ b/src/net/tmwa/gui/guildtab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/gui/guildtab.h b/src/net/tmwa/gui/guildtab.h index 3a685b8f7..25920c9f0 100644 --- a/src/net/tmwa/gui/guildtab.h +++ b/src/net/tmwa/gui/guildtab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/gui/partytab.cpp b/src/net/tmwa/gui/partytab.cpp index b26d84f8f..c1890b937 100644 --- a/src/net/tmwa/gui/partytab.cpp +++ b/src/net/tmwa/gui/partytab.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/gui/partytab.h b/src/net/tmwa/gui/partytab.h index 28d9f1cb7..b028831c0 100644 --- a/src/net/tmwa/gui/partytab.h +++ b/src/net/tmwa/gui/partytab.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/guildhandler.cpp b/src/net/tmwa/guildhandler.cpp index 60747685d..4db171545 100644 --- a/src/net/tmwa/guildhandler.cpp +++ b/src/net/tmwa/guildhandler.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -255,8 +255,8 @@ void GuildHandler::leave(const int guildId) const msg.writeString("", 40); // Message } -void GuildHandler::kick(const GuildMember *const member, - const std::string &reason) const +void GuildHandler::kick(const GuildMember *restrict const member, + const std::string &restrict reason) const { if (!member || !member->getGuild()) return; @@ -319,8 +319,9 @@ void GuildHandler::changeMemberPostion(const GuildMember *const member, msg.writeInt32(level); // pos } -void GuildHandler::changeNotice(const int guildId, const std::string &msg1, - const std::string &msg2) const +void GuildHandler::changeNotice(const int guildId, + const std::string &restrict msg1, + const std::string &restrict msg2) const { MessageOut msg(CMSG_GUILD_CHANGE_NOTICE); msg.writeInt32(guildId); diff --git a/src/net/tmwa/guildhandler.h b/src/net/tmwa/guildhandler.h index ea4c0f182..666a4b45c 100644 --- a/src/net/tmwa/guildhandler.h +++ b/src/net/tmwa/guildhandler.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -53,8 +53,8 @@ class GuildHandler final : public Ea::GuildHandler, public MessageHandler void leave(const int guildId) const override final; - void kick(const GuildMember *const member, - const std::string &reason) const override final; + void kick(const GuildMember *restrict const member, + const std::string &restrict reason) const override final; void chat(const int guildId, const std::string &text) const override final; @@ -66,8 +66,10 @@ class GuildHandler final : public Ea::GuildHandler, public MessageHandler void changeMemberPostion(const GuildMember *const member, const int level) const override final; - void changeNotice(const int guildId, const std::string &msg1, - const std::string &msg2) const override final; + void changeNotice(const int guildId, + const std::string &restrict msg1, + const std::string &restrict msg2) + const override final; }; extern Ea::GuildTab *guildTab; diff --git a/src/net/tmwa/inventoryhandler.cpp b/src/net/tmwa/inventoryhandler.cpp index a993bb35c..02413dafc 100644 --- a/src/net/tmwa/inventoryhandler.cpp +++ b/src/net/tmwa/inventoryhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index a23e05b93..d0df79ae0 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/itemhandler.cpp b/src/net/tmwa/itemhandler.cpp index 5a888d28f..3b41d5bbc 100644 --- a/src/net/tmwa/itemhandler.cpp +++ b/src/net/tmwa/itemhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/itemhandler.h b/src/net/tmwa/itemhandler.h index e377e18a7..5203da929 100644 --- a/src/net/tmwa/itemhandler.h +++ b/src/net/tmwa/itemhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/loginhandler.cpp b/src/net/tmwa/loginhandler.cpp index 4fe225de6..95dd59350 100644 --- a/src/net/tmwa/loginhandler.cpp +++ b/src/net/tmwa/loginhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -125,18 +125,20 @@ void LoginHandler::disconnect() mNetwork->disconnect(); } -void LoginHandler::changePassword(const std::string &username A_UNUSED, - const std::string &oldPassword, - const std::string &newPassword) const +void LoginHandler::changePassword(const std::string &restrict username + A_UNUSED, + const std::string &restrict oldPassword, + const std::string &restrict newPassword) + const { MessageOut outMsg(CMSG_CHAR_PASSWORD_CHANGE); outMsg.writeStringNoLog(oldPassword, 24); outMsg.writeStringNoLog(newPassword, 24); } -void LoginHandler::sendLoginRegister(const std::string &username, - const std::string &password, - const std::string &email) const +void LoginHandler::sendLoginRegister(const std::string &restrict username, + const std::string &restrict password, + const std::string &restrict email) const { if (email.empty()) { diff --git a/src/net/tmwa/loginhandler.h b/src/net/tmwa/loginhandler.h index 8eabcfe56..20ca3f52d 100644 --- a/src/net/tmwa/loginhandler.h +++ b/src/net/tmwa/loginhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -54,9 +54,9 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler unsigned int getMaxPasswordLength() const override final A_WARN_UNUSED { return 24; } - void changePassword(const std::string &username, - const std::string &oldPassword, - const std::string &newPassword) + void changePassword(const std::string &restrict username, + const std::string &restrict oldPassword, + const std::string &restrict newPassword) const override final; ServerInfo *getCharServer() const override final A_WARN_UNUSED; @@ -68,9 +68,10 @@ class LoginHandler final : public MessageHandler, public Ea::LoginHandler void processUpdateHost2(Net::MessageIn &msg) const; private: - void sendLoginRegister(const std::string &username, - const std::string &password, - const std::string &email) const override final; + void sendLoginRegister(const std::string &restrict username, + const std::string &restrict password, + const std::string &restrict email) + const override final; }; } // namespace TmwAthena diff --git a/src/net/tmwa/messagehandler.cpp b/src/net/tmwa/messagehandler.cpp index 66aa36e56..b41b511a9 100644 --- a/src/net/tmwa/messagehandler.cpp +++ b/src/net/tmwa/messagehandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/messagehandler.h b/src/net/tmwa/messagehandler.h index 77494d30f..ae57fcba5 100644 --- a/src/net/tmwa/messagehandler.h +++ b/src/net/tmwa/messagehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/messagein.cpp b/src/net/tmwa/messagein.cpp index 4d8b334f3..c1a3032d0 100644 --- a/src/net/tmwa/messagein.cpp +++ b/src/net/tmwa/messagein.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/messagein.h b/src/net/tmwa/messagein.h index 50afff011..8dd95a478 100644 --- a/src/net/tmwa/messagein.h +++ b/src/net/tmwa/messagein.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/messageout.cpp b/src/net/tmwa/messageout.cpp index fa9f2b1e6..8dfbf2bd7 100644 --- a/src/net/tmwa/messageout.cpp +++ b/src/net/tmwa/messageout.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/messageout.h b/src/net/tmwa/messageout.h index a68e4788f..57ba9e75b 100644 --- a/src/net/tmwa/messageout.h +++ b/src/net/tmwa/messageout.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/network.cpp b/src/net/tmwa/network.cpp index 77b28dadd..c91387898 100644 --- a/src/net/tmwa/network.cpp +++ b/src/net/tmwa/network.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/network.h b/src/net/tmwa/network.h index 21ff221aa..6d05d0e48 100644 --- a/src/net/tmwa/network.h +++ b/src/net/tmwa/network.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/npchandler.cpp b/src/net/tmwa/npchandler.cpp index bb53ef33f..436badf26 100644 --- a/src/net/tmwa/npchandler.cpp +++ b/src/net/tmwa/npchandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h index 2cd4a3cd0..b36255bc2 100644 --- a/src/net/tmwa/npchandler.h +++ b/src/net/tmwa/npchandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/partyhandler.cpp b/src/net/tmwa/partyhandler.cpp index d3a49d75a..78d56f669 100644 --- a/src/net/tmwa/partyhandler.cpp +++ b/src/net/tmwa/partyhandler.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/partyhandler.h b/src/net/tmwa/partyhandler.h index 586f866cc..1de9c63b7 100644 --- a/src/net/tmwa/partyhandler.h +++ b/src/net/tmwa/partyhandler.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Lloyd Bryant <lloyd_bryant@netzero.net> - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/pethandler.cpp b/src/net/tmwa/pethandler.cpp new file mode 100644 index 000000000..2a3e56e0e --- /dev/null +++ b/src/net/tmwa/pethandler.cpp @@ -0,0 +1,71 @@ +/* + * The ManaPlus Client + * Copyright (C) 2013-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#include "net/tmwa/pethandler.h" + +#include "gui/widgets/tabs/chattab.h" + +#include "net/net.h" + +#include "net/tmwa/chathandler.h" +#include "net/tmwa/protocol.h" + +#include "debug.h" + +extern Net::PetHandler *petHandler; + +namespace TmwAthena +{ + +PetHandler::PetHandler() : + MessageHandler() +{ + static const uint16_t _messages[] = + { + 0 + }; + handledMessages = _messages; + petHandler = this; +} + +void PetHandler::handleMessage(Net::MessageIn &msg A_UNUSED) +{ + BLOCK_START("PetHandler::handleMessage") + BLOCK_END("PetHandler::handleMessage") +} + +void PetHandler::move(const Being *const being A_UNUSED, + const int x1 A_UNUSED, const int y1 A_UNUSED, + const int x2 A_UNUSED, const int y2 A_UNUSED) const +{ +} + +void PetHandler::spawn(const Being *const being A_UNUSED, + const int x A_UNUSED, const int y A_UNUSED) const +{ +} + +void PetHandler::emote(const uint8_t emoteId) const +{ + Net::getChatHandler()->talk("\302\202\302e" + toString( + static_cast<int>(emoteId)), GENERAL_CHANNEL); +} + +} // namespace TmwAthena diff --git a/src/net/tmwa/pethandler.h b/src/net/tmwa/pethandler.h new file mode 100644 index 000000000..81536e0b1 --- /dev/null +++ b/src/net/tmwa/pethandler.h @@ -0,0 +1,52 @@ +/* + * The ManaPlus Client + * Copyright (C) 2013-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef NET_TMWA_PETHANDLER_H +#define NET_TMWA_PETHANDLER_H + +#include "net/tmwa/messagehandler.h" + +#include "net/pethandler.h" + +namespace TmwAthena +{ + +class PetHandler final : public MessageHandler, public Net::PetHandler +{ + public: + PetHandler(); + + A_DELETE_COPY(PetHandler) + + void handleMessage(Net::MessageIn &msg) override final; + + void move(const Being *const being, + const int x1, const int y1, + const int x2, const int y2) const override final; + + void spawn(const Being *const being, + const int x, const int y) const override final; + + void emote(const uint8_t emoteId) const override final; +}; + +} // namespace TmwAthena + +#endif // NET_TMWA_PETHANDLER_H diff --git a/src/net/tmwa/playerhandler.cpp b/src/net/tmwa/playerhandler.cpp index 164ecb8c2..007c29dd6 100644 --- a/src/net/tmwa/playerhandler.cpp +++ b/src/net/tmwa/playerhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/playerhandler.h b/src/net/tmwa/playerhandler.h index 75022a452..5e1419119 100644 --- a/src/net/tmwa/playerhandler.h +++ b/src/net/tmwa/playerhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/protocol.h b/src/net/tmwa/protocol.h index a09a498aa..17d6a4cc8 100644 --- a/src/net/tmwa/protocol.h +++ b/src/net/tmwa/protocol.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/questhandler.cpp b/src/net/tmwa/questhandler.cpp index ca9a2c9f1..328a379dc 100644 --- a/src/net/tmwa/questhandler.cpp +++ b/src/net/tmwa/questhandler.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/questhandler.h b/src/net/tmwa/questhandler.h index a92b601c3..3e5e8178a 100644 --- a/src/net/tmwa/questhandler.h +++ b/src/net/tmwa/questhandler.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/skillhandler.cpp b/src/net/tmwa/skillhandler.cpp index 5edb1c0b4..19953e051 100644 --- a/src/net/tmwa/skillhandler.cpp +++ b/src/net/tmwa/skillhandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/skillhandler.h b/src/net/tmwa/skillhandler.h index 1b951df96..d1c813f5e 100644 --- a/src/net/tmwa/skillhandler.h +++ b/src/net/tmwa/skillhandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/tradehandler.cpp b/src/net/tmwa/tradehandler.cpp index 6b144cd5a..0cc768c5a 100644 --- a/src/net/tmwa/tradehandler.cpp +++ b/src/net/tmwa/tradehandler.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tmwa/tradehandler.h b/src/net/tmwa/tradehandler.h index c3367ee73..28f43cb0a 100644 --- a/src/net/tmwa/tradehandler.h +++ b/src/net/tmwa/tradehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h index 801eba9c1..823352239 100644 --- a/src/net/tradehandler.h +++ b/src/net/tradehandler.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/net/worldinfo.h b/src/net/worldinfo.h index 25bc089ca..98e4c3e04 100644 --- a/src/net/worldinfo.h +++ b/src/net/worldinfo.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/notifications.h b/src/notifications.h index b3bb2f2f2..18a689287 100644 --- a/src/notifications.h +++ b/src/notifications.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/notifymanager.cpp b/src/notifymanager.cpp index 94471d96a..07a9e9a8f 100644 --- a/src/notifymanager.cpp +++ b/src/notifymanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/notifymanager.h b/src/notifymanager.h index 58dfc556b..10e93ab86 100644 --- a/src/notifymanager.h +++ b/src/notifymanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/animationparticle.cpp b/src/particle/animationparticle.cpp index 6fba399c8..d7f31ca1e 100644 --- a/src/particle/animationparticle.cpp +++ b/src/particle/animationparticle.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/animationparticle.h b/src/particle/animationparticle.h index b2a190e08..da4d8f6cd 100644 --- a/src/particle/animationparticle.h +++ b/src/particle/animationparticle.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/imageparticle.cpp b/src/particle/imageparticle.cpp index fa96f5962..e41c072b4 100644 --- a/src/particle/imageparticle.cpp +++ b/src/particle/imageparticle.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -103,6 +103,6 @@ void ImageParticle::draw(Graphics *const graphics, } mImage->setAlpha(alphafactor); - DRAW_IMAGE(graphics, mImage, screenX, screenY); + graphics->drawImage2(mImage, screenX, screenY); return; } diff --git a/src/particle/imageparticle.h b/src/particle/imageparticle.h index 91a11bfc2..3c3a17ebc 100644 --- a/src/particle/imageparticle.h +++ b/src/particle/imageparticle.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index 99e4117ae..576b292fa 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/particle.h b/src/particle/particle.h index d14db0572..f75803772 100644 --- a/src/particle/particle.h +++ b/src/particle/particle.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/particlecontainer.cpp b/src/particle/particlecontainer.cpp index ddebcef7b..0c73d2762 100644 --- a/src/particle/particlecontainer.cpp +++ b/src/particle/particlecontainer.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/particlecontainer.h b/src/particle/particlecontainer.h index 82718d7d1..c3b49dde0 100644 --- a/src/particle/particlecontainer.h +++ b/src/particle/particlecontainer.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/particleemitter.cpp b/src/particle/particleemitter.cpp index 2ddf3b50c..13f9d8d41 100644 --- a/src/particle/particleemitter.cpp +++ b/src/particle/particleemitter.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/particleemitter.h b/src/particle/particleemitter.h index 415c10f37..bf0e05ae5 100644 --- a/src/particle/particleemitter.h +++ b/src/particle/particleemitter.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/particleemitterprop.h b/src/particle/particleemitterprop.h index ea241e740..21f4ff8fa 100644 --- a/src/particle/particleemitterprop.h +++ b/src/particle/particleemitterprop.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/particleinfo.h b/src/particle/particleinfo.h index a0bdb8397..98ef0cd63 100644 --- a/src/particle/particleinfo.h +++ b/src/particle/particleinfo.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/rotationalparticle.cpp b/src/particle/rotationalparticle.cpp index 4cf726c32..2a1fe7904 100644 --- a/src/particle/rotationalparticle.cpp +++ b/src/particle/rotationalparticle.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/rotationalparticle.h b/src/particle/rotationalparticle.h index 4d7f826de..fe8f2bd4c 100644 --- a/src/particle/rotationalparticle.h +++ b/src/particle/rotationalparticle.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/textparticle.cpp b/src/particle/textparticle.cpp index 355102531..54de26887 100644 --- a/src/particle/textparticle.cpp +++ b/src/particle/textparticle.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/particle/textparticle.h b/src/particle/textparticle.h index 47cf14d62..eb8a160e1 100644 --- a/src/particle/textparticle.h +++ b/src/particle/textparticle.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2006-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/party.cpp b/src/party.cpp index fb96a9423..2e3bf6fac 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/party.h b/src/party.h index 3acb0101d..79fdfcf9e 100644 --- a/src/party.h +++ b/src/party.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/position.cpp b/src/position.cpp index fbca3ba41..97b358238 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/position.h b/src/position.h index 9b4bb80ba..0e489bcfa 100644 --- a/src/position.h +++ b/src/position.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/properties.h b/src/properties.h index fab5304c7..5b9908746 100644 --- a/src/properties.h +++ b/src/properties.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 8508b9eec..c88892cc4 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -28,7 +28,6 @@ #include "graphicsmanager.h" #include "logger.h" -#include "resources/image.h" #include "resources/imagehelper.h" #include "resources/openglimagehelper.h" @@ -440,79 +439,6 @@ int Graphics::getHeight() const return mHeight; } -bool Graphics::drawImage(const Image *image, int x, int y) -{ - if (image) - { - return drawImage2(image, 0, 0, x, y, - image->mBounds.w, image->mBounds.h, false); - } - else - { - return false; - } -} - -void Graphics::drawImageRect(const int x, const int y, - const int w, const int h, - const Image *const topLeft, - const Image *const topRight, - const Image *const bottomLeft, - const Image *const bottomRight, - const Image *const top, - const Image *const right, - const Image *const bottom, - const Image *const left, - const Image *const center) -{ - BLOCK_START("Graphics::drawImageRect") - const bool drawMain = center && topLeft && topRight - && bottomLeft && bottomRight; - - // Draw the center area - if (center && drawMain) - { - const int tlw = topLeft->getWidth(); - const int tlh = topLeft->getHeight(); - drawImagePattern(center, tlw + x, tlh + y, - w - tlw - topRight->getWidth(), - h - tlh - bottomLeft->getHeight()); - } - - // Draw the sides - if (top && left && bottom && right) - { - const int lw = left->getWidth(); - const int rw = right->getWidth(); - const int th = top->getHeight(); - const int bh = bottom->getHeight(); - drawImagePattern(top, x + lw, y, w - lw - rw, th); - drawImagePattern(bottom, x + lw, h - bh + y, w - lw - rw, bh); - drawImagePattern(left, x, y + th, lw, h - th - bh); - drawImagePattern(right, x + w - rw, th + y, rw, h - th - bh); - } - // Draw the corners - if (drawMain) - { - DRAW_IMAGE(this, topLeft, x, y); - DRAW_IMAGE(this, topRight, x + w - topRight->getWidth(), y); - DRAW_IMAGE(this, bottomLeft, x, h - bottomLeft->getHeight() + y); - DRAW_IMAGE(this, bottomRight, - x + w - bottomRight->getWidth(), - y + h - bottomRight->getHeight()); - } - BLOCK_END("Graphics::drawImageRect") -} - -void Graphics::drawImageRect(int x, int y, int w, int h, - const ImageRect &imgRect) -{ - drawImageRect(x, y, w, h, - imgRect.grid[0], imgRect.grid[2], imgRect.grid[6], imgRect.grid[8], - imgRect.grid[1], imgRect.grid[5], imgRect.grid[7], imgRect.grid[3], - imgRect.grid[4]); -} - bool Graphics::drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height) { @@ -525,66 +451,6 @@ bool Graphics::drawNet(const int x1, const int y1, const int x2, const int y2, return true; } -bool Graphics::calcImageRect(ImageVertexes *const vert, - const int x, const int y, - const int w, const int h, - const Image *const topLeft, - const Image *const topRight, - const Image *const bottomLeft, - const Image *const bottomRight, - const Image *const top, - const Image *const right, - const Image *const bottom, - const Image *const left, - const Image *const center) -{ - if (!vert) - return false; - - BLOCK_START("Graphics::calcImageRect") - const bool drawMain = center && topLeft && topRight - && bottomLeft && bottomRight; - -// pushClipArea(gcn::Rectangle(x, y, w, h)); - - // Draw the center area - if (center && drawMain) - { - const int tlw = topLeft->getWidth(); - const int tlh = topLeft->getHeight(); - calcImagePattern(vert, center, tlw + x, tlh + y, - w - tlw - topRight->getWidth(), - h - tlh - bottomLeft->getHeight()); - } - // Draw the sides - if (top && left && bottom && right) - { - const int lw = left->getWidth(); - const int rw = right->getWidth(); - const int th = top->getHeight(); - const int bh = bottom->getHeight(); - calcImagePattern(vert, top, x + lw, y, w - lw - rw, th); - calcImagePattern(vert, bottom, x + lw, y + h - bh, w - lw - rw, bh); - calcImagePattern(vert, left, x, y + th, lw, h - th - bh); - calcImagePattern(vert, right, x + w - rw, y + th, rw, h - th - bh); - } - - calcTileVertexes(vert, topLeft, x, y); - if (topRight) - calcTileVertexes(vert, topRight, x + w - topRight->getWidth(), y); - if (bottomLeft) - calcTileVertexes(vert, bottomLeft, x, y + h - bottomLeft->getHeight()); - if (bottomRight) - { - calcTileVertexes(vert, bottomRight, x + w - bottomRight->getWidth(), - y + h - bottomRight->getHeight()); - } - -// popClipArea(); - BLOCK_END("Graphics::calcImageRect") - return 0; -} - void Graphics::setWindowSize(const int width A_UNUSED, const int height A_UNUSED) { diff --git a/src/render/graphics.h b/src/render/graphics.h index 79dc008b9..82ef32fea 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -47,15 +47,6 @@ struct SDL_Window; static const int defaultScreenWidth = 800; static const int defaultScreenHeight = 600; -#define DRAW_IMAGE(graphics, image, x, y) \ - { \ - if (image) \ - { \ - (graphics)->drawImage2(image, 0, 0, x, y, \ - (image)->mBounds.w, (image)->mBounds.h, false); \ - } \ - } - /** * 9 images defining a rectangle. 4 corners, 4 sides and a middle area. The * topology is as follows: @@ -150,89 +141,48 @@ class Graphics : public gcn::Graphics */ virtual bool resizeScreen(const int width, const int height); - /** - * Blits an image onto the screen. - * - * @return <code>true</code> if the image was blitted properly - * <code>false</code> otherwise. - */ - bool drawImage(const Image *image, int x, int y); - // override unused abstract function void drawImage(const gcn::Image* image A_UNUSED, int srcX A_UNUSED, int srcY A_UNUSED, int dstX A_UNUSED, int dstY A_UNUSED, - int width A_UNUSED, int height A_UNUSED) override + int width A_UNUSED, int height A_UNUSED) override final { } /** * Draws a resclaled version of the image */ - virtual bool drawRescaledImage(const Image *const image, int srcX, - int srcY, int dstX, int dstY, - const int width, const int height, + virtual bool drawRescaledImage(const Image *const image, + int dstX, int dstY, const int desiredWidth, - const int desiredHeight, - const bool useColor = false) = 0; + const int desiredHeight) = 0; - virtual void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) = 0; + virtual void drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) = 0; /** * Draw a pattern based on a rescaled version of the given image... */ - virtual void drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) = 0; - - /** - * Draws a rectangle using images. 4 corner images, 4 side images and 1 - * image for the inside. - */ - void drawImageRect(const int x, const int y, const int w, const int h, - const Image *const topLeft, - const Image *const topRight, - const Image *const bottomLeft, - const Image *const bottomRight, - const Image *const top, - const Image *const right, - const Image *const bottom, - const Image *const left, - const Image *const center); - - /** - * Draws a rectangle using images. 4 corner images, 4 side images and 1 - * image for the inside. - */ - void drawImageRect(int x, int y, int w, int h, - const ImageRect &imgRect); - - bool calcImageRect(ImageVertexes *const vert, - const int x, const int y, - const int w, const int h, - const Image *const topLeft, - const Image *const topRight, - const Image *const bottomLeft, - const Image *const bottomRight, - const Image *const top, - const Image *const right, - const Image *const bottom, - const Image *const left, - const Image *const center); - - virtual void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const = 0; - - virtual void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const = 0; + virtual void drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) = 0; + + virtual void drawImageRect(const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) = 0; + + virtual void calcPattern(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const = 0; + + virtual void calcPattern(ImageCollection *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const = 0; virtual void calcTileVertexes(ImageVertexes *const vert, const Image *const image, @@ -252,19 +202,11 @@ class Graphics : public gcn::Graphics const Image *const image, int x, int y) = 0; - virtual bool calcWindow(ImageCollection *const vertCol, + virtual void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) = 0; - /** - * Draws a rectangle using images. 4 corner images, 4 side images and 1 - * image for the inside. - */ - inline void drawImageRect(const gcn::Rectangle &area, - const ImageRect &imgRect) - { drawImageRect(area.x, area.y, area.width, area.height, imgRect); } - virtual void fillRectangle(const gcn::Rectangle& rectangle) override = 0; @@ -388,10 +330,16 @@ class Graphics : public gcn::Graphics * <code>false</code> otherwise. */ virtual bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) = 0; + int dstX, int dstY) = 0; + + virtual void drawImageCached(const Image *const image, + int srcX, int srcY) = 0; + + virtual void drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) = 0; + + virtual void completeCache() = 0; int mWidth; int mHeight; diff --git a/src/render/graphics_calcImageRect.hpp b/src/render/graphics_calcImageRect.hpp new file mode 100644 index 000000000..07ee34d34 --- /dev/null +++ b/src/render/graphics_calcImageRect.hpp @@ -0,0 +1,93 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +// bool GraphicsX::calcImageRect(ImageVertexes *const vert, +// const int x, const int y, +// const int w, const int h, +// const ImageRect &imgRect) + +if (!vert) + return; + +BLOCK_START("Graphics::calcImageRect") + +const Image *const *const grid = imgRect.grid; +const Image *const topLeft = grid[0]; +const Image *const topRight = grid[2]; +const Image *const bottomLeft = grid[6]; +const Image *const bottomRight = grid[8]; +const Image *const top = grid[1]; +const Image *const right = grid[5]; +const Image *const bottom = grid[7]; +const Image *const left = grid[3]; +const Image *const center = grid[4]; + +const bool drawMain = center && topLeft && topRight + && bottomLeft && bottomRight; + +// Draw the center area +if (center && drawMain) +{ + const int tlw = topLeft->getWidth(); + const int tlh = topLeft->getHeight(); + calcPatternInline(vert, center, tlw + x, tlh + y, + w - tlw - topRight->getWidth(), + h - tlh - bottomLeft->getHeight()); +} +// Draw the sides +if (top && left && bottom && right) +{ + const int lw = left->getWidth(); + const int rw = right->getWidth(); + const int th = top->getHeight(); + const int bh = bottom->getHeight(); + calcPatternInline(vert, top, x + lw, y, w - lw - rw, th); + calcPatternInline(vert, bottom, x + lw, y + h - bh, w - lw - rw, bh); + calcPatternInline(vert, left, x, y + th, lw, h - th - bh); + if (w > rw) + calcPatternInline(vert, right, x + w - rw, y + th, rw, h - th - bh); +} + +calcTileVertexesInline(vert, topLeft, x, y); +if (topRight) +{ + const int trw = topRight->getWidth(); + if (w > trw) + calcTileVertexesInline(vert, topRight, x + w - trw, y); +} +if (bottomLeft) +{ + calcTileVertexesInline(vert, bottomLeft, + x, y + h - bottomLeft->getHeight()); +} +if (bottomRight) +{ + const int brw = bottomRight->getWidth(); + if (w > brw) + { + calcTileVertexesInline(vert, bottomRight, x + w - brw, + y + h - bottomRight->getHeight()); + } +} + +BLOCK_END("Graphics::calcImageRect") diff --git a/src/render/graphics_drawImageRect.hpp b/src/render/graphics_drawImageRect.hpp new file mode 100644 index 000000000..faaa2d1a7 --- /dev/null +++ b/src/render/graphics_drawImageRect.hpp @@ -0,0 +1,83 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + +// void GraphicsX::drawImageRect(const int x, const int y, +// const int w, const int h, +// const ImageRect &imgRect) + +BLOCK_START("Graphics::drawImageRect") + +const Image *const *const grid = imgRect.grid; +const Image *const topLeft = grid[0]; +const Image *const topRight = grid[2]; +const Image *const bottomLeft = grid[6]; +const Image *const bottomRight = grid[8]; +const Image *const top = grid[1]; +const Image *const right = grid[5]; +const Image *const bottom = grid[7]; +const Image *const left = grid[3]; +const Image *const center = grid[4]; + +const bool drawMain = center && topLeft && topRight + && bottomLeft && bottomRight; + +// Draw the center area +if (center && drawMain) +{ + const int tlw = topLeft->getWidth(); + const int tlh = topLeft->getHeight(); + drawPatternInline(center, tlw + x, tlh + y, + w - tlw - topRight->getWidth(), + h - tlh - bottomLeft->getHeight()); +} + +// Draw the sides +if (top && left && bottom && right) +{ + const int lw = left->getWidth(); + const int rw = right->getWidth(); + const int th = top->getHeight(); + const int bh = bottom->getHeight(); + drawPatternInline(top, x + lw, y, w - lw - rw, th); + drawPatternInline(bottom, x + lw, h - bh + y, w - lw - rw, bh); + drawPatternInline(left, x, y + th, lw, h - th - bh); + if (w > rw) + drawPatternInline(right, x + w - rw, th + y, rw, h - th - bh); +} +// Draw the corners +if (drawMain) +{ + drawImageInline(topLeft, x, y); + const int trw = topRight->getWidth(); + if (w > trw) + drawImageInline(topRight, x + w - trw, y); + drawImageInline(bottomLeft, x, h - bottomLeft->getHeight() + y); + const int brw = bottomRight->getWidth(); + if (w > brw) + { + drawImageInline(bottomRight, + x + w - brw, + y + h - bottomRight->getHeight()); + } +} +BLOCK_END("Graphics::drawImageRect") diff --git a/src/render/mgl.cpp b/src/render/mgl.cpp index 0fabb5d1b..54845b944 100644 --- a/src/render/mgl.cpp +++ b/src/render/mgl.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/render/mgl.h b/src/render/mgl.h index 4e97a8553..a47a70218 100644 --- a/src/render/mgl.h +++ b/src/render/mgl.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 1d0feb085..d273e9f65 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -38,6 +38,32 @@ #include "debug.h" +#define vertFill2D(tVar, vVar, x1, y1, x2, y2, dstX, dstY, w, h) \ + tVar[vp + 0] = x1; \ + tVar[vp + 1] = y1; \ + tVar[vp + 2] = x2; \ + tVar[vp + 3] = y1; \ + tVar[vp + 4] = x2; \ + tVar[vp + 5] = y2; \ + tVar[vp + 6] = x1; \ + tVar[vp + 7] = y1; \ + tVar[vp + 8] = x1; \ + tVar[vp + 9] = y2; \ + tVar[vp + 10] = x2; \ + tVar[vp + 11] = y2; \ + vVar[vp + 0] = dstX; \ + vVar[vp + 1] = dstY; \ + vVar[vp + 2] = dstX + w; \ + vVar[vp + 3] = dstY; \ + vVar[vp + 4] = dstX + w; \ + vVar[vp + 5] = dstY + h; \ + vVar[vp + 6] = dstX; \ + vVar[vp + 7] = dstY; \ + vVar[vp + 8] = dstX; \ + vVar[vp + 9] = dstY + h; \ + vVar[vp + 10] = dstX + w; \ + vVar[vp + 11] = dstY + h; + GLuint MobileOpenGLGraphics::mLastImage = 0; #ifdef DEBUG_DRAW_CALLS unsigned int MobileOpenGLGraphics::mDrawCalls = 0; @@ -46,12 +72,15 @@ unsigned int MobileOpenGLGraphics::mLastDrawCalls = 0; MobileOpenGLGraphics::MobileOpenGLGraphics(): mFloatTexArray(nullptr), - mIntTexArray(nullptr), - mIntVertArray(nullptr), mShortVertArray(nullptr), + mFloatTexArrayCached(nullptr), + mShortVertArrayCached(nullptr), + mAlphaCached(1.0F), + mVpCached(0), mTexture(false), mIsByteColor(false), mByteColor(), + mImageCached(0), mFloatColor(1.0F), mMaxVertices(500), mColorAlpha(false), @@ -68,9 +97,9 @@ MobileOpenGLGraphics::MobileOpenGLGraphics(): MobileOpenGLGraphics::~MobileOpenGLGraphics() { delete [] mFloatTexArray; - delete [] mIntTexArray; - delete [] mIntVertArray; delete [] mShortVertArray; + delete [] mFloatTexArrayCached; + delete [] mShortVertArrayCached; } void MobileOpenGLGraphics::initArrays() @@ -85,9 +114,9 @@ void MobileOpenGLGraphics::initArrays() const int sz = mMaxVertices * 4 + 30; vertexBufSize = mMaxVertices; mFloatTexArray = new GLfloat[sz]; - mIntTexArray = new GLint[sz]; - mIntVertArray = new GLint[sz]; mShortVertArray = new GLshort[sz]; + mFloatTexArrayCached = new GLfloat[sz]; + mShortVertArrayCached = new GLshort[sz]; } bool MobileOpenGLGraphics::setVideoMode(const int w, const int h, @@ -187,115 +216,206 @@ static inline void drawRescaledQuad(const Image *const image, } } - bool MobileOpenGLGraphics::drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) + int dstX, int dstY) +{ + return drawImageInline(image, dstX, dstY); +} + +bool MobileOpenGLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) if (!image) return false; - const SDL_Rect &imageRect = image->mBounds; - - if (!useColor) - setColorAlpha(image->mAlpha); - + setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE debugBindTexture(image); #endif bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); - setTexturingAndBlending(true); - drawQuad(image, srcX + imageRect.x, srcY + imageRect.y, - dstX, dstY, width, height); + const SDL_Rect &imageRect = image->mBounds; + drawQuad(image, imageRect.x, imageRect.y, + dstX, dstY, imageRect.w, imageRect.h); return true; } -bool MobileOpenGLGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, - const int desiredHeight, - const bool useColor) +void MobileOpenGLGraphics::drawImageCached(const Image *const image, + int x, int y) { - return drawRescaledImage(image, srcX, srcY, - dstX, dstY, - width, height, - desiredWidth, desiredHeight, - useColor, true); + if (!image) + return; + + if (image->mGLImage != mImageCached) + { + completeCache(); + mImageCached = image->mGLImage; + mAlphaCached = image->mAlpha; + } + + const SDL_Rect &imageRect = image->mBounds; + const int srcX = imageRect.x; + const int srcY = imageRect.y; + const int w = imageRect.w; + const int h = imageRect.h; + + if (w == 0 || h == 0) + return; + + const float tw = static_cast<float>(image->mTexWidth); + const float th = static_cast<float>(image->mTexHeight); + + const unsigned int vLimit = mMaxVertices * 4; + + unsigned int vp = mVpCached; + + // Draw a set of textured rectangles +// if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) + { + float texX1 = static_cast<float>(srcX) / tw; + float texY1 = static_cast<float>(srcY) / th; + float texX2 = static_cast<float>(srcX + w) / tw; + float texY2 = static_cast<float>(srcY + h) / th; + + vertFill2D(mFloatTexArrayCached, mShortVertArrayCached, + texX1, texY1, texX2, texY2, + x, y, w, h); + + vp += 12; + if (vp >= vLimit) + { + completeCache(); + vp = 0; + } + else + { + mVpCached = vp; + } + } +} + +void MobileOpenGLGraphics::drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + if (!image) + return; + + if (image->mGLImage != mImageCached) + { + completeCache(); + mImageCached = image->mGLImage; + } + + const SDL_Rect &imageRect = image->mBounds; + const int srcX = imageRect.x; + const int srcY = imageRect.y; + const int iw = imageRect.w; + const int ih = imageRect.h; + + if (iw == 0 || ih == 0) + return; + + const float tw = static_cast<float>(image->mTexWidth); + const float th = static_cast<float>(image->mTexHeight); + + unsigned int vp = mVpCached; + const unsigned int vLimit = mMaxVertices * 4; + // Draw a set of textured rectangles +// if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) +// { + const float texX1 = static_cast<float>(srcX) / tw; + const float texY1 = static_cast<float>(srcY) / th; + + for (int py = 0; py < h; py += ih) + { + const int height = (py + ih >= h) ? h - py : ih; + const float texY2 = static_cast<float>(srcY + height) / th; + const int dstY = y + py; + for (int px = 0; px < w; px += iw) + { + const int width = (px + iw >= w) ? w - px : iw; + const int dstX = x + px; + + const float texX2 = static_cast<float>(srcX + width) / tw; + + vertFill2D(mFloatTexArrayCached, mShortVertArrayCached, + texX1, texY1, texX2, texY2, + dstX, dstY, width, height); + + vp += 12; + if (vp >= vLimit) + { + completeCache(); + vp = 0; + } + } + } +// } + mVpCached = vp; +} + +void MobileOpenGLGraphics::completeCache() +{ + if (!mImageCached) + return; + + setColorAlpha(mAlphaCached); +#ifdef DEBUG_BIND_TEXTURE +// debugBindTexture(image); +#endif + bindTexture(OpenGLImageHelper::mTextureType, mImageCached); + setTexturingAndBlending(true); + + drawTriangleArrayfsCached(mVpCached); + mImageCached = 0; + mVpCached = 0; } bool MobileOpenGLGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, int dstX, int dstY, - const int width, const int height, const int desiredWidth, - const int desiredHeight, - const bool useColor, - bool smooth) + const int desiredHeight) { FUNC_BLOCK("Graphics::drawRescaledImage", 1) if (!image) return false; - // Just draw the image normally when no resizing is necessary, - if (width == desiredWidth && height == desiredHeight) - { - return drawImage2(image, srcX, srcY, dstX, dstY, - width, height, useColor); - } - - // When the desired image is smaller than the current one, - // disable smooth effect. - if (width > desiredWidth && height > desiredHeight) - smooth = false; - const SDL_Rect &imageRect = image->mBounds; - srcX += imageRect.x; - srcY += imageRect.y; - if (!useColor) - setColorAlpha(image->mAlpha); + // Just draw the image normally when no resizing is necessary, + if (imageRect.w == desiredWidth && imageRect.h == desiredHeight) + return drawImageInline(image, dstX, dstY); + setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE debugBindTexture(image); #endif bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); - setTexturingAndBlending(true); // Draw a textured quad. - drawRescaledQuad(image, srcX, srcY, dstX, dstY, width, height, - desiredWidth, desiredHeight); - - if (smooth) // A basic smooth effect... - { - setColorAlpha(0.2F); - drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height, - desiredWidth + 1, desiredHeight + 1); - drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height, - desiredWidth - 1, desiredHeight - 1); - - drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY, width, height, - desiredWidth - 1, desiredHeight); - drawRescaledQuad(image, srcX, srcY, dstX, dstY + 1, width, height, - desiredWidth, desiredHeight - 1); - } + drawRescaledQuad(image, imageRect.x, imageRect.y, dstX, dstY, + imageRect.w, imageRect.h, desiredWidth, desiredHeight); return true; } -void MobileOpenGLGraphics::drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) +void MobileOpenGLGraphics::drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + drawPatternInline(image, x, y, w, h); +} + +void MobileOpenGLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) { - FUNC_BLOCK("Graphics::drawImagePattern", 1) + FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) return; @@ -340,41 +460,9 @@ void MobileOpenGLGraphics::drawImagePattern(const Image *const image, const float texX2 = static_cast<float>(srcX + width) / tw; - mFloatTexArray[vp + 0] = texX1; // 1 - mFloatTexArray[vp + 1] = texY1; - - mFloatTexArray[vp + 2] = texX2; // 2 - mFloatTexArray[vp + 3] = texY1; - - mFloatTexArray[vp + 4] = texX2; // 3 - mFloatTexArray[vp + 5] = texY2; - - mFloatTexArray[vp + 6] = texX1; // 1 - mFloatTexArray[vp + 7] = texY1; - - mFloatTexArray[vp + 8] = texX1; // 4 - mFloatTexArray[vp + 9] = texY2; - - mFloatTexArray[vp + 10] = texX2; // 3 - mFloatTexArray[vp + 11] = texY2; - - mShortVertArray[vp + 0] = static_cast<GLshort>(dstX); - mShortVertArray[vp + 1] = static_cast<GLshort>(dstY); - - mShortVertArray[vp + 2] = static_cast<GLshort>(dstX + width); - mShortVertArray[vp + 3] = static_cast<GLshort>(dstY); - - mShortVertArray[vp + 4] = static_cast<GLshort>(dstX + width); - mShortVertArray[vp + 5] = static_cast<GLshort>(dstY + height); - - mShortVertArray[vp + 6] = static_cast<GLshort>(dstX); - mShortVertArray[vp + 7] = static_cast<GLshort>(dstY); - - mShortVertArray[vp + 8] = static_cast<GLshort>(dstX); - mShortVertArray[vp + 9] = static_cast<GLshort>(dstY + height); - - mShortVertArray[vp + 10] = static_cast<GLshort>(dstX + width); - mShortVertArray[vp + 11] = static_cast<GLshort>(dstY + height); + vertFill2D(mFloatTexArray, mShortVertArray, + texX1, texY1, texX2, texY2, + dstX, dstY, width, height); vp += 12; if (vp >= vLimit) @@ -389,11 +477,11 @@ void MobileOpenGLGraphics::drawImagePattern(const Image *const image, // } } -void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) +void MobileOpenGLGraphics::drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) { if (!image) return; @@ -450,41 +538,9 @@ void MobileOpenGLGraphics::drawRescaledImagePattern(const Image *const image, / scaledWidth; const float texX2 = texX1 + tFractionW * visibleFractionW; - mFloatTexArray[vp + 0] = texX1; - mFloatTexArray[vp + 1] = texY1; - - mFloatTexArray[vp + 2] = texX2; - mFloatTexArray[vp + 3] = texY1; - - mFloatTexArray[vp + 4] = texX2; - mFloatTexArray[vp + 5] = texY2; - - mFloatTexArray[vp + 6] = texX1; - mFloatTexArray[vp + 7] = texY1; - - mFloatTexArray[vp + 8] = texX1; - mFloatTexArray[vp + 9] = texY2; - - mFloatTexArray[vp + 10] = texX2; - mFloatTexArray[vp + 11] = texY2; - - mShortVertArray[vp + 0] = static_cast<GLshort>(dstX); - mShortVertArray[vp + 1] = static_cast<GLshort>(dstY); - - mShortVertArray[vp + 2] = static_cast<GLshort>(dstX + width); - mShortVertArray[vp + 3] = static_cast<GLshort>(dstY); - - mShortVertArray[vp + 4] = static_cast<GLshort>(dstX + width); - mShortVertArray[vp + 5] = static_cast<GLshort>(dstY + height); - - mShortVertArray[vp + 6] = static_cast<GLshort>(dstX); - mShortVertArray[vp + 7] = static_cast<GLshort>(dstY); - - mShortVertArray[vp + 8] = static_cast<GLshort>(dstX); - mShortVertArray[vp + 9] = static_cast<GLshort>(dstY + height); - - mShortVertArray[vp + 10] = static_cast<GLshort>(dstX + width); - mShortVertArray[vp + 11] = static_cast<GLshort>(dstY + height); + vertFill2D(mFloatTexArray, mShortVertArray, + texX1, texY1, texX2, texY2, + dstX, dstY, width, height); vp += 12; if (vp >= vLimit) @@ -528,10 +584,18 @@ inline void MobileOpenGLGraphics::drawVertexes(const } } -void MobileOpenGLGraphics::calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void MobileOpenGLGraphics::calcPattern(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const +{ + calcPatternInline(vert, image, x, y, w, h); +} + +void MobileOpenGLGraphics::calcPatternInline(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const { if (!image || !vert) return; @@ -573,41 +637,9 @@ void MobileOpenGLGraphics::calcImagePattern(ImageVertexes *const vert, const int dstX = x + px; const float texX2 = static_cast<float>(srcX + width) / tw; - floatTexArray[vp + 0] = texX1; - floatTexArray[vp + 1] = texY1; - - floatTexArray[vp + 2] = texX2; - floatTexArray[vp + 3] = texY1; - - floatTexArray[vp + 4] = texX2; - floatTexArray[vp + 5] = texY2; - - floatTexArray[vp + 6] = texX1; - floatTexArray[vp + 7] = texY1; - - floatTexArray[vp + 8] = texX1; - floatTexArray[vp + 9] = texY2; - - floatTexArray[vp + 10] = texX2; - floatTexArray[vp + 11] = texY2; - - shortVertArray[vp + 0] = dstX; - shortVertArray[vp + 1] = dstY; - - shortVertArray[vp + 2] = dstX + width; - shortVertArray[vp + 3] = dstY; - - shortVertArray[vp + 4] = dstX + width; - shortVertArray[vp + 5] = dstY + height; - - shortVertArray[vp + 6] = dstX; - shortVertArray[vp + 7] = dstY; - - shortVertArray[vp + 8] = dstX; - shortVertArray[vp + 9] = dstY + height; - - shortVertArray[vp + 10] = dstX + width; - shortVertArray[vp + 11] = dstY + height; + vertFill2D(floatTexArray, shortVertArray, + texX1, texY1, texX2, texY2, + dstX, dstY, width, height); vp += 12; if (vp >= vLimit) @@ -634,11 +666,11 @@ void MobileOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, vertCol->currentVert = vert; vert->image = image; vertCol->draws.push_back(vert); - calcTileVertexes(vert, image, x, y); + calcTileVertexesInline(vert, image, x, y); } else { - calcTileVertexes(vertCol->currentVert, image, x, y); + calcTileVertexesInline(vertCol->currentVert, image, x, y); } } @@ -662,10 +694,10 @@ void MobileOpenGLGraphics::drawTileCollection(const ImageCollection } } -void MobileOpenGLGraphics::calcImagePattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void MobileOpenGLGraphics::calcPattern(ImageCollection* const vertCol, + const Image *const image, + const int x, const int y, + const int w, const int h) const { ImageVertexes *vert = nullptr; if (vertCol->currentGLImage != image->mGLImage) @@ -681,13 +713,20 @@ void MobileOpenGLGraphics::calcImagePattern(ImageCollection* const vertCol, vert = vertCol->currentVert; } - calcImagePattern(vert, image, x, y, w, h); + calcPatternInline(vert, image, x, y, w, h); } void MobileOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, const Image *const image, int dstX, int dstY) const { + calcTileVertexesInline(vert, image, dstX, dstY); +} + +void MobileOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int dstX, int dstY) const +{ if (!vert || !image) return; @@ -721,41 +760,9 @@ void MobileOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, GLfloat *const floatTexArray = ogl.continueFloatTexArray(); GLshort *const shortVertArray = ogl.continueShortVertArray(); - floatTexArray[vp + 0] = texX1; - floatTexArray[vp + 1] = texY1; - - floatTexArray[vp + 2] = texX2; - floatTexArray[vp + 3] = texY1; - - floatTexArray[vp + 4] = texX2; - floatTexArray[vp + 5] = texY2; - - floatTexArray[vp + 6] = texX1; - floatTexArray[vp + 7] = texY1; - - floatTexArray[vp + 8] = texX1; - floatTexArray[vp + 9] = texY2; - - floatTexArray[vp + 10] = texX2; - floatTexArray[vp + 11] = texY2; - - shortVertArray[vp + 0] = dstX; - shortVertArray[vp + 1] = dstY; - - shortVertArray[vp + 2] = dstX + w; - shortVertArray[vp + 3] = dstY; - - shortVertArray[vp + 4] = dstX + w; - shortVertArray[vp + 5] = dstY + h; - - shortVertArray[vp + 6] = dstX; - shortVertArray[vp + 7] = dstY; - - shortVertArray[vp + 8] = dstX; - shortVertArray[vp + 9] = dstY + h; - - shortVertArray[vp + 10] = dstX + w; - shortVertArray[vp + 11] = dstY + h; + vertFill2D(floatTexArray, shortVertArray, + texX1, texY1, texX2, texY2, + dstX, dstY, w, h); vp += 12; if (vp >= vLimit) @@ -784,7 +791,7 @@ void MobileOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -bool MobileOpenGLGraphics::calcWindow(ImageCollection *const vertCol, +void MobileOpenGLGraphics::calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) @@ -803,11 +810,7 @@ bool MobileOpenGLGraphics::calcWindow(ImageCollection *const vertCol, { vert = vertCol->currentVert; } - - return calcImageRect(vert, x, y, w, h, - imgRect.grid[0], imgRect.grid[2], imgRect.grid[6], imgRect.grid[8], - imgRect.grid[1], imgRect.grid[5], imgRect.grid[7], imgRect.grid[3], - imgRect.grid[4]); + calcImageRect(vert, x, y, w, h, imgRect); } void MobileOpenGLGraphics::updateScreen() @@ -1202,6 +1205,17 @@ inline void MobileOpenGLGraphics::drawTriangleArrayfs(const int size) glDrawArrays(GL_TRIANGLES, 0, size / 2); } +inline void MobileOpenGLGraphics::drawTriangleArrayfsCached(const int size) +{ + glVertexPointer(2, GL_SHORT, 0, mShortVertArrayCached); + glTexCoordPointer(2, GL_FLOAT, 0, mFloatTexArrayCached); + +#ifdef DEBUG_DRAW_CALLS + mDrawCalls ++; +#endif + glDrawArrays(GL_TRIANGLES, 0, size / 2); +} + inline void MobileOpenGLGraphics::drawTriangleArrayfs(const GLshort *const shortVertArray, const GLfloat *const @@ -1270,6 +1284,21 @@ void MobileOpenGLGraphics::restoreColor() mByteColor = mColor; } +void MobileOpenGLGraphics::drawImageRect(const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_drawImageRect.hpp" +} + +void MobileOpenGLGraphics::calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_calcImageRect.hpp" +} + #ifdef DEBUG_BIND_TEXTURE void MobileOpenGLGraphics::debugBindTexture(const Image *const image) { diff --git a/src/render/mobileopenglgraphics.h b/src/render/mobileopenglgraphics.h index ca8d70a3a..f665f743b 100644 --- a/src/render/mobileopenglgraphics.h +++ b/src/render/mobileopenglgraphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -56,108 +56,7 @@ class MobileOpenGLGraphics final : public Graphics ~MobileOpenGLGraphics(); - bool setVideoMode(const int w, const int h, - const int bpp, - const bool fs, - const bool hwaccel, - const bool resize, - const bool noFrame) override final; - - - /** - * Draws a resclaled version of the image - */ - bool drawRescaledImage(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, const int desiredHeight, - const bool useColor) override final; - - /** - * Used to get the smooth rescale option over the standard function. - */ - bool drawRescaledImage(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, const int desiredHeight, - const bool useColor, bool smooth); - - void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; - - /** - * Draw a pattern based on a rescaled version of the given image... - */ - void drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) override final; - - void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; - - void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; - - void calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const override final; - - void drawTileCollection(const ImageCollection - *const vertCol) override final; - - void calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) override final; - - void drawTileVertexes(const ImageVertexes *const vert) override final; - - bool calcWindow(ImageCollection *const vertCol, - const int x, const int y, - const int w, const int h, - const ImageRect &imgRect) override final; - - void updateScreen() override final; - - void _beginDraw() override final; - - void _endDraw() override final; - - bool pushClipArea(gcn::Rectangle area) override final; - - void popClipArea() override final; - - void setColor(const gcn::Color &color) override final - { - mColor = color; - mColor2 = color; - mColorAlpha = (color.a != 255); - } - - void setColorAll(const gcn::Color &color, - const gcn::Color &color2) - { - mColor = color; - mColor2 = color2; - mColorAlpha = (color.a != 255); - } - - void drawPoint(int x, int y) override final; - - void drawLine(int x1, int y1, int x2, int y2) override final; - - void drawRectangle(const gcn::Rectangle &rect, - const bool filled); - - void drawRectangle(const gcn::Rectangle &rect) override final; - - void fillRectangle(const gcn::Rectangle &rect) override final; + #include "render/openglgraphicsdef.hpp" inline void drawTriangleArrayfs(const GLshort *const shortVertArray, const GLfloat *const floatTexArray, @@ -165,33 +64,23 @@ class MobileOpenGLGraphics final : public Graphics inline void drawTriangleArrayfs(const int size); + inline void drawTriangleArrayfsCached(const int size); + inline void drawLineArrays(const int size); inline void drawVertexes(const NormalOpenGLGraphicsVertexes &ogl); - void initArrays() override final; - - static void dumpSettings(); - - /** - * Takes a screenshot and returns it as SDL surface. - */ - SDL_Surface *getScreenshot() override final A_WARN_UNUSED; - - void prepareScreenshot() override final; - bool drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height) override final; - int getMemoryUsage(); - - void updateTextureFormat(); + void initArrays() override final; - bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + /** + * Draws a rectangle using images. 4 corner images, 4 side images and 1 + * image for the inside. + */ + void drawImageRect(int x, int y, int w, int h, + const ImageRect &imgRect); #ifdef DEBUG_DRAW_CALLS unsigned int getDrawCalls() const @@ -202,10 +91,6 @@ class MobileOpenGLGraphics final : public Graphics static unsigned int mLastDrawCalls; #endif - static void bindTexture(const GLenum target, const GLuint texture); - - static GLuint mLastImage; - protected: void setTexturingAndBlending(const bool enable); @@ -216,14 +101,34 @@ class MobileOpenGLGraphics final : public Graphics void inline restoreColor(); + void inline calcImageRect(ImageVertexes *const vert, + int x, int y, + int w, int h, + const ImageRect &imgRect); + + void inline calcPatternInline(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const; + + void inline calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const; + + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); + GLfloat *mFloatTexArray; - GLint *mIntTexArray; - GLint *mIntVertArray; GLshort *mShortVertArray; + GLfloat *mFloatTexArrayCached; + GLshort *mShortVertArrayCached; + float mAlphaCached; + int mVpCached; bool mTexture; bool mIsByteColor; gcn::Color mByteColor; + GLuint mImageCached; float mFloatColor; int mMaxVertices; bool mColorAlpha; diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index 76f95cf9c..5b7abd895 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -37,6 +37,43 @@ #include "debug.h" +#define vertFill2D(tVar, vVar, x1, y1, x2, y2, dstX, dstY, w, h) \ + tVar[vp + 0] = x1; \ + tVar[vp + 1] = y1; \ + tVar[vp + 2] = x2; \ + tVar[vp + 3] = y1; \ + tVar[vp + 4] = x2; \ + tVar[vp + 5] = y2; \ + tVar[vp + 6] = x1; \ + tVar[vp + 7] = y2; \ + vVar[vp + 0] = dstX; \ + vVar[vp + 1] = dstY; \ + vVar[vp + 2] = dstX + w; \ + vVar[vp + 3] = dstY; \ + vVar[vp + 4] = dstX + w; \ + vVar[vp + 5] = dstY + h; \ + vVar[vp + 6] = dstX; \ + vVar[vp + 7] = dstY + h; + + +#define vertFillNv(tVar, vVar, srcX, srcY, dstX, dstY, w, h) \ + tVar[vp + 0] = srcX; \ + tVar[vp + 1] = srcY; \ + tVar[vp + 2] = srcX + w; \ + tVar[vp + 3] = srcY; \ + tVar[vp + 4] = srcX + w; \ + tVar[vp + 5] = srcY + h; \ + tVar[vp + 6] = srcX; \ + tVar[vp + 7] = srcY + h; \ + vVar[vp + 0] = dstX; \ + vVar[vp + 1] = dstY; \ + vVar[vp + 2] = dstX + w; \ + vVar[vp + 3] = dstY; \ + vVar[vp + 4] = dstX + w; \ + vVar[vp + 5] = dstY + h; \ + vVar[vp + 6] = dstX; \ + vVar[vp + 7] = dstY + h; + GLuint NormalOpenGLGraphics::mLastImage = 0; #ifdef DEBUG_DRAW_CALLS unsigned int NormalOpenGLGraphics::mDrawCalls = 0; @@ -51,9 +88,15 @@ NormalOpenGLGraphics::NormalOpenGLGraphics(): mFloatTexArray(nullptr), mIntTexArray(nullptr), mIntVertArray(nullptr), + mFloatTexArrayCached(nullptr), + mIntTexArrayCached(nullptr), + mIntVertArrayCached(nullptr), + mAlphaCached(1.0F), + mVpCached(0), mTexture(false), mIsByteColor(false), mByteColor(), + mImageCached(0), mFloatColor(1.0F), mMaxVertices(500), mColorAlpha(false), @@ -72,6 +115,9 @@ NormalOpenGLGraphics::~NormalOpenGLGraphics() delete [] mFloatTexArray; delete [] mIntTexArray; delete [] mIntVertArray; + delete [] mFloatTexArrayCached; + delete [] mIntTexArrayCached; + delete [] mIntVertArrayCached; } void NormalOpenGLGraphics::initArrays() @@ -88,6 +134,9 @@ void NormalOpenGLGraphics::initArrays() mFloatTexArray = new GLfloat[sz]; mIntTexArray = new GLint[sz]; mIntVertArray = new GLint[sz]; + mFloatTexArrayCached = new GLfloat[sz]; + mIntTexArrayCached = new GLint[sz]; + mIntVertArrayCached = new GLint[sz]; } bool NormalOpenGLGraphics::setVideoMode(const int w, const int h, @@ -234,115 +283,253 @@ static inline void drawRescaledQuad(const Image *const image, } } - bool NormalOpenGLGraphics::drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) + int dstX, int dstY) +{ + return drawImageInline(image, dstX, dstY); +} + +bool NormalOpenGLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) if (!image) return false; - const SDL_Rect &imageRect = image->mBounds; - - if (!useColor) - setColorAlpha(image->mAlpha); + setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE debugBindTexture(image); #endif bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); - setTexturingAndBlending(true); - drawQuad(image, srcX + imageRect.x, srcY + imageRect.y, - dstX, dstY, width, height); + const SDL_Rect &imageRect = image->mBounds; + drawQuad(image, imageRect.x, imageRect.y, + dstX, dstY, imageRect.w, imageRect.h); return true; } -bool NormalOpenGLGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, - const int desiredHeight, - const bool useColor) +void NormalOpenGLGraphics::drawImageCached(const Image *const image, + int x, int y) +{ + if (!image) + return; + + if (image->mGLImage != mImageCached) + { + completeCache(); + mImageCached = image->mGLImage; + mAlphaCached = image->mAlpha; + } + + const SDL_Rect &imageRect = image->mBounds; + const int w = imageRect.w; + const int h = imageRect.h; + + if (w == 0 || h == 0) + return; + + const int srcX = imageRect.x; + const int srcY = imageRect.y; + + const float tw = static_cast<float>(image->mTexWidth); + const float th = static_cast<float>(image->mTexHeight); + + const unsigned int vLimit = mMaxVertices * 4; + + unsigned int vp = mVpCached; + + // Draw a set of textured rectangles + if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) + { + const float texX1 = static_cast<float>(srcX) / tw; + const float texY1 = static_cast<float>(srcY) / th; + + const float texX2 = static_cast<float>(srcX + w) / tw; + const float texY2 = static_cast<float>(srcY + h) / th; + + vertFill2D(mFloatTexArrayCached, mIntVertArrayCached, + texX1, texY1, texX2, texY2, + x, y, w, h); + + vp += 8; + if (vp >= vLimit) + { + completeCache(); + vp = 0; + } + else + { + mVpCached = vp; + } + } + else + { + vertFillNv(mIntTexArrayCached, mIntVertArrayCached, + srcX, srcY, x, y, w, h); + + vp += 8; + if (vp >= vLimit) + { + completeCache(); + vp = 0; + } + else + { + mVpCached = vp; + } + } +} + +void NormalOpenGLGraphics::drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPatternCached", 1) + if (!image) + return; + + if (image->mGLImage != mImageCached) + { + completeCache(); + mImageCached = image->mGLImage; + } + + const SDL_Rect &imageRect = image->mBounds; + const int srcX = imageRect.x; + const int srcY = imageRect.y; + const int iw = imageRect.w; + const int ih = imageRect.h; + + if (iw == 0 || ih == 0) + return; + + const float tw = static_cast<float>(image->mTexWidth); + const float th = static_cast<float>(image->mTexHeight); + + unsigned int vp = mVpCached; + const unsigned int vLimit = mMaxVertices * 4; + // Draw a set of textured rectangles + if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) + { + const float texX1 = static_cast<float>(srcX) / tw; + const float texY1 = static_cast<float>(srcY) / th; + + for (int py = 0; py < h; py += ih) + { + const int height = (py + ih >= h) ? h - py : ih; + const int dstY = y + py; + const float texY2 = static_cast<float>(srcY + height) / th; + for (int px = 0; px < w; px += iw) + { + const int width = (px + iw >= w) ? w - px : iw; + const int dstX = x + px; + + const float texX2 = static_cast<float>(srcX + width) / tw; + + vertFill2D(mFloatTexArrayCached, mIntVertArrayCached, + texX1, texY1, texX2, texY2, + dstX, dstY, width, height); + + vp += 8; + if (vp >= vLimit) + { + completeCache(); + vp = 0; + } + } + } + } + else + { + for (int py = 0; py < h; py += ih) + { + const int height = (py + ih >= h) ? h - py : ih; + const int dstY = y + py; + for (int px = 0; px < w; px += iw) + { + const int width = (px + iw >= w) ? w - px : iw; + const int dstX = x + px; + + vertFillNv(mIntTexArrayCached, mIntVertArrayCached, + srcX, srcY, dstX, dstY, width, height); + + vp += 8; + if (vp >= vLimit) + { + completeCache(); + vp = 0; + } + } + } + } + mVpCached = vp; +} + +void NormalOpenGLGraphics::completeCache() { - return drawRescaledImage(image, srcX, srcY, - dstX, dstY, - width, height, - desiredWidth, desiredHeight, - useColor, true); + if (!mImageCached) + return; + + setColorAlpha(mAlphaCached); +#ifdef DEBUG_BIND_TEXTURE +// debugBindTexture(image); +#endif + bindTexture(OpenGLImageHelper::mTextureType, mImageCached); + setTexturingAndBlending(true); + + if (OpenGLImageHelper::mTextureType == GL_TEXTURE_2D) + drawQuadArrayfiCached(mVpCached); + else + drawQuadArrayiiCached(mVpCached); + + mImageCached = 0; + mVpCached = 0; } bool NormalOpenGLGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, int dstX, int dstY, - const int width, const int height, const int desiredWidth, - const int desiredHeight, - const bool useColor, - bool smooth) + const int desiredHeight) { FUNC_BLOCK("Graphics::drawRescaledImage", 1) if (!image) return false; - // Just draw the image normally when no resizing is necessary, - if (width == desiredWidth && height == desiredHeight) - { - return drawImage2(image, srcX, srcY, dstX, dstY, - width, height, useColor); - } - - // When the desired image is smaller than the current one, - // disable smooth effect. - if (width > desiredWidth && height > desiredHeight) - smooth = false; - const SDL_Rect &imageRect = image->mBounds; - srcX += imageRect.x; - srcY += imageRect.y; - if (!useColor) - setColorAlpha(image->mAlpha); + // Just draw the image normally when no resizing is necessary, + if (imageRect.w == desiredWidth && imageRect.h == desiredHeight) + return drawImageInline(image, dstX, dstY); + setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE debugBindTexture(image); #endif bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); - setTexturingAndBlending(true); // Draw a textured quad. - drawRescaledQuad(image, srcX, srcY, dstX, dstY, width, height, - desiredWidth, desiredHeight); - - if (smooth) // A basic smooth effect... - { - setColorAlpha(0.2F); - drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height, - desiredWidth + 1, desiredHeight + 1); - drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height, - desiredWidth - 1, desiredHeight - 1); - - drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY, width, height, - desiredWidth - 1, desiredHeight); - drawRescaledQuad(image, srcX, srcY, dstX, dstY + 1, width, height, - desiredWidth, desiredHeight - 1); - } + drawRescaledQuad(image, imageRect.x, imageRect.y, dstX, dstY, + imageRect.w, imageRect.h, desiredWidth, desiredHeight); return true; } -void NormalOpenGLGraphics::drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) +void NormalOpenGLGraphics::drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) { - FUNC_BLOCK("Graphics::drawImagePattern", 1) + drawPatternInline(image, x, y, w, h); +} + +void NormalOpenGLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) return; @@ -384,32 +571,11 @@ void NormalOpenGLGraphics::drawImagePattern(const Image *const image, { const int width = (px + iw >= w) ? w - px : iw; const int dstX = x + px; - const float texX2 = static_cast<float>(srcX + width) / tw; - mFloatTexArray[vp + 0] = texX1; - mFloatTexArray[vp + 1] = texY1; - - mFloatTexArray[vp + 2] = texX2; - mFloatTexArray[vp + 3] = texY1; - - mFloatTexArray[vp + 4] = texX2; - mFloatTexArray[vp + 5] = texY2; - - mFloatTexArray[vp + 6] = texX1; - mFloatTexArray[vp + 7] = texY2; - - mIntVertArray[vp + 0] = dstX; - mIntVertArray[vp + 1] = dstY; - - mIntVertArray[vp + 2] = dstX + width; - mIntVertArray[vp + 3] = dstY; - - mIntVertArray[vp + 4] = dstX + width; - mIntVertArray[vp + 5] = dstY + height; - - mIntVertArray[vp + 6] = dstX; - mIntVertArray[vp + 7] = dstY + height; + vertFill2D(mFloatTexArray, mIntVertArray, + texX1, texY1, texX2, texY2, + dstX, dstY, width, height); vp += 8; if (vp >= vLimit) @@ -433,29 +599,8 @@ void NormalOpenGLGraphics::drawImagePattern(const Image *const image, const int width = (px + iw >= w) ? w - px : iw; const int dstX = x + px; - mIntTexArray[vp + 0] = srcX; - mIntTexArray[vp + 1] = srcY; - - mIntTexArray[vp + 2] = srcX + width; - mIntTexArray[vp + 3] = srcY; - - mIntTexArray[vp + 4] = srcX + width; - mIntTexArray[vp + 5] = srcY + height; - - mIntTexArray[vp + 6] = srcX; - mIntTexArray[vp + 7] = srcY + height; - - mIntVertArray[vp + 0] = dstX; - mIntVertArray[vp + 1] = dstY; - - mIntVertArray[vp + 2] = dstX + width; - mIntVertArray[vp + 3] = dstY; - - mIntVertArray[vp + 4] = dstX + width; - mIntVertArray[vp + 5] = dstY + height; - - mIntVertArray[vp + 6] = dstX; - mIntVertArray[vp + 7] = dstY + height; + vertFillNv(mIntTexArray, mIntVertArray, + srcX, srcY, dstX, dstY, width, height); vp += 8; if (vp >= vLimit) @@ -470,11 +615,11 @@ void NormalOpenGLGraphics::drawImagePattern(const Image *const image, } } -void NormalOpenGLGraphics::drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) +void NormalOpenGLGraphics::drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) { if (!image) return; @@ -532,29 +677,9 @@ void NormalOpenGLGraphics::drawRescaledImagePattern(const Image *const image, / scaledWidth; const float texX2 = texX1 + tFractionW * visibleFractionW; - mFloatTexArray[vp + 0] = texX1; - mFloatTexArray[vp + 1] = texY1; - - mFloatTexArray[vp + 2] = texX2; - mFloatTexArray[vp + 3] = texY1; - - mFloatTexArray[vp + 4] = texX2; - mFloatTexArray[vp + 5] = texY2; - - mFloatTexArray[vp + 6] = texX1; - mFloatTexArray[vp + 7] = texY2; - - mIntVertArray[vp + 0] = dstX; - mIntVertArray[vp + 1] = dstY; - - mIntVertArray[vp + 2] = dstX + width; - mIntVertArray[vp + 3] = dstY; - - mIntVertArray[vp + 4] = dstX + width; - mIntVertArray[vp + 5] = dstY + height; - - mIntVertArray[vp + 6] = dstX; - mIntVertArray[vp + 7] = dstY + height; + vertFill2D(mFloatTexArray, mIntVertArray, + texX1, texY1, texX2, texY2, + dstX, dstY, width, height); vp += 8; if (vp >= vLimit) @@ -665,10 +790,18 @@ inline void NormalOpenGLGraphics::drawVertexes(const } } -void NormalOpenGLGraphics::calcImagePattern(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void NormalOpenGLGraphics::calcPattern(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const +{ + calcPatternInline(vert, image, x, y, w, h); +} + +void NormalOpenGLGraphics::calcPatternInline(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const { if (!image || !vert) return; @@ -710,29 +843,9 @@ void NormalOpenGLGraphics::calcImagePattern(ImageVertexes* const vert, const int dstX = x + px; const float texX2 = static_cast<float>(srcX + width) / tw; - floatTexArray[vp + 0] = texX1; - floatTexArray[vp + 1] = texY1; - - floatTexArray[vp + 2] = texX2; - floatTexArray[vp + 3] = texY1; - - floatTexArray[vp + 4] = texX2; - floatTexArray[vp + 5] = texY2; - - floatTexArray[vp + 6] = texX1; - floatTexArray[vp + 7] = texY2; - - intVertArray[vp + 0] = dstX; - intVertArray[vp + 1] = dstY; - - intVertArray[vp + 2] = dstX + width; - intVertArray[vp + 3] = dstY; - - intVertArray[vp + 4] = dstX + width; - intVertArray[vp + 5] = dstY + height; - - intVertArray[vp + 6] = dstX; - intVertArray[vp + 7] = dstY + height; + vertFill2D(floatTexArray, intVertArray, + texX1, texY1, texX2, texY2, + dstX, dstY, width, height); vp += 8; if (vp >= vLimit) @@ -759,29 +872,8 @@ void NormalOpenGLGraphics::calcImagePattern(ImageVertexes* const vert, const int width = (px + iw >= w) ? w - px : iw; const int dstX = x + px; - intTexArray[vp + 0] = srcX; - intTexArray[vp + 1] = srcY; - - intTexArray[vp + 2] = srcX + width; - intTexArray[vp + 3] = srcY; - - intTexArray[vp + 4] = srcX + width; - intTexArray[vp + 5] = srcY + height; - - intTexArray[vp + 6] = srcX; - intTexArray[vp + 7] = srcY + height; - - intVertArray[vp + 0] = dstX; - intVertArray[vp + 1] = dstY; - - intVertArray[vp + 2] = dstX + width; - intVertArray[vp + 3] = dstY; - - intVertArray[vp + 4] = dstX + width; - intVertArray[vp + 5] = dstY + height; - - intVertArray[vp + 6] = dstX; - intVertArray[vp + 7] = dstY + height; + vertFillNv(intTexArray, intVertArray, + srcX, srcY, dstX, dstY, width, height); vp += 8; if (vp >= vLimit) @@ -808,11 +900,11 @@ void NormalOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, vertCol->currentVert = vert; vert->image = image; vertCol->draws.push_back(vert); - calcTileVertexes(vert, image, x, y); + calcTileVertexesInline(vert, image, x, y); } else { - calcTileVertexes(vertCol->currentVert, image, x, y); + calcTileVertexesInline(vertCol->currentVert, image, x, y); } } @@ -836,10 +928,10 @@ void NormalOpenGLGraphics::drawTileCollection(const ImageCollection } } -void NormalOpenGLGraphics::calcImagePattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void NormalOpenGLGraphics::calcPattern(ImageCollection* const vertCol, + const Image *const image, + const int x, const int y, + const int w, const int h) const { ImageVertexes *vert = nullptr; if (vertCol->currentGLImage != image->mGLImage) @@ -855,13 +947,20 @@ void NormalOpenGLGraphics::calcImagePattern(ImageCollection* const vertCol, vert = vertCol->currentVert; } - calcImagePattern(vert, image, x, y, w, h); + calcPatternInline(vert, image, x, y, w, h); } void NormalOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, const Image *const image, int dstX, int dstY) const { + calcTileVertexesInline(vert, image, dstX, dstY); +} + +void NormalOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int dstX, int dstY) const +{ if (!vert || !image) return; @@ -897,29 +996,9 @@ void NormalOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, GLfloat *const floatTexArray = ogl.continueFloatTexArray(); GLint *const intVertArray = ogl.continueIntVertArray(); - floatTexArray[vp + 0] = texX1; - floatTexArray[vp + 1] = texY1; - - floatTexArray[vp + 2] = texX2; - floatTexArray[vp + 3] = texY1; - - floatTexArray[vp + 4] = texX2; - floatTexArray[vp + 5] = texY2; - - floatTexArray[vp + 6] = texX1; - floatTexArray[vp + 7] = texY2; - - intVertArray[vp + 0] = dstX; - intVertArray[vp + 1] = dstY; - - intVertArray[vp + 2] = dstX + w; - intVertArray[vp + 3] = dstY; - - intVertArray[vp + 4] = dstX + w; - intVertArray[vp + 5] = dstY + h; - - intVertArray[vp + 6] = dstX; - intVertArray[vp + 7] = dstY + h; + vertFill2D(floatTexArray, intVertArray, + texX1, texY1, texX2, texY2, + dstX, dstY, w, h); vp += 8; if (vp >= vLimit) @@ -935,29 +1014,8 @@ void NormalOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, GLint *const intTexArray = ogl.continueIntTexArray(); GLint *const intVertArray = ogl.continueIntVertArray(); - intTexArray[vp + 0] = srcX; - intTexArray[vp + 1] = srcY; - - intTexArray[vp + 2] = srcX + w; - intTexArray[vp + 3] = srcY; - - intTexArray[vp + 4] = srcX + w; - intTexArray[vp + 5] = srcY + h; - - intTexArray[vp + 6] = srcX; - intTexArray[vp + 7] = srcY + h; - - intVertArray[vp + 0] = dstX; - intVertArray[vp + 1] = dstY; - - intVertArray[vp + 2] = dstX + w; - intVertArray[vp + 3] = dstY; - - intVertArray[vp + 4] = dstX + w; - intVertArray[vp + 5] = dstY + h; - - intVertArray[vp + 6] = dstX; - intVertArray[vp + 7] = dstY + h; + vertFillNv(intTexArray, intVertArray, + srcX, srcY, dstX, dstY, w, h); vp += 8; if (vp >= vLimit) @@ -986,7 +1044,7 @@ void NormalOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -bool NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, +void NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) @@ -994,7 +1052,7 @@ bool NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, ImageVertexes *vert = nullptr; Image *const image = imgRect.grid[4]; if (!image) - return false; + return; if (vertCol->currentGLImage != image->mGLImage) { vert = new ImageVertexes(); @@ -1007,12 +1065,7 @@ bool NormalOpenGLGraphics::calcWindow(ImageCollection *const vertCol, { vert = vertCol->currentVert; } - - const Image *const *const grid = &imgRect.grid[0]; - return calcImageRect(vert, x, y, w, h, - grid[0], grid[2], grid[6], grid[8], - grid[1], grid[5], grid[7], grid[3], - grid[4]); + calcImageRect(vert, x, y, w, h, imgRect); } void NormalOpenGLGraphics::updateScreen() @@ -1391,6 +1444,17 @@ inline void NormalOpenGLGraphics::drawQuadArrayfi(const int size) glDrawArrays(GL_QUADS, 0, size / 2); } +inline void NormalOpenGLGraphics::drawQuadArrayfiCached(const int size) +{ + glVertexPointer(2, GL_INT, 0, mIntVertArrayCached); + glTexCoordPointer(2, GL_FLOAT, 0, mFloatTexArrayCached); + +#ifdef DEBUG_DRAW_CALLS + mDrawCalls ++; +#endif + glDrawArrays(GL_QUADS, 0, size / 2); +} + inline void NormalOpenGLGraphics::drawQuadArrayfi(const GLint *const intVertArray, const GLfloat *const @@ -1417,6 +1481,17 @@ inline void NormalOpenGLGraphics::drawQuadArrayii(const int size) glDrawArrays(GL_QUADS, 0, size / 2); } +inline void NormalOpenGLGraphics::drawQuadArrayiiCached(const int size) +{ + glVertexPointer(2, GL_INT, 0, mIntVertArrayCached); + glTexCoordPointer(2, GL_INT, 0, mIntTexArrayCached); + +#ifdef DEBUG_DRAW_CALLS + mDrawCalls ++; +#endif + glDrawArrays(GL_QUADS, 0, size / 2); +} + inline void NormalOpenGLGraphics::drawQuadArrayii(const GLint *const intVertArray, const GLint *const @@ -1495,6 +1570,21 @@ void NormalOpenGLGraphics::restoreColor() mByteColor = mColor; } +void NormalOpenGLGraphics::drawImageRect(const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_drawImageRect.hpp" +} + +void NormalOpenGLGraphics::calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_calcImageRect.hpp" +} + #ifdef DEBUG_BIND_TEXTURE void NormalOpenGLGraphics::debugBindTexture(const Image *const image) { diff --git a/src/render/normalopenglgraphics.h b/src/render/normalopenglgraphics.h index 7042cf413..882ff5ed8 100644 --- a/src/render/normalopenglgraphics.h +++ b/src/render/normalopenglgraphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -56,116 +56,20 @@ class NormalOpenGLGraphics final : public Graphics ~NormalOpenGLGraphics(); - bool setVideoMode(const int w, const int h, - const int bpp, - const bool fs, - const bool hwaccel, - const bool resize, - const bool noFrame) override final; - - - /** - * Draws a resclaled version of the image - */ - bool drawRescaledImage(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, const int desiredHeight, - const bool useColor) override final; - - /** - * Used to get the smooth rescale option over the standard function. - */ - bool drawRescaledImage(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, const int desiredHeight, - const bool useColor, bool smooth); - - void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; - - /** - * Draw a pattern based on a rescaled version of the given image... - */ - void drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) override final; - - void calcImagePattern(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; - - void calcImagePattern(ImageCollection* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; - - void calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const override final; - - void calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) override final; - - void drawTileCollection(const ImageCollection *const vertCol) - override final; - - void drawTileVertexes(const ImageVertexes *const vert) override final; - - bool calcWindow(ImageCollection *const vertCol, - const int x, const int y, - const int w, const int h, - const ImageRect &imgRect) override final; - - void updateScreen() override final; - - void _beginDraw() override final; - - void _endDraw() override final; - - bool pushClipArea(gcn::Rectangle area) override final; - - void popClipArea() override final; - - void setColor(const gcn::Color &color) override final - { - mColor = color; - mColor2 = color; - mColorAlpha = (color.a != 255); - } - - void setColorAll(const gcn::Color &color, const gcn::Color &color2) - { - mColor = color; - mColor2 = color2; - mColorAlpha = (color.a != 255); - } - - void drawPoint(int x, int y) override final; - - void drawLine(int x1, int y1, int x2, int y2) override final; - - void drawRectangle(const gcn::Rectangle &rect, - const bool filled); - - void drawRectangle(const gcn::Rectangle &rect) override final; - - void fillRectangle(const gcn::Rectangle &rect) override final; + #include "render/openglgraphicsdef.hpp" inline void drawQuadArrayfi(const int size); + inline void drawQuadArrayfiCached(const int size); + inline void drawQuadArrayfi(const GLint *const intVertArray, const GLfloat *const floatTexArray, const int size); inline void drawQuadArrayii(const int size); + inline void drawQuadArrayiiCached(const int size); + inline void drawQuadArrayii(const GLint *const intVertArray, const GLint *const intTexArray, const int size); @@ -176,29 +80,17 @@ class NormalOpenGLGraphics final : public Graphics inline void drawVertexes(const NormalOpenGLGraphicsVertexes &ogl); - void initArrays() override final; - - static void dumpSettings(); - - /** - * Takes a screenshot and returns it as SDL surface. - */ - SDL_Surface *getScreenshot() override final A_WARN_UNUSED; - - void prepareScreenshot() override final; - bool drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height) override final; - int getMemoryUsage() A_WARN_UNUSED; - - void updateTextureFormat(); + void initArrays() override final; - bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + /** + * Draws a rectangle using images. 4 corner images, 4 side images and 1 + * image for the inside. + */ + void drawImageRect(int x, int y, int w, int h, + const ImageRect &imgRect); #ifdef DEBUG_DRAW_CALLS unsigned int getDrawCalls() const @@ -212,9 +104,6 @@ class NormalOpenGLGraphics final : public Graphics unsigned int getBinds() const { return mLastBinds; } #endif - static void bindTexture(const GLenum target, const GLuint texture); - - static GLuint mLastImage; protected: void setTexturingAndBlending(const bool enable); @@ -226,13 +115,36 @@ class NormalOpenGLGraphics final : public Graphics void inline restoreColor(); + void inline calcImageRect(ImageVertexes *const vert, + int x, int y, + int w, int h, + const ImageRect &imgRect); + + void inline calcPatternInline(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const; + + void inline calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const; + + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); + GLfloat *mFloatTexArray; GLint *mIntTexArray; GLint *mIntVertArray; + GLfloat *mFloatTexArrayCached; + GLint *mIntTexArrayCached; + GLint *mIntVertArrayCached; + float mAlphaCached; + int mVpCached; bool mTexture; bool mIsByteColor; gcn::Color mByteColor; + GLuint mImageCached; float mFloatColor; int mMaxVertices; bool mColorAlpha; diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index 0a831513b..2f1a59976 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -136,116 +136,91 @@ static inline void drawRescaledQuad(const Image *const image A_UNUSED, } } - bool NullOpenGLGraphics::drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) + int dstX, int dstY) +{ + return drawImageInline(image, dstX, dstY); +} + +bool NullOpenGLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) if (!image) return false; - const SDL_Rect &imageRect = image->mBounds; - srcX += imageRect.x; - srcY += imageRect.y; - - if (!useColor) - setColorAlpha(image->mAlpha); - + setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE debugBindTexture(image); #endif bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); - setTexturingAndBlending(true); - drawQuad(image, srcX, srcY, dstX, dstY, width, height); + const SDL_Rect &imageRect = image->mBounds; + drawQuad(image, imageRect.x, imageRect.y, dstX, dstY, + imageRect.w, imageRect.h); return true; } -bool NullOpenGLGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, - const int desiredHeight, - const bool useColor) +void NullOpenGLGraphics::drawImageCached(const Image *const image A_UNUSED, + int x A_UNUSED, int y A_UNUSED) +{ +} + +void NullOpenGLGraphics::drawPatternCached(const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED) +{ +} + +void NullOpenGLGraphics::completeCache() { - return drawRescaledImage(image, srcX, srcY, - dstX, dstY, - width, height, - desiredWidth, desiredHeight, - useColor, true); } bool NullOpenGLGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, int dstX, int dstY, - const int width, const int height, const int desiredWidth, - const int desiredHeight, - const bool useColor, - bool smooth) + const int desiredHeight) { FUNC_BLOCK("Graphics::drawRescaledImage", 1) if (!image) return false; - // Just draw the image normally when no resizing is necessary, - if (width == desiredWidth && height == desiredHeight) - { - return drawImage2(image, srcX, srcY, dstX, dstY, - width, height, useColor); - } - - // When the desired image is smaller than the current one, - // disable smooth effect. - if (width > desiredWidth && height > desiredHeight) - smooth = false; - const SDL_Rect &imageRect = image->mBounds; - srcX += imageRect.x; - srcY += imageRect.y; - if (!useColor) - setColorAlpha(image->mAlpha); + // Just draw the image normally when no resizing is necessary, + if (imageRect.w == desiredWidth && imageRect.h == desiredHeight) + return drawImageInline(image, dstX, dstY); + setColorAlpha(image->mAlpha); #ifdef DEBUG_BIND_TEXTURE debugBindTexture(image); #endif bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); - setTexturingAndBlending(true); // Draw a textured quad. - drawRescaledQuad(image, srcX, srcY, dstX, dstY, width, height, - desiredWidth, desiredHeight); - - if (smooth) // A basic smooth effect... - { - setColorAlpha(0.2F); - drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height, - desiredWidth + 1, desiredHeight + 1); - drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height, - desiredWidth - 1, desiredHeight - 1); - - drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY, width, height, - desiredWidth - 1, desiredHeight); - drawRescaledQuad(image, srcX, srcY, dstX, dstY + 1, width, height, - desiredWidth, desiredHeight - 1); - } + drawRescaledQuad(image, imageRect.x, imageRect.y, dstX, dstY, + imageRect.w, imageRect.h, desiredWidth, desiredHeight); return true; } -void NullOpenGLGraphics::drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) +void NullOpenGLGraphics::drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) { - FUNC_BLOCK("Graphics::drawImagePattern", 1) + drawPatternInline(image, x, y, w, h); +} + +void NullOpenGLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) return; @@ -373,11 +348,11 @@ void NullOpenGLGraphics::drawImagePattern(const Image *const image, } } -void NullOpenGLGraphics::drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) +void NullOpenGLGraphics::drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) { if (!image) return; @@ -568,10 +543,18 @@ inline void NullOpenGLGraphics::drawVertexes(const } } -void NullOpenGLGraphics::calcImagePattern(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void NullOpenGLGraphics::calcPattern(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const +{ + calcPatternInline(vert, image, x, y, w, h); +} + +void NullOpenGLGraphics::calcPatternInline(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const { if (!image || !vert) return; @@ -711,11 +694,11 @@ void NullOpenGLGraphics::calcTileCollection(ImageCollection *const vertCol, vertCol->currentVert = vert; vert->image = image; vertCol->draws.push_back(vert); - calcTileVertexes(vert, image, x, y); + calcTileVertexesInline(vert, image, x, y); } else { - calcTileVertexes(vertCol->currentVert, image, x, y); + calcTileVertexesInline(vertCol->currentVert, image, x, y); } } @@ -739,10 +722,10 @@ void NullOpenGLGraphics::drawTileCollection(const ImageCollection } } -void NullOpenGLGraphics::calcImagePattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void NullOpenGLGraphics::calcPattern(ImageCollection* const vertCol, + const Image *const image, + const int x, const int y, + const int w, const int h) const { ImageVertexes *vert = nullptr; if (vertCol->currentGLImage != image->mGLImage) @@ -758,13 +741,20 @@ void NullOpenGLGraphics::calcImagePattern(ImageCollection* const vertCol, vert = vertCol->currentVert; } - calcImagePattern(vert, image, x, y, w, h); + calcPatternInline(vert, image, x, y, w, h); } void NullOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert, const Image *const image, int dstX, int dstY) const { + calcTileVertexesInline(vert, image, dstX, dstY); +} + +void NullOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int dstX, int dstY) const +{ if (!vert || !image) return; @@ -889,7 +879,7 @@ void NullOpenGLGraphics::drawTileVertexes(const ImageVertexes *const vert) drawVertexes(vert->ogl); } -bool NullOpenGLGraphics::calcWindow(ImageCollection *const vertCol, +void NullOpenGLGraphics::calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) @@ -897,7 +887,7 @@ bool NullOpenGLGraphics::calcWindow(ImageCollection *const vertCol, ImageVertexes *vert = nullptr; Image *const image = imgRect.grid[4]; if (!image) - return false; + return; if (vertCol->currentGLImage != image->mGLImage) { vert = new ImageVertexes(); @@ -910,11 +900,7 @@ bool NullOpenGLGraphics::calcWindow(ImageCollection *const vertCol, { vert = vertCol->currentVert; } - - return calcImageRect(vert, x, y, w, h, - imgRect.grid[0], imgRect.grid[2], imgRect.grid[6], imgRect.grid[8], - imgRect.grid[1], imgRect.grid[5], imgRect.grid[7], imgRect.grid[3], - imgRect.grid[4]); + calcImageRect(vert, x, y, w, h, imgRect); } void NullOpenGLGraphics::updateScreen() @@ -1173,6 +1159,21 @@ void NullOpenGLGraphics::restoreColor() mByteColor = mColor; } +void NullOpenGLGraphics::drawImageRect(const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_drawImageRect.hpp" +} + +void NullOpenGLGraphics::calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_calcImageRect.hpp" +} + #ifdef DEBUG_BIND_TEXTURE void NullOpenGLGraphics::debugBindTexture(const Image *const image) { diff --git a/src/render/nullopenglgraphics.h b/src/render/nullopenglgraphics.h index 82285f90d..cbab0614d 100644 --- a/src/render/nullopenglgraphics.h +++ b/src/render/nullopenglgraphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -56,107 +56,7 @@ class NullOpenGLGraphics final : public Graphics ~NullOpenGLGraphics(); - bool setVideoMode(const int w, const int h, - const int bpp, - const bool fs, - const bool hwaccel, - const bool resize, - const bool noFrame) override final; - - - /** - * Draws a resclaled version of the image - */ - bool drawRescaledImage(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, const int desiredHeight, - const bool useColor) override final; - - /** - * Used to get the smooth rescale option over the standard function. - */ - bool drawRescaledImage(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, const int desiredHeight, - const bool useColor, bool smooth); - - void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; - - /** - * Draw a pattern based on a rescaled version of the given image... - */ - void drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) override final; - - void calcImagePattern(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; - - void calcImagePattern(ImageCollection* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; - - void calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const override final; - - void calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) override final; - - void drawTileCollection(const ImageCollection *const vertCol) - override final; - - void drawTileVertexes(const ImageVertexes *const vert) override final; - - bool calcWindow(ImageCollection *const vertCol, - const int x, const int y, - const int w, const int h, - const ImageRect &imgRect) override final; - - void updateScreen() override final; - - void _beginDraw() override final; - - void _endDraw() override final; - - bool pushClipArea(gcn::Rectangle area) override final; - - void popClipArea() override final; - - void setColor(const gcn::Color &color) override final - { - mColor = color; - mColor2 = color; - mColorAlpha = (color.a != 255); - } - - void setColorAll(const gcn::Color &color, const gcn::Color &color2) - { - mColor = color; - mColor2 = color2; - mColorAlpha = (color.a != 255); - } - - void drawPoint(int x, int y) override final; - - void drawLine(int x1, int y1, int x2, int y2) override final; - - void drawRectangle(const gcn::Rectangle &rect, - const bool filled); - - void drawRectangle(const gcn::Rectangle &rect) override final; - - void fillRectangle(const gcn::Rectangle &rect) override final; + #include "render/openglgraphicsdef.hpp" inline void drawQuadArrayfi(const int size); @@ -176,29 +76,17 @@ class NullOpenGLGraphics final : public Graphics inline void drawVertexes(const NormalOpenGLGraphicsVertexes &ogl); - void initArrays() override final; - - static void dumpSettings(); - - /** - * Takes a screenshot and returns it as SDL surface. - */ - SDL_Surface *getScreenshot() override final A_WARN_UNUSED; - - void prepareScreenshot() override final; - bool drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height) override final; - int getMemoryUsage() A_WARN_UNUSED; - - void updateTextureFormat(); + void initArrays() override final; - bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + /** + * Draws a rectangle using images. 4 corner images, 4 side images and 1 + * image for the inside. + */ + void drawImageRect(int x, int y, int w, int h, + const ImageRect &imgRect); #ifdef DEBUG_DRAW_CALLS unsigned int getDrawCalls() const @@ -209,10 +97,6 @@ class NullOpenGLGraphics final : public Graphics static unsigned int mLastDrawCalls; #endif - static void bindTexture(const GLenum target, const GLuint texture); - - static GLuint mLastImage; - protected: void setTexturingAndBlending(const bool enable); @@ -223,6 +107,23 @@ class NullOpenGLGraphics final : public Graphics void inline restoreColor(); + void inline calcImageRect(ImageVertexes *const vert, + int x, int y, + int w, int h, + const ImageRect &imgRect); + + void inline calcPatternInline(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const; + + void inline calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const; + + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); + GLfloat *mFloatTexArray; GLint *mIntTexArray; GLint *mIntVertArray; diff --git a/src/render/openglgraphicsdef.hpp b/src/render/openglgraphicsdef.hpp new file mode 100644 index 000000000..9f6d9d319 --- /dev/null +++ b/src/render/openglgraphicsdef.hpp @@ -0,0 +1,146 @@ +/* + * The ManaPlus Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + + bool setVideoMode(const int w, const int h, + const int bpp, + const bool fs, + const bool hwaccel, + const bool resize, + const bool noFrame) override final; + + + /** + * Draws a resclaled version of the image + */ + bool drawRescaledImage(const Image *const image, + int dstX, int dstY, + const int desiredWidth, + const int desiredHeight) override final; + + void inline drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h); + + void drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) override final; + + /** + * Draw a pattern based on a rescaled version of the given image... + */ + void drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) override final; + + void calcPattern(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; + + void calcPattern(ImageCollection* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; + + void calcTileVertexes(ImageVertexes *const vert, + const Image *const image, + int x, int y) const override final; + + void calcTileCollection(ImageCollection *const vertCol, + const Image *const image, + int x, int y) override final; + + void drawTileCollection(const ImageCollection *const vertCol) + override final; + + void drawTileVertexes(const ImageVertexes *const vert) override final; + + void calcWindow(ImageCollection *const vertCol, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) override final; + + void updateScreen() override final; + + void _beginDraw() override final; + + void _endDraw() override final; + + bool pushClipArea(gcn::Rectangle area) override final; + + void popClipArea() override final; + + void setColor(const gcn::Color &color) override final + { + mColor = color; + mColor2 = color; + mColorAlpha = (color.a != 255); + } + + void setColorAll(const gcn::Color &color, const gcn::Color &color2) + { + mColor = color; + mColor2 = color2; + mColorAlpha = (color.a != 255); + } + + void drawPoint(int x, int y) override final; + + void drawLine(int x1, int y1, int x2, int y2) override final; + + void drawRectangle(const gcn::Rectangle &rect, + const bool filled); + + void drawRectangle(const gcn::Rectangle &rect) override final; + + void fillRectangle(const gcn::Rectangle &rect) override final; + + static void dumpSettings(); + + /** + * Takes a screenshot and returns it as SDL surface. + */ + SDL_Surface *getScreenshot() override final A_WARN_UNUSED; + + void prepareScreenshot() override final; + + int getMemoryUsage() A_WARN_UNUSED; + + void updateTextureFormat(); + + bool drawImage2(const Image *const image, + int dstX, int dstY) override final; + + void drawImageCached(const Image *const image, + int x, int y) override final; + + void drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) override final; + + void completeCache() override final; + + static void bindTexture(const GLenum target, const GLuint texture); + + static GLuint mLastImage; diff --git a/src/render/renderers.cpp b/src/render/renderers.cpp index dcabd0fbf..cb6d655e9 100644 --- a/src/render/renderers.cpp +++ b/src/render/renderers.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/render/renderers.h b/src/render/renderers.h index 3c79103c1..2f15f7b51 100644 --- a/src/render/renderers.h +++ b/src/render/renderers.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/render/rendererslistsdl.h b/src/render/rendererslistsdl.h index 585e4ceba..b2c3b2354 100644 --- a/src/render/rendererslistsdl.h +++ b/src/render/rendererslistsdl.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/render/rendererslistsdl2.h b/src/render/rendererslistsdl2.h index 0c2f97c33..1ebe4b242 100644 --- a/src/render/rendererslistsdl2.h +++ b/src/render/rendererslistsdl2.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index 02369fef4..c6e8c1f30 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -138,112 +138,134 @@ static inline void drawRescaledQuad(const Image *const image, } } - bool SafeOpenGLGraphics::drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) + int dstX, int dstY) +{ + return drawImageInline(image, dstX, dstY); +} + +bool SafeOpenGLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) if (!image) return false; - if (!useColor) - setColorAlpha(image->mAlpha); - + setColorAlpha(image->mAlpha); bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); - setTexturingAndBlending(true); + const SDL_Rect &bounds = image->mBounds; // Draw a textured quad. glBegin(GL_QUADS); - drawQuad(image, srcX + image->mBounds.x, srcY + image->mBounds.y, - dstX, dstY, width, height); + drawQuad(image, bounds.x, bounds.y, + dstX, dstY, bounds.w, bounds.h); glEnd(); return true; } -bool SafeOpenGLGraphics::drawRescaledImage(const Image *const image, int srcX, - int srcY, int dstX, int dstY, - const int width, const int height, - const int desiredWidth, - const int desiredHeight, - const bool useColor) +void SafeOpenGLGraphics::drawImageCached(const Image *const image, + int x, int y) { - return drawRescaledImage(image, srcX, srcY, - dstX, dstY, - width, height, - desiredWidth, desiredHeight, - useColor, true); + FUNC_BLOCK("Graphics::drawImageCached", 1) + if (!image) + return; + + setColorAlpha(image->mAlpha); + bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); + setTexturingAndBlending(true); + + const SDL_Rect &bounds = image->mBounds; + // Draw a textured quad. + glBegin(GL_QUADS); + drawQuad(image, bounds.x, bounds.y, x, y, bounds.w, bounds.h); + glEnd(); } -bool SafeOpenGLGraphics::drawRescaledImage(const Image *const image, int srcX, - int srcY, int dstX, int dstY, - const int width, const int height, - const int desiredWidth, - const int desiredHeight, - const bool useColor, - bool smooth) +void SafeOpenGLGraphics::drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) { - FUNC_BLOCK("Graphics::drawRescaledImage", 1) + FUNC_BLOCK("Graphics::drawPatternCached", 1) if (!image) - return false; + return; - // Just draw the image normally when no resizing is necessary, - if (width == desiredWidth && height == desiredHeight) + const SDL_Rect &imageRect = image->mBounds; + const int iw = imageRect.w; + const int ih = imageRect.h; + if (iw == 0 || ih == 0) + return; + + const int srcX = imageRect.x; + const int srcY = imageRect.y; + + setColorAlpha(image->mAlpha); + bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); + setTexturingAndBlending(true); + + // Draw a set of textured rectangles + glBegin(GL_QUADS); + + for (int py = 0; py < h; py += ih) { - return drawImage2(image, srcX, srcY, dstX, dstY, - width, height, useColor); + const int height = (py + ih >= h) ? h - py : ih; + const int dstY = y + py; + for (int px = 0; px < w; px += iw) + { + int width = (px + iw >= w) ? w - px : iw; + int dstX = x + px; + drawQuad(image, srcX, srcY, dstX, dstY, width, height); + } } - // When the desired image is smaller than the current one, - // disable smooth effect. - if (width > desiredWidth && height > desiredHeight) - smooth = false; + glEnd(); +} + +void SafeOpenGLGraphics::completeCache() +{ +} - srcX += image->mBounds.x; - srcY += image->mBounds.y; +bool SafeOpenGLGraphics::drawRescaledImage(const Image *const image, + int dstX, int dstY, + const int desiredWidth, + const int desiredHeight) +{ + FUNC_BLOCK("Graphics::drawRescaledImage", 1) + if (!image) + return false; - if (!useColor) - setColorAlpha(image->mAlpha); + const SDL_Rect &imageRect = image->mBounds; - bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); + // Just draw the image normally when no resizing is necessary, + if (imageRect.w == desiredWidth && imageRect.h == desiredHeight) + return drawImageInline(image, dstX, dstY); + setColorAlpha(image->mAlpha); + bindTexture(OpenGLImageHelper::mTextureType, image->mGLImage); setTexturingAndBlending(true); // Draw a textured quad. glBegin(GL_QUADS); - drawRescaledQuad(image, srcX, srcY, dstX, dstY, width, height, - desiredWidth, desiredHeight); - - if (smooth) // A basic smooth effect... - { - setColorAlpha(0.2F); - drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height, - desiredWidth + 1, desiredHeight + 1); - drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height, - desiredWidth - 1, desiredHeight - 1); - - drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY, width, height, - desiredWidth - 1, desiredHeight); - drawRescaledQuad(image, srcX, srcY, dstX, dstY + 1, width, height, - desiredWidth, desiredHeight - 1); - } - + drawRescaledQuad(image, imageRect.x, imageRect.y, dstX, dstY, + imageRect.w, imageRect.h, desiredWidth, desiredHeight); glEnd(); return true; } -/* Optimising the functions that Graphics::drawImagePattern would call, - * so that glBegin...glEnd are outside the main loop. */ -void SafeOpenGLGraphics::drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) +void SafeOpenGLGraphics::drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) { - FUNC_BLOCK("Graphics::drawImagePattern", 1) + drawPatternInline(image, x, y, w, h); +} + +void SafeOpenGLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPattern", 1) if (!image) return; @@ -278,11 +300,11 @@ void SafeOpenGLGraphics::drawImagePattern(const Image *const image, glEnd(); } -void SafeOpenGLGraphics::drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) +void SafeOpenGLGraphics::drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) { if (!image) return; @@ -339,21 +361,39 @@ void SafeOpenGLGraphics::calcTileVertexes(ImageVertexes *const vert A_UNUSED, { } -void SafeOpenGLGraphics::calcImagePattern(ImageVertexes *const vert A_UNUSED, - const Image *const image A_UNUSED, - const int x A_UNUSED, - const int y A_UNUSED, - const int w A_UNUSED, - const int h A_UNUSED) const +void SafeOpenGLGraphics::calcTileVertexesInline(ImageVertexes *const + vert A_UNUSED, + const Image *const + image A_UNUSED, + int x A_UNUSED, + int y A_UNUSED) const { } -void SafeOpenGLGraphics::calcImagePattern(ImageCollection *const vert A_UNUSED, - const Image *const image A_UNUSED, - const int x A_UNUSED, - const int y A_UNUSED, - const int w A_UNUSED, - const int h A_UNUSED) const +void SafeOpenGLGraphics::calcPattern(ImageVertexes *const vert A_UNUSED, + const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED) const +{ +} + +void SafeOpenGLGraphics::calcPatternInline(ImageVertexes *const vert A_UNUSED, + const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED) const +{ +} + +void SafeOpenGLGraphics::calcPattern(ImageCollection *const vert A_UNUSED, + const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED) const { } @@ -380,12 +420,11 @@ void SafeOpenGLGraphics::updateScreen() BLOCK_END("Graphics::updateScreen") } -bool SafeOpenGLGraphics::calcWindow(ImageCollection *const vertCol A_UNUSED, +void SafeOpenGLGraphics::calcWindow(ImageCollection *const vertCol A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, const int h A_UNUSED, const ImageRect &imgRect A_UNUSED) { - return false; } void SafeOpenGLGraphics::_beginDraw() @@ -527,17 +566,41 @@ void SafeOpenGLGraphics::drawPoint(int x, int y) glEnd(); } -void SafeOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) +bool SafeOpenGLGraphics::drawNet(const int x1, const int y1, + const int x2, const int y2, + const int width, const int height) { setTexturingAndBlending(false); restoreColor(); glBegin(GL_LINES); - glVertex2f(static_cast<float>(x1) + 0.5F, static_cast<float>(y1) + 0.5F); - glVertex2f(static_cast<float>(x2) + 0.5F, static_cast<float>(y2) + 0.5F); + for (int y = y1; y < y2; y += height) + { + glVertex2f(static_cast<float>(x1) + 0.5F, + static_cast<float>(y) + 0.5F); + glVertex2f(static_cast<float>(x2) + 0.5F, + static_cast<float>(y) + 0.5F); + } + + for (int x = x1; x < x2; x += width) + { + glVertex2f(static_cast<float>(x) + 0.5F, + static_cast<float>(y1) + 0.5F); + glVertex2f(static_cast<float>(x) + 0.5F, + static_cast<float>(y2) + 0.5F); + } glEnd(); - glBegin(GL_POINTS); + return true; +} + +void SafeOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) +{ + setTexturingAndBlending(false); + restoreColor(); + + glBegin(GL_LINES); + glVertex2f(static_cast<float>(x1) + 0.5F, static_cast<float>(y1) + 0.5F); glVertex2f(static_cast<float>(x2) + 0.5F, static_cast<float>(y2) + 0.5F); glEnd(); } @@ -644,4 +707,19 @@ void SafeOpenGLGraphics::restoreColor() mByteColor = mColor; } +void SafeOpenGLGraphics::drawImageRect(const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_drawImageRect.hpp" +} + +void SafeOpenGLGraphics::calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_calcImageRect.hpp" +} + #endif // USE_OPENGL diff --git a/src/render/safeopenglgraphics.h b/src/render/safeopenglgraphics.h index 705e580e1..28d61b59a 100644 --- a/src/render/safeopenglgraphics.h +++ b/src/render/safeopenglgraphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -50,122 +50,18 @@ class SafeOpenGLGraphics final : public Graphics ~SafeOpenGLGraphics(); - bool setVideoMode(const int w, const int h, - const int bpp, - const bool fs, - const bool hwaccel, - const bool resize, - const bool noFrame) override final; + #include "render/openglgraphicsdef.hpp" /** - * Draws a resclaled version of the image + * Draws a rectangle using images. 4 corner images, 4 side images and 1 + * image for the inside. */ - bool drawRescaledImage(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, const int desiredHeight, - const bool useColor) override final; + void drawImageRect(int x, int y, int w, int h, + const ImageRect &imgRect); - /** - * Used to get the smooth rescale option over the standard function. - */ - bool drawRescaledImage(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const int desiredWidth, const int desiredHeight, - const bool useColor, bool smooth); - - void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; - - /** - * Draw a pattern based on a rescaled version of the given image... - */ - void drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) override final; - - void calcTileVertexes(ImageVertexes *const vert, - const Image *const image, - int x, int y) const override final; - - void calcTileCollection(ImageCollection *const vertCol, - const Image *const image, - int x, int y) override final; - - void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; - - void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; - - void drawTileVertexes(const ImageVertexes *const vert) override final; - - void drawTileCollection(const ImageCollection *const vertCol) - override final; - - void updateScreen() override final; - - bool calcWindow(ImageCollection *const vertCol, - const int x, const int y, - const int w, const int h, - const ImageRect &imgRect) override final; - - void _beginDraw() override final; - - void _endDraw() override final; - - bool pushClipArea(gcn::Rectangle area) override final; - - void popClipArea() override final; - - void setColor(const gcn::Color &color) override final - { - mColor = color; - mColor2 = color; - mColorAlpha = (color.a != 255); - } - - void setColorAll(const gcn::Color &color, const gcn::Color &color2) - { - mColor = color; - mColor2 = color2; - mColorAlpha = (color.a != 255); - } - - void drawPoint(int x, int y) override final; - - void drawLine(int x1, int y1, int x2, int y2) override final; - - void drawRectangle(const gcn::Rectangle &rect, const bool filled); - - void drawRectangle(const gcn::Rectangle &rect) override final; - - void fillRectangle(const gcn::Rectangle &rect) override final; - - /** - * Takes a screenshot and returns it as SDL surface. - */ - SDL_Surface *getScreenshot() override final A_WARN_UNUSED; - - void prepareScreenshot() override final; - - bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; - - static void bindTexture(const GLenum target, const GLuint texture); - - static GLuint mLastImage; + bool drawNet(const int x1, const int y1, + const int x2, const int y2, + const int width, const int height) override final; protected: void setTexturingAndBlending(const bool enable); @@ -175,6 +71,23 @@ class SafeOpenGLGraphics final : public Graphics void inline restoreColor(); + void inline calcImageRect(ImageVertexes *const vert, + int x, int y, + int w, int h, + const ImageRect &imgRect); + + void calcPatternInline(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const; + + void inline calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const; + + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); + bool mTexture; bool mIsByteColor; gcn::Color mByteColor; diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 979de3c31..96e05c8f6 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -81,12 +81,9 @@ SDLGraphics::~SDLGraphics() } bool SDLGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, int dstX, int dstY, - const int width, const int height, const int desiredWidth, - const int desiredHeight, - const bool useColor A_UNUSED) + const int desiredHeight) { FUNC_BLOCK("Graphics::drawRescaledImage", 1) // Check that preconditions for blitting are met. @@ -99,10 +96,10 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, const SDL_Rect &bounds = image->mBounds; const SDL_Rect srcRect = { - static_cast<int32_t>(srcX + bounds.x), - static_cast<int32_t>(srcY + bounds.y), - static_cast<int32_t>(width), - static_cast<int32_t>(height) + static_cast<int32_t>(bounds.x), + static_cast<int32_t>(bounds.y), + static_cast<int32_t>(bounds.w), + static_cast<int32_t>(bounds.h) }; const SDL_Rect dstRect = { @@ -116,9 +113,14 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, &srcRect, &dstRect) < 0); } -bool SDLGraphics::drawImage2(const Image *const image, int srcX, int srcY, - int dstX, int dstY, const int width, - const int height, const bool useColor A_UNUSED) +bool SDLGraphics::drawImage2(const Image *const image, + int dstX, int dstY) +{ + return drawImageInline(image, dstX, dstY); +} + +bool SDLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) // Check that preconditions for blitting are met. @@ -132,28 +134,60 @@ bool SDLGraphics::drawImage2(const Image *const image, int srcX, int srcY, const SDL_Rect &bounds = image->mBounds; const SDL_Rect srcRect = { - static_cast<int32_t>(srcX + bounds.x), - static_cast<int32_t>(srcY + bounds.y), - static_cast<int32_t>(width), - static_cast<int32_t>(height) + static_cast<int32_t>(bounds.x), + static_cast<int32_t>(bounds.y), + static_cast<int32_t>(bounds.w), + static_cast<int32_t>(bounds.h) }; const SDL_Rect dstRect = { static_cast<int32_t>(dstX + top.xOffset), static_cast<int32_t>(dstY + top.yOffset), - static_cast<int32_t>(width), - static_cast<int32_t>(height) + static_cast<int32_t>(bounds.w), + static_cast<int32_t>(bounds.h) }; return !MSDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect); } -void SDLGraphics::drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) +void SDLGraphics::drawImageCached(const Image *const image, + int x, int y) +{ + FUNC_BLOCK("Graphics::drawImageCached", 1) + // Check that preconditions for blitting are met. + if (!mWindow || !image || !image->mTexture) + return; + + const gcn::ClipRectangle &top = mClipStack.top(); + if (!top.width || !top.height) + return; + + const SDL_Rect &bounds = image->mBounds; + const SDL_Rect srcRect = + { + static_cast<int32_t>(bounds.x), + static_cast<int32_t>(bounds.y), + static_cast<int32_t>(bounds.w), + static_cast<int32_t>(bounds.h) + }; + + const SDL_Rect dstRect = + { + static_cast<int32_t>(x + top.xOffset), + static_cast<int32_t>(y + top.yOffset), + static_cast<int32_t>(bounds.w), + static_cast<int32_t>(bounds.h) + }; + + MSDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect); +} + +void SDLGraphics::drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) { - FUNC_BLOCK("Graphics::drawImagePattern", 1) + FUNC_BLOCK("Graphics::drawPatternCached", 1) // Check that preconditions for blitting are met. if (!mWindow || !image) return; @@ -196,11 +230,69 @@ void SDLGraphics::drawImagePattern(const Image *const image, } } -void SDLGraphics::drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) +void SDLGraphics::completeCache() +{ +} + +void SDLGraphics::drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + drawPatternInline(image, x, y, w, h); +} + +void SDLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPattern", 1) + // Check that preconditions for blitting are met. + if (!mWindow || !image) + return; + if (!image->mTexture) + return; + + const gcn::ClipRectangle &top = mClipStack.top(); + if (!top.width || !top.height) + return; + + const SDL_Rect &bounds = image->mBounds; + const int iw = bounds.w; + const int ih = bounds.h; + if (iw == 0 || ih == 0) + return; + + const int xOffset = top.xOffset + x; + const int yOffset = top.yOffset + y; + + SDL_Rect dstRect; + SDL_Rect srcRect; + srcRect.x = static_cast<int32_t>(bounds.x); + srcRect.y = static_cast<int32_t>(bounds.y); + for (int py = 0; py < h; py += ih) + { + const int dh = (py + ih >= h) ? h - py : ih; + dstRect.y = static_cast<int32_t>(py + yOffset); + srcRect.h = static_cast<int32_t>(dh); + dstRect.h = static_cast<int32_t>(dh); + + for (int px = 0; px < w; px += iw) + { + const int dw = (px + iw >= w) ? w - px : iw; + dstRect.x = static_cast<int32_t>(px + xOffset); + srcRect.w = static_cast<int32_t>(dw); + dstRect.w = static_cast<int32_t>(dw); + + MSDL_RenderCopy(mRenderer, image->mTexture, &srcRect, &dstRect); + } + } +} + +void SDLGraphics::drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) { // Check that preconditions for blitting are met. if (!mWindow || !image) @@ -254,10 +346,18 @@ void SDLGraphics::drawRescaledImagePattern(const Image *const image, delete tmpImage; } -void SDLGraphics::calcImagePattern(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDLGraphics::calcPattern(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const +{ + calcPatternInline(vert, image, x, y, w, h); +} + +void SDLGraphics::calcPatternInline(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const { // Check that preconditions for blitting are met. if (!vert || !mWindow || !image || !image->mTexture) @@ -304,10 +404,10 @@ void SDLGraphics::calcImagePattern(ImageVertexes* const vert, } } -void SDLGraphics::calcImagePattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDLGraphics::calcPattern(ImageCollection* const vertCol, + const Image *const image, + const int x, const int y, + const int w, const int h) const { ImageVertexes *vert = nullptr; if (vertCol->currentImage != image) @@ -323,7 +423,7 @@ void SDLGraphics::calcImagePattern(ImageCollection* const vertCol, vert = vertCol->currentVert; } - calcImagePattern(vert, image, x, y, w, h); + calcPatternInline(vert, image, x, y, w, h); } void SDLGraphics::calcTileVertexes(ImageVertexes *const vert, @@ -334,6 +434,14 @@ void SDLGraphics::calcTileVertexes(ImageVertexes *const vert, calcTileSDL(vert, x, y); } +void SDLGraphics::calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const +{ + vert->image = image; + calcTileSDL(vert, x, y); +} + void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const { // Check that preconditions for blitting are met. @@ -464,7 +572,7 @@ bool SDLGraphics::drawNet(const int x1, const int y1, return true; } -bool SDLGraphics::calcWindow(ImageCollection *const vertCol, +void SDLGraphics::calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) @@ -483,12 +591,7 @@ bool SDLGraphics::calcWindow(ImageCollection *const vertCol, { vert = vertCol->currentVert; } - - const Image *const *const grid = &imgRect.grid[0]; - return calcImageRect(vert, x, y, w, h, - grid[0], grid[2], grid[6], grid[8], - grid[1], grid[5], grid[7], grid[3], - grid[4]); + calcImageRect(vert, x, y, w, h, imgRect); } void SDLGraphics::fillRectangle(const gcn::Rectangle &rectangle) @@ -640,4 +743,19 @@ bool SDLGraphics::setVideoMode(const int w, const int h, const int bpp, return videoInfo(); } +void SDLGraphics::drawImageRect(const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_drawImageRect.hpp" +} + +void SDLGraphics::calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_calcImageRect.hpp" +} + #endif // USE_SDL2 diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index 362d7cbc0..5f1e8ac1c 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -62,32 +62,34 @@ class SDLGraphics final : public Graphics void popClipArea() override final; - bool drawRescaledImage(const Image *const image, int srcX, - int srcY, int dstX, int dstY, - const int width, const int height, + bool drawRescaledImage(const Image *const image, + int dstX, int dstY, const int desiredWidth, - const int desiredHeight, - const bool useColor = false) override final; + const int desiredHeight) override final; - void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; + void drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) override final; - void drawRescaledImagePattern(const Image *const image, + void inline drawPatternInline(const Image *const image, const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) override final; + const int w, const int h); - void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; + void drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) override final; - void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; + void calcPattern(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; + + void calcPattern(ImageCollection *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; void calcTileVertexes(ImageVertexes *const vert, const Image *const image, @@ -113,7 +115,7 @@ class SDLGraphics final : public Graphics const int x2, const int y2, const int width, const int height) override final; - bool calcWindow(ImageCollection *const vertCol, + void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) override final; @@ -137,15 +139,46 @@ class SDLGraphics final : public Graphics { mRendererFlags = flags; } bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + int dstX, int dstY) override final; + + void drawImageCached(const Image *const image, + int x, int y) override final; + + void drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) override final; + + void completeCache() override final; + + /** + * Draws a rectangle using images. 4 corner images, 4 side images and 1 + * image for the inside. + */ + void drawImageRect(int x, int y, int w, int h, + const ImageRect &imgRect); protected: uint32_t mRendererFlags; uint32_t mOldPixel; int mOldAlpha; + + private: + void inline calcImageRect(ImageVertexes *const vert, + int x, int y, + int w, int h, + const ImageRect &imgRect); + + void inline calcPatternInline(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const; + + void inline calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const; + + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); }; #endif // USE_SDL2 diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index 7556bc5ac..95c8f08b1 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -62,12 +62,9 @@ SDL2SoftwareGraphics::~SDL2SoftwareGraphics() } bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, int dstX, int dstY, - const int width, const int height, const int desiredWidth, - const int desiredHeight, - const bool useColor A_UNUSED) + const int desiredHeight) { FUNC_BLOCK("Graphics::drawRescaledImage", 1) // Check that preconditions for blitting are met. @@ -89,10 +86,10 @@ bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, SDL_Rect srcRect = { - static_cast<int16_t>(srcX + bounds.x), - static_cast<int16_t>(srcY + bounds.y), - static_cast<uint16_t>(width), - static_cast<uint16_t>(height) + static_cast<int16_t>(bounds.x), + static_cast<int16_t>(bounds.y), + static_cast<uint16_t>(bounds.w), + static_cast<uint16_t>(bounds.h) }; SDL_Rect dstRect = @@ -112,10 +109,13 @@ bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, } bool SDL2SoftwareGraphics::drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, const int width, - const int height, - const bool useColor A_UNUSED) + int dstX, int dstY) +{ + return drawImageInline(image, dstX, dstY); +} + +bool SDL2SoftwareGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) // Check that preconditions for blitting are met. @@ -125,16 +125,15 @@ bool SDL2SoftwareGraphics::drawImage2(const Image *const image, const gcn::ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; - SDL_Surface *const src = image->mSDLSurface; - srcX += bounds.x; - srcY += bounds.y; + int srcX = bounds.x; + int srcY = bounds.y; dstX += top.xOffset; dstY += top.yOffset; - int w = width; - int h = height; + int w = bounds.w; + int h = bounds.h; if (srcX < 0) { w += srcX; @@ -203,11 +202,219 @@ bool SDL2SoftwareGraphics::drawImage2(const Image *const image, return 0; } -void SDL2SoftwareGraphics::drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) +void SDL2SoftwareGraphics::drawImageCached(const Image *const image, + int x, int y) +{ + FUNC_BLOCK("Graphics::drawImageCached", 1) + // Check that preconditions for blitting are met. + if (!mSurface || !image || !image->mSDLSurface) + return; + + const gcn::ClipRectangle &top = mClipStack.top(); + const SDL_Rect &bounds = image->mBounds; + + SDL_Surface *const src = image->mSDLSurface; + + int srcX = bounds.x; + int srcY = bounds.y; + x += top.xOffset; + y += top.yOffset; + + int w = bounds.w; + int h = bounds.h; + if (srcX < 0) + { + w += srcX; + x -= static_cast<int16_t>(srcX); + srcX = 0; + } + const int maxw = src->w - srcX; + if (maxw < w) + w = maxw; + + if (srcY < 0) + { + h += srcY; + y -= static_cast<int16_t>(srcY); + srcY = 0; + } + const int maxh = src->h - srcY; + if (maxh < h) + h = maxh; + + const SDL_Rect *const clip = &mSurface->clip_rect; + const int clipX = clip->x; + const int clipY = clip->y; + int dx = clipX - x; + if (dx > 0) + { + w -= dx; + x += static_cast<int16_t>(dx); + srcX += dx; + } + dx = x + w - clipX - clip->w; + if (dx > 0) + w -= dx; + + int dy = clipY - y; + if (dy > 0) + { + h -= dy; + y += static_cast<int16_t>(dy); + srcY += dy; + } + dy = y + h - clipY - clip->h; + if (dy > 0) + h -= dy; + + if (w > 0 && h > 0) + { + SDL_Rect srcRect = + { + static_cast<int16_t>(srcX), + static_cast<int16_t>(srcY), + static_cast<uint16_t>(w), + static_cast<uint16_t>(h) + }; + + SDL_Rect dstRect = + { + static_cast<int16_t>(x), + static_cast<int16_t>(y), + static_cast<uint16_t>(w), + static_cast<uint16_t>(h) + }; + + SDL_LowerBlit(src, &srcRect, mSurface, &dstRect); + } +} + +void SDL2SoftwareGraphics::drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPatternCached", 1) + // Check that preconditions for blitting are met. + if (!mSurface || !image) + return; + if (!image->mSDLSurface) + return; + + const SDL_Rect &bounds = image->mBounds; + const int iw = bounds.w; + const int ih = bounds.h; + if (iw == 0 || ih == 0) + return; + + const gcn::ClipRectangle &top = mClipStack.top(); + const int xOffset = top.xOffset + x; + const int yOffset = top.yOffset + y; + const int srcX = bounds.x; + const int srcY = bounds.y; + SDL_Surface *const src = image->mSDLSurface; + const SDL_Rect *const clip = &mSurface->clip_rect; + const int clipX = clip->x; + const int clipY = clip->y; + + for (int py = 0; py < h; py += ih) + { + const int dh = (py + ih >= h) ? h - py : ih; + int dstY = py + yOffset; + int y2 = srcY; + int h2 = dh; + if (y2 < 0) + { + h2 += y2; + dstY -= static_cast<int16_t>(y2); + y2 = 0; + } + const int maxh = src->h - y2; + if (maxh < h2) + h2 = maxh; + + int dy = clipY - dstY; + if (dy > 0) + { + h2 -= dy; + dstY += static_cast<int16_t>(dy); + y2 += dy; + } + dy = dstY + h2 - clipY - clip->h; + if (dy > 0) + h2 -= dy; + + if (h2 > 0) + { + for (int px = 0; px < w; px += iw) + { + const int dw = (px + iw >= w) ? w - px : iw; + int dstX = px + xOffset; + int x2 = srcX; + int w2 = dw; + if (x2 < 0) + { + w2 += x2; + dstX -= static_cast<int16_t>(x2); + x2 = 0; + } + const int maxw = src->w - x2; + if (maxw < w2) + w2 = maxw; + + int dx = clipX - dstX; + if (dx > 0) + { + w2 -= dx; + dstX += static_cast<int16_t>(dx); + x2 += dx; + } + dx = dstX + w2 - clipX - clip->w; + if (dx > 0) + w2 -= dx; + + if (w2 > 0) + { + SDL_Rect srcRect = + { + static_cast<int16_t>(x2), + static_cast<int16_t>(y2), + static_cast<uint16_t>(w2), + static_cast<uint16_t>(h2) + }; + + SDL_Rect dstRect = + { + static_cast<int16_t>(dstX), + static_cast<int16_t>(dstY), + static_cast<uint16_t>(w2), + static_cast<uint16_t>(h2) + }; + + SDL_LowerBlit(src, &srcRect, mSurface, &dstRect); + } + +// SDL_BlitSurface(image->mSDLSurface, &srcRect, mWindow, &dstRect); + } + } + } +} + +void SDL2SoftwareGraphics::completeCache() { - FUNC_BLOCK("Graphics::drawImagePattern", 1) +} + +void SDL2SoftwareGraphics::drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + drawPatternInline(image, x, y, w, h); +} + +void SDL2SoftwareGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPattern", 1) // Check that preconditions for blitting are met. if (!mSurface || !image) return; @@ -313,11 +520,11 @@ void SDL2SoftwareGraphics::drawImagePattern(const Image *const image, } } -void SDL2SoftwareGraphics::drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) +void SDL2SoftwareGraphics::drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) { // Check that preconditions for blitting are met. if (!mSurface || !image) @@ -379,10 +586,18 @@ void SDL2SoftwareGraphics::drawRescaledImagePattern(const Image *const image, delete tmpImage; } -void SDL2SoftwareGraphics::calcImagePattern(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDL2SoftwareGraphics::calcPattern(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const +{ + calcPatternInline(vert, image, x, y, w, h); +} + +void SDL2SoftwareGraphics::calcPatternInline(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const { // Check that preconditions for blitting are met. if (!vert || !mSurface || !image || !image->mSDLSurface) @@ -433,10 +648,10 @@ void SDL2SoftwareGraphics::calcImagePattern(ImageVertexes* const vert, } } -void SDL2SoftwareGraphics::calcImagePattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDL2SoftwareGraphics::calcPattern(ImageCollection* const vertCol, + const Image *const image, + const int x, const int y, + const int w, const int h) const { ImageVertexes *vert = nullptr; if (vertCol->currentImage != image) @@ -452,7 +667,7 @@ void SDL2SoftwareGraphics::calcImagePattern(ImageCollection* const vertCol, vert = vertCol->currentVert; } - calcImagePattern(vert, image, x, y, w, h); + calcPatternInline(vert, image, x, y, w, h); } void SDL2SoftwareGraphics::calcTileVertexes(ImageVertexes *const vert, @@ -463,6 +678,14 @@ void SDL2SoftwareGraphics::calcTileVertexes(ImageVertexes *const vert, calcTileSDL(vert, x, y); } +void SDL2SoftwareGraphics::calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const +{ + vert->image = image; + calcTileSDL(vert, x, y); +} + void SDL2SoftwareGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const { @@ -589,7 +812,7 @@ bool SDL2SoftwareGraphics::drawNet(const int x1, const int y1, return true; } -bool SDL2SoftwareGraphics::calcWindow(ImageCollection *const vertCol, +void SDL2SoftwareGraphics::calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) @@ -608,12 +831,7 @@ bool SDL2SoftwareGraphics::calcWindow(ImageCollection *const vertCol, { vert = vertCol->currentVert; } - - const Image *const *const grid = &imgRect.grid[0]; - return calcImageRect(vert, x, y, w, h, - grid[0], grid[2], grid[6], grid[8], - grid[1], grid[5], grid[7], grid[3], - grid[4]); + calcImageRect(vert, x, y, w, h, imgRect); } int SDL2SoftwareGraphics::SDL_FakeUpperBlit(const SDL_Surface *const src, @@ -1288,4 +1506,19 @@ bool SDL2SoftwareGraphics::resizeScreen(const int width, const int height) return ret; } +void SDL2SoftwareGraphics::drawImageRect(const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_drawImageRect.hpp" +} + +void SDL2SoftwareGraphics::calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_calcImageRect.hpp" +} + #endif // USE_SDL2 diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h index 54a45d4fe..295118067 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -63,32 +63,33 @@ class SDL2SoftwareGraphics final : public Graphics void popClipArea(); bool drawRescaledImage(const Image *const image, - int srcX, int srcY, int dstX, int dstY, - const int width, const int height, const int desiredWidth, - const int desiredHeight, - const bool useColor = false) override final; + const int desiredHeight) override final; - void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; + void drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) override final; - void drawRescaledImagePattern(const Image *const image, + void inline drawPatternInline(const Image *const image, const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) override final; + const int w, const int h); - void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; + void drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) override final; - void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; + void calcPattern(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; + + void calcPattern(ImageCollection *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; void calcTileVertexes(ImageVertexes *const vert, const Image *const image, @@ -114,7 +115,7 @@ class SDL2SoftwareGraphics final : public Graphics const int x2, const int y2, const int width, const int height) override final; - bool calcWindow(ImageCollection *const vertCol, + void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) override final; @@ -140,10 +141,23 @@ class SDL2SoftwareGraphics final : public Graphics bool resizeScreen(const int width, const int height) override final; bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + int dstX, int dstY) override final; + + void drawImageCached(const Image *const image, + int x, int y) override final; + + void drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) override final; + + void completeCache() override final; + + /** + * Draws a rectangle using images. 4 corner images, 4 side images and 1 + * image for the inside. + */ + void drawImageRect(int x, int y, int w, int h, + const ImageRect &imgRect); protected: int SDL_FakeUpperBlit(const SDL_Surface *const src, @@ -159,6 +173,24 @@ class SDL2SoftwareGraphics final : public Graphics SDL_Surface *mSurface; uint32_t mOldPixel; int mOldAlpha; + + private: + void inline calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect); + + void inline calcPatternInline(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const; + + void inline calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const; + + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); }; #endif // USE_SDL2 diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 52439f1c3..964f2d25a 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -55,12 +55,9 @@ SDLGraphics::~SDLGraphics() } bool SDLGraphics::drawRescaledImage(const Image *const image, - int srcX, int srcY, int dstX, int dstY, - const int width, const int height, const int desiredWidth, - const int desiredHeight, - const bool useColor A_UNUSED) + const int desiredHeight) { FUNC_BLOCK("Graphics::drawRescaledImage", 1) // Check that preconditions for blitting are met. @@ -82,10 +79,10 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, SDL_Rect srcRect = { - static_cast<int16_t>(srcX + bounds.x), - static_cast<int16_t>(srcY + bounds.y), - static_cast<uint16_t>(width), - static_cast<uint16_t>(height) + static_cast<int16_t>(bounds.x), + static_cast<int16_t>(bounds.y), + static_cast<uint16_t>(bounds.w), + static_cast<uint16_t>(bounds.h) }; SDL_Rect dstRect = @@ -104,9 +101,14 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, return returnValue; } -bool SDLGraphics::drawImage2(const Image *const image, int srcX, int srcY, - int dstX, int dstY, const int width, - const int height, const bool useColor A_UNUSED) +bool SDLGraphics::drawImage2(const Image *const image, + int dstX, int dstY) +{ + return drawImageInline(image, dstX, dstY); +} + +bool SDLGraphics::drawImageInline(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) // Check that preconditions for blitting are met. @@ -116,16 +118,15 @@ bool SDLGraphics::drawImage2(const Image *const image, int srcX, int srcY, const gcn::ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; - SDL_Surface *const src = image->mSDLSurface; - srcX += bounds.x; - srcY += bounds.y; + int srcX = bounds.x; + int srcY = bounds.y; dstX += top.xOffset; dstY += top.yOffset; - int w = width; - int h = height; + int w = bounds.w; + int h = bounds.h; if (srcX < 0) { w += srcX; @@ -194,11 +195,219 @@ bool SDLGraphics::drawImage2(const Image *const image, int srcX, int srcY, return 0; } -void SDLGraphics::drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) +void SDLGraphics::drawImageCached(const Image *const image, + int x, int y) +{ + FUNC_BLOCK("Graphics::drawImageCached", 1) + // Check that preconditions for blitting are met. + if (!mWindow || !image || !image->mSDLSurface) + return; + + const gcn::ClipRectangle &top = mClipStack.top(); + const SDL_Rect &bounds = image->mBounds; + + SDL_Surface *const src = image->mSDLSurface; + + int srcX = bounds.x; + int srcY = bounds.y; + x += top.xOffset; + y += top.yOffset; + + int w = bounds.w; + int h = bounds.h; + if (srcX < 0) + { + w += srcX; + x -= static_cast<int16_t>(srcX); + srcX = 0; + } + const int maxw = src->w - srcX; + if (maxw < w) + w = maxw; + + if (srcY < 0) + { + h += srcY; + y -= static_cast<int16_t>(srcY); + srcY = 0; + } + const int maxh = src->h - srcY; + if (maxh < h) + h = maxh; + + const SDL_Rect *const clip = &mWindow->clip_rect; + const int clipX = clip->x; + const int clipY = clip->y; + int dx = clipX - x; + if (dx > 0) + { + w -= dx; + x += static_cast<int16_t>(dx); + srcX += dx; + } + dx = x + w - clipX - clip->w; + if (dx > 0) + w -= dx; + + int dy = clipY - y; + if (dy > 0) + { + h -= dy; + y += static_cast<int16_t>(dy); + srcY += dy; + } + dy = y + h - clipY - clip->h; + if (dy > 0) + h -= dy; + + if (w > 0 && h > 0) + { + SDL_Rect srcRect = + { + static_cast<int16_t>(srcX), + static_cast<int16_t>(srcY), + static_cast<uint16_t>(w), + static_cast<uint16_t>(h) + }; + + SDL_Rect dstRect = + { + static_cast<int16_t>(x), + static_cast<int16_t>(y), + static_cast<uint16_t>(w), + static_cast<uint16_t>(h) + }; + + SDL_LowerBlit(src, &srcRect, mWindow, &dstRect); + } +} + +void SDLGraphics::drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPatternCached", 1) + // Check that preconditions for blitting are met. + if (!mWindow || !image) + return; + if (!image->mSDLSurface) + return; + + const SDL_Rect &bounds = image->mBounds; + const int iw = bounds.w; + const int ih = bounds.h; + if (iw == 0 || ih == 0) + return; + + const gcn::ClipRectangle &top = mClipStack.top(); + const int xOffset = top.xOffset + x; + const int yOffset = top.yOffset + y; + const int srcX = bounds.x; + const int srcY = bounds.y; + SDL_Surface *const src = image->mSDLSurface; + const SDL_Rect *const clip = &mWindow->clip_rect; + const int clipX = clip->x; + const int clipY = clip->y; + + for (int py = 0; py < h; py += ih) + { + const int dh = (py + ih >= h) ? h - py : ih; + int dstY = py + yOffset; + int y2 = srcY; + int h2 = dh; + if (y2 < 0) + { + h2 += y2; + dstY -= static_cast<int16_t>(y2); + y2 = 0; + } + const int maxh = src->h - y2; + if (maxh < h2) + h2 = maxh; + + int dy = clipY - dstY; + if (dy > 0) + { + h2 -= dy; + dstY += static_cast<int16_t>(dy); + y2 += dy; + } + dy = dstY + h2 - clipY - clip->h; + if (dy > 0) + h2 -= dy; + + if (h2 > 0) + { + for (int px = 0; px < w; px += iw) + { + const int dw = (px + iw >= w) ? w - px : iw; + int dstX = px + xOffset; + int x2 = srcX; + int w2 = dw; + if (x2 < 0) + { + w2 += x2; + dstX -= static_cast<int16_t>(x2); + x2 = 0; + } + const int maxw = src->w - x2; + if (maxw < w2) + w2 = maxw; + + int dx = clipX - dstX; + if (dx > 0) + { + w2 -= dx; + dstX += static_cast<int16_t>(dx); + x2 += dx; + } + dx = dstX + w2 - clipX - clip->w; + if (dx > 0) + w2 -= dx; + + if (w2 > 0) + { + SDL_Rect srcRect = + { + static_cast<int16_t>(x2), + static_cast<int16_t>(y2), + static_cast<uint16_t>(w2), + static_cast<uint16_t>(h2) + }; + + SDL_Rect dstRect = + { + static_cast<int16_t>(dstX), + static_cast<int16_t>(dstY), + static_cast<uint16_t>(w2), + static_cast<uint16_t>(h2) + }; + + SDL_LowerBlit(src, &srcRect, mWindow, &dstRect); + } + +// SDL_BlitSurface(image->mSDLSurface, &srcRect, mWindow, &dstRect); + } + } + } +} + +void SDLGraphics::completeCache() { - FUNC_BLOCK("Graphics::drawImagePattern", 1) +} + +void SDLGraphics::drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + drawPatternInline(image, x, y, w, h); +} + +void SDLGraphics::drawPatternInline(const Image *const image, + const int x, const int y, + const int w, const int h) +{ + FUNC_BLOCK("Graphics::drawPattern", 1) // Check that preconditions for blitting are met. if (!mWindow || !image) return; @@ -304,11 +513,11 @@ void SDLGraphics::drawImagePattern(const Image *const image, } } -void SDLGraphics::drawRescaledImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) +void SDLGraphics::drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) { // Check that preconditions for blitting are met. if (!mWindow || !image) @@ -370,10 +579,18 @@ void SDLGraphics::drawRescaledImagePattern(const Image *const image, delete tmpImage; } -void SDLGraphics::calcImagePattern(ImageVertexes* const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDLGraphics::calcPattern(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const +{ + calcPatternInline(vert, image, x, y, w, h); +} + +void SDLGraphics::calcPatternInline(ImageVertexes* const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const { // Check that preconditions for blitting are met. if (!vert || !mWindow || !image || !image->mSDLSurface) @@ -424,10 +641,10 @@ void SDLGraphics::calcImagePattern(ImageVertexes* const vert, } } -void SDLGraphics::calcImagePattern(ImageCollection* const vertCol, - const Image *const image, - const int x, const int y, - const int w, const int h) const +void SDLGraphics::calcPattern(ImageCollection* const vertCol, + const Image *const image, + const int x, const int y, + const int w, const int h) const { ImageVertexes *vert = nullptr; if (vertCol->currentImage != image) @@ -443,7 +660,7 @@ void SDLGraphics::calcImagePattern(ImageCollection* const vertCol, vert = vertCol->currentVert; } - calcImagePattern(vert, image, x, y, w, h); + calcPatternInline(vert, image, x, y, w, h); } void SDLGraphics::calcTileVertexes(ImageVertexes *const vert, @@ -454,6 +671,14 @@ void SDLGraphics::calcTileVertexes(ImageVertexes *const vert, calcTileSDL(vert, x, y); } +void SDLGraphics::calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const +{ + vert->image = image; + calcTileSDL(vert, x, y); +} + void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const { // Check that preconditions for blitting are met. @@ -586,7 +811,7 @@ bool SDLGraphics::drawNet(const int x1, const int y1, return true; } -bool SDLGraphics::calcWindow(ImageCollection *const vertCol, +void SDLGraphics::calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) @@ -605,12 +830,7 @@ bool SDLGraphics::calcWindow(ImageCollection *const vertCol, { vert = vertCol->currentVert; } - - const Image *const *const grid = &imgRect.grid[0]; - return calcImageRect(vert, x, y, w, h, - grid[0], grid[2], grid[6], grid[8], - grid[1], grid[5], grid[7], grid[3], - grid[4]); + calcImageRect(vert, x, y, w, h, imgRect); } int SDLGraphics::SDL_FakeUpperBlit(const SDL_Surface *const src, @@ -1265,4 +1485,19 @@ bool SDLGraphics::setVideoMode(const int w, const int h, const int bpp, return videoInfo(); } +void SDLGraphics::drawImageRect(const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_drawImageRect.hpp" +} + +void SDLGraphics::calcImageRect(ImageVertexes *const vert, + const int x, const int y, + const int w, const int h, + const ImageRect &imgRect) +{ + #include "render/graphics_calcImageRect.hpp" +} + #endif // USE_SDL2 diff --git a/src/render/sdlgraphics.h b/src/render/sdlgraphics.h index fcb624b12..53a139612 100644 --- a/src/render/sdlgraphics.h +++ b/src/render/sdlgraphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -62,32 +62,34 @@ class SDLGraphics final : public Graphics void popClipArea() override final; - bool drawRescaledImage(const Image *const image, int srcX, - int srcY, int dstX, int dstY, - const int width, const int height, + bool drawRescaledImage(const Image *const image, + int dstX, int dstY, const int desiredWidth, - const int desiredHeight, - const bool useColor = false) override final; + const int desiredHeight) override final; - void drawImagePattern(const Image *const image, - const int x, const int y, - const int w, const int h) override final; + void drawPattern(const Image *const image, + const int x, const int y, + const int w, const int h) override final; - void drawRescaledImagePattern(const Image *const image, + void inline drawPatternInline(const Image *const image, const int x, const int y, - const int w, const int h, - const int scaledWidth, - const int scaledHeight) override final; + const int w, const int h); - void calcImagePattern(ImageVertexes *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; + void drawRescaledPattern(const Image *const image, + const int x, const int y, + const int w, const int h, + const int scaledWidth, + const int scaledHeight) override final; - void calcImagePattern(ImageCollection *const vert, - const Image *const image, - const int x, const int y, - const int w, const int h) const override final; + void calcPattern(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; + + void calcPattern(ImageCollection *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const override final; void calcTileVertexes(ImageVertexes *const vert, const Image *const image, @@ -113,7 +115,7 @@ class SDLGraphics final : public Graphics const int x2, const int y2, const int width, const int height) override final; - bool calcWindow(ImageCollection *const vertCol, + void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect) override final; @@ -134,10 +136,23 @@ class SDLGraphics final : public Graphics const bool noFrame) override final; bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + int dstX, int dstY) override final; + + void drawImageCached(const Image *const image, + int x, int y) override final; + + void drawPatternCached(const Image *const image, + const int x, const int y, + const int w, const int h) override final; + + void completeCache() override final; + + /** + * Draws a rectangle using images. 4 corner images, 4 side images and 1 + * image for the inside. + */ + void drawImageRect(int x, int y, int w, int h, + const ImageRect &imgRect); protected: int SDL_FakeUpperBlit(const SDL_Surface *const src, @@ -151,6 +166,23 @@ class SDLGraphics final : public Graphics uint32_t mOldPixel; int mOldAlpha; + + private: + void inline calcImageRect(ImageVertexes *const vert, + int x, int y, + int w, int h, + const ImageRect &imgRect); + + void inline calcPatternInline(ImageVertexes *const vert, + const Image *const image, + const int x, const int y, + const int w, const int h) const; + + void inline calcTileVertexesInline(ImageVertexes *const vert, + const Image *const image, + int x, int y) const; + bool inline drawImageInline(const Image *const image, + int dstX, int dstY); }; #endif // USE_SDL2 diff --git a/src/render/surfacegraphics.cpp b/src/render/surfacegraphics.cpp index 879d44f60..8834bb171 100644 --- a/src/render/surfacegraphics.cpp +++ b/src/render/surfacegraphics.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -42,27 +42,23 @@ SurfaceGraphics::~SurfaceGraphics() { } -bool SurfaceGraphics::drawImage2(const Image *const image, int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor A_UNUSED) +bool SurfaceGraphics::drawImage2(const Image *const image, + int dstX, int dstY) { FUNC_BLOCK("Graphics::drawImage2", 1) // Check that preconditions for blitting are met. if (!mTarget || !image || !image->mSDLSurface) return false; - srcX += image->mBounds.x; - srcY += image->mBounds.y; - + const SDL_Rect &imageRect = image->mBounds; SDL_Rect dstRect; SDL_Rect srcRect; dstRect.x = static_cast<int16_t>(dstX); dstRect.y = static_cast<int16_t>(dstY); - srcRect.x = static_cast<int16_t>(srcX); - srcRect.y = static_cast<int16_t>(srcY); - srcRect.w = static_cast<uint16_t>(width); - srcRect.h = static_cast<uint16_t>(height); + srcRect.x = static_cast<int16_t>(imageRect.x); + srcRect.y = static_cast<int16_t>(imageRect.y); + srcRect.w = static_cast<uint16_t>(imageRect.w); + srcRect.h = static_cast<uint16_t>(imageRect.h); #ifdef USE_SDL2 return !(SDL_BlitSurface(image->mSDLSurface, &srcRect, @@ -80,3 +76,41 @@ bool SurfaceGraphics::drawImage2(const Image *const image, int srcX, int srcY, } #endif } + +void SurfaceGraphics::drawImageCached(const Image *const image, + int x, int y) +{ + FUNC_BLOCK("Graphics::drawImageCached", 1) + // Check that preconditions for blitting are met. + if (!mTarget || !image || !image->mSDLSurface) + return; + + const SDL_Rect &rect = image->mBounds; + + SDL_Rect dstRect; + SDL_Rect srcRect; + dstRect.x = static_cast<int16_t>(x); + dstRect.y = static_cast<int16_t>(y); + srcRect.x = static_cast<int16_t>(rect.x); + srcRect.y = static_cast<int16_t>(rect.y); + srcRect.w = static_cast<uint16_t>(rect.w); + srcRect.h = static_cast<uint16_t>(rect.h); + +#ifdef USE_SDL2 + SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect); +#else + if (mBlitMode == BLIT_NORMAL) + { + SDL_BlitSurface(image->mSDLSurface, &srcRect, mTarget, &dstRect); + } + else + { + SurfaceImageHelper::combineSurface(image->mSDLSurface, &srcRect, + mTarget, &dstRect); + } +#endif +} + +void SurfaceGraphics::completeCache() +{ +} diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index a81ff590c..3b0c639da 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -70,47 +70,43 @@ class SurfaceGraphics final : public Graphics { } bool drawRescaledImage(const Image *const image A_UNUSED, - int srcX A_UNUSED, int srcY A_UNUSED, int dstX A_UNUSED, int dstY A_UNUSED, - const int width A_UNUSED, - const int height A_UNUSED, const int desiredWidth A_UNUSED, - const int desiredHeight A_UNUSED, - const bool useColor A_UNUSED = false) + const int desiredHeight A_UNUSED) override final { return false; } - void drawImagePattern(const Image *const image A_UNUSED, - const int x A_UNUSED, - const int y A_UNUSED, - const int w A_UNUSED, - const int h A_UNUSED) override final + void drawPattern(const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED) override final { } - void drawRescaledImagePattern(const Image *const image A_UNUSED, - const int x A_UNUSED, - const int y A_UNUSED, - const int w A_UNUSED, - const int h A_UNUSED, - const int scaledWidth A_UNUSED, - const int scaledHeight A_UNUSED) - override final + void drawRescaledPattern(const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED, + const int scaledWidth A_UNUSED, + const int scaledHeight A_UNUSED) + override final { } - void calcImagePattern(ImageVertexes *const vert A_UNUSED, - const Image *const image A_UNUSED, - const int x A_UNUSED, - const int y A_UNUSED, - const int w A_UNUSED, - const int h A_UNUSED) const override final + void calcPattern(ImageVertexes *const vert A_UNUSED, + const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED) const override final { } - void calcImagePattern(ImageCollection *const vert A_UNUSED, - const Image *const image A_UNUSED, - const int x A_UNUSED, - const int y A_UNUSED, - const int w A_UNUSED, - const int h A_UNUSED) const override final + void calcPattern(ImageCollection *const vert A_UNUSED, + const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED) const override final { } void calcTileVertexes(ImageVertexes *const vert A_UNUSED, @@ -150,11 +146,11 @@ class SurfaceGraphics final : public Graphics const int height A_UNUSED) override final { return false; } - bool calcWindow(ImageCollection *const vertCol A_UNUSED, + void calcWindow(ImageCollection *const vertCol A_UNUSED, const int x A_UNUSED, const int y A_UNUSED, const int w A_UNUSED, const int h A_UNUSED, const ImageRect &imgRect A_UNUSED) override final - { return false; } + { } void setBlitMode(const BlitMode mode) { mBlitMode = mode; } @@ -183,10 +179,28 @@ class SurfaceGraphics final : public Graphics { return false; } bool drawImage2(const Image *const image, - int srcX, int srcY, - int dstX, int dstY, - const int width, const int height, - const bool useColor) override final; + int dstX, int dstY) override final; + + void drawImageCached(const Image *const image, + int x, int y) override final; + + void drawPatternCached(const Image *const image A_UNUSED, + const int x A_UNUSED, + const int y A_UNUSED, + const int w A_UNUSED, + const int h A_UNUSED) override final + { } + + void completeCache() override final; + + /** + * Draws a rectangle using images. 4 corner images, 4 side images and 1 + * image for the inside. + */ + void drawImageRect(const int x A_UNUSED, const int y A_UNUSED, + const int w A_UNUSED, const int h A_UNUSED, + const ImageRect &imgRect A_UNUSED) + { } protected: BlitMode mBlitMode; diff --git a/src/resources/action.cpp b/src/resources/action.cpp index d7bf44911..7deced3d5 100644 --- a/src/resources/action.cpp +++ b/src/resources/action.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/action.h b/src/resources/action.h index 43259d5c6..92fadfc89 100644 --- a/src/resources/action.h +++ b/src/resources/action.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/ambientlayer.cpp b/src/resources/ambientlayer.cpp index b74ba96db..c9574c589 100644 --- a/src/resources/ambientlayer.cpp +++ b/src/resources/ambientlayer.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -119,13 +119,13 @@ void AmbientLayer::draw(Graphics *const graphics, const int x, if (imageHelper->useOpenGL() == RENDER_SOFTWARE || !mKeepRatio) { - graphics->drawImagePattern(mImage, static_cast<int>(-mPosX), - static_cast<int>(-mPosY), x + static_cast<int>(mPosX), - y + static_cast<int>(mPosY)); + graphics->drawPattern(mImage, static_cast<int>(-mPosX), + static_cast<int>(-mPosY), x + static_cast<int>(mPosX), + y + static_cast<int>(mPosY)); } else { - graphics->drawRescaledImagePattern(mImage, static_cast<int>(-mPosX), + graphics->drawRescaledPattern(mImage, static_cast<int>(-mPosX), static_cast<int>(-mPosY), x + static_cast<int>(mPosX), y + static_cast<int>(mPosY), static_cast<int>(mImage->mBounds.w) diff --git a/src/resources/ambientlayer.h b/src/resources/ambientlayer.h index ab8202ba7..9a694bb2f 100644 --- a/src/resources/ambientlayer.h +++ b/src/resources/ambientlayer.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/animation.cpp b/src/resources/animation.cpp index 541d578b0..c0d927605 100644 --- a/src/resources/animation.cpp +++ b/src/resources/animation.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/animation.h b/src/resources/animation.h index ac1ff971f..7eaacac2a 100644 --- a/src/resources/animation.h +++ b/src/resources/animation.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/atlasmanager.cpp b/src/resources/atlasmanager.cpp index f1a67bfe5..71a6382dc 100644 --- a/src/resources/atlasmanager.cpp +++ b/src/resources/atlasmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -250,7 +250,7 @@ SDL_Surface *AtlasManager::createSDLAtlas(TextureAtlas *const atlas) #else SDL_SetAlpha(image->mSDLSurface, 0, SDL_ALPHA_OPAQUE); #endif - DRAW_IMAGE(graphics, image, item->x, item->y); + graphics->drawImage2(image, item->x, item->y); } } } diff --git a/src/resources/atlasmanager.h b/src/resources/atlasmanager.h index afd153602..309bf11cb 100644 --- a/src/resources/atlasmanager.h +++ b/src/resources/atlasmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp index 0ad8d563e..174a6edfd 100644 --- a/src/resources/beingcommon.cpp +++ b/src/resources/beingcommon.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/beingcommon.h b/src/resources/beingcommon.h index 0a1850217..54c9fc35d 100644 --- a/src/resources/beingcommon.h +++ b/src/resources/beingcommon.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/beinginfo.cpp b/src/resources/beinginfo.cpp index 92169314a..38c141d63 100644 --- a/src/resources/beinginfo.cpp +++ b/src/resources/beinginfo.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -60,6 +60,20 @@ BeingInfo::BeingInfo() : mAvatarId(0), mWidth(0), mHeight(0), + mStartFollowDist(3), + mFollowDist(1), + mWarpDist(11), + mWalkSpeed(0), + mSitOffsetX(0), + mSitOffsetY(0), + mMoveOffsetX(0), + mMoveOffsetY(0), + mDeadOffsetX(0), + mDeadOffsetY(0), + mThinkTime(50), + mDirectionType(1), + mSitDirectionType(1), + mDeadDirectionType(1), mStaticMaxHP(false), mTargetSelection(true) { diff --git a/src/resources/beinginfo.h b/src/resources/beinginfo.h index 008af8590..d862f1020 100644 --- a/src/resources/beinginfo.h +++ b/src/resources/beinginfo.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -212,10 +212,10 @@ class BeingInfo final void setAvatarId(const uint16_t id) { mAvatarId = id; } - int getWidth() const + int getWidth() const A_WARN_UNUSED { return mWidth; } - int getHeight() const + int getHeight() const A_WARN_UNUSED { return mHeight; } void setWidth(const int n) @@ -224,9 +224,93 @@ class BeingInfo final void setHeight(const int n) { mHeight = n; } + void setStartFollowDist(const int n) + { mStartFollowDist = n; } + + int getStartFollowDist() const A_WARN_UNUSED + { return mStartFollowDist; } + + void setFollowDist(const int n) + { mFollowDist = n; } + + int getFollowDist() const A_WARN_UNUSED + { return mFollowDist; } + + void setWalkSpeed(const int n) + { mWalkSpeed = n; } + + int getWalkSpeed() const A_WARN_UNUSED + { return mWalkSpeed; } + + void setWarpDist(const int n) + { mWarpDist = n; } + + int getWarpDist() const A_WARN_UNUSED + { return mWarpDist; } + + void setSitOffsetX(const int n) + { mSitOffsetX = n; } + + int getSitOffsetX() const A_WARN_UNUSED + { return mSitOffsetX; } + + void setSitOffsetY(const int n) + { mSitOffsetY = n; } + + int getSitOffsetY() const A_WARN_UNUSED + { return mSitOffsetY; } + + void setMoveOffsetX(const int n) + { mMoveOffsetX = n; } + + int getMoveOffsetX() const A_WARN_UNUSED + { return mMoveOffsetX; } + + void setMoveOffsetY(const int n) + { mMoveOffsetY = n; } + + int getMoveOffsetY() const A_WARN_UNUSED + { return mMoveOffsetY; } + + void setDeadOffsetX(const int n) + { mDeadOffsetX = n; } + + int getDeadOffsetX() const A_WARN_UNUSED + { return mDeadOffsetX; } + + void setDeadOffsetY(const int n) + { mDeadOffsetY = n; } + + int getDeadOffsetY() const A_WARN_UNUSED + { return mDeadOffsetY; } + + void setThinkTime(const int n) + { mThinkTime = n; } + + int getThinkTime() const A_WARN_UNUSED + { return mThinkTime; } + + void setDirectionType(const int n) + { mDirectionType = n; } + + int getDirectionType() const A_WARN_UNUSED + { return mDirectionType; } + + void setSitDirectionType(const int n) + { mSitDirectionType = n; } + + int getSitDirectionType() const A_WARN_UNUSED + { return mSitDirectionType; } + + void setDeadDirectionType(const int n) + { mDeadDirectionType = n; } + + int getDeadDirectionType() const A_WARN_UNUSED + { return mDeadDirectionType; } + void setColorsList(const std::string &name); - std::string getColor(const int idx) const; + std::string getColor(const int idx) const A_WARN_UNUSED; static void init(); @@ -254,6 +338,20 @@ class BeingInfo final uint16_t mAvatarId; int mWidth; int mHeight; + int mStartFollowDist; + int mFollowDist; + int mWarpDist; + int mWalkSpeed; + int mSitOffsetX; + int mSitOffsetY; + int mMoveOffsetX; + int mMoveOffsetY; + int mDeadOffsetX; + int mDeadOffsetY; + int mThinkTime; + int mDirectionType; + int mSitDirectionType; + int mDeadDirectionType; bool mStaticMaxHP; bool mTargetSelection; }; diff --git a/src/resources/cursor.cpp b/src/resources/cursor.cpp index 4c43e22de..a67aebf4a 100644 --- a/src/resources/cursor.cpp +++ b/src/resources/cursor.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/cursor.h b/src/resources/cursor.h index 1f597a821..021fbf048 100644 --- a/src/resources/cursor.h +++ b/src/resources/cursor.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/avatardb.cpp b/src/resources/db/avatardb.cpp index 516234928..8ff58efc5 100644 --- a/src/resources/db/avatardb.cpp +++ b/src/resources/db/avatardb.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/avatardb.h b/src/resources/db/avatardb.h index 8e6e0ddc1..0b4894c9c 100644 --- a/src/resources/db/avatardb.h +++ b/src/resources/db/avatardb.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/chardb.cpp b/src/resources/db/chardb.cpp index f97dd9b3b..80ddedc37 100644 --- a/src/resources/db/chardb.cpp +++ b/src/resources/db/chardb.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/chardb.h b/src/resources/db/chardb.h index 8edefe8a1..7a2fd97e6 100644 --- a/src/resources/db/chardb.h +++ b/src/resources/db/chardb.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/colordb.cpp b/src/resources/db/colordb.cpp index 8f4e1431c..759226e84 100644 --- a/src/resources/db/colordb.cpp +++ b/src/resources/db/colordb.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/colordb.h b/src/resources/db/colordb.h index f7e3bbee1..e466102f9 100644 --- a/src/resources/db/colordb.h +++ b/src/resources/db/colordb.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2008 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/deaddb.cpp b/src/resources/db/deaddb.cpp index fa418ee3e..ba4efc8a8 100644 --- a/src/resources/db/deaddb.cpp +++ b/src/resources/db/deaddb.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/deaddb.h b/src/resources/db/deaddb.h index bb0394893..1e47e9c3b 100644 --- a/src/resources/db/deaddb.h +++ b/src/resources/db/deaddb.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/emotedb.cpp b/src/resources/db/emotedb.cpp index 21a3aa0c6..7b1bb1ce2 100644 --- a/src/resources/db/emotedb.cpp +++ b/src/resources/db/emotedb.cpp @@ -1,7 +1,7 @@ /* * Emote database * Copyright (C) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/emotedb.h b/src/resources/db/emotedb.h index 59d1547f0..a7dc40422 100644 --- a/src/resources/db/emotedb.h +++ b/src/resources/db/emotedb.h @@ -1,7 +1,7 @@ /* * Emote database * Copyright (C) 2009 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index 62e2789a0..4c702ed33 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -604,7 +604,7 @@ const ItemDB::ItemInfos &ItemDB::getItemInfos() int parseSpriteName(const std::string &name) { int id = -1; - if (name == "body" || name == "race") + if (name == "race" || name == "type") { id = 0; } diff --git a/src/resources/db/itemdb.h b/src/resources/db/itemdb.h index 9a4ded036..8a113cf6c 100644 --- a/src/resources/db/itemdb.h +++ b/src/resources/db/itemdb.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/mapdb.cpp b/src/resources/db/mapdb.cpp index 13aac3032..15c80f2ae 100644 --- a/src/resources/db/mapdb.cpp +++ b/src/resources/db/mapdb.cpp @@ -1,7 +1,7 @@ /* * Color database * Copyright (C) 2008 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/mapdb.h b/src/resources/db/mapdb.h index ed3d131bd..527d15ba4 100644 --- a/src/resources/db/mapdb.h +++ b/src/resources/db/mapdb.h @@ -1,7 +1,7 @@ /* * Color database * Copyright (C) 2008 Aethyra Development Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/monsterdb.cpp b/src/resources/db/monsterdb.cpp index de695f704..d53bb4b69 100644 --- a/src/resources/db/monsterdb.cpp +++ b/src/resources/db/monsterdb.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/monsterdb.h b/src/resources/db/monsterdb.h index d81585b39..a4be8213e 100644 --- a/src/resources/db/monsterdb.h +++ b/src/resources/db/monsterdb.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/npcdb.cpp b/src/resources/db/npcdb.cpp index 922b2e8ee..a7bc2121a 100644 --- a/src/resources/db/npcdb.cpp +++ b/src/resources/db/npcdb.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/npcdb.h b/src/resources/db/npcdb.h index ac4b0d417..1fdd46eed 100644 --- a/src/resources/db/npcdb.h +++ b/src/resources/db/npcdb.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/palettedb.cpp b/src/resources/db/palettedb.cpp index 91c3b1e34..09140d55b 100644 --- a/src/resources/db/palettedb.cpp +++ b/src/resources/db/palettedb.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/palettedb.h b/src/resources/db/palettedb.h index 3465dd538..2a12d6ab5 100644 --- a/src/resources/db/palettedb.h +++ b/src/resources/db/palettedb.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/petdb.cpp b/src/resources/db/petdb.cpp index 169c8ee39..c235200a6 100644 --- a/src/resources/db/petdb.cpp +++ b/src/resources/db/petdb.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -22,13 +22,14 @@ #include "resources/db/petdb.h" +#include "configuration.h" #include "logger.h" #include "resources/beingcommon.h" #include "resources/beinginfo.h" +#include "utils/gettext.h" #include "utils/dtor.h" -#include "configuration.h" #include "debug.h" @@ -74,14 +75,55 @@ void PETDB::load() BeingInfo *const currentInfo = new BeingInfo; + currentInfo->setName(XML::langProperty(petNode, + // TRANSLATORS: unknown info name + "name", _("pet"))); + currentInfo->setTargetSelection(XML::getBoolProperty(petNode, - "targetSelection", false)); + "targetSelection", true)); BeingCommon::readBasicAttributes(currentInfo, petNode, "talk"); currentInfo->setDeadSortOffsetY(XML::getProperty(petNode, "deadSortOffsetY", 31)); + currentInfo->setStartFollowDist(XML::getProperty(petNode, + "startFollowDistance", 3)); + currentInfo->setFollowDist(XML::getProperty(petNode, + "followDistance", 0)); + currentInfo->setWarpDist(XML::getProperty(petNode, + "warpDistance", 11)); + + currentInfo->setWalkSpeed(XML::getProperty(petNode, + "walkSpeed", 0)); + + currentInfo->setTargetOffsetX(XML::getProperty(petNode, + "offsetX", 0)); + currentInfo->setTargetOffsetY(XML::getProperty(petNode, + "offsetY", 1)); + currentInfo->setSitOffsetX(XML::getProperty(petNode, + "sitOffsetX", 0)); + currentInfo->setSitOffsetY(XML::getProperty(petNode, + "sitOffsetY", 1)); + currentInfo->setMoveOffsetX(XML::getProperty(petNode, + "moveOffsetX", 0)); + currentInfo->setMoveOffsetY(XML::getProperty(petNode, + "moveOffsetY", 1)); + currentInfo->setDeadOffsetX(XML::getProperty(petNode, + "deadOffsetX", 0)); + currentInfo->setDeadOffsetY(XML::getProperty(petNode, + "deadOffsetY", 1)); + + currentInfo->setThinkTime(XML::getProperty(petNode, + "thinkTime", 500) / 10); + + currentInfo->setDirectionType(XML::getProperty(petNode, + "directionType", 1)); + currentInfo->setSitDirectionType(XML::getProperty(petNode, + "sitDirectionType", 1)); + currentInfo->setDeadDirectionType(XML::getProperty(petNode, + "deadDirectionType", 1)); + SpriteDisplay display; for_each_xml_child_node(spriteNode, petNode) { diff --git a/src/resources/db/petdb.h b/src/resources/db/petdb.h index 5a5175f34..e3ed9a7da 100644 --- a/src/resources/db/petdb.h +++ b/src/resources/db/petdb.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/sounddb.cpp b/src/resources/db/sounddb.cpp index f1e0ff93c..639156909 100644 --- a/src/resources/db/sounddb.cpp +++ b/src/resources/db/sounddb.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/db/sounddb.h b/src/resources/db/sounddb.h index 29a165cd7..3c421ca62 100644 --- a/src/resources/db/sounddb.h +++ b/src/resources/db/sounddb.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp index 67d32993f..a1d925a1f 100644 --- a/src/resources/dye.cpp +++ b/src/resources/dye.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/dye.h b/src/resources/dye.h index fe3f2a606..a68839e47 100644 --- a/src/resources/dye.h +++ b/src/resources/dye.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/dyecolor.h b/src/resources/dyecolor.h index e9a6a5950..75037468d 100644 --- a/src/resources/dyecolor.h +++ b/src/resources/dyecolor.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/fboinfo.h b/src/resources/fboinfo.h index faf1696b2..9ba4efd43 100644 --- a/src/resources/fboinfo.h +++ b/src/resources/fboinfo.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/image.cpp b/src/resources/image.cpp index 900d0348f..d2a1eb2dd 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/image.h b/src/resources/image.h index 65bc0f338..93c31f935 100644 --- a/src/resources/image.h +++ b/src/resources/image.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/imagehelper.cpp b/src/resources/imagehelper.cpp index 51ca0d44e..a089dc248 100644 --- a/src/resources/imagehelper.cpp +++ b/src/resources/imagehelper.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/imagehelper.h b/src/resources/imagehelper.h index b22a609a6..27cf1df14 100644 --- a/src/resources/imagehelper.h +++ b/src/resources/imagehelper.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/imageset.cpp b/src/resources/imageset.cpp index 5f62af574..0bae736cd 100644 --- a/src/resources/imageset.cpp +++ b/src/resources/imageset.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/imageset.h b/src/resources/imageset.h index 693e035db..3d89f48bb 100644 --- a/src/resources/imageset.h +++ b/src/resources/imageset.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/imagewriter.cpp b/src/resources/imagewriter.cpp index 3e1eeead5..65e3a7dbe 100644 --- a/src/resources/imagewriter.cpp +++ b/src/resources/imagewriter.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/imagewriter.h b/src/resources/imagewriter.h index b68ee81c2..e5cb2cf5e 100644 --- a/src/resources/imagewriter.h +++ b/src/resources/imagewriter.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/iteminfo.cpp b/src/resources/iteminfo.cpp index 5845138d2..afe9ff027 100644 --- a/src/resources/iteminfo.cpp +++ b/src/resources/iteminfo.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/iteminfo.h b/src/resources/iteminfo.h index 76a9b78c7..43dcbf9e9 100644 --- a/src/resources/iteminfo.h +++ b/src/resources/iteminfo.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index ceedd3369..9caa14945 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/mapreader.h b/src/resources/mapreader.h index e6a5597e1..3573fcc89 100644 --- a/src/resources/mapreader.h +++ b/src/resources/mapreader.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/openglimagehelper.cpp b/src/resources/openglimagehelper.cpp index 458ee389d..d855323d1 100644 --- a/src/resources/openglimagehelper.cpp +++ b/src/resources/openglimagehelper.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/openglimagehelper.h b/src/resources/openglimagehelper.h index 8d2348ed9..6c6492eb4 100644 --- a/src/resources/openglimagehelper.h +++ b/src/resources/openglimagehelper.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/resource.cpp b/src/resources/resource.cpp index 0ec09e0f0..3f95cd86d 100644 --- a/src/resources/resource.cpp +++ b/src/resources/resource.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/resource.h b/src/resources/resource.h index cdcac1b8f..bc3d54f51 100644 --- a/src/resources/resource.h +++ b/src/resources/resource.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 82f7cfca8..00fe37c75 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index 4e954242f..83c0036f2 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/sdl2imagehelper.cpp b/src/resources/sdl2imagehelper.cpp index 0ea97c5f4..80110735f 100644 --- a/src/resources/sdl2imagehelper.cpp +++ b/src/resources/sdl2imagehelper.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/sdl2imagehelper.h b/src/resources/sdl2imagehelper.h index 46914e2a2..70ea9c12f 100644 --- a/src/resources/sdl2imagehelper.h +++ b/src/resources/sdl2imagehelper.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/sdl2softwareimagehelper.cpp b/src/resources/sdl2softwareimagehelper.cpp index a8ca5cd89..3e8802f41 100644 --- a/src/resources/sdl2softwareimagehelper.cpp +++ b/src/resources/sdl2softwareimagehelper.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/sdl2softwareimagehelper.h b/src/resources/sdl2softwareimagehelper.h index a63f45933..210b0f8b1 100644 --- a/src/resources/sdl2softwareimagehelper.h +++ b/src/resources/sdl2softwareimagehelper.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/sdlimagehelper.cpp b/src/resources/sdlimagehelper.cpp index 6e198b457..cced7ad8a 100644 --- a/src/resources/sdlimagehelper.cpp +++ b/src/resources/sdlimagehelper.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/sdlimagehelper.h b/src/resources/sdlimagehelper.h index ad1423596..725b34ebc 100644 --- a/src/resources/sdlimagehelper.h +++ b/src/resources/sdlimagehelper.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/sdlmusic.cpp b/src/resources/sdlmusic.cpp index b9f6492d1..9ea87b670 100644 --- a/src/resources/sdlmusic.cpp +++ b/src/resources/sdlmusic.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/sdlmusic.h b/src/resources/sdlmusic.h index 957468134..02f168522 100644 --- a/src/resources/sdlmusic.h +++ b/src/resources/sdlmusic.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/soundeffect.cpp b/src/resources/soundeffect.cpp index 2da3319e8..8a009bfeb 100644 --- a/src/resources/soundeffect.cpp +++ b/src/resources/soundeffect.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/soundeffect.h b/src/resources/soundeffect.h index 4768c9284..40579b3e2 100644 --- a/src/resources/soundeffect.h +++ b/src/resources/soundeffect.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/soundinfo.h b/src/resources/soundinfo.h index 5d6bd21ad..bae53ae35 100644 --- a/src/resources/soundinfo.h +++ b/src/resources/soundinfo.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/spritedef.cpp b/src/resources/spritedef.cpp index f20bba2a9..9970063c8 100644 --- a/src/resources/spritedef.cpp +++ b/src/resources/spritedef.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h index 9113ee132..fe84096c3 100644 --- a/src/resources/spritedef.h +++ b/src/resources/spritedef.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/subimage.cpp b/src/resources/subimage.cpp index 520a37fe9..fd35fb7bb 100644 --- a/src/resources/subimage.cpp +++ b/src/resources/subimage.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/subimage.h b/src/resources/subimage.h index 43e8eda14..27a76d277 100644 --- a/src/resources/subimage.h +++ b/src/resources/subimage.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/surfaceimagehelper.cpp b/src/resources/surfaceimagehelper.cpp index aaecc2b71..740c1c41d 100644 --- a/src/resources/surfaceimagehelper.cpp +++ b/src/resources/surfaceimagehelper.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/surfaceimagehelper.h b/src/resources/surfaceimagehelper.h index 39efa1d4d..fb3649f06 100644 --- a/src/resources/surfaceimagehelper.h +++ b/src/resources/surfaceimagehelper.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index f15142208..1866241bb 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/resources/wallpaper.h b/src/resources/wallpaper.h index 98cf58ae1..4d409fa48 100644 --- a/src/resources/wallpaper.h +++ b/src/resources/wallpaper.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/sdlshared.h b/src/sdlshared.h index 48e4ce25b..a011045bc 100644 --- a/src/sdlshared.h +++ b/src/sdlshared.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/shopitem.cpp b/src/shopitem.cpp index fd2a7e670..8ee8da670 100644 --- a/src/shopitem.cpp +++ b/src/shopitem.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/shopitem.h b/src/shopitem.h index 8eeaadb92..449d9f91c 100644 --- a/src/shopitem.h +++ b/src/shopitem.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/simpleanimation.cpp b/src/simpleanimation.cpp index 77e84d835..63f15c18f 100644 --- a/src/simpleanimation.cpp +++ b/src/simpleanimation.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -79,7 +79,7 @@ void SimpleAnimation::draw(Graphics *const graphics, if (!mCurrentFrame || !mCurrentFrame->image) return; - DRAW_IMAGE(graphics, mCurrentFrame->image, + graphics->drawImage2(mCurrentFrame->image, posX + mCurrentFrame->offsetX, posY + mCurrentFrame->offsetY); } diff --git a/src/simpleanimation.h b/src/simpleanimation.h index c78b5009c..f5f971059 100644 --- a/src/simpleanimation.h +++ b/src/simpleanimation.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/soundconsts.h b/src/soundconsts.h index 17117f021..adbbe3372 100644 --- a/src/soundconsts.h +++ b/src/soundconsts.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/soundmanager.cpp b/src/soundmanager.cpp index be36c0f6a..f106b6623 100644 --- a/src/soundmanager.cpp +++ b/src/soundmanager.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/soundmanager.h b/src/soundmanager.h index 2679fbec5..3ed5b6fc0 100644 --- a/src/soundmanager.h +++ b/src/soundmanager.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/spellmanager.cpp b/src/spellmanager.cpp index 5d465e244..85ac4bf22 100644 --- a/src/spellmanager.cpp +++ b/src/spellmanager.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/spellmanager.h b/src/spellmanager.h index e6323da51..c30fa645f 100644 --- a/src/spellmanager.h +++ b/src/spellmanager.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/spellshortcut.cpp b/src/spellshortcut.cpp index 73cbb0122..ecdf3a8ae 100644 --- a/src/spellshortcut.cpp +++ b/src/spellshortcut.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers. + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/spellshortcut.h b/src/spellshortcut.h index 82c269925..bef241944 100644 --- a/src/spellshortcut.h +++ b/src/spellshortcut.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/sprite.h b/src/sprite.h index 75c81b29b..52ac535ca 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/statuseffect.cpp b/src/statuseffect.cpp index 75c409734..018fe39ec 100644 --- a/src/statuseffect.cpp +++ b/src/statuseffect.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/statuseffect.h b/src/statuseffect.h index 90b49baf2..7c36b48bf 100644 --- a/src/statuseffect.h +++ b/src/statuseffect.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/test/testlauncher.cpp b/src/test/testlauncher.cpp index 99f0b1753..a0e4f98dc 100644 --- a/src/test/testlauncher.cpp +++ b/src/test/testlauncher.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -94,7 +94,7 @@ int TestLauncher::testBackend() const for (int f = 0; f < cnt; f ++) { - DRAW_IMAGE(mainGraphics, img, cnt * 7, cnt * 5); + mainGraphics->drawImage2(img, cnt * 7, cnt * 5); mainGraphics->updateScreen(); } @@ -152,11 +152,11 @@ int TestLauncher::testFps() { for (int y = 0; y < 600; y += 50) { - DRAW_IMAGE(mainGraphics, img[idx], x, y); + mainGraphics->drawImage2(img[idx], x, y); idx ++; if (idx > sz) idx = 0; - DRAW_IMAGE(mainGraphics, img[idx], x, y); + mainGraphics->drawImage2(img[idx], x, y); idx ++; if (idx > sz) idx = 0; @@ -211,9 +211,9 @@ int TestLauncher::testInternal() { for (int y = 0; y < 600; y += 25) { - DRAW_IMAGE(mainGraphics, img[idx], x, y); - DRAW_IMAGE(mainGraphics, img[idx], x + 1, y); - DRAW_IMAGE(mainGraphics, img[idx], x, y + 5); + mainGraphics->drawImage2(img[idx], x, y); + mainGraphics->drawImage2(img[idx], x + 1, y); + mainGraphics->drawImage2(img[idx], x, y + 5); idx ++; if (idx > 3) diff --git a/src/test/testlauncher.h b/src/test/testlauncher.h index 17c3c0f2c..296cc5b29 100644 --- a/src/test/testlauncher.h +++ b/src/test/testlauncher.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp index f7cb65275..fadeb206e 100644 --- a/src/test/testmain.cpp +++ b/src/test/testmain.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/test/testmain.h b/src/test/testmain.h index 1142747ed..c46e6a1fc 100644 --- a/src/test/testmain.h +++ b/src/test/testmain.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/text.cpp b/src/text.cpp index ee9e3b33a..d0027b8ae 100644 --- a/src/text.cpp +++ b/src/text.cpp @@ -3,7 +3,7 @@ * Copyright (C) 2008 Douglas Boffey <DougABoffey@netscape.net> * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/text.h b/src/text.h index 2a5c84cf7..2c6b9b2b4 100644 --- a/src/text.h +++ b/src/text.h @@ -3,7 +3,7 @@ * Copyright (C) 2008 Douglas Boffey <DougABoffey@netscape.net> * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/textcommand.cpp b/src/textcommand.cpp index 1aa2e8381..1cc1e8ded 100644 --- a/src/textcommand.cpp +++ b/src/textcommand.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/textcommand.h b/src/textcommand.h index 81f91d7d4..2011e90c2 100644 --- a/src/textcommand.h +++ b/src/textcommand.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 Andrei Karas - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/textmanager.cpp b/src/textmanager.cpp index 949867fa3..3c51bf25e 100644 --- a/src/textmanager.cpp +++ b/src/textmanager.cpp @@ -1,7 +1,7 @@ /* * Support for non-overlapping floating text * Copyright (C) 2008 Douglas Boffey <DougABoffey@netscape.net> - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/textmanager.h b/src/textmanager.h index 33e15c5d4..a63707301 100644 --- a/src/textmanager.h +++ b/src/textmanager.h @@ -1,7 +1,7 @@ /* * Support for non-overlapping floating text * Copyright (C) 2008 Douglas Boffey <DougABoffey@netscape.net> - * Copyright (C) 2011-2013 The ManaPlus developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/tileset.h b/src/tileset.h index 57e1056a9..77140544e 100644 --- a/src/tileset.h +++ b/src/tileset.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/touchactions.cpp b/src/touchactions.cpp index 7fe51ae44..1b6abdf23 100644 --- a/src/touchactions.cpp +++ b/src/touchactions.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/touchactions.h b/src/touchactions.h index f61c5496e..6374ca46c 100644 --- a/src/touchactions.h +++ b/src/touchactions.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index 843a578ce..2f93a4ddc 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -225,7 +225,7 @@ void TouchManager::draw() const Image *const icon = item->icon; if (icon) { - DRAW_IMAGE(mainGraphics, icon, + mainGraphics->drawImage2(icon, item->x + (item->width - icon->mBounds.w) / 2, item->y + (item->height - icon->mBounds.h) / 2); } diff --git a/src/touchmanager.h b/src/touchmanager.h index 37cba8eee..8668654ec 100644 --- a/src/touchmanager.h +++ b/src/touchmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/units.cpp b/src/units.cpp index a5cc75213..f1ba1ba39 100644 --- a/src/units.cpp +++ b/src/units.cpp @@ -2,7 +2,7 @@ * Support for custom units * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/units.h b/src/units.h index accfa4189..84ad177cd 100644 --- a/src/units.h +++ b/src/units.h @@ -2,7 +2,7 @@ * Support for custom units * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/checkutils.cpp b/src/utils/checkutils.cpp index d2eb01488..ac49e3534 100644 --- a/src/utils/checkutils.cpp +++ b/src/utils/checkutils.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/checkutils.h b/src/utils/checkutils.h index ed21bda0a..ea01c09d4 100644 --- a/src/utils/checkutils.h +++ b/src/utils/checkutils.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/copynpaste.cpp b/src/utils/copynpaste.cpp index 20af28454..4e4f3c183 100644 --- a/src/utils/copynpaste.cpp +++ b/src/utils/copynpaste.cpp @@ -1,7 +1,7 @@ /* * Retrieve string pasted depending on OS mechanisms. * Copyright (C) 2001-2010 Wormux Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/copynpaste.h b/src/utils/copynpaste.h index 1a6069267..67cb11357 100644 --- a/src/utils/copynpaste.h +++ b/src/utils/copynpaste.h @@ -1,7 +1,7 @@ /* * Retrieve string pasted depending on OS mechanisms. * Copyright (C) 2001-2010 Wormux Team - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/cpu.cpp b/src/utils/cpu.cpp index 6dfd5a98c..c48b25ddd 100644 --- a/src/utils/cpu.cpp +++ b/src/utils/cpu.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/cpu.h b/src/utils/cpu.h index 01e29d705..57d28dd89 100644 --- a/src/utils/cpu.h +++ b/src/utils/cpu.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/dtor.h b/src/utils/dtor.h index d1bdd8777..c14ec41f6 100644 --- a/src/utils/dtor.h +++ b/src/utils/dtor.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/files.cpp b/src/utils/files.cpp index cb43ff5df..206a4d4bd 100644 --- a/src/utils/files.cpp +++ b/src/utils/files.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -126,6 +126,7 @@ void Files::extractZip(const std::string &restrict zipName, int Files::renameFile(const std::string &restrict srcName, const std::string &restrict dstName) { +#if defined __native_client__ FILE *srcFile = fopen(srcName.c_str(), "rb"); if (srcFile == nullptr) return -1; @@ -158,4 +159,40 @@ int Files::renameFile(const std::string &restrict srcName, return 0; return -1; +#else + return ::rename(srcName.c_str(), dstName.c_str()); +#endif +} + +int Files::copyFile(const std::string &restrict srcName, + const std::string &restrict dstName) +{ + FILE *srcFile = fopen(srcName.c_str(), "rb"); + if (srcFile == nullptr) + return -1; + FILE *dstFile = fopen(dstName.c_str(), "w+b"); + if (dstFile == nullptr) + { + fclose(srcFile); + return -1; + } + + const int chunkSize = 500000; + char *buf = new char[chunkSize]; + size_t sz = 0; + while ((sz = fread(buf, 1, chunkSize, srcFile))) + { + if (fwrite(buf, 1, sz, dstFile) != sz) + { + delete [] buf; + fclose(srcFile); + fclose(dstFile); + return -1; + } + } + + delete [] buf; + fclose(srcFile); + fclose(dstFile); + return 0; } diff --git a/src/utils/files.h b/src/utils/files.h index 5eb29031e..cc578464a 100644 --- a/src/utils/files.h +++ b/src/utils/files.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -49,6 +49,9 @@ namespace Files int renameFile(const std::string &restrict pFrom, const std::string &restrict pTo); + + int copyFile(const std::string &restrict pFrom, + const std::string &restrict pTo); } // namespace Files #endif // UTILS_FILES_H diff --git a/src/utils/fuzzer.cpp b/src/utils/fuzzer.cpp index 42468d6b0..6d76b1329 100644 --- a/src/utils/fuzzer.cpp +++ b/src/utils/fuzzer.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/fuzzer.h b/src/utils/fuzzer.h index 91193901d..95c9e3999 100644 --- a/src/utils/fuzzer.h +++ b/src/utils/fuzzer.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/gettext.h b/src/utils/gettext.h index a00e44898..5acf1596a 100644 --- a/src/utils/gettext.h +++ b/src/utils/gettext.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/langs.cpp b/src/utils/langs.cpp index e7a72a692..af05649a9 100644 --- a/src/utils/langs.cpp +++ b/src/utils/langs.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/langs.h b/src/utils/langs.h index 608ae7d05..bbc9e546f 100644 --- a/src/utils/langs.h +++ b/src/utils/langs.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/mathutils.h b/src/utils/mathutils.h index 01078baf3..545a1cc4b 100644 --- a/src/utils/mathutils.h +++ b/src/utils/mathutils.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/mkdir.cpp b/src/utils/mkdir.cpp index 3108d1afa..045556f2b 100644 --- a/src/utils/mkdir.cpp +++ b/src/utils/mkdir.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/mkdir.h b/src/utils/mkdir.h index 591f2ca95..2eb1c361d 100644 --- a/src/utils/mkdir.h +++ b/src/utils/mkdir.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/mutex.h b/src/utils/mutex.h index 70e5fa54d..4c207bad7 100644 --- a/src/utils/mutex.h +++ b/src/utils/mutex.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2008-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/paths.cpp b/src/utils/paths.cpp index e02fcc23c..4599efb16 100644 --- a/src/utils/paths.cpp +++ b/src/utils/paths.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/paths.h b/src/utils/paths.h index cb0af64ad..8ed1fd3d9 100644 --- a/src/utils/paths.h +++ b/src/utils/paths.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/perfomance.cpp b/src/utils/perfomance.cpp index b0deea95c..93d09cb40 100644 --- a/src/utils/perfomance.cpp +++ b/src/utils/perfomance.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/perfomance.h b/src/utils/perfomance.h index f668988f3..c88859730 100644 --- a/src/utils/perfomance.h +++ b/src/utils/perfomance.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/physfscheckutils.cpp b/src/utils/physfscheckutils.cpp index 6b443dc65..103726e19 100644 --- a/src/utils/physfscheckutils.cpp +++ b/src/utils/physfscheckutils.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/physfscheckutils.h b/src/utils/physfscheckutils.h index df14fe093..4940591c5 100644 --- a/src/utils/physfscheckutils.h +++ b/src/utils/physfscheckutils.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp index fc0020433..0faab8f20 100644 --- a/src/utils/physfsrwops.cpp +++ b/src/utils/physfsrwops.cpp @@ -19,7 +19,7 @@ * * This file was written by Ryan C. Gordon. (icculus@icculus.org). * - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers */ #include "utils/physfsrwops.h" diff --git a/src/utils/physfsrwops.h b/src/utils/physfsrwops.h index 11b44a185..7c829d9f2 100644 --- a/src/utils/physfsrwops.h +++ b/src/utils/physfsrwops.h @@ -19,7 +19,7 @@ * * This file was written by Ryan C. Gordon. (icculus@icculus.org). * - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers */ #ifndef UTILS_PHYSFSRWOPS_H diff --git a/src/utils/physfstools.cpp b/src/utils/physfstools.cpp index 325f7cddc..8e04aa608 100644 --- a/src/utils/physfstools.cpp +++ b/src/utils/physfstools.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * @@ -33,13 +33,17 @@ const char *dirSeparator = nullptr; namespace PhysFs { +#if defined(__native_client__) void init(const char *const name) { -#if defined(__native_client__) if (!PHYSFS_init("/fakebinary")) #elif defined(ANDROID) + void init(const char *const name A_UNUSED) + { if (!PHYSFS_init((getRealPath(".").append("/fakebinary")).c_str())) #else + void init(const char *const name) + { if (!PHYSFS_init(name)) #endif { diff --git a/src/utils/physfstools.h b/src/utils/physfstools.h index fd760f287..3667f7a16 100644 --- a/src/utils/physfstools.h +++ b/src/utils/physfstools.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/process.cpp b/src/utils/process.cpp index 1bd8430b5..bb7488e33 100644 --- a/src/utils/process.cpp +++ b/src/utils/process.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/process.h b/src/utils/process.h index 1652dcce0..4604c4100 100644 --- a/src/utils/process.h +++ b/src/utils/process.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/sdl2helper.cpp b/src/utils/sdl2helper.cpp index ff50e29c8..22c57116c 100644 --- a/src/utils/sdl2helper.cpp +++ b/src/utils/sdl2helper.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/sdl2helper.h b/src/utils/sdl2helper.h index 7d2743815..9f625ee84 100644 --- a/src/utils/sdl2helper.h +++ b/src/utils/sdl2helper.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/sdlcheckutils.cpp b/src/utils/sdlcheckutils.cpp index a3524aa91..028c2968f 100644 --- a/src/utils/sdlcheckutils.cpp +++ b/src/utils/sdlcheckutils.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/sdlcheckutils.h b/src/utils/sdlcheckutils.h index 069a37057..ef1fc201e 100644 --- a/src/utils/sdlcheckutils.h +++ b/src/utils/sdlcheckutils.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/sdlhelper.cpp b/src/utils/sdlhelper.cpp index 1511bedb1..0f5d67a59 100644 --- a/src/utils/sdlhelper.cpp +++ b/src/utils/sdlhelper.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/sdlhelper.h b/src/utils/sdlhelper.h index 29d8241e3..a471268af 100644 --- a/src/utils/sdlhelper.h +++ b/src/utils/sdlhelper.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/specialfolder.cpp b/src/utils/specialfolder.cpp index 9415e4d46..01e8556ca 100644 --- a/src/utils/specialfolder.cpp +++ b/src/utils/specialfolder.cpp @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/specialfolder.h b/src/utils/specialfolder.h index 0506c5c26..d94ba6b1e 100644 --- a/src/utils/specialfolder.h +++ b/src/utils/specialfolder.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 6a4c3a085..8e657bb93 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/stringutils.h b/src/utils/stringutils.h index 37d744823..02b1aa031 100644 --- a/src/utils/stringutils.h +++ b/src/utils/stringutils.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/stringvector.h b/src/utils/stringvector.h index fc313e0c3..d33c09452 100644 --- a/src/utils/stringvector.h +++ b/src/utils/stringvector.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/timer.cpp b/src/utils/timer.cpp index f6aab825c..f5245646e 100644 --- a/src/utils/timer.cpp +++ b/src/utils/timer.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/timer.h b/src/utils/timer.h index 40f8cc39d..2ced185a2 100644 --- a/src/utils/timer.h +++ b/src/utils/timer.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/translation/podict.cpp b/src/utils/translation/podict.cpp index 3941e776e..443fe56a3 100644 --- a/src/utils/translation/podict.cpp +++ b/src/utils/translation/podict.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/translation/podict.h b/src/utils/translation/podict.h index a39cee73f..36cf0d4af 100644 --- a/src/utils/translation/podict.h +++ b/src/utils/translation/podict.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/translation/poparser.cpp b/src/utils/translation/poparser.cpp index e624c85aa..76dae99a5 100644 --- a/src/utils/translation/poparser.cpp +++ b/src/utils/translation/poparser.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/translation/poparser.h b/src/utils/translation/poparser.h index 15aef53e3..dbf87b531 100644 --- a/src/utils/translation/poparser.h +++ b/src/utils/translation/poparser.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/translation/translationmanager.cpp b/src/utils/translation/translationmanager.cpp index eb7a98759..893e4d33f 100644 --- a/src/utils/translation/translationmanager.cpp +++ b/src/utils/translation/translationmanager.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/translation/translationmanager.h b/src/utils/translation/translationmanager.h index 8c75a8038..e7d42aa39 100644 --- a/src/utils/translation/translationmanager.h +++ b/src/utils/translation/translationmanager.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index b87418079..a2de26ee3 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/utils/xml.h b/src/utils/xml.h index a0a563498..0fa0ba078 100644 --- a/src/utils/xml.h +++ b/src/utils/xml.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2004-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/variabledata.h b/src/variabledata.h index 715731b8b..9230299e3 100644 --- a/src/variabledata.h +++ b/src/variabledata.h @@ -1,7 +1,7 @@ /* * The ManaPlus Client * Copyright (C) 2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/vector.cpp b/src/vector.cpp index e4ca3eafa..2e6fd7df2 100644 --- a/src/vector.cpp +++ b/src/vector.cpp @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/vector.h b/src/vector.h index 66a0d501f..2ec3bc724 100644 --- a/src/vector.h +++ b/src/vector.h @@ -2,7 +2,7 @@ * The ManaPlus Client * Copyright (C) 2007-2009 The Mana World Development Team * Copyright (C) 2009-2010 The Mana Developers - * Copyright (C) 2011-2013 The ManaPlus Developers + * Copyright (C) 2011-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/walklayer.cpp b/src/walklayer.cpp index 53ac31048..5ca6e4c71 100644 --- a/src/walklayer.cpp +++ b/src/walklayer.cpp @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/walklayer.h b/src/walklayer.h index c8b729207..0c5110f48 100644 --- a/src/walklayer.h +++ b/src/walklayer.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2013 The ManaPlus Developers + * Copyright (C) 2013-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * diff --git a/src/winver.h b/src/winver.h index cc5825959..16d0ce5b2 100644 --- a/src/winver.h +++ b/src/winver.h @@ -1,6 +1,6 @@ /* * The ManaPlus Client - * Copyright (C) 2012-2013 The ManaPlus Developers + * Copyright (C) 2012-2014 The ManaPlus Developers * * This file is part of The ManaPlus Client. * |