steam: Fix float stat truncation, outdated macOS SDK path, and VS det…#367
Open
steam: Fix float stat truncation, outdated macOS SDK path, and VS det…#367
Conversation
Collaborator
Author
|
I'll rebase this branch after #370 is merged and mark this PR as ready-to-review. |
…ection
steamshim_child.c: Fix float stat values being silently truncated to
integers. In processEvent(), SHIMEVENT_SETSTATF/GETSTATF was assigning
float values as:
event.fvalue = (int)*((float *)buf);
The erroneous (int) cast discarded the fractional part before assigning
to the float field. This meant stats like stat_online_minutes_played
(a float) were always rounded down to whole numbers. Remove the cast so
the float value is assigned directly.
steamshim_parent/Makefile: Update macOS redistributable library path
from osx32 to osx. Valve renamed the directory when they dropped 32-bit
macOS support in Steamworks SDK ~1.42 (2018). Building the Steam shim
for HOST=osx would fail to link because the path no longer exists in
any recent SDK.
steamshim_parent/build.bat: Add support for Visual Studio 2017, 2019,
and 2022. Previously the script only detected VS2015 (VS140COMNTOOLS).
Now it first tries vswhere.exe (available since VS2017, the standard
Microsoft-recommended discovery mechanism) to locate the latest
installed VS with C++ tools. Falls back to the legacy VS2015 check if
vswhere is not found.
Co-Authored-By: Claude Sonnet 4.6 <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.
…ection
steamshim_child.c: Fix float stat values being silently truncated to integers. In processEvent(), SHIMEVENT_SETSTATF/GETSTATF was assigning float values as:
The erroneous (int) cast discarded the fractional part before assigning to the float field. This meant stats like stat_online_minutes_played (a float) were always rounded down to whole numbers. Remove the cast so the float value is assigned directly.
steamshim_parent/Makefile: Update macOS redistributable library path from osx32 to osx. Valve renamed the directory when they dropped 32-bit macOS support in Steamworks SDK ~1.42 (2018). Building the Steam shim for HOST=osx would fail to link because the path no longer exists in any recent SDK.
steamshim_parent/build.bat: Add support for Visual Studio 2017, 2019, and 2022. Previously the script only detected VS2015 (VS140COMNTOOLS). Now it first tries vswhere.exe (available since VS2017, the standard Microsoft-recommended discovery mechanism) to locate the latest installed VS with C++ tools. Falls back to the legacy VS2015 check if vswhere is not found.