Skip to content

Commit a745819

Browse files
committed
Allow OpenGL only if -gl key is specified
xrEngine/pure.h: made message const xrGame/console_commands.cpp: fix to g_inv_highlight_equipped
1 parent 614c467 commit a745819

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/xrEngine/EngineAPI.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ void CEngineAPI::CreateRendererList()
229229
hRenderR2 = XRay::LoadModule("xrRender_R2");
230230
hRenderR3 = XRay::LoadModule("xrRender_R3");
231231
hRenderR4 = XRay::LoadModule("xrRender_R4");
232-
hRenderRGL = XRay::LoadModule("xrRender_GL");
232+
233+
const bool allowOGL = !!strstr(Core.Params, "-gl");
234+
if (allowOGL)
235+
hRenderRGL = XRay::LoadModule("xrRender_GL");
233236

234237
// Restore error handling
235238
SetErrorMode(0);
@@ -263,7 +266,7 @@ void CEngineAPI::CreateRendererList()
263266
hRenderR4->close();
264267
}
265268

266-
if (hRenderRGL->exist())
269+
if (allowOGL && hRenderRGL->exist())
267270
{
268271
if (GEnv.CheckRGL && GEnv.CheckRGL())
269272
modes.emplace_back(xr_token("renderer_gl", 6));

src/xrEngine/pure.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class MessageRegistry
104104
messages[0].Object->OnPure();
105105
else
106106
{
107-
for (auto& message : messages)
107+
for (const auto& message : messages)
108108
if (message.Prio != REG_PRIORITY_INVALID)
109109
message.Object->OnPure();
110110
}

src/xrGame/console_commands.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1901,7 +1901,7 @@ void CCC_RegisterCommands()
19011901
CMD3(CCC_Mask, "g_autopickup", &psActorFlags, AF_AUTOPICKUP);
19021902
CMD3(CCC_Mask, "g_dynamic_music", &psActorFlags, AF_DYNAMIC_MUSIC);
19031903
CMD3(CCC_Mask, "g_important_save", &psActorFlags, AF_IMPORTANT_SAVE);
1904-
CMD3(CCC_Integer, "g_inv_highlight_equipped", &g_inv_highlight_equipped, 0, 1);
1904+
CMD4(CCC_Integer, "g_inv_highlight_equipped", &g_inv_highlight_equipped, 0, 1);
19051905

19061906
#ifdef DEBUG
19071907
CMD1(CCC_ShowSmartCastStats, "show_smart_cast_stats");

0 commit comments

Comments
 (0)