2019-09-19 22:42:45 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010-2019 EDuke32 developers and contributors
|
|
|
|
Copyright (C) 2019 Nuke.YKT
|
|
|
|
|
|
|
|
This file is part of NBlood.
|
|
|
|
|
|
|
|
NBlood is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
#pragma once
|
2019-09-07 13:15:39 +00:00
|
|
|
#include "build.h"
|
2019-09-19 22:42:45 +00:00
|
|
|
#include "palette.h"
|
|
|
|
#include "common_game.h"
|
|
|
|
#include "messages.h"
|
|
|
|
#include "player.h"
|
2020-11-26 16:19:42 +00:00
|
|
|
#include "interpolate.h"
|
2021-09-02 18:23:51 +00:00
|
|
|
#include "bloodactor.h"
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
BEGIN_BLD_NS
|
|
|
|
|
2020-08-02 17:43:45 +00:00
|
|
|
extern bool gPrediction;
|
|
|
|
|
2019-09-19 22:42:45 +00:00
|
|
|
enum VIEW_EFFECT {
|
2021-12-29 21:56:21 +00:00
|
|
|
kViewEffectShadow = 0,
|
|
|
|
kViewEffectFlareHalo,
|
|
|
|
kViewEffectCeilGlow,
|
|
|
|
kViewEffectFloorGlow,
|
|
|
|
kViewEffectTorchHigh,
|
|
|
|
kViewEffectTorchLow,
|
|
|
|
kViewEffectSmokeHigh,
|
|
|
|
kViewEffectSmokeLow,
|
|
|
|
kViewEffectFlame,
|
|
|
|
kViewEffectSpear,
|
|
|
|
kViewEffectTrail,
|
|
|
|
kViewEffectPhase,
|
|
|
|
kViewEffectShowWeapon,
|
|
|
|
kViewEffectReflectiveBall,
|
|
|
|
kViewEffectShoot,
|
|
|
|
kViewEffectTesla,
|
|
|
|
kViewEffectFlag,
|
|
|
|
kViewEffectBigFlag,
|
|
|
|
kViewEffectAtom,
|
|
|
|
kViewEffectSpotProgress,
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
enum VIEWPOS {
|
2023-09-26 19:09:35 +00:00
|
|
|
viewFirstPerson = 0,
|
|
|
|
viewThirdPerson
|
2019-09-19 22:42:45 +00:00
|
|
|
};
|
|
|
|
|
2020-10-11 09:52:30 +00:00
|
|
|
enum { kFontNum = 5 };
|
2020-01-02 09:45:31 +00:00
|
|
|
|
2021-12-29 21:56:21 +00:00
|
|
|
extern FFont* gFont[kFontNum];
|
2019-09-19 22:42:45 +00:00
|
|
|
extern VIEWPOS gViewPos;
|
|
|
|
extern int gViewIndex;
|
2022-08-27 08:53:34 +00:00
|
|
|
extern int deliriumTilt, deliriumPitch;
|
|
|
|
extern int deliriumPitchO;
|
|
|
|
extern DAngle deliriumTurnO, deliriumTurn;
|
|
|
|
extern DAngle gScreenTiltO, gScreenTilt;
|
2019-09-19 22:42:45 +00:00
|
|
|
extern int gShowFrameRate;
|
|
|
|
extern int gLastPal;
|
|
|
|
|
2023-10-02 19:03:59 +00:00
|
|
|
void hudDraw(DBloodPlayer* pPlayer, sectortype* pSector, double bobx, double boby, double zDelta, DAngle angle, int basepal, double interpfrac);
|
2019-09-19 22:42:45 +00:00
|
|
|
void viewInitializePrediction(void);
|
2021-12-29 21:56:21 +00:00
|
|
|
void viewUpdatePrediction(InputPacket* pInput);
|
2019-09-19 22:42:45 +00:00
|
|
|
void viewCorrectPrediction(void);
|
|
|
|
void viewBackupView(int nPlayer);
|
|
|
|
void InitStatusBar(void);
|
2023-10-02 19:03:59 +00:00
|
|
|
void UpdateStatusBar(DBloodPlayer* pPlayer);
|
2019-09-19 22:42:45 +00:00
|
|
|
void viewInit(void);
|
2022-08-07 08:25:15 +00:00
|
|
|
void viewprocessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t smooth);
|
2022-01-22 08:38:01 +00:00
|
|
|
void viewSetMessage(const char* pMessage, const char* color = nullptr, const MESSAGE_PRIORITY priority = MESSAGE_PRIORITY_NORMAL);
|
2020-07-31 19:06:56 +00:00
|
|
|
|
|
|
|
|
2021-12-29 21:56:21 +00:00
|
|
|
void viewSetErrorMessage(const char* pMessage);
|
2019-09-19 22:42:45 +00:00
|
|
|
void DoLensEffect(void);
|
|
|
|
void UpdateDacs(int nPalette, bool bNoTint = false);
|
2020-01-14 20:20:46 +00:00
|
|
|
void viewDrawScreen(bool sceneonly = false);
|
2023-10-02 19:03:59 +00:00
|
|
|
void viewUpdateDelirium(DBloodPlayer* pPlayer);
|
2019-10-07 19:29:52 +00:00
|
|
|
void viewSetSystemMessage(const char* pMessage, ...);
|
2019-09-19 22:42:45 +00:00
|
|
|
|
2021-12-29 21:56:21 +00:00
|
|
|
inline void viewInterpolateSector(sectortype* pSector)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-12-29 21:56:21 +00:00
|
|
|
StartInterpolation(pSector, Interp_Sect_Floorz);
|
|
|
|
StartInterpolation(pSector, Interp_Sect_Ceilingz);
|
|
|
|
StartInterpolation(pSector, Interp_Sect_Floorheinum);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2021-12-29 21:56:21 +00:00
|
|
|
inline void viewInterpolateWall(walltype* pWall)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-12-29 21:56:21 +00:00
|
|
|
StartInterpolation(pWall, Interp_Wall_X);
|
|
|
|
StartInterpolation(pWall, Interp_Wall_Y);
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
|
|
|
|
2021-09-05 10:35:13 +00:00
|
|
|
inline void viewBackupSpriteLoc(DBloodActor* actor)
|
2019-09-19 22:42:45 +00:00
|
|
|
{
|
2021-12-29 21:56:21 +00:00
|
|
|
if (!actor->interpolated)
|
|
|
|
{
|
2021-12-30 16:10:08 +00:00
|
|
|
actor->backuploc();
|
2021-12-29 21:56:21 +00:00
|
|
|
actor->interpolated = true;
|
|
|
|
}
|
2019-09-19 22:42:45 +00:00
|
|
|
}
|
2019-09-22 06:39:22 +00:00
|
|
|
|
2020-12-05 11:54:26 +00:00
|
|
|
|
2019-09-22 06:39:22 +00:00
|
|
|
END_BLD_NS
|