OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Renderer Class Referenceabstract

#include <Renderer.h>

Inheritance diagram for Renderer:
BaseRenderer NullRenderer OpenGLRenderer

Public Member Functions

 Renderer (std::shared_ptr< GameConfig > config, DecalBuilder *decal_builder, SpellFxRenderer *spellfx, std::shared_ptr< ParticleEngine > particle_engine, Vis *vis)
 
virtual ~Renderer ()
 
virtual bool Initialize ()=0
 
virtual void ClearBlack ()=0
 
virtual void PresentBlackScreen ()=0
 
virtual RgbaImage ReadScreenPixels ()=0
 
virtual void ClearTarget (Color uColor)=0
 
virtual void Present ()=0
 
virtual bool InitializeFullscreen ()=0
 
virtual void CreateZBuffer ()=0
 
virtual void Release ()=0
 
virtual bool SwitchToWindow ()=0
 
virtual void BeginLines2D ()=0
 
virtual void EndLines2D ()=0
 
virtual void RasterLine2D (Pointi a, Pointi b, Color uColor32)=0
 
virtual void DrawLines (const RenderVertexD3D3 *vertices, int num_vertices)=0
 
virtual void ClearZBuffer ()=0
 
virtual void RestoreFrontBuffer ()=0
 
virtual void RestoreBackBuffer ()=0
 
virtual void BltBackToFontFast (int a2, int a3, Recti *a4)=0
 
virtual void BeginScene3D ()=0
 
virtual void MakeParticleBillboardAndPush (SoftwareBillboard *a2, GraphicsImage *texture, Color uDiffuse, int angle)=0
 
virtual float GetGamma ()=0
 
virtual void DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene ()=0
 
virtual void BillboardSphereSpellFX (SpellFX_Billboard *a1, Color diffuse)=0
 
virtual void TransformBillboardsAndSetPalettesODM ()=0
 
virtual void DrawProjectile (float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, GraphicsImage *texture)=0
 
virtual TextureRenderId CreateTexture (RgbaImageView image)=0
 
virtual void DeleteTexture (TextureRenderId id)=0
 
virtual void UpdateTexture (TextureRenderId id, RgbaImageView image)=0
 
virtual void Update_Texture (GraphicsImage *texture)=0
 
virtual void BeginScene2D ()=0
 
virtual void ScreenFade (Color color, float t)=0
 
virtual void SetUIClipRect (const Recti &rect)=0
 
virtual void ResetUIClipRect ()=0
 
virtual void DrawTextureNew (float u, float v, GraphicsImage *img, Color colourmask32=colorTable.White)=0
 
virtual void DrawTextureCustomHeight (float u, float v, GraphicsImage *, int height)=0
 
virtual void DrawTextureOffset (int x, int y, int offset_x, int offset_y, GraphicsImage *)=0
 
virtual void DrawImage (GraphicsImage *, const Recti &rect, int paletteid=0, Color colourmask32=colorTable.White)=0
 
virtual void ZDrawTextureAlpha (float u, float v, GraphicsImage *pTexture, int zVal)=0
 
virtual void BlendTextures (int a2, int a3, GraphicsImage *a4, GraphicsImage *a5, int t, int start_opacity, int end_opacity)=0
 
virtual void TexturePixelRotateDraw (float u, float v, GraphicsImage *img, int time)=0
 
virtual void DrawMonsterPortrait (Recti rc, SpriteFrame *Portrait_Sprite, int Y_Offset)=0
 
virtual void DrawMasked (float u, float v, GraphicsImage *img, int color_dimming_level, Color mask=colorTable.White)=0
 
virtual void DrawTextureGrayShade (float u, float v, GraphicsImage *a4)=0
 
virtual void DrawTransparentRedShade (float u, float v, GraphicsImage *a4)=0
 
virtual void DrawTransparentGreenShade (float u, float v, GraphicsImage *pTexture)=0
 
virtual void BeginTextNew (GraphicsImage *main, GraphicsImage *shadow)=0
 
virtual void EndTextNew ()=0
 
virtual void DrawTextNew (int x, int y, int w, int h, float u1, float v1, float u2, float v2, int isshadow, Color colour)=0
 
virtual void FillRectFast (int uX, int uY, int uWidth, int uHeight, Color uColor32)=0
 
virtual void DrawOutdoorBuildings ()=0
 
virtual void DrawIndoorSky (int uNumVertices, int uFaceID=0)=0
 
virtual void DrawOutdoorSky ()=0
 
virtual void PrepareDecorationsRenderList_ODM ()=0
 
virtual void DrawSpriteObjects ()=0
 
virtual void DrawOutdoorTerrain ()=0
 
virtual bool AreRenderSurfacesOk ()=0
 
