ref: 87618da55e0264d844e86bee5fc8f6cc8c2c4a33
parent: edacaef2bf6a6879cff1ff5ae348e747a6871005
author: Fabien Sanglard <[email protected]>
date: Thu Dec 13 20:30:03 EST 2012
Swtiched back uint8_t to char for string functions.
--- a/Engine/src/build.h
+++ b/Engine/src/build.h
@@ -330,7 +330,7 @@
//END VISUALIZE RENDERER
//Global.c
-void Error (int errorType, uint8_t *error, ...);
+void Error (int errorType, char *error, ...);
int FindDistance2D(int ix, int iy);
#endif /* defined _INCLUDE_BUILD_H_ */
--- a/Engine/src/cache1d.c
+++ b/Engine/src/cache1d.c
@@ -94,8 +94,8 @@
if ((unsigned)newbytes > (unsigned)cachesize)
{
- printf("Cachesize: %ld\n",cachesize);
- printf("*Newhandle: 0x%x, Newbytes: %ld, *Newlock: %d\n",(unsigned int)newhandle,newbytes,*newlockptr);
+ printf("Cachesize: %d\n",cachesize);
+ printf("*Newhandle: 0x%x, Newbytes: %d, *Newlock: %d\n",(unsigned int)newhandle,newbytes,*newlockptr);
reportandexit("BUFFER TOO BIG TO FIT IN CACHE!\n");
}
@@ -215,15 +215,15 @@
j = 0;
for(i=0;i<cacnum;i++)
{
- printf("%ld- ",i);
- printf("ptr: 0x%lx, ",*cac[i].hand);
- printf("leng: %ld, ",cac[i].leng);
+ printf("%d- ",i);
+ printf("ptr: 0x%x, ",*cac[i].hand);
+ printf("leng: %d, ",cac[i].leng);
printf("lock: %d\n",*cac[i].lock);
j += cac[i].leng;
}
- printf("Cachesize = %ld\n",cachesize);
- printf("Cacnum = %ld\n",cacnum);
- printf("Cache length sum = %ld\n",j);
+ printf("Cachesize = %d\n",cachesize);
+ printf("Cacnum = %d\n",cacnum);
+ printf("Cache length sum = %d\n",j);
printf("ERROR: %s",errormessage);
Error(EXIT_FAILURE, "");
}
@@ -283,7 +283,7 @@
#endif
-int32_t initgroupfile(const uint8_t *filename)
+int32_t initgroupfile(const char *filename)
{
#if (defined USE_PHYSICSFS)
static int initted_physfs = 0;
@@ -557,31 +557,6 @@
int32_t kopen4load(const char *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;
- uint8_t _filename[64];
-
- assert(strlen(filename) < sizeof (_filename));
- strcpy(_filename, filename);
- PHYSFSEXT_locateCorrectCase(_filename);
-
- rc = PHYSFS_openRead(_filename);
- if (rc == NULL)
- return(-1);
-
- for (i = 0; i < MAXOPENFILES; i++)
- {
- if (filehan[i] == NULL)
- {
- filehan[i] = rc;
- return(i);
- }
- }
-
- PHYSFS_close(rc); /* oh well. */
- return(-1);
-#else
int32_t i, j, k, fil, newhandle;
uint8_t bad;
uint8_t *gfileptr;
@@ -631,7 +606,7 @@
}
}
return(-1);
-#endif
+
}
int32_t kread(int32_t handle, void *buffer, int32_t leng)
@@ -999,7 +974,7 @@
return((int32_t )shortptr[0]); /* uncompleng */
}
-
+boolean SafeFileExists ( const char * _filename );
int32_t TCkopen4load(const char *filename, int readfromGRP)
{
char fullfilename[512];
@@ -1020,7 +995,7 @@
if(g_CV_DebugFileAccess != 0)
{
- printf("FILE ACCESS: [read] File: (%s) Result: %ld, clock: %ld\n", fullfilename, result, totalclock);
+ printf("FILE ACCESS: [read] File: (%s) Result: %d, clock: %d\n", fullfilename, result, totalclock);
}
return result;
--- a/Engine/src/cache1d.h
+++ b/Engine/src/cache1d.h
@@ -25,7 +25,7 @@
void suckcache (int32_t *suckptr);
void agecache(void);
void reportandexit(char *errormessage);
-int32_t initgroupfile(const uint8_t *filename);
+int32_t initgroupfile(const char *filename);
void uninitgroupfile(void);
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);
--- a/Engine/src/enet/include/enet.h
+++ b/Engine/src/enet/include/enet.h
@@ -394,7 +394,7 @@
@retval 0 on success
@retval < 0 on failure
*/
-extern int enet_address_get_host (const ENetAddress *address, uint8_t *hostName, size_t nameLength );
+extern int enet_address_get_host (const ENetAddress *address, char *hostName, size_t nameLength );
/** @} */
--- a/Engine/src/enet/unix.c
+++ b/Engine/src/enet/unix.c
@@ -94,7 +94,7 @@
}
int
-enet_address_get_host (const ENetAddress * address, uint8_t * name, size_t nameLength)
+enet_address_get_host (const ENetAddress * address, char * name, size_t nameLength)
{
struct in_addr in;
struct hostent * hostEntry = NULL;
--- a/Engine/src/engine.c
+++ b/Engine/src/engine.c
@@ -2567,7 +2567,7 @@
faketimerhandler();
}
-int loadboard(uint8_t *filename, int32_t *daposx, int32_t *daposy,
+int loadboard(char *filename, int32_t *daposx, int32_t *daposy,
int32_t *daposz, short *daang, short *dacursectnum)
{
int x;
@@ -2723,7 +2723,7 @@
}
-int saveboard(uint8_t *filename, int32_t *daposx, int32_t *daposy,
+int saveboard(char *filename, int32_t *daposx, int32_t *daposy,
int32_t *daposz, short *daang, short *dacursectnum)
{
int fil;
@@ -3021,10 +3021,8 @@
{
int32_t i;
-#ifdef SUPERBUILD
- int32_t j;
-#endif
+
initengine_called = 1;
if (dommxoverlay)
@@ -3039,16 +3037,6 @@
parallaxtype = 2; parallaxyoffs = 0L; parallaxyscale = 65536;
showinvisibility = 0;
-#ifdef SUPERBUILD
- for(i=1;i<1024;i++) lowrecip[i] = ((1<<24)-1)/i;
- for(i=0;i<MAXVOXELS;i++)
- for(j=0;j<MAXVOXMIPS;j++)
- {
- voxoff[i][j] = 0L;
- voxlock[i][j] = 200;
- }
-#endif
-
paletteloaded = 0;
searchit = 0; searchstat = -1;
@@ -3284,7 +3272,11 @@
{
if (((a&1023) == 0) && (ysiz <= 256)) /* vlineasm4 has 256 high limit! */
{
- if (dastat&64) setupvlineasm(24L); else setupmvlineasm(24L);
+ if (dastat&64)
+ setupvlineasm(24L);
+ else
+ setupmvlineasm(24L);
+
by <<= 8; yv <<= 8; yv2 <<= 8;
palookupoffse[0] = palookupoffse[1] = palookupoffse[2] = palookupoffse[3] = palookupoffs;
@@ -3451,13 +3443,28 @@
/* x,y1 */
bx += xv*(y1-oy); by += yv*(y1-oy); oy = y1;
- if (dastat&64) { if (qlinemode) rhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,0L ,by<<16,ylookup[y1]+x+frameplace);
- else rhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,bx<<16,by<<16,ylookup[y1]+x+frameplace);
- } else rmhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,bx<<16,by<<16,ylookup[y1]+x+frameplace);
+ if (dastat&64)
+ {
+ if (qlinemode)
+ rhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,0L ,by<<16,ylookup[y1]+x+frameplace);
+ else
+ rhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,bx<<16,by<<16,ylookup[y1]+x+frameplace);
+ }
+ else
+ rmhlineasm4(x-lastx[y1],(bx>>16)*ysiz+(by>>16)+bufplc,0L,bx<<16,by<<16,ylookup[y1]+x+frameplace);
}
- if (x == x2-1) { bx += xv2; by += yv2; break; }
+ if (x == x2-1)
+ {
+ bx += xv2;
+ by += yv2;
+ break;
+ }
+
y1 = uplc[x+1];
- if (((dastat&8) == 0) && (startumost[x+1] > y1)) y1 = startumost[x+1];
+
+ if (((dastat&8) == 0) && (startumost[x+1] > y1))
+ y1 = startumost[x+1];
+
y2 = y1;
}
bx += xv2; by += yv2;
@@ -3479,9 +3486,9 @@
if ((dastat&1) == 0)
{
if (dastat&64)
- setupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
+ setupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
else
- msetupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
+ msetupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
}
else
{
@@ -3488,6 +3495,7 @@
tsetupspritevline(palookupoffs,(xv>>16)*ysiz,xv<<16,ysiz,yv,0L);
if (dastat&32) settransreverse(); else settransnormal();
}
+
for(x=x1;x<x2;x++)
{
bx += xv2; by += yv2;
@@ -3502,10 +3510,23 @@
switch(y1-oy)
{
- case -1: bx -= xv; by -= yv; oy = y1; break;
- case 0: break;
- case 1: bx += xv; by += yv; oy = y1; break;
- default: bx += xv*(y1-oy); by += yv*(y1-oy); oy = y1; break;
+ case -1:
+ bx -= xv;
+ by -= yv;
+ oy = y1;
+ break;
+ case 0:
+ break;
+ case 1:
+ bx += xv;
+ by += yv;
+ oy = y1;
+ break;
+ default:
+ bx += xv*(y1-oy);
+ by += yv*(y1-oy);
+ oy = y1;
+ break;
}
p = ylookup[y1]+x+frameplace;
@@ -3513,14 +3534,14 @@
if ((dastat&1) == 0)
{
if (dastat&64)
- spritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
+ spritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
else
- mspritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
+ mspritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
}
else
{
- tspritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
- transarea += (y2-y1);
+ tspritevline(0L,by<<16,y2-y1+1,bx<<16,(bx>>16)*ysiz+(by>>16)+bufplc,p);
+ transarea += (y2-y1);
}
faketimerhandler();
}
@@ -3538,23 +3559,7 @@
{
int32_t i;
permfifotype *per;
- /* int32_t j,k; */
-#if 0
- uint8_t snotbuf[32];
- j = 0; k = 0;
- for(i=0;i<4096;i++)
- if (waloff[i] != 0)
- {
- sprintf(snotbuf,"%ld-%ld",i,tilesizx[i]*tilesizy[i]);
- printext256((j>>5)*40+32,(j&31)*6,walock[i]>>3,-1,snotbuf,1);
- k += tilesizx[i]*tilesizy[i];
- j++;
- }
- sprintf(snotbuf,"Total: %ld",k);
- printext256((j>>5)*40+32,(j&31)*6,31,-1,snotbuf,1);
-#endif
-
if (qsetmode == 200)
{
for(i=permtail;i!=permhead;i=((i+1)&(MAXPERMS-1)))
@@ -3665,7 +3670,7 @@
}
-int loadpics(uint8_t *filename, uint8_t * gamedir)
+int loadpics(char *filename, uint8_t * gamedir)
{
int32_t offscount, localtilestart, localtileend, dasiz;
short fil, i, j, k;
@@ -7216,7 +7221,8 @@
permhead = permtail = 0;
}
-
+// Render a sprite on screen. This is used by the Engine but also the Game module
+// when drawing the HUD or the Weapon held by the player !!!
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)
@@ -7427,7 +7433,7 @@
VBE_setPalette(0, 256, (uint8_t *) tempbuf);
}
-
+//This is only used by drawmapview.
static void fillpolygon(int32_t npoints)
{
int32_t z, zz, x1, y1, x2, y2, miny, maxy, y, xinc, cnt;
@@ -8071,7 +8077,8 @@
/* DRAWROOMS TO TILE BACKUP&SET CODE */
tilesizx[tilenume] = xsiz; tilesizy[tilenume] = ysiz;
bakxsiz[setviewcnt] = xsiz; bakysiz[setviewcnt] = ysiz;
- bakvidoption[setviewcnt] = vidoption; vidoption = 2;
+ bakvidoption[setviewcnt] = vidoption;
+ vidoption = 2;
bakframeplace[setviewcnt] = frameplace; frameplace = waloff[tilenume];
bakwindowx1[setviewcnt] = windowx1; bakwindowy1[setviewcnt] = windowy1;
bakwindowx2[setviewcnt] = windowx2; bakwindowy2[setviewcnt] = windowy2;
--- a/Engine/src/engine.h
+++ b/Engine/src/engine.h
@@ -58,7 +58,7 @@
void nextpage(void);
void drawrooms(int32_t daposx, int32_t daposy, int32_t daposz,
short daang, int32_t dahoriz, short dacursectnum);
-int loadboard(uint8_t *filename, int32_t *daposx, int32_t *daposy,
+int loadboard(char *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,
@@ -67,8 +67,8 @@
uint8_t name[82], uint8_t fontsize);
void initengine(void);
void uninitengine(void);
-int loadpics(uint8_t *filename, uint8_t * gamedir);
-int saveboard(uint8_t *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz,
+int loadpics(char *filename, uint8_t * gamedir);
+int saveboard(char *filename, int32_t *daposx, int32_t *daposy, int32_t *daposz,
short *daang, short *dacursectnum);
void plotpixel(int32_t x, int32_t y, uint8_t col);
uint8_t getpixel(int32_t x, int32_t y);
--- a/Engine/src/engine_protos.h
+++ b/Engine/src/engine_protos.h
@@ -30,7 +30,7 @@
extern void suckcache(int32_t *suckptr);
extern void agecache(void);
extern void reportandexit(char *errormessage);
-extern int32_t initgroupfile(const uint8_t *filename);
+extern int32_t initgroupfile(const char *filename);
extern void uninitgroupfile(void);
extern int32_t kopen4load(const char *filename,int readfromGRP);
extern int32_t kread(int32_t handle, void *buffer, int32_t leng);
@@ -85,24 +85,7 @@
extern void restore256_palette(void);
extern uint32_t getticks(void);
-/* mmulti.c */
-// converted to function pointers
-/*
-void (*callcommit)(void);
-void (*initcrc)(void);
-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);
-void (*sendlogoff)(void);
-int (*getoutputcirclesize)(void);
-void (*setsocket)(short newsocket);
-short (*getpacket)(short *other, uint8_t *bufptr);
-void (*flushpackets)(void);
-void (*genericmultifunction)(int32_t other, uint8_t *bufptr, int32_t messleng, int32_t command);
-*/
+
void callcommit(void);
void initcrc(void);
int32_t getcrc(uint8_t *buffer, short bufleng);
@@ -123,8 +106,8 @@
//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(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 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(uint8_t davidoption, int32_t daxdim, int32_t daydim);
extern void setmmxoverlay(int isenabled);
extern int getmmxoverlay(void);
@@ -133,7 +116,7 @@
extern void nextpage(void);
extern void loadtile(short tilenume);
extern int allocatepermanenttile(short tilenume, int32_t xsiz, int32_t ysiz);
-extern int loadpics(uint8_t *filename, uint8_t * gamedir);
+extern int loadpics(char *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);
--- a/Engine/src/pragmas.c
+++ b/Engine/src/pragmas.c
@@ -11,7 +11,7 @@
void clearbuf(void *d, int32_t c, int32_t a)
{
- int32_t *p = (long*)d;
+ int32_t *p = (int32_t*)d;
while ((c--) > 0) *(p++) = a;
}
@@ -29,7 +29,7 @@
void copybuf(void *s, void *d, int32_t c)
{
- int32_t *p = (long*)s, *q = (long*)d;
+ int32_t *p = (int32_t*)s, *q = (int32_t*)d;
while ((c--) > 0) *(q++) = *(p++);
}
@@ -45,13 +45,13 @@
while((c--) > 0) *(q++) = *(p--);
}
-void qinterpolatedown16(long* bufptr, int32_t num, int32_t val, int32_t add)
+void qinterpolatedown16(int32_t* bufptr, int32_t num, int32_t val, int32_t add)
{ // gee, I wonder who could have provided this...
int32_t i, *lptr = bufptr;
for(i=0;i<num;i++) { lptr[i] = (val>>16); val += add; }
}
-void qinterpolatedown16short(long* bufptr, int32_t num, int32_t val, int32_t add)
+void qinterpolatedown16short(int32_t* bufptr, int32_t num, int32_t val, int32_t add)
{ // ...maybe the same person who provided this too?
int32_t i; short *sptr = (short *)bufptr;
for(i=0;i<num;i++) { sptr[i] = (short)(val>>16); val += add; }
--- a/Engine/src/pragmas.h
+++ b/Engine/src/pragmas.h
@@ -157,8 +157,8 @@
void clearbufbyte(void *D, int32_t c, int32_t a);
void copybufbyte(void *S, void *D, int32_t c);
-void qinterpolatedown16 (long* bufptr, int32_t num, int32_t val, int32_t add);
-void qinterpolatedown16short (long* bufptr, int32_t num, int32_t val, int32_t add);
+void qinterpolatedown16 (int32_t* bufptr, int32_t num, int32_t val, int32_t add);
+void qinterpolatedown16short (int32_t* bufptr, int32_t num, int32_t val, int32_t add);
#endif /* !defined _INCLUDE_PRAGMAS_H_ */
--- a/Engine/src/sdl_driver.c
+++ b/Engine/src/sdl_driver.c
@@ -355,8 +355,8 @@
void set_sdl_renderer(void);
-static __inline void __out_sdldebug(const uint8_t *subsystem,
- const uint8_t *fmt, va_list ap)
+static __inline void __out_sdldebug(const char *subsystem,
+ const char *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 uint8_t *fmt, ...)
+static void sdldebug(const char *fmt, ...)
{
va_list ap;
@@ -393,9 +393,9 @@
#endif
-static void __append_sdl_surface_flag(SDL_Surface *_surface, uint8_t *str,
+static void __append_sdl_surface_flag(SDL_Surface *_surface, char *str,
size_t strsize, Uint32 flag,
- const uint8_t *flagstr)
+ const char *flagstr)
{
if (_surface->flags & flag)
{
@@ -413,7 +413,7 @@
static void output_surface_info(SDL_Surface *_surface)
{
const SDL_VideoInfo *info;
- uint8_t f[256];
+ char f[256];
if (!_sdl_debug_file)
return;
@@ -471,7 +471,7 @@
static void output_driver_info(void)
{
- uint8_t buffer[256];
+ char buffer[256];
if (!_sdl_debug_file)
return;
@@ -889,7 +889,7 @@
static SDL_Joystick *joystick = NULL;
void _joystick_init(void)
{
- const uint8_t *envr = getenv(BUILD_SDLJOYSTICK);
+ const char *envr = getenv(BUILD_SDLJOYSTICK);
int favored = 0;
int numsticks;
int i;
@@ -923,7 +923,7 @@
for (i = 0; i < numsticks; i++)
{
- const uint8_t *stickname = SDL_JoystickName(i);
+ const char *stickname = SDL_JoystickName(i);
if ((envr != NULL) && (strcmp(envr, stickname) == 0))
favored = i;
@@ -1010,7 +1010,7 @@
static __inline void init_debugging(void)
{
- const uint8_t *envr = getenv(BUILD_SDLDEBUG);
+ const char *envr = getenv(BUILD_SDLDEBUG);
debug_hall_of_mirrors = (getenv(BUILD_HALLOFMIRRORS) != NULL);
@@ -1067,7 +1067,7 @@
void set_sdl_renderer(void)
{
- const uint8_t *envr = getenv(BUILD_RENDERER);
+ const char *envr = getenv(BUILD_RENDERER);
#ifdef USE_OPENGL
int need_opengl_lib = 0;
--- a/Game/src/_functio.h
+++ b/Game/src/_functio.h
@@ -37,7 +37,7 @@
#ifdef __cplusplus
extern "C" {
#endif
-uint8_t * gamefunctions[] =
+char * gamefunctions[] =
{
"Move_Forward",
"Move_Backward",
@@ -102,9 +102,9 @@
// if not found and use default keys.
struct {
- uint8_t * entryKey;
- uint8_t * keyname1;
- uint8_t * keyname2;
+ char * entryKey;
+ char * keyname1;
+ char * keyname2;
} keydefaults[] = {
{ "Move_Forward", "Up", "Kpad8" },
{ "Move_Backward", "Down", "Kpad2" },
--- a/Game/src/_rts.h
+++ b/Game/src/_rts.h
@@ -33,7 +33,7 @@
typedef struct
{
- uint8_t name[8];
+ char name[8];
int32 handle,position,size;
} lumpinfo_t;
@@ -48,7 +48,7 @@
{
int32 filepos;
int32 size;
- uint8_t name[8];
+ char name[8];
} filelump_t;
#endif
--- a/Game/src/animlib.c
+++ b/Game/src/animlib.c
@@ -55,7 +55,7 @@
//
//****************************************************************************
-void CheckAnimStarted ( uint8_t * funcname )
+void CheckAnimStarted ( char * funcname )
{
if (!Anim_Started)
Error(EXIT_FAILURE, "ANIMLIB_%s: Anim has not been initialized\n",funcname);
--- a/Game/src/audiolib/dsl.c
+++ b/Game/src/audiolib/dsl.c
@@ -133,7 +133,6 @@
int MixMode, void ( *CallBackFunc )( void ) )
{
Uint16 format;
- Uint8 *tmp;
int channels;
int chunksize;
int blah;
--- a/Game/src/config.c
+++ b/Game/src/config.c
@@ -81,7 +81,7 @@
int32 mouseSensitivity_X;
int32 mouseSensitivity_Y;
-static uint8_t setupfilename[512];//={SETUPFILENAME};
+static char setupfilename[512];//={SETUPFILENAME};
static int32 scripthandle;
static int32 setupread=0;
/*
@@ -149,7 +149,7 @@
===================
*/
-int32 CONFIG_FunctionNameToNum( uint8_t * func )
+int32 CONFIG_FunctionNameToNum( char * func )
{
int32 i;
@@ -192,7 +192,7 @@
*/
-int32 CONFIG_AnalogNameToNum( uint8_t * func )
+int32 CONFIG_AnalogNameToNum( char * func )
{
if (!stricmp(func,"analog_turning"))
@@ -295,8 +295,8 @@
int32 i;
int32 numkeyentries;
int32 function;
- uint8_t keyname1[80];
- uint8_t keyname2[80];
+ char keyname1[80];
+ char keyname2[80];
kb_scancode key1,key2;
// set default keys in case duke3d.cfg was not found
@@ -356,18 +356,18 @@
void CONFIG_SetupMouse( int32 scripthandle )
{
int32 i;
- uint8_t str[80];
- uint8_t temp[80];
+ char str[80];
+ char temp[80];
int32 function, scale;
for (i=0;i<MAXMOUSEBUTTONS;i++)
{
- sprintf(str,"MouseButton%ld",i);
+ sprintf(str,"MouseButton%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
CONTROL_MapButton( function, i, false );
- sprintf(str,"MouseButtonClicked%ld",i);
+ sprintf(str,"MouseButtonClicked%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -376,7 +376,7 @@
// map over the axes
for (i=0;i<MAXMOUSEAXES;i++)
{
- sprintf(str,"MouseAnalogAxes%ld",i);
+ sprintf(str,"MouseAnalogAxes%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_AnalogNameToNum(temp);
@@ -385,12 +385,12 @@
//TODO Fix the Analog mouse axis issue. Just make a new function for registering them.
//CONTROL_MapAnalogAxis(i,function);
}
- sprintf(str,"MouseDigitalAxes%ld_0",i);
+ sprintf(str,"MouseDigitalAxes%d_0",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
CONTROL_MapDigitalAxis( i, function, 0 );
- sprintf(str,"MouseDigitalAxes%ld_1",i);
+ sprintf(str,"MouseDigitalAxes%d_1",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -424,20 +424,20 @@
void CONFIG_SetupGamePad( int32 scripthandle )
{
int32 i;
- uint8_t str[80];
- uint8_t temp[80];
+ char str[80];
+ char temp[80];
int32 function;
for (i=0;i<MAXJOYBUTTONS;i++)
{
- sprintf(str,"JoystickButton%ld",i);
+ sprintf(str,"JoystickButton%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapButton( function, i, false );
- sprintf(str,"JoystickButtonClicked%ld",i);
+ sprintf(str,"JoystickButtonClicked%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -447,13 +447,13 @@
// map over the axes
for (i=0;i<MAXGAMEPADAXES;i++)
{
- sprintf(str,"GamePadDigitalAxes%ld_0",i);
+ sprintf(str,"GamePadDigitalAxes%d_0",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapDigitalAxis( i, function, 0 );
- sprintf(str,"GamePadDigitalAxes%ld_1",i);
+ sprintf(str,"GamePadDigitalAxes%d_1",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -475,20 +475,20 @@
void CONFIG_SetupJoystick( int32 scripthandle )
{
int32 i, j;
- uint8_t str[80];
- uint8_t temp[80];
+ char str[80];
+ char temp[80];
int32 function, deadzone;
float scale;
for (i=0;i<MAXJOYBUTTONS;i++)
{
- sprintf(str,"JoystickButton%ld",i);
+ sprintf(str,"JoystickButton%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapJoyButton( function, i, false );
- sprintf(str,"JoystickButtonClicked%ld",i);
+ sprintf(str,"JoystickButtonClicked%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -498,7 +498,7 @@
// map over the axes
for (i=0;i<MAXJOYAXES;i++)
{
- sprintf(str,"JoystickAnalogAxes%ld",i);
+ sprintf(str,"JoystickAnalogAxes%d",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_AnalogNameToNum(temp);
@@ -506,23 +506,23 @@
//{
CONTROL_MapAnalogAxis(i,function);
//}
- sprintf(str,"JoystickDigitalAxes%ld_0",i);
+ sprintf(str,"JoystickDigitalAxes%d_0",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapDigitalAxis( i, function, 0 );
- sprintf(str,"JoystickDigitalAxes%ld_1",i);
+ sprintf(str,"JoystickDigitalAxes%d_1",i);
memset(temp,0,sizeof(temp));
SCRIPT_GetString(scripthandle, "Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
if (function != -1)
CONTROL_MapDigitalAxis( i, function, 1 );
- sprintf(str,"JoystickAnalogScale%ld",i);
+ sprintf(str,"JoystickAnalogScale%d",i);
SCRIPT_GetFloat(scripthandle, "Controls", str,&scale);
CONTROL_SetAnalogAxisScale( i, scale );
deadzone = 0;
- sprintf(str,"JoystickAnalogDeadzone%ld",i);
+ sprintf(str,"JoystickAnalogDeadzone%d",i);
SCRIPT_GetNumber(scripthandle, "Controls", str, &deadzone);
CONTROL_SetAnalogAxisDeadzone( i, deadzone);
}
@@ -532,7 +532,7 @@
{
for(j=0; j < 8; j++) // 8? because hats can have 8 different values
{
- sprintf(str,"JoystickHat%ld_%ld",i, j);
+ sprintf(str,"JoystickHat%ld_%d",i, j);
memset(temp,0,sizeof(temp));
SCRIPT_GetString( scripthandle,"Controls", str,temp);
function = CONFIG_FunctionNameToNum(temp);
@@ -556,7 +556,7 @@
short i;
uint8_t fn[] = "game_.sav";
FILE *fil;
- uint8_t fullpathsavefilename[16];
+ char fullpathsavefilename[16];
for (i=0;i<10;i++)
@@ -605,7 +605,7 @@
void CONFIG_ReadSetup( void )
{
int32 dummy;
- uint8_t commmacro[] = COMMMACRO;
+ char commmacro[] = COMMMACRO;
FILE* setup_file_hdl;
printf("CONFIG_ReadSetup...\n");
@@ -811,7 +811,7 @@
void CONFIG_WriteSetup( void )
{
int32 dummy, i;
- uint8_t commmacro[] = COMMMACRO;
+ char commmacro[] = COMMMACRO;
if (!setupread) return;
@@ -864,7 +864,7 @@
for (i=0;i<MAXMOUSEAXES*2;i++)
{
- sprintf((uint8_t *)tempbuf, "MouseDigitalAxes%ld_%d", i>>1, i&1);
+ sprintf((uint8_t *)tempbuf, "MouseDigitalAxes%d_%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]):"");
}
@@ -881,7 +881,7 @@
for(dummy=0;dummy<10;dummy++)
{
- sprintf(buf,"WeaponChoice%ld",dummy);
+ sprintf(buf,"WeaponChoice%d",dummy);
SCRIPT_PutNumber( scripthandle, "Misc",buf,ud.mywchoice[dummy],false,false);
}
--- a/Game/src/console.c
+++ b/Game/src/console.c
@@ -16,19 +16,19 @@
typedef struct console_element
{
- uint8_t text[MAX_CONSOLE_STRING_LENGTH];
+ char text[MAX_CONSOLE_STRING_LENGTH];
void* prev;
void* next;
}CONSOLEELEMENT;
// Private member functions
-void CONSOLE_InsertUsedCommand(const uint8_t * szUsedCommand);
+void CONSOLE_InsertUsedCommand(const char * szUsedCommand);
void CONSOLE_ClearUsedCommandList();
void CONSOLE_RecalculateDirtyBuffer();
// console argument tracker
int argc;
-uint8_t argv[MAX_CVAR_ARGS][MAX_CONSOLE_STRING_LENGTH];
+char 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
-uint8_t dirty_buffer[MAX_CONSOLE_STRING_LENGTH];
+char 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.
- uint8_t *sStartupScript = "startup.cfg";
+ char *sStartupScript = "startup.cfg";
FILE* fp = fopen(sStartupScript, "r");
@@ -99,7 +99,7 @@
// If the file exists
if(NULL != fp)
{
- uint8_t line[128];
+ char line[128];
memset(line, 0, 128);
while(fgets(line ,128-1, fp) != NULL)
@@ -114,7 +114,7 @@
void CONSOLE_HandleInput()
{
- uint8_t * lastKey;
+ char * lastKey;
int tmp;
if(g_CV_classic)
@@ -441,10 +441,10 @@
}
}
-void CONSOLE_ParseCommand(uint8_t * command)
+void CONSOLE_ParseCommand(char * command)
{
- uint8_t *cvar;
- uint8_t *token;
+ char *cvar;
+ char *token;
int i, numCvars;
argc = 0;
@@ -486,7 +486,7 @@
}
-void CONSOLE_InsertUsedCommand(const uint8_t * szUsedCommand)
+void CONSOLE_InsertUsedCommand(const char * 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 uint8_t *newmsg, ...)
+void CONSOLE_Printf(const char *newmsg, ...)
{
CONSOLEELEMENT *pElement;
va_list argptr;
- uint8_t msg[512];//[MAX_CONSOLE_STRING_LENGTH];
+ char 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
-uint8_t * CONSOLE_GetArgv(unsigned int var)
+char * 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(uint8_t * command);
-void CONSOLE_Printf(const uint8_t *newmsg, ...);
+void CONSOLE_ParseCommand(char * command);
+void CONSOLE_Printf(const char *newmsg, ...);
int CONSOLE_GetArgc();
-uint8_t * CONSOLE_GetArgv(unsigned int var);
+char * CONSOLE_GetArgv(unsigned int var);
int CONSOLE_IsActive();
void CONSOLE_SetActive(int i);
--- a/Game/src/control.c
+++ b/Game/src/control.c
@@ -84,14 +84,7 @@
static float JoyAnalogScale[MAXJOYAXES];
static int32 JoyAnalogDeadzone[MAXJOYAXES];
-//Extern functions from SDLDriver.c:
-int _joystick_hat(int hat);
-void _joystick_deinit(void);
-void _joystick_init(void);
-int _joystick_button(int button);
-int _joystick_axis(int axis);
-int _joystick_update(void);
-//End of SDLDriver declaration
+
int ACTION(int i)
{
--- a/Game/src/cvar_defs.c
+++ b/Game/src/cvar_defs.c
@@ -15,6 +15,8 @@
//We need to access debug soundinfo
#include "sounddebugdefs.h"
+#include "../../Engine/src/sdl_driver.h"
+
// Bind our Cvars at startup. You can still add bindings after this call, but
// it is recommanded that you bind your default CVars here.
void CVARDEFS_Init()
@@ -65,34 +67,33 @@
if(g_CV_DebugJoystick)
{
int i;
- uint8_t buf[128];
- minitext(2, 2, "Debug Joystick", 17,10+16);
+ char buf[128];
+ minitext(2, 2, "Debug Joystick", 17,10+16);
- for(i = 0; i < MAXJOYAXES; i++)
- {
- sprintf(buf, "Joystick Axis%d: Raw: %d Used:%d", i,
- _joystick_axis(i), CONTROL_GetFilteredAxisValue(i));
- minitext(2, (i*8)+12, buf, 23,10+16);
- }
+ for(i = 0; i < MAXJOYAXES; i++)
+ {
+ sprintf(buf, "Joystick Axis%d: Raw: %d Used:%d", i,_joystick_axis(i), CONTROL_GetFilteredAxisValue(i));
+ minitext(2, (i*8)+12, buf, 23,10+16);
+ }
- for(i = 0; i < MAXJOYBUTTONS; i++)
- {
- sprintf(buf, "Button%d: %d", i, _joystick_button(i));
- if(i < (MAXJOYBUTTONS/2))
- {
- minitext(2, (i*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
- }
- else
- {
- minitext(55, ((i-16)*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
- }
- }
+ for(i = 0; i < MAXJOYBUTTONS; i++)
+ {
+ sprintf(buf, "Button%d: %d", i, _joystick_button(i));
+ if(i < (MAXJOYBUTTONS/2))
+ {
+ minitext(2, (i*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
+ }
+ else
+ {
+ minitext(55, ((i-16)*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
+ }
+ }
- for(i = 0; i < MAXJOYHATS; i++)
- {
- sprintf(buf, "Hat%d: %d", i, _joystick_hat(i));
- minitext(110, (i*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
- }
+ for(i = 0; i < MAXJOYHATS; i++)
+ {
+ sprintf(buf, "Hat%d: %d", i, _joystick_hat(i));
+ minitext(110, (i*8)+(MAXJOYAXES*8)+12, buf, 23,10+16);
+ }
}
@@ -99,7 +100,7 @@
if(g_CV_DebugSound)
{
- uint8_t buf[128];
+ char buf[128];
minitext(2, 2, "Debug Sound", 17,10+16);
sprintf(buf, "Active sounds: %lu", sounddebugActiveSounds);
--- 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 uint8_t * varname, const uint8_t * varhelp, void* variable, function_t function)
+void CVAR_RegisterCvar(const char * varname, const char * varhelp, void* variable, function_t function)
{
if(NULL == function)
{
--- a/Game/src/cvars.h
+++ b/Game/src/cvars.h
@@ -14,14 +14,14 @@
typedef struct t_cvar_binding
{
- uint8_t name[64];
- uint8_t help[64];
+ char name[64];
+ char help[64];
void* variable;
function_t function;
} cvar_binding;
-void CVAR_RegisterCvar(const uint8_t * varname, const uint8_t * varhelp, void* variable, function_t function);
+void CVAR_RegisterCvar(const char * varname, const char * 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
@@ -373,16 +373,16 @@
extern uint8_t MusicPtr[72000];
extern int32_t msx[2048],msy[2048];
extern short cyclers[MAXCYCLERS][6],numcyclers;
-extern uint8_t myname[2048];
+extern char myname[2048];
struct user_defs
{
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];
+ char user_name[MAXPLAYERS][32];
+ char ridecule[10][40];
+ char savegame[10][22];
+ char pwlockout[128],rtsname[128];
uint8_t overhead_on,last_overhead;
short pause_on,from_bonus;
@@ -434,7 +434,7 @@
typedef struct
{
unsigned int crc32;
- uint8_t * name;
+ char * name;
uint32_t size;
} crc32_t;
@@ -529,9 +529,9 @@
extern short int global_random;
extern int32_t scaredfallz;
-extern uint8_t buf[80]; //My own generic input buffer
+extern char buf[80]; //My own generic input buffer
-extern uint8_t fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
+extern char fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
extern uint8_t scantoasc[128],ready2send;
extern uint8_t scantoascwithshift[128];
@@ -545,7 +545,8 @@
extern uint8_t sounds[NUM_SOUNDS][14];
extern int32_t script[MAXSCRIPTSIZE],*scriptptr,*insptr,*labelcode,labelcnt;
-extern uint8_t *label,*textptr,error,warning,killit_flag;
+extern char *label,*textptr,error,warning;
+extern uint8_t killit_flag;
extern int32_t *actorscrptr[MAXTILES],*parsing_actor;
extern uint8_t actortype[MAXTILES];
extern uint8_t *music_pointer;
@@ -610,11 +611,11 @@
extern short soundps[NUM_SOUNDS],soundpe[NUM_SOUNDS],soundvo[NUM_SOUNDS];
extern uint8_t soundpr[NUM_SOUNDS],soundm[NUM_SOUNDS];
extern int32_t soundsiz[NUM_SOUNDS];
-extern uint8_t level_names[44][33];
+extern char level_names[44][33];
extern int32_t partime[44],designertime[44];
-extern uint8_t volume_names[4][33];
-extern uint8_t skill_names[5][33];
-extern uint8_t level_file_names[44][128];
+extern char volume_names[4][33];
+extern char skill_names[5][33];
+extern char level_file_names[44][128];
extern int32 SoundToggle,MusicToggle;
extern short last_threehundred,lastsavedpos;
@@ -622,7 +623,7 @@
extern short buttonstat;
extern int32_t cachecount;
-extern uint8_t boardfilename[128],waterpal[768],slimepal[768],titlepal[768],drealms[768],endingpal[768];
+extern char 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;
--- a/Game/src/dukeunix.h
+++ b/Game/src/dukeunix.h
@@ -41,10 +41,10 @@
struct find_t
{
DIR *dir;
- uint8_t pattern[MAX_PATH];
- uint8_t name[MAX_PATH];
+ char pattern[MAX_PATH];
+ char name[MAX_PATH];
};
-int _dos_findfirst(uint8_t *filename, int x, struct find_t *f);
+int _dos_findfirst(char *filename, int x, struct find_t *f);
int _dos_findnext(struct find_t *f);
struct dosdate_t
@@ -65,7 +65,7 @@
#define max(x, y) ((x) > (y) ? (x) : (y))
#endif
-#define FP_OFF(x) ((int32_t) (x))
+
#ifndef strcmpi
#define strcmpi(x, y) strcasecmp(x, y)
--- a/Game/src/dummy_audiolib.c
+++ b/Game/src/dummy_audiolib.c
@@ -8,7 +8,8 @@
#include "audiolib/fx_man.h"
#include <inttypes.h>
-
+#include <stdio.h>
+#include "engine_protos.h"
/*
uint8_t *FX_ErrorString( int ErrorNumber ){
static uint8_t nope = '\0';
@@ -190,9 +191,22 @@
{
}
-void PlayMusic(short dummy)
+void PlayMusic(char* filename)
{
-
+ char magicNumber[5];
+ printf("Play music '%s'.\n",filename);
+ int32_t fd = kopen4load(filename,1);
+ if (fd > 0)
+ printf("Found the music size='%d'!\n",kfilelength(fd));
+
+ kread(fd, magicNumber, 4);
+ magicNumber[4] = 0;
+
+ //If midi this should be 'MThd' !
+ printf("Magic number='%s'!\n",magicNumber);
+
+
+ kclose(fd);
}
--- a/Game/src/funct.h
+++ b/Game/src/funct.h
@@ -123,9 +123,9 @@
//#line "sector.c" 2766
extern void checksectors(short snum);
//#line "rts.c" 36
-extern void RTS_AddFile(uint8_t *filename);
+extern void RTS_AddFile(char *filename);
//#line "rts.c" 93
-extern void RTS_Init(uint8_t *filename);
+extern void RTS_Init(char *filename);
//#line "rts.c" 126
extern int32 RTS_NumSounds(void );
//#line "rts.c" 141
@@ -228,7 +228,7 @@
//#line "menues.c" 18
extern void cmenu(short cm);
//#line "menues.c" 38
-extern void savetemp(uint8_t *fn,int32_t daptr,int32_t dasiz);
+extern void savetemp(char *fn,int32_t daptr,int32_t dasiz);
//#line "menues.c" 49
extern void getangplayers(short snum);
//#line "menues.c" 67
@@ -243,9 +243,9 @@
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,uint8_t *t);
+extern int menutext(int x,int y,short s,short p,char *t);
//#line "menues.c" 630
-extern int menutextc(int x,int y,short s,short p,uint8_t *t);
+extern int menutextc(int x,int y,short s,short p,char *t);
//#line "menues.c" 727
extern void bar(int x,int y,short *p,short dainc,uint8_t damodify,short s,short pa);
//#line "menues.c" 806
@@ -286,7 +286,7 @@
//#line "gamedef.c" 1227
extern void passone(int readfromGRP);
//#line "gamedef.c" 1239
-extern void loadefs(uint8_t *fn,uint8_t *mptr, int readfromGRP);
+extern void loadefs(char *fn,uint8_t *mptr, int readfromGRP);
//#line "gamedef.c" 1342
extern uint8_t dodge(spritetype *s);
//#line "gamedef.c" 1374
@@ -312,11 +312,11 @@
//#line "game.c" 81
extern void uninittimer(void );
//#line "game.c" 89
-extern int gametext(int x,int y,uint8_t *t,uint8_t s,short dabits);
+extern int gametext(int x,int y,char *t,uint8_t s,short dabits);
//#line "game.c" 136
-extern int gametextpart(int x,int y,uint8_t *t,uint8_t s,short p);
+extern int gametextpart(int x,int y,char *t,uint8_t s,short p);
//#line "game.c" 192
-extern int minitext(int x,int y,uint8_t *t,uint8_t p,uint8_t sb);
+extern int minitext(int x,int y,char *t,uint8_t p,uint8_t sb);
//#line "game.c" 231
extern void gamenumber(int32_t x,int32_t y,int32_t n,uint8_t s);
//#line "game.c" 248
@@ -375,7 +375,7 @@
//#line "game.c" 1691
extern void binscreen(void );
//#line "game.c" 1705
-extern void gameexit(uint8_t *t);
+extern void gameexit(char *t);
//#line "game.c" 1752
extern short strget(short x,short y,uint8_t *t,short dalen,short c);
//#line "game.c" 1819
@@ -475,11 +475,11 @@
//#line "config.c" 57
extern void CONFIG_GetSetupFilename(void );
//#line "config.c" 170
-extern int32 CONFIG_FunctionNameToNum(uint8_t *func);
+extern int32 CONFIG_FunctionNameToNum(char *func);
//#line "config.c" 192
extern uint8_t *CONFIG_FunctionNumToName(int32 func);
//#line "config.c" 211
-extern int32 CONFIG_AnalogNameToNum(uint8_t *func);
+extern int32 CONFIG_AnalogNameToNum(char *func);
//#line "config.c" 240
extern void CONFIG_SetDefaults(void );
//#line "config.c" 264
--- a/Game/src/function.h
+++ b/Game/src/function.h
@@ -40,7 +40,7 @@
#define NUMGAMEFUNCTIONS 55 //dont forget to check NUMKEYENTRIES
-extern uint8_t * gamefunctions[];
+extern char * gamefunctions[];
enum
{
--- a/Game/src/game.c
+++ b/Game/src/game.c
@@ -89,9 +89,9 @@
// For addfaz's stun server. use /stun to activate
unsigned short g_bStun = 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' };
+char confilename[128] = {"GAME.CON"},boardfilename[128] = {0};
+char waterpal[768], slimepal[768], titlepal[768], drealms[768], endingpal[768];
+char firstdemofile[80] = { '\0' };
#define patchstatusbar(x1,y1,x2,y2) \
{ \
@@ -149,10 +149,11 @@
}
#endif
-int gametext(int x,int y,uint8_t *t,uint8_t s,short dabits)
+int gametext(int x,int y,char *t,uint8_t s,short dabits)
{
short ac,newx;
- uint8_t centre, *oldt;
+ char* oldt;
+ uint8_t centre;
centre = ( x == (320>>1) );
newx = 0;
@@ -197,10 +198,11 @@
return (x);
}
-int gametextpal(int x,int y,uint8_t *t,uint8_t s,uint8_t p)
+int gametextpal(int x,int y,char *t,uint8_t s,uint8_t p)
{
short ac,newx;
- uint8_t centre, *oldt;
+ uint8_t centre;
+ char* oldt;
centre = ( x == (320>>1) );
newx = 0;
@@ -244,10 +246,11 @@
return (x);
}
-int gametextpart(int x,int y,uint8_t *t,uint8_t s,short p)
+int gametextpart(int x,int y,char *t,uint8_t s,short p)
{
short ac,newx, cnt;
- uint8_t centre, *oldt;
+ uint8_t centre;
+ char * oldt;
centre = ( x == (320>>1) );
newx = 0;
@@ -300,11 +303,11 @@
return (x);
}
-int minitext(int x,int y,uint8_t *str,uint8_t p,uint8_t sb)
+int minitext(int x,int y,char *str,uint8_t p,uint8_t sb)
{
short ac;
- uint8_t buf[128];
- uint8_t *t;
+ char buf[128];
+ char *t;
strncpy (buf, str, 128);
buf[127] = 0;
@@ -324,11 +327,11 @@
return (x);
}
-int minitextshade(int x,int y,uint8_t *str,uint8_t s,uint8_t p,uint8_t sb)
+int minitextshade(int x,int y,char *str,uint8_t s,uint8_t p,uint8_t sb)
{
short ac;
- uint8_t buf[128];
- uint8_t *t;
+ char buf[128];
+ char *t;
strncpy (buf, str, 128);
buf[127] = 0;
@@ -350,7 +353,7 @@
void gamenumber(int32_t x,int32_t y,int32_t n,uint8_t s)
{
- uint8_t b[10];
+ char b[10];
//
@@ -358,7 +361,7 @@
// is NON-STANDARD and equivalent to STANDARD
// (void) sprintf(buffer, "%ld", l);
//ltoa(n,b,10);
- sprintf(b,"%ld",n);
+ sprintf(b,"%d",n);
gametext(x,y,b,s,2+8+16);
}
@@ -392,7 +395,7 @@
uint8_t user_quote[MAXUSERQUOTES][128];
// uint8_t typebuflen,typebuf[41];
-static void adduserquote(uint8_t *daquote)
+static void adduserquote(char *daquote)
{
int32_t i;
@@ -424,7 +427,7 @@
uint8_t *grpVersion2char(uint8_t grp_to_identify)
{
- uint8_t *id;
+ char *id;
switch(grp_to_identify)
{
@@ -1421,8 +1424,8 @@
void invennum(int32_t x,int32_t y,uint8_t num1,uint8_t ha,uint8_t sbits)
{
- uint8_t dabuf[80] = {0};
- sprintf(dabuf,"%ld",num1);
+ char dabuf[80] = {0};
+ sprintf(dabuf,"%c",num1);
if(num1 > 99)
{
rotatesprite((x-4)<<16,y<<16,65536L,0,THREEBYFIVE+dabuf[0]-'0',ha,0,sbits,0,0,xdim-1,ydim-1);
@@ -2373,7 +2376,7 @@
}
-void gameexit(uint8_t *msg)
+void gameexit(char *msg)
{
short i;
uint8_t t[256];
@@ -7677,7 +7680,7 @@
void compilecons(void)
{
- uint8_t userconfilename[512];
+ char userconfilename[512];
mymembuf = (uint8_t *)&hittype[0];
labelcode = (int32_t *)§or[0];
@@ -8031,7 +8034,7 @@
void copyprotect(void)
{
FILE *fp;
- uint8_t idfile[256];
+ char idfile[256];
return;
@@ -8437,13 +8440,7 @@
puts("Loading palette/lookups.");
-// CTW - MODIFICATION
-/* if( setgamemode(ScreenMode,ScreenWidth,ScreenHeight) < 0 )
- {
- printf("\nVESA driver for ( %i * %i ) not found/supported!\n",xdim,ydim);
- vidoption = 2;
- setgamemode(vidoption,320,200);
- }*/
+
if( setgamemode(ScreenMode,ScreenWidth,ScreenHeight) < 0 )
{
printf("\nVESA driver for ( %i * %i ) not found/supported!\n",xdim,ydim);
@@ -8452,15 +8449,11 @@
ScreenHeight = 200;
setgamemode(ScreenMode,ScreenWidth,ScreenHeight);
}
-// CTW END - MODIFICATION
+
printf("genspriteremaps()\n");
genspriteremaps();
-//if (VOLUMEONE)
-// { if(numplayers > 4 || ud.multimode > 4)
-// gameexit(" The full version of Duke Nukem 3D supports 5 or more players.");
-// }
setbrightness(ud.brightness>>2,&ps[myconnectindex].palette[0]);
--- a/Game/src/gamedef.c
+++ b/Game/src/gamedef.c
@@ -42,13 +42,13 @@
#define NUMKEYWORDS 112
//From global.c
-void FixFilePath(uint8_t *filename);
+void FixFilePath(char *filename);
//From actors.c
void lotsofmail(spritetype *s, short n);
void lotsofpaper(spritetype *s, short n);
-uint8_t *keyw[NUMKEYWORDS] =
+char *keyw[NUMKEYWORDS] =
{
"definelevelname", // 0
"actor", // 1 [#]
@@ -331,7 +331,7 @@
tempbuf[i] = 0;
for(i=0;i<NUMKEYWORDS;i++)
- if( strcmp( (const uint8_t *)tempbuf,keyw[i]) == 0 )
+ if( strcmp( (const char *)tempbuf,keyw[i]) == 0 )
return i;
return -1;
@@ -698,7 +698,7 @@
return 0;
case 55: // include other con files.
{
- uint8_t includedconfile[512];
+ char includedconfile[512];
scriptptr--;
while( isaltok(*textptr) == 0 )
{
@@ -715,20 +715,8 @@
tempbuf[j] = '\0';
// fix path for unix. (doesn't really matter...)
- FixFilePath((uint8_t *)tempbuf);
-/*
- // Are we loading a TC?
- if(game_dir[0] != '\0')
- {
- // Yes
- sprintf(includedconfile, "%s\\%s", game_dir, tempbuf);
- }
- else
- {
- // No
- sprintf(includedconfile, "%s", tempbuf);
- }
-*/
+ FixFilePath((char *)tempbuf);
+
sprintf(includedconfile, "%s", tempbuf);
fp = TCkopen4load(includedconfile,readfromGRP);
@@ -1504,7 +1492,7 @@
}
-uint8_t *defaultcons[3] =
+char *defaultcons[3] =
{
"GAME.CON",
"USER.CON",
@@ -1548,7 +1536,7 @@
}
}
-void loadefs(uint8_t *filenam, uint8_t *mptr, int readfromGRP)
+void loadefs(char *filenam, uint8_t *mptr, int readfromGRP)
{
int32_t fs,fp;
uint8_t kbdKey;
--- a/Game/src/global.c
+++ b/Game/src/global.c
@@ -89,11 +89,11 @@
int32_t msx[2048],msy[2048];
short cyclers[MAXCYCLERS][6],numcyclers;
-uint8_t fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
+char fta_quotes[NUMOFFIRSTTIMEACTIVE][64];
uint8_t tempbuf[2048], packbuf[576];
-uint8_t buf[80];
+char buf[80];
short camsprite;
short mirrorwall[64], mirrorsector[64], mirrorcnt;
@@ -102,10 +102,11 @@
uint8_t betaname[80];
-uint8_t level_names[44][33],level_file_names[44][128];
+char level_names[44][33];
+char level_file_names[44][128];
int32_t partime[44],designertime[44];
-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", "" };
+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", "" };
volatile int32_t checksume;
int32_t soundsiz[NUM_SOUNDS];
@@ -155,7 +156,8 @@
int32_t script[MAXSCRIPTSIZE],*scriptptr,*insptr,*labelcode,labelcnt;
int32_t *actorscrptr[MAXTILES],*parsing_actor;
-uint8_t *label,*textptr,error,warning,killit_flag;
+char *label,*textptr,error,warning ;
+uint8_t killit_flag;
uint8_t *music_pointer;
uint8_t actortype[MAXTILES];
@@ -200,7 +202,7 @@
int32_t myhorizbak[MOVEFIFOSIZ],dukefriction = 0xcc00, show_shareware;
short myangbak[MOVEFIFOSIZ];
-uint8_t myname[2048] = {"XDUKE"};
+char myname[2048] = {"XDUKE"};
uint8_t camerashitable,freezerhurtowner=0,lasermode;
// CTW - MODIFICATION
// uint8_t networkmode = 255, movesperpacket = 1,gamequit = 0,playonten = 0,everyothertime;
@@ -221,7 +223,7 @@
// portability stuff. --ryan.
// A good portion of this was ripped from GPL'd Rise of the Triad. --ryan.
-void FixFilePath(uint8_t *filename)
+void FixFilePath(char *filename)
{
#if PLATFORM_UNIX
uint8_t *ptr;
@@ -334,9 +336,9 @@
}
#elif defined(PLATFORM_UNIX) || defined(PLATFORM_MACOSX)
-int _dos_findfirst(uint8_t *filename, int x, struct find_t *f)
+int _dos_findfirst(char *filename, int x, struct find_t *f)
{
- uint8_t *ptr;
+ char *ptr;
if (strlen(filename) >= sizeof (f->pattern))
return(1);
@@ -361,7 +363,7 @@
}
-static int check_pattern_nocase(const uint8_t *x, const uint8_t *y)
+static int check_pattern_nocase(const char *x, const char *y)
{
if ((x == NULL) || (y == NULL))
return(0); /* not a match. */
@@ -494,7 +496,7 @@
return (ix - (ix>>4) + (t>>2) + (t>>3));
}
#include "SDL.h"
-void Error (int errorType, uint8_t *error, ...)
+void Error (int errorType, char *error, ...)
{
va_list argptr;
@@ -522,7 +524,7 @@
// usage: write2disk(__LINE__, __FILE__, "c:\temp\my_dbug_file.txt", uint8_t * msg);
int i, k=0;
- uint8_t filename[2048];
+ char filename[2048];
FILE *pFile;
for(i=0; cfilename[i]; i++)
@@ -542,7 +544,8 @@
int32 SafeOpenAppend (const char *_filename, int32 filetype)
{
int handle;
- uint8_t filename[MAX_PATH];
+ char filename[MAX_PATH];
+
strncpy(filename, _filename, sizeof (filename));
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
@@ -596,10 +599,13 @@
return handle;
}
+
+
+
int32 SafeOpenRead (const char *_filename, int32 filetype)
{
int handle;
- uint8_t filename[MAX_PATH];
+ char filename[MAX_PATH];
strncpy(filename, _filename, sizeof (filename));
filename[sizeof (filename) - 1] = '\0';
FixFilePath(filename);
@@ -903,7 +909,7 @@
}
#endif
-uint8_t ApogeePath[256];
+char ApogeePath[256];
int setup_homedir (void)
{
@@ -927,7 +933,7 @@
}
-uint8_t CheckParm (uint8_t *check)
+uint8_t CheckParm (char *check)
{
int i;
for (i = 1; i < _argc; i++)
--- a/Game/src/keyboard.c
+++ b/Game/src/keyboard.c
@@ -264,7 +264,7 @@
return NULL;
}
-kb_scancode KB_StringToScanCode( uint8_t * string )
+kb_scancode KB_StringToScanCode( char * string )
{
uint8_t * name = NULL;
int32 i=0;
--- a/Game/src/keyboard.h
+++ b/Game/src/keyboard.h
@@ -211,7 +211,7 @@
void KB_FlushKeyboardQueue( void ); // Empties the keyboard queue of all waiting characters.
void KB_ClearKeysDown( void ); // Clears all keys down flags.
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
+kb_scancode KB_StringToScanCode( char * 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
@@ -146,7 +146,7 @@
}
-void savetemp(uint8_t *fn,int32_t daptr,int32_t dasiz)
+void savetemp(char *fn,int32_t daptr,int32_t dasiz)
{
int fp;
@@ -542,12 +542,12 @@
int saveplayer(int8_t spot)
{
int32_t i, j;
- uint8_t fn[] = "game0.sav";
- uint8_t mpfn[] = "gameA_00.sav";
- uint8_t *fnptr,scriptptrs[MAXSCRIPTSIZE];
+ char fn[] = "game0.sav";
+ char mpfn[] = "gameA_00.sav";
+ char *fnptr,scriptptrs[MAXSCRIPTSIZE];
FILE *fil;
int32_t bv = BYTEVERSION;
- uint8_t fullpathsavefilename[16];
+ char fullpathsavefilename[16];
if(spot < 0)
{
@@ -903,7 +903,7 @@
}
}
-int menutext(int x,int y,short s,short p,uint8_t *t)
+int menutext(int x,int y,short s,short p,char *t)
{
short i, ac, centre;
@@ -1018,7 +1018,7 @@
return (x);
}
-int menutextc(int x,int y,short s,short p,uint8_t *t)
+int menutextc(int x,int y,short s,short p,char *t)
{
short i, ac, centre;
--- a/Game/src/player.c
+++ b/Game/src/player.c
@@ -1301,6 +1301,8 @@
int8_t gs;
struct player_struct *p;
short *kb;
+
+
p = &ps[snum];
kb = &p->kickback_pic;
--- a/Game/src/premap.c
+++ b/Game/src/premap.c
@@ -1073,7 +1073,7 @@
#define BOT_MAX_NAME 20
int bot_used[BOT_MAX_NAME] = { false };
- uint8_t *bot_names[] = { "* ELASTI",
+ char *bot_names[] = { "* ELASTI",
"* ^ZookeM^",
"* DOOM",
"* DRO",
@@ -1444,8 +1444,8 @@
{
short i;
int32_t l;
- uint8_t levname[256];
- uint8_t fulllevelfilename[512];
+ char levname[256];
+ char fulllevelfilename[512];
KB_ClearKeyDown(sc_Pause); // avoid entering in pause mode.
--- a/Game/src/rts.c
+++ b/Game/src/rts.c
@@ -57,7 +57,7 @@
====================
*/
-void RTS_AddFile (uint8_t *filename)
+void RTS_AddFile (char *filename)
{
wadinfo_t header;
lumpinfo_t *lump_p;
@@ -114,7 +114,7 @@
====================
*/
-void RTS_Init (uint8_t *filename)
+void RTS_Init (char *filename)
{
int32 length;
//
--- a/Game/src/rts.h
+++ b/Game/src/rts.h
@@ -43,7 +43,7 @@
====================
*/
-void RTS_Init (uint8_t *filename);
+void RTS_Init (char *filename);
/*
====================
=
--- a/Game/src/scriplib.c
+++ b/Game/src/scriplib.c
@@ -53,7 +53,7 @@
uint8_t *key;
scriptflag_t type;
union {
- uint8_t *string[2];
+ char *string[2];
int number;
float floatnumber;
} data;
@@ -317,7 +317,7 @@
}
}
-static scriptnode_t *SCRIPT_findinchildren (scriptnode_t *parent, uint8_t *s)
+static scriptnode_t *SCRIPT_findinchildren (scriptnode_t *parent, char *s)
{
scriptnode_t *cur = parent;
@@ -374,7 +374,7 @@
==============
*/
-int32 SCRIPT_Parse ( uint8_t *data, int32 length, uint8_t * name )
+int32 SCRIPT_Parse ( uint8_t *data, int32 length, char * name )
{
STUBBED("Parse");
@@ -390,10 +390,10 @@
==============
*/
-int32 SCRIPT_Load ( uint8_t * filename )
+int32 SCRIPT_Load ( char * filename )
{
FILE *fp;
- uint8_t curline[128];
+ char curline[128];
scriptnode_t *headnode = NULL;
scriptnode_t *cur_subsection = NULL;
@@ -481,7 +481,7 @@
=
==============
*/
-void SCRIPT_Save (int32 scripthandle, uint8_t * filename)
+void SCRIPT_Save (int32 scripthandle, char* filename)
{
FILE *fp;
scriptnode_t *head;
@@ -538,7 +538,7 @@
==============
*/
-int32 SCRIPT_NumberEntries( int32 scripthandle, uint8_t * sectionname )
+int32 SCRIPT_NumberEntries( int32 scripthandle, char * sectionname )
{
scriptnode_t *node = NULL;
int32 entries = 0;
@@ -566,7 +566,7 @@
=
==============
*/
-uint8_t * SCRIPT_Entry( int32 scripthandle, uint8_t * sectionname, int32 which )
+uint8_t * SCRIPT_Entry( int32 scripthandle, char * sectionname, int32 which )
{
scriptnode_t *node = NULL;
int32 entrynum = 0;
@@ -599,7 +599,7 @@
=
==============
*/
-uint8_t * SCRIPT_GetRaw(int32 scripthandle, uint8_t * sectionname, uint8_t * entryname)
+uint8_t * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname)
{
STUBBED("GetRaw");
@@ -616,9 +616,9 @@
void SCRIPT_GetString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * dest
+ char * sectionname,
+ char * entryname,
+ char * dest
)
{
scriptnode_t *cur;
@@ -650,10 +650,10 @@
void SCRIPT_GetDoubleString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * dest1,
- uint8_t * dest2
+ char * sectionname,
+ char * entryname,
+ char * dest1,
+ char * dest2
)
{
scriptnode_t *cur;
@@ -686,8 +686,8 @@
boolean SCRIPT_GetNumber
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
int32 * number
)
{
@@ -778,8 +778,8 @@
void SCRIPT_GetDouble
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
double * number
)
{
@@ -870,9 +870,9 @@
void SCRIPT_PutString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * string
+ char * sectionname,
+ char * entryname,
+ char * string
)
{
scriptnode_t *head;
@@ -922,10 +922,10 @@
void SCRIPT_PutDoubleString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * string1,
- uint8_t * string2
+ char * sectionname,
+ char * entryname,
+ char * string1,
+ char * string2
)
{
scriptnode_t *head;
@@ -977,8 +977,8 @@
void SCRIPT_PutNumber
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
int32 number,
boolean hexadecimal,
boolean defaultvalue
--- a/Game/src/scriplib.h
+++ b/Game/src/scriplib.h
@@ -59,7 +59,7 @@
==============
*/
-int32 SCRIPT_Parse ( uint8_t *data, int32 length, uint8_t * name );
+int32 SCRIPT_Parse ( uint8_t *data, int32 length, char * name );
/*
@@ -70,7 +70,7 @@
==============
*/
-int32 SCRIPT_Load ( uint8_t * filename );
+int32 SCRIPT_Load ( char * filename );
/*
==============
@@ -79,7 +79,7 @@
=
==============
*/
-void SCRIPT_Save (int32 scripthandle, uint8_t * filename);
+void SCRIPT_Save (int32 scripthandle, char * filename);
/*
@@ -110,7 +110,7 @@
==============
*/
-int32 SCRIPT_NumberEntries( int32 scripthandle, uint8_t * sectionname );
+int32 SCRIPT_NumberEntries( int32 scripthandle, char * sectionname );
/*
==============
@@ -120,7 +120,7 @@
==============
*/
-uint8_t * SCRIPT_Entry( int32 scripthandle, uint8_t * sectionname, int32 which );
+uint8_t * SCRIPT_Entry( int32 scripthandle, char * sectionname, int32 which );
/*
@@ -130,7 +130,7 @@
=
==============
*/
-uint8_t * SCRIPT_GetRaw(int32 scripthandle, uint8_t * sectionname, uint8_t * entryname);
+uint8_t * SCRIPT_GetRaw(int32 scripthandle, char * sectionname, char * entryname);
/*
==============
@@ -142,9 +142,9 @@
void SCRIPT_GetString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * dest
+ char * sectionname,
+ char * entryname,
+ char * dest
);
/*
@@ -157,10 +157,10 @@
void SCRIPT_GetDoubleString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * dest1,
- uint8_t * dest2
+ char * sectionname,
+ char * entryname,
+ char * dest1,
+ char * dest2
);
/*
@@ -173,8 +173,8 @@
boolean SCRIPT_GetNumber
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
int32 * number
);
@@ -221,8 +221,8 @@
void SCRIPT_GetDouble
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
double * number
);
@@ -295,9 +295,9 @@
void SCRIPT_PutString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * string
+ char * sectionname,
+ char * entryname,
+ char * string
);
/*
@@ -310,10 +310,10 @@
void SCRIPT_PutDoubleString
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
- uint8_t * string1,
- uint8_t * string2
+ char * sectionname,
+ char * entryname,
+ char * string1,
+ char * string2
);
/*
@@ -326,8 +326,8 @@
void SCRIPT_PutNumber
(
int32 scripthandle,
- uint8_t * sectionname,
- uint8_t * entryname,
+ char * sectionname,
+ char * entryname,
int32 number,
boolean hexadecimal,
boolean defaultvalue
--- a/Game/src/sounds.c
+++ b/Game/src/sounds.c
@@ -254,35 +254,11 @@
void playmusic(uint8_t *fn)
{
-#if PLATFORM_DOS
- short fp;
- int32_t l;
-
if(MusicToggle == 0) return;
if(MusicDevice == NumSoundCards) return;
- if(eightytwofifty && numplayers > 1) return;
- fp = kopen4load(fn,0);
-
- if(fp == -1) return;
-
- l = kfilelength( fp );
- if(l >= 72000)
- {
- kclose(fp);
- return;
- }
-
- kread( fp, MusicPtr, l);
- kclose( fp );
- MUSIC_PlaySong( MusicPtr, MUSIC_LoopSong );
-#else
- if(MusicToggle == 0) return;
- if(MusicDevice == NumSoundCards) return;
-
// the SDL_mixer version does more or less this same thing. --ryan.
PlayMusic(fn);
-#endif
}
uint8_t loadsound(unsigned short num)
--- a/Game/src/util_lib.h
+++ b/Game/src/util_lib.h
@@ -50,9 +50,9 @@
extern uint8_t ** _argv;
void RegisterShutdownFunction( void (* shutdown) (void) );
-void Error (int errorType, uint8_t *error, ...);
+void Error (int errorType, char *error, ...);
-uint8_t CheckParm (uint8_t *check);
+uint8_t CheckParm (char *check);
void *SafeMalloc (int32 size);
int32 SafeMallocSize (void * ptr);
--- a/xcode/Duke3D.xcodeproj/project.pbxproj
+++ b/xcode/Duke3D.xcodeproj/project.pbxproj
@@ -180,6 +180,7 @@
2D7C17D5167AD6A500E1BBA1 /* pitch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = pitch.h; path = ../../Game/src/audiolib/pitch.h; sourceTree = "<group>"; };
2D7C17D6167AD6A500E1BBA1 /* user.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = user.c; path = ../../Game/src/audiolib/user.c; sourceTree = "<group>"; };
2D7C17DF167ADE1F00E1BBA1 /* pitch.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pitch.c; path = ../../Game/src/audiolib/pitch.c; sourceTree = "<group>"; };
+ 2D7C17E2167AF7DE00E1BBA1 /* sdl_driver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sdl_driver.h; path = ../../Engine/src/sdl_driver.h; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@@ -231,6 +232,7 @@
2D7B61F01678884400E35E54 /* Engine */ = {
isa = PBXGroup;
children = (
+ 2D7C17E2167AF7DE00E1BBA1 /* sdl_driver.h */,
2D7B61F11678885A00E35E54 /* a.c */,
2D7B61F21678885A00E35E54 /* a.h */,
2D7B61F31678885A00E35E54 /* build.h */,