Fixed "Werror" related compilation problems on Linux and Meego.
This commit is contained in:
@@ -572,7 +572,7 @@ private:
|
||||
#if (!defined IOS) && (!defined QT_CONFIG)
|
||||
void LoadJPG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
||||
int LoadPNG(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
||||
#if (!defined ANDROID)
|
||||
#if (!defined ANDROID) && (!defined QT_CONFIG)
|
||||
void LoadGIF(TextureInfo &textureInfo, const char *filename, int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
||||
int image_readgif(void * handle, TextureInfo &textureInfo, DWORD * bgcolor, InputFunc readFunc,int mode = 0, int TextureFormat = TEXTURE_FORMAT);
|
||||
#endif // (ANDROID) How can we get gif support for android ?
|
||||
|
||||
@@ -228,7 +228,7 @@ float JLBFont::GetStringWidth(const char *string) const
|
||||
float len = 0.0f;
|
||||
|
||||
const char *p = string;
|
||||
char ch;
|
||||
int ch;
|
||||
|
||||
while (*p)
|
||||
{
|
||||
|
||||
@@ -226,6 +226,7 @@ void JMD2Model::CalculateNormal(ScePspFVector3 *normal, float *p1, float *p2, fl
|
||||
void JMD2Model::CalculateNormal(float *p1, float *p2, float *p3)
|
||||
#endif
|
||||
{
|
||||
#if defined (PSP) || ((!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0))
|
||||
float a[3], b[3], result[3];
|
||||
float length;
|
||||
|
||||
@@ -251,16 +252,12 @@ void JMD2Model::CalculateNormal(float *p1, float *p2, float *p3)
|
||||
normal->x = result[0]/length;
|
||||
normal->y = result[1]/length;
|
||||
normal->z = result[2]/length;
|
||||
#else
|
||||
// normalize and specify the normal
|
||||
#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||
#elif (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||
glNormal3f(result[0]/length, result[1]/length, result[2]/length);
|
||||
#else
|
||||
// FIXME
|
||||
#endif //(!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -102,21 +102,9 @@ void hgeDistortionMesh::SetTexture(JTexture* tex)
|
||||
void hgeDistortionMesh::SetTextureRect(float x, float y, float w, float h)
|
||||
{
|
||||
int i,j;
|
||||
float tw,th;
|
||||
|
||||
tx=x; ty=y; width=w; height=h;
|
||||
|
||||
if (quad->mTex)
|
||||
{
|
||||
tw=(float)quad->mTex->mTexWidth;
|
||||
th=(float)quad->mTex->mTexHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
tw = w;
|
||||
th = h;
|
||||
}
|
||||
|
||||
cellw=w/(nCols-1);
|
||||
cellh=h/(nRows-1);
|
||||
|
||||
|
||||
@@ -1575,9 +1575,9 @@ void JRenderer::Plot(float x, float y, PIXEL_TYPE color)
|
||||
{
|
||||
checkGlError();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) && (!defined GL_VERSION_ES_CM_1_1)
|
||||
JColor col;
|
||||
col.color = color;
|
||||
#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) && (!defined GL_VERSION_ES_CM_1_1)
|
||||
glColor4ub(col.r, col.g, col.b, col.a);
|
||||
glBegin(GL_POINTS);
|
||||
glVertex2f(x, SCREEN_HEIGHT_F-y);
|
||||
@@ -1595,9 +1595,9 @@ void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color)
|
||||
{
|
||||
checkGlError();
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
JColor col;
|
||||
col.color = color;
|
||||
#if (!defined GL_ES_VERSION_2_0) && (!defined GL_VERSION_2_0) && (!defined GL_VERSION_ES_CM_1_1)
|
||||
JColor col;
|
||||
col.color = color;
|
||||
glColor4ub(col.r, col.g, col.b, col.a);
|
||||
glBegin(GL_POINTS);
|
||||
for (int i=0;i<count;i++)
|
||||
|
||||
@@ -1328,10 +1328,6 @@ const char* TiXmlAttribute::Parse( const char* p, TiXmlParsingData* data, TiXmlE
|
||||
p = SkipWhiteSpace( p, encoding );
|
||||
if ( !p || !*p ) return 0;
|
||||
|
||||
int tabsize = 4;
|
||||
if ( document )
|
||||
tabsize = document->TabSize();
|
||||
|
||||
if ( data )
|
||||
{
|
||||
data->Stamp( p, encoding );
|
||||
|
||||
@@ -40,4 +40,4 @@ public:
|
||||
~AIHints();
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1398,7 +1398,7 @@ public:
|
||||
|
||||
int isReactingToClick(MTGCardInstance * _card, ManaCost * mana = NULL)
|
||||
{
|
||||
if (_card == target && game->currentlyActing()->game->inPlay->hasCard(source) && (MTGCardInstance *) _card->isTapped())
|
||||
if (_card == target && game->currentlyActing()->game->inPlay->hasCard(source) && _card->isTapped())
|
||||
{
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(cost))
|
||||
{
|
||||
@@ -3289,7 +3289,6 @@ public:
|
||||
int addToGame()
|
||||
{
|
||||
MTGCardInstance * _target = (MTGCardInstance *) target;
|
||||
amount;
|
||||
for (int i = 0; i < amount; i++)
|
||||
{
|
||||
if (_target->controller()->opponent()->damaged() > 0)
|
||||
|
||||
@@ -53,4 +53,4 @@ public:
|
||||
~PlayRestrictions();
|
||||
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -251,4 +251,4 @@ AIAction * AIHints::suggestAbility(ManaCost * potentialMana)
|
||||
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1371,13 +1371,10 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, Player * op
|
||||
sprintf(deckFileSmall, "ai_baka_deck%i", deckid);
|
||||
}
|
||||
|
||||
int deckSetting = EASY;
|
||||
if ( opponent )
|
||||
{
|
||||
bool isOpponentAI = opponent->isAI() == 1;
|
||||
DeckMetaData *meta = DeckManager::GetInstance()->getDeckMetaDataByFilename( opponent->deckFile, isOpponentAI );
|
||||
if ( meta->getVictoryPercentage() >= 65)
|
||||
deckSetting = HARD;
|
||||
DeckManager::GetInstance()->getDeckMetaDataByFilename( opponent->deckFile, isOpponentAI );
|
||||
}
|
||||
|
||||
AIPlayerBaka * baka = NEW AIPlayerBaka(deckFile, deckFileSmall, avatarFilename);
|
||||
|
||||
@@ -758,7 +758,7 @@ int ActionStack::getActionElementFromCard(MTGCardInstance * card)
|
||||
{
|
||||
|
||||
if(!card)
|
||||
return NULL;
|
||||
return 0;
|
||||
for (size_t i = 0; i < mObjects.size(); i++)
|
||||
{
|
||||
Interruptible * current = (Interruptible *) mObjects[i];
|
||||
@@ -767,7 +767,7 @@ int ActionStack::getActionElementFromCard(MTGCardInstance * card)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Interruptible * ActionStack::getNext(Interruptible * previous, int type, int state, int display)
|
||||
|
||||
@@ -322,9 +322,7 @@ void StatsWrapper::initStatistics(string deckstats)
|
||||
gamesPlayed = stats->nbGames();
|
||||
|
||||
// Detailed deck statistics against AI
|
||||
int found = 1;
|
||||
int nbDecks = 0;
|
||||
found = 0;
|
||||
char buffer[512];
|
||||
char smallDeckName[512];
|
||||
ostringstream oss;
|
||||
@@ -334,7 +332,6 @@ void StatsWrapper::initStatistics(string deckstats)
|
||||
sprintf(buffer, "%s/%s.txt", bakaDir.c_str(), deckFilename.c_str());
|
||||
if (fileExists(buffer))
|
||||
{
|
||||
found = 1;
|
||||
nbDecks++;
|
||||
|
||||
sprintf(smallDeckName, "%s_deck%i", "ai_baka", nbDecks);
|
||||
|
||||
@@ -818,7 +818,7 @@ void GameObserver::ButtonPressed(PlayGuiObject * target)
|
||||
{
|
||||
cardClick(NULL, avatar->player);
|
||||
}
|
||||
else if (GuiPhaseBar* phaseBar = dynamic_cast<GuiPhaseBar*>(target))
|
||||
else if (dynamic_cast<GuiPhaseBar*>(target))
|
||||
{
|
||||
MTGGamePhase::GetInstance()->NextGamePhase();
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ const string Options::optionNames[] = {
|
||||
int Options::getID(string name)
|
||||
{
|
||||
if (0 == name.size())
|
||||
INVALID_OPTION;
|
||||
return INVALID_OPTION;
|
||||
|
||||
std::transform(name.begin(), name.end(), name.begin(), ::tolower);
|
||||
|
||||
|
||||
@@ -124,7 +124,7 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card,Player * player
|
||||
}
|
||||
|
||||
size_t typeRelated = restriction[i].find("type(");
|
||||
size_t check = NULL;
|
||||
size_t check = 0;
|
||||
if(typeRelated != string::npos)
|
||||
{
|
||||
int firstAmount = 0;
|
||||
@@ -142,7 +142,6 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card,Player * player
|
||||
check = comparasion[i].find("type(");
|
||||
if( check != string::npos)
|
||||
{
|
||||
size_t start = 0;
|
||||
size_t end = 0;
|
||||
size_t found = comparasion[i].find("type(");
|
||||
if (found != string::npos)
|
||||
|
||||
@@ -977,9 +977,8 @@ int MTGSuspendRule::reactToClick(MTGCardInstance * card)
|
||||
card->paymenttype = MTGAbility::SUSPEND_COST;
|
||||
}
|
||||
//------------------------------------------------------------------------
|
||||
int payResult = player->getManaPool()->pay(card->getManaCost()->suspend);
|
||||
player->getManaPool()->pay(card->getManaCost()->suspend);
|
||||
card->getManaCost()->suspend->doPayExtra();
|
||||
payResult = ManaCost::MANA_PAID_WITH_SUSPEND;
|
||||
//---------------------------------------------------------------------------
|
||||
player->game->putInZone(card, card->currentZone, player->game->exile);
|
||||
card->next->suspended = true;
|
||||
|
||||
@@ -500,7 +500,7 @@ void OptionTheme::Render()
|
||||
{
|
||||
string temp;
|
||||
std::getline(file, temp);
|
||||
for (unsigned int x = 0; x < 17, x < temp.size(); x++)
|
||||
for (unsigned int x = 0; x < 17 && x < temp.size(); x++)
|
||||
{
|
||||
if (isprint(temp[x])) //Clear stuff that breaks mFont->DrawString, cuts to 16 chars.
|
||||
author += temp[x];
|
||||
|
||||
@@ -31,7 +31,7 @@ const KeyRep& translateKey(LocalKeySym key)
|
||||
if (!str)
|
||||
{
|
||||
str = NEW char[11];
|
||||
sprintf(str, "%lu", key); //TODO: Wagic is not supposed to know that a key actually is an unsingned long, so this part should probably be platform specific (move to JGE ?)
|
||||
sprintf(str, "%lu", (long unsigned int)key); //TODO: Wagic is not supposed to know that a key actually is an unsingned long, so this part should probably be platform specific (move to JGE ?)
|
||||
}
|
||||
const KeyRep k = make_pair(str, static_cast<JQuad*>(NULL));
|
||||
fattable[key] = k;
|
||||
|
||||
@@ -1550,7 +1550,7 @@ WDistort::WDistort(float x1, float y1, float x2, float y2, float x3, float y3, f
|
||||
|
||||
void WGuiListRow::Render()
|
||||
{
|
||||
int start = 0, nowPos = 0, vHeight = 0;
|
||||
int start = 0, nowPos = 0;
|
||||
int nbitems = (int) items.size();
|
||||
|
||||
//List is empty.
|
||||
@@ -1576,7 +1576,6 @@ void WGuiListRow::Render()
|
||||
}
|
||||
}
|
||||
|
||||
vHeight = 0;
|
||||
nowPos = 4;
|
||||
float nowVPos = 4;
|
||||
float tallestRow = 0;
|
||||
|
||||
Reference in New Issue
Block a user