* Fix usage of uninitialized array (\!), which could result in TROR connections being deleted at random when deleting sectors. I guess this is a sign of approaching senility :(

* When dragging highlighted sprites, do a setsprite() after each position update. This way, they won't end up on the wrong level
* TROR support for SE 31 and 32 in-game, example provided in test map
* some uncommited stuff for TROR: SE 6/14


git-svn-id: https://svn.eduke32.com/eduke32@1924 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-06-29 19:57:05 +00:00
parent 1eec50be5f
commit 6a713133cf
7 changed files with 98 additions and 18 deletions

View file

@ -4276,8 +4276,11 @@ end_after_dragging:
}
else
{
sprite[highlight[i]&16383].x += dax;
sprite[highlight[i]&16383].y += day;
spritetype *daspr = &sprite[highlight[i]&16383];
daspr->x += dax;
daspr->y += day;
setsprite(daspr-sprite, (const vec3_t *)daspr);
}
}
}
@ -5919,6 +5922,7 @@ end_space_handling:
#ifdef YAX_ENABLE
int16_t cb, fb;
uint8_t bunchbitmap[YAX_MAXBUNCHES>>3];
Bmemset(bunchbitmap, 0, sizeof(bunchbitmap));
#endif
keystatus[0xd3] = 0;
@ -6011,9 +6015,9 @@ end_space_handling:
for (j=0; j<numsectors; j++)
{
yax_getbunches(j, &cb, &fb);
if (bunchbitmap[cb>>3] & (1<<(cb&7)))
if (cb>=0 && (bunchbitmap[cb>>3] & (1<<(cb&7))))
yax_setbunch(j, YAX_CEILING, -1);
if (bunchbitmap[fb>>3] & (1<<(fb&7)))
if (fb>=0 && (bunchbitmap[fb>>3] & (1<<(fb&7))))
yax_setbunch(j, YAX_FLOOR, -1);
}
#endif

Binary file not shown.

View file

@ -7512,6 +7512,9 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
}
}
}
Yax_SetBunchZs(sc-sector, YAX_FLOOR, sc->floorz);
break;
}
@ -7573,6 +7576,8 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
}
}
}
Yax_SetBunchZs(sc-sector, YAX_FLOOR, sc->floorz);
}
break;
@ -7609,6 +7614,9 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
else sc->ceilingz +=
ksgn(t[1]-sc->ceilingz)*SP;
}
Yax_SetBunchZs(sc-sector, YAX_CEILING, sc->ceilingz);
break;
}
@ -7635,6 +7643,8 @@ ACTOR_STATIC void G_MoveEffectors(void) //STATNUM 3
}
else sc->ceilingz -= ksgn(s->z-t[1])*SP;
}
Yax_SetBunchZs(sc-sector, YAX_CEILING, sc->ceilingz);
}
break;

View file

@ -1414,8 +1414,8 @@ const char *SectorEffectorTagText(int32_t lotag)
"LIGHTNING (H=TILE#4890)",
"FLOAT",
"2 WAY TRAIN (ST=31)", // 30
"FLOOR RISE",
"CEILING FALL",
"FLOOR RISE/FALL",
"CEILING RISE/FALL",
"SPAWN JIB W/QUAKE",
};

View file

