More OutputDebugString() -> DebugTrace changes.

This commit is contained in:
wrenczes@gmail.com
2010-10-06 10:45:29 +00:00
parent 291a0d0312
commit 5595c0d3d8
4 changed files with 21 additions and 26 deletions
+2
View File
@@ -4,6 +4,8 @@
// dirty, but I get OS header includes this way // dirty, but I get OS header includes this way
#include "JGE.h" #include "JGE.h"
#include "../include/config.h"
#include <iostream> #include <iostream>
#include <stdio.h> #include <stdio.h>
#include <string> #include <string>
+8 -12
View File
@@ -5,6 +5,7 @@
#include <math.h> #include <math.h>
#include "../include/config.h" #include "../include/config.h"
#include "../include/DebugRoutines.h"
#include "../include/GameStateMenu.h" #include "../include/GameStateMenu.h"
#include "../include/MenuItem.h" #include "../include/MenuItem.h"
#include "../include/GameOptions.h" #include "../include/GameOptions.h"
@@ -415,12 +416,10 @@ void GameStateMenu::Update(float dt)
if (!nextDirectory(RESPATH"/sets/","_cards.dat")){ if (!nextDirectory(RESPATH"/sets/","_cards.dat")){
//Remove temporary translations //Remove temporary translations
Translator::GetInstance()->tempValues.clear(); Translator::GetInstance()->tempValues.clear();
//Debug
#ifdef _DEBUG DebugTrace(std::endl << "==" << std::endl <<
char buf[4096]; "Total MTGCards: " << mParent->collection->collection.size() << std::endl <<
sprintf(buf, "\n==\nTotal MTGCard: %lu\nTotal CardPrimitives: %lu\n==\n", (long unsigned)mParent->collection->collection.size(), (long unsigned)mParent->collection->primitives.size()); "Total CardPrimitives: " << mParent->collection->primitives.size() << std::endl << "==");
OutputDebugString(buf);
#endif
//Force default, if necessary. //Force default, if necessary.
if(options[Options::ACTIVE_PROFILE].str == "") if(options[Options::ACTIVE_PROFILE].str == "")
@@ -635,12 +634,9 @@ void GameStateMenu::Render()
void GameStateMenu::ButtonPressed(int controllerId, int controlId) void GameStateMenu::ButtonPressed(int controllerId, int controlId)
{ {
WFont * mFont = resources.GetWFont(Constants::MENU_FONT); WFont * mFont = resources.GetWFont(Constants::MENU_FONT);
#if defined (WIN32) || defined (LINUX)
char buf[4096]; DebugTrace("GameStateMenu: controllerId " << controllerId << " selected");
sprintf(buf, "cnotrollerId: %i", controllerId);
OutputDebugString(buf);
#endif
switch (controllerId){ switch (controllerId){
case MENU_LANGUAGE_SELECTION: case MENU_LANGUAGE_SELECTION:
setLang(controlId); setLang(controlId);
+5 -8
View File
@@ -1,4 +1,5 @@
#include "../include/config.h" #include "../include/config.h"
#include "../include/DebugRoutines.h"
#include "../include/ManaCost.h" #include "../include/ManaCost.h"
#include "../include/ManaCostHybrid.h" #include "../include/ManaCostHybrid.h"
#include "../include/ExtraCost.h" #include "../include/ExtraCost.h"
@@ -490,22 +491,18 @@ ManaCost * ManaCost::Diff(ManaCost * _cost){
#ifdef WIN32 #ifdef WIN32
void ManaCost::Dump(){ void ManaCost::Dump(){
char buf[4096]; DebugTrace("\n===ManaCost===\n");
OutputDebugString("\n===ManaCost===\n");
for (int i=0; i<= Constants::MTG_NB_COLORS; i++){ for (int i=0; i<= Constants::MTG_NB_COLORS; i++){
if (cost[i]) { if (cost[i]) {
sprintf(buf, "%c:%i - ", Constants::MTGColorChars[i],cost[i]); DebugTrace(Constants::MTGColorChars[i] << ":" << cost[i] << " - ");
OutputDebugString(buf);
} }
} }
for (unsigned int i=0; i< nbhybrids; i++){ for (unsigned int i=0; i< nbhybrids; i++){
ManaCostHybrid * h = hybrids[i]; ManaCostHybrid * h = hybrids[i];
DebugTrace("H:{" << Constants::MTGColorChars[h->color1] << ":" << h->value1 << "}/{" << Constants::MTGColorChars[h->color2] << ":" << h->value2 << "}");
sprintf(buf, "H:{%c:%i}/{%c:%i}", Constants::MTGColorChars[h->color1], h->value1, Constants::MTGColorChars[h->color2], h->value2);
OutputDebugString(buf);
} }
OutputDebugString("\n=============\n"); DebugTrace("\n=============\n");
} }
#endif #endif
+6 -6
View File
@@ -1,3 +1,4 @@
#include "../include/DebugRoutines.h"
#include "../include/PhaseRing.h" #include "../include/PhaseRing.h"
#include "../include/MTGDefinitions.h" #include "../include/MTGDefinitions.h"
#include "../include/Player.h" #include "../include/Player.h"
@@ -19,9 +20,8 @@ int PhaseRing::phaseStrToInt(string s){
if (s.compare("secondmain") == 0)return Constants::MTG_PHASE_SECONDMAIN; if (s.compare("secondmain") == 0)return Constants::MTG_PHASE_SECONDMAIN;
if (s.compare("endofturn") == 0)return Constants::MTG_PHASE_ENDOFTURN; if (s.compare("endofturn") == 0)return Constants::MTG_PHASE_ENDOFTURN;
if (s.compare("cleanup") == 0)return Constants::MTG_PHASE_CLEANUP; if (s.compare("cleanup") == 0)return Constants::MTG_PHASE_CLEANUP;
OutputDebugString("PHASERING: Unknown Phase name:"); DebugTrace("PHASERING: Unknown Phase name: " << s);
OutputDebugString(s.c_str());
OutputDebugString("\n");
return Constants::MTG_PHASE_FIRSTMAIN; return Constants::MTG_PHASE_FIRSTMAIN;
} }
@@ -90,9 +90,9 @@ Phase * PhaseRing::forward(bool sendEvents){
Phase * PhaseRing::goToPhase(int id, Player * player, bool sendEvents){ Phase * PhaseRing::goToPhase(int id, Player * player, bool sendEvents){
Phase * currentPhase = *current; Phase * currentPhase = *current;
while(currentPhase->id !=id || currentPhase->player != player){ //Dangerous, risk for inifinte loop ! while(currentPhase->id !=id || currentPhase->player != player){ //Dangerous, risk for inifinte loop !
#ifdef WIN32
OutputDebugString("goto"); DebugTrace("PhasingRing: goToPhase called, current phase is " << phaseName(currentPhase->id));
#endif
currentPhase = forward(sendEvents); currentPhase = forward(sendEvents);
} }
return currentPhase; return currentPhase;