mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
- fix w4 warnings
- add convenience macros for config_db(CFG_GET_SYS_VAL) - VFSUtil::EnumDirEnts now uses flags instead of bool recursive - UNUSED() for params, UNUSED2 (<- need better name) for variables - config.h defines must be tested with #if (always defined) -> allows detecting misspellings thanks to compiler warnings - replace debug_assert(0) with debug_warn (its sole purpose) - replace ScriptingHost::ValueToInt et al with ToPrimitive - use nommgr.h to disable both mmgr and VC debug heap This was SVN commit r2585.
This commit is contained in:
@@ -470,10 +470,11 @@ void CConsole::SetBuffer(const wchar_t* szMessage, ...)
|
||||
m_iBufferLength = m_iBufferPos = (int)wcslen(m_szBuffer);
|
||||
}
|
||||
|
||||
void CConsole::UseHistoryFile( CStr filename, unsigned int historysize )
|
||||
void CConsole::UseHistoryFile( CStr filename, int max_history_lines )
|
||||
{
|
||||
m_MaxHistoryLines = max_history_lines;
|
||||
|
||||
m_sHistoryFile = filename;
|
||||
m_iHistorySize = historysize;
|
||||
LoadHistory();
|
||||
}
|
||||
|
||||
@@ -592,10 +593,11 @@ void CConsole::SaveHistory()
|
||||
{
|
||||
CStr buffer;
|
||||
std::deque<std::wstring>::iterator it;
|
||||
unsigned int count = 0;
|
||||
int line_count = 0;
|
||||
for( it = m_deqBufHistory.begin(); it != m_deqBufHistory.end(); ++it )
|
||||
{
|
||||
if( count++ >= m_iHistorySize ) break;
|
||||
if(line_count++ >= m_MaxHistoryLines)
|
||||
break;
|
||||
buffer = CStrW( *it ).ToUTF8() + "\n" + buffer;
|
||||
}
|
||||
vfs_store( m_sHistoryFile, (void*)buffer.c_str(), buffer.Length(), FILE_NO_AIO );
|
||||
|
||||
Reference in New Issue
Block a user