* Change the name of debug.h into config.h and use the new RESPATH define.
This commit is contained in:
jean.chalard
2008-12-25 16:28:03 +00:00
parent 161da1d3cb
commit 3e9ff2b580
61 changed files with 191 additions and 178 deletions

View File

@@ -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];

View File

@@ -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();

View File

@@ -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");

View File

@@ -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);

View File

@@ -9,7 +9,7 @@
#define LOG(x)
#endif
#define LOG_FILE "Res/debug.txt"
#define LOG_FILE RESPATH"/debug.txt"
class Logger{
public:

View File

@@ -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"

View File

@@ -21,4 +21,8 @@
#endif
#endif
#ifndef RESPATH
#define RESPATH "Res"
#endif
#endif

View File

@@ -10,7 +10,7 @@
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspiofilemgr.h>
#include <pspdebug.h>
#include <pspconfig.h>
#include <psputility.h>
#include <pspgu.h>
#include <psprtc.h>
@@ -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