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

Function InitializeDLL

scripts/level13.cpp:1663–1744  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1661// InitializeDLL()
1662// ===============
1663char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) {
1664 osicommon_Initialize((tOSIRISModuleInit *)func_list);
1665 if (func_list->game_checksum != CHECKSUM) {
1666 mprintf(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksum, CHECKSUM);
1667 mprintf(0, "RECOMPILE YOUR SCRIPTS!!!\n");
1668 return 0;
1669 }
1670
1671 ClearGlobalActionCtrs();
1672 dfInit();
1673 InitMessageList();
1674
1675 // Build the filename of the message file
1676 char filename[_MAX_PATH + 32];
1677 int lang_type;
1678 if (func_list->script_identifier != NULL) {
1679 _splitpath(func_list->script_identifier, NULL, NULL, filename, NULL);
1680 lang_type = Game_GetLanguage();
1681 if (lang_type == LANGUAGE_FRENCH)
1682 strcat(filename, "_FRN");
1683 else if (lang_type == LANGUAGE_GERMAN)
1684 strcat(filename, "_GER");
1685 else if (lang_type == LANGUAGE_ITALIAN)
1686 strcat(filename, "_ITN");
1687 else if (lang_type == LANGUAGE_SPANISH)
1688 strcat(filename, "_SPN");
1689 strcat(filename, ".msg");
1690 } else {
1691 strcpy(filename, "level13.msg");
1692 lang_type = LANGUAGE_ENGLISH;
1693 }
1694 if (!ReadMessageFile(filename)) {
1695 mprintf(0, "ERROR: Could not load message file - %s\n", filename);
1696 }
1697
1698 int j;
1699
1700 // Do Door Index lookups
1701 for (j = 0; j < NUM_DOOR_NAMES; j++)
1702 Door_handles[j] = Scrpt_FindDoorName(Door_names[j]);
1703
1704 // Do Object Index lookups
1705 for (j = 0; j < NUM_OBJECT_NAMES; j++)
1706 Object_handles[j] = Scrpt_FindObjectName(Object_names[j]);
1707
1708 // Do Room Index lookups
1709 for (j = 0; j < NUM_ROOM_NAMES; j++)
1710 Room_indexes[j] = Scrpt_FindRoomName(Room_names[j]);
1711
1712 // Do Trigger Index lookups
1713 for (j = 0; j < NUM_TRIGGER_NAMES; j++) {
1714 Trigger_indexes[j] = Scrpt_FindTriggerName(Trigger_names[j]);
1715 Trigger_faces[j] = Scrpt_GetTriggerFace(Trigger_indexes[j]);
1716 Trigger_rooms[j] = Scrpt_GetTriggerRoom(Trigger_indexes[j]);
1717 }
1718
1719 // Do Sound Index lookups
1720 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