ko4life-net / ko

Open source development of the game Knight Online. This is a reversed engineered old version of the game aiming to replicate the nostalgic experience we all once had <3
https://github.com/ko4life-net/ko
MIT License
55 stars 22 forks source link

Unify precompiled headers across all projects to use StdBase.h. #253

Closed stevewgr closed 1 week ago

stevewgr commented 1 week ago

Description

This pull request unifies the precompiled headers across all projects by standardizing on StdBase.h STL only headers.

This approach simplifies maintenance and enhances uniformity across projects, reducing duplication and ensuring consistent feature availability.

I also defined NOMINMAX before including Window headers so that we can use STL's min max functions instead of the ones coming from Windows headers.

stevewgr commented 1 week ago

Thanks for the review guys! Thankfully we have automation--I noticed a weird issue on some VS installation, namely in the GitHub runners: https://github.com/ko4life-net/ko/actions/runs/11788806886

       "D:\a\ko\ko\src\All.sln" (Clean;Build target) (1) ->
       "D:\a\ko\ko\src\game\KnightOnLine.vcxproj" (default target) (22:2) ->
       (ClCompile target) -> 
         D:\a\ko\ko\src\game\GameProcMain.cpp(319,5): error C2065: '_finddata_t': undeclared identifier [D:\a\ko\ko\src\game\KnightOnLine.vcxproj]
         D:\a\ko\ko\src\game\GameProcMain.cpp(319,17): error C2146: syntax error: missing ';' before identifier 'fi' [D:\a\ko\ko\src\game\KnightOnLine.vcxproj]
         D:\a\ko\ko\src\game\GameProcMain.cpp(319,17): error C2065: 'fi': undeclared identifier [D:\a\ko\ko\src\game\KnightOnLine.vcxproj]
         D:\a\ko\ko\src\game\GameProcMain.cpp(327,37): error C2065: 'fi': undeclared identifier [D:\a\ko\ko\src\game\KnightOnLine.vcxproj]
         D:\a\ko\ko\src\game\GameProcMain.cpp(327,13): error C3861: '_findfirst': identifier not found [D:\a\ko\ko\src\game\KnightOnLine.vcxproj]

On my machine it was building just fine, hence I find this error weird. However including Window's io.h file fixes the issue and we'll anyway remove it once adapting std::filesystem to the project.

This was added in this commit: https://github.com/ko4life-net/ko/pull/253/commits/d631c98f77ce71f9a43e7dd0b1e18172ceeb5537

Build passing now: https://github.com/ko4life-net/ko/actions/runs/11789222493

Merging.