- pptop = tex[(ty << 5) + tx];
- tx = ~((angle >> 1) + uoffs) & 0x1f;
- ppbot = tex[(ty << 5) + tx];
-
- angle = (tun >> 16) & 0xff;
- depth = (tun >> 24) & 0xff;
- tx = ((angle >> 1) - uoffs) & 0x1f;
+ pptop = TEXEL(tx, ty, shade);
+ tx = ~(angle + uoffs) & 0x1f;
+ ppbot = TEXEL(tx, ty, shade);
+
+ angle = TUN_U(tun >> 16);
+ depth = TUN_V(tun >> 16);
+ shade = depth >> 7;
+ tx = (angle - uoffs) & 0x1f;