Fixed Qt project compile on Windows

This commit is contained in:
Xawotihs
2010-10-16 12:17:25 +00:00
parent 817a666a2f
commit e082deaddf
4 changed files with 21 additions and 16 deletions
+3
View File
@@ -79,11 +79,14 @@ GameApp::~GameApp()
void GameApp::Create() void GameApp::Create()
{ {
srand((unsigned int)time(0)); // initialize random srand((unsigned int)time(0)); // initialize random
#ifndef QT_CONFIG
#if defined (WIN32) #if defined (WIN32)
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#elif not defined (LINUX) #elif not defined (LINUX)
pspfpu_set_enable(0); //disable FPU Exceptions until we find where the FPU errors come from pspfpu_set_enable(0); //disable FPU Exceptions until we find where the FPU errors come from
#endif #endif
#endif //QT_CONFIG
//_CrtSetBreakAlloc(368); //_CrtSetBreakAlloc(368);
LOG("starting Game"); LOG("starting Game");
+5 -5
View File
@@ -1,3 +1,5 @@
#include "../include/config.h"
#include "../include/DebugRoutines.h"
#include "../include/Rules.h" #include "../include/Rules.h"
#include "../include/MTGDefinitions.h" #include "../include/MTGDefinitions.h"
#include "../include/config.h" #include "../include/config.h"
@@ -14,9 +16,7 @@ int Rules::getMTGId(string cardName){
if (cardName.compare("*") == 0) return -1; //Any card if (cardName.compare("*") == 0) return -1; //Any card
MTGCard * card = GameApp::collection->getCardByName(cardName); MTGCard * card = GameApp::collection->getCardByName(cardName);
if (card) return card->getMTGId(); if (card) return card->getMTGId();
OutputDebugString("RULES: Can't find card:"); DebugTrace("RULES: Can't find card:" << cardName.c_str());
OutputDebugString(cardName.c_str());
OutputDebugString("\n");
return 0; return 0;
} }
@@ -272,7 +272,7 @@ void Rules::initPlayers(){
void Rules::initGame(){ void Rules::initGame(){
//Put the GameObserver in the initial state //Put the GameObserver in the initial state
GameObserver * g = GameObserver::GetInstance(); GameObserver * g = GameObserver::GetInstance();
OutputDebugString("RULES Init Game\n"); DebugTrace("RULES Init Game\n");
//Set the current player/phase //Set the current player/phase
g->currentPlayer = g->players[initState.player]; g->currentPlayer = g->players[initState.player];
@@ -317,7 +317,7 @@ void Rules::initGame(){
} }
} }
addExtraRules(); addExtraRules();
OutputDebugString("RULES Init Game Done !\n"); DebugTrace("RULES Init Game Done !\n");
} }
+3 -2
View File
@@ -1,4 +1,5 @@
#include "../include/config.h" #include "../include/config.h"
#include "../include/DebugRoutines.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"
@@ -333,7 +334,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(MTGCardInstance * card
case 1224: //Spell blast case 1224: //Spell blast
{ {
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString ("Counter Spell !\n"); DebugTrace("Counter Spell !\n");
#endif #endif
return NEW SpellTargetChooser(card); return NEW SpellTargetChooser(card);
} }
@@ -660,7 +661,7 @@ bool TargetZoneChooser::canTarget(Targetable * target){
if (MTGGameZone::intToZone(zones[i],source,card)->hasCard(card)) return true; if (MTGGameZone::intToZone(zones[i],source,card)->hasCard(card)) return true;
} }
}else if (target->typeAsTarget() == TARGET_STACKACTION){ }else if (target->typeAsTarget() == TARGET_STACKACTION){
OutputDebugString ("CHECKING INTERRUPTIBLE\n"); DebugTrace("CHECKING INTERRUPTIBLE\n");
Interruptible * action = (Interruptible *) target; Interruptible * action = (Interruptible *) target;
if (action->type == ACTION_SPELL && action->state==NOT_RESOLVED){ if (action->type == ACTION_SPELL && action->state==NOT_RESOLVED){
Spell * spell = (Spell *) action; Spell * spell = (Spell *) action;
+9 -8
View File
@@ -1,4 +1,5 @@
#include "../include/config.h" #include "../include/config.h"
#include "../include/DebugRoutines.h"
#include "../include/GameApp.h" #include "../include/GameApp.h"
#include "../include/Player.h" #include "../include/Player.h"
#include "../include/Tasks.h" #include "../include/Tasks.h"
@@ -94,7 +95,7 @@ void Task::storeCommonAttribs() {
int Task::restoreCommonAttribs() { int Task::restoreCommonAttribs() {
if (persistentAttribs.size() < COMMON_ATTRIBS_COUNT) { if (persistentAttribs.size() < COMMON_ATTRIBS_COUNT) {
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTasks.cpp::restoreCommonAttribs: Not enough attributes loaded\n"); DebugTrace("\nTasks.cpp::restoreCommonAttribs: Not enough attributes loaded\n");
#endif #endif
return -1; return -1;
@@ -224,14 +225,14 @@ Task* Task::createFromStr(string params, bool rand) {
break; break;
default: default:
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTasks.cpp::createFromStr: Undefined class type\n"); DebugTrace("\nTasks.cpp::createFromStr: Undefined class type\n");
#endif #endif
result = NEW TaskWinAgainst(); result = NEW TaskWinAgainst();
} }
if (!result) { if (!result) {
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTask::createFromStr: Failed to create task\n"); DebugTrace("\nTask::createFromStr: Failed to create task\n");
#endif #endif
return NULL; return NULL;
} }
@@ -269,7 +270,7 @@ int TaskList::save(string _fileName) {
} }
if (fileName == "") { if (fileName == "") {
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTaskList::save: No filename specified\n"); DebugTrace("\nTaskList::save: No filename specified\n");
#endif #endif
return -1; return -1;
} }
@@ -277,7 +278,7 @@ int TaskList::save(string _fileName) {
std::ofstream file(fileName.c_str()); std::ofstream file(fileName.c_str());
if (file){ if (file){
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString("\nsaving tasks\n"); DebugTrace("\nsaving tasks\n");
#endif #endif
file << "# Format: <Type>|<Expiration>|<Accepted>|<Opponent>|<Reward>|<Description>[|Additional attributes]\n"; file << "# Format: <Type>|<Expiration>|<Accepted>|<Opponent>|<Reward>|<Description>[|Additional attributes]\n";
@@ -298,7 +299,7 @@ int TaskList::load(string _fileName) {
} }
if (fileName == "") { if (fileName == "") {
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTaskList::load: No filename specified\n"); DebugTrace("\nTaskList::load: No filename specified\n");
#endif #endif
return -1; return -1;
} }
@@ -319,14 +320,14 @@ int TaskList::load(string _fileName) {
this->addTask(task); this->addTask(task);
} else { } else {
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTaskList::load: error creating task\n"); DebugTrace("\nTaskList::load: error creating task\n");
#endif #endif
} }
} }
file.close(); file.close();
} else { } else {
#if defined (WIN32) || defined (LINUX) #if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTaskList::load: Failed to open file\n"); DebugTrace("\nTaskList::load: Failed to open file\n");
#endif #endif
return -1; return -1;
} }