virtual RgbaImage MakeViewportScreenshot (int width, int height)=0
 
virtual RgbaImage MakeFullScreenshot ()=0
 
virtual std::vector< Actor * > getActorsInViewport (int pDepth)=0
 
virtual void BeginLightmaps ()=0
 
virtual void EndLightmaps ()=0
 
virtual void BeginLightmaps2 ()=0
 
virtual void EndLightmaps2 ()=0
 
virtual bool DrawLightmap (Lightmap *pLightmap, Vec3f *pColorMult, float z_bias)=0
 
virtual void BeginDecals ()=0
 
virtual void EndDecals ()=0
 
virtual void DrawDecal (Decal *pDecal, float z_bias)=0
 
virtual void DrawSpecialEffectsQuad (GraphicsImage *texture, int palette)=0
 
virtual void DrawFromSpriteSheet (Recti *pSrcRect, Pointi *pTargetPoint, int a3, int blend_mode)=0
 
virtual void DrawIndoorFaces ()=0
 
virtual void ReleaseTerrain ()=0
 
virtual void ReleaseBSP ()=0
 
virtual void DrawTwodVerts ()=0
 
virtual Sizei GetRenderDimensions ()=0
 
virtual Sizei GetPresentDimensions ()=0
 
virtual bool Reinitialize (bool firstInit=false)=0
 
virtual bool ReloadShaders ()=0
 
virtual void DoRenderBillboards_D3D ()=0
 
virtual void flushAndScale ()=0
 
virtual void swapBuffers ()=0
 
virtual void beginOverlays ()=0
 
virtual void endOverlays ()=0
 

Public Attributes

std::shared_ptr< GameConfigconfig = nullptr
 
int * pActiveZBuffer
 
Color uFogColor
 
int hd_water_current_frame
 
GraphicsImagehd_water_tile_anim [7]
 
RenderBillboardD3D pBillboardRenderListD3D [1000]
 
unsigned int uNumBillboardsToDraw
 
int drawcalls
 
DecalBuilderdecal_builder = nullptr
 
SpellFxRendererspell_fx_renderer = nullptr
 
std::shared_ptr< ParticleEngineparticle_engine = nullptr
 
Visvis = nullptr
 

Constructor & Destructor Documentation

◆ Renderer()

Renderer::Renderer ( std::shared_ptr< GameConfig config,
DecalBuilder decal_builder,
SpellFxRenderer spellfx,
std::shared_ptr< ParticleEngine particle_engine,
Vis vis 
)

◆ ~Renderer()

Renderer::~Renderer ( )
virtualdefault

Member Function Documentation

◆ AreRenderSurfacesOk()

virtual bool Renderer::AreRenderSurfacesOk ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BeginDecals()

virtual void Renderer::BeginDecals ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BeginLightmaps()

virtual void Renderer::BeginLightmaps ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BeginLightmaps2()

virtual void Renderer::BeginLightmaps2 ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BeginLines2D()

virtual void Renderer::BeginLines2D ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ beginOverlays()

virtual void Renderer::beginOverlays ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BeginScene2D()

virtual void Renderer::BeginScene2D ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BeginScene3D()

virtual void Renderer::BeginScene3D ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BeginTextNew()

