summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2024-03-15 17:41:01 +0100
committerkdx <kikoodx@paranoici.org>2024-03-15 17:41:01 +0100
commitd2c10b2e05d567c34c071e8845d23a8f9a0b50d3 (patch)
tree32d7f011dfe23c1bf785e4a76a848e3b57adfca7
parent4f63c6b7ff2de61fd08fbc7c6d73ceda11dfeb2f (diff)
downloadmaximalistmanifesto-d2c10b2e05d567c34c071e8845d23a8f9a0b50d3.tar.gz
fix colors
-rw-r--r--map/0.tmj6
-rwxr-xr-xrun.sh2
-rw-r--r--src/_color.c1
-rw-r--r--src/color.c8
-rw-r--r--src/entity.c2
-rw-r--r--src/trigger.c8
6 files changed, 17 insertions, 10 deletions
diff --git a/map/0.tmj b/map/0.tmj
index 6cfb8a8..f79e360 100644
--- a/map/0.tmj
+++ b/map/0.tmj
@@ -790,6 +790,12 @@
"name":"color",
"type":"color",
"value":"#ff00eaff"
+ },
+ {
+ "name":"color group",
+ "propertytype":"ColorGroup",
+ "type":"int",
+ "value":0
}],
"rotation":0,
"type":"color",
diff --git a/run.sh b/run.sh
index ef1d4c0..4b17e92 100755
--- a/run.sh
+++ b/run.sh
@@ -1,2 +1,2 @@
#!/bin/sh
-tup build-default && gamescope -Fpixel -w480 -h360 -- ./build-default/build/nulltopos .
+tup build-default && gamescope -Fpixel -w480 -h360 -- ./build-default/build/nulltopos . && killall nulltopos -9
diff --git a/src/_color.c b/src/_color.c
index a7573fe..2f3c7cf 100644
--- a/src/_color.c
+++ b/src/_color.c
@@ -11,6 +11,7 @@ void setbgcolor(float r, float g, float b) {
_br = r;
_bg = g;
_bb = b;
+ plog("%f %f %f", _br, _bg, _bb);
}
void fgcolor() {
diff --git a/src/color.c b/src/color.c
index 8f5b71b..67c3fb8 100644
--- a/src/color.c
+++ b/src/color.c
@@ -3,9 +3,9 @@ PARENT(trigger);
IMPL(enter) {
if (this->color_group)
- setfgcolor(1. / 255. * this->color.r, 1. / 255. * this->color.g,
- 1. / 255. * this->color.b);
+ setfgcolor(this->color.r / 255., this->color.g / 255.,
+ this->color.b / 255.);
else
- setbgcolor(1. / 255. * this->color.r, 1. / 255. * this->color.g,
- 1. / 255. * this->color.b);
+ setbgcolor(this->color.r / 255., this->color.g / 255.,
+ this->color.b / 255.);
}
diff --git a/src/entity.c b/src/entity.c
index 5f81cda..8076a86 100644
--- a/src/entity.c
+++ b/src/entity.c
@@ -245,5 +245,5 @@ const char *entity_propertyc(Entity *this, const char *property) {
return e->valuestring;
}
}
- return "#000000ff";
+ return "#ff000000";
}
diff --git a/src/trigger.c b/src/trigger.c
index 987b7f9..7790d9d 100644
--- a/src/trigger.c
+++ b/src/trigger.c
@@ -17,10 +17,10 @@ INIT {
const auto color = propertyc("color");
if (color != nullptr && strlen(color) > 8) {
- this->color.r = strtobyte(color + 1);
- this->color.g = strtobyte(color + 3);
- this->color.b = strtobyte(color + 5);
- this->color.a = strtobyte(color + 7);
+ this->color.r = strtobyte(color + 3);
+ this->color.g = strtobyte(color + 5);
+ this->color.b = strtobyte(color + 7);
+ this->color.a = strtobyte(color + 1);
} else {
this->color.r = 0;
this->color.g = 0;