Mercurial > mm7
annotate Engine/Graphics/IRender.h @ 2575:a76d408c5132 tip
DrawTranslucent -> DrawTextureGrayShade
Removed old texture drawing stuff
author | a.parshin |
---|---|
date | Wed, 09 Mar 2016 01:39:52 +0200 |
parents | dd36326a9994 |
children |
rev | line source |
---|---|
2496 | 1 #pragma once |
2 | |
3 #include "lib\legacy_dx\d3d.h" | |
4 #include "OSWindow.h" | |
5 #include "RenderStruct.h" | |
2499 | 6 #include "../VectorTypes.h" |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2536
diff
changeset
|
7 #include "Engine/Graphics/Texture.h" |
2496 | 8 |
9 struct IRender | |
10 { | |
11 public: | |
12 virtual ~IRender() {} | |
13 | |
14 virtual bool Initialize(OSWindow *window) = 0; | |
15 | |
16 virtual void ClearBlack() = 0; | |
17 virtual void PresentBlackScreen() = 0; | |
18 | |
19 virtual void SaveWinnersCertificate(const char *a1) = 0; | |
20 virtual void ClearTarget(unsigned int uColor) = 0; | |
21 virtual void Present() = 0; | |
22 | |
23 virtual void _49FD3A_fullscreen() = 0; | |
24 virtual bool InitializeFullscreen() = 0; | |
25 | |
26 virtual void CreateZBuffer() = 0; | |
27 virtual void Release() = 0; | |
28 | |
29 virtual bool SwitchToWindow() = 0; | |
30 virtual void RasterLine2D(signed int uX, signed int uY, signed int uZ, signed int uW, unsigned __int16 uColor) = 0; | |
31 virtual void ClearZBuffer(int a2, int a3) = 0; | |
32 virtual void SetRasterClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW) = 0; | |
33 virtual bool LockSurface_DDraw4(IDirectDrawSurface4 *pSurface, DDSURFACEDESC2 *pDesc, unsigned int uLockFlags) = 0; | |
34 virtual void GetTargetPixelFormat(DDPIXELFORMAT *pOut) = 0; | |
35 virtual void LockRenderSurface(void **pOutSurfacePtr, unsigned int *pOutPixelsPerRow) = 0; | |
36 virtual void UnlockBackBuffer() = 0; | |
37 virtual void LockFrontBuffer(void **pOutSurface, unsigned int *pOutPixelsPerRow) = 0; | |
38 virtual void UnlockFrontBuffer() = 0; | |
39 virtual void RestoreFrontBuffer() = 0; | |
40 virtual void RestoreBackBuffer() = 0; | |
41 virtual void BltToFront(RECT *pDstRect, IDirectDrawSurface *pSrcSurface, RECT *pSrcRect, unsigned int uBltFlags) = 0; | |
42 virtual void BltBackToFontFast(int a2, int a3, RECT *a4) = 0; | |
43 virtual void BeginSceneD3D() = 0; | |
44 | |
45 virtual unsigned int GetActorTintColor(float a2, int tint, int a4, int a5, RenderBillboard *a6) = 0; | |
46 | |
47 virtual void DrawPolygon(unsigned int uNumVertices, struct Polygon *a3, ODMFace *a4, IDirect3DTexture2 *pTexture) = 0; | |
48 virtual void DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders) = 0; | |
2574 | 49 virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture_MM7 *pTex, int uPackedID, unsigned int uColor, int a8) = 0; |
2496 | 50 |
51 virtual void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle) = 0; | |
52 virtual void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle) = 0; | |
53 | |
54 virtual void DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene() = 0; | |
55 virtual void DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *pSprite, int dimming_level) = 0; | |
56 virtual void _4A4CC9_AddSomeBillboard(struct stru6_stru1_indoor_sw_billboard *a1, int diffuse) = 0; | |
57 virtual void TransformBillboardsAndSetPalettesODM() = 0; | |
58 virtual void DrawBillboardList_BLV() = 0; | |
59 | |
60 virtual void DrawProjectile(float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, IDirect3DTexture2 *a9) = 0; | |
61 virtual bool LoadTexture(const char *pName, unsigned int bMipMaps, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture) = 0; | |
62 virtual bool MoveSpriteToDevice(Sprite *pSprite) = 0; | |
63 | |
64 virtual void BeginScene() = 0; | |
65 virtual void EndScene() = 0; | |
66 virtual void ScreenFade(unsigned int color, float t) = 0; | |
67 | |
2524 | 68 virtual void SetUIClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW) = 0; |
69 virtual void ResetUIClipRect() = 0; | |
2544
c674d547cc7c
GUIWindow switch logic refactored into behaviour classes
a.parshin
parents:
2536
diff
changeset
|
70 virtual void CreditsTextureScroll(unsigned int pX, unsigned int pY, int move_X, int move_Y, struct RGBTexture *pTexture) = 0; |
2518 | 71 |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2544
diff
changeset
|
72 virtual void DrawTextureNew(float u, float v, struct Image *) = 0; |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2544
diff
changeset
|
73 virtual void DrawTextureAlphaNew(float u, float v, struct Image *) = 0; |
2574 | 74 virtual void DrawTextureCustomHeight(float u, float v, class Image *img, int height) = 0; |
75 //virtual void DrawTextureNew(float u, float v, struct Texture_MM7 *) = 0; | |
76 //virtual void DrawTextureTransparentColorKey(signed int x, signed int y, struct Texture_MM7 *tex) = 0; | |
77 //virtual void DrawTextureIndexedAlpha(unsigned int uX, unsigned int uY, struct Texture_MM7 *pTexture) = 0; | |
2496 | 78 |
2574 | 79 virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Image *pTexture, int a5) = 0; |
80 virtual void ZDrawTextureAlpha(float u, float v, struct Image *pTexture, int zVal) = 0; | |
81 virtual void BlendTextures(unsigned int a2, unsigned int a3, struct Image *a4, struct Texture_MM7 *a5, int t, int start_opacity, int end_opacity) = 0; | |
82 virtual void _4A65CC(unsigned int x, unsigned int y, struct Texture_MM7 *a4, struct Texture_MM7 *a5, int a6, int a7, int a8) = 0; | |
2496 | 83 |
2575 | 84 virtual void DrawMasked(float u, float v, struct Image *img, unsigned int color_dimming_level, unsigned __int16 mask) = 0; |
85 virtual void DrawTextureGrayShade(float u, float v, struct Image *a4) = 0; | |
2574 | 86 virtual void DrawTransparentRedShade(float u, float v, struct Image *a4) = 0; |
87 virtual void DrawTransparentGreenShade(float u, float v, struct Image *pTexture) = 0; | |
2496 | 88 virtual void DrawFansTransparent(const RenderVertexD3D3 *vertices, unsigned int num_vertices) = 0; |
89 | |
2525 | 90 virtual void DrawTextAlpha(int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, bool present_time_transparency) = 0; |
2496 | 91 virtual void DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor) = 0; |
92 | |
93 virtual void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16) = 0; | |
94 virtual void _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, void *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7) = 0; | |
95 | |
96 virtual void DrawBuildingsD3D() = 0; | |
97 | |
98 virtual void DrawIndoorSky(unsigned int uNumVertices, unsigned int uFaceID = 0) = 0; | |
99 virtual void DrawOutdoorSkyD3D() = 0; | |
100 virtual void DrawOutdoorSkyPolygon(unsigned int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture) = 0; | |
101 virtual void DrawIndoorSkyPolygon(signed int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture) = 0; | |
102 | |
103 virtual void PrepareDecorationsRenderList_ODM() = 0; | |
104 virtual void DrawSpriteObjects_ODM() = 0; | |
105 | |
106 virtual void RenderTerrainD3D() = 0; | |
107 | |
108 virtual bool AreRenderSurfacesOk() = 0; | |
109 virtual bool IsGammaSupported() = 0; | |
110 | |
111 virtual void SaveScreenshot(const char *pFilename, unsigned int width, unsigned int height) = 0; | |
112 virtual void PackScreenshot(unsigned int width, unsigned int height, void *out_data, unsigned int data_size, unsigned int *screenshot_size) = 0; | |
113 virtual void SavePCXScreenshot() = 0; | |
114 | |
115 virtual int _46À6ÀÑ_GetActorsInViewport(int pDepth) = 0; | |
116 | |
117 virtual void BeginLightmaps() = 0; | |
118 virtual void EndLightmaps() = 0; | |
119 virtual void BeginLightmaps2() = 0; | |
120 virtual void EndLightmaps2() = 0; | |
121 virtual bool DrawLightmap(struct Lightmap *pLightmap, struct Vec3_float_ *pColorMult, float z_bias) = 0; | |
122 | |
123 virtual void BeginDecals() = 0; | |
124 virtual void EndDecals() = 0; | |
125 virtual void DrawDecal(struct Decal *pDecal, float z_bias) = 0; | |
126 | |
127 virtual void do_draw_debug_line_d3d(const RenderVertexD3D3 *pLineBegin, signed int sDiffuseBegin, const RenderVertexD3D3 *pLineEnd, signed int sDiffuseEnd, float z_stuff) = 0; | |
128 virtual void DrawLines(const RenderVertexD3D3 *vertices, unsigned int num_vertices) = 0; | |
129 | |
130 virtual void DrawSpecialEffectsQuad(const RenderVertexD3D3 *vertices, IDirect3DTexture2 *texture) = 0; | |
131 | |
132 virtual void am_Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3) = 0; | |
133 virtual void am_Blt_Chroma(RECT *pSrcRect, POINT *pTargetPoint, int a3, int blend_mode) = 0; | |
134 | |
135 | |
136 | |
137 | |
138 | |
139 | |
140 | |
141 | |
2526 | 142 inline IRender() |
143 { | |
144 pActiveZBuffer = 0; | |
145 pDirectDraw4 = 0; | |
146 pFrontBuffer4 = 0; | |
147 pBackBuffer4 = 0; | |
148 pTargetSurface = 0; | |
149 uTargetSurfacePitch = 0; | |
150 bUseColoredLights = 0; | |
151 bTinting = 0; | |
152 bUsingSpecular = 0; | |
153 uFogColor = 0; | |
154 memset(pHDWaterBitmapIDs, 0, sizeof(pHDWaterBitmapIDs)); | |
155 hd_water_current_frame = 0; | |
156 hd_water_tile_id = 0; | |
157 pBeforePresentFunction = 0; | |
158 bFogEnabled; | |
159 memset(pBillboardRenderListD3D, 0, sizeof(pBillboardRenderListD3D)); | |
160 uNumBillboardsToDraw = 0; | |
161 } | |
2496 | 162 |
163 int *pActiveZBuffer; | |
164 IDirectDraw4 *pDirectDraw4; | |
165 IDirectDrawSurface4 *pFrontBuffer4; | |
166 IDirectDrawSurface4 *pBackBuffer4; | |
167 void *pTargetSurface; | |
168 unsigned int uTargetSurfacePitch; | |
169 unsigned int bUseColoredLights; | |
170 unsigned int bTinting; | |
171 unsigned int bUsingSpecular; | |
172 uint32_t uFogColor; | |
173 unsigned int pHDWaterBitmapIDs[7]; | |
174 int hd_water_current_frame; | |
175 int hd_water_tile_id; | |
176 void (*pBeforePresentFunction)(); | |
177 uint32_t bFogEnabled; | |
178 RenderBillboardD3D pBillboardRenderListD3D[1000]; | |
179 unsigned int uNumBillboardsToDraw; | |
180 | |
181 virtual void WritePixel16(int x, int y, unsigned __int16 color) = 0; | |
182 virtual unsigned __int16 ReadPixel16(int x, int y) = 0; | |
183 | |
184 virtual void ToggleTint() = 0; | |
185 virtual void ToggleColoredLights() = 0; | |
186 | |
187 virtual unsigned int GetRenderWidth() = 0; | |
188 virtual unsigned int GetRenderHeight() = 0; | |
189 | |
190 virtual void Sub01() = 0; | |
191 }; |