- same procedure for Blood

This commit is contained in:
Christoph Oelckers 2020-08-24 19:47:09 +02:00
parent debb4b17b6
commit 0ee042fb60
8 changed files with 46 additions and 87 deletions

View file

@ -183,22 +183,15 @@ void ctrlGetInput(void)
UsesToSend.byte = 0; UsesToSend.byte = 0;
WeaponToSend = 0; WeaponToSend = 0;
if (buttonMap.ButtonDown(gamefunc_Map))
{
buttonMap.ClearButton(gamefunc_Map);
viewToggle(gViewMode);
}
if (buttonMap.ButtonDown(gamefunc_Map_Follow_Mode)) if (buttonMap.ButtonDown(gamefunc_Map_Follow_Mode))
{ {
buttonMap.ClearButton(gamefunc_Map_Follow_Mode); buttonMap.ClearButton(gamefunc_Map_Follow_Mode);
gFollowMap = !gFollowMap; automapFollow = !automapFollow;
gViewMap.FollowMode(gFollowMap);
} }
if (buttonMap.ButtonDown(gamefunc_Shrink_Screen)) if (buttonMap.ButtonDown(gamefunc_Shrink_Screen))
{ {
if (gViewMode == 3) if (automapMode == am_off)
{ {
buttonMap.ClearButton(gamefunc_Shrink_Screen); buttonMap.ClearButton(gamefunc_Shrink_Screen);
if (!SHIFTS_IS_PRESSED) if (!SHIFTS_IS_PRESSED)
@ -210,7 +203,7 @@ void ctrlGetInput(void)
hud_scale = hud_scale - 4; hud_scale = hud_scale - 4;
} }
} }
if (gViewMode == 4) if (automapMode != am_off)
{ {
gZoom = ClipLow(gZoom - (gZoom >> 4), 64); gZoom = ClipLow(gZoom - (gZoom >> 4), 64);
gViewMap.nZoom = gZoom; gViewMap.nZoom = gZoom;
@ -219,7 +212,7 @@ void ctrlGetInput(void)
if (buttonMap.ButtonDown(gamefunc_Enlarge_Screen)) if (buttonMap.ButtonDown(gamefunc_Enlarge_Screen))
{ {
if (gViewMode == 3) if (automapMode == am_off)
{ {
buttonMap.ClearButton(gamefunc_Enlarge_Screen); buttonMap.ClearButton(gamefunc_Enlarge_Screen);
if (!SHIFTS_IS_PRESSED) if (!SHIFTS_IS_PRESSED)
@ -231,8 +224,7 @@ void ctrlGetInput(void)
hud_scale = hud_scale + 4; hud_scale = hud_scale + 4;
} }
} }
if ( if (automapMode != am_off)
gViewMode == 4)
{ {
gZoom = ClipHigh(gZoom + (gZoom >> 4), 4096); gZoom = ClipHigh(gZoom + (gZoom >> 4), 4096);
gViewMap.nZoom = gZoom; gViewMap.nZoom = gZoom;
@ -368,7 +360,7 @@ void ctrlGetInput(void)
input.q16mlook = fix16_ssub(input.q16mlook, fix16_from_dbl(scaleAdjustmentToInterval(info.dpitch / mlookScale))); input.q16mlook = fix16_ssub(input.q16mlook, fix16_from_dbl(scaleAdjustmentToInterval(info.dpitch / mlookScale)));
if (!gViewMap.bFollowMode && gViewMode == 4) if (!automapFollow && automapMode != am_off)
{ {
gViewMap.turn += input.q16turn<<2; gViewMap.turn += input.q16turn<<2;
gViewMap.forward += input.forward; gViewMap.forward += input.forward;

View file

@ -44,9 +44,6 @@ static int _line;
int32_t gTurnSpeed = 92; int32_t gTurnSpeed = 92;
int32_t gDetail = 4; int32_t gDetail = 4;
int32_t gFollowMap = 1;
int32_t gOverlayMap = 0;
int32_t gRotateMap = 0;
bool gNoClip; bool gNoClip;
bool gInfiniteAmmo; bool gInfiniteAmmo;
int32_t gDeliriumBlur = 1; int32_t gDeliriumBlur = 1;

View file

@ -41,9 +41,6 @@ extern bool bVanilla;
extern int32_t gTurnSpeed; extern int32_t gTurnSpeed;
extern int32_t gDetail; extern int32_t gDetail;
extern int32_t gFollowMap;
extern int32_t gOverlayMap;
extern int32_t gRotateMap;
extern bool gNoClip; extern bool gNoClip;
extern bool gInfiniteAmmo; extern bool gInfiniteAmmo;
extern int32_t gDeliriumBlur; extern int32_t gDeliriumBlur;

View file

@ -133,7 +133,7 @@ void sub_2541C(int x, int y, int z, short a)
for (int i = connecthead; i >= 0; i = connectpoint2[i]) for (int i = connecthead; i >= 0; i = connectpoint2[i])
{ {
if (gViewMap.bFollowMode || gView->nPlayer != i) if (automapFollow || gView->nPlayer != i)
{ {
PLAYER *pPlayer = &gPlayer[i]; PLAYER *pPlayer = &gPlayer[i];
spritetype *pSprite = pPlayer->pSprite; spritetype *pSprite = pPlayer->pSprite;
@ -168,19 +168,12 @@ void sub_2541C(int x, int y, int z, short a)
} }
} }
CViewMap::CViewMap() void CViewMap::sub_25C38(int _x, int _y, int _angle, short zoom)
{ {
bActive = 0;
}
void CViewMap::sub_25C38(int _x, int _y, int _angle, short zoom, char unk1)
{
bActive = 1;
x = _x; x = _x;
y = _y; y = _y;
angle = _angle; angle = _angle;
nZoom = zoom; nZoom = zoom;
FollowMode(unk1);
forward = 0; forward = 0;
turn = 0; turn = 0;
strafe = 0; strafe = 0;
@ -188,10 +181,7 @@ void CViewMap::sub_25C38(int _x, int _y, int _angle, short zoom, char unk1)
void CViewMap::sub_25C74(void) void CViewMap::sub_25C74(void)
{ {
char pBuffer[128]; int tm = 0;
if (!bActive)
return;
char tm = 0;
if (windowxy1.x > 0) if (windowxy1.x > 0)
{ {
setViewport(Hud_Stbar); setViewport(Hud_Stbar);
@ -201,30 +191,6 @@ void CViewMap::sub_25C74(void)
twod->AddColorOnlyQuad(windowxy1.x, windowxy1.y, (windowxy2.x + 1) - windowxy1.x, (windowxy2.y + 1) - windowxy1.y, 0xff000000); twod->AddColorOnlyQuad(windowxy1.x, windowxy1.y, (windowxy2.x + 1) - windowxy1.x, (windowxy2.y + 1) - windowxy1.y, 0xff000000);
renderDrawMapView(x,y,nZoom>>2,angle); renderDrawMapView(x,y,nZoom>>2,angle);
sub_2541C(x,y,nZoom>>2,angle); sub_2541C(x,y,nZoom>>2,angle);
const char *pTitle = currentLevel->DisplayName();
const char *pFilename = currentLevel->LabelName();
if (pTitle)
sprintf(pBuffer, "%s: %s", pFilename, pTitle);
else
sprintf(pBuffer, "%s", pFilename);
#if 0
int nViewY;
if (g ViewSize > 3)
nViewY = gViewY1S-16;
else
nViewY = gViewY0S+1;
viewDrawText(3, pBuffer, gViewX1S /2, nViewY, -128, 0, 2, 0, 256);
#else
// This needs fixing across games, so for the time being just print the text into the upper left corner
viewDrawText(3, pBuffer, 3, 3, -128, 0, 0, 0, 256);
#endif
#if 0 // needs to be generalized
if (gViewMap.bFollowMode)
Printf(PRINT_NOTIFY, "MAP FOLLOW MODE\n");
else
Printf(PRINT_NOTIFY, "MAP SCROLL MODE\n");
#endif
if (tm) if (tm)
setViewport(hud_size); setViewport(hud_size);
} }
@ -232,7 +198,7 @@ void CViewMap::sub_25C74(void)
void CViewMap::sub_25DB0(spritetype *pSprite) void CViewMap::sub_25DB0(spritetype *pSprite)
{ {
nZoom = gZoom; nZoom = gZoom;
if (bFollowMode) if (automapFollow)
{ {
x = pSprite->x; x = pSprite->x;
y = pSprite->y; y = pSprite->y;
@ -260,10 +226,6 @@ void CViewMap::sub_25E84(int *_x, int *_y)
*_y = y; *_y = y;
} }
void CViewMap::FollowMode(char mode)
{
bFollowMode = mode;
}
CViewMap gViewMap; CViewMap gViewMap;

View file

@ -31,15 +31,12 @@ public:
char bActive; char bActive;
int x, y, nZoom; int x, y, nZoom;
short angle; short angle;
char bFollowMode;
int forward, strafe; int forward, strafe;
fix16_t turn; fix16_t turn;
CViewMap(); void sub_25C38(int, int, int, short);
void sub_25C38(int, int, int, short, char);
void sub_25C74(void); void sub_25C74(void);
void sub_25DB0(spritetype *pSprite); void sub_25DB0(spritetype *pSprite);
void sub_25E84(int *, int*); void sub_25E84(int *, int*);
void FollowMode(char);
}; };
extern CViewMap gViewMap; extern CViewMap gViewMap;

View file

@ -187,7 +187,36 @@ private:
void PrintLevelStats(PLAYER* pPlayer, int bottomy) void PrintLevelStats(PLAYER* pPlayer, int bottomy)
{ {
if (gViewMode == 3 && hud_stats) if (automapMode == am_full)
{
FString pBuffer;
const char *pTitle = currentLevel->DisplayName();
const char *pFilename = currentLevel->LabelName();
if (pTitle)
pBuffer.Format("%s: %s", pFilename, pTitle);
else
pBuffer = pFilename;
#if 0
int nViewY;
if (g ViewSize > 3)
nViewY = gViewY1S-16;
else
nViewY = gViewY0S+1;
viewDrawText(3, pBuffer, gViewX1S /2, nViewY, -128, 0, 2, 0, 256);
#else
// This needs fixing across games, so for the time being just print the text into the upper left corner
viewDrawText(3, pBuffer, 3, 3, -128, 0, 0, 0, 256);
#endif
#if 0 // needs to be generalized
if (automapFollow)
Printf(PRINT_NOTIFY, "MAP FOLLOW MODE\n");
else
Printf(PRINT_NOTIFY, "MAP SCROLL MODE\n");
#endif
}
if (automapMode == am_off && hud_stats)
{ {
FLevelStats stats{}; FLevelStats stats{};
@ -815,7 +844,7 @@ void UpdateStatusBar(ClockTicks arg)
{ {
DBloodStatusBar sbar; DBloodStatusBar sbar;
if (gViewMode == 3 && hud_size <= Hud_Stbar) if (automapMode == am_off && hud_size <= Hud_Stbar)
{ {
UpdateFrame(); UpdateFrame();
} }

View file

@ -61,8 +61,6 @@ struct INTERPOLATE {
INTERPOLATE_TYPE type; INTERPOLATE_TYPE type;
}; };
int gViewMode = 3;
double gInterpolate; double gInterpolate;
int nInterpolations; int nInterpolations;
char gInterpolateSprite[(kMaxSprites+7)>>3]; char gInterpolateSprite[(kMaxSprites+7)>>3];
@ -103,16 +101,6 @@ void FontSet(int id, int tile, int space)
if (ptrs[id]) *ptrs[id] = gFont[id]; if (ptrs[id]) *ptrs[id] = gFont[id];
} }
void viewToggle(int viewMode)
{
if (viewMode == 3)
gViewMode = 4;
else
{
gViewMode = 3;
}
}
void viewBackupView(int nPlayer) void viewBackupView(int nPlayer)
{ {
PLAYER *pPlayer = &gPlayer[nPlayer]; PLAYER *pPlayer = &gPlayer[nPlayer];
@ -355,7 +343,7 @@ void viewInit(void)
dword_172CE0[i][1] = mulscale16(wrand(), 2048); dword_172CE0[i][1] = mulscale16(wrand(), 2048);
dword_172CE0[i][2] = mulscale16(wrand(), 2048); dword_172CE0[i][2] = mulscale16(wrand(), 2048);
} }
gViewMap.sub_25C38(0, 0, gZoom, 0, gFollowMap); gViewMap.sub_25C38(0, 0, gZoom, 0);
} }
void viewDrawInterface(ClockTicks arg) void viewDrawInterface(ClockTicks arg)
@ -680,11 +668,11 @@ void viewDrawScreen(bool sceneonly)
CalcInterpolations(); CalcInterpolations();
} }
if (gViewMode == 3 || gViewMode == 4 || gOverlayMap) if (automapMode != am_full)
{ {
DoSectorLighting(); DoSectorLighting();
} }
if (gViewMode == 3 || gOverlayMap) if (automapMode == am_off)
{ {
int basepal = 0; int basepal = 0;
if (powerupCheck(gView, kPwUpDeathMask) > 0) basepal = 4; if (powerupCheck(gView, kPwUpDeathMask) > 0) basepal = 4;
@ -1046,7 +1034,7 @@ void viewDrawScreen(bool sceneonly)
hudDraw(gView, nSectnum, defaultHoriz, v4c, v48, zDelta, basepal); hudDraw(gView, nSectnum, defaultHoriz, v4c, v48, zDelta, basepal);
} }
UpdateDacs(0, true); // keep the view palette active only for the actual 3D view and its overlays. UpdateDacs(0, true); // keep the view palette active only for the actual 3D view and its overlays.
if (gViewMode == 4) if (automapMode != am_off)
{ {
gViewMap.sub_25DB0(gView->pSprite); gViewMap.sub_25DB0(gView->pSprite);
} }

View file

@ -129,7 +129,6 @@ enum
extern int gZoom; extern int gZoom;
extern FFont *gFont[kFontNum]; extern FFont *gFont[kFontNum];
extern int gViewMode;
extern VIEWPOS gViewPos; extern VIEWPOS gViewPos;
extern int gViewIndex; extern int gViewIndex;
extern int gScreenTilt; extern int gScreenTilt;
@ -140,12 +139,10 @@ extern char gInterpolateSprite[];
extern char gInterpolateWall[]; extern char gInterpolateWall[];
extern char gInterpolateSector[]; extern char gInterpolateSector[];
extern LOCATION gPrevSpriteLoc[kMaxSprites]; extern LOCATION gPrevSpriteLoc[kMaxSprites];
extern int gViewMode;
extern int gLastPal; extern int gLastPal;
extern double gInterpolate; extern double gInterpolate;
void hudDraw(PLAYER* gView, int nSectnum, int defaultHoriz, double bobx, double boby, double zDelta, int basepal); void hudDraw(PLAYER* gView, int nSectnum, int defaultHoriz, double bobx, double boby, double zDelta, int basepal);
void viewToggle(int viewMode);
void viewInitializePrediction(void); void viewInitializePrediction(void);
void viewUpdatePrediction(GINPUT *pInput); void viewUpdatePrediction(GINPUT *pInput);
void viewCorrectPrediction(void); void viewCorrectPrediction(void);