annotate Engine/Graphics/Viewport.cpp @ 2575:a76d408c5132 tip

DrawTranslucent -> DrawTextureGrayShade Removed old texture drawing stuff
author a.parshin
date Wed, 09 Mar 2016 01:39:52 +0200
parents 4d199006c716
children
rev   line source
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
4
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
6
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
7 #include "Engine/Engine.h"
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
8
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
9 #include "Viewport.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
10 #include "Engine/Party.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
11 #include "Engine/OurMath.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
12 #include "Engine/Objects/Actor.h"
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
13 #include "Outdoor.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
14 #include "Engine/Events.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
15 #include "IO/Mouse.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
16 #include "Engine/Objects/SpriteObject.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
17 #include "Engine/Objects/ObjectList.h"
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
18 #include "DecorationList.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
19 #include "Engine/texts.h"
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
20 #include "Vis.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
21 #include "Engine/LOD.h"
2502
a77c34acdbc9 Media folder
Ritor1
parents: 2499
diff changeset
22 #include "GUI/GUIWindow.h"
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
23 #include "Engine/TurnEngine/TurnEngine.h"
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
24 #include "Engine/stru123.h"
2499
68cdef6879a0 engine folder
Ritor1
parents: 2496
diff changeset
25 #include "Level/Decoration.h"
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
26
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
27
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
28 //----- (004C0262) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
29 void Viewport::SetScreen( signed int sTL_X, signed int sTL_Y, signed int sBR_X, signed int sBR_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
30 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
31 unsigned int tl_x; // edx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
32 unsigned int br_x; // esi@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
33 unsigned int tl_y; // edi@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
34 unsigned int br_y; // eax@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
35
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
36 tl_x = sTL_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
37 br_x = sBR_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
38 if ( sTL_X > sBR_X )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
39 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
40 br_x = sTL_X; // swap x's
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
41 tl_x = sBR_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
42 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
43 tl_y = sTL_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
44 br_y = sBR_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
45 if ( sTL_Y > sBR_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
46 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
47 br_y = sTL_Y; // swap y's
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
48 tl_y = sBR_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
49 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
50 this->uScreen_TL_X = tl_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
51 this->uScreen_TL_Y = tl_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
52 this->uScreen_BR_X = br_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
53 this->uScreen_BR_Y = br_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
54 this->uScreenWidth = br_x - tl_x + 1;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
55 this->uScreenHeight = br_y - tl_y + 1;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
56 this->uScreenCenterX = (signed int)(br_x + tl_x) /2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
57 //if ( pRenderer->pRenderD3D == 0 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
58 // this->uScreenCenterY = this->uScreen_BR_Y - fixpoint_mul(field_30, uScreenHeight);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
59 //else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
60 this->uScreenCenterY = (br_y + tl_y)/2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
61 SetViewport(this->uScreen_TL_X, this->uScreen_TL_Y, this->uScreen_BR_X, this->uScreen_BR_Y);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
62 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
63
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
64 //----- (004C02F8) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
65 void Viewport::SetFOV(int field_of_view)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
66 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
67 this->field_of_view = field_of_view;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
68 SetScreen(uScreen_TL_X, uScreen_TL_Y, uScreen_BR_X, uScreen_BR_Y);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
69 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
70
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
71 //----- (004C0312) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
72 void Viewport::SetViewport( signed int sTL_X, signed int sTL_Y, signed int sBR_X, signed int sBR_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
73 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
74 signed int tl_x; // ebx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
75 signed int tl_y; // edi@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
76 signed int br_x; // edx@5
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
77 signed int br_y; // eax@7
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
78
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
79 tl_x = sTL_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
80 if ( sTL_X < this->uScreen_TL_X )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
81 tl_x = this->uScreen_TL_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
82 tl_y = sTL_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
83 if ( sTL_Y < this->uScreen_TL_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
84 tl_y = this->uScreen_TL_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
85 br_x = sBR_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
86 if ( sBR_X > this->uScreen_BR_X )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
87 br_x = this->uScreen_BR_X;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
88 br_y = sBR_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
89 if ( sBR_Y > this->uScreen_BR_Y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
90 br_y = this->uScreen_BR_Y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
91 this->uViewportTL_Y = tl_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
92 this->uViewportTL_X = tl_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
93 this->uViewportBR_X = br_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
94 this->uViewportBR_Y = br_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
95 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
96
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
97 //----- (00443219) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
98 void ViewingParams::_443219()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
99 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
100 this->sViewCenterY += 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
101
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
102 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
103 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
104
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
105 //----- (00443225) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
106 void ViewingParams::_443225()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
107 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
108 this->sViewCenterX -= 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
109
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
110 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
111 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
112
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
113 //----- (00443231) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
114 void ViewingParams::_443231()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
115 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
116 this->sViewCenterY -= 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
117
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
118 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
119 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
120
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
121 //----- (0044323D) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
122 void ViewingParams::_44323D()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
123 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
124 this->sViewCenterX += 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
125
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
126 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
127 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
128
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
129 //----- (00443249) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
130 void ViewingParams::CenterOnParty()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
131 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
132 this->uMapBookMapZoom = fixpoint_mul(0x8000, this->uMapBookMapZoom);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
133 if (this->uMapBookMapZoom < 384)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
134 this->uMapBookMapZoom = 384;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
135
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
136 this->sViewCenterX = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
137 this->sViewCenterY = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
138
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
139 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
140 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
141
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
142 //----- (00443291) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
143 void ViewingParams::CenterOnParty2()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
144 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
145 int v2; // eax@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
146
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
147 if (uCurrentlyLoadedLevelType == LEVEL_Outdoor)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
148 v2 = 1536;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
149 else if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
150 v2 = 3072;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
151 else assert(false);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
152
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
153 this->uMapBookMapZoom *= 2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
154 if (this->uMapBookMapZoom > v2 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
155 this->uMapBookMapZoom = v2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
156
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
157 this->sViewCenterX = pParty->vPosition.x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
158 this->sViewCenterY = pParty->vPosition.y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
159 AdjustPosition();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
160 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
161
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
162 //----- (004432E7) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
163 void ViewingParams::AdjustPosition()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
164 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
165 ViewingParams *v1; // esi@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
166 int v2; // ebx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
167 signed int v3; // edx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
168 int v4; // ecx@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
169 int v5; // edi@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
170 int v6; // eax@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
171 int v7; // eax@5
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
172
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
173
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
174 v1 = this;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
175 v2 = this->indoor_center_y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
176 v3 = 88 >> (this->uMapBookMapZoom / 384);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
177 v4 = (44 - v3) << 9;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
178 if ( v1->sViewCenterY > v2 + v4 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
179 v1->sViewCenterY = v2 + v4;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
180
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
181 v5 = v1->indoor_center_x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
182 v6 = (v3 - 44) << 9;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
183 if ( v1->sViewCenterX < v5 + v6 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
184 v1->sViewCenterX = v5 + v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
185
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
186 v7 = v2 + v6;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
187 if ( v1->sViewCenterY < v7 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
188 v1->sViewCenterY = v7;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
189
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
190 if ( v1->sViewCenterX > v5 + v4 )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
191 v1->sViewCenterX = v5 + v4;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
192 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
193
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
194 //----- (00443343) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
195 void ViewingParams::InitGrayPalette()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
196 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
197 for (unsigned short i=0; i<256; ++i)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
198 pPalette[i]=Color16(i, i, i);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
199 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
200
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
201 //----- (00443365) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
202 void ViewingParams::_443365()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
203 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
204 Vec3_short_ *v3; // eax@4
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
205 Vec3_short_ *v6; // eax@12
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
206 int minimum_y; // [sp+10h] [bp-10h]@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
207 int maximum_y; // [sp+14h] [bp-Ch]@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
208 int minimum_x; // [sp+18h] [bp-8h]@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
209 int maximum_x; // [sp+1Ch] [bp-4h]@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
210
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
211 InitGrayPalette();
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
212 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
213 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
214 minimum_x = 0x40000000;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
215 minimum_y = 0x40000000;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
216
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
217 maximum_x = -0x40000000;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
218 maximum_y = -0x40000000;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
219 for (int i=0; i<pIndoor->pMapOutlines->uNumOutlines; ++i)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
220 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
221 v3 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace1ID];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
222
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
223 if ( v3->x < minimum_x )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
224 minimum_x = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
225 if ( v3->x > maximum_x )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
226 maximum_x = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
227 if ( v3->y < minimum_y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
228 minimum_y = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
229 if ( v3->y > maximum_y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
230 maximum_y = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
231
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
232 v6 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace2ID];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
233
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
234 if ( v6->x < minimum_x )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
235 minimum_x = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
236 if ( v6->x > maximum_x )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
237 maximum_x = v3->x;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
238
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
239 if ( v6->y < minimum_y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
240 minimum_y = v3->y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
241 if ( v6->y > maximum_y )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
242 maximum_y = v3->y;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
243 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
244
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
245 uMinimapZoom = 1024;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
246 indoor_center_x = (signed int)(minimum_x + maximum_x) / 2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
247 field_28 = 10;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
248 indoor_center_y = (signed int)(minimum_y + maximum_y) / 2;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
249 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
250 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
251 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
252 indoor_center_x = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
253 indoor_center_y = 0;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
254 uMinimapZoom = _576E2C_current_minimap_zoom;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
255 field_28 = dword_576E28;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
256 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
257 uMapBookMapZoom = 384;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
258 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
259
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
260
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
261
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
262
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
263
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
264
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
265 void ItemInteraction(unsigned int item_id)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
266 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
267 if (pItemsTable->pItems[pSpriteObjects[item_id].containing_item.uItemID].uEquipType == EQUIP_GOLD)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
268 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
269 pParty->PartyFindsGold(pSpriteObjects[item_id].containing_item.special_enchantment, 0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
270 viewparams->bRedrawGameUI = 1;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
271 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
272 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
273 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
274 if (pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
275 return;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
276
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
277 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[pSpriteObjects[item_id].containing_item.uItemID].pUnidentifiedName);//You found an item (%s)!
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
278 ShowStatusBarString(pTmpBuf2.data(), 2);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
279 if (pSpriteObjects[item_id].containing_item.uItemID == ITEM_ARTIFACT_SPLITTER)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
280 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
281 if (pSpriteObjects[item_id].containing_item.uItemID == ITEM_SPELLBOOK_MIND_REMOVE_FEAR)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
282 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
283 if (!pParty->AddItemToParty(&pSpriteObjects[item_id].containing_item))
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
284 pParty->SetHoldingItem(&pSpriteObjects[item_id].containing_item);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
285 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
286 SpriteObject::OnInteraction(item_id);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
287 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
288
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
289 bool ActorInteraction(unsigned int id)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
290 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
291 if (!pActors[id].GetActorsRelation(0) && pActors[id].ActorFriend() && pActors[id].CanAct())
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
292 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
293 Actor::AI_FaceObject(id, 4, 0, 0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
294 if (pActors[id].sNPC_ID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
295 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_StartNPCDialogue, id, 0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
296 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
297 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
298 if (pNPCStats->pGroups_copy[pActors[id].uGroup])
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
299 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
300 if (pNPCStats->pCatchPhrases[pNPCStats->pGroups_copy[pActors[id].uGroup]])
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
301 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
302 pParty->uFlags |= 2;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
303 strcpy(byte_5B0938.data(), pNPCStats->pCatchPhrases[pNPCStats->pGroups_copy[pActors[id].uGroup]]);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
304 sub_4451A8_press_any_key(0, 0, 0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
305 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
306 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
307 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
308 return true;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
309 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
310 return false;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
311 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
312
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
313 void DecorationInteraction(unsigned int id, unsigned int pid)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
314 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
315 if (pLevelDecorations[id].uEventID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
316 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
317 EventProcessor(pLevelDecorations[id].uEventID, pid, 1);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
318 pLevelDecorations[id].uFlags |= LEVEL_DECORATION_VISIBLE_ON_MAP;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
319 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
320 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
321 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
322 if (pLevelDecorations[id].IsInteractive())
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
323 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
324 activeLevelDecoration = &pLevelDecorations[id];
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
325 EventProcessor(stru_5E4C90_MapPersistVars._decor_events[pLevelDecorations[id]._idx_in_stru123 - 75] + 380, 0, 1);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
326 activeLevelDecoration = nullptr;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
327 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
328 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
329 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
330
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
331
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
332 void DropHeldItem()
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
333 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
334 if (!pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
335 return;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
336
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
337 SpriteObject a1; // [sp+Ch] [bp-80h]@1
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
338 POINT *v1; // esi@3
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
339 __debugbreak();//no checker
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
340 int v6 = 0;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
341 a1.uType = (SPRITE_OBJECT_TYPE)pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
342 if ((signed int)pObjectList->uNumObjects <= 0)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
343 LOWORD(v6) = 0;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
344 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
345 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
346 auto v7 = (char *)&pObjectList->pObjects->uObjectID;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
347 while (pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID != *(short *)v7)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
348 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
349 ++v6;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
350 v7 += 56;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
351 if (v6 >= (signed int)pObjectList->uNumObjects)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
352 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
353 LOWORD(v6) = 0;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
354 break;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
355 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
356 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
357 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
358 a1.uObjectDescID = v6;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
359 a1.vPosition.y = pParty->vPosition.y;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
360 a1.spell_caster_pid = OBJECT_Player;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
361 a1.vPosition.x = pParty->vPosition.x;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
362 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
363 a1.uSoundID = 0;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
364 a1.uFacing = 0;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
365 a1.uAttributes = 8;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
366 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
367 a1.uSpriteFrameID = 0;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
368 memcpy(&a1.containing_item, &pParty->pPickedItem, 0x24u);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
369
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
370 extern int UnprojectX(int);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
371 //v9 = UnprojectX(v1->x);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
372 a1.Create(pParty->sRotationY + UnprojectX(v1->x), 184, 200, 0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
373 auto pTextureID = pIcons_LOD->LoadTexture(pParty->pPickedItem.GetIconName(), TEXTURE_16BIT_PALETTE);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
374 if (pTextureID != -1)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
375 pIcons_LOD->pTextures[pTextureID].Release();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
376 pMouse->RemoveHoldingItem();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
377 pIcons_LOD->SyncLoadedFilesCount();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
378 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
379
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
380
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
381 //----- (0042213C) --------------------------------------------------------
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
382 void OnGameViewportClick()
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
383 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
384 signed int v0; // ebx@2
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
385 POINT *v1; // esi@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
386 signed int v6; // eax@14
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
387 char *v7; // esi@15
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
388 int v9; // eax@19
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
389 unsigned int pTextureID; // eax@19
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
390 int pEventID; // ecx@21
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
391 int v15; // ecx@29
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
392 // signed int v16; // edx@30
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
393 // int v18; // ebx@47
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
394 // signed int v21; // eax@58
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
395 SpriteObject a1; // [sp+Ch] [bp-80h]@1
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
396 POINT a2; // [sp+84h] [bp-8h]@3
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
397
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
398 int clickable_distance = 512;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
399
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
400 v1 = pMouse->GetCursorPos(&a2);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
401 //if ( pRenderer->pRenderD3D )
2541
a902abdfc7f2 1. Renamed class Game to class Engine.
a.parshin
parents: 2502
diff changeset
402 v0 = pEngine->pVisInstance->get_picked_object_zbuf_val();
2570
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
403 int distance = HIWORD(v0);
4d199006c716 debug_terrain_polygin
Ritor1
parents: 2567
diff changeset
404 bool in_range = distance < clickable_distance;
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
405 //else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
406 // v0 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[v1->y]];
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
407
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
408 if ( PID_TYPE(v0) == OBJECT_Item)
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
409 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
410 int item_id = PID_ID(v0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
411 //v21 = (signed int)(unsigned __int16)v0 >> 3;
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
412 if (pObjectList->pObjects[pSpriteObjects[item_id].uObjectDescID].uFlags & 0x10 || item_id >= 1000 || !pSpriteObjects[item_id].uObjectDescID
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
413 || !in_range)
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
414 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
415 if (pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
416 DropHeldItem();
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
417 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
418 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
419 ItemInteraction(item_id);
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
420 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
421 else if ( PID_TYPE(v0) == OBJECT_Actor)
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
422 {
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
423 int mon_id = PID_ID(v0);
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
424 //a2.y = v16;
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
425 if ( pActors[mon_id].uAIState == Dead )
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
426 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
427 if (in_range)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
428 pActors[mon_id].LootActor();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
429 else if (pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
430 DropHeldItem();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
431 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
432 else if ( GetAsyncKeyState(VK_SHIFT) >= 0 )
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
433 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
434 if (!in_range)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
435 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
436 if (pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
437 DropHeldItem();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
438 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
439 else if (!ActorInteraction(mon_id))
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
440 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
441 if (pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
442 pTurnEngine->field_18 |= TE_FLAG_8;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
443 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
444 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Attack, 0, 0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
445 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
446 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
447 else if ( pParty->bTurnBasedModeOn == true && pTurnEngine->turn_stage == TE_MOVEMENT )
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
448 pParty->uFlags |= PARTY_FLAGS_1_FALLING;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
449 else if ( uActiveCharacter && sub_427769_isSpellQuickCastableOnShiftClick(pPlayers[uActiveCharacter]->uQuickSpell))
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
450 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_CastQuickSpell, 0, 0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
451 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
452 else if ( PID_TYPE(v0) == OBJECT_Decoration)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
453 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
454 int id = PID_ID(v0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
455 if (distance - pDecorationList->pDecorations[pLevelDecorations[id].uDecorationDescID].uRadius >= clickable_distance)
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
456 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
457 if (pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
458 DropHeldItem();
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
459 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
460 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
461 DecorationInteraction(id, v0);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
462 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
463 else if (PID_TYPE(v0) == OBJECT_BModel && in_range)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
464 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
465 if (uCurrentlyLoadedLevelType == LEVEL_Indoor)
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
466 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
467 if (!pIndoor->pFaces[PID_ID(v0)].Clickable())
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
468 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
469 if (!pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
470 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
471 ShowNothingHereStatus();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
472 if (!pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
473 return;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
474 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
475 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
476 DropHeldItem();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
477 }
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
478 else
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
479 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
480 pEventID = pIndoor->pFaceExtras[pIndoor->pFaces[PID_ID(v0)].uFaceExtraID].uEventID;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
481 EventProcessor(pEventID, (unsigned __int16)v0, 1);
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
482 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
483 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
484 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor)
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
485 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
486 if (!pOutdoor->pBModels[(signed int)(v0 & 0xFFFF) >> 9].pFaces[PID_ID(v0) & 0x3F].Clickable())
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
487 {
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
488 if (!pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
489 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
490 ShowNothingHereStatus();
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
491 if (!pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
492 return;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
493 }
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
494 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
495 DropHeldItem();
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
496 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
497 else
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
498 {
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
499 pEventID = pOutdoor->pBModels[(signed int)(v0 & 0xFFFF) >> 9].pFaces[PID_ID(v0) & 0x3F].sCogTriggeredID;
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
500 EventProcessor(pEventID, (unsigned __int16)v0, 1);
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
501 }
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
502 }
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
503 }
2567
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
504 else if (pParty->pPickedItem.uItemID)
d569340b05ff Few constants changed into enum values
a.parshin
parents: 2566
diff changeset
505 DropHeldItem();
2496
5abd8fc8f1c6 for ITEM_ARTIFACT_LADYS_ESCORT
Ritor1
parents:
diff changeset
506 }