mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
Mapster32: style-cleanup check_spritelist_consistency() and VM_Execute(): 'for'.
DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@5018 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a1a79b001e
commit
7742d5a40a
2 changed files with 38 additions and 34 deletions
|
@ -730,7 +730,7 @@ static int32_t csc_s, csc_i;
|
|||
// 1: corrupt, 0: OK
|
||||
static int32_t check_spritelist_consistency()
|
||||
{
|
||||
int32_t s, i, ournumsprites=0;
|
||||
int32_t ournumsprites=0;
|
||||
static uint8_t havesprite[MAXSPRITES>>3];
|
||||
|
||||
csc_s = csc_i = -1;
|
||||
|
@ -738,7 +738,7 @@ static int32_t check_spritelist_consistency()
|
|||
if (Numsprites < 0 || Numsprites > MAXSPRITES)
|
||||
return 1;
|
||||
|
||||
for (i=0; i<MAXSPRITES; i++)
|
||||
for (int i=0; i<MAXSPRITES; i++)
|
||||
{
|
||||
const int32_t sectnum=sprite[i].sectnum, statnum=sprite[i].statnum;
|
||||
|
||||
|
@ -764,8 +764,9 @@ static int32_t check_spritelist_consistency()
|
|||
|
||||
Bmemset(havesprite, 0, (Numsprites+7)>>3);
|
||||
|
||||
for (s=0; s<numsectors; s++)
|
||||
for (int s=0; s<numsectors; s++)
|
||||
{
|
||||
int i;
|
||||
csc_s = s;
|
||||
|
||||
for (i=headspritesect[s]; i>=0; i=nextspritesect[i])
|
||||
|
@ -789,7 +790,7 @@ static int32_t check_spritelist_consistency()
|
|||
}
|
||||
|
||||
csc_s = -1;
|
||||
for (i=0; i<MAXSPRITES; i++)
|
||||
for (int i=0; i<MAXSPRITES; i++)
|
||||
{
|
||||
csc_i = i;
|
||||
|
||||
|
@ -800,8 +801,9 @@ static int32_t check_spritelist_consistency()
|
|||
|
||||
// STATUS LIST -- we now clear havesprite[] bits
|
||||
|
||||
for (s=0; s<MAXSTATUS; s++)
|
||||
for (int s=0; s<MAXSTATUS; s++)
|
||||
{
|
||||
int i;
|
||||
csc_s = s;
|
||||
|
||||
for (i=headspritestat[s]; i>=0; i=nextspritestat[i])
|
||||
|
@ -827,7 +829,7 @@ static int32_t check_spritelist_consistency()
|
|||
}
|
||||
|
||||
csc_s = -1;
|
||||
for (i=0; i<Numsprites; i++)
|
||||
for (int i=0; i<Numsprites; i++)
|
||||
{
|
||||
csc_i = i;
|
||||
|
||||
|
|
|
@ -1265,19 +1265,19 @@ skip_check:
|
|||
case CON_FOR: // special-purpose iteration
|
||||
insptr++;
|
||||
{
|
||||
int32_t var = *insptr++, how=*insptr++, ii, jj;
|
||||
int32_t parm2 = how<=ITER_DRAWNSPRITES ? 0 : Gv_GetVarX(*insptr++);
|
||||
instype *end = insptr + *insptr, *beg = ++insptr;
|
||||
int32_t vm_i_bak = vm.g_i;
|
||||
tspritetype *vm_sp_bak = vm.g_sp;
|
||||
int16_t endwall;
|
||||
const int32_t var = *insptr++, how = *insptr++;
|
||||
const int32_t parm2 = how<=ITER_DRAWNSPRITES ? 0 : Gv_GetVarX(*insptr++);
|
||||
instype *const end = insptr + *insptr, *const beg = ++insptr;
|
||||
const int32_t vm_i_bak = vm.g_i;
|
||||
tspritetype *const vm_sp_bak = vm.g_sp;
|
||||
|
||||
if (vm.flags&VMFLAG_ERROR) continue;
|
||||
if (vm.flags&VMFLAG_ERROR)
|
||||
continue;
|
||||
|
||||
switch (how)
|
||||
{
|
||||
case ITER_ALLSPRITES:
|
||||
for (jj=0; jj<MAXSPRITES && !vm.flags; jj++)
|
||||
for (int jj=0; jj<MAXSPRITES && !vm.flags; jj++)
|
||||
{
|
||||
if (sprite[jj].statnum == MAXSTATUS)
|
||||
continue;
|
||||
|
@ -1289,7 +1289,7 @@ skip_check:
|
|||
}
|
||||
break;
|
||||
case ITER_ALLSECTORS:
|
||||
for (jj=0; jj<numsectors && !vm.flags; jj++)
|
||||
for (int jj=0; jj<numsectors && !vm.flags; jj++)
|
||||
{
|
||||
Gv_SetVarX(var, jj);
|
||||
insptr = beg;
|
||||
|
@ -1297,7 +1297,7 @@ skip_check:
|
|||
}
|
||||
break;
|
||||
case ITER_ALLWALLS:
|
||||
for (jj=0; jj<numwalls && !vm.flags; jj++)
|
||||
for (int jj=0; jj<numwalls && !vm.flags; jj++)
|
||||
{
|
||||
Gv_SetVarX(var, jj);
|
||||
insptr = beg;
|
||||
|
@ -1306,7 +1306,7 @@ skip_check:
|
|||
break;
|
||||
case ITER_ACTIVELIGHTS:
|
||||
#ifdef POLYMER
|
||||
for (jj=0; jj<PR_MAXLIGHTS; jj++)
|
||||
for (int jj=0; jj<PR_MAXLIGHTS; jj++)
|
||||
{
|
||||
if (!prlights[jj].flags.active)
|
||||
continue;
|
||||
|
@ -1321,9 +1321,9 @@ skip_check:
|
|||
break;
|
||||
|
||||
case ITER_SELSPRITES:
|
||||
for (ii=0; ii<highlightcnt && !vm.flags; ii++)
|
||||
for (int ii=0; ii<highlightcnt && !vm.flags; ii++)
|
||||
{
|
||||
jj = highlight[ii];
|
||||
int jj = highlight[ii];
|
||||
if (jj&0xc000)
|
||||
{
|
||||
jj &= (MAXSPRITES-1);
|
||||
|
@ -1336,18 +1336,18 @@ skip_check:
|
|||
}
|
||||
break;
|
||||
case ITER_SELSECTORS:
|
||||
for (ii=0; ii<highlightsectorcnt && !vm.flags; ii++)
|
||||
for (int ii=0; ii<highlightsectorcnt && !vm.flags; ii++)
|
||||
{
|
||||
jj=highlightsector[ii];
|
||||
int jj=highlightsector[ii];
|
||||
Gv_SetVarX(var, jj);
|
||||
insptr = beg;
|
||||
VM_Execute(1);
|
||||
}
|
||||
break;
|
||||
case ITER_SELWALLS:
|
||||
for (ii=0; ii<highlightcnt && !vm.flags; ii++)
|
||||
for (int ii=0; ii<highlightcnt && !vm.flags; ii++)
|
||||
{
|
||||
jj=highlight[ii];
|
||||
int jj=highlight[ii];
|
||||
if (jj&0xc000)
|
||||
continue;
|
||||
Gv_SetVarX(var, jj);
|
||||
|
@ -1356,7 +1356,7 @@ skip_check:
|
|||
}
|
||||
break;
|
||||
case ITER_DRAWNSPRITES:
|
||||
for (ii=0; ii<spritesortcnt && !vm.flags; ii++)
|
||||
for (int ii=0; ii<spritesortcnt && !vm.flags; ii++)
|
||||
{
|
||||
vm.g_sp = (tspritetype *)&sprite[MAXSPRITES-1];
|
||||
Bmemcpy(&sprite[MAXSPRITES-1], &tsprite[ii], sizeof(tspritetype));
|
||||
|
@ -1369,7 +1369,7 @@ skip_check:
|
|||
case ITER_SPRITESOFSECTOR:
|
||||
if (parm2 < 0 || parm2 >= MAXSECTORS)
|
||||
goto badindex;
|
||||
for (jj=headspritesect[parm2]; jj>=0 && !vm.flags; jj=nextspritesect[jj])
|
||||
for (int jj=headspritesect[parm2]; jj>=0 && !vm.flags; jj=nextspritesect[jj])
|
||||
{
|
||||
Gv_SetVarX(var, jj);
|
||||
vm.g_i = jj;
|
||||
|
@ -1381,7 +1381,7 @@ skip_check:
|
|||
case ITER_WALLSOFSECTOR:
|
||||
if (parm2 < 0 || parm2 >= MAXSECTORS)
|
||||
goto badindex;
|
||||
for (jj=sector[parm2].wallptr, endwall=jj+sector[parm2].wallnum-1;
|
||||
for (int jj=sector[parm2].wallptr, endwall=jj+sector[parm2].wallnum-1;
|
||||
jj<=endwall && !vm.flags; jj++)
|
||||
{
|
||||
Gv_SetVarX(var, jj);
|
||||
|
@ -1392,18 +1392,20 @@ skip_check:
|
|||
case ITER_LOOPOFWALL:
|
||||
if (parm2 < 0 || parm2 >= numwalls)
|
||||
goto badindex;
|
||||
jj = parm2;
|
||||
do
|
||||
{
|
||||
Gv_SetVarX(var, jj);
|
||||
insptr = beg;
|
||||
VM_Execute(1);
|
||||
jj = wall[jj].point2;
|
||||
int jj = parm2;
|
||||
do
|
||||
{
|
||||
Gv_SetVarX(var, jj);
|
||||
insptr = beg;
|
||||
VM_Execute(1);
|
||||
jj = wall[jj].point2;
|
||||
}
|
||||
while (jj != parm2 && !vm.flags);
|
||||
}
|
||||
while (jj != parm2 && !vm.flags);
|
||||
break;
|
||||
case ITER_RANGE:
|
||||
for (jj=0; jj<parm2 && !vm.flags; jj++)
|
||||
for (int jj=0; jj<parm2 && !vm.flags; jj++)
|
||||
{
|
||||
Gv_SetVarX(var, jj);
|
||||
insptr = beg;
|
||||
|
|
Loading…
Reference in a new issue