Subversion Repositories eduke32

Compare Revisions

Ignore whitespace Rev 5017 → Rev 5018

/polymer/eduke32/source/m32common.c
730,7 → 730,7
// 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
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
 
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
}
 
csc_s = -1;
for (i=0; i<MAXSPRITES; i++)
for (int i=0; i<MAXSPRITES; i++)
{
csc_i = i;
 
800,8 → 801,9
 
// 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
}
 
csc_s = -1;
for (i=0; i<Numsprites; i++)
for (int i=0; i<Numsprites; i++)
{
csc_i = i;
 
/polymer/eduke32/source/m32exec.c
1265,19 → 1265,19
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
}
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
}
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
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
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,9 → 1336,9
}
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);
1345,9 → 1345,9
}
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
}
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
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
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
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;