[update] Added a debug-music-index command-line option.
This commit is contained in:
parent
928be56f10
commit
c146ab5366
@ -36,7 +36,8 @@ int main(string[] unparsed_args) {
|
||||
|
||||
private bool ParseArgs(string[] unparsed_args, out Args args) {
|
||||
auto helpinfo = unparsed_args.getopt(
|
||||
"window-size", &args.window_size
|
||||
"debug-music-index", &args.debug_music_index,
|
||||
"window-size", &args.window_size
|
||||
);
|
||||
|
||||
auto valid = true;
|
||||
|
@ -6,4 +6,7 @@ struct Args {
|
||||
public:
|
||||
///
|
||||
int window_size = 600;
|
||||
|
||||
///
|
||||
int debug_music_index = -1;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
module sj.Game;
|
||||
|
||||
import std.algorithm,
|
||||
std.exception,
|
||||
std.file,
|
||||
std.json,
|
||||
std.path;
|
||||
@ -48,8 +49,15 @@ class Game : AbstractGame {
|
||||
play_ .SetupSceneDependency(result_);
|
||||
result_.SetupSceneDependency(title_);
|
||||
|
||||
title_.Initialize();
|
||||
super(title_);
|
||||
if (args.debug_music_index >= 0) {
|
||||
enforce(args.debug_music_index < music_list.length);
|
||||
load_.Initialize(music_list_[args.debug_music_index]);
|
||||
super(load_);
|
||||
|
||||
} else {
|
||||
title_.Initialize();
|
||||
super(title_);
|
||||
}
|
||||
}
|
||||
|
||||
~this() {
|
||||
|
Reference in New Issue
Block a user