Merge branch 'master' into minmax

This commit is contained in:
xawotihs
2014-01-24 23:49:30 +01:00
100 changed files with 5124 additions and 1688 deletions
+26 -13
View File
@@ -1,17 +1,30 @@
language: cpp language: cpp
branches:
except:
- latest-master
before_install: before_install:
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" - export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
- export PSPSDK="$PSPDEV/psp/sdk" - export PSPSDK="$PSPDEV/psp/sdk"
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" - export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
- export ANDROID="android-sdk-linux/tools/android" - export ANDROID="android-sdk-linux/tools/android"
install: install:
- sudo apt-get update -qq - sudo add-apt-repository ppa:tobydox/mingw -y
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch; fi - sudo apt-get update -qq
- 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 - 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
- tar -x --xz -f sdk.lzma - sudo ln -s /opt/mingw32/bin/moc /opt/mingw32/bin/i686-w64-mingw32-moc
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv - 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
- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv - tar -x --xz -f sdk.lzma
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 - wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
- tar -zxf android-sdk_r22-linux.tgz - wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
- echo yes | $ANDROID update sdk --filter 1,2,3,8 --no-ui --force > log.txt - tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
- tar -zxf android-sdk_r22-linux.tgz
- $ANDROID list sdk --extended -a
- echo yes | $ANDROID update sdk -a --filter "tools","platform-tools","build-tools-19.0.1","android-10" --no-ui --force > log.txt
- sudo pip install pyjavaproperties
script: ./travis-script.sh
env:
global:
secure: "fJgWlCFbde96OSQNGKUmowGX+ERPeqP+n1EOMf1+FJzOU4DdkTLRAlV5+5qnEX9jB/3mWN6iPpmG1qEz/SdDG3KHxJYs4ZU/Lu485O24zZ/+GdYBNsrvhPD9ckPGEMLDa1foEVTDnW0Dlkz3BCFcszjhtXGUJv7v6Pj6LRk1Mg8="
script: "./travis-script.sh" script: "./travis-script.sh"
after_success: ./upload-binaries.sh
+1 -1
View File
@@ -61,7 +61,7 @@ std::string ToHex(T* pointer)
{ \ { \
std::ostringstream stream; \ std::ostringstream stream; \
stream << inString << std::endl; \ stream << inString << std::endl; \
OutputDebugString(stream.str().c_str()); \ OutputDebugStringA(stream.str().c_str()); \
} }
#endif // QT_CONFIG #endif // QT_CONFIG
#endif // Win32, Linux #endif // Win32, Linux
+128
View File
@@ -0,0 +1,128 @@
#ifndef DOWNLOADER_H
#define DOWNLOADER_H
//-------------------------------------------------------------------------------------
//
// This class handles download of remote resources (any kind of file)
// All the resources are stored locally in the userPath
// For every resources, the downloader verifies if the resource was modifed
// on the server before downloading the update. The Downloader maintains a catalogue
// of resource downloaded to be able to check if they need to be updated.
//
// The interface can be used completly synchronously by the application and some
// context or message loop is needed in the implementation of this interface
//
// Note that the Downloader could in theory by implemented on top of JNetwork.
//
//-------------------------------------------------------------------------------------
#include <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
-1
View File
@@ -297,7 +297,6 @@ public:
private: private:
float mTimer; float mTimer;
float mFrameTime; float mFrameTime;
JAnimator* mAnimator;
vector<JAnimatorObject *> mObjects; vector<JAnimatorObject *> mObjects;
}; };
-1
View File
@@ -37,7 +37,6 @@ private:
float mTexY; float mTexY;
float mTexWidth; float mTexWidth;
float mTexHeight; float mTexHeight;
JTexture* mTexture;
JQuad* mQuad; JQuad* mQuad;
+1
View File
@@ -128,6 +128,7 @@ public:
bool readIntoString(const string & FilePath, string & target); bool readIntoString(const string & FilePath, string & target);
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);
+77 -3
View File
@@ -1,7 +1,7 @@
#ifndef THREADING_H #ifndef THREADING_H
#define THREADING_H #define THREADING_H
#if !defined(PSP) && !defined(QT_CONFIG) #if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L)
#include <boost/date_time.hpp> #include <boost/date_time.hpp>
#ifdef WIN32 #ifdef WIN32
@@ -14,7 +14,7 @@
#endif #endif
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#elif !defined(QT_CONFIG) #elif defined(PSP)
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
@@ -307,7 +307,7 @@ namespace boost
} }
} }
#elif defined(QT_CONFIG) #elif defined(QT_CONFIG) && (__cplusplus <= 199711L)
#include <QMutex> #include <QMutex>
#include <QThread> #include <QThread>
@@ -537,6 +537,80 @@ namespace boost
} }
} }
#elif (__cplusplus > 199711L)
#include <thread>
#include <mutex>
namespace boost
{
typedef std::thread thread;
template <class Mutex>
struct unique_lock
{
unique_lock(Mutex& inMutex) : mMutex(&inMutex)
{
mMutex->lock();
}
~unique_lock()
{
mMutex->unlock();
}
Mutex* mMutex;
};
class mutex
{
public:
typedef unique_lock<mutex> scoped_lock;
mutex()
: mQMutex()
{
}
~mutex()
{
}
void lock()
{
mQMutex.lock();
}
void unlock()
{
mQMutex.unlock();
}
std::mutex mQMutex;
private:
mutex(mutex const&);
mutex& operator=(mutex const&);
};
namespace posix_time
{
typedef unsigned int milliseconds;
}
/**
** boost's platform neutral sleep call.
*/
namespace this_thread
{
inline void sleep(boost::posix_time::milliseconds const& time)
{
std::this_thread::sleep_for(std::chrono::milliseconds(time));
}
}
}
#endif #endif
#endif // THREADING_H #endif // THREADING_H
+15
View File
@@ -136,6 +136,20 @@ signals:
private slots: private slots:
private: private:
int lastPosx(){
#if QT_VERSION >= 0x050000
return m_lastPos.x()*devicePixelRatio();
#else
return m_lastPos.x();
#endif
}
int lastPosy(){
#if QT_VERSION >= 0x050000
return m_lastPos.y()*devicePixelRatio();
#else
return m_lastPos.y();
#endif
}
void timerEvent( QTimerEvent* ); void timerEvent( QTimerEvent* );
void doAndEnqueue(JButton action) { void doAndEnqueue(JButton action) {
m_engine->HoldKey_NoRepeat(action); m_engine->HoldKey_NoRepeat(action);
@@ -154,6 +168,7 @@ private:
int m_timerId; int m_timerId;
bool m_active; bool m_active;
QRect m_viewPort; QRect m_viewPort;
QPoint m_lastPos;
#ifdef QT_WIDGET #ifdef QT_WIDGET
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID) #if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
int mMouseDownX; int mMouseDownX;
+298
View File
@@ -0,0 +1,298 @@
#include "DebugRoutines.h"
#include "JFileSystem.h"
#include "Downloader.h"
#define RECORDS_DEFAULT_FILE "cache/records.txt"
#ifdef QT_CONFIG
QNetworkAccessManager DownloadRequest::networkAccessManager;
#endif
DownloadRequest::DownloadRequest(string localPath,
string remoteResourceURL,
string ETag,
DownloadStatus downloadStatus,
size_t totalSize,
size_t currentSize):
mLocalPath(localPath),
mRemoteResourceURL(remoteResourceURL),
mRequestedRemoteResourceURL(remoteResourceURL),
mETag(ETag),
mDownloadStatus(downloadStatus),
mUpgradeAvailable(false),
mTotalSize(totalSize),
mCurrentSize(currentSize)
{
}
DownloadRequest::~DownloadRequest()
{
}
void DownloadRequest::startHead()
{
#ifdef QT_CONFIG
QNetworkRequest request(QUrl(QString(mRequestedRemoteResourceURL.c_str())));
request.setRawHeader("If-None-Match", mETag.c_str());
mNetworkReply = networkAccessManager.head(request);
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
#endif
}
void DownloadRequest::startGet()
{
#ifdef QT_CONFIG
mNetworkReply = networkAccessManager.get(QNetworkRequest(QUrl(QString(mRequestedRemoteResourceURL.c_str()))));
#endif
mFile.close();
JFileSystem::GetInstance()->Remove(getTempLocalPath());
JFileSystem::GetInstance()->openForWrite(mFile, getTempLocalPath());
#ifdef QT_CONFIG
connect(mNetworkReply, SIGNAL(downloadProgress(qint64, qint64)),
SLOT(downloadProgress(qint64, qint64)));
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
#endif
}
void DownloadRequest::fileDownloaded()
{
do {
QByteArray eTagByteArray = mNetworkReply->rawHeader("ETag");
if(!eTagByteArray.isEmpty()) {
string oldETag = mETag;
mETag = QString(eTagByteArray).toStdString();
if(oldETag!="" && oldETag != mETag)
mUpgradeAvailable = true;
}
// let's check some error
if(mNetworkReply->error() != QNetworkReply::NoError) {
DebugTrace(mNetworkReply->errorString().toStdString());
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
mFile.close();
JFileSystem::GetInstance()->Remove(getTempLocalPath());
break;
}
// check if we're getting redirected
QVariant redirectionTarget = mNetworkReply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (!redirectionTarget.isNull()) {
QUrl newUrl = QUrl(mRequestedRemoteResourceURL.c_str()).resolved(redirectionTarget.toUrl());
DebugTrace(string("Redirect to ")+ newUrl.toString().toStdString());
mRequestedRemoteResourceURL = newUrl.toString().toStdString();
mNetworkReply->deleteLater();
if(mFile.is_open())
startGet();
else
startHead();
return;
}
if(mFile.is_open())
{
QByteArray byteArray = mNetworkReply->readAll();
mFile.write(byteArray.constData(), byteArray.size());
mFile.close();
if(!JFileSystem::GetInstance()->Rename(getTempLocalPath(), mLocalPath)) {
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
break;
}
}
mDownloadStatus = DownloadRequest::DOWNLOADED;
} while(0);
Downloader::GetInstance()->Update();
mNetworkReply->deleteLater();
emit statusChanged((int)mDownloadStatus);
}
void DownloadRequest::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
{
QByteArray byteArray = mNetworkReply->readAll();
mFile.write(byteArray.constData(), byteArray.size());
mCurrentSize = bytesReceived;
mTotalSize = bytesTotal;
int percent = 0;
if(bytesTotal)
percent = (bytesReceived/bytesTotal)*100;
emit percentChanged(percent);
}
Downloader* Downloader::mInstance = 0;
Downloader::Downloader(string globalRemoteURL, string localcacheRecords):
mGlobalRemoteURL(globalRemoteURL),
mLocalCacheRecords(localcacheRecords)
{
JFileSystem::GetInstance()->MakeDir("cache");
izfstream downloadRecords;
if(mLocalCacheRecords.empty())
mLocalCacheRecords = RECORDS_DEFAULT_FILE;
if(JFileSystem::GetInstance()->openForRead(downloadRecords, mLocalCacheRecords))
{// File exists, let's read it.
downloadRecords >> (*this);
}
JFileSystem::GetInstance()->CloseFile();
}
Downloader::~Downloader()
{
map<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;
}
+12 -2
View File
@@ -126,7 +126,7 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
DebugTrace("User path " << userPath); DebugTrace("User path " << userPath);
#elif defined (QT_CONFIG) #elif defined (QT_CONFIG)
QDir sysDir("projects/mtg/bin/Res"); QDir sysDir(RESDIR);
QDir dir(QDir::homePath()); QDir dir(QDir::homePath());
dir.mkdir(USERDIR); dir.mkdir(USERDIR);
dir.cd(USERDIR); dir.cd(USERDIR);
@@ -313,11 +313,15 @@ bool JFileSystem::readIntoString(const string & FilePath, string & target)
int fileSize = GetFileSize(file); int fileSize = GetFileSize(file);
#ifndef __MINGW32__
try { try {
#endif
target.resize((std::string::size_type) fileSize); target.resize((std::string::size_type) fileSize);
#ifndef __MINGW32__
} catch (bad_alloc&) { } catch (bad_alloc&) {
return false; return false;
} }
#endif
if (fileSize) if (fileSize)
@@ -553,7 +557,13 @@ 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()) ? true: false; return (rename(from.c_str(), to.c_str()) == 0);
}
bool JFileSystem::Remove(string aFile)
{
string toRemove = mUserFSPath + aFile;
return (std::remove(toRemove.c_str()) == 0);
} }
int JFileSystem::GetFileSize(izfstream & file) int JFileSystem::GetFileSize(izfstream & file)
+1 -2
View File
@@ -96,9 +96,8 @@ int main(int argc, char* argv[])
options.reloadProfile(); options.reloadProfile();
TestSuite testSuite("test/_tests.txt"); TestSuite testSuite("test/_tests.txt");
result = testSuite.run(); result = testSuite.run();
int totalTests = testSuite.nbTests + testSuite.nbAITests;
delete wagicCore; delete wagicCore;
DebugTrace("TestSuite done: failed test: " << result << " out of " << totalTests << " total"); DebugTrace("TestSuite done: failed test: " << result << " out of " << testSuite.nbTests + testSuite.nbAITests << " total");
#ifdef CAPTURE_STDERR #ifdef CAPTURE_STDERR
OutputCapturer::debugAndClear(); OutputCapturer::debugAndClear();
#endif #endif
+18 -11
View File
@@ -9,11 +9,11 @@
#include <QtDeclarative> #include <QtDeclarative>
#include "qmlapplicationviewer.h" #include "qmlapplicationviewer.h"
#endif //QT_WIDGET #endif //QT_WIDGET
#include "filedownloader.h" #include "Downloader.h"
#include "GameApp.h" #include "GameApp.h"
#include "corewrapper.h" #include "corewrapper.h"
QWidget* g_glwidget = NULL; WagicCore* g_glwidget = NULL;
static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] = static const struct { LocalKeySym keysym; JButton keycode; } gDefaultBindings[] =
{ {
@@ -69,18 +69,25 @@ 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());
FileDownloader fileDownloader(USERDIR, WAGIC_RESOURCE_NAME); DownloadRequest* downloadRequest = NULL;
#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();
g_glwidget->connect(&fileDownloader, SIGNAL(finished(int)), SLOT(start(int))); if(!downloadRequest || downloadRequest->getDownloadStatus() == DownloadRequest::DOWNLOADED)
{
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,6 +80,19 @@ 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
+1 -1
View File
@@ -2486,7 +2486,7 @@ void JRenderer::Enable2D()
#if (defined GL_VERSION_ES_CM_1_1) || (defined GL_OES_VERSION_1_1) #if (defined GL_VERSION_ES_CM_1_1) || (defined GL_OES_VERSION_1_1)
glOrthof(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f, -1.0f, 1.0f); glOrthof(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f, -1.0f, 1.0f);
#else #else
gluOrtho2D(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f); glOrtho(0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f, -1.0f, 1.0f);
#endif #endif
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
+29 -29
View File
@@ -335,7 +335,7 @@ void WagicCore::resizeGL(int width, int height)
#if (defined GL_VERSION_ES_CM_1_1 || defined GL_OES_VERSION_1_1) #if (defined GL_VERSION_ES_CM_1_1 || defined GL_OES_VERSION_1_1)
glOrthof(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f, -1.0f, 1.0f); glOrthof(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f, -1.0f, 1.0f);
#else #else
gluOrtho2D(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f); glOrtho(0.0f, (float) (m_viewPort.right()-m_viewPort.left())-1.0f, 0.0f, (float) (m_viewPort.bottom()-m_viewPort.top())-1.0f, -1.0f, 1.0f);
#endif #endif
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
@@ -418,29 +418,29 @@ void WagicCore::mousePressEvent(QMouseEvent *event)
{ {
if(event->button() == Qt::LeftButton) if(event->button() == Qt::LeftButton)
{ {
QPoint lastPos = event->pos(); m_lastPos = event->pos();
// this is intended to convert window coordinate into game coordinate. // this is intended to convert window coordinate into game coordinate.
// this is correct only if the game and window have the same aspect ratio, otherwise, it's just wrong // this is correct only if the game and window have the same aspect ratio, otherwise, it's just wrong
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth(); int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight(); int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
if (lastPos.y() >= m_viewPort.top() && if (lastPosy() >= m_viewPort.top() &&
lastPos.y() <= m_viewPort.bottom() && lastPosy() <= m_viewPort.bottom() &&
lastPos.x() <= m_viewPort.right() && lastPosx() <= m_viewPort.right() &&
lastPos.x() >= m_viewPort.left()) { lastPosx() >= m_viewPort.left()) {
m_engine->LeftClicked( m_engine->LeftClicked(
((lastPos.x()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth, ((lastPosx()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
((lastPos.y()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight); ((lastPosy()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) && (!defined Q_WS_ANDROID) #if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) && (!defined Q_WS_ANDROID)
m_engine->HoldKey_NoRepeat(JGE_BTN_OK); m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
#else #else
mMouseDownX = lastPos.x(); mMouseDownX = lastPosx();
mMouseDownY = lastPos.y(); mMouseDownY = lastPosy();
mLastFingerDownTime = g_startTimer.elapsed(); mLastFingerDownTime = g_startTimer.elapsed();
#endif #endif
} else if(lastPos.y()<m_viewPort.top()) { } else if(lastPosy()<m_viewPort.top()) {
m_engine->HoldKey_NoRepeat(JGE_BTN_MENU); m_engine->HoldKey_NoRepeat(JGE_BTN_MENU);
} else if(lastPos.y()>m_viewPort.bottom()) { } else if(lastPosy()>m_viewPort.bottom()) {
m_engine->HoldKey_NoRepeat(JGE_BTN_NEXT); m_engine->HoldKey_NoRepeat(JGE_BTN_NEXT);
} }
event->accept(); event->accept();
@@ -465,33 +465,33 @@ void WagicCore::mouseReleaseEvent(QMouseEvent *event)
{ {
if(event->button() == Qt::LeftButton) if(event->button() == Qt::LeftButton)
{ {
QPoint lastPos = event->pos(); m_lastPos = event->pos();
if (lastPos.y() >= m_viewPort.top() && if (lastPosy() >= m_viewPort.top() &&
lastPos.y() <= m_viewPort.bottom() && lastPosy() <= m_viewPort.bottom() &&
lastPos.x() <= m_viewPort.right() && lastPosx() <= m_viewPort.right() &&
lastPos.x() >= m_viewPort.left()) { lastPosx() >= m_viewPort.left()) {
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID) #if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
if(g_startTimer.elapsed() - mLastFingerDownTime <= kTapEventTimeout ) if(g_startTimer.elapsed() - mLastFingerDownTime <= kTapEventTimeout )
{ {
if(abs(mMouseDownX - lastPos.x()) < kHitzonePliancy && if(abs(mMouseDownX - lastPosx()) < kHitzonePliancy &&
abs(mMouseDownY - lastPos.y()) < kHitzonePliancy) abs(mMouseDownY - lastPosy()) < kHitzonePliancy)
{ {
m_engine->HoldKey_NoRepeat(JGE_BTN_OK); m_engine->HoldKey_NoRepeat(JGE_BTN_OK);
} }
} }
else if (g_startTimer.elapsed() - mLastFingerDownTime >= kSwipeEventMinDuration) else if (g_startTimer.elapsed() - mLastFingerDownTime >= kSwipeEventMinDuration)
{ // Let's swipe { // Let's swipe
m_engine->Scroll(lastPos.x()-mMouseDownX, lastPos.y()-mMouseDownY); m_engine->Scroll(lastPosx()-mMouseDownX, lastPosy()-mMouseDownY);
} }
#else #else
//#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN) //#if (!defined Q_WS_MAEMO_5) && (!defined MEEGO_EDITION_HARMATTAN)
m_engine->ReleaseKey(JGE_BTN_OK); m_engine->ReleaseKey(JGE_BTN_OK);
#endif #endif
m_engine->ReleaseKey(JGE_BTN_MENU); m_engine->ReleaseKey(JGE_BTN_MENU);
} else if(lastPos.y() < m_viewPort.top()) { } else if(lastPosy() < m_viewPort.top()) {
m_engine->ReleaseKey(JGE_BTN_MENU); m_engine->ReleaseKey(JGE_BTN_MENU);
} else if(lastPos.y() > m_viewPort.bottom()) { } else if(lastPosy() > m_viewPort.bottom()) {
m_engine->ReleaseKey(JGE_BTN_NEXT); m_engine->ReleaseKey(JGE_BTN_NEXT);
} }
event->accept(); event->accept();
@@ -517,15 +517,15 @@ void WagicCore::mouseMoveEvent(QMouseEvent *event)
int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth(); int actualWidth = (int) JRenderer::GetInstance()->GetActualWidth();
int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight(); int actualHeight = (int) JRenderer::GetInstance()->GetActualHeight();
QPoint lastPos = event->pos(); m_lastPos = event->pos();
if (lastPos.y() >= m_viewPort.top() && if (lastPosy() >= m_viewPort.top() &&
lastPos.y() <= m_viewPort.bottom() && lastPosy() <= m_viewPort.bottom() &&
lastPos.x() <= m_viewPort.right() && lastPosx() <= m_viewPort.right() &&
lastPos.x() >= m_viewPort.left()) { lastPosx() >= m_viewPort.left()) {
m_engine->LeftClicked( m_engine->LeftClicked(
((lastPos.x()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth, ((lastPosx()-m_viewPort.left())*SCREEN_WIDTH)/actualWidth,
((lastPos.y()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight); ((lastPosy()-m_viewPort.top())*SCREEN_HEIGHT)/actualHeight);
event->accept(); event->accept();
} else { } else {
super::mouseMoveEvent(event); super::mouseMoveEvent(event);
+2
View File
@@ -106,6 +106,7 @@ public:
virtual int overflow(int c = EOF); virtual int overflow(int c = EOF);
virtual int underflow(); virtual int underflow();
virtual int sync(); virtual int sync();
using std::streambuf::setbuf;
virtual std::streambuf * setbuf(char * pr, int nLength); virtual std::streambuf * setbuf(char * pr, int nLength);
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode); virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
@@ -131,6 +132,7 @@ public:
virtual int overflow(int c = EOF); virtual int overflow(int c = EOF);
virtual int underflow(); virtual int underflow();
virtual int sync(); virtual int sync();
using std::streambuf::setbuf;
virtual std::streambuf * setbuf(char * pr, int nLength); virtual std::streambuf * setbuf(char * pr, int nLength);
virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode); virtual std::streampos seekoff(std::streamoff, std::ios::seekdir, std::ios::openmode);
+1 -1
View File
@@ -16,6 +16,6 @@ Wagic, the Homebrew, is a C++ game engine that allows to play card games against
It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc... It is highly customizable and allows the player to tweak the rules / create their own cards, their own themes, etc...
Info, Downloads, and more at http://wololo.net Info, downloads, discussions and more at http://wololo.net/forum/index.php
-![alt text](http://wololo.net/wagic/wp-content/uploads/2009/10/shop.jpg "Screenshot") -![alt text](http://wololo.net/wagic/wp-content/uploads/2009/10/shop.jpg "Screenshot")
+3
View File
@@ -136,6 +136,9 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
$(MTG_PATH)/src/WFont.cpp \ $(MTG_PATH)/src/WFont.cpp \
$(MTG_PATH)/src/WGui.cpp \ $(MTG_PATH)/src/WGui.cpp \
$(MTG_PATH)/src/WResourceManager.cpp \ $(MTG_PATH)/src/WResourceManager.cpp \
$(MTG_PATH)/src/DeckView.cpp \
$(MTG_PATH)/src/CarouselDeckView.cpp \
$(MTG_PATH)/src/GridDeckView.cpp \
$(JGE_PATH)/src/SDLmain.cpp \ $(JGE_PATH)/src/SDLmain.cpp \
$(JGE_PATH)/src/Encoding.cpp \ $(JGE_PATH)/src/Encoding.cpp \
$(JGE_PATH)/src/JAnimator.cpp \ $(JGE_PATH)/src/JAnimator.cpp \
@@ -80,7 +80,6 @@ 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;
@@ -307,7 +306,7 @@ public class SDLActivity extends Activity implements OnKeyListener
private void startDownload() private void startDownload()
{ {
String url = RES_URL + RES_FILENAME; String url = getResourceUrl();
if (!checkStorageState()) if (!checkStorageState())
{ {
Log.e(TAG, "Error in initializing storage space."); Log.e(TAG, "Error in initializing storage space.");
@@ -437,7 +436,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 = "core_" + versionCodeString + ".zip"; RES_FILENAME = getResourceName();
StorageOptions.determineStorageOptions(); StorageOptions.determineStorageOptions();
checkStorageLocationPreference(); checkStorageLocationPreference();
@@ -525,6 +524,9 @@ 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
@@ -27,7 +27,7 @@ OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\
objs/ThisDescriptor.o objs/Token.o objs/Translate.o objs/TranslateKeys.o\ objs/ThisDescriptor.o objs/Token.o objs/Translate.o objs/TranslateKeys.o\
objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o\ objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o\
objs/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o\ objs/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o\
objs/WFont.o objs/WFont.o objs/CarouselDeckView.o objs/GridDeckView.o objs/DeckView.o
DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS)) DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS))
RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache) RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache)
@@ -7,10 +7,13 @@ from optparse import OptionParser
def createResZipFile(filename): def createResZipFile(filename):
utilities = ZipUtilities() utilities = ZipUtilities()
rename = False
if not os.path.isfile('settings/options.txt'): if not os.path.isfile('settings/options.txt'):
os.rename('settings/options.orig.txt', 'settings/options.txt') os.rename('settings/options.orig.txt', 'settings/options.txt')
remame = True
if not os.path.isfile('player/options.txt'): if not os.path.isfile('player/options.txt'):
os.rename('player/options.orig.txt', 'player/options.txt') os.rename('player/options.orig.txt', 'player/options.txt')
rename = True
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED) zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
utilities.addFolderToZip(zip_file, 'themes') utilities.addFolderToZip(zip_file, 'themes')
@@ -26,6 +29,10 @@ def createResZipFile(filename):
utilities.addFolderToZip(zip_file, 'ai') utilities.addFolderToZip(zip_file, 'ai')
zip_file.close() zip_file.close()
if rename:
os.rename('settings/options.txt', 'settings/options.orig.txt')
os.rename('player/options.txt', 'player/options.orig.txt')
def getFilename(): def getFilename():
p = Properties(); p = Properties();
p.load(open('../../build.number.properties')); p.load(open('../../build.number.properties'));
+1
View File
@@ -16,6 +16,7 @@ auto=flashbackrule
auto=retracerule auto=retracerule
auto=suspendrule auto=suspendrule
auto=morphrule auto=morphrule
auto=playfromgraveyardrule
auto=attackrule auto=attackrule
auto=blockrule auto=blockrule
auto=combattriggerrule auto=combattriggerrule
+5
View File
@@ -1513,3 +1513,8 @@ primitive=Zephyr Net
id=142357 id=142357
rarity=C rarity=C
[/card] [/card]
[card]
primitive=Avatar Token
id=-140233
rarity=T
[/card]
+5
View File
@@ -1248,3 +1248,8 @@ primitive=Zombie Goliath
id=190545 id=190545
rarity=C rarity=C
[/card] [/card]
[card]
primitive=Avatar Token
id=-191239
rarity=T
[/card]
+5
View File
@@ -1258,3 +1258,8 @@ primitive=Yavimaya Wurm
id=205221 id=205221
rarity=C rarity=C
[/card] [/card]
[card]
primitive=Avatar Token
id=-205957
rarity=T
[/card]
File diff suppressed because it is too large Load Diff
+21 -9
View File
@@ -18104,6 +18104,13 @@ mana={3}{R}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
name=Crucible of Worlds
auto=lord(land|mygraveyard) CanPlayFromGraveyard
text=You may play land cards from your graveyard.
mana={3}
type=Artifact
[/card]
[card]
name=Crude Rampart name=Crude Rampart
abilities=defender abilities=defender
facedown={3} facedown={3}
@@ -28197,7 +28204,7 @@ subtype=Equipment
[card] [card]
name=Executioner's Swing name=Executioner's Swing
text=Target creature that dealt damage this turn gets -5/-5 until end of turn. text=Target creature that dealt damage this turn gets -5/-5 until end of turn.
target=creature[damaged] target=creature[damager]
auto=-5/-5 ueot auto=-5/-5 ueot
mana={W}{B} mana={W}{B}
type=Instant type=Instant
@@ -31450,7 +31457,7 @@ toughness=2
[/card] [/card]
[card] [card]
name=Flourishing Defenses name=Flourishing Defenses
auto=@counteradded(-1/-1) from(creature|mybattlefield):may token(Elf Warrior,Creature elf warrior,1/1,green) auto=@counteradded(-1/-1) from(creature):may token(Elf Warrior,Creature elf warrior,1/1,green)
text=Whenever a -1/-1 counter is placed on a creature, you may put a 1/1 green Elf Warrior creature token onto the battlefield. text=Whenever a -1/-1 counter is placed on a creature, you may put a 1/1 green Elf Warrior creature token onto the battlefield.
mana={4}{G} mana={4}{G}
type=Enchantment type=Enchantment
@@ -37159,7 +37166,7 @@ type=Sorcery
[/card] [/card]
[card] [card]
name=Grave Pact name=Grave Pact
auto=@movedTo(creature|mygraveyard) from(mybattlefield):ability$!name(sacrifice) notatarget(creature|mybattlefield) sacrifice!$ opponent auto=@movedTo(creature|graveyard) from(mybattlefield):ability$!name(sacrifice) notatarget(creature|mybattlefield) sacrifice!$ opponent
text=Whenever a creature you control dies, each other player sacrifices a creature. text=Whenever a creature you control dies, each other player sacrifices a creature.
mana={1}{B}{B}{B} mana={1}{B}{B}{B}
type=Enchantment type=Enchantment
@@ -73579,7 +73586,7 @@ toughness=6
###The 2 cards below should stay together (Flip Card)### ###The 2 cards below should stay together (Flip Card)###
[card] [card]
name=Rune-Tail, Kitsune Ascendant name=Rune-Tail, Kitsune Ascendant
auto=this(controllerlife >30) all(this) flip(Rune-Tail's Essence) auto=this(controllerlife > 29) transforms((,newability[flip(Rune-Tail's Essence)]))
text=When you have 30 or more life, flip Rune-Tail, Kitsune Ascendant. text=When you have 30 or more life, flip Rune-Tail, Kitsune Ascendant.
mana={2}{W} mana={2}{W}
type=Legendary Creature type=Legendary Creature
@@ -78437,11 +78444,7 @@ toughness=2
[/card] [/card]
[card] [card]
name=Shifting Sky name=Shifting Sky
auto=choice name(choose white) all(this) transforms((,newability[lord(*[-land]) becomes(,white)])) forever auto=chooseacolor lord(*[-land]) becomes(,chosencolor) chooseend
auto=choice name(choose blue) all(this) transforms((,newability[lord(*[-land]) becomes(,blue)])) forever
auto=choice name(choose black) all(this) transforms((,newability[lord(*[-land]) becomes(,black)])) forever
auto=choice name(choose red) all(this) transforms((,newability[lord(*[-land]) becomes(,red)])) forever
auto=choice name(choose green) all(this) transforms((,newability[lord(*[-land]) becomes(,green)])) forever
text=As Shifting Sky enters the battlefield, choose a color. -- All nonland permanents are the chosen color. text=As Shifting Sky enters the battlefield, choose a color. -- All nonland permanents are the chosen color.
mana={2}{U} mana={2}{U}
type=Enchantment type=Enchantment
@@ -103468,6 +103471,15 @@ mana={1}{B}
type=Enchantment type=Enchantment
[/card] [/card]
[card] [card]
name=Yawgmoth's Will
auto=lord(*|mygraveyard) canPlayFromGraveyard
auto=emblem transforms((,newability[@movedTo(*|mygraveyard):all(trigger[to]) moveTo(exile)])) ueot
auto=moveTo(exile)
text=Until end of turn, you may play cards from your graveyard. -- If a card would be put into your graveyard from anywhere this turn, exile that card instead.
mana={2}{B}
type=Sorcery
[/card]
[card]
name=Yawning Fissure name=Yawning Fissure
auto=ability$!name(sacrifice land) notatarget(land|mybattlefield) sacrifice!$ opponent auto=ability$!name(sacrifice land) notatarget(land|mybattlefield) sacrifice!$ opponent
text=Each opponent sacrifices a land. text=Each opponent sacrifices a land.
@@ -3187,19 +3187,6 @@ mana={2}
type=Artifact type=Artifact
[/card] [/card]
[card] [card]
name=Crucible of Worlds
auto={0}:may moveTo(myBattlefield) target(land|mygraveyard) limit:1 myTurnOnly
# Above line does not work: "May moveto" from graveyards does
# not work due to interface issues. The "limit:1" doesn't work
# here either. Even if both worked, then the card would allow
# you to play lands *in addition* to the 1 land you can play per
# turn. Instead it should just give you the option to play this
# 1 land from your hand or your graveyard.
text=You may play land cards from your graveyard.
mana={3}
type=Artifact
[/card]
[card]
name=Cruel Deceiver name=Cruel Deceiver
text={1}: Look at the top card of your library. -- {2}: Reveal the top card of your library. If it's a land card, Cruel Deceiver gains "Whenever Cruel Deceiver deals damage to a creature, destroy that creature" until end of turn. Activate this ability only once each turn. text={1}: Look at the top card of your library. -- {2}: Reveal the top card of your library. If it's a land card, Cruel Deceiver gains "Whenever Cruel Deceiver deals damage to a creature, destroy that creature" until end of turn. Activate this ability only once each turn.
mana={1}{B} mana={1}{B}
+4
View File
@@ -249,6 +249,7 @@ curiosity2_i217.txt
crimson_kobolds.txt crimson_kobolds.txt
crosis_s_catacombs_1.txt crosis_s_catacombs_1.txt
crosis_s_catacombs_2.txt crosis_s_catacombs_2.txt
crucible_of_worlds.txt
crumble.txt crumble.txt
crystal_rod_i172.txt crystal_rod_i172.txt
cursed_land1_i188.txt cursed_land1_i188.txt
@@ -307,6 +308,9 @@ 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
@@ -0,0 +1,26 @@
# Testing crucible of worlds (keyword: CANPLAYFROMGRAVEYARD)
# name=Crucible of Worlds
# text=You may play land cards from your graveyard.
[INIT]
FIRSTMAIN
[PLAYER1]
hand:island,plains
inplay:crucible of worlds
graveyard:forest,mountain
[PLAYER2]
[DO]
forest
# all next lands shouldn't be played
island
mountain
plains
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:crucible of worlds,forest
hand:island,plains
graveyard:mountain
[PLAYER2]
[END]
@@ -0,0 +1,42 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Test that can target creature that damaged creature this turn
[INIT]
combatattackers
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
inplay:Flying Men,Swamp,Plains
hand:Executioner's Swing
[DO]
Grizzly Bears
next
Flying Men
next
next
next
# second main
# kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
graveyard:Grizzly Bears
[PLAYER2]
graveyard:Executioner's Swing,Flying Men
inplay:Plains,Swamp
[END]
@@ -0,0 +1,42 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Test that can target creature that damaged player
[INIT]
combatattackers
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
inplay:Swamp,Plains
hand:Executioner's Swing
[DO]
Grizzly Bears
next
next
next
next
# second main
# kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
graveyard:Grizzly Bears
[PLAYER2]
graveyard:Executioner's Swing
inplay:Plains,Swamp
life:18
[END]
@@ -0,0 +1,34 @@
#NAME: Executioner's Swing
#DESC: Checks targetability
#DESC: Prove that can't target passive creature
[INIT]
secondmain
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
manapool:{B}{W}
hand:Executioner's Swing
[DO]
# attempt to kill bear
yes
Swamp
Plains
Executioner's Swing
Grizzly Bears
endinterruption
[ASSERT]
secondmain
[PLAYER1]
inplay:Grizzly Bears
[PLAYER2]
hand:Executioner's Swing
manapool:{W}{B}
[END]
+8 -4
View File
@@ -2,6 +2,7 @@
<!-- build.properties should contain the values for major, minor and point --> <!-- build.properties should contain the values for major, minor and point -->
<property file="build.properties" /> <property file="build.properties" />
<property file="build.number.properties" /> <property file="build.number.properties" />
<property environment="env"/>
<path id="groovy.class.path" > <path id="groovy.class.path" >
<fileset dir="${groovy.dir}" /> <fileset dir="${groovy.dir}" />
@@ -76,19 +77,22 @@ Author: Michael Nguyen
#define WAGIC_VERSION_MAJOR ${build.major} #define WAGIC_VERSION_MAJOR ${build.major}
#define WAGIC_VERSION_MEDIUM ${build.minor} #define WAGIC_VERSION_MEDIUM ${build.minor}
#define WAGIC_VERSION_MINOR ${build.point} #define WAGIC_VERSION_MINOR ${build.point}
#define WAGIC_VERSION_REVISION ${env.TRAVIS_BUILD_NUMBER}
#define VERSION_DOT(a, b, c) a ##.## b ##.## c #define VERSION_DOT(a, b, c, d) a ##.## b ##.## c ##.## d
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c #define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
#define VERSION_GAME(a, b, c) VERSION_DOT(a, b, c) #define VERSION_GAME(a, b, c, d) VERSION_DOT(a, b, c, d)
#define VERSION_FILE(a, b, c) VERSION_WITHOUT_DOT(a, b, c) #define VERSION_FILE(a, b, c) VERSION_WITHOUT_DOT(a, b, c)
#define VERSION_TOSTRING(a) #a #define VERSION_TOSTRING(a) #a
#define VERSION_STRINGIFY(a) VERSION_TOSTRING(a) #define VERSION_STRINGIFY(a) VERSION_TOSTRING(a)
#define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR) #define WAGIC_VERSION VERSION_GAME(WAGIC_VERSION_MAJOR, WAGIC_VERSION_MEDIUM, WAGIC_VERSION_MINOR, WAGIC_VERSION_REVISION)
#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_VERSION_STRING ".zip" #define WAGIC_RESOURCE_NAME "Wagic-core.zip"
#define WAGIC_RELEASE_NAME "${env.RELEASE_NAME}"
#define WAGIC_RESOURCE_URL "https://github.com/WagicProject/wagic/releases/download/" WAGIC_RELEASE_NAME "/" WAGIC_RESOURCE_NAME
#endif #endif
+2 -1
View File
@@ -2608,7 +2608,8 @@ public:
int removed(MTGCardInstance * card) int removed(MTGCardInstance * card)
{ {
if (abilities.find(card) != abilities.end() && !(forceDestroy == -1 && forcedAlive == 1))//only embelms have forcedestroy = -1 and forcedalive = 1 if (abilities.find(card) != abilities.end()
&& !(forceDestroy == -1 && forcedAlive == 1)) //only embelms have forcedestroy = -1 and forcedalive = 1
{ {
game->removeObserver(abilities[card]); game->removeObserver(abilities[card]);
abilities.erase(card); abilities.erase(card);
+1
View File
@@ -64,6 +64,7 @@ class CardDescriptor: public MTGCardInstance
string compareName; string compareName;
int CDopponentDamaged; int CDopponentDamaged;
int CDcontrollerDamaged; int CDcontrollerDamaged;
int CDdamager;
}; };
#endif #endif
+3 -3
View File
@@ -33,7 +33,7 @@ protected:
/* /*
** Tries to render the Big version of a card picture, backups to text version in case of failure ** Tries to render the Big version of a card picture, backups to text version in case of failure
*/ */
static void RenderBig(MTGCard * card, const Pos& pos); static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false);
static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal); static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal);
static void AlternateRender(MTGCard * card, const Pos& pos); static void AlternateRender(MTGCard * card, const Pos& pos);
@@ -55,8 +55,8 @@ public:
virtual void Render(); virtual void Render();
virtual void Update(float dt); virtual void Update(float dt);
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal); void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false);
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal); static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false);
static JQuadPtr AlternateThumbQuad(MTGCard * card); static JQuadPtr AlternateThumbQuad(MTGCard * card);
virtual ostream& toString(ostream&) const; virtual ostream& toString(ostream&) const;
+45
View File
@@ -0,0 +1,45 @@
#ifndef _CAROUSEL_DECK_VIEW_H_
#define _CAROUSEL_DECK_VIEW_H_
#include "DeckView.h"
#include "Easing.h"
class CarouselDeckView : public DeckView
{
private:
static const float max_scale;
static const float x_center;
static const float right_border;
static const float slide_animation_duration;
static const float scroll_animation_duration;
public:
CarouselDeckView();
virtual ~CarouselDeckView();
void Reset();
void UpdateViewState(float dt);
void UpdateCardPosition(int index);
void renderCard(int index)
{
int alpha = (int) (255 * (mCards[index].scale + 1.0 - max_scale));
DeckView::renderCard(index, alpha);
}
void Render();
bool ButtonPressed(Buttons button);
MTGCard * Click(int x, int y);
MTGCard * Click();
void changePositionAnimated(int offset);
void changeFilterAnimated(int offset);
MTGCard *getActiveCard();
private:
float mScrollOffset, mSlideOffset;
InOutQuadEasing mScrollEasing;
InOutQuadEasing mSlideEasing;
};
#endif //_CAROUSEL_DECK_VIEW_H_
+241
View File
@@ -0,0 +1,241 @@
#ifndef _DECK_VIEW_H_
#define _DECK_VIEW_H_
#include <vector>
#include "MTGCard.h"
#include "DeckDataWrapper.h"
#include "WFont.h"
#include "WResourceManager.h"
#include "Pos.h"
/*! \brief A abstract base class for deck views
*
* The deck editor uses a deck view to present the cards
* e.g. in a circular "Carousel" layout or in a flat grid
* layout. Both layouts inherit this base class to ensure
* a common interface which the deck editor can rely on.
*/
class DeckView
{
protected:
/*! \brief defines the delay until additional card informations get shown
*
* \note I am not entirely sure about that
*/
static const float no_user_activity_show_card_delay;
/*! \brief Represents a card for internal use in the deck view
*
* It stores positional information and a pointer to the actual card structure.
*/
struct CardRep{
float x;
float y;
float scale;
MTGCard * card;
};
public:
/*! \brief Defines if the filter needs an update
*
* The owner of the deck that is shown is responsible for updating the filters.
*/
bool dirtyFilters;
/*! \brief Defines if the card positions need an update
*
* If the card positions are dirty, UpdateCardPosition will get called on
* all cards during Update(float dt);
*
* \see Update
* \see UpdateCardPosition
*/
bool dirtyCardPos;
/*! \brief Constructs the view and initializes datamembers
*
* It sets the dirty states to true, the currently shown deck to NULL and selects filter 0.
*
* \param numberOfCards the number of cards the view handles (this includes hidden cards for caching)
*/
DeckView(int numberOfCards);
/*! \brief Does nothing but is needed to ensure proper deletion of derived classes.
*/
virtual ~DeckView();
/*! \brief Resets nearly all datamembers to their initial values
*
* Does not reset mCards.
*/
virtual void Reset();
/*! \brief Advances the view by dt time units
*
* This method calls UpdateViewState unconditionally and UpdateCardPosition on every card
* if dirtyCardPos is set. It then resets dirtyCardPos.
*
* \param dt the number of time units to advance
* \see UpdateViewState
* \see UpdateCardPosition
*/
void Update(float dt);
/*! \brief Sets the deck that this view shows
*
* This method replaces the currently shown deck with toShow, sets all dirty states and
* reloads the mtg cards. No ownership changes.
*
* \param toShow the deck to show
* \see reloadIndexes
*/
void SetDeck(DeckDataWrapper *toShow);
/*! \brief Returns a pointer to the current deck.
*/
DeckDataWrapper *deck();
/*! \brief Performs an immediate switch of the filter without animations
*
* This method rotates the currently selected filter by delta and sets dirtyFilters.
*
* \param delta the filter to select relatively to the currently selected filter
* \see dirtyFilters
*/
void changeFilter(int delta);
/*! \brief Performs an immediate switch of the position without animations
*
* If the i-th card stored in mCards points to the j-th card in the deck, it will point
* to the (j+delta)-th card after this method is called. No dirty states are set.
*
* \param delta the number of cards to advances
* \see mCards
*/
void changePosition(int delta);
/*! \brief Returns the number of the currently selected filter
*
* \return the currently selected filter
*/
int filter();
/*! \brief Reloads the mtg card pointers of mCards from the deck
*
* This is called when: We change the position in the deck or the deck structure changes
* (due to filtering or addition or removal of cards).
*/
void reloadIndexes();
/*! \brief Returns the current position in the deck
*/
int getPosition();
/*! \brief Renders the view
*/
virtual void Render() = 0;
/*! \brief Reacts to selections by a pointer device (e. g. mouse, touch)
*
* If the selection in view internal i. e. a card got selected, there is
* no outside action performed and this method will return NULL. If a action got
* triggered i. e. a selected card was activated, it returns that card
* for further handling by the caller.
*
* \param x the x coordinate of the pointer during the action
* \param y the y coordinate of the pointer during the action
* \returns the card the action corresponds to
*/
virtual MTGCard * Click(int x, int y) = 0;
/*! \brief Reacts to selections by pointerless devices (e. g. buttons)
*
* \see Click(int x, int y)
* \returns the card the actions corresponds to
*/
virtual MTGCard * Click() = 0;
/*! \brief Handles ordinary button presses
*
* \param the pressed JButton
* \returns true if the view reacted to the button and false otherwise
*/
virtual bool ButtonPressed(Buttons button) = 0;
/*! \brief Returns the currently active card
*/
virtual MTGCard *getActiveCard() = 0;
/*! \brief Changes the position by a given offset
*
* Advances the view by offset cards and animates the change.
*
* \param offset the number of positions to advance
*/
virtual void changePositionAnimated(int offset) = 0;
/*! \brief Changes the filter by a given offset
*
* Rotates the selected filter by the given offset and animates the change.
*/
virtual void changeFilterAnimated(int offset) = 0;
protected:
/*! \brief The number of time units since an user activity occurred
*/
float last_user_activity;
/*! \brief The currently selected filter
*/
int mFilter;
/*! \brief The currently selected deck
*
* This class does not take ownership of the deck
*/
DeckDataWrapper *mCurrentDeck;
/*! \brief The card positions and pointers
*/
vector<CardRep> mCards;
/*! \brief Renders a card with given alpha value
*
* \param index of the card in mCards to render
* \param alpha the alpha value of the card
* \param asThumbnail renders the thumbnail image of the card if set to true
*
* \see mCards
*/
void renderCard(int index, int alpha, bool asThumbnail = false);
/*! \brief Returns the index in mCards of the card that is nearest to the given point
*
* \note This method uses the euclidian distance to the center of the card
*
* \param x the reference points x coordinate
* \param y the reference points y coordinate
* \returns the index of the nearest card to the reference point and -1 of mCards is empty
*/
int getCardIndexNextTo(int x, int y);
private:
/*! \brief Updates the state of the view e. g. view transitions
*
* \param dt the passes time since the last update
*/
virtual void UpdateViewState(float dt) = 0;
/*! \brief Updates the given card reps positional members
*
* This method is called from Update when dirtyCardPos is set
*
* \param index the index in mCards of the card to update
*
* \see Update
* \see mCards
*/
virtual void UpdateCardPosition(int index) = 0;
};
#endif // _DECK_VIEW_H_
+245
View File
@@ -0,0 +1,245 @@
#ifndef _EASING_H_
#define _EASING_H_
/*! \brief A class for eased floats for use in animations
*
* Animations often defines values a floating point variable
* should have at given times and interpolates between them to
* calculate the value of that variable at any given intermediate
* time step.
*
* The simplest case would be linear interpolation:
* Suppose a float "position" should be a at time = 0 and
* b at time = x. If the current time is y, the value of
* "position" is then a + (b-a)*y/x.
*
* This class defines the interface needed to implement different
* kind of interpolations with a common interface. See
* http://www.gizma.com/easing/ for more information for a few
* examples.
*/
class Easing
{
public:
/*! \brief The value at the start of an animation.
*
* start_value is undefined if no animation is running.
*/
float start_value;
/*! \brief The amount the value should change during the animation.
*
* delta_value is undefined if no animation is running.
*/
float delta_value;
/*! \brief The current value.
*
* Use this member to read the value or to write the value without
* to animate intermediate values and. Make sure that the easing
* is not used once value is deleted.
*/
float& value;
/*! \brief The duration the animation should take
*
* It is not relevant which unit is used. This value is undefined
* if no animation is running.
*/
float duration;
/*! \brief The accumulated time the animation did run until now.
*
* It is not relevant which unit is used. This values is undefined
* if no animation is running.
*/
float time_acc;
/*! \brief Sets Easing::float to val and sets the animation as not running.
*
* Make sure that the easing is not used once value is deleted.
*
* \param val The value to ease
*/
Easing(float& val): start_value(val), delta_value(0), value(val), duration(0), time_acc(0)
{
}
/*! \brief Resets the animation to its initial value
*
* This method does set the value to the start value and sets the passed time to 0.
* If there is no animation animation running, the resulting value is undefined.
*/
void reset()
{
value = start_value;
time_acc = 0;
}
/*! \brief Finishes the animation immediately
*
* Sets the value to the animations target value and the passed time to the
* animations duration. If there is no animation running, the behaviour is undefined.
*/
void finish()
{
value = start_value + delta_value;
time_acc = duration;
}
/*! \brief Lets dt time pass
*
* Advances the animation by dt time units and updates the value accordingly.
*
* \val dt The amount of time to jump forward
*/
void update(float dt)
{
if(time_acc < duration)
{
time_acc += dt;
if(time_acc > duration)
{
time_acc = duration;
value = start_value + delta_value;
}
else
{
updateValue();
}
}
}
/*! \brief Calculates the value from all other members.
*
* This method gets implemented by all specific easing classes.
*/
virtual void updateValue() = 0;
/*! \brief Starts the animation.
*
* Starts the interpolation from the current value (now) to
* targetValue (in now + _duration).
*
* If the animation is currently running, it gets replaced.
*
* \param targetValue The value to interpolate to
* \param _duration The duration the interpolation should take
*/
void start(float targetValue, float _duration)
{
start_value = value;
delta_value = targetValue - start_value;
time_acc = 0;
duration = _duration;
}
/*! \brief Translates the current value and the target value by delta_value
*
* This method is mainly used for trickery. Suppose there is one object in the
* middle of the screen that should move to the top until it is outside of the
* screen and gets replaced by a second one entering the screen from the lower
* side once the first one disappeared. This method can be used to simulate this
* effect with one animation by translating (i.e. moving) the animation from the
* top to the bottom:
*
* Object1 and object2 are the same object: object1 whose y position is bound to value
* To start the transition, use start(SCREEN_HEIGHT, desired time); Once the first
* object left the screen (i.e. object.y < 0), change objects appearance to object2
* and translate the easing by (SCREEN_HEIGHT).
*
* \param delta_value The change in start_value and value
*/
void translate(float delta_value)
{
start_value += delta_value;
value += delta_value;
}
/*! \brief Returns if the passed time exceeds duration.
*
* If ther is no animation running, it is ensured that this is true.
*/
bool finished()
{
return time_acc >= duration;
}
};
/*! \brief This class defines an easing with quadratic acceleration
*/
class InQuadEasing : public Easing
{
public:
/*! \brief Calls Easing::Easing(val).
*
* \see Easing::Easing(float& val)
*/
InQuadEasing(float& val): Easing(val) {}
/*! \brief Implements the value calculation.
*
* \see Easing::updateValue()
*/
void updateValue()
{
float time_tmp = time_acc / duration;
value = delta_value * time_tmp * time_tmp + start_value;
}
};
/*! \brief This class defines an easing with quadratic decceleration
*/
class OutQuadEasing : public Easing
{
public:
/*! \brief Calls Easing::Easing(val).
*
* \see Easing::Easing(float& val)
*/
OutQuadEasing(float& val): Easing(val) {}
/*! \brief Implements the value calculation.
*
* \see Easing::updateValue()
*/
void updateValue()
{
float time_tmp = time_acc / duration;
value = (-delta_value) * time_tmp * (time_tmp - 2.0f) + start_value;
}
};
/*! \brief This class defines an easing with quadratic acceleration and decceleration.
*/
class InOutQuadEasing : public Easing
{
public:
/*! \brief Calls Easing::Easing(val).
*
* \see Easing::Easing(float& val)
*/
InOutQuadEasing(float& val): Easing(val) {}
/*! \brief Implements the value calculation.
*
* \see Easing::updateValue()
*/
void updateValue()
{
float time_tmp = (time_acc * 2) / duration;
if (time_tmp < 1)
{
value = (float)(delta_value * 0.5 * time_tmp * time_tmp + start_value);
}
else
{
time_tmp -= 1;
value = (float)(- delta_value * 0.5 * (time_tmp * (time_tmp - 2) - 1) + start_value);
}
}
};
#endif //_EASING_H_
-1
View File
@@ -17,7 +17,6 @@ private:
WSrcCards * setSrc; WSrcCards * setSrc;
SimpleMenu * menu; SimpleMenu * menu;
bool showMenu; bool showMenu;
bool showAlt;
bool saveMe; bool saveMe;
int mState; int mState;
int mDetailItem; int mDetailItem;
+26 -54
View File
@@ -19,22 +19,7 @@
#include "WGui.h" #include "WGui.h"
#include "InteractiveButton.h" #include "InteractiveButton.h"
#define NO_USER_ACTIVITY_HELP_DELAY 10 class DeckView;
#define NO_USER_ACTIVITY_SHOWCARD_DELAY 0.1
enum
{
STAGE_TRANSITION_RIGHT = 0,
STAGE_TRANSITION_LEFT = 1,
STAGE_WAITING = 2,
STAGE_TRANSITION_UP = 3,
STAGE_TRANSITION_DOWN = 4,
STAGE_ONSCREEN_MENU = 5,
STAGE_WELCOME = 6,
STAGE_MENU = 7,
STAGE_FILTERS = 8,
STAGE_TRANSITION_SELECTED = 9
};
// TODO: need a better name for MENU_FIRST_MENU, this is reused for the 1st submenu of // TODO: need a better name for MENU_FIRST_MENU, this is reused for the 1st submenu of
// available options in the duel menu // available options in the duel menu
@@ -44,7 +29,7 @@ enum
MENU_DECK_SELECTION = 10, MENU_DECK_SELECTION = 10,
MENU_DECK_BUILDER = 11, MENU_DECK_BUILDER = 11,
MENU_FIRST_DUEL_SUBMENU = 102, MENU_FIRST_DUEL_SUBMENU = 102,
MENU_LANGUAGE_SELECTION = 103, MENU_LANGUAGE_SELECTION = 103
}; };
// enums for menu options // enums for menu options
@@ -64,79 +49,69 @@ enum DECK_VIEWER_MENU_ITEMS
MENU_ITEM_NO = 21, MENU_ITEM_NO = 21,
MENU_ITEM_FILTER_BY = 22, MENU_ITEM_FILTER_BY = 22,
MENUITEM_MORE_INFO = kInfoMenuID MENUITEM_MORE_INFO = kInfoMenuID
}; };
#define ALL_COLORS -1
#define ROTATE_LEFT 1;
#define ROTATE_RIGHT 0;
#define HIGH_SPEED 15.0
#define MED_SPEED 5.0f
#define LOW_SPEED 1.5
#define MAX_SAVED_FILTERS Constants::NB_Colors + 1
#define CARDS_DISPLAYED 10
class GameStateDeckViewer: public GameState, public JGuiListener class GameStateDeckViewer: public GameState, public JGuiListener
{ {
private: private:
enum DeckViewerStages
{
STAGE_WAITING = 0,
STAGE_ONSCREEN_MENU,
STAGE_WELCOME,
STAGE_MENU,
STAGE_FILTERS
};
vector<JQuadPtr> mIcons; vector<JQuadPtr> mIcons;
JQuadPtr pspIcons[8]; JQuadPtr pspIcons[8];
JTexture * pspIconsTexture; JTexture * pspIconsTexture;
float last_user_activity; float last_user_activity;
float onScreenTransition; float onScreenTransition;
float mRotation; DeckViewerStages mStage;
float mSlide;
int mAlpha;
int mStage;
int useFilter;
JMusic * bgMusic; JMusic * bgMusic;
int lastPos;
int lastTotal;
int mSelected;
InteractiveButton *toggleDeckButton, *sellCardButton, *statsPrevButton, *filterButton; InteractiveButton *toggleDeckButton, *sellCardButton, *statsPrevButton, *filterButton, *toggleViewButton;
WGuiFilters * filterMenu; WGuiFilters * filterMenu;
WSrcDeckViewer * source; WSrcDeckViewer * source;
DeckEditorMenu * welcome_menu; DeckEditorMenu * welcome_menu;
SimpleMenu * subMenu; SimpleMenu * subMenu;
DeckEditorMenu * menu; DeckEditorMenu * deckMenu;
PriceList* pricelist; PriceList* pricelist;
PlayerData * playerdata; PlayerData * playerdata;
int price;
DeckDataWrapper * displayed_deck;
DeckDataWrapper * myDeck; DeckDataWrapper * myDeck;
DeckDataWrapper * myCollection; DeckDataWrapper * myCollection;
MTGCard * cardIndex[CARDS_DISPLAYED]; StatsWrapper * mStatsWrapper;
StatsWrapper *stw;
int hudAlpha; int hudAlpha;
string newDeckname; string newDeckname;
bool isAIDeckSave; bool isAIDeckSave;
bool mSwitching; bool mSwitching;
enum AvailableView{
CAROUSEL_VIEW,
GRID_VIEW
};
DeckView* mView;
AvailableView mCurrentView;
void saveDeck(); //Saves the deck and additional necessary information void saveDeck(); //Saves the deck and additional necessary information
void saveAsAIDeck(string deckName); // saves deck as an AI Deck void saveAsAIDeck(string deckName); // saves deck as an AI Deck
int getCurrentPos();
void sellCard(); void sellCard();
void setButtonState(bool state); void setButtonState(bool state);
bool userPressedButton(); bool userPressedButton();
void RenderButtons(); void RenderButtons();
void setupView(AvailableView view, DeckDataWrapper *deck);
pair<float, float> cardsCoordinates[CARDS_DISPLAYED]; void toggleView();
public: public:
GameStateDeckViewer(GameApp* parent); GameStateDeckViewer(GameApp* parent);
virtual ~GameStateDeckViewer(); virtual ~GameStateDeckViewer();
void updateDecks(); void updateDecks();
void rotateCards(int direction);
void loadIndexes();
void updateFilters(); void updateFilters();
void rebuildFilters(); void rebuildFilters();
void switchDisplay(); void toggleCollection();
void Start(); void Start();
virtual void End(); virtual void End();
void addRemove(MTGCard * card); void addRemove(MTGCard * card);
@@ -145,11 +120,8 @@ public:
void renderSlideBar(); void renderSlideBar();
void renderDeckBackground(); void renderDeckBackground();
void renderOnScreenMenu(); void renderOnScreenMenu();
virtual void renderCard(int id, float rotation);
virtual void renderCard(int id);
virtual void Render(); virtual void Render();
int loadDeck(int deckid); int loadDeck(int deckid);
void LoadDeckStatistics(int deckId);
void OnScroll(int inXVelocity, int inYVelocity); void OnScroll(int inXVelocity, int inYVelocity);
-1
View File
@@ -65,7 +65,6 @@ private:
JQuadPtr pspIcons[8]; JQuadPtr pspIcons[8];
WSrcCards * srcCards; WSrcCards * srcCards;
TaskList * taskList; TaskList * taskList;
float mElapsed;
WGuiMenu * shopMenu; WGuiMenu * shopMenu;
WGuiFilters * filterMenu; //Filter menu slides in sideways from right, or up from bottom. WGuiFilters * filterMenu; //Filter menu slides in sideways from right, or up from bottom.
WGuiCardImage * bigDisplay; WGuiCardImage * bigDisplay;
+154
View File
@@ -0,0 +1,154 @@
#ifndef _GRID_DECK_VIEW_H
#define _GRID_DECK_VIEW_H
#include "DeckView.h"
#include "Easing.h"
/*! \brief Implements a grid view
*
* This view displays 12 cards in two rows as thumbnails. The currently
* selected card is dislayed bigger than the rest and uses the fullsize
* image. Scrolling the view horizontally and toggeling filters is
* animated and uses quadratic easing.
*
* It also implements a button mode for pointerless devices.
*/
class GridDeckView : public DeckView
{
private:
static const float scroll_animation_duration;
static const float slide_animation_duration;
static const float card_scale_small;
static const float card_scale_big;
public:
/*! \brief Constructs a grid view with no decks set
*/
GridDeckView();
/*! \brief Does nothing but is needed to ensure proper deletion of derived classes.
*/
virtual ~GridDeckView();
/*! \brief Resets almost all member variables but mRows and mCols
*/
void Reset();
/*! \brief Advances scrolling and sliding animations
*
* \param dt the time since the last update
*
* \see DeckView::UpdateViewState()
*/
void UpdateViewState(float dt);
/*! \brief Updates the cards position
*
* \see DeckView::UpdateCardPosition()
*/
void UpdateCardPosition(int index);
/*! \brief Renders the view
*
* This method prefetches all rendered cards as thumbnails except the
* selected card to reduce cache pressure.
*/
void Render();
/*! \brief Handles button presses
*
* The mapping is as follows:
* JGE_BTN_LEFT moves the position to the left if not in button mode
* moves the selection otherwise
* JGE_BTN_RIGHT move the position to the right if not in button mode
* moves the selection otherwise
* JGE_BTN_UP select the previous filter if not in button mode
* moves the selection otherwise
* JGE_BTN_DOWN select the next filter if not in button mode
* moves the selection otherwise
* JGE_BTN_CTRL deactivate button mode
*
* \param button the pressed button
* \returns if the view handled the button
*/
bool ButtonPressed(Buttons button);
/*! \brief Handles clicks and triggers scrolling and the selection of cards
*
* This method deactivates the button mode and searches for the nearest
* card to the given position. If this card is in column 0 or 1 it scrolls
* left. If it is in column (mCols-1) or (mCols-2) it scrolls to the right.
* In any other case, it selects the card.
*
* \param x the clicks x coordinate
* \param y the clicks y coordinate
*
* \return selected card c if c was already selected and no animation is running, NULL otherwise
*/
MTGCard * Click(int x, int y);
/*! \brief Handles pointerless clicks (JGE_BTN_OK)
*
* If no card is selected, this method activates button mode and selects a card.
*
* \returns selected card, NULL otherwise
*/
MTGCard * Click();
/*! \brief Scrolls the view horizontally
*
* \param offset the number of columns to scroll
*/
void changePositionAnimated(int offset);
/*! \brief Rotates the selected filter and slides vertically
*
* \param the number of filters to rotate
*/
void changeFilterAnimated(int offset);
/*! \brief Returns the currently selected card
*
* \returns card c if c is selected and in column 4 to 6 and NULL otherwise*/
MTGCard *getActiveCard();
private:
/*! \brief The amount of columns (visible and hidden)
*/
const int mCols;
/*! \brief The amount of rows
*/
const int mRows;
/*! \brief The current scrolling offset
*/
float mScrollOffset;
/*! \brief The current sliding offset
*/
float mSlideOffset;
/*! \brief The easing functor that gets applied while scrolling
*/
InOutQuadEasing mScrollEasing;
/*! \brief The easing functor that gets applied while sliding
*/
InOutQuadEasing mSlideEasing;
/*! \brief The current selected card index
*/
int mCurrentSelection;
/*! \brief Stores if we are in button mode.
*/
bool mButtonMode;
/*! \brief Moves the card selection by an offset.
*
* \param offset the offset to move the selection
* \param alignIfOutOfBounds the view will scroll if the selection moves out of bound if set to true
*/
void moveSelection(int offset, bool alignIfOutOfBounds);
};
#endif //_GRID_DECK_VIEW_H
+2 -1
View File
@@ -6,8 +6,9 @@
#include <hge/hgeparticle.h> #include <hge/hgeparticle.h>
#include "JGE.h" #include "JGE.h"
#include "MTGDefinitions.h" #include "MTGDefinitions.h"
#include "GameApp.h" #include "Pos.h"
#include "GuiLayers.h" #include "GuiLayers.h"
#include "WResource_Fwd.h"
class ManaIcon : public Pos class ManaIcon : public Pos
{ {
+12 -2
View File
@@ -4,15 +4,25 @@
#include "GuiLayers.h" #include "GuiLayers.h"
#include "PhaseRing.h" #include "PhaseRing.h"
#include "WEvent.h" #include "WEvent.h"
#include "PlayGuiObject.h"
#include "Easing.h"
class GuiPhaseBar: public GuiLayer, public PlayGuiObject class GuiPhaseBar: public GuiLayer, public PlayGuiObject
{ {
protected: private:
Phase* phase; static const float zoom_big;
static const float zoom_small;
static const float step;
int displayedPhaseId;
float angle; float angle;
float zoomFactor; float zoomFactor;
OutQuadEasing angleEasing;
InOutQuadEasing zoomFactorEasing;
DuelLayers* mpDuelLayers; DuelLayers* mpDuelLayers;
void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale);
public: public:
GuiPhaseBar(DuelLayers* duelLayers); GuiPhaseBar(DuelLayers* duelLayers);
~GuiPhaseBar(); ~GuiPhaseBar();
-1
View File
@@ -47,7 +47,6 @@ protected:
{ {
static const float HEIGHT; static const float HEIGHT;
unsigned attackers; unsigned attackers;
unsigned blockers;
unsigned currentAttacker; unsigned currentAttacker;
float height; float height;
+1
View File
@@ -28,6 +28,7 @@ const int kNextStatsButtonId = 10005;
const int kPrevStatsButtonId = 10006; const int kPrevStatsButtonId = 10006;
const int kCycleCardsButtonId = 10007; const int kCycleCardsButtonId = 10007;
const int kShowCardListButtonId = 10008; const int kShowCardListButtonId = 10008;
const int kSwitchViewButton = 10009;
class InteractiveButton: public SimpleButton class InteractiveButton: public SimpleButton
{ {
+1
View File
@@ -65,6 +65,7 @@ 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;
-1
View File
@@ -4,7 +4,6 @@
#define MTG_ERROR -1 #define MTG_ERROR -1
#include "MTGDefinitions.h" #include "MTGDefinitions.h"
#include "GameApp.h"
#include "WResourceManager.h" #include "WResourceManager.h"
#include <dirent.h> #include <dirent.h>
#include <Threading.h> #include <Threading.h>
+2 -1
View File
@@ -218,7 +218,8 @@ class Constants
soulbond = 100, soulbond = 100,
LURE = 101, LURE = 101,
NOLEGEND = 102, NOLEGEND = 102,
NB_BASIC_ABILITIES = 103, CANPLAYFROMGRAVEYARD = 103,
NB_BASIC_ABILITIES = 104,
RARITY_S = 'S', //Special Rarity RARITY_S = 'S', //Special Rarity
+16
View File
@@ -66,6 +66,7 @@ public:
MTGEventBonus(GameObserver* observer, int _id); MTGEventBonus(GameObserver* observer, int _id);
virtual MTGEventBonus * clone() const; virtual MTGEventBonus * clone() const;
}; };
class MTGPutInPlayRule: public PermanentAbility class MTGPutInPlayRule: public PermanentAbility
{ {
public: public:
@@ -172,6 +173,21 @@ public:
virtual MTGMorphCostRule * clone() const; virtual MTGMorphCostRule * clone() const;
}; };
class MTGPlayFromGraveyardRule: public MTGAlternativeCostRule
{
public:
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL);
int reactToClick(MTGCardInstance * card);
virtual ostream& toString(ostream& out) const;
MTGPlayFromGraveyardRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "cast card from graveyard";
}
virtual MTGPlayFromGraveyardRule * clone() const;
};
class MTGSuspendRule: public MTGAlternativeCostRule class MTGSuspendRule: public MTGAlternativeCostRule
{ {
public: public:
+2
View File
@@ -1,6 +1,8 @@
#ifndef OBJECTANALYTICS_H #ifndef OBJECTANALYTICS_H
#define OBJECTANALYTICS_H #define OBJECTANALYTICS_H
#include <boost/cstdint.hpp>
#ifdef _DEBUG #ifdef _DEBUG
#define TRACK_OBJECT_USAGE #define TRACK_OBJECT_USAGE
#endif #endif
-1
View File
@@ -7,7 +7,6 @@
#include <JGui.h> #include <JGui.h>
#include <vector> #include <vector>
#include <string> #include <string>
#include "GameApp.h"
#include "GameStateOptions.h" #include "GameStateOptions.h"
#include "WFilter.h" #include "WFilter.h"
#include "WDataSrc.h" #include "WDataSrc.h"
+3 -1
View File
@@ -20,16 +20,18 @@ public:
~PriceList(); ~PriceList();
int save(); int save();
int getSellPrice(int cardid); int getSellPrice(int cardid);
int getSellPrice(MTGCard* card);
int getPurchasePrice(int cardid); int getPurchasePrice(int cardid);
int getPrice(MTGCard *card);
int getPrice(int cardId); int getPrice(int cardId);
int setPrice(int cardId, int price); int setPrice(int cardId, int price);
int setPrice(MTGCard *card, int price);
int getOtherPrice(int amt); int getOtherPrice(int amt);
static float difficultyScalar(float price, int cardid = 0); static float difficultyScalar(float price, int cardid = 0);
static void updateKey() static void updateKey()
{ {
randomKey = rand(); randomKey = rand();
} }
;
}; };
#endif #endif
-1
View File
@@ -20,7 +20,6 @@ class SimplePopup: public JGuiController
private: private:
float mWidth, mX, mY; float mWidth, mX, mY;
int mMaxLines; int mMaxLines;
int mFontId;
DeckMetaData * mDeckInformation; DeckMetaData * mDeckInformation;
string mTitle; string mTitle;
WFont *mTextFont; WFont *mTextFont;
+13 -2
View File
@@ -2,6 +2,15 @@
#define TASK_H #define TASK_H
#include <vector> #include <vector>
#include <string>
#include "Easing.h"
using namespace std;
class GameObserver;
class JQuad;
class JTexture;
// Task type constant // Task type constant
@@ -70,8 +79,11 @@ class TaskList
{ {
protected: protected:
string fileName; string fileName;
float vPos; float vPos;
float mElapsed; OutQuadEasing vPosInEasing;
InQuadEasing vPosOutEasing;
int mState; int mState;
JQuad * mBg[9]; JQuad * mBg[9];
JTexture * mBgTex; JTexture * mBgTex;
@@ -95,7 +107,6 @@ public:
{ {
return mState; return mState;
} }
;
void addTask(string params, bool rand = false); void addTask(string params, bool rand = false);
void addTask(Task *task); void addTask(Task *task);
void addRandomTask(int diff = 100); void addRandomTask(int diff = 100);
+2
View File
@@ -1,3 +1,5 @@
#include "MTGDeck.h"
#ifndef _WFILTER_H_ #ifndef _WFILTER_H_
#define _WFILTER_H_ #define _WFILTER_H_
/** /**
+1
View File
@@ -8,6 +8,7 @@
class hgeDistortionMesh; class hgeDistortionMesh;
class GameStateOptions; class GameStateOptions;
class SimpleMenu;
/** /**
@defgroup WGui Basic Gui @defgroup WGui Basic Gui
+4 -4
View File
@@ -1,12 +1,12 @@
#ifndef WRESOURCE_FWD_H #ifndef WRESOURCE_FWD_H
#define WRESOURCE_FWD_H #define WRESOURCE_FWD_H
#ifndef WP8 #if (__cplusplus > 199711L)
#include <boost/shared_ptr.hpp>
typedef boost::shared_ptr<JQuad> JQuadPtr;
#else
#include <memory> #include <memory>
typedef std::shared_ptr<JQuad> JQuadPtr; typedef std::shared_ptr<JQuad> JQuadPtr;
#else
#include <boost/shared_ptr.hpp>
typedef boost::shared_ptr<JQuad> JQuadPtr;
#endif #endif
#endif #endif
+1 -1
View File
@@ -1,7 +1,7 @@
#ifndef _DEBUG_H_ #ifndef _DEBUG_H_
#define _DEBUG_H_ #define _DEBUG_H_
#if ((defined WIN32) || (defined WP8)) #if ((defined WIN32) || (defined WP8)) && !defined(__MINGW32__)
#define snprintf sprintf_s #define snprintf sprintf_s
#endif #endif
+1
View File
@@ -26,6 +26,7 @@
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include <stdlib.h> #include <stdlib.h>
#include <list>
#include "DebugRoutines.h" #include "DebugRoutines.h"
+1 -1
View File
@@ -316,7 +316,7 @@ bool AIHints::canWeCombo(GameObserver* observer,MTGCardInstance * card,AIPlayerB
int comboPartsRestriction = 0; int comboPartsRestriction = 0;
if(gotCombo) if(gotCombo)
return gotCombo;//because more then one might be possible at any time. return gotCombo;//because more than one might be possible at any time.
if (hints[i]->hold.size()) if (hints[i]->hold.size())
{ {
for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++) for(unsigned int hPart = 0; hPart < hints[i]->hold.size(); hPart++)
+2 -2
View File
@@ -446,7 +446,7 @@ int OrderedAIAction::getEfficiency()
} }
if ((drawer->getNumCards() >= p->game->library->nb_cards && (Targetable*)p == drawer->getTarget()) || (p->game->hand->nb_cards > 10 && (Targetable*)p == drawer->getTarget())) if ((drawer->getNumCards() >= p->game->library->nb_cards && (Targetable*)p == drawer->getTarget()) || (p->game->hand->nb_cards > 10 && (Targetable*)p == drawer->getTarget()))
{ {
//if the amount im drawing will mill me to death or i have more then 10 cards in hand, eff is 0; //if the amount im drawing will mill me to death or i have more than 10 cards in hand, eff is 0;
efficiency = 0; efficiency = 0;
} }
break; break;
@@ -854,7 +854,7 @@ ManaCost * AIPlayerBaka::getPotentialMana(MTGCardInstance * target)
if (card == target) if (card == target)
used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76 used[card] = true; //http://code.google.com/p/wagic/issues/detail?id=76
if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost() == 1) if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost() == 1)
{//ai can't use cards which produce more then 1 converted while using the old pMana method. {//ai can't use cards which produce more than 1 converted while using the old pMana method.
result->add(amp->output); result->add(amp->output);
used[card] = true; used[card] = true;
} }
+15 -18
View File
@@ -1994,28 +1994,23 @@ int AADynamic::resolve()
break; break;
case DYNAMIC_ABILITY_WHO_ITSELF: case DYNAMIC_ABILITY_WHO_ITSELF:
source = ((MTGCardInstance *) _target); source = ((MTGCardInstance *) _target);
_target = _target;
break; break;
case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER: case DYNAMIC_ABILITY_WHO_TARGETCONTROLLER:
_target = _target;
secondaryTarget = ((MTGCardInstance *) _target)->controller(); secondaryTarget = ((MTGCardInstance *) _target)->controller();
break; break;
case DYNAMIC_ABILITY_WHO_TARGETOPPONENT: case DYNAMIC_ABILITY_WHO_TARGETOPPONENT:
_target = _target;
secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent(); secondaryTarget = ((MTGCardInstance *) _target)->controller()->opponent();
break; break;
case DYNAMIC_ABILITY_WHO_TOSOURCE: case DYNAMIC_ABILITY_WHO_TOSOURCE:
tosrc = true; tosrc = true;
break; break;
case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER: case DYNAMIC_ABILITY_WHO_SOURCECONTROLLER:
_target = _target;
secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller(); secondaryTarget = ((MTGCardInstance *) OriginalSrc)->controller();
break; break;
case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT: case DYNAMIC_ABILITY_WHO_SOURCEOPPONENT:
secondaryTarget = OriginalSrc->controller()->opponent(); secondaryTarget = OriginalSrc->controller()->opponent();
break; break;
default: default:
_target = _target;
break; break;
} }
if(amountsource == DYNAMIC_MYSELF_AMOUNT) if(amountsource == DYNAMIC_MYSELF_AMOUNT)
@@ -4728,14 +4723,15 @@ 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";
} }
@@ -5419,8 +5415,8 @@ AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _sourc
} }
void AACastCard::Update(float dt) void AACastCard::Update(float dt)
{ {
MTGAbility::Update(dt); MTGAbility::Update(dt);
if (processed) if (processed)
return; return;
@@ -5468,10 +5464,10 @@ AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _sourc
resolveSpell(); resolveSpell();
this->forceDestroy = 1; this->forceDestroy = 1;
return; return;
} }
int AACastCard::isReactingToTargetClick(Targetable * card){return 0;} int AACastCard::isReactingToTargetClick(Targetable * card){return 0;}
int AACastCard::reactToTargetClick(Targetable * object) int AACastCard::reactToTargetClick(Targetable * object)
{ {
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object)) if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
return reactToClick(cObject); return reactToClick(cObject);
@@ -5486,16 +5482,16 @@ AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _sourc
return 1; return 1;
} }
return 0; return 0;
} }
MTGCardInstance * AACastCard::makeCard() MTGCardInstance * AACastCard::makeCard()
{ {
MTGCardInstance * card = NULL; MTGCardInstance * card = NULL;
MTGCard * cardData = MTGCollection()->getCardByName(cardNamed); MTGCard * cardData = MTGCollection()->getCardByName(cardNamed);
card = NEW MTGCardInstance(cardData, source->controller()->game); card = NEW MTGCardInstance(cardData, source->controller()->game);
source->controller()->game->temp->addCard(card); source->controller()->game->temp->addCard(card);
return card; return card;
} }
int AACastCard::resolveSpell() int AACastCard::resolveSpell()
{ {
@@ -5708,6 +5704,7 @@ void ATutorialMessage::Update(float dt)
mElapsed += dt; mElapsed += dt;
if(!mUserCloseRequest)
IconButtonsController::Update(dt); IconButtonsController::Update(dt);
if (mIsImage) if (mIsImage)
+19 -7
View File
@@ -23,6 +23,7 @@ CardDescriptor::CardDescriptor()
colorComparisonMode = COMPARISON_NONE; colorComparisonMode = COMPARISON_NONE;
CDopponentDamaged = 0; CDopponentDamaged = 0;
CDcontrollerDamaged = 0; CDcontrollerDamaged = 0;
CDdamager = 0;
} }
int CardDescriptor::init() int CardDescriptor::init()
@@ -226,16 +227,27 @@ MTGCardInstance * CardDescriptor::match(MTGCardInstance * card)
{ {
match = NULL; match = NULL;
} }
if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
{ if ((CDdamager == -1 && (card->damageToOpponent || card->damageToController || card->damageToCreature))
Player * p = card->controller()->opponent();//controller()->opponent(); || (CDdamager == 1 && !(card->damageToOpponent || card->damageToController || card->damageToCreature)))
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p) || (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p)
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent()) || (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
{ {
match = NULL; match = NULL;
} }
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p) || (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p)
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent()) || (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent())) if(CDopponentDamaged == -1 || CDopponentDamaged == 1)
{
Player * p = card->controller()->opponent();//controller()->opponent();
if ((CDopponentDamaged == -1 && card->damageToOpponent && card->controller() == p)
|| (CDopponentDamaged == 1 && !card->damageToOpponent && card->controller() == p)
|| (CDopponentDamaged == -1 && card->damageToController && card->controller() == p->opponent())
|| (CDopponentDamaged == 1 && !card->damageToController && card->controller() == p->opponent()))
{
match = NULL;
}
if ((CDcontrollerDamaged == -1 && card->damageToController && card->controller() == p)
|| (CDcontrollerDamaged == 1 && !card->damageToController && card->controller() == p)
|| (CDcontrollerDamaged == -1 && card->damageToOpponent && card->controller() == p->opponent())
|| (CDcontrollerDamaged == 1 && !card->damageToOpponent && card->controller() == p->opponent()))
{ {
match = NULL; match = NULL;
} }
+20 -6
View File
@@ -17,6 +17,7 @@
#include "Counters.h" #include "Counters.h"
#include "ModRules.h" #include "ModRules.h"
#include "CardDescriptor.h" #include "CardDescriptor.h"
#include "GameApp.h"
const float CardGui::Width = 28.0; const float CardGui::Width = 28.0;
const float CardGui::Height = 40.0; const float CardGui::Height = 40.0;
@@ -110,17 +111,17 @@ void CardGui::Update(float dt)
PlayGuiObject::Update(dt); PlayGuiObject::Update(dt);
} }
void CardGui::DrawCard(const Pos& inPosition, int inMode) void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb)
{ {
DrawCard(card, inPosition, inMode); DrawCard(card, inPosition, inMode, thumb);
} }
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode) void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb)
{ {
switch (inMode) switch (inMode)
{ {
case DrawMode::kNormal: case DrawMode::kNormal:
RenderBig(inCard, inPosition); RenderBig(inCard, inPosition, thumb);
break; break;
case DrawMode::kText: case DrawMode::kText:
AlternateRender(inCard, inPosition); AlternateRender(inCard, inPosition);
@@ -957,7 +958,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad)
} }
//Renders a big card on screen. Defaults to the "alternate" rendering if no image is found //Renders a big card on screen. Defaults to the "alternate" rendering if no image is found
void CardGui::RenderBig(MTGCard* card, const Pos& pos) void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb)
{ {
JRenderer * renderer = JRenderer::GetInstance(); JRenderer * renderer = JRenderer::GetInstance();
//GameObserver * game = GameObserver::GetInstance(); //GameObserver * game = GameObserver::GetInstance();
@@ -966,7 +967,8 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos)
//i want this but ai targets cards so quickly that it can crash the game. //i want this but ai targets cards so quickly that it can crash the game.
float x = pos.actX; float x = pos.actX;
JQuadPtr quad = WResourceManager::Instance()->RetrieveCard(card); JQuadPtr quad = thumb ? WResourceManager::Instance()->RetrieveCard(card, RETRIEVE_THUMB)
: WResourceManager::Instance()->RetrieveCard(card);
MTGCardInstance * kcard = dynamic_cast<MTGCardInstance*>(card); MTGCardInstance * kcard = dynamic_cast<MTGCardInstance*>(card);
if(kcard && !kcard->isToken && kcard->name != kcard->model->data->name) if(kcard && !kcard->isToken && kcard->name != kcard->model->data->name)
{ {
@@ -1222,6 +1224,18 @@ 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
View File
@@ -6,6 +6,7 @@
#include "MTGDeck.h" #include "MTGDeck.h"
#include "Subtypes.h" #include "Subtypes.h"
#include "Translate.h" #include "Translate.h"
#include "GameApp.h"
using std::string; using std::string;
+200
View File
@@ -0,0 +1,200 @@
#include "CarouselDeckView.h"
const float CarouselDeckView::max_scale = 0.96f;
const float CarouselDeckView::x_center = 180;
const float CarouselDeckView::right_border = SCREEN_WIDTH + 180;
const float CarouselDeckView::slide_animation_duration = 0.6f;
const float CarouselDeckView::scroll_animation_duration = 0.3f;
CarouselDeckView::CarouselDeckView() :
DeckView(10), mScrollOffset(0), mSlideOffset(0), mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset)
{
}
CarouselDeckView::~CarouselDeckView()
{}
void CarouselDeckView::UpdateViewState(float dt)
{
if(!mScrollEasing.finished())
{
mScrollEasing.update(dt);
if(mScrollOffset <= -1.0f)
{
changePosition(-1);
mScrollEasing.translate(1.0f);
}
else if(mScrollOffset >= 1.0f)
{
changePosition(1);
mScrollEasing.translate(-1.0f);
}
dirtyCardPos = true;
}
if(!mSlideEasing.finished())
{
mSlideEasing.update(dt);
if(mSlideOffset < mSlideEasing.start_value)
{
//going downwards
if(mSlideOffset < -1.0f)
{
mSlideEasing.translate(2.0f);
changeFilter(1);
}
}
else if(mSlideOffset > mSlideEasing.start_value)
{
//upwards
if(mSlideOffset > 1.0f)
{
mSlideEasing.translate(-2.0f);
changeFilter(-1);
}
}
dirtyCardPos = true;
}
}
void CarouselDeckView::UpdateCardPosition(int index)
{
CardRep &rep = mCards[index];
float rotation = mScrollOffset + 8 - index;
rep.x = x_center + cos((rotation) * M_PI / 12) * (right_border - x_center);
rep.scale = max_scale / 1.12f * cos((rep.x - x_center) * 1.5f / (right_border - x_center)) + 0.2f * max_scale * cos(
cos((rep.x - x_center) * 0.15f / (right_border - x_center)));
rep.y = (SCREEN_HEIGHT_F) / 2.0f + SCREEN_HEIGHT_F * mSlideOffset * (rep.scale + 0.2f);
}
void CarouselDeckView::Reset()
{
mSlideEasing.finish();
mScrollEasing.finish();
DeckView::Reset();
}
void CarouselDeckView::Render()
{
// even though we want to draw the cards in a particular z order for layering, we want to prefetch them
// in a different order, ie the center card should appear first, then the adjacent ones
if (WResourceManager::Instance()->IsThreaded())
{
WResourceManager::Instance()->RetrieveCard(mCards[0].card);
WResourceManager::Instance()->RetrieveCard(mCards[3].card);
WResourceManager::Instance()->RetrieveCard(mCards[4].card);
WResourceManager::Instance()->RetrieveCard(mCards[2].card);
WResourceManager::Instance()->RetrieveCard(mCards[5].card);
WResourceManager::Instance()->RetrieveCard(mCards[1].card);
WResourceManager::Instance()->RetrieveCard(mCards[6].card);
}
renderCard(6);
renderCard(5);
renderCard(4);
renderCard(0);
if (mScrollOffset < 0.5 && mScrollOffset > -0.5)
{
renderCard(1);
renderCard(3);
renderCard(2);
}
else if (mScrollOffset < -0.5)
{
renderCard(3);
renderCard(2);
renderCard(1);
}
else
{
renderCard(1);
renderCard(2);
renderCard(3);
}
}
bool CarouselDeckView::ButtonPressed(Buttons button)
{
switch(button)
{
case JGE_BTN_LEFT:
changePositionAnimated(-1);
last_user_activity = 0;
break;
case JGE_BTN_RIGHT:
changePositionAnimated(1);
last_user_activity = 0;
break;
case JGE_BTN_UP:
changeFilterAnimated(1);
last_user_activity = 0;
break;
case JGE_BTN_DOWN:
changeFilterAnimated(-1);
last_user_activity = 0;
break;
default:
return false;
}
return true;
}
MTGCard * CarouselDeckView::Click(int x, int y)
{
int n = getCardIndexNextTo(x, y);
last_user_activity = 0;
//clicked active card, and no animation is running
if(mSlideEasing.finished() && mScrollEasing.finished())
{
if(n == 2)
{
return getActiveCard();
}
else
{
changePositionAnimated(n - 2);
}
}
return NULL;
}
MTGCard *CarouselDeckView::Click()
{
if(mSlideEasing.finished() && mScrollEasing.finished())
{
return getActiveCard();
}
else
{
return NULL;
}
}
void CarouselDeckView::changePositionAnimated(int offset)
{
if(mScrollEasing.finished())
mScrollEasing.start((float)offset, (float)(scroll_animation_duration * abs(offset)));
last_user_activity = 0;
}
void CarouselDeckView::changeFilterAnimated(int offset)
{
if(mSlideEasing.finished())
mSlideEasing.start(2.0f * float(offset), float(slide_animation_duration * abs(offset)));
last_user_activity = 0;
}
MTGCard *CarouselDeckView::getActiveCard()
{
return mCards[2].card;
}
+1 -1
View File
@@ -386,7 +386,7 @@ void Credits::computeTournament(GameObserver* g, GameApp * _app,bool tournament,
} }
if (mGamesWon>mGamesPlayed*0.80 && mGamesWon<mGamesPlayed) if (mGamesWon>mGamesPlayed*0.80 && mGamesWon<mGamesPlayed)
{ {
CreditBonus * b = NEW CreditBonus(250, _("Won more then 80 percentage of games")); CreditBonus * b = NEW CreditBonus(250, _("Won more than 80 percentage of games"));
bonus.push_back(b); bonus.push_back(b);
} }
+3 -1
View File
@@ -192,8 +192,10 @@ 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())
+213
View File
@@ -0,0 +1,213 @@
#include "DeckView.h"
#include "GameOptions.h"
#include "CardGui.h"
const float DeckView::no_user_activity_show_card_delay = 0.1f;
DeckView::DeckView(int numberOfCards)
: dirtyFilters(true), dirtyCardPos(true), last_user_activity(0.0f), mFilter(0), mCurrentDeck(NULL)
{
mCards.resize(numberOfCards);
}
DeckView::~DeckView()
{
}
void DeckView::Reset()
{
dirtyFilters = true;
dirtyCardPos = true;
last_user_activity = 0;
mFilter = 0;
mCurrentDeck = NULL;
}
void DeckView::Update(float dt)
{
last_user_activity += dt;
UpdateViewState(dt);
if(dirtyCardPos)
{
for(unsigned int i = 0; i < mCards.size(); ++i)
{
UpdateCardPosition(i);
}
dirtyCardPos = false;
}
}
void DeckView::SetDeck(DeckDataWrapper *toShow)
{
mCurrentDeck = toShow;
dirtyCardPos = true;
dirtyFilters = true;
reloadIndexes();
}
DeckDataWrapper* DeckView::deck()
{
return mCurrentDeck;
}
void DeckView::changeFilter(int delta)
{
unsigned int FilterCount = Constants::NB_Colors + 1;
mFilter = (FilterCount + mFilter + delta) % FilterCount;
dirtyFilters = true;
}
void DeckView::changePosition(int delta)
{
for(int i = 0; i < delta; ++i)
{
mCurrentDeck->next();
}
for(int i = 0; i > delta; --i)
{
mCurrentDeck->prev();
}
reloadIndexes();
}
int DeckView::filter()
{
return mFilter;
}
void DeckView::reloadIndexes()
{
if(mCurrentDeck != NULL)
{
for (unsigned int i = 0; i < mCards.size(); i++)
{
mCards[i].card = deck()->getCard(i);
}
}
}
void DeckView::renderCard(int index, int alpha, bool asThumbnail)
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
const CardRep& cardPosition = mCards[index];
if (!cardPosition.card) return;
if (!WResourceManager::Instance()->IsThreaded())
{
JQuadPtr backQuad = WResourceManager::Instance()->GetQuad(kGenericCardID);
JQuadPtr quad;
int cacheError = CACHE_ERROR_NONE;
if (!options[Options::DISABLECARDS].number)
{
quad = WResourceManager::Instance()->RetrieveCard(cardPosition.card, RETRIEVE_EXISTING);
cacheError = WResourceManager::Instance()->RetrieveError();
if (!quad.get() && cacheError != CACHE_ERROR_404)
{
if (last_user_activity > (abs(2 - index) + 1) * no_user_activity_show_card_delay)
quad = WResourceManager::Instance()->RetrieveCard(cardPosition.card);
else
{
quad = backQuad;
}
}
}
if (quad.get())
{
if (quad == backQuad)
{
quad->SetColor(ARGB(255,255,255,255));
float _scale = cardPosition.scale * (285 / quad->mHeight);
JRenderer::GetInstance()->RenderQuad(quad.get(), cardPosition.x, cardPosition.y, 0.0f, _scale, _scale);
}
else
{
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
CardGui::DrawCard(cardPosition.card, pos, asThumbnail);
}
}
else
{
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
CardGui::DrawCard(cardPosition.card, pos, DrawMode::kText, asThumbnail);
}
}
else
{
int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText;
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail);
}
int quadAlpha = alpha;
if (!deck()->count(cardPosition.card)) quadAlpha /= 2;
quadAlpha = 255 - quadAlpha;
if (quadAlpha > 0)
{
JRenderer::GetInstance()->FillRect(cardPosition.x - cardPosition.scale * 100.0f, cardPosition.y - cardPosition.scale * 142.5f, cardPosition.scale * 200.0f, cardPosition.scale * 285.0f,
ARGB(quadAlpha,0,0,0));
}
if (last_user_activity < 3)
{
int fontAlpha = alpha;
float qtY = cardPosition.y - 135 * cardPosition.scale;
float qtX = cardPosition.x + 40 * cardPosition.scale;
char buffer[4096];
sprintf(buffer, "x%i", deck()->count(cardPosition.card));
WFont * font = mFont;
font->SetColor(ARGB(fontAlpha/2,0,0,0));
JRenderer::GetInstance()->FillRect(qtX, qtY, font->GetStringWidth(buffer) + 6, 16, ARGB(fontAlpha/2,0,0,0));
font->DrawString(buffer, qtX + 4, qtY + 4);
font->SetColor(ARGB(fontAlpha,255,255,255));
font->DrawString(buffer, qtX + 2, qtY + 2);
font->SetColor(ARGB(255,255,255,255));
}
}
int DeckView::getCardIndexNextTo(int x, int y)
{
int bestCardIndex = -1;
float bestDistance = 0;
for(unsigned int i = 0; i < mCards.size(); i++)
{
const CardRep& cardPosition = mCards[i];
float dx = (x - cardPosition.x);
float dy = (y - cardPosition.y);
float dist = dx*dx + dy*dy;
if(dist < bestDistance || bestCardIndex == -1)
{
bestDistance = dist;
bestCardIndex = i;
}
}
return bestCardIndex;
}
int DeckView::getPosition()
{
if(!mCurrentDeck)
{
return 0;
}
int total = mCurrentDeck->Size();
int currentPos = (mCurrentDeck->getOffset() + 3) % total;
while (currentPos <= 0) currentPos += total;
return currentPos;
}
+1
View File
@@ -795,6 +795,7 @@ 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++)
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -14,6 +14,7 @@
#include "Translate.h" #include "Translate.h"
#include "Rules.h" #include "Rules.h"
#include "ModRules.h" #include "ModRules.h"
#include "GameApp.h"
#ifdef TESTSUITE #ifdef TESTSUITE
#include "TestSuiteAI.h" #include "TestSuiteAI.h"
@@ -795,7 +796,7 @@ void GameStateDuel::Update(float dt)
if (game->didWin()) if (game->didWin())
{ {
//the following section will be called only in a classic or demo gamemode and if a tournament or match with more then one game is activ //the following section will be called only in a classic or demo gamemode and if a tournament or match with more than one game is activ
if ( (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&& mParent->players[1] == PLAYER_TYPE_CPU && (tournament->isTournament() || tournament->getGamesToPlay()>1 )) if ( (mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO)&& mParent->players[1] == PLAYER_TYPE_CPU && (tournament->isTournament() || tournament->getGamesToPlay()>1 ))
{ {
setGamePhase(DUEL_STATE_SHOW_SCORE); setGamePhase(DUEL_STATE_SHOW_SCORE);
+17 -12
View File
@@ -215,34 +215,39 @@ 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: Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha", "Art:",
"Ilya B, Julio, Jeck, J, Kaioshin, Lakeesha",
"Check themeinfo.txt for the full credits of each theme!", "Check themeinfo.txt for the full credits of each theme!",
"", "",
"Dev Team:", "Dev Team:",
"Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat,", "Abrasax, Almosthumane, Daddy32, DJardin, Dr.Solomat, J, Jeck,",
"J, Jeck, kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen,", "kevlahnota, Leungclj, linshier, Mootpoint, Mnguyen, Psyringe,",
"Psyringe, Salmelo, Superhiro, Wololo, Yeshua, Zethfox", "Rolzad73, 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: Abrasax, AzureKnight, colarchon", "Deck Builders:",
"Excessum, Hehotfarv, Jeremy, Jog1118, JonyAS", "Abrasax, AzureKnight, colarchon, Excessum, Hehotfarv,",
"Lachaux, Link17, Muddobbers, Nakano, Niegen", "Jeremy, Jog1118, JonyAS, Lachaux, Link17, Muddobbers,",
"Kaioshin, Psyringe, r1c47, Superhiro, Szei", "Nakano, Niegen, Kaioshin, Psyringe, r1c47, Superhiro,",
"Thanatos02, Whismer, Wololo", "Szei, 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",
+4 -8
View File
@@ -102,7 +102,6 @@ void GameStateShop::Start()
bListCards = false; bListCards = false;
mTouched = false; mTouched = false;
mStage = STAGE_FADE_IN; mStage = STAGE_FADE_IN;
mElapsed = 0;
needLoad = true; needLoad = true;
booster = NULL; booster = NULL;
srcCards = NEW WSrcUnlockedCards(0); srcCards = NEW WSrcUnlockedCards(0);
@@ -259,8 +258,8 @@ void GameStateShop::cancelCard(int controlId)
break; break;
} }
price = price - (rnd * price) / 100; price = price - (rnd * price) / 100;
if (price < pricelist->getPrice(c->getMTGId())) //filters have a tendancy to increase the price instead of lowering it! if (price < pricelist->getPrice(c)) //filters have a tendancy to increase the price instead of lowering it!
pricelist->setPrice(c->getMTGId(), price); pricelist->setPrice(c, price);
//Prices do not immediately go down when you ignore something. //Prices do not immediately go down when you ignore something.
return; return;
} }
@@ -427,7 +426,7 @@ void GameStateShop::End()
{ {
save(); save();
JRenderer::GetInstance()->EnableVSync(false); JRenderer::GetInstance()->EnableVSync(false);
mElapsed = 0;
SAFE_DELETE(shopMenu); SAFE_DELETE(shopMenu);
SAFE_DELETE(bigDisplay); SAFE_DELETE(bigDisplay);
SAFE_DELETE(srcCards); SAFE_DELETE(srcCards);
@@ -469,9 +468,6 @@ void GameStateShop::Update(float dt)
if (lightAlpha > 50) if (lightAlpha > 50)
lightAlpha = 50; lightAlpha = 50;
if (mStage != STAGE_FADE_IN)
mElapsed += dt;
JButton btn; JButton btn;
switch (mStage) switch (mStage)
{ {
@@ -496,7 +492,7 @@ void GameStateShop::Update(float dt)
} }
break; break;
case STAGE_SHOP_TASKS: case STAGE_SHOP_TASKS:
if (menu) if (menu && !menu->isClosed())
{ {
menu->Update(dt); menu->Update(dt);
return; return;
+284
View File
@@ -0,0 +1,284 @@
#include "GridDeckView.h"
const float GridDeckView::scroll_animation_duration = 0.3f;
const float GridDeckView::slide_animation_duration = 0.6f;
const float GridDeckView::card_scale_small = 0.48f;
const float GridDeckView::card_scale_big = 0.7f;
GridDeckView::GridDeckView()
: DeckView(16), mCols(8), mRows(2), mScrollOffset(0), mSlideOffset(0),
mScrollEasing(mScrollOffset), mSlideEasing(mSlideOffset), mCurrentSelection(-1),
mButtonMode(false)
{
}
GridDeckView::~GridDeckView()
{
}
void GridDeckView::Reset()
{
mSlideEasing.finish();
mScrollEasing.finish();
mCurrentSelection = 0;
mButtonMode = false;
DeckView::Reset();
}
void GridDeckView::UpdateViewState(float dt)
{
if(!mScrollEasing.finished())
{
mScrollEasing.update(dt);
if(mScrollOffset <= -1.0f)
{
changePosition(2);
moveSelection(-2, false);
mScrollEasing.translate(1.0f);
}
else if(mScrollOffset >= 1.0f)
{
changePosition(-2);
moveSelection(2, false);
mScrollEasing.translate(-1.0f);
}
dirtyCardPos = true;
}
if(!mSlideEasing.finished())
{
mSlideEasing.update(dt);
if(mSlideOffset < -1.0f)
{
mSlideEasing.translate(2.0f);
changeFilter(1);
}
else if(mSlideOffset > 1.0f)
{
mSlideEasing.translate(-2.0f);
changeFilter(-1);
}
dirtyCardPos = true;
}
}
void GridDeckView::UpdateCardPosition(int index)
{
CardRep &rep = mCards[index];
int col = index / mRows;
int row = index % mRows;
float colWidth = SCREEN_WIDTH_F / (mCols - 3);
float rowHeight = SCREEN_HEIGHT_F / mRows;
rep.x = (col + mScrollOffset) * colWidth - colWidth;
rep.y = row * rowHeight + mSlideOffset*SCREEN_HEIGHT + rowHeight/2;
if(mCurrentSelection == index)
{
rep.scale = card_scale_big;
if(row == 0)
{
rep.y += rowHeight * (card_scale_big - card_scale_small);
}
else
{
rep.y -= rowHeight * (card_scale_big - card_scale_small);
}
}
else
{
rep.scale = card_scale_small;
}
}
void GridDeckView::Render()
{
int firstVisibleCard = 2;
int lastVisibleCard = mCards.size() - 2;
if(!mScrollEasing.finished())
{
if(mScrollEasing.delta_value > 0){
firstVisibleCard = 0;
}
else
{
lastVisibleCard = mCards.size();
}
}
for(int i = firstVisibleCard; i < lastVisibleCard; ++i)
{
if(mCurrentSelection != i)
{
if (WResourceManager::Instance()->IsThreaded())
{
WResourceManager::Instance()->RetrieveCard(mCards[i].card, RETRIEVE_THUMB);
}
renderCard(i, 255, true);
}
else
{
if (WResourceManager::Instance()->IsThreaded())
{
WResourceManager::Instance()->RetrieveCard(mCards[i].card);
}
}
}
if(2 <= mCurrentSelection && mCurrentSelection < 12)
{
renderCard(mCurrentSelection, 255, false);
}
}
bool GridDeckView::ButtonPressed(Buttons button)
{
switch(button)
{
case JGE_BTN_LEFT:
if(mButtonMode && mScrollEasing.finished()) moveSelection(-2, true);
else if(!mButtonMode) changePositionAnimated(-1);
last_user_activity = 0;
break;
case JGE_BTN_RIGHT:
if(mButtonMode && mScrollEasing.finished()) moveSelection(2, true);
else if(!mButtonMode) changePositionAnimated(1);
last_user_activity = 0;
break;
case JGE_BTN_UP:
if(mButtonMode && mScrollEasing.finished()) moveSelection(-1, true);
else if(!mButtonMode) changeFilterAnimated(1);
last_user_activity = 0;
break;
case JGE_BTN_DOWN:
if(mButtonMode && mScrollEasing.finished()) moveSelection(1, true);
else if(!mButtonMode) changeFilterAnimated(-1);
last_user_activity = 0;
break;
case JGE_BTN_CTRL:
if(mButtonMode)
{
mButtonMode = false;
dirtyCardPos = true;
mCurrentSelection = -1;
}
else return false;
break;
default:
return false;
}
return true;
}
MTGCard * GridDeckView::Click(int x, int y)
{
int n = getCardIndexNextTo(x, y);
last_user_activity = 0;
mButtonMode = false;
if(mScrollEasing.finished() && mSlideEasing.finished())
{ //clicked and no animations running
if(n == mCurrentSelection)
{
return getActiveCard();
}
else if(n < 4)
{
changePositionAnimated(-1);
}
else if(n >= 12)
{
changePositionAnimated(1);
}
else
{
mCurrentSelection = n;
dirtyCardPos = true;
}
}
return NULL;
}
MTGCard * GridDeckView::Click()
{
if(mScrollEasing.finished() && mSlideEasing.finished())
{
MTGCard *active = getActiveCard();
if(active != NULL)
{
return active;
}
else
{
mButtonMode = true;
dirtyCardPos = true;
mCurrentSelection = 4;
}
}
return NULL;
}
void GridDeckView::changePositionAnimated(int offset)
{
if(mScrollEasing.finished())
mScrollEasing.start(-1.0f * offset, scroll_animation_duration * abs(offset));
last_user_activity = 0;
}
void GridDeckView::changeFilterAnimated(int offset)
{
if(mSlideEasing.finished())
mSlideEasing.start(2.0f * offset, float(slide_animation_duration * abs(offset)));
last_user_activity = 0;
}
MTGCard* GridDeckView::getActiveCard()
{
if(mCurrentSelection >= 4 && mCurrentSelection < int(mCards.size())-4)
{
return mCards[mCurrentSelection].card;
}
else
{
return NULL;
}
}
void GridDeckView::moveSelection(int offset, bool alignIfOutOfBounds)
{
mCurrentSelection += offset;
if(alignIfOutOfBounds)
{
if(mCurrentSelection < 4)
{
changePositionAnimated(-1);
}
else if(mCurrentSelection >= 12)
{
changePositionAnimated(1);
}
}
else
{
if(mCurrentSelection < 4 || mCurrentSelection >= 12)
{
mCurrentSelection = -1;
}
}
dirtyCardPos = true;
}
+1
View File
@@ -3,6 +3,7 @@
#include "GuiMana.h" #include "GuiMana.h"
#include "OptionItem.h" #include "OptionItem.h"
#include "Player.h" #include "Player.h"
#include "GameApp.h"
//using std::cout; //using std::cout;
using std::endl; using std::endl;
+49 -54
View File
@@ -24,26 +24,28 @@
}; };
*/ */
const float GuiPhaseBar::zoom_big = (float)(1.5 * 1.4);
const float GuiPhaseBar::zoom_small = 1.5;
const float GuiPhaseBar::step = M_PI/6.0f;
namespace namespace
{ {
//width and height of the phase symbol textures
const float kWidth = 28; const float kWidth = 28;
const float kHeight = kWidth; const float kHeight = kWidth;
const unsigned kPhases = 12; const unsigned kPhases = NB_MTG_PHASES - 2; //there are two phases we do not show
}
const float ICONSCALE = 1.5; void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale)
const float CENTER = SCREEN_HEIGHT_F / 2 + 10; {
inQuad->SetTextureRect(phaseId * (kWidth + 1), 0, kWidth, kHeight);
void DrawGlyph(JQuad* inQuad, int inGlyph, float inY, float, unsigned int inP, float inScale) JRenderer::GetInstance()->RenderQuad(inQuad, x, y - scale * kWidth/2, 0.0f, scale, scale);
{
float xPos = static_cast<float> ((inP + inGlyph * (int) (kWidth + 1)) % (kPhases * (int) (kWidth + 1)));
inQuad->SetTextureRect(xPos, 0, kWidth, kHeight);
JRenderer::GetInstance()->RenderQuad(inQuad, 0, inY, 0.0, inScale, inScale);
}
} }
GuiPhaseBar::GuiPhaseBar(DuelLayers* duelLayers) : GuiPhaseBar::GuiPhaseBar(DuelLayers* duelLayers) :
GuiLayer(duelLayers->getObserver()), PlayGuiObject(0, 0, 106, 0, false), GuiLayer(duelLayers->getObserver()), PlayGuiObject(80, 0, 106, 0, false),
phase(NULL), angle(0.0f), zoomFactor(ICONSCALE), mpDuelLayers(duelLayers) displayedPhaseId(0), angle(0.0f), zoomFactor(zoom_small), angleEasing(angle),
zoomFactorEasing(zoomFactor), mpDuelLayers(duelLayers)
{ {
if(duelLayers->getObserver()->getResourceManager()) if(duelLayers->getObserver()->getResourceManager())
{ {
@@ -57,10 +59,7 @@ GuiPhaseBar::GuiPhaseBar(DuelLayers* duelLayers) :
GameApp::systemError = "Error loading phasebar texture : " __FILE__; GameApp::systemError = "Error loading phasebar texture : " __FILE__;
} }
zoom = ICONSCALE;
mpDuelLayers->getCardSelector()->Add(this); mpDuelLayers->getCardSelector()->Add(this);
} }
GuiPhaseBar::~GuiPhaseBar() GuiPhaseBar::~GuiPhaseBar()
@@ -69,32 +68,27 @@ GuiPhaseBar::~GuiPhaseBar()
void GuiPhaseBar::Update(float dt) void GuiPhaseBar::Update(float dt)
{ {
if (angle > 3 * dt) angleEasing.update(dt);
angle -= 3 * dt;
else
angle = 0;
if (dt > 0.05f) dt = 0.05f; if(angle <= -step)
if(zoomFactor + 0.05f < zoom)
{ {
zoomFactor += dt; displayedPhaseId = (displayedPhaseId + 1) % kPhases;
} angleEasing.translate(step);
else if (zoomFactor - 0.05f > zoom)
{
zoomFactor -= dt;
} }
zoomFactorEasing.update(dt);
} }
void GuiPhaseBar::Entering() void GuiPhaseBar::Entering()
{ {
mHasFocus = true; mHasFocus = true;
zoom = 1.4f*ICONSCALE; zoomFactorEasing.start(zoom_big, 0.3f);
} }
bool GuiPhaseBar::Leaving(JButton) bool GuiPhaseBar::Leaving(JButton)
{ {
mHasFocus = false; mHasFocus = false;
zoom = ICONSCALE; zoomFactorEasing.start(zoom_small, 0.6f);
return true; return true;
} }
@@ -104,32 +98,19 @@ void GuiPhaseBar::Render()
//uncomment to draw a hideous line across hires screens. //uncomment to draw a hideous line across hires screens.
// JRenderer::GetInstance()->DrawLine(0, CENTER, SCREEN_WIDTH, CENTER, ARGB(255, 255, 255, 255)); // JRenderer::GetInstance()->DrawLine(0, CENTER, SCREEN_WIDTH, CENTER, ARGB(255, 255, 255, 255));
unsigned int p = (phase->id + kPhases - 4) * (int) (kWidth + 1); const float radius = 25 * zoomFactor;
float centerYPosition = CENTER + (kWidth / 2) * angle * zoomFactor / (M_PI / 6) - zoomFactor * kWidth / 4;
float yPos = centerYPosition;
float scale = 0;
for (int glyph = 3; glyph < 6; ++glyph)
{
scale = zoomFactor * sinf(angle + glyph * M_PI / 6) / 2;
DrawGlyph(quad.get(), glyph, yPos, angle, p, scale);
yPos += kWidth * scale;
}
yPos = centerYPosition; for(int i = 0; i < 6; ++i)
for (int glyph = 2; glyph > 0; --glyph)
{ {
scale = zoomFactor * sinf(angle + glyph * M_PI / 6) / 2; //the position of the glyphe in the circle
yPos -= kWidth * scale; const float circPos = (i - 2) * step + angle;
DrawGlyph(quad.get(), glyph, yPos, angle, p, scale); const float glyphY = this->y + this->mHeight / 2 + sin(circPos) * radius;
}
if (angle > 0) //the scale is computed so that the glyphes touch each other
{ //hint: sin(circPos + PI/2) = cos(circPos)
scale = zoomFactor * sinf(angle) / 2; const float glyphScale = float(zoomFactor * cosf(circPos) * 0.5f);
yPos -= kWidth * scale;
float xPos = static_cast<float> (p % (kPhases * (int) (kWidth + 1))); DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale);
quad->SetTextureRect(xPos, kHeight, kWidth, kHeight);
JRenderer::GetInstance()->RenderQuad(quad.get(), 0, yPos, 0.0, scale, scale);
} }
//print phase name //print phase name
@@ -159,7 +140,9 @@ void GuiPhaseBar::Render()
char buf[200]; char buf[200];
//running this string through translate returns gibberish even though we defined the variables in the lang.txt //running this string through translate returns gibberish even though we defined the variables in the lang.txt
string phaseNameToTranslate = observer->phaseRing->phaseName(phase->id); //the conversion from phase bar phases to mtg phases is x%kPhases + 1
//todo: just to this when the displayedPhaseId updates
string phaseNameToTranslate = observer->phaseRing->phaseName(displayedPhaseId%kPhases + 1);
phaseNameToTranslate = _(phaseNameToTranslate); phaseNameToTranslate = _(phaseNameToTranslate);
sprintf(buf, _("(%s%s) %s").c_str(), currentP.c_str(), interrupt.c_str(),phaseNameToTranslate.c_str()); sprintf(buf, _("(%s%s) %s").c_str(), currentP.c_str(), interrupt.c_str(),phaseNameToTranslate.c_str());
font->DrawString(buf, SCREEN_WIDTH - 5, 2, JGETEXT_RIGHT); font->DrawString(buf, SCREEN_WIDTH - 5, 2, JGETEXT_RIGHT);
@@ -170,8 +153,20 @@ int GuiPhaseBar::receiveEventMinus(WEvent *e)
WEventPhaseChange *event = dynamic_cast<WEventPhaseChange*> (e); WEventPhaseChange *event = dynamic_cast<WEventPhaseChange*> (e);
if (event) if (event)
{ {
angle = M_PI / 6; //convert the mtg phase to the phases of the phase wheel
phase = event->to; //the mapping is
//0 -> none
//1..12 -> 0..11
//13 -> none
int targetPhase = event->to->id;
if(targetPhase != 0 && targetPhase != 13)
{
targetPhase -= 1;
int phasesToAnimate = (targetPhase - displayedPhaseId + kPhases) % kPhases;
angleEasing.start(float(phasesToAnimate * (- step)), 0.3f * float(sqrt(float(phasesToAnimate))));
}
} }
return 1; return 1;
} }
+1 -1
View File
@@ -103,7 +103,7 @@ inline float GuiPlay::VertStack::nextX()
} }
GuiPlay::BattleField::BattleField() : GuiPlay::BattleField::BattleField() :
attackers(0), blockers(0), height(0.0), red(0), colorFlow(0) attackers(0), height(0.0), red(0), colorFlow(0)
{ {
} }
const float GuiPlay::BattleField::HEIGHT = 80.0f; const float GuiPlay::BattleField::HEIGHT = 80.0f;
+6 -2
View File
@@ -1039,6 +1039,12 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
observer->addObserver(NEW MTGMorphCostRule(observer, -1)); observer->addObserver(NEW MTGMorphCostRule(observer, -1));
return NULL; return NULL;
} }
found = s.find("playfromgraveyardrule");
if(found != string::npos)
{
observer->addObserver(NEW MTGPlayFromGraveyardRule(observer, -1));
return NULL;
}
//this rule handles attacking ability during attacker phase //this rule handles attacking ability during attacker phase
found = s.find("attackrule"); found = s.find("attackrule");
if(found != string::npos) if(found != string::npos)
@@ -4270,8 +4276,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
if (card->hasType(Subtypes::TYPE_INSTANT) || card->hasType(Subtypes::TYPE_SORCERY)) if (card->hasType(Subtypes::TYPE_INSTANT) || card->hasType(Subtypes::TYPE_SORCERY))
{ {
MTGPlayerCards * zones = card->owner->game; MTGPlayerCards * zones = card->owner->game;
if(card->getCurrentZone())
card->currentZone->owner->game;//grab it from where ever it is.
MTGPlayerCards * Endzones = card->owner->game;//put them in thier owners respective zones as per rules. MTGPlayerCards * Endzones = card->owner->game;//put them in thier owners respective zones as per rules.
if (card->basicAbilities[(int)Constants::EXILEDEATH]) if (card->basicAbilities[(int)Constants::EXILEDEATH])
{ {
+1
View File
@@ -158,6 +158,7 @@ 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;
+2 -1
View File
@@ -131,7 +131,8 @@ const char* Constants::MTGBasicAbilities[] = {
"poisondamager",//deals damage to players as poison counters. "poisondamager",//deals damage to players as poison counters.
"soulbond", "soulbond",
"lure", "lure",
"nolegend" "nolegend",
"canplayfromgraveyard"
}; };
map<string,int> Constants::MTGBasicAbilitiesMap; map<string,int> Constants::MTGBasicAbilitiesMap;
+43 -2
View File
@@ -146,7 +146,7 @@ int MTGEventBonus::receiveEvent(WEvent * event)
} }
//////bonus for having a LOT of specific type. //////bonus for having a LOT of specific type.
//not else'd becuase it is possible for a card to contain //not else'd becuase it is possible for a card to contain
//more then one of the types, and for more then one to trigger. //more than one of the types, and for more than one to trigger.
if(e->card->hasType(Subtypes::TYPE_ARTIFACT)) if(e->card->hasType(Subtypes::TYPE_ARTIFACT))
toys[currentPlayer->getId()]++; toys[currentPlayer->getId()]++;
if(e->card->isCreature()) if(e->card->isCreature())
@@ -273,6 +273,7 @@ MTGEventBonus * MTGEventBonus::clone() const
{ {
return NEW MTGEventBonus(*this); return NEW MTGEventBonus(*this);
} }
MTGPutInPlayRule::MTGPutInPlayRule(GameObserver* observer, int _id) : MTGPutInPlayRule::MTGPutInPlayRule(GameObserver* observer, int _id) :
PermanentAbility(observer, _id) PermanentAbility(observer, _id)
{ {
@@ -716,7 +717,6 @@ int MTGAlternativeCostRule::reactToClick(MTGCardInstance * card, ManaCost *alter
copy->alternateCostPaid[alternateCostType] = 1; copy->alternateCostPaid[alternateCostType] = 1;
spell->resolve(); spell->resolve();
SAFE_DELETE(spell); SAFE_DELETE(spell);
game->mLayers->stackLayer()->addSpell(copy, NULL, NULL, alternateCostType, 1);
} }
else else
{ {
@@ -1140,8 +1140,49 @@ MTGMorphCostRule * MTGMorphCostRule::clone() const
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
//------------------------------------------------------------------------- //-------------------------------------------------------------------------
MTGPlayFromGraveyardRule::MTGPlayFromGraveyardRule(GameObserver* observer, int _id) :
MTGAlternativeCostRule(observer, _id)
{
aType = MTGAbility::PUT_INTO_PLAY;
}
int MTGPlayFromGraveyardRule::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
{
Player * player = game->currentlyActing();
ManaCost * cost = card->getManaCost();
if (!player->game->graveyard->hasCard(card))
return 0;
if (!card->has(Constants::CANPLAYFROMGRAVEYARD))
return 0;
return MTGAlternativeCostRule::isReactingToClick(card, mana, cost);
}
int MTGPlayFromGraveyardRule::reactToClick(MTGCardInstance * card)
{
if (!isReactingToClick(card))
return 0;
ManaCost * cost = card->getManaCost();
card->paymenttype = MTGAbility::PUT_INTO_PLAY;
return MTGAlternativeCostRule::reactToClick(card, cost, ManaCost::MANA_PAID);
}
ostream& MTGPlayFromGraveyardRule::toString(ostream& out) const
{
out << "MTGPlayFromGraveyardRule ::: (";
return MTGAbility::toString(out) << ")";
}
MTGPlayFromGraveyardRule * MTGPlayFromGraveyardRule::clone() const
{
return NEW MTGPlayFromGraveyardRule(*this);
}
///////////////////////////////////////////////////////////////////////////////////////////////////
bool MTGAttackRule::select(Target* t) bool MTGAttackRule::select(Target* t)
{ {
+1
View File
@@ -7,6 +7,7 @@
#include "TranslateKeys.h" #include "TranslateKeys.h"
#include "StyleManager.h" #include "StyleManager.h"
#include <dirent.h> #include <dirent.h>
#include "SimpleMenu.h"
//OptionItem //OptionItem
OptionItem::OptionItem(int _id, string _displayValue) : OptionItem::OptionItem(int _id, string _displayValue) :
+21 -4
View File
@@ -47,12 +47,12 @@ int PriceList::save()
return 1; return 1;
} }
int PriceList::getPrice(int cardId) int PriceList::getPrice(MTGCard * card)
{ {
map<int, int>::iterator it = prices.find(cardId); map<int, int>::iterator it = prices.find(card->getId());
if (it != prices.end()) return (*it).second; if (it != prices.end()) return (*it).second;
char rarity = collection->getCardById(cardId)->getRarity(); char rarity = card->getRarity();
switch (rarity) switch (rarity)
{ {
case Constants::RARITY_M: case Constants::RARITY_M:
@@ -77,7 +77,11 @@ int PriceList::getPrice(int cardId)
return Constants::PRICE_1C; return Constants::PRICE_1C;
break; break;
} }
}
int PriceList::getPrice(int cardId)
{
return getPrice(collection->getCardById(cardId));
} }
int PriceList::setPrice(int cardId, int price) int PriceList::setPrice(int cardId, int price)
@@ -85,10 +89,23 @@ int PriceList::setPrice(int cardId, int price)
prices[cardId] = price; prices[cardId] = price;
return price; return price;
} }
int PriceList::setPrice(MTGCard * card, int price)
{
prices[card->getId()] = price;
return price;
}
int PriceList::getSellPrice(int cardid) int PriceList::getSellPrice(int cardid)
{ {
return getPrice(cardid); return getPrice(collection->getCardById(cardid));
} }
int PriceList::getSellPrice(MTGCard *card)
{
return getPrice(card);
}
float PriceList::difficultyScalar(float price, int cardid) float PriceList::difficultyScalar(float price, int cardid)
{ {
float badluck = (float) (abs(cardid + randomKey) % 201) / 100; //Float between 0 and 2. float badluck = (float) (abs(cardid + randomKey) % 201) / 100; //Float between 0 and 2.
+1
View File
@@ -6,6 +6,7 @@
#include "Player.h" #include "Player.h"
#include "AIMomirPlayer.h" #include "AIMomirPlayer.h"
#include "GameApp.h"
#include "MTGGameZones.h" #include "MTGGameZones.h"
#include "MTGAbility.h" #include "MTGAbility.h"
#include "AllAbilities.h" #include "AllAbilities.h"
+1 -1
View File
@@ -15,7 +15,7 @@
#include <iomanip> #include <iomanip>
SimplePopup::SimplePopup(int id, JGuiListener* listener, const int fontId, const char * _title, DeckMetaData* deckMetaData, MTGAllCards * collection, float cancelX, float cancelY) : SimplePopup::SimplePopup(int id, JGuiListener* listener, const int fontId, const char * _title, DeckMetaData* deckMetaData, MTGAllCards * collection, float cancelX, float cancelY) :
JGuiController(JGE::GetInstance(), id, listener), mFontId(fontId), mCollection(collection) JGuiController(JGE::GetInstance(), id, listener), mCollection(collection)
{ {
mX = 19; mX = 19;
mY = 66; mY = 66;
+1
View File
@@ -13,6 +13,7 @@
#include "PlayerData.h" #include "PlayerData.h"
#include "MTGDeck.h" #include "MTGDeck.h"
#include "WFont.h" #include "WFont.h"
#include "GameApp.h"
#include <JFileSystem.h> #include <JFileSystem.h>
#define LINE_SPACE 2 #define LINE_SPACE 2
+12
View File
@@ -485,6 +485,18 @@ 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?
+18 -14
View File
@@ -258,9 +258,10 @@ Task* Task::createFromStr(const string params, bool rand)
/*---------------- TaskList -----------------*/ /*---------------- TaskList -----------------*/
TaskList::TaskList(string _fileName) TaskList::TaskList(string _fileName):
fileName(_fileName), vPos(-SCREEN_HEIGHT), vPosInEasing(vPos), vPosOutEasing(vPos)
{ {
fileName = _fileName;
if (fileName == "") if (fileName == "")
{ {
fileName = options.profileFile(PLAYER_TASKS).c_str(); fileName = options.profileFile(PLAYER_TASKS).c_str();
@@ -378,9 +379,10 @@ void TaskList::removeTask(Task *task)
void TaskList::Start() void TaskList::Start()
{ {
vPos = -SCREEN_HEIGHT; //Offscreen
mElapsed = 0;
mState = TASKS_IN; mState = TASKS_IN;
vPos = -SCREEN_HEIGHT; //Offscreen
vPosInEasing.start(0.0f, 1.0f);
if (!mBgTex) if (!mBgTex)
{ {
mBgTex = WResourceManager::Instance()->RetrieveTexture("taskboard.png", RETRIEVE_LOCK); mBgTex = WResourceManager::Instance()->RetrieveTexture("taskboard.png", RETRIEVE_LOCK);
@@ -410,7 +412,7 @@ void TaskList::Start()
void TaskList::End() void TaskList::End()
{ {
mState = TASKS_OUT; mState = TASKS_OUT;
mElapsed = 0; vPosOutEasing.start(float(-SCREEN_HEIGHT), 0.9f);
} }
void TaskList::passOneDay() void TaskList::passOneDay()
@@ -451,21 +453,23 @@ int TaskList::getTaskCount()
void TaskList::Update(float dt) void TaskList::Update(float dt)
{ {
mElapsed += dt; if(!vPosInEasing.finished())
{
vPosInEasing.update(dt);
if (mState == TASKS_IN && vPos < 0) if(vPosInEasing.finished())
{ {
vPos = -SCREEN_HEIGHT + (SCREEN_HEIGHT * mElapsed / 0.75f); //Todo: more physical drop-in.
if (vPos >= 0)
{
vPos = 0;
mState = TaskList::TASKS_ACTIVE; mState = TaskList::TASKS_ACTIVE;
} }
} }
else if (mState == TASKS_OUT && vPos > -SCREEN_HEIGHT) else if(!vPosOutEasing.finished())
{ {
vPos = -(SCREEN_HEIGHT * mElapsed / 0.75f); vPosOutEasing.update(dt);
if (vPos <= -SCREEN_HEIGHT) mState = TASKS_INACTIVE;
if(vPosOutEasing.finished())
{
mState = TASKS_INACTIVE;
}
} }
} }
+3
View File
@@ -6,6 +6,9 @@
#include "Subtypes.h" #include "Subtypes.h"
#include "TranslateKeys.h" #include "TranslateKeys.h"
#include <hge/hgedistort.h> #include <hge/hgedistort.h>
#include "SimpleMenu.h"
#include "Pos.h"
#include "CardGui.h"
/** /**
Provides an interface to retrieve some standardized colors. The idea here is that a child of WGuiBase Provides an interface to retrieve some standardized colors. The idea here is that a child of WGuiBase
+22
View File
@@ -319,6 +319,12 @@
<ClCompile Include="src\CardPrimitive.cpp" /> <ClCompile Include="src\CardPrimitive.cpp" />
<ClCompile Include="src\CardSelector.cpp" /> <ClCompile Include="src\CardSelector.cpp" />
<ClCompile Include="src\CardSelectorSingleton.cpp" /> <ClCompile Include="src\CardSelectorSingleton.cpp" />
<ClCompile Include="src\CarouselDeckView.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='HQ Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="src\Counters.cpp" /> <ClCompile Include="src\Counters.cpp" />
<ClCompile Include="src\Credits.cpp" /> <ClCompile Include="src\Credits.cpp" />
<ClCompile Include="src\Damage.cpp" /> <ClCompile Include="src\Damage.cpp" />
@@ -330,6 +336,12 @@
<ClCompile Include="src\DeckMenuItem.cpp" /> <ClCompile Include="src\DeckMenuItem.cpp" />
<ClCompile Include="src\DeckMetaData.cpp" /> <ClCompile Include="src\DeckMetaData.cpp" />
<ClCompile Include="src\DeckStats.cpp" /> <ClCompile Include="src\DeckStats.cpp" />
<ClCompile Include="src\DeckView.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='HQ Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="src\DuelLayers.cpp" /> <ClCompile Include="src\DuelLayers.cpp" />
<ClCompile Include="src\ExtraCost.cpp" /> <ClCompile Include="src\ExtraCost.cpp" />
<ClCompile Include="src\GameApp.cpp"> <ClCompile Include="src\GameApp.cpp">
@@ -363,6 +375,12 @@
<ClCompile Include="src\GameStateShop.cpp" /> <ClCompile Include="src\GameStateShop.cpp" />
<ClCompile Include="src\GameStateStory.cpp" /> <ClCompile Include="src\GameStateStory.cpp" />
<ClCompile Include="src\GameStateTransitions.cpp" /> <ClCompile Include="src\GameStateTransitions.cpp" />
<ClCompile Include="src\GridDeckView.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='HQ Debug|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Profile|Win32'">NotUsing</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
</ClCompile>
<ClCompile Include="src\GuiAvatars.cpp" /> <ClCompile Include="src\GuiAvatars.cpp" />
<ClCompile Include="src\GuiBackground.cpp" /> <ClCompile Include="src\GuiBackground.cpp" />
<ClCompile Include="src\GuiCardsController.cpp" /> <ClCompile Include="src\GuiCardsController.cpp" />
@@ -461,6 +479,7 @@
<ClInclude Include="include\CardPrimitive.h" /> <ClInclude Include="include\CardPrimitive.h" />
<ClInclude Include="include\CardSelector.h" /> <ClInclude Include="include\CardSelector.h" />
<ClInclude Include="include\CardSelectorSingleton.h" /> <ClInclude Include="include\CardSelectorSingleton.h" />
<ClInclude Include="include\CarouselDeckView.h" />
<ClInclude Include="include\config.h" /> <ClInclude Include="include\config.h" />
<ClInclude Include="include\Counters.h" /> <ClInclude Include="include\Counters.h" />
<ClInclude Include="include\Credits.h" /> <ClInclude Include="include\Credits.h" />
@@ -473,7 +492,9 @@
<ClInclude Include="include\DeckMenuItem.h" /> <ClInclude Include="include\DeckMenuItem.h" />
<ClInclude Include="include\DeckMetaData.h" /> <ClInclude Include="include\DeckMetaData.h" />
<ClInclude Include="include\DeckStats.h" /> <ClInclude Include="include\DeckStats.h" />
<ClInclude Include="include\DeckView.h" />
<ClInclude Include="include\DuelLayers.h" /> <ClInclude Include="include\DuelLayers.h" />
<ClInclude Include="include\Easing.h" />
<ClInclude Include="include\Effects.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" />
@@ -488,6 +509,7 @@
<ClInclude Include="include\GameStateShop.h" /> <ClInclude Include="include\GameStateShop.h" />
<ClInclude Include="include\GameStateStory.h" /> <ClInclude Include="include\GameStateStory.h" />
<ClInclude Include="include\GameStateTransitions.h" /> <ClInclude Include="include\GameStateTransitions.h" />
<ClInclude Include="include\GridDeckView.h" />
<ClInclude Include="include\GuiAvatars.h" /> <ClInclude Include="include\GuiAvatars.h" />
<ClInclude Include="include\GuiBackground.h" /> <ClInclude Include="include\GuiBackground.h" />
<ClInclude Include="include\GuiCardsController.h" /> <ClInclude Include="include\GuiCardsController.h" />
+22 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<ClCompile Include="src\ActionElement.cpp"> <ClCompile Include="src\ActionElement.cpp">
@@ -334,6 +334,15 @@
<ClCompile Include="src\AIPlayerMinMax.cpp"> <ClCompile Include="src\AIPlayerMinMax.cpp">
<Filter>src</Filter> <Filter>src</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="src\CarouselDeckView.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\DeckView.cpp">
<Filter>src</Filter>
</ClCompile>
<ClCompile Include="src\GridDeckView.cpp">
<Filter>src</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="include\ActionElement.h"> <ClInclude Include="include\ActionElement.h">
@@ -687,6 +696,18 @@
<ClInclude Include="include\AIPlayerMinMax.h"> <ClInclude Include="include\AIPlayerMinMax.h">
<Filter>inc</Filter> <Filter>inc</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="include\CarouselDeckView.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="include\DeckView.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="include\Easing.h">
<Filter>inc</Filter>
</ClInclude>
<ClInclude Include="include\GridDeckView.h">
<Filter>inc</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="Makefile" /> <None Include="Makefile" />
+241 -373
View File
@@ -1,39 +1,19 @@
#------------------------------------------------- #-------------------------------------------------
#-------------------------------------------------
include(wagic.pri)
DEFINES += SDL_CONFIG
# #
# Project created by QtCreator 2010-06-30T19:48:30 # Project created by QtCreator 2010-06-30T19:48:30
# #
#------------------------------------------------- QT -= core gui opengl network declarative
#QT += core gui opengl network #unix|windows:QMAKE_CXXFLAGS += -std=c++11
macx:QT += phonon
#CONFIG += warn_off precompile_header // causes some massives errors on mac. INCLUDEPATH += ../../JGE/Dependencies/SDL/include
VERSION = 0.14.1
TARGET = wagic
TEMPLATE = app
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-parameter
windows:DEFINES += WIN32
windows:DEFINES += _CRT_SECURE_NO_WARNINGS
unix|macx:DEFINES += LINUX
CONFIG(debug, debug|release):DEFINES += _DEBUG
#DEFINES += QT_CONFIG
#DEFINES += NETWORK_SUPPORT
DEFINES += SDL_CONFIG
DEFINES += TIXML_USE_STL
macx:DEFINES += USE_PHONON
maemo5: {
DEFINES += USE_PHONON
QT += phonon dbus
}
windows:INCLUDEPATH += ../../JGE/Dependencies/include
windows:INCLUDEPATH += ../../JGE/Dependencies/SDL/include
windows:INCLUDEPATH += extra
unix:INCLUDEPATH += /usr/include/GL unix:INCLUDEPATH += /usr/include/GL
unix:INCLUDEPATH += /usr/local/include/SDL unix:INCLUDEPATH += /usr/local/include/SDL
macx:INCLUDEPATH += /opt/include
INCLUDEPATH += ../../JGE/include
INCLUDEPATH += ../../JGE/src/zipFS
INCLUDEPATH += ../../Boost
INCLUDEPATH += include
OBJECTS_DIR = objs OBJECTS_DIR = objs
MOC_DIR = objs MOC_DIR = objs
DESTDIR = bin DESTDIR = bin
@@ -42,358 +22,246 @@ macx|unix:LIBS += -lz -lboost_thread-mt
unix:LIBS += -ljpeg -lgif -lpng12 -L/usr/local/lib -lGL -lGLU -lSDL unix:LIBS += -ljpeg -lgif -lpng12 -L/usr/local/lib -lGL -lGLU -lSDL
windows:LIBS += -L../../JGE/Dependencies/lib -L../../Boost/lib -llibjpeg-static-mt-debug -lgiflib -llibpng -lfmodvc windows:LIBS += -L../../JGE/Dependencies/lib -L../../Boost/lib -llibjpeg-static-mt-debug -lgiflib -llibpng -lfmodvc
PRECOMPILED_HEADER = include/PrecompiledHeader.h
# MGT
SOURCES += \
src/AbilityParser.cpp\
src/ActionElement.cpp\
src/ActionLayer.cpp\
src/ActionStack.cpp\
src/AIHints.cpp\
src/AIMomirPlayer.cpp\
src/AIPlayer.cpp\
src/AIPlayerBaka.cpp\
src/AIStats.cpp\
src/AllAbilities.cpp\
src/CardDescriptor.cpp\
src/CardDisplay.cpp\
src/CardEffect.cpp\
src/CardGui.cpp\
src/CardPrimitive.cpp\
src/CardSelector.cpp\
src/CardSelectorSingleton.cpp\
src/Closest.cpp\
src/Counters.cpp\
src/Credits.cpp\
src/Damage.cpp\
src/DamagerDamaged.cpp\
src/DeckDataWrapper.cpp\
src/DeckEditorMenu.cpp\
src/DeckManager.cpp\
src/DeckMenu.cpp\
src/DeckMenuItem.cpp\
src/DeckMetaData.cpp\
src/DeckStats.cpp\
src/DuelLayers.cpp\
src/Effects.cpp\
src/ExtraCost.cpp\
src/GameApp.cpp\
src/GameLauncher.cpp\
src/GameObserver.cpp\
src/GameOptions.cpp\
src/GameStateAwards.cpp\
src/GameState.cpp\
src/GameStateDeckViewer.cpp\
src/GameStateDuel.cpp\
src/GameStateMenu.cpp\
src/GameStateOptions.cpp\
src/GameStateShop.cpp\
src/GameStateStory.cpp\
src/GameStateTransitions.cpp\
src/GuiAvatars.cpp\
src/GuiBackground.cpp\
src/GuiCardsController.cpp\
src/GuiCombat.cpp\
src/GuiFrame.cpp\
src/GuiHand.cpp\
src/GuiLayers.cpp\
src/GuiMana.cpp\
src/GuiPhaseBar.cpp\
src/GuiPlay.cpp\
src/GuiStatic.cpp\
src/IconButton.cpp\
src/ManaCost.cpp\
src/ManaCostHybrid.cpp\
src/MenuItem.cpp\
src/ModRules.cpp\
src/MTGAbility.cpp\
src/MTGCard.cpp\
src/MTGCardInstance.cpp\
src/MTGDeck.cpp\
src/MTGDefinitions.cpp\
src/MTGGamePhase.cpp\
src/MTGGameZones.cpp\
src/MTGPack.cpp\
src/MTGRules.cpp\
src/ObjectAnalytics.cpp\
src/OptionItem.cpp\
src/PhaseRing.cpp\
src/Player.cpp\
src/PlayerData.cpp\
src/PlayGuiObject.cpp\
src/PlayGuiObjectController.cpp\
src/PlayRestrictions.cpp\
src/Pos.cpp\
src/PriceList.cpp\
src/ReplacementEffects.cpp\
src/Rules.cpp\
src/SimpleMenu.cpp\
src/SimpleMenuItem.cpp\
src/SimplePad.cpp\
src/SimplePopup.cpp\
src/StoryFlow.cpp\
src/Subtypes.cpp\
src/StyleManager.cpp\
src/TargetChooser.cpp\
src/TargetsList.cpp\
src/Tasks.cpp\
src/TextScroller.cpp\
src/ThisDescriptor.cpp\
src/Token.cpp\
src/Translate.cpp\
src/TranslateKeys.cpp\
src/Trash.cpp\
src/utils.cpp\
src/WCachedResource.cpp\
src/WDataSrc.cpp\
src/WEvent.cpp\
src/WFilter.cpp\
src/WFont.cpp\
src/WGui.cpp\
src/WResourceManager.cpp\
src/NetworkPlayer.cpp
CONFIG(debug, debug|release):SOURCES += src/TestSuiteAI.cpp CONFIG(debug, debug|release):SOURCES += src/TestSuiteAI.cpp
HEADERS += \
include/AllAbilities.h\
include/DeckMenu.h\
include/DeckMenuItem.h\
include/ExtraCost.h\
include/ManaCost.h\
include/SimpleMenuItem.h\
include/GameApp.h\
include/ManaCostHybrid.h\
include/SimplePad.h\
include/ActionElement.h\
include/GameObserver.h\
include/MenuItem.h\
include/StoryFlow.h\
include/ActionLayer.h\
include/GameOptions.h\
include/MTGAbility.h\
include/Subtypes.h\
include/ActionStack.h\
include/GameStateAwards.h\
include/MTGCard.h\
include/AIMomirPlayer.h\
include/GameStateDeckViewer.h\
include/MTGCardInstance.h\
include/Targetable.h\
include/AIPlayer.h\
include/GameStateDuel.h\
include/MTGDeck.h\
include/TargetChooser.h\
include/AIStats.h\
include/GameState.h\
include/MTGDefinitions.h\
include/TargetsList.h\
include/AllAbilities.h\
include/GameStateMenu.h\
include/MTGGamePhase.h\
include/Tasks.h\
include/CardDescriptor.h\
include/GameStateOptions.h\
include/MTGGameZones.h\
include/TestSuiteAI.h\
include/CardDisplay.h\
include/GameStateShop.h\
include/MTGPack.h\
include/TextScroller.h\
include/CardEffect.h\
include/GameStateStory.h\
include/MTGRules.h\
include/ThisDescriptor.h\
include/CardGui.h\
include/GameStateTransitions.h\
include/IconButton.h\
include/OptionItem.h\
include/Token.h\
include/CardPrimitive.h\
include/GuiAvatars.h\
include/OSD.h\
include/Translate.h\
include/CardSelector.h\
include/CardSelectorSingleton.h\
include/GuiBackground.h\
include/PhaseRing.h\
include/TranslateKeys.h\
include/config.h\
include/GuiCardsController.h\
include/PlayerData.h\
include/Trash.h\
include/Counters.h\
include/GuiCombat.h\
include/Player.h\
include/utils.h\
include/Credits.h\
include/GuiFrame.h\
include/PlayGuiObjectController.h\
include/WCachedResource.h\
include/Damage.h\
include/GuiHand.h\
include/PlayGuiObject.h\
include/WDataSrc.h\
include/DamagerDamaged.h\
include/GuiLayers.h\
include/Pos.h\
include/WEvent.h\
include/DeckDataWrapper.h\
include/GuiMana.h\
include/PriceList.h\
include/WFilter.h\
include/DeckMetaData.h\
include/GuiPhaseBar.h\
include/ReplacementEffects.h\
include/WGui.h\
include/DeckStats.h\
include/GuiPlay.h\
include/Rules.h\
include/WResourceManager.h\
include/DuelLayers.h\
include/GuiStatic.h\
include/Effects.h\
include/StyleManager.h\
include/WFont.h\
include/DeckManager.h\
include/SimplePopup.h\
include/SimpleMenu.h\
include/PrecompiledHeader.h\
include/Navigator.h\
include/DeckEditorMenu.h\
include/PlayRestrictions.h\
include/NetworkPlayer.h\
include/ModRules.h\
include/AIHints.h\
# JGE, could probably be moved outside # JGE, could probably be moved outside
SOURCES += \ SOURCES += \
../../JGE/src/SDLmain.cpp\ ../../JGE/src/SDLmain.cpp\
../../JGE/src/Encoding.cpp\ ../../JGE/src/JMD2Model.cpp
../../JGE/src/JAnimator.cpp\
../../JGE/src/JApp.cpp\
../../JGE/src/JDistortionMesh.cpp\
../../JGE/src/JFileSystem.cpp\
../../JGE/src/JGameObject.cpp\
../../JGE/src/JGE.cpp\
../../JGE/src/JGui.cpp\
../../JGE/src/JLogger.cpp\
../../JGE/src/JLBFont.cpp\
../../JGE/src/JMD2Model.cpp\
../../JGE/src/JOBJModel.cpp\
../../JGE/src/JParticle.cpp\
../../JGE/src/JParticleEffect.cpp\
../../JGE/src/JParticleEmitter.cpp\
../../JGE/src/JParticleSystem.cpp\
../../JGE/src/JResourceManager.cpp\
../../JGE/src/JSpline.cpp\
../../JGE/src/JSprite.cpp\
../../JGE/src/Vector2D.cpp\
../../JGE/src/tinyxml/tinystr.cpp\
../../JGE/src/tinyxml/tinyxml.cpp\
../../JGE/src/tinyxml/tinyxmlerror.cpp\
../../JGE/src/tinyxml/tinyxmlparser.cpp\
../../JGE/src/hge/hgecolor.cpp\
../../JGE/src/hge/hgedistort.cpp\
../../JGE/src/hge/hgefont.cpp\
../../JGE/src/hge/hgeparticle.cpp\
../../JGE/src/hge/hgerect.cpp\
../../JGE/src/hge/hgevector.cpp\
../../JGE/src/zipFS/zfsystem.cpp\
../../JGE/src/zipFS/ziphdr.cpp\
../../JGE/src/zipFS/zstream.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/pc/JGfx.cpp\
../../JGE/src/JNetwork.cpp\
../../JGE/src/pc/JSocket.cpp
HEADERS += \ windows{
../../JGE/include/decoder_prx.h\
../../JGE/include/DebugRoutines.h\
../../JGE/include/Encoding.h\
../../JGE/include/JAnimator.h\
../../JGE/include/JApp.h\
../../JGE/include/JAssert.h\
../../JGE/include/JCooleyesMP3.h\
../../JGE/include/JDistortionMesh.h\
../../JGE/include/JFileSystem.h\
../../JGE/include/JGameLauncher.h\
../../JGE/include/JGameObject.h\
../../JGE/include/JGE.h\
../../JGE/include/JGui.h\
../../JGE/include/JLBFont.h\
../../JGE/include/JLogger.h\
../../JGE/include/JMD2Model.h\
../../JGE/include/JMP3.h\
../../JGE/include/JNetwork.h\
../../JGE/include/JOBJModel.h\
../../JGE/include/JParticleEffect.h\
../../JGE/include/JParticleEmitter.h\
../../JGE/include/JParticle.h\
../../JGE/include/JParticleSystem.h\
../../JGE/include/JRenderer.h\
../../JGE/include/JResourceManager.h\
../../JGE/include/JSocket.h\
../../JGE/include/JSoundSystem.h\
../../JGE/include/JSpline.h\
../../JGE/include/JSprite.h\
../../JGE/include/JTypes.h\
../../JGE/include/Vector2D.h\
../../JGE/include/Vector3D.h\
../../JGE/include/vram.h\
../../JGE/include/Threading.h\
../../JGE/src/tinyxml/tinystr.h\
../../JGE/src/tinyxml/tinyxml.h\
../../JGE/include/vram.h\
../../JGE/include/hge/hgecolor.h\
../../JGE/include/hge/hgedistort.h\
../../JGE/include/hge/hgefont.h\
../../JGE/include/hge/hgerect.h\
../../JGE/include/hge/hgevector.h\
../../JGE/include/hge/hgeparticle.h\
../../JGE/include/unzip/ioapi.h\
../../JGE/include/unzip/mztools.h\
../../JGE/include/unzip/unzip.h\
../../JGE/include/JNetwork.h\
../../JGE/include/JSocket.h
INSTALLS += target \ SOURCES += \
res \ ../../JGE/Dependencies/SDL/src/core/windows/SDL_windows.c\
../../JGE/Dependencies/SDL/src/events/SDL_clipboardevents.c\
../../JGE/Dependencies/SDL/src/events/SDL_gesture.c\
../../JGE/Dependencies/SDL/src/events/SDL_touch.c\
../../JGE/Dependencies/SDL/src/libm/e_atan2.c\
../../JGE/Dependencies/SDL/src/libm/e_log.c\
../../JGE/Dependencies/SDL/src/libm/e_pow.c\
../../JGE/Dependencies/SDL/src/libm/e_rem_pio2.c\
../../JGE/Dependencies/SDL/src/libm/e_sqrt.c\
../../JGE/Dependencies/SDL/src/libm/k_cos.c\
../../JGE/Dependencies/SDL/src/libm/k_rem_pio2.c\
../../JGE/Dependencies/SDL/src/libm/k_sin.c\
../../JGE/Dependencies/SDL/src/libm/s_atan.c\
../../JGE/Dependencies/SDL/src/libm/s_copysign.c\
../../JGE/Dependencies/SDL/src/libm/s_cos.c\
../../JGE/Dependencies/SDL/src/libm/s_fabs.c\
../../JGE/Dependencies/SDL/src/libm/s_floor.c\
../../JGE/Dependencies/SDL/src/libm/s_scalbn.c\
../../JGE/Dependencies/SDL/src/libm/s_sin.c\
../../JGE/Dependencies/SDL/src/render/direct3d/SDL_render_d3d.c\
../../JGE/Dependencies/SDL/src/render/opengl/SDL_render_gl.c\
../../JGE/Dependencies/SDL/src/render/opengl/SDL_shaders_gl.c\
../../JGE/Dependencies/SDL/src/render/SDL_render.c\
../../JGE/Dependencies/SDL/src/render/SDL_yuv_mmx.c\
../../JGE/Dependencies/SDL/src/render/SDL_yuv_sw.c\
../../JGE/Dependencies/SDL/src/render/software/SDL_blendfillrect.c\
../../JGE/Dependencies/SDL/src/render/software/SDL_blendline.c\
../../JGE/Dependencies/SDL/src/render/software/SDL_blendpoint.c\
../../JGE/Dependencies/SDL/src/render/software/SDL_drawline.c\
../../JGE/Dependencies/SDL/src/render/software/SDL_drawpoint.c\
../../JGE/Dependencies/SDL/src/render/software/SDL_render_sw.c\
../../JGE/Dependencies/SDL/src/SDL.c\
../../JGE/Dependencies/SDL/src/SDL_assert.c\
../../JGE/Dependencies/SDL/src/atomic/SDL_atomic.c\
../../JGE/Dependencies/SDL/src/atomic/SDL_spinlock.c\
../../JGE/Dependencies/SDL/src/audio/SDL_audio.c\
../../JGE/Dependencies/SDL/src/audio/SDL_audiocvt.c\
../../JGE/Dependencies/SDL/src/audio/SDL_audiodev.c\
../../JGE/Dependencies/SDL/src/audio/SDL_audiotypecvt.c\
../../JGE/Dependencies/SDL/src/SDL_hints.c\
../../JGE/Dependencies/SDL/src/SDL_log.c\
../../JGE/Dependencies/SDL/src/video/dummy/SDL_nullframebuffer.c\
../../JGE/Dependencies/SDL/src/video/SDL_blit.c\
../../JGE/Dependencies/SDL/src/video/SDL_blit_0.c\
../../JGE/Dependencies/SDL/src/video/SDL_blit_1.c\
../../JGE/Dependencies/SDL/src/video/SDL_blit_A.c\
../../JGE/Dependencies/SDL/src/video/SDL_blit_auto.c\
../../JGE/Dependencies/SDL/src/video/SDL_blit_copy.c\
../../JGE/Dependencies/SDL/src/video/SDL_blit_N.c\
../../JGE/Dependencies/SDL/src/video/SDL_blit_slow.c\
../../JGE/Dependencies/SDL/src/video/SDL_bmp.c\
../../JGE/Dependencies/SDL/src/SDL_compat.c\
../../JGE/Dependencies/SDL/src/cpuinfo/SDL_cpuinfo.c\
../../JGE/Dependencies/SDL/src/video/SDL_clipboard.c\
../../JGE/Dependencies/SDL/src/video/SDL_shape.c\
../../JGE/Dependencies/SDL/src/audio/windib/SDL_dibaudio.c\
../../JGE/Dependencies/SDL/src/audio/disk/SDL_diskaudio.c\
../../JGE/Dependencies/SDL/src/audio/dummy/SDL_dummyaudio.c\
../../JGE/Dependencies/SDL/src/audio/windx5/SDL_dx5audio.c\
../../JGE/Dependencies/SDL/src/joystick/windows/SDL_dxjoystick.c\
../../JGE/Dependencies/SDL/src/SDL_error.c\
../../JGE/Dependencies/SDL/src/events/SDL_events.c\
../../JGE/Dependencies/SDL/src/SDL_fatal.c\
../../JGE/Dependencies/SDL/src/video/SDL_fillrect.c\
../../JGE/Dependencies/SDL/src/stdlib/SDL_getenv.c\
../../JGE/Dependencies/SDL/src/haptic/SDL_haptic.c\
../../JGE/Dependencies/SDL/src/stdlib/SDL_iconv.c\
../../JGE/Dependencies/SDL/src/joystick/SDL_joystick.c\
../../JGE/Dependencies/SDL/src/events/SDL_keyboard.c\
../../JGE/Dependencies/SDL/src/stdlib/SDL_malloc.c\
../../JGE/Dependencies/SDL/src/audio/SDL_mixer.c\
../../JGE/Dependencies/SDL/src/joystick/windows/SDL_mmjoystick.c\
../../JGE/Dependencies/SDL/src/events/SDL_mouse.c\
../../JGE/Dependencies/SDL/src/video/dummy/SDL_nullevents.c\
../../JGE/Dependencies/SDL/src/video/dummy/SDL_nullvideo.c\
../../JGE/Dependencies/SDL/src/video/SDL_pixels.c\
../../JGE/Dependencies/SDL/src/power/SDL_power.c\
../../JGE/Dependencies/SDL/src/stdlib/SDL_qsort.c\
../../JGE/Dependencies/SDL/src/events/SDL_quit.c\
../../JGE/Dependencies/SDL/src/video/SDL_rect.c\
../../JGE/Dependencies/SDL/src/video/SDL_RLEaccel.c\
../../JGE/Dependencies/SDL/src/file/SDL_rwops.c\
../../JGE/Dependencies/SDL/src/stdlib/SDL_stdlib.c\
../../JGE/Dependencies/SDL/src/video/SDL_stretch.c\
../../JGE/Dependencies/SDL/src/stdlib/SDL_string.c\
../../JGE/Dependencies/SDL/src/video/SDL_surface.c\
../../JGE/Dependencies/SDL/src/haptic/windows/SDL_syshaptic.c\
../../JGE/Dependencies/SDL/src/loadso/windows/SDL_sysloadso.c\
../../JGE/Dependencies/SDL/src/thread/windows/SDL_sysmutex.c\
../../JGE/Dependencies/SDL/src/power/windows/SDL_syspower.c\
../../JGE/Dependencies/SDL/src/thread/windows/SDL_syssem.c\
../../JGE/Dependencies/SDL/src/thread/windows/SDL_systhread.c\
../../JGE/Dependencies/SDL/src/timer/windows/SDL_systimer.c\
../../JGE/Dependencies/SDL/src/thread/SDL_thread.c\
../../JGE/Dependencies/SDL/src/timer/SDL_timer.c\
../../JGE/Dependencies/SDL/src/video/SDL_video.c\
../../JGE/Dependencies/SDL/src/audio/SDL_wave.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsclipboard.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsevents.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsframebuffer.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowskeyboard.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsmodes.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsmouse.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsopengl.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsshape.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsvideo.c\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowswindow.c\
../../JGE/Dependencies/SDL/src/events/SDL_windowevents.c
res.path = /usr/local/bin/Res
res.files += bin/Res/*
target.path = /usr/local/bin
maemo5: { HEADERS += \
# Variables ../../JGE/Dependencies/SDL/include/SDL.h\
BINDIR = /opt/wagic ../../JGE/Dependencies/SDL/include/SDL_assert.h\
RESDIR = /home/user/wagic/Res ../../JGE/Dependencies/SDL/include/SDL_atomic.h\
ICONDIR = /usr/share ../../JGE/Dependencies/SDL/include/SDL_audio.h\
DEFINES += RESDIR=\\\"$$RESDIR\\\" ../../JGE/Dependencies/SDL/include/SDL_blendmode.h\
../../JGE/Dependencies/SDL/include/SDL_clipboard.h\
../../JGE/Dependencies/SDL/include/SDL_compat.h\
../../JGE/Dependencies/SDL/include/SDL_config.h\
../../JGE/Dependencies/SDL/include/SDL_config_windows.h\
../../JGE/Dependencies/SDL/include/SDL_copying.h\
../../JGE/Dependencies/SDL/include/SDL_cpuinfo.h\
../../JGE/Dependencies/SDL/include/SDL_endian.h\
../../JGE/Dependencies/SDL/include/SDL_error.h\
../../JGE/Dependencies/SDL/include/SDL_events.h\
../../JGE/Dependencies/SDL/include/SDL_gesture.h\
../../JGE/Dependencies/SDL/include/SDL_haptic.h\
../../JGE/Dependencies/SDL/include/SDL_hints.h\
../../JGE/Dependencies/SDL/include/SDL_input.h\
../../JGE/Dependencies/SDL/include/SDL_joystick.h\
../../JGE/Dependencies/SDL/include/SDL_keyboard.h\
../../JGE/Dependencies/SDL/include/SDL_keycode.h\
../../JGE/Dependencies/SDL/include/SDL_loadso.h\
../../JGE/Dependencies/SDL/include/SDL_log.h\
../../JGE/Dependencies/SDL/include/SDL_main.h\
../../JGE/Dependencies/SDL/include/SDL_mouse.h\
../../JGE/Dependencies/SDL/include/SDL_mutex.h\
../../JGE/Dependencies/SDL/include/SDL_name.h\
../../JGE/Dependencies/SDL/include/SDL_opengl.h\
../../JGE/Dependencies/SDL/include/SDL_opengles.h\
../../JGE/Dependencies/SDL/include/SDL_pixels.h\
../../JGE/Dependencies/SDL/include/SDL_platform.h\
../../JGE/Dependencies/SDL/include/SDL_power.h\
../../JGE/Dependencies/SDL/include/SDL_quit.h\
../../JGE/Dependencies/SDL/include/SDL_rect.h\
../../JGE/Dependencies/SDL/include/SDL_render.h\
../../JGE/Dependencies/SDL/include/SDL_revision.h\
../../JGE/Dependencies/SDL/include/SDL_rwops.h\
../../JGE/Dependencies/SDL/include/SDL_scancode.h\
../../JGE/Dependencies/SDL/include/SDL_shape.h\
../../JGE/Dependencies/SDL/include/SDL_stdinc.h\
../../JGE/Dependencies/SDL/include/SDL_surface.h\
../../JGE/Dependencies/SDL/include/SDL_syswm.h\
../../JGE/Dependencies/SDL/include/SDL_thread.h\
../../JGE/Dependencies/SDL/include/SDL_timer.h\
../../JGE/Dependencies/SDL/include/SDL_touch.h\
../../JGE/Dependencies/SDL/include/SDL_types.h\
../../JGE/Dependencies/SDL/include/SDL_version.h\
../../JGE/Dependencies/SDL/include/SDL_video.h\
../../JGE/Dependencies/SDL/src/core/windows/SDL_windows.h\
../../JGE/Dependencies/SDL/src/events/blank_cursor.h\
../../JGE/Dependencies/SDL/src/events/default_cursor.h\
../../JGE/Dependencies/SDL/src/audio/windx5\directx.h\
../../JGE/Dependencies/SDL/src/events/SDL_clipboardevents_c.h\
../../JGE/Dependencies/SDL/src/events/SDL_gesture_c.h\
../../JGE/Dependencies/SDL/src/events/SDL_touch_c.h\
../../JGE/Dependencies/SDL/src/libm/math.h\
../../JGE/Dependencies/SDL/src/libm/math_private.h\
../../JGE/Dependencies/SDL/src/render/mmx.h\
../../JGE/Dependencies/SDL/src/render/opengl\SDL_shaders_gl.h\
../../JGE/Dependencies/SDL/src/render/SDL_sysrender.h\
../../JGE/Dependencies/SDL/src/render/SDL_yuv_sw_c.h\
../../JGE/Dependencies/SDL/src/audio/SDL_audio_c.h\
../../JGE/Dependencies/SDL/src/audio/SDL_audiodev_c.h\
../../JGE/Dependencies/SDL/src/audio/SDL_audiomem.h\
../../JGE/Dependencies/SDL/src/render/software/SDL_blendfillrect.h\
../../JGE/Dependencies/SDL/src/render/software/SDL_blendline.h\
../../JGE/Dependencies/SDL/src/render/software/SDL_blendpoint.h\
../../JGE/Dependencies/SDL/src/render/software/SDL_draw.h\
../../JGE/Dependencies/SDL/src/render/software/SDL_drawline.h\
../../JGE/Dependencies/SDL/src/render/software/SDL_drawpoint.h\
../../JGE/Dependencies/SDL/src/render/software/SDL_render_sw_c.h\
../../JGE/Dependencies/SDL/src/video/dummy/SDL_nullframebuffer_c.h\
../../JGE/Dependencies/SDL/src/video/SDL_blit.h\
../../JGE/Dependencies/SDL/src/video/SDL_blit_auto.h\
../../JGE/Dependencies/SDL/src/video/SDL_blit_copy.h\
../../JGE/Dependencies/SDL/src/video/SDL_blit_slow.h\
../../JGE/Dependencies/SDL/src/video/SDL_shape_internals.h\
../../JGE/Dependencies/SDL/src/audio/windib/SDL_dibaudio.h\
../../JGE/Dependencies/SDL/src/audio/disk/SDL_diskaudio.h\
../../JGE/Dependencies/SDL/src/audio/dummy/SDL_dummyaudio.h\
../../JGE/Dependencies/SDL/src/audio/windx5/SDL_dx5audio.h\
../../JGE/Dependencies/SDL/src/SDL_error_c.h\
../../JGE/Dependencies/SDL/src/events/SDL_events_c.h\
../../JGE/Dependencies/SDL/src/SDL_fatal.h\
../../JGE/Dependencies/SDL/src/video/SDL_glesfuncs.h\
../../JGE/Dependencies/SDL/src/video/SDL_glfuncs.h\
../../JGE/Dependencies/SDL/src/joystick/SDL_joystick_c.h\
../../JGE/Dependencies/SDL/src/events/SDL_keyboard_c.h\
../../JGE/Dependencies/SDL/src/events/SDL_mouse_c.h\
../../JGE/Dependencies/SDL/src/video/dummy/SDL_nullevents_c.h\
../../JGE/Dependencies/SDL/src/video/dummy/SDL_nullvideo.h\
../../JGE/Dependencies/SDL/src/video/SDL_pixels_c.h\
../../JGE/Dependencies/SDL/src/video/SDL_rect_c.h\
../../JGE/Dependencies/SDL/src/video/SDL_RLEaccel_c.h\
../../JGE/Dependencies/SDL/src/video/SDL_stretch_c.h\
../../JGE/Dependencies/SDL/src/audio/SDL_sysaudio.h\
../../JGE/Dependencies/SDL/src/events/SDL_sysevents.h\
../../JGE/Dependencies/SDL/src/haptic/SDL_syshaptic.h\
../../JGE/Dependencies/SDL/src/joystick/SDL_sysjoystick.h\
../../JGE/Dependencies/SDL/src/thread/SDL_systhread.h\
../../JGE/Dependencies/SDL/src/thread/windows\SDL_systhread_c.h\
../../JGE/Dependencies/SDL/src/timer/SDL_systimer.h\
../../JGE/Dependencies/SDL/src/video/SDL_sysvideo.h\
../../JGE/Dependencies/SDL/src/thread/SDL_thread_c.h\
../../JGE/Dependencies/SDL/src/timer/SDL_timer_c.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_vkeys.h\
../../JGE/Dependencies/SDL/src/audio/SDL_wave.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsclipboard.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsevents.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsframebuffer.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowskeyboard.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsmodes.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsmouse.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsopengl.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsshape.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowsvideo.h\
../../JGE/Dependencies/SDL/src/video/windows/SDL_windowswindow.h\
../../JGE/Dependencies/SDL/src/events/SDL_windowevents_c.h\
../../JGE/Dependencies/SDL/src/video/windows/wmmsg.h\
../../JGE/Dependencies/SDL/VisualC/SDL/resource.h
INSTALLS += target \
desktop \
icon \
res \
restxt \
launcher \
target.path = $$BINDIR
desktop.path = $$ICONDIR/applications/hildon
desktop.files += wagic.desktop
icon.path = $$ICONDIR/icons/hicolor/64x64/apps
icon.files += wagic-64x64.png
res.path = $$RESDIR
res.files += bin/Res/*
# res.extra = tar -C ../../../../src/projects/mtg/bin -czf Res.tgz Res
restxt.path = $$BINDIR
restxt.files += debian/Res.txt
launcher.path = $$BINDIR
launcher.files += debian/launcher
} }
+16 -373
View File
@@ -1,5 +1,9 @@
include(wagic.pri)
# Add more folders to ship with the application, here # Add more folders to ship with the application, here
addExclusiveBuilds(graphics, Graphics, console, Console) addExclusiveBuilds(graphics, Graphics, console, Console)
INCLUDEPATH += ../../JGE/include/qt
CONFIG(console, graphics|console){ CONFIG(console, graphics|console){
QT += core network QT += core network
QT -= gui QT -= gui
@@ -14,407 +18,46 @@ else:CONFIG(graphics, graphics|console){
folder_01.target = /usr/share folder_01.target = /usr/share
DEPLOYMENTFOLDERS = folder_01 DEPLOYMENTFOLDERS = folder_01
QT += core gui opengl network QT += core gui opengl network
QT -= declarative quick qml
#maemo5:DEFINES += QT_WIDGET #maemo5:DEFINES += QT_WIDGET
DEFINES += QT_WIDGET DEFINES += QT_WIDGET
unix:!symbian:INCLUDEPATH += /usr/include/GL unix:!symbian:INCLUDEPATH += /usr/include/GL
# Please do not modify the following two lines. Required for deployment. # Please do not modify the following two lines. Required for deployment.
!maemo5:include(qml/qmlapplicationviewer/qmlapplicationviewer.pri) # !maemo5:include(qml/qmlapplicationviewer/qmlapplicationviewer.pri)
!maemo5:qtcAddDeployment() # !maemo5:qtcAddDeployment()
} }
#!android:!symbian:QT += phonon #!android:!symbian:QT += phonon
maemo5:QT += dbus maemo5:QT += dbus
TARGET = wagic
TEMPLATE = app
#!macx:CONFIG += precompile_header
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-parameter
unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-but-set-parameter
unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-but-set-variable
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-value
unix:!macx:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
unix:!macx:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror
windows:DEFINES += _CRT_SECURE_NO_WARNINGS
unix|macx:DEFINES += LINUX
CONFIG(debug, debug|release) {
DEFINES += _DEBUG
}
DEFINES += QT_CONFIG DEFINES += QT_CONFIG
#!android:!symbian:DEFINES += USE_PHONON #!android:!symbian:DEFINES += USE_PHONON
android:INCLUDEPATH += $$ANDROID_NDK_ROOT/platforms/android-9/arch-arm/usr/include android:INCLUDEPATH += $$ANDROID_NDK_ROOT/platforms/android-9/arch-arm/usr/include
#DEFINES += QT_NO_DEBUG_OUTPUT #DEFINES += QT_NO_DEBUG_OUTPUT
DEFINES += NETWORK_SUPPORT
DEFINES += TIXML_USE_STL
windows:INCLUDEPATH += ../../JGE/Dependencies/include
windows{
*-g++* {
DEFINES += LINUX
}
*-msvc* {
INCLUDEPATH += extra
DEFINES += WIN32
}
}
macx:INCLUDEPATH += /opt/include
INCLUDEPATH += ../../JGE/include/qt
INCLUDEPATH += ../../JGE/include
INCLUDEPATH += ../../JGE/src/zipFS
INCLUDEPATH += ../../Boost
INCLUDEPATH += include
#!symbian:DESTDIR = bin
unix:!symbian:LIBS += -lz
win32:LIBS += ../../JGE/Dependencies/lib/fmodvc.lib
win32:LIBS += ../../JGE/Dependencies/lib/zlibd.lib
PRECOMPILED_HEADER = include/PrecompiledHeader.h
#DEFINES += TRACK_OBJECT_USAGE
#DEFINES += AI_CHANGE_TESTING
#DEFINES += ACTION_LOGGING_TESTING
SOURCES += \
src/AbilityParser.cpp\
src/ActionElement.cpp\
src/ActionLayer.cpp\
src/ActionStack.cpp\
src/AIHints.cpp\
src/AIMomirPlayer.cpp\
src/AIPlayer.cpp\
src/AIPlayerBaka.cpp\
src/AIStats.cpp\
src/AllAbilities.cpp\
src/CardDescriptor.cpp\
src/CardDisplay.cpp\
src/CardGui.cpp\
src/CardPrimitive.cpp\
src/CardSelector.cpp\
src/Closest.cpp\
src/Counters.cpp\
src/Credits.cpp\
src/Damage.cpp\
src/DamagerDamaged.cpp\
src/DeckDataWrapper.cpp\
src/DeckEditorMenu.cpp\
src/DeckManager.cpp\
src/DeckMenu.cpp\
src/DeckMenuItem.cpp\
src/DeckMetaData.cpp\
src/DeckStats.cpp\
src/DuelLayers.cpp\
src/Effects.cpp\
src/ExtraCost.cpp\
src/GameApp.cpp\
src/GameLauncher.cpp\
src/GameObserver.cpp\
src/GameOptions.cpp\
src/GameStateAwards.cpp\
src/GameState.cpp\
src/GameStateDeckViewer.cpp\
src/GameStateDuel.cpp\
src/GameStateMenu.cpp\
src/GameStateOptions.cpp\
src/GameStateShop.cpp\
src/GameStateStory.cpp\
src/GameStateTransitions.cpp\
src/GuiAvatars.cpp\
src/GuiBackground.cpp\
src/GuiCardsController.cpp\
src/GuiCombat.cpp\
src/GuiFrame.cpp\
src/GuiHand.cpp\
src/GuiLayers.cpp\
src/GuiMana.cpp\
src/GuiPhaseBar.cpp\
src/GuiPlay.cpp\
src/GuiStatic.cpp\
src/IconButton.cpp\
src/InteractiveButton.cpp\
src/ManaCost.cpp\
src/ManaCostHybrid.cpp\
src/MenuItem.cpp\
src/ModRules.cpp\
src/MTGAbility.cpp\
src/MTGCard.cpp\
src/MTGCardInstance.cpp\
src/MTGDeck.cpp\
src/MTGDefinitions.cpp\
src/MTGGamePhase.cpp\
src/MTGGameZones.cpp\
src/MTGPack.cpp\
src/MTGRules.cpp\
src/ObjectAnalytics.cpp\
src/OptionItem.cpp\
src/PhaseRing.cpp\
src/Player.cpp\
src/PlayerData.cpp\
src/PlayGuiObject.cpp\
src/PlayGuiObjectController.cpp\
src/PlayRestrictions.cpp\
src/Pos.cpp\
src/PriceList.cpp\
src/ReplacementEffects.cpp\
src/Rules.cpp\
src/SimpleButton.cpp\
src/SimpleMenu.cpp\
src/SimpleMenuItem.cpp\
src/SimplePad.cpp\
src/SimplePopup.cpp\
src/StoryFlow.cpp\
src/Subtypes.cpp\
src/StyleManager.cpp\
src/TargetChooser.cpp\
src/TargetsList.cpp\
src/Tasks.cpp\
src/TextScroller.cpp\
src/ThisDescriptor.cpp\
src/Token.cpp\
src/Translate.cpp\
src/TranslateKeys.cpp\
src/Trash.cpp\
src/utils.cpp\
src/WCachedResource.cpp\
src/WDataSrc.cpp\
src/WEvent.cpp\
src/WFilter.cpp\
src/WFont.cpp\
src/WGui.cpp\
src/WResourceManager.cpp \
src/AIPlayerBakaB.cpp \
src/TestSuiteAI.cpp
HEADERS += \
include/CacheEngine.h\
include/AllAbilities.h\
include/AbilityParser.h\
include/PrecompiledHeader.h\
include/WResource_Fwd.h\
include/PlayRestrictions.h\
include/ModRules.h\
include/AIHints.h\
include/AIPlayerBaka.h\
include/AIPlayerBakaB.h\
include/DeckEditorMenu.h\
include/WResourceManagerImpl.h\
include/DeckMenu.h\
include/DeckMenuItem.h\
include/ExtraCost.h\
include/ManaCost.h\
include/SimpleMenuItem.h\
include/GameApp.h\
include/ManaCostHybrid.h\
include/SimplePad.h\
include/ActionElement.h\
include/GameObserver.h\
include/MenuItem.h\
include/StoryFlow.h\
include/ActionLayer.h\
include/GameOptions.h\
include/MTGAbility.h\
include/Subtypes.h\
include/ActionStack.h\
include/GameStateAwards.h\
include/MTGCard.h\
include/AIMomirPlayer.h\
include/GameStateDeckViewer.h\
include/MTGCardInstance.h\
include/Targetable.h\
include/AIPlayer.h\
include/GameStateDuel.h\
include/MTGDeck.h\
include/TargetChooser.h\
include/AIStats.h\
include/GameState.h\
include/MTGDefinitions.h\
include/TargetsList.h\
include/AllAbilities.h\
include/GameStateMenu.h\
include/MTGGamePhase.h\
include/Tasks.h\
include/CardDescriptor.h\
include/GameStateOptions.h\
include/MTGGameZones.h\
include/TestSuiteAI.h\
include/CardDisplay.h\
include/GameStateShop.h\
include/MTGPack.h\
include/TextScroller.h\
include/GameStateStory.h\
include/MTGRules.h\
include/ThisDescriptor.h\
include/CardGui.h\
include/GameStateTransitions.h\
include/IconButton.h\
include/OptionItem.h\
include/Token.h\
include/CardPrimitive.h\
include/GuiAvatars.h\
include/Translate.h\
include/CardSelector.h\
include/GuiBackground.h\
include/PhaseRing.h\
include/TranslateKeys.h\
include/config.h\
include/GuiCardsController.h\
include/PlayerData.h\
include/Trash.h\
include/Counters.h\
include/GuiCombat.h\
include/Player.h\
include/utils.h\
include/Credits.h\
include/GuiFrame.h\
include/PlayGuiObjectController.h\
include/WCachedResource.h\
include/Damage.h\
include/GuiHand.h\
include/PlayGuiObject.h\
include/WDataSrc.h\
include/DamagerDamaged.h\
include/GuiLayers.h\
include/Pos.h\
include/WEvent.h\
include/DeckDataWrapper.h\
include/GuiMana.h\
include/PriceList.h\
include/WFilter.h\
include/DeckMetaData.h\
include/GuiPhaseBar.h\
include/ReplacementEffects.h\
include/WGui.h\
include/DeckStats.h\
include/GuiPlay.h\
include/Rules.h\
include/WResourceManager.h\
include/DuelLayers.h\
include/GuiStatic.h\
include/Effects.h\
include/StyleManager.h\
include/WFont.h\
include/DeckManager.h\
include/SimplePopup.h\
include/SimpleMenu.h\
include/SimpleButton.h\
include/InteractiveButton.h\
include/ObjectAnalytics.h
# JGE, could probably be moved outside
SOURCES += \
../../JGE/src/Encoding.cpp\
../../JGE/src/JAnimator.cpp\
../../JGE/src/JApp.cpp\
../../JGE/src/JDistortionMesh.cpp\
../../JGE/src/JFileSystem.cpp\
../../JGE/src/JGameObject.cpp\
../../JGE/src/JGE.cpp\
../../JGE/src/JGui.cpp\
../../JGE/src/JLogger.cpp\
../../JGE/src/JLBFont.cpp\
../../JGE/src/JOBJModel.cpp\
../../JGE/src/JParticle.cpp\
../../JGE/src/JParticleEffect.cpp\
../../JGE/src/JParticleEmitter.cpp\
../../JGE/src/JParticleSystem.cpp\
../../JGE/src/JResourceManager.cpp\
../../JGE/src/JSpline.cpp\
../../JGE/src/JNetwork.cpp\
../../JGE/src/pc/JSocket.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/JSprite.cpp\
../../JGE/src/OutputCapturer.cpp\
../../JGE/src/Vector2D.cpp\
../../JGE/src/tinyxml/tinystr.cpp\
../../JGE/src/tinyxml/tinyxml.cpp\
../../JGE/src/tinyxml/tinyxmlerror.cpp\
../../JGE/src/tinyxml/tinyxmlparser.cpp\
../../JGE/src/hge/hgecolor.cpp\
../../JGE/src/hge/hgedistort.cpp\
../../JGE/src/hge/hgefont.cpp\
../../JGE/src/hge/hgeparticle.cpp\
../../JGE/src/hge/hgerect.cpp\
../../JGE/src/hge/hgevector.cpp\
../../JGE/src/zipFS/zfsystem.cpp\
../../JGE/src/zipFS/ziphdr.cpp\
../../JGE/src/zipFS/zstream.cpp
CONFIG(graphics, graphics|console){ CONFIG(graphics, graphics|console){
HEADERS += \
../../JGE/include/qt/filedownloader.h\
../../JGE/include/qt/corewrapper.h
SOURCES += \ SOURCES += \
../../JGE/src/qt/filedownloader.cpp\ ../../JGE/src/qt/filedownloader.cpp\
../../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/JGfx.cpp ../../JGE/src/pc/JGfx.cpp
HEADERS += \
../../JGE/include/qt/filedownloader.h\
../../JGE/include/qt/corewrapper.h
} }
else:CONFIG(console, graphics|console){ else:CONFIG(console, graphics|console){
HEADERS += \
../../JGE/include/OutputCapturer.h
SOURCES += \ SOURCES += \
../../JGE/src/OutputCapturer.cpp\
../../JGE/src/JGfx-fake.cpp\ ../../JGE/src/JGfx-fake.cpp\
../../JGE/src/Qtconsole.cpp ../../JGE/src/Qtconsole.cpp\
} }
HEADERS += \
../../JGE/include/Threading.h\
../../JGE/include/decoder_prx.h\
../../JGE/include/DebugRoutines.h\
../../JGE/include/Encoding.h\
../../JGE/include/JAnimator.h\
../../JGE/include/JApp.h\
../../JGE/include/JAssert.h\
../../JGE/include/JCooleyesMP3.h\
../../JGE/include/JDistortionMesh.h\
../../JGE/include/JFileSystem.h\
../../JGE/include/JGameLauncher.h\
../../JGE/include/JGameObject.h\
../../JGE/include/JGE.h\
../../JGE/include/JGui.h\
../../JGE/include/JLBFont.h\
../../JGE/include/JLogger.h\
../../JGE/include/JMD2Model.h\
../../JGE/include/JMP3.h\
../../JGE/include/JNetwork.h\
../../JGE/include/JOBJModel.h\
../../JGE/include/JParticleEffect.h\
../../JGE/include/JParticleEmitter.h\
../../JGE/include/JParticle.h\
../../JGE/include/JParticleSystem.h\
../../JGE/include/JRenderer.h\
../../JGE/include/JResourceManager.h\
../../JGE/include/JSocket.h\
../../JGE/include/JSoundSystem.h\
../../JGE/include/JSpline.h\
../../JGE/include/JSprite.h\
../../JGE/include/JTypes.h\
../../JGE/include/OutputCapturer.h\
../../JGE/include/Vector2D.h\
../../JGE/include/Vector3D.h\
../../JGE/include/vram.h\
../../JGE/include/hge/hgecolor.h\
../../JGE/include/hge/hgedistort.h\
../../JGE/include/hge/hgefont.h\
../../JGE/include/hge/hgeparticle.h\
../../JGE/include/hge/hgerect.h\
../../JGE/include/hge/hgevector.h\
../../JGE/src/unzip/unzip.h\
../../JGE/src/unzip/ioapi.h\
../../JGE/src/zipFS/zstream_zlib.h\
../../JGE/src/zipFS/zfsystem.h\
../../JGE/src/zipFS/zstream.h\
../../JGE/src/zipFS/ziphdr.h\
../../JGE/src/zipFS/stdafx.h\
../../JGE/src/zipFS/fileio.h\
../../JGE/src/tinyxml/tinystr.h\
../../JGE/src/tinyxml/tinyxml.h\
../../JGE/include/vram.h
# maemo 5 packaging # maemo 5 packaging
maemo5: { maemo5: {
# Variables # Variables
+482
View File
@@ -0,0 +1,482 @@
# Add more folders to ship with the application, here
TARGET = wagic
TEMPLATE = app
#!macx:CONFIG += precompile_header
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-parameter
unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-but-set-parameter
unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-but-set-variable
unix|*macx*:QMAKE_CXXFLAGS += -Wno-unused-value
unix:!*macx*:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
unix:!*macx*:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror
windows:DEFINES += _CRT_SECURE_NO_WARNINGS
unix|macx:DEFINES += LINUX
CONFIG(debug, debug|release) {
DEFINES += _DEBUG
}
DEFINES += NETWORK_SUPPORT
DEFINES += TIXML_USE_STL
windows:INCLUDEPATH += ../../JGE/Dependencies/include
windows{
*-g++* {
DEFINES += LINUX
INCLUDEPATH += /usr/i686-w64-mingw32/sys-root/mingw/include/Qt
# INCLUDEPATH += /usr/i686-w64-mingw32/sys-root/mingw/include/c++
LIBS += -L/usr/i686-w64-mingw32/sys-root/mingw/lib
LIBS += -lwsock32
DEFINES += FORCE_GL2
}
*-msvc* {
INCLUDEPATH += extra
DEFINES += WIN32
}
}
macx:INCLUDEPATH += /opt/include
INCLUDEPATH += ../../JGE/include
INCLUDEPATH += ../../JGE/src/zipFS
INCLUDEPATH += ../../Boost
INCLUDEPATH += include
unix:!symbian:LIBS += -lz
windows:LIBS += ../../JGE/Dependencies/lib/fmodvc.lib
windows:LIBS += ../../JGE/Dependencies/lib/zlibd.lib
PRECOMPILED_HEADER = include/PrecompiledHeader.h
#DEFINES += TRACK_OBJECT_USAGE
#DEFINES += AI_CHANGE_TESTING
#DEFINES += ACTION_LOGGING_TESTING
SOURCES += \
src/AbilityParser.cpp\
src/ActionElement.cpp\
src/ActionLayer.cpp\
src/ActionStack.cpp\
src/AIHints.cpp\
src/AIMomirPlayer.cpp\
src/AIPlayer.cpp\
src/AIPlayerBaka.cpp\
src/AIStats.cpp\
src/AllAbilities.cpp\
src/CardDescriptor.cpp\
src/CardDisplay.cpp\
src/CardGui.cpp\
src/CardPrimitive.cpp\
src/CardSelector.cpp\
src/CarouselDeckView.cpp\
src/Closest.cpp\
src/Counters.cpp\
src/Credits.cpp\
src/Damage.cpp\
src/DamagerDamaged.cpp\
src/DeckDataWrapper.cpp\
src/DeckEditorMenu.cpp\
src/DeckManager.cpp\
src/DeckMenu.cpp\
src/DeckMenuItem.cpp\
src/DeckMetaData.cpp\
src/DeckStats.cpp\
src/DeckView.cpp\
src/DuelLayers.cpp\
src/Effects.cpp\
src/ExtraCost.cpp\
src/GameApp.cpp\
src/GameLauncher.cpp\
src/GameObserver.cpp\
src/GameOptions.cpp\
src/GameStateAwards.cpp\
src/GameState.cpp\
src/GameStateDeckViewer.cpp\
src/GameStateDuel.cpp\
src/GameStateMenu.cpp\
src/GameStateOptions.cpp\
src/GameStateShop.cpp\
src/GameStateStory.cpp\
src/GameStateTransitions.cpp\
src/GridDeckView.cpp\
src/GuiAvatars.cpp\
src/GuiBackground.cpp\
src/GuiCardsController.cpp\
src/GuiCombat.cpp\
src/GuiFrame.cpp\
src/GuiHand.cpp\
src/GuiLayers.cpp\
src/GuiMana.cpp\
src/GuiPhaseBar.cpp\
src/GuiPlay.cpp\
src/GuiStatic.cpp\
src/IconButton.cpp\
src/InteractiveButton.cpp\
src/ManaCost.cpp\
src/ManaCostHybrid.cpp\
src/MenuItem.cpp\
src/ModRules.cpp\
src/MTGAbility.cpp\
src/MTGCard.cpp\
src/MTGCardInstance.cpp\
src/MTGDeck.cpp\
src/MTGDefinitions.cpp\
src/MTGGamePhase.cpp\
src/MTGGameZones.cpp\
src/MTGPack.cpp\
src/MTGRules.cpp\
src/ObjectAnalytics.cpp\
src/OptionItem.cpp\
src/PhaseRing.cpp\
src/Player.cpp\
src/PlayerData.cpp\
src/PlayGuiObject.cpp\
src/PlayGuiObjectController.cpp\
src/PlayRestrictions.cpp\
src/Pos.cpp\
src/PriceList.cpp\
src/ReplacementEffects.cpp\
src/Rules.cpp\
src/SimpleButton.cpp\
src/SimpleMenu.cpp\
src/SimpleMenuItem.cpp\
src/SimplePad.cpp\
src/SimplePopup.cpp\
src/StoryFlow.cpp\
src/Subtypes.cpp\
src/StyleManager.cpp\
src/TargetChooser.cpp\
src/TargetsList.cpp\
src/Tasks.cpp\
src/TextScroller.cpp\
src/ThisDescriptor.cpp\
src/Token.cpp\
src/Translate.cpp\
src/TranslateKeys.cpp\
src/Trash.cpp\
src/utils.cpp\
src/WCachedResource.cpp\
src/WDataSrc.cpp\
src/WEvent.cpp\
src/WFilter.cpp\
src/WFont.cpp\
src/WGui.cpp\
src/WResourceManager.cpp \
src/AIPlayerBakaB.cpp \
src/TestSuiteAI.cpp
HEADERS += \
include/CarouselDeckView.h\
include/DeckView.h\
include/Easing.h\
include/GridDeckView.h\
include/CacheEngine.h\
include/AllAbilities.h\
include/AbilityParser.h\
include/PrecompiledHeader.h\
include/WResource_Fwd.h\
include/PlayRestrictions.h\
include/ModRules.h\
include/AIHints.h\
include/AIPlayerBaka.h\
include/AIPlayerBakaB.h\
include/DeckEditorMenu.h\
include/WResourceManagerImpl.h\
include/DeckMenu.h\
include/DeckMenuItem.h\
include/ExtraCost.h\
include/ManaCost.h\
include/SimpleMenuItem.h\
include/GameApp.h\
include/ManaCostHybrid.h\
include/SimplePad.h\
include/ActionElement.h\
include/GameObserver.h\
include/MenuItem.h\
include/StoryFlow.h\
include/ActionLayer.h\
include/GameOptions.h\
include/MTGAbility.h\
include/Subtypes.h\
include/ActionStack.h\
include/GameStateAwards.h\
include/MTGCard.h\
include/AIMomirPlayer.h\
include/GameStateDeckViewer.h\
include/MTGCardInstance.h\
include/Targetable.h\
include/AIPlayer.h\
include/GameStateDuel.h\
include/MTGDeck.h\
include/TargetChooser.h\
include/AIStats.h\
include/GameState.h\
include/MTGDefinitions.h\
include/TargetsList.h\
include/AllAbilities.h\
include/GameStateMenu.h\
include/MTGGamePhase.h\
include/Tasks.h\
include/CardDescriptor.h\
include/GameStateOptions.h\
include/MTGGameZones.h\
include/TestSuiteAI.h\
include/CardDisplay.h\
include/GameStateShop.h\
include/MTGPack.h\
include/TextScroller.h\
include/GameStateStory.h\
include/MTGRules.h\
include/ThisDescriptor.h\
include/CardGui.h\
include/GameStateTransitions.h\
include/IconButton.h\
include/OptionItem.h\
include/Token.h\
include/CardPrimitive.h\
include/GuiAvatars.h\
include/Translate.h\
include/CardSelector.h\
include/GuiBackground.h\
include/PhaseRing.h\
include/TranslateKeys.h\
include/config.h\
include/GuiCardsController.h\
include/PlayerData.h\
include/Trash.h\
include/Counters.h\
include/GuiCombat.h\
include/Player.h\
include/utils.h\
include/Credits.h\
include/GuiFrame.h\
include/PlayGuiObjectController.h\
include/WCachedResource.h\
include/Damage.h\
include/GuiHand.h\
include/PlayGuiObject.h\
include/WDataSrc.h\
include/DamagerDamaged.h\
include/GuiLayers.h\
include/Pos.h\
include/WEvent.h\
include/DeckDataWrapper.h\
include/GuiMana.h\
include/PriceList.h\
include/WFilter.h\
include/DeckMetaData.h\
include/GuiPhaseBar.h\
include/ReplacementEffects.h\
include/WGui.h\
include/DeckStats.h\
include/GuiPlay.h\
include/Rules.h\
include/WResourceManager.h\
include/DuelLayers.h\
include/GuiStatic.h\
include/Effects.h\
include/StyleManager.h\
include/WFont.h\
include/DeckManager.h\
include/SimplePopup.h\
include/SimpleMenu.h\
include/SimpleButton.h\
include/InteractiveButton.h\
include/ObjectAnalytics.h
# JGE, could probably be moved outside
SOURCES += \
../../JGE/src/Downloader.cpp\
../../JGE/src/Encoding.cpp\
../../JGE/src/JAnimator.cpp\
../../JGE/src/JApp.cpp\
../../JGE/src/JDistortionMesh.cpp\
../../JGE/src/JFileSystem.cpp\
../../JGE/src/JGameObject.cpp\
../../JGE/src/JGE.cpp\
../../JGE/src/JGui.cpp\
../../JGE/src/JLogger.cpp\
../../JGE/src/JLBFont.cpp\
../../JGE/src/JOBJModel.cpp\
../../JGE/src/JParticle.cpp\
../../JGE/src/JParticleEffect.cpp\
../../JGE/src/JParticleEmitter.cpp\
../../JGE/src/JParticleSystem.cpp\
../../JGE/src/JResourceManager.cpp\
../../JGE/src/JSpline.cpp\
../../JGE/src/JNetwork.cpp\
../../JGE/src/pc/JSocket.cpp\
../../JGE/src/pc/JSfx.cpp\
../../JGE/src/JSprite.cpp\
../../JGE/src/Vector2D.cpp\
../../JGE/src/tinyxml/tinystr.cpp\
../../JGE/src/tinyxml/tinyxml.cpp\
../../JGE/src/tinyxml/tinyxmlerror.cpp\
../../JGE/src/tinyxml/tinyxmlparser.cpp\
../../JGE/src/hge/hgecolor.cpp\
../../JGE/src/hge/hgedistort.cpp\
../../JGE/src/hge/hgefont.cpp\
../../JGE/src/hge/hgeparticle.cpp\
../../JGE/src/hge/hgerect.cpp\
../../JGE/src/hge/hgevector.cpp\
../../JGE/src/zipFS/zfsystem.cpp\
../../JGE/src/zipFS/ziphdr.cpp\
../../JGE/src/zipFS/zstream.cpp
HEADERS += \
../../JGE/include/Downloader.h\
../../JGE/include/Threading.h\
../../JGE/include/decoder_prx.h\
../../JGE/include/DebugRoutines.h\
../../JGE/include/Encoding.h\
../../JGE/include/JAnimator.h\
../../JGE/include/JApp.h\
../../JGE/include/JAssert.h\
../../JGE/include/JCooleyesMP3.h\
../../JGE/include/JDistortionMesh.h\
../../JGE/include/JFileSystem.h\
../../JGE/include/JGameLauncher.h\
../../JGE/include/JGameObject.h\
../../JGE/include/JGE.h\
../../JGE/include/JGui.h\
../../JGE/include/JLBFont.h\
../../JGE/include/JLogger.h\
../../JGE/include/JMD2Model.h\
../../JGE/include/JMP3.h\
../../JGE/include/JNetwork.h\
../../JGE/include/JOBJModel.h\
../../JGE/include/JParticleEffect.h\
../../JGE/include/JParticleEmitter.h\
../../JGE/include/JParticle.h\
../../JGE/include/JParticleSystem.h\
../../JGE/include/JRenderer.h\
../../JGE/include/JResourceManager.h\
../../JGE/include/JSocket.h\
../../JGE/include/JSoundSystem.h\
../../JGE/include/JSpline.h\
../../JGE/include/JSprite.h\
../../JGE/include/JTypes.h\
../../JGE/include/Vector2D.h\
../../JGE/include/Vector3D.h\
../../JGE/include/vram.h\
../../JGE/include/hge/hgecolor.h\
../../JGE/include/hge/hgedistort.h\
../../JGE/include/hge/hgefont.h\
../../JGE/include/hge/hgeparticle.h\
../../JGE/include/hge/hgerect.h\
../../JGE/include/hge/hgevector.h\
../../JGE/src/unzip/unzip.h\
../../JGE/src/unzip/ioapi.h\
../../JGE/src/zipFS/zstream_zlib.h\
../../JGE/src/zipFS/zfsystem.h\
../../JGE/src/zipFS/zstream.h\
../../JGE/src/zipFS/ziphdr.h\
../../JGE/src/zipFS/stdafx.h\
../../JGE/src/zipFS/fileio.h\
../../JGE/src/tinyxml/tinystr.h\
../../JGE/src/tinyxml/tinyxml.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\\\"
}
+71 -2
View File
@@ -1,5 +1,39 @@
#!/bin/sh -ex #!/bin/sh -ex
# let's dump some info to debug a bit
echo PSPDEV = $PSPDEV
echo psp-config = `psp-config --psp-prefix`
echo ls = `ls`
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
cd projects/mtg/
ant update > error.txt
cd ../..
# we create resource package
cd projects/mtg/bin/Res
python createResourceZip.py
# if we let the zip here, Wagic will use it in the testsuite
# and we'll get 51 failed test cases
mv core_*.zip ../../../../core.zip
cd ../../../..
# we're building a PSP binary here # we're building a PSP binary here
cd JGE cd JGE
make -j 8 make -j 8
@@ -7,6 +41,18 @@ cd ..
cd projects/mtg cd projects/mtg
mkdir objs mkdir objs
make -j 8 make -j 8
mkdir WTH
mkdir WTH/Res
mv EBOOT.PBP WTH/
mv ../../JGE/exceptionHandler/prx/exception.prx WTH/
cp ../../core.zip WTH/Res
cd WTH/Res
unzip core.zip
rm core.zip
cd ..
chmod -R 775 Res
cd ..
zip psprelease.zip -r WTH/
cd ../.. cd ../..
# we're building an Android binary here # we're building an Android binary here
@@ -26,5 +72,28 @@ cd ..
qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR
make -j 8 make -j 8
# and finish by running the testsuite # we're cross-compiling a Qt Windows version here,
./wagic # PATH is only set here to prevent colision
export PATH="$PATH:/opt/mingw32/bin"
mkdir build
cd build
mkdir win-cross
cd win-cross
/opt/mingw32/bin/qmake ../../projects/mtg/wagic-qt.pro CONFIG+=release CONFIG+=graphics
make -j 8
cd release
cp ../../../projects/mtg/bin/fmod.dll .
cp /opt/mingw32/bin/QtCore4.dll .
cp /opt/mingw32/bin/QtGui4.dll .
cp /opt/mingw32/bin/QtNetwork4.dll .
cp /opt/mingw32/bin/QtOpenGL4.dll .
cp ../../../projects/mtg/bin/zlib1.dll .
cp /opt/mingw32/bin/libpng15-15.dll .
cd ..
zip win-cross.zip -r release/
cd ../..
# Now we run the testsuite (Res needs to be in the working directory)
cd projects/mtg
../../wagic
cd ../..
+99
View File
@@ -0,0 +1,99 @@
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
if [ "$TRAVIS_BRANCH" == "alphas" ]; then
echo -e "Creating a release\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-d '{"tag_name": "alpha-'${TRAVIS_BUILD_NUMBER}'", "target_commitish": "master", "name": "Alpha release number '${TRAVIS_BUILD_NUMBER}'", "body": "Automatic alpha release generated by Travis CI", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
IDDI=`cat json.txt | jq '.id'`
echo -e "Uploading Core resources\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @core.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip"
echo -e "Uploading android package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @projects/mtg/Android/bin/Wagic-debug.apk \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk"
echo -e "Uploading PSP package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @projects/mtg/psprelease.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip"
echo -e "Uploading Windows package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @build/win-cross/win-cross.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip"
echo -e "Done uploading\n"
fi
fi
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
if [ "$TRAVIS_BRANCH" == "master" ]; then
# get info about all releases
echo -e "Getting info about previous releases"
curl -X GET -H "Authorization: token ${GH_TOKEN}" \
"https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
# extract info only about only "latest-release" tag
cat json.txt |jq 'map(select (.tag_name == "latest-master"))' > latest.txt
# get id of release
ID_TO_DELETE=`cat latest.txt |jq '.[0].id'`
# delete previous release
echo -e "Deleting release number ${ID_TO_DELETE}"
curl -X DELETE -H "Authorization: token ${GH_TOKEN}" \
"https://api.github.com/repos/WagicProject/wagic/releases/${ID_TO_DELETE}"
# delete previous tag
curl -X DELETE -H "Authorization: token ${GH_TOKEN}" \
"https://api.github.com/repos/WagicProject/wagic/git/refs/tags/latest-master"
echo -e "Creating a release\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-d '{"tag_name": "latest-master", "target_commitish": "master", "name": "master-'${TRAVIS_BUILD_NUMBER}'", "body": "Automatic release based on latest commit to master branch generated by Travis CI", "draft": false, "prerelease": true}' "https://api.github.com/repos/WagicProject/wagic/releases" > json.txt
IDDI=`cat json.txt | jq '.id'`
echo -e "Uploading Core resources\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @core.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-core.zip"
echo -e "Uploading android package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @projects/mtg/Android/bin/Wagic-debug.apk \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-android.apk"
echo -e "Uploading PSP package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @projects/mtg/psprelease.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-psp.zip"
echo -e "Uploading Windows package\n"
curl -X POST -H "Authorization: token ${GH_TOKEN}" \
-H "Accept: application/vnd.github.manifold-preview" \
-H "Content-Type: application/zip" \
--data-binary @build/win-cross/win-cross.zip \
"https://uploads.github.com/repos/WagicProject/wagic/releases/${IDDI}/assets?name=Wagic-windows.zip"
echo -e "Done uploading\n"
fi
fi