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

Function InitializeDLL

scripts/ChrisTest.cpp:360–441  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

358// InitializeDLL()
359// ===============
360char STDCALL InitializeDLL(tOSIRISModuleInit *func_list) {
361 osicommon_Initialize((tOSIRISModuleInit *)func_list);
362 if (func_list->game_checksum != CHECKSUM) {
363 mprintf(0, "Game-Checksum FAIL!!! (%ul!=%ul)\n", func_list->game_checksum, CHECKSUM);
364 mprintf(0, "RECOMPILE YOUR SCRIPTS!!!\n");
365 return 0;
366 }
367
368 ClearGlobalActionCtrs();
369 dfInit();
370 InitMessageList();
371
372 // Build the filename of the message file
373 char filename[_MAX_PATH + 32];
374 int lang_type;
375 if (func_list->script_identifier != NULL) {
376 _splitpath(func_list->script_identifier, NULL, NULL, filename, NULL);
377 lang_type = Game_GetLanguage();
378 if (lang_type == LANGUAGE_FRENCH)
379 strcat(filename, "_FRN");
380 else if (lang_type == LANGUAGE_GERMAN)
381 strcat(filename, "_GER");
382 else if (lang_type == LANGUAGE_ITALIAN)
383 strcat(filename, "_ITN");
384 else if (lang_type == LANGUAGE_SPANISH)
385 strcat(filename, "_SPN");
386 strcat(filename, ".msg");
387 } else {
388 strcpy(filename, "Train03.msg");
389 lang_type = LANGUAGE_ENGLISH;
390 }
391 if (!ReadMessageFile(filename)) {
392 mprintf(0, "ERROR: Could not load message file - %s\n", filename);
393 }
394
395 int j;
396
397 // Do Door Index lookups
398 for (j = 0; j < NUM_DOOR_NAMES; j++)
399 Door_handles[j] = Scrpt_FindDoorName(Door_names[j]);
400
401 // Do Object Index lookups
402 for (j = 0; j < NUM_OBJECT_NAMES; j++)
403 Object_handles[j] = Scrpt_FindObjectName(Object_names[j]);
404
405 // Do Room Index lookups
406 for (j = 0; j < NUM_ROOM_NAMES; j++)
407 Room_indexes[j] = Scrpt_FindRoomName(Room_names[j]);
408
409 // Do Trigger Index lookups
410 for (j = 0; j < NUM_TRIGGER_NAMES; j++) {
411 Trigger_indexes[j] = Scrpt_FindTriggerName(Trigger_names[j]);
412 Trigger_faces[j] = Scrpt_GetTriggerFace(Trigger_indexes[j]);
413 Trigger_rooms[j] = Scrpt_GetTriggerRoom(Trigger_indexes[j]);
414 }
415
416 // Do Sound Index lookups
417 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