iOS compilation fixes

This commit is contained in:
Xawotihs
2010-11-19 23:16:31 +00:00
parent 6d855e6cda
commit 8339cdd3b3
30 changed files with 327 additions and 220 deletions

View File

@@ -60,7 +60,7 @@ class Interruptible: public PlayGuiObject, public Targetable{
virtual const string getDisplayName() const;
void Render(MTGCardInstance * source, JQuad * targetQuad, string alt1, string alt2, string action, bool bigQuad = false);
virtual int receiveEvent(WEvent * event) {return 0;};
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
virtual void Dump();
#endif
};
@@ -181,8 +181,8 @@ class ActionStack :public GuiLayer{
int has(Interruptible * action);
int has(MTGAbility * ability);
int receiveEventPlus(WEvent * event);
#if defined (WIN32) || defined (LINUX)
void Dump();
#if defined (WIN32) || defined (LINUX) || defined (IOS)
void Dump();
#endif
};

View File

@@ -51,7 +51,7 @@ public:
Task(char _type = ' ');
static Task* createFromStr(string params, bool rand = FALSE);
static Task* createFromStr(string params, bool rand = false);
virtual string toString();
string getDesc();
virtual string createDesc() = 0;
@@ -89,7 +89,7 @@ public:
int load(string _fileName = "");
int save(string _fileName = "");
int getState() {return mState;};
void addTask(string params, bool rand = FALSE);
void addTask(string params, bool rand = false);
void addTask(Task *task);
void addRandomTask(int diff = 100);
void removeTask(Task *task);

View File

@@ -3,7 +3,7 @@
#include <JGE.h>
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
#else
#include <pspkernel.h>

View File

