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

Function InitializeDLL

scripts/myPowerHouse.cpp:342–423  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

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