From 52dde4ef32d0748c389cca81af69f4a5491b8aa3 Mon Sep 17 00:00:00 2001 From: terminx Date: Sun, 19 May 2019 03:54:40 +0000 Subject: [PATCH] Rename Gv_SetVarX() to Gv_SetVar() (overloaded) git-svn-id: https://svn.eduke32.com/eduke32@7653 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gameexec.cpp | 206 +++++++++++------------ source/duke3d/src/gamevars.cpp | 2 +- source/duke3d/src/gamevars.h | 2 +- source/duke3d/src/m32exec.cpp | 246 ++++++++++++++-------------- source/duke3d/src/m32structures.cpp | 8 +- source/duke3d/src/m32vars.cpp | 2 +- 6 files changed, 233 insertions(+), 233 deletions(-) diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index c82891391..b81aacb58 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -1898,7 +1898,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) if ((aGameVars[tw].flags & (GAMEVAR_USER_MASK | GAMEVAR_PTR_MASK)) == 0) aGameVars[tw].global = nValue; else - Gv_SetVarX(tw, nValue); + Gv_SetVar(tw, nValue); } dispatch(); @@ -2177,7 +2177,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) vInstruction(CON_SETVAR): insptr++; - Gv_SetVarX(*insptr, insptr[1]); + Gv_SetVar(*insptr, insptr[1]); insptr += 2; dispatch(); @@ -2256,7 +2256,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) vInstruction(CON_RANDVAR): insptr++; - Gv_SetVarX(*insptr, mulscale16(krand(), insptr[1] + 1)); + Gv_SetVar(*insptr, mulscale16(krand(), insptr[1] + 1)); insptr += 2; dispatch(); @@ -2283,7 +2283,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) vInstruction(CON_RANDVARVAR): insptr++; tw = *insptr++; - Gv_SetVarX(tw, mulscale16(krand(), Gv_GetVar(*insptr++) + 1)); + Gv_SetVar(tw, mulscale16(krand(), Gv_GetVar(*insptr++) + 1)); dispatch(); vInstruction(CON_SETPLAYER): @@ -2304,7 +2304,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) int const labelNum = *insptr++; int const lParm2 = (PlayerLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVar(*insptr++) : 0; - Gv_SetVarX(*insptr++, VM_GetPlayer(playerNum, labelNum, lParm2)); + Gv_SetVar(*insptr++, VM_GetPlayer(playerNum, labelNum, lParm2)); dispatch(); } vInstruction(CON_SETWALL): @@ -2337,7 +2337,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) int const labelNum = *insptr++; auto const &wallLabel = WallLabels[labelNum]; - Gv_SetVarX(*insptr++, + Gv_SetVar(*insptr++, (wallLabel.offset != -1 && (wallLabel.flags & LABEL_READFUNC) != LABEL_READFUNC) ? VM_GetStruct(wallLabel.flags, (intptr_t *)((char *)&wall[wallNum] + wallLabel.offset)) : VM_GetWall(wallNum, labelNum)); @@ -2358,7 +2358,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) if (tw == CON_SETACTORVAR) Gv_SetVar(lVar1, Gv_GetVar(lVar2), lSprite, vm.playerNum); else - Gv_SetVarX(lVar2, Gv_GetVar(lVar1, lSprite, vm.playerNum)); + Gv_SetVar(lVar2, Gv_GetVar(lVar1, lSprite, vm.playerNum)); dispatch(); } @@ -2376,7 +2376,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) if (tw == CON_SETPLAYERVAR) Gv_SetVar(lVar1, Gv_GetVar(lVar2), vm.spriteNum, playerNum); else - Gv_SetVarX(lVar2, Gv_GetVar(lVar1, vm.spriteNum, playerNum)); + Gv_SetVar(lVar2, Gv_GetVar(lVar1, vm.spriteNum, playerNum)); dispatch(); } @@ -2415,7 +2415,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) abort_after_error(); } - Gv_SetVarX(*insptr++, VM_GetSprite(spriteNum, labelNum, lParm2)); + Gv_SetVar(*insptr++, VM_GetSprite(spriteNum, labelNum, lParm2)); dispatch(); } @@ -2441,7 +2441,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) VM_ASSERT((unsigned)spriteNum < MAXSPRITES, "invalid sprite %d\n", spriteNum); - Gv_SetVarX(*insptr++, VM_GetStruct(actorLabel.flags, (intptr_t *)((char *)&actor[spriteNum] + actorLabel.offset))); + Gv_SetVar(*insptr++, VM_GetStruct(actorLabel.flags, (intptr_t *)((char *)&actor[spriteNum] + actorLabel.offset))); dispatch(); } @@ -2467,7 +2467,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) VM_ASSERT((unsigned)spriteNum < MAXSPRITES, "invalid sprite %d\n", spriteNum); - Gv_SetVarX(*insptr++, VM_GetStruct(spriteLabel.flags, (intptr_t *)((char *)&sprite[spriteNum] + spriteLabel.offset))); + Gv_SetVar(*insptr++, VM_GetStruct(spriteLabel.flags, (intptr_t *)((char *)&sprite[spriteNum] + spriteLabel.offset))); dispatch(); } vInstruction(CON_SETSPRITEEXT): @@ -2492,7 +2492,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) VM_ASSERT((unsigned)spriteNum < MAXSPRITES, "invalid sprite %d\n", spriteNum); - Gv_SetVarX(*insptr++, VM_GetStruct(spriteExtLabel.flags, (intptr_t *)((char *)&spriteext[spriteNum] + spriteExtLabel.offset))); + Gv_SetVar(*insptr++, VM_GetStruct(spriteExtLabel.flags, (intptr_t *)((char *)&spriteext[spriteNum] + spriteExtLabel.offset))); dispatch(); } @@ -2514,7 +2514,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) int const labelNum = *insptr++; auto const &tsprLabel = TsprLabels[labelNum]; - Gv_SetVarX(*insptr++, VM_GetStruct(tsprLabel.flags, (intptr_t *)((char *)spriteext[spriteNum].tspr + tsprLabel.offset))); + Gv_SetVar(*insptr++, VM_GetStruct(tsprLabel.flags, (intptr_t *)((char *)spriteext[spriteNum].tspr + tsprLabel.offset))); dispatch(); } @@ -2543,7 +2543,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) int const labelNum = *insptr++; auto const §Label = SectorLabels[labelNum]; - Gv_SetVarX(*insptr++, + Gv_SetVar(*insptr++, (sectLabel.offset != -1 && (sectLabel.flags & LABEL_READFUNC) != LABEL_READFUNC) ? VM_GetStruct(sectLabel.flags, (intptr_t *)((char *)§or[sectNum] + sectLabel.offset)) : VM_GetSector(sectNum, labelNum)); @@ -2638,7 +2638,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) if (sprite[jj].statnum == MAXSTATUS) continue; - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); } @@ -2649,7 +2649,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) for (native_t jj = headspritestat[statNum]; jj >= 0;) { int const kk = nextspritestat[jj]; - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); jj = kk; @@ -2662,7 +2662,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) for (native_t jj = headspritesect[sectNum]; jj >= 0;) { int const kk = nextspritesect[jj]; - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); jj = kk; @@ -2672,7 +2672,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) case ITER_ALLSECTORS: for (native_t jj = 0; jj < numsectors; ++jj) { - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); } @@ -2680,7 +2680,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) case ITER_ALLWALLS: for (native_t jj = 0; jj < numwalls; ++jj) { - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); } @@ -2692,7 +2692,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) if (!prlights[jj].flags.active) continue; - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); } @@ -2703,7 +2703,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) { for (native_t ii = 0; ii < spritesortcnt; ii++) { - Gv_SetVarX(returnVar, ii); + Gv_SetVar(returnVar, ii); insptr = pNext; VM_Execute(); } @@ -2716,7 +2716,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) for (native_t jj = headspritesect[nIndex]; jj >= 0;) { int const kk = nextspritesect[jj]; - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); jj = kk; @@ -2728,7 +2728,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) for (native_t jj = headspritestat[nIndex]; jj >= 0;) { int const kk = nextspritestat[jj]; - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); jj = kk; @@ -2739,7 +2739,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) goto badindex; for (native_t jj = sector[nIndex].wallptr, endwall = jj + sector[nIndex].wallnum - 1; jj <= endwall; jj++) { - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); } @@ -2751,7 +2751,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) int jj = nIndex; do { - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); jj = wall[jj].point2; @@ -2761,7 +2761,7 @@ GAMEEXEC_STATIC void VM_Execute(bool const loop /*= false*/) case ITER_RANGE: for (native_t jj = 0; jj < nIndex; jj++) { - Gv_SetVarX(returnVar, jj); + Gv_SetVar(returnVar, jj); insptr = pNext; VM_Execute(); } @@ -2792,7 +2792,7 @@ badindex: int const spriteNum = (tw != g_thisActorVarID) ? Gv_GetVar(tw) : vm.spriteNum; int const labelNum = *insptr++; - Gv_SetVarX(*insptr++, VM_GetActiveProjectile(spriteNum, labelNum)); + Gv_SetVar(*insptr++, VM_GetActiveProjectile(spriteNum, labelNum)); dispatch(); } @@ -3517,7 +3517,7 @@ badindex: int const nResult = cansee(sprite[nSprite1].x, sprite[nSprite1].y, sprite[nSprite1].z, sprite[nSprite1].sectnum, sprite[nSprite2].x, sprite[nSprite2].y, sprite[nSprite2].z, sprite[nSprite2].sectnum); - Gv_SetVarX(*insptr++, nResult); + Gv_SetVar(*insptr++, nResult); dispatch(); } @@ -3549,7 +3549,7 @@ badindex: VM_ASSERT((unsigned)quoteNum < MAXQUOTES && apStrings[quoteNum], "invalid quote %d\n", quoteNum); - Gv_SetVarX(gameVar, Bstrlen(apStrings[quoteNum])); + Gv_SetVar(gameVar, Bstrlen(apStrings[quoteNum])); dispatch(); } @@ -3580,8 +3580,8 @@ badindex: v.offset.x, v.offset.y, v.between.x, v.between.y, v.f, v.bound[0].x, v.bound[0].y, v.bound[1].x, v.bound[1].y); - Gv_SetVarX(widthVar, dim.x); - Gv_SetVarX(heightVar, dim.y); + Gv_SetVar(widthVar, dim.x); + Gv_SetVar(heightVar, dim.y); } dispatch(); } @@ -3598,7 +3598,7 @@ badindex: abort_after_error(); } - Gv_SetVarX(gameVar, headspritestat[statNum]); + Gv_SetVar(gameVar, headspritestat[statNum]); dispatch(); } @@ -3610,7 +3610,7 @@ badindex: VM_ASSERT((unsigned)spriteNum < MAXSPRITES, "invalid sprite %d\n", spriteNum); - Gv_SetVarX(gameVar, prevspritestat[spriteNum]); + Gv_SetVar(gameVar, prevspritestat[spriteNum]); dispatch(); } @@ -3622,7 +3622,7 @@ badindex: VM_ASSERT((unsigned)spriteNum < MAXSPRITES, "invalid sprite %d\n", spriteNum); - Gv_SetVarX(gameVar, nextspritestat[spriteNum]); + Gv_SetVar(gameVar, nextspritestat[spriteNum]); dispatch(); } @@ -3634,7 +3634,7 @@ badindex: VM_ASSERT((unsigned)sectNum < MAXSECTORS, "invalid sector %d\n", sectNum); - Gv_SetVarX(gameVar, headspritesect[sectNum]); + Gv_SetVar(gameVar, headspritesect[sectNum]); dispatch(); } @@ -3646,7 +3646,7 @@ badindex: VM_ASSERT((unsigned)spriteNum < MAXSPRITES, "invalid sprite %d\n", spriteNum); - Gv_SetVarX(gameVar, prevspritesect[spriteNum]); + Gv_SetVar(gameVar, prevspritesect[spriteNum]); dispatch(); } @@ -3658,7 +3658,7 @@ badindex: VM_ASSERT((unsigned)spriteNum < MAXSPRITES, "invalid sprite %d\n", spriteNum); - Gv_SetVarX(gameVar, nextspritesect[spriteNum]); + Gv_SetVar(gameVar, nextspritesect[spriteNum]); dispatch(); } @@ -3745,7 +3745,7 @@ badindex: abort_after_error(); } - Gv_SetVarX(gameVar, strcmp(apStrings[quote1], apStrings[quote2])); + Gv_SetVar(gameVar, strcmp(apStrings[quote1], apStrings[quote2])); dispatch(); } @@ -3971,7 +3971,7 @@ badindex: vInstruction(CON_DISPLAYRAND): insptr++; - Gv_SetVarX(*insptr++, system_15bit_rand()); + Gv_SetVar(*insptr++, system_15bit_rand()); dispatch(); vInstruction(CON_DRAGPOINT): @@ -4005,7 +4005,7 @@ badindex: abort_after_error(); } - Gv_SetVarX(out, (tw == CON_LDIST ? ldist : dist)(&sprite[in.x], &sprite[in.y])); + Gv_SetVar(out, (tw == CON_LDIST ? ldist : dist)(&sprite[in.x], &sprite[in.y])); dispatch(); } @@ -4016,7 +4016,7 @@ badindex: int const out = *insptr++; vec2_t in; Gv_FillWithVars(in); - Gv_SetVarX(out, (tw == CON_GETANGLE ? getangle : G_GetAngleDelta)(in.x, in.y)); + Gv_SetVar(out, (tw == CON_GETANGLE ? getangle : G_GetAngleDelta)(in.x, in.y)); dispatch(); } @@ -4029,9 +4029,9 @@ badindex: Gv_FillWithVars(in); if (tw == CON_MULSCALE) - Gv_SetVarX(out, mulscale(in.x, in.y, in.z)); + Gv_SetVar(out, mulscale(in.x, in.y, in.z)); else - Gv_SetVarX(out, divscale(in.x, in.y, in.z)); + Gv_SetVar(out, divscale(in.x, in.y, in.z)); dispatch(); } @@ -4042,7 +4042,7 @@ badindex: int const out = *insptr++; vec3_t in; Gv_FillWithVars(in); - Gv_SetVarX(out, scale(in.x, in.y, in.z)); + Gv_SetVar(out, scale(in.x, in.y, in.z)); dispatch(); } @@ -4219,7 +4219,7 @@ badindex: break; case CON_READGAMEVAR: SCRIPT_GetNumber(ud.config.scripthandle, "Gamevars", aGameVars[*insptr].szLabel, &nValue); - Gv_SetVarX(*insptr++, nValue); + Gv_SetVar(*insptr++, nValue); break; } dispatch(); @@ -4422,10 +4422,10 @@ badindex: int32_t ceilz, ceilhit, florz, florhit; getzrange(&v.vect, v.sectNum, &ceilz, &ceilhit, &florz, &florhit, v2.walldist, v2.clipmask); - Gv_SetVarX(ceilzvar, ceilz); - Gv_SetVarX(ceilhitvar, ceilhit); - Gv_SetVarX(florzvar, florz); - Gv_SetVarX(florhitvar, florhit); + Gv_SetVar(ceilzvar, ceilz); + Gv_SetVar(ceilhitvar, ceilhit); + Gv_SetVar(florzvar, florz); + Gv_SetVar(florhitvar, florhit); dispatch(); } @@ -4454,7 +4454,7 @@ badindex: Gv_FillWithVars(da); int64_t const hypsq = (int64_t)da.x * da.x + (int64_t)da.y * da.y; - Gv_SetVarX(returnVar, (hypsq > (int64_t)INT32_MAX) ? (int32_t)sqrt((double)hypsq) : ksqrt((uint32_t)hypsq)); + Gv_SetVar(returnVar, (hypsq > (int64_t)INT32_MAX) ? (int32_t)sqrt((double)hypsq) : ksqrt((uint32_t)hypsq)); dispatch(); } @@ -4479,13 +4479,13 @@ badindex: v.vec[1].z, v.vec2[0].x, v.vec2[0].y, v.vec2[1].x, v.vec2[1].y, &in.x, &in.y, &in.z); - Gv_SetVarX(retvar, ret); + Gv_SetVar(retvar, ret); if (ret) { - Gv_SetVarX(intxvar, in.x); - Gv_SetVarX(intyvar, in.y); - Gv_SetVarX(intzvar, in.z); + Gv_SetVar(intxvar, in.x); + Gv_SetVar(intyvar, in.y); + Gv_SetVar(intzvar, in.z); } dispatch(); @@ -4523,12 +4523,12 @@ badindex: VM_ASSERT((unsigned)sectNum < MAXSECTORS, "invalid sector %d\n", sectNum); - Gv_SetVarX( + Gv_SetVar( returnVar, clipmovex(&v.vec3, §Num, v.vec2.x, v.vec2.y, v.dist.w, v.dist.f, v.dist.c, v.clipMask, (tw == CON_CLIPMOVENOSLIDE))); - Gv_SetVarX(sectReturn, v.sectNum32); - Gv_SetVarX(xReturn, v.vec3.x); - Gv_SetVarX(yReturn, v.vec3.y); + Gv_SetVar(sectReturn, v.sectNum32); + Gv_SetVar(xReturn, v.vec3.x); + Gv_SetVar(yReturn, v.vec3.y); dispatch(); } @@ -4557,12 +4557,12 @@ badindex: hitdata_t hit; hitscan(&v.origin, v.sectnum, v.vect.x, v.vect.y, v.vect.z, &hit, clipType); - Gv_SetVarX(sectReturn, hit.sect); - Gv_SetVarX(wallReturn, hit.wall); - Gv_SetVarX(spriteReturn, hit.sprite); - Gv_SetVarX(xReturn, hit.pos.x); - Gv_SetVarX(yReturn, hit.pos.y); - Gv_SetVarX(zReturn, hit.pos.z); + Gv_SetVar(sectReturn, hit.sect); + Gv_SetVar(wallReturn, hit.wall); + Gv_SetVar(spriteReturn, hit.sprite); + Gv_SetVar(xReturn, hit.pos.x); + Gv_SetVar(yReturn, hit.pos.y); + Gv_SetVar(zReturn, hit.pos.z); dispatch(); } @@ -4586,7 +4586,7 @@ badindex: abort_after_error(); } - Gv_SetVarX(returnVar, cansee(v.vec1.x, v.vec1.y, v.vec1.z, v.firstSector, v.vec2.x, v.vec2.y, v.vec2.z, v.secondSector)); + Gv_SetVar(returnVar, cansee(v.vec1.x, v.vec1.y, v.vec1.z, v.firstSector, v.vec2.x, v.vec2.y, v.vec2.z, v.secondSector)); dispatch(); } @@ -4606,8 +4606,8 @@ badindex: rotatepoint(v.point[0], v.point[1], v.angle, &result); - Gv_SetVarX(xReturn, result.x); - Gv_SetVarX(yReturn, result.y); + Gv_SetVar(xReturn, result.x); + Gv_SetVar(yReturn, result.y); dispatch(); } @@ -4648,10 +4648,10 @@ badindex: neartag(v.point.x, v.point.y, v.point.z, v.sectNum, v.nAngle, &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, v2.tagRange, v2.tagSearch, NULL); - Gv_SetVarX(sectReturn, neartagsector); - Gv_SetVarX(wallReturn, neartagwall); - Gv_SetVarX(spriteReturn, neartagsprite); - Gv_SetVarX(distReturn, neartaghitdist); + Gv_SetVar(sectReturn, neartagsector); + Gv_SetVar(wallReturn, neartagwall); + Gv_SetVar(spriteReturn, neartagsprite); + Gv_SetVar(distReturn, neartaghitdist); dispatch(); } @@ -4662,7 +4662,7 @@ badindex: G_GetTimeDate(values); for (int value : values) - Gv_SetVarX(*insptr++, value); + Gv_SetVar(*insptr++, value); dispatch(); } @@ -4680,7 +4680,7 @@ badindex: VM_ASSERT((unsigned)v.spriteNum < MAXSPRITES, "invalid sprite %d\n", v.spriteNum); - Gv_SetVarX(*insptr++, A_MoveSprite(v.spriteNum, &v.vect, v.clipType)); + Gv_SetVar(*insptr++, A_MoveSprite(v.spriteNum, &v.vect, v.clipType)); dispatch(); } @@ -4713,7 +4713,7 @@ badindex: VM_ASSERT((unsigned)v.sectNum < MAXSECTORS, "invalid sector %d\n", v.sectNum); - Gv_SetVarX(*insptr++, (tw == CON_GETFLORZOFSLOPE ? getflorzofslope : getceilzofslope)(v.sectNum, v.vect.x, v.vect.y)); + Gv_SetVar(*insptr++, (tw == CON_GETFLORZOFSLOPE ? getflorzofslope : getceilzofslope)(v.sectNum, v.vect.x, v.vect.y)); dispatch(); } @@ -4730,7 +4730,7 @@ badindex: sectNum = vm.pSprite->sectnum; updatesector(vect.x, vect.y, §Num); - Gv_SetVarX(returnVar, sectNum); + Gv_SetVar(returnVar, sectNum); dispatch(); } @@ -4747,7 +4747,7 @@ badindex: sectNum = vm.pSprite->sectnum; updatesectorz(vect.x, vect.y, vect.z, §Num); - Gv_SetVarX(returnVar, sectNum); + Gv_SetVar(returnVar, sectNum); dispatch(); } @@ -5032,7 +5032,7 @@ badindex: vInstruction(CON_SECTOROFWALL): insptr++; tw = *insptr++; - Gv_SetVarX(tw, sectorofwall(Gv_GetVar(*insptr++))); + Gv_SetVar(tw, sectorofwall(Gv_GetVar(*insptr++))); dispatch(); vInstruction(CON_QSPRINTF): @@ -5227,7 +5227,7 @@ badindex: { // syntax sqrt int const sqrtval = ksqrt((uint32_t)Gv_GetVar(*insptr++)); - Gv_SetVarX(*insptr++, sqrtval); + Gv_SetVar(*insptr++, sqrtval); dispatch(); } @@ -5277,7 +5277,7 @@ badindex: } while (findStatnum--); - Gv_SetVarX(returnVar, foundSprite); + Gv_SetVar(returnVar, foundSprite); dispatch(); } @@ -5325,7 +5325,7 @@ badindex: } while (findStatnum--); - Gv_SetVarX(returnVar, foundSprite); + Gv_SetVar(returnVar, foundSprite); dispatch(); } @@ -5334,7 +5334,7 @@ badindex: int32_t tw; insptr++; aGameVars[g_returnVarID].global = A_FindPlayer(vm.pSprite, &tw); - Gv_SetVarX(*insptr++, tw); + Gv_SetVar(*insptr++, tw); dispatch(); } @@ -5343,7 +5343,7 @@ badindex: int32_t tw; insptr++; aGameVars[g_returnVarID].global = P_FindOtherPlayer(vm.playerNum, &tw); - Gv_SetVarX(*insptr++, tw); + Gv_SetVar(*insptr++, tw); dispatch(); } @@ -5354,7 +5354,7 @@ badindex: int const playerNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVar(insptr[-1]) : vm.playerNum; int const labelNum = *insptr++; - Gv_SetVarX(*insptr++, VM_GetPlayerInput(playerNum, labelNum)); + Gv_SetVar(*insptr++, VM_GetPlayerInput(playerNum, labelNum)); dispatch(); } @@ -5374,7 +5374,7 @@ badindex: int const labelNum = *insptr++; int const lParm2 = (UserdefsLabels[labelNum].flags & LABEL_HASPARM2) ? Gv_GetVar(*insptr++) : 0; - Gv_SetVarX(*insptr++, VM_GetUserdef(labelNum, lParm2)); + Gv_SetVar(*insptr++, VM_GetUserdef(labelNum, lParm2)); dispatch(); } @@ -5384,7 +5384,7 @@ badindex: int const tileNum = (*insptr++ != g_thisActorVarID) ? Gv_GetVar(insptr[-1]) : vm.pSprite->picnum; int const labelNum = *insptr++; - Gv_SetVarX(*insptr++, VM_GetTileData(tileNum, labelNum)); + Gv_SetVar(*insptr++, VM_GetTileData(tileNum, labelNum)); dispatch(); } @@ -5413,7 +5413,7 @@ badindex: { tw = Gv_GetVar(*insptr++); int const labelNum = *insptr++; - Gv_SetVarX(*insptr++, VM_GetProjectile(tw, labelNum)); + Gv_SetVar(*insptr++, VM_GetProjectile(tw, labelNum)); dispatch(); } @@ -5429,7 +5429,7 @@ badindex: vInstruction(CON_GETANGLETOTARGET): insptr++; // vm.pActor->lastvx and lastvy are last known location of target. - Gv_SetVarX(*insptr++, getangle(vm.pActor->lastv.x - vm.pSprite->x, vm.pActor->lastv.y - vm.pSprite->y)); + Gv_SetVar(*insptr++, getangle(vm.pActor->lastv.x - vm.pSprite->x, vm.pActor->lastv.y - vm.pSprite->y)); dispatch(); vInstruction(CON_ANGOFF): @@ -5460,12 +5460,12 @@ badindex: vInstruction(CON_GETPLAYERANGLE): insptr++; - Gv_SetVarX(*insptr++, fix16_to_int(vm.pPlayer->q16ang)); + Gv_SetVar(*insptr++, fix16_to_int(vm.pPlayer->q16ang)); dispatch(); vInstruction(CON_GETACTORANGLE): insptr++; - Gv_SetVarX(*insptr++, vm.pSprite->ang); + Gv_SetVar(*insptr++, vm.pSprite->ang); dispatch(); vInstruction(CON_SETPLAYERANGLE): @@ -5482,7 +5482,7 @@ badindex: if ((aGameVars[insptr[1]].flags & (GAMEVAR_USER_MASK | GAMEVAR_PTR_MASK)) == 0) aGameVars[insptr[1]].global = klabs(aGameVars[insptr[1]].global); else - Gv_SetVarX(insptr[1], klabs(Gv_GetVar(insptr[1]))); + Gv_SetVar(insptr[1], klabs(Gv_GetVar(insptr[1]))); insptr += 2; dispatch(); @@ -5651,7 +5651,7 @@ badindex: vInstruction(CON_GETARRAYSIZE): insptr++; tw = *insptr++; - Gv_SetVarX(*insptr++, (aGameArrays[tw].flags & GAMEARRAY_VARSIZE) ? Gv_GetVar(aGameArrays[tw].size) : aGameArrays[tw].size); + Gv_SetVar(*insptr++, (aGameArrays[tw].flags & GAMEARRAY_VARSIZE) ? Gv_GetVar(aGameArrays[tw].size) : aGameArrays[tw].size); dispatch(); vInstruction(CON_RESIZEARRAY): @@ -5802,7 +5802,7 @@ badindex: vInstruction(CON_DISPLAYRANDVAR): insptr++; - Gv_SetVarX(*insptr, mulscale15(system_15bit_rand(), insptr[1] + 1)); + Gv_SetVar(*insptr, mulscale15(system_15bit_rand(), insptr[1] + 1)); insptr += 2; dispatch(); @@ -5811,7 +5811,7 @@ badindex: { tw = *insptr++; int const min = Gv_GetVar(*insptr++); - Gv_SetVarX(tw, clamp2(Gv_GetVar(tw), min, Gv_GetVar(*insptr++))); + Gv_SetVar(tw, clamp2(Gv_GetVar(tw), min, Gv_GetVar(*insptr++))); } dispatch(); @@ -5820,7 +5820,7 @@ badindex: { tw = *insptr++; int32_t const rgb = Gv_GetVar(*insptr++); - Gv_SetVarX(tw, getclosestcol_lim(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF, Gv_GetVar(*insptr++))); + Gv_SetVar(tw, getclosestcol_lim(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF, Gv_GetVar(*insptr++))); } dispatch(); @@ -5861,14 +5861,14 @@ badindex: if ((aGameVars[insptr[1]].flags & (GAMEVAR_USER_MASK | GAMEVAR_PTR_MASK)) == 0) aGameVars[insptr[1]].global = -aGameVars[insptr[1]].global; else - Gv_SetVarX(insptr[1], -Gv_GetVar(insptr[1])); + Gv_SetVar(insptr[1], -Gv_GetVar(insptr[1])); insptr += 2; dispatch(); vInstruction(CON_DISPLAYRANDVARVAR): insptr++; tw = *insptr++; - Gv_SetVarX(tw, mulscale15(system_15bit_rand(), Gv_GetVar(*insptr++) + 1)); + Gv_SetVar(tw, mulscale15(system_15bit_rand(), Gv_GetVar(*insptr++) + 1)); dispatch(); vInstruction(CON_GMAXAMMO): @@ -5879,7 +5879,7 @@ badindex: CON_ERRPRINTF("invalid weapon %d\n", (int)tw); abort_after_error(); } - Gv_SetVarX(*insptr++, vm.pPlayer->max_ammo_amount[tw]); + Gv_SetVar(*insptr++, vm.pPlayer->max_ammo_amount[tw]); dispatch(); vInstruction(CON_SMAXAMMO): @@ -5908,7 +5908,7 @@ badindex: abort_after_error(); } - Gv_SetVarX(tw, tabledivide32((dividend + ksgn(dividend) * klabs(divisor / 2)), divisor)); + Gv_SetVar(tw, tabledivide32((dividend + ksgn(dividend) * klabs(divisor / 2)), divisor)); dispatch(); } @@ -5926,20 +5926,20 @@ badindex: abort_after_error(); } - Gv_SetVarX(tw, tabledivide32((dividend + ksgn(dividend) * klabs(divisor) + 1), divisor)); + Gv_SetVar(tw, tabledivide32((dividend + ksgn(dividend) * klabs(divisor) + 1), divisor)); dispatch(); } vInstruction(CON_SIN): insptr++; tw = *insptr++; - Gv_SetVarX(tw, sintable[Gv_GetVar(*insptr++) & 2047]); + Gv_SetVar(tw, sintable[Gv_GetVar(*insptr++) & 2047]); dispatch(); vInstruction(CON_COS): insptr++; tw = *insptr++; - Gv_SetVarX(tw, sintable[(Gv_GetVar(*insptr++) + 512) & 2047]); + Gv_SetVar(tw, sintable[(Gv_GetVar(*insptr++) + 512) & 2047]); dispatch(); @@ -6195,13 +6195,13 @@ badindex: vInstruction(CON_GETTICKS): insptr++; - Gv_SetVarX(*insptr++, timerGetTicks()); + Gv_SetVar(*insptr++, timerGetTicks()); dispatch(); vInstruction(CON_GETCURRADDRESS): insptr++; tw = *insptr++; - Gv_SetVarX(tw, (intptr_t)(insptr - apScript)); + Gv_SetVar(tw, (intptr_t)(insptr - apScript)); dispatch(); vmErrorCase: // you're not supposed to be here diff --git a/source/duke3d/src/gamevars.cpp b/source/duke3d/src/gamevars.cpp index f1814bbc3..d34a55460 100644 --- a/source/duke3d/src/gamevars.cpp +++ b/source/duke3d/src/gamevars.cpp @@ -838,7 +838,7 @@ badindex: (var.flags & GAMEVAR_PERACTOR) ? spriteNum : playerNum, vm.spriteNum, vm.playerNum); } -void __fastcall Gv_SetVarX(int const gameVar, int const newValue) { Gv_SetVar__(gameVar, newValue, vm.spriteNum, vm.playerNum); } +void __fastcall Gv_SetVar(int const gameVar, int const newValue) { Gv_SetVar__(gameVar, newValue, vm.spriteNum, vm.playerNum); } void __fastcall Gv_SetVar(int const gameVar, int const newValue, int const spriteNum, int const playerNum) { Gv_SetVar__(gameVar, newValue, spriteNum, playerNum); diff --git a/source/duke3d/src/gamevars.h b/source/duke3d/src/gamevars.h index 82a8d8417..34dd7d999 100644 --- a/source/duke3d/src/gamevars.h +++ b/source/duke3d/src/gamevars.h @@ -125,7 +125,7 @@ int __fastcall Gv_GetVar(int gameVar, int spriteNum, int playerNum); void __fastcall Gv_SetVar(int const gameVar, int const newValue, int const spriteNum, int const playerNum); int __fastcall Gv_GetVar(int gameVar); void __fastcall Gv_GetManyVars(int const numVars, int32_t * const outBuf); -void __fastcall Gv_SetVarX(int const gameVar, int const newValue); +void __fastcall Gv_SetVar(int const gameVar, int const newValue); template static FORCE_INLINE void Gv_FillWithVars(T & rv) diff --git a/source/duke3d/src/m32exec.cpp b/source/duke3d/src/m32exec.cpp index 6f99b3b21..7b2187ee0 100644 --- a/source/duke3d/src/m32exec.cpp +++ b/source/duke3d/src/m32exec.cpp @@ -455,7 +455,7 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, insptr-apScript); + Gv_SetVar(j, insptr-apScript); } continue; @@ -512,7 +512,7 @@ skip_check: if (CheckArray(j)) continue; - Gv_SetVarX(*insptr++, Gv_GetArraySize(j)); + Gv_SetVar(*insptr++, Gv_GetArraySize(j)); } continue; @@ -605,19 +605,19 @@ skip_check: // *** var & varvar ops case CON_RANDVAR: insptr++; - Gv_SetVarX(*insptr, mulscale16(krand(), *(insptr+1)+1)); + Gv_SetVar(*insptr, mulscale16(krand(), *(insptr+1)+1)); insptr += 2; continue; case CON_DISPLAYRANDVAR: insptr++; - Gv_SetVarX(*insptr, mulscale15(system_15bit_rand(), *(insptr+1)+1)); + Gv_SetVar(*insptr, mulscale15(system_15bit_rand(), *(insptr+1)+1)); insptr += 2; continue; case CON_SETVAR: insptr++; - Gv_SetVarX(*insptr, *(insptr+1)); + Gv_SetVar(*insptr, *(insptr+1)); insptr += 2; continue; @@ -625,13 +625,13 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(*insptr++)); } continue; case CON_MULVAR: insptr++; - Gv_SetVarX(*insptr, Gv_GetVar(*insptr) * *(insptr+1)); + Gv_SetVar(*insptr, Gv_GetVar(*insptr) * *(insptr+1)); insptr += 2; continue; @@ -643,7 +643,7 @@ skip_check: insptr += 2; continue; } - Gv_SetVarX(*insptr, Gv_GetVar(*insptr) / *(insptr+1)); + Gv_SetVar(*insptr, Gv_GetVar(*insptr) / *(insptr+1)); insptr += 2; continue; @@ -655,25 +655,25 @@ skip_check: insptr += 2; continue; } - Gv_SetVarX(*insptr,Gv_GetVar(*insptr)%*(insptr+1)); + Gv_SetVar(*insptr,Gv_GetVar(*insptr)%*(insptr+1)); insptr += 2; continue; case CON_ANDVAR: insptr++; - Gv_SetVarX(*insptr,Gv_GetVar(*insptr) & *(insptr+1)); + Gv_SetVar(*insptr,Gv_GetVar(*insptr) & *(insptr+1)); insptr += 2; continue; case CON_ORVAR: insptr++; - Gv_SetVarX(*insptr,Gv_GetVar(*insptr) | *(insptr+1)); + Gv_SetVar(*insptr,Gv_GetVar(*insptr) | *(insptr+1)); insptr += 2; continue; case CON_XORVAR: insptr++; - Gv_SetVarX(*insptr,Gv_GetVar(*insptr) ^ *(insptr+1)); + Gv_SetVar(*insptr,Gv_GetVar(*insptr) ^ *(insptr+1)); insptr += 2; continue; @@ -681,7 +681,7 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j,mulscale16(krand(), Gv_GetVar(*insptr++)+1)); + Gv_SetVar(j,mulscale16(krand(), Gv_GetVar(*insptr++)+1)); } continue; @@ -689,7 +689,7 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j,mulscale15(system_15bit_rand(), Gv_GetVar(*insptr++)+1)); + Gv_SetVar(j,mulscale15(system_15bit_rand(), Gv_GetVar(*insptr++)+1)); } continue; @@ -697,7 +697,7 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(j)*Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(j)*Gv_GetVar(*insptr++)); } continue; @@ -712,7 +712,7 @@ skip_check: M32_ERROR("Divide by zero."); continue; } - Gv_SetVarX(j, Gv_GetVar(j)/l2); + Gv_SetVar(j, Gv_GetVar(j)/l2); continue; } @@ -728,7 +728,7 @@ skip_check: continue; } - Gv_SetVarX(j, Gv_GetVar(j) % l2); + Gv_SetVar(j, Gv_GetVar(j) % l2); continue; } @@ -736,7 +736,7 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(j) & Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(j) & Gv_GetVar(*insptr++)); } continue; @@ -744,7 +744,7 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(j) ^ Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(j) ^ Gv_GetVar(*insptr++)); } continue; @@ -752,13 +752,13 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(j) | Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(j) | Gv_GetVar(*insptr++)); } continue; case CON_SUBVAR: insptr++; - Gv_SetVarX(*insptr, Gv_GetVar(*insptr) - *(insptr+1)); + Gv_SetVar(*insptr, Gv_GetVar(*insptr) - *(insptr+1)); insptr += 2; continue; @@ -766,13 +766,13 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(j) - Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(j) - Gv_GetVar(*insptr++)); } continue; case CON_ADDVAR: insptr++; - Gv_SetVarX(*insptr, Gv_GetVar(*insptr) + *(insptr+1)); + Gv_SetVar(*insptr, Gv_GetVar(*insptr) + *(insptr+1)); insptr += 2; continue; @@ -780,13 +780,13 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(j) + Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(j) + Gv_GetVar(*insptr++)); } continue; case CON_SHIFTVARL: insptr++; - Gv_SetVarX(*insptr, Gv_GetVar(*insptr) << *(insptr+1)); + Gv_SetVar(*insptr, Gv_GetVar(*insptr) << *(insptr+1)); insptr += 2; continue; @@ -794,13 +794,13 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(j) << Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(j) << Gv_GetVar(*insptr++)); } continue; case CON_SHIFTVARR: insptr++; - Gv_SetVarX(*insptr, Gv_GetVar(*insptr) >> *(insptr+1)); + Gv_SetVar(*insptr, Gv_GetVar(*insptr) >> *(insptr+1)); insptr += 2; continue; @@ -808,25 +808,25 @@ skip_check: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, Gv_GetVar(j) >> Gv_GetVar(*insptr++)); + Gv_SetVar(j, Gv_GetVar(j) >> Gv_GetVar(*insptr++)); } continue; case CON_SIN: insptr++; - Gv_SetVarX(*insptr, sintable[Gv_GetVar(*(insptr+1))&2047]); + Gv_SetVar(*insptr, sintable[Gv_GetVar(*(insptr+1))&2047]); insptr += 2; continue; case CON_COS: insptr++; - Gv_SetVarX(*insptr, sintable[(Gv_GetVar(*(insptr+1))+512)&2047]); + Gv_SetVar(*insptr, sintable[(Gv_GetVar(*(insptr+1))+512)&2047]); insptr += 2; continue; case CON_DISPLAYRAND: insptr++; - Gv_SetVarX(*insptr++, system_15bit_rand()); + Gv_SetVar(*insptr++, system_15bit_rand()); continue; // *** other math @@ -839,7 +839,7 @@ skip_check: int32_t const scale=*(insptr+1); // rounding must absolutely be! //OSD_Printf("ftoi: bits:%8x, scale=%d, fval=%f, (int32_t)(fval*scale)=%d\n", bits, scale, fval, (int32_t)(fval*scale)); - Gv_SetVarX(*insptr, (int32_t)Blrintf(fval * scale)); + Gv_SetVar(*insptr, (int32_t)Blrintf(fval * scale)); } insptr += 2; continue; @@ -852,7 +852,7 @@ skip_check: ival=Gv_GetVar(*insptr); int32_t const scale=*(insptr+1); fval = (float)ival/(float)scale; - Gv_SetVarX(*insptr, ival); + Gv_SetVar(*insptr, ival); } insptr += 2; continue; @@ -863,13 +863,13 @@ skip_check: int32_t var=*insptr++, min=Gv_GetVar(*insptr++), max=Gv_GetVar(*insptr++); int32_t val=Gv_GetVar(var); - if (valmax) Gv_SetVarX(var, max); + if (valmax) Gv_SetVar(var, max); } continue; case CON_INV: - Gv_SetVarX(*(insptr+1), -Gv_GetVar(*(insptr+1))); + Gv_SetVar(*(insptr+1), -Gv_GetVar(*(insptr+1))); insptr += 2; continue; @@ -879,7 +879,7 @@ skip_check: // syntax sqrt int32_t lInVarID=*insptr++, lOutVarID=*insptr++; - Gv_SetVarX(lOutVarID, ksqrt((uint32_t)Gv_GetVar(lInVarID))); + Gv_SetVar(lOutVarID, ksqrt((uint32_t)Gv_GetVar(lInVarID))); continue; } @@ -900,9 +900,9 @@ skip_check: if (vm.flags&VMFLAG_ERROR) continue; if (tw==CON_DIST) - Gv_SetVarX(distvar, dist(&sprite[xvar],&sprite[yvar])); + Gv_SetVar(distvar, dist(&sprite[xvar],&sprite[yvar])); else - Gv_SetVarX(distvar, ldist(&sprite[xvar],&sprite[yvar])); + Gv_SetVar(distvar, ldist(&sprite[xvar],&sprite[yvar])); continue; } @@ -913,7 +913,7 @@ skip_check: int32_t xvar = Gv_GetVar(*insptr++); int32_t yvar = Gv_GetVar(*insptr++); - Gv_SetVarX(angvar, getangle(xvar,yvar)); + Gv_SetVar(angvar, getangle(xvar,yvar)); continue; } @@ -924,7 +924,7 @@ skip_check: int32_t xvar = Gv_GetVar(*insptr++); int32_t yvar = Gv_GetVar(*insptr++); - Gv_SetVarX(angvar, G_GetAngleDelta(xvar,yvar)); + Gv_SetVar(angvar, G_GetAngleDelta(xvar,yvar)); continue; } @@ -953,11 +953,11 @@ skip_check: z = divscale14(-horiz, veclen); } - Gv_SetVarX(zvar, z); + Gv_SetVar(zvar, z); } - Gv_SetVarX(xvar, x); - Gv_SetVarX(yvar, y); + Gv_SetVar(xvar, x); + Gv_SetVar(yvar, y); continue; } @@ -968,7 +968,7 @@ skip_check: int32_t var1 = *insptr++, var2 = Gv_GetVar(*insptr++); int32_t var3 = Gv_GetVar(*insptr++), var4 = Gv_GetVar(*insptr++); - Gv_SetVarX(var1, mulscale(var2, var3, var4)); + Gv_SetVar(var1, mulscale(var2, var3, var4)); continue; } case CON_DIVSCALE: @@ -977,7 +977,7 @@ skip_check: int32_t var1 = *insptr++, var2 = Gv_GetVar(*insptr++); int32_t var3 = Gv_GetVar(*insptr++), var4 = Gv_GetVar(*insptr++); - Gv_SetVarX(var1, divscale(var2, var3, var4)); + Gv_SetVar(var1, divscale(var2, var3, var4)); continue; } case CON_SCALEVAR: @@ -986,7 +986,7 @@ skip_check: int32_t var1 = *insptr++, var2 = Gv_GetVar(*insptr++); int32_t var3 = Gv_GetVar(*insptr++), var4 = Gv_GetVar(*insptr++); - Gv_SetVarX(var1, scale(var2, var3, var4)); + Gv_SetVar(var1, scale(var2, var3, var4)); continue; } @@ -1273,7 +1273,7 @@ skip_check: for (j=numsects-1; j>=0; j--) sectlist32[j] = sectlist[j]; - Gv_SetVarX(numsectsVar, numsects); + Gv_SetVar(numsectsVar, numsects); g_iReturnVar = 0; // restore some VM state @@ -1339,7 +1339,7 @@ skip_check: { if (sprite[jj].statnum == MAXSTATUS) continue; - Gv_SetVarX(var, jj); + Gv_SetVar(var, jj); vm.spriteNum = jj; vm.pSprite = &sprite[jj]; insptr = beg; @@ -1349,7 +1349,7 @@ skip_check: case ITER_ALLSECTORS: for (bssize_t jj=0; jj=0 && !vm.flags; jj=nextspritesect[jj]) { - Gv_SetVarX(var, jj); + Gv_SetVar(var, jj); vm.spriteNum = jj; vm.pSprite = &sprite[jj]; insptr = beg; @@ -1456,7 +1456,7 @@ skip_check: for (bssize_t jj=sector[parm2].wallptr, endwall=jj+sector[parm2].wallnum-1; jj<=endwall && !vm.flags; jj++) { - Gv_SetVarX(var, jj); + Gv_SetVar(var, jj); insptr = beg; VM_Execute(1); } @@ -1468,7 +1468,7 @@ skip_check: int jj = parm2; do { - Gv_SetVarX(var, jj); + Gv_SetVar(var, jj); insptr = beg; VM_Execute(1); jj = wall[jj].point2; @@ -1479,7 +1479,7 @@ skip_check: case ITER_RANGE: for (bssize_t jj=0; jj (int64_t)INT32_MAX) - Gv_SetVarX(retvar, (int32_t)sqrt((double)hypsq)); + Gv_SetVar(retvar, (int32_t)sqrt((double)hypsq)); else - Gv_SetVarX(retvar, ksqrt((uint32_t)hypsq)); + Gv_SetVar(retvar, ksqrt((uint32_t)hypsq)); continue; } @@ -1928,12 +1928,12 @@ badindex: else ret = rayintersect(x1, y1, z1, x2, y2, z2, x3, y3, x4, y4, &intx, &inty, &intz); - Gv_SetVarX(retvar, ret); + Gv_SetVar(retvar, ret); if (ret) { - Gv_SetVarX(intxvar, intx); - Gv_SetVarX(intyvar, inty); - Gv_SetVarX(intzvar, intz); + Gv_SetVar(intxvar, intx); + Gv_SetVar(intyvar, inty); + Gv_SetVar(intzvar, intz); } continue; @@ -1956,10 +1956,10 @@ badindex: X_ERROR_INVALIDSECT(sectnum); - Gv_SetVarX(retvar, clipmove(&vect, §num, xvect, yvect, walldist, floordist, ceildist, clipmask)); - Gv_SetVarX(sectnumvar, sectnum); - Gv_SetVarX(xvar, vect.x); - Gv_SetVarX(yvar, vect.y); + Gv_SetVar(retvar, clipmove(&vect, §num, xvect, yvect, walldist, floordist, ceildist, clipmask)); + Gv_SetVar(sectnumvar, sectnum); + Gv_SetVar(xvar, vect.x); + Gv_SetVar(yvar, vect.y); continue; } @@ -1982,12 +1982,12 @@ badindex: X_ERROR_INVALIDSECT(sectnum); hitscan((const vec3_t *)&vect, sectnum, vx, vy, vz, &hit, cliptype); - Gv_SetVarX(hitsectvar, hit.sect); - Gv_SetVarX(hitwallvar, hit.wall); - Gv_SetVarX(hitspritevar, hit.sprite); - Gv_SetVarX(hitxvar, hit.pos.x); - Gv_SetVarX(hityvar, hit.pos.y); - Gv_SetVarX(hitzvar, hit.pos.z); + Gv_SetVar(hitsectvar, hit.sect); + Gv_SetVar(hitwallvar, hit.wall); + Gv_SetVar(hitspritevar, hit.sprite); + Gv_SetVar(hitxvar, hit.pos.x); + Gv_SetVar(hityvar, hit.pos.y); + Gv_SetVar(hitzvar, hit.pos.z); } continue; } @@ -2003,7 +2003,7 @@ badindex: X_ERROR_INVALIDSECT(sect1); X_ERROR_INVALIDSECT(sect2); - Gv_SetVarX(rvar, cansee(x1,y1,z1,sect1,x2,y2,z2,sect2)); + Gv_SetVar(rvar, cansee(x1,y1,z1,sect1,x2,y2,z2,sect2)); continue; } @@ -2018,8 +2018,8 @@ badindex: vec2_t p2; rotatepoint(pivot,p,daang,&p2); - Gv_SetVarX(x2var, p2.x); - Gv_SetVarX(y2var, p2.y); + Gv_SetVar(x2var, p2.x); + Gv_SetVar(y2var, p2.y); continue; } @@ -2046,10 +2046,10 @@ badindex: neartag(x, y, z, sectnum, ang, &neartagsector, &neartagwall, &neartagsprite, &neartaghitdist, neartagrange, tagsearch, NULL); - Gv_SetVarX(neartagsectorvar, neartagsector); - Gv_SetVarX(neartagwallvar, neartagwall); - Gv_SetVarX(neartagspritevar, neartagsprite); - Gv_SetVarX(neartaghitdistvar, neartaghitdist); + Gv_SetVar(neartagsectorvar, neartagsector); + Gv_SetVar(neartagwallvar, neartagwall); + Gv_SetVar(neartagspritevar, neartagsprite); + Gv_SetVar(neartaghitdistvar, neartaghitdist); continue; } @@ -2077,9 +2077,9 @@ badindex: X_ERROR_INVALIDSECT(sectnum); if (tw == CON_GETFLORZOFSLOPE) - Gv_SetVarX(var, getflorzofslope(sectnum,x,y)); + Gv_SetVar(var, getflorzofslope(sectnum,x,y)); else - Gv_SetVarX(var, getceilzofslope(sectnum,x,y)); + Gv_SetVar(var, getceilzofslope(sectnum,x,y)); continue; } @@ -2129,7 +2129,7 @@ badindex: if (tw==CON_UPDATESECTOR) updatesector(x,y,&w); else updatesectorz(x,y,z,&w); - Gv_SetVarX(var, w); + Gv_SetVar(var, w); continue; } @@ -2143,7 +2143,7 @@ badindex: M32_ERROR("invalid status list %d", j); continue; } - Gv_SetVarX(i,headspritestat[j]); + Gv_SetVar(i,headspritestat[j]); continue; } @@ -2154,7 +2154,7 @@ badindex: int32_t j=Gv_GetVar(*insptr++); X_ERROR_INVALIDSPRI(j); - Gv_SetVarX(i,prevspritestat[j]); + Gv_SetVar(i,prevspritestat[j]); continue; } @@ -2165,7 +2165,7 @@ badindex: int32_t j=Gv_GetVar(*insptr++); X_ERROR_INVALIDSPRI(j); - Gv_SetVarX(i,nextspritestat[j]); + Gv_SetVar(i,nextspritestat[j]); continue; } @@ -2176,7 +2176,7 @@ badindex: int32_t j=Gv_GetVar(*insptr++); X_ERROR_INVALIDSECT(j); - Gv_SetVarX(i,headspritesect[j]); + Gv_SetVar(i,headspritesect[j]); continue; } @@ -2187,7 +2187,7 @@ badindex: int32_t j=Gv_GetVar(*insptr++); X_ERROR_INVALIDSPRI(j); - Gv_SetVarX(i,prevspritesect[j]); + Gv_SetVar(i,prevspritesect[j]); continue; } @@ -2198,7 +2198,7 @@ badindex: int32_t j=Gv_GetVar(*insptr++); X_ERROR_INVALIDSPRI(j); - Gv_SetVarX(i,nextspritesect[j]); + Gv_SetVar(i,nextspritesect[j]); continue; } @@ -2220,7 +2220,7 @@ badindex: else res=cansee(sprite[lVar1].x,sprite[lVar1].y,sprite[lVar1].z,sprite[lVar1].sectnum, sprite[lVar2].x,sprite[lVar2].y,sprite[lVar2].z,sprite[lVar2].sectnum); - Gv_SetVarX(*insptr++, res); + Gv_SetVar(*insptr++, res); continue; } @@ -2269,7 +2269,7 @@ badindex: insptr++; { int32_t j = *insptr++; - Gv_SetVarX(j, sectorofwall(Gv_GetVar(*insptr++))); + Gv_SetVar(j, sectorofwall(Gv_GetVar(*insptr++))); } continue; @@ -2282,7 +2282,7 @@ badindex: insptr++; { int32_t r = Gv_GetVar(*insptr++), g = Gv_GetVar(*insptr++), b = Gv_GetVar(*insptr++); - Gv_SetVarX(*insptr++, paletteGetClosestColor(r, g, b)); + Gv_SetVar(*insptr++, paletteGetClosestColor(r, g, b)); continue; } @@ -2375,14 +2375,14 @@ badindex: ti = localtime(&rawtime); // initprintf("Time&date: %s\n",asctime (ti)); - Gv_SetVarX(v1, ti->tm_sec); - Gv_SetVarX(v2, ti->tm_min); - Gv_SetVarX(v3, ti->tm_hour); - Gv_SetVarX(v4, ti->tm_mday); - Gv_SetVarX(v5, ti->tm_mon); - Gv_SetVarX(v6, ti->tm_year+1900); - Gv_SetVarX(v7, ti->tm_wday); - Gv_SetVarX(v8, ti->tm_yday); + Gv_SetVar(v1, ti->tm_sec); + Gv_SetVar(v2, ti->tm_min); + Gv_SetVar(v3, ti->tm_hour); + Gv_SetVar(v4, ti->tm_mday); + Gv_SetVar(v5, ti->tm_mon); + Gv_SetVar(v6, ti->tm_year+1900); + Gv_SetVar(v7, ti->tm_wday); + Gv_SetVar(v8, ti->tm_yday); continue; } @@ -2520,14 +2520,14 @@ badindex: //OSD_Printf("max:%d, sign:%d\n", max, sign); if (tw==CON_GETNUMBERFROMUSER) { - Gv_SetVarX(var, in3dmode() ? + Gv_SetVar(var, in3dmode() ? getnumber256(quotetext, Gv_GetVar(var), max, sign) : getnumber16(quotetext, Gv_GetVar(var), max, sign)); } else if (tw==CON_GETNUMBER16) - Gv_SetVarX(var, getnumber16(quotetext, Gv_GetVar(var), max, sign)); + Gv_SetVar(var, getnumber16(quotetext, Gv_GetVar(var), max, sign)); else - Gv_SetVarX(var, getnumber256(quotetext, Gv_GetVar(var), max, sign)); + Gv_SetVar(var, getnumber256(quotetext, Gv_GetVar(var), max, sign)); } } continue; @@ -2618,7 +2618,7 @@ badindex: if (vm.flags&VMFLAG_ERROR) continue; - Gv_SetVarX(i, Bstrlen(quotetext)); + Gv_SetVar(i, Bstrlen(quotetext)); continue; } @@ -2837,7 +2837,7 @@ dodefault: break; } while (k--); - Gv_SetVarX(lVarID, lFound); + Gv_SetVar(lVarID, lFound); continue; } @@ -2884,7 +2884,7 @@ dodefault: break; } while (k--); - Gv_SetVarX(lVarID, lFound); + Gv_SetVar(lVarID, lFound); continue; } @@ -2894,7 +2894,7 @@ dodefault: insptr++; { int32_t j=*insptr++; - Gv_SetVarX(j, timerGetTicks()); + Gv_SetVar(j, timerGetTicks()); } continue; @@ -2981,37 +2981,37 @@ dodefault: case CON_SPGETLOTAG: insptr++; X_ERROR_INVALIDSP(); - Gv_SetVarX(M32_LOTAG_VAR_ID, vm.pSprite->lotag); + Gv_SetVar(M32_LOTAG_VAR_ID, vm.pSprite->lotag); continue; case CON_SPGETHITAG: insptr++; X_ERROR_INVALIDSP(); - Gv_SetVarX(M32_HITAG_VAR_ID, vm.pSprite->hitag); + Gv_SetVar(M32_HITAG_VAR_ID, vm.pSprite->hitag); continue; case CON_SECTGETLOTAG: insptr++; X_ERROR_INVALIDSP(); - Gv_SetVarX(M32_LOTAG_VAR_ID, sector[vm.pSprite->sectnum].lotag); + Gv_SetVar(M32_LOTAG_VAR_ID, sector[vm.pSprite->sectnum].lotag); continue; case CON_SECTGETHITAG: insptr++; X_ERROR_INVALIDSP(); - Gv_SetVarX(M32_HITAG_VAR_ID, sector[vm.pSprite->sectnum].hitag); + Gv_SetVar(M32_HITAG_VAR_ID, sector[vm.pSprite->sectnum].hitag); continue; case CON_GETTEXTUREFLOOR: insptr++; X_ERROR_INVALIDSP(); - Gv_SetVarX(M32_TEXTURE_VAR_ID, sector[vm.pSprite->sectnum].floorpicnum); + Gv_SetVar(M32_TEXTURE_VAR_ID, sector[vm.pSprite->sectnum].floorpicnum); continue; case CON_GETTEXTURECEILING: insptr++; X_ERROR_INVALIDSP(); - Gv_SetVarX(M32_TEXTURE_VAR_ID, sector[vm.pSprite->sectnum].ceilingpicnum); + Gv_SetVar(M32_TEXTURE_VAR_ID, sector[vm.pSprite->sectnum].ceilingpicnum); continue; // ^^^ case CON_DRAWLINE16: @@ -3152,7 +3152,7 @@ dodefault: continue; } - Gv_SetVarX(var, S_SoundFlags(j)); + Gv_SetVar(var, S_SoundFlags(j)); } continue; diff --git a/source/duke3d/src/m32structures.cpp b/source/duke3d/src/m32structures.cpp index e9e9faaa8..071c5556d 100644 --- a/source/duke3d/src/m32structures.cpp +++ b/source/duke3d/src/m32structures.cpp @@ -133,7 +133,7 @@ static int32_t __fastcall VM_AccessWall(int32_t how, int32_t lVar1, int32_t labe } if (how&ACCESS_USEVARS) - Gv_SetVarX(lVar2, lValue); + Gv_SetVar(lVar2, lValue); return lValue; } @@ -262,7 +262,7 @@ static int32_t __fastcall VM_AccessSector(int32_t how, int32_t lVar1, int32_t la } if (how&ACCESS_USEVARS) - Gv_SetVarX(lVar2, lValue); + Gv_SetVar(lVar2, lValue); return lValue; } @@ -369,7 +369,7 @@ static int32_t __fastcall VM_AccessSprite(int32_t how, int32_t lVar1, int32_t la } if (how&ACCESS_USEVARS) - Gv_SetVarX(lVar2, lValue); + Gv_SetVar(lVar2, lValue); return lValue; } @@ -556,7 +556,7 @@ static int32_t __fastcall VM_AccessTsprite(int32_t how, int32_t lVar1, int32_t l } if (how&ACCESS_USEVARS) - Gv_SetVarX(lVar2, lValue); + Gv_SetVar(lVar2, lValue); return lValue; } diff --git a/source/duke3d/src/m32vars.cpp b/source/duke3d/src/m32vars.cpp index 2542e4894..65900c943 100644 --- a/source/duke3d/src/m32vars.cpp +++ b/source/duke3d/src/m32vars.cpp @@ -380,7 +380,7 @@ int32_t __fastcall Gv_GetVar(int32_t id) } -void __fastcall Gv_SetVarX(int32_t id, int32_t lValue) +void __fastcall Gv_SetVar(int32_t id, int32_t lValue) { switch (id&M32_VARTYPE_MASK) {