1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-18 19:29:09 +00:00

Begin killing off sprintf

This commit is contained in:
2013-02-01 17:39:46 -05:00
parent 470ed86187
commit dd35878465
13 changed files with 57 additions and 100 deletions

View File

@ -554,9 +554,8 @@ void hsG3DDeviceSelector::RemoveUnusableDevModes(bool bTough)
}
else
{
char str[ 256 ];
sprintf( str, " Keeping mode (%dx%d) on device %s", modes[j].GetWidth(), modes[j].GetHeight(), fRecords[ i ].GetDriverDesc() );
plDemoDebugFile::Write( str );
plString log = plString::Format(" Keeping mode (%dx%d) on device %s", modes[j].GetWidth(), modes[j].GetHeight(), fRecords[ i ].GetDriverDesc());
plDemoDebugFile::Write( log.c_str() );
}
}
@ -605,10 +604,9 @@ void hsG3DDeviceSelector::RemoveUnusableDevModes(bool bTough)
// Remove Direct3D devices with less than 11 megs of RAM
else if (bTough && ( totalMem = IAdjustDirectXMemory( fRecords[i].GetMemoryBytes() ) ) < 11*1024*1024 )
{
char str[ 256 ];
sprintf( str, " Removing Direct3D device with < 11MB RAM. Device RAM (in kB): %d (Description: %s)",
totalMem / 1024, fRecords[ i ].GetDriverDesc() );
plDemoDebugFile::Write( str );
plString log = plString::Format(" Removing Direct3D device with < 11MB RAM. Device RAM (in kB): %d (Description: %s)",
totalMem / 1024, fRecords[ i ].GetDriverDesc() );
plDemoDebugFile::Write( log.c_str() );
fRecords[i].SetDiscarded(true);
}
else
@ -1958,7 +1956,7 @@ void plDemoDebugFile::IDDFClose( void )
//// Write ////////////////////////////////////////////////////////////////////
// Writes a string to the DDF. If the DDF isn't open, opens it.
void plDemoDebugFile::Write( char *string )
void plDemoDebugFile::Write( const char *string )
{
#if M3DDEMOINFO // Demo Debug Build
if( !fIsOpen )
@ -1969,7 +1967,7 @@ void plDemoDebugFile::Write( char *string )
#endif
}
void plDemoDebugFile::Write( char *string1, char *string2 )
void plDemoDebugFile::Write( const char *string1, const char *string2 )
{
#if M3DDEMOINFO // Demo Debug Build
if( !fIsOpen )
@ -1980,7 +1978,7 @@ void plDemoDebugFile::Write( char *string1, char *string2 )
#endif
}
void plDemoDebugFile::Write( char *string1, int32_t value )
void plDemoDebugFile::Write( const char *string1, int32_t value )
{
#if M3DDEMOINFO // Demo Debug Build
if( !fIsOpen )

View File

@ -456,13 +456,13 @@ class plDemoDebugFile
~plDemoDebugFile() { IDDFClose(); }
// Static function to write a string to the DDF
static void Write( char *string );
static void Write( const char *string );
// Static function to write two strings to the DDF
static void Write( char *string1, char *string2 );
static void Write( const char *string1, const char *string2 );
// Static function to write a string and a signed integer value to the DDF
static void Write( char *string1, int32_t value );
static void Write( const char *string1, int32_t value );
// Enables or disables the DDF class
static void Enable( bool yes ) { fEnabled = yes; }