Merge branch 'colormap-overhaul' into colormap-overhaul-fade

This commit is contained in:
mazmazz 2018-09-11 17:31:02 -04:00
commit c2e662b2c0
2 changed files with 9 additions and 2 deletions

View file

@ -1819,8 +1819,8 @@ extracolormap_t *R_CreateColormap(char *p1, char *p2, char *p3)
// Pack rgba values into combined var
// OpenGL also uses this instead of lighttables for rendering
rgba = cr + (cg << 8) + (cb << 16) + (ca << 24);
fadergba = cfr + (cfg << 8) + (cfb << 16) + (cfa << 24);
rgba = R_PutRgbaRGBA(cr, cg, cb, ca);
fadergba = R_PutRgbaRGBA(cfr, cfg, cfb, cfa);
// Did we just make a default colormap?
#ifdef EXTRACOLORMAPLUMPS

View file

@ -133,6 +133,13 @@ const char *R_NameForColormap(extracolormap_t *extra_colormap);
#define R_GetRgbaG(rgba) ((rgba >> 8) & 0xFF)
#define R_GetRgbaB(rgba) ((rgba >> 16) & 0xFF)
#define R_GetRgbaA(rgba) ((rgba >> 24) & 0xFF)
#define R_GetRgbaRGB(rgba) (rgba & 0xFFFFFF)
#define R_PutRgbaR(r) (r)
#define R_PutRgbaG(g) (g << 8)
#define R_PutRgbaB(b) (b << 16)
#define R_PutRgbaA(a) (a << 24)
#define R_PutRgbaRGB(r, g, b) (R_PutRgbaR(r) + R_PutRgbaG(g) + R_PutRgbaB(b))
#define R_PutRgbaRGBA(r, g, b, a) (R_PutRgbaRGB(r, g, b) + R_PutRgbaA(a))
extern INT32 numtextures;