2016-03-01 15:47:10 +00:00
|
|
|
#ifndef __R_RENDERER_H
|
|
|
|
#define __R_RENDERER_H
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
struct FRenderer;
|
|
|
|
extern FRenderer *Renderer;
|
2016-09-20 21:13:12 +00:00
|
|
|
class FSerializer;
|
2016-03-01 15:47:10 +00:00
|
|
|
class FTexture;
|
|
|
|
class AActor;
|
|
|
|
class player_t;
|
|
|
|
struct sector_t;
|
|
|
|
class FCanvasTexture;
|
2016-09-21 07:01:12 +00:00
|
|
|
class FileWriter;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
struct FRenderer
|
|
|
|
{
|
|
|
|
FRenderer()
|
|
|
|
{
|
|
|
|
Renderer = this;
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~FRenderer()
|
|
|
|
{
|
|
|
|
Renderer = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Can be overridden so that the colormaps for sector color/fade won't be built.
|
|
|
|
virtual bool UsesColormap() const = 0;
|
|
|
|
|
|
|
|
// precache one texture
|
2016-05-01 20:47:36 +00:00
|
|
|
virtual void Precache(BYTE *texhitlist, TMap<PClassActor*, bool> &actorhitlist) = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
// render 3D view
|
|
|
|
virtual void RenderView(player_t *player) = 0;
|
|
|
|
|
|
|
|
// Remap voxel palette
|
|
|
|
virtual void RemapVoxels() {}
|
|
|
|
|
|
|
|
// renders view to a savegame picture
|
2016-09-21 07:01:12 +00:00
|
|
|
virtual void WriteSavePic (player_t *player, FileWriter *file, int width, int height) = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
// draws player sprites with hardware acceleration (only useful for software rendering)
|
|
|
|
virtual void DrawRemainingPlayerSprites() {}
|
|
|
|
|
|
|
|
// notifies the renderer that an actor has changed state.
|
|
|
|
virtual void StateChanged(AActor *actor) {}
|
|
|
|
|
|
|
|
// notify the renderer that serialization of the curent level is about to start/end
|
2016-09-20 21:13:12 +00:00
|
|
|
virtual void StartSerialize(FSerializer &arc) {}
|
|
|
|
virtual void EndSerialize(FSerializer &arc) {}
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
virtual int GetMaxViewPitch(bool down) = 0; // return value is in plain degrees
|
|
|
|
|
|
|
|
virtual void OnModeSet () {}
|
|
|
|
virtual void ClearBuffer(int color) = 0;
|
|
|
|
virtual void Init() = 0;
|
|
|
|
virtual void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, int fov) = 0;
|
2017-01-03 17:55:12 +00:00
|
|
|
virtual sector_t *FakeFlat(sector_t *sec, sector_t *tempsec, int *floorlightlevel, int *ceilinglightlevel) = 0;
|
2016-03-01 15:47:10 +00:00
|
|
|
virtual void SetFogParams(int _fogdensity, PalEntry _outsidefogcolor, int _outsidefogdensity, int _skyfog) {}
|
|
|
|
virtual void PreprocessLevel() {}
|
|
|
|
virtual void CleanLevelData() {}
|
|
|
|
virtual bool RequireGLNodes() { return false; }
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|