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

Function InitializeDLL

scripts/LEVEL15.cpp:1751–1832  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1749// InitializeDLL()
1750// ===============
1751char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) {
1752 osicommon_Initialize((tOSIRISModuleInit *)func_list);
1753 if (func_list->game_checksum != CHECKSUM) {
1754 mprintf(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksum, CHECKSUM);
1755 mprintf(0, "RECOMPILE YOUR SCRIPTS!!!\n");
1756 return 0;
1757 }
1758
1759 ClearGlobalActionCtrs();
1760 dfInit();
1761 InitMessageList();
1762
1763 // Build the filename of the message file
1764 char filename[_MAX_PATH + 32];
1765 int lang_type;
1766 if (func_list->script_identifier != NULL) {
1767 _splitpath(func_list->script_identifier, NULL, NULL, filename, NULL);
1768 lang_type = Game_GetLanguage();
1769 if (lang_type == LANGUAGE_FRENCH)
1770 strcat(filename, "_FRN");
1771 else if (lang_type == LANGUAGE_GERMAN)
1772 strcat(filename, "_GER");
1773 else if (lang_type == LANGUAGE_ITALIAN)
1774 strcat(filename, "_ITN");
1775 else if (lang_type == LANGUAGE_SPANISH)
1776 strcat(filename, "_SPN");
1777 strcat(filename, ".msg");
1778 } else {
1779 strcpy(filename, "Level15.msg");
1780 lang_type = LANGUAGE_ENGLISH;
1781 }
1782 if (!ReadMessageFile(filename)) {
1783 mprintf(0, "ERROR: Could not load message file - %s\n", filename);
1784 }
1785
1786 int j;
1787
1788 // Do Door Index lookups
1789 for (j = 0; j < NUM_DOOR_NAMES; j++)
1790 Door_handles[j] = Scrpt_FindDoorName(Door_names[j]);
1791
1792 // Do Object Index lookups
1793 for (j = 0; j < NUM_OBJECT_NAMES; j++)
1794 Object_handles[j] = Scrpt_FindObjectName(Object_names[j]);
1795
1796 // Do Room Index lookups
1797 for (j = 0; j < NUM_ROOM_NAMES; j++)
1798 Room_indexes[j] = Scrpt_FindRoomName(Room_names[j]);
1799
1800 // Do Trigger Index lookups
1801 for (j = 0; j < NUM_TRIGGER_NAMES; j++) {
1802 Trigger_indexes[j] = Scrpt_FindTriggerName(Trigger_names[j]);
1803 Trigger_faces[j] = Scrpt_GetTriggerFace(Trigger_indexes[j]);
1804 Trigger_rooms[j] = Scrpt_GetTriggerRoom(Trigger_indexes[j]);
1805 }
1806
1807 // Do Sound Index lookups
1808 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