summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-01-23 16:59:43 -0500
committerpommicket <pommicket@gmail.com>2023-01-23 16:59:43 -0500
commit4d9eaeaac64c22290a524966a1c7ea6962057982 (patch)
tree4f7b502e296cb05302d9fd2e6f280379071292a8
parentbbf9bd5fe273e474c207258f5e514cd57e438094 (diff)
autoplay setting
-rw-r--r--settings.txt4
-rw-r--r--src/main.rs7
2 files changed, 8 insertions, 3 deletions
diff --git a/settings.txt b/settings.txt
index 6456874..e179772 100644
--- a/settings.txt
+++ b/settings.txt
@@ -23,9 +23,11 @@ antialiasing 1
# focal length in "meters"
focal-length 1
# field of view in degrees
-fov 45
+fov 90
# set this to 1 to use HSV instead of RGB for color
hsv 0
+# set this to 1 to automatically start playing SDFs when they load
+autoplay 0
# framerate cap.
# by default, vsync is enabled, so you don't need to change this unless you want
# to run at an even lower framerate than your monitor's refresh rate
diff --git a/src/main.rs b/src/main.rs
index 782ef32..65b68ff 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,7 +1,7 @@
/*
@TODO:
- pause screen
-- autoplay setting
+- reload settings.txt when changed
- strip ' ' and '\n' from *inside* string
- flash error on bad string (see @TODO(error handling))
- RnToRn functions (& add back in RToR)
@@ -379,10 +379,13 @@ impl State {
.select_nth_unstable_by(i, |a, b| a.total_cmp(b))
.1;
drop(sdf_values);
- let initial_view = View {
+ let mut initial_view = View {
level_set,
..Default::default()
};
+ if self.settings.get_i32("autoplay").unwrap_or(0) != 0 {
+ initial_view.unpause(false);
+ }
self.initial_view = initial_view.clone();
self.view = initial_view;
}