some fixes

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1508 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
omegadox 2008-12-12 10:33:02 +00:00
parent bd1aa13182
commit 2c9f66e3b2
4 changed files with 60 additions and 15 deletions

View File

@ -46,7 +46,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="../../PluginSpecs" AdditionalIncludeDirectories="../../PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_SECURE_SCL=0;LOGGING" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_SECURE_SCL=0;LOGGING"
MinimalRebuild="true" MinimalRebuild="true"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
@ -117,7 +117,7 @@
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="0" Optimization="0"
AdditionalIncludeDirectories="../../PluginSpecs" AdditionalIncludeDirectories="../../PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_SECURE_SCL=0"
StringPooling="true" StringPooling="true"
MinimalRebuild="true" MinimalRebuild="true"
@ -192,7 +192,7 @@
Optimization="2" Optimization="2"
EnableIntrinsicFunctions="true" EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="2" FavorSizeOrSpeed="2"
AdditionalIncludeDirectories="../../PluginSpecs" AdditionalIncludeDirectories="../../PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_CRT_SECURE_NO_WARNINGS"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -340,7 +340,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="3" Optimization="3"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../../PluginSpecs" AdditionalIncludeDirectories="../../PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;LOGGING" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0;LOGGING"
RuntimeLibrary="0" RuntimeLibrary="0"
BufferSecurityCheck="false" BufferSecurityCheck="false"
@ -412,7 +412,7 @@
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
Optimization="3" Optimization="3"
FavorSizeOrSpeed="1" FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../../PluginSpecs" AdditionalIncludeDirectories="../../PluginSpecs;..\..\..\Externals\wxWidgets\Include;..\..\..\Externals\wxWidgets\Include\msvc"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0"
RuntimeLibrary="0" RuntimeLibrary="0"
FloatingPointModel="0" FloatingPointModel="0"

View File

@ -31,7 +31,6 @@ void RegisterPanicAlertHandler(PanicAlertHandler handler)
panic_handler = handler; panic_handler = handler;
} }
void PanicAlert(const char* format, ...) void PanicAlert(const char* format, ...)
{ {
va_list args; va_list args;
@ -49,7 +48,42 @@ void PanicAlert(const char* format, ...)
char buffer[2048]; char buffer[2048];
CharArrayFromFormatV(buffer, 2048, format, args); CharArrayFromFormatV(buffer, 2048, format, args);
LOG(MASTER_LOG, "PANIC: %s", buffer); LOG(MASTER_LOG, "PANIC: %s", buffer);
wxMessageBox(buffer, "PANIC!", wxICON_EXCLAMATION); #if defined(HAVE_WX) && HAVE_WX
wxMessageBox(wxString::FromAscii(buffer), wxT("PANIC!"), wxICON_EXCLAMATION);
#else
vprintf(format, args);
printf("\n");
#endif
}
va_end(args);
}
void SuccessAlert(const char* format, ...)
{
va_list args;
va_start(args, format);
if (panic_handler)
{
char buffer[2048];
CharArrayFromFormatV(buffer, 2048, format, args);
LOG(MASTER_LOG, "SUCCESS: %s", buffer);
panic_handler(buffer, false);
}
else
{
char buffer[2048];
CharArrayFromFormatV(buffer, 2048, format, args);
LOG(MASTER_LOG, "SUCCESS: %s", buffer);
#if defined(HAVE_WX) && HAVE_WX
wxMessageBox(wxString::FromAscii(buffer), wxT("SUCCESS!"), wxICON_EXCLAMATION);
#else
vprintf(format, args);
printf("\n");
#endif
} }
va_end(args); va_end(args);
@ -64,7 +98,12 @@ bool PanicYesNo(const char* format, ...)
char buffer[2048]; char buffer[2048];
CharArrayFromFormatV(buffer, 2048, format, args); CharArrayFromFormatV(buffer, 2048, format, args);
LOG(MASTER_LOG, "PANIC: %s", buffer); LOG(MASTER_LOG, "PANIC: %s", buffer);
retval = wxYES == wxMessageBox(buffer, "PANIC! Continue?", wxICON_QUESTION | wxYES_NO); #if defined(HAVE_WX) && HAVE_WX
retval = wxYES == wxMessageBox(wxString::FromAscii(buffer), wxT("PANIC! Continue?"), wxICON_QUESTION | wxYES_NO);
#else
vprintf(format, args);
printf("\n");
#endif
va_end(args); va_end(args);
return(retval); return(retval);
} }
@ -78,7 +117,12 @@ bool AskYesNo(const char* format, ...)
char buffer[2048]; char buffer[2048];
CharArrayFromFormatV(buffer, 2048, format, args); CharArrayFromFormatV(buffer, 2048, format, args);
LOG(MASTER_LOG, "ASK: %s", buffer); LOG(MASTER_LOG, "ASK: %s", buffer);
retval = wxYES == wxMessageBox(buffer, "Dolphin", wxICON_QUESTION | wxYES_NO); #if defined(HAVE_WX) && HAVE_WX
retval = wxYES == wxMessageBox(wxString::FromAscii(buffer), wxT("Dolphin"), wxICON_QUESTION | wxYES_NO);
#else
vprintf(format, args);
printf("\n");
#endif
va_end(args); va_end(args);
return(retval); return(retval);
} }

