Skip to content

Commit

Permalink
simplify the definition of screens
Browse files Browse the repository at this point in the history
I introduced the namespace blocks because of a Doxygen bug, but removing
the `struct` keyword instead is a simpler workaround.
  • Loading branch information
fmang committed Mar 28, 2020
1 parent 089627e commit b44dc2b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions lib/ui/screens/pause.cc
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ static int draw(oshu::shell &w)
return 0;
}

namespace oshu {

/**
* Pause screen: the music stops.
*
Expand All @@ -102,11 +100,9 @@ namespace oshu {
* to re-focus.
*
*/
struct oshu::game_screen pause_screen = {
oshu::game_screen oshu::pause_screen = {
.name = "Paused",
.on_event = on_event,
.update = update,
.draw = draw,
};

}
6 changes: 1 addition & 5 deletions lib/ui/screens/play.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ static int draw(oshu::shell &w)
return 0;
}

namespace oshu {

/**
* The standard in-play game screen.
*
Expand All @@ -176,11 +174,9 @@ namespace oshu {
* This screen relies heavily on the game mode.
*
*/
struct oshu::game_screen play_screen = {
oshu::game_screen oshu::play_screen = {
.name = "Playing",
.on_event = on_event,
.update = update,
.draw = draw,
};

}
6 changes: 1 addition & 5 deletions lib/ui/screens/score.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,15 @@ static int draw(oshu::shell &w)
return 0;
}

namespace oshu {

/**
* Game complete screen.
*
* Once this screen is reached, the only command left is *exit*.
*
*/
struct oshu::game_screen score_screen = {
oshu::game_screen oshu::score_screen = {
.name = "Finished",
.on_event = on_event,
.update = update,
.draw = draw,
};

}

0 comments on commit b44dc2b

Please sign in to comment.