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

Function InitializeDLL

scripts/SewerRat.cpp:348–429  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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