- except for DWORD, all homegrown integer types are gone - a handful were left where they represent genuine Windows types.

This commit is contained in:
Christoph Oelckers 2017-03-09 19:54:41 +01:00
commit d2beacfc5f
136 changed files with 770 additions and 774 deletions

View file

@ -54,7 +54,7 @@
#include "r_utility.h"
#include "r_renderer.h"
static bool R_CheckForFixedLights(const BYTE *colormaps);
static bool R_CheckForFixedLights(const uint8_t *colormaps);
extern "C" {
@ -79,7 +79,7 @@ size_t numfakecmaps;
TArray<FSpecialColormap> SpecialColormaps;
BYTE DesaturateColormap[31][256];
uint8_t DesaturateColormap[31][256];
struct FSpecialColormapParameters
{
@ -210,7 +210,7 @@ FDynamicColormap *GetSpecialLights (PalEntry color, PalEntry fade, int desaturat
if (Renderer->UsesColormap())
{
colormap->Maps = new BYTE[NUMCOLORMAPS*256];
colormap->Maps = new uint8_t[NUMCOLORMAPS*256];
colormap->BuildLights ();
}
else colormap->Maps = NULL;
@ -248,7 +248,7 @@ void FDynamicColormap::BuildLights ()
int l, c;
int lr, lg, lb, ld, ild;
PalEntry colors[256], basecolors[256];
BYTE *shade;
uint8_t *shade;
if (Maps == NULL)
return;
@ -376,7 +376,7 @@ void FDynamicColormap::RebuildAllLights()
{
if (cm->Maps == NULL)
{
cm->Maps = new BYTE[NUMCOLORMAPS*256];
cm->Maps = new uint8_t[NUMCOLORMAPS*256];
cm->BuildLights ();
}
}
@ -394,9 +394,9 @@ void R_SetDefaultColormap (const char *name)
if (strnicmp (fakecmaps[0].name, name, 8) != 0)
{
int lump, i, j;
BYTE map[256];
BYTE unremap[256];
BYTE remap[256];
uint8_t map[256];
uint8_t unremap[256];
uint8_t remap[256];
lump = Wads.CheckNumForFullName (name, true, ns_colormaps);
if (lump == -1)
@ -432,7 +432,7 @@ void R_SetDefaultColormap (const char *name)
remap[0] = 0;
for (i = 0; i < NUMCOLORMAPS; ++i)
{
BYTE *map2 = &realcolormaps.Maps[i*256];
uint8_t *map2 = &realcolormaps.Maps[i*256];
lumpr.Read (map, 256);
for (j = 0; j < 256; ++j)
{
@ -504,12 +504,12 @@ void R_InitColormaps ()
}
}
}
realcolormaps.Maps = new BYTE[256*NUMCOLORMAPS*fakecmaps.Size()];
realcolormaps.Maps = new uint8_t[256*NUMCOLORMAPS*fakecmaps.Size()];
R_SetDefaultColormap ("COLORMAP");
if (fakecmaps.Size() > 1)
{
BYTE unremap[256], remap[256], mapin[256];
uint8_t unremap[256], remap[256], mapin[256];
int i;
unsigned j;
@ -526,11 +526,11 @@ void R_InitColormaps ()
{
int k, r, g, b;
FWadLump lump = Wads.OpenLumpNum (fakecmaps[j].lump);
BYTE *const map = realcolormaps.Maps + NUMCOLORMAPS*256*j;
uint8_t *const map = realcolormaps.Maps + NUMCOLORMAPS*256*j;
for (k = 0; k < NUMCOLORMAPS; ++k)
{
BYTE *map2 = &map[k*256];
uint8_t *map2 = &map[k*256];
lump.Read (mapin, 256);
map2[0] = 0;
for (r = 1; r < 256; ++r)
@ -555,7 +555,7 @@ void R_InitColormaps ()
// [SP] Create a copy of the colormap
if (!realfbcolormaps.Maps)
{
realfbcolormaps.Maps = new BYTE[256*NUMCOLORMAPS*fakecmaps.Size()];
realfbcolormaps.Maps = new uint8_t[256*NUMCOLORMAPS*fakecmaps.Size()];
memcpy(realfbcolormaps.Maps, realcolormaps.Maps, 256*NUMCOLORMAPS*fakecmaps.Size());
}
@ -579,7 +579,7 @@ void R_InitColormaps ()
// desaturated colormaps. These are used for texture composition
for(int m = 0; m < 31; m++)
{
BYTE *shade = DesaturateColormap[m];
uint8_t *shade = DesaturateColormap[m];
for (int c = 0; c < 256; c++)
{
int intensity = (GPalette.BaseColors[c].r * 77 +
@ -603,10 +603,10 @@ void R_InitColormaps ()
//
//==========================================================================
static bool R_CheckForFixedLights(const BYTE *colormaps)
static bool R_CheckForFixedLights(const uint8_t *colormaps)
{
const BYTE *lastcolormap = colormaps + (NUMCOLORMAPS - 1) * 256;
BYTE freq[256];
const uint8_t *lastcolormap = colormaps + (NUMCOLORMAPS - 1) * 256;
uint8_t freq[256];
int i, j;
// Count the frequencies of different colors in the final colormap.
@ -623,7 +623,7 @@ static bool R_CheckForFixedLights(const BYTE *colormaps)
// final coloramp.
for (i = 255; i >= 0; --i)
{
BYTE color = lastcolormap[i];
uint8_t color = lastcolormap[i];
if (freq[color] > 10) // arbitrary number to decide "common" colors
{
continue;

View file

@ -14,7 +14,7 @@ extern size_t numfakecmaps;
struct FSWColormap
{
BYTE *Maps = nullptr;
uint8_t *Maps = nullptr;
PalEntry Color = 0xffffffff;
PalEntry Fade = 0xff000000;
int Desaturate = 0;
@ -57,7 +57,7 @@ struct FSpecialColormap : FSWColormap
float ColorizeStart[3];
float ColorizeEnd[3];
BYTE Colormap[256];
uint8_t Colormap[256];
PalEntry GrayscaleToColor[256];
};
@ -76,7 +76,7 @@ int AddSpecialColormap(float r1, float g1, float b1, float r2, float g2, float b
extern BYTE DesaturateColormap[31][256];
extern uint8_t DesaturateColormap[31][256];
extern "C"
{
extern FDynamicColormap NormalLight;

View file

@ -91,10 +91,10 @@ struct VoxelOptions
//
//==========================================================================
static BYTE *GetVoxelRemap(const BYTE *pal)
static uint8_t *GetVoxelRemap(const uint8_t *pal)
{
static BYTE remap[256];
static BYTE oldpal[768];
static uint8_t remap[256];
static uint8_t oldpal[768];
static bool firsttime = true;
if (firsttime || memcmp(oldpal, pal, 768) != 0)
@ -142,8 +142,8 @@ static bool CopyVoxelSlabs(kvxslab_t *dest, const kvxslab_t *src, int size)
dest->col[j] = src->col[j];
}
slabzleng += 3;
src = (kvxslab_t *)((BYTE *)src + slabzleng);
dest = (kvxslab_t *)((BYTE *)dest + slabzleng);
src = (kvxslab_t *)((uint8_t *)src + slabzleng);
dest = (kvxslab_t *)((uint8_t *)dest + slabzleng);
size -= slabzleng;
}
return true;
@ -157,7 +157,7 @@ static bool CopyVoxelSlabs(kvxslab_t *dest, const kvxslab_t *src, int size)
//
//==========================================================================
static void RemapVoxelSlabs(kvxslab_t *dest, int size, const BYTE *remap)
static void RemapVoxelSlabs(kvxslab_t *dest, int size, const uint8_t *remap)
{
while (size >= 3)
{
@ -168,7 +168,7 @@ static void RemapVoxelSlabs(kvxslab_t *dest, int size, const BYTE *remap)
dest->col[j] = remap[dest->col[j]];
}
slabzleng += 3;
dest = (kvxslab_t *)((BYTE *)dest + slabzleng);
dest = (kvxslab_t *)((uint8_t *)dest + slabzleng);
size -= slabzleng;
}
}
@ -183,12 +183,12 @@ FVoxel *R_LoadKVX(int lumpnum)
{
const kvxslab_t *slabs[MAXVOXMIPS];
FVoxel *voxel = new FVoxel;
const BYTE *rawmip;
const uint8_t *rawmip;
int mip, maxmipsize;
int i, j, n;
FMemLump lump = Wads.ReadLump(lumpnum); // FMemLump adds an extra 0 byte to the end.
BYTE *rawvoxel = (BYTE *)lump.GetMem();
uint8_t *rawvoxel = (uint8_t *)lump.GetMem();
int voxelsize = (int)(lump.GetSize()-1);
// Oh, KVX, why couldn't you have a proper header? We'll just go through
@ -229,7 +229,7 @@ FVoxel *R_LoadKVX(int lumpnum)
// Allocate slab data space.
mipl->OffsetX = new int[(numbytes - 24 + 3) / 4];
mipl->OffsetXY = (short *)(mipl->OffsetX + mipl->SizeX + 1);
mipl->SlabData = (BYTE *)(mipl->OffsetXY + mipl->SizeX * (mipl->SizeY + 1));
mipl->SlabData = (uint8_t *)(mipl->OffsetXY + mipl->SizeX * (mipl->SizeY + 1));
// Load x offsets.
for (i = 0, n = mipl->SizeX; i <= n; ++i)
@ -313,7 +313,7 @@ FVoxel *R_LoadKVX(int lumpnum)
}
voxel->LumpNum = lumpnum;
voxel->Palette = new BYTE[768];
voxel->Palette = new uint8_t[768];
memcpy(voxel->Palette, rawvoxel + voxelsize - 768, 768);
return voxel;
@ -432,7 +432,7 @@ void FVoxel::CreateBgraSlabData()
slabzleng += 3;
dest = (kvxslab_bgra_t *)((uint32_t *)dest + slabzleng);
src = (kvxslab_t *)((BYTE *)src + slabzleng);
src = (kvxslab_t *)((uint8_t *)src + slabzleng);
size -= slabzleng;
}
}
@ -448,7 +448,7 @@ void FVoxel::Remap()
{
if (Palette != NULL)
{
BYTE *remap = GetVoxelRemap(Palette);
uint8_t *remap = GetVoxelRemap(Palette);
for (int i = 0; i < NumMips; ++i)
{
RemapVoxelSlabs((kvxslab_t *)Mips[i].SlabData, Mips[i].OffsetX[Mips[i].SizeX], remap);

View file

@ -9,10 +9,10 @@
struct kvxslab_t
{
BYTE ztop; // starting z coordinate of top of slab
BYTE zleng; // # of bytes in the color array - slab height
BYTE backfacecull; // low 6 bits tell which of 6 faces are exposed
BYTE col[1/*zleng*/];// color data from top to bottom
uint8_t ztop; // starting z coordinate of top of slab
uint8_t zleng; // # of bytes in the color array - slab height
uint8_t backfacecull; // low 6 bits tell which of 6 faces are exposed
uint8_t col[1/*zleng*/];// color data from top to bottom
};
struct kvxslab_bgra_t
@ -34,7 +34,7 @@ struct FVoxelMipLevel
DVector3 Pivot;
int *OffsetX;
short *OffsetXY;
BYTE *SlabData;
uint8_t *SlabData;
TArray<uint32_t> SlabDataBgra;
};
@ -43,7 +43,7 @@ struct FVoxel
int LumpNum;
int NumMips;
int VoxelIndex; // Needed by GZDoom
BYTE *Palette;
uint8_t *Palette;
FVoxelMipLevel Mips[MAXVOXMIPS];
FVoxel();