[update] Updated the debug mode to load music fast.

This commit is contained in:
falsycat 2019-10-17 00:00:00 +00:00
parent 210c25e695
commit 1c9aa9340d
3 changed files with 13 additions and 6 deletions

View File

@ -5,7 +5,8 @@ import std.algorithm,
std.exception, std.exception,
std.file, std.file,
std.json, std.json,
std.path; std.path,
std.typecons;
import gl4d; import gl4d;
@ -60,7 +61,9 @@ class Game : AbstractGame {
if (args.debug_music_index >= 0) { if (args.debug_music_index >= 0) {
enforce(args.debug_music_index < music_list.length); enforce(args.debug_music_index < music_list.length);
load_.Initialize( 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_); super(load_);
} else { } else {

View File

@ -1,7 +1,8 @@
/// License: MIT /// License: MIT
module sj.LoadingScene; module sj.LoadingScene;
import std.math; import std.math,
std.typecons;
import gl4d; import gl4d;
@ -25,6 +26,8 @@ class LoadingScene : SceneInterface {
/// ///
enum AnimeFrames = 300; enum AnimeFrames = 300;
/// ///
enum FastLoadAnimeFrames = 30;
///
enum CubeRotationSpeed = vec3(PI/200, PI/20, PI/200); enum CubeRotationSpeed = vec3(PI/200, PI/20, PI/200);
/// ///
enum LoadingTextScale = vec3(-0.1, 0.1, 0.1); 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; music_ = music;
offset_beat_ = offset_beat; offset_beat_ = offset_beat;
anime_ = Animation(AnimeFrames); anime_ = Animation(fastload? FastLoadAnimeFrames: AnimeFrames);
with (lobby_) { with (lobby_) {
bg_inner_ease_ = Easing!vec4( bg_inner_ease_ = Easing!vec4(

View File

@ -4,6 +4,7 @@ module sj.SelectScene;
import std.conv, import std.conv,
std.math, std.math,
std.random, std.random,
std.typecons,
std.variant; std.variant;
import derelict.sfml2.audio; import derelict.sfml2.audio;
@ -383,7 +384,7 @@ private class MusicPlayState : AbstractSceneState {
if (anime_.isFinished) { if (anime_.isFinished) {
music_.StopPlaying(); music_.StopPlaying();
owner.load_scene_.Initialize(music_, 0); owner.load_scene_.Initialize(music_, 0, No.FastLoad);
return CreateResult(owner.load_scene_); return CreateResult(owner.load_scene_);
} }
return CreateResult(this); return CreateResult(this);