annotate Render.h @ 50:2ee78ed62d37

Слияние
author Ritor1
date Tue, 22 Jan 2013 17:40:13 +0600
parents 9c0607679772
children 3b4f8bd48e3b
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
Ritor1
parents:
diff changeset
2 #include <stdio.h>
Ritor1
parents:
diff changeset
3
Ritor1
parents:
diff changeset
4 #include "lib\legacy_dx\d3d.h"
Ritor1
parents:
diff changeset
5 #include "OSAPI.h"
Ritor1
parents:
diff changeset
6
Ritor1
parents:
diff changeset
7 #include "Sprites.h"
Ritor1
parents:
diff changeset
8 #include "VectorTypes.h"
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10 struct stru148;
Ritor1
parents:
diff changeset
11 struct Texture;
Ritor1
parents:
diff changeset
12 struct RGBTexture;
Ritor1
parents:
diff changeset
13 struct RenderBillboardTransform_local0;
Ritor1
parents:
diff changeset
14 struct ODMFace;
Ritor1
parents:
diff changeset
15
Ritor1
parents:
diff changeset
16
Ritor1
parents:
diff changeset
17 /* 119 */
Ritor1
parents:
diff changeset
18 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
19 struct RenderVertexSoft
Ritor1
parents:
diff changeset
20 {
Ritor1
parents:
diff changeset
21 inline RenderVertexSoft():
Ritor1
parents:
diff changeset
22 flt_2C(0.0f)
Ritor1
parents:
diff changeset
23 {}
Ritor1
parents:
diff changeset
24
Ritor1
parents:
diff changeset
25 Vec3_float_ vWorldPosition;
Ritor1
parents:
diff changeset
26 Vec3_float_ vWorldViewPosition;
Ritor1
parents:
diff changeset
27 float vWorldViewProjX;
Ritor1
parents:
diff changeset
28 float vWorldViewProjY;
Ritor1
parents:
diff changeset
29 float flt_20;
Ritor1
parents:
diff changeset
30 float u;
Ritor1
parents:
diff changeset
31 float v;
Ritor1
parents:
diff changeset
32 float flt_2C;
Ritor1
parents:
diff changeset
33 };
Ritor1
parents:
diff changeset
34 #pragma pack(pop)
Ritor1
parents:
diff changeset
35
Ritor1
parents:
diff changeset
36
Ritor1
parents:
diff changeset
37
Ritor1
parents:
diff changeset
38 /* 112 */
Ritor1
parents:
diff changeset
39 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
40 struct RenderVertexD3D3
Ritor1
parents:
diff changeset
41 {
Ritor1
parents:
diff changeset
42 Vec3_float_ pos;
Ritor1
parents:
diff changeset
43 float rhw;
Ritor1
parents:
diff changeset
44 unsigned int diffuse;
Ritor1
parents:
diff changeset
45 unsigned int specular;
Ritor1
parents:
diff changeset
46 Vec2_float_ texcoord;
Ritor1
parents:
diff changeset
47 };
Ritor1
parents:
diff changeset
48
Ritor1
parents:
diff changeset
49
Ritor1
parents:
diff changeset
50
Ritor1
parents:
diff changeset
51 /* 161 */
Ritor1
parents:
diff changeset
52 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
53 struct RenderBillboard
Ritor1
parents:
diff changeset
54 {
Ritor1
parents:
diff changeset
55 int field_0;
Ritor1
parents:
diff changeset
56 int field_4;
Ritor1
parents:
diff changeset
57 float fov_x;
Ritor1
parents:
diff changeset
58 float fov_y;
Ritor1
parents:
diff changeset
59 int sZValue;
Ritor1
parents:
diff changeset
60 int field_14;
Ritor1
parents:
diff changeset
61 unsigned __int16 uHwSpriteID;
Ritor1
parents:
diff changeset
62 __int16 uPalette;
Ritor1
parents:
diff changeset
63 __int16 uIndoorSectorID;
Ritor1
parents:
diff changeset
64 __int16 field_1E;
Ritor1
parents:
diff changeset
65 __int16 some_x;
Ritor1
parents:
diff changeset
66 __int16 some_y;
Ritor1
parents:
diff changeset
67 __int16 some_z;
Ritor1
parents:
diff changeset
68 __int16 uScreenSpaceX;
Ritor1
parents:
diff changeset
69 __int16 uScreenSpaceY;
Ritor1
parents:
diff changeset
70 unsigned __int16 uPaletteSubindex;
Ritor1
parents:
diff changeset
71 unsigned int uTintColor;
Ritor1
parents:
diff changeset
72 SpriteFrame *pSpriteFrame;
Ritor1
parents:
diff changeset
73 };
Ritor1
parents:
diff changeset
74 #pragma pack(pop)
Ritor1
parents:
diff changeset
75
Ritor1
parents:
diff changeset
76
Ritor1
parents:
diff changeset
77 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
78 struct RenderD3D__DevInfo
Ritor1
parents:
diff changeset
79 {
Ritor1
parents:
diff changeset
80 unsigned int bIsDeviceCompatible;
Ritor1
parents:
diff changeset
81 char *pName;
Ritor1
parents:
diff changeset
82 char *pDescription;
Ritor1
parents:
diff changeset
83 GUID *pGUID;
Ritor1
parents:
diff changeset
84 unsigned int uCaps;
Ritor1
parents:
diff changeset
85 char *pDriverName;
Ritor1
parents:
diff changeset
86 char *pDeviceDesc;
Ritor1
parents:
diff changeset
87 char *pDDraw4DevDesc;
Ritor1
parents:
diff changeset
88 GUID *pDirectDrawGUID;
Ritor1
parents:
diff changeset
89 int uVideoMem;
Ritor1
parents:
diff changeset
90 };
Ritor1
parents:
diff changeset
91 #pragma pack(pop)
Ritor1
parents:
diff changeset
92
Ritor1
parents:
diff changeset
93
Ritor1
parents:
diff changeset
94
Ritor1
parents:
diff changeset
95 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
96 struct RenderD3D_D3DDevDesc
Ritor1
parents:
diff changeset
97 {
Ritor1
parents:
diff changeset
98 int field_0;
Ritor1
parents:
diff changeset
99 int field_4;
Ritor1
parents:
diff changeset
100 int field_8;
Ritor1
parents:
diff changeset
101 int field_C;
Ritor1
parents:
diff changeset
102 int field_10;
Ritor1
parents:
diff changeset
103 char *pDriverName;
Ritor1
parents:
diff changeset
104 char *pDeviceDesc;
Ritor1
parents:
diff changeset
105 char *pDDraw4DevDesc;
Ritor1
parents:
diff changeset
106 GUID *pGUID;
Ritor1
parents:
diff changeset
107 unsigned int uVideoMem;
Ritor1
parents:
diff changeset
108 };
Ritor1
parents:
diff changeset
109 #pragma pack(pop)
Ritor1
parents:
diff changeset
110
Ritor1
parents:
diff changeset
111
Ritor1
parents:
diff changeset
112
Ritor1
parents:
diff changeset
113
Ritor1
parents:
diff changeset
114
Ritor1
parents:
diff changeset
115
Ritor1
parents:
diff changeset
116
Ritor1
parents:
diff changeset
117
Ritor1
parents:
diff changeset
118
Ritor1
parents:
diff changeset
119 /* 280 */
Ritor1
parents:
diff changeset
120 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
121 struct HWLTexture
Ritor1
parents:
diff changeset
122 {
Ritor1
parents:
diff changeset
123 inline HWLTexture():
Ritor1
parents:
diff changeset
124 field_0(0), field_4(0), field_8(0),
Ritor1
parents:
diff changeset
125 field_C(0), field_10(0), field_14(0)
Ritor1
parents:
diff changeset
126 {}
Ritor1
parents:
diff changeset
127
Ritor1
parents:
diff changeset
128 int field_0;
Ritor1
parents:
diff changeset
129 int field_4;
Ritor1
parents:
diff changeset
130 int field_8;
Ritor1
parents:
diff changeset
131 int field_C;
Ritor1
parents:
diff changeset
132 int field_10;
Ritor1
parents:
diff changeset
133 int field_14;
Ritor1
parents:
diff changeset
134 int field_18;
Ritor1
parents:
diff changeset
135 int field_1C;
Ritor1
parents:
diff changeset
136 int field_20;
Ritor1
parents:
diff changeset
137 int field_24;
Ritor1
parents:
diff changeset
138 unsigned int uWidth;
Ritor1
parents:
diff changeset
139 unsigned int uHeight;
Ritor1
parents:
diff changeset
140 int field_30;
Ritor1
parents:
diff changeset
141 int field_34;
Ritor1
parents:
diff changeset
142 unsigned __int16 *pPixels;
Ritor1
parents:
diff changeset
143 };
Ritor1
parents:
diff changeset
144 #pragma pack(pop)
Ritor1
parents:
diff changeset
145
Ritor1
parents:
diff changeset
146
Ritor1
parents:
diff changeset
147 /* 185 */
Ritor1
parents:
diff changeset
148 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
149 struct RenderHWLContainer
Ritor1
parents:
diff changeset
150 {
Ritor1
parents:
diff changeset
151 RenderHWLContainer();
Ritor1
parents:
diff changeset
152 bool Load(const wchar_t *pFilename);
Ritor1
parents:
diff changeset
153 bool Release();
Ritor1
parents:
diff changeset
154
Ritor1
parents:
diff changeset
155 HWLTexture *LoadTexture(const char *pName, int bMipMaps);
Ritor1
parents:
diff changeset
156
Ritor1
parents:
diff changeset
157 FILE *pFile;
Ritor1
parents:
diff changeset
158 uint uSignature;
Ritor1
parents:
diff changeset
159 unsigned int uDataOffset;
Ritor1
parents:
diff changeset
160 unsigned int uNumItems;
Ritor1
parents:
diff changeset
161 char *pSpriteNames[50000];
Ritor1
parents:
diff changeset
162 int pSpriteOffsets[50000];
Ritor1
parents:
diff changeset
163 int bDumpDebug;
Ritor1
parents:
diff changeset
164 int field_61A94_scale_hwls_to_half;
Ritor1
parents:
diff changeset
165 };
Ritor1
parents:
diff changeset
166 #pragma pack(pop)
Ritor1
parents:
diff changeset
167
Ritor1
parents:
diff changeset
168
Ritor1
parents:
diff changeset
169
Ritor1
parents:
diff changeset
170 /* 242 */
Ritor1
parents:
diff changeset
171 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
172 struct RenderBillboardD3D
Ritor1
parents:
diff changeset
173 {
Ritor1
parents:
diff changeset
174 enum OpacityType: unsigned __int32
Ritor1
parents:
diff changeset
175 {
Ritor1
parents:
diff changeset
176 Transparent = 0,
Ritor1
parents:
diff changeset
177 Opaque_1 = 1,
Ritor1
parents:
diff changeset
178 Opaque_2 = 2,
Ritor1
parents:
diff changeset
179 Opaque_3 = 3,
Ritor1
parents:
diff changeset
180 InvalidOpacity = 0xFFFFFFFF
Ritor1
parents:
diff changeset
181 };
Ritor1
parents:
diff changeset
182
Ritor1
parents:
diff changeset
183 IDirect3DTexture2 *pTexture;
Ritor1
parents:
diff changeset
184 unsigned int uNumVertices;
Ritor1
parents:
diff changeset
185 RenderVertexD3D3 pQuards[4];
Ritor1
parents:
diff changeset
186 float flt_88;
Ritor1
parents:
diff changeset
187 OpacityType uOpacity;
Ritor1
parents:
diff changeset
188 int field_90;
Ritor1
parents:
diff changeset
189 int sZValue;
Ritor1
parents:
diff changeset
190 unsigned int uParentBillboardID;
Ritor1
parents:
diff changeset
191 };
Ritor1
parents:
diff changeset
192 #pragma pack(pop)
Ritor1
parents:
diff changeset
193
Ritor1
parents:
diff changeset
194
Ritor1
parents:
diff changeset
195
Ritor1
parents:
diff changeset
196
Ritor1
parents:
diff changeset
197 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
198 struct RenderD3D_aux
Ritor1
parents:
diff changeset
199 {
Ritor1
parents:
diff changeset
200 RenderD3D__DevInfo *pInfo;
Ritor1
parents:
diff changeset
201 RenderD3D_D3DDevDesc *ptr_4;
Ritor1
parents:
diff changeset
202 };
Ritor1
parents:
diff changeset
203 #pragma pack(pop)
Ritor1
parents:
diff changeset
204
Ritor1
parents:
diff changeset
205
Ritor1
parents:
diff changeset
206
Ritor1
parents:
diff changeset
207 /* 183 */
Ritor1
parents:
diff changeset
208 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
209 struct RenderD3D
Ritor1
parents:
diff changeset
210 {
Ritor1
parents:
diff changeset
211 RenderD3D();
Ritor1
parents:
diff changeset
212
Ritor1
parents:
diff changeset
213 static bool DoesRaiseExceptions();
Ritor1
parents:
diff changeset
214
Ritor1
parents:
diff changeset
215 void GetAvailableDevices(RenderD3D__DevInfo **pOutDevices);
Ritor1
parents:
diff changeset
216 void Release();
Ritor1
parents:
diff changeset
217 bool CreateDevice(unsigned int uDeviceID, int bWindowed, HWND hWnd);
Ritor1
parents:
diff changeset
218 unsigned int GetDeviceCaps();
Ritor1
parents:
diff changeset
219 void ClearTarget(unsigned int bClearColor, unsigned int uClearColor, unsigned int bClearDepth, float z_clear);
Ritor1
parents:
diff changeset
220 void Present(bool bForceBlit);
Ritor1
parents:
diff changeset
221 bool CreateTexture(unsigned int uTextureWidth, unsigned int uTextureHeight, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture, bool bAlphaChannel, bool bMipmaps, unsigned int uMinDeviceTexDim);
Ritor1
parents:
diff changeset
222 void HandleLostResources();
Ritor1
parents:
diff changeset
223
Ritor1
parents:
diff changeset
224
Ritor1
parents:
diff changeset
225 unsigned int bWindowed;
Ritor1
parents:
diff changeset
226 int field_4;
Ritor1
parents:
diff changeset
227 int field_8;
Ritor1
parents:
diff changeset
228 HWND hWindow;
Ritor1
parents:
diff changeset
229 int field_10;
Ritor1
parents:
diff changeset
230 int field_14;
Ritor1
parents:
diff changeset
231 int field_18;
Ritor1
parents:
diff changeset
232 RenderD3D__DevInfo *pAvailableDevices;
Ritor1
parents:
diff changeset
233 IDirectDraw4 *pHost;
Ritor1
parents:
diff changeset
234 IDirect3D3 *pDirect3D;
Ritor1
parents:
diff changeset
235 IUnknown *pUnk;
Ritor1
parents:
diff changeset
236 IDirectDrawSurface4 *pBackBuffer;
Ritor1
parents:
diff changeset
237 IDirectDrawSurface4 *pFrontBuffer;
Ritor1
parents:
diff changeset
238 IDirectDrawSurface4 *pZBuffer;
Ritor1
parents:
diff changeset
239 IDirect3DDevice3 *pDevice;
Ritor1
parents:
diff changeset
240 IDirect3DViewport3 *pViewport;
Ritor1
parents:
diff changeset
241 int field_40;
Ritor1
parents:
diff changeset
242 int field_44;
Ritor1
parents:
diff changeset
243 char pErrorMessage[48];
Ritor1
parents:
diff changeset
244 char field_78[208];
Ritor1
parents:
diff changeset
245 };
Ritor1
parents:
diff changeset
246 #pragma pack(pop)
Ritor1
parents:
diff changeset
247
Ritor1
parents:
diff changeset
248
Ritor1
parents:
diff changeset
249 /* 182 */
Ritor1
parents:
diff changeset
250 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
251 struct Render
Ritor1
parents:
diff changeset
252 {
Ritor1
parents:
diff changeset
253 Render();
Ritor1
parents:
diff changeset
254 ~Render();
Ritor1
parents:
diff changeset
255
Ritor1
parents:
diff changeset
256 static Render *Create() {return new Render;}
Ritor1
parents:
diff changeset
257
Ritor1
parents:
diff changeset
258 bool Initialize(bool bWindowed, uint uDefaultDevice,
Ritor1
parents:
diff changeset
259 bool bColoredLights, uint uDetailLevel, uint bTinting);
Ritor1
parents:
diff changeset
260
Ritor1
parents:
diff changeset
261 static void __fastcall SetPixel(struct Vec2_int_ *pTargetXY, unsigned __int16 uColor);
Ritor1
parents:
diff changeset
262
Ritor1
parents:
diff changeset
263 bool IsColorKeySupported(IDirectDraw4 *);
Ritor1
parents:
diff changeset
264 void _49EBF1();
Ritor1
parents:
diff changeset
265 void ClearBlack();
Ritor1
parents:
diff changeset
266 void PresentBlackScreen();
Ritor1
parents:
diff changeset
267 void SavePCXScreenshot();
Ritor1
parents:
diff changeset
268 void _49F1BC(const char *a1);
Ritor1
parents:
diff changeset
269 int _49F5A2(int a2, int a3, int a4, void *Dst, int a6, int a7);
Ritor1
parents:
diff changeset
270 FILE *SavePCXImage(const char *Filename, char *a3, int a4, int a5);
Ritor1
parents:
diff changeset
271 void ClearTarget(unsigned int uColor);
Ritor1
parents:
diff changeset
272 void Release2();
Ritor1
parents:
diff changeset
273 void Present();
Ritor1
parents:
diff changeset
274 void _49FD3A();
Ritor1
parents:
diff changeset
275 void CreateZBuffer();
Ritor1
parents:
diff changeset
276 void Release();
Ritor1
parents:
diff changeset
277 void CreateSomeTexture();
Ritor1
parents:
diff changeset
278 bool InitializeFullscreen(HWND hWnd);
Ritor1
parents:
diff changeset
279 bool SwitchToWindow(HWND hWnd);
Ritor1
parents:
diff changeset
280 char Line2D(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned __int16 uColor);
Ritor1
parents:
diff changeset
281 void ClearZBuffer(int a2, int a3);
Ritor1
parents:
diff changeset
282 void Clip_v2(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW);
Ritor1
parents:
diff changeset
283 void ParseTargetPixelFormat();
Ritor1
parents:
diff changeset
284 bool LockSurface_DDraw4(IDirectDrawSurface4 *pSurface, DDSURFACEDESC2 *pDesc, unsigned int uLockFlags);
Ritor1
parents:
diff changeset
285 bool LockSurface_DDraw2(IDirectDrawSurface2 *pSurface, DDSURFACEDESC *pDesc, unsigned int uLockFlags);
Ritor1
parents:
diff changeset
286 void CreateDirectDraw();
Ritor1
parents:
diff changeset
287 void SetDirectDrawCooperationMode(HWND hWnd, bool bFullscreen);
Ritor1
parents:
diff changeset
288 void SetDirectDrawDisplayMode(unsigned int uWidth, unsigned int uHeight, unsigned int uBPP);
Ritor1
parents:
diff changeset
289 void CreateFrontBuffer();
Ritor1
parents:
diff changeset
290 void CreateBackBuffer();
Ritor1
parents:
diff changeset
291 void CreateDirectDrawPrimarySurface();
Ritor1
parents:
diff changeset
292 void CreateClipper(HWND a2);
Ritor1
parents:
diff changeset
293 void GetTargetPixelFormat(DDPIXELFORMAT *pOut);
Ritor1
parents:
diff changeset
294 void LockRenderSurface(void **pOutSurfacePtr, unsigned int *pOutPixelsPerRow);
Ritor1
parents:
diff changeset
295 bool UsingDirect3D();
Ritor1
parents:
diff changeset
296 void UnlockBackBuffer();
Ritor1
parents:
diff changeset
297 void LockFrontBuffer(void **pOutSurface, unsigned int *pOutPixelsPerRow);
Ritor1
parents:
diff changeset
298 void UnlockFrontBuffer();
Ritor1
parents:
diff changeset
299 void RestoreFrontBuffer();
Ritor1
parents:
diff changeset
300 HRESULT _4A184C();
Ritor1
parents:
diff changeset
301 void PresentRect(RECT *a2, RECT *a3);
Ritor1
parents:
diff changeset
302 void BltToFront(RECT *pDstRect, IDirectDrawSurface *pSrcSurface, RECT *pSrcRect, unsigned int uBltFlags);
Ritor1
parents:
diff changeset
303 void BltBackToFontFast(int a2, int a3, RECT *a4);
Ritor1
parents:
diff changeset
304 unsigned int Billboard_ProbablyAddToListAndSortByZOrder(unsigned int a1);
Ritor1
parents:
diff changeset
305 unsigned int GetBillboardDrawListSize();
Ritor1
parents:
diff changeset
306 unsigned int GetParentBillboardID(unsigned int uBillboardID);
Ritor1
parents:
diff changeset
307 void BeginSceneD3D();
Ritor1
parents:
diff changeset
308 void DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
Ritor1
parents:
diff changeset
309 unsigned int GetActorTintColor(float a2, int a3, int a4, int a5, RenderBillboard *a6);
Ritor1
parents:
diff changeset
310 void DrawPolygon(unsigned int uNumVertices, stru148 *a3, ODMFace *a4, IDirect3DTexture2 *pTexture);
Ritor1
parents:
diff changeset
311 void DrawTerrainPolygon(unsigned int uNumVertices, stru148 *a4, IDirect3DTexture2 *a5, int a6, int a7);
Ritor1
parents:
diff changeset
312 void DrawFan(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *a4);
Ritor1
parents:
diff changeset
313 void _4A2ED5(signed int a2, stru148 *a3, IDirect3DTexture2 *pHwTex);
Ritor1
parents:
diff changeset
314 void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8);
Ritor1
parents:
diff changeset
315 void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
Ritor1
parents:
diff changeset
316 void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
Ritor1
parents:
diff changeset
317 void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int a1a, RenderBillboard *pBillboard);
Ritor1
parents:
diff changeset
318 void DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *a3, int uPaletteSubindex);
Ritor1
parents:
diff changeset
319 int MakeParticleBillboardAndPush_BLV_Software(int screenSpaceX, int screenSpaceY, int z, int lightColor, int a6);
Ritor1
parents:
diff changeset
320 void DrawProjectile(float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, IDirect3DTexture2 *a9);
Ritor1
parents:
diff changeset
321 void _4A4CC9(struct stru6_stru1_indoor_sw_billboard *a1, int a2);
Ritor1
parents:
diff changeset
322 bool LoadTexture(const char *pName, unsigned int bMipMaps, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture);
Ritor1
parents:
diff changeset
323 HWLTexture *MoveSpriteToDevice(Sprite *pSprite);
Ritor1
parents:
diff changeset
324 void BeginScene();
Ritor1
parents:
diff changeset
325 void EndScene();
Ritor1
parents:
diff changeset
326 unsigned int _4A52F1(unsigned int this_, float a3);
Ritor1
parents:
diff changeset
327 void Clip(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW);
Ritor1
parents:
diff changeset
328 void ResetClip();
Ritor1
parents:
diff changeset
329 void DrawTextureRGB(unsigned int uOutX, unsigned int uOutY, RGBTexture *a4);
Ritor1
parents:
diff changeset
330 void _4A5D33(unsigned int a2, unsigned int a3, int a4, int a5, RGBTexture *pTexture);
Ritor1
parents:
diff changeset
331 void DrawTextureIndexed(unsigned int uX, unsigned int uY, Texture *a4);
Ritor1
parents:
diff changeset
332 void _4A601E(signed int a2, signed int a3, Texture *pTexture, int a5);
Ritor1
parents:
diff changeset
333 void _4A612A(signed int uOutX, unsigned int uOutY, Texture *pTexture, int zVal);
Ritor1
parents:
diff changeset
334 void DrawTextureTransparent(unsigned int uX, unsigned int uY, Texture *pTexture);
Ritor1
parents:
diff changeset
335 void _4A63E6(unsigned int a2, unsigned int a3, Texture *a4, Texture *a5, int a6, int a7, int a8);
Ritor1
parents:
diff changeset
336 void _4A65CC(unsigned int x, unsigned int y, Texture *a4, Texture *a5, int a6, int a7, int a8);
Ritor1
parents:
diff changeset
337 void _4A6776(unsigned int a2, unsigned int a3, Texture *a4);
Ritor1
parents:
diff changeset
338 void DrawTransparentGreenShade(signed int a2, signed int a3, Texture *pTexture);
Ritor1
parents:
diff changeset
339 void _4A6A68(unsigned int a2, unsigned int a3, Texture *a4, __int16 height);
Ritor1
parents:
diff changeset
340 void DrawTextPalette(int x, int y, int a4, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8);
Ritor1
parents:
diff changeset
341 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);
Ritor1
parents:
diff changeset
342 void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16);
Ritor1
parents:
diff changeset
343 int _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, unsigned __int16 *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7);
Ritor1
parents:
diff changeset
344 void _4A6E7E(unsigned int a2, unsigned int a3, Texture *a4);
Ritor1
parents:
diff changeset
345 char DrawBuildingsD3D();
Ritor1
parents:
diff changeset
346 struct BSPModel *DrawBuildingsSW();
Ritor1
parents:
diff changeset
347 int OnOutdoorRedrawSW();
Ritor1
parents:
diff changeset
348 void DrawSkyD3D();
Ritor1
parents:
diff changeset
349 int DrawSkySW(struct Span *a1, stru148 *a2, int a3);
Ritor1
parents:
diff changeset
350 void DrawDecorations();
Ritor1
parents:
diff changeset
351 void DrawLayingItems_Shooting_Magic_ODM();
Ritor1
parents:
diff changeset
352 void TransformBillboardsAndSetPalettesODM();
Ritor1
parents:
diff changeset
353 float DrawBezierTerrain();
Ritor1
parents:
diff changeset
354 void DrawTerrainD3D(int a1, int edx0, int a3);
Ritor1
parents:
diff changeset
355 void DrawTerrainSW(int a1, int a2, int a3);
Ritor1
parents:
diff changeset
356 __int16 ExecOutdoorDrawSW();
Ritor1
parents:
diff changeset
357 void ChangeBetweenWinFullscreenModes();
Ritor1
parents:
diff changeset
358 void DrawBillboardList_BLV();
Ritor1
parents:
diff changeset
359
Ritor1
parents:
diff changeset
360
Ritor1
parents:
diff changeset
361 unsigned int bUserDirect3D;
Ritor1
parents:
diff changeset
362 unsigned int bStartInWindow;
Ritor1
parents:
diff changeset
363 unsigned int uDesiredDirect3DDevice;
Ritor1
parents:
diff changeset
364 unsigned int uAcquiredDirect3DDevice;
Ritor1
parents:
diff changeset
365 int field_10;
Ritor1
parents:
diff changeset
366 int field_14;
Ritor1
parents:
diff changeset
367 int field_18_locked_pitch;
Ritor1
parents:
diff changeset
368 int field_1C_clipx;
Ritor1
parents:
diff changeset
369 int field_20_clipy;
Ritor1
parents:
diff changeset
370 int field_24_clipz;
Ritor1
parents:
diff changeset
371 int field_28_clipw;
Ritor1
parents:
diff changeset
372 __int16 field_2C[65536];
Ritor1
parents:
diff changeset
373 __int16 field_2002C[65536];
Ritor1
parents:
diff changeset
374 int field_4002C;
Ritor1
parents:
diff changeset
375 int field_40030;
Ritor1
parents:
diff changeset
376 int *pActiveZBuffer;
Ritor1
parents:
diff changeset
377 int *pDefaultZBuffer;
Ritor1
parents:
diff changeset
378 int field_4003C;
Ritor1
parents:
diff changeset
379 int field_40040;
Ritor1
parents:
diff changeset
380 int field_40044;
Ritor1
parents:
diff changeset
381 int field_40048;
Ritor1
parents:
diff changeset
382 int field_4004C;
Ritor1
parents:
diff changeset
383 HWND hWnd;
Ritor1
parents:
diff changeset
384 int field_40054;
Ritor1
parents:
diff changeset
385 unsigned int bWindowMode;
Ritor1
parents:
diff changeset
386 int field_4005C[11];
Ritor1
parents:
diff changeset
387 RenderD3D *pRenderD3D;
Ritor1
parents:
diff changeset
388 IDirectDraw4 *pDirectDraw4;
Ritor1
parents:
diff changeset
389 IDirectDrawSurface4 *pFrontBuffer4;
Ritor1
parents:
diff changeset
390 IDirectDrawSurface4 *pBackBuffer4;
Ritor1
parents:
diff changeset
391 IDirectDrawSurface4 *pColorKeySurface4;
Ritor1
parents:
diff changeset
392 IDirectDraw2 *pDirectDraw2;
Ritor1
parents:
diff changeset
393 IDirectDrawSurface2 *pFrontBuffer2;
Ritor1
parents:
diff changeset
394 IDirectDrawSurface2 *pBackBuffer2;
Ritor1
parents:
diff changeset
395 IDirectDrawSurface2 *pSomeSurface2;
Ritor1
parents:
diff changeset
396 DDPIXELFORMAT ddpfPrimareSuface;
Ritor1
parents:
diff changeset
397 unsigned int uTargetRBits;
Ritor1
parents:
diff changeset
398 unsigned int uTargetGBits;
Ritor1
parents:
diff changeset
399 unsigned int uTargetBBits;
Ritor1
parents:
diff changeset
400 unsigned int uTargetRMask;
Ritor1
parents:
diff changeset
401 unsigned int uTargetGMask;
Ritor1
parents:
diff changeset
402 unsigned int uTargetBMask;
Ritor1
parents:
diff changeset
403 unsigned int uNumSceneBegins;
Ritor1
parents:
diff changeset
404 int *ptr_400E8;
Ritor1
parents:
diff changeset
405 unsigned __int16 *pTargetSurface;
Ritor1
parents:
diff changeset
406 unsigned int uTargetSurfacePitch;
Ritor1
parents:
diff changeset
407 unsigned int uClipY;
Ritor1
parents:
diff changeset
408 unsigned int uClipX;
Ritor1
parents:
diff changeset
409 unsigned int uClipW;
Ritor1
parents:
diff changeset
410 unsigned int uClipZ;
Ritor1
parents:
diff changeset
411 unsigned int bClip;
Ritor1
parents:
diff changeset
412 unsigned int bColorKeySupported;
Ritor1
parents:
diff changeset
413 unsigned int uNumD3DSceneBegins;
Ritor1
parents:
diff changeset
414 int field_40110;
Ritor1
parents:
diff changeset
415 RenderHWLContainer pD3DBitmaps;
Ritor1
parents:
diff changeset
416 RenderHWLContainer pD3DSprites;
Ritor1
parents:
diff changeset
417 unsigned int bUseColoredLights;
Ritor1
parents:
diff changeset
418 unsigned int bRequiredTextureStagesAvailable;
Ritor1
parents:
diff changeset
419 unsigned int bTinting;
Ritor1
parents:
diff changeset
420 unsigned int uLevelOfDetail;
Ritor1
parents:
diff changeset
421 unsigned int uMaxDeviceTextureDim;
Ritor1
parents:
diff changeset
422 unsigned int uMinDeviceTextureDim;
Ritor1
parents:
diff changeset
423 int field_10365C;
Ritor1
parents:
diff changeset
424 unsigned int bUsingSpecular;
Ritor1
parents:
diff changeset
425 uint uFogColor;
Ritor1
parents:
diff changeset
426 int field_103668;
Ritor1
parents:
diff changeset
427 unsigned int pHDWaterBitmapIDs[7];
Ritor1
parents:
diff changeset
428 char field_103688[32];
Ritor1
parents:
diff changeset
429 int field_1036A8_bitmapid;
Ritor1
parents:
diff changeset
430 int field_1036AC_bitmapid;
Ritor1
parents:
diff changeset
431 IDirectDrawSurface4 *pSurface;
Ritor1
parents:
diff changeset
432 IDirect3DTexture2 *pTexture;
Ritor1
parents:
diff changeset
433 int field_1036B8;
Ritor1
parents:
diff changeset
434 int _gpu_memory_used;
Ritor1
parents:
diff changeset
435 void (__cdecl *pBeforePresentFunction)();
Ritor1
parents:
diff changeset
436 int field_1036C4;
Ritor1
parents:
diff changeset
437 uint bFogEnabled;
Ritor1
parents:
diff changeset
438 int field_1036CC;
Ritor1
parents:
diff changeset
439 RenderBillboardD3D pBillboardRenderListD3D[1000];
Ritor1
parents:
diff changeset
440 unsigned int uNumBillboardsToDraw;
Ritor1
parents:
diff changeset
441 int field_129834;
Ritor1
parents:
diff changeset
442 unsigned int uCurrentlyLockedSurfacePitch;
Ritor1
parents:
diff changeset
443 unsigned __int16 *pCurrentlyLockedSurfaceDataPtr;
Ritor1
parents:
diff changeset
444 unsigned __int16 *pCurrentlyLockedSoftSurface;
Ritor1
parents:
diff changeset
445 };
Ritor1
parents:
diff changeset
446 #pragma pack(pop)
Ritor1
parents:
diff changeset
447
Ritor1
parents:
diff changeset
448 extern struct IDirectDrawClipper *pDDrawClipper;
Ritor1
parents:
diff changeset
449 extern struct Render *pRenderer; // idb
Ritor1
parents:
diff changeset
450
Ritor1
parents:
diff changeset
451
Ritor1
parents:
diff changeset
452
Ritor1
parents:
diff changeset
453
Ritor1
parents:
diff changeset
454 /* 248 */
Ritor1
parents:
diff changeset
455 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
456 struct RenderBillboardTransform_local0
Ritor1
parents:
diff changeset
457 {
Ritor1
parents:
diff changeset
458 unsigned __int16 *pTarget;
Ritor1
parents:
diff changeset
459 int *pTargetZ;
Ritor1
parents:
diff changeset
460 int uScreenSpaceX;
Ritor1
parents:
diff changeset
461 int uScreenSpaceY;
Ritor1
parents:
diff changeset
462 int field_10;
Ritor1
parents:
diff changeset
463 int field_14;
Ritor1
parents:
diff changeset
464 char field_18[8];
Ritor1
parents:
diff changeset
465 unsigned __int16 *pPalette;
Ritor1
parents:
diff changeset
466 unsigned __int16 *pPalette2;
Ritor1
parents:
diff changeset
467 int sZValue;
Ritor1
parents:
diff changeset
468 unsigned int uFlags;
Ritor1
parents:
diff changeset
469 unsigned int uTargetPitch;
Ritor1
parents:
diff changeset
470 unsigned int uViewportX;
Ritor1
parents:
diff changeset
471 unsigned int uViewportY;
Ritor1
parents:
diff changeset
472 unsigned int uViewportZ;
Ritor1
parents:
diff changeset
473 unsigned int uViewportW;
Ritor1
parents:
diff changeset
474 int field_44;
Ritor1
parents:
diff changeset
475 int uParentBillboardID;
Ritor1
parents:
diff changeset
476 int uTintColor;
Ritor1
parents:
diff changeset
477 };
Ritor1
parents:
diff changeset
478 #pragma pack(pop)
Ritor1
parents:
diff changeset
479
Ritor1
parents:
diff changeset
480
Ritor1
parents:
diff changeset
481
Ritor1
parents:
diff changeset
482
Ritor1
parents:
diff changeset
483 extern int uNumDecorationsDrawnThisFrame; // weak
Ritor1
parents:
diff changeset
484 extern RenderBillboard pBillboardRenderList[500];
Ritor1
parents:
diff changeset
485 extern unsigned int uNumBillboardsToDraw;
Ritor1
parents:
diff changeset
486 extern int uNumSpritesDrawnThisFrame; // weak
Ritor1
parents:
diff changeset
487
Ritor1
parents:
diff changeset
488
Ritor1
parents:
diff changeset
489
Ritor1
parents:
diff changeset
490
Ritor1
parents:
diff changeset
491 extern RenderVertexSoft array_507D30[50];
Ritor1
parents:
diff changeset
492 extern RenderVertexSoft array_508690[50];
Ritor1
parents:
diff changeset
493 extern RenderVertexSoft array_508FF0[50];
Ritor1
parents:
diff changeset
494 extern RenderVertexSoft array_509950[50];
Ritor1
parents:
diff changeset
495 extern RenderVertexSoft array_50A2B0[50];
Ritor1
parents:
diff changeset
496 extern RenderVertexSoft array_50AC10[50];
Ritor1
parents:
diff changeset
497
Ritor1
parents:
diff changeset
498 extern RenderVertexSoft array_73D150[20];
Ritor1
parents:
diff changeset
499
Ritor1
parents:
diff changeset
500 extern RenderVertexD3D3 arary_77E5C8[50];
Ritor1
parents:
diff changeset
501
Ritor1
parents:
diff changeset
502 extern RenderVertexSoft *ptr_801A04;
Ritor1
parents:
diff changeset
503 extern RenderVertexSoft *ptr_801A08;
Ritor1
parents:
diff changeset
504
Ritor1
parents:
diff changeset
505 extern RenderVertexSoft pVerticesSR_801A10[384];
Ritor1
parents:
diff changeset
506 extern RenderVertexSoft pVerticesSR_806210[384];