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

Function InitializeDLL

scripts/CanyonsCTF.cpp:333–414  ·  view source on GitHub ↗

=============== InitializeDLL() ===============

Source from the content-addressed store, hash-verified

331// InitializeDLL()
332// ===============
333char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) {
334 osicommon_Initialize((tOSIRISModuleInit *)func_list);
335 if (func_list->game_checksum != CHECKSUM) {
336 mprintf(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksum, CHECKSUM);
337 mprintf(0, "RECOMPILE YOUR SCRIPTS!!!\n");
338 return 0;
339 }
340
341 ClearGlobalActionCtrs();
342 dfInit();
343 InitMessageList();
344
345 // Build the filename of the message file
346 char filename[_MAX_PATH + 32];
347 int lang_type;
348 if (func_list->script_identifier != NULL) {
349 _splitpath(func_list->script_identifier, NULL, NULL, filename, NULL);
350 lang_type = Game_GetLanguage();
351 if (lang_type == LANGUAGE_FRENCH)
352 strcat(filename, "_FRN");
353 else if (lang_type == LANGUAGE_GERMAN)
354 strcat(filename, "_GER");
355 else if (lang_type == LANGUAGE_ITALIAN)
356 strcat(filename, "_ITN");
357 else if (lang_type == LANGUAGE_SPANISH)
358 strcat(filename, "_SPN");
359 strcat(filename, ".msg");
360 } else {
361 strcpy(filename, "CanyonsCTF.msg");
362 lang_type = LANGUAGE_ENGLISH;
363 }
364 if (!ReadMessageFile(filename)) {
365 mprintf(0, "ERROR: Could not load message file - %s\n", filename);
366 }
367
368 int j;
369
370 // Do Door Index lookups
371 for (j = 0; j < NUM_DOOR_NAMES; j++)
372 Door_handles[j] = Scrpt_FindDoorName(Door_names[j]);
373
374 // Do Object Index lookups
375 for (j = 0; j < NUM_OBJECT_NAMES; j++)
376 Object_handles[j] = Scrpt_FindObjectName(Object_names[j]);
377
378 // Do Room Index lookups
379 for (j = 0; j < NUM_ROOM_NAMES; j++)
380 Room_indexes[j] = Scrpt_FindRoomName(Room_names[j]);
381
382 // Do Trigger Index lookups
383 for (j = 0; j < NUM_TRIGGER_NAMES; j++) {
384 Trigger_indexes[j] = Scrpt_FindTriggerName(Trigger_names[j]);
385 Trigger_faces[j] = Scrpt_GetTriggerFace(Trigger_indexes[j]);
386 Trigger_rooms[j] = Scrpt_GetTriggerRoom(Trigger_indexes[j]);
387 }
388
389 // Do Sound Index lookups
390 for (j = 0; j < NUM_SOUND_NAMES; j++)

Callers

nothing calls this directly

Calls 7

dfInitFunction · 0.85
_splitpathFunction · 0.85
osicommon_InitializeFunction · 0.70
ClearGlobalActionCtrsFunction · 0.70
InitMessageListFunction · 0.70
ReadMessageFileFunction · 0.70
GetMessageFunction · 0.70

Tested by

no test coverage detected