Skip to content

Commit

Permalink
Fix build with old Irrlicht
Browse files Browse the repository at this point in the history
  • Loading branch information
grorp committed Feb 23, 2024
1 parent 4ba2582 commit 71c1fa9
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,17 @@ with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#include "IrrCompileConfig.h"
#include "version.h"
#include "config.h"
#include "porting.h"
#include "IrrCompileConfig.h"

#if IRRLICHT_VERSION_MT_REVISION < 15
#include "util/string.h"
#endif
#ifndef SERVER
#include "client/renderingengine.h"
#endif

#if USE_CMAKE_CONFIG_H
#include "cmake_config_githash.h"
#endif

extern "C" {
#if USE_LUAJIT
#include <luajit.h>
Expand All @@ -38,6 +36,10 @@ extern "C" {
#endif
}

#if USE_CMAKE_CONFIG_H
#include "cmake_config_githash.h"
#endif

#ifndef VERSION_GITHASH
#define VERSION_GITHASH VERSION_STRING
#endif
Expand Down Expand Up @@ -97,18 +99,18 @@ void write_version(std::ostream &os, bool use_rendering_engine)
default: return "Unknown";
}
}();
os << "Active Irrlicht device = " << device_name << std::endl;;
os << "Active Irrlicht device = " << device_name << std::endl;

auto drivertype = RenderingEngine::get_video_driver()->getDriverType();
auto info = RenderingEngine::getVideoDriverInfo(drivertype);
os << "Active video driver = " << info.name << std::endl;

os << "Active renderer = ";
#if IRRLICHT_VERSION_MT_REVISION >= 15
os << RenderingEngine::get_video_driver()->getName() << std::endl;
#else
auto tmp = wide_to_utf8(RenderingEngine::get_video_driver()->getName());
os << tmp << std::endl;
#endif
#if IRRLICHT_VERSION_MT_REVISION >= 15
os << RenderingEngine::get_video_driver()->getName() << std::endl;
#else
auto tmp = wide_to_utf8(RenderingEngine::get_video_driver()->getName());
os << tmp << std::endl;
#endif
#endif
}

0 comments on commit 71c1fa9

Please sign in to comment.