Lots of feature upgrades.

This commit is contained in:
Justin Marshall
2026-05-30 02:50:21 -07:00
parent 7806bb8ef8
commit ea74cd9921
13 changed files with 2433 additions and 153 deletions
+247 -28
View File
@@ -44,24 +44,233 @@
#include "multi.h"
#define T_POUTC 165
#define TOWN_PLAYER_LIGHT 1
// #define TESTINGCRYPT // JKE set this to keep the crypt open
#if RLE_DRAW
void DrawUnit (long xp,long yp,BYTE *pCelBuff,long nCel,long nCelW,long ostart,long oend);
void DrawLitUnit (long xp,long yp,BYTE *pCelBuff,long nCel,long nCelW,long ostart,long oend);
void DrawLitUnitLerpOverlay(long xp, long yp, BYTE *pCelBuff, long nCel, long nCelW, long ostart, long oend, int density);
void DrawUnitClipped (long xp,long yp,BYTE *pCelBuff,long nCel,long nCelW,long ostart,long oend);
void DrawLitUnitClipped (long xp,long yp,BYTE *pCelBuff,long nCel,long nCelW,long ostart,long oend);
void DrawLitUnitLerpOverlayClipped(long xp, long yp, BYTE *pCelBuff, long nCel, long nCelW, long ostart, long oend, int density);
void DrawUnitOutline(byte ocolor, long xp, long yp, BYTE *pCelBuff, long nCel, long nCelW, long ostart, long oend);
void DrawUnitOutlineClipped(byte ocolor, long xp, long yp, BYTE *pCelBuff, long nCel, long nCelW, long ostart, long oend);
#endif
extern "C" {
extern int gnTownTileX;
extern int gnTownTileY;
extern int gnTownFlickerFrame;
}
extern int gnRenderFrameInterp;
extern int PlrWalkLenTbl[NUM_CLASSES];
static void T_DrawHTLXsub (BYTE *pTo, int sx, int sy, int xp, int yp, BOOL chflag);
static void T_DrawHTLXsub2 (BYTE *pTo, int sx, int sy, int sv, int sv2, int xp, int yp, BOOL chflag);
static void T_DrawHTLXsub3 (BYTE *pTo, int sx, int sy, int ev, int ev2, int xp, int yp, BOOL chflag);
static void T_DrawPlayerTownUnit(PlayerStruct *pPlayer, int xp, int yp, BYTE *pCelBuff, long nCel, long nCelW, long ostart, long oend, BOOL clipped);
void ApplyWorldGoldShimmer(ItemStruct *pItem, int itemIndex, int x, int y, int ostart, int oend);
void plrmsg_draw();
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static void T_SetTownTile(int sx, int sy)
{
gnTownTileX = sx;
gnTownTileY = sy;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static int T_VisualHalfStep(long velocity)
{
int interp;
__int64 step;
interp = gnRenderFrameInterp;
if (interp <= 0 || velocity == 0)
return 0;
if (interp > 256)
interp = 256;
step = velocity;
if (step < 0)
return -(int)(((-step) * interp) >> 16);
return (int)((step * interp) >> 16);
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static BOOL T_PlayerUsesVisualLerp(PlayerStruct *pPlayer)
{
return pPlayer->_pmode == PM_WALK
|| pPlayer->_pmode == PM_WALK2
|| pPlayer->_pmode == PM_WALK3;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static BOOL T_PlayerHasVisualStep(PlayerStruct *pPlayer)
{
int walkLen;
walkLen = 8;
if (currlevel != 0)
walkLen = PlrWalkLenTbl[pPlayer->_pClass];
return pPlayer->_pVar8 < walkLen;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static int T_GetPlayerDrawX(PlayerStruct *pPlayer, int xp)
{
xp += pPlayer->_pxoff;
if (T_PlayerUsesVisualLerp(pPlayer) && T_PlayerHasVisualStep(pPlayer))
xp += T_VisualHalfStep(pPlayer->_pxvel);
return xp;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static int T_GetPlayerDrawY(PlayerStruct *pPlayer, int yp)
{
yp += pPlayer->_pyoff;
if (T_PlayerUsesVisualLerp(pPlayer) && T_PlayerHasVisualStep(pPlayer))
yp += T_VisualHalfStep(pPlayer->_pyvel);
return yp;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static int T_GetScrollDrawX()
{
int sxoff;
PlayerStruct *pPlayer;
sxoff = ScrollInfo._sxoff;
if (ScrollInfo._sdir == SCRL_NONE)
return sxoff;
pPlayer = &plr[myplr];
if (T_PlayerUsesVisualLerp(pPlayer) && T_PlayerHasVisualStep(pPlayer))
sxoff -= T_VisualHalfStep(pPlayer->_pxvel);
return sxoff;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static int T_GetScrollDrawY()
{
int syoff;
PlayerStruct *pPlayer;
syoff = ScrollInfo._syoff;
if (ScrollInfo._sdir == SCRL_NONE)
return syoff;
pPlayer = &plr[myplr];
if (T_PlayerUsesVisualLerp(pPlayer) && T_PlayerHasVisualStep(pPlayer))
syoff -= T_VisualHalfStep(pPlayer->_pyvel);
return syoff;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static int T_GetVisualLerpDensity(int animCnt, int animDelay)
{
int interp;
int progress;
int density;
if (animDelay <= 1)
return 0;
interp = gnRenderFrameInterp;
if (interp < 0)
interp = 0;
if (interp > 256)
interp = 256;
progress = animCnt * 256 + interp;
density = (progress * 4) / (animDelay * 256);
if (density < 1)
return 0;
if (density > 3)
density = 3;
return density;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static int T_GetPlayerLerpFrame(PlayerStruct *pPlayer, int *density)
{
int frame;
*density = T_GetVisualLerpDensity(pPlayer->_pAnimCnt, pPlayer->_pAnimDelay);
if (*density == 0)
return 0;
frame = pPlayer->_pAnimFrame + 1;
if (frame > pPlayer->_pAnimLen)
return 0;
return frame;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
static void T_DrawPlayerTownUnit(PlayerStruct *pPlayer, int xp, int yp, BYTE *pCelBuff, long nCel, long nCelW, long ostart, long oend, BOOL clipped)
{
long oldnLVal;
int density, nextFrame;
oldnLVal = nLVal;
nLVal = TOWN_PLAYER_LIGHT;
#if RLE_DRAW
if (clipped)
DrawLitUnitClipped(xp, yp, pCelBuff, nCel, nCelW, ostart, oend);
else
DrawLitUnit(xp, yp, pCelBuff, nCel, nCelW, ostart, oend);
nextFrame = T_GetPlayerLerpFrame(pPlayer, &density);
if (nextFrame) {
if (clipped)
DrawLitUnitLerpOverlayClipped(xp, yp, pCelBuff, nextFrame, nCelW, ostart, oend, density);
else
DrawLitUnitLerpOverlay(xp, yp, pCelBuff, nextFrame, nCelW, ostart, oend, density);
}
#else
if (clipped)
CDrawSlabCelL(xp, yp, pCelBuff, nCel, nCelW, ostart, oend);
else
DrawSlabCelL(xp, yp, pCelBuff, nCel, nCelW, ostart, oend);
#endif
nLVal = oldnLVal;
}
/*-----------------------------------------------------------------------**
**-----------------------------------------------------------------------*/
void TDrawBlankMini(BYTE *pDecodeTo)
{
app_assert(gpBuffer);
@@ -289,6 +498,7 @@ void T_DrawEFlag1(BYTE *pTo2, int sx, int sy, int xp, int yp)
pTo = pTo2;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 12; t += 2)
{
if (gdwPNum = mt[t]) DrawMTileClipBottom (pTo);
@@ -315,6 +525,7 @@ static void T_DrawHTLXsub (BYTE *pTo, int sx, int sy, int xp, int yp, BOOL chfla
pxp = xp - item[bv]._iAnimWidth2;
if (bv == cursitem) COutlineSlabCel(181, pxp, yp, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, 8);
CDrawSlabCel(pxp, yp, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, 8);
ApplyWorldGoldShimmer(&item[bv], bv, pxp, yp, 0, 8);
}
if ((dFlags[sx][sy] & BFLAG_MONSTLR) != 0) {
mi = -(dMonster[sx][sy-1] + 1);
@@ -332,16 +543,15 @@ static void T_DrawHTLXsub (BYTE *pTo, int sx, int sy, int xp, int yp, BOOL chfla
}
if ((dFlags[sx][sy] & BFLAG_PLRLR) != 0) {
bv = -(dPlayer[sx][sy-1] + 1);
pxp = plr[bv]._pxoff + xp - plr[bv]._pAnimWidth2;
pyp = plr[bv]._pyoff + yp;
pxp = T_GetPlayerDrawX(&plr[bv], xp) - plr[bv]._pAnimWidth2;
pyp = T_GetPlayerDrawY(&plr[bv], yp);
#if RLE_DRAW
if (bv == cursplr) DrawUnitOutlineClipped(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
DrawUnitClipped(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
#else
if (bv == cursplr) COutlineSlabCel(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
CDrawSlabCel(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
#endif
T_DrawPlayerTownUnit(&plr[bv], pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8, TRUE);
if (chflag)
{
@@ -353,16 +563,15 @@ static void T_DrawHTLXsub (BYTE *pTo, int sx, int sy, int xp, int yp, BOOL chfla
DrawDeadPlr(sx, sy, xp, yp, 0, 8, TRUE);
if (dPlayer[sx][sy] > 0) {
bv = dPlayer[sx][sy] - 1;
pxp = plr[bv]._pxoff + xp - plr[bv]._pAnimWidth2;
pyp = plr[bv]._pyoff + yp;
pxp = T_GetPlayerDrawX(&plr[bv], xp) - plr[bv]._pAnimWidth2;
pyp = T_GetPlayerDrawY(&plr[bv], yp);
#if RLE_DRAW
if (bv == cursplr) DrawUnitOutlineClipped(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
DrawUnitClipped(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
#else
if (bv == cursplr) COutlineSlabCel(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
CDrawSlabCel(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8);
#endif
T_DrawPlayerTownUnit(&plr[bv], pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, 8, TRUE);
if (chflag)
{
@@ -390,6 +599,7 @@ void T_DrawHTileLineX (int sx, int sy, int xp, int yp, int nd, int halfflag)
if (gdwPNum = dPiece[sx][sy]) {
pTo = gpBuffer + nBuffWTbl[yp] + xp + 32;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 1; t < 17; t += 2)
{
@@ -419,6 +629,7 @@ void T_DrawHTileLineX (int sx, int sy, int xp, int yp, int nd, int halfflag)
if (gdwPNum != 0) {
pTo = gpBuffer + nBuffWTbl[yp] + xp;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 16; t+= 2)
{
@@ -447,6 +658,7 @@ void T_DrawHTileLineX (int sx, int sy, int xp, int yp, int nd, int halfflag)
if (gdwPNum != 0) {
pTo = gpBuffer + nBuffWTbl[yp] + xp;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 16; t+= 2)
{
@@ -480,6 +692,7 @@ void T_DrawEFlag2(BYTE *pTo2, int sx, int sy, int sv, int sv2, int xp, int yp)
else
pTo = pTo2 + (NBUFFWSL5 * sv);
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 6; t++)
{
@@ -509,6 +722,7 @@ static void T_DrawHTLXsub2 (BYTE *pTo, int sx, int sy, int sv, int sv2, int xp,
pxp = xp - item[bv]._iAnimWidth2;
if (bv == cursitem) COutlineSlabCel(181, pxp, yp, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, sv2, 8);
CDrawSlabCel(pxp, yp, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, sv2, 8);
ApplyWorldGoldShimmer(&item[bv], bv, pxp, yp, sv2, 8);
}
if ((dFlags[sx][sy] & BFLAG_MONSTLR) != 0) {
mi = -(dMonster[sx][sy-1] + 1);
@@ -526,16 +740,15 @@ static void T_DrawHTLXsub2 (BYTE *pTo, int sx, int sy, int sv, int sv2, int xp,
}
if ((dFlags[sx][sy] & BFLAG_PLRLR) != 0) {
bv = -(dPlayer[sx][sy-1] + 1);
pxp = plr[bv]._pxoff + xp - plr[bv]._pAnimWidth2;
pyp = plr[bv]._pyoff + yp;
pxp = T_GetPlayerDrawX(&plr[bv], xp) - plr[bv]._pAnimWidth2;
pyp = T_GetPlayerDrawY(&plr[bv], yp);
#if RLE_DRAW
if (bv == cursplr) DrawUnitOutlineClipped(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8);
DrawUnitClipped(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8);
#else
if (bv == cursplr) COutlineSlabCel(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8);
CDrawSlabCel(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8);
#endif
T_DrawPlayerTownUnit(&plr[bv], pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8, TRUE);
if (chflag)
{
@@ -547,16 +760,15 @@ static void T_DrawHTLXsub2 (BYTE *pTo, int sx, int sy, int sv, int sv2, int xp,
DrawDeadPlr(sx, sy, xp, yp, sv2, 8, TRUE);
if (dPlayer[sx][sy] > 0) {
bv = dPlayer[sx][sy] - 1;
pxp = plr[bv]._pxoff + xp - plr[bv]._pAnimWidth2;
pyp = plr[bv]._pyoff + yp;
pxp = T_GetPlayerDrawX(&plr[bv], xp) - plr[bv]._pAnimWidth2;
pyp = T_GetPlayerDrawY(&plr[bv], yp);
#if RLE_DRAW
if (bv == cursplr) DrawUnitOutlineClipped(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8);
DrawUnitClipped(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8);
#else
if (bv == cursplr) COutlineSlabCel(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8);
CDrawSlabCel(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8);
#endif
T_DrawPlayerTownUnit(&plr[bv], pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, sv2, 8, TRUE);
if (chflag)
{
@@ -586,6 +798,7 @@ void T_DrawHTLX2 (int sx, int sy, int xp, int yp, int nd, int sv, int halfflag)
if (gdwPNum = dPiece[sx][sy]) {
pTo = gpBuffer + nBuffWTbl[yp] + xp - NBUFFWSL5 + 32;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 7; t++)
{
@@ -617,6 +830,7 @@ void T_DrawHTLX2 (int sx, int sy, int xp, int yp, int nd, int sv, int halfflag)
if (gdwPNum != 0) {
pTo = gpBuffer + nBuffWTbl[yp] + xp - NBUFFWSL5;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 7; t++)
{
if (sv <= t) {
@@ -649,6 +863,7 @@ void T_DrawHTLX2 (int sx, int sy, int xp, int yp, int nd, int sv, int halfflag)
if (gdwPNum != 0) {
pTo = gpBuffer + nBuffWTbl[yp] + xp - NBUFFWSL5;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 7; t++)
{
@@ -683,6 +898,7 @@ void T_DrawEFlag3(BYTE *pTo2, int sx, int sy, int ev, int ev2, int xp, int yp)
pTo = pTo2;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 7; t++)
{
@@ -710,6 +926,7 @@ static void T_DrawHTLXsub3 (BYTE *pTo, int sx, int sy, int ev, int ev2, int xp,
if (bv == cursitem) OutlineSlabCel(181, pxp, yp, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, ev2);
app_assert(item[bv]._iAnimData);
DrawSlabCel(pxp, yp, item[bv]._iAnimData, item[bv]._iAnimFrame, item[bv]._iAnimWidth, 0, ev2);
ApplyWorldGoldShimmer(&item[bv], bv, pxp, yp, 0, ev2);
}
if ((dFlags[sx][sy] & BFLAG_MONSTLR) != 0) {
mi = -(dMonster[sx][sy-1] + 1);
@@ -729,18 +946,17 @@ static void T_DrawHTLXsub3 (BYTE *pTo, int sx, int sy, int ev, int ev2, int xp,
}
if ((dFlags[sx][sy] & BFLAG_PLRLR) != 0) {
bv = -(dPlayer[sx][sy-1] + 1);
pxp = plr[bv]._pxoff + xp - plr[bv]._pAnimWidth2;
pyp = plr[bv]._pyoff + yp;
pxp = T_GetPlayerDrawX(&plr[bv], xp) - plr[bv]._pAnimWidth2;
pyp = T_GetPlayerDrawY(&plr[bv], yp);
#if RLE_DRAW
if (bv == cursplr) DrawUnitOutline(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2);
app_assert(plr[bv]._pAnimData);
DrawUnit(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2);
#else
if (bv == cursplr) OutlineSlabCel(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2);
app_assert(plr[bv]._pAnimData);
DrawSlabCel(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2);
#endif
T_DrawPlayerTownUnit(&plr[bv], pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2, FALSE);
if (chflag)
{
@@ -752,18 +968,17 @@ static void T_DrawHTLXsub3 (BYTE *pTo, int sx, int sy, int ev, int ev2, int xp,
DrawDeadPlr(sx, sy, xp, yp, 0, ev2, FALSE);
if (dPlayer[sx][sy] > 0) {
bv = dPlayer[sx][sy] - 1;
pxp = plr[bv]._pxoff + xp - plr[bv]._pAnimWidth2;
pyp = plr[bv]._pyoff + yp;
pxp = T_GetPlayerDrawX(&plr[bv], xp) - plr[bv]._pAnimWidth2;
pyp = T_GetPlayerDrawY(&plr[bv], yp);
#if RLE_DRAW
if (bv == cursplr) DrawUnitOutline(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2);
app_assert(plr[bv]._pAnimData);
DrawUnit(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2);
#else
if (bv == cursplr) OutlineSlabCel(T_POUTC, pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2);
app_assert(plr[bv]._pAnimData);
DrawSlabCel(pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2);
#endif
T_DrawPlayerTownUnit(&plr[bv], pxp, pyp, plr[bv]._pAnimData, plr[bv]._pAnimFrame, plr[bv]._pAnimWidth, 0, ev2, FALSE);
if (chflag)
{
@@ -794,6 +1009,7 @@ void T_DrawHTLX3 (int sx, int sy, int xp, int yp, int nd, int ev, int halfflag)
if (gdwPNum = dPiece[sx][sy]) {
pTo = gpBuffer + nBuffWTbl[yp] + xp + 32;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 7; t++)
{
@@ -823,6 +1039,7 @@ void T_DrawHTLX3 (int sx, int sy, int xp, int yp, int nd, int ev, int halfflag)
if (gdwPNum != 0) {
pTo = gpBuffer + nBuffWTbl[yp] + xp;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 7; t++)
{
if (ev >= t) {
@@ -853,6 +1070,7 @@ void T_DrawHTLX3 (int sx, int sy, int xp, int yp, int nd, int ev, int halfflag)
if (gdwPNum != 0) {
pTo = gpBuffer + nBuffWTbl[yp] + xp;
mt = &dMT2[CalcRot(sx,sy)].mt[0];
T_SetTownTile(sx, sy);
for(t = 0; t < 7; t++)
{
@@ -888,8 +1106,8 @@ void T_SVGADrawView (int StartX, int StartY)
ViewBX = 10;
ViewBY = 11;
xpos = 64 + ScrollInfo._sxoff;
ypos = 175 + ScrollInfo._syoff;
xpos = 64 + T_GetScrollDrawX();
ypos = 175 + T_GetScrollDrawY();
StartX -= 10;
StartY -= 1;
width = 10;
@@ -1007,8 +1225,8 @@ void T_VGADrawView (int StartX, int StartY)
ViewBX = 6;
ViewBY = 6;
xpos = 64 + ScrollInfo._sxoff;
ypos = 143 + ScrollInfo._syoff;
xpos = 64 + T_GetScrollDrawX();
ypos = 143 + T_GetScrollDrawY();
StartX -= 6;
StartY -= 1;
width = 6;
@@ -1199,6 +1417,7 @@ _YLp: mov ecx,160
// walls, so we set them here once for the whole screen
nLVal = 0;
nTrans = 0;
gnTownFlickerFrame = GetTickCount() / 120;
if (svgamode) T_SVGADrawView (StartX, StartY);
else T_VGADrawView (StartX, StartY);