Skip to content

Commit

Permalink
Merge commit '904b1ceaf7be4af97768d62fb116a6047f7cd834'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hendricks266 committed Aug 27, 2023
2 parents ccdd8a9 + 904b1ce commit f4ca9cd
Show file tree
Hide file tree
Showing 62 changed files with 526 additions and 519 deletions.
2 changes: 1 addition & 1 deletion source/blood/src/blood.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,7 +1634,7 @@ int app_main(int argc, char const * const * argv)
wm_msgbox("Build Engine Initialization Error",
"There was a problem initializing the Build engine: %s", engineerrstr);
#endif
ERRprintf("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
LOG_F(ERROR, "app_main: There was a problem initializing the Build engine: %s", engineerrstr);
Bexit(2);
}

Expand Down
7 changes: 0 additions & 7 deletions source/build/include/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -699,13 +699,6 @@ static FORCE_INLINE int32_t Blrintf(const float x)
# define Bsqrtf sqrtf
#endif

// redefined for apple/ppc, which chokes on stderr when linking...
#if defined EDUKE32_OSX && defined __BIG_ENDIAN__
# define ERRprintf(fmt, ...) printf(fmt, ## __VA_ARGS__)
#else
# define ERRprintf(fmt, ...) fprintf(stderr, fmt, ## __VA_ARGS__)
#endif

#ifdef __ANDROID__
void eduke32_exit_return(int) ATTRIBUTE((noreturn));
# define exit(x) eduke32_exit_return(x)
Expand Down
10 changes: 5 additions & 5 deletions source/build/src/build.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,8 @@ static void M32_FatalEngineError(void)
#ifdef DEBUGGINGAIDS
debug_break();
#endif
Bsprintf(tempbuf, "There was a problem initializing the engine: %s\n", engineerrstr);
ERRprintf("%s", tempbuf);
Bsprintf(tempbuf, "There was a problem initializing the engine: %s", engineerrstr);
LOG_F(ERROR, "%s", tempbuf);
fatal_exit(tempbuf);
}

Expand Down Expand Up @@ -648,11 +648,11 @@ int app_main(int argc, char const* const* argv)
pathsearchmode = 1; // unrestrict findfrompath so that full access to the filesystem can be had

#ifdef USE_OPENGL
OSD_RegisterFunction("restartvid","restartvid: reinitialize the video mode",osdcmd_restartvid);
OSD_RegisterFunction("vidmode","vidmode <xdim> <ydim> <bpp> <fullscreen>: immediately change the video mode",osdcmd_vidmode);
OSD_RegisterFunction("restartvid","restartvid: reinitializes the video mode",osdcmd_restartvid);
OSD_RegisterFunction("vidmode","vidmode <xdim> <ydim> <bpp> <fullscreen>: changes the video mode",osdcmd_vidmode);
baselayer_osdcmd_vidmode_func = osdcmd_vidmode;
#else
OSD_RegisterFunction("vidmode","vidmode <xdim> <ydim>: immediately change the video mode",osdcmd_vidmode);
OSD_RegisterFunction("vidmode","vidmode <xdim> <ydim>: changes the video mode",osdcmd_vidmode);
#endif

wm_setapptitle(AppProperName);
Expand Down
13 changes: 5 additions & 8 deletions source/build/src/defs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ static int32_t defsparser(scriptfile *script)
if (orig_crc32 == tile_crc32)
have_crc32 = 0;
else
DLOG_F(WARNING, "tilefromtexture: CRC32 of tile %d doesn't match! CRC32: %d, Expected: %d", tile, orig_crc32, tile_crc32);
DLOG_F(WARNING, "tilefromtexture: CRC32 of tile %d doesn't match! CRC32: 0x%08X, Expected: 0x%08X", tile, orig_crc32, tile_crc32);
}

vec2_16_t orig_size{};
Expand All @@ -952,13 +952,13 @@ static int32_t defsparser(scriptfile *script)
if (orig_size.x == tile_size.x && orig_size.y == tile_size.y)
have_size = 0;
else
LOG_F(WARNING, "tilefromtexture: size of tile %d doesn't match! Size: (%d, %d), Expected: (%d, %d)", tile, orig_size.x, orig_size.y, tile_size.x, tile_size.y);
DLOG_F(WARNING, "tilefromtexture: size of tile %d doesn't match! Size: (%d, %d), Expected: (%d, %d)", tile, orig_size.x, orig_size.y, tile_size.x, tile_size.y);
}

