// SONIC ROBO BLAST 2 //----------------------------------------------------------------------------- // Copyright (C) 1993-1996 by id Software, Inc. // Copyright (C) 1998-2000 by DooM Legacy Team. // Copyright (C) 1999-2021 by Sonic Team Junior. // // This program is free software distributed under the // terms of the GNU General Public License, version 2. // See the 'LICENSE' file for more details. //----------------------------------------------------------------------------- /// \file v_video.h /// \brief Gamma correction LUT #ifndef __V_VIDEO__ #define __V_VIDEO__ #include "doomdef.h" #include "doomtype.h" #include "r_defs.h" // // VIDEO // // Screen 0 is the screen updated by I_Update screen. // Screen 1 is an extra buffer. extern UINT8 *screens[5]; extern consvar_t cv_ticrate, cv_constextsize, cv_globalgamma, cv_globalsaturation, cv_rhue, cv_yhue, cv_ghue, cv_chue, cv_bhue, cv_mhue, cv_rgamma, cv_ygamma, cv_ggamma, cv_cgamma, cv_bgamma, cv_mgamma, cv_rsaturation, cv_ysaturation, cv_gsaturation, cv_csaturation, cv_bsaturation, cv_msaturation; // Allocates buffer screens, call before R_Init. void V_Init(void); // Recalculates the viddef (dupx, dupy, etc.) according to the current screen resolution. void V_Recalc(void); // Color look-up table #define CLUTINDEX(r, g, b) (((r) >> 3) << 11) | (((g) >> 2) << 5) | ((b) >> 3) typedef struct { boolean init; RGBA_t palette[256]; UINT16 table[0xFFFF]; } colorlookup_t; void InitColorLUT(colorlookup_t *lut, RGBA_t *palette, boolean makecolors); UINT8 GetColorLUT(colorlookup_t *lut, UINT8 r, UINT8 g, UINT8 b); UINT8 GetColorLUTDirect(colorlookup_t *lut, UINT8 r, UINT8 g, UINT8 b); // Set the current RGB palette lookup to use for palettized graphics void V_SetPalette(INT32 palettenum); void V_SetPaletteLump(const char *pal); const char *R_GetPalname(UINT16 num); const char *GetPalette(void); extern RGBA_t *pLocalPalette; extern RGBA_t *pMasterPalette; void V_CubeApply(UINT8 *red, UINT8 *green, UINT8 *blue); // Retrieve the ARGB value from a palette color index #define V_GetColor(color) (pLocalPalette[color&0xFF]) #define V_GetMasterColor(color) (pMasterPalette[color&0xFF]) // Bottom 8 bits are used for parameter (screen or character) #define V_PARAMMASK 0x000000FF // flags hacked in scrn (not supported by all functions (see src)) // patch scaling uses bits 9 and 10 #define V_SCALEPATCHSHIFT 8 #define V_SCALEPATCHMASK 0x00000300 #define V_NOSCALEPATCH 0x00000100 #define V_SMALLSCALEPATCH 0x00000200 #define V_MEDSCALEPATCH 0x00000300 // string spacing uses bits 11 and 12 #define V_SPACINGMASK 0x00000C00 #define V_6WIDTHSPACE 0x00000400 // early 2.1 style spacing, variable widths, 6 character space #define V_OLDSPACING 0x00000800 // Old style spacing, 8 per character 4 per space #define V_MONOSPACE 0x00000C00 // Don't do width checks on characters, all characters 8 width // use bits 13-16 for colors // though we only have 7 colors now, perhaps we can introduce // more as needed later #define V_CHARCOLORSHIFT 12 #define V_CHARCOLORMASK 0x0000F000 // for simplicity's sake, shortcuts to specific colors #define V_MAGENTAMAP 0x00001000 #define V_YELLOWMAP 0x00002000 #define V_GREENMAP 0x00003000 #define V_BLUEMAP 0x00004000 #define V_REDMAP 0x00005000 #define V_GRAYMAP 0x00006000 #define V_ORANGEMAP 0x00007000 #define V_SKYMAP 0x00008000 #define V_PURPLEMAP 0x00009000 #define V_AQUAMAP 0x0000A000 #define V_PERIDOTMAP 0x0000B000 #define V_AZUREMAP 0x0000C000 #define V_BROWNMAP 0x0000D000 #define V_ROSYMAP 0x0000E000 #define V_INVERTMAP 0x0000F000 // use bits 17-20 for alpha transparency #define V_ALPHASHIFT 16 #define V_ALPHAMASK 0x000F0000 // define specific translucencies #define V_10TRANS 0x00010000 #define V_20TRANS 0x00020000 #define V_30TRANS 0x00030000 #define V_40TRANS 0x00040000 #define V_TRANSLUCENT 0x00050000 // TRANS50 #define V_60TRANS 0x00060000 #define V_70TRANS 0x00070000 #define V_80TRANS 0x00080000 // used to be V_8020TRANS #define V_90TRANS 0x00090000 #define V_HUDTRANSHALF 0x000D0000 #define V_HUDTRANS 0x000E0000 // draw the hud translucent #define V_HUDTRANSDOUBLE 0x000F0000 // Macros follow #define V_USERHUDTRANSHALF ((10-(cv_translucenthud.value/2))<