- Added new Scroll_Wall special to allow more control over wall scrolling.

Since it uses fixed point parameters it can only be used in scripts though.
- Added flags parameters to all wall scroller specials that didn't use
  all 5 args.
- Separated scrolling of the 3 different texture parts of a sidedef.
  While doing this I did some more restructuring of the sidedef structure
  and changed it so that all state changes to sidedefs that affect rendering 
  have to be made with access functions. This is not of much use to the
  software renderer but it allows far easier caching of rendering data
  for OpenGL because the only place I need to check is in the access functions.


SVN r832 (trunk)
This commit is contained in:
Christoph Oelckers 2008-03-21 17:35:49 +00:00
commit e77f83fbf6
29 changed files with 529 additions and 333 deletions

View file

@ -1822,9 +1822,11 @@ void FActiveInterpolation::CopyInterpToOld ()
oldipos[0] = ((sector_t*)Address)->ceiling_xoffs;
oldipos[1] = ((sector_t*)Address)->ceiling_yoffs;
break;
case INTERP_WallPanning:
oldipos[0] = ((side_t*)Address)->rowoffset;
oldipos[1] = ((side_t*)Address)->textureoffset;
case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
oldipos[0] = ((side_t*)Address)->GetTextureYOffset(Type - INTERP_WallPanning_Top);
oldipos[1] = ((side_t*)Address)->GetTextureXOffset(Type - INTERP_WallPanning_Top);
break;
}
}
@ -1853,9 +1855,11 @@ void FActiveInterpolation::CopyBakToInterp ()
((sector_t*)Address)->ceiling_xoffs = bakipos[0];
((sector_t*)Address)->ceiling_yoffs = bakipos[1];
break;
case INTERP_WallPanning:
((side_t*)Address)->rowoffset = bakipos[0];
((side_t*)Address)->textureoffset = bakipos[1];
case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
((side_t*)Address)->SetTextureYOffset(Type - INTERP_WallPanning_Top, bakipos[0]);
((side_t*)Address)->SetTextureXOffset(Type - INTERP_WallPanning_Top, bakipos[1]);
break;
}
}
@ -1863,6 +1867,7 @@ void FActiveInterpolation::CopyBakToInterp ()
void FActiveInterpolation::DoAnInterpolation (fixed_t smoothratio)
{
fixed_t *adr1, *adr2, pos;
int v1, v2;
switch (Type)
{
@ -1886,9 +1891,13 @@ void FActiveInterpolation::DoAnInterpolation (fixed_t smoothratio)
adr1 = &((sector_t*)Address)->ceiling_xoffs;
adr2 = &((sector_t*)Address)->ceiling_yoffs;
break;
case INTERP_WallPanning:
adr1 = &((side_t*)Address)->rowoffset;
adr2 = &((side_t*)Address)->textureoffset;
case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
v1 = ((side_t*)Address)->GetTextureYOffset(Type - INTERP_WallPanning_Top);
v2 = ((side_t*)Address)->GetTextureXOffset(Type - INTERP_WallPanning_Top);
adr1 = &v1;
adr2 = &v2;
break;
default:
return;
@ -1899,6 +1908,19 @@ void FActiveInterpolation::DoAnInterpolation (fixed_t smoothratio)
pos = bakipos[1] = *adr2;
*adr2 = oldipos[1] + FixedMul (pos - oldipos[1], smoothratio);
switch (Type)
{
case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
((side_t*)Address)->SetTextureYOffset(Type - INTERP_WallPanning_Top, v1);
((side_t*)Address)->SetTextureXOffset(Type - INTERP_WallPanning_Top, v2);
break;
default:
return;
}
}
size_t FActiveInterpolation::HashKey (EInterpType type, void *interptr)
@ -2141,7 +2163,10 @@ FArchive &operator << (FArchive &arc, FActiveInterpolation *&interp)
switch (type)
{
case INTERP_Vertex: arc << ptr.vert; break;
case INTERP_WallPanning: arc << ptr.side; break;
case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
arc << ptr.side; break;
default: arc << ptr.sect; break;
}
}
@ -2153,7 +2178,10 @@ FArchive &operator << (FArchive &arc, FActiveInterpolation *&interp)
switch (type)
{
case INTERP_Vertex: arc << ptr.vert; break;
case INTERP_WallPanning: arc << ptr.side; break;
case INTERP_WallPanning_Top:
case INTERP_WallPanning_Mid:
case INTERP_WallPanning_Bottom:
arc << ptr.side; break;
default: arc << ptr.sect; break;
}
interp->Address = ptr.ptr;