Merge branch 'master' into OverlayExtension10

This commit is contained in:
Magnus Norddahl 2016-12-27 04:32:13 +01:00 committed by GitHub
commit e91c5ac54d
931 changed files with 126568 additions and 3305 deletions

View file

@ -72,8 +72,8 @@ struct FakeCmap
};
TArray<FakeCmap> fakecmaps;
BYTE *realcolormaps;
BYTE *realfbcolormaps; //[SP] For fullbright use
FSWColormap realcolormaps;
FSWColormap realfbcolormaps; //[SP] For fullbright use
size_t numfakecmaps;
@ -410,7 +410,7 @@ void R_SetDefaultColormap (const char *name)
foo.Color = 0xFFFFFF;
foo.Fade = 0;
foo.Maps = realcolormaps;
foo.Maps = realcolormaps.Maps;
foo.Desaturate = 0;
foo.Next = NULL;
foo.BuildLights ();
@ -432,7 +432,7 @@ void R_SetDefaultColormap (const char *name)
remap[0] = 0;
for (i = 0; i < NUMCOLORMAPS; ++i)
{
BYTE *map2 = &realcolormaps[i*256];
BYTE *map2 = &realcolormaps.Maps[i*256];
lumpr.Read (map, 256);
for (j = 0; j < 256; ++j)
{
@ -456,15 +456,11 @@ void R_DeinitColormaps ()
{
SpecialColormaps.Clear();
fakecmaps.Clear();
if (realcolormaps != NULL)
delete[] realcolormaps.Maps;
if (realfbcolormaps.Maps)
{
delete[] realcolormaps;
realcolormaps = NULL;
}
if (realfbcolormaps != NULL)
{
delete[] realfbcolormaps;
realfbcolormaps = NULL;
delete[] realfbcolormaps.Maps;
realfbcolormaps.Maps = nullptr;
}
FreeSpecialLights();
}
@ -508,7 +504,7 @@ void R_InitColormaps ()
}
}
}
realcolormaps = new BYTE[256*NUMCOLORMAPS*fakecmaps.Size()];
realcolormaps.Maps = new BYTE[256*NUMCOLORMAPS*fakecmaps.Size()];
R_SetDefaultColormap ("COLORMAP");
if (fakecmaps.Size() > 1)
@ -530,7 +526,7 @@ void R_InitColormaps ()
{
int k, r, g, b;
FWadLump lump = Wads.OpenLumpNum (fakecmaps[j].lump);
BYTE *const map = realcolormaps + NUMCOLORMAPS*256*j;
BYTE *const map = realcolormaps.Maps + NUMCOLORMAPS*256*j;
for (k = 0; k < NUMCOLORMAPS; ++k)
{
@ -557,19 +553,19 @@ void R_InitColormaps ()
}
// [SP] Create a copy of the colormap
if (!realfbcolormaps)
if (!realfbcolormaps.Maps)
{
realfbcolormaps = new BYTE[256*NUMCOLORMAPS*fakecmaps.Size()];
memcpy(realfbcolormaps, realcolormaps, 256*NUMCOLORMAPS*fakecmaps.Size());
realfbcolormaps.Maps = new BYTE[256*NUMCOLORMAPS*fakecmaps.Size()];
memcpy(realfbcolormaps.Maps, realcolormaps.Maps, 256*NUMCOLORMAPS*fakecmaps.Size());
}
NormalLight.Color = PalEntry (255, 255, 255);
NormalLight.Fade = 0;
NormalLight.Maps = realcolormaps;
NormalLight.Maps = realcolormaps.Maps;
FullNormalLight.Color = PalEntry (255, 255, 255);
FullNormalLight.Fade = 0;
FullNormalLight.Maps = realfbcolormaps;
NormalLightHasFixedLights = R_CheckForFixedLights(realcolormaps);
FullNormalLight.Maps = realfbcolormaps.Maps;
NormalLightHasFixedLights = R_CheckForFixedLights(realcolormaps.Maps);
numfakecmaps = fakecmaps.Size();
// build default special maps (e.g. invulnerability)

View file

@ -1,18 +1,26 @@
#ifndef __RES_CMAP_H
#define __RES_CMAP_H
struct FSWColormap;
void R_InitColormaps ();
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 BYTE *realcolormaps; // [RH] make the colormaps externally visible
extern FSWColormap realcolormaps; // [RH] make the colormaps externally visible
extern size_t numfakecmaps;
struct FSWColormap
{
BYTE *Maps = nullptr;
PalEntry Color = 0xffffffff;
PalEntry Fade = 0xff000000;
int Desaturate = 0;
};
struct FDynamicColormap
struct FDynamicColormap : FSWColormap
{
void ChangeFade (PalEntry fadecolor);
void ChangeColor (PalEntry lightcolor, int desaturate);
@ -20,10 +28,6 @@ struct FDynamicColormap
void BuildLights ();
static void RebuildAllLights();
BYTE *Maps;
PalEntry Color;
PalEntry Fade;
int Desaturate;
FDynamicColormap *Next;
};
@ -43,8 +47,13 @@ enum
};
struct FSpecialColormap
struct FSpecialColormap : FSWColormap
{
FSpecialColormap()
{
Maps = Colormap;
}
float ColorizeStart[3];
float ColorizeEnd[3];
BYTE Colormap[256];

View file

@ -247,9 +247,9 @@ void FInterpolator::RemoveInterpolation(DInterpolation *interp)
if (interp->Prev != NULL) interp->Prev->Next = interp->Next;
if (interp->Next != NULL) interp->Next->Prev = interp->Prev;
}
interp->Next = NULL;
interp->Prev = NULL;
count--;
interp->Next = NULL;
interp->Prev = NULL;
count--;
}
//==========================================================================
@ -471,12 +471,12 @@ void DSectorPlaneInterpolation::Restore()
if (!ceiling)
{
sector->floorplane.setD(bakheight);
sector->SetPlaneTexZ(sector_t::floor, baktexz);
sector->SetPlaneTexZ(sector_t::floor, baktexz, true);
}
else
{
sector->ceilingplane.setD(bakheight);
sector->SetPlaneTexZ(sector_t::ceiling, baktexz);
sector->SetPlaneTexZ(sector_t::ceiling, baktexz, true);
}
P_RecalculateAttached3DFloors(sector);
sector->CheckPortalPlane(ceiling? sector_t::ceiling : sector_t::floor);
@ -514,8 +514,8 @@ void DSectorPlaneInterpolation::Interpolate(double smoothratio)
else
{
pplane->setD(oldheight + (bakheight - oldheight) * smoothratio);
sector->SetPlaneTexZ(pos, oldtexz + (baktexz - oldtexz) * smoothratio);
P_RecalculateAttached3DFloors(sector);
sector->SetPlaneTexZ(pos, oldtexz + (baktexz - oldtexz) * smoothratio, true);
P_RecalculateAttached3DFloors(sector);
sector->CheckPortalPlane(pos);
}
}

View file

@ -861,6 +861,15 @@ void R_InitTranslationTables ()
remap->Remap[i] = IcePaletteRemap[v];
remap->Palette[i] = PalEntry(255, IcePalette[v][0], IcePalette[v][1], IcePalette[v][2]);
}
// The alphatexture translation. Since alphatextures use the red channel this is just a standard grayscale mapping.
PushIdentityTable(TRANSLATION_Standard);
remap = translationtables[TRANSLATION_Standard][8];
for (i = 0; i < 256; i++)
{
remap->Remap[i] = i;
remap->Palette[i] = PalEntry(255, i, i, i);
}
}
//----------------------------------------------------------------------------

View file

@ -15,6 +15,8 @@
#include "r_data/voxels.h"
#include "textures/textures.h"
void gl_InitModels();
// variables used to look up
// and range check thing_t sprites patches
TArray<spritedef_t> sprites;
@ -987,6 +989,7 @@ void R_InitSprites ()
// [RH] Sort the skins, but leave base as skin 0
//qsort (&skins[PlayerClasses.Size ()], numskins-PlayerClasses.Size (), sizeof(FPlayerSkin), skinsorter);
gl_InitModels();
}
void R_DeinitSpriteData()