Skip to content

Review fixes for the Ogre 14.6 port - #1

Merged
slapin merged 6 commits into
slapin:ogre-v14.6-v3from
Upabjojr:ogre-v14.6-v3-review-fixes
Aug 9, 2026
Merged

Review fixes for the Ogre 14.6 port#1
slapin merged 6 commits into
slapin:ogre-v14.6-v3from
Upabjojr:ogre-v14.6-v3-review-fixes

Conversation

@Upabjojr

Copy link
Copy Markdown

Follow-up to tomluchowski#15, based on ff63881. This targets ogre-v14.6-v3 directly so it stacks onto that PR rather than duplicating it — the review it addresses is here.

Three commits, roughly in order of how much they matter.

Correctness

  • ODSocketServer::mActualPort was never initialised. Not in the constructor's init list, only assigned inside createServer() — so ODServer::getNetworkPort(), which now calls getActualPort() unconditionally, read an indeterminate value and could return a garbage port instead of falling through to the configured one.
  • ODFrameListener::renderQueueStarted() dereferenced a pointer that starts null. CameraManager::mActiveCamera is nullptr until setActiveCamera() runs; the new condition called ->getName() on it regardless.
  • ReflMetal.material was deleted while three meshes still reference itRoundshield.mesh, Sabre.mesh, Wyvern.mesh — and shaders/ReflMetal.{vert,frag} and materials/textures/EnvmapMetal.png were left orphaned. Restored the script; removing it properly means retargeting those meshes too, which is a separate decision.
  • Seven converted normal-map materials had their braces reflowed so normal_map } closed the rtshader_system block on the same line and pass lighting lost its own closing line. Balanced, so it parses, but the nesting no longer reads correctly. Restored the structure the other ~50 materials use, and made the mapping space explicit as tangent_space — matching the implicit default of the pre-conversion lighting_stage normal_map <tex> line.

Debug leftovers

  • dumpWindowTree() walked the whole widget tree and wrote a line per widget to std::cerr — not through LogManager — every time the settings window opened.
  • MenuModeMain::activate() logged root window geometry on every entry to the main menu.

Mechanical cleanup

  • Moved the new <iostream>/<fstream> includes below each file's own header, and dropped the two that duplicated an include already a few lines further down (ODPacket.cpp, ConfigManager.cpp are now byte-identical to before the PR).
  • Restored indentation on the five statements that ended up in column 0 beside the new buildTangentVectorsIfNeeded() calls; took the MeshPtr by const reference instead of copying the shared pointer, and added a null guard since several call sites feed getByName() straight in.
  • Dropped the redundant .get() calls and the three #if OGRE_VERSION < 0x10A00 / #else blocks whose branches had become identical — matching how MovableTextOverlay.cpp handled the same situation in Ogre v14.6 v3 tomluchowski/OpenDungeonsPlus#15.
  • CMake: set(CMAKE_CXX_STANDARD 14) was competing with the OD_CXX11_FLAGS probe still prepending -std=c++11 to CMAKE_CXX_FLAGS. Removed the probe and added CMAKE_CXX_STANDARD_REQUIRED ON. CMAKE_CXX_EXTENSIONS defaults to ON, giving -std=gnu++14, which covers the MinGW case the old probe worked around.
  • resources.cfg.in: folded the duplicated [Graphics] section into one and dropped the six hardcoded @CMAKE_INSTALL_PREFIX@/share/OGRE/Media/RTShaderLib* paths, now redundant with @RTSHADER_DIR@.
  • Trailing newlines on the two new .glsl files.

Not touched

Left alone deliberately, and raised as questions on tomluchowski#15 instead: the ephemeral-port fallback's effect on LAN hosting, the x11_mouse_hide flip, the SettingsWindow scaling approach, the vendored RTShaderLib GLSL, and the 194 re-serialised meshes.

Verification

Not built or run. This machine has Ogre 1.12 and tomluchowski#15 needs 14.6 plus tomluchowski/cegui#1, so none of this is compile-verified — please build it before merging. The changes are deliberately narrow and local for that reason.

🤖 Generated with Claude Code

Upabjojr and others added 3 commits July 31, 2026 17:04
ODSocketServer::mActualPort was declared but never initialised, so
ODServer::getNetworkPort() read an indeterminate value whenever it ran
before createServer() and could hand out a garbage port.

ODFrameListener::renderQueueStarted() dereferenced
CameraManager::getActiveCamera() unconditionally, but that pointer starts
as nullptr and stays null until createCamera() runs.

ReflMetal.material was deleted while Roundshield.mesh, Sabre.mesh and
Wyvern.mesh still name the ReflMetal material, and shaders/ReflMetal.vert,
shaders/ReflMetal.frag and materials/textures/EnvmapMetal.png were all
left in the tree. Restore the script rather than leave those meshes
falling back to the default material.

