SW: Add TrackerCast where needed for printf.

Patch from Striker.

git-svn-id: https://svn.eduke32.com/eduke32@7500 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2019-04-08 06:25:33 +00:00 committed by Christoph Oelckers
parent 61446c0995
commit 28ec01ef75
6 changed files with 25 additions and 25 deletions

View file

@ -198,7 +198,7 @@ SetupBuildFAF(void)
{ {
if (sprite[i].hitag == sp->hitag && sprite[i].lotag == sp->lotag) 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); Message(ds,0);
} }
} }
@ -229,7 +229,7 @@ SetupBuildFAF(void)
sector[sp->sectnum].ceilingpicnum = FAF_MIRROR_PIC; sector[sp->sectnum].ceilingpicnum = FAF_MIRROR_PIC;
if (sector[sp->sectnum].floorz == sector[sp->sectnum].ceilingz) 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); Message(ds,0);
} }
} }
@ -239,7 +239,7 @@ SetupBuildFAF(void)
sector[sp->sectnum].floorpicnum = FAF_MIRROR_PIC; sector[sp->sectnum].floorpicnum = FAF_MIRROR_PIC;
if (sector[sp->sectnum].floorz == sector[sp->sectnum].ceilingz) 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); Message(ds,0);
} }
} }

View file

@ -1493,16 +1493,16 @@ void PrintSpriteInfo(PLAYERp pp)
} }
if (SpriteInfo > 1) if (SpriteInfo > 1)
{ {
sprintf(buffer, "POSX:%d", sp->x); sprintf(buffer, "POSX:%d", TrackerCast(sp->x));
printext256(x, y, 1, -1, buffer, 1); printext256(x, y, 1, -1, buffer, 1);
y += Y_STEP; y += Y_STEP;
sprintf(buffer, "POSY:%d", sp->y); sprintf(buffer, "POSY:%d", TrackerCast(sp->y));
printext256(x, y, 1, -1, buffer, 1); printext256(x, y, 1, -1, buffer, 1);
y += Y_STEP; y += Y_STEP;
sprintf(buffer, "POSZ:%d", sp->z); sprintf(buffer, "POSZ:%d", TrackerCast(sp->z));
printext256(x, y, 1, -1, buffer, 1); printext256(x, y, 1, -1, buffer, 1);
y += Y_STEP; 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); printext256(x, y, 1, -1, buffer, 1);
y += Y_STEP; y += Y_STEP;
} }

View file

@ -2255,8 +2255,8 @@ ExtGetSectorCaption(short sectnum)
} }
else else
{ {
sprintf(tempbuf, "%d,%d", sector[sectnum].hitag, sprintf(tempbuf, "%d,%d", TrackerCast(sector[sectnum].hitag),
sector[sectnum].lotag); TrackerCast(sector[sectnum].lotag));
} }
return tempbuf; return tempbuf;
} }
@ -2270,8 +2270,8 @@ ExtGetWallCaption(short wallnum)
} }
else else
{ {
sprintf(tempbuf, "%d,%d", wall[wallnum].hitag, sprintf(tempbuf, "%d,%d", TrackerCast(wall[wallnum].hitag),
wall[wallnum].lotag); TrackerCast(wall[wallnum].lotag));
} }
return tempbuf; return tempbuf;
} }
@ -2664,7 +2664,7 @@ ExtGetSpriteCaption(short spritenum)
//tempbuf[0] = NULL; //tempbuf[0] = NULL;
sprintf(tempbuf, "S:%d", data); sprintf(tempbuf, "S:%d", data);
else 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; break;
@ -2679,7 +2679,7 @@ ExtGetSpriteCaption(short spritenum)
sprintf(tempbuf, "S:%d,%s%s", data, p, multi_str); sprintf(tempbuf, "S:%d,%s%s", data, p, multi_str);
else else
// name and numbers - name only prints if not null string // 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; break;
@ -2971,10 +2971,10 @@ ExtEditSectorData(short sectnum) // F7
sprintf(tempbuf, "PicNum = %d", FindPicNum); sprintf(tempbuf, "PicNum = %d", FindPicNum);
printext16(8, ydim16+32 + 16, 11, -1, tempbuf, 0); 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); 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); printext16(8, ydim16+32 + 32, 11, -1, tempbuf, 0);
FindNextSprite(FindPicNum); FindNextSprite(FindPicNum);

View file

@ -402,8 +402,8 @@ JS_InitMirrors(void)
if (!Found_Cam) if (!Found_Cam)
{ {
printf("Cound not find the camera view sprite for match %d\n",wall[i].hitag); printf("Cound not find the camera view sprite for match %d\n",TrackerCast(wall[i].hitag));
printf("Map Coordinates: x = %d, y = %d\n",wall[i].x,wall[i].y); printf("Map Coordinates: x = %d, y = %d\n",TrackerCast(wall[i].x),TrackerCast(wall[i].y));
exit(0); exit(0);
} }
@ -429,8 +429,8 @@ JS_InitMirrors(void)
if (!Found_Cam) if (!Found_Cam)
{ {
printf("Did not find drawtotile for camera number %d\n",mirrorcnt); printf("Did not find drawtotile for camera number %d\n",mirrorcnt);
printf("wall[%d].hitag == %d\n",i,wall[i].hitag); printf("wall[%d].hitag == %d\n",i,TrackerCast(wall[i].hitag));
printf("Map Coordinates: x = %d, y = %d\n",wall[i].x,wall[i].y); printf("Map Coordinates: x = %d, y = %d\n", TrackerCast(wall[i].x), TrackerCast(wall[i].y));
exit(0); exit(0);
} }
} }
@ -1233,16 +1233,16 @@ JS_PlockError(short wall_num, short t)
switch (t) switch (t)
{ {
case 1: 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; break;
case 2: 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; break;
case 3: 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; break;
case 4: 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; break;
} }
exit(0); exit(0);

View file

@ -2006,7 +2006,7 @@ DumpSounds(void)
if (vp->owner >= 0) if (vp->owner >= 0)
{ {
SPRITEp sp = &sprite[vp->owner]; 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); DebugWriteString(ds);
} }
vp = vp->next; vp = vp->next;

View file

@ -2882,7 +2882,7 @@ SpriteSetup(void)
if (sprite[i].hitag == sp->hitag && sprite[i].lotag == sp->lotag) if (sprite[i].hitag == sp->hitag && sprite[i].lotag == sp->lotag)
{ {
TerminateGame(); 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); exit(0);
} }
} }