- replaced the homegrown integer types in all p* sources and headers.

This commit is contained in:
Christoph Oelckers 2017-03-08 15:20:00 +01:00
parent 3a0e29dab9
commit ad41b23506
37 changed files with 487 additions and 487 deletions

View file

@ -247,7 +247,7 @@ static int P_Set3DFloor(line_t * line, int param, int param2, int alpha)
// The content list changed in r1783 of Vavoom to be unified // The content list changed in r1783 of Vavoom to be unified
// among all its supported games, so it has now ten different // among all its supported games, so it has now ten different
// values instead of just five. // values instead of just five.
static DWORD vavoomcolors[] = { VC_EMPTY, static uint32_t vavoomcolors[] = { VC_EMPTY,
VC_WATER, VC_LAVA, VC_NUKAGE, VC_SLIME, VC_HELLSLIME, VC_WATER, VC_LAVA, VC_NUKAGE, VC_SLIME, VC_HELLSLIME,
VC_BLOOD, VC_SLUDGE, VC_HAZARD, VC_BOOMWATER }; VC_BLOOD, VC_SLUDGE, VC_HAZARD, VC_BOOMWATER };
flags |= FF_SWIMMABLE | FF_BOTHPLANES | FF_ALLSIDES | FF_FLOOD; flags |= FF_SWIMMABLE | FF_BOTHPLANES | FF_ALLSIDES | FF_FLOOD;

View file

