OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
C4Draw.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
5  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
6  *
7  * Distributed under the terms of the ISC license; see accompanying file
8  * "COPYING" for details.
9  *
10  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
11  * See accompanying file "TRADEMARK" for details.
12  *
13  * To redistribute this file separately, substitute the full license texts
14  * for the above references.
15  */
16 
17 /* A wrapper class to OpenGL and Direct3d */
18 
19 #ifndef INC_STDDDRAW2
20 #define INC_STDDDRAW2
21 
22 #include "lib/StdMeshMaterial.h"
23 #include "graphics/C4Surface.h"
25 
26 // Global Draw access pointer
27 extern C4Draw *pDraw;
28 
29 inline void DwTo4UB(DWORD dwClr, unsigned char (&r)[4])
30 {
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);
35 }
36 
37 // pattern
38 class C4Pattern
39 {
40 private:
41  // pattern surface for new-style patterns
42  class C4Surface *sfcPattern32;
43  // Faster access
44  uint32_t * CachedPattern; int Wdt; int Hgt;
45  // pattern zoom factor; 0 means no zoom
46  int Zoom;
47 public:
48  C4Pattern& operator=(const C4Pattern&);
49  const C4Surface *getSurface() const { return sfcPattern32; }
50  DWORD PatternClr(unsigned int iX, unsigned int iY) const; // apply pattern to color
51  bool Set(class C4Surface *sfcSource, int iZoom=0); // set and enable pattern
52  void SetZoom(int iZoom) { Zoom = iZoom; }
53  void Clear(); // clear pattern
54  C4Pattern(); // ctor
55  ~C4Pattern() { Clear(); } // dtor
56 };
57 
58 // blit position on screen
59 // This is the format required by GL_T2F_C4UB_V3F
61 {
62  float tx, ty; // texture positions
63  unsigned char color[4]; // color modulation
64  float ftx,fty,ftz; // blit positions
65 };
66 
67 // helper struct
68 struct ZoomData
69 {
70  float Zoom;
71  float X, Y;
72 };
73 
74 class C4FoWRegion;
75 
76 // Shader combinations
77 static const int C4SSC_MOD2 = 1; // signed addition instead of multiplication for clrMod
78 static const int C4SSC_BASE = 2; // use a base texture instead of just a single color
79 static const int C4SSC_OVERLAY = 4; // use a colored overlay on top of base texture
80 static const int C4SSC_LIGHT = 8; // use dynamic+ambient lighting
81 static const int C4SSC_NORMAL = 16; // extract normals from normal map instead of (0,0,1)
82 
83 // direct draw encapsulation
84 class C4Draw
85 {
86 public:
88 
89  static constexpr int COLOR_DEPTH = 32;
90  static constexpr int COLOR_DEPTH_BYTES = COLOR_DEPTH / 8;
91 
92  C4Draw() = default;
93  virtual ~C4Draw() { pDraw=nullptr; }
94 public:
95  C4AbstractApp * pApp; // the application
96  bool Active; // set if device is ready to render, etc.
97  float gamma[C4MaxGammaRamps][3]; // input gammas
98  float gammaOut[3]; // combined gamma
99  int MaxTexSize{0};
100  C4ScriptUniform scriptUniform; // uniforms added to all draw calls
101 protected:
102  float fClipX1,fClipY1,fClipX2,fClipY2; // clipper in unzoomed coordinates
103  float fStClipX1,fStClipY1,fStClipX2,fStClipY2; // stored clipper in unzoomed coordinates
104  int32_t iClipX1,iClipY1,iClipX2,iClipY2; // clipper in pixel coordinates
105  bool ClipAll; // set if clipper clips everything away
106  bool PrimaryLocked; // set if primary surface is locked (-> can't blit)
107  C4Surface *RenderTarget; // current render target
108  bool BlitModulated; // set if blits should be modulated with BlitModulateClr
109  DWORD BlitModulateClr; // modulation color for blitting
110  DWORD dwBlitMode; // extra flags for blit
111  const C4FoWRegion* pFoW; // new-style FoW
112  float ZoomX; float ZoomY;
113  const StdMeshMatrix* MeshTransform; // Transformation to apply to mesh before rendering
115 public:
116  float Zoom;
117  // General
118  bool Init(C4AbstractApp * pApp, unsigned int iXRes, unsigned int iYRes, unsigned int iMonitor);
119  virtual void Clear();
120  virtual void Default();
121  virtual CStdGLCtx *CreateContext(C4Window *, C4AbstractApp *) { return nullptr; }
122  virtual bool OnResolutionChanged(unsigned int iXRes, unsigned int iYRes) = 0; // reinit clipper for new resolution
123  // Clipper
124  bool GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2);
125  bool SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2);
126  bool SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2);
127  C4Rect GetClipRect() const;
128  C4Rect GetOutRect() const;
129  bool StorePrimaryClipper();
130  bool RestorePrimaryClipper();
131  bool NoPrimaryClipper();
132  bool ApplyPrimaryClipper(C4Surface * sfcSurface);
133  bool DetachPrimaryClipper(C4Surface * sfcSurface);
134  virtual bool UpdateClipper() = 0; // set current clipper to render target
135  // Surface
136  bool GetSurfaceSize(C4Surface * sfcSurface, int &iWdt, int &iHgt);
137  void Grayscale(C4Surface * sfcSfc, int32_t iOffset = 0);
138  void LockingPrimary() { PrimaryLocked=true; }
139  void PrimaryUnlocked() { PrimaryLocked=false; }
140  virtual bool PrepareMaterial(StdMeshMatManager& mat_manager, StdMeshMaterialLoader& loader, StdMeshMaterial& mat) = 0; // Find best technique, fail if there is none
141  virtual bool PrepareRendering(C4Surface * sfcToSurface) = 0; // check if/make rendering possible to given surface
142  virtual bool EnsureMainContextSelected() = 0;
143  virtual bool PrepareSpriteShader(C4Shader& shader, const char* name, int ssc, C4GroupSet* pGroups, const char* const* additionalDefines, const char* const* additionalSlices) = 0; // create sprite shader
144  // Blit
145  virtual void BlitLandscape(C4Surface * sfcSource, float fx, float fy,
146  C4Surface * sfcTarget, float tx, float ty, float wdt, float hgt);
147  void Blit8Fast(CSurface8 * sfcSource, int fx, int fy,
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,
151  bool fSrcColKey=false, const C4BltTransform *pTransform=nullptr);
152  bool BlitUnscaled(C4Surface * sfcSource, float fx, float fy, float fwdt, float fhgt,
153  C4Surface * sfcTarget, float tx, float ty, float twdt, float thgt,
154  bool fSrcColKey=false, const C4BltTransform *pTransform=nullptr);
155  bool RenderMesh(StdMeshInstance &instance, C4Surface * sfcTarget, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform); // Call PrepareMaterial with Mesh's material before
156  virtual void PerformMesh(StdMeshInstance &instance, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform* pTransform) = 0;
157  bool Blit8(C4Surface * sfcSource, int fx, int fy, int fwdt, int fhgt, // force 8bit-blit (inline)
158  C4Surface * sfcTarget, int tx, int ty, int twdt, int thgt,
159  bool fSrcColKey=false, const C4BltTransform *pTransform=nullptr);
160  bool BlitSimple(C4Surface * sfcSource, int fx, int fy, int fwdt, int fhgt,
161  C4Surface * sfcTarget, int tx, int ty, int twdt, int thgt,
162  bool fTransparency=true);
163  bool BlitSurface(C4Surface * sfcSurface, C4Surface * sfcTarget, int tx, int ty, bool fBlitBase);
164  bool BlitSurfaceTile(C4Surface * sfcSurface, C4Surface * sfcTarget, float iToX, float iToY, float iToWdt, float iToHgt, float iOffsetX, float iOffsetY, C4ShaderCall* shader_call);
165  virtual void FillBG(DWORD dwClr=0) = 0;
166  // Text
167  enum { DEFAULT_MESSAGE_COLOR = 0xffffffff };
168  bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true);
169  bool StringOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true);
170  // Drawing
171  virtual void PerformMultiPix(C4Surface* sfcTarget, const C4BltVertex* vertices, unsigned int n_vertices, C4ShaderCall* shader_call) = 0;
172  virtual void PerformMultiLines(C4Surface* sfcTarget, const C4BltVertex* vertices, unsigned int n_vertices, float width, C4ShaderCall* shader_call) = 0;
173  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; // blit the same texture many times
174  // Convenience drawing functions
175  void DrawBoxDw(C4Surface * sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr); // calls DrawBoxFade
176  void DrawBoxFade(C4Surface * sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, C4ShaderCall* shader_call); // calls DrawQuadDw
177  void DrawPatternedCircle(C4Surface * sfcDest, int x, int y, int r, BYTE col, C4Pattern & Pattern, CStdPalette &rPal);
178  void DrawFrameDw(C4Surface * sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr, float width=1.0f);
179  void DrawQuadDw(C4Surface * sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, C4ShaderCall* shader_call);
180  void DrawPix(C4Surface * sfcDest, float tx, float ty, DWORD dwCol); // Consider using PerformMultiPix if you draw more than one pixel
181  void DrawLineDw(C4Surface * sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr, float width = 1.0f); // Consider using PerformMultiLines if you draw more than one line
182  void DrawCircleDw(C4Surface * sfcTarget, float cx, float cy, float r, DWORD dwClr, float width = 1.0f);
183  // gamma
184  void SetGamma(float r, float g, float b, int32_t iRampIndex); // set gamma
185  void ResetGamma(); // reset gamma to default
186  DWORD ApplyGammaTo(DWORD dwClr); // apply gamma to given color
187  // blit states
188  void ActivateBlitModulation(DWORD dwWithClr) { BlitModulated=true; BlitModulateClr=dwWithClr; } // modulate following blits with a given color
189  void DeactivateBlitModulation() { BlitModulated=false; } // stop color modulation of blits
190  bool GetBlitModulation(DWORD &rdwColor) { rdwColor=BlitModulateClr; return BlitModulated; }
191  void SetBlitMode(DWORD dwBlitMode) { this->dwBlitMode=dwBlitMode & C4GFXBLIT_ALL; } // set blit mode extra flags (additive blits, mod2-modulation, etc.)
192  void ResetBlitMode() { dwBlitMode=0; }
193  void SetFoW(const C4FoWRegion* fow) { pFoW = fow; }
194  const C4FoWRegion* GetFoW() const { return pFoW; }
195  void SetZoom(float X, float Y, float Zoom);
196  void SetZoom(const ZoomData &zoom) { SetZoom(zoom.X, zoom.Y, zoom.Zoom); }
197  void GetZoom(ZoomData *r) { r->Zoom=Zoom; r->X=ZoomX; r->Y=ZoomY; }
198  void ApplyZoom(float & X, float & Y);
199  void RemoveZoom(float & X, float & Y);
200  void SetMeshTransform(const StdMeshMatrix* Transform) { MeshTransform = Transform; } // if non-nullptr make sure to keep matrix valid
201  void SetPerspective(bool fSet) { fUsePerspective = fSet; }
202 
203  // device objects
204  virtual bool RestoreDeviceObjects() = 0; // restore device dependant objects
205  virtual bool InvalidateDeviceObjects() = 0; // free device dependant objects
206  virtual bool DeviceReady() = 0; // return whether device exists
207 
208 protected:
209  bool StringOut(const char *szText, C4Surface * sfcDest, float iTx, float iTy, DWORD dwFCol, BYTE byForm, bool fDoMarkup, C4Markup &Markup, CStdFont *pFont, float fZoom);
210  bool CreatePrimaryClipper(unsigned int iXRes, unsigned int iYRes);
211  virtual bool Error(const char *szMsg);
212 
213  friend class C4Surface;
214  friend class C4TexRef;
215  friend class C4Pattern;
216 };
217 
219 {
220  ZoomDataStackItem(float newzoom) { pDraw->GetZoom(this); pDraw->SetZoom(X, Y, newzoom); }
221  ZoomDataStackItem(float X, float Y, float newzoom) { pDraw->GetZoom(this); pDraw->SetZoom(X, Y, newzoom); }
222  ~ZoomDataStackItem() { pDraw->SetZoom(*this); }
223 };
224 
225 bool DDrawInit(C4AbstractApp * pApp, unsigned int iXRes, unsigned int iYRes, unsigned int iMonitor);
226 #endif // INC_STDDDRAW2
void SetMeshTransform(const StdMeshMatrix *Transform)
Definition: C4Draw.h:200
static constexpr int COLOR_DEPTH_BYTES
Definition: C4Draw.h:90
void SetZoom(const ZoomData &zoom)
Definition: C4Draw.h:196
float fty
Definition: C4Draw.h:64
bool RestorePrimaryClipper()
Definition: C4Draw.cpp:210
virtual void PerformMesh(StdMeshInstance &instance, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform *pTransform)=0
void SetFoW(const C4FoWRegion *fow)
Definition: C4Draw.h:193
int MaxTexSize
Definition: C4Draw.h:99
void Blit8Fast(CSurface8 *sfcSource, int fx, int fy, C4Surface *sfcTarget, int tx, int ty, int wdt, int hgt)
Definition: C4Draw.cpp:251
float ftz
Definition: C4Draw.h:64
void ApplyZoom(float &X, float &Y)
Definition: C4Draw.cpp:784
DWORD PatternClr(unsigned int iX, unsigned int iY) const
Definition: C4Draw.cpp:159
void DrawPix(C4Surface *sfcDest, float tx, float ty, DWORD dwCol)
Definition: C4Draw.cpp:604
bool Active
Definition: C4Draw.h:96
float fClipY2
Definition: C4Draw.h:102
virtual bool RestoreDeviceObjects()=0
float ZoomY
Definition: C4Draw.h:112
float fClipY1
Definition: C4Draw.h:102
int Wdt
Definition: C4Surface.h:65
float tx
Definition: C4Draw.h:62
C4ScriptUniform scriptUniform
Definition: C4Draw.h:100
#define b
bool GetPrimaryClipper(int &rX1, int &rY1, int &rX2, int &rY2)
Definition: C4Draw.cpp:722
unsigned char color[4]
Definition: C4Draw.h:63
virtual bool DeviceReady()=0
void ResetBlitMode()
Definition: C4Draw.h:192
static constexpr int COLOR_DEPTH
Definition: C4Draw.h:89
float fStClipY1
Definition: C4Draw.h:103
void Grayscale(C4Surface *sfcSfc, int32_t iOffset=0)
Definition: C4Draw.cpp:701
virtual bool PrepareMaterial(StdMeshMatManager &mat_manager, StdMeshMaterialLoader &loader, StdMeshMaterial &mat)=0
float gammaOut[3]
Definition: C4Draw.h:98
bool TextOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
Definition: C4Draw.cpp:567
float Y
Definition: C4Draw.h:71
float fStClipX2
Definition: C4Draw.h:103
const int C4MaxGammaRamps
Definition: C4Constants.h:35
bool Init(C4AbstractApp *pApp, unsigned int iXRes, unsigned int iYRes, unsigned int iMonitor)
Definition: C4Draw.cpp:815
Definition: C4Rect.h:27
uint8_t BYTE
void SetZoom(int iZoom)
Definition: C4Draw.h:52
bool fUsePerspective
Definition: C4Draw.h:114
float ty
Definition: C4Draw.h:62
const C4Surface * getSurface() const
Definition: C4Draw.h:49
virtual void BlitLandscape(C4Surface *sfcSource, float fx, float fy, C4Surface *sfcTarget, float tx, float ty, float wdt, float hgt)
Definition: C4Draw.cpp:245
int Hgt
Definition: C4Surface.h:65
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 DrawLineDw(C4Surface *sfcTarget, float x1, float y1, float x2, float y2, DWORD dwClr, float width=1.0f)
Definition: C4Draw.cpp:614
void SetBlitMode(DWORD dwBlitMode)
Definition: C4Draw.h:191
bool StringOut(const char *szText, CStdFont &rFont, float fZoom, C4Surface *sfcDest, float iTx, float iTy, DWORD dwFCol=0xffffffff, BYTE byForm=ALeft, bool fDoMarkup=true)
Definition: C4Draw.cpp:576
const C4FoWRegion * pFoW
Definition: C4Draw.h:111
const StdMeshMatrix * MeshTransform
Definition: C4Draw.h:113
bool DDrawInit(C4AbstractApp *pApp, unsigned int iXRes, unsigned int iYRes, unsigned int iMonitor)
Definition: C4Draw.cpp:796
bool CreatePrimaryClipper(unsigned int iXRes, unsigned int iYRes)
Definition: C4Draw.cpp:507
void LockingPrimary()
Definition: C4Draw.h:138
const C4FoWRegion * GetFoW() const
Definition: C4Draw.h:194
void DrawFrameDw(C4Surface *sfcDest, int x1, int y1, int x2, int y2, DWORD dwClr, float width=1.0f)
Definition: C4Draw.cpp:641
virtual bool PrepareRendering(C4Surface *sfcToSurface)=0
bool BlitSurface(C4Surface *sfcSurface, C4Surface *sfcTarget, int tx, int ty, bool fBlitBase)
Definition: C4Draw.cpp:517
ZoomDataStackItem(float newzoom)
Definition: C4Draw.h:220
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)
Definition: C4Draw.cpp:469
void DwTo4UB(DWORD dwClr, unsigned char(&r)[4])
Definition: C4Draw.h:29
bool PrimaryLocked
Definition: C4Draw.h:106
bool RenderMesh(StdMeshInstance &instance, C4Surface *sfcTarget, float tx, float ty, float twdt, float thgt, DWORD dwPlayerColor, C4BltTransform *pTransform)
Definition: C4Draw.cpp:403
void DrawCircleDw(C4Surface *sfcTarget, float cx, float cy, float r, DWORD dwClr, float width=1.0f)
Definition: C4Draw.cpp:624
bool BlitSurfaceTile(C4Surface *sfcSurface, C4Surface *sfcTarget, float iToX, float iToY, float iToWdt, float iToHgt, float iOffsetX, float iOffsetY, C4ShaderCall *shader_call)
Definition: C4Draw.cpp:535
void Clear()
Definition: C4Draw.cpp:146
virtual void PerformMultiPix(C4Surface *sfcTarget, const C4BltVertex *vertices, unsigned int n_vertices, C4ShaderCall *shader_call)=0
void DrawBoxDw(C4Surface *sfcDest, int iX1, int iY1, int iX2, int iY2, DWORD dwClr)
Definition: C4Draw.cpp:846
void DrawQuadDw(C4Surface *sfcTarget, float *ipVtx, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, C4ShaderCall *shader_call)
Definition: C4Draw.cpp:659
void SetPerspective(bool fSet)
Definition: C4Draw.h:201
virtual void PerformMultiLines(C4Surface *sfcTarget, const C4BltVertex *vertices, unsigned int n_vertices, float width, C4ShaderCall *shader_call)=0
virtual CStdGLCtx * CreateContext(C4Window *, C4AbstractApp *)
Definition: C4Draw.h:121
DWORD ApplyGammaTo(DWORD dwClr)
Definition: C4Draw.cpp:772
bool SetPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
Definition: C4Draw.cpp:217
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)
Definition: C4Draw.cpp:309
virtual bool Error(const char *szMsg)
Definition: C4Draw.cpp:500
void DrawBoxFade(C4Surface *sfcDest, float iX, float iY, float iWdt, float iHgt, DWORD dwClr1, DWORD dwClr2, DWORD dwClr3, DWORD dwClr4, C4ShaderCall *shader_call)
Definition: C4Draw.cpp:830
int32_t iClipY2
Definition: C4Draw.h:104
virtual void FillBG(DWORD dwClr=0)=0
float ZoomX
Definition: C4Draw.h:112
virtual bool PrepareSpriteShader(C4Shader &shader, const char *name, int ssc, C4GroupSet *pGroups, const char *const *additionalDefines, const char *const *additionalSlices)=0
void RemoveZoom(float &X, float &Y)
Definition: C4Draw.cpp:790
C4Pattern()
Definition: C4Draw.cpp:138
float fStClipY2
Definition: C4Draw.h:103
DWORD BlitModulateClr
Definition: C4Draw.h:109
float Zoom
Definition: C4Draw.h:116
virtual bool OnResolutionChanged(unsigned int iXRes, unsigned int iYRes)=0
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)
Definition: C4Draw.cpp:301
#define C4GFXBLIT_ALL
Definition: C4Surface.h:32
C4Draw * pDraw
Definition: C4Draw.cpp:42
void GetZoom(ZoomData *r)
Definition: C4Draw.h:197
bool GetBlitModulation(DWORD &rdwColor)
Definition: C4Draw.h:190
C4Draw()=default
bool ApplyPrimaryClipper(C4Surface *sfcSurface)
Definition: C4Draw.cpp:227
C4Pattern & operator=(const C4Pattern &)
Definition: C4Draw.cpp:94
virtual void Default()
Definition: C4Draw.cpp:169
const int ALeft
Definition: C4Surface.h:41
float fClipX2
Definition: C4Draw.h:102
C4Surface * RenderTarget
Definition: C4Draw.h:107
bool GetSurfaceSize(C4Surface *sfcSurface, int &iWdt, int &iHgt)
Definition: C4Draw.cpp:191
float ftx
Definition: C4Draw.h:64
void PrimaryUnlocked()
Definition: C4Draw.h:139
int32_t iClipY1
Definition: C4Draw.h:104
C4Rect GetOutRect() const
Definition: C4Draw.cpp:739
void DeactivateBlitModulation()
Definition: C4Draw.h:189
bool Set(class C4Surface *sfcSource, int iZoom=0)
Definition: C4Draw.cpp:114
virtual bool UpdateClipper()=0
virtual void Clear()
Definition: C4Draw.cpp:184
DWORD dwBlitMode
Definition: C4Draw.h:110
float X
Definition: C4Draw.h:71
bool ClipAll
Definition: C4Draw.h:105
int32_t iClipX1
Definition: C4Draw.h:104
void DrawPatternedCircle(C4Surface *sfcDest, int x, int y, int r, BYTE col, C4Pattern &Pattern, CStdPalette &rPal)
Definition: C4Draw.cpp:675
#define X(sdl, oc)
virtual ~C4Draw()
Definition: C4Draw.h:93
bool DetachPrimaryClipper(C4Surface *sfcSurface)
Definition: C4Draw.cpp:232
void ActivateBlitModulation(DWORD dwWithClr)
Definition: C4Draw.h:188
C4Rect GetClipRect() const
Definition: C4Draw.cpp:730
bool NoPrimaryClipper()
Definition: C4Draw.cpp:237
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)
Definition: C4Draw.cpp:424
bool SubPrimaryClipper(int iX1, int iY1, int iX2, int iY2)
Definition: C4Draw.cpp:196
Definition: C4Draw.h:84
~C4Pattern()
Definition: C4Draw.h:55
uint32_t DWORD
float fStClipX1
Definition: C4Draw.h:103
bool BlitModulated
Definition: C4Draw.h:108
void SetZoom(float X, float Y, float Zoom)
Definition: C4Draw.cpp:779
float Zoom
Definition: C4Draw.h:70
void SetGamma(float r, float g, float b, int32_t iRampIndex)
Definition: C4Draw.cpp:744
void ResetGamma()
Definition: C4Draw.cpp:760
DrawOperation
Definition: C4Draw.h:87
virtual bool InvalidateDeviceObjects()=0
bool StorePrimaryClipper()
Definition: C4Draw.cpp:203
float fClipX1
Definition: C4Draw.h:102
C4AbstractApp * pApp
Definition: C4Draw.h:95
virtual bool EnsureMainContextSelected()=0
int32_t iClipX2
Definition: C4Draw.h:104
float gamma[C4MaxGammaRamps][3]
Definition: C4Draw.h:97
ZoomDataStackItem(float X, float Y, float newzoom)
Definition: C4Draw.h:221