diff --git a/.travis.yml b/.travis.yml index 48acd7689..ece4fd393 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,38 @@ language: cpp +branches: + except: + - latest-master + before_install: - export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" - export PSPSDK="$PSPDEV/psp/sdk" - export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" - export ANDROID="android-sdk-linux/tools/android" -install: +- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa - sudo apt-get update -qq - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi +- sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev pulseaudio libpulse-dev +- export QMAKE="qmake -qt=qt5" - wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download -- tar -x --xz -f sdk.lzma - wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv -- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv +- wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz -nv + +install: +- tar -x --xz -f sdk.lzma - tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 -- tar -zxf android-sdk_r22-linux.tgz -- $ANDROID list sdk -a -- echo yes | $ANDROID update sdk -a --filter 1,2,4,18 --no-ui --force > log.txt +- tar -zxf android-sdk_r23.0.2-linux.tgz +- $ANDROID list sdk --extended -a +- echo yes | $ANDROID update sdk --filter tools,platform-tools,build-tools-21.1.1,android-10 --no-ui --force --no-https - sudo pip install pyjavaproperties -script: ./travis-script.sh +- sudo pip install github3.py + env: global: secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8=" script: "./travis-script.sh" -after_success: ./upload-binaries.sh + +after_success: +- python upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH +- python upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/Android/bin/Wagic-debug.apk -r Wagic-android.apk -b $TRAVIS_BRANCH +- python upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/psprelease.zip -r Wagic-psp.zip -b $TRAVIS_BRANCH diff --git a/JGE/include/Downloader.h b/JGE/include/Downloader.h new file mode 100644 index 000000000..96c643ae2 --- /dev/null +++ b/JGE/include/Downloader.h @@ -0,0 +1,128 @@ +#ifndef DOWNLOADER_H +#define DOWNLOADER_H + +//------------------------------------------------------------------------------------- +// +// This class handles download of remote resources (any kind of file) +// All the resources are stored locally in the userPath +// For every resources, the downloader verifies if the resource was modifed +// on the server before downloading the update. The Downloader maintains a catalogue +// of resource downloaded to be able to check if they need to be updated. +// +// The interface can be used completly synchronously by the application and some +// context or message loop is needed in the implementation of this interface +// +// Note that the Downloader could in theory by implemented on top of JNetwork. +// +//------------------------------------------------------------------------------------- +#include +#include +#include +#include +#include +#include "Threading.h" +#ifdef QT_CONFIG +#include +#include +#include +#include +#endif + +using namespace std; + +class DownloadRequest + #ifdef QT_CONFIG + : public QObject + #endif +{ +#ifdef QT_CONFIG + Q_OBJECT + +private slots: +#endif + void fileDownloaded(); + void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); + +#ifdef QT_CONFIG +signals: + void percentChanged(int percent); + void statusChanged(int); +#endif + +public: + typedef enum { + NOT_PRESENT, + DOWNLOADING, + DOWNLOADED, + DOWNLOAD_ERROR + } DownloadStatus; + +protected: + string mLocalPath; + string mRemoteResourceURL; + // previous one is the original, next one can change after redirection + string mRequestedRemoteResourceURL; + string mETag; + DownloadStatus mDownloadStatus; + bool mUpgradeAvailable; + size_t mTotalSize; + size_t mCurrentSize; + ofstream mFile; +#ifdef QT_CONFIG + QNetworkReply* mNetworkReply; + static QNetworkAccessManager networkAccessManager; +#endif + + +public: + DownloadRequest(string localPath="", + string remoteResourceURL="", + string ETag = "", + DownloadStatus downloadStatus=NOT_PRESENT, + size_t totalSize = 0, + size_t currentSize = 0); + ~DownloadRequest(); + static bool NetworkIsAccessible(); + + string getTempLocalPath() const { return (mLocalPath+".tmp"); }; + string getLocalPath() const { return mLocalPath; }; + string getRemoteResource() const { return mRemoteResourceURL; }; + string getETag() const { return mETag; }; + void startGet(); + void startHead(); + DownloadStatus getDownloadStatus() const { return mDownloadStatus; }; + bool upgradeAvailable() const { return mUpgradeAvailable; }; + void getSizes(size_t& totalSize, size_t¤tSize) { + totalSize = mTotalSize; + currentSize = mCurrentSize; + }; + + friend ostream& operator<<(ostream& out, const DownloadRequest& d); + friend istream& operator>>(istream&, DownloadRequest&); + friend class Downloader; +}; + + +class Downloader +{ +protected: + Downloader(string globalRemoteURL="", string localCacheRecords=""); + virtual ~Downloader(); + static Downloader* mInstance; + string mGlobalRemoteURL; + string mLocalCacheRecords; + boost::mutex mMutex; + map mRequestMap; + +public: + static Downloader* GetInstance(); + static void Release(); + + void Update(); + DownloadRequest* Get(string localPath, string remoteResourceURL=""); + + friend ostream& operator<<(ostream& out, const Downloader& d); + friend istream& operator>>(istream&, Downloader&); +}; + +#endif // DOWNLOADER_H diff --git a/JGE/include/JAnimator.h b/JGE/include/JAnimator.h index 794c6ce50..a525e3b88 100644 --- a/JGE/include/JAnimator.h +++ b/JGE/include/JAnimator.h @@ -297,7 +297,6 @@ public: private: float mTimer; float mFrameTime; - JAnimator* mAnimator; vector mObjects; }; diff --git a/JGE/include/JDistortionMesh.h b/JGE/include/JDistortionMesh.h index 10939a83e..171446a91 100644 --- a/JGE/include/JDistortionMesh.h +++ b/JGE/include/JDistortionMesh.h @@ -37,7 +37,6 @@ private: float mTexY; float mTexWidth; float mTexHeight; - JTexture* mTexture; JQuad* mQuad; diff --git a/JGE/include/JFileSystem.h b/JGE/include/JFileSystem.h index 6c658a8b3..25cdc7551 100644 --- a/JGE/include/JFileSystem.h +++ b/JGE/include/JFileSystem.h @@ -128,6 +128,7 @@ public: bool readIntoString(const string & FilePath, string & target); bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out ); bool Rename(string from, string to); + bool Remove(string aFile); //Returns true if strFilename exists somewhere in the fileSystem bool FileExists(const string& strFilename); @@ -163,4 +164,4 @@ protected: -#endif \ No newline at end of file +#endif diff --git a/JGE/include/JSoundSystem.h b/JGE/include/JSoundSystem.h index 93fe4f1e3..130935813 100644 --- a/JGE/include/JSoundSystem.h +++ b/JGE/include/JSoundSystem.h @@ -23,28 +23,32 @@ #include "SLES/OpenSLES_Android.h" #elif defined USE_PHONON - #include - #include +#include +#include +#elif (defined QT_CONFIG) +#include "QMediaPlayer" +#include "QMediaPlaylist" +#include "QSoundEffect" #elif defined WIN32 - #include +#include #define WITH_FMOD #elif defined (PSP) - #include - #include - #include - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include +#include +#include +#include - #include "JAudio.h" - #include "JMP3.h" +#include "JAudio.h" +#include "JMP3.h" #endif #ifdef WITH_FMOD - #include "../Dependencies/include/fmod.h" +#include "../Dependencies/include/fmod.h" #endif //------------------------------------------------------------------------------------------------ @@ -67,7 +71,7 @@ public: #ifdef USE_PHONON Phonon::AudioOutput* mOutput; Phonon::MediaObject* mMediaObject; - public slots: +public slots: void seekAtTheBegining(); #elif defined (PSP) JMP3* mTrack; @@ -82,6 +86,10 @@ public: SLPlayItf playInterface; SLSeekItf seekInterface; SLVolumeItf musicVolumeInterface; +#elif (defined QT_CONFIG) + QMediaPlaylist* playlist; + QMediaPlayer* player; + string fullpath; #else void* mTrack; #endif //WITH_FMOD @@ -92,13 +100,15 @@ public: //------------------------------------------------------------------------------------------------ class JSample { - public: +public: JSample(); ~JSample(); unsigned long fileSize(); - -#if defined (PSP) +#if (defined QT_CONFIG) && (!defined USE_PHONON) + QMediaPlayer* effect; + void* mSample; +#elif defined (PSP) WAVDATA *mSample; #elif defined (IOS) std::string filename; @@ -133,126 +143,128 @@ class JSoundSystem public: - ////////////////////////////////////////////////////////////////////////// - /// Get the singleton instance - /// - ////////////////////////////////////////////////////////////////////////// - static JSoundSystem* GetInstance(); + ////////////////////////////////////////////////////////////////////////// + /// Get the singleton instance + /// + ////////////////////////////////////////////////////////////////////////// + static JSoundSystem* GetInstance(); - static void Destroy(); + static void Destroy(); - ////////////////////////////////////////////////////////////////////////// - /// Load music. - /// - /// @note MP3 is the only supported format for the moment. - /// - /// @param filename - Name of the music file. - /// - ////////////////////////////////////////////////////////////////////////// - JMusic *LoadMusic(const char *fileName); + ////////////////////////////////////////////////////////////////////////// + /// Load music. + /// + /// @note MP3 is the only supported format for the moment. + /// + /// @param filename - Name of the music file. + /// + ////////////////////////////////////////////////////////////////////////// + JMusic *LoadMusic(const char *fileName); - ////////////////////////////////////////////////////////////////////////// - /// Delete music from memory. - /// - /// @param music - Music to be deleted. - /// - ////////////////////////////////////////////////////////////////////////// - //void FreeMusic(JMusic *music); + ////////////////////////////////////////////////////////////////////////// + /// Delete music from memory. + /// + /// @param music - Music to be deleted. + /// + ////////////////////////////////////////////////////////////////////////// + //void FreeMusic(JMusic *music); - ////////////////////////////////////////////////////////////////////////// - /// Play music. - /// - /// @param music - Music to be played. - /// @param looping - Play the music in a loop. - /// - ////////////////////////////////////////////////////////////////////////// - void PlayMusic(JMusic *music, bool looping = false); + ////////////////////////////////////////////////////////////////////////// + /// Play music. + /// + /// @param music - Music to be played. + /// @param looping - Play the music in a loop. + /// + ////////////////////////////////////////////////////////////////////////// + void PlayMusic(JMusic *music, bool looping = false); - ////////////////////////////////////////////////////////////////////////// - /// Stop playing. - /// - /// @param music - Music to be stopped. - /// - ////////////////////////////////////////////////////////////////////////// - void StopMusic(JMusic *music); + ////////////////////////////////////////////////////////////////////////// + /// Stop playing. + /// + /// @param music - Music to be stopped. + /// + ////////////////////////////////////////////////////////////////////////// + void StopMusic(JMusic *music); - ////////////////////////////////////////////////////////////////////////// - /// Resume playing. - /// - /// @param music - Music to be resumed. - /// - ////////////////////////////////////////////////////////////////////////// - void ResumeMusic(JMusic *music); + ////////////////////////////////////////////////////////////////////////// + /// Resume playing. + /// + /// @param music - Music to be resumed. + /// + ////////////////////////////////////////////////////////////////////////// + void ResumeMusic(JMusic *music); - ////////////////////////////////////////////////////////////////////////// - /// Pause playing. - /// - /// @param music - Music to be paused. - /// - ////////////////////////////////////////////////////////////////////////// - void PauseMusic(JMusic *music); + ////////////////////////////////////////////////////////////////////////// + /// Pause playing. + /// + /// @param music - Music to be paused. + /// + ////////////////////////////////////////////////////////////////////////// + void PauseMusic(JMusic *music); - ////////////////////////////////////////////////////////////////////////// - /// Load sound effect. - /// - /// @note WAV sound effect only. - /// - /// @param fileName - Sound effect for loading. - /// - ////////////////////////////////////////////////////////////////////////// - JSample *LoadSample(const char *fileName); + ////////////////////////////////////////////////////////////////////////// + /// Load sound effect. + /// + /// @note WAV sound effect only. + /// + /// @param fileName - Sound effect for loading. + /// + ////////////////////////////////////////////////////////////////////////// + JSample *LoadSample(const char *fileName); - ////////////////////////////////////////////////////////////////////////// - /// Delete sound effect from memory. - /// - /// @param sample - Sound to be deleted. - /// - ////////////////////////////////////////////////////////////////////////// - //void FreeSample(JSample *sample); + ////////////////////////////////////////////////////////////////////////// + /// Delete sound effect from memory. + /// + /// @param sample - Sound to be deleted. + /// + ////////////////////////////////////////////////////////////////////////// + //void FreeSample(JSample *sample); - ////////////////////////////////////////////////////////////////////////// - /// Play sound effect. - /// - /// @param sample - Sound for playing. - /// - ////////////////////////////////////////////////////////////////////////// - void PlaySample(JSample *sample); + ////////////////////////////////////////////////////////////////////////// + /// Play sound effect. + /// + /// @param sample - Sound for playing. + /// + ////////////////////////////////////////////////////////////////////////// + void PlaySample(JSample *sample); - ////////////////////////////////////////////////////////////////////////// - /// Set volume for audio playback. - /// - /// @param volume - New volume. - /// - ////////////////////////////////////////////////////////////////////////// - void SetVolume(int volume); + ////////////////////////////////////////////////////////////////////////// + /// Set volume for audio playback. + /// + /// @param volume - New volume. + /// + ////////////////////////////////////////////////////////////////////////// + void SetVolume(int volume); - void SetMusicVolume(int volume); + void SetMusicVolume(int volume); - void SetSfxVolume(int volume); + void SetSfxVolume(int volume); - int mChannel; + int mChannel; protected: - JSoundSystem(); - ~JSoundSystem(); + JSoundSystem(); + ~JSoundSystem(); - void InitSoundSystem(); - void DestroySoundSystem(); + void InitSoundSystem(); + void DestroySoundSystem(); private: - - JMusic *mCurrentMusic; +#if (defined PSP || defined ANDROID) + JMusic *mCurrentMusic; JSample *mCurrentSample; +#endif - int mVolume; - int mMusicVolume; - int mSampleVolume; + int mVolume; + int mMusicVolume; + int mSampleVolume; - static JSoundSystem* mInstance; + static JSoundSystem* mInstance; }; #endif + diff --git a/JGE/include/Threading.h b/JGE/include/Threading.h index d69985a07..9bc40c118 100644 --- a/JGE/include/Threading.h +++ b/JGE/include/Threading.h @@ -1,7 +1,7 @@ #ifndef THREADING_H #define THREADING_H -#if !defined(PSP) && !defined(QT_CONFIG) && !defined(WP8) && !(defined(SDL_CONFIG) && defined(__MINGW32__)) +#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L) && !(_MSC_VER >= 1700) #include #ifdef WIN32 @@ -26,7 +26,7 @@ namespace boost { /** - ** PSP specific variant of a boost mutex & scoped_lock + ** PSP specific variant of a boost mutex & scoped_lock */ template @@ -60,7 +60,7 @@ namespace boost { sceKernelDeleteSema(mID); } - + void lock() { int result = sceKernelWaitSema(mID, 1, 0); @@ -142,7 +142,7 @@ namespace boost } } - + int mID; int mThreadID; volatile int mRecursionCount; @@ -164,7 +164,7 @@ namespace boost /** - ** Emulating boost::thread configuration glue, with some shortcuts + ** Emulating boost::thread configuration glue, with some shortcuts ** This detail namespace is a distillation of boost's thread.hpp, thread_data.hpp. */ namespace detail @@ -212,13 +212,13 @@ namespace boost ** ** The intent of its usage is this form only: ** mWorkerThread = boost::thread(ThreadProc, this); - ** where ThreadProc is a static member function of the 'this' class,eg: - ** static void FOO::ThreadProc(void* inParam) - ** { - ** FOO* instance = reinterpret_cast(inParam); - ** // now you have class instance data available... - ** } - ** + ** where ThreadProc is a static member function of the 'this' class,eg: + ** static void FOO::ThreadProc(void* inParam) + ** { + ** FOO* instance = reinterpret_cast(inParam); + ** // now you have class instance data available... + ** } + ** ** Any other variant of a thread proc with more than one param is unimplemented. */ class thread @@ -227,7 +227,7 @@ namespace boost ** Helper class for sceKernelStartThread, which passes args by value, not by reference ** We use this struct to wrap any pointers that we want to pass to the worker thread. */ - struct CallbackData + struct CallbackData { CallbackData(detail::thread_data_ptr inThreadInfo) : mThreadInfo(inThreadInfo) @@ -307,7 +307,7 @@ namespace boost } } -#elif defined(QT_CONFIG) +#elif defined(QT_CONFIG) && (__cplusplus <= 199711L) #include #include @@ -537,14 +537,14 @@ namespace boost } } -#elif defined(WP8) || (defined(SDL_CONFIG) && defined(__MINGW32__)) +#elif (__cplusplus > 199711L) || (_MSC_VER >= 1700) #include #include namespace boost { - typedef std::thread thread; + typedef std::thread thread; template struct unique_lock @@ -562,7 +562,7 @@ namespace boost Mutex* mMutex; }; - class mutex + class mutex { public: @@ -606,7 +606,7 @@ namespace boost { inline void sleep(boost::posix_time::milliseconds const& time) { - std::this_thread::sleep_for(std::chrono::milliseconds(time)); + std::this_thread::sleep_for(std::chrono::milliseconds(time)); } } } diff --git a/JGE/include/qt/qtcorewrapper.h b/JGE/include/qt/qtcorewrapper.h index a8c065bd9..9ccf28159 100644 --- a/JGE/include/qt/qtcorewrapper.h +++ b/JGE/include/qt/qtcorewrapper.h @@ -113,6 +113,20 @@ signals: private slots: private: + int lastPosx(){ +#if QT_VERSION >= 0x050100 + return m_lastPos.x()*devicePixelRatio(); +#else + return m_lastPos.x(); +#endif + } + int lastPosy(){ +#if QT_VERSION >= 0x050100 + return m_lastPos.y()*devicePixelRatio(); +#else + return m_lastPos.y(); +#endif + } void timerEvent( QTimerEvent* ); public: @@ -125,6 +139,7 @@ private: int m_timerId; bool m_active; QRect m_viewPort; + QPoint m_lastPos; #ifdef QT_WIDGET #if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID) int mMouseDownX; diff --git a/JGE/src/Downloader.cpp b/JGE/src/Downloader.cpp new file mode 100644 index 000000000..e1ba9eb26 --- /dev/null +++ b/JGE/src/Downloader.cpp @@ -0,0 +1,298 @@ +#include "DebugRoutines.h" +#include "JFileSystem.h" +#include "Downloader.h" + +#define RECORDS_DEFAULT_FILE "cache/records.txt" + +#ifdef QT_CONFIG +QNetworkAccessManager DownloadRequest::networkAccessManager; +#endif + +DownloadRequest::DownloadRequest(string localPath, + string remoteResourceURL, + string ETag, + DownloadStatus downloadStatus, + size_t totalSize, + size_t currentSize): + mLocalPath(localPath), + mRemoteResourceURL(remoteResourceURL), + mRequestedRemoteResourceURL(remoteResourceURL), + mETag(ETag), + mDownloadStatus(downloadStatus), + mUpgradeAvailable(false), + mTotalSize(totalSize), + mCurrentSize(currentSize) +{ +} + +DownloadRequest::~DownloadRequest() +{ +} + +void DownloadRequest::startHead() +{ +#ifdef QT_CONFIG + QNetworkRequest request(QUrl(QString(mRequestedRemoteResourceURL.c_str()))); + request.setRawHeader("If-None-Match", mETag.c_str()); + mNetworkReply = networkAccessManager.head(request); + connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded())); +#endif +} + +void DownloadRequest::startGet() +{ +#ifdef QT_CONFIG + mNetworkReply = networkAccessManager.get(QNetworkRequest(QUrl(QString(mRequestedRemoteResourceURL.c_str())))); +#endif + mFile.close(); + JFileSystem::GetInstance()->Remove(getTempLocalPath()); + JFileSystem::GetInstance()->openForWrite(mFile, getTempLocalPath()); +#ifdef QT_CONFIG + connect(mNetworkReply, SIGNAL(downloadProgress(qint64, qint64)), + SLOT(downloadProgress(qint64, qint64))); + connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded())); +#endif +} + +void DownloadRequest::fileDownloaded() +{ + do { + QByteArray eTagByteArray = mNetworkReply->rawHeader("ETag"); + if(!eTagByteArray.isEmpty()) { + string oldETag = mETag; + mETag = QString(eTagByteArray).toStdString(); + if(oldETag!="" && oldETag != mETag) + mUpgradeAvailable = true; + } + + // let's check some error + if(mNetworkReply->error() != QNetworkReply::NoError) { + DebugTrace(mNetworkReply->errorString().toStdString()); + mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR; + mFile.close(); + JFileSystem::GetInstance()->Remove(getTempLocalPath()); + break; + } + + // check if we're getting redirected + QVariant redirectionTarget = mNetworkReply->attribute(QNetworkRequest::RedirectionTargetAttribute); + if (!redirectionTarget.isNull()) { + QUrl newUrl = QUrl(mRequestedRemoteResourceURL.c_str()).resolved(redirectionTarget.toUrl()); + DebugTrace(string("Redirect to ")+ newUrl.toString().toStdString()); + + mRequestedRemoteResourceURL = newUrl.toString().toStdString(); + mNetworkReply->deleteLater(); + if(mFile.is_open()) + startGet(); + else + startHead(); + return; + } + + if(mFile.is_open()) + { + QByteArray byteArray = mNetworkReply->readAll(); + mFile.write(byteArray.constData(), byteArray.size()); + mFile.close(); + if(!JFileSystem::GetInstance()->Rename(getTempLocalPath(), mLocalPath)) { + mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR; + break; + } + } + mDownloadStatus = DownloadRequest::DOWNLOADED; + } while(0); + + Downloader::GetInstance()->Update(); + mNetworkReply->deleteLater(); + + emit statusChanged((int)mDownloadStatus); +} + +void DownloadRequest::downloadProgress(qint64 bytesReceived, qint64 bytesTotal) +{ + QByteArray byteArray = mNetworkReply->readAll(); + mFile.write(byteArray.constData(), byteArray.size()); + mCurrentSize = bytesReceived; + mTotalSize = bytesTotal; + int percent = 0; + if(bytesTotal) + percent = (bytesReceived/bytesTotal)*100; + emit percentChanged(percent); +} + +Downloader* Downloader::mInstance = 0; + +Downloader::Downloader(string globalRemoteURL, string localcacheRecords): + mGlobalRemoteURL(globalRemoteURL), + mLocalCacheRecords(localcacheRecords) +{ + JFileSystem::GetInstance()->MakeDir("cache"); + + izfstream downloadRecords; + if(mLocalCacheRecords.empty()) + mLocalCacheRecords = RECORDS_DEFAULT_FILE; + if(JFileSystem::GetInstance()->openForRead(downloadRecords, mLocalCacheRecords)) + {// File exists, let's read it. + downloadRecords >> (*this); + } + JFileSystem::GetInstance()->CloseFile(); +} + +Downloader::~Downloader() +{ + map::iterator ite; + for(ite = mRequestMap.begin(); ite != mRequestMap.end(); ite++) + { + delete (*ite).second; + } + mRequestMap.erase(mRequestMap.begin(), mRequestMap.end()); +} + +Downloader* Downloader::GetInstance() +{ + if(!mInstance) + { + mInstance = new Downloader(); + } + return mInstance; +} + +void Downloader::Release() +{ + if(mInstance) + { + delete mInstance; + mInstance = 0; + } +} + +bool DownloadRequest::NetworkIsAccessible() +{ + bool result = false; + +#ifdef QT_CONFIG + networkAccessManager.setNetworkAccessible(QNetworkAccessManager::Accessible); + result = networkAccessManager.networkAccessible(); +#endif + + return result; +} + +DownloadRequest* Downloader::Get(string localPath, string remoteResourceURL) +{ + map::iterator ite = mRequestMap.find(localPath); + if(ite == mRequestMap.end()) + { // request does not exist, let's create it + DownloadRequest* request = new DownloadRequest(localPath, remoteResourceURL); + std::pair::iterator,bool> ret; + ret = mRequestMap.insert ( std::pair(localPath, request) ); + if (ret.second==false) { + DebugTrace("Downloader::Get Error inserting request in Map"); + return 0; + } + ite = ret.first; + } + + // Now, we can check the server + if((*ite).second->getDownloadStatus() == DownloadRequest::NOT_PRESENT || + (*ite).second->upgradeAvailable()) + { // File is not here or an update is available, let's get it + (*ite).second->startGet(); + (*ite).second->mDownloadStatus = DownloadRequest::DOWNLOADING; + } + else if ((*ite).second->getDownloadStatus() == DownloadRequest::DOWNLOADED) + { // File is here, let's check if there is some update without blocking the playback + (*ite).second->startHead(); + } + + return (*ite).second; +} + +void Downloader::Update() +{ + ofstream downloadRecords; + if(JFileSystem::GetInstance()->openForWrite(downloadRecords, mLocalCacheRecords)) + { + downloadRecords << (*this); + } + downloadRecords.close(); +} + +ostream& operator<<(ostream& out, const DownloadRequest& d) +{ +// HEAD request fails, so this line erase cache record after upgrade check :( +// if(d.getDownloadStatus() == DownloadRequest::DOWNLOADED) + { + out << "localPath=" << d.mLocalPath << endl; + out << "remoteResource=" << d.mRemoteResourceURL << endl; + out << "ETag=" << d.mETag << endl; + out << "upgradeAvailable=" << d.mUpgradeAvailable <>(istream& in, DownloadRequest& d) +{ + string s; + + while(std::getline(in, s)) + { + size_t limiter = s.find("="); + string areaS; + if (limiter != string::npos) + { + areaS = s.substr(0, limiter); + if (areaS.compare("localPath") == 0) + { + d.mLocalPath = s.substr(limiter + 1); + } + else if (areaS.compare("remoteResource") == 0) + { + d.mRemoteResourceURL = s.substr(limiter + 1); + d.mRequestedRemoteResourceURL = d.mRemoteResourceURL; + } + else if (areaS.compare("ETag") == 0) + { + d.mETag = s.substr(limiter + 1); + d.mDownloadStatus = DownloadRequest::DOWNLOADED; + } + else if (areaS.compare("upgradeAvailable") == 0) + { + d.mUpgradeAvailable = (bool)atoi(s.substr(limiter + 1).c_str()); + break; + } + } + } + + return in; +} + +ostream& operator<<(ostream& out, const Downloader& d) +{ + map::const_iterator ite; + for(ite = d.mRequestMap.begin(); ite != d.mRequestMap.end(); ite++) + { + out << (*(*ite).second) << endl; + } + return out; +} + +istream& operator>>(istream& in, Downloader& d) +{ + while(!in.eof()) + { + DownloadRequest* downloadRequest = new DownloadRequest(); + in >> (*downloadRequest); + + if(!downloadRequest->getLocalPath().empty() && + !downloadRequest->getRemoteResource().empty() && + !downloadRequest->getETag().empty()) { + d.mRequestMap[downloadRequest->getLocalPath()] = downloadRequest; + } else { + delete downloadRequest; + } + } + return in; +} + diff --git a/JGE/src/JFileSystem.cpp b/JGE/src/JFileSystem.cpp index 34f50936d..eee1612d5 100644 --- a/JGE/src/JFileSystem.cpp +++ b/JGE/src/JFileSystem.cpp @@ -322,11 +322,15 @@ bool JFileSystem::readIntoString(const string & FilePath, string & target) int fileSize = GetFileSize(file); +#ifndef __MINGW32__ try { +#endif target.resize((std::string::size_type) fileSize); +#ifndef __MINGW32__ } catch (bad_alloc&) { return false; } +#endif if (fileSize) @@ -562,7 +566,13 @@ bool JFileSystem::Rename(string _from, string _to) string from = mUserFSPath + _from; string to = mUserFSPath + _to; std::remove(to.c_str()); - return rename(from.c_str(), to.c_str()) ? true: false; + return (rename(from.c_str(), to.c_str()) == 0); +} + +bool JFileSystem::Remove(string aFile) +{ + string toRemove = mUserFSPath + aFile; + return (std::remove(toRemove.c_str()) == 0); } int JFileSystem::GetFileSize(izfstream & file) diff --git a/JGE/src/Qtmain.cpp b/JGE/src/Qtmain.cpp index c9b280600..aa2139342 100644 --- a/JGE/src/Qtmain.cpp +++ b/JGE/src/Qtmain.cpp @@ -9,11 +9,11 @@ #include #include "qmlapplicationviewer.h" #endif //QT_WIDGET -#include "filedownloader.h" +#include "Downloader.h" #include "GameApp.h" #include "qtcorewrapper.h" -QWidget* g_glwidget = NULL; +WagicCore* g_glwidget = NULL; @@ -40,11 +40,25 @@ int main(int argc, char* argv[]) #endif //QT_WIDGET - app->setApplicationName(QtWagicCore::getApplicationName()); - FileDownloader fileDownloader(USERDIR, WAGIC_RESOURCE_NAME); + app->setApplicationName(WagicCore::getApplicationName()); + DownloadRequest* downloadRequest = NULL; +#ifdef WAGIC_RESOURCE_URL + Downloader*downloader = Downloader::GetInstance(); + downloadRequest = downloader->Get( + "core.zip", + WAGIC_RESOURCE_URL + ); +#endif #ifdef QT_WIDGET - g_glwidget = new QtWagicCore(); - g_glwidget->connect(&fileDownloader, SIGNAL(finished(int)), SLOT(start(int))); + g_glwidget = new WagicCore(); + if(!downloadRequest || downloadRequest->getDownloadStatus() == DownloadRequest::DOWNLOADED) + { + g_glwidget->start(0); + } + else + { + g_glwidget->connect(downloadRequest, SIGNAL(statusChanged(int)), SLOT(start(int))); + } #else qmlRegisterType("CustomComponents", 1, 0, "WagicCore"); diff --git a/JGE/src/SDLmain.cpp b/JGE/src/SDLmain.cpp index f2e2436b3..f99fb7ce4 100644 --- a/JGE/src/SDLmain.cpp +++ b/JGE/src/SDLmain.cpp @@ -74,6 +74,22 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume( JNIEnv* env, jclass cls) { WagicCore::getInstance()->setActive(true); + if (!g_engine) + return; + g_engine->Resume(); +} + +#include "Wagic_Version.h" +extern "C" jstring Java_org_libsdl_app_SDLActivity_getResourceName( + JNIEnv* env, jclass cls) +{ + return env->NewStringUTF (WAGIC_RESOURCE_NAME); +} + +extern "C" jstring Java_org_libsdl_app_SDLActivity_getResourceUrl( + JNIEnv* env, jclass cls) +{ + return env->NewStringUTF (WAGIC_RESOURCE_URL); } #endif diff --git a/JGE/src/pc/JSfx.cpp b/JGE/src/pc/JSfx.cpp index 4977bc831..c92a6fb3a 100644 --- a/JGE/src/pc/JSfx.cpp +++ b/JGE/src/pc/JSfx.cpp @@ -22,6 +22,8 @@ JMusic::JMusic() #ifdef USE_PHONON : mOutput(0), mMediaObject(0) +#elif defined QT_CONFIG + : playlist(0), player(0) #endif { } @@ -40,11 +42,16 @@ int JMusic::getPlayTime(){ JMusic::~JMusic() { -#ifdef USE_PHONON +#if defined USE_PHONON if(mOutput) delete mOutput; if(mMediaObject) delete mMediaObject; +#elif defined QT_CONFIG + if(player) + delete player; + if(playlist) + delete playlist; #elif defined WITH_FMOD JSoundSystem::GetInstance()->StopMusic(this); if (mTrack) FSOUND_Sample_Free(mTrack); @@ -69,7 +76,10 @@ JSample::JSample() JSample::~JSample() { -#ifdef USE_PHONON +#if (defined QT_CONFIG) && (!defined USE_PHONON) + if(effect) + delete effect; +#elif USE_PHONON if(mOutput) delete mOutput; if(mMediaObject) @@ -144,65 +154,84 @@ void JSoundSystem::DestroySoundSystem() JMusic *JSoundSystem::LoadMusic(const char *fileName) { -#ifdef USE_PHONON - JMusic* music = new JMusic(); - if (music) - { - music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0); - music->mMediaObject = new Phonon::MediaObject(0); - string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName); - music->mMediaObject->setCurrentSource(QString(fullpath.c_str())); - Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput); - Q_ASSERT(mediapath.isValid()); - } - return music; -#elif (defined WITH_FMOD) - JMusic* music = new JMusic(); - if (music) + JMusic* music = NULL; +#if (defined QT_CONFIG) && (!defined USE_PHONON) + music = new JMusic(); + if (music) { - JFileSystem* fileSystem = JFileSystem::GetInstance(); - if (fileSystem->OpenFile(fileName)) - { - int size = fileSystem->GetFileSize(); - char *buffer = new char[size]; - fileSystem->ReadFile(buffer, size); - music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size); - - delete[] buffer; - fileSystem->CloseFile(); - } + music->player = new QMediaPlayer; + music->player->setVolume(100); + music->playlist = new QMediaPlaylist; + music->fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName); + music->playlist->addMedia(QUrl::fromLocalFile(music->fullpath.c_str())); + music->playlist->setCurrentIndex(0); + } +#elif defined USE_PHONON + music = new JMusic(); + if (music) + { + music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0); + music->mMediaObject = new Phonon::MediaObject(0); + string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName); + music->mMediaObject->setCurrentSource(QString(fullpath.c_str())); + Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput); + Q_ASSERT(mediapath.isValid()); + } +#elif (defined WITH_FMOD) + music = new JMusic(); + if (music) + { + JFileSystem* fileSystem = JFileSystem::GetInstance(); + if (fileSystem->OpenFile(fileName)) + { + int size = fileSystem->GetFileSize(); + char *buffer = new char[size]; + fileSystem->ReadFile(buffer, size); + music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size); + + delete[] buffer; + fileSystem->CloseFile(); + } } - return music; #else cerr << fileName << endl; - return NULL; #endif + return music; } void JSoundSystem::PlayMusic(JMusic *music, bool looping) { -#ifdef USE_PHONON - if (music && music->mMediaObject && music->mOutput) - { - if(looping) +#if (defined QT_CONFIG) && (!defined USE_PHONON) + if(music && music->player && music->playlist) { - music->mMediaObject->connect(music->mMediaObject, SIGNAL(aboutToFinish()), music, SLOT(seekAtTheBegining())); + if(looping) + music->playlist->setPlaybackMode(QMediaPlaylist::Loop); + + music->player->setPlaylist(music->playlist); + music->player->play(); } - music->mOutput->setVolume((qreal)mVolume*0.01); - music->mMediaObject->play(); - - } -#elif (defined WITH_FMOD) - if (music && music->mTrack) +#elif USE_PHONON + if (music && music->mMediaObject && music->mOutput) { - mChannel = FSOUND_PlaySound(mChannel, music->mTrack); - SetMusicVolume(mVolume); + if(looping) + { + music->mMediaObject->connect(music->mMediaObject, SIGNAL(aboutToFinish()), music, SLOT(seekAtTheBegining())); + } + music->mOutput->setVolume((qreal)mVolume*0.01); + music->mMediaObject->play(); - if (looping) - FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL); - else - FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF); + } +#elif (defined WITH_FMOD) + if (music && music->mTrack) + { + mChannel = FSOUND_PlaySound(mChannel, music->mTrack); + SetMusicVolume(mVolume); + + if (looping) + FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_NORMAL); + else + FSOUND_SetLoopMode(mChannel, FSOUND_LOOP_OFF); } #else music = 0; @@ -213,7 +242,12 @@ void JSoundSystem::PlayMusic(JMusic *music, bool looping) void JSoundSystem::StopMusic(JMusic *music) { -#ifdef USE_PHONON +#if (defined QT_CONFIG) && (!defined USE_PHONON) + if (music && music->player && music->playlist) + { + music->player->stop(); + } +#elif defined USE_PHONON if (music && music->mMediaObject && music->mOutput) { music->mMediaObject->stop(); @@ -264,47 +298,61 @@ void JSoundSystem::SetSfxVolume(int volume){ JSample *JSoundSystem::LoadSample(const char *fileName) { -#if (defined USE_PHONON) - JSample* sample = new JSample(); - if (sample) - { - sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0); - sample->mMediaObject = new Phonon::MediaObject(0); - string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName); - sample->mMediaObject->setCurrentSource(QString(fullpath.c_str())); - Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput); - Q_ASSERT(mediapath.isValid()); - } - return sample; -#elif (defined WITH_FMOD) - JSample* sample = new JSample(); - if (sample) + JSample* sample = NULL; +#if (defined QT_CONFIG) && (!defined USE_PHONON) + sample = new JSample(); + if (sample) { - JFileSystem* fileSystem = JFileSystem::GetInstance(); - if (fileSystem->OpenFile(fileName)) - { - int size = fileSystem->GetFileSize(); - char *buffer = new char[size]; - fileSystem->ReadFile(buffer, size); - sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size); + string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName); + sample->effect = new QMediaPlayer; + sample->effect->setMedia(QUrl::fromLocalFile(fullpath.c_str())); + sample->effect->setVolume(100); + sample->mSample = &(sample->effect); + } +#elif (defined USE_PHONON) + sample = new JSample(); + if (sample) + { + sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0); + sample->mMediaObject = new Phonon::MediaObject(0); + string fullpath = JFileSystem::GetInstance()->GetResourceFile(fileName); + sample->mMediaObject->setCurrentSource(QString(fullpath.c_str())); + Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput); + Q_ASSERT(mediapath.isValid()); + } +#elif (defined WITH_FMOD) + sample = new JSample(); + if (sample) + { + JFileSystem* fileSystem = JFileSystem::GetInstance(); + if (fileSystem->OpenFile(fileName)) + { + int size = fileSystem->GetFileSize(); + char *buffer = new char[size]; + fileSystem->ReadFile(buffer, size); + sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size); - delete[] buffer; - fileSystem->CloseFile(); - }else - sample->mSample = NULL; + delete[] buffer; + fileSystem->CloseFile(); + }else + sample->mSample = NULL; } - return sample; #else cerr << fileName << endl; - return NULL; #endif + return sample; } void JSoundSystem::PlaySample(JSample *sample) { -#ifdef USE_PHONON +#if (defined QT_CONFIG) && (!defined USE_PHONON) + if(sample) + { + sample->effect->play(); + } +#elif defined USE_PHONON if (sample && sample->mMediaObject && sample->mOutput) { sample->mOutput->setVolume((qreal)mSampleVolume*0.01); diff --git a/JGE/src/zipFS/zstream.h b/JGE/src/zipFS/zstream.h index 2f5d9b9f9..0e8b3bf19 100644 --- a/JGE/src/zipFS/zstream.h +++ b/JGE/src/zipFS/zstream.h @@ -106,6 +106,7 @@ public: virtual int overflow(int c = EOF); virtual int underflow(); virtual int sync(); + using std::streambuf::setbuf; virtual std::streambuf * setbuf(char * pr, int nLength); virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode); @@ -131,6 +132,7 @@ public: virtual int overflow(int c = EOF); virtual int underflow(); virtual int sync(); + using std::streambuf::setbuf; virtual std::streambuf * setbuf(char * pr, int nLength); virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode); diff --git a/README.md b/README.md index 1ea3ee9bb..f3eea73d2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ [![Build Status](https://travis-ci.org/WagicProject/wagic.png?branch=master)](https://travis-ci.org/WagicProject/wagic) +[![Build status](https://ci.appveyor.com/api/projects/status/7j4fbr6m62aqej59/branch/master)](https://ci.appveyor.com/project/xawotihs/wagic/branch/master) + ## Description @@ -16,6 +18,11 @@ Wagic, the Homebrew, is a C++ game engine that allows to play card games against It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc... -Info, Downloads, and more at http://wololo.net +Info, downloads, discussions and more at http://wololo.net/forum/index.php -![alt text](http://wololo.net/wagic/wp-content/uploads/2009/10/shop.jpg "Screenshot") + + + +### Sample round play-through video +[![IMAGE ALT TEXT HERE](http://img.youtube.com/vi/WUFSAPZuDIk/0.jpg)](http://www.youtube.com/watch?v=WUFSAPZuDIk) diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..a0802bbc0 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,68 @@ +# Notes: +# - Minimal appveyor.yml file is an empty file. All sections are optional. +# - Indent each level of configuration with 2 spaces. Do not use tabs! +# - All section names are case-sensitive. +# - Section names should be unique on each level. + +#---------------------------------# +# environment configuration # +#---------------------------------# + +environment: + GH_TOKEN: + secure: dYnBDQkiY5oVjIlswzBX9BJigNtBGXgGlp1tK3XbHzrDEDrs2vaKD5m+Oz5OSz1C + +# scripts that run after cloning repository +install: + - ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:/get-pip.py') + - "C:/Python27/python.exe C:/get-pip.py" + - "C:/Python27/Scripts/pip.exe install pyjavaproperties" + - "C:/Python27/Scripts/pip.exe install github3.py" + +#---------------------------------# +# build configuration # +#---------------------------------# + +# build Configuration, i.e. Debug, Release, etc. +configuration: Release + +build: + project: projects/mtg/mtg_vs2010.sln # path to Visual Studio solution or project + +#---------------------------------# +# tests configuration # +#---------------------------------# + +# to disable automatic tests +test: off + + +#---------------------------------# +# artifacts configuration # +#---------------------------------# + +artifacts: + # pushing windows package + - path: projects\mtg\bin\Wagic-windows*.zip + + +#---------------------------------# +# deployment configuration # +#---------------------------------# + +# scripts to run before deployment +before_deploy: + - cd projects/mtg/bin + - "C:/Python27/python.exe createWindowsZip.py" + - cd ../../.. + +# scripts to run after deployment +after_deploy: + +# to run your custom scripts instead of provider deployments +deploy_script: + - "C:/Python27/python.exe upload-binaries.py -t %GH_TOKEN% -s %APPVEYOR_REPO_COMMIT% -l projects/mtg/bin/Wagic-windows.zip -r Wagic-windows.zip -b %APPVEYOR_REPO_BRANCH%" + +# to disable deployment +#deploy: off + diff --git a/projects/mtg/Android/jni/Android.mk b/projects/mtg/Android/jni/Android.mk index 19187a701..2b1dbc709 100644 --- a/projects/mtg/Android/jni/Android.mk +++ b/projects/mtg/Android/jni/Android.mk @@ -57,7 +57,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \ $(MTG_PATH)/src/DeckMetaData.cpp \ $(MTG_PATH)/src/DeckStats.cpp \ $(MTG_PATH)/src/DuelLayers.cpp \ - $(MTG_PATH)/src/Effects.cpp \ $(MTG_PATH)/src/ExtraCost.cpp \ $(MTG_PATH)/src/GameApp.cpp \ $(MTG_PATH)/src/GameLauncher.cpp \ diff --git a/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java b/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java index 0891808c8..847475a48 100644 --- a/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java +++ b/projects/mtg/Android/src/org/libsdl/app/SDLActivity.java @@ -80,7 +80,6 @@ public class SDLActivity extends Activity implements OnKeyListener public Boolean mErrorHappened = false; public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/"; public static String RES_FILENAME = "core_0184.zip"; - public static final String RES_URL = "http://wagic.googlecode.com/files/"; public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/"; private String userFolder; @@ -307,7 +306,7 @@ public class SDLActivity extends Activity implements OnKeyListener private void startDownload() { - String url = RES_URL + RES_FILENAME; + String url = getResourceUrl(); if (!checkStorageState()) { Log.e(TAG, "Error in initializing storage space."); @@ -437,7 +436,7 @@ public class SDLActivity extends Activity implements OnKeyListener mContext = this.getApplicationContext(); // get the current version of the app to set the core filename String versionCodeString = getApplicationCode(); - RES_FILENAME = "core_" + versionCodeString + ".zip"; + RES_FILENAME = getResourceName(); StorageOptions.determineStorageOptions(); checkStorageLocationPreference(); @@ -525,6 +524,9 @@ public class SDLActivity extends Activity implements OnKeyListener } // C functions we call + public static native String getResourceUrl(); + public static native String getResourceName(); + public static native void nativeInit(); public static native void nativeQuit(); diff --git a/projects/mtg/Makefile b/projects/mtg/Makefile index a5db9bda5..7b53ff162 100644 --- a/projects/mtg/Makefile +++ b/projects/mtg/Makefile @@ -6,7 +6,7 @@ OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\ objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\ objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\ objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\ - objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\ + objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\ objs/GameObserver.o objs/GameOptions.o objs/GameState.o\ objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\ objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\ @@ -128,7 +128,7 @@ clean: endif define compile -$(CXX) -c $(CXXFLAGS) $< -o $@ +$(CXX) -c $(CXXFLAGS) $< -o $@ endef PrecompiledHeader.h.gch: ../../projects/mtg/include/PrecompiledHeader.h diff --git a/projects/mtg/bin/Res/createResourceZip.py b/projects/mtg/bin/Res/createResourceZip.py index ff5ed73d5..baf5eab1f 100644 --- a/projects/mtg/bin/Res/createResourceZip.py +++ b/projects/mtg/bin/Res/createResourceZip.py @@ -30,8 +30,8 @@ def createResZipFile(filename): zip_file.close() if rename: - os.rename('settings/options.txt', 'settings/options.orig.txt') - os.rename('player/options.txt', 'player/options.orig.txt') + os.rename('settings/options.txt', 'settings/options.orig.txt') + os.rename('player/options.txt', 'player/options.orig.txt') def getFilename(): p = Properties(); @@ -44,16 +44,18 @@ def getFilename(): -def createStandardResFile(): - print "Creating Standard Resource File" - filename = getFilename() + '.zip' +def createStandardResFile(filename): + print('Creating Standard Resource File') + if not filename: + filename = getFilename() + '.zip' createResZipFile( filename ) print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename) -def createIosResFile(): - print 'Preparing Resource Package for iOS' +def createIosResFile(filename): + print('Preparing Resource Package for iOS') utilities = ZipUtilities() - filename = getFilename() + '_iOS.zip' + if not filename: + filename = getFilename() + '_iOS.zip' #createResZipFile( filename ) zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED) zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED) @@ -78,10 +80,10 @@ class ZipUtilities: if file != '.svn': full_path = os.path.join(folder, file) if os.path.isfile(full_path): - print 'File added: ' + str(full_path) + print('File added: ' + str(full_path)) zip_file.write(full_path) elif os.path.isdir(full_path): - print 'Entering folder: ' + str(full_path) + print('Entering folder: ' + str(full_path)) self.addFolderToZip(zip_file, full_path) @@ -90,16 +92,17 @@ def main(): parser = OptionParser() parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform") + parser.add_option("-n", "--name", help="NAME: specify resource file name", metavar="NAME", dest="name") (options, args) = parser.parse_args() if (options.platform): - if (options.platform == "ios"): - createIosResFile() - else: - createStandardResFile() + if (options.platform == "ios"): + createIosResFile(options.name) + else: + createStandardResFile(options.name) else: - createStandardResFile() + createStandardResFile(options.name) if __name__ == "__main__": main() diff --git a/projects/mtg/bin/Res/sets/M14/_cards.dat b/projects/mtg/bin/Res/sets/M14/_cards.dat new file mode 100644 index 000000000..c2c52c8be --- /dev/null +++ b/projects/mtg/bin/Res/sets/M14/_cards.dat @@ -0,0 +1,1259 @@ +[meta] +author=Wagic Team +name=Magic 2014 +year=2013 +[/meta] +[card] +primitive=Academy Raider +id=370735 +rarity=C +[/card] +[card] +primitive=Accorder's Shield +id=370581 +rarity=C +[/card] +[card] +primitive=Accursed Spirit +id=370811 +rarity=C +[/card] +[card] +primitive=Act of Treason +id=370618 +rarity=C +[/card] +[card] +primitive=Advocate of the Beast +id=370738 +rarity=C +[/card] +[card] +primitive=Air Servant +id=370688 +rarity=C +[/card] +[card] +primitive=Ajani, Caller of the Pride +id=370680 +rarity=M +[/card] +[card] +primitive=Ajani's Chosen +id=370750 +rarity=R +[/card] +[card] +primitive=Altar's Reap +id=370677 +rarity=C +[/card] +[card] +primitive=Angelic Accord +id=370612 +rarity=U +[/card] +[card] +primitive=Angelic Wall +id=370789 +rarity=C +[/card] +[card] +primitive=Archaeomancer +id=370753 +rarity=C +[/card] +[card] +primitive=Archangel of Thune +id=370627 +rarity=M +[/card] +[card] +primitive=Armored Cancrix +id=370632 +rarity=C +[/card] +[card] +primitive=Artificer's Hex +id=370634 +rarity=U +[/card] +[card] +primitive=Auramancer +id=370793 +rarity=C +[/card] +[card] +primitive=Awaken the Ancient +id=370613 +rarity=R +[/card] +[card] +primitive=Banisher Priest +id=370624 +rarity=U +[/card] +[card] +primitive=Barrage of Expendables +id=370822 +rarity=U +[/card] +[card] +primitive=Battle Sliver +id=370639 +rarity=U +[/card] +[card] +primitive=Blessing +id=370819 +rarity=U +[/card] +[card] +primitive=Blightcaster +id=370761 +rarity=U +[/card] +[card] +primitive=Blood Bairn +id=370698 +rarity=C +[/card] +[card] +primitive=Blur Sliver +id=370593 +rarity=U +[/card] +[card] +primitive=Bogbrew Witch +id=370758 +rarity=R +[/card] +[card] +primitive=Bonescythe Sliver +id=370801 +rarity=R +[/card] +[card] +primitive=Bramblecrush +id=370642 +rarity=U +[/card] +[card] +primitive=Brave the Elements +id=370816 +rarity=U +[/card] +[card] +primitive=Briarpack Alpha +id=370739 +rarity=U +[/card] +[card] +primitive=Brindle Boar +id=370778 +rarity=C +[/card] +[card] +primitive=Bubbling Cauldron +id=370661 +rarity=R +[/card] +[card] +primitive=Burning Earth +id=370696 +rarity=R +[/card] +[card] +primitive=Cancel +id=370755 +rarity=C +[/card] +[card] +primitive=Canyon Minotaur +id=370757 +rarity=C +[/card] +[card] +primitive=Capashen Knight +id=370821 +rarity=C +[/card] +[card] +primitive=Celestial Flare +id=370666 +rarity=C +[/card] +[card] +primitive=Chandra, Pyromaster +id=370637 +rarity=M +[/card] +[card] +primitive=Chandra's Outrage +id=370659 +rarity=C +[/card] +[card] +primitive=Chandra's Phoenix +id=370691 +rarity=R +[/card] +[card] +primitive=Charging Griffin +id=370768 +rarity=C +[/card] +[card] +primitive=Child of Night +id=370823 +rarity=C +[/card] +[card] +primitive=Claustrophobia +id=370653 +rarity=C +[/card] +[card] +primitive=Clone +id=370622 +rarity=R +[/card] +[card] +primitive=Colossal Whale +id=370685 +rarity=R +[/card] +[card] +primitive=Congregate +id=370804 +rarity=U +[/card] +[card] +primitive=Coral Merfolk +id=370667 +rarity=C +[/card] +[card] +primitive=Corpse Hauler +id=370800 +rarity=C +[/card] +[card] +primitive=Corrupt +id=370630 +rarity=U +[/card] +[card] +primitive=Cyclops Tyrant +id=370585 +rarity=C +[/card] +[card] +primitive=Dark Favor +id=370782 +rarity=C +[/card] +[card] +primitive=Dark Prophecy +id=370596 +rarity=R +[/card] +[card] +primitive=Darksteel Forge +id=370734 +rarity=R +[/card] +[card] +primitive=Darksteel Ingot +id=370675 +rarity=U +[/card] +[card] +primitive=Dawnstrike Paladin +id=370721 +rarity=C +[/card] +[card] +primitive=Deadly Recluse +id=370582 +rarity=C +[/card] +[card] +primitive=Deathgaze Cockatrice +id=370775 +rarity=C +[/card] +[card] +primitive=Demolish +id=370621 +rarity=C +[/card] +[card] +primitive=Devout Invocation +id=370726 +rarity=M +[/card] +[card] +primitive=Diabolic Tutor +id=370732 +rarity=U +[/card] +[card] +primitive=Dismiss into Dream +id=370796 +rarity=R +[/card] +[card] +primitive=Disperse +id=370818 +rarity=C +[/card] +[card] +primitive=Divination +id=370616 +rarity=C +[/card] +[card] +primitive=Divine Favor +id=370748 +rarity=C +[/card] +[card] +primitive=Domestication +id=370783 +rarity=R +[/card] +[card] +primitive=Doom Blade +id=370609 +rarity=C +[/card] +[card] +primitive=Door of Destinies +id=370699 +rarity=R +[/card] +[card] +primitive=Dragon Egg +id=370660 +rarity=U +[/card] +[card] +primitive=Dragon Hatchling +id=370717 +rarity=C +[/card] +[card] +primitive=Duress +id=370577 +rarity=C +[/card] +[card] +primitive=Elite Arcanist +id=370747 +rarity=R +[/card] +[card] +primitive=Elixir of Immortality +id=370681 +rarity=U +[/card] +[card] +primitive=Elvish Mystic +id=370744 +rarity=C +[/card] +[card] +primitive=Encroaching Wastes +id=370769 +rarity=U +[/card] +[card] +primitive=Enlarge +id=370797 +rarity=U +[/card] +[card] +primitive=Essence Scatter +id=370694 +rarity=C +[/card] +[card] +primitive=Festering Newt +id=370772 +rarity=C +[/card] +[card] +primitive=Fiendslayer Paladin +id=370786 +rarity=R +[/card] +[card] +primitive=Fireshrieker +id=370715 +rarity=U +[/card] +[card] +primitive=Flames of the Firebrand +id=370824 +rarity=U +[/card] +[card] +primitive=Fleshpulper Giant +id=370741 +rarity=U +[/card] +[card] +primitive=Fog +id=370633 +rarity=C +[/card] +[card] +primitive=Forest +id=370598 +rarity=C +[/card] +[card] +primitive=Forest +id=370729 +rarity=C +[/card] +[card] +primitive=Forest +id=370756 +rarity=C +[/card] +[card] +primitive=Forest +id=370771 +rarity=C +[/card] +[card] +primitive=Fortify +id=370712 +rarity=U +[/card] +[card] +primitive=Frost Breath +id=370678 +rarity=C +[/card] +[card] +primitive=Galerider Sliver +id=370590 +rarity=R +[/card] +[card] +primitive=Garruk, Caller of Beasts +id=370687 +rarity=M +[/card] +[card] +primitive=Garruk's Horde +id=370684 +rarity=R +[/card] +[card] +primitive=Giant Growth +id=370788 +rarity=C +[/card] +[card] +primitive=Giant Spider +id=370781 +rarity=C +[/card] +[card] +primitive=Gladecover Scout +id=370716 +rarity=C +[/card] +[card] +primitive=Glimpse the Future +id=370774 +rarity=U +[/card] +[card] +primitive=Gnawing Zombie +id=370682 +rarity=U +[/card] +[card] +primitive=Goblin Diplomats +id=370674 +rarity=R +[/card] +[card] +primitive=Goblin Shortcutter +id=370610 +rarity=C +[/card] +[card] +primitive=Griffin Sentinel +id=370792 +rarity=C +[/card] +[card] +primitive=Grim Return +id=370776 +rarity=R +[/card] +[card] +primitive=Groundshaker Sliver +id=370626 +rarity=C +[/card] +[card] +primitive=Guardian of the Ages +id=370603 +rarity=R +[/card] +[card] +primitive=Haunted Plate Mail +id=370594 +rarity=R +[/card] +[card] +primitive=Hive Stirrings +id=370817 +rarity=C +[/card] +[card] +primitive=Howl of the Night Pack +id=370718 +rarity=U +[/card] +[card] +primitive=Hunt the Weak +id=370743 +rarity=C +[/card] +[card] +primitive=Illusionary Armor +id=370701 +rarity=U +[/card] +[card] +primitive=Imposing Sovereign +id=370770 +rarity=R +[/card] +[card] +primitive=Indestructibility +id=370673 +rarity=R +[/card] +[card] +primitive=Into the Wilds +id=370579 +rarity=R +[/card] +[card] +primitive=Island +id=370608 +rarity=C +[/card] +[card] +primitive=Island +id=370611 +rarity=C +[/card] +[card] +primitive=Island +id=370647 +rarity=C +[/card] +[card] +primitive=Island +id=370773 +rarity=C +[/card] +[card] +primitive=Jace, Memory Adept +id=370728 +rarity=M +[/card] +[card] +primitive=Jace's Mindseeker +id=370638 +rarity=R +[/card] +[card] +primitive=Kalonian Hydra +id=370766 +rarity=R +[/card] +[card] +primitive=Kalonian Tusker +id=370700 +rarity=U +[/card] +[card] +primitive=Lava Axe +id=370595 +rarity= +[/card] +[card] +primitive=Lay of the Land +id=370767 +rarity=C +[/card] +[card] +primitive=Lifebane Zombie +id=370723 +rarity=R +[/card] +[card] +primitive=Lightning Talons +id=370795 +rarity=C +[/card] +[card] +primitive=Liliana of the Dark Realms +id=370658 +rarity=M +[/card] +[card] +primitive=Liliana's Reaver +id=370740 +rarity=R +[/card] +[card] +primitive=Zombie Token +id=-339967 +rarity=T +[/card] +[card] +primitive=Liturgy of Blood +id=370652 +rarity=C +[/card] +[card] +primitive=Manaweft Sliver +id=370599 +rarity=U +[/card] +[card] +primitive=Marauding Maulhorn +id=370648 +rarity=C +[/card] +[card] +primitive=Mark of the Vampire +id=370787 +rarity=C +[/card] +[card] +primitive=Master of Diversion +id=370708 +rarity=C +[/card] +[card] +primitive=Megantic Sliver +id=370794 +rarity=R +[/card] +[card] +primitive=Merfolk Spy +id=370762 +rarity=C +[/card] +[card] +primitive=Messenger Drake +id=370807 +rarity=C +[/card] +[card] +primitive=Millstone +id=370737 +rarity=U +[/card] +[card] +primitive=Mind Rot +id=370711 +rarity=C +[/card] +[card] +primitive=Mindsparker +id=370695 +rarity=R +[/card] +[card] +primitive=Minotaur Abomination +id=370683 +rarity=C +[/card] +[card] +primitive=Molten Birth +id=370604 +rarity=U +[/card] +[card] +primitive=Mountain +id=370583 +rarity=C +[/card] +[card] +primitive=Mountain +id=370588 +rarity=C +[/card] +[card] +primitive=Mountain +id=370591 +rarity=C +[/card] +[card] +primitive=Mountain +id=370725 +rarity=C +[/card] +[card] +primitive=Mutavault +id=370733 +rarity=R +[/card] +[card] +primitive=Naturalize +id=370802 +rarity=C +[/card] +[card] +primitive=Negate +id=370719 +rarity=C +[/card] +[card] +primitive=Nephalia Seakite +id=370760 +rarity=C +[/card] +[card] +primitive=Nightmare +id=370689 +rarity=R +[/card] +[card] +primitive=Nightwing Shade +id=370705 +rarity=U +[/card] +[card] +primitive=Oath of the Ancient Wood +id=370763 +rarity=R +[/card] +[card] +primitive=Ogre Battledriver +id=370662 +rarity=R +[/card] +[card] +primitive=Opportunity +id=370751 +rarity=U +[/card] +[card] +primitive=Pacifism +id=370812 +rarity=C +[/card] +[card] +primitive=Path of Bravery +id=370798 +rarity=R +[/card] +[card] +primitive=Pay No Heed +id=370742 +rarity=C +[/card] +[card] +primitive=Phantom Warrior +id=370650 +rarity=U +[/card] +[card] +primitive=Pillarfield Ox +id=370765 +rarity=C +[/card] +[card] +primitive=Pitchburn Devils +id=370649 +rarity=C +[/card] +[card] +primitive=Plains +id=370615 +rarity=C +[/card] +[card] +primitive=Plains +id=370669 +rarity=C +[/card] +[card] +primitive=Plains +id=370679 +rarity=C +[/card] +[card] +primitive=Plains +id=370754 +rarity=C +[/card] +[card] +primitive=Planar Cleansing +id=370808 +rarity=R +[/card] +[card] +primitive=Plummet +id=370601 +rarity=C +[/card] +[card] +primitive=Predatory Sliver +id=370745 +rarity=C +[/card] +[card] +primitive=Primeval Bounty +id=370656 +rarity=M +[/card] +[card] +primitive=Pyromancer's Guantlet +id=370686 +rarity=R +[/card] +[card] +primitive=Quag Sickness +id=370714 +rarity=U +[/card] +[card] +primitive=Quicken +id=370644 +rarity=R +[/card] +[card] +primitive=Ranger's Guile +id=370803 +rarity=C +[/card] +[card] +primitive=Ratchet Bomb +id=370623 +rarity=C +[/card] +[card] +primitive=Regathan Firecat +id=370805 +rarity=C +[/card] +[card] +primitive=Ring of Three Wishes +id=370580 +rarity=M +[/card] +[card] +primitive=Rise of the Dark Realms +id=370636 +rarity=M +[/card] +[card] +primitive=Rod of Ruin +id=370668 +rarity=U +[/card] +[card] +primitive=Rootwalla +id=370693 +rarity=C +[/card] +[card] +primitive=Rumbling Baloth +id=370764 +rarity=C +[/card] +[card] +primitive=Sanguine Bond +id=370671 +rarity=R +[/card] +[card] +primitive=Savage Summoning +id=370710 +rarity=R +[/card] +[card] +primitive=Scavenging Ooze +id=370629 +rarity=R +[/card] +[card] +primitive=Scourge of Valkas +id=370584 +rarity=R +[/card] +[card] +primitive=Scroll Thief +id=370651 +rarity=C +[/card] +[card] +primitive=Seacoast Drake +id=370617 +rarity=C +[/card] +[card] +primitive=Seismic Stomp +id=370713 +rarity=C +[/card] +[card] +primitive=Sengir Vampire +id=370724 +rarity=U +[/card] +[card] +primitive=Sensory Deprivation +id=370780 +rarity=C +[/card] +[card] +primitive=Sentinel Sliver +id=370813 +rarity=C +[/card] +[card] +primitive=Seraph of the Sword +id=370620 +rarity=R +[/card] +[card] +primitive=Serra Angel +id=370602 +rarity=U +[/card] +[card] +primitive=Shadowborn Apostle +id=370746 +rarity=C +[/card] +[card] +primitive=Shadowborn Demon +id=370655 +rarity=M +[/card] +[card] +primitive=Shimmering Grotto +id=370631 +rarity=C +[/card] +[card] +primitive=Shivan Dragon +id=370825 +rarity=R +[/card] +[card] +primitive=Shiv's Embrace +id=370707 +rarity=U +[/card] +[card] +primitive=Shock +id=370654 +rarity=C +[/card] +[card] +primitive=Show of Valor +id=370779 +rarity=C +[/card] +[card] +primitive=Shrivel +id=370722 +rarity=C +[/card] +[card] +primitive=Siege Mastodon +id=370704 +rarity=C +[/card] +[card] +primitive=Silence +id=370578 +rarity=R +[/card] +[card] +primitive=Sliver Construct +id=370643 +rarity=C +[/card] +[card] +primitive=Smelt +id=370784 +rarity=C +[/card] +[card] +primitive=Solemn Offering +id=370730 +rarity=C +[/card] +[card] +primitive=Soulmender +id=370587 +rarity=C +[/card] +[card] +primitive=Spell Blast +id=370645 +rarity=U +[/card] +[card] +primitive=Sporemound +id=370605 +rarity=C +[/card] +[card] +primitive=Staff of the Death Magus +id=370586 +rarity=U +[/card] +[card] +primitive=Staff of the Flame Magus +id=370625 +rarity=U +[/card] +[card] +primitive=Staff of the Mind Magus +id=370676 +[/card] +[card] +primitive=Staff of the Wild Magus +id=370592 +rarity=U +[/card] +[card] +primitive=Staff of the Sun Magus +id=370635 +rarity=U +[/card] +[card] +primitive=Steelform Sliver +id=370597 +rarity=U +[/card] +[card] +primitive=Stonehorn Chanter +id=370777 +rarity=U +[/card] +[card] +primitive=Striking Sliver +id=370589 +rarity=C +[/card] +[card] +primitive=Strionic Resonator +id=370670 +rarity=R +[/card] +[card] +primitive=Suntail Hawk +id=370720 +rarity=C +[/card] +[card] +primitive=Swamp +id=370703 +rarity=C +[/card] +[card] +primitive=Swamp +id=370727 +rarity=C +[/card] +[card] +primitive=Swamp +id=370731 +rarity=C +[/card] +[card] +primitive=Swamp +id=370785 +rarity=C +[/card] +[card] +primitive=Syphon Sliver +id=370752 +rarity=R +[/card] +[card] +primitive=Tenacious Dead +id=370606 +rarity=U +[/card] +[card] +primitive=Thorncaster Sliver +id=370820 +rarity=R +[/card] +[card] +primitive=Thunder Strike +id=370607 +rarity=U +[/card] +[card] +primitive=Tidebinder Mage +id=370736 +rarity=R +[/card] +[card] +primitive=Time Ebb +id=370641 +rarity=R +[/card] +[card] +primitive=Tome Scour +id=370706 +rarity=C +[/card] +[card] +primitive=Trading Post +id=370646 +rarity=R +[/card] +[card] +primitive=Trained Condor +id=370692 +rarity=C +[/card] +[card] +primitive=Traumatize +id=370663 +rarity=R +[/card] +[card] +primitive=Trollhide +id=370664 +rarity=C +[/card] +[card] +primitive=Undead Minotaur +id=370702 +rarity=C +[/card] +[card] +primitive=Vampire Warlord +id=370709 +rarity=U +[/card] +[card] +primitive=Vastwood Hydra +id=370749 +rarity=R +[/card] +[card] +primitive=Verdant Haven +id=370657 +rarity=C +[/card] +[card] +primitive=Vial of Poison +id=370640 +rarity=U +[/card] +[card] +primitive=Vile Rebirth +id=370799 +rarity=C +[/card] +[card] +primitive=Volcanic Geyser +id=370614 +rarity=U +[/card] +[card] +primitive=Voracious Wurm +id=370814 +rarity=U +[/card] +[card] +primitive=Wall of Frost +id=370690 +rarity=U +[/card] +[card] +primitive=Wall of Swords +id=370697 +rarity=U +[/card] +[card] +primitive=Warden of Evos Isle +id=370815 +rarity=U +[/card] +[card] +primitive=Water Servant +id=370809 +rarity=U +[/card] +[card] +primitive=Wild Guess +id=370791 +rarity=C +[/card] +[card] +primitive=Wild Ricochet +id=370790 +rarity=R +[/card] +[card] +primitive=Windreader Sphinx +id=370810 +rarity=U +[/card] +[card] +primitive=Windstorm +id=370628 +rarity=U +[/card] +[card] +primitive=Witchstalker +id=370806 +rarity=R +[/card] +[card] +primitive=Woodborn Behemoth +id=370665 +rarity=U +[/card] +[card] +primitive=Wring Flesh +id=370759 +rarity=C +[/card] +[card] +primitive=Xathrid Necromancer +id=370619 +rarity=R +[/card] +[card] +primitive=Zombie Token +id=-339968 +rarity=T +[/card] +[card] +primitive=Young Pyromancer +id=370600 +rarity=U +[/card] +[card] +primitive=Zephyr Charge +id=370672 +rarity=C +[/card] diff --git a/projects/mtg/bin/Res/sets/primitives/mtg.txt b/projects/mtg/bin/Res/sets/primitives/mtg.txt index f07510b44..de89aceea 100644 --- a/projects/mtg/bin/Res/sets/primitives/mtg.txt +++ b/projects/mtg/bin/Res/sets/primitives/mtg.txt @@ -28204,7 +28204,7 @@ subtype=Equipment [card] name=Executioner's Swing text=Target creature that dealt damage this turn gets -5/-5 until end of turn. -target=creature[damaged] +target=creature[damager] auto=-5/-5 ueot mana={W}{B} type=Instant @@ -31457,7 +31457,7 @@ toughness=2 [/card] [card] name=Flourishing Defenses -auto=@counteradded(-1/-1) from(creature|mybattlefield):may token(Elf Warrior,Creature elf warrior,1/1,green) +auto=@counteradded(-1/-1) from(creature):may token(Elf Warrior,Creature elf warrior,1/1,green) text=Whenever a -1/-1 counter is placed on a creature, you may put a 1/1 green Elf Warrior creature token onto the battlefield. mana={4}{G} type=Enchantment @@ -37166,7 +37166,7 @@ type=Sorcery [/card] [card] name=Grave Pact -auto=@movedTo(creature|mygraveyard) from(mybattlefield):ability$!name(sacrifice) notatarget(creature|mybattlefield) sacrifice!$ opponent +auto=@movedTo(creature|graveyard) from(mybattlefield):ability$!name(sacrifice) notatarget(creature|mybattlefield) sacrifice!$ opponent text=Whenever a creature you control dies, each other player sacrifices a creature. mana={1}{B}{B}{B} type=Enchantment @@ -73586,7 +73586,7 @@ toughness=6 ###The 2 cards below should stay together (Flip Card)### [card] name=Rune-Tail, Kitsune Ascendant -auto=this(controllerlife >30) all(this) flip(Rune-Tail's Essence) +auto=this(controllerlife > 29) transforms((,newability[flip(Rune-Tail's Essence)])) text=When you have 30 or more life, flip Rune-Tail, Kitsune Ascendant. mana={2}{W} type=Legendary Creature @@ -78444,11 +78444,7 @@ toughness=2 [/card] [card] name=Shifting Sky -auto=choice name(choose white) all(this) transforms((,newability[lord(*[-land]) becomes(,white)])) forever -auto=choice name(choose blue) all(this) transforms((,newability[lord(*[-land]) becomes(,blue)])) forever -auto=choice name(choose black) all(this) transforms((,newability[lord(*[-land]) becomes(,black)])) forever -auto=choice name(choose red) all(this) transforms((,newability[lord(*[-land]) becomes(,red)])) forever -auto=choice name(choose green) all(this) transforms((,newability[lord(*[-land]) becomes(,green)])) forever +auto=chooseacolor lord(*[-land]) becomes(,chosencolor) chooseend text=As Shifting Sky enters the battlefield, choose a color. -- All nonland permanents are the chosen color. mana={2}{U} type=Enchantment @@ -104302,4 +104298,4 @@ type=Land Creature subtype=Forest Dryad power=1 toughness=1 -[/card] \ No newline at end of file +[/card] diff --git a/projects/mtg/bin/Res/test/_tests.txt b/projects/mtg/bin/Res/test/_tests.txt index 3e351b82e..53bb5f826 100644 --- a/projects/mtg/bin/Res/test/_tests.txt +++ b/projects/mtg/bin/Res/test/_tests.txt @@ -204,6 +204,7 @@ brass_man.txt brass_man_i161.txt briarhorn.txt bringer_of_the_red_dawn.txt +buyback.txt cage_of_hands.txt Call_to_Heel_1.txt Call_to_Heel_2.txt @@ -308,6 +309,9 @@ evil_presence3.txt evil_presence_i647.txt evil_presence_i647_2.txt exaltedsourcekilled.txt +executioners_swing.txt +executioners_swing2.txt +executioners_swing3.txt explore.txt Faceless_Butcher.txt fading.txt diff --git a/projects/mtg/bin/Res/test/buyback.txt b/projects/mtg/bin/Res/test/buyback.txt new file mode 100644 index 000000000..ca655e5d5 --- /dev/null +++ b/projects/mtg/bin/Res/test/buyback.txt @@ -0,0 +1,30 @@ +# Cast card once with buyback and second time without. +# The card must be in the graveyard, not in the hand +[INIT] +FIRSTMAIN + +[PLAYER1] +hand:Capsize +manapool:{5}{U}{U}{U}{U} + +[PLAYER2] +inplay:Swamp,Island + +[DO] +Capsize +# pay buyback +choice 1 +Swamp +Capsize +Island + +[ASSERT] +FIRSTMAIN + +[PLAYER1] +graveyard:Capsize + +[PLAYER2] +hand:Swamp,Island + +[END] diff --git a/projects/mtg/bin/Res/test/executioners_swing.txt b/projects/mtg/bin/Res/test/executioners_swing.txt new file mode 100644 index 000000000..baabe2c48 --- /dev/null +++ b/projects/mtg/bin/Res/test/executioners_swing.txt @@ -0,0 +1,42 @@ +#NAME: Executioner's Swing +#DESC: Checks targetability +#DESC: Test that can target creature that damaged creature this turn + +[INIT] +combatattackers + +[PLAYER1] +inplay:Grizzly Bears + +[PLAYER2] +inplay:Flying Men,Swamp,Plains +hand:Executioner's Swing + +[DO] +Grizzly Bears +next +Flying Men +next +next +next + +# second main +# kill bear +yes +Swamp +Plains +Executioner's Swing +Grizzly Bears +endinterruption + +[ASSERT] +secondmain + +[PLAYER1] +graveyard:Grizzly Bears + +[PLAYER2] +graveyard:Executioner's Swing,Flying Men +inplay:Plains,Swamp + +[END] diff --git a/projects/mtg/bin/Res/test/executioners_swing2.txt b/projects/mtg/bin/Res/test/executioners_swing2.txt new file mode 100644 index 000000000..cb484e8d7 --- /dev/null +++ b/projects/mtg/bin/Res/test/executioners_swing2.txt @@ -0,0 +1,42 @@ +#NAME: Executioner's Swing +#DESC: Checks targetability +#DESC: Test that can target creature that damaged player + +[INIT] +combatattackers + +[PLAYER1] +inplay:Grizzly Bears + +[PLAYER2] +inplay:Swamp,Plains +hand:Executioner's Swing + +[DO] +Grizzly Bears +next +next +next +next + +# second main +# kill bear +yes +Swamp +Plains +Executioner's Swing +Grizzly Bears +endinterruption + +[ASSERT] +secondmain + +[PLAYER1] +graveyard:Grizzly Bears + +[PLAYER2] +graveyard:Executioner's Swing +inplay:Plains,Swamp +life:18 + +[END] diff --git a/projects/mtg/bin/Res/test/executioners_swing3.txt b/projects/mtg/bin/Res/test/executioners_swing3.txt new file mode 100644 index 000000000..433164fed --- /dev/null +++ b/projects/mtg/bin/Res/test/executioners_swing3.txt @@ -0,0 +1,34 @@ +#NAME: Executioner's Swing +#DESC: Checks targetability +#DESC: Prove that can't target passive creature + +[INIT] +secondmain + +[PLAYER1] +inplay:Grizzly Bears + +[PLAYER2] +manapool:{B}{W} +hand:Executioner's Swing + +[DO] +# attempt to kill bear +yes +Swamp +Plains +Executioner's Swing +Grizzly Bears +endinterruption + +[ASSERT] +secondmain + +[PLAYER1] +inplay:Grizzly Bears + +[PLAYER2] +hand:Executioner's Swing +manapool:{W}{B} + +[END] diff --git a/projects/mtg/bin/createWindowsZip.py b/projects/mtg/bin/createWindowsZip.py new file mode 100644 index 000000000..8b2e7e4d9 --- /dev/null +++ b/projects/mtg/bin/createWindowsZip.py @@ -0,0 +1,73 @@ +import sys +import os +import zipfile +from pyjavaproperties import Properties +from optparse import OptionParser + +def createWindowsZipFile(filename): + utilities = ZipUtilities() + zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED) + zip_file.write('../../../LICENSE') + zip_file.write('libpng13.dll') + zip_file.write('SDL.dll') + zip_file.write('fmod.dll') + zip_file.write('zlib1.dll') + zip_file.write('Wagic.exe') + zip_file.write('Res/' + getFilename('core') + '.zip') + zip_file.close() + +def getFilename(filename): + p = Properties(); + p.load(open('../build.number.properties')); + minor = p['build.minor']; + major = p['build.major']; + point = p['build.point']; + filename = filename + '-' + major + minor + point + return filename + +def createStandardResFile(): + print "Creating Resource File" + cmd = 'python createResourceZip.py -n ' + getFilename('core') + '.zip' + os.chdir("Res") + os.system(cmd) + os.chdir("..") + print "Creating Windows Package File" + filename = 'Wagic-windows.zip' + createWindowsZipFile( filename ) + print >> sys.stderr, 'Created Windows Package: {0}'.format( filename) + +class ZipUtilities: + + def toZip(self, file, filename): + zip_file = zipfile.ZipFile(filename, 'w') + if os.path.isfile(file): + zip_file.write(file) + else: + self.addFolderToZip(zip_file, file) + zip_file.close() + + def addFolderToZip(self, zip_file, folder): + zip_file.writestr(folder + '/', '') + for file in os.listdir(folder): + if file != '.svn': + full_path = os.path.join(folder, file) + if os.path.isfile(full_path): + print 'File added: ' + str(full_path) + zip_file.write(full_path) + elif os.path.isdir(full_path): + print 'Entering folder: ' + str(full_path) + self.addFolderToZip(zip_file, full_path) + + +def main(): +## using optparse instead of argParse for now since python 2.7 may not be installed. + + parser = OptionParser() + parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform") + + (options, args) = parser.parse_args() + + createStandardResFile() + +if __name__ == "__main__": + main() diff --git a/projects/mtg/build.xml b/projects/mtg/build.xml index b568ca50a..81210aa41 100644 --- a/projects/mtg/build.xml +++ b/projects/mtg/build.xml @@ -3,7 +3,7 @@ - + @@ -90,7 +90,9 @@ Author: Michael Nguyen #define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR) #define WAGIC_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION) #define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) -#define WAGIC_RESOURCE_NAME WAGIC_CORE_VERSION_STRING ".zip" +#define WAGIC_RESOURCE_NAME "Wagic-core.zip" +#define WAGIC_RELEASE_NAME "${env.RELEASE_NAME}" +#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME #endif diff --git a/projects/mtg/include/ActionStack.h b/projects/mtg/include/ActionStack.h index 06e7f2afe..7a3bdde16 100644 --- a/projects/mtg/include/ActionStack.h +++ b/projects/mtg/include/ActionStack.h @@ -72,7 +72,7 @@ public: } Interruptible(GameObserver* observer, int inID = 0, bool hasFocus = false) - : PlayGuiObject(40, x, y, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL) + : PlayGuiObject(40, 0.0f, 0.0f, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL) { } diff --git a/projects/mtg/include/CardDescriptor.h b/projects/mtg/include/CardDescriptor.h index 704e3d55f..fbe58f4db 100644 --- a/projects/mtg/include/CardDescriptor.h +++ b/projects/mtg/include/CardDescriptor.h @@ -64,6 +64,7 @@ class CardDescriptor: public MTGCardInstance string compareName; int CDopponentDamaged; int CDcontrollerDamaged; + int CDdamager; }; #endif diff --git a/projects/mtg/include/Effects.h b/projects/mtg/include/Effects.h deleted file mode 100644 index 248e22a3c..000000000 --- a/projects/mtg/include/Effects.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _EFFECTS_H_ -#define _EFFECTS_H_ - -#include - -class Effect: public JGuiObject -{ - static int id_counter; -public: - Effect() : JGuiObject(++id_counter) {}; -}; - -#endif // _EFFECTS_H_ diff --git a/projects/mtg/include/GameStateAwards.h b/projects/mtg/include/GameStateAwards.h index cb614895c..64cc741a6 100644 --- a/projects/mtg/include/GameStateAwards.h +++ b/projects/mtg/include/GameStateAwards.h @@ -17,7 +17,6 @@ private: WSrcCards * setSrc; SimpleMenu * menu; bool showMenu; - bool showAlt; bool saveMe; int mState; int mDetailItem; diff --git a/projects/mtg/include/GuiPlay.h b/projects/mtg/include/GuiPlay.h index 4eadc959a..c900b30ba 100644 --- a/projects/mtg/include/GuiPlay.h +++ b/projects/mtg/include/GuiPlay.h @@ -47,7 +47,6 @@ protected: { static const float HEIGHT; unsigned attackers; - unsigned blockers; unsigned currentAttacker; float height; diff --git a/projects/mtg/include/MTGCardInstance.h b/projects/mtg/include/MTGCardInstance.h index ab708e5db..82053bcf1 100644 --- a/projects/mtg/include/MTGCardInstance.h +++ b/projects/mtg/include/MTGCardInstance.h @@ -65,6 +65,7 @@ public: bool wasDealtDamage; bool damageToOpponent; bool damageToController; + bool damageToCreature; bool mPropertiesChangedSinceLastUpdate; int reduxamount; int flanked; diff --git a/projects/mtg/include/PlayGuiObject.h b/projects/mtg/include/PlayGuiObject.h index 5855c2884..c09d1a4c8 100644 --- a/projects/mtg/include/PlayGuiObject.h +++ b/projects/mtg/include/PlayGuiObject.h @@ -12,7 +12,6 @@ #define GUI_OPPONENTHAND 5 #include -#include "Effects.h" #include "WEvent.h" #include "Pos.h" @@ -65,7 +64,6 @@ public: } ; virtual ~PlayGuiObject() {}; - vector effects; }; #endif diff --git a/projects/mtg/include/SimplePopup.h b/projects/mtg/include/SimplePopup.h index 154710e92..d61d7cc47 100644 --- a/projects/mtg/include/SimplePopup.h +++ b/projects/mtg/include/SimplePopup.h @@ -20,7 +20,6 @@ class SimplePopup: public JGuiController private: float mWidth, mX, mY; int mMaxLines; - int mFontId; DeckMetaData * mDeckInformation; string mTitle; WFont *mTextFont; diff --git a/projects/mtg/include/WResource_Fwd.h b/projects/mtg/include/WResource_Fwd.h index 9c185ee11..0dc0b11f6 100644 --- a/projects/mtg/include/WResource_Fwd.h +++ b/projects/mtg/include/WResource_Fwd.h @@ -1,12 +1,12 @@ -#ifndef WRESOURCE_FWD_H -#define WRESOURCE_FWD_H - -#if !defined(WP8) && !(defined(SDL_CONFIG) && defined(__MINGW32__)) -#include -typedef boost::shared_ptr JQuadPtr; -#else -#include -typedef std::shared_ptr JQuadPtr; -#endif - -#endif +#ifndef WRESOURCE_FWD_H +#define WRESOURCE_FWD_H + +#if (_MSC_VER >= 1700) || (__cplusplus > 199711L) +#include +typedef std::shared_ptr JQuadPtr; +#else +#include +typedef boost::shared_ptr JQuadPtr; +#endif + +#endif diff --git a/projects/mtg/include/config.h b/projects/mtg/include/config.h index ada8c7add..55dcb0e91 100644 --- a/projects/mtg/include/config.h +++ b/projects/mtg/include/config.h @@ -1,7 +1,7 @@ #ifndef _DEBUG_H_ #define _DEBUG_H_ -#if ((defined WIN32) || (defined WP8)) +#if ((defined WIN32) || (defined WP8)) && !defined(__MINGW32__) #define snprintf sprintf_s #endif diff --git a/projects/mtg/src/AIHints.cpp b/projects/mtg/src/AIHints.cpp index c8dae463f..0482a77d7 100644 --- a/projects/mtg/src/AIHints.cpp +++ b/projects/mtg/src/AIHints.cpp @@ -314,7 +314,7 @@ bool AIHints::canWeCombo(GameObserver* observer,MTGCardInstance * card,AIPlayerB int comboPartsRestriction = 0; if(gotCombo) - return gotCombo;//because more then one might be possible at any time. + return gotCombo;//because more than one might be possible at any time. if (hints[i]->hold.size()) { for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++) diff --git a/projects/mtg/src/AIPlayerBaka.cpp b/projects/mtg/src/AIPlayerBaka.cpp index 3368812d0..b126eb040 100644 --- a/projects/mtg/src/AIPlayerBaka.cpp +++ b/projects/mtg/src/AIPlayerBaka.cpp @@ -445,7 +445,7 @@ int OrderedAIAction::getEfficiency() } if ((drawer->getNumCards() >= p->game->library->nb_cards && (Targetable*)p == drawer->getTarget()) || (p->game->hand->nb_cards > 10 && (Targetable*)p == drawer->getTarget())) { - //if the amount im drawing will mill me to death or i have more then 10 cards in hand, eff is 0; + //if the amount im drawing will mill me to death or i have more than 10 cards in hand, eff is 0; efficiency = 0; } break; @@ -853,7 +853,7 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target) if (card == target) used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76 if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost() == 1) - {//ai can't use cards which produce more then 1 converted while using the old pMana method. + {//ai can't use cards which produce more than 1 converted while using the old pMana method. result->add(amp->output); used[card] = true; } diff --git a/projects/mtg/src/AllAbilities.cpp b/projects/mtg/src/AllAbilities.cpp index adb9d2862..26cd01faa 100644 --- a/projects/mtg/src/AllAbilities.cpp +++ b/projects/mtg/src/AllAbilities.cpp @@ -1994,28 +1994,23 @@ int AADynamic::resolve() break; case DYNAMIC_ABILITY_WHO_ITSELF: source = ((MTGCardInstance *) _target); - _target = _target; break; case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER: - _target = _target; secondaryTarget = ((MTGCardInstance *) _target)->controller(); break; case DYNAMIC_ABILITY_WHO_TARGETOPPONENT: - _target = _target; secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent(); break; case DYNAMIC_ABILITY_WHO_TOSOURCE: tosrc = true; break; case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER: - _target = _target; secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller(); break; case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT: secondaryTarget = OriginalSrc->controller()->opponent(); break; default: - _target = _target; break; } if(amountsource == DYNAMIC_MYSELF_AMOUNT) @@ -4728,14 +4723,15 @@ void AVanishing::Update(float dt) int AVanishing::resolve() { - return 1; } const string AVanishing::getMenuText() { -if(counterName.find("fade") != string::npos) -return "Fading"; + if (counterName.find("fade") != string::npos) + { + return "Fading"; + } return "Vanishing"; } @@ -5708,7 +5704,8 @@ void ATutorialMessage::Update(float dt) mElapsed += dt; - IconButtonsController::Update(dt); + if(!mUserCloseRequest) + IconButtonsController::Update(dt); if (mIsImage) return; diff --git a/projects/mtg/src/CardDescriptor.cpp b/projects/mtg/src/CardDescriptor.cpp index f304e356d..c6ae1e7a7 100644 --- a/projects/mtg/src/CardDescriptor.cpp +++ b/projects/mtg/src/CardDescriptor.cpp @@ -23,6 +23,7 @@ CardDescriptor::CardDescriptor() colorComparisonMode = COMPARISON_NONE; CDopponentDamaged = 0; CDcontrollerDamaged = 0; + CDdamager = 0; } int CardDescriptor::init() @@ -226,16 +227,27 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card) { match = NULL; } - if(CDopponentDamaged == -1 || CDopponentDamaged == 1) - { - Player * p = card->controller()->opponent();//controller()->opponent(); - if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p) || (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p) - || (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent()) || (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent())) + + if ((CDdamager == -1 && (card->damageToOpponent || card->damageToController || card->damageToCreature)) + || (CDdamager == 1 && !(card->damageToOpponent || card->damageToController || card->damageToCreature))) { match = NULL; } - if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p) || (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p) - || (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent()) || (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent())) + + if(CDopponentDamaged == -1 || CDopponentDamaged == 1) + { + Player * p = card->controller()->opponent();//controller()->opponent(); + if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p) + || (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p) + || (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent()) + || (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent())) + { + match = NULL; + } + if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p) + || (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p) + || (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent()) + || (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent())) { match = NULL; } diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 859a6d936..0b5b9d44a 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -1224,6 +1224,18 @@ bool CardGui::FilterCard(MTGCard * _card,string filter) cd.CDcontrollerDamaged = 1; } } + //creature dealt damage to anything + else if (attribute.find("damager") != string::npos) + { + if (minus) + { + cd.CDdamager = -1; + } + else + { + cd.CDdamager = 1; + } + } else if (attribute.find("multicolor") != string::npos) { //card is multicolored? diff --git a/projects/mtg/src/Credits.cpp b/projects/mtg/src/Credits.cpp index 1e07fcb49..64c4a609e 100644 --- a/projects/mtg/src/Credits.cpp +++ b/projects/mtg/src/Credits.cpp @@ -386,7 +386,7 @@ void Credits::computeTournament(GameObserver* g, GameApp * _app,bool tournament, } if (mGamesWon>mGamesPlayed*0.80 && mGamesWondealDamage(damage); target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount - if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE) + if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE){ ((MTGCardInstance*)target)->wasDealtDamage = true; + ((MTGCardInstance*)source)->damageToCreature = true; + } if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER) { if(target == source->controller()) diff --git a/projects/mtg/src/Effects.cpp b/projects/mtg/src/Effects.cpp deleted file mode 100644 index 50056df0d..000000000 --- a/projects/mtg/src/Effects.cpp +++ /dev/null @@ -1,3 +0,0 @@ -#include "../include/Effects.h" - -int Effect::id_counter = 0; diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index ed01c26d5..80fb9a0f4 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -795,6 +795,7 @@ void GameObserver::gameStateBasedEffects() c->wasDealtDamage = false; c->damageToController = false; c->damageToOpponent = false; + c->damageToCreature = false; c->isAttacking = NULL; } for (int t = 0; t < nbcards; t++) diff --git a/projects/mtg/src/GameStateDuel.cpp b/projects/mtg/src/GameStateDuel.cpp index 878415184..b93b31b53 100644 --- a/projects/mtg/src/GameStateDuel.cpp +++ b/projects/mtg/src/GameStateDuel.cpp @@ -796,7 +796,7 @@ void GameStateDuel::Update(float dt) if (game->didWin()) { - //the following section will be called only in a classic or demo gamemode and if a tournament or match with more then one game is activ + //the following section will be called only in a classic or demo gamemode and if a tournament or match with more than one game is activ if ( (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&& mParent->players[1] == PLAYER_TYPE_CPU && (tournament->isTournament() || tournament->getGamesToPlay()>1 )) { setGamePhase(DUEL_STATE_SHOW_SCORE); diff --git a/projects/mtg/src/GameStateOptions.cpp b/projects/mtg/src/GameStateOptions.cpp index 981eee505..16decd052 100644 --- a/projects/mtg/src/GameStateOptions.cpp +++ b/projects/mtg/src/GameStateOptions.cpp @@ -215,34 +215,39 @@ void GameStateOptions::Render() const char * const CreditsText[] = { "Wagic, The Homebrew?! by Wololo", "", - "updates, new cards, and more on http://wololo.net/wagic", + "Updates, new cards, and more on http://wololo.net/wagic", "Many thanks to the people who help this project", "", "", - "Art: Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha", + "Art:", + "Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha", "Check themeinfo.txt for the full credits of each theme!", "", "Dev Team:", - "Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat,", - "J, Jeck, kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen,", - "Psyringe, Salmelo, Superhiro, Wololo, Yeshua, Zethfox", + "Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat, J, Jeck,", + "kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen, Psyringe,", + "Rolzad73, Salmelo, Superhiro, Wololo, Yeshua, Zethfox", "", "Music by Celestial Aeon Project, http://www.jamendo.com", "", - "Deck Builders: Abrasax, AzureKnight, colarchon", - "Excessum, Hehotfarv, Jeremy, Jog1118, JonyAS", - "Lachaux, Link17, Muddobbers, Nakano, Niegen", - "Kaioshin, Psyringe, r1c47, Superhiro, Szei", - "Thanatos02, Whismer, Wololo", + "Deck Builders:", + "Abrasax, AzureKnight, colarchon, Excessum, Hehotfarv,", + "Jeremy, Jog1118, JonyAS, Lachaux, Link17, Muddobbers,", + "Nakano, Niegen, Kaioshin, Psyringe, r1c47, Superhiro,", + "Szei, Thanatos02, Whismer, Wololo", "", "Thanks also go to Dr.Watson, Orine, Raphael, Sakya, Tyranid", "for their help.", "", "Thanks to everyone who contributes code/content on the forums!", "", - "Developed with the JGE++ Library (http://code.google.com/p/wagic)", + "", + "Source:", + "http://code.google.com/p/wagic (2009-2013)", + "https://github.com/WagicProject/wagic (2013- )", + "", + "Developed with the JGE++ Library", "SFX From www.soundsnap.com", - "", "", "This work is not related to or endorsed by Wizards of the Coast, Inc", diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index 183bd581f..0ab99501d 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -103,7 +103,7 @@ inline float GuiPlay::VertStack::nextX() } GuiPlay::BattleField::BattleField() : - attackers(0), blockers(0), height(0.0), red(0), colorFlow(0) + attackers(0), height(0.0), red(0), colorFlow(0) { } const float GuiPlay::BattleField::HEIGHT = 80.0f; diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 4d9cd985c..a4ad3f5e2 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -4276,8 +4276,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell) if (card->hasType(Subtypes::TYPE_INSTANT) || card->hasType(Subtypes::TYPE_SORCERY)) { MTGPlayerCards * zones = card->owner->game; - if(card->getCurrentZone()) - card->currentZone->owner->game;//grab it from where ever it is. MTGPlayerCards * Endzones = card->owner->game;//put them in thier owners respective zones as per rules. if (card->basicAbilities[(int)Constants::EXILEDEATH]) { @@ -4286,6 +4284,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell) } else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] > 0) { + card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] = 0; zones->putInZone(card, zones->stack, Endzones->hand); } else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_FLASHBACK] > 0) diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index e70320ae4..b957afa0c 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -158,6 +158,7 @@ void MTGCardInstance::initMTGCI() auras = 0; damageToOpponent = false; damageToController = false; + damageToCreature = false; wasDealtDamage = false; isDualWielding = false; suspended = false; diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index c804a2ed5..0c6e9ec10 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -146,7 +146,7 @@ int MTGEventBonus::receiveEvent(WEvent * event) } //////bonus for having a LOT of specific type. //not else'd becuase it is possible for a card to contain - //more then one of the types, and for more then one to trigger. + //more than one of the types, and for more than one to trigger. if(e->card->hasType(Subtypes::TYPE_ARTIFACT)) toys[currentPlayer->getId()]++; if(e->card->isCreature()) diff --git a/projects/mtg/src/PlayGuiObject.cpp b/projects/mtg/src/PlayGuiObject.cpp index 5d84ca3a8..56069802a 100644 --- a/projects/mtg/src/PlayGuiObject.cpp +++ b/projects/mtg/src/PlayGuiObject.cpp @@ -38,13 +38,9 @@ void PlayGuiObject::Update(float dt) if (mHeight < defaultHeight) mHeight = defaultHeight; } wave = (wave + 2 * (int) (100 * dt)) % 255; - for (vector::iterator it = effects.begin(); it != effects.end(); ++it) - (*it)->Update(dt); Pos::Update(dt); } void PlayGuiObject::Render() { - for (vector::iterator it = effects.begin(); it != effects.end(); ++it) - (*it)->Render(); } diff --git a/projects/mtg/src/SimplePopup.cpp b/projects/mtg/src/SimplePopup.cpp index b994d9c61..e8cccf5e4 100644 --- a/projects/mtg/src/SimplePopup.cpp +++ b/projects/mtg/src/SimplePopup.cpp @@ -15,7 +15,7 @@ #include SimplePopup::SimplePopup(int id, JGuiListener* listener, const int fontId, const char * _title, DeckMetaData* deckMetaData, MTGAllCards * collection, float cancelX, float cancelY) : - JGuiController(JGE::GetInstance(), id, listener), mFontId(fontId), mCollection(collection) + JGuiController(JGE::GetInstance(), id, listener), mCollection(collection) { mX = 19; mY = 66; diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index 2e73f23e4..e69f29702 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -485,6 +485,18 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta cd->CDcontrollerDamaged = 1; } } + //creature dealt damage to anything + else if (attribute.find("damager") != string::npos) + { + if (minus) + { + cd->CDdamager = -1; + } + else + { + cd->CDdamager = 1; + } + } else if (attribute.find("multicolor") != string::npos) { //card is multicolored? diff --git a/projects/mtg/template.vcxproj b/projects/mtg/template.vcxproj index 912ece289..16e66111e 100644 --- a/projects/mtg/template.vcxproj +++ b/projects/mtg/template.vcxproj @@ -493,7 +493,6 @@ - @@ -592,4 +591,4 @@ - \ No newline at end of file + diff --git a/projects/mtg/template.vcxproj.filters b/projects/mtg/template.vcxproj.filters index 0e2cdef9e..263d9ab9e 100644 --- a/projects/mtg/template.vcxproj.filters +++ b/projects/mtg/template.vcxproj.filters @@ -417,9 +417,6 @@ inc - - inc - inc @@ -725,4 +722,4 @@ res - \ No newline at end of file + diff --git a/projects/mtg/wagic-qt.pro b/projects/mtg/wagic-qt.pro index 42093f729..97232669b 100644 --- a/projects/mtg/wagic-qt.pro +++ b/projects/mtg/wagic-qt.pro @@ -5,7 +5,7 @@ addExclusiveBuilds(graphics, Graphics, console, Console) INCLUDEPATH += ../../JGE/include/qt CONFIG(console, graphics|console){ - QT += core network + QT += core network multimedia QT -= gui DEFINES += CONSOLE_CONFIG @@ -17,7 +17,7 @@ else:CONFIG(graphics, graphics|console){ folder_01.source = qml/QmlWagic folder_01.target = /usr/share DEPLOYMENTFOLDERS = folder_01 - QT += core gui opengl network + QT += core gui opengl network multimedia QT -= declarative quick qml #maemo5:DEFINES += QT_WIDGET DEFINES += QT_WIDGET @@ -46,6 +46,7 @@ CONFIG(graphics, graphics|console){ ../../JGE/src/qt/qtcorewrapper.cpp\ ../../JGE/src/Qtmain.cpp\ ../../JGE/src/JMD2Model.cpp\ + ../../JGE/src/pc/JSfx.cpp\ ../../JGE/src/pc/JGfx.cpp } else:CONFIG(console, graphics|console){ @@ -54,6 +55,7 @@ else:CONFIG(console, graphics|console){ SOURCES += \ ../../JGE/src/OutputCapturer.cpp\ + ../../JGE/src/pc/JSfx.cpp\ ../../JGE/src/JGfx-fake.cpp\ ../../JGE/src/Qtconsole.cpp\ } diff --git a/projects/mtg/wagic.pri b/projects/mtg/wagic.pri index a5f3e2a76..b9cce3c38 100644 --- a/projects/mtg/wagic.pri +++ b/projects/mtg/wagic.pri @@ -4,13 +4,14 @@ TEMPLATE = app #!macx:CONFIG += precompile_header unix|macx:QMAKE_CXXFLAGS += -Wno-unused-parameter -unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-but-set-parameter -unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-but-set-variable -unix|macx:QMAKE_CXXFLAGS += -Wno-unused-value -unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs -unix:!macx:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror +unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-but-set-parameter +unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-but-set-variable +unix|*macx*:QMAKE_CXXFLAGS += -Wno-unused-value +unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs +unix:!*macx*:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror windows:DEFINES += _CRT_SECURE_NO_WARNINGS +windows|winrt:DEFINES += NOMINMAX unix|macx:DEFINES += LINUX CONFIG(debug, debug|release) { DEFINES += _DEBUG @@ -28,10 +29,12 @@ windows{ # INCLUDEPATH += /usr/i686-w64-mingw32/sys-root/mingw/include/c++ LIBS += -L/usr/i686-w64-mingw32/sys-root/mingw/lib LIBS += -lwsock32 + DEFINES += FORCE_GL2 } *-msvc* { INCLUDEPATH += extra DEFINES += WIN32 + DEFINES += FORCE_GL2 } } macx:INCLUDEPATH += /opt/include @@ -41,9 +44,9 @@ INCLUDEPATH += ../../Boost INCLUDEPATH += include unix:!symbian:LIBS += -lz -win32:LIBS += ../../JGE/Dependencies/lib/fmodvc.lib -win32:LIBS += ../../JGE/Dependencies/lib/zlibd.lib -#PRECOMPILED_HEADER = include/PrecompiledHeader.h + +windows:LIBS += ../../JGE/Dependencies/lib/zlibd.lib +PRECOMPILED_HEADER = include/PrecompiledHeader.h #DEFINES += TRACK_OBJECT_USAGE #DEFINES += AI_CHANGE_TESTING @@ -80,7 +83,6 @@ SOURCES += \ src/DeckStats.cpp\ src/DeckView.cpp\ src/DuelLayers.cpp\ - src/Effects.cpp\ src/ExtraCost.cpp\ src/GameApp.cpp\ src/GameLauncher.cpp\ @@ -271,7 +273,6 @@ HEADERS += \ include/WResourceManager.h\ include/DuelLayers.h\ include/GuiStatic.h\ - include/Effects.h\ include/StyleManager.h\ include/WFont.h\ include/DeckManager.h\ @@ -284,6 +285,7 @@ HEADERS += \ # JGE, could probably be moved outside SOURCES += \ ../../JGE/src/corewrapper.cpp\ + ../../JGE/src/Downloader.cpp\ ../../JGE/src/Encoding.cpp\ ../../JGE/src/JAnimator.cpp\ ../../JGE/src/JApp.cpp\ @@ -303,7 +305,6 @@ SOURCES += \ ../../JGE/src/JSpline.cpp\ ../../JGE/src/JNetwork.cpp\ ../../JGE/src/pc/JSocket.cpp\ - ../../JGE/src/pc/JSfx.cpp\ ../../JGE/src/JSprite.cpp\ ../../JGE/src/Vector2D.cpp\ ../../JGE/src/tinyxml/tinystr.cpp\ @@ -322,6 +323,7 @@ SOURCES += \ HEADERS += \ ../../JGE/include/corewrapper.h\ + ../../JGE/include/Downloader.h\ ../../JGE/include/Threading.h\ ../../JGE/include/decoder_prx.h\ ../../JGE/include/DebugRoutines.h\ diff --git a/projects/mtg/wagic.xcodeproj/project.pbxproj b/projects/mtg/wagic.xcodeproj/project.pbxproj index 6f4b9057d..d951b708e 100755 --- a/projects/mtg/wagic.xcodeproj/project.pbxproj +++ b/projects/mtg/wagic.xcodeproj/project.pbxproj @@ -67,7 +67,6 @@ 12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; }; 12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; }; 12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; }; - 12059DAB14980B7300DAC43B /* CardEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F71291C60500B9016A /* CardEffect.cpp */; }; 12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; }; 12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; }; 12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; }; @@ -85,7 +84,6 @@ 12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; }; 12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; }; 12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.cpp */; }; - 12059DBD14980B7300DAC43B /* Effects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377091291C60500B9016A /* Effects.cpp */; }; 12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; }; 12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; }; 12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; }; @@ -198,7 +196,6 @@ 12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 12D095E014417D0500F69056 /* libstdc++.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4B14980B7300DAC43B /* CFNetwork.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12211EBA14934A2C00641703 /* CFNetwork.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4C14980B7300DAC43B /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 12211EB814934A1800641703 /* MobileCoreServices.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; - 12059E4D14980B7300DAC43B /* libGoogleAdMobAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED379148BAE7B00C58E83 /* libGoogleAdMobAds.a */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4E14980B7300DAC43B /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1216D632148F7411000F2295 /* libc++abi.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E4F14980B7300DAC43B /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50F148BCC1900C58E83 /* libsqlite3.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 12059E5014980B7300DAC43B /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 129654D0148A52730031100B /* iAd.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; @@ -217,7 +214,6 @@ 12059E5D14980B7300DAC43B /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50B148BCBBC00C58E83 /* MapKit.framework */; }; 12059E5E14980B7300DAC43B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED518148BF0E000C58E83 /* MediaPlayer.framework */; }; 1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1216D632148F7411000F2295 /* libc++abi.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; - 1216D634148F747D000F2295 /* libGoogleAdMobAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED379148BAE7B00C58E83 /* libGoogleAdMobAds.a */; settings = {ATTRIBUTES = (Weak, ); }; }; 12211E7914931CBB00641703 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2814931CBB00641703 /* ASIAuthenticationDialog.m */; }; 12211E7A14931CBB00641703 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2B14931CBB00641703 /* ASIDataCompressor.m */; }; 12211E7B14931CBB00641703 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2D14931CBB00641703 /* ASIDataDecompressor.m */; }; @@ -285,6 +281,9 @@ 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; }; 28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; }; + 751E1F1518FAE53E001B1E16 /* CarouselDeckView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 751E1F1218FAE53E001B1E16 /* CarouselDeckView.cpp */; }; + 751E1F1618FAE53E001B1E16 /* DeckView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 751E1F1318FAE53E001B1E16 /* DeckView.cpp */; }; + 751E1F1718FAE53E001B1E16 /* GridDeckView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 751E1F1418FAE53E001B1E16 /* GridDeckView.cpp */; }; 75D209D3181D54FD009916AC /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D1181D54FD009916AC /* Default-568h@2x.png */; }; 75D209D4181D54FD009916AC /* wagic-80x80.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D2181D54FD009916AC /* wagic-80x80.png */; }; CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */; }; @@ -307,7 +306,6 @@ CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; }; CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; }; CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; }; - CEA377611291C60500B9016A /* CardEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F71291C60500B9016A /* CardEffect.cpp */; }; CEA377621291C60500B9016A /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; }; CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; }; CEA377641291C60500B9016A /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; }; @@ -325,7 +323,6 @@ CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; }; CEA377711291C60500B9016A /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; }; CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.cpp */; }; - CEA377731291C60500B9016A /* Effects.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377091291C60500B9016A /* Effects.cpp */; }; CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; }; CEA377751291C60500B9016A /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; }; CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; }; @@ -578,6 +575,13 @@ 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; 28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 751E1F0E18FAE52D001B1E16 /* CarouselDeckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CarouselDeckView.h; sourceTree = ""; }; + 751E1F0F18FAE52D001B1E16 /* DeckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeckView.h; sourceTree = ""; }; + 751E1F1018FAE52D001B1E16 /* Easing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Easing.h; sourceTree = ""; }; + 751E1F1118FAE52D001B1E16 /* GridDeckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GridDeckView.h; sourceTree = ""; }; + 751E1F1218FAE53E001B1E16 /* CarouselDeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CarouselDeckView.cpp; sourceTree = ""; }; + 751E1F1318FAE53E001B1E16 /* DeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeckView.cpp; sourceTree = ""; }; + 751E1F1418FAE53E001B1E16 /* GridDeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GridDeckView.cpp; sourceTree = ""; }; 75D209D1181D54FD009916AC /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; 75D209D2181D54FD009916AC /* wagic-80x80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "wagic-80x80.png"; sourceTree = SOURCE_ROOT; }; 8D1107310486CEB800E47090 /* wagic-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "wagic-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = ""; }; @@ -609,7 +613,6 @@ CEA3768C1291C60500B9016A /* AllAbilities.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = AllAbilities.h; sourceTree = ""; }; CEA3768D1291C60500B9016A /* CardDescriptor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDescriptor.h; sourceTree = ""; }; CEA3768E1291C60500B9016A /* CardDisplay.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDisplay.h; sourceTree = ""; }; - CEA3768F1291C60500B9016A /* CardEffect.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardEffect.h; sourceTree = ""; }; CEA376901291C60500B9016A /* CardGui.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardGui.h; sourceTree = ""; }; CEA376911291C60500B9016A /* CardPrimitive.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardPrimitive.h; sourceTree = ""; }; CEA376921291C60500B9016A /* CardSelector.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardSelector.h; sourceTree = ""; }; @@ -627,7 +630,6 @@ CEA3769E1291C60500B9016A /* DeckMetaData.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckMetaData.h; sourceTree = ""; }; CEA3769F1291C60500B9016A /* DeckStats.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckStats.h; sourceTree = ""; }; CEA376A01291C60500B9016A /* DuelLayers.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DuelLayers.h; sourceTree = ""; }; - CEA376A11291C60500B9016A /* Effects.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Effects.h; sourceTree = ""; }; CEA376A21291C60500B9016A /* ExtraCost.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ExtraCost.h; sourceTree = ""; }; CEA376A31291C60500B9016A /* GameApp.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameApp.h; sourceTree = ""; }; CEA376A41291C60500B9016A /* GameObserver.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameObserver.h; sourceTree = ""; }; @@ -711,7 +713,6 @@ CEA376F41291C60500B9016A /* AllAbilities.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = AllAbilities.cpp; sourceTree = ""; }; CEA376F51291C60500B9016A /* CardDescriptor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDescriptor.cpp; sourceTree = ""; }; CEA376F61291C60500B9016A /* CardDisplay.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDisplay.cpp; sourceTree = ""; }; - CEA376F71291C60500B9016A /* CardEffect.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardEffect.cpp; sourceTree = ""; }; CEA376F81291C60500B9016A /* CardGui.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardGui.cpp; sourceTree = ""; }; CEA376F91291C60500B9016A /* CardPrimitive.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardPrimitive.cpp; sourceTree = ""; }; CEA376FA1291C60500B9016A /* CardSelector.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardSelector.cpp; sourceTree = ""; }; @@ -729,7 +730,6 @@ CEA377061291C60500B9016A /* DeckMetaData.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckMetaData.cpp; sourceTree = ""; }; CEA377071291C60500B9016A /* DeckStats.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckStats.cpp; sourceTree = ""; }; CEA377081291C60500B9016A /* DuelLayers.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DuelLayers.cpp; sourceTree = ""; }; - CEA377091291C60500B9016A /* Effects.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = Effects.cpp; sourceTree = ""; }; CEA3770A1291C60500B9016A /* ExtraCost.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = ExtraCost.cpp; sourceTree = ""; }; CEA3770B1291C60500B9016A /* GameApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameApp.cpp; sourceTree = ""; }; CEA3770C1291C60500B9016A /* GameLauncher.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameLauncher.cpp; sourceTree = ""; }; @@ -890,7 +890,6 @@ 12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */, 12059E4B14980B7300DAC43B /* CFNetwork.framework in Frameworks */, 12059E4C14980B7300DAC43B /* MobileCoreServices.framework in Frameworks */, - 12059E4D14980B7300DAC43B /* libGoogleAdMobAds.a in Frameworks */, 12059E4E14980B7300DAC43B /* libc++abi.dylib in Frameworks */, 12059E4F14980B7300DAC43B /* libsqlite3.dylib in Frameworks */, 12059E5014980B7300DAC43B /* iAd.framework in Frameworks */, @@ -922,7 +921,6 @@ 12D095E114417D0500F69056 /* libstdc++.dylib in Frameworks */, 12211EBB14934A2C00641703 /* CFNetwork.framework in Frameworks */, 12211EB914934A1900641703 /* MobileCoreServices.framework in Frameworks */, - 1216D634148F747D000F2295 /* libGoogleAdMobAds.a in Frameworks */, 1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */, 128ED510148BCC1900C58E83 /* libsqlite3.dylib in Frameworks */, 129654D1148A52740031100B /* iAd.framework in Frameworks */, @@ -1284,6 +1282,10 @@ CEA376851291C60500B9016A /* include */ = { isa = PBXGroup; children = ( + 751E1F0E18FAE52D001B1E16 /* CarouselDeckView.h */, + 751E1F0F18FAE52D001B1E16 /* DeckView.h */, + 751E1F1018FAE52D001B1E16 /* Easing.h */, + 751E1F1118FAE52D001B1E16 /* GridDeckView.h */, 12272FC114CD558C00192DC7 /* SimpleButton.h */, 12CCA032144A05DF00E343A0 /* AbilityParser.h */, 127694891441274D0088F6D3 /* AIPlayerBaka.h */, @@ -1306,7 +1308,6 @@ CEA3768C1291C60500B9016A /* AllAbilities.h */, CEA3768D1291C60500B9016A /* CardDescriptor.h */, CEA3768E1291C60500B9016A /* CardDisplay.h */, - CEA3768F1291C60500B9016A /* CardEffect.h */, CEA376901291C60500B9016A /* CardGui.h */, CEA376911291C60500B9016A /* CardPrimitive.h */, CEA376921291C60500B9016A /* CardSelector.h */, @@ -1324,7 +1325,6 @@ CEA3769E1291C60500B9016A /* DeckMetaData.h */, CEA3769F1291C60500B9016A /* DeckStats.h */, CEA376A01291C60500B9016A /* DuelLayers.h */, - CEA376A11291C60500B9016A /* Effects.h */, CEA376A21291C60500B9016A /* ExtraCost.h */, CEA376A31291C60500B9016A /* GameApp.h */, CEA376A41291C60500B9016A /* GameObserver.h */, @@ -1408,6 +1408,9 @@ CEA376ED1291C60500B9016A /* src */ = { isa = PBXGroup; children = ( + 751E1F1218FAE53E001B1E16 /* CarouselDeckView.cpp */, + 751E1F1318FAE53E001B1E16 /* DeckView.cpp */, + 751E1F1418FAE53E001B1E16 /* GridDeckView.cpp */, 12CCA02F144A05D100E343A0 /* AbilityParser.cpp */, 12769483144127380088F6D3 /* AIPlayerBaka.cpp */, 12769484144127380088F6D3 /* AIPlayerBakaB.cpp */, @@ -1427,7 +1430,6 @@ CEA376F41291C60500B9016A /* AllAbilities.cpp */, CEA376F51291C60500B9016A /* CardDescriptor.cpp */, CEA376F61291C60500B9016A /* CardDisplay.cpp */, - CEA376F71291C60500B9016A /* CardEffect.cpp */, CEA376F81291C60500B9016A /* CardGui.cpp */, CEA376F91291C60500B9016A /* CardPrimitive.cpp */, CEA376FA1291C60500B9016A /* CardSelector.cpp */, @@ -1445,7 +1447,6 @@ CEA377061291C60500B9016A /* DeckMetaData.cpp */, CEA377071291C60500B9016A /* DeckStats.cpp */, CEA377081291C60500B9016A /* DuelLayers.cpp */, - CEA377091291C60500B9016A /* Effects.cpp */, CEA3770A1291C60500B9016A /* ExtraCost.cpp */, CEA3770B1291C60500B9016A /* GameApp.cpp */, CEA3770C1291C60500B9016A /* GameLauncher.cpp */, @@ -1703,7 +1704,7 @@ 29B97313FDCFA39411CA2CEA /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0430; + LastUpgradeCheck = 0510; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "wagic" */; compatibilityVersion = "Xcode 3.2"; @@ -1827,7 +1828,6 @@ 12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */, 12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */, 12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */, - 12059DAB14980B7300DAC43B /* CardEffect.cpp in Sources */, 12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */, 12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */, 12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */, @@ -1845,7 +1845,6 @@ 12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */, 12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */, 12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */, - 12059DBD14980B7300DAC43B /* Effects.cpp in Sources */, 12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */, 12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */, 12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */, @@ -2009,7 +2008,6 @@ CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */, CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */, CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */, - CEA377611291C60500B9016A /* CardEffect.cpp in Sources */, CEA377621291C60500B9016A /* CardGui.cpp in Sources */, CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */, CEA377641291C60500B9016A /* CardSelector.cpp in Sources */, @@ -2027,7 +2025,6 @@ CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */, CEA377711291C60500B9016A /* DeckStats.cpp in Sources */, CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */, - CEA377731291C60500B9016A /* Effects.cpp in Sources */, CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */, CEA377751291C60500B9016A /* GameApp.cpp in Sources */, CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */, @@ -2057,6 +2054,7 @@ CEA3778F1291C60500B9016A /* ManaCostHybrid.cpp in Sources */, CEA377901291C60500B9016A /* MenuItem.cpp in Sources */, CEA377911291C60500B9016A /* MTGAbility.cpp in Sources */, + 751E1F1718FAE53E001B1E16 /* GridDeckView.cpp in Sources */, CEA377931291C60500B9016A /* MTGCard.cpp in Sources */, CEA377941291C60500B9016A /* MTGCardInstance.cpp in Sources */, CEA377951291C60500B9016A /* MTGDeck.cpp in Sources */, @@ -2095,6 +2093,7 @@ CEA377BA1291C60500B9016A /* utils.cpp in Sources */, CEA377BB1291C60500B9016A /* WCachedResource.cpp in Sources */, CEA377BC1291C60500B9016A /* WDataSrc.cpp in Sources */, + 751E1F1618FAE53E001B1E16 /* DeckView.cpp in Sources */, CEA377BD1291C60500B9016A /* WEvent.cpp in Sources */, CEA377BE1291C60500B9016A /* WFilter.cpp in Sources */, CEA377BF1291C60500B9016A /* WFont.cpp in Sources */, @@ -2104,6 +2103,7 @@ CE9A478512B514BA00C9F38A /* EAGLView.m in Sources */, CE9A478612B514BA00C9F38A /* EAGLViewController.m in Sources */, CE9A478912B514BA00C9F38A /* ES2Renderer.m in Sources */, + 751E1F1518FAE53E001B1E16 /* CarouselDeckView.cpp in Sources */, CE9A478A12B514BA00C9F38A /* main.m in Sources */, CE9A478D12B514BA00C9F38A /* wagicAppDelegate.m in Sources */, CE9E71DD1375A58600759DDC /* thread.cpp in Sources */, @@ -2152,10 +2152,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = ( - armv6, - "$(ARCHS_STANDARD_32_BIT)", - ); CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; @@ -2205,10 +2201,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - armv6, - "$(ARCHS_STANDARD_32_BIT)", - ); CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; @@ -2252,10 +2244,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = YES; - ARCHS = ( - armv6, - "$(ARCHS_STANDARD_32_BIT)", - ); CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; @@ -2291,10 +2279,7 @@ "\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"", ); "New Setting" = ""; - OTHER_LDFLAGS = ( - "-no_implicit_dylibs", - "-Wl", - ); + OTHER_LDFLAGS = "-Wl"; PRODUCT_NAME = wagic; PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; @@ -2307,10 +2292,6 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = ( - armv6, - "$(ARCHS_STANDARD_32_BIT)", - ); CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; COPY_PHASE_STRIP = YES; @@ -2339,10 +2320,7 @@ "$(inherited)", "\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"", ); - OTHER_LDFLAGS = ( - "-no_implicit_dylibs", - "-Wl", - ); + OTHER_LDFLAGS = "-Wl"; PRODUCT_NAME = wagic; PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; @@ -2354,7 +2332,6 @@ C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; CODE_SIGN_IDENTITY = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEPLOYMENT_LOCATION = NO; @@ -2365,6 +2342,11 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ../../Boost/boost; IPHONEOS_DEPLOYMENT_TARGET = 5.1; + ONLY_ACTIVE_ARCH = YES; + OTHER_CFLAGS = ( + "-DTIXML_USE_STL", + "-fno-objc-arc", + ); PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -2374,7 +2356,6 @@ C01FCF5008A954540054247B /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)"; CODE_SIGN_IDENTITY = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; GCC_C_LANGUAGE_STANDARD = c99; @@ -2382,7 +2363,10 @@ GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ../../Boost/boost; IPHONEOS_DEPLOYMENT_TARGET = 5.1; - OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; + OTHER_CFLAGS = ( + "-DNS_BLOCK_ASSERTIONS=1", + "-DTIXML_USE_STL=1", + ); PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; SDKROOT = iphoneos; diff --git a/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic-opengl1.1.xcscheme b/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic-opengl1.1.xcscheme index ff4186a80..71e41a631 100644 --- a/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic-opengl1.1.xcscheme +++ b/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic-opengl1.1.xcscheme @@ -1,6 +1,6 @@ error.txt cd ../.. +# we create resource package +cd projects/mtg/bin/Res +python createResourceZip.py +# if we let the zip here, Wagic will use it in the testsuite +# and we'll get 51 failed test cases +mv core_*.zip ../../../../core.zip +cd ../../../.. + # we're building a PSP binary here cd JGE make -j 8 @@ -18,11 +41,18 @@ cd .. cd projects/mtg mkdir objs make -j 8 -mkdir psprelease -mv EBOOT.PBP psprelease/ -mv wagic.elf psprelease/ -mv wagic.prx psprelease/ -zip psprelease.zip -r psprelease/ +mkdir WTH +mkdir WTH/Res +mv EBOOT.PBP WTH/ +mv ../../JGE/exceptionHandler/prx/exception.prx WTH/ +cp ../../core.zip WTH/Res +cd WTH/Res +unzip core.zip +rm core.zip +cd .. +chmod -R 775 Res +cd .. +zip psprelease.zip -r WTH/ cd ../.. # we're building an Android binary here @@ -34,24 +64,37 @@ ant debug -f projects/mtg/Android/build.xml # we're building a Qt version with GUI here mkdir qt-gui-build cd qt-gui-build -qmake ../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics +$QMAKE ../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics make -j 8 cd .. # let's try an Intel linux binary in debug text-mode-only -qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR +$QMAKE projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR make -j 8 -# we create resource package -cd projects/mtg/bin/Res -python createResourceZip.py -# if we let the zip here, Wagic will use it in the testsuite -# and we'll get 51 failed test cases -mv core_*.zip ../../../../core.zip -cd ../../../.. +# we're cross-compiling a Qt Windows version here, +# PATH is only set here to prevent colision + +# export PATH="$PATH:/opt/mingw32/bin" +# mkdir build +# cd build +# mkdir win-cross +# cd win-cross +# /opt/mingw32/bin/qmake ../../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics +# make -j 8 +# cd release +# cp ../../../projects/mtg/bin/fmod.dll . +# cp /opt/mingw32/bin/QtCore4.dll . +# cp /opt/mingw32/bin/QtGui4.dll . +# cp /opt/mingw32/bin/QtNetwork4.dll . +# cp /opt/mingw32/bin/QtOpenGL4.dll . +# cp ../../../projects/mtg/bin/zlib1.dll . +# cp /opt/mingw32/bin/libpng15-15.dll . +# cd .. +# zip win-cross.zip -r release/ +# cd ../.. # Now we run the testsuite (Res needs to be in the working directory) cd projects/mtg ../../wagic cd ../.. - diff --git a/upload-binaries.py b/upload-binaries.py new file mode 100644 index 000000000..01508f6d5 --- /dev/null +++ b/upload-binaries.py @@ -0,0 +1,66 @@ +import sys +import os +import zipfile +from pyjavaproperties import Properties +from optparse import OptionParser +from github3 import login + +def checkRelease(repository, remote): + release = None + for r in repository.iter_releases(): + if r.name == 'latest-master' : + release = r + for a in r.assets : + if a.name == remote : + # need to delete the old release + r.delete() + # need also to delete the tag (reference) + ref = repository.ref('tags/latest-master') + ref.delete() + release = None + + if release is None: + # now, we recreate a new one + release = repository.create_release('latest-master', 'master', 'latest-master', + 'Latest successful builds of the master branch automatically uploaded by Travis or AppVeyor CI.', + False, + True) + + return release + + +def suffixFilename(filename, build): + p = Properties(); + p.load(open('projects/mtg/build.number.properties')); + minor = p['build.minor']; + major = p['build.major']; + point = p['build.point']; + name, extension = os.path.splitext(filename) + filename = name + '-' + major + minor + point + '-' + build + extension + return filename + +def main(): + parser = OptionParser() + parser.add_option("-t", "--token", help="TOKEN: specify authentication token to use", metavar="TOKEN", dest="token") + parser.add_option("-s", "--sha", help="SHA: specify commit SHA", metavar="SHA", dest="sha") + parser.add_option("-l", "--local", help="FILE: specify local file path to upload", metavar="LOCAL", dest="local") + parser.add_option("-r", "--remote", help="NAME: specify remote asset name in the release.", metavar="REMOTE", dest="remote") + parser.add_option("-b", "--branch", help="BRANCH: specify branch of the commit", metavar="BRANCH", dest="branch") + + (options, args) = parser.parse_args() + + if (options.token and options.sha and options.local and options.remote and options.branch == 'master'): + gh = login(token = options.token) + else: + parser.print_help() + return + + repository = gh.repository('WagicProject', 'wagic') + r = checkRelease(repository, options.remote) + filename = options.remote + with open(options.local, 'rb') as fd: + r.upload_asset('application/zip', filename , fd) + + +if __name__ == "__main__": + main() diff --git a/upload-binaries.sh b/upload-binaries.sh index f688b8190..272b4771d 100755 --- a/upload-binaries.sh +++ b/upload-binaries.sh @@ -10,21 +10,89 @@ if [ "$TRAVIS_BRANCH" == "alphas" ]; then -H "Accept: application/vnd.github.manifold-preview" \ -H "Content-Type: application/zip" \ --data-binary @core.zip \ - "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core-${TRAVIS_BUILD_NUMBER}.zip" + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip" echo -e "Uploading android package\n" curl -X POST -H "Authorization: token ${GH_TOKEN}" \ -H "Accept: application/vnd.github.manifold-preview" \ -H "Content-Type: application/zip" \ --data-binary @projects/mtg/Android/bin/Wagic-debug.apk \ - "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android-${TRAVIS_BUILD_NUMBER}.apk" + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk" echo -e "Uploading PSP package\n" curl -X POST -H "Authorization: token ${GH_TOKEN}" \ -H "Accept: application/vnd.github.manifold-preview" \ -H "Content-Type: application/zip" \ --data-binary @projects/mtg/psprelease.zip \ - "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp-${TRAVIS_BUILD_NUMBER}.zip" + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip" + +# echo -e "Uploading Windows package\n" +# curl -X POST -H "Authorization: token ${GH_TOKEN}" \ +# -H "Accept: application/vnd.github.manifold-preview" \ +# -H "Content-Type: application/zip" \ +# --data-binary @build/win-cross/win-cross.zip \ +# "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip" + + echo -e "Done uploading\n" +fi +fi + +if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then +if [ "$TRAVIS_BRANCH" == "master" ]; then + + # get info about all releases + echo -e "Getting info about previous releases" + curl -X GET -H "Authorization: token ${GH_TOKEN}" \ + "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt + + # extract info only about only "latest-release" tag + cat json.txt |jq 'map(select (.tag_name == "latest-master"))' > latest.txt + + # get id of release + ID_TO_DELETE=`cat latest.txt |jq '.[0].id'` + + # delete previous release + echo -e "Deleting release number ${ID_TO_DELETE}" + curl -X DELETE -H "Authorization: token ${GH_TOKEN}" \ + "https://api.github.com/repos/WagicProject/wagic/releases/${ID_TO_DELETE}" + + # delete previous tag + curl -X DELETE -H "Authorization: token ${GH_TOKEN}" \ + "https://api.github.com/repos/WagicProject/wagic/git/refs/tags/latest-master" + + + echo -e "Creating a release\n" + curl -X POST -H "Authorization: token ${GH_TOKEN}" \ + -d '{"tag_name": "latest-master", "target_commitish": "master", "name": "master-'${TRAVIS_BUILD_NUMBER}'", "body": "Automatic release based on latest commit to master branch generated by Travis CI", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt + IDDI=`cat json.txt | jq '.id'` + + echo -e "Uploading Core resources\n" + curl -X POST -H "Authorization: token ${GH_TOKEN}" \ + -H "Accept: application/vnd.github.manifold-preview" \ + -H "Content-Type: application/zip" \ + --data-binary @core.zip \ + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip" + + echo -e "Uploading android package\n" + curl -X POST -H "Authorization: token ${GH_TOKEN}" \ + -H "Accept: application/vnd.github.manifold-preview" \ + -H "Content-Type: application/zip" \ + --data-binary @projects/mtg/Android/bin/Wagic-debug.apk \ + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk" + + echo -e "Uploading PSP package\n" + curl -X POST -H "Authorization: token ${GH_TOKEN}" \ + -H "Accept: application/vnd.github.manifold-preview" \ + -H "Content-Type: application/zip" \ + --data-binary @projects/mtg/psprelease.zip \ + "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip" + +# echo -e "Uploading Windows package\n" +# curl -X POST -H "Authorization: token ${GH_TOKEN}" \ +# -H "Accept: application/vnd.github.manifold-preview" \ +# -H "Content-Type: application/zip" \ +# --data-binary @build/win-cross/win-cross.zip \ +# "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip" echo -e "Done uploading\n" fi