Thyme icon indicating copy to clipboard operation
Thyme copied to clipboard

Fix compile warning in w3ddisplay from deprecated GetVersionEx function

Open xezon opened this issue 3 years ago • 14 comments

xezon avatar Dec 28 '21 16:12 xezon

Given that VER_PLATFORM_WIN32_WINDOWS means "Windows 9x" (at least according to available documentation) maybe its better to just remove the check entirely (given that we don't even run on Windows 9x)

jonwil avatar Dec 28 '21 20:12 jonwil

Yes that is what was done within the ifdef block. I could delete the code if so desired, but I left it for now for documentation sake.

xezon avatar Dec 28 '21 20:12 xezon

No, I meant removing the whole lot including the W3D::Invalidate_Textures call (since that call is inside the "if version == Windows 9x" block)

jonwil avatar Dec 28 '21 20:12 jonwil

Hmm. Why do you think that is an appropriate action? Not invalidating textures on Device Reset will likely cause Direct X to not be able to recover.

xezon avatar Dec 28 '21 21:12 xezon

The original game code is not calling Invalidate_Textures on modern windows so why do we need to do that?

jonwil avatar Dec 28 '21 22:12 jonwil

I will take a look later.

xezon avatar Dec 28 '21 23:12 xezon

Its basically impossible for VersionInformation.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS to be true on any version of Windows Thyme supports.

jonwil avatar Dec 30 '21 08:12 jonwil

We already use git for source control we have absolutely no need to add unusable code branches. Just delete the code.

duncanspumpkin avatar Dec 30 '21 09:12 duncanspumpkin

Maybe comment out the whole function for now and add a TODO to remove finally later if never used?

xezon avatar Dec 30 '21 09:12 xezon

Why, we have already investigated and concluded is not used. Have a comment that there used to be special win9x code if you want. If in the future you can always use git history to find the original code

duncanspumpkin avatar Dec 30 '21 09:12 duncanspumpkin

I would just like the Compiler Warning gone. Removing the function entirely will likely make it forgotten, and if ever someone wants it back, he likely re-implements it. No one will remember to check GIT history and where in time.

xezon avatar Dec 30 '21 10:12 xezon

Is this good to go? Review is very small so should not take long to review.

xezon avatar Feb 12 '22 20:02 xezon

I would still like to see the dead code removed as it has already been investigated and if anyone for some reason wanted to view the original they can use git to find it.

duncanspumpkin avatar Feb 28 '22 16:02 duncanspumpkin

Endless discussions. I can't search Git like I can search in Visual Studio. If we can't move forward with this then we have to keep this compiler warning in the build.

xezon avatar Feb 28 '22 17:02 xezon

PR solved by disabling the code via "#if 0". Closing.

jonwil avatar Sep 11 '23 21:09 jonwil