From 73c2d1708015938966d598d73631d73668f2ef9e Mon Sep 17 00:00:00 2001 From: citiral Date: Thu, 21 Nov 2013 20:38:41 +0100 Subject: [PATCH 01/12] Updated deckmenu.cpp to properly render deck description and summary Deck description and statistics were being drawn as black text, this made it invisible as it was rendered over a black background. I made it change the color to white before drawing, so its shown as its suposed to be.(Did the default text color change?) --- projects/mtg/src/DeckMenu.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/mtg/src/DeckMenu.cpp b/projects/mtg/src/DeckMenu.cpp index 6c589a67a..3d205b539 100644 --- a/projects/mtg/src/DeckMenu.cpp +++ b/projects/mtg/src/DeckMenu.cpp @@ -293,6 +293,7 @@ void DeckMenu::Render() // fill in the description part of the screen string text = wordWrap(_(currentMenuItem->getDescription()), descWidth, descriptionFont->mFontID ); + descriptionFont->SetColor(ARGB(255,255,255,255)); descriptionFont->DrawString(text.c_str(), descX, descY); // fill in the statistical portion @@ -301,6 +302,7 @@ void DeckMenu::Render() ostringstream oss; oss << _("Deck: ") << currentMenuItem->getDeckName() << endl; oss << currentMenuItem->getDeckStatsSummary(); + descriptionFont->SetColor(ARGB(255,255,255,255)); descriptionFont->DrawString(oss.str(), statsX, statsY); } From 352e3c2daae235ff4198f1084232be199114c235 Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Sat, 23 Nov 2013 16:03:04 +0100 Subject: [PATCH 02/12] Remove makros and add undefs to avoid clashing names FRAND and Clamp were not used and Clamp collided when doing unit builds. SQUARE(x) is longer than x*x and if x is an expression it gets evaluated twice. --- JGE/include/JGE.h | 11 +++++++++++ JGE/include/Vector3D.h | 11 +---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/JGE/include/JGE.h b/JGE/include/JGE.h index 8168821f3..80a2e3717 100644 --- a/JGE/include/JGE.h +++ b/JGE/include/JGE.h @@ -44,6 +44,17 @@ typedef WPARAM LocalKeySym; #include typedef KeySym LocalKeySym; #define LOCAL_KEY_NONE XK_VoidSymbol +#undef Status +#undef Bool +#undef None +#undef CursorShape +#undef KeyPress +#undef KeyRelease +#undef FocusIn +#undef FocusOut +#undef FontChange +#undef Unsorted +#undef GrayScale #elif defined(ANDROID) // This is temporary until we understand how to send real key events from Java typedef long unsigned int LocalKeySym; diff --git a/JGE/include/Vector3D.h b/JGE/include/Vector3D.h index 573af33ca..aa207353b 100644 --- a/JGE/include/Vector3D.h +++ b/JGE/include/Vector3D.h @@ -3,15 +3,6 @@ #include - -/*************************** Macros and constants ***************************/ -// returns a number ranging from -1.0 to 1.0 -#define FRAND (((float)rand()-(float)rand())/RAND_MAX) -#define Clamp(x, min, max) x = (x Date: Sat, 23 Nov 2013 16:09:11 +0100 Subject: [PATCH 03/12] Add/fix broken include guards --- projects/mtg/include/DeckManager.h | 5 +++++ projects/mtg/include/MTGPack.h | 2 +- projects/mtg/include/StyleManager.h | 5 +++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/projects/mtg/include/DeckManager.h b/projects/mtg/include/DeckManager.h index 1c324c667..02b9435f4 100644 --- a/projects/mtg/include/DeckManager.h +++ b/projects/mtg/include/DeckManager.h @@ -1,3 +1,6 @@ +#ifndef _DECK_MANAGER_H +#define _DECK_MANAGER_H + #include #include @@ -43,3 +46,5 @@ public: ~DeckManager(); }; + +#endif //_DECK_MANAGER_H diff --git a/projects/mtg/include/MTGPack.h b/projects/mtg/include/MTGPack.h index 84db2c957..a34faf48e 100644 --- a/projects/mtg/include/MTGPack.h +++ b/projects/mtg/include/MTGPack.h @@ -1,4 +1,4 @@ -#ifndef _MTGPACCK_H_ +#ifndef _MTGPACK_H_ #define _MTGPACK_H_ class ShopBooster; diff --git a/projects/mtg/include/StyleManager.h b/projects/mtg/include/StyleManager.h index dd929eb50..c08d40ab5 100644 --- a/projects/mtg/include/StyleManager.h +++ b/projects/mtg/include/StyleManager.h @@ -1,3 +1,6 @@ +#ifndef _STYLE_MANAGER_H_ +#define _STYLE_MANAGER_H_ + class WStyle { public: @@ -34,3 +37,5 @@ protected: string activeStyle; map styles; }; + +#endif //_STYLE_MANAGER_H_ From 9f0b70d1c9a2ab70fd3c71079e336dd8a24a242a Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Sat, 23 Nov 2013 16:18:45 +0100 Subject: [PATCH 04/12] Put constans into extra namespace as kBackToMainMenuID... collides with itself. GameStateAwards::kBackToMainMenuID and GameStateOptions::kBackToMainMenuID define those with different values. --- projects/mtg/src/GameStateAwards.cpp | 10 +++++----- projects/mtg/src/GameStateOptions.cpp | 17 ++++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/projects/mtg/src/GameStateAwards.cpp b/projects/mtg/src/GameStateAwards.cpp index 69c62d13e..de0a39447 100644 --- a/projects/mtg/src/GameStateAwards.cpp +++ b/projects/mtg/src/GameStateAwards.cpp @@ -21,7 +21,7 @@ enum ENUM_AWARDS_STATE }; -namespace +namespace GameStateAwardsConstants { const int kBackToTrophiesID = 2; const int kBackToMainMenuID = 1; @@ -186,8 +186,8 @@ void GameStateAwards::Update(float dt) SAFE_DELETE(menu); menu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), EXIT_AWARDS_MENU, this, Fonts::MENU_FONT, 50, 170); if (mState == STATE_DETAILS) - menu->Add(kBackToTrophiesID, "Back to Trophies"); - menu->Add(kBackToMainMenuID, "Back to Main Menu"); + menu->Add(GameStateAwardsConstants::kBackToTrophiesID, "Back to Trophies"); + menu->Add(GameStateAwardsConstants::kBackToMainMenuID, "Back to Main Menu"); menu->Add(kCancelMenuID, "Cancel"); break; case JGE_BTN_PREV: @@ -359,11 +359,11 @@ void GameStateAwards::ButtonPressed(int controllerId, int controlId) if (controllerId == EXIT_AWARDS_MENU) switch (controlId) { - case kBackToMainMenuID: + case GameStateAwardsConstants::kBackToMainMenuID: mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU); showMenu = false; break; - case kBackToTrophiesID: + case GameStateAwardsConstants::kBackToTrophiesID: mState = STATE_LISTVIEW; SAFE_DELETE(detailview); showMenu = false; diff --git a/projects/mtg/src/GameStateOptions.cpp b/projects/mtg/src/GameStateOptions.cpp index 883568fc0..e9f142d1d 100644 --- a/projects/mtg/src/GameStateOptions.cpp +++ b/projects/mtg/src/GameStateOptions.cpp @@ -7,13 +7,12 @@ #include "SimplePad.h" #include "Translate.h" -namespace +namespace GameStateOptionsConstants { const int kSaveAndBackToMainMenuID = 1; const int kBackToMainMenuID = 2; const int kNewProfileID = 4; const int kReloadID = 5; - } GameStateOptions::GameStateOptions(GameApp* parent) : @@ -78,7 +77,7 @@ void GameStateOptions::Start() optionsList->Add(NEW WGuiSplit(cPrf, cThm)); optionsList->Add(cStyle); - optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"), -102, kNewProfileID, this)); + optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"), -102, GameStateOptionsConstants::kNewProfileID, this)); optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable Cheat Mode"))); optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::OPTIMIZE_HAND, "Optimize Starting Hand"))); @@ -118,8 +117,8 @@ void GameStateOptions::Start() optionsTabs->Add(optionsList); optionsMenu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), -102, this, Fonts::MAIN_FONT, 50, 170); - optionsMenu->Add(kBackToMainMenuID, "Back to Main Menu"); - optionsMenu->Add(kSaveAndBackToMainMenuID, "Save And Exit"); + optionsMenu->Add(GameStateOptionsConstants::kBackToMainMenuID, "Back to Main Menu"); + optionsMenu->Add(GameStateOptionsConstants::kSaveAndBackToMainMenuID, "Save And Exit"); optionsMenu->Add(kCancelMenuID, "Cancel"); optionsTabs->Entering(JGE_BTN_NONE); @@ -285,21 +284,21 @@ void GameStateOptions::ButtonPressed(int controllerId, int controlId) if (controllerId == -102) switch (controlId) { - case kSaveAndBackToMainMenuID: + case GameStateOptionsConstants::kSaveAndBackToMainMenuID: mState = SAVE; break; //Set Audio volume - case kBackToMainMenuID: + case GameStateOptionsConstants::kBackToMainMenuID: mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU); break; case kCancelMenuID: mState = SHOW_OPTIONS; break; - case kNewProfileID: + case GameStateOptionsConstants::kNewProfileID: options.keypadStart("", &newProfile); options.keypadTitle("New Profile"); break; - case kReloadID: + case GameStateOptionsConstants::kReloadID: mReload = true; break; } From 3e94de985f0b8a8154e204664f2ce168f2608c2e Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Sat, 23 Nov 2013 16:25:14 +0100 Subject: [PATCH 05/12] Add more include guards --- projects/mtg/include/CacheEngine.h | 5 +++++ projects/mtg/include/DeckEditorMenu.h | 3 +++ projects/mtg/include/GuiMana.h | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/projects/mtg/include/CacheEngine.h b/projects/mtg/include/CacheEngine.h index 5203e3511..2a2b0ab0d 100644 --- a/projects/mtg/include/CacheEngine.h +++ b/projects/mtg/include/CacheEngine.h @@ -1,3 +1,6 @@ +#ifndef _CACHE_ENGINE_H_ +#define _CACHE_ENGINE_H_ + #include "PrecompiledHeader.h" #include "Threading.h" @@ -208,3 +211,5 @@ public: CardRetrieverBase* CacheEngine::sInstance = NULL; bool CacheEngine::sIsThreaded = false; + +#endif //_CACHE_ENGINE_H_ diff --git a/projects/mtg/include/DeckEditorMenu.h b/projects/mtg/include/DeckEditorMenu.h index a3c71e690..d252785ec 100644 --- a/projects/mtg/include/DeckEditorMenu.h +++ b/projects/mtg/include/DeckEditorMenu.h @@ -1,3 +1,5 @@ +#ifndef _DECK_EDITOR_MENU_H +#define _DECK_EDITOR_MENU_H #pragma once #include "DeckMenu.h" #include "DeckDataWrapper.h" @@ -19,3 +21,4 @@ public: void Render(); virtual ~DeckEditorMenu(); }; +#endif //_DECK_EDITOR_MENU_H diff --git a/projects/mtg/include/GuiMana.h b/projects/mtg/include/GuiMana.h index 289422175..d18655bc9 100644 --- a/projects/mtg/include/GuiMana.h +++ b/projects/mtg/include/GuiMana.h @@ -1,3 +1,6 @@ +#ifndef _GUI_MANA_H +#define _GUI_MANA_H + #include "string.h" #include #include @@ -51,3 +54,5 @@ public: virtual int receiveEventPlus(WEvent * e); virtual int receiveEventMinus(WEvent * e); }; + +#endif //_GUI_MANA_H From e0428ac7b0ecb474a7d149cd4ad6fe0e9aae9f7d Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Sat, 23 Nov 2013 17:04:24 +0100 Subject: [PATCH 06/12] Avoid more conflicts. We could now do unit builds... and make the linker put every data element and function into its own section. On linktime, we can output every discarded section and get a list of dead code (for that build). --- projects/mtg/src/CardSelector.cpp | 26 ++++++------ projects/mtg/src/DeckMenu.cpp | 36 ++++++++--------- projects/mtg/src/GameStateAwards.cpp | 10 ++--- projects/mtg/src/GameStateOptions.cpp | 16 ++++---- projects/mtg/src/GuiCombat.cpp | 16 ++++---- projects/mtg/src/SimpleMenu.cpp | 58 +++++++++++++-------------- 6 files changed, 81 insertions(+), 81 deletions(-) diff --git a/projects/mtg/src/CardSelector.cpp b/projects/mtg/src/CardSelector.cpp index f6e017516..cae1bee14 100644 --- a/projects/mtg/src/CardSelector.cpp +++ b/projects/mtg/src/CardSelector.cpp @@ -7,42 +7,42 @@ #include "Closest.cpp" #include "GameObserver.h" -struct Left: public Exp +struct CardSelectorLeft: public Exp { static inline bool test(CardSelector::Target* ref, CardSelector::Target* test) { return ref->x - test->x > fabs(ref->y - test->y); } }; -struct Right: public Exp +struct CardSelectorRight: public Exp { static inline bool test(CardSelector::Target* ref, CardSelector::Target* test) { return test->x - ref->x > fabs(ref->y - test->y); } }; -struct Up: public Exp +struct CardSelectorUp: public Exp { static inline bool test(CardSelector::Target* ref, CardSelector::Target* test) { return ref->y - test->y > fabs(ref->x - test->x); } }; -struct Down: public Exp +struct CardSelectorDown: public Exp { static inline bool test(CardSelector::Target* ref, CardSelector::Target* test) { return test->y - ref->y > fabs(ref->x - test->x); } }; -struct Diff: public Exp +struct CardSelectorDiff: public Exp { static inline bool test(CardSelector::Target* ref, CardSelector::Target* test) { return ref != test; } }; -struct True: public Exp +struct CardSelectorTrue: public Exp { static inline bool test(CardSelector::Target*, CardSelector::Target*) { @@ -94,7 +94,7 @@ void CardSelector::Remove(CardSelector::Target* card) CardView* c = dynamic_cast (active); if (c) c->zoom = 1.0f; - active = closest (cards, limitor, active); + active = closest (cards, limitor, active); c = dynamic_cast (active); if (c) c->zoom = 1.4f; @@ -120,7 +120,7 @@ CardSelector::Target* CardSelector::fetchMemory(SelectorMemory& memory) } // We come here if the card is not in the selector any more, or if // it is there but it is now refused by the limitor. - return closest (cards, limitor, memory.x, memory.y); + return closest (cards, limitor, memory.x, memory.y); } void CardSelector::Push() @@ -182,7 +182,7 @@ bool CardSelector::CheckUserInput(JButton key) if(!jge) return false; if(jge->GetLeftClickCoordinates(x, y)) { - active = closest (cards, limitor, static_cast (x), static_cast (y)); + active = closest (cards, limitor, static_cast (x), static_cast (y)); } switch (key) @@ -196,16 +196,16 @@ bool CardSelector::CheckUserInput(JButton key) goto switch_active; break; case JGE_BTN_LEFT: - active = closest (cards, limitor, active); + active = closest (cards, limitor, active); break; case JGE_BTN_RIGHT: - active = closest (cards, limitor, active); + active = closest (cards, limitor, active); break; case JGE_BTN_UP: - active = closest (cards, limitor, active); + active = closest (cards, limitor, active); break; case JGE_BTN_DOWN: - active = closest (cards, limitor, active); + active = closest (cards, limitor, active); break; case JGE_BTN_CANCEL: mDrawMode = (mDrawMode + 1) % DrawMode::kNumDrawModes; diff --git a/projects/mtg/src/DeckMenu.cpp b/projects/mtg/src/DeckMenu.cpp index 6c589a67a..19b8ffed3 100644 --- a/projects/mtg/src/DeckMenu.cpp +++ b/projects/mtg/src/DeckMenu.cpp @@ -13,16 +13,16 @@ #include -namespace +namespace DeckMenuConst { const float kVerticalMargin = 16; const float kHorizontalMargin = 20; const float kLineHeight = 25; - const float kDescriptionVerticalBoxPadding = -5; + const float kDescriptionVerticalBoxPadding = -5; const float kDescriptionHorizontalBoxPadding = 5; const float kDefaultFontScale = 1.0f; - const float kVerticalScrollSpeed = 7.0f; + const float kVerticalScrollSpeed = 7.0f; const int DETAILED_INFO_THRESHOLD = 20; const int kDetailedInfoButtonId = 10000; @@ -52,8 +52,8 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc titleY = 15; titleWidth = 180; // width of inner box of title - descX = 260 + kDescriptionHorizontalBoxPadding; - descY = 100 + kDescriptionVerticalBoxPadding; + descX = 260 + DeckMenuConst::kDescriptionHorizontalBoxPadding; + descY = 100 + DeckMenuConst::kDescriptionVerticalBoxPadding; descHeight = 145; descWidth = 195; @@ -73,11 +73,11 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc float scrollerWidth = 200.0f; float scrollerHeight = 28.0f; - mScroller = NEW VerticalTextScroller(Fonts::MAIN_FONT, 14, 235, scrollerWidth, scrollerHeight, kVerticalScrollSpeed); + mScroller = NEW VerticalTextScroller(Fonts::MAIN_FONT, 14, 235, scrollerWidth, scrollerHeight, DeckMenuConst::kVerticalScrollSpeed); mAutoTranslate = true; maxItems = 6; - mHeight = 2 * kVerticalMargin + (maxItems * kLineHeight); + mHeight = 2 * DeckMenuConst::kVerticalMargin + (maxItems * DeckMenuConst::kLineHeight); // we want to cap the deck titles to 15 characters to avoid overflowing deck names title = _(_title); @@ -94,7 +94,7 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc else titleFontScale = SCALE_NORMAL; - mSelectionTargetY = selectionY = kVerticalMargin; + mSelectionTargetY = selectionY = DeckMenuConst::kVerticalMargin; if (NULL == stars) stars = NEW hgeParticleSystem(WResourceManager::Instance()->RetrievePSI("stars.psi", WResourceManager::Instance()->GetQuad("stars").get())); @@ -106,7 +106,7 @@ JGuiController(JGE::GetInstance(), id, listener), fontId(fontId), mShowDetailsSc float stringWidth = descriptionFont->GetStringWidth(detailedInfoString.c_str()); float boxStartX = detailedInfoBoxX - stringWidth / 2 + 20; - dismissButton = NEW InteractiveButton( this, kDetailedInfoButtonId, Fonts::MAIN_FONT, detailedInfoString, boxStartX, detailedInfoBoxY, JGE_BTN_CANCEL); + dismissButton = NEW InteractiveButton( this, DeckMenuConst::kDetailedInfoButtonId, Fonts::MAIN_FONT, detailedInfoString, boxStartX, detailedInfoBoxY, JGE_BTN_CANCEL); JGuiController::Add(dismissButton, true); updateScroller(); @@ -181,7 +181,7 @@ bool DeckMenu::showDetailsScreen() if (currentMenuItem) { if (mAlwaysShowDetailsButton) return true; - if (mShowDetailsScreen && currentMenuItem->getVictories() > DETAILED_INFO_THRESHOLD) return true; + if (mShowDetailsScreen && currentMenuItem->getVictories() > DeckMenuConst::DETAILED_INFO_THRESHOLD) return true; } return false; @@ -189,10 +189,10 @@ bool DeckMenu::showDetailsScreen() void DeckMenu::initMenuItems() { - float sY = mY + kVerticalMargin; + float sY = mY + DeckMenuConst::kVerticalMargin; for (int i = startId; i < mCount; ++i) { - float y = mY + kVerticalMargin + i * kLineHeight; + float y = mY + DeckMenuConst::kVerticalMargin + i * DeckMenuConst::kLineHeight; DeckMenuItem * currentMenuItem = static_cast (mObjects[i]); currentMenuItem->Relocate(mX, y); if (currentMenuItem->hasFocus()) sY = y; @@ -248,7 +248,7 @@ void DeckMenu::Render() { if (i > mCount - 1) break; DeckMenuItem *currentMenuItem = static_cast (mObjects[i]); - if (currentMenuItem->getY() - kLineHeight * startId < mY + height - kLineHeight + 7) + if (currentMenuItem->getY() - DeckMenuConst::kLineHeight * startId < mY + height - DeckMenuConst::kLineHeight + 7) { // only load stats for visible items in the list DeckMetaData* metaData = currentMenuItem->getMetaData(); @@ -309,7 +309,7 @@ void DeckMenu::Render() } else // reset the font color to be slightly muted mFont->SetColor(ARGB(150,255,255,255)); - currentMenuItem->RenderWithOffset(-kLineHeight * startId); + currentMenuItem->RenderWithOffset(-DeckMenuConst::kLineHeight * startId); } } @@ -342,8 +342,8 @@ void DeckMenu::Update(float dt) selectionT += 3 * dt; selectionY += (mSelectionTargetY - selectionY) * 8 * dt; - float starsX = starsOffsetX + ((mWidth - 2 * kHorizontalMargin) * (1 + cos(selectionT)) / 2); - float starsY = selectionY + 5 * cos(selectionT * 2.35f) + kLineHeight / 2 - kLineHeight * startId; + float starsX = starsOffsetX + ((mWidth - 2 * DeckMenuConst::kHorizontalMargin) * (1 + cos(selectionT)) / 2); + float starsY = selectionY + 5 * cos(selectionT * 2.35f) + DeckMenuConst::kLineHeight / 2 - DeckMenuConst::kLineHeight * startId; stars->MoveTo(starsX, starsY); // @@ -371,7 +371,7 @@ void DeckMenu::Update(float dt) void DeckMenu::Add(int id, const char * text, string desc, bool forceFocus, DeckMetaData * deckMetaData) { DeckMenuItem * menuItem = NEW DeckMenuItem(this, id, fontId, text, 0, - mY + kVerticalMargin + mCount * kLineHeight, (mCount == 0), mAutoTranslate, deckMetaData); + mY + DeckMenuConst::kVerticalMargin + mCount * DeckMenuConst::kLineHeight, (mCount == 0), mAutoTranslate, deckMetaData); Translator * t = Translator::GetInstance(); map::iterator it = t->deckValues.find(text); string deckDescription = ""; @@ -384,7 +384,7 @@ void DeckMenu::Add(int id, const char * text, string desc, bool forceFocus, Deck menuItem->setDescription(deckDescription); JGuiController::Add(menuItem); - if (mCount <= maxItems) mHeight += kLineHeight; + if (mCount <= maxItems) mHeight += DeckMenuConst::kLineHeight; if (forceFocus) { diff --git a/projects/mtg/src/GameStateAwards.cpp b/projects/mtg/src/GameStateAwards.cpp index de0a39447..8012f6825 100644 --- a/projects/mtg/src/GameStateAwards.cpp +++ b/projects/mtg/src/GameStateAwards.cpp @@ -21,7 +21,7 @@ enum ENUM_AWARDS_STATE }; -namespace GameStateAwardsConstants +namespace GameStateAwardsConst { const int kBackToTrophiesID = 2; const int kBackToMainMenuID = 1; @@ -186,8 +186,8 @@ void GameStateAwards::Update(float dt) SAFE_DELETE(menu); menu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), EXIT_AWARDS_MENU, this, Fonts::MENU_FONT, 50, 170); if (mState == STATE_DETAILS) - menu->Add(GameStateAwardsConstants::kBackToTrophiesID, "Back to Trophies"); - menu->Add(GameStateAwardsConstants::kBackToMainMenuID, "Back to Main Menu"); + menu->Add(GameStateAwardsConst::kBackToTrophiesID, "Back to Trophies"); + menu->Add(GameStateAwardsConst::kBackToMainMenuID, "Back to Main Menu"); menu->Add(kCancelMenuID, "Cancel"); break; case JGE_BTN_PREV: @@ -359,11 +359,11 @@ void GameStateAwards::ButtonPressed(int controllerId, int controlId) if (controllerId == EXIT_AWARDS_MENU) switch (controlId) { - case GameStateAwardsConstants::kBackToMainMenuID: + case GameStateAwardsConst::kBackToMainMenuID: mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU); showMenu = false; break; - case GameStateAwardsConstants::kBackToTrophiesID: + case GameStateAwardsConst::kBackToTrophiesID: mState = STATE_LISTVIEW; SAFE_DELETE(detailview); showMenu = false; diff --git a/projects/mtg/src/GameStateOptions.cpp b/projects/mtg/src/GameStateOptions.cpp index e9f142d1d..981eee505 100644 --- a/projects/mtg/src/GameStateOptions.cpp +++ b/projects/mtg/src/GameStateOptions.cpp @@ -7,7 +7,7 @@ #include "SimplePad.h" #include "Translate.h" -namespace GameStateOptionsConstants +namespace GameStateOptionsConst { const int kSaveAndBackToMainMenuID = 1; const int kBackToMainMenuID = 2; @@ -77,7 +77,7 @@ void GameStateOptions::Start() optionsList->Add(NEW WGuiSplit(cPrf, cThm)); optionsList->Add(cStyle); - optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"), -102, GameStateOptionsConstants::kNewProfileID, this)); + optionsList->Add(NEW WGuiButton(NEW WGuiHeader("New Profile"), -102, GameStateOptionsConst::kNewProfileID, this)); optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::CHEATMODE, "Enable Cheat Mode"))); optionsList->Add(NEW WDecoCheat(NEW OptionInteger(Options::OPTIMIZE_HAND, "Optimize Starting Hand"))); @@ -117,8 +117,8 @@ void GameStateOptions::Start() optionsTabs->Add(optionsList); optionsMenu = NEW SimpleMenu(JGE::GetInstance(), WResourceManager::Instance(), -102, this, Fonts::MAIN_FONT, 50, 170); - optionsMenu->Add(GameStateOptionsConstants::kBackToMainMenuID, "Back to Main Menu"); - optionsMenu->Add(GameStateOptionsConstants::kSaveAndBackToMainMenuID, "Save And Exit"); + optionsMenu->Add(GameStateOptionsConst::kBackToMainMenuID, "Back to Main Menu"); + optionsMenu->Add(GameStateOptionsConst::kSaveAndBackToMainMenuID, "Save And Exit"); optionsMenu->Add(kCancelMenuID, "Cancel"); optionsTabs->Entering(JGE_BTN_NONE); @@ -284,21 +284,21 @@ void GameStateOptions::ButtonPressed(int controllerId, int controlId) if (controllerId == -102) switch (controlId) { - case GameStateOptionsConstants::kSaveAndBackToMainMenuID: + case GameStateOptionsConst::kSaveAndBackToMainMenuID: mState = SAVE; break; //Set Audio volume - case GameStateOptionsConstants::kBackToMainMenuID: + case GameStateOptionsConst::kBackToMainMenuID: mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU); break; case kCancelMenuID: mState = SHOW_OPTIONS; break; - case GameStateOptionsConstants::kNewProfileID: + case GameStateOptionsConst::kNewProfileID: options.keypadStart("", &newProfile); options.keypadTitle("New Profile"); break; - case GameStateOptionsConstants::kReloadID: + case GameStateOptionsConst::kReloadID: mReload = true; break; } diff --git a/projects/mtg/src/GuiCombat.cpp b/projects/mtg/src/GuiCombat.cpp index 29888cac1..129352d59 100644 --- a/projects/mtg/src/GuiCombat.cpp +++ b/projects/mtg/src/GuiCombat.cpp @@ -16,21 +16,21 @@ const float kZoom_level1 = 1.4f; const float kZoom_level2 = 2.2f; const float kZoom_level3 = 2.7f; -struct True: public Exp +struct GuiCombatTrue: public Exp { static inline bool test(DamagerDamaged*, DamagerDamaged*) { return true; } }; -struct Left: public Exp +struct GuiCombatLeft: public Exp { static inline bool test(DamagerDamaged* ref, DamagerDamaged* test) { return ref->y == test->y && ref->x > test->x && test->show; } }; -struct Right: public Exp +struct GuiCombatRight: public Exp { static inline bool test(DamagerDamaged* ref, DamagerDamaged* test) { @@ -217,7 +217,7 @@ void GuiCombat::shiftLeft() case ATK: { DamagerDamaged* old = active; - active = closest (attackers, NULL, static_cast (active)); + active = closest (attackers, NULL, static_cast (active)); activeAtk = static_cast (active); if (old != active) { @@ -231,7 +231,7 @@ void GuiCombat::shiftLeft() case BLK: { DamagerDamaged* old = active; - active = closest (activeAtk->blockers, NULL, static_cast (active)); + active = closest (activeAtk->blockers, NULL, static_cast (active)); if (old != active) { if (old) @@ -255,7 +255,7 @@ void GuiCombat::shiftRight( DamagerDamaged* oldActive ) case BLK: { DamagerDamaged* old = active; - active = closest (activeAtk->blockers, NULL, static_cast (active)); + active = closest (activeAtk->blockers, NULL, static_cast (active)); if (old != active) { if (old) @@ -268,7 +268,7 @@ void GuiCombat::shiftRight( DamagerDamaged* oldActive ) case ATK: { DamagerDamaged* old = active; - active = closest (attackers, NULL, static_cast (active)); + active = closest (attackers, NULL, static_cast (active)); if (active == oldActive) { active = activeAtk = NULL; @@ -321,7 +321,7 @@ bool GuiCombat::CheckUserInput(JButton key) // position selected card if (BLK == cursor_pos) { - DamagerDamaged* selectedCard = closest (activeAtk->blockers, NULL, static_cast (x), static_cast (y)); + DamagerDamaged* selectedCard = closest (activeAtk->blockers, NULL, static_cast (x), static_cast (y)); // find the index into the vector where the current selected card is. int c1 = 0, c2 = 0; int i = 0; diff --git a/projects/mtg/src/SimpleMenu.cpp b/projects/mtg/src/SimpleMenu.cpp index 5cf6ec947..3aaa15ad0 100644 --- a/projects/mtg/src/SimpleMenu.cpp +++ b/projects/mtg/src/SimpleMenu.cpp @@ -6,7 +6,7 @@ #include "GameApp.h" #include "Translate.h" -namespace +namespace SimpleMenuConst { const float kPoleWidth = 7; const float kVerticalMargin = 20; @@ -38,7 +38,7 @@ SimpleMenu::SimpleMenu(JGE* jge, WResourceManager* resourceManager, int id, JGui { autoTranslate = true; isMultipleChoice = false; - mHeight = 2 * kVerticalMargin; + mHeight = 2 * SimpleMenuConst::kVerticalMargin; mWidth = 0; mX = x; mY = y; @@ -48,7 +48,7 @@ SimpleMenu::SimpleMenu(JGE* jge, WResourceManager* resourceManager, int id, JGui selectionT = 0; timeOpen = 0; mClosed = false; - selectionTargetY = selectionY = y + kVerticalMargin; + selectionTargetY = selectionY = y + SimpleMenuConst::kVerticalMargin; if(resourceManager) { @@ -61,7 +61,7 @@ SimpleMenu::SimpleMenu(JGE* jge, WResourceManager* resourceManager, int id, JGui spadeL = resourceManager->RetrieveQuad("spade_ul.png", 0, 0, 0, 0, "spade_ul", RETRIEVE_MANAGE); spadeR = resourceManager->RetrieveQuad("spade_ur.png", 0, 0, 0, 0, "spade_ur", RETRIEVE_MANAGE); jewel.reset(NEW JQuad(jewelTex, 1, 1, 3, 3)); - side = resourceManager->RetrieveQuad("menuside.png", 1, 1, 1, kPoleWidth, "menuside", RETRIEVE_MANAGE); + side = resourceManager->RetrieveQuad("menuside.png", 1, 1, 1, SimpleMenuConst::kPoleWidth, "menuside", RETRIEVE_MANAGE); stars = NEW hgeParticleSystem(resourceManager->RetrievePSI("stars.psi", resourceManager->GetQuad("stars").get())); @@ -78,16 +78,16 @@ void SimpleMenu::drawHorzPole(float x, float y, float width) { JRenderer* renderer = JRenderer::GetInstance(); - float leftXOffset = (spadeR->mWidth - kPoleWidth) / 2; + float leftXOffset = (spadeR->mWidth - SimpleMenuConst::kPoleWidth) / 2; float rightXOffset = leftXOffset; float yOffset = leftXOffset; if (spadeR->mWidth != spadeR->mHeight) { //We have a weird case to deal with in the "Classic" theme, the spades graphics need to be aligned specifically, // While the ones in the "Final Saga" theme need to be centered - leftXOffset = kSpadeWidthOffset; - yOffset = kSpadeHeightOffset; - rightXOffset = kSpadeRightBottomOffset; + leftXOffset = SimpleMenuConst::kSpadeWidthOffset; + yOffset = SimpleMenuConst::kSpadeHeightOffset; + rightXOffset = SimpleMenuConst::kSpadeRightBottomOffset; } renderer->RenderQuad(side.get(), x, y, 0, width); @@ -104,23 +104,23 @@ void SimpleMenu::drawVertPole(float x, float y, float height) { JRenderer* renderer = JRenderer::GetInstance(); - float xOffset = (spadeR->mWidth - kPoleWidth) / 2; + float xOffset = (spadeR->mWidth - SimpleMenuConst::kPoleWidth) / 2; float topYOffset = xOffset; float bottomYOffset = xOffset; if (spadeR->mWidth != spadeR->mHeight) { //We have a weird case to deal with in the "Classic" theme, the spades graphics need to be aligned specifically, // While the ones in the "Final Saga" theme need to be centered - xOffset = kSpadeHeightOffset; - topYOffset = kSpadeWidthOffset; - bottomYOffset = kSpadeRightBottomOffset; + xOffset = SimpleMenuConst::kSpadeHeightOffset; + topYOffset = SimpleMenuConst::kSpadeWidthOffset; + bottomYOffset = SimpleMenuConst::kSpadeRightBottomOffset; } - renderer->RenderQuad(side.get(), x + kPoleWidth, y, M_PI / 2, height); + renderer->RenderQuad(side.get(), x + SimpleMenuConst::kPoleWidth, y, M_PI / 2, height); spadeR->SetHFlip(true); spadeL->SetHFlip(false); - renderer->RenderQuad(spadeR.get(), x + kPoleWidth + xOffset, y - topYOffset, M_PI / 2); - renderer->RenderQuad(spadeL.get(), x + kPoleWidth + xOffset, y + height - bottomYOffset, M_PI / 2); + renderer->RenderQuad(spadeR.get(), x + SimpleMenuConst::kPoleWidth + xOffset, y - topYOffset, M_PI / 2); + renderer->RenderQuad(spadeL.get(), x + SimpleMenuConst::kPoleWidth + xOffset, y + height - bottomYOffset, M_PI / 2); renderer->RenderQuad(jewel.get(), x - 1, y - 1); renderer->RenderQuad(jewel.get(), x - 1, y + height - 1); @@ -133,7 +133,7 @@ void SimpleMenu::Render() WFont * mFont = WResourceManager::Instance()->GetWFont(fontId); if (0 == mWidth) { - float sY = mY + kVerticalMargin; + float sY = mY + SimpleMenuConst::kVerticalMargin; for (int i = 0; i < mCount; ++i) { @@ -146,7 +146,7 @@ void SimpleMenu::Render() if ((!title.empty()) && (mWidth < titleFont->GetStringWidth(title.c_str()))) mWidth = titleFont->GetStringWidth(title.c_str()); titleFont->SetScale(scaleFactor); - mWidth += 2 * kHorizontalMargin; + mWidth += 2 * SimpleMenuConst::kHorizontalMargin; if (mCenterHorizontal) mX = (SCREEN_WIDTH_F - mWidth) / 2; @@ -156,7 +156,7 @@ void SimpleMenu::Render() for (int i = 0; i < mCount; ++i) { - float y = mY + kVerticalMargin + i * kLineHeight; + float y = mY + SimpleMenuConst::kVerticalMargin + i * SimpleMenuConst::kLineHeight; SimpleMenuItem * smi = static_cast (mObjects[i]); smi->Relocate(mX + mWidth / 2, y); if (smi->hasFocus()) sY = y; @@ -171,7 +171,7 @@ void SimpleMenu::Render() float height = mHeight; if (timeOpen < 1) height *= timeOpen > 0 ? timeOpen : -timeOpen; - float heightPadding = kLineHeight/2; // this to reduce the bottom padding of the menu + float heightPadding = SimpleMenuConst::kLineHeight/2; // this to reduce the bottom padding of the menu renderer->FillRect(mX, mY, mWidth, height - heightPadding, ARGB(180,0,0,0)); renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA); @@ -200,8 +200,8 @@ void SimpleMenu::Render() { if (i > mCount - 1) break; SimpleMenuItem *currentMenuItem = static_cast(mObjects[i]); - float currentY = currentMenuItem->getY() - kLineHeight * startId; - float menuBottomEdge = mY + height - kLineHeight + 7; + float currentY = currentMenuItem->getY() - SimpleMenuConst::kLineHeight * startId; + float menuBottomEdge = mY + height - SimpleMenuConst::kLineHeight + 7; if (currentY < menuBottomEdge) { if (currentMenuItem->hasFocus()) @@ -214,7 +214,7 @@ void SimpleMenu::Render() { mFont->SetColor(ARGB(150,255,255,255)); } - (static_cast (mObjects[i]))->RenderWithOffset(-kLineHeight * startId); + (static_cast (mObjects[i]))->RenderWithOffset(-SimpleMenuConst::kLineHeight * startId); } mFont->SetScale(SCALE_NORMAL); } @@ -244,8 +244,8 @@ bool SimpleMenu::CheckUserInput(JButton key) if (mObjects.size()) { float top, left; - float menuTopEdge = mY + kLineHeight; - float menuBottomEdge = mY + mHeight - (kLineHeight/2); + float menuTopEdge = mY + SimpleMenuConst::kLineHeight; + float menuBottomEdge = mY + mHeight - (SimpleMenuConst::kLineHeight/2); if (y < menuTopEdge) n = (mCurr - 1) > 0 ? mCurr -1 : 0; @@ -257,7 +257,7 @@ bool SimpleMenu::CheckUserInput(JButton key) { if (mObjects[i]->getTopLeft(top, left)) { - if ( (y > top) && (y <= (top + kLineHeight)) ) + if ( (y > top) && (y <= (top + SimpleMenuConst::kLineHeight)) ) n = i; } } @@ -308,8 +308,8 @@ void SimpleMenu::Update(float dt) selectionT += 3 * dt; selectionY += (selectionTargetY - selectionY) * 8 * dt; if(stars) - stars->MoveTo(mX + kHorizontalMargin + ((mWidth - 2 * kHorizontalMargin) * (1 + cos(selectionT)) / 2), selectionY + 5 * cos( - selectionT * 2.35f) + kLineHeight / 2 - kLineHeight * startId); + stars->MoveTo(mX + SimpleMenuConst::kHorizontalMargin + ((mWidth - 2 * SimpleMenuConst::kHorizontalMargin) * (1 + cos(selectionT)) / 2), selectionY + 5 * cos( + selectionT * 2.35f) + SimpleMenuConst::kLineHeight / 2 - SimpleMenuConst::kLineHeight * startId); if (timeOpen < 0) { timeOpen += dt * 10; @@ -330,12 +330,12 @@ void SimpleMenu::Update(float dt) void SimpleMenu::Add(int id, const char * text, string desc, bool forceFocus) { - SimpleMenuItem * smi = NEW SimpleMenuItem(this, id, fontId, text, 0, mY + kVerticalMargin + mCount * kLineHeight, + SimpleMenuItem * smi = NEW SimpleMenuItem(this, id, fontId, text, 0, mY + SimpleMenuConst::kVerticalMargin + mCount * SimpleMenuConst::kLineHeight, (mCount == 0), autoTranslate); smi->setDescription(desc); JGuiController::Add(smi); - if (mCount <= maxItems) mHeight += kLineHeight; + if (mCount <= maxItems) mHeight += SimpleMenuConst::kLineHeight; if (forceFocus) { mObjects[mCurr]->Leaving(JGE_BTN_DOWN); From 0bb211a5817fd4f2c31f202bb6c4568b48f4606b Mon Sep 17 00:00:00 2001 From: Tobias Loose Date: Sun, 24 Nov 2013 09:18:34 +0100 Subject: [PATCH 07/12] Remove unused global variables from DeckStats.cpp and add proper... member variable initialization. --- projects/mtg/src/DeckStats.cpp | 35 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/projects/mtg/src/DeckStats.cpp b/projects/mtg/src/DeckStats.cpp index c18d66cd3..5cb4c4dff 100644 --- a/projects/mtg/src/DeckStats.cpp +++ b/projects/mtg/src/DeckStats.cpp @@ -271,22 +271,6 @@ void DeckStats::EndInstance() // StatsWrapper - - float noLandsProbInTurn[Constants::STATS_FOR_TURNS] = {0.0f}; - float noCreaturesProbInTurn[Constants::STATS_FOR_TURNS] = {0.0f}; - - int countCardsPerCostAndColor[Constants::STATS_MAX_MANA_COST + 1][Constants::MTG_NB_COLORS + 1] = {{0,0}}; - int countCreaturesPerCostAndColor[Constants::STATS_MAX_MANA_COST + 1][Constants::MTG_NB_COLORS + 1] = {{0,0}}; - int countSpellsPerCostAndColor[Constants::STATS_MAX_MANA_COST + 1][Constants::MTG_NB_COLORS + 1] = {{0,0}}; - - int countCardsPerCost[Constants::STATS_MAX_MANA_COST + 1] = {0}; - int countCreaturesPerCost[Constants::STATS_MAX_MANA_COST + 1] = {0}; - int countSpellsPerCost[Constants::STATS_MAX_MANA_COST + 1] = {0}; - int countLandsPerColor[Constants::MTG_NB_COLORS + 1] = {0}; - int countBasicLandsPerColor[Constants::MTG_NB_COLORS + 1] = {0}; - int countNonLandProducersPerColor[Constants::MTG_NB_COLORS + 1] = {0}; - int totalCostPerColor[Constants::MTG_NB_COLORS + 1] = {0}; - void StatsWrapper::initValues() { // initilize all member values to 0 @@ -301,7 +285,24 @@ void StatsWrapper::initValues() avgManaCost = avgCreatureCost = avgSpellCost = 0.0f; countCreatures = countSpells = countInstants = countEnchantments = countSorceries = countArtifacts = 0; - + + //this works only with 0.0f on floats + memset(noLandsProbInTurn, 0.0f, sizeof(float) * Constants::STATS_FOR_TURNS); + memset(noCreaturesProbInTurn, 0.0f, sizeof(float) * Constants::STATS_FOR_TURNS); + + memset(countCardsPerCost, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)); + memset(countCreaturesPerCost, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)); + memset(countSpellsPerCost, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)); + + memset(countCardsPerCostAndColor, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)*(Constants::MTG_NB_COLORS + 1)); + memset(countCreaturesPerCostAndColor, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)*(Constants::MTG_NB_COLORS + 1)); + memset(countSpellsPerCostAndColor, 0, sizeof(int) * (Constants::STATS_MAX_MANA_COST + 1)*(Constants::MTG_NB_COLORS + 1)); + + memset(countLandsPerColor, 0, sizeof(int) * (Constants::MTG_NB_COLORS + 1)); + memset(countBasicLandsPerColor, 0, sizeof(int) * (Constants::MTG_NB_COLORS + 1)); + memset(countNonLandProducersPerColor, 0, sizeof(int) * (Constants::MTG_NB_COLORS + 1)); + memset(totalCostPerColor, 0, sizeof(int) * (Constants::MTG_NB_COLORS + 1)); + } StatsWrapper::StatsWrapper(int deckId) From 73f9319b923f5f1f119b368f6b08e181c7cf3e7c Mon Sep 17 00:00:00 2001 From: xawotihs Date: Mon, 25 Nov 2013 05:27:31 +0100 Subject: [PATCH 08/12] Activates Android build from Travis --- .travis.yml | 6 ++++++ travis-script.sh | 8 +++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2b6cf9e36..2e4b93d3a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,13 @@ before_install: - export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" - export PSPSDK="$PSPDEV/psp/sdk" - export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" + - export ANDROID="android-sdk-linux/tools/android" install: - wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download - tar -x --xz -f sdk.lzma + - wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv + - wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv + - tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 + - tar -zxf android-sdk_r22-linux.tgz + - $ANDROID update sdk --filter 1,2,3,8 --no-ui --force > log.txt script: "./travis-script.sh" diff --git a/travis-script.sh b/travis-script.sh index b9461e8a9..6927f0dc8 100755 --- a/travis-script.sh +++ b/travis-script.sh @@ -7,9 +7,15 @@ cd .. cd projects/mtg mkdir objs make -j 8 +cd ../.. + +# we're building an Android binary here +android-ndk-r9/ndk-build -C projects/mtg/Android -j8 +$ANDROID list targets +$ANDROID update project -t 1 -p projects/mtg/Android +ant debug -f projects/mtg/Android/build.xml # let's try an Intel linux binary -cd ../.. qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug DEFINES+=CAPTURE_STDERR make -j 8 From 9889186eab09450ba069f18c6dd8991845930b60 Mon Sep 17 00:00:00 2001 From: Dmitry Panin Date: Mon, 25 Nov 2013 13:41:29 +0400 Subject: [PATCH 09/12] Added missing "echo" statement --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2e4b93d3a..5fee256d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,5 +11,5 @@ install: - wget http://dl.google.com/android/android-sdk_r22-linux.tgz -nv - tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 - tar -zxf android-sdk_r22-linux.tgz - - $ANDROID update sdk --filter 1,2,3,8 --no-ui --force > log.txt + - echo yes | $ANDROID update sdk --filter 1,2,3,8 --no-ui --force > log.txt script: "./travis-script.sh" From fac44c4b48361b8f63f21e8fcb8f3dfa57d41106 Mon Sep 17 00:00:00 2001 From: Rolzad73 Date: Mon, 25 Nov 2013 11:53:34 -0500 Subject: [PATCH 10/12] - updated AndroidManifest.xml to match desired API values. - removed CardEffect.cpp reference from Android.mk build file. - added sdk.buildtools=18.1.1 line to default.properties and project.properties - updated .gitignore --- projects/mtg/Android/.gitignore | 1 + projects/mtg/Android/AndroidManifest.xml | 2 +- projects/mtg/Android/default.properties | 4 ++++ projects/mtg/Android/jni/Android.mk | 1 - projects/mtg/Android/project.properties | 4 ++++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/projects/mtg/Android/.gitignore b/projects/mtg/Android/.gitignore index b2b2f4c62..5a9b113aa 100644 --- a/projects/mtg/Android/.gitignore +++ b/projects/mtg/Android/.gitignore @@ -1,2 +1,3 @@ /gen +/bin diff --git a/projects/mtg/Android/AndroidManifest.xml b/projects/mtg/Android/AndroidManifest.xml index 0ed014758..8fd0e2815 100644 --- a/projects/mtg/Android/AndroidManifest.xml +++ b/projects/mtg/Android/AndroidManifest.xml @@ -14,5 +14,5 @@ - + diff --git a/projects/mtg/Android/default.properties b/projects/mtg/Android/default.properties index 8010039f3..3f05ff78e 100644 --- a/projects/mtg/Android/default.properties +++ b/projects/mtg/Android/default.properties @@ -9,3 +9,7 @@ # Project target. target=android-10 + +# Project build tools version +sdk.buildtools=18.1.1 + diff --git a/projects/mtg/Android/jni/Android.mk b/projects/mtg/Android/jni/Android.mk index da01c8a6d..faa1067b3 100644 --- a/projects/mtg/Android/jni/Android.mk +++ b/projects/mtg/Android/jni/Android.mk @@ -41,7 +41,6 @@ LOCAL_SRC_FILES := $(SDL_PATH)/src/main/android/SDL_android_main.cpp \ $(MTG_PATH)/src/AllAbilities.cpp \ $(MTG_PATH)/src/CardDescriptor.cpp \ $(MTG_PATH)/src/CardDisplay.cpp \ - $(MTG_PATH)/src/CardEffect.cpp \ $(MTG_PATH)/src/CardGui.cpp \ $(MTG_PATH)/src/CardPrimitive.cpp \ $(MTG_PATH)/src/CardSelector.cpp \ diff --git a/projects/mtg/Android/project.properties b/projects/mtg/Android/project.properties index b7c2081d5..15f4d07e4 100644 --- a/projects/mtg/Android/project.properties +++ b/projects/mtg/Android/project.properties @@ -12,3 +12,7 @@ # Project target. target=android-10 + +# Build tools version +sdk.buildtools=18.1.1 + From 8aa0b8cea0aba2622ba1ef8c73a698071295b5ee Mon Sep 17 00:00:00 2001 From: Rolzad73 Date: Mon, 25 Nov 2013 13:41:07 -0500 Subject: [PATCH 11/12] reverting sdk.buildtools change --- projects/mtg/Android/default.properties | 4 ---- projects/mtg/Android/project.properties | 4 ---- 2 files changed, 8 deletions(-) diff --git a/projects/mtg/Android/default.properties b/projects/mtg/Android/default.properties index 3f05ff78e..8010039f3 100644 --- a/projects/mtg/Android/default.properties +++ b/projects/mtg/Android/default.properties @@ -9,7 +9,3 @@ # Project target. target=android-10 - -# Project build tools version -sdk.buildtools=18.1.1 - diff --git a/projects/mtg/Android/project.properties b/projects/mtg/Android/project.properties index 15f4d07e4..b7c2081d5 100644 --- a/projects/mtg/Android/project.properties +++ b/projects/mtg/Android/project.properties @@ -12,7 +12,3 @@ # Project target. target=android-10 - -# Build tools version -sdk.buildtools=18.1.1 - From 47685f4892d3411966a09f53e86999f887c56179 Mon Sep 17 00:00:00 2001 From: xawotihs Date: Mon, 25 Nov 2013 22:42:09 +0100 Subject: [PATCH 12/12] Added installation of 32 bits libs to make Android SDK work. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 5fee256d5..9430365de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,8 @@ before_install: - export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" - export ANDROID="android-sdk-linux/tools/android" install: + - sudo apt-get update -qq + - if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch; fi - wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download - tar -x --xz -f sdk.lzma - wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv