- removal of all code to handle OpenGL 2. From this commit on the main build of GZDoom will be OpenGL 3.3 or higher.
# Conflicts: # src/gl/renderer/gl_renderer.cpp # src/gl/shaders/gl_shader.cpp # src/gl/system/gl_framebuffer.cpp # src/gl_load/gl_interface.cpp
This commit is contained in:
parent
1455111ddc
commit
8ab68264c1
33 changed files with 213 additions and 2070 deletions
|
|
@ -1371,7 +1371,7 @@ unsigned char * FTexture::CreateTexBuffer(int translation, int & w, int & h, int
|
|||
int isTransparent = -1;
|
||||
|
||||
|
||||
if ((flags & CTF_CheckHires) && translation != STRange_AlphaTexture)
|
||||
if (flags & CTF_CheckHires)
|
||||
{
|
||||
buffer = LoadHiresTexture(&w, &h);
|
||||
if (buffer != nullptr)
|
||||
|
|
@ -1389,37 +1389,11 @@ unsigned char * FTexture::CreateTexBuffer(int translation, int & w, int & h, int
|
|||
|
||||
FBitmap bmp(buffer, W * 4, W, H);
|
||||
|
||||
if (translation <= 0 || translation >= STRange_Min)
|
||||
if (translation <= 0)
|
||||
{
|
||||
// Allow creation of desaturated or special-colormapped textures for the legacy renderer.
|
||||
FCopyInfo inf = { OP_COPY, BLEND_NONE,{ 0 }, 0, 0 };
|
||||
if (translation >= STRange_Desaturate && translation < STRange_Desaturate + 31) // there are 31 ranges of desaturations available
|
||||
{
|
||||
inf.blend = (EBlend)(BLEND_DESATURATE1 + translation - STRange_Desaturate);
|
||||
}
|
||||
else if (translation >= STRange_Specialcolormap && translation < STRange_Specialcolormap + (int)SpecialColormaps.Size())
|
||||
{
|
||||
inf.blend = (EBlend)(BLEND_SPECIALCOLORMAP1 + translation - STRange_Specialcolormap);
|
||||
}
|
||||
|
||||
int trans = CopyTrueColorPixels(&bmp, exx, exx, 0, translation >= STRange_Min ? &inf : nullptr);
|
||||
int trans = CopyTrueColorPixels(&bmp, exx, exx, 0, nullptr);
|
||||
CheckTrans(buffer, W*H, trans);
|
||||
isTransparent = bTranslucent;
|
||||
// alpha texture for legacy mode
|
||||
if (translation == STRange_AlphaTexture)
|
||||
{
|
||||
for (int i = 0; i < W*H; i++)
|
||||
{
|
||||
int b = buffer[4 * i];
|
||||
int g = buffer[4 * i + 1];
|
||||
int r = buffer[4 * i + 2];
|
||||
int gray = Luminance(r, g, b);
|
||||
buffer[4 * i] = 255;
|
||||
buffer[4 * i + 1] = 255;
|
||||
buffer[4 * i + 2] = 255;
|
||||
buffer[4 * i + 3] = (buffer[4 * i + 3] * gray) >> 8;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1430,26 +1404,11 @@ unsigned char * FTexture::CreateTexBuffer(int translation, int & w, int & h, int
|
|||
// This is not conclusive for setting the texture's transparency info.
|
||||
}
|
||||
|
||||
// [BB] The hqnx upsampling (not the scaleN one) destroys partial transparency, don't upsamle textures using it.
|
||||
// [BB] Potentially upsample the buffer.
|
||||
if ((flags & CTF_MaybeWarped) && bWarped && w*h <= 256 * 256) // do not software-warp larger textures, especially on the old systems that still need this fallback.
|
||||
if (flags & CTF_ProcessData)
|
||||
{
|
||||
// need to do software warping
|
||||
FWarpTexture *wt = static_cast<FWarpTexture*>(this);
|
||||
unsigned char *warpbuffer = new unsigned char[w*h * 4];
|
||||
WarpBuffer((uint32_t*)warpbuffer, (const uint32_t*)buffer, w, h, wt->WidthOffsetMultiplier, wt->HeightOffsetMultiplier, screen->FrameTime, wt->Speed, bWarped);
|
||||
delete[] buffer;
|
||||
buffer = warpbuffer;
|
||||
wt->GenTime[0] = screen->FrameTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flags & CTF_ProcessData)
|
||||
buffer = CreateUpsampledTextureBuffer(buffer, W, H, w, h, !!isTransparent);
|
||||
}
|
||||
|
||||
if (flags & CTF_ProcessData)
|
||||
buffer = CreateUpsampledTextureBuffer(buffer, W, H, w, h, !!isTransparent);
|
||||
ProcessData(buffer, w, h, false);
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue