aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2010-10-18 20:19:58 +0000
committerEugene Sandulenko2010-10-18 20:19:58 +0000
commit7f7a6cdafd758287f6bbb767adb98a42edb2f4a2 (patch)
tree25b7e50f6ea4580a7c383ea8317ef329b3a2023b
parent56b1f8ddeef842edae08e48be2562b0f0a49b3db (diff)
downloadscummvm-rg350-7f7a6cdafd758287f6bbb767adb98a42edb2f4a2.tar.gz
scummvm-rg350-7f7a6cdafd758287f6bbb767adb98a42edb2f4a2.tar.bz2
scummvm-rg350-7f7a6cdafd758287f6bbb767adb98a42edb2f4a2.zip
Revert "GUI: Use vprintf in Console class. Patch by littleboy"
svn-id: r53585
-rw-r--r--gui/console.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/gui/console.cpp b/gui/console.cpp
index 2fede327f1..a53e97888b 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -660,7 +660,7 @@ void ConsoleDialog::updateScrollBuffer() {
}
int ConsoleDialog::printf(const char *format, ...) {
- va_list argptr;
+ va_list argptr;
va_start(argptr, format);
int count = this->vprintf(format, argptr);
@@ -669,10 +669,17 @@ int ConsoleDialog::printf(const char *format, ...) {
}
int ConsoleDialog::vprintf(const char *format, va_list argptr) {
- Common::String output = Common::String::vprintf(format, argptr);
+ char buf[2048];
- print(output.c_str());
- return output.size();
+#if defined(WIN32)
+ int count = _vsnprintf(buf, sizeof(buf), format, argptr);
+#elif defined(__SYMBIAN32__)
+ int count = vsprintf(buf, format, argptr);
+#else
+ int count = vsnprintf(buf, sizeof(buf), format, argptr);
+#endif
+ print(buf);
+ return count;
}
void ConsoleDialog::putchar(int c) {