Mercurial > mm7
annotate Vis.h @ 2407:378e5732ba38
Слияние
author | Ritor1 |
---|---|
date | Wed, 09 Jul 2014 18:19:54 +0600 |
parents | 701dc2f4956b |
children |
rev | line source |
---|---|
0 | 1 #pragma once |
2 #include "Render.h" | |
3 | |
4 | |
5 | |
194 | 6 enum VisObjectType: unsigned __int32 |
7 { | |
8 VisObjectType_Any = 0, | |
9 VisObjectType_Sprite = 1, | |
10 VisObjectType_Face = 2 | |
11 }; | |
12 | |
13 /* 150 */ | |
14 #pragma pack(push, 1) | |
15 struct Vis_SelectionFilter //stru157 | |
16 { | |
17 VisObjectType object_type; | |
18 int object_id; // OBJECT_Actor, OBJECT_Player etc | |
1322 | 19 int at_ai_state; |
20 int no_at_ai_state; | |
21 int select_flags; | |
194 | 22 }; |
23 #pragma pack(pop) | |
24 extern Vis_SelectionFilter vis_sprite_filter_1; // 00F93E1C | |
25 extern Vis_SelectionFilter vis_sprite_filter_2; // 00F93E30 | |
26 extern Vis_SelectionFilter vis_face_filter; // 00F93E44 | |
27 extern Vis_SelectionFilter vis_door_filter; // 00F93E58 | |
28 extern Vis_SelectionFilter vis_sprite_filter_3; // 00F93E6C | |
29 extern Vis_SelectionFilter vis_sprite_filter_4; // static to sub_44EEA7 | |
0 | 30 |
31 | |
32 | |
33 #pragma pack(push, 1) | |
194 | 34 struct Vis_ObjectInfo |
0 | 35 { |
194 | 36 void *object; |
37 union | |
38 { | |
39 int sZValue; | |
40 struct | |
41 { | |
42 unsigned __int16 object_pid; | |
43 signed __int16 actual_z; | |
44 }; | |
45 }; | |
46 VisObjectType object_type; | |
0 | 47 }; |
48 #pragma pack(pop) | |
49 | |
194 | 50 |
0 | 51 #pragma pack(push, 1) |
194 | 52 struct Vis_SelectionList |
0 | 53 { |
194 | 54 enum PointerCreationType |
55 { | |
56 All = 0, | |
57 Unique = 1 | |
58 }; | |
59 | |
60 Vis_SelectionList(); | |
0 | 61 //----- (004C0585) -------------------------------------------------------- |
194 | 62 ~Vis_SelectionList() {} |
1137 | 63 Vis_ObjectInfo *SelectionPointers(int a2, int a3); |
194 | 64 void create_object_pointers(PointerCreationType type = All); |
0 | 65 |
194 | 66 inline void AddObject(void *object, VisObjectType type, int packed_zval) |
67 { | |
68 object_pool[uNumPointers].object = object; | |
69 object_pool[uNumPointers].object_type = type; | |
70 object_pool[uNumPointers++].sZValue = packed_zval; | |
71 } | |
72 | |
1458 | 73 void ( ***vdestructor_ptr)(Vis_SelectionList *, bool); |
194 | 74 Vis_ObjectInfo object_pool[512]; |
75 Vis_ObjectInfo *object_pointers[512]; | |
76 unsigned int uNumPointers; | |
0 | 77 }; |
78 #pragma pack(pop) | |
79 | |
80 | |
81 | |
82 /* 116 */ | |
83 #pragma pack(push, 1) | |
1103 | 84 class Vis |
0 | 85 { |
1103 | 86 public: |
0 | 87 Vis(); |
88 //----- (004C05A2) -------------------------------------------------------- | |
89 //virtual ~Vis() {} | |
90 //----- (004C05BE) -------------------------------------------------------- | |
522 | 91 virtual ~Vis() {} |
194 | 92 bool PickKeyboard(Vis_SelectionList *list, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter); |
196 | 93 void PickBillboards_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter); |
94 void PickIndoorFaces_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter); | |
95 void PickOutdoorFaces_Keyboard(float pick_depth, Vis_SelectionList *list, Vis_SelectionFilter *filter); | |
96 | |
194 | 97 bool PickMouse(float fDepth, float fMouseX, float fMouseY, Vis_SelectionFilter *sprite_filter, Vis_SelectionFilter *face_filter); |
98 void PickBillboards_Mouse(float fPickDepth, float fX, float fY, Vis_SelectionList *list, Vis_SelectionFilter *filter); | |
196 | 99 void PickIndoorFaces_Mouse(float fDepth, struct RenderVertexSoft *pRay, Vis_SelectionList *list, Vis_SelectionFilter *filter); |
323 | 100 void PickOutdoorFaces_Mouse(float fDepth, struct RenderVertexSoft *pRay, Vis_SelectionList *list, Vis_SelectionFilter *filter, bool only_reachable); |
196 | 101 |
194 | 102 bool is_part_of_selection(void *uD3DBillboardIdx_or_pBLVFace_or_pODMFace, Vis_SelectionFilter *filter); |
0 | 103 bool DoesRayIntersectBillboard(float fDepth, unsigned int uD3DBillboardIdx); |
916 | 104 Vis_ObjectInfo *DetermineFacetIntersection(struct BLVFace *face, unsigned int a3, float pick_depth); |
196 | 105 bool IsPolygonOccludedByBillboard(struct RenderVertexSoft *vertices, int num_vertices, float x, float y); |
0 | 106 void GetPolygonCenter(struct RenderVertexD3D3 *pVertices, unsigned int uNumVertices, float *pCenterX, float *pCenterY); |
196 | 107 void GetPolygonScreenSpaceCenter(struct RenderVertexSoft *vertices, int num_vertices, float *out_center_x, float *out_center_y); |
0 | 108 bool IsPointInsideD3DBillboard(struct RenderBillboardD3D *a1, float x, float y); |
295 | 109 int PickClosestActor(int object_id, unsigned int pick_depth, int a4, int a5, int a6); |
0 | 110 void _4C1A02(); |
2150 | 111 void SortVectors_x(RenderVertexSoft *pArray, int start, int end); |
194 | 112 int get_object_zbuf_val(Vis_ObjectInfo *info); |
0 | 113 int get_picked_object_zbuf_val(); |
2006 | 114 bool Intersect_Ray_Face(struct RenderVertexSoft *pRayStart, struct RenderVertexSoft *pRayEnd, float *pDepth, RenderVertexSoft *Intersection, BLVFace *pFace, signed int pBModelID); |
115 bool CheckIntersectBModel(BLVFace *pFace, Vec3_short_ IntersectPoint, signed int sModelID); | |
1050 | 116 void BLV_CreateIntersectFacesVertexCoordList(int *a, int *b, __int16 *intersect_face_vertex_coords_list_a, __int16 *intersect_face_vertex_coords_list_b, Vec3_short_ *IntersectPoint, BLVFace *pFace); |
117 void ODM_CreateIntersectFacesVertexCoordList(int *a, int *b, __int16 *intersect_face_vertex_coords_list_a, __int16 *intersect_face_vertex_coords_list_b, Vec3_short_ *IntersectPoint, BLVFace *pFace, unsigned int uModelID); | |
0 | 118 void CastPickRay(RenderVertexSoft *pRay, float fMouseX, float fMouseY, float fPickDepth); |
1322 | 119 void sort_object_pointers(Vis_ObjectInfo **pPointers, int start, int end); |
2150 | 120 void SortVerticesByX(struct RenderVertexD3D3 *pArray, unsigned int uStart, unsigned int uEnd); |
121 void SortVerticesByY(struct RenderVertexD3D3 *pArray, unsigned int uStart, unsigned int uEnd); | |
2149
d4f00d622889
SortByScreenSpaceX and SortByScreenSpaceY for Vis fix
Ritor1
parents:
2006
diff
changeset
|
122 void SortByScreenSpaceX(struct RenderVertexSoft *pArray, int start, int end); |
d4f00d622889
SortByScreenSpaceX and SortByScreenSpaceY for Vis fix
Ritor1
parents:
2006
diff
changeset
|
123 void SortByScreenSpaceY(struct RenderVertexSoft *pArray, int start, int end); |
0 | 124 |
1458 | 125 //void ( ***vdestructor_ptr)(Vis *, bool); |
194 | 126 Vis_SelectionList default_list; |
127 RenderVertexSoft stru_200C; | |
128 RenderVertexSoft stru_203C; | |
129 RenderVertexSoft stru_206C; | |
130 RenderVertexSoft stru_209C; | |
196 | 131 int keyboard_pick_depth; |
0 | 132 }; |
133 #pragma pack(pop) |