mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-12-24 11:40:51 +00:00
Don't apply color cube in md2_loadTexture when in palette rendering mode
Fixes brightness getting applied twice on models in palette rendering mode
This commit is contained in:
parent
bbf23a5143
commit
6c4cb3a025
1 changed files with 12 additions and 8 deletions
|
@ -387,8 +387,6 @@ static void md2_loadTexture(md2_t *model)
|
|||
if (!grPatch->mipmap->downloaded && !grPatch->mipmap->data)
|
||||
{
|
||||
int w = 0, h = 0;
|
||||
UINT32 size;
|
||||
RGBA_t *image;
|
||||
|
||||
#ifdef HAVE_PNG
|
||||
grPatch->mipmap->format = PNG_Load(filename, &w, &h, grPatch);
|
||||
|
@ -409,13 +407,19 @@ static void md2_loadTexture(md2_t *model)
|
|||
grPatch->mipmap->width = (UINT16)w;
|
||||
grPatch->mipmap->height = (UINT16)h;
|
||||
|
||||
// Lactozilla: Apply colour cube
|
||||
image = grPatch->mipmap->data;
|
||||
size = w*h;
|
||||
while (size--)
|
||||
// for palette rendering, color cube is applied in post-processing instead of here
|
||||
if (!HWR_ShouldUsePaletteRendering())
|
||||
{
|
||||
V_CubeApply(&image->s.red, &image->s.green, &image->s.blue);
|
||||
image++;
|
||||
UINT32 size;
|
||||
RGBA_t *image;
|
||||
// Lactozilla: Apply colour cube
|
||||
image = grPatch->mipmap->data;
|
||||
size = w*h;
|
||||
while (size--)
|
||||
{
|
||||
V_CubeApply(&image->s.red, &image->s.green, &image->s.blue);
|
||||
image++;
|
||||
}
|
||||
}
|
||||
}
|
||||
HWD.pfnSetTexture(grPatch->mipmap);
|
||||
|
|
Loading…
Reference in a new issue