nakee's new logmanager. added a console window for windows builds (prints to parent console on non-win32). also fix some random wxw bugs: main window's position is saved when using debugger, disabling windows from the tools menu are saved settings, some other small fixes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2675 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman
2009-03-18 17:17:58 +00:00
parent 03ba466b5b
commit 2301d072a6
120 changed files with 1758 additions and 1103 deletions

View File

@ -111,7 +111,7 @@ int G2Accelerometer(int _G, int XYZ, int Wm)
int Return = (int)Accelerometer;
// Logging
//Console::Print("G2Accelerometer():%f %f %f %f\n", Neutral, OneG, G, Accelerometer);
//INFO_LOG(CONSOLE, "G2Accelerometer():%f %f %f %f\n", Neutral, OneG, G, Accelerometer);
// Boundaries
if (Return > 255) Return = 255;
@ -130,14 +130,14 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
if(VRecording.at(g_RecordingPlaying[Wm]).Recording.size() == 0)
{
g_RecordingPlaying[Wm] = -1;
Console::Print("Empty\n\n");
INFO_LOG(CONSOLE, "Empty\n\n");
return false;
}
// Return if the playback speed is unset
if(VRecording.at(g_RecordingPlaying[Wm]).PlaybackSpeed < 0)
{
Console::Print("PlaybackSpeed empty: %i\n\n", g_RecordingPlaying[Wm]);
INFO_LOG(CONSOLE, "PlaybackSpeed empty: %i\n\n", g_RecordingPlaying[Wm]);
g_RecordingPlaying[Wm] = -1;
return false;
}
@ -152,7 +152,7 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
)
)
{
Console::Print("Wrong IR mode: %i\n\n", g_RecordingPlaying[Wm]);
INFO_LOG(CONSOLE, "Wrong IR mode: %i\n\n", g_RecordingPlaying[Wm]);
g_RecordingPlaying[Wm] = -1;
return false;
}
@ -160,7 +160,7 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
// Get starting time
if(g_RecordingCounter[Wm] == 0)
{
Console::Print("\n\nBegin: %i\n", Wm);
INFO_LOG(CONSOLE, "\n\nBegin: %i\n", Wm);
g_RecordingStart[Wm] = GetDoubleTime();
}
@ -190,7 +190,7 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
g_RecordingPlaying[Wm] = -1;
g_RecordingStart[Wm] = 0;
g_RecordingCurrentTime[Wm] = 0;
Console::Print("End: %i\n\n", Wm);
INFO_LOG(CONSOLE, "End: %i\n\n", Wm);
return false;
}
@ -204,13 +204,13 @@ bool RecordingPlayAccIR(u8 &_x, u8 &_y, u8 &_z, IRReportType &_IR, int Wm)
if (g_DebugAccelerometer)
{
//Console::ClearScreen();
Console::Print("Current time: [%i / %i] %f %f\n",
INFO_LOG(CONSOLE, "Current time: [%i / %i] %f %f\n",
g_RecordingPoint[Wm], VRecording.at(g_RecordingPlaying[Wm]).Recording.size(),
VRecording.at(g_RecordingPlaying[Wm]).Recording.at(g_RecordingPoint[Wm]).Time, g_RecordingCurrentTime[Wm]
);
Console::Print("Accel x, y, z: %03u %03u %03u\n", _x, _y, _z);
INFO_LOG(CONSOLE, "Accel x, y, z: %03u %03u %03u\n", _x, _y, _z);
}
//Console::Print("Accel x, y, z: %03u %03u %03u\n", _x, _y, _z);
//INFO_LOG(CONSOLE, "Accel x, y, z: %03u %03u %03u\n", _x, _y, _z);
g_RecordingCounter[Wm]++;
@ -272,7 +272,7 @@ bool IsSwitchPressed(int _Key)
int RecordingCheckKeys(int WmNuIr)
{
#ifdef _WIN32
//Console::Print("RecordingCheckKeys: %i\n", Wiimote);
//INFO_LOG(CONSOLE, "RecordingCheckKeys: %i\n", Wiimote);
// Check if we have a HotKey match
bool Match = false;
@ -287,7 +287,7 @@ int RecordingCheckKeys(int WmNuIr)
|| VRecording.at(i).HotKeyIR == j && WmNuIr == 2 && IsNumericalKeyPressed(j))
&& (IsSwitchPressed(VRecording.at(i).HotKeySwitch) || VRecording.at(i).HotKeySwitch == 3))
{
//Console::Print("Match: %i %i\n", i, Key);
//INFO_LOG(CONSOLE, "Match: %i %i\n", i, Key);
Match = true;
Recording = i;
break;
@ -485,7 +485,7 @@ void SingleShake(u8 &_y, u8 &_z, int i)
Shake[i] = -1;
}
#endif
//if (Shake[i] > -1) Console::Print("Shake: %i\n", Shake[i]);
//if (Shake[i] > -1) INFO_LOG(CONSOLE, "Shake: %i\n", Shake[i]);
}
@ -609,7 +609,7 @@ void TiltWiimoteKeyboard(float &Roll, float &Pitch)
else
{
Pitch = KbDegree;
//Console::Print("Degree: %2.1f\n", KbDegree);
//INFO_LOG(CONSOLE, "Degree: %2.1f\n", KbDegree);
}
// --------------------
#endif
@ -642,9 +642,9 @@ void Tilt(u8 &_x, u8 &_y, u8 &_z)
if (g_DebugData)
{
//Console::ClearScreen();
/*Console::Print("L:%2.1f R:%2.1f Lx:%2.1f Range:%2.1f Degree:%2.1f L:%i R:%i\n",
/*INFO_LOG(CONSOLE, "L:%2.1f R:%2.1f Lx:%2.1f Range:%2.1f Degree:%2.1f L:%i R:%i\n",
Tl, Tr, Lx, Range, Degree, PadState[Page].Axis.Tl, PadState[Page].Axis.Tr);*/
/*Console::Print("Roll:%2.1f Pitch:%2.1f\n", Roll, Pitch);*/
/*INFO_LOG(CONSOLE, "Roll:%2.1f Pitch:%2.1f\n", Roll, Pitch);*/
}
}
@ -662,7 +662,7 @@ void FillReportAcc(wm_accel& _acc)
{
// If the recording reached the end or failed somehow we will not return
if (RecordingPlay(_acc.x, _acc.y, _acc.z, 0)) return;
//Console::Print("X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
//INFO_LOG(CONSOLE, "X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
}
// ---------------------
@ -767,13 +767,13 @@ void FillReportAcc(wm_accel& _acc)
//if(consoleDisplay == 0)
Console::Print("x: %03i | y: %03i | z: %03i | A:%i B:%i C:%i a:%i b:%i c:%i d:%i X:%i Y:%i Z:%i\n",
INFO_LOG(CONSOLE, "x: %03i | y: %03i | z: %03i | A:%i B:%i C:%i a:%i b:%i c:%i d:%i X:%i Y:%i Z:%i\n",
_acc.x, _acc.y, _acc.z,
A, B, C,
a, b, c, d,
X, Y, Z
);
Console::Print("x: %03i | y: %03i | z: %03i | X:%i Y:%i Z:%i | AX:%i AY:%i AZ:%i \n",
INFO_LOG(CONSOLE, "x: %03i | y: %03i | z: %03i | X:%i Y:%i Z:%i | AX:%i AY:%i AZ:%i \n",
_acc.x, _acc.y, _acc.z,
X, Y, Z,
AX, AY, AZ
@ -804,7 +804,7 @@ void FillReportIR(wm_ir_extended& _ir0, wm_ir_extended& _ir1)
}
else
{
//Console::Print("X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
//INFO_LOG(CONSOLE, "X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
if (RecordingPlayIR(_ir0)) return;
}
// ---------------------
@ -857,7 +857,7 @@ void FillReportIR(wm_ir_extended& _ir0, wm_ir_extended& _ir1)
//Console::ClearScreen();
//if(consoleDisplay == 1)
Console::Print("x0:%03i x1:%03i y0:%03i y1:%03i | T:%i L:%i R:%i B:%i S:%i\n",
INFO_LOG(CONSOLE, "x0:%03i x1:%03i y0:%03i y1:%03i | T:%i L:%i R:%i B:%i S:%i\n",
x0, x1, y0, y1, Top, Left, Right, Bottom, SensorBarRadius
);*/
// ------------------
@ -898,7 +898,7 @@ void FillReportIRBasic(wm_ir_basic& _ir0, wm_ir_basic& _ir1)
// We are playing back a recording, we don't accept any manual input this time
else
{
//Console::Print("X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
//INFO_LOG(CONSOLE, "X, Y, Z: %u %u %u\n", _acc.x, _acc.y, _acc.z);
if (RecordingPlayIR(_ir0)) return;
}
// ---------------------
@ -958,11 +958,11 @@ void FillReportIRBasic(wm_ir_basic& _ir0, wm_ir_basic& _ir1)
//ClearScreen();
//if(consoleDisplay == 1)
Console::Print("x1:%03i x2:%03i y1:%03i y2:%03i irx1:%02x y1:%02x x2:%02x y2:%02x | T:%i L:%i R:%i B:%i S:%i\n",
INFO_LOG(CONSOLE, "x1:%03i x2:%03i y1:%03i y2:%03i irx1:%02x y1:%02x x2:%02x y2:%02x | T:%i L:%i R:%i B:%i S:%i\n",
x1, x2, y1, y2, _ir0.x1, _ir0.y1, _ir1.x2, _ir1.y2, Top, Left, Right, Bottom, SensorBarRadius
);
Console::Print("\n");
Console::Print("ir0.x1:%02x x1h:%02x x2:%02x x2h:%02x | ir0.y1:%02x y1h:%02x y2:%02x y2h:%02x | ir1.x1:%02x x1h:%02x x2:%02x x2h:%02x | ir1.y1:%02x y1h:%02x y2:%02x y2h:%02x\n",
INFO_LOG(CONSOLE, "\n");
INFO_LOG(CONSOLE, "ir0.x1:%02x x1h:%02x x2:%02x x2h:%02x | ir0.y1:%02x y1h:%02x y2:%02x y2h:%02x | ir1.x1:%02x x1h:%02x x2:%02x x2h:%02x | ir1.y1:%02x y1h:%02x y2:%02x y2h:%02x\n",
_ir0.x1, _ir0.x1Hi, _ir0.x2, _ir0.x2Hi,
_ir0.y1, _ir0.y1Hi, _ir0.y2, _ir0.y2Hi,
_ir1.x1, _ir1.x1Hi, _ir1.x2, _ir1.x2Hi,