31 r[0] = (
unsigned char)( (dwClr >> 16) & 0xff);
32 r[1] = (
unsigned char)( (dwClr >> 8) & 0xff);
33 r[2] = (
unsigned char)( (dwClr ) & 0xff);
34 r[3] = (
unsigned char)( (dwClr >> 24) & 0xff);
44 uint32_t * CachedPattern;
int Wdt;
int Hgt;
77 static const int C4SSC_MOD2 = 1;
78 static const int C4SSC_BASE = 2;
79 static const int C4SSC_OVERLAY = 4;
80 static const int C4SSC_LIGHT = 8;
81 static const int C4SSC_NORMAL = 16;
119 virtual void Clear();
146 C4Surface * sfcTarget,
float tx,
float ty,
float wdt,
float hgt);
148 C4Surface * sfcTarget,
int tx,
int ty,
int wdt,
int hgt);
149 bool Blit(
C4Surface * sfcSource,
float fx,
float fy,
float fwdt,
float fhgt,
150 C4Surface * sfcTarget,
float tx,
float ty,
float twdt,
float thgt,
153 C4Surface * sfcTarget,
float tx,
float ty,
float twdt,
float thgt,
157 bool Blit8(
C4Surface * sfcSource,
int fx,
int fy,
int fwdt,
int fhgt,
158 C4Surface * sfcTarget,
int tx,
int ty,
int twdt,
int thgt,
161 C4Surface * sfcTarget,
int tx,
int ty,
int twdt,
int thgt,
162 bool fTransparency=
true);
184 void SetGamma(
float r,
float g,
float b, int32_t iRampIndex);
211 virtual bool Error(
const char *szMsg);
const int C4MaxGammaRamps
void DwTo4UB(DWORD dwClr, unsigned char(&r)[4])
bool DDrawInit(C4AbstractApp *pApp, unsigned int iXRes, unsigned int iYRes, unsigned int iMonitor)
bool SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
void SetFoW(const C4FoWRegion *fow)
virtual bool Error(const char *szMsg)
void DrawCircleDw(C4Surface *sfcTarget, float cx, float cy, float r, DWORD dwClr, float width=1.0f)
bool ApplyPrimaryClipper(C4Surface *sfcSurface)
void RemoveZoom(float &X, float &Y)
bool Blit(C4Surface *sfcSource, float fx, float fy, float fwdt, float fhgt, C4Surface *sfcTarget, float tx, float ty, float twdt, float thgt, bool fSrcColKey=false, const C4BltTransform *pTransform=nullptr)
static constexpr int COLOR_DEPTH_BYTES
void DrawFrameDw(C4Surface *sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr, float width=1.0f)
void DrawPix(C4Surface *sfcDest, float tx, float ty, DWORD dwCol)
virtual bool InvalidateDeviceObjects()=0
void GetZoom(ZoomData *r)
virtual void BlitLandscape(C4Surface *sfcSource, float fx, float fy, C4Surface *sfcTarget, float tx, float ty, float wdt, float hgt)
void Grayscale(C4Surface *sfcSfc, int32_t iOffset=0)
void DrawQuadDw(C4Surface *sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, C4ShaderCall *shader_call)
const StdMeshMatrix * MeshTransform
virtual void FillBG(DWORD dwClr=0)=0
bool BlitSimple(C4Surface *sfcSource, int fx, int fy, int fwdt, int fhgt, C4Surface *sfcTarget, int tx, int ty, int twdt, int thgt, bool fTransparency=true)
virtual CStdGLCtx * CreateContext(C4Window *, C4AbstractApp *)
C4Rect GetClipRect() const
bool RestorePrimaryClipper()
virtual bool PrepareSpriteShader(C4Shader &shader, const char *name, int ssc, C4GroupSet *pGroups, const char *const *additionalDefines, const char *const *additionalSlices)=0
void SetBlitMode(DWORD dwBlitMode)
C4Rect GetOutRect() const
bool BlitUnscaled(C4Surface *sfcSource, float fx, float fy, float fwdt, float fhgt, C4Surface *sfcTarget, float tx, float ty, float twdt, float thgt, bool fSrcColKey=false, const C4BltTransform *pTransform=nullptr)
bool GetSurfaceSize(C4Surface *sfcSurface, int &iWdt, int &iHgt)
virtual bool RestoreDeviceObjects()=0
static constexpr int COLOR_DEPTH
bool StringOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
const C4FoWRegion * GetFoW() const
virtual bool UpdateClipper()=0
bool RenderMesh(StdMeshInstance &instance, C4Surface *sfcTarget, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform *pTransform)
bool BlitSurface(C4Surface *sfcSurface, C4Surface *sfcTarget, int tx, int ty, bool fBlitBase)
virtual void PerformMultiLines(C4Surface *sfcTarget, const C4BltVertex *vertices, unsigned int n_vertices, float width, C4ShaderCall *shader_call)=0
void DrawBoxFade(C4Surface *sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, C4ShaderCall *shader_call)
virtual bool PrepareMaterial(StdMeshMatManager &mat_manager, StdMeshMaterialLoader &loader, StdMeshMaterial &mat)=0
void DeactivateBlitModulation()
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
bool GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2)
void SetGamma(float r, float g, float b, int32_t iRampIndex)
bool DetachPrimaryClipper(C4Surface *sfcSurface)
bool StorePrimaryClipper()
void DrawLineDw(C4Surface *sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr, float width=1.0f)
virtual bool DeviceReady()=0
virtual bool EnsureMainContextSelected()=0
bool GetBlitModulation(DWORD &rdwColor)
bool CreatePrimaryClipper(unsigned int iXRes, unsigned int iYRes)
void SetMeshTransform(const StdMeshMatrix *Transform)
bool Init(C4AbstractApp *pApp, unsigned int iXRes, unsigned int iYRes, unsigned int iMonitor)
void Blit8Fast(CSurface8 *sfcSource, int fx, int fy, C4Surface *sfcTarget, int tx, int ty, int wdt, int hgt)
void SetZoom(float X, float Y, float Zoom)
virtual bool OnResolutionChanged(unsigned int iXRes, unsigned int iYRes)=0
void DrawPatternedCircle(C4Surface *sfcDest, int x, int y, int r, BYTE col, C4Pattern &Pattern, CStdPalette &rPal)
bool SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
void ActivateBlitModulation(DWORD dwWithClr)
virtual void PerformMesh(StdMeshInstance &instance, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform *pTransform)=0
void SetPerspective(bool fSet)
C4ScriptUniform scriptUniform
float gamma[C4MaxGammaRamps][3]
void ApplyZoom(float &X, float &Y)
DWORD ApplyGammaTo(DWORD dwClr)
bool Blit8(C4Surface *sfcSource, int fx, int fy, int fwdt, int fhgt, C4Surface *sfcTarget, int tx, int ty, int twdt, int thgt, bool fSrcColKey=false, const C4BltTransform *pTransform=nullptr)
virtual bool PrepareRendering(C4Surface *sfcToSurface)=0
virtual void PerformMultiTris(C4Surface *sfcTarget, const C4BltVertex *vertices, unsigned int n_vertices, const C4BltTransform *pTransform, C4TexRef *pTex, C4TexRef *pOverlay, C4TexRef *pNormal, DWORD dwOverlayClrMod, C4ShaderCall *shader_call)=0
void SetZoom(const ZoomData &zoom)
bool BlitSurfaceTile(C4Surface *sfcSurface, C4Surface *sfcTarget, float iToX, float iToY, float iToWdt, float iToHgt, float iOffsetX, float iOffsetY, C4ShaderCall *shader_call)
virtual void PerformMultiPix(C4Surface *sfcTarget, const C4BltVertex *vertices, unsigned int n_vertices, C4ShaderCall *shader_call)=0
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
DWORD PatternClr(unsigned int iX, unsigned int iY) const
const C4Surface * getSurface() const
bool Set(class C4Surface *sfcSource, int iZoom=0)
C4Pattern & operator=(const C4Pattern &)
ZoomDataStackItem(float X, float Y, float newzoom)
ZoomDataStackItem(float newzoom)