Compare commits
75 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9cc2c6cc4d | |||
| a695323bc7 | |||
| 9ff087ecde | |||
| 47685f4892 | |||
| 7aaebdc661 | |||
| 8aa0b8cea0 | |||
| fac44c4b48 | |||
| 9889186eab | |||
| 73f9319b92 | |||
| fd6bc95539 | |||
| 0bb211a581 | |||
| e0428ac7b0 | |||
| 3e94de985f | |||
| 9f0b70d1c9 | |||
| 1e8fc81aa3 | |||
| 352e3c2daa | |||
| 678a4734bb | |||
| 052e3abdb8 | |||
| 73c2d17080 | |||
| ffbb228d2d | |||
| 306765c6b6 | |||
| 3cee80e3bc | |||
| 8209716fc9 | |||
| e76c57d747 | |||
| 9c282aeb56 | |||
| bbc310dec7 | |||
| a37af1776a | |||
| 35697a65b4 | |||
| 6bed1666be | |||
| f021866368 | |||
| d7e527166c | |||
| 071a487100 | |||
| f370899a8a | |||
| 331e126787 | |||
| 6c41e5c92c | |||
| 82e3ab3977 | |||
| f2314ca673 | |||
| 94c3ac9ad9 | |||
| 5419d87e4e | |||
| e1213d1c1f | |||
| 446ed20758 | |||
| 7a48c5e087 | |||
| 3ca2f1c1ed | |||
| 146872797b | |||
| c6dc51c7d3 | |||
| 0ef92d154a | |||
| 2835bdf767 | |||
| afc903e31b | |||
| 6294bb1eed | |||
| 9f16b2208d | |||
| 0a765b702b | |||
| 82de6f2840 | |||
| 90652fa73d | |||
| e8c73aaf9d | |||
| f95094a429 | |||
| 7a57de6608 | |||
| 14c2d522c2 | |||
| 6bf2147d94 | |||
| fea5b04a77 | |||
| ea98b769a7 | |||
| 017f6dd1ed | |||
| 784d127a6e | |||
| f6c47b85e3 | |||
| dac31994b6 | |||
| 74280aef1d | |||
| 8013d09e4f | |||
| 6bbe290762 | |||
| 57c9940244 | |||
| db1c552321 | |||
| f08f0ad3b9 | |||
| a3a1bc2b79 | |||
| 9037699281 | |||
| 8d66f82179 | |||
| b17d9d3f85 | |||
| c5190a62cd |
+16
-1
@@ -1,2 +1,17 @@
|
|||||||
language: cpp
|
language: cpp
|
||||||
script: "qmake projects/mtg/wagic-qt.pro CONFIG+=testsuite CONFIG+=debug && make -j 8"
|
before_install:
|
||||||
|
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
|
||||||
|
- export PSPSDK="$PSPDEV/psp/sdk"
|
||||||
|
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
|
||||||
|
- export ANDROID="android-sdk-linux/tools/android"
|
||||||
|
install:
|
||||||
|
- sudo apt-get update -qq
|
||||||
|
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch; fi
|
||||||
|
- wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download
|
||||||
|
- tar -x --xz -f sdk.lzma
|
||||||
|
- wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv
|
||||||
|
- wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv
|
||||||
|
- tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2
|
||||||
|
- tar -zxf android-sdk_r22-linux.tgz
|
||||||
|
- echo yes | $ANDROID update sdk --filter 1,2,3,8 --no-ui --force > log.txt
|
||||||
|
script: "./travis-script.sh"
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
// dirty, but I get OS header includes this way
|
// dirty, but I get OS header includes this way
|
||||||
#include "JGE.h"
|
#include "JGE.h"
|
||||||
|
|
||||||
|
#include "OutputCapturer.h"
|
||||||
|
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
@@ -29,12 +31,23 @@ std::string ToHex(T* pointer)
|
|||||||
#if defined (WIN32) || defined (LINUX)
|
#if defined (WIN32) || defined (LINUX)
|
||||||
|
|
||||||
#ifdef QT_CONFIG
|
#ifdef QT_CONFIG
|
||||||
|
|
||||||
|
#ifdef CAPTURE_STDERR
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
{ \
|
{ \
|
||||||
std::ostringstream stream; \
|
std::ostringstream stream; \
|
||||||
stream << inString << std::endl; \
|
stream << inString; \
|
||||||
qDebug("%s", stream.str().c_str()); \
|
OutputCapturer::add(stream.str()); \
|
||||||
}
|
}
|
||||||
|
#else // CAPTURE_STDERR
|
||||||
|
#define DebugTrace(inString) \
|
||||||
|
{ \
|
||||||
|
std::ostringstream stream; \
|
||||||
|
stream << inString; \
|
||||||
|
qDebug("%s", stream.str().c_str()); \
|
||||||
|
}
|
||||||
|
#endif // CAPTURE_STDERR
|
||||||
|
|
||||||
#elif defined (ANDROID)
|
#elif defined (ANDROID)
|
||||||
#include <android/log.h>
|
#include <android/log.h>
|
||||||
#define DebugTrace(inString) \
|
#define DebugTrace(inString) \
|
||||||
|
|||||||
@@ -44,6 +44,17 @@ typedef WPARAM LocalKeySym;
|
|||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
typedef KeySym LocalKeySym;
|
typedef KeySym LocalKeySym;
|
||||||
#define LOCAL_KEY_NONE XK_VoidSymbol
|
#define LOCAL_KEY_NONE XK_VoidSymbol
|
||||||
|
#undef Status
|
||||||
|
#undef Bool
|
||||||
|
#undef None
|
||||||
|
#undef CursorShape
|
||||||
|
#undef KeyPress
|
||||||
|
#undef KeyRelease
|
||||||
|
#undef FocusIn
|
||||||
|
#undef FocusOut
|
||||||
|
#undef FontChange
|
||||||
|
#undef Unsorted
|
||||||
|
#undef GrayScale
|
||||||
|
|
||||||
#elif defined(ANDROID) // This is temporary until we understand how to send real key events from Java
|
#elif defined(ANDROID) // This is temporary until we understand how to send real key events from Java
|
||||||
typedef long unsigned int LocalKeySym;
|
typedef long unsigned int LocalKeySym;
|
||||||
|
|||||||
@@ -578,7 +578,7 @@ private:
|
|||||||
#if (!defined PSP)
|
#if (!defined PSP)
|
||||||
|
|
||||||
GLuint mCurrentTex;
|
GLuint mCurrentTex;
|
||||||
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)
|
#if ((defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)) && (!defined CONSOLE_CONFIG)
|
||||||
// MVP matrix
|
// MVP matrix
|
||||||
ESMatrix theMvpMatrix;
|
ESMatrix theMvpMatrix;
|
||||||
|
|
||||||
|
|||||||
@@ -25,8 +25,7 @@
|
|||||||
#elif defined USE_PHONON
|
#elif defined USE_PHONON
|
||||||
#include <phonon/AudioOutput>
|
#include <phonon/AudioOutput>
|
||||||
#include <phonon/MediaObject>
|
#include <phonon/MediaObject>
|
||||||
#else
|
#elif defined WIN32
|
||||||
#ifdef WIN32
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#define WITH_FMOD
|
#define WITH_FMOD
|
||||||
#elif defined (PSP)
|
#elif defined (PSP)
|
||||||
@@ -43,10 +42,10 @@
|
|||||||
#include "JAudio.h"
|
#include "JAudio.h"
|
||||||
#include "JMP3.h"
|
#include "JMP3.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_FMOD
|
#ifdef WITH_FMOD
|
||||||
#include "../Dependencies/include/fmod.h"
|
#include "../Dependencies/include/fmod.h"
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|||||||
+64
-47
@@ -75,6 +75,23 @@ enum {
|
|||||||
#define SCREEN_HEIGHT_F 272.0f
|
#define SCREEN_HEIGHT_F 272.0f
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef CONSOLE_CONFIG
|
||||||
|
#define DEFAULT_BLEND 0
|
||||||
|
#define BLEND_OPTION_ADD 0
|
||||||
|
#define BLEND_OPTION_BLEND 0
|
||||||
|
#define BLEND_ZERO 0
|
||||||
|
#define BLEND_ONE 0
|
||||||
|
#define BLEND_SRC_COLOR 0
|
||||||
|
#define BLEND_ONE_MINUS_SRC_COLOR 0
|
||||||
|
#define BLEND_SRC_ALPHA 0
|
||||||
|
#define BLEND_ONE_MINUS_SRC_ALPHA 0
|
||||||
|
#define BLEND_DST_ALPHA 0
|
||||||
|
#define BLEND_ONE_MINUS_DST_ALPHA 0
|
||||||
|
#define BLEND_DST_COLOR 0
|
||||||
|
#define BLEND_ONE_MINUS_DST_COLOR 0
|
||||||
|
#define BLEND_SRC_ALPHA_SATURATE 0
|
||||||
|
#define GU_PSM_5551 0
|
||||||
|
#else
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
// #define DEFAULT_BLEND BLEND_DEFAULT
|
// #define DEFAULT_BLEND BLEND_DEFAULT
|
||||||
// #define BLEND_OPTION_ADD BLEND_COLORADD
|
// #define BLEND_OPTION_ADD BLEND_COLORADD
|
||||||
@@ -84,9 +101,10 @@ enum {
|
|||||||
#define BLEND_OPTION_ADD GU_TFX_ADD
|
#define BLEND_OPTION_ADD GU_TFX_ADD
|
||||||
#define BLEND_OPTION_BLEND GU_TFX_BLEND
|
#define BLEND_OPTION_BLEND GU_TFX_BLEND
|
||||||
#endif
|
#endif
|
||||||
|
#endif // CONSOLE_CONFIG
|
||||||
|
|
||||||
#if (defined WIN32) && (!defined LINUX)
|
#if (defined WIN32) && (!defined LINUX)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined(LINUX) && (!defined WIN32) || defined(IOS) || defined (ANDROID)
|
#if defined(LINUX) && (!defined WIN32) || defined(IOS) || defined (ANDROID)
|
||||||
typedef uint8_t byte;
|
typedef uint8_t byte;
|
||||||
@@ -97,8 +115,21 @@ typedef bool BOOL;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
typedef int8_t s8;
|
||||||
|
typedef int16_t s16;
|
||||||
|
typedef int32_t s32;
|
||||||
|
typedef uint8_t u8;
|
||||||
|
typedef uint16_t u16;
|
||||||
|
typedef uint32_t u32;
|
||||||
|
#define PIXEL_TYPE DWORD
|
||||||
|
#define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
|
||||||
|
#define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
|
||||||
|
#ifndef PSP
|
||||||
|
#define TEXTURE_FORMAT 0
|
||||||
|
#endif //PSP
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef CONSOLE_CONFIG
|
||||||
#ifndef QT_CONFIG
|
#ifndef QT_CONFIG
|
||||||
#if defined (IOS)
|
#if defined (IOS)
|
||||||
#import <OpenGLES/ES2/gl.h>
|
#import <OpenGLES/ES2/gl.h>
|
||||||
@@ -113,7 +144,7 @@ typedef bool BOOL;
|
|||||||
#include <GL/glu.h>
|
#include <GL/glu.h>
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
# include <QtOpenGL>
|
#include <QtOpenGL>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if (defined FORCE_GLES)
|
#if (defined FORCE_GLES)
|
||||||
@@ -127,14 +158,12 @@ typedef bool BOOL;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (PSP)
|
#if defined (PSP)
|
||||||
|
|
||||||
#ifndef ABGR8888
|
#ifndef ABGR8888
|
||||||
#define ABGR8888
|
#define ABGR8888
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined (ABGR8888)
|
#if defined (ABGR8888)
|
||||||
#define PIXEL_TYPE u32
|
|
||||||
#ifndef ARGB
|
#ifndef ARGB
|
||||||
#define ARGB(a, r, g, b) (PIXEL_TYPE)((a << 24) | (b << 16) | (g << 8) | r) // macro to assemble pixels in correct format
|
#define ARGB(a, r, g, b) (PIXEL_TYPE)((a << 24) | (b << 16) | (g << 8) | r) // macro to assemble pixels in correct format
|
||||||
#endif
|
#endif
|
||||||
@@ -215,13 +244,6 @@ typedef struct
|
|||||||
|
|
||||||
#else //non PSP
|
#else //non PSP
|
||||||
|
|
||||||
typedef int8_t s8;
|
|
||||||
typedef int16_t s16;
|
|
||||||
typedef int32_t s32;
|
|
||||||
typedef uint8_t u8;
|
|
||||||
typedef uint16_t u16;
|
|
||||||
typedef uint32_t u32;
|
|
||||||
|
|
||||||
|
|
||||||
#define BLEND_ZERO GL_ZERO
|
#define BLEND_ZERO GL_ZERO
|
||||||
#define BLEND_ONE GL_ONE
|
#define BLEND_ONE GL_ONE
|
||||||
@@ -235,44 +257,16 @@ typedef uint32_t u32;
|
|||||||
#define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR
|
#define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR
|
||||||
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE
|
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE
|
||||||
|
|
||||||
#define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
|
#define GU_PSM_8888 0
|
||||||
#define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
|
#define GU_PSM_5551 0
|
||||||
|
#define GU_PSM_4444 0
|
||||||
#define TEXTURE_FORMAT 0
|
#define GU_PSM_5650 0
|
||||||
#define GU_PSM_8888 0
|
|
||||||
#define GU_PSM_5551 0
|
|
||||||
#define GU_PSM_4444 0
|
|
||||||
#define GU_PSM_5650 0
|
|
||||||
#define PIXEL_TYPE DWORD
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
#else
|
||||||
|
typedef uint32_t GLuint;
|
||||||
|
typedef float GLfloat;
|
||||||
typedef enum Buttons
|
#endif //CONSOLE_CONFIG
|
||||||
{
|
|
||||||
JGE_BTN_NONE = 0, // No button pressed
|
|
||||||
JGE_BTN_QUIT, // Home on PSP
|
|
||||||
JGE_BTN_MENU, // Start on PSP
|
|
||||||
JGE_BTN_CTRL, // Select
|
|
||||||
JGE_BTN_POWER, // Hold
|
|
||||||
JGE_BTN_SOUND, // Music note
|
|
||||||
JGE_BTN_RIGHT,
|
|
||||||
JGE_BTN_LEFT,
|
|
||||||
JGE_BTN_UP,
|
|
||||||
JGE_BTN_DOWN,
|
|
||||||
JGE_BTN_OK, // Circle in Japan, Cross in Europe
|
|
||||||
JGE_BTN_CANCEL, // Triangle
|
|
||||||
JGE_BTN_PRI, // Square (primary)
|
|
||||||
JGE_BTN_SEC, // Cross or Circle (secondary)
|
|
||||||
JGE_BTN_PREV, // Left trigger
|
|
||||||
JGE_BTN_NEXT, // Right trigger
|
|
||||||
JGE_BTN_FULLSCREEN, // Switch to fullscreen (obviously, PC only)
|
|
||||||
|
|
||||||
JGE_BTN_MAX = JGE_BTN_FULLSCREEN + 1
|
|
||||||
} JButton;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------------------------
|
||||||
struct Vertex
|
struct Vertex
|
||||||
@@ -542,5 +536,28 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum Buttons
|
||||||
|
{
|
||||||
|
JGE_BTN_NONE = 0, // No button pressed
|
||||||
|
JGE_BTN_QUIT, // Home on PSP
|
||||||
|
JGE_BTN_MENU, // Start on PSP
|
||||||
|
JGE_BTN_CTRL, // Select
|
||||||
|
JGE_BTN_POWER, // Hold
|
||||||
|
JGE_BTN_SOUND, // Music note
|
||||||
|
JGE_BTN_RIGHT,
|
||||||
|
JGE_BTN_LEFT,
|
||||||
|
JGE_BTN_UP,
|
||||||
|
JGE_BTN_DOWN,
|
||||||
|
JGE_BTN_OK, // Circle in Japan, Cross in Europe
|
||||||
|
JGE_BTN_CANCEL, // Triangle
|
||||||
|
JGE_BTN_PRI, // Square (primary)
|
||||||
|
JGE_BTN_SEC, // Cross or Circle (secondary)
|
||||||
|
JGE_BTN_PREV, // Left trigger
|
||||||
|
JGE_BTN_NEXT, // Right trigger
|
||||||
|
JGE_BTN_FULLSCREEN, // Switch to fullscreen (obviously, PC only)
|
||||||
|
|
||||||
|
JGE_BTN_MAX = JGE_BTN_FULLSCREEN + 1
|
||||||
|
} JButton;
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
#ifndef OUTPUTCAPTURER_H
|
||||||
|
#define OUTPUTCAPTURER_H
|
||||||
|
|
||||||
|
#if defined(QT_CONFIG)
|
||||||
|
#include <Qt>
|
||||||
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
|
#include "Threading.h"
|
||||||
|
|
||||||
|
class OutputCapturer
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
static std::ostringstream stream;
|
||||||
|
static boost::mutex mMutex;
|
||||||
|
|
||||||
|
public:
|
||||||
|
static void add(const std::string& s);
|
||||||
|
static void debugAndClear();
|
||||||
|
static void clear();
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif // OUTPUTCAPTURER_H
|
||||||
@@ -315,7 +315,6 @@ namespace boost
|
|||||||
#include <boost/bind.hpp>
|
#include <boost/bind.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
|
|
||||||
#include "../include/DebugRoutines.h"
|
|
||||||
#include "../include/JLogger.h"
|
#include "../include/JLogger.h"
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
|
|||||||
+1
-10
@@ -3,15 +3,6 @@
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
|
||||||
/*************************** Macros and constants ***************************/
|
|
||||||
// returns a number ranging from -1.0 to 1.0
|
|
||||||
#define FRAND (((float)rand()-(float)rand())/RAND_MAX)
|
|
||||||
#define Clamp(x, min, max) x = (x<min ? min : x<max ? x : max);
|
|
||||||
|
|
||||||
#define SQUARE(x) (x)*(x)
|
|
||||||
|
|
||||||
|
|
||||||
struct Vector3D
|
struct Vector3D
|
||||||
{
|
{
|
||||||
Vector3D(float x, float y, float z) : x(x), y(y), z(z) {}
|
Vector3D(float x, float y, float z) : x(x), y(y), z(z) {}
|
||||||
@@ -63,7 +54,7 @@ struct Vector3D
|
|||||||
|
|
||||||
float Length()
|
float Length()
|
||||||
{
|
{
|
||||||
float length = (float)sqrt(SQUARE(x) + SQUARE(y) + SQUARE(z));
|
float length = sqrt(x*x + y*y + z*z);
|
||||||
return (length != 0.0f) ? length : 1.0f;
|
return (length != 0.0f) ? length : 1.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+14
-5
@@ -16,9 +16,9 @@ User folder is the only one that is really needed to guarantee both read and wri
|
|||||||
The content that users should not be touching.
|
The content that users should not be touching.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(ANDROID)
|
#ifndef PSP
|
||||||
#include "../../include/PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
#endif
|
#endif //PSP
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#pragma warning(disable : 4786)
|
#pragma warning(disable : 4786)
|
||||||
@@ -34,6 +34,10 @@ The content that users should not be touching.
|
|||||||
#include "../include/JLogger.h"
|
#include "../include/JLogger.h"
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
|
|
||||||
|
#ifdef QT_CONFIG
|
||||||
|
#include <QDir>
|
||||||
|
#endif
|
||||||
|
|
||||||
JFileSystem* JFileSystem::mInstance = NULL;
|
JFileSystem* JFileSystem::mInstance = NULL;
|
||||||
|
|
||||||
JZipCache::JZipCache()
|
JZipCache::JZipCache()
|
||||||
@@ -121,13 +125,18 @@ 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 dir(QDir::homePath());
|
|
||||||
dir.cd(USERDIR);
|
|
||||||
|
|
||||||
QDir sysDir("projects/mtg/bin/Res");
|
QDir sysDir("projects/mtg/bin/Res");
|
||||||
|
QDir dir(QDir::homePath());
|
||||||
|
dir.mkdir(USERDIR);
|
||||||
|
dir.cd(USERDIR);
|
||||||
|
|
||||||
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
|
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
|
||||||
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
|
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
|
||||||
|
|
||||||
|
DebugTrace("User path " << userPath);
|
||||||
|
DebugTrace("System path " << systemPath);
|
||||||
|
DebugTrace("Current path " << QDir::currentPath().toStdString());
|
||||||
#else
|
#else
|
||||||
//Find the Res.txt file and matching Res folders for backwards compatibility
|
//Find the Res.txt file and matching Res folders for backwards compatibility
|
||||||
ifstream mfile("Res.txt");
|
ifstream mfile("Res.txt");
|
||||||
|
|||||||
@@ -0,0 +1,508 @@
|
|||||||
|
//-------------------------------------------------------------------------------------
|
||||||
|
//
|
||||||
|
// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows.
|
||||||
|
#include "../../include/JGE.h"
|
||||||
|
#include "../../include/JRenderer.h"
|
||||||
|
#include "../../include/JResourceManager.h"
|
||||||
|
#include "../../include/JFileSystem.h"
|
||||||
|
#include "../../include/JAssert.h"
|
||||||
|
|
||||||
|
JQuad::JQuad(JTexture *tex, float x, float y, float width, float height)
|
||||||
|
:mTex(tex), mX(x), mY(y), mWidth(width), mHeight(height)
|
||||||
|
{
|
||||||
|
JASSERT(tex != NULL);
|
||||||
|
JRenderer::GetInstance()->TransferTextureToGLContext(*tex);
|
||||||
|
|
||||||
|
mHotSpotX = 0.0f;
|
||||||
|
mHotSpotY = 0.0f;
|
||||||
|
//mBlend = BLEND_DEFAULT;
|
||||||
|
for (int i=0;i<4;i++)
|
||||||
|
mColor[i].color = 0xFFFFFFFF;
|
||||||
|
|
||||||
|
mHFlipped = false;
|
||||||
|
mVFlipped = false;
|
||||||
|
|
||||||
|
SetTextureRect(x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
void JQuad::SetTextureRect(float x, float y, float w, float h)
|
||||||
|
{
|
||||||
|
mX = x;
|
||||||
|
mY = y;
|
||||||
|
mWidth = w;
|
||||||
|
mHeight = h;
|
||||||
|
|
||||||
|
if(mTex)
|
||||||
|
{
|
||||||
|
mTX0 = x/mTex->mTexWidth;
|
||||||
|
mTY0 = y/mTex->mTexHeight;
|
||||||
|
mTX1 = (x+w)/mTex->mTexWidth;
|
||||||
|
mTY1 = (y+h)/mTex->mTexHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JQuad::GetTextureRect(float *x, float *y, float *w, float *h)
|
||||||
|
{
|
||||||
|
*x=mX; *y=mY; *w=mWidth; *h=mHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JQuad::SetColor(PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
for (int i=0;i<4;i++)
|
||||||
|
mColor[i].color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void JQuad::SetHotSpot(float x, float y)
|
||||||
|
{
|
||||||
|
mHotSpotX = x;
|
||||||
|
mHotSpotY = y;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
JTexture::JTexture() : mBuffer(NULL)
|
||||||
|
{
|
||||||
|
mTexId = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
JTexture::~JTexture()
|
||||||
|
{
|
||||||
|
if (mBuffer)
|
||||||
|
{
|
||||||
|
delete [] mBuffer;
|
||||||
|
mBuffer = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits)
|
||||||
|
{
|
||||||
|
JRenderer::GetInstance()->BindTexture(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
//////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
JRenderer* JRenderer::mInstance = NULL;
|
||||||
|
bool JRenderer::m3DEnabled = false;
|
||||||
|
|
||||||
|
void JRenderer::Set3DFlag(bool flag) { m3DEnabled = flag; }
|
||||||
|
|
||||||
|
JRenderer* JRenderer::GetInstance()
|
||||||
|
{
|
||||||
|
if (mInstance == NULL)
|
||||||
|
{
|
||||||
|
mInstance = new JRenderer();
|
||||||
|
|
||||||
|
JASSERT(mInstance != NULL);
|
||||||
|
|
||||||
|
mInstance->InitRenderer();
|
||||||
|
}
|
||||||
|
|
||||||
|
return mInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::Destroy()
|
||||||
|
{
|
||||||
|
if (mInstance)
|
||||||
|
{
|
||||||
|
mInstance->DestroyRenderer();
|
||||||
|
delete mInstance;
|
||||||
|
mInstance = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
JRenderer::JRenderer() : mActualWidth(SCREEN_WIDTH_F), mActualHeight(SCREEN_HEIGHT_F)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
JRenderer::~JRenderer()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::InitRenderer()
|
||||||
|
{
|
||||||
|
mCurrentTextureFilter = TEX_FILTER_NONE;
|
||||||
|
mImageFilter = NULL;
|
||||||
|
|
||||||
|
mCurrTexBlendSrc = BLEND_SRC_ALPHA;
|
||||||
|
mCurrTexBlendDest = BLEND_ONE_MINUS_SRC_ALPHA;
|
||||||
|
|
||||||
|
// mLineWidth = 1.0f;
|
||||||
|
mCurrentTex = -1;
|
||||||
|
mFOV = 75.0f;
|
||||||
|
|
||||||
|
#ifdef USING_MATH_TABLE
|
||||||
|
for (int i=0;i<360;i++)
|
||||||
|
{
|
||||||
|
mSinTable[i] = sinf(i*DEG2RAD);
|
||||||
|
mCosTable[i] = cosf(i*DEG2RAD);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
mCurrentRenderMode = MODE_UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::DestroyRenderer()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::BeginScene()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::EndScene()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::BindTexture(JTexture *tex)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::EnableTextureFilter(bool flag)
|
||||||
|
{
|
||||||
|
if (flag)
|
||||||
|
mCurrentTextureFilter = TEX_FILTER_LINEAR;
|
||||||
|
else
|
||||||
|
mCurrentTextureFilter = TEX_FILTER_NEAREST;
|
||||||
|
|
||||||
|
mCurrentTex = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Swap(float *a, float *b)
|
||||||
|
{
|
||||||
|
float n=*a;
|
||||||
|
*a = *b;
|
||||||
|
*b = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::RenderQuad(JQuad* quad, float xo, float yo, float angle, float xScale, float yScale)
|
||||||
|
{
|
||||||
|
//yo = SCREEN_HEIGHT-yo-1;//-(quad->mHeight);
|
||||||
|
float width = quad->mWidth;
|
||||||
|
float height = quad->mHeight;
|
||||||
|
float x = -quad->mHotSpotX;
|
||||||
|
float y = quad->mHotSpotY;
|
||||||
|
|
||||||
|
Vector2D pt[4];
|
||||||
|
pt[3] = Vector2D(x, y);
|
||||||
|
pt[2] = Vector2D(x+width, y);
|
||||||
|
pt[1] = Vector2D(x+width, y-height);
|
||||||
|
pt[0] = Vector2D(x, y-height);
|
||||||
|
|
||||||
|
|
||||||
|
Vector2D uv[4];
|
||||||
|
uv[0] = Vector2D(quad->mTX0, quad->mTY1);
|
||||||
|
uv[1] = Vector2D(quad->mTX1, quad->mTY1);
|
||||||
|
uv[2] = Vector2D(quad->mTX1, quad->mTY0);
|
||||||
|
uv[3] = Vector2D(quad->mTX0, quad->mTY0);
|
||||||
|
|
||||||
|
if (quad->mHFlipped)
|
||||||
|
{
|
||||||
|
Swap(&uv[0].x, &uv[1].x);
|
||||||
|
Swap(&uv[2].x, &uv[3].x);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (quad->mVFlipped)
|
||||||
|
{
|
||||||
|
Swap(&uv[0].y, &uv[2].y);
|
||||||
|
Swap(&uv[1].y, &uv[3].y);
|
||||||
|
}
|
||||||
|
|
||||||
|
BindTexture(quad->mTex);
|
||||||
|
|
||||||
|
yo = SCREEN_HEIGHT_F - yo;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::RenderQuad(JQuad* quad, VertexColor* pt)
|
||||||
|
{
|
||||||
|
for (int i=0;i<4;i++)
|
||||||
|
{
|
||||||
|
pt[i].y = SCREEN_HEIGHT_F - pt[i].y;
|
||||||
|
quad->mColor[i].color = pt[i].color;
|
||||||
|
}
|
||||||
|
|
||||||
|
Vector2D uv[4];
|
||||||
|
uv[0] = Vector2D(quad->mTX0, quad->mTY1);
|
||||||
|
uv[1] = Vector2D(quad->mTX1, quad->mTY1);
|
||||||
|
uv[2] = Vector2D(quad->mTX1, quad->mTY0);
|
||||||
|
uv[3] = Vector2D(quad->mTX0, quad->mTY0);
|
||||||
|
|
||||||
|
BindTexture(quad->mTex);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
y = SCREEN_HEIGHT_F - y - height;
|
||||||
|
|
||||||
|
JColor col;
|
||||||
|
col.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
y = SCREEN_HEIGHT_F - y - height;
|
||||||
|
|
||||||
|
JColor col;
|
||||||
|
col.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE* colors)
|
||||||
|
{
|
||||||
|
JColor col[4];
|
||||||
|
for (int i=0;i<4;i++)
|
||||||
|
col[i].color = colors[i];
|
||||||
|
|
||||||
|
FillRect(x, y, width, height, col);
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::FillRect(float x, float y, float width, float height, JColor* colors)
|
||||||
|
{
|
||||||
|
y = SCREEN_HEIGHT_F - y - height;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
// glLineWidth (mLineWidth);
|
||||||
|
JColor col;
|
||||||
|
col.color = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::Plot(float x, float y, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::ScreenShot(const char* filename __attribute__((unused)))
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::TransferTextureToGLContext(JTexture& inTexture)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
JTexture* JRenderer::CreateTexture(int width, int height, int mode __attribute__((unused)))
|
||||||
|
{
|
||||||
|
JTexture *tex = new JTexture();
|
||||||
|
|
||||||
|
return tex;
|
||||||
|
}
|
||||||
|
|
||||||
|
JTexture* JRenderer::LoadTexture(const char* filename, int mode, int textureFormat)
|
||||||
|
{
|
||||||
|
JTexture *tex = new JTexture();
|
||||||
|
|
||||||
|
return tex;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::EnableVSync(bool flag __attribute__((unused)))
|
||||||
|
{
|
||||||
|
// if (flag)
|
||||||
|
// hge->System_SetState(HGE_FPS, 60); // HGEFPS_VSYNC
|
||||||
|
// else
|
||||||
|
// hge->System_SetState(HGE_FPS, HGEFPS_UNLIMITED);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::ClearScreen(PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::SetTexBlend(int src, int dest)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::SetTexBlendSrc(int src)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::SetTexBlendDest(int dest)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::Enable2D()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::Enable3D()
|
||||||
|
{ /* NOT USED
|
||||||
|
if (!m3DEnabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (mCurrentRenderMode == MODE_3D)
|
||||||
|
return;
|
||||||
|
|
||||||
|
mCurrentRenderMode = MODE_3D;
|
||||||
|
|
||||||
|
glViewport (0, 0, (GLsizei)SCREEN_WIDTH, (GLsizei)SCREEN_HEIGHT); // Reset The Current Viewport
|
||||||
|
glMatrixMode (GL_PROJECTION); // Select The Projection Matrix
|
||||||
|
glLoadIdentity (); // Reset The Projection Matrix
|
||||||
|
gluPerspective (mFOV, (GLfloat)SCREEN_WIDTH/(GLfloat)SCREEN_HEIGHT, // Calculate The Aspect Ratio Of The Window
|
||||||
|
0.5f, 1000.0f);
|
||||||
|
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
|
||||||
|
glLoadIdentity (); // Reset The Modelview Matrix
|
||||||
|
|
||||||
|
glEnable (GL_DEPTH_TEST); */
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::SetClip(int, int, int, int)
|
||||||
|
{// NOT USED
|
||||||
|
//glScissor(x, y, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::LoadIdentity()
|
||||||
|
{// NOT USED
|
||||||
|
//glLoadIdentity();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::Translate(float, float, float)
|
||||||
|
{// NOT USED
|
||||||
|
//glTranslatef(x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::RotateX(float)
|
||||||
|
{// NOT USED
|
||||||
|
//glRotatef(angle*RAD2DEG, 1.0f, 0.0f, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::RotateY(float)
|
||||||
|
{// NOT USED
|
||||||
|
//glRotatef(angle*RAD2DEG, 0.0f, 1.0f, 0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::RotateZ(float)
|
||||||
|
{// NOT USED
|
||||||
|
//glRotatef(angle*RAD2DEG, 0.0f, 0.0f, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::PushMatrix()
|
||||||
|
{// NOT USED
|
||||||
|
//glPushMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::PopMatrix()
|
||||||
|
{// NOT USED
|
||||||
|
//glPopMatrix();
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::RenderTriangles(JTexture* texture, Vertex3D *vertices, int start, int count)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::SetFOV(float fov)
|
||||||
|
{
|
||||||
|
mFOV = fov;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::DrawLine(float x1, float y1, float x2, float y2, float lineWidth, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
float dy=y2-y1;
|
||||||
|
float dx=x2-x1;
|
||||||
|
if(dy==0 && dx==0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
float l=(float)hypot(dx,dy);
|
||||||
|
|
||||||
|
float x[4];
|
||||||
|
float y[4];
|
||||||
|
|
||||||
|
x[0]=x1+lineWidth*(y2-y1)/l;
|
||||||
|
y[0]=y1-lineWidth*(x2-x1)/l;
|
||||||
|
|
||||||
|
x[1]=x1-lineWidth*(y2-y1)/l;
|
||||||
|
y[1]=y1+lineWidth*(x2-x1)/l;
|
||||||
|
|
||||||
|
x[2]=x2-lineWidth*(y2-y1)/l;
|
||||||
|
y[2]=y2+lineWidth*(x2-x1)/l;
|
||||||
|
|
||||||
|
x[3]=x2+lineWidth*(y2-y1)/l;
|
||||||
|
y[3]=y2-lineWidth*(x2-x1)/l;
|
||||||
|
|
||||||
|
FillPolygon(x, y, 4, color);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::DrawCircle(float x, float y, float radius, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void JRenderer::FillCircle(float x, float y, float radius, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::DrawPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::FillPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::SetImageFilter(JImageFilter* imageFilter)
|
||||||
|
{
|
||||||
|
mImageFilter = imageFilter;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
#include "../include/OutputCapturer.h"
|
||||||
|
|
||||||
|
std::ostringstream OutputCapturer::stream;
|
||||||
|
boost::mutex OutputCapturer::mMutex;
|
||||||
|
|
||||||
|
void OutputCapturer::add(const std::string& s)
|
||||||
|
{
|
||||||
|
boost::mutex::scoped_lock lock(mMutex);
|
||||||
|
stream << s << "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
void OutputCapturer::debugAndClear()
|
||||||
|
{
|
||||||
|
stream.flush();
|
||||||
|
qDebug("%s", stream.str().c_str());
|
||||||
|
stream.str("");
|
||||||
|
}
|
||||||
|
|
||||||
|
void OutputCapturer::clear()
|
||||||
|
{
|
||||||
|
stream.str("");
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
#include "../include/JGE.h"
|
||||||
|
#include "../include/JTypes.h"
|
||||||
|
#include "../include/JApp.h"
|
||||||
|
#include "../include/JFileSystem.h"
|
||||||
|
#include "../include/JRenderer.h"
|
||||||
|
#include "../include/JGameLauncher.h"
|
||||||
|
|
||||||
|
#include "TestSuiteAI.h"
|
||||||
|
#include "GameOptions.h"
|
||||||
|
#include "MTGDeck.h"
|
||||||
|
#include "DebugRoutines.h"
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QElapsedTimer>
|
||||||
|
|
||||||
|
class WagicWrapper
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
WagicWrapper();
|
||||||
|
virtual ~WagicWrapper();
|
||||||
|
|
||||||
|
public:
|
||||||
|
// used mainly to mesure the delta between 2 updates
|
||||||
|
static QElapsedTimer g_startTimer;
|
||||||
|
|
||||||
|
private:
|
||||||
|
JGE* m_engine;
|
||||||
|
JApp* m_app;
|
||||||
|
JGameLauncher* m_launcher;
|
||||||
|
};
|
||||||
|
|
||||||
|
QElapsedTimer WagicWrapper::g_startTimer;
|
||||||
|
|
||||||
|
int JGEGetTime()
|
||||||
|
{
|
||||||
|
return (int)WagicWrapper::g_startTimer.elapsed();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool JGEToggleFullscreen()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
void JGECreateDefaultBindings()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
WagicWrapper::WagicWrapper()
|
||||||
|
{
|
||||||
|
m_launcher = new JGameLauncher();
|
||||||
|
u32 flags = m_launcher->GetInitFlags();
|
||||||
|
if ((flags&JINIT_FLAG_ENABLE3D)!=0)
|
||||||
|
{
|
||||||
|
JRenderer::Set3DFlag(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
JGECreateDefaultBindings();
|
||||||
|
|
||||||
|
m_engine = JGE::GetInstance();
|
||||||
|
m_app = m_launcher->GetGameApp();
|
||||||
|
m_app->Create();
|
||||||
|
m_engine->SetApp(m_app);
|
||||||
|
JRenderer::GetInstance()->Enable2D();
|
||||||
|
g_startTimer.restart();
|
||||||
|
}
|
||||||
|
|
||||||
|
WagicWrapper::~WagicWrapper()
|
||||||
|
{
|
||||||
|
if(m_launcher)
|
||||||
|
{
|
||||||
|
delete m_launcher;
|
||||||
|
m_launcher = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(m_engine)
|
||||||
|
m_engine->SetApp(NULL);
|
||||||
|
|
||||||
|
if (m_app)
|
||||||
|
{
|
||||||
|
m_app->Destroy();
|
||||||
|
delete m_app;
|
||||||
|
m_app = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
JGE::Destroy();
|
||||||
|
m_engine = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
QCoreApplication a(argc, argv);
|
||||||
|
|
||||||
|
int result = 0;
|
||||||
|
WagicWrapper* wagicCore = new WagicWrapper();
|
||||||
|
MTGCollection()->loadFolder("sets/primitives/");
|
||||||
|
MTGCollection()->loadFolder("sets/", "_cards.dat");
|
||||||
|
options.reloadProfile();
|
||||||
|
TestSuite testSuite("test/_tests.txt");
|
||||||
|
result = testSuite.run();
|
||||||
|
int totalTests = testSuite.nbTests + testSuite.nbAITests;
|
||||||
|
delete wagicCore;
|
||||||
|
DebugTrace("TestSuite done: failed test: " << result << " out of " << totalTests << " total");
|
||||||
|
#ifdef CAPTURE_STDERR
|
||||||
|
OutputCapturer::debugAndClear();
|
||||||
|
#endif
|
||||||
|
return result;
|
||||||
|
}
|
||||||
+18
-4
@@ -166,11 +166,12 @@ void DestroyGame(void)
|
|||||||
[menuKeyRecognizer requireGestureRecognizerToFail: selectKeyRecognizer];
|
[menuKeyRecognizer requireGestureRecognizerToFail: selectKeyRecognizer];
|
||||||
[self addGestureRecognizer:menuKeyRecognizer];
|
[self addGestureRecognizer:menuKeyRecognizer];
|
||||||
|
|
||||||
/*
|
// initialize the scaling factor
|
||||||
|
lastScale = 1.f;
|
||||||
UIPinchGestureRecognizer *pinchZoomRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchZoom:)];
|
UIPinchGestureRecognizer *pinchZoomRecognizer = [[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(handlePinchZoom:)];
|
||||||
[self addGestureRecognizer:pinchZoomRecognizer];
|
[self addGestureRecognizer:pinchZoomRecognizer];
|
||||||
[pinchZoomRecognizer release];
|
[pinchZoomRecognizer release];
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Create a single tap recognizer to select the nearest object.
|
Create a single tap recognizer to select the nearest object.
|
||||||
@@ -391,8 +392,6 @@ void DestroyGame(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
|
- (BOOL) gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
|
||||||
{
|
{
|
||||||
return YES;
|
return YES;
|
||||||
@@ -425,6 +424,21 @@ void DestroyGame(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#pragma mark Gesture Recognizer callbacks
|
#pragma mark Gesture Recognizer callbacks
|
||||||
|
- (void)handlePinchZoom: (UIPinchGestureRecognizer *) pinchGesture {
|
||||||
|
[[[pinchGesture view] layer] removeAllAnimations];
|
||||||
|
CGFloat currentScaleFactor = [pinchGesture scale];
|
||||||
|
|
||||||
|
if (pinchGesture.state == UIGestureRecognizerStateEnded) {
|
||||||
|
if (lastScale < 1.3f) {
|
||||||
|
lastScale *= currentScaleFactor;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
lastScale = 1;
|
||||||
|
[self displayGameMenu];
|
||||||
|
}
|
||||||
|
pinchGesture.scale = 1.f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void)handlePanMotion: (UIPanGestureRecognizer *) panGesture
|
- (void)handlePanMotion: (UIPanGestureRecognizer *) panGesture
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -47,7 +47,6 @@
|
|||||||
|
|
||||||
- (void)viewDidLoad {
|
- (void)viewDidLoad {
|
||||||
NSLog(@"EAGL ViewController - view Did Load");
|
NSLog(@"EAGL ViewController - view Did Load");
|
||||||
|
|
||||||
[super viewDidLoad];
|
[super viewDidLoad];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -56,7 +55,6 @@
|
|||||||
[self.view resumeGame];
|
[self.view resumeGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
- (void)viewWillDisappear:(BOOL)animated
|
- (void)viewWillDisappear:(BOOL)animated
|
||||||
{
|
{
|
||||||
[self.view pauseGame];
|
[self.view pauseGame];
|
||||||
@@ -77,6 +75,10 @@
|
|||||||
[self.view endGame];
|
[self.view endGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIStatusBarStyle)preferredStatusBarStyle {
|
||||||
|
return UIStatusBarStyleLightContent;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)viewDidAppear:(BOOL)animated {
|
- (void)viewDidAppear:(BOOL)animated {
|
||||||
|
|
||||||
NSLog(@"EAGL ViewController - view Did Appear");
|
NSLog(@"EAGL ViewController - view Did Appear");
|
||||||
|
|||||||
@@ -7,6 +7,7 @@
|
|||||||
#include "JFileSystem.h"
|
#include "JFileSystem.h"
|
||||||
#include "JRenderer.h"
|
#include "JRenderer.h"
|
||||||
#include "JGameLauncher.h"
|
#include "JGameLauncher.h"
|
||||||
|
#include "UIScreen+Util.h"
|
||||||
|
|
||||||
#define ACTUAL_SCREEN_WIDTH (SCREEN_WIDTH)
|
#define ACTUAL_SCREEN_WIDTH (SCREEN_WIDTH)
|
||||||
#define ACTUAL_SCREEN_HEIGHT (SCREEN_HEIGHT)
|
#define ACTUAL_SCREEN_HEIGHT (SCREEN_HEIGHT)
|
||||||
@@ -61,7 +62,7 @@ bool checkFramebufferStatus();
|
|||||||
// for retina devices. because of the 568 px, the ratio between height-width skews the
|
// for retina devices. because of the 568 px, the ratio between height-width skews the
|
||||||
// frame a bit
|
// frame a bit
|
||||||
|
|
||||||
if ( backingHeight == 568 || backingWidth == 568) {
|
if ( [UIScreen isRetinaDisplay]) {
|
||||||
viewPort.left = 0;
|
viewPort.left = 0;
|
||||||
viewPort.top = -((backingWidth/ACTUAL_RATIO)-backingHeight)/2 + 22; // account for status bar
|
viewPort.top = -((backingWidth/ACTUAL_RATIO)-backingHeight)/2 + 22; // account for status bar
|
||||||
viewPort.right = backingWidth;
|
viewPort.right = backingWidth;
|
||||||
|
|||||||
+1
-1
@@ -823,7 +823,7 @@ void JRenderer::BeginScene()
|
|||||||
esMatrixLoadIdentity(&theMvpMatrix);
|
esMatrixLoadIdentity(&theMvpMatrix);
|
||||||
esOrtho(&theMvpMatrix, 0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f,-1.0f, 1.0f);
|
esOrtho(&theMvpMatrix, 0.0f, SCREEN_WIDTH_F, 0.0f, SCREEN_HEIGHT_F-1.0f,-1.0f, 1.0f);
|
||||||
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||||
#if (defined WIN32) || ((defined GL_VERSION_ES_CM_1_1) && (!defined IOS))
|
#if (defined WIN32 && !defined GL_ES_VERSION_2_0) || ((defined GL_VERSION_ES_CM_1_1) && (!defined IOS))
|
||||||
float scaleH = mActualHeight/SCREEN_HEIGHT_F;
|
float scaleH = mActualHeight/SCREEN_HEIGHT_F;
|
||||||
float scaleW = mActualWidth/SCREEN_WIDTH_F;
|
float scaleW = mActualWidth/SCREEN_WIDTH_F;
|
||||||
if (scaleH != 1.0f || scaleW != 1.0f)
|
if (scaleH != 1.0f || scaleW != 1.0f)
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
/gen
|
/gen
|
||||||
|
/bin
|
||||||
|
|
||||||
|
|||||||
@@ -14,5 +14,5 @@
|
|||||||
|
|
||||||
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:name="com.google.ads.AdActivity" android:screenOrientation="sensorLandscape"/>
|
<activity android:configChanges="keyboard|keyboardHidden|orientation" android:name="com.google.ads.AdActivity" android:screenOrientation="sensorLandscape"/>
|
||||||
</application>
|
</application>
|
||||||
<uses-sdk android:minSdkVersion="9" android:targetSdkVersion="9"/>
|
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -1,10 +0,0 @@
|
|||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/gen/net/wagic/app/R.java \
|
|
||||||
: /Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-hdpi/icon.png \
|
|
||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-ldpi/icon.png \
|
|
||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-mdpi/icon.png \
|
|
||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/layout/main.xml \
|
|
||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/values/strings.xml \
|
|
||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-hdpi/icon.png \
|
|
||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-ldpi/icon.png \
|
|
||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-mdpi/icon.png \
|
|
||||||
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/AndroidManifest.xml \
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
/** Automatically generated file. DO NOT MODIFY */
|
|
||||||
package net.wagic.app;
|
|
||||||
|
|
||||||
public final class BuildConfig {
|
|
||||||
public final static boolean DEBUG = true;
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
/* AUTO-GENERATED FILE. DO NOT MODIFY.
|
|
||||||
*
|
|
||||||
* This class was automatically generated by the
|
|
||||||
* aapt tool from the resource data it found. It
|
|
||||||
* should not be modified by hand.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package net.wagic.app;
|
|
||||||
|
|
||||||
public final class R {
|
|
||||||
public static final class attr {
|
|
||||||
}
|
|
||||||
public static final class drawable {
|
|
||||||
public static final int icon=0x7f020000;
|
|
||||||
}
|
|
||||||
public static final class id {
|
|
||||||
public static final int mainLayout=0x7f050000;
|
|
||||||
}
|
|
||||||
public static final class layout {
|
|
||||||
public static final int main=0x7f030000;
|
|
||||||
}
|
|
||||||
public static final class string {
|
|
||||||
public static final int app_name=0x7f040000;
|
|
||||||
public static final int app_version=0x7f040001;
|
|
||||||
public static final int info_text=0x7f040002;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -41,7 +41,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \
|
|||||||
$(MTG_PATH)/src/AllAbilities.cpp \
|
$(MTG_PATH)/src/AllAbilities.cpp \
|
||||||
$(MTG_PATH)/src/CardDescriptor.cpp \
|
$(MTG_PATH)/src/CardDescriptor.cpp \
|
||||||
$(MTG_PATH)/src/CardDisplay.cpp \
|
$(MTG_PATH)/src/CardDisplay.cpp \
|
||||||
$(MTG_PATH)/src/CardEffect.cpp \
|
|
||||||
$(MTG_PATH)/src/CardGui.cpp \
|
$(MTG_PATH)/src/CardGui.cpp \
|
||||||
$(MTG_PATH)/src/CardPrimitive.cpp \
|
$(MTG_PATH)/src/CardPrimitive.cpp \
|
||||||
$(MTG_PATH)/src/CardSelector.cpp \
|
$(MTG_PATH)/src/CardSelector.cpp \
|
||||||
|
|||||||
Binary file not shown.
@@ -54,10 +54,6 @@ import android.view.View.OnKeyListener;
|
|||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.FrameLayout.LayoutParams;
|
import android.widget.FrameLayout.LayoutParams;
|
||||||
|
|
||||||
import com.google.ads.AdRequest;
|
|
||||||
import com.google.ads.AdSize;
|
|
||||||
import com.google.ads.AdView;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* SDL Activity
|
* SDL Activity
|
||||||
*/
|
*/
|
||||||
@@ -68,7 +64,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
public static String TAG = Activity.class.getCanonicalName();
|
public static String TAG = Activity.class.getCanonicalName();
|
||||||
|
|
||||||
// Main components
|
// Main components
|
||||||
private static AdView mAdView;
|
|
||||||
private static SDLActivity mSingleton;
|
private static SDLActivity mSingleton;
|
||||||
private static SDLSurface mSurface;
|
private static SDLSurface mSurface;
|
||||||
|
|
||||||
@@ -422,25 +417,12 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
SurfaceHolder holder = mSurface.getHolder();
|
SurfaceHolder holder = mSurface.getHolder();
|
||||||
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
|
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
|
||||||
|
|
||||||
// Create the adView
|
|
||||||
mAdView = new AdView(this, AdSize.BANNER, "a14e9009f88864f"); // "a14dc0ab7b27413" <-- for the alpha);
|
|
||||||
|
|
||||||
_videoLayout.addView(mSurface, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
|
_videoLayout.addView(mSurface, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
|
||||||
_videoLayout.addView(mAdView, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL));
|
|
||||||
// mGLView.setFocusableInTouchMode(true);
|
// mGLView.setFocusableInTouchMode(true);
|
||||||
// mGLView.setFocusable(true);
|
// mGLView.setFocusable(true);
|
||||||
// adView.requestFreshAd();
|
// adView.requestFreshAd();
|
||||||
setContentView(_videoLayout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
|
setContentView(_videoLayout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
|
||||||
mSurface.requestFocus();
|
mSurface.requestFocus();
|
||||||
|
|
||||||
AdRequest request = new AdRequest();
|
|
||||||
|
|
||||||
request.addTestDevice(AdRequest.TEST_EMULATOR);
|
|
||||||
request.addTestDevice("1DA1E070BC7D4ABE8BA77EB73C2CB0AA"); // wololo's phone
|
|
||||||
request.addTestDevice("C386F3830A9789C649098A817BF54C04"); // xawotihs's tablet
|
|
||||||
|
|
||||||
// Initiate a generic request to load it with an ad
|
|
||||||
mAdView.loadAd(request);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup
|
// Setup
|
||||||
@@ -512,14 +494,6 @@ public class SDLActivity extends Activity implements OnKeyListener
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((command.compareTo("entergamestate:menu") == 0) || (command.compareTo("enterduelphase:end") == 0))
|
|
||||||
{
|
|
||||||
mAdView.setVisibility(View.VISIBLE);
|
|
||||||
} else if (command.compareTo("leavegamestate:menu") == 0)
|
|
||||||
{
|
|
||||||
mAdView.setVisibility(View.INVISIBLE);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Messages from the SDLMain thread
|
// Messages from the SDLMain thread
|
||||||
|
|||||||
+30
-1
@@ -1,4 +1,33 @@
|
|||||||
OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o objs/ActionLayer.o objs/ActionStack.o objs/AIHints.o objs/AIMomirPlayer.o objs/AIPlayer.o objs/AIPlayerBaka.o objs/AIStats.o objs/AllAbilities.o objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o objs/CardEffect.o objs/CardPrimitive.o objs/CardSelector.o objs/CardSelectorSingleton.o objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o objs/GameObserver.o objs/GameOptions.o objs/GameState.o objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o objs/GameStateShop.o objs/GameStateStory.o objs/GameStateTransitions.o objs/GuiAvatars.o objs/GuiBackground.o objs/GuiCardsController.o objs/GuiCombat.o objs/GuiFrame.o objs/GuiHand.o objs/GuiLayers.o objs/GuiMana.o objs/GuiPhaseBar.o objs/GuiPlay.o objs/GuiStatic.o objs/IconButton.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o objs/ModRules.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o objs/MTGPack.o objs/MTGRules.o objs/Navigator.o objs/ObjectAnalytics.o objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/PlayRestrictions.o objs/Pos.o objs/PrecompiledHeader.o objs/PriceList.o objs/ReplacementEffects.o objs/Rules.o objs/SimpleMenu.o objs/SimpleButton.o objs/SimpleMenuItem.o objs/SimplePad.o objs/SimplePopup.o objs/StoryFlow.o objs/StyleManager.o objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TextScroller.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/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o objs/WFont.o
|
OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\
|
||||||
|
objs/ActionLayer.o objs/ActionStack.o objs/AIHints.o objs/AIMomirPlayer.o\
|
||||||
|
objs/AIPlayer.o objs/AIPlayerBaka.o objs/AIStats.o objs/AllAbilities.o\
|
||||||
|
objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o\
|
||||||
|
objs/CardPrimitive.o objs/CardSelector.o objs/CardSelectorSingleton.o\
|
||||||
|
objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\
|
||||||
|
objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\
|
||||||
|
objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\
|
||||||
|
objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\
|
||||||
|
objs/GameObserver.o objs/GameOptions.o objs/GameState.o\
|
||||||
|
objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
|
||||||
|
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
|
||||||
|
objs/GameStateShop.o objs/GameStateStory.o objs/GameStateTransitions.o\
|
||||||
|
objs/GuiAvatars.o objs/GuiBackground.o objs/GuiCardsController.o\
|
||||||
|
objs/GuiCombat.o objs/GuiFrame.o objs/GuiHand.o objs/GuiLayers.o\
|
||||||
|
objs/GuiMana.o objs/GuiPhaseBar.o objs/GuiPlay.o objs/GuiStatic.o\
|
||||||
|
objs/IconButton.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o\
|
||||||
|
objs/ModRules.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o\
|
||||||
|
objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o\
|
||||||
|
objs/MTGPack.o objs/MTGRules.o objs/Navigator.o objs/ObjectAnalytics.o\
|
||||||
|
objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o\
|
||||||
|
objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/PlayRestrictions.o\
|
||||||
|
objs/Pos.o objs/PrecompiledHeader.o objs/PriceList.o objs/ReplacementEffects.o\
|
||||||
|
objs/Rules.o objs/SimpleMenu.o objs/SimpleButton.o objs/SimpleMenuItem.o\
|
||||||
|
objs/SimplePad.o objs/SimplePopup.o objs/StoryFlow.o objs/StyleManager.o\
|
||||||
|
objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TextScroller.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/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o\
|
||||||
|
objs/WFont.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)
|
||||||
|
|||||||
@@ -0,0 +1,106 @@
|
|||||||
|
[meta]
|
||||||
|
author=Wagic Team
|
||||||
|
name=From the Vault: Twenty
|
||||||
|
block=Vault
|
||||||
|
year=2013
|
||||||
|
[/meta]
|
||||||
|
[card]
|
||||||
|
primitive=Akroma's Vengeance
|
||||||
|
id=373328
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Chainer's Edict
|
||||||
|
id=373317
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Chameleon Colossus
|
||||||
|
id=373321
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Char
|
||||||
|
id=373332
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Cruel Ultimatum
|
||||||
|
id=373318
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Dark Ritual
|
||||||
|
id=373329
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fact or Fiction
|
||||||
|
id=373325
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Fyndhorn Elves
|
||||||
|
id=373320
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Gilded Lotus
|
||||||
|
id=373335
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Green Sun's Zenith
|
||||||
|
id=373333
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Hymn to Tourach
|
||||||
|
id=373324
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Impulse
|
||||||
|
id=373330
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Ink-Eyes, Servant of Oni
|
||||||
|
id=373327
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Jace, the Mind Sculptor
|
||||||
|
id=373316
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Kessig Wolf Run
|
||||||
|
id=373323
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Swords to Plowshares
|
||||||
|
id=373334
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Tangle Wire
|
||||||
|
id=373322
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Thran Dynamo
|
||||||
|
id=373331
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Venser, Shaper Savant
|
||||||
|
id=373326
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
|
primitive=Wall of Blossoms
|
||||||
|
id=373319
|
||||||
|
rarity=M
|
||||||
|
[/card]
|
||||||
@@ -17432,7 +17432,7 @@ toughness=4
|
|||||||
[card]
|
[card]
|
||||||
name=Cranial Plating
|
name=Cranial Plating
|
||||||
auto=foreach(artifact|mybattlefield) 1/0
|
auto=foreach(artifact|mybattlefield) 1/0
|
||||||
auto={B}{B}:attach
|
auto={B}{B}:name(attach) retarget target(creature|mybattlefield)
|
||||||
auto={1}:equip
|
auto={1}:equip
|
||||||
text=Equipped creature gets +1/+0 for each artifact you control. -- {B}{B}: Attach Cranial Plating to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
text=Equipped creature gets +1/+0 for each artifact you control. -- {B}{B}: Attach Cranial Plating to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
||||||
mana={2}
|
mana={2}
|
||||||
@@ -23286,7 +23286,7 @@ type=Sorcery
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
name=Dragon Hatchling
|
name=Dragon Hatchling
|
||||||
auto={1}{R}:1/0
|
auto={R}:1/0
|
||||||
abilities=flying
|
abilities=flying
|
||||||
text=Flying -- {R}: Dragon Hatchling gets +1/+0 until end of turn.
|
text=Flying -- {R}: Dragon Hatchling gets +1/+0 until end of turn.
|
||||||
mana={1}{R}
|
mana={1}{R}
|
||||||
@@ -39826,7 +39826,7 @@ name=Healer's Headdress
|
|||||||
auto={1}:equip
|
auto={1}:equip
|
||||||
auto=0/2
|
auto=0/2
|
||||||
auto=teach(creature) {T}:prevent:1 target(creature,player)
|
auto=teach(creature) {T}:prevent:1 target(creature,player)
|
||||||
auto={W}{W}:attach
|
auto={W}{W}:name(attach) retarget target(creature|mybattlefield)
|
||||||
text=Equipped creature gets +0/+2 and has "{T}: Prevent the next 1 damage that would be dealt to target creature or player this turn." -- {W}{W}: Attach Healer's Headdress to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
text=Equipped creature gets +0/+2 and has "{T}: Prevent the next 1 damage that would be dealt to target creature or player this turn." -- {W}{W}: Attach Healer's Headdress to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
||||||
mana={2}
|
mana={2}
|
||||||
type=Artifact
|
type=Artifact
|
||||||
@@ -41596,7 +41596,7 @@ toughness=2
|
|||||||
name=Horned Helm
|
name=Horned Helm
|
||||||
auto=1/1
|
auto=1/1
|
||||||
auto=trample
|
auto=trample
|
||||||
auto={G}{G}:attach
|
auto={G}{G}:name(attach) retarget target(creature|mybattlefield)
|
||||||
auto={1}:equip
|
auto={1}:equip
|
||||||
text=Equipped creature gets +1/+1 and has trample. -- {G}{G}: Attach Horned Helm to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
text=Equipped creature gets +1/+1 and has trample. -- {G}{G}: Attach Horned Helm to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
||||||
mana={2}
|
mana={2}
|
||||||
@@ -54155,6 +54155,18 @@ power=2
|
|||||||
toughness=2
|
toughness=2
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
name=Master of Waves
|
||||||
|
abilities=protection from red
|
||||||
|
auto=lord(Elemental|mybattlefield) 1/1
|
||||||
|
auto=token(Elemental,Creature Elemental,1/0)*type:manaU
|
||||||
|
text=Protection from red. -- Elemental creatures you control get +1/+1. -- When Master of Waves enters the battlefield, put a number of 1/0 blue Elemental creature tokens onto the battlefield equal to your devotion to blue. (Each {U} in the mana costs of permanents you control counts toward your devotion to blue.)
|
||||||
|
mana={3}{U}
|
||||||
|
type=Creature
|
||||||
|
subtype=Merfolk Wizard
|
||||||
|
power=2
|
||||||
|
toughness=1
|
||||||
|
[/card]
|
||||||
|
[card]
|
||||||
name=Master Splicer
|
name=Master Splicer
|
||||||
auto=token(Golem,Artifact Creature Golem,3/3)
|
auto=token(Golem,Artifact Creature Golem,3/3)
|
||||||
auto=lord(golem|mybattlefield) 1/1
|
auto=lord(golem|mybattlefield) 1/1
|
||||||
@@ -59971,7 +59983,7 @@ toughness=2
|
|||||||
[card]
|
[card]
|
||||||
name=Neurok Stealthsuit
|
name=Neurok Stealthsuit
|
||||||
auto=teach(creature) shroud
|
auto=teach(creature) shroud
|
||||||
auto={U}{U}:attach
|
auto={U}{U}:name(attach) retarget target(creature|mybattlefield)
|
||||||
auto={1}:equip
|
auto={1}:equip
|
||||||
text=Equipped creature has shroud. (It can't be the target of spells or abilities.) -- {U}{U}: Attach Neurok Stealthsuit to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
text=Equipped creature has shroud. (It can't be the target of spells or abilities.) -- {U}{U}: Attach Neurok Stealthsuit to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
||||||
mana={2}
|
mana={2}
|
||||||
@@ -83425,7 +83437,7 @@ toughness=3
|
|||||||
[card]
|
[card]
|
||||||
name=Sparring Collar
|
name=Sparring Collar
|
||||||
auto=first strike
|
auto=first strike
|
||||||
auto={R}{R}:attach
|
auto={R}{R}:name(attach) retarget target(creature|mybattlefield)
|
||||||
auto={1}:equip
|
auto={1}:equip
|
||||||
text=Equipped creature has first strike. -- {R}{R}: Attach Sparring Collar to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
text=Equipped creature has first strike. -- {R}{R}: Attach Sparring Collar to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
||||||
mana={2}
|
mana={2}
|
||||||
@@ -83704,7 +83716,7 @@ type=Instant
|
|||||||
[card]
|
[card]
|
||||||
name=Spell Rupture
|
name=Spell Rupture
|
||||||
target=*|stack
|
target=*|stack
|
||||||
auto=if cantargetcard(*|opponentstack) then transforms((,newability[pay[[{value:power:highest:creature:opponentbattlefield}]] name(pay {value} mana) donothing?fizzle])) forever else transforms((,newability[pay[[{value:power:highest:creature:mybattlefield.}]] name(pay {value} mana) donothing?fizzle])) forever
|
auto=if cantargetcard(*|opponentstack) then transforms((,newability[pay[[{value:power:highest:creature:opponentbattlefield}]] name(pay {value} mana) donothing?fizzle])) forever else transforms((,newability[pay[[{value:power:highest:creature:mybattlefield}]] name(pay {value} mana) donothing?fizzle])) forever
|
||||||
text=Counter target spell unless its controller pays {X}, where X is the greatest power among creatures you control.
|
text=Counter target spell unless its controller pays {X}, where X is the greatest power among creatures you control.
|
||||||
mana={1}{U}
|
mana={1}{U}
|
||||||
type=Instant
|
type=Instant
|
||||||
@@ -88480,7 +88492,7 @@ toughness=3
|
|||||||
[card]
|
[card]
|
||||||
name=Syncopate
|
name=Syncopate
|
||||||
target=*|stack
|
target=*|stack
|
||||||
auto=transforms((,newability[pay[[{x}]] name(pay {value} mana) donothing?fizzleto(exile)])) forever
|
auto=transforms((,newability[pay[[{value:storedx}]] name(pay {value} mana) donothing?fizzleto(exile)])) forever
|
||||||
text=Counter target spell unless its controller pays {X}. If that spell is countered this way, exile it instead of putting it into its owner's graveyard.
|
text=Counter target spell unless its controller pays {X}. If that spell is countered this way, exile it instead of putting it into its owner's graveyard.
|
||||||
mana={X}{U}
|
mana={X}{U}
|
||||||
type=Instant
|
type=Instant
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ colossus_of_sardia1.txt
|
|||||||
colossus_of_sardia2.txt
|
colossus_of_sardia2.txt
|
||||||
composite_golem.txt
|
composite_golem.txt
|
||||||
conservator.txt
|
conservator.txt
|
||||||
|
consign_to_dream.txt
|
||||||
Contagion_Clasp.txt
|
Contagion_Clasp.txt
|
||||||
control_magic.txt
|
control_magic.txt
|
||||||
control_magic2.txt
|
control_magic2.txt
|
||||||
@@ -238,7 +239,7 @@ counterspell.txt
|
|||||||
counterspell2.txt
|
counterspell2.txt
|
||||||
counterspell3.txt
|
counterspell3.txt
|
||||||
counterspell4.txt
|
counterspell4.txt
|
||||||
counter_unless_pay.txt
|
counter_unless_pay_x.txt
|
||||||
Covetous_Dragon_ASLONGAS_3.txt
|
Covetous_Dragon_ASLONGAS_3.txt
|
||||||
Covetous_Dragon_ASLONGAS_4.txt
|
Covetous_Dragon_ASLONGAS_4.txt
|
||||||
cranial_plating.txt
|
cranial_plating.txt
|
||||||
@@ -614,6 +615,8 @@ souls_attendant_i489.txt
|
|||||||
soul's grace_POWERLIFEGAIN.txt
|
soul's grace_POWERLIFEGAIN.txt
|
||||||
spark_elemental.txt
|
spark_elemental.txt
|
||||||
spectral_shield_CANTBETARGETOF.txt
|
spectral_shield_CANTBETARGETOF.txt
|
||||||
|
spell_rupture.txt
|
||||||
|
spell_rupture_2.txt
|
||||||
sphinx_summoner.txt
|
sphinx_summoner.txt
|
||||||
spirit_link.txt
|
spirit_link.txt
|
||||||
spirit_link_i173.txt
|
spirit_link_i173.txt
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Test TargetChooser based on negation of two colors
|
||||||
|
# Grizzly bear should be put on top of library
|
||||||
|
|
||||||
|
# name=Consign to Dream
|
||||||
|
# Return target permanent to its owner's hand.
|
||||||
|
# If that permanent is red or green, put it on top of its owner's library
|
||||||
|
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
hand:Consign to Dream
|
||||||
|
manapool:{2}{U}
|
||||||
|
inplay:grizzly bears
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
Consign to Dream
|
||||||
|
grizzly bears
|
||||||
|
endinterruption
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
graveyard:Consign to Dream
|
||||||
|
library:grizzly bears
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
#Testing Counter unless pay {X} mechanic
|
||||||
|
#P1 casts Think Twice with {5} left in his mana pool and P2 counters with Syncopate using X = 3. P1 chooses to pay {3} and Think Twice resolves with {2} left in his mana pool.
|
||||||
|
[INIT]
|
||||||
|
firstmain
|
||||||
|
[PLAYER1]
|
||||||
|
hand:think twice
|
||||||
|
manapool:{1}{U}{5}
|
||||||
|
library:counterspell
|
||||||
|
[PLAYER2]
|
||||||
|
hand:syncopate
|
||||||
|
manapool:{3}{U}
|
||||||
|
[DO]
|
||||||
|
think twice
|
||||||
|
no
|
||||||
|
yes
|
||||||
|
syncopate
|
||||||
|
think twice
|
||||||
|
choice 0
|
||||||
|
[ASSERT]
|
||||||
|
firstmain
|
||||||
|
[PLAYER1]
|
||||||
|
hand:counterspell
|
||||||
|
graveyard:think twice
|
||||||
|
manapool:{2}
|
||||||
|
[PLAYER2]
|
||||||
|
graveyard:syncopate
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
# Testing spell rupture (expression: "pay[[{value:WParsedInt}]]")
|
||||||
|
# counter opponent spell
|
||||||
|
[INIT]
|
||||||
|
firstmain
|
||||||
|
[PLAYER1]
|
||||||
|
hand:bad moon
|
||||||
|
manapool:{1}{B}{4}
|
||||||
|
inplay:raging goblin
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:grizzly bears
|
||||||
|
hand:spell rupture
|
||||||
|
manapool:{1}{U}
|
||||||
|
[DO]
|
||||||
|
bad moon
|
||||||
|
no
|
||||||
|
yes
|
||||||
|
spell rupture
|
||||||
|
bad moon
|
||||||
|
choice 0
|
||||||
|
[ASSERT]
|
||||||
|
firstmain
|
||||||
|
[PLAYER1]
|
||||||
|
manapool:{2}
|
||||||
|
inplay:raging goblin,bad moon
|
||||||
|
[PLAYER2]
|
||||||
|
graveyard:spell rupture
|
||||||
|
manapool:{0}
|
||||||
|
inplay:grizzly bears
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# Testing spell rupture (expression: "pay[[{value:WParsedInt}]]")
|
||||||
|
# counter own spell
|
||||||
|
[INIT]
|
||||||
|
firstmain
|
||||||
|
[PLAYER1]
|
||||||
|
hand:bad moon,spell rupture
|
||||||
|
manapool:{1}{B}{1}{U}{4}
|
||||||
|
inplay:raging goblin
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:grizzly bears
|
||||||
|
[DO]
|
||||||
|
bad moon
|
||||||
|
yes
|
||||||
|
spell rupture
|
||||||
|
bad moon
|
||||||
|
choice 0
|
||||||
|
[ASSERT]
|
||||||
|
firstmain
|
||||||
|
[PLAYER1]
|
||||||
|
graveyard:spell rupture
|
||||||
|
manapool:{3}
|
||||||
|
inplay:raging goblin,bad moon
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:grizzly bears
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
//
|
||||||
|
// UIScreen+Util.h
|
||||||
|
// wagic
|
||||||
|
//
|
||||||
|
// Created by Michael Nguyen on 11/27/13.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
|
||||||
|
#import <UIKit/UIKit.h>
|
||||||
|
|
||||||
|
@interface UIScreen (Util)
|
||||||
|
|
||||||
|
+(BOOL)isRetinaDisplay;
|
||||||
|
@end
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
//
|
||||||
|
// UIScreen+Util.m
|
||||||
|
// wagic
|
||||||
|
//
|
||||||
|
// Created by Michael Nguyen on 11/27/13.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
#include "UIScreen+Util.h"
|
||||||
|
|
||||||
|
static BOOL isRetinaScreen = NO;
|
||||||
|
static BOOL didRetinaCheck = NO;
|
||||||
|
|
||||||
|
@implementation UIScreen (Util)
|
||||||
|
+ (BOOL)isRetinaDisplay
|
||||||
|
{
|
||||||
|
if (!didRetinaCheck) {
|
||||||
|
isRetinaScreen = ([[self mainScreen] respondsToSelector:@selector(displayLinkWithTarget:selector:)] &&
|
||||||
|
([self mainScreen].scale == 2.0));
|
||||||
|
didRetinaCheck = YES;
|
||||||
|
}
|
||||||
|
return isRetinaScreen;
|
||||||
|
}
|
||||||
|
@end
|
||||||
@@ -9,10 +9,6 @@
|
|||||||
#include <JGui.h>
|
#include <JGui.h>
|
||||||
#include "MTGDefinitions.h"
|
#include "MTGDefinitions.h"
|
||||||
|
|
||||||
#define INACTIVE 0
|
|
||||||
#define ACTION_REQUESTED 1
|
|
||||||
#define ACTIVE 2
|
|
||||||
|
|
||||||
class MTGCardInstance;
|
class MTGCardInstance;
|
||||||
class ManaCost;
|
class ManaCost;
|
||||||
class Targetable;
|
class Targetable;
|
||||||
@@ -22,31 +18,33 @@ class WEvent;
|
|||||||
class ActionElement: public JGuiObject
|
class ActionElement: public JGuiObject
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
int activeState;
|
enum Activity{
|
||||||
|
Inactive,
|
||||||
|
ActionRequested,
|
||||||
|
Active
|
||||||
|
};
|
||||||
|
|
||||||
|
Activity activity;
|
||||||
TargetChooser * tc;
|
TargetChooser * tc;
|
||||||
public:
|
public:
|
||||||
GamePhase currentPhase;
|
GamePhase currentPhase;
|
||||||
GamePhase newPhase;
|
GamePhase newPhase;
|
||||||
int modal;
|
int modal;
|
||||||
int waitingForAnswer;
|
int waitingForAnswer;
|
||||||
int getActivity();
|
virtual void Update(float){}
|
||||||
virtual void Update(float){};
|
virtual void Render(){}
|
||||||
virtual void Render(){};
|
|
||||||
virtual int testDestroy()
|
virtual int testDestroy()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
virtual int destroy()
|
virtual int destroy()
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
virtual bool CheckUserInput(JButton)
|
virtual bool CheckUserInput(JButton)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
ActionElement(int id);
|
ActionElement(int id);
|
||||||
ActionElement(const ActionElement& copyFromMe);
|
ActionElement(const ActionElement& copyFromMe);
|
||||||
TargetChooser * getActionTc(){return tc;}
|
TargetChooser * getActionTc(){return tc;}
|
||||||
@@ -62,27 +60,22 @@ public:
|
|||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
virtual int stillInUse(MTGCardInstance *)
|
virtual int stillInUse(MTGCardInstance *)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
virtual int receiveEvent(WEvent *)
|
virtual int receiveEvent(WEvent *)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
virtual int reactToClick(MTGCardInstance *)
|
virtual int reactToClick(MTGCardInstance *)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
;
|
|
||||||
virtual const char * getMenuText()
|
virtual const char * getMenuText()
|
||||||
{
|
{
|
||||||
return "Ability";
|
return "Ability";
|
||||||
}
|
}
|
||||||
;
|
|
||||||
virtual ActionElement * clone() const = 0;
|
virtual ActionElement * clone() const = 0;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -41,16 +41,9 @@ class DamageStack;
|
|||||||
class ManaCost;
|
class ManaCost;
|
||||||
class TargetChooser;
|
class TargetChooser;
|
||||||
|
|
||||||
|
|
||||||
#define ACTIONSTACK_STANDARD 0
|
|
||||||
#define ACTIONSTACK_TARGET 1
|
|
||||||
|
|
||||||
class Interruptible: public PlayGuiObject, public Targetable
|
class Interruptible: public PlayGuiObject, public Targetable
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
//TODO : remove these when they are back in PlayGuiObject
|
|
||||||
float x, y;
|
|
||||||
|
|
||||||
int state, display;
|
int state, display;
|
||||||
MTGCardInstance * source;
|
MTGCardInstance * source;
|
||||||
virtual void Entering()
|
virtual void Entering()
|
||||||
@@ -186,6 +179,11 @@ public:
|
|||||||
class ActionStack :public GuiLayer
|
class ActionStack :public GuiLayer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
enum ActionStackMode{
|
||||||
|
ACTIONSTACK_STANDARD = 0,
|
||||||
|
ACTIONSTACK_TARGET = 1
|
||||||
|
};
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
NOT_DECIDED = 0,
|
NOT_DECIDED = 0,
|
||||||
@@ -207,7 +205,7 @@ protected:
|
|||||||
InterruptDecision interruptDecision[2];
|
InterruptDecision interruptDecision[2];
|
||||||
float timer;
|
float timer;
|
||||||
int currentState;
|
int currentState;
|
||||||
int mode;
|
ActionStackMode mode;
|
||||||
int checked;
|
int checked;
|
||||||
ATutorialMessage* currentTutorial;
|
ATutorialMessage* currentTutorial;
|
||||||
int interruptBtnXOffset, noBtnXOffset, noToAllBtnXOffset, interruptDialogWidth;
|
int interruptBtnXOffset, noBtnXOffset, noToAllBtnXOffset, interruptDialogWidth;
|
||||||
|
|||||||
@@ -873,8 +873,8 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
if (!tc->canTarget(e->damage->target)) return 0;
|
if (!tc->canTarget(e->damage->target)) return 0;
|
||||||
if (fromTc && !fromTc->canTarget(e->damage->source)) return 0;
|
if (fromTc && !fromTc->canTarget(e->damage->source)) return 0;
|
||||||
if (type == 1 && e->damage->typeOfDamage != DAMAGE_COMBAT) return 0;
|
if (type == 1 && e->damage->typeOfDamage != Damage::DAMAGE_COMBAT) return 0;
|
||||||
if (type == 2 && e->damage->typeOfDamage == DAMAGE_COMBAT) return 0;
|
if (type == 2 && e->damage->typeOfDamage == Damage::DAMAGE_COMBAT) return 0;
|
||||||
e->damage->target->thatmuch = e->damage->damage;
|
e->damage->target->thatmuch = e->damage->damage;
|
||||||
e->damage->source->thatmuch = e->damage->damage;
|
e->damage->source->thatmuch = e->damage->damage;
|
||||||
this->source->thatmuch = e->damage->damage;
|
this->source->thatmuch = e->damage->damage;
|
||||||
@@ -2577,7 +2577,7 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (d->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (d->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
a->source = (MTGCardInstance *) d;
|
a->source = (MTGCardInstance *) d;
|
||||||
}
|
}
|
||||||
@@ -2725,7 +2725,7 @@ public:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (d->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (d->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
a->source = (MTGCardInstance *) d;
|
a->source = (MTGCardInstance *) d;
|
||||||
}
|
}
|
||||||
@@ -2794,113 +2794,24 @@ public:
|
|||||||
//equipment
|
//equipment
|
||||||
class AEquip: public TargetAbility
|
class AEquip: public TargetAbility
|
||||||
{
|
{
|
||||||
public:
|
private:
|
||||||
|
bool isAttach;
|
||||||
vector<MTGAbility *> currentAbilities;
|
vector<MTGAbility *> currentAbilities;
|
||||||
AEquip(GameObserver* observer, int _id, MTGCardInstance * _source, ManaCost * _cost = NULL, int restrictions =
|
|
||||||
ActivatedAbility::AS_SORCERY) :
|
public:
|
||||||
TargetAbility(observer, _id, _source, NULL, _cost, restrictions)
|
AEquip(GameObserver* observer, int _id, MTGCardInstance * _source, ManaCost * _cost = NULL,
|
||||||
{
|
int restrictions = ActivatedAbility::AS_SORCERY);
|
||||||
aType = MTGAbility::STANDARD_EQUIP;
|
|
||||||
}
|
|
||||||
|
|
||||||
int unequip()
|
int unequip();
|
||||||
{
|
int equip(MTGCardInstance * equipped);
|
||||||
if (source->target)
|
|
||||||
{
|
|
||||||
source->target->equipment -= 1;
|
|
||||||
source->parentCards.clear();
|
|
||||||
for(unsigned int w = 0;w < source->target->childrenCards.size();w++)
|
|
||||||
{
|
|
||||||
MTGCardInstance * child = source->target->childrenCards[w];
|
|
||||||
if(child == source)
|
|
||||||
source->target->childrenCards.erase(source->target->childrenCards.begin() + w);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
source->target = NULL;
|
|
||||||
for (size_t i = 0; i < currentAbilities.size(); ++i)
|
|
||||||
{
|
|
||||||
MTGAbility * a = currentAbilities[i];
|
|
||||||
if (dynamic_cast<AEquip *> (a) || dynamic_cast<ATeach *> (a) || dynamic_cast<AAConnect *> (a) || (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot))
|
|
||||||
{
|
|
||||||
SAFE_DELETE(a);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
game->removeObserver(currentAbilities[i]);
|
|
||||||
}
|
|
||||||
currentAbilities.clear();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int equip(MTGCardInstance * equipped)
|
int resolve();
|
||||||
{
|
const char * getMenuText();
|
||||||
source->target = equipped;
|
|
||||||
source->target->equipment += 1;
|
|
||||||
source->parentCards.push_back(equipped);
|
|
||||||
source->target->childrenCards.push_back((MTGCardInstance*)source);
|
|
||||||
AbilityFactory af(game);
|
|
||||||
af.getAbilities(¤tAbilities, NULL, source);
|
|
||||||
for (size_t i = 0; i < currentAbilities.size(); ++i)
|
|
||||||
{
|
|
||||||
MTGAbility * a = currentAbilities[i];
|
|
||||||
if (dynamic_cast<AEquip *> (a)) continue;
|
|
||||||
if (dynamic_cast<ATeach *> (a)) continue;
|
|
||||||
if (dynamic_cast<AAConnect *> (a)) continue;
|
|
||||||
if (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot)
|
|
||||||
{
|
|
||||||
a->forceDestroy = 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (dynamic_cast<AACopier *> (af.getCoreAbility(a)))
|
|
||||||
{
|
|
||||||
a->forceDestroy = 1;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//we generally dont want to pass oneShot tokencreators to the cards
|
|
||||||
//we equip...
|
|
||||||
a->addToGame();
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
}
|
int testDestroy();
|
||||||
|
int destroy();
|
||||||
int resolve()
|
|
||||||
{
|
|
||||||
MTGCardInstance * mTarget = tc->getNextCardTarget();
|
|
||||||
if (!mTarget) return 0;
|
|
||||||
if (mTarget == source) return 0;
|
|
||||||
unequip();
|
|
||||||
equip(mTarget);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char * getMenuText()
|
|
||||||
{
|
|
||||||
return "Equip";
|
|
||||||
}
|
|
||||||
|
|
||||||
int testDestroy()
|
|
||||||
{
|
|
||||||
if (source->target && !game->isInPlay(source->target))
|
|
||||||
unequip();
|
|
||||||
if(!game->connectRule)
|
|
||||||
{
|
|
||||||
if (source->target && TargetAbility::tc && !TargetAbility::tc->canTarget((Targetable *)source->target,true))
|
|
||||||
unequip();
|
|
||||||
}
|
|
||||||
return TargetAbility::testDestroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
int destroy()
|
|
||||||
{
|
|
||||||
unequip();
|
|
||||||
return TargetAbility::destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
AEquip * clone() const
|
|
||||||
{
|
|
||||||
return NEW AEquip(*this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
AEquip * clone() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ATokenCreator: public ActivatedAbility
|
class ATokenCreator: public ActivatedAbility
|
||||||
@@ -5638,7 +5549,7 @@ public:
|
|||||||
{
|
{
|
||||||
WEventDamage * e = (WEventDamage *) event;
|
WEventDamage * e = (WEventDamage *) event;
|
||||||
Damage * d = e->damage;
|
Damage * d = e->damage;
|
||||||
if (combatonly && e->damage->typeOfDamage != DAMAGE_COMBAT)
|
if (combatonly && e->damage->typeOfDamage != Damage::DAMAGE_COMBAT)
|
||||||
return 0;
|
return 0;
|
||||||
MTGCardInstance * card = d->source;
|
MTGCardInstance * card = d->source;
|
||||||
if (d->damage > 0 && card && (card == source || card == source->target))
|
if (d->damage > 0 && card && (card == source || card == source->target))
|
||||||
@@ -5781,7 +5692,6 @@ class GenericFlipACoin: public ActivatedAbility
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
string baseAbility;
|
string baseAbility;
|
||||||
bool chooseColor;
|
|
||||||
AASetCoin * setCoin;
|
AASetCoin * setCoin;
|
||||||
GenericFlipACoin(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "", ManaCost * cost = NULL);
|
GenericFlipACoin(GameObserver* observer, int id, MTGCardInstance * source, Targetable * target, string toAdd = "", ManaCost * cost = NULL);
|
||||||
int resolve();
|
int resolve();
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#ifndef _CACHE_ENGINE_H_
|
||||||
|
#define _CACHE_ENGINE_H_
|
||||||
|
|
||||||
#include "PrecompiledHeader.h"
|
#include "PrecompiledHeader.h"
|
||||||
|
|
||||||
#include "Threading.h"
|
#include "Threading.h"
|
||||||
@@ -208,3 +211,5 @@ public:
|
|||||||
|
|
||||||
CardRetrieverBase* CacheEngine::sInstance = NULL;
|
CardRetrieverBase* CacheEngine::sInstance = NULL;
|
||||||
bool CacheEngine::sIsThreaded = false;
|
bool CacheEngine::sIsThreaded = false;
|
||||||
|
|
||||||
|
#endif //_CACHE_ENGINE_H_
|
||||||
|
|||||||
@@ -9,9 +9,6 @@
|
|||||||
#include "MTGGameZones.h"
|
#include "MTGGameZones.h"
|
||||||
#include "Counters.h"
|
#include "Counters.h"
|
||||||
|
|
||||||
#define CD_OR 1
|
|
||||||
#define CD_AND 2
|
|
||||||
|
|
||||||
enum ENUM_COMPARISON_MODES
|
enum ENUM_COMPARISON_MODES
|
||||||
{
|
{
|
||||||
COMPARISON_NONE = 0, // Needs to remain 0 for quick if(comparison_mode) checks
|
COMPARISON_NONE = 0, // Needs to remain 0 for quick if(comparison_mode) checks
|
||||||
@@ -31,7 +28,12 @@ class CardDescriptor: public MTGCardInstance
|
|||||||
MTGCardInstance * match_not(MTGCardInstance * card);
|
MTGCardInstance * match_not(MTGCardInstance * card);
|
||||||
bool valueInRange(int comparisonMode, int value, int criterion);
|
bool valueInRange(int comparisonMode, int value, int criterion);
|
||||||
public:
|
public:
|
||||||
int mode;
|
enum Operator{
|
||||||
|
CD_OR = 1,
|
||||||
|
CD_AND = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
Operator mode;
|
||||||
int powerComparisonMode;
|
int powerComparisonMode;
|
||||||
int toughnessComparisonMode;
|
int toughnessComparisonMode;
|
||||||
int manacostComparisonMode;
|
int manacostComparisonMode;
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
#ifndef _CARDEFFECT_H_
|
|
||||||
#define _CARDEFFECT_H_
|
|
||||||
|
|
||||||
#include <JGE.h>
|
|
||||||
#include "Effects.h"
|
|
||||||
|
|
||||||
struct CardGui;
|
|
||||||
|
|
||||||
class CardEffect: public Effect
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CardEffect(CardGui* target);
|
|
||||||
~CardEffect();
|
|
||||||
private:
|
|
||||||
CardGui* target;
|
|
||||||
|
|
||||||
public:
|
|
||||||
virtual void Render();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // _CARDEFFECT_H_
|
|
||||||
@@ -11,17 +11,15 @@ class JGuiObject;
|
|||||||
class MTGCardInstance;
|
class MTGCardInstance;
|
||||||
class GameObserver;
|
class GameObserver;
|
||||||
|
|
||||||
#define DAMAGEABLE_MTGCARDINSTANCE 0
|
|
||||||
#define DAMAGEABLE_PLAYER 1
|
|
||||||
|
|
||||||
#define DAMAGE_ALL_TYPES 0
|
|
||||||
#define DAMAGE_COMBAT 1
|
|
||||||
#define DAMAGE_OTHER 2
|
|
||||||
|
|
||||||
class Damageable:public Targetable
|
class Damageable:public Targetable
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
public:
|
public:
|
||||||
|
enum DamageableType{
|
||||||
|
DAMAGEABLE_MTGCARDINSTANCE = 0,
|
||||||
|
DAMAGEABLE_PLAYER
|
||||||
|
};
|
||||||
|
|
||||||
int life;
|
int life;
|
||||||
int handsize;
|
int handsize;
|
||||||
int poisonCount;
|
int poisonCount;
|
||||||
@@ -29,12 +27,14 @@ public:
|
|||||||
int preventable;
|
int preventable;
|
||||||
int thatmuch;
|
int thatmuch;
|
||||||
int lifeLostThisTurn;
|
int lifeLostThisTurn;
|
||||||
int type_as_damageable;
|
DamageableType type_as_damageable;
|
||||||
Damageable(GameObserver* observer, int _life)
|
Damageable(GameObserver* observer, int _life)
|
||||||
: Targetable(observer)
|
: Targetable(observer), life(_life), handsize(0),
|
||||||
{life=_life;lifeLostThisTurn = 0;};
|
poisonCount(0), damageCount(0), preventable(0), thatmuch(0),
|
||||||
int getLife(){return life;};
|
lifeLostThisTurn(0), type_as_damageable(DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
virtual int dealDamage(int damage){life-=damage;return life;};
|
{}
|
||||||
|
int getLife(){return life;}
|
||||||
|
virtual int dealDamage(int damage){life-=damage;return life;}
|
||||||
virtual int afterDamage(){return 0;}
|
virtual int afterDamage(){return 0;}
|
||||||
virtual int poisoned(){return 0;}
|
virtual int poisoned(){return 0;}
|
||||||
virtual int prevented(){return 0;}
|
virtual int prevented(){return 0;}
|
||||||
@@ -47,17 +47,23 @@ public:
|
|||||||
|
|
||||||
class Damage: public Interruptible
|
class Damage: public Interruptible
|
||||||
{
|
{
|
||||||
protected:
|
|
||||||
void init(MTGCardInstance * source, Damageable * target, int damage, int typeOfDamage);
|
|
||||||
public:
|
public:
|
||||||
|
enum DamageType{
|
||||||
|
DAMAGE_ALL_TYPES = 0,
|
||||||
|
DAMAGE_COMBAT,
|
||||||
|
DAMAGE_OTHER
|
||||||
|
};
|
||||||
|
|
||||||
Damageable * target;
|
Damageable * target;
|
||||||
int typeOfDamage;
|
DamageType typeOfDamage;
|
||||||
int damage;
|
int damage;
|
||||||
void Render();
|
void Render();
|
||||||
Damage(GameObserver* observer, MTGCardInstance* source, Damageable * target);
|
Damage(GameObserver* observer, MTGCardInstance* source, Damageable * target);
|
||||||
Damage(GameObserver* observer, MTGCardInstance* source, Damageable * target, int damage, int typeOfDamage = DAMAGE_OTHER);
|
Damage(GameObserver* observer, MTGCardInstance* source, Damageable * target, int damage, DamageType typeOfDamage = DAMAGE_OTHER);
|
||||||
int resolve();
|
int resolve();
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
|
protected:
|
||||||
|
void init(MTGCardInstance * source, Damageable * target, int damage, DamageType typeOfDamage);
|
||||||
};
|
};
|
||||||
|
|
||||||
class DamageStack : public GuiLayer, public Interruptible
|
class DamageStack : public GuiLayer, public Interruptible
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
#ifndef _DECK_EDITOR_MENU_H
|
||||||
|
#define _DECK_EDITOR_MENU_H
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "DeckMenu.h"
|
#include "DeckMenu.h"
|
||||||
#include "DeckDataWrapper.h"
|
#include "DeckDataWrapper.h"
|
||||||
@@ -19,3 +21,4 @@ public:
|
|||||||
void Render();
|
void Render();
|
||||||
virtual ~DeckEditorMenu();
|
virtual ~DeckEditorMenu();
|
||||||
};
|
};
|
||||||
|
#endif //_DECK_EDITOR_MENU_H
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#ifndef _DECK_MANAGER_H
|
||||||
|
#define _DECK_MANAGER_H
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@@ -43,3 +46,5 @@ public:
|
|||||||
~DeckManager();
|
~DeckManager();
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif //_DECK_MANAGER_H
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
#include "MTGCard.h"
|
#include "MTGCard.h"
|
||||||
#include "MTGGameZones.h"
|
#include "MTGGameZones.h"
|
||||||
|
|
||||||
#include "CardEffect.h"
|
|
||||||
#ifdef NETWORK_SUPPORT
|
#ifdef NETWORK_SUPPORT
|
||||||
#include "JNetwork.h"
|
#include "JNetwork.h"
|
||||||
#endif //NETWORK_SUPPORT
|
#endif //NETWORK_SUPPORT
|
||||||
@@ -49,7 +48,6 @@ public:
|
|||||||
|
|
||||||
GameType gameType;
|
GameType gameType;
|
||||||
Rules * rules;
|
Rules * rules;
|
||||||
CardEffect *effect;
|
|
||||||
#ifdef NETWORK_SUPPORT
|
#ifdef NETWORK_SUPPORT
|
||||||
string mServerAddress;
|
string mServerAddress;
|
||||||
JNetwork* mpNetwork;
|
JNetwork* mpNetwork;
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#ifndef _GUI_MANA_H
|
||||||
|
#define _GUI_MANA_H
|
||||||
|
|
||||||
#include "string.h"
|
#include "string.h"
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <hge/hgeparticle.h>
|
#include <hge/hgeparticle.h>
|
||||||
@@ -51,3 +54,5 @@ public:
|
|||||||
virtual int receiveEventPlus(WEvent * e);
|
virtual int receiveEventPlus(WEvent * e);
|
||||||
virtual int receiveEventMinus(WEvent * e);
|
virtual int receiveEventMinus(WEvent * e);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif //_GUI_MANA_H
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#ifndef _MTGPACCK_H_
|
#ifndef _MTGPACK_H_
|
||||||
#define _MTGPACK_H_
|
#define _MTGPACK_H_
|
||||||
|
|
||||||
class ShopBooster;
|
class ShopBooster;
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
#ifndef _OSD_H_
|
|
||||||
#define _OSD_H_
|
|
||||||
|
|
||||||
class OSDLayer: public PlayGuiObjectController
|
|
||||||
{
|
|
||||||
virtual void Update(float dt);
|
|
||||||
virtual bool CheckUserInput(JButton key);
|
|
||||||
virtual void Render();
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -29,9 +29,10 @@ protected:
|
|||||||
TargetChooser * tcTarget;
|
TargetChooser * tcTarget;
|
||||||
int damage;
|
int damage;
|
||||||
bool oneShot;
|
bool oneShot;
|
||||||
int typeOfDamage;
|
Damage::DamageType typeOfDamage;
|
||||||
public:
|
public:
|
||||||
REDamagePrevention(MTGAbility * _source, TargetChooser *_tcSource = NULL, TargetChooser *_tcTarget = NULL, int _damage = -1, bool _oneShot = true, int typeOfDamage = DAMAGE_ALL_TYPES);
|
REDamagePrevention(MTGAbility * _source, TargetChooser *_tcSource = NULL, TargetChooser *_tcTarget = NULL,
|
||||||
|
int _damage = -1, bool _oneShot = true, Damage::DamageType typeOfDamage = Damage::DAMAGE_ALL_TYPES);
|
||||||
WEvent * replace(WEvent *e);
|
WEvent * replace(WEvent *e);
|
||||||
~REDamagePrevention();
|
~REDamagePrevention();
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
#ifndef _STYLE_MANAGER_H_
|
||||||
|
#define _STYLE_MANAGER_H_
|
||||||
|
|
||||||
class WStyle
|
class WStyle
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -34,3 +37,5 @@ protected:
|
|||||||
string activeStyle;
|
string activeStyle;
|
||||||
map<string, WStyle*> styles;
|
map<string, WStyle*> styles;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif //_STYLE_MANAGER_H_
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef _DEBUG_H_
|
#ifndef _DEBUG_H_
|
||||||
#define _DEBUG_H_
|
#define _DEBUG_H_
|
||||||
|
|
||||||
#if ((defined WIN32) || (defined WP8)) && (!defined QT_CONFIG)
|
#if ((defined WIN32) || (defined WP8))
|
||||||
#define snprintf sprintf_s
|
#define snprintf sprintf_s
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -74,8 +74,7 @@ AIHint::AIHint(string _line)
|
|||||||
|
|
||||||
if(action.find( "combo ") != string::npos)
|
if(action.find( "combo ") != string::npos)
|
||||||
{
|
{
|
||||||
string Combo = "";
|
string Combo = action.c_str() + 6;
|
||||||
Combo = action.c_str() + 6;
|
|
||||||
combos.push_back(Combo);
|
combos.push_back(Combo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -307,14 +306,13 @@ bool AIHints::canWeCombo(GameObserver* observer,MTGCardInstance * card,AIPlayerB
|
|||||||
TargetChooserFactory tfc(observer);
|
TargetChooserFactory tfc(observer);
|
||||||
TargetChooser * hintTc = NULL;
|
TargetChooser * hintTc = NULL;
|
||||||
bool gotCombo = false;
|
bool gotCombo = false;
|
||||||
int comboPartsHold = 0;
|
|
||||||
int comboPartsUntil = 0;
|
|
||||||
int comboPartsRestriction = 0;
|
|
||||||
for(unsigned int i = 0; i < hints.size();i++)
|
for(unsigned int i = 0; i < hints.size();i++)
|
||||||
{
|
{
|
||||||
comboPartsHold = 0;
|
int comboPartsHold = 0;
|
||||||
comboPartsUntil = 0;
|
int comboPartsUntil = 0;
|
||||||
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 then one might be possible at any time.
|
||||||
if (hints[i]->hold.size())
|
if (hints[i]->hold.size())
|
||||||
|
|||||||
@@ -90,13 +90,12 @@ int AIMomirPlayer::computeActions()
|
|||||||
}
|
}
|
||||||
else if (p == this && observer->mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0)
|
else if (p == this && observer->mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0)
|
||||||
{ //standard actions
|
{ //standard actions
|
||||||
CardDescriptor cd;
|
|
||||||
MTGCardInstance * card = NULL;
|
|
||||||
|
|
||||||
switch (currentGamePhase)
|
switch (currentGamePhase)
|
||||||
{
|
{
|
||||||
case MTG_PHASE_FIRSTMAIN:
|
case MTG_PHASE_FIRSTMAIN:
|
||||||
{
|
{
|
||||||
|
CardDescriptor cd;
|
||||||
ManaCost * potentialMana = getPotentialMana();
|
ManaCost * potentialMana = getPotentialMana();
|
||||||
int converted = potentialMana->getConvertedCost();
|
int converted = potentialMana->getConvertedCost();
|
||||||
SAFE_DELETE(potentialMana);
|
SAFE_DELETE(potentialMana);
|
||||||
@@ -106,7 +105,7 @@ int AIMomirPlayer::computeActions()
|
|||||||
//Attempt to put land into play
|
//Attempt to put land into play
|
||||||
cd.init();
|
cd.init();
|
||||||
cd.setColor(Constants::MTG_COLOR_LAND);
|
cd.setColor(Constants::MTG_COLOR_LAND);
|
||||||
card = cd.match(game->hand);
|
MTGCardInstance *card = cd.match(game->hand);
|
||||||
int canPutLandsIntoPlay = game->playRestrictions->canPutIntoZone(card, game->inPlay);
|
int canPutLandsIntoPlay = game->playRestrictions->canPutIntoZone(card, game->inPlay);
|
||||||
if (card && (canPutLandsIntoPlay == PlayRestriction::CAN_PLAY))
|
if (card && (canPutLandsIntoPlay == PlayRestriction::CAN_PLAY))
|
||||||
{
|
{
|
||||||
@@ -118,15 +117,12 @@ int AIMomirPlayer::computeActions()
|
|||||||
}
|
}
|
||||||
momir();
|
momir();
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
case MTG_PHASE_SECONDMAIN:
|
case MTG_PHASE_SECONDMAIN:
|
||||||
selectAbility();
|
selectAbility();
|
||||||
return 1;
|
return 1;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
return AIPlayerBaka::computeActions();
|
return AIPlayerBaka::computeActions();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AIPlayerBaka::computeActions();
|
return AIPlayerBaka::computeActions();
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ int AIAction::clickMultiAct(vector<Targetable*>& actionTargets)
|
|||||||
ite = actionTargets.erase(ite);
|
ite = actionTargets.erase(ite);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ite++;
|
++ite;
|
||||||
}
|
}
|
||||||
|
|
||||||
//shuffle to make it less predictable, otherwise ai will always seem to target from right to left. making it very obvious.
|
//shuffle to make it less predictable, otherwise ai will always seem to target from right to left. making it very obvious.
|
||||||
@@ -167,7 +167,7 @@ int AIPlayer::clickMultiTarget(TargetChooser * tc, vector<Targetable*>& potentia
|
|||||||
ite = potentialTargets.erase(ite);
|
ite = potentialTargets.erase(ite);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
ite++;
|
++ite;
|
||||||
}
|
}
|
||||||
|
|
||||||
randomGenerator.random_shuffle(potentialTargets.begin(), potentialTargets.end());
|
randomGenerator.random_shuffle(potentialTargets.begin(), potentialTargets.end());
|
||||||
|
|||||||
@@ -134,10 +134,9 @@ int OrderedAIAction::getEfficiency()
|
|||||||
if (!target)
|
if (!target)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
bool NeedPreventing;
|
|
||||||
NeedPreventing = false;
|
|
||||||
if (currentPhase == MTG_PHASE_COMBATBLOCKERS)
|
if (currentPhase == MTG_PHASE_COMBATBLOCKERS)
|
||||||
{
|
{
|
||||||
|
bool NeedPreventing = false;
|
||||||
MTGCardInstance * nextOpponent = target->getNextOpponent();
|
MTGCardInstance * nextOpponent = target->getNextOpponent();
|
||||||
if(!nextOpponent)
|
if(!nextOpponent)
|
||||||
break;
|
break;
|
||||||
@@ -152,12 +151,10 @@ int OrderedAIAction::getEfficiency()
|
|||||||
//small bonus added for the poor 1/1s, if we can save them, we will unless something else took precidence.
|
//small bonus added for the poor 1/1s, if we can save them, we will unless something else took precidence.
|
||||||
//note is the target is being blocked or blocking a creature with wither or deathtouch, it is not even considered for preventing as it is a waste.
|
//note is the target is being blocked or blocking a creature with wither or deathtouch, it is not even considered for preventing as it is a waste.
|
||||||
//if its combat blockers, it is being blocked or blocking, and has less prevents the the amount of damage it will be taking, the effeincy is increased slightly and totalled by the danger rank multiplier for final result.
|
//if its combat blockers, it is being blocked or blocking, and has less prevents the the amount of damage it will be taking, the effeincy is increased slightly and totalled by the danger rank multiplier for final result.
|
||||||
int calculateAfterDamage = 0;
|
|
||||||
int damages = 0;
|
|
||||||
if((target->defenser || target->blockers.size()) && target->controller() == p)
|
if((target->defenser || target->blockers.size()) && target->controller() == p)
|
||||||
{
|
{
|
||||||
damages = nextOpponent->power;
|
int damages = nextOpponent->power;
|
||||||
calculateAfterDamage = int(target->toughness - damages);
|
int calculateAfterDamage = target->toughness - damages;
|
||||||
if((calculateAfterDamage + target->preventable) > 0)
|
if((calculateAfterDamage + target->preventable) > 0)
|
||||||
{
|
{
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
@@ -588,8 +585,7 @@ int OrderedAIAction::getEfficiency()
|
|||||||
efficiency = 80;
|
efficiency = 80;
|
||||||
if(atc->name.length() && atc->sabilities.length() && atc->types.size() && p->game->inPlay->findByName(atc->name))
|
if(atc->name.length() && atc->sabilities.length() && atc->types.size() && p->game->inPlay->findByName(atc->name))
|
||||||
{
|
{
|
||||||
list<int>::iterator it;
|
for (list<int>::const_iterator it = atc->types.begin(); it != atc->types.end(); ++it)
|
||||||
for (it = atc->types.begin(); it != atc->types.end(); it++)
|
|
||||||
{
|
{
|
||||||
if(*it == Subtypes::TYPE_LEGENDARY)//ai please stop killing voja!!! :P
|
if(*it == Subtypes::TYPE_LEGENDARY)//ai please stop killing voja!!! :P
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
@@ -978,11 +974,10 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ManaCostHybrid * hybridCost;
|
ManaCostHybrid * hybridCost;
|
||||||
int hyb;
|
|
||||||
hyb = 0;
|
|
||||||
hybridCost = cost->getHybridCost(0);
|
hybridCost = cost->getHybridCost(0);
|
||||||
if(hybridCost)
|
if(hybridCost)
|
||||||
{
|
{
|
||||||
|
int hyb = 0;
|
||||||
while ((hybridCost = cost->getHybridCost(hyb)) != NULL)
|
while ((hybridCost = cost->getHybridCost(hyb)) != NULL)
|
||||||
{
|
{
|
||||||
//here we try to find one of the colors in the hybrid cost, it is done 1 at a time unfortunately
|
//here we try to find one of the colors in the hybrid cost, it is done 1 at a time unfortunately
|
||||||
@@ -1046,7 +1041,6 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
|
|||||||
{
|
{
|
||||||
|
|
||||||
ManaCost * withKickerCost= NEW ManaCost(cost->getKicker());
|
ManaCost * withKickerCost= NEW ManaCost(cost->getKicker());
|
||||||
int canKick = 0;
|
|
||||||
vector<MTGAbility*>kickerPayment;
|
vector<MTGAbility*>kickerPayment;
|
||||||
bool keepLooking = true;
|
bool keepLooking = true;
|
||||||
while(keepLooking)
|
while(keepLooking)
|
||||||
@@ -1061,7 +1055,6 @@ vector<MTGAbility*> AIPlayerBaka::canPayMana(MTGCardInstance * target,ManaCost *
|
|||||||
payments.push_back(kickerPayment[w]);
|
payments.push_back(kickerPayment[w]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
canKick += 1;
|
|
||||||
keepLooking = cost->getKicker()->isMulti;
|
keepLooking = cost->getKicker()->isMulti;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1297,12 +1290,10 @@ int AIPlayerBaka::createAbilityTargets(MTGAbility * a, MTGCardInstance * c, Rank
|
|||||||
|
|
||||||
TargetChooser * AIPlayerBaka::GetComboTc( GameObserver * observer,TargetChooser * tc)
|
TargetChooser * AIPlayerBaka::GetComboTc( GameObserver * observer,TargetChooser * tc)
|
||||||
{
|
{
|
||||||
TargetChooser * gathertc = NULL;
|
|
||||||
TargetChooserFactory tcf(observer);
|
TargetChooserFactory tcf(observer);
|
||||||
map<string, string>::iterator it = comboHint->cardTargets.begin();
|
for(map<string, string>::iterator it = comboHint->cardTargets.begin();it != comboHint->cardTargets.end();++it)
|
||||||
for(map<string, string>::iterator it = comboHint->cardTargets.begin();it != comboHint->cardTargets.end();it++)
|
|
||||||
{
|
{
|
||||||
gathertc = tcf.createTargetChooser(it->first.c_str(),tc->source);
|
TargetChooser *gathertc = tcf.createTargetChooser(it->first.c_str(),tc->source);
|
||||||
gathertc->setAllZones();
|
gathertc->setAllZones();
|
||||||
if(gathertc->canTarget(tc->source))
|
if(gathertc->canTarget(tc->source))
|
||||||
{
|
{
|
||||||
@@ -1402,7 +1393,6 @@ int AIPlayerBaka::selectAbility()
|
|||||||
MTGCardInstance * card = game->inPlay->cards[j];
|
MTGCardInstance * card = game->inPlay->cards[j];
|
||||||
if(a->getCost() && !a->isReactingToClick(card, totalPotentialMana))//for performance reason only look for specific mana if the payment couldnt be made with potential.
|
if(a->getCost() && !a->isReactingToClick(card, totalPotentialMana))//for performance reason only look for specific mana if the payment couldnt be made with potential.
|
||||||
{
|
{
|
||||||
abilityPayment = vector<MTGAbility*>();
|
|
||||||
abilityPayment = canPayMana(card,a->getCost());
|
abilityPayment = canPayMana(card,a->getCost());
|
||||||
}
|
}
|
||||||
if (a->isReactingToClick(card, totalPotentialMana) || abilityPayment.size())
|
if (a->isReactingToClick(card, totalPotentialMana) || abilityPayment.size())
|
||||||
@@ -1410,10 +1400,9 @@ int AIPlayerBaka::selectAbility()
|
|||||||
if(a->getCost() && a->getCost()->hasX() && totalPotentialMana->getConvertedCost() < a->getCost()->getConvertedCost()+1)
|
if(a->getCost() && a->getCost()->hasX() && totalPotentialMana->getConvertedCost() < a->getCost()->getConvertedCost()+1)
|
||||||
continue;
|
continue;
|
||||||
//don't even bother to play an ability with {x} if you can't even afford x=1.
|
//don't even bother to play an ability with {x} if you can't even afford x=1.
|
||||||
ManaCost * fullPayment = NULL;
|
|
||||||
if (abilityPayment.size())
|
if (abilityPayment.size())
|
||||||
{
|
{
|
||||||
fullPayment = NEW ManaCost();
|
ManaCost *fullPayment = NEW ManaCost();
|
||||||
for(int ch = 0; ch < int(abilityPayment.size());ch++)
|
for(int ch = 0; ch < int(abilityPayment.size());ch++)
|
||||||
{
|
{
|
||||||
AManaProducer * ampp = dynamic_cast<AManaProducer*> (abilityPayment[ch]);
|
AManaProducer * ampp = dynamic_cast<AManaProducer*> (abilityPayment[ch]);
|
||||||
@@ -1525,7 +1514,7 @@ int AIPlayerBaka::chooseTarget(TargetChooser * _tc, Player * forceTarget,MTGCard
|
|||||||
}
|
}
|
||||||
//Make sure we own the decision to choose the targets
|
//Make sure we own the decision to choose the targets
|
||||||
assert(tc->Owner == observer->currentlyActing());
|
assert(tc->Owner == observer->currentlyActing());
|
||||||
if (tc && tc->Owner != observer->currentlyActing())
|
if (tc->Owner != observer->currentlyActing())
|
||||||
{
|
{
|
||||||
observer->currentActionPlayer = tc->Owner;
|
observer->currentActionPlayer = tc->Owner;
|
||||||
//this is a hack, but if we hit this condition we are locked in a infinate loop
|
//this is a hack, but if we hit this condition we are locked in a infinate loop
|
||||||
@@ -1905,12 +1894,11 @@ MTGCardInstance * AIPlayerBaka::activateCombo()
|
|||||||
{
|
{
|
||||||
if(!comboHint)
|
if(!comboHint)
|
||||||
return NULL;
|
return NULL;
|
||||||
TargetChooser * hintTc = NULL;
|
|
||||||
TargetChooserFactory tfc(observer);
|
TargetChooserFactory tfc(observer);
|
||||||
ManaCost * totalCost = ManaCost::parseManaCost(comboHint->manaNeeded);
|
ManaCost * totalCost = ManaCost::parseManaCost(comboHint->manaNeeded);
|
||||||
for(unsigned int k = 0;k < comboHint->casting.size(); k++)
|
for(unsigned int k = 0;k < comboHint->casting.size(); k++)
|
||||||
{
|
{
|
||||||
hintTc = tfc.createTargetChooser(comboHint->casting[k],nextCardToPlay);
|
TargetChooser *hintTc = tfc.createTargetChooser(comboHint->casting[k],nextCardToPlay);
|
||||||
int combohand = game->hand->cards.size();
|
int combohand = game->hand->cards.size();
|
||||||
for(int j = 0; j < combohand;j++)
|
for(int j = 0; j < combohand;j++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ AIStats::AIStats(Player * _player, char * _filename)
|
|||||||
AIStats::~AIStats()
|
AIStats::~AIStats()
|
||||||
{
|
{
|
||||||
list<AIStat *>::iterator it;
|
list<AIStat *>::iterator it;
|
||||||
for (it = stats.begin(); it != stats.end(); it++)
|
for (it = stats.begin(); it != stats.end(); ++it)
|
||||||
{
|
{
|
||||||
AIStat * stat = *it;
|
AIStat * stat = *it;
|
||||||
delete stat;
|
delete stat;
|
||||||
@@ -47,7 +47,7 @@ void AIStats::updateStatsCard(MTGCardInstance * cardInstance, Damage * damage, f
|
|||||||
{
|
{
|
||||||
stat->value += static_cast<int>(multiplier * STATS_PLAYER_MULTIPLIER * damage->damage);
|
stat->value += static_cast<int>(multiplier * STATS_PLAYER_MULTIPLIER * damage->damage);
|
||||||
}
|
}
|
||||||
else if (damage->target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
else if (damage->target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
MTGCardInstance * target = (MTGCardInstance *) damage->target;
|
MTGCardInstance * target = (MTGCardInstance *) damage->target;
|
||||||
if (target->controller() == player && !target->isInPlay(player->getObserver()))
|
if (target->controller() == player && !target->isInPlay(player->getObserver()))
|
||||||
@@ -115,7 +115,7 @@ bool AIStats::isInTop(MTGCardInstance * card, unsigned int max, bool tooSmallCou
|
|||||||
MTGCard * source = card->model;
|
MTGCard * source = card->model;
|
||||||
int id = source->getMTGId();
|
int id = source->getMTGId();
|
||||||
list<AIStat *>::iterator it;
|
list<AIStat *>::iterator it;
|
||||||
for (it = stats.begin(); it != stats.end(); it++)
|
for (it = stats.begin(); it != stats.end(); ++it)
|
||||||
{
|
{
|
||||||
if (n >= max)
|
if (n >= max)
|
||||||
return false;
|
return false;
|
||||||
@@ -135,7 +135,7 @@ AIStat * AIStats::find(MTGCard * source)
|
|||||||
{
|
{
|
||||||
int id = source->getMTGId();
|
int id = source->getMTGId();
|
||||||
list<AIStat *>::iterator it;
|
list<AIStat *>::iterator it;
|
||||||
for (it = stats.begin(); it != stats.end(); it++)
|
for (it = stats.begin(); it != stats.end(); ++it)
|
||||||
{
|
{
|
||||||
AIStat * stat = *it;
|
AIStat * stat = *it;
|
||||||
if (stat->source == id)
|
if (stat->source == id)
|
||||||
@@ -174,7 +174,7 @@ void AIStats::save()
|
|||||||
{
|
{
|
||||||
char writer[128];
|
char writer[128];
|
||||||
list<AIStat *>::iterator it;
|
list<AIStat *>::iterator it;
|
||||||
for (it = stats.begin(); it != stats.end(); it++)
|
for (it = stats.begin(); it != stats.end(); ++it)
|
||||||
{
|
{
|
||||||
AIStat * stat = *it;
|
AIStat * stat = *it;
|
||||||
if (stat->value > 0)
|
if (stat->value > 0)
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
ActionElement::ActionElement(int id) :
|
ActionElement::ActionElement(int id) :
|
||||||
JGuiObject(id)
|
JGuiObject(id)
|
||||||
{
|
{
|
||||||
activeState = INACTIVE;
|
activity = Inactive;
|
||||||
modal = 0;
|
modal = 0;
|
||||||
waitingForAnswer = 0;
|
waitingForAnswer = 0;
|
||||||
currentPhase = MTG_PHASE_INVALID;
|
currentPhase = MTG_PHASE_INVALID;
|
||||||
@@ -18,7 +18,7 @@ ActionElement::ActionElement(int id) :
|
|||||||
|
|
||||||
ActionElement::ActionElement(const ActionElement& a): JGuiObject(a)
|
ActionElement::ActionElement(const ActionElement& a): JGuiObject(a)
|
||||||
{
|
{
|
||||||
activeState = a.activeState;
|
activity = a.activity;
|
||||||
tc = a.tc ? a.tc->clone() : NULL;
|
tc = a.tc ? a.tc->clone() : NULL;
|
||||||
currentPhase = a.currentPhase;
|
currentPhase = a.currentPhase;
|
||||||
newPhase = a.newPhase;
|
newPhase = a.newPhase;
|
||||||
@@ -31,12 +31,6 @@ ActionElement::~ActionElement()
|
|||||||
SAFE_DELETE(tc);
|
SAFE_DELETE(tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
int ActionElement::getActivity()
|
|
||||||
{
|
|
||||||
|
|
||||||
return activeState;
|
|
||||||
}
|
|
||||||
|
|
||||||
int ActionElement::isReactingToTargetClick(Targetable * object)
|
int ActionElement::isReactingToTargetClick(Targetable * object)
|
||||||
{
|
{
|
||||||
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
|
if (MTGCardInstance * cObject = dynamic_cast<MTGCardInstance *>(object))
|
||||||
|
|||||||
@@ -165,8 +165,6 @@ void ActionLayer::Update(float dt)
|
|||||||
if (cantCancel)
|
if (cantCancel)
|
||||||
{
|
{
|
||||||
ActionElement * ae = isWaitingForAnswer();
|
ActionElement * ae = isWaitingForAnswer();
|
||||||
int countTargets = 0;
|
|
||||||
int maxTargets = 0;
|
|
||||||
if(ae && ae->getActionTc())
|
if(ae && ae->getActionTc())
|
||||||
{
|
{
|
||||||
if (!ae->getActionTc()->validTargetsExist())
|
if (!ae->getActionTc()->validTargetsExist())
|
||||||
@@ -175,8 +173,8 @@ void ActionLayer::Update(float dt)
|
|||||||
cancelCurrentAction();
|
cancelCurrentAction();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
countTargets = ae->getActionTc()->countValidTargets();
|
int countTargets = ae->getActionTc()->countValidTargets();
|
||||||
maxTargets = ae->getActionTc()->maxtargets;
|
int maxTargets = ae->getActionTc()->maxtargets;
|
||||||
if (countTargets < maxTargets)
|
if (countTargets < maxTargets)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
@@ -266,7 +264,7 @@ int ActionLayer::receiveEventPlus(WEvent * event)
|
|||||||
ActionElement * currentAction = (ActionElement *) mObjects[i];
|
ActionElement * currentAction = (ActionElement *) mObjects[i];
|
||||||
result += currentAction->receiveEvent(event);
|
result += currentAction->receiveEvent(event);
|
||||||
}
|
}
|
||||||
return 0;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ActionLayer::isReactingToTargetClick(Targetable * card)
|
int ActionLayer::isReactingToTargetClick(Targetable * card)
|
||||||
@@ -440,10 +438,9 @@ void ActionLayer::setCustomMenuObject(Targetable * object, bool must,vector<MTGA
|
|||||||
if(abilities.size())
|
if(abilities.size())
|
||||||
{
|
{
|
||||||
abilitiesMenu->isMultipleChoice = true;
|
abilitiesMenu->isMultipleChoice = true;
|
||||||
ActionElement * currentAction = NULL;
|
|
||||||
for(int w = 0; w < int(abilities.size());w++)
|
for(int w = 0; w < int(abilities.size());w++)
|
||||||
{
|
{
|
||||||
currentAction = (ActionElement*)abilities[w];
|
ActionElement* currentAction = (ActionElement*)abilities[w];
|
||||||
currentActionCard = (MTGCardInstance*)abilities[0]->target;
|
currentActionCard = (MTGCardInstance*)abilities[0]->target;
|
||||||
abilitiesMenu->Add(mObjects.size()-1, currentAction->getMenuText(),"",false);
|
abilitiesMenu->Add(mObjects.size()-1, currentAction->getMenuText(),"",false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ void StackAbility::Render()
|
|||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
quad = target->getIcon();
|
quad = target->getIcon();
|
||||||
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
alt2 = ((MTGCardInstance *) target)->name;
|
alt2 = ((MTGCardInstance *) target)->name;
|
||||||
}
|
}
|
||||||
@@ -400,7 +400,7 @@ void Spell::Render()
|
|||||||
if (target)
|
if (target)
|
||||||
{
|
{
|
||||||
quad = target->getIcon();
|
quad = target->getIcon();
|
||||||
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
alt2 = ((MTGCardInstance *) target)->name;
|
alt2 = ((MTGCardInstance *) target)->name;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -973,7 +973,7 @@ AASetTypeChosen::~AASetTypeChosen()
|
|||||||
//
|
//
|
||||||
//choosing a type or color
|
//choosing a type or color
|
||||||
GenericFlipACoin::GenericFlipACoin(GameObserver* observer, int id, MTGCardInstance * source, Targetable *,string _toAdd, ManaCost * cost) :
|
GenericFlipACoin::GenericFlipACoin(GameObserver* observer, int id, MTGCardInstance * source, Targetable *,string _toAdd, ManaCost * cost) :
|
||||||
ActivatedAbility(observer, id, source, cost, 0), baseAbility(_toAdd),chooseColor(chooseColor)
|
ActivatedAbility(observer, id, source, cost, 0), baseAbility(_toAdd)
|
||||||
{
|
{
|
||||||
this->GetId();
|
this->GetId();
|
||||||
setCoin = NULL;
|
setCoin = NULL;
|
||||||
@@ -1144,9 +1144,6 @@ int GenericPaidAbility::resolve()
|
|||||||
baseAbility = Af.parseMagicLine(baseAbilityStrSplit[0], this->GetId(), NULL, source);
|
baseAbility = Af.parseMagicLine(baseAbilityStrSplit[0], this->GetId(), NULL, source);
|
||||||
baseAbility->target = target;
|
baseAbility->target = target;
|
||||||
optionalCost = ManaCost::parseManaCost(baseCost, NULL, source);
|
optionalCost = ManaCost::parseManaCost(baseCost, NULL, source);
|
||||||
if (optionalCost->hasX()) {
|
|
||||||
optionalCost->add(Constants::MTG_COLOR_ARTIFACT, source->storedSourceCard->X);
|
|
||||||
}
|
|
||||||
|
|
||||||
// hacky way to produce better MenuText
|
// hacky way to produce better MenuText
|
||||||
AAFakeAbility* isFake = dynamic_cast< AAFakeAbility* >( baseAbility );
|
AAFakeAbility* isFake = dynamic_cast< AAFakeAbility* >( baseAbility );
|
||||||
@@ -2354,7 +2351,7 @@ int AALifer::resolve()
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
WParsedInt life(life_s, NULL, source);
|
WParsedInt life(life_s, NULL, source);
|
||||||
if (_target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (_target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
_target = ((MTGCardInstance *) _target)->controller();
|
_target = ((MTGCardInstance *) _target)->controller();
|
||||||
}
|
}
|
||||||
@@ -3530,10 +3527,10 @@ int MenuAbility::reactToChoiceClick(Targetable * object,int choice,int control)
|
|||||||
if (mClone && !toPay && optionalCosts.size() && i < int(optionalCosts.size()) && optionalCosts[i])//paidability only supports the first ability as paid for now.
|
if (mClone && !toPay && optionalCosts.size() && i < int(optionalCosts.size()) && optionalCosts[i])//paidability only supports the first ability as paid for now.
|
||||||
{
|
{
|
||||||
toPay = NEW ManaCost();
|
toPay = NEW ManaCost();
|
||||||
if(optionalCosts[i]->extraCosts)
|
if (optionalCosts[i]->extraCosts)
|
||||||
toPay->extraCosts = optionalCosts[i]->extraCosts->clone();
|
toPay->extraCosts = optionalCosts[i]->extraCosts->clone();
|
||||||
toPay->addExtraCost(NEW ExtraManaCost(NEW ManaCost(optionalCosts[i])));
|
toPay->addExtraCost(NEW ExtraManaCost(NEW ManaCost(optionalCosts[i])));
|
||||||
toPay->setExtraCostsAction(this,source);
|
toPay->setExtraCostsAction(this, source);
|
||||||
game->mExtraPayment = toPay->extraCosts;
|
game->mExtraPayment = toPay->extraCosts;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -4383,7 +4380,7 @@ int AAExchangeLife::resolve()
|
|||||||
int oldlife = player->getLife();
|
int oldlife = player->getLife();
|
||||||
int targetOldLife = _target->getLife();
|
int targetOldLife = _target->getLife();
|
||||||
int modifier = oldlife > targetOldLife? oldlife - targetOldLife:targetOldLife - oldlife;
|
int modifier = oldlife > targetOldLife? oldlife - targetOldLife:targetOldLife - oldlife;
|
||||||
if (_target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (_target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
int increaser = 0;
|
int increaser = 0;
|
||||||
MTGCardInstance * card = ((MTGCardInstance*)_target);
|
MTGCardInstance * card = ((MTGCardInstance*)_target);
|
||||||
@@ -4600,15 +4597,15 @@ int APreventDamageTypes::addToGame()
|
|||||||
fromTc->targetter = NULL;
|
fromTc->targetter = NULL;
|
||||||
if (type != 1 && type != 2)
|
if (type != 1 && type != 2)
|
||||||
{//not adding this creates a memory leak.
|
{//not adding this creates a memory leak.
|
||||||
re = NEW REDamagePrevention(this, fromTc, toTc, -1, false, DAMAGE_COMBAT);
|
re = NEW REDamagePrevention(this, fromTc, toTc, -1, false, Damage::DAMAGE_COMBAT);
|
||||||
}
|
}
|
||||||
else if (type == 1)
|
else if (type == 1)
|
||||||
{
|
{
|
||||||
re = NEW REDamagePrevention(this, fromTc, toTc, -1, false, DAMAGE_ALL_TYPES);
|
re = NEW REDamagePrevention(this, fromTc, toTc, -1, false, Damage::DAMAGE_ALL_TYPES);
|
||||||
}
|
}
|
||||||
else if (type == 2)
|
else if (type == 2)
|
||||||
{
|
{
|
||||||
re = NEW REDamagePrevention(this, fromTc, toTc, -1, false, DAMAGE_OTHER);
|
re = NEW REDamagePrevention(this, fromTc, toTc, -1, false, Damage::DAMAGE_OTHER);
|
||||||
}
|
}
|
||||||
game->replacementEffects->add(re);
|
game->replacementEffects->add(re);
|
||||||
return MTGAbility::addToGame();
|
return MTGAbility::addToGame();
|
||||||
@@ -5294,6 +5291,115 @@ AAConnect * AAConnect::clone() const
|
|||||||
return NEW AAConnect(*this);
|
return NEW AAConnect(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AEquip::AEquip(GameObserver* observer, int _id, MTGCardInstance * _source, ManaCost * _cost, int restrictions) :
|
||||||
|
TargetAbility(observer, _id, _source, NULL, _cost, restrictions)
|
||||||
|
{
|
||||||
|
aType = MTGAbility::STANDARD_EQUIP;
|
||||||
|
isAttach = restrictions != ActivatedAbility::AS_SORCERY;
|
||||||
|
}
|
||||||
|
|
||||||
|
int AEquip::unequip()
|
||||||
|
{
|
||||||
|
if (source->target)
|
||||||
|
{
|
||||||
|
source->target->equipment -= 1;
|
||||||
|
source->parentCards.clear();
|
||||||
|
for (unsigned int w = 0; w < source->target->childrenCards.size(); w++)
|
||||||
|
{
|
||||||
|
MTGCardInstance * child = source->target->childrenCards[w];
|
||||||
|
if (child == source)
|
||||||
|
source->target->childrenCards.erase(source->target->childrenCards.begin() + w);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
source->target = NULL;
|
||||||
|
for (size_t i = 0; i < currentAbilities.size(); ++i)
|
||||||
|
{
|
||||||
|
MTGAbility * a = currentAbilities[i];
|
||||||
|
if (dynamic_cast<AEquip *> (a) || dynamic_cast<ATeach *> (a) || dynamic_cast<AAConnect *> (a)
|
||||||
|
|| (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot))
|
||||||
|
{
|
||||||
|
SAFE_DELETE(a);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
game->removeObserver(currentAbilities[i]);
|
||||||
|
}
|
||||||
|
currentAbilities.clear();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int AEquip::equip(MTGCardInstance * equipped)
|
||||||
|
{
|
||||||
|
source->target = equipped;
|
||||||
|
source->target->equipment += 1;
|
||||||
|
source->parentCards.push_back(equipped);
|
||||||
|
source->target->childrenCards.push_back((MTGCardInstance*)source);
|
||||||
|
AbilityFactory af(game);
|
||||||
|
af.getAbilities(¤tAbilities, NULL, source);
|
||||||
|
for (size_t i = 0; i < currentAbilities.size(); ++i)
|
||||||
|
{
|
||||||
|
MTGAbility * a = currentAbilities[i];
|
||||||
|
if (dynamic_cast<AEquip *> (a)) continue;
|
||||||
|
if (dynamic_cast<ATeach *> (a)) continue;
|
||||||
|
if (dynamic_cast<AAConnect *> (a)) continue;
|
||||||
|
if (dynamic_cast<AANewTarget *> (af.getCoreAbility(a))) continue;
|
||||||
|
if (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot)
|
||||||
|
{
|
||||||
|
a->forceDestroy = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (dynamic_cast<AACopier *> (af.getCoreAbility(a)))
|
||||||
|
{
|
||||||
|
a->forceDestroy = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//we generally dont want to pass oneShot tokencreators to the cards
|
||||||
|
//we equip...
|
||||||
|
a->addToGame();
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int AEquip::resolve()
|
||||||
|
{
|
||||||
|
MTGCardInstance * mTarget = tc->getNextCardTarget();
|
||||||
|
if (!mTarget) return 0;
|
||||||
|
if (mTarget == source) return 0;
|
||||||
|
unequip();
|
||||||
|
equip(mTarget);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char * AEquip::getMenuText()
|
||||||
|
{
|
||||||
|
if (isAttach)
|
||||||
|
return "Attach";
|
||||||
|
else
|
||||||
|
return "Equip";
|
||||||
|
}
|
||||||
|
|
||||||
|
int AEquip::testDestroy()
|
||||||
|
{
|
||||||
|
if (source->target && !game->isInPlay(source->target))
|
||||||
|
unequip();
|
||||||
|
if (!game->connectRule)
|
||||||
|
{
|
||||||
|
if (source->target && TargetAbility::tc && !TargetAbility::tc->canTarget((Targetable *)source->target,true))
|
||||||
|
unequip();
|
||||||
|
}
|
||||||
|
return TargetAbility::testDestroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
int AEquip::destroy()
|
||||||
|
{
|
||||||
|
unequip();
|
||||||
|
return TargetAbility::destroy();
|
||||||
|
}
|
||||||
|
|
||||||
|
AEquip * AEquip::clone() const
|
||||||
|
{
|
||||||
|
return NEW AEquip(*this);
|
||||||
|
}
|
||||||
|
|
||||||
// casting a card for free, or casting a copy of a card.
|
// casting a card for free, or casting a copy of a card.
|
||||||
AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool _restricted,bool _copied,bool asNormal,string _namedCard,string _name,bool _noEvent) :
|
AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool _restricted,bool _copied,bool asNormal,string _namedCard,string _name,bool _noEvent) :
|
||||||
MTGAbility(observer, _id, _source),restricted(_restricted),asCopy(_copied),normal(asNormal),cardNamed(_namedCard),nameThis(_name),noEvent(_noEvent)
|
MTGAbility(observer, _id, _source),restricted(_restricted),asCopy(_copied),normal(asNormal),cardNamed(_namedCard),nameThis(_name),noEvent(_noEvent)
|
||||||
|
|||||||
@@ -160,7 +160,8 @@ MTGCardInstance * CardDescriptor::match_and(MTGCardInstance * card)
|
|||||||
|
|
||||||
if (mColorExclusions)
|
if (mColorExclusions)
|
||||||
{
|
{
|
||||||
if ((mColorExclusions & card->colors) == mColorExclusions)
|
// if any of forbidden colors intersect with card colors
|
||||||
|
if ((mColorExclusions & card->colors) != 0)
|
||||||
match = NULL;
|
match = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
#include "../include/GameApp.h"
|
|
||||||
#include "../include/MTGCard.h"
|
|
||||||
#include "../include/GameOptions.h"
|
|
||||||
#include "../include/CardEffect.h"
|
|
||||||
|
|
||||||
CardEffect::CardEffect(CardGui* target) :
|
|
||||||
target(target)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
CardEffect::~CardEffect()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void CardEffect::Render()
|
|
||||||
{
|
|
||||||
// std::cout << "Rendering effect" << std::endl;
|
|
||||||
}
|
|
||||||
@@ -1013,7 +1013,7 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
|||||||
CardDescriptor cd;
|
CardDescriptor cd;
|
||||||
MTGCardInstance * card = (MTGCardInstance*) _card->data;
|
MTGCardInstance * card = (MTGCardInstance*) _card->data;
|
||||||
cd.init();
|
cd.init();
|
||||||
cd.mode = CD_OR;
|
cd.mode = CardDescriptor::CD_OR;
|
||||||
while (filter.size())
|
while (filter.size())
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1033,13 +1033,13 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
|||||||
string attribute;
|
string attribute;
|
||||||
if (found2 != string::npos)
|
if (found2 != string::npos)
|
||||||
{
|
{
|
||||||
cd.mode = CD_OR;
|
cd.mode = CardDescriptor::CD_OR;
|
||||||
attribute = attributes.substr(0, found2);
|
attribute = attributes.substr(0, found2);
|
||||||
attributes = attributes.substr(found2 + 1);
|
attributes = attributes.substr(found2 + 1);
|
||||||
}
|
}
|
||||||
else if (foundAnd != string::npos)
|
else if (foundAnd != string::npos)
|
||||||
{
|
{
|
||||||
cd.mode = CD_AND;
|
cd.mode = CardDescriptor::CD_AND;
|
||||||
attribute = attributes.substr(0, foundAnd);
|
attribute = attributes.substr(0, foundAnd);
|
||||||
attributes = attributes.substr(foundAnd + 1);
|
attributes = attributes.substr(foundAnd + 1);
|
||||||
}
|
}
|
||||||
@@ -1302,7 +1302,7 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nbminuses)
|
if (nbminuses)
|
||||||
cd.mode = CD_AND;
|
cd.mode = CardDescriptor::CD_AND;
|
||||||
filter = filter.substr(0, found);
|
filter = filter.substr(0, found);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1312,7 +1312,7 @@ bool CardGui::FilterCard(MTGCard * _card,string filter)
|
|||||||
|
|
||||||
if (found != string::npos)
|
if (found != string::npos)
|
||||||
{
|
{
|
||||||
cd.mode = CD_OR;
|
cd.mode = CardDescriptor::CD_OR;
|
||||||
typeName = filter.substr(0, found);
|
typeName = filter.substr(0, found);
|
||||||
filter = filter.substr(found + 1);
|
filter = filter.substr(found + 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,42 +7,42 @@
|
|||||||
#include "Closest.cpp"
|
#include "Closest.cpp"
|
||||||
#include "GameObserver.h"
|
#include "GameObserver.h"
|
||||||
|
|
||||||
struct Left: public Exp
|
struct CardSelectorLeft: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
||||||
{
|
{
|
||||||
return ref->x - test->x > fabs(ref->y - test->y);
|
return ref->x - test->x > fabs(ref->y - test->y);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct Right: public Exp
|
struct CardSelectorRight: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
||||||
{
|
{
|
||||||
return test->x - ref->x > fabs(ref->y - test->y);
|
return test->x - ref->x > fabs(ref->y - test->y);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct Up: public Exp
|
struct CardSelectorUp: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
||||||
{
|
{
|
||||||
return ref->y - test->y > fabs(ref->x - test->x);
|
return ref->y - test->y > fabs(ref->x - test->x);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct Down: public Exp
|
struct CardSelectorDown: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
||||||
{
|
{
|
||||||
return test->y - ref->y > fabs(ref->x - test->x);
|
return test->y - ref->y > fabs(ref->x - test->x);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct Diff: public Exp
|
struct CardSelectorDiff: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
static inline bool test(CardSelector::Target* ref, CardSelector::Target* test)
|
||||||
{
|
{
|
||||||
return ref != test;
|
return ref != test;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct True: public Exp
|
struct CardSelectorTrue: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(CardSelector::Target*, CardSelector::Target*)
|
static inline bool test(CardSelector::Target*, CardSelector::Target*)
|
||||||
{
|
{
|
||||||
@@ -94,7 +94,7 @@ void CardSelector::Remove(CardSelector::Target* card)
|
|||||||
CardView* c = dynamic_cast<CardView*> (active);
|
CardView* c = dynamic_cast<CardView*> (active);
|
||||||
if (c)
|
if (c)
|
||||||
c->zoom = 1.0f;
|
c->zoom = 1.0f;
|
||||||
active = closest<Diff> (cards, limitor, active);
|
active = closest<CardSelectorDiff> (cards, limitor, active);
|
||||||
c = dynamic_cast<CardView*> (active);
|
c = dynamic_cast<CardView*> (active);
|
||||||
if (c)
|
if (c)
|
||||||
c->zoom = 1.4f;
|
c->zoom = 1.4f;
|
||||||
@@ -120,7 +120,7 @@ CardSelector::Target* CardSelector::fetchMemory(SelectorMemory& memory)
|
|||||||
}
|
}
|
||||||
// We come here if the card is not in the selector any more, or if
|
// We come here if the card is not in the selector any more, or if
|
||||||
// it is there but it is now refused by the limitor.
|
// it is there but it is now refused by the limitor.
|
||||||
return closest<True> (cards, limitor, memory.x, memory.y);
|
return closest<CardSelectorTrue> (cards, limitor, memory.x, memory.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardSelector::Push()
|
void CardSelector::Push()
|
||||||
@@ -182,7 +182,7 @@ bool CardSelector::CheckUserInput(JButton key)
|
|||||||
if(!jge) return false;
|
if(!jge) return false;
|
||||||
if(jge->GetLeftClickCoordinates(x, y))
|
if(jge->GetLeftClickCoordinates(x, y))
|
||||||
{
|
{
|
||||||
active = closest<True> (cards, limitor, static_cast<float> (x), static_cast<float> (y));
|
active = closest<CardSelectorTrue> (cards, limitor, static_cast<float> (x), static_cast<float> (y));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (key)
|
switch (key)
|
||||||
@@ -196,16 +196,16 @@ bool CardSelector::CheckUserInput(JButton key)
|
|||||||
goto switch_active;
|
goto switch_active;
|
||||||
break;
|
break;
|
||||||
case JGE_BTN_LEFT:
|
case JGE_BTN_LEFT:
|
||||||
active = closest<Left> (cards, limitor, active);
|
active = closest<CardSelectorLeft> (cards, limitor, active);
|
||||||
break;
|
break;
|
||||||
case JGE_BTN_RIGHT:
|
case JGE_BTN_RIGHT:
|
||||||
active = closest<Right> (cards, limitor, active);
|
active = closest<CardSelectorRight> (cards, limitor, active);
|
||||||
break;
|
break;
|
||||||
case JGE_BTN_UP:
|
case JGE_BTN_UP:
|
||||||
active = closest<Up> (cards, limitor, active);
|
active = closest<CardSelectorUp> (cards, limitor, active);
|
||||||
break;
|
break;
|
||||||
case JGE_BTN_DOWN:
|
case JGE_BTN_DOWN:
|
||||||
active = closest<Down> (cards, limitor, active);
|
active = closest<CardSelectorDown> (cards, limitor, active);
|
||||||
break;
|
break;
|
||||||
case JGE_BTN_CANCEL:
|
case JGE_BTN_CANCEL:
|
||||||
mDrawMode = (mDrawMode + 1) % DrawMode::kNumDrawModes;
|
mDrawMode = (mDrawMode + 1) % DrawMode::kNumDrawModes;
|
||||||
|
|||||||
+15
-25
@@ -14,13 +14,13 @@ Damage::Damage(GameObserver* observer, MTGCardInstance * source, Damageable * ta
|
|||||||
init(source, target, source->getPower(), DAMAGE_OTHER);
|
init(source, target, source->getPower(), DAMAGE_OTHER);
|
||||||
}
|
}
|
||||||
|
|
||||||
Damage::Damage(GameObserver* observer, MTGCardInstance * source, Damageable * target, int damage, int _typeOfDamage)
|
Damage::Damage(GameObserver* observer, MTGCardInstance * source, Damageable * target, int damage, DamageType _typeOfDamage)
|
||||||
: Interruptible(observer)
|
: Interruptible(observer)
|
||||||
{
|
{
|
||||||
init(source, target, damage, _typeOfDamage);
|
init(source, target, damage, _typeOfDamage);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Damage::init(MTGCardInstance * _source, Damageable * _target, int _damage, int _typeOfDamage)
|
void Damage::init(MTGCardInstance * _source, Damageable * _target, int _damage, DamageType _typeOfDamage)
|
||||||
{
|
{
|
||||||
typeOfDamage = _typeOfDamage;
|
typeOfDamage = _typeOfDamage;
|
||||||
target = _target;
|
target = _target;
|
||||||
@@ -59,29 +59,19 @@ int Damage::resolve()
|
|||||||
//reserved for culmulitive absorb ability coding
|
//reserved for culmulitive absorb ability coding
|
||||||
|
|
||||||
//prevent next damage-----------------------------
|
//prevent next damage-----------------------------
|
||||||
if ((target)->preventable >= 1)
|
if (target->preventable > 0)
|
||||||
{
|
{
|
||||||
int preventing = (target)->preventable;
|
int preventing = MIN(target->preventable, damage);
|
||||||
for (int k = preventing; k > 0; k--)
|
damage -= preventing;
|
||||||
{
|
target->preventable -= preventing;
|
||||||
//the following keeps preventable from ADDING toughness/life if damage was less then preventable amount.
|
|
||||||
for (int i = damage; i >= 1; i--)
|
|
||||||
{
|
|
||||||
(target)->preventable -= 1;
|
|
||||||
damage -= 1;
|
|
||||||
break;//does the redux of damage 1 time, breaks the loop to deincrement preventing and start the loop over.
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
//set prevent next damage back to 0 if it is equal to less then 0
|
|
||||||
if ((target)->preventable < 0)
|
|
||||||
{
|
{
|
||||||
(target)->preventable = 0;
|
target->preventable = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
{
|
{
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||||
if ((_target)->protectedAgainst(source))
|
if ((_target)->protectedAgainst(source))
|
||||||
@@ -134,7 +124,7 @@ int Damage::resolve()
|
|||||||
|
|
||||||
int a = damage;
|
int a = damage;
|
||||||
|
|
||||||
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE && (source->has(Constants::WITHER) || source->has(
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE && (source->has(Constants::WITHER) || source->has(
|
||||||
Constants::INFECT)))
|
Constants::INFECT)))
|
||||||
{
|
{
|
||||||
// Damage for WITHER or poison on creatures. This should probably go in replacement effects
|
// Damage for WITHER or poison on creatures. This should probably go in replacement effects
|
||||||
@@ -146,7 +136,7 @@ int Damage::resolve()
|
|||||||
if(_target->toughness <= 0 && _target->has(Constants::INDESTRUCTIBLE))
|
if(_target->toughness <= 0 && _target->has(Constants::INDESTRUCTIBLE))
|
||||||
_target->controller()->game->putInGraveyard(_target);
|
_target->controller()->game->putInGraveyard(_target);
|
||||||
}
|
}
|
||||||
else if (target->type_as_damageable == DAMAGEABLE_PLAYER && (source->has(Constants::INFECT)||source->has(Constants::POISONDAMAGER)))
|
else if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER && (source->has(Constants::INFECT)||source->has(Constants::POISONDAMAGER)))
|
||||||
{
|
{
|
||||||
// Poison on player
|
// Poison on player
|
||||||
Player * _target = (Player *) target;
|
Player * _target = (Player *) target;
|
||||||
@@ -163,7 +153,7 @@ int Damage::resolve()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (target->type_as_damageable == DAMAGEABLE_PLAYER && (source->has(Constants::POISONTOXIC) ||
|
else if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER && (source->has(Constants::POISONTOXIC) ||
|
||||||
source->has(Constants::POISONTWOTOXIC) || source->has(Constants::POISONTHREETOXIC)))
|
source->has(Constants::POISONTWOTOXIC) || source->has(Constants::POISONTHREETOXIC)))
|
||||||
{
|
{
|
||||||
//Damage + 1, 2, or 3 poison counters on player
|
//Damage + 1, 2, or 3 poison counters on player
|
||||||
@@ -202,9 +192,9 @@ 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_MTGCARDINSTANCE)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
((MTGCardInstance*)target)->wasDealtDamage = true;
|
((MTGCardInstance*)target)->wasDealtDamage = true;
|
||||||
if (target->type_as_damageable == DAMAGEABLE_PLAYER)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
|
||||||
{
|
{
|
||||||
if(target == source->controller())
|
if(target == source->controller())
|
||||||
{
|
{
|
||||||
@@ -260,7 +250,7 @@ void Damage::Render()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
mFont->DrawString(_(((MTGCardInstance *) target)->getName()).c_str(), x + 120, y);
|
mFont->DrawString(_(((MTGCardInstance *) target)->getName()).c_str(), x + 120, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ void DamagerDamaged::addDamage(int damage, DamagerDamaged* source)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (0 < damage)
|
if (0 < damage)
|
||||||
damages.push_back(Damage(card->getObserver(), source->card, card, damage, DAMAGE_COMBAT));
|
damages.push_back(Damage(card->getObserver(), source->card, card, damage, Damage::DAMAGE_COMBAT));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,16 +13,16 @@
|
|||||||
|
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
namespace
|
namespace DeckMenuConst
|
||||||
{
|
{
|
||||||
const float kVerticalMargin = 16;
|
const float kVerticalMargin = 16;
|
||||||
const float kHorizontalMargin = 20;
|
const float kHorizontalMargin = 20;
|
||||||
const float kLineHeight = 25;
|
const float kLineHeight = 25;
|
||||||
const float kDescriptionVerticalBoxPadding = -5;
|
const float kDescriptionVerticalBoxPadding = -5;
|
||||||
const float kDescriptionHorizontalBoxPadding = 5;
|
const float kDescriptionHorizontalBoxPadding = 5;
|
||||||
|
|
||||||
const float kDefaultFontScale = 1.0f;
|
const float kDefaultFontScale = 1.0f;
|
||||||
const float kVerticalScrollSpeed = 7.0f;
|
const float kVerticalScrollSpeed = 7.0f;
|
||||||
|
|
||||||
const int DETAILED_INFO_THRESHOLD = 20;
|
const int DETAILED_INFO_THRESHOLD = 20;
|
||||||
const int kDetailedInfoButtonId = 10000;
|
const int kDetailedInfoButtonId = 10000;
|
||||||
@@ -52,8 +52,8 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc
|
|||||||
titleY = 15;
|
titleY = 15;
|
||||||
titleWidth = 180; // width of inner box of title
|
titleWidth = 180; // width of inner box of title
|
||||||
|
|
||||||
descX = 260 + kDescriptionHorizontalBoxPadding;
|
descX = 260 + DeckMenuConst::kDescriptionHorizontalBoxPadding;
|
||||||
descY = 100 + kDescriptionVerticalBoxPadding;
|
descY = 100 + DeckMenuConst::kDescriptionVerticalBoxPadding;
|
||||||
descHeight = 145;
|
descHeight = 145;
|
||||||
descWidth = 195;
|
descWidth = 195;
|
||||||
|
|
||||||
@@ -73,11 +73,11 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc
|
|||||||
|
|
||||||
float scrollerWidth = 200.0f;
|
float scrollerWidth = 200.0f;
|
||||||
float scrollerHeight = 28.0f;
|
float scrollerHeight = 28.0f;
|
||||||
mScroller = NEW VerticalTextScroller(Fonts::MAIN_FONT, 14, 235, scrollerWidth, scrollerHeight, kVerticalScrollSpeed);
|
mScroller = NEW VerticalTextScroller(Fonts::MAIN_FONT, 14, 235, scrollerWidth, scrollerHeight, DeckMenuConst::kVerticalScrollSpeed);
|
||||||
|
|
||||||
mAutoTranslate = true;
|
mAutoTranslate = true;
|
||||||
maxItems = 6;
|
maxItems = 6;
|
||||||
mHeight = 2 * kVerticalMargin + (maxItems * kLineHeight);
|
mHeight = 2 * DeckMenuConst::kVerticalMargin + (maxItems * DeckMenuConst::kLineHeight);
|
||||||
|
|
||||||
// we want to cap the deck titles to 15 characters to avoid overflowing deck names
|
// we want to cap the deck titles to 15 characters to avoid overflowing deck names
|
||||||
title = _(_title);
|
title = _(_title);
|
||||||
@@ -94,7 +94,7 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc
|
|||||||
else
|
else
|
||||||
titleFontScale = SCALE_NORMAL;
|
titleFontScale = SCALE_NORMAL;
|
||||||
|
|
||||||
mSelectionTargetY = selectionY = kVerticalMargin;
|
mSelectionTargetY = selectionY = DeckMenuConst::kVerticalMargin;
|
||||||
|
|
||||||
if (NULL == stars)
|
if (NULL == stars)
|
||||||
stars = NEW hgeParticleSystem(WResourceManager::Instance()->RetrievePSI("stars.psi", WResourceManager::Instance()->GetQuad("stars").get()));
|
stars = NEW hgeParticleSystem(WResourceManager::Instance()->RetrievePSI("stars.psi", WResourceManager::Instance()->GetQuad("stars").get()));
|
||||||
@@ -106,7 +106,7 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc
|
|||||||
float stringWidth = descriptionFont->GetStringWidth(detailedInfoString.c_str());
|
float stringWidth = descriptionFont->GetStringWidth(detailedInfoString.c_str());
|
||||||
float boxStartX = detailedInfoBoxX - stringWidth / 2 + 20;
|
float boxStartX = detailedInfoBoxX - stringWidth / 2 + 20;
|
||||||
|
|
||||||
dismissButton = NEW InteractiveButton( this, kDetailedInfoButtonId, Fonts::MAIN_FONT, detailedInfoString, boxStartX, detailedInfoBoxY, JGE_BTN_CANCEL);
|
dismissButton = NEW InteractiveButton( this, DeckMenuConst::kDetailedInfoButtonId, Fonts::MAIN_FONT, detailedInfoString, boxStartX, detailedInfoBoxY, JGE_BTN_CANCEL);
|
||||||
JGuiController::Add(dismissButton, true);
|
JGuiController::Add(dismissButton, true);
|
||||||
|
|
||||||
updateScroller();
|
updateScroller();
|
||||||
@@ -181,7 +181,7 @@ bool DeckMenu::showDetailsScreen()
|
|||||||
if (currentMenuItem)
|
if (currentMenuItem)
|
||||||
{
|
{
|
||||||
if (mAlwaysShowDetailsButton) return true;
|
if (mAlwaysShowDetailsButton) return true;
|
||||||
if (mShowDetailsScreen && currentMenuItem->getVictories() > DETAILED_INFO_THRESHOLD) return true;
|
if (mShowDetailsScreen && currentMenuItem->getVictories() > DeckMenuConst::DETAILED_INFO_THRESHOLD) return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@@ -189,10 +189,10 @@ bool DeckMenu::showDetailsScreen()
|
|||||||
|
|
||||||
void DeckMenu::initMenuItems()
|
void DeckMenu::initMenuItems()
|
||||||
{
|
{
|
||||||
float sY = mY + kVerticalMargin;
|
float sY = mY + DeckMenuConst::kVerticalMargin;
|
||||||
for (int i = startId; i < mCount; ++i)
|
for (int i = startId; i < mCount; ++i)
|
||||||
{
|
{
|
||||||
float y = mY + kVerticalMargin + i * kLineHeight;
|
float y = mY + DeckMenuConst::kVerticalMargin + i * DeckMenuConst::kLineHeight;
|
||||||
DeckMenuItem * currentMenuItem = static_cast<DeckMenuItem*> (mObjects[i]);
|
DeckMenuItem * currentMenuItem = static_cast<DeckMenuItem*> (mObjects[i]);
|
||||||
currentMenuItem->Relocate(mX, y);
|
currentMenuItem->Relocate(mX, y);
|
||||||
if (currentMenuItem->hasFocus()) sY = y;
|
if (currentMenuItem->hasFocus()) sY = y;
|
||||||
@@ -248,7 +248,7 @@ void DeckMenu::Render()
|
|||||||
{
|
{
|
||||||
if (i > mCount - 1) break;
|
if (i > mCount - 1) break;
|
||||||
DeckMenuItem *currentMenuItem = static_cast<DeckMenuItem*> (mObjects[i]);
|
DeckMenuItem *currentMenuItem = static_cast<DeckMenuItem*> (mObjects[i]);
|
||||||
if (currentMenuItem->getY() - kLineHeight * startId < mY + height - kLineHeight + 7)
|
if (currentMenuItem->getY() - DeckMenuConst::kLineHeight * startId < mY + height - DeckMenuConst::kLineHeight + 7)
|
||||||
{
|
{
|
||||||
// only load stats for visible items in the list
|
// only load stats for visible items in the list
|
||||||
DeckMetaData* metaData = currentMenuItem->getMetaData();
|
DeckMetaData* metaData = currentMenuItem->getMetaData();
|
||||||
@@ -293,6 +293,7 @@ void DeckMenu::Render()
|
|||||||
|
|
||||||
// fill in the description part of the screen
|
// fill in the description part of the screen
|
||||||
string text = wordWrap(_(currentMenuItem->getDescription()), descWidth, descriptionFont->mFontID );
|
string text = wordWrap(_(currentMenuItem->getDescription()), descWidth, descriptionFont->mFontID );
|
||||||
|
descriptionFont->SetColor(ARGB(255,255,255,255));
|
||||||
descriptionFont->DrawString(text.c_str(), descX, descY);
|
descriptionFont->DrawString(text.c_str(), descX, descY);
|
||||||
|
|
||||||
// fill in the statistical portion
|
// fill in the statistical portion
|
||||||
@@ -301,6 +302,7 @@ void DeckMenu::Render()
|
|||||||
ostringstream oss;
|
ostringstream oss;
|
||||||
oss << _("Deck: ") << currentMenuItem->getDeckName() << endl;
|
oss << _("Deck: ") << currentMenuItem->getDeckName() << endl;
|
||||||
oss << currentMenuItem->getDeckStatsSummary();
|
oss << currentMenuItem->getDeckStatsSummary();
|
||||||
|
descriptionFont->SetColor(ARGB(255,255,255,255));
|
||||||
descriptionFont->DrawString(oss.str(), statsX, statsY);
|
descriptionFont->DrawString(oss.str(), statsX, statsY);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -309,7 +311,7 @@ void DeckMenu::Render()
|
|||||||
}
|
}
|
||||||
else // reset the font color to be slightly muted
|
else // reset the font color to be slightly muted
|
||||||
mFont->SetColor(ARGB(150,255,255,255));
|
mFont->SetColor(ARGB(150,255,255,255));
|
||||||
currentMenuItem->RenderWithOffset(-kLineHeight * startId);
|
currentMenuItem->RenderWithOffset(-DeckMenuConst::kLineHeight * startId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -342,8 +344,8 @@ void DeckMenu::Update(float dt)
|
|||||||
selectionT += 3 * dt;
|
selectionT += 3 * dt;
|
||||||
selectionY += (mSelectionTargetY - selectionY) * 8 * dt;
|
selectionY += (mSelectionTargetY - selectionY) * 8 * dt;
|
||||||
|
|
||||||
float starsX = starsOffsetX + ((mWidth - 2 * kHorizontalMargin) * (1 + cos(selectionT)) / 2);
|
float starsX = starsOffsetX + ((mWidth - 2 * DeckMenuConst::kHorizontalMargin) * (1 + cos(selectionT)) / 2);
|
||||||
float starsY = selectionY + 5 * cos(selectionT * 2.35f) + kLineHeight / 2 - kLineHeight * startId;
|
float starsY = selectionY + 5 * cos(selectionT * 2.35f) + DeckMenuConst::kLineHeight / 2 - DeckMenuConst::kLineHeight * startId;
|
||||||
stars->MoveTo(starsX, starsY);
|
stars->MoveTo(starsX, starsY);
|
||||||
|
|
||||||
//
|
//
|
||||||
@@ -371,7 +373,7 @@ void DeckMenu::Update(float dt)
|
|||||||
void DeckMenu::Add(int id, const char * text, string desc, bool forceFocus, DeckMetaData * deckMetaData)
|
void DeckMenu::Add(int id, const char * text, string desc, bool forceFocus, DeckMetaData * deckMetaData)
|
||||||
{
|
{
|
||||||
DeckMenuItem * menuItem = NEW DeckMenuItem(this, id, fontId, text, 0,
|
DeckMenuItem * menuItem = NEW DeckMenuItem(this, id, fontId, text, 0,
|
||||||
mY + kVerticalMargin + mCount * kLineHeight, (mCount == 0), mAutoTranslate, deckMetaData);
|
mY + DeckMenuConst::kVerticalMargin + mCount * DeckMenuConst::kLineHeight, (mCount == 0), mAutoTranslate, deckMetaData);
|
||||||
Translator * t = Translator::GetInstance();
|
Translator * t = Translator::GetInstance();
|
||||||
map<string, string>::iterator it = t->deckValues.find(text);
|
map<string, string>::iterator it = t->deckValues.find(text);
|
||||||
string deckDescription = "";
|
string deckDescription = "";
|
||||||
@@ -384,7 +386,7 @@ void DeckMenu::Add(int id, const char * text, string desc, bool forceFocus, Deck
|
|||||||
menuItem->setDescription(deckDescription);
|
menuItem->setDescription(deckDescription);
|
||||||
|
|
||||||
JGuiController::Add(menuItem);
|
JGuiController::Add(menuItem);
|
||||||
if (mCount <= maxItems) mHeight += kLineHeight;
|
if (mCount <= maxItems) mHeight += DeckMenuConst::kLineHeight;
|
||||||
|
|
||||||
if (forceFocus)
|
if (forceFocus)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -271,22 +271,6 @@ void DeckStats::EndInstance()
|
|||||||
|
|
||||||
|
|
||||||
// StatsWrapper
|
// StatsWrapper
|
||||||
|
|
||||||
float noLandsProbInTurn[Constants::STATS_FOR_TURNS] = {0.0f};
|
|
||||||
float noCreaturesProbInTurn[Constants::STATS_FOR_TURNS] = {0.0f};
|
|
||||||
|
|
||||||
int countCardsPerCostAndColor[Constants::STATS_MAX_MANA_COST + 1][Constants::MTG_NB_COLORS + 1] = {{0,0}};
|
|
||||||
int countCreaturesPerCostAndColor[Constants::STATS_MAX_MANA_COST + 1][Constants::MTG_NB_COLORS + 1] = {{0,0}};
|
|
||||||
int countSpellsPerCostAndColor[Constants::STATS_MAX_MANA_COST + 1][Constants::MTG_NB_COLORS + 1] = {{0,0}};
|
|
||||||
|
|
||||||
int countCardsPerCost[Constants::STATS_MAX_MANA_COST + 1] = {0};
|
|
||||||
int countCreaturesPerCost[Constants::STATS_MAX_MANA_COST + 1] = {0};
|
|
||||||
int countSpellsPerCost[Constants::STATS_MAX_MANA_COST + 1] = {0};
|
|
||||||
int countLandsPerColor[Constants::MTG_NB_COLORS + 1] = {0};
|
|
||||||
int countBasicLandsPerColor[Constants::MTG_NB_COLORS + 1] = {0};
|
|
||||||
int countNonLandProducersPerColor[Constants::MTG_NB_COLORS + 1] = {0};
|
|
||||||
int totalCostPerColor[Constants::MTG_NB_COLORS + 1] = {0};
|
|
||||||
|
|
||||||
void StatsWrapper::initValues()
|
void StatsWrapper::initValues()
|
||||||
{
|
{
|
||||||
// initilize all member values to 0
|
// initilize all member values to 0
|
||||||
@@ -301,7 +285,24 @@ void StatsWrapper::initValues()
|
|||||||
avgManaCost = avgCreatureCost = avgSpellCost = 0.0f;
|
avgManaCost = avgCreatureCost = avgSpellCost = 0.0f;
|
||||||
|
|
||||||
countCreatures = countSpells = countInstants = countEnchantments = countSorceries = countArtifacts = 0;
|
countCreatures = countSpells = countInstants = countEnchantments = countSorceries = countArtifacts = 0;
|
||||||
|
|
||||||
|
//this works only with 0.0f on floats
|
||||||
|
memset(noLandsProbInTurn, 0.0f, sizeof(float) * Constants::STATS_FOR_TURNS);
|
||||||
|
memset(noCreaturesProbInTurn, 0.0f, sizeof(float) * Constants::STATS_FOR_TURNS);
|
||||||
|
|
||||||
|
memset(countCardsPerCost, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1));
|
||||||
|
memset(countCreaturesPerCost, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1));
|
||||||
|
memset(countSpellsPerCost, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1));
|
||||||
|
|
||||||
|
memset(countCardsPerCostAndColor, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)*(Constants::MTG_NB_COLORS + 1));
|
||||||
|
memset(countCreaturesPerCostAndColor, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)*(Constants::MTG_NB_COLORS + 1));
|
||||||
|
memset(countSpellsPerCostAndColor, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)*(Constants::MTG_NB_COLORS + 1));
|
||||||
|
|
||||||
|
memset(countLandsPerColor, 0, sizeof(int) * (Constants::MTG_NB_COLORS + 1));
|
||||||
|
memset(countBasicLandsPerColor, 0, sizeof(int) * (Constants::MTG_NB_COLORS + 1));
|
||||||
|
memset(countNonLandProducersPerColor, 0, sizeof(int) * (Constants::MTG_NB_COLORS + 1));
|
||||||
|
memset(totalCostPerColor, 0, sizeof(int) * (Constants::MTG_NB_COLORS + 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StatsWrapper::StatsWrapper(int deckId)
|
StatsWrapper::StatsWrapper(int deckId)
|
||||||
|
|||||||
@@ -383,8 +383,8 @@ void GameObserver::resetStartupGame()
|
|||||||
startupGameSerialized = "";
|
startupGameSerialized = "";
|
||||||
stream << *this;
|
stream << *this;
|
||||||
startupGameSerialized = stream.str();
|
startupGameSerialized = stream.str();
|
||||||
DebugTrace("startGame\n");
|
// DebugTrace("startGame\n");
|
||||||
DebugTrace(startupGameSerialized);
|
// DebugTrace(startupGameSerialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameObserver::startGame(GameType gtype, Rules * rules)
|
void GameObserver::startGame(GameType gtype, Rules * rules)
|
||||||
|
|||||||
@@ -1188,10 +1188,11 @@ bool GameOptionKeyBindings::read(string input)
|
|||||||
iss.get(*(s.rdbuf()), ',');
|
iss.get(*(s.rdbuf()), ',');
|
||||||
iss.get();
|
iss.get();
|
||||||
|
|
||||||
LocalKeySym local;
|
LocalKeySym local = 0;
|
||||||
char sep;
|
char sep = 0;
|
||||||
u32 button;
|
u32 button = 0;
|
||||||
s >> local >> sep >> button;
|
s >> local >> sep >> button;
|
||||||
|
|
||||||
if (':' != sep)
|
if (':' != sep)
|
||||||
return false;
|
return false;
|
||||||
assoc.push_back(make_pair(local, u32_to_button(button)));
|
assoc.push_back(make_pair(local, u32_to_button(button)));
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ enum ENUM_AWARDS_STATE
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
namespace
|
namespace GameStateAwardsConst
|
||||||
{
|
{
|
||||||
const int kBackToTrophiesID = 2;
|
const int kBackToTrophiesID = 2;
|
||||||
const int kBackToMainMenuID = 1;
|
const int kBackToMainMenuID = 1;
|
||||||
@@ -186,8 +186,8 @@ void GameStateAwards::Update(float dt)
|
|||||||
SAFE_DELETE(menu);
|
SAFE_DELETE(menu);
|
||||||
menu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), EXIT_AWARDS_MENU, this, Fonts::MENU_FONT, 50, 170);
|
menu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), EXIT_AWARDS_MENU, this, Fonts::MENU_FONT, 50, 170);
|
||||||
if (mState == STATE_DETAILS)
|
if (mState == STATE_DETAILS)
|
||||||
menu->Add(kBackToTrophiesID, "Back to Trophies");
|
menu->Add(GameStateAwardsConst::kBackToTrophiesID, "Back to Trophies");
|
||||||
menu->Add(kBackToMainMenuID, "Back to Main Menu");
|
menu->Add(GameStateAwardsConst::kBackToMainMenuID, "Back to Main Menu");
|
||||||
menu->Add(kCancelMenuID, "Cancel");
|
menu->Add(kCancelMenuID, "Cancel");
|
||||||
break;
|
break;
|
||||||
case JGE_BTN_PREV:
|
case JGE_BTN_PREV:
|
||||||
@@ -359,11 +359,11 @@ void GameStateAwards::ButtonPressed(int controllerId, int controlId)
|
|||||||
if (controllerId == EXIT_AWARDS_MENU)
|
if (controllerId == EXIT_AWARDS_MENU)
|
||||||
switch (controlId)
|
switch (controlId)
|
||||||
{
|
{
|
||||||
case kBackToMainMenuID:
|
case GameStateAwardsConst::kBackToMainMenuID:
|
||||||
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
||||||
showMenu = false;
|
showMenu = false;
|
||||||
break;
|
break;
|
||||||
case kBackToTrophiesID:
|
case GameStateAwardsConst::kBackToTrophiesID:
|
||||||
mState = STATE_LISTVIEW;
|
mState = STATE_LISTVIEW;
|
||||||
SAFE_DELETE(detailview);
|
SAFE_DELETE(detailview);
|
||||||
showMenu = false;
|
showMenu = false;
|
||||||
|
|||||||
@@ -23,22 +23,6 @@
|
|||||||
#include "AIPlayer.h"
|
#include "AIPlayer.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//!! helper function; this is probably handled somewhere in the code already.
|
|
||||||
// If not, should be placed in general library
|
|
||||||
void StringExplode(string str, string separator, vector<string>* results)
|
|
||||||
{
|
|
||||||
size_t found;
|
|
||||||
found = str.find_first_of(separator);
|
|
||||||
while (found != string::npos)
|
|
||||||
{
|
|
||||||
if (found > 0) results->push_back(str.substr(0, found));
|
|
||||||
str = str.substr(found + 1);
|
|
||||||
found = str.find_first_of(separator);
|
|
||||||
}
|
|
||||||
if (str.length() > 0) results->push_back(str);
|
|
||||||
}
|
|
||||||
|
|
||||||
GameStateDeckViewer::GameStateDeckViewer(GameApp* parent) :
|
GameStateDeckViewer::GameStateDeckViewer(GameApp* parent) :
|
||||||
GameState(parent, "deckeditor")
|
GameState(parent, "deckeditor")
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ GameStateMenu::GameStateMenu(GameApp* parent) :
|
|||||||
scroller = NULL;
|
scroller = NULL;
|
||||||
langChoices = false;
|
langChoices = false;
|
||||||
primitivesLoadCounter = -1;
|
primitivesLoadCounter = -1;
|
||||||
|
bgTexture = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
GameStateMenu::~GameStateMenu()
|
GameStateMenu::~GameStateMenu()
|
||||||
|
|||||||
@@ -7,13 +7,12 @@
|
|||||||
#include "SimplePad.h"
|
#include "SimplePad.h"
|
||||||
#include "Translate.h"
|
#include "Translate.h"
|
||||||
|
|
||||||
namespace
|
namespace GameStateOptionsConst
|
||||||
{
|
{
|
||||||
const int kSaveAndBackToMainMenuID = 1;
|
const int kSaveAndBackToMainMenuID = 1;
|
||||||
const int kBackToMainMenuID = 2;
|
const int kBackToMainMenuID = 2;
|
||||||
const int kNewProfileID = 4;
|
const int kNewProfileID = 4;
|
||||||
const int kReloadID = 5;
|
const int kReloadID = 5;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GameStateOptions::GameStateOptions(GameApp* parent) :
|
GameStateOptions::GameStateOptions(GameApp* parent) :
|
||||||
@@ -78,7 +77,7 @@ void GameStateOptions::Start()
|
|||||||
|
|
||||||
optionsList->Add(NEW WGuiSplit(cPrf, cThm));
|
optionsList->Add(NEW WGuiSplit(cPrf, cThm));
|
||||||
optionsList->Add(cStyle);
|
optionsList->Add(cStyle);
|
||||||
optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"), -102, kNewProfileID, this));
|
optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"), -102, GameStateOptionsConst::kNewProfileID, this));
|
||||||
|
|
||||||
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable Cheat Mode")));
|
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable Cheat Mode")));
|
||||||
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::OPTIMIZE_HAND, "Optimize Starting Hand")));
|
optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::OPTIMIZE_HAND, "Optimize Starting Hand")));
|
||||||
@@ -118,8 +117,8 @@ void GameStateOptions::Start()
|
|||||||
optionsTabs->Add(optionsList);
|
optionsTabs->Add(optionsList);
|
||||||
|
|
||||||
optionsMenu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), -102, this, Fonts::MAIN_FONT, 50, 170);
|
optionsMenu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), -102, this, Fonts::MAIN_FONT, 50, 170);
|
||||||
optionsMenu->Add(kBackToMainMenuID, "Back to Main Menu");
|
optionsMenu->Add(GameStateOptionsConst::kBackToMainMenuID, "Back to Main Menu");
|
||||||
optionsMenu->Add(kSaveAndBackToMainMenuID, "Save And Exit");
|
optionsMenu->Add(GameStateOptionsConst::kSaveAndBackToMainMenuID, "Save And Exit");
|
||||||
optionsMenu->Add(kCancelMenuID, "Cancel");
|
optionsMenu->Add(kCancelMenuID, "Cancel");
|
||||||
|
|
||||||
optionsTabs->Entering(JGE_BTN_NONE);
|
optionsTabs->Entering(JGE_BTN_NONE);
|
||||||
@@ -285,21 +284,21 @@ void GameStateOptions::ButtonPressed(int controllerId, int controlId)
|
|||||||
if (controllerId == -102)
|
if (controllerId == -102)
|
||||||
switch (controlId)
|
switch (controlId)
|
||||||
{
|
{
|
||||||
case kSaveAndBackToMainMenuID:
|
case GameStateOptionsConst::kSaveAndBackToMainMenuID:
|
||||||
mState = SAVE;
|
mState = SAVE;
|
||||||
break;
|
break;
|
||||||
//Set Audio volume
|
//Set Audio volume
|
||||||
case kBackToMainMenuID:
|
case GameStateOptionsConst::kBackToMainMenuID:
|
||||||
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
|
||||||
break;
|
break;
|
||||||
case kCancelMenuID:
|
case kCancelMenuID:
|
||||||
mState = SHOW_OPTIONS;
|
mState = SHOW_OPTIONS;
|
||||||
break;
|
break;
|
||||||
case kNewProfileID:
|
case GameStateOptionsConst::kNewProfileID:
|
||||||
options.keypadStart("", &newProfile);
|
options.keypadStart("", &newProfile);
|
||||||
options.keypadTitle("New Profile");
|
options.keypadTitle("New Profile");
|
||||||
break;
|
break;
|
||||||
case kReloadID:
|
case GameStateOptionsConst::kReloadID:
|
||||||
mReload = true;
|
mReload = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ GameStateShop::GameStateShop(GameApp* parent) :
|
|||||||
kCreditsString = _(kCreditsString);
|
kCreditsString = _(kCreditsString);
|
||||||
|
|
||||||
cycleCardsButton = NEW InteractiveButton(NULL, kCycleCardsButtonId, Fonts::MAIN_FONT, "New Cards", SCREEN_WIDTH_F - 80, SCREEN_HEIGHT_F - 20, JGE_BTN_PRI);
|
cycleCardsButton = NEW InteractiveButton(NULL, kCycleCardsButtonId, Fonts::MAIN_FONT, "New Cards", SCREEN_WIDTH_F - 80, SCREEN_HEIGHT_F - 20, JGE_BTN_PRI);
|
||||||
|
|
||||||
showCardListButton = NEW InteractiveButton(NULL, kShowCardListButtonId, Fonts::MAIN_FONT, "Show List", SCREEN_WIDTH_F - 150, SCREEN_HEIGHT_F - 20, JGE_BTN_SEC);
|
showCardListButton = NEW InteractiveButton(NULL, kShowCardListButtonId, Fonts::MAIN_FONT, "Show List", SCREEN_WIDTH_F - 150, SCREEN_HEIGHT_F - 20, JGE_BTN_SEC);
|
||||||
disablePurchase = false;
|
disablePurchase = false;
|
||||||
clearInput = false;
|
clearInput = false;
|
||||||
@@ -768,17 +768,21 @@ void GameStateShop::Render()
|
|||||||
r->FillRect(0, SCREEN_HEIGHT - 17, SCREEN_WIDTH, 17, ARGB(128,0,0,0));
|
r->FillRect(0, SCREEN_HEIGHT - 17, SCREEN_WIDTH, 17, ARGB(128,0,0,0));
|
||||||
std::ostringstream stream;
|
std::ostringstream stream;
|
||||||
stream << kCreditsString << playerdata->credits;
|
stream << kCreditsString << playerdata->credits;
|
||||||
mFont->SetColor(ARGB(255,255,255,255));
|
|
||||||
mFont->DrawString(stream.str(), 5, SCREEN_HEIGHT - 14);
|
|
||||||
|
|
||||||
#ifndef TOUCH_ENABLED
|
#ifndef TOUCH_ENABLED
|
||||||
float len = 4 + mFont->GetStringWidth(kOtherCardsString.c_str());
|
float len = 4 + mFont->GetStringWidth(kOtherCardsString.c_str());
|
||||||
r->RenderQuad(pspIcons[6].get(), SCREEN_WIDTH - len - 0.5 - 10, SCREEN_HEIGHT - 8, 0, kPspIconScaleFactor, kPspIconScaleFactor);
|
r->RenderQuad(pspIcons[6].get(), SCREEN_WIDTH - len - 0.5 - 10, SCREEN_HEIGHT - 8, 0, kPspIconScaleFactor, kPspIconScaleFactor);
|
||||||
mFont->DrawString(kOtherCardsString, SCREEN_WIDTH - len, SCREEN_HEIGHT - 14);
|
mFont->DrawString(kOtherCardsString, SCREEN_WIDTH - len, SCREEN_HEIGHT - 14);
|
||||||
#else
|
#else
|
||||||
|
#ifdef IOS
|
||||||
|
mFont->SetScale(1.2f); // for iOS devices.
|
||||||
|
#endif
|
||||||
|
|
||||||
enableButtons();
|
enableButtons();
|
||||||
#endif
|
#endif
|
||||||
|
mFont->SetColor(ARGB(255,255,255,255));
|
||||||
|
mFont->DrawString(stream.str(), 5, SCREEN_HEIGHT - 14);
|
||||||
|
|
||||||
mFont->SetColor(ARGB(255,255,255,0));
|
mFont->SetColor(ARGB(255,255,255,0));
|
||||||
mFont->DrawString(descPurchase(bigSync.getPos()).c_str(), SCREEN_WIDTH / 2, SCREEN_HEIGHT - 14, JGETEXT_CENTER);
|
mFont->DrawString(descPurchase(bigSync.getPos()).c_str(), SCREEN_WIDTH / 2, SCREEN_HEIGHT - 14, JGETEXT_CENTER);
|
||||||
mFont->SetColor(ARGB(255,255,255,255));
|
mFont->SetColor(ARGB(255,255,255,255));
|
||||||
|
|||||||
@@ -16,21 +16,21 @@ const float kZoom_level1 = 1.4f;
|
|||||||
const float kZoom_level2 = 2.2f;
|
const float kZoom_level2 = 2.2f;
|
||||||
const float kZoom_level3 = 2.7f;
|
const float kZoom_level3 = 2.7f;
|
||||||
|
|
||||||
struct True: public Exp
|
struct GuiCombatTrue: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(DamagerDamaged*, DamagerDamaged*)
|
static inline bool test(DamagerDamaged*, DamagerDamaged*)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct Left: public Exp
|
struct GuiCombatLeft: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(DamagerDamaged* ref, DamagerDamaged* test)
|
static inline bool test(DamagerDamaged* ref, DamagerDamaged* test)
|
||||||
{
|
{
|
||||||
return ref->y == test->y && ref->x > test->x && test->show;
|
return ref->y == test->y && ref->x > test->x && test->show;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
struct Right: public Exp
|
struct GuiCombatRight: public Exp
|
||||||
{
|
{
|
||||||
static inline bool test(DamagerDamaged* ref, DamagerDamaged* test)
|
static inline bool test(DamagerDamaged* ref, DamagerDamaged* test)
|
||||||
{
|
{
|
||||||
@@ -217,7 +217,7 @@ void GuiCombat::shiftLeft()
|
|||||||
case ATK:
|
case ATK:
|
||||||
{
|
{
|
||||||
DamagerDamaged* old = active;
|
DamagerDamaged* old = active;
|
||||||
active = closest<Left> (attackers, NULL, static_cast<AttackerDamaged*> (active));
|
active = closest<GuiCombatLeft> (attackers, NULL, static_cast<AttackerDamaged*> (active));
|
||||||
activeAtk = static_cast<AttackerDamaged*> (active);
|
activeAtk = static_cast<AttackerDamaged*> (active);
|
||||||
if (old != active)
|
if (old != active)
|
||||||
{
|
{
|
||||||
@@ -231,7 +231,7 @@ void GuiCombat::shiftLeft()
|
|||||||
case BLK:
|
case BLK:
|
||||||
{
|
{
|
||||||
DamagerDamaged* old = active;
|
DamagerDamaged* old = active;
|
||||||
active = closest<Left> (activeAtk->blockers, NULL, static_cast<DefenserDamaged*> (active));
|
active = closest<GuiCombatLeft> (activeAtk->blockers, NULL, static_cast<DefenserDamaged*> (active));
|
||||||
if (old != active)
|
if (old != active)
|
||||||
{
|
{
|
||||||
if (old)
|
if (old)
|
||||||
@@ -255,7 +255,7 @@ void GuiCombat::shiftRight( DamagerDamaged* oldActive )
|
|||||||
case BLK:
|
case BLK:
|
||||||
{
|
{
|
||||||
DamagerDamaged* old = active;
|
DamagerDamaged* old = active;
|
||||||
active = closest<Right> (activeAtk->blockers, NULL, static_cast<DefenserDamaged*> (active));
|
active = closest<GuiCombatRight> (activeAtk->blockers, NULL, static_cast<DefenserDamaged*> (active));
|
||||||
if (old != active)
|
if (old != active)
|
||||||
{
|
{
|
||||||
if (old)
|
if (old)
|
||||||
@@ -268,7 +268,7 @@ void GuiCombat::shiftRight( DamagerDamaged* oldActive )
|
|||||||
case ATK:
|
case ATK:
|
||||||
{
|
{
|
||||||
DamagerDamaged* old = active;
|
DamagerDamaged* old = active;
|
||||||
active = closest<Right> (attackers, NULL, static_cast<AttackerDamaged*> (active));
|
active = closest<GuiCombatRight> (attackers, NULL, static_cast<AttackerDamaged*> (active));
|
||||||
if (active == oldActive)
|
if (active == oldActive)
|
||||||
{
|
{
|
||||||
active = activeAtk = NULL;
|
active = activeAtk = NULL;
|
||||||
@@ -321,7 +321,7 @@ bool GuiCombat::CheckUserInput(JButton key)
|
|||||||
// position selected card
|
// position selected card
|
||||||
if (BLK == cursor_pos)
|
if (BLK == cursor_pos)
|
||||||
{
|
{
|
||||||
DamagerDamaged* selectedCard = closest<True> (activeAtk->blockers, NULL, static_cast<float> (x), static_cast<float> (y));
|
DamagerDamaged* selectedCard = closest<GuiCombatTrue> (activeAtk->blockers, NULL, static_cast<float> (x), static_cast<float> (y));
|
||||||
// find the index into the vector where the current selected card is.
|
// find the index into the vector where the current selected card is.
|
||||||
int c1 = 0, c2 = 0;
|
int c1 = 0, c2 = 0;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -526,7 +526,7 @@ int GuiCombat::resolve() // Returns the number of damage objects dealt this turn
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (dmg > 0 && ((!attacker->isBlocked()) || attacker->has(Constants::TRAMPLE)))
|
if (dmg > 0 && ((!attacker->isBlocked()) || attacker->has(Constants::TRAMPLE)))
|
||||||
stack->Add(NEW Damage(observer, (*it)->card, (Damageable*)attacker->isAttacking?(Damageable*)attacker->isAttacking:observer->opponent(), dmg, DAMAGE_COMBAT));
|
stack->Add(NEW Damage(observer, (*it)->card, (Damageable*)attacker->isAttacking?(Damageable*)attacker->isAttacking:observer->opponent(), dmg, Damage::DAMAGE_COMBAT));
|
||||||
|
|
||||||
for (vector<Damage>::iterator d = (*it)->damages.begin(); d != (*it)->damages.end(); ++d)
|
for (vector<Damage>::iterator d = (*it)->damages.begin(); d != (*it)->damages.end(); ++d)
|
||||||
stack->Add(NEW Damage(*d));
|
stack->Add(NEW Damage(*d));
|
||||||
|
|||||||
@@ -1,56 +0,0 @@
|
|||||||
#include "GuiMessageBox.h"
|
|
||||||
|
|
||||||
bool GuiMessageBox::CheckUserInput(JButton key)
|
|
||||||
{
|
|
||||||
if (mActionButton == key)
|
|
||||||
{
|
|
||||||
if (mObjects[mCurr] != NULL && mObjects[mCurr]->ButtonPressed())
|
|
||||||
{
|
|
||||||
if (mListener != NULL)
|
|
||||||
{
|
|
||||||
mListener->ButtonPressed(mId, mObjects[mCurr]->GetId());
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((PSP_CTRL_LEFT == key) || (PSP_CTRL_UP == key)) // || mEngine->GetAnalogY()<64)
|
|
||||||
{
|
|
||||||
int n = mCurr;
|
|
||||||
n--;
|
|
||||||
if (n < 0)
|
|
||||||
{
|
|
||||||
if ((mStyle & JGUI_STYLE_WRAPPING))
|
|
||||||
n = mCount - 1;
|
|
||||||
else
|
|
||||||
n = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(PSP_CTRL_UP))
|
|
||||||
{
|
|
||||||
mCurr = n;
|
|
||||||
mObjects[mCurr]->Entering();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if ((PSP_CTRL_RIGHT == key) || (PSP_CTRL_DOWN == key)) // || mEngine->GetAnalogY()>192)
|
|
||||||
{
|
|
||||||
int n = mCurr;
|
|
||||||
n++;
|
|
||||||
if (n > mCount - 1)
|
|
||||||
{
|
|
||||||
if ((mStyle & JGUI_STYLE_WRAPPING))
|
|
||||||
n = 0;
|
|
||||||
else
|
|
||||||
n = mCount - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (n != mCurr && mObjects[mCurr] != NULL && mObjects[mCurr]->Leaving(PSP_CTRL_DOWN))
|
|
||||||
{
|
|
||||||
mCurr = n;
|
|
||||||
mObjects[mCurr]->Entering();
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
@@ -2163,6 +2163,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
|
|||||||
return NEW AEquip(observer, id, card);
|
return NEW AEquip(observer, id, card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: deprecate this ability in favor of retarget
|
||||||
//Equipment (attach)
|
//Equipment (attach)
|
||||||
found = s.find("attach");
|
found = s.find("attach");
|
||||||
if (found != string::npos)
|
if (found != string::npos)
|
||||||
@@ -4476,7 +4477,7 @@ Player * MTGAbility::getPlayerFromDamageable(Damageable * target)
|
|||||||
if (!target)
|
if (!target)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
return ((MTGCardInstance *) target)->controller();
|
return ((MTGCardInstance *) target)->controller();
|
||||||
|
|
||||||
return (Player *) target;
|
return (Player *) target;
|
||||||
|
|||||||
@@ -336,13 +336,22 @@ void MTGAllCards::init()
|
|||||||
initCounters();
|
initCounters();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MTGAllCards::loadFolder(const string& folder, const string& filename )
|
void MTGAllCards::loadFolder(const string& infolder, const string& filename )
|
||||||
{
|
{
|
||||||
|
string folder = infolder;
|
||||||
|
|
||||||
|
// Make sure the base paths finish with a '/' or a '\'
|
||||||
|
if (! folder.empty()) {
|
||||||
|
string::iterator c = folder.end();//userPath.at(userPath.size()-1);
|
||||||
|
c--;
|
||||||
|
if ((*c != '/') && (*c != '\\'))
|
||||||
|
folder += '/';
|
||||||
|
}
|
||||||
|
|
||||||
vector<string> files = JFileSystem::GetInstance()->scanfolder(folder);
|
vector<string> files = JFileSystem::GetInstance()->scanfolder(folder);
|
||||||
|
|
||||||
if (!files.size())
|
if (!files.size())
|
||||||
{
|
{
|
||||||
DebugTrace("loadPrimitives:WARNING:Primitives folder is missing");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,7 +364,7 @@ void MTGAllCards::loadFolder(const string& folder, const string& filename )
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(JFileSystem::GetInstance()->DirExists(afile))
|
if(JFileSystem::GetInstance()->DirExists(afile))
|
||||||
loadFolder(string(afile).c_str(), filename);
|
loadFolder(afile, filename);
|
||||||
|
|
||||||
if (!JFileSystem::GetInstance()->FileExists(afile))
|
if (!JFileSystem::GetInstance()->FileExists(afile))
|
||||||
continue;
|
continue;
|
||||||
@@ -382,7 +391,10 @@ int MTGAllCards::load(const char * config_file, const char * set_name, int)
|
|||||||
std::string contents;
|
std::string contents;
|
||||||
izfstream file;
|
izfstream file;
|
||||||
if (!JFileSystem::GetInstance()->openForRead(file, config_file))
|
if (!JFileSystem::GetInstance()->openForRead(file, config_file))
|
||||||
|
{
|
||||||
|
DebugTrace("MTGAllCards::load: error loading: " << config_file);
|
||||||
return total_cards;
|
return total_cards;
|
||||||
|
}
|
||||||
|
|
||||||
string s;
|
string s;
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ void MTGGamePhase::Update(float)
|
|||||||
int newState = observer->getCurrentGamePhase();
|
int newState = observer->getCurrentGamePhase();
|
||||||
if (newState != currentState)
|
if (newState != currentState)
|
||||||
{
|
{
|
||||||
activeState = ACTIVE;
|
activity = Active;
|
||||||
animation = 4;
|
animation = 4;
|
||||||
currentState = newState;
|
currentState = newState;
|
||||||
}
|
}
|
||||||
@@ -28,18 +28,18 @@ void MTGGamePhase::Update(float)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
activeState = INACTIVE;
|
activity = Inactive;
|
||||||
animation = 0;
|
animation = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MTGGamePhase::NextGamePhase()
|
bool MTGGamePhase::NextGamePhase()
|
||||||
{
|
{
|
||||||
if (activeState == INACTIVE)
|
if (activity == Inactive)
|
||||||
{
|
{
|
||||||
if (observer->currentActionPlayer == observer->currentlyActing())
|
if (observer->currentActionPlayer == observer->currentlyActing())
|
||||||
{
|
{
|
||||||
activeState = ACTIVE;
|
activity = Active;
|
||||||
observer->userRequestNextGamePhase();
|
observer->userRequestNextGamePhase();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2700,7 +2700,7 @@ int MTGDeathtouchRule::receiveEvent(WEvent * event)
|
|||||||
if (!card)
|
if (!card)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (d->target->type_as_damageable != DAMAGEABLE_MTGCARDINSTANCE)
|
if (d->target->type_as_damageable != Damageable::DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
return 0;
|
return 0;
|
||||||
MTGCardInstance * _target = (MTGCardInstance *) (d->target);
|
MTGCardInstance * _target = (MTGCardInstance *) (d->target);
|
||||||
|
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
#include "MTGSpellStack.h"
|
|
||||||
|
|
||||||
MTGSpellStack::MTGSpellStack()
|
|
||||||
{
|
|
||||||
cursor = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MTGSpellStack::addSpell(Ability * ability)
|
|
||||||
{
|
|
||||||
cursor++;
|
|
||||||
spellStack[cursor] ability;
|
|
||||||
}
|
|
||||||
|
|
||||||
int MTGSpellStack::resolve()
|
|
||||||
{
|
|
||||||
if (cursor < 0)
|
|
||||||
return 0;
|
|
||||||
int result = cursor;
|
|
||||||
cursor--;
|
|
||||||
(spellStack[cursor + 1])->resolve();
|
|
||||||
return (result + 1);
|
|
||||||
}
|
|
||||||
@@ -424,7 +424,7 @@ int ManaCost::hasX()
|
|||||||
DebugTrace("Seems ManaCost was not properly initialized");
|
DebugTrace("Seems ManaCost was not properly initialized");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if(xColor > 0)
|
if (xColor > 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return cost[Constants::NB_Colors];
|
return cost[Constants::NB_Colors];
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "AllAbilities.h"
|
#include "AllAbilities.h"
|
||||||
|
|
||||||
REDamagePrevention::REDamagePrevention(MTGAbility * source, TargetChooser *tcSource, TargetChooser *tcTarget, int damage,
|
REDamagePrevention::REDamagePrevention(MTGAbility * source, TargetChooser *tcSource, TargetChooser *tcTarget, int damage,
|
||||||
bool oneShot, int typeOfDamage) :
|
bool oneShot, Damage::DamageType typeOfDamage) :
|
||||||
source(source), tcSource(tcSource), tcTarget(tcTarget), damage(damage), oneShot(oneShot), typeOfDamage(typeOfDamage)
|
source(source), tcSource(tcSource), tcTarget(tcTarget), damage(damage), oneShot(oneShot), typeOfDamage(typeOfDamage)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ WEvent * REDamagePrevention::replace(WEvent *event)
|
|||||||
WEventDamage * e = dynamic_cast<WEventDamage*> (event);
|
WEventDamage * e = dynamic_cast<WEventDamage*> (event);
|
||||||
if (!e) return event;
|
if (!e) return event;
|
||||||
Damage *d = e->damage;
|
Damage *d = e->damage;
|
||||||
if (d->typeOfDamage != typeOfDamage && typeOfDamage != DAMAGE_ALL_TYPES) return event;
|
if (d->typeOfDamage != typeOfDamage && typeOfDamage != Damage::DAMAGE_ALL_TYPES) return event;
|
||||||
if ((!tcSource || tcSource->canTarget(d->source)) && (!tcTarget || tcTarget->canTarget(d->target)))
|
if ((!tcSource || tcSource->canTarget(d->source)) && (!tcTarget || tcTarget->canTarget(d->target)))
|
||||||
{
|
{
|
||||||
if (damage == -1)
|
if (damage == -1)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#include "GameApp.h"
|
#include "GameApp.h"
|
||||||
#include "Translate.h"
|
#include "Translate.h"
|
||||||
|
|
||||||
namespace
|
namespace SimpleMenuConst
|
||||||
{
|
{
|
||||||
const float kPoleWidth = 7;
|
const float kPoleWidth = 7;
|
||||||
const float kVerticalMargin = 20;
|
const float kVerticalMargin = 20;
|
||||||
@@ -38,7 +38,7 @@ SimpleMenu::SimpleMenu(JGE* jge, WResourceManager* resourceManager, int id, JGui
|
|||||||
{
|
{
|
||||||
autoTranslate = true;
|
autoTranslate = true;
|
||||||
isMultipleChoice = false;
|
isMultipleChoice = false;
|
||||||
mHeight = 2 * kVerticalMargin;
|
mHeight = 2 * SimpleMenuConst::kVerticalMargin;
|
||||||
mWidth = 0;
|
mWidth = 0;
|
||||||
mX = x;
|
mX = x;
|
||||||
mY = y;
|
mY = y;
|
||||||
@@ -48,7 +48,7 @@ SimpleMenu::SimpleMenu(JGE* jge, WResourceManager* resourceManager, int id, JGui
|
|||||||
selectionT = 0;
|
selectionT = 0;
|
||||||
timeOpen = 0;
|
timeOpen = 0;
|
||||||
mClosed = false;
|
mClosed = false;
|
||||||
selectionTargetY = selectionY = y + kVerticalMargin;
|
selectionTargetY = selectionY = y + SimpleMenuConst::kVerticalMargin;
|
||||||
|
|
||||||
if(resourceManager)
|
if(resourceManager)
|
||||||
{
|
{
|
||||||
@@ -61,7 +61,7 @@ SimpleMenu::SimpleMenu(JGE* jge, WResourceManager* resourceManager, int id, JGui
|
|||||||
spadeL = resourceManager->RetrieveQuad("spade_ul.png", 0, 0, 0, 0, "spade_ul", RETRIEVE_MANAGE);
|
spadeL = resourceManager->RetrieveQuad("spade_ul.png", 0, 0, 0, 0, "spade_ul", RETRIEVE_MANAGE);
|
||||||
spadeR = resourceManager->RetrieveQuad("spade_ur.png", 0, 0, 0, 0, "spade_ur", RETRIEVE_MANAGE);
|
spadeR = resourceManager->RetrieveQuad("spade_ur.png", 0, 0, 0, 0, "spade_ur", RETRIEVE_MANAGE);
|
||||||
jewel.reset(NEW JQuad(jewelTex, 1, 1, 3, 3));
|
jewel.reset(NEW JQuad(jewelTex, 1, 1, 3, 3));
|
||||||
side = resourceManager->RetrieveQuad("menuside.png", 1, 1, 1, kPoleWidth, "menuside", RETRIEVE_MANAGE);
|
side = resourceManager->RetrieveQuad("menuside.png", 1, 1, 1, SimpleMenuConst::kPoleWidth, "menuside", RETRIEVE_MANAGE);
|
||||||
|
|
||||||
stars = NEW hgeParticleSystem(resourceManager->RetrievePSI("stars.psi", resourceManager->GetQuad("stars").get()));
|
stars = NEW hgeParticleSystem(resourceManager->RetrievePSI("stars.psi", resourceManager->GetQuad("stars").get()));
|
||||||
|
|
||||||
@@ -78,16 +78,16 @@ void SimpleMenu::drawHorzPole(float x, float y, float width)
|
|||||||
{
|
{
|
||||||
JRenderer* renderer = JRenderer::GetInstance();
|
JRenderer* renderer = JRenderer::GetInstance();
|
||||||
|
|
||||||
float leftXOffset = (spadeR->mWidth - kPoleWidth) / 2;
|
float leftXOffset = (spadeR->mWidth - SimpleMenuConst::kPoleWidth) / 2;
|
||||||
float rightXOffset = leftXOffset;
|
float rightXOffset = leftXOffset;
|
||||||
float yOffset = leftXOffset;
|
float yOffset = leftXOffset;
|
||||||
if (spadeR->mWidth != spadeR->mHeight)
|
if (spadeR->mWidth != spadeR->mHeight)
|
||||||
{
|
{
|
||||||
//We have a weird case to deal with in the "Classic" theme, the spades graphics need to be aligned specifically,
|
//We have a weird case to deal with in the "Classic" theme, the spades graphics need to be aligned specifically,
|
||||||
// While the ones in the "Final Saga" theme need to be centered
|
// While the ones in the "Final Saga" theme need to be centered
|
||||||
leftXOffset = kSpadeWidthOffset;
|
leftXOffset = SimpleMenuConst::kSpadeWidthOffset;
|
||||||
yOffset = kSpadeHeightOffset;
|
yOffset = SimpleMenuConst::kSpadeHeightOffset;
|
||||||
rightXOffset = kSpadeRightBottomOffset;
|
rightXOffset = SimpleMenuConst::kSpadeRightBottomOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer->RenderQuad(side.get(), x, y, 0, width);
|
renderer->RenderQuad(side.get(), x, y, 0, width);
|
||||||
@@ -104,23 +104,23 @@ void SimpleMenu::drawVertPole(float x, float y, float height)
|
|||||||
{
|
{
|
||||||
JRenderer* renderer = JRenderer::GetInstance();
|
JRenderer* renderer = JRenderer::GetInstance();
|
||||||
|
|
||||||
float xOffset = (spadeR->mWidth - kPoleWidth) / 2;
|
float xOffset = (spadeR->mWidth - SimpleMenuConst::kPoleWidth) / 2;
|
||||||
float topYOffset = xOffset;
|
float topYOffset = xOffset;
|
||||||
float bottomYOffset = xOffset;
|
float bottomYOffset = xOffset;
|
||||||
if (spadeR->mWidth != spadeR->mHeight)
|
if (spadeR->mWidth != spadeR->mHeight)
|
||||||
{
|
{
|
||||||
//We have a weird case to deal with in the "Classic" theme, the spades graphics need to be aligned specifically,
|
//We have a weird case to deal with in the "Classic" theme, the spades graphics need to be aligned specifically,
|
||||||
// While the ones in the "Final Saga" theme need to be centered
|
// While the ones in the "Final Saga" theme need to be centered
|
||||||
xOffset = kSpadeHeightOffset;
|
xOffset = SimpleMenuConst::kSpadeHeightOffset;
|
||||||
topYOffset = kSpadeWidthOffset;
|
topYOffset = SimpleMenuConst::kSpadeWidthOffset;
|
||||||
bottomYOffset = kSpadeRightBottomOffset;
|
bottomYOffset = SimpleMenuConst::kSpadeRightBottomOffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
renderer->RenderQuad(side.get(), x + kPoleWidth, y, M_PI / 2, height);
|
renderer->RenderQuad(side.get(), x + SimpleMenuConst::kPoleWidth, y, M_PI / 2, height);
|
||||||
spadeR->SetHFlip(true);
|
spadeR->SetHFlip(true);
|
||||||
spadeL->SetHFlip(false);
|
spadeL->SetHFlip(false);
|
||||||
renderer->RenderQuad(spadeR.get(), x + kPoleWidth + xOffset, y - topYOffset, M_PI / 2);
|
renderer->RenderQuad(spadeR.get(), x + SimpleMenuConst::kPoleWidth + xOffset, y - topYOffset, M_PI / 2);
|
||||||
renderer->RenderQuad(spadeL.get(), x + kPoleWidth + xOffset, y + height - bottomYOffset, M_PI / 2);
|
renderer->RenderQuad(spadeL.get(), x + SimpleMenuConst::kPoleWidth + xOffset, y + height - bottomYOffset, M_PI / 2);
|
||||||
|
|
||||||
renderer->RenderQuad(jewel.get(), x - 1, y - 1);
|
renderer->RenderQuad(jewel.get(), x - 1, y - 1);
|
||||||
renderer->RenderQuad(jewel.get(), x - 1, y + height - 1);
|
renderer->RenderQuad(jewel.get(), x - 1, y + height - 1);
|
||||||
@@ -133,7 +133,7 @@ void SimpleMenu::Render()
|
|||||||
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
WFont * mFont = WResourceManager::Instance()->GetWFont(fontId);
|
||||||
if (0 == mWidth)
|
if (0 == mWidth)
|
||||||
{
|
{
|
||||||
float sY = mY + kVerticalMargin;
|
float sY = mY + SimpleMenuConst::kVerticalMargin;
|
||||||
|
|
||||||
for (int i = 0; i < mCount; ++i)
|
for (int i = 0; i < mCount; ++i)
|
||||||
{
|
{
|
||||||
@@ -146,7 +146,7 @@ void SimpleMenu::Render()
|
|||||||
if ((!title.empty()) && (mWidth < titleFont->GetStringWidth(title.c_str())))
|
if ((!title.empty()) && (mWidth < titleFont->GetStringWidth(title.c_str())))
|
||||||
mWidth = titleFont->GetStringWidth(title.c_str());
|
mWidth = titleFont->GetStringWidth(title.c_str());
|
||||||
titleFont->SetScale(scaleFactor);
|
titleFont->SetScale(scaleFactor);
|
||||||
mWidth += 2 * kHorizontalMargin;
|
mWidth += 2 * SimpleMenuConst::kHorizontalMargin;
|
||||||
|
|
||||||
if (mCenterHorizontal)
|
if (mCenterHorizontal)
|
||||||
mX = (SCREEN_WIDTH_F - mWidth) / 2;
|
mX = (SCREEN_WIDTH_F - mWidth) / 2;
|
||||||
@@ -156,7 +156,7 @@ void SimpleMenu::Render()
|
|||||||
|
|
||||||
for (int i = 0; i < mCount; ++i)
|
for (int i = 0; i < mCount; ++i)
|
||||||
{
|
{
|
||||||
float y = mY + kVerticalMargin + i * kLineHeight;
|
float y = mY + SimpleMenuConst::kVerticalMargin + i * SimpleMenuConst::kLineHeight;
|
||||||
SimpleMenuItem * smi = static_cast<SimpleMenuItem*> (mObjects[i]);
|
SimpleMenuItem * smi = static_cast<SimpleMenuItem*> (mObjects[i]);
|
||||||
smi->Relocate(mX + mWidth / 2, y);
|
smi->Relocate(mX + mWidth / 2, y);
|
||||||
if (smi->hasFocus()) sY = y;
|
if (smi->hasFocus()) sY = y;
|
||||||
@@ -171,7 +171,7 @@ void SimpleMenu::Render()
|
|||||||
float height = mHeight;
|
float height = mHeight;
|
||||||
if (timeOpen < 1) height *= timeOpen > 0 ? timeOpen : -timeOpen;
|
if (timeOpen < 1) height *= timeOpen > 0 ? timeOpen : -timeOpen;
|
||||||
|
|
||||||
float heightPadding = kLineHeight/2; // this to reduce the bottom padding of the menu
|
float heightPadding = SimpleMenuConst::kLineHeight/2; // this to reduce the bottom padding of the menu
|
||||||
renderer->FillRect(mX, mY, mWidth, height - heightPadding, ARGB(180,0,0,0));
|
renderer->FillRect(mX, mY, mWidth, height - heightPadding, ARGB(180,0,0,0));
|
||||||
|
|
||||||
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
|
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
|
||||||
@@ -200,8 +200,8 @@ void SimpleMenu::Render()
|
|||||||
{
|
{
|
||||||
if (i > mCount - 1) break;
|
if (i > mCount - 1) break;
|
||||||
SimpleMenuItem *currentMenuItem = static_cast<SimpleMenuItem*>(mObjects[i]);
|
SimpleMenuItem *currentMenuItem = static_cast<SimpleMenuItem*>(mObjects[i]);
|
||||||
float currentY = currentMenuItem->getY() - kLineHeight * startId;
|
float currentY = currentMenuItem->getY() - SimpleMenuConst::kLineHeight * startId;
|
||||||
float menuBottomEdge = mY + height - kLineHeight + 7;
|
float menuBottomEdge = mY + height - SimpleMenuConst::kLineHeight + 7;
|
||||||
if (currentY < menuBottomEdge)
|
if (currentY < menuBottomEdge)
|
||||||
{
|
{
|
||||||
if (currentMenuItem->hasFocus())
|
if (currentMenuItem->hasFocus())
|
||||||
@@ -214,7 +214,7 @@ void SimpleMenu::Render()
|
|||||||
{
|
{
|
||||||
mFont->SetColor(ARGB(150,255,255,255));
|
mFont->SetColor(ARGB(150,255,255,255));
|
||||||
}
|
}
|
||||||
(static_cast<SimpleMenuItem*> (mObjects[i]))->RenderWithOffset(-kLineHeight * startId);
|
(static_cast<SimpleMenuItem*> (mObjects[i]))->RenderWithOffset(-SimpleMenuConst::kLineHeight * startId);
|
||||||
}
|
}
|
||||||
mFont->SetScale(SCALE_NORMAL);
|
mFont->SetScale(SCALE_NORMAL);
|
||||||
}
|
}
|
||||||
@@ -244,8 +244,8 @@ bool SimpleMenu::CheckUserInput(JButton key)
|
|||||||
if (mObjects.size())
|
if (mObjects.size())
|
||||||
{
|
{
|
||||||
float top, left;
|
float top, left;
|
||||||
float menuTopEdge = mY + kLineHeight;
|
float menuTopEdge = mY + SimpleMenuConst::kLineHeight;
|
||||||
float menuBottomEdge = mY + mHeight - (kLineHeight/2);
|
float menuBottomEdge = mY + mHeight - (SimpleMenuConst::kLineHeight/2);
|
||||||
|
|
||||||
if (y < menuTopEdge)
|
if (y < menuTopEdge)
|
||||||
n = (mCurr - 1) > 0 ? mCurr -1 : 0;
|
n = (mCurr - 1) > 0 ? mCurr -1 : 0;
|
||||||
@@ -257,7 +257,7 @@ bool SimpleMenu::CheckUserInput(JButton key)
|
|||||||
{
|
{
|
||||||
if (mObjects[i]->getTopLeft(top, left))
|
if (mObjects[i]->getTopLeft(top, left))
|
||||||
{
|
{
|
||||||
if ( (y > top) && (y <= (top + kLineHeight)) )
|
if ( (y > top) && (y <= (top + SimpleMenuConst::kLineHeight)) )
|
||||||
n = i;
|
n = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -308,8 +308,8 @@ void SimpleMenu::Update(float dt)
|
|||||||
selectionT += 3 * dt;
|
selectionT += 3 * dt;
|
||||||
selectionY += (selectionTargetY - selectionY) * 8 * dt;
|
selectionY += (selectionTargetY - selectionY) * 8 * dt;
|
||||||
if(stars)
|
if(stars)
|
||||||
stars->MoveTo(mX + kHorizontalMargin + ((mWidth - 2 * kHorizontalMargin) * (1 + cos(selectionT)) / 2), selectionY + 5 * cos(
|
stars->MoveTo(mX + SimpleMenuConst::kHorizontalMargin + ((mWidth - 2 * SimpleMenuConst::kHorizontalMargin) * (1 + cos(selectionT)) / 2), selectionY + 5 * cos(
|
||||||
selectionT * 2.35f) + kLineHeight / 2 - kLineHeight * startId);
|
selectionT * 2.35f) + SimpleMenuConst::kLineHeight / 2 - SimpleMenuConst::kLineHeight * startId);
|
||||||
if (timeOpen < 0)
|
if (timeOpen < 0)
|
||||||
{
|
{
|
||||||
timeOpen += dt * 10;
|
timeOpen += dt * 10;
|
||||||
@@ -330,12 +330,12 @@ void SimpleMenu::Update(float dt)
|
|||||||
|
|
||||||
void SimpleMenu::Add(int id, const char * text, string desc, bool forceFocus)
|
void SimpleMenu::Add(int id, const char * text, string desc, bool forceFocus)
|
||||||
{
|
{
|
||||||
SimpleMenuItem * smi = NEW SimpleMenuItem(this, id, fontId, text, 0, mY + kVerticalMargin + mCount * kLineHeight,
|
SimpleMenuItem * smi = NEW SimpleMenuItem(this, id, fontId, text, 0, mY + SimpleMenuConst::kVerticalMargin + mCount * SimpleMenuConst::kLineHeight,
|
||||||
(mCount == 0), autoTranslate);
|
(mCount == 0), autoTranslate);
|
||||||
|
|
||||||
smi->setDescription(desc);
|
smi->setDescription(desc);
|
||||||
JGuiController::Add(smi);
|
JGuiController::Add(smi);
|
||||||
if (mCount <= maxItems) mHeight += kLineHeight;
|
if (mCount <= maxItems) mHeight += SimpleMenuConst::kLineHeight;
|
||||||
if (forceFocus)
|
if (forceFocus)
|
||||||
{
|
{
|
||||||
mObjects[mCurr]->Leaving(JGE_BTN_DOWN);
|
mObjects[mCurr]->Leaving(JGE_BTN_DOWN);
|
||||||
|
|||||||
@@ -294,13 +294,13 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
string attribute;
|
string attribute;
|
||||||
if (found2 != string::npos)
|
if (found2 != string::npos)
|
||||||
{
|
{
|
||||||
cd->mode = CD_OR;
|
cd->mode = CardDescriptor::CD_OR;
|
||||||
attribute = attributes.substr(0, found2);
|
attribute = attributes.substr(0, found2);
|
||||||
attributes = attributes.substr(found2 + 1);
|
attributes = attributes.substr(found2 + 1);
|
||||||
}
|
}
|
||||||
else if (foundAnd != string::npos)
|
else if (foundAnd != string::npos)
|
||||||
{
|
{
|
||||||
cd->mode = CD_AND;
|
cd->mode = CardDescriptor::CD_AND;
|
||||||
attribute = attributes.substr(0, foundAnd);
|
attribute = attributes.substr(0, foundAnd);
|
||||||
attributes = attributes.substr(foundAnd + 1);
|
attributes = attributes.substr(foundAnd + 1);
|
||||||
}
|
}
|
||||||
@@ -550,7 +550,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
else
|
else
|
||||||
cd->colors = card->colors;
|
cd->colors = card->colors;
|
||||||
|
|
||||||
cd->mode = CD_OR;
|
cd->mode = CardDescriptor::CD_OR;
|
||||||
}
|
}
|
||||||
else if( CDtype.find("types") != string::npos )
|
else if( CDtype.find("types") != string::npos )
|
||||||
{
|
{
|
||||||
@@ -572,7 +572,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
cd->removeType("creature");
|
cd->removeType("creature");
|
||||||
cd->removeType("planeswalker");
|
cd->removeType("planeswalker");
|
||||||
cd->removeType("tribal");
|
cd->removeType("tribal");
|
||||||
cd->mode = CD_OR;
|
cd->mode = CardDescriptor::CD_OR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (attribute.find("counter") != string::npos)
|
else if (attribute.find("counter") != string::npos)
|
||||||
@@ -629,7 +629,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
{
|
{
|
||||||
cd->SetExclusionColor(cid);
|
cd->SetExclusionColor(cid);
|
||||||
}
|
}
|
||||||
cd->mode = CD_OR;
|
cd->mode = CardDescriptor::CD_OR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (attribute.find("chosencolor") != string::npos)
|
if (attribute.find("chosencolor") != string::npos)
|
||||||
@@ -685,7 +685,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nbminuses)
|
if (nbminuses)
|
||||||
cd->mode = CD_AND;
|
cd->mode = CardDescriptor::CD_AND;
|
||||||
typeName = typeName.substr(0, found);
|
typeName = typeName.substr(0, found);
|
||||||
}
|
}
|
||||||
if (cd)
|
if (cd)
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ int TestSuiteAI::Act(float)
|
|||||||
timer = 0;
|
timer = 0;
|
||||||
|
|
||||||
string action = suite->getNextAction();
|
string action = suite->getNextAction();
|
||||||
observer->mLayers->stackLayer()->Dump();
|
// observer->mLayers->stackLayer()->Dump();
|
||||||
DebugTrace("TESTSUITE command: " << action);
|
DebugTrace("TESTSUITE command: " << action);
|
||||||
|
|
||||||
if (observer->mLayers->stackLayer()->askIfWishesToInterrupt == this)
|
if (observer->mLayers->stackLayer()->askIfWishesToInterrupt == this)
|
||||||
@@ -433,6 +433,15 @@ void TestSuiteGame::assertGame()
|
|||||||
Log("<span class=\"success\">==Test Succesful !==</span>");
|
Log("<span class=\"success\">==Test Succesful !==</span>");
|
||||||
else
|
else
|
||||||
Log("<span class=\"error\">==Test Failed !==</span>");
|
Log("<span class=\"error\">==Test Failed !==</span>");
|
||||||
|
#ifdef CAPTURE_STDERR
|
||||||
|
if (error)
|
||||||
|
{
|
||||||
|
OutputCapturer::debugAndClear();
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
OutputCapturer::clear();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
mMutex.unlock();
|
mMutex.unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -585,6 +594,9 @@ void TestSuite::ThreadProc(void* inParam)
|
|||||||
{
|
{
|
||||||
LOG("Entering TestSuite::ThreadProc");
|
LOG("Entering TestSuite::ThreadProc");
|
||||||
TestSuite* instance = reinterpret_cast<TestSuite*>(inParam);
|
TestSuite* instance = reinterpret_cast<TestSuite*>(inParam);
|
||||||
|
#ifdef CAPTURE_STDERR
|
||||||
|
OutputCapturer::debugAndClear();
|
||||||
|
#endif
|
||||||
if (instance)
|
if (instance)
|
||||||
{
|
{
|
||||||
string filename;
|
string filename;
|
||||||
@@ -611,7 +623,7 @@ void TestSuite::ThreadProc(void* inParam)
|
|||||||
int TestSuite::run()
|
int TestSuite::run()
|
||||||
{
|
{
|
||||||
mProcessing = true;
|
mProcessing = true;
|
||||||
loadNext();
|
// loadNext();
|
||||||
ThreadProc(this);
|
ThreadProc(this);
|
||||||
|
|
||||||
return nbFailed + nbAIFailed;
|
return nbFailed + nbAIFailed;
|
||||||
|
|||||||
@@ -455,7 +455,6 @@
|
|||||||
<ClInclude Include="include\CacheEngine.h" />
|
<ClInclude Include="include\CacheEngine.h" />
|
||||||
<ClInclude Include="include\CardDescriptor.h" />
|
<ClInclude Include="include\CardDescriptor.h" />
|
||||||
<ClInclude Include="include\CardDisplay.h" />
|
<ClInclude Include="include\CardDisplay.h" />
|
||||||
<ClInclude Include="include\CardEffect.h" />
|
|
||||||
<ClInclude Include="include\CardGui.h" />
|
<ClInclude Include="include\CardGui.h" />
|
||||||
<ClInclude Include="include\CardPrimitive.h" />
|
<ClInclude Include="include\CardPrimitive.h" />
|
||||||
<ClInclude Include="include\CardSelector.h" />
|
<ClInclude Include="include\CardSelector.h" />
|
||||||
@@ -517,7 +516,6 @@
|
|||||||
<ClInclude Include="include\NetworkPlayer.h" />
|
<ClInclude Include="include\NetworkPlayer.h" />
|
||||||
<ClInclude Include="include\ObjectAnalytics.h" />
|
<ClInclude Include="include\ObjectAnalytics.h" />
|
||||||
<ClInclude Include="include\OptionItem.h" />
|
<ClInclude Include="include\OptionItem.h" />
|
||||||
<ClInclude Include="include\OSD.h" />
|
|
||||||
<ClInclude Include="include\PhaseRing.h" />
|
<ClInclude Include="include\PhaseRing.h" />
|
||||||
<ClInclude Include="include\Player.h" />
|
<ClInclude Include="include\Player.h" />
|
||||||
<ClInclude Include="include\PlayerData.h" />
|
<ClInclude Include="include\PlayerData.h" />
|
||||||
|
|||||||
@@ -363,9 +363,6 @@
|
|||||||
<ClInclude Include="include\CardDisplay.h">
|
<ClInclude Include="include\CardDisplay.h">
|
||||||
<Filter>inc</Filter>
|
<Filter>inc</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\CardEffect.h">
|
|
||||||
<Filter>inc</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="include\CardGui.h">
|
<ClInclude Include="include\CardGui.h">
|
||||||
<Filter>inc</Filter>
|
<Filter>inc</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
@@ -528,9 +525,6 @@
|
|||||||
<ClInclude Include="include\OptionItem.h">
|
<ClInclude Include="include\OptionItem.h">
|
||||||
<Filter>inc</Filter>
|
<Filter>inc</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="include\OSD.h">
|
|
||||||
<Filter>inc</Filter>
|
|
||||||
</ClInclude>
|
|
||||||
<ClInclude Include="include\PhaseRing.h">
|
<ClInclude Include="include\PhaseRing.h">
|
||||||
<Filter>inc</Filter>
|
<Filter>inc</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
|||||||
+50
-28
@@ -1,9 +1,28 @@
|
|||||||
# Add more folders to ship with the application, here
|
# Add more folders to ship with the application, here
|
||||||
folder_01.source = qml/QmlWagic
|
addExclusiveBuilds(graphics, Graphics, console, Console)
|
||||||
folder_01.target = /usr/share
|
CONFIG(console, graphics|console){
|
||||||
DEPLOYMENTFOLDERS = folder_01
|
QT += core network
|
||||||
|
QT -= gui
|
||||||
|
|
||||||
|
DEFINES += CONSOLE_CONFIG
|
||||||
|
CONFIG += console
|
||||||
|
CONFIG -= app_bundle
|
||||||
|
DEFINES += TESTSUITE
|
||||||
|
}
|
||||||
|
else:CONFIG(graphics, graphics|console){
|
||||||
|
folder_01.source = qml/QmlWagic
|
||||||
|
folder_01.target = /usr/share
|
||||||
|
DEPLOYMENTFOLDERS = folder_01
|
||||||
|
QT += core gui opengl network
|
||||||
|
#maemo5:DEFINES += QT_WIDGET
|
||||||
|
DEFINES += QT_WIDGET
|
||||||
|
unix:!symbian:INCLUDEPATH += /usr/include/GL
|
||||||
|
|
||||||
|
# Please do not modify the following two lines. Required for deployment.
|
||||||
|
!maemo5:include(qml/qmlapplicationviewer/qmlapplicationviewer.pri)
|
||||||
|
!maemo5:qtcAddDeployment()
|
||||||
|
}
|
||||||
|
|
||||||
QT += core gui opengl network
|
|
||||||
#!android:!symbian:QT += phonon
|
#!android:!symbian:QT += phonon
|
||||||
maemo5:QT += dbus
|
maemo5:QT += dbus
|
||||||
|
|
||||||
@@ -15,24 +34,19 @@ unix|macx:QMAKE_CXXFLAGS += -Wno-unused-parameter
|
|||||||
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-but-set-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-but-set-variable
|
||||||
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-value
|
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-value
|
||||||
#unix|macx:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror
|
unix|macx:QMAKE_CXXFLAGS += -Wno-unused-local-typedefs
|
||||||
|
unix|macx:!maemo5:!symbian:QMAKE_CXXFLAGS += -Werror
|
||||||
|
|
||||||
windows:DEFINES += _CRT_SECURE_NO_WARNINGS
|
windows:DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||||
unix|macx:DEFINES += LINUX
|
unix|macx:DEFINES += LINUX
|
||||||
CONFIG(debug, debug|release) {
|
CONFIG(debug, debug|release) {
|
||||||
DEFINES += _DEBUG
|
DEFINES += _DEBUG
|
||||||
}
|
}
|
||||||
|
|
||||||
CONFIG(testsuite)
|
|
||||||
{
|
|
||||||
DEFINES += TESTSUITE
|
|
||||||
}
|
|
||||||
#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
|
||||||
#maemo5:DEFINES += QT_WIDGET
|
|
||||||
DEFINES += QT_WIDGET
|
|
||||||
DEFINES += NETWORK_SUPPORT
|
DEFINES += NETWORK_SUPPORT
|
||||||
|
|
||||||
windows:INCLUDEPATH += ../../JGE/Dependencies/include
|
windows:INCLUDEPATH += ../../JGE/Dependencies/include
|
||||||
@@ -45,7 +59,6 @@ windows{
|
|||||||
DEFINES += WIN32
|
DEFINES += WIN32
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unix:!symbian:INCLUDEPATH += /usr/include/GL
|
|
||||||
macx:INCLUDEPATH += /opt/include
|
macx:INCLUDEPATH += /opt/include
|
||||||
INCLUDEPATH += ../../JGE/include/qt
|
INCLUDEPATH += ../../JGE/include/qt
|
||||||
INCLUDEPATH += ../../JGE/include
|
INCLUDEPATH += ../../JGE/include
|
||||||
@@ -55,6 +68,8 @@ INCLUDEPATH += include
|
|||||||
#!symbian:DESTDIR = bin
|
#!symbian:DESTDIR = bin
|
||||||
|
|
||||||
unix:!symbian:LIBS += -lz
|
unix:!symbian:LIBS += -lz
|
||||||
|
win32:LIBS += ../../JGE/Dependencies/lib/fmodvc.lib
|
||||||
|
win32:LIBS += ../../JGE/Dependencies/lib/zlibd.lib
|
||||||
PRECOMPILED_HEADER = include/PrecompiledHeader.h
|
PRECOMPILED_HEADER = include/PrecompiledHeader.h
|
||||||
|
|
||||||
#DEFINES += TRACK_OBJECT_USAGE
|
#DEFINES += TRACK_OBJECT_USAGE
|
||||||
@@ -74,7 +89,6 @@ SOURCES += \
|
|||||||
src/AllAbilities.cpp\
|
src/AllAbilities.cpp\
|
||||||
src/CardDescriptor.cpp\
|
src/CardDescriptor.cpp\
|
||||||
src/CardDisplay.cpp\
|
src/CardDisplay.cpp\
|
||||||
src/CardEffect.cpp\
|
|
||||||
src/CardGui.cpp\
|
src/CardGui.cpp\
|
||||||
src/CardPrimitive.cpp\
|
src/CardPrimitive.cpp\
|
||||||
src/CardSelector.cpp\
|
src/CardSelector.cpp\
|
||||||
@@ -228,7 +242,6 @@ HEADERS += \
|
|||||||
include/GameStateShop.h\
|
include/GameStateShop.h\
|
||||||
include/MTGPack.h\
|
include/MTGPack.h\
|
||||||
include/TextScroller.h\
|
include/TextScroller.h\
|
||||||
include/CardEffect.h\
|
|
||||||
include/GameStateStory.h\
|
include/GameStateStory.h\
|
||||||
include/MTGRules.h\
|
include/MTGRules.h\
|
||||||
include/ThisDescriptor.h\
|
include/ThisDescriptor.h\
|
||||||
@@ -239,7 +252,6 @@ HEADERS += \
|
|||||||
include/Token.h\
|
include/Token.h\
|
||||||
include/CardPrimitive.h\
|
include/CardPrimitive.h\
|
||||||
include/GuiAvatars.h\
|
include/GuiAvatars.h\
|
||||||
include/OSD.h\
|
|
||||||
include/Translate.h\
|
include/Translate.h\
|
||||||
include/CardSelector.h\
|
include/CardSelector.h\
|
||||||
include/GuiBackground.h\
|
include/GuiBackground.h\
|
||||||
@@ -291,9 +303,6 @@ HEADERS += \
|
|||||||
|
|
||||||
# JGE, could probably be moved outside
|
# JGE, could probably be moved outside
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
../../JGE/src/qt/filedownloader.cpp\
|
|
||||||
../../JGE/src/qt/corewrapper.cpp\
|
|
||||||
../../JGE/src/Qtmain.cpp\
|
|
||||||
../../JGE/src/Encoding.cpp\
|
../../JGE/src/Encoding.cpp\
|
||||||
../../JGE/src/JAnimator.cpp\
|
../../JGE/src/JAnimator.cpp\
|
||||||
../../JGE/src/JApp.cpp\
|
../../JGE/src/JApp.cpp\
|
||||||
@@ -304,7 +313,6 @@ SOURCES += \
|
|||||||
../../JGE/src/JGui.cpp\
|
../../JGE/src/JGui.cpp\
|
||||||
../../JGE/src/JLogger.cpp\
|
../../JGE/src/JLogger.cpp\
|
||||||
../../JGE/src/JLBFont.cpp\
|
../../JGE/src/JLBFont.cpp\
|
||||||
../../JGE/src/JMD2Model.cpp\
|
|
||||||
../../JGE/src/JOBJModel.cpp\
|
../../JGE/src/JOBJModel.cpp\
|
||||||
../../JGE/src/JParticle.cpp\
|
../../JGE/src/JParticle.cpp\
|
||||||
../../JGE/src/JParticleEffect.cpp\
|
../../JGE/src/JParticleEffect.cpp\
|
||||||
@@ -314,7 +322,9 @@ SOURCES += \
|
|||||||
../../JGE/src/JSpline.cpp\
|
../../JGE/src/JSpline.cpp\
|
||||||
../../JGE/src/JNetwork.cpp\
|
../../JGE/src/JNetwork.cpp\
|
||||||
../../JGE/src/pc/JSocket.cpp\
|
../../JGE/src/pc/JSocket.cpp\
|
||||||
|
../../JGE/src/pc/JSfx.cpp\
|
||||||
../../JGE/src/JSprite.cpp\
|
../../JGE/src/JSprite.cpp\
|
||||||
|
../../JGE/src/OutputCapturer.cpp\
|
||||||
../../JGE/src/Vector2D.cpp\
|
../../JGE/src/Vector2D.cpp\
|
||||||
../../JGE/src/tinyxml/tinystr.cpp\
|
../../JGE/src/tinyxml/tinystr.cpp\
|
||||||
../../JGE/src/tinyxml/tinyxml.cpp\
|
../../JGE/src/tinyxml/tinyxml.cpp\
|
||||||
@@ -328,13 +338,28 @@ SOURCES += \
|
|||||||
../../JGE/src/hge/hgevector.cpp\
|
../../JGE/src/hge/hgevector.cpp\
|
||||||
../../JGE/src/zipFS/zfsystem.cpp\
|
../../JGE/src/zipFS/zfsystem.cpp\
|
||||||
../../JGE/src/zipFS/ziphdr.cpp\
|
../../JGE/src/zipFS/ziphdr.cpp\
|
||||||
../../JGE/src/zipFS/zstream.cpp\
|
../../JGE/src/zipFS/zstream.cpp
|
||||||
../../JGE/src/pc/JSfx.cpp\
|
|
||||||
|
CONFIG(graphics, graphics|console){
|
||||||
|
SOURCES += \
|
||||||
|
../../JGE/src/qt/filedownloader.cpp\
|
||||||
|
../../JGE/src/qt/corewrapper.cpp\
|
||||||
|
../../JGE/src/Qtmain.cpp\
|
||||||
|
../../JGE/src/JMD2Model.cpp\
|
||||||
../../JGE/src/pc/JGfx.cpp
|
../../JGE/src/pc/JGfx.cpp
|
||||||
|
|
||||||
HEADERS += \
|
HEADERS += \
|
||||||
../../JGE/include/qt/filedownloader.h\
|
../../JGE/include/qt/filedownloader.h\
|
||||||
../../JGE/include/qt/corewrapper.h\
|
../../JGE/include/qt/corewrapper.h
|
||||||
|
}
|
||||||
|
else:CONFIG(console, graphics|console){
|
||||||
|
SOURCES += \
|
||||||
|
../../JGE/src/JGfx-fake.cpp\
|
||||||
|
../../JGE/src/Qtconsole.cpp
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HEADERS += \
|
||||||
../../JGE/include/Threading.h\
|
../../JGE/include/Threading.h\
|
||||||
../../JGE/include/decoder_prx.h\
|
../../JGE/include/decoder_prx.h\
|
||||||
../../JGE/include/DebugRoutines.h\
|
../../JGE/include/DebugRoutines.h\
|
||||||
@@ -366,6 +391,7 @@ HEADERS += \
|
|||||||
../../JGE/include/JSpline.h\
|
../../JGE/include/JSpline.h\
|
||||||
../../JGE/include/JSprite.h\
|
../../JGE/include/JSprite.h\
|
||||||
../../JGE/include/JTypes.h\
|
../../JGE/include/JTypes.h\
|
||||||
|
../../JGE/include/OutputCapturer.h\
|
||||||
../../JGE/include/Vector2D.h\
|
../../JGE/include/Vector2D.h\
|
||||||
../../JGE/include/Vector3D.h\
|
../../JGE/include/Vector3D.h\
|
||||||
../../JGE/include/vram.h\
|
../../JGE/include/vram.h\
|
||||||
@@ -387,10 +413,6 @@ HEADERS += \
|
|||||||
../../JGE/src/tinyxml/tinyxml.h\
|
../../JGE/src/tinyxml/tinyxml.h\
|
||||||
../../JGE/include/vram.h
|
../../JGE/include/vram.h
|
||||||
|
|
||||||
# Please do not modify the following two lines. Required for deployment.
|
|
||||||
!maemo5:include(qml/qmlapplicationviewer/qmlapplicationviewer.pri)
|
|
||||||
!maemo5:qtcAddDeployment()
|
|
||||||
|
|
||||||
# maemo 5 packaging
|
# maemo 5 packaging
|
||||||
maemo5: {
|
maemo5: {
|
||||||
# Variables
|
# Variables
|
||||||
|
|||||||
@@ -67,7 +67,6 @@
|
|||||||
12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; };
|
12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; };
|
||||||
12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; };
|
12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; };
|
||||||
12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; };
|
12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; };
|
||||||
12059DAB14980B7300DAC43B /* CardEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F71291C60500B9016A /* CardEffect.cpp */; };
|
|
||||||
12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; };
|
12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; };
|
||||||
12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; };
|
12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; };
|
||||||
12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; };
|
12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; };
|
||||||
@@ -217,7 +216,6 @@
|
|||||||
12059E5D14980B7300DAC43B /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50B148BCBBC00C58E83 /* MapKit.framework */; };
|
12059E5D14980B7300DAC43B /* MapKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50B148BCBBC00C58E83 /* MapKit.framework */; };
|
||||||
12059E5E14980B7300DAC43B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED518148BF0E000C58E83 /* MediaPlayer.framework */; };
|
12059E5E14980B7300DAC43B /* MediaPlayer.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED518148BF0E000C58E83 /* MediaPlayer.framework */; };
|
||||||
1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1216D632148F7411000F2295 /* libc++abi.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
|
1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 1216D632148F7411000F2295 /* libc++abi.dylib */; settings = {ATTRIBUTES = (Weak, ); }; };
|
||||||
1216D634148F747D000F2295 /* libGoogleAdMobAds.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED379148BAE7B00C58E83 /* libGoogleAdMobAds.a */; settings = {ATTRIBUTES = (Weak, ); }; };
|
|
||||||
12211E7914931CBB00641703 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2814931CBB00641703 /* ASIAuthenticationDialog.m */; };
|
12211E7914931CBB00641703 /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2814931CBB00641703 /* ASIAuthenticationDialog.m */; };
|
||||||
12211E7A14931CBB00641703 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2B14931CBB00641703 /* ASIDataCompressor.m */; };
|
12211E7A14931CBB00641703 /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2B14931CBB00641703 /* ASIDataCompressor.m */; };
|
||||||
12211E7B14931CBB00641703 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2D14931CBB00641703 /* ASIDataDecompressor.m */; };
|
12211E7B14931CBB00641703 /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2D14931CBB00641703 /* ASIDataDecompressor.m */; };
|
||||||
@@ -285,6 +283,7 @@
|
|||||||
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
|
1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; };
|
||||||
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
|
28FD15000DC6FC520079059D /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD14FF0DC6FC520079059D /* OpenGLES.framework */; };
|
||||||
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
|
28FD15080DC6FC5B0079059D /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 28FD15070DC6FC5B0079059D /* QuartzCore.framework */; };
|
||||||
|
75877A32184714BF0076B4A2 /* UIScreen+Util.m in Sources */ = {isa = PBXBuildFile; fileRef = 75877A31184714BF0076B4A2 /* UIScreen+Util.m */; };
|
||||||
75D209D3181D54FD009916AC /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D1181D54FD009916AC /* Default-568h@2x.png */; };
|
75D209D3181D54FD009916AC /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D1181D54FD009916AC /* Default-568h@2x.png */; };
|
||||||
75D209D4181D54FD009916AC /* wagic-80x80.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D2181D54FD009916AC /* wagic-80x80.png */; };
|
75D209D4181D54FD009916AC /* wagic-80x80.png in Resources */ = {isa = PBXBuildFile; fileRef = 75D209D2181D54FD009916AC /* wagic-80x80.png */; };
|
||||||
CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */; };
|
CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CE97CD1D1295AB4300FDFD3B /* SimplePopup.cpp */; };
|
||||||
@@ -307,7 +306,6 @@
|
|||||||
CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; };
|
CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F41291C60500B9016A /* AllAbilities.cpp */; };
|
||||||
CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; };
|
CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F51291C60500B9016A /* CardDescriptor.cpp */; };
|
||||||
CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; };
|
CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F61291C60500B9016A /* CardDisplay.cpp */; };
|
||||||
CEA377611291C60500B9016A /* CardEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F71291C60500B9016A /* CardEffect.cpp */; };
|
|
||||||
CEA377621291C60500B9016A /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; };
|
CEA377621291C60500B9016A /* CardGui.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F81291C60500B9016A /* CardGui.cpp */; };
|
||||||
CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; };
|
CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376F91291C60500B9016A /* CardPrimitive.cpp */; };
|
||||||
CEA377641291C60500B9016A /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; };
|
CEA377641291C60500B9016A /* CardSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CEA376FA1291C60500B9016A /* CardSelector.cpp */; };
|
||||||
@@ -578,6 +576,8 @@
|
|||||||
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||||
28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
28FD14FF0DC6FC520079059D /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; };
|
||||||
28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
28FD15070DC6FC5B0079059D /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; };
|
||||||
|
75877A30184714BF0076B4A2 /* UIScreen+Util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "UIScreen+Util.h"; path = "UI/UIScreen+Util.h"; sourceTree = "<group>"; };
|
||||||
|
75877A31184714BF0076B4A2 /* UIScreen+Util.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "UIScreen+Util.m"; path = "UI/UIScreen+Util.m"; sourceTree = "<group>"; };
|
||||||
75D209D1181D54FD009916AC /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
|
75D209D1181D54FD009916AC /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = SOURCE_ROOT; };
|
||||||
75D209D2181D54FD009916AC /* wagic-80x80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "wagic-80x80.png"; sourceTree = SOURCE_ROOT; };
|
75D209D2181D54FD009916AC /* wagic-80x80.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "wagic-80x80.png"; sourceTree = SOURCE_ROOT; };
|
||||||
8D1107310486CEB800E47090 /* wagic-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "wagic-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
|
8D1107310486CEB800E47090 /* wagic-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "wagic-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
|
||||||
@@ -609,7 +609,6 @@
|
|||||||
CEA3768C1291C60500B9016A /* AllAbilities.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = AllAbilities.h; sourceTree = "<group>"; };
|
CEA3768C1291C60500B9016A /* AllAbilities.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = AllAbilities.h; sourceTree = "<group>"; };
|
||||||
CEA3768D1291C60500B9016A /* CardDescriptor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDescriptor.h; sourceTree = "<group>"; };
|
CEA3768D1291C60500B9016A /* CardDescriptor.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDescriptor.h; sourceTree = "<group>"; };
|
||||||
CEA3768E1291C60500B9016A /* CardDisplay.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDisplay.h; sourceTree = "<group>"; };
|
CEA3768E1291C60500B9016A /* CardDisplay.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardDisplay.h; sourceTree = "<group>"; };
|
||||||
CEA3768F1291C60500B9016A /* CardEffect.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardEffect.h; sourceTree = "<group>"; };
|
|
||||||
CEA376901291C60500B9016A /* CardGui.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardGui.h; sourceTree = "<group>"; };
|
CEA376901291C60500B9016A /* CardGui.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardGui.h; sourceTree = "<group>"; };
|
||||||
CEA376911291C60500B9016A /* CardPrimitive.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardPrimitive.h; sourceTree = "<group>"; };
|
CEA376911291C60500B9016A /* CardPrimitive.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardPrimitive.h; sourceTree = "<group>"; };
|
||||||
CEA376921291C60500B9016A /* CardSelector.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardSelector.h; sourceTree = "<group>"; };
|
CEA376921291C60500B9016A /* CardSelector.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.h; fileEncoding = 4; path = CardSelector.h; sourceTree = "<group>"; };
|
||||||
@@ -711,7 +710,6 @@
|
|||||||
CEA376F41291C60500B9016A /* AllAbilities.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = AllAbilities.cpp; sourceTree = "<group>"; };
|
CEA376F41291C60500B9016A /* AllAbilities.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = AllAbilities.cpp; sourceTree = "<group>"; };
|
||||||
CEA376F51291C60500B9016A /* CardDescriptor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDescriptor.cpp; sourceTree = "<group>"; };
|
CEA376F51291C60500B9016A /* CardDescriptor.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDescriptor.cpp; sourceTree = "<group>"; };
|
||||||
CEA376F61291C60500B9016A /* CardDisplay.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDisplay.cpp; sourceTree = "<group>"; };
|
CEA376F61291C60500B9016A /* CardDisplay.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardDisplay.cpp; sourceTree = "<group>"; };
|
||||||
CEA376F71291C60500B9016A /* CardEffect.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardEffect.cpp; sourceTree = "<group>"; };
|
|
||||||
CEA376F81291C60500B9016A /* CardGui.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardGui.cpp; sourceTree = "<group>"; };
|
CEA376F81291C60500B9016A /* CardGui.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardGui.cpp; sourceTree = "<group>"; };
|
||||||
CEA376F91291C60500B9016A /* CardPrimitive.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardPrimitive.cpp; sourceTree = "<group>"; };
|
CEA376F91291C60500B9016A /* CardPrimitive.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardPrimitive.cpp; sourceTree = "<group>"; };
|
||||||
CEA376FA1291C60500B9016A /* CardSelector.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardSelector.cpp; sourceTree = "<group>"; };
|
CEA376FA1291C60500B9016A /* CardSelector.cpp */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.cpp; fileEncoding = 4; path = CardSelector.cpp; sourceTree = "<group>"; };
|
||||||
@@ -922,7 +920,6 @@
|
|||||||
12D095E114417D0500F69056 /* libstdc++.dylib in Frameworks */,
|
12D095E114417D0500F69056 /* libstdc++.dylib in Frameworks */,
|
||||||
12211EBB14934A2C00641703 /* CFNetwork.framework in Frameworks */,
|
12211EBB14934A2C00641703 /* CFNetwork.framework in Frameworks */,
|
||||||
12211EB914934A1900641703 /* MobileCoreServices.framework in Frameworks */,
|
12211EB914934A1900641703 /* MobileCoreServices.framework in Frameworks */,
|
||||||
1216D634148F747D000F2295 /* libGoogleAdMobAds.a in Frameworks */,
|
|
||||||
1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */,
|
1216D633148F7411000F2295 /* libc++abi.dylib in Frameworks */,
|
||||||
128ED510148BCC1900C58E83 /* libsqlite3.dylib in Frameworks */,
|
128ED510148BCC1900C58E83 /* libsqlite3.dylib in Frameworks */,
|
||||||
129654D1148A52740031100B /* iAd.framework in Frameworks */,
|
129654D1148A52740031100B /* iAd.framework in Frameworks */,
|
||||||
@@ -1017,6 +1014,8 @@
|
|||||||
children = (
|
children = (
|
||||||
CE9A477512B514BA00C9F38A /* EAGLView.h */,
|
CE9A477512B514BA00C9F38A /* EAGLView.h */,
|
||||||
CE9A477612B514BA00C9F38A /* EAGLView.m */,
|
CE9A477612B514BA00C9F38A /* EAGLView.m */,
|
||||||
|
75877A30184714BF0076B4A2 /* UIScreen+Util.h */,
|
||||||
|
75877A31184714BF0076B4A2 /* UIScreen+Util.m */,
|
||||||
);
|
);
|
||||||
name = UI;
|
name = UI;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -1306,7 +1305,6 @@
|
|||||||
CEA3768C1291C60500B9016A /* AllAbilities.h */,
|
CEA3768C1291C60500B9016A /* AllAbilities.h */,
|
||||||
CEA3768D1291C60500B9016A /* CardDescriptor.h */,
|
CEA3768D1291C60500B9016A /* CardDescriptor.h */,
|
||||||
CEA3768E1291C60500B9016A /* CardDisplay.h */,
|
CEA3768E1291C60500B9016A /* CardDisplay.h */,
|
||||||
CEA3768F1291C60500B9016A /* CardEffect.h */,
|
|
||||||
CEA376901291C60500B9016A /* CardGui.h */,
|
CEA376901291C60500B9016A /* CardGui.h */,
|
||||||
CEA376911291C60500B9016A /* CardPrimitive.h */,
|
CEA376911291C60500B9016A /* CardPrimitive.h */,
|
||||||
CEA376921291C60500B9016A /* CardSelector.h */,
|
CEA376921291C60500B9016A /* CardSelector.h */,
|
||||||
@@ -1427,7 +1425,6 @@
|
|||||||
CEA376F41291C60500B9016A /* AllAbilities.cpp */,
|
CEA376F41291C60500B9016A /* AllAbilities.cpp */,
|
||||||
CEA376F51291C60500B9016A /* CardDescriptor.cpp */,
|
CEA376F51291C60500B9016A /* CardDescriptor.cpp */,
|
||||||
CEA376F61291C60500B9016A /* CardDisplay.cpp */,
|
CEA376F61291C60500B9016A /* CardDisplay.cpp */,
|
||||||
CEA376F71291C60500B9016A /* CardEffect.cpp */,
|
|
||||||
CEA376F81291C60500B9016A /* CardGui.cpp */,
|
CEA376F81291C60500B9016A /* CardGui.cpp */,
|
||||||
CEA376F91291C60500B9016A /* CardPrimitive.cpp */,
|
CEA376F91291C60500B9016A /* CardPrimitive.cpp */,
|
||||||
CEA376FA1291C60500B9016A /* CardSelector.cpp */,
|
CEA376FA1291C60500B9016A /* CardSelector.cpp */,
|
||||||
@@ -1827,7 +1824,6 @@
|
|||||||
12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */,
|
12059DA814980B7300DAC43B /* AllAbilities.cpp in Sources */,
|
||||||
12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */,
|
12059DA914980B7300DAC43B /* CardDescriptor.cpp in Sources */,
|
||||||
12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */,
|
12059DAA14980B7300DAC43B /* CardDisplay.cpp in Sources */,
|
||||||
12059DAB14980B7300DAC43B /* CardEffect.cpp in Sources */,
|
|
||||||
12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */,
|
12059DAC14980B7300DAC43B /* CardGui.cpp in Sources */,
|
||||||
12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */,
|
12059DAD14980B7300DAC43B /* CardPrimitive.cpp in Sources */,
|
||||||
12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */,
|
12059DAE14980B7300DAC43B /* CardSelector.cpp in Sources */,
|
||||||
@@ -2009,7 +2005,6 @@
|
|||||||
CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */,
|
CEA3775E1291C60500B9016A /* AllAbilities.cpp in Sources */,
|
||||||
CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */,
|
CEA3775F1291C60500B9016A /* CardDescriptor.cpp in Sources */,
|
||||||
CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */,
|
CEA377601291C60500B9016A /* CardDisplay.cpp in Sources */,
|
||||||
CEA377611291C60500B9016A /* CardEffect.cpp in Sources */,
|
|
||||||
CEA377621291C60500B9016A /* CardGui.cpp in Sources */,
|
CEA377621291C60500B9016A /* CardGui.cpp in Sources */,
|
||||||
CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */,
|
CEA377631291C60500B9016A /* CardPrimitive.cpp in Sources */,
|
||||||
CEA377641291C60500B9016A /* CardSelector.cpp in Sources */,
|
CEA377641291C60500B9016A /* CardSelector.cpp in Sources */,
|
||||||
@@ -2099,6 +2094,7 @@
|
|||||||
CEA377BE1291C60500B9016A /* WFilter.cpp in Sources */,
|
CEA377BE1291C60500B9016A /* WFilter.cpp in Sources */,
|
||||||
CEA377BF1291C60500B9016A /* WFont.cpp in Sources */,
|
CEA377BF1291C60500B9016A /* WFont.cpp in Sources */,
|
||||||
CEA377C01291C60500B9016A /* WGui.cpp in Sources */,
|
CEA377C01291C60500B9016A /* WGui.cpp in Sources */,
|
||||||
|
75877A32184714BF0076B4A2 /* UIScreen+Util.m in Sources */,
|
||||||
CEA377C11291C60500B9016A /* WResourceManager.cpp in Sources */,
|
CEA377C11291C60500B9016A /* WResourceManager.cpp in Sources */,
|
||||||
CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */,
|
CE97CD1E1295AB4300FDFD3B /* SimplePopup.cpp in Sources */,
|
||||||
CE9A478512B514BA00C9F38A /* EAGLView.m in Sources */,
|
CE9A478512B514BA00C9F38A /* EAGLView.m in Sources */,
|
||||||
|
|||||||
Executable
+23
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh -ex
|
||||||
|
|
||||||
|
# we're building a PSP binary here
|
||||||
|
cd JGE
|
||||||
|
make -j 8
|
||||||
|
cd ..
|
||||||
|
cd projects/mtg
|
||||||
|
mkdir objs
|
||||||
|
make -j 8
|
||||||
|
cd ../..
|
||||||
|
|
||||||
|
# we're building an Android binary here
|
||||||
|
android-ndk-r9/ndk-build -C projects/mtg/Android -j8
|
||||||
|
$ANDROID list targets
|
||||||
|
$ANDROID update project -t 1 -p projects/mtg/Android
|
||||||
|
ant debug -f projects/mtg/Android/build.xml
|
||||||
|
|
||||||
|
# let's try an Intel linux binary
|
||||||
|
qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR
|
||||||
|
make -j 8
|
||||||
|
|
||||||
|
# and finish by running the testsuite
|
||||||
|
./wagic
|
||||||
Reference in New Issue
Block a user