fix: resolve C++ build errors in games#254
Open
seventhback777 wants to merge 1 commit into
Open
Conversation
…ong, car-race BelowTheSurface/behaviour.h, player.h: Replace center_point(sprite) with manual point_at() calculation using sprite_x/y + width/height. center_point() was removed from the SplashKit API; this restores equivalent behaviour without that function. HomemadePong/program.cpp, Pingpong/game.cpp, car-race/game.cpp, car-race/program.cpp: Replace unqualified to_string() calls with std::to_string(). The unqualified form is ambiguous in strict C++ compilation and fails on some compilers/platforms.
4 tasks
RealH4D35
approved these changes
May 24, 2026
RealH4D35
left a comment
There was a problem hiding this comment.
Review for PR #254 (Build Fixes)
Tested on: Arch Linux (g++ 14, SplashKit latest)
Compilation fixes needed (add these upstream):
- None. The PR itself provides the necessary fixes to make the listed games compile.
Features work as expected:
BelowTheSurface– The manual centre‑point calculation usingsprite_x,sprite_width,sprite_y,sprite_heightandpoint_atcorrectly replaces the removedcenter_point(). Enemy and player positions are identical; no behavioural change.HomemadePong,Pingpong,car-race– Qualifyingto_stringcalls withstd::resolves ambiguous‑overload errors in strict C++17/C++20 mode. Score display, game logic, and all runtime behaviour remain unchanged.- All four games now compile cleanly with
-std=c++17and-std=c++20; no new warnings.
Pre‑existing issues (not caused by this PR):
- The removed
center_point()function is part of a broader SplashKit API update. Other games may still use deprecated functions and will need similar fixes. - DLL files were correctly excluded from the commit – this is expected and appropriate.
Relationship to PR #253:
- PR #253 introduces a multi‑platform CI pipeline that would immediately fail on these games without these fixes. Merging PR #254 first ensures the CI stays green from day one.
Ready to merge – changes are minimal, correct, and have no negative impact on functionality.
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.
Replace center_point() with point_at() in BelowTheSurface (API removed from SplashKit). Replace to_string() with std::to_string() in HomemadePong, Pingpong, car-race. DLL files excluded.