mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-19 07:31:03 +00:00
- replaced a few naked chars with better types.
This commit is contained in:
parent
48b6ce2f4d
commit
ec66f39535
12 changed files with 18 additions and 21 deletions
|
@ -225,7 +225,7 @@ typedef struct
|
|||
uint16_t smoothduration;
|
||||
hudtyp hudmem[2];
|
||||
int8_t skinnum;
|
||||
char pal;
|
||||
uint8_t pal;
|
||||
} tile2model_t;
|
||||
|
||||
# define EXTRATILES (MAXTILES/8)
|
||||
|
|
|
@ -31,7 +31,7 @@ vec2_t hitscangoal = { (1<<29)-1, (1<<29)-1 };
|
|||
int32_t hitallsprites = 0;
|
||||
|
||||
////////// CLIPMOVE //////////
|
||||
inline char bitmap_test(uint8_t const* const ptr, int const n) { return ptr[n >> 3] & (1 << (n & 7)); }
|
||||
inline uint8_t bitmap_test(uint8_t const* const ptr, int const n) { return ptr[n >> 3] & (1 << (n & 7)); }
|
||||
|
||||
|
||||
// x1, y1: in/out
|
||||
|
@ -347,7 +347,7 @@ static inline void keepaway(int32_t *x, int32_t *y, int32_t w)
|
|||
const int32_t x1 = clipit[w].x1, dx = clipit[w].x2-x1;
|
||||
const int32_t y1 = clipit[w].y1, dy = clipit[w].y2-y1;
|
||||
const int32_t ox = Sgn(-dy), oy = Sgn(dx);
|
||||
char first = (abs(dx) <= abs(dy));
|
||||
uint8_t first = (abs(dx) <= abs(dy));
|
||||
|
||||
do
|
||||
{
|
||||
|
|
|
@ -983,7 +983,7 @@ void FMapInfoParser::ParseEpisodeInfo ()
|
|||
{
|
||||
ParseAssign();
|
||||
sc.MustGetString ();
|
||||
key = sc.String[0];
|
||||
if (!(sc.String[0] & 0x80)) key = sc.String[0];
|
||||
}
|
||||
else if (sc.Compare("noskillmenu"))
|
||||
{
|
||||
|
|
|
@ -372,7 +372,7 @@ static int32_t LoadMapHack(const char *filename, SpawnSpriteDef& sprites)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void loadMapHack(const char* filename, const unsigned char* md4, SpawnSpriteDef& sprites)
|
||||
void loadMapHack(const char* filename, const uint8_t* md4, SpawnSpriteDef& sprites)
|
||||
{
|
||||
hw_ClearSplitSector();
|
||||
|
||||
|
|
|
@ -196,7 +196,7 @@ bool SetMusicForMap(const char* mapname, const char* music, bool namehack)
|
|||
if (index == nullptr && namehack)
|
||||
{
|
||||
int lev, ep;
|
||||
signed char b1, b2;
|
||||
int8_t b1, b2;
|
||||
|
||||
int numMatches = sscanf(mapname, "%c%d%c%d", &b1, &ep, &b2, &lev);
|
||||
|
||||
|
|
|
@ -527,7 +527,7 @@ void loadMap(const char* filename, int flags, vec3_t* pos, int16_t* ang, int* cu
|
|||
guniqhudid = 0;
|
||||
fr.Seek(0, FileReader::SeekSet);
|
||||
auto buffer = fr.Read();
|
||||
unsigned char md4[16];
|
||||
uint8_t md4[16];
|
||||
md4once(buffer.Data(), buffer.Size(), md4);
|
||||
loadMapHack(filename, md4, sprites);
|
||||
setWallSectors();
|
||||
|
@ -707,7 +707,7 @@ TArray<walltype> loadMapWalls(const char* filename)
|
|||
}
|
||||
|
||||
|
||||
void qloadboard(const char* filename, char flags, vec3_t* dapos, int16_t* daang);
|
||||
void qloadboard(const char* filename, uint8_t flags, vec3_t* dapos, int16_t* daang);
|
||||
|
||||
|
||||
// loads a map into the backup buffer.
|
||||
|
|
|
@ -666,5 +666,5 @@ void fixSectors();
|
|||
void loadMap(const char *filename, int flags, vec3_t *pos, int16_t *ang, int *cursectnum, SpawnSpriteDef& sprites);
|
||||
TArray<walltype> loadMapWalls(const char* filename);
|
||||
void loadMapBackup(const char* filename);
|
||||
void loadMapHack(const char* filename, const unsigned char*, SpawnSpriteDef& sprites);
|
||||
void loadMapHack(const char* filename, const uint8_t*, SpawnSpriteDef& sprites);
|
||||
void validateStartSector(const char* filename, const vec3_t& pos, int* cursectnum, unsigned numsectors, bool noabort = false);
|
||||
|
|
|
@ -122,7 +122,6 @@ struct HWDrawInfo;
|
|||
class HWWall
|
||||
{
|
||||
public:
|
||||
static const char passflag[];
|
||||
|
||||
enum
|
||||
{
|
||||
|
|
|
@ -661,9 +661,9 @@ class BitReader {
|
|||
public:
|
||||
int nBitPos;
|
||||
int nSize;
|
||||
char* pBuffer;
|
||||
BitReader(char* _pBuffer, int _nSize, int _nBitPos) { pBuffer = _pBuffer; nSize = _nSize; nBitPos = _nBitPos; nSize -= nBitPos >> 3; }
|
||||
BitReader(char* _pBuffer, int _nSize) { pBuffer = _pBuffer; nSize = _nSize; nBitPos = 0; }
|
||||
uint8_t* pBuffer;
|
||||
BitReader(uint8_t* _pBuffer, int _nSize, int _nBitPos) { pBuffer = _pBuffer; nSize = _nSize; nBitPos = _nBitPos; nSize -= nBitPos >> 3; }
|
||||
BitReader(uint8_t* _pBuffer, int _nSize) { pBuffer = _pBuffer; nSize = _nSize; nBitPos = 0; }
|
||||
int readBit()
|
||||
{
|
||||
if (nSize <= 0)
|
||||
|
|
|
@ -284,7 +284,7 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, int*
|
|||
|
||||
if (pSector->extra > 0)
|
||||
{
|
||||
char pBuffer[nXSectorSize];
|
||||
uint8_t pBuffer[nXSectorSize];
|
||||
pSector->allocX();
|
||||
XSECTOR* pXSector = &pSector->xs();
|
||||
int nCount;
|
||||
|
@ -410,7 +410,7 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, int*
|
|||
|
||||
if (pWall->extra > 0)
|
||||
{
|
||||
char pBuffer[nXWallSize];
|
||||
uint8_t pBuffer[nXWallSize];
|
||||
pWall->allocX();
|
||||
XWALL* pXWall = &pWall->xw();
|
||||
int nCount;
|
||||
|
@ -501,7 +501,7 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, int*
|
|||
|
||||
if (pSprite->extra > 0)
|
||||
{
|
||||
char pBuffer[nXSpriteSize];
|
||||
uint8_t pBuffer[nXSpriteSize];
|
||||
XSPRITE* pXSprite = &sprites.xspr[i];
|
||||
*pXSprite = {};
|
||||
int nCount;
|
||||
|
@ -680,7 +680,7 @@ END_BLD_NS
|
|||
//
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void qloadboard(const char* filename, char flags, vec3_t* dapos, int16_t* daang)
|
||||
void qloadboard(const char* filename, uint8_t flags, vec3_t* dapos, int16_t* daang)
|
||||
{
|
||||
Blood::BloodSpawnSpriteDef sprites;
|
||||
int sp;
|
||||
|
|
|
@ -521,7 +521,7 @@ static void ByteSwapSEQ(Seq* pSeq)
|
|||
for (int i = 0; i < pSeq->nFrames; i++)
|
||||
{
|
||||
SEQFRAME* pFrame = &pSeq->frames[i];
|
||||
BitReader bitReader((char*)pFrame, sizeof(SEQFRAME));
|
||||
BitReader bitReader((uint8_t*)pFrame, sizeof(SEQFRAME));
|
||||
SEQFRAME swapFrame;
|
||||
swapFrame.tile = bitReader.readUnsigned(12);
|
||||
swapFrame.transparent = bitReader.readBit();
|
||||
|
|
|
@ -58,11 +58,9 @@ void BlackOut();
|
|||
|
||||
void DoGameOverScene(bool finallevel);
|
||||
|
||||
extern unsigned char curpal[];
|
||||
extern uint8_t curpal[];
|
||||
|
||||
void TintPalette(int a, int b, int c);
|
||||
//void MySetPalette(unsigned char *palette);
|
||||
//void GetCurPal(unsigned char *palette);
|
||||
|
||||
void EraseScreen(int eax);
|
||||
|
||||
|
|
Loading…
Reference in a new issue