[fix] Fixed an issue that posteffect's parameters were remained after music ended.
This commit is contained in:
parent
673c2dfe94
commit
05377b7472
@ -60,6 +60,11 @@ class PostEffect {
|
||||
fb_.Unbind();
|
||||
}
|
||||
|
||||
///
|
||||
void Initialize() {
|
||||
instance = instance.init;
|
||||
}
|
||||
|
||||
///
|
||||
void BindFramebuffer() {
|
||||
fb_.Bind();
|
||||
|
@ -48,7 +48,7 @@ class Game : AbstractGame {
|
||||
title_ = new TitleScene(lobby_, programs_);
|
||||
select_ = new SelectScene(lobby_, programs_, fonts_, music_list_);
|
||||
load_ = new LoadingScene(lobby_, posteffect_, programs_, fonts_);
|
||||
play_ = new PlayScene;
|
||||
play_ = new PlayScene(posteffect_);
|
||||
result_ = new ResultScene(lobby_, programs_, fonts_);
|
||||
|
||||
title_ .SetupSceneDependency(select_);
|
||||
|
@ -23,7 +23,8 @@ class PlayScene : SceneInterface {
|
||||
enum NearnessScoreRatio = 10;
|
||||
|
||||
///
|
||||
this() {
|
||||
this(sjplayer.PostEffect posteffect) {
|
||||
posteffect_ = posteffect;
|
||||
}
|
||||
~this() {
|
||||
context_.destroy();
|
||||
@ -42,12 +43,14 @@ class PlayScene : SceneInterface {
|
||||
score_ = BaseScore;
|
||||
|
||||
music_.PlayForGame(offset_beat);
|
||||
posteffect_.Initialize();
|
||||
}
|
||||
override SceneInterface Update(KeyInput input) {
|
||||
beat_ = music_.beat;
|
||||
|
||||
if (beat_ >= context_.length) {
|
||||
music_.StopPlaying();
|
||||
posteffect_.Initialize();
|
||||
|
||||
result_scene_.Initialize(music_, score_);
|
||||
return result_scene_;
|
||||
@ -93,6 +96,8 @@ class PlayScene : SceneInterface {
|
||||
return result;
|
||||
}
|
||||
|
||||
sjplayer.PostEffect posteffect_;
|
||||
|
||||
ResultScene result_scene_;
|
||||
|
||||
Music music_;
|
||||
|
Reference in New Issue
Block a user