raze/source/games/blood/src/view.h

119 lines
3.3 KiB
C
Raw Normal View History

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
#include "build.h"
2019-09-19 22:42:45 +00:00
#include "palette.h"
#include "common_game.h"
#include "messages.h"
#include "player.h"
#include "interpolate.h"
#include "bloodactor.h"
2019-09-19 22:42:45 +00:00
BEGIN_BLD_NS
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 {
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;
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;
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);
void UpdateStatusBar(DBloodPlayer* pPlayer);
2019-09-19 22:42:45 +00:00
void viewInit(void);
void viewprocessSprites(tspriteArray& tsprites, int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t smooth);
void viewSetMessage(const char* pMessage, const char* color = nullptr, const MESSAGE_PRIORITY priority = MESSAGE_PRIORITY_NORMAL);
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);
void viewUpdateDelirium(DBloodPlayer* pPlayer);
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
}
inline void viewBackupSpriteLoc(DBloodActor* actor)
2019-09-19 22:42:45 +00:00
{
2021-12-29 21:56:21 +00:00
if (!actor->interpolated)
{
actor->backuploc();
2021-12-29 21:56:21 +00:00
actor->interpolated = true;
}
2019-09-19 22:42:45 +00:00
}
END_BLD_NS