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