summaryrefslogtreecommitdiff
path: root/src/helpers/math
diff options
context:
space:
mode:
authorVaxry <43317083+vaxerski@users.noreply.github.com>2026-02-21 21:30:39 +0000
committerGitHub <noreply@github.com>2026-02-21 21:30:39 +0000
commit723870337f299d4c80aa0048144f3a1ca1c885bd (patch)
treeca3279ae5dbc841f676c64d2f58f895de13cd3bf /src/helpers/math
parent51f8849e541f0a8150ac3a43fa928c1e299daf18 (diff)
layout: rethonk layouts from the ground up (#12890)
Rewrites layouts to be much smaller, and deal with much less annoying BS. Improves the overall architecture, unifies handling of pseudotiling, and various other improvements.
Diffstat (limited to 'src/helpers/math')
-rw-r--r--src/helpers/math/Direction.cpp0
-rw-r--r--src/helpers/math/Direction.hpp35
2 files changed, 35 insertions, 0 deletions
diff --git a/src/helpers/math/Direction.cpp b/src/helpers/math/Direction.cpp
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/src/helpers/math/Direction.cpp
diff --git a/src/helpers/math/Direction.hpp b/src/helpers/math/Direction.hpp
new file mode 100644
index 00000000..9905db4f
--- /dev/null
+++ b/src/helpers/math/Direction.hpp
@@ -0,0 +1,35 @@
+#pragma once
+
+#include <cstdint>
+
+namespace Math {
+ enum eDirection : int8_t {
+ DIRECTION_DEFAULT = -1,
+ DIRECTION_UP,
+ DIRECTION_RIGHT,
+ DIRECTION_DOWN,
+ DIRECTION_LEFT
+ };
+
+ inline eDirection fromChar(char x) {
+ switch (x) {
+ case 'r': return DIRECTION_RIGHT;
+ case 'l': return DIRECTION_LEFT;
+ case 't':
+ case 'u': return DIRECTION_UP;
+ case 'b':
+ case 'd': return DIRECTION_DOWN;
+ default: return DIRECTION_DEFAULT;
+ }
+ }
+
+ inline const char* toString(eDirection d) {
+ switch (d) {
+ case DIRECTION_UP: return "up";
+ case DIRECTION_DOWN: return "down";
+ case DIRECTION_LEFT: return "left";
+ case DIRECTION_RIGHT: return "right";
+ default: return "default";
+ }
+ }
+}; \ No newline at end of file