Mercurial > mm7
annotate Render.h @ 2101:ee2724b9ca05
RasterLine2D fix and etc.
author | Ritor1 |
---|---|
date | Mon, 16 Dec 2013 18:43:42 +0600 |
parents | 259df09dfb50 |
children | 0db53678ff48 |
rev | line source |
---|---|
0 | 1 #pragma once |
1512 | 2 |
3 #include <cstdint> | |
4 #include <cstdio> | |
0 | 5 |
6 #include "lib\legacy_dx\d3d.h" | |
1802 | 7 #include "OSWindow.h" |
0 | 8 |
9 #include "VectorTypes.h" | |
10 | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
11 struct Polygon; |
0 | 12 struct Texture; |
13 struct RGBTexture; | |
14 struct RenderBillboardTransform_local0; | |
15 struct ODMFace; | |
16 | |
17 | |
2069 | 18 unsigned __int16 Color16(unsigned __int32 r, unsigned __int32 g, unsigned __int32 b); |
19 unsigned __int32 Color32(unsigned __int16 color16); | |
20 | |
0 | 21 /* 119 */ |
22 #pragma pack(push, 1) | |
23 struct RenderVertexSoft | |
24 { | |
25 inline RenderVertexSoft(): | |
26 flt_2C(0.0f) | |
27 {} | |
28 | |
29 Vec3_float_ vWorldPosition; | |
30 Vec3_float_ vWorldViewPosition; | |
31 float vWorldViewProjX; | |
32 float vWorldViewProjY; | |
168 | 33 float _rhw; |
0 | 34 float u; |
35 float v; | |
36 float flt_2C; | |
37 }; | |
38 #pragma pack(pop) | |
39 | |
40 | |
41 | |
42 /* 112 */ | |
43 #pragma pack(push, 1) | |
44 struct RenderVertexD3D3 | |
45 { | |
46 Vec3_float_ pos; | |
47 float rhw; | |
2006 | 48 signed int diffuse; |
0 | 49 unsigned int specular; |
50 Vec2_float_ texcoord; | |
51 }; | |
1269 | 52 #pragma pack(pop) |
0 | 53 |
1016 | 54 class Sprite; |
55 class SpriteFrame; | |
0 | 56 |
57 /* 161 */ | |
58 #pragma pack(push, 1) | |
59 struct RenderBillboard | |
60 { | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
61 int _screenspace_x_scaler_packedfloat; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
62 int _screenspace_y_scaler_packedfloat; |
0 | 63 float fov_x; |
64 float fov_y; | |
194 | 65 union |
66 { | |
67 int sZValue; | |
68 struct | |
69 { | |
70 unsigned __int16 object_pid; | |
71 signed __int16 actual_z; | |
72 }; | |
73 }; | |
142 | 74 int field_14_actor_id; |
0 | 75 unsigned __int16 uHwSpriteID; |
76 __int16 uPalette; | |
77 __int16 uIndoorSectorID; | |
78 __int16 field_1E; | |
430 | 79 __int16 world_x; |
80 __int16 world_y; | |
81 __int16 world_z; | |
0 | 82 __int16 uScreenSpaceX; |
83 __int16 uScreenSpaceY; | |
657 | 84 unsigned __int16 dimming_level; |
2006 | 85 signed int sTintColor; |
0 | 86 SpriteFrame *pSpriteFrame; |
159 | 87 |
88 inline float GetFloatZ() const | |
89 { | |
194 | 90 return (float)object_pid / 65535.0f + (float)actual_z; |
159 | 91 } |
0 | 92 }; |
93 #pragma pack(pop) | |
94 | |
95 | |
96 #pragma pack(push, 1) | |
97 struct RenderD3D__DevInfo | |
98 { | |
99 unsigned int bIsDeviceCompatible; | |
100 char *pName; | |
101 char *pDescription; | |
102 GUID *pGUID; | |
103 unsigned int uCaps; | |
104 char *pDriverName; | |
105 char *pDeviceDesc; | |
106 char *pDDraw4DevDesc; | |
107 GUID *pDirectDrawGUID; | |
108 int uVideoMem; | |
109 }; | |
110 #pragma pack(pop) | |
111 | |
112 | |
113 | |
114 #pragma pack(push, 1) | |
115 struct RenderD3D_D3DDevDesc | |
116 { | |
117 int field_0; | |
118 int field_4; | |
119 int field_8; | |
120 int field_C; | |
121 int field_10; | |
122 char *pDriverName; | |
123 char *pDeviceDesc; | |
124 char *pDDraw4DevDesc; | |
125 GUID *pGUID; | |
126 unsigned int uVideoMem; | |
127 }; | |
128 #pragma pack(pop) | |
129 | |
130 | |
131 | |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | |
138 /* 280 */ | |
139 #pragma pack(push, 1) | |
140 struct HWLTexture | |
141 { | |
142 inline HWLTexture(): | |
143 field_0(0), field_4(0), field_8(0), | |
144 field_C(0), field_10(0), field_14(0) | |
145 {} | |
146 | |
147 int field_0; | |
148 int field_4; | |
149 int field_8; | |
150 int field_C; | |
151 int field_10; | |
152 int field_14; | |
670 | 153 int uBufferWidth; |
154 int uBufferHeight; | |
155 int uAreaWidth; | |
156 int uAreaHeigth; | |
0 | 157 unsigned int uWidth; |
158 unsigned int uHeight; | |
670 | 159 int uAreaX; |
160 int uAreaY; | |
0 | 161 unsigned __int16 *pPixels; |
162 }; | |
163 #pragma pack(pop) | |
164 | |
165 | |
166 /* 185 */ | |
167 #pragma pack(push, 1) | |
168 struct RenderHWLContainer | |
169 { | |
170 RenderHWLContainer(); | |
171 bool Load(const wchar_t *pFilename); | |
172 bool Release(); | |
173 | |
174 HWLTexture *LoadTexture(const char *pName, int bMipMaps); | |
175 | |
176 FILE *pFile; | |
1512 | 177 uint32_t uSignature; |
0 | 178 unsigned int uDataOffset; |
179 unsigned int uNumItems; | |
180 char *pSpriteNames[50000]; | |
181 int pSpriteOffsets[50000]; | |
182 int bDumpDebug; | |
1583 | 183 int scale_hwls_to_half; |
0 | 184 }; |
185 #pragma pack(pop) | |
186 | |
187 | |
188 | |
189 /* 242 */ | |
190 #pragma pack(push, 1) | |
191 struct RenderBillboardD3D | |
192 { | |
2006 | 193 enum OpacityType: signed __int32 |
0 | 194 { |
195 Transparent = 0, | |
196 Opaque_1 = 1, | |
197 Opaque_2 = 2, | |
198 Opaque_3 = 3, | |
2006 | 199 NoBlend = -1 |
0 | 200 }; |
201 | |
202 IDirect3DTexture2 *pTexture; | |
203 unsigned int uNumVertices; | |
1390 | 204 RenderVertexD3D3 pQuads[4]; |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
205 float z_order; |
0 | 206 OpacityType uOpacity; |
207 int field_90; | |
208 int sZValue; | |
2002 | 209 signed int sParentBillboardID; |
0 | 210 }; |
211 #pragma pack(pop) | |
212 | |
213 | |
214 | |
215 | |
216 #pragma pack(push, 1) | |
217 struct RenderD3D_aux | |
218 { | |
219 RenderD3D__DevInfo *pInfo; | |
220 RenderD3D_D3DDevDesc *ptr_4; | |
221 }; | |
222 #pragma pack(pop) | |
223 | |
224 | |
225 | |
226 /* 183 */ | |
227 #pragma pack(push, 1) | |
228 struct RenderD3D | |
229 { | |
230 RenderD3D(); | |
231 | |
232 void GetAvailableDevices(RenderD3D__DevInfo **pOutDevices); | |
233 void Release(); | |
2069 | 234 bool CreateDevice(unsigned int uDeviceID, int bWindowed, struct OSWindow *window); |
0 | 235 unsigned int GetDeviceCaps(); |
236 void ClearTarget(unsigned int bClearColor, unsigned int uClearColor, unsigned int bClearDepth, float z_clear); | |
237 void Present(bool bForceBlit); | |
238 bool CreateTexture(unsigned int uTextureWidth, unsigned int uTextureHeight, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture, bool bAlphaChannel, bool bMipmaps, unsigned int uMinDeviceTexDim); | |
239 void HandleLostResources(); | |
240 | |
241 | |
242 unsigned int bWindowed; | |
243 int field_4; | |
244 int field_8; | |
245 HWND hWindow; | |
246 int field_10; | |
247 int field_14; | |
248 int field_18; | |
249 RenderD3D__DevInfo *pAvailableDevices; | |
250 IDirectDraw4 *pHost; | |
251 IDirect3D3 *pDirect3D; | |
252 IUnknown *pUnk; | |
253 IDirectDrawSurface4 *pBackBuffer; | |
254 IDirectDrawSurface4 *pFrontBuffer; | |
255 IDirectDrawSurface4 *pZBuffer; | |
256 IDirect3DDevice3 *pDevice; | |
257 IDirect3DViewport3 *pViewport; | |
258 int field_40; | |
259 int field_44; | |
260 char pErrorMessage[48]; | |
261 char field_78[208]; | |
262 }; | |
263 #pragma pack(pop) | |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1206
diff
changeset
|
264 extern struct RenderVertexD3D3 pVertices[50]; |
0 | 265 |
266 /* 182 */ | |
267 #pragma pack(push, 1) | |
268 struct Render | |
269 { | |
270 Render(); | |
271 ~Render(); | |
272 | |
273 static Render *Create() {return new Render;} | |
274 | |
2069 | 275 bool Initialize(OSWindow *window, bool bColoredLights, uint32_t uDetailLevel, bool bTinting); |
0 | 276 |
277 | |
278 bool IsColorKeySupported(IDirectDraw4 *); | |
2069 | 279 void _stub_49EBF1(); |
0 | 280 void ClearBlack(); |
281 void PresentBlackScreen(); | |
282 void SavePCXScreenshot(); | |
2069 | 283 void SaveWinnersCertificate(const char *a1); |
810 | 284 void PackPCXpicture(unsigned short* picture_data, int wight, int heidth, void *data_buff, int max_buff_size,unsigned int* packed_size); |
0 | 285 FILE *SavePCXImage(const char *Filename, char *a3, int a4, int a5); |
286 void ClearTarget(unsigned int uColor); | |
287 void Release2(); | |
288 void Present(); | |
289 void _49FD3A(); | |
290 void CreateZBuffer(); | |
291 void Release(); | |
292 void CreateSomeTexture(); | |
1802 | 293 bool InitializeFullscreen(); |
294 bool SwitchToWindow(); | |
2101 | 295 char RasterLine2D(signed int uX, signed int uY, signed int uZ, signed int uW, unsigned __int16 uColor); |
0 | 296 void ClearZBuffer(int a2, int a3); |
709 | 297 void SetRasterClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW); |
0 | 298 void ParseTargetPixelFormat(); |
299 bool LockSurface_DDraw4(IDirectDrawSurface4 *pSurface, DDSURFACEDESC2 *pDesc, unsigned int uLockFlags); | |
300 bool LockSurface_DDraw2(IDirectDrawSurface2 *pSurface, DDSURFACEDESC *pDesc, unsigned int uLockFlags); | |
301 void CreateDirectDraw(); | |
302 void SetDirectDrawCooperationMode(HWND hWnd, bool bFullscreen); | |
303 void SetDirectDrawDisplayMode(unsigned int uWidth, unsigned int uHeight, unsigned int uBPP); | |
304 void CreateFrontBuffer(); | |
305 void CreateBackBuffer(); | |
306 void CreateDirectDrawPrimarySurface(); | |
307 void CreateClipper(HWND a2); | |
308 void GetTargetPixelFormat(DDPIXELFORMAT *pOut); | |
309 void LockRenderSurface(void **pOutSurfacePtr, unsigned int *pOutPixelsPerRow); | |
310 void UnlockBackBuffer(); | |
311 void LockFrontBuffer(void **pOutSurface, unsigned int *pOutPixelsPerRow); | |
312 void UnlockFrontBuffer(); | |
313 void RestoreFrontBuffer(); | |
314 HRESULT _4A184C(); | |
315 void PresentRect(RECT *a2, RECT *a3); | |
316 void BltToFront(RECT *pDstRect, IDirectDrawSurface *pSrcSurface, RECT *pSrcRect, unsigned int uBltFlags); | |
317 void BltBackToFontFast(int a2, int a3, RECT *a4); | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
318 unsigned int Billboard_ProbablyAddToListAndSortByZOrder(float z); |
0 | 319 unsigned int GetBillboardDrawListSize(); |
320 unsigned int GetParentBillboardID(unsigned int uBillboardID); | |
321 void BeginSceneD3D(); | |
322 void DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); | |
349 | 323 unsigned int GetActorTintColor(float a2, int tint, int a4, int a5, RenderBillboard *a6); |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
324 void DrawPolygon(unsigned int uNumVertices, struct Polygon *a3, ODMFace *a4, IDirect3DTexture2 *pTexture); |
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
325 void DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders); |
1923 | 326 void DrawOutdoorSkyPolygon(unsigned int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture); |
327 void DrawIndoorSkyPolygon(signed int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture); | |
1262 | 328 void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8); |
1923 | 329 void DrawIndoorSky(unsigned int uNumVertices, unsigned int uFaceID); |
0 | 330 void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); |
331 void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); | |
657 | 332 void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard); |
717 | 333 void DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *pSprite, int dimming_level); |
2069 | 334 //int MakeParticleBillboardAndPush_BLV_Software(int screenSpaceX, int screenSpaceY, int z, int lightColor, int a6); |
0 | 335 void DrawProjectile(float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, IDirect3DTexture2 *a9); |
1390 | 336 void _4A4CC9_AddSomeBillboard(struct stru6_stru1_indoor_sw_billboard *a1, int diffuse); |
0 | 337 bool LoadTexture(const char *pName, unsigned int bMipMaps, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture); |
670 | 338 bool MoveSpriteToDevice(Sprite *pSprite); |
0 | 339 void BeginScene(); |
340 void EndScene(); | |
341 unsigned int _4A52F1(unsigned int this_, float a3); | |
727 | 342 void SetTextureClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW); |
343 void ResetTextureClipRect(); | |
0 | 344 void DrawTextureRGB(unsigned int uOutX, unsigned int uOutY, RGBTexture *a4); |
1675 | 345 void CreditsTextureScroll(unsigned int pX, unsigned int pY, int move_X, int move_Y, RGBTexture *pTexture); |
1262 | 346 void DrawTextureIndexed(unsigned int uX, unsigned int uY, struct Texture *a4); |
347 void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5); | |
348 void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal); | |
349 void DrawTextureTransparent(unsigned int uX, unsigned int uY, struct Texture *pTexture); | |
1455 | 350 void DrawAura(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); |
1262 | 351 void _4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); |
352 void DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4); | |
353 void DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture); | |
2069 | 354 void DrawMasked(signed int a2, signed int a3, struct Texture *pTexture, unsigned __int16 mask); |
1496 | 355 void GetLeather(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height); |
1268 | 356 void DrawTextPalette(int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8); |
0 | 357 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); |
358 void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16); | |
2069 | 359 void _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, void *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7); |
1262 | 360 void _4A6E7E(unsigned int a2, unsigned int a3, struct Texture *a4); |
1787 | 361 void DrawBuildingsD3D(); |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
362 //struct BSPModel *DrawBuildingsSW(); |
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
363 //int OnOutdoorRedrawSW(); |
1923 | 364 void DrawOutdoorSkyD3D(); |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
365 //int DrawSkySW(struct Span *a1, Polygon *a2, int a3); |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
366 void PrepareDecorationsRenderList_ODM(); |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
430
diff
changeset
|
367 void DrawSpriteObjects_ODM(); |
0 | 368 void TransformBillboardsAndSetPalettesODM(); |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
369 //float DrawBezierTerrain(); |
86 | 370 void RenderTerrainD3D(); |
985 | 371 void DrawTerrainD3D(int a1, int edx0, int a3, int unk4); |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
372 //void DrawTerrainSW(int a1, int a2, int a3, int a4); |
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1390
diff
changeset
|
373 //void ExecOutdoorDrawSW(); |
0 | 374 void ChangeBetweenWinFullscreenModes(); |
375 void DrawBillboardList_BLV(); | |
2002 | 376 void __cdecl sub_4A19B0(); |
0 | 377 |
1802 | 378 //unsigned int bUserDirect3D; |
2069 | 379 //unsigned int bStartInWindow; |
0 | 380 unsigned int uDesiredDirect3DDevice; |
381 unsigned int uAcquiredDirect3DDevice; | |
382 int field_10; | |
383 int field_14; | |
384 int field_18_locked_pitch; | |
709 | 385 int raster_clip_x; |
386 int raster_clip_y; // clipping rect for raster ops | |
387 int raster_clip_z; // like RasterLine2D for (mini)map | |
388 int raster_clip_w; | |
2069 | 389 __int16 unused_2C[65536]; |
390 __int16 unused_2002C[65536]; | |
0 | 391 int field_4002C; |
392 int field_40030; | |
393 int *pActiveZBuffer; | |
394 int *pDefaultZBuffer; | |
395 int field_4003C; | |
396 int field_40040; | |
397 int field_40044; | |
398 int field_40048; | |
399 int field_4004C; | |
1802 | 400 //HWND hWnd; |
401 OSWindow *window; | |
0 | 402 int field_40054; |
403 unsigned int bWindowMode; | |
404 int field_4005C[11]; | |
405 RenderD3D *pRenderD3D; | |
406 IDirectDraw4 *pDirectDraw4; | |
407 IDirectDrawSurface4 *pFrontBuffer4; | |
408 IDirectDrawSurface4 *pBackBuffer4; | |
409 IDirectDrawSurface4 *pColorKeySurface4; | |
410 IDirectDraw2 *pDirectDraw2; | |
411 IDirectDrawSurface2 *pFrontBuffer2; | |
412 IDirectDrawSurface2 *pBackBuffer2; | |
413 IDirectDrawSurface2 *pSomeSurface2; | |
2069 | 414 DDPIXELFORMAT ddpfPrimarySuface; |
0 | 415 unsigned int uTargetRBits; |
416 unsigned int uTargetGBits; | |
417 unsigned int uTargetBBits; | |
418 unsigned int uTargetRMask; | |
419 unsigned int uTargetGMask; | |
420 unsigned int uTargetBMask; | |
421 unsigned int uNumSceneBegins; | |
2069 | 422 unsigned __int32 *pTargetSurface_unaligned; |
423 void *pTargetSurface; | |
0 | 424 unsigned int uTargetSurfacePitch; |
425 unsigned int uClipY; | |
426 unsigned int uClipX; | |
427 unsigned int uClipW; | |
428 unsigned int uClipZ; | |
429 unsigned int bClip; | |
2069 | 430 //unsigned int bColorKeySupported; |
0 | 431 unsigned int uNumD3DSceneBegins; |
2069 | 432 int using_software_screen_buffer; |
0 | 433 RenderHWLContainer pD3DBitmaps; |
434 RenderHWLContainer pD3DSprites; | |
435 unsigned int bUseColoredLights; | |
436 unsigned int bRequiredTextureStagesAvailable; | |
437 unsigned int bTinting; | |
438 unsigned int uLevelOfDetail; | |
439 unsigned int uMaxDeviceTextureDim; | |
440 unsigned int uMinDeviceTextureDim; | |
441 int field_10365C; | |
442 unsigned int bUsingSpecular; | |
1512 | 443 uint32_t uFogColor; |
0 | 444 int field_103668; |
445 unsigned int pHDWaterBitmapIDs[7]; | |
446 char field_103688[32]; | |
265 | 447 int hd_water_current_frame; |
448 int hd_water_tile_id; | |
0 | 449 IDirectDrawSurface4 *pSurface; |
450 IDirect3DTexture2 *pTexture; | |
451 int field_1036B8; | |
452 int _gpu_memory_used; | |
1458 | 453 void ( *pBeforePresentFunction)(); |
0 | 454 int field_1036C4; |
1512 | 455 uint32_t bFogEnabled; |
0 | 456 int field_1036CC; |
457 RenderBillboardD3D pBillboardRenderListD3D[1000]; | |
458 unsigned int uNumBillboardsToDraw; | |
459 int field_129834; | |
2069 | 460 //unsigned int uCurrentlyLockedSurfacePitch; |
461 //unsigned __int16 *pCurrentlyLockedSurfaceDataPtr; | |
462 //void *pCurrentlyLockedSoftSurface; | |
463 | |
464 inline void WritePixel16(int x, int y, unsigned __int16 color) | |
465 { | |
466 if (ddpfPrimarySuface.dwRGBBitCount == 32) | |
467 { | |
468 auto p = (unsigned __int32 *)pTargetSurface + x + y * uTargetSurfacePitch; | |
469 *p = Color32(color); | |
470 } | |
471 else if (ddpfPrimarySuface.dwRGBBitCount == 16) | |
472 { | |
473 auto p = (unsigned __int16 *)pTargetSurface + x + y * uTargetSurfacePitch; | |
474 *p = color; | |
475 } | |
476 else __debugbreak(); | |
477 } | |
478 | |
479 inline unsigned __int16 ReadPixel16(int x, int y) | |
480 { | |
481 if (ddpfPrimarySuface.dwRGBBitCount == 32) | |
482 { | |
483 auto p = (unsigned __int32 *)pTargetSurface + x + y * uTargetSurfacePitch; | |
484 return Color16((*p >> 16) & 255, (*p >> 8) & 255, *p & 255); | |
485 } | |
486 else if (ddpfPrimarySuface.dwRGBBitCount == 16) | |
487 { | |
488 auto p = (unsigned __int16 *)pTargetSurface + x + y * uTargetSurfacePitch; | |
489 return *p; | |
490 } | |
491 else __debugbreak(); | |
492 } | |
1655 | 493 |
494 | |
1802 | 495 //int windowed_mode_width; |
496 //int windowed_mode_height; | |
0 | 497 }; |
498 #pragma pack(pop) | |
499 | |
500 extern struct IDirectDrawClipper *pDDrawClipper; | |
501 extern struct Render *pRenderer; // idb | |
67 | 502 extern struct pUnkTerrain *Unks; |
0 | 503 |
504 | |
505 | |
506 /* 248 */ | |
507 #pragma pack(push, 1) | |
508 struct RenderBillboardTransform_local0 | |
509 { | |
2069 | 510 void *pTarget; |
0 | 511 int *pTargetZ; |
512 int uScreenSpaceX; | |
513 int uScreenSpaceY; | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
514 int _screenspace_x_scaler_packedfloat; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
515 int _screenspace_y_scaler_packedfloat; |
0 | 516 char field_18[8]; |
517 unsigned __int16 *pPalette; | |
518 unsigned __int16 *pPalette2; | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
519 union |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
520 { |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
521 int sZValue; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
522 struct |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
523 { |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
524 unsigned short object_pid; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
525 short zbuffer_depth; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
526 }; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
527 }; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
142
diff
changeset
|
528 unsigned int uFlags; // & 4 - mirror horizontally |
0 | 529 unsigned int uTargetPitch; |
530 unsigned int uViewportX; | |
531 unsigned int uViewportY; | |
532 unsigned int uViewportZ; | |
533 unsigned int uViewportW; | |
534 int field_44; | |
2002 | 535 int sParentBillboardID; |
2006 | 536 int sTintColor; |
0 | 537 }; |
538 #pragma pack(pop) | |
539 | |
540 | |
541 | |
542 | |
543 extern int uNumDecorationsDrawnThisFrame; // weak | |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1206
diff
changeset
|
544 extern RenderBillboard pBillboardRenderList[500]; |
0 | 545 extern unsigned int uNumBillboardsToDraw; |
546 extern int uNumSpritesDrawnThisFrame; // weak | |
547 | |
548 | |
549 | |
550 | |
1207
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1206
diff
changeset
|
551 extern RenderVertexSoft array_507D30[50]; |
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1206
diff
changeset
|
552 extern RenderVertexSoft array_50AC10[50]; |
96a81634669e
arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents:
1206
diff
changeset
|
553 extern RenderVertexSoft array_73D150[20]; |
0 | 554 |
1413 | 555 extern RenderVertexD3D3 d3d_vertex_buffer[50]; |