Skip to content

Commit

Permalink
tidy some warnings
Browse files Browse the repository at this point in the history
default to controller layout when loading options menu on steam deck
  • Loading branch information
fallahn committed Oct 9, 2024
1 parent 5f61249 commit d49317a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
4 changes: 2 additions & 2 deletions samples/golf/buildnumber.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef BUILD_NUMBER_H_
#define BUILD_NUMBER_H_

#define BUILDNUMBER 7171
#define BUILDNUMBER_STR "7171"
#define BUILDNUMBER 7174
#define BUILDNUMBER_STR "7174"

#endif /* BUILD_NUMBER_H_ */
5 changes: 5 additions & 0 deletions samples/golf/src/golf/OptionsState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@ OptionsState::OptionsState(cro::StateStack& ss, cro::State::Context ctx, SharedS
m_viewScale (2.f),
m_refreshControllers(false)
{
if (Social::isSteamdeck())
{
lastInput = LastInput::XBox;
}

ctx.mainWindow.setMouseCaptured(false);

m_videoSettings.fullScreen = ctx.mainWindow.isFullscreen();
Expand Down
12 changes: 6 additions & 6 deletions samples/golf/src/golf/server/ServerGolfRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data)
//skins and match play are always in a single group
//so we don't consider other players here
const auto& currPlayer = playerInfo[0];
for (auto i = 1; i < playerInfo.size(); ++i)
for (auto i = 1u; i < playerInfo.size(); ++i)
{
playerInfo[i].distanceToHole = 0.f;
playerInfo[i].holeScore[m_currentHole] = currPlayer.holeScore[m_currentHole] + 1;
Expand All @@ -194,9 +194,9 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data)
else
{
//eliminate anyone who can't beat this score
//again - assume all players exist in the dame group
//again - assume all players exist in the same group
const auto& currPlayer = playerInfo[0];
for (auto i = 1; i < playerInfo.size(); ++i)
for (auto i = 1u; i < playerInfo.size(); ++i)
{
if (playerInfo[i].holeScore[m_currentHole] >= currPlayer.holeScore[m_currentHole])
{
Expand Down Expand Up @@ -230,7 +230,7 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data)
//force a draw by eliminating anyone who can't beat it
if (currPlayer.holeScore[m_currentHole] == m_currentBest)
{
for (auto i = 1; i < playerInfo.size(); ++i)
for (auto i = 1u; i < playerInfo.size(); ++i)
{
if (playerInfo[i].holeScore[m_currentHole] + 1 >= m_currentBest)
{
Expand Down Expand Up @@ -312,7 +312,7 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data)
{
//skins / match play should always be in the same group
const auto& currPlayer = m_playerInfo[groupID].playerInfo[0];
for (auto i = 1; i < playerInfo.size(); ++i)
for (auto i = 1u; i < playerInfo.size(); ++i)
{
playerInfo[i].distanceToHole = 0.f;
playerInfo[i].holeScore[m_currentHole] = currPlayer.holeScore[m_currentHole] + 1;
Expand All @@ -332,7 +332,7 @@ void GolfState::handleRules(std::int32_t groupID, const GolfBallEvent& data)
{
//check if our score is even with anyone holed already and forfeit
auto& currPlayer = m_playerInfo[groupID].playerInfo[0];
for (auto i = 1; i < playerInfo.size(); ++i)
for (auto i = 1u; i < playerInfo.size(); ++i)
{
if (playerInfo[i].distanceToHole == 0
&& playerInfo[i].holeScore[m_currentHole] < currPlayer.holeScore[m_currentHole])
Expand Down

0 comments on commit d49317a

Please sign in to comment.