diff --git a/JGE/include/JRenderer.h b/JGE/include/JRenderer.h index 76ad3c395..4a4bb6232 100644 --- a/JGE/include/JRenderer.h +++ b/JGE/include/JRenderer.h @@ -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 ? diff --git a/JGE/src/JLBFont.cpp b/JGE/src/JLBFont.cpp index edc513da0..7c6fbc08f 100644 --- a/JGE/src/JLBFont.cpp +++ b/JGE/src/JLBFont.cpp @@ -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) { diff --git a/JGE/src/JMD2Model.cpp b/JGE/src/JMD2Model.cpp index 835e3f1c0..2de583eaf 100644 --- a/JGE/src/JMD2Model.cpp +++ b/JGE/src/JMD2Model.cpp @@ -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 } diff --git a/JGE/src/hge/hgedistort.cpp b/JGE/src/hge/hgedistort.cpp index 78fd972e0..8a21b505d 100644 --- a/JGE/src/hge/hgedistort.cpp +++ b/JGE/src/hge/hgedistort.cpp @@ -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); diff --git a/JGE/src/pc/JGfx.cpp b/JGE/src/pc/JGfx.cpp index 1d1da4723..9549a5ed8 100644 --- a/JGE/src/pc/JGfx.cpp +++ b/JGE/src/pc/JGfx.cpp @@ -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;iTabSize(); - if ( data ) { data->Stamp( p, encoding ); diff --git a/projects/mtg/include/AIHints.h b/projects/mtg/include/AIHints.h index 5f1040dfb..ce1ed428c 100644 --- a/projects/mtg/include/AIHints.h +++ b/projects/mtg/include/AIHints.h @@ -40,4 +40,4 @@ public: ~AIHints(); }; -#endif \ No newline at end of file +#endif diff --git a/projects/mtg/include/AllAbilities.h b/projects/mtg/include/AllAbilities.h index 014c3990f..7de22bc9a 100644 --- a/projects/mtg/include/AllAbilities.h +++ b/projects/mtg/include/AllAbilities.h @@ -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) diff --git a/projects/mtg/include/PlayRestrictions.h b/projects/mtg/include/PlayRestrictions.h index 91320b737..15130a203 100644 --- a/projects/mtg/include/PlayRestrictions.h +++ b/projects/mtg/include/PlayRestrictions.h @@ -53,4 +53,4 @@ public: ~PlayRestrictions(); }; -#endif \ No newline at end of file +#endif diff --git a/projects/mtg/src/AIHints.cpp b/projects/mtg/src/AIHints.cpp index 548a37eed..b3f64f39b 100644 --- a/projects/mtg/src/AIHints.cpp +++ b/projects/mtg/src/AIHints.cpp @@ -251,4 +251,4 @@ AIAction * AIHints::suggestAbility(ManaCost * potentialMana) } return NULL; -} \ No newline at end of file +} diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index ced1bc257..2857c5b61 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -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); diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 5f9a59c65..ccebf9ffa 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -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) diff --git a/projects/mtg/src/DeckStats.cpp b/projects/mtg/src/DeckStats.cpp index e3e92f475..f3d1c3d76 100644 --- a/projects/mtg/src/DeckStats.cpp +++ b/projects/mtg/src/DeckStats.cpp @@ -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); diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 6bd9f1ea1..2b6c52255 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -818,7 +818,7 @@ void GameObserver::ButtonPressed(PlayGuiObject * target) { cardClick(NULL, avatar->player); } - else if (GuiPhaseBar* phaseBar = dynamic_cast(target)) + else if (dynamic_cast(target)) { MTGGamePhase::GetInstance()->NextGamePhase(); } diff --git a/projects/mtg/src/GameOptions.cpp b/projects/mtg/src/GameOptions.cpp index fa9ee7245..0e6c23d9a 100644 --- a/projects/mtg/src/GameOptions.cpp +++ b/projects/mtg/src/GameOptions.cpp @@ -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); diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index 11c07a30e..f93b2ff31 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -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) diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index 3637531dd..cd346de86 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -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; diff --git a/projects/mtg/src/OptionItem.cpp b/projects/mtg/src/OptionItem.cpp index 80e32e436..35dc98c3d 100644 --- a/projects/mtg/src/OptionItem.cpp +++ b/projects/mtg/src/OptionItem.cpp @@ -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]; diff --git a/projects/mtg/src/TranslateKeys.cpp b/projects/mtg/src/TranslateKeys.cpp index 74db1ccd5..829da2640 100644 --- a/projects/mtg/src/TranslateKeys.cpp +++ b/projects/mtg/src/TranslateKeys.cpp @@ -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(NULL)); fattable[key] = k; diff --git a/projects/mtg/src/WGui.cpp b/projects/mtg/src/WGui.cpp index 1e8496536..85bb865c7 100644 --- a/projects/mtg/src/WGui.cpp +++ b/projects/mtg/src/WGui.cpp @@ -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;