J :
* Change the name of debug.h into config.h and use the new RESPATH define.
This commit is contained in:
@@ -63,7 +63,7 @@ else
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
$(TARGET): $(OBJS)
|
$(TARGET): $(OBJS) ../../JGE/lib/linux/libjge.a
|
||||||
g++ -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIR)
|
g++ -o $(TARGET) $(OBJS) $(LIBS) $(LIBDIR)
|
||||||
|
|
||||||
linux: $(TARGET)
|
linux: $(TARGET)
|
||||||
@@ -71,17 +71,17 @@ linux: $(TARGET)
|
|||||||
debug: linux
|
debug: linux
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(OBJS)
|
$(RM) $(OBJS)
|
||||||
|
|
||||||
|
|
||||||
$(OBJS): objs/%.o: src/%.cpp
|
$(OBJS): objs/%.o: src/%.cpp
|
||||||
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
$(CXX) -c -o $@ $(CXXFLAGS) $<
|
||||||
|
|
||||||
$(DEPS): deps/%.d: src/%.cpp
|
$(DEPS): deps/%.d: src/%.cpp
|
||||||
@set -e; rm -f $@; \
|
@set -e; $(RM) $@; \
|
||||||
$(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
|
$(CXX) -MM $(CXXFLAGS) $< > $@.$$$$; \
|
||||||
sed 's,\($*\)\.o[ :]*,objs/\1.o $@ : ,g' < $@.$$$$ > $@; \
|
sed 's,\($*\)\.o[ :]*,objs/\1.o $@ : ,g' < $@.$$$$ > $@; \
|
||||||
rm -f $@.$$$$
|
$(RM) $@.$$$$
|
||||||
|
|
||||||
include $(DEPS)
|
include $(DEPS)
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ ASFLAGS = $(CXXFLAGS)
|
|||||||
LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lglut -lhgetools -lfmod-3.75
|
LIBS = -ljge -lfreetype -ljpeg -lgif -lpng -lz -lm -lstdc++ -lglut -lhgetools -lfmod-3.75
|
||||||
# -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lpspfpu
|
# -lmikmod -lpsppower -lpspmpeg -lpspaudiocodec -lpspaudiolib -lpspaudio -lpspgum -lpspgu -lpsprtc -lpspfpu
|
||||||
|
|
||||||
LDFLAGS = $(LIBDIR) $(LIBS)
|
LDFLAGS = $(LIBDIR) $(LIBS) -rdynamic
|
||||||
|
|
||||||
all: $(OBJS)
|
all: $(OBJS)
|
||||||
$(CXX) -o bin/mtg $(OBJS) $(LDFLAGS)
|
$(CXX) -o bin/mtg $(OBJS) $(LDFLAGS)
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
#define OPTIONS_MUSICVOLUME 0
|
#define OPTIONS_MUSICVOLUME 0
|
||||||
#define OPTIONS_SFXVOLUME 1
|
#define OPTIONS_SFXVOLUME 1
|
||||||
#define OPTIONS_INTERRUPTATENDOFPHASE_OFFSET 2
|
#define OPTIONS_INTERRUPTATENDOFPHASE_OFFSET 2
|
||||||
#define OPTIONS_SAVEFILE "Res/settings/options.txt"
|
#define OPTIONS_SAVEFILE RESPATH"/settings/options.txt"
|
||||||
class GameOptions {
|
class GameOptions {
|
||||||
public:
|
public:
|
||||||
int values[MAX_OPTIONS];
|
int values[MAX_OPTIONS];
|
||||||
|
|||||||
@@ -141,10 +141,10 @@ class GameStateDeckViewer: public GameState, public JGuiListener
|
|||||||
virtual void Start()
|
virtual void Start()
|
||||||
{
|
{
|
||||||
hudAlpha = 0;
|
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);
|
playerdata = NEW PlayerData(mParent->collection);
|
||||||
sellMenu = NULL;
|
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;
|
displayed_deck = myCollection;
|
||||||
myDeck = NULL;
|
myDeck = NULL;
|
||||||
menuFont = GameApp::CommonRes->GetJLBFont("graphics/f3");
|
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);
|
welcome_menu = NEW SimpleMenu(10,this,menuFont,20,20,200);
|
||||||
char buffer[100];
|
char buffer[100];
|
||||||
for (int i=1; i < 6; i++){
|
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);
|
std::ifstream file(buffer);
|
||||||
if(file){
|
if(file){
|
||||||
welcome_menu->Add(i, GameState::menuTexts[i]);
|
welcome_menu->Add(i, GameState::menuTexts[i]);
|
||||||
@@ -733,10 +733,10 @@ class GameStateDeckViewer: public GameState, public JGuiListener
|
|||||||
|
|
||||||
int loadDeck(int deckid){
|
int loadDeck(int deckid){
|
||||||
SAFE_DELETE(myCollection);
|
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;
|
displayed_deck = myCollection;
|
||||||
char filename[4096];
|
char filename[4096];
|
||||||
sprintf(filename, "Res/player/deck%i.txt", deckid);
|
sprintf(filename, RESPATH"/player/deck%i.txt", deckid);
|
||||||
SAFE_DELETE(myDeck);
|
SAFE_DELETE(myDeck);
|
||||||
myDeck = NEW DeckDataWrapper(NEW MTGDeck(filename, mParent->cache,mParent->collection));
|
myDeck = NEW DeckDataWrapper(NEW MTGDeck(filename, mParent->cache,mParent->collection));
|
||||||
MTGCard * current = myDeck->getNext();
|
MTGCard * current = myDeck->getNext();
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ class GameStateMenu: public GameState, public JGuiListener
|
|||||||
|
|
||||||
virtual void Destroy()
|
virtual void Destroy()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
SAFE_DELETE(mGuiController);
|
SAFE_DELETE(mGuiController);
|
||||||
|
|
||||||
@@ -170,7 +170,7 @@ subMenuController = NULL;
|
|||||||
if (GameApp::HasMusic && GameApp::music && GameOptions::GetInstance()->values[OPTIONS_MUSICVOLUME] == 0){
|
if (GameApp::HasMusic && GameApp::music && GameOptions::GetInstance()->values[OPTIONS_MUSICVOLUME] == 0){
|
||||||
JSoundSystem::GetInstance()->StopMusic(GameApp::music);
|
JSoundSystem::GetInstance()->StopMusic(GameApp::music);
|
||||||
SAFE_DELETE(GameApp::music);
|
SAFE_DELETE(GameApp::music);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -181,11 +181,11 @@ subMenuController = NULL;
|
|||||||
int nextCardSet(){
|
int nextCardSet(){
|
||||||
int found = 0;
|
int found = 0;
|
||||||
if (!mDip){
|
if (!mDip){
|
||||||
mDip = opendir("Res/sets/");
|
mDip = opendir(RESPATH"/sets/");
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!found && (mDit = readdir(mDip))){
|
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);
|
std::ifstream file(mCurrentSetFileName);
|
||||||
if(file){
|
if(file){
|
||||||
sprintf(mCurrentSetName, "%s", mDit->d_name);
|
sprintf(mCurrentSetName, "%s", mDit->d_name);
|
||||||
@@ -216,7 +216,7 @@ subMenuController = NULL;
|
|||||||
virtual void Update(float dt)
|
virtual void Update(float dt)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (GameApp::music){
|
if (GameApp::music){
|
||||||
/*if (mVolume < 2*GameOptions::GetInstance()->values[OPTIONS_MUSICVOLUME]){
|
/*if (mVolume < 2*GameOptions::GetInstance()->values[OPTIONS_MUSICVOLUME]){
|
||||||
mVolume++;
|
mVolume++;
|
||||||
JSoundSystem::GetInstance()->SetVolume(mVolume/2);
|
JSoundSystem::GetInstance()->SetVolume(mVolume/2);
|
||||||
@@ -234,7 +234,7 @@ subMenuController = NULL;
|
|||||||
//How many cards total ?
|
//How many cards total ?
|
||||||
sprintf(nbcardsStr, "Database: %i cards", mParent->collection->totalCards());
|
sprintf(nbcardsStr, "Database: %i cards", mParent->collection->totalCards());
|
||||||
//Check for first time comer
|
//Check for first time comer
|
||||||
std::ifstream file("Res/player/collection.dat");
|
std::ifstream file(RESPATH"/player/collection.dat");
|
||||||
if(file){
|
if(file){
|
||||||
file.close();
|
file.close();
|
||||||
currentState = STATE_WARNING;
|
currentState = STATE_WARNING;
|
||||||
@@ -281,7 +281,7 @@ subMenuController = NULL;
|
|||||||
#ifdef TESTSUITE
|
#ifdef TESTSUITE
|
||||||
subMenuController->Add(666, "Test Suite");
|
subMenuController->Add(666, "Test Suite");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -315,7 +315,7 @@ subMenuController = NULL;
|
|||||||
sprintf(buf, "setID: %i", setId);
|
sprintf(buf, "setID: %i", setId);
|
||||||
OutputDebugString(buf);
|
OutputDebugString(buf);
|
||||||
#endif
|
#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
|
//10 lands of each
|
||||||
if (!mCollection->addRandomCards(10, setId,RARITY_L,"Forest")){
|
if (!mCollection->addRandomCards(10, setId,RARITY_L,"Forest")){
|
||||||
mCollection->addRandomCards(10, -1,RARITY_L,"Forest");
|
mCollection->addRandomCards(10, -1,RARITY_L,"Forest");
|
||||||
|
|||||||
@@ -16,11 +16,11 @@ class Player;
|
|||||||
|
|
||||||
class GuiLayer: public JGuiController{
|
class GuiLayer: public JGuiController{
|
||||||
protected:
|
protected:
|
||||||
int modal;
|
|
||||||
GameObserver * game;
|
GameObserver * game;
|
||||||
public:
|
public:
|
||||||
|
int modal;
|
||||||
|
bool hasFocus;
|
||||||
virtual void resetObjects();
|
virtual void resetObjects();
|
||||||
int hasFocus;
|
|
||||||
int getMaxId();
|
int getMaxId();
|
||||||
void RenderMessageBackground(float x0, float y0, float width, int height);
|
void RenderMessageBackground(float x0, float y0, float width, int height);
|
||||||
void RenderMessageBackground(float y0, int height);
|
void RenderMessageBackground(float y0, int height);
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#define LOG(x)
|
#define LOG(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define LOG_FILE "Res/debug.txt"
|
#define LOG_FILE RESPATH"/debug.txt"
|
||||||
|
|
||||||
class Logger{
|
class Logger{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#ifndef _PLAYER_DATA_H_
|
#ifndef _PLAYER_DATA_H_
|
||||||
#define _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"
|
#include "../include/MTGDeck.h"
|
||||||
|
|
||||||
|
|||||||
@@ -21,4 +21,8 @@
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef RESPATH
|
||||||
|
#define RESPATH "Res"
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
#include <pspdisplay.h>
|
#include <pspdisplay.h>
|
||||||
#include <pspctrl.h>
|
#include <pspctrl.h>
|
||||||
#include <pspiofilemgr.h>
|
#include <pspiofilemgr.h>
|
||||||
#include <pspdebug.h>
|
#include <pspconfig.h>
|
||||||
#include <psputility.h>
|
#include <psputility.h>
|
||||||
#include <pspgu.h>
|
#include <pspgu.h>
|
||||||
#include <psprtc.h>
|
#include <psprtc.h>
|
||||||
@@ -35,4 +35,10 @@ int lowercase(string source);
|
|||||||
int filesize(const char * filename);
|
int filesize(const char * filename);
|
||||||
int readfile_to_ints(const char * filename, int * out_buffer);
|
int readfile_to_ints(const char * filename, int * out_buffer);
|
||||||
int fileExists(const char * filename);
|
int fileExists(const char * filename);
|
||||||
|
|
||||||
|
#ifdef LINUX
|
||||||
|
void dumpStack();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/AIPlayer.h"
|
#include "../include/AIPlayer.h"
|
||||||
#include "../include/CardDescriptor.h"
|
#include "../include/CardDescriptor.h"
|
||||||
#include "../include/DamageResolverLayer.h"
|
#include "../include/DamageResolverLayer.h"
|
||||||
@@ -230,6 +230,7 @@ int AIPlayer::chooseAttackers(){
|
|||||||
int myForce = getCreaturesInfo(this,INFO_CREATURESPOWER,-1,1);
|
int myForce = getCreaturesInfo(this,INFO_CREATURESPOWER,-1,1);
|
||||||
int myCreatures = getCreaturesInfo(this, INFO_NBCREATURES, -1,1);
|
int myCreatures = getCreaturesInfo(this, INFO_NBCREATURES, -1,1);
|
||||||
bool attack = ((myCreatures > opponentCreatures) || (myForce > opponentForce) || (myForce > 2*opponent()->life));
|
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){
|
if (attack){
|
||||||
CardDescriptor cd;
|
CardDescriptor cd;
|
||||||
cd.init();
|
cd.init();
|
||||||
@@ -365,7 +366,7 @@ int AIPlayer::combatDamages(){
|
|||||||
AIStats * AIPlayer::getStats(){
|
AIStats * AIPlayer::getStats(){
|
||||||
if (!stats){
|
if (!stats){
|
||||||
char statFile[512];
|
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);
|
stats = new AIStats(this, statFile);
|
||||||
}
|
}
|
||||||
return stats;
|
return stats;
|
||||||
@@ -378,7 +379,7 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, MTGPlayerCa
|
|||||||
while (found){
|
while (found){
|
||||||
found = 0;
|
found = 0;
|
||||||
char buffer[512];
|
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);
|
std::ifstream file(buffer);
|
||||||
if(file){
|
if(file){
|
||||||
found = 1;
|
found = 1;
|
||||||
@@ -390,10 +391,10 @@ AIPlayer * AIPlayerFactory::createAIPlayer(MTGAllCards * collection, MTGPlayerCa
|
|||||||
deckid = 1 + rand() % (nbdecks);
|
deckid = 1 + rand() % (nbdecks);
|
||||||
}
|
}
|
||||||
char deckFile[512];
|
char deckFile[512];
|
||||||
sprintf(deckFile, "Res/ai/baka/deck%i.txt",deckid);
|
sprintf(deckFile, RESPATH"/ai/baka/deck%i.txt",deckid);
|
||||||
char avatarFile[512];
|
char avatarFile[512];
|
||||||
sprintf(avatarFile, "ai/baka/avatars/avatar%i.jpg",deckid);
|
sprintf(avatarFile, "ai/baka/avatars/avatar%i.jpg",deckid);
|
||||||
|
|
||||||
char deckFileSmall[512];
|
char deckFileSmall[512];
|
||||||
sprintf(deckFileSmall, "ai_baka_deck%i",deckid);
|
sprintf(deckFileSmall, "ai_baka_deck%i",deckid);
|
||||||
#if defined (WIN32) || defined (LINUX)
|
#if defined (WIN32) || defined (LINUX)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/AIStats.h"
|
#include "../include/AIStats.h"
|
||||||
#include "../include/GameObserver.h"
|
#include "../include/GameObserver.h"
|
||||||
#include "../include/Player.h"
|
#include "../include/Player.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/ActionLayer.h"
|
#include "../include/ActionLayer.h"
|
||||||
#include "../include/GameObserver.h"
|
#include "../include/GameObserver.h"
|
||||||
#include "../include/Targetable.h"
|
#include "../include/Targetable.h"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
The Action Stack contains all information for Game Events that can be interrupted (Interruptible)
|
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/ActionStack.h"
|
||||||
#include "../include/MTGAbility.h"
|
#include "../include/MTGAbility.h"
|
||||||
#include "../include/GameObserver.h"
|
#include "../include/GameObserver.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/Blocker.h"
|
#include "../include/Blocker.h"
|
||||||
|
|
||||||
Blocker::Blocker(int id, MTGCardInstance * card):MTGAbility(id, card){
|
Blocker::Blocker(int id, MTGCardInstance * card):MTGAbility(id, card){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/CardDescriptor.h"
|
#include "../include/CardDescriptor.h"
|
||||||
|
|
||||||
CardDescriptor::CardDescriptor(): MTGCardInstance(){
|
CardDescriptor::CardDescriptor(): MTGCardInstance(){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/CardDisplay.h"
|
#include "../include/CardDisplay.h"
|
||||||
#include "../include/CardGui.h"
|
#include "../include/CardGui.h"
|
||||||
#include "../include/TargetChooser.h"
|
#include "../include/TargetChooser.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/CardGui.h"
|
#include "../include/CardGui.h"
|
||||||
#include <Vector2D.h>
|
#include <Vector2D.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/ConstraintResolver.h"
|
#include "../include/ConstraintResolver.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "../include/Counters.h"
|
#include "../include/Counters.h"
|
||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGCardInstance.h"
|
#include "../include/MTGCardInstance.h"
|
||||||
|
|
||||||
Counter::Counter(MTGCardInstance * _target, int _power, int _toughness){
|
Counter::Counter(MTGCardInstance * _target, int _power, int _toughness){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/Damage.h"
|
#include "../include/Damage.h"
|
||||||
#include "../include/MTGCardInstance.h"
|
#include "../include/MTGCardInstance.h"
|
||||||
#include "../include/Counters.h"
|
#include "../include/Counters.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/DamageResolverLayer.h"
|
#include "../include/DamageResolverLayer.h"
|
||||||
#include "../include/GameObserver.h"
|
#include "../include/GameObserver.h"
|
||||||
#include "../include/MTGCardInstance.h"
|
#include "../include/MTGCardInstance.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/DamagerDamaged.h"
|
#include "../include/DamagerDamaged.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,48 +1,48 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/DeckStats.h"
|
#include "../include/DeckStats.h"
|
||||||
#include "../include/Player.h"
|
#include "../include/Player.h"
|
||||||
|
|
||||||
DeckStats * DeckStats::mInstance = NULL;
|
DeckStats * DeckStats::mInstance = NULL;
|
||||||
|
|
||||||
int DeckStat::percentVictories(){
|
int DeckStat::percentVictories(){
|
||||||
if (nbgames == 0) return 50;
|
if (nbgames == 0) return 50;
|
||||||
return (100 * victories / nbgames);
|
return (100 * victories / nbgames);
|
||||||
}
|
}
|
||||||
|
|
||||||
DeckStats * DeckStats::GetInstance(){
|
DeckStats * DeckStats::GetInstance(){
|
||||||
if (!mInstance) mInstance = NEW DeckStats();
|
if (!mInstance) mInstance = NEW DeckStats();
|
||||||
return mInstance;
|
return mInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckStats::cleanStats(){
|
void DeckStats::cleanStats(){
|
||||||
map<string,DeckStat *>::iterator it;
|
map<string,DeckStat *>::iterator it;
|
||||||
for (it = stats.begin(); it != stats.end(); it++){
|
for (it = stats.begin(); it != stats.end(); it++){
|
||||||
SAFE_DELETE(it->second);
|
SAFE_DELETE(it->second);
|
||||||
}
|
}
|
||||||
stats.clear();
|
stats.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
DeckStats::~DeckStats(){
|
DeckStats::~DeckStats(){
|
||||||
cleanStats();
|
cleanStats();
|
||||||
}
|
}
|
||||||
|
|
||||||
int DeckStats::percentVictories(string opponentsFile){
|
int DeckStats::percentVictories(string opponentsFile){
|
||||||
map<string,DeckStat *>::iterator it = stats.find(opponentsFile);
|
map<string,DeckStat *>::iterator it = stats.find(opponentsFile);
|
||||||
if (it == stats.end()){
|
if (it == stats.end()){
|
||||||
return 50;
|
return 50;
|
||||||
}else{
|
}else{
|
||||||
return (it->second->percentVictories());
|
return (it->second->percentVictories());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckStats::load(Player * player){
|
void DeckStats::load(Player * player){
|
||||||
char filename[512];
|
char filename[512];
|
||||||
sprintf(filename, "Res/player/stats/%s.txt",player->deckFile.c_str());
|
sprintf(filename, RESPATH"/player/stats/%s.txt",player->deckFile.c_str());
|
||||||
load(filename);
|
load(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckStats::load(const char * filename){
|
void DeckStats::load(const char * filename){
|
||||||
cleanStats();
|
cleanStats();
|
||||||
std::ifstream file(filename);
|
std::ifstream file(filename);
|
||||||
std::string s;
|
std::string s;
|
||||||
|
|
||||||
@@ -55,17 +55,17 @@ void DeckStats::load(const char * filename){
|
|||||||
int victories = atoi(s.c_str());
|
int victories = atoi(s.c_str());
|
||||||
stats[deckfile] = NEW DeckStat(games,victories);
|
stats[deckfile] = NEW DeckStat(games,victories);
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckStats::save(Player * player){
|
void DeckStats::save(Player * player){
|
||||||
char filename[512];
|
char filename[512];
|
||||||
sprintf(filename, "Res/player/stats/%s.txt",player->deckFile.c_str());
|
sprintf(filename, RESPATH"/player/stats/%s.txt",player->deckFile.c_str());
|
||||||
save(filename);
|
save(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckStats::save(const char * filename){
|
void DeckStats::save(const char * filename){
|
||||||
std::ofstream file(filename);
|
std::ofstream file(filename);
|
||||||
char writer[512];
|
char writer[512];
|
||||||
if (file){
|
if (file){
|
||||||
@@ -79,25 +79,24 @@ void DeckStats::save(const char * filename){
|
|||||||
file<<writer;
|
file<<writer;
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeckStats::saveStats(Player *player, Player *opponent, GameObserver * game){
|
void DeckStats::saveStats(Player *player, Player *opponent, GameObserver * game){
|
||||||
int victory = 1;
|
int victory = 1;
|
||||||
if (!game->gameOver){
|
if (!game->gameOver){
|
||||||
if (player->life == opponent->life) return;
|
if (player->life == opponent->life) return;
|
||||||
if (player->life < opponent->life) victory = 0;
|
if (player->life < opponent->life) victory = 0;
|
||||||
}else if (game->gameOver == player) {
|
}else if (game->gameOver == player) {
|
||||||
victory = 0;
|
victory = 0;
|
||||||
}
|
}
|
||||||
load(player);
|
load(player);
|
||||||
map<string,DeckStat *>::iterator it = stats.find(opponent->deckFile);
|
map<string,DeckStat *>::iterator it = stats.find(opponent->deckFile);
|
||||||
if (it == stats.end()){
|
if (it == stats.end()){
|
||||||
stats[opponent->deckFile] = NEW DeckStat(1,victory);
|
stats[opponent->deckFile] = NEW DeckStat(1,victory);
|
||||||
}else{
|
}else{
|
||||||
it->second->victories+=victory;
|
it->second->victories+=victory;
|
||||||
it->second->nbgames+=1;
|
it->second->nbgames+=1;
|
||||||
}
|
}
|
||||||
save(player);
|
save(player);
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/DuelLayers.h"
|
#include "../include/DuelLayers.h"
|
||||||
#include "../include/MTGRules.h"
|
#include "../include/MTGRules.h"
|
||||||
#include "../include/DamageResolverLayer.h"
|
#include "../include/DamageResolverLayer.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include <JGE.h>
|
#include <JGE.h>
|
||||||
#include <JRenderer.h>
|
#include <JRenderer.h>
|
||||||
#if defined (WIN32) || defined (LINUX)
|
#if defined (WIN32) || defined (LINUX)
|
||||||
@@ -62,13 +62,13 @@ void GameApp::Create()
|
|||||||
LOG("starting Game");
|
LOG("starting Game");
|
||||||
|
|
||||||
//Test for Music files presence
|
//Test for Music files presence
|
||||||
std::ifstream file("Res/sound/Track0.mp3");
|
std::ifstream file(RESPATH"/sound/Track0.mp3");
|
||||||
if(file){
|
if(file){
|
||||||
file.close();
|
file.close();
|
||||||
}else{
|
}else{
|
||||||
HasMusic = 0;
|
HasMusic = 0;
|
||||||
}
|
}
|
||||||
std::ifstream file2("Res/sound/Track1.mp3");
|
std::ifstream file2(RESPATH"/sound/Track1.mp3");
|
||||||
if(file2){
|
if(file2){
|
||||||
file2.close();
|
file2.close();
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) <jhkhui@gmail.com>
|
// Copyright (c) 2007 James Hui (a.k.a. Dr.Watson) <jhkhui@gmail.com>
|
||||||
//
|
//
|
||||||
//-------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------
|
||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <JGameLauncher.h>
|
#include <JGameLauncher.h>
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/GameObserver.h"
|
#include "../include/GameObserver.h"
|
||||||
|
|
||||||
#include "../include/GameOptions.h"
|
#include "../include/GameOptions.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/GameOptions.h"
|
#include "../include/GameOptions.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/GameStateDuel.h"
|
#include "../include/GameStateDuel.h"
|
||||||
#include "../include/utils.h"
|
#include "../include/utils.h"
|
||||||
#include "../include/AIPlayer.h"
|
#include "../include/AIPlayer.h"
|
||||||
@@ -39,7 +39,7 @@ void GameStateDuel::Start()
|
|||||||
|
|
||||||
#ifdef TESTSUITE
|
#ifdef TESTSUITE
|
||||||
if (testSuite) delete testSuite;
|
if (testSuite) delete testSuite;
|
||||||
testSuite = NEW TestSuite("Res/test/_tests.txt");
|
testSuite = NEW TestSuite(RESPATH"/test/_tests.txt");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ void GameStateDuel::Start()
|
|||||||
deckmenu = NEW SimpleMenu(1,this,mFont, 10 , 10, 100, "Choose a Deck");
|
deckmenu = NEW SimpleMenu(1,this,mFont, 10 , 10, 100, "Choose a Deck");
|
||||||
char buffer[100];
|
char buffer[100];
|
||||||
for (int j=1; j<6; j++){
|
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);
|
std::ifstream file(buffer);
|
||||||
if(file){
|
if(file){
|
||||||
deckmenu->Add(j, GameState::menuTexts[j]);
|
deckmenu->Add(j, GameState::menuTexts[j]);
|
||||||
@@ -88,7 +88,7 @@ void GameStateDuel::loadPlayer(int playerId, int decknb, int isAI){
|
|||||||
if (decknb){
|
if (decknb){
|
||||||
if (!isAI){ //Human Player
|
if (!isAI){ //Human Player
|
||||||
char deckFile[255];
|
char deckFile[255];
|
||||||
sprintf(deckFile, "Res/player/deck%i.txt",decknb);
|
sprintf(deckFile, RESPATH"/player/deck%i.txt",decknb);
|
||||||
char deckFileSmall[255];
|
char deckFileSmall[255];
|
||||||
sprintf(deckFileSmall, "player_deck%i",decknb);
|
sprintf(deckFileSmall, "player_deck%i",decknb);
|
||||||
int deck_cards_ids[100];
|
int deck_cards_ids[100];
|
||||||
@@ -205,7 +205,7 @@ void GameStateDuel::Update(float dt)
|
|||||||
char buffer[512];
|
char buffer[512];
|
||||||
char aiSmallDeckName[512];
|
char aiSmallDeckName[512];
|
||||||
char deckDesc[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)){
|
if(fileExists(buffer)){
|
||||||
found = 1;
|
found = 1;
|
||||||
nbAIDecks++;
|
nbAIDecks++;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/GameStateOptions.h"
|
#include "../include/GameStateOptions.h"
|
||||||
#include "../include/GameApp.h"
|
#include "../include/GameApp.h"
|
||||||
#include "../include/OptionItem.h"
|
#include "../include/OptionItem.h"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
The shop is where the player can buy cards, decks...
|
The shop is where the player can buy cards, decks...
|
||||||
*/
|
*/
|
||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include <JRenderer.h>
|
#include <JRenderer.h>
|
||||||
#include "../include/GameStateShop.h"
|
#include "../include/GameStateShop.h"
|
||||||
#include "../include/GameApp.h"
|
#include "../include/GameApp.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/GuiCardsController.h"
|
#include "../include/GuiCardsController.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/GuiLayers.h"
|
#include "../include/GuiLayers.h"
|
||||||
#include "../include/Player.h"
|
#include "../include/Player.h"
|
||||||
|
|
||||||
GuiLayer::GuiLayer(int id, GameObserver* _game):JGuiController(id, NULL){
|
GuiLayer::GuiLayer(int id, GameObserver* _game):JGuiController(id, NULL){
|
||||||
game = _game;
|
game = _game;
|
||||||
modal = 0;
|
modal = 0;
|
||||||
hasFocus = 0;
|
hasFocus = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
GuiLayer::~GuiLayer(){
|
GuiLayer::~GuiLayer(){
|
||||||
@@ -121,21 +121,22 @@ void GuiLayers::Update(float dt, Player * currentPlayer){
|
|||||||
for (i=0; i<nbitems; i++){
|
for (i=0; i<nbitems; i++){
|
||||||
if (!isAI){
|
if (!isAI){
|
||||||
if (0 != key)
|
if (0 != key)
|
||||||
{
|
if (objects[i]->CheckUserInput(key))
|
||||||
objects[i]->hasFocus = 1;
|
break;
|
||||||
if (objects[i]->CheckUserInput(key))
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (++i; i<nbitems; ++i) objects[i]->hasFocus = 0;
|
if (isAI)
|
||||||
if (isAI){
|
|
||||||
currentPlayer->Act(dt);
|
currentPlayer->Act(dt);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GuiLayers::Render(){
|
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--){
|
for (int i=nbitems-1; i>=0; i--){
|
||||||
objects[i]->Render();
|
objects[i]->Render();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/Logger.h"
|
#include "../include/Logger.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGAbility.h"
|
#include "../include/MTGAbility.h"
|
||||||
#include "../include/ManaCost.h"
|
#include "../include/ManaCost.h"
|
||||||
#include "../include/MTGGameZones.h"
|
#include "../include/MTGGameZones.h"
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
//TODO Fill BasicAbilities
|
//TODO Fill BasicAbilities
|
||||||
|
|
||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGCard.h"
|
#include "../include/MTGCard.h"
|
||||||
|
|
||||||
#include "../include/TexturesCache.h"
|
#include "../include/TexturesCache.h"
|
||||||
|
|||||||
@@ -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
|
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/MTGCardInstance.h"
|
||||||
#include "../include/CardDescriptor.h"
|
#include "../include/CardDescriptor.h"
|
||||||
#include "../include/Counters.h"
|
#include "../include/Counters.h"
|
||||||
@@ -19,6 +19,7 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * _belongs_to):
|
|||||||
LOG("==Creating MTGCardInstance==");
|
LOG("==Creating MTGCardInstance==");
|
||||||
initMTGCI();
|
initMTGCI();
|
||||||
model = card;
|
model = card;
|
||||||
|
attacker = 0;
|
||||||
lifeOrig = life;
|
lifeOrig = life;
|
||||||
belongs_to=_belongs_to;
|
belongs_to=_belongs_to;
|
||||||
initAttackersDefensers();
|
initAttackersDefensers();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGDeck.h"
|
#include "../include/MTGDeck.h"
|
||||||
#include "../include/utils.h"
|
#include "../include/utils.h"
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGGamePhase.h"
|
#include "../include/MTGGamePhase.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ void MTGGamePhase::Update(float dt){
|
|||||||
|
|
||||||
|
|
||||||
if (animation > 0){
|
if (animation > 0){
|
||||||
fprintf(stderr, "animation = %f", animation);
|
// fprintf(stderr, "animation = %f", animation);
|
||||||
animation -= dt *5 ;
|
animation -= dt *5 ;
|
||||||
}else{
|
}else{
|
||||||
activeState = INACTIVE;
|
activeState = INACTIVE;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGGameZones.h"
|
#include "../include/MTGGameZones.h"
|
||||||
#include "../include/Player.h"
|
#include "../include/Player.h"
|
||||||
#include "../include/GameOptions.h"
|
#include "../include/GameOptions.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGGuiHand.h"
|
#include "../include/MTGGuiHand.h"
|
||||||
#include "../include/CardGui.h"
|
#include "../include/CardGui.h"
|
||||||
|
|
||||||
@@ -52,6 +52,7 @@ void MTGGuiHand::Update(float dt){
|
|||||||
if (mAnimState < 0){
|
if (mAnimState < 0){
|
||||||
mAnimState = 0;
|
mAnimState = 0;
|
||||||
mShowHand = HAND_HIDE;
|
mShowHand = HAND_HIDE;
|
||||||
|
modal = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,6 +66,7 @@ bool MTGGuiHand::CheckUserInput(u32 key){
|
|||||||
if (PSP_CTRL_LTRIGGER == key) {
|
if (PSP_CTRL_LTRIGGER == key) {
|
||||||
if (mShowHand == HAND_HIDE){
|
if (mShowHand == HAND_HIDE){
|
||||||
mShowHand = HAND_SHOW_ANIMATION;
|
mShowHand = HAND_SHOW_ANIMATION;
|
||||||
|
modal = true;
|
||||||
}
|
}
|
||||||
if (mShowHand == HAND_SHOW){
|
if (mShowHand == HAND_SHOW){
|
||||||
mShowHand = HAND_HIDE_ANIMATION;
|
mShowHand = HAND_HIDE_ANIMATION;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
cards in play, graveyard, library, games phases, Players avatars
|
cards in play, graveyard, library, games phases, Players avatars
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGGuiPlay.h"
|
#include "../include/MTGGuiPlay.h"
|
||||||
#include "../include/MTGCardInstance.h"
|
#include "../include/MTGCardInstance.h"
|
||||||
#include "../include/CardGui.h"
|
#include "../include/CardGui.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGRules.h"
|
#include "../include/MTGRules.h"
|
||||||
|
|
||||||
MTGAttackRule::MTGAttackRule(int _id):MTGAbility(_id,NULL){
|
MTGAttackRule::MTGAttackRule(int _id):MTGAbility(_id,NULL){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/Logger.h"
|
#include "../include/Logger.h"
|
||||||
#include "../include/ManaCost.h"
|
#include "../include/ManaCost.h"
|
||||||
#include "../include/ManaCostHybrid.h"
|
#include "../include/ManaCostHybrid.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MenuItem.h"
|
#include "../include/MenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#include "../include/PhaseRing.h"
|
#include "../include/PhaseRing.h"
|
||||||
#include "../include/MTGDefinitions.h"
|
#include "../include/MTGDefinitions.h"
|
||||||
#include "../include/Player.h"
|
#include "../include/Player.h"
|
||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/PlayGuiObject.h"
|
#include "../include/PlayGuiObject.h"
|
||||||
|
|
||||||
#include "../include/Player.h"
|
#include "../include/Player.h"
|
||||||
@@ -20,7 +20,7 @@ void PlayGuiObject::Update(float dt){
|
|||||||
if (mHasFocus && mHeight < defaultHeight * 1.2)
|
if (mHasFocus && mHeight < defaultHeight * 1.2)
|
||||||
{
|
{
|
||||||
mHeight += defaultHeight*0.8f*dt;
|
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)
|
if (mHeight > defaultHeight * 1.2)
|
||||||
mHeight = defaultHeight * 1.2;
|
mHeight = defaultHeight * 1.2;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/PlayGuiObjectController.h"
|
#include "../include/PlayGuiObjectController.h"
|
||||||
|
|
||||||
#include "../include/PlayGuiObject.h"
|
#include "../include/PlayGuiObject.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/Player.h"
|
#include "../include/Player.h"
|
||||||
#include "../include/GameObserver.h"
|
#include "../include/GameObserver.h"
|
||||||
#include "../include/DeckStats.h"
|
#include "../include/DeckStats.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/PlayerData.h"
|
#include "../include/PlayerData.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -19,7 +19,7 @@ PlayerData::PlayerData(MTGAllCards * allcards){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//COLLECTION
|
//COLLECTION
|
||||||
collection = NEW MTGDeck("Res/player/collection.dat", allcards->mCache , allcards);
|
collection = NEW MTGDeck(RESPATH"/player/collection.dat", allcards->mCache , allcards);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/PriceList.h"
|
#include "../include/PriceList.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/ShopItem.h"
|
#include "../include/ShopItem.h"
|
||||||
#include "../include/CardGui.h"
|
#include "../include/CardGui.h"
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ ShopItems::ShopItems(int id, JGuiListener* listener, JLBFont* font, int x, int y
|
|||||||
mHeight = 0;
|
mHeight = 0;
|
||||||
showPriceDialog = -1;
|
showPriceDialog = -1;
|
||||||
dialog = NULL;
|
dialog = NULL;
|
||||||
pricelist = NEW PriceList("Res/settings/prices.dat",_collection);
|
pricelist = NEW PriceList(RESPATH"/settings/prices.dat",_collection);
|
||||||
playerdata = NEW PlayerData(_collection);
|
playerdata = NEW PlayerData(_collection);
|
||||||
display = NULL;
|
display = NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/SimpleMenu.h"
|
#include "../include/SimpleMenu.h"
|
||||||
#include "../include/SimpleMenuItem.h"
|
#include "../include/SimpleMenuItem.h"
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/SimpleMenuItem.h"
|
#include "../include/SimpleMenuItem.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/Subtypes.h"
|
#include "../include/Subtypes.h"
|
||||||
#include <JGE.h>
|
#include <JGE.h>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/TargetChooser.h"
|
#include "../include/TargetChooser.h"
|
||||||
#include "../include/CardDescriptor.h"
|
#include "../include/CardDescriptor.h"
|
||||||
#include "../include/MTGGameZones.h"
|
#include "../include/MTGGameZones.h"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/TargetsList.h"
|
#include "../include/TargetsList.h"
|
||||||
#include "../include/Player.h"
|
#include "../include/Player.h"
|
||||||
#include "../include/MTGCardInstance.h"
|
#include "../include/MTGCardInstance.h"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#include "../include/TestSuiteAI.h"
|
#include "../include/TestSuiteAI.h"
|
||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
using std::string;
|
using std::string;
|
||||||
@@ -247,7 +247,7 @@ void TestSuite::initGame(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TestSuite::Log(const char * text){
|
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){
|
if (file){
|
||||||
file << text;
|
file << text;
|
||||||
file << "\n";
|
file << "\n";
|
||||||
@@ -334,7 +334,7 @@ TestSuite::TestSuite(const char * filename){
|
|||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
ofstream file2 ("Res/test/results.html");
|
ofstream file2 (RESPATH"/test/results.html");
|
||||||
if (file2){
|
if (file2){
|
||||||
file2 << "<html><head>";
|
file2 << "<html><head>";
|
||||||
file2 << "<meta http-equiv=\"refresh\" content=\"10\" >";
|
file2 << "<meta http-equiv=\"refresh\" content=\"10\" >";
|
||||||
@@ -405,7 +405,7 @@ void TestSuite::cleanup(){
|
|||||||
|
|
||||||
void TestSuite::load(const char * _filename){
|
void TestSuite::load(const char * _filename){
|
||||||
char filename[4096];
|
char filename[4096];
|
||||||
sprintf(filename, "Res/test/%s", _filename);
|
sprintf(filename, RESPATH"/test/%s", _filename);
|
||||||
std::ifstream file(filename);
|
std::ifstream file(filename);
|
||||||
std::string s;
|
std::string s;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/TexturesCache.h"
|
#include "../include/TexturesCache.h"
|
||||||
|
|
||||||
TexturesCache::TexturesCache(){
|
TexturesCache::TexturesCache(){
|
||||||
@@ -27,8 +27,7 @@ int TexturesCache::isInCache(MTGCard * card, int type){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int TexturesCache::getCacheById(int id, int type){
|
int TexturesCache::getCacheById(int id, int type){
|
||||||
int i;
|
for (int i=0; i<nb_textures;i++){
|
||||||
for (i=0; i<nb_textures;i++){
|
|
||||||
if (cache[i]->type == type && cache[i]->getId() == id){
|
if (cache[i]->type == type && cache[i]->getId() == id){
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@@ -68,7 +67,7 @@ int TexturesCache::cleanup(){
|
|||||||
JQuad * TexturesCache::getQuad(MTGCard * card, int type){
|
JQuad * TexturesCache::getQuad(MTGCard * card, int type){
|
||||||
int cache_id = getCacheById(card->getId(), type);
|
int cache_id = getCacheById(card->getId(), type);
|
||||||
if (cache_id == -1){
|
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
|
//Not found in the cache, we have to load the file and put it in the cache
|
||||||
if (cleanup()){
|
if (cleanup()){
|
||||||
cache_id = nb_textures;
|
cache_id = nb_textures;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
#include "../include/debug.h"
|
#include "../include/config.h"
|
||||||
#include "../include/utils.h"
|
#include "../include/utils.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -63,7 +63,7 @@ if(fichier){
|
|||||||
}
|
}
|
||||||
|
|
||||||
char alternateFilename[512];
|
char alternateFilename[512];
|
||||||
sprintf(alternateFilename, "Res/%s",filename);
|
sprintf(alternateFilename, RESPATH"/%s",filename);
|
||||||
std::ifstream fichier2(alternateFilename);
|
std::ifstream fichier2(alternateFilename);
|
||||||
if(fichier2){
|
if(fichier2){
|
||||||
fichier2.close();
|
fichier2.close();
|
||||||
|
|||||||
Reference in New Issue
Block a user