ref: 284ae8bef0b4c30b9fa33120b0e850cee28b6bc5
parent: 2de110a4439d1f327d872b137b5bfcbf41c8cf56
author: Fabien Sanglard <[email protected]>
date: Thu Dec 13 13:58:32 EST 2012
Redefined char to uint8_t: Crashing bug and Visual bug are now GONE git statusgit status
--- a/Engine/src/a.h
+++ b/Engine/src/a.h
@@ -16,7 +16,7 @@
int32_t mmxoverlay(void);
int32_t sethlinesizes(int32_t,int32_t,int32_t);
-int32_t setpalookupaddress(char *);
+int32_t setpalookupaddress(uint8_t *);
int32_t setuphlineasm4(int32_t,int32_t);
int32_t hlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
int32_t setuprhlineasm4(int32_t,int32_t,int32_t,int32_t,int32_t,int32_t);
--- a/Engine/src/build.h
+++ b/Engine/src/build.h
@@ -100,7 +100,7 @@
short point2, nextwall, nextsector, cstat;
short picnum, overpicnum;
int8_t shade;
- char pal, xrepeat, yrepeat, xpanning, ypanning;
+ uint8_t pal, xrepeat, yrepeat, xpanning, ypanning;
short lotag, hitag, extra;
} walltype;
@@ -151,7 +151,7 @@
EXTERN int32_t spritesortcnt;
EXTERN spritetype tsprite[MAXSPRITESONSCREEN];
-EXTERN char vidoption;
+EXTERN uint8_t vidoption;
EXTERN int32_t xdim, ydim, ylookup[MAXYDIM+1], numpages;
EXTERN int32_t yxaspect, viewingrange;
@@ -165,8 +165,8 @@
EXTERN short sintable[2048];
EXTERN uint8_t palette[768];
EXTERN short numpalookups;
-EXTERN char *palookup[MAXPALOOKUPS];
-EXTERN char parallaxtype, showinvisibility;
+EXTERN uint8_t *palookup[MAXPALOOKUPS];
+EXTERN uint8_t parallaxtype, showinvisibility;
EXTERN int32_t parallaxyoffs, parallaxyscale;
EXTERN int32_t visibility, parallaxvisibility;
@@ -180,7 +180,7 @@
EXTERN short nextspritesect[MAXSPRITES], nextspritestat[MAXSPRITES];
EXTERN short tilesizx[MAXTILES], tilesizy[MAXTILES];
-EXTERN char walock[MAXTILES];
+EXTERN uint8_t walock[MAXTILES];
EXTERN int32_t numtiles, picanm[MAXTILES], waloff[MAXTILES];
/*
@@ -198,13 +198,13 @@
* then in 3D mode, the walls and sprites that you see will show up the
* next time you flip to 2D mode.
*/
-EXTERN char show2dsector[(MAXSECTORS+7)>>3];
-EXTERN char show2dwall[(MAXWALLS+7)>>3];
-EXTERN char show2dsprite[(MAXSPRITES+7)>>3];
-EXTERN char automapping;
+EXTERN uint8_t show2dsector[(MAXSECTORS+7)>>3];
+EXTERN uint8_t show2dwall[(MAXWALLS+7)>>3];
+EXTERN uint8_t show2dsprite[(MAXSPRITES+7)>>3];
+EXTERN uint8_t automapping;
-EXTERN char gotpic[(MAXTILES+7)>>3];
-EXTERN char gotsector[(MAXSECTORS+7)>>3];
+EXTERN uint8_t gotpic[(MAXTILES+7)>>3];
+EXTERN uint8_t gotsector[(MAXSECTORS+7)>>3];
/*************************************************************************
POSITION VARIABLES:
@@ -327,7 +327,7 @@
//END VISUALIZE RENDERER
//Global.c
-void Error (int errorType, char *error, ...);
+void Error (int errorType, uint8_t *error, ...);
int FindDistance2D(int ix, int iy);
#endif /* defined _INCLUDE_BUILD_H_ */
--- a/Engine/src/cache1d.c
+++ b/Engine/src/cache1d.c
@@ -39,7 +39,7 @@
* cachestart = (int32_t )(pointer to start of BIG buffer)
* cachesize = length of BIG buffer
*
- * Step 2: Call allocache(int32_t *bufptr, int32_t bufsiz, char *lockptr)
+ * Step 2: Call allocache(int32_t *bufptr, int32_t bufsiz, uint8_t *lockptr)
* whenever you need to allocate a buffer, where:
*
* *bufptr = pointer to 4-byte pointer to buffer
@@ -47,7 +47,7 @@
* previously allocated things from the cache safely by
* setting the 4-byte pointer to 0.
* bufsiz = number of bytes to allocate
- * *lockptr = pointer to locking char which tells whether
+ * *lockptr = pointer to locking uint8_t which tells whether
* the region can be removed or not. If *lockptr = 0 then
* the region is not locked else its locked.
*
@@ -70,7 +70,7 @@
int32_t lockrecip[200];
// TC game directory
-char game_dir[512] = { '\0' };
+uint8_t game_dir[512] = { '\0' };
void initcache(int32_t dacachestart, int32_t dacachesize)
{
@@ -192,7 +192,7 @@
void agecache(void)
{
int32_t cnt;
- char ch;
+ uint8_t ch;
if (agecount >= cacnum) agecount = cacnum-1;
assert(agecount >= 0);
@@ -207,7 +207,7 @@
}
}
-void reportandexit(char *errormessage)
+void reportandexit(uint8_t *errormessage)
{
int32_t i, j;
@@ -253,9 +253,9 @@
int32_t gnumfiles[MAXGROUPFILES]; // number of files on grp
int32_t groupfil[MAXGROUPFILES] = {-1,-1,-1,-1}; // grp file handles
int32_t groupfilpos[MAXGROUPFILES];
-char *gfilelist[MAXGROUPFILES]; // name list + size list of all the files in grp
+uint8_t *gfilelist[MAXGROUPFILES]; // name list + size list of all the files in grp
int32_t *gfileoffs[MAXGROUPFILES]; // offset of the files
-char *groupfil_memory[MAXGROUPFILES]; // addresses of raw GRP files in memory
+uint8_t *groupfil_memory[MAXGROUPFILES]; // addresses of raw GRP files in memory
int32_t groupefil_crc32[MAXGROUPFILES];
uint8_t filegrp[MAXOPENFILES];
@@ -283,7 +283,7 @@
#endif
-int32_t initgroupfile(const char *filename)
+int32_t initgroupfile(const uint8_t *filename)
{
#if (defined USE_PHYSICSFS)
static int initted_physfs = 0;
@@ -308,7 +308,7 @@
return(1); /* uhh...? */
#else
- char buf[16];
+ uint8_t buf[16];
int32_t i, j, k;
printf("Loading %s ...\n", filename);
@@ -343,7 +343,7 @@
gnumfiles[numgroupfiles] = BUILDSWAP_INTEL32(*((int32_t *)&buf[12]));
- if ((gfilelist[numgroupfiles] = (char *)kmalloc(gnumfiles[numgroupfiles]<<4)) == 0)
+ if ((gfilelist[numgroupfiles] = (uint8_t *)kmalloc(gnumfiles[numgroupfiles]<<4)) == 0)
{ Error(EXIT_FAILURE, "Not enough memory for file grouping system\n"); }
if ((gfileoffs[numgroupfiles] = (int32_t *)kmalloc((gnumfiles[numgroupfiles]+1)<<2)) == 0)
{ Error(EXIT_FAILURE, "Not enough memory for file grouping system\n"); }
@@ -407,11 +407,11 @@
}
#if (defined USE_PHYSICSFS)
-static int locateOneElement(char *buf)
+static int locateOneElement(uint8_t *buf)
{
- char *ptr;
- char **rc;
- char **i;
+ uint8_t *ptr;
+ uint8_t **rc;
+ uint8_t **i;
if (PHYSFS_exists(buf))
return(1); /* quick rejection: exists in current case. */
@@ -446,11 +446,11 @@
} /* locateOneElement */
-int PHYSFSEXT_locateCorrectCase(char *buf)
+int PHYSFSEXT_locateCorrectCase(uint8_t *buf)
{
int rc;
- char *ptr;
- char *prevptr;
+ uint8_t *ptr;
+ uint8_t *prevptr;
while (*buf == '/') /* skip any '/' at start of string... */
buf++;
@@ -528,7 +528,7 @@
#define POLY 0x8408 /* 1021H bit reversed */
-unsigned short crc16(char *data_p, unsigned short length)
+unsigned short crc16(uint8_t *data_p, unsigned short length)
{
uint8_t i;
unsigned int data;
@@ -555,12 +555,12 @@
return (crc);
}
-int32_t kopen4load(const char *filename, int readfromGRP)
+int32_t kopen4load(const uint8_t *filename, int readfromGRP)
{ // FIX_00072: all files are now 1st searched in Duke's root folder and then in the GRP.
#if (defined USE_PHYSICSFS)
int i;
PHYSFS_file *rc;
- char _filename[64];
+ uint8_t _filename[64];
assert(strlen(filename) < sizeof (_filename));
strcpy(_filename, filename);
@@ -584,7 +584,7 @@
#else
int32_t i, j, k, fil, newhandle;
uint8_t bad;
- char *gfileptr;
+ uint8_t *gfileptr;
newhandle = MAXOPENFILES-1;
while (filehan[newhandle] != -1)
@@ -612,7 +612,7 @@
{
for(i=gnumfiles[k]-1;i>=0;i--)
{
- gfileptr = (char *)&gfilelist[k][i<<4];
+ gfileptr = (uint8_t *)&gfilelist[k][i<<4];
bad = 0;
for(j=0;j<13;j++)
@@ -687,7 +687,7 @@
return(1);
}
-int kread8(int32_t handle, char *buffer)
+int kread8(int32_t handle, uint8_t *buffer)
{
if (kread(handle, buffer, 1) != 1)
return(0);
@@ -775,7 +775,7 @@
/* Internal LZW variables */
#define LZWSIZE 16384 /* Watch out for shorts! */
-static char *lzwbuf1, *lzwbuf4, *lzwbuf5;
+static uint8_t *lzwbuf1, *lzwbuf4, *lzwbuf5;
static uint8_t lzwbuflock[5];
static short *lzwbuf2, *lzwbuf3;
@@ -784,7 +784,7 @@
size_t i, j;
int32_t k, kgoal;
short leng;
- char *ptr;
+ uint8_t *ptr;
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 200;
if (lzwbuf1 == NULL) allocache((int32_t *)&lzwbuf1,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[0]);
@@ -794,7 +794,7 @@
if (lzwbuf5 == NULL) allocache((int32_t *)&lzwbuf5,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[4]);
if (dasizeof > LZWSIZE) { count *= dasizeof; dasizeof = 1; }
- ptr = (char *)buffer;
+ ptr = (uint8_t *)buffer;
kread(fil,&leng,2); kread(fil,lzwbuf5,(int32_t )leng);
k = 0;
@@ -822,7 +822,7 @@
size_t i, j;
int32_t k, kgoal;
short leng;
- char *ptr;
+ uint8_t *ptr;
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 200;
if (lzwbuf1 == NULL) allocache((int32_t *)&lzwbuf1,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[0]);
@@ -832,7 +832,7 @@
if (lzwbuf5 == NULL) allocache((int32_t *)&lzwbuf5,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[4]);
if (dasizeof > LZWSIZE) { count *= dasizeof; dasizeof = 1; }
- ptr = (char *)buffer;
+ ptr = (uint8_t *)buffer;
fread(&leng,2,1,fil); fread(lzwbuf5,(int32_t )leng,1,fil);
k = 0; kgoal = uncompress(lzwbuf5,(int32_t )leng,lzwbuf4);
@@ -858,7 +858,7 @@
{
size_t i, j, k;
short leng;
- char *ptr;
+ uint8_t *ptr;
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 200;
if (lzwbuf1 == NULL) allocache((int32_t *)&lzwbuf1,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[0]);
@@ -868,7 +868,7 @@
if (lzwbuf5 == NULL) allocache((int32_t *)&lzwbuf5,LZWSIZE+(LZWSIZE>>4),&lzwbuflock[4]);
if (dasizeof > LZWSIZE) { count *= dasizeof; dasizeof = 1; }
- ptr = (char *)buffer;
+ ptr = (uint8_t *)buffer;
copybufbyte(ptr,lzwbuf4,(int32_t )dasizeof);
k = dasizeof;
@@ -898,13 +898,13 @@
lzwbuflock[0] = lzwbuflock[1] = lzwbuflock[2] = lzwbuflock[3] = lzwbuflock[4] = 1;
}
-int32_t compress(char *lzwinbuf, int32_t uncompleng, char *lzwoutbuf)
+int32_t compress(uint8_t *lzwinbuf, int32_t uncompleng, uint8_t *lzwoutbuf)
{
int32_t i, addr, newaddr, addrcnt, zx, *longptr;
int32_t bytecnt1, bitcnt, numbits, oneupnumbits;
short *shortptr;
- for(i=255;i>=0;i--) { lzwbuf1[i] = (char) i; lzwbuf3[i] = (short) ((i+1)&255); }
+ for(i=255;i>=0;i--) { lzwbuf1[i] = (uint8_t ) i; lzwbuf3[i] = (short) ((i+1)&255); }
clearbuf((void *) FP_OFF(lzwbuf2),256>>1,0xffffffff);
clearbuf((void *) FP_OFF(lzwoutbuf),((uncompleng+15)+3)>>2,0L);
@@ -960,7 +960,7 @@
return(uncompleng+4);
}
-int32_t uncompress(char *lzwinbuf, int32_t compleng, char *lzwoutbuf)
+int32_t uncompress(uint8_t *lzwinbuf, int32_t compleng, uint8_t *lzwoutbuf)
{
int32_t strtot, currstr, numbits, oneupnumbits;
int32_t i, dat, leng, bitcnt, outbytecnt, *longptr;
@@ -987,9 +987,9 @@
lzwbuf3[currstr] = (short) dat;
for(leng=0;dat>=256;leng++,dat=lzwbuf3[dat])
- lzwbuf1[leng] = (char) lzwbuf2[dat];
+ lzwbuf1[leng] = (uint8_t ) lzwbuf2[dat];
- lzwoutbuf[outbytecnt++] = (char) dat;
+ lzwoutbuf[outbytecnt++] = (uint8_t ) dat;
for(i=leng-1;i>=0;i--) lzwoutbuf[outbytecnt++] = lzwbuf1[i];
lzwbuf2[currstr-1] = (short) dat; lzwbuf2[currstr] = (short) dat;
@@ -1000,9 +1000,9 @@
}
-int32_t TCkopen4load(const char *filename, int readfromGRP)
+int32_t TCkopen4load(const uint8_t *filename, int readfromGRP)
{
- char fullfilename[512];
+ uint8_t fullfilename[512];
int32_t result = 0;
if(game_dir[0] != '\0' && !readfromGRP)
--- a/Engine/src/cache1d.h
+++ b/Engine/src/cache1d.h
@@ -24,14 +24,14 @@
void allocache (int32_t *newhandle, int32_t newbytes, uint8_t *newlockptr);
void suckcache (int32_t *suckptr);
void agecache(void);
-void reportandexit(char *errormessage);
-int32_t initgroupfile(const char *filename);
+void reportandexit(uint8_t *errormessage);
+int32_t initgroupfile(const uint8_t *filename);
void uninitgroupfile(void);
-unsigned short crc16(char *data_p, unsigned short length);
+unsigned short crc16(uint8_t *data_p, unsigned short length);
unsigned int crc32_update(uint8_t *buf, unsigned int length, unsigned int crc_to_update);
-int32_t kopen4load(const char *filename, int readfromGRP);
+int32_t kopen4load(const uint8_t *filename, int readfromGRP);
int32_t kread(int32_t handle, void *buffer, int32_t leng);
-int kread8(int32_t handle, char *buffer);
+int kread8(int32_t handle, uint8_t *buffer);
int kread16(int32_t handle, short *buffer);
int kread32(int32_t handle, int32_t *buffer);
int32_t klseek(int32_t handle, int32_t offset, int32_t whence);
@@ -40,11 +40,11 @@
void kdfread(void *buffer, size_t dasizeof, size_t count, int32_t fil);
void dfread(void *buffer, size_t dasizeof, size_t count, FILE *fil);
void dfwrite(void *buffer, size_t dasizeof, size_t count, FILE *fil);
-int32_t compress(char *lzwinbuf, int32_t uncompleng, char *lzwoutbuf);
-int32_t uncompress(char *lzwinbuf, int32_t compleng, char *lzwoutbuf);
+int32_t compress(uint8_t *lzwinbuf, int32_t uncompleng, uint8_t *lzwoutbuf);
+int32_t uncompress(uint8_t *lzwinbuf, int32_t compleng, uint8_t *lzwoutbuf);
-extern char game_dir[512];
-extern int32_t TCkopen4load(const char *filename, int readfromGRP);
+extern uint8_t game_dir[512];
+extern int32_t TCkopen4load(const uint8_t *filename, int readfromGRP);
#endif /* !defined _INCLUDE_CACHE1D_H_ */
--- a/Engine/src/display.h
+++ b/Engine/src/display.h
@@ -68,21 +68,21 @@
/* set these in your _platform_init() implementation. */
extern int _argc;
-extern char **_argv;
+extern uint8_t **_argv;
/* !!! gads, look at all the namespace polution... */
extern int32_t xres, yres, bytesperline, imageSize, maxpages;
-extern char *screen, vesachecked;
+extern uint8_t *screen, vesachecked;
extern int32_t buffermode, origbuffermode, linearmode;
-extern char permanentupdate, vgacompatible;
-extern char moustat;
+extern uint8_t permanentupdate, vgacompatible;
+extern uint8_t moustat;
extern int32_t *horizlookup, *horizlookup2, horizycent;
extern int32_t oxdimen, oviewingrange, oxyaspect;
extern int32_t curbrightness;
extern int32_t qsetmode;
extern int32_t frameplace, frameoffset, pageoffset, ydim16;
-extern char textfont[1024], smalltextfont[1024];
-extern char pow2char[8];
+extern uint8_t textfont[1024], smalltextfont[1024];
+extern uint8_t pow2char[8];
extern volatile int32_t stereomode, visualpage, activepage, whiteband, blackband;
extern int32_t searchx, searchy;
extern int32_t wx1, wy1, wx2, wy2, ydimen;
@@ -101,7 +101,7 @@
/* these need to be implemented by YOUR driver. */
-void _platform_init(int argc, char **argv, const char *title, const char *icon);
+void _platform_init(int argc, uint8_t **argv, const uint8_t *title, const uint8_t *icon);
void _idle(void);
void _handle_events(void);
void *_getVideoBase(void);
@@ -125,8 +125,8 @@
* and global variables that need to get set up correctly.
*/
void getvalidvesamodes(void);
-int VBE_getPalette(int32_t start, int32_t num, char *dapal);
-int VBE_setPalette(int32_t start, int32_t num, char *palettebuffer);
+int VBE_getPalette(int32_t start, int32_t num, uint8_t *dapal);
+int VBE_setPalette(int32_t start, int32_t num, uint8_t *palettebuffer);
int setvesa(int32_t x, int32_t y);
void uninitvesa(void);
void setvmode(int mode);
@@ -156,11 +156,11 @@
void __interrupt __far timerhandler(void);
/* resolution inits. sdl_driver.c ... */
-int32_t _setgamemode(char davidoption, int32_t daxdim, int32_t daydim);
+int32_t _setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim);
uint32_t getticks();
-void drawline16(int32_t XStart, int32_t YStart, int32_t XEnd, int32_t YEnd, char Color);
+void drawline16(int32_t XStart, int32_t YStart, int32_t XEnd, int32_t YEnd, uint8_t Color);
void setcolor16(int i1);
int using_opengl(void);
--- a/Engine/src/dummy_multi.c
+++ b/Engine/src/dummy_multi.c
@@ -13,4 +13,4 @@
short connecthead, connectpoint2[MAXPLAYERS];
-char syncstate=0;
\ No newline at end of file
+uint8_t syncstate=0;
\ No newline at end of file
--- a/Engine/src/enet/api.txt
+++ b/Engine/src/enet/api.txt
@@ -142,13 +142,13 @@
Clean-up ENet after use. Should be called when a program that has initialized
and used ENet exits.
-int enet_address_set_host (ENetAddress * address, const char * hostName);
+int enet_address_set_host (ENetAddress * address, const uint8_t * hostName);
Attempts to resolve the host named by the parameter hostName and sets the host
field in the address parameter if successful. Returns 0 on success and -1 on
failure.
-int enet_address_get_host (const ENetAddress * address, char * hostName, size_t nameLength);
+int enet_address_get_host (const ENetAddress * address, uint8_t * hostName, size_t nameLength);
Attempts to do a reverse lookup of the host field in the address parameter.
If successful, the name of the host is placed in the string described by
--- a/Engine/src/enet/include/enet.h
+++ b/Engine/src/enet/include/enet.h
@@ -384,7 +384,7 @@
@retval < 0 on failure
@returns the address of the given hostName in address on success
*/
-extern int enet_address_set_host (ENetAddress *address, const char *hostName );
+extern int enet_address_set_host (ENetAddress *address, const uint8_t *hostName );
/** Attempts to do a reserve lookup of the host field in the address parameter.
@param address address used for reverse lookup
@@ -394,7 +394,7 @@
@retval 0 on success
@retval < 0 on failure
*/
-extern int enet_address_get_host (const ENetAddress *address, char *hostName, size_t nameLength );
+extern int enet_address_get_host (const ENetAddress *address, uint8_t *hostName, size_t nameLength );
/** @} */
--- a/Engine/src/enet/tutorial.txt
+++ b/Engine/src/enet/tutorial.txt
@@ -7,7 +7,7 @@
i.e.
int
-main (int argc, char ** argv)
+main (int argc, uint8_t ** argv)
{
if (enet_initialize () != 0)
{
--- a/Engine/src/enet/unix.c
+++ b/Engine/src/enet/unix.c
@@ -67,12 +67,12 @@
}
int
-enet_address_set_host (ENetAddress * address, const char * name)
+enet_address_set_host (ENetAddress * address, const uint8_t * name)
{
struct hostent * hostEntry = NULL;
#ifdef HAS_GETHOSTBYNAME_R
struct hostent hostData;
- char buffer [2048];
+ uint8_t buffer [2048];
int errnum;
#ifdef linux
@@ -94,26 +94,26 @@
}
int
-enet_address_get_host (const ENetAddress * address, char * name, size_t nameLength)
+enet_address_get_host (const ENetAddress * address, uint8_t * name, size_t nameLength)
{
struct in_addr in;
struct hostent * hostEntry = NULL;
#ifdef HAS_GETHOSTBYADDR_R
struct hostent hostData;
- char buffer [2048];
+ uint8_t buffer [2048];
int errnum;
in.s_addr = address -> host;
#ifdef linux
- gethostbyaddr_r ((char *) & in, sizeof (struct in_addr), AF_INET, & hostData, buffer, sizeof (buffer), & hostEntry, & errnum);
+ gethostbyaddr_r ((uint8_t *) & in, sizeof (struct in_addr), AF_INET, & hostData, buffer, sizeof (buffer), & hostEntry, & errnum);
#else
- hostEntry = gethostbyaddr_r ((char *) & in, sizeof (struct in_addr), AF_INET, & hostData, buffer, sizeof (buffer), & errnum);
+ hostEntry = gethostbyaddr_r ((uint8_t *) & in, sizeof (struct in_addr), AF_INET, & hostData, buffer, sizeof (buffer), & errnum);
#endif
#else
in.s_addr = address -> host;
- hostEntry = gethostbyaddr ((char *) & in, sizeof (struct in_addr), AF_INET);
+ hostEntry = gethostbyaddr ((uint8_t *) & in, sizeof (struct in_addr), AF_INET);
#endif
if (hostEntry == NULL)
@@ -145,7 +145,7 @@
ioctl (newSocket, FIONBIO, & nonBlocking);
#endif
- setsockopt (newSocket, SOL_SOCKET, SO_RCVBUF, (char *) & receiveBufferSize, sizeof (int));
+ setsockopt (newSocket, SOL_SOCKET, SO_RCVBUF, (uint8_t *) & receiveBufferSize, sizeof (int));
}
if (address == NULL)
--- a/Engine/src/enet/win32.c
+++ b/Engine/src/enet/win32.c
@@ -67,7 +67,7 @@
}
int
-enet_address_set_host (ENetAddress * address, const char * name)
+enet_address_set_host (ENetAddress * address, const uint8_t * name)
{
struct hostent * hostEntry;
@@ -82,7 +82,7 @@
}
int
-enet_address_get_host (const ENetAddress * address, char * name, size_t nameLength)
+enet_address_get_host (const ENetAddress * address, uint8_t * name, size_t nameLength)
{
struct in_addr in;
struct hostent * hostEntry;
@@ -89,7 +89,7 @@
in.s_addr = address -> host;
- hostEntry = gethostbyaddr ((char *) & in, sizeof (struct in_addr), AF_INET);
+ hostEntry = gethostbyaddr ((uint8_t *) & in, sizeof (struct in_addr), AF_INET);
if (hostEntry == NULL)
return -1;
@@ -113,7 +113,7 @@
{
ioctlsocket (newSocket, FIONBIO, & nonBlocking);
- setsockopt (newSocket, SOL_SOCKET, SO_RCVBUF, (char *) & receiveBufferSize, sizeof (int));
+ setsockopt (newSocket, SOL_SOCKET, SO_RCVBUF, (uint8_t *) & receiveBufferSize, sizeof (int));
}
memset (& sin, 0, sizeof (struct sockaddr_in));
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -42,7 +42,7 @@
int32_t stereowidth = 23040, stereopixelwidth = 28, ostereopixelwidth = -1;
volatile int32_t stereomode = 0, visualpage, activepage, whiteband, blackband;
-volatile char oa1, o3c2, ortca, ortcb, overtbits, laststereoint;
+volatile uint8_t oa1, o3c2, ortca, ortcb, overtbits, laststereoint;
#include "display.h"
@@ -103,7 +103,7 @@
#endif
/* used to be static. --ryan. */
-char moustat = 0;
+uint8_t moustat = 0;
int32_t transarea = 0, totalarea = 0, beforedrawrooms = 1;
@@ -114,7 +114,7 @@
int32_t curbrightness = 0;
/* Textured Map variables */
-static char globalpolytype;
+static uint8_t globalpolytype;
static short *dotp1[MAXYDIM], *dotp2[MAXYDIM];
static uint8_t tempbuf[MAXWALLS];
@@ -128,8 +128,8 @@
*/
uint8_t permanentlock = 255;
int32_t artversion, mapversion;
-char *pic = NULL;
-char picsiz[MAXTILES], tilefilenum[MAXTILES];
+uint8_t *pic = NULL;
+uint8_t picsiz[MAXTILES], tilefilenum[MAXTILES];
int32_t lastageclock;
int32_t tilefileoffs[MAXTILES];
@@ -137,7 +137,7 @@
static short radarang[1280], radarang2[MAXXDIM+1];
static unsigned short sqrtable[4096], shlookup[4096+256];
-char pow2char[8] = {1,2,4,8,16,32,64,-128};
+uint8_t pow2char[8] = {1,2,4,8,16,32,64,-128};
int32_t pow2long[32] =
{
1L,2L,4L,8L,
@@ -151,7 +151,7 @@
};
int32_t reciptable[2048], fpuasm;
-char kensmessage[128];
+uint8_t kensmessage[128];
@@ -172,8 +172,8 @@
#define SYM_dmval "dmval"
#endif
-char britable[16][64];
-char textfont[1024], smalltextfont[1024];
+uint8_t britable[16][64];
+uint8_t textfont[1024], smalltextfont[1024];
static int32_t xb1[MAXWALLSB], yb1[MAXWALLSB], xb2[MAXWALLSB], yb2[MAXWALLSB];
static int32_t rx1[MAXWALLSB], ry1[MAXWALLSB], rx2[MAXWALLSB], ry2[MAXWALLSB];
@@ -183,7 +183,7 @@
static short smost[MAXYSAVES], smostcnt;
static short smoststart[MAXWALLSB];
-static char smostwalltype[MAXWALLSB];
+static uint8_t smostwalltype[MAXWALLSB];
static int32_t smostwall[MAXWALLSB], smostwallcnt = -1L;
static short maskwall[MAXWALLSB], maskwallcnt;
@@ -212,16 +212,16 @@
short globalang, globalcursectnum;
int32_t globalpal, cosglobalang, singlobalang;
int32_t cosviewingrangeglobalang, sinviewingrangeglobalang;
-char *globalpalwritten;
+uint8_t *globalpalwritten;
int32_t globaluclip, globaldclip, globvis = 0;
int32_t globalvisibility, globalhisibility, globalpisibility, globalcisibility;
-char globparaceilclip, globparaflorclip;
+uint8_t globparaceilclip, globparaflorclip;
int32_t xyaspect, viewingrangerecip;
int32_t asm1, asm2, asm3, asm4;
int32_t vplce[4], vince[4], palookupoffse[4], bufplce[4];
-char globalxshift, globalyshift;
+uint8_t globalxshift, globalyshift;
int32_t globalxpanning, globalypanning, globalshade;
short globalpicnum, globalshiftval;
int32_t globalzd, globalbufplc, globalyscale, globalorientation;
@@ -232,20 +232,20 @@
// sectorBorder is the stack and sectorbordercnt is the stack counter.
static short sectorborder[256], sectorbordercnt;
-static char tablesloaded = 0;
+static uint8_t tablesloaded = 0;
int32_t pageoffset, ydim16, qsetmode = 0;
int32_t startposx, startposy, startposz;
short startang, startsectnum;
short pointhighlight, linehighlight, highlightcnt;
static int32_t lastx[MAXYDIM];
-char *transluc = NULL, paletteloaded = 0;
+uint8_t *transluc = NULL, paletteloaded = 0;
#define FASTPALGRIDSIZ 8
static int32_t rdist[129], gdist[129], bdist[129];
-static char colhere[((FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2))>>3];
-static char colhead[(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)];
+static uint8_t colhere[((FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2))>>3];
+static uint8_t colhead[(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)*(FASTPALGRIDSIZ+2)];
static int32_t colnext[256];
-static char coldist[8] = {0,1,2,3,4,3,2,1};
+static uint8_t coldist[8] = {0,1,2,3,4,3,2,1};
static int32_t colscan[27];
static short clipnum, hitwalls[4];
@@ -274,10 +274,10 @@
int32_t searchx = -1, searchy; /* search input */
short searchsector, searchwall, searchstat; /* search output */
-static char artfilename[20];
+static uint8_t artfilename[20];
static int32_t numtilefiles, artfil = -1, artfilnum, artfilplc;
-static char inpreparemirror = 0;
+static uint8_t inpreparemirror = 0;
static int32_t mirrorsx1, mirrorsy1, mirrorsx2, mirrorsy2;
int32_t totalclocklock;
@@ -1020,7 +1020,7 @@
{
int32_t i, x, xnice, ynice, fpalookup;
int32_t y1ve[4], y2ve[4], u4, d4, z, tsizx, tsizy;
- char bad;
+ uint8_t bad;
tsizx = tilesizx[globalpicnum];
tsizy = tilesizy[globalpicnum];
@@ -1162,7 +1162,7 @@
{
int32_t i, x, startx, xnice, ynice, fpalookup;
int32_t y1ve[4], y2ve[4], u4, d4, dax, z, p, tsizx, tsizy;
- char bad;
+ uint8_t bad;
tsizx = tilesizx[globalpicnum];
tsizy = tilesizy[globalpicnum];
@@ -1286,7 +1286,7 @@
/* renders parallaxed skies/floors --ryan. */
static void parascan(int32_t dax1, int32_t dax2, int32_t sectnum,
- char dastat, int32_t bunch)
+ uint8_t dastat, int32_t bunch)
{
sectortype *sec;
int32_t j, k, l, m, n, x, z, wallnum, nextsectnum, globalhorizbak;
@@ -1426,7 +1426,7 @@
#define BITSOFPRECISION 3 /* Don't forget to change this in A.ASM also! */
-static void grouscan (int32_t dax1, int32_t dax2, int32_t sectnum, char dastat)
+static void grouscan (int32_t dax1, int32_t dax2, int32_t sectnum, uint8_t dastat)
{
int32_t i, j, l, x, y, dx, dy, wx, wy, y1, y2, daz;
int32_t daslope, dasqr;
@@ -1659,7 +1659,7 @@
}
-static int wallmost(short *mostbuf, int32_t w, int32_t sectnum, char dastat)
+static int wallmost(short *mostbuf, int32_t w, int32_t sectnum, uint8_t dastat)
{
int32_t bad, i, j, t, y, z, inty, intz, xcross, yinc, fw;
int32_t x1, y1, z1, x2, y2, z2, xv, yv, dx, dy, dasqr, oz1, oz2;
@@ -1818,7 +1818,7 @@
int32_t i, x, x1, x2, cz[5], fz[5];
int32_t z, wallnum, sectnum, nextsectnum;
int32_t startsmostwallcnt, startsmostcnt, gotswall;
- char andwstat1, andwstat2;
+ uint8_t andwstat1, andwstat2;
z = bunchfirst[bunch];
sectnum = thesector[z]; sec = §or[sectnum];
@@ -1826,8 +1826,8 @@
andwstat1 = 0xff; andwstat2 = 0xff;
for(;z>=0;z=p2[z]) /* uplc/dplc calculation */
{
- andwstat1 &= wallmost(uplc,z,sectnum,(char)0);
- andwstat2 &= wallmost(dplc,z,sectnum,(char)1);
+ andwstat1 &= wallmost(uplc,z,sectnum,(uint8_t )0);
+ andwstat2 &= wallmost(dplc,z,sectnum,(uint8_t )1);
}
if ((andwstat1&3) != 3) /* draw ceilings */
@@ -1913,7 +1913,7 @@
}
else
{
- wallmost(dwall,z,nextsectnum,(char)0);
+ wallmost(dwall,z,nextsectnum,(uint8_t )0);
if ((cz[2] > fz[0]) || (cz[3] > fz[1]))
for(i=x1;i<=x2;i++) if (dwall[i] > dplc[i]) dwall[i] = dplc[i];
@@ -2001,7 +2001,7 @@
}
else
{
- wallmost(uwall,z,nextsectnum,(char)1);
+ wallmost(uwall,z,nextsectnum,(uint8_t )1);
if ((fz[2] < cz[0]) || (fz[3] < cz[1]))
for(i=x1;i<=x2;i++) if (uwall[i] < uplc[i]) uwall[i] = uplc[i];
@@ -2567,7 +2567,7 @@
faketimerhandler();
}
-int loadboard(char *filename, int32_t *daposx, int32_t *daposy,
+int loadboard(uint8_t *filename, int32_t *daposx, int32_t *daposy,
int32_t *daposz, short *daang, short *dacursectnum)
{
int x;
@@ -2581,7 +2581,7 @@
// FIX_00058: Save/load game crash in both single and multiplayer
// We have to reset those arrays since the same
// arrays are used as temporary space in the
- // compilecons() function like "label = (char *)&sprite[0];"
+ // compilecons() function like "label = (uint8_t *)&sprite[0];"
// to save memory space I guess.
// Not reseting the array will leave dumps fooling
// the function saveplayer(), eg at if(actorscrptr[PN] == 0)
@@ -2619,18 +2619,18 @@
kread16(fil,§->floorstat);
kread16(fil,§->ceilingpicnum);
kread16(fil,§->ceilingheinum);
- kread8(fil,(char*)§->ceilingshade);
- kread8(fil,(char*)§->ceilingpal);
- kread8(fil,(char*)§->ceilingxpanning);
- kread8(fil,(char*)§->ceilingypanning);
+ kread8(fil,(uint8_t *)§->ceilingshade);
+ kread8(fil,(uint8_t *)§->ceilingpal);
+ kread8(fil,(uint8_t *)§->ceilingxpanning);
+ kread8(fil,(uint8_t *)§->ceilingypanning);
kread16(fil,§->floorpicnum);
kread16(fil,§->floorheinum);
- kread8(fil,(char*)§->floorshade);
- kread8(fil,(char*)§->floorpal);
- kread8(fil,(char*)§->floorxpanning);
- kread8(fil,(char*)§->floorypanning);
- kread8(fil,(char*)§->visibility);
- kread8(fil,(char*)§->filler);
+ kread8(fil,(uint8_t *)§->floorshade);
+ kread8(fil,(uint8_t *)§->floorpal);
+ kread8(fil,(uint8_t *)§->floorxpanning);
+ kread8(fil,(uint8_t *)§->floorypanning);
+ kread8(fil,(uint8_t *)§->visibility);
+ kread8(fil,(uint8_t *)§->filler);
kread16(fil,§->lotag);
kread16(fil,§->hitag);
kread16(fil,§->extra);
@@ -2647,7 +2647,7 @@
kread16(fil,&w->cstat);
kread16(fil,&w->picnum);
kread16(fil,&w->overpicnum);
- kread8(fil,(char*)&w->shade);
+ kread8(fil,(uint8_t *)&w->shade);
kread8(fil,&w->pal);
kread8(fil,&w->xrepeat);
kread8(fil,&w->yrepeat);
@@ -2666,14 +2666,14 @@
kread32(fil,&s->z);
kread16(fil,&s->cstat);
kread16(fil,&s->picnum);
- kread8(fil,(char*)&s->shade);
- kread8(fil,(char*)&s->pal);
- kread8(fil,(char*)&s->clipdist);
- kread8(fil,(char*)&s->filler);
- kread8(fil,(char*)&s->xrepeat);
- kread8(fil,(char*)&s->yrepeat);
- kread8(fil,(char*)&s->xoffset);
- kread8(fil,(char*)&s->yoffset);
+ kread8(fil,(uint8_t *)&s->shade);
+ kread8(fil,(uint8_t *)&s->pal);
+ kread8(fil,(uint8_t *)&s->clipdist);
+ kread8(fil,(uint8_t *)&s->filler);
+ kread8(fil,(uint8_t *)&s->xrepeat);
+ kread8(fil,(uint8_t *)&s->yrepeat);
+ kread8(fil,(uint8_t *)&s->xoffset);
+ kread8(fil,(uint8_t *)&s->yoffset);
kread16(fil,&s->sectnum);
kread16(fil,&s->statnum);
kread16(fil,&s->ang);
@@ -2697,9 +2697,9 @@
// FIX_00009: Show map CRC and GRP file version of each player in case of Out Of Synch
- mapCRC = crc16((char*)sector, numsectors*sizeof(sectortype));
- mapCRC += crc16((char*)wall, numwalls*sizeof(walltype));
- mapCRC += crc16((char*)sprite, numsprites*sizeof(spritetype));
+ mapCRC = crc16((uint8_t *)sector, numsectors*sizeof(sectortype));
+ mapCRC += crc16((uint8_t *)wall, numwalls*sizeof(walltype));
+ mapCRC += crc16((uint8_t *)sprite, numsprites*sizeof(spritetype));
return(0);
}
@@ -2717,13 +2717,13 @@
write(f, &val, 2);
}
-static void write8(int f, char val)
+static void write8(int f, uint8_t val)
{
write(f, &val, 1);
}
-int saveboard(char *filename, int32_t *daposx, int32_t *daposy,
+int saveboard(uint8_t *filename, int32_t *daposx, int32_t *daposy,
int32_t *daposz, short *daang, short *dacursectnum)
{
int fil;
@@ -2902,7 +2902,7 @@
static void initfastcolorlookup(int32_t rscale, int32_t gscale, int32_t bscale)
{
int32_t i, j, x, y, z;
- char *pal1;
+ uint8_t *pal1;
j = 0;
for(i=64;i>=0;i--)
@@ -2917,7 +2917,7 @@
clearbufbyte((void *)FP_OFF(colhere),sizeof(colhere),0L);
clearbufbyte((void *)FP_OFF(colhead),sizeof(colhead),0L);
- pal1 = (char *)&palette[768-3];
+ pal1 = (uint8_t *)&palette[768-3];
for(i=255;i>=0;i--,pal1-=3)
{
j = (pal1[0]>>3)*FASTPALGRIDSIZ*FASTPALGRIDSIZ+(pal1[1]>>3)*FASTPALGRIDSIZ+(pal1[2]>>3)+FASTPALGRIDSIZ*FASTPALGRIDSIZ+FASTPALGRIDSIZ+1;
@@ -2938,7 +2938,7 @@
static void loadpalette(void)
{
int32_t i, j, k, dist, fil;
- char *ptr;
+ uint8_t *ptr;
if (paletteloaded != 0) return;
if ((fil = TCkopen4load("palette.dat",0)) == -1) return;
@@ -2946,9 +2946,9 @@
kread(fil,palette,768);
kread16(fil,&numpalookups);
- if ((palookup[0] = (char *)kkmalloc(numpalookups<<8)) == NULL)
+ if ((palookup[0] = (uint8_t *)kkmalloc(numpalookups<<8)) == NULL)
allocache((int32_t *)&palookup[0],numpalookups<<8,&permanentlock);
- if ((transluc = (char *)kkmalloc(65536L)) == NULL)
+ if ((transluc = (uint8_t *)kkmalloc(65536L)) == NULL)
allocache((int32_t *)&transluc,65536,&permanentlock);
globalpalwritten = palookup[0]; globalpal = 0;
@@ -2976,9 +2976,9 @@
for(i=0;i<256;i++)
{
dist = palette[i*3]*3+palette[i*3+1]*5+palette[i*3+2]*2;
- ptr = (char *)(FP_OFF(palookup[k])+i);
+ ptr = (uint8_t *)(FP_OFF(palookup[k])+i);
for(j=0;j<32;j++)
- ptr[j<<8] = (char)min(max(mulscale10(dist,32-j),0),15);
+ ptr[j<<8] = (uint8_t )min(max(mulscale10(dist,32-j),0),15);
}
if (transluc != NULL)
@@ -2992,7 +2992,7 @@
-int setgamemode(char davidoption, int32_t daxdim, int32_t daydim)
+int setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim)
{
strcpy(kensmessage,"!!!! BUILD engine&tools programmed by Ken Silverman of E.G. RI. (c) Copyright 1995 Ken Silverman. Summary: BUILD = Ken. !!!!");
if (getkensmessagecrc(FP_OFF(kensmessage)) != 0x56c764d4)
@@ -3140,7 +3140,7 @@
static void dorotatesprite (int32_t sx, int32_t sy, int32_t z, short a, short picnum,
- int8_t dashade, uint8_t dapalnum, char dastat, int32_t cx1,
+ int8_t dashade, uint8_t dapalnum, uint8_t dastat, int32_t cx1,
int32_t cy1, int32_t cx2, int32_t cy2)
{
int32_t cosang, sinang, v, nextv, dax1, dax2, oy, bx, by, ny1, ny2;
@@ -3147,14 +3147,14 @@
int32_t i, x, y, x1, y1, x2, y2, gx1, gy1, p, bufplc, palookupoffs;
int32_t xsiz, ysiz, xoff, yoff, npoints, yplc, yinc, lx, rx, xx, xend;
int32_t xv, yv, xv2, yv2, obuffermode=0, qlinemode=0, y1ve[4], y2ve[4], u4, d4;
- char bad;
+ uint8_t bad;
xsiz = tilesizx[picnum]; ysiz = tilesizy[picnum];
if (dastat&16) { xoff = 0; yoff = 0; }
else
{
- xoff = (long)((signed char)((picanm[picnum]>>8)&255))+(xsiz>>1);
- yoff = (long)((signed char)((picanm[picnum]>>16)&255))+(ysiz>>1);
+ xoff = (int32_t)((int8_t )((picanm[picnum]>>8)&255))+(xsiz>>1);
+ yoff = (int32_t)((int8_t )((picanm[picnum]>>16)&255))+(ysiz>>1);
}
if (dastat&4) yoff = ysiz-yoff;
@@ -3541,7 +3541,7 @@
/* int32_t j,k; */
#if 0
- char snotbuf[32];
+ uint8_t snotbuf[32];
j = 0; k = 0;
for(i=0;i<4096;i++)
if (waloff[i] != 0)
@@ -3597,7 +3597,7 @@
void loadtile(short tilenume)
{
- char *ptr;
+ uint8_t *ptr;
int32_t i, dasiz;
if ((unsigned)tilenume >= (unsigned)MAXTILES) return;
@@ -3633,7 +3633,7 @@
klseek(artfil,tilefileoffs[tilenume]-artfilplc,SEEK_CUR);
faketimerhandler();
}
- ptr = (char *)waloff[tilenume];
+ ptr = (uint8_t *)waloff[tilenume];
kread(artfil,ptr,dasiz);
faketimerhandler();
artfilplc = tilefileoffs[tilenume]+dasiz;
@@ -3657,19 +3657,19 @@
picanm[tilenume] = 0;
j = 15; while ((j > 1) && (pow2long[j] > xsiz)) j--;
- picsiz[tilenume] = ((char)j);
+ picsiz[tilenume] = ((uint8_t )j);
j = 15; while ((j > 1) && (pow2long[j] > ysiz)) j--;
- picsiz[tilenume] += ((char)(j<<4));
+ picsiz[tilenume] += ((uint8_t )(j<<4));
return(waloff[tilenume]);
}
-int loadpics(char *filename, char* gamedir)
+int loadpics(uint8_t *filename, uint8_t * gamedir)
{
int32_t offscount, localtilestart, localtileend, dasiz;
short fil, i, j, k;
- //char fullpathartfilename[512];
+ //uint8_t fullpathartfilename[512];
strcpy(artfilename,filename);
@@ -3753,7 +3753,7 @@
/* try dpmi_DETERMINEMAXREALALLOC! */
cachesize = max(artsize,1048576);
- while ((pic = (char *)kkmalloc(cachesize)) == NULL)
+ while ((pic = (uint8_t *)kkmalloc(cachesize)) == NULL)
{
cachesize -= 65536L;
if (cachesize < 65536) return(-1);
@@ -3764,10 +3764,10 @@
{
j = 15;
while ((j > 1) && (pow2long[j] > tilesizx[i])) j--;
- picsiz[i] = ((char)j);
+ picsiz[i] = ((uint8_t )j);
j = 15;
while ((j > 1) && (pow2long[j] > tilesizy[i])) j--;
- picsiz[i] += ((char)(j<<4));
+ picsiz[i] += ((uint8_t )(j<<4));
}
artfil = -1;
@@ -3778,10 +3778,10 @@
}
#ifdef SUPERBUILD
-void qloadkvx(int32_t voxindex, char *filename)
+void qloadkvx(int32_t voxindex, uint8_t *filename)
{
int32_t i, fil, dasiz, lengcnt, lengtot;
- char *ptr;
+ uint8_t *ptr;
if ((fil = kopen4load(filename,0)) == -1) return;
@@ -3795,7 +3795,7 @@
/* Must store filenames to use cacheing system :( */
voxlock[voxindex][i] = 200;
allocache(&voxoff[voxindex][i],dasiz,(uint8_t *)&voxlock[voxindex][i]);
- ptr = (char *)voxoff[voxindex][i];
+ ptr = (uint8_t *)voxoff[voxindex][i];
kread(fil,ptr,dasiz);
lengcnt += dasiz+4;
@@ -4035,11 +4035,11 @@
z1 = max(nsec->ceilingz,sec->ceilingz);
z2 = min(nsec->floorz,sec->floorz);
- wallmost(uwall,z,sectnum,(char)0);
- wallmost(uplc,z,(long)wal->nextsector,(char)0);
+ wallmost(uwall,z,sectnum,(uint8_t )0);
+ wallmost(uplc,z,(long)wal->nextsector,(uint8_t )0);
for(x=xb1[z];x<=xb2[z];x++) if (uplc[x] > uwall[x]) uwall[x] = uplc[x];
- wallmost(dwall,z,sectnum,(char)1);
- wallmost(dplc,z,(long)wal->nextsector,(char)1);
+ wallmost(dwall,z,sectnum,(uint8_t )1);
+ wallmost(dplc,z,(long)wal->nextsector,(uint8_t )1);
for(x=xb1[z];x<=xb2[z];x++) if (dplc[x] < dwall[x]) dwall[x] = dplc[x];
prepwall(z,wal);
@@ -4193,7 +4193,7 @@
int32_t lx, rx, nx, ny, x1=0, y1=0, z1, x2=0, y2=0, z2, yplc, yinc=0;
int32_t yoff, xs=0, ys=0, xe, ye, xi=0, yi=0, cbackx, cbacky, dagxinc, dagyinc;
short *shortptr;
- char *voxptr, *voxend, *davoxptr, oand, oand16, oand32;
+ uint8_t *voxptr, *voxend, *davoxptr, oand, oand16, oand32;
cosang = sintable[(globalang+512)&2047];
sinang = sintable[globalang&2047];
@@ -4212,7 +4212,7 @@
}
if (k >= MAXVOXMIPS) i = MAXVOXMIPS-1;
- davoxptr = (char *)voxoff[daindex][i]; if (!davoxptr) return;
+ davoxptr = (uint8_t *)voxoff[daindex][i]; if (!davoxptr) return;
daxscale <<= (i+8); dayscale <<= (i+8);
odayscale = dayscale;
@@ -4331,8 +4331,8 @@
for(y=ys;y!=ye;y+=yi,nx+=dagyinc,ny-=dagxinc)
{
if ((ny <= nytooclose) || (ny >= nytoofar)) continue;
- voxptr = (char *)(shortptr[y]+slabxoffs);
- voxend = (char *)(shortptr[y+1]+slabxoffs);
+ voxptr = (uint8_t *)(shortptr[y]+slabxoffs);
+ voxend = (uint8_t *)(shortptr[y+1]+slabxoffs);
if (voxptr == voxend) continue;
lx = mulscale32(nx>>3,distrecip[(ny+y1)>>14])+halfxdimen;
@@ -4404,7 +4404,7 @@
int32_t cosang, sinang, dax, day, lpoint, lmax, rpoint, rmax, dax1, dax2, y;
int32_t npoints, npoints2, zz, t, zsgn, zzsgn;
short tilenum, spritenum;
- char swapped, daclip;
+ uint8_t swapped, daclip;
#ifdef SUPERBUILD
int32_t *longptr;
@@ -4437,8 +4437,8 @@
if (cstat&512) settransreverse(); else settransnormal();
}
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)tspr->xoffset);
- yoff = (long)((signed char)((picanm[tilenum]>>16)&255))+((long)tspr->yoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)tspr->xoffset);
+ yoff = (long)((int8_t )((picanm[tilenum]>>16)&255))+((long)tspr->yoffset);
if ((cstat&48) == 0)
{
@@ -5223,7 +5223,7 @@
// crashes 2nd demo of atomic, when pig jumps in hole.
tspr->z -= mulscale6(longptr[5],(long)tspr->yrepeat);
}
- yoff = (long)((signed char)((picanm[sprite[tspr->owner].picnum]>>16)&255))+((long)tspr->yoffset);
+ yoff = (long)((int8_t )((picanm[sprite[tspr->owner].picnum]>>16)&255))+((long)tspr->yoffset);
tspr->z -= ((yoff*tspr->yrepeat)<<2);
globvis = globalvisibility;
@@ -5339,7 +5339,7 @@
spritesz[k] = tspriteptr[k]->z;
if ((tspriteptr[k]->cstat&48) != 32)
{
- yoff = (long)((signed char)((picanm[tspriteptr[k]->picnum]>>16)&255))+((long)tspriteptr[k]->yoffset);
+ yoff = (long)((int8_t )((picanm[tspriteptr[k]->picnum]>>16)&255))+((long)tspriteptr[k]->yoffset);
spritesz[k] -= ((yoff*tspriteptr[k]->yrepeat)<<2);
yspan = (tilesizy[tspriteptr[k]->picnum]*tspriteptr[k]->yrepeat<<2);
if (!(tspriteptr[k]->cstat&128)) spritesz[k] -= (yspan>>1);
@@ -5794,7 +5794,7 @@
int32_t dawalclipmask, dasprclipmask;
short tempshortcnt, tempshortnum, dasector, startwall, endwall;
short nextsector;
- char clipyou;
+ uint8_t clipyou;
*hitsect = -1; *hitwall = -1; *hitsprite = -1;
if (sectnum < 0) return(-1);
@@ -5936,7 +5936,7 @@
i = (tilesizy[spr->picnum]*spr->yrepeat<<2);
if (cstat&128) z1 += (i>>1);
- if (picanm[spr->picnum]&0x00ff0000) z1 -= ((long)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
+ if (picanm[spr->picnum]&0x00ff0000) z1 -= ((long)((int8_t )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
if ((intz > z1) || (intz < z1-i)) continue;
topu = vx*(y1-ys) - vy*(x1-xs);
@@ -5959,7 +5959,7 @@
* Given: (x1, y1) starts out as the center point
*/
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
if ((cstat&4) > 0) xoff = -xoff;
k = spr->ang; l = spr->xrepeat;
dax = sintable[k&2047]*l; day = sintable[(k+1536)&2047]*l;
@@ -5976,7 +5976,7 @@
k = ((tilesizy[spr->picnum]*spr->yrepeat)<<2);
if (cstat&128) daz = spr->z+(k>>1); else daz = spr->z;
- if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
+ if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((int8_t )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
if ((intz < daz) && (intz > daz-k))
{
*hitsect = dasector; *hitwall = -1; *hitsprite = z;
@@ -5996,8 +5996,8 @@
if (klabs(intx-xs)+klabs(inty-ys) > klabs((*hitx)-xs)+klabs((*hity)-ys)) continue;
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
- yoff = (long)((signed char)((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ yoff = (long)((int8_t )((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
if ((cstat&4) > 0) xoff = -xoff;
if ((cstat&8) > 0) yoff = -yoff;
@@ -6054,7 +6054,7 @@
int neartag(int32_t xs, int32_t ys, int32_t zs, short sectnum, short ange,
short *neartagsector, short *neartagwall, short *neartagsprite,
- int32_t *neartaghitdist, int32_t neartagrange, char tagsearch)
+ int32_t *neartaghitdist, int32_t neartagrange, uint8_t tagsearch)
{
walltype *wal, *wal2;
spritetype *spr;
@@ -6139,7 +6139,7 @@
intz = zs+scale(vz,topt,bot);
i = tilesizy[spr->picnum]*spr->yrepeat;
if (spr->cstat&128) z1 += (i<<1);
- if (picanm[spr->picnum]&0x00ff0000) z1 -= ((long)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
+ if (picanm[spr->picnum]&0x00ff0000) z1 -= ((long)((int8_t )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
if ((intz <= z1) && (intz >= z1-(i<<2)))
{
topu = vx*(y1-ys) - vy*(x1-xs);
@@ -6245,7 +6245,7 @@
static void keepaway (int32_t *x, int32_t *y, int32_t w)
{
int32_t dx, dy, ox, oy, x1, y1;
- char first;
+ uint8_t first;
x1 = clipit[w].x1; dx = clipit[w].x2-x1;
y1 = clipit[w].y1; dy = clipit[w].y2-y1;
@@ -6416,7 +6416,7 @@
{
k = ((tilesizy[spr->picnum]*spr->yrepeat)<<2);
if (cstat&128) daz = spr->z+(k>>1); else daz = spr->z;
- if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
+ if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((int8_t )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
if (((*z) < daz+ceildist) && ((*z) > daz-k-flordist))
{
bsz = (spr->clipdist<<2)+walldist; if (gx < 0) bsz = -bsz;
@@ -6429,7 +6429,7 @@
case 16:
k = ((tilesizy[spr->picnum]*spr->yrepeat)<<2);
if (cstat&128) daz = spr->z+(k>>1); else daz = spr->z;
- if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
+ if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((int8_t )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
daz2 = daz-k;
daz += ceildist; daz2 -= flordist;
if (((*z) < daz) && ((*z) > daz2))
@@ -6439,7 +6439,7 @@
* Given: (x1, y1) starts out as the center point
*/
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
if ((cstat&4) > 0) xoff = -xoff;
k = spr->ang; l = spr->xrepeat;
dax = sintable[k&2047]*l; day = sintable[(k+1536)&2047]*l;
@@ -6478,8 +6478,8 @@
if (((*z) > spr->z) == ((cstat&8)==0)) continue;
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
- yoff = (long)((signed char)((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ yoff = (long)((int8_t )((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
if ((cstat&4) > 0) xoff = -xoff;
if ((cstat&8) > 0) yoff = -yoff;
@@ -6627,7 +6627,7 @@
int32_t i, j, k, t, dx, dy, dax, day, daz, daz2, bad, dir;
int32_t dasprclipmask, dawalclipmask;
short startwall, endwall, clipsectcnt;
- char bad2;
+ uint8_t bad2;
if ((*sectnum) < 0) return(-1);
@@ -6659,7 +6659,7 @@
{
t = ((tilesizy[spr->picnum]*spr->yrepeat)<<2);
if (spr->cstat&128) daz = spr->z+(t>>1); else daz = spr->z;
- if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
+ if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((int8_t )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
if (((*z) < daz+ceildist) && ((*z) > daz-t-flordist))
{
t = (spr->clipdist<<2)+walldist;
@@ -6831,7 +6831,7 @@
void draw2dgrid(int32_t posxe, int32_t posye, short ange, int32_t zoome, short gride)
{
int32_t i, xp1, yp1, xp2=0, yp2, tempy, tempint;
- char mask;
+ uint8_t mask;
if (gride > 0)
{
@@ -6910,7 +6910,7 @@
{
walltype *wal;
int32_t i, j, xp1, yp1, xp2, yp2, tempint;
- char col;
+ uint8_t col;
if (qsetmode == 200) return;
@@ -7107,10 +7107,10 @@
* other cause flicker, so I have this function here so the shadow can
* be drawn with _noupdate, and the actual string is draw with an update.
*/
-static void __printext256(int32_t xpos, int32_t ypos, short col, short backcol, char name[82], char fontsize, int should_update)
+static void __printext256(int32_t xpos, int32_t ypos, short col, short backcol, uint8_t name[82], uint8_t fontsize, int should_update)
{
int32_t stx, i, x, y, charxsiz;
- char *fontptr, *letptr, *ptr;
+ uint8_t *fontptr, *letptr, *ptr;
stx = xpos;
@@ -7120,15 +7120,15 @@
for(i=0;name[i];i++)
{
letptr = &fontptr[name[i]<<3];
- ptr = (char *)(ylookup[ypos+7]+(stx-fontsize)+frameplace);
+ ptr = (uint8_t *)(ylookup[ypos+7]+(stx-fontsize)+frameplace);
for(y=7;y>=0;y--)
{
for(x=charxsiz-1;x>=0;x--)
{
if (letptr[y]&pow2char[7-fontsize-x])
- ptr[x] = (char)col;
+ ptr[x] = (uint8_t )col;
else if (backcol >= 0)
- ptr[x] = (char)backcol;
+ ptr[x] = (uint8_t )backcol;
}
ptr -= ylookup[1];
}
@@ -7140,13 +7140,13 @@
}
-void printext256(int32_t xpos, int32_t ypos, short col, short backcol, char name[82], char fontsize)
+void printext256(int32_t xpos, int32_t ypos, short col, short backcol, uint8_t name[82], uint8_t fontsize)
{
__printext256(xpos, ypos, col, backcol, name, fontsize, 1);
}
-void printext256_noupdate(int32_t xpos, int32_t ypos, short col, short backcol, char name[82], char fontsize)
+void printext256_noupdate(int32_t xpos, int32_t ypos, short col, short backcol, uint8_t name[82], uint8_t fontsize)
{
__printext256(xpos, ypos, col, backcol, name, fontsize, 0);
}
@@ -7153,10 +7153,10 @@
#ifdef DBGRECORD
-int krand(int line, char* file)
+int krand(int line, uint8_t * file)
{
int i, k=0;
- char filename[2048];
+ uint8_t filename[2048];
FILE *pFile;
#else
int krand()
@@ -7197,7 +7197,7 @@
int32_t x1, y1, x2, y2, x3, y3, x4, y4, ang, cosang, sinang;
int32_t xspan, yspan, xrepeat, yrepeat, dasprclipmask, dawalclipmask;
short cstat;
- char clipyou;
+ uint8_t clipyou;
if (sectnum < 0)
{
@@ -7291,7 +7291,7 @@
daz = spr->z;
k = ((tilesizy[spr->picnum]*spr->yrepeat)<<1);
if (cstat&128) daz += k;
- if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
+ if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((int8_t )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
daz2 = daz - (k<<1);
clipyou = 1;
}
@@ -7298,7 +7298,7 @@
break;
case 16:
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
if ((cstat&4) > 0) xoff = -xoff;
k = spr->ang; l = spr->xrepeat;
dax = sintable[k&2047]*l; day = sintable[(k+1536)&2047]*l;
@@ -7309,7 +7309,7 @@
{
daz = spr->z; k = ((tilesizy[spr->picnum]*spr->yrepeat)<<1);
if (cstat&128) daz += k;
- if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((signed char)((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
+ if (picanm[spr->picnum]&0x00ff0000) daz -= ((long)((int8_t )((picanm[spr->picnum]>>16)&255))*spr->yrepeat<<2);
daz2 = daz-(k<<1);
clipyou = 1;
}
@@ -7321,8 +7321,8 @@
if ((z > daz) == ((cstat&8)==0)) continue;
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
- yoff = (long)((signed char)((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ yoff = (long)((int8_t )((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
if ((cstat&4) > 0) xoff = -xoff;
if ((cstat&8) > 0) yoff = -yoff;
@@ -7431,7 +7431,7 @@
void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum,
- int8_t dashade, char dapalnum, char dastat,
+ int8_t dashade, uint8_t dapalnum, uint8_t dastat,
int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2)
{
int32_t i;
@@ -7506,7 +7506,7 @@
static int getclosestcol(int32_t r, int32_t g, int32_t b)
{
int32_t i, j, k, dist, mindist, retcol;
- char *pal1;
+ uint8_t *pal1;
j = (r>>3)*FASTPALGRIDSIZ*FASTPALGRIDSIZ+(g>>3)*FASTPALGRIDSIZ+(b>>3)+FASTPALGRIDSIZ*FASTPALGRIDSIZ+FASTPALGRIDSIZ+1;
mindist = min(rdist[coldist[r&7]+64+8],gdist[coldist[g&7]+64+8]);
@@ -7522,7 +7522,7 @@
i = colhead[i];
do
{
- pal1 = (char *)&palette[i*3];
+ pal1 = (uint8_t *)&palette[i*3];
dist = gdist[pal1[1]+g];
if (dist < mindist)
{
@@ -7539,7 +7539,7 @@
if (retcol >= 0) return(retcol);
mindist = 0x7fffffff;
- pal1 = (char *)&palette[768-3];
+ pal1 = (uint8_t *)&palette[768-3];
for(i=255;i>=0;i--,pal1-=3)
{
dist = gdist[pal1[1]+g]; if (dist >= mindist) continue;
@@ -7551,11 +7551,11 @@
}
-void makepalookup(int32_t palnum, char *remapbuf, int8_t r,
- int8_t g, int8_t b, char dastat)
+void makepalookup(int32_t palnum, uint8_t *remapbuf, int8_t r,
+ int8_t g, int8_t b, uint8_t dastat)
{
int32_t i, j, dist, palscale;
- char *ptr, *ptr2;
+ uint8_t *ptr, *ptr2;
if (paletteloaded == 0) return;
@@ -7562,7 +7562,7 @@
if (palookup[palnum] == NULL)
{
/* Allocate palookup buffer */
- if ((palookup[palnum] = (char *)kkmalloc(numpalookups<<8)) == NULL)
+ if ((palookup[palnum] = (uint8_t *)kkmalloc(numpalookups<<8)) == NULL)
allocache((int32_t *)&palookup[palnum],numpalookups<<8,&permanentlock);
}
@@ -7573,8 +7573,8 @@
{
for(i=0;i<256;i++)
{
- ptr = (char *)(FP_OFF(palookup[0])+remapbuf[i]);
- ptr2 = (char *)(FP_OFF(palookup[palnum])+i);
+ ptr = (uint8_t *)(FP_OFF(palookup[0])+remapbuf[i]);
+ ptr2 = (uint8_t *)(FP_OFF(palookup[palnum])+i);
for(j=0;j<numpalookups;j++)
{ *ptr2 = *ptr; ptr += 256; ptr2 += 256; }
}
@@ -7581,13 +7581,13 @@
}
else
{
- ptr2 = (char *)FP_OFF(palookup[palnum]);
+ ptr2 = (uint8_t *)FP_OFF(palookup[palnum]);
for(i=0;i<numpalookups;i++)
{
palscale = divscale16(i,numpalookups);
for(j=0;j<256;j++)
{
- ptr = (char *)&palette[remapbuf[j]*3];
+ ptr = (uint8_t *)&palette[remapbuf[j]*3];
*ptr2++ = getclosestcol((long)ptr[0]+mulscale16(r-ptr[0],palscale),
(long)ptr[1]+mulscale16(g-ptr[1],palscale),
(long)ptr[2]+mulscale16(b-ptr[2],palscale));
@@ -7600,15 +7600,15 @@
for(i=0;i<256;i++)
{
dist = palette[i*3]*3+palette[i*3+1]*5+palette[i*3+2]*2;
- ptr = (char *)(FP_OFF(palookup[palnum])+i);
+ ptr = (uint8_t *)(FP_OFF(palookup[palnum])+i);
for(j=0;j<32;j++)
- ptr[j<<8] = (char)min(max(mulscale10(dist,32-j),0),15);
+ ptr[j<<8] = (uint8_t )min(max(mulscale10(dist,32-j),0),15);
}
}
}
-void setbrightness(char dabrightness, uint8_t *dapal)
+void setbrightness(uint8_t dabrightness, uint8_t *dapal)
{
int32_t i, j, k;
@@ -7637,7 +7637,7 @@
}
}
- VBE_setPalette(0, 256, (char *) tempbuf);
+ VBE_setPalette(0, 256, (uint8_t *) tempbuf);
}
@@ -8094,8 +8094,8 @@
npoints = 0;
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
- yoff = (long)((signed char)((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ yoff = (long)((int8_t )((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
if ((spr->cstat&4) > 0) xoff = -xoff;
if ((spr->cstat&8) > 0) yoff = -yoff;
@@ -8258,7 +8258,7 @@
}
-void plotpixel(int32_t x, int32_t y, char col)
+void plotpixel(int32_t x, int32_t y, uint8_t col)
{
drawpixel(ylookup[y]+x+frameplace,(long)col);
}
--- a/Engine/src/engine.h
+++ b/Engine/src/engine.h
@@ -36,7 +36,7 @@
* information on using these functions that may or may not be accurate. :)
*/
int initmouse(void);
-int setgamemode(char davidoption, int32_t daxdim, int32_t daydim);
+int setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim);
int getceilzofslope(short sectnum, int32_t dax, int32_t day);
int getflorzofslope(short sectnum, int32_t dax, int32_t day);
void getzsofslope(short sectnum, int32_t dax, int32_t day, int32_t *ceilz, int32_t *florz);
@@ -58,22 +58,22 @@
void nextpage(void);
void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,
short daang, int32_t dahoriz, short dacursectnum);
-int loadboard(char *filename, int32_t *daposx, int32_t *daposy,
+int loadboard(uint8_t *filename, int32_t *daposx, int32_t *daposy,
int32_t *daposz, short *daang, short *dacursectnum);
void drawmasks(void);
void printext256(int32_t xpos, int32_t ypos, short col, short backcol,
- char name[82], char fontsize);
+ uint8_t name[82], uint8_t fontsize);
void printext256_noupdate(int32_t xpos, int32_t ypos, short col, short backcol,
- char name[82], char fontsize);
+ uint8_t name[82], uint8_t fontsize);
void initengine(void);
void uninitengine(void);
-int loadpics(char *filename, char* gamedir);
-int saveboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz,
+int loadpics(uint8_t *filename, uint8_t * gamedir);
+int saveboard(uint8_t *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz,
short *daang, short *dacursectnum);
-void plotpixel(int32_t x, int32_t y, char col);
+void plotpixel(int32_t x, int32_t y, uint8_t col);
uint8_t getpixel(int32_t x, int32_t y);
-void setbrightness(char dabrightness, uint8_t *dapal);
-int screencapture(char *filename, char inverseit);
+void setbrightness(uint8_t dabrightness, uint8_t *dapal);
+int screencapture(uint8_t *filename, uint8_t inverseit);
void getmousevalues(short *mousx, short *mousy, short *bstatus);
int clipmove (int32_t *x, int32_t *y, int32_t *z, short *sectnum, int32_t xvect,
int32_t yvect, int32_t walldist, int32_t ceildist,
@@ -120,21 +120,21 @@
short topbottom, short direction);
int neartag(int32_t xs, int32_t ys, int32_t zs, short sectnum, short ange,
short *neartagsector, short *neartagwall, short *neartagsprite,
- int32_t *neartaghitdist, int32_t neartagrange, char tagsearch);
+ int32_t *neartaghitdist, int32_t neartagrange, uint8_t tagsearch);
int pushmove(int32_t *x, int32_t *y, int32_t *z, short *sectnum,
int32_t walldist, int32_t ceildist, int32_t flordist,
uint32_t cliptype);
#ifdef DBGRECORD
-int krand(int line, char* file);
+int krand(int line, uint8_t * file);
#else
int krand(void);
#endif
void flushperms(void);
void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum,
- int8_t dashade, char dapalnum, char dastat,
+ int8_t dashade, uint8_t dapalnum, uint8_t dastat,
int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
-void makepalookup(int32_t palnum, char *remapbuf, int8_t r,
- int8_t g, int8_t b, char dastat);
+void makepalookup(int32_t palnum, uint8_t *remapbuf, int8_t r,
+ int8_t g, int8_t b, uint8_t dastat);
void drawmapview(int32_t dax, int32_t day, int32_t zoome, short ang);
void setview(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
void setviewtotile(short tilenume, int32_t xsiz, int32_t ysiz);
@@ -148,7 +148,7 @@
int clipinsidebox(int32_t x, int32_t y, short wallnum, int32_t walldist);
#ifdef SUPERBUILD
-void qloadkvx(int32_t voxindex, char *filename);
+void qloadkvx(int32_t voxindex, uint8_t *filename);
#endif
#ifdef __cplusplus
--- a/Engine/src/engine_protos.h
+++ b/Engine/src/engine_protos.h
@@ -26,21 +26,21 @@
#if 0
/* game.c */
-extern void initsb(char dadigistat, char damusistat, int32_t dasamplerate, char danumspeakers, char dabytespersample, char daintspersec, char daquality);
+extern void initsb(uint8_t dadigistat, uint8_t damusistat, int32_t dasamplerate, uint8_t danumspeakers, uint8_t dabytespersample, uint8_t daintspersec, uint8_t daquality);
extern void uninitsb(void);
-extern int loadsong(char *filename);
+extern int loadsong(uint8_t *filename);
extern void musicon(void);
extern void musicoff(void);
-extern void wsayfollow(char *dafilename, int32_t dafreq, int32_t davol, int32_t *daxplc, int32_t *dayplc, char followstat);
-extern void wsay(char *dafilename, int32_t dafreq, int32_t volume1, int32_t volume2);
+extern void wsayfollow(uint8_t *dafilename, int32_t dafreq, int32_t davol, int32_t *daxplc, int32_t *dayplc, uint8_t followstat);
+extern void wsay(uint8_t *dafilename, int32_t dafreq, int32_t volume1, int32_t volume2);
extern void preparesndbuf(void);
extern void setears(int32_t daposx, int32_t daposy, int32_t daxvect, int32_t dayvect);
extern void timerhandler(void);
extern void keyhandler(void);
extern void initlava(void);
-extern void movelava(char *dapic);
-extern void drawtilebackground(int32_t thex, int32_t they, short tilenum, int8_t shade, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2, char dapalnum);
-extern void printext(int32_t x, int32_t y, char *buffer, short tilenum, char invisiblecol);
+extern void movelava(uint8_t *dapic);
+extern void drawtilebackground(int32_t thex, int32_t they, short tilenum, int8_t shade, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2, uint8_t dapalnum);
+extern void printext(int32_t x, int32_t y, uint8_t *buffer, short tilenum, uint8_t invisiblecol);
extern void drawstatusflytime(short snum);
extern void drawstatusbar(short snum);
extern void setup3dscreen(void);
@@ -49,7 +49,7 @@
extern void updateinterpolations(void);
extern void restoreinterpolations(void);
extern void searchmap(short startsector);
-extern void prepareboard(char *daboardfilename);
+extern void prepareboard(uint8_t *daboardfilename);
extern int32_t changehealth(short snum, short deltahealth);
extern void changenumbombs(short snum, short deltanumbombs);
extern void changenummissiles(short snum, short deltanummissiles);
@@ -56,7 +56,7 @@
extern void changenumgrabbers(short snum, short deltanumgrabbers);
extern void findrandomspot(int32_t *x, int32_t *y, short *sectnum);
extern void operatesector(short dasector);
-extern void shootgun(short snum, int32_t x, int32_t y, int32_t z, short daang, int32_t dahoriz, short dasectnum, char guntype);
+extern void shootgun(short snum, int32_t x, int32_t y, int32_t z, short daang, int32_t dahoriz, short dasectnum, uint8_t guntype);
extern void operatesprite(short dasprite);
extern void checktouchsprite(short snum, short sectnum);
extern void checkgrabbertouchsprite(short snum, short sectnum);
@@ -90,10 +90,10 @@
extern void allocache(int32_t *newhandle, int32_t newbytes, uint8_t *newlockptr);
extern void suckcache(int32_t *suckptr);
extern void agecache(void);
-extern void reportandexit(char *errormessage);
-extern int32_t initgroupfile(const char *filename);
+extern void reportandexit(uint8_t *errormessage);
+extern int32_t initgroupfile(const uint8_t *filename);
extern void uninitgroupfile(void);
-extern int32_t kopen4load(const char *filename,int readfromGRP);
+extern int32_t kopen4load(const uint8_t *filename,int readfromGRP);
extern int32_t kread(int32_t handle, void *buffer, int32_t leng);
extern int32_t klseek(int32_t handle, int32_t offset, int32_t whence);
extern int32_t kfilelength(int32_t handle);
@@ -101,8 +101,8 @@
extern void kdfread(void *buffer, size_t dasizeof, size_t count, int32_t fil);
extern void dfread(void *buffer, size_t dasizeof, size_t count, FILE *fil);
extern void dfwrite(void *buffer, size_t dasizeof, size_t count, FILE *fil);
-extern int32_t compress(char *lzwinbuf, int32_t uncompleng, char *lzwoutbuf);
-extern int32_t uncompress(char *lzwinbuf, int32_t compleng, char *lzwoutbuf);
+extern int32_t compress(uint8_t *lzwinbuf, int32_t uncompleng, uint8_t *lzwoutbuf);
+extern int32_t uncompress(uint8_t *lzwinbuf, int32_t compleng, uint8_t *lzwoutbuf);
/* sdl_driver.c */
extern int using_opengl(void);
@@ -110,14 +110,14 @@
extern uint8_t _readlastkeyhit(void);
extern int mprotect_align(const void *addr, size_t len, int prot);
extern void unprotect_ASM_pages(void);
-extern void _platform_init(int argc, char **argv, const char *title, const char *icon);
+extern void _platform_init(int argc, uint8_t **argv, const uint8_t *title, const uint8_t *icon);
extern int setvesa(int32_t x, int32_t y);
-extern int screencapture(char *filename, char inverseit);
+extern int screencapture(uint8_t *filename, uint8_t inverseit);
extern void setvmode(int mode);
-extern int _setgamemode(char davidoption, int32_t daxdim, int32_t daydim);
+extern int _setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim);
extern void getvalidvesamodes(void);
-extern int VBE_setPalette(int32_t start, int32_t num, char *palettebuffer);
-extern int VBE_getPalette(int32_t start, int32_t num, char *palettebuffer);
+extern int VBE_setPalette(int32_t start, int32_t num, uint8_t *palettebuffer);
+extern int VBE_getPalette(int32_t start, int32_t num, uint8_t *palettebuffer);
extern void _uninitengine(void);
extern void uninitvesa(void);
extern int setupmouse(void);
@@ -132,7 +132,7 @@
extern void setcolor16(int col);
extern void drawpixel16(int32_t offset);
extern void fillscreen16(int32_t offset, int32_t color, int32_t blocksize);
-extern void drawline16(int32_t XStart, int32_t YStart, int32_t XEnd, int32_t YEnd, char Color);
+extern void drawline16(int32_t XStart, int32_t YStart, int32_t XEnd, int32_t YEnd, uint8_t Color);
extern void clear2dscreen(void);
extern void _idle(void);
extern void *_getVideoBase(void);
@@ -151,9 +151,9 @@
/*
void (*callcommit)(void);
void (*initcrc)(void);
-int32_t (*getcrc)(char *buffer, short bufleng);
-void (*initmultiplayers)(char damultioption, char dacomrateoption, char dapriority);
-void (*sendpacket)(int32_t other, char *bufptr, int32_t messleng);
+int32_t (*getcrc)(uint8_t *buffer, short bufleng);
+void (*initmultiplayers)(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority);
+void (*sendpacket)(int32_t other, uint8_t *bufptr, int32_t messleng);
void (*setpackettimeout)(int32_t datimeoutcount, int32_t daresendagaincount);
void (*uninitmultiplayers)(void);
void (*sendlogon)(void);
@@ -160,15 +160,15 @@
void (*sendlogoff)(void);
int (*getoutputcirclesize)(void);
void (*setsocket)(short newsocket);
-short (*getpacket)(short *other, char *bufptr);
+short (*getpacket)(short *other, uint8_t *bufptr);
void (*flushpackets)(void);
-void (*genericmultifunction)(int32_t other, char *bufptr, int32_t messleng, int32_t command);
+void (*genericmultifunction)(int32_t other, uint8_t *bufptr, int32_t messleng, int32_t command);
*/
void callcommit(void);
void initcrc(void);
-int32_t getcrc(char *buffer, short bufleng);
-void initmultiplayers(char damultioption, char dacomrateoption, char dapriority);
-void sendpacket(int32_t other, char *bufptr, int32_t messleng);
+int32_t getcrc(uint8_t *buffer, short bufleng);
+void initmultiplayers(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority);
+void sendpacket(int32_t other, uint8_t *bufptr, int32_t messleng);
void setpackettimeout(int32_t datimeoutcount, int32_t daresendagaincount);
void uninitmultiplayers(void);
void sendlogon(void);
@@ -175,9 +175,9 @@
void sendlogoff(void);
int getoutputcirclesize(void);
void setsocket(short newsocket);
-short getpacket(short *other, char *bufptr);
+short getpacket(short *other, uint8_t *bufptr);
void flushpackets(void);
-void genericmultifunction(int32_t other, char *bufptr, int32_t messleng, int32_t command);
+void genericmultifunction(int32_t other, uint8_t *bufptr, int32_t messleng, int32_t command);
/* engine.c */
extern int setgotpic(int32_t i1);
@@ -184,9 +184,9 @@
//extern static __inline int32_t getclipmask(int32_t a, int32_t b, int32_t c, int32_t d);
extern int wallfront(int32_t l1, int32_t l2);
extern void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz, short daang, int32_t dahoriz, short dacursectnum);
-extern int loadboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
-extern int saveboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
-extern int setgamemode(char davidoption, int32_t daxdim, int32_t daydim);
+extern int loadboard(uint8_t *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
+extern int saveboard(uint8_t *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz, short *daang, short *dacursectnum);
+extern int setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim);
extern void setmmxoverlay(int isenabled);
extern int getmmxoverlay(void);
extern void initengine(void);
@@ -194,8 +194,8 @@
extern void nextpage(void);
extern void loadtile(short tilenume);
extern int allocatepermanenttile(short tilenume, int32_t xsiz, int32_t ysiz);
-extern int loadpics(char *filename, char* gamedir);
-extern void qloadkvx(int32_t voxindex, char *filename);
+extern int loadpics(uint8_t *filename, uint8_t * gamedir);
+extern void qloadkvx(int32_t voxindex, uint8_t *filename);
extern int clipinsidebox(int32_t x, int32_t y, short wallnum, int32_t walldist);
extern void drawline256(int32_t x1, int32_t y1, int32_t x2, int32_t y2, uint8_t col);
extern int inside(int32_t x, int32_t y, short sectnum);
@@ -218,7 +218,7 @@
extern int lintersect(int32_t x1, int32_t y1, int32_t z1, int32_t x2, int32_t y2, int32_t z2, int32_t x3, int32_t y3, int32_t x4, int32_t y4, int32_t *intx, int32_t *inty, int32_t *intz);
extern int rintersect(int32_t x1, int32_t y1, int32_t z1, int32_t vx, int32_t vy, int32_t vz, int32_t x3, int32_t y3, int32_t x4, int32_t y4, int32_t *intx, int32_t *inty, int32_t *intz);
extern int hitscan(int32_t xs, int32_t ys, int32_t zs, short sectnum, int32_t vx, int32_t vy, int32_t vz, short *hitsect, short *hitwall, short *hitsprite, int32_t *hitx, int32_t *hity, int32_t *hitz, uint32_t cliptype);
-extern int neartag(int32_t xs, int32_t ys, int32_t zs, short sectnum, short ange, short *neartagsector, short *neartagwall, short *neartagsprite, int32_t *neartaghitdist, int32_t neartagrange, char tagsearch);
+extern int neartag(int32_t xs, int32_t ys, int32_t zs, short sectnum, short ange, short *neartagsector, short *neartagwall, short *neartagsprite, int32_t *neartaghitdist, int32_t neartagrange, uint8_t tagsearch);
extern void dragpoint(short pointhighlight, int32_t dax, int32_t day);
extern int lastwall(short point);
extern int clipmove(int32_t *x, int32_t *y, int32_t *z, short *sectnum, int32_t xvect, int32_t yvect, int32_t walldist, int32_t ceildist, int32_t flordist, uint32_t cliptype);
@@ -229,10 +229,10 @@
extern void getmousevalues(short *mousx, short *mousy, short *bstatus);
extern void draw2dgrid(int32_t posxe, int32_t posye, short ange, int32_t zoome, short gride);
extern void draw2dscreen(int32_t posxe, int32_t posye, short ange, int32_t zoome, short gride);
-extern void printext256(int32_t xpos, int32_t ypos, short col, short backcol, char name[82], char fontsize);
-extern void printext256_noupdate(int32_t xpos, int32_t ypos, short col, short backcol, char name[82], char fontsize);
+extern void printext256(int32_t xpos, int32_t ypos, short col, short backcol, uint8_t name[82], uint8_t fontsize);
+extern void printext256_noupdate(int32_t xpos, int32_t ypos, short col, short backcol, uint8_t name[82], uint8_t fontsize);
#ifdef DBGRECORD
-extern int krand(int line, char* file);
+extern int krand(int line, uint8_t * file);
#else
extern int krand(void);
#endif
@@ -240,13 +240,13 @@
extern void setview(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
extern void setaspect(int32_t daxrange, int32_t daaspect);
extern void flushperms(void);
-extern void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum, int8_t dashade, char dapalnum, char dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
-extern void makepalookup(int32_t palnum, char *remapbuf, int8_t r, int8_t g, int8_t b, char dastat);
-extern void setbrightness(char dabrightness, uint8_t *dapal);
+extern void rotatesprite(int32_t sx, int32_t sy, int32_t z, short a, short picnum, int8_t dashade, uint8_t dapalnum, uint8_t dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
+extern void makepalookup(int32_t palnum, uint8_t *remapbuf, int8_t r, int8_t g, int8_t b, uint8_t dastat);
+extern void setbrightness(uint8_t dabrightness, uint8_t *dapal);
extern void drawmapview(int32_t dax, int32_t day, int32_t zoome, short ang);
extern void clearview(int32_t dacol);
extern void clearallviews(int32_t dacol);
-extern void plotpixel(int32_t x, int32_t y, char col);
+extern void plotpixel(int32_t x, int32_t y, uint8_t col);
extern uint8_t getpixel(int32_t x, int32_t y);
extern void setviewtotile(short tilenume, int32_t xsiz, int32_t ysiz);
extern void setviewback(void);
--- a/Engine/src/pragmas.c
+++ b/Engine/src/pragmas.c
@@ -17,12 +17,12 @@
void clearbufbyte(void *D, int32_t c, int32_t a)
{ // Cringe City
- char *p = (char*)D;
+ uint8_t *p = (uint8_t *)D;
int32_t m[4] = { 0xffl,0xff00l,0xff0000l,0xff000000l };
int32_t n[4] = { 0,8,16,24 };
int32_t z=0;
while ((c--) > 0) {
- *(p++) = (char)((a & m[z])>>n[z]);
+ *(p++) = (uint8_t )((a & m[z])>>n[z]);
z=(z+1)&3;
}
}
@@ -35,13 +35,13 @@
void copybufbyte(void *S, void *D, int32_t c)
{
- char *p = (char*)S, *q = (char*)D;
+ uint8_t *p = (uint8_t *)S, *q = (uint8_t *)D;
while((c--) > 0) *(q++) = *(p++);
}
void copybufreverse(void *S, void *D, int32_t c)
{
- char *p = (char*)S, *q = (char*)D;
+ uint8_t *p = (uint8_t *)S, *q = (uint8_t *)D;
while((c--) > 0) *(q++) = *(p--);
}
--- a/Engine/src/sdl_driver.c
+++ b/Engine/src/sdl_driver.c
@@ -40,9 +40,9 @@
/*
void (*callcommit)(void);
void (*initcrc)(void);
-int32_t (*getcrc)(char *buffer, short bufleng);
-void (*initmultiplayers)(char damultioption, char dacomrateoption, char dapriority);
-void (*sendpacket)(int32_t other, char *bufptr, int32_t messleng);
+int32_t (*getcrc)(uint8_t *buffer, short bufleng);
+void (*initmultiplayers)(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority);
+void (*sendpacket)(int32_t other, uint8_t *bufptr, int32_t messleng);
void (*setpackettimeout)(int32_t datimeoutcount, int32_t daresendagaincount);
void (*uninitmultiplayers)(void);
void (*sendlogon)(void);
@@ -49,9 +49,9 @@
void (*sendlogoff)(void);
int (*getoutputcirclesize)(void);
void (*setsocket)(short newsocket);
-short (*getpacket)(short *other, char *bufptr);
+short (*getpacket)(short *other, uint8_t *bufptr);
void (*flushpackets)(void);
-void (*genericmultifunction)(int32_t other, char *bufptr, int32_t messleng, int32_t command);
+void (*genericmultifunction)(int32_t other, uint8_t *bufptr, int32_t messleng, int32_t command);
*/
/**/
@@ -115,7 +115,7 @@
}
#endif
}
-int32_t getcrc(char *buffer, short bufleng)
+int32_t getcrc(uint8_t *buffer, short bufleng)
{
#ifndef USER_DUMMY_NETWORK
switch(nNetMode)
@@ -128,7 +128,7 @@
#endif
return 0;
}
-void initmultiplayers(char damultioption, char dacomrateoption, char dapriority)
+void initmultiplayers(uint8_t damultioption, uint8_t dacomrateoption, uint8_t dapriority)
{
#ifndef USER_DUMMY_NETWORK
switch(nNetMode)
@@ -142,7 +142,7 @@
}
#endif
}
-void sendpacket(int32_t other, char *bufptr, int32_t messleng)
+void sendpacket(int32_t other, uint8_t *bufptr, int32_t messleng)
{
#ifndef USER_DUMMY_NETWORK
switch(nNetMode)
@@ -239,7 +239,7 @@
}
#endif
}
-short getpacket(short *other, char *bufptr)
+short getpacket(short *other, uint8_t *bufptr)
{
#ifndef USER_DUMMY_NETWORK
switch(nNetMode)
@@ -266,7 +266,7 @@
}
#endif
}
-void genericmultifunction(int32_t other, char *bufptr, int32_t messleng, int32_t command)
+void genericmultifunction(int32_t other, uint8_t *bufptr, int32_t messleng, int32_t command)
{
#ifndef USER_DUMMY_NETWORK
switch(nNetMode)
@@ -296,7 +296,7 @@
RENDERER_TOTAL
} sdl_renderer_type;
-const char *renderer_name[RENDERER_TOTAL];
+const uint8_t *renderer_name[RENDERER_TOTAL];
#define ENVRSTR_RENDERER_SOFTWARE "software"
#define ENVRSTR_RENDERER_OPENGL3D "opengl3d"
@@ -321,13 +321,13 @@
int _argc = 0;
-char **_argv = NULL;
+uint8_t **_argv = NULL;
/* !!! move these elsewhere? */
int32_t xres, yres, bytesperline, frameplace, frameoffset, imageSize, maxpages;
-char *screen, vesachecked;
+uint8_t *screen, vesachecked;
int32_t buffermode, origbuffermode, linearmode;
-char permanentupdate = 0, vgacompatible;
+uint8_t permanentupdate = 0, vgacompatible;
SDL_Surface *surface = NULL; /* This isn't static so that we can use it elsewhere AH */
static int debug_hall_of_mirrors = 0;
@@ -355,8 +355,8 @@
void set_sdl_renderer(void);
-static __inline void __out_sdldebug(const char *subsystem,
- const char *fmt, va_list ap)
+static __inline void __out_sdldebug(const uint8_t *subsystem,
+ const uint8_t *fmt, va_list ap)
{
fprintf(_sdl_debug_file, "%s: ", subsystem);
vfprintf(_sdl_debug_file, fmt, ap);
@@ -365,7 +365,7 @@
} /* __out_sdldebug */
-static void sdldebug(const char *fmt, ...)
+static void sdldebug(const uint8_t *fmt, ...)
{
va_list ap;
@@ -379,7 +379,7 @@
#if (defined USE_OPENGL)
-void sgldebug(const char *fmt, ...)
+void sgldebug(const uint8_t *fmt, ...)
{
va_list ap;
@@ -393,9 +393,9 @@
#endif
-static void __append_sdl_surface_flag(SDL_Surface *_surface, char *str,
+static void __append_sdl_surface_flag(SDL_Surface *_surface, uint8_t *str,
size_t strsize, Uint32 flag,
- const char *flagstr)
+ const uint8_t *flagstr)
{
if (_surface->flags & flag)
{
@@ -413,7 +413,7 @@
static void output_surface_info(SDL_Surface *_surface)
{
const SDL_VideoInfo *info;
- char f[256];
+ uint8_t f[256];
if (!_sdl_debug_file)
return;
@@ -471,7 +471,7 @@
static void output_driver_info(void)
{
- char buffer[256];
+ uint8_t buffer[256];
if (!_sdl_debug_file)
return;
@@ -516,7 +516,7 @@
* !!! Just be sure to keep the non-DOS things, like the window's
* !!! titlebar caption. --ryan.
*/
-static char screenalloctype = 255;
+static uint8_t screenalloctype = 255;
static void init_new_res_vars(int32_t davidoption)
{
int i = 0;
@@ -566,7 +566,7 @@
j = ydim*4*sizeof(long); /* Leave room for horizlookup&horizlookup2 */
// screenalloctype = 0;
-// if ((screen = (char *)kkmalloc(i+(j<<1))) == NULL)
+// if ((screen = (uint8_t *)kkmalloc(i+(j<<1))) == NULL)
// {
// allocache((int32_t *)&screen,i+(j<<1),&permanentlock);
// screenalloctype = 1;
@@ -612,7 +612,7 @@
// clearallviews(0L);
//} /* if */
- setbrightness((char) curbrightness, (uint8_t *) &palette[0]);
+ setbrightness((uint8_t ) curbrightness, (uint8_t *) &palette[0]);
if (searchx < 0) { searchx = halfxdimen; searchy = (ydimen>>1); }
} /* init_new_res_vars */
@@ -889,7 +889,7 @@
static SDL_Joystick *joystick = NULL;
void _joystick_init(void)
{
- const char *envr = getenv(BUILD_SDLJOYSTICK);
+ const uint8_t *envr = getenv(BUILD_SDLJOYSTICK);
int favored = 0;
int numsticks;
int i;
@@ -923,7 +923,7 @@
for (i = 0; i < numsticks; i++)
{
- const char *stickname = SDL_JoystickName(i);
+ const uint8_t *stickname = SDL_JoystickName(i);
if ((envr != NULL) && (strcmp(envr, stickname) == 0))
favored = i;
@@ -1010,7 +1010,7 @@
static __inline void init_debugging(void)
{
- const char *envr = getenv(BUILD_SDLDEBUG);
+ const uint8_t *envr = getenv(BUILD_SDLDEBUG);
debug_hall_of_mirrors = (getenv(BUILD_HALLOFMIRRORS) != NULL);
@@ -1071,9 +1071,9 @@
/* lousy -ansi flag. :) */
-static char *string_dupe(const char *str)
+static uint8_t *string_dupe(const uint8_t *str)
{
- char *retval = malloc(strlen(str) + 1);
+ uint8_t *retval = malloc(strlen(str) + 1);
if (retval != NULL)
strcpy(retval, str);
return(retval);
@@ -1082,7 +1082,7 @@
void set_sdl_renderer(void)
{
- const char *envr = getenv(BUILD_RENDERER);
+ const uint8_t *envr = getenv(BUILD_RENDERER);
#ifdef USE_OPENGL
int need_opengl_lib = 0;
@@ -1182,11 +1182,11 @@
}
-void _platform_init(int argc, char **argv, const char *title, const char *icon)
+void _platform_init(int argc, uint8_t **argv, const uint8_t *title, const uint8_t *icon)
{
int i;
int32_t timeElapsed;
- char dummyString[4096];
+ uint8_t dummyString[4096];
_argc = argc;
_argv = argv;
@@ -1388,7 +1388,7 @@
// Capture BMP of the current frame
-int screencapture(char *filename, char inverseit)
+int screencapture(uint8_t *filename, uint8_t inverseit)
{
// FIX_00006: better naming system for screenshots + message when pic is taken.
// Use ./screenshots folder. Screenshot code rerwritten. Faster and
@@ -1411,7 +1411,7 @@
}
-int _setgamemode(char davidoption, int32_t daxdim, int32_t daydim)
+int _setgamemode(uint8_t davidoption, int32_t daxdim, int32_t daydim)
{
int validated, i;
SDL_Surface *image;
@@ -1462,10 +1462,10 @@
{
if (!shown_gl_strings)
{
- sgldebug("GL_VENDOR [%s]", (char *) dglGetString(GL_VENDOR));
- sgldebug("GL_RENDERER [%s]", (char *) dglGetString(GL_RENDERER));
- sgldebug("GL_VERSION [%s]", (char *) dglGetString(GL_VERSION));
- sgldebug("GL_EXTENSIONS [%s]", (char *) dglGetString(GL_EXTENSIONS));
+ sgldebug("GL_VENDOR [%s]", (uint8_t *) dglGetString(GL_VENDOR));
+ sgldebug("GL_RENDERER [%s]", (uint8_t *) dglGetString(GL_RENDERER));
+ sgldebug("GL_VERSION [%s]", (uint8_t *) dglGetString(GL_VERSION));
+ sgldebug("GL_EXTENSIONS [%s]", (uint8_t *) dglGetString(GL_EXTENSIONS));
shown_gl_strings = 1;
} /* if */
@@ -1491,10 +1491,10 @@
} /* setgamemode */
-static int get_dimensions_from_str(const char *str, int32_t *_w, int32_t *_h)
+static int get_dimensions_from_str(const uint8_t *str, int32_t *_w, int32_t *_h)
{
- char *xptr = NULL;
- char *ptr = NULL;
+ uint8_t *xptr = NULL;
+ uint8_t *ptr = NULL;
int32_t w = -1;
int32_t h = -1;
@@ -1531,7 +1531,7 @@
{
int32_t w = DEFAULT_MAXRESWIDTH;
int32_t h = DEFAULT_MAXRESHEIGHT;
- const char *envr = getenv(BUILD_MAXSCREENRES);
+ const uint8_t *envr = getenv(BUILD_MAXSCREENRES);
if (envr != NULL)
{
@@ -1551,7 +1551,7 @@
} /* get_max_screen_res */
-static void add_vesa_mode(const char *typestr, int w, int h)
+static void add_vesa_mode(const uint8_t *typestr, int w, int h)
{
sdldebug("Adding %s resolution (%dx%d).", typestr, w, h);
validmode[validmodecnt] = validmodecnt;
@@ -1566,7 +1566,7 @@
{
int32_t w;
int32_t h;
- const char *envr = getenv(BUILD_USERSCREENRES);
+ const uint8_t *envr = getenv(BUILD_USERSCREENRES);
if (envr == NULL)
return;
@@ -1602,7 +1602,7 @@
} /* get_physical_resolutions */
-static void remove_vesa_mode(int index, const char *reason)
+static void remove_vesa_mode(int index, const uint8_t *reason)
{
int i;
@@ -1698,8 +1698,8 @@
static __inline void output_vesa_modelist(void)
{
- char buffer[256];
- char numbuf[20];
+ uint8_t buffer[256];
+ uint8_t numbuf[20];
int i;
if (!_sdl_debug_file)
@@ -1759,7 +1759,7 @@
} /* getvalidvesamodes */
-int VBE_setPalette(int32_t start, int32_t num, char *palettebuffer)
+int VBE_setPalette(int32_t start, int32_t num, uint8_t *palettebuffer)
/*
* (From Ken's docs:)
* Set (num) palette palette entries starting at (start)
@@ -1776,7 +1776,7 @@
{
SDL_Color fmt_swap[256];
SDL_Color *sdlp = &fmt_swap[start];
- char *p = palettebuffer;
+ uint8_t *p = palettebuffer;
int i;
#if (defined USE_OPENGL)
@@ -1830,10 +1830,10 @@
} /* VBE_setPalette */
-int VBE_getPalette(int32_t start, int32_t num, char *palettebuffer)
+int VBE_getPalette(int32_t start, int32_t num, uint8_t *palettebuffer)
{
SDL_Color *sdlp = surface->format->palette->colors + start;
- char *p = palettebuffer + (start * 4);
+ uint8_t *p = palettebuffer + (start * 4);
int i;
for (i = 0; i < num; i++)
@@ -2072,10 +2072,10 @@
/* Most of this line code is taken from Abrash's "Graphics Programming Blackbook".
Remember, sharing code is A Good Thing. AH */
-static __inline void DrawHorizontalRun (char **ScreenPtr, int XAdvance, int RunLength, char Color)
+static __inline void DrawHorizontalRun (uint8_t **ScreenPtr, int XAdvance, int RunLength, uint8_t Color)
{
int i;
- char *WorkingScreenPtr = *ScreenPtr;
+ uint8_t *WorkingScreenPtr = *ScreenPtr;
for (i=0; i<RunLength; i++)
{
@@ -2086,10 +2086,10 @@
*ScreenPtr = WorkingScreenPtr;
}
-static __inline void DrawVerticalRun (char **ScreenPtr, int XAdvance, int RunLength, char Color)
+static __inline void DrawVerticalRun (uint8_t **ScreenPtr, int XAdvance, int RunLength, uint8_t Color)
{
int i;
- char *WorkingScreenPtr = *ScreenPtr;
+ uint8_t *WorkingScreenPtr = *ScreenPtr;
for (i=0; i<RunLength; i++)
{
@@ -2100,11 +2100,11 @@
*ScreenPtr = WorkingScreenPtr;
}
-void drawline16(int32_t XStart, int32_t YStart, int32_t XEnd, int32_t YEnd, char Color)
+void drawline16(int32_t XStart, int32_t YStart, int32_t XEnd, int32_t YEnd, uint8_t Color)
{
int Temp, AdjUp, AdjDown, ErrorTerm, XAdvance, XDelta, YDelta;
int WholeStep, InitialPixelCount, FinalPixelCount, i, RunLength;
- char *ScreenPtr;
+ uint8_t *ScreenPtr;
int32_t dx, dy;
if (SDL_MUSTLOCK(surface))
@@ -2150,7 +2150,7 @@
}
/* Point to the bitmap address first pixel to draw */
- ScreenPtr = (char *) (get_framebuffer()) + XStart + (surface->w * YStart);
+ ScreenPtr = (uint8_t *) (get_framebuffer()) + XStart + (surface->w * YStart);
/* Figure out whether we're going left or right, and how far we're going horizontally */
if ((XDelta = XEnd - XStart) < 0)
--- a/Game/src/DbgHelp.h
+++ b/Game/src/DbgHelp.h
@@ -1520,7 +1520,7 @@
typedef struct _IMAGEHLP_SYMBOL_SRC {
DWORD sizeofstruct;
DWORD type;
- char file[MAX_PATH];
+ uint8_t file[MAX_PATH];
} IMAGEHLP_SYMBOL_SRC, *PIMAGEHLP_SYMBOL_SRC;
typedef struct _MODULE_TYPE_INFO { // AKA TYPTYP
--- a/Game/src/_functio.h
+++ b/Game/src/_functio.h
@@ -37,7 +37,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-char * gamefunctions[] =
+uint8_t * gamefunctions[] =
{
"Move_Forward",
"Move_Backward",
@@ -102,9 +102,9 @@
// if not found and use default keys.
struct {
- char* entryKey;
- char* keyname1;
- char* keyname2;
+ uint8_t * entryKey;
+ uint8_t * keyname1;
+ uint8_t * keyname2;
} keydefaults[] = {
{ "Move_Forward", "Up", "Kpad8" },
{ "Move_Backward", "Down", "Kpad2" },
--- a/Game/src/_rts.h
+++ b/Game/src/_rts.h
@@ -33,13 +33,13 @@
typedef struct
{
- char name[8];
+ uint8_t name[8];
int32 handle,position,size;
} lumpinfo_t;
typedef struct
{
- char identification[4]; // should be IWAD
+ uint8_t identification[4]; // should be IWAD
int32 numlumps;
int32 infotableofs;
} wadinfo_t;
@@ -48,7 +48,7 @@
{
int32 filepos;
int32 size;
- char name[8];
+ uint8_t name[8];
} filelump_t;
#endif
--- a/Game/src/actors.c
+++ b/Game/src/actors.c
@@ -27,7 +27,7 @@
#include "duke3d.h"
extern int32_t numenvsnds;
-char actor_tog;
+uint8_t actor_tog;
void updateinterpolations() //Stick at beginning of domovethings
{
@@ -406,7 +406,7 @@
int32_t ifsquished(short i, short p)
{
sectortype *sc;
- char squishme;
+ uint8_t squishme;
int32_t floorceildist;
if(PN == APLAYER && ud.clipping)
@@ -449,7 +449,7 @@
int32_t d, q, x1, y1;
int32_t sectcnt, sectend, dasect, startwall, endwall, nextsect;
short j,k,p,x,nextj,sect;
- char statlist[] = {0,1,6,10,12,2,5};
+ uint8_t statlist[] = {0,1,6,10,12,2,5};
short *tempshort = (short *)tempbuf;
s = &sprite[i];
@@ -627,7 +627,7 @@
{
int32_t daz,h, oldx, oldy;
short retval, dasectnum, cd;
- char bg;
+ uint8_t bg;
bg = badguy(&sprite[spritenum]);
@@ -773,7 +773,7 @@
{
int32_t gutz,floorz;
short i,a,j;
- char sx,sy;
+ uint8_t sx,sy;
int8_t pal;
if(badguy(s) && s->xrepeat < 16)
@@ -811,7 +811,7 @@
{
int32_t gutz,floorz;
short i,a,j;
- char sx,sy;
+ uint8_t sx,sy;
if(badguy(s) && s->xrepeat < 16)
sx = sy = 8;
@@ -1097,7 +1097,7 @@
{
short q, j, x, t, s, *c;
walltype *wal;
- char cshade;
+ uint8_t cshade;
for(q=numcyclers-1;q>=0;q--)
{
@@ -2796,7 +2796,7 @@
void movetransports(void)
{
- char warpspriteto;
+ uint8_t warpspriteto;
short i, j, k, l, p, sect, sectlotag, nexti, nextj;
int32_t ll,onfloorz,q;
@@ -5171,8 +5171,8 @@
if(s->owner == -1)
{
- sprintf((char*)tempbuf,"Could not find any locators for SE# 6 and 14 with a hitag of %ld.\n",t[3]);
- gameexit((char*)tempbuf);
+ sprintf((uint8_t *)tempbuf,"Could not find any locators for SE# 6 and 14 with a hitag of %ld.\n",t[3]);
+ gameexit((uint8_t *)tempbuf);
}
j = ldist(&sprite[s->owner],s);
--- a/Game/src/animlib.c
+++ b/Game/src/animlib.c
@@ -55,7 +55,7 @@
//
//****************************************************************************
-void CheckAnimStarted ( char * funcname )
+void CheckAnimStarted ( uint8_t * funcname )
{
if (!Anim_Started)
Error(EXIT_FAILURE, "ANIMLIB_%s: Anim has not been initialized\n",funcname);
@@ -126,7 +126,7 @@
nextOp:
- cnt = (signed char) *srcP++;
+ cnt = (int8_t ) *srcP++;
if (cnt > 0)
goto dump;
if (cnt == 0)
--- a/Game/src/audiolib/fx_man.h
+++ b/Game/src/audiolib/fx_man.h
@@ -78,7 +78,7 @@
};
-char *FX_ErrorString( int ErrorNumber );
+uint8_t *FX_ErrorString( int ErrorNumber );
int FX_SetupCard( int SoundCard, fx_device *device );
int FX_GetBlasterSettings( fx_blaster_config *blaster );
int FX_SetupSoundBlaster( fx_blaster_config blaster, int *MaxVoices, int *MaxSampleBits, int *MaxChannels );
@@ -102,25 +102,25 @@
int FX_SetPitch( int handle, int pitchoffset );
int FX_SetFrequency( int handle, int frequency );
-int FX_PlayVOC( char *ptr, int pitchoffset, int vol, int left, int right,
+int FX_PlayVOC( uint8_t *ptr, int pitchoffset, int vol, int left, int right,
int priority, uint32_t callbackval );
-int FX_PlayLoopedVOC( char *ptr, int32_t loopstart, int32_t loopend,
+int FX_PlayLoopedVOC( uint8_t *ptr, int32_t loopstart, int32_t loopend,
int32_t pitchoffset, int32_t vol, int32_t left, int32_t right, int32_t priority,
uint32_t callbackval );
-int FX_PlayWAV( char *ptr, int pitchoffset, int vol, int left, int right,
+int FX_PlayWAV( uint8_t *ptr, int pitchoffset, int vol, int left, int right,
int priority, uint32_t callbackval );
-int FX_PlayLoopedWAV( char *ptr, int32_t loopstart, int32_t loopend,
+int FX_PlayLoopedWAV( uint8_t *ptr, int32_t loopstart, int32_t loopend,
int pitchoffset, int vol, int left, int right, int priority,
uint32_t callbackval );
-int FX_PlayVOC3D( char *ptr, int32_t pitchoffset, int32_t angle, int32_t distance,
+int FX_PlayVOC3D( uint8_t *ptr, int32_t pitchoffset, int32_t angle, int32_t distance,
int priority, uint32_t callbackval );
-int FX_PlayWAV3D( char *ptr, int pitchoffset, int angle, int distance,
+int FX_PlayWAV3D( uint8_t *ptr, int pitchoffset, int angle, int distance,
int priority, uint32_t callbackval );
-int FX_PlayRaw( char *ptr, uint32_t length, uint32_t rate,
+int FX_PlayRaw( uint8_t *ptr, uint32_t length, uint32_t rate,
int pitchoffset, int vol, int left, int right, int priority,
uint32_t callbackval );
-int FX_PlayLoopedRaw( char *ptr, uint32_t length, char *loopstart,
- char *loopend, unsigned rate, int pitchoffset, int vol, int left,
+int FX_PlayLoopedRaw( uint8_t *ptr, uint32_t length, uint8_t *loopstart,
+ uint8_t *loopend, unsigned rate, int pitchoffset, int vol, int left,
int right, int priority, uint32_t callbackval );
int32_t FX_Pan3D( int handle, int angle, int distance );
int32_t FX_SoundActive( int32_t handle );
@@ -127,10 +127,10 @@
int32_t FX_SoundsPlaying( void );
int32_t FX_StopSound( int handle );
int32_t FX_StopAllSounds( void );
-int32_t FX_StartDemandFeedPlayback( void ( *function )( char **ptr, uint32_t *length ),
+int32_t FX_StartDemandFeedPlayback( void ( *function )( uint8_t **ptr, uint32_t *length ),
int32_t rate, int32_t pitchoffset, int32_t vol, int32_t left, int32_t right,
int32_t priority, uint32_t callbackval );
-int FX_StartRecording( int MixRate, void ( *function )( char *ptr, int length ) );
+int FX_StartRecording( int MixRate, void ( *function )( uint8_t *ptr, int length ) );
void FX_StopRecord( void );
#endif
--- a/Game/src/audiolib/music.h
+++ b/Game/src/audiolib/music.h
@@ -66,7 +66,7 @@
#define MUSIC_LoopSong ( 1 == 1 )
#define MUSIC_PlayOnce ( !MUSIC_LoopSong )
-char *MUSIC_ErrorString( int ErrorNumber );
+uint8_t *MUSIC_ErrorString( int ErrorNumber );
int MUSIC_Init( int SoundCard, int Address );
int MUSIC_Shutdown( void );
void MUSIC_SetMaxFMMidiChannel( int channel );
--- a/Game/src/config.c
+++ b/Game/src/config.c
@@ -81,7 +81,7 @@
int32 mouseSensitivity_X;
int32 mouseSensitivity_Y;
-static char setupfilename[512];//={SETUPFILENAME};
+static uint8_t setupfilename[512];//={SETUPFILENAME};
static int32 scripthandle;
static int32 setupread=0;
/*
@@ -149,7 +149,7 @@
===================
*/
-int32 CONFIG_FunctionNameToNum( char * func )
+int32 CONFIG_FunctionNameToNum( uint8_t * func )
{
int32 i;
@@ -171,7 +171,7 @@
===================
*/
-char * CONFIG_FunctionNumToName( int32 func )
+uint8_t * CONFIG_FunctionNumToName( int32 func )
{
if (-1 < func && func < NUMGAMEFUNCTIONS)
{
@@ -192,7 +192,7 @@
*/
-int32 CONFIG_AnalogNameToNum( char * func )
+int32 CONFIG_AnalogNameToNum( uint8_t * func )
{
if (!stricmp(func,"analog_turning"))
@@ -295,8 +295,8 @@
int32 i;
int32 numkeyentries;
int32 function;
- char keyname1[80];
- char keyname2[80];
+ uint8_t keyname1[80];
+ uint8_t keyname2[80];
kb_scancode key1,key2;
// set default keys in case duke3d.cfg was not found
@@ -356,8 +356,8 @@
void CONFIG_SetupMouse( int32 scripthandle )
{
int32 i;
- char str[80];
- char temp[80];
+ uint8_t str[80];
+ uint8_t temp[80];
int32 function, scale;
for (i=0;i<MAXMOUSEBUTTONS;i++)
@@ -424,8 +424,8 @@
void CONFIG_SetupGamePad( int32 scripthandle )
{
int32 i;
- char str[80];
- char temp[80];
+ uint8_t str[80];
+ uint8_t temp[80];
int32 function;
@@ -475,8 +475,8 @@
void CONFIG_SetupJoystick( int32 scripthandle )
{
int32 i, j;
- char str[80];
- char temp[80];
+ uint8_t str[80];
+ uint8_t temp[80];
int32 function, deadzone;
float scale;
@@ -554,9 +554,9 @@
{
int32_t dummy;
short i;
- char fn[] = "game_.sav";
+ uint8_t fn[] = "game_.sav";
FILE *fil;
- char fullpathsavefilename[16];
+ uint8_t fullpathsavefilename[16];
for (i=0;i<10;i++)
@@ -605,7 +605,7 @@
void CONFIG_ReadSetup( void )
{
int32 dummy;
- char commmacro[] = COMMMACRO;
+ uint8_t commmacro[] = COMMMACRO;
FILE* setup_file_hdl;
printf("CONFIG_ReadSetup...\n");
@@ -811,7 +811,7 @@
void CONFIG_WriteSetup( void )
{
int32 dummy, i;
- char commmacro[] = COMMMACRO;
+ uint8_t commmacro[] = COMMMACRO;
if (!setupread) return;
@@ -857,15 +857,15 @@
// FIX_00016: Build in Keyboard/mouse setup. Mouse now faster.
for(i=0; i<MAXMOUSEBUTTONS; i++)
{
- sprintf((char*)tempbuf, "MouseButton%d", i);
- SCRIPT_PutString(scripthandle, "Controls", (char*)tempbuf,
+ sprintf((uint8_t *)tempbuf, "MouseButton%d", i);
+ SCRIPT_PutString(scripthandle, "Controls", (uint8_t *)tempbuf,
(MouseMapping[i]!=-1)?CONFIG_FunctionNumToName(MouseMapping[i]):"");
}
for (i=0;i<MAXMOUSEAXES*2;i++)
{
- sprintf((char*)tempbuf, "MouseDigitalAxes%ld_%d", i>>1, i&1);
- SCRIPT_PutString(scripthandle, "Controls", (char*)tempbuf,
+ sprintf((uint8_t *)tempbuf, "MouseDigitalAxes%ld_%d", i>>1, i&1);
+ SCRIPT_PutString(scripthandle, "Controls", (uint8_t *)tempbuf,
(MouseDigitalAxeMapping[i>>1][i&1]!=-1)?CONFIG_FunctionNumToName(MouseDigitalAxeMapping[i>>1][i&1]):"");
}
--- a/Game/src/console.c
+++ b/Game/src/console.c
@@ -16,19 +16,19 @@
typedef struct console_element
{
- char text[MAX_CONSOLE_STRING_LENGTH];
+ uint8_t text[MAX_CONSOLE_STRING_LENGTH];
void* prev;
void* next;
}CONSOLEELEMENT;
// Private member functions
-void CONSOLE_InsertUsedCommand(const char* szUsedCommand);
+void CONSOLE_InsertUsedCommand(const uint8_t * szUsedCommand);
void CONSOLE_ClearUsedCommandList();
void CONSOLE_RecalculateDirtyBuffer();
// console argument tracker
int argc;
-char argv[MAX_CVAR_ARGS][MAX_CONSOLE_STRING_LENGTH];
+uint8_t argv[MAX_CVAR_ARGS][MAX_CONSOLE_STRING_LENGTH];
// Console entries, prepending linked list
CONSOLEELEMENT *console_buffer = NULL;
// Current viewed setion of the console
@@ -39,7 +39,7 @@
CONSOLEELEMENT *console_used_command_list_current = NULL;
// dirty buffer
-char dirty_buffer[MAX_CONSOLE_STRING_LENGTH];
+uint8_t dirty_buffer[MAX_CONSOLE_STRING_LENGTH];
// dirty buffer control vars
int console_cursor_pos = 0; //without spaces
@@ -92,7 +92,7 @@
void CONSOLE_ParseStartupScript()
{
// FIX_00017: heavy autoexec.cfg not needed anymore.
- char *sStartupScript = "startup.cfg";
+ uint8_t *sStartupScript = "startup.cfg";
FILE* fp = fopen(sStartupScript, "r");
@@ -99,7 +99,7 @@
// If the file exists
if(NULL != fp)
{
- char line[128];
+ uint8_t line[128];
memset(line, 0, 128);
while(fgets(line ,128-1, fp) != NULL)
@@ -114,7 +114,7 @@
void CONSOLE_HandleInput()
{
- char* lastKey;
+ uint8_t * lastKey;
int tmp;
if(g_CV_classic)
@@ -441,10 +441,10 @@
}
}
-void CONSOLE_ParseCommand(char* command)
+void CONSOLE_ParseCommand(uint8_t * command)
{
- char *cvar;
- char *token;
+ uint8_t *cvar;
+ uint8_t *token;
int i, numCvars;
argc = 0;
@@ -486,7 +486,7 @@
}
-void CONSOLE_InsertUsedCommand(const char* szUsedCommand)
+void CONSOLE_InsertUsedCommand(const uint8_t * szUsedCommand)
{
//create a new element in the list, and add it to the front
CONSOLEELEMENT *pElement = (CONSOLEELEMENT*)malloc(sizeof(CONSOLEELEMENT));
@@ -558,11 +558,11 @@
}
-void CONSOLE_Printf(const char *newmsg, ...)
+void CONSOLE_Printf(const uint8_t *newmsg, ...)
{
CONSOLEELEMENT *pElement;
va_list argptr;
- char msg[512];//[MAX_CONSOLE_STRING_LENGTH];
+ uint8_t msg[512];//[MAX_CONSOLE_STRING_LENGTH];
va_start (argptr,newmsg);
vsprintf (msg, newmsg, argptr);
va_end (argptr);
@@ -608,7 +608,7 @@
}
// Get the current list of args for this keyword
-char* CONSOLE_GetArgv(unsigned int var)
+uint8_t * CONSOLE_GetArgv(unsigned int var)
{
return argv[var];
}
--- a/Game/src/console.h
+++ b/Game/src/console.h
@@ -9,10 +9,10 @@
void CONSOLE_ParseStartupScript();
void CONSOLE_HandleInput();
void CONSOLE_Render();
-void CONSOLE_ParseCommand(char* command);
-void CONSOLE_Printf(const char *newmsg, ...);
+void CONSOLE_ParseCommand(uint8_t * command);
+void CONSOLE_Printf(const uint8_t *newmsg, ...);
int CONSOLE_GetArgc();
-char* CONSOLE_GetArgv(unsigned int var);
+uint8_t * CONSOLE_GetArgv(unsigned int var);
int CONSOLE_IsActive();
void CONSOLE_SetActive(int i);
--- a/Game/src/cvar_defs.c
+++ b/Game/src/cvar_defs.c
@@ -65,7 +65,7 @@
if(g_CV_DebugJoystick)
{
int i;
- char buf[128];
+ uint8_t buf[128];
minitext(2, 2, "Debug Joystick", 17,10+16);
for(i = 0; i < MAXJOYAXES; i++)
@@ -99,7 +99,7 @@
if(g_CV_DebugSound)
{
- char buf[128];
+ uint8_t buf[128];
minitext(2, 2, "Debug Sound", 17,10+16);
sprintf(buf, "Active sounds: %lu", sounddebugActiveSounds);
@@ -297,7 +297,7 @@
for(i=connecthead;i>=0;i=connectpoint2[i])
{
- sendpacket(i,(char*)tempbuf,11); //And send the packet to everyone
+ sendpacket(i,(uint8_t *)tempbuf,11); //And send the packet to everyone
}
}
else ps[myconnectindex].gm |= MODE_RESTART; //Otherwise just restart the game
@@ -326,7 +326,7 @@
void CVARDEFS_FunctionHelp(void* var)
{
int i, numArgs, numCvars;
- char *helpcmd = CONSOLE_GetArgv(0);
+ uint8_t *helpcmd = CONSOLE_GetArgv(0);
numCvars = CVAR_GetNumCvarBindings();
numArgs = CONSOLE_GetArgc();
--- a/Game/src/cvars.c
+++ b/Game/src/cvars.c
@@ -9,7 +9,7 @@
cvar_binding cvar_binding_list[MAX_CVARS];
int num_cvar_bindings = 0;
-void CVAR_RegisterCvar(const char* varname, const char* varhelp, void* variable, function_t function)
+void CVAR_RegisterCvar(const uint8_t * varname, const uint8_t * varhelp, void* variable, function_t function)
{
if(NULL == function)
{
--- a/Game/src/cvars.h
+++ b/Game/src/cvars.h
@@ -4,18 +4,20 @@
#define REGCONVAR(varname, varhelp, variable, function) CVAR_RegisterCvar(varname, varhelp, &variable, &function)
#define REGCONFUNC(varname, varhelp, function) CVAR_RegisterCvar(varname, varhelp, NULL, &function)
+#include <inttypes.h>
+
typedef void (*function_t) (void* binding);
typedef struct t_cvar_binding
{
- char name[64];
- char help[64];
+ uint8_t name[64];
+ uint8_t help[64];
void* variable;
function_t function;
} cvar_binding;
-void CVAR_RegisterCvar(const char* varname, const char* varhelp, void* variable, function_t function);
+void CVAR_RegisterCvar(const uint8_t * varname, const uint8_t * varhelp, void* variable, function_t function);
int CVAR_GetNumCvarBindings();
cvar_binding* CVAR_GetCvarBinding(unsigned int nBinding);
void CVAR_Render();
--- a/Game/src/duke3d.h
+++ b/Game/src/duke3d.h
@@ -355,8 +355,8 @@
typedef struct
{
- char *ptr;
- char lock;
+ uint8_t *ptr;
+ uint8_t lock;
int length, num;
} SAMPLE;
@@ -368,22 +368,22 @@
extern struct animwalltype animwall[MAXANIMWALLS];
extern short numanimwalls,probey,lastprobey;
-extern char *mymembuf;
-extern char typebuflen,typebuf[41];
-extern char MusicPtr[72000];
+extern uint8_t *mymembuf;
+extern uint8_t typebuflen,typebuf[41];
+extern uint8_t MusicPtr[72000];
extern int32_t msx[2048],msy[2048];
extern short cyclers[MAXCYCLERS][6],numcyclers;
-extern char myname[2048];
+extern uint8_t myname[2048];
struct user_defs
{
- char god,warp_on,cashman,eog,showallmap;
- char show_help,scrollmode,clipping;
- char user_name[MAXPLAYERS][32];
- char ridecule[10][40];
- char savegame[10][22];
- char pwlockout[128],rtsname[128];
- char overhead_on,last_overhead;
+ uint8_t god,warp_on,cashman,eog,showallmap;
+ uint8_t show_help,scrollmode,clipping;
+ uint8_t user_name[MAXPLAYERS][32];
+ uint8_t ridecule[10][40];
+ uint8_t savegame[10][22];
+ uint8_t pwlockout[128],rtsname[128];
+ uint8_t overhead_on,last_overhead;
short pause_on,from_bonus;
short camerasprite,last_camsprite;
@@ -408,13 +408,13 @@
int32 weaponautoswitch;
// FIX_00015: Backward compliance with older demos (down to demos v27, 28, 116 and 117 only)
- char playing_demo_rev;
+ uint8_t playing_demo_rev;
uint32_t groupefil_crc32[MAXPLAYERS][MAXGROUPFILES];
unsigned short conSize[MAXPLAYERS];
#ifdef CHECK_XDUKE_REV
- char rev[MAXPLAYERS][10];
+ uint8_t rev[MAXPLAYERS][10];
#endif
uint32_t mapCRC[MAXPLAYERS];
uint32_t exeCRC[MAXPLAYERS];
@@ -428,13 +428,13 @@
};
-extern char numplayersprites;
-extern char picsiz[MAXTILES];
+extern uint8_t numplayersprites;
+extern uint8_t picsiz[MAXTILES];
typedef struct
{
unsigned int crc32;
- char* name;
+ uint8_t * name;
uint32_t size;
} crc32_t;
@@ -481,20 +481,20 @@
int scream_voice;
- char gm,on_warping_sector,footprintcount;
- char hbomb_on,jumping_toggle,rapid_fire_hold,on_ground;
- char name[32],inven_icon,buttonpalette;
+ uint8_t gm,on_warping_sector,footprintcount;
+ uint8_t hbomb_on,jumping_toggle,rapid_fire_hold,on_ground;
+ uint8_t name[32],inven_icon,buttonpalette;
- char jetpack_on,spritebridge,lastrandomspot;
- char scuba_on,footprintpal,heat_on;
+ uint8_t jetpack_on,spritebridge,lastrandomspot;
+ uint8_t scuba_on,footprintpal,heat_on;
- char holster_weapon,falling_counter;
- char gotweapon[MAX_WEAPONS],refresh_inventory,*palette;
+ uint8_t holster_weapon,falling_counter;
+ uint8_t gotweapon[MAX_WEAPONS],refresh_inventory,*palette;
- char toggle_key_flag,knuckle_incs; // ,select_dir;
- char walking_snd_toggle, palookup, hard_landing;
- char max_secret_rooms,secret_rooms,/*fire_flag,*/pals[3];
- char max_actors_killed,actors_killed,return_to_center;
+ uint8_t toggle_key_flag,knuckle_incs; // ,select_dir;
+ uint8_t walking_snd_toggle, palookup, hard_landing;
+ uint8_t max_secret_rooms,secret_rooms,/*fire_flag,*/pals[3];
+ uint8_t max_actors_killed,actors_killed,return_to_center;
// local but synch variables (ud is local but not synch):
@@ -506,7 +506,7 @@
// affect the opponent's gameplay (so he can still hear you picking up new weapons)
int32 weaponautoswitch;
- char fakeplayer;
+ uint8_t fakeplayer;
};
extern uint8_t tempbuf[2048], packbuf[576];
@@ -529,11 +529,11 @@
extern short int global_random;
extern int32_t scaredfallz;
-extern char buf[80]; //My own generic input buffer
+extern uint8_t buf[80]; //My own generic input buffer
-extern char fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
-extern char scantoasc[128],ready2send;
-extern char scantoascwithshift[128];
+extern uint8_t fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
+extern uint8_t scantoasc[128],ready2send;
+extern uint8_t scantoascwithshift[128];
extern fx_device device;
extern SAMPLE Sound[ NUM_SOUNDS ];
@@ -541,28 +541,28 @@
extern int32 mouseSensitivity_X, mouseSensitivity_Y;
extern SOUNDOWNER SoundOwner[NUM_SOUNDS][4];
-extern char playerreadyflag[MAXPLAYERS],playerquitflag[MAXPLAYERS];
-extern char sounds[NUM_SOUNDS][14];
+extern uint8_t playerreadyflag[MAXPLAYERS],playerquitflag[MAXPLAYERS];
+extern uint8_t sounds[NUM_SOUNDS][14];
extern int32_t script[MAXSCRIPTSIZE],*scriptptr,*insptr,*labelcode,labelcnt;
-extern char *label,*textptr,error,warning,killit_flag;
+extern uint8_t *label,*textptr,error,warning,killit_flag;
extern int32_t *actorscrptr[MAXTILES],*parsing_actor;
-extern char actortype[MAXTILES];
-extern char *music_pointer;
+extern uint8_t actortype[MAXTILES];
+extern uint8_t *music_pointer;
-extern char ipath[80],opath[80];
+extern uint8_t ipath[80],opath[80];
-extern char music_fn[4][11][13],music_select;
-extern char env_music_fn[4][13];
+extern uint8_t music_fn[4][11][13],music_select;
+extern uint8_t env_music_fn[4][13];
extern short camsprite;
-// extern char gotz;
-extern char inspace(short sectnum);
+// extern uint8_t gotz;
+extern uint8_t inspace(short sectnum);
struct weaponhit
{
- char cgg;
+ uint8_t cgg;
short picnum,ang,extra,owner,movflag;
short tempang,actorstayput,dispicnum;
short timetosleep;
@@ -583,7 +583,7 @@
extern int current_menu;
extern int32_t tempwallptr,animatecnt;
extern int32_t lockclock,frameplace;
-extern char display_mirror,rtsplaying;
+extern uint8_t display_mirror,rtsplaying;
extern int32_t movefifoend[MAXPLAYERS];
extern int32_t ototalclock;
@@ -606,33 +606,33 @@
#include "funct.h"
#include "engine_protos.h"
-extern char screencapt;
+extern uint8_t screencapt;
extern short soundps[NUM_SOUNDS],soundpe[NUM_SOUNDS],soundvo[NUM_SOUNDS];
-extern char soundpr[NUM_SOUNDS],soundm[NUM_SOUNDS];
+extern uint8_t soundpr[NUM_SOUNDS],soundm[NUM_SOUNDS];
extern int32_t soundsiz[NUM_SOUNDS];
-extern char level_names[44][33];
+extern uint8_t level_names[44][33];
extern int32_t partime[44],designertime[44];
-extern char volume_names[4][33];
-extern char skill_names[5][33];
-extern char level_file_names[44][128];
+extern uint8_t volume_names[4][33];
+extern uint8_t skill_names[5][33];
+extern uint8_t level_file_names[44][128];
extern int32 SoundToggle,MusicToggle;
extern short last_threehundred,lastsavedpos;
-extern char restorepalette;
+extern uint8_t restorepalette;
extern short buttonstat;
extern int32_t cachecount;
-extern char boardfilename[128],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768];
-extern char betaname[80];
-extern char cachedebug,earthquaketime;
-extern char networkmode;
-extern char lumplockbyte[11];
+extern uint8_t boardfilename[128],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768];
+extern uint8_t betaname[80];
+extern uint8_t cachedebug,earthquaketime;
+extern uint8_t networkmode;
+extern uint8_t lumplockbyte[11];
//DUKE3D.H - replace the end "my's" with this
extern int32_t myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel;
extern short myhoriz, omyhoriz, myhorizoff, omyhorizoff, globalskillsound;
extern short myang, omyang, mycursectnum, myjumpingcounter;
-extern char myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
+extern uint8_t myjumpingtoggle, myonground, myhardlanding,myreturntocenter;
extern int32_t fakemovefifoplc;
extern int32_t myxbak[MOVEFIFOSIZ], myybak[MOVEFIFOSIZ], myzbak[MOVEFIFOSIZ];
extern int32_t myhorizbak[MOVEFIFOSIZ];
@@ -648,7 +648,7 @@
{
short frag[MAXPLAYERS], got_access, last_extra, shield_amount, curr_weapon;
short ammo_amount[MAX_WEAPONS], holoduke_on;
- char gotweapon[MAX_WEAPONS], inven_icon, jetpack_on, heat_on;
+ uint8_t gotweapon[MAX_WEAPONS], inven_icon, jetpack_on, heat_on;
short firstaid_amount, steroids_amount, holoduke_amount, jetpack_amount;
short heat_amount, scuba_amount, boot_amount;
short last_weapon, weapon_pos, kickback_pic;
@@ -658,17 +658,17 @@
extern STATUSBARTYPE sbar;
extern short frags[MAXPLAYERS][MAXPLAYERS];
extern int32_t cameradist, cameraclock, dukefriction,show_shareware;
-extern char networkmode, movesperpacket;
-extern char gamequit;
+extern uint8_t networkmode, movesperpacket;
+extern uint8_t gamequit;
-extern char pus,pub,camerashitable,freezerhurtowner,lasermode;
-extern char syncstat, syncval[MAXPLAYERS][MOVEFIFOSIZ];
+extern uint8_t pus,pub,camerashitable,freezerhurtowner,lasermode;
+extern uint8_t syncstat, syncval[MAXPLAYERS][MOVEFIFOSIZ];
extern int8_t multiwho, multipos, multiwhat, multiflag;
extern int32_t syncvalhead[MAXPLAYERS], syncvaltail, syncvaltottail;
extern int32_t numfreezebounces,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
// CTW - MODIFICATION
-// extern char stereo,eightytwofifty,playerswhenstarted,playonten,everyothertime;
-extern char stereo,eightytwofifty,playerswhenstarted,everyothertime;
+// extern uint8_t stereo,eightytwofifty,playerswhenstarted,playonten,everyothertime;
+extern uint8_t stereo,eightytwofifty,playerswhenstarted,everyothertime;
// CTW END - MODIFICATION
extern int32_t myminlag[MAXPLAYERS], mymaxlag, otherminlag, bufferjitter;
--- a/Game/src/dukeunix.h
+++ b/Game/src/dukeunix.h
@@ -41,10 +41,10 @@
struct find_t
{
DIR *dir;
- char pattern[MAX_PATH];
- char name[MAX_PATH];
+ uint8_t pattern[MAX_PATH];
+ uint8_t name[MAX_PATH];
};
-int _dos_findfirst(char *filename, int x, struct find_t *f);
+int _dos_findfirst(uint8_t *filename, int x, struct find_t *f);
int _dos_findnext(struct find_t *f);
struct dosdate_t
@@ -84,7 +84,7 @@
#define Z_AvailHeap() ((64 * 1024) * 1024)
#endif
-#define printchrasm(x,y,ch) printf("%c", (char) (ch & 0xFF))
+#define printchrasm(x,y,ch) printf("%c", (uint8_t ) (ch & 0xFF))
#ifdef __GNUC__
#define GCC_PACK1_EXT __attribute__((packed,aligned(1)))
--- a/Game/src/dukewin.h
+++ b/Game/src/dukewin.h
@@ -31,9 +31,9 @@
{
int32_t handle;
struct _finddata_t data;
- char name[MAX_PATH];
+ uint8_t name[MAX_PATH];
};
-int _dos_findfirst(char *filename, int x, struct find_t *f);
+int _dos_findfirst(uint8_t *filename, int x, struct find_t *f);
int _dos_findnext(struct find_t *f);
struct dosdate_t
@@ -62,7 +62,7 @@
// 64 megs should be enough for anybody. :) --ryan.
#define Z_AvailHeap() ((64 * 1024) * 1024)
-#define printchrasm(x,y,ch) printf("%c", (char) (ch & 0xFF))
+#define printchrasm(x,y,ch) printf("%c", (uint8_t ) (ch & 0xFF))
#define cdecl
--- a/Game/src/dummy_audiolib.c
+++ b/Game/src/dummy_audiolib.c
@@ -9,8 +9,8 @@
#include "audiolib/fx_man.h"
#include <inttypes.h>
-char *FX_ErrorString( int ErrorNumber ){
- static char nope = '\0';
+uint8_t *FX_ErrorString( int ErrorNumber ){
+ static uint8_t nope = '\0';
return &nope;
}
@@ -37,25 +37,25 @@
int FX_SetPitch( int handle, int pitchoffset ){return 1;}
int FX_SetFrequency( int handle, int frequency ){return 1;}
-int FX_PlayVOC( char *ptr, int pitchoffset, int vol, int left, int right,
+int FX_PlayVOC( uint8_t *ptr, int pitchoffset, int vol, int left, int right,
int priority, uint32_t callbackval ){return 1;}
-int FX_PlayLoopedVOC( char *ptr, int32_t loopstart, int32_t loopend,
+int FX_PlayLoopedVOC( uint8_t *ptr, int32_t loopstart, int32_t loopend,
int pitchoffset, int vol, int left, int right, int priority,
uint32_t callbackval ){return 1;}
-int FX_PlayWAV( char *ptr, int pitchoffset, int vol, int left, int right,
+int FX_PlayWAV( uint8_t *ptr, int pitchoffset, int vol, int left, int right,
int priority, uint32_t callbackval ){return 1;}
-int FX_PlayLoopedWAV( char *ptr, int32_t loopstart, int32_t loopend,
+int FX_PlayLoopedWAV( uint8_t *ptr, int32_t loopstart, int32_t loopend,
int pitchoffset, int vol, int left, int right, int priority,
uint32_t callbackval ){return 1;}
-int FX_PlayVOC3D( char *ptr, int pitchoffset, int angle, int distance,
+int FX_PlayVOC3D( uint8_t *ptr, int pitchoffset, int angle, int distance,
int priority, uint32_t callbackval ){return 1;}
-int FX_PlayWAV3D( char *ptr, int pitchoffset, int angle, int distance,
+int FX_PlayWAV3D( uint8_t *ptr, int pitchoffset, int angle, int distance,
int priority, uint32_t callbackval ){return 1;}
-int FX_PlayRaw( char *ptr, uint32_t length, unsigned rate,
+int FX_PlayRaw( uint8_t *ptr, uint32_t length, unsigned rate,
int pitchoffset, int vol, int left, int right, int priority,
uint32_t callbackval ){return 1;}
-int FX_PlayLoopedRaw( char *ptr, uint32_t length, char *loopstart,
- char *loopend, unsigned rate, int pitchoffset, int vol, int left,
+int FX_PlayLoopedRaw( uint8_t *ptr, uint32_t length, uint8_t *loopstart,
+ uint8_t *loopend, unsigned rate, int pitchoffset, int vol, int left,
int right, int priority, uint32_t callbackval ){return 1;}
int FX_Pan3D( int handle, int angle, int distance ){return 1;}
int FX_SoundActive( int handle ){return 1;}
@@ -62,10 +62,10 @@
int FX_SoundsPlaying( void ){return 0;}
int FX_StopSound( int handle ){return 1;}
int FX_StopAllSounds( void ){return 1;}
-int FX_StartDemandFeedPlayback( void ( *function )( char **ptr, uint32_t *length ),
+int FX_StartDemandFeedPlayback( void ( *function )( uint8_t **ptr, uint32_t *length ),
int rate, int pitchoffset, int vol, int left, int right,
int priority, uint32_t callbackval ){return 1;}
-int FX_StartRecording( int MixRate, void ( *function )( char *ptr, int length ) ){return 1;}
+int FX_StartRecording( int MixRate, void ( *function )( uint8_t *ptr, int length ) ){return 1;}
void FX_StopRecord( void ){}
@@ -74,7 +74,7 @@
//Dummy music
#include "audiolib/music.h"
-char *MUSIC_ErrorString(int ErrorNumber)
+uint8_t *MUSIC_ErrorString(int ErrorNumber)
{
return "";
}
--- a/Game/src/file_lib.h
+++ b/Game/src/file_lib.h
@@ -48,7 +48,7 @@
// SafeOpenWrite - Opens a file for writing, returns handle
//
//==========================================================================
-int32 SafeOpenWrite ( const char * filename, int32 filetype );
+int32 SafeOpenWrite ( const uint8_t * filename, int32 filetype );
//==========================================================================
//
@@ -55,7 +55,7 @@
// SafeOpenRead - Opens a file for reading, returns handle
//
//==========================================================================
-int32 SafeOpenRead ( const char * filename, int32 filetype );
+int32 SafeOpenRead ( const uint8_t * filename, int32 filetype );
//==========================================================================
//
@@ -62,7 +62,7 @@
// SafeOpenAppend - Opens a file for appending, returns handle
//
//==========================================================================
-int32 SafeOpenAppend ( const char * filename, int32 filetype );
+int32 SafeOpenAppend ( const uint8_t * filename, int32 filetype );
//==========================================================================
//
@@ -76,7 +76,7 @@
// SafeFileExists - Checks for existence of file
//
//==========================================================================
-boolean SafeFileExists ( const char * filename );
+boolean SafeFileExists ( const uint8_t * filename );
//==========================================================================
//
@@ -122,7 +122,7 @@
// returns number of bytes read
//
//==========================================================================
-int32 LoadFile ( const char * filename, void ** bufferptr );
+int32 LoadFile ( const uint8_t * filename, void ** bufferptr );
//==========================================================================
//
@@ -135,7 +135,7 @@
// count - number of bytes to write
//
//==========================================================================
-void SaveFile ( const char * filename, void * bufferptr, int32 count );
+void SaveFile ( const uint8_t * filename, void * bufferptr, int32 count );
//==========================================================================
//
@@ -149,7 +149,7 @@
// filename - standard filename
//
//==========================================================================
-void GetPathFromEnvironment( char *fullname, const char *envname, const char *filename );
+void GetPathFromEnvironment( uint8_t *fullname, const uint8_t *envname, const uint8_t *filename );
//==========================================================================
//
@@ -160,7 +160,7 @@
// extension - default extension should include '.'
//
//==========================================================================
-void DefaultExtension (char *path, const char *extension);
+void DefaultExtension (uint8_t *path, const uint8_t *extension);
//==========================================================================
//
@@ -171,7 +171,7 @@
// extension - default path
//
//==========================================================================
-void DefaultPath (char *path, const char *basepath);
+void DefaultPath (uint8_t *path, const uint8_t *basepath);
//==========================================================================
//
@@ -182,7 +182,7 @@
// dest - where the file base name will be placed
//
//==========================================================================
-void ExtractFileBase (char *path, char *dest);
+void ExtractFileBase (uint8_t *path, uint8_t *dest);
//==========================================================================
//
@@ -191,7 +191,7 @@
// returns false otherwise
//
//==========================================================================
-boolean GetExtension( char *filename, char *extension );
+boolean GetExtension( uint8_t *filename, uint8_t *extension );
//==========================================================================
//
@@ -199,7 +199,7 @@
// space is left at the end of the string to hold an extension.
//
//==========================================================================
-void SetExtension( char *filename, const char *extension );
+void SetExtension( uint8_t *filename, const uint8_t *extension );
#ifdef __MSDOS__
//******************************************************************************
@@ -216,7 +216,7 @@
// Pointer to next path
//
//******************************************************************************
-char * GetPath (char * path, char *dir);
+uint8_t * GetPath (uint8_t * path, uint8_t *dir);
//******************************************************************************
//
@@ -233,7 +233,7 @@
// FALSE - If unsuccessful.
//
//******************************************************************************
-boolean ChangeDirectory (char * path);
+boolean ChangeDirectory (uint8_t * path);
//******************************************************************************
//
@@ -250,7 +250,7 @@
// FALSE - If drive change unsuccessful.
//
//******************************************************************************
-boolean ChangeDrive (char *drive);
+boolean ChangeDrive (uint8_t *drive);
#endif
--- a/Game/src/funct.h
+++ b/Game/src/funct.h
@@ -29,7 +29,7 @@
#include "duke3d.h"
-extern void sendscore(char *s);
+extern void sendscore(uint8_t *s);
//#line "sounds.c" 25
extern void SoundStartup(void );
//#line "sounds.c" 95
@@ -39,15 +39,15 @@
//#line "sounds.c" 166
extern void MusicShutdown(void );
//#line "sounds.c" 181
-extern int USRHOOKS_GetMem(char **ptr,uint32_t size);
+extern int USRHOOKS_GetMem(uint8_t **ptr,uint32_t size);
//#line "sounds.c" 192
-extern int USRHOOKS_FreeMem(char *ptr);
+extern int USRHOOKS_FreeMem(uint8_t *ptr);
//#line "sounds.c" 200
extern void intomenusounds(void );
//#line "sounds.c" 227
-extern void playmusic(char *fn);
+extern void playmusic(uint8_t *fn);
//#line "sounds.c" 251
-extern char loadsound(unsigned short num);
+extern uint8_t loadsound(unsigned short num);
//#line "sounds.c" 277
extern int xyzsound(short num,short i,int32_t x,int32_t y,int32_t z);
//#line "sounds.c" 407
@@ -67,11 +67,11 @@
//#line "sector.c" 56
extern short check_activator_motion(short lotag);
//#line "sector.c" 93
-extern char isadoorwall(short dapic);
+extern uint8_t isadoorwall(short dapic);
//#line "sector.c" 124
-extern char isanunderoperator(short lotag);
+extern uint8_t isanunderoperator(short lotag);
//#line "sector.c" 139
-extern char isanearoperator(short lotag);
+extern uint8_t isanearoperator(short lotag);
//#line "sector.c" 161
extern short checkcursectnums(short sect);
//#line "sector.c" 169
@@ -93,7 +93,7 @@
//#line "sector.c" 369
extern void animatewalls(void );
//#line "sector.c" 457
-extern char activatewarpelevators(short s,short d);
+extern uint8_t activatewarpelevators(short s,short d);
//#line "sector.c" 504
extern void operatesectors(short sn,short ii);
//#line "sector.c" 997
@@ -105,7 +105,7 @@
//#line "sector.c" 1104
extern void operateforcefields(short s,short low);
//#line "sector.c" 1140
-extern char checkhitswitch(short snum,int32_t w,char switchtype);
+extern uint8_t checkhitswitch(short snum,int32_t w,uint8_t switchtype);
//#line "sector.c" 1515
extern void activatebysector(short sect,short j);
//#line "sector.c" 1532
@@ -113,7 +113,7 @@
//#line "sector.c" 1746
extern void checkplayerhurt(struct player_struct *p,short j);
//#line "sector.c" 1816
-extern char checkhitceiling(short sn);
+extern uint8_t checkhitceiling(short sn);
//#line "sector.c" 1891
extern void checkhitsprite(short i,short sn);
//#line "sector.c" 2326
@@ -123,15 +123,15 @@
//#line "sector.c" 2766
extern void checksectors(short snum);
//#line "rts.c" 36
-extern void RTS_AddFile(char *filename);
+extern void RTS_AddFile(uint8_t *filename);
//#line "rts.c" 93
-extern void RTS_Init(char *filename);
+extern void RTS_Init(uint8_t *filename);
//#line "rts.c" 126
extern int32 RTS_NumSounds(void );
//#line "rts.c" 141
extern int32 RTS_SoundLength(int32 lump);
//#line "rts.c" 157
-extern char *RTS_GetSoundName(int32 i);
+extern uint8_t *RTS_GetSoundName(int32 i);
//#line "rts.c" 174
extern void RTS_ReadLump(int32 lump,void *dest);
//#line "rts.c" 194
@@ -150,7 +150,7 @@
//#line "premap.c" 212
extern void resetinventory(short snum);
//#line "premap.c" 232
-extern void resetprestat(short snum,char g);
+extern void resetprestat(short snum,uint8_t g);
//#line "premap.c" 294
extern void setupbackdrop(short backpicnum);
//#line "premap.c" 329
@@ -158,11 +158,11 @@
//#line "premap.c" 443
extern void cachegoodsprites(void );
//#line "premap.c" 516
-extern void prelevel(char g);
+extern void prelevel(uint8_t g);
//#line "premap.c" 823
-extern void newgame(char vn,char ln,char sk);
+extern void newgame(uint8_t vn,uint8_t ln,uint8_t sk);
//#line "premap.c" 874
-extern void resetpspritevars(char g);
+extern void resetpspritevars(uint8_t g);
//#line "premap.c" 1012
extern void resettimevars(void );
//#line "premap.c" 1043
@@ -170,9 +170,9 @@
//#line "premap.c" 1077
extern void waitforeverybody(void);
//#line "premap.c" 1131
-extern char checksum(int32_t sum);
+extern uint8_t checksum(int32_t sum);
//#line "premap.c" 1163
-extern char getsound(unsigned short num);
+extern uint8_t getsound(unsigned short num);
//#line "premap.c" 1189
extern void precachenecessarysounds(void );
//#line "premap.c" 1201
@@ -180,7 +180,7 @@
//#line "premap.c" 1244
extern void dofrontscreens(void );
//#line "premap.c" 1285
-extern void enterlevel(char g);
+extern void enterlevel(uint8_t g);
//#line "player.c" 10
extern void setpal(struct player_struct *p);
//#line "player.c" 28
@@ -204,23 +204,23 @@
//#line "player.c" 939
extern void displayloogie(short snum);
//#line "player.c" 958
-extern char animatefist(short gs,short snum);
+extern uint8_t animatefist(short gs,short snum);
//#line "player.c" 986
-extern char animateknee(short gs,short snum);
+extern uint8_t animateknee(short gs,short snum);
//#line "player.c" 1002
-extern char animateknuckles(short gs,short snum);
+extern uint8_t animateknuckles(short gs,short snum);
//#line "player.c" 1022
extern void displaymasks(short snum);
//#line "player.c" 1043
-extern char animatetip(short gs,short snum);
+extern uint8_t animatetip(short gs,short snum);
//#line "player.c" 1064
-extern char animateaccess(short gs,short snum);
+extern uint8_t animateaccess(short gs,short snum);
//#line "player.c" 1090
extern void displayweapon(short snum);
//#line "player.c" 1501
extern void getinput(short snum);
//#line "player.c" 1742
-extern char doincrements(struct player_struct *p);
+extern uint8_t doincrements(struct player_struct *p);
//#line "player.c" 1935
extern void checkweapons(struct player_struct *p);
//#line "player.c" 1951
@@ -228,11 +228,11 @@
//#line "menues.c" 18
extern void cmenu(short cm);
//#line "menues.c" 38
-extern void savetemp(char *fn,int32_t daptr,int32_t dasiz);
+extern void savetemp(uint8_t *fn,int32_t daptr,int32_t dasiz);
//#line "menues.c" 49
extern void getangplayers(short snum);
//#line "menues.c" 67
-extern int loadpheader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr);
+extern int loadpheader(uint8_t spot,int32 *vn,int32 *ln,int32 *psk,int32 *numplr);
//#line "menues.c" 105
extern int loadplayer(int8_t spot);
//#line "menues.c" 276
@@ -243,15 +243,15 @@
extern int probe(int x,int y,int i,int n);
extern int probeXduke(int x,int y,int i,int n, int32_t spriteSize);
//#line "menues.c" 521
-extern int menutext(int x,int y,short s,short p,char *t);
+extern int menutext(int x,int y,short s,short p,uint8_t *t);
//#line "menues.c" 630
-extern int menutextc(int x,int y,short s,short p,char *t);
+extern int menutextc(int x,int y,short s,short p,uint8_t *t);
//#line "menues.c" 727
-extern void bar(int x,int y,short *p,short dainc,char damodify,short s,short pa);
+extern void bar(int x,int y,short *p,short dainc,uint8_t damodify,short s,short pa);
//#line "menues.c" 806
extern void dispnames(void );
//#line "menues.c" 832
-extern int getfilenames(char kind[]);
+extern int getfilenames(uint8_t kind[]);
//#line "menues.c" 865
extern void sortfilenames(void);
//#line "menues.c" 886
@@ -258,17 +258,17 @@
extern void menus(void );
void gameexitanycase(void);
//#line "menues.c" 2414
-extern void palto(char r,char g,char b,int32_t e);
+extern void palto(uint8_t r,uint8_t g,uint8_t b,int32_t e);
//#line "menues.c" 2436
extern void drawoverheadmap(int32_t cposx,int32_t cposy,int32_t czoom,short cang);
//#line "menues.c" 2685
-extern void playanm(char *fn,char);
+extern void playanm(uint8_t *fn,uint8_t );
//#line "gamedef.c" 122
extern short getincangle(short a,short na);
//#line "gamedef.c" 140
-extern char ispecial(char c);
+extern uint8_t ispecial(uint8_t c);
//#line "gamedef.c" 154
-extern char isaltok(char c);
+extern uint8_t isaltok(uint8_t c);
//#line "gamedef.c" 159
extern void getglobalz(short i);
//#line "gamedef.c" 203
@@ -282,13 +282,13 @@
//#line "gamedef.c" 342
extern void transnum(void );
//#line "gamedef.c" 402
-extern char parsecommand(int readfromGRP );
+extern uint8_t parsecommand(int readfromGRP );
//#line "gamedef.c" 1227
extern void passone(int readfromGRP);
//#line "gamedef.c" 1239
-extern void loadefs(char *fn,char *mptr, int readfromGRP);
+extern void loadefs(uint8_t *fn,uint8_t *mptr, int readfromGRP);
//#line "gamedef.c" 1342
-extern char dodge(spritetype *s);
+extern uint8_t dodge(spritetype *s);
//#line "gamedef.c" 1374
extern short furthestangle(short i,short angs);
//#line "gamedef.c" 1404
@@ -300,11 +300,11 @@
//#line "gamedef.c" 1711
extern void parseifelse(int32_t condition);
//#line "gamedef.c" 1729
-extern char parse(void );
+extern uint8_t parse(void );
//#line "gamedef.c" 2699
extern void execute(short i,short p,int32_t x);
//#line "game.c" 63
-extern void overwritesprite(int32_t thex,int32_t they,short tilenum,int8_t shade,char stat,char dapalnum);
+extern void overwritesprite(int32_t thex,int32_t they,short tilenum,int8_t shade,uint8_t stat,uint8_t dapalnum);
//#line "game.c" 70
extern void timerhandler(void);
//#line "game.c" 75
@@ -312,13 +312,13 @@
//#line "game.c" 81
extern void uninittimer(void );
//#line "game.c" 89
-extern int gametext(int x,int y,char *t,char s,short dabits);
+extern int gametext(int x,int y,uint8_t *t,uint8_t s,short dabits);
//#line "game.c" 136
-extern int gametextpart(int x,int y,char *t,char s,short p);
+extern int gametextpart(int x,int y,uint8_t *t,uint8_t s,short p);
//#line "game.c" 192
-extern int minitext(int x,int y,char *t,char p,char sb);
+extern int minitext(int x,int y,uint8_t *t,uint8_t p,uint8_t sb);
//#line "game.c" 231
-extern void gamenumber(int32_t x,int32_t y,int32_t n,char s);
+extern void gamenumber(int32_t x,int32_t y,int32_t n,uint8_t s);
//#line "game.c" 248
extern void ShutDown(void );
//#line "game.c" 260
@@ -338,21 +338,21 @@
//#line "game.c" 924
extern short badguypic(short pn);
//#line "game.c" 963
-extern void myos(int32_t x,int32_t y,short tilenum,int8_t shade,char orientation);
+extern void myos(int32_t x,int32_t y,short tilenum,int8_t shade,uint8_t orientation);
//#line "game.c" 976
-extern void myospal(int32_t x,int32_t y,short tilenum,int8_t shade,char orientation,char p);
+extern void myospal(int32_t x,int32_t y,short tilenum,int8_t shade,uint8_t orientation,uint8_t p);
//#line "game.c" 991
-extern void invennum(int32_t x,int32_t y,char num1,char ha,char sbits);
+extern void invennum(int32_t x,int32_t y,uint8_t num1,uint8_t ha,uint8_t sbits);
//#line "game.c" 1021
-extern void weaponnum(short ind,int32_t x,int32_t y,int32_t num1,int32_t num2,char ha);
+extern void weaponnum(short ind,int32_t x,int32_t y,int32_t num1,int32_t num2,uint8_t ha);
//#line "game.c" 1049
-extern void weaponnum999(char ind,int32_t x,int32_t y,int32_t num1,int32_t num2,char ha);
+extern void weaponnum999(uint8_t ind,int32_t x,int32_t y,int32_t num1,int32_t num2,uint8_t ha);
//#line "game.c" 1088
extern void weapon_amounts(struct player_struct *p,int32_t x,int32_t y,int32_t u);
//#line "game.c" 1197
-extern void digitalnumber(int32_t x,int32_t y,int32_t n,char s,char cs);
+extern void digitalnumber(int32_t x,int32_t y,int32_t n,uint8_t s,uint8_t cs);
//#line "game.c" 1223
-extern void scratchmarks(int32_t x,int32_t y,int32_t n,char s,char p);
+extern void scratchmarks(int32_t x,int32_t y,int32_t n,uint8_t s,uint8_t p);
//#line "game.c" 1238
extern void displayinventory(struct player_struct *p);
//#line "game.c" 1296
@@ -375,9 +375,9 @@
//#line "game.c" 1691
extern void binscreen(void );
//#line "game.c" 1705
-extern void gameexit(char *t);
+extern void gameexit(uint8_t *t);
//#line "game.c" 1752
-extern short strget(short x,short y,char *t,short dalen,short c);
+extern short strget(short x,short y,uint8_t *t,short dalen,short c);
//#line "game.c" 1819
extern void displayrest(int32_t smoothratio);
//#line "game.c" 2047
@@ -393,7 +393,7 @@
//#line "game.c" 2459
extern short EGS(short whatsect,int32_t s_x,int32_t s_y,int32_t s_z,short s_pn,int8_t s_s,int8_t s_xr,int8_t s_yr,short s_a,short s_ve,int32_t s_zv,short s_ow,int8_t s_ss);
//#line "game.c" 2537
-extern char wallswitchcheck(short i);
+extern uint8_t wallswitchcheck(short i);
//#line "game.c" 2588
extern short spawn(short j,short pn);
//#line "game.c" 4181
@@ -403,11 +403,11 @@
//#line "game.c" 5303
extern void nonsharedkeys(void );
//#line "game.c" 5863
-extern void comlinehelp(char **argv);
+extern void comlinehelp(uint8_t **argv);
//#line "game.c" 5889
-extern void checkcommandline(int argc,char **argv);
+extern void checkcommandline(int argc,uint8_t **argv);
//#line "game.c" 6078
-extern void printstr(short x,short y,char string[],char attribute);
+extern void printstr(short x,short y,uint8_t string[],uint8_t attribute);
//#line "game.c" 6104
extern void Logo(void );
//#line "game.c" 6187
@@ -419,9 +419,9 @@
//#line "game.c" 6284
extern void getnames(void );
//#line "game.c" 6309
-extern int main(int argc,char **argv);
+extern int main(int argc,char **argv);
//#line "game.c" 6563
-extern char opendemoread(char which_demo);
+extern uint8_t opendemoread(uint8_t which_demo);
//#line "game.c" 6589
extern void opendemowrite(void );
//#line "game.c" 6608
@@ -431,19 +431,19 @@
//#line "game.c" 6642
extern int32_t playback(void );
//#line "game.c" 6777
-extern char moveloop(void);
+extern uint8_t moveloop(void);
//#line "game.c" 6796
extern void fakedomovethingscorrect(void);
//#line "game.c" 6829
extern void fakedomovethings(void );
//#line "game.c" 7247
-extern char domovethings(void );
+extern uint8_t domovethings(void );
//#line "game.c" 7373
extern void displaybonuspics(short x,short y,short p);
//#line "game.c" 7396
extern void doorders(void );
//#line "game.c" 7432
-extern void dobonus(char bonusonly);
+extern void dobonus(uint8_t bonusonly);
//#line "game.c" 7846
extern void cameratext(short i);
//#line "game.c" 7869
@@ -475,11 +475,11 @@
//#line "config.c" 57
extern void CONFIG_GetSetupFilename(void );
//#line "config.c" 170
-extern int32 CONFIG_FunctionNameToNum(char *func);
+extern int32 CONFIG_FunctionNameToNum(uint8_t *func);
//#line "config.c" 192
-extern char *CONFIG_FunctionNumToName(int32 func);
+extern uint8_t *CONFIG_FunctionNumToName(int32 func);
//#line "config.c" 211
-extern int32 CONFIG_AnalogNameToNum(char *func);
+extern int32 CONFIG_AnalogNameToNum(uint8_t *func);
//#line "config.c" 240
extern void CONFIG_SetDefaults(void );
//#line "config.c" 264
@@ -497,7 +497,7 @@
//#line "config.c" 613
extern void CONFIG_WriteSetup(void );
//#line "animlib.c" 34
-extern void CheckAnimStarted(char *funcname);
+extern void CheckAnimStarted(uint8_t *funcname);
//#line "animlib.c" 46
extern uint16 findpage(uint16 framenumber);
//#line "animlib.c" 71
--- a/Game/src/function.h
+++ b/Game/src/function.h
@@ -40,7 +40,7 @@
#define NUMGAMEFUNCTIONS 55 //dont forget to check NUMKEYENTRIES
-extern char * gamefunctions[];
+extern uint8_t * gamefunctions[];
enum
{
--- a/Game/src/game.c
+++ b/Game/src/game.c
@@ -73,9 +73,9 @@
#define TIMERUPDATESIZ 32
int32_t cameradist = 0, cameraclock = 0;
-char eightytwofifty = 0;
-char playerswhenstarted;
-char qe,cp;
+uint8_t eightytwofifty = 0;
+uint8_t playerswhenstarted;
+uint8_t qe,cp;
uint8_t nHostForceDisableAutoaim = 0;
@@ -89,9 +89,9 @@
// For addfaz's stun server. use /stun to activate
unsigned short g_bStun = 0;
-char confilename[128] = {"GAME.CON"},boardfilename[128] = {0};
-char waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768];
-char firstdemofile[80] = { '\0' };
+uint8_t confilename[128] = {"GAME.CON"},boardfilename[128] = {0};
+uint8_t waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768];
+uint8_t firstdemofile[80] = { '\0' };
#define patchstatusbar(x1,y1,x2,y2) \
{ \
@@ -103,17 +103,17 @@
void __interrupt __far newint24( int errval, int ax, int bp, int si );
int recfilep,totalreccnt;
-char debug_on = 0,actor_tog = 0,*rtsptr,memorycheckoveride=0;
+uint8_t debug_on = 0,actor_tog = 0,*rtsptr,memorycheckoveride=0;
-extern char syncstate;
+extern uint8_t syncstate;
extern int32 numlumps;
FILE *frecfilep = (FILE *)NULL;
void pitch_test( void );
-char restorepalette,screencapt,nomorelogohack;
+uint8_t restorepalette,screencapt,nomorelogohack;
int sendmessagecommand = -1;
#if PLATFORM_DOS
@@ -149,10 +149,10 @@
}
#endif
-int gametext(int x,int y,char *t,char s,short dabits)
+int gametext(int x,int y,uint8_t *t,uint8_t s,short dabits)
{
short ac,newx;
- char centre, *oldt;
+ uint8_t centre, *oldt;
centre = ( x == (320>>1) );
newx = 0;
@@ -197,10 +197,10 @@
return (x);
}
-int gametextpal(int x,int y,char *t,char s,char p)
+int gametextpal(int x,int y,uint8_t *t,uint8_t s,uint8_t p)
{
short ac,newx;
- char centre, *oldt;
+ uint8_t centre, *oldt;
centre = ( x == (320>>1) );
newx = 0;
@@ -244,10 +244,10 @@
return (x);
}
-int gametextpart(int x,int y,char *t,char s,short p)
+int gametextpart(int x,int y,uint8_t *t,uint8_t s,short p)
{
short ac,newx, cnt;
- char centre, *oldt;
+ uint8_t centre, *oldt;
centre = ( x == (320>>1) );
newx = 0;
@@ -300,11 +300,11 @@
return (x);
}
-int minitext(int x,int y,char *str,char p,char sb)
+int minitext(int x,int y,uint8_t *str,uint8_t p,uint8_t sb)
{
short ac;
- char buf[128];
- char *t;
+ uint8_t buf[128];
+ uint8_t *t;
strncpy (buf, str, 128);
buf[127] = 0;
@@ -324,11 +324,11 @@
return (x);
}
-int minitextshade(int x,int y,char *str,char s,char p,char sb)
+int minitextshade(int x,int y,uint8_t *str,uint8_t s,uint8_t p,uint8_t sb)
{
short ac;
- char buf[128];
- char *t;
+ uint8_t buf[128];
+ uint8_t *t;
strncpy (buf, str, 128);
buf[127] = 0;
@@ -348,13 +348,13 @@
return (x);
}
-void gamenumber(int32_t x,int32_t y,int32_t n,char s)
+void gamenumber(int32_t x,int32_t y,int32_t n,uint8_t s)
{
- char b[10];
+ uint8_t b[10];
//
- // char * ltoa(int32_t l, char * buffer, int radix);
+ // uint8_t * ltoa(int32_t l, uint8_t * buffer, int radix);
// is NON-STANDARD and equivalent to STANDARD
// (void) sprintf(buffer, "%ld", l);
//ltoa(n,b,10);
@@ -363,7 +363,7 @@
}
-char recbuf[80];
+uint8_t recbuf[80];
void allowtimetocorrecterrorswhenquitting(void)
{
int32_t i, j, oldtotalclock;
@@ -389,10 +389,10 @@
#define MAXUSERQUOTES 4
int32_t quotebot, quotebotgoal;
short user_quote_time[MAXUSERQUOTES];
-char user_quote[MAXUSERQUOTES][128];
-// char typebuflen,typebuf[41];
+uint8_t user_quote[MAXUSERQUOTES][128];
+// uint8_t typebuflen,typebuf[41];
-static void adduserquote(char *daquote)
+static void adduserquote(uint8_t *daquote)
{
int32_t i;
@@ -406,9 +406,9 @@
pub = NUMPAGES;
}
-char *grpVersion2char_from_crc(unsigned int crc32_grp_to_identify)
+uint8_t *grpVersion2char_from_crc(unsigned int crc32_grp_to_identify)
{
- char *id;
+ uint8_t *id;
int i=0;
id = crc32lookup[MAX_KNOWN_GRP].name; // unknown version
@@ -422,9 +422,9 @@
return(id);
}
-char *grpVersion2char(uint8_t grp_to_identify)
+uint8_t *grpVersion2char(uint8_t grp_to_identify)
{
- char *id;
+ uint8_t *id;
switch(grp_to_identify)
{
@@ -504,7 +504,7 @@
{
if (playerquitflag[i] == 0) continue;
if (i == myconnectindex)
- otherminlag = (long)((signed char)packbuf[j]);
+ otherminlag = (long)((int8_t )packbuf[j]);
j++;
}
@@ -525,12 +525,12 @@
copybufbyte(&osyn[i],&nsyn[i],sizeof(input));
if (l&1) nsyn[i].fvel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
if (l&2) nsyn[i].svel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
- if (l&4) nsyn[i].avel = (signed char)packbuf[j++];
+ if (l&4) nsyn[i].avel = (int8_t )packbuf[j++];
if (l&8) nsyn[i].bits = ((nsyn[i].bits&0xffffff00)|((long)packbuf[j++]));
if (l&16) nsyn[i].bits = ((nsyn[i].bits&0xffff00ff)|((long)packbuf[j++])<<8);
if (l&32) nsyn[i].bits = ((nsyn[i].bits&0xff00ffff)|((long)packbuf[j++])<<16);
if (l&64) nsyn[i].bits = ((nsyn[i].bits&0x00ffffff)|((long)packbuf[j++])<<24);
- if (l&128) nsyn[i].horz = (signed char)packbuf[j++];
+ if (l&128) nsyn[i].horz = (int8_t )packbuf[j++];
if (nsyn[i].bits&(1<<26)) playerquitflag[i] = 0;
movefifoend[i]++;
@@ -567,12 +567,12 @@
copybufbyte(&osyn[other],&nsyn[other],sizeof(input));
if (k&1) nsyn[other].fvel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
if (k&2) nsyn[other].svel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
- if (k&4) nsyn[other].avel = (signed char)packbuf[j++];
+ if (k&4) nsyn[other].avel = (int8_t )packbuf[j++];
if (k&8) nsyn[other].bits = ((nsyn[other].bits&0xffffff00)|((long)packbuf[j++]));
if (k&16) nsyn[other].bits = ((nsyn[other].bits&0xffff00ff)|((long)packbuf[j++])<<8);
if (k&32) nsyn[other].bits = ((nsyn[other].bits&0xff00ffff)|((long)packbuf[j++])<<16);
if (k&64) nsyn[other].bits = ((nsyn[other].bits&0x00ffffff)|((long)packbuf[j++])<<24);
- if (k&128) nsyn[other].horz = (signed char)packbuf[j++];
+ if (k&128) nsyn[other].horz = (int8_t )packbuf[j++];
movefifoend[other]++;
while (j != packbufleng)
@@ -651,7 +651,7 @@
if (SoundToggle == 0 || ud.lockout == 1 || FXDevice == NumSoundCards)
break;
- rtsptr = (char *)RTS_GetSound(packbuf[1]-1);
+ rtsptr = (uint8_t *)RTS_GetSound(packbuf[1]-1);
if (*rtsptr == 'C')
FX_PlayVOC3D(rtsptr,0,0,0,255,-packbuf[1]);
else
@@ -696,7 +696,7 @@
{
if (i == myconnectindex)
{
- otherminlag = (long)((signed char)packbuf[j]);
+ otherminlag = (long)((int8_t )packbuf[j]);
}
j++;
@@ -709,12 +709,12 @@
k = packbuf[j++];
if (k&1) nsyn[other].fvel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
if (k&2) nsyn[other].svel = packbuf[j]+((short)packbuf[j+1]<<8), j += 2;
- if (k&4) nsyn[other].avel = (signed char)packbuf[j++];
+ if (k&4) nsyn[other].avel = (int8_t )packbuf[j++];
if (k&8) nsyn[other].bits = ((nsyn[other].bits&0xffffff00)|((long)packbuf[j++]));
if (k&16) nsyn[other].bits = ((nsyn[other].bits&0xffff00ff)|((long)packbuf[j++])<<8);
if (k&32) nsyn[other].bits = ((nsyn[other].bits&0xff00ffff)|((long)packbuf[j++])<<16);
if (k&64) nsyn[other].bits = ((nsyn[other].bits&0x00ffffff)|((long)packbuf[j++])<<24);
- if (k&128) nsyn[other].horz = (signed char)packbuf[j++];
+ if (k&128) nsyn[other].horz = (int8_t )packbuf[j++];
movefifoend[other]++;
for(i=1;i<movesperpacket;i++)
@@ -902,19 +902,19 @@
if (nsyn[0].fvel != osyn[0].fvel)
{
- packbuf[j++] = (char)nsyn[0].fvel;
- packbuf[j++] = (char)(nsyn[0].fvel>>8);
+ packbuf[j++] = (uint8_t )nsyn[0].fvel;
+ packbuf[j++] = (uint8_t )(nsyn[0].fvel>>8);
packbuf[k] |= 1;
}
if (nsyn[0].svel != osyn[0].svel)
{
- packbuf[j++] = (char)nsyn[0].svel;
- packbuf[j++] = (char)(nsyn[0].svel>>8);
+ packbuf[j++] = (uint8_t )nsyn[0].svel;
+ packbuf[j++] = (uint8_t )(nsyn[0].svel>>8);
packbuf[k] |= 2;
}
if (nsyn[0].avel != osyn[0].avel)
{
- packbuf[j++] = (signed char)nsyn[0].avel;
+ packbuf[j++] = (int8_t )nsyn[0].avel;
packbuf[k] |= 4;
}
if ((nsyn[0].bits^osyn[0].bits)&0x000000ff) packbuf[j++] = (nsyn[0].bits&255), packbuf[k] |= 8;
@@ -923,7 +923,7 @@
if ((nsyn[0].bits^osyn[0].bits)&0xff000000) packbuf[j++] = ((nsyn[0].bits>>24)&255), packbuf[k] |= 64;
if (nsyn[0].horz != osyn[0].horz)
{
- packbuf[j++] = (char)nsyn[0].horz;
+ packbuf[j++] = (uint8_t )nsyn[0].horz;
packbuf[k] |= 128;
}
@@ -963,19 +963,19 @@
if (nsyn[0].fvel != osyn[0].fvel)
{
- packbuf[j++] = (char)nsyn[0].fvel;
- packbuf[j++] = (char)(nsyn[0].fvel>>8);
+ packbuf[j++] = (uint8_t )nsyn[0].fvel;
+ packbuf[j++] = (uint8_t )(nsyn[0].fvel>>8);
packbuf[1] |= 1;
}
if (nsyn[0].svel != osyn[0].svel)
{
- packbuf[j++] = (char)nsyn[0].svel;
- packbuf[j++] = (char)(nsyn[0].svel>>8);
+ packbuf[j++] = (uint8_t )nsyn[0].svel;
+ packbuf[j++] = (uint8_t )(nsyn[0].svel>>8);
packbuf[1] |= 2;
}
if (nsyn[0].avel != osyn[0].avel)
{
- packbuf[j++] = (signed char)nsyn[0].avel;
+ packbuf[j++] = (int8_t )nsyn[0].avel;
packbuf[1] |= 4;
}
if ((nsyn[0].bits^osyn[0].bits)&0x000000ff) packbuf[j++] = (nsyn[0].bits&255), packbuf[1] |= 8;
@@ -984,7 +984,7 @@
if ((nsyn[0].bits^osyn[0].bits)&0xff000000) packbuf[j++] = ((nsyn[0].bits>>24)&255), packbuf[1] |= 64;
if (nsyn[0].horz != osyn[0].horz)
{
- packbuf[j++] = (char)nsyn[0].horz;
+ packbuf[j++] = (uint8_t )nsyn[0].horz;
packbuf[1] |= 128;
}
@@ -1040,19 +1040,19 @@
packbuf[k] = 0;
if (nsyn[i].fvel != osyn[i].fvel)
{
- packbuf[j++] = (char)nsyn[i].fvel;
- packbuf[j++] = (char)(nsyn[i].fvel>>8);
+ packbuf[j++] = (uint8_t )nsyn[i].fvel;
+ packbuf[j++] = (uint8_t )(nsyn[i].fvel>>8);
packbuf[k] |= 1;
}
if (nsyn[i].svel != osyn[i].svel)
{
- packbuf[j++] = (char)nsyn[i].svel;
- packbuf[j++] = (char)(nsyn[i].svel>>8);
+ packbuf[j++] = (uint8_t )nsyn[i].svel;
+ packbuf[j++] = (uint8_t )(nsyn[i].svel>>8);
packbuf[k] |= 2;
}
if (nsyn[i].avel != osyn[i].avel)
{
- packbuf[j++] = (signed char)nsyn[i].avel;
+ packbuf[j++] = (int8_t )nsyn[i].avel;
packbuf[k] |= 4;
}
if ((nsyn[i].bits^osyn[i].bits)&0x000000ff) packbuf[j++] = (nsyn[i].bits&255), packbuf[k] |= 8;
@@ -1061,7 +1061,7 @@
if ((nsyn[i].bits^osyn[i].bits)&0xff000000) packbuf[j++] = ((nsyn[i].bits>>24)&255), packbuf[k] |= 64;
if (nsyn[i].horz != osyn[i].horz)
{
- packbuf[j++] = (char)nsyn[i].horz;
+ packbuf[j++] = (uint8_t )nsyn[i].horz;
packbuf[k] |= 128;
}
k++;
@@ -1086,7 +1086,7 @@
}
extern int32_t cacnum;
-typedef struct { int32_t *hand, leng; char *lock; } cactype;
+typedef struct { int32_t *hand, leng; uint8_t *lock; } cactype;
extern cactype cac[];
void caches(void)
@@ -1391,9 +1391,9 @@
-void myos(int32_t x, int32_t y, short tilenum, int8_t shade, char orientation)
+void myos(int32_t x, int32_t y, short tilenum, int8_t shade, uint8_t orientation)
{
- char p;
+ uint8_t p;
short a;
if(orientation&4)
@@ -1404,9 +1404,9 @@
rotatesprite(x<<16,y<<16,65536L,a,tilenum,shade,p,2|orientation,windowx1,windowy1,windowx2,windowy2);
}
-void myospal(int32_t x, int32_t y, short tilenum, int8_t shade, char orientation, char p)
+void myospal(int32_t x, int32_t y, short tilenum, int8_t shade, uint8_t orientation, uint8_t p)
{
- char fp;
+ uint8_t fp;
short a;
if(orientation&4)
@@ -1419,9 +1419,9 @@
}
-void invennum(int32_t x,int32_t y,char num1,char ha,char sbits)
+void invennum(int32_t x,int32_t y,uint8_t num1,uint8_t ha,uint8_t sbits)
{
- char dabuf[80] = {0};
+ uint8_t dabuf[80] = {0};
sprintf(dabuf,"%ld",num1);
if(num1 > 99)
{
@@ -1438,7 +1438,7 @@
rotatesprite((x+4)<<16,y<<16,65536L,0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
}
-void orderweaponnum(short ind,int32_t x,int32_t y,int32_t num1, int32_t num2,char ha)
+void orderweaponnum(short ind,int32_t x,int32_t y,int32_t num1, int32_t num2,uint8_t ha)
{
rotatesprite((x-7)<<16,y<<16,65536L,0,THREEBYFIVE+ind+1,ha-10,7,10+128,0,0,xdim-1,ydim-1);
rotatesprite((x-3)<<16,y<<16,65536L,0,THREEBYFIVE+10,ha,0,10+128,0,0,xdim-1,ydim-1);
@@ -1446,9 +1446,9 @@
minitextshade(x+1,y-4,"ORDER",26,6,2+8+16+128);
}
-void weaponnum(short ind,int32_t x,int32_t y,int32_t num1, int32_t num2,char ha)
+void weaponnum(short ind,int32_t x,int32_t y,int32_t num1, int32_t num2,uint8_t ha)
{
- char dabuf[80] = {0};
+ uint8_t dabuf[80] = {0};
rotatesprite((x-7)<<16,y<<16,65536L,0,THREEBYFIVE+ind+1,ha-10,7,10+128,0,0,xdim-1,ydim-1);
rotatesprite((x-3)<<16,y<<16,65536L,0,THREEBYFIVE+10,ha,0,10+128,0,0,xdim-1,ydim-1);
@@ -1474,9 +1474,9 @@
else rotatesprite((x+13)<<16,y<<16,65536L,0,THREEBYFIVE+dabuf[0]-'0',ha,0,10+128,0,0,xdim-1,ydim-1);
}
-void weaponnum999(char ind,int32_t x,int32_t y,int32_t num1, int32_t num2,char ha)
+void weaponnum999(uint8_t ind,int32_t x,int32_t y,int32_t num1, int32_t num2,uint8_t ha)
{
- char dabuf[80] = {0};
+ uint8_t dabuf[80] = {0};
rotatesprite((x-7)<<16,y<<16,65536L,0,THREEBYFIVE+ind+1,ha-10,7,10+128,0,0,xdim-1,ydim-1);
rotatesprite((x-4)<<16,y<<16,65536L,0,THREEBYFIVE+10,ha,0,10+128,0,0,xdim-1,ydim-1);
@@ -1641,13 +1641,13 @@
}
}
-void digitalnumber(int32_t x,int32_t y,int32_t n,char s,char cs)
+void digitalnumber(int32_t x,int32_t y,int32_t n,uint8_t s,uint8_t cs)
{
short i, j, k, p, c;
- char b[10];
+ uint8_t b[10];
//
- // char * ltoa(int32_t l, char * buffer, int radix);
+ // uint8_t * ltoa(int32_t l, uint8_t * buffer, int radix);
// is NON-STANDARD and equivalent to STANDARD
// (void) sprintf(buffer, "%ld", l);
//ltoa(n,b,10);
@@ -1674,7 +1674,7 @@
/*
-void scratchmarks(int32_t x,int32_t y,int32_t n,char s,char p)
+void scratchmarks(int32_t x,int32_t y,int32_t n,uint8_t s,uint8_t p)
{
int32_t i, ni;
@@ -1875,7 +1875,7 @@
{
struct player_struct *p;
int32_t i, j, o, ss, u;
- char permbit;
+ uint8_t permbit;
short offx = 3, offy = 3, stepx=60, stepy=6;
p = &ps[snum];
@@ -1983,7 +1983,7 @@
case 6: i = ((p->scuba_amount+63)>>6); break;
case 7: i = (p->boot_amount>>1); break;
}
- invennum(284-30-o,200-6,(char)i,0,10+permbit);
+ invennum(284-30-o,200-6,(uint8_t )i,0,10+permbit);
if (j > 0) minitext(288-30-o,180,"ON",0,10+16+permbit);
else if (j != 0x80000000) minitext(284-30-o,180,"OFF",2,10+16+permbit);
if (p->inven_icon >= 6) minitext(284-35-o,180,"AUTO",2,10+16+permbit);
@@ -2139,7 +2139,7 @@
case 6: i = ((p->scuba_amount+63)>>6); break;
case 7: i = (p->boot_amount>>1); break;
}
- invennum(284-30-o,200-6,(char)i,0,10+permbit);
+ invennum(284-30-o,200-6,(uint8_t )i,0,10+permbit);
}
}
}
@@ -2152,7 +2152,7 @@
void tics(short offx, short offy, short color)
{
int32_t i;
- char fps[512], mapname[512];
+ uint8_t fps[512], mapname[512];
int32_t currentFps;
static int32_t fpsAvg = 0, savedFps = 0;
static boolean toggle = true;
@@ -2367,20 +2367,20 @@
fil = kopen4load("duke3d.bin",1);
if(fil == -1) return;
- kread(fil,(char *)0xb8000,4000);
+ kread(fil,(uint8_t *)0xb8000,4000);
kclose(fil);
#endif
}
-void gameexit(char *msg)
+void gameexit(uint8_t *msg)
{
short i;
- char t[256];
+ uint8_t t[256];
strncpy(t,msg,256); t[255] = 0;
- if(*t != 0) ps[myconnectindex].palette = (char *) &palette[0];
+ if(*t != 0) ps[myconnectindex].palette = (uint8_t *) &palette[0];
if(numplayers > 1)
allowtimetocorrecterrorswhenquitting();
@@ -2467,7 +2467,7 @@
short inputloc = 0;
-short strget(short x,short y,char *t,short dalen,short c)
+short strget(short x,short y,uint8_t *t,short dalen,short c)
{
short ch,sc;
@@ -2521,7 +2521,7 @@
if( c == 999 ) return(0);
if( c == 998 )
{
- char b[41],ii;
+ uint8_t b[41],ii;
for(ii=0;ii<inputloc;ii++)
b[ii] = '*';
b[ii] = 0;
@@ -3521,7 +3521,7 @@
return(i);
}
-char wallswitchcheck(short i)
+uint8_t wallswitchcheck(short i)
{
switch(PN)
{
@@ -5766,7 +5766,7 @@
{
l = s->z-hittype[ps[p].i].floorz+(3<<8);
if( l > 1024 && s->yrepeat > 32 && s->extra > 0 )
- s->yoffset = (signed char)(l/(s->yrepeat<<2));
+ s->yoffset = (int8_t )(l/(s->yrepeat<<2));
else s->yoffset=0;
}
@@ -6092,7 +6092,7 @@
#define NUMCHEATCODES 26
-char cheatquotes[NUMCHEATCODES][14] = {
+uint8_t cheatquotes[NUMCHEATCODES][14] = {
{"cornholio"}, // 0
{"stuff"}, // 1
{"scotty###"}, // 2
@@ -6123,7 +6123,7 @@
};
-char cheatbuf[10],cheatbuflen;
+uint8_t cheatbuf[10],cheatbuflen;
void cheats(void)
{
short ch, i, j, k, keystate, weapon;
@@ -6754,7 +6754,7 @@
if(ud.lockout == 0)
if(SoundToggle && ALT_IS_PRESSED && ( RTS_NumSounds() > 0 ) && rtsplaying == 0 && VoiceToggle )
{
- rtsptr = (char *)RTS_GetSound (i-1);
+ rtsptr = (uint8_t *)RTS_GetSound (i-1);
if(*rtsptr == 'C')
FX_PlayVOC3D( rtsptr,0,0,0,255,-i);
else FX_PlayWAV3D( rtsptr,0,0,0,255,-i);
@@ -7062,7 +7062,7 @@
-void comlinehelp(char **argv)
+void comlinehelp(uint8_t **argv)
{
printf("Command line help. %s [/flags...]\n",argv[0]);
puts(" ?, /? This help message");
@@ -7091,11 +7091,11 @@
printf("\n");
}
-void checkcommandline(int argc,char **argv)
+void checkcommandline(int argc,uint8_t **argv)
{
short i, j;
- char *c;
- char kbdKey;
+ uint8_t *c;
+ uint8_t kbdKey;
ud.fta_on = 1;
ud.god = 0;
@@ -7225,7 +7225,7 @@
c++;
if(*c)
{
- char fullpathgrpfile[16]; // 16 not enough
+ uint8_t fullpathgrpfile[16]; // 16 not enough
memset(fullpathgrpfile, 0, 16);
if( strchr(c,'.') == 0)
@@ -7451,9 +7451,9 @@
-void printstr(short x, short y, char string[81], char attribute)
+void printstr(short x, short y, uint8_t string[81], uint8_t attribute)
{
- char character;
+ uint8_t character;
short i, pos;
pos = (y*80+x)<<1;
@@ -7632,13 +7632,13 @@
void loadtmb(void)
{
- char tmb[8000];
+ uint8_t tmb[8000];
int32_t fil, l;
fil = kopen4load("d3dtimbr.tmb",0);
if(fil == -1) return;
l = kfilelength(fil);
- kread(fil,(char *)tmb,l);
+ kread(fil,(uint8_t *)tmb,l);
MUSIC_RegisterTimbreBank(tmb);
kclose(fil);
}
@@ -7663,9 +7663,9 @@
CONSOLE_Term();
}
-static char todd[] = "Duke Nukem 3D(tm) Copyright 1989, 1996 Todd Replogle and 3D Realms Entertainment";
-static char trees[] = "I want to make a game with trees";
-static char sixteen[] = "16 Possible Dukes";
+static uint8_t todd[] = "Duke Nukem 3D(tm) Copyright 1989, 1996 Todd Replogle and 3D Realms Entertainment";
+static uint8_t trees[] = "I want to make a game with trees";
+static uint8_t sixteen[] = "16 Possible Dukes";
/*
===================
@@ -7677,11 +7677,11 @@
void compilecons(void)
{
- char userconfilename[512];
+ uint8_t userconfilename[512];
- mymembuf = (char *)&hittype[0];
+ mymembuf = (uint8_t *)&hittype[0];
labelcode = (int32_t *)§or[0];
- label = (char *)&sprite[0];
+ label = (uint8_t *)&sprite[0];
sprintf(userconfilename, "%s", confilename);
@@ -7746,7 +7746,7 @@
if(numplayers > 1)
puts("Multiplayer initialized.");
- ps[myconnectindex].palette = (char *) &palette[0];
+ ps[myconnectindex].palette = (uint8_t *) &palette[0];
SetupGameButtons();
if(networkmode == 255)
@@ -7774,7 +7774,7 @@
}
-void sendscore(char *s)
+void sendscore(uint8_t *s)
{
if(numplayers > 1)
genericmultifunction(-1,s,strlen(s)+1,5);
@@ -7850,7 +7850,7 @@
for(i=0;i<10;i++)
{
ud.wchoice[myconnectindex][i] = ud.mywchoice[i];
- buf[l] = (char) ud.mywchoice[i];
+ buf[l] = (uint8_t ) ud.mywchoice[i];
l++;
}
@@ -7965,7 +7965,7 @@
}
-char testcd( char *fn )
+uint8_t testcd( uint8_t *fn )
{
#if PLATFORM_DOS
short drive_count, drive;
@@ -8031,7 +8031,7 @@
void copyprotect(void)
{
FILE *fp;
- char idfile[256];
+ uint8_t idfile[256];
return;
@@ -8058,12 +8058,12 @@
#ifdef _WIN32
-void findGRPToUse(char* game_dir,char* baseDir,char* groupfilefullpath)
+void findGRPToUse(uint8_t * game_dir,uint8_t * baseDir,uint8_t * groupfilefullpath)
{
WIN32_FIND_DATA FindFileData;
HANDLE hFind = INVALID_HANDLE_VALUE;
int i=0,kbdKey ;
- char groupfile[9][512];
+ uint8_t groupfile[9][512];
int grpID ;
if(game_dir[0] != '\0')
@@ -8115,9 +8115,9 @@
#else
-void findGRPToUse(char* game_dir,char* baseDir,char* groupfilefullpath){
+void findGRPToUse(uint8_t * game_dir,uint8_t * baseDir,uint8_t * groupfilefullpath){
- //char *grpName="DUKE3D.GRP";
+ //uint8_t *grpName="DUKE3D.GRP";
//sprintf(groupfilefullpath, "%s\\%s", game_dir, grpName);
sprintf(groupfilefullpath, "%s","/Users/fabiensanglard/Desktop/DUKE3D.GRP");
printf("The ONLY GRP location for this port is '%s'.\n",groupfilefullpath);
@@ -8129,10 +8129,10 @@
{
// FIX_00032: Added multi base GRP manager. Use duke3d*.grp to handle multiple grp.
- char groupfilefullpath[512];
+ uint8_t groupfilefullpath[512];
- char *baseDir="duke3d*.grp";
- //char *baseDir="DUKE3D.GRP";
+ uint8_t *baseDir="duke3d*.grp";
+ //uint8_t *baseDir="DUKE3D.GRP";
findGRPToUse(game_dir,baseDir,groupfilefullpath);
@@ -8142,15 +8142,15 @@
return(initgroupfile(groupfilefullpath) != -1);
}
-int main(int argc,char **argv)
+int main(int argc,char **argv)
{
int32_t i, j;
int32 iScriptHandle;
int32_t filehandle;
- char HEAD[2048], HEAD2[2048], HEADA[2048];
- char kbdKey;
- char *exe;
+ uint8_t HEAD[2048], HEAD2[2048], HEADA[2048];
+ uint8_t kbdKey;
+ uint8_t *exe;
//printf( "This is a debug version 19.7.1 only Based on 19.7\n"
@@ -8296,7 +8296,7 @@
if(game_dir[0] != '\0')
{
//FILE *fp = NULL;
- char setupfilename[128];
+ uint8_t setupfilename[128];
//Yes
sprintf(setupfilename, "%s\\%s", game_dir, SETUPFILENAME);
@@ -8702,13 +8702,13 @@
return(0);
}
-char opendemoread(char which_demo) // 0 = mine
+uint8_t opendemoread(uint8_t which_demo) // 0 = mine
{
- char d[] = "demo_.dmo";
- char *fname = d;
- char ver;
+ uint8_t d[] = "demo_.dmo";
+ uint8_t *fname = d;
+ uint8_t ver;
short i,j;
- char firstdemofile_[512];
+ uint8_t firstdemofile_[512];
int32 dummy;
int32_t groupefil_crc32_from_demo[MAXGROUPFILES];
@@ -8736,7 +8736,7 @@
}
kread(recfilep,&ud.reccnt,sizeof(long));
- kread(recfilep,&ver,sizeof(char));
+ kread(recfilep,&ver,sizeof(uint8_t ));
printf("%s has version = %d\n", fname, ver);
@@ -8787,11 +8787,11 @@
ud.playing_demo_rev = ver;
- kread(recfilep,(char *)&ud.volume_number,sizeof(char));
- kread(recfilep,(char *)&ud.level_number,sizeof(char));
- kread(recfilep,(char *)&ud.player_skill,sizeof(char));
- kread(recfilep,(char *)&ud.m_coop,sizeof(char));
- kread(recfilep,(char *)&ud.m_ffire,sizeof(char));
+ kread(recfilep,(uint8_t *)&ud.volume_number,sizeof(uint8_t ));
+ kread(recfilep,(uint8_t *)&ud.level_number,sizeof(uint8_t ));
+ kread(recfilep,(uint8_t *)&ud.player_skill,sizeof(uint8_t ));
+ kread(recfilep,(uint8_t *)&ud.m_coop,sizeof(uint8_t ));
+ kread(recfilep,(uint8_t *)&ud.m_ffire,sizeof(uint8_t ));
kread(recfilep,(short *)&ud.multimode,sizeof(short));
kread(recfilep,(short *)&ud.m_monsters_off,sizeof(short));
kread(recfilep,(int32 *)&ud.m_respawn_monsters,sizeof(int32));
@@ -8798,10 +8798,10 @@
kread(recfilep,(int32 *)&ud.m_respawn_items,sizeof(int32));
kread(recfilep,(int32 *)&ud.m_respawn_inventory,sizeof(int32));
kread(recfilep,(int32 *)&ud.playerai,sizeof(int32));
- kread(recfilep,(char *)&ud.user_name[0][0],sizeof(ud.user_name));
+ kread(recfilep,(uint8_t *)&ud.user_name[0][0],sizeof(ud.user_name));
// FIX_00034: Demos do not turn your run mode off anymore:
kread(recfilep,(int32 *)&dummy /*ud.auto_run*/,sizeof(int32)); // not needed and would affect autorun status in duke3d.cfg when quitting duke from a demo
- kread(recfilep,(char *)boardfilename,sizeof(boardfilename));
+ kread(recfilep,(uint8_t *)boardfilename,sizeof(boardfilename));
if( boardfilename[0] != 0 )
{
ud.m_level_number = 7;
@@ -8810,7 +8810,7 @@
for(i=0;i<ud.multimode;i++)
{
- kread(recfilep,(int32 *)&ps[i].aim_mode,sizeof(char));
+ kread(recfilep,(int32 *)&ps[i].aim_mode,sizeof(uint8_t ));
// FIX_00080: Out Of Synch in demos. Tries recovering OOS in old demos v27/28/29/116/117/118. New: v30/v119.
if(ver==BYTEVERSION)
@@ -8829,11 +8829,11 @@
void opendemowrite(void)
{
- char d[] = "demo1.dmo";
+ uint8_t d[] = "demo1.dmo";
int32_t dummylong = 0;
- char ver;
+ uint8_t ver;
short i;
- char fullpathdemofilename[16];
+ uint8_t fullpathdemofilename[16];
if(ud.recstat == 2) kclose(recfilep);
@@ -8856,14 +8856,14 @@
if ((frecfilep = fopen(fullpathdemofilename,"wb")) == NULL) return;
// CTW END - MODIFICATION
fwrite(&dummylong,4,1,frecfilep);
- fwrite(&ver,sizeof(char),1,frecfilep);
+ fwrite(&ver,sizeof(uint8_t ),1,frecfilep);
// FIX_00062: Better support and identification for GRP and CON files for 1.3/1.3d/1.4/1.5
fwrite((int32_t *)groupefil_crc32,sizeof(groupefil_crc32),1,frecfilep);
- fwrite((char *)&ud.volume_number,sizeof(char),1,frecfilep);
- fwrite((char *)&ud.level_number,sizeof(char),1,frecfilep);
- fwrite((char *)&ud.player_skill,sizeof(char),1,frecfilep);
- fwrite((char *)&ud.m_coop,sizeof(char),1,frecfilep);
- fwrite((char *)&ud.m_ffire,sizeof(char),1,frecfilep);
+ fwrite((uint8_t *)&ud.volume_number,sizeof(uint8_t ),1,frecfilep);
+ fwrite((uint8_t *)&ud.level_number,sizeof(uint8_t ),1,frecfilep);
+ fwrite((uint8_t *)&ud.player_skill,sizeof(uint8_t ),1,frecfilep);
+ fwrite((uint8_t *)&ud.m_coop,sizeof(uint8_t ),1,frecfilep);
+ fwrite((uint8_t *)&ud.m_ffire,sizeof(uint8_t ),1,frecfilep);
fwrite((short *)&ud.multimode,sizeof(short),1,frecfilep);
fwrite((short *)&ud.m_monsters_off,sizeof(short),1,frecfilep);
fwrite((int32 *)&ud.m_respawn_monsters,sizeof(int32),1,frecfilep);
@@ -8870,13 +8870,13 @@
fwrite((int32 *)&ud.m_respawn_items,sizeof(int32),1,frecfilep);
fwrite((int32 *)&ud.m_respawn_inventory,sizeof(int32),1,frecfilep);
fwrite((int32 *)&ud.playerai,sizeof(int32),1,frecfilep);
- fwrite((char *)&ud.user_name[0][0],sizeof(ud.user_name),1,frecfilep);
+ fwrite((uint8_t *)&ud.user_name[0][0],sizeof(ud.user_name),1,frecfilep);
fwrite((int32 *)&ud.auto_run,sizeof(int32),1,frecfilep);
- fwrite((char *)boardfilename,sizeof(boardfilename),1,frecfilep);
+ fwrite((uint8_t *)boardfilename,sizeof(boardfilename),1,frecfilep);
for(i=0;i<ud.multimode;i++)
{
- fwrite((int32 *)&ps[i].aim_mode,sizeof(char),1,frecfilep); // seems wrong; prolly not needed anyway
+ fwrite((int32 *)&ps[i].aim_mode,sizeof(uint8_t ),1,frecfilep); // seems wrong; prolly not needed anyway
// FIX_00080: Out Of Synch in demos. Tries recovering OOS in old demos v27/28/29/116/117/118. New: v30/v119.
fwrite(ud.wchoice[i],sizeof(ud.wchoice[0]),1,frecfilep);
}
@@ -8935,16 +8935,16 @@
// Seems to happen when player input starts being simulated, but just guessing.
// This change effectively disables it. The related code is still enabled.
// (This is working on Linux, so I flipped it back to '1'. --ryan.)
- char which_demo = 1;
+ uint8_t which_demo = 1;
// CTW END - MODIFICATION
-char in_menu = 0;
+uint8_t in_menu = 0;
// extern int32_t syncs[];
int32_t playback(void)
{
int32_t i,j,k,l,t;
- char foundemo;
+ uint8_t foundemo;
#ifdef DBGRECORD
FILE * pFile;
#endif
@@ -9141,7 +9141,7 @@
return 1;
}
-char moveloop()
+uint8_t moveloop()
{
int32_t i;
@@ -9206,7 +9206,7 @@
int32_t i, j, k, doubvel, fz, cz, hz, lz, x, y;
uint32_t sb_snum;
short psect, psectlotag, tempsect, backcstat;
- char shrunk, spritebridge;
+ uint8_t shrunk, spritebridge;
syn = (input *)&inputfifo[fakemovefifoplc&(MOVEFIFOSIZ-1)][myconnectindex];
@@ -9638,10 +9638,10 @@
}
-char domovethings(void)
+uint8_t domovethings(void)
{
short i, j;
- char ch;
+ uint8_t ch;
#ifdef DBGRECORD
FILE *pFile;
@@ -9780,7 +9780,7 @@
if ((numplayers >= 2) && ((movefifoplc&7) == 7))
{
- ch = (char)(randomseed&255);
+ ch = (uint8_t )(randomseed&255);
for(i=connecthead;i>=0;i=connectpoint2[i])
ch += ((ps[i].posx+ps[i].posy+ps[i].posz+ps[i].ang+ps[i].horiz)&255);
syncval[myconnectindex][syncvalhead[myconnectindex]&(MOVEFIFOSIZ-1)] = ch;
@@ -9883,7 +9883,7 @@
totalclock = 0;while( !KB_KeyWaiting() ) getpackets();
}
-void dobonus(char bonusonly)
+void dobonus(uint8_t bonusonly)
{
short t, tinc,gfx_offset;
int32_t i, y,xfragtotal,yfragtotal;
@@ -10437,7 +10437,7 @@
void cameratext(short i)
{
- char flipbits;
+ uint8_t flipbits;
int32_t x , y;
if(!T1)
@@ -10740,9 +10740,9 @@
// makes smaller files. Doesn't freeze or lag the game anymore.
void takescreenshot(void)
{
- char szFilename[256];
+ uint8_t szFilename[256];
int i;
- char score[20];
+ uint8_t score[20];
time_t time4file;
struct tm *tmHMS;
@@ -10763,7 +10763,7 @@
if(ud.multimode>1) // if more than 1 player, we add name. Then add score if DM
{
- strcat((char*)tempbuf, " [");
+ strcat((uint8_t *)tempbuf, " [");
for(i=connecthead;i>=0;i=connectpoint2[i])
{
if(!ud.user_name[i][0])
--- a/Game/src/game.h
+++ b/Game/src/game.h
@@ -1,8 +1,8 @@
#ifndef _GAME_H_
#define _GAME_H_
-//extern char game_dir[512];
-char* getgamedir();
+//extern uint8_t game_dir[512];
+uint8_t * getgamedir();
#endif // include-once header.
--- a/Game/src/gamedef.c
+++ b/Game/src/gamedef.c
@@ -30,7 +30,7 @@
extern short otherp;
static short total_lines,line_number;
-static char checking_ifelse,parsing_state,*last_used_text;
+static uint8_t checking_ifelse,parsing_state,*last_used_text;
static short num_squigilly_brackets;
static int32_t last_used_size;
@@ -42,13 +42,13 @@
#define NUMKEYWORDS 112
//From global.c
-void FixFilePath(char *filename);
+void FixFilePath(uint8_t *filename);
//From actors.c
void lotsofmail(spritetype *s, short n);
void lotsofpaper(spritetype *s, short n);
-char *keyw[NUMKEYWORDS] =
+uint8_t *keyw[NUMKEYWORDS] =
{
"definelevelname", // 0
"actor", // 1 [#]
@@ -183,7 +183,7 @@
}
}
-char ispecial(char c)
+uint8_t ispecial(uint8_t c)
{
if(c == 0x0a)
{
@@ -197,7 +197,7 @@
return 0;
}
-char isaltok(char c)
+uint8_t isaltok(uint8_t c)
{
return ( isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.');
}
@@ -311,7 +311,7 @@
int32_t keyword(void)
{
int32_t i;
- char *temptextptr;
+ uint8_t *temptextptr;
temptextptr = textptr;
@@ -331,7 +331,7 @@
tempbuf[i] = 0;
for(i=0;i<NUMKEYWORDS;i++)
- if( strcmp( (const char*)tempbuf,keyw[i]) == 0 )
+ if( strcmp( (const uint8_t *)tempbuf,keyw[i]) == 0 )
return i;
return -1;
@@ -359,7 +359,7 @@
for(i=0;i<NUMKEYWORDS;i++)
{
- if( strcmp( (const char*)tempbuf,keyw[i]) == 0 )
+ if( strcmp( (const uint8_t *)tempbuf,keyw[i]) == 0 )
{
*scriptptr = i;
textptr += l;
@@ -418,7 +418,7 @@
for(i=0;i<labelcnt;i++)
{
- if( strcmp((const char*)tempbuf,label+(i<<6)) == 0 )
+ if( strcmp((const uint8_t *)tempbuf,label+(i<<6)) == 0 )
{
*scriptptr = labelcode[i];
scriptptr++;
@@ -442,10 +442,10 @@
}
-char parsecommand(int readfromGRP)
+uint8_t parsecommand(int readfromGRP)
{
int32_t i, j, k, *tempscrptr;
- char done, *origtptr, temp_ifelse_check, tw;
+ uint8_t done, *origtptr, temp_ifelse_check, tw;
short temp_line_number;
int fp;
@@ -698,7 +698,7 @@
return 0;
case 55: // include other con files.
{
- char includedconfile[512];
+ uint8_t includedconfile[512];
scriptptr--;
while( isaltok(*textptr) == 0 )
{
@@ -715,7 +715,7 @@
tempbuf[j] = '\0';
// fix path for unix. (doesn't really matter...)
- FixFilePath((char*)tempbuf);
+ FixFilePath((uint8_t *)tempbuf);
/*
// Are we loading a TC?
if(game_dir[0] != '\0')
@@ -755,7 +755,7 @@
*(textptr+j) = 0;
- kread(fp,(char *)textptr,j);
+ kread(fp,(uint8_t *)textptr,j);
kclose(fp);
ud.conCRC[0] = crc32_update((uint8_t *)textptr, j, ud.conCRC[0]);
@@ -1504,7 +1504,7 @@
}
-char *defaultcons[3] =
+uint8_t *defaultcons[3] =
{
"GAME.CON",
"USER.CON",
@@ -1548,10 +1548,10 @@
}
}
-void loadefs(char *filenam, char *mptr, int readfromGRP)
+void loadefs(uint8_t *filenam, uint8_t *mptr, int readfromGRP)
{
int32_t fs,fp;
- char kbdKey;
+ uint8_t kbdKey;
memset(script, 0, sizeof(script));
@@ -1568,10 +1568,10 @@
fs = kfilelength(fp);
- last_used_text = textptr = (char *) mptr;
+ last_used_text = textptr = (uint8_t *) mptr;
last_used_size = fs;
- kread(fp,(char *)textptr,fs);
+ kread(fp,(uint8_t *)textptr,fs);
kclose(fp);
ud.conCRC[0]=0;
ud.conCRC[0] = crc32_update((uint8_t *)textptr, fs, ud.conCRC[0]);
@@ -1672,7 +1672,7 @@
}
}
-char dodge(spritetype *s)
+uint8_t dodge(spritetype *s)
{
short i;
int32_t bx,by,mx,my,bxvect,byvect,mxvect,myvect,d;
@@ -2035,7 +2035,7 @@
}
}
-char parse(void);
+uint8_t parse(void);
void parseifelse(int32_t condition)
{
@@ -2057,7 +2057,7 @@
// int32_t *it = 0x00589a04;
-char parse(void)
+uint8_t parse(void)
{
int32_t j, l, s;
@@ -2315,9 +2315,9 @@
break;
case 99:
insptr++;
- g_sp->xrepeat = (char) *insptr;
+ g_sp->xrepeat = (uint8_t ) *insptr;
insptr++;
- g_sp->yrepeat = (char) *insptr;
+ g_sp->yrepeat = (uint8_t ) *insptr;
insptr++;
break;
case 13:
@@ -3134,7 +3134,7 @@
void execute(short i,short p,int32_t x)
{
- char done;
+ uint8_t done;
g_i = i;
g_p = p;
--- a/Game/src/global.c
+++ b/Game/src/global.c
@@ -32,8 +32,8 @@
#include "duke3d.h"
-char *mymembuf;
-char MusicPtr[72000];
+uint8_t *mymembuf;
+uint8_t MusicPtr[72000];
crc32_t crc32lookup[] = {
@@ -89,11 +89,11 @@
int32_t msx[2048],msy[2048];
short cyclers[MAXCYCLERS][6],numcyclers;
-char fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
+uint8_t fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
uint8_t tempbuf[2048], packbuf[576];
-char buf[80];
+uint8_t buf[80];
short camsprite;
short mirrorwall[64], mirrorsector[64], mirrorcnt;
@@ -100,19 +100,19 @@
int current_menu;
-char betaname[80];
+uint8_t betaname[80];
-char level_names[44][33],level_file_names[44][128];
+uint8_t level_names[44][33],level_file_names[44][128];
int32_t partime[44],designertime[44];
-char volume_names[4][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY", "" }; // Names are not in 1.3 con files. MUST be in code.
-char skill_names[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD", "" };
+uint8_t volume_names[4][33] = { "L.A. MELTDOWN", "LUNAR APOCALYPSE", "SHRAPNEL CITY", "" }; // Names are not in 1.3 con files. MUST be in code.
+uint8_t skill_names[5][33] = { "PIECE OF CAKE", "LET'S ROCK", "COME GET SOME", "DAMN I'M GOOD", "" };
volatile int32_t checksume;
int32_t soundsiz[NUM_SOUNDS];
short soundps[NUM_SOUNDS],soundpe[NUM_SOUNDS],soundvo[NUM_SOUNDS];
-char soundm[NUM_SOUNDS],soundpr[NUM_SOUNDS];
-char sounds[NUM_SOUNDS][14];
+uint8_t soundm[NUM_SOUNDS],soundpr[NUM_SOUNDS];
+uint8_t sounds[NUM_SOUNDS][14];
short title_zoom;
@@ -121,7 +121,7 @@
SAMPLE Sound[ NUM_SOUNDS ];
SOUNDOWNER SoundOwner[NUM_SOUNDS][4];
-char numplayersprites,earthquaketime;
+uint8_t numplayersprites,earthquaketime;
int32_t fricxv,fricyv;
struct player_orig po[MAXPLAYERS];
@@ -128,8 +128,8 @@
struct player_struct ps[MAXPLAYERS];
struct user_defs ud;
-char pus, pub;
-char syncstat, syncval[MAXPLAYERS][MOVEFIFOSIZ];
+uint8_t pus, pub;
+uint8_t syncstat, syncval[MAXPLAYERS][MOVEFIFOSIZ];
int32_t syncvalhead[MAXPLAYERS], syncvaltail, syncvaltottail;
input sync[MAXPLAYERS], loc;
@@ -149,22 +149,22 @@
//Game recording variables
-char playerreadyflag[MAXPLAYERS],ready2send;
-char playerquitflag[MAXPLAYERS];
+uint8_t playerreadyflag[MAXPLAYERS],ready2send;
+uint8_t playerquitflag[MAXPLAYERS];
int32_t vel, svel, angvel, horiz, ototalclock, respawnactortime=768, respawnitemtime=768, groupfile;
int32_t script[MAXSCRIPTSIZE],*scriptptr,*insptr,*labelcode,labelcnt;
int32_t *actorscrptr[MAXTILES],*parsing_actor;
-char *label,*textptr,error,warning,killit_flag;
-char *music_pointer;
-char actortype[MAXTILES];
+uint8_t *label,*textptr,error,warning,killit_flag;
+uint8_t *music_pointer;
+uint8_t actortype[MAXTILES];
-char display_mirror,typebuflen,typebuf[41];
+uint8_t display_mirror,typebuflen,typebuf[41];
-char music_fn[4][11][13],music_select;
-char env_music_fn[4][13];
-char rtsplaying;
+uint8_t music_fn[4][11][13],music_select;
+uint8_t env_music_fn[4][13];
+uint8_t rtsplaying;
short weaponsandammosprites[15] = {
@@ -192,7 +192,7 @@
short myhoriz, omyhoriz, myhorizoff, omyhorizoff;
short myang, omyang, mycursectnum, myjumpingcounter,frags[MAXPLAYERS][MAXPLAYERS];
-char myjumpingtoggle, myonground, myhardlanding, myreturntocenter;
+uint8_t myjumpingtoggle, myonground, myhardlanding, myreturntocenter;
int8_t multiwho, multipos, multiwhat, multiflag;
int32_t fakemovefifoplc,movefifoplc;
@@ -200,11 +200,11 @@
int32_t myhorizbak[MOVEFIFOSIZ],dukefriction = 0xcc00, show_shareware;
short myangbak[MOVEFIFOSIZ];
-char myname[2048] = {"XDUKE"};
-char camerashitable,freezerhurtowner=0,lasermode;
+uint8_t myname[2048] = {"XDUKE"};
+uint8_t camerashitable,freezerhurtowner=0,lasermode;
// CTW - MODIFICATION
-// char networkmode = 255, movesperpacket = 1,gamequit = 0,playonten = 0,everyothertime;
-char networkmode = 255, movesperpacket = 1,gamequit = 0,everyothertime;
+// uint8_t networkmode = 255, movesperpacket = 1,gamequit = 0,playonten = 0,everyothertime;
+uint8_t networkmode = 255, movesperpacket = 1,gamequit = 0,everyothertime;
// CTW END - MODIFICATION
int32_t numfreezebounces=3,rpgblastradius,pipebombblastradius,tripbombblastradius,shrinkerblastradius,morterblastradius,bouncemineblastradius,seenineblastradius;
STATUSBARTYPE sbar;
@@ -221,11 +221,11 @@
// portability stuff. --ryan.
// A good portion of this was ripped from GPL'd Rise of the Triad. --ryan.
-void FixFilePath(char *filename)
+void FixFilePath(uint8_t *filename)
{
#if PLATFORM_UNIX
- char *ptr;
- char *lastsep = filename;
+ uint8_t *ptr;
+ uint8_t *lastsep = filename;
if ((!filename) || (*filename == '\0'))
return;
@@ -240,7 +240,7 @@
if ((*ptr == PATH_SEP_CHAR) || (*ptr == '\0'))
{
- char pch = *ptr;
+ uint8_t pch = *ptr;
struct dirent *dent = NULL;
DIR *dir;
@@ -301,7 +301,7 @@
/* no-op. */
#elif PLATFORM_WIN32
-int _dos_findfirst(char *filename, int x, struct find_t *f)
+int _dos_findfirst(uint8_t *filename, int x, struct find_t *f)
{
int32_t rc = _findfirst(filename, &f->data);
f->handle = rc;
@@ -334,9 +334,9 @@
}
#elif defined(PLATFORM_UNIX) || defined(PLATFORM_MACOSX)
-int _dos_findfirst(char *filename, int x, struct find_t *f)
+int _dos_findfirst(uint8_t *filename, int x, struct find_t *f)
{
- char *ptr;
+ uint8_t *ptr;
if (strlen(filename) >= sizeof (f->pattern))
return(1);
@@ -361,7 +361,7 @@
}
-static int check_pattern_nocase(const char *x, const char *y)
+static int check_pattern_nocase(const uint8_t *x, const uint8_t *y)
{
if ((x == NULL) || (y == NULL))
return(0); /* not a match. */
@@ -494,7 +494,7 @@
return (ix - (ix>>4) + (t>>2) + (t>>3));
}
#include "SDL.h"
-void Error (int errorType, char *error, ...)
+void Error (int errorType, uint8_t *error, ...)
{
va_list argptr;
@@ -517,12 +517,12 @@
exit (errorType);
}
-void write2disk(int line, char* cfilename, char *filename2write, char *message)
+void write2disk(int line, uint8_t * cfilename, uint8_t *filename2write, uint8_t *message)
{
- // usage: write2disk(__LINE__, __FILE__, "c:\temp\my_dbug_file.txt", char* msg);
+ // usage: write2disk(__LINE__, __FILE__, "c:\temp\my_dbug_file.txt", uint8_t * msg);
int i, k=0;
- char filename[2048];
+ uint8_t filename[2048];
FILE *pFile;
for(i=0; cfilename[i]; i++)
@@ -539,10 +539,10 @@
fclose(pFile);
}
-int32 SafeOpenAppend (const char *_filename, int32 filetype)
+int32 SafeOpenAppend (const uint8_t *_filename, int32 filetype)
{
int handle;
- char filename[MAX_PATH];
+ uint8_t filename[MAX_PATH];
strncpy(filename, _filename, sizeof (filename));
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
@@ -560,9 +560,9 @@
return handle;
}
-boolean SafeFileExists ( const char * _filename )
+boolean SafeFileExists ( const uint8_t * _filename )
{
- char filename[MAX_PATH];
+ uint8_t filename[MAX_PATH];
strncpy(filename, _filename, sizeof (filename));
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
@@ -575,10 +575,10 @@
}
-int32 SafeOpenWrite (const char *_filename, int32 filetype)
+int32 SafeOpenWrite (const uint8_t *_filename, int32 filetype)
{
int handle;
- char filename[MAX_PATH];
+ uint8_t filename[MAX_PATH];
strncpy(filename, _filename, sizeof (filename));
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
@@ -596,10 +596,10 @@
return handle;
}
-int32 SafeOpenRead (const char *_filename, int32 filetype)
+int32 SafeOpenRead (const uint8_t *_filename, int32 filetype)
{
int handle;
- char filename[MAX_PATH];
+ uint8_t filename[MAX_PATH];
strncpy(filename, _filename, sizeof (filename));
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
@@ -642,7 +642,7 @@
}
}
-void SafeWriteString (int handle, char * buffer)
+void SafeWriteString (int handle, uint8_t * buffer)
{
unsigned iocount;
@@ -827,9 +827,9 @@
*/
#if PLATFORM_UNIX
-char *strlwr(char *s)
+uint8_t *strlwr(uint8_t *s)
{
- char *p = s;
+ uint8_t *p = s;
while (*p) {
*p = tolower(*p);
@@ -839,9 +839,9 @@
return s;
}
-char *strupr(char *s)
+uint8_t *strupr(uint8_t *s)
{
- char *p = s;
+ uint8_t *p = s;
while (*p) {
*p = toupper(*p);
@@ -851,7 +851,7 @@
return s;
}
-char *itoa(int value, char *string, int radix)
+uint8_t *itoa(int value, uint8_t *string, int radix)
{
switch (radix) {
case 10:
@@ -868,7 +868,7 @@
return string;
}
-char *ltoa(int32_t value, char *string, int radix)
+uint8_t *ltoa(int32_t value, uint8_t *string, int radix)
{
switch (radix) {
case 10:
@@ -885,7 +885,7 @@
return string;
}
-char *ultoa(unsigned int32_t value, char *string, int radix)
+uint8_t *ultoa(unsigned int32_t value, uint8_t *string, int radix)
{
switch (radix) {
case 10:
@@ -903,7 +903,7 @@
}
#endif
-char ApogeePath[256];
+uint8_t ApogeePath[256];
int setup_homedir (void)
{
@@ -927,7 +927,7 @@
}
-char CheckParm (char *check)
+uint8_t CheckParm (uint8_t *check)
{
int i;
for (i = 1; i < _argc; i++)
@@ -963,5 +963,5 @@
* BUILD_CACHEDEBUG 0 at the top of the source. Flip it to 1 if you ever
* need to tinker in the cache code.
*/
-char cachedebug = 0;
+uint8_t cachedebug = 0;
--- a/Game/src/keyboard.c
+++ b/Game/src/keyboard.c
@@ -40,9 +40,9 @@
static volatile boolean keyIsWaiting = 0;
-static char scancodeToASCII[ MAXKEYBOARDSCAN ];
-static char shiftedScancodeToASCII[ MAXKEYBOARDSCAN ];
-static char extscanToSC[ MAXKEYBOARDSCAN ];
+static uint8_t scancodeToASCII[ MAXKEYBOARDSCAN ];
+static uint8_t shiftedScancodeToASCII[ MAXKEYBOARDSCAN ];
+static uint8_t extscanToSC[ MAXKEYBOARDSCAN ];
/*
=============================================================================
@@ -110,7 +110,7 @@
return keyIsWaiting;
}
-char KB_Getch( void )
+uint8_t KB_Getch( void )
{
while (!keyIsWaiting) { _idle(); /* pull the pud. */ }
@@ -124,7 +124,7 @@
return scancodeToASCII[KB_LastScan];
}
-void KB_Addch( char ch )
+void KB_Addch( uint8_t ch )
{
STUBBED("KB_Addch");
}
@@ -144,7 +144,7 @@
}
static struct {
- char* name;
+ char * name;
int code;
} keyname2scancode[] = {
{ ",", sc_Comma },
@@ -252,7 +252,7 @@
{ NULL, 0 }
};
-char *KB_ScanCodeToString( kb_scancode scancode )
+uint8_t *KB_ScanCodeToString( kb_scancode scancode )
{
int i;
for(i = 0; keyname2scancode[i].name != NULL; i++)
@@ -264,9 +264,9 @@
return NULL;
}
-kb_scancode KB_StringToScanCode( char * string )
+kb_scancode KB_StringToScanCode( uint8_t * string )
{
- char* name = NULL;
+ uint8_t * name = NULL;
int32 i=0;
name = keyname2scancode[i].name;
for(;name;++i, name=keyname2scancode[i].name)
--- a/Game/src/keyboard.h
+++ b/Game/src/keyboard.h
@@ -206,12 +206,12 @@
void KB_KeyEvent( int scancode, boolean keypressed ); // Interprets scancodes
boolean KB_KeyWaiting( void ); // Checks if a character is waiting in the keyboard queue
-char KB_Getch( void ); // Gets the next keypress
-void KB_Addch( char ch ); // Adds key to end of queue
+uint8_t KB_Getch( void ); // Gets the next keypress
+void KB_Addch( uint8_t ch ); // Adds key to end of queue
void KB_FlushKeyboardQueue( void ); // Empties the keyboard queue of all waiting characters.
void KB_ClearKeysDown( void ); // Clears all keys down flags.
-char * KB_ScanCodeToString( kb_scancode scancode ); // convert scancode into a string
-kb_scancode KB_StringToScanCode( char * string ); // convert a string into a scancode
+uint8_t * KB_ScanCodeToString( kb_scancode scancode ); // convert scancode into a string
+kb_scancode KB_StringToScanCode( uint8_t * string ); // convert a string into a scancode
void KB_TurnKeypadOn( void ); // turn the keypad on
void KB_TurnKeypadOff( void ); // turn the keypad off
boolean KB_KeypadActive( void ); // check whether keypad is active
--- a/Game/src/menues.c
+++ b/Game/src/menues.c
@@ -34,15 +34,15 @@
extern SDL_Surface *surface;
extern short inputloc;
extern int recfilep;
-extern char vgacompatible;
+extern uint8_t vgacompatible;
short probey=0,lastprobey=0,last_menu,globalskillsound=-1;
short sh,onbar,buttonstat,deletespot;
short last_zero,last_fifty,last_threehundred = 0;
-static char fileselect = 1, menunamecnt, menuname[256][17];
+static uint8_t fileselect = 1, menunamecnt, menuname[256][17];
// File tree info
//
-char szCurrentDirectory[1024] = {'\0'};
+uint8_t szCurrentDirectory[1024] = {'\0'};
#define FILETYPE_DIRECTORY 0
#define FILETYPE_FILE 1
@@ -49,7 +49,7 @@
typedef struct fileentry
{
- char filename[16];
+ uint8_t filename[16];
int type;
}FILEENTRY;
@@ -77,7 +77,7 @@
#define eTenBnBadTenInst 3805
int tenBnStart(void);
-void tenBnSetBrowseRtn(char *(*rtn)(char *str, int len));
+void tenBnSetBrowseRtn(uint8_t *(*rtn)(uint8_t *str, int len));
void tenBnSetExitRtn(void (*rtn)(void));
void tenBnSetEndRtn(void (*rtn)(void));*/
// CTW END - REMOVED
@@ -86,7 +86,7 @@
{
}
-void dummymess(int i,char *c)
+void dummymess(int i,uint8_t *c)
{
}
@@ -146,13 +146,13 @@
}
-void savetemp(char *fn,int32_t daptr,int32_t dasiz)
+void savetemp(uint8_t *fn,int32_t daptr,int32_t dasiz)
{
int fp;
fp = open(fn,O_WRONLY|O_CREAT|O_TRUNC|O_BINARY,S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP);
- write(fp,(char *)daptr,dasiz);
+ write(fp,(uint8_t *)daptr,dasiz);
close(fp);
}
@@ -175,10 +175,10 @@
}
}
-int loadpheader(char spot,int32 *vn,int32 *ln,int32 *psk,int32 *nump)
+int loadpheader(uint8_t spot,int32 *vn,int32 *ln,int32 *psk,int32 *nump)
{
- char fn[] = "game0.sav";
+ uint8_t fn[] = "game0.sav";
int32_t fil;
int32_t bv;
@@ -205,7 +205,7 @@
if (waloff[MAXTILES-3] == 0) allocache(&waloff[MAXTILES-3],160*100,&walock[MAXTILES-3]);
tilesizx[MAXTILES-3] = 100; tilesizy[MAXTILES-3] = 160;
- kdfread((char *)waloff[MAXTILES-3],160,100,fil);
+ kdfread((uint8_t *)waloff[MAXTILES-3],160,100,fil);
kclose(fil);
@@ -216,9 +216,9 @@
int loadplayer(int8_t spot)
{
short k,music_changed;
- char fn[] = "game0.sav";
- char mpfn[] = "gameA_00.sav";
- char *fnptr, scriptptrs[MAXSCRIPTSIZE];
+ uint8_t fn[] = "game0.sav";
+ uint8_t mpfn[] = "gameA_00.sav";
+ uint8_t *fnptr, scriptptrs[MAXSCRIPTSIZE];
int32_t fil, bv, i, j, x;
int32 nump;
@@ -316,7 +316,7 @@
walock[MAXTILES-3] = 1;
if (waloff[MAXTILES-3] == 0) allocache(&waloff[MAXTILES-3],160*100,&walock[MAXTILES-3]);
tilesizx[MAXTILES-3] = 100; tilesizy[MAXTILES-3] = 160;
- kdfread((char *)waloff[MAXTILES-3],160,100,fil);
+ kdfread((uint8_t *)waloff[MAXTILES-3],160,100,fil);
kdfread(&numwalls,2,1,fil);
kdfread(&wall[0],sizeof(walltype),MAXWALLS,fil);
@@ -343,8 +343,8 @@
kdfread(&mirrorcnt,sizeof(short),1,fil);
kdfread(&mirrorwall[0],sizeof(short),64,fil);
kdfread(&mirrorsector[0],sizeof(short),64,fil);
- kdfread(&show2dsector[0],sizeof(char),MAXSECTORS>>3,fil);
- kdfread(&actortype[0],sizeof(char),MAXTILES,fil);
+ kdfread(&show2dsector[0],sizeof(uint8_t ),MAXSECTORS>>3,fil);
+ kdfread(&actortype[0],sizeof(uint8_t ),MAXTILES,fil);
kdfread(&boardfilename[0],sizeof(boardfilename),1,fil);
kdfread(&numclouds,sizeof(numclouds),1,fil);
@@ -542,12 +542,12 @@
int saveplayer(int8_t spot)
{
int32_t i, j;
- char fn[] = "game0.sav";
- char mpfn[] = "gameA_00.sav";
- char *fnptr,scriptptrs[MAXSCRIPTSIZE];
+ uint8_t fn[] = "game0.sav";
+ uint8_t mpfn[] = "gameA_00.sav";
+ uint8_t *fnptr,scriptptrs[MAXSCRIPTSIZE];
FILE *fil;
int32_t bv = BYTEVERSION;
- char fullpathsavefilename[16];
+ uint8_t fullpathsavefilename[16];
if(spot < 0)
{
@@ -601,7 +601,7 @@
dfwrite(&ud.volume_number,sizeof(ud.volume_number),1,fil);
dfwrite(&ud.level_number,sizeof(ud.level_number),1,fil);
dfwrite(&ud.player_skill,sizeof(ud.player_skill),1,fil);
- dfwrite((char *)waloff[MAXTILES-1],160,100,fil);
+ dfwrite((uint8_t *)waloff[MAXTILES-1],160,100,fil);
dfwrite(&numwalls,2,1,fil);
dfwrite(&wall[0],sizeof(walltype),MAXWALLS,fil);
@@ -628,8 +628,8 @@
dfwrite(&mirrorcnt,sizeof(short),1,fil);
dfwrite(&mirrorwall[0],sizeof(short),64,fil);
dfwrite(&mirrorsector[0],sizeof(short),64,fil);
- dfwrite(&show2dsector[0],sizeof(char),MAXSECTORS>>3,fil);
- dfwrite(&actortype[0],sizeof(char),MAXTILES,fil);
+ dfwrite(&show2dsector[0],sizeof(uint8_t ),MAXSECTORS>>3,fil);
+ dfwrite(&actortype[0],sizeof(uint8_t ),MAXTILES,fil);
dfwrite(&boardfilename[0],sizeof(boardfilename),1,fil);
dfwrite(&numclouds,sizeof(numclouds),1,fil);
@@ -903,7 +903,7 @@
}
}
-int menutext(int x,int y,short s,short p,char *t)
+int menutext(int x,int y,short s,short p,uint8_t *t)
{
short i, ac, centre;
@@ -1018,7 +1018,7 @@
return (x);
}
-int menutextc(int x,int y,short s,short p,char *t)
+int menutextc(int x,int y,short s,short p,uint8_t *t)
{
short i, ac, centre;
@@ -1121,10 +1121,10 @@
}
-void bar(int x,int y,short *p,short dainc,char damodify,short s, short pa)
+void bar(int x,int y,short *p,short dainc,uint8_t damodify,short s, short pa)
{
short xloc;
- char rev;
+ uint8_t rev;
if(dainc < 0) { dainc = -dainc; rev = 1; }
else rev = 0;
@@ -1231,7 +1231,7 @@
// We DO have a _dos_findfirst implementation now...maybe use that instead?
// --ryan.
#if ORIGINAL_DUKE3D_GETFILENAMES
-int getfilenames(char kind[6])
+int getfilenames(uint8_t kind[6])
{
short type;
struct find_t fileinfo;
@@ -1266,7 +1266,7 @@
#else
-int getfilenames(char kind[6])
+int getfilenames(uint8_t kind[6])
{
/* !!! FIXME: Visual C? */
#if (defined __WATCOMC__)
@@ -1304,7 +1304,7 @@
struct dirent *dent;
struct stat statbuf;
int add_this;
- char *ptr = NULL;
+ uint8_t *ptr = NULL;
int len = 0;
int subdirs = 0;
@@ -1335,7 +1335,7 @@
len = strlen(dent->d_name);
if (len >= 5)
{
- ptr = ((char *) dent->d_name) + len;
+ ptr = ((uint8_t *) dent->d_name) + len;
ptr += strlen(ptr) - 4;
if (stricmp(ptr, ".MAP") == 0)
add_this = 1;
@@ -1363,7 +1363,7 @@
void sortfilenames()
{
- char sortbuffer[17];
+ uint8_t sortbuffer[17];
int32_t i, j, k;
for(i=1;i<menunamecnt;i++)
@@ -4171,10 +4171,10 @@
}
}
-void palto(char r,char g,char b,int32_t e)
+void palto(uint8_t r,uint8_t g,uint8_t b,int32_t e)
{
int i;
- char temparray[768];
+ uint8_t temparray[768];
for(i=0;i<768;i+=3)
{
@@ -4204,7 +4204,7 @@
int32_t xrepeat, yrepeat, z1, z2, startwall, endwall, tilenum, daang;
int32_t xvect, yvect, xvect2, yvect2;
short p;
- char col;
+ uint8_t col;
walltype *wal, *wal2;
spritetype *spr;
@@ -4300,7 +4300,7 @@
{
x1 = sprx; y1 = spry;
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
if ((spr->cstat&4) > 0) xoff = -xoff;
k = spr->ang; l = spr->xrepeat;
dax = sintable[k&2047]*l; day = sintable[(k+1536)&2047]*l;
@@ -4325,8 +4325,8 @@
case 32:
tilenum = spr->picnum;
- xoff = (long)((signed char)((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
- yoff = (long)((signed char)((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
+ xoff = (long)((int8_t )((picanm[tilenum]>>8)&255))+((long)spr->xoffset);
+ yoff = (long)((int8_t )((picanm[tilenum]>>16)&255))+((long)spr->yoffset);
if ((spr->cstat&4) > 0) xoff = -xoff;
if ((spr->cstat&8) > 0) yoff = -yoff;
@@ -4623,9 +4623,9 @@
int32_t lastanimhack=0;
-void playanm(char *fn,char t)
+void playanm(uint8_t *fn,uint8_t t)
{
- char *animbuf, *palptr;
+ uint8_t *animbuf, *palptr;
int32_t i, j, k, length=0, numframes=0;
int32 handle=-1;
@@ -4649,7 +4649,7 @@
if(anim == 0 || lastanimhack != (MAXTILES-3-t))
allocache((int32_t *)&anim,length+sizeof(anim_t),&walock[MAXTILES-3-t]);
- animbuf = (char *)(FP_OFF(anim)+sizeof(anim_t));
+ animbuf = (uint8_t *)(FP_OFF(anim)+sizeof(anim_t));
lastanimhack = (MAXTILES-3-t);
--- a/Game/src/midi/databuf.h
+++ b/Game/src/midi/databuf.h
@@ -53,7 +53,7 @@
virtual uint32 read4() =0;
virtual uint32 read4high() =0;
virtual float readf() =0;
- virtual void read(char *, int) =0;
+ virtual void read(uint8_t *, int) =0;
virtual void write1(unsigned int) =0;
virtual void write2(uint16) =0;
@@ -61,7 +61,7 @@
virtual void write4(uint32) =0;
virtual void write4high(uint32) =0;
virtual void writef(float) =0;
- virtual void write(char *, int) =0;
+ virtual void write(uint8_t *, int) =0;
virtual void seek(unsigned int) =0;
virtual void skip(int) =0;
@@ -78,7 +78,7 @@
uint8_t *buf_ptr;
sint32 size;
public:
- BufferDataSource(char *data, unsigned int len)
+ BufferDataSource(uint8_t *data, unsigned int len)
{
// data can be NULL if len is also 0
// assert(data!=0 || len==0);
@@ -86,7 +86,7 @@
size = len;
};
- void load(char *data, unsigned int len)
+ void load(uint8_t *data, unsigned int len)
{
// data can be NULL if len is also 0
//assert(data!=0 || len==0);
@@ -151,7 +151,7 @@
return uif.f;
};
- void read(char *b, int len) {
+ void read(uint8_t *b, int len) {
memcpy(b, buf_ptr, len);
buf_ptr += len;
};
@@ -200,7 +200,7 @@
*buf_ptr++ = (uif.i>>24)&0xff;
};
- virtual void write(char *b, int len)
+ virtual void write(uint8_t *b, int len)
{
memcpy(buf_ptr, b, len);
buf_ptr += len;
--- a/Game/src/midi/win_midiout.cpp
+++ b/Game/src/midi/win_midiout.cpp
@@ -208,7 +208,7 @@
giveinfo();
if (mmsys_err != MMSYSERR_NOERROR)
{
- char buf[512];
+ uint8_t buf[512];
giveinfo();
midiOutGetErrorText(mmsys_err, buf, 512);
@@ -742,7 +742,7 @@
return playing!=0;
}
-const char *Windows_MidiOut::copyright(void)
+const uint8_t *Windows_MidiOut::copyright(void)
{
giveinfo();
return "Internal Win32 Midiout Midi Player for Pentagram. Version 1.2a";
@@ -810,10 +810,10 @@
#include "../duke3d.h"
#include "cache1d.h"
-static char warningMessage[80];
-static char errorMessage[80];
+static uint8_t warningMessage[80];
+static uint8_t errorMessage[80];
-char *MUSIC_ErrorString(int ErrorNumber)
+uint8_t *MUSIC_ErrorString(int ErrorNumber)
{
switch (ErrorNumber)
{
@@ -864,10 +864,10 @@
static int music_loopflag = MUSIC_PlayOnce;
static Windows_MidiOut *midi_device = NULL;
-extern void musdebug(const char *fmt, ...);
+extern void musdebug(const uint8_t *fmt, ...);
extern void init_debugging(void);
-extern void setWarningMessage(const char *msg);
-extern void setErrorMessage(const char *msg);
+extern void setWarningMessage(const uint8_t *msg);
+extern void setErrorMessage(const uint8_t *msg);
extern int MUSIC_ErrorCode;
#define __FX_TRUE (1 == 1)
#define __FX_FALSE (!__FX_TRUE)
@@ -875,7 +875,7 @@
#pragma message (" The win_midi code is temp until the SDL midi code functions properly ")
#pragma message (" STUBBED musdebug ")
-void musdebug(const char *fmt, ...)
+void musdebug(const uint8_t *fmt, ...)
{
#if 0
va_list ap;
@@ -893,11 +893,11 @@
} // snddebug
#pragma message (" STUBBED setErrorMessage ")
-static void setErrorMessage(const char *msg)
+static void setErrorMessage(const uint8_t *msg)
{
#if 0
strncpy(errorMessage, msg, sizeof (errorMessage));
- // strncpy() doesn't add the null char if there isn't room...
+ // strncpy() doesn't add the null uint8_t if there isn't room...
errorMessage[sizeof (errorMessage) - 1] = '\0';
snddebug("Error message set to [%s].", errorMessage);
#endif
@@ -1078,7 +1078,7 @@
if(midi_device)
midi_device->stop_stream(0);
- BufferDataSource mid_data((char*)song, 1024 * 1024);
+ BufferDataSource mid_data((uint8_t *)song, 1024 * 1024);
XMIDI midfile(&mid_data, XMIDI_CONVERT_EMIDI_GM);
XMIDIEventList *eventlist = midfile.GetEventList(0);
if (eventlist)
@@ -1092,7 +1092,7 @@
return(MUSIC_Ok);
} // MUSIC_PlaySong
-int MUSIC_PlayExtSong(char *fn)
+int MUSIC_PlayExtSong(uint8_t *fn)
{
MUSIC_StopSong();
@@ -1125,12 +1125,12 @@
} // MUSIC_PlaySong
-extern char ApogeePath[256];
+extern uint8_t ApogeePath[256];
-static void CheckAndPlayMusicType(const char* szName, const char* szType)
+static void CheckAndPlayMusicType(const uint8_t * szName, const uint8_t * szType)
{
- char fpath[1024] = {'\0'};
+ uint8_t fpath[1024] = {'\0'};
// Is this a TC?
if(game_dir[0] != '\0')
@@ -1162,16 +1162,16 @@
}
// Duke3D-specific. --ryan.
-void PlayMusic(char *fn)
+void PlayMusic(uint8_t *fn)
{
- //extern int File_Exists(char *fn);
- //extern void GetOnlyNameOfFile(char *fn);
+ //extern int File_Exists(uint8_t *fn);
+ //extern void GetOnlyNameOfFile(uint8_t *fn);
short fp;
int32_t l;
- char *cfn;
- char *buffer;
- char fpath[19] = {'\0'};
+ uint8_t *cfn;
+ uint8_t *buffer;
+ uint8_t fpath[19] = {'\0'};
cfn = fn;
--- a/Game/src/midi/win_midiout.h
+++ b/Game/src/midi/win_midiout.h
@@ -52,7 +52,7 @@
virtual void stop_track(void);
virtual void stop_sfx(void);
virtual bool is_playing(void);
- virtual const char *copyright(void);
+ virtual const uint8_t *copyright(void);
// PSMDEX - Pentagram Streaming Midi Driver Extensions
virtual int max_streams();
--- a/Game/src/midi/xmidi.cpp
+++ b/Game/src/midi/xmidi.cpp
@@ -83,7 +83,7 @@
// The index is the MT32 Patch nubmer and the value is the GM Patch
// This is only suitable for music that doesn'tdo timbre changes
// XMIDIs that contain Timbre changes will not convert properly
-const char XMIDI::mt32asgm[128] = {
+const uint8_t XMIDI::mt32asgm[128] = {
0, // 0 Piano 1
1, // 1 Piano 2
2, // 2 Piano 3 (synth)
@@ -216,7 +216,7 @@
// Same as above, except include patch changes
// so GS instruments can be used
-const char XMIDI::mt32asgs[256] = {
+const uint8_t XMIDI::mt32asgs[256] = {
0, 0, // 0 Piano 1
1, 0, // 1 Piano 2
2, 0, // 2 Piano 3 (synth)
@@ -883,7 +883,7 @@
//std::cout << "Max Polyphony: " << notes.GetMaxPolyphony() << std::endl;
static const uint8_t tempo_buf[5] = { 0x51, 0x03, 0x07, 0xA1, 0x20 };
- BufferDataSource ds((char *)tempo_buf, 5);
+ BufferDataSource ds((uint8_t *)tempo_buf, 5);
current = list;
ConvertSystemMessage (0, 0xFF,&ds);
}
@@ -1095,7 +1095,7 @@
current->buffer = Malloc<uint8_t >(current->len);
- source->read (reinterpret_cast<char *>(current->buffer), current->len);
+ source->read (reinterpret_cast<uint8_t *>(current->buffer), current->len);
return i+current->len;
}
@@ -1229,7 +1229,7 @@
{
int num = 0;
uint32 len = 0;
- char buf[32];
+ uint8_t buf[32];
first_state fs;
@@ -1266,7 +1266,7 @@
// Add tempo
static const uint8_t tempo_buf[5] = { 0x51, 0x03, 0x07, 0xA1, 0x20 };
- BufferDataSource ds((char *)tempo_buf, 5);
+ BufferDataSource ds((uint8_t *)tempo_buf, 5);
current = list;
ConvertSystemMessage (0, 0xFF,&ds);
@@ -1288,7 +1288,7 @@
{
int num = 0;
uint32 len = 0;
- char buf[32];
+ uint8_t buf[32];
int chan_mask = 0;
first_state fs;
@@ -1345,7 +1345,7 @@
uint32 len;
uint32 chunk_len;
int count;
- char buf[32];
+ uint8_t buf[32];
string s;
@@ -1570,7 +1570,7 @@
//
// XMIDIEventList stuff
//
-int XMIDIEventList::Write (const char *filename)
+int XMIDIEventList::Write (const uint8_t *filename)
{
// FILE *file = fopen (filename, "wb"); // DARKE FIXME
// FileDataSource ds(file);
--- a/Game/src/midi/xmidi.h
+++ b/Game/src/midi/xmidi.h
@@ -224,7 +224,7 @@
midi_event *events;
// Write this list to a file/buffer
- int Write (const char *filename);
+ int Write (const uint8_t *filename);
int Write (DataSource *dest);
// Increments the counter
@@ -246,8 +246,8 @@
midi_event *current;
midi_event *notes_on;
- const static char mt32asgm[128];
- const static char mt32asgs[256];
+ const static uint8_t mt32asgm[128];
+ const static uint8_t mt32asgs[256];
bool bank127[16];
int convert_type;
--- a/Game/src/player.c
+++ b/Game/src/player.c
@@ -202,7 +202,7 @@
short aim(spritetype *s,short aang, short auto_aim)
{
- char gotshrinker,gotfreezer;
+ uint8_t gotshrinker,gotfreezer;
short i, j, a, k, cans;
short aimstats[] = {10,13,1,2};
int32_t dx1, dy1, dx2, dy2, dx3, dy3, smax, sdist;
@@ -1135,7 +1135,7 @@
}
}
-char animatefist(short gs,short snum)
+uint8_t animatefist(short gs,short snum)
{
short looking_arc,fisti,fistpal;
int32_t fistzoom, fistz;
@@ -1166,7 +1166,7 @@
return 1;
}
-char animateknee(short gs,short snum)
+uint8_t animateknee(short gs,short snum)
{
short knee_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-72,-32,-8};
short looking_arc, pal;
@@ -1191,7 +1191,7 @@
return 1;
}
-char animateknuckles(short gs,short snum)
+uint8_t animateknuckles(short gs,short snum)
{
short knuckle_frames[] = {0,1,2,2,3,3,3,2,2,1,0};
short looking_arc, pal;
@@ -1240,7 +1240,7 @@
}
}
-char animatetip(short gs,short snum)
+uint8_t animatetip(short gs,short snum)
{
short p,looking_arc;
short tip_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16};
@@ -1266,11 +1266,11 @@
return 1;
}
-char animateaccess(short gs,short snum)
+uint8_t animateaccess(short gs,short snum)
{
short access_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16};
short looking_arc;
- char p;
+ uint8_t p;
if(ps[snum].access_incs == 0 || sprite[ps[snum].i].extra <= 0) return 0;
@@ -1297,7 +1297,7 @@
{
int32_t gun_pos, looking_arc, cw;
int32_t weapon_xoffset, i, j;
- char o,pal;
+ uint8_t o,pal;
int8_t gs;
struct player_struct *p;
short *kb;
@@ -1625,7 +1625,7 @@
if((*kb))
{
- char throw_frames[]
+ uint8_t throw_frames[]
= {0,0,0,0,0,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2};
if((*kb) < 7)
@@ -1666,7 +1666,7 @@
if((*kb))
{
- char cycloidy[] = {0,4,12,24,12,4,0};
+ uint8_t cycloidy[] = {0,4,12,24,12,4,0};
i = sgn((*kb)>>2);
@@ -1696,7 +1696,7 @@
if((*kb))
{
- char cat_frames[] = { 0,0,1,1,2,2 };
+ uint8_t cat_frames[] = { 0,0,1,1,2,2 };
if(sprite[p->i].pal != 1)
{
@@ -2126,7 +2126,7 @@
}
-char doincrements(struct player_struct *p)
+uint8_t doincrements(struct player_struct *p)
{
int32_t snum;
@@ -2341,7 +2341,7 @@
void processinput(short snum)
{
int32_t j, i, k, doubvel, fz, cz, hz, lz, truefdist, x, y;
- char shrunk;
+ uint8_t shrunk;
uint32_t sb_snum;
short psect, psectlotag,*kb, tempsect, pi;
struct player_struct *p;
@@ -4103,7 +4103,7 @@
static int32_t goalsect[MAXPLAYERS], goalwall[MAXPLAYERS], goalsprite[MAXPLAYERS];
static int32_t goalplayer[MAXPLAYERS], clipmovecount[MAXPLAYERS];
short searchsect[MAXSECTORS], searchparent[MAXSECTORS];
-char dashow2dsector[(MAXSECTORS+7)>>3];
+uint8_t dashow2dsector[(MAXSECTORS+7)>>3];
void computergetinput(int32_t snum, input *syn)
{
int32_t i, j, k, l, x1, y1, z1, x2, y2, z2, x3, y3, z3, dx, dy;
--- a/Game/src/premap.c
+++ b/Game/src/premap.c
@@ -27,7 +27,7 @@
#include "duke3d.h"
#include "cache1d.h"
-extern char everyothertime;
+extern uint8_t everyothertime;
short which_palookup = 9;
@@ -38,7 +38,7 @@
void cachespritenum(short i)
{
- char maxc;
+ uint8_t maxc;
short j;
if(ud.monsters_off && badguy(&sprite[i])) return;
@@ -230,7 +230,7 @@
tloadtile(i);
}
-char getsound(unsigned short num)
+uint8_t getsound(unsigned short num)
{
short fp;
int32_t l;
@@ -475,7 +475,7 @@
pus = 1;
p->on_warping_sector = 0;
p->spritebridge = 0;
- p->palette = (char *) &palette[0];
+ p->palette = (uint8_t *) &palette[0];
if(p->steroids_amount < 400 )
{
@@ -570,7 +570,7 @@
}
-void resetprestat(short snum,char g)
+void resetprestat(short snum,uint8_t g)
{
struct player_struct *p;
short i;
@@ -662,7 +662,7 @@
pskybits=3;
}
-void prelevel(char g)
+void prelevel(uint8_t g)
{
short i, nexti, j, startwall, endwall, lotaglist;
short lotags[65];
@@ -982,7 +982,7 @@
}
-void newgame(char vn,char ln,char sk)
+void newgame(uint8_t vn,uint8_t ln,uint8_t sk)
{
struct player_struct *p = &ps[0];
short i;
@@ -1063,17 +1063,17 @@
}
-void resetpspritevars(char g)
+void resetpspritevars(uint8_t g)
{
short i, j, nexti,circ;
int32_t firstx,firsty;
spritetype *s;
- char aimmode[MAXPLAYERS];
+ uint8_t aimmode[MAXPLAYERS];
STATUSBARTYPE tsbar[MAXPLAYERS];
#define BOT_MAX_NAME 20
int bot_used[BOT_MAX_NAME] = { false };
- char *bot_names[] = { "* ELASTI",
+ uint8_t *bot_names[] = { "* ELASTI",
"* ^ZookeM^",
"* DOOM",
"* DRO",
@@ -1282,12 +1282,12 @@
{
int32_t j,fp;
int8_t look_pos;
- char *lookfn = "lookup.dat";
- char numl;
+ uint8_t *lookfn = "lookup.dat";
+ uint8_t numl;
fp = TCkopen4load(lookfn,0);
if(fp != -1)
- kread(fp,(char *)&numl,1);
+ kread(fp,(uint8_t *)&numl,1);
else
gameexit("\nERROR: File 'LOOKUP.DAT' not found.");
@@ -1440,12 +1440,12 @@
myreturntocenter = ps[myconnectindex].return_to_center;
}
-void enterlevel(char g)
+void enterlevel(uint8_t g)
{
short i;
int32_t l;
- char levname[256];
- char fulllevelfilename[512];
+ uint8_t levname[256];
+ uint8_t fulllevelfilename[512];
KB_ClearKeyDown(sc_Pause); // avoid entering in pause mode.
--- a/Game/src/rts.c
+++ b/Game/src/rts.c
@@ -35,7 +35,7 @@
static lumpinfo_t *lumpinfo; // location of each lump on disk
static boolean RTS_Started = false;
-char lumplockbyte[11];
+uint8_t lumplockbyte[11];
/*
============================================================================
@@ -57,7 +57,7 @@
====================
*/
-void RTS_AddFile (char *filename)
+void RTS_AddFile (uint8_t *filename)
{
wadinfo_t header;
lumpinfo_t *lump_p;
@@ -114,7 +114,7 @@
====================
*/
-void RTS_Init (char *filename)
+void RTS_Init (uint8_t *filename)
{
int32 length;
//
@@ -178,7 +178,7 @@
====================
*/
-char * RTS_GetSoundName (int32 i)
+uint8_t * RTS_GetSoundName (int32 i)
{
i++;
if (i>=numlumps)
--- a/Game/src/rts.h
+++ b/Game/src/rts.h
@@ -43,7 +43,7 @@
====================
*/
-void RTS_Init (char *filename);
+void RTS_Init (uint8_t *filename);
/*
====================
=
@@ -72,7 +72,7 @@
====================
*/
-char * RTS_GetSoundName (int32 i);
+uint8_t * RTS_GetSoundName (int32 i);
/*
====================
=
--- a/Game/src/scriplib.c
+++ b/Game/src/scriplib.c
@@ -50,10 +50,10 @@
typedef struct scriptnode_s {
struct scriptnode_s *child;
struct scriptnode_s *sibling;
- char *key;
+ uint8_t *key;
scriptflag_t type;
union {
- char *string[2];
+ uint8_t *string[2];
int number;
float floatnumber;
} data;
@@ -188,11 +188,11 @@
}
}
-static char *SCRIPT_copystring (char * s)
+static uint8_t *SCRIPT_copystring (uint8_t * s)
{
- char *ret;
+ uint8_t *ret;
- ret = (char *) malloc (strlen (s)+1);
+ ret = (uint8_t *) malloc (strlen (s)+1);
if (ret != NULL)
{
strcpy (ret, s);
@@ -200,7 +200,7 @@
return ret;
}
-static int SCRIPT_getnexttoken (char *buffer, char* token, int start)
+static int SCRIPT_getnexttoken (uint8_t *buffer, uint8_t * token, int start)
{
int iterator = start;
@@ -225,9 +225,9 @@
}
/* Fills in a scriptnode with the interpreted contents of a line */
-static void SCRIPT_parseline (char *curline, scriptnode_t *node)
+static void SCRIPT_parseline (uint8_t *curline, scriptnode_t *node)
{
- char token[128];
+ uint8_t token[128];
int i;
/* Needs to handle 5 cases: */
@@ -279,7 +279,7 @@
node->type = SCRIPTFLAG_DECIMAL;
node->data.number = -1;
}else if (token[0] == '"') {
- char workbuf[128];
+ uint8_t workbuf[128];
int r;
/* Found one of possibly two strings */
@@ -317,7 +317,7 @@
}
}
-static scriptnode_t *SCRIPT_findinchildren (scriptnode_t *parent, char *s)
+static scriptnode_t *SCRIPT_findinchildren (scriptnode_t *parent, uint8_t *s)
{
scriptnode_t *cur = parent;
@@ -341,7 +341,7 @@
=
==============
*/
-int32 SCRIPT_Init( char * name )
+int32 SCRIPT_Init( uint8_t * name )
{
STUBBED("Init");
@@ -374,7 +374,7 @@
==============
*/
-int32 SCRIPT_Parse ( char *data, int32 length, char * name )
+int32 SCRIPT_Parse ( uint8_t *data, int32 length, uint8_t * name )
{
STUBBED("Parse");
@@ -390,10 +390,10 @@
==============
*/
-int32 SCRIPT_Load ( char * filename )
+int32 SCRIPT_Load ( uint8_t * filename )
{
FILE *fp;
- char curline[128];
+ uint8_t curline[128];
scriptnode_t *headnode = NULL;
scriptnode_t *cur_subsection = NULL;
@@ -481,7 +481,7 @@
=
==============
*/
-void SCRIPT_Save (int32 scripthandle, char * filename)
+void SCRIPT_Save (int32 scripthandle, uint8_t * filename)
{
FILE *fp;
scriptnode_t *head;
@@ -523,7 +523,7 @@
==============
*/
-char * SCRIPT_Section( int32 scripthandle, int32 which )
+uint8_t * SCRIPT_Section( int32 scripthandle, int32 which )
{
STUBBED("Section");
@@ -538,7 +538,7 @@
==============
*/
-int32 SCRIPT_NumberEntries( int32 scripthandle, char * sectionname )
+int32 SCRIPT_NumberEntries( int32 scripthandle, uint8_t * sectionname )
{
scriptnode_t *node = NULL;
int32 entries = 0;
@@ -566,11 +566,11 @@
=
==============
*/
-char * SCRIPT_Entry( int32 scripthandle, char * sectionname, int32 which )
+uint8_t * SCRIPT_Entry( int32 scripthandle, uint8_t * sectionname, int32 which )
{
scriptnode_t *node = NULL;
int32 entrynum = 0;
- char* val = NULL;
+ uint8_t * val = NULL;
if(scripthandle >= MAX_SCRIPTS || scripthandle < 0)
return "";
@@ -599,7 +599,7 @@
=
==============
*/
-char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname)
+uint8_t * SCRIPT_GetRaw(int32 scripthandle, uint8_t * sectionname, uint8_t * entryname)
{
STUBBED("GetRaw");
@@ -616,9 +616,9 @@
void SCRIPT_GetString
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * dest
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * dest
)
{
scriptnode_t *cur;
@@ -650,10 +650,10 @@
void SCRIPT_GetDoubleString
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * dest1,
- char * dest2
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * dest1,
+ uint8_t * dest2
)
{
scriptnode_t *cur;
@@ -686,8 +686,8 @@
boolean SCRIPT_GetNumber
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
int32 * number
)
{
@@ -722,8 +722,8 @@
void SCRIPT_GetBoolean
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
boolean * bool
)
{
@@ -741,8 +741,8 @@
boolean SCRIPT_GetFloat
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
float * floatnumber
)
{
@@ -778,8 +778,8 @@
void SCRIPT_GetDouble
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
double * number
)
{
@@ -795,7 +795,7 @@
=
==============
*/
-void SCRIPT_PutComment( int32 scripthandle, char * sectionname, char * comment )
+void SCRIPT_PutComment( int32 scripthandle, uint8_t * sectionname, uint8_t * comment )
{
STUBBED("PutComment");
}
@@ -807,7 +807,7 @@
=
==============
*/
-void SCRIPT_PutEOL( int32 scripthandle, char * sectionname )
+void SCRIPT_PutEOL( int32 scripthandle, uint8_t * sectionname )
{
STUBBED("PutEOL");
}
@@ -822,8 +822,8 @@
void SCRIPT_PutMultiComment
(
int32 scripthandle,
- char * sectionname,
- char * comment,
+ uint8_t * sectionname,
+ uint8_t * comment,
...
)
{
@@ -837,7 +837,7 @@
=
==============
*/
-void SCRIPT_PutSection( int32 scripthandle, char * sectionname )
+void SCRIPT_PutSection( int32 scripthandle, uint8_t * sectionname )
{
STUBBED("PutSection");
}
@@ -852,9 +852,9 @@
void SCRIPT_PutRaw
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * raw
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * raw
)
{
STUBBED("PutRaw");
@@ -870,9 +870,9 @@
void SCRIPT_PutString
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * string
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * string
)
{
scriptnode_t *head;
@@ -922,10 +922,10 @@
void SCRIPT_PutDoubleString
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * string1,
- char * string2
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * string1,
+ uint8_t * string2
)
{
scriptnode_t *head;
@@ -977,8 +977,8 @@
void SCRIPT_PutNumber
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
int32 number,
boolean hexadecimal,
boolean defaultvalue
@@ -1033,8 +1033,8 @@
void SCRIPT_PutBoolean
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
boolean bool
)
{
@@ -1052,8 +1052,8 @@
void SCRIPT_PutDouble
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
double number,
boolean defaultvalue
)
--- a/Game/src/scriplib.h
+++ b/Game/src/scriplib.h
@@ -39,7 +39,7 @@
=
==============
*/
-int32 SCRIPT_Init( char * name );
+int32 SCRIPT_Init( uint8_t * name );
/*
@@ -59,7 +59,7 @@
==============
*/
-int32 SCRIPT_Parse ( char *data, int32 length, char * name );
+int32 SCRIPT_Parse ( uint8_t *data, int32 length, uint8_t * name );
/*
@@ -70,7 +70,7 @@
==============
*/
-int32 SCRIPT_Load ( char * filename );
+int32 SCRIPT_Load ( uint8_t * filename );
/*
==============
@@ -79,7 +79,7 @@
=
==============
*/
-void SCRIPT_Save (int32 scripthandle, char * filename);
+void SCRIPT_Save (int32 scripthandle, uint8_t * filename);
/*
@@ -100,7 +100,7 @@
==============
*/
-char * SCRIPT_Section( int32 scripthandle, int32 which );
+uint8_t * SCRIPT_Section( int32 scripthandle, int32 which );
/*
==============
@@ -110,7 +110,7 @@
==============
*/
-int32 SCRIPT_NumberEntries( int32 scripthandle, char * sectionname );
+int32 SCRIPT_NumberEntries( int32 scripthandle, uint8_t * sectionname );
/*
==============
@@ -120,7 +120,7 @@
==============
*/
-char * SCRIPT_Entry( int32 scripthandle, char * sectionname, int32 which );
+uint8_t * SCRIPT_Entry( int32 scripthandle, uint8_t * sectionname, int32 which );
/*
@@ -130,7 +130,7 @@
=
==============
*/
-char * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname);
+uint8_t * SCRIPT_GetRaw(int32 scripthandle, uint8_t * sectionname, uint8_t * entryname);
/*
==============
@@ -142,9 +142,9 @@
void SCRIPT_GetString
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * dest
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * dest
);
/*
@@ -157,10 +157,10 @@
void SCRIPT_GetDoubleString
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * dest1,
- char * dest2
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * dest1,
+ uint8_t * dest2
);
/*
@@ -173,8 +173,8 @@
boolean SCRIPT_GetNumber
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
int32 * number
);
@@ -188,8 +188,8 @@
void SCRIPT_GetBoolean
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
boolean * bool
);
@@ -204,8 +204,8 @@
boolean SCRIPT_GetFloat
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
float * floatnumber
);
@@ -221,8 +221,8 @@
void SCRIPT_GetDouble
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
double * number
);
@@ -235,7 +235,7 @@
=
==============
*/
-void SCRIPT_PutComment( int32 scripthandle, char * sectionname, char * comment );
+void SCRIPT_PutComment( int32 scripthandle, uint8_t * sectionname, uint8_t * comment );
/*
==============
@@ -244,7 +244,7 @@
=
==============
*/
-void SCRIPT_PutEOL( int32 scripthandle, char * sectionname );
+void SCRIPT_PutEOL( int32 scripthandle, uint8_t * sectionname );
/*
==============
@@ -256,8 +256,8 @@
void SCRIPT_PutMultiComment
(
int32 scripthandle,
- char * sectionname,
- char * comment,
+ uint8_t * sectionname,
+ uint8_t * comment,
...
);
@@ -268,7 +268,7 @@
=
==============
*/
-void SCRIPT_PutSection( int32 scripthandle, char * sectionname );
+void SCRIPT_PutSection( int32 scripthandle, uint8_t * sectionname );
/*
==============
@@ -280,9 +280,9 @@
void SCRIPT_PutRaw
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * raw
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * raw
);
/*
@@ -295,9 +295,9 @@
void SCRIPT_PutString
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * string
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * string
);
/*
@@ -310,10 +310,10 @@
void SCRIPT_PutDoubleString
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
- char * string1,
- char * string2
+ uint8_t * sectionname,
+ uint8_t * entryname,
+ uint8_t * string1,
+ uint8_t * string2
);
/*
@@ -326,8 +326,8 @@
void SCRIPT_PutNumber
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
int32 number,
boolean hexadecimal,
boolean defaultvalue
@@ -343,8 +343,8 @@
void SCRIPT_PutBoolean
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
boolean bool
);
@@ -359,8 +359,8 @@
void SCRIPT_PutDouble
(
int32 scripthandle,
- char * sectionname,
- char * entryname,
+ uint8_t * sectionname,
+ uint8_t * entryname,
double number,
boolean defaultvalue
);
--- a/Game/src/sector.c
+++ b/Game/src/sector.c
@@ -29,7 +29,7 @@
// PRIMITIVE
-char haltsoundhack;
+uint8_t haltsoundhack;
short callsound(short sn,short whatsprite)
{
short i;
@@ -121,7 +121,7 @@
return( 0 );
}
-char isadoorwall(short dapic)
+uint8_t isadoorwall(short dapic)
{
switch(dapic)
{
@@ -153,7 +153,7 @@
}
-char isanunderoperator(short lotag)
+uint8_t isanunderoperator(short lotag)
{
switch(lotag&0xff)
{
@@ -169,7 +169,7 @@
return 0;
}
-char isanearoperator(short lotag)
+uint8_t isanearoperator(short lotag)
{
switch(lotag&0xff)
{
@@ -498,7 +498,7 @@
}
}
-char activatewarpelevators(short s,short d) //Parm = sectoreffectornum
+uint8_t activatewarpelevators(short s,short d) //Parm = sectoreffectornum
{
short i, sn;
@@ -550,7 +550,7 @@
{
int32_t j=0, l, q, startwall, endwall;
short i;
- char sect_error;
+ uint8_t sect_error;
sectortype *sptr;
sect_error = 0;
@@ -1158,9 +1158,9 @@
}
-char checkhitswitch(short snum,int32_t w,char switchtype)
+uint8_t checkhitswitch(short snum,int32_t w,uint8_t switchtype)
{
- char switchpal;
+ uint8_t switchpal;
short i, x, lotag,hitag,picnum,correctdips,numdips;
int32_t sx,sy;
@@ -1869,7 +1869,7 @@
}
-char checkhitceiling(short sn)
+uint8_t checkhitceiling(short sn)
{
short i, j;
@@ -2414,10 +2414,10 @@
void cheatkeys(short snum)
{
short i, k;
- char dainv;
+ uint8_t dainv;
uint32_t sb_snum, j;
struct player_struct *p;
- char playing_old_demo = 0;
+ uint8_t playing_old_demo = 0;
sb_snum = sync[snum].bits;
p = &ps[snum];
--- a/Game/src/sounds.c
+++ b/Game/src/sounds.c
@@ -207,7 +207,7 @@
}
}
-int USRHOOKS_GetMem(char **ptr, uint32_t size )
+int USRHOOKS_GetMem(uint8_t **ptr, uint32_t size )
{
*ptr = malloc(size);
@@ -218,13 +218,13 @@
}
-int USRHOOKS_FreeMem(char *ptr)
+int USRHOOKS_FreeMem(uint8_t *ptr)
{
free(ptr);
return( USRHOOKS_Ok);
}
-char menunum=0;
+uint8_t menunum=0;
void intomenusounds(void)
{
@@ -252,7 +252,7 @@
menunum %= 17;
}
-void playmusic(char *fn)
+void playmusic(uint8_t *fn)
{
#if PLATFORM_DOS
short fp;
@@ -285,7 +285,7 @@
#endif
}
-char loadsound(unsigned short num)
+uint8_t loadsound(unsigned short num)
{
int32_t fp, l;
--- a/Game/src/types.h
+++ b/Game/src/types.h
@@ -53,7 +53,7 @@
typedef uint32 dword;
typedef int32 fixed;
-typedef char boolean;
+typedef uint8_t boolean;
typedef float float32;
typedef double float64;
typedef int64_t float128;
--- a/Game/src/util_lib.h
+++ b/Game/src/util_lib.h
@@ -43,25 +43,25 @@
#else
extern int32 _argc;
#endif
-extern char ** _argv;
+extern uint8_t ** _argv;
void RegisterShutdownFunction( void (* shutdown) (void) );
-void Error (int errorType, char *error, ...);
+void Error (int errorType, uint8_t *error, ...);
-char CheckParm (char *check);
+uint8_t CheckParm (uint8_t *check);
void *SafeMalloc (int32 size);
int32 SafeMallocSize (void * ptr);
void SafeFree (void * ptr);
void SafeRealloc (void ** ptr, int32 newsize);
-int32 ParseHex (char *hex);
-int32 ParseNum (char *str);
+int32 ParseHex (uint8_t *hex);
+int32 ParseNum (uint8_t *str);
int16 MotoShort (int16 l);
int16 IntelShort (int16 l);
int32_t Motoint32_t (int32_t l);
int32_t Intelint32_t (int32_t l);
-void HeapSort(char * base, int32 nel, int32 width, int32 (*compare)(), void (*switcher)());
+void HeapSort(uint8_t * base, int32 nel, int32 width, int32 (*compare)(), void (*switcher)());
#ifdef __cplusplus
};
--- a/xcode/Duke3D/SDLMain.m
+++ b/xcode/Duke3D/SDLMain.m
@@ -37,7 +37,7 @@
#endif /* SDL_USE_CPS */
static int gArgc;
-static char **gArgv;
+static uint8_t **gArgv;
static BOOL gFinderLaunch;
static BOOL gCalledAppMainline = FALSE;
@@ -86,7 +86,7 @@
{
if (shouldChdir)
{
- char parentdir[MAXPATHLEN];
+ uint8_t parentdir[MAXPATHLEN];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) {
@@ -197,7 +197,7 @@
}
/* Replacement for NSApplicationMain */
-static void CustomApplicationMain (int argc, char **argv)
+static void CustomApplicationMain (int argc, uint8_t **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
@@ -252,10 +252,10 @@
*/
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
- const char *temparg;
+ const uint8_t *temparg;
size_t arglen;
- char *arg;
- char **newargv;
+ uint8_t *arg;
+ uint8_t **newargv;
if (!gFinderLaunch) /* MacOS is passing command line args. */
return FALSE;
@@ -265,11 +265,11 @@
temparg = [filename UTF8String];
arglen = SDL_strlen(temparg) + 1;
- arg = (char *) SDL_malloc(arglen);
+ arg = (uint8_t *) SDL_malloc(arglen);
if (arg == NULL)
return FALSE;
- newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
+ newargv = (uint8_t **) realloc(gArgv, sizeof (uint8_t *) * (gArgc + 2));
if (newargv == NULL)
{
SDL_free(arg);
@@ -354,12 +354,12 @@
/* Main entry point to executable - should *not* be SDL_main! */
-int main (int argc, char **argv)
+int main (int argc, char **argv)
{
/* Copy the arguments into a global variable */
/* This is passed if we are launched by double-clicking */
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
- gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
+ gArgv = (uint8_t **) SDL_malloc(sizeof (uint8_t *) * 2);
gArgv[0] = argv[0];
gArgv[1] = NULL;
gArgc = 1;
@@ -367,7 +367,7 @@
} else {
int i;
gArgc = argc;
- gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
+ gArgv = (uint8_t **) SDL_malloc(sizeof (uint8_t *) * (argc+1));
for (i = 0; i <= argc; i++)
gArgv[i] = argv[i];
gFinderLaunch = NO;