annotate Engine/Graphics/LightmapBuilder.h @ 2563:65c97624c047

Saving & loading works from both main menu and game
author a.parshin
date Tue, 19 May 2015 22:00:56 +0200
parents b8a56afc6ba1
children f2f2595fe308
rev   line source
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
1 #pragma once
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
2 #include <vector>
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
3 #include "Render.h"
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
4
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
5 struct LightsStack_StationaryLight_;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
6 struct LightsStack_MobileLight_;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
7
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
8 /* 115 */
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
9 #pragma pack(push, 1)
2532
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
10 struct Lightmap //карта света, текстура для наложения теней
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
11 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
12 Lightmap();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
13 virtual ~Lightmap() {}
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
14
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
15 //void ( ***vdestructor_ptr)(Lightmap *, bool);
2532
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
16 signed int NumVertices;
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
17 RenderVertexSoft pVertices[64];
2532
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
18 __int16 position_x; //позиция источника света
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
19 __int16 position_y;
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
20 __int16 position_z;
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
21 __int16 field_C0E; //нигде не используется
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
22 unsigned int uColorMask;
2532
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
23 float fBrightness; //яркость
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
24 int field_C18; //нигде не используется
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
25 };
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
26 #pragma pack(pop)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
27
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
28
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
29 /* 114 */
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
30 #pragma pack(push, 1)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
31 class LightmapBuilder
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
32 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
33 public:
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
34 LightmapBuilder();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
35 virtual ~LightmapBuilder() //----- (0045BBAA)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
36 {}
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
37
2532
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
38 void Draw_183808_Lightmaps(); //используется для мобильного света
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
39 //bool DrawLightmap(Lightmap *a1, Vec3_float_ *pColorMult, float z_bias);
2532
9ec6b8be16fe Mobile light
Ritor1
parents: 2531
diff changeset
40 bool DoDraw_183808_Lightmaps(float a2); //используется для мобильного света
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
41 bool DrawLightmaps(int indices);
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
42 void DrawLightmapsType(int type);
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
43 void DrawDebugOutlines(char bit_one_for_list1__bit_two_for_list2);
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
44 double _45D643_sw(struct Edge *a1, float a2);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
45 //int _45D426_sw(struct Span *a1, struct Edge **a2, unsigned int a3, struct Edge *a4, int a5);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
46 //bool _45D3C7_sw(struct Polygon *a1);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
47 bool StackLight_TerrainFace(struct StationaryLight *pLight, struct Vec3_float_ *pNormal, float *a3, struct RenderVertexSoft *a1, unsigned int uStripType, int X, unsigned int *pSlot);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
48 bool StackLights_TerrainFace(struct Vec3_float_ *pNormal, float *a3, struct RenderVertexSoft *a1, unsigned int uStripType, bool bLightBackfaces);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
49 bool ApplyLight_ODM(struct StationaryLight *pLight, struct ODMFace *pFace, unsigned int *pSlot, char a4);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
50 bool ApplyLights_OutdoorFace(struct ODMFace *pFace);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
51 double _45CC0C_light(struct Vec3_float_ a1, float a2, float a3, struct Vec3_float_ *pNormal, float a5, int uLightType);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
52 int _45CBD4(struct RenderVertexSoft *a2, int a3, int *a4, int *a5);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
53 int _45CB89(struct RenderVertexSoft *a1, int a2);
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
54 int _45CA88(struct LightsData *a2, struct RenderVertexSoft *a3, int a4, struct Vec3_float_ *pNormal);
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
55 bool ApplyLight_BLV(struct StationaryLight *pLight, struct BLVFace *a2, unsigned int *pSlot, bool bLightBackfaces, char *a5);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
56 bool ApplyLights_IndoorFace(unsigned int uFaceID);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
57 int _45C6D6(int a2, struct RenderVertexSoft *a3, Lightmap *pLightmap);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
58 int _45C4B9(int a2, struct RenderVertexSoft *a3, Lightmap *pLightmap);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
59 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);
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
60 bool ApplyLights(struct LightsData *a2, struct stru154 *a3, unsigned int uNumVertices, struct RenderVertexSoft *a5, struct IndoorCameraD3D_Vec4 *, char uClipFlag);
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
61
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
62
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
63 //void ( ***vdestructor_ptr)(LightmapBuilder *, bool);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
64 //std::vector<Lightmap> std__vector_000004;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
65 //std::vector<Lightmap> std__vector_183808;
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
66 Lightmap StationaryLights[512];//std__vector_000004
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
67 unsigned int StationaryLightsCount;//std__vector_000004_size
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
68 Lightmap MobileLights[768];//std__vector_183808
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
69 unsigned int MobileLightsCount;//std__vector_183808_size
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
70 float light_length_x;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
71 float light_length_y;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
72 float light_length_z;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
73 float light_length_x2;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
74 float light_length_y2;
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
75 float light_length_z2;
2531
f6de3e15d4a5 for light in indoor
Ritor1
parents: 2496
diff changeset
76 float tex_light_radius;//flt_3C8C24;
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
77 float flt_3C8C28;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
78 float flt_3C8C2C_lightmaps_brightness;
2562
b8a56afc6ba1 new var no_actors, lights_flag, debug_lights, StationaryLights and MobileLights
Ritor1
parents: 2532
diff changeset
79 float light_radius;
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
80 RenderVertexSoft field_3C8C34[256];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
81 int uFlags;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
82 };
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
83 #pragma pack(pop)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
84
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
85
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
86
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
87
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
88 extern LightsStack_StationaryLight_ *pStationaryLightsStack;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
89 //extern StationaryLight pStationaryLights[400];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
90 //extern int uNumStationaryLightsApplied; // weak
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
91 extern LightsStack_MobileLight_ *pMobileLightsStack;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
92 //extern MobileLight pMobileLights[400];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
93 //extern int uNumMobileLightsApplied;