(for more frames replace the "8" by 8+[the number of new frames]*2, i.e. 8+4*2 or simply 16)
Now replace the HitVertWall function by this function:
::: CODE :::
void HitVertWall (void)
{
int wallpic;
unsigned texture;
byte tile;
texture = (yintercept>>4)&0xfc0;
if (xtilestep == -1)
{
texture = 0xfc0-texture;
xintercept += TILEGLOBAL;
}
wallheight[pixx] = CalcHeight();
if (lastside==1 && lastintercept == xtile && lasttilehit == tilehit)
{
// in the same wall type as last time, so check for optimized draw
if (texture == (unsigned)postsource)
{
// wide scale
postwidth++;
wallheight[pixx] = wallheight[pixx-1];
return;
}
else
{
ScalePost ();
(unsigned)postsource = texture;
postwidth = 1;
postx = pixx;
}
}
else
{
// new wall
if (lastside != -1) // if not the first scaled post
ScalePost ();
lastside = true;
lastintercept = xtile;
lasttilehit = tilehit;
postx = pixx;
postwidth = 1;
if (tilehit & 0x40)
{ // check for adjacent doors
ytile = yintercept>>TILESHIFT;
tile = tilemap[xtile-xtilestep][ytile];
if (tile & 0x80)
{
switch(doorobjlist[tile & 0x7f].lock)
{
case dr_lock1:
case dr_lock2:
case dr_lock3:
case dr_lock4:
case dr_elevator:
wallpic = DOORWALL+9;
break;
case dr_normal:
default:
wallpic = DOORWALL+3;
break;
}
}
else
wallpic = vertwall[tilehit & ~0x40];
}
else
wallpic = vertwall[tilehit];
*( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);
(unsigned)postsource = texture;
}
}
and the HitHorizWall function by that:
::: CODE :::
void HitHorizWall (void)
{
int wallpic;
unsigned texture;
byte tile;
texture = (xintercept>>4)&0xfc0;
if (ytilestep == -1)
yintercept += TILEGLOBAL;
else
texture = 0xfc0-texture;
wallheight[pixx] = CalcHeight();
if (lastside==0 && lastintercept == ytile && lasttilehit == tilehit)
{
// in the same wall type as last time, so check for optimized draw
if (texture == (unsigned)postsource)
{
// wide scale
postwidth++;
wallheight[pixx] = wallheight[pixx-1];
return;
}
else
{
ScalePost ();
(unsigned)postsource = texture;
postwidth = 1;
postx = pixx;
}
}
else
{
// new wall
if (lastside != -1) // if not the first scaled post
ScalePost ();
lastside = 0;
lastintercept = ytile;
lasttilehit = tilehit;
postx = pixx;
postwidth = 1;
if (tilehit & 0x40)
{ // check for adjacent doors
xtile = xintercept>>TILESHIFT;
tile = tilemap[xtile][ytile-ytilestep];
if(tile & 0x80)
{
switch(doorobjlist[tile & 0x7f].lock)
{
case dr_lock1:
case dr_lock2:
case dr_lock3:
case dr_lock4:
case dr_elevator:
wallpic = DOORWALL+8;
break;
case dr_normal:
default:
wallpic = DOORWALL+2;
break;
}
}
else
wallpic = horizwall[tilehit & ~0x40];
}
else
wallpic = horizwall[tilehit];
*( ((unsigned *)&postsource)+1) = (unsigned)PM_GetPage(wallpic);
(unsigned)postsource = texture;
}
}
That's it!
The result will look like this:
You should be able to simply adjust this to your needs
Greets ;D
Ripper