#include "osiris_import.h"

mprintf_fp mprintf;
MSafe_CallFunction_fp MSafe_CallFunction;
MSafe_GetValue_fp MSafe_GetValue;
Obj_CallEvent_fp Obj_CallEvent;
Trgr_CallEvent_fp Trgr_CallEvent;
Sound_TouchFile_fp Sound_TouchFile;
Obj_FindID_fp Obj_FindID;
Obj_FindType_fp Obj_FindType;
Wpn_FindID_fp Wpn_FindID;
Obj_GetTimeLived_fp Obj_GetTimeLived;
Obj_GetGunPos_fp Obj_GetGunPosFP;
Obj_GetGroundPos_fp Obj_GetGroundPosFP;
Room_Value_fp Room_ValueFP;
Room_IsValid_fp Room_IsValid;
Obj_GetAttachParent_fp Obj_GetAttachParent;
Obj_GetNumAttachSlots_fp Obj_GetNumAttachSlots;
Obj_GetAttachChildHandle_fp Obj_GetAttachChildHandle;
Obj_AttachObjectAP_fp Obj_AttachObjectAP;
Obj_AttachObjectRad_fp Obj_AttachObjectRad;
Obj_UnattachFromParent_fp Obj_UnattachFromParent;
Obj_UnattachChild_fp Obj_UnattachChild;
Obj_UnattachChildren_fp Obj_UnattachChildren;
FVI_RayCast_fp FVI_RayCast;
AI_GetPathID_fp AI_GetPathID;
AI_GoalFollowPathSimple_fp AI_GoalFollowPathSimpleFP;
AI_PowerSwitch_fp AI_PowerSwitch;
AI_Value_fp AI_Value;
Obj_Value_fp Obj_ValueFP;
Matcen_Value_fp Matcen_ValueFP;
AI_TurnTowardsVectors_fp AI_TurnTowardsVectors;
AI_SetType_fp AI_SetType;
AI_FindHidePos_fp AI_FindHidePos;
AI_GoalAddEnabler_fp AI_GoalAddEnabler;
AI_AddGoal_fp AI_AddGoal;
AI_ClearGoal_fp AI_ClearGoal;
AI_FindObjOfType_fp AI_FindObjOfTypeFP;
AI_GetRoomPathPoint_fp AI_GetRoomPathPoint;
AI_FindEnergyCenter_fp AI_FindEnergyCenter;
AI_GetDistToObj_fp AI_GetDistToObj;
AI_SetGoalFlags_fp AI_SetGoalFlags;
AI_SetGoalCircleDist_fp AI_SetGoalCircleDist;
File_ReadBytes_fp File_ReadBytes;
File_ReadInt_fp File_ReadInt;
File_ReadShort_fp File_ReadShort;
File_ReadByte_fp File_ReadByte;
File_ReadFloat_fp File_ReadFloat;
File_ReadDouble_fp File_ReadDouble;
File_ReadString_fp File_ReadString;
File_WriteBytes_fp File_WriteBytes;
File_WriteString_fp File_WriteString;
File_WriteInt_fp File_WriteInt;
File_WriteShort_fp File_WriteShort;
File_WriteByte_fp File_WriteByte;
File_WriteFloat_fp File_WriteFloat;
File_WriteDouble_fp File_WriteDouble;
Scrpt_MemAlloc_fp Scrpt_MemAlloc;
Scrpt_MemFree_fp Scrpt_MemFree;
Scrpt_CancelTimer_fp Scrpt_CancelTimer;
Scrpt_CreateTimer_fp Scrpt_CreateTimer;
MSafe_DoPowerup_fp MSafe_DoPowerup;
Obj_Create_fp Obj_CreateFP;
Game_GetTime_fp Game_GetTime;
Game_GetFrameTime_fp Game_GetFrameTime;
Obj_WBValue_fp Obj_WBValueFP;
Scrpt_TimerExists_fp Scrpt_TimerExists;
Matcen_Reset_fp Matcen_Reset;
Matcen_Copy_fp Matcen_Copy;
Matcen_Create_fp Matcen_Create;
Matcen_FindID_fp Matcen_FindID;
Msn_FlagSet_fp Msn_FlagSet;
Msn_FlagGet_fp Msn_FlagGet;
Player_Value_fp Player_ValueFP;
Obj_SetCustomAnim_fp Obj_SetCustomAnimFP;
Player_AddHudMessage_fp Player_AddHudMessage;
Obj_Ghost_fp Obj_Ghost;
Obj_Burning_fp Obj_BurningFP;
Obj_IsEffect_fp Obj_IsEffect;
File_Open_fp File_Open;
File_Close_fp File_Close;
File_Tell_fp File_Tell;
File_eof_fp File_eof;
Sound_Stop_fp Sound_StopFP;
Sound_Play2d_fp Sound_Play2dFP;
Sound_Play3d_fp Sound_Play3dFP;
Sound_FindId_fp Sound_FindId;
AI_IsObjFriend_fp AI_IsObjFriend;
AI_IsObjEnemy_fp AI_IsObjEnemy;
AI_GoalValue_fp AI_GoalValueFP;
AI_GetNearbyObjs_fp AI_GetNearbyObjsFP;
AI_GetCurGoalIndex_fp AI_GetCurGoalIndex;
OMMS_Malloc_fp OMMS_Malloc;
OMMS_Attach_fp OMMS_Attach;
OMMS_Detach_fp OMMS_Detach;
OMMS_Free_fp OMMS_Free;
OMMS_Find_fp OMMS_Find;
OMMS_GetInfo_fp OMMS_GetInfo;
Cine_Start_fp Cine_Start;
Cine_Stop_fp Cine_Stop;
Scrpt_FindSoundName_fp Scrpt_FindSoundName;
Scrpt_FindRoomName_fp Scrpt_FindRoomName;
Scrpt_FindTriggerName_fp Scrpt_FindTriggerName;
Scrpt_FindObjectName_fp Scrpt_FindObjectName;
Scrpt_GetTriggerRoom_fp Scrpt_GetTriggerRoom;
Scrpt_GetTriggerFace_fp Scrpt_GetTriggerFace;
Scrpt_FindDoorName_fp Scrpt_FindDoorName;
Scrpt_FindTextureName_fp Scrpt_FindTextureName;
Game_CreateRandomSparks_fp Game_CreateRandomSparksFP;
Scrpt_CancelTimerID_fp Scrpt_CancelTimerID;
Game_EnableShip_fp Game_EnableShip;
Game_IsShipEnabled_fp Game_IsShipEnabled;
Path_GetInformation_fp Path_GetInformationFP;
Cine_StartCanned_fp Cine_StartCanned;
Scrpt_FindMatcenName_fp Scrpt_FindMatcenName;
Scrpt_FindPathName_fp Scrpt_FindPathName;
Scrpt_FindLevelGoalName_fp Scrpt_FindLevelGoalName;
LGoal_Value_fp LGoal_ValueFP;
Obj_MakeListOfType_fp Obj_MakeListOfType;
Obj_Kill_fp Obj_Kill;
// OSIRISEXTERN AI_AreRoomsReachable_fp AI_AreRoomsReachable;
AI_IsDestReachable_fp AI_IsDestReachable;
AI_IsObjReachable_fp AI_IsObjReachable;
Game_GetDiffLevel_fp Game_GetDiffLevel;
Game_GetLanguage_fp Game_GetLanguage;
Path_Value_fp Path_Value;

