- 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
parent c008ddaf66
commit d2beacfc5f
136 changed files with 769 additions and 773 deletions

View File

@ -3,10 +3,6 @@
#include <stdint.h>
typedef uint8_t BYTE;
typedef uint16_t WORD;
typedef uint64_t QWORD;
// windef.h, included by windows.h, has its own incompatible definition
// of DWORD as a long. In files that mix Doom and Windows code, you
// must define USE_WINDOWS_DWORD before including doomtype.h so that
@ -32,7 +28,7 @@ typedef struct _GUID
union QWORD_UNION
{
QWORD AsOne;
uint64_t AsOne;
struct
{
#ifdef __BIG_ENDIAN__

View File

@ -153,10 +153,10 @@ struct FButtonStatus
enum { MAX_KEYS = 6 }; // Maximum number of keys that can press this button
uint16_t Keys[MAX_KEYS];
BYTE bDown; // Button is down right now
BYTE bWentDown; // Button went down this tic
BYTE bWentUp; // Button went up this tic
BYTE padTo16Bytes;
uint8_t bDown; // Button is down right now
uint8_t bWentDown; // Button went down this tic
uint8_t bWentUp; // Button went up this tic
uint8_t padTo16Bytes;
bool PressKey (int keynum); // Returns true if this key caused the button to be pressed.
bool ReleaseKey (int keynum); // Returns true if this key is no longer pressed.

View File

@ -71,10 +71,10 @@ void FColorMatcher::SetPalette (const uint32_t *palette)
Pal = (const PalEntry *)palette;
}
BYTE FColorMatcher::Pick (int r, int g, int b)
uint8_t FColorMatcher::Pick (int r, int g, int b)
{
if (Pal == NULL)
return 1;
return (BYTE)BestColor ((uint32_t *)Pal, r, g, b);
return (uint8_t)BestColor ((uint32_t *)Pal, r, g, b);
}

View File

@ -7,7 +7,7 @@
union FMD5Holder
{
BYTE Bytes[16];
uint8_t Bytes[16];
uint32_t DWords[4];
hash_t Hash;
};

View File

@ -863,7 +863,7 @@ const char *FConfigFile::GenerateEndTag(const char *value)
// isn't in the value. We create the sequences by generating two
// 64-bit random numbers and Base64 encoding the first 15 bytes
// from them.
union { QWORD rand_num[2]; BYTE rand_bytes[16]; };
union { uint64_t rand_num[2]; uint8_t rand_bytes[16]; };
do
{
rand_num[0] = pr_endtag.GenRand64();

View File

@ -49,10 +49,10 @@ void D_UserInfoChanged (FBaseCVar *info);
void D_SendServerInfoChange (const FBaseCVar *cvar, UCVarValue value, ECVarType type);
void D_SendServerFlagChange (const FBaseCVar *cvar, int bitnum, bool set);
void D_DoServerInfoChange (BYTE **stream, bool singlebit);
void D_DoServerInfoChange (uint8_t **stream, bool singlebit);
void D_WriteUserInfoStrings (int player, BYTE **stream, bool compact=false);
void D_ReadUserInfoStrings (int player, BYTE **stream, bool update);
void D_WriteUserInfoStrings (int player, uint8_t **stream, bool compact=false);
void D_ReadUserInfoStrings (int player, uint8_t **stream, bool update);
struct FPlayerColorSet;
void D_GetPlayerColor (int player, float *h, float *s, float *v, FPlayerColorSet **colorset);

View File

@ -645,7 +645,7 @@ void PInt::SetValue(void *addr, int val)
}
else if (Size == 8)
{
*(QWORD *)addr = val;
*(uint64_t *)addr = val;
}
else
{
@ -681,7 +681,7 @@ int PInt::GetValueInt(void *addr) const
}
else if (Size == 8)
{ // truncated output
return (int)*(QWORD *)addr;
return (int)*(uint64_t *)addr;
}
else
{

View File

@ -45,7 +45,7 @@ static int *y;
// [RH] Fire Wipe
#define FIREWIDTH 64
#define FIREHEIGHT 64
static BYTE *burnarray;
static uint8_t *burnarray;
static int density;
static int burntime;
@ -81,7 +81,7 @@ bool wipe_initMelt (int ticks)
int i, r;
// copy start screen to main screen
screen->DrawBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (BYTE *)wipe_scr_start);
screen->DrawBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (uint8_t *)wipe_scr_start);
// makes this wipe faster (in theory)
// to have stuff in column-major format
@ -165,21 +165,21 @@ bool wipe_exitMelt (int ticks)
bool wipe_initBurn (int ticks)
{
burnarray = new BYTE[FIREWIDTH * (FIREHEIGHT+5)];
burnarray = new uint8_t[FIREWIDTH * (FIREHEIGHT+5)];
memset (burnarray, 0, FIREWIDTH * (FIREHEIGHT+5));
density = 4;
burntime = 0;
return 0;
}
int wipe_CalcBurn (BYTE *burnarray, int width, int height, int density)
int wipe_CalcBurn (uint8_t *burnarray, int width, int height, int density)
{
// This is a modified version of the fire that was once used
// on the player setup menu.
static int voop;
int a, b;
BYTE *from;
uint8_t *from;
// generator
from = &burnarray[width * height];
@ -198,10 +198,10 @@ int wipe_CalcBurn (BYTE *burnarray, int width, int height, int density)
from = burnarray;
for (b = 0; b <= height; b += 2)
{
BYTE *pixel = from;
uint8_t *pixel = from;
// special case: first pixel on line
BYTE *p = pixel + (width << 1);
uint8_t *p = pixel + (width << 1);
unsigned int top = *p + *(p + width - 1) + *(p + 1);
unsigned int bottom = *(pixel + (width << 2));
unsigned int c1 = (top + bottom) >> 2;
@ -274,14 +274,14 @@ bool wipe_doBurn (int ticks)
// Draw the screen
int xstep, ystep, firex, firey;
int x, y;
BYTE *to, *fromold, *fromnew;
uint8_t *to, *fromold, *fromnew;
const int SHIFT = 16;
xstep = (FIREWIDTH << SHIFT) / SCREENWIDTH;
ystep = (FIREHEIGHT << SHIFT) / SCREENHEIGHT;
to = screen->GetBuffer();
fromold = (BYTE *)wipe_scr_start;
fromnew = (BYTE *)wipe_scr_end;
fromold = (uint8_t *)wipe_scr_start;
fromnew = (uint8_t *)wipe_scr_end;
if (!r_blendmethod)
{
@ -379,7 +379,7 @@ bool wipe_doFade (int ticks)
fade += ticks * 2;
if (fade > 64)
{
screen->DrawBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (BYTE *)wipe_scr_end);
screen->DrawBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (uint8_t *)wipe_scr_end);
return true;
}
else
@ -388,9 +388,9 @@ bool wipe_doFade (int ticks)
int bglevel = 64 - fade;
DWORD *fg2rgb = Col2RGB8[fade];
DWORD *bg2rgb = Col2RGB8[bglevel];
BYTE *fromnew = (BYTE *)wipe_scr_end;
BYTE *fromold = (BYTE *)wipe_scr_start;
BYTE *to = screen->GetBuffer();
uint8_t *fromnew = (uint8_t *)wipe_scr_end;
uint8_t *fromold = (uint8_t *)wipe_scr_start;
uint8_t *to = screen->GetBuffer();
const PalEntry *pal = GPalette.BaseColors;
if (!r_blendmethod)
@ -456,7 +456,7 @@ bool wipe_StartScreen (int type)
if (CurrentWipeType)
{
wipe_scr_start = new short[SCREENWIDTH * SCREENHEIGHT / 2];
screen->GetBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (BYTE *)wipe_scr_start);
screen->GetBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (uint8_t *)wipe_scr_start);
return true;
}
return false;
@ -470,8 +470,8 @@ void wipe_EndScreen (void)
if (CurrentWipeType)
{
wipe_scr_end = new short[SCREENWIDTH * SCREENHEIGHT / 2];
screen->GetBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (BYTE *)wipe_scr_end);
screen->DrawBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (BYTE *)wipe_scr_start); // restore start scr.
screen->GetBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (uint8_t *)wipe_scr_end);
screen->DrawBlock (0, 0, SCREENWIDTH, SCREENHEIGHT, (uint8_t *)wipe_scr_start); // restore start scr.
// Initialize the wipe
(*wipes[(CurrentWipeType-1)*3])(0);

View File

