annotate RenderStruct.h @ 2461:ff7f4995aa25

function MakeScreenshot()
author Ritor1
date Tue, 05 Aug 2014 17:00:35 +0600
parents 2d3c3d1dff0c
children 1d04e48651d4
rev   line source
2410
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
1 #pragma once
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
2
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
3 #include <cstdint>
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
4 #include <cstdio>
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
5
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
6 #include "lib\legacy_dx\d3d.h"
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
7 #include "OSWindow.h"
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
8
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
9 #include "VectorTypes.h"
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
10
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
11
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
12 #define ErrD3D(hr) \
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
13 do \
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
14 { \
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
15 extern void ErrHR(HRESULT, const char *, const char *, const char *, int); \
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
16 ErrHR(hr, "Direct3D", __FUNCTION__, __FILE__, __LINE__); \
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
17 } while(0)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
18
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
19 struct Polygon;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
20 struct Texture;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
21 struct RGBTexture;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
22 struct RenderBillboardTransform_local0;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
23 struct ODMFace;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
24
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
25
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
26 unsigned __int16 Color16(unsigned __int32 r, unsigned __int32 g, unsigned __int32 b);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
27 unsigned __int32 Color32(unsigned __int16 color16);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
28
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
29 /* 119 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
30 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
31 struct RenderVertexSoft
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
32 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
33 inline RenderVertexSoft():
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
34 flt_2C(0.0f)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
35 {}
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
36
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
37 Vec3_float_ vWorldPosition;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
38 Vec3_float_ vWorldViewPosition;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
39 float vWorldViewProjX;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
40 float vWorldViewProjY;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
41 float _rhw;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
42 float u;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
43 float v;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
44 float flt_2C;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
45 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
46 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
47
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
48
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
49
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
50 /* 112 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
51 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
52 struct RenderVertexD3D3
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
53 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
54 Vec3_float_ pos;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
55 float rhw;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
56 signed int diffuse;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
57 unsigned int specular;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
58 Vec2_float_ texcoord;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
59 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
60 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
61
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
62 class Sprite;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
63 class SpriteFrame;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
64
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
65 /* 161 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
66 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
67 struct RenderBillboard
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
68 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
69 int _screenspace_x_scaler_packedfloat;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
70 int _screenspace_y_scaler_packedfloat;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
71 float fov_x;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
72 float fov_y;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
73 union
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
74 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
75 int sZValue;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
76 struct
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
77 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
78 unsigned __int16 object_pid;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
79 signed __int16 actual_z;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
80 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
81 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
82 int field_14_actor_id;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
83 signed __int16 HwSpriteID;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
84 __int16 uPalette;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
85 __int16 uIndoorSectorID;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
86 __int16 field_1E;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
87 __int16 world_x;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
88 __int16 world_y;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
89 __int16 world_z;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
90 __int16 uScreenSpaceX;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
91 __int16 uScreenSpaceY;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
92 unsigned __int16 dimming_level;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
93 signed int sTintColor;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
94 SpriteFrame *pSpriteFrame;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
95
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
96 inline float GetFloatZ() const
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
97 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
98 return (float)object_pid / 65535.0f + (float)actual_z;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
99 }
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
100 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
101 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
102
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
103
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
104 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
105 struct RenderD3D__DevInfo
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
106 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
107 unsigned int bIsDeviceCompatible;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
108 char *pName;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
109 char *pDescription;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
110 GUID *pGUID;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
111 unsigned int uCaps;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
112 char *pDriverName;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
113 char *pDeviceDesc;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
114 char *pDDraw4DevDesc;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
115 GUID *pDirectDrawGUID;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
116 int uVideoMem;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
117 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
118 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
119
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
120
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
121
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
122 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
123 struct RenderD3D_D3DDevDesc
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
124 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
125 int field_0;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
126 int field_4;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
127 int field_8;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
128 int field_C;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
129 int field_10;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
130 char *pDriverName;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
131 char *pDeviceDesc;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
132 char *pDDraw4DevDesc;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
133 GUID *pGUID;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
134 unsigned int uVideoMem;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
135 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
136 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
137
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
138
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
139
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
140
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
141
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
142
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
143
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
144
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
145
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
146 /* 280 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
147 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
148 struct HWLTexture
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
149 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
150 inline HWLTexture():
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
151 field_0(0), field_4(0), field_8(0),
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
152 field_C(0), field_10(0), field_14(0)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
153 {}
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
154
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
155 int field_0;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
156 int field_4;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
157 int field_8;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
158 int field_C;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
159 int field_10;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
160 int field_14;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
161 int uBufferWidth;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
162 int uBufferHeight;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
163 int uAreaWidth;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
164 int uAreaHeigth;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
165 unsigned int uWidth;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
166 unsigned int uHeight;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
167 int uAreaX;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
168 int uAreaY;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
169 unsigned __int16 *pPixels;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
170 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
171 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
172
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
173
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
174 /* 185 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
175 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
176 struct RenderHWLContainer
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
177 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
178 RenderHWLContainer();
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
179 bool Load(const wchar_t *pFilename);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
180 bool Release();
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
181
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
182 HWLTexture *LoadTexture(const char *pName, int bMipMaps);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
183
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
184 FILE *pFile;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
185 uint32_t uSignature;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
186 unsigned int uDataOffset;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
187 unsigned int uNumItems;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
188 char *pSpriteNames[50000];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
189 int pSpriteOffsets[50000];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
190 int bDumpDebug;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
191 int scale_hwls_to_half;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
192 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
193 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
194
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
195
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
196
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
197 /* 242 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
198 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
199 struct RenderBillboardD3D
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
200 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
201 inline RenderBillboardD3D():
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
202 opacity(Transparent),
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
203 field_90(-1),
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
204 sParentBillboardID(-1),
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
205 uNumVertices(4)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
206 {}
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
207
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
208 enum OpacityType: unsigned __int32
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
209 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
210 Transparent = 0,
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
211 Opaque_1 = 1,
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
212 Opaque_2 = 2,
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
213 Opaque_3 = 3,
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
214 NoBlend = 0xFFFFFFFF
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
215 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
216
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
217 IDirect3DTexture2 *pTexture;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
218 unsigned int uNumVertices;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
219 RenderVertexD3D3 pQuads[4];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
220 float z_order;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
221 OpacityType opacity;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
222 int field_90;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
223 int sZValue;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
224 signed int sParentBillboardID;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
225 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
226 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
227
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
228
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
229
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
230
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
231 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
232 struct RenderD3D_aux
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
233 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
234 RenderD3D__DevInfo *pInfo;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
235 RenderD3D_D3DDevDesc *ptr_4;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
236 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
237 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
238
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
239
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
240
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
241 /* 183 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
242 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
243 class RenderD3D
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
244 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
245 public:
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
246 RenderD3D();
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
247
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
248 void GetAvailableDevices(RenderD3D__DevInfo **pOutDevices);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
249 void Release();
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
250 bool CreateDevice(unsigned int uDeviceID, int bWindowed, OSWindow *window);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
251 unsigned int GetDeviceCaps();
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
252 void ClearTarget(unsigned int bClearColor, unsigned int uClearColor, unsigned int bClearDepth, float z_clear);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
253 void Present(bool bForceBlit);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
254 bool CreateTexture(unsigned int uTextureWidth, unsigned int uTextureHeight, IDirectDrawSurface4 **pOutSurface, IDirect3DTexture2 **pOutTexture, bool bAlphaChannel, bool bMipmaps, unsigned int uMinDeviceTexDim);
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
255 void HandleLostResources();
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
256
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
257
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
258 unsigned int bWindowed;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
259 int field_4;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
260 int field_8;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
261 HWND hWindow;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
262 int field_10;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
263 int field_14;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
264 int field_18;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
265 RenderD3D__DevInfo *pAvailableDevices;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
266 IDirectDraw4 *pHost;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
267 IDirect3D3 *pDirect3D;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
268 IUnknown *pUnk;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
269 IDirectDrawSurface4 *pBackBuffer;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
270 IDirectDrawSurface4 *pFrontBuffer;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
271 IDirectDrawSurface4 *pZBuffer;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
272 IDirect3DDevice3 *pDevice;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
273 IDirect3DViewport3 *pViewport;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
274 int field_40;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
275 int field_44;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
276 char pErrorMessage[48];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
277 char field_78[208];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
278 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
279 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
280 extern struct RenderVertexD3D3 pVertices[50];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
281
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
282 /* 182 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
283 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
284
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
285 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
286
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
287 bool PauseGameDrawing();
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
288
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
289 extern struct IDirectDrawClipper *pDDrawClipper;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
290 extern struct Render *pRenderer; // idb
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
291 extern struct pUnkTerrain *Unks;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
292
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
293
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
294
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
295 /* 248 */
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
296 #pragma pack(push, 1)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
297 struct RenderBillboardTransform_local0
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
298 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
299 void *pTarget;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
300 int *pTargetZ;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
301 int uScreenSpaceX;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
302 int uScreenSpaceY;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
303 int _screenspace_x_scaler_packedfloat;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
304 int _screenspace_y_scaler_packedfloat;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
305 char field_18[8];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
306 unsigned __int16 *pPalette;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
307 unsigned __int16 *pPalette2;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
308 union
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
309 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
310 int sZValue;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
311 struct
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
312 {
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
313 unsigned short object_pid;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
314 short zbuffer_depth;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
315 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
316 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
317 unsigned int uFlags; // & 4 - mirror horizontally
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
318 unsigned int uTargetPitch;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
319 unsigned int uViewportX;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
320 unsigned int uViewportY;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
321 unsigned int uViewportZ;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
322 unsigned int uViewportW;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
323 int field_44;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
324 int sParentBillboardID;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
325 int sTintColor;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
326 };
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
327 #pragma pack(pop)
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
328
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
329
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
330
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
331
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
332 extern int uNumDecorationsDrawnThisFrame; // weak
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
333 extern RenderBillboard pBillboardRenderList[500];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
334 extern unsigned int uNumBillboardsToDraw;
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
335 extern int uNumSpritesDrawnThisFrame; // weak
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
336
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
337
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
338
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
339
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
340 extern RenderVertexSoft array_507D30[50];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
341 extern RenderVertexSoft array_50AC10[50];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
342 extern RenderVertexSoft array_73D150[20];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
343
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
344 extern RenderVertexD3D3 d3d_vertex_buffer[50];
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
345
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
346
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
347 int ODM_NearClip(unsigned int uVertexID); // idb
2d3c3d1dff0c added RenderStruct.h
Ritor1
parents:
diff changeset
348 int ODM_FarClip(unsigned int uNumVertices);