-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.cpp
More file actions
113 lines (94 loc) · 3.39 KB
/
test.cpp
File metadata and controls
113 lines (94 loc) · 3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#include "test_shared.hpp"
int main(int argc, char** argv) {
std::vector<std::string> args(argv, argv + argc);
auto hasArg = [&](const std::string& arg) {
return std::find(args.begin(), args.end(), arg) != args.end();
};
std::string chartPath, imagePath, audioPath, chartTitle, chartDifficulty, storyboardAssetsPath;
std::cout << "1. fv1" << std::endl;
std::cout << "3. fv3" << std::endl;
std::cout << "4. rpe" << std::endl;
std::cout << "5. rpe_2" << std::endl;
std::cout << "6. rpe_3" << std::endl;
std::cout << "7. rpe_4" << std::endl;
std::cout << "8. rpe_5" << std::endl;
int choice;
std::cout << ">> ";
std::cin >> choice;
switch (choice) {
case 1: {
chartPath = "./test_files/fv1/chart.json";
imagePath = "./test_files/fv1/image.png";
audioPath = "./test_files/fv1/audio.mp3";
chartTitle = "Aleph-0";
chartDifficulty = "Legacy Lv.15";
break;
}
case 3: {
chartPath = "./test_files/fv3/chart.json";
imagePath = "./test_files/fv3/image.png";
audioPath = "./test_files/fv3/audio.mp3";
chartTitle = "Alice in a xxxxxxxx";
chartDifficulty = "IN Lv.15";
break;
}
case 4: {
chartPath = "./test_files/rpe/chart.json";
imagePath = "./test_files/rpe/image.png";
audioPath = "./test_files/rpe/audio.mp3";
storyboardAssetsPath = "./test_files/rpe";
break;
}
case 5: {
chartPath = "./test_files/rpe_2/chart.json";
imagePath = "./test_files/rpe_2/image.png";
audioPath = "./test_files/rpe_2/audio.mp3";
storyboardAssetsPath = "./test_files/rpe_2";
break;
}
case 6: {
chartPath = "./test_files/rpe_3/chart.json";
imagePath = "./test_files/rpe_3/image.png";
audioPath = "./test_files/rpe_3/audio.mp3";
storyboardAssetsPath = "./test_files/rpe_3";
break;
}
case 7: {
chartPath = "./test_files/rpe_4/chart.json";
imagePath = "./test_files/rpe_4/image.png";
audioPath = "./test_files/rpe_4/audio.mp3";
storyboardAssetsPath = "./test_files/rpe_4";
break;
}
case 8: {
chartPath = "./test_files/rpe_5/chart.json";
imagePath = "./test_files/rpe_5/image.png";
audioPath = "./test_files/rpe_5/audio.mp3";
storyboardAssetsPath = "./test_files/rpe_5";
break;
}
default: {
std::cout << "Invalid choice" << std::endl;
return 1;
}
}
Window window {};
window.init();
window.vsync = !hasArg("--disable-vsync");
if (hasArg("--extend-scale")) window.globalScale = 0.25;
window.loadChart(chartPath, storyboardAssetsPath, nullptr);
if (window.chart.meta.title.empty()) {
window.chart.meta.title = chartTitle;
window.chart.meta.difficulty = chartDifficulty;
}
window.loadBgImage(imagePath);
window.loadMainSound(audioPath);
window.startMainSound();
while (ma_sound_is_playing(window.mainSound)) {
double t = getMaSoundPosition(window.mainSound);
if (!window.mainloopFrame(t, {})) {
break;
}
}
return 0;
}