mirror of https://github.com/PCSX2/pcsx2.git
* Switch the Confirmation dialogs to use '.' separators instead of ':' separators. The dots don't get escaped in the ini file, so they're much easier on the eyes.
* Remove one more dependency on the old vssprintf code; hoping to remove it soon. Only thing left now is the r5900 disasm code (which is a monster). git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3388 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
d2d6fd2964
commit
9feca5f767
|
@ -108,6 +108,7 @@ struct ParsedAssignmentString
|
|||
|
||||
extern bool pxParseAssignmentString( const wxString& src, wxString& ldest, wxString& rdest );
|
||||
|
||||
extern int FastFormatString_AsciiRaw(wxCharBuffer& dest, const char* fmt, va_list argptr);
|
||||
extern wxString FastFormatString_Ascii(const char* fmt, va_list argptr);
|
||||
extern wxString FastFormatString_Unicode(const wxChar* fmt, va_list argptr);
|
||||
|
||||
|
|
|
@ -120,6 +120,34 @@ static void format_that_unicode_mess( SafeArray<wxChar>& buffer, const wxChar* f
|
|||
// though it'd be kinda nice if we did.
|
||||
}
|
||||
|
||||
// returns the length of the string (not including the 0)
|
||||
int FastFormatString_AsciiRaw(wxCharBuffer& dest, const char* fmt, va_list argptr)
|
||||
{
|
||||
if( ascii_buffer_is_deleted )
|
||||
{
|
||||
// This means that the program is shutting down and the C++ destructors are
|
||||
// running, randomly deallocating static variables from existence. We handle it
|
||||
// as gracefully as possible by allocating local vars to do our bidding (slow, but
|
||||
// ultimately necessary!)
|
||||
|
||||
SafeArray<char> localbuf( 4096, L"Temporary Ascii Formatting Buffer" );
|
||||
format_that_ascii_mess( localbuf, fmt, argptr );
|
||||
dest = localbuf.GetPtr();
|
||||
return strlen(dest);
|
||||
}
|
||||
else
|
||||
{
|
||||
// This is normal operation. The static buffers are available for use, and we use
|
||||
// them for sake of efficiency (fewer heap allocs, for sure!)
|
||||
|
||||
ScopedLock locker( ascii_buffer );
|
||||
format_that_ascii_mess( ascii_buffer.buffer, fmt, argptr );
|
||||
dest = ascii_buffer.buffer.GetPtr();
|
||||
return strlen(dest);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
wxString FastFormatString_Ascii(const char* fmt, va_list argptr)
|
||||
{
|
||||
if( ascii_buffer_is_deleted )
|
||||
|
|
|
@ -20,7 +20,8 @@ void AsciiFile::Printf( const char* fmt, ... )
|
|||
{
|
||||
va_list list;
|
||||
va_start( list, fmt );
|
||||
std::string writeme; vssprintf( writeme, fmt, list );
|
||||
//std::string writeme; vssprintf( writeme, fmt, list );
|
||||
wxCharBuffer result; int reslen = FastFormatString_AsciiRaw(result, fmt, list);
|
||||
va_end( list );
|
||||
Write( writeme.c_str(), writeme.length() );
|
||||
Write( result.data(), reslen );
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ static void CpuCheckSSE2()
|
|||
L"Your options will be limited and emulation will be *very* slow." )
|
||||
);
|
||||
|
||||
pxIssueConfirmation( exconf, MsgButtons().OK(), L"Error:Startup:NoSSE2" );
|
||||
pxIssueConfirmation( exconf, MsgButtons().OK(), L"Error.Startup.NoSSE2" );
|
||||
|
||||
// Auto-disable anything that needs SSE2:
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ static void CheckHacksOverrides()
|
|||
|
||||
// [TODO] : List command line option overrides in action?
|
||||
|
||||
pxIssueConfirmation( dialog, MsgButtons().OK(), L"Dialog:SysConfig:Overrides" );
|
||||
pxIssueConfirmation( dialog, MsgButtons().OK(), L"Dialog.SysConfig.Overrides" );
|
||||
}
|
||||
|
||||
static void CheckPluginsOverrides()
|
||||
|
@ -61,7 +61,7 @@ static void CheckPluginsOverrides()
|
|||
|
||||
// [TODO] : List command line option overrides in action?
|
||||
|
||||
pxIssueConfirmation( dialog, MsgButtons().OK(), L"Dialog:ComponentsConfig:Overrides" );
|
||||
pxIssueConfirmation( dialog, MsgButtons().OK(), L"Dialog.ComponentsConfig.Overrides" );
|
||||
}
|
||||
|
||||
Dialogs::SysConfigDialog::SysConfigDialog(wxWindow* parent)
|
||||
|
|
|
@ -75,7 +75,7 @@ bool IsoDropTarget::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen
|
|||
dialog += dialog.GetCharHeight();
|
||||
dialog += dialog.Heading(GetMsg_ConfirmSysReset());
|
||||
|
||||
confirmed = (pxIssueConfirmation( dialog, MsgButtons().Reset().Cancel(), L"DragDrop:BootELF" ) != wxID_CANCEL);
|
||||
confirmed = (pxIssueConfirmation( dialog, MsgButtons().Reset().Cancel(), L"DragDrop.BootELF" ) != wxID_CANCEL);
|
||||
}
|
||||
|
||||
if( confirmed )
|
||||
|
|
|
@ -141,7 +141,7 @@ wxWindowID SwapOrReset_Iso( wxWindow* owner, IScopedCoreThread& core_control, co
|
|||
dialog += dialog.GetCharHeight();
|
||||
dialog += dialog.Heading(_("Do you want to swap discs or boot the new image (via system reset)?"));
|
||||
|
||||
result = pxIssueConfirmation( dialog, MsgButtons().Reset().Cancel().Custom(_("Swap Disc")), L"DragDrop:BootSwapIso" );
|
||||
result = pxIssueConfirmation( dialog, MsgButtons().Reset().Cancel().Custom(_("Swap Disc")), L"DragDrop.BootSwapIso" );
|
||||
if( result == wxID_CANCEL )
|
||||
{
|
||||
core_control.AllowResume();
|
||||
|
@ -184,7 +184,7 @@ wxWindowID SwapOrReset_CdvdSrc( wxWindow* owner, CDVD_SourceType newsrc )
|
|||
_("Do you want to swap discs or boot the new image (system reset)?")
|
||||
);
|
||||
|
||||
result = pxIssueConfirmation( dialog, MsgButtons().Reset().Cancel().Custom(_("Swap Disc")), L"DragDrop:BootSwapIso" );
|
||||
result = pxIssueConfirmation( dialog, MsgButtons().Reset().Cancel().Custom(_("Swap Disc")), L"DragDrop.BootSwapIso" );
|
||||
|
||||
if( result == wxID_CANCEL )
|
||||
{
|
||||
|
@ -331,7 +331,7 @@ void MainEmuFrame::_DoBootCdvd()
|
|||
{
|
||||
wxDialogWithHelpers dialog( this, _("Confirm PS2 Reset") );
|
||||
dialog += dialog.Heading( GetMsg_ConfirmSysReset() );
|
||||
bool confirmed = (pxIssueConfirmation( dialog, MsgButtons().Yes().Cancel(), L"BootCdvd:ConfirmReset" ) != wxID_CANCEL);
|
||||
bool confirmed = (pxIssueConfirmation( dialog, MsgButtons().Yes().Cancel(), L"BootCdvd.ConfirmReset" ) != wxID_CANCEL);
|
||||
|
||||
if( !confirmed )
|
||||
{
|
||||
|
|
|
@ -238,7 +238,7 @@ void ApplyOverValidStateEvent::InvokeEvent()
|
|||
L"Are you sure you want to apply settings now?"
|
||||
) );
|
||||
|
||||
int result = pxIssueConfirmation( dialog, MsgButtons().OK().Cancel(), L"PluginSelector:ConfirmShutdown" );
|
||||
int result = pxIssueConfirmation( dialog, MsgButtons().OK().Cancel(), L"PluginSelector.ConfirmShutdown" );
|
||||
|
||||
if( result == wxID_CANCEL )
|
||||
throw Exception::CannotApplySettings( m_owner->GetApplicableConfigPanel() ).Quiet()
|
||||
|
|
Loading…
Reference in New Issue