Skip to content

Commit

Permalink
Do not display resolution options when not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkwouter committed Jul 15, 2024
1 parent ae93e7a commit 7fae85c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,8 @@ inline constexpr int DEFAULT_BOARD_WIDTH = 8;
inline constexpr int DEFAULT_BOARD_HEIGHT = 7;
inline constexpr int DEFAULT_SHELL_SIZE = 256; // The default should be the largest

#if !defined(__PSP__) && !defined(__vita__)
# define SHOW_RESOLUTION_OPTIONS 1
#endif

#endif // CONSTANTS_HPP
6 changes: 6 additions & 0 deletions src/states/OptionsState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ void OptionsState::handleEvents(std::vector<Event> events) {
case Option::MUSIC_VOLUME:
changeMusicVolume(1);
break;
#ifdef SHOW_RESOLUTION_OPTIONS
case Option::FULLSCREEN:
changeFullscreen();
break;
case Option::RESOLUTION:
changeResolution(1);
break;
#endif
case Option::GO_BACK:
this->done = true;
break;
Expand All @@ -74,12 +76,14 @@ void OptionsState::handleEvents(std::vector<Event> events) {
case Option::MUSIC_VOLUME:
changeMusicVolume(-1);
break;
#ifdef SHOW_RESOLUTION_OPTIONS
case Option::FULLSCREEN:
changeFullscreen();
break;
case Option::RESOLUTION:
changeResolution(-1);
break;
#endif
case Option::GO_BACK:
this->done = true;
break;
Expand Down Expand Up @@ -279,12 +283,14 @@ void OptionsState::loadTexts() {
case Option::CHANGE_MUSIC:
current_text = getChangeMusicString();
break;
#ifdef SHOW_RESOLUTION_OPTIONS
case Option::FULLSCREEN:
current_text = getFullscreenString();
break;
case Option::RESOLUTION:
current_text = getResolutionString();
break;
#endif
case Option::GO_BACK:
current_text = "return to menu";
break;
Expand Down
3 changes: 3 additions & 0 deletions src/states/OptionsState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
#include "../SoundManager.hpp"
#include "../OptionManager.hpp"
#include "../PauseScreen.hpp"
#include "../constants.hpp"

enum class Option {
CHANGE_MUSIC,
SOUND_VOLUME,
MUSIC_VOLUME,
#ifdef SHOW_RESOLUTION_OPTIONS
FULLSCREEN,
RESOLUTION,
#endif
GO_BACK
};

Expand Down

0 comments on commit 7fae85c

Please sign in to comment.