MusicMod: Simplified the initial console log

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1792 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson
2009-01-05 07:02:24 +00:00
parent 6517f80316
commit b6f4c4e958
17 changed files with 314 additions and 450 deletions

View File

@ -10,20 +10,21 @@
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
/// Include and declarations, definitions
////////////////////////////////////////////////////////////////////////////////
#include "Config.h"
#include "Console.h"
#include <map>
using namespace std;
map<TCHAR *, ConfVar *> * conf_map = NULL;
TCHAR * szIniPath = NULL;
const TCHAR * SECTION = TEXT( "Plainamp" );
// ============================================================================
@ -33,10 +34,7 @@ const TCHAR * SECTION = TEXT( "Plainamp" );
ConfVar::ConfVar( TCHAR * szKey, ConfMode mode )
{
// MessageBox( 0, TEXT( "no const @ ConfVar" ), TEXT( "" ), 0 );
// ---------------------------------------------------------------------------------------
//wprintf("ConfVar::ConfVar(TCHAR) > Got <%s>\n", szKey);
// ---------------------------------------------------------------------------------------
// Init
const int iLen = ( int )_tcslen( szKey );
@ -61,9 +59,7 @@ ConfVar::ConfVar( TCHAR * szKey, ConfMode mode )
////////////////////////////////////////////////////////////////////////////////
ConfVar::ConfVar( const TCHAR * szKey, ConfMode mode )
{
// ---------------------------------------------------------------------------------------
//wprintf("ConfVar::ConfVar(const TCHAR) > Got <%s>\n", szKey);
// ---------------------------------------------------------------------------------------
// Init
m_szKey = ( TCHAR * )szKey;
@ -77,10 +73,7 @@ ConfVar::ConfVar( const TCHAR * szKey, ConfMode mode )
if( !conf_map ) conf_map = new map<TCHAR *, ConfVar *>;
conf_map->insert( pair<TCHAR *, ConfVar *>( m_szKey, this ) );
// ---------------------------------------------------------------------------------------
//wprintf("ConfVar::ConfVar(const TCHAR) > Insert <%s>\n", ConfVar::m_szKey);
// ---------------------------------------------------------------------------------------
}
@ -103,10 +96,7 @@ ConfVar::~ConfVar()
ConfBool::ConfBool( bool * pbData, TCHAR * szKey, ConfMode mode, bool bDefault ) : ConfVar( szKey, mode )
{
// MessageBox( 0, TEXT( "no const @ ConfBool" ), TEXT( "" ), 0 );
// ---------------------------------------------------------------------------------------
wprintf("ConfBool(TCHAR) > Get <%s>\n", szKey);
// ---------------------------------------------------------------------------------------
//wprintf("ConfBool(TCHAR) > Get <%s>\n", szKey);
m_pbData = pbData;
m_bDefault = bDefault;
@ -122,9 +112,7 @@ ConfBool::ConfBool( bool * pbData, TCHAR * szKey, ConfMode mode, bool bDefault )
////////////////////////////////////////////////////////////////////////////////
ConfBool::ConfBool( bool * pbData, const TCHAR * szKey, ConfMode mode, bool bDefault ) : ConfVar( szKey, mode )
{
// ---------------------------------------------------------------------------------------
wprintf("ConfBool(TCHAR) > Get <%s>\n", szKey);
// ---------------------------------------------------------------------------------------
//wprintf("ConfBool(TCHAR) > Get <%s>\n", szKey);
m_pbData = pbData;
m_bDefault = bDefault;
@ -139,7 +127,7 @@ ConfBool::ConfBool( bool * pbData, const TCHAR * szKey, ConfMode mode, bool bDef
////////////////////////////////////////////////////////////////////////////////
void ConfBool::Read()
{
wprintf("ConfBool::Read() > Begin <m_bRead:%i> and <szIniPath:%s>\n", m_bRead, szIniPath);
//wprintf("ConfBool::Read() > Begin <m_bRead:%i> and <szIniPath:%s>\n", m_bRead, szIniPath);
if( m_bRead || !szIniPath ) return;
@ -519,13 +507,13 @@ ConfString::ConfString( TCHAR * szData, const TCHAR * szKey, ConfMode mode, TCHA
////////////////////////////////////////////////////////////////////////////////
void ConfString::Read()
{
wprintf( "ConfString::Read() > Begin\n");
//wprintf( "ConfString::Read() > Begin\n");
if( m_bRead || !szIniPath ) return;
GetPrivateProfileString( SECTION, m_szKey, m_szDefault, m_szData, m_iMaxLen, szIniPath );
wprintf( "ConfString::Read() > GetPrivateProfileString <%s> <%s> <%s>\n", m_szKey, m_szData, szIniPath);
//wprintf( "ConfString::Read() > GetPrivateProfileString <%s> <%s> <%s>\n", m_szKey, m_szData, szIniPath);
m_bRead = true;
}
@ -550,7 +538,8 @@ void ConfString::Write()
////////////////////////////////////////////////////////////////////////////////
///
////////////////////////////////////////////////////////////////////////////////
ConfCurDir::ConfCurDir( TCHAR * szData, TCHAR * szKey ) : ConfString( szData, szKey, CONF_MODE_INTERNAL, TEXT( "C:\\" ), MAX_PATH )
ConfCurDir::ConfCurDir( TCHAR * szData, TCHAR * szKey ) : ConfString( szData, szKey,
CONF_MODE_INTERNAL, TEXT( "C:\\" ), MAX_PATH )
{
}
@ -560,31 +549,27 @@ ConfCurDir::ConfCurDir( TCHAR * szData, TCHAR * szKey ) : ConfString( szData, sz
////////////////////////////////////////////////////////////////////////////////
///
////////////////////////////////////////////////////////////////////////////////
ConfCurDir::ConfCurDir( TCHAR * szData, const TCHAR * szKey ) : ConfString( szData, szKey, CONF_MODE_INTERNAL, TEXT( "C:\\" ), MAX_PATH )
ConfCurDir::ConfCurDir( TCHAR * szData, const TCHAR * szKey ) : ConfString( szData, szKey,
CONF_MODE_INTERNAL, TEXT( "C:\\" ), MAX_PATH )
{
}
// =======================================================================================
// MAJOR FUNCTION: This changes the relative path for the whole application
// =======================================================================================
////////////////////////////////////////////////////////////////////////////////
///
/* IMPORTANT: This SetCurrentDirectory() has to be disabled or we change the relative paths
for the entire application */
////////////////////////////////////////////////////////////////////////////////
void ConfCurDir::Read()
{
ConfString::Read();
// MessageBox( 0, m_szData, TEXT( "CurDir" ), 0 );
// Apply
//SetCurrentDirectory( m_szData );
wprintf("ConfCurDir::Read > End <%s>\n", m_szData);
//wprintf("ConfCurDir::Read > End <%s>\n", m_szData);
}
// =======================================================================================
// =======================================================================================
// ==============================================================================
////////////////////////////////////////////////////////////////////////////////
@ -671,10 +656,12 @@ void Conf::Init()
map<TCHAR *, ConfVar *>::iterator iter = conf_map->begin();
// =======================================================================================
// *** Something changes the API relative paths here
// This will lead us to the Read() function earlier in this file. For example ConfBool::Read()
while( iter != conf_map->end() )
{
iter->second->Read(); // *** This changes the relative path
/* By default there was a SetCurrentDirectory() here that would affect the entire process,
exe and everything. It is disabled now. */
iter->second->Read();
iter++;
}
// =======================================================================================