MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / AddString

Method AddString

editor/BriefManage.cpp:223–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

221}
222
223void CBriefManage::AddString(char *filename, int pagetype) {
224 char buffer[_MAX_PATH + 100];
225 char real_filename[_MAX_PATH];
226 char page_type[100];
227 char *pagename = filename;
228
229 switch (pagetype) {
230 case PAGETYPE_SOUND: {
231 // look for the page in the manage system
232 bool found;
233
234 found = false;
235
236 mngs_sound_page page;
237
238 if (mng_FindSpecificSoundPage(filename, &page) > 0) {
239 found = true;
240 }
241
242 if (!found) {
243 // ok there wasn't one in the gamefiles make sure there isn't a tracklocked
244 if (mng_FindTrackLock(filename, PAGETYPE_SOUND) != -1) {
245 // there isn't one in the track lock...this is our first compile!
246 found = true;
247 }
248 }
249
250 if (found) {
251 // we already have this in the manage system
252 return;
253 }
254
255 strcpy(page_type, "[sound]");
256 } break;
257 case PAGETYPE_GAMEFILE: {
258 // look for the page in the manage system
259 bool found;
260 int i;
261
262 char ext[32];
263 ddio_SplitPath(filename, NULL, real_filename, ext);
264 strcat(real_filename, ext);
265 pagename = real_filename;
266
267 found = false;
268 for (i = 0; i < MAX_GAMEFILES; i++) {
269 if (Gamefiles[i].used && (!stricmp(real_filename, Gamefiles[i].name))) {
270 found = true;
271 break;
272 }
273 }
274
275 if (!found) {
276 // ok there wasn't one in the gamefiles make sure there isn't a tracklocked
277 if (mng_FindTrackLock(real_filename, PAGETYPE_GAMEFILE) != -1) {
278 // there isn't one in the track lock...this is our first compile!
279 found = true;
280 }

Callers 15

DebugSpewMethod · 0.80
AddToListMethod · 0.80
AddLangToListMethod · 0.80
ParseMOTDFileMethod · 0.80
OnInitDialogMethod · 0.80
UpdateDialogMethod · 0.80
OnInitDialogMethod · 0.80

Calls 3

mng_FindTrackLockFunction · 0.85
ddio_SplitPathFunction · 0.50

Tested by

no test coverage detected