void osicommon_Initialize(tOSIRISModuleInit *mi) {
  int i = 0;
  mprintf = (mprintf_fp)mi->fp[i++];
  MSafe_CallFunction = (MSafe_CallFunction_fp)mi->fp[i++];
  MSafe_GetValue = (MSafe_GetValue_fp)mi->fp[i++];
  Obj_CallEvent = (Obj_CallEvent_fp)mi->fp[i++];
  Trgr_CallEvent = (Trgr_CallEvent_fp)mi->fp[i++];
  Sound_TouchFile = (Sound_TouchFile_fp)mi->fp[i++];
  Obj_FindID = (Obj_FindID_fp)mi->fp[i++];
  Wpn_FindID = (Wpn_FindID_fp)mi->fp[i++];
  Obj_GetTimeLived = (Obj_GetTimeLived_fp)mi->fp[i++];
  Obj_GetGunPosFP = (Obj_GetGunPos_fp)mi->fp[i++];
  Room_ValueFP = (Room_Value_fp)mi->fp[i++];
  Room_IsValid = (Room_IsValid_fp)mi->fp[i++];
  Obj_GetAttachParent = (Obj_GetAttachParent_fp)mi->fp[i++];
  Obj_GetNumAttachSlots = (Obj_GetNumAttachSlots_fp)mi->fp[i++];
  Obj_GetAttachChildHandle = (Obj_GetAttachChildHandle_fp)mi->fp[i++];
  Obj_AttachObjectAP = (Obj_AttachObjectAP_fp)mi->fp[i++];
  Obj_AttachObjectRad = (Obj_AttachObjectRad_fp)mi->fp[i++];
  Obj_UnattachFromParent = (Obj_UnattachFromParent_fp)mi->fp[i++];
  Obj_UnattachChild = (Obj_UnattachChild_fp)mi->fp[i++];
  Obj_UnattachChildren = (Obj_UnattachChildren_fp)mi->fp[i++];
  FVI_RayCast = (FVI_RayCast_fp)mi->fp[i++];
  AI_GetPathID = (AI_GetPathID_fp)mi->fp[i++];
  AI_GoalFollowPathSimpleFP = (AI_GoalFollowPathSimple_fp)mi->fp[i++];
  AI_PowerSwitch = (AI_PowerSwitch_fp)mi->fp[i++];
  AI_TurnTowardsVectors = (AI_TurnTowardsVectors_fp)mi->fp[i++];
  AI_SetType = (AI_SetType_fp)mi->fp[i++];
  AI_FindHidePos = (AI_FindHidePos_fp)mi->fp[i++];
  AI_GoalAddEnabler = (AI_GoalAddEnabler_fp)mi->fp[i++];
  AI_AddGoal = (AI_AddGoal_fp)mi->fp[i++];
  AI_ClearGoal = (AI_ClearGoal_fp)mi->fp[i++];
  AI_Value = (AI_Value_fp)mi->fp[i++];
  AI_FindObjOfTypeFP = (AI_FindObjOfType_fp)mi->fp[i++];
  AI_GetRoomPathPoint = (AI_GetRoomPathPoint_fp)mi->fp[i++];
  AI_FindEnergyCenter = (AI_FindEnergyCenter_fp)mi->fp[i++];
  AI_GetDistToObj = (AI_GetDistToObj_fp)mi->fp[i++];
  AI_SetGoalFlags = (AI_SetGoalFlags_fp)mi->fp[i++];
  AI_SetGoalCircleDist = (AI_SetGoalCircleDist_fp)mi->fp[i++];
  File_ReadBytes = (File_ReadBytes_fp)mi->fp[i++];
  File_ReadInt = (File_ReadInt_fp)mi->fp[i++];
  File_ReadShort = (File_ReadShort_fp)mi->fp[i++];
  File_ReadByte = (File_ReadByte_fp)mi->fp[i++];
  File_ReadFloat = (File_ReadFloat_fp)mi->fp[i++];
  File_ReadDouble = (File_ReadDouble_fp)mi->fp[i++];
  File_ReadString = (File_ReadString_fp)mi->fp[i++];
  File_WriteBytes = (File_WriteBytes_fp)mi->fp[i++];
  File_WriteString = (File_WriteString_fp)mi->fp[i++];
  File_WriteInt = (File_WriteInt_fp)mi->fp[i++];
  File_WriteShort = (File_WriteShort_fp)mi->fp[i++];
  File_WriteByte = (File_WriteByte_fp)mi->fp[i++];
  File_WriteFloat = (File_WriteFloat_fp)mi->fp[i++];
  File_WriteDouble = (File_WriteDouble_fp)mi->fp[i++];
  Scrpt_MemAlloc = (Scrpt_MemAlloc_fp)mi->fp[i++];
  Scrpt_MemFree = (Scrpt_MemFree_fp)mi->fp[i++];
  Scrpt_CancelTimer = (Scrpt_CancelTimer_fp)mi->fp[i++];
  Scrpt_CreateTimer = (Scrpt_CreateTimer_fp)mi->fp[i++];
  MSafe_DoPowerup = (MSafe_DoPowerup_fp)mi->fp[i++];
  Obj_CreateFP = (Obj_Create_fp)mi->fp[i++];
  Game_GetTime = (Game_GetTime_fp)mi->fp[i++];
  Game_GetFrameTime = (Game_GetFrameTime_fp)mi->fp[i++];
  Obj_WBValueFP = (Obj_WBValue_fp)mi->fp[i++];
  Scrpt_TimerExists = (Scrpt_TimerExists_fp)mi->fp[i++];
  Obj_ValueFP = (Obj_Value_fp)mi->fp[i++];
  Matcen_ValueFP = (Matcen_Value_fp)mi->fp[i++];
  Matcen_Reset = (Matcen_Reset_fp)mi->fp[i++];
  Matcen_Copy = (Matcen_Copy_fp)mi->fp[i++];
  Matcen_Create = (Matcen_Create_fp)mi->fp[i++];
  Matcen_FindID = (Matcen_FindID_fp)mi->fp[i++];
  Msn_FlagSet = (Msn_FlagSet_fp)mi->fp[i++];
  Msn_FlagGet = (Msn_FlagGet_fp)mi->fp[i++];
  Player_ValueFP = (Player_Value_fp)mi->fp[i++];
  Obj_SetCustomAnimFP = (Obj_SetCustomAnim_fp)mi->fp[i++];
  Player_AddHudMessage = (Player_AddHudMessage_fp)mi->fp[i++];
  Obj_Ghost = (Obj_Ghost_fp)mi->fp[i++];
  Obj_BurningFP = (Obj_Burning_fp)mi->fp[i++];
  Obj_IsEffect = (Obj_IsEffect_fp)mi->fp[i++];
  File_Open = (File_Open_fp)mi->fp[i++];
  File_Close = (File_Close_fp)mi->fp[i++];
  File_Tell = (File_Tell_fp)mi->fp[i++];
  File_eof = (File_eof_fp)mi->fp[i++];
  Sound_StopFP = (Sound_Stop_fp)mi->fp[i++];
  Sound_Play2dFP = (Sound_Play2d_fp)mi->fp[i++];
  Sound_Play3dFP = (Sound_Play3d_fp)mi->fp[i++];
  Sound_FindId = (Sound_FindId_fp)mi->fp[i++];
  AI_IsObjFriend = (AI_IsObjFriend_fp)mi->fp[i++];
  AI_IsObjEnemy = (AI_IsObjEnemy_fp)mi->fp[i++];
  AI_GoalValueFP = (AI_GoalValue_fp)mi->fp[i++];
  AI_GetNearbyObjsFP = (AI_GetNearbyObjs_fp)mi->fp[i++];
  AI_GetCurGoalIndex = (AI_GetCurGoalIndex_fp)mi->fp[i++];
  OMMS_Malloc = (OMMS_Malloc_fp)mi->fp[i++];
  OMMS_Attach = (OMMS_Attach_fp)mi->fp[i++];
  OMMS_Detach = (OMMS_Detach_fp)mi->fp[i++];
  OMMS_Free = (OMMS_Free_fp)mi->fp[i++];
  OMMS_Find = (OMMS_Find_fp)mi->fp[i++];
  OMMS_GetInfo = (OMMS_GetInfo_fp)mi->fp[i++];
  Cine_Start = (Cine_Start_fp)mi->fp[i++];
  Cine_Stop = (Cine_Stop_fp)mi->fp[i++];
  Scrpt_FindSoundName = (Scrpt_FindSoundName_fp)mi->fp[i++];
  Scrpt_FindRoomName = (Scrpt_FindRoomName_fp)mi->fp[i++];
  Scrpt_FindTriggerName = (Scrpt_FindTriggerName_fp)mi->fp[i++];
  Scrpt_FindObjectName = (Scrpt_FindObjectName_fp)mi->fp[i++];
  Scrpt_GetTriggerRoom = (Scrpt_GetTriggerRoom_fp)mi->fp[i++];
  Scrpt_GetTriggerFace = (Scrpt_GetTriggerFace_fp)mi->fp[i++];
  Scrpt_FindDoorName = (Scrpt_FindDoorName_fp)mi->fp[i++];
  Scrpt_FindTextureName = (Scrpt_FindTextureName_fp)mi->fp[i++];
  Game_CreateRandomSparksFP = (Game_CreateRandomSparks_fp)mi->fp[i++];
  Scrpt_CancelTimerID = (Scrpt_CancelTimerID_fp)mi->fp[i++];
  Obj_GetGroundPosFP = (Obj_GetGroundPos_fp)mi->fp[i++];
  Game_EnableShip = (Game_EnableShip_fp)mi->fp[i++];
  Game_IsShipEnabled = (Game_IsShipEnabled_fp)mi->fp[i++];
  Path_GetInformationFP = (Path_GetInformation_fp)mi->fp[i++];
  Cine_StartCanned = (Cine_StartCanned_fp)mi->fp[i++];
  Scrpt_FindMatcenName = (Scrpt_FindMatcenName_fp)mi->fp[i++];
  Scrpt_FindPathName = (Scrpt_FindPathName_fp)mi->fp[i++];
  Scrpt_FindLevelGoalName = (Scrpt_FindLevelGoalName_fp)mi->fp[i++];
  Obj_FindType = (Obj_FindType_fp)mi->fp[i++];
  LGoal_ValueFP = (LGoal_Value_fp)mi->fp[i++];
  Obj_MakeListOfType = (Obj_MakeListOfType_fp)mi->fp[i++];
  Obj_Kill = (Obj_Kill_fp)mi->fp[i++];
  //	AI_AreRoomsReachable = (AI_AreRoomsReachable_fp)mi->fp[i++];
  AI_IsDestReachable = (AI_IsDestReachable_fp)mi->fp[i++];
  AI_IsObjReachable = (AI_IsObjReachable_fp)mi->fp[i++];
  Game_GetDiffLevel = (Game_GetDiffLevel_fp)mi->fp[i++];
  Game_GetLanguage = (Game_GetLanguage_fp)mi->fp[i++];
  Path_Value = (Path_Value_fp)mi->fp[i++];
}