@ -3791,6 +3791,36 @@ int32_t A_InsertSprite(int32_t whatsect,int32_t s_x,int32_t s_y,int32_t s_z,int3
return(i);
}
#ifdef YAX_ENABLE
void Yax_SetBunchZs(int32_t sectnum, int32_t cf, int32_t daz)
{
int32_t i, bunchnum = yax_getbunch(sectnum, cf);
if (bunchnum < 0 || bunchnum >= numyaxbunches)
return;
for (SECTORS_OF_BUNCH(bunchnum, YAX_CEILING, i))
SECTORFLD(i,z, YAX_CEILING) = daz;
for (SECTORS_OF_BUNCH(bunchnum, YAX_FLOOR, i))
SECTORFLD(i,z, YAX_FLOOR) = daz;
}
static void Yax_SetBunchInterpolation(int32_t sectnum, int32_t cf)
{
int32_t i, bunchnum = yax_getbunch(sectnum, cf);
if (bunchnum < 0 || bunchnum >= numyaxbunches)
return;
for (SECTORS_OF_BUNCH(bunchnum, YAX_CEILING, i))
G_SetInterpolation(&sector[i].ceilingz);
for (SECTORS_OF_BUNCH(bunchnum, YAX_FLOOR, i))
G_SetInterpolation(&sector[i].floorz);
}
#else
# define Yax_SetBunchInterpolation(sectnum, cf)
#endif
int32_t A_Spawn(int32_t j, int32_t pn)
{
int32_t i, s, startwall, endwall, sect, clostest=0;
@ -5367,9 +5397,14 @@ int32_t A_Spawn(int32_t j, int32_t pn)
break;
case 31:
{
T2 = sector[sect].floorz;
// T3 = sp->hitag;
if (sp->ang != 1536) sector[sect].floorz = sp->z;
if (sp->ang != 1536)
{
sector[sect].floorz = sp->z;
Yax_SetBunchZs(sect, YAX_FLOOR, sp->z);
}
startwall = sector[sect].wallptr;
endwall = startwall+sector[sect].wallnum;
@ -5378,12 +5413,19 @@ int32_t A_Spawn(int32_t j, int32_t pn)
if (wall[s].hitag == 0) wall[s].hitag = 9999;
G_SetInterpolation(&sector[sect].floorz);
Yax_SetBunchInterpolation(sect, YAX_FLOOR);
}
break;
case 32:
{
T2 = sector[sect].ceilingz;
T3 = sp->hitag;
if (sp->ang != 1536) sector[sect].ceilingz = sp->z;
if (sp->ang != 1536)
{
sector[sect].ceilingz = sp->z;
Yax_SetBunchZs(sect, YAX_CEILING, sp->z);
}
startwall = sector[sect].wallptr;
endwall = startwall+sector[sect].wallnum;
@ -5392,7 +5434,8 @@ int32_t A_Spawn(int32_t j, int32_t pn)
if (wall[s].hitag == 0) wall[s].hitag = 9999;
G_SetInterpolation(&sector[sect].ceilingz);
Yax_SetBunchInterpolation(sect, YAX_CEILING);
}
break;
case 4: //Flashing lights

View file

@ -256,6 +256,12 @@ int32_t minitext_(int32_t x,int32_t y,const char *t,int32_t s,int32_t p,int32_t
extern inline int32_t mpgametext(int32_t y,const char *t,int32_t s,int32_t dabits);
int32_t startwin_run(void);
#ifdef YAX_ENABLE
void Yax_SetBunchZs(int32_t sectnum, int32_t cf, int32_t daz);
#else
#define Yax_SetBunchZs(sectnum, cf, daz)
#endif
void A_SpawnCeilingGlass(int32_t i,int32_t sectnum,int32_t n);
void A_SpawnGlass(int32_t i,int32_t n);
void A_SpawnRandomGlass(int32_t i,int32_t wallnum,int32_t n);

View file

@ -1030,7 +1030,11 @@ static void premap_setup_fixed_sprites(void)
{
if (FIXSPR_SELOTAGP(sprite[i].lotag))
{
for (j=headspritesect[sprite[i].sectnum]; j>=0; j=nextspritesect[j])
#ifdef YAX_ENABLE
int32_t firstrun = 1;
#endif
j = headspritesect[sprite[i].sectnum];
while (j>=0)
{
// TRIPBOMB uses t_data[7] for its own purposes. Wouldn't be
// too useful with moving sectors anyway
@ -1040,14 +1044,27 @@ static void premap_setup_fixed_sprites(void)
pivot = i;
if (sprite[i].lotag==0)
pivot = sprite[i].owner;
if (pivot < 0 || pivot>=MAXSPRITES)
continue;
if (j!=i && j!=pivot && pivot>=0 && pivot<MAXSPRITES)
{
// let's hope we don't step on anyone's toes here
actor[j].t_data[7] = 0x18190000 | pivot; // 'rs' magic + pivot SE sprite index
actor[j].t_data[8] = sprite[j].x - sprite[pivot].x;
actor[j].t_data[9] = sprite[j].y - sprite[pivot].y;
}
}
j = nextspritesect[j];
#ifdef YAX_ENABLE
if (j<0 && firstrun)
if (sprite[i].lotag==6 || sprite[i].lotag==14)
{
firstrun = 0;
j = actor[i].t_data[9];
if (j >= 0)
j = headspritesect[j];
}
#endif
}
}
}
}