World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
RenderBase.cpp
См. документацию.
2 
3 #include <cassert>
4 
5 #include "Engine/Engine.h"
6 #include "Engine/MM7.h"
8 
9 #include "Engine/Objects/Actor.h"
12 
15 #include "Engine/Graphics/Lights.h"
19 
20 #include "Platform/OSWindow.h"
21 
23  if (!pD3DBitmaps.Open(MakeDataPath("data\\d3dbitmap.hwl"))) {
24  return false;
25  }
26  if (!pD3DSprites.Open(MakeDataPath("data\\d3dsprite.hwl"))) {
27  return false;
28  }
29 
30  window = window_;
31  if (window == nullptr) {
32  return false;
33  }
34 
35  return true;
36 }
37 
39  if (!config->IsFullscreen()) {
40  // window->SetWindowedMode(game_width, game_height);
42  } else {
43  __debugbreak(); // check required
44  window->SetFullscreenMode();
46  }
47 }
48 
50  if (uNumBillboardsToDraw >= 999) {
51  return 0;
52  }
53 
54  if (!uNumBillboardsToDraw) {
56  return 0;
57  }
58 
59  unsigned int v7 = 0;
60  for (int left = 0, right = uNumBillboardsToDraw;
61  left < right;) { // binsearch
62  v7 = left + (right - left) / 2;
64  right = v7;
65  else
66  left = v7 + 1;
67  }
68 
69  if (z > render->pBillboardRenderListD3D[v7].z_order) {
70  if (v7 == render->uNumBillboardsToDraw - 1) {
71  v7 = render->uNumBillboardsToDraw;
72  } else {
73  if (render->uNumBillboardsToDraw > v7) {
74  for (unsigned int i = 0; i < render->uNumBillboardsToDraw - v7;
75  i++) {
76  memcpy(&render->pBillboardRenderListD3D
77  [render->uNumBillboardsToDraw - i],
78  &render->pBillboardRenderListD3D
79  [render->uNumBillboardsToDraw - (i + 1)],
80  sizeof(render->pBillboardRenderListD3D
81  [render->uNumBillboardsToDraw - i]));
82  }
83  }
84  ++v7;
85  }
87  return v7;
88  }
89 
90  if (z <= render->pBillboardRenderListD3D[v7].z_order) {
91  if (render->uNumBillboardsToDraw > v7) {
92  for (unsigned int i = 0; i < render->uNumBillboardsToDraw - v7;
93  i++) {
94  memcpy(&render->pBillboardRenderListD3D
95  [render->uNumBillboardsToDraw - i],
96  &render->pBillboardRenderListD3D
97  [render->uNumBillboardsToDraw - (i + 1)],
98  sizeof(render->pBillboardRenderListD3D
99  [render->uNumBillboardsToDraw - i]));
100  }
101  }
103  return v7;
104  }
105 
106  return v7;
107 }
108 
110  for (unsigned int i = 0; i < uNumSpriteObjects; ++i) {
111  SpriteObject *object = &pSpriteObjects[i];
112  // auto v0 = (char *)&pSpriteObjects[i].uSectorID;
113  // v0 = (char *)&pSpriteObjects[0].uSectorID;
114  // do
115  //{
116 
117  // if (object->uType == 601) __debugbreak();
118 
119  if (!object->uObjectDescID) { // item probably pciked up - this also gets wiped at end of sprite anims/ particle effects
120  // __debugbreak();
121  continue;
122  }
123 
124 
125  if (!object->HasSprite()) {
126  // __debugbreak();
127  continue;
128  }
129 
130  // v1 = &pObjectList->pObjects[*((short *)v0 - 13)];
131  // if ( !(v1->uFlags & 1) )
132  //{
133  // v2 = *((short *)v0 - 14)
134  // v2 = object->uType;
135 
136  // render as sprte 500 - 9081
137 
138  if (spell_fx_renderer->RenderAsSprite(object) || ((object->uType < 1000 || object->uType >= 10000) && (object->uType < 500 || object->uType >= 600))) {
139  // a5 = *(short *)v0;
140  int x = object->vPosition.x;
141  int y = object->vPosition.y;
142  int z = object->vPosition.z;
143  SpriteFrame *frame = object->GetSpriteFrame();
144 
145  if (frame->icon_name == "null") {
146  __debugbreak();
147  continue;
148  }
149 
150  int a6 = frame->uGlowRadius * object->field_22_glow_radius_multiplier;
151 
152  // sprite angle to camera
153  unsigned int v6 = stru_5C6E00->Atan2(
154  object->vPosition.x - pIndoorCameraD3D->vPartyPos.x,
155  object->vPosition.y - pIndoorCameraD3D->vPartyPos.y);
156  // LOWORD(v7) = object->uFacing;
157  // v8 = v36;
158  int v9 = ((int)(stru_5C6E00->uIntegerPi + ((int)stru_5C6E00->uIntegerPi >> 3) +
159  object->uFacing - v6) >> 8) & 7;
160 
162  // error catching
163  if (frame->hw_sprites[v9]->texture->GetHeight() == 0 || frame->hw_sprites[v9]->texture->GetWidth() == 0)
164  __debugbreak();
165 
166  if (frame->uFlags & 0x20) {
167  // v8 = v36;
168  z -= fixpoint_mul(frame->scale._internal, frame->hw_sprites[v9]->uBufferHeight) / 2;
169  }
170  int16_t v46 = 0;
171  if (frame->uFlags & 2) v46 = 2;
172  // v11 = (int *)(256 << device_caps);
173  if ((256 << v9) & frame->uFlags) v46 |= 4;
174  if (frame->uFlags & 0x40000) v46 |= 0x40;
175  if (frame->uFlags & 0x20000) v46 |= 0x80;
176  if (a6) {
177  pMobileLightsStack->AddLight(x, y, z, object->uSectorID, a6, 0xFF, 0xFF, 0xFF, _4E94D3_light_type);
178  }
179 
180  int view_x = 0;
181  int view_y = 0;
182  int view_z = 0;
183 
184  bool visible = pIndoorCameraD3D->ViewClip(x, y, z, &view_x, &view_y, &view_z);
185 
186  if (visible) {
187  // if (abs(view_x) >= abs(view_y)) {
188  int projected_x = 0;
189  int projected_y = 0;
190  pIndoorCameraD3D->Project(view_x, view_y, view_z, &projected_x, &projected_y);
191 
192  object->uAttributes |= 1;
196 
199 
204 
208 
212  // if (!(object->uAttributes & 0x20)) {
213  // if (!pRenderD3D) {
214  // __debugbreak();
215  // pBillboardRenderList[::uNumBillboardsToDraw].screen_space_z
216  // = 0;
217  // pBillboardRenderList[::uNumBillboardsToDraw].object_pid
218  // = 0;
219  // }
220  // }
221 
222  assert(::uNumBillboardsToDraw < 500);
225  // }
226  }
227  }
228  }
229 }
230 
232  SoftwareBillboard billboard = {0};
233  billboard.sParentBillboardID = -1;
234  // billboard.pTarget = render->pTargetSurface;
235  billboard.pTargetZ = render->pActiveZBuffer;
236  // billboard.uTargetPitch = render->uTargetSurfacePitch;
237  billboard.uViewportX = pViewport->uViewportTL_X;
238  billboard.uViewportY = pViewport->uViewportTL_Y;
239  billboard.uViewportZ = pViewport->uViewportBR_X - 1;
240  billboard.uViewportW = pViewport->uViewportBR_Y;
242 
243  for (unsigned int i = 0; i < ::uNumBillboardsToDraw; ++i) {
244  auto p = &pBillboardRenderList[i];
245  if (p->hwsprite) {
246  billboard.screen_space_x = p->screen_space_x;
247  billboard.screen_space_y = p->screen_space_y;
248  billboard.screen_space_z = p->screen_space_z;
249  billboard.sParentBillboardID = i;
251  p->screenspace_projection_factor_x;
253  p->screenspace_projection_factor_y;
254  billboard.sTintColor = p->sTintColor;
255  billboard.object_pid = p->object_pid;
256  billboard.uFlags = p->field_1E;
257 
258  TransformBillboard(&billboard, p);
259  } else {
260  __debugbreak();
261  }
262  }
263 }
264 
265 unsigned int BlendColors(unsigned int a1, unsigned int a2) {
266  uint alpha =
267  (uint)floorf(0.5f + (a1 >> 24) / 255.0f * (a2 >> 24) / 255.0f * 255.0f);
268  uint red = (uint)floorf(0.5f + ((a1 >> 16) & 0xFF) / 255.0f *
269  ((a2 >> 16) & 0xFF) / 255.0f * 255.0f);
270  uint green = (uint)floorf(0.5f + ((a1 >> 8) & 0xFF) / 255.0f *
271  ((a2 >> 8) & 0xFF) / 255.0f * 255.0f);
272  uint blue = (uint)floorf(0.5f + ((a1 >> 0) & 0xFF) / 255.0f *
273  ((a2 >> 0) & 0xFF) / 255.0f * 255.0f);
274  return (alpha << 24) | (red << 16) | (green << 8) | blue;
275 }
276 
278  RenderBillboard *pBillboard) {
279  Sprite *pSprite = pBillboard->hwsprite;
280  // error catching
281  if (pSprite->texture->GetHeight() == 0 || pSprite->texture->GetWidth() == 0)
282  __debugbreak();
283 
284  int dimming_level = pBillboard->dimming_level;
285 
286  unsigned int billboard_index = Billboard_ProbablyAddToListAndSortByZOrder(a2->screen_space_z);
287 
288  float v30 = a2->screenspace_projection_factor_x;
289  float v29 = a2->screenspace_projection_factor_y;
290 
291  unsigned int diffuse = ::GetActorTintColor(
292  dimming_level, 0, a2->screen_space_z, 0, pBillboard);
293  if (config->is_tinting && a2->sTintColor & 0x00FFFFFF) {
294  diffuse = BlendColors(a2->sTintColor, diffuse);
295  if (a2->sTintColor & 0xFF000000)
296  diffuse = 0x007F7F7F & ((unsigned int)diffuse >> 1);
297  }
298 
299  unsigned int specular = 0;
300  if (config->is_using_specular) {
301  specular = sub_47C3D7_get_fog_specular(0, 0, a2->screen_space_z);
302  }
303 
304  RenderBillboardD3D *billboard = &pBillboardRenderListD3D[billboard_index];
305 
306  float v14 = (float)((int)pSprite->uBufferWidth / 2 - pSprite->uAreaX);
307  float v15 = (float)((int)pSprite->uBufferHeight - pSprite->uAreaY);
308  if (a2->uFlags & 4) v14 *= -1.f;
309  billboard->pQuads[0].diffuse = diffuse;
310  billboard->pQuads[0].pos.x = (float)a2->screen_space_x - v14 * v30;
311  billboard->pQuads[0].pos.y = (float)a2->screen_space_y - v15 * v29;
312  billboard->pQuads[0].pos.z = 1.f - 1.f / (a2->screen_space_z * 1000.f / pIndoorCameraD3D->GetFarClip());
313  billboard->pQuads[0].rhw = 1.f / a2->screen_space_z;
314  billboard->pQuads[0].specular = specular;
315  billboard->pQuads[0].texcoord.x = 0.f;
316  billboard->pQuads[0].texcoord.y = 0.f;
317 
318  v14 = (float)((int)pSprite->uBufferWidth / 2 - pSprite->uAreaX);
319  v15 = (float)((int)pSprite->uBufferHeight - pSprite->uAreaHeight - pSprite->uAreaY);
320  if (a2->uFlags & 4) v14 = v14 * -1.f;
321  billboard->pQuads[1].specular = specular;
322  billboard->pQuads[1].diffuse = diffuse;
323  billboard->pQuads[1].pos.x = (float)a2->screen_space_x - v14 * v30;
324  billboard->pQuads[1].pos.y = (float)a2->screen_space_y - v15 * v29;
325  billboard->pQuads[1].pos.z = 1.f - 1.f / (a2->screen_space_z * 1000.f / pIndoorCameraD3D->GetFarClip());
326  billboard->pQuads[1].rhw = 1.f / a2->screen_space_z;
327  billboard->pQuads[1].texcoord.x = 0.f;
328  billboard->pQuads[1].texcoord.y = 1.f;
329 
330  v14 = (float)((int)pSprite->uAreaWidth + pSprite->uAreaX + pSprite->uBufferWidth / 2 - pSprite->uBufferWidth);
331  v15 = (float)((int)pSprite->uBufferHeight - pSprite->uAreaHeight - pSprite->uAreaY);
332  if (a2->uFlags & 4) v14 *= -1.f;
333  billboard->pQuads[2].diffuse = diffuse;
334  billboard->pQuads[2].specular = specular;
335  billboard->pQuads[2].pos.x = (float)a2->screen_space_x + v14 * v30;
336  billboard->pQuads[2].pos.y = (float)a2->screen_space_y - v15 * v29;
337  billboard->pQuads[2].pos.z = 1.f - 1.f / (a2->screen_space_z * 1000.f / pIndoorCameraD3D->GetFarClip());
338  billboard->pQuads[2].rhw = 1.f / a2->screen_space_z;
339  billboard->pQuads[2].texcoord.x = 1.f;
340  billboard->pQuads[2].texcoord.y = 1.f;
341 
342  v14 = (float)((int)pSprite->uAreaWidth + pSprite->uAreaX + pSprite->uBufferWidth / 2 - pSprite->uBufferWidth);
343  v15 = (float)((int)pSprite->uBufferHeight - pSprite->uAreaY);
344  if (a2->uFlags & 4) v14 *= -1.f;
345  billboard->pQuads[3].diffuse = diffuse;
346  billboard->pQuads[3].specular = specular;
347  billboard->pQuads[3].pos.x = (float)a2->screen_space_x + v14 * v30;
348  billboard->pQuads[3].pos.y = (float)a2->screen_space_y - v15 * v29;
349  billboard->pQuads[3].pos.z = 1.f - 1.f / (a2->screen_space_z * 1000.f / pIndoorCameraD3D->GetFarClip());
350  billboard->pQuads[3].rhw = 1.f / a2->screen_space_z;
351  billboard->pQuads[3].texcoord.x = 1.f;
352  billboard->pQuads[3].texcoord.y = 0.f;
353 
354  billboard->uNumVertices = 4;
355 
356  // error catching
357  if (pSprite->texture->GetHeight() == 0 || pSprite->texture->GetWidth() == 0)
358  __debugbreak();
359 
360  billboard->texture = pSprite->texture;
361  billboard->z_order = a2->screen_space_z;
362  billboard->field_90 = a2->field_44;
363  billboard->screen_space_z = a2->screen_space_z;
364  billboard->object_pid = a2->object_pid;
365  billboard->sParentBillboardID = a2->sParentBillboardID;
366 
367  if (a2->sTintColor & 0xFF000000)
369  else
371 }
372 
373 double fix2double(int fix) {
374  return (((double)(fix & 0xFFFF) / (double)0xFFFF) + (double)(fix >> 16));
375 }
376 
378  Texture *texture,
379  unsigned int uDiffuse,
380  int angle) {
381  unsigned int billboard_index = Billboard_ProbablyAddToListAndSortByZOrder(a2->screen_space_z);
382  RenderBillboardD3D *billboard = &pBillboardRenderListD3D[billboard_index];
383 
385  billboard->field_90 = a2->field_44;
386  billboard->screen_space_z = a2->screen_space_z;
387  billboard->object_pid = a2->object_pid;
388  billboard->sParentBillboardID = a2->sParentBillboardID;
389  billboard->texture = texture;
390  billboard->z_order = a2->screen_space_z;
391  billboard->uNumVertices = 4;
392 
393  float screenspace_projection_factor = a2->screenspace_projection_factor_x;
394 
395  float rhw = 1.f / a2->screen_space_z;
396  float z = 1.f - 1.f / (a2->screen_space_z * 1000.f / pIndoorCameraD3D->GetFarClip());
397 
398  float acos = (float)cos(angle);
399  float asin = (float)sin(angle);
400 
401  {
402  float v16 = -12.f;
403  float v17 = -12.f;
404  billboard->pQuads[0].pos.x = (acos * v16 - asin * v17) * screenspace_projection_factor + (float)a2->screen_space_x;
405  billboard->pQuads[0].pos.y = (acos * v17 + asin * v16 - 12.f) * screenspace_projection_factor + (float)a2->screen_space_y;
406  billboard->pQuads[0].pos.z = z;
407  billboard->pQuads[0].specular = 0;
408  billboard->pQuads[0].diffuse = uDiffuse;
409  billboard->pQuads[0].rhw = rhw;
410  billboard->pQuads[0].texcoord.x = 0.f;
411  billboard->pQuads[0].texcoord.y = 0.f;
412  }
413 
414  {
415  float v31 = -12;
416  float v32 = 12;
417  billboard->pQuads[1].pos.x = (acos * v31 - asin * v32) * screenspace_projection_factor + (float)a2->screen_space_x;
418  billboard->pQuads[1].pos.y = (acos * v32 + asin * v31 - 12.f) * screenspace_projection_factor + (float)a2->screen_space_y;
419  billboard->pQuads[1].pos.z = z;
420  billboard->pQuads[1].specular = 0;
421  billboard->pQuads[1].diffuse = uDiffuse;
422  billboard->pQuads[1].rhw = rhw;
423  billboard->pQuads[1].texcoord.x = 0.0;
424  billboard->pQuads[1].texcoord.y = 1.0;
425  }
426 
427  {
428  float v23 = 12;
429  float v24 = 12;
430  billboard->pQuads[2].pos.x = (acos * v23 - asin * v24) * screenspace_projection_factor + (float)a2->screen_space_x;
431  billboard->pQuads[2].pos.y = (acos * v24 + asin * v23 - 12.f) * screenspace_projection_factor + (float)a2->screen_space_y;
432  billboard->pQuads[2].pos.z = z;
433  billboard->pQuads[2].specular = 0;
434  billboard->pQuads[2].diffuse = uDiffuse;
435  billboard->pQuads[2].rhw = rhw;
436  billboard->pQuads[2].texcoord.x = 1.0;
437  billboard->pQuads[2].texcoord.y = 1.0;
438  }
439 
440  {
441  float v39 = 12;
442  float v40 = -12;
443  billboard->pQuads[3].pos.x = (acos * v39 - asin * v40) * screenspace_projection_factor + (float)a2->screen_space_x;
444  billboard->pQuads[3].pos.y = (acos * v40 + asin * v39 - 12.f) * screenspace_projection_factor + (float)a2->screen_space_y;
445  billboard->pQuads[3].pos.z = z;
446  billboard->pQuads[3].specular = 0;
447  billboard->pQuads[3].diffuse = uDiffuse;
448  billboard->pQuads[3].rhw = rhw;
449  billboard->pQuads[3].texcoord.x = 1.0;
450  billboard->pQuads[3].texcoord.y = 0.0;
451  }
452 }
453 
455  return pD3DBitmaps.LoadTexture(name);
456 }
457 
459  return pD3DSprites.LoadTexture(name);
460 }
461 
OSWindow.h
SpriteObject
Definition: SpriteObject.h:189
SpriteFrame::hw_sprites
Sprite * hw_sprites[8]
Definition: Sprites.h:46
fix2double
double fix2double(int fix)
Definition: RenderBase.cpp:373
RenderBillboard::hwsprite
Sprite * hwsprite
Definition: IRender.h:32
int16_t
signed __int16 int16_t
Definition: SDL_config.h:36
Viewport.h
Image::GetHeight
unsigned int GetHeight()
Definition: Image.cpp:230
RenderBillboard::screen_space_x
int16_t screen_space_x
Definition: IRender.h:39
Vec2::x
T x
Definition: VectorTypes.h:12
SpriteFrame::uGlowRadius
int uGlowRadius
Definition: Sprites.h:49
ODMRenderParams::uNumBillboards
unsigned int uNumBillboards
Definition: IRender.h:90
SpriteFrame::icon_name
String icon_name
Definition: Sprites.h:43
right
GLdouble GLdouble right
Definition: SDL_opengl_glext.h:6106
pSpriteObjects
std::array< SpriteObject, MAX_SPRITE_OBJECTS > pSpriteObjects
Definition: SpriteObject.cpp:34
Viewport::uViewportTL_Y
int uViewportTL_Y
Definition: Viewport.h:23
RenderBillboard::uIndoorSectorID
int16_t uIndoorSectorID
Definition: IRender.h:34
OBJECT_Item
@ OBJECT_Item
Definition: Actor.h:66
Vec3_float_::x
float x
Definition: VectorTypes.h:89
RenderBase::Initialize
virtual bool Initialize(OSWindow *window)
Definition: RenderBase.cpp:22
RenderBillboardD3D::Opaque_1
@ Opaque_1
Definition: IRender.h:151
RenderVertexD3D3::pos
Vec3_float_ pos
Definition: IRender.h:130
_4E94D3_light_type
char _4E94D3_light_type
Definition: mm7_data.cpp:307
z
GLdouble GLdouble z
Definition: SDL_opengl_glext.h:407
SpriteObject.h
SpriteFrame::scale
fixed scale
Definition: Sprites.h:47
RenderBillboardD3D
Definition: IRender.h:138
RenderBase::TransformBillboard
void TransformBillboard(SoftwareBillboard *a2, RenderBillboard *pBillboard)
Definition: RenderBase.cpp:277
Texture
Definition: Texture.h:4
RenderBillboard::dimming_level
uint16_t dimming_level
Definition: IRender.h:43
SoftwareBillboard::screenspace_projection_factor_y
float screenspace_projection_factor_y
Definition: IRender.h:177
RenderBillboardD3D::field_90
int field_90
Definition: IRender.h:163
LightmapBuilder.h
RenderBillboard::screen_space_z
int16_t screen_space_z
Definition: IRender.h:41
SoftwareBillboard::screenspace_projection_factor_x
float screenspace_projection_factor_x
Definition: IRender.h:176
RenderBillboard::world_z
int16_t world_z
Definition: IRender.h:38
RenderBillboardD3D::Transparent
@ Transparent
Definition: IRender.h:150
Sprite::uBufferHeight
int uBufferHeight
Definition: Sprites.h:32
SpriteFrame::uPaletteIndex
int uPaletteIndex
Definition: Sprites.h:51
texture
GLenum GLenum GLuint texture
Definition: SDL_opengl_glext.h:1181
SpellFxRenderer.h
RenderBillboardD3D::z_order
float z_order
Definition: IRender.h:161
SoftwareBillboard::field_44
int field_44
Definition: IRender.h:187
Sprite::texture
Texture * texture
Definition: Sprites.h:28
RenderBillboard::pSpriteFrame
SpriteFrame * pSpriteFrame
Definition: IRender.h:45
HWLTexture
Definition: HWLContainer.h:9
Vec3_float_::y
float y
Definition: VectorTypes.h:90
Vec3_float_::z
float z
Definition: VectorTypes.h:91
IRender::InitializeFullscreen
virtual bool InitializeFullscreen()=0
RenderBase::Billboard_ProbablyAddToListAndSortByZOrder
unsigned int Billboard_ProbablyAddToListAndSortByZOrder(float z)
Definition: RenderBase.cpp:49
Engine.h
Lights.h
Sprite
Definition: Sprites.h:10
IRender::GetActorTintColor
virtual unsigned int GetActorTintColor(int DimLevel, int tint, float WorldViewX, int a5, RenderBillboard *Billboard)=0
RenderVertexD3D3::texcoord
Vec2_float_ texcoord
Definition: IRender.h:134
HWLContainer::LoadTexture
HWLTexture * LoadTexture(const String &pName)
Definition: HWLContainer.cpp:88
RenderBillboard::field_1E
int16_t field_1E
Definition: IRender.h:35
Actor.h
OSWindow
Definition: OSWindow.h:12
Sprite::uAreaY
int uAreaY
Definition: Sprites.h:30
alpha
GLfloat GLfloat GLfloat alpha
Definition: SDL_opengl_glext.h:415
y
EGLSurface EGLint EGLint y
Definition: SDL_egl.h:1596
RenderVertexD3D3::rhw
float rhw
Definition: IRender.h:131
Image::GetWidth
unsigned int GetWidth()
Definition: Image.cpp:217
IndoorCameraD3D::vPartyPos
Vec3< int > vPartyPos
Definition: IndoorCameraD3D.h:253
Vec2::y
T y
Definition: VectorTypes.h:13
Sprite::uBufferWidth
int uBufferWidth
Definition: Sprites.h:31
object
GLuint object
Definition: SDL_opengl_glext.h:6060
SoftwareBillboard
Definition: IRender.h:170
RenderBillboard::uPalette
int16_t uPalette
Definition: IRender.h:33
RenderBillboard
Definition: IRender.h:26
p
GLfloat GLfloat p
Definition: SDL_opengl_glext.h:11093
RenderBillboard::object_pid
uint16_t object_pid
Definition: IRender.h:42
x
EGLSurface EGLint x
Definition: SDL_egl.h:1596
RenderBase::pD3DBitmaps
HWLContainer pD3DBitmaps
Definition: RenderBase.h:32
SoftwareBillboard::screen_space_z
short screen_space_z
Definition: IRender.h:175
RenderBase::PostInitialization
void PostInitialization()
Definition: RenderBase.cpp:38
BlendColors
unsigned int BlendColors(unsigned int a1, unsigned int a2)
Definition: RenderBase.cpp:265
IndoorCameraD3D::ViewClip
bool ViewClip(int x, int y, int z, int *transformed_x, int *transformed_y, int *transformed_z, bool dont_show=false)
Definition: IndoorCameraD3D.cpp:172
fixed::_internal
int32_t _internal
Definition: OurMath.h:73
Sprite::uAreaWidth
int uAreaWidth
Definition: Sprites.h:33
RenderVertexD3D3::diffuse
unsigned int diffuse
Definition: IRender.h:132
IRender::pBillboardRenderListD3D
RenderBillboardD3D pBillboardRenderListD3D[1000]
Definition: IRender.h:428
IndoorCameraD3D::Project
void Project(int x, int y, int z, int *screenspace_x, int *screenspace_y)
Definition: IndoorCameraD3D.cpp:1137
fixpoint_mul
__int64 fixpoint_mul(int a1, int a2)
Definition: OurMath.cpp:138
Viewport::uViewportBR_X
int uViewportBR_X
Definition: Viewport.h:24
window
EGLSurface EGLNativeWindowType * window
Definition: SDL_egl.h:1580
f
GLfloat f
Definition: SDL_opengl_glext.h:1873
RenderBase::LoadHwlSprite
virtual HWLTexture * LoadHwlSprite(const String &name)
Definition: RenderBase.cpp:458
RenderBillboardD3D::uNumVertices
unsigned int uNumVertices
Definition: IRender.h:159
RenderBase::LoadHwlBitmap
virtual HWLTexture * LoadHwlBitmap(const String &name)
Definition: RenderBase.cpp:454
blue
GLbyte GLbyte blue
Definition: SDL_opengl_glext.h:382
SoftwareBillboard::screen_space_x
int screen_space_x
Definition: IRender.h:173
green
GLbyte green
Definition: SDL_opengl_glext.h:382
RenderBillboardD3D::opacity
OpacityType opacity
Definition: IRender.h:162
HWLContainer::Open
bool Open(const String &pFilename)
Definition: HWLContainer.cpp:28
Viewport::uViewportBR_Y
int uViewportBR_Y
Definition: Viewport.h:25
RenderBillboardD3D::texture
Texture * texture
Definition: IRender.h:158
SoftwareBillboard::uViewportY
unsigned int uViewportY
Definition: IRender.h:184
RenderBillboard::screenspace_projection_factor_y
float screenspace_projection_factor_y
Definition: IRender.h:28
SpellFxRenderer::RenderAsSprite
bool RenderAsSprite(struct SpriteObject *a2)
Definition: SpellFxRenderer.cpp:671
Outdoor.h
RenderBillboardD3D::object_pid
unsigned short object_pid
Definition: IRender.h:165
SoftwareBillboard::uViewportX
unsigned int uViewportX
Definition: IRender.h:183
RenderBillboard::screen_space_y
int16_t screen_space_y
Definition: IRender.h:40
SoftwareBillboard::screen_space_y
int screen_space_y
Definition: IRender.h:174
pViewport
struct Viewport * pViewport
Definition: mm7_data.cpp:21
pODMRenderParams
ODMRenderParams * pODMRenderParams
Definition: Outdoor.cpp:49
uNumSpriteObjects
size_t uNumSpriteObjects
Definition: SpriteObject.cpp:33
IRender::uNumBillboardsToDraw
unsigned int uNumBillboardsToDraw
Definition: IRender.h:429
IRender::SwitchToWindow
virtual bool SwitchToWindow()=0
RenderBillboardD3D::Opaque_3
@ Opaque_3
Definition: IRender.h:153
IRender::spell_fx_renderer
SpellFxRenderer * spell_fx_renderer
Definition: IRender.h:433
stru193_math::Atan2
unsigned int Atan2(int x, int y)
Definition: OurMath.cpp:46
name
EGLImageKHR EGLint * name
Definition: SDL_egl.h:1497
Sprite::uAreaX
int uAreaX
Definition: Sprites.h:29
RenderBillboard::world_y
int16_t world_y
Definition: IRender.h:37
SoftwareBillboard::uViewportW
unsigned int uViewportW
Definition: IRender.h:186
RenderBase.h
MakeDataPath
std::string MakeDataPath(const char *file_rel_path)
Definition: Engine.cpp:126
SpriteFrame
Definition: Sprites.h:39
uint
unsigned int uint
Definition: MM7.h:4
SoftwareBillboard::uViewportZ
unsigned int uViewportZ
Definition: IRender.h:185
SoftwareBillboard::uFlags
unsigned int uFlags
Definition: IRender.h:181
IndoorCameraD3D.h
SoftwareBillboard::sParentBillboardID
int sParentBillboardID
Definition: IRender.h:188
__debugbreak
void __cdecl __debugbreak(void)
fixed::GetFloat
float GetFloat() const
Definition: OurMath.h:37
uNumSpritesDrawnThisFrame
int uNumSpritesDrawnThisFrame
Definition: RenderOpenGL.cpp:56
stru_5C6E00
struct stru193_math * stru_5C6E00
Definition: mm7_data.cpp:19
angle
GLfloat angle
Definition: SDL_opengl_glext.h:6100
sub_47C3D7_get_fog_specular
int sub_47C3D7_get_fog_specular(int a1, int a2, float a3)
Definition: Outdoor.cpp:3898
pBillboardRenderList
RenderBillboard pBillboardRenderList[500]
Definition: RenderOpenGL.cpp:54
ODMRenderParams::int_fov_rad
int int_fov_rad
Definition: IRender.h:79
RenderBase::MakeParticleBillboardAndPush
virtual void MakeParticleBillboardAndPush(SoftwareBillboard *a2, Texture *texture, unsigned int uDiffuse, int angle)
Definition: RenderBase.cpp:377
IndoorCameraD3D::GetFarClip
float GetFarClip() const
Definition: IndoorCameraD3D.cpp:159
RenderBillboard::screenspace_projection_factor_x
float screenspace_projection_factor_x
Definition: IRender.h:27
RenderBase::DrawSpriteObjects_ODM
virtual void DrawSpriteObjects_ODM()
Definition: RenderBase.cpp:109
ObjectList.h
RenderBillboardD3D::sParentBillboardID
int sParentBillboardID
Definition: IRender.h:167
pMobileLightsStack
LightsStack_MobileLight_ * pMobileLightsStack
Definition: LightmapBuilder.cpp:14
RenderBase::pD3DSprites
HWLContainer pD3DSprites
Definition: RenderBase.h:33
RenderBase::TransformBillboardsAndSetPalettesODM
virtual void TransformBillboardsAndSetPalettesODM()
Definition: RenderBase.cpp:231
RenderBillboardD3D::screen_space_z
short screen_space_z
Definition: IRender.h:166
RenderVertexD3D3::specular
unsigned int specular
Definition: IRender.h:133
RenderBillboardD3D::pQuads
RenderVertexD3D3 pQuads[4]
Definition: IRender.h:160
SoftwareBillboard::pTargetZ
int * pTargetZ
Definition: IRender.h:172
pIndoorCameraD3D
IndoorCameraD3D * pIndoorCameraD3D
Definition: IndoorCameraD3D.cpp:21
Viewport::uViewportTL_X
int uViewportTL_X
Definition: Viewport.h:22
left
GLint left
Definition: SDL_opengl_glext.h:1952
stru193_math::uIntegerPi
static const unsigned int uIntegerPi
Definition: OurMath.h:88
String
std::string String
Definition: Strings.h:10
LightsStack_MobileLight_::AddLight
bool AddLight(int16_t x, int16_t y, int16_t z, int16_t uSectorID, int uRadius, uint8_t r, uint8_t g, uint8_t b, char a10)
Definition: LightsStack.cpp:6
SoftwareBillboard::sTintColor
int sTintColor
Definition: IRender.h:189
Sprites.h
RenderBillboard::world_x
int16_t world_x
Definition: IRender.h:36
config
EGLConfig config
Definition: SDL_egl.h:1149
Sprite::uAreaHeight
int uAreaHeight
Definition: Sprites.h:34
SpriteFrame::uFlags
int uFlags
Definition: Sprites.h:48
RenderBillboard::sTintColor
unsigned int sTintColor
Definition: IRender.h:44
SoftwareBillboard::object_pid
unsigned short object_pid
Definition: IRender.h:190
MM7.h
render
std::shared_ptr< IRender > render
Definition: RenderOpenGL.cpp:52