Skip to content

Commit

Permalink
Fix build on Ubuntu 16.04 and macOS
Browse files Browse the repository at this point in the history
Apparently the C++ standard library is supposed to provide
specializations of std::hash for enums (even in C++11)
but those don't always work for whatever reason.
  • Loading branch information
sfan5 committed Jul 12, 2021
1 parent effb535 commit 5c89a0e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/client/renderingengine.cpp
Expand Up @@ -557,13 +557,13 @@ void RenderingEngine::draw_scene(video::SColor skycolor, bool show_hud,

const VideoDriverInfo &RenderingEngine::getVideoDriverInfo(irr::video::E_DRIVER_TYPE type)
{
static const std::unordered_map<irr::video::E_DRIVER_TYPE,VideoDriverInfo> driver_info_map = {
{irr::video::EDT_NULL, {"null", "NULL Driver"}},
{irr::video::EDT_OPENGL, {"opengl", "OpenGL"}},
{irr::video::EDT_OGLES1, {"ogles1", "OpenGL ES1"}},
{irr::video::EDT_OGLES2, {"ogles2", "OpenGL ES2"}},
static const std::unordered_map<int, VideoDriverInfo> driver_info_map = {
{(int)video::EDT_NULL, {"null", "NULL Driver"}},
{(int)video::EDT_OPENGL, {"opengl", "OpenGL"}},
{(int)video::EDT_OGLES1, {"ogles1", "OpenGL ES1"}},
{(int)video::EDT_OGLES2, {"ogles2", "OpenGL ES2"}},
};
return driver_info_map.at(type);
return driver_info_map.at((int)type);
}

#ifndef __ANDROID__
Expand Down

0 comments on commit 5c89a0e

Please sign in to comment.