rework log function and protocol

* remove some protocol ifdefs, replace with game features system
This commit is contained in:
Eduardo Bart
2012-05-28 19:04:44 -03:00
parent 4c80d783d6
commit c01b32b032
51 changed files with 391 additions and 280 deletions

View File

@@ -109,7 +109,7 @@ void crashHandler(int signum, siginfo_t* info, void* secret)
fout << ss.str();
fout << "\n";
fout.close();
logInfo("Crash report saved to file ", fileName.c_str());
logInfo("Crash report saved to file %s", fileName.c_str());
} else
logError("Failed to save crash report!");

View File

@@ -134,14 +134,15 @@ LONG CALLBACK ExceptionHandler(LPEXCEPTION_POINTERS e)
if(fout.is_open() && fout.good()) {
fout << ss.str();
fout.close();
logInfo("Crash report saved to file ", fileName);
logInfo("Crash report saved to file %s", fileName);
} else
logError("Failed to save crash report!");
// inform the user
std::string msg = stdext::format("The application has crashed.\n\n"
"A crash report has been written to:\n"
"%s", fileName.c_str());
std::string msg = stdext::format(
"The application has crashed.\n\n"
"A crash report has been written to:\n"
"%s", fileName.c_str());
MessageBox(NULL, msg.c_str(), "Application crashed", 0);
// this seems to silently close the application

View File

@@ -680,7 +680,7 @@ void WIN32Window::setMouseCursor(const std::string& file, const Point& hotSpot)
apng_data apng;
if(load_apng(fin, &apng) != 0) {
logTraceError("unable to load png file ", file);
logTraceError("unable to load png file %s", file);
return;
}

View File

@@ -416,7 +416,7 @@ void X11Window::internalCreateGLContext()
m_eglContext = eglCreateContext(m_eglDisplay, m_eglConfig, EGL_NO_CONTEXT, attrList);
if(m_eglContext == EGL_NO_CONTEXT )
logFatal("Unable to create EGL context: ", eglGetError());
logFatal("Unable to create EGL context: %s", eglGetError());
#else
m_glxContext = glXCreateContext(m_display, m_visual, NULL, True);
@@ -457,7 +457,7 @@ void X11Window::internalConnectGLContext()
#ifdef OPENGL_ES
m_eglSurface = eglCreateWindowSurface(m_eglDisplay, m_eglConfig, m_window, NULL);
if(m_eglSurface == EGL_NO_SURFACE)
logFatal("Unable to create EGL surface: ", eglGetError());
logFatal("Unable to create EGL surface: %s", eglGetError());
if(!eglMakeCurrent(m_eglDisplay, m_eglSurface, m_eglSurface, m_eglContext))
logFatal("Unable to connect EGL context into X11 window");
#else
@@ -841,7 +841,7 @@ void X11Window::setMouseCursor(const std::string& file, const Point& hotSpot)
apng_data apng;
if(load_apng(fin, &apng) != 0) {
logTraceError("unable to load png file ", file);
logTraceError("unable to load png file %s", file);
return;
}