- const-ified the palette pointers in the texture creation code.

- fixed includes.
This commit is contained in:
Christoph Oelckers 2020-04-11 19:08:22 +02:00
parent 65f15e1147
commit d586ffa79c
32 changed files with 37 additions and 37 deletions

View file

@ -573,7 +573,7 @@ class FPNGFileTexture : public FTexture
{
public:
FPNGFileTexture (FileReader &lump, int width, int height, uint8_t colortype);
virtual FBitmap GetBgraBitmap(PalEntry *remap, int *trans);
virtual FBitmap GetBgraBitmap(const PalEntry *remap, int *trans);
protected:
@ -631,7 +631,7 @@ FPNGFileTexture::FPNGFileTexture (FileReader &lump, int width, int height, uint8
//
//===========================================================================
FBitmap FPNGFileTexture::GetBgraBitmap(PalEntry *remap, int *trans)
FBitmap FPNGFileTexture::GetBgraBitmap(const PalEntry *remap, int *trans)
{
FBitmap bmp;
// Parse pre-IDAT chunks. I skip the CRCs. Is that bad?

View file

@ -182,7 +182,7 @@ int FImageSource::CopyPixels(FBitmap *bmp, int conversion)
return 0;
}
int FImageSource::CopyTranslatedPixels(FBitmap *bmp, PalEntry *remap)
int FImageSource::CopyTranslatedPixels(FBitmap *bmp, const PalEntry *remap)
{
auto ppix = CreatePalettedPixels(false);
bmp->CopyPixelData(0, 0, ppix.Data(), Width, Height, Height, 1, 0, remap, nullptr);
@ -195,7 +195,7 @@ int FImageSource::CopyTranslatedPixels(FBitmap *bmp, PalEntry *remap)
//
//==========================================================================
FBitmap FImageSource::GetCachedBitmap(PalEntry *remap, int conversion, int *ptrans)
FBitmap FImageSource::GetCachedBitmap(const PalEntry *remap, int conversion, int *ptrans)
{
FBitmap ret;

View file

@ -53,7 +53,7 @@ protected:
virtual TArray<uint8_t> CreatePalettedPixels(int conversion);
virtual int CopyPixels(FBitmap *bmp, int conversion); // This will always ignore 'luminance'.
int CopyTranslatedPixels(FBitmap *bmp, PalEntry *remap);
int CopyTranslatedPixels(FBitmap *bmp, const PalEntry *remap);
public:
@ -86,7 +86,7 @@ public:
// Unlile for paletted images there is no variant here that returns a persistent bitmap, because all users have to process the returned image into another format.
FBitmap GetCachedBitmap(PalEntry *remap, int conversion, int *trans = nullptr);
FBitmap GetCachedBitmap(const PalEntry *remap, int conversion, int *trans = nullptr);
static void ClearImages() { ImageArena.FreeAll(); ImageForLump.Clear(); NextID = 0; }
static FImageSource * GetImage(int lumpnum, bool checkflat);

View file

@ -73,7 +73,7 @@ FImageTexture::FImageTexture(FImageSource *img, const char *name) noexcept
//
//===========================================================================
FBitmap FImageTexture::GetBgraBitmap(PalEntry *p, int *trans)
FBitmap FImageTexture::GetBgraBitmap(const PalEntry *p, int *trans)
{
return mImage->GetCachedBitmap(p, bNoRemap0? FImageSource::noremap0 : FImageSource::normal, trans);
}

View file

@ -68,7 +68,7 @@ TArray<uint8_t> FSkyBox::Get8BitPixels(bool alphatex)
//
//-----------------------------------------------------------------------------
FBitmap FSkyBox::GetBgraBitmap(PalEntry *p, int *trans)
FBitmap FSkyBox::GetBgraBitmap(const PalEntry *p, int *trans)
{
return previous->GetBgraBitmap(p, trans);
}

View file

@ -18,7 +18,7 @@ public:
FSkyBox(const char *name);
TArray<uint8_t> Get8BitPixels(bool alphatex);
FBitmap GetBgraBitmap(PalEntry *, int *trans) override;
FBitmap GetBgraBitmap(const PalEntry *, int *trans) override;
FImageSource *GetImage() const override;

View file

@ -175,7 +175,7 @@ FTexture::~FTexture ()
//
//===========================================================================
FBitmap FTexture::GetBgraBitmap(PalEntry *remap, int *ptrans)
FBitmap FTexture::GetBgraBitmap(const PalEntry *remap, int *ptrans)
{
FBitmap bmp;
bmp.Create(Width, Height);

View file

@ -312,7 +312,7 @@ public:
// Returns the whole texture, stored in column-major order
virtual TArray<uint8_t> Get8BitPixels(bool alphatex);
virtual FBitmap GetBgraBitmap(PalEntry *remap, int *trans = nullptr);
virtual FBitmap GetBgraBitmap(const PalEntry *remap, int *trans = nullptr);
static bool SmoothEdges(unsigned char * buffer,int w, int h);
static PalEntry averageColor(const uint32_t *data, int size, int maxout);
@ -514,7 +514,7 @@ public:
}
FImageSource* GetImage() const override { return mImage; }
FBitmap GetBgraBitmap(PalEntry* p, int* trans) override;
FBitmap GetBgraBitmap(const PalEntry* p, int* trans) override;
};

View file

@ -46,7 +46,7 @@
#include "v_video.h"
#include "skyboxtexture.h"
#include "hwrenderer/postprocessing/hw_postprocessshader.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "texturemanager.h"
void AddLightDefaults(FLightDefaults *defaults, double attnFactor);

View file

@ -28,7 +28,7 @@
#include "f_wipe.h"
#include "templates.h"
#include "textures/bitmap.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
class FBurnTexture : public FTexture
{
@ -41,7 +41,7 @@ public:
Height = h;
}
FBitmap GetBgraBitmap(PalEntry*, int *trans) override
FBitmap GetBgraBitmap(const PalEntry*, int *trans) override
{
FBitmap bmp;
bmp.Create(Width, Height);

View file

@ -28,7 +28,7 @@
#include "matrix.h"
#include "hwrenderer/scene//hw_drawstructs.h"
#include "hwrenderer/scene//hw_renderstate.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "c_cvars.h"
#include "r_defs.h"
#include "r_data/r_translate.h"

View file

@ -31,7 +31,7 @@
#include "c_cvars.h"
#include "doomtype.h"
#include "r_data/colormaps.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "gl_load/gl_interface.h"
#include "hwrenderer/utility/hw_cvars.h"

View file

@ -28,7 +28,7 @@
#include "gl/system/gl_debug.h"
#include "gl/renderer/gl_renderer.h"
#include "gl_samplers.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
namespace OpenGLRenderer
{

View file

@ -35,7 +35,7 @@
#include "g_levellocals.h"
#include "i_time.h"
#include "cmdlib.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hwrenderer/data/buffers.h"
#include "hwrenderer/data/flatvertices.h"
#include "hwrenderer/scene/hw_drawinfo.h"

View file

@ -29,7 +29,7 @@
#include "a_sharedglobal.h"
#include "r_utility.h"
#include "g_levellocals.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hwrenderer/utility/hw_cvars.h"
#include "hwrenderer/scene/hw_drawstructs.h"
#include "hwrenderer/scene/hw_drawinfo.h"

View file

@ -25,7 +25,7 @@
#include "hwrenderer/dynlights/hw_lightbuffer.h"
#include "hwrenderer/scene/hw_drawstructs.h"
#include "hwrenderer/scene/hw_drawinfo.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
EXTERN_CVAR(Bool, gl_seamless)

View file

@ -39,7 +39,7 @@
#include "hwrenderer/utility/hw_cvars.h"
#include "hwrenderer/utility/hw_clock.h"
#include "hwrenderer/utility/hw_lighting.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hwrenderer/scene/hw_drawinfo.h"
#include "hwrenderer/data/flatvertices.h"
#include "hwrenderer/dynlights/hw_lightbuffer.h"

View file

@ -6,7 +6,7 @@
#include "hwrenderer/scene/hw_drawinfo.h"
#include "hwrenderer/scene/hw_drawstructs.h"
#include "hw_renderstate.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
struct HWSkyInfo

View file

@ -6,7 +6,7 @@
#include "hw_drawstructs.h"
#include "hw_drawlist.h"
#include "matrix.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
struct FColormap;
class IVertexBuffer;

View file

@ -32,7 +32,7 @@
#include "hwrenderer/scene/hw_drawstructs.h"
#include "hwrenderer/scene/hw_portal.h"
#include "hwrenderer/utility/hw_lighting.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
CVAR(Bool,gl_noskyboxes, false, 0)

View file

@ -63,7 +63,7 @@
#include "cmdlib.h"
#include "skyboxtexture.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hw_skydome.h"
#include "hw_renderstate.h"
#include "hw_drawinfo.h"

View file

@ -52,7 +52,7 @@
#include "hwrenderer/utility/hw_cvars.h"
#include "hwrenderer/utility/hw_clock.h"
#include "hwrenderer/utility/hw_lighting.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hwrenderer/dynlights/hw_dynlightdata.h"
#include "hwrenderer/dynlights/hw_lightbuffer.h"
#include "hw_renderstate.h"

View file

@ -32,7 +32,7 @@
#include "actorinlines.h"
#include "texturemanager.h"
#include "hwrenderer/dynlights/hw_dynlightdata.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hwrenderer/utility/hw_cvars.h"
#include "hwrenderer/utility/hw_clock.h"
#include "hwrenderer/utility/hw_lighting.h"

View file

@ -38,7 +38,7 @@
#include "hwrenderer/models/hw_models.h"
#include "hwrenderer/dynlights/hw_dynlightdata.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hwrenderer/utility/hw_lighting.h"
#include "hwrenderer/utility/hw_cvars.h"
#include "hwrenderer/scene/hw_drawinfo.h"

View file

@ -32,7 +32,7 @@
#include "actor.h"
#include "r_data/models/models.h"
#include "skyboxtexture.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "image.h"
#include "v_video.h"
#include "v_font.h"

View file

@ -25,7 +25,7 @@
#include "c_dispatch.h"
#include "v_video.h"
#include "hw_cvars.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "menu/menu.h"
#include "texturemanager.h"

View file

@ -23,7 +23,7 @@
#include "templates.h"
#include "c_cvars.h"
#include "r_data/colormaps.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hwrenderer/utility/hw_cvars.h"
#include "hwrenderer/scene/hw_renderstate.h"
#include "poly_framebuffer.h"

View file

@ -8,7 +8,7 @@
#include "hwrenderer/scene/hw_drawstructs.h"
#include "hwrenderer/scene/hw_renderstate.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
struct HWViewpointUniforms;

View file

@ -26,7 +26,7 @@
*/
#include "hw_ihwtexture.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "swrenderer/r_renderer.h"
#include "r_swscene.h"
#include "filesystem.h"

View file

@ -10,7 +10,7 @@
#include "hwrenderer/scene/hw_drawstructs.h"
#include "hwrenderer/scene/hw_renderstate.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
class VkRenderPassSetup;
class VkTextureImage;

View file

@ -23,7 +23,7 @@
#include "templates.h"
#include "c_cvars.h"
#include "r_data/colormaps.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
#include "hwrenderer/utility/hw_cvars.h"
#include "hwrenderer/scene/hw_renderstate.h"
#include "vulkan/system/vk_objects.h"

View file

@ -28,7 +28,7 @@
#include "vulkan/system/vk_device.h"
#include "vulkan/system/vk_builders.h"
#include "vk_samplers.h"
#include "hwrenderer/textures/hw_material.h"
#include "hw_material.h"
struct VkTexFilter
{