Compare commits

..

15 Commits

Author SHA1 Message Date
xawotihs 14d4bede9a Linked mingw32 rcc 2013-12-31 17:45:01 +01:00
xawotihs 8636a99d0d Activates qt resources only on windows as g++ seems to crash on Travis VM. 2013-12-31 17:18:14 +01:00
xawotihs 73cdbd6b88 And again 2013-12-31 16:58:17 +01:00
xawotihs 3482afeb84 Should fix the build of the graphics versions 2013-12-31 16:08:59 +01:00
xawotihs de40146462 Something is weird with the -- in the travis build script... 2013-12-31 15:49:21 +01:00
xawotihs 94d5a85043 Tries to remove weird characters in travis build file 2013-12-31 00:08:46 +01:00
xawotihs 4811fbcc9f Activates qt resources into graphics Qt build 2013-12-30 23:41:50 +01:00
xawotihs 6fd136a211 Fixed JSfx with JMOD. 2013-12-29 18:37:26 +01:00
xawotihs d98640fc01 Fixed android JGfx compilation 2013-12-29 12:38:35 +01:00
xawotihs 685317b457 Installs psp HGE lib 2013-12-28 18:02:32 +01:00
xawotihs a9a59d7b8e Tries to build PSP HGE lib 2013-12-28 17:52:37 +01:00
xawotihs fe9ad84ee5 More PSP compilation fixes. 2013-12-28 12:15:52 +01:00
xawotihs 3f43648b22 More PSP fixes. 2013-12-28 11:44:00 +01:00
xawotihs afb4c4605b Fixed PSP cross compilation issues. 2013-12-28 01:05:53 +01:00
xawotihs fec4468aea Updated JFileSystem implementation to be compatible with Qt resources. 2013-12-28 00:38:02 +01:00
79 changed files with 961 additions and 3964 deletions
+22 -59
View File
@@ -1,68 +1,31 @@
language: cpp language: cpp
env:
global:
secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8="
matrix:
- BUILD_TYPE=PSP
- BUILD_TYPE=Android
- BUILD_TYPE=Qt
branches: branches:
except: except:
- latest-master - latest-master
before_install: before_install:
- sudo apt-get update -qq - export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
# Building for PSP here - export PSPSDK="$PSPDEV/psp/sdk"
- if [ "$BUILD_TYPE" == "PSP" ]; then - export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" && - export ANDROID="android-sdk-linux/tools/android"
export PSPSDK="$PSPDEV/psp/sdk" &&
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" &&
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;
fi
# Building for Android here
- if [ "$BUILD_TYPE" == "Android" ]; then
export ANDROID="android-sdk-linux/tools/android" &&
if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi &&
wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv &&
wget http://dl.google.com/android/android-sdk_r23.0.2-linux.tgz -nv;
fi
# Building for Qt here
- if [ "$BUILD_TYPE" == "Qt" ]; then
sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa &&
sudo apt-get update -qq &&
sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev pulseaudio libpulse-dev &&
export QMAKE="qmake -qt=qt5";
fi
install: install:
# Building for PSP here - sudo add-apt-repository ppa:tobydox/mingw -y
- if [ "$BUILD_TYPE" == "PSP" ]; then - sudo apt-get update -qq
tar -x --xz -f sdk.lzma; - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq mingw32-x-gcc mingw32-x-qt; fi
fi - sudo ln -s /opt/mingw32/bin/moc /opt/mingw32/bin/i686-w64-mingw32-moc
- if [ "$BUILD_TYPE" == "Android" ]; then - sudo ln -s /opt/mingw32/bin/rcc /opt/mingw32/bin/i686-w64-mingw32-rcc
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 && - 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 -zxf android-sdk_r23.0.2-linux.tgz && - tar -x --xz -f sdk.lzma
$ANDROID list sdk --extended -a && - wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
echo yes | $ANDROID update sdk --filter tools,platform-tools,build-tools-21.1.1,android-10 --no-ui --force --no-https; - wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
fi - 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,5,19 --no-ui --force > log.txt
- sudo pip install pyjavaproperties - sudo pip install pyjavaproperties
- sudo pip install github3.py
script: ./travis-script.sh script: ./travis-script.sh
env:
global:
secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8="
matrix: script: "./travis-script.sh"
fast_finish: true after_success: ./upload-binaries.sh
deploy:
provider: releases
api-key:
secure: "gzfDEihpfTmoO6CSjTNpHSlLTPtQUZUqTlmD91CQby6+znDsOy4xsqj10MNXe+l/3KYny1DtM48nxNKeVjsyeYg66TTzKsrgMVzt6Ah5CBhSXO99/TiaMJmSXmMO7GGfKDct190Dqej1gbR7AMd38DOYe2vpR0LX+Lf3gzDVLoU="
file:
- ${TRAVIS_BUILD_DIR}/core.zip
- ${TRAVIS_BUILD_DIR}/projects/mtg/Android/bin/Wagic-debug.apk
- ${TRAVIS_BUILD_DIR}/projects/mtg/psprelease.zip
skip_cleanup: true
on:
repo: WagicProject/wagic
tags: false
branch: auto_releases
-128
View File
@@ -1,128 +0,0 @@
#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 <string>
#include <ostream>
#include <istream>
#include <fstream>
#include <map>
#include "Threading.h"
#ifdef QT_CONFIG
#include <QObject>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkAccessManager>
#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&currentSize) {
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<string, DownloadRequest*> 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
+37 -12
View File
@@ -1,6 +1,10 @@
#ifndef _J_FILE_SYSTEM_H_ #ifndef _J_FILE_SYSTEM_H_
#define _J_FILE_SYSTEM_H_ #define _J_FILE_SYSTEM_H_
#ifdef QT_CONFIG
#include <QFile>
#endif
#include "zfsystem.h" #include "zfsystem.h"
#include <string> #include <string>
using zip_file_system::filesystem; using zip_file_system::filesystem;
@@ -18,13 +22,38 @@ using namespace std;
/// archive file. /// archive file.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
class JFile {
friend class JFileSystem;
filesystem::limited_file_info * mCurrentFileInZip;
izfstream mFile;
#ifdef QT_CONFIG
QFile *mpqFile;
#endif
public:
JFile() : mCurrentFileInZip(0)
#ifdef QT_CONFIG
, mpqFile(0)
#endif
{
};
~JFile() {
#ifdef QT_CONFIG
if(mpqFile) {
mpqFile->close();
delete mpqFile;
}
#endif
if (mFile)
mFile.close();
};
};
class JZipCache { class JZipCache {
public: public:
JZipCache(); JZipCache();
~JZipCache(); ~JZipCache();
map<string, filesystem::limited_file_info> dir; map<string, filesystem::limited_file_info> dir;
}; };
class JFileSystem { class JFileSystem {
@@ -32,23 +61,21 @@ private:
string mSystemFSPath, mUserFSPath; string mSystemFSPath, mUserFSPath;
filesystem * mSystemFS, * mUserFS; filesystem * mSystemFS, * mUserFS;
static JFileSystem* mInstance; static JFileSystem* mInstance;
izfstream mFile;
map<string,JZipCache *>mZipCache; map<string,JZipCache *>mZipCache;
unsigned int mZipCachedElementsCount; unsigned int mZipCachedElementsCount;
string mZipFileName; string mZipFileName;
int mFileSize;
char *mPassword; char *mPassword;
bool mZipAvailable; bool mZipAvailable;
void preloadZip(const string& filename); void preloadZip(const string& filename);
izfstream mZipFile; izfstream mZipFile;
filesystem::limited_file_info * mCurrentFileInZip;
std::vector<std::string>& scanRealFolder(const std::string& folderName, std::vector<std::string>& results); std::vector<std::string>& scanRealFolder(const std::string& folderName, std::vector<std::string>& results);
bool openForRead(izfstream & File, const string & FilePath);
int GetFileSize(izfstream & file);
public: public:
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Attach ZIP archive to the file system. /// Attach ZIP archive to the file system.
/// ///
@@ -83,7 +110,7 @@ public:
/// Open file for reading. /// Open file for reading.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
bool OpenFile(const string &filename); JFile* OpenFile(const string &filename);
//Fills the vector results with a list of children of the given folder //Fills the vector results with a list of children of the given folder
std::vector<std::string>& scanfolder(const std::string& folderName, std::vector<std::string>& results); std::vector<std::string>& scanfolder(const std::string& folderName, std::vector<std::string>& results);
@@ -97,20 +124,19 @@ public:
/// @return Number of bytes read. /// @return Number of bytes read.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
int ReadFile(void *buffer, int size); int ReadFile(JFile*, void *buffer, int size);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Get size of file. /// Get size of file.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
int GetFileSize(); int GetFileSize(JFile*);
int GetFileSize(izfstream & file);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Close file. /// Close file.
/// ///
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
void CloseFile(); void CloseFile(JFile*);
////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////
/// Set root for all the following file operations /// Set root for all the following file operations
@@ -124,11 +150,10 @@ public:
void SetUSerRoot(const string& resourceRoot); void SetUSerRoot(const string& resourceRoot);
string GetUserRoot() { return mUserFSPath; }; string GetUserRoot() { return mUserFSPath; };
bool openForRead(izfstream & File, const string & FilePath);
bool readIntoString(const string & FilePath, string & target); bool readIntoString(const string & FilePath, string & target);
bool ReadFileLine(JFile*, string&);
bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out ); bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out );
bool Rename(string from, string to); bool Rename(string from, string to);
bool Remove(string aFile);
//Returns true if strFilename exists somewhere in the fileSystem //Returns true if strFilename exists somewhere in the fileSystem
bool FileExists(const string& strFilename); bool FileExists(const string& strFilename);
-1
View File
@@ -178,7 +178,6 @@ private:
float mSpacing; float mSpacing;
PIXEL_TYPE mColor; PIXEL_TYPE mColor;
int mBlend;
int mBase; int mBase;
+3 -15
View File
@@ -25,10 +25,6 @@
#elif defined USE_PHONON #elif defined USE_PHONON
#include <phonon/AudioOutput> #include <phonon/AudioOutput>
#include <phonon/MediaObject> #include <phonon/MediaObject>
#elif (defined QT_CONFIG)
#include "QMediaPlayer"
#include "QMediaPlaylist"
#include "QSoundEffect"
#elif defined WIN32 #elif defined WIN32
#include <windows.h> #include <windows.h>
#define WITH_FMOD #define WITH_FMOD
@@ -86,10 +82,6 @@ public slots:
SLPlayItf playInterface; SLPlayItf playInterface;
SLSeekItf seekInterface; SLSeekItf seekInterface;
SLVolumeItf musicVolumeInterface; SLVolumeItf musicVolumeInterface;
#elif (defined QT_CONFIG)
QMediaPlaylist* playlist;
QMediaPlayer* player;
string fullpath;
#else #else
void* mTrack; void* mTrack;
#endif //WITH_FMOD #endif //WITH_FMOD
@@ -105,10 +97,8 @@ public:
~JSample(); ~JSample();
unsigned long fileSize(); unsigned long fileSize();
#if (defined QT_CONFIG) && (!defined USE_PHONON)
QMediaPlayer* effect; #if defined (PSP)
void* mSample;
#elif defined (PSP)
WAVDATA *mSample; WAVDATA *mSample;
#elif defined (IOS) #elif defined (IOS)
std::string filename; std::string filename;
@@ -252,10 +242,9 @@ protected:
void DestroySoundSystem(); void DestroySoundSystem();
private: private:
#if (defined PSP || defined ANDROID)
JMusic *mCurrentMusic; JMusic *mCurrentMusic;
JSample *mCurrentSample; JSample *mCurrentSample;
#endif
int mVolume; int mVolume;
int mMusicVolume; int mMusicVolume;
@@ -267,4 +256,3 @@ private:
}; };
#endif #endif
+2 -2
View File
@@ -137,14 +137,14 @@ private slots:
private: private:
int lastPosx(){ int lastPosx(){
#if QT_VERSION >= 0x050100 #if QT_VERSION >= 0x050000
return m_lastPos.x()*devicePixelRatio(); return m_lastPos.x()*devicePixelRatio();
#else #else
return m_lastPos.x(); return m_lastPos.x();
#endif #endif
} }
int lastPosy(){ int lastPosy(){
#if QT_VERSION >= 0x050100 #if QT_VERSION >= 0x050000
return m_lastPos.y()*devicePixelRatio(); return m_lastPos.y()*devicePixelRatio();
#else #else
return m_lastPos.y(); return m_lastPos.y();
-298
View File
@@ -1,298 +0,0 @@
#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<string, DownloadRequest*>::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<string, DownloadRequest*>::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<std::map<string,DownloadRequest*>::iterator,bool> ret;
ret = mRequestMap.insert ( std::pair<string,DownloadRequest*>(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 <<endl;
}
return out;
}
istream& operator>>(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<string, DownloadRequest*>::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;
}
+5 -4
View File
@@ -44,11 +44,12 @@ bool JAnimator::Load(const char* scriptFile)
JFileSystem *fileSystem = JFileSystem::GetInstance(); JFileSystem *fileSystem = JFileSystem::GetInstance();
if (fileSystem == NULL) return false; if (fileSystem == NULL) return false;
if (!fileSystem->OpenFile(scriptFile)) return false; JFile* jFile = fileSystem->OpenFile(scriptFile);
if (!jFile) return false;
int size = fileSystem->GetFileSize(); int size = fileSystem->GetFileSize(jFile);
char *xmlBuffer = new char[size]; char *xmlBuffer = new char[size];
fileSystem->ReadFile(xmlBuffer, size); fileSystem->ReadFile(jFile, xmlBuffer, size);
TiXmlDocument doc; TiXmlDocument doc;
doc.Parse(xmlBuffer); doc.Parse(xmlBuffer);
@@ -173,7 +174,7 @@ bool JAnimator::Load(const char* scriptFile)
} }
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
delete[] xmlBuffer; delete[] xmlBuffer;
return true; return true;
+17 -16
View File
@@ -49,7 +49,8 @@ char loadWaveData(WAVDATA* p_wav, char* fileName, char memLoad) // WAVE加载,
{ {
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (!fileSystem->OpenFile(fileName)) JFile* jFile = fileSystem->OpenFile(fileName);
if (!jFile)
return 0; return 0;
memset(p_wav, 0, sizeof(WAVDATA)); memset(p_wav, 0, sizeof(WAVDATA));
@@ -57,14 +58,14 @@ char loadWaveData(WAVDATA* p_wav, char* fileName, char memLoad) // WAVE加载,
char head[256]; char head[256];
memset(head, 0, 256); memset(head, 0, 256);
//sceIoRead(fd, head, 20); //sceIoRead(fd, head, 20);
fileSystem->ReadFile(head, 20); fileSystem->ReadFile(jFile, head, 20);
char string[8]; char string[8];
memset(string, 0, 8); memset(string, 0, 8);
memcpy(string, head, 4); memcpy(string, head, 4);
if (0!=strcmp(string, "RIFF")) if (0!=strcmp(string, "RIFF"))
{ {
//sceIoClose(fd); //sceIoClose(fd);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return 0; return 0;
} }
memset(string, 0, 8); memset(string, 0, 8);
@@ -72,7 +73,7 @@ char loadWaveData(WAVDATA* p_wav, char* fileName, char memLoad) // WAVE加载,
if (0!=strcmp(string, "WAVE")) if (0!=strcmp(string, "WAVE"))
{ {
//sceIoClose(fd); //sceIoClose(fd);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return 0; return 0;
} }
memset(string, 0, 8); memset(string, 0, 8);
@@ -80,42 +81,42 @@ char loadWaveData(WAVDATA* p_wav, char* fileName, char memLoad) // WAVE加载,
if (0!=strcmp(string, "fmt")) if (0!=strcmp(string, "fmt"))
{ {
//sceIoClose(fd); //sceIoClose(fd);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return 0; return 0;
} }
int fmtSize = 0; int fmtSize = 0;
memcpy(&fmtSize, head+16, 4); memcpy(&fmtSize, head+16, 4);
//sceIoRead(fd, head+20, fmtSize); //sceIoRead(fd, head+20, fmtSize);
fileSystem->ReadFile(head+20,fmtSize ); fileSystem->ReadFile(jFile, head+20,fmtSize );
p_wav->headSize = 20+fmtSize; p_wav->headSize = 20+fmtSize;
while (1) while (1)
{ {
//sceIoRead(fd, head+p_wav->headSize, 4); //sceIoRead(fd, head+p_wav->headSize, 4);
fileSystem->ReadFile(head+p_wav->headSize, 4); fileSystem->ReadFile(jFile, head+p_wav->headSize, 4);
memset(string, 0, 8); memset(string, 0, 8);
memcpy(string, head+p_wav->headSize, 4); memcpy(string, head+p_wav->headSize, 4);
p_wav->headSize += 4; p_wav->headSize += 4;
if (0!=strcmp(string, "data")) if (0!=strcmp(string, "data"))
{ {
//sceIoRead(fd, head+p_wav->headSize, 4); //sceIoRead(fd, head+p_wav->headSize, 4);
fileSystem->ReadFile(head+p_wav->headSize, 4); fileSystem->ReadFile(jFile, head+p_wav->headSize, 4);
memcpy(&fmtSize, head+p_wav->headSize, 4); memcpy(&fmtSize, head+p_wav->headSize, 4);
p_wav->headSize += 4; p_wav->headSize += 4;
//sceIoRead(fd, head+p_wav->headSize, fmtSize); //sceIoRead(fd, head+p_wav->headSize, fmtSize);
fileSystem->ReadFile(head+p_wav->headSize, fmtSize); fileSystem->ReadFile(jFile, head+p_wav->headSize, fmtSize);
p_wav->headSize += fmtSize; p_wav->headSize += fmtSize;
} }
else else
{ {
//sceIoRead(fd, head+p_wav->headSize, 4); //sceIoRead(fd, head+p_wav->headSize, 4);
fileSystem->ReadFile(head+p_wav->headSize, 4); fileSystem->ReadFile(jFile, head+p_wav->headSize, 4);
p_wav->headSize += 4; p_wav->headSize += 4;
break; break;
} }
if (p_wav->headSize>191) if (p_wav->headSize>191)
{ {
//sceIoClose(fd); //sceIoClose(fd);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return 0; return 0;
} }
} }
@@ -126,7 +127,7 @@ char loadWaveData(WAVDATA* p_wav, char* fileName, char memLoad) // WAVE加载,
if (p_wav->channelCount!=1 && p_wav->channelCount!=2) if (p_wav->channelCount!=1 && p_wav->channelCount!=2)
{ {
//sceIoClose(fd); //sceIoClose(fd);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return 0; return 0;
} }
memcpy(&p_wav->samplePerSecond, head+24, 4); memcpy(&p_wav->samplePerSecond, head+24, 4);
@@ -136,7 +137,7 @@ char loadWaveData(WAVDATA* p_wav, char* fileName, char memLoad) // WAVE加载,
if (p_wav->bytePerSample!=1 && p_wav->bytePerSample!=2) if (p_wav->bytePerSample!=1 && p_wav->bytePerSample!=2)
{ {
//sceIoClose(fd); //sceIoClose(fd);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return 0; return 0;
} }
p_wav->nSample = 44100 / p_wav->samplePerSecond; p_wav->nSample = 44100 / p_wav->samplePerSecond;
@@ -147,17 +148,17 @@ char loadWaveData(WAVDATA* p_wav, char* fileName, char memLoad) // WAVE加载,
if (p_wav->soundSize>4096000) if (p_wav->soundSize>4096000)
{ {
//sceIoClose(fd); //sceIoClose(fd);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return 0; return 0;
} }
p_wav->buffer = (char*)malloc(p_wav->soundSize); p_wav->buffer = (char*)malloc(p_wav->soundSize);
memset(p_wav->buffer, 0, p_wav->soundSize); memset(p_wav->buffer, 0, p_wav->soundSize);
//sceIoRead(fd, p_wav->buffer, p_wav->soundSize); //sceIoRead(fd, p_wav->buffer, p_wav->soundSize);
fileSystem->ReadFile(p_wav->buffer, p_wav->soundSize); fileSystem->ReadFile(jFile, p_wav->buffer, p_wav->soundSize);
p_wav->bytePosition = 0; p_wav->bytePosition = 0;
p_wav->fd = -1; p_wav->fd = -1;
//sceIoClose(fd); //sceIoClose(fd);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
} }
else else
{ {
+137 -50
View File
@@ -107,7 +107,6 @@ JFileSystem* JFileSystem::GetInstance()
// Tries to set the system and user paths. // Tries to set the system and user paths.
// On some OSes, the parameters get overriden by hardcoded values // On some OSes, the parameters get overriden by hardcoded values
JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath) JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
{ {
string systemPath = _systemPath; string systemPath = _systemPath;
string userPath = _userPath; string userPath = _userPath;
@@ -131,8 +130,8 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
dir.mkdir(USERDIR); dir.mkdir(USERDIR);
dir.cd(USERDIR); dir.cd(USERDIR);
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString(); systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
DebugTrace("User path " << userPath); DebugTrace("User path " << userPath);
DebugTrace("System path " << systemPath); DebugTrace("System path " << systemPath);
@@ -192,9 +191,6 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
mZipAvailable = false; mZipAvailable = false;
mZipCachedElementsCount = 0; mZipCachedElementsCount = 0;
mPassword = NULL; mPassword = NULL;
mFileSize = 0;
mCurrentFileInZip = NULL;
}; };
void JFileSystem::Destroy() void JFileSystem::Destroy()
@@ -208,14 +204,26 @@ void JFileSystem::Destroy()
bool JFileSystem::DirExists(const string& strDirname) bool JFileSystem::DirExists(const string& strDirname)
{ {
return (mSystemFS && mSystemFS->DirExists(strDirname)) || mUserFS->DirExists(strDirname); return (
(mSystemFS && mSystemFS->DirExists(strDirname))
|| mUserFS->DirExists(strDirname)
#ifdef QT_CONFIG
|| QDir(QString(":/") + strDirname.c_str()).exists()
#endif
);
} }
bool JFileSystem::FileExists(const string& strFilename) bool JFileSystem::FileExists(const string& strFilename)
{ {
if (strFilename.length() < 1 ) return false; if (strFilename.length() < 1 ) return false;
return (mSystemFS && mSystemFS->FileExists(strFilename)) || mUserFS->FileExists(strFilename); return (
(mSystemFS && mSystemFS->FileExists(strFilename))
|| mUserFS->FileExists(strFilename)
#ifdef QT_CONFIG
|| QFile(QString(":/") + strFilename.c_str()).exists()
#endif
);
} }
bool JFileSystem::MakeDir(const string & dir) bool JFileSystem::MakeDir(const string & dir)
@@ -275,7 +283,6 @@ bool JFileSystem::AttachZipFile(const string &zipfile, char *password /* = NULL
} }
mZipAvailable = true; mZipAvailable = true;
return true; return true;
} }
@@ -285,7 +292,6 @@ void JFileSystem::DetachZipFile()
{ {
mZipFile.close(); mZipFile.close();
} }
mCurrentFileInZip = NULL;
mZipAvailable = false; mZipAvailable = false;
} }
@@ -307,9 +313,13 @@ bool JFileSystem::openForRead(izfstream & File, const string & FilePath) {
bool JFileSystem::readIntoString(const string & FilePath, string & target) bool JFileSystem::readIntoString(const string & FilePath, string & target)
{ {
bool result = false;
// Trying first with a izfstream
do {
izfstream file; izfstream file;
if (!openForRead(file, FilePath)) if (!openForRead(file, FilePath))
return false; break;
int fileSize = GetFileSize(file); int fileSize = GetFileSize(file);
@@ -319,16 +329,42 @@ bool JFileSystem::readIntoString(const string & FilePath, string & target)
target.resize((std::string::size_type) fileSize); target.resize((std::string::size_type) fileSize);
#ifndef __MINGW32__ #ifndef __MINGW32__
} catch (bad_alloc&) { } catch (bad_alloc&) {
return false; break;
} }
#endif #endif
if (fileSize) if (fileSize)
file.read(&target[0], fileSize); file.read(&target[0], fileSize);
file.close(); file.close();
return true; result = true;
} while (0);
#ifdef QT_CONFIG
// Now we try with qrc if we haven't finc anything yet
if (!result) do {
string path = string(":/") + FilePath.c_str();
QFile qfile(path.c_str());
qfile.open(QIODevice::ReadOnly);
if(!qfile.isReadable())
break;
int fileSize = qfile.size();
#ifndef __MINGW32__
try {
#endif
target.resize((std::string::size_type) fileSize);
#ifndef __MINGW32__
} catch (bad_alloc&) {
break;
}
#endif
if (fileSize)
qfile.read(&target[0], fileSize);
qfile.close();
result = true;
} while (0);
#endif //QT_CONFIG
return result;
} }
bool JFileSystem::openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode) bool JFileSystem::openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode)
@@ -374,12 +410,25 @@ bool JFileSystem::openForWrite(ofstream & File, const string & FilePath, ios_bas
return false; return false;
} }
bool JFileSystem::OpenFile(const string &filename) JFile* JFileSystem::OpenFile(const string &filename)
{ {
mCurrentFileInZip = NULL; bool result;
JFile* jFile = new JFile();
jFile->mCurrentFileInZip = NULL;
if (!mZipAvailable || !mZipFile) do {
return openForRead(mFile, filename); if (!mZipAvailable || !mZipFile) {
result = openForRead(jFile->mFile, filename);
if(!result) {
#ifdef QT_CONFIG
string path = string(":/") + filename.c_str();
jFile->mpqFile = new QFile(path.c_str());
jFile->mpqFile->open(QIODevice::ReadOnly);
result = jFile->mpqFile->isReadable();
#endif
}
break;
}
preloadZip(mZipFileName); preloadZip(mZipFileName);
map<string,JZipCache *>::iterator it = mZipCache.find(mZipFileName); map<string,JZipCache *>::iterator it = mZipCache.find(mZipFileName);
@@ -387,7 +436,8 @@ bool JFileSystem::OpenFile(const string &filename)
{ {
//DetachZipFile(); //DetachZipFile();
//return OpenFile(filename); //return OpenFile(filename);
return openForRead(mFile, filename); result = openForRead(jFile->mFile, filename);
break;
} }
JZipCache * zc = it->second; JZipCache * zc = it->second;
map<string, filesystem::limited_file_info>::iterator it2 = zc->dir.find(filename); map<string, filesystem::limited_file_info>::iterator it2 = zc->dir.find(filename);
@@ -395,36 +445,37 @@ bool JFileSystem::OpenFile(const string &filename)
{ {
/*DetachZipFile(); /*DetachZipFile();
return OpenFile(filename); */ return OpenFile(filename); */
return openForRead(mFile, filename); result = openForRead(jFile->mFile, filename);
break;
} }
mCurrentFileInZip = &(it2->second); jFile->mCurrentFileInZip = &(it2->second);
mFileSize = it2->second.m_Size; result = true;
return true; } while(0);
if(result)
return jFile;
else {
delete jFile;
return 0;
}
} }
void JFileSystem::CloseFile() void JFileSystem::CloseFile(JFile* jFile)
{ {
if (mZipAvailable && mZipFile) delete jFile;
{
mCurrentFileInZip = NULL;
}
if (mFile)
mFile.close();
} }
//returns 0 if less than "size" bits were read //returns 0 if less than "size" bits were read
int JFileSystem::ReadFile(void *buffer, int size) int JFileSystem::ReadFile(JFile* jFile, void *buffer, int size)
{ {
if (mCurrentFileInZip) if (jFile->mCurrentFileInZip)
{ {
assert(mZipFile); assert(mZipFile);
if((size_t)size > mCurrentFileInZip->m_Size) //only support "store" method for zip inside zips if((size_t)size > jFile->mCurrentFileInZip->m_Size) //only support "store" method for zip inside zips
return 0; return 0;
std::streamoff offset = filesystem::SkipLFHdr(mZipFile, mCurrentFileInZip->m_Offset); std::streamoff offset = filesystem::SkipLFHdr(mZipFile, jFile->mCurrentFileInZip->m_Offset);
if (!mZipFile.seekg(offset)) if (!mZipFile.seekg(offset))
return 0; return 0;
mZipFile.read((char *) buffer, size); mZipFile.read((char *) buffer, size);
@@ -432,16 +483,43 @@ int JFileSystem::ReadFile(void *buffer, int size)
return size; return size;
} }
if (!mFile) #ifdef QT_CONFIG
if(jFile->mpqFile) {
return jFile->mpqFile->read((char*)buffer, size);
}
#endif
if (!jFile->mFile)
return 0; return 0;
assert(!mFile.Zipped() || (size_t)size <= mFile.getUncompSize()); assert(!jFile->mFile.Zipped() || (size_t)size <= jFile->mFile.getUncompSize());
mFile.read((char *)buffer, size); jFile->mFile.read((char *)buffer, size);
if (mFile.eof()) if (jFile->mFile.eof())
return 0; return 0;
return size; return size;
} }
bool JFileSystem::ReadFileLine(JFile* jFile, string& s)
{
if(!jFile) return false;
#ifdef QT_CONFIG
if(jFile->mpqFile) {
QString qs = jFile->mpqFile->readLine();
if(qs.isEmpty())
return false;
else {
s = qs.toStdString();
return true;
}
}
#endif
if(!jFile->mFile)
return 0;
assert(!jFile->mFile.Zipped());
return std::getline(jFile->mFile, s);
}
std::vector<std::string>& JFileSystem::scanRealFolder(const std::string& folderName, std::vector<std::string>& results) std::vector<std::string>& JFileSystem::scanRealFolder(const std::string& folderName, std::vector<std::string>& results)
{ {
DIR *dip = opendir(folderName.c_str()); DIR *dip = opendir(folderName.c_str());
@@ -529,6 +607,15 @@ std::vector<std::string>& JFileSystem::scanfolder(const std::string& _folderName
seen[systemReal[i]] = true; seen[systemReal[i]] = true;
} }
} }
#ifdef QT_CONFIG
string path = string(":/") + folderName;
QDir dir(path.c_str());
QStringList list = dir.entryList();
for(int i = 0; i < list.size(); i++)
{
seen[list.at(i).toStdString()] = true;
}
#endif
for(map<string,bool>::iterator it = seen.begin(); it != seen.end(); ++it) for(map<string,bool>::iterator it = seen.begin(); it != seen.end(); ++it)
{ {
@@ -544,12 +631,18 @@ std::vector<std::string> JFileSystem::scanfolder(const std::string& folderName)
return scanfolder(folderName, result); return scanfolder(folderName, result);
} }
int JFileSystem::GetFileSize() int JFileSystem::GetFileSize(JFile* jFile)
{ {
if (mCurrentFileInZip) if (jFile->mCurrentFileInZip)
return mFileSize; return jFile->mCurrentFileInZip->m_Size;
return GetFileSize(mFile); #ifdef QT_CONFIG
if(jFile->mpqFile) {
return jFile->mpqFile->size();
}
#endif
return GetFileSize(jFile->mFile);
} }
bool JFileSystem::Rename(string _from, string _to) bool JFileSystem::Rename(string _from, string _to)
@@ -557,13 +650,7 @@ bool JFileSystem::Rename(string _from, string _to)
string from = mUserFSPath + _from; string from = mUserFSPath + _from;
string to = mUserFSPath + _to; string to = mUserFSPath + _to;
std::remove(to.c_str()); std::remove(to.c_str());
return (rename(from.c_str(), to.c_str()) == 0); return rename(from.c_str(), to.c_str()) ? true: false;
}
bool JFileSystem::Remove(string aFile)
{
string toRemove = mUserFSPath + aFile;
return (std::remove(toRemove.c_str()) == 0);
} }
int JFileSystem::GetFileSize(izfstream & file) int JFileSystem::GetFileSize(izfstream & file)
+10 -9
View File
@@ -116,25 +116,26 @@ bool JGBKFont::Init(const char* engFileName, const char* chnFileName, int fontsi
int size; int size;
JFileSystem *fileSys = JFileSystem::GetInstance(); JFileSystem *fileSys = JFileSystem::GetInstance();
if (!fileSys->OpenFile(engFileName)) JFile* jFile = fileSys->OpenFile(engFileName);
if (!jFile)
return false; return false;
size = fileSys->GetFileSize(); size = fileSys->GetFileSize(jFile);
mEngFont = new BYTE[size]; mEngFont = new BYTE[size];
fileSys->ReadFile(mEngFont, size); fileSys->ReadFile(jFile, mEngFont, size);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
jFile = fileSys->OpenFile(chnFileName);
if (!fileSys->OpenFile(chnFileName)) if (!jFile)
return false; return false;
size = fileSys->GetFileSize(); size = fileSys->GetFileSize(jFile);
mChnFont = new BYTE[size]; mChnFont = new BYTE[size];
fileSys->ReadFile(mChnFont, size); fileSys->ReadFile(jFile, mChnFont, size);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
return true; return true;
} }
+25 -20
View File
@@ -892,9 +892,10 @@ static void PNGCustomReadDataFn(png_structp png_ptr, png_bytep data, png_size_t
{ {
png_size_t check; png_size_t check;
JFileSystem *fileSystem = (JFileSystem*)png_ptr->io_ptr; JFile* jFile = (JFile*)png_ptr->io_ptr;
JFileSystem* fileSystem = JFileSystem::GetInstance();
check = fileSystem->ReadFile(data, length); check = fileSystem->ReadFile(jFile, data, length);
if (check != length) if (check != length)
{ {
@@ -1038,23 +1039,24 @@ void JRenderer::LoadJPG(TextureInfo &textureInfo, const char *filename, int mode
bits32 = NULL; bits32 = NULL;
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (!fileSystem->OpenFile(filename)) JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile)
{ {
return; return;
} }
rawsize = fileSystem->GetFileSize(); rawsize = fileSystem->GetFileSize(jFile);
rawdata = new u8[rawsize]; rawdata = new u8[rawsize];
if (!rawdata) if (!rawdata)
{ {
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return; return;
} }
fileSystem->ReadFile(rawdata, rawsize); fileSystem->ReadFile(jFile, rawdata, rawsize);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
cinfo.err = jpeg_std_error(&jerr); cinfo.err = jpeg_std_error(&jerr);
@@ -1362,24 +1364,25 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char* filename, int mode,
u32* line; u32* line;
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (!fileSystem->OpenFile(filename)) return JGE_ERR_CANT_OPEN_FILE; JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile) return JGE_ERR_CANT_OPEN_FILE;
//JLOG("PNG opened - creating read struct"); //JLOG("PNG opened - creating read struct");
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) { if (png_ptr == NULL) {
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return JGE_ERR_PNG; return JGE_ERR_PNG;
} }
//JLOG("Setting error callback func"); //JLOG("Setting error callback func");
png_set_error_fn(png_ptr, (png_voidp) NULL, (png_error_ptr) NULL, PNGCustomWarningFn); png_set_error_fn(png_ptr, (png_voidp) NULL, (png_error_ptr) NULL, PNGCustomWarningFn);
info_ptr = png_create_info_struct(png_ptr); info_ptr = png_create_info_struct(png_ptr);
if (info_ptr == NULL) { if (info_ptr == NULL) {
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
return JGE_ERR_PNG; return JGE_ERR_PNG;
} }
png_init_io(png_ptr, NULL); png_init_io(png_ptr, NULL);
png_set_read_fn(png_ptr, (png_voidp)fileSystem, PNGCustomReadDataFn); png_set_read_fn(png_ptr, (png_voidp)jFile, PNGCustomReadDataFn);
png_set_sig_bytes(png_ptr, sig_read); png_set_sig_bytes(png_ptr, sig_read);
png_read_info(png_ptr, info_ptr); png_read_info(png_ptr, info_ptr);
@@ -1392,7 +1395,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char* filename, int mode,
png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER);
line = (u32*) malloc(width * 4); line = (u32*) malloc(width * 4);
if (!line) { if (!line) {
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
return JGE_ERR_MALLOC_FAILED; return JGE_ERR_MALLOC_FAILED;
} }
@@ -1430,7 +1433,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char* filename, int mode,
std::ostringstream stream; std::ostringstream stream;
stream << "Alloc failed for: Tex Width: " << texWidth << " Tex Height: " << kVerticalBlockSize << ", total bytes: " << texWidth * kVerticalBlockSize * sizeof(PIXEL_TYPE); stream << "Alloc failed for: Tex Width: " << texWidth << " Tex Height: " << kVerticalBlockSize << ", total bytes: " << texWidth * kVerticalBlockSize * sizeof(PIXEL_TYPE);
JLOG(stream.str().c_str()); JLOG(stream.str().c_str());
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
return JGE_ERR_MALLOC_FAILED; return JGE_ERR_MALLOC_FAILED;
} }
@@ -1505,7 +1508,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char* filename, int mode,
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
//JLOG("Closing PNG"); //JLOG("Closing PNG");
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
if (done) if (done)
{ {
@@ -1725,9 +1728,9 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
int image_gif_read(GifFileType * ft, GifByteType * buf, int size) int image_gif_read(GifFileType * ft, GifByteType * buf, int size)
{ {
JFileSystem *fileSys = JFileSystem::GetInstance();
JFileSystem *fileSys = (JFileSystem *)ft->UserData; JFile* jFile = (JFile*)ft->UserData;
if (fileSys->ReadFile(buf, size)) if (fileSys->ReadFile(jFile, buf, size))
return size; return size;
else else
return 0; return 0;
@@ -1740,15 +1743,17 @@ void JRenderer::LoadGIF(TextureInfo &textureInfo, const char *filename, int mode
JFileSystem *fileSys = JFileSystem::GetInstance(); JFileSystem *fileSys = JFileSystem::GetInstance();
if (!fileSys->OpenFile(filename)) JFile* jFile = fileSys->OpenFile(filename);
if (!jFile)
return; return;
DWORD bkcol; DWORD bkcol;
int result = image_readgif(fileSys, textureInfo, &bkcol, image_gif_read, mode); int result = image_readgif(jFile, textureInfo, &bkcol, image_gif_read, mode);
if(result!=0) if(result!=0)
textureInfo.mBits=NULL; textureInfo.mBits=NULL;
fileSys->CloseFile(); fileSys->CloseFile(jFile);
return ; return ;
} }
+4 -3
View File
@@ -42,10 +42,11 @@ JLBFont::JLBFont(const char *fontname, int lineheight, bool useVideoRAM)
//FILE *file; //FILE *file;
JFileSystem *fileSys = JFileSystem::GetInstance(); JFileSystem *fileSys = JFileSystem::GetInstance();
if (!fileSys->OpenFile(filename)) return; JFile* jFile = fileSys->OpenFile(filename);
if (!jFile) return;
fileSys->ReadFile((u8 *)buffer, 2048); fileSys->ReadFile(jFile, (u8 *)buffer, 2048);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
sprintf(filename, "%s.png", fontname); sprintf(filename, "%s.png", fontname);
mTexture = mRenderer->LoadTexture(filename, useVideoRAM); mTexture = mRenderer->LoadTexture(filename, useVideoRAM);
+5 -4
View File
@@ -96,7 +96,8 @@ bool JMD2Model::Load(char *filename, char *textureName)
// open the model file // open the model file
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (!fileSystem->OpenFile(filename)) JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile)
return false; return false;
//filePtr = fopen(filename, "rb"); //filePtr = fopen(filename, "rb");
//if (filePtr == NULL) //if (filePtr == NULL)
@@ -107,13 +108,13 @@ bool JMD2Model::Load(char *filename, char *textureName)
//fileLen = ftell(filePtr); //fileLen = ftell(filePtr);
//fseek(filePtr, 0, SEEK_SET); //fseek(filePtr, 0, SEEK_SET);
fileLen = fileSystem->GetFileSize(); fileLen = fileSystem->GetFileSize(jFile);
// read entire file into buffer // read entire file into buffer
buffer = (char*)malloc(fileLen + 1); buffer = (char*)malloc(fileLen + 1);
//fread(buffer, sizeof(char), fileLen, filePtr); //fread(buffer, sizeof(char), fileLen, filePtr);
fileSystem->ReadFile(buffer, fileLen); fileSystem->ReadFile(jFile, buffer, fileLen);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
// extract model file header from buffer // extract model file header from buffer
modelHeader = (modelHeader_t*)buffer; modelHeader = (modelHeader_t*)buffer;
+5 -4
View File
@@ -47,14 +47,15 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
{ {
JFileSystem* fileSys = JFileSystem::GetInstance(); JFileSystem* fileSys = JFileSystem::GetInstance();
if (!fileSys->OpenFile(modelName)) JFile* jFile = fileSys->OpenFile(modelName);
if (!jFile)
return false; return false;
int size = fileSys->GetFileSize(); int size = fileSys->GetFileSize(jFile);
char *buffer = new char[size]; char *buffer = new char[size];
fileSys->ReadFile(buffer, size); fileSys->ReadFile(jFile, buffer, size);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
Vector3D vert; Vector3D vert;
+5 -4
View File
@@ -55,11 +55,12 @@ bool JParticleEffect::Load(const char* filename)
JFileSystem *fileSystem = JFileSystem::GetInstance(); JFileSystem *fileSystem = JFileSystem::GetInstance();
if (fileSystem == NULL) return false; if (fileSystem == NULL) return false;
if (!fileSystem->OpenFile(filename)) return false; JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile) return false;
int size = fileSystem->GetFileSize(); int size = fileSystem->GetFileSize(jFile);
char *xmlBuffer = new char[size]; char *xmlBuffer = new char[size];
fileSystem->ReadFile(xmlBuffer, size); fileSystem->ReadFile(jFile, xmlBuffer, size);
TiXmlDocument doc; TiXmlDocument doc;
@@ -296,7 +297,7 @@ bool JParticleEffect::Load(const char* filename)
} }
} }
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
delete[] xmlBuffer; delete[] xmlBuffer;
return true; return true;
+5 -5
View File
@@ -93,13 +93,13 @@ bool JResourceManager::LoadResource(const string& resourceName)
JFileSystem *fileSystem = JFileSystem::GetInstance(); JFileSystem *fileSystem = JFileSystem::GetInstance();
if (fileSystem == NULL) return false; if (fileSystem == NULL) return false;
JFile* jFile = fileSystem->OpenFile(path.c_str());
if (!jFile) return false;
if (!fileSystem->OpenFile(path.c_str())) return false; int size = fileSystem->GetFileSize(jFile);
int size = fileSystem->GetFileSize();
char *xmlBuffer = new char[size]; char *xmlBuffer = new char[size];
fileSystem->ReadFile(xmlBuffer, size); fileSystem->ReadFile(jFile, xmlBuffer, size);
TiXmlDocument doc; TiXmlDocument doc;
doc.Parse(xmlBuffer); doc.Parse(xmlBuffer);
@@ -179,7 +179,7 @@ bool JResourceManager::LoadResource(const string& resourceName)
} }
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
delete[] xmlBuffer; delete[] xmlBuffer;
// JGERelease(); // JGERelease();
+5 -4
View File
@@ -41,11 +41,12 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
JFileSystem *fileSystem = JFileSystem::GetInstance(); JFileSystem *fileSystem = JFileSystem::GetInstance();
if (fileSystem == NULL) return false; if (fileSystem == NULL) return false;
if (!fileSystem->OpenFile(filename)) return false; JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile) return false;
int size = fileSystem->GetFileSize(); int size = fileSystem->GetFileSize(jFile);
char *xmlBuffer = new char[size]; char *xmlBuffer = new char[size];
fileSystem->ReadFile(xmlBuffer, size); fileSystem->ReadFile(jFile, xmlBuffer, size);
TiXmlDocument doc; TiXmlDocument doc;
doc.Parse(xmlBuffer); doc.Parse(xmlBuffer);
@@ -76,7 +77,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
} }
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
delete[] xmlBuffer; delete[] xmlBuffer;
return true; return true;
+5 -4
View File
@@ -200,14 +200,15 @@ bool JTTFont::Load(const char *filename, int size, int mode)
if (FT_Init_FreeType( &mLibrary ) == 0) if (FT_Init_FreeType( &mLibrary ) == 0)
{ {
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (fileSystem->OpenFile(filename)) JFile* jFile = fileSystem->OpenFile(filename);
if (jFile)
{ {
mFontBitsSize = fileSystem->GetFileSize(); mFontBitsSize = fileSystem->GetFileSize(jFile);
mFontBits = (FT_Byte*)malloc(mFontBitsSize); mFontBits = (FT_Byte*)malloc(mFontBitsSize);
fileSystem->ReadFile(mFontBits, mFontBitsSize); fileSystem->ReadFile(jFile, mFontBits, mFontBitsSize);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
if (FT_New_Memory_Face(mLibrary, mFontBits, mFontBitsSize, 0, &mFace ) == 0) if (FT_New_Memory_Face(mLibrary, mFontBits, mFontBitsSize, 0, &mFace ) == 0)
{ {
+11 -18
View File
@@ -9,11 +9,11 @@
#include <QtDeclarative> #include <QtDeclarative>
#include "qmlapplicationviewer.h" #include "qmlapplicationviewer.h"
#endif //QT_WIDGET #endif //QT_WIDGET
#include "Downloader.h" #include "filedownloader.h"
#include "GameApp.h" #include "GameApp.h"
#include "corewrapper.h" #include "corewrapper.h"
WagicCore* g_glwidget = NULL; QWidget* g_glwidget = NULL;
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] = static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
{ {
@@ -69,25 +69,18 @@ int main(int argc, char* argv[])
#endif //QT_WIDGET #endif //QT_WIDGET
if(argc >= 2 && string(argv[1]) == "testsuite")
{
int result = 0;
result += WagicCore::runTestSuite();
return result;
}
app->setApplicationName(WagicCore::getApplicationName()); app->setApplicationName(WagicCore::getApplicationName());
DownloadRequest* downloadRequest = NULL; FileDownloader fileDownloader(USERDIR, WAGIC_RESOURCE_NAME);
#ifdef WAGIC_RESOURCE_URL
Downloader*downloader = Downloader::GetInstance();
downloadRequest = downloader->Get(
"core.zip",
WAGIC_RESOURCE_URL
);
#endif
#ifdef QT_WIDGET #ifdef QT_WIDGET
g_glwidget = new WagicCore(); g_glwidget = new WagicCore();
if(!downloadRequest || downloadRequest->getDownloadStatus() == DownloadRequest::DOWNLOADED) g_glwidget->connect(&fileDownloader, SIGNAL(finished(int)), SLOT(start(int)));
{
g_glwidget->start(0);
}
else
{
g_glwidget->connect(downloadRequest, SIGNAL(statusChanged(int)), SLOT(start(int)));
}
#else #else
qmlRegisterType<WagicCore>("CustomComponents", 1, 0, "WagicCore"); qmlRegisterType<WagicCore>("CustomComponents", 1, 0, "WagicCore");
-13
View File
@@ -80,19 +80,6 @@ extern "C" void Java_org_libsdl_app_SDLActivity_nativeResume(
return; return;
g_engine->Resume(); 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 #endif
+5 -4
View File
@@ -57,19 +57,20 @@ hgeFont::hgeFont(const char *szFont, bool bMipmap __attribute__((unused)))
// Load font description // Load font description
JFileSystem* fileSys = JFileSystem::GetInstance(); JFileSystem* fileSys = JFileSystem::GetInstance();
if (!fileSys->OpenFile(szFont)) return; JFile* jFile = fileSys->OpenFile(szFont);
if (!jFile) return;
//data=hge->Resource_Load(szFont, &size); //data=hge->Resource_Load(szFont, &size);
//if(!data) return; //if(!data) return;
size = fileSys->GetFileSize(); size = fileSys->GetFileSize(jFile);
desc = new char[size+1]; desc = new char[size+1];
//memcpy(desc,data,size); //memcpy(desc,data,size);
fileSys->ReadFile(desc, size); fileSys->ReadFile(jFile, desc, size);
desc[size]=0; desc[size]=0;
//hge->Resource_Free(data); //hge->Resource_Free(data);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
pdesc=_get_line(desc,linebuf); pdesc=_get_line(desc,linebuf);
if(strcmp(linebuf, FNTHEADERTAG)) if(strcmp(linebuf, FNTHEADERTAG))
+5 -10
View File
@@ -50,14 +50,9 @@ float Random_Float(float min, float max)
hgeParticleSystem::hgeParticleSystem(const char *filename, JQuad *sprite) hgeParticleSystem::hgeParticleSystem(const char *filename, JQuad *sprite)
{ {
//void *psi;
//hgeParticleSystemInfo psi;
JFileSystem* fileSys = JFileSystem::GetInstance(); JFileSystem* fileSys = JFileSystem::GetInstance();
//hge=hgeCreate(HGE_VERSION); JFile* jFile = fileSys->OpenFile(filename);
if (!jFile) return;
//psi=hge->Resource_Load(filename);
if (!fileSys->OpenFile(filename)) return;
//if(!psi) return; //if(!psi) return;
@@ -66,12 +61,12 @@ hgeParticleSystem::hgeParticleSystem(const char *filename, JQuad *sprite)
// Skip reading the pointer as it may be larger than 4 bytes in the structure // Skip reading the pointer as it may be larger than 4 bytes in the structure
void *dummyPointer; void *dummyPointer;
fileSys->ReadFile(&dummyPointer, 4); fileSys->ReadFile(jFile, &dummyPointer, 4);
// we're actually trying to read more than the file size now, but it's no problem. // we're actually trying to read more than the file size now, but it's no problem.
// Note that this fix is only to avoid the largest problems, filling a structure // Note that this fix is only to avoid the largest problems, filling a structure
// by directly reading a file, is really a bad idea ... // by directly reading a file, is really a bad idea ...
fileSys->ReadFile(&(info.nEmission), sizeof(hgeParticleSystemInfo) - 4); fileSys->ReadFile(jFile, &(info.nEmission), sizeof(hgeParticleSystemInfo) - 4);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
info.sprite=sprite; info.sprite=sprite;
// info.fGravityMin *= 100; // info.fGravityMin *= 100;
+36 -29
View File
@@ -1683,20 +1683,21 @@ void JRenderer::LoadJPG(TextureInfo &textureInfo, const char *filename, int mode
int rawsize, i; int rawsize, i;
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (!fileSystem->OpenFile(filename)) return; JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile) return;
rawsize = fileSystem->GetFileSize(); rawsize = fileSystem->GetFileSize(jFile);
rawdata = new BYTE[rawsize]; rawdata = new BYTE[rawsize];
if (!rawdata) if (!rawdata)
{ {
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return; return;
} }
fileSystem->ReadFile(rawdata, rawsize); fileSystem->ReadFile(jFile, rawdata, rawsize);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
// Initialize libJpeg Object // Initialize libJpeg Object
cinfo.err = jpeg_std_error(&jerr); cinfo.err = jpeg_std_error(&jerr);
@@ -1804,9 +1805,10 @@ static void PNGCustomReadDataFn(png_structp png_ptr, png_bytep data, png_size_t
{ {
png_size_t check; png_size_t check;
JFileSystem *fileSystem = (JFileSystem*)png_ptr->io_ptr; JFileSystem* fileSystem = JFileSystem::GetInstance();
JFile *jFile = (JFile*)png_ptr->io_ptr;
check = fileSystem->ReadFile(data, length); check = fileSystem->ReadFile(jFile, data, length);
if (check != length) if (check != length)
{ {
@@ -1869,13 +1871,14 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
DWORD* line; DWORD* line;
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (!fileSystem->OpenFile(filename)) JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile)
return JGE_ERR_CANT_OPEN_FILE; return JGE_ERR_CANT_OPEN_FILE;
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (png_ptr == NULL) if (png_ptr == NULL)
{ {
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
return JGE_ERR_PNG; return JGE_ERR_PNG;
} }
@@ -1885,14 +1888,14 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
if (info_ptr == NULL) if (info_ptr == NULL)
{ {
//fclose(fp); //fclose(fp);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
return JGE_ERR_PNG; return JGE_ERR_PNG;
} }
png_init_io(png_ptr, NULL); png_init_io(png_ptr, NULL);
png_set_read_fn(png_ptr, (png_voidp)fileSystem, PNGCustomReadDataFn); png_set_read_fn(png_ptr, (png_voidp)jFile, PNGCustomReadDataFn);
png_set_sig_bytes(png_ptr, sig_read); png_set_sig_bytes(png_ptr, sig_read);
png_read_info(png_ptr, info_ptr); png_read_info(png_ptr, info_ptr);
@@ -1908,7 +1911,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
if (!line) if (!line)
{ {
//fclose(fp); //fclose(fp);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL); png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
return JGE_ERR_MALLOC_FAILED; return JGE_ERR_MALLOC_FAILED;
@@ -1957,7 +1960,7 @@ int JRenderer::LoadPNG(TextureInfo &textureInfo, const char *filename, int mode
png_read_end(png_ptr, info_ptr); png_read_end(png_ptr, info_ptr);
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
textureInfo.mBits = buffer; textureInfo.mBits = buffer;
@@ -2116,9 +2119,10 @@ int JRenderer::image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bg
int image_gif_read(GifFileType * ft, GifByteType * buf, int size) int image_gif_read(GifFileType * ft, GifByteType * buf, int size)
{ {
JFileSystem *fileSys = (JFileSystem *)ft->UserData; JFileSystem* fileSystem = JFileSystem::GetInstance();
//return fread(buf, 1, size, (FILE *)ft->UserData); JFile* jFile = (JFile*)ft->UserData;
if (fileSys->ReadFile(buf, size))
if (fileSys->ReadFile(jFile, buf, size))
return size; return size;
else else
return 0; return 0;
@@ -2130,17 +2134,18 @@ void JRenderer::LoadGIF(TextureInfo &textureInfo, const char *filename, int mode
///* ///*
//FILE * fp = fopen(filename, "rb"); //FILE * fp = fopen(filename, "rb");
JFileSystem *fileSys = JFileSystem::GetInstance(); JFileSystem *fileSys = JFileSystem::GetInstance();
if (!fileSys->OpenFile(filename)) JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile))
return; return;
//if(fp == NULL) //if(fp == NULL)
// return; // return;
DWORD bkcol; DWORD bkcol;
int result = image_readgif(fileSys, textureInfo, &bkcol, image_gif_read, mode); int result = image_readgif(jFile, textureInfo, &bkcol, image_gif_read, mode);
if(result!=0) if(result!=0)
textureInfo.mBits=NULL; textureInfo.mBits=NULL;
//fclose(fp); //fclose(fp);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
return ;//*/ return ;//*/
} }
#endif //(!defined IOS) && (!defined QT_CONFIG) && (!defined SDL_CONFIG) #endif //(!defined IOS) && (!defined QT_CONFIG) && (!defined SDL_CONFIG)
@@ -2161,20 +2166,21 @@ JTexture* JRenderer::LoadTexture(const char* filename, int mode, int TextureForm
UIImage *image = NULL; UIImage *image = NULL;
do { do {
if (!fileSystem->OpenFile(filename)) JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile)
break; break;
rawsize = fileSystem->GetFileSize(); rawsize = fileSystem->GetFileSize(jFile);
rawdata = new BYTE[rawsize]; rawdata = new BYTE[rawsize];
if (!rawdata) if (!rawdata)
{ {
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
break; break;
} }
fileSystem->ReadFile(rawdata, rawsize); fileSystem->ReadFile(jFile, rawdata, rawsize);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
texData = [[NSData alloc] initWithBytes:rawdata length:rawsize]; texData = [[NSData alloc] initWithBytes:rawdata length:rawsize];
image = [[UIImage alloc] initWithData:texData]; image = [[UIImage alloc] initWithData:texData];
@@ -2254,20 +2260,21 @@ JTexture* JRenderer::LoadTexture(const char* filename, int, int)
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
do { do {
if (!fileSystem->OpenFile(filename)) JFile* jFile = fileSystem->OpenFile(filename);
if (!jFile)
break; break;
rawsize = fileSystem->GetFileSize(); rawsize = fileSystem->GetFileSize(jFile);
rawdata = new BYTE[rawsize]; rawdata = new BYTE[rawsize];
if (!rawdata) if (!rawdata)
{ {
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
break; break;
} }
fileSystem->ReadFile(rawdata, rawsize); fileSystem->ReadFile(jFile, rawdata, rawsize);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
QImage tmpImage = QImage::fromData(rawdata, rawsize); QImage tmpImage = QImage::fromData(rawdata, rawsize);
if(tmpImage.isNull()) if(tmpImage.isNull())
+27 -73
View File
@@ -22,8 +22,6 @@
JMusic::JMusic() JMusic::JMusic()
#ifdef USE_PHONON #ifdef USE_PHONON
: mOutput(0), mMediaObject(0) : mOutput(0), mMediaObject(0)
#elif defined QT_CONFIG
: playlist(0), player(0)
#endif #endif
{ {
} }
@@ -42,16 +40,11 @@ int JMusic::getPlayTime(){
JMusic::~JMusic() JMusic::~JMusic()
{ {
#if defined USE_PHONON #ifdef USE_PHONON
if(mOutput) if(mOutput)
delete mOutput; delete mOutput;
if(mMediaObject) if(mMediaObject)
delete mMediaObject; delete mMediaObject;
#elif defined QT_CONFIG
if(player)
delete player;
if(playlist)
delete playlist;
#elif defined WITH_FMOD #elif defined WITH_FMOD
JSoundSystem::GetInstance()->StopMusic(this); JSoundSystem::GetInstance()->StopMusic(this);
if (mTrack) FSOUND_Sample_Free(mTrack); if (mTrack) FSOUND_Sample_Free(mTrack);
@@ -76,10 +69,7 @@ JSample::JSample()
JSample::~JSample() JSample::~JSample()
{ {
#if (defined QT_CONFIG) && (!defined USE_PHONON) #ifdef USE_PHONON
if(effect)
delete effect;
#elif USE_PHONON
if(mOutput) if(mOutput)
delete mOutput; delete mOutput;
if(mMediaObject) if(mMediaObject)
@@ -154,20 +144,8 @@ void JSoundSystem::DestroySoundSystem()
JMusic *JSoundSystem::LoadMusic(const char *fileName) JMusic *JSoundSystem::LoadMusic(const char *fileName)
{ {
JMusic* music = NULL; #ifdef USE_PHONON
#if (defined QT_CONFIG) && (!defined USE_PHONON) JMusic* music = new JMusic();
music = new JMusic();
if (music)
{
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) if (music)
{ {
music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0); music->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
@@ -177,41 +155,35 @@ JMusic *JSoundSystem::LoadMusic(const char *fileName)
Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput); Phonon::Path mediapath = Phonon::createPath(music->mMediaObject, music->mOutput);
Q_ASSERT(mediapath.isValid()); Q_ASSERT(mediapath.isValid());
} }
return music;
#elif (defined WITH_FMOD) #elif (defined WITH_FMOD)
music = new JMusic(); JMusic* music = new JMusic();
if (music) if (music)
{ {
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (fileSystem->OpenFile(fileName)) JFile* jFile = fileSystem->OpenFile(fileName);
if (jFile)
{ {
int size = fileSystem->GetFileSize(); int size = fileSystem->GetFileSize(jFile);
char *buffer = new char[size]; char *buffer = new char[size];
fileSystem->ReadFile(buffer, size); fileSystem->ReadFile(jFile, buffer, size);
music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size); music->mTrack = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
delete[] buffer; delete[] buffer;
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
} }
} }
return music;
#else #else
cerr << fileName << endl; cerr << fileName << endl;
return NULL;
#endif #endif
return music;
} }
void JSoundSystem::PlayMusic(JMusic *music, bool looping) void JSoundSystem::PlayMusic(JMusic *music, bool looping)
{ {
#if (defined QT_CONFIG) && (!defined USE_PHONON) #ifdef USE_PHONON
if(music && music->player && music->playlist)
{
if(looping)
music->playlist->setPlaybackMode(QMediaPlaylist::Loop);
music->player->setPlaylist(music->playlist);
music->player->play();
}
#elif USE_PHONON
if (music && music->mMediaObject && music->mOutput) if (music && music->mMediaObject && music->mOutput)
{ {
if(looping) if(looping)
@@ -242,12 +214,7 @@ void JSoundSystem::PlayMusic(JMusic *music, bool looping)
void JSoundSystem::StopMusic(JMusic *music) void JSoundSystem::StopMusic(JMusic *music)
{ {
#if (defined QT_CONFIG) && (!defined USE_PHONON) #ifdef USE_PHONON
if (music && music->player && music->playlist)
{
music->player->stop();
}
#elif defined USE_PHONON
if (music && music->mMediaObject && music->mOutput) if (music && music->mMediaObject && music->mOutput)
{ {
music->mMediaObject->stop(); music->mMediaObject->stop();
@@ -298,19 +265,8 @@ void JSoundSystem::SetSfxVolume(int volume){
JSample *JSoundSystem::LoadSample(const char *fileName) JSample *JSoundSystem::LoadSample(const char *fileName)
{ {
JSample* sample = NULL; #if (defined USE_PHONON)
#if (defined QT_CONFIG) && (!defined USE_PHONON) JSample* sample = new JSample();
sample = new JSample();
if (sample)
{
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) if (sample)
{ {
sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0); sample->mOutput = new Phonon::AudioOutput(Phonon::GameCategory, 0);
@@ -320,39 +276,37 @@ JSample *JSoundSystem::LoadSample(const char *fileName)
Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput); Phonon::Path mediapath = Phonon::createPath(sample->mMediaObject, sample->mOutput);
Q_ASSERT(mediapath.isValid()); Q_ASSERT(mediapath.isValid());
} }
return sample;
#elif (defined WITH_FMOD) #elif (defined WITH_FMOD)
sample = new JSample(); JSample* sample = new JSample();
if (sample) if (sample)
{ {
JFileSystem* fileSystem = JFileSystem::GetInstance(); JFileSystem* fileSystem = JFileSystem::GetInstance();
if (fileSystem->OpenFile(fileName)) JFile* jFile = fileSystem->OpenFile(fileName);
if (jFile)
{ {
int size = fileSystem->GetFileSize(); int size = fileSystem->GetFileSize(jFile);
char *buffer = new char[size]; char *buffer = new char[size];
fileSystem->ReadFile(buffer, size); fileSystem->ReadFile(jFile, buffer, size);
sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size); sample->mSample = FSOUND_Sample_Load(FSOUND_UNMANAGED, buffer, FSOUND_LOADMEMORY, 0, size);
delete[] buffer; delete[] buffer;
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
}else }else
sample->mSample = NULL; sample->mSample = NULL;
} }
return sample;
#else #else
cerr << fileName << endl; cerr << fileName << endl;
return NULL;
#endif #endif
return sample;
} }
void JSoundSystem::PlaySample(JSample *sample) void JSoundSystem::PlaySample(JSample *sample)
{ {
#if (defined QT_CONFIG) && (!defined USE_PHONON) #ifdef USE_PHONON
if(sample)
{
sample->effect->play();
}
#elif defined USE_PHONON
if (sample && sample->mMediaObject && sample->mOutput) if (sample && sample->mMediaObject && sample->mOutput)
{ {
sample->mOutput->setVolume((qreal)mSampleVolume*0.01); sample->mOutput->setVolume((qreal)mSampleVolume*0.01);
-7
View File
@@ -2,8 +2,6 @@
[![Build Status](https://travis-ci.org/WagicProject/wagic.png?branch=master)](https://travis-ci.org/WagicProject/wagic) [![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 ## Description
@@ -21,8 +19,3 @@ It is highly customizable and allows the player to tweak the rules / create thei
Info, downloads, discussions and more at http://wololo.net/forum/index.php 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") -![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)
-68
View File
@@ -1,68 +0,0 @@
# 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
+1
View File
@@ -57,6 +57,7 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
$(MTG_PATH)/src/DeckMetaData.cpp \ $(MTG_PATH)/src/DeckMetaData.cpp \
$(MTG_PATH)/src/DeckStats.cpp \ $(MTG_PATH)/src/DeckStats.cpp \
$(MTG_PATH)/src/DuelLayers.cpp \ $(MTG_PATH)/src/DuelLayers.cpp \
$(MTG_PATH)/src/Effects.cpp \
$(MTG_PATH)/src/ExtraCost.cpp \ $(MTG_PATH)/src/ExtraCost.cpp \
$(MTG_PATH)/src/GameApp.cpp \ $(MTG_PATH)/src/GameApp.cpp \
$(MTG_PATH)/src/GameLauncher.cpp \ $(MTG_PATH)/src/GameLauncher.cpp \
@@ -80,6 +80,7 @@ public class SDLActivity extends Activity implements OnKeyListener
public Boolean mErrorHappened = false; public Boolean mErrorHappened = false;
public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/"; public final static String RES_FOLDER = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
public static String RES_FILENAME = "core_0184.zip"; 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/"; public String systemFolder = Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res/";
private String userFolder; private String userFolder;
@@ -306,7 +307,7 @@ public class SDLActivity extends Activity implements OnKeyListener
private void startDownload() private void startDownload()
{ {
String url = getResourceUrl(); String url = RES_URL + RES_FILENAME;
if (!checkStorageState()) if (!checkStorageState())
{ {
Log.e(TAG, "Error in initializing storage space."); Log.e(TAG, "Error in initializing storage space.");
@@ -436,7 +437,7 @@ public class SDLActivity extends Activity implements OnKeyListener
mContext = this.getApplicationContext(); mContext = this.getApplicationContext();
// get the current version of the app to set the core filename // get the current version of the app to set the core filename
String versionCodeString = getApplicationCode(); String versionCodeString = getApplicationCode();
RES_FILENAME = getResourceName(); RES_FILENAME = "core_" + versionCodeString + ".zip";
StorageOptions.determineStorageOptions(); StorageOptions.determineStorageOptions();
checkStorageLocationPreference(); checkStorageLocationPreference();
@@ -524,9 +525,6 @@ public class SDLActivity extends Activity implements OnKeyListener
} }
// C functions we call // C functions we call
public static native String getResourceUrl();
public static native String getResourceName();
public static native void nativeInit(); public static native void nativeInit();
public static native void nativeQuit(); public static native void nativeQuit();
+1 -1
View File
@@ -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/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\
objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\ objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\
objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\ objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\
objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\ objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\
objs/GameObserver.o objs/GameOptions.o objs/GameState.o\ objs/GameObserver.o objs/GameOptions.o objs/GameState.o\
objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\ objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\ objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
+61 -14
View File
@@ -42,19 +42,50 @@ def getFilename():
filename = 'core_' + major + minor + point filename = 'core_' + major + minor + point
return filename return filename
def createQrcFile():
utilities = ZipUtilities()
print "Creating Qt Resource File"
filename = "core.qrc"
f = open(filename, 'w')
f.seek(0,0)
f.write("""<!DOCTYPE RCC><RCC version="1.0">\n<qresource>\n""")
rename = False
if not os.path.isfile('settings/options.txt'):
os.rename('settings/options.orig.txt', 'settings/options.txt')
remame = True
if not os.path.isfile('player/options.txt'):
os.rename('player/options.orig.txt', 'player/options.txt')
rename = True
utilities.addFolderToQrc(f, 'themes')
utilities.addFolderToQrc(f, 'sound')
utilities.addFolderToQrc(f, 'settings')
utilities.addFolderToQrc(f, 'sets')
utilities.addFolderToQrc(f, 'rules')
utilities.addFolderToQrc(f, 'player')
utilities.addFolderToQrc(f, 'packs')
utilities.addFolderToQrc(f, 'lang')
utilities.addFolderToQrc(f, 'graphics')
utilities.addFolderToQrc(f, 'campaigns')
utilities.addFolderToQrc(f, 'ai')
if rename:
os.rename('settings/options.txt', 'settings/options.orig.txt')
os.rename('player/options.txt', 'player/options.orig.txt')
f.seek(0,2)
f.write('</qresource>\n</RCC>\n')
f.close
print >> sys.stderr, 'Created Resource Package for Qt projects: {0}'.format( filename)
def createStandardResFile(filename): def createStandardResFile():
print('Creating Standard Resource File') print "Creating Standard Resource File"
if not filename:
filename = getFilename() + '.zip' filename = getFilename() + '.zip'
createResZipFile( filename ) createResZipFile( filename )
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename) print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)
def createIosResFile(filename): def createIosResFile():
print('Preparing Resource Package for iOS') print 'Preparing Resource Package for iOS'
utilities = ZipUtilities() utilities = ZipUtilities()
if not filename:
filename = getFilename() + '_iOS.zip' filename = getFilename() + '_iOS.zip'
#createResZipFile( filename ) #createResZipFile( filename )
zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED) zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED)
@@ -80,29 +111,45 @@ class ZipUtilities:
if file != '.svn': if file != '.svn':
full_path = os.path.join(folder, file) full_path = os.path.join(folder, file)
if os.path.isfile(full_path): if os.path.isfile(full_path):
print('File added: ' + str(full_path)) print 'File added: ' + str(full_path)
zip_file.write(full_path) zip_file.write(full_path)
elif os.path.isdir(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) self.addFolderToZip(zip_file, full_path)
def addFolderToQrc(self, qrc, folder):
qrc.seek(0,2)
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)
qrc.write('<file>')
qrc.write(full_path)
qrc.write('</file>\n')
elif os.path.isdir(full_path):
print 'Entering folder: ' + str(full_path)
self.addFolderToQrc(qrc, full_path)
def main(): def main():
## using optparse instead of argParse for now since python 2.7 may not be installed. ## using optparse instead of argParse for now since python 2.7 may not be installed.
parser = OptionParser() parser = OptionParser()
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform") parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg qt, 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() (options, args) = parser.parse_args()
if (options.platform): if (options.platform):
if (options.platform == "ios"): print "reading %s..." % options.platform
createIosResFile(options.name) if (options.platform == 'ios'):
createIosResFile()
elif (options.platform == 'qt'):
createQrcFile()
else: else:
createStandardResFile(options.name) createStandardResFile()
else: else:
createStandardResFile(options.name) createStandardResFile()
if __name__ == "__main__": if __name__ == "__main__":
main() main()
-846
View File
@@ -1,846 +0,0 @@
[meta]
author=Wagic Team
name=Born of the Gods
year=2014
block=Theros
[/meta]
[card]
primitive=Acolyte's Reward
id=378373
rarity=U
[/card]
[card]
primitive=Aerie Worshippers
id=378402
rarity=U
[/card]
[card]
primitive=Akroan Conscriptor
id=378459
rarity=U
[/card]
[card]
primitive=Akroan Phalanx
id=378374
rarity=U
[/card]
[card]
primitive=Akroan Skyguard
id=378375
rarity=C
[/card]
[card]
primitive=Arbiter of the Ideal
id=378403
rarity=R
[/card]
[card]
primitive=Archetype of Aggression
id=378460
rarity=U
[/card]
[card]
primitive=Archetype of Courage
id=378376
rarity=U
[/card]
[card]
primitive=Archetype of Endurance
id=378488
rarity=U
[/card]
[card]
primitive=Archetype of Finality
id=378430
rarity=U
[/card]
[card]
primitive=Archetype of Imagination
id=378404
rarity=U
[/card]
[card]
primitive=Ashiok's Adept
id=378431
rarity=U
[/card]
[card]
primitive=Aspect of Hydra
id=378489
rarity=C
[/card]
[card]
primitive=Asphyxiate
id=378432
rarity=C
[/card]
[card]
primitive=Astral Cornucopia
id=378529
rarity=R
[/card]
[card]
primitive=Bile Blight
id=378433
rarity=U
[/card]
[card]
primitive=Black Oak of Odunos
id=378434
rarity=U
[/card]
[card]
primitive=Bolt of Keranos
id=378461
rarity=C
[/card]
[card]
primitive=Brimaz, King of Oreskos
id=378377
rarity=M
[/card]
[card]
primitive=Champion of Stray Souls
id=378435
rarity=M
[/card]
[card]
primitive=Charging Badger
id=378490
rarity=C
[/card]
[card]
primitive=Chorus of the Tides
id=378405
rarity=C
[/card]
[card]
primitive=Chromanticore
id=378516
rarity=M
[/card]
[card]
primitive=Claim of Erebos
id=378436
rarity=C
[/card]
[card]
primitive=Courser of Kruphix
id=378491
rarity=R
[/card]
[card]
primitive=Crypsis
id=378406
rarity=C
[/card]
[card]
primitive=Culling Mark
id=378492
rarity=C
[/card]
[card]
primitive=Cyclops of One-Eyed Pass
id=378462
rarity=C
[/card]
[card]
primitive=Dawn to Dusk
id=378378
rarity=U
[/card]
[card]
primitive=Deepwater Hypnotist
id=378407
rarity=C
[/card]
[card]
primitive=Divination
id=378408
rarity=C
[/card]
[card]
primitive=Drown in Sorrow
id=378437
rarity=U
[/card]
[card]
primitive=Eater of Hope
id=378438
rarity=R
[/card]
[card]
primitive=Eidolon of Countless Battles
id=378379
rarity=R
[/card]
[card]
primitive=Elite Skirmisher
id=378380
rarity=C
[/card]
[card]
primitive=Ephara, God of the Polis
id=378517
rarity=M
[/card]
[card]
primitive=Ephara's Enlightenment
id=378518
rarity=U
[/card]
[card]
primitive=Ephara's Radiance
id=378381
rarity=C
[/card]
[card]
primitive=Epiphany Storm
id=378463
rarity=C
[/card]
[card]
primitive=Eternity Snare
id=378409
rarity=U
[/card]
[card]
primitive=Evanescent Intellect
id=378410
rarity=C
[/card]
[card]
primitive=Everflame Eidolon
id=378464
rarity=U
[/card]
[card]
primitive=Excoriate
id=378382
rarity=C
[/card]
[card]
primitive=Eye Gouge
id=378439
rarity=C
[/card]
[card]
primitive=Fall of the Hammer
id=378465
rarity=C
[/card]
[card]
primitive=Fanatic of Xenagos
id=378519
rarity=U
[/card]
[card]
primitive=Fate Unraveler
id=378440
rarity=R
[/card]
[card]
primitive=Fated Conflagration
id=378466
rarity=R
[/card]
[card]
primitive=Fated Infatuation
id=378411
rarity=R
[/card]
[card]
primitive=Fated Intervention
id=378493
rarity=R
[/card]
[card]
primitive=Fated Retribution
id=378383
rarity=R
[/card]
[card]
primitive=Fated Return
id=378441
rarity=R
[/card]
[card]
primitive=Fearsome Temper
id=378467
rarity=C
[/card]
[card]
primitive=Felhide Brawler
id=378442
rarity=C
[/card]
[card]
primitive=Felhide Spiritbinder
id=378468
rarity=R
[/card]
[card]
primitive=Flame-Wreathed Phoenix
id=378469
rarity=M
[/card]
[card]
primitive=Flitterstep Eidolon
id=378412
rarity=U
[/card]
[card]
primitive=Floodtide Serpent
id=378413
rarity=C
[/card]
[card]
primitive=Forgestoker Dragon
id=378470
rarity=R
[/card]
[card]
primitive=Forlorn Pseudamma
id=378443
rarity=U
[/card]
[card]
primitive=Forsaken Drifters
id=378444
rarity=U
[/card]
[card]
primitive=Ghostblade Eidolon
id=378384
rarity=U
[/card]
[card]
primitive=Gild
id=378445
rarity=R
[/card]
[card]
primitive=Gold
id=-378445
rarity=T
[/card]
[card]
primitive=Glimpse the Sun God
id=378385
rarity=U
[/card]
[card]
primitive=God-Favored General
id=378386
rarity=U
[/card]
[card]
primitive=Gorgon's Head
id=378530
rarity=U
[/card]
[card]
primitive=Graverobber Spider
id=378494
rarity=U
[/card]
[card]
primitive=Great Hart
id=378387
rarity=C
[/card]
[card]
primitive=Griffin Dreamfinder
id=378388
rarity=C
[/card]
[card]
primitive=Grisly Transformation
id=378446
rarity=C
[/card]
[card]
primitive=Herald of Torment
id=378447
rarity=R
[/card]
[card]
primitive=Hero of Iroas
id=378389
rarity=R
[/card]
[card]
primitive=Hero of Leina Tower
id=378495
rarity=R
[/card]
[card]
primitive=Heroes' Podium
id=378531
rarity=R
[/card]
[card]
primitive=Hold at Bay
id=378390
rarity=C
[/card]
[card]
primitive=Hunter's Prowess
id=378496
rarity=R
[/card]
[card]
primitive=Impetuous Sunchaser
id=378471
rarity=C
[/card]
[card]
primitive=Karametra, God of Harvests
id=378520
rarity=M
[/card]
[card]
primitive=Karametra's Favor
id=378497
rarity=C
[/card]
[card]
primitive=Kiora, the Crashing Wave
id=378521
rarity=M
[/card]
[card]
primitive=Kiora's Prevention
id=37852101
rarity=T
[/card]
[card]
primitive=Kiora's Kraken
id=-378521
rarity=T
[/card]
[card]
primitive=Kiora's Follower
id=378522
rarity=U
[/card]
[card]
primitive=Kragma Butcher
id=378472
rarity=C
[/card]
[card]
primitive=Kraken of the Straits
id=378414
rarity=U
[/card]
[card]
primitive=Lightning Volley
id=378473
rarity=U
[/card]
[card]
primitive=Loyal Pegasus
id=378391
rarity=C
[/card]
[card]
primitive=Marshmist Titan
id=378448
rarity=C
[/card]
[card]
primitive=Meletis Astronomer
id=378415
rarity=U
[/card]
[card]
primitive=Mindreaver
id=378416
rarity=R
[/card]
[card]
primitive=Mischief and Mayhem
id=378498
rarity=U
[/card]
[card]
primitive=Mogis, God of Slaughter
id=378523
rarity=M
[/card]
[card]
primitive=Mortal's Ardor
id=378392
rarity=C
[/card]
[card]
primitive=Mortal's Resolve
id=378499
rarity=C
[/card]
[card]
primitive=Necrobite
id=378449
rarity=C
[/card]
[card]
primitive=Nessian Demolok
id=378500
rarity=U
[/card]
[card]
primitive=Nessian Wilds Ravager
id=378501
rarity=R
[/card]
[card]
primitive=Noble Quarry
id=378502
rarity=U
[/card]
[card]
primitive=Nullify
id=378417
rarity=C
[/card]
[card]
primitive=Nyxborn Eidolon
id=378450
rarity=C
[/card]
[card]
primitive=Nyxborn Rollicker
id=378474
rarity=C
[/card]
[card]
primitive=Nyxborn Shieldmate
id=378393
rarity=C
[/card]
[card]
primitive=Nyxborn Triton
id=378418
rarity=C
[/card]
[card]
primitive=Nyxborn Wolf
id=378503
rarity=C
[/card]
[card]
primitive=Odunos River Trawler
id=378451
rarity=U
[/card]
[card]
primitive=Oracle of Bones
id=378475
rarity=R
[/card]
[card]
primitive=Oracle's Insight
id=378419
rarity=U
[/card]
[card]
primitive=Oreskos Sun Guide
id=378394
rarity=C
[/card]
[card]
primitive=Ornitharch
id=378395
rarity=U
[/card]
[card]
primitive=Pain Seer
id=378452
rarity=R
[/card]
[card]
primitive=Peregrination
id=378504
rarity=U
[/card]
[card]
primitive=Perplexing Chimera
id=378420
rarity=R
[/card]
[card]
primitive=Pharagax Giant
id=378476
rarity=C
[/card]
[card]
primitive=Phenax, God of Deception
id=378524
rarity=M
[/card]
[card]
primitive=Pheres-Band Raiders
id=378505
rarity=U
[/card]
[card]
primitive=Pheres-Band Tromper
id=378506
rarity=C
[/card]
[card]
primitive=Pillar of War
id=378532
rarity=U
[/card]
[card]
primitive=Pinnacle of Rage
id=378477
rarity=U
[/card]
[card]
primitive=Plea for Guidance
id=378396
rarity=R
[/card]
[card]
primitive=Ragemonger
id=378525
rarity=U
[/card]
[card]
primitive=Raised by Wolves
id=378507
rarity=U
[/card]
[card]
primitive=Reap what is Sown
id=378526
rarity=U
[/card]
[card]
primitive=Reckless Reveler
id=378478
rarity=C
[/card]
[card]
primitive=Retraction Helix
id=378421
rarity=C
[/card]
[card]
primitive=Revoke Existence
id=378397
rarity=C
[/card]
[card]
primitive=Rise to the Challenge
id=378479
rarity=C
[/card]
[card]
primitive=Sanguimancy
id=378453
rarity=U
[/card]
[card]
primitive=Satyr Firedancer
id=378480
rarity=R
[/card]
[card]
primitive=Satyr Nyx-Smith
id=378481
rarity=U
[/card]
[card]
primitive=Satyr Wayfinder
id=378508
rarity=C
[/card]
[card]
primitive=Scourge of Skola Vale
id=378509
rarity=R
[/card]
[card]
primitive=Scouring Sands
id=378482
rarity=C
[/card]
[card]
primitive=Searing Blood
id=378483
rarity=U
[/card]
[card]
primitive=Servant of Tymaret
id=378454
rarity=C
[/card]
[card]
primitive=Setessan Oathsworn
id=378510
rarity=C
[/card]
[card]
primitive=Setessan Starbreaker
id=378511
rarity=C
[/card]
[card]
primitive=Shrike Harpy
id=378455
rarity=U
[/card]
[card]
primitive=Silent Sentinel
id=378398
rarity=R
[/card]
[card]
primitive=Siren of the Fanged Coast
id=378422
rarity=U
[/card]
[card]
primitive=Siren of the Silent Song
id=378527
rarity=U
[/card]
[card]
primitive=Siren Song Lyre
id=378533
rarity=U
[/card]
[card]
primitive=Skyreaping
id=378512
rarity=U
[/card]
[card]
primitive=Snake of the Golden Grove
id=378513
rarity=C
[/card]
[card]
primitive=Sphinx's Disciple
id=378423
rarity=C
[/card]
[card]
primitive=Spirit of the Labyrinth
id=378399
rarity=R
[/card]
[card]
primitive=Spiteful Returned
id=378456
rarity=U
[/card]
[card]
primitive=Springleaf Drum
id=378534
rarity=U
[/card]
[card]
primitive=Stormcaller of Keranos
id=378484
rarity=U
[/card]
[card]
primitive=Stratus Walk
id=378424
rarity=C
[/card]
[card]
primitive=Sudden Storm
id=378425
rarity=C
[/card]
[card]
primitive=Sunbond
id=378400
rarity=U
[/card]
[card]
primitive=Swordwise Centaur
id=378514
rarity=C
[/card]
[card]
primitive=Temple of Enlightenment
id=378535
rarity=R
[/card]
[card]
primitive=Temple of Malice
id=378536
rarity=R
[/card]
[card]
primitive=Temple of Plenty
id=378537
rarity=R
[/card]
[card]
primitive=Thassa's Rebuff
id=378426
rarity=U
[/card]
[card]
primitive=Thunder Brute
id=378485
rarity=U
[/card]
[card]
primitive=Thunderous Might
id=378486
rarity=U
[/card]
[card]
primitive=Tromokratis
id=378427
rarity=R
[/card]
[card]
primitive=Unravel the AEther
id=378515
rarity=U
[/card]
[card]
primitive=Vanguard of Brimaz
id=378401
rarity=U
[/card]
[card]
primitive=Vortex Elemental
id=378428
rarity=U
[/card]
[card]
primitive=Warchanter of Mogis
id=378457
rarity=C
[/card]
[card]
primitive=Weight of the Underworld
id=378458
rarity=C
[/card]
[card]
primitive=Whelming Wave
id=378429
rarity=R
[/card]
[card]
primitive=Whims of the Fates
id=378487
rarity=R
[/card]
[card]
primitive=Xenagos, God of Revels
id=378528
rarity=M
[/card]
File diff suppressed because it is too large Load Diff
-4
View File
@@ -204,7 +204,6 @@ brass_man.txt
brass_man_i161.txt brass_man_i161.txt
briarhorn.txt briarhorn.txt
bringer_of_the_red_dawn.txt bringer_of_the_red_dawn.txt
buyback.txt
cage_of_hands.txt cage_of_hands.txt
Call_to_Heel_1.txt Call_to_Heel_1.txt
Call_to_Heel_2.txt Call_to_Heel_2.txt
@@ -309,9 +308,6 @@ evil_presence3.txt
evil_presence_i647.txt evil_presence_i647.txt
evil_presence_i647_2.txt evil_presence_i647_2.txt
exaltedsourcekilled.txt exaltedsourcekilled.txt
executioners_swing.txt
executioners_swing2.txt
executioners_swing3.txt
explore.txt explore.txt
Faceless_Butcher.txt Faceless_Butcher.txt
fading.txt fading.txt
-30
View File
@@ -1,30 +0,0 @@
# 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]
@@ -1,42 +0,0 @@
#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]
@@ -1,42 +0,0 @@
#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]
@@ -1,34 +0,0 @@
#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]
-24
View File
@@ -1,24 +0,0 @@
#Testing Griselbrand with the new specific life cost {L:7}
#Player has 8 life and you cannot use the ability the second time if you cannot pay life.
#Must change griselbrand code to {L:7}:draw:7 instead of {L}{L}{L}{L}{L}{L}{L}:draw:7
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:Griselbrand
life:8
library:forest,forest,forest,forest,forest,forest,forest,plains,mountain,mountain,mountain,mountain,mountain,mountain,island
[PLAYER2]
life:20
[DO]
Griselbrand
Griselbrand
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:Griselbrand
life:1
hand:mountain,mountain,mountain,mountain,mountain,mountain,island
library:forest,forest,forest,forest,forest,forest,forest,plains
[PLAYER2]
life:20
[END]
@@ -1,38 +0,0 @@
#Testing guild keyword gruul for Xenagos, God of Revels. You must have Born of the gods set (BNG)
#[card]
#name=Xenagos, God of Revels
#abilities=indestructible
#auto=@each my combatbegins:name(haste and +x/+x) target(other creature|mybattlefield) transforms((,newability[haste],newability[power/power])) ueot
#auto=this(variable{gruul}>6) transforms((Creature))
#text=Indestructible -- As long as your devotion to red and green is less than seven, Xenagos isn't a creature. -- At the beginning of combat on your turn, another target creature you control gains haste and gets +X/+X until end of turn, where X is that creature's power.
#mana={3}{R}{G}
#type=Legendary Enchantment
#subtype=God
#power=6
#toughness=5
#[/card]
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:378528
hand:19869
life:20
manapool:{G}{G}{G}{G}{G}
[PLAYER2]
life:20
[DO]
19869
next
choice 0
19869
next
19869
eot
[ASSERT]
UNTAP
[PLAYER1]
inplay:378528,19869
life:20
[PLAYER2]
life:12
[END]
-73
View File
@@ -1,73 +0,0 @@
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()
+1 -3
View File
@@ -90,9 +90,7 @@ Author: Michael Nguyen
#define WAGIC_RESOURCE_VERSION VERSION_FILE(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR) #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_VERSION_STRING VERSION_STRINGIFY(WAGIC_VERSION)
#define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION) #define WAGIC_CORE_VERSION_STRING "core_" VERSION_STRINGIFY(WAGIC_RESOURCE_VERSION)
#define WAGIC_RESOURCE_NAME "Wagic-core.zip" #define WAGIC_RESOURCE_NAME WAGIC_CORE_VERSION_STRING ".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 #endif
+1 -1
View File
@@ -72,7 +72,7 @@ public:
} }
Interruptible(GameObserver* observer, int inID = 0, bool hasFocus = false) Interruptible(GameObserver* observer, int inID = 0, bool hasFocus = false)
: PlayGuiObject(40, 0.0f, 0.0f, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL) : PlayGuiObject(40, x, y, inID, hasFocus), Targetable(observer), state(NOT_RESOLVED), display(0), source(NULL)
{ {
} }
-200
View File
@@ -172,206 +172,6 @@ private:
{ {
intValue = target->getManaCost()->getConvertedCost(); intValue = target->getManaCost()->getConvertedCost();
} }
else if (s == "azorius")//devotion blue white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "boros")//devotion red white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 3);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "dimir")//devotion blue black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "golgari")//devotion to green black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "gruul")//devotion to green red
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 3);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "izzet")//devotion to red blue
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 3);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "orzhov")//devotion to white black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 4);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "rakdos")//devotion to red black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 3);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "selesnya")//devotion to green white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "simic")//devotion to green blue
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 2);
}
}
}
SAFE_DELETE(dtc);
}
else if (s.find("type:") != string::npos) else if (s.find("type:") != string::npos)
{ {
size_t begins = s.find("type:"); size_t begins = s.find("type:");
-1
View File
@@ -64,7 +64,6 @@ class CardDescriptor: public MTGCardInstance
string compareName; string compareName;
int CDopponentDamaged; int CDopponentDamaged;
int CDcontrollerDamaged; int CDcontrollerDamaged;
int CDdamager;
}; };
#endif #endif
+13
View File
@@ -0,0 +1,13 @@
#ifndef _EFFECTS_H_
#define _EFFECTS_H_
#include <JGui.h>
class Effect: public JGuiObject
{
static int id_counter;
public:
Effect() : JGuiObject(++id_counter) {};
};
#endif // _EFFECTS_H_
-13
View File
@@ -90,19 +90,6 @@ public:
virtual LifeCost * clone() const; virtual LifeCost * clone() const;
}; };
//Specific life cost
class SpecificLifeCost : public ExtraCost
{
private:
int slc;
public:
SpecificLifeCost(TargetChooser *_tc = NULL, int slc = 0);
virtual int canPay();
virtual int doPay();
virtual SpecificLifeCost * clone() const;
};
//phyrexian mana //phyrexian mana
class LifeorManaCost : public ExtraCost class LifeorManaCost : public ExtraCost
{ {
-1
View File
@@ -65,7 +65,6 @@ public:
bool wasDealtDamage; bool wasDealtDamage;
bool damageToOpponent; bool damageToOpponent;
bool damageToController; bool damageToController;
bool damageToCreature;
bool mPropertiesChangedSinceLastUpdate; bool mPropertiesChangedSinceLastUpdate;
int reduxamount; int reduxamount;
int flanked; int flanked;
+2
View File
@@ -12,6 +12,7 @@
#define GUI_OPPONENTHAND 5 #define GUI_OPPONENTHAND 5
#include <JGui.h> #include <JGui.h>
#include "Effects.h"
#include "WEvent.h" #include "WEvent.h"
#include "Pos.h" #include "Pos.h"
@@ -64,6 +65,7 @@ public:
} }
; ;
virtual ~PlayGuiObject() {}; virtual ~PlayGuiObject() {};
vector<Effect*> effects;
}; };
#endif #endif
+1 -3
View File
@@ -4723,15 +4723,14 @@ void AVanishing::Update(float dt)
int AVanishing::resolve() int AVanishing::resolve()
{ {
return 1; return 1;
} }
const string AVanishing::getMenuText() const string AVanishing::getMenuText()
{ {
if(counterName.find("fade") != string::npos) if(counterName.find("fade") != string::npos)
{
return "Fading"; return "Fading";
}
return "Vanishing"; return "Vanishing";
} }
@@ -5704,7 +5703,6 @@ void ATutorialMessage::Update(float dt)
mElapsed += dt; mElapsed += dt;
if(!mUserCloseRequest)
IconButtonsController::Update(dt); IconButtonsController::Update(dt);
if (mIsImage) if (mIsImage)
+4 -16
View File
@@ -23,7 +23,6 @@ CardDescriptor::CardDescriptor()
colorComparisonMode = COMPARISON_NONE; colorComparisonMode = COMPARISON_NONE;
CDopponentDamaged = 0; CDopponentDamaged = 0;
CDcontrollerDamaged = 0; CDcontrollerDamaged = 0;
CDdamager = 0;
} }
int CardDescriptor::init() int CardDescriptor::init()
@@ -227,27 +226,16 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
{ {
match = NULL; match = NULL;
} }
if ((CDdamager == -1 && (card->damageToOpponent || card->damageToController || card->damageToCreature))
|| (CDdamager == 1 && !(card->damageToOpponent || card->damageToController || card->damageToCreature)))
{
match = NULL;
}
if(CDopponentDamaged == -1 || CDopponentDamaged == 1) if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
{ {
Player * p = card->controller()->opponent();//controller()->opponent(); Player * p = card->controller()->opponent();//controller()->opponent();
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p) if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p) || (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()))
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent())
|| (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
{ {
match = NULL; match = NULL;
} }
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p) if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p) || (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()))
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent())
|| (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent()))
{ {
match = NULL; match = NULL;
} }
-12
View File
@@ -1224,18 +1224,6 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
cd.CDcontrollerDamaged = 1; 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) else if (attribute.find("multicolor") != string::npos)
{ {
//card is multicolored? //card is multicolored?
+1 -3
View File
@@ -192,10 +192,8 @@ int Damage::resolve()
//return the left over amount after effects have been applied to them. //return the left over amount after effects have been applied to them.
a = target->dealDamage(damage); a = target->dealDamage(damage);
target->damageCount += damage;//the amount must be the actual damage so i changed this from 1 to damage, this fixes pdcount and odcount 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*)target)->wasDealtDamage = true;
((MTGCardInstance*)source)->damageToCreature = true;
}
if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER) if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
{ {
if(target == source->controller()) if(target == source->controller())
+3
View File
@@ -0,0 +1,3 @@
#include "../include/Effects.h"
int Effect::id_counter = 0;
-38
View File
@@ -151,44 +151,6 @@ int LifeCost::doPay()
return 1; return 1;
} }
//Specific life cost
SpecificLifeCost * SpecificLifeCost::clone() const
{
SpecificLifeCost * ec = NEW SpecificLifeCost(*this);
if (tc)
ec->tc = tc->clone();
return ec;
}
SpecificLifeCost::SpecificLifeCost(TargetChooser *_tc, int slc)
: ExtraCost("Life", _tc), slc(slc)
{
}
int SpecificLifeCost::canPay()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if(_target->controller()->life >= slc)
{
return 1;
}
return 0;
}
int SpecificLifeCost::doPay()
{
if (!target)
return 0;
MTGCardInstance * _target = (MTGCardInstance *) target;
_target->controller()->loseLife(slc);
target = NULL;
if (tc)
tc->initTargets();
return 1;
}
//life or Mana cost //life or Mana cost
LifeorManaCost * LifeorManaCost::clone() const LifeorManaCost * LifeorManaCost::clone() const
{ {
-1
View File
@@ -795,7 +795,6 @@ void GameObserver::gameStateBasedEffects()
c->wasDealtDamage = false; c->wasDealtDamage = false;
c->damageToController = false; c->damageToController = false;
c->damageToOpponent = false; c->damageToOpponent = false;
c->damageToCreature = false;
c->isAttacking = NULL; c->isAttacking = NULL;
} }
for (int t = 0; t < nbcards; t++) for (int t = 0; t < nbcards; t++)
+1 -1
View File
@@ -1843,7 +1843,7 @@ int Tournament::getRandomDeck(bool noEasyDecks)
DeckManager *deckManager = DeckManager::GetInstance(); DeckManager *deckManager = DeckManager::GetInstance();
vector<DeckMetaData *> *deckList = deckManager->getAIDeckOrderList(); vector<DeckMetaData *> *deckList = deckManager->getAIDeckOrderList();
int deckNumber; int deckNumber=0;
unsigned int random=0; unsigned int random=0;
int k=0; int k=0;
bool isDouble=true; bool isDouble=true;
+8 -8
View File
@@ -300,12 +300,12 @@ string GameStateMenu::loadRandomWallpaper()
return wallpaper; return wallpaper;
vector<string> wallpapers; vector<string> wallpapers;
izfstream file; JFile* jFile = JFileSystem::GetInstance()->OpenFile("graphics/wallpapers.txt");
if (! JFileSystem::GetInstance()->openForRead(file, "graphics/wallpapers.txt")) if (!jFile)
return wallpaper; return wallpaper;
string s; string s;
while (std::getline(file, s)) while (JFileSystem::GetInstance()->ReadFileLine(jFile, s))
{ {
if (!s.size()) if (!s.size())
continue; continue;
@@ -313,7 +313,7 @@ string GameStateMenu::loadRandomWallpaper()
s.erase(s.size() - 1); //Handle DOS files s.erase(s.size() - 1); //Handle DOS files
wallpapers.push_back(s); wallpapers.push_back(s);
} }
file.close(); JFileSystem::GetInstance()->CloseFile(jFile);
int rnd = rand() % (wallpapers.size()); int rnd = rand() % (wallpapers.size());
wallpaper = wallpapers[rnd]; wallpaper = wallpapers[rnd];
@@ -352,21 +352,21 @@ void GameStateMenu::loadLangMenu()
vector<string> langFiles = JFileSystem::GetInstance()->scanfolder("lang/"); vector<string> langFiles = JFileSystem::GetInstance()->scanfolder("lang/");
for (size_t i = 0; i < langFiles.size(); ++i) for (size_t i = 0; i < langFiles.size(); ++i)
{ {
izfstream file;
string filePath = "lang/"; string filePath = "lang/";
filePath.append(langFiles[i]); filePath.append(langFiles[i]);
if (! JFileSystem::GetInstance()->openForRead(file, filePath)) JFile* jFile = JFileSystem::GetInstance()->OpenFile(filePath);
if (!jFile)
continue; continue;
string s; string s;
string lang; string lang;
if (std::getline(file, s)) if (JFileSystem::GetInstance()->ReadFileLine(jFile, s))
{ {
lang = getLang(s); lang = getLang(s);
} }
file.close(); JFileSystem::GetInstance()->CloseFile(jFile);
if (lang.size()) if (lang.size())
{ {
+12 -17
View File
@@ -215,39 +215,34 @@ void GameStateOptions::Render()
const char * const CreditsText[] = { const char * const CreditsText[] = {
"Wagic, The Homebrew?! by Wololo", "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", "Many thanks to the people who help this project",
"", "",
"", "",
"Art:", "Art: Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha",
"Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha",
"Check themeinfo.txt for the full credits of each theme!", "Check themeinfo.txt for the full credits of each theme!",
"", "",
"Dev Team:", "Dev Team:",
"Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat, J, Jeck,", "Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat,",
"kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen, Psyringe,", "J, Jeck, kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen,",
"Rolzad73, Salmelo, Superhiro, Wololo, Yeshua, Zethfox", "Psyringe, Salmelo, Superhiro, Wololo, Yeshua, Zethfox",
"", "",
"Music by Celestial Aeon Project, http://www.jamendo.com", "Music by Celestial Aeon Project, http://www.jamendo.com",
"", "",
"Deck Builders:", "Deck Builders: Abrasax, AzureKnight, colarchon",
"Abrasax, AzureKnight, colarchon, Excessum, Hehotfarv,", "Excessum, Hehotfarv, Jeremy, Jog1118, JonyAS",
"Jeremy, Jog1118, JonyAS, Lachaux, Link17, Muddobbers,", "Lachaux, Link17, Muddobbers, Nakano, Niegen",
"Nakano, Niegen, Kaioshin, Psyringe, r1c47, Superhiro,", "Kaioshin, Psyringe, r1c47, Superhiro, Szei",
"Szei, Thanatos02, Whismer, Wololo", "Thanatos02, Whismer, Wololo",
"", "",
"Thanks also go to Dr.Watson, Orine, Raphael, Sakya, Tyranid", "Thanks also go to Dr.Watson, Orine, Raphael, Sakya, Tyranid",
"for their help.", "for their help.",
"", "",
"Thanks to everyone who contributes code/content on the forums!", "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", "SFX From www.soundsnap.com",
"", "",
"", "",
"This work is not related to or endorsed by Wizards of the Coast, Inc", "This work is not related to or endorsed by Wizards of the Coast, Inc",
-1
View File
@@ -4284,7 +4284,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
} }
else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] > 0) 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); zones->putInZone(card, zones->stack, Endzones->hand);
} }
else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_FLASHBACK] > 0) else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_FLASHBACK] > 0)
-1
View File
@@ -158,7 +158,6 @@ void MTGCardInstance::initMTGCI()
auras = 0; auras = 0;
damageToOpponent = false; damageToOpponent = false;
damageToController = false; damageToController = false;
damageToCreature = false;
wasDealtDamage = false; wasDealtDamage = false;
isDualWielding = false; isDualWielding = false;
suspended = false; suspended = false;
+5 -5
View File
@@ -399,8 +399,8 @@ int MTGAllCards::load(const string &config_file, int set_id)
int lineNumber = 0; int lineNumber = 0;
std::string contents; std::string contents;
izfstream file; JFile* jFile = JFileSystem::GetInstance()->OpenFile(config_file);
if (!JFileSystem::GetInstance()->openForRead(file, config_file)) if (!jFile)
{ {
DebugTrace("MTGAllCards::load: error loading: " << config_file); DebugTrace("MTGAllCards::load: error loading: " << config_file);
return total_cards; return total_cards;
@@ -408,7 +408,7 @@ int MTGAllCards::load(const string &config_file, int set_id)
string s; string s;
while (getline(file,s)) while (JFileSystem::GetInstance()->ReadFileLine(jFile, s))
{ {
lineNumber++; lineNumber++;
if (!s.size()) continue; if (!s.size()) continue;
@@ -448,7 +448,7 @@ int MTGAllCards::load(const string &config_file, int set_id)
if (!maxGrade) maxGrade = Constants::GRADE_BORDERLINE; //Default setting for grade is borderline? if (!maxGrade) maxGrade = Constants::GRADE_BORDERLINE; //Default setting for grade is borderline?
if (fileGrade > maxGrade) if (fileGrade > maxGrade)
{ {
file.close(); JFileSystem::GetInstance()->CloseFile(jFile);
return total_cards; return total_cards;
} }
} }
@@ -480,7 +480,7 @@ int MTGAllCards::load(const string &config_file, int set_id)
continue; continue;
} }
} }
file.close(); JFileSystem::GetInstance()->CloseFile(jFile);
return total_cards; return total_cards;
} }
+1 -10
View File
@@ -159,19 +159,10 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
{ //Mill to exile yourself as a cost (Library 2 Exile) { //Mill to exile yourself as a cost (Library 2 Exile)
manaCost->addExtraCost(NEW MillExileCost(tc)); manaCost->addExtraCost(NEW MillExileCost(tc));
} }
else if (value == "l") else
{ //Life cost { //Life cost
manaCost->addExtraCost(NEW LifeCost(tc)); manaCost->addExtraCost(NEW LifeCost(tc));
} }
else
{ //Specific Life cost
vector<string>valSplit = parseBetween(value,"l:"," ",false);
if (valSplit.size()) {
WParsedInt* lifetopay = NEW WParsedInt(valSplit[1], NULL, c);
manaCost->addExtraCost(NEW SpecificLifeCost(tc,lifetopay->getValue()));
SAFE_DELETE(lifetopay);
}
}
break; break;
case 'd': //DiscardRandom cost case 'd': //DiscardRandom cost
if (value == "d") if (value == "d")
+4 -4
View File
@@ -326,16 +326,16 @@ void OptionLanguage::Reload()
vector<string> langFiles = JFileSystem::GetInstance()->scanfolder("lang/"); vector<string> langFiles = JFileSystem::GetInstance()->scanfolder("lang/");
for (size_t i = 0; i < langFiles.size(); ++i) for (size_t i = 0; i < langFiles.size(); ++i)
{ {
izfstream file;
string filePath = "lang/"; string filePath = "lang/";
filePath.append(langFiles[i]); filePath.append(langFiles[i]);
if (! JFileSystem::GetInstance()->openForRead(file, filePath)) JFile* jFile = JFileSystem::GetInstance()->OpenFile(filePath);
if (!jFile)
continue; continue;
string s; string s;
string lang; string lang;
if (std::getline(file, s)) if (JFileSystem::GetInstance()->ReadFileLine(jFile, s))
{ {
if (!s.size()) if (!s.size())
{ {
@@ -352,7 +352,7 @@ void OptionLanguage::Reload()
lang = s.substr(6); lang = s.substr(6);
} }
} }
file.close(); JFileSystem::GetInstance()->CloseFile(jFile);
if (lang.size()) if (lang.size())
{ {
+4
View File
@@ -38,9 +38,13 @@ void PlayGuiObject::Update(float dt)
if (mHeight < defaultHeight) mHeight = defaultHeight; if (mHeight < defaultHeight) mHeight = defaultHeight;
} }
wave = (wave + 2 * (int) (100 * dt)) % 255; wave = (wave + 2 * (int) (100 * dt)) % 255;
for (vector<Effect*>::iterator it = effects.begin(); it != effects.end(); ++it)
(*it)->Update(dt);
Pos::Update(dt); Pos::Update(dt);
} }
void PlayGuiObject::Render() void PlayGuiObject::Render()
{ {
for (vector<Effect*>::iterator it = effects.begin(); it != effects.end(); ++it)
(*it)->Render();
} }
+5 -4
View File
@@ -599,16 +599,17 @@ bool StoryFlow::parse(string path)
JFileSystem *fileSystem = JFileSystem::GetInstance(); JFileSystem *fileSystem = JFileSystem::GetInstance();
if (!fileSystem) return false; if (!fileSystem) return false;
if (!fileSystem->OpenFile(path.c_str())) return false; JFile* jFile = fileSystem->OpenFile(path.c_str());
if (!jFile) return false;
int size = fileSystem->GetFileSize(); int size = fileSystem->GetFileSize(jFile);
char *xmlBuffer = NEW char[size]; char *xmlBuffer = NEW char[size];
fileSystem->ReadFile(xmlBuffer, size); fileSystem->ReadFile(jFile, xmlBuffer, size);
TiXmlDocument doc; TiXmlDocument doc;
doc.Parse(xmlBuffer); doc.Parse(xmlBuffer);
fileSystem->CloseFile(); fileSystem->CloseFile(jFile);
delete[] xmlBuffer; delete[] xmlBuffer;
for (TiXmlNode* node = doc.FirstChild(); node; node = node->NextSibling()) for (TiXmlNode* node = doc.FirstChild(); node; node = node->NextSibling())
-12
View File
@@ -485,18 +485,6 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
cd->CDcontrollerDamaged = 1; 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) else if (attribute.find("multicolor") != string::npos)
{ {
//card is multicolored? //card is multicolored?
+5 -4
View File
@@ -333,8 +333,9 @@ bool WCachedParticles::Attempt(const string& filename, int, int & error)
{ {
JFileSystem* fileSys = JFileSystem::GetInstance(); JFileSystem* fileSys = JFileSystem::GetInstance();
JFile* jFile = fileSys->OpenFile(WResourceManager::Instance()->graphicsFile(filename));
if (!fileSys->OpenFile(WResourceManager::Instance()->graphicsFile(filename))) if (!jFile)
{ {
error = CACHE_ERROR_404; error = CACHE_ERROR_404;
return false; return false;
@@ -345,12 +346,12 @@ bool WCachedParticles::Attempt(const string& filename, int, int & error)
particles = NEW hgeParticleSystemInfo; particles = NEW hgeParticleSystemInfo;
// We Skip reading the pointer as it may be larger than 4 bytes in the structure // We Skip reading the pointer as it may be larger than 4 bytes in the structure
void *dummyPointer; void *dummyPointer;
fileSys->ReadFile(&dummyPointer, 4); fileSys->ReadFile(jFile, &dummyPointer, 4);
// we're actually trying to read more than the file size now, but it's no problem. // we're actually trying to read more than the file size now, but it's no problem.
// Note that this fix is only to avoid the largest problems, filling a structure // Note that this fix is only to avoid the largest problems, filling a structure
// by directly reading a file, is really a bad idea ... // by directly reading a file, is really a bad idea ...
fileSys->ReadFile(&(particles->nEmission), sizeof(hgeParticleSystemInfo) - sizeof(void*)); fileSys->ReadFile(jFile, &(particles->nEmission), sizeof(hgeParticleSystemInfo) - sizeof(void*));
fileSys->CloseFile(); fileSys->CloseFile(jFile);
particles->sprite = NULL; particles->sprite = NULL;
error = CACHE_ERROR_NONE; error = CACHE_ERROR_NONE;
+21 -17
View File
@@ -171,20 +171,22 @@ WFont(inFontID), mTexture(0)
unsigned char height; unsigned char height;
} sizeStr = { 0, 0, 0 }; } sizeStr = { 0, 0, 0 };
if (!fileSys->OpenFile(engFileName)) return; JFile* jFile = fileSys->OpenFile(engFileName);
size = fileSys->GetFileSize(); if (!jFile) return;
size = fileSys->GetFileSize(jFile);
mStdFont = NEW u8[size]; mStdFont = NEW u8[size];
fileSys->ReadFile(mStdFont, size); fileSys->ReadFile(jFile, mStdFont, size);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
if (!fileSys->OpenFile(fontname)) return; jFile = fileSys->OpenFile(fontname);
fileSys->ReadFile(&sizeStr, 4); // Works only for little-endian machines (PSP and PC are) if (!jFile) return;
fileSys->ReadFile(jFile, &sizeStr, 4); // Works only for little-endian machines (PSP and PC are)
size = sizeStr.chars * sizeStr.width * sizeStr.height / 2; size = sizeStr.chars * sizeStr.width * sizeStr.height / 2;
mExtraFont = NEW u8[size]; // 4 bits for a pixel mExtraFont = NEW u8[size]; // 4 bits for a pixel
mIndex = NEW u16[65536]; mIndex = NEW u16[65536];
fileSys->ReadFile(mIndex, 65536 * sizeof(u16)); fileSys->ReadFile(jFile, mIndex, 65536 * sizeof(u16));
fileSys->ReadFile(mExtraFont, size); fileSys->ReadFile(jFile, mExtraFont, size);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
mColor0 = ARGB(255, 255, 255, 255); mColor0 = ARGB(255, 255, 255, 255);
mColor = mColor0; mColor = mColor0;
@@ -612,17 +614,19 @@ WGBKFont::WGBKFont(int inFontID, const char *fontname, int lineheight, bool) :
JFileSystem *fileSys = JFileSystem::GetInstance(); JFileSystem *fileSys = JFileSystem::GetInstance();
int size = 0; int size = 0;
if (!fileSys->OpenFile(fontname)) return; JFile* jFile = fileSys->OpenFile(fontname);
size = fileSys->GetFileSize(); if (!jFile) return;
size = fileSys->GetFileSize(jFile);
mExtraFont = NEW u8[size]; mExtraFont = NEW u8[size];
fileSys->ReadFile(mExtraFont, size); fileSys->ReadFile(jFile, mExtraFont, size);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
if (!fileSys->OpenFile(engFileName)) return; jFile = fileSys->OpenFile(engFileName);
size = fileSys->GetFileSize(); if (!jFile) return;
size = fileSys->GetFileSize(jFile);
mStdFont = NEW u8[size]; mStdFont = NEW u8[size];
fileSys->ReadFile(mStdFont, size); fileSys->ReadFile(jFile, mStdFont, size);
fileSys->CloseFile(); fileSys->CloseFile(jFile);
mIndex = 0; mIndex = 0;
+1
View File
@@ -493,6 +493,7 @@
<ClInclude Include="include\DeckView.h" /> <ClInclude Include="include\DeckView.h" />
<ClInclude Include="include\DuelLayers.h" /> <ClInclude Include="include\DuelLayers.h" />
<ClInclude Include="include\Easing.h" /> <ClInclude Include="include\Easing.h" />
<ClInclude Include="include\Effects.h" />
<ClInclude Include="include\ExtraCost.h" /> <ClInclude Include="include\ExtraCost.h" />
<ClInclude Include="include\GameApp.h" /> <ClInclude Include="include\GameApp.h" />
<ClInclude Include="include\GameObserver.h" /> <ClInclude Include="include\GameObserver.h" />
+3
View File
@@ -417,6 +417,9 @@
<ClInclude Include="include\DuelLayers.h"> <ClInclude Include="include\DuelLayers.h">
<Filter>inc</Filter> <Filter>inc</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\Effects.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="include\ExtraCost.h"> <ClInclude Include="include\ExtraCost.h">
<Filter>inc</Filter> <Filter>inc</Filter>
</ClInclude> </ClInclude>
+4 -5
View File
@@ -5,7 +5,7 @@ addExclusiveBuilds(graphics, Graphics, console, Console)
INCLUDEPATH += ../../JGE/include/qt INCLUDEPATH += ../../JGE/include/qt
CONFIG(console, graphics|console){ CONFIG(console, graphics|console){
QT += core network multimedia QT += core network
QT -= gui QT -= gui
DEFINES += CONSOLE_CONFIG DEFINES += CONSOLE_CONFIG
@@ -15,9 +15,10 @@ CONFIG(console, graphics|console){
} }
else:CONFIG(graphics, graphics|console){ else:CONFIG(graphics, graphics|console){
folder_01.source = qml/QmlWagic folder_01.source = qml/QmlWagic
folder_01.target = /usr/share folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01 DEPLOYMENTFOLDERS = folder_01
QT += core gui opengl network multimedia windows:RESOURCES = bin/Res/core.qrc
QT += core gui opengl network
QT -= declarative quick qml QT -= declarative quick qml
#maemo5:DEFINES += QT_WIDGET #maemo5:DEFINES += QT_WIDGET
DEFINES += QT_WIDGET DEFINES += QT_WIDGET
@@ -46,7 +47,6 @@ CONFIG(graphics, graphics|console){
../../JGE/src/qt/corewrapper.cpp\ ../../JGE/src/qt/corewrapper.cpp\
../../JGE/src/Qtmain.cpp\ ../../JGE/src/Qtmain.cpp\
../../JGE/src/JMD2Model.cpp\ ../../JGE/src/JMD2Model.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/pc/JGfx.cpp ../../JGE/src/pc/JGfx.cpp
} }
else:CONFIG(console, graphics|console){ else:CONFIG(console, graphics|console){
@@ -55,7 +55,6 @@ else:CONFIG(console, graphics|console){
SOURCES += \ SOURCES += \
../../JGE/src/OutputCapturer.cpp\ ../../JGE/src/OutputCapturer.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/JGfx-fake.cpp\ ../../JGE/src/JGfx-fake.cpp\
../../JGE/src/Qtconsole.cpp\ ../../JGE/src/Qtconsole.cpp\
} }
+5 -112
View File
@@ -11,7 +11,6 @@ unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
unix:!*macx*:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror unix:!*macx*:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror
windows:DEFINES += _CRT_SECURE_NO_WARNINGS windows:DEFINES += _CRT_SECURE_NO_WARNINGS
windows|winrt:DEFINES += NOMINMAX
unix|macx:DEFINES += LINUX unix|macx:DEFINES += LINUX
CONFIG(debug, debug|release) { CONFIG(debug, debug|release) {
DEFINES += _DEBUG DEFINES += _DEBUG
@@ -33,7 +32,6 @@ windows{
*-msvc* { *-msvc* {
INCLUDEPATH += extra INCLUDEPATH += extra
DEFINES += WIN32 DEFINES += WIN32
DEFINES += FORCE_GL2
} }
} }
macx:INCLUDEPATH += /opt/include macx:INCLUDEPATH += /opt/include
@@ -43,7 +41,8 @@ INCLUDEPATH += ../../Boost
INCLUDEPATH += include INCLUDEPATH += include
unix:!symbian:LIBS += -lz unix:!symbian:LIBS += -lz
windows:LIBS += ../../JGE/Dependencies/lib/zlibd.lib win32:LIBS += ../../JGE/Dependencies/lib/fmodvc.lib
win32:LIBS += ../../JGE/Dependencies/lib/zlibd.lib
PRECOMPILED_HEADER = include/PrecompiledHeader.h PRECOMPILED_HEADER = include/PrecompiledHeader.h
#DEFINES += TRACK_OBJECT_USAGE #DEFINES += TRACK_OBJECT_USAGE
@@ -81,6 +80,7 @@ SOURCES += \
src/DeckStats.cpp\ src/DeckStats.cpp\
src/DeckView.cpp\ src/DeckView.cpp\
src/DuelLayers.cpp\ src/DuelLayers.cpp\
src/Effects.cpp\
src/ExtraCost.cpp\ src/ExtraCost.cpp\
src/GameApp.cpp\ src/GameApp.cpp\
src/GameLauncher.cpp\ src/GameLauncher.cpp\
@@ -271,6 +271,7 @@ HEADERS += \
include/WResourceManager.h\ include/WResourceManager.h\
include/DuelLayers.h\ include/DuelLayers.h\
include/GuiStatic.h\ include/GuiStatic.h\
include/Effects.h\
include/StyleManager.h\ include/StyleManager.h\
include/WFont.h\ include/WFont.h\
include/DeckManager.h\ include/DeckManager.h\
@@ -282,7 +283,6 @@ HEADERS += \
# JGE, could probably be moved outside # JGE, could probably be moved outside
SOURCES += \ SOURCES += \
../../JGE/src/Downloader.cpp\
../../JGE/src/Encoding.cpp\ ../../JGE/src/Encoding.cpp\
../../JGE/src/JAnimator.cpp\ ../../JGE/src/JAnimator.cpp\
../../JGE/src/JApp.cpp\ ../../JGE/src/JApp.cpp\
@@ -302,6 +302,7 @@ SOURCES += \
../../JGE/src/JSpline.cpp\ ../../JGE/src/JSpline.cpp\
../../JGE/src/JNetwork.cpp\ ../../JGE/src/JNetwork.cpp\
../../JGE/src/pc/JSocket.cpp\ ../../JGE/src/pc/JSocket.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/JSprite.cpp\ ../../JGE/src/JSprite.cpp\
../../JGE/src/Vector2D.cpp\ ../../JGE/src/Vector2D.cpp\
../../JGE/src/tinyxml/tinystr.cpp\ ../../JGE/src/tinyxml/tinystr.cpp\
@@ -319,7 +320,6 @@ SOURCES += \
../../JGE/src/zipFS/zstream.cpp ../../JGE/src/zipFS/zstream.cpp
HEADERS += \ HEADERS += \
../../JGE/include/Downloader.h\
../../JGE/include/Threading.h\ ../../JGE/include/Threading.h\
../../JGE/include/decoder_prx.h\ ../../JGE/include/decoder_prx.h\
../../JGE/include/DebugRoutines.h\ ../../JGE/include/DebugRoutines.h\
@@ -371,110 +371,3 @@ HEADERS += \
../../JGE/src/tinyxml/tinystr.h\ ../../JGE/src/tinyxml/tinystr.h\
../../JGE/src/tinyxml/tinyxml.h\ ../../JGE/src/tinyxml/tinyxml.h\
../../JGE/include/vram.h ../../JGE/include/vram.h
# maemo 5 packaging
maemo5: {
# Variables
BINDIR = /opt/wagic/bin
RESDIR = /home/user/wagic/Res
USERDIR = MyDocs/.Wagic
ICONDIR = /usr/share
DEFINES += RESDIR=\\\"$$RESDIR\\\"
DEFINES += USERDIR=\\\"$$USERDIR\\\"
INSTALLS += target \
desktop \
icon
target.path = $$BINDIR
desktop.path = $$ICONDIR/applications/hildon
desktop.files += wagic.desktop
icon.path = $$ICONDIR/icons/hicolor/64x64/apps
icon.files += wagic-64x64.png
# Meego/maemo 6 packaging (no launcher)
} else:contains(MEEGO_EDITION,harmattan): {
# Variables
BINDIR = /opt/wagic/bin
RESDIR = /opt/wagic/Res
USERDIR = MyDocs/.Wagic
ICONDIR = /usr/share
DEFINES += RESDIR=\\\"$$RESDIR\\\"
DEFINES += USERDIR=\\\"$$USERDIR\\\"
INSTALLS += target \
desktop \
icon \
policy
target.path = $$BINDIR
desktop.path = /usr/share/applications
desktop.files += debian_harmattan/wagic.desktop
icon.files = wagic-80x80.png
icon.path = /usr/share/icons/hicolor/64x64/apps
policy.files = debian_harmattan/wagic.conf
policy.path = /usr/share/policy/etc/syspart.conf.d
} else:symbian {
TARGET.UID3 = 0xE1D807D3
# Smart Installer package's UID
# This UID is from the protected range
# and therefore the package will fail to install if self-signed
# By default qmake uses the unprotected range value if unprotected UID is defined for the application
# and 0x2002CCCF value if protected UID is given to the application
#symbian:DEPLOYMENT.installer_header = 0x2002CCCF
# Allow network access on Symbian... that's probably pointless
TARGET.CAPABILITY += NetworkServices
RESDIR = some/res/dir
USERDIR = .Wagic
DEFINES += RESDIR=\"$$RESDIR\"
DEFINES += USERDIR=\"$$USERDIR\"
ICON = wagic.svg
} else:android {
DEFINES += Q_WS_ANDROID
RESDIR = Res
USERDIR = /sdcard/Wagic/Res
DEFINES += RESDIR=\\\"$$RESDIR\\\"
DEFINES += USERDIR=\\\"$$USERDIR\\\"
} else:unix {
# Variables
BINDIR = /usr/bin
ICONDIR = /usr/share
RESDIR = Res
USERDIR = .Wagic
DEFINES += RESDIR=\\\"$$RESDIR\\\"
DEFINES += USERDIR=\\\"$$USERDIR\\\"
target.path = $$BINDIR
desktop.path = $$ICONDIR/applications
desktop.files += wagic.desktop
icon.path = $$ICONDIR/icons/hicolor/64x64/apps
icon.files += wagic-64x64.png
INSTALLS += target \
desktop \
icon
} else:windows {
RESDIR = ./Res
USERDIR = .Wagic
DEFINES += RESDIR=\\\"$$RESDIR\\\"
DEFINES += USERDIR=\\\"$$USERDIR\\\"
}
+48 -32
View File
@@ -67,6 +67,7 @@
12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; }; 12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; };
12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; }; 12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; };
12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.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 */; }; 12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; };
12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; }; 12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; };
12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; }; 12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; };
@@ -84,6 +85,7 @@
12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; }; 12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; };
12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; }; 12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; };
12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.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 */; }; 12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; };
12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; }; 12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; };
12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; }; 12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; };
@@ -196,6 +198,7 @@
12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 12D095E014417D0500F69056 /* libstdc++.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; 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, ); }; }; 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, ); }; }; 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, ); }; }; 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, ); }; }; 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, ); }; }; 12059E5014980B7300DAC43B /* iAd.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 129654D0148A52730031100B /* iAd.framework */; settings = {ATTRIBUTES = (Weak, ); }; };
@@ -214,6 +217,7 @@
12059E5D14980B7300DAC43B /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50B148BCBBC00C58E83 /* MapKit.framework */; }; 12059E5D14980B7300DAC43B /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50B148BCBBC00C58E83 /* MapKit.framework */; };
12059E5E14980B7300DAC43B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED518148BF0E000C58E83 /* MediaPlayer.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, ); }; }; 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 */; }; 12211E7914931CBB00641703 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2814931CBB00641703 /* ASIAuthenticationDialog.m */; };
12211E7A14931CBB00641703 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2B14931CBB00641703 /* ASIDataCompressor.m */; }; 12211E7A14931CBB00641703 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2B14931CBB00641703 /* ASIDataCompressor.m */; };
12211E7B14931CBB00641703 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2D14931CBB00641703 /* ASIDataDecompressor.m */; }; 12211E7B14931CBB00641703 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2D14931CBB00641703 /* ASIDataDecompressor.m */; };
@@ -281,9 +285,6 @@
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; }; 28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.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 */; }; 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 */; }; 75D209D4181D54FD009916AC /* wagic-80x80.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D2181D54FD009916AC /* wagic-80x80.png */; };
CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */; }; CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */; };
@@ -306,6 +307,7 @@
CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; }; CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; };
CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; }; CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; };
CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.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 */; }; CEA377621291C60500B9016A /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; };
CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; }; CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; };
CEA377641291C60500B9016A /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; }; CEA377641291C60500B9016A /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; };
@@ -323,6 +325,7 @@
CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; }; CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377061291C60500B9016A /* DeckMetaData.cpp */; };
CEA377711291C60500B9016A /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; }; CEA377711291C60500B9016A /* DeckStats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377071291C60500B9016A /* DeckStats.cpp */; };
CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA377081291C60500B9016A /* DuelLayers.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 */; }; CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770A1291C60500B9016A /* ExtraCost.cpp */; };
CEA377751291C60500B9016A /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; }; CEA377751291C60500B9016A /* GameApp.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770B1291C60500B9016A /* GameApp.cpp */; };
CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; }; CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA3770C1291C60500B9016A /* GameLauncher.cpp */; };
@@ -575,13 +578,6 @@
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 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; }; 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; }; 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 = "<group>"; };
751E1F0F18FAE52D001B1E16 /* DeckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DeckView.h; sourceTree = "<group>"; };
751E1F1018FAE52D001B1E16 /* Easing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Easing.h; sourceTree = "<group>"; };
751E1F1118FAE52D001B1E16 /* GridDeckView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GridDeckView.h; sourceTree = "<group>"; };
751E1F1218FAE53E001B1E16 /* CarouselDeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CarouselDeckView.cpp; sourceTree = "<group>"; };
751E1F1318FAE53E001B1E16 /* DeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DeckView.cpp; sourceTree = "<group>"; };
751E1F1418FAE53E001B1E16 /* GridDeckView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GridDeckView.cpp; sourceTree = "<group>"; };
75D209D1181D54FD009916AC /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; }; 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; }; 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 = "<group>"; }; 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 = "<group>"; };
@@ -613,6 +609,7 @@
CEA3768C1291C60500B9016A /* AllAbilities.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = AllAbilities.h; sourceTree = "<group>"; }; CEA3768C1291C60500B9016A /* AllAbilities.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = AllAbilities.h; sourceTree = "<group>"; };
CEA3768D1291C60500B9016A /* CardDescriptor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDescriptor.h; sourceTree = "<group>"; }; CEA3768D1291C60500B9016A /* CardDescriptor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDescriptor.h; sourceTree = "<group>"; };
CEA3768E1291C60500B9016A /* CardDisplay.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDisplay.h; sourceTree = "<group>"; }; CEA3768E1291C60500B9016A /* CardDisplay.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDisplay.h; sourceTree = "<group>"; };
CEA3768F1291C60500B9016A /* CardEffect.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardEffect.h; sourceTree = "<group>"; };
CEA376901291C60500B9016A /* CardGui.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardGui.h; sourceTree = "<group>"; }; CEA376901291C60500B9016A /* CardGui.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardGui.h; sourceTree = "<group>"; };
CEA376911291C60500B9016A /* CardPrimitive.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardPrimitive.h; sourceTree = "<group>"; }; CEA376911291C60500B9016A /* CardPrimitive.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardPrimitive.h; sourceTree = "<group>"; };
CEA376921291C60500B9016A /* CardSelector.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardSelector.h; sourceTree = "<group>"; }; CEA376921291C60500B9016A /* CardSelector.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardSelector.h; sourceTree = "<group>"; };
@@ -630,6 +627,7 @@
CEA3769E1291C60500B9016A /* DeckMetaData.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckMetaData.h; sourceTree = "<group>"; }; CEA3769E1291C60500B9016A /* DeckMetaData.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckMetaData.h; sourceTree = "<group>"; };
CEA3769F1291C60500B9016A /* DeckStats.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckStats.h; sourceTree = "<group>"; }; CEA3769F1291C60500B9016A /* DeckStats.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DeckStats.h; sourceTree = "<group>"; };
CEA376A01291C60500B9016A /* DuelLayers.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DuelLayers.h; sourceTree = "<group>"; }; CEA376A01291C60500B9016A /* DuelLayers.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = DuelLayers.h; sourceTree = "<group>"; };
CEA376A11291C60500B9016A /* Effects.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = Effects.h; sourceTree = "<group>"; };
CEA376A21291C60500B9016A /* ExtraCost.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ExtraCost.h; sourceTree = "<group>"; }; CEA376A21291C60500B9016A /* ExtraCost.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = ExtraCost.h; sourceTree = "<group>"; };
CEA376A31291C60500B9016A /* GameApp.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameApp.h; sourceTree = "<group>"; }; CEA376A31291C60500B9016A /* GameApp.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameApp.h; sourceTree = "<group>"; };
CEA376A41291C60500B9016A /* GameObserver.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameObserver.h; sourceTree = "<group>"; }; CEA376A41291C60500B9016A /* GameObserver.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = GameObserver.h; sourceTree = "<group>"; };
@@ -713,6 +711,7 @@
CEA376F41291C60500B9016A /* AllAbilities.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = AllAbilities.cpp; sourceTree = "<group>"; }; CEA376F41291C60500B9016A /* AllAbilities.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = AllAbilities.cpp; sourceTree = "<group>"; };
CEA376F51291C60500B9016A /* CardDescriptor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDescriptor.cpp; sourceTree = "<group>"; }; CEA376F51291C60500B9016A /* CardDescriptor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDescriptor.cpp; sourceTree = "<group>"; };
CEA376F61291C60500B9016A /* CardDisplay.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDisplay.cpp; sourceTree = "<group>"; }; CEA376F61291C60500B9016A /* CardDisplay.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDisplay.cpp; sourceTree = "<group>"; };
CEA376F71291C60500B9016A /* CardEffect.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardEffect.cpp; sourceTree = "<group>"; };
CEA376F81291C60500B9016A /* CardGui.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardGui.cpp; sourceTree = "<group>"; }; CEA376F81291C60500B9016A /* CardGui.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardGui.cpp; sourceTree = "<group>"; };
CEA376F91291C60500B9016A /* CardPrimitive.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardPrimitive.cpp; sourceTree = "<group>"; }; CEA376F91291C60500B9016A /* CardPrimitive.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardPrimitive.cpp; sourceTree = "<group>"; };
CEA376FA1291C60500B9016A /* CardSelector.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardSelector.cpp; sourceTree = "<group>"; }; CEA376FA1291C60500B9016A /* CardSelector.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardSelector.cpp; sourceTree = "<group>"; };
@@ -730,6 +729,7 @@
CEA377061291C60500B9016A /* DeckMetaData.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckMetaData.cpp; sourceTree = "<group>"; }; CEA377061291C60500B9016A /* DeckMetaData.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckMetaData.cpp; sourceTree = "<group>"; };
CEA377071291C60500B9016A /* DeckStats.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckStats.cpp; sourceTree = "<group>"; }; CEA377071291C60500B9016A /* DeckStats.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DeckStats.cpp; sourceTree = "<group>"; };
CEA377081291C60500B9016A /* DuelLayers.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DuelLayers.cpp; sourceTree = "<group>"; }; CEA377081291C60500B9016A /* DuelLayers.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = DuelLayers.cpp; sourceTree = "<group>"; };
CEA377091291C60500B9016A /* Effects.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = Effects.cpp; sourceTree = "<group>"; };
CEA3770A1291C60500B9016A /* ExtraCost.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = ExtraCost.cpp; sourceTree = "<group>"; }; CEA3770A1291C60500B9016A /* ExtraCost.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = ExtraCost.cpp; sourceTree = "<group>"; };
CEA3770B1291C60500B9016A /* GameApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameApp.cpp; sourceTree = "<group>"; }; CEA3770B1291C60500B9016A /* GameApp.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameApp.cpp; sourceTree = "<group>"; };
CEA3770C1291C60500B9016A /* GameLauncher.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameLauncher.cpp; sourceTree = "<group>"; }; CEA3770C1291C60500B9016A /* GameLauncher.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = GameLauncher.cpp; sourceTree = "<group>"; };
@@ -890,6 +890,7 @@
12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */, 12059E4A14980B7300DAC43B /* libstdc++.dylib in Frameworks */,
12059E4B14980B7300DAC43B /* CFNetwork.framework in Frameworks */, 12059E4B14980B7300DAC43B /* CFNetwork.framework in Frameworks */,
12059E4C14980B7300DAC43B /* MobileCoreServices.framework in Frameworks */, 12059E4C14980B7300DAC43B /* MobileCoreServices.framework in Frameworks */,
12059E4D14980B7300DAC43B /* libGoogleAdMobAds.a in Frameworks */,
12059E4E14980B7300DAC43B /* libc++abi.dylib in Frameworks */, 12059E4E14980B7300DAC43B /* libc++abi.dylib in Frameworks */,
12059E4F14980B7300DAC43B /* libsqlite3.dylib in Frameworks */, 12059E4F14980B7300DAC43B /* libsqlite3.dylib in Frameworks */,
12059E5014980B7300DAC43B /* iAd.framework in Frameworks */, 12059E5014980B7300DAC43B /* iAd.framework in Frameworks */,
@@ -921,6 +922,7 @@
12D095E114417D0500F69056 /* libstdc++.dylib in Frameworks */, 12D095E114417D0500F69056 /* libstdc++.dylib in Frameworks */,
12211EBB14934A2C00641703 /* CFNetwork.framework in Frameworks */, 12211EBB14934A2C00641703 /* CFNetwork.framework in Frameworks */,
12211EB914934A1900641703 /* MobileCoreServices.framework in Frameworks */, 12211EB914934A1900641703 /* MobileCoreServices.framework in Frameworks */,
1216D634148F747D000F2295 /* libGoogleAdMobAds.a in Frameworks */,
1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */, 1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */,
128ED510148BCC1900C58E83 /* libsqlite3.dylib in Frameworks */, 128ED510148BCC1900C58E83 /* libsqlite3.dylib in Frameworks */,
129654D1148A52740031100B /* iAd.framework in Frameworks */, 129654D1148A52740031100B /* iAd.framework in Frameworks */,
@@ -1282,10 +1284,6 @@
CEA376851291C60500B9016A /* include */ = { CEA376851291C60500B9016A /* include */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
751E1F0E18FAE52D001B1E16 /* CarouselDeckView.h */,
751E1F0F18FAE52D001B1E16 /* DeckView.h */,
751E1F1018FAE52D001B1E16 /* Easing.h */,
751E1F1118FAE52D001B1E16 /* GridDeckView.h */,
12272FC114CD558C00192DC7 /* SimpleButton.h */, 12272FC114CD558C00192DC7 /* SimpleButton.h */,
12CCA032144A05DF00E343A0 /* AbilityParser.h */, 12CCA032144A05DF00E343A0 /* AbilityParser.h */,
127694891441274D0088F6D3 /* AIPlayerBaka.h */, 127694891441274D0088F6D3 /* AIPlayerBaka.h */,
@@ -1308,6 +1306,7 @@
CEA3768C1291C60500B9016A /* AllAbilities.h */, CEA3768C1291C60500B9016A /* AllAbilities.h */,
CEA3768D1291C60500B9016A /* CardDescriptor.h */, CEA3768D1291C60500B9016A /* CardDescriptor.h */,
CEA3768E1291C60500B9016A /* CardDisplay.h */, CEA3768E1291C60500B9016A /* CardDisplay.h */,
CEA3768F1291C60500B9016A /* CardEffect.h */,
CEA376901291C60500B9016A /* CardGui.h */, CEA376901291C60500B9016A /* CardGui.h */,
CEA376911291C60500B9016A /* CardPrimitive.h */, CEA376911291C60500B9016A /* CardPrimitive.h */,
CEA376921291C60500B9016A /* CardSelector.h */, CEA376921291C60500B9016A /* CardSelector.h */,
@@ -1325,6 +1324,7 @@
CEA3769E1291C60500B9016A /* DeckMetaData.h */, CEA3769E1291C60500B9016A /* DeckMetaData.h */,
CEA3769F1291C60500B9016A /* DeckStats.h */, CEA3769F1291C60500B9016A /* DeckStats.h */,
CEA376A01291C60500B9016A /* DuelLayers.h */, CEA376A01291C60500B9016A /* DuelLayers.h */,
CEA376A11291C60500B9016A /* Effects.h */,
CEA376A21291C60500B9016A /* ExtraCost.h */, CEA376A21291C60500B9016A /* ExtraCost.h */,
CEA376A31291C60500B9016A /* GameApp.h */, CEA376A31291C60500B9016A /* GameApp.h */,
CEA376A41291C60500B9016A /* GameObserver.h */, CEA376A41291C60500B9016A /* GameObserver.h */,
@@ -1408,9 +1408,6 @@
CEA376ED1291C60500B9016A /* src */ = { CEA376ED1291C60500B9016A /* src */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
751E1F1218FAE53E001B1E16 /* CarouselDeckView.cpp */,
751E1F1318FAE53E001B1E16 /* DeckView.cpp */,
751E1F1418FAE53E001B1E16 /* GridDeckView.cpp */,
12CCA02F144A05D100E343A0 /* AbilityParser.cpp */, 12CCA02F144A05D100E343A0 /* AbilityParser.cpp */,
12769483144127380088F6D3 /* AIPlayerBaka.cpp */, 12769483144127380088F6D3 /* AIPlayerBaka.cpp */,
12769484144127380088F6D3 /* AIPlayerBakaB.cpp */, 12769484144127380088F6D3 /* AIPlayerBakaB.cpp */,
@@ -1430,6 +1427,7 @@
CEA376F41291C60500B9016A /* AllAbilities.cpp */, CEA376F41291C60500B9016A /* AllAbilities.cpp */,
CEA376F51291C60500B9016A /* CardDescriptor.cpp */, CEA376F51291C60500B9016A /* CardDescriptor.cpp */,
CEA376F61291C60500B9016A /* CardDisplay.cpp */, CEA376F61291C60500B9016A /* CardDisplay.cpp */,
CEA376F71291C60500B9016A /* CardEffect.cpp */,
CEA376F81291C60500B9016A /* CardGui.cpp */, CEA376F81291C60500B9016A /* CardGui.cpp */,
CEA376F91291C60500B9016A /* CardPrimitive.cpp */, CEA376F91291C60500B9016A /* CardPrimitive.cpp */,
CEA376FA1291C60500B9016A /* CardSelector.cpp */, CEA376FA1291C60500B9016A /* CardSelector.cpp */,
@@ -1447,6 +1445,7 @@
CEA377061291C60500B9016A /* DeckMetaData.cpp */, CEA377061291C60500B9016A /* DeckMetaData.cpp */,
CEA377071291C60500B9016A /* DeckStats.cpp */, CEA377071291C60500B9016A /* DeckStats.cpp */,
CEA377081291C60500B9016A /* DuelLayers.cpp */, CEA377081291C60500B9016A /* DuelLayers.cpp */,
CEA377091291C60500B9016A /* Effects.cpp */,
CEA3770A1291C60500B9016A /* ExtraCost.cpp */, CEA3770A1291C60500B9016A /* ExtraCost.cpp */,
CEA3770B1291C60500B9016A /* GameApp.cpp */, CEA3770B1291C60500B9016A /* GameApp.cpp */,
CEA3770C1291C60500B9016A /* GameLauncher.cpp */, CEA3770C1291C60500B9016A /* GameLauncher.cpp */,
@@ -1704,7 +1703,7 @@
29B97313FDCFA39411CA2CEA /* Project object */ = { 29B97313FDCFA39411CA2CEA /* Project object */ = {
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 0510; LastUpgradeCheck = 0430;
}; };
buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "wagic" */; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "wagic" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";
@@ -1828,6 +1827,7 @@
12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */, 12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */,
12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */, 12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */,
12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */, 12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */,
12059DAB14980B7300DAC43B /* CardEffect.cpp in Sources */,
12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */, 12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */,
12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */, 12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */,
12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */, 12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */,
@@ -1845,6 +1845,7 @@
12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */, 12059DBA14980B7300DAC43B /* DeckMetaData.cpp in Sources */,
12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */, 12059DBB14980B7300DAC43B /* DeckStats.cpp in Sources */,
12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */, 12059DBC14980B7300DAC43B /* DuelLayers.cpp in Sources */,
12059DBD14980B7300DAC43B /* Effects.cpp in Sources */,
12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */, 12059DBE14980B7300DAC43B /* ExtraCost.cpp in Sources */,
12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */, 12059DBF14980B7300DAC43B /* GameApp.cpp in Sources */,
12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */, 12059DC014980B7300DAC43B /* GameLauncher.cpp in Sources */,
@@ -2008,6 +2009,7 @@
CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */, CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */,
CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */, CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */,
CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */, CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */,
CEA377611291C60500B9016A /* CardEffect.cpp in Sources */,
CEA377621291C60500B9016A /* CardGui.cpp in Sources */, CEA377621291C60500B9016A /* CardGui.cpp in Sources */,
CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */, CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */,
CEA377641291C60500B9016A /* CardSelector.cpp in Sources */, CEA377641291C60500B9016A /* CardSelector.cpp in Sources */,
@@ -2025,6 +2027,7 @@
CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */, CEA377701291C60500B9016A /* DeckMetaData.cpp in Sources */,
CEA377711291C60500B9016A /* DeckStats.cpp in Sources */, CEA377711291C60500B9016A /* DeckStats.cpp in Sources */,
CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */, CEA377721291C60500B9016A /* DuelLayers.cpp in Sources */,
CEA377731291C60500B9016A /* Effects.cpp in Sources */,
CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */, CEA377741291C60500B9016A /* ExtraCost.cpp in Sources */,
CEA377751291C60500B9016A /* GameApp.cpp in Sources */, CEA377751291C60500B9016A /* GameApp.cpp in Sources */,
CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */, CEA377761291C60500B9016A /* GameLauncher.cpp in Sources */,
@@ -2054,7 +2057,6 @@
CEA3778F1291C60500B9016A /* ManaCostHybrid.cpp in Sources */, CEA3778F1291C60500B9016A /* ManaCostHybrid.cpp in Sources */,
CEA377901291C60500B9016A /* MenuItem.cpp in Sources */, CEA377901291C60500B9016A /* MenuItem.cpp in Sources */,
CEA377911291C60500B9016A /* MTGAbility.cpp in Sources */, CEA377911291C60500B9016A /* MTGAbility.cpp in Sources */,
751E1F1718FAE53E001B1E16 /* GridDeckView.cpp in Sources */,
CEA377931291C60500B9016A /* MTGCard.cpp in Sources */, CEA377931291C60500B9016A /* MTGCard.cpp in Sources */,
CEA377941291C60500B9016A /* MTGCardInstance.cpp in Sources */, CEA377941291C60500B9016A /* MTGCardInstance.cpp in Sources */,
CEA377951291C60500B9016A /* MTGDeck.cpp in Sources */, CEA377951291C60500B9016A /* MTGDeck.cpp in Sources */,
@@ -2093,7 +2095,6 @@
CEA377BA1291C60500B9016A /* utils.cpp in Sources */, CEA377BA1291C60500B9016A /* utils.cpp in Sources */,
CEA377BB1291C60500B9016A /* WCachedResource.cpp in Sources */, CEA377BB1291C60500B9016A /* WCachedResource.cpp in Sources */,
CEA377BC1291C60500B9016A /* WDataSrc.cpp in Sources */, CEA377BC1291C60500B9016A /* WDataSrc.cpp in Sources */,
751E1F1618FAE53E001B1E16 /* DeckView.cpp in Sources */,
CEA377BD1291C60500B9016A /* WEvent.cpp in Sources */, CEA377BD1291C60500B9016A /* WEvent.cpp in Sources */,
CEA377BE1291C60500B9016A /* WFilter.cpp in Sources */, CEA377BE1291C60500B9016A /* WFilter.cpp in Sources */,
CEA377BF1291C60500B9016A /* WFont.cpp in Sources */, CEA377BF1291C60500B9016A /* WFont.cpp in Sources */,
@@ -2103,7 +2104,6 @@
CE9A478512B514BA00C9F38A /* EAGLView.m in Sources */, CE9A478512B514BA00C9F38A /* EAGLView.m in Sources */,
CE9A478612B514BA00C9F38A /* EAGLViewController.m in Sources */, CE9A478612B514BA00C9F38A /* EAGLViewController.m in Sources */,
CE9A478912B514BA00C9F38A /* ES2Renderer.m in Sources */, CE9A478912B514BA00C9F38A /* ES2Renderer.m in Sources */,
751E1F1518FAE53E001B1E16 /* CarouselDeckView.cpp in Sources */,
CE9A478A12B514BA00C9F38A /* main.m in Sources */, CE9A478A12B514BA00C9F38A /* main.m in Sources */,
CE9A478D12B514BA00C9F38A /* wagicAppDelegate.m in Sources */, CE9A478D12B514BA00C9F38A /* wagicAppDelegate.m in Sources */,
CE9E71DD1375A58600759DDC /* thread.cpp in Sources */, CE9E71DD1375A58600759DDC /* thread.cpp in Sources */,
@@ -2152,6 +2152,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES; ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
@@ -2201,6 +2205,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
@@ -2244,6 +2252,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES; ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
COPY_PHASE_STRIP = NO; COPY_PHASE_STRIP = NO;
@@ -2279,7 +2291,10 @@
"\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"", "\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"",
); );
"New Setting" = ""; "New Setting" = "";
OTHER_LDFLAGS = "-Wl"; OTHER_LDFLAGS = (
"-no_implicit_dylibs",
"-Wl",
);
PRODUCT_NAME = wagic; PRODUCT_NAME = wagic;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
@@ -2292,6 +2307,10 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO; ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = (
armv6,
"$(ARCHS_STANDARD_32_BIT)",
);
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
COPY_PHASE_STRIP = YES; COPY_PHASE_STRIP = YES;
@@ -2320,7 +2339,10 @@
"$(inherited)", "$(inherited)",
"\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"", "\"$(SRCROOT)/../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5\"",
); );
OTHER_LDFLAGS = "-Wl"; OTHER_LDFLAGS = (
"-no_implicit_dylibs",
"-Wl",
);
PRODUCT_NAME = wagic; PRODUCT_NAME = wagic;
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
@@ -2332,6 +2354,7 @@
C01FCF4F08A954540054247B /* Debug */ = { C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
CODE_SIGN_IDENTITY = "iPhone Developer"; CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
DEPLOYMENT_LOCATION = NO; DEPLOYMENT_LOCATION = NO;
@@ -2342,11 +2365,6 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../Boost/boost; HEADER_SEARCH_PATHS = ../../Boost/boost;
IPHONEOS_DEPLOYMENT_TARGET = 5.1; IPHONEOS_DEPLOYMENT_TARGET = 5.1;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DTIXML_USE_STL",
"-fno-objc-arc",
);
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
@@ -2356,6 +2374,7 @@
C01FCF5008A954540054247B /* Release */ = { C01FCF5008A954540054247B /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
CODE_SIGN_IDENTITY = "iPhone Distribution"; CODE_SIGN_IDENTITY = "iPhone Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
GCC_C_LANGUAGE_STANDARD = c99; GCC_C_LANGUAGE_STANDARD = c99;
@@ -2363,10 +2382,7 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../../Boost/boost; HEADER_SEARCH_PATHS = ../../Boost/boost;
IPHONEOS_DEPLOYMENT_TARGET = 5.1; IPHONEOS_DEPLOYMENT_TARGET = 5.1;
OTHER_CFLAGS = ( OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
"-DNS_BLOCK_ASSERTIONS=1",
"-DTIXML_USE_STL=1",
);
PROVISIONING_PROFILE = ""; PROVISIONING_PROFILE = "";
"PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
SDKROOT = iphoneos; SDKROOT = iphoneos;
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0510" LastUpgradeVersion = "0500"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Scheme <Scheme
LastUpgradeVersion = "0510" LastUpgradeVersion = "0500"
version = "1.3"> version = "1.3">
<BuildAction <BuildAction
parallelizeBuildables = "YES" parallelizeBuildables = "YES"
+35 -51
View File
@@ -1,23 +1,10 @@
#!/bin/sh -ex #!/bin/sh -ex
# let's dump some info to debug a bit # let's dump some info to debug a bit
echo PSPDEV = $PSPDEV
echo psp-config = `psp-config --psp-prefix`
echo ls = `ls` echo ls = `ls`
echo pwd = `pwd` echo pwd = `pwd`
# computing potential release name
echo TRAVIS_PULL_REQUEST = $TRAVIS_PULL_REQUEST
echo TRAVIS_BRANCH = $TRAVIS_BRANCH
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
if [ "$TRAVIS_BRANCH" = "alphas" ]; then
export RELEASE_NAME="alpha-${TRAVIS_BUILD_NUMBER}"
else if [ "$TRAVIS_BRANCH" = "master" ]; then
export RELEASE_NAME="latest-master"
fi
fi
fi
echo RELEASE_NAME = $RELEASE_NAME
# updating versions with the TRAVIS build numbers # updating versions with the TRAVIS build numbers
cd projects/mtg/ cd projects/mtg/
@@ -27,22 +14,20 @@ cd ../..
# we create resource package # we create resource package
cd projects/mtg/bin/Res cd projects/mtg/bin/Res
python createResourceZip.py python createResourceZip.py
python createResourceZip.py --platform=qt
# if we let the zip here, Wagic will use it in the testsuite # if we let the zip here, Wagic will use it in the testsuite
# and we'll get 51 failed test cases # and we'll get 51 failed test cases
mv core_*.zip ../../../../core.zip mv core_*.zip ../../../../core.zip
cd ../../../.. cd ../../../..
# we're building a PSP binary here # we're building a PSP binary here
if [ "$BUILD_TYPE" = "PSP" ]; then
# let's dump some info to debug a bit
echo PSPDEV = $PSPDEV
echo psp-config = `psp-config --psp-prefix`
cd JGE cd JGE
make -j 4 make -j 8
make -j 8 -f Makefile.hge install
cd .. cd ..
cd projects/mtg cd projects/mtg
mkdir objs mkdir objs
make -j 4 make -j 8
mkdir WTH mkdir WTH
mkdir WTH/Res mkdir WTH/Res
mv EBOOT.PBP WTH/ mv EBOOT.PBP WTH/
@@ -56,51 +41,50 @@ if [ "$BUILD_TYPE" = "PSP" ]; then
cd .. cd ..
zip psprelease.zip -r WTH/ zip psprelease.zip -r WTH/
cd ../.. cd ../..
fi
# we're building an Android binary here # we're building an Android binary here
if [ "$BUILD_TYPE" = "Android" ]; then android-ndk-r9/ndk-build -C projects/mtg/Android -j8
android-ndk-r9/ndk-build -C projects/mtg/Android -j4
$ANDROID list targets $ANDROID list targets
$ANDROID update project -t 1 -p projects/mtg/Android $ANDROID update project -t 1 -p projects/mtg/Android
ant debug -f projects/mtg/Android/build.xml ant debug -f projects/mtg/Android/build.xml
fi
if [ "$BUILD_TYPE" = "Qt" ]; then
# we're building a Qt version with GUI here # we're building a Qt version with GUI here
mkdir qt-gui-build mkdir qt-gui-build
cd qt-gui-build cd qt-gui-build
$QMAKE ../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics mv ../projects/mtg/bin/Res/settings/options.orig.txt ../projects/mtg/bin/Res/settings/options.txt
make -j 4 mv ../projects/mtg/bin/Res/player/options.orig.txt ../projects/mtg/bin/Res/player/options.txt
qmake ../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics
make -j 8
cd .. cd ..
# let's try an Intel linux binary in debug text-mode-only # 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 4 make -j 8
# we're cross-compiling a Qt Windows version here, # we're cross-compiling a Qt Windows version here,
# PATH is only set here to prevent colision # PATH is only set here to prevent collision
export PATH="$PATH:/opt/mingw32/bin"
# export PATH="$PATH:/opt/mingw32/bin" mkdir build
# mkdir build cd build
# cd build mkdir win-cross
# mkdir win-cross cd win-cross
# cd win-cross /opt/mingw32/bin/qmake ../../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics
# /opt/mingw32/bin/qmake ../../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics make -j 8
# make -j 4 cd release
# cd release cp ../../../projects/mtg/bin/fmod.dll .
# cp ../../../projects/mtg/bin/fmod.dll . cp /opt/mingw32/bin/QtCore4.dll .
# cp /opt/mingw32/bin/QtCore4.dll . cp /opt/mingw32/bin/QtGui4.dll .
# cp /opt/mingw32/bin/QtGui4.dll . cp /opt/mingw32/bin/QtNetwork4.dll .
# cp /opt/mingw32/bin/QtNetwork4.dll . cp /opt/mingw32/bin/QtOpenGL4.dll .
# cp /opt/mingw32/bin/QtOpenGL4.dll . cp ../../../projects/mtg/bin/zlib1.dll .
# cp ../../../projects/mtg/bin/zlib1.dll . cp /opt/mingw32/bin/libpng15-15.dll .
# cp /opt/mingw32/bin/libpng15-15.dll . cd ..
# cd .. zip win-cross.zip -r release/
# zip win-cross.zip -r release/ mv ../../projects/mtg/bin/Res/settings/options.txt ../../projects/mtg/bin/Res/settings/options.orig.txt
# cd ../.. mv ../../projects/mtg/bin/Res/player/options.txt ../../projects/mtg/bin/Res/player/options.orig.txt
cd ../..
# Now we run the testsuite (Res needs to be in the working directory) # Now we run the testsuite (Res needs to be in the working directory)
cd projects/mtg cd projects/mtg
../../wagic ../../wagic
cd ../.. cd ../..
fi
-66
View File
@@ -1,66 +0,0 @@
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()
+18 -18
View File
@@ -10,28 +10,28 @@ if [ "$TRAVIS_BRANCH" == "alphas" ]; then
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @core.zip \ --data-binary @core.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core-${TRAVIS_BUILD_NUMBER}.zip"
echo -e "Uploading android package\n" echo -e "Uploading android package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @projects/mtg/Android/bin/Wagic-debug.apk \ --data-binary @projects/mtg/Android/bin/Wagic-debug.apk \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android-${TRAVIS_BUILD_NUMBER}.apk"
echo -e "Uploading PSP package\n" echo -e "Uploading PSP package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @projects/mtg/psprelease.zip \ --data-binary @projects/mtg/psprelease.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp-${TRAVIS_BUILD_NUMBER}.zip"
# echo -e "Uploading Windows package\n" echo -e "Uploading Windows package\n"
# curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
# -H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
# -H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
# --data-binary @build/win-cross/win-cross.zip \ --data-binary @build/win-cross/win-cross.zip \
# "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows-${TRAVIS_BUILD_NUMBER}.zip"
echo -e "Done uploading\n" echo -e "Done uploading\n"
fi fi
@@ -71,28 +71,28 @@ if [ "$TRAVIS_BRANCH" == "master" ]; then
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @core.zip \ --data-binary @core.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core-${TRAVIS_BUILD_NUMBER}.zip"
echo -e "Uploading android package\n" echo -e "Uploading android package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @projects/mtg/Android/bin/Wagic-debug.apk \ --data-binary @projects/mtg/Android/bin/Wagic-debug.apk \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android-${TRAVIS_BUILD_NUMBER}.apk"
echo -e "Uploading PSP package\n" echo -e "Uploading PSP package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
--data-binary @projects/mtg/psprelease.zip \ --data-binary @projects/mtg/psprelease.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp-${TRAVIS_BUILD_NUMBER}.zip"
# echo -e "Uploading Windows package\n" echo -e "Uploading Windows package\n"
# curl -X POST -H "Authorization: token ${GH_TOKEN}" \ curl -X POST -H "Authorization: token ${GH_TOKEN}" \
# -H "Accept: application/vnd.github.manifold-preview" \ -H "Accept: application/vnd.github.manifold-preview" \
# -H "Content-Type: application/zip" \ -H "Content-Type: application/zip" \
# --data-binary @build/win-cross/win-cross.zip \ --data-binary @build/win-cross/win-cross.zip \
# "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip" "https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows-${TRAVIS_BUILD_NUMBER}.zip"
echo -e "Done uploading\n" echo -e "Done uploading\n"
fi fi