diff --git a/src/gl/renderer/gl_colormap.h b/src/gl/renderer/gl_colormap.h index 2122b1248..d66950309 100644 --- a/src/gl/renderer/gl_colormap.h +++ b/src/gl/renderer/gl_colormap.h @@ -75,5 +75,4 @@ struct FColormap }; - #endif diff --git a/src/r_data/colormaps.cpp b/src/r_data/colormaps.cpp index ffaaa38ac..3bfc89b4b 100644 --- a/src/r_data/colormaps.cpp +++ b/src/r_data/colormaps.cpp @@ -71,7 +71,7 @@ struct FakeCmap }; TArray fakecmaps; -FColormap realcolormaps; +FSWColormap realcolormaps; size_t numfakecmaps; diff --git a/src/r_data/colormaps.h b/src/r_data/colormaps.h index bda6a5ea4..039a85189 100644 --- a/src/r_data/colormaps.h +++ b/src/r_data/colormaps.h @@ -9,10 +9,10 @@ void R_DeinitColormaps (); DWORD R_ColormapNumForName(const char *name); // killough 4/4/98 void R_SetDefaultColormap (const char *name); // [RH] change normal fadetable DWORD R_BlendForColormap (DWORD map); // [RH] return calculated blend for a colormap -extern FColormap realcolormaps; // [RH] make the colormaps externally visible +extern FSWColormap realcolormaps; // [RH] make the colormaps externally visible extern size_t numfakecmaps; -struct FColormap +struct FSWColormap { BYTE *Maps = nullptr; PalEntry Color = 0xffffffff; @@ -20,7 +20,7 @@ struct FColormap int Desaturate = 0; }; -struct FDynamicColormap : FColormap +struct FDynamicColormap : FSWColormap { void ChangeFade (PalEntry fadecolor); void ChangeColor (PalEntry lightcolor, int desaturate); @@ -47,7 +47,7 @@ enum }; -struct FSpecialColormap : FColormap +struct FSpecialColormap : FSWColormap { FSpecialColormap() { diff --git a/src/r_defs.h b/src/r_defs.h index f4bfbcdcf..7d7ad7eab 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -1509,13 +1509,13 @@ struct FMiniBSP // typedef BYTE lighttable_t; // This could be wider for >8 bit display. -struct FColormap; +struct FSWColormap; // This encapsulates the fields of vissprite_t that can be altered by AlterWeaponSprite struct visstyle_t { int ColormapNum; // Which colormap is rendered - FColormap *BaseColormap; // Base colormap used together with ColormapNum + FSWColormap *BaseColormap; // Base colormap used together with ColormapNum float Alpha; FRenderStyle RenderStyle; }; diff --git a/src/r_draw.cpp b/src/r_draw.cpp index 682ed4668..f255352f5 100644 --- a/src/r_draw.cpp +++ b/src/r_draw.cpp @@ -100,7 +100,7 @@ void (*R_DrawFogBoundary)(int x1, int x2, short *uclip, short *dclip); void (*R_MapTiltedPlane)(int y, int x1); void (*R_MapColoredPlane)(int y, int x1); void (*R_DrawParticle)(vissprite_t *); -void (*R_SetupDrawSlab)(FColormap *base_colormap, float light, int shade); +void (*R_SetupDrawSlab)(FSWColormap *base_colormap, float light, int shade); void (*R_DrawSlab)(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p); fixed_t (*tmvline1_add)(); void (*tmvline4_add)(); @@ -146,7 +146,7 @@ extern "C" { int dc_pitch=0xABadCafe; // [RH] Distance between rows lighttable_t* dc_colormap; -FColormap *dc_fcolormap; +FSWColormap *dc_fcolormap; ShadeConstants dc_shade_constants; fixed_t dc_light; int dc_x; @@ -1032,7 +1032,7 @@ int ds_y; int ds_x1; int ds_x2; -FColormap* ds_fcolormap; +FSWColormap* ds_fcolormap; lighttable_t* ds_colormap; ShadeConstants ds_shade_constants; dsfixed_t ds_light; @@ -2413,10 +2413,10 @@ void R_InitColumnDrawers () R_DrawParticle = R_DrawParticle_C; #ifdef X86_ASM - R_SetupDrawSlab = [](FColormap *colormap, float light, int shade) { R_SetupDrawSlabA(colormap->Maps + (GETPALOOKUP(light, shade) << COLORMAPSHIFT)); }; + R_SetupDrawSlab = [](FSWColormap *colormap, float light, int shade) { R_SetupDrawSlabA(colormap->Maps + (GETPALOOKUP(light, shade) << COLORMAPSHIFT)); }; R_DrawSlab = R_DrawSlabA; #else - R_SetupDrawSlab = [](FColormap *colormap, float light, int shade) { R_SetupDrawSlabC(colormap->Maps + (GETPALOOKUP(light, shade) << COLORMAPSHIFT)); }; + R_SetupDrawSlab = [](FSWColormap *colormap, float light, int shade) { R_SetupDrawSlabC(colormap->Maps + (GETPALOOKUP(light, shade) << COLORMAPSHIFT)); }; R_DrawSlab = R_DrawSlabC; #endif @@ -2806,7 +2806,7 @@ void R_SetTranslationMap(lighttable_t *translation) } } -void R_SetColorMapLight(FColormap *base_colormap, float light, int shade) +void R_SetColorMapLight(FSWColormap *base_colormap, float light, int shade) { dc_fcolormap = base_colormap; if (r_swtruecolor) @@ -2830,7 +2830,7 @@ void R_SetColorMapLight(FColormap *base_colormap, float light, int shade) } } -void R_SetDSColorMapLight(FColormap *base_colormap, float light, int shade) +void R_SetDSColorMapLight(FSWColormap *base_colormap, float light, int shade) { ds_fcolormap = base_colormap; if (r_swtruecolor) diff --git a/src/r_draw.h b/src/r_draw.h index 591ae0b5f..204f2a493 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -31,7 +31,7 @@ extern "C" int fuzzoffset[FUZZTABLE + 1]; // [RH] +1 for the assembly routine extern "C" int fuzzpos; extern "C" int fuzzviewheight; -struct FColormap; +struct FSWColormap; struct ShadeConstants { @@ -52,7 +52,7 @@ extern "C" int ylookup[MAXHEIGHT]; extern "C" int dc_pitch; // [RH] Distance between rows extern "C" lighttable_t*dc_colormap; -extern "C" FColormap *dc_fcolormap; +extern "C" FSWColormap *dc_fcolormap; extern "C" ShadeConstants dc_shade_constants; extern "C" fixed_t dc_light; extern "C" int dc_x; @@ -288,7 +288,7 @@ void R_FillColumnP_C (void); void R_FillColumnHorizP_C (void); void R_FillSpan_C (void); -extern void(*R_SetupDrawSlab)(FColormap *base_colormap, float light, int shade); +extern void(*R_SetupDrawSlab)(FSWColormap *base_colormap, float light, int shade); extern void(*R_DrawSlab)(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p); #ifdef X86_ASM @@ -303,7 +303,7 @@ extern "C" int ds_y; extern "C" int ds_x1; extern "C" int ds_x2; -extern "C" FColormap* ds_fcolormap; +extern "C" FSWColormap* ds_fcolormap; extern "C" lighttable_t* ds_colormap; extern "C" ShadeConstants ds_shade_constants; extern "C" dsfixed_t ds_light; @@ -374,10 +374,10 @@ void maskwallscan (int x1, int x2, short *uwal, short *dwal, float *swal, fixed_ void transmaskwallscan (int x1, int x2, short *uwal, short *dwal, float *swal, fixed_t *lwal, double yrepeat, const BYTE *(*getcol)(FTexture *tex, int col)=R_GetColumn); // Sets dc_colormap and dc_light to their appropriate values depending on the output format (pal vs true color) -void R_SetColorMapLight(FColormap *base_colormap, float light, int shade); +void R_SetColorMapLight(FSWColormap *base_colormap, float light, int shade); // Same as R_SetColorMapLight, but for ds_colormap and ds_light -void R_SetDSColorMapLight(FColormap *base_colormap, float light, int shade); +void R_SetDSColorMapLight(FSWColormap *base_colormap, float light, int shade); void R_SetTranslationMap(lighttable_t *translation); diff --git a/src/r_draw_rgba.cpp b/src/r_draw_rgba.cpp index 69ebfeb84..0d86ead47 100644 --- a/src/r_draw_rgba.cpp +++ b/src/r_draw_rgba.cpp @@ -2751,7 +2751,7 @@ static ShadeConstants slab_rgba_shade_constants; static const BYTE *slab_rgba_colormap; static fixed_t slab_rgba_light; -void R_SetupDrawSlab_rgba(FColormap *base_colormap, float light, int shade) +void R_SetupDrawSlab_rgba(FSWColormap *base_colormap, float light, int shade) { slab_rgba_shade_constants.light_red = base_colormap->Color.r * 256 / 255; slab_rgba_shade_constants.light_green = base_colormap->Color.g * 256 / 255; diff --git a/src/r_draw_rgba.h b/src/r_draw_rgba.h index ca54f7263..df3d0f233 100644 --- a/src/r_draw_rgba.h +++ b/src/r_draw_rgba.h @@ -97,7 +97,7 @@ void R_FillSpan_rgba(); void R_DrawTiltedSpan_rgba(int y, int x1, int x2, const FVector3 &plane_sz, const FVector3 &plane_su, const FVector3 &plane_sv, bool plane_shade, int planeshade, float planelightfloat, fixed_t pviewx, fixed_t pviewy); void R_DrawColoredSpan_rgba(int y, int x1, int x2); -void R_SetupDrawSlab_rgba(FColormap *base_colormap, float light, int shade); +void R_SetupDrawSlab_rgba(FSWColormap *base_colormap, float light, int shade); void R_DrawSlab_rgba(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p); void R_DrawFogBoundary_rgba(int x1, int x2, short *uclip, short *dclip); diff --git a/src/r_main.cpp b/src/r_main.cpp index 5ff80b101..ba02a7c60 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -120,7 +120,7 @@ double FocalLengthX; double FocalLengthY; FDynamicColormap*basecolormap; // [RH] colormap currently drawing with int fixedlightlev; -FColormap *fixedcolormap; +FSWColormap *fixedcolormap; FSpecialColormap *realfixedcolormap; double WallTMapScale2; diff --git a/src/r_main.h b/src/r_main.h index fa8fe0bb1..8d1867526 100644 --- a/src/r_main.h +++ b/src/r_main.h @@ -106,7 +106,7 @@ extern double r_SpriteVisibility; extern int r_actualextralight; extern bool foggy; extern int fixedlightlev; -extern FColormap* fixedcolormap; +extern FSWColormap* fixedcolormap; extern FSpecialColormap*realfixedcolormap; diff --git a/src/r_swrenderer.cpp b/src/r_swrenderer.cpp index 034275101..9bc8e4b96 100644 --- a/src/r_swrenderer.cpp +++ b/src/r_swrenderer.cpp @@ -340,7 +340,7 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin // curse Doom's overuse of global variables in the renderer. // These get clobbered by rendering to a camera texture but they need to be preserved so the final rendering can be done with the correct palette. - FColormap *savecolormap = fixedcolormap; + FSWColormap *savecolormap = fixedcolormap; FSpecialColormap *savecm = realfixedcolormap; DAngle savedfov = FieldOfView; diff --git a/src/r_things.cpp b/src/r_things.cpp index 013fc7152..6f1fb2700 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -1481,7 +1481,7 @@ void R_DrawPSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double if (camera->Inventory != nullptr) { BYTE oldcolormapnum = vis->Style.ColormapNum; - FColormap *oldcolormap = vis->Style.BaseColormap; + FSWColormap *oldcolormap = vis->Style.BaseColormap; camera->Inventory->AlterWeaponSprite (&vis->Style); if (vis->Style.BaseColormap != oldcolormap || vis->Style.ColormapNum != oldcolormapnum) { @@ -1960,7 +1960,7 @@ void R_DrawSprite (vissprite_t *spr) int r1, r2; short topclip, botclip; short *clip1, *clip2; - FColormap *colormap = spr->Style.BaseColormap; + FSWColormap *colormap = spr->Style.BaseColormap; int colormapnum = spr->Style.ColormapNum; F3DFloor *rover; FDynamicColormap *mybasecolormap; @@ -2486,7 +2486,7 @@ void R_ProjectParticle (particle_t *particle, const sector_t *sector, int shade, int x1, x2, y1, y2; vissprite_t* vis; sector_t* heightsec = NULL; - FColormap* map; + FSWColormap* map; // [ZZ] Particle not visible through the portal plane if (CurrentPortal && !!P_PointOnLineSide(particle->Pos, CurrentPortal->dst)) @@ -2785,7 +2785,7 @@ extern double BaseYaspectMul;; void R_DrawVoxel(const FVector3 &globalpos, FAngle viewangle, const FVector3 &dasprpos, DAngle dasprang, fixed_t daxscale, fixed_t dayscale, FVoxel *voxobj, - FColormap *colormap, int colormapnum, short *daumost, short *dadmost, int minslabz, int maxslabz, int flags) + FSWColormap *colormap, int colormapnum, short *daumost, short *dadmost, int minslabz, int maxslabz, int flags) { int i, j, k, x, y, syoff, ggxstart, ggystart, nxoff; fixed_t cosang, sinang, sprcosang, sprsinang; diff --git a/src/r_things.h b/src/r_things.h index 13f89574b..cbe34015f 100644 --- a/src/r_things.h +++ b/src/r_things.h @@ -144,7 +144,7 @@ enum { DVF_OFFSCREEN = 1, DVF_SPANSONLY = 2, DVF_MIRRORED = 4 }; void R_DrawVoxel(const FVector3 &viewpos, FAngle viewangle, const FVector3 &sprpos, DAngle dasprang, fixed_t daxscale, fixed_t dayscale, struct FVoxel *voxobj, - FColormap *colormap, int colormapnum, short *daumost, short *dadmost, int minslabz, int maxslabz, int flags); + FSWColormap *colormap, int colormapnum, short *daumost, short *dadmost, int minslabz, int maxslabz, int flags); void R_ClipVisSprite (vissprite_t *vis, int xl, int xh); diff --git a/src/win32/win32gliface.cpp b/src/win32/win32gliface.cpp index 7ca001e1e..59ef471d3 100644 --- a/src/win32/win32gliface.cpp +++ b/src/win32/win32gliface.cpp @@ -346,7 +346,8 @@ bool Win32GLVideo::GoFullscreen(bool yes) // //========================================================================== -DFrameBuffer *Win32GLVideo::CreateFrameBuffer(int width, int height, bool fs, DFrameBuffer *old) + +DFrameBuffer *Win32GLVideo::CreateFrameBuffer(int width, int height, bool bgra, bool fs, DFrameBuffer *old) { Win32GLFrameBuffer *fb; @@ -860,7 +861,7 @@ IMPLEMENT_ABSTRACT_CLASS(Win32GLFrameBuffer) // //========================================================================== -Win32GLFrameBuffer::Win32GLFrameBuffer(void *hMonitor, int width, int height, int bits, int refreshHz, bool fullscreen) : BaseWinFB(width, height) +Win32GLFrameBuffer::Win32GLFrameBuffer(void *hMonitor, int width, int height, int bits, int refreshHz, bool fullscreen) : BaseWinFB(width, height, false) { m_Width = width; m_Height = height; diff --git a/src/win32/win32gliface.h b/src/win32/win32gliface.h index 6320e2903..87eb10de6 100644 --- a/src/win32/win32gliface.h +++ b/src/win32/win32gliface.h @@ -38,7 +38,7 @@ public: void StartModeIterator (int bits, bool fs); bool NextMode (int *width, int *height, bool *letterbox); bool GoFullscreen(bool yes); - DFrameBuffer *CreateFrameBuffer (int width, int height, bool fs, DFrameBuffer *old); + DFrameBuffer *CreateFrameBuffer (int width, int height, bool bgra, bool fs, DFrameBuffer *old); virtual bool SetResolution (int width, int height, int bits); void DumpAdapters(); bool InitHardware (HWND Window, int multisample);