summaryrefslogtreecommitdiff
path: root/src/peds/PedDebug.cpp
blob: 0dbabb58896922a7105c80c7956ff8e9d9c3737c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
#include "common.h"
#ifndef MASTER
#include "main.h"
#include "Camera.h"
#include "Font.h"
#include "Ped.h"
#include "Sprite.h"
#include "Text.h"

static char ObjectiveText[][28] = {
	"No Obj",
	"Wait on Foot",
	"Wait on Foot for cop",
	"Flee on Foot Till Safe",
	"Guard Spot",
	"Guard Area",
	"Wait in Car",
	"Wait in Car then Getout",
	"Kill Char on Foot",
	"Kill Char Any Means",
	"Flee Char on Foot Till Safe",
	"Flee Char on Foot Always",
	"GoTo Char on Foot",
	"GoTo Char on Foot walking",
	"Hassle char",
	"Follow Char in Formation",
	"Leave Car",
	"Enter Car as Passenger",
	"Enter Car as Driver",
	"Follow Car in Car",
	"Fire at Obj from Vehicle",
	"Destroy Obj",
	"Destroy Car",
	"GoTo Area Any Means",
	"GoTo Area on Foot",
	"Run to Area",
	"GoTo Area in Car",
	"Follow Car on Foot Woffset",
	"Guard Attack",
	"Set Leader",
	"Follow Route",
	"Solicit vehicle",
	"Take Taxi",
	"Catch Train",
	"Buy IceCream",
	"Steal Any Car",
	"Steal any mission car",
	"Mug Char",
	"Lv car die",
	"Goto seat",
	"Goto atm",
	"Flee car",
	"Sunbathe",
	"Goto bus stop",
	"Goto pizza",
	"Goto shelter",
	"Aim gun at",
	"Wander",
	"Wait on foot at shltr",
	"Sprint to area",
	"Kill char on boat",
	"Solicit ped",
	"Wait at bus stop",
	"Goto ice cream van foot",
	"Wait foot icecream van"
};

static char StateText[][18] = {
	"None",
	"Idle",
	"Look Entity",
	"Look Heading",
	"Wander Range",
	"Wander Path",
	"Seek Pos",
	"Seek Entity",
	"Flee Pos",
	"Flee Entity",
	"Pursue",
	"Follow Path",
	"Sniper Mode",
	"Rocket Mode",
	"Dummy",
	"Pause",
	"Attack",
	"Fight",
	"Face Phone",
	"Make Call",
	"Chat",
	"Mug",
	"AimGun",
	"AI Control",
	"Seek Car",
	"Seek InBoat",
	"Follow Route",
	"C.P.R.",
	"Solicit",
	"Buy IceCream",
	"Investigate",
	"Step away",
	"On Fire",
	"Bathe",
	"Flash",
	"Jog",
	"Answer mobile",
	"Hang out",
	"STATES_NO_AI",
	"Abseil",
	"Sit",
	"Jump",
	"Fall",
	"GetUp",
	"Stagger",
	"Dive away",
	"STATES_NO_ST",
	"Enter Train",
	"Exit Train",
	"Arrest Plyr",
	"Driving",
	"Passenger",
	"Taxi Passngr",
	"Open Door",
	"Die",
	"Dead",
	"CarJack",
	"Drag fm Car",
	"Enter Car",
	"Steal Car",
	"Exit Car",
	"Hands Up",
	"Arrested",
	"Deply stgr"
};

static char PersonalityTypeText[][18] = {
	"Player",
	"Cop",
	"Medic",
	"Fireman",
	"Gang 1",
	"Gang 2",
	"Gang 3",
	"Gang 4",
	"Gang 5",
	"Gang 6",
	"Gang 7",
	"Street Guy",
	"Suit Guy",
	"Sensible Guy",
	"Geek Guy",
	"Old Guy",
	"Tough Guy",
	"Street Girl",
	"Suit Girl",
	"Sensible Girl",
	"Geek Girl",
	"Old Girl",
	"Tough Girl",
	"Tramp",
#ifdef FIX_BUGS // there's male and female ones
	"Tramp",
#endif
	"Tourist",
	"Prostitute",
	"Criminal",
	"Busker",
	"Taxi Driver",
	"Psycho",
	"Steward",
	"Sports Fan",
};

