From 28ec01ef752dafbf599d4b63a56fdd51452ace90 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 8 Apr 2019 06:25:33 +0000 Subject: [PATCH] SW: Add TrackerCast where needed for printf. Patch from Striker. git-svn-id: https://svn.eduke32.com/eduke32@7500 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/sw/src/brooms.cpp | 6 +++--- source/sw/src/draw.cpp | 8 ++++---- source/sw/src/jnstub.cpp | 16 ++++++++-------- source/sw/src/jsector.cpp | 16 ++++++++-------- source/sw/src/sounds.cpp | 2 +- source/sw/src/sprite.cpp | 2 +- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/source/sw/src/brooms.cpp b/source/sw/src/brooms.cpp index 57974eabb..05e8a9ba6 100644 --- a/source/sw/src/brooms.cpp +++ b/source/sw/src/brooms.cpp @@ -198,7 +198,7 @@ SetupBuildFAF(void) { if (sprite[i].hitag == sp->hitag && sprite[i].lotag == sp->lotag) { - sprintf(ds,"Two VIEW_THRU_ tags with same match found on level\n1: x %d, y %d \n2: x %d, y %d", sp->x, sp->y, sprite[i].x, sprite[i].y); + sprintf(ds,"Two VIEW_THRU_ tags with same match found on level\n1: x %d, y %d \n2: x %d, y %d", TrackerCast(sp->x), TrackerCast(sp->y), TrackerCast(sprite[i].x), TrackerCast(sprite[i].y)); Message(ds,0); } } @@ -229,7 +229,7 @@ SetupBuildFAF(void) sector[sp->sectnum].ceilingpicnum = FAF_MIRROR_PIC; if (sector[sp->sectnum].floorz == sector[sp->sectnum].ceilingz) { - sprintf(ds, "Mirror used for non-connect area. Use tile 342. Sect %d, x %d, y %d\n", sp->sectnum, wall[sector[sp->sectnum].wallptr].x, wall[sector[sp->sectnum].wallptr].y); + sprintf(ds, "Mirror used for non-connect area. Use tile 342. Sect %d, x %d, y %d\n", TrackerCast(sp->sectnum), TrackerCast(wall[sector[sp->sectnum].wallptr].x), TrackerCast(wall[sector[sp->sectnum].wallptr].y)); Message(ds,0); } } @@ -239,7 +239,7 @@ SetupBuildFAF(void) sector[sp->sectnum].floorpicnum = FAF_MIRROR_PIC; if (sector[sp->sectnum].floorz == sector[sp->sectnum].ceilingz) { - sprintf(ds, "Mirror used for non-connect area. Use tile 342. Sect %d, x %d, y %d\n", sp->sectnum, wall[sector[sp->sectnum].wallptr].x, wall[sector[sp->sectnum].wallptr].y); + sprintf(ds, "Mirror used for non-connect area. Use tile 342. Sect %d, x %d, y %d\n", TrackerCast(sp->sectnum), TrackerCast(wall[sector[sp->sectnum].wallptr].x), TrackerCast(wall[sector[sp->sectnum].wallptr].y)); Message(ds,0); } } diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index c6f76ad30..72d2810f4 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -1493,16 +1493,16 @@ void PrintSpriteInfo(PLAYERp pp) } if (SpriteInfo > 1) { - sprintf(buffer, "POSX:%d", sp->x); + sprintf(buffer, "POSX:%d", TrackerCast(sp->x)); printext256(x, y, 1, -1, buffer, 1); y += Y_STEP; - sprintf(buffer, "POSY:%d", sp->y); + sprintf(buffer, "POSY:%d", TrackerCast(sp->y)); printext256(x, y, 1, -1, buffer, 1); y += Y_STEP; - sprintf(buffer, "POSZ:%d", sp->z); + sprintf(buffer, "POSZ:%d", TrackerCast(sp->z)); printext256(x, y, 1, -1, buffer, 1); y += Y_STEP; - sprintf(buffer, "ANG:%d", (int32_t) sp->ang); + sprintf(buffer, "ANG:%d", TrackerCast(sp->ang)); printext256(x, y, 1, -1, buffer, 1); y += Y_STEP; } diff --git a/source/sw/src/jnstub.cpp b/source/sw/src/jnstub.cpp index 02b118846..68d3e9d45 100644 --- a/source/sw/src/jnstub.cpp +++ b/source/sw/src/jnstub.cpp @@ -2255,8 +2255,8 @@ ExtGetSectorCaption(short sectnum) } else { - sprintf(tempbuf, "%d,%d", sector[sectnum].hitag, - sector[sectnum].lotag); + sprintf(tempbuf, "%d,%d", TrackerCast(sector[sectnum].hitag), + TrackerCast(sector[sectnum].lotag)); } return tempbuf; } @@ -2270,8 +2270,8 @@ ExtGetWallCaption(short wallnum) } else { - sprintf(tempbuf, "%d,%d", wall[wallnum].hitag, - wall[wallnum].lotag); + sprintf(tempbuf, "%d,%d", TrackerCast(wall[wallnum].hitag), + TrackerCast(wall[wallnum].lotag)); } return tempbuf; } @@ -2664,7 +2664,7 @@ ExtGetSpriteCaption(short spritenum) //tempbuf[0] = NULL; sprintf(tempbuf, "S:%d", data); else - sprintf(tempbuf, "S:%d,%d,%d", data, sprite[spritenum].hitag, sprite[spritenum].lotag); + sprintf(tempbuf, "S:%d,%d,%d", data, TrackerCast(sprite[spritenum].hitag), TrackerCast(sprite[spritenum].lotag)); break; @@ -2679,7 +2679,7 @@ ExtGetSpriteCaption(short spritenum) sprintf(tempbuf, "S:%d,%s%s", data, p, multi_str); else // name and numbers - name only prints if not null string - sprintf(tempbuf, "%s%s%d,%d", p, multi_str, sprite[spritenum].hitag, sprite[spritenum].lotag); + sprintf(tempbuf, "%s%s%d,%d", p, multi_str, TrackerCast(sprite[spritenum].hitag), TrackerCast(sprite[spritenum].lotag)); break; @@ -2971,10 +2971,10 @@ ExtEditSectorData(short sectnum) // F7 sprintf(tempbuf, "PicNum = %d", FindPicNum); printext16(8, ydim16+32 + 16, 11, -1, tempbuf, 0); - sprintf(tempbuf, "HiTag = %d", sp->hitag); + sprintf(tempbuf, "HiTag = %d", TrackerCast(sp->hitag)); printext16(8, ydim16+32 + 24, 11, -1, tempbuf, 0); - sprintf(tempbuf, "LowTag = %d", sp->lotag); + sprintf(tempbuf, "LowTag = %d", TrackerCast(sp->lotag)); printext16(8, ydim16+32 + 32, 11, -1, tempbuf, 0); FindNextSprite(FindPicNum); diff --git a/source/sw/src/jsector.cpp b/source/sw/src/jsector.cpp index 0c810e620..85e579add 100644 --- a/source/sw/src/jsector.cpp +++ b/source/sw/src/jsector.cpp @@ -402,8 +402,8 @@ JS_InitMirrors(void) if (!Found_Cam) { - printf("Cound not find the camera view sprite for match %d\n",wall[i].hitag); - printf("Map Coordinates: x = %d, y = %d\n",wall[i].x,wall[i].y); + printf("Cound not find the camera view sprite for match %d\n",TrackerCast(wall[i].hitag)); + printf("Map Coordinates: x = %d, y = %d\n",TrackerCast(wall[i].x),TrackerCast(wall[i].y)); exit(0); } @@ -429,8 +429,8 @@ JS_InitMirrors(void) if (!Found_Cam) { printf("Did not find drawtotile for camera number %d\n",mirrorcnt); - printf("wall[%d].hitag == %d\n",i,wall[i].hitag); - printf("Map Coordinates: x = %d, y = %d\n",wall[i].x,wall[i].y); + printf("wall[%d].hitag == %d\n",i,TrackerCast(wall[i].hitag)); + printf("Map Coordinates: x = %d, y = %d\n", TrackerCast(wall[i].x), TrackerCast(wall[i].y)); exit(0); } } @@ -1233,16 +1233,16 @@ JS_PlockError(short wall_num, short t) switch (t) { case 1: - printf("wall %d, x %d, y %d, pic %d\n", wall_num, wall[wall_num].x, wall[wall_num].y, wall[wall_num].picnum); + printf("wall %d, x %d, y %d, pic %d\n", wall_num, TrackerCast(wall[wall_num].x), TrackerCast(wall[wall_num].y), TrackerCast(wall[wall_num].picnum)); break; case 2: - printf("wall %d, x %d, y %d, OVERpic %d\n", wall_num, wall[wall_num].x, wall[wall_num].y, wall[wall_num].overpicnum); + printf("wall %d, x %d, y %d, OVERpic %d\n", wall_num, TrackerCast(wall[wall_num].x), TrackerCast(wall[wall_num].y), TrackerCast(wall[wall_num].overpicnum)); break; case 3: - printf("sector %d, ceiling %d\n", wall_num, sector[wall_num].ceilingpicnum); + printf("sector %d, ceiling %d\n", wall_num, TrackerCast(sector[wall_num].ceilingpicnum)); break; case 4: - printf("sector %d, floor %d\n", wall_num, sector[wall_num].floorpicnum); + printf("sector %d, floor %d\n", wall_num, TrackerCast(sector[wall_num].floorpicnum)); break; } exit(0); diff --git a/source/sw/src/sounds.cpp b/source/sw/src/sounds.cpp index 904ce39a1..494337423 100644 --- a/source/sw/src/sounds.cpp +++ b/source/sw/src/sounds.cpp @@ -2006,7 +2006,7 @@ DumpSounds(void) if (vp->owner >= 0) { SPRITEp sp = &sprite[vp->owner]; - sprintf(ds,"sp->picnum=%d, sp->hitag=%d, sp->lotag=%d, sp->owner=%d\n",sp->picnum,sp->hitag,sp->lotag,sp->owner); + sprintf(ds,"sp->picnum=%d, sp->hitag=%d, sp->lotag=%d, sp->owner=%d\n",TrackerCast(sp->picnum), TrackerCast(sp->hitag), TrackerCast(sp->lotag), TrackerCast(sp->owner)); DebugWriteString(ds); } vp = vp->next; diff --git a/source/sw/src/sprite.cpp b/source/sw/src/sprite.cpp index 7a0032052..3a35363fd 100644 --- a/source/sw/src/sprite.cpp +++ b/source/sw/src/sprite.cpp @@ -2882,7 +2882,7 @@ SpriteSetup(void) if (sprite[i].hitag == sp->hitag && sprite[i].lotag == sp->lotag) { TerminateGame(); - printf("Two VIEW_THRU_ tags with same match found on level\n1: x %d, y %d \n2: x %d, y %d", sp->x, sp->y, sprite[i].x, sprite[i].y); + printf("Two VIEW_THRU_ tags with same match found on level\n1: x %d, y %d \n2: x %d, y %d", TrackerCast(sp->x), TrackerCast(sp->y), TrackerCast(sprite[i].x), TrackerCast(sprite[i].y)); exit(0); } }