Debian Codegraph @

Descent3/TelComGoals.cpp

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/TelComGoals.cpp $
21 * $Revision: 17 $
22 * $Date: 4/20/99 1:45a $
23 * $Author: Matt $
24 *
25 * TelCom Goal Status screen
26 *
27 * $Log: /DescentIII/main/TelComGoals.cpp $
28 *
29 * 17 4/20/99 1:45a Matt
30 * Fixed a dereferencing bug that was causing this screen to use totally
31 * different fonts than the code intended. It now uses the two briefing
32 * fonts.
33 *
34 * 16 4/17/99 6:15p Samir
35 * replaced gr.h with grdefs.h and fixed resulting compile bugs.
36 *
37 * 15 4/14/99 3:57a Jeff
38 * fixed case mismatch in #includes
39 *
40 * 14 4/05/99 3:28p Jeff
41 * failed mission added to telcom goal screen
42 *
43 * 13 4/02/99 9:24p Jeff
44 * fixed tooltip detection
45 *
46 * 12 3/31/99 5:34p Jeff
47 * fixed 0 byte malloc
48 *
49 * 11 3/27/99 2:59p Jeff
50 * handle multiple line goals...tooltips don't go off screen now
51 *
52 * 10 3/24/99 3:01p Jeff
53 * fixed 0 byte malloc
54 *
55 * 9 2/27/99 2:48p Jeff
56 * adjust to bottom right corner of mouse pointer (tool tips)
57 *
58 * 7 2/26/99 5:01p Jeff
59 * added background screen and some new artwork
60 *
61 * 6 2/26/99 12:07a Jeff
62 * fixed up tooltip stuff
63 *
64 * 5 2/24/99 9:39p Jeff
65 * updated
66 *
67 * 4 2/21/99 9:06p Jeff
68 * fixed bug where nothing would display on the screen if there were
69 * goals, but none are enabled or viewable by telcom
70 *
71 * 3 2/20/99 9:22p Jeff
72 * finished telcom level goals screen. Made it so if you go into the
73 * telcom from the game it goes to main menu instead of briefings.
74 *
75 * 2 2/20/99 4:37p Jeff
76 * added telcomgoals
77 *
78 * 1 2/20/99 4:31p Jeff
79 *
80 * $NoKeywords: $
81 */
82
83 #include "TelComGoals.h"cxx . . $ `<file>/Descent3/TelComGoals.h`/
84 #include <stdlib.h>
85 #include <string.h>
86 #include <ctype.h>
87
88 #include "cfile.h"cxx . . $ `<file>/cfile/cfile.h`/
89 #include "pserror.h"cxx . . $ `<file>/misc/pserror.h`/
90 #include "ddio.h"cxx . . $ `<file>/ddio/ddio.h`/
91 #include "bitmap.h"cxx . . $ `<file>/lib/bitmap.h`/
92
93 #include "TelCom.h"cxx . . $ `<file>/Descent3/TelCom.h`/
94 #include "renderer.h"cxx . . $ `<file>/lib/renderer.h`/
95 #include "game.h"cxx . . $ `<file>/Descent3/game.h`/
96 #include "mem.h"cxx . . $ `<file>/mem/mem.h`/
97 #include "stringtable.h"cxx . . $ `<file>/Descent3/stringtable.h`/
98 #include "gametexture.h"cxx . . $ `<file>/Descent3/gametexture.h`/
99 #include "textaux.h"cxx . . $ `<file>/lib/textaux.h`/
100 #include "TelComEfxStructs.h"cxx . . $ `<file>/Descent3/TelComEfxStructs.h`/
101 #include "TelComEffects.h"cxx . . $ `<file>/Descent3/TelComEffects.h`/
102 #include "levelgoal.h"cxx . . $ `<file>/Descent3/levelgoal.h`/
103 #include "textaux.h"cxx . . $ `<file>/lib/textaux.h`/
104 #include "Mission.h"cxx . . $ `<file>/Descent3/Mission.h`/
105 #include "Macros.h"cxx . . $ `<file>/lib/Macros.h`/
106 #include "hlsoundlib.h"cxx . . $ `<file>/sndlib/hlsoundlib.h`/
107
108 #include <algorithm>
109
110 #define TITLE_Xcxx . . $ `Descent3/TelComGoals.cpp:110:9`! 30 + TGminx
111 #define VALUE_Xcxx . . $ `Descent3/TelComGoals.cpp:111:9`! 400 + TGminx
112 int TGminxcxx . . $ TGminx., TGmaxxcxx . . $ TGmaxx., TGminycxx . . $ TGminy., TGmaxycxx . . $ TGmaxy.;
113 #define SM_FONTcxx . . $ `Descent3/TelComGoals.cpp:113:9`! BRIEFING_FONTcxx . . $ `Descent3/gamefont.h:111:9`!
114 #define BG_FONTcxx . . $ `Descent3/TelComGoals.cpp:114:9`! BIG_BRIEFING_FONTcxx . . $ `Descent3/gamefont.h:112:9`!
115
116 #define UI_RIGHT_ARROW_CHARcxx . . $ `Descent3/TelComGoals.cpp:116:9`! 26
117
118 struct tGoalLineInfocxx . . $ tGoalLineInfo# {
119 bool primarycxx . . $ tGoalLineInfo#primary.;
120 bool is_objectivecxx . . $ tGoalLineInfo#is_objective.;
121 bool is_activecxx . . $ tGoalLineInfo#is_active.;
122 int goal_indexcxx . . $ tGoalLineInfo#goal_index.;
123 int lxcxx . . $ tGoalLineInfo#lx., rxcxx . . $ tGoalLineInfo#rx., tycxx . . $ tGoalLineInfo#ty., bycxx . . $ tGoalLineInfo#by.; // bounding box
124 };
125
126 static tGoalLineInfocxx . . $ tGoalLineInfo# *TG_Linescxx . . $ TG_Lines.;
127 static int TG_NumLinescxx . . $ TG_NumLines.;
128 static int *TG_SortedListcxx . . $ TG_SortedList.;
129 static int TG_CurrObjectiveArrowcxx . . $ TG_CurrObjectiveArrow.;
130
131 struct tToolTipDatacxx . . $ tToolTipData# {
132 int wcxx . . $ tToolTipData#w., hcxx . . $ tToolTipData#h.;
133 };
134
135 static tToolTipDatacxx . . $ tToolTipData# TG_TT_destcxx . . $ TG_TT_dest.;
136 static tToolTipDatacxx . . $ tToolTipData# TG_TT_currcxx . . $ TG_TT_curr.;
137 static chunked_bitmapcxx . . $ chunked_bitmap# TG_Tooltipbitmapcxx . . $ TG_Tooltipbitmap.;
138 static int TG_MouseOffset_xcxx . . $ TG_MouseOffset_x. = -1, TG_MouseOffset_ycxx . . $ TG_MouseOffset_y. = -1;
139 // returns true if left < right
140 bool TG_compare_slotscxx . . $ TG_compare_slots(cf9ef193275fa6d8).(int left, int right) {
141 int left_index, right_index;
142 int left_priority, right_priority;
143 char left_list, right_list;
144
145 left_index = TG_Linescxx . . $ TG_Lines.[left].goal_indexcxx . . $ tGoalLineInfo#goal_index.;
146 right_index = TG_Linescxx . . $ TG_Lines.[right].goal_indexcxx . . $ tGoalLineInfo#goal_index.;
147
148 // Primaries have precedence over secondaries
149 if (TG_Linescxx . . $ TG_Lines.[left].primarycxx . . $ tGoalLineInfo#primary. && !TG_Linescxx . . $ TG_Lines.[right].primarycxx . . $ tGoalLineInfo#primary.)
150 return false; // right is a secondary, left is a primary
151 if (!TG_Linescxx . . $ TG_Lines.[left].primarycxx . . $ tGoalLineInfo#primary. && TG_Linescxx . . $ TG_Lines.[right].primarycxx . . $ tGoalLineInfo#primary.)
152 return true; // right is a primary, left is secondary
153
154 Level_goalscxx . . $ Level_goals..GoalPrioritycxx . . $ levelgoals#GoalPriority(f3551096b2e9a55d).(left_index, LO_GET_SPECIFIEDcxx . . $ `Descent3/levelgoal_external.h:34:9`!, &left_priority);
155 Level_goalscxx . . $ Level_goals..GoalPrioritycxx . . $ levelgoals#GoalPriority(f3551096b2e9a55d).(right_index, LO_GET_SPECIFIEDcxx . . $ `Descent3/levelgoal_external.h:34:9`!, &right_priority);
156 Level_goalscxx . . $ Level_goals..GoalGoalListcxx . . $ levelgoals#GoalGoalList(5a6a60347df10d71).(left_index, LO_GET_SPECIFIEDcxx . . $ `Descent3/levelgoal_external.h:34:9`!, &left_list);
157 Level_goalscxx . . $ Level_goals..GoalGoalListcxx . . $ levelgoals#GoalGoalList(5a6a60347df10d71).(right_index, LO_GET_SPECIFIEDcxx . . $ `Descent3/levelgoal_external.h:34:9`!, &right_list);
158
159 // check goal list...the lower has priority
160 if (left_list < right_list)
161 return false;
162 if (right_list < left_list)
163 return true;
164
165 // the have same goal list, if it's an object, then that has priority, else sort by
166 // goal priority
167 if (TG_Linescxx . . $ TG_Lines.[left].is_objectivecxx . . $ tGoalLineInfo#is_objective.)
168 return false;
169 if (TG_Linescxx . . $ TG_Lines.[right].is_objectivecxx . . $ tGoalLineInfo#is_objective.)
170 return true;
171
172 // they are both goals, and not objectives, check based on priority
173 return (left_priority > right_priority);
174 }
175
176 void TCGoalsBuildLineDatacxx . . $ TCGoalsBuildLineData(49f6e7a06ebc5aa8).(void) {
177 int number_of_goals = Level_goalscxx . . $ Level_goals..GetNumGoalscxx . . $ levelgoals#GetNumGoals(b126dc7c1de90089).();
178 int index, goal_status, count = 0, i;
179
180 // see how many of these are something we want
181 for (index = 0; index < number_of_goals; index++) {
182 Level_goalscxx . . $ Level_goals..GoalStatuscxx . . $ levelgoals#GoalStatus(a197d185bbe4f6f0).(index, LO_GET_SPECIFIEDcxx . . $ `Descent3/levelgoal_external.h:34:9`!, &goal_status);
183
184 if (goal_status & LGF_ENABLEDcxx . . $ `Descent3/levelgoal_external.h:40:9`!)
185 count++;
186 }
187
188 //'count' goals are what we have to display
189 // allocate memory needed and start filling in
190 if (count) {
191 TG_Linescxx . . $ TG_Lines. = (tGoalLineInfocxx . . $ tGoalLineInfo# *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(tGoalLineInfo) * count);
192 TG_NumLinescxx . . $ TG_NumLines. = count;
193 TG_SortedListcxx . . $ TG_SortedList. = (int *)mem_malloccxx . . $ `mem/mem.h:79:9`!(sizeof(int) * count);
194 if (!TG_SortedListcxx . . $ TG_SortedList. || !TG_Linescxx . . $ TG_Lines.) {
195 // out of memory
196 Telcom_systemcxx . . $ Telcom_system..current_statuscxx . . $ tTelComInfo#current_status. = TS_OFFcxx . . $ `Descent3/TelCom.h:79:9`!;
197 return;
198 }
199
200 // fill in data
201 i = 0;
202 for (index = 0; index < number_of_goals; index++) {
203 Level_goalscxx . . $ Level_goals..GoalStatuscxx . . $ levelgoals#GoalStatus(a197d185bbe4f6f0).(index, LO_GET_SPECIFIEDcxx . . $ `Descent3/levelgoal_external.h:34:9`!, &goal_status);
204
205 if (goal_status & LGF_ENABLEDcxx . . $ `Descent3/levelgoal_external.h:40:9`!) {
206 TG_Linescxx . . $ TG_Lines.[i].goal_indexcxx . . $ tGoalLineInfo#goal_index. = index;
207 TG_Linescxx . . $ TG_Lines.[i].is_activecxx . . $ tGoalLineInfo#is_active. = false;
208
209 // Is this a primary or secondary goal?
210 if (goal_status & LGF_SECONDARY_GOALcxx . . $ `Descent3/levelgoal_external.h:39:9`!) {
211 TG_Linescxx . . $ TG_Lines.[i].primarycxx . . $ tGoalLineInfo#primary. = false;
212 } else {
213 TG_Linescxx . . $ TG_Lines.[i].primarycxx . . $ tGoalLineInfo#primary. = true;
214 }
215
216 if (goal_status & LGF_TELCOM_LISTScxx . . $ `Descent3/levelgoal_external.h:42:9`!) {
217 TG_Linescxx . . $ TG_Lines.[i].is_objectivecxx . . $ tGoalLineInfo#is_objective. = true;
218 } else {
219 TG_Linescxx . . $ TG_Lines.[i].is_objectivecxx . . $ tGoalLineInfo#is_objective. = false;
220 }
221
222 // initialize x/y values to -1, that way they will be filled in when drawn first
223 // frame.
224 TG_Linescxx . . $ TG_Lines.[i].lxcxx . . $ tGoalLineInfo#lx. = TG_Linescxx . . $ TG_Lines.[i].rxcxx . . $ tGoalLineInfo#rx. = TG_Linescxx . . $ TG_Lines.[i].tycxx . . $ tGoalLineInfo#ty. = TG_Linescxx . . $ TG_Lines.[i].bycxx . . $ tGoalLineInfo#by. = -1;
225
226 i++;
227 }
228 }
229
230 // Determine which goals are active
231 int num_active, act_g_index;
232 num_active = Level_goalscxx . . $ Level_goals..GetNumActivePrimaryGoalscxx . . $ levelgoals#GetNumActivePrimaryGoals(b126dc7c1de90089).();
233 for (i = 0; i < num_active; i++) {
234 act_g_index = Level_goalscxx . . $ Level_goals..GetActivePrimaryGoalcxx . . $ levelgoals#GetActivePrimaryGoal(7864480464b09eea).(i);
235
236 // search for that index
237 for (index = 0; index < TG_NumLinescxx . . $ TG_NumLines.; index++) {
238 if (act_g_index == TG_Linescxx . . $ TG_Lines.[index].goal_indexcxx . . $ tGoalLineInfo#goal_index.) {
239 TG_Linescxx . . $ TG_Lines.[index].is_activecxx . . $ tGoalLineInfo#is_active. = true;
240 break;
241 }
242 }
243 }
244 num_active = Level_goalscxx . . $ Level_goals..GetNumActiveSecondaryGoalscxx . . $ levelgoals#GetNumActiveSecondaryGoals(b126dc7c1de90089).();
245 for (i = 0; i < num_active; i++) {
246 act_g_index = Level_goalscxx . . $ Level_goals..GetActiveSecondaryGoalcxx . . $ levelgoals#GetActiveSecondaryGoal(7864480464b09eea).(i);
247
248 // search for that index
249 for (index = 0; index < TG_NumLinescxx . . $ TG_NumLines.; index++) {
250 if (act_g_index == TG_Linescxx . . $ TG_Lines.[index].goal_indexcxx . . $ tGoalLineInfo#goal_index.) {
251 TG_Linescxx . . $ TG_Lines.[index].is_activecxx . . $ tGoalLineInfo#is_active. = true;
252 break;
253 }
254 }
255 }
256
257 // All data has been filled in, now sort it all
258 int t, j;
259 for (i = 0; i < TG_NumLinescxx . . $ TG_NumLines.; i++) {
260 TG_SortedListcxx . . $ TG_SortedList.[i] = i;
261 }
262
263 for (i = 1; i <= TG_NumLinescxx . . $ TG_NumLines. - 1; i++) {
264 t = TG_SortedListcxx . . $ TG_SortedList.[i];
265
266 // Shift elements down until
267 // insertion point found.
268 for (j = i - 1; j >= 0 && TG_compare_slotscxx . . $ TG_compare_slots(cf9ef193275fa6d8).(TG_SortedListcxx . . $ TG_SortedList.[j], t); j--) {
269 TG_SortedListcxx . . $ TG_SortedList.[j + 1] = TG_SortedListcxx . . $ TG_SortedList.[j];
270 }
271 // insert
272 TG_SortedListcxx . . $ TG_SortedList.[j + 1] = t;
273 }
274 } else {
275 TG_Linescxx . . $ TG_Lines. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
276 TG_NumLinescxx . . $ TG_NumLines. = 0;
277 TG_SortedListcxx . . $ TG_SortedList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
278 }
279 }
280
281 int FindHighlightedItemcxx . . $ FindHighlightedItem(9b79fb6aee4c0440).(int x, int y) {
282 for (int i = 0; i < TG_NumLinescxx . . $ TG_NumLines.; i++) {
283 if (x >= TG_Linescxx . . $ TG_Lines.[i].lxcxx . . $ tGoalLineInfo#lx. && x <= TG_Linescxx . . $ TG_Lines.[i].rxcxx . . $ tGoalLineInfo#rx. && y >= TG_Linescxx . . $ TG_Lines.[i].tycxx . . $ tGoalLineInfo#ty. && y <= TG_Linescxx . . $ TG_Lines.[i].bycxx . . $ tGoalLineInfo#by.) {
284 return TG_Linescxx . . $ TG_Lines.[i].goal_indexcxx . . $ tGoalLineInfo#goal_index.;
285 }
286 }
287 return -1;
288 }
289
290 #define ACTIVE_ALPHA_PER_SECcxx . . $ `Descent3/TelComGoals.cpp:290:9`! 255.0f
291 #define ACTIVE_ALPHA_MINcxx . . $ `Descent3/TelComGoals.cpp:291:9`! 100.0f
292 #define ACTIVE_ALPHA_MAXcxx . . $ `Descent3/TelComGoals.cpp:292:9`! 255.0f
293
294 #define COLOR_OBJECTIVE_HEADINGcxx . . $ `Descent3/TelComGoals.cpp:294:9`! GR_WHITE
295 #define COLOR_OBJECTIVE_NAMEcxx . . $ `Descent3/TelComGoals.cpp:295:9`! GR_RGB(255, 255, 40)
296 #define COLOR_GOAL_NAMEcxx . . $ `Descent3/TelComGoals.cpp:296:9`! GR_WHITE
297 #define COLOR_COMPLETEDcxx . . $ `Descent3/TelComGoals.cpp:297:9`! GR_RGB(40, 255, 40)
298 #define COLOR_INCOMPLETEcxx . . $ `Descent3/TelComGoals.cpp:298:9`! GR_RGB(255, 40, 40)
299 #define COLOR_FAILEDcxx . . $ `Descent3/TelComGoals.cpp:299:9`! GR_RGB(255, 255, 40)
300
301 void TCGoalsRenderCallbackcxx . . $ TCGoalsRenderCallback(49f6e7a06ebc5aa8).(void) {
302 static bool active_alpha_in = false;
303 static float active_alpha = ACTIVE_ALPHA_MAXcxx . . $ `Descent3/TelComGoals.cpp:292:9`!;
304
305 // recalculate alpha
306 float alpha_change = last_frametimecxx . . $ last_frametime. * ACTIVE_ALPHA_PER_SECcxx . . $ `Descent3/TelComGoals.cpp:290:9`!;
307 float alpha_amount;
308 while (alpha_change > 0) {
309 if (active_alpha_in) {
310 alpha_amount = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(ACTIVE_ALPHA_MAXcxx . . $ `Descent3/TelComGoals.cpp:292:9`! - active_alpha, alpha_change);
311 active_alpha += alpha_amount;
312
313 if (active_alpha > (ACTIVE_ALPHA_MAXcxx . . $ `Descent3/TelComGoals.cpp:292:9`! - 1.0f))
314 active_alpha_in = false;
315 } else {
316 alpha_amount = stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(alpha_change, active_alpha - ACTIVE_ALPHA_MINcxx . . $ `Descent3/TelComGoals.cpp:291:9`!);
317 active_alpha -= alpha_amount;
318
319 if (active_alpha < (ACTIVE_ALPHA_MINcxx . . $ `Descent3/TelComGoals.cpp:291:9`! + 1.0f))
320 active_alpha_in = true;
321 }
322 alpha_change -= alpha_amount;
323 }
324
325 int old_font = grtext_GetFontcxx . . $ grtext_GetFont(b126dc7c1de90089).();
326
327 grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(255);
328 rend_SetOverlayTypecxx . . $ rend_SetOverlayType(ac50b47256ae7414).(OT_NONEcxx . . $ `lib/renderer.h:333:9`!);
329 rend_SetLightingcxx . . $ rend_SetLighting(e55526c9d3dd1656).(LS_NONEcxx . . $ LS_NONE.);
330 rend_SetColorModelcxx . . $ rend_SetColorModel(e3c5062d5af601c7).(CM_MONOcxx . . $ CM_MONO.);
331 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(0);
332 rend_SetAlphaTypecxx . . $ rend_SetAlphaType(4af4fd0e2b26c4ac).(AT_CONSTANTcxx . . $ `lib/renderer.h:400:9`! + AT_TEXTUREcxx . . $ `lib/renderer.h:401:9`!);
333 rend_SetAlphaValuecxx . . $ rend_SetAlphaValue(ac50b47256ae7414).(255);
334 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(0);
335
336 int y = TGminycxx . . $ TGminy.;
337
338 int obj_x, obj_max_width, goal_x, goal_max_width, status_x, status_max_width;
339 obj_x = TGminxcxx . . $ TGminx. + 25;
340 obj_max_width = 315;
341 status_x = obj_x + obj_max_width;
342 status_max_width = TGmaxxcxx . . $ TGmaxx. - status_x;
343 goal_x = obj_x + 20;
344 goal_max_width = status_x - goal_x;
345 /*
346 int goal_name_x,goal_status_x,goal_name_max_width,goal_status_max_width;
347 goal_name_x = TGminx + 20;
348 goal_name_max_width = 320;
349 goal_status_x = goal_name_x + goal_name_max_width;
350 goal_status_max_width = TGmaxx-goal_status_x;
351 */
352
353 int period_length;
354 period_length = grfont_GetCharWidthcxx . . $ grfont_GetCharWidth(9b79fb6aee4c0440).(SM_FONTcxx . . $ `Descent3/TelComGoals.cpp:113:9`!, '.') + Grtext_spacingcxx . . $ Grtext_spacing.;
355
356 //@@@ASSERT(goal_status_max_width>0);
357 ASSERTcxx . . $ `misc/pserror.h:246:9`!(status_max_width > 0);
358
359 int big_height = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(BG_FONTcxx . . $ `Descent3/TelComGoals.cpp:114:9`!);
360 int small_height = grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(SM_FONTcxx . . $ `Descent3/TelComGoals.cpp:113:9`!);
361
362 grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(255);
363 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(GR_WHITEcxx . . $ GR_WHITE.);
364
365 // render here
366 // grtext_SetFont(BRIEFING_FONT);
367 //@@@int number_of_goals = Level_goals.GetNumGoals();
368 int goal_index;
369 int goal_status, i, width, x;
370 bool first_primary, first_secondary;
371 first_primary = first_secondary = true;
372
373 #define GOAL_NAME_BUFFER_SIZEcxx . . $ `Descent3/TelComGoals.cpp:373:9`! 256
374 #define BUFFER_SIZEcxx . . $ `Descent3/TelComGoals.cpp:374:9`! GOAL_NAME_BUFFER_SIZEcxx . . $ `Descent3/TelComGoals.cpp:373:9`! * 4
375 char buffer[BUFFER_SIZEcxx . . $ `Descent3/TelComGoals.cpp:374:9`!];
376
377 // Print out Heading
378 char level_string[32];
379 snprintf(level_string, sizeof(level_string), TXT_LEVELSTRINGcxx . . $ `Descent3/stringtable.h:41:9`!, Current_missioncxx . . $ Current_mission..cur_levelcxx . . $ tMission#cur_level.);
380 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(BG_FONTcxx . . $ `Descent3/TelComGoals.cpp:114:9`!);
381 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 255, 255));
382 int level_name_x = TGmaxxcxx . . $ TGmaxx. - grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(level_string) - 15;
383 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(level_name_x, y, level_string);
384 if (!Level_infocxx . . $ Level_info..namecxx . . $ level_info#name.[0]) {
385 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(TGminxcxx . . $ TGminx. + 15, y, TXT_UNNAMEDcxx . . $ `Descent3/stringtable.h:42:9`!);
386 } else {
387 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(TGminxcxx . . $ TGminx. + 15, y, Level_infocxx . . $ Level_info..namecxx . . $ level_info#name.);
388 }
389 y += (big_height + 15);
390
391 for (i = 0; i < TG_NumLinescxx . . $ TG_NumLines.; i++) {
392 goal_index = TG_SortedListcxx . . $ TG_SortedList.[i];
393 grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(255);
394
395 // Print out heading
396 if (TG_Linescxx . . $ TG_Lines.[goal_index].primarycxx . . $ tGoalLineInfo#primary.) {
397 if (first_primary) {
398 // this is the first primary goal, print out heading
399 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(BG_FONTcxx . . $ `Descent3/TelComGoals.cpp:114:9`!);
400 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(COLOR_OBJECTIVE_HEADINGcxx . . $ `Descent3/TelComGoals.cpp:294:9`!);
401 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(TGminxcxx . . $ TGminx. + 15, y, TXT_PRIMGOALScxx . . $ `Descent3/stringtable.h:43:9`!);
402 y += (big_height + 1);
403 first_primary = false;
404 }
405 } else {
406 if (first_secondary) {
407 if (!first_primary)
408 y += 10;
409
410 // this is the first secondary goal, print out heading
411 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(BG_FONTcxx . . $ `Descent3/TelComGoals.cpp:114:9`!);
412 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(COLOR_OBJECTIVE_HEADINGcxx . . $ `Descent3/TelComGoals.cpp:294:9`!);
413 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(TGminxcxx . . $ TGminx. + 15, y, TXT_SECONDARYGOALScxx . . $ `Descent3/stringtable.h:44:9`!);
414 y += (big_height + 1);
415 first_secondary = false;
416 }
417 }
418
419 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(SM_FONTcxx . . $ `Descent3/TelComGoals.cpp:113:9`!);
420
421 // determine x position
422 if (TG_Linescxx . . $ TG_Lines.[goal_index].is_objectivecxx . . $ tGoalLineInfo#is_objective.) {
423 x = obj_x;
424 width = obj_max_width;
425 } else {
426 x = goal_x;
427 width = goal_max_width;
428 }
429
430 // get the name of our goal
431 Level_goalscxx . . $ Level_goals..GoalGetNamecxx . . $ levelgoals#GoalGetName(6836bd73a290bb97).(TG_Linescxx . . $ TG_Lines.[goal_index].goal_indexcxx . . $ tGoalLineInfo#goal_index., buffer, GOAL_NAME_BUFFER_SIZEcxx . . $ `Descent3/TelComGoals.cpp:373:9`!);
432
433 // clip goal_name to our max width
434 //@@textaux_ClipString(width,buffer,1.0,UI_RIGHT_ARROW_CHAR);
435 if (TG_Linescxx . . $ TG_Lines.[goal_index].is_objectivecxx . . $ tGoalLineInfo#is_objective.) {
436 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(COLOR_OBJECTIVE_NAMEcxx . . $ `Descent3/TelComGoals.cpp:295:9`!);
437 } else {
438 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(COLOR_GOAL_NAMEcxx . . $ `Descent3/TelComGoals.cpp:296:9`!);
439 }
440 //@@grtext_Printf(x,y,buffer);
441 char wrap_buffer[BUFFER_SIZEcxx . . $ `Descent3/TelComGoals.cpp:374:9`!];
442 textaux_WordWrapcxx . . $ textaux_WordWrap(2480230cce71d9d7).(buffer, wrap_buffer, width, SM_FONTcxx . . $ `Descent3/TelComGoals.cpp:113:9`!);
443 const char *nextline;
444 char linebuffer[256];
445 int wrap_y = y;
446
447 nextline = textaux_CopyTextLinecxx . . $ textaux_CopyTextLine(327ecc8d2b0bb221).(wrap_buffer, linebuffer);
448 while ((nextline) && ((y + small_height + 2) < TGmaxycxx . . $ TGmaxy.)) {
449 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(x, y, linebuffer);
450 y += (small_height + 2);
451 nextline = textaux_CopyTextLinecxx . . $ textaux_CopyTextLine(327ecc8d2b0bb221).(nextline, linebuffer);
452 }
453 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(x, y, linebuffer);
454
455 // see if we need to fill in x/y coords
456 if (TG_Linescxx . . $ TG_Lines.[goal_index].lxcxx . . $ tGoalLineInfo#lx. == -1) {
457 TG_Linescxx . . $ TG_Lines.[goal_index].lxcxx . . $ tGoalLineInfo#lx. = x;
458 TG_Linescxx . . $ TG_Lines.[goal_index].rxcxx . . $ tGoalLineInfo#rx. = status_x + status_max_width;
459 TG_Linescxx . . $ TG_Lines.[goal_index].tycxx . . $ tGoalLineInfo#ty. = wrap_y;
460 TG_Linescxx . . $ TG_Lines.[goal_index].bycxx . . $ tGoalLineInfo#by. = y + small_height;
461 }
462
463 // fill with '.' until the start of the next column
464 int end_x = x + grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(linebuffer) + Grtext_spacingcxx . . $ Grtext_spacing.;
465 // move end_x to mod period_length
466 while ((end_x % period_length) != 0) {
467 end_x++;
468 }
469
470 int length_to_fill = ((status_x - (end_x + 10)) / period_length) * period_length;
471 int index = 0;
472 while (length_to_fill > period_length && index < (BUFFER_SIZEcxx . . $ `Descent3/TelComGoals.cpp:374:9`! - 1)) {
473 buffer[index] = '.';
474 index++;
475 length_to_fill -= period_length;
476 }
477 buffer[index] = '\0';
478 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(GR_WHITEcxx . . $ GR_WHITE.);
479 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(end_x, y, buffer);
480
481 if (TG_Linescxx . . $ TG_Lines.[goal_index].is_activecxx . . $ tGoalLineInfo#is_active.) {
482
483 if (TG_CurrObjectiveArrowcxx . . $ TG_CurrObjectiveArrow. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
484 rend_SetAlphaTypecxx . . $ rend_SetAlphaType(4af4fd0e2b26c4ac).(AT_CONSTANT_TEXTUREcxx . . $ `lib/renderer.h:402:9`!);
485 rend_SetAlphaValuecxx . . $ rend_SetAlphaValue(ac50b47256ae7414).(active_alpha);
486 rend_SetLightingcxx . . $ rend_SetLighting(e55526c9d3dd1656).(LS_NONEcxx . . $ LS_NONE.);
487 rend_SetColorModelcxx . . $ rend_SetColorModel(e3c5062d5af601c7).(CM_MONOcxx . . $ CM_MONO.);
488 rend_SetOverlayTypecxx . . $ rend_SetOverlayType(ac50b47256ae7414).(OT_NONEcxx . . $ `lib/renderer.h:333:9`!);
489 rend_SetWrapTypecxx . . $ rend_SetWrapType(da524b148887c0e7).(WT_CLAMPcxx . . $ WT_CLAMP.);
490 rend_SetFilteringcxx . . $ rend_SetFiltering(4af4fd0e2b26c4ac).(0);
491
492 rend_DrawScaledBitmapcxx . . $ rend_DrawScaledBitmap(bffd21ce5f93b71b).(x - small_height - 2, wrap_y, x - 2, wrap_y + small_height, TG_CurrObjectiveArrowcxx . . $ TG_CurrObjectiveArrow., 0, 0,
493 1, 1);
494
495 rend_SetAlphaValuecxx . . $ rend_SetAlphaValue(ac50b47256ae7414).(255.0);
496 rend_SetFilteringcxx . . $ rend_SetFiltering(4af4fd0e2b26c4ac).(1);
497 } else {
498 uint8_tcxx . . $ uint8_t# alpha_to_use;
499 alpha_to_use = (uint8_tcxx . . $ uint8_t#)active_alpha;
500 grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(alpha_to_use);
501 }
502 }
503
504 // get the status of the goal
505 Level_goalscxx . . $ Level_goals..GoalStatuscxx . . $ levelgoals#GoalStatus(a197d185bbe4f6f0).(TG_Linescxx . . $ TG_Lines.[goal_index].goal_indexcxx . . $ tGoalLineInfo#goal_index., LO_GET_SPECIFIEDcxx . . $ `Descent3/levelgoal_external.h:34:9`!, &goal_status);
506 if (goal_status & LGF_COMPLETEDcxx . . $ `Descent3/levelgoal_external.h:41:9`!) {
507 // completed goal
508 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(COLOR_COMPLETEDcxx . . $ `Descent3/TelComGoals.cpp:297:9`!);
509 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(status_x, y, TXT_COMPLETEDcxx . . $ `Descent3/stringtable.h:88:9`!);
510 } else if (goal_status & LGF_FAILEDcxx . . $ `Descent3/levelgoal_external.h:45:9`!) {
511 // failed goal
512 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(COLOR_FAILEDcxx . . $ `Descent3/TelComGoals.cpp:299:9`!);
513 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(status_x, y, TXT_FAILEDcxx . . $ `Descent3/stringtable.h:796:9`!);
514 } else {
515 // not completed
516 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(COLOR_INCOMPLETEcxx . . $ `Descent3/TelComGoals.cpp:298:9`!);
517 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(status_x, y, TXT_NOTCOMPLETEDYETcxx . . $ `Descent3/stringtable.h:89:9`!);
518 }
519
520 y += (small_height + 2);
521 }
522
523 if ((TG_NumLinescxx . . $ TG_NumLines. <= 0) || (first_primary && first_secondary)) {
524 // no goals for this level
525 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(BG_FONTcxx . . $ `Descent3/TelComGoals.cpp:114:9`!);
526
527 y = TGminycxx . . $ TGminy. + ((TGmaxycxx . . $ TGmaxy. - TGminycxx . . $ TGminy.) / 2) - (grfont_GetHeightcxx . . $ grfont_GetHeight(7864480464b09eea).(BG_FONTcxx . . $ `Descent3/TelComGoals.cpp:114:9`!) / 2);
528 grtext_CenteredPrintfcxx . . $ grtext_CenteredPrintf(9514e36549094170).(0, y, TXT_NOGOALSAVAILcxx . . $ `Descent3/stringtable.h:76:9`!);
529 }
530
531 grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).();
532
533 // Display tooltip box
534 int mouse_x, mouse_y;
535 ddio_MouseGetStatecxx . . $ ddio_MouseGetState(150f8a26046a094b).(&mouse_x, &mouse_y, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
536 int index = FindHighlightedItemcxx . . $ FindHighlightedItem(9b79fb6aee4c0440).(mouse_x, mouse_y);
537 char desc_buffer[1024], s_desc_buffer[1024], *ptr;
538 ptr = desc_buffer;
539 *ptr = '\0';
540
541 if (index != -1) {
542 #define MIN_TOOLTIP_WIDTHcxx . . $ `Descent3/TelComGoals.cpp:542:9`! 100
543 #define MAX_TOOLTIP_WIDTHcxx . . $ `Descent3/TelComGoals.cpp:543:9`! 300
544 #define MIN_TOOLTIP_HEIGHTcxx . . $ `Descent3/TelComGoals.cpp:544:9`! 40
545 // we're over an item
546
547 Level_goalscxx . . $ Level_goals..GoalGetDesccxx . . $ levelgoals#GoalGetDesc(6836bd73a290bb97).(index, desc_buffer, 1024);
548 while (*ptr && (*ptr == ' ' || *ptr == '\t'))
549 ptr++;
550 if (strlen(ptr) > 0) {
551 int width = grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(ptr);
552
553 if (width > MAX_TOOLTIP_WIDTHcxx . . $ `Descent3/TelComGoals.cpp:543:9`!)
554 width = MAX_TOOLTIP_WIDTHcxx . . $ `Descent3/TelComGoals.cpp:543:9`!;
555 textaux_WordWrapcxx . . $ textaux_WordWrap(2480230cce71d9d7).(ptr, s_desc_buffer, width - 45, SM_FONTcxx . . $ `Descent3/TelComGoals.cpp:113:9`!);
556
557 int num_lines = 0;
558 char *dptr = s_desc_buffer;
559 while (*dptr) {
560 if (*dptr == '\n')
561 num_lines++;
562 dptr++;
563 }
564 num_lines++;
565 ptr = s_desc_buffer;
566
567 // figure out true width
568 const char *next_line = textaux_CopyTextLinecxx . . $ textaux_CopyTextLine(327ecc8d2b0bb221).(ptr, desc_buffer);
569 width = grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(desc_buffer);
570 int t;
571 while (next_line) {
572 next_line = textaux_CopyTextLinecxx . . $ textaux_CopyTextLine(327ecc8d2b0bb221).(next_line, desc_buffer);
573 t = grtext_GetTextLineWidthcxx . . $ grtext_GetTextLineWidth(5c4306d8553b3696).(desc_buffer);
574 if (t > width)
575 width = t;
576 }
577
578 TG_TT_destcxx . . $ TG_TT_dest..wcxx . . $ tToolTipData#w. = width + 20;
579 TG_TT_destcxx . . $ TG_TT_dest..hcxx . . $ tToolTipData#h. = 10 + (num_lines * small_height);
580 } else {
581 memset(&TG_TT_destcxx . . $ TG_TT_dest., 0, sizeof(tToolTipDatacxx . . $ tToolTipData#)); // start shrinking
582 }
583 } else {
584 memset(&TG_TT_destcxx . . $ TG_TT_dest., 0, sizeof(tToolTipDatacxx . . $ tToolTipData#)); // start shrinking
585 }
586
587 #define TOOLTIP_SPEEDcxx . . $ `Descent3/TelComGoals.cpp:587:9`! 400.0f
588
589 // adjust box
590 if (TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w. > TG_TT_destcxx . . $ TG_TT_dest..wcxx . . $ tToolTipData#w.) {
591 // shrinking
592 TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w. -= stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w. - TG_TT_destcxx . . $ TG_TT_dest..wcxx . . $ tToolTipData#w., (int)(TOOLTIP_SPEEDcxx . . $ `Descent3/TelComGoals.cpp:587:9`! * last_frametimecxx . . $ last_frametime.));
593 } else {
594 // enlarging
595 TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w. += stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(TG_TT_destcxx . . $ TG_TT_dest..wcxx . . $ tToolTipData#w. - TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w., (int)(TOOLTIP_SPEEDcxx . . $ `Descent3/TelComGoals.cpp:587:9`! * last_frametimecxx . . $ last_frametime.));
596 }
597
598 if (TG_TT_currcxx . . $ TG_TT_curr..hcxx . . $ tToolTipData#h. > TG_TT_destcxx . . $ TG_TT_dest..hcxx . . $ tToolTipData#h.) {
599 // shrinking
600 TG_TT_currcxx . . $ TG_TT_curr..hcxx . . $ tToolTipData#h. -= stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(TG_TT_currcxx . . $ TG_TT_curr..hcxx . . $ tToolTipData#h. - TG_TT_destcxx . . $ TG_TT_dest..hcxx . . $ tToolTipData#h., (int)(TOOLTIP_SPEEDcxx . . $ `Descent3/TelComGoals.cpp:587:9`! * last_frametimecxx . . $ last_frametime.));
601 } else {
602 // enlarging
603 TG_TT_currcxx . . $ TG_TT_curr..hcxx . . $ tToolTipData#h. += stdcxx . . $ std/::mincxx . . $ std/min(2a338fce5842aa6a).(TG_TT_destcxx . . $ TG_TT_dest..hcxx . . $ tToolTipData#h. - TG_TT_currcxx . . $ TG_TT_curr..hcxx . . $ tToolTipData#h., (int)(TOOLTIP_SPEEDcxx . . $ `Descent3/TelComGoals.cpp:587:9`! * last_frametimecxx . . $ last_frametime.));
604 }
605
606 // rend_SetAlphaType (AT_CONSTANT_TEXTURE);
607 // rend_SetAlphaValue (200.0);
608 rend_SetLightingcxx . . $ rend_SetLighting(e55526c9d3dd1656).(LS_NONEcxx . . $ LS_NONE.);
609 rend_SetColorModelcxx . . $ rend_SetColorModel(e3c5062d5af601c7).(CM_MONOcxx . . $ CM_MONO.);
610 rend_SetOverlayTypecxx . . $ rend_SetOverlayType(ac50b47256ae7414).(OT_NONEcxx . . $ `lib/renderer.h:333:9`!);
611 rend_SetWrapTypecxx . . $ rend_SetWrapType(da524b148887c0e7).(WT_CLAMPcxx . . $ WT_CLAMP.);
612 rend_SetFilteringcxx . . $ rend_SetFiltering(4af4fd0e2b26c4ac).(0);
613
614 if (TG_MouseOffset_xcxx . . $ TG_MouseOffset_x. == -1) {
615 // determine bottom-right x/y of mouse cursor
616 uint16_tcxx . . $ uint16_t# *data = bm_datacxx . . $ bm_data(501e1bc9f482c6bd).(TC_cursorcxx . . $ TC_cursor., 0);
617 int width = bm_wcxx . . $ bm_w(9b79fb6aee4c0440).(TC_cursorcxx . . $ TC_cursor., 0);
618 int index = width * bm_hcxx . . $ bm_h(9b79fb6aee4c0440).(TC_cursorcxx . . $ TC_cursor., 0) - 1;
619 while (index > 0 && (!(data[index] & OPAQUE_FLAGcxx . . $ `lib/grdefs.h:72:9`!)))
620 index--;
621
622 TG_MouseOffset_xcxx . . $ TG_MouseOffset_x. = index % width;
623 TG_MouseOffset_ycxx . . $ TG_MouseOffset_y. = index / width;
624 }
625
626 // Adjust X box if it is to far to the right
627 if (mouse_x + TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w. > Telcom_systemcxx . . $ Telcom_system..Monitor_coordscxx . . $ tTelComInfo#Monitor_coords.[MONITOR_MAINcxx . . $ `Descent3/TelCom.h:98:9`!].rightcxx . . $ box#right. ||
628 mouse_x + TG_TT_destcxx . . $ TG_TT_dest..wcxx . . $ tToolTipData#w. > Telcom_systemcxx . . $ Telcom_system..Monitor_coordscxx . . $ tTelComInfo#Monitor_coords.[MONITOR_MAINcxx . . $ `Descent3/TelCom.h:98:9`!].rightcxx . . $ box#right.) {
629 // we must adjust
630 mouse_x -= TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w.;
631 }
632
633 rend_DrawScaledChunkedBitmapcxx . . $ rend_DrawScaledChunkedBitmap(a8bf607edbcedb63).(&TG_Tooltipbitmapcxx . . $ TG_Tooltipbitmap., mouse_x + TG_MouseOffset_xcxx . . $ TG_MouseOffset_x., mouse_y + TG_MouseOffset_ycxx . . $ TG_MouseOffset_y., TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w.,
634 TG_TT_currcxx . . $ TG_TT_curr..hcxx . . $ tToolTipData#h., 255);
635 rend_SetFilteringcxx . . $ rend_SetFiltering(4af4fd0e2b26c4ac).(1);
636
637 if (TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w. != 0 && TG_TT_currcxx . . $ TG_TT_curr..hcxx . . $ tToolTipData#h. != 0) {
638 // See if we need to draw any text
639 // only when curr==dest
640 if (TG_TT_currcxx . . $ TG_TT_curr..wcxx . . $ tToolTipData#w. == TG_TT_destcxx . . $ TG_TT_dest..wcxx . . $ tToolTipData#w. && TG_TT_currcxx . . $ TG_TT_curr..hcxx . . $ tToolTipData#h. == TG_TT_destcxx . . $ TG_TT_dest..hcxx . . $ tToolTipData#h.) {
641 // write text description
642 grtext_SetAlphacxx . . $ grtext_SetAlpha(ac50b47256ae7414).(255);
643 grtext_SetColorcxx . . $ grtext_SetColor(cb2f890c2fdad230).(GR_WHITEcxx . . $ GR_WHITE.);
644 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(SM_FONTcxx . . $ `Descent3/TelComGoals.cpp:113:9`!);
645
646 const char *next_line;
647 int c_x, c_y;
648 c_x = mouse_x + TG_MouseOffset_xcxx . . $ TG_MouseOffset_x. + 10;
649 c_y = mouse_y + TG_MouseOffset_ycxx . . $ TG_MouseOffset_y. + 5;
650
651 next_line = textaux_CopyTextLinecxx . . $ textaux_CopyTextLine(327ecc8d2b0bb221).(ptr, desc_buffer);
652 while (next_line) {
653 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(c_x, c_y, desc_buffer);
654 next_line = textaux_CopyTextLinecxx . . $ textaux_CopyTextLine(327ecc8d2b0bb221).(next_line, desc_buffer);
655 c_y += small_height;
656 }
657 grtext_Printfcxx . . $ grtext_Printf(9514e36549094170).(c_x, c_y, desc_buffer);
658 grtext_Flushcxx . . $ grtext_Flush(49f6e7a06ebc5aa8).();
659 }
660 }
661
662 grtext_SetFontcxx . . $ grtext_SetFont(d4f767463ce0a6b3).(old_font);
663 rend_SetZBufferStatecxx . . $ rend_SetZBufferState(4af4fd0e2b26c4ac).(1);
664 }
665
666 // This is the function called by TelCom
667 // return true if TelCom should exit to TelCom Main Menu
668 // return false if you should exit out of TelCom completly
669 bool TelComGoalStatuscxx . . $ TelComGoalStatus(4a6cbf79c6ed567c).(tTelComInfocxx . . $ tTelComInfo# *tcs) {
670 bool done = false;
671
672 TelcomStartScreencxx . . $ TelcomStartScreen(d4f767463ce0a6b3).(0);
673
674 TCBKGDESCcxx . . $ TCBKGDESC# backg;
675 backg.colorcxx . . $ TCBKGDESC#color. = BACKGROUND_COLORcxx . . $ `Descent3/TelCom.h:58:9`!;
676 backg.capscxx . . $ TCBKGDESC#caps. = TCBGD_COLORcxx . . $ `Descent3/TelComEfxStructs.h:127:9`!;
677 backg.typecxx . . $ TCBKGDESC#type. = TC_BACK_STATICcxx . . $ `Descent3/TelComEfxStructs.h:144:9`!;
678 CreateBackgroundEffectcxx . . $ CreateBackgroundEffect(36995d1e7af252ca).(&backg, MONITOR_MAINcxx . . $ `Descent3/TelCom.h:98:9`!, 0);
679 CreateBackgroundEffectcxx . . $ CreateBackgroundEffect(36995d1e7af252ca).(&backg, MONITOR_TOPcxx . . $ `Descent3/TelCom.h:99:9`!, 0);
680
681 TCBMPDESCcxx . . $ TCBMPDESC# bmpdesc;
682 bmpdesc.typecxx . . $ TCBMPDESC#type. = TC_BMP_STATICcxx . . $ `Descent3/TelComEfxStructs.h:139:9`!;
683 bmpdesc.flagscxx . . $ TCBMPDESC#flags. = 0;
684 bmpdesc.capscxx . . $ TCBMPDESC#caps. = TCBD_XYcxx . . $ `Descent3/TelComEfxStructs.h:115:9`!;
685 bmpdesc.xcxx . . $ TCBMPDESC#x. = 0;
686 bmpdesc.ycxx . . $ TCBMPDESC#y. = 0;
687 strcpy(bmpdesc.filenamecxx . . $ TCBMPDESC#filename., "TelcomGoalBkg.ogf");
688 CreateBitmapEffectcxx . . $ CreateBitmapEffect(a6e53fec506ced4b).(&bmpdesc, MONITOR_MAINcxx . . $ `Descent3/TelCom.h:98:9`!, 0);
689 /*
690 $$TABLE_GAMEFILE "TelcomGoalBkg.ogf"
691 */
692
693 TGminxcxx . . $ TGminx. = tcs->Monitor_coordscxx . . $ tTelComInfo#Monitor_coords.[MONITOR_MAINcxx . . $ `Descent3/TelCom.h:98:9`!].leftcxx . . $ box#left. + 10;
694 TGminycxx . . $ TGminy. = tcs->Monitor_coordscxx . . $ tTelComInfo#Monitor_coords.[MONITOR_MAINcxx . . $ `Descent3/TelCom.h:98:9`!].topcxx . . $ box#top. + 10;
695 TGmaxycxx . . $ TGmaxy. = tcs->Monitor_coordscxx . . $ tTelComInfo#Monitor_coords.[MONITOR_MAINcxx . . $ `Descent3/TelCom.h:98:9`!].bottomcxx . . $ box#bottom. - 10;
696 TGmaxxcxx . . $ TGmaxx. = tcs->Monitor_coordscxx . . $ tTelComInfo#Monitor_coords.[MONITOR_MAINcxx . . $ `Descent3/TelCom.h:98:9`!].rightcxx . . $ box#right. - 10;
697 TG_Linescxx . . $ TG_Lines. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
698 TG_SortedListcxx . . $ TG_SortedList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
699 TG_NumLinescxx . . $ TG_NumLines. = 0;
700 memset(&TG_TT_destcxx . . $ TG_TT_dest., 0, sizeof(tToolTipDatacxx . . $ tToolTipData#));
701 memset(&TG_TT_currcxx . . $ TG_TT_curr., 0, sizeof(tToolTipDatacxx . . $ tToolTipData#));
702
703 int bm_handle = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("TelcomToolTip.ogf", 0);
704 if (bm_handle <= BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
705 bm_handle = bm_AllocBitmapcxx . . $ bm_AllocBitmap(2326284602b0bb2d).(32, 32, 0);
706 if (bm_handle > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!) {
707 uint16_tcxx . . $ uint16_t# *data = bm_datacxx . . $ bm_data(501e1bc9f482c6bd).(bm_handle, 0);
708 for (int i = 0; i < 1024; i++) {
709 data[i] = GR_RGB16cxx . . $ GR_RGB16(6461fafb79bad5b9).(0, 0, 0) | OPAQUE_FLAGcxx . . $ `lib/grdefs.h:72:9`!;
710 }
711 }
712 }
713
714 bm_CreateChunkedBitmapcxx . . $ bm_CreateChunkedBitmap(b9fa1b176cbdfaf1).(bm_handle, &TG_Tooltipbitmapcxx . . $ TG_Tooltipbitmap.);
715
716 TCTEXTDESCcxx . . $ TCTEXTDESC# textdesc;
717 textdesc.typecxx . . $ TCTEXTDESC#type. = TC_TEXT_STATICcxx . . $ `Descent3/TelComEfxStructs.h:135:9`!;
718 textdesc.fontcxx . . $ TCTEXTDESC#font. = BG_FONTcxx . . $ `Descent3/TelComGoals.cpp:114:9`!;
719 textdesc.capscxx . . $ TCTEXTDESC#caps. = TCTD_TEXTBOXcxx . . $ `Descent3/TelComEfxStructs.h:111:9`! | TCTD_COLORcxx . . $ `Descent3/TelComEfxStructs.h:107:9`! | TCTD_FONTcxx . . $ `Descent3/TelComEfxStructs.h:106:9`!;
720 textdesc.textboxcxx . . $ TCTEXTDESC#textbox..leftcxx . . $ tc_text#left. = 0;
721 textdesc.textboxcxx . . $ TCTEXTDESC#textbox..rightcxx . . $ tc_text#right. = 380;
722 textdesc.textboxcxx . . $ TCTEXTDESC#textbox..topcxx . . $ tc_text#top. = 4;
723 textdesc.textboxcxx . . $ TCTEXTDESC#textbox..bottomcxx . . $ tc_text#bottom. = 50;
724 textdesc.colorcxx . . $ TCTEXTDESC#color. = GR_RGBcxx . . $ GR_RGB(530956271a9518a5).(255, 255, 255);
725
726 CreateTextEffectcxx . . $ CreateTextEffect(b73a9a5c42deb467).(&textdesc, TXT_GOALSTATUSHEADINGcxx . . $ `Descent3/stringtable.h:94:9`!, MONITOR_TOPcxx . . $ `Descent3/TelCom.h:99:9`!, 0);
727 TelcomEndScreencxx . . $ TelcomEndScreen(49f6e7a06ebc5aa8).();
728 TelcomRenderSetScreencxx . . $ TelcomRenderSetScreen(d4f767463ce0a6b3).(0);
729
730 TelcomRenderSetCallbackcxx . . $ TelcomRenderSetCallback(964b12a25712bdc3).(TCGoalsRenderCallbackcxx . . $ TCGoalsRenderCallback(49f6e7a06ebc5aa8).);
731
732 TCGoalsBuildLineDatacxx . . $ TCGoalsBuildLineData(49f6e7a06ebc5aa8).();
733
734 TG_CurrObjectiveArrowcxx . . $ TG_CurrObjectiveArrow. = bm_AllocLoadFileBitmapcxx . . $ bm_AllocLoadFileBitmap(1163be050dbfff7).("CurrObjectiveArrow.ogf", 0);
735
736 while (!done) {
737 Sound_systemcxx . . $ Sound_system..BeginSoundFramecxx . . $ hlsSystem#BeginSoundFrame(b45ddcbc8423892c).(Telcom_called_from_gamecxx . . $ Telcom_called_from_game.);
738
739 if (tcs->statecxx . . $ tTelComInfo#state. != TCS_POWERONcxx . . $ `Descent3/TelCom.h:133:9`! || tcs->current_statuscxx . . $ tTelComInfo#current_status. != TS_GOALScxx . . $ `Descent3/TelCom.h:90:9`!) {
740 // we're done with the loop
741 done = true;
742 }
743
744 // Process all waiting events for the TelCom (we may only want to handle this once a frame!)
745 TelComHandleAllEventscxx . . $ TelComHandleAllEvents(9b1dcfbcd79f78bb).(&Telcom_systemcxx . . $ Telcom_system.);
746
747 TelcomRenderScreencxx . . $ TelcomRenderScreen(22445115de651e24).();
748 Descentcxx . . $ Descent.->defercxx . . $ oeApplication#defer(db52760e79bf9054).();
749 if (KEY_STATEcxx . . $ `ddio/ddio_common.h:204:9`!(KEY_ESCcxx . . $ `ddio/ddio_common.h:267:9`!))
750 Telcom_systemcxx . . $ Telcom_system..statecxx . . $ tTelComInfo#state. = TCS_POWEROFFcxx . . $ `Descent3/TelCom.h:132:9`!;
751
752 Sound_systemcxx . . $ Sound_system..EndSoundFramecxx . . $ hlsSystem#EndSoundFrame(49f6e7a06ebc5aa8).();
753 }
754
755 DestroyAllScreenscxx . . $ DestroyAllScreens(b45ddcbc8423892c).();
756 TelcomRenderSetScreencxx . . $ TelcomRenderSetScreen(d4f767463ce0a6b3).(DUMMY_SCREENcxx . . $ `Descent3/TelCom.h:95:9`!);
757 TelcomRenderSetCallbackcxx . . $ TelcomRenderSetCallback(964b12a25712bdc3).(NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!);
758
759 if (TG_Linescxx . . $ TG_Lines.) {
760 mem_freecxx . . $ `mem/mem.h:80:9`!(TG_Lines);
761 TG_Linescxx . . $ TG_Lines. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
762 }
763 if (TG_SortedListcxx . . $ TG_SortedList.) {
764 mem_freecxx . . $ `mem/mem.h:80:9`!(TG_SortedList);
765 TG_SortedListcxx . . $ TG_SortedList. = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!;
766 }
767 TG_NumLinescxx . . $ TG_NumLines. = 0;
768
769 if (TG_CurrObjectiveArrowcxx . . $ TG_CurrObjectiveArrow. > BAD_BITMAP_HANDLEcxx . . $ `lib/bitmap.h:42:9`!)
770 bm_FreeBitmapcxx . . $ bm_FreeBitmap(d4f767463ce0a6b3).(TG_CurrObjectiveArrowcxx . . $ TG_CurrObjectiveArrow.);
771
772 bm_DestroyChunkedBitmapcxx . . $ bm_DestroyChunkedBitmap(1635f60f4d3c1317).(&TG_Tooltipbitmapcxx . . $ TG_Tooltipbitmap.);
773
774 return true;
775 }