static char WaitStateText[][16] = {
	"No Wait",
	"Traffic Lights",
	"Pause CrossRoad",
	"Look CrossRoad",
	"Look Ped",
	"Look Shop",
	"Look Accident",
	"FaceOff Gang",
	"Double Back",
	"Hit Wall",
	"Turn 180deg",
	"Surprised",
	"Ped Stuck",
	"Look About",
	"Play Duck",
	"Play Cower",
	"Play Taxi",
	"Play HandsUp",
	"Play HandsCower",
	"Play Chat",
	"Finish Flee",
	"Sit down",
	"Sit down rvrs",
	"Sit up",
	"Sit idle",
	"Use atm",
	"Sunbth pre",
	"Sunbth down",
	"Sunbth idle",
	"Riot",
	"Fast fall",
	"Bomber",
	"Stripper",
	"Ground attack",
	"Lance sitting",
	"Handsup simple"
};

void
CPed::DebugDrawPedDestination(CPed *, int, int)
{
#ifndef FINAL
	// TODO: something was here
#endif // !FINAL
}

void
CPed::DebugDrawPedDesiredHeading(CPed *, int, int)
{
#ifndef FINAL
	// TODO: something was here
#endif // !FINAL
}

void
CPed::DebugDrawCollisionRadius(float, float, float, float, int)
{
#ifndef FINAL
	// TODO: something was here
#endif // !FINAL
}

void
CPed::DebugDrawVisionRange(CVector a1, float)
{
	for (int i = a1.x - 90; i < a1.x + 89; i += 30) {
#ifndef FINAL
		// TODO: something was here
#endif // !FINAL
	}
}

void
CPed::DebugDrawVisionSimple(CVector, float)
{
#ifndef FINAL
	// TODO: something was here
#endif // !FINAL
}

void
CPed::DebugDrawLook()
{
#ifndef FINAL
	// TODO: something was here
#endif // !FINAL
}

void
CPed::DebugDrawPedPsyche()
{
#ifndef FINAL
	// TODO: something was here
#endif // !FINAL
}

void
CPed::DebugDrawDebugLines()
{
#ifndef FINAL
	// TODO: something was here
#endif // !FINAL
}

int nDisplayDebugInfo = 0;

void
CPed::SwitchDebugDisplay(void)
{
	if (++nDisplayDebugInfo > 2)
		nDisplayDebugInfo = 0;
}

int
CPed::GetDebugDisplay(void)
{
	return nDisplayDebugInfo;
}

void
CPed::DebugDrawLookAtPoints()
{
	// TODO: mobile code
}

void
CPed::DebugRenderOnePedText(void)
{
	if ((GetPosition() - TheCamera.GetPosition()).MagnitudeSqr() < sq(30.0f)) {
		float width, height;
		RwV3d screenCoords;
		CVector bitAbove = GetPosition();
		bitAbove.z += 2.0f;
		if (CSprite::CalcScreenCoors(bitAbove, &screenCoords, &width, &height, true)) {

			float lineHeight = SCREEN_SCALE_Y(Min(height / 100.0f, 0.7f) * 22.0f);

			DefinedState();
			CFont::SetPropOn();
			CFont::SetBackgroundOn();

			// Originally both of them were being divided by 60.0f.
			float xScale = Min(width / 240.0f, 0.7f);
			float yScale = Min(height / 80.0f, 0.7f);

			CFont::SetScale(SCREEN_SCALE_X(xScale), SCREEN_SCALE_Y(yScale));
			CFont::SetCentreOn();
			CFont::SetCentreSize(SCREEN_WIDTH);
			CFont::SetJustifyOff();
			CFont::SetColor(CRGBA(255, 255, 0, 255));
			CFont::SetBackGroundOnlyTextOn();
			CFont::SetFontStyle(1);
			AsciiToUnicode(StateText[m_nPedState], gUString);
			CFont::PrintString(screenCoords.x, screenCoords.y, gUString);
			AsciiToUnicode(ObjectiveText[m_objective], gUString);
			CFont::PrintString(screenCoords.x, screenCoords.y + lineHeight, gUString);
			AsciiToUnicode(PersonalityTypeText[m_pedStats->m_type], gUString);
			CFont::PrintString(screenCoords.x, screenCoords.y + 2 * lineHeight, gUString);
			AsciiToUnicode(WaitStateText[m_nWaitState], gUString);
			CFont::PrintString(screenCoords.x, screenCoords.y + 3 * lineHeight, gUString);
			if (m_nPedState == PED_SEEK_POS || m_nPedState == PED_SEEK_ENTITY) {
				sprintf(gString, "Safe distance to target: %.2f", m_distanceToCountSeekDone);
				AsciiToUnicode(gString, gUString);
				CFont::PrintString(screenCoords.x, screenCoords.y + 4 * lineHeight, gUString);
			}
			DefinedState();
		}
	}
}

void
CPed::DebugRenderClosePedText()
{
	// TODO: mobile code
}
#endif