Review fixes for the Ogre 14.6 port - #1
Merged
Conversation
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>
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to tomluchowski#15, based on
ff63881. This targetsogre-v14.6-v3directly 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::mActualPortwas never initialised. Not in the constructor's init list, only assigned insidecreateServer()— soODServer::getNetworkPort(), which now callsgetActualPort()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::mActiveCameraisnullptruntilsetActiveCamera()runs; the new condition called->getName()on it regardless.ReflMetal.materialwas deleted while three meshes still reference it —Roundshield.mesh,Sabre.mesh,Wyvern.mesh— andshaders/ReflMetal.{vert,frag}andmaterials/textures/EnvmapMetal.pngwere left orphaned. Restored the script; removing it properly means retargeting those meshes too, which is a separate decision.normal_map }closed thertshader_systemblock on the same line andpass lightinglost 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 astangent_space— matching the implicit default of the pre-conversionlighting_stage normal_map <tex>line.Debug leftovers
dumpWindowTree()walked the whole widget tree and wrote a line per widget tostd::cerr— not throughLogManager— every time the settings window opened.MenuModeMain::activate()logged root window geometry on every entry to the main menu.Mechanical cleanup
<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.cppare now byte-identical to before the PR).buildTangentVectorsIfNeeded()calls; took theMeshPtrby const reference instead of copying the shared pointer, and added a null guard since several call sites feedgetByName()straight in..get()calls and the three#if OGRE_VERSION < 0x10A00 / #elseblocks whose branches had become identical — matching howMovableTextOverlay.cpphandled the same situation in Ogre v14.6 v3 tomluchowski/OpenDungeonsPlus#15.set(CMAKE_CXX_STANDARD 14)was competing with theOD_CXX11_FLAGSprobe still prepending-std=c++11toCMAKE_CXX_FLAGS. Removed the probe and addedCMAKE_CXX_STANDARD_REQUIRED ON.CMAKE_CXX_EXTENSIONSdefaults toON, 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@..glslfiles.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_hideflip, theSettingsWindowscaling 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