From 9035fde10b013a3432c48c275144d2479403f8d1 Mon Sep 17 00:00:00 2001 From: hiker Date: Wed, 17 Sep 2014 16:08:41 +1000 Subject: [PATCH] Avoid crashes on server side by supplying (unnecessary) values like os_win=0 on linux etc. Added more opengl data to keep the server happier ... though not yet entirely happy ;) --- src/graphics/irr_driver.cpp | 21 +++++---------------- src/graphics/irr_driver.hpp | 3 ++- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 177f6d4ce..eed4bdfbb 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -657,23 +657,12 @@ void IrrDriver::initDevice() } // initDevice //----------------------------------------------------------------------------- -void IrrDriver::getOpenGLData(std::string *vendor ) +void IrrDriver::getOpenGLData(std::string *vendor, std::string *renderer, + std::string *version) { - *vendor = (char*)(glGetString(GL_VENDOR)); -#ifdef XX - m_gl_major_version = 2; - m_gl_minor_version = 1; - // Call to glGetIntegerv should not be made if --no-graphics is used - if(!ProfileWorld::isNoGraphics()) - { - glGetIntegerv(GL_MAJOR_VERSION, &m_gl_major_version); - glGetIntegerv(GL_MINOR_VERSION, &m_gl_minor_version); - Log::info("IrrDriver", "OpenGL version: %d.%d", m_gl_major_version, m_gl_minor_version); - Log::info("IrrDriver", "OpenGL vendor: %s", ); - Log::info("IrrDriver", "OpenGL renderer: %s", glGetString(GL_RENDERER)); - Log::info("IrrDriver", "OpenGL version string: %s", glGetString(GL_VERSION)); - -#endif + *vendor = (char*)glGetString(GL_VENDOR ); + *renderer = (char*)glGetString(GL_RENDERER); + *version = (char*)glGetString(GL_VERSION ); } // getOpenGLData //----------------------------------------------------------------------------- diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 14f9ba706..2b4f121fd 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -428,7 +428,8 @@ public: ~IrrDriver(); void initDevice(); void reset(); - void getOpenGLData(std::string *vendor); + void getOpenGLData(std::string *vendor, std::string *renderer, + std::string *version); void generateSkyboxCubemap(); void generateDiffuseCoefficients();