Skip to content

Commit

Permalink
add new screentype to prevent gc from unloading replays at eval
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Dec 1, 2018
1 parent 54a0f9d commit e658b67
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/RageTextureManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ RageTextureManager::Update(float fDeltaTime)
static RageTimer garbageCollector;
if (garbageCollector.PeekDeltaTime() >= 30.0f) {
if ((SCREENMAN != nullptr) && (SCREENMAN->GetTopScreen() != nullptr) &&
SCREENMAN->GetTopScreen()->GetScreenType() != gameplay) {
SCREENMAN->GetTopScreen()->GetScreenType() != gameplay &&
SCREENMAN->GetTopScreen()->GetScreenType() != evaluation) {
DoDelayedDelete();
garbageCollector.Touch();
}
Expand Down
1 change: 1 addition & 0 deletions src/Screen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static const char* ScreenTypeNames[] = {
"Attract",
"GameMenu",
"Gameplay",
"Evaluation",
"SystemMenu",
};
XToString(ScreenType);
Expand Down
1 change: 1 addition & 0 deletions src/Screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ enum ScreenType
game_menu, /**< The menu screens, where options can be set before playing.
*/
gameplay, /**< The gameplay screen, where the actual game takes place. */
evaluation,
system_menu, /**< The system/operator menu, where special options are set.
*/
NUM_ScreenType, /**< The number of screen types. */
Expand Down
2 changes: 1 addition & 1 deletion src/ScreenEvaluation.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class ScreenEvaluation : public ScreenWithMenuElements
void Init() override;
bool Input(const InputEventPlus& input) override;
void HandleScreenMessage(ScreenMessage SM) override;

ScreenType GetScreenType() const override { return evaluation; }
bool MenuBack(const InputEventPlus& input) override;
bool MenuStart(const InputEventPlus& input) override;
void PushSelf(lua_State* L) override;
Expand Down

0 comments on commit e658b67

Please sign in to comment.