Page MenuHomeWildfire Games

Split the rendering WaterManager in a graphics/ and a renderer/ part.
Needs ReviewPublic

Authored by wraitii on Feb 10 2021, 5:41 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Trac Tickets
#2692
Summary

This splits the WaterManager class, used for water rendering, in a graphics/ component that holds the water settings, renderer/WaterRData and the renderer itself.
CWater is now held by the World, since that seems to make sense.

The goal is to make the rendering-bits (i.e. OpenGL) more independent from graphics stuff, and thus easier to change.

Refs #2692 for the in-game actor editor.

Test Plan

Compile, agree.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
Stan added inline comments.May 1 2021, 5:11 PM
source/graphics/WaterManager.cpp
70 ↗(On Diff #17321)

SAFE ARRAY DELETE ?

113 ↗(On Diff #17321)

UNUSED?

197 ↗(On Diff #17321)

we → We

source/graphics/WaterManager.h
21–22 ↗(On Diff #17321)

Forward declare CVector3D?

81 ↗(On Diff #17321)

could be std::vector / std::array?

source/renderer/WaterRendering.h
37 ↗(On Diff #17321)

Missing <vector>

I don't see a point in the separation as a Manager. Your implementation contains data needed only for rendering (it doesn't manage something and doing such calculations on CPU in case someone wants changeable terrain is very expensive in comparison to GPU) and a small state that might be stored in CmpWaterManager. I'd suggest to use CmpWaterManager (I'm not even sure that we need the Manager suffix for Cmp as well) for the core state, Water (without Manager) for visual properties and WaterRenderer for rendering (like for Terrain).

source/renderer/WaterRendering.h
1 ↗(On Diff #17321)

We use *Renderer names, not *Rendering.

18–20 ↗(On Diff #17321)

Useless comment here, should be in the description.

wraitii updated this revision to Diff 19559.Jan 29 2022, 8:08 PM

Rewrite.

This splits into CWater, which holds the water settings & water height for graphics, WaterRData, which holds the persistent water data for rendering (such as wind strength), and WaterManager only holds the rendering stuff.

I think there is still some cleanup to be had with the SceneRenderer / World / Graphics logic, but this seems neater overall.

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/7291/display/redirect

wraitii edited the summary of this revision. (Show Details)Jan 29 2022, 8:09 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/5592/display/redirect

Stan added inline comments.Jan 29 2022, 10:45 PM
source/graphics/GameView.cpp
252

Maybe Could Be GetHeight since the previous call is water

source/graphics/Water.h
67

Not initialized?

76

Should it be CStrW?

source/ps/World.cpp
55

Could they be unique_ptr?

source/renderer/ModelRenderer.cpp
715

Any reason this isn't calling timer_time() directly?

source/renderer/SceneRenderer.cpp
808

Debug?

source/renderer/TerrainRenderer.cpp
575

Since those are not moddable, might be better to make it an enum class or maybe intern those strings

source/renderer/WaterManager.cpp
180

Anyreason those are arrays and not std::vector / std::array?

source/simulation2/components/CCmpWaterManager.cpp
102–103

Could early return earlier?

What's about WaterRenderer?

source/graphics/GameView.cpp
224–225

I believe it should be in RegMemFun, because it loads a bunch of textures inside.

252

Also const while at it.

source/graphics/Water.h
26

Swap with the empty line above.

48

Is the comment needed? CWater doesn't own the terrain, so it's not responsible for its dirtiness.

64

Why it's protected?

source/renderer/SceneRenderer.cpp
482

const.

source/renderer/TerrainRenderer.cpp
447

It's not good to reload textures in the middle of rendering, you might put it somewhere before LOS/Minimap textures drawing.

source/renderer/WaterManager.cpp
350

a isn't a standard name for loops.

source/renderer/WaterRData.cpp
28

Include order.

325

const.

source/simulation2/components/CCmpWaterManager.cpp
109–117

Do we need x and z? If yes in the future then it should be in CWater as well.

source/simulation2/system/SimContext.h
47–48

Calls above duplicate this method.

What's about WaterRenderer?

I intended to do the renaming in a separate diff, but TBH this maybe doesn't make the diff that much smaller.

source/graphics/Water.h
48

As of this diff, the terrain is actually responsible for the water data because it's in PatchRData, so we need to mark the terrain dirty when changing the water height.

In that light, the comment might have some use, but maybe I can make that more explicit.

I'm planning to look into remedying that situation as well.

64

I tend to just use protected over private as default. Makes no difference in this particular instance.

source/ps/World.cpp
55

They should actually, but I think I'll leave that cleanup for another diff.

source/renderer/ModelRenderer.cpp
715

Yes, the game can be paused.

source/renderer/WaterManager.cpp
180

Legacy code. Think I'll also leave that update for another diff.

source/simulation2/system/SimContext.h
47–48

Am aware, but again wanted to leave that cleanup for a separate diff.

wraitii updated this revision to Diff 19567.Jan 30 2022, 9:09 AM
wraitii marked 21 inline comments as done.

Address comments, rename WaterManager to WaterRenderer

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libnetwork_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgraphics_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libatlas_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgui_dbg.a(precompiled.o) has no symbols
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Cocoa.framework/Cocoa.tbd and library file /System/Library/Frameworks//Cocoa.framework/Cocoa are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//IOKit.framework/IOKit.tbd and library file /System/Library/Frameworks//IOKit.framework/IOKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//QuartzCore.framework/QuartzCore.tbd and library file /System/Library/Frameworks//QuartzCore.framework/QuartzCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Metal.framework/Metal.tbd and library file /System/Library/Frameworks//Metal.framework/Metal are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//OpenAL.framework/OpenAL.tbd and library file /System/Library/Frameworks//OpenAL.framework/OpenAL are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ApplicationServices.framework/ApplicationServices.tbd and library file /System/Library/Frameworks//ApplicationServices.framework/ApplicationServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Cocoa.framework/Cocoa.tbd and library file /System/Library/Frameworks//Cocoa.framework/Cocoa are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit.tbd and library file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreData.framework/Versions/A/CoreData.tbd and library file /System/Library/Frameworks//CoreData.framework/Versions/A/CoreData are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics.tbd and library file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText.tbd and library file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO.tbd and library file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ColorSync.framework/Versions/A/ColorSync.tbd and library file /System/Library/Frameworks//ColorSync.framework/Versions/A/ColorSync are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices.tbd and library file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreImage.framework/Versions/A/CoreImage.tbd and library file /System/Library/Frameworks//CoreImage.framework/Versions/A/CoreImage are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation.tbd and library file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Versions/C/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Versions/C/Foundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork.tbd and library file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList are out of sync. Falling back to library file for linking.
ld: warning: object file (../../../libraries/osx/fmt/lib/libfmt.a(format.cc.o)) was built for newer OSX version (10.13) than being linked (10.12)
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_LOSTexture.h:31:16: error: no matching constructor for initialization of 'CSimulation2'
                CSimulation2 sim(NULL, g_ScriptContext, NULL);
                             ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:50:2: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
        CSimulation2(std::shared_ptr<ScriptContext> cx, CWorld* world);
        ^
../../../source/simulation2/Simulation2.h:47:14: note: candidate constructor not viable: requires 1 argument, but 3 were provided
        NONCOPYABLE(CSimulation2);
                    ^
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_LOSTexture.h:70:16: error: no matching constructor for initialization of 'CSimulation2'
                CSimulation2 sim(NULL, g_ScriptContext, NULL);
                             ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:50:2: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
        CSimulation2(std::shared_ptr<ScriptContext> cx, CWorld* world);
        ^
../../../source/simulation2/Simulation2.h:47:14: note: candidate constructor not viable: requires 1 argument, but 3 were provided
        NONCOPYABLE(CSimulation2);
                    ^
2 errors generated.
make[1]: *** [obj/test_Debug/test_LOSTexture.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [test] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/5600/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Debug:
    23>e:\jenkins\workspace\vs2015-differential\source\graphics\tests\test_lostexture.h(31): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\graphics\tests\test_LOSTexture.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\graphics\tests\test_lostexture.h(70): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\graphics\tests\test_LOSTexture.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(140): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(199): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(254): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(311): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_position.h(142): error C2065: 'IID_WaterRenderer': undeclared identifier (compiling source file ..\..\..\source\simulation2\components\tests\test_Position.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_cmptemplatemanager.h(243): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_CmpTemplateManager.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(60): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(80): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(136): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_serializer.h(890): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Serializer.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/6693/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-gcc7.txt
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h: In member function 'void TestLOSTexture::test_basic()':
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:31:47: error: no matching function for call to 'CSimulation2::CSimulation2(NULL, std::shared_ptr<ScriptContext>&, NULL)'
   CSimulation2 sim(NULL, g_ScriptContext, NULL);
                                               ^
In file included from /zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:23,
                 from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
../../../source/simulation2/Simulation2.h:50:2: note: candidate: 'CSimulation2::CSimulation2(std::shared_ptr<ScriptContext>, CWorld*)'
  CSimulation2(std::shared_ptr<ScriptContext> cx, CWorld* world);
  ^~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:50:2: note:   candidate expects 2 arguments, 3 provided
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h: In member function 'void TestLOSTexture::test_perf_DISABLED()':
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:70:47: error: no matching function for call to 'CSimulation2::CSimulation2(NULL, std::shared_ptr<ScriptContext>&, NULL)'
   CSimulation2 sim(NULL, g_ScriptContext, NULL);
                                               ^
In file included from /zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:23,
                 from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
../../../source/simulation2/Simulation2.h:50:2: note: candidate: 'CSimulation2::CSimulation2(std::shared_ptr<ScriptContext>, CWorld*)'
  CSimulation2(std::shared_ptr<ScriptContext> cx, CWorld* world);
  ^~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:50:2: note:   candidate expects 2 arguments, 3 provided
make[1]: *** [test.make:432: obj/test_Debug/test_LOSTexture.o] Error 1
make: *** [Makefile:205: test] Error 2

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/7299/display/redirect

source/graphics/Water.h
64

It doesn't seem reasonable, protected means you plan to add inheritance.

source/renderer/WaterRData.cpp
638

const.

source/renderer/WaterRenderer.h
61

Technically speaking textures can not be resized. And textures inside ResizeRenderingTextures a bit different from textures created in CreateRenderingTextures. Maybe something like RecreateScreenSizeRenderingTextures()?

wraitii added inline comments.Jan 30 2022, 10:53 AM
source/renderer/TerrainRenderer.cpp
575

Will do in cleanup diff I think

source/renderer/WaterRenderer.h
61

True, to be honest I think I might want to change the code to resize the reflection/refraction textures (if you switch from/top fullscreen, the quality can noticeably decrease).

source/simulation2/components/CCmpWaterManager.cpp
102–103

meh

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
In file included from ../../../source/pch/network/precompiled.h:26:
In file included from ../../../source/network/NetMessage.h:26:
In file included from ../../../source/network/NetMessages.h:27:
../../../source/scriptinterface/ScriptTypes.h:62:10: fatal error: 'jspubtd.h' file not found
#include "jspubtd.h"
         ^~~~~~~~~~~
1 error generated.
make[1]: *** [obj/network_Debug/precompiled.h.gch] Error 1
make: *** [network] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/6423/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

Debug:
    23>e:\jenkins\workspace\vs2015-differential\source\graphics\tests\test_lostexture.h(31): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\graphics\tests\test_LOSTexture.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\graphics\tests\test_lostexture.h(70): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\graphics\tests\test_LOSTexture.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(140): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(199): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(254): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(311): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_position.h(142): error C2065: 'IID_WaterRenderer': undeclared identifier (compiling source file ..\..\..\source\simulation2\components\tests\test_Position.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_cmptemplatemanager.h(243): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_CmpTemplateManager.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(60): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(80): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(136): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_serializer.h(890): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Serializer.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/7515/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-clang7.txt
In file included from ../../../source/pch/test/precompiled.h:22:
../../../source/simulation2/system/ComponentTest.h:245:15: warning: 'ReloadTerrain' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
        virtual void ReloadTerrain()
                     ^
../../../source/simulation2/components/ICmpTerrain.h:67:15: note: overridden virtual function is here
        virtual void ReloadTerrain() = 0;
                     ^
1 warning generated.
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
/zpool0/clang7/source/graphics/tests/test_LOSTexture.h:31:16: error: no matching constructor for initialization of 'CSimulation2'
                CSimulation2 sim(NULL, g_ScriptContext, NULL);
                             ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:50:2: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
        CSimulation2(std::shared_ptr<ScriptContext> cx, CWorld* world);
        ^
../../../source/simulation2/Simulation2.h:47:14: note: candidate constructor not viable: requires 1 argument, but 3 were provided
        NONCOPYABLE(CSimulation2);
                    ^
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
/zpool0/clang7/source/graphics/tests/test_LOSTexture.h:70:16: error: no matching constructor for initialization of 'CSimulation2'
                CSimulation2 sim(NULL, g_ScriptContext, NULL);
                             ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:50:2: note: candidate constructor not viable: requires 2 arguments, but 3 were provided
        CSimulation2(std::shared_ptr<ScriptContext> cx, CWorld* world);
        ^
../../../source/simulation2/Simulation2.h:47:14: note: candidate constructor not viable: requires 1 argument, but 3 were provided
        NONCOPYABLE(CSimulation2);
                    ^
2 errors generated.
make[1]: *** [test.make:432: obj/test_Debug/test_LOSTexture.o] Error 1
make: *** [Makefile:205: test] Error 2
builderr-debug-gcc7.txt
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:0:
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h: In member function 'void TestLOSTexture::test_basic()':
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:31:47: error: no matching function for call to 'CSimulation2::CSimulation2(NULL, std::shared_ptr<ScriptContext>&, NULL)'
   CSimulation2 sim(NULL, g_ScriptContext, NULL);
                                               ^
In file included from /zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:23:0,
                 from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
../../../source/simulation2/Simulation2.h:50:2: note: candidate: CSimulation2::CSimulation2(std::shared_ptr<ScriptContext>, CWorld*)
  CSimulation2(std::shared_ptr<ScriptContext> cx, CWorld* world);
  ^~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:50:2: note:   candidate expects 2 arguments, 3 provided
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:0:
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h: In member function 'void TestLOSTexture::test_perf_DISABLED()':
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:70:47: error: no matching function for call to 'CSimulation2::CSimulation2(NULL, std::shared_ptr<ScriptContext>&, NULL)'
   CSimulation2 sim(NULL, g_ScriptContext, NULL);
                                               ^
In file included from /zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:23:0,
                 from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
../../../source/simulation2/Simulation2.h:50:2: note: candidate: CSimulation2::CSimulation2(std::shared_ptr<ScriptContext>, CWorld*)
  CSimulation2(std::shared_ptr<ScriptContext> cx, CWorld* world);
  ^~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:50:2: note:   candidate expects 2 arguments, 3 provided
make[1]: *** [test.make:432: obj/test_Debug/test_LOSTexture.o] Error 1
make: *** [Makefile:205: test] Error 2

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/8120/display/redirect

phosit added a subscriber: phosit.Oct 16 2022, 4:56 PM
phosit added inline comments.
source/graphics/Camera.cpp
32

Not required anymore

source/graphics/CameraController.cpp
41

Not required anymore

source/ps/World.h
97

return by reference

source/simulation2/Simulation2.cpp
640

Should be passed by reference. nullptr would lead to UB.

source/simulation2/components/CCmpTerrain.cpp
122

why did you change from override to virtual?
same for other functions

wraitii added inline comments.Oct 16 2022, 5:05 PM
source/simulation2/Simulation2.cpp
640

Mh, conceptually I'd rather not, because the simulation should be able to exist without the world. What UB are you referring to ?

source/simulation2/components/CCmpTerrain.cpp
122

Think that's just rebase trouble

phosit added inline comments.Oct 16 2022, 5:09 PM
source/simulation2/Simulation2.cpp
640

The constructor of CSimulation2Impl calls -> on it.

vladislavbelov added inline comments.Oct 17 2022, 1:06 AM
source/graphics/GameView.cpp
223

RegMemFun.

source/graphics/MapReader.cpp
726–731

Looks like a duplication, are there guarantees that the heights will always match?

source/ps/World.h
61

Might be std::unique_ptr without waiting of the overall refactoring.

source/renderer/WaterRenderer.h
82

The name mismatches the CWater and ICmpWaterManager method names, neither of them use that name.

source/simulation2/components/tests/test_Position.h
142

Should be IID_Water.

source/simulation2/system/ComponentTest.h
245

override instead of virtual.

source/tools/atlas/GameInterface/ActorViewer.cpp
125

Should be terrain if it's local.

275

terrain.

459–467

The commented code should be removed.

In many files #include "renderer/WaterRenderer.h" is not required.

wraitii updated this revision to Diff 21902.Jun 10 2023, 6:06 PM
wraitii marked 14 inline comments as done.

Rewrite the diff again as rebase.

This time, I only split a few parameters in CWater. The rest stays mostly as-is.
However, to keep things neat:

  • CWorld becomes the owner of CWater. This is used to access water data in a number of places instead of WaterManager.
  • Scene can return a reference to the world, and use that to remove some further references
  • Pass CWater as argument to functions in WaterManager, meaning we don't need to hold references to anything there.
  • A number of other changes are required as side-effects or can be implemented as cleanups.

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-macos.txt
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libnetwork_dbg.a(precompiled.o) has no symbols
../../../source/simulation2/components/CCmpWaterManager.cpp:32:43: warning: unused parameter 'componentManager' [-Wunused-parameter]
        static void ClassInit(CComponentManager& componentManager)
                                                 ^
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libsimulation2_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libengine_dbg.a(precompiled.o) has no symbols
../../../source/renderer/PatchRData.cpp:1411:10: warning: unused variable 'mapSize' [-Wunused-variable]
        ssize_t mapSize = terrain->GetVerticesPerSide();
                ^
1 warning generated.
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgraphics_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libatlas_dbg.a(precompiled.o) has no symbols
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib: file: ../../../binaries/system/libgui_dbg.a(precompiled.o) has no symbols
ld: warning: text-based stub file /System/Library/Frameworks//CoreAudio.framework/CoreAudio.tbd and library file /System/Library/Frameworks//CoreAudio.framework/CoreAudio are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox.tbd and library file /System/Library/Frameworks//AudioToolbox.framework/AudioToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback.tbd and library file /System/Library/Frameworks//ForceFeedback.framework/ForceFeedback are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreVideo.framework/CoreVideo.tbd and library file /System/Library/Frameworks//CoreVideo.framework/CoreVideo are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Cocoa.framework/Cocoa.tbd and library file /System/Library/Frameworks//Cocoa.framework/Cocoa are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//IOKit.framework/IOKit.tbd and library file /System/Library/Frameworks//IOKit.framework/IOKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//QuartzCore.framework/QuartzCore.tbd and library file /System/Library/Frameworks//QuartzCore.framework/QuartzCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Metal.framework/Metal.tbd and library file /System/Library/Frameworks//Metal.framework/Metal are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Security.framework/Security.tbd and library file /System/Library/Frameworks//Security.framework/Security are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//OpenAL.framework/OpenAL.tbd and library file /System/Library/Frameworks//OpenAL.framework/OpenAL are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ApplicationServices.framework/ApplicationServices.tbd and library file /System/Library/Frameworks//ApplicationServices.framework/ApplicationServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Cocoa.framework/Cocoa.tbd and library file /System/Library/Frameworks//Cocoa.framework/Cocoa are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit.tbd and library file /System/Library/Frameworks//AppKit.framework/Versions/C/AppKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreData.framework/Versions/A/CoreData.tbd and library file /System/Library/Frameworks//CoreData.framework/Versions/A/CoreData are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition.tbd and library file /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreImage.framework/Versions/A/CoreImage.tbd and library file /System/Library/Frameworks//CoreImage.framework/Versions/A/CoreImage are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics.tbd and library file /System/Library/Frameworks//CoreGraphics.framework/Versions/A/CoreGraphics are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText.tbd and library file /System/Library/Frameworks//CoreText.framework/Versions/A/CoreText are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO.tbd and library file /System/Library/Frameworks//ImageIO.framework/Versions/A/ImageIO are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//ColorSync.framework/Versions/A/ColorSync.tbd and library file /System/Library/Frameworks//ColorSync.framework/Versions/A/ColorSync are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices.tbd and library file /System/Library/Frameworks//CoreServices.framework/Versions/A/CoreServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis.tbd and library file /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation.tbd and library file /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//Foundation.framework/Versions/C/Foundation.tbd and library file /System/Library/Frameworks//Foundation.framework/Versions/C/Foundation are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork.tbd and library file /System/Library/Frameworks//CFNetwork.framework/Versions/A/CFNetwork are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList.tbd and library file /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList are out of sync. Falling back to library file for linking.
ld: warning: text-based stub file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd and library file /System/Library/Frameworks//CoreFoundation.framework/CoreFoundation are out of sync. Falling back to library file for linking.
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_LOSTexture.h:31:16: error: no matching constructor for initialization of 'CSimulation2'
                CSimulation2 sim(NULL, g_ScriptContext, NULL);
                             ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:54:2: note: candidate constructor not viable: requires 4 arguments, but 3 were provided
        CSimulation2(CUnitManager* unitManager, std::shared_ptr<ScriptContext> cx, CTerrain* terrain, CWater* water);
        ^
../../../source/simulation2/Simulation2.h:49:14: note: candidate constructor not viable: requires 1 argument, but 3 were provided
        NONCOPYABLE(CSimulation2);
                    ^
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
/Users/wfg/Jenkins/workspace/macos-differential/source/graphics/tests/test_LOSTexture.h:70:16: error: no matching constructor for initialization of 'CSimulation2'
                CSimulation2 sim(NULL, g_ScriptContext, NULL);
                             ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:54:2: note: candidate constructor not viable: requires 4 arguments, but 3 were provided
        CSimulation2(CUnitManager* unitManager, std::shared_ptr<ScriptContext> cx, CTerrain* terrain, CWater* water);
        ^
../../../source/simulation2/Simulation2.h:49:14: note: candidate constructor not viable: requires 1 argument, but 3 were provided
        NONCOPYABLE(CSimulation2);
                    ^
2 errors generated.
make[1]: *** [obj/test_Debug/test_LOSTexture.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [test] Error 2

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7058/display/redirect

wraitii added inline comments.Jun 10 2023, 6:13 PM
source/graphics/GameView.cpp
198–201

I haven't done the legwork, but I don't think there's really much sense to a GameView without a CWorld.

source/renderer/SceneRenderer.cpp
1088

This feels awkwardly placed but it seems like that's where it should go.

source/renderer/WaterManager.cpp
1070–1072

Should also update on WindAngle for atlas, but I have had some trouble with running atlas so didn't fully finish this here

source/simulation2/Simulation2.cpp
640

fixed that

source/simulation2/components/CCmpTerrain.cpp
149–150

This was previously done in WaterManager for some reason

source/simulation2/components/CCmpWaterManager.cpp
94–95

Feel like this should be moved to CWater, but that might be a separate diff

Build failure - The Moirai have given mortals hearts that can endure.

Debug:
    14>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\graphics\GameView.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\graphics.vcxproj]
    15>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\tools\atlas\GameInterface\ActorViewer.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\atlas.vcxproj]
    15>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\tools\atlas\GameInterface\Handlers\EnvironmentHandlers.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\atlas.vcxproj]
    11>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\ccmpwatermanager.cpp(32): warning C4100: 'componentManager': unreferenced formal parameter [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\simulation2.vcxproj]
    14>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\renderer\ModelRenderer.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\graphics.vcxproj]
    14>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\renderer\PatchRData.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\graphics.vcxproj]
    14>e:\jenkins\workspace\vs2015-differential\source\renderer\patchrdata.cpp(1411): warning C4189: 'mapSize': local variable is initialized but not referenced [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\graphics.vcxproj]
    14>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\renderer\RenderingOptions.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\graphics.vcxproj]
    14>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\renderer\SceneRenderer.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\graphics.vcxproj]
    14>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\renderer\TerrainRenderer.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\graphics.vcxproj]
    14>e:\jenkins\workspace\vs2015-differential\source\renderer\watermanager.h(204): warning C4245: 'initializing': conversion from 'int' to 'u8', signed/unsigned mismatch (compiling source file ..\..\..\source\renderer\WaterManager.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\graphics.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\graphics\tests\test_lostexture.h(31): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\graphics\tests\test_LOSTexture.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\graphics\tests\test_lostexture.h(70): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\graphics\tests\test_LOSTexture.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(140): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(199): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(254): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\components\tests\test_pathfinder.h(311): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\components\tests\test_Pathfinder.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_cmptemplatemanager.h(243): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_CmpTemplateManager.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_serializer.h(890): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Serializer.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(60): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(80): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]
    23>e:\jenkins\workspace\vs2015-differential\source\simulation2\tests\test_simulation2.h(136): error C2661: 'CSimulation2::CSimulation2': no overloaded function takes 3 arguments (compiling source file ..\..\..\source\simulation2\tests\test_Simulation2.cpp) [E:\Jenkins\workspace\vs2015-differential\build\workspaces\vs2017\test.vcxproj]

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8147/display/redirect

Build failure - The Moirai have given mortals hearts that can endure.

builderr-debug-gcc7.txt
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:0:
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h: In member function 'void TestLOSTexture::test_basic()':
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:31:47: error: no matching function for call to 'CSimulation2::CSimulation2(NULL, std::shared_ptr<ScriptContext>&, NULL)'
   CSimulation2 sim(NULL, g_ScriptContext, NULL);
                                               ^
In file included from /zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:23:0,
                 from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
../../../source/simulation2/Simulation2.h:54:2: note: candidate: CSimulation2::CSimulation2(CUnitManager*, std::shared_ptr<ScriptContext>, CTerrain*, CWater*)
  CSimulation2(CUnitManager* unitManager, std::shared_ptr<ScriptContext> cx, CTerrain* terrain, CWater* water);
  ^~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:54:2: note:   candidate expects 4 arguments, 3 provided
In file included from ../../../source/graphics/tests/test_LOSTexture.cpp:17:0:
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h: In member function 'void TestLOSTexture::test_perf_DISABLED()':
/zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:70:47: error: no matching function for call to 'CSimulation2::CSimulation2(NULL, std::shared_ptr<ScriptContext>&, NULL)'
   CSimulation2 sim(NULL, g_ScriptContext, NULL);
                                               ^
In file included from /zpool0/gcc7/source/graphics/tests/test_LOSTexture.h:23:0,
                 from ../../../source/graphics/tests/test_LOSTexture.cpp:17:
../../../source/simulation2/Simulation2.h:54:2: note: candidate: CSimulation2::CSimulation2(CUnitManager*, std::shared_ptr<ScriptContext>, CTerrain*, CWater*)
  CSimulation2(CUnitManager* unitManager, std::shared_ptr<ScriptContext> cx, CTerrain* terrain, CWater* water);
  ^~~~~~~~~~~~
../../../source/simulation2/Simulation2.h:54:2: note:   candidate expects 4 arguments, 3 provided
make[1]: *** [test.make:435: obj/test_Debug/test_LOSTexture.o] Error 1
make: *** [Makefile:205: test] Error 2

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/8728/display/redirect

This diff is still big.
Could you split the addition of "versioning"?