View File

@ -190,7 +190,8 @@ inline u64 swap64(u64 data) {return(((u64)swap32(data) << 32) | swap32(data >> 3
// Utility functions // Utility functions
void PanicAlert(const char* text, ...); void PanicAlert(const char* format, ...);
void SuccessAlert(const char* format, ...);
bool PanicYesNo(const char* text, ...); bool PanicYesNo(const char* text, ...);
bool AskYesNo(const char* text, ...); bool AskYesNo(const char* text, ...);

View File

@ -496,7 +496,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
break; break;
case OUTOFBLOCKS: case OUTOFBLOCKS:
blocksOpen.Printf(wxT(E_OUTOFBLOCKS), memoryCard[slot]->GetFreeBlocks()); blocksOpen.Printf(wxT(E_OUTOFBLOCKS), memoryCard[slot]->GetFreeBlocks());
wxMessageBox(blocksOpen, wxT("Error"), wxOK|wxICON_ERROR); PanicAlert(blocksOpen.c_str());
break; break;
case OUTOFDIRENTRIES: case OUTOFDIRENTRIES:
PanicAlert(E_OUTOFDIRENTRIES); PanicAlert(E_OUTOFDIRENTRIES);
@ -532,7 +532,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
break; break;
case OUTOFBLOCKS: case OUTOFBLOCKS:
blocksOpen.Printf(wxT(E_OUTOFBLOCKS), memoryCard[slot]->GetFreeBlocks()); blocksOpen.Printf(wxT(E_OUTOFBLOCKS), memoryCard[slot]->GetFreeBlocks());
PanicAlert(blocksOpen); PanicAlert(blocksOpen.c_str());
break; break;
case OUTOFDIRENTRIES: case OUTOFDIRENTRIES:
PanicAlert(E_OUTOFDIRENTRIES); PanicAlert(E_OUTOFDIRENTRIES);
@ -556,7 +556,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
// Fix checksums and save the changes // Fix checksums and save the changes
if (memoryCard[slot]->FixChecksums()) if (memoryCard[slot]->FixChecksums())
{ {
wxMessageBox(wxT("The checksum was successfully fixed"), wxT("Success"), wxOK); SuccessAlert("The checksum was successfully fixed");
if (!memoryCard[slot]->Save()) PanicAlert(E_SAVEFAILED); if (!memoryCard[slot]->Save()) PanicAlert(E_SAVEFAILED);
} }
else PanicAlert(E_NOMEMCARD); else PanicAlert(E_NOMEMCARD);
@ -613,7 +613,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
break; break;
case OUTOFBLOCKS: case OUTOFBLOCKS:
blocksOpen.Printf(wxT(E_OUTOFBLOCKS), memoryCard[slot]->GetFreeBlocks()); blocksOpen.Printf(wxT(E_OUTOFBLOCKS), memoryCard[slot]->GetFreeBlocks());
PanicAlert(blocksOpen); PanicAlert(blocksOpen.c_str());
break; break;
case OUTOFDIRENTRIES: case OUTOFDIRENTRIES:
PanicAlert(E_OUTOFDIRENTRIES); PanicAlert(E_OUTOFDIRENTRIES);
@ -631,7 +631,7 @@ void CMemcardManager::CopyDeleteClick(wxCommandEvent& event)
PanicAlert(E_SAVEFAILED); PanicAlert(E_SAVEFAILED);
break; break;
case GCS: case GCS:
wxMessageBox(wxT("File converted to .gci"), wxT("Success"), wxOK); SuccessAlert("File converted to .gci");
break; break;
case SUCCESS: case SUCCESS:
memoryCard[slot]->FixChecksums(); memoryCard[slot]->FixChecksums();