mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 23:02:08 +00:00
- use the new ZDoom code for retrieving a sky's cap color to avoid redundancies.
This commit is contained in:
parent
ce80d8157b
commit
96437d95fa
3 changed files with 1 additions and 41 deletions
|
@ -167,7 +167,7 @@ void gl_GenerateGlobalBrightmapFromColormap()
|
|||
// component becomes one.
|
||||
//
|
||||
//===========================================================================
|
||||
PalEntry averageColor(const DWORD *data, int size, int maxout)
|
||||
static PalEntry averageColor(const DWORD *data, int size, int maxout)
|
||||
{
|
||||
int i;
|
||||
unsigned int r, g, b;
|
||||
|
@ -216,10 +216,7 @@ FTexture::MiscGLInfo::MiscGLInfo() throw()
|
|||
GlowColor = 0;
|
||||
GlowHeight = 128;
|
||||
bSkybox = false;
|
||||
FloorSkyColor = 0;
|
||||
CeilingSkyColor = 0;
|
||||
bFullbright = false;
|
||||
bSkyColorDone = false;
|
||||
bBrightmapChecked = false;
|
||||
bDisableFullbright = false;
|
||||
bNoFilter = false;
|
||||
|
@ -326,38 +323,6 @@ void FTexture::GetGlowColor(float *data)
|
|||
data[2]=gl_info.GlowColor.b/255.0f;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Gets the average color of a texture for use as a sky cap color
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
PalEntry FTexture::GetSkyCapColor(bool bottom)
|
||||
{
|
||||
PalEntry col;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
if (!gl_info.bSkyColorDone)
|
||||
{
|
||||
gl_info.bSkyColorDone = true;
|
||||
|
||||
unsigned char *buffer = GLRenderer->GetTextureBuffer(this, w, h);
|
||||
|
||||
if (buffer)
|
||||
{
|
||||
gl_info.CeilingSkyColor = averageColor((DWORD *) buffer, w * MIN(30, h), 0);
|
||||
if (h>30)
|
||||
{
|
||||
gl_info.FloorSkyColor = averageColor(((DWORD *) buffer)+(h-30)*w, w * 30, 0);
|
||||
}
|
||||
else gl_info.FloorSkyColor = gl_info.CeilingSkyColor;
|
||||
delete[] buffer;
|
||||
}
|
||||
}
|
||||
return bottom? gl_info.FloorSkyColor : gl_info.CeilingSkyColor;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Finds gaps in the texture which can be skipped by the renderer
|
||||
|
|
|
@ -24,7 +24,6 @@ protected:
|
|||
|
||||
|
||||
void gl_GenerateGlobalBrightmapFromColormap();
|
||||
PalEntry averageColor(const DWORD *data, int size, int maxout);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -307,8 +307,6 @@ public:
|
|||
FGLTexture *SystemTexture[2];
|
||||
FTexture *Brightmap;
|
||||
PalEntry GlowColor;
|
||||
PalEntry FloorSkyColor;
|
||||
PalEntry CeilingSkyColor;
|
||||
int GlowHeight;
|
||||
FloatRect *areas;
|
||||
int areacount;
|
||||
|
@ -318,7 +316,6 @@ public:
|
|||
bool bGlowing:1; // Texture glows
|
||||
bool bFullbright:1; // always draw fullbright
|
||||
bool bSkybox:1; // This is a skybox
|
||||
bool bSkyColorDone:1; // Fill color for sky
|
||||
char bBrightmapChecked:1; // Set to 1 if brightmap has been checked
|
||||
bool bDisableFullbright:1; // This texture will not be displayed as fullbright sprite
|
||||
bool bNoFilter:1;
|
||||
|
@ -331,7 +328,6 @@ public:
|
|||
MiscGLInfo gl_info;
|
||||
|
||||
void GetGlowColor(float *data);
|
||||
PalEntry GetSkyCapColor(bool bottom);
|
||||
bool isGlowing() { return gl_info.bGlowing; }
|
||||
bool isFullbright() { return gl_info.bFullbright; }
|
||||
void CreateDefaultBrightmap();
|
||||
|
|
Loading…
Reference in a new issue