if (have_crc32 || have_size)
{
#if 0
initprintf("tilefromtexture %d { ifmatch { size %d %d crc32 %d } }\n", tile, orig_size.x, orig_size.y, orig_crc32);
DLOG_F(INFO, "tilefromtexture %d { ifmatch { size %d %d crc32 0x%08X } }", tile, orig_size.x, orig_size.y, orig_crc32);
#endif
break;
}
Expand Down Expand Up @@ -1505,7 +1505,6 @@ static int32_t defsparser(scriptfile *script)
int32_t token = getatoken(script,modeltokens,ARRAY_SIZE(modeltokens));
switch (token)
{
//case T_ERROR: initprintf("Error on line %s:%d in model tokens\n", script->filename,script->linenum); break;
case T_SCALE:
scriptfile_getdouble(script,&scale); break;
case T_SHADE:
Expand Down Expand Up @@ -1922,9 +1921,9 @@ static int32_t defsparser(scriptfile *script)
md_thinoutmodel(lastmodelid, usedframebitmap);
# ifdef DEBUG_MODEL_MEM
if (i>=0 && i<onumframes)
initprintf("used %d/%d frames: %s\n", i, onumframes, modelfn);
LOG_F(INFO, "used %d/%d frames: %s", i, onumframes, modelfn);
else if (i<0)
initprintf("md_thinoutmodel returned %d: %s\n", i, modelfn);
LOG_F(INFO, "md_thinoutmodel returned %d: %s", i, modelfn);
# endif
}
# endif
Expand Down Expand Up @@ -1986,7 +1985,6 @@ static int32_t defsparser(scriptfile *script)
{
switch (getatoken(script, voxeltokens, ARRAY_SIZE(voxeltokens)))
{
//case T_ERROR: initprintf("Error on line %s:%d in voxel tokens\n", script->filename,linenum); break;
case T_TILE:
scriptfile_getsymbol(script,&tilex);

Expand Down Expand Up @@ -2070,7 +2068,6 @@ static int32_t defsparser(scriptfile *script)
{
switch (getatoken(script,skyboxtokens,ARRAY_SIZE(skyboxtokens)))
{
//case T_ERROR: initprintf("Error on line %s:%d in skybox tokens\n",script->filename,linenum); break;
case T_TILE:
scriptfile_getsymbol(script,&tile); break;
case T_PAL:
Expand Down
13 changes: 7 additions & 6 deletions source/build/src/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1054,7 +1054,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t,int32_

if (k < 0)
{
yaxprintf("%s, l %d: skipped bunch %d\n", cf?"v":"^", lev, j);
yaxprintf("%s, l %d: skipped bunch %d", cf?"v":"^", lev, j);
continue;
}

Expand Down Expand Up @@ -8478,7 +8478,7 @@ static void dosetaspect(void)
no_radarang2 = 1;
#ifdef DEBUGGINGAIDS
if (editstatus)
initprintf("no rad2\n");
LOG_F(INFO, "no rad2");
#endif
break;
}
Expand Down Expand Up @@ -9043,7 +9043,7 @@ static void sighandler(int sig, siginfo_t *info, void *ctx)
default:
s = "?! (unknown)"; break;
}
ERRprintf("Caught SIGFPE at address %p, code %s. Aborting.\n", info->si_addr, s);
LOG_F(ERROR, "Caught SIGFPE at address %p, code %s. Aborting.", info->si_addr, s);
break;
default:
break;
Expand Down Expand Up @@ -11584,7 +11584,7 @@ int32_t saveboard(const char *filename, const vec3_t *dapos, int16_t daang, int1
#ifdef NEW_MAP_FORMAT
if (mapversion == 10)
{
initprintf("Saving of TROR maps not yet accessible in the Lunatic preview build\n");
LOG_F(ERROR, "Saving of TROR maps not yet accessible with NEW_MAP_FORMAT");
return -1;
// return saveboard_maptext(filename, dapos, daang, dacursectnum);
}
Expand Down Expand Up @@ -13718,7 +13718,8 @@ void rotatesprite_(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
// bit RS_CENTERORIGIN: see dorotspr_handle_bit2
////////////////////

if (((dastat & RS_PERM) == 0) || (numpages < 2) || (beforedrawrooms != 0))
auto const impermanent = (dastat & RS_PERM) == 0 || videoGetRenderMode() == REND_POLYMER;
if (impermanent || (numpages < 2) || (beforedrawrooms != 0))
{
videoBeginDrawing(); //{{{
dorotatesprite(sx,sy,z,a,picnum,dashade,dapalnum,dastat,daalpha,dablend,cx1,cy1,cx2,cy2,guniqhudid);
Expand All @@ -13729,7 +13730,7 @@ void rotatesprite_(int32_t sx, int32_t sy, int32_t z, int16_t a, int16_t picnum,
(sx == (160<<16)) && (sy == (100<<16)) && (z == 65536L) && (a == 0) && ((dastat&RS_TRANS1) == 0))
permhead = permtail = 0;

if ((dastat & RS_PERM) == 0)
if (impermanent)
return;

if (numpages >= 2)
Expand Down
4 changes: 2 additions & 2 deletions source/build/src/engine_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ static FORCE_INLINE int32_t yax_isislandwall(int32_t line, int32_t cf) { return
extern char m32_debugstr[64][128];
extern int32_t m32_numdebuglines;
# define yaxdebug(fmt, ...) do { if (m32_numdebuglines<64) Bsnprintf(m32_debugstr[m32_numdebuglines++], 128, fmt, ##__VA_ARGS__); } while (0)
# define yaxprintf(fmt, ...) do { initprintf(fmt, ##__VA_ARGS__); } while (0)
# define yaxprintf(fmt, ...) do { LOG_F(INFO, fmt, ##__VA_ARGS__); } while (0)
#else
# define yaxdebug(fmt, ...)
# define yaxprintf(fmt, ...)
Expand Down Expand Up @@ -456,7 +456,7 @@ static inline floorsprite_dims get_floorspr_dims(uspriteptr_t spr, bool sloped)
static inline vec2_t get_floorspr_center(void const *const ptr, bool sloped)
{
auto const *spr = (uspriteptr_t)ptr;
Bassert((spr->cstat & CSTAT_SPRITE_ALIGNMENT) == CSTAT_SPRITE_ALIGNMENT_FLOOR);
Bassert((spr->cstat & CSTAT_SPRITE_ALIGNMENT) == (sloped ? CSTAT_SPRITE_ALIGNMENT_SLOPE : CSTAT_SPRITE_ALIGNMENT_FLOOR));

auto const dims = get_floorspr_dims(spr, sloped);
int32_t const cosang = dims.cosang, sinang = dims.sinang;
Expand Down
13 changes: 7 additions & 6 deletions source/build/src/glbuild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ static void *getproc_(const char *s, int32_t *err, int32_t fatal, int32_t extens
#endif
if (!t && fatal)
{
initprintf("Failed to find %s in %s\n", s, gldriver);
LOG_F(ERROR, "Failed to find %s in %s", s, gldriver);
*err = 1;
}
return t;
Expand All @@ -527,7 +527,7 @@ int32_t loadwgl(const char *driver)
hGLDLL = LoadLibrary(driver);
if (!hGLDLL)
{
initprintf("Failed loading \"%s\"\n", driver);
LOG_F(ERROR, "Failed loading \"%s\"", driver);
return -1;
}

Expand Down Expand Up @@ -618,7 +618,8 @@ void texdbg_bglGenTextures(GLsizei n, GLuint *textures, const char *srcfn)
{
GLuint const t = textures[i];
if (t < texnameallocsize && bitmap_test(texnameused, t))
initprintf("texdebug %x Gen: overwriting used tex name %u from %x\n", hash, t, texnamefromwhere[t]);
DLOG_F(INFO, "texdebug %x Gen: overwriting used tex name %u from %x",
hash, t, texnamefromwhere[t]);
}

bglGenTextures(n, textures);
Expand Down Expand Up @@ -652,10 +653,10 @@ void texdbg_bglDeleteTextures(GLsizei n, const GLuint *textures, const char *src
if (t < texnameallocsize)
{
if (!bitmap_test(texnameused, t))
initprintf("texdebug %x Del: deleting unused tex name %u\n", hash, t);
DLOG_F(INFO, "texdebug %x Del: deleting unused tex name %u", hash, t);
else if (bitmap_test(texnameused, t) && texnamefromwhere[t] != hash)
initprintf("texdebug %x Del: deleting foreign tex name %u from %x\n", hash,
t, texnamefromwhere[t]);
DLOG_F(INFO, "texdebug %x Del: deleting foreign tex name %u from %x",
hash, t, texnamefromwhere[t]);
}
}

Expand Down
14 changes: 7 additions & 7 deletions source/build/src/mdsprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static int32_t addtileP(int32_t model,int32_t tile,int32_t pallet)
UNREFERENCED_PARAMETER(model);
if (curextra==MAXTILES+EXTRATILES-1)
{
initprintf("warning: max EXTRATILES reached\n");
LOG_F(WARNING, "max EXTRATILES reached");
return curextra;
}

Expand Down Expand Up @@ -399,7 +399,7 @@ int32_t md_thinoutmodel(int32_t modelid, uint8_t *usedframebitmap)
{
if (anm->endframe <= anm->startframe)
{
// initprintf("backward anim %d-%d\n", anm->startframe, anm->endframe);
// LOG_F(WARNING, "backward anim %d-%d", anm->startframe, anm->endframe);
return -3;
}

Expand Down Expand Up @@ -450,7 +450,7 @@ int32_t md_thinoutmodel(int32_t modelid, uint8_t *usedframebitmap)
for (anm=m->animations; anm; anm=anm->next)
{
if (otonframe[anm->startframe]==-1 || otonframe[anm->endframe-1]==-1)
initprintf("md %d WTF: anm %d %d\n", modelid, anm->startframe, anm->endframe);
LOG_F(WARNING, "md %d WTF: anm %d %d", modelid, anm->startframe, anm->endframe);

anm->startframe = otonframe[anm->startframe];
anm->endframe = otonframe[anm->endframe-1];
Expand All @@ -460,7 +460,7 @@ int32_t md_thinoutmodel(int32_t modelid, uint8_t *usedframebitmap)
if (tile2model[i].modelid == modelid)
{
if (otonframe[tile2model[i].framenum]==-1)
initprintf("md %d WTF: tile %d, fr %d\n", modelid, i, tile2model[i].framenum);
LOG_F(WARNING, "md %d WTF: tile %d, fr %d", modelid, i, tile2model[i].framenum);
tile2model[i].framenum = otonframe[tile2model[i].framenum];
}

Expand Down Expand Up @@ -1695,8 +1695,8 @@ int md3postload_polymer(md3model_t *m)
#ifdef DEBUG_MODEL_MEM
i = (m->head.numframes * s->numverts * sizeof(float) * 15);
if (i > 1<<20)
initprintf("size %d (%d fr, %d v): md %s surf %d/%d\n", i, m->head.numframes, s->numverts,
m->head.nam, surfi, m->head.numsurfs);
LOG_F(INFO, "size %d (%d fr, %d v): md %s surf %d/%d", i, m->head.numframes, s->numverts,
m->head.nam, surfi, m->head.numsurfs);
#endif
s->geometry = (float *)Xcalloc(m->head.numframes * s->numverts * 15, sizeof(float));

Expand Down Expand Up @@ -2551,7 +2551,7 @@ mdmodel_t *mdload(const char *filnam)
switch (B_LITTLE32(i))
{
case IDP2_MAGIC:
// initprintf("Warning: model \"%s\" is version IDP2; wanted version IDP3\n",filnam);
// LOG_F(WARNING, "model \"%s\" is version IDP2; wanted version IDP3", filnam);
vm = (mdmodel_t *)md2load(fil,filnam);
break; //IDP2
case IDP3_MAGIC:
Expand Down
4 changes: 2 additions & 2 deletions source/build/src/mhk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ int32_t engineLoadMHK(const char *filename)
{
if (maphacklightcnt == PR_MAXLIGHTS)
{
initprintf("warning: max light count %d exceeded, "
"ignoring further light defs\n", PR_MAXLIGHTS);
LOG_F(WARNING, "%s:%d: warning: max light count %d exceeded, ignoring further light defs",
script->filename, scriptfile_getlinum(script, cmdtokptr), PR_MAXLIGHTS);
toomanylights = 1;
break;
}
Expand Down
24 changes: 12 additions & 12 deletions source/build/src/mmulti.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void nfIncCP() //function to handle currentplayer increment
if (nfCurrentPlayer >= numplayers)
{
nfFinished = 1; //Set NatFree finished flag. Perform non-natfree networking routines
initprintf("natfree: all players accounted for.\n");
LOG_F(INFO, "natfree: all players accounted for.");
return;
}
}
Expand Down Expand Up @@ -277,7 +277,7 @@ int netread(int *other, char *dabuf, int bufsiz) //0:no packets in buffer
{
if (otherport[nfCurrentPlayer] != snatchport) //If Port numbers do not match
{
initprintf("natfree: port number for player %d changed from %d to %d.\n",nfCurrentPlayer,otherport[nfCurrentPlayer],snatchport);
LOG_F(INFO, "natfree: port number for player %d changed from %d to %d.",nfCurrentPlayer,otherport[nfCurrentPlayer],snatchport);
otherport[nfCurrentPlayer] = snatchport; //Correct the port number
}
}
Expand Down Expand Up @@ -727,14 +727,14 @@ int mmulti_getpacket(int *retother, unsigned char *bufptr)
/*Addfaz NatFree Start*/
if (natfree && !nfCheckHF(other))
{
initprintf("natfree: heard from player %d\n", other);
LOG_F(INFO, "natfree: heard from player %d", other);
HeardFrom[other] = 1;
HeardFrom2[other] = 1;
nfIncCP();
}
else
{
initprintf("mmulti: player %d connected! (%d.%d.%d.%d:%d)\n", other, otherip[other]&255,(otherip[other]>>8)&255,(otherip[other]>>16)&255,(((unsigned int)otherip[other])>>24),otherport[other]);
LOG_F(INFO, "mmulti: player %d connected! (%d.%d.%d.%d:%d)", other, otherip[other]&255,(otherip[other]>>8)&255,(otherip[other]>>16)&255,(((unsigned int)otherip[other])>>24),otherport[other]);
}
/*Addfaz NatFree End*/

Expand All @@ -761,7 +761,7 @@ int mmulti_getpacket(int *retother, unsigned char *bufptr)
/*Addfaz NatFree Start*/
if (natfree)
{
initprintf("natfree: heard from player %d (head).\n", connecthead);
LOG_F(INFO, "natfree: heard from player %d (head).", connecthead);
HeardFrom[connecthead] = 1;
HeardFrom2[connecthead] = 1;
nfIncCP();
Expand Down Expand Up @@ -812,7 +812,7 @@ int mmulti_getpacket(int *retother, unsigned char *bufptr)
/*Addfaz NatFree Start*/
if (natfree && !HeardFrom2[nfCurrentPlayer] && i == nfCurrentPlayer)
{
initprintf("natfree: heard from player %d.\n", i);
LOG_F(INFO, "natfree: heard from player %d.", i);
HeardFrom2[nfCurrentPlayer] = 1;
HeardFrom[nfCurrentPlayer] = 1;
nfIncCP();
Expand Down Expand Up @@ -846,7 +846,7 @@ int getexternaladdress(char *buffer, const char *host, int port)

if (WSAStartup(0x101,&ws) == SOCKET_ERROR)
{
initprintf("mmulti: Winsock error in getexternaladdress() (%d)\n",errno);
LOG_F(ERROR, "mmulti: Winsock error in getexternaladdress() (%d)",errno);
return(0);
}
wsainitialized = 1;
Expand All @@ -855,7 +855,7 @@ int getexternaladdress(char *buffer, const char *host, int port)

if ((h=gethostbyname(host)) == NULL)
{
initprintf("mmulti: gethostbyname() error in getexternaladdress() (%d)\n",h_errno);
LOG_F(ERROR, "mmulti: gethostbyname() error in getexternaladdress() (%d)", h_errno);
return(0);
}

Expand All @@ -869,24 +869,24 @@ int getexternaladdress(char *buffer, const char *host, int port)

if (mysock == INVALID_SOCKET)
{
initprintf("mmulti: socket() error in getexternaladdress() (%d)\n",errno);
LOG_F(ERROR, "mmulti: socket() error in getexternaladdress() (%d)", errno);
return(0);
}

if (connect(mysock, (struct sockaddr *)&dest_addr, sizeof(struct sockaddr)) == SOCKET_ERROR)
{
initprintf("mmulti: connect() error in getexternaladdress() (%d)\n",errno);
LOG_F(ERROR, "mmulti: connect() error in getexternaladdress() (%d)", errno);
return(0);
}

bytes_sent = send(mysock, req, strlen(req), 0);
if (bytes_sent == SOCKET_ERROR)
{
initprintf("mmulti: send() error in getexternaladdress() (%d)\n",errno);
LOG_F(ERROR, "mmulti: send() error in getexternaladdress() (%d)", errno);
return(0);
}

// initprintf("sent %d bytes\n",bytes_sent);
// LOG_F(INFO, "mmulti: sent %d bytes", bytes_sent);
recv(mysock, (char *)&tempbuf, sizeof(tempbuf), 0);
closesocket(mysock);
j = Bstrlen(text);
Expand Down
Loading

0 comments on commit f4ca9cd

Please sign in to comment.