annotate Render.h @ 2216:3f375342de12

window->GetWidth() continue
author Ritor1
date Sat, 15 Feb 2014 16:00:19 +0600
parents e1e4a8a20b5f
children 5944810e88e2
rev   line source
0
Ritor1
parents:
diff changeset
1 #pragma once
1512
af57b3b76fe4 Clean and decouple. (1)
yoctozepto
parents: 1496
diff changeset
2
af57b3b76fe4 Clean and decouple. (1)
yoctozepto
parents: 1496
diff changeset
3 #include <cstdint>
af57b3b76fe4 Clean and decouple. (1)
yoctozepto
parents: 1496
diff changeset
4 #include <cstdio>
0
Ritor1
parents:
diff changeset
5
Ritor1
parents:
diff changeset
6 #include "lib\legacy_dx\d3d.h"
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1675
diff changeset
7 #include "OSWindow.h"
0
Ritor1
parents:
diff changeset
8
Ritor1
parents:
diff changeset
9 #include "VectorTypes.h"
Ritor1
parents:
diff changeset
10
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
11
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
12 #define ErrD3D(hr) \
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
13 do \
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
14 { \
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
15 extern void ErrHR(HRESULT, const char *, const char *, const char *, int); \
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
16 ErrHR(hr, "Direct3D", __FUNCTION__, __FILE__, __LINE__); \
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
17 } while(0)
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
18
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
19 struct Polygon;
0
Ritor1
parents:
diff changeset
20 struct Texture;
Ritor1
parents:
diff changeset
21 struct RGBTexture;
Ritor1
parents:
diff changeset
22 struct RenderBillboardTransform_local0;
Ritor1
parents:
diff changeset
23 struct ODMFace;
Ritor1
parents:
diff changeset
24
Ritor1
parents:
diff changeset
25
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
26 unsigned __int16 Color16(unsigned __int32 r, unsigned __int32 g, unsigned __int32 b);
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
27 unsigned __int32 Color32(unsigned __int16 color16);
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
28
0
Ritor1
parents:
diff changeset
29 /* 119 */
Ritor1
parents:
diff changeset
30 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
31 struct RenderVertexSoft
Ritor1
parents:
diff changeset
32 {
Ritor1
parents:
diff changeset
33 inline RenderVertexSoft():
Ritor1
parents:
diff changeset
34 flt_2C(0.0f)
Ritor1
parents:
diff changeset
35 {}
Ritor1
parents:
diff changeset
36
Ritor1
parents:
diff changeset
37 Vec3_float_ vWorldPosition;
Ritor1
parents:
diff changeset
38 Vec3_float_ vWorldViewPosition;
Ritor1
parents:
diff changeset
39 float vWorldViewProjX;
Ritor1
parents:
diff changeset
40 float vWorldViewProjY;
168
ee11772d0ad2 New sky (turn on -new_sky console command)
Nomad
parents: 144
diff changeset
41 float _rhw;
0
Ritor1
parents:
diff changeset
42 float u;
Ritor1
parents:
diff changeset
43 float v;
Ritor1
parents:
diff changeset
44 float flt_2C;
Ritor1
parents:
diff changeset
45 };
Ritor1
parents:
diff changeset
46 #pragma pack(pop)
Ritor1
parents:
diff changeset
47
Ritor1
parents:
diff changeset
48
Ritor1
parents:
diff changeset
49
Ritor1
parents:
diff changeset
50 /* 112 */
Ritor1
parents:
diff changeset
51 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
52 struct RenderVertexD3D3
Ritor1
parents:
diff changeset
53 {
Ritor1
parents:
diff changeset
54 Vec3_float_ pos;
Ritor1
parents:
diff changeset
55 float rhw;
2006
30c2b575d25c signed fixes
zipi
parents: 2002
diff changeset
56 signed int diffuse;
0
Ritor1
parents:
diff changeset
57 unsigned int specular;
Ritor1
parents:
diff changeset
58 Vec2_float_ texcoord;
Ritor1
parents:
diff changeset
59 };
1269
34b08429a6b8 inserted missing pragma pack(pop)
Grumpy7
parents: 1268
diff changeset
60 #pragma pack(pop)
0
Ritor1
parents:
diff changeset
61
1016
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 992
diff changeset
62 class Sprite;
c45d51b3f4f4 Included header files cleanup
Grumpy7
parents: 992
diff changeset
63 class SpriteFrame;
0
Ritor1
parents:
diff changeset
64
Ritor1
parents:
diff changeset
65 /* 161 */
Ritor1
parents:
diff changeset
66 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
67 struct RenderBillboard
Ritor1
parents:
diff changeset
68 {
144
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
69 int _screenspace_x_scaler_packedfloat;
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
70 int _screenspace_y_scaler_packedfloat;
0
Ritor1
parents:
diff changeset
71 float fov_x;
Ritor1
parents:
diff changeset
72 float fov_y;
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
73 union
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
74 {
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
75 int sZValue;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
76 struct
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
77 {
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
78 unsigned __int16 object_pid;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
79 signed __int16 actual_z;
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
80 };
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
81 };
142
8b8fd4d83fdc Various things here and there
Nomad
parents: 86
diff changeset
82 int field_14_actor_id;
0
Ritor1
parents:
diff changeset
83 unsigned __int16 uHwSpriteID;
Ritor1
parents:
diff changeset
84 __int16 uPalette;
Ritor1
parents:
diff changeset
85 __int16 uIndoorSectorID;
Ritor1
parents:
diff changeset
86 __int16 field_1E;
430
58b71c1af7d8 Objects are drawn (items, spells sfx)
Nomad
parents: 349
diff changeset
87 __int16 world_x;
58b71c1af7d8 Objects are drawn (items, spells sfx)
Nomad
parents: 349
diff changeset
88 __int16 world_y;
58b71c1af7d8 Objects are drawn (items, spells sfx)
Nomad
parents: 349
diff changeset
89 __int16 world_z;
0
Ritor1
parents:
diff changeset
90 __int16 uScreenSpaceX;
Ritor1
parents:
diff changeset
91 __int16 uScreenSpaceY;
657
7747161ea5b5 RenderBillboard member rename
Nomad
parents: 515
diff changeset
92 unsigned __int16 dimming_level;
2006
30c2b575d25c signed fixes
zipi
parents: 2002
diff changeset
93 signed int sTintColor;
0
Ritor1
parents:
diff changeset
94 SpriteFrame *pSpriteFrame;
159
3235bc4cf78e NPCDialogue
Ritor1
parents: 144
diff changeset
95
3235bc4cf78e NPCDialogue
Ritor1
parents: 144
diff changeset
96 inline float GetFloatZ() const
3235bc4cf78e NPCDialogue
Ritor1
parents: 144
diff changeset
97 {
194
650d96af8855 Vis overhaul; sprites can be picked by mouse
Nomad
parents: 186
diff changeset
98 return (float)object_pid / 65535.0f + (float)actual_z;
159
3235bc4cf78e NPCDialogue
Ritor1
parents: 144
diff changeset
99 }
0
Ritor1
parents:
diff changeset
100 };
Ritor1
parents:
diff changeset
101 #pragma pack(pop)
Ritor1
parents:
diff changeset
102
Ritor1
parents:
diff changeset
103
Ritor1
parents:
diff changeset
104 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
105 struct RenderD3D__DevInfo
Ritor1
parents:
diff changeset
106 {
Ritor1
parents:
diff changeset
107 unsigned int bIsDeviceCompatible;
Ritor1
parents:
diff changeset
108 char *pName;
Ritor1
parents:
diff changeset
109 char *pDescription;
Ritor1
parents:
diff changeset
110 GUID *pGUID;
Ritor1
parents:
diff changeset
111 unsigned int uCaps;
Ritor1
parents:
diff changeset
112 char *pDriverName;
Ritor1
parents:
diff changeset
113 char *pDeviceDesc;
Ritor1
parents:
diff changeset
114 char *pDDraw4DevDesc;
Ritor1
parents:
diff changeset
115 GUID *pDirectDrawGUID;
Ritor1
parents:
diff changeset
116 int uVideoMem;
Ritor1
parents:
diff changeset
117 };
Ritor1
parents:
diff changeset
118 #pragma pack(pop)
Ritor1
parents:
diff changeset
119
Ritor1
parents:
diff changeset
120
Ritor1
parents:
diff changeset
121
Ritor1
parents:
diff changeset
122 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
123 struct RenderD3D_D3DDevDesc
Ritor1
parents:
diff changeset
124 {
Ritor1
parents:
diff changeset
125 int field_0;
Ritor1
parents:
diff changeset
126 int field_4;
Ritor1
parents:
diff changeset
127 int field_8;
Ritor1
parents:
diff changeset
128 int field_C;
Ritor1
parents:
diff changeset
129 int field_10;
Ritor1
parents:
diff changeset
130 char *pDriverName;
Ritor1
parents:
diff changeset
131 char *pDeviceDesc;
Ritor1
parents:
diff changeset
132 char *pDDraw4DevDesc;
Ritor1
parents:
diff changeset
133 GUID *pGUID;
Ritor1
parents:
diff changeset
134 unsigned int uVideoMem;
Ritor1
parents:
diff changeset
135 };
Ritor1
parents:
diff changeset
136 #pragma pack(pop)
Ritor1
parents:
diff changeset
137
Ritor1
parents:
diff changeset
138
Ritor1
parents:
diff changeset
139
Ritor1
parents:
diff changeset
140
Ritor1
parents:
diff changeset
141
Ritor1
parents:
diff changeset
142
Ritor1
parents:
diff changeset
143
Ritor1
parents:
diff changeset
144
Ritor1
parents:
diff changeset
145
Ritor1
parents:
diff changeset
146 /* 280 */
Ritor1
parents:
diff changeset
147 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
148 struct HWLTexture
Ritor1
parents:
diff changeset
149 {
Ritor1
parents:
diff changeset
150 inline HWLTexture():
Ritor1
parents:
diff changeset
151 field_0(0), field_4(0), field_8(0),
Ritor1
parents:
diff changeset
152 field_C(0), field_10(0), field_14(0)
Ritor1
parents:
diff changeset
153 {}
Ritor1
parents:
diff changeset
154
Ritor1
parents:
diff changeset
155 int field_0;
Ritor1
parents:
diff changeset
156 int field_4;
Ritor1
parents:
diff changeset
157 int field_8;
Ritor1
parents:
diff changeset
158 int field_C;
Ritor1
parents:
diff changeset
159 int field_10;
Ritor1
parents:
diff changeset
160 int field_14;
670
9824e2eeee30 fixed decorations animation
Gloval
parents: 657
diff changeset
161 int uBufferWidth;
9824e2eeee30 fixed decorations animation
Gloval
parents: 657
diff changeset
162 int uBufferHeight;
9824e2eeee30 fixed decorations animation
Gloval
parents: 657
diff changeset
163 int uAreaWidth;
9824e2eeee30 fixed decorations animation
Gloval
parents: 657
diff changeset
164 int uAreaHeigth;
0
Ritor1
parents:
diff changeset
165 unsigned int uWidth;
Ritor1
parents:
diff changeset
166 unsigned int uHeight;
670
9824e2eeee30 fixed decorations animation
Gloval
parents: 657
diff changeset
167 int uAreaX;
9824e2eeee30 fixed decorations animation
Gloval
parents: 657
diff changeset
168 int uAreaY;
0
Ritor1
parents:
diff changeset
169 unsigned __int16 *pPixels;
Ritor1
parents:
diff changeset
170 };
Ritor1
parents:
diff changeset
171 #pragma pack(pop)
Ritor1
parents:
diff changeset
172
Ritor1
parents:
diff changeset
173
Ritor1
parents:
diff changeset
174 /* 185 */
Ritor1
parents:
diff changeset
175 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
176 struct RenderHWLContainer
Ritor1
parents:
diff changeset
177 {
Ritor1
parents:
diff changeset
178 RenderHWLContainer();
Ritor1
parents:
diff changeset
179 bool Load(const wchar_t *pFilename);
Ritor1
parents:
diff changeset
180 bool Release();
Ritor1
parents:
diff changeset
181
Ritor1
parents:
diff changeset
182 HWLTexture *LoadTexture(const char *pName, int bMipMaps);
Ritor1
parents:
diff changeset
183
Ritor1
parents:
diff changeset
184 FILE *pFile;
1512
af57b3b76fe4 Clean and decouple. (1)
yoctozepto
parents: 1496
diff changeset
185 uint32_t uSignature;
0
Ritor1
parents:
diff changeset
186 unsigned int uDataOffset;
Ritor1
parents:
diff changeset
187 unsigned int uNumItems;
Ritor1
parents:
diff changeset
188 char *pSpriteNames[50000];
Ritor1
parents:
diff changeset
189 int pSpriteOffsets[50000];
Ritor1
parents:
diff changeset
190 int bDumpDebug;
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1512
diff changeset
191 int scale_hwls_to_half;
0
Ritor1
parents:
diff changeset
192 };
Ritor1
parents:
diff changeset
193 #pragma pack(pop)
Ritor1
parents:
diff changeset
194
Ritor1
parents:
diff changeset
195
Ritor1
parents:
diff changeset
196
Ritor1
parents:
diff changeset
197 /* 242 */
Ritor1
parents:
diff changeset
198 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
199 struct RenderBillboardD3D
Ritor1
parents:
diff changeset
200 {
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
201 inline RenderBillboardD3D():
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
202 opacity(Transparent),
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
203 field_90(-1),
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
204 sParentBillboardID(-1),
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
205 uNumVertices(4)
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
206 {}
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
207
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
208 enum OpacityType: unsigned __int32
0
Ritor1
parents:
diff changeset
209 {
Ritor1
parents:
diff changeset
210 Transparent = 0,
Ritor1
parents:
diff changeset
211 Opaque_1 = 1,
Ritor1
parents:
diff changeset
212 Opaque_2 = 2,
Ritor1
parents:
diff changeset
213 Opaque_3 = 3,
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
214 NoBlend = 0xFFFFFFFF
0
Ritor1
parents:
diff changeset
215 };
Ritor1
parents:
diff changeset
216
Ritor1
parents:
diff changeset
217 IDirect3DTexture2 *pTexture;
Ritor1
parents:
diff changeset
218 unsigned int uNumVertices;
1390
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1269
diff changeset
219 RenderVertexD3D3 pQuads[4];
144
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
220 float z_order;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
221 OpacityType opacity;
0
Ritor1
parents:
diff changeset
222 int field_90;
Ritor1
parents:
diff changeset
223 int sZValue;
2002
2e6c63bdcfa9 RenderBillboardD3D initialization
zipi
parents: 1923
diff changeset
224 signed int sParentBillboardID;
0
Ritor1
parents:
diff changeset
225 };
Ritor1
parents:
diff changeset
226 #pragma pack(pop)
Ritor1
parents:
diff changeset
227
Ritor1
parents:
diff changeset
228
Ritor1
parents:
diff changeset
229
Ritor1
parents:
diff changeset
230
Ritor1
parents:
diff changeset
231 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
232 struct RenderD3D_aux
Ritor1
parents:
diff changeset
233 {
Ritor1
parents:
diff changeset
234 RenderD3D__DevInfo *pInfo;
Ritor1
parents:
diff changeset
235 RenderD3D_D3DDevDesc *ptr_4;
Ritor1
parents:
diff changeset
236 };
Ritor1
parents:
diff changeset
237 #pragma pack(pop)
Ritor1
parents:
diff changeset
238
Ritor1
parents:
diff changeset
239
Ritor1
parents:
diff changeset
240
Ritor1
parents:
diff changeset
241 /* 183 */
Ritor1
parents:
diff changeset
242 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
243 struct RenderD3D
Ritor1
parents:
diff changeset
244 {
Ritor1
parents:
diff changeset
245 RenderD3D();
Ritor1
parents:
diff changeset
246
Ritor1
parents:
diff changeset
247 void GetAvailableDevices(RenderD3D__DevInfo **pOutDevices);
Ritor1
parents:
diff changeset
248 void Release();
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
249 bool CreateDevice(unsigned int uDeviceID, int bWindowed, struct OSWindow *window);
0
Ritor1
parents:
diff changeset
250 unsigned int GetDeviceCaps();
Ritor1
parents:
diff changeset
251 void ClearTarget(unsigned int bClearColor, unsigned int uClearColor, unsigned int bClearDepth, float z_clear);
Ritor1
parents:
diff changeset
252 void Present(bool bForceBlit);
Ritor1
parents:
diff changeset
253 bool CreateTexture(unsigned int uTextureWidth, unsigned int uTextureHeight, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture, bool bAlphaChannel, bool bMipmaps, unsigned int uMinDeviceTexDim);
Ritor1
parents:
diff changeset
254 void HandleLostResources();
Ritor1
parents:
diff changeset
255
Ritor1
parents:
diff changeset
256
Ritor1
parents:
diff changeset
257 unsigned int bWindowed;
Ritor1
parents:
diff changeset
258 int field_4;
Ritor1
parents:
diff changeset
259 int field_8;
Ritor1
parents:
diff changeset
260 HWND hWindow;
Ritor1
parents:
diff changeset
261 int field_10;
Ritor1
parents:
diff changeset
262 int field_14;
Ritor1
parents:
diff changeset
263 int field_18;
Ritor1
parents:
diff changeset
264 RenderD3D__DevInfo *pAvailableDevices;
Ritor1
parents:
diff changeset
265 IDirectDraw4 *pHost;
Ritor1
parents:
diff changeset
266 IDirect3D3 *pDirect3D;
Ritor1
parents:
diff changeset
267 IUnknown *pUnk;
Ritor1
parents:
diff changeset
268 IDirectDrawSurface4 *pBackBuffer;
Ritor1
parents:
diff changeset
269 IDirectDrawSurface4 *pFrontBuffer;
Ritor1
parents:
diff changeset
270 IDirectDrawSurface4 *pZBuffer;
Ritor1
parents:
diff changeset
271 IDirect3DDevice3 *pDevice;
Ritor1
parents:
diff changeset
272 IDirect3DViewport3 *pViewport;
Ritor1
parents:
diff changeset
273 int field_40;
Ritor1
parents:
diff changeset
274 int field_44;
Ritor1
parents:
diff changeset
275 char pErrorMessage[48];
Ritor1
parents:
diff changeset
276 char field_78[208];
Ritor1
parents:
diff changeset
277 };
Ritor1
parents:
diff changeset
278 #pragma pack(pop)
1207
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1206
diff changeset
279 extern struct RenderVertexD3D3 pVertices[50];
0
Ritor1
parents:
diff changeset
280
Ritor1
parents:
diff changeset
281 /* 182 */
Ritor1
parents:
diff changeset
282 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
283 struct Render
Ritor1
parents:
diff changeset
284 {
Ritor1
parents:
diff changeset
285 Render();
Ritor1
parents:
diff changeset
286 ~Render();
Ritor1
parents:
diff changeset
287
Ritor1
parents:
diff changeset
288 static Render *Create() {return new Render;}
Ritor1
parents:
diff changeset
289
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
290 bool Initialize(OSWindow *window, bool bColoredLights, uint32_t uDetailLevel, bool bTinting);
0
Ritor1
parents:
diff changeset
291
Ritor1
parents:
diff changeset
292
Ritor1
parents:
diff changeset
293 void ClearBlack();
Ritor1
parents:
diff changeset
294 void PresentBlackScreen();
Ritor1
parents:
diff changeset
295 void SavePCXScreenshot();
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
296 void SaveWinnersCertificate(const char *a1);
0
Ritor1
parents:
diff changeset
297 void ClearTarget(unsigned int uColor);
Ritor1
parents:
diff changeset
298 void Present();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
299 void _49FD3A_fullscreen();
0
Ritor1
parents:
diff changeset
300 void CreateZBuffer();
Ritor1
parents:
diff changeset
301 void Release();
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1675
diff changeset
302 bool InitializeFullscreen();
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1675
diff changeset
303 bool SwitchToWindow();
2102
0db53678ff48 RasterLine2D, DIALOGUE_EVT_A etc.
Ritor1
parents: 2101
diff changeset
304 void RasterLine2D(signed int uX, signed int uY, signed int uZ, signed int uW, unsigned __int16 uColor);
0
Ritor1
parents:
diff changeset
305 void ClearZBuffer(int a2, int a3);
709
af08fc9e29c8 Items (blue dots) on minimap fixed
Nomad
parents: 688
diff changeset
306 void SetRasterClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW);
0
Ritor1
parents:
diff changeset
307 bool LockSurface_DDraw4(IDirectDrawSurface4 *pSurface, DDSURFACEDESC2 *pDesc, unsigned int uLockFlags);
Ritor1
parents:
diff changeset
308 void GetTargetPixelFormat(DDPIXELFORMAT *pOut);
Ritor1
parents:
diff changeset
309 void LockRenderSurface(void **pOutSurfacePtr, unsigned int *pOutPixelsPerRow);
Ritor1
parents:
diff changeset
310 void UnlockBackBuffer();
Ritor1
parents:
diff changeset
311 void LockFrontBuffer(void **pOutSurface, unsigned int *pOutPixelsPerRow);
Ritor1
parents:
diff changeset
312 void UnlockFrontBuffer();
Ritor1
parents:
diff changeset
313 void RestoreFrontBuffer();
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2128
diff changeset
314 void RestoreBackBuffer();
0
Ritor1
parents:
diff changeset
315 void BltToFront(RECT *pDstRect, IDirectDrawSurface *pSrcSurface, RECT *pSrcRect, unsigned int uBltFlags);
Ritor1
parents:
diff changeset
316 void BltBackToFontFast(int a2, int a3, RECT *a4);
Ritor1
parents:
diff changeset
317 void BeginSceneD3D();
Ritor1
parents:
diff changeset
318 void DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
349
672b83584b0f GetActorTintColor
Nomad
parents: 315
diff changeset
319 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
320 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
321 void DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders);
1923
f92e0bab7c78 rename DrawIndoorPolygonSky
Ritor1
parents: 1922
diff changeset
322 void DrawOutdoorSkyPolygon(unsigned int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture);
f92e0bab7c78 rename DrawIndoorPolygonSky
Ritor1
parents: 1922
diff changeset
323 void DrawIndoorSkyPolygon(signed int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture);
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1207
diff changeset
324 void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8);
1923
f92e0bab7c78 rename DrawIndoorPolygonSky
Ritor1
parents: 1922
diff changeset
325 void DrawIndoorSky(unsigned int uNumVertices, unsigned int uFaceID);
0
Ritor1
parents:
diff changeset
326 void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
Ritor1
parents:
diff changeset
327 void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
717
Ritor1
parents: 688
diff changeset
328 void DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *pSprite, int dimming_level);
0
Ritor1
parents:
diff changeset
329 void DrawProjectile(float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, IDirect3DTexture2 *a9);
1390
613c77e51e38 Messed with spell effects drawing a bit.
Nomad
parents: 1269
diff changeset
330 void _4A4CC9_AddSomeBillboard(struct stru6_stru1_indoor_sw_billboard *a1, int diffuse);
0
Ritor1
parents:
diff changeset
331 bool LoadTexture(const char *pName, unsigned int bMipMaps, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture);
670
9824e2eeee30 fixed decorations animation
Gloval
parents: 657
diff changeset
332 bool MoveSpriteToDevice(Sprite *pSprite);
0
Ritor1
parents:
diff changeset
333 void BeginScene();
Ritor1
parents:
diff changeset
334 void EndScene();
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
335 void ScreenFade(unsigned int color, float t);
727
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 710
diff changeset
336 void SetTextureClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW);
da130dd3092a Big time Travel ouverhaul
Nomad
parents: 710
diff changeset
337 void ResetTextureClipRect();
0
Ritor1
parents:
diff changeset
338 void DrawTextureRGB(unsigned int uOutX, unsigned int uOutY, RGBTexture *a4);
1675
f1cdf8c062d4 MainMenuUI_Credits_Loop() and CreditsTextureScroll
Ritor1
parents: 1655
diff changeset
339 void CreditsTextureScroll(unsigned int pX, unsigned int pY, int move_X, int move_Y, RGBTexture *pTexture);
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1207
diff changeset
340 void DrawTextureIndexed(unsigned int uX, unsigned int uY, struct Texture *a4);
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1207
diff changeset
341 void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5);
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1207
diff changeset
342 void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal);
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1207
diff changeset
343 void DrawTextureTransparent(unsigned int uX, unsigned int uY, struct Texture *pTexture);
1455
bfe342ae0c1f DrawPaperdoll cleaning
Ritor1
parents: 1427
diff changeset
344 void DrawAura(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8);
1262
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1207
diff changeset
345 void _4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8);
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1207
diff changeset
346 void DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4);
0aeac0b9ca30 included header cleanup
Grumpy7
parents: 1207
diff changeset
347 void DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
348 void DrawMasked(signed int a2, signed int a3, struct Texture *pTexture, unsigned __int16 mask);
1496
ab6bf38b2940 UIGame.cpp cleaning(continue)
Ritor1
parents: 1458
diff changeset
349 void GetLeather(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height);
1268
2929c4406d2c guiwindow funcs cleanup
Gloval
parents: 1262
diff changeset
350 void DrawTextPalette(int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8);
0
Ritor1
parents:
diff changeset
351 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
352 void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16);
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
353 void _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, void *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7);
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
354 void DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture *a4);
1787
0c4d3c6a9d5a DrawBuildingsD3D cleared
Ritor1
parents: 1675
diff changeset
355 void DrawBuildingsD3D();
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
356 //struct BSPModel *DrawBuildingsSW();
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
357 //int OnOutdoorRedrawSW();
1923
f92e0bab7c78 rename DrawIndoorPolygonSky
Ritor1
parents: 1922
diff changeset
358 void DrawOutdoorSkyD3D();
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
359 //int DrawSkySW(struct Span *a1, Polygon *a2, int a3);
144
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
360 void PrepareDecorationsRenderList_ODM();
515
cb0ad52d6a26 LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents: 430
diff changeset
361 void DrawSpriteObjects_ODM();
0
Ritor1
parents:
diff changeset
362 void TransformBillboardsAndSetPalettesODM();
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
363 //float DrawBezierTerrain();
86
ec84db4c8f9d 4.01.13
Ritor1
parents: 67
diff changeset
364 void RenderTerrainD3D();
985
062788391c88 BezierTerrain little clean
Ritor1
parents: 973
diff changeset
365 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
366 //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
367 //void ExecOutdoorDrawSW();
0
Ritor1
parents:
diff changeset
368 void ChangeBetweenWinFullscreenModes();
Ritor1
parents:
diff changeset
369 void DrawBillboardList_BLV();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
370 bool AreRenderSurfacesOk();
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
371 bool IsGammaSupported();
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
372 void SaveScreenshot(const char *pFilename, unsigned int width, unsigned int height);
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
373 void PackScreenshot(unsigned int width, unsigned int height, void *out_data, unsigned int data_size, unsigned int *screenshot_size);
2182
e1e4a8a20b5f _46Ð6ÐС_GetActorsInViewport
Ritor1
parents: 2155
diff changeset
374 int _46À6ÀÑ_GetActorsInViewport(int pDepth);
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
375 void BeginLightmaps();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
376 void EndLightmaps();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
377 void BeginLightmaps2();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
378 void EndLightmaps2();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
379 bool DrawLightmap(struct Lightmap *pLightmap, struct Vec3_float_ *pColorMult, float z_bias);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
380
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
381 void BeginDecals();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
382 void EndDecals();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
383 void DrawDecal(struct Decal *pDecal, float z_bias);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
384
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
385 void do_draw_debug_line_d3d(const RenderVertexD3D3 *pLineBegin, signed int sDiffuseBegin, const RenderVertexD3D3 *pLineEnd, signed int sDiffuseEnd, float z_stuff);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
386 void DrawLines(const RenderVertexD3D3 *vertices, unsigned int num_vertices);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
387 void DrawFansTransparent(const RenderVertexD3D3 *vertices, unsigned int num_vertices);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
388 void DrawSpecialEffectsQuad(const RenderVertexD3D3 *vertices, IDirect3DTexture2 *texture);
0
Ritor1
parents:
diff changeset
389
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
390 void am_Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3);
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
391 void am_Blt_Chroma(RECT *pSrcRect, POINT *pTargetPoint, int a3, int blend_mode);
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
392
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
393
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
394 protected: unsigned int uDesiredDirect3DDevice;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
395 protected: int raster_clip_x;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
396 protected: int raster_clip_y; // clipping rect for raster ops
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
397 protected: int raster_clip_z; // like RasterLine2D for (mini)map
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
398 protected: int raster_clip_w;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
399 public: int *pActiveZBuffer;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
400 protected: int *pDefaultZBuffer;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
401 protected: OSWindow *window;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
402 protected: unsigned int bWindowMode;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
403 protected: RenderD3D *pRenderD3D;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
404 public: IDirectDraw4 *pDirectDraw4;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
405 public: IDirectDrawSurface4 *pFrontBuffer4;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
406 public: IDirectDrawSurface4 *pBackBuffer4;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
407 protected: DDPIXELFORMAT ddpfPrimarySuface;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
408 protected: unsigned int uTargetRBits;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
409 protected: unsigned int uTargetGBits;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
410 protected: unsigned int uTargetBBits;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
411 protected: unsigned int uTargetRMask;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
412 protected: unsigned int uTargetGMask;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
413 protected: unsigned int uTargetBMask;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
414 protected: unsigned int uNumSceneBegins;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
415 protected: unsigned __int32 *pTargetSurface_unaligned;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
416 public: void *pTargetSurface;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
417 public: unsigned int uTargetSurfacePitch;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
418 protected: unsigned int uClipY;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
419 protected: unsigned int uClipX;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
420 protected: unsigned int uClipW;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
421 protected: unsigned int uClipZ;
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
422 protected: unsigned int bClip;
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
423 protected: unsigned int uNumD3DSceneBegins;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
424 protected: int using_software_screen_buffer;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
425 protected: RenderHWLContainer pD3DBitmaps;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
426 protected: RenderHWLContainer pD3DSprites;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
427 public: unsigned int bUseColoredLights;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
428 protected: unsigned int bRequiredTextureStagesAvailable;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
429 public: unsigned int bTinting;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
430 protected: unsigned int uLevelOfDetail;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
431 protected: unsigned int uMaxDeviceTextureDim;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
432 protected: unsigned int uMinDeviceTextureDim;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
433 public: unsigned int bUsingSpecular;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
434 public: uint32_t uFogColor;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
435 public: unsigned int pHDWaterBitmapIDs[7];
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
436 public: int hd_water_current_frame;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
437 public: int hd_water_tile_id;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
438 public: void (*pBeforePresentFunction)();
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
439 public: uint32_t bFogEnabled;
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
440 public: RenderBillboardD3D pBillboardRenderListD3D[1000];
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
441 public: unsigned int uNumBillboardsToDraw;
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
442
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
443
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
444 protected:
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
445 void DoRenderBillboards_D3D();
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
446 void SetBillboardBlendOptions(RenderBillboardD3D::OpacityType a1);
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
447 void DrawBorderTiles(struct Polygon *poly);
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
448 unsigned short *MakeScreenshot(signed int width, signed int height);
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
449 bool CheckTextureStages();
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
450 void ParseTargetPixelFormat();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
451 void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
452 void CreateDirectDraw();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
453 void SetDirectDrawCooperationMode(HWND hWnd, bool bFullscreen);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
454 void SetDirectDrawDisplayMode(unsigned int uWidth, unsigned int uHeight, unsigned int uBPP);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
455 void CreateFrontBuffer();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
456 void CreateBackBuffer();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
457 void CreateDirectDrawPrimarySurface();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
458 void CreateClipper(HWND a2);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
459 void PackPCXpicture(unsigned short* picture_data, int wight, int heidth, void *data_buff, int max_buff_size,unsigned int* packed_size);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
460 void SavePCXImage(const char *Filename, unsigned short* picture_data, int width, int height);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
461 unsigned int Billboard_ProbablyAddToListAndSortByZOrder(float z);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
462 unsigned int GetParentBillboardID(unsigned int uBillboardID);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
463 unsigned int GetBillboardDrawListSize();
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
464
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
465 public:
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
466 inline void WritePixel16(int x, int y, unsigned __int16 color)
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
467 {
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
468 if (ddpfPrimarySuface.dwRGBBitCount == 32)
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
469 {
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
470 auto p = (unsigned __int32 *)pTargetSurface + x + y * uTargetSurfacePitch;
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
471 *p = Color32(color);
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
472 }
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
473 else if (ddpfPrimarySuface.dwRGBBitCount == 16)
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
474 {
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
475 auto p = (unsigned __int16 *)pTargetSurface + x + y * uTargetSurfacePitch;
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
476 *p = color;
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
477 }
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
478 else __debugbreak();
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
479 }
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
480
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
481 inline unsigned __int16 ReadPixel16(int x, int y)
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
482 {
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
483 if (ddpfPrimarySuface.dwRGBBitCount == 32)
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
484 {
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
485 auto p = (unsigned __int32 *)pTargetSurface + x + y * uTargetSurfacePitch;
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
486 return Color16((*p >> 16) & 255, (*p >> 8) & 255, *p & 255);
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
487 }
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
488 else if (ddpfPrimarySuface.dwRGBBitCount == 16)
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
489 {
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
490 auto p = (unsigned __int16 *)pTargetSurface + x + y * uTargetSurfacePitch;
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
491 return *p;
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
492 }
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
493 else __debugbreak();
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
494 }
1655
a7eebb6ee7a2 Window Resize (change arguments to MM7_Initialize)
Nomad
parents: 1583
diff changeset
495
a7eebb6ee7a2 Window Resize (change arguments to MM7_Initialize)
Nomad
parents: 1583
diff changeset
496
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
497 inline void ToggleTint() {bTinting = !bTinting;}
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
498 inline void ToggleColoredLights() {bUseColoredLights = !bUseColoredLights;}
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
499
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
500 inline unsigned int GetRenderWidth() {return window->GetWidth();}
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
501 inline unsigned int GetRenderHeight() {return window->GetHeight();}
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
502
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
503 inline void Sub01()
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
504 {
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
505 if (pRenderD3D && !bWindowMode)
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
506 _49FD3A_fullscreen();
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
507 }
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
508
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
509 friend void Present_NoColorKey();
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
510
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1675
diff changeset
511 //int windowed_mode_width;
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1675
diff changeset
512 //int windowed_mode_height;
0
Ritor1
parents:
diff changeset
513 };
Ritor1
parents:
diff changeset
514 #pragma pack(pop)
Ritor1
parents:
diff changeset
515
Ritor1
parents:
diff changeset
516 extern struct IDirectDrawClipper *pDDrawClipper;
Ritor1
parents:
diff changeset
517 extern struct Render *pRenderer; // idb
67
3b4f8bd48e3b 25.01.13 (I did sky)
Ritor1
parents: 0
diff changeset
518 extern struct pUnkTerrain *Unks;
0
Ritor1
parents:
diff changeset
519
Ritor1
parents:
diff changeset
520
Ritor1
parents:
diff changeset
521
Ritor1
parents:
diff changeset
522 /* 248 */
Ritor1
parents:
diff changeset
523 #pragma pack(push, 1)
Ritor1
parents:
diff changeset
524 struct RenderBillboardTransform_local0
Ritor1
parents:
diff changeset
525 {
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
526 void *pTarget;
0
Ritor1
parents:
diff changeset
527 int *pTargetZ;
Ritor1
parents:
diff changeset
528 int uScreenSpaceX;
Ritor1
parents:
diff changeset
529 int uScreenSpaceY;
144
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
530 int _screenspace_x_scaler_packedfloat;
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
531 int _screenspace_y_scaler_packedfloat;
0
Ritor1
parents:
diff changeset
532 char field_18[8];
Ritor1
parents:
diff changeset
533 unsigned __int16 *pPalette;
Ritor1
parents:
diff changeset
534 unsigned __int16 *pPalette2;
144
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
535 union
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
536 {
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
537 int sZValue;
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
538 struct
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
539 {
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
540 unsigned short object_pid;
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
541 short zbuffer_depth;
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
542 };
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
543 };
8ab4484c22e0 Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents: 142
diff changeset
544 unsigned int uFlags; // & 4 - mirror horizontally
0
Ritor1
parents:
diff changeset
545 unsigned int uTargetPitch;
Ritor1
parents:
diff changeset
546 unsigned int uViewportX;
Ritor1
parents:
diff changeset
547 unsigned int uViewportY;
Ritor1
parents:
diff changeset
548 unsigned int uViewportZ;
Ritor1
parents:
diff changeset
549 unsigned int uViewportW;
Ritor1
parents:
diff changeset
550 int field_44;
2002
2e6c63bdcfa9 RenderBillboardD3D initialization
zipi
parents: 1923
diff changeset
551 int sParentBillboardID;
2006
30c2b575d25c signed fixes
zipi
parents: 2002
diff changeset
552 int sTintColor;
0
Ritor1
parents:
diff changeset
553 };
Ritor1
parents:
diff changeset
554 #pragma pack(pop)
Ritor1
parents:
diff changeset
555
Ritor1
parents:
diff changeset
556
Ritor1
parents:
diff changeset
557
Ritor1
parents:
diff changeset
558
Ritor1
parents:
diff changeset
559 extern int uNumDecorationsDrawnThisFrame; // weak
1207
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1206
diff changeset
560 extern RenderBillboard pBillboardRenderList[500];
0
Ritor1
parents:
diff changeset
561 extern unsigned int uNumBillboardsToDraw;
Ritor1
parents:
diff changeset
562 extern int uNumSpritesDrawnThisFrame; // weak
Ritor1
parents:
diff changeset
563
Ritor1
parents:
diff changeset
564
Ritor1
parents:
diff changeset
565
Ritor1
parents:
diff changeset
566
1207
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1206
diff changeset
567 extern RenderVertexSoft array_507D30[50];
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1206
diff changeset
568 extern RenderVertexSoft array_50AC10[50];
96a81634669e arrays to std::arrays phase 3 - finishing global arrays
Grumpy7
parents: 1206
diff changeset
569 extern RenderVertexSoft array_73D150[20];
0
Ritor1
parents:
diff changeset
570
1413
3881d2f94eb1 UseNPCSkill
Nomad
parents: 1391
diff changeset
571 extern RenderVertexD3D3 d3d_vertex_buffer[50];