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

View File

@@ -79,11 +79,14 @@ GameApp::~GameApp()
void GameApp::Create()
{
srand((unsigned int)time(0)); // initialize random
#ifndef QT_CONFIG
#if defined (WIN32)
_CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
#elif not defined (LINUX)
pspfpu_set_enable(0); //disable FPU Exceptions until we find where the FPU errors come from
#endif
#endif //QT_CONFIG
//_CrtSetBreakAlloc(368);
LOG("starting Game");

View File

@@ -1,3 +1,5 @@
#include "../include/config.h"
#include "../include/DebugRoutines.h"
#include "../include/Rules.h"
#include "../include/MTGDefinitions.h"
#include "../include/config.h"
@@ -14,9 +16,7 @@ int Rules::getMTGId(string cardName){
if (cardName.compare("*") == 0) return -1; //Any card
MTGCard * card = GameApp::collection->getCardByName(cardName);
if (card) return card->getMTGId();
OutputDebugString("RULES: Can't find card:");
OutputDebugString(cardName.c_str());
OutputDebugString("\n");
DebugTrace("RULES: Can't find card:" << cardName.c_str());
return 0;
}
@@ -272,7 +272,7 @@ void Rules::initPlayers(){
void Rules::initGame(){
//Put the GameObserver in the initial state
GameObserver * g = GameObserver::GetInstance();
OutputDebugString("RULES Init Game\n");
DebugTrace("RULES Init Game\n");
//Set the current player/phase
g->currentPlayer = g->players[initState.player];
@@ -317,7 +317,7 @@ void Rules::initGame(){
}
}
addExtraRules();
OutputDebugString("RULES Init Game Done !\n");
DebugTrace("RULES Init Game Done !\n");
}

View File

@@ -1,4 +1,5 @@
#include "../include/config.h"
#include "../include/DebugRoutines.h"
#include "../include/TargetChooser.h"
#include "../include/CardDescriptor.h"
#include "../include/MTGGameZones.h"
@@ -333,7 +334,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(MTGCardInstance * card
case 1224: //Spell blast
{
#if defined (WIN32) || defined (LINUX)
OutputDebugString ("Counter Spell !\n");
DebugTrace("Counter Spell !\n");
#endif
return NEW SpellTargetChooser(card);
}
@@ -660,7 +661,7 @@ bool TargetZoneChooser::canTarget(Targetable * target){
if (MTGGameZone::intToZone(zones[i],source,card)->hasCard(card)) return true;
}
}else if (target->typeAsTarget() == TARGET_STACKACTION){
OutputDebugString ("CHECKING INTERRUPTIBLE\n");
DebugTrace("CHECKING INTERRUPTIBLE\n");
Interruptible * action = (Interruptible *) target;
if (action->type == ACTION_SPELL && action->state==NOT_RESOLVED){
Spell * spell = (Spell *) action;
@@ -813,4 +814,4 @@ bool DamageTargetChooser::canTarget(Targetable * target){
TriggerTargetChooser * TriggerTargetChooser::clone() const{
TriggerTargetChooser * a = NEW TriggerTargetChooser(*this);
return a;
}
}

View File

@@ -1,4 +1,5 @@
#include "../include/config.h"
#include "../include/DebugRoutines.h"
#include "../include/GameApp.h"
#include "../include/Player.h"
#include "../include/Tasks.h"
@@ -94,7 +95,7 @@ void Task::storeCommonAttribs() {
int Task::restoreCommonAttribs() {
if (persistentAttribs.size() < COMMON_ATTRIBS_COUNT) {
#if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTasks.cpp::restoreCommonAttribs: Not enough attributes loaded\n");
DebugTrace("\nTasks.cpp::restoreCommonAttribs: Not enough attributes loaded\n");
#endif
return -1;
@@ -224,14 +225,14 @@ Task* Task::createFromStr(string params, bool rand) {
break;
default:
#if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTasks.cpp::createFromStr: Undefined class type\n");
DebugTrace("\nTasks.cpp::createFromStr: Undefined class type\n");
#endif
result = NEW TaskWinAgainst();
}
if (!result) {
#if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTask::createFromStr: Failed to create task\n");
DebugTrace("\nTask::createFromStr: Failed to create task\n");
#endif
return NULL;
}
@@ -269,7 +270,7 @@ int TaskList::save(string _fileName) {
}
if (fileName == "") {
#if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTaskList::save: No filename specified\n");
DebugTrace("\nTaskList::save: No filename specified\n");
#endif
return -1;
}
@@ -277,7 +278,7 @@ int TaskList::save(string _fileName) {
std::ofstream file(fileName.c_str());
if (file){
#if defined (WIN32) || defined (LINUX)
OutputDebugString("\nsaving tasks\n");
DebugTrace("\nsaving tasks\n");
#endif
file << "# Format: <Type>|<Expiration>|<Accepted>|<Opponent>|<Reward>|<Description>[|Additional attributes]\n";
@@ -298,7 +299,7 @@ int TaskList::load(string _fileName) {
}
if (fileName == "") {
#if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTaskList::load: No filename specified\n");
DebugTrace("\nTaskList::load: No filename specified\n");
#endif
return -1;
}
@@ -319,14 +320,14 @@ int TaskList::load(string _fileName) {
this->addTask(task);
} else {
#if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTaskList::load: error creating task\n");
DebugTrace("\nTaskList::load: error creating task\n");
#endif
}
}
file.close();
} else {
#if defined (WIN32) || defined (LINUX)
OutputDebugString("\nTaskList::load: Failed to open file\n");
DebugTrace("\nTaskList::load: Failed to open file\n");
#endif
return -1;
}