virtual void Renderer::BeginTextNew ( GraphicsImage main,
GraphicsImage shadow 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BillboardSphereSpellFX()

virtual void Renderer::BillboardSphereSpellFX ( SpellFX_Billboard a1,
Color  diffuse 
)
pure virtual

Implemented in BaseRenderer.

◆ BlendTextures()

virtual void Renderer::BlendTextures ( int  a2,
int  a3,
GraphicsImage a4,
GraphicsImage a5,
int  t,
int  start_opacity,
int  end_opacity 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ BltBackToFontFast()

virtual void Renderer::BltBackToFontFast ( int  a2,
int  a3,
Recti a4 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ClearBlack()

virtual void Renderer::ClearBlack ( )
pure virtual

Implemented in BaseRenderer.

◆ ClearTarget()

virtual void Renderer::ClearTarget ( Color  uColor)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ClearZBuffer()

virtual void Renderer::ClearZBuffer ( )
pure virtual

Implemented in BaseRenderer.

◆ CreateTexture()

virtual TextureRenderId Renderer::CreateTexture ( RgbaImageView  image)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ CreateZBuffer()

virtual void Renderer::CreateZBuffer ( )
pure virtual

Implemented in BaseRenderer.

◆ DeleteTexture()

virtual void Renderer::DeleteTexture ( TextureRenderId  id)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DoRenderBillboards_D3D()

virtual void Renderer::DoRenderBillboards_D3D ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene()

virtual void Renderer::DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene ( )
pure virtual

Implemented in BaseRenderer.

◆ DrawDecal()

virtual void Renderer::DrawDecal ( Decal pDecal,
float  z_bias 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawFromSpriteSheet()

virtual void Renderer::DrawFromSpriteSheet ( Recti pSrcRect,
Pointi pTargetPoint,
int  a3,
int  blend_mode 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawImage()

virtual void Renderer::DrawImage ( GraphicsImage ,
const Recti rect,
int  paletteid = 0,
Color  colourmask32 = colorTable.White 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawIndoorFaces()

virtual void Renderer::DrawIndoorFaces ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawIndoorSky()

virtual void Renderer::DrawIndoorSky ( int  uNumVertices,
int  uFaceID = 0 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawLightmap()

virtual bool Renderer::DrawLightmap ( Lightmap *  pLightmap,
Vec3f pColorMult,
float  z_bias 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawLines()

virtual void Renderer::DrawLines ( const RenderVertexD3D3 vertices,
int  num_vertices 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawMasked()

virtual void Renderer::DrawMasked ( float  u,
float  v,
GraphicsImage img,
int  color_dimming_level,
Color  mask = colorTable.White 
)
pure virtual

Implemented in BaseRenderer.

◆ DrawMonsterPortrait()

virtual void Renderer::DrawMonsterPortrait ( Recti  rc,
SpriteFrame Portrait_Sprite,
int  Y_Offset 
)
pure virtual

Implemented in BaseRenderer.

◆ DrawOutdoorBuildings()

virtual void Renderer::DrawOutdoorBuildings ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawOutdoorSky()

virtual void Renderer::DrawOutdoorSky ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawOutdoorTerrain()

virtual void Renderer::DrawOutdoorTerrain ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawProjectile()

virtual void Renderer::DrawProjectile ( float  srcX,
float  srcY,
float  a3,
float  a4,
float  dstX,
float  dstY,
float  a7,
float  a8,
GraphicsImage texture 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawSpecialEffectsQuad()

virtual void Renderer::DrawSpecialEffectsQuad ( GraphicsImage texture,
int  palette 
)
pure virtual

Implemented in BaseRenderer.

◆ DrawSpriteObjects()

virtual void Renderer::DrawSpriteObjects ( )
pure virtual

Implemented in BaseRenderer.

◆ DrawTextNew()

virtual void Renderer::DrawTextNew ( int  x,
int  y,
int  w,
int  h,
float  u1,
float  v1,
float  u2,
float  v2,
int  isshadow,
Color  colour 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawTextureCustomHeight()

virtual void Renderer::DrawTextureCustomHeight ( float  u,
float  v,
GraphicsImage ,
int  height 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawTextureGrayShade()

virtual void Renderer::DrawTextureGrayShade ( float  u,
float  v,
GraphicsImage a4 
)
pure virtual

Implemented in BaseRenderer.

◆ DrawTextureNew()

virtual void Renderer::DrawTextureNew ( float  u,
float  v,
GraphicsImage img,
Color  colourmask32 = colorTable.White 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawTextureOffset()

virtual void Renderer::DrawTextureOffset ( int  x,
int  y,
int  offset_x,
int  offset_y,
GraphicsImage  
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ DrawTransparentGreenShade()

virtual void Renderer::DrawTransparentGreenShade ( float  u,
float  v,
GraphicsImage pTexture 
)
pure virtual

Implemented in BaseRenderer.

◆ DrawTransparentRedShade()

virtual void Renderer::DrawTransparentRedShade ( float  u,
float  v,
GraphicsImage a4 
)
pure virtual

Implemented in BaseRenderer.

◆ DrawTwodVerts()

virtual void Renderer::DrawTwodVerts ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ EndDecals()

virtual void Renderer::EndDecals ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ EndLightmaps()

virtual void Renderer::EndLightmaps ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ EndLightmaps2()

virtual void Renderer::EndLightmaps2 ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ EndLines2D()

virtual void Renderer::EndLines2D ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ endOverlays()

virtual void Renderer::endOverlays ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ EndTextNew()

virtual void Renderer::EndTextNew ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ FillRectFast()

virtual void Renderer::FillRectFast ( int  uX,
int  uY,
int  uWidth,
int  uHeight,
Color  uColor32 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ flushAndScale()

virtual void Renderer::flushAndScale ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ getActorsInViewport()

virtual std::vector< Actor * > Renderer::getActorsInViewport ( int  pDepth)
pure virtual

Implemented in BaseRenderer.

◆ GetGamma()

virtual float Renderer::GetGamma ( )
pure virtual

Implemented in BaseRenderer.

◆ GetPresentDimensions()

virtual Sizei Renderer::GetPresentDimensions ( )
pure virtual

Implemented in BaseRenderer.

◆ GetRenderDimensions()

virtual Sizei Renderer::GetRenderDimensions ( )
pure virtual

Implemented in BaseRenderer.

◆ Initialize()

virtual bool Renderer::Initialize ( )
pure virtual

Implemented in BaseRenderer, NullRenderer, and OpenGLRenderer.

◆ InitializeFullscreen()

virtual bool Renderer::InitializeFullscreen ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ MakeFullScreenshot()

virtual RgbaImage Renderer::MakeFullScreenshot ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ MakeParticleBillboardAndPush()

virtual void Renderer::MakeParticleBillboardAndPush ( SoftwareBillboard a2,
GraphicsImage texture,
Color  uDiffuse,
int  angle 
)
pure virtual

Implemented in BaseRenderer.

◆ MakeViewportScreenshot()

virtual RgbaImage Renderer::MakeViewportScreenshot ( int  width,
int  height 
)
pure virtual

Takes a screenshot of the game viewport, w/o the UI elements.

Parameters
widthRequired width
heightRequired height.
Returns
Taken screenshot image.

Implemented in NullRenderer, and OpenGLRenderer.

◆ PrepareDecorationsRenderList_ODM()

virtual void Renderer::PrepareDecorationsRenderList_ODM ( )
pure virtual

Implemented in BaseRenderer.

◆ Present()

virtual void Renderer::Present ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ PresentBlackScreen()

virtual void Renderer::PresentBlackScreen ( )
pure virtual

Implemented in BaseRenderer.

◆ RasterLine2D()

virtual void Renderer::RasterLine2D ( Pointi  a,
Pointi  b,
Color  uColor32 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ReadScreenPixels()

virtual RgbaImage Renderer::ReadScreenPixels ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ Reinitialize()

virtual bool Renderer::Reinitialize ( bool  firstInit = false)
pure virtual

Implemented in BaseRenderer, NullRenderer, and OpenGLRenderer.

◆ Release()

virtual void Renderer::Release ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ReleaseBSP()

virtual void Renderer::ReleaseBSP ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ReleaseTerrain()

virtual void Renderer::ReleaseTerrain ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ReloadShaders()

virtual bool Renderer::ReloadShaders ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ResetUIClipRect()

virtual void Renderer::ResetUIClipRect ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ RestoreBackBuffer()

virtual void Renderer::RestoreBackBuffer ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ RestoreFrontBuffer()

virtual void Renderer::RestoreFrontBuffer ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ScreenFade()

virtual void Renderer::ScreenFade ( Color  color,
float  t 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ SetUIClipRect()

virtual void Renderer::SetUIClipRect ( const Recti rect)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ swapBuffers()

virtual void Renderer::swapBuffers ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ SwitchToWindow()

virtual bool Renderer::SwitchToWindow ( )
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ TexturePixelRotateDraw()

virtual void Renderer::TexturePixelRotateDraw ( float  u,
float  v,
GraphicsImage img,
int  time 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ TransformBillboardsAndSetPalettesODM()

virtual void Renderer::TransformBillboardsAndSetPalettesODM ( )
pure virtual

Implemented in BaseRenderer.

◆ Update_Texture()

virtual void Renderer::Update_Texture ( GraphicsImage texture)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ UpdateTexture()

virtual void Renderer::UpdateTexture ( TextureRenderId  id,
RgbaImageView  image 
)
pure virtual

Implemented in NullRenderer, and OpenGLRenderer.

◆ ZDrawTextureAlpha()

virtual void Renderer::ZDrawTextureAlpha ( float  u,
float  v,
GraphicsImage pTexture,
int  zVal 
)
pure virtual

Implemented in BaseRenderer.

Member Data Documentation

◆ config

std::shared_ptr<GameConfig> Renderer::config = nullptr

◆ decal_builder

DecalBuilder* Renderer::decal_builder = nullptr

◆ drawcalls

int Renderer::drawcalls

◆ hd_water_current_frame

int Renderer::hd_water_current_frame

◆ hd_water_tile_anim

GraphicsImage* Renderer::hd_water_tile_anim[7]

◆ pActiveZBuffer

int* Renderer::pActiveZBuffer

◆ particle_engine

std::shared_ptr<ParticleEngine> Renderer::particle_engine = nullptr

◆ pBillboardRenderListD3D

RenderBillboardD3D Renderer::pBillboardRenderListD3D[1000]

◆ spell_fx_renderer

SpellFxRenderer* Renderer::spell_fx_renderer = nullptr

◆ uFogColor

Color Renderer::uFogColor

◆ uNumBillboardsToDraw

unsigned int Renderer::uNumBillboardsToDraw

◆ vis

Vis* Renderer::vis = nullptr

The documentation for this class was generated from the following files: