Skip to content

Commit

Permalink
Allow OpenGL only if -gl key is specified
Browse files Browse the repository at this point in the history
xrEngine/pure.h: made message const
xrGame/console_commands.cpp: fix to g_inv_highlight_equipped
  • Loading branch information
Xottab-DUTY committed May 26, 2018
1 parent 614c467 commit a745819
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/xrEngine/EngineAPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ void CEngineAPI::CreateRendererList()
hRenderR2 = XRay::LoadModule("xrRender_R2");
hRenderR3 = XRay::LoadModule("xrRender_R3");
hRenderR4 = XRay::LoadModule("xrRender_R4");
hRenderRGL = XRay::LoadModule("xrRender_GL");

const bool allowOGL = !!strstr(Core.Params, "-gl");
if (allowOGL)
hRenderRGL = XRay::LoadModule("xrRender_GL");

// Restore error handling
SetErrorMode(0);
Expand Down Expand Up @@ -263,7 +266,7 @@ void CEngineAPI::CreateRendererList()
hRenderR4->close();
}

if (hRenderRGL->exist())
if (allowOGL && hRenderRGL->exist())
{
if (GEnv.CheckRGL && GEnv.CheckRGL())
modes.emplace_back(xr_token("renderer_gl", 6));
Expand Down
2 changes: 1 addition & 1 deletion src/xrEngine/pure.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class MessageRegistry
messages[0].Object->OnPure();
else
{
for (auto& message : messages)
for (const auto& message : messages)
if (message.Prio != REG_PRIORITY_INVALID)
message.Object->OnPure();
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/console_commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1901,7 +1901,7 @@ void CCC_RegisterCommands()
CMD3(CCC_Mask, "g_autopickup", &psActorFlags, AF_AUTOPICKUP);
CMD3(CCC_Mask, "g_dynamic_music", &psActorFlags, AF_DYNAMIC_MUSIC);
CMD3(CCC_Mask, "g_important_save", &psActorFlags, AF_IMPORTANT_SAVE);
CMD3(CCC_Integer, "g_inv_highlight_equipped", &g_inv_highlight_equipped, 0, 1);
CMD4(CCC_Integer, "g_inv_highlight_equipped", &g_inv_highlight_equipped, 0, 1);

#ifdef DEBUG
CMD1(CCC_ShowSmartCastStats, "show_smart_cast_stats");
Expand Down

1 comment on commit a745819

@q4a
Copy link
Member

@q4a q4a commented on a745819 May 27, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is NOT good! Users should see OpenGL render test it and write bug reports!!!

Please sign in to comment.