Seven of the converted normal-map materials had their braces reflowed so
that "normal_map }" closed the rtshader_system block on the same line and
the pass lighting block lost its own closing brace line. It still parses,
but the nesting no longer reads correctly. Restore the structure the other
materials use and spell the mapping space explicitly as tangent_space,
matching the pre-conversion default.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
dumpWindowTree() walked the whole widget tree and wrote a line per widget
straight to std::cerr every time the settings window was opened, and
MenuModeMain::activate() logged the root window geometry on every entry to
the main menu. Both look like instrumentation kept from tracking down the
layout problems, not something to ship.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Move the newly added <iostream>/<fstream> includes below each file's own
header so the headers stay self-contained, and drop the two that merely
duplicated an include already present further down.

Restore the indentation on the five statements that ended up in column 0
next to the new buildTangentVectorsIfNeeded() calls, take the MeshPtr by
const reference instead of copying the shared pointer, and guard against a
null mesh. Drop the redundant .get() calls and the three
"#if OGRE_VERSION < 0x10A00 / #else" blocks whose branches are now
identical.

Let CMAKE_CXX_STANDARD drive the language standard on its own: the
-std=c++11 flag the OD_CXX11_FLAGS probe injected into CMAKE_CXX_FLAGS
contradicted the newly requested C++14, and nothing asked CMake to treat
the standard as required.

Fold the duplicated [Graphics] section in resources.cfg.in into one, and
drop the hardcoded share/OGRE/Media/RTShaderLib paths now that
@RTSHADER_DIR@ and @OGRE_MEDIA_DIR@ point at the same place.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Upabjojr and others added 3 commits July 31, 2026 17:21
Ogre ships CMake/Templates/resources.cfg.in with both Main and RTShaderLib
under [OgreInternal]; putting RTShaderLib under [Graphics] instead leaves
the RTSS shader library in a different group from the Main headers it
includes.

Verified against OGRECave/ogre master: OGREConfig.cmake does
set_and_check(OGRE_MEDIA_DIR ...), so @OGRE_MEDIA_DIR@ and @RTSHADER_DIR@
both expand for consumers using find_package(OGRE CONFIG) as we do. The
share/OGRE/Media/RTShaderLib/{GLSL,HLSL,HLSL_Cg,materials} paths dropped in
the previous commit no longer exist at all -- RTShaderLib is flat since the
1.x layout was collapsed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Built Ogre 14.6.0 and the CEGUI fork from source and ran the game; both of
these were wrong and the runtime proved it.

Restoring ReflMetal.material was a mistake. Its shaders do not compile
against Ogre 14 at all: ReflMetal.vert/.frag include FFPLib_Texturing.glsl,
which calls the ENABLE_LINEAR_COLOUR macro that only RTSLib_Colour.glsl
defines, and adding that include just exposes the next layer -- FFP_Transform
has a different signature and SGX_Light_Point_DiffuseSpecular no longer
exists. Meanwhile Roundshield.material and Wyvern.material exist in their own
right and Ogre logs nothing at all about the missing material. Deleting it
was correct; restoring it traded a silent fallback for two hard shader
compile errors. Reverted. (What remains is only the orphaned
shaders/ReflMetal.* and materials/textures/EnvmapMetal.png.)

The duplicated resources.cfg entries were load-bearing, not an accident. Our
hand-written shaders live in the Graphics group and #include
OgreUnifiedShader.h and the RTShaderLib sources; Ogre resolves those includes
within the same resource group, so Media/Main genuinely has to appear under
[Graphics] as well as [OgreInternal]. Removing it cost five shader programs.
RTShaderLib, in contrast, must appear ONLY under [Graphics] -- listing it in
both groups makes RTSSamplers.material parse twice and Ogre throws
"Sampler 'Ogre/ShadowSampler' already exists" during startup, which killed
the game before it reached the menu. Documented both constraints in the file
so the next person does not tidy them away again.

Dropping the six @CMAKE_INSTALL_PREFIX@/share/OGRE/Media/RTShaderLib* paths
still stands: they point into OUR install prefix, not Ogre's, and the
GLSL/HLSL/HLSL_Cg/materials subdirectories no longer exist now that
RTShaderLib is flat.

Verified: no new Ogre errors versus the PR head, and the seven T2*/T3*
material errors this branch fixes are real ScriptCompiler failures.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both sliders carried AutoRenderingSurface="True", which asks CEGUI to render
that widget subtree into its own RenderingSurface. The Ogre renderer in the
CEGUI fork never composites those nested surfaces, so the slider drew
nothing at all -- no track, no thumb -- while still reporting itself as
visible and correctly positioned. The label above it ("Music: 100%",
"Ambient Light: +184%") kept rendering, which is what makes it look like
only the thumb went missing.

The property is not part of the Ogre 14 port; it predates it and happened to
work with the CEGUI and Ogre the game used before. Nothing else in gui/ sets
it, so these two sliders were the only widgets affected -- which matches the
report that only OPTIONS -> AUDIO and OPTIONS -> GAMEPLAY are broken.

False is the CEGUI default, so the property is simply dropped rather than
set. Verified by screenshotting both tabs with the property on and off,
against Ogre 14.6.0 and the CEGUI fork built from source.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@slapin
slapin merged commit 7f8cd5e into slapin:ogre-v14.6-v3 Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants