@@ -7,6 +7,8 @@ import java.util.Properties;
7
7
8
8
import com.bladecoder.engine.BladeEngine;
9
9
import com.bladecoder.engine.util.Config;
10
+ import com.bladecoder.engine.ui.UI.Screens;
11
+ import com.bladecoder.engine.ui.defaults.DefaultSceneScreen;
10
12
import org.lwjgl.BufferUtils;
11
13
import org.lwjgl.LWJGLException;
12
14
import org.lwjgl.input.Cursor;
@@ -21,6 +23,8 @@ public class DesktopLauncher extends BladeEngine {
21
23
22
24
private boolean fullscreen = true;
23
25
private LwjglApplicationConfiguration cfg = new LwjglApplicationConfiguration();
26
+
27
+ private float speed = 1.0f;
24
28
25
29
DesktopLauncher() {
26
30
Properties p = new Properties();
@@ -70,6 +74,11 @@ public class DesktopLauncher extends BladeEngine {
70
74
i++;
71
75
setPlayMode(args[i]);
72
76
}
77
+ } else if (s.equals("-s")) {
78
+ if (i + 1 < args.length) {
79
+ i++;
80
+ speed = Float.parseFloat(args[i]);
81
+ }
73
82
} else if (s.equals("-chapter")) {
74
83
if (i + 1 < args.length) {
75
84
i++;
@@ -116,23 +125,21 @@ public class DesktopLauncher extends BladeEngine {
116
125
}
117
126
}
118
127
}
119
-
120
128
121
129
public void usage() {
122
- System.out.println(
123
- "Usage:\n" +
124
- "-chapter chapter\tLoads the selected chapter\n" +
125
- "-t scene_name\tStart test mode for the scene\n" +
126
- "-p record_name\tPlay previusly recorded games\n" +
127
- "-f\tSet fullscreen mode\n" +
128
- "-w\tSet windowed mode\n" +
129
- "-d\tShow debug messages\n" +
130
- "-res width\tForce the resolution width\n" +
131
- "-l game_state\tLoad the previusly saved game state\n" +
132
- "-r\tRun the game from the begining\n" +
133
- "-aspect aspect_ratio\tSets the specified screen aspect (16:9, 4:3, 16:10)\n"
134
- );
135
-
130
+ System.out.println("Usage:\n"
131
+ + "-chapter chapter\tLoads the selected chapter\n"
132
+ + "-t scene_name\tStart test mode for the scene\n"
133
+ + "-p record_name\tPlay previusly recorded games\n"
134
+ + "-f\tSet fullscreen mode\n"
135
+ + "-w\tSet windowed mode\n"
136
+ + "-d\tShow debug messages\n"
137
+ + "-res width\tForce the resolution width\n"
138
+ + "-l game_state\tLoad the previusly saved game state\n"
139
+ + "-r\tRun the game from the begining\n"
140
+ + "-s speed\tSets the game speed\n"
141
+ + "-aspect aspect_ratio\tSets the specified screen aspect (16:9, 4:3, 16:10)\n");
142
+
136
143
System.exit(0);
137
144
}
138
145
@@ -145,6 +152,9 @@ public class DesktopLauncher extends BladeEngine {
145
152
hideCursor();
146
153
147
154
super.create();
155
+
156
+ if(getUI().getScreen(Screens.SCENE_SCREEN) instanceof DefaultSceneScreen)
157
+ ((DefaultSceneScreen) getUI().getScreen(Screens.SCENE_SCREEN)).setSpeed(speed);
148
158
}
149
159
150
160
private void hideCursor() {
0 commit comments