mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 09:21:36 +00:00
Atrributify various function declarations. Right now the attributes used are noreturn, nonnull and format, the latter allowing us to catch silly printf errors. Again, these range from relatively benign to disastrous.
git-svn-id: https://svn.eduke32.com/eduke32@1740 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
00fbd8267e
commit
92223c2c85
17 changed files with 149 additions and 170 deletions
|
@ -97,8 +97,8 @@ int32_t initsystem(void);
|
||||||
void uninitsystem(void);
|
void uninitsystem(void);
|
||||||
|
|
||||||
extern int32_t flushlogwindow;
|
extern int32_t flushlogwindow;
|
||||||
void initprintf(const char *, ...);
|
void initprintf(const char *, ...) ATTRIBUTE((format(printf,1,2)));
|
||||||
void debugprintf(const char *,...);
|
void debugprintf(const char *,...) ATTRIBUTE((format(printf,1,2)));
|
||||||
|
|
||||||
int32_t handleevents(void);
|
int32_t handleevents(void);
|
||||||
extern void (*after_handleevents_hook)(void);
|
extern void (*after_handleevents_hook)(void);
|
||||||
|
@ -162,8 +162,8 @@ extern double vid_gamma, vid_contrast, vid_brightness;
|
||||||
|
|
||||||
int32_t switchrendermethod(int32_t,int32_t); // 0 = software, 1 = opengl | bool = reinit
|
int32_t switchrendermethod(int32_t,int32_t); // 0 = software, 1 = opengl | bool = reinit
|
||||||
|
|
||||||
int32_t wm_msgbox(char *name, char *fmt, ...);
|
int32_t wm_msgbox(char *name, char *fmt, ...) ATTRIBUTE((format(printf,2,3)));
|
||||||
int32_t wm_ynbox(char *name, char *fmt, ...);
|
int32_t wm_ynbox(char *name, char *fmt, ...) ATTRIBUTE((format(printf,2,3)));
|
||||||
void wm_setapptitle(char *name);
|
void wm_setapptitle(char *name);
|
||||||
|
|
||||||
// baselayer.c
|
// baselayer.c
|
||||||
|
|
|
@ -459,7 +459,7 @@ void setview(int32_t x1, int32_t y1, int32_t x2, int32_t y2);
|
||||||
void setaspect(int32_t daxrange, int32_t daaspect);
|
void setaspect(int32_t daxrange, int32_t daaspect);
|
||||||
void flushperms(void);
|
void flushperms(void);
|
||||||
|
|
||||||
void plotlines2d(int32_t *xx, int32_t *yy, int32_t numpoints, char col);
|
void plotlines2d(int32_t *xx, int32_t *yy, int32_t numpoints, char col) ATTRIBUTE((nonnull(1,2)));
|
||||||
|
|
||||||
void plotpixel(int32_t x, int32_t y, char col);
|
void plotpixel(int32_t x, int32_t y, char col);
|
||||||
char getpixel(int32_t x, int32_t y);
|
char getpixel(int32_t x, int32_t y);
|
||||||
|
@ -475,26 +475,26 @@ void clearallviews(int32_t dacol);
|
||||||
void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang);
|
void drawmapview(int32_t dax, int32_t day, int32_t zoome, int16_t ang);
|
||||||
void rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, char dapalnum, int32_t dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
|
void rotatesprite(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum, int8_t dashade, char dapalnum, int32_t dastat, int32_t cx1, int32_t cy1, int32_t cx2, int32_t cy2);
|
||||||
void drawline256(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col);
|
void drawline256(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col);
|
||||||
int32_t printext16(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize);
|
int32_t printext16(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize) ATTRIBUTE((nonnull(5)));
|
||||||
void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize);
|
void printext256(int32_t xpos, int32_t ypos, int16_t col, int16_t backcol, const char *name, char fontsize) ATTRIBUTE((nonnull(5)));
|
||||||
|
|
||||||
extern int32_t clipmoveboxtracenum;
|
extern int32_t clipmoveboxtracenum;
|
||||||
int32_t clipmove(vec3_t *vect, int16_t *sectnum, int32_t xvect, int32_t yvect, int32_t walldist, int32_t ceildist, int32_t flordist, uint32_t cliptype);
|
int32_t clipmove(vec3_t *vect, int16_t *sectnum, int32_t xvect, int32_t yvect, int32_t walldist, int32_t ceildist, int32_t flordist, uint32_t cliptype) ATTRIBUTE((nonnull(1,2)));
|
||||||
int32_t clipinsidebox(int32_t x, int32_t y, int16_t wallnum, int32_t walldist);
|
int32_t clipinsidebox(int32_t x, int32_t y, int16_t wallnum, int32_t walldist);
|
||||||
int32_t clipinsideboxline(int32_t x, int32_t y, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t walldist);
|
int32_t clipinsideboxline(int32_t x, int32_t y, int32_t x1, int32_t y1, int32_t x2, int32_t y2, int32_t walldist);
|
||||||
int32_t pushmove(vec3_t *vect, int16_t *sectnum, int32_t walldist, int32_t ceildist, int32_t flordist, uint32_t cliptype);
|
int32_t pushmove(vec3_t *vect, int16_t *sectnum, int32_t walldist, int32_t ceildist, int32_t flordist, uint32_t cliptype) ATTRIBUTE((nonnull(1,2)));
|
||||||
void getzrange(const vec3_t *vect, int16_t sectnum, int32_t *ceilz, int32_t *ceilhit, int32_t *florz, int32_t *florhit, int32_t walldist, uint32_t cliptype);
|
void getzrange(const vec3_t *vect, int16_t sectnum, int32_t *ceilz, int32_t *ceilhit, int32_t *florz, int32_t *florhit, int32_t walldist, uint32_t cliptype) ATTRIBUTE((nonnull(1,3,4,5,6)));
|
||||||
int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32_t vz, hitdata_t *hitinfo, uint32_t cliptype);
|
int32_t hitscan(const vec3_t *sv, int16_t sectnum, int32_t vx, int32_t vy, int32_t vz, hitdata_t *hitinfo, uint32_t cliptype) ATTRIBUTE((nonnull(1,6)));
|
||||||
int32_t neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, int16_t *neartagsector, int16_t *neartagwall, int16_t *neartagsprite, int32_t *neartaghitdist, int32_t neartagrange, char tagsearch);
|
int32_t neartag(int32_t xs, int32_t ys, int32_t zs, int16_t sectnum, int16_t ange, int16_t *neartagsector, int16_t *neartagwall, int16_t *neartagsprite, int32_t *neartaghitdist, int32_t neartagrange, char tagsearch) ATTRIBUTE((nonnull(6,7,8)));
|
||||||
int32_t cansee(int32_t x1, int32_t y1, int32_t z1, int16_t sect1, int32_t x2, int32_t y2, int32_t z2, int16_t sect2);
|
int32_t cansee(int32_t x1, int32_t y1, int32_t z1, int16_t sect1, int32_t x2, int32_t y2, int32_t z2, int16_t sect2);
|
||||||
void updatesector(int32_t x, int32_t y, int16_t *sectnum);
|
void updatesector(int32_t x, int32_t y, int16_t *sectnum) ATTRIBUTE((nonnull(3)));
|
||||||
void updatesectorexclude(int32_t x, int32_t y, int16_t *sectnum, const uint8_t *excludesectbitmap);
|
void updatesectorexclude(int32_t x, int32_t y, int16_t *sectnum, const uint8_t *excludesectbitmap) ATTRIBUTE((nonnull(3)));
|
||||||
void updatesectorz(int32_t x, int32_t y, int32_t z, int16_t *sectnum);
|
void updatesectorz(int32_t x, int32_t y, int32_t z, int16_t *sectnum) ATTRIBUTE((nonnull(4)));
|
||||||
int32_t inside(int32_t x, int32_t y, int16_t sectnum);
|
int32_t inside(int32_t x, int32_t y, int16_t sectnum);
|
||||||
void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day);
|
void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day);
|
||||||
void setfirstwall(int16_t sectnum, int16_t newfirstwall);
|
void setfirstwall(int16_t sectnum, int16_t newfirstwall);
|
||||||
|
|
||||||
void getmousevalues(int32_t *mousx, int32_t *mousy, int32_t *bstatus);
|
void getmousevalues(int32_t *mousx, int32_t *mousy, int32_t *bstatus) ATTRIBUTE((nonnull(1,2,3)));
|
||||||
int32_t krand(void);
|
int32_t krand(void);
|
||||||
int32_t ksqrt(int32_t num);
|
int32_t ksqrt(int32_t num);
|
||||||
// int32_t getangle(int32_t xvect, int32_t yvect);
|
// int32_t getangle(int32_t xvect, int32_t yvect);
|
||||||
|
@ -517,12 +517,12 @@ static inline int32_t getangle(int32_t xvect, int32_t yvect)
|
||||||
return ((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047;
|
return ((radarang[640-scale(160,xvect,yvect)]>>6)+512+((yvect<0)<<10))&2047;
|
||||||
}
|
}
|
||||||
|
|
||||||
void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y, int16_t daang, int32_t *x2, int32_t *y2);
|
void rotatepoint(int32_t xpivot, int32_t ypivot, int32_t x, int32_t y, int16_t daang, int32_t *x2, int32_t *y2) ATTRIBUTE((nonnull(6,7)));
|
||||||
int32_t lastwall(int16_t point);
|
int32_t lastwall(int16_t point);
|
||||||
int32_t nextsectorneighborz(int16_t sectnum, int32_t thez, int16_t topbottom, int16_t direction);
|
int32_t nextsectorneighborz(int16_t sectnum, int32_t thez, int16_t topbottom, int16_t direction);
|
||||||
int32_t getceilzofslope(int16_t sectnum, int32_t dax, int32_t day);
|
int32_t getceilzofslope(int16_t sectnum, int32_t dax, int32_t day);
|
||||||
int32_t getflorzofslope(int16_t sectnum, int32_t dax, int32_t day);
|
int32_t getflorzofslope(int16_t sectnum, int32_t dax, int32_t day);
|
||||||
void getzsofslope(int16_t sectnum, int32_t dax, int32_t day, int32_t *ceilz, int32_t *florz);
|
void getzsofslope(int16_t sectnum, int32_t dax, int32_t day, int32_t *ceilz, int32_t *florz) ATTRIBUTE((nonnull(4,5)));
|
||||||
void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
void alignceilslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
||||||
void alignflorslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
void alignflorslope(int16_t dasect, int32_t x, int32_t y, int32_t z);
|
||||||
int32_t sectorofwall(int16_t theline);
|
int32_t sectorofwall(int16_t theline);
|
||||||
|
@ -563,9 +563,9 @@ static inline int32_t deletesprite(int16_t spritenum)
|
||||||
|
|
||||||
int32_t changespritesect(int16_t spritenum, int16_t newsectnum);
|
int32_t changespritesect(int16_t spritenum, int16_t newsectnum);
|
||||||
int32_t changespritestat(int16_t spritenum, int16_t newstatnum);
|
int32_t changespritestat(int16_t spritenum, int16_t newstatnum);
|
||||||
int32_t setsprite(int16_t spritenum, const vec3_t *new);
|
int32_t setsprite(int16_t spritenum, const vec3_t *new) ATTRIBUTE((nonnull(2)));
|
||||||
|
|
||||||
int32_t screencapture(char *filename, char inverseit);
|
int32_t screencapture(char *filename, char inverseit) ATTRIBUTE((nonnull(1)));
|
||||||
|
|
||||||
int32_t getclosestcol(int32_t r, int32_t g, int32_t b);
|
int32_t getclosestcol(int32_t r, int32_t g, int32_t b);
|
||||||
|
|
||||||
|
@ -586,7 +586,7 @@ void qsetmode640480(void);
|
||||||
void qsetmodeany(int32_t,int32_t);
|
void qsetmodeany(int32_t,int32_t);
|
||||||
void clear2dscreen(void);
|
void clear2dscreen(void);
|
||||||
void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride);
|
void draw2dgrid(int32_t posxe, int32_t posye, int32_t posze, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride);
|
||||||
void draw2dscreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride);
|
void draw2dscreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int32_t zoome, int16_t gride) ATTRIBUTE((nonnull(1)));
|
||||||
int32_t drawline16(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col);
|
int32_t drawline16(int32_t x1, int32_t y1, int32_t x2, int32_t y2, char col);
|
||||||
void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col);
|
void drawcircle16(int32_t x1, int32_t y1, int32_t r, int32_t eccen, char col);
|
||||||
|
|
||||||
|
|
|
@ -76,9 +76,9 @@ extern int32_t m32_swcnt;
|
||||||
extern int16_t *m32_wallsprite;
|
extern int16_t *m32_wallsprite;
|
||||||
extern int8_t sideview_reversehrot;
|
extern int8_t sideview_reversehrot;
|
||||||
extern inline int32_t scalescreeny(int32_t sy);
|
extern inline int32_t scalescreeny(int32_t sy);
|
||||||
extern void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome);
|
extern void screencoords(int32_t *xres, int32_t *yres, int32_t x, int32_t y, int32_t zoome) ATTRIBUTE((nonnull));
|
||||||
//extern void invscreencoords(int32_t *dx, int32_t *dy, int32_t sx, int32_t sy, int32_t zoome);
|
//extern void invscreencoords(int32_t *dx, int32_t *dy, int32_t sx, int32_t sy, int32_t zoome);
|
||||||
extern int32_t getinvdisplacement(int32_t *dx, int32_t *dy, int32_t dz);
|
extern int32_t getinvdisplacement(int32_t *dx, int32_t *dy, int32_t dz) ATTRIBUTE((nonnull));
|
||||||
extern inline int32_t getscreenvdisp(int32_t bz, int32_t zoome);
|
extern inline int32_t getscreenvdisp(int32_t bz, int32_t zoome);
|
||||||
extern void setup_sideview_sincos(void);
|
extern void setup_sideview_sincos(void);
|
||||||
extern void m32_setkeyfilter(int32_t on);
|
extern void m32_setkeyfilter(int32_t on);
|
||||||
|
@ -123,14 +123,14 @@ int32_t _getnumber256(const char *namestart, int32_t num, int32_t maxnumber, cha
|
||||||
int32_t _getnumber16(const char *namestart, int32_t num, int32_t maxnumber, char sign, void *(func)(int32_t));
|
int32_t _getnumber16(const char *namestart, int32_t num, int32_t maxnumber, char sign, void *(func)(int32_t));
|
||||||
#define getnumber16(namestart, num, maxnumber, sign) _getnumber16(namestart, num, maxnumber, sign, NULL)
|
#define getnumber16(namestart, num, maxnumber, sign) _getnumber16(namestart, num, maxnumber, sign, NULL)
|
||||||
void printmessage256(int32_t x, int32_t y, const char *name);
|
void printmessage256(int32_t x, int32_t y, const char *name);
|
||||||
void message(const char *fmt, ...);
|
void message(const char *fmt, ...) ATTRIBUTE((format(printf,1,2)));
|
||||||
|
|
||||||
// currently only for 3d mode
|
// currently only for 3d mode
|
||||||
const char* getstring_simple(const char *querystr, const char *defaultstr, int32_t maxlen);
|
const char* getstring_simple(const char *querystr, const char *defaultstr, int32_t maxlen);
|
||||||
|
|
||||||
// like snprintf, but pads the output buffer with 'fill' at the end
|
// like snprintf, but pads the output buffer with 'fill' at the end
|
||||||
int32_t snfillprintf(char *outbuf, size_t bufsiz, int32_t fill, const char *fmt, ...);
|
//int32_t snfillprintf(char *outbuf, size_t bufsiz, int32_t fill, const char *fmt, ...);
|
||||||
void _printmessage16(const char *fmt, ...);
|
void _printmessage16(const char *fmt, ...) ATTRIBUTE((format(printf,1,2)));
|
||||||
|
|
||||||
extern int32_t lastpm16time;
|
extern int32_t lastpm16time;
|
||||||
#define printmessage16(fmt, ...) lastpm16time = totalclock, _printmessage16(fmt, ## __VA_ARGS__)
|
#define printmessage16(fmt, ...) lastpm16time = totalclock, _printmessage16(fmt, ## __VA_ARGS__)
|
||||||
|
|
|
@ -234,7 +234,7 @@ extern int32_t halfxdim16, midydim16;
|
||||||
|
|
||||||
// gamevar bytecode format:
|
// gamevar bytecode format:
|
||||||
|
|
||||||
// FEDC|BA09|8765|4321|FEDC|BA09|8765|4321
|
// FEDC|BA98|7654|3210|FEDC|BA98|7654|3120
|
||||||
// | .. .... .... gamevar ID
|
// | .. .... .... gamevar ID
|
||||||
// | . constant bit (checked first) / get-payload-var bit for array or struct
|
// | . constant bit (checked first) / get-payload-var bit for array or struct
|
||||||
// | . negate bit
|
// | . negate bit
|
||||||
|
|
|
@ -246,7 +246,7 @@ int32_t osdcmd_glinfo(const osdfuncparm_t *parm)
|
||||||
);
|
);
|
||||||
|
|
||||||
s = Bstrdup(glinfo.extensions);
|
s = Bstrdup(glinfo.extensions);
|
||||||
if (!s) initprintf(glinfo.extensions);
|
if (!s) initprintf("%s", glinfo.extensions);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
i = 0; t = u = s;
|
i = 0; t = u = s;
|
||||||
|
|
|
@ -254,6 +254,7 @@ static inline void bclamp(int32_t *x, int32_t mi, int32_t ma)
|
||||||
if (*x<mi) *x=mi;
|
if (*x<mi) *x=mi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef USE_OPENGL
|
||||||
static int32_t osdcmd_restartvid(const osdfuncparm_t *parm)
|
static int32_t osdcmd_restartvid(const osdfuncparm_t *parm)
|
||||||
{
|
{
|
||||||
extern int32_t qsetmode;
|
extern int32_t qsetmode;
|
||||||
|
@ -329,6 +330,7 @@ static int32_t osdcmd_vidmode(const osdfuncparm_t *parm)
|
||||||
|
|
||||||
return OSDCMD_OK;
|
return OSDCMD_OK;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int32_t startwin_run(void);
|
extern int32_t startwin_run(void);
|
||||||
|
|
||||||
|
@ -400,7 +402,7 @@ int32_t app_main(int32_t argc, const char **argv)
|
||||||
#endif
|
#endif
|
||||||
;
|
;
|
||||||
#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)
|
#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)
|
||||||
wm_msgbox("Mapster32",s);
|
wm_msgbox("Mapster32","%s",s);
|
||||||
#else
|
#else
|
||||||
puts(s);
|
puts(s);
|
||||||
#endif
|
#endif
|
||||||
|
@ -2093,8 +2095,8 @@ void overheadeditor(void)
|
||||||
drawline16(0,searchy, xdim2d-1,searchy, editorcolors[15]);
|
drawline16(0,searchy, xdim2d-1,searchy, editorcolors[15]);
|
||||||
drawlinepat = 0xffffffff;
|
drawlinepat = 0xffffffff;
|
||||||
|
|
||||||
Bsprintf(tempbuf,"(%d,%d)",mousxplc,mousyplc);
|
_printmessage16("(%d,%d)",mousxplc,mousyplc);
|
||||||
/*
|
#if 0
|
||||||
i = (Bstrlen(tempbuf)<<3)+6;
|
i = (Bstrlen(tempbuf)<<3)+6;
|
||||||
if ((searchx+i) < (xdim2d-1))
|
if ((searchx+i) < (xdim2d-1))
|
||||||
i = 0;
|
i = 0;
|
||||||
|
@ -2103,8 +2105,7 @@ void overheadeditor(void)
|
||||||
j = 0;
|
j = 0;
|
||||||
else j = (searchy+16)-(ydim2d-STATUS2DSIZ2-1);
|
else j = (searchy+16)-(ydim2d-STATUS2DSIZ2-1);
|
||||||
printext16(searchx+6-i,searchy+6-j,editorcolors[11],-1,tempbuf,0);
|
printext16(searchx+6-i,searchy+6-j,editorcolors[11],-1,tempbuf,0);
|
||||||
*/
|
#endif
|
||||||
_printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
drawline16(searchx,0, searchx,8, editorcolors[15]);
|
drawline16(searchx,0, searchx,8, editorcolors[15]);
|
||||||
drawline16(0,searchy, 8,searchy, editorcolors[15]);
|
drawline16(0,searchy, 8,searchy, editorcolors[15]);
|
||||||
|
@ -4950,10 +4951,7 @@ CANCEL:
|
||||||
bflushchars();
|
bflushchars();
|
||||||
while (bad == 0)
|
while (bad == 0)
|
||||||
{
|
{
|
||||||
Bsprintf(buffer,"Save as: ^011%s", boardfilename);
|
_printmessage16("Save as: ^011%s%s", boardfilename, (totalclock&32)?"_":"");
|
||||||
if (totalclock & 32)
|
|
||||||
Bstrcat(buffer,"_");
|
|
||||||
_printmessage16(buffer);
|
|
||||||
showframe(1);
|
showframe(1);
|
||||||
|
|
||||||
if (handleevents())
|
if (handleevents())
|
||||||
|
@ -5010,8 +5008,7 @@ CANCEL:
|
||||||
f = Bstrrchr(selectedboardfilename, '/');
|
f = Bstrrchr(selectedboardfilename, '/');
|
||||||
if (!f) f = selectedboardfilename; else f++;
|
if (!f) f = selectedboardfilename; else f++;
|
||||||
}
|
}
|
||||||
Bsprintf(buffer,"Saving to %s...",f);
|
_printmessage16("Saving to %s...",f);
|
||||||
_printmessage16(buffer);
|
|
||||||
showframe(1);
|
showframe(1);
|
||||||
|
|
||||||
fixspritesectors(); //Do this before saving!
|
fixspritesectors(); //Do this before saving!
|
||||||
|
@ -5606,7 +5603,7 @@ int32_t checksectorpointer(int16_t i, int16_t sectnum)
|
||||||
char buf[128];
|
char buf[128];
|
||||||
Bsprintf(buf, "WARN: checksectorpointer called with i=%d but (new)numwalls=%d", i, max(numwalls,newnumwalls));
|
Bsprintf(buf, "WARN: checksectorpointer called with i=%d but (new)numwalls=%d", i, max(numwalls,newnumwalls));
|
||||||
OSD_Printf("%s\n", buf);
|
OSD_Printf("%s\n", buf);
|
||||||
printmessage16(buf);
|
printmessage16("%s", buf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5770,7 +5767,7 @@ int32_t _getnumber16(const char *namestart, int32_t num, int32_t maxnumber, char
|
||||||
Bsprintf(buffer,"%s^011%d",namestart,danum);
|
Bsprintf(buffer,"%s^011%d",namestart,danum);
|
||||||
n = Bstrlen(buffer);
|
n = Bstrlen(buffer);
|
||||||
if (totalclock & 32) Bstrcat(buffer,"_ ");
|
if (totalclock & 32) Bstrcat(buffer,"_ ");
|
||||||
_printmessage16(buffer);
|
_printmessage16("%s", buffer);
|
||||||
|
|
||||||
if (func != NULL)
|
if (func != NULL)
|
||||||
{
|
{
|
||||||
|
@ -5803,7 +5800,7 @@ int32_t _getnumber16(const char *namestart, int32_t num, int32_t maxnumber, char
|
||||||
{
|
{
|
||||||
oldnum = danum;
|
oldnum = danum;
|
||||||
asksave = 1;
|
asksave = 1;
|
||||||
printmessage16(buffer);
|
printmessage16("%s", buffer);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (ch == '-' && sign) // negate
|
else if (ch == '-' && sign) // negate
|
||||||
|
@ -6907,6 +6904,7 @@ void keytimerstuff(void)
|
||||||
/* if(mlook) pos.z -= (horiz-101)*(vel/40); */
|
/* if(mlook) pos.z -= (horiz-101)*(vel/40); */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
int32_t snfillprintf(char *outbuf, size_t bufsiz, int32_t fill, const char *fmt, ...)
|
int32_t snfillprintf(char *outbuf, size_t bufsiz, int32_t fill, const char *fmt, ...)
|
||||||
{
|
{
|
||||||
char tmpstr[256];
|
char tmpstr[256];
|
||||||
|
@ -6922,6 +6920,7 @@ int32_t snfillprintf(char *outbuf, size_t bufsiz, int32_t fill, const char *fmt,
|
||||||
|
|
||||||
return ofs;
|
return ofs;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void _printmessage16(const char *fmt, ...)
|
void _printmessage16(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
|
|
|
@ -225,10 +225,7 @@ void message(const char *fmt, ...)
|
||||||
lastmessagetime = totalclock;
|
lastmessagetime = totalclock;
|
||||||
|
|
||||||
if (!mouseaction)
|
if (!mouseaction)
|
||||||
{
|
OSD_Printf("%s\n", tmpstr);
|
||||||
Bstrcat(tmpstr,"\n");
|
|
||||||
OSD_Printf(tmpstr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct _mapundo
|
typedef struct _mapundo
|
||||||
|
@ -2611,7 +2608,7 @@ static int32_t AskIfSure(char *text)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_printmessage16(text?text:"Are you sure you want to proceed?");
|
_printmessage16("%s", text?text:"Are you sure you want to proceed?");
|
||||||
}
|
}
|
||||||
|
|
||||||
showframe(1);
|
showframe(1);
|
||||||
|
@ -6761,7 +6758,7 @@ static void Keys2d(void)
|
||||||
|
|
||||||
|
|
||||||
if (totalclock < lastpm16time + 120*2)
|
if (totalclock < lastpm16time + 120*2)
|
||||||
_printmessage16(lastpm16buf);
|
_printmessage16("%s", lastpm16buf);
|
||||||
else if (counter >= 2 && totalclock >= 120*6)
|
else if (counter >= 2 && totalclock >= 120*6)
|
||||||
{
|
{
|
||||||
if (pointhighlight >= 16384)
|
if (pointhighlight >= 16384)
|
||||||
|
@ -7005,8 +7002,7 @@ static void Keys2d(void)
|
||||||
sprite[cursprite].xrepeat = getnumber16(tempbuf, sprite[cursprite].xrepeat, 255, 0);
|
sprite[cursprite].xrepeat = getnumber16(tempbuf, sprite[cursprite].xrepeat, 255, 0);
|
||||||
Bsprintf(tempbuf, "Sprite %d yrepeat: ", cursprite);
|
Bsprintf(tempbuf, "Sprite %d yrepeat: ", cursprite);
|
||||||
sprite[cursprite].yrepeat = getnumber16(tempbuf, sprite[cursprite].yrepeat, 255, 0);
|
sprite[cursprite].yrepeat = getnumber16(tempbuf, sprite[cursprite].yrepeat, 255, 0);
|
||||||
Bsprintf(tempbuf, "Sprite %d updated", i);
|
printmessage16("Sprite %d updated", i);
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7074,13 +7070,11 @@ static void Keys2d(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (autogrid)
|
if (autogrid)
|
||||||
Bsprintf(tempbuf,"Grid size: 9 (autosize)");
|
printmessage16("Grid size: 9 (autosize)");
|
||||||
else if (!grid)
|
else if (!grid)
|
||||||
Bsprintf(tempbuf,"Grid off");
|
printmessage16("Grid off");
|
||||||
else
|
else
|
||||||
Bsprintf(tempbuf,"Grid size: %d (%d units)", grid, 2048>>grid);
|
printmessage16("Grid size: %d (%d units)", grid, 2048>>grid);
|
||||||
|
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
if (autogrid)
|
if (autogrid)
|
||||||
{
|
{
|
||||||
|
@ -7103,8 +7097,7 @@ static void Keys2d(void)
|
||||||
sprite[i].z = getnumber16(tempbuf, sprite[i].z, 8388608, 1);
|
sprite[i].z = getnumber16(tempbuf, sprite[i].z, 8388608, 1);
|
||||||
Bsprintf(tempbuf, "Sprite %d angle: ", i);
|
Bsprintf(tempbuf, "Sprite %d angle: ", i);
|
||||||
sprite[i].ang = getnumber16(tempbuf, sprite[i].ang, 2047, 0);
|
sprite[i].ang = getnumber16(tempbuf, sprite[i].ang, 2047, 0);
|
||||||
Bsprintf(tempbuf, "Sprite %d updated", i);
|
printmessage16("Sprite %d updated", i);
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (pointhighlight >= 0 /*<= 16383*/)
|
else if (pointhighlight >= 0 /*<= 16383*/)
|
||||||
|
@ -7118,8 +7111,7 @@ static void Keys2d(void)
|
||||||
Bsprintf(tempbuf, "Wall %d y: ", i);
|
Bsprintf(tempbuf, "Wall %d y: ", i);
|
||||||
k = getnumber16(tempbuf, k, editorgridextent, 1);
|
k = getnumber16(tempbuf, k, editorgridextent, 1);
|
||||||
dragpoint(i, j, k);
|
dragpoint(i, j, k);
|
||||||
Bsprintf(tempbuf, "Wall %d updated", i);
|
printmessage16("Wall %d updated", i);
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7127,8 +7119,7 @@ static void Keys2d(void)
|
||||||
if (keystatus[KEYSC_QUOTE] && PRESSED_KEYSC(3)) // ' 3
|
if (keystatus[KEYSC_QUOTE] && PRESSED_KEYSC(3)) // ' 3
|
||||||
{
|
{
|
||||||
onnames = (onnames+1)%8;
|
onnames = (onnames+1)%8;
|
||||||
Bsprintf(tempbuf, "Mode %d %s", onnames, SpriteMode[onnames]);
|
printmessage16("Mode %d %s", onnames, SpriteMode[onnames]);
|
||||||
printmessage16(tempbuf);
|
|
||||||
// clearmidstatbar16();
|
// clearmidstatbar16();
|
||||||
// for(i=0;i<MAXMODE32D;i++) {printext16(0*8,ydim16+32+(i*8),15,-1,SpriteMode[i],0);
|
// for(i=0;i<MAXMODE32D;i++) {printext16(0*8,ydim16+32+(i*8),15,-1,SpriteMode[i],0);
|
||||||
}
|
}
|
||||||
|
@ -7142,14 +7133,12 @@ static void Keys2d(void)
|
||||||
if (pointhighlight >= 16384)
|
if (pointhighlight >= 16384)
|
||||||
{
|
{
|
||||||
swapshort(&sprite[cursprite].lotag, &sprite[cursprite].hitag);
|
swapshort(&sprite[cursprite].lotag, &sprite[cursprite].hitag);
|
||||||
Bsprintf(tempbuf, "Sprite %d tags swapped", cursprite);
|
printmessage16("Sprite %d tags swapped", cursprite);
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
else if (linehighlight >= 0)
|
else if (linehighlight >= 0)
|
||||||
{
|
{
|
||||||
swapshort(&wall[linehighlight].lotag, &wall[linehighlight].hitag);
|
swapshort(&wall[linehighlight].lotag, &wall[linehighlight].hitag);
|
||||||
Bsprintf(tempbuf, "Wall %d tags swapped", linehighlight);
|
printmessage16("Wall %d tags swapped", linehighlight);
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7157,8 +7146,7 @@ static void Keys2d(void)
|
||||||
{
|
{
|
||||||
pos.x = getnumber16("X-coordinate: ", pos.x, editorgridextent, 1);
|
pos.x = getnumber16("X-coordinate: ", pos.x, editorgridextent, 1);
|
||||||
pos.y = getnumber16("Y-coordinate: ", pos.y, editorgridextent, 1);
|
pos.y = getnumber16("Y-coordinate: ", pos.y, editorgridextent, 1);
|
||||||
Bsprintf(tempbuf, "Current pos now (%d, %d)", pos.x, pos.y);
|
printmessage16("Current pos now (%d, %d)", pos.x, pos.y);
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
}// end key2d
|
}// end key2d
|
||||||
|
|
||||||
|
@ -7295,7 +7283,7 @@ static void G_ShowParameterHelp(void)
|
||||||
#endif
|
#endif
|
||||||
"\n-?, -help, --help\tDisplay this help message and exit"
|
"\n-?, -help, --help\tDisplay this help message and exit"
|
||||||
;
|
;
|
||||||
wm_msgbox("Mapster32"VERSION BUILDDATE,s);
|
wm_msgbox("Mapster32"VERSION BUILDDATE,"%s",s);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AddGamePath(const char *buffer)
|
static void AddGamePath(const char *buffer)
|
||||||
|
@ -9803,7 +9791,7 @@ static void Keys2d3d(void)
|
||||||
if (getmessageleng > 0)
|
if (getmessageleng > 0)
|
||||||
{
|
{
|
||||||
if (qsetmode != 200)
|
if (qsetmode != 200)
|
||||||
printmessage16(getmessage);
|
printmessage16("%s", getmessage);
|
||||||
if (totalclock > getmessagetimeoff)
|
if (totalclock > getmessagetimeoff)
|
||||||
getmessageleng = 0;
|
getmessageleng = 0;
|
||||||
}
|
}
|
||||||
|
@ -10056,7 +10044,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Ceiling Flags: ",sectnum);
|
Bsprintf(edittext,"Sector %d Ceiling Flags: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].ceilingstat = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].ceilingstat,65536L,0);
|
sector[sectnum].ceilingstat = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].ceilingstat,65536L,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10065,10 +10053,10 @@ static void EditSectorData(int16_t sectnum)
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
Bsprintf(edittext,"Sector %d Ceiling X Pan: ",sectnum);
|
Bsprintf(edittext,"Sector %d Ceiling X Pan: ",sectnum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].ceilingxpanning = (char)getnumber16(edittext,(int32_t)sector[sectnum].ceilingxpanning,256L,0);
|
sector[sectnum].ceilingxpanning = (char)getnumber16(edittext,(int32_t)sector[sectnum].ceilingxpanning,256L,0);
|
||||||
Bsprintf(edittext,"Sector %d Ceiling Y Pan: ",sectnum);
|
Bsprintf(edittext,"Sector %d Ceiling Y Pan: ",sectnum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].ceilingypanning = (char)getnumber16(edittext,(int32_t)sector[sectnum].ceilingypanning,256L,0);
|
sector[sectnum].ceilingypanning = (char)getnumber16(edittext,(int32_t)sector[sectnum].ceilingypanning,256L,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10077,7 +10065,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Ceiling Shade: ",sectnum);
|
Bsprintf(edittext,"Sector %d Ceiling Shade: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].ceilingshade = (char)getnumber16(edittext,(int32_t)sector[sectnum].ceilingshade,128L,1);
|
sector[sectnum].ceilingshade = (char)getnumber16(edittext,(int32_t)sector[sectnum].ceilingshade,128L,1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10087,7 +10075,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Ceiling Z-coordinate: ",sectnum);
|
Bsprintf(edittext,"Sector %d Ceiling Z-coordinate: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].ceilingz = getnumber16(edittext,sector[sectnum].ceilingz,8388608,1); //2147483647L,-2147483648L
|
sector[sectnum].ceilingz = getnumber16(edittext,sector[sectnum].ceilingz,8388608,1); //2147483647L,-2147483648L
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10097,7 +10085,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Ceiling Tile Number: ",sectnum);
|
Bsprintf(edittext,"Sector %d Ceiling Tile Number: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].ceilingpicnum = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].ceilingpicnum,MAXTILES,0);
|
sector[sectnum].ceilingpicnum = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].ceilingpicnum,MAXTILES,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10107,7 +10095,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Ceiling Heinum: ",sectnum);
|
Bsprintf(edittext,"Sector %d Ceiling Heinum: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].ceilingheinum = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].ceilingheinum,65536L,1);
|
sector[sectnum].ceilingheinum = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].ceilingheinum,65536L,1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10117,7 +10105,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Ceiling Palookup Number: ",sectnum);
|
Bsprintf(edittext,"Sector %d Ceiling Palookup Number: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].ceilingpal = (char)getnumber16(edittext,(int32_t)sector[sectnum].ceilingpal,MAXPALOOKUPS,0);
|
sector[sectnum].ceilingpal = (char)getnumber16(edittext,(int32_t)sector[sectnum].ceilingpal,MAXPALOOKUPS,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10132,7 +10120,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Floor Flags: ",sectnum);
|
Bsprintf(edittext,"Sector %d Floor Flags: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].floorstat = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].floorstat,65536L,0);
|
sector[sectnum].floorstat = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].floorstat,65536L,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10142,10 +10130,10 @@ static void EditSectorData(int16_t sectnum)
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
Bsprintf(edittext,"Sector %d Floor X Pan: ",sectnum);
|
Bsprintf(edittext,"Sector %d Floor X Pan: ",sectnum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].floorxpanning = (char)getnumber16(edittext,(int32_t)sector[sectnum].floorxpanning,256L,0);
|
sector[sectnum].floorxpanning = (char)getnumber16(edittext,(int32_t)sector[sectnum].floorxpanning,256L,0);
|
||||||
Bsprintf(edittext,"Sector %d Floor Y Pan: ",sectnum);
|
Bsprintf(edittext,"Sector %d Floor Y Pan: ",sectnum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].floorypanning = (char)getnumber16(edittext,(int32_t)sector[sectnum].floorypanning,256L,0);
|
sector[sectnum].floorypanning = (char)getnumber16(edittext,(int32_t)sector[sectnum].floorypanning,256L,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10155,7 +10143,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Floor Shade: ",sectnum);
|
Bsprintf(edittext,"Sector %d Floor Shade: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].floorshade = (char)getnumber16(edittext,(int32_t)sector[sectnum].floorshade,128L,1L);
|
sector[sectnum].floorshade = (char)getnumber16(edittext,(int32_t)sector[sectnum].floorshade,128L,1L);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10165,7 +10153,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Floor Z-coordinate: ",sectnum);
|
Bsprintf(edittext,"Sector %d Floor Z-coordinate: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].floorz = getnumber16(edittext,sector[sectnum].floorz,8388608L,1); //2147483647L,-2147483648L
|
sector[sectnum].floorz = getnumber16(edittext,sector[sectnum].floorz,8388608L,1); //2147483647L,-2147483648L
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10175,7 +10163,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Floor Tile Number: ",sectnum);
|
Bsprintf(edittext,"Sector %d Floor Tile Number: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].floorpicnum = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].floorpicnum,MAXTILES,0);
|
sector[sectnum].floorpicnum = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].floorpicnum,MAXTILES,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10184,7 +10172,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Flooring Heinum: ",sectnum);
|
Bsprintf(edittext,"Sector %d Flooring Heinum: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].floorheinum = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].floorheinum,65536L,1);
|
sector[sectnum].floorheinum = (int16_t)getnumber16(edittext,(int32_t)sector[sectnum].floorheinum,65536L,1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10193,7 +10181,7 @@ static void EditSectorData(int16_t sectnum)
|
||||||
Bsprintf(edittext,"Sector %d Floor Palookup Number: ",sectnum);
|
Bsprintf(edittext,"Sector %d Floor Palookup Number: ",sectnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sector[sectnum].floorpal = (char)getnumber16(edittext,(int32_t)sector[sectnum].floorpal,MAXPALOOKUPS,0);
|
sector[sectnum].floorpal = (char)getnumber16(edittext,(int32_t)sector[sectnum].floorpal,MAXPALOOKUPS,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10259,7 +10247,7 @@ static void EditWallData(int16_t wallnum)
|
||||||
Bsprintf(edittext,"Wall %d Flags: ",wallnum);
|
Bsprintf(edittext,"Wall %d Flags: ",wallnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].cstat = (int16_t)getnumber16(edittext,(int32_t)wall[wallnum].cstat,65536L,0);
|
wall[wallnum].cstat = (int16_t)getnumber16(edittext,(int32_t)wall[wallnum].cstat,65536L,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10268,7 +10256,7 @@ static void EditWallData(int16_t wallnum)
|
||||||
Bsprintf(edittext,"Wall %d Shade: ",wallnum);
|
Bsprintf(edittext,"Wall %d Shade: ",wallnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].shade = (char)getnumber16(edittext,(int32_t)wall[wallnum].shade,128,1);
|
wall[wallnum].shade = (char)getnumber16(edittext,(int32_t)wall[wallnum].shade,128,1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10277,7 +10265,7 @@ static void EditWallData(int16_t wallnum)
|
||||||
Bsprintf(edittext,"Wall %d Pal: ",wallnum);
|
Bsprintf(edittext,"Wall %d Pal: ",wallnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].pal = (char)getnumber16(edittext,(int32_t)wall[wallnum].pal,MAXPALOOKUPS,0);
|
wall[wallnum].pal = (char)getnumber16(edittext,(int32_t)wall[wallnum].pal,MAXPALOOKUPS,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10286,10 +10274,10 @@ static void EditWallData(int16_t wallnum)
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
Bsprintf(edittext,"Wall %d X Repeat: ",wallnum);
|
Bsprintf(edittext,"Wall %d X Repeat: ",wallnum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].xrepeat = (char)getnumber16(edittext,(int32_t)wall[wallnum].xrepeat,256L,0);
|
wall[wallnum].xrepeat = (char)getnumber16(edittext,(int32_t)wall[wallnum].xrepeat,256L,0);
|
||||||
Bsprintf(edittext,"Wall %d Y Repeat: ",wallnum);
|
Bsprintf(edittext,"Wall %d Y Repeat: ",wallnum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].yrepeat = (char)getnumber16(edittext,(int32_t)wall[wallnum].yrepeat,256L,0);
|
wall[wallnum].yrepeat = (char)getnumber16(edittext,(int32_t)wall[wallnum].yrepeat,256L,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10298,10 +10286,10 @@ static void EditWallData(int16_t wallnum)
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
Bsprintf(edittext,"Wall %d X Pan: ",wallnum);
|
Bsprintf(edittext,"Wall %d X Pan: ",wallnum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].xpanning = (char)getnumber16(edittext,(int32_t)wall[wallnum].xpanning,256L,0);
|
wall[wallnum].xpanning = (char)getnumber16(edittext,(int32_t)wall[wallnum].xpanning,256L,0);
|
||||||
Bsprintf(edittext,"Wall %d Y Pan: ",wallnum);
|
Bsprintf(edittext,"Wall %d Y Pan: ",wallnum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].ypanning = (char)getnumber16(edittext,(int32_t)wall[wallnum].ypanning,256L,0);
|
wall[wallnum].ypanning = (char)getnumber16(edittext,(int32_t)wall[wallnum].ypanning,256L,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10310,7 +10298,7 @@ static void EditWallData(int16_t wallnum)
|
||||||
Bsprintf(edittext,"Wall %d Tile number: ",wallnum);
|
Bsprintf(edittext,"Wall %d Tile number: ",wallnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].picnum = (int16_t)getnumber16(edittext,(int32_t)wall[wallnum].picnum,MAXTILES,0);
|
wall[wallnum].picnum = (int16_t)getnumber16(edittext,(int32_t)wall[wallnum].picnum,MAXTILES,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10320,7 +10308,7 @@ static void EditWallData(int16_t wallnum)
|
||||||
Bsprintf(edittext,"Wall %d OverTile number: ",wallnum);
|
Bsprintf(edittext,"Wall %d OverTile number: ",wallnum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
wall[wallnum].overpicnum = (int16_t)getnumber16(edittext,(int32_t)wall[wallnum].overpicnum,MAXTILES,0);
|
wall[wallnum].overpicnum = (int16_t)getnumber16(edittext,(int32_t)wall[wallnum].overpicnum,MAXTILES,0);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10454,7 +10442,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d X-coordinate: ",spritenum);
|
Bsprintf(edittext,"Sprite %d X-coordinate: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].x = getnumber16(edittext,sprite[spritenum].x,131072,1);
|
sprite[spritenum].x = getnumber16(edittext,sprite[spritenum].x,131072,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10465,7 +10453,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Y-coordinate: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Y-coordinate: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].y = getnumber16(edittext,sprite[spritenum].y,131072,1);
|
sprite[spritenum].y = getnumber16(edittext,sprite[spritenum].y,131072,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10476,7 +10464,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Z-coordinate: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Z-coordinate: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].z = getnumber16(edittext,sprite[spritenum].z,8388608,1); //2147483647L,-2147483648L
|
sprite[spritenum].z = getnumber16(edittext,sprite[spritenum].z,8388608,1); //2147483647L,-2147483648L
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10487,7 +10475,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Sectnum: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Sectnum: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
i = getnumber16(edittext,sprite[spritenum].sectnum,numsectors-1,0);
|
i = getnumber16(edittext,sprite[spritenum].sectnum,numsectors-1,0);
|
||||||
if (i != sprite[spritenum].sectnum)
|
if (i != sprite[spritenum].sectnum)
|
||||||
changespritesect(spritenum,i);
|
changespritesect(spritenum,i);
|
||||||
|
@ -10500,7 +10488,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Statnum: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Statnum: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
i = getnumber16(edittext,sprite[spritenum].statnum,MAXSTATUS-1,0);
|
i = getnumber16(edittext,sprite[spritenum].statnum,MAXSTATUS-1,0);
|
||||||
if (i != sprite[spritenum].statnum)
|
if (i != sprite[spritenum].statnum)
|
||||||
changespritestat(spritenum,i);
|
changespritestat(spritenum,i);
|
||||||
|
@ -10520,7 +10508,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Flags: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Flags: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].cstat = (int16_t)getnumber16(edittext,(int32_t)sprite[spritenum].cstat,65536L,0);
|
sprite[spritenum].cstat = (int16_t)getnumber16(edittext,(int32_t)sprite[spritenum].cstat,65536L,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10531,7 +10519,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Shade: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Shade: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].shade = (char)getnumber16(edittext,(int32_t)sprite[spritenum].shade,128,1);
|
sprite[spritenum].shade = (char)getnumber16(edittext,(int32_t)sprite[spritenum].shade,128,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10542,7 +10530,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Pal: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Pal: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].pal = (char)getnumber16(edittext,(int32_t)sprite[spritenum].pal,MAXPALOOKUPS,0);
|
sprite[spritenum].pal = (char)getnumber16(edittext,(int32_t)sprite[spritenum].pal,MAXPALOOKUPS,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10553,10 +10541,10 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
Bsprintf(edittext,"Sprite %d X Repeat: ",spritenum);
|
Bsprintf(edittext,"Sprite %d X Repeat: ",spritenum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].xrepeat = (char)getnumber16(edittext,(int32_t)sprite[spritenum].xrepeat,256L,0);
|
sprite[spritenum].xrepeat = (char)getnumber16(edittext,(int32_t)sprite[spritenum].xrepeat,256L,0);
|
||||||
Bsprintf(edittext,"Sprite %d Y Repeat: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Y Repeat: ",spritenum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].yrepeat = (char)getnumber16(edittext,(int32_t)sprite[spritenum].yrepeat,256L,0);
|
sprite[spritenum].yrepeat = (char)getnumber16(edittext,(int32_t)sprite[spritenum].yrepeat,256L,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10567,10 +10555,10 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
Bsprintf(edittext,"Sprite %d X Offset: ",spritenum);
|
Bsprintf(edittext,"Sprite %d X Offset: ",spritenum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].xoffset = (char)getnumber16(edittext,(int32_t)sprite[spritenum].xoffset,128L,1);
|
sprite[spritenum].xoffset = (char)getnumber16(edittext,(int32_t)sprite[spritenum].xoffset,128L,1);
|
||||||
Bsprintf(edittext,"Sprite %d Y Offset: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Y Offset: ",spritenum);
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].yoffset = (char)getnumber16(edittext,(int32_t)sprite[spritenum].yoffset,128L,1);
|
sprite[spritenum].yoffset = (char)getnumber16(edittext,(int32_t)sprite[spritenum].yoffset,128L,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10581,7 +10569,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Tile number: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Tile number: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].picnum = (int16_t)getnumber16(edittext,(int32_t)sprite[spritenum].picnum,MAXTILES,0);
|
sprite[spritenum].picnum = (int16_t)getnumber16(edittext,(int32_t)sprite[spritenum].picnum,MAXTILES,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10599,7 +10587,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Angle: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Angle: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].ang = (int16_t)getnumber16(edittext,(int32_t)sprite[spritenum].ang,2048L,0);
|
sprite[spritenum].ang = (int16_t)getnumber16(edittext,(int32_t)sprite[spritenum].ang,2048L,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10610,7 +10598,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d X-Velocity: ",spritenum);
|
Bsprintf(edittext,"Sprite %d X-Velocity: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].xvel = getnumber16(edittext,(int32_t)sprite[spritenum].xvel,65536,1);
|
sprite[spritenum].xvel = getnumber16(edittext,(int32_t)sprite[spritenum].xvel,65536,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10621,7 +10609,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Y-Velocity: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Y-Velocity: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].yvel = getnumber16(edittext,(int32_t)sprite[spritenum].yvel,65536,1);
|
sprite[spritenum].yvel = getnumber16(edittext,(int32_t)sprite[spritenum].yvel,65536,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10632,7 +10620,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Z-Velocity: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Z-Velocity: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].zvel = getnumber16(edittext,(int32_t)sprite[spritenum].zvel,65536,1);
|
sprite[spritenum].zvel = getnumber16(edittext,(int32_t)sprite[spritenum].zvel,65536,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10643,7 +10631,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Owner: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Owner: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].owner = getnumber16(edittext,(int32_t)sprite[spritenum].owner,MAXSPRITES,1);
|
sprite[spritenum].owner = getnumber16(edittext,(int32_t)sprite[spritenum].owner,MAXSPRITES,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10654,7 +10642,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Clipdist: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Clipdist: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].clipdist = (char)getnumber16(edittext,(int32_t)sprite[spritenum].clipdist,256,0);
|
sprite[spritenum].clipdist = (char)getnumber16(edittext,(int32_t)sprite[spritenum].clipdist,256,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10665,7 +10653,7 @@ static void EditSpriteData(int16_t spritenum)
|
||||||
Bsprintf(edittext,"Sprite %d Extra: ",spritenum);
|
Bsprintf(edittext,"Sprite %d Extra: ",spritenum);
|
||||||
if (editval)
|
if (editval)
|
||||||
{
|
{
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
sprite[spritenum].extra = getnumber16(edittext,(int32_t)sprite[spritenum].extra,BTAG_MAX,1);
|
sprite[spritenum].extra = getnumber16(edittext,(int32_t)sprite[spritenum].extra,BTAG_MAX,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10815,7 +10803,7 @@ static void GenericSpriteSearch()
|
||||||
{
|
{
|
||||||
Bsprintf(edittext, "%s: ", labels[row][col]);
|
Bsprintf(edittext, "%s: ", labels[row][col]);
|
||||||
enddrawing();
|
enddrawing();
|
||||||
printmessage16(edittext);
|
printmessage16("%s", edittext);
|
||||||
i = getnumber16(edittext, gs_spritewhat[col][row] ? gs_sprite[col][row] : 0,
|
i = getnumber16(edittext, gs_spritewhat[col][row] ? gs_sprite[col][row] : 0,
|
||||||
maxval[row][col], sign[row][col]);
|
maxval[row][col], sign[row][col]);
|
||||||
if (col == 2 && row == 0) i = (i+2048)&2047; // angle
|
if (col == 2 && row == 0) i = (i+2048)&2047; // angle
|
||||||
|
@ -11025,8 +11013,7 @@ static void FuncMenu(void)
|
||||||
if (tilesizx[sprite[i].picnum] <= 0)
|
if (tilesizx[sprite[i].picnum] <= 0)
|
||||||
sprite[i].picnum = 0,j++;
|
sprite[i].picnum = 0,j++;
|
||||||
}
|
}
|
||||||
Bsprintf(tempbuf,"Replaced %d invalid tiles",j);
|
printmessage16("Replaced %d invalid tiles",j);
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -11043,8 +11030,7 @@ static void FuncMenu(void)
|
||||||
for (j=0; j<MAXSPRITES-1; j++)
|
for (j=0; j<MAXSPRITES-1; j++)
|
||||||
if (sprite[j].picnum == i)
|
if (sprite[j].picnum == i)
|
||||||
deletesprite(j), k++;
|
deletesprite(j), k++;
|
||||||
Bsprintf(tempbuf,"%d sprite(s) deleted",k);
|
printmessage16("%d sprite(s) deleted",k);
|
||||||
printmessage16(tempbuf);
|
|
||||||
}
|
}
|
||||||
else printmessage16("Aborted");
|
else printmessage16("Aborted");
|
||||||
}
|
}
|
||||||
|
|
|
@ -624,18 +624,14 @@ int32_t CONFIG_ReadSetup(void)
|
||||||
ud.config.scripthandle = SCRIPT_Load(setupfilename);
|
ud.config.scripthandle = SCRIPT_Load(setupfilename);
|
||||||
else if (SafeFileExists(SETUPFILENAME) && ud.config.scripthandle < 0)
|
else if (SafeFileExists(SETUPFILENAME) && ud.config.scripthandle < 0)
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"The configuration file \"%s\" was not found. "
|
i=wm_ynbox("Import Configuration Settings", "The configuration file \"%s\" was not found. "
|
||||||
"Import configuration data from \"%s\"?",setupfilename,SETUPFILENAME);
|
"Import configuration data from \"%s\"?",setupfilename,SETUPFILENAME);
|
||||||
|
|
||||||
i=wm_ynbox("Import Configuration Settings",tempbuf);
|
|
||||||
if (i) ud.config.scripthandle = SCRIPT_Load(SETUPFILENAME);
|
if (i) ud.config.scripthandle = SCRIPT_Load(SETUPFILENAME);
|
||||||
}
|
}
|
||||||
else if (SafeFileExists("duke3d.cfg") && ud.config.scripthandle < 0)
|
else if (SafeFileExists("duke3d.cfg") && ud.config.scripthandle < 0)
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf,"The configuration file \"%s\" was not found. "
|
i=wm_ynbox("Import Configuration Settings", "The configuration file \"%s\" was not found. "
|
||||||
"Import configuration data from \"duke3d.cfg\"?",setupfilename);
|
"Import configuration data from \"duke3d.cfg\"?",setupfilename);
|
||||||
|
|
||||||
i=wm_ynbox("Import Configuration Settings",tempbuf);
|
|
||||||
if (i) ud.config.scripthandle = SCRIPT_Load("duke3d.cfg");
|
if (i) ud.config.scripthandle = SCRIPT_Load("duke3d.cfg");
|
||||||
}
|
}
|
||||||
pathsearchmode = 0;
|
pathsearchmode = 0;
|
||||||
|
@ -822,18 +818,17 @@ void CONFIG_WriteBinds(void) // save binds and aliases to <cfgname>_settings.cfg
|
||||||
OSD_WriteCvars(fp);
|
OSD_WriteCvars(fp);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
if (!Bstrcmp(setupfilename, SETUPFILENAME))
|
if (!Bstrcmp(setupfilename, SETUPFILENAME))
|
||||||
Bsprintf(tempbuf, "Wrote settings.cfg\n");
|
OSD_Printf("Wrote settings.cfg\n");
|
||||||
else Bsprintf(tempbuf,"Wrote %s_settings.cfg\n",ptr);
|
else OSD_Printf("Wrote %s_settings.cfg\n",ptr);
|
||||||
OSD_Printf(tempbuf);
|
|
||||||
Bfree(ptr);
|
Bfree(ptr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Bstrcmp(setupfilename, SETUPFILENAME))
|
if (!Bstrcmp(setupfilename, SETUPFILENAME))
|
||||||
Bsprintf(tempbuf, "Error writing settings.cfg: %s\n", strerror(errno));
|
OSD_Printf("Error writing settings.cfg: %s\n", strerror(errno));
|
||||||
else Bsprintf(tempbuf,"Error writing %s_settings.cfg: %s\n",ptr,strerror(errno));
|
else OSD_Printf("Error writing %s_settings.cfg: %s\n",ptr,strerror(errno));
|
||||||
|
|
||||||
OSD_Printf(tempbuf);
|
|
||||||
Bfree(ptr);
|
Bfree(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1992,7 +1992,7 @@ void G_GameExit(const char *t)
|
||||||
{
|
{
|
||||||
char titlebuf[256];
|
char titlebuf[256];
|
||||||
Bsprintf(titlebuf,HEAD2 " %s",s_buildDate);
|
Bsprintf(titlebuf,HEAD2 " %s",s_buildDate);
|
||||||
wm_msgbox(titlebuf, (char *)t);
|
wm_msgbox(titlebuf, "%s", (char *)t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -264,7 +264,7 @@ void G_DrawTilePal(int32_t x,int32_t y,int32_t tilenum,int32_t shade,int32_t ori
|
||||||
void G_DrawTilePalSmall(int32_t x,int32_t y,int32_t tilenum,int32_t shade,int32_t orientation,int32_t p);
|
void G_DrawTilePalSmall(int32_t x,int32_t y,int32_t tilenum,int32_t shade,int32_t orientation,int32_t p);
|
||||||
void G_DrawTileSmall(int32_t x,int32_t y,int32_t tilenum,int32_t shade,int32_t orientation);
|
void G_DrawTileSmall(int32_t x,int32_t y,int32_t tilenum,int32_t shade,int32_t orientation);
|
||||||
void G_FadePalette(int32_t r,int32_t g,int32_t b,int32_t e);
|
void G_FadePalette(int32_t r,int32_t g,int32_t b,int32_t e);
|
||||||
void G_GameExit(const char *t);
|
void G_GameExit(const char *t) ATTRIBUTE((noreturn));
|
||||||
void G_GameQuit(void);
|
void G_GameQuit(void);
|
||||||
void G_GetCrosshairColor(void);
|
void G_GetCrosshairColor(void);
|
||||||
void G_HandleLocalKeys(void);
|
void G_HandleLocalKeys(void);
|
||||||
|
|
|
@ -1156,7 +1156,7 @@ static int32_t C_SetScriptSize(int32_t size)
|
||||||
{
|
{
|
||||||
C_ReportError(-1);
|
C_ReportError(-1);
|
||||||
initprintf("%s:%d: out of memory: Aborted (%ud)\n",g_szScriptFileName,g_lineNumber,(unsigned)(g_scriptPtr-script));
|
initprintf("%s:%d: out of memory: Aborted (%ud)\n",g_szScriptFileName,g_lineNumber,(unsigned)(g_scriptPtr-script));
|
||||||
initprintf(tempbuf);
|
initprintf("%s", tempbuf);
|
||||||
g_numCompilerErrors++;
|
g_numCompilerErrors++;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -1174,7 +1174,7 @@ static int32_t C_SetScriptSize(int32_t size)
|
||||||
bitptr = newbitptr;
|
bitptr = newbitptr;
|
||||||
if (script != newscript)
|
if (script != newscript)
|
||||||
{
|
{
|
||||||
initprintf("Relocating compiled code from to 0x%x to 0x%x\n", script, newscript);
|
initprintf("Relocating compiled code from to 0x%lx to 0x%lx\n", (unsigned long)script, (unsigned long)newscript);
|
||||||
script = newscript;
|
script = newscript;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1619,7 +1619,7 @@ static void C_GetNextVarType(int32_t type)
|
||||||
if (!type && !g_labelsOnly && (isdigit(*textptr) || ((*textptr == '-') && (isdigit(*(textptr+1))))))
|
if (!type && !g_labelsOnly && (isdigit(*textptr) || ((*textptr == '-') && (isdigit(*(textptr+1))))))
|
||||||
{
|
{
|
||||||
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug)
|
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug)
|
||||||
initprintf("%s:%d: debug: accepted constant %d in place of gamevar.\n",g_szScriptFileName,g_lineNumber,atol(textptr));
|
initprintf("%s:%d: debug: accepted constant %ld in place of gamevar.\n",g_szScriptFileName,g_lineNumber,atol(textptr));
|
||||||
bitptr[(g_scriptPtr-script)>>3] &= ~(BITPTR_POINTER<<((g_scriptPtr-script)&7));
|
bitptr[(g_scriptPtr-script)>>3] &= ~(BITPTR_POINTER<<((g_scriptPtr-script)&7));
|
||||||
*g_scriptPtr++=MAXGAMEVARS;
|
*g_scriptPtr++=MAXGAMEVARS;
|
||||||
if (tolower(textptr[1])=='x')
|
if (tolower(textptr[1])=='x')
|
||||||
|
@ -1640,7 +1640,7 @@ static void C_GetNextVarType(int32_t type)
|
||||||
if (!type)
|
if (!type)
|
||||||
{
|
{
|
||||||
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug)
|
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug)
|
||||||
initprintf("%s:%d: debug: flagging gamevar as negative.\n",g_szScriptFileName,g_lineNumber,atol(textptr));
|
initprintf("%s:%d: debug: flagging gamevar as negative.\n",g_szScriptFileName,g_lineNumber); //,atol(textptr));
|
||||||
f = (MAXGAMEVARS<<1);
|
f = (MAXGAMEVARS<<1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1949,7 +1949,7 @@ static int32_t C_GetNextValue(int32_t type)
|
||||||
while (i > 0);
|
while (i > 0);
|
||||||
|
|
||||||
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug > 1)
|
if (!(g_numCompilerErrors || g_numCompilerWarnings) && g_scriptDebug > 1)
|
||||||
initprintf("%s:%d: debug: accepted constant %d.\n",g_szScriptFileName,g_lineNumber,atol(textptr));
|
initprintf("%s:%d: debug: accepted constant %ld.\n",g_szScriptFileName,g_lineNumber,atol(textptr));
|
||||||
bitptr[(g_scriptPtr-script)>>3] &= ~(BITPTR_POINTER<<((g_scriptPtr-script)&7));
|
bitptr[(g_scriptPtr-script)>>3] &= ~(BITPTR_POINTER<<((g_scriptPtr-script)&7));
|
||||||
|
|
||||||
if (tolower(textptr[1])=='x')
|
if (tolower(textptr[1])=='x')
|
||||||
|
@ -2607,7 +2607,7 @@ static int32_t C_ParseCommand(void)
|
||||||
kclose(fp);
|
kclose(fp);
|
||||||
g_numCompilerErrors++;
|
g_numCompilerErrors++;
|
||||||
initprintf("%s:%d: error: could not allocate %d bytes to include `%s'.\n",
|
initprintf("%s:%d: error: could not allocate %d bytes to include `%s'.\n",
|
||||||
g_lineNumber,g_szScriptFileName,j,tempbuf);
|
g_szScriptFileName,g_lineNumber,j,tempbuf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5676,7 +5676,7 @@ repeatcase:
|
||||||
if (i >= (signed)sizeof(CheatStrings[k])-1)
|
if (i >= (signed)sizeof(CheatStrings[k])-1)
|
||||||
{
|
{
|
||||||
initprintf("%s:%d: warning: truncating cheat string to %d characters.\n",
|
initprintf("%s:%d: warning: truncating cheat string to %d characters.\n",
|
||||||
g_szScriptFileName,g_lineNumber,MAXCHEATLEN,sizeof(CheatStrings[k])-1);
|
g_szScriptFileName,g_lineNumber,MAXCHEATLEN); //,sizeof(CheatStrings[k])-1);
|
||||||
g_numCompilerWarnings++;
|
g_numCompilerWarnings++;
|
||||||
C_NextLine();
|
C_NextLine();
|
||||||
break;
|
break;
|
||||||
|
@ -5691,7 +5691,7 @@ repeatcase:
|
||||||
k = *(g_scriptPtr-1);
|
k = *(g_scriptPtr-1);
|
||||||
if (k >= MAXSOUNDS)
|
if (k >= MAXSOUNDS)
|
||||||
{
|
{
|
||||||
initprintf("%s:%ld: error: exceeded sound limit of %ld.\n",g_szScriptFileName,g_lineNumber,MAXSOUNDS);
|
initprintf("%s:%d: error: exceeded sound limit of %d.\n",g_szScriptFileName,g_lineNumber,MAXSOUNDS);
|
||||||
g_numCompilerErrors++;
|
g_numCompilerErrors++;
|
||||||
}
|
}
|
||||||
g_scriptPtr--;
|
g_scriptPtr--;
|
||||||
|
@ -6327,9 +6327,9 @@ void C_Compile(const char *filenam)
|
||||||
C_SetScriptSize(g_scriptPtr-script+8);
|
C_SetScriptSize(g_scriptPtr-script+8);
|
||||||
|
|
||||||
initprintf("Script compiled in %dms, %ld*%db, version %s\n", getticks() - startcompiletime,
|
initprintf("Script compiled in %dms, %ld*%db, version %s\n", getticks() - startcompiletime,
|
||||||
(unsigned)(g_scriptPtr-script), sizeof(intptr_t), (g_scriptVersion == 14?"1.4+":"1.3D"));
|
(unsigned long)(g_scriptPtr-script), sizeof(intptr_t), (g_scriptVersion == 14?"1.4+":"1.3D"));
|
||||||
|
|
||||||
initprintf("%ld/%ld labels, %d/%d variables\n", g_numLabels,
|
initprintf("%d/%d labels, %d/%d variables\n", g_numLabels,
|
||||||
min((MAXSECTORS * sizeof(sectortype)/sizeof(int32_t)),
|
min((MAXSECTORS * sizeof(sectortype)/sizeof(int32_t)),
|
||||||
MAXSPRITES * sizeof(spritetype)/(1<<6)),
|
MAXSPRITES * sizeof(spritetype)/(1<<6)),
|
||||||
g_gameVarCount, MAXGAMEVARS);
|
g_gameVarCount, MAXGAMEVARS);
|
||||||
|
@ -6344,10 +6344,10 @@ void C_Compile(const char *filenam)
|
||||||
if (actorscrptr[i])
|
if (actorscrptr[i])
|
||||||
l++;
|
l++;
|
||||||
|
|
||||||
if (j) initprintf("%ld quotes, ", j);
|
if (j) initprintf("%d quotes, ", j);
|
||||||
if (g_numQuoteRedefinitions) initprintf("%d strings, ", g_numQuoteRedefinitions);
|
if (g_numQuoteRedefinitions) initprintf("%d strings, ", g_numQuoteRedefinitions);
|
||||||
if (k) initprintf("%ld events, ", k);
|
if (k) initprintf("%d events, ", k);
|
||||||
if (l) initprintf("%ld actors", l);
|
if (l) initprintf("%d actors", l);
|
||||||
|
|
||||||
initprintf("\n");
|
initprintf("\n");
|
||||||
|
|
||||||
|
@ -6522,10 +6522,10 @@ void C_ReportError(int32_t iError)
|
||||||
initprintf("%s:%d: error: variable `%s' is of the wrong type.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
|
initprintf("%s:%d: error: variable `%s' is of the wrong type.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
|
||||||
break;
|
break;
|
||||||
case WARNING_BADGAMEVAR:
|
case WARNING_BADGAMEVAR:
|
||||||
initprintf("%s:%ld: warning: variable `%s' should be either per-player OR per-actor, not both.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
|
initprintf("%s:%d: warning: variable `%s' should be either per-player OR per-actor, not both.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
|
||||||
break;
|
break;
|
||||||
case WARNING_DUPLICATECASE:
|
case WARNING_DUPLICATECASE:
|
||||||
initprintf("%s:%ld: warning: duplicate case ignored.\n",g_szScriptFileName,g_lineNumber);
|
initprintf("%s:%d: warning: duplicate case ignored.\n",g_szScriptFileName,g_lineNumber);
|
||||||
break;
|
break;
|
||||||
case WARNING_DUPLICATEDEFINITION:
|
case WARNING_DUPLICATEDEFINITION:
|
||||||
initprintf("%s:%d: warning: duplicate game definition `%s' ignored.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
|
initprintf("%s:%d: warning: duplicate game definition `%s' ignored.\n",g_szScriptFileName,g_lineNumber,label+(g_numLabels<<6));
|
||||||
|
|
|
@ -699,7 +699,7 @@ skip_check:
|
||||||
int32_t q = *insptr++, i = *insptr++;
|
int32_t q = *insptr++, i = *insptr++;
|
||||||
if ((ScriptQuotes[q] == NULL || ScriptQuoteRedefinitions[i] == NULL))
|
if ((ScriptQuotes[q] == NULL || ScriptQuoteRedefinitions[i] == NULL))
|
||||||
{
|
{
|
||||||
OSD_Printf(CON_ERROR "%s %d null quote\n",g_errorLineNum,keyw[g_tw],q,i);
|
OSD_Printf(CON_ERROR "%d %d null quote\n",g_errorLineNum,keyw[g_tw],q,i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Bstrcpy(ScriptQuotes[q],ScriptQuoteRedefinitions[i]);
|
Bstrcpy(ScriptQuotes[q],ScriptQuoteRedefinitions[i]);
|
||||||
|
|
|
@ -210,14 +210,14 @@ void CONTROL_PrintKeyMap(void)
|
||||||
|
|
||||||
for (i=0; i<CONTROL_NUM_FLAGS; i++)
|
for (i=0; i<CONTROL_NUM_FLAGS; i++)
|
||||||
{
|
{
|
||||||
initprintf("function %2ld key1=%3x key2=%3x\n",
|
initprintf("function %2d key1=%3x key2=%3x\n",
|
||||||
i, CONTROL_KeyMapping[i].key1, CONTROL_KeyMapping[i].key2);
|
i, CONTROL_KeyMapping[i].key1, CONTROL_KeyMapping[i].key2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CONTROL_PrintControlFlag(int32_t which)
|
void CONTROL_PrintControlFlag(int32_t which)
|
||||||
{
|
{
|
||||||
initprintf("function %2ld active=%d used=%d toggle=%d buttonheld=%d cleared=%d\n",
|
initprintf("function %2d active=%d used=%d toggle=%d buttonheld=%d cleared=%d\n",
|
||||||
which, CONTROL_Flags[which].active, CONTROL_Flags[which].used,
|
which, CONTROL_Flags[which].active, CONTROL_Flags[which].used,
|
||||||
CONTROL_Flags[which].toggle, CONTROL_Flags[which].buttonheld,
|
CONTROL_Flags[which].toggle, CONTROL_Flags[which].buttonheld,
|
||||||
CONTROL_Flags[which].cleared);
|
CONTROL_Flags[which].cleared);
|
||||||
|
|
|
@ -603,7 +603,7 @@ static int32_t C_SetScriptSize(int32_t size)
|
||||||
|
|
||||||
if (script != newscript)
|
if (script != newscript)
|
||||||
{
|
{
|
||||||
initprintf("Relocating compiled code from to 0x%x to 0x%x\n", script, newscript);
|
initprintf("Relocating compiled code from to 0x%lx to 0x%lx\n", (unsigned long)script, (unsigned long)newscript);
|
||||||
script = newscript;
|
script = newscript;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1674,7 +1674,7 @@ static int32_t C_ParseCommand(void)
|
||||||
kclose(fp);
|
kclose(fp);
|
||||||
g_numCompilerErrors++;
|
g_numCompilerErrors++;
|
||||||
initprintf("%s:%d: error: could not allocate %d bytes to include `%s'.\n",
|
initprintf("%s:%d: error: could not allocate %d bytes to include `%s'.\n",
|
||||||
g_lineNumber,g_szScriptFileName,j,tempbuf);
|
g_szScriptFileName,g_lineNumber,j,tempbuf);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3591,7 +3591,7 @@ void C_CompilationInfo(void)
|
||||||
int32_t j, k=0;
|
int32_t j, k=0;
|
||||||
initprintf(" \n");
|
initprintf(" \n");
|
||||||
initprintf("Compiled code info: (size=%ld*%d bytes)\n",
|
initprintf("Compiled code info: (size=%ld*%d bytes)\n",
|
||||||
(unsigned)(g_scriptPtr-script), sizeof(instype));
|
(unsigned long)(g_scriptPtr-script), sizeof(instype));
|
||||||
initprintf(" %d/%d user labels, %d/65536 indirect constants,\n",
|
initprintf(" %d/%d user labels, %d/65536 indirect constants,\n",
|
||||||
g_numLabels-g_numDefaultLabels, 65536-g_numDefaultLabels,
|
g_numLabels-g_numDefaultLabels, 65536-g_numDefaultLabels,
|
||||||
g_numSavedConstants);
|
g_numSavedConstants);
|
||||||
|
@ -3904,7 +3904,7 @@ void C_ReportError(int32_t iError)
|
||||||
g_szScriptFileName, g_lineNumber, tlabel, def_tw==CON_DEFSTATE?"define":"state");
|
g_szScriptFileName, g_lineNumber, tlabel, def_tw==CON_DEFSTATE?"define":"state");
|
||||||
break;
|
break;
|
||||||
case WARNING_DUPLICATECASE:
|
case WARNING_DUPLICATECASE:
|
||||||
initprintf("%s:%ld: warning: duplicate case ignored.\n",
|
initprintf("%s:%d: warning: duplicate case ignored.\n",
|
||||||
g_szScriptFileName, g_lineNumber);
|
g_szScriptFileName, g_lineNumber);
|
||||||
break;
|
break;
|
||||||
case WARNING_DUPLICATEDEFINITION:
|
case WARNING_DUPLICATEDEFINITION:
|
||||||
|
|
|
@ -1408,7 +1408,7 @@ skip_check:
|
||||||
continue;
|
continue;
|
||||||
badindex:
|
badindex:
|
||||||
OSD_Printf(OSD_ERROR "Line %d, %s %s: index %d out of range!\n",g_errorLineNum,keyw[g_tw],
|
OSD_Printf(OSD_ERROR "Line %d, %s %s: index %d out of range!\n",g_errorLineNum,keyw[g_tw],
|
||||||
iter_tokens[how], parm2);
|
iter_tokens[how].token, parm2);
|
||||||
vm.flags |= VMFLAG_ERROR;
|
vm.flags |= VMFLAG_ERROR;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -825,9 +825,8 @@ process:
|
||||||
case PACKET_VERSION:
|
case PACKET_VERSION:
|
||||||
if (pbuf[1] != BYTEVERSION || pbuf[2] != (uint8_t)atoi(s_buildDate))
|
if (pbuf[1] != BYTEVERSION || pbuf[2] != (uint8_t)atoi(s_buildDate))
|
||||||
{
|
{
|
||||||
Bsprintf(tempbuf, "Server protocol is version %d.%d, expecting %d.%d\n",
|
initprintf("Server protocol is version %d.%d, expecting %d.%d\n",
|
||||||
pbuf[1], pbuf[2], BYTEVERSION, (uint8_t)atoi(s_buildDate));
|
pbuf[1], pbuf[2], BYTEVERSION, (uint8_t)atoi(s_buildDate));
|
||||||
initprintf(tempbuf);
|
|
||||||
initprintf("Server version mismatch! You cannot play Duke with different versions!\n");
|
initprintf("Server version mismatch! You cannot play Duke with different versions!\n");
|
||||||
g_netDisconnect = 1;
|
g_netDisconnect = 1;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -125,7 +125,7 @@ void S_MusicShutdown(void)
|
||||||
S_StopMusic();
|
S_StopMusic();
|
||||||
|
|
||||||
if (MUSIC_Shutdown() != MUSIC_Ok)
|
if (MUSIC_Shutdown() != MUSIC_Ok)
|
||||||
initprintf(MUSIC_ErrorString(MUSIC_ErrorCode));
|
initprintf("%s", MUSIC_ErrorString(MUSIC_ErrorCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_PauseMusic(int32_t onf)
|
void S_PauseMusic(int32_t onf)
|
||||||
|
|
Loading…
Reference in a new issue