From 3e9ff2b5803849fc2caee70a34df7a09a5a582c1 Mon Sep 17 00:00:00 2001 From: "jean.chalard" Date: Thu, 25 Dec 2008 16:28:03 +0000 Subject: [PATCH] J : * Change the name of debug.h into config.h and use the new RESPATH define. --- projects/mtg/Makefile | 8 +- projects/mtg/Makefile.linux | 2 +- projects/mtg/include/GameOptions.h | 2 +- projects/mtg/include/GameStateDeckViewer.h | 10 +- projects/mtg/include/GameStateMenu.h | 16 +- projects/mtg/include/GuiLayers.h | 4 +- projects/mtg/include/Logger.h | 2 +- projects/mtg/include/PlayerData.h | 2 +- projects/mtg/include/{debug.h => config.h} | 4 + projects/mtg/include/utils.h | 8 +- projects/mtg/src/AIPlayer.cpp | 11 +- projects/mtg/src/AIStats.cpp | 2 +- projects/mtg/src/ActionLayer.cpp | 2 +- projects/mtg/src/ActionStack.cpp | 2 +- projects/mtg/src/Blocker.cpp | 2 +- projects/mtg/src/CardDescriptor.cpp | 2 +- projects/mtg/src/CardDisplay.cpp | 2 +- projects/mtg/src/CardGui.cpp | 2 +- projects/mtg/src/ConstraintResolver.cpp | 2 +- projects/mtg/src/Counters.cpp | 2 +- projects/mtg/src/Damage.cpp | 2 +- projects/mtg/src/DamageResolverLayer.cpp | 2 +- projects/mtg/src/DamagerDamaged.cpp | 2 +- projects/mtg/src/DeckStats.cpp | 147 +++++++++---------- projects/mtg/src/DuelLayers.cpp | 2 +- projects/mtg/src/GameApp.cpp | 6 +- projects/mtg/src/GameLauncher.cpp | 2 +- projects/mtg/src/GameObserver.cpp | 2 +- projects/mtg/src/GameOptions.cpp | 2 +- projects/mtg/src/GameStateDuel.cpp | 10 +- projects/mtg/src/GameStateOptions.cpp | 2 +- projects/mtg/src/GameStateShop.cpp | 2 +- projects/mtg/src/GuiCardsController.cpp | 2 +- projects/mtg/src/GuiLayers.cpp | 21 +-- projects/mtg/src/Logger.cpp | 2 +- projects/mtg/src/MTGAbility.cpp | 2 +- projects/mtg/src/MTGCard.cpp | 2 +- projects/mtg/src/MTGCardInstance.cpp | 3 +- projects/mtg/src/MTGDeck.cpp | 2 +- projects/mtg/src/MTGGamePhase.cpp | 4 +- projects/mtg/src/MTGGameZones.cpp | 2 +- projects/mtg/src/MTGGuiHand.cpp | 4 +- projects/mtg/src/MTGGuiPlay.cpp | 2 +- projects/mtg/src/MTGRules.cpp | 2 +- projects/mtg/src/ManaCost.cpp | 2 +- projects/mtg/src/MenuItem.cpp | 2 +- projects/mtg/src/PhaseRing.cpp | 2 +- projects/mtg/src/PlayGuiObject.cpp | 4 +- projects/mtg/src/PlayGuiObjectController.cpp | 2 +- projects/mtg/src/Player.cpp | 2 +- projects/mtg/src/PlayerData.cpp | 4 +- projects/mtg/src/PriceList.cpp | 2 +- projects/mtg/src/ShopItem.cpp | 4 +- projects/mtg/src/SimpleMenu.cpp | 2 +- projects/mtg/src/SimpleMenuItem.cpp | 2 +- projects/mtg/src/Subtypes.cpp | 2 +- projects/mtg/src/TargetChooser.cpp | 2 +- projects/mtg/src/TargetsList.cpp | 2 +- projects/mtg/src/TestSuiteAI.cpp | 8 +- projects/mtg/src/TexturesCache.cpp | 7 +- projects/mtg/src/utils.cpp | 4 +- 61 files changed, 191 insertions(+), 178 deletions(-) rename projects/mtg/include/{debug.h => config.h} (91%) diff --git a/projects/mtg/Makefile b/projects/mtg/Makefile index 2962c295d..a5276225d 100644 --- a/projects/mtg/Makefile +++ b/projects/mtg/Makefile @@ -63,7 +63,7 @@ else -$(TARGET): $(OBJS) +$(TARGET): $(OBJS) ../../JGE/lib/linux/libjge.a g++ -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIR) linux: $(TARGET) @@ -71,17 +71,17 @@ linux: $(TARGET) debug: linux clean: - rm -f $(OBJS) + $(RM) $(OBJS) $(OBJS): objs/%.o: src/%.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< $(DEPS): deps/%.d: src/%.cpp - @set -e; rm -f $@; \ + @set -e; $(RM) $@; \ $(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \ sed 's,\($*\)\.o[ :]*,objs/\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ + $(RM) $@.$$$$ include $(DEPS) diff --git a/projects/mtg/Makefile.linux b/projects/mtg/Makefile.linux index 8d51e30b6..6e808dea9 100644 --- a/projects/mtg/Makefile.linux +++ b/projects/mtg/Makefile.linux @@ -12,7 +12,7 @@ ASFLAGS = $(CXXFLAGS) LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lglut -lhgetools -lfmod-3.75 # -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lpspfpu -LDFLAGS = $(LIBDIR) $(LIBS) +LDFLAGS = $(LIBDIR) $(LIBS) -rdynamic all: $(OBJS) $(CXX) -o bin/mtg $(OBJS) $(LDFLAGS) diff --git a/projects/mtg/include/GameOptions.h b/projects/mtg/include/GameOptions.h index 190aa64fb..7d73626c2 100644 --- a/projects/mtg/include/GameOptions.h +++ b/projects/mtg/include/GameOptions.h @@ -6,7 +6,7 @@ #define OPTIONS_MUSICVOLUME 0 #define OPTIONS_SFXVOLUME 1 #define OPTIONS_INTERRUPTATENDOFPHASE_OFFSET 2 -#define OPTIONS_SAVEFILE "Res/settings/options.txt" +#define OPTIONS_SAVEFILE RESPATH"/settings/options.txt" class GameOptions { public: int values[MAX_OPTIONS]; diff --git a/projects/mtg/include/GameStateDeckViewer.h b/projects/mtg/include/GameStateDeckViewer.h index 735fc2b72..16139009a 100644 --- a/projects/mtg/include/GameStateDeckViewer.h +++ b/projects/mtg/include/GameStateDeckViewer.h @@ -141,10 +141,10 @@ class GameStateDeckViewer: public GameState, public JGuiListener virtual void Start() { hudAlpha = 0; - pricelist = NEW PriceList("Res/settings/prices.dat",mParent->collection); + pricelist = NEW PriceList(RESPATH"/settings/prices.dat",mParent->collection); playerdata = NEW PlayerData(mParent->collection); sellMenu = NULL; - myCollection = NEW DeckDataWrapper(NEW MTGDeck("Res/player/collection.dat", mParent->cache,mParent->collection)); + myCollection = NEW DeckDataWrapper(NEW MTGDeck(RESPATH"/player/collection.dat", mParent->cache,mParent->collection)); displayed_deck = myCollection; myDeck = NULL; menuFont = GameApp::CommonRes->GetJLBFont("graphics/f3"); @@ -188,7 +188,7 @@ class GameStateDeckViewer: public GameState, public JGuiListener welcome_menu = NEW SimpleMenu(10,this,menuFont,20,20,200); char buffer[100]; for (int i=1; i < 6; i++){ - sprintf(buffer, "Res/player/deck%i.txt",i); + sprintf(buffer, RESPATH"/player/deck%i.txt",i); std::ifstream file(buffer); if(file){ welcome_menu->Add(i, GameState::menuTexts[i]); @@ -733,10 +733,10 @@ class GameStateDeckViewer: public GameState, public JGuiListener int loadDeck(int deckid){ SAFE_DELETE(myCollection); - myCollection = NEW DeckDataWrapper(NEW MTGDeck("Res/player/collection.dat", mParent->cache,mParent->collection)); + myCollection = NEW DeckDataWrapper(NEW MTGDeck(RESPATH"/player/collection.dat", mParent->cache,mParent->collection)); displayed_deck = myCollection; char filename[4096]; - sprintf(filename, "Res/player/deck%i.txt", deckid); + sprintf(filename, RESPATH"/player/deck%i.txt", deckid); SAFE_DELETE(myDeck); myDeck = NEW DeckDataWrapper(NEW MTGDeck(filename, mParent->cache,mParent->collection)); MTGCard * current = myDeck->getNext(); diff --git a/projects/mtg/include/GameStateMenu.h b/projects/mtg/include/GameStateMenu.h index 9e7a8bcf3..dd93b8f4e 100644 --- a/projects/mtg/include/GameStateMenu.h +++ b/projects/mtg/include/GameStateMenu.h @@ -134,7 +134,7 @@ class GameStateMenu: public GameState, public JGuiListener virtual void Destroy() { - + SAFE_DELETE(mGuiController); @@ -170,7 +170,7 @@ subMenuController = NULL; if (GameApp::HasMusic && GameApp::music && GameOptions::GetInstance()->values[OPTIONS_MUSICVOLUME] == 0){ JSoundSystem::GetInstance()->StopMusic(GameApp::music); SAFE_DELETE(GameApp::music); - } + } } @@ -181,11 +181,11 @@ subMenuController = NULL; int nextCardSet(){ int found = 0; if (!mDip){ - mDip = opendir("Res/sets/"); + mDip = opendir(RESPATH"/sets/"); } while (!found && (mDit = readdir(mDip))){ - sprintf(mCurrentSetFileName, "Res/sets/%s/_cards.dat", mDit->d_name); + sprintf(mCurrentSetFileName, RESPATH"/sets/%s/_cards.dat", mDit->d_name); std::ifstream file(mCurrentSetFileName); if(file){ sprintf(mCurrentSetName, "%s", mDit->d_name); @@ -216,7 +216,7 @@ subMenuController = NULL; virtual void Update(float dt) { - if (GameApp::music){ + if (GameApp::music){ /*if (mVolume < 2*GameOptions::GetInstance()->values[OPTIONS_MUSICVOLUME]){ mVolume++; JSoundSystem::GetInstance()->SetVolume(mVolume/2); @@ -234,7 +234,7 @@ subMenuController = NULL; //How many cards total ? sprintf(nbcardsStr, "Database: %i cards", mParent->collection->totalCards()); //Check for first time comer - std::ifstream file("Res/player/collection.dat"); + std::ifstream file(RESPATH"/player/collection.dat"); if(file){ file.close(); currentState = STATE_WARNING; @@ -281,7 +281,7 @@ subMenuController = NULL; #ifdef TESTSUITE subMenuController->Add(666, "Test Suite"); #endif - + } } } @@ -315,7 +315,7 @@ subMenuController = NULL; sprintf(buf, "setID: %i", setId); OutputDebugString(buf); #endif - MTGDeck *mCollection = NEW MTGDeck("Res/player/collection.dat", mParent->cache, mParent->collection); + MTGDeck *mCollection = NEW MTGDeck(RESPATH"/player/collection.dat", mParent->cache, mParent->collection); //10 lands of each if (!mCollection->addRandomCards(10, setId,RARITY_L,"Forest")){ mCollection->addRandomCards(10, -1,RARITY_L,"Forest"); diff --git a/projects/mtg/include/GuiLayers.h b/projects/mtg/include/GuiLayers.h index e42aa630b..e217f2c47 100644 --- a/projects/mtg/include/GuiLayers.h +++ b/projects/mtg/include/GuiLayers.h @@ -16,11 +16,11 @@ class Player; class GuiLayer: public JGuiController{ protected: - int modal; GameObserver * game; public: + int modal; + bool hasFocus; virtual void resetObjects(); - int hasFocus; int getMaxId(); void RenderMessageBackground(float x0, float y0, float width, int height); void RenderMessageBackground(float y0, int height); diff --git a/projects/mtg/include/Logger.h b/projects/mtg/include/Logger.h index b1317f81e..dfb1463e5 100644 --- a/projects/mtg/include/Logger.h +++ b/projects/mtg/include/Logger.h @@ -9,7 +9,7 @@ #define LOG(x) #endif -#define LOG_FILE "Res/debug.txt" +#define LOG_FILE RESPATH"/debug.txt" class Logger{ public: diff --git a/projects/mtg/include/PlayerData.h b/projects/mtg/include/PlayerData.h index 2856c0c4f..003d63ea9 100644 --- a/projects/mtg/include/PlayerData.h +++ b/projects/mtg/include/PlayerData.h @@ -1,7 +1,7 @@ #ifndef _PLAYER_DATA_H_ #define _PLAYER_DATA_H_ -#define PLAYER_SAVEFILE "Res/player/data.dat" +#define PLAYER_SAVEFILE RESPATH"/player/data.dat" #include "../include/MTGDeck.h" diff --git a/projects/mtg/include/debug.h b/projects/mtg/include/config.h similarity index 91% rename from projects/mtg/include/debug.h rename to projects/mtg/include/config.h index 7a6ce9c05..a2319394d 100644 --- a/projects/mtg/include/debug.h +++ b/projects/mtg/include/config.h @@ -21,4 +21,8 @@ #endif #endif +#ifndef RESPATH +#define RESPATH "Res" +#endif + #endif diff --git a/projects/mtg/include/utils.h b/projects/mtg/include/utils.h index 3dcf1b0d4..a7a827ed9 100644 --- a/projects/mtg/include/utils.h +++ b/projects/mtg/include/utils.h @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -35,4 +35,10 @@ int lowercase(string source); int filesize(const char * filename); int readfile_to_ints(const char * filename, int * out_buffer); int fileExists(const char * filename); + +#ifdef LINUX +void dumpStack(); #endif + +#endif + diff --git a/projects/mtg/src/AIPlayer.cpp b/projects/mtg/src/AIPlayer.cpp index f50f1ad24..4f30ca2e3 100644 --- a/projects/mtg/src/AIPlayer.cpp +++ b/projects/mtg/src/AIPlayer.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/AIPlayer.h" #include "../include/CardDescriptor.h" #include "../include/DamageResolverLayer.h" @@ -230,6 +230,7 @@ int AIPlayer::chooseAttackers(){ int myForce = getCreaturesInfo(this,INFO_CREATURESPOWER,-1,1); int myCreatures = getCreaturesInfo(this, INFO_NBCREATURES, -1,1); bool attack = ((myCreatures > opponentCreatures) || (myForce > opponentForce) || (myForce > 2*opponent()->life)); + printf("Choose attackers : %i %i %i %i -> %i\n", opponentForce, opponentCreatures, myForce, myCreatures, attack); if (attack){ CardDescriptor cd; cd.init(); @@ -365,7 +366,7 @@ int AIPlayer::combatDamages(){ AIStats * AIPlayer::getStats(){ if (!stats){ char statFile[512]; - sprintf(statFile, "Res/ai/baka/stats/%s.stats", opponent()->deckFile.c_str()); + sprintf(statFile, RESPATH"/ai/baka/stats/%s.stats", opponent()->deckFile.c_str()); stats = new AIStats(this, statFile); } return stats; @@ -378,7 +379,7 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, MTGPlayerCa while (found){ found = 0; char buffer[512]; - sprintf(buffer, "Res/ai/baka/deck%i.txt",nbdecks+1); + sprintf(buffer, RESPATH"/ai/baka/deck%i.txt",nbdecks+1); std::ifstream file(buffer); if(file){ found = 1; @@ -390,10 +391,10 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, MTGPlayerCa deckid = 1 + rand() % (nbdecks); } char deckFile[512]; - sprintf(deckFile, "Res/ai/baka/deck%i.txt",deckid); + sprintf(deckFile, RESPATH"/ai/baka/deck%i.txt",deckid); char avatarFile[512]; sprintf(avatarFile, "ai/baka/avatars/avatar%i.jpg",deckid); - + char deckFileSmall[512]; sprintf(deckFileSmall, "ai_baka_deck%i",deckid); #if defined (WIN32) || defined (LINUX) diff --git a/projects/mtg/src/AIStats.cpp b/projects/mtg/src/AIStats.cpp index 8aa0c6047..194fd5e14 100644 --- a/projects/mtg/src/AIStats.cpp +++ b/projects/mtg/src/AIStats.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/AIStats.h" #include "../include/GameObserver.h" #include "../include/Player.h" diff --git a/projects/mtg/src/ActionLayer.cpp b/projects/mtg/src/ActionLayer.cpp index f22105147..00eb38c9d 100644 --- a/projects/mtg/src/ActionLayer.cpp +++ b/projects/mtg/src/ActionLayer.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/ActionLayer.h" #include "../include/GameObserver.h" #include "../include/Targetable.h" diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 3b172116a..ef54ba4a1 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -1,7 +1,7 @@ /* The Action Stack contains all information for Game Events that can be interrupted (Interruptible) */ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/ActionStack.h" #include "../include/MTGAbility.h" #include "../include/GameObserver.h" diff --git a/projects/mtg/src/Blocker.cpp b/projects/mtg/src/Blocker.cpp index 85a19eaf7..1c386c56f 100644 --- a/projects/mtg/src/Blocker.cpp +++ b/projects/mtg/src/Blocker.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/Blocker.h" Blocker::Blocker(int id, MTGCardInstance * card):MTGAbility(id, card){ diff --git a/projects/mtg/src/CardDescriptor.cpp b/projects/mtg/src/CardDescriptor.cpp index 0f79e0e60..b1c2c6f38 100644 --- a/projects/mtg/src/CardDescriptor.cpp +++ b/projects/mtg/src/CardDescriptor.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/CardDescriptor.h" CardDescriptor::CardDescriptor(): MTGCardInstance(){ diff --git a/projects/mtg/src/CardDisplay.cpp b/projects/mtg/src/CardDisplay.cpp index 4ce382fa7..afc6872b0 100644 --- a/projects/mtg/src/CardDisplay.cpp +++ b/projects/mtg/src/CardDisplay.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/CardDisplay.h" #include "../include/CardGui.h" #include "../include/TargetChooser.h" diff --git a/projects/mtg/src/CardGui.cpp b/projects/mtg/src/CardGui.cpp index 9160a95e1..1dd50bc13 100644 --- a/projects/mtg/src/CardGui.cpp +++ b/projects/mtg/src/CardGui.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/CardGui.h" #include diff --git a/projects/mtg/src/ConstraintResolver.cpp b/projects/mtg/src/ConstraintResolver.cpp index 62d6fa4b0..032ce4136 100644 --- a/projects/mtg/src/ConstraintResolver.cpp +++ b/projects/mtg/src/ConstraintResolver.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/ConstraintResolver.h" diff --git a/projects/mtg/src/Counters.cpp b/projects/mtg/src/Counters.cpp index 8c4babed5..e54bb64a1 100644 --- a/projects/mtg/src/Counters.cpp +++ b/projects/mtg/src/Counters.cpp @@ -1,5 +1,5 @@ #include "../include/Counters.h" -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGCardInstance.h" Counter::Counter(MTGCardInstance * _target, int _power, int _toughness){ diff --git a/projects/mtg/src/Damage.cpp b/projects/mtg/src/Damage.cpp index 537624c20..e535c3205 100644 --- a/projects/mtg/src/Damage.cpp +++ b/projects/mtg/src/Damage.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/Damage.h" #include "../include/MTGCardInstance.h" #include "../include/Counters.h" diff --git a/projects/mtg/src/DamageResolverLayer.cpp b/projects/mtg/src/DamageResolverLayer.cpp index fc5fd1840..068992e4f 100644 --- a/projects/mtg/src/DamageResolverLayer.cpp +++ b/projects/mtg/src/DamageResolverLayer.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/DamageResolverLayer.h" #include "../include/GameObserver.h" #include "../include/MTGCardInstance.h" diff --git a/projects/mtg/src/DamagerDamaged.cpp b/projects/mtg/src/DamagerDamaged.cpp index e4ebf7fe0..7e831e32a 100644 --- a/projects/mtg/src/DamagerDamaged.cpp +++ b/projects/mtg/src/DamagerDamaged.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/DamagerDamaged.h" diff --git a/projects/mtg/src/DeckStats.cpp b/projects/mtg/src/DeckStats.cpp index baf7d1586..885879083 100644 --- a/projects/mtg/src/DeckStats.cpp +++ b/projects/mtg/src/DeckStats.cpp @@ -1,48 +1,48 @@ -#include "../include/debug.h" -#include "../include/DeckStats.h" -#include "../include/Player.h" - -DeckStats * DeckStats::mInstance = NULL; - -int DeckStat::percentVictories(){ - if (nbgames == 0) return 50; - return (100 * victories / nbgames); -} - -DeckStats * DeckStats::GetInstance(){ - if (!mInstance) mInstance = NEW DeckStats(); - return mInstance; -} - -void DeckStats::cleanStats(){ +#include "../include/config.h" +#include "../include/DeckStats.h" +#include "../include/Player.h" + +DeckStats * DeckStats::mInstance = NULL; + +int DeckStat::percentVictories(){ + if (nbgames == 0) return 50; + return (100 * victories / nbgames); +} + +DeckStats * DeckStats::GetInstance(){ + if (!mInstance) mInstance = NEW DeckStats(); + return mInstance; +} + +void DeckStats::cleanStats(){ map::iterator it; for (it = stats.begin(); it != stats.end(); it++){ SAFE_DELETE(it->second); } - stats.clear(); -} - -DeckStats::~DeckStats(){ - cleanStats(); -} - -int DeckStats::percentVictories(string opponentsFile){ - map::iterator it = stats.find(opponentsFile); - if (it == stats.end()){ - return 50; - }else{ - return (it->second->percentVictories()); - } -} - -void DeckStats::load(Player * player){ - char filename[512]; - sprintf(filename, "Res/player/stats/%s.txt",player->deckFile.c_str()); - load(filename); -} - -void DeckStats::load(const char * filename){ - cleanStats(); + stats.clear(); +} + +DeckStats::~DeckStats(){ + cleanStats(); +} + +int DeckStats::percentVictories(string opponentsFile){ + map::iterator it = stats.find(opponentsFile); + if (it == stats.end()){ + return 50; + }else{ + return (it->second->percentVictories()); + } +} + +void DeckStats::load(Player * player){ + char filename[512]; + sprintf(filename, RESPATH"/player/stats/%s.txt",player->deckFile.c_str()); + load(filename); +} + +void DeckStats::load(const char * filename){ + cleanStats(); std::ifstream file(filename); std::string s; @@ -55,17 +55,17 @@ void DeckStats::load(const char * filename){ int victories = atoi(s.c_str()); stats[deckfile] = NEW DeckStat(games,victories); } - file.close(); - } -} - -void DeckStats::save(Player * player){ - char filename[512]; - sprintf(filename, "Res/player/stats/%s.txt",player->deckFile.c_str()); - save(filename); -} - -void DeckStats::save(const char * filename){ + file.close(); + } +} + +void DeckStats::save(Player * player){ + char filename[512]; + sprintf(filename, RESPATH"/player/stats/%s.txt",player->deckFile.c_str()); + save(filename); +} + +void DeckStats::save(const char * filename){ std::ofstream file(filename); char writer[512]; if (file){ @@ -79,25 +79,24 @@ void DeckStats::save(const char * filename){ file<gameOver){ - if (player->life == opponent->life) return; - if (player->life < opponent->life) victory = 0; - }else if (game->gameOver == player) { - victory = 0; - } - load(player); - map::iterator it = stats.find(opponent->deckFile); - if (it == stats.end()){ - stats[opponent->deckFile] = NEW DeckStat(1,victory); - }else{ - it->second->victories+=victory; - it->second->nbgames+=1; - } - save(player); - -} + } +} + +void DeckStats::saveStats(Player *player, Player *opponent, GameObserver * game){ + int victory = 1; + if (!game->gameOver){ + if (player->life == opponent->life) return; + if (player->life < opponent->life) victory = 0; + }else if (game->gameOver == player) { + victory = 0; + } + load(player); + map::iterator it = stats.find(opponent->deckFile); + if (it == stats.end()){ + stats[opponent->deckFile] = NEW DeckStat(1,victory); + }else{ + it->second->victories+=victory; + it->second->nbgames+=1; + } + save(player); +} diff --git a/projects/mtg/src/DuelLayers.cpp b/projects/mtg/src/DuelLayers.cpp index f1873494c..295ff99e6 100644 --- a/projects/mtg/src/DuelLayers.cpp +++ b/projects/mtg/src/DuelLayers.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/DuelLayers.h" #include "../include/MTGRules.h" #include "../include/DamageResolverLayer.h" diff --git a/projects/mtg/src/GameApp.cpp b/projects/mtg/src/GameApp.cpp index f5d60a640..8f2b0a20a 100644 --- a/projects/mtg/src/GameApp.cpp +++ b/projects/mtg/src/GameApp.cpp @@ -1,5 +1,5 @@ -#include "../include/debug.h" +#include "../include/config.h" #include #include #if defined (WIN32) || defined (LINUX) @@ -62,13 +62,13 @@ void GameApp::Create() LOG("starting Game"); //Test for Music files presence - std::ifstream file("Res/sound/Track0.mp3"); + std::ifstream file(RESPATH"/sound/Track0.mp3"); if(file){ file.close(); }else{ HasMusic = 0; } - std::ifstream file2("Res/sound/Track1.mp3"); + std::ifstream file2(RESPATH"/sound/Track1.mp3"); if(file2){ file2.close(); }else{ diff --git a/projects/mtg/src/GameLauncher.cpp b/projects/mtg/src/GameLauncher.cpp index 50c08e0b3..73e96b775 100644 --- a/projects/mtg/src/GameLauncher.cpp +++ b/projects/mtg/src/GameLauncher.cpp @@ -7,7 +7,7 @@ // Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) // //------------------------------------------------------------------------------------- -#include "../include/debug.h" +#include "../include/config.h" #include #include diff --git a/projects/mtg/src/GameObserver.cpp b/projects/mtg/src/GameObserver.cpp index 9ae75163f..c4a51931b 100644 --- a/projects/mtg/src/GameObserver.cpp +++ b/projects/mtg/src/GameObserver.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/GameObserver.h" #include "../include/GameOptions.h" diff --git a/projects/mtg/src/GameOptions.cpp b/projects/mtg/src/GameOptions.cpp index 5f7b02494..ab4bcff28 100644 --- a/projects/mtg/src/GameOptions.cpp +++ b/projects/mtg/src/GameOptions.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/GameOptions.h" #include #include diff --git a/projects/mtg/src/GameStateDuel.cpp b/projects/mtg/src/GameStateDuel.cpp index c8c59b6f9..ddf6668a9 100644 --- a/projects/mtg/src/GameStateDuel.cpp +++ b/projects/mtg/src/GameStateDuel.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/GameStateDuel.h" #include "../include/utils.h" #include "../include/AIPlayer.h" @@ -39,7 +39,7 @@ void GameStateDuel::Start() #ifdef TESTSUITE if (testSuite) delete testSuite; - testSuite = NEW TestSuite("Res/test/_tests.txt"); + testSuite = NEW TestSuite(RESPATH"/test/_tests.txt"); #endif @@ -64,7 +64,7 @@ void GameStateDuel::Start() deckmenu = NEW SimpleMenu(1,this,mFont, 10 , 10, 100, "Choose a Deck"); char buffer[100]; for (int j=1; j<6; j++){ - sprintf(buffer, "Res/player/deck%i.txt",j); + sprintf(buffer, RESPATH"/player/deck%i.txt",j); std::ifstream file(buffer); if(file){ deckmenu->Add(j, GameState::menuTexts[j]); @@ -88,7 +88,7 @@ void GameStateDuel::loadPlayer(int playerId, int decknb, int isAI){ if (decknb){ if (!isAI){ //Human Player char deckFile[255]; - sprintf(deckFile, "Res/player/deck%i.txt",decknb); + sprintf(deckFile, RESPATH"/player/deck%i.txt",decknb); char deckFileSmall[255]; sprintf(deckFileSmall, "player_deck%i",decknb); int deck_cards_ids[100]; @@ -205,7 +205,7 @@ void GameStateDuel::Update(float dt) char buffer[512]; char aiSmallDeckName[512]; char deckDesc[512]; - sprintf(buffer, "Res/ai/baka/deck%i.txt",nbAIDecks+1); + sprintf(buffer, RESPATH"/ai/baka/deck%i.txt",nbAIDecks+1); if(fileExists(buffer)){ found = 1; nbAIDecks++; diff --git a/projects/mtg/src/GameStateOptions.cpp b/projects/mtg/src/GameStateOptions.cpp index 61cfa3549..cb90663b7 100644 --- a/projects/mtg/src/GameStateOptions.cpp +++ b/projects/mtg/src/GameStateOptions.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/GameStateOptions.h" #include "../include/GameApp.h" #include "../include/OptionItem.h" diff --git a/projects/mtg/src/GameStateShop.cpp b/projects/mtg/src/GameStateShop.cpp index 511d987ca..f3877079f 100644 --- a/projects/mtg/src/GameStateShop.cpp +++ b/projects/mtg/src/GameStateShop.cpp @@ -1,7 +1,7 @@ /* The shop is where the player can buy cards, decks... */ -#include "../include/debug.h" +#include "../include/config.h" #include #include "../include/GameStateShop.h" #include "../include/GameApp.h" diff --git a/projects/mtg/src/GuiCardsController.cpp b/projects/mtg/src/GuiCardsController.cpp index d63d99919..4550b35d9 100644 --- a/projects/mtg/src/GuiCardsController.cpp +++ b/projects/mtg/src/GuiCardsController.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/GuiCardsController.h" diff --git a/projects/mtg/src/GuiLayers.cpp b/projects/mtg/src/GuiLayers.cpp index aa9866bf0..fe2eca106 100644 --- a/projects/mtg/src/GuiLayers.cpp +++ b/projects/mtg/src/GuiLayers.cpp @@ -1,11 +1,11 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/GuiLayers.h" #include "../include/Player.h" GuiLayer::GuiLayer(int id, GameObserver* _game):JGuiController(id, NULL){ game = _game; modal = 0; - hasFocus = 0; + hasFocus = false; } GuiLayer::~GuiLayer(){ @@ -121,21 +121,22 @@ void GuiLayers::Update(float dt, Player * currentPlayer){ for (i=0; ihasFocus = 1; - if (objects[i]->CheckUserInput(key)) - break; - } + if (objects[i]->CheckUserInput(key)) + break; } } } - for (++i; ihasFocus = 0; - if (isAI){ + if (isAI) currentPlayer->Act(dt); - } } void GuiLayers::Render(){ + bool focusMakesItThrough = true; + for (int i = 0; i < nbitems; ++i) + { + objects[i]->hasFocus = focusMakesItThrough; + if (objects[i]->modal) focusMakesItThrough = false; + } for (int i=nbitems-1; i>=0; i--){ objects[i]->Render(); } diff --git a/projects/mtg/src/Logger.cpp b/projects/mtg/src/Logger.cpp index 19fa15f55..ad5689a61 100644 --- a/projects/mtg/src/Logger.cpp +++ b/projects/mtg/src/Logger.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/Logger.h" #include #include diff --git a/projects/mtg/src/MTGAbility.cpp b/projects/mtg/src/MTGAbility.cpp index a038f9683..c0171999b 100644 --- a/projects/mtg/src/MTGAbility.cpp +++ b/projects/mtg/src/MTGAbility.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGAbility.h" #include "../include/ManaCost.h" #include "../include/MTGGameZones.h" diff --git a/projects/mtg/src/MTGCard.cpp b/projects/mtg/src/MTGCard.cpp index 38651f30f..3020b25dd 100644 --- a/projects/mtg/src/MTGCard.cpp +++ b/projects/mtg/src/MTGCard.cpp @@ -3,7 +3,7 @@ //------------------------------------------------- //TODO Fill BasicAbilities -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGCard.h" #include "../include/TexturesCache.h" diff --git a/projects/mtg/src/MTGCardInstance.cpp b/projects/mtg/src/MTGCardInstance.cpp index e5c08c4bb..de75cab67 100644 --- a/projects/mtg/src/MTGCardInstance.cpp +++ b/projects/mtg/src/MTGCardInstance.cpp @@ -4,7 +4,7 @@ Although there is only one MTGCard of each type, there can be as much Instances of it as needed in the game -------------------------------------------- */ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGCardInstance.h" #include "../include/CardDescriptor.h" #include "../include/Counters.h" @@ -19,6 +19,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * _belongs_to): LOG("==Creating MTGCardInstance=="); initMTGCI(); model = card; + attacker = 0; lifeOrig = life; belongs_to=_belongs_to; initAttackersDefensers(); diff --git a/projects/mtg/src/MTGDeck.cpp b/projects/mtg/src/MTGDeck.cpp index 4e4b98854..cdc760d66 100644 --- a/projects/mtg/src/MTGDeck.cpp +++ b/projects/mtg/src/MTGDeck.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGDeck.h" #include "../include/utils.h" #include diff --git a/projects/mtg/src/MTGGamePhase.cpp b/projects/mtg/src/MTGGamePhase.cpp index 2e7448d84..7cac6068e 100644 --- a/projects/mtg/src/MTGGamePhase.cpp +++ b/projects/mtg/src/MTGGamePhase.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGGamePhase.h" @@ -32,7 +32,7 @@ void MTGGamePhase::Update(float dt){ if (animation > 0){ - fprintf(stderr, "animation = %f", animation); + // fprintf(stderr, "animation = %f", animation); animation -= dt *5 ; }else{ activeState = INACTIVE; diff --git a/projects/mtg/src/MTGGameZones.cpp b/projects/mtg/src/MTGGameZones.cpp index 21f7446de..82b75c3ba 100644 --- a/projects/mtg/src/MTGGameZones.cpp +++ b/projects/mtg/src/MTGGameZones.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGGameZones.h" #include "../include/Player.h" #include "../include/GameOptions.h" diff --git a/projects/mtg/src/MTGGuiHand.cpp b/projects/mtg/src/MTGGuiHand.cpp index 9f8df0de7..be6b41d46 100644 --- a/projects/mtg/src/MTGGuiHand.cpp +++ b/projects/mtg/src/MTGGuiHand.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGGuiHand.h" #include "../include/CardGui.h" @@ -52,6 +52,7 @@ void MTGGuiHand::Update(float dt){ if (mAnimState < 0){ mAnimState = 0; mShowHand = HAND_HIDE; + modal = false; } } @@ -65,6 +66,7 @@ bool MTGGuiHand::CheckUserInput(u32 key){ if (PSP_CTRL_LTRIGGER == key) { if (mShowHand == HAND_HIDE){ mShowHand = HAND_SHOW_ANIMATION; + modal = true; } if (mShowHand == HAND_SHOW){ mShowHand = HAND_HIDE_ANIMATION; diff --git a/projects/mtg/src/MTGGuiPlay.cpp b/projects/mtg/src/MTGGuiPlay.cpp index 02746373e..13edeef7f 100644 --- a/projects/mtg/src/MTGGuiPlay.cpp +++ b/projects/mtg/src/MTGGuiPlay.cpp @@ -2,7 +2,7 @@ cards in play, graveyard, library, games phases, Players avatars */ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGGuiPlay.h" #include "../include/MTGCardInstance.h" #include "../include/CardGui.h" diff --git a/projects/mtg/src/MTGRules.cpp b/projects/mtg/src/MTGRules.cpp index da8e64018..82a67745e 100644 --- a/projects/mtg/src/MTGRules.cpp +++ b/projects/mtg/src/MTGRules.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MTGRules.h" MTGAttackRule::MTGAttackRule(int _id):MTGAbility(_id,NULL){ diff --git a/projects/mtg/src/ManaCost.cpp b/projects/mtg/src/ManaCost.cpp index 46a71aa19..e5ec3ee0d 100644 --- a/projects/mtg/src/ManaCost.cpp +++ b/projects/mtg/src/ManaCost.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/Logger.h" #include "../include/ManaCost.h" #include "../include/ManaCostHybrid.h" diff --git a/projects/mtg/src/MenuItem.cpp b/projects/mtg/src/MenuItem.cpp index 5ed04c5e8..ac3599f9b 100644 --- a/projects/mtg/src/MenuItem.cpp +++ b/projects/mtg/src/MenuItem.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/MenuItem.h" diff --git a/projects/mtg/src/PhaseRing.cpp b/projects/mtg/src/PhaseRing.cpp index 99e55b42f..2ecd3dbc0 100644 --- a/projects/mtg/src/PhaseRing.cpp +++ b/projects/mtg/src/PhaseRing.cpp @@ -1,7 +1,7 @@ #include "../include/PhaseRing.h" #include "../include/MTGDefinitions.h" #include "../include/Player.h" -#include "../include/debug.h" +#include "../include/config.h" diff --git a/projects/mtg/src/PlayGuiObject.cpp b/projects/mtg/src/PlayGuiObject.cpp index bd60941d4..b2c0fc83b 100644 --- a/projects/mtg/src/PlayGuiObject.cpp +++ b/projects/mtg/src/PlayGuiObject.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/PlayGuiObject.h" #include "../include/Player.h" @@ -20,7 +20,7 @@ void PlayGuiObject::Update(float dt){ if (mHasFocus && mHeight < defaultHeight * 1.2) { mHeight += defaultHeight*0.8f*dt; - fprintf(stderr, "increasing size to %f - %d", mHeight, GetId() ); + // fprintf(stderr, "increasing size to %f - %d", mHeight, GetId() ); if (mHeight > defaultHeight * 1.2) mHeight = defaultHeight * 1.2; diff --git a/projects/mtg/src/PlayGuiObjectController.cpp b/projects/mtg/src/PlayGuiObjectController.cpp index b202daebd..f4ed417fd 100644 --- a/projects/mtg/src/PlayGuiObjectController.cpp +++ b/projects/mtg/src/PlayGuiObjectController.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/PlayGuiObjectController.h" #include "../include/PlayGuiObject.h" diff --git a/projects/mtg/src/Player.cpp b/projects/mtg/src/Player.cpp index 04c626eef..a28946f19 100644 --- a/projects/mtg/src/Player.cpp +++ b/projects/mtg/src/Player.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/Player.h" #include "../include/GameObserver.h" #include "../include/DeckStats.h" diff --git a/projects/mtg/src/PlayerData.cpp b/projects/mtg/src/PlayerData.cpp index 477ec4d7a..6956a0d00 100644 --- a/projects/mtg/src/PlayerData.cpp +++ b/projects/mtg/src/PlayerData.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/PlayerData.h" #include @@ -19,7 +19,7 @@ PlayerData::PlayerData(MTGAllCards * allcards){ } //COLLECTION - collection = NEW MTGDeck("Res/player/collection.dat", allcards->mCache , allcards); + collection = NEW MTGDeck(RESPATH"/player/collection.dat", allcards->mCache , allcards); } diff --git a/projects/mtg/src/PriceList.cpp b/projects/mtg/src/PriceList.cpp index 6fd08b1c8..eeb9efe4d 100644 --- a/projects/mtg/src/PriceList.cpp +++ b/projects/mtg/src/PriceList.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/PriceList.h" diff --git a/projects/mtg/src/ShopItem.cpp b/projects/mtg/src/ShopItem.cpp index 257459235..75294cbb7 100644 --- a/projects/mtg/src/ShopItem.cpp +++ b/projects/mtg/src/ShopItem.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/ShopItem.h" #include "../include/CardGui.h" @@ -131,7 +131,7 @@ ShopItems::ShopItems(int id, JGuiListener* listener, JLBFont* font, int x, int y mHeight = 0; showPriceDialog = -1; dialog = NULL; - pricelist = NEW PriceList("Res/settings/prices.dat",_collection); + pricelist = NEW PriceList(RESPATH"/settings/prices.dat",_collection); playerdata = NEW PlayerData(_collection); display = NULL; } diff --git a/projects/mtg/src/SimpleMenu.cpp b/projects/mtg/src/SimpleMenu.cpp index c21d409a7..13d1290b2 100644 --- a/projects/mtg/src/SimpleMenu.cpp +++ b/projects/mtg/src/SimpleMenu.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/SimpleMenu.h" #include "../include/SimpleMenuItem.h" diff --git a/projects/mtg/src/SimpleMenuItem.cpp b/projects/mtg/src/SimpleMenuItem.cpp index d8706e9d1..a1ddf088d 100644 --- a/projects/mtg/src/SimpleMenuItem.cpp +++ b/projects/mtg/src/SimpleMenuItem.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/SimpleMenuItem.h" diff --git a/projects/mtg/src/Subtypes.cpp b/projects/mtg/src/Subtypes.cpp index 3cf99c389..0ac69857b 100644 --- a/projects/mtg/src/Subtypes.cpp +++ b/projects/mtg/src/Subtypes.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/Subtypes.h" #include #include diff --git a/projects/mtg/src/TargetChooser.cpp b/projects/mtg/src/TargetChooser.cpp index 9f7dafbd5..3d527c2c9 100644 --- a/projects/mtg/src/TargetChooser.cpp +++ b/projects/mtg/src/TargetChooser.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/TargetChooser.h" #include "../include/CardDescriptor.h" #include "../include/MTGGameZones.h" diff --git a/projects/mtg/src/TargetsList.cpp b/projects/mtg/src/TargetsList.cpp index cbcdc606b..6c1143f8b 100644 --- a/projects/mtg/src/TargetsList.cpp +++ b/projects/mtg/src/TargetsList.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/TargetsList.h" #include "../include/Player.h" #include "../include/MTGCardInstance.h" diff --git a/projects/mtg/src/TestSuiteAI.cpp b/projects/mtg/src/TestSuiteAI.cpp index 9b81e6785..856ea8390 100644 --- a/projects/mtg/src/TestSuiteAI.cpp +++ b/projects/mtg/src/TestSuiteAI.cpp @@ -1,5 +1,5 @@ #include "../include/TestSuiteAI.h" -#include "../include/debug.h" +#include "../include/config.h" #include using std::string; @@ -247,7 +247,7 @@ void TestSuite::initGame(){ } int TestSuite::Log(const char * text){ - ofstream file ("Res/test/results.html",ios_base::app); + ofstream file (RESPATH"/test/results.html",ios_base::app); if (file){ file << text; file << "\n"; @@ -334,7 +334,7 @@ TestSuite::TestSuite(const char * filename){ file.close(); } - ofstream file2 ("Res/test/results.html"); + ofstream file2 (RESPATH"/test/results.html"); if (file2){ file2 << ""; file2 << ""; @@ -405,7 +405,7 @@ void TestSuite::cleanup(){ void TestSuite::load(const char * _filename){ char filename[4096]; - sprintf(filename, "Res/test/%s", _filename); + sprintf(filename, RESPATH"/test/%s", _filename); std::ifstream file(filename); std::string s; diff --git a/projects/mtg/src/TexturesCache.cpp b/projects/mtg/src/TexturesCache.cpp index 27be08ac6..5340adc8d 100644 --- a/projects/mtg/src/TexturesCache.cpp +++ b/projects/mtg/src/TexturesCache.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/TexturesCache.h" TexturesCache::TexturesCache(){ @@ -27,8 +27,7 @@ int TexturesCache::isInCache(MTGCard * card, int type){ } int TexturesCache::getCacheById(int id, int type){ - int i; - for (i=0; itype == type && cache[i]->getId() == id){ return i; } @@ -68,7 +67,7 @@ int TexturesCache::cleanup(){ JQuad * TexturesCache::getQuad(MTGCard * card, int type){ int cache_id = getCacheById(card->getId(), type); if (cache_id == -1){ - fprintf(stderr, "not found %d\n", card->getId()); + fprintf(stderr, "not found %d %i\n", card->getId(), type); //Not found in the cache, we have to load the file and put it in the cache if (cleanup()){ cache_id = nb_textures; diff --git a/projects/mtg/src/utils.cpp b/projects/mtg/src/utils.cpp index 3f053769d..6d27889b8 100644 --- a/projects/mtg/src/utils.cpp +++ b/projects/mtg/src/utils.cpp @@ -1,4 +1,4 @@ -#include "../include/debug.h" +#include "../include/config.h" #include "../include/utils.h" @@ -63,7 +63,7 @@ if(fichier){ } char alternateFilename[512]; -sprintf(alternateFilename, "Res/%s",filename); +sprintf(alternateFilename, RESPATH"/%s",filename); std::ifstream fichier2(alternateFilename); if(fichier2){ fichier2.close();