From e49f1e0050d7e948df0bc797f47ee250b0f44dae Mon Sep 17 00:00:00 2001 From: David Athay Date: Sun, 25 Mar 2012 17:55:25 -0500 Subject: Made changes to compile on Mac OSX 10.6 and later MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also added Xcode project for others to compile for Mac OSX. Reviewed-by: Thorbjørn Lindeijer --- src/gui/widgets/scrollarea.cpp | 2 +- src/log.cpp | 12 ++---------- src/log.mm | 36 ++++++++++++++++++++++++++++++++++++ src/net/manaserv/connection.h | 1 + 4 files changed, 40 insertions(+), 11 deletions(-) create mode 100644 src/log.mm (limited to 'src') diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 716dc7bc..d5e824e1 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -212,7 +212,7 @@ void ScrollArea::logic() void ScrollArea::updateAlpha() { - float alpha = std::max(config.getFloatValue("guialpha"), + float alpha = std::max(config.getFloatValue("guialpha"), Theme::instance()->getMinimumOpacity()); if (alpha != mAlpha) diff --git a/src/log.cpp b/src/log.cpp index fc36ea75..eae0a82b 100644 --- a/src/log.cpp +++ b/src/log.cpp @@ -24,7 +24,7 @@ #ifdef _WIN32 #include #elif __APPLE__ -#include +void MacDialogBox(const std::string &error); #endif #include @@ -109,15 +109,7 @@ void Logger::error(const std::string &error_text) #ifdef _WIN32 MessageBox(NULL, error_text.c_str(), "Error", MB_ICONERROR | MB_OK); #elif defined __APPLE__ - Str255 msg; - CFStringRef error; - error = CFStringCreateWithCString(NULL, - error_text.c_str(), - kCFStringEncodingMacRoman); - CFStringGetPascalString(error, msg, 255, kCFStringEncodingMacRoman); - StandardAlert(kAlertStopAlert, - "\pError", - (ConstStr255Param) msg, NULL, NULL); + MacDialogBox(error_text); #elif defined __linux__ || __linux std::cerr << "Error: " << error_text << std::endl; std::string msg="xmessage \"" + error_text + "\""; diff --git a/src/log.mm b/src/log.mm new file mode 100644 index 00000000..ae241c59 --- /dev/null +++ b/src/log.mm @@ -0,0 +1,36 @@ +/* + * The Mana Client + * Copyright (C) 2004-2009 The Mana World Development Team + * Copyright (C) 2009-2012 The Mana Developers + * + * This file is part of The Mana 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 . + */ + +#import +#include + +void MacDialogBox(const std::string &error) +{ + NSString *errorMessage = [NSString stringWithCString:error.c_str() + encoding:[NSString defaultCStringEncoding]]; + NSAlert *alert = [NSAlert alertWithMessageText:errorMessage + defaultButton:@"OK" + alternateButton:nil + otherButton:nil + informativeTextWithFormat:@""]; + + [alert runModal]; +} diff --git a/src/net/manaserv/connection.h b/src/net/manaserv/connection.h index 954849de..42932c47 100644 --- a/src/net/manaserv/connection.h +++ b/src/net/manaserv/connection.h @@ -23,6 +23,7 @@ #define NET_MANASERV_CONNECTION_H #include +#include "net/manaserv/network.h" #include -- cgit v1.2.3-70-g09d2 From 4f8eacb64b5d5b1cf0cbd8071ed75f66f8354dfc Mon Sep 17 00:00:00 2001 From: David Athay Date: Sun, 25 Mar 2012 23:18:13 -0500 Subject: Update version for Mac OSX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Thorbjørn Lindeijer --- src/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.h b/src/main.h index 8be57657..1c0ce33a 100644 --- a/src/main.h +++ b/src/main.h @@ -55,7 +55,7 @@ #elif defined _WIN32 #include "winver.h" #elif defined __APPLE__ -#define PACKAGE_VERSION "0.5.3" +#define PACKAGE_VERSION "0.6.0" #endif #ifdef PACKAGE_VERSION -- cgit v1.2.3-70-g09d2 From bc9a2e2135c7f515b29b7ee2e5cefde99c70d6c8 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 1 Apr 2012 19:52:30 +0200 Subject: Bumped version and updated news in preparation of 0.6.1 release --- CMakeLists.txt | 2 +- NEWS | 12 ++++++++++++ README | 2 +- data/help/changes.txt | 12 ++++++++++++ data/help/header.txt | 2 +- packaging/windows/setup.nsi | 2 +- src/main.h | 2 +- src/winver.h | 4 ++-- 8 files changed, 31 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2e06d02d..6996c7dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ CMAKE_POLICY(VERSION 2.6) PROJECT(MANA) IF (NOT VERSION) - SET(VERSION 0.6.0) + SET(VERSION 0.6.1) ENDIF() STRING(REPLACE "." " " _VERSION ${VERSION}) diff --git a/NEWS b/NEWS index ea84c258..4f7971c4 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,15 @@ +0.6.1 (2 April 2012) +- Made it easier to click beings that are next to other beings +- Removed NPC trade messages from chat (again) +- Fixed swapping of ring and necklace equipment slots +- Fixed drawing order of particles +- Fixed manaserv-enabled builds +- Fixed category of mana.desktop file +- Fixed display of server description +- Fixed issues with rendering very small maps +- Fixed compile for Mac OSX and reintroduced Xcode project +- Updated Finnish, Brazilian Portuguese and Polish translations + 0.6.0 (12 February 2012) - Added support for a larger number of character slots - Added scrolling to tab bars when there isn't enough space diff --git a/README b/README index 671c804d..cd99e10a 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ THE MANA CLIENT =============== - Version: 0.6.0 Date: 2012-02-12 + Version: 0.6.1 Date: 2012-04-02 Development team: - See AUTHORS file for a list diff --git a/data/help/changes.txt b/data/help/changes.txt index b7ecc8c8..a4a148cd 100644 --- a/data/help/changes.txt +++ b/data/help/changes.txt @@ -3,6 +3,18 @@ ##3 === RECENT CHANGES === ##0 + 0.6.1 (2 April 2012) + - Made it easier to click beings that are next to other beings + - Removed NPC trade messages from chat (again) + - Fixed swapping of ring and necklace equipment slots + - Fixed drawing order of particles + - Fixed manaserv-enabled builds + - Fixed category of mana.desktop file + - Fixed display of server description + - Fixed issues with rendering very small maps + - Fixed compile for Mac OSX and reintroduced Xcode project + - Updated Finnish, Brazilian Portuguese and Polish translations + 0.6.0 (12 February 2012) - Added support for a larger number of character slots - Added scrolling to tab bars when there isn't enough space diff --git a/data/help/header.txt b/data/help/header.txt index 1e5b2fb5..2910af85 100644 --- a/data/help/header.txt +++ b/data/help/header.txt @@ -2,7 +2,7 @@ ##1 M A N A C L I E N T ##1 ========================================= - ##2Version:##0 0.6.0 ##2Date:##0 12 February 2012 + ##2Version:##0 0.6.1 ##2Date:##0 2 April 2012 ##2 Website:##0 http://manasource.org diff --git a/packaging/windows/setup.nsi b/packaging/windows/setup.nsi index 602d8291..f7d7e069 100644 --- a/packaging/windows/setup.nsi +++ b/packaging/windows/setup.nsi @@ -45,7 +45,7 @@ SetCompressor /SOLID lzma !System "${UPX} --best --crp-ms=999999 --compress-icons=0 --nrv2d ${EXEDIR}\${PRODUCT_NAME_SHORT}.exe" !ifndef PRODUCT_VERSION - !define PRODUCT_VERSION "0.5-git" + !define PRODUCT_VERSION "0.6-git" !endif !define PRODUCT_PUBLISHER "Mana Development Team" !define PRODUCT_WEB_SITE "http://manasource.org" diff --git a/src/main.h b/src/main.h index 1c0ce33a..5a663646 100644 --- a/src/main.h +++ b/src/main.h @@ -55,7 +55,7 @@ #elif defined _WIN32 #include "winver.h" #elif defined __APPLE__ -#define PACKAGE_VERSION "0.6.0" +#define PACKAGE_VERSION "0.6.1" #endif #ifdef PACKAGE_VERSION diff --git a/src/winver.h b/src/winver.h index ce6f23ee..4c33fe29 100644 --- a/src/winver.h +++ b/src/winver.h @@ -21,6 +21,6 @@ /* VERSION DEFINITIONS */ #define VER_MAJOR 0 #define VER_MINOR 6 -#define VER_RELEASE 0 +#define VER_RELEASE 1 #define VER_BUILD 0 -#define PACKAGE_VERSION "0.6.0.0" +#define PACKAGE_VERSION "0.6.1.0" -- cgit v1.2.3-70-g09d2 From 4c7ff677593ea5a56326ec5a43814291f36bd452 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 1 Apr 2012 20:21:24 +0200 Subject: Potentially fixed problems with user agent in Windows builds The Windows releases have not been properly identifying themselves, and it seems to be due to a compiler issue, as discovered by Stefan Dombrowski (@cody). He did a similar change but didn't push it anywhere so I've redone it. The line that is now split up was very preprocessor-heavy, which may have been part of the problem, but we'll probably never know what it was exactly. --- src/net/download.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/net/download.cpp b/src/net/download.cpp index 988cc662..bccba7a3 100644 --- a/src/net/download.cpp +++ b/src/net/download.cpp @@ -220,9 +220,11 @@ int Download::downloadThread(void *ptr) curl_easy_setopt(d->mCurl, CURLOPT_WRITEDATA, file); } - curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT, - strprintf(PACKAGE_EXTENDED_VERSION, - branding.getStringValue("appShort").c_str()).c_str()); + const std::string appShort = branding.getStringValue("appShort"); + const std::string userAgent = + strprintf(PACKAGE_EXTENDED_VERSION, appShort.c_str()); + + curl_easy_setopt(d->mCurl, CURLOPT_USERAGENT, userAgent.c_str()); curl_easy_setopt(d->mCurl, CURLOPT_ERRORBUFFER, d->mError); curl_easy_setopt(d->mCurl, CURLOPT_URL, d->mUrl.c_str()); curl_easy_setopt(d->mCurl, CURLOPT_NOPROGRESS, 0); -- cgit v1.2.3-70-g09d2 From 9015268746ed9052a9dc83839b2834b5feeab166 Mon Sep 17 00:00:00 2001 From: Thorbjørn Lindeijer Date: Sun, 1 Apr 2012 22:13:39 +0200 Subject: Fixed problems with using the last emote The tmwa/BeingHandler was adjusting the effect id rather than the emote id, causing it to not find the last emote (and the rest of the emotes only worked correctly because the effect ids were consecutive in the same order as the emote ids). Furthermore, the EmoteShortcutContainer refused to draw the icon for the last emote due to an off-by-one error in dealing with the 1-adjusted emote ids used by the EmoteShortcut class. Also cleaned up some old remains of a player ignore strategy that used to use the two balloon emotes (this had been their original purpose). Reviewed-by: Erik Schilling --- NEWS | 1 + data/help/changes.txt | 1 + src/being.h | 2 -- src/gui/widgets/emoteshortcutcontainer.cpp | 5 ++--- src/net/tmwa/beinghandler.cpp | 5 ++--- src/playerrelations.cpp | 3 +-- src/resources/emotedb.cpp | 6 +++--- src/resources/emotedb.h | 4 ++-- 8 files changed, 12 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/NEWS b/NEWS index 4f7971c4..c655caea 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,7 @@ - Made it easier to click beings that are next to other beings - Removed NPC trade messages from chat (again) - Fixed swapping of ring and necklace equipment slots +- Fixed problems with using the last emote - Fixed drawing order of particles - Fixed manaserv-enabled builds - Fixed category of mana.desktop file diff --git a/data/help/changes.txt b/data/help/changes.txt index a4a148cd..a080b2d7 100644 --- a/data/help/changes.txt +++ b/data/help/changes.txt @@ -7,6 +7,7 @@ - Made it easier to click beings that are next to other beings - Removed NPC trade messages from chat (again) - Fixed swapping of ring and necklace equipment slots + - Fixed problems with using the last emote - Fixed drawing order of particles - Fixed manaserv-enabled builds - Fixed category of mana.desktop file diff --git a/src/being.h b/src/being.h index 84c159b7..0287dc6e 100644 --- a/src/being.h +++ b/src/being.h @@ -31,11 +31,9 @@ #include #include -#include #include #include -#define FIRST_IGNORE_EMOTE 14 #define STATUS_EFFECTS 32 #define SPEECH_TIME 500 diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp index 1230e47a..3105a762 100644 --- a/src/gui/widgets/emoteshortcutcontainer.cpp +++ b/src/gui/widgets/emoteshortcutcontainer.cpp @@ -60,7 +60,7 @@ EmoteShortcutContainer::EmoteShortcutContainer(): mEmoteImg.push_back(EmoteDB::get(i)->sprite); } - mMaxItems = EmoteDB::getLast() < MAX_ITEMS ? EmoteDB::getLast() : MAX_ITEMS; + mMaxItems = std::min(EmoteDB::getLast(), MAX_ITEMS); mBoxHeight = mBackgroundImg->getHeight(); mBoxWidth = mBackgroundImg->getWidth(); @@ -97,11 +97,10 @@ void EmoteShortcutContainer::draw(gcn::Graphics *graphics) g->drawText(key, emoteX + 2, emoteY + 2, gcn::Graphics::LEFT); int emoteId = emoteShortcut->getEmote(i); - if (emoteId > 0 && emoteId <= EmoteDB::getLast()) + if (emoteId > 0 && emoteId <= EmoteDB::getLast() + 1) { mEmoteImg[emoteId - 1]->draw(g, emoteX + 2, emoteY + 10); } - } if (mEmoteMoved) diff --git a/src/net/tmwa/beinghandler.cpp b/src/net/tmwa/beinghandler.cpp index c94e08df..b7d84685 100644 --- a/src/net/tmwa/beinghandler.cpp +++ b/src/net/tmwa/beinghandler.cpp @@ -427,9 +427,8 @@ void BeingHandler::handleMessage(Net::MessageIn &msg) if (player_relations.hasPermission(dstBeing, PlayerRelation::EMOTE)) { - const int fx = EmoteDB::get(msg.readInt8())->effect; - //TODO: figure out why the -1 is needed - effectManager->trigger(fx - 1, dstBeing); + const int fx = EmoteDB::get(msg.readInt8() - 1)->effect; + effectManager->trigger(fx, dstBeing); } break; diff --git a/src/playerrelations.cpp b/src/playerrelations.cpp index 89cd7250..47bc1913 100644 --- a/src/playerrelations.cpp +++ b/src/playerrelations.cpp @@ -31,8 +31,7 @@ #include "utils/gettext.h" #define PLAYER_IGNORE_STRATEGY_NOP "nop" -#define PLAYER_IGNORE_STRATEGY_EMOTE0 "emote0" -#define DEFAULT_IGNORE_STRATEGY PLAYER_IGNORE_STRATEGY_EMOTE0 +#define DEFAULT_IGNORE_STRATEGY PLAYER_IGNORE_STRATEGY_NOP #define NAME "name" // constant for xml serialisation #define RELATION "relation" // constant for xml serialisation diff --git a/src/resources/emotedb.cpp b/src/resources/emotedb.cpp index 6a001078..00721ac4 100644 --- a/src/resources/emotedb.cpp +++ b/src/resources/emotedb.cpp @@ -45,7 +45,7 @@ void EmoteDB::load() unload(); mUnknown.name = "unknown"; - mUnknown.effect = 0; + mUnknown.effect = -1; mUnknown.sprite = new ImageSprite( ResourceManager::getInstance()->getImage("graphics/sprites/error.png")); @@ -91,7 +91,7 @@ void EmoteDB::load() const int width = XML::getProperty(emoteNode, "width", 0); const int height = XML::getProperty(emoteNode, "height", 0); - if (imageName.empty() || !(width > 0) || !(height > 0)) + if (imageName.empty() || width <= 0 || height <= 0) { logger->log("Emote Database: Warning: Emote with bad imageset values"); delete currentEmote; @@ -150,7 +150,7 @@ const Emote *EmoteDB::get(int id) } } -const int &EmoteDB::getLast() +int EmoteDB::getLast() { return mLastEmote; } diff --git a/src/resources/emotedb.h b/src/resources/emotedb.h index 1324fb7e..a1e991ec 100644 --- a/src/resources/emotedb.h +++ b/src/resources/emotedb.h @@ -48,9 +48,9 @@ namespace EmoteDB const Emote *get(int id); - const int &getLast(); + int getLast(); typedef Emotes::iterator EmotesIterator; } -#endif +#endif // EMOTE_DB_H -- cgit v1.2.3-70-g09d2