World of Might and Magic  0.2.0
Open reimplementation of Might and Magic 6 7 8 game engine
LightmapBuilder.h
См. документацию.
1 #pragma once
2 
3 #include <vector>
4 
6 
9 
10 /* 115 */
11 #pragma pack(push, 1)
12 struct Lightmap { // карта света, текстура для наложения теней
13  Lightmap();
14  virtual ~Lightmap() {}
15 
16  // void ( ***vdestructor_ptr)(Lightmap *, bool);
17  signed int NumVertices;
19  __int16 position_x; //позиция источника света
20  __int16 position_y;
21  __int16 position_z;
22  __int16 field_C0E; //нигде не используется
23  unsigned int uColorMask;
24  float fBrightness; //яркость
25  int field_C18; //нигде не используется
26 };
27 #pragma pack(pop)
28 
29 #define LIGHTMAP_FLAGS_USE_SPECULAR 0x01
30 
31 /* 114 */
32 #pragma pack(push, 1)
34  public:
36  virtual ~LightmapBuilder() //----- (0045BBAA)
37  {}
38 
39  void Draw_183808_Lightmaps(); //используется для мобильного света
40  // bool DrawLightmap(Lightmap *a1, Vec3_float_ *pColorMult, float z_bias);
41  bool DoDraw_183808_Lightmaps(float a2); //используется для мобильного света
42  void DrawLightmaps(int indices);
43  void DrawLightmapsType(int type);
44  void DrawDebugOutlines(char bit_one_for_list1__bit_two_for_list2);
45  double _45D643_sw(struct Edge *a1, float a2);
46  // int _45D426_sw(struct Span *a1, struct Edge **a2, unsigned int a3, struct
47  // Edge *a4, int a5); bool _45D3C7_sw(struct Polygon *a1);
48  bool StackLight_TerrainFace(struct StationaryLight *pLight,
49  struct Vec3_float_ *pNormal, float *a3,
50  struct RenderVertexSoft *a1,
51  unsigned int uStripType, int X,
52  unsigned int *pSlot);
53  bool StackLights_TerrainFace(struct Vec3_float_ *pNormal, float *a3,
54  struct RenderVertexSoft *a1,
55  unsigned int uStripType, bool bLightBackfaces);
56  bool ApplyLight_ODM(struct StationaryLight *pLight, struct ODMFace *pFace,
57  unsigned int *pSlot, bool bLightBackfaces);
58  bool ApplyLights_OutdoorFace(struct ODMFace *pFace);
59  double _45CC0C_light(struct Vec3_float_ a1, float a2, float a3,
60  struct Vec3_float_ *pNormal, float a5, int uLightType);
61  int _45CBD4(struct RenderVertexSoft *a2, int a3, int *a4, int *a5);
62  int _45CB89(struct RenderVertexSoft *a1, int a2);
63  int _45CA88(struct LightsData *a2, struct RenderVertexSoft *a3, int a4,
64  struct Vec3_float_ *pNormal);
65  bool ApplyLight_BLV(struct StationaryLight *pLight, struct BLVFace *a2,
66  unsigned int *pSlot, bool bLightBackfaces, char *a5);
67  bool ApplyLights_IndoorFace(unsigned int uFaceID);
68  int _45C6D6(int a2, struct RenderVertexSoft *a3, Lightmap *pLightmap);
69  int _45C4B9(int a2, struct RenderVertexSoft *a3, Lightmap *pLightmap);
70  bool _45BE86_build_light_polygon(Vec3_int_ *pos, float radius,
71  unsigned int uColorMask, float dot_dist,
72  int uLightType, struct stru314 *a7,
73  unsigned int uNumVertices,
74  RenderVertexSoft *a9, char uClipFlag);
75  bool ApplyLights(struct LightsData *a2, struct stru154 *a3,
76  unsigned int uNumVertices, struct RenderVertexSoft *a5,
77  struct IndoorCameraD3D_Vec4 *, char uClipFlag);
78 
79  // void ( ***vdestructor_ptr)(LightmapBuilder *, bool);
80  // std::vector<Lightmap> std__vector_000004;
81  // std::vector<Lightmap> std__vector_183808;
82  Lightmap StationaryLights[512]; // std__vector_000004
83  unsigned int StationaryLightsCount; // std__vector_000004_size
84  Lightmap MobileLights[768]; // std__vector_183808
85  unsigned int MobileLightsCount; // std__vector_183808_size
92  float tex_light_radius; // flt_3C8C24;
93  float flt_3C8C28;
95  float light_radius;
97  int uFlags; // LIGHTMAP_FLAGS_*
98 
99  Log *log = nullptr;
100 };
101 #pragma pack(pop)
102 
104 // extern StationaryLight pStationaryLights[400];
105 // extern int uNumStationaryLightsApplied;
107 // extern MobileLight pMobileLights[400];
108 // extern int uNumMobileLightsApplied;
LightmapBuilder::light_length_z
float light_length_z
Definition: LightmapBuilder.h:88
LightmapBuilder::_45BE86_build_light_polygon
bool _45BE86_build_light_polygon(Vec3_int_ *pos, float radius, unsigned int uColorMask, float dot_dist, int uLightType, struct stru314 *a7, unsigned int uNumVertices, RenderVertexSoft *a9, char uClipFlag)
Definition: LightmapBuilder.cpp:561
Lightmap::position_y
__int16 position_y
Definition: LightmapBuilder.h:20
LightmapBuilder::_45C6D6
int _45C6D6(int a2, struct RenderVertexSoft *a3, Lightmap *pLightmap)
Definition: LightmapBuilder.cpp:731
Lightmap::Lightmap
Lightmap()
Definition: LightmapBuilder.cpp:19
Vec3_float_
Definition: VectorTypes.h:74
LightmapBuilder::light_length_y2
float light_length_y2
Definition: LightmapBuilder.h:90
stru154
Definition: Indoor.h:229
Lightmap::NumVertices
signed int NumVertices
Definition: LightmapBuilder.h:17
LightmapBuilder::ApplyLights_IndoorFace
bool ApplyLights_IndoorFace(unsigned int uFaceID)
Definition: LightmapBuilder.cpp:261
LightmapBuilder::DoDraw_183808_Lightmaps
bool DoDraw_183808_Lightmaps(float a2)
Definition: LightmapBuilder.cpp:344
LightmapBuilder::DrawLightmapsType
void DrawLightmapsType(int type)
Definition: LightmapBuilder.cpp:796
LightmapBuilder::ApplyLight_BLV
bool ApplyLight_BLV(struct StationaryLight *pLight, struct BLVFace *a2, unsigned int *pSlot, bool bLightBackfaces, char *a5)
Definition: LightmapBuilder.cpp:299
LightmapBuilder::uFlags
int uFlags
Definition: LightmapBuilder.h:97
LightmapBuilder::log
Log * log
Definition: LightmapBuilder.h:99
LightmapBuilder::light_length_z2
float light_length_z2
Definition: LightmapBuilder.h:91
pMobileLightsStack
LightsStack_MobileLight_ * pMobileLightsStack
Definition: LightmapBuilder.cpp:14
Lightmap::~Lightmap
virtual ~Lightmap()
Definition: LightmapBuilder.h:14
Lightmap::uColorMask
unsigned int uColorMask
Definition: LightmapBuilder.h:23
IndoorCameraD3D_Vec4
Definition: IndoorCameraD3D.h:32
LightmapBuilder::light_length_y
float light_length_y
Definition: LightmapBuilder.h:87
Log
Definition: Log.h:3
Lightmap
Definition: LightmapBuilder.h:12
LightmapBuilder::MobileLightsCount
unsigned int MobileLightsCount
Definition: LightmapBuilder.h:85
LightmapBuilder::flt_3C8C28
float flt_3C8C28
Definition: LightmapBuilder.h:93
Lightmap::position_x
__int16 position_x
Definition: LightmapBuilder.h:19
LightmapBuilder::DrawDebugOutlines
void DrawDebugOutlines(char bit_one_for_list1__bit_two_for_list2)
Definition: LightmapBuilder.cpp:1077
LightmapBuilder::DrawLightmaps
void DrawLightmaps(int indices)
Definition: LightmapBuilder.cpp:802
StationaryLight
Definition: Lights.h:10
Lightmap::position_z
__int16 position_z
Definition: LightmapBuilder.h:21
LightmapBuilder
Definition: LightmapBuilder.h:33
IRender.h
LightmapBuilder::~LightmapBuilder
virtual ~LightmapBuilder()
Definition: LightmapBuilder.h:36
LightmapBuilder::flt_3C8C2C_lightmaps_brightness
float flt_3C8C2C_lightmaps_brightness
Definition: LightmapBuilder.h:94
BLVFace
Definition: Indoor.h:424
LightmapBuilder::StationaryLights
Lightmap StationaryLights[512]
Definition: LightmapBuilder.h:82
LightmapBuilder::_45CA88
int _45CA88(struct LightsData *a2, struct RenderVertexSoft *a3, int a4, struct Vec3_float_ *pNormal)
Definition: LightmapBuilder.cpp:848
LightmapBuilder::light_length_x
float light_length_x
Definition: LightmapBuilder.h:86
type
EGLenum type
Definition: SDL_egl.h:850
Lightmap::field_C18
int field_C18
Definition: LightmapBuilder.h:25
LightmapBuilder::light_radius
float light_radius
Definition: LightmapBuilder.h:95
Lightmap::fBrightness
float fBrightness
Definition: LightmapBuilder.h:24
LightmapBuilder::LightmapBuilder
LightmapBuilder()
Definition: LightmapBuilder.cpp:29
LightmapBuilder::light_length_x2
float light_length_x2
Definition: LightmapBuilder.h:89
Lightmap::pVertices
RenderVertexSoft pVertices[64]
Definition: LightmapBuilder.h:18
LightmapBuilder::tex_light_radius
float tex_light_radius
Definition: LightmapBuilder.h:92
LightmapBuilder::_45CC0C_light
double _45CC0C_light(struct Vec3_float_ a1, float a2, float a3, struct Vec3_float_ *pNormal, float a5, int uLightType)
Definition: LightmapBuilder.cpp:1001
LightmapBuilder::ApplyLight_ODM
bool ApplyLight_ODM(struct StationaryLight *pLight, struct ODMFace *pFace, unsigned int *pSlot, bool bLightBackfaces)
Definition: LightmapBuilder.cpp:192
LightsData
Definition: Indoor.h:16
LightmapBuilder::_45CBD4
int _45CBD4(struct RenderVertexSoft *a2, int a3, int *a4, int *a5)
Definition: LightmapBuilder.cpp:969
LightsStack_StationaryLight_
Definition: Lights.h:46
Lightmap::field_C0E
__int16 field_C0E
Definition: LightmapBuilder.h:22
LightmapBuilder::ApplyLights_OutdoorFace
bool ApplyLights_OutdoorFace(struct ODMFace *pFace)
Definition: LightmapBuilder.cpp:48
ODMFace
Definition: BSPModel.h:93
LightmapBuilder::_45C4B9
int _45C4B9(int a2, struct RenderVertexSoft *a3, Lightmap *pLightmap)
Definition: LightmapBuilder.cpp:359
LightmapBuilder::MobileLights
Lightmap MobileLights[768]
Definition: LightmapBuilder.h:84
stru314
Definition: stru314.h:5
LightsStack_MobileLight_
Definition: Lights.h:73
LightmapBuilder::ApplyLights
bool ApplyLights(struct LightsData *a2, struct stru154 *a3, unsigned int uNumVertices, struct RenderVertexSoft *a5, struct IndoorCameraD3D_Vec4 *, char uClipFlag)
Definition: LightmapBuilder.cpp:494
LightmapBuilder::Draw_183808_Lightmaps
void Draw_183808_Lightmaps()
Definition: LightmapBuilder.cpp:835
RenderVertexSoft
Definition: IRender.h:113
LightmapBuilder::_45CB89
int _45CB89(struct RenderVertexSoft *a1, int a2)
Definition: LightmapBuilder.cpp:918
LightmapBuilder::_45D643_sw
double _45D643_sw(struct Edge *a1, float a2)
indices
GLuint GLuint GLsizei GLenum const GLvoid * indices
Definition: SDL_opengl.h:1571
LightmapBuilder::StationaryLightsCount
unsigned int StationaryLightsCount
Definition: LightmapBuilder.h:83
LightmapBuilder::StackLights_TerrainFace
bool StackLights_TerrainFace(struct Vec3_float_ *pNormal, float *a3, struct RenderVertexSoft *a1, unsigned int uStripType, bool bLightBackfaces)
Definition: LightmapBuilder.cpp:465
LightmapBuilder::field_3C8C34
RenderVertexSoft field_3C8C34[256]
Definition: LightmapBuilder.h:96
pStationaryLightsStack
LightsStack_StationaryLight_ * pStationaryLightsStack
Definition: LightmapBuilder.cpp:11
LightmapBuilder::StackLight_TerrainFace
bool StackLight_TerrainFace(struct StationaryLight *pLight, struct Vec3_float_ *pNormal, float *a3, struct RenderVertexSoft *a1, unsigned int uStripType, int X, unsigned int *pSlot)
Definition: LightmapBuilder.cpp:74