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

Function InitializeDLL

scripts/RudeAwakening.cpp:424–505  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

422// InitializeDLL()
423// ===============
424char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) {
425 osicommon_Initialize((tOSIRISModuleInit *)func_list);
426 if (func_list->game_checksum != CHECKSUM) {
427 mprintf(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksum, CHECKSUM);
428 mprintf(0, "RECOMPILE YOUR SCRIPTS!!!\n");
429 return 0;
430 }
431
432 ClearGlobalActionCtrs();
433 dfInit();
434 InitMessageList();
435
436 // Build the filename of the message file
437 char filename[_MAX_PATH + 32];
438 int lang_type;
439 if (func_list->script_identifier != NULL) {
440 _splitpath(func_list->script_identifier, NULL, NULL, filename, NULL);
441 lang_type = Game_GetLanguage();
442 if (lang_type == LANGUAGE_FRENCH)
443 strcat(filename, "_FRN");
444 else if (lang_type == LANGUAGE_GERMAN)
445 strcat(filename, "_GER");
446 else if (lang_type == LANGUAGE_ITALIAN)
447 strcat(filename, "_ITN");
448 else if (lang_type == LANGUAGE_SPANISH)
449 strcat(filename, "_SPN");
450 strcat(filename, ".msg");
451 } else {
452 strcpy(filename, "RudeAwakening.msg");
453 lang_type = LANGUAGE_ENGLISH;
454 }
455 if (!ReadMessageFile(filename)) {
456 mprintf(0, "ERROR: Could not load message file - %s\n", filename);
457 }
458
459 int j;
460
461 // Do Door Index lookups
462 for (j = 0; j < NUM_DOOR_NAMES; j++)
463 Door_handles[j] = Scrpt_FindDoorName(Door_names[j]);
464
465 // Do Object Index lookups
466 for (j = 0; j < NUM_OBJECT_NAMES; j++)
467 Object_handles[j] = Scrpt_FindObjectName(Object_names[j]);
468
469 // Do Room Index lookups
470 for (j = 0; j < NUM_ROOM_NAMES; j++)
471 Room_indexes[j] = Scrpt_FindRoomName(Room_names[j]);
472
473 // Do Trigger Index lookups
474 for (j = 0; j < NUM_TRIGGER_NAMES; j++) {
475 Trigger_indexes[j] = Scrpt_FindTriggerName(Trigger_names[j]);
476 Trigger_faces[j] = Scrpt_GetTriggerFace(Trigger_indexes[j]);
477 Trigger_rooms[j] = Scrpt_GetTriggerRoom(Trigger_indexes[j]);
478 }
479
480 // Do Sound Index lookups
481 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