annotate Render.h @ 2480:24fd08aef81e

Слияние
author Ritor1
date Fri, 22 Aug 2014 11:07:07 +0600
parents acac52e9e36a
children
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>
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
5 #include <array>
0
Ritor1
parents:
diff changeset
6
Ritor1
parents:
diff changeset
7 #include "lib\legacy_dx\d3d.h"
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1675
diff changeset
8 #include "OSWindow.h"
2410
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents: 2404
diff changeset
9 #include "RenderStruct.h"
0
Ritor1
parents:
diff changeset
10
Ritor1
parents:
diff changeset
11 #include "VectorTypes.h"
Ritor1
parents:
diff changeset
12
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
13 #include "IRender.h"
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
14
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
15 #pragma pack(push, 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
16 struct DDM_DLV_Header
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
17 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
18 //----- (00462607) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
19 inline DDM_DLV_Header()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
20 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
21 this->uLastRepawnDay = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
22 this->uNumRespawns = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
23 this->uReputation = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
24 this->field_C_alert = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
25 this->uNumFacesInBModels = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
26 this->uNumDecorations = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
27 this->uNumBModels = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
28 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
29
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
30
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
31 int uNumRespawns;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
32 int uLastRepawnDay;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
33 int uReputation;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
34 int field_C_alert;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
35 unsigned int uNumFacesInBModels;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
36 unsigned int uNumDecorations;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
37 unsigned int uNumBModels;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
38 int field_1C;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
39 int field_20;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
40 int field_24;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
41 };
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
42 #pragma pack(pop)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
43
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
44
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
45 struct ODMFace;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
46
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
47
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
48 /* 141 */
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
49 // stru148
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
50 #pragma pack(push, 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
51 struct Polygon
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
52 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
53 inline Polygon()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
54 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
55 uNumVertices = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
56 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
57
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
58 int _479295();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
59 //void _48276F_sr();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
60 void _normalize_v_18();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
61 void Create_48607B(struct stru149 *a2);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
62
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
63 float field_0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
64 float field_4;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
65 float field_8;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
66 float field_C;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
67 float field_10;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
68 unsigned int uNumVertices;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
69 Vec3_int_ v_18;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
70 int field_24;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
71 int sTextureDeltaU;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
72 int sTextureDeltaV;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
73 __int16 flags;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
74 __int16 field_32;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
75 int field_34;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
76 struct stru149 *ptr_38;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
77 struct Texture *pTexture;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
78 struct Span *_unused_prolly_head;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
79 struct Span *_unused_prolly_tail;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
80 int **ptr_48;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
81 unsigned __int16 uTileBitmapID;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
82 __int16 field_4E;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
83 __int16 field_50;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
84 __int16 field_52;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
85 ODMFace *pODMFace;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
86 char dimming_level;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
87 char field_59;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
88 char field_5A;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
89 char field_5B;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
90 char terrain_grid_z;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
91 char terrain_grid_x;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
92 unsigned __int8 uBModelID;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
93 unsigned __int8 uBModelFaceID;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
94 struct Edge *pEdgeList1[20];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
95 unsigned int uEdgeList1Size;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
96 struct Edge *pEdgeList2[20];
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
97 unsigned int uEdgeList2Size;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
98 char field_108;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
99 char field_109;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
100 char field_10A;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
101 char field_10B;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
102 };
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
103 #pragma pack(pop)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
104 extern std::array<struct Polygon, 2000 + 18000> array_77EC08;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
105
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
106
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
107 /* 142 */
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
108 #pragma pack(push, 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
109 struct stru149
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
110 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
111 void _48616B_frustum_odm(int a2, int a3, int a4, int a5, int a6, int a7);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
112 void _48653D_frustum_blv(int a2, int a3, int a4, int a5, int a6, int a7);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
113 void _48694B_frustum_sky();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
114
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
115 int field_0_party_dir_x;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
116 int field_4_party_dir_y;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
117 int field_8_party_dir_z;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
118 int angle_from_north;//field_C
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
119 int angle_from_west;//field_10
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
120 int viewing_angle_from_west_east;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
121 int angle_from_east;//field_18
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
122 int angle_from_south;//field_1C
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
123 int viewing_angle_from_north_south;//field_20
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
124 int field_24;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
125 int field_28;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
126 };
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
127 #pragma pack(pop)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
128 extern stru149 stru_8019C8;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
129
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
130 /* 88 */
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
131 #pragma pack(push, 1)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
132 struct ODMRenderParams
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
133 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
134 //----- (00462684) --------------------------------------------------------
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
135 ODMRenderParams()
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
136 {
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
137 uPickDepth = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
138 this->shading_dist_shade = 2048;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
139 shading_dist_shademist = 4096;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
140 shading_dist_mist = 8192;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
141 int_fov_rad = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
142 this->bNoSky = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
143 this->bDoNotRenderDecorations = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
144 this->field_5C = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
145 this->field_60 = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
146 this->outdoor_no_wavy_water = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
147 this->outdoor_no_mist = 0;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
148 }
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
149
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
150 void Initialize();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
151
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
152 int uPickDepth;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
153 int shading_dist_shade;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
154 int shading_dist_shademist;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
155 int shading_dist_mist;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
156 unsigned int uCameraFovInDegrees;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
157 int int_fov_rad; // 157 struct IndoorCamera::fov_rad
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
158 int int_fov_rad_inv; // 157 struct IndoorCamera::fov_rad_inv
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
159 int _unused_camera_rotation_y_int_sine; // merged with BLVRenderParams equivalents
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
160 int _unused_camera_rotation_y_int_cosine; // into IndoorCameraD3D
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
161 int _unused_camera_rotation_x_int_sine; // --//--
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
162 int _unused_camera_rotation_x_int_cosine; // --//--
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
163 int uNumPolygons;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
164 unsigned int _unused_uNumEdges;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
165 unsigned int _unused_uNumSurfs;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
166 unsigned int _unused_uNumSpans;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
167 unsigned int uNumBillboards;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
168 float field_40;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
169 int field_44;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
170 int outdoor_grid_band_3;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
171 int field_4C;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
172 int field_50;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
173 unsigned int bNoSky;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
174 unsigned int bDoNotRenderDecorations;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
175 int field_5C;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
176 int field_60;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
177 int outdoor_no_wavy_water;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
178 int outdoor_no_mist;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
179 int building_gamme;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
180 int terrain_gamma;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
181
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
182 unsigned int uMapGridCellX; // moved from 157 struct IndoorCamera::0C
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
183 unsigned int uMapGridCellZ; // moved from 157 struct IndoorCamera::10
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
184 };
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
185 #pragma pack(pop)
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
186 extern ODMRenderParams *pODMRenderParams;
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
187
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
188
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
189
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
190 struct Render: public IRender
0
Ritor1
parents:
diff changeset
191 {
Ritor1
parents:
diff changeset
192 Render();
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
193 virtual ~Render();
0
Ritor1
parents:
diff changeset
194
Ritor1
parents:
diff changeset
195 static Render *Create() {return new Render;}
Ritor1
parents:
diff changeset
196
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
197 virtual bool Initialize(OSWindow *window);
0
Ritor1
parents:
diff changeset
198
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
199 virtual void ClearBlack();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
200 virtual void PresentBlackScreen();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
201
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
202 virtual void SaveWinnersCertificate(const char *a1);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
203 virtual void ClearTarget(unsigned int uColor);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
204 virtual void Present();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
205
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
206 virtual void _49FD3A_fullscreen();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
207 virtual bool InitializeFullscreen();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
208
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
209 virtual void CreateZBuffer();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
210 virtual void Release();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
211
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
212 virtual bool SwitchToWindow();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
213 virtual void RasterLine2D(signed int uX, signed int uY, signed int uZ, signed int uW, unsigned __int16 uColor);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
214 virtual void ClearZBuffer(int a2, int a3);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
215 virtual void SetRasterClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
216 virtual bool LockSurface_DDraw4(IDirectDrawSurface4 *pSurface, DDSURFACEDESC2 *pDesc, unsigned int uLockFlags);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
217 virtual void GetTargetPixelFormat(DDPIXELFORMAT *pOut);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
218 virtual void LockRenderSurface(void **pOutSurfacePtr, unsigned int *pOutPixelsPerRow);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
219 virtual void UnlockBackBuffer();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
220 virtual void LockFrontBuffer(void **pOutSurface, unsigned int *pOutPixelsPerRow);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
221 virtual void UnlockFrontBuffer();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
222 virtual void RestoreFrontBuffer();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
223 virtual void RestoreBackBuffer();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
224 virtual void BltToFront(RECT *pDstRect, IDirectDrawSurface *pSrcSurface, RECT *pSrcRect, unsigned int uBltFlags);
2475
acac52e9e36a remove DirectX11.cpp/.h for VS2010, MatrixMultiply and other
Ritor1
parents: 2464
diff changeset
225 virtual void BltBackToFontFast(int a2, int a3, RECT *pSrcRect);
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
226 virtual void BeginSceneD3D();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
227
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
228 virtual unsigned int GetActorTintColor(float a2, int tint, int a4, int a5, RenderBillboard *a6);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
229
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
230 virtual void DrawPolygon(unsigned int uNumVertices, struct Polygon *a3, ODMFace *a4, IDirect3DTexture2 *pTexture);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
231 virtual void DrawTerrainPolygon(unsigned int uNumVertices, struct Polygon *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
232 virtual void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
233
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
234 virtual void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
235 virtual void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
236
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
237 virtual void DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
238 virtual void DrawBillboard_Indoor(RenderBillboardTransform_local0 *pSoftBillboard, Sprite *pSprite, int dimming_level);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
239 virtual void _4A4CC9_AddSomeBillboard(struct stru6_stru1_indoor_sw_billboard *a1, int diffuse);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
240 virtual void TransformBillboardsAndSetPalettesODM();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
241 virtual void DrawBillboardList_BLV();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
242
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
243 virtual void DrawProjectile(float srcX, float srcY, float a3, float a4, float dstX, float dstY, float a7, float a8, IDirect3DTexture2 *a9);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
244 virtual bool LoadTexture(const char *pName, unsigned int bMipMaps, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
245 virtual bool MoveSpriteToDevice(Sprite *pSprite);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
246
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
247 virtual void BeginScene();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
248 virtual void EndScene();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
249 virtual void ScreenFade(unsigned int color, float t);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
250
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
251 virtual void SetTextureClipRect(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
252 virtual void ResetTextureClipRect();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
253 virtual void DrawTextureRGB(unsigned int uOutX, unsigned int uOutY, RGBTexture *a4);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
254 virtual void CreditsTextureScroll(unsigned int pX, unsigned int pY, int move_X, int move_Y, RGBTexture *pTexture);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
255 virtual void DrawTextureIndexed(unsigned int uX, unsigned int uY, struct Texture *a4);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
256
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
257 virtual void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
258 virtual void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
259 virtual void DrawTextureTransparent(unsigned int uX, unsigned int uY, struct Texture *pTexture);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
260 virtual void DrawAura(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
261 virtual void _4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
262
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
263 virtual void DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
264 virtual void DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
265 virtual void DrawFansTransparent(const RenderVertexD3D3 *vertices, unsigned int num_vertices);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
266
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
267 virtual void DrawMasked(signed int a2, signed int a3, struct Texture *pTexture, unsigned __int16 mask);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
268 virtual void GetLeather(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
269
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
270 virtual void DrawTextPalette(int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
271 virtual void DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
272
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
273 virtual void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
274 virtual void _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, void *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
275 virtual void DrawTranslucent(unsigned int a2, unsigned int a3, struct Texture *a4);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
276
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
277 virtual void DrawBuildingsD3D();
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
278 //struct BSPModel *DrawBuildingsSW();
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
279 //int OnOutdoorRedrawSW();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
280
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
281 virtual void DrawIndoorSky(unsigned int uNumVertices, unsigned int uFaceID);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
282 virtual void DrawOutdoorSkyD3D();
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
283 //int DrawSkySW(struct Span *a1, Polygon *a2, int a3);
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
284 virtual void DrawOutdoorSkyPolygon(unsigned int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
285 virtual void DrawIndoorSkyPolygon(signed int uNumVertices, struct Polygon *pSkyPolygon, IDirect3DTexture2 *pTexture);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
286
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
287 virtual void PrepareDecorationsRenderList_ODM();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
288 virtual void DrawSpriteObjects_ODM();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
289
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
290 //float DrawBezierTerrain();
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
291 virtual void RenderTerrainD3D();
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
292 //void DrawTerrainSW(int a1, int a2, int a3, int a4);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
293
1391
cc9a3a24d61d Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents: 1390
diff changeset
294 //void ExecOutdoorDrawSW();
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
295 virtual void ChangeBetweenWinFullscreenModes();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
296 virtual bool AreRenderSurfacesOk();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
297 virtual bool IsGammaSupported();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
298
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
299 virtual void SaveScreenshot(const char *pFilename, unsigned int width, unsigned int height);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
300 virtual void PackScreenshot(unsigned int width, unsigned int height, void *out_data, unsigned int data_size, unsigned int *screenshot_size);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
301 virtual void SavePCXScreenshot();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
302
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
303 virtual int _466_GetActorsInViewport(int pDepth);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
304
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
305 virtual void BeginLightmaps();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
306 virtual void EndLightmaps();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
307 virtual void BeginLightmaps2();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
308 virtual void EndLightmaps2();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
309 virtual bool DrawLightmap(struct Lightmap *pLightmap, struct Vec3_float_ *pColorMult, float z_bias);
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
310
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
311 virtual void BeginDecals();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
312 virtual void EndDecals();
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
313 virtual void DrawDecal(struct Decal *pDecal, float z_bias);
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
314
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
315 virtual void do_draw_debug_line_d3d(const RenderVertexD3D3 *pLineBegin, signed int sDiffuseBegin, const RenderVertexD3D3 *pLineEnd, signed int sDiffuseEnd, float z_stuff);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
316 virtual void DrawLines(const RenderVertexD3D3 *vertices, unsigned int num_vertices);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
317
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
318 virtual void DrawSpecialEffectsQuad(const RenderVertexD3D3 *vertices, IDirect3DTexture2 *texture);
0
Ritor1
parents:
diff changeset
319
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
320 virtual void am_Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3);
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
321 virtual void am_Blt_Chroma(RECT *pSrcRect, POINT *pTargetPoint, int a3, int blend_mode);
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
322
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
323 public:/*
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
324 int *pActiveZBuffer;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
325 IDirectDraw4 *pDirectDraw4;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
326 IDirectDrawSurface4 *pFrontBuffer4;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
327 IDirectDrawSurface4 *pBackBuffer4;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
328 void *pTargetSurface;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
329 unsigned int uTargetSurfacePitch;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
330 unsigned int bUseColoredLights;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
331 unsigned int bTinting;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
332 unsigned int bUsingSpecular;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
333 uint32_t uFogColor;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
334 unsigned int pHDWaterBitmapIDs[7];
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
335 int hd_water_current_frame;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
336 int hd_water_tile_id;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
337 void (*pBeforePresentFunction)();
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
338 uint32_t bFogEnabled;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
339 RenderBillboardD3D pBillboardRenderListD3D[1000];
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
340 unsigned int uNumBillboardsToDraw;*/
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
341
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
342 virtual void WritePixel16(int x, int y, unsigned __int16 color)
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
343 {
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
344 if (ddpfPrimarySuface.dwRGBBitCount == 32)
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
345 {
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
346 auto p = (unsigned __int32 *)pTargetSurface + x + y * uTargetSurfacePitch;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
347 *p = Color32(color);
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
348 }
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
349 else if (ddpfPrimarySuface.dwRGBBitCount == 16)
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
350 {
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
351 auto p = (unsigned __int16 *)pTargetSurface + x + y * uTargetSurfacePitch;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
352 *p = color;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
353 }
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
354 else __debugbreak();
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
355 }
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
356
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
357 virtual unsigned __int16 ReadPixel16(int x, int y)
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
358 {
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
359 if (ddpfPrimarySuface.dwRGBBitCount == 32)
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
360 {
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
361 auto p = (unsigned __int32 *)pTargetSurface + x + y * uTargetSurfacePitch;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
362 return Color16((*p >> 16) & 255, (*p >> 8) & 255, *p & 255);
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
363 }
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
364 else if (ddpfPrimarySuface.dwRGBBitCount == 16)
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
365 {
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
366 auto p = (unsigned __int16 *)pTargetSurface + x + y * uTargetSurfacePitch;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
367 return *p;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
368 }
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
369 else __debugbreak();
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
370 }
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
371
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
372 virtual void ToggleTint() {bTinting = !bTinting;}
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
373 virtual void ToggleColoredLights() {bUseColoredLights = !bUseColoredLights;}
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
374
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
375 virtual unsigned int GetRenderWidth() {return window->GetWidth();}
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
376 virtual unsigned int GetRenderHeight() {return window->GetHeight();}
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
377
2462
1d04e48651d4 Render split into interface and realization, added Direct3D 11
a.parshin
parents: 2410
diff changeset
378 virtual void Sub01()
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
379 {
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
380 if (pRenderD3D && !bWindowMode)
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
381 _49FD3A_fullscreen();
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
382 }
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
383
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
384 friend void Present_NoColorKey();
2069
259df09dfb50 32bits almost there
Nomad
parents: 2006
diff changeset
385
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
386 protected:
2402
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
387 unsigned int uDesiredDirect3DDevice;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
388 int raster_clip_x;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
389 int raster_clip_y; // clipping rect for raster ops
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
390 int raster_clip_z; // like RasterLine2D for (mini)map
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
391 int raster_clip_w;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
392 int *pDefaultZBuffer;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
393 OSWindow *window;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
394 unsigned int bWindowMode;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
395 RenderD3D *pRenderD3D;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
396 DDPIXELFORMAT ddpfPrimarySuface;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
397 unsigned int uTargetRBits;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
398 unsigned int uTargetGBits;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
399 unsigned int uTargetBBits;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
400 unsigned int uTargetRMask;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
401 unsigned int uTargetGMask;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
402 unsigned int uTargetBMask;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
403 unsigned int uNumSceneBegins;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
404 unsigned __int32 *pTargetSurface_unaligned;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
405 unsigned int uClipY;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
406 unsigned int uClipX;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
407 unsigned int uClipW;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
408 unsigned int uClipZ;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
409 unsigned int bClip;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
410 unsigned int uNumD3DSceneBegins;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
411 int using_software_screen_buffer;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
412 RenderHWLContainer pD3DBitmaps;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
413 RenderHWLContainer pD3DSprites;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
414 unsigned int bRequiredTextureStagesAvailable;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
415 unsigned int uLevelOfDetail;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
416 unsigned int uMaxDeviceTextureDim;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
417 unsigned int uMinDeviceTextureDim;
8cee51ce4382 included directx 11
Ritor1
parents: 2343
diff changeset
418
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
419 void DoRenderBillboards_D3D();
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
420 void SetBillboardBlendOptions(RenderBillboardD3D::OpacityType a1);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
421 void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard);
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
422 unsigned int Billboard_ProbablyAddToListAndSortByZOrder(float z);
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
423 unsigned int GetParentBillboardID(unsigned int uBillboardID);
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
424 unsigned int GetBillboardDrawListSize();
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
425
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
426 void DrawBorderTiles(struct Polygon *poly);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
427
2154
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
428 unsigned short *MakeScreenshot(signed int width, signed int height);
9bd7522cdbbb Render decoupling.
Nomad
parents: 2153
diff changeset
429 bool CheckTextureStages();
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
430 void ParseTargetPixelFormat();
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
431
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
432 void CreateDirectDraw();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
433 void SetDirectDrawCooperationMode(HWND hWnd, bool bFullscreen);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
434 void SetDirectDrawDisplayMode(unsigned int uWidth, unsigned int uHeight, unsigned int uBPP);
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
435 void CreateFrontBuffer();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
436 void CreateBackBuffer();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
437 void CreateDirectDrawPrimarySurface();
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
438 void CreateClipper(HWND a2);
2404
82512695b45d struct Render
Ritor1
parents: 2402
diff changeset
439
2155
0a1438c16c2b Render decoupling.
Nomad
parents: 2154
diff changeset
440 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
441 void SavePCXImage(const char *Filename, unsigned short* picture_data, int width, int height);
2153
d28d3c006077 Some Render decoupling.
Nomad
parents: 2152
diff changeset
442
1802
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1675
diff changeset
443 //int windowed_mode_width;
633f81bb3ae7 HWND -> class OSWindow
Nomad
parents: 1675
diff changeset
444 //int windowed_mode_height;
0
Ritor1
parents:
diff changeset
445 };
2463
0f17a30149ec cleaning project part 1
zipi
parents: 2462
diff changeset
446
2464
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
447 unsigned int __fastcall _452442_color_cvt(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
448
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
449 int __fastcall GetActorTintColor(int max_dim, int min_dim, float distance, int a4, struct RenderBillboard *a5);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
450 int __fastcall _43F55F_get_billboard_light_level(struct RenderBillboard *a1, int uBaseLightLevel);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
451 int __fastcall _43F5C8_get_point_light_level_with_respect_to_lights(unsigned int uBaseLightLevel, int uSectorID, float x, float y, float z);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
452 unsigned int __fastcall GetMaxMipLevels(unsigned int uDim);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
453 int _46E44E_collide_against_faces_and_portals(unsigned int b1); // idb
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
454 int __fastcall _46E889_collide_against_bmodels(unsigned int ecx0);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
455 int collide_against_floor(int x, int y, int z, unsigned int *pSectorID, unsigned int *pFaceID); // idb
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
456 void __fastcall _46ED8A_collide_against_sprite_objects(unsigned int _this);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
457 int _46EF01_collision_chech_player(int a1); // idb
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
458 void _46E0B2_collide_against_decorations();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
459 int _46F04E_collide_against_portals();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
460 unsigned int __fastcall sub_46DEF2(signed int a2, unsigned int uLayingItemID);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
461 void UpdateObjects();
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
462 bool sub_47531C(int a1, int *a2, int pos_x, int pos_y, int pos_z, int dir_x, int dir_y, int dir_z, struct BLVFace *face, int a10);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
463 bool sub_4754BF(int a1, int *a2, int X, int Y, int Z, int dir_x, int dir_y, int dir_z, struct BLVFace *face, int a10, int a11);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
464 int sub_475665(struct BLVFace *face, int a2, __int16 a3);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
465 bool __fastcall sub_4759C9(struct BLVFace *face, int a2, int a3, __int16 a4);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
466 bool __fastcall sub_475D85(Vec3_int_ *a1, Vec3_int_ *a2, int *a3, struct BLVFace *a4);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
467 bool __fastcall sub_475F30(int *a1, struct BLVFace *a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9);
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
468
104fdbea0386 cleaning project part 2
zipi
parents: 2463
diff changeset
469 bool __fastcall IsBModelVisible(unsigned int uModelID, int *unused);