@ -34,7 +34,7 @@ void wipe_Cleanup ();
// The buffer must have an additional 5 rows not included in height
// to use for a seeding area.
int wipe_CalcBurn (BYTE *buffer, int width, int height, int density);
int wipe_CalcBurn (uint8_t *buffer, int width, int height, int density);
enum
{

View File

@ -392,7 +392,7 @@ ISzAlloc g_Alloc = { SzAlloc, SzFree };
FileReaderLZMA::FileReaderLZMA (FileReader &file, size_t uncompressed_size, bool zip)
: File(file), SawEOF(false)
{
BYTE header[4 + LZMA_PROPS_SIZE];
uint8_t header[4 + LZMA_PROPS_SIZE];
int err;
assert(zip == true);

View File

@ -175,7 +175,7 @@ enum ELevelFlags : unsigned int
LEVEL_CHANGEMAPCHEAT = 0x40000000, // Don't display cluster messages
LEVEL_VISITED = 0x80000000, // Used for intermission map
// The flags QWORD is now split into 2 DWORDs
// The flags uint64_t is now split into 2 DWORDs
LEVEL2_RANDOMPLAYERSTARTS = 0x00000001, // Select single player starts randomnly (no voodoo dolls)
LEVEL2_ALLMAP = 0x00000002, // The player picked up a map on this level

View File

@ -33,22 +33,22 @@ class FHealthBar : public FTexture
public:
FHealthBar ();
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
const BYTE *GetPixels ();
const uint8_t *GetColumn (unsigned int column, const Span **spans_out);
const uint8_t *GetPixels ();
bool CheckModified ();
void SetVial (int level);
protected:
BYTE Pixels[200*2];
BYTE Colors[8];
uint8_t Pixels[200*2];
uint8_t Colors[8];
static const Span DummySpan[2];
int VialLevel;
bool NeedRefresh;
void MakeTexture ();
void FillBar (int min, int max, BYTE light, BYTE dark);
void FillBar (int min, int max, uint8_t light, uint8_t dark);
};
const FTexture::Span FHealthBar::DummySpan[2] = { { 0, 2 }, { 0, 0 } };
@ -58,7 +58,7 @@ FHealthBar::FHealthBar ()
{
int i;
static const BYTE rgbs[8*3] =
static const uint8_t rgbs[8*3] =
{
180, 228, 128, // light green
128, 180, 80, // dark green
@ -90,7 +90,7 @@ bool FHealthBar::CheckModified ()
return NeedRefresh;
}
const BYTE *FHealthBar::GetColumn (unsigned int column, const Span **spans_out)
const uint8_t *FHealthBar::GetColumn (unsigned int column, const Span **spans_out)
{
if (NeedRefresh)
{
@ -107,7 +107,7 @@ const BYTE *FHealthBar::GetColumn (unsigned int column, const Span **spans_out)
return Pixels + column*2;
}
const BYTE *FHealthBar::GetPixels ()
const uint8_t *FHealthBar::GetPixels ()
{
if (NeedRefresh)
{
@ -166,7 +166,7 @@ void FHealthBar::MakeTexture ()
}
}
void FHealthBar::FillBar (int min, int max, BYTE light, BYTE dark)
void FHealthBar::FillBar (int min, int max, uint8_t light, uint8_t dark)
{
for (int i = min*2; i < max*2; i++)
{

View File

@ -69,7 +69,7 @@ struct FGLLinePortal
extern TArray<FPortal *> portals;
extern TArray<FGLLinePortal*> linePortalToGL;
extern TArray<BYTE> currentmapsection;
extern TArray<uint8_t> currentmapsection;
void gl_InitPortals();
void gl_BuildPortalCoverage(FPortalCoverage *coverage, subsector_t *subsector, const DVector2 &displacement);

View File

@ -296,7 +296,7 @@ struct FCoverageBuilder
else
{
// we reached a subsector so we can link the node with this subsector
subsector_t *sub = (subsector_t *)((BYTE *)node - 1);
subsector_t *sub = (subsector_t *)((uint8_t *)node - 1);
collect.Push(int(sub-subsectors));
}
}

View File

@ -97,9 +97,9 @@ public:
virtual void Tick();
void Serialize(FSerializer &arc);
void PostSerialize();
BYTE GetRed() const { return args[LIGHT_RED]; }
BYTE GetGreen() const { return args[LIGHT_GREEN]; }
BYTE GetBlue() const { return args[LIGHT_BLUE]; }
uint8_t GetRed() const { return args[LIGHT_RED]; }
uint8_t GetGreen() const { return args[LIGHT_GREEN]; }
uint8_t GetBlue() const { return args[LIGHT_BLUE]; }
float GetRadius() const { return (IsActive() ? m_currentRadius * 2.f : 0.f); }
void LinkLight();
void UnlinkLight();
@ -135,11 +135,11 @@ protected:
public:
int m_tickCount;
BYTE lightflags;
BYTE lighttype;
uint8_t lightflags;
uint8_t lighttype;
bool owned;
bool halo;
BYTE color2[3];
uint8_t color2[3];
bool visibletoplayer;
bool swapped;
int bufferindex;

View File

@ -59,7 +59,7 @@ public:
virtual int FindFrame(const char * name) = 0;
virtual void RenderFrame(FTexture * skin, int frame, int frame2, double inter, int translation=0) = 0;
virtual void BuildVertexBuffer() = 0;
virtual void AddSkins(BYTE *hitlist) = 0;
virtual void AddSkins(uint8_t *hitlist) = 0;
void DestroyVertexBuffer()
{
delete mVBuf;
@ -185,7 +185,7 @@ public:
virtual int FindFrame(const char * name);
virtual void RenderFrame(FTexture * skin, int frame, int frame2, double inter, int translation=0);
virtual void LoadGeometry();
virtual void AddSkins(BYTE *hitlist);
virtual void AddSkins(uint8_t *hitlist);
void UnloadGeometry();
void BuildVertexBuffer();
@ -292,7 +292,7 @@ public:
virtual void RenderFrame(FTexture * skin, int frame, int frame2, double inter, int translation=0);
void LoadGeometry();
void BuildVertexBuffer();
virtual void AddSkins(BYTE *hitlist);
virtual void AddSkins(uint8_t *hitlist);
};
struct FVoxelVertexHash
@ -335,7 +335,7 @@ protected:
TArray<unsigned int> mIndices;
void MakeSlabPolys(int x, int y, kvxslab_t *voxptr, FVoxelMap &check);
void AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3, int x4, int y4, int z4, BYTE color, FVoxelMap &check);
void AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3, int x4, int y4, int z4, uint8_t color, FVoxelMap &check);
unsigned int AddVertex(FModelVertex &vert, FVoxelMap &check);
public:
@ -345,7 +345,7 @@ public:
void Initialize();
virtual int FindFrame(const char * name);
virtual void RenderFrame(FTexture * skin, int frame, int frame2, double inter, int translation=0);
virtual void AddSkins(BYTE *hitlist);
virtual void AddSkins(uint8_t *hitlist);
FTextureID GetPaletteTexture() const { return mPalette; }
void BuildVertexBuffer();
float getAspectFactor();

View File

@ -300,7 +300,7 @@ void FMD3Model::BuildVertexBuffer()
//
//===========================================================================
void FMD3Model::AddSkins(BYTE *hitlist)
void FMD3Model::AddSkins(uint8_t *hitlist)
{
for (int i = 0; i < numSurfaces; i++)
{

View File

@ -65,8 +65,8 @@ public:
FVoxelTexture(FVoxel *voxel);
~FVoxelTexture();
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
const BYTE *GetPixels ();
const uint8_t *GetColumn (unsigned int column, const Span **spans_out);
const uint8_t *GetPixels ();
void Unload ();
int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf);
@ -74,7 +74,7 @@ public:
protected:
FVoxel *SourceVox;
BYTE *Pixels;
uint8_t *Pixels;
};
@ -107,20 +107,20 @@ FVoxelTexture::~FVoxelTexture()
{
}
const BYTE *FVoxelTexture::GetColumn (unsigned int column, const Span **spans_out)
const uint8_t *FVoxelTexture::GetColumn (unsigned int column, const Span **spans_out)
{
// not needed
return NULL;
}
const BYTE *FVoxelTexture::GetPixels ()
const uint8_t *FVoxelTexture::GetPixels ()
{
// GetPixels gets called when a translated palette is used so we still need to implement it here.
if (Pixels == NULL)
{
Pixels = new BYTE[256];
Pixels = new uint8_t[256];
BYTE *pp = SourceVox->Palette;
uint8_t *pp = SourceVox->Palette;
if(pp != NULL)
{
@ -137,7 +137,7 @@ const BYTE *FVoxelTexture::GetPixels ()
{
for(int i=0;i<256;i++, pp+=3)
{
Pixels[i] = (BYTE)i;
Pixels[i] = (uint8_t)i;
}
}
}
@ -165,14 +165,14 @@ void FVoxelTexture::Unload ()
int FVoxelTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf)
{
PalEntry pe[256];
BYTE bitmap[256];
BYTE *pp = SourceVox->Palette;
uint8_t bitmap[256];
uint8_t *pp = SourceVox->Palette;
if(pp != NULL)
{
for(int i=0;i<256;i++, pp+=3)
{
bitmap[i] = (BYTE)i;
bitmap[i] = (uint8_t)i;
pe[i].r = (pp[0] << 2) | (pp[0] >> 4);
pe[i].g = (pp[1] << 2) | (pp[1] >> 4);
pe[i].b = (pp[2] << 2) | (pp[2] >> 4);
@ -183,7 +183,7 @@ int FVoxelTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, F
{
for(int i=0;i<256;i++, pp+=3)
{
bitmap[i] = (BYTE)i;
bitmap[i] = (uint8_t)i;
pe[i] = GPalette.BaseColors[i];
pe[i].a = 255;
}
@ -239,7 +239,7 @@ unsigned int FVoxelModel::AddVertex(FModelVertex &vert, FVoxelMap &check)
//
//===========================================================================
void FVoxelModel::AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3, int x4, int y4, int z4, BYTE col, FVoxelMap &check)
void FVoxelModel::AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3, int x4, int y4, int z4, uint8_t col, FVoxelMap &check)
{
float PivotX = mVoxel->Mips[0].Pivot.X;
float PivotY = mVoxel->Mips[0].Pivot.Y;
@ -289,7 +289,7 @@ void FVoxelModel::AddFace(int x1, int y1, int z1, int x2, int y2, int z2, int x3
void FVoxelModel::MakeSlabPolys(int x, int y, kvxslab_t *voxptr, FVoxelMap &check)
{
const BYTE *col = voxptr->col;
const uint8_t *col = voxptr->col;
int zleng = voxptr->zleng;
int ztop = voxptr->ztop;
int cull = voxptr->backfacecull;
@ -342,13 +342,13 @@ void FVoxelModel::Initialize()
FVoxelMipLevel *mip = &mVoxel->Mips[0];
for (int x = 0; x < mip->SizeX; x++)
{
BYTE *slabxoffs = &mip->SlabData[mip->OffsetX[x]];
uint8_t *slabxoffs = &mip->SlabData[mip->OffsetX[x]];
short *xyoffs = &mip->OffsetXY[x * (mip->SizeY + 1)];
for (int y = 0; y < mip->SizeY; y++)
{
kvxslab_t *voxptr = (kvxslab_t *)(slabxoffs + xyoffs[y]);
kvxslab_t *voxend = (kvxslab_t *)(slabxoffs + xyoffs[y+1]);
for (; voxptr < voxend; voxptr = (kvxslab_t *)((BYTE *)voxptr + voxptr->zleng + 3))
for (; voxptr < voxend; voxptr = (kvxslab_t *)((uint8_t *)voxptr + voxptr->zleng + 3))
{
MakeSlabPolys(x, y, voxptr, check);
}
@ -394,7 +394,7 @@ void FVoxelModel::BuildVertexBuffer()
//
//===========================================================================
void FVoxelModel::AddSkins(BYTE *hitlist)
void FVoxelModel::AddSkins(uint8_t *hitlist)
{
hitlist[mPalette.GetIndex()] |= FTexture::TEX_Flat;
}

View File

@ -139,7 +139,7 @@ void F2DDrawer::AddTexture(FTexture *img, DrawParms &parms)
{
color = PalEntry(light, light, light);
}
color.a = (BYTE)(parms.Alpha * 255);
color.a = (uint8_t)(parms.Alpha * 255);
// scissor test doesn't use the current viewport for the coordinates, so use real screen coordinates
dg.mScissor[0] = GLRenderer->ScreenToWindowX(parms.lclip);

View File

@ -253,7 +253,7 @@ static PalEntry gl_CalcLightColor(int light, PalEntry pe, int blendfactor)
g = (mixlight + pe.g * blendfactor) / 255;
b = (mixlight + pe.b * blendfactor) / 255;
}
return PalEntry(255, BYTE(r), BYTE(g), BYTE(b));
return PalEntry(255, uint8_t(r), uint8_t(g), uint8_t(b));
}
//==========================================================================

View File

@ -529,7 +529,7 @@ void FGLRenderer::CreateTonemapPalette()
{
for (int b = 0; b < 64; b++)
{
PalEntry color = GPalette.BaseColors[(BYTE)PTM_BestColor((uint32_t *)GPalette.BaseColors, (r << 2) | (r >> 4), (g << 2) | (g >> 4), (b << 2) | (b >> 4), 0, 256)];
PalEntry color = GPalette.BaseColors[(uint8_t)PTM_BestColor((uint32_t *)GPalette.BaseColors, (r << 2) | (r >> 4), (g << 2) | (g >> 4), (b << 2) | (b >> 4), 0, 256)];
int index = ((r * 64 + g) * 64 + b) * 4;
lut[index] = color.r;
lut[index + 1] = color.g;

View File

@ -131,7 +131,7 @@ static void AddLine (seg_t *seg, bool portalclip)
}
currentsubsector->flags |= SSECF_DRAWN;
BYTE ispoly = BYTE(seg->sidedef->Flags & WALLF_POLYOBJ);
uint8_t ispoly = uint8_t(seg->sidedef->Flags & WALLF_POLYOBJ);
if (!seg->backsector)
{
@ -248,7 +248,7 @@ static void RenderPolyBSPNode (void *node)
node = bsp->children[side];
}
PolySubsector ((subsector_t *)((BYTE *)node - 1));
PolySubsector ((subsector_t *)((uint8_t *)node - 1));
}
//==========================================================================
@ -512,7 +512,7 @@ static void DoSubsector(subsector_t * sub)
fakesector = gl_FakeFlat(sector, &fake, false);
}
BYTE &srf = gl_drawinfo->sectorrenderflags[sub->render_sector->sectornum];
uint8_t &srf = gl_drawinfo->sectorrenderflags[sub->render_sector->sectornum];
if (!(srf & SSRF_PROCESSED))
{
srf |= SSRF_PROCESSED;
@ -587,7 +587,7 @@ void gl_RenderBSPNode (void *node)
node = bsp->children[side];
}
DoSubsector ((subsector_t *)((BYTE *)node - 1));
DoSubsector ((subsector_t *)((uint8_t *)node - 1));
}

View File

@ -427,7 +427,7 @@ angle_t R_PointToPseudoAngle(double x, double y)
// if some part of the bbox might be visible.
//
//-----------------------------------------------------------------------------
static const BYTE checkcoord[12][4] = // killough -- static const
static const uint8_t checkcoord[12][4] = // killough -- static const
{
{3,0,2,1},
{3,0,2,0},
@ -447,7 +447,7 @@ bool Clipper::CheckBox(const float *bspcoord)
angle_t angle1, angle2;
int boxpos;
const BYTE* check;
const uint8_t* check;
// Find the corners of the box
// that define the edges from current viewpoint.

View File

@ -203,12 +203,12 @@ struct FDrawInfo
struct SubsectorHackInfo
{
subsector_t * sub;
BYTE flags;
uint8_t flags;
};
TArray<BYTE> sectorrenderflags;
TArray<BYTE> ss_renderflags;
TArray<BYTE> no_renderflags;
TArray<uint8_t> sectorrenderflags;
TArray<uint8_t> ss_renderflags;
TArray<uint8_t> no_renderflags;
TArray<MissingTextureInfo> MissingUpperTextures;
TArray<MissingTextureInfo> MissingLowerTextures;

View File

@ -690,7 +690,7 @@ GLSectorStackPortal::~GLSectorStackPortal()
//
//-----------------------------------------------------------------------------
static BYTE SetCoverage(void *node)
static uint8_t SetCoverage(void *node)
{
if (numnodes == 0)
{
@ -699,13 +699,13 @@ static BYTE SetCoverage(void *node)
if (!((size_t)node & 1)) // Keep going until found a subsector
{
node_t *bsp = (node_t *)node;
BYTE coverage = SetCoverage(bsp->children[0]) | SetCoverage(bsp->children[1]);
uint8_t coverage = SetCoverage(bsp->children[0]) | SetCoverage(bsp->children[1]);
gl_drawinfo->no_renderflags[bsp-nodes] = coverage;
return coverage;
}
else
{
subsector_t *sub = (subsector_t *)((BYTE *)node - 1);
subsector_t *sub = (subsector_t *)((uint8_t *)node - 1);
return gl_drawinfo->ss_renderflags[sub-subsectors] & SSRF_SEEN;
}
}

View File

@ -108,7 +108,7 @@ private:
ActorRenderFlags savedvisibility;
GLPortal *PrevPortal;
GLPortal *PrevClipPortal;
TArray<BYTE> savedmapsection;
TArray<uint8_t> savedmapsection;
TArray<unsigned int> mPrimIndices;
protected:

View File

@ -92,7 +92,7 @@ extern bool r_showviewer;
int gl_fixedcolormap;
area_t in_area;
TArray<BYTE> currentmapsection;
TArray<uint8_t> currentmapsection;
int camtexcount;
void gl_ParseDefs();
@ -1010,7 +1010,7 @@ struct FGLInterface : public FRenderer
bool UsesColormap() const override;
void PrecacheTexture(FTexture *tex, int cache);
void PrecacheSprite(FTexture *tex, SpriteHits &hits);
void Precache(BYTE *texhitlist, TMap<PClassActor*, bool> &actorhitlist) override;
void Precache(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitlist) override;
void RenderView(player_t *player) override;
void WriteSavePic (player_t *player, FileWriter *file, int width, int height) override;
void StateChanged(AActor *actor) override;
@ -1078,13 +1078,13 @@ void FGLInterface::PrecacheSprite(FTexture *tex, SpriteHits &hits)
//
//==========================================================================
void FGLInterface::Precache(BYTE *texhitlist, TMap<PClassActor*, bool> &actorhitlist)
void FGLInterface::Precache(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitlist)
{
SpriteHits *spritelist = new SpriteHits[sprites.Size()];
SpriteHits **spritehitlist = new SpriteHits*[TexMan.NumTextures()];
TMap<PClassActor*, bool>::Iterator it(actorhitlist);
TMap<PClassActor*, bool>::Pair *pair;
BYTE *modellist = new BYTE[Models.Size()];
uint8_t *modellist = new uint8_t[Models.Size()];
memset(modellist, 0, Models.Size());
memset(spritehitlist, 0, sizeof(SpriteHits**) * TexMan.NumTextures());

View File

@ -892,7 +892,7 @@ void GLSprite::Process(AActor* thing, sector_t * sector, int thruportal)
lightlevel=fullbright? 255 :
gl_ClampLight(rendersector->GetTexture(sector_t::ceiling) == skyflatnum ?
rendersector->GetCeilingLight() : rendersector->GetFloorLight());
foglevel = (BYTE)clamp<short>(rendersector->lightlevel, 0, 255);
foglevel = (uint8_t)clamp<short>(rendersector->lightlevel, 0, 255);
lightlevel = gl_CheckSpriteGlow(rendersector, lightlevel, thingpos);
@ -1093,7 +1093,7 @@ void GLSprite::ProcessParticle (particle_t *particle, sector_t *sector)//, int s
lightlevel = gl_ClampLight(sector->GetTexture(sector_t::ceiling) == skyflatnum ?
sector->GetCeilingLight() : sector->GetFloorLight());
foglevel = (BYTE)clamp<short>(sector->lightlevel, 0, 255);
foglevel = (uint8_t)clamp<short>(sector->lightlevel, 0, 255);
if (gl_fixedcolormap)
{

View File

@ -153,8 +153,8 @@ public:
TArray<lightlist_t> *lightlist;
int lightlevel;
BYTE type;
BYTE flags;
uint8_t type;
uint8_t flags;
short rellight;
float topglowcolor[4];
@ -309,7 +309,7 @@ public:
int lightlevel;
bool stack;
bool ceiling;
BYTE renderflags;
uint8_t renderflags;
int vboindex;
//int vboheight;
@ -348,8 +348,8 @@ public:
friend void Mod_RenderModel(GLSprite * spr, model_t * mdl, int framenumber);
int lightlevel;
BYTE foglevel;
BYTE hw_styleflags;
uint8_t foglevel;
uint8_t hw_styleflags;
bool fullbright;
PalEntry ThingColor; // thing's own color
FColormap Colormap;

View File

@ -711,7 +711,7 @@ void GLWall::DoTexture(int _type,seg_t * seg, int peg,
GLSeg glsave=glseg;
float flh=ceilingrefheight-floorrefheight;
int texpos;
BYTE savedflags = flags;
uint8_t savedflags = flags;
switch (_type)
{

View File

@ -506,7 +506,7 @@ void OpenGLFrameBuffer::FillSimplePoly(FTexture *texture, FVector2 *points, int
//
//===========================================================================
void OpenGLFrameBuffer::GetScreenshotBuffer(const BYTE *&buffer, int &pitch, ESSType &color_type)
void OpenGLFrameBuffer::GetScreenshotBuffer(const uint8_t *&buffer, int &pitch, ESSType &color_type)
{
const auto &viewport = GLRenderer->mOutputLetterbox;
@ -523,7 +523,7 @@ void OpenGLFrameBuffer::GetScreenshotBuffer(const BYTE *&buffer, int &pitch, ESS
int h = SCREENHEIGHT;
ReleaseScreenshotBuffer();
ScreenshotBuffer = new BYTE[w * h * 3];
ScreenshotBuffer = new uint8_t[w * h * 3];
float rcpWidth = 1.0f / w;
float rcpHeight = 1.0f / h;

View File

@ -55,7 +55,7 @@ public:
// Retrieves a buffer containing image data for a screenshot.
// Hint: Pitch can be negative for upside-down images, in which case buffer
// points to the last row in the buffer, which will be the first row output.
virtual void GetScreenshotBuffer(const BYTE *&buffer, int &pitch, ESSType &color_type);
virtual void GetScreenshotBuffer(const uint8_t *&buffer, int &pitch, ESSType &color_type);
// Releases the screenshot buffer.
virtual void ReleaseScreenshotBuffer();
@ -96,7 +96,7 @@ private:
bool swapped;
PalEntry SourcePalette[256];
BYTE *ScreenshotBuffer;
uint8_t *ScreenshotBuffer;
class Wiper
{

View File

@ -397,7 +397,7 @@ bool OpenGLSWFrameBuffer::Wiper_Melt::Run(int ticks, OpenGLSWFrameBuffer *fb)
BufferedTris *quad = &fb->QuadExtra[fb->QuadBatchPos];
FBVERTEX *vert = &fb->VertexData[fb->VertexPos];
WORD *index = &fb->IndexData[fb->IndexPos];
uint16_t *index = &fb->IndexData[fb->IndexPos];
quad->ClearSetup();
quad->Flags = BQF_DisableAlphaTest;

View File

@ -87,7 +87,7 @@ public:
private:
static const int WIDTH = 64, HEIGHT = 64;
BYTE BurnArray[WIDTH * (HEIGHT + 5)];
uint8_t BurnArray[WIDTH * (HEIGHT + 5)];
FHardwareTexture *BurnTexture;
int Density;
int BurnTime;
@ -524,15 +524,15 @@ bool OpenGLFrameBuffer::Wiper_Burn::Run(int ticks, OpenGLFrameBuffer *fb)
BurnTexture = new FHardwareTexture(WIDTH, HEIGHT, true);
// Update the burn texture with the new burn data
BYTE rgb_buffer[WIDTH*HEIGHT*4];
uint8_t rgb_buffer[WIDTH*HEIGHT*4];
const BYTE *src = BurnArray;
const uint8_t *src = BurnArray;
DWORD *dest = (DWORD *)rgb_buffer;
for (int y = HEIGHT; y != 0; --y)
{
for (int x = WIDTH; x != 0; --x)
{
BYTE s = clamp<int>((*src++)*2, 0, 255);
uint8_t s = clamp<int>((*src++)*2, 0, 255);
*dest++ = MAKEARGB(s,255,255,255);
}
}

View File

@ -39,7 +39,7 @@
//
//===========================================================================
template<class T>
void iCopyColors(unsigned char * pout, const unsigned char * pin, int count, int step, BYTE tr, BYTE tg, BYTE tb)
void iCopyColors(unsigned char * pout, const unsigned char * pin, int count, int step, uint8_t tr, uint8_t tg, uint8_t tb)
{
int i;
unsigned char a;
@ -58,7 +58,7 @@ void iCopyColors(unsigned char * pout, const unsigned char * pin, int count, int
}
}
typedef void (*CopyFunc)(unsigned char * pout, const unsigned char * pin, int count, int step, BYTE tr, BYTE tg, BYTE tb);
typedef void (*CopyFunc)(unsigned char * pout, const unsigned char * pin, int count, int step, uint8_t tr, uint8_t tg, uint8_t tb);
static CopyFunc copyfuncs[]={
iCopyColors<cRGB>,
@ -81,15 +81,15 @@ static CopyFunc copyfuncs[]={
//
//===========================================================================
void FGLBitmap::CopyPixelDataRGB(int originx, int originy,
const BYTE * patch, int srcwidth, int srcheight, int step_x, int step_y,
const uint8_t * patch, int srcwidth, int srcheight, int step_x, int step_y,
int rotate, int ct, FCopyInfo *inf, int r, int g, int b)
{
if (ClipCopyPixelRect(&ClipRect, originx, originy, patch, srcwidth, srcheight, step_x, step_y, rotate))
{
BYTE *buffer = GetPixels() + 4*originx + Pitch*originy;
uint8_t *buffer = GetPixels() + 4*originx + Pitch*originy;
for (int y=0;y<srcheight;y++)
{
copyfuncs[ct](&buffer[y*Pitch], &patch[y*step_y], srcwidth, step_x, (BYTE)r, (BYTE)g, (BYTE)b);
copyfuncs[ct](&buffer[y*Pitch], &patch[y*step_y], srcwidth, step_x, (uint8_t)r, (uint8_t)g, (uint8_t)b);
}
}
}
@ -99,7 +99,7 @@ void FGLBitmap::CopyPixelDataRGB(int originx, int originy,
// Paletted to True Color texture copy function
//
//===========================================================================
void FGLBitmap::CopyPixelData(int originx, int originy, const BYTE * patch, int srcwidth, int srcheight,
void FGLBitmap::CopyPixelData(int originx, int originy, const uint8_t * patch, int srcwidth, int srcheight,
int step_x, int step_y, int rotate, PalEntry * palette, FCopyInfo *inf)
{
PalEntry penew[256];
@ -108,7 +108,7 @@ void FGLBitmap::CopyPixelData(int originx, int originy, const BYTE * patch, int
if (ClipCopyPixelRect(&ClipRect, originx, originy, patch, srcwidth, srcheight, step_x, step_y, rotate))
{
BYTE *buffer = GetPixels() + 4*originx + Pitch*originy;
uint8_t *buffer = GetPixels() + 4*originx + Pitch*originy;
if (translation > 0)
{

View File

@ -14,7 +14,7 @@ public:
FGLBitmap()
{
}
FGLBitmap(BYTE *buffer, int pitch, int width, int height)
FGLBitmap(uint8_t *buffer, int pitch, int width, int height)
: FBitmap(buffer, pitch, width, height)
{
}
@ -25,11 +25,11 @@ public:
alphatrans = _alphatrans;
}
virtual void CopyPixelDataRGB(int originx, int originy, const BYTE *patch, int srcwidth,
virtual void CopyPixelDataRGB(int originx, int originy, const uint8_t *patch, int srcwidth,
int srcheight, int step_x, int step_y, int rotate, int ct, FCopyInfo *inf = NULL,
/* for PNG tRNS */ int r=0, int g=0, int b=0);
virtual void CopyPixelData(int originx, int originy, const BYTE * patch, int srcwidth, int srcheight,
virtual void CopyPixelData(int originx, int originy, const uint8_t * patch, int srcwidth, int srcheight,
int step_x, int step_y, int rotate, PalEntry * palette, FCopyInfo *inf = NULL);
};

View File

@ -110,7 +110,7 @@ int CheckDDPK3(FTexture *tex)
FString checkName;
const char ** checklist;
BYTE useType=tex->UseType;
uint8_t useType=tex->UseType;
if (useType==FTexture::TEX_SkinSprite || useType==FTexture::TEX_Decal || useType==FTexture::TEX_FontChar)
{
@ -291,7 +291,7 @@ int CheckExternalFile(FTexture *tex, bool & hascolorkey)
FString checkName;
const char ** checklist;
BYTE useType=tex->UseType;
uint8_t useType=tex->UseType;
if (useType==FTexture::TEX_SkinSprite || useType==FTexture::TEX_Decal || useType==FTexture::TEX_FontChar)
{

View File

@ -65,7 +65,7 @@ private:
bool bHasColorkey; // only for hires
bool bExpandFlag;
BYTE lastSampler;
uint8_t lastSampler;
int lastTranslation;
unsigned char * LoadHiresTexture(FTexture *hirescheck, int *width, int *height);

View File

@ -84,7 +84,7 @@ void FSamplerManager::UnbindAll()
}
}
BYTE FSamplerManager::Bind(int texunit, int num, int lastval)
uint8_t FSamplerManager::Bind(int texunit, int num, int lastval)
{
if (gl.flags & RFL_SAMPLER_OBJECTS)
{

View File

@ -16,7 +16,7 @@ public:
FSamplerManager();
~FSamplerManager();
BYTE Bind(int texunit, int num, int lastval);
uint8_t Bind(int texunit, int num, int lastval);
void SetTextureFilterMode();

View File

@ -59,7 +59,7 @@ FSkyBox::~FSkyBox()
//
//-----------------------------------------------------------------------------
const BYTE *FSkyBox::GetColumn (unsigned int column, const Span **spans_out)
const uint8_t *FSkyBox::GetColumn (unsigned int column, const Span **spans_out)
{
if (faces[0]) return faces[0]->GetColumn(column, spans_out);
return NULL;
@ -71,7 +71,7 @@ const BYTE *FSkyBox::GetColumn (unsigned int column, const Span **spans_out)
//
//-----------------------------------------------------------------------------
const BYTE *FSkyBox::GetPixels ()
const uint8_t *FSkyBox::GetPixels ()
{
if (faces[0]) return faces[0]->GetPixels();
return NULL;

View File

@ -16,8 +16,8 @@ public:
FSkyBox();
~FSkyBox();
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
const BYTE *GetPixels ();
const uint8_t *GetColumn (unsigned int column, const Span **spans_out);
const uint8_t *GetPixels ();
int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf);
bool UseBasePalette();
void Unload ();

View File

@ -267,7 +267,7 @@ void FTexture::CreateDefaultBrightmap()
)
{
// May have one - let's check when we use this texture
const BYTE *texbuf = GetPixels();
const uint8_t *texbuf = GetPixels();
const int white = ColorMatcher.Pick(255,255,255);
int size = GetWidth() * GetHeight();
@ -556,13 +556,13 @@ FBrightmapTexture::~FBrightmapTexture ()
{
}
const BYTE *FBrightmapTexture::GetColumn (unsigned int column, const Span **spans_out)
const uint8_t *FBrightmapTexture::GetColumn (unsigned int column, const Span **spans_out)
{
// not needed
return NULL;
}
const BYTE *FBrightmapTexture::GetPixels ()
const uint8_t *FBrightmapTexture::GetPixels ()
{
// not needed
return NULL;

View File

@ -9,8 +9,8 @@ public:
FBrightmapTexture (FTexture *source);
~FBrightmapTexture ();
const BYTE *GetColumn (unsigned int column, const Span **spans_out);
const BYTE *GetPixels ();
const uint8_t *GetColumn (unsigned int column, const Span **spans_out);
const uint8_t *GetPixels ();
void Unload ();
int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf);
@ -18,7 +18,7 @@ public:
protected:
FTexture *SourcePic;
//BYTE *Pixels;
//uint8_t *Pixels;
//Span **Spans;
};

View File

@ -46,7 +46,7 @@ bool GLTranslationPalette::Update()
memset(pd.pe, 0, sizeof(pd.pe));
memcpy(pd.pe, remap->Palette, remap->NumEntries * sizeof(*remap->Palette));
pd.crc32 = CalcCRC32((BYTE*)pd.pe, sizeof(pd.pe));
pd.crc32 = CalcCRC32((uint8_t*)pd.pe, sizeof(pd.pe));
for(unsigned int i=0;i< AllPalettes.Size(); i++)
{
if (pd.crc32 == AllPalettes[i].crc32)

View File

@ -79,8 +79,8 @@ class FSectionCreator
{
static FSectionCreator *creator;
BYTE *processed_segs;
BYTE *processed_subsectors;
uint8_t *processed_segs;
uint8_t *processed_subsectors;
int *section_for_segs;
vertex_t *v1_l1, *v2_l1;
@ -97,8 +97,8 @@ public:
FSectionCreator()
{
processed_segs = new BYTE[(numsegs+7)/8];
processed_subsectors = new BYTE[(numsubsectors+7)/8];
processed_segs = new uint8_t[(numsegs+7)/8];
processed_subsectors = new uint8_t[(numsubsectors+7)/8];
memset(processed_segs, 0, (numsegs+7)/8);
memset(processed_subsectors, 0, (numsubsectors+7)/8);

View File

@ -90,9 +90,9 @@ public:
// SFMT interface
unsigned int GenRand32();
QWORD GenRand64();
uint64_t GenRand64();
void FillArray32(uint32_t *array, int size);
void FillArray64(QWORD *array, int size);
void FillArray64(uint64_t *array, int size);
void InitGenRand(uint32_t seed);
void InitByArray(uint32_t *init_key, int key_length);
int GetMinArraySize32();
@ -140,7 +140,7 @@ public:
/** These real versions are due to Isaku Wada */
/** generates a random number on [0,1) with 53-bit resolution*/
static inline double ToRes53(QWORD v)
static inline double ToRes53(uint64_t v)
{
return v * (1.0/18446744073709551616.0L);
}
@ -149,7 +149,7 @@ public:
* 32 bit integers */
static inline double ToRes53Mix(uint32_t x, uint32_t y)
{
return ToRes53(x | ((QWORD)y << 32));
return ToRes53(x | ((uint64_t)y << 32));
}
/** generates a random number on [0,1) with 53-bit resolution
@ -204,7 +204,7 @@ private:
{
w128_t w128[SFMT::N];
unsigned int u[SFMT::N32];
QWORD u64[SFMT::N64];
uint64_t u64[SFMT::N64];
} sfmt;
/** index counter to the 32-bit internal state array */
int idx;

View File

@ -523,7 +523,7 @@ namespace EnvelopeGeneratorData
class OPL3 : public OPLEmul
{
public:
BYTE registers[0x200];
uint8_t registers[0x200];
Operator *operators[2][0x20];
Channel2op *channels2op[2][9];

View File

@ -3276,7 +3276,7 @@ void P_LoadReject (MapData * map, bool junk)
if (qwords > 0)
{
const QWORD *qreject = (const QWORD *)rejectmatrix;
const uint64_t *qreject = (const uint64_t *)rejectmatrix;
i = 0;
do

View File

@ -64,7 +64,7 @@ void PolyCull::CullNode(void *node)
node = bsp->children[side];
}
subsector_t *sub = (subsector_t *)((BYTE *)node - 1);
subsector_t *sub = (subsector_t *)((uint8_t *)node - 1);
CullSubsector(sub);
}

View File

@ -411,7 +411,7 @@ void PolyScreenSprite::Render()
Colormap->Desaturate == 0)
{
overlay = Colormap->Fade;
overlay.a = BYTE(ColormapNum * 255 / NUMCOLORMAPS);
overlay.a = uint8_t(ColormapNum * 255 / NUMCOLORMAPS);
}
else
{

View File

@ -177,7 +177,7 @@ void RenderPolyScene::RenderSprite(AActor *thing, double sortDistance, DVector2
node = bsp->children[sideLeft];
}
subsector_t *sub = (subsector_t *)((BYTE *)node - 1);
subsector_t *sub = (subsector_t *)((uint8_t *)node - 1);
auto it = SubsectorDepths.find(sub);
if (it != SubsectorDepths.end())

View File

@ -40,7 +40,7 @@
#include "version.h"
static NSColor* RGB(const BYTE red, const BYTE green, const BYTE blue)
static NSColor* RGB(const uint8_t red, const uint8_t green, const uint8_t blue)
{
return [NSColor colorWithCalibratedRed:red / 255.0f
green:green / 255.0f
@ -250,7 +250,7 @@ void FConsoleWindow::AddText(const char* message)
if (TEXTCOLOR_ESCAPE == *message)
{
const BYTE* colorID = reinterpret_cast<const BYTE*>(message) + 1;
const uint8_t* colorID = reinterpret_cast<const uint8_t*>(message) + 1;
if ('\0' == *colorID)
{
break;

View File

@ -26,7 +26,7 @@ bool I_SetCursor(FTexture *cursorpic)
cursorSurface = SDL_CreateRGBSurface (0, 32, 32, 32, MAKEARGB(0,255,0,0), MAKEARGB(0,0,255,0), MAKEARGB(0,0,0,255), MAKEARGB(255,0,0,0));
SDL_LockSurface(cursorSurface);
BYTE buffer[32*32*4];
uint8_t buffer[32*32*4];
memset(buffer, 0, 32*32*4);
FBitmap bmp(buffer, 32*4, 32, 32);
cursorpic->CopyTrueColorPixels(&bmp, 0, 0);

View File

@ -139,7 +139,7 @@ public:
void ProcessInput()
{
BYTE buttonstate;
uint8_t buttonstate;
for (int i = 0; i < NumAxes; ++i)
{
@ -206,7 +206,7 @@ protected:
float Multiplier;
EJoyAxis GameAxis;
double Value;
BYTE ButtonValue;
uint8_t ButtonValue;
};
static const EJoyAxis DefaultAxes[5];

View File

@ -81,7 +81,7 @@ protected:
void InitializeState();
SDLGLFB () {}
BYTE GammaTable[3][256];
uint8_t GammaTable[3][256];
bool UpdatePending;
SDL_Window *Screen;

View File

@ -34,7 +34,7 @@ public:
private:
PalEntry SourcePalette[256];
BYTE GammaTable[3][256];
uint8_t GammaTable[3][256];
PalEntry Flash;
int FlashAmount;
float Gamma;

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();

View File

@ -29,7 +29,7 @@ struct FRenderer
virtual bool UsesColormap() const = 0;
// precache one texture
virtual void Precache(BYTE *texhitlist, TMap<PClassActor*, bool> &actorhitlist) = 0;
virtual void Precache(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitlist) = 0;
// render 3D view
virtual void RenderView(player_t *player) = 0;

View File

@ -41,7 +41,7 @@ struct FResourceLump
char Name[9];
uint32_t dwName; // These are for accessing the first 4 or 8 chars of
QWORD qwName; // Name as a unit without breaking strict aliasing rules
uint64_t qwName; // Name as a unit without breaking strict aliasing rules
};
uint8_t Flags;
int8_t RefCount;

View File

@ -2353,7 +2353,7 @@ void S_SerializeSounds(FSerializer &arc)
for (unsigned int i = chans.Size(); i-- != 0; )
{
// Replace start time with sample position.
QWORD start = chans[i]->StartTime.AsOne;
uint64_t start = chans[i]->StartTime.AsOne;
chans[i]->StartTime.AsOne = GSnd ? GSnd->GetPosition(chans[i]) : 0;
arc(nullptr, *chans[i]);
chans[i]->StartTime.AsOne = start;

View File

@ -81,10 +81,10 @@ inline static int idxof(int i) {
*/
#ifdef ONLY64
inline static void rshift128(w128_t *out, w128_t const *in, int shift) {
QWORD th, tl, oh, ol;
uint64_t th, tl, oh, ol;
th = ((QWORD)in->u[2] << 32) | ((QWORD)in->u[3]);
tl = ((QWORD)in->u[0] << 32) | ((QWORD)in->u[1]);
th = ((uint64_t)in->u[2] << 32) | ((uint64_t)in->u[3]);
tl = ((uint64_t)in->u[0] << 32) | ((uint64_t)in->u[1]);
oh = th >> (shift * 8);
ol = tl >> (shift * 8);
@ -96,10 +96,10 @@ inline static void rshift128(w128_t *out, w128_t const *in, int shift) {
}
#else
inline static void rshift128(w128_t *out, w128_t const *in, int shift) {
QWORD th, tl, oh, ol;
uint64_t th, tl, oh, ol;
th = ((QWORD)in->u[3] << 32) | ((QWORD)in->u[2]);
tl = ((QWORD)in->u[1] << 32) | ((QWORD)in->u[0]);
th = ((uint64_t)in->u[3] << 32) | ((uint64_t)in->u[2]);
tl = ((uint64_t)in->u[1] << 32) | ((uint64_t)in->u[0]);
oh = th >> (shift * 8);
ol = tl >> (shift * 8);
@ -120,10 +120,10 @@ inline static void rshift128(w128_t *out, w128_t const *in, int shift) {
*/
#ifdef ONLY64
inline static void lshift128(w128_t *out, w128_t const *in, int shift) {
QWORD th, tl, oh, ol;
uint64_t th, tl, oh, ol;
th = ((QWORD)in->u[2] << 32) | ((QWORD)in->u[3]);
tl = ((QWORD)in->u[0] << 32) | ((QWORD)in->u[1]);
th = ((uint64_t)in->u[2] << 32) | ((uint64_t)in->u[3]);
tl = ((uint64_t)in->u[0] << 32) | ((uint64_t)in->u[1]);
oh = th << (shift * 8);
ol = tl << (shift * 8);
@ -135,10 +135,10 @@ inline static void lshift128(w128_t *out, w128_t const *in, int shift) {
}
#else
inline static void lshift128(w128_t *out, w128_t const *in, int shift) {
QWORD th, tl, oh, ol;
uint64_t th, tl, oh, ol;
th = ((QWORD)in->u[3] << 32) | ((QWORD)in->u[2]);
tl = ((QWORD)in->u[1] << 32) | ((QWORD)in->u[0]);
th = ((uint64_t)in->u[3] << 32) | ((uint64_t)in->u[2]);
tl = ((uint64_t)in->u[1] << 32) | ((uint64_t)in->u[0]);
oh = th << (shift * 8);
ol = tl << (shift * 8);
@ -379,12 +379,12 @@ unsigned int FRandom::GenRand32()
* unless an initialization is again executed.
* @return 64-bit pseudorandom number
*/
QWORD FRandom::GenRand64()
uint64_t FRandom::GenRand64()
{
#if defined(BIG_ENDIAN64) && !defined(ONLY64)
uint32_t r1, r2;
#else
QWORD r;
uint64_t r;
#endif
assert(initialized);
@ -399,7 +399,7 @@ QWORD FRandom::GenRand64()
r1 = sfmt.u[idx];
r2 = sfmt.u[idx + 1];
idx += 2;
return ((QWORD)r2 << 32) | r1;
return ((uint64_t)r2 << 32) | r1;
#else
r = sfmt.u64[idx / 2];
idx += 2;
@ -470,7 +470,7 @@ void FRandom::FillArray32(uint32_t *array, int size)
* memory. Mac OSX doesn't have these functions, but \b malloc of OSX
* returns the pointer to the aligned memory block.
*/
void FRandom::FillArray64(QWORD *array, int size)
void FRandom::FillArray64(uint64_t *array, int size)
{
assert(initialized);
assert(idx == SFMT::N32);

View File

@ -68,7 +68,7 @@
union w128_t {
vector unsigned int s;
uint32_t u[4];
QWORD u64[2];
uint64_t u64[2];
};
#elif defined(HAVE_SSE2)
@ -78,7 +78,7 @@ union w128_t {
union w128_t {
__m128i si;
uint32_t u[4];
QWORD u64[2];
uint64_t u64[2];
};
#else
@ -86,7 +86,7 @@ union w128_t {
/** 128-bit data structure */
union w128_t {
uint32_t u[4];
QWORD u64[2];
uint64_t u64[2];
};
#endif

View File

@ -2203,11 +2203,11 @@ bool FMODSoundRenderer::HandleChannelDelay(FMOD::Channel *chan, FISoundChannel *
{
chan->setPosition(seekpos, FMOD_TIMEUNIT_PCM);
}
reuse_chan->StartTime.AsOne = QWORD(nowtime.AsOne - seekpos * OutputRate / freq);
reuse_chan->StartTime.AsOne = uint64_t(nowtime.AsOne - seekpos * OutputRate / freq);
}
else if (reuse_chan->StartTime.AsOne != 0)
{
QWORD difftime = nowtime.AsOne - reuse_chan->StartTime.AsOne;
uint64_t difftime = nowtime.AsOne - reuse_chan->StartTime.AsOne;
if (difftime > 0)
{
// Clamp the position of looping sounds to be within the sound.
@ -2743,7 +2743,7 @@ void FMODSoundRenderer::UpdateSounds()
//
//==========================================================================
std::pair<SoundHandle,bool> FMODSoundRenderer::LoadSoundRaw(BYTE *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend, bool monoize)
std::pair<SoundHandle,bool> FMODSoundRenderer::LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend, bool monoize)
{
FMOD_CREATESOUNDEXINFO exinfo;
SoundHandle retval = { NULL };
@ -2825,7 +2825,7 @@ std::pair<SoundHandle,bool> FMODSoundRenderer::LoadSoundRaw(BYTE *sfxdata, int l
//
//==========================================================================
std::pair<SoundHandle,bool> FMODSoundRenderer::LoadSound(BYTE *sfxdata, int length, bool monoize)
std::pair<SoundHandle,bool> FMODSoundRenderer::LoadSound(uint8_t *sfxdata, int length, bool monoize)
{
FMOD_CREATESOUNDEXINFO exinfo;
SoundHandle retval = { NULL };
@ -3382,7 +3382,7 @@ short *FMODSoundRenderer::DecodeSample(int outlen, const void *coded, int sizeby
sound->release();
if (result == FMOD_ERR_FILE_EOF)
{
memset((BYTE *)outbuf + amt_read, 0, len - amt_read);
memset((uint8_t *)outbuf + amt_read, 0, len - amt_read);
}
else if (result != FMOD_OK || amt_read != len)
{

View File

@ -15,8 +15,8 @@ public:
void SetSfxVolume (float volume);
void SetMusicVolume (float volume);
std::pair<SoundHandle,bool> LoadSound(BYTE *sfxdata, int length, bool monoize);
std::pair<SoundHandle,bool> LoadSoundRaw(BYTE *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1, bool monoize = false);
std::pair<SoundHandle,bool> LoadSound(uint8_t *sfxdata, int length, bool monoize);
std::pair<SoundHandle,bool> LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1, bool monoize = false);
void UnloadSound (SoundHandle sfx);
unsigned int GetMSLength(SoundHandle sfx);
unsigned int GetSampleLength(SoundHandle sfx);

View File

@ -92,14 +92,14 @@ enum EMIDIType
MIDI_MUS
};
extern int MUSHeaderSearch(const BYTE *head, int len);
extern int MUSHeaderSearch(const uint8_t *head, int len);
EXTERN_CVAR (Int, snd_samplerate)
EXTERN_CVAR (Int, snd_mididevice)
static bool MusicDown = true;
static bool ungzip(BYTE *data, int size, TArray<BYTE> &newdata);
static bool ungzip(uint8_t *data, int size, TArray<uint8_t> &newdata);
MusInfo *currSong;
int nomusic = 0;
@ -351,7 +351,7 @@ static EMIDIType IdentifyMIDIType(DWORD *id, int size)
{
// Check for MUS format
// Tolerate sloppy wads by searching up to 32 bytes for the header
if (MUSHeaderSearch((BYTE*)id, size) >= 0)
if (MUSHeaderSearch((uint8_t*)id, size) >= 0)
{
return MIDI_MUS;
}
@ -420,7 +420,7 @@ MusInfo *I_RegisterSong (FileReader *reader, MidiDeviceSetting *device)
if ((id[0] & MAKE_ID(255, 255, 255, 0)) == GZIP_ID)
{
int len = reader->GetLength();
BYTE *gzipped = new BYTE[len];
uint8_t *gzipped = new uint8_t[len];
if (reader->Read(gzipped, len) != len)
{
delete[] gzipped;
@ -481,7 +481,7 @@ retry_as_sndsys:
else if (
(id[0] == MAKE_ID('R','A','W','A') && id[1] == MAKE_ID('D','A','T','A')) || // Rdos Raw OPL
(id[0] == MAKE_ID('D','B','R','A') && id[1] == MAKE_ID('W','O','P','L')) || // DosBox Raw OPL
(id[0] == MAKE_ID('A','D','L','I') && *((BYTE *)id + 4) == 'B')) // Martin Fernandez's modified IMF
(id[0] == MAKE_ID('A','D','L','I') && *((uint8_t *)id + 4) == 'B')) // Martin Fernandez's modified IMF
{
info = new OPLMUSSong (*reader, device != NULL? device->args.GetChars() : "");
}
@ -590,11 +590,11 @@ MusInfo *I_RegisterURLSong (const char *url)
//
//==========================================================================
static bool ungzip(BYTE *data, int complen, TArray<BYTE> &newdata)
static bool ungzip(uint8_t *data, int complen, TArray<uint8_t> &newdata)
{
const BYTE *max = data + complen - 8;
const BYTE *compstart = data + 10;
BYTE flags = data[3];
const uint8_t *max = data + complen - 8;
const uint8_t *compstart = data + 10;
uint8_t flags = data[3];
unsigned isize;
z_stream stream;
int err;
@ -827,7 +827,7 @@ CCMD (writemidi)
return;
}
TArray<BYTE> midi;
TArray<uint8_t> midi;
FILE *f;
bool success;

View File

@ -42,7 +42,7 @@ EXTERN_CVAR (Float, timidity_mastervolume)
#ifndef _WIN32
struct MIDIHDR
{
BYTE *lpData;
uint8_t *lpData;
DWORD dwBufferLength;
DWORD dwBytesRecorded;
MIDIHDR *lpNext;
@ -59,13 +59,13 @@ enum
MOD_SWSYNTH
};
typedef BYTE *LPSTR;
typedef uint8_t *LPSTR;
#define MEVT_TEMPO ((BYTE)1)
#define MEVT_NOP ((BYTE)2)
#define MEVT_LONGMSG ((BYTE)128)
#define MEVT_TEMPO ((uint8_t)1)
#define MEVT_NOP ((uint8_t)2)
#define MEVT_LONGMSG ((uint8_t)128)
#define MEVT_EVENTTYPE(x) ((BYTE)((x) >> 24))
#define MEVT_EVENTTYPE(x) ((uint8_t)((x) >> 24))
#define MEVT_EVENTPARM(x) ((x) & 0xffffff)
#define MOM_DONE 969
@ -302,7 +302,7 @@ protected:
virtual bool ServiceStream (void *buff, int numbytes);
virtual void HandleEvent(int status, int parm1, int parm2) = 0;
virtual void HandleLongEvent(const BYTE *data, int len) = 0;
virtual void HandleLongEvent(const uint8_t *data, int len) = 0;
virtual void ComputeOutput(float *buffer, int len) = 0;
};
@ -321,7 +321,7 @@ protected:
void CalcTickRate();
int PlayTick();
void HandleEvent(int status, int parm1, int parm2);
void HandleLongEvent(const BYTE *data, int len);
void HandleLongEvent(const uint8_t *data, int len);
void ComputeOutput(float *buffer, int len);
bool ServiceStream(void *buff, int numbytes);
};
@ -355,7 +355,7 @@ protected:
Timidity::Renderer *Renderer;
void HandleEvent(int status, int parm1, int parm2);
void HandleLongEvent(const BYTE *data, int len);
void HandleLongEvent(const uint8_t *data, int len);
void ComputeOutput(float *buffer, int len);
};
@ -389,7 +389,7 @@ protected:
WildMidi_Renderer *Renderer;
void HandleEvent(int status, int parm1, int parm2);
void HandleLongEvent(const BYTE *data, int len);
void HandleLongEvent(const uint8_t *data, int len);
void ComputeOutput(float *buffer, int len);
void WildMidiSetOption(int opt, int set);
};
@ -421,7 +421,7 @@ public:
protected:
void HandleEvent(int status, int parm1, int parm2);
void HandleLongEvent(const BYTE *data, int len);
void HandleLongEvent(const uint8_t *data, int len);
void ComputeOutput(float *buffer, int len);
int LoadPatchSets(const char *patches);
@ -489,7 +489,7 @@ public:
void FluidSettingNum(const char *setting, double value);
void FluidSettingStr(const char *setting, const char *value);
void WildMidiSetOption(int opt, int set);
void CreateSMF(TArray<BYTE> &file, int looplimit=0);
void CreateSMF(TArray<uint8_t> &file, int looplimit=0);
protected:
MIDIStreamer(const char *dumpname, EMidiDevice type);
@ -550,7 +550,7 @@ protected:
int Division;
int Tempo;
int InitialTempo;
BYTE ChannelVolumes[16];
uint8_t ChannelVolumes[16];
DWORD Volume;
EMidiDevice DeviceType;
bool CallbackIsThreaded;
@ -580,8 +580,8 @@ protected:
DWORD *MakeEvents(DWORD *events, DWORD *max_events_p, DWORD max_time);
MUSHeader *MusHeader;
BYTE *MusBuffer;
BYTE LastVelocity[16];
uint8_t *MusBuffer;
uint8_t LastVelocity[16];
size_t MusP, MaxMusP;
};
@ -612,7 +612,7 @@ protected:
DWORD *SendCommand (DWORD *event, TrackInfo *track, DWORD delay, ptrdiff_t room, bool &sysex_noroom);
TrackInfo *FindNextDue ();
BYTE *MusHeader;
uint8_t *MusHeader;
int SongLen;
TrackInfo *Tracks;
TrackInfo *TrackDue;
@ -626,13 +626,13 @@ protected:
struct AutoNoteOff
{
DWORD Delay;
BYTE Channel, Key;
uint8_t Channel, Key;
};
// Sorry, std::priority_queue, but I want to be able to modify the contents of the heap.
class NoteOffQueue : public TArray<AutoNoteOff>
{
public:
void AddNoteOff(DWORD delay, BYTE channel, BYTE key);
void AddNoteOff(DWORD delay, uint8_t channel, uint8_t key);
void AdvanceTime(DWORD time);
bool Pop(AutoNoteOff &item);
@ -675,7 +675,7 @@ protected:
static DWORD ReadVarLenHMI(TrackInfo *);
static DWORD ReadVarLenHMP(TrackInfo *);
BYTE *MusHeader;
uint8_t *MusHeader;
int SongLen;
int NumTracks;
TrackInfo *Tracks;
@ -702,8 +702,8 @@ protected:
XMISong(const XMISong *original, const char *filename, EMidiDevice type); // file dump constructor
int FindXMIDforms(const BYTE *chunk, int len, TrackInfo *songs) const;
void FoundXMID(const BYTE *chunk, int len, TrackInfo *song) const;
int FindXMIDforms(const uint8_t *chunk, int len, TrackInfo *songs) const;
void FoundXMID(const uint8_t *chunk, int len, TrackInfo *song) const;
bool SetMIDISubsong(int subsong);
void DoInitialSetup();
void DoRestart();
@ -715,7 +715,7 @@ protected:
DWORD *SendCommand (DWORD *event, EventSource track, DWORD delay, ptrdiff_t room, bool &sysex_noroom);
EventSource FindNextDue();
BYTE *MusHeader;
uint8_t *MusHeader;
int SongLen; // length of the entire file
int NumSongs;
TrackInfo *Songs;

View File

@ -135,12 +135,12 @@ public:
void SetMusicVolume (float volume)
{
}
std::pair<SoundHandle,bool> LoadSound(BYTE *sfxdata, int length, bool monoize)
std::pair<SoundHandle,bool> LoadSound(uint8_t *sfxdata, int length, bool monoize)
{
SoundHandle retval = { NULL };
return std::make_pair(retval, true);
}
std::pair<SoundHandle,bool> LoadSoundRaw(BYTE *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend, bool monoize)
std::pair<SoundHandle,bool> LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend, bool monoize)
{
SoundHandle retval = { NULL };
return std::make_pair(retval, true);
@ -461,9 +461,9 @@ FString SoundStream::GetStats()
//
//==========================================================================
std::pair<SoundHandle,bool> SoundRenderer::LoadSoundVoc(BYTE *sfxdata, int length, bool monoize)
std::pair<SoundHandle,bool> SoundRenderer::LoadSoundVoc(uint8_t *sfxdata, int length, bool monoize)
{
BYTE * data = NULL;
uint8_t * data = NULL;
int len, frequency, channels, bits, loopstart, loopend;
len = frequency = channels = bits = 0;
loopstart = loopend = -1;
@ -568,7 +568,7 @@ std::pair<SoundHandle,bool> SoundRenderer::LoadSoundVoc(BYTE *sfxdata, int lengt
// Second pass to write the data
if (okay)
{
data = new BYTE[len];
data = new uint8_t[len];
i = 26;
int j = 0;
while (i < length)

View File

@ -97,9 +97,9 @@ public:
virtual void SetSfxVolume (float volume) = 0;
virtual void SetMusicVolume (float volume) = 0;
// Returns a pair containing a sound handle and a boolean indicating the sound can be used in 3D.
virtual std::pair<SoundHandle,bool> LoadSound(BYTE *sfxdata, int length, bool monoize=false) = 0;
std::pair<SoundHandle,bool> LoadSoundVoc(BYTE *sfxdata, int length, bool monoize=false);
virtual std::pair<SoundHandle,bool> LoadSoundRaw(BYTE *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1, bool monoize = false) = 0;
virtual std::pair<SoundHandle,bool> LoadSound(uint8_t *sfxdata, int length, bool monoize=false) = 0;
std::pair<SoundHandle,bool> LoadSoundVoc(uint8_t *sfxdata, int length, bool monoize=false);
virtual std::pair<SoundHandle,bool> LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1, bool monoize = false) = 0;
virtual void UnloadSound (SoundHandle sfx) = 0; // unloads a sound from memory
virtual unsigned int GetMSLength(SoundHandle sfx) = 0; // Gets the length of a sound at its default frequency
virtual unsigned int GetSampleLength(SoundHandle sfx) = 0; // Gets the length of a sound at its default frequency

View File

@ -250,7 +250,7 @@ bool AudioToolboxMIDIDevice::Preprocess(MIDIStreamer* song, bool looping)
{
assert(nullptr != song);
TArray<BYTE> midi;
TArray<uint8_t> midi;
song->CreateSMF(midi, looping ? 0 : 1);
CFDataRef data = CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, &midi[0], midi.Size(), kCFAllocatorNull);

View File

@ -145,9 +145,9 @@ CUSTOM_CVAR(Float, mod_dumb_mastervolume, 1.f, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
//
//==========================================================================
static inline QWORD time_to_samples(double p_time,int p_sample_rate)
static inline uint64_t time_to_samples(double p_time,int p_sample_rate)
{
return (QWORD)floor((double)p_sample_rate * p_time + 0.5);
return (uint64_t)floor((double)p_sample_rate * p_time + 0.5);
}
//==========================================================================

View File

@ -438,7 +438,7 @@ void FluidSynthMIDIDevice::HandleEvent(int status, int parm1, int parm2)
//
//==========================================================================
void FluidSynthMIDIDevice::HandleLongEvent(const BYTE *data, int len)
void FluidSynthMIDIDevice::HandleLongEvent(const uint8_t *data, int len)
{
if (len > 1 && (data[0] == 0xF0 || data[0] == 0xF7))
{

View File

@ -117,7 +117,7 @@ MusInfo *GME_OpenSong(FileReader &reader, const char *fmt)
{
gme_type_t type;
gme_err_t err;
BYTE *song;
uint8_t *song;
Music_Emu *emu;
int sample_rate;
@ -135,7 +135,7 @@ MusInfo *GME_OpenSong(FileReader &reader, const char *fmt)
int fpos = reader.Tell();
int len = reader.GetLength();
song = new BYTE[len];
song = new uint8_t[len];
if (reader.Read(song, len) != len)
{
delete[] song;

View File

@ -89,7 +89,7 @@
struct HMISong::TrackInfo
{
const BYTE *TrackBegin;
const uint8_t *TrackBegin;
size_t TrackP;
size_t MaxTrackP;
DWORD Delay;
@ -97,7 +97,7 @@ struct HMISong::TrackInfo
uint16_t Designation[NUM_HMI_DESIGNATIONS];
bool Enabled;
bool Finished;
BYTE RunningStatus;
uint8_t RunningStatus;
DWORD ReadVarLenHMI();
DWORD ReadVarLenHMP();
@ -142,7 +142,7 @@ HMISong::HMISong (FileReader &reader, EMidiDevice type, const char *args)
{ // Way too small to be HMI.
return;
}
MusHeader = new BYTE[len];
MusHeader = new uint8_t[len];
SongLen = len;
NumTracks = 0;
if (reader.Read(MusHeader, len) != len)
@ -576,7 +576,7 @@ void HMISong::AdvanceTracks(DWORD time)
DWORD *HMISong::SendCommand (DWORD *events, TrackInfo *track, DWORD delay, ptrdiff_t room, bool &sysex_noroom)
{
DWORD len;
BYTE event, data1 = 0, data2 = 0;
uint8_t event, data1 = 0, data2 = 0;
// If the next event comes from the fake track, pop an entry off the note-off queue.
if (track == FakeTrack)
@ -669,7 +669,7 @@ DWORD *HMISong::SendCommand (DWORD *events, TrackInfo *track, DWORD delay, ptrdi
}
else
{
BYTE *msg = (BYTE *)&events[3];
uint8_t *msg = (uint8_t *)&events[3];
if (event == MIDI_SYSEX)
{ // Need to add the SysEx marker to the message.
events[2] = (MEVT_LONGMSG << 24) | (len + 1);
@ -782,7 +782,7 @@ void HMISong::ProcessInitialMetaEvents ()
{
TrackInfo *track;
int i;
BYTE event;
uint8_t event;
DWORD len;
for (i = 0; i < NumTracks; ++i)
@ -877,7 +877,7 @@ DWORD HMISong::TrackInfo::ReadVarLenHMI()
DWORD HMISong::TrackInfo::ReadVarLenHMP()
{
DWORD time = 0;
BYTE t = 0;
uint8_t t = 0;
int off = 0;
while (!(t & 0x80) && TrackP < MaxTrackP)
@ -895,7 +895,7 @@ DWORD HMISong::TrackInfo::ReadVarLenHMP()
//
//==========================================================================
void NoteOffQueue::AddNoteOff(DWORD delay, BYTE channel, BYTE key)
void NoteOffQueue::AddNoteOff(DWORD delay, uint8_t channel, uint8_t key)
{
unsigned int i = Reserve(1);
while (i > 0 && (*this)[Parent(i)].Delay > delay)
@ -1052,7 +1052,7 @@ HMISong::HMISong(const HMISong *original, const char *filename, EMidiDevice type
: MIDIStreamer(filename, type)
{
SongLen = original->SongLen;
MusHeader = new BYTE[original->SongLen];
MusHeader = new uint8_t[original->SongLen];
memcpy(MusHeader, original->MusHeader, original->SongLen);
NumTracks = original->NumTracks;
Division = original->Division;

View File

@ -140,7 +140,7 @@ TimidityPPMIDIDevice::~TimidityPPMIDIDevice ()
bool TimidityPPMIDIDevice::Preprocess(MIDIStreamer *song, bool looping)
{
TArray<BYTE> midi;
TArray<uint8_t> midi;
bool success;
FILE *f;
@ -287,9 +287,9 @@ bool TimidityPPMIDIDevice::ValidateTimidity()
DWORD fileLen;
HANDLE diskFile;
HANDLE mapping;
const BYTE *exeBase;
const BYTE *exeEnd;
const BYTE *exe;
const uint8_t *exeBase;
const uint8_t *exeEnd;
const uint8_t *exe;
bool good;
pathLen = SearchPath (NULL, timidity_exe, NULL, MAX_PATH, foundPath, &filePart);
@ -319,7 +319,7 @@ bool TimidityPPMIDIDevice::ValidateTimidity()
CloseHandle (diskFile);
return false;
}
exeBase = (const BYTE *)MapViewOfFile (mapping, FILE_MAP_READ, 0, 0, 0);
exeBase = (const uint8_t *)MapViewOfFile (mapping, FILE_MAP_READ, 0, 0, 0);
if (exeBase == NULL)
{
Printf(PRINT_BOLD, "Could not map %s\n", foundPath);
@ -343,7 +343,7 @@ bool TimidityPPMIDIDevice::ValidateTimidity()
good = true;
break;
}
exe = (const BYTE *)tSpot + 1;
exe = (const uint8_t *)tSpot + 1;
}
}
catch (...)
@ -509,7 +509,7 @@ bool TimidityPPMIDIDevice::FillStream(SoundStream *stream, void *buff, int len,
didget = 0;
for (;;)
{
ReadFile(song->ReadWavePipe, (BYTE *)buff+didget, len-didget, &got, NULL);
ReadFile(song->ReadWavePipe, (uint8_t *)buff+didget, len-didget, &got, NULL);
didget += got;
if (didget >= (DWORD)len)
break;
@ -518,7 +518,7 @@ bool TimidityPPMIDIDevice::FillStream(SoundStream *stream, void *buff, int len,
Sleep (10);
if (!PeekNamedPipe(song->ReadWavePipe, NULL, 0, NULL, &avail, NULL) || avail == 0)
{
memset ((BYTE *)buff+didget, 0, len-didget);
memset ((uint8_t *)buff+didget, 0, len-didget);
break;
}
}
@ -549,10 +549,10 @@ bool TimidityPPMIDIDevice::FillStream(SoundStream *stream, void *buff, int len,
}
// fprintf(stderr,"something\n");
got = read(song->WavePipe[0], (BYTE *)buff, len);
got = read(song->WavePipe[0], (uint8_t *)buff, len);
if (got < len)
{
memset((BYTE *)buff+got, 0, len-got);
memset((uint8_t *)buff+got, 0, len-got);
}
#endif
return true;

View File

@ -53,7 +53,7 @@
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static void WriteVarLen (TArray<BYTE> &file, DWORD value);
static void WriteVarLen (TArray<uint8_t> &file, DWORD value);
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
@ -68,7 +68,7 @@ extern char MIDI_EventLengths[7];
// PRIVATE DATA DEFINITIONS ------------------------------------------------
static const BYTE StaticMIDIhead[] =
static const uint8_t StaticMIDIhead[] =
{
'M','T','h','d', 0, 0, 0, 6,
0, 0, // format 0: only one track
@ -955,7 +955,7 @@ int MIDIStreamer::FillBuffer(int buffer_num, int max_events, DWORD max_time)
VolumeChanged = false;
for (i = 0; i < 16; ++i)
{
BYTE courseVol = (BYTE)(((ChannelVolumes[i]+1) * NewVolume) >> 16);
uint8_t courseVol = (uint8_t)(((ChannelVolumes[i]+1) * NewVolume) >> 16);
events[0] = 0; // dwDeltaTime
events[1] = 0; // dwStreamID
events[2] = MIDI_CTRLCHANGE | i | (7<<8) | (courseVol<<16);
@ -1069,8 +1069,8 @@ DWORD *MIDIStreamer::WriteStopNotes(DWORD *events)
void MIDIStreamer::Precache()
{
BYTE found_instruments[256] = { 0, };
BYTE found_banks[256] = { 0, };
uint8_t found_instruments[256] = { 0, };
uint8_t found_banks[256] = { 0, };
bool multiple_banks = false;
LoopLimit = 1;
@ -1167,10 +1167,10 @@ void MIDIStreamer::Precache()
//
//==========================================================================
void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
void MIDIStreamer::CreateSMF(TArray<uint8_t> &file, int looplimit)
{
DWORD delay = 0;
BYTE running_status = 255;
uint8_t running_status = 255;
// Always create songs aimed at GM devices.
CheckCaps(MOD_MIDIPORT);
@ -1200,9 +1200,9 @@ void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
file.Push(MIDI_META);
file.Push(MIDI_META_TEMPO);
file.Push(3);
file.Push(BYTE(tempo >> 16));
file.Push(BYTE(tempo >> 8));
file.Push(BYTE(tempo));
file.Push(uint8_t(tempo >> 16));
file.Push(uint8_t(tempo >> 8));
file.Push(uint8_t(tempo));
running_status = 255;
}
else if (MEVT_EVENTTYPE(event[2]) == MEVT_LONGMSG)
@ -1210,7 +1210,7 @@ void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
WriteVarLen(file, delay);
delay = 0;
DWORD len = MEVT_EVENTPARM(event[2]);
BYTE *bytes = (BYTE *)&event[3];
uint8_t *bytes = (uint8_t *)&event[3];
if (bytes[0] == MIDI_SYSEX)
{
len--;
@ -1230,16 +1230,16 @@ void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
{
WriteVarLen(file, delay);
delay = 0;
BYTE status = BYTE(event[2]);
uint8_t status = uint8_t(event[2]);
if (status != running_status)
{
running_status = status;
file.Push(status);
}
file.Push(BYTE((event[2] >> 8) & 0x7F));
file.Push(uint8_t((event[2] >> 8) & 0x7F));
if (MIDI_EventLengths[(status >> 4) & 7] == 2)
{
file.Push(BYTE((event[2] >> 16) & 0x7F));
file.Push(uint8_t((event[2] >> 16) & 0x7F));
}
}
// Advance to next event
@ -1262,10 +1262,10 @@ void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
// Fill in track length
DWORD len = file.Size() - 22;
file[18] = BYTE(len >> 24);
file[19] = BYTE(len >> 16);
file[20] = BYTE(len >> 8);
file[21] = BYTE(len & 255);
file[18] = uint8_t(len >> 24);
file[19] = uint8_t(len >> 16);
file[20] = uint8_t(len >> 8);
file[21] = uint8_t(len & 255);
LoopLimit = 0;
}
@ -1276,7 +1276,7 @@ void MIDIStreamer::CreateSMF(TArray<BYTE> &file, int looplimit)
//
//==========================================================================
static void WriteVarLen (TArray<BYTE> &file, DWORD value)
static void WriteVarLen (TArray<uint8_t> &file, DWORD value)
{
DWORD buffer = value & 0x7F;
@ -1288,7 +1288,7 @@ static void WriteVarLen (TArray<BYTE> &file, DWORD value)
for (;;)
{
file.Push(BYTE(buffer));
file.Push(uint8_t(buffer));
if (buffer & 0x80)
{
buffer >>= 8;

View File

@ -53,7 +53,7 @@
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
int MUSHeaderSearch(const BYTE *head, int len);
int MUSHeaderSearch(const uint8_t *head, int len);
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
@ -61,7 +61,7 @@ int MUSHeaderSearch(const BYTE *head, int len);
// PRIVATE DATA DEFINITIONS ------------------------------------------------
static const BYTE CtrlTranslate[15] =
static const uint8_t CtrlTranslate[15] =
{
0, // program change
0, // bank select
@ -103,7 +103,7 @@ MUSSong2::MUSSong2 (FileReader &reader, EMidiDevice type, const char *args)
}
#endif
BYTE front[32];
uint8_t front[32];
int start;
if (reader.Read(front, sizeof(front)) != sizeof(front))
@ -127,9 +127,9 @@ MUSSong2::MUSSong2 (FileReader &reader, EMidiDevice type, const char *args)
{ // It's too short.
return;
}
MusHeader = (MUSHeader *)new BYTE[len];
MusHeader = (MUSHeader *)new uint8_t[len];
memcpy(MusHeader, front + start, sizeof(front) - start);
if (reader.Read((BYTE *)MusHeader + sizeof(front) - start, len - (sizeof(front) - start)) != (len - (32 - start)))
if (reader.Read((uint8_t *)MusHeader + sizeof(front) - start, len - (sizeof(front) - start)) != (len - (32 - start)))
{
return;
}
@ -140,7 +140,7 @@ MUSSong2::MUSSong2 (FileReader &reader, EMidiDevice type, const char *args)
return;
}
MusBuffer = (BYTE *)MusHeader + LittleShort(MusHeader->SongStart);
MusBuffer = (uint8_t *)MusHeader + LittleShort(MusHeader->SongStart);
MaxMusP = MIN<int>(LittleShort(MusHeader->SongLen), len - LittleShort(MusHeader->SongStart));
Division = 140;
InitialTempo = 1000000;
@ -156,7 +156,7 @@ MUSSong2::~MUSSong2 ()
{
if (MusHeader != NULL)
{
delete[] (BYTE *)MusHeader;
delete[] (uint8_t *)MusHeader;
}
}
@ -212,12 +212,12 @@ bool MUSSong2::CheckDone()
void MUSSong2::Precache()
{
TArray<uint16_t> work(LittleShort(MusHeader->NumInstruments));
const BYTE *used = (BYTE *)MusHeader + sizeof(MUSHeader) / sizeof(BYTE);
const uint8_t *used = (uint8_t *)MusHeader + sizeof(MUSHeader) / sizeof(uint8_t);
int i, k;
for (i = k = 0; i < LittleShort(MusHeader->NumInstruments); ++i)
{
BYTE instr = used[k++];
uint8_t instr = used[k++];
uint16_t val;
if (instr < 128)
{
@ -269,10 +269,10 @@ DWORD *MUSSong2::MakeEvents(DWORD *events, DWORD *max_event_p, DWORD max_time)
while (events < max_event_p && tot_time <= max_time)
{
BYTE mid1, mid2;
BYTE channel;
BYTE t = 0, status;
BYTE event = MusBuffer[MusP++];
uint8_t mid1, mid2;
uint8_t channel;
uint8_t t = 0, status;
uint8_t event = MusBuffer[MusP++];
if ((event & 0x70) != MUS_SCOREEND)
{
@ -409,9 +409,9 @@ MUSSong2::MUSSong2(const MUSSong2 *original, const char *filename, EMidiDevice t
{
int songstart = LittleShort(original->MusHeader->SongStart);
MaxMusP = original->MaxMusP;
MusHeader = (MUSHeader *)new BYTE[songstart + MaxMusP];
MusHeader = (MUSHeader *)new uint8_t[songstart + MaxMusP];
memcpy(MusHeader, original->MusHeader, songstart + MaxMusP);
MusBuffer = (BYTE *)MusHeader + songstart;
MusBuffer = (uint8_t *)MusHeader + songstart;
Division = 140;
InitialTempo = 1000000;
}
@ -425,7 +425,7 @@ MUSSong2::MUSSong2(const MUSSong2 *original, const char *filename, EMidiDevice t
//
//==========================================================================
int MUSHeaderSearch(const BYTE *head, int len)
int MUSHeaderSearch(const uint8_t *head, int len)
{
len -= 4;
for (int i = 0; i <= len; ++i)

View File

@ -57,13 +57,13 @@
struct MIDISong2::TrackInfo
{
const BYTE *TrackBegin;
const uint8_t *TrackBegin;
size_t TrackP;
size_t MaxTrackP;
DWORD Delay;
DWORD PlayedTime;
bool Finished;
BYTE RunningStatus;
uint8_t RunningStatus;
bool Designated;
bool EProgramChange;
bool EVolume;
@ -115,7 +115,7 @@ MIDISong2::MIDISong2 (FileReader &reader, EMidiDevice type, const char *args)
}
#endif
SongLen = reader.GetLength();
MusHeader = new BYTE[SongLen];
MusHeader = new uint8_t[SongLen];
if (reader.Read(MusHeader, SongLen) != SongLen)
return;
@ -374,7 +374,7 @@ void MIDISong2::AdvanceTracks(DWORD time)
DWORD *MIDISong2::SendCommand (DWORD *events, TrackInfo *track, DWORD delay, ptrdiff_t room, bool &sysex_noroom)
{
DWORD len;
BYTE event, data1 = 0, data2 = 0;
uint8_t event, data1 = 0, data2 = 0;
int i;
sysex_noroom = false;
@ -610,7 +610,7 @@ DWORD *MIDISong2::SendCommand (DWORD *events, TrackInfo *track, DWORD delay, ptr
}
else
{
BYTE *msg = (BYTE *)&events[3];
uint8_t *msg = (uint8_t *)&events[3];
if (event == MIDI_SYSEX)
{ // Need to add the SysEx marker to the message.
events[2] = (MEVT_LONGMSG << 24) | (len + 1);
@ -699,7 +699,7 @@ void MIDISong2::ProcessInitialMetaEvents ()
{
TrackInfo *track;
int i;
BYTE event;
uint8_t event;
DWORD len;
for (i = 0; i < NumTracks; ++i)
@ -845,7 +845,7 @@ MIDISong2::MIDISong2(const MIDISong2 *original, const char *filename, EMidiDevic
: MIDIStreamer(filename, type)
{
SongLen = original->SongLen;
MusHeader = new BYTE[original->SongLen];
MusHeader = new uint8_t[original->SongLen];
memcpy(MusHeader, original->MusHeader, original->SongLen);
Format = original->Format;
NumTracks = original->NumTracks;

View File

@ -313,7 +313,7 @@ int SoftSynthMIDIDevice::PlayTick()
}
else if (MEVT_EVENTTYPE(event[2]) == MEVT_LONGMSG)
{
HandleLongEvent((BYTE *)&event[3], MEVT_EVENTPARM(event[2]));
HandleLongEvent((uint8_t *)&event[3], MEVT_EVENTPARM(event[2]));
}
else if (MEVT_EVENTTYPE(event[2]) == 0)
{ // Short MIDI event

View File

@ -63,7 +63,7 @@ struct FmtChunk
DWORD SubFormatA;
uint16_t SubFormatB;
uint16_t SubFormatC;
BYTE SubFormatD[8];
uint8_t SubFormatD[8];
};
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
@ -162,7 +162,7 @@ void TimidityMIDIDevice::HandleEvent(int status, int parm1, int parm2)
//
//==========================================================================
void TimidityMIDIDevice::HandleLongEvent(const BYTE *data, int len)
void TimidityMIDIDevice::HandleLongEvent(const uint8_t *data, int len)
{
Renderer->HandleLongMessage(data, len);
}

View File

@ -193,7 +193,7 @@ void WildMIDIDevice::HandleEvent(int status, int parm1, int parm2)
//
//==========================================================================
void WildMIDIDevice::HandleLongEvent(const BYTE *data, int len)
void WildMIDIDevice::HandleLongEvent(const uint8_t *data, int len)
{
Renderer->LongEvent(data, len);
}

View File

@ -247,7 +247,7 @@ void WinMIDIDevice::PrecacheInstruments(const uint16_t *instruments, int count)
{
return;
}
BYTE bank[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
uint8_t bank[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int i, chan;
for (i = 0, chan = 0; i < count; ++i)

View File

@ -65,11 +65,11 @@ struct LoopInfo
struct XMISong::TrackInfo
{
const BYTE *EventChunk;
const uint8_t *EventChunk;
size_t EventLen;
size_t EventP;
const BYTE *TimbreChunk;
const uint8_t *TimbreChunk;
size_t TimbreLen;
DWORD Delay;
@ -118,7 +118,7 @@ XMISong::XMISong (FileReader &reader, EMidiDevice type, const char *args)
}
#endif
SongLen = reader.GetLength();
MusHeader = new BYTE[SongLen];
MusHeader = new uint8_t[SongLen];
if (reader.Read(MusHeader, SongLen) != SongLen)
return;
@ -172,7 +172,7 @@ XMISong::~XMISong ()
//
//==========================================================================
int XMISong::FindXMIDforms(const BYTE *chunk, int len, TrackInfo *songs) const
int XMISong::FindXMIDforms(const uint8_t *chunk, int len, TrackInfo *songs) const
{
int count = 0;
@ -214,7 +214,7 @@ int XMISong::FindXMIDforms(const BYTE *chunk, int len, TrackInfo *songs) const
//
//==========================================================================
void XMISong::FoundXMID(const BYTE *chunk, int len, TrackInfo *song) const
void XMISong::FoundXMID(const uint8_t *chunk, int len, TrackInfo *song) const
{
for (int p = 0; p <= len - 8; )
{
@ -390,7 +390,7 @@ void XMISong::AdvanceSong(DWORD time)
DWORD *XMISong::SendCommand (DWORD *events, EventSource due, DWORD delay, ptrdiff_t room, bool &sysex_noroom)
{
DWORD len;
BYTE event, data1 = 0, data2 = 0;
uint8_t event, data1 = 0, data2 = 0;
if (due == EVENT_Fake)
{
@ -540,7 +540,7 @@ DWORD *XMISong::SendCommand (DWORD *events, EventSource due, DWORD delay, ptrdif
}
else
{
BYTE *msg = (BYTE *)&events[3];
uint8_t *msg = (uint8_t *)&events[3];
if (event == MIDI_SYSEX)
{ // Need to add the SysEx marker to the message.
events[2] = (MEVT_LONGMSG << 24) | (len + 1);
@ -616,7 +616,7 @@ DWORD *XMISong::SendCommand (DWORD *events, EventSource due, DWORD delay, ptrdif
void XMISong::ProcessInitialMetaEvents ()
{
TrackInfo *track = CurrSong;
BYTE event;
uint8_t event;
DWORD len;
while (!track->Finished &&
@ -736,7 +736,7 @@ XMISong::XMISong(const XMISong *original, const char *filename, EMidiDevice type
: MIDIStreamer(filename, type)
{
SongLen = original->SongLen;
MusHeader = new BYTE[original->SongLen];
MusHeader = new uint8_t[original->SongLen];
memcpy(MusHeader, original->MusHeader, original->SongLen);
NumSongs = original->NumSongs;
Tempo = InitialTempo = original->InitialTempo;

View File

@ -1099,7 +1099,7 @@ float OpenALSoundRenderer::GetOutputRate()
}
std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSoundRaw(BYTE *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend, bool monoize)
std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend, bool monoize)
{
SoundHandle retval = { NULL };
@ -1195,7 +1195,7 @@ std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSoundRaw(BYTE *sfxdata, int
return std::make_pair(retval, channels==1);
}
std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSound(BYTE *sfxdata, int length, bool monoize)
std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSound(uint8_t *sfxdata, int length, bool monoize)
{
SoundHandle retval = { NULL };
MemoryReader reader((const char*)sfxdata, length);
@ -1245,13 +1245,13 @@ std::pair<SoundHandle,bool> OpenALSoundRenderer::LoadSound(BYTE *sfxdata, int le
}
else if(type == SampleType_UInt8)
{
BYTE *sfxdata = (BYTE*)&data[0];
uint8_t *sfxdata = (uint8_t*)&data[0];
for(size_t i = 0;i < frames;i++)
{
int sum = 0;
for(size_t c = 0;c < chancount;c++)
sum += sfxdata[i*chancount + c] - 128;
sfxdata[i] = BYTE((sum / chancount) + 128);
sfxdata[i] = uint8_t((sum / chancount) + 128);
}
}
data.Resize(unsigned(data.Size()/chancount));

View File

@ -83,8 +83,8 @@ public:
virtual void SetSfxVolume(float volume);
virtual void SetMusicVolume(float volume);
virtual std::pair<SoundHandle,bool> LoadSound(BYTE *sfxdata, int length, bool monoize);
virtual std::pair<SoundHandle,bool> LoadSoundRaw(BYTE *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1, bool monoize = false);
virtual std::pair<SoundHandle,bool> LoadSound(uint8_t *sfxdata, int length, bool monoize);
virtual std::pair<SoundHandle,bool> LoadSoundRaw(uint8_t *sfxdata, int length, int frequency, int channels, int bits, int loopstart, int loopend = -1, bool monoize = false);
virtual void UnloadSound(SoundHandle sfx);
virtual unsigned int GetMSLength(SoundHandle sfx);
virtual unsigned int GetSampleLength(SoundHandle sfx);

View File

@ -150,7 +150,7 @@ namespace swrenderer
int tx = (xoffset >> FRACBITS) % mip_width;
if (tx < 0)
tx += mip_width;
source = (BYTE*)(pixels + tx * mip_height);
source = (uint8_t*)(pixels + tx * mip_height);
source2 = nullptr;
height = mip_height;
texturefracx = 0;
@ -162,8 +162,8 @@ namespace swrenderer
if (tx0 < 0)
tx0 += mip_width;
int tx1 = (tx0 + 1) % mip_width;
source = (BYTE*)(pixels + tx0 * mip_height);
source2 = (BYTE*)(pixels + tx1 * mip_height);
source = (uint8_t*)(pixels + tx0 * mip_height);
source2 = (uint8_t*)(pixels + tx1 * mip_height);
height = mip_height;
texturefracx = (xoffset >> (FRACBITS - 4)) & 15;
}

View File

@ -100,8 +100,8 @@ namespace swrenderer
uint32_t uv_step;
uint32_t uv_max;
const BYTE *source;
const BYTE *source2;
const uint8_t *source;
const uint8_t *source2;
uint32_t texturefracx;
uint32_t height;
};

View File

@ -451,7 +451,7 @@ void SWCanvas::DrawLine(DCanvas *canvas, int x0, int y0, int x1, int y1, int pal
}
else
{
BYTE *spot = canvas->GetBuffer() + y0*canvas->GetPitch() + x0;
uint8_t *spot = canvas->GetBuffer() + y0*canvas->GetPitch() + x0;
int pitch = canvas->GetPitch();
do
{
@ -475,7 +475,7 @@ void SWCanvas::DrawLine(DCanvas *canvas, int x0, int y0, int x1, int y1, int pal
}
else
{
BYTE *spot = canvas->GetBuffer() + y0*canvas->GetPitch() + x0;
uint8_t *spot = canvas->GetBuffer() + y0*canvas->GetPitch() + x0;
int advance = canvas->GetPitch() + xDir;
do
{
@ -588,7 +588,7 @@ void SWCanvas::DrawPixel(DCanvas *canvas, int x, int y, int palColor, uint32_t r
palColor = PalFromRGB(realcolor);
}
canvas->GetBuffer()[canvas->GetPitch() * y + x] = (BYTE)palColor;
canvas->GetBuffer()[canvas->GetPitch() * y + x] = (uint8_t)palColor;
}
void SWCanvas::PUTTRANSDOT(DCanvas *canvas, int xx, int yy, int basecolor, int level)
@ -633,7 +633,7 @@ void SWCanvas::PUTTRANSDOT(DCanvas *canvas, int xx, int yy, int basecolor, int l
}
else if (!r_blendmethod)
{
BYTE *spot = canvas->GetBuffer() + oldyyshifted + xx;
uint8_t *spot = canvas->GetBuffer() + oldyyshifted + xx;
DWORD *bg2rgb = Col2RGB8[1 + level];
DWORD *fg2rgb = Col2RGB8[63 - level];
DWORD fg = fg2rgb[basecolor];
@ -643,13 +643,13 @@ void SWCanvas::PUTTRANSDOT(DCanvas *canvas, int xx, int yy, int basecolor, int l
}
else
{
BYTE *spot = canvas->GetBuffer() + oldyyshifted + xx;
uint8_t *spot = canvas->GetBuffer() + oldyyshifted + xx;
uint32_t r = (GPalette.BaseColors[*spot].r * (64 - level) + GPalette.BaseColors[basecolor].r * level) / 256;
uint32_t g = (GPalette.BaseColors[*spot].g * (64 - level) + GPalette.BaseColors[basecolor].g * level) / 256;
uint32_t b = (GPalette.BaseColors[*spot].b * (64 - level) + GPalette.BaseColors[basecolor].b * level) / 256;
*spot = (BYTE)RGB256k.RGB[r][g][b];
*spot = (uint8_t)RGB256k.RGB[r][g][b];
}
}
@ -698,7 +698,7 @@ void SWCanvas::Clear(DCanvas *canvas, int left, int top, int right, int bottom,
}
else
{
BYTE *dest = canvas->GetBuffer() + top * Pitch + left;
uint8_t *dest = canvas->GetBuffer() + top * Pitch + left;
x = right - left;
for (y = top; y < bottom; y++)
{
@ -774,7 +774,7 @@ void SWCanvas::Dim(DCanvas *canvas, PalEntry color, float damount, int x1, int y
DWORD *bg2rgb;
DWORD fg;
BYTE *spot = canvas->GetBuffer() + x1 + y1*Pitch;
uint8_t *spot = canvas->GetBuffer() + x1 + y1*Pitch;
int gap = Pitch - w;
int alpha = (int)((float)64 * damount);
@ -819,7 +819,7 @@ void SWCanvas::Dim(DCanvas *canvas, PalEntry color, float damount, int x1, int y
uint32_t r = (dimmedcolor_r + GPalette.BaseColors[*spot].r * ialpha) >> 8;
uint32_t g = (dimmedcolor_g + GPalette.BaseColors[*spot].g * ialpha) >> 8;
uint32_t b = (dimmedcolor_b + GPalette.BaseColors[*spot].b * ialpha) >> 8;
*spot = (BYTE)RGB256k.RGB[r][g][b];
*spot = (uint8_t)RGB256k.RGB[r][g][b];
spot++;
}
spot += gap;

View File

@ -123,9 +123,9 @@ void FSoftwareRenderer::PrecacheTexture(FTexture *tex, int cache)
}
}
void FSoftwareRenderer::Precache(BYTE *texhitlist, TMap<PClassActor*, bool> &actorhitlist)
void FSoftwareRenderer::Precache(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitlist)
{
BYTE *spritelist = new BYTE[sprites.Size()];
uint8_t *spritelist = new uint8_t[sprites.Size()];
TMap<PClassActor*, bool>::Iterator it(actorhitlist);
TMap<PClassActor*, bool>::Pair *pair;
@ -249,7 +249,7 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin
{
auto viewport = RenderViewport::Instance();
BYTE *Pixels = viewport->RenderTarget->IsBgra() ? (BYTE*)tex->GetPixelsBgra() : (BYTE*)tex->GetPixels();
uint8_t *Pixels = viewport->RenderTarget->IsBgra() ? (uint8_t*)tex->GetPixelsBgra() : (uint8_t*)tex->GetPixels();
DSimpleCanvas *Canvas = viewport->RenderTarget->IsBgra() ? tex->GetCanvasBgra() : tex->GetCanvas();
// curse Doom's overuse of global variables in the renderer.
@ -295,7 +295,7 @@ void FSoftwareRenderer::RenderTextureView (FCanvasTexture *tex, AActor *viewpoin
// We need to make sure that both pixel buffers contain data:
int width = tex->GetWidth();
int height = tex->GetHeight();
BYTE *palbuffer = (BYTE *)tex->GetPixels();
uint8_t *palbuffer = (uint8_t *)tex->GetPixels();
uint32_t *bgrabuffer = (uint32_t*)tex->GetPixelsBgra();
for (int x = 0; x < width; x++)
{

View File

@ -13,7 +13,7 @@ struct FSoftwareRenderer : public FRenderer
bool UsesColormap() const override;
// precache textures
void Precache(BYTE *texhitlist, TMap<PClassActor*, bool> &actorhitlist) override;
void Precache(uint8_t *texhitlist, TMap<PClassActor*, bool> &actorhitlist) override;
// render 3D view
void RenderView(player_t *player) override;

View File

@ -718,7 +718,7 @@ namespace swrenderer
if ((unsigned int)(sub - subsectors) < (unsigned int)numsubsectors)
{ // Only do it for the main BSP.
int shade = LightVisibility::LightLevelToShade((floorlightlevel + ceilinglightlevel) / 2 + LightVisibility::ActualExtraLight(foggy), foggy);
for (WORD i = ParticlesInSubsec[(unsigned int)(sub - subsectors)]; i != NO_PARTICLE; i = Particles[i].snext)
for (int i = ParticlesInSubsec[(unsigned int)(sub - subsectors)]; i != NO_PARTICLE; i = Particles[i].snext)
{
RenderParticle::Project(Thread, Particles + i, subsectors[sub - subsectors].sector, shade, FakeSide, foggy);
}
@ -810,7 +810,7 @@ namespace swrenderer
node = bsp->children[side];
}
RenderSubsector((subsector_t *)((BYTE *)node - 1));
RenderSubsector((subsector_t *)((uint8_t *)node - 1));
}
void RenderOpaquePass::ClearClip()

View File

@ -279,7 +279,7 @@ namespace swrenderer
// [ZZ] check depth. fill portal with black if it's exceeding the visual recursion limit, and continue like nothing happened.
if (depth >= r_portal_recursions)
{
BYTE color = (BYTE)BestColor((DWORD *)GPalette.BaseColors, 0, 0, 0, 0, 255);
uint8_t color = (uint8_t)BestColor((DWORD *)GPalette.BaseColors, 0, 0, 0, 0, 255);
int spacing = viewport->RenderTarget->GetPitch();
for (int x = pds->x1; x < pds->x2; x++)
{
@ -302,7 +302,7 @@ namespace swrenderer
}
else
{
BYTE *dest = viewport->RenderTarget->GetBuffer() + x + Ytop * spacing;
uint8_t *dest = viewport->RenderTarget->GetBuffer() + x + Ytop * spacing;
for (int y = Ytop; y <= Ybottom; y++)
{
@ -479,9 +479,9 @@ namespace swrenderer
if (viewport->RenderTarget->IsBgra()) // Assuming this is just a debug function
return;
BYTE color = (BYTE)BestColor((DWORD *)GPalette.BaseColors, 255, 0, 0, 0, 255);
uint8_t color = (uint8_t)BestColor((DWORD *)GPalette.BaseColors, 255, 0, 0, 0, 255);
BYTE* pixels = viewport->RenderTarget->GetBuffer();
uint8_t* pixels = viewport->RenderTarget->GetBuffer();
// top edge
for (int x = pds->x1; x < pds->x2; x++)
{

View File

@ -66,7 +66,7 @@ namespace swrenderer
DVector2 decal_left, decal_right, decal_pos;
int x1, x2;
double yscale;
BYTE flipx;
uint8_t flipx;
double zpos;
int needrepeat = 0;
sector_t *front, *back;
@ -121,7 +121,7 @@ namespace swrenderer
}
FTexture *WallSpriteTile = TexMan(decal->PicNum, true);
flipx = (BYTE)(decal->RenderFlags & RF_XFLIP);
flipx = (uint8_t)(decal->RenderFlags & RF_XFLIP);
if (WallSpriteTile == NULL || WallSpriteTile->UseType == FTexture::TEX_Null)
{

View File

@ -214,7 +214,7 @@ namespace swrenderer
auto vis = this;
int spacing;
BYTE color = vis->Light.BaseColormap->Maps[vis->startfrac];
uint8_t color = vis->Light.BaseColormap->Maps[vis->startfrac];
int yl = vis->y1;
int ycount = vis->y2 - yl + 1;
int x1 = vis->x1;

View File

@ -195,7 +195,7 @@ namespace swrenderer
spritedef_t* sprdef;
spriteframe_t* sprframe;
FTextureID picnum;
WORD flip;
uint16_t flip;
FTexture* tex;
bool noaccel;
double alpha = owner->Alpha;
@ -537,7 +537,7 @@ namespace swrenderer
colormap_to_use->Desaturate == 0)
{
accelSprite.overlay = colormap_to_use->Fade;
accelSprite.overlay.a = BYTE(vis.Light.ColormapNum * 255 / NUMCOLORMAPS);
accelSprite.overlay.a = uint8_t(vis.Light.ColormapNum * 255 / NUMCOLORMAPS);
}
else
{

View File

@ -412,9 +412,9 @@ namespace swrenderer
case 8: case 7: x2 = gyinc; y2 = -gxinc; break;
case 6: case 3: x2 = gxinc+gyinc; y2 = gyinc-gxinc; break;
}
BYTE oand = (1 << int(xs<backx)) + (1 << (int(ys<backy)+2));
BYTE oand16 = oand + 16;
BYTE oand32 = oand + 32;
uint8_t oand = (1 << int(xs<backx)) + (1 << (int(ys<backy)+2));
uint8_t oand16 = oand + 16;
uint8_t oand32 = oand + 32;
if (yi > 0) { dagxinc = gxinc; dagyinc = FixedMul(gyinc, viewport->viewingrangerecip); }
else { dagxinc = -gxinc; dagyinc = -FixedMul(gyinc, viewport->viewingrangerecip); }
@ -428,7 +428,7 @@ namespace swrenderer
for (x = xs; x != xe; x += xi)
{
BYTE *slabxoffs = &mip->SlabData[mip->OffsetX[x]];
uint8_t *slabxoffs = &mip->SlabData[mip->OffsetX[x]];
short *xyoffs = &mip->OffsetXY[x * (mip->SizeY + 1)];
nx = FixedMul(ggxstart + ggxinc[x], viewport->viewingrangerecip) + x1;
@ -455,9 +455,9 @@ namespace swrenderer
fixed_t l1 = xs_RoundToInt(centerxwidebig_f / (ny - yoff));
fixed_t l2 = xs_RoundToInt(centerxwidebig_f / (ny + yoff));
for (; voxptr < voxend; voxptr = (kvxslab_t *)((BYTE *)voxptr + voxptr->zleng + 3))
for (; voxptr < voxend; voxptr = (kvxslab_t *)((uint8_t *)voxptr + voxptr->zleng + 3))
{
const BYTE *col = voxptr->col;
const uint8_t *col = voxptr->col;
int zleng = voxptr->zleng;
int ztop = voxptr->ztop;
fixed_t z1, z2;

View File

@ -62,9 +62,9 @@ namespace swrenderer
dc_textureheight = tex->GetHeight();
const FTexture::Span *span;
const BYTE *column;
const uint8_t *column;
if (viewport->RenderTarget->IsBgra() && !drawer_needs_pal_input)
column = (const BYTE *)tex->GetColumnBgra(col >> FRACBITS, &span);
column = (const uint8_t *)tex->GetColumnBgra(col >> FRACBITS, &span);
else
column = tex->GetColumn(col >> FRACBITS, &span);
@ -172,7 +172,7 @@ namespace swrenderer
xoffset = MAX(MIN(xoffset, (mip_width << FRACBITS) - 1), 0);
int tx = xoffset >> FRACBITS;
dc_source = (BYTE*)(pixels + tx * mip_height);
dc_source = (uint8_t*)(pixels + tx * mip_height);
dc_source2 = nullptr;
dc_textureheight = mip_height;
dc_texturefracx = 0;
@ -183,8 +183,8 @@ namespace swrenderer
int tx0 = xoffset >> FRACBITS;
int tx1 = MIN(tx0 + 1, mip_width - 1);
dc_source = (BYTE*)(pixels + tx0 * mip_height);
dc_source2 = (BYTE*)(pixels + tx1 * mip_height);
dc_source = (uint8_t*)(pixels + tx0 * mip_height);
dc_source2 = (uint8_t*)(pixels + tx1 * mip_height);
dc_textureheight = mip_height;
dc_texturefracx = (xoffset >> (FRACBITS - 4)) & 15;
}

Some files were not shown because too many files have changed in this diff Show More