@@ -1091,7 +1091,7 @@ void ActionStack::Render()
}
}
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
void Interruptible::Dump()
{

View File

@@ -3,7 +3,7 @@
#include <JGE.h>
#include <JLogger.h>
#include <JRenderer.h>
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
#include <time.h>
#else
#include <pspfpu.h>
@@ -78,7 +78,7 @@ GameApp::~GameApp()
void GameApp::Create()
{
srand((unsigned int) time(0)); // initialize random
#ifndef QT_CONFIG
#if not defined(QT_CONFIG) && not defined(IOS)
#if defined (WIN32)
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#elif not defined (LINUX)

View File

@@ -278,7 +278,7 @@ int GameStateMenu::nextDirectory(const char * root, const char * file)
int found = 0;
if (!mDip)
{
mDip = opendir(root);
mDip = opendir(JGE_GET_RES(root).c_str());
}
while (!found && (mDit = readdir(mDip)))

View File

@@ -55,7 +55,7 @@ Task::Task(char _type)
{
reward = 0;
expiresIn = 1;
accepted = FALSE;
accepted = false;
if (_type == ' ')
{
type = TASK_BASIC;
@@ -603,7 +603,7 @@ void TaskList::addRandomTask(int diff)
string s(TASKS_ALL);
char taskType[2];
sprintf(taskType, "%c", s[rand() % s.length()]);
addTask(string(taskType), TRUE);
addTask(string(taskType), true);
}
TaskList::~TaskList()
@@ -742,7 +742,7 @@ TaskDelay::TaskDelay(int _opponent, int _turn) :
{
type = TASK_DELAY;
turn = _turn;
afterTurn = TRUE;
afterTurn = true;
}
int TaskDelay::computeReward()

View File

@@ -10,7 +10,7 @@ using std::map;
static map<const LocalKeySym, KeyRep> fattable;
static map<const JButton, KeyRep> slimtable;
#ifdef LINUX
#if defined(LINUX) || defined (IOS)
const KeyRep& translateKey(LocalKeySym key)
{
{
@@ -20,7 +20,7 @@ const KeyRep& translateKey(LocalKeySym key)
}
char* str = NULL;
#ifndef QT_CONFIG
#if not defined(QT_CONFIG) && not defined(IOS)
str = XKeysymToString(key);
#endif // QT_CONFIG
if (!str)

View File

@@ -233,7 +233,7 @@ unsigned long WCachedTexture::size()
if (!texture) return 0;
unsigned int pixel_size = 4;
#if defined WIN32 || defined LINUX
#if defined WIN32 || defined LINUX || defined IOS
#else
pixel_size = JRenderer::GetInstance()->PixelSize(texture->mTextureFormat);
#endif

View File

@@ -249,7 +249,7 @@ int WFBFont::PreCacheChar(const u8 *ch)
int index = mCurr++;
if (mCurr >= mCacheSize) mCurr = 0;
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
int x = 0;
int y = 0;
memset(mCharBuffer, 0, sizeof(u32) * mFontSize * mFontSize);
@@ -285,7 +285,7 @@ int WFBFont::PreCacheChar(const u8 *ch)
#if 1
for (; j < offset; j++)
{
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
mCharBuffer[y * mFontSize + x] = ARGB(0, 0, 0, 0);
#else
SwizzlePlot(pTexture, ARGB(0, 0, 0, 0), x * PIXEL_SIZE, y, mTexture->mTexWidth * PIXEL_SIZE);
@@ -300,7 +300,7 @@ int WFBFont::PreCacheChar(const u8 *ch)
gray = src[(i * size + j - offset) / 2];
gray = ((j - offset) & 1) ? (gray & 0xF0) : ((gray & 0x0F) << 4);
if (gray) gray |= 0x0F;
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
mCharBuffer[y * mFontSize + x] = ARGB(gray, 255, 255, 255);
#else
SwizzlePlot(pTexture, ARGB(gray, 255, 255, 255), x * PIXEL_SIZE, y, mTexture->mTexWidth * PIXEL_SIZE);
@@ -309,7 +309,7 @@ int WFBFont::PreCacheChar(const u8 *ch)
}
for (; j < mFontSize; j++)
{
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
mCharBuffer[y * mFontSize + x] = ARGB(0, 0, 0, 0);
#else
SwizzlePlot(pTexture, ARGB(0, 0, 0, 0), x * PIXEL_SIZE, y, mTexture->mTexWidth * PIXEL_SIZE);
@@ -321,7 +321,7 @@ int WFBFont::PreCacheChar(const u8 *ch)
mGBCode[index] = code;
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
x = (int)mSprites[index]->mX;
y = (int)mSprites[index]->mY;
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, mFontSize, mFontSize, GL_RGBA, GL_UNSIGNED_BYTE, mCharBuffer);
@@ -601,7 +601,7 @@ WGBKFont::WGBKFont(int inFontID, const char *fontname, int lineheight, bool useV
mSprites = NEW JQuad*[mCacheSize];
mGBCode = NEW int[mCacheSize];
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
mCharBuffer = NEW u32[mFontSize*mFontSize];
#endif
@@ -657,7 +657,7 @@ int WGBKFont::PreCacheChar(const u8 *ch)
int index = mCurr++;
if (mCurr >= mCacheSize) mCurr = 0;
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
int x = 0;
int y = 0;
memset(mCharBuffer, 0, sizeof(u32) * mFontSize * mFontSize);
@@ -685,7 +685,7 @@ int WGBKFont::PreCacheChar(const u8 *ch)
// set up the font texture buffer
for (unsigned int i = 0; i < mFontSize; i++)
{
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
x = 0;
#else
x = (int) mSprites[index]->mX;
@@ -694,7 +694,7 @@ int WGBKFont::PreCacheChar(const u8 *ch)
#if 1
for (; j < offset; j++)
{
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
mCharBuffer[y * mFontSize + x] = ARGB(0, 0, 0, 0);
#else
SwizzlePlot(pTexture, ARGB(0, 0, 0, 0), x * PIXEL_SIZE, y, mTexture->mTexWidth * PIXEL_SIZE);
@@ -709,7 +709,7 @@ int WGBKFont::PreCacheChar(const u8 *ch)
gray = src[(i * size + j - offset) / 2];
gray = ((j - offset) & 1) ? (gray & 0xF0) : ((gray & 0x0F) << 4);
if (gray) gray |= 0x0F;
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
mCharBuffer[y * mFontSize + x] = ARGB(gray, 255, 255, 255);
#else
SwizzlePlot(pTexture, ARGB(gray, 255, 255, 255), x * PIXEL_SIZE, y, mTexture->mTexWidth * PIXEL_SIZE);
@@ -718,7 +718,7 @@ int WGBKFont::PreCacheChar(const u8 *ch)
}
for (; j < mFontSize; j++)
{
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
mCharBuffer[y * mFontSize + x] = ARGB(0, 0, 0, 0);
#else
SwizzlePlot(pTexture, ARGB(0, 0, 0, 0), x * PIXEL_SIZE, y, mTexture->mTexWidth * PIXEL_SIZE);
@@ -730,7 +730,7 @@ int WGBKFont::PreCacheChar(const u8 *ch)
mGBCode[index] = code;
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
x = (int)mSprites[index]->mX;
y = (int)mSprites[index]->mY;
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, mFontSize, mFontSize, GL_RGBA, GL_UNSIGNED_BYTE, mCharBuffer);

View File

@@ -43,7 +43,7 @@ int WRand()
int filesize(const char * filename)
{
int file_size = 0;
#if defined (WIN32) || defined (LINUX)
#if defined (WIN32) || defined (LINUX) || defined (IOS)
FILE * file = fopen(filename, "rb");
if (file != NULL)
{

View File

@@ -84,7 +84,6 @@ SOURCES += \
src/GuiPhaseBar.cpp\
src/GuiPlay.cpp\
src/GuiStatic.cpp\
src/Logger.cpp\
src/ManaCost.cpp\
src/ManaCostHybrid.cpp\
src/MenuItem.cpp\
@@ -110,6 +109,7 @@ SOURCES += \
src/SimpleMenu.cpp\
src/SimpleMenuItem.cpp\
src/SimplePad.cpp\
src/SimplePopup.cpp\
src/StoryFlow.cpp\
src/Subtypes.cpp\
src/StyleManager.cpp\
@@ -234,6 +234,7 @@ HEADERS += \
include/StyleManager.h\
include/WFont.h\
include/DeckManager.h\
include/SimplePopup.h\
include/SimpleMenu.h
# JGE, could probably be moved outside