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

Function InitializeDLL

scripts/Geodomes.cpp:386–467  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

384// InitializeDLL()
385// ===============
386char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) {
387 osicommon_Initialize((tOSIRISModuleInit *)func_list);
388 if (func_list->game_checksum != CHECKSUM) {
389 mprintf(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksum, CHECKSUM);
390 mprintf(0, "RECOMPILE YOUR SCRIPTS!!!\n");
391 return 0;
392 }
393
394 ClearGlobalActionCtrs();
395 dfInit();
396 InitMessageList();
397
398 // Build the filename of the message file
399 char filename[_MAX_PATH + 32];
400 int lang_type;
401 if (func_list->script_identifier != NULL) {
402 _splitpath(func_list->script_identifier, NULL, NULL, filename, NULL);
403 lang_type = Game_GetLanguage();
404 if (lang_type == LANGUAGE_FRENCH)
405 strcat(filename, "_FRN");
406 else if (lang_type == LANGUAGE_GERMAN)
407 strcat(filename, "_GER");
408 else if (lang_type == LANGUAGE_ITALIAN)
409 strcat(filename, "_ITN");
410 else if (lang_type == LANGUAGE_SPANISH)
411 strcat(filename, "_SPN");
412 strcat(filename, ".msg");
413 } else {
414 strcpy(filename, "Geodomes.msg");
415 lang_type = LANGUAGE_ENGLISH;
416 }
417 if (!ReadMessageFile(filename)) {
418 mprintf(0, "ERROR: Could not load message file - %s\n", filename);
419 }
420
421 int j;
422
423 // Do Door Index lookups
424 for (j = 0; j < NUM_DOOR_NAMES; j++)
425 Door_handles[j] = Scrpt_FindDoorName(Door_names[j]);
426
427 // Do Object Index lookups
428 for (j = 0; j < NUM_OBJECT_NAMES; j++)
429 Object_handles[j] = Scrpt_FindObjectName(Object_names[j]);
430
431 // Do Room Index lookups
432 for (j = 0; j < NUM_ROOM_NAMES; j++)
433 Room_indexes[j] = Scrpt_FindRoomName(Room_names[j]);
434
435 // Do Trigger Index lookups
436 for (j = 0; j < NUM_TRIGGER_NAMES; j++) {
437 Trigger_indexes[j] = Scrpt_FindTriggerName(Trigger_names[j]);
438 Trigger_faces[j] = Scrpt_GetTriggerFace(Trigger_indexes[j]);
439 Trigger_rooms[j] = Scrpt_GetTriggerRoom(Trigger_indexes[j]);
440 }
441
442 // Do Sound Index lookups
443 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