summaryrefslogtreecommitdiff
path: root/src/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cc')
-rw-r--r--src/main.cc21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/main.cc b/src/main.cc
index 8cedfce..f7136ef 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -130,7 +130,10 @@ float* generate_tone(float* buffer, float freq) {
int main(int argc, char** argv) {
bool fullscreen_enabled = false;
- double seek_time = 0.0;
+ float seek_time = 0.0f;
+ int* width_ptr = nullptr;
+ int* height_ptr = nullptr;
+ int custom_width, custom_height;
#if !defined(STRIP_ALL)
for (int i = 1; i < argc; ++i) {
@@ -139,6 +142,12 @@ int main(int argc, char** argv) {
} else if (strcmp(argv[i], "--seek") == 0 && i + 1 < argc) {
seek_time = atof(argv[i + 1]);
++i;
+ } else if (strcmp(argv[i], "--resolution") == 0 && i + 1 < argc) {
+ const char* res_str = argv[++i];
+ if (sscanf(res_str, "%dx%d", &custom_width, &custom_height) == 2) {
+ width_ptr = &custom_width;
+ height_ptr = &custom_height;
+ }
}
}
#else
@@ -147,10 +156,8 @@ int main(int argc, char** argv) {
fullscreen_enabled = true;
#endif /* STRIP_ALL */
- platform_init_window(fullscreen_enabled);
- int width, height;
- glfwGetFramebufferSize(platform_get_window(), &width, &height);
- gpu_init(platform_get_window(), width, height);
+ platform_init_window(fullscreen_enabled, width_ptr, height_ptr);
+ gpu_init(platform_get_window(), platform_get_width(), platform_get_height());
audio_init();
// Register drum assets
@@ -234,9 +241,7 @@ int main(int argc, char** argv) {
update_game_logic(current_time);
- int width, height;
- glfwGetFramebufferSize(platform_get_window(), &width, &height);
- float aspect_ratio = (float)width / (float)height;
+ float aspect_ratio = platform_get_aspect_ratio();
// Adjusted multiplier for visuals (preventing constant 1.0 saturation)
float raw_peak = synth_get_output_peak();