aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornathansmith117 <nathansmith117@sdf.org>2025-02-03 17:23:39 +0000
committernathansmith117 <nathansmith117@sdf.org>2025-02-03 17:23:39 +0000
commitfb7ccc0c046ed80fdac2e829b8c367841600e211 (patch)
treee7a7765e98e4583a7c1468e1342ce67e7813fb23
parentb07e8d2baa70d6da287eaa555bc2bc5070c42c2f (diff)
downloadsldj-fb7ccc0c046ed80fdac2e829b8c367841600e211.tar.gz
sldj-fb7ccc0c046ed80fdac2e829b8c367841600e211.tar.bz2
sldj-fb7ccc0c046ed80fdac2e829b8c367841600e211.zip
More messing around
-rw-r--r--src/sldjConfig.h4
-rw-r--r--test/scanTest1.c22
2 files changed, 20 insertions, 6 deletions
diff --git a/src/sldjConfig.h b/src/sldjConfig.h
index 4865538..c8285bd 100644
--- a/src/sldjConfig.h
+++ b/src/sldjConfig.h
@@ -4,8 +4,8 @@
#define WINDOW_WIDTH 960
#define WINDOW_HEIGHT 720
-#define DEFAULT_SCREEN_WIDTH 640
-#define DEFAULT_SCREEN_HEIGHT 480
+#define DEFAULT_SCREEN_WIDTH 480
+#define DEFAULT_SCREEN_HEIGHT 360
#define DEFAULT_FRAME_RATE 24
diff --git a/test/scanTest1.c b/test/scanTest1.c
index 32c4d86..ac67115 100644
--- a/test/scanTest1.c
+++ b/test/scanTest1.c
@@ -13,14 +13,28 @@ typedef struct Color {
Color lineScanner(uint16_t x, uint16_t y, uint32_t frameNumber)
{
uint8_t c = 0;
+ uint8_t scale = random() % 2 + 7;
- if (frameNumber % 255 >= 127)
+ if (frameNumber % 1024 >= 512)
{
- c = (x >> 8) + (uint8_t)(hypot(x >> 9, y >> 9) * (frameNumber % 255));
+ uint8_t section = frameNumber % 300;
+
+ if (section >= 200)
+ {
+ c = (x >> 8) + (uint8_t)(hypot(x >> 8, y >> 8) * (frameNumber % 255));
+ } else if (section >= 100) {
+ c = (x >> 8) + (uint8_t)(hypot(cos(x >> scale), sin(y >> scale)) * (frameNumber % 255));
+ } else {
+ c = frameNumber + hypot((x - 32768) >> scale, (y - 32768) >> scale);
+ }
} else {
- c = (x >> 8) + (uint8_t)(hypot(cos(x >> 9), sin(y >> 9)) * (frameNumber % 255));
+ uint8_t c1 = (x >> 8) + (uint8_t)(hypot(x >> 8, y >> 8) * (frameNumber % 255));
+ uint8_t c2 = (x >> 8) + (uint8_t)(hypot(cos(x >> scale), sin(y >> scale)) * (frameNumber % 255));
+ uint8_t c3 = frameNumber + hypot((x - 32768) >> scale, (y - 32768) >> scale);
+
+ c = c1 & c2 & c3;
}
-
+
return (Color){
.r = (uint8_t)(sin(c) * 127),
.g = c - 127,