diff options
author | kartofen <mladenovnasko0@gmail.com> | 2023-04-15 18:27:29 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2023-04-15 18:27:29 +0300 |
commit | cf631e23e1d0e29edac2e13446bdd42235c111fc (patch) | |
tree | 141f85599c7bd47b3fcb0a3088a5ce117d6e18fd /src/common.h | |
parent | 02ec17653ee5399eac67871dfd5fb193bb9dce2f (diff) |
collision and depth shading
Diffstat (limited to 'src/common.h')
-rw-r--r-- | src/common.h | 6 |
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 |