From 1c9aa9340df511a859293f106de0c1cd358eee59 Mon Sep 17 00:00:00 2001 From: falsycat Date: Thu, 17 Oct 2019 00:00:00 +0000 Subject: [PATCH] [update] Updated the debug mode to load music fast. --- src/sj/Game.d | 7 +++++-- src/sj/LoadingScene.d | 9 ++++++--- src/sj/SelectScene.d | 3 ++- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/sj/Game.d b/src/sj/Game.d index 4923888..1e28cdb 100644 --- a/src/sj/Game.d +++ b/src/sj/Game.d @@ -5,7 +5,8 @@ import std.algorithm, std.exception, std.file, std.json, - std.path; + std.path, + std.typecons; import gl4d; @@ -60,7 +61,9 @@ class Game : AbstractGame { if (args.debug_music_index >= 0) { enforce(args.debug_music_index < music_list.length); load_.Initialize( - music_list_[args.debug_music_index], args.debug_music_offset_beat); + music_list_[args.debug_music_index], + args.debug_music_offset_beat, + Yes.FastLoad); super(load_); } else { diff --git a/src/sj/LoadingScene.d b/src/sj/LoadingScene.d index 591355a..de3f2ea 100644 --- a/src/sj/LoadingScene.d +++ b/src/sj/LoadingScene.d @@ -1,7 +1,8 @@ /// License: MIT module sj.LoadingScene; -import std.math; +import std.math, + std.typecons; import gl4d; @@ -25,6 +26,8 @@ class LoadingScene : SceneInterface { /// enum AnimeFrames = 300; /// + enum FastLoadAnimeFrames = 30; + /// enum CubeRotationSpeed = vec3(PI/200, PI/20, PI/200); /// enum LoadingTextScale = vec3(-0.1, 0.1, 0.1); @@ -63,11 +66,11 @@ class LoadingScene : SceneInterface { } /// - void Initialize(Music music, float offset_beat) { + void Initialize(Music music, float offset_beat, Flag!"FastLoad" fastload) { music_ = music; offset_beat_ = offset_beat; - anime_ = Animation(AnimeFrames); + anime_ = Animation(fastload? FastLoadAnimeFrames: AnimeFrames); with (lobby_) { bg_inner_ease_ = Easing!vec4( diff --git a/src/sj/SelectScene.d b/src/sj/SelectScene.d index 288b204..a71d0d6 100644 --- a/src/sj/SelectScene.d +++ b/src/sj/SelectScene.d @@ -4,6 +4,7 @@ module sj.SelectScene; import std.conv, std.math, std.random, + std.typecons, std.variant; import derelict.sfml2.audio; @@ -383,7 +384,7 @@ private class MusicPlayState : AbstractSceneState { if (anime_.isFinished) { music_.StopPlaying(); - owner.load_scene_.Initialize(music_, 0); + owner.load_scene_.Initialize(music_, 0, No.FastLoad); return CreateResult(owner.load_scene_); } return CreateResult(this);