summaryrefslogtreecommitdiff
path: root/src/common.h
diff options
context:
space:
mode:
authorkartofen <mladenovnasko0@gmail.com>2023-04-15 18:27:29 +0300
committerkartofen <mladenovnasko0@gmail.com>2023-04-15 18:27:29 +0300
commitcf631e23e1d0e29edac2e13446bdd42235c111fc (patch)
tree141f85599c7bd47b3fcb0a3088a5ce117d6e18fd /src/common.h
parent02ec17653ee5399eac67871dfd5fb193bb9dce2f (diff)
collision and depth shading
Diffstat (limited to 'src/common.h')
-rw-r--r--src/common.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common.h b/src/common.h
index 4d0df29..faaecb6 100644
--- a/src/common.h
+++ b/src/common.h
@@ -36,8 +36,14 @@ struct xyz {
#define COLOR_GREEN 0x00FF00
#define COLOR_BLUE 0x0000FF
#define COLOR_LIGHTWHITE 0xF5F5F5
+
#define color(col) (((col)>>16) & 0xFF), (((col)>>8) & 0xFF), ((col) & 0xFF)
+#define scale_color(col, z) \
+ (((((col >> 16) & 0xFF) - clamp(z, 0, 255)) << 16) | \
+ ((((col >> 8) & 0xFF) - clamp(z, 0, 255)) << 8) | \
+ ((col & 0xFF) - clamp(z, 0, 255)))
+
// macro wrapper for the sdl logging system
#include <SDL2/SDL.h>
#define LOG_APPLICATION SDL_LOG_CATEGORY_APPLICATION