From cf631e23e1d0e29edac2e13446bdd42235c111fc Mon Sep 17 00:00:00 2001 From: kartofen Date: Sat, 15 Apr 2023 18:27:29 +0300 Subject: collision and depth shading --- src/common.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/common.h') 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 #define LOG_APPLICATION SDL_LOG_CATEGORY_APPLICATION -- cgit v1.2.3