Fixed "Werror" related compilation problems on Linux and Meego.

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