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

Function InitializeDLL

scripts/CellTestLevel.cpp:335–416  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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