@ -122,11 +122,11 @@ void P_Attach3dMidtexLinesToSector(sector_t *sector, int lineid, int tag, bool c
extsector_t::midtex::plane &scrollplane = ceiling? sector->e->Midtex.Ceiling : sector->e->Midtex.Floor; extsector_t::midtex::plane &scrollplane = ceiling? sector->e->Midtex.Ceiling : sector->e->Midtex.Floor;
// Bit arrays that mark whether a line or sector is to be attached. // Bit arrays that mark whether a line or sector is to be attached.
BYTE *found_lines = new BYTE[(level.lines.Size()+7)/8]; uint8_t *found_lines = new uint8_t[(level.lines.Size()+7)/8];
BYTE *found_sectors = new BYTE[(level.sectors.Size()+7)/8]; uint8_t *found_sectors = new uint8_t[(level.sectors.Size()+7)/8];
memset(found_lines, 0, sizeof (BYTE) * ((level.lines.Size()+7)/8)); memset(found_lines, 0, sizeof (uint8_t) * ((level.lines.Size()+7)/8));
memset(found_sectors, 0, sizeof (BYTE) * ((level.sectors.Size()+7)/8)); memset(found_sectors, 0, sizeof (uint8_t) * ((level.sectors.Size()+7)/8));
// mark all lines and sectors that are already attached to this one // mark all lines and sectors that are already attached to this one
// and clear the arrays. The old data will be re-added automatically // and clear the arrays. The old data will be re-added automatically

View file

@ -205,7 +205,7 @@ static DLevelScript *P_GetScriptGoing (AActor *who, line_t *where, int num, cons
struct FBehavior::ArrayInfo struct FBehavior::ArrayInfo
{ {
DWORD ArraySize; uint32_t ArraySize;
int32_t *Elements; int32_t *Elements;
}; };
@ -1563,7 +1563,7 @@ FBehavior *FBehavior::StaticGetModule (int lib)
void FBehavior::StaticMarkLevelVarStrings() void FBehavior::StaticMarkLevelVarStrings()
{ {
// Mark map variables. // Mark map variables.
for (DWORD modnum = 0; modnum < StaticModules.Size(); ++modnum) for (uint32_t modnum = 0; modnum < StaticModules.Size(); ++modnum)
{ {
StaticModules[modnum]->MarkMapVarStrings(); StaticModules[modnum]->MarkMapVarStrings();
} }
@ -1580,7 +1580,7 @@ void FBehavior::StaticMarkLevelVarStrings()
void FBehavior::StaticLockLevelVarStrings() void FBehavior::StaticLockLevelVarStrings()
{ {
// Lock map variables. // Lock map variables.
for (DWORD modnum = 0; modnum < StaticModules.Size(); ++modnum) for (uint32_t modnum = 0; modnum < StaticModules.Size(); ++modnum)
{ {
StaticModules[modnum]->LockMapVarStrings(); StaticModules[modnum]->LockMapVarStrings();
} }
@ -1743,7 +1743,7 @@ void FBehavior::SerializeVarSet (FSerializer &arc, int32_t *vars, int max)
static int ParseLocalArrayChunk(void *chunk, ACSLocalArrays *arrays, int offset) static int ParseLocalArrayChunk(void *chunk, ACSLocalArrays *arrays, int offset)
{ {
unsigned count = (LittleShort(static_cast<unsigned short>(((unsigned *)chunk)[1]) - 2)) / 4; unsigned count = (LittleShort(static_cast<unsigned short>(((unsigned *)chunk)[1]) - 2)) / 4;
int *sizes = (int *)((BYTE *)chunk + 10); int *sizes = (int *)((uint8_t *)chunk + 10);
arrays->Count = count; arrays->Count = count;
if (count > 0) if (count > 0)
{ {
@ -1783,7 +1783,7 @@ FBehavior::FBehavior()
bool FBehavior::Init(int lumpnum, FileReader * fr, int len) bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
{ {
BYTE *object; uint8_t *object;
int i; int i;
LumpNum = lumpnum; LumpNum = lumpnum;
@ -1812,7 +1812,7 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
return false; return false;
} }
object = new BYTE[len]; object = new uint8_t[len];
if (fr == NULL) if (fr == NULL)
{ {
Wads.ReadLump (lumpnum, object); Wads.ReadLump (lumpnum, object);
@ -1860,8 +1860,8 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
if (Format == ACS_Old) if (Format == ACS_Old)
{ {
DWORD dirofs = LittleLong(((DWORD *)object)[1]); uint32_t dirofs = LittleLong(((uint32_t *)object)[1]);
DWORD pretag = ((DWORD *)(object + dirofs))[-1]; uint32_t pretag = ((uint32_t *)(object + dirofs))[-1];
Chunks = object + len; Chunks = object + len;
// Check for redesigned ACSE/ACSe // Check for redesigned ACSE/ACSe
@ -1870,31 +1870,31 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
pretag == MAKE_ID('A','C','S','E'))) pretag == MAKE_ID('A','C','S','E')))
{ {
Format = (pretag == MAKE_ID('A','C','S','e')) ? ACS_LittleEnhanced : ACS_Enhanced; Format = (pretag == MAKE_ID('A','C','S','e')) ? ACS_LittleEnhanced : ACS_Enhanced;
Chunks = object + LittleLong(((DWORD *)(object + dirofs))[-2]); Chunks = object + LittleLong(((uint32_t *)(object + dirofs))[-2]);
// Forget about the compatibility cruft at the end of the lump // Forget about the compatibility cruft at the end of the lump
DataSize = LittleLong(((DWORD *)object)[1]) - 8; DataSize = LittleLong(((uint32_t *)object)[1]) - 8;
} }
} }
else else
{ {
Chunks = object + LittleLong(((DWORD *)object)[1]); Chunks = object + LittleLong(((uint32_t *)object)[1]);
} }
LoadScriptsDirectory (); LoadScriptsDirectory ();
if (Format == ACS_Old) if (Format == ACS_Old)
{ {
StringTable = LittleLong(((DWORD *)Data)[1]); StringTable = LittleLong(((uint32_t *)Data)[1]);
StringTable += LittleLong(((DWORD *)(Data + StringTable))[0]) * 12 + 4; StringTable += LittleLong(((uint32_t *)(Data + StringTable))[0]) * 12 + 4;
UnescapeStringTable(Data + StringTable, Data, false); UnescapeStringTable(Data + StringTable, Data, false);
} }
else else
{ {
UnencryptStrings (); UnencryptStrings ();
BYTE *strings = FindChunk (MAKE_ID('S','T','R','L')); uint8_t *strings = FindChunk (MAKE_ID('S','T','R','L'));
if (strings != NULL) if (strings != NULL)
{ {
StringTable = DWORD(strings - Data + 8); StringTable = uint32_t(strings - Data + 8);
UnescapeStringTable(strings + 8, NULL, true); UnescapeStringTable(strings + 8, NULL, true);
} }
else else
@ -1914,15 +1914,15 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
} }
else else
{ {
DWORD *chunk; uint32_t *chunk;
// Load functions // Load functions
BYTE *funcs; uint8_t *funcs;
Functions = NULL; Functions = NULL;
funcs = FindChunk (MAKE_ID('F','U','N','C')); funcs = FindChunk (MAKE_ID('F','U','N','C'));
if (funcs != NULL) if (funcs != NULL)
{ {
NumFunctions = LittleLong(((DWORD *)funcs)[1]) / 8; NumFunctions = LittleLong(((uint32_t *)funcs)[1]) / 8;
funcs += 8; funcs += 8;
FunctionProfileData = new ACSProfileInfo[NumFunctions]; FunctionProfileData = new ACSProfileInfo[NumFunctions];
Functions = new ScriptFunction[NumFunctions]; Functions = new ScriptFunction[NumFunctions];
@ -1941,12 +1941,12 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
// Load local arrays for functions // Load local arrays for functions
if (NumFunctions > 0) if (NumFunctions > 0)
{ {
for (chunk = (DWORD *)FindChunk(MAKE_ID('F','A','R','Y')); chunk != NULL; chunk = (DWORD *)NextChunk((BYTE *)chunk)) for (chunk = (uint32_t *)FindChunk(MAKE_ID('F','A','R','Y')); chunk != NULL; chunk = (uint32_t *)NextChunk((uint8_t *)chunk))
{ {
int size = LittleLong(chunk[1]); int size = LittleLong(chunk[1]);
if (size >= 6) if (size >= 6)
{ {
unsigned int func_num = LittleShort(((WORD *)chunk)[4]); unsigned int func_num = LittleShort(((uint16_t *)chunk)[4]);
if (func_num < (unsigned int)NumFunctions) if (func_num < (unsigned int)NumFunctions)
{ {
ScriptFunction *func = &Functions[func_num]; ScriptFunction *func = &Functions[func_num];
@ -1958,7 +1958,7 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
} }
// Load JUMP points // Load JUMP points
chunk = (DWORD *)FindChunk (MAKE_ID('J','U','M','P')); chunk = (uint32_t *)FindChunk (MAKE_ID('J','U','M','P'));
if (chunk != NULL) if (chunk != NULL)
{ {
for (i = 0;i < (int)LittleLong(chunk[1]);i += 4) for (i = 0;i < (int)LittleLong(chunk[1]);i += 4)
@ -1967,7 +1967,7 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
// Initialize this object's map variables // Initialize this object's map variables
memset (MapVarStore, 0, sizeof(MapVarStore)); memset (MapVarStore, 0, sizeof(MapVarStore));
chunk = (DWORD *)FindChunk (MAKE_ID('M','I','N','I')); chunk = (uint32_t *)FindChunk (MAKE_ID('M','I','N','I'));
while (chunk != NULL) while (chunk != NULL)
{ {
int numvars = LittleLong(chunk[1])/4 - 1; int numvars = LittleLong(chunk[1])/4 - 1;
@ -1976,7 +1976,7 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
{ {
MapVarStore[i+firstvar] = LittleLong(chunk[3+i]); MapVarStore[i+firstvar] = LittleLong(chunk[3+i]);
} }
chunk = (DWORD *)NextChunk ((BYTE *)chunk); chunk = (uint32_t *)NextChunk ((uint8_t *)chunk);
} }
// Initialize this object's map variable pointers to defaults. They can be changed // Initialize this object's map variable pointers to defaults. They can be changed
@ -1987,7 +1987,7 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
} }
// Create arrays for this module // Create arrays for this module
chunk = (DWORD *)FindChunk (MAKE_ID('A','R','A','Y')); chunk = (uint32_t *)FindChunk (MAKE_ID('A','R','A','Y'));
if (chunk != NULL) if (chunk != NULL)
{ {
NumArrays = LittleLong(chunk[1])/8; NumArrays = LittleLong(chunk[1])/8;
@ -1998,12 +1998,12 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
MapVarStore[LittleLong(chunk[2+i*2])] = i; MapVarStore[LittleLong(chunk[2+i*2])] = i;
ArrayStore[i].ArraySize = LittleLong(chunk[3+i*2]); ArrayStore[i].ArraySize = LittleLong(chunk[3+i*2]);
ArrayStore[i].Elements = new int32_t[ArrayStore[i].ArraySize]; ArrayStore[i].Elements = new int32_t[ArrayStore[i].ArraySize];
memset(ArrayStore[i].Elements, 0, ArrayStore[i].ArraySize*sizeof(DWORD)); memset(ArrayStore[i].Elements, 0, ArrayStore[i].ArraySize*sizeof(uint32_t));
} }
} }
// Initialize arrays for this module // Initialize arrays for this module
chunk = (DWORD *)FindChunk (MAKE_ID('A','I','N','I')); chunk = (uint32_t *)FindChunk (MAKE_ID('A','I','N','I'));
while (chunk != NULL) while (chunk != NULL)
{ {
int arraynum = MapVarStore[LittleLong(chunk[2])]; int arraynum = MapVarStore[LittleLong(chunk[2])];
@ -2019,12 +2019,12 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
elems[j] = LittleLong(chunk[3+j]); elems[j] = LittleLong(chunk[3+j]);
} }
} }
chunk = (DWORD *)NextChunk((BYTE *)chunk); chunk = (uint32_t *)NextChunk((uint8_t *)chunk);
} }
// Start setting up array pointers // Start setting up array pointers
NumTotalArrays = NumArrays; NumTotalArrays = NumArrays;
chunk = (DWORD *)FindChunk (MAKE_ID('A','I','M','P')); chunk = (uint32_t *)FindChunk (MAKE_ID('A','I','M','P'));
if (chunk != NULL) if (chunk != NULL)
{ {
NumTotalArrays += LittleLong(chunk[2]); NumTotalArrays += LittleLong(chunk[2]);
@ -2041,10 +2041,10 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
// Tag the library ID to any map variables that are initialized with strings // Tag the library ID to any map variables that are initialized with strings
if (LibraryID != 0) if (LibraryID != 0)
{ {
chunk = (DWORD *)FindChunk (MAKE_ID('M','S','T','R')); chunk = (uint32_t *)FindChunk (MAKE_ID('M','S','T','R'));
if (chunk != NULL) if (chunk != NULL)
{ {
for (DWORD i = 0; i < LittleLong(chunk[1])/4; ++i) for (uint32_t i = 0; i < LittleLong(chunk[1])/4; ++i)
{ {
const char *str = LookupString(MapVarStore[LittleLong(chunk[i+2])]); const char *str = LookupString(MapVarStore[LittleLong(chunk[i+2])]);
if (str != NULL) if (str != NULL)
@ -2054,10 +2054,10 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
} }
} }
chunk = (DWORD *)FindChunk (MAKE_ID('A','S','T','R')); chunk = (uint32_t *)FindChunk (MAKE_ID('A','S','T','R'));
if (chunk != NULL) if (chunk != NULL)
{ {
for (DWORD i = 0; i < LittleLong(chunk[1])/4; ++i) for (uint32_t i = 0; i < LittleLong(chunk[1])/4; ++i)
{ {
int arraynum = MapVarStore[LittleLong(chunk[i+2])]; int arraynum = MapVarStore[LittleLong(chunk[i+2])];
if ((unsigned)arraynum < (unsigned)NumArrays) if ((unsigned)arraynum < (unsigned)NumArrays)
@ -2077,10 +2077,10 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
} }
// [BL] Newer version of ASTR for structure aware compilers although we only have one array per chunk // [BL] Newer version of ASTR for structure aware compilers although we only have one array per chunk
chunk = (DWORD *)FindChunk (MAKE_ID('A','T','A','G')); chunk = (uint32_t *)FindChunk (MAKE_ID('A','T','A','G'));
while (chunk != NULL) while (chunk != NULL)
{ {
const BYTE* chunkData = (const BYTE*)(chunk + 2); const uint8_t* chunkData = (const uint8_t*)(chunk + 2);
// First byte is version, it should be 0 // First byte is version, it should be 0
if(*chunkData++ == 0) if(*chunkData++ == 0)
{ {
@ -2110,15 +2110,15 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
} }
} }
chunk = (DWORD *)NextChunk ((BYTE *)chunk); chunk = (uint32_t *)NextChunk ((uint8_t *)chunk);
} }
} }
// Load required libraries. // Load required libraries.
if (NULL != (chunk = (DWORD *)FindChunk (MAKE_ID('L','O','A','D')))) if (NULL != (chunk = (uint32_t *)FindChunk (MAKE_ID('L','O','A','D'))))
{ {
const char *const parse = (char *)&chunk[2]; const char *const parse = (char *)&chunk[2];
DWORD i; uint32_t i;
for (i = 0; i < LittleLong(chunk[1]); ) for (i = 0; i < LittleLong(chunk[1]); )
{ {
@ -2151,7 +2151,7 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
continue; continue;
// Resolve functions // Resolve functions
chunk = (DWORD *)FindChunk(MAKE_ID('F','N','A','M')); chunk = (uint32_t *)FindChunk(MAKE_ID('F','N','A','M'));
for (j = 0; j < NumFunctions; ++j) for (j = 0; j < NumFunctions; ++j)
{ {
ScriptFunction *func = &((ScriptFunction *)Functions)[j]; ScriptFunction *func = &((ScriptFunction *)Functions)[j];
@ -2185,13 +2185,13 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
} }
// Resolve map variables // Resolve map variables
chunk = (DWORD *)FindChunk(MAKE_ID('M','I','M','P')); chunk = (uint32_t *)FindChunk(MAKE_ID('M','I','M','P'));
if (chunk != NULL) if (chunk != NULL)
{ {
char *parse = (char *)&chunk[2]; char *parse = (char *)&chunk[2];
for (DWORD j = 0; j < LittleLong(chunk[1]); ) for (uint32_t j = 0; j < LittleLong(chunk[1]); )
{ {
DWORD varNum = LittleLong(*(DWORD *)&parse[j]); uint32_t varNum = LittleLong(*(uint32_t *)&parse[j]);
j += 4; j += 4;
int impNum = lib->FindMapVarName (&parse[j]); int impNum = lib->FindMapVarName (&parse[j]);
if (impNum >= 0) if (impNum >= 0)
@ -2206,13 +2206,13 @@ bool FBehavior::Init(int lumpnum, FileReader * fr, int len)
// Resolve arrays // Resolve arrays
if (NumTotalArrays > NumArrays) if (NumTotalArrays > NumArrays)
{ {
chunk = (DWORD *)FindChunk(MAKE_ID('A','I','M','P')); chunk = (uint32_t *)FindChunk(MAKE_ID('A','I','M','P'));
char *parse = (char *)&chunk[3]; char *parse = (char *)&chunk[3];
for (DWORD j = 0; j < LittleLong(chunk[2]); ++j) for (uint32_t j = 0; j < LittleLong(chunk[2]); ++j)
{ {
DWORD varNum = LittleLong(*(DWORD *)parse); uint32_t varNum = LittleLong(*(uint32_t *)parse);
parse += 4; parse += 4;
DWORD expectedSize = LittleLong(*(DWORD *)parse); uint32_t expectedSize = LittleLong(*(uint32_t *)parse);
parse += 4; parse += 4;
int impNum = lib->FindMapArray (parse); int impNum = lib->FindMapArray (parse);
if (impNum >= 0) if (impNum >= 0)
@ -2285,10 +2285,10 @@ void FBehavior::LoadScriptsDirectory ()
{ {
union union
{ {
BYTE *b; uint8_t *b;
DWORD *dw; uint32_t *dw;
WORD *w; uint16_t *w;
SWORD *sw; int16_t *sw;
ScriptPtr2 *po; // Old ScriptPtr2 *po; // Old
ScriptPtr1 *pi; // Intermediate ScriptPtr1 *pi; // Intermediate
ScriptPtr3 *pe; // LittleEnhanced ScriptPtr3 *pe; // LittleEnhanced
@ -2302,7 +2302,7 @@ void FBehavior::LoadScriptsDirectory ()
switch (Format) switch (Format)
{ {
case ACS_Old: case ACS_Old:
scripts.dw = (DWORD *)(Data + LittleLong(((DWORD *)Data)[1])); scripts.dw = (uint32_t *)(Data + LittleLong(((uint32_t *)Data)[1]));
NumScripts = LittleLong(scripts.dw[0]); NumScripts = LittleLong(scripts.dw[0]);
if (NumScripts != 0) if (NumScripts != 0)
{ {
@ -2330,7 +2330,7 @@ void FBehavior::LoadScriptsDirectory ()
{ {
// There are no scripts! // There are no scripts!
} }
else if (*(DWORD *)Data != MAKE_ID('A','C','S',0)) else if (*(uint32_t *)Data != MAKE_ID('A','C','S',0))
{ {
NumScripts = LittleLong(scripts.dw[1]) / 12; NumScripts = LittleLong(scripts.dw[1]) / 12;
Scripts = new ScriptPtr[NumScripts]; Scripts = new ScriptPtr[NumScripts];
@ -2342,7 +2342,7 @@ void FBehavior::LoadScriptsDirectory ()
ScriptPtr *ptr2 = &Scripts[i]; ScriptPtr *ptr2 = &Scripts[i];
ptr2->Number = LittleShort(ptr1->Number); ptr2->Number = LittleShort(ptr1->Number);
ptr2->Type = BYTE(LittleShort(ptr1->Type)); ptr2->Type = uint8_t(LittleShort(ptr1->Type));
ptr2->ArgCount = LittleLong(ptr1->ArgCount); ptr2->ArgCount = LittleLong(ptr1->ArgCount);
ptr2->Address = LittleLong(ptr1->Address); ptr2->Address = LittleLong(ptr1->Address);
} }
@ -2497,24 +2497,24 @@ int FBehavior::SortScripts (const void *a, const void *b)
void FBehavior::UnencryptStrings () void FBehavior::UnencryptStrings ()
{ {
DWORD *prevchunk = NULL; uint32_t *prevchunk = NULL;
DWORD *chunk = (DWORD *)FindChunk(MAKE_ID('S','T','R','E')); uint32_t *chunk = (uint32_t *)FindChunk(MAKE_ID('S','T','R','E'));
while (chunk != NULL) while (chunk != NULL)
{ {
for (DWORD strnum = 0; strnum < LittleLong(chunk[3]); ++strnum) for (uint32_t strnum = 0; strnum < LittleLong(chunk[3]); ++strnum)
{ {
int ofs = LittleLong(chunk[5+strnum]); int ofs = LittleLong(chunk[5+strnum]);
BYTE *data = (BYTE *)chunk + ofs + 8, last; uint8_t *data = (uint8_t *)chunk + ofs + 8, last;
int p = (BYTE)(ofs*157135); int p = (uint8_t)(ofs*157135);
int i = 0; int i = 0;
do do
{ {
last = (data[i] ^= (BYTE)(p+(i>>1))); last = (data[i] ^= (uint8_t)(p+(i>>1)));
++i; ++i;
} while (last != 0); } while (last != 0);
} }
prevchunk = chunk; prevchunk = chunk;
chunk = (DWORD *)NextChunk ((BYTE *)chunk); chunk = (uint32_t *)NextChunk ((uint8_t *)chunk);
*prevchunk = MAKE_ID('S','T','R','L'); *prevchunk = MAKE_ID('S','T','R','L');
} }
if (prevchunk != NULL) if (prevchunk != NULL)
@ -2535,11 +2535,11 @@ void FBehavior::UnencryptStrings ()
// //
//============================================================================ //============================================================================
void FBehavior::UnescapeStringTable(BYTE *chunkstart, BYTE *datastart, bool has_padding) void FBehavior::UnescapeStringTable(uint8_t *chunkstart, uint8_t *datastart, bool has_padding)
{ {
assert(chunkstart != NULL); assert(chunkstart != NULL);
DWORD *chunk = (DWORD *)chunkstart; uint32_t *chunk = (uint32_t *)chunkstart;
if (datastart == NULL) if (datastart == NULL)
{ {
@ -2548,7 +2548,7 @@ void FBehavior::UnescapeStringTable(BYTE *chunkstart, BYTE *datastart, bool has_
if (!has_padding) if (!has_padding)
{ {
chunk[0] = LittleLong(chunk[0]); chunk[0] = LittleLong(chunk[0]);
for (DWORD strnum = 0; strnum < chunk[0]; ++strnum) for (uint32_t strnum = 0; strnum < chunk[0]; ++strnum)
{ {
int ofs = LittleLong(chunk[1 + strnum]); // Byte swap offset, if needed. int ofs = LittleLong(chunk[1 + strnum]); // Byte swap offset, if needed.
chunk[1 + strnum] = ofs; chunk[1 + strnum] = ofs;
@ -2558,7 +2558,7 @@ void FBehavior::UnescapeStringTable(BYTE *chunkstart, BYTE *datastart, bool has_
else else
{ {
chunk[1] = LittleLong(chunk[1]); chunk[1] = LittleLong(chunk[1]);
for (DWORD strnum = 0; strnum < chunk[1]; ++strnum) for (uint32_t strnum = 0; strnum < chunk[1]; ++strnum)
{ {
int ofs = LittleLong(chunk[3 + strnum]); // Byte swap offset, if needed. int ofs = LittleLong(chunk[3 + strnum]); // Byte swap offset, if needed.
chunk[3 + strnum] = ofs; chunk[3 + strnum] = ofs;
@ -2591,7 +2591,7 @@ bool FBehavior::IsGood ()
ScriptFunction *funcdef = (ScriptFunction *)Functions + i; ScriptFunction *funcdef = (ScriptFunction *)Functions + i;
if (funcdef->Address == 0 && funcdef->ImportNum == 0) if (funcdef->Address == 0 && funcdef->ImportNum == 0)
{ {
DWORD *chunk = (DWORD *)FindChunk (MAKE_ID('F','N','A','M')); uint32_t *chunk = (uint32_t *)FindChunk (MAKE_ID('F','N','A','M'));
Printf (TEXTCOLOR_RED "Could not find ACS function %s for use in %s.\n", Printf (TEXTCOLOR_RED "Could not find ACS function %s for use in %s.\n",
(char *)(chunk + 2) + chunk[3+i], ModuleName); (char *)(chunk + 2) + chunk[3+i], ModuleName);
bad = true; bad = true;
@ -2630,7 +2630,7 @@ const ScriptPtr *FBehavior::FindScript (int script) const
const ScriptPtr *FBehavior::StaticFindScript (int script, FBehavior *&module) const ScriptPtr *FBehavior::StaticFindScript (int script, FBehavior *&module)
{ {
for (DWORD i = 0; i < StaticModules.Size(); ++i) for (uint32_t i = 0; i < StaticModules.Size(); ++i)
{ {
const ScriptPtr *code = StaticModules[i]->FindScript (script); const ScriptPtr *code = StaticModules[i]->FindScript (script);
if (code != NULL) if (code != NULL)
@ -2660,12 +2660,12 @@ ScriptFunction *FBehavior::GetFunction (int funcnum, FBehavior *&module) const
int FBehavior::FindFunctionName (const char *funcname) const int FBehavior::FindFunctionName (const char *funcname) const
{ {
return FindStringInChunk ((DWORD *)FindChunk (MAKE_ID('F','N','A','M')), funcname); return FindStringInChunk ((uint32_t *)FindChunk (MAKE_ID('F','N','A','M')), funcname);
} }
int FBehavior::FindMapVarName (const char *varname) const int FBehavior::FindMapVarName (const char *varname) const
{ {
return FindStringInChunk ((DWORD *)FindChunk (MAKE_ID('M','E','X','P')), varname); return FindStringInChunk ((uint32_t *)FindChunk (MAKE_ID('M','E','X','P')), varname);
} }
int FBehavior::FindMapArray (const char *arrayname) const int FBehavior::FindMapArray (const char *arrayname) const
@ -2678,11 +2678,11 @@ int FBehavior::FindMapArray (const char *arrayname) const
return -1; return -1;
} }
int FBehavior::FindStringInChunk (DWORD *names, const char *varname) const int FBehavior::FindStringInChunk (uint32_t *names, const char *varname) const
{ {
if (names != NULL) if (names != NULL)
{ {
DWORD i; uint32_t i;
for (i = 0; i < LittleLong(names[2]); ++i) for (i = 0; i < LittleLong(names[2]); ++i)
{ {
@ -2734,52 +2734,52 @@ inline bool FBehavior::CopyStringToArray(int arraynum, int index, int maxLength,
return !(*string); // return true if only terminating 0 was not written return !(*string); // return true if only terminating 0 was not written
} }
BYTE *FBehavior::FindChunk (DWORD id) const uint8_t *FBehavior::FindChunk (uint32_t id) const
{ {
BYTE *chunk = Chunks; uint8_t *chunk = Chunks;
while (chunk != NULL && chunk < Data + DataSize) while (chunk != NULL && chunk < Data + DataSize)
{ {
if (((DWORD *)chunk)[0] == id) if (((uint32_t *)chunk)[0] == id)
{ {
return chunk; return chunk;
} }
chunk += LittleLong(((DWORD *)chunk)[1]) + 8; chunk += LittleLong(((uint32_t *)chunk)[1]) + 8;
} }
return NULL; return NULL;
} }
BYTE *FBehavior::NextChunk (BYTE *chunk) const uint8_t *FBehavior::NextChunk (uint8_t *chunk) const
{ {
DWORD id = *(DWORD *)chunk; uint32_t id = *(uint32_t *)chunk;
chunk += LittleLong(((DWORD *)chunk)[1]) + 8; chunk += LittleLong(((uint32_t *)chunk)[1]) + 8;
while (chunk != NULL && chunk < Data + DataSize) while (chunk != NULL && chunk < Data + DataSize)
{ {
if (((DWORD *)chunk)[0] == id) if (((uint32_t *)chunk)[0] == id)
{ {
return chunk; return chunk;
} }
chunk += LittleLong(((DWORD *)chunk)[1]) + 8; chunk += LittleLong(((uint32_t *)chunk)[1]) + 8;
} }
return NULL; return NULL;
} }
const char *FBehavior::StaticLookupString (DWORD index) const char *FBehavior::StaticLookupString (uint32_t index)
{ {
DWORD lib = index >> LIBRARYID_SHIFT; uint32_t lib = index >> LIBRARYID_SHIFT;
if (lib == STRPOOL_LIBRARYID) if (lib == STRPOOL_LIBRARYID)
{ {
return GlobalACSStrings.GetString(index); return GlobalACSStrings.GetString(index);
} }
if (lib >= (DWORD)StaticModules.Size()) if (lib >= (uint32_t)StaticModules.Size())
{ {
return NULL; return NULL;
} }
return StaticModules[lib]->LookupString (index & 0xffff); return StaticModules[lib]->LookupString (index & 0xffff);
} }
const char *FBehavior::LookupString (DWORD index) const const char *FBehavior::LookupString (uint32_t index) const
{ {
if (StringTable == 0) if (StringTable == 0)
{ {
@ -2787,7 +2787,7 @@ const char *FBehavior::LookupString (DWORD index) const
} }
if (Format == ACS_Old) if (Format == ACS_Old)
{ {
DWORD *list = (DWORD *)(Data + StringTable); uint32_t *list = (uint32_t *)(Data + StringTable);
if (index >= list[0]) if (index >= list[0])
return NULL; // Out of range for this list; return NULL; // Out of range for this list;
@ -2795,7 +2795,7 @@ const char *FBehavior::LookupString (DWORD index) const
} }
else else
{ {
DWORD *list = (DWORD *)(Data + StringTable); uint32_t *list = (uint32_t *)(Data + StringTable);
if (index >= list[1]) if (index >= list[1])
return NULL; // Out of range for this list return NULL; // Out of range for this list
@ -2803,7 +2803,7 @@ const char *FBehavior::LookupString (DWORD index) const
} }
} }
void FBehavior::StaticStartTypedScripts (WORD type, AActor *activator, bool always, int arg1, bool runNow) void FBehavior::StaticStartTypedScripts (uint16_t type, AActor *activator, bool always, int arg1, bool runNow)
{ {
static const char *const TypeNames[] = static const char *const TypeNames[] =
{ {
@ -2833,7 +2833,7 @@ void FBehavior::StaticStartTypedScripts (WORD type, AActor *activator, bool alwa
} }
} }
void FBehavior::StartTypedScripts (WORD type, AActor *activator, bool always, int arg1, bool runNow) void FBehavior::StartTypedScripts (uint16_t type, AActor *activator, bool always, int arg1, bool runNow)
{ {
const ScriptPtr *ptr; const ScriptPtr *ptr;
int i; int i;
@ -4425,7 +4425,7 @@ bool GetVarAddrType(AActor *self, FName varname, int index, void *&addr, PType *
return false; return false;
} }
type = var->Type; type = var->Type;
BYTE *baddr = reinterpret_cast<BYTE *>(self) + var->Offset; uint8_t *baddr = reinterpret_cast<uint8_t *>(self) + var->Offset;
arraytype = dyn_cast<PArray>(type); arraytype = dyn_cast<PArray>(type);
if (arraytype != NULL) if (arraytype != NULL)
{ {
@ -5843,7 +5843,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
actorMask = ActorFlags::FromInt(args[5]); actorMask = ActorFlags::FromInt(args[5]);
} }
DWORD wallMask = ML_BLOCKEVERYTHING | ML_BLOCKHITSCAN; uint32_t wallMask = ML_BLOCKEVERYTHING | ML_BLOCKHITSCAN;
if (argCount >= 7) { if (argCount >= 7) {
wallMask = args[6]; wallMask = args[6];
} }
@ -6247,15 +6247,15 @@ enum
inline int getbyte (int *&pc) inline int getbyte (int *&pc)
{ {
int res = *(BYTE *)pc; int res = *(uint8_t *)pc;
pc = (int *)((BYTE *)pc+1); pc = (int *)((uint8_t *)pc+1);
return res; return res;
} }
inline int getshort (int *&pc) inline int getshort (int *&pc)
{ {
int res = LittleShort( *(SWORD *)pc); int res = LittleShort( *(int16_t *)pc);
pc = (int *)((BYTE *)pc+2); pc = (int *)((uint8_t *)pc+2);
return res; return res;
} }
@ -6446,50 +6446,50 @@ int DLevelScript::RunScript ()
break; break;
case PCD_PUSHBYTE: case PCD_PUSHBYTE:
PushToStack (*(BYTE *)pc); PushToStack (*(uint8_t *)pc);
pc = (int *)((BYTE *)pc + 1); pc = (int *)((uint8_t *)pc + 1);
break; break;
case PCD_PUSH2BYTES: case PCD_PUSH2BYTES:
Stack[sp] = ((BYTE *)pc)[0]; Stack[sp] = ((uint8_t *)pc)[0];
Stack[sp+1] = ((BYTE *)pc)[1]; Stack[sp+1] = ((uint8_t *)pc)[1];
sp += 2; sp += 2;
pc = (int *)((BYTE *)pc + 2); pc = (int *)((uint8_t *)pc + 2);
break; break;
case PCD_PUSH3BYTES: case PCD_PUSH3BYTES:
Stack[sp] = ((BYTE *)pc)[0]; Stack[sp] = ((uint8_t *)pc)[0];
Stack[sp+1] = ((BYTE *)pc)[1]; Stack[sp+1] = ((uint8_t *)pc)[1];
Stack[sp+2] = ((BYTE *)pc)[2]; Stack[sp+2] = ((uint8_t *)pc)[2];
sp += 3; sp += 3;
pc = (int *)((BYTE *)pc + 3); pc = (int *)((uint8_t *)pc + 3);
break; break;
case PCD_PUSH4BYTES: case PCD_PUSH4BYTES:
Stack[sp] = ((BYTE *)pc)[0]; Stack[sp] = ((uint8_t *)pc)[0];
Stack[sp+1] = ((BYTE *)pc)[1]; Stack[sp+1] = ((uint8_t *)pc)[1];
Stack[sp+2] = ((BYTE *)pc)[2]; Stack[sp+2] = ((uint8_t *)pc)[2];
Stack[sp+3] = ((BYTE *)pc)[3]; Stack[sp+3] = ((uint8_t *)pc)[3];
sp += 4; sp += 4;
pc = (int *)((BYTE *)pc + 4); pc = (int *)((uint8_t *)pc + 4);
break; break;
case PCD_PUSH5BYTES: case PCD_PUSH5BYTES:
Stack[sp] = ((BYTE *)pc)[0]; Stack[sp] = ((uint8_t *)pc)[0];
Stack[sp+1] = ((BYTE *)pc)[1]; Stack[sp+1] = ((uint8_t *)pc)[1];
Stack[sp+2] = ((BYTE *)pc)[2]; Stack[sp+2] = ((uint8_t *)pc)[2];
Stack[sp+3] = ((BYTE *)pc)[3]; Stack[sp+3] = ((uint8_t *)pc)[3];
Stack[sp+4] = ((BYTE *)pc)[4]; Stack[sp+4] = ((uint8_t *)pc)[4];
sp += 5; sp += 5;
pc = (int *)((BYTE *)pc + 5); pc = (int *)((uint8_t *)pc + 5);
break; break;
case PCD_PUSHBYTES: case PCD_PUSHBYTES:
temp = *(BYTE *)pc; temp = *(uint8_t *)pc;
pc = (int *)((BYTE *)pc + temp + 1); pc = (int *)((uint8_t *)pc + temp + 1);
for (temp = -temp; temp; temp++) for (temp = -temp; temp; temp++)
{ {
PushToStack (*((BYTE *)pc + temp)); PushToStack (*((uint8_t *)pc + temp));
} }
break; break;
@ -6619,35 +6619,35 @@ int DLevelScript::RunScript ()
// Parameters for PCD_LSPEC?DIRECTB are by definition bytes so never need and-ing. // Parameters for PCD_LSPEC?DIRECTB are by definition bytes so never need and-ing.
case PCD_LSPEC1DIRECTB: case PCD_LSPEC1DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide, P_ExecuteSpecial(((uint8_t *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], 0, 0, 0, 0); ((uint8_t *)pc)[1], 0, 0, 0, 0);
pc = (int *)((BYTE *)pc + 2); pc = (int *)((uint8_t *)pc + 2);
break; break;
case PCD_LSPEC2DIRECTB: case PCD_LSPEC2DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide, P_ExecuteSpecial(((uint8_t *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], ((BYTE *)pc)[2], 0, 0, 0); ((uint8_t *)pc)[1], ((uint8_t *)pc)[2], 0, 0, 0);
pc = (int *)((BYTE *)pc + 3); pc = (int *)((uint8_t *)pc + 3);
break; break;
case PCD_LSPEC3DIRECTB: case PCD_LSPEC3DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide, P_ExecuteSpecial(((uint8_t *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], ((BYTE *)pc)[2], ((BYTE *)pc)[3], 0, 0); ((uint8_t *)pc)[1], ((uint8_t *)pc)[2], ((uint8_t *)pc)[3], 0, 0);
pc = (int *)((BYTE *)pc + 4); pc = (int *)((uint8_t *)pc + 4);
break; break;
case PCD_LSPEC4DIRECTB: case PCD_LSPEC4DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide, P_ExecuteSpecial(((uint8_t *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], ((BYTE *)pc)[2], ((BYTE *)pc)[3], ((uint8_t *)pc)[1], ((uint8_t *)pc)[2], ((uint8_t *)pc)[3],
((BYTE *)pc)[4], 0); ((uint8_t *)pc)[4], 0);
pc = (int *)((BYTE *)pc + 5); pc = (int *)((uint8_t *)pc + 5);
break; break;
case PCD_LSPEC5DIRECTB: case PCD_LSPEC5DIRECTB:
P_ExecuteSpecial(((BYTE *)pc)[0], activationline, activator, backSide, P_ExecuteSpecial(((uint8_t *)pc)[0], activationline, activator, backSide,
((BYTE *)pc)[1], ((BYTE *)pc)[2], ((BYTE *)pc)[3], ((uint8_t *)pc)[1], ((uint8_t *)pc)[2], ((uint8_t *)pc)[3],
((BYTE *)pc)[4], ((BYTE *)pc)[5]); ((uint8_t *)pc)[4], ((uint8_t *)pc)[5]);
pc = (int *)((BYTE *)pc + 6); pc = (int *)((uint8_t *)pc + 6);
break; break;
case PCD_CALLFUNC: case PCD_CALLFUNC:
@ -7673,12 +7673,12 @@ int DLevelScript::RunScript ()
break; break;
case PCD_DELAYDIRECTB: case PCD_DELAYDIRECTB:
statedata = *(BYTE *)pc + (fmt == ACS_Old && gameinfo.gametype == GAME_Hexen); statedata = *(uint8_t *)pc + (fmt == ACS_Old && gameinfo.gametype == GAME_Hexen);
if (statedata > 0) if (statedata > 0)
{ {
state = SCRIPT_Delayed; state = SCRIPT_Delayed;
} }
pc = (int *)((BYTE *)pc + 1); pc = (int *)((uint8_t *)pc + 1);
break; break;
case PCD_RANDOM: case PCD_RANDOM:
@ -7692,8 +7692,8 @@ int DLevelScript::RunScript ()
break; break;
case PCD_RANDOMDIRECTB: case PCD_RANDOMDIRECTB:
PushToStack (Random (((BYTE *)pc)[0], ((BYTE *)pc)[1])); PushToStack (Random (((uint8_t *)pc)[0], ((uint8_t *)pc)[1]));
pc = (int *)((BYTE *)pc + 2); pc = (int *)((uint8_t *)pc + 2);
break; break;
case PCD_THINGCOUNT: case PCD_THINGCOUNT:
@ -10305,7 +10305,7 @@ static void ShowProfileData(TArray<ProfileCollector> &profiles, long ilimit,
// Script/function name // Script/function name
if (functions) if (functions)
{ {
DWORD *fnames = (DWORD *)prof->Module->FindChunk(MAKE_ID('F','N','A','M')); uint32_t *fnames = (uint32_t *)prof->Module->FindChunk(MAKE_ID('F','N','A','M'));
if (prof->Index >= 0 && prof->Index < (int)LittleLong(fnames[2])) if (prof->Index >= 0 && prof->Index < (int)LittleLong(fnames[2]))
{ {
mysnprintf(scriptname, sizeof(scriptname), "%s", mysnprintf(scriptname, sizeof(scriptname), "%s",
@ -10343,7 +10343,7 @@ CCMD(acsprofile)
sort_by_runs sort_by_runs
}; };
static const char *sort_names[] = { "total", "min", "max", "avg", "runs" }; static const char *sort_names[] = { "total", "min", "max", "avg", "runs" };
static const BYTE sort_match_len[] = { 1, 2, 2, 1, 1 }; static const uint8_t sort_match_len[] = { 1, 2, 2, 1, 1 };
TArray<ProfileCollector> ScriptProfiles, FuncProfiles; TArray<ProfileCollector> ScriptProfiles, FuncProfiles;
long limit = 10; long limit = 10;

View file

@ -198,11 +198,11 @@ struct ACSLocalArrays
struct ScriptPtr struct ScriptPtr
{ {
int Number; int Number;
DWORD Address; uint32_t Address;
BYTE Type; uint8_t Type;
BYTE ArgCount; uint8_t ArgCount;
WORD VarCount; uint16_t VarCount;
WORD Flags; uint16_t Flags;
ACSLocalArrays LocalArrays; ACSLocalArrays LocalArrays;
ACSProfileInfo ProfileData; ACSProfileInfo ProfileData;
@ -211,51 +211,51 @@ struct ScriptPtr
// The present ZDoom version // The present ZDoom version
struct ScriptPtr3 struct ScriptPtr3
{ {
SWORD Number; int16_t Number;
BYTE Type; uint8_t Type;
BYTE ArgCount; uint8_t ArgCount;
DWORD Address; uint32_t Address;
}; };
// The intermediate ZDoom version // The intermediate ZDoom version
struct ScriptPtr1 struct ScriptPtr1
{ {
SWORD Number; int16_t Number;
WORD Type; uint16_t Type;
DWORD Address; uint32_t Address;
DWORD ArgCount; uint32_t ArgCount;
}; };
// The old Hexen version // The old Hexen version
struct ScriptPtr2 struct ScriptPtr2
{ {
DWORD Number; // Type is Number / 1000 uint32_t Number; // Type is Number / 1000
DWORD Address; uint32_t Address;
DWORD ArgCount; uint32_t ArgCount;
}; };
struct ScriptFlagsPtr struct ScriptFlagsPtr
{ {
WORD Number; uint16_t Number;
WORD Flags; uint16_t Flags;
}; };
struct ScriptFunctionInFile struct ScriptFunctionInFile
{ {
BYTE ArgCount; uint8_t ArgCount;
BYTE LocalCount; uint8_t LocalCount;
BYTE HasReturnValue; uint8_t HasReturnValue;
BYTE ImportNum; uint8_t ImportNum;
DWORD Address; uint32_t Address;
}; };
struct ScriptFunction struct ScriptFunction
{ {
BYTE ArgCount; uint8_t ArgCount;
BYTE HasReturnValue; uint8_t HasReturnValue;
BYTE ImportNum; uint8_t ImportNum;
int LocalCount; int LocalCount;
DWORD Address; uint32_t Address;
ACSLocalArrays LocalArrays; ACSLocalArrays LocalArrays;
}; };
@ -296,13 +296,13 @@ public:
bool Init(int lumpnum, FileReader * fr = NULL, int len = 0); bool Init(int lumpnum, FileReader * fr = NULL, int len = 0);
bool IsGood (); bool IsGood ();
BYTE *FindChunk (DWORD id) const; uint8_t *FindChunk (uint32_t id) const;
BYTE *NextChunk (BYTE *chunk) const; uint8_t *NextChunk (uint8_t *chunk) const;
const ScriptPtr *FindScript (int number) const; const ScriptPtr *FindScript (int number) const;
void StartTypedScripts (WORD type, AActor *activator, bool always, int arg1, bool runNow); void StartTypedScripts (uint16_t type, AActor *activator, bool always, int arg1, bool runNow);
DWORD PC2Ofs (int *pc) const { return (DWORD)((BYTE *)pc - Data); } uint32_t PC2Ofs (int *pc) const { return (uint32_t)((uint8_t *)pc - Data); }
int *Ofs2PC (DWORD ofs) const { return (int *)(Data + ofs); } int *Ofs2PC (uint32_t ofs) const { return (int *)(Data + ofs); }
int *Jump2PC (DWORD jumpPoint) const { return Ofs2PC(JumpPoints[jumpPoint]); } int *Jump2PC (uint32_t jumpPoint) const { return Ofs2PC(JumpPoints[jumpPoint]); }
ACSFormat GetFormat() const { return Format; } ACSFormat GetFormat() const { return Format; }
ScriptFunction *GetFunction (int funcnum, FBehavior *&module) const; ScriptFunction *GetFunction (int funcnum, FBehavior *&module) const;
int GetArrayVal (int arraynum, int index) const; int GetArrayVal (int arraynum, int index) const;
@ -321,7 +321,7 @@ public:
const char *GetModuleName() const { return ModuleName; } const char *GetModuleName() const { return ModuleName; }
ACSProfileInfo *GetFunctionProfileData(int index) { return index >= 0 && index < NumFunctions ? &FunctionProfileData[index] : NULL; } ACSProfileInfo *GetFunctionProfileData(int index) { return index >= 0 && index < NumFunctions ? &FunctionProfileData[index] : NULL; }
ACSProfileInfo *GetFunctionProfileData(ScriptFunction *func) { return GetFunctionProfileData((int)(func - (ScriptFunction *)Functions)); } ACSProfileInfo *GetFunctionProfileData(ScriptFunction *func) { return GetFunctionProfileData((int)(func - (ScriptFunction *)Functions)); }
const char *LookupString (DWORD index) const; const char *LookupString (uint32_t index) const;
int32_t *MapVars[NUM_MAPVARS]; int32_t *MapVars[NUM_MAPVARS];
@ -336,8 +336,8 @@ public:
static void StaticUnlockLevelVarStrings(); static void StaticUnlockLevelVarStrings();
static const ScriptPtr *StaticFindScript (int script, FBehavior *&module); static const ScriptPtr *StaticFindScript (int script, FBehavior *&module);
static const char *StaticLookupString (DWORD index); static const char *StaticLookupString (uint32_t index);
static void StaticStartTypedScripts (WORD type, AActor *activator, bool always, int arg1=0, bool runNow=false); static void StaticStartTypedScripts (uint16_t type, AActor *activator, bool always, int arg1=0, bool runNow=false);
static void StaticStopMyScripts (AActor *actor); static void StaticStopMyScripts (AActor *actor);
private: private:
@ -346,9 +346,9 @@ private:
ACSFormat Format; ACSFormat Format;
int LumpNum; int LumpNum;
BYTE *Data; uint8_t *Data;
int DataSize; int DataSize;
BYTE *Chunks; uint8_t *Chunks;
ScriptPtr *Scripts; ScriptPtr *Scripts;
int NumScripts; int NumScripts;
ScriptFunction *Functions; ScriptFunction *Functions;
@ -358,10 +358,10 @@ private:
int NumArrays; int NumArrays;
ArrayInfo **Arrays; ArrayInfo **Arrays;
int NumTotalArrays; int NumTotalArrays;
DWORD StringTable; uint32_t StringTable;
int32_t MapVarStore[NUM_MAPVARS]; int32_t MapVarStore[NUM_MAPVARS];
TArray<FBehavior *> Imports; TArray<FBehavior *> Imports;
DWORD LibraryID; uint32_t LibraryID;
char ModuleName[9]; char ModuleName[9];
TArray<int> JumpPoints; TArray<int> JumpPoints;
@ -371,8 +371,8 @@ private:
static int SortScripts (const void *a, const void *b); static int SortScripts (const void *a, const void *b);
void UnencryptStrings (); void UnencryptStrings ();
void UnescapeStringTable(BYTE *chunkstart, BYTE *datastart, bool haspadding); void UnescapeStringTable(uint8_t *chunkstart, uint8_t *datastart, bool haspadding);
int FindStringInChunk (DWORD *chunk, const char *varname) const; int FindStringInChunk (uint32_t *chunk, const char *varname) const;
void SerializeVars (FSerializer &arc); void SerializeVars (FSerializer &arc);
void SerializeVarSet (FSerializer &arc, int32_t *vars, int max); void SerializeVarSet (FSerializer &arc, int32_t *vars, int max);

View file

@ -4798,7 +4798,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetUserVar)
PField *var = GetVar(self, varname); PField *var = GetVar(self, varname);
if (var != nullptr) if (var != nullptr)
{ {
var->Type->SetValue(reinterpret_cast<BYTE *>(self) + var->Offset, value); var->Type->SetValue(reinterpret_cast<uint8_t *>(self) + var->Offset, value);
} }
return 0; return 0;
} }
@ -4813,7 +4813,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetUserVarFloat)
PField *var = GetVar(self, varname); PField *var = GetVar(self, varname);
if (var != nullptr) if (var != nullptr)
{ {
var->Type->SetValue(reinterpret_cast<BYTE *>(self) + var->Offset, value); var->Type->SetValue(reinterpret_cast<uint8_t *>(self) + var->Offset, value);
} }
return 0; return 0;
} }
@ -4857,7 +4857,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetUserArray)
if (var != nullptr) if (var != nullptr)
{ {
PArray *arraytype = static_cast<PArray *>(var->Type); PArray *arraytype = static_cast<PArray *>(var->Type);
arraytype->ElementType->SetValue(reinterpret_cast<BYTE *>(self) + var->Offset + arraytype->ElementSize * pos, value); arraytype->ElementType->SetValue(reinterpret_cast<uint8_t *>(self) + var->Offset + arraytype->ElementSize * pos, value);
} }
return 0; return 0;
} }
@ -4874,7 +4874,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetUserArrayFloat)
if (var != nullptr) if (var != nullptr)
{ {
PArray *arraytype = static_cast<PArray *>(var->Type); PArray *arraytype = static_cast<PArray *>(var->Type);
arraytype->ElementType->SetValue(reinterpret_cast<BYTE *>(self) + var->Offset + arraytype->ElementSize * pos, value); arraytype->ElementType->SetValue(reinterpret_cast<uint8_t *>(self) + var->Offset + arraytype->ElementSize * pos, value);
} }
return 0; return 0;
} }

View file

@ -45,17 +45,17 @@
//40 bytes //40 bytes
struct sectortype struct sectortype
{ {
SWORD wallptr, wallnum; int16_t wallptr, wallnum;
int32_t ceilingZ, floorZ; int32_t ceilingZ, floorZ;
SWORD ceilingstat, floorstat; int16_t ceilingstat, floorstat;
SWORD ceilingpicnum, ceilingheinum; int16_t ceilingpicnum, ceilingheinum;
SBYTE ceilingshade; int8_t ceilingshade;
BYTE ceilingpal, ceilingxpanning, ceilingypanning; uint8_t ceilingpal, ceilingxpanning, ceilingypanning;
SWORD floorpicnum, floorheinum; int16_t floorpicnum, floorheinum;
SBYTE floorshade; int8_t floorshade;
BYTE floorpal, floorxpanning, floorypanning; uint8_t floorpal, floorxpanning, floorypanning;
BYTE visibility, filler; uint8_t visibility, filler;
SWORD lotag, hitag, extra; int16_t lotag, hitag, extra;
}; };
//cstat: //cstat:
@ -75,11 +75,11 @@ struct sectortype
struct walltype struct walltype
{ {
int32_t x, y; int32_t x, y;
SWORD point2, nextwall, nextsector, cstat; int16_t point2, nextwall, nextsector, cstat;
SWORD picnum, overpicnum; int16_t picnum, overpicnum;
SBYTE shade; int8_t shade;
BYTE pal, xrepeat, yrepeat, xpanning, ypanning; uint8_t pal, xrepeat, yrepeat, xpanning, ypanning;
SWORD lotag, hitag, extra; int16_t lotag, hitag, extra;
}; };
//cstat: //cstat:
@ -101,29 +101,29 @@ struct walltype
struct spritetype struct spritetype
{ {
int32_t x, y, z; int32_t x, y, z;
SWORD cstat, picnum; int16_t cstat, picnum;
SBYTE shade; int8_t shade;
BYTE pal, clipdist, filler; uint8_t pal, clipdist, filler;
BYTE xrepeat, yrepeat; uint8_t xrepeat, yrepeat;
SBYTE xoffset, yoffset; int8_t xoffset, yoffset;
SWORD sectnum, statnum; int16_t sectnum, statnum;
SWORD ang, owner, xvel, yvel, zvel; int16_t ang, owner, xvel, yvel, zvel;
SWORD lotag, hitag, extra; int16_t lotag, hitag, extra;
}; };
// I used to have all the Xobjects mapped out. Not anymore. // I used to have all the Xobjects mapped out. Not anymore.
// (Thanks for the great firmware, Seagate!) // (Thanks for the great firmware, Seagate!)
struct Xsprite struct Xsprite
{ {
BYTE NotReallyPadding[16]; uint8_t NotReallyPadding[16];
WORD Data1; uint16_t Data1;
WORD Data2; uint16_t Data2;
WORD Data3; uint16_t Data3;
WORD ThisIsntPaddingEither; uint16_t ThisIsntPaddingEither;
DWORD NorThis:2; uint32_t NorThis:2;
DWORD Data4:16; uint32_t Data4:16;
DWORD WhatIsThisIDontEven:14; uint32_t WhatIsThisIDontEven:14;
BYTE ThisNeedsToBe56Bytes[28]; uint8_t ThisNeedsToBe56Bytes[28];
}; };
struct SlopeWork struct SlopeWork
@ -142,7 +142,7 @@ void P_AdjustLine (line_t *line);
// PRIVATE FUNCTION PROTOTYPES --------------------------------------------- // PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static bool P_LoadBloodMap (BYTE *data, size_t len, FMapThing **sprites, int *numsprites); static bool P_LoadBloodMap (uint8_t *data, size_t len, FMapThing **sprites, int *numsprites);
static void LoadSectors (sectortype *bsectors, int count); static void LoadSectors (sectortype *bsectors, int count);
static void LoadWalls (walltype *walls, int numwalls, sectortype *bsectors); static void LoadWalls (walltype *walls, int numwalls, sectortype *bsectors);
static int LoadSprites (spritetype *sprites, Xsprite *xsprites, int numsprites, sectortype *bsectors, FMapThing *mapthings); static int LoadSprites (spritetype *sprites, Xsprite *xsprites, int numsprites, sectortype *bsectors, FMapThing *mapthings);
@ -161,31 +161,31 @@ static void Decrypt (void *to, const void *from, int len, int key);
bool P_IsBuildMap(MapData *map) bool P_IsBuildMap(MapData *map)
{ {
DWORD len = map->Size(ML_LABEL); uint32_t len = map->Size(ML_LABEL);
if (len < 4) if (len < 4)
{ {
return false; return false;
} }
BYTE *data = new BYTE[len]; uint8_t *data = new uint8_t[len];
map->Seek(ML_LABEL); map->Seek(ML_LABEL);
map->Read(ML_LABEL, data); map->Read(ML_LABEL, data);
// Check for a Blood map. // Check for a Blood map.
if (*(DWORD *)data == MAKE_ID('B','L','M','\x1a')) if (*(uint32_t *)data == MAKE_ID('B','L','M','\x1a'))
{ {
delete[] data; delete[] data;
return true; return true;
} }
const int numsec = LittleShort(*(WORD *)(data + 20)); const int numsec = LittleShort(*(uint16_t *)(data + 20));
int numwalls; int numwalls;
if (len < 26 + numsec*sizeof(sectortype) || if (len < 26 + numsec*sizeof(sectortype) ||
(numwalls = LittleShort(*(WORD *)(data + 22 + numsec*sizeof(sectortype))), (numwalls = LittleShort(*(uint16_t *)(data + 22 + numsec*sizeof(sectortype))),
len < 24 + numsec*sizeof(sectortype) + numwalls*sizeof(walltype)) || len < 24 + numsec*sizeof(sectortype) + numwalls*sizeof(walltype)) ||
LittleLong(*(DWORD *)data) != 7 || LittleLong(*(uint32_t *)data) != 7 ||
LittleShort(*(WORD *)(data + 16)) >= 2048) LittleShort(*(uint16_t *)(data + 16)) >= 2048)
{ // Can't possibly be a version 7 BUILD map { // Can't possibly be a version 7 BUILD map
delete[] data; delete[] data;
return false; return false;
@ -200,7 +200,7 @@ bool P_IsBuildMap(MapData *map)
// //
//========================================================================== //==========================================================================
bool P_LoadBuildMap (BYTE *data, size_t len, FMapThing **sprites, int *numspr) bool P_LoadBuildMap (uint8_t *data, size_t len, FMapThing **sprites, int *numspr)
{ {
if (len < 26) if (len < 26)
{ {
@ -208,20 +208,20 @@ bool P_LoadBuildMap (BYTE *data, size_t len, FMapThing **sprites, int *numspr)
} }
// Check for a Blood map. // Check for a Blood map.
if (*(DWORD *)data == MAKE_ID('B','L','M','\x1a')) if (*(uint32_t *)data == MAKE_ID('B','L','M','\x1a'))
{ {
return P_LoadBloodMap (data, len, sprites, numspr); return P_LoadBloodMap (data, len, sprites, numspr);
} }
const int numsec = LittleShort(*(WORD *)(data + 20)); const int numsec = LittleShort(*(uint16_t *)(data + 20));
int numwalls; int numwalls;
int numsprites; int numsprites;
if (len < 26 + numsec*sizeof(sectortype) || if (len < 26 + numsec*sizeof(sectortype) ||
(numwalls = LittleShort(*(WORD *)(data + 22 + numsec*sizeof(sectortype))), (numwalls = LittleShort(*(uint16_t *)(data + 22 + numsec*sizeof(sectortype))),
len < 24 + numsec*sizeof(sectortype) + numwalls*sizeof(walltype)) || len < 24 + numsec*sizeof(sectortype) + numwalls*sizeof(walltype)) ||
LittleLong(*(DWORD *)data) != 7 || LittleLong(*(uint32_t *)data) != 7 ||
LittleShort(*(WORD *)(data + 16)) >= 2048) LittleShort(*(uint16_t *)(data + 16)) >= 2048)
{ // Can't possibly be a version 7 BUILD map { // Can't possibly be a version 7 BUILD map
return false; return false;
} }
@ -230,7 +230,7 @@ bool P_LoadBuildMap (BYTE *data, size_t len, FMapThing **sprites, int *numspr)
LoadWalls ((walltype *)(data + 24 + numsec*sizeof(sectortype)), numwalls, LoadWalls ((walltype *)(data + 24 + numsec*sizeof(sectortype)), numwalls,
(sectortype *)(data + 22)); (sectortype *)(data + 22));
numsprites = *(WORD *)(data + 24 + numsec*sizeof(sectortype) + numwalls*sizeof(walltype)); numsprites = *(uint16_t *)(data + 24 + numsec*sizeof(sectortype) + numwalls*sizeof(walltype));
*sprites = new FMapThing[numsprites + 1]; *sprites = new FMapThing[numsprites + 1];
CreateStartSpot ((int32_t *)(data + 4), *sprites); CreateStartSpot ((int32_t *)(data + 4), *sprites);
*numspr = 1 + LoadSprites ((spritetype *)(data + 26 + numsec*sizeof(sectortype) + numwalls*sizeof(walltype)), *numspr = 1 + LoadSprites ((spritetype *)(data + 26 + numsec*sizeof(sectortype) + numwalls*sizeof(walltype)),
@ -245,11 +245,11 @@ bool P_LoadBuildMap (BYTE *data, size_t len, FMapThing **sprites, int *numspr)
// //
//========================================================================== //==========================================================================
static bool P_LoadBloodMap (BYTE *data, size_t len, FMapThing **mapthings, int *numspr) static bool P_LoadBloodMap (uint8_t *data, size_t len, FMapThing **mapthings, int *numspr)
{ {
BYTE infoBlock[37]; uint8_t infoBlock[37];
int mapver = data[5]; int mapver = data[5];
DWORD matt; uint32_t matt;
int numRevisions, numWalls, numsprites, skyLen, visibility, parallaxType; int numRevisions, numWalls, numsprites, skyLen, visibility, parallaxType;
int i; int i;
int k; int k;
@ -259,7 +259,7 @@ static bool P_LoadBloodMap (BYTE *data, size_t len, FMapThing **mapthings, int *
return false; return false;
} }
matt = *(DWORD *)(data + 28); matt = *(uint32_t *)(data + 28);
if (matt != 0 && if (matt != 0 &&
matt != MAKE_ID('M','a','t','t') && matt != MAKE_ID('M','a','t','t') &&
matt != MAKE_ID('t','t','a','M')) matt != MAKE_ID('t','t','a','M'))
@ -270,13 +270,13 @@ static bool P_LoadBloodMap (BYTE *data, size_t len, FMapThing **mapthings, int *
{ {
memcpy (infoBlock, data + 6, 37); memcpy (infoBlock, data + 6, 37);
} }
skyLen = 2 << LittleShort(*(WORD *)(infoBlock + 16)); skyLen = 2 << LittleShort(*(uint16_t *)(infoBlock + 16));
visibility = LittleLong(*(DWORD *)(infoBlock + 18)); visibility = LittleLong(*(uint32_t *)(infoBlock + 18));
parallaxType = infoBlock[26]; parallaxType = infoBlock[26];
numRevisions = LittleLong(*(DWORD *)(infoBlock + 27)); numRevisions = LittleLong(*(uint32_t *)(infoBlock + 27));
int numsectors = LittleShort(*(WORD *)(infoBlock + 31)); int numsectors = LittleShort(*(uint16_t *)(infoBlock + 31));
numWalls = LittleShort(*(WORD *)(infoBlock + 33)); numWalls = LittleShort(*(uint16_t *)(infoBlock + 33));
numsprites = LittleShort(*(WORD *)(infoBlock + 35)); numsprites = LittleShort(*(uint16_t *)(infoBlock + 35));
Printf("Visibility: %d\n", visibility); Printf("Visibility: %d\n", visibility);
if (mapver == 7) if (mapver == 7)
@ -397,10 +397,10 @@ static void LoadSectors (sectortype *bsec, int count)
for (int i = 0; i < count; ++i, ++bsec, ++sec) for (int i = 0; i < count; ++i, ++bsec, ++sec)
{ {
bsec->wallptr = WORD(bsec->wallptr); bsec->wallptr = uint16_t(bsec->wallptr);
bsec->wallnum = WORD(bsec->wallnum); bsec->wallnum = uint16_t(bsec->wallnum);
bsec->ceilingstat = WORD(bsec->ceilingstat); bsec->ceilingstat = uint16_t(bsec->ceilingstat);
bsec->floorstat = WORD(bsec->floorstat); bsec->floorstat = uint16_t(bsec->floorstat);
sec->e = &sec->e[i]; sec->e = &sec->e[i];
double floorheight = -LittleLong(bsec->floorZ) / 256.; double floorheight = -LittleLong(bsec->floorZ) / 256.;
@ -782,7 +782,7 @@ vertex_t *FindVertex (int32_t xx, int32_t yy)
static void CreateStartSpot (int32_t *pos, FMapThing *start) static void CreateStartSpot (int32_t *pos, FMapThing *start)
{ {
short angle = LittleShort(*(WORD *)(&pos[3])); short angle = LittleShort(*(uint16_t *)(&pos[3]));
FMapThing mt = { 0, }; FMapThing mt = { 0, };
mt.pos.X = LittleLong(pos[0]) / 16.; mt.pos.X = LittleLong(pos[0]) / 16.;
@ -844,8 +844,8 @@ static void CalcPlane (SlopeWork &slope, secplane_t &plane)
static void Decrypt (void *to_, const void *from_, int len, int key) static void Decrypt (void *to_, const void *from_, int len, int key)
{ {
BYTE *to = (BYTE *)to_; uint8_t *to = (uint8_t *)to_;
const BYTE *from = (const BYTE *)from_; const uint8_t *from = (const uint8_t *)from_;
for (int i = 0; i < len; ++i, ++key) for (int i = 0; i < len; ++i, ++key)
{ {

View file

@ -1108,7 +1108,7 @@ static void HandleReply(player_t *player, bool isconsole, int nodenum, int reply
// //
//============================================================================ //============================================================================
void P_ConversationCommand (int netcode, int pnum, BYTE **stream) void P_ConversationCommand (int netcode, int pnum, uint8_t **stream)
{ {
player_t *player = &players[pnum]; player_t *player = &players[pnum];

View file

@ -75,7 +75,7 @@ void P_FreeStrifeConversations ();
void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveangle); void P_StartConversation (AActor *npc, AActor *pc, bool facetalker, bool saveangle);
void P_ResumeConversation (); void P_ResumeConversation ();
void P_ConversationCommand (int netcode, int player, BYTE **stream); void P_ConversationCommand (int netcode, int player, uint8_t **stream);
class FileReader; class FileReader;
bool P_ParseUSDF(int lumpnum, FileReader *lump, int lumplen); bool P_ParseUSDF(int lumpnum, FileReader *lump, int lumplen);

View file

@ -66,11 +66,11 @@ FRandom pr_railtrail("RailTrail");
#define FADEFROMTTL(a) (1.f/(a)) #define FADEFROMTTL(a) (1.f/(a))
// [RH] particle globals // [RH] particle globals
WORD NumParticles; uint16_t NumParticles;
WORD ActiveParticles; uint16_t ActiveParticles;
WORD InactiveParticles; uint16_t InactiveParticles;
particle_t *Particles; particle_t *Particles;
TArray<WORD> ParticlesInSubsec; TArray<uint16_t> ParticlesInSubsec;
static int grey1, grey2, grey3, grey4, red, green, blue, yellow, black, static int grey1, grey2, grey3, grey4, red, green, blue, yellow, black,
red1, green1, blue1, yellow1, purple, purple1, white, red1, green1, blue1, yellow1, purple, purple1, white,
@ -79,7 +79,7 @@ static int grey1, grey2, grey3, grey4, red, green, blue, yellow, black,
static const struct ColorList { static const struct ColorList {
int *color; int *color;
BYTE r, g, b; uint8_t r, g, b;
} Colors[] = { } Colors[] = {
{&grey1, 85, 85, 85 }, {&grey1, 85, 85, 85 },
{&grey2, 171, 171, 171}, {&grey2, 171, 171, 171},
@ -118,7 +118,7 @@ inline particle_t *NewParticle (void)
result = Particles + InactiveParticles; result = Particles + InactiveParticles;
InactiveParticles = result->tnext; InactiveParticles = result->tnext;
result->tnext = ActiveParticles; result->tnext = ActiveParticles;
ActiveParticles = WORD(result - Particles); ActiveParticles = uint16_t(result - Particles);
} }
return result; return result;
} }
@ -159,7 +159,7 @@ void P_InitParticles ()
num = r_maxparticles; num = r_maxparticles;
// This should be good, but eh... // This should be good, but eh...
NumParticles = (WORD)clamp<int>(num, 100, 65535); NumParticles = (uint16_t)clamp<int>(num, 100, 65535);
P_DeinitParticles(); P_DeinitParticles();
Particles = new particle_t[NumParticles]; Particles = new particle_t[NumParticles];
@ -205,7 +205,7 @@ void P_FindParticleSubsectors ()
{ {
return; return;
} }
for (WORD i = ActiveParticles; i != NO_PARTICLE; i = Particles[i].tnext) for (uint16_t i = ActiveParticles; i != NO_PARTICLE; i = Particles[i].tnext)
{ {
// Try to reuse the subsector from the last portal check, if still valid. // Try to reuse the subsector from the last portal check, if still valid.
if (Particles[i].subsector == NULL) Particles[i].subsector = R_PointInSubsector(Particles[i].Pos); if (Particles[i].subsector == NULL) Particles[i].subsector = R_PointInSubsector(Particles[i].Pos);

View file

@ -51,19 +51,19 @@ struct particle_t
double sizestep; double sizestep;
subsector_t * subsector; subsector_t * subsector;
short ttl; short ttl;
BYTE bright; uint8_t bright;
bool notimefreeze; bool notimefreeze;
float fadestep; float fadestep;
float alpha; float alpha;
int color; int color;
WORD tnext; uint16_t tnext;
WORD snext; uint16_t snext;
}; };
extern particle_t *Particles; extern particle_t *Particles;
extern TArray<WORD> ParticlesInSubsec; extern TArray<uint16_t> ParticlesInSubsec;
const WORD NO_PARTICLE = 0xffff; const uint16_t NO_PARTICLE = 0xffff;
void P_ClearParticles (); void P_ClearParticles ();
void P_FindParticleSubsectors (); void P_FindParticleSubsectors ();

View file

@ -74,7 +74,7 @@ void P_GetPolySpots (MapData * lump, TArray<FNodeBuilder::FPolyStart> &spots, TA
CVAR(Bool, gl_cachenodes, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR(Bool, gl_cachenodes, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR(Float, gl_cachetime, 0.6f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR(Float, gl_cachetime, 0.6f, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
void P_LoadZNodes (FileReader &dalump, DWORD id); void P_LoadZNodes (FileReader &dalump, uint32_t id);
static bool CheckCachedNodes(MapData *map); static bool CheckCachedNodes(MapData *map);
static void CreateCachedNodes(MapData *map); static void CreateCachedNodes(MapData *map);
@ -93,29 +93,29 @@ struct gl3_mapsubsector_t
struct glseg_t struct glseg_t
{ {
WORD v1; // start vertex (16 bit) uint16_t v1; // start vertex (16 bit)
WORD v2; // end vertex (16 bit) uint16_t v2; // end vertex (16 bit)
WORD linedef; // linedef, or -1 for minisegs uint16_t linedef; // linedef, or -1 for minisegs
WORD side; // side on linedef: 0 for right, 1 for left uint16_t side; // side on linedef: 0 for right, 1 for left
WORD partner; // corresponding partner seg, or 0xffff on one-sided walls uint16_t partner; // corresponding partner seg, or 0xffff on one-sided walls
}; };
struct glseg3_t struct glseg3_t
{ {
int32_t v1; int32_t v1;
int32_t v2; int32_t v2;
WORD linedef; uint16_t linedef;
WORD side; uint16_t side;
int32_t partner; int32_t partner;
}; };
struct gl5_mapnode_t struct gl5_mapnode_t
{ {
SWORD x,y,dx,dy; // partition line int16_t x,y,dx,dy; // partition line
SWORD bbox[2][4]; // bounding box for each child int16_t bbox[2][4]; // bounding box for each child
// If NF_SUBSECTOR is or'ed in, it's a subsector, // If NF_SUBSECTOR is or'ed in, it's a subsector,
// else it's a node of another subtree. // else it's a node of another subtree.
DWORD children[2]; uint32_t children[2];
}; };
@ -181,7 +181,7 @@ bool P_CheckForGLNodes()
} }
else else
{ {
for(DWORD j=0;j<sub->numlines;j++) for(uint32_t j=0;j<sub->numlines;j++)
{ {
if (segs[j].linedef==NULL) // miniseg if (segs[j].linedef==NULL) // miniseg
{ {
@ -221,14 +221,14 @@ static bool format5;
static bool LoadGLVertexes(FileReader * lump) static bool LoadGLVertexes(FileReader * lump)
{ {
BYTE *gldata; uint8_t *gldata;
int i; int i;
firstglvertex = level.vertexes.Size(); firstglvertex = level.vertexes.Size();
int gllen=lump->GetLength(); int gllen=lump->GetLength();
gldata = new BYTE[gllen]; gldata = new uint8_t[gllen];
lump->Seek(0, SEEK_SET); lump->Seek(0, SEEK_SET);
lump->Read(gldata, gllen); lump->Read(gldata, gllen);
@ -377,7 +377,7 @@ static bool LoadGLSegs(FileReader * lump)
segs[i].v1 = &level.vertexes[checkGLVertex3(LittleLong(ml->v1))]; segs[i].v1 = &level.vertexes[checkGLVertex3(LittleLong(ml->v1))];
segs[i].v2 = &level.vertexes[checkGLVertex3(LittleLong(ml->v2))]; segs[i].v2 = &level.vertexes[checkGLVertex3(LittleLong(ml->v2))];
const DWORD partner = LittleLong(ml->partner); const uint32_t partner = LittleLong(ml->partner);
segs[i].PartnerSeg = DWORD_MAX == partner ? nullptr : &segs[partner]; segs[i].PartnerSeg = DWORD_MAX == partner ? nullptr : &segs[partner];
if(ml->linedef != 0xffff) // skip minisegs if(ml->linedef != 0xffff) // skip minisegs
@ -533,7 +533,7 @@ static bool LoadNodes (FileReader * lump)
int j; int j;
int k; int k;
node_t* no; node_t* no;
WORD* used; uint16_t* used;
if (!format5) if (!format5)
{ {
@ -548,8 +548,8 @@ static bool LoadNodes (FileReader * lump)
basemn = mn = new mapnode_t[numnodes]; basemn = mn = new mapnode_t[numnodes];
lump->Read(mn, lump->GetLength()); lump->Read(mn, lump->GetLength());
used = (WORD *)alloca (sizeof(WORD)*numnodes); used = (uint16_t *)alloca (sizeof(uint16_t)*numnodes);
memset (used, 0, sizeof(WORD)*numnodes); memset (used, 0, sizeof(uint16_t)*numnodes);
no = nodes; no = nodes;
@ -561,7 +561,7 @@ static bool LoadNodes (FileReader * lump)
no->dy = LittleShort(mn->dy)<<FRACBITS; no->dy = LittleShort(mn->dy)<<FRACBITS;
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
{ {
WORD child = LittleShort(mn->children[j]); uint16_t child = LittleShort(mn->children[j]);
if (child & NF_SUBSECTOR) if (child & NF_SUBSECTOR)
{ {
child &= ~NF_SUBSECTOR; child &= ~NF_SUBSECTOR;
@ -570,7 +570,7 @@ static bool LoadNodes (FileReader * lump)
delete [] basemn; delete [] basemn;
return false; return false;
} }
no->children[j] = (BYTE *)&subsectors[child] + 1; no->children[j] = (uint8_t *)&subsectors[child] + 1;
} }
else if (child >= numnodes) else if (child >= numnodes)
{ {
@ -608,8 +608,8 @@ static bool LoadNodes (FileReader * lump)
basemn = mn = new gl5_mapnode_t[numnodes]; basemn = mn = new gl5_mapnode_t[numnodes];
lump->Read(mn, lump->GetLength()); lump->Read(mn, lump->GetLength());
used = (WORD *)alloca (sizeof(WORD)*numnodes); used = (uint16_t *)alloca (sizeof(uint16_t)*numnodes);
memset (used, 0, sizeof(WORD)*numnodes); memset (used, 0, sizeof(uint16_t)*numnodes);
no = nodes; no = nodes;
@ -630,7 +630,7 @@ static bool LoadNodes (FileReader * lump)
delete [] basemn; delete [] basemn;
return false; return false;
} }
no->children[j] = (BYTE *)&subsectors[child] + 1; no->children[j] = (uint8_t *)&subsectors[child] + 1;
} }
else if (child >= numnodes) else if (child >= numnodes)
{ {
@ -808,7 +808,7 @@ static int FindGLNodesInFile(FResourceFile * f, const char * label)
FString glheader; FString glheader;
bool mustcheck=false; bool mustcheck=false;
DWORD numentries = f->LumpCount(); uint32_t numentries = f->LumpCount();
glheader.Format("GL_%.8s", label); glheader.Format("GL_%.8s", label);
if (glheader.Len()>8) if (glheader.Len()>8)
@ -819,7 +819,7 @@ static int FindGLNodesInFile(FResourceFile * f, const char * label)
if (numentries > 4) if (numentries > 4)
{ {
for(DWORD i=0;i<numentries-4;i++) for(uint32_t i=0;i<numentries-4;i++)
{ {
if (!strnicmp(f->GetLump(i)->Name, glheader, 8)) if (!strnicmp(f->GetLump(i)->Name, glheader, 8))
{ {
@ -1051,7 +1051,7 @@ bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime)
// //
//========================================================================== //==========================================================================
typedef TArray<BYTE> MemFile; typedef TArray<uint8_t> MemFile;
static FString CreateCacheName(MapData *map, bool create) static FString CreateCacheName(MapData *map, bool create)
@ -1067,25 +1067,25 @@ static FString CreateCacheName(MapData *map, bool create)
return path; return path;
} }
static void WriteByte(MemFile &f, BYTE b) static void WriteByte(MemFile &f, uint8_t b)
{ {
f.Push(b); f.Push(b);
} }
static void WriteWord(MemFile &f, WORD b) static void WriteWord(MemFile &f, uint16_t b)
{ {
int v = f.Reserve(2); int v = f.Reserve(2);
f[v] = (BYTE)b; f[v] = (uint8_t)b;
f[v+1] = (BYTE)(b>>8); f[v+1] = (uint8_t)(b>>8);
} }
static void WriteLong(MemFile &f, DWORD b) static void WriteLong(MemFile &f, uint32_t b)
{ {
int v = f.Reserve(4); int v = f.Reserve(4);
f[v] = (BYTE)b; f[v] = (uint8_t)b;
f[v+1] = (BYTE)(b>>8); f[v+1] = (uint8_t)(b>>8);
f[v+2] = (BYTE)(b>>16); f[v+2] = (uint8_t)(b>>16);
f[v+3] = (BYTE)(b>>24); f[v+3] = (uint8_t)(b>>24);
} }
static void CreateCachedNodes(MapData *map) static void CreateCachedNodes(MapData *map)
@ -1110,10 +1110,10 @@ static void CreateCachedNodes(MapData *map)
for(int i=0;i<numsegs;i++) for(int i=0;i<numsegs;i++)
{ {
WriteLong(ZNodes, segs[i].v1->Index()); WriteLong(ZNodes, segs[i].v1->Index());
WriteLong(ZNodes, segs[i].PartnerSeg == nullptr? 0xffffffffu : DWORD(segs[i].PartnerSeg - segs)); WriteLong(ZNodes, segs[i].PartnerSeg == nullptr? 0xffffffffu : uint32_t(segs[i].PartnerSeg - segs));
if (segs[i].linedef) if (segs[i].linedef)
{ {
WriteLong(ZNodes, DWORD(segs[i].linedef->Index())); WriteLong(ZNodes, uint32_t(segs[i].linedef->Index()));
WriteByte(ZNodes, segs[i].sidedef == segs[i].linedef->sidedef[0]? 0:1); WriteByte(ZNodes, segs[i].sidedef == segs[i].linedef->sidedef[0]? 0:1);
} }
else else
@ -1140,21 +1140,21 @@ static void CreateCachedNodes(MapData *map)
for (int j = 0; j < 2; ++j) for (int j = 0; j < 2; ++j)
{ {
DWORD child; uint32_t child;
if ((size_t)nodes[i].children[j] & 1) if ((size_t)nodes[i].children[j] & 1)
{ {
child = 0x80000000 | DWORD((subsector_t *)((BYTE *)nodes[i].children[j] - 1) - subsectors); child = 0x80000000 | uint32_t((subsector_t *)((uint8_t *)nodes[i].children[j] - 1) - subsectors);
} }
else else
{ {
child = DWORD((node_t *)nodes[i].children[j] - nodes); child = uint32_t((node_t *)nodes[i].children[j] - nodes);
} }
WriteLong(ZNodes, child); WriteLong(ZNodes, child);
} }
} }
uLongf outlen = ZNodes.Size(); uLongf outlen = ZNodes.Size();
BYTE *compressed; uint8_t *compressed;
int offset = level.lines.Size() * 8 + 12 + 16; int offset = level.lines.Size() * 8 + 12 + 16;
int r; int r;
do do
@ -1170,12 +1170,12 @@ static void CreateCachedNodes(MapData *map)
while (r == Z_BUF_ERROR); while (r == Z_BUF_ERROR);
memcpy(compressed, "CACH", 4); memcpy(compressed, "CACH", 4);
DWORD len = LittleLong(level.lines.Size()); uint32_t len = LittleLong(level.lines.Size());
memcpy(compressed+4, &len, 4); memcpy(compressed+4, &len, 4);
map->GetChecksum(compressed+8); map->GetChecksum(compressed+8);
for (unsigned i = 0; i < level.lines.Size(); i++) for (unsigned i = 0; i < level.lines.Size(); i++)
{ {
DWORD ndx[2] = { LittleLong(DWORD(level.lines[i].v1->Index())), LittleLong(DWORD(level.lines[i].v2->Index())) }; uint32_t ndx[2] = { LittleLong(uint32_t(level.lines[i].v1->Index())), LittleLong(uint32_t(level.lines[i].v2->Index())) };
memcpy(compressed + 8 + 16 + 8 * i, ndx, 8); memcpy(compressed + 8 + 16 + 8 * i, ndx, 8);
} }
memcpy(compressed + offset - 4, "ZGL3", 4); memcpy(compressed + offset - 4, "ZGL3", 4);
@ -1204,10 +1204,10 @@ static void CreateCachedNodes(MapData *map)
static bool CheckCachedNodes(MapData *map) static bool CheckCachedNodes(MapData *map)
{ {
char magic[4] = {0,0,0,0}; char magic[4] = {0,0,0,0};
BYTE md5[16]; uint8_t md5[16];
BYTE md5map[16]; uint8_t md5map[16];
DWORD numlin; uint32_t numlin;
DWORD *verts = NULL; uint32_t *verts = NULL;
FString path = CreateCacheName(map, false); FString path = CreateCacheName(map, false);
FILE *f = fopen(path, "rb"); FILE *f = fopen(path, "rb");
@ -1224,7 +1224,7 @@ static bool CheckCachedNodes(MapData *map)
map->GetChecksum(md5map); map->GetChecksum(md5map);
if (memcmp(md5, md5map, 16)) goto errorout; if (memcmp(md5, md5map, 16)) goto errorout;
verts = new DWORD[numlin * 8]; verts = new uint32_t[numlin * 8];
if (fread(verts, 8, numlin, f) != numlin) goto errorout; if (fread(verts, 8, numlin, f) != numlin) goto errorout;
if (fread(magic, 1, 4, f) != 4) goto errorout; if (fread(magic, 1, 4, f) != 4) goto errorout;
@ -1353,7 +1353,7 @@ subsector_t *P_PointInSubsector (double x, double y)
} }
while (!((size_t)node & 1)); while (!((size_t)node & 1));
return (subsector_t *)((BYTE *)node - 1); return (subsector_t *)((uint8_t *)node - 1);
} }
//========================================================================== //==========================================================================
@ -1406,7 +1406,7 @@ static bool PointOnLine (int x, int y, int x1, int y1, int dx, int dy)
void P_SetRenderSector() void P_SetRenderSector()
{ {
int i; int i;
DWORD j; uint32_t j;
TArray<subsector_t *> undetermined; TArray<subsector_t *> undetermined;
subsector_t * ss; subsector_t * ss;

View file

@ -155,8 +155,8 @@ public:
void Serialize(FSerializer &arc); void Serialize(FSerializer &arc);
void Tick(); void Tick();
protected: protected:
BYTE m_BaseLevel; uint8_t m_BaseLevel;
BYTE m_Phase; uint8_t m_Phase;
private: private:
DPhased(); DPhased();
DPhased(sector_t *sector, int baselevel); DPhased(sector_t *sector, int baselevel);

View file

@ -73,7 +73,7 @@
5 : Copy texture and type; trigger model. ( = 2) 5 : Copy texture and type; trigger model. ( = 2)
6 : Copy texture and type; numeric model. ( = 2+4) 6 : Copy texture and type; numeric model. ( = 2+4)
*/ */
static const BYTE ChangeMap[8] = { 0, 1, 5, 3, 7, 2, 6, 0 }; static const uint8_t ChangeMap[8] = { 0, 1, 5, 3, 7, 2, 6, 0 };
int LS_Sector_SetPlaneReflection(line_t *ln, AActor *it, bool backSide, int arg0, int arg1, int arg2, int arg3, int arg4); int LS_Sector_SetPlaneReflection(line_t *ln, AActor *it, bool backSide, int arg0, int arg1, int arg2, int arg3, int arg4);
int LS_SetGlobalFogParameter(line_t *ln, AActor *it, bool backSide, int arg0, int arg1, int arg2, int arg3, int arg4); int LS_SetGlobalFogParameter(line_t *ln, AActor *it, bool backSide, int arg0, int arg1, int arg2, int arg3, int arg4);
@ -106,7 +106,7 @@ static FRandom pr_glass ("GlassBreak");
// There are aliases for the ACS specials that take names instead of numbers. // There are aliases for the ACS specials that take names instead of numbers.
// This table maps them onto the real number-based specials. // This table maps them onto the real number-based specials.
BYTE NamedACSToNormalACS[7] = uint8_t NamedACSToNormalACS[7] =
{ {
ACS_Execute, ACS_Execute,
ACS_Suspend, ACS_Suspend,

View file

@ -47,9 +47,9 @@ struct FLineSpecial
{ {
const char *name; const char *name;
int number; int number;
SBYTE min_args; int8_t min_args;
SBYTE max_args; int8_t max_args;
BYTE map_args; uint8_t map_args;
}; };
@ -196,7 +196,7 @@ typedef int (*lnSpecFunc)(struct line_t *line,
int arg4, int arg4,
int arg5); int arg5);
extern BYTE NamedACSToNormalACS[7]; extern uint8_t NamedACSToNormalACS[7];
static inline bool P_IsACSSpecial(int specnum) static inline bool P_IsACSSpecial(int specnum)
{ {
return (specnum >= ACS_Execute && specnum <= ACS_LockedExecuteDoor) || return (specnum >= ACS_Execute && specnum <= ACS_LockedExecuteDoor) ||

View file

@ -407,7 +407,7 @@ const secplane_t * P_CheckSlopeWalk(AActor *actor, DVector2 &move);
// //
// P_SETUP // P_SETUP
// //
extern BYTE* rejectmatrix; // for fast sight rejection extern uint8_t* rejectmatrix; // for fast sight rejection

View file

@ -4695,7 +4695,7 @@ DEFINE_ACTION_FUNCTION(AActor, LineAttack)
// //
//========================================================================== //==========================================================================
AActor *P_LinePickActor(AActor *t1, DAngle angle, double distance, DAngle pitch, ActorFlags actorMask, DWORD wallMask) AActor *P_LinePickActor(AActor *t1, DAngle angle, double distance, DAngle pitch, ActorFlags actorMask, uint32_t wallMask)
{ {
DVector3 direction; DVector3 direction;
double shootz; double shootz;

View file

@ -2057,6 +2057,6 @@ sector_t *P_PointInSectorBuggy(double x, double y)
node = (node_t *)node->children[R_PointOnSideSlow(x, y, node)]; node = (node_t *)node->children[R_PointOnSideSlow(x, y, node)];
} while (!((size_t)node & 1)); } while (!((size_t)node & 1));
subsector_t *ssec = (subsector_t *)((BYTE *)node - 1); subsector_t *ssec = (subsector_t *)((uint8_t *)node - 1);
return ssec->sector; return ssec->sector;
} }

View file

@ -175,10 +175,10 @@ struct FPortalGroupArray
inited = false; inited = false;
} }
void Add(DWORD num) void Add(uint32_t num)
{ {
if (varused < MAX_STATIC) entry[varused++] = (WORD)num; if (varused < MAX_STATIC) entry[varused++] = (uint16_t)num;
else data.Push((WORD)num); else data.Push((uint16_t)num);
} }
unsigned Size() unsigned Size()
@ -186,7 +186,7 @@ struct FPortalGroupArray
return varused + data.Size(); return varused + data.Size();
} }
DWORD operator[](unsigned index) uint32_t operator[](unsigned index)
{ {
return index < MAX_STATIC ? entry[index] : data[index - MAX_STATIC]; return index < MAX_STATIC ? entry[index] : data[index - MAX_STATIC];
} }
@ -195,9 +195,9 @@ struct FPortalGroupArray
int method; int method;
private: private:
WORD entry[MAX_STATIC]; uint16_t entry[MAX_STATIC];
BYTE varused; uint8_t varused;
TArray<WORD> data; TArray<uint16_t> data;
}; };
class FBlockLinesIterator class FBlockLinesIterator

View file

@ -535,12 +535,12 @@ AActor::AActor () throw()
AActor::AActor (const AActor &other) throw() AActor::AActor (const AActor &other) throw()
: DThinker() : DThinker()
{ {
memcpy (&snext, &other.snext, (BYTE *)&this[1] - (BYTE *)&snext); memcpy (&snext, &other.snext, (uint8_t *)&this[1] - (uint8_t *)&snext);
} }
AActor &AActor::operator= (const AActor &other) AActor &AActor::operator= (const AActor &other)
{ {
memcpy (&snext, &other.snext, (BYTE *)&this[1] - (BYTE *)&snext); memcpy (&snext, &other.snext, (uint8_t *)&this[1] - (uint8_t *)&snext);
return *this; return *this;
} }
@ -3739,7 +3739,7 @@ bool AActor::IsOkayToAttack (AActor *link)
return false; return false;
} }
void AActor::SetShade (DWORD rgb) void AActor::SetShade (uint32_t rgb)
{ {
PalEntry *entry = (PalEntry *)&rgb; PalEntry *entry = (PalEntry *)&rgb;
fillcolor = rgb | (ColorMatcher.Pick (entry->r, entry->g, entry->b) << 24); fillcolor = rgb | (ColorMatcher.Pick (entry->r, entry->g, entry->b) << 24);
@ -3904,8 +3904,8 @@ void AActor::CheckPortalTransition(bool islinked)
void AActor::Tick () void AActor::Tick ()
{ {
// [RH] Data for Heretic/Hexen scrolling sectors // [RH] Data for Heretic/Hexen scrolling sectors
static const SBYTE HexenCompatSpeeds[] = {-25, 0, -10, -5, 0, 5, 10, 0, 25 }; static const int8_t HexenCompatSpeeds[] = {-25, 0, -10, -5, 0, 5, 10, 0, 25 };
static const SBYTE HexenScrollies[24][2] = static const int8_t HexenScrollies[24][2] =
{ {
{ 0, 1 }, { 0, 2 }, { 0, 4 }, { 0, 1 }, { 0, 2 }, { 0, 4 },
{ -1, 0 }, { -2, 0 }, { -4, 0 }, { -1, 0 }, { -2, 0 }, { -4, 0 },
@ -3917,8 +3917,8 @@ void AActor::Tick ()
{ 1, -1 }, { 2, -2 }, { 4, -4 } { 1, -1 }, { 2, -2 }, { 4, -4 }
}; };
static const BYTE HereticScrollDirs[4] = { 6, 9, 1, 4 }; static const uint8_t HereticScrollDirs[4] = { 6, 9, 1, 4 };
static const BYTE HereticSpeedMuls[5] = { 5, 10, 25, 30, 35 }; static const uint8_t HereticSpeedMuls[5] = { 5, 10, 25, 30, 35 };
AActor *onmo; AActor *onmo;
@ -4172,7 +4172,7 @@ void AActor::Tick ()
scrolltype <= Carry_West35) scrolltype <= Carry_West35)
{ // Heretic scroll special { // Heretic scroll special
scrolltype -= Carry_East5; scrolltype -= Carry_East5;
BYTE dir = HereticScrollDirs[scrolltype / 5]; uint8_t dir = HereticScrollDirs[scrolltype / 5];
double carryspeed = HereticSpeedMuls[scrolltype % 5] * (1. / (32 * CARRYFACTOR)); double carryspeed = HereticSpeedMuls[scrolltype % 5] * (1. / (32 * CARRYFACTOR));
if (scrolltype < 5 && !(i_compatflags&COMPATF_RAVENSCROLL)) if (scrolltype < 5 && !(i_compatflags&COMPATF_RAVENSCROLL))
{ {
@ -4909,7 +4909,7 @@ AActor *AActor::StaticSpawn (PClassActor *type, const DVector3 &pos, replace_t a
actor->SpawnPoint.Z = (actor->Z() - actor->Sector->floorplane.ZatPoint(actor)); actor->SpawnPoint.Z = (actor->Z() - actor->Sector->floorplane.ZatPoint(actor));
} }
if (actor->FloatBobPhase == (BYTE)-1) actor->FloatBobPhase = rng(); // Don't make everything bob in sync (unless deliberately told to do) if (actor->FloatBobPhase == (uint8_t)-1) actor->FloatBobPhase = rng(); // Don't make everything bob in sync (unless deliberately told to do)
if (actor->flags2 & MF2_FLOORCLIP) if (actor->flags2 & MF2_FLOORCLIP)
{ {
actor->AdjustFloorClip (); actor->AdjustFloorClip ();
@ -5316,7 +5316,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
{ {
player_t *p; player_t *p;
APlayerPawn *mobj, *oldactor; APlayerPawn *mobj, *oldactor;
BYTE state; uint8_t state;
DVector3 spawn; DVector3 spawn;
DAngle SpawnAngle; DAngle SpawnAngle;

View file

@ -331,7 +331,7 @@ void RecalculateDrawnSubsectors()
FSerializer &Serialize(FSerializer &arc, const char *key, subsector_t *&ss, subsector_t **) FSerializer &Serialize(FSerializer &arc, const char *key, subsector_t *&ss, subsector_t **)
{ {
BYTE by; uint8_t by;
const char *str; const char *str;
if (arc.isWriting()) if (arc.isWriting())
@ -526,7 +526,7 @@ void P_SerializeSounds(FSerializer &arc)
S_SerializeSounds(arc); S_SerializeSounds(arc);
DSeqNode::SerializeSequences (arc); DSeqNode::SerializeSequences (arc);
const char *name = NULL; const char *name = NULL;
BYTE order; uint8_t order;
if (arc.isWriting()) if (arc.isWriting())
{ {
@ -691,8 +691,8 @@ static void ReadMultiplePlayers(FSerializer &arc, int numPlayers, int numPlayers
int i, j; int i, j;
const char **nametemp = new const char *[numPlayers]; const char **nametemp = new const char *[numPlayers];
player_t *playertemp = new player_t[numPlayers]; player_t *playertemp = new player_t[numPlayers];
BYTE *tempPlayerUsed = new BYTE[numPlayers]; uint8_t *tempPlayerUsed = new uint8_t[numPlayers];
BYTE playerUsed[MAXPLAYERS]; uint8_t playerUsed[MAXPLAYERS];
for (i = 0; i < numPlayers; ++i) for (i = 0; i < numPlayers; ++i)
{ {
@ -908,7 +908,7 @@ void G_SerializeLevel(FSerializer &arc, bool hubload)
// prevent bad things from happening by doing a check on the size of level arrays and the map's entire checksum. // prevent bad things from happening by doing a check on the size of level arrays and the map's entire checksum.
// The old code happily tried to load savegames with any mismatch here, often causing meaningless errors // The old code happily tried to load savegames with any mismatch here, often causing meaningless errors
// deep down in the deserializer or just a crash if the few insufficient safeguards were not triggered. // deep down in the deserializer or just a crash if the few insufficient safeguards were not triggered.
BYTE chk[16] = { 0 }; uint8_t chk[16] = { 0 };
arc.Array("checksum", chk, 16); arc.Array("checksum", chk, 16);
if (arc.GetSize("linedefs") != level.lines.Size() || if (arc.GetSize("linedefs") != level.lines.Size() ||
arc.GetSize("sidedefs") != level.sides.Size() || arc.GetSize("sidedefs") != level.sides.Size() ||

View file

@ -113,7 +113,7 @@ inline bool P_IsBuildMap(MapData *map)
return false; return false;
} }
inline bool P_LoadBuildMap(BYTE *mapdata, size_t len, FMapThing **things, int *numthings) inline bool P_LoadBuildMap(uint8_t *mapdata, size_t len, FMapThing **things, int *numthings)
{ {
return false; return false;
} }
@ -180,7 +180,7 @@ FBlockNode** blocklinks; // for thing chains
// Without special effect, this could be // Without special effect, this could be
// used as a PVS lookup as well. // used as a PVS lookup as well.
// //
BYTE* rejectmatrix; uint8_t* rejectmatrix;
bool ForceNodeBuild; bool ForceNodeBuild;
@ -414,7 +414,7 @@ MapData *P_OpenMapData(const char * mapname, bool justcheck)
wadReader = map->resource->GetReader(); wadReader = map->resource->GetReader();
} }
} }
DWORD id; uint32_t id;
// Although we're using the resource system, we still want to be sure we're // Although we're using the resource system, we still want to be sure we're
// reading from a wad file. // reading from a wad file.
@ -429,7 +429,7 @@ MapData *P_OpenMapData(const char * mapname, bool justcheck)
map->MapLumps[0].Reader = map->resource->GetLump(0)->NewReader(); map->MapLumps[0].Reader = map->resource->GetLump(0)->NewReader();
strncpy(map->MapLumps[0].Name, map->resource->GetLump(0)->Name, 8); strncpy(map->MapLumps[0].Name, map->resource->GetLump(0)->Name, 8);
for(DWORD i = 1; i < map->resource->LumpCount(); i++) for(uint32_t i = 1; i < map->resource->LumpCount(); i++)
{ {
const char* lumpname = map->resource->GetLump(i)->Name; const char* lumpname = map->resource->GetLump(i)->Name;
@ -534,7 +534,7 @@ bool P_CheckMapData(const char *mapname)
// //
//=========================================================================== //===========================================================================
void MapData::GetChecksum(BYTE cksum[16]) void MapData::GetChecksum(uint8_t cksum[16])
{ {
MD5Context md5; MD5Context md5;
@ -674,7 +674,7 @@ static void SummarizeMissingTextures(const FMissingTextureTracker &missing)
// //
//=========================================================================== //===========================================================================
static void SetTexture (side_t *side, int position, DWORD *blend, const char *name) static void SetTexture (side_t *side, int position, uint32_t *blend, const char *name)
{ {
FTextureID texture; FTextureID texture;
if ((*blend = R_ColormapNumForName (name)) == 0) if ((*blend = R_ColormapNumForName (name)) == 0)
@ -702,7 +702,7 @@ static void SetTexture (side_t *side, int position, DWORD *blend, const char *na
side->SetTexture(position, texture); side->SetTexture(position, texture);
} }
static void SetTextureNoErr (side_t *side, int position, DWORD *color, const char *name, bool *validcolor, bool isFog) static void SetTextureNoErr (side_t *side, int position, uint32_t *color, const char *name, bool *validcolor, bool isFog)
{ {
FTextureID texture; FTextureID texture;
*validcolor = false; *validcolor = false;
@ -866,9 +866,9 @@ void P_LoadZSegs (FileReaderBase &data)
for (int i = 0; i < numsegs; ++i) for (int i = 0; i < numsegs; ++i)
{ {
line_t *ldef; line_t *ldef;
DWORD v1, v2; uint32_t v1, v2;
WORD line; uint16_t line;
BYTE side; uint8_t side;
data >> v1 >> v2 >> line >> side; data >> v1 >> v2 >> line >> side;
@ -904,10 +904,10 @@ void P_LoadGLZSegs (FileReaderBase &data, int type)
for (size_t j = 0; j < subsectors[i].numlines; ++j) for (size_t j = 0; j < subsectors[i].numlines; ++j)
{ {
seg_t *seg; seg_t *seg;
DWORD v1, partner; uint32_t v1, partner;
DWORD line; uint32_t line;
WORD lineword; uint16_t lineword;
BYTE side; uint8_t side;
data >> v1 >> partner; data >> v1 >> partner;
if (type >= 2) if (type >= 2)
@ -969,7 +969,7 @@ void P_LoadGLZSegs (FileReaderBase &data, int type)
void LoadZNodes(FileReaderBase &data, int glnodes) void LoadZNodes(FileReaderBase &data, int glnodes)
{ {
// Read extra vertices added during node building // Read extra vertices added during node building
DWORD orgVerts, newVerts; uint32_t orgVerts, newVerts;
TStaticArray<vertex_t> newvertarray; TStaticArray<vertex_t> newvertarray;
unsigned int i; unsigned int i;
@ -1009,7 +1009,7 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
level.vertexes = std::move(newvertarray); level.vertexes = std::move(newvertarray);
// Read the subsectors // Read the subsectors
DWORD numSubs, currSeg; uint32_t numSubs, currSeg;
data >> numSubs; data >> numSubs;
numsubsectors = numSubs; numsubsectors = numSubs;
@ -1018,7 +1018,7 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
for (i = currSeg = 0; i < numSubs; ++i) for (i = currSeg = 0; i < numSubs; ++i)
{ {
DWORD numsegs; uint32_t numsegs;
data >> numsegs; data >> numsegs;
subsectors[i].firstline = (seg_t *)(size_t)currSeg; // Oh damn. I should have stored the seg count sooner. subsectors[i].firstline = (seg_t *)(size_t)currSeg; // Oh damn. I should have stored the seg count sooner.
@ -1027,7 +1027,7 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
} }
// Read the segs // Read the segs
DWORD numSegs; uint32_t numSegs;
data >> numSegs; data >> numSegs;
@ -1057,7 +1057,7 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
} }
// Read nodes // Read nodes
DWORD numNodes; uint32_t numNodes;
data >> numNodes; data >> numNodes;
numnodes = numNodes; numnodes = numNodes;
@ -1068,7 +1068,7 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
{ {
if (glnodes < 3) if (glnodes < 3)
{ {
SWORD x, y, dx, dy; int16_t x, y, dx, dy;
data >> x >> y >> dx >> dy; data >> x >> y >> dx >> dy;
nodes[i].x = x << FRACBITS; nodes[i].x = x << FRACBITS;
@ -1084,18 +1084,18 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
{ {
for (int k = 0; k < 4; ++k) for (int k = 0; k < 4; ++k)
{ {
SWORD coord; int16_t coord;
data >> coord; data >> coord;
nodes[i].bbox[j][k] = coord; nodes[i].bbox[j][k] = coord;
} }
} }
for (int m = 0; m < 2; ++m) for (int m = 0; m < 2; ++m)
{ {
DWORD child; uint32_t child;
data >> child; data >> child;
if (child & 0x80000000) if (child & 0x80000000)
{ {
nodes[i].children[m] = (BYTE *)&subsectors[child & 0x7FFFFFFF] + 1; nodes[i].children[m] = (uint8_t *)&subsectors[child & 0x7FFFFFFF] + 1;
} }
else else
{ {
@ -1106,7 +1106,7 @@ void LoadZNodes(FileReaderBase &data, int glnodes)
} }
void P_LoadZNodes (FileReader &dalump, DWORD id) void P_LoadZNodes (FileReader &dalump, uint32_t id)
{ {
int type; int type;
bool compressed; bool compressed;
@ -1206,10 +1206,10 @@ template<class segtype>
void P_LoadSegs (MapData * map) void P_LoadSegs (MapData * map)
{ {
int i; int i;
BYTE *data; uint8_t *data;
int numvertexes = level.vertexes.Size(); int numvertexes = level.vertexes.Size();
BYTE *vertchanged = new BYTE[numvertexes]; // phares 10/4/98 uint8_t *vertchanged = new uint8_t[numvertexes]; // phares 10/4/98
DWORD segangle; uint32_t segangle;
//int ptp_angle; // phares 10/4/98 //int ptp_angle; // phares 10/4/98
//int delta_angle; // phares 10/4/98 //int delta_angle; // phares 10/4/98
int vnum1,vnum2; // phares 10/4/98 int vnum1,vnum2; // phares 10/4/98
@ -1232,7 +1232,7 @@ void P_LoadSegs (MapData * map)
segs = new seg_t[numsegs]; segs = new seg_t[numsegs];
memset (segs, 0, numsegs*sizeof(seg_t)); memset (segs, 0, numsegs*sizeof(seg_t));
data = new BYTE[lumplen]; data = new uint8_t[lumplen];
map->Read(ML_SEGS, data); map->Read(ML_SEGS, data);
for (i = 0; i < numsubsectors; ++i) for (i = 0; i < numsubsectors; ++i)
@ -1270,7 +1270,7 @@ void P_LoadSegs (MapData * map)
li->v1 = &level.vertexes[vnum1]; li->v1 = &level.vertexes[vnum1];
li->v2 = &level.vertexes[vnum2]; li->v2 = &level.vertexes[vnum2];
segangle = (WORD)LittleShort(ml->angle); segangle = (uint16_t)LittleShort(ml->angle);
// phares 10/4/98: In the case of a lineseg that was created by splitting // phares 10/4/98: In the case of a lineseg that was created by splitting
// another line, it appears that the line angle is inherited from the // another line, it appears that the line angle is inherited from the
@ -1387,7 +1387,7 @@ template<class subsectortype, class segtype>
void P_LoadSubsectors (MapData * map) void P_LoadSubsectors (MapData * map)
{ {
int i; int i;
DWORD maxseg = map->Size(ML_SEGS) / sizeof(segtype); uint32_t maxseg = map->Size(ML_SEGS) / sizeof(segtype);
numsubsectors = map->Size(ML_SSECTORS) / sizeof(subsectortype); numsubsectors = map->Size(ML_SSECTORS) / sizeof(subsectortype);
@ -1561,7 +1561,7 @@ void P_LoadNodes (MapData * map)
char *mnp; char *mnp;
nodetype *mn; nodetype *mn;
node_t* no; node_t* no;
WORD* used; uint16_t* used;
int lumplen = map->Size(ML_NODES); int lumplen = map->Size(ML_NODES);
int maxss = map->Size(ML_SSECTORS) / sizeof(subsectortype); int maxss = map->Size(ML_SSECTORS) / sizeof(subsectortype);
@ -1574,8 +1574,8 @@ void P_LoadNodes (MapData * map)
} }
nodes = new node_t[numnodes]; nodes = new node_t[numnodes];
used = (WORD *)alloca (sizeof(WORD)*numnodes); used = (uint16_t *)alloca (sizeof(uint16_t)*numnodes);
memset (used, 0, sizeof(WORD)*numnodes); memset (used, 0, sizeof(uint16_t)*numnodes);
mnp = new char[lumplen]; mnp = new char[lumplen];
mn = (nodetype*)(mnp + nodetype::NF_LUMPOFFSET); mn = (nodetype*)(mnp + nodetype::NF_LUMPOFFSET);
@ -1603,7 +1603,7 @@ void P_LoadNodes (MapData * map)
delete[] mnp; delete[] mnp;
return; return;
} }
no->children[j] = (BYTE *)&subsectors[child] + 1; no->children[j] = (uint8_t *)&subsectors[child] + 1;
} }
else if (child >= numnodes) else if (child >= numnodes)
{ {
@ -1685,7 +1685,7 @@ static void SetMapThingUserData(AActor *actor, unsigned udi)
} }
else else
{ // Set the value of the specified user variable. { // Set the value of the specified user variable.
var->Type->SetValue(reinterpret_cast<BYTE *>(actor) + var->Offset, value); var->Type->SetValue(reinterpret_cast<uint8_t *>(actor) + var->Offset, value);
} }
} }
} }
@ -1696,9 +1696,9 @@ static void SetMapThingUserData(AActor *actor, unsigned udi)
// //
//=========================================================================== //===========================================================================
WORD MakeSkill(int flags) uint16_t MakeSkill(int flags)
{ {
WORD res = 0; uint16_t res = 0;
if (flags & 1) res |= 1+2; if (flags & 1) res |= 1+2;
if (flags & 2) res |= 4; if (flags & 2) res |= 4;
if (flags & 4) res |= 8+16; if (flags & 4) res |= 8+16;
@ -1973,7 +1973,7 @@ void P_SaveLineSpecial (line_t *ld)
if (ld->sidedef[0] == NULL) if (ld->sidedef[0] == NULL)
return; return;
DWORD sidenum = ld->sidedef[0]->Index(); uint32_t sidenum = ld->sidedef[0]->Index();
// killough 4/4/98: support special sidedef interpretation below // killough 4/4/98: support special sidedef interpretation below
// [RH] Save Static_Init only if it's interested in the textures // [RH] Save Static_Init only if it's interested in the textures
if (ld->special != Static_Init || ld->args[1] == Init_Color) if (ld->special != Static_Init || ld->args[1] == Init_Color)
@ -2068,7 +2068,7 @@ void P_FinishLoadingLineDefs ()
} }
} }
static void P_SetSideNum (side_t **sidenum_p, WORD sidenum) static void P_SetSideNum (side_t **sidenum_p, uint16_t sidenum)
{ {
if (sidenum == NO_INDEX) if (sidenum == NO_INDEX)
{ {
@ -2356,7 +2356,7 @@ static void P_LoopSidedefs (bool firstloop)
// one that forms the smallest angle is assumed to be the right one. // one that forms the smallest angle is assumed to be the right one.
for (i = 0; i < numsides; ++i) for (i = 0; i < numsides; ++i)
{ {
DWORD right; uint32_t right;
line_t *line = level.sides[i].linedef; line_t *line = level.sides[i].linedef;
// If the side's line only exists in a single sector, // If the side's line only exists in a single sector,
@ -2449,7 +2449,7 @@ static void P_LoopSidedefs (bool firstloop)
int P_DetermineTranslucency (int lumpnum) int P_DetermineTranslucency (int lumpnum)
{ {
FWadLump tranmap = Wads.OpenLumpNum (lumpnum); FWadLump tranmap = Wads.OpenLumpNum (lumpnum);
BYTE index; uint8_t index;
PalEntry newcolor; PalEntry newcolor;
PalEntry newcolor2; PalEntry newcolor2;
@ -2508,7 +2508,7 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, intmaps
// upper "texture" is light color // upper "texture" is light color
// lower "texture" is fog color // lower "texture" is fog color
{ {
DWORD color = MAKERGB(255,255,255), fog = 0; uint32_t color = MAKERGB(255,255,255), fog = 0;
bool colorgood, foggood; bool colorgood, foggood;
SetTextureNoErr (sd, side_t::bottom, &fog, msd->bottomtexture, &foggood, true); SetTextureNoErr (sd, side_t::bottom, &fog, msd->bottomtexture, &foggood, true);
@ -3026,7 +3026,7 @@ void P_LoadBlockMap (MapData * map)
} }
else else
{ {
BYTE *data = new BYTE[count]; uint8_t *data = new uint8_t[count];
map->Read(ML_BLOCKMAP, data); map->Read(ML_BLOCKMAP, data);
const short *wadblockmaplump = (short *)data; const short *wadblockmaplump = (short *)data;
int i; int i;
@ -3041,13 +3041,13 @@ void P_LoadBlockMap (MapData * map)
blockmaplump[0] = LittleShort(wadblockmaplump[0]); blockmaplump[0] = LittleShort(wadblockmaplump[0]);
blockmaplump[1] = LittleShort(wadblockmaplump[1]); blockmaplump[1] = LittleShort(wadblockmaplump[1]);
blockmaplump[2] = (DWORD)(LittleShort(wadblockmaplump[2])) & 0xffff; blockmaplump[2] = (uint32_t)(LittleShort(wadblockmaplump[2])) & 0xffff;
blockmaplump[3] = (DWORD)(LittleShort(wadblockmaplump[3])) & 0xffff; blockmaplump[3] = (uint32_t)(LittleShort(wadblockmaplump[3])) & 0xffff;
for (i = 4; i < count; i++) for (i = 4; i < count; i++)
{ {
short t = LittleShort(wadblockmaplump[i]); // killough 3/1/98 short t = LittleShort(wadblockmaplump[i]); // killough 3/1/98
blockmaplump[i] = t == -1 ? (DWORD)0xffffffff : (DWORD) t & 0xffff; blockmaplump[i] = t == -1 ? (uint32_t)0xffffffff : (uint32_t) t & 0xffff;
} }
delete[] data; delete[] data;
@ -3266,7 +3266,7 @@ void P_LoadReject (MapData * map, bool junk)
{ {
// Check if the reject has some actual content. If not, free it. // Check if the reject has some actual content. If not, free it.
rejectsize = MIN (rejectsize, neededsize); rejectsize = MIN (rejectsize, neededsize);
rejectmatrix = new BYTE[rejectsize]; rejectmatrix = new uint8_t[rejectsize];
map->Seek(ML_REJECT); map->Seek(ML_REJECT);
map->file->Read (rejectmatrix, rejectsize); map->file->Read (rejectmatrix, rejectsize);
@ -3354,14 +3354,14 @@ void P_GetPolySpots (MapData * map, TArray<FNodeBuilder::FPolyStart> &spots, TAr
static void P_PrecacheLevel() static void P_PrecacheLevel()
{ {
int i; int i;
BYTE *hitlist; uint8_t *hitlist;
TMap<PClassActor *, bool> actorhitlist; TMap<PClassActor *, bool> actorhitlist;
int cnt = TexMan.NumTextures(); int cnt = TexMan.NumTextures();
if (demoplayback) if (demoplayback)
return; return;
hitlist = new BYTE[cnt]; hitlist = new uint8_t[cnt];
memset(hitlist, 0, cnt); memset(hitlist, 0, cnt);
AActor *actor; AActor *actor;
@ -3654,7 +3654,7 @@ void P_SetupLevel (const char *lumpname, int position)
buildmap = false; buildmap = false;
if (map->Size(0) > 0) if (map->Size(0) > 0)
{ {
BYTE *mapdata = new BYTE[map->Size(0)]; uint8_t *mapdata = new uint8_t[map->Size(0)];
map->Seek(0); map->Seek(0);
map->file->Read(mapdata, map->Size(0)); map->file->Read(mapdata, map->Size(0));
times[0].Clock(); times[0].Clock();
@ -3802,7 +3802,7 @@ void P_SetupLevel (const char *lumpname, int position)
{ {
// Check for compressed nodes first, then uncompressed nodes // Check for compressed nodes first, then uncompressed nodes
FWadLump test; FWadLump test;
DWORD id = MAKE_ID('X','x','X','x'), idcheck = 0, idcheck2 = 0, idcheck3 = 0, idcheck4 = 0, idcheck5 = 0, idcheck6 = 0; uint32_t id = MAKE_ID('X','x','X','x'), idcheck = 0, idcheck2 = 0, idcheck3 = 0, idcheck4 = 0, idcheck5 = 0, idcheck6 = 0;
if (map->Size(ML_ZNODES) != 0) if (map->Size(ML_ZNODES) != 0)
{ {

View file

@ -82,7 +82,7 @@ struct MapData
} }
} }
DWORD Size(unsigned int lumpindex) uint32_t Size(unsigned int lumpindex)
{ {
if (lumpindex<countof(MapLumps) && MapLumps[lumpindex].Reader) if (lumpindex<countof(MapLumps) && MapLumps[lumpindex].Reader)
{ {
@ -91,7 +91,7 @@ struct MapData
return 0; return 0;
} }
void GetChecksum(BYTE cksum[16]); void GetChecksum(uint8_t cksum[16]);
}; };
MapData * P_OpenMapData(const char * mapname, bool justcheck); MapData * P_OpenMapData(const char * mapname, bool justcheck);
@ -137,13 +137,13 @@ struct sidei_t // [RH] Only keep BOOM sidedef init stuff around for init
{ {
short tag, special; short tag, special;
short alpha; short alpha;
DWORD map; uint32_t map;
} a; } a;
// Used when grouping sidedefs into loops. // Used when grouping sidedefs into loops.
struct struct
{ {
DWORD first, next; uint32_t first, next;
char lineside; char lineside;
} b; } b;
}; };

View file

@ -146,7 +146,7 @@ bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType, DVe
int lineActivation; int lineActivation;
INTBOOL repeat; INTBOOL repeat;
INTBOOL buttonSuccess; INTBOOL buttonSuccess;
BYTE special; uint8_t special;
if (!P_TestActivateLine (line, mo, side, activationType, optpos)) if (!P_TestActivateLine (line, mo, side, activationType, optpos))
{ {
@ -336,7 +336,7 @@ bool P_PredictLine(line_t *line, AActor *mo, int side, int activationType)
{ {
int lineActivation; int lineActivation;
INTBOOL buttonSuccess; INTBOOL buttonSuccess;
BYTE special; uint8_t special;
// Only predict a very specifc section of specials // Only predict a very specifc section of specials
if (line->special != Teleport_Line && if (line->special != Teleport_Line &&
@ -749,17 +749,17 @@ class DWallLightTransfer : public DThinker
DECLARE_CLASS (DWallLightTransfer, DThinker) DECLARE_CLASS (DWallLightTransfer, DThinker)
DWallLightTransfer() {} DWallLightTransfer() {}
public: public:
DWallLightTransfer (sector_t *srcSec, int target, BYTE flags); DWallLightTransfer (sector_t *srcSec, int target, uint8_t flags);
void Serialize(FSerializer &arc); void Serialize(FSerializer &arc);
void Tick (); void Tick ();
protected: protected:
static void DoTransfer (short level, int target, BYTE flags); static void DoTransfer (short level, int target, uint8_t flags);
sector_t *Source; sector_t *Source;
int TargetID; int TargetID;
short LastLight; short LastLight;
BYTE Flags; uint8_t Flags;
}; };
IMPLEMENT_CLASS(DWallLightTransfer, false, false) IMPLEMENT_CLASS(DWallLightTransfer, false, false)
@ -773,7 +773,7 @@ void DWallLightTransfer::Serialize(FSerializer &arc)
("flags", Flags); ("flags", Flags);
} }
DWallLightTransfer::DWallLightTransfer (sector_t *srcSec, int target, BYTE flags) DWallLightTransfer::DWallLightTransfer (sector_t *srcSec, int target, uint8_t flags)
{ {
int linenum; int linenum;
int wallflags; int wallflags;
@ -819,7 +819,7 @@ void DWallLightTransfer::Tick ()
} }
} }
void DWallLightTransfer::DoTransfer (short lightlevel, int target, BYTE flags) void DWallLightTransfer::DoTransfer (short lightlevel, int target, uint8_t flags)
{ {
int linenum; int linenum;
@ -1204,7 +1204,7 @@ void P_InitSectorSpecial(sector_t *sector, int special)
if (sector->special >= Scroll_North_Slow && if (sector->special >= Scroll_North_Slow &&
sector->special <= Scroll_SouthWest_Fast) sector->special <= Scroll_SouthWest_Fast)
{ // Hexen scroll special { // Hexen scroll special
static const SBYTE hexenScrollies[24][2] = static const int8_t hexenScrollies[24][2] =
{ {
{ 0, 1 }, { 0, 2 }, { 0, 4 }, { 0, 1 }, { 0, 2 }, { 0, 4 },
{ -1, 0 }, { -2, 0 }, { -4, 0 }, { -1, 0 }, { -2, 0 }, { -4, 0 },

View file

@ -150,7 +150,7 @@ void EV_StartLightFading (int tag, int value, int tics);
#define BUTTONTIME TICRATE // 1 second, in ticks. #define BUTTONTIME TICRATE // 1 second, in ticks.
bool P_ChangeSwitchTexture (side_t *side, int useAgain, BYTE special, bool *quest=NULL); bool P_ChangeSwitchTexture (side_t *side, int useAgain, uint8_t special, bool *quest=NULL);
bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 *optpos = NULL); bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 *optpos = NULL);
// //

View file

@ -439,7 +439,7 @@ FStateDefine *FStateDefinitions::FindStateAddress(const char *name)
// //
//========================================================================== //==========================================================================
void FStateDefinitions::SetStateLabel(const char *statename, FState *state, BYTE defflags) void FStateDefinitions::SetStateLabel(const char *statename, FState *state, uint8_t defflags)
{ {
FStateDefine *std = FindStateAddress(statename); FStateDefine *std = FindStateAddress(statename);
std->State = state; std->State = state;

View file

@ -65,12 +65,12 @@ public:
void Tick (); void Tick ();
side_t *m_Side; side_t *m_Side;
SBYTE m_Part; int8_t m_Part;
bool bFlippable; bool bFlippable;
bool bReturning; bool bReturning;
FSwitchDef *m_SwitchDef; FSwitchDef *m_SwitchDef;
int32_t m_Frame; int32_t m_Frame;
DWORD m_Timer; uint32_t m_Timer;
DVector2 m_Pos; DVector2 m_Pos;
protected: protected:
@ -245,7 +245,7 @@ bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 *
// //
//========================================================================== //==========================================================================
bool P_ChangeSwitchTexture (side_t *side, int useAgain, BYTE special, bool *quest) bool P_ChangeSwitchTexture (side_t *side, int useAgain, uint8_t special, bool *quest)
{ {
int texture; int texture;
int sound; int sound;
@ -338,7 +338,7 @@ DActiveButton::DActiveButton (side_t *side, int Where, FSwitchDef *Switch,
const DVector2 &pos, bool useagain) const DVector2 &pos, bool useagain)
{ {
m_Side = side; m_Side = side;
m_Part = SBYTE(Where); m_Part = int8_t(Where);
m_Pos = pos; m_Pos = pos;
bFlippable = useagain; bFlippable = useagain;
bReturning = false; bReturning = false;

View file

@ -49,7 +49,7 @@
// MACROS ------------------------------------------------------------------ // MACROS ------------------------------------------------------------------
#define SET_FIELD(type,val) *((type*)((BYTE *)fields + \ #define SET_FIELD(type,val) *((type*)((uint8_t *)fields + \
parser[keyword].u.Offset)) = val; parser[keyword].u.Offset)) = val;
// TYPES ------------------------------------------------------------------- // TYPES -------------------------------------------------------------------
@ -134,7 +134,7 @@ static void ParseDefault (FScanner &sc);
FTerrainTypeArray TerrainTypes; FTerrainTypeArray TerrainTypes;
TArray<FSplashDef> Splashes; TArray<FSplashDef> Splashes;
TArray<FTerrainDef> Terrains; TArray<FTerrainDef> Terrains;
WORD DefaultTerrainType; uint16_t DefaultTerrainType;
// PRIVATE DATA DEFINITIONS ------------------------------------------------ // PRIVATE DATA DEFINITIONS ------------------------------------------------
@ -546,7 +546,7 @@ static void GenericParse (FScanner &sc, FGenericParse *parser, const char **keyw
case GEN_Byte: case GEN_Byte:
sc.MustGetNumber (); sc.MustGetNumber ();
SET_FIELD (BYTE, sc.Number); SET_FIELD (uint8_t, sc.Number);
break; break;
case GEN_Class: case GEN_Class:

View file

@ -39,24 +39,24 @@
class PClass; class PClass;
extern WORD DefaultTerrainType; extern uint16_t DefaultTerrainType;
class FTerrainTypeArray class FTerrainTypeArray
{ {
public: public:
TArray<WORD> Types; TArray<uint16_t> Types;
WORD operator [](FTextureID tex) const uint16_t operator [](FTextureID tex) const
{ {
if ((unsigned)tex.GetIndex() >= Types.Size()) return DefaultTerrainType; if ((unsigned)tex.GetIndex() >= Types.Size()) return DefaultTerrainType;
WORD type = Types[tex.GetIndex()]; uint16_t type = Types[tex.GetIndex()];
return type == 0xffff? DefaultTerrainType : type; return type == 0xffff? DefaultTerrainType : type;
} }
WORD operator [](int texnum) const uint16_t operator [](int texnum) const
{ {
if ((unsigned)texnum >= Types.Size()) return DefaultTerrainType; if ((unsigned)texnum >= Types.Size()) return DefaultTerrainType;
WORD type = Types[texnum]; uint16_t type = Types[texnum];
return type == 0xffff? DefaultTerrainType : type; return type == 0xffff? DefaultTerrainType : type;
} }
void Resize(unsigned newsize) void Resize(unsigned newsize)
@ -65,7 +65,7 @@ public:
} }
void Clear() void Clear()
{ {
memset (&Types[0], 0xff, Types.Size()*sizeof(WORD)); memset (&Types[0], 0xff, Types.Size()*sizeof(uint16_t));
} }
void Set(int index, int value) void Set(int index, int value)
{ {
@ -73,7 +73,7 @@ public:
{ {
int oldsize = Types.Size(); int oldsize = Types.Size();
Resize(index + 1); Resize(index + 1);
memset(&Types[oldsize], 0xff, (index + 1 - oldsize)*sizeof(WORD)); memset(&Types[oldsize], 0xff, (index + 1 - oldsize)*sizeof(uint16_t));
} }
Types[index] = value; Types[index] = value;
} }
@ -92,9 +92,9 @@ struct FSplashDef
PClassActor *SmallSplash; PClassActor *SmallSplash;
PClassActor *SplashBase; PClassActor *SplashBase;
PClassActor *SplashChunk; PClassActor *SplashChunk;
BYTE ChunkXVelShift; uint8_t ChunkXVelShift;
BYTE ChunkYVelShift; uint8_t ChunkYVelShift;
BYTE ChunkZVelShift; uint8_t ChunkZVelShift;
bool NoAlert; bool NoAlert;
double ChunkBaseZVel; double ChunkBaseZVel;
double SmallSplashClip; double SmallSplashClip;

View file

@ -54,7 +54,7 @@ struct FTraceInfo
DVector3 Start; DVector3 Start;
DVector3 Vec; DVector3 Vec;
ActorFlags ActorMask; ActorFlags ActorMask;
DWORD WallMask; uint32_t WallMask;
AActor *IgnoreThis; AActor *IgnoreThis;
FTraceResults *Results; FTraceResults *Results;
sector_t *CurSector; sector_t *CurSector;
@ -62,7 +62,7 @@ struct FTraceInfo
double EnterDist; double EnterDist;
ETraceStatus (*TraceCallback)(FTraceResults &res, void *data); ETraceStatus (*TraceCallback)(FTraceResults &res, void *data);
void *TraceCallbackData; void *TraceCallbackData;
DWORD TraceFlags; uint32_t TraceFlags;
int inshootthrough; int inshootthrough;
double startfrac; double startfrac;
double limitz; double limitz;
@ -103,7 +103,7 @@ struct FTraceInfo
}; };
static bool EditTraceResult (DWORD flags, FTraceResults &res); static bool EditTraceResult (uint32_t flags, FTraceResults &res);
@ -150,7 +150,7 @@ static bool isLiquid(F3DFloor *ff)
//========================================================================== //==========================================================================
bool Trace(const DVector3 &start, sector_t *sector, const DVector3 &direction, double maxDist, bool Trace(const DVector3 &start, sector_t *sector, const DVector3 &direction, double maxDist,
ActorFlags actorMask, DWORD wallMask, AActor *ignore, FTraceResults &res, DWORD flags, ActorFlags actorMask, uint32_t wallMask, AActor *ignore, FTraceResults &res, uint32_t flags,
ETraceStatus(*callback)(FTraceResults &res, void *), void *callbackdata) ETraceStatus(*callback)(FTraceResults &res, void *), void *callbackdata)
{ {
FTraceInfo inf; FTraceInfo inf;
@ -923,7 +923,7 @@ bool FTraceInfo::CheckPlane (const secplane_t &plane)
// //
//========================================================================== //==========================================================================
static bool EditTraceResult (DWORD flags, FTraceResults &res) static bool EditTraceResult (uint32_t flags, FTraceResults &res)
{ {
if (flags & TRACE_NoSky) if (flags & TRACE_NoSky)
{ // Throw away sky hits { // Throw away sky hits

View file

@ -77,8 +77,8 @@ struct FTraceResults
AActor *Actor; // valid if hit an actor AActor *Actor; // valid if hit an actor
line_t *Line; // valid if hit a line line_t *Line; // valid if hit a line
BYTE Side; uint8_t Side;
BYTE Tier; uint8_t Tier;
bool unlinked; // passed through a portal without static offset. bool unlinked; // passed through a portal without static offset.
ETraceResult HitType; ETraceResult HitType;
F3DFloor *ffloor; F3DFloor *ffloor;
@ -109,7 +109,7 @@ enum ETraceStatus
}; };
bool Trace(const DVector3 &start, sector_t *sector, const DVector3 &direction, double maxDist, bool Trace(const DVector3 &start, sector_t *sector, const DVector3 &direction, double maxDist,
ActorFlags ActorMask, DWORD WallMask, AActor *ignore, FTraceResults &res, DWORD traceFlags = 0, ActorFlags ActorMask, uint32_t WallMask, AActor *ignore, FTraceResults &res, uint32_t traceFlags = 0,
ETraceStatus(*callback)(FTraceResults &res, void *) = NULL, void *callbackdata = NULL); ETraceStatus(*callback)(FTraceResults &res, void *) = NULL, void *callbackdata = NULL);
#endif //__P_TRACE_H__ #endif //__P_TRACE_H__

View file

@ -104,7 +104,7 @@ struct PredictPos
static int PredictionLerptics; static int PredictionLerptics;
static player_t PredictionPlayerBackup; static player_t PredictionPlayerBackup;
static BYTE PredictionActorBackup[sizeof(APlayerPawn)]; static uint8_t PredictionActorBackup[sizeof(APlayerPawn)];
static TArray<AActor *> PredictionSectorListBackup; static TArray<AActor *> PredictionSectorListBackup;
static TArray<sector_t *> PredictionTouchingSectorsBackup; static TArray<sector_t *> PredictionTouchingSectorsBackup;
@ -579,7 +579,7 @@ void player_t::SetFOV(float fov)
{ {
Net_WriteByte(DEM_MYFOV); Net_WriteByte(DEM_MYFOV);
} }
Net_WriteByte((BYTE)clamp<float>(fov, 5.f, 179.f)); Net_WriteByte((uint8_t)clamp<float>(fov, 5.f, 179.f));
} }
} }
@ -3048,7 +3048,7 @@ void P_PredictPlayer (player_t *player)
PredictionPlayerBackup = *player; PredictionPlayerBackup = *player;
APlayerPawn *act = player->mo; APlayerPawn *act = player->mo;
memcpy(PredictionActorBackup, &act->snext, sizeof(APlayerPawn) - ((BYTE *)&act->snext - (BYTE *)act)); memcpy(PredictionActorBackup, &act->snext, sizeof(APlayerPawn) - ((uint8_t *)&act->snext - (uint8_t *)act));
act->flags &= ~MF_PICKUP; act->flags &= ~MF_PICKUP;
act->flags2 &= ~MF2_PUSHWALL; act->flags2 &= ~MF2_PUSHWALL;
@ -3174,7 +3174,7 @@ void P_UnPredictPlayer ()
act->touching_lineportallist = nullptr; act->touching_lineportallist = nullptr;
act->UnlinkFromWorld(&ctx); act->UnlinkFromWorld(&ctx);
memcpy(&act->snext, PredictionActorBackup, sizeof(APlayerPawn) - ((BYTE *)&act->snext - (BYTE *)act)); memcpy(&act->snext, PredictionActorBackup, sizeof(APlayerPawn) - ((uint8_t *)&act->snext - (uint8_t *)act));
// The blockmap ordering needs to remain unchanged, too. // The blockmap ordering needs to remain unchanged, too.
// Restore sector links and refrences. // Restore sector links and refrences.

View file

@ -65,11 +65,11 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld, int lineindexforid)
{ {
unsigned short special = (unsigned short) LittleShort(mld->special); unsigned short special = (unsigned short) LittleShort(mld->special);
short tag = LittleShort(mld->tag); short tag = LittleShort(mld->tag);
DWORD flags = LittleShort(mld->flags); uint32_t flags = LittleShort(mld->flags);
INTBOOL passthrough = 0; INTBOOL passthrough = 0;
DWORD flags1 = flags; uint32_t flags1 = flags;
DWORD newflags = 0; uint32_t newflags = 0;
for(int i=0;i<16;i++) for(int i=0;i<16;i++)
{ {
@ -223,7 +223,7 @@ void P_TranslateLineDef (line_t *ld, maplinedef_t *mld, int lineindexforid)
FBoomArg *arg = &b->Args[j]; FBoomArg *arg = &b->Args[j];
int *destp; int *destp;
int flagtemp; int flagtemp;
BYTE val = 0; // quiet, GCC uint8_t val = 0; // quiet, GCC
bool found; bool found;
if (arg->ArgNum < 4) if (arg->ArgNum < 4)

View file

@ -1448,7 +1448,7 @@ static void KillSideLists ()
// //
//========================================================================== //==========================================================================
static void AddPolyVert(TArray<DWORD> &vnum, DWORD vert) static void AddPolyVert(TArray<uint32_t> &vnum, uint32_t vert)
{ {
for (unsigned int i = vnum.Size() - 1; i-- != 0; ) for (unsigned int i = vnum.Size() - 1; i-- != 0; )
{ {
@ -1473,22 +1473,22 @@ static void AddPolyVert(TArray<DWORD> &vnum, DWORD vert)
static void IterFindPolySides (FPolyObj *po, side_t *side) static void IterFindPolySides (FPolyObj *po, side_t *side)
{ {
static TArray<DWORD> vnum; static TArray<uint32_t> vnum;
unsigned int vnumat; unsigned int vnumat;
assert(sidetemp != NULL); assert(sidetemp != NULL);
vnum.Clear(); vnum.Clear();
vnum.Push(DWORD(side->V1()->Index())); vnum.Push(uint32_t(side->V1()->Index()));
vnumat = 0; vnumat = 0;
while (vnum.Size() != vnumat) while (vnum.Size() != vnumat)
{ {
DWORD sidenum = sidetemp[vnum[vnumat++]].b.first; uint32_t sidenum = sidetemp[vnum[vnumat++]].b.first;
while (sidenum != NO_SIDE) while (sidenum != NO_SIDE)
{ {
po->Sidedefs.Push(&level.sides[sidenum]); po->Sidedefs.Push(&level.sides[sidenum]);
AddPolyVert(vnum, DWORD(level.sides[sidenum].V2()->Index())); AddPolyVert(vnum, uint32_t(level.sides[sidenum].V2()->Index()));
sidenum = sidetemp[sidenum].b.next; sidenum = sidetemp[sidenum].b.next;
} }
} }
@ -1592,7 +1592,7 @@ static void SpawnPolyobj (int index, int tag, int type)
if (port && (port->mDefFlags & PORTF_PASSABLE)) if (port && (port->mDefFlags & PORTF_PASSABLE))
{ {
int type = port->mType == PORTT_LINKED ? 2 : 1; int type = port->mType == PORTT_LINKED ? 2 : 1;
if (po->bHasPortals < type) po->bHasPortals = (BYTE)type; if (po->bHasPortals < type) po->bHasPortals = (uint8_t)type;
} }
l->validcount = validcount; l->validcount = validcount;
po->Linedefs.Push(l); po->Linedefs.Push(l);
@ -1753,7 +1753,7 @@ void PO_Init (void)
for (int i = 0; i < numsubsectors; i++) for (int i = 0; i < numsubsectors; i++)
{ {
subsector_t *ss = &subsectors[i]; subsector_t *ss = &subsectors[i];
for(DWORD j=0;j<ss->numlines; j++) for(uint32_t j=0;j<ss->numlines; j++)
{ {
if (ss->firstline[j].sidedef != NULL && if (ss->firstline[j].sidedef != NULL &&
ss->firstline[j].sidedef->Flags & WALLF_POLYOBJ) ss->firstline[j].sidedef->Flags & WALLF_POLYOBJ)
@ -2069,7 +2069,7 @@ static void SplitPoly(FPolyNode *pnode, void *node, float bbox[4])
else else
{ {
// we reached a subsector so we can link the node with this subsector // 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);
// Link node to subsector // Link node to subsector
pnode->pnext = sub->polys; pnode->pnext = sub->polys;

View file

@ -83,7 +83,7 @@ struct FPolyObj
int crush; // should the polyobj attempt to crush mobjs? int crush; // should the polyobj attempt to crush mobjs?
bool bHurtOnTouch; // should the polyobj hurt anything it touches? bool bHurtOnTouch; // should the polyobj hurt anything it touches?
bool bBlocked; bool bBlocked;
BYTE bHasPortals; // 1 for any portal, 2 for a linked portal (2 must block rotations.) uint8_t bHasPortals; // 1 for any portal, 2 for a linked portal (2 must block rotations.)
int seqType; int seqType;
double Size; // polyobj size (area of POLY_AREAUNIT == size of FRACUNIT) double Size; // polyobj size (area of POLY_AREAUNIT == size of FRACUNIT)
FPolyNode *subsectorlinks; FPolyNode *subsectorlinks;

View file

@ -81,7 +81,7 @@ DEFINE_FIELD(FSectorPortal, mSkybox);
struct FPortalBits struct FPortalBits
{ {
TArray<DWORD> data; TArray<uint32_t> data;
void setSize(int num) void setSize(int num)
{ {
@ -91,7 +91,7 @@ struct FPortalBits
void clear() void clear()
{ {
memset(&data[0], 0, data.Size()*sizeof(DWORD)); memset(&data[0], 0, data.Size()*sizeof(uint32_t));
} }
void setBit(int group) void setBit(int group)
@ -287,7 +287,7 @@ void P_SpawnLinePortal(line_t* line)
memset(port, 0, sizeof(FLinePortal)); memset(port, 0, sizeof(FLinePortal));
port->mOrigin = line; port->mOrigin = line;
port->mDestination = dst; port->mDestination = dst;
port->mType = BYTE(line->args[2]); // range check is done above. port->mType = uint8_t(line->args[2]); // range check is done above.
if (port->mType == PORTT_LINKED) if (port->mType == PORTT_LINKED)
{ {
@ -296,7 +296,7 @@ void P_SpawnLinePortal(line_t* line)
} }
else else
{ {
port->mAlign = BYTE(line->args[3] >= PORG_ABSOLUTE && line->args[3] <= PORG_CEILING ? line->args[3] : PORG_ABSOLUTE); port->mAlign = uint8_t(line->args[3] >= PORG_ABSOLUTE && line->args[3] <= PORG_CEILING ? line->args[3] : PORG_ABSOLUTE);
if (port->mType == PORTT_INTERACTIVE && port->mAlign != PORG_ABSOLUTE) if (port->mType == PORTT_INTERACTIVE && port->mAlign != PORG_ABSOLUTE)
{ {
// Due to the way z is often handled, these pose a major issue for parts of the code that needs to transparently handle interactive portals. // Due to the way z is often handled, these pose a major issue for parts of the code that needs to transparently handle interactive portals.
@ -923,7 +923,7 @@ static void AddDisplacementForPortal(FLinePortal *portal)
static bool ConnectGroups() static bool ConnectGroups()
{ {
// Now // Now
BYTE indirect = 1; uint8_t indirect = 1;
bool bogus = false; bool bogus = false;
bool changed; bool changed;
do do

View file

@ -29,7 +29,7 @@ struct FDisplacement
{ {
DVector2 pos; DVector2 pos;
bool isSet; bool isSet;
BYTE indirect; // just for illustration. uint8_t indirect; // just for illustration.
}; };
@ -183,10 +183,10 @@ struct FLinePortal
line_t *mOrigin; line_t *mOrigin;
line_t *mDestination; line_t *mDestination;
DVector2 mDisplacement; DVector2 mDisplacement;
BYTE mType; uint8_t mType;
BYTE mFlags; uint8_t mFlags;
BYTE mDefFlags; uint8_t mDefFlags;
BYTE mAlign; uint8_t mAlign;
DAngle mAngleDiff; DAngle mAngleDiff;
double mSinRot; double mSinRot;
double mCosRot; double mCosRot;

View file

@ -46,8 +46,8 @@ struct seg_t;
#define MAXWIDTH 5760 #define MAXWIDTH 5760
#define MAXHEIGHT 3600 #define MAXHEIGHT 3600
const WORD NO_INDEX = 0xffffu; const uint16_t NO_INDEX = 0xffffu;
const DWORD NO_SIDE = 0xffffffffu; const uint32_t NO_SIDE = 0xffffffffu;
// Silhouette, needed for clipping Segs (mainly) // Silhouette, needed for clipping Segs (mainly)
// and sprites representing things. // and sprites representing things.
@ -80,7 +80,7 @@ enum
struct vertexdata_t struct vertexdata_t
{ {
double zCeiling, zFloor; double zCeiling, zFloor;
DWORD flags; uint32_t flags;
}; };
#ifdef USE_FLOAT #ifdef USE_FLOAT
@ -1011,16 +1011,16 @@ public:
int prevsec; // -1 or number of sector for previous step int prevsec; // -1 or number of sector for previous step
int nextsec; // -1 or number of next step sector int nextsec; // -1 or number of next step sector
BYTE soundtraversed; // 0 = untraversed, 1,2 = sndlines -1 uint8_t soundtraversed; // 0 = untraversed, 1,2 = sndlines -1
// jff 2/26/98 lockout machinery for stairbuilding // jff 2/26/98 lockout machinery for stairbuilding
SBYTE stairlock; // -2 on first locked -1 after thinker done 0 normally int8_t stairlock; // -2 on first locked -1 after thinker done 0 normally
TStaticPointedArray<line_t *> Lines; TStaticPointedArray<line_t *> Lines;
// killough 3/7/98: support flat heights drawn at another sector's heights // killough 3/7/98: support flat heights drawn at another sector's heights
sector_t *heightsec; // other sector, or NULL if no other sector sector_t *heightsec; // other sector, or NULL if no other sector
DWORD bottommap, midmap, topmap; // killough 4/4/98: dynamic colormaps uint32_t bottommap, midmap, topmap; // killough 4/4/98: dynamic colormaps
// [RH] these can also be blend values if // [RH] these can also be blend values if
// the alpha mask is non-zero // the alpha mask is non-zero
@ -1036,9 +1036,9 @@ public:
short damageinterval; // Interval for damage application short damageinterval; // Interval for damage application
short leakydamage; // chance of leaking through radiation suit short leakydamage; // chance of leaking through radiation suit
WORD ZoneNumber; // [RH] Zone this sector belongs to uint16_t ZoneNumber; // [RH] Zone this sector belongs to
WORD MoreFlags; // [RH] Internal sector flags uint16_t MoreFlags; // [RH] Internal sector flags
DWORD Flags; // Sector flags uint32_t Flags; // Sector flags
// [RH] Action specials for sectors. Like Skull Tag, but more // [RH] Action specials for sectors. Like Skull Tag, but more
// flexible in a Bloody way. SecActTarget forms a list of actors // flexible in a Bloody way. SecActTarget forms a list of actors
@ -1134,16 +1134,16 @@ struct side_t
DBaseDecal* AttachedDecals; // [RH] Decals bound to the wall DBaseDecal* AttachedDecals; // [RH] Decals bound to the wall
part textures[3]; part textures[3];
line_t *linedef; line_t *linedef;
//DWORD linenum; //uint32_t linenum;
DWORD LeftSide, RightSide; // [RH] Group walls into loops uint32_t LeftSide, RightSide; // [RH] Group walls into loops
WORD TexelLength; uint16_t TexelLength;
SWORD Light; int16_t Light;
BYTE Flags; uint8_t Flags;
int UDMFIndex; // needed to access custom UDMF fields which are stored in loading order. int UDMFIndex; // needed to access custom UDMF fields which are stored in loading order.
int GetLightLevel (bool foggy, int baselight, bool is3dlight=false, int *pfakecontrast_usedbygzdoom=NULL) const; int GetLightLevel (bool foggy, int baselight, bool is3dlight=false, int *pfakecontrast_usedbygzdoom=NULL) const;
void SetLight(SWORD l) void SetLight(int16_t l)
{ {
Light = l; Light = l;
} }
@ -1413,7 +1413,7 @@ enum
struct FPortalCoverage struct FPortalCoverage
{ {
DWORD * subsectors; uint32_t * subsectors;
int sscount; int sscount;
}; };
@ -1424,7 +1424,7 @@ struct subsector_t
FMiniBSP *BSP; FMiniBSP *BSP;
seg_t *firstline; seg_t *firstline;
sector_t *render_sector; sector_t *render_sector;
DWORD numlines; uint32_t numlines;
int flags; int flags;
void BuildPolyBSP(); void BuildPolyBSP();
@ -1482,7 +1482,7 @@ struct FMiniBSP
// OTHER TYPES // OTHER TYPES
// //
typedef BYTE lighttable_t; // This could be wider for >8 bit display. typedef uint8_t lighttable_t; // This could be wider for >8 bit display.
// This encapsulates the fields of vissprite_t that can be altered by AlterWeaponSprite // This encapsulates the fields of vissprite_t that can be altered by AlterWeaponSprite
struct visstyle_t struct visstyle_t