iOS compilation fixes
This commit is contained in:
@@ -1091,7 +1091,7 @@ void ActionStack::Render()
|
||||
}
|
||||
}
|
||||
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
#if defined (WIN32) || defined (LINUX) || defined (IOS)
|
||||
|
||||
void Interruptible::Dump()
|
||||
{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)))
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
+12
-12
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user