
/*********************************************************************
 ** Copyright (c) 1992-2022 MAK Technologies, Inc.
 ** All rights reserved.
 *********************************************************************/

#ifndef __diguy_typedefs_H
#define __diguy_typedefs_H

#include <diguy_constants.h> // for diguyCallbackReturn
class diguyCharacter;
class diguyCharacterGesture;
class diguyCrowd;
class diguyImpact;
class diguyParticleSystem;
class diguyParticleManager;
class diguyScenario;
class diguySensorRegion;
class diguySignal;
class diguyVariable;
class diguyView;
class diguyViewCamera;
class diguyViewFog;
class diguyViewLight;
class diguyViewLabel;
class diguyViewPainter;

class diguyGraphicsTexture;
class diguyGraphicsTextureArray;
class diguyGraphicsFile;
class diguyGraphicsMaterial;
class diguyGraphicsMesh;
class diguyGraphicsShaderInstance;
class diguyGraphicsShaderProgram;
class diguyGraphicsShaderTechnique;
class diguyGraphicsInstanceGroup;
class diguyGraphicsState;
class diguyGraphicsLink;
class diguyGraphicsShape;
class diguyGraphicsFrameBuffer;
class diguyParticleSystemRenderer;
class diguyAuthorVisualWaypoint;

/*****************************************************************************/
/**
 *2  Character Typedefs.
 **
 */

/****************************************************************************/
typedef diguyCallbackReturn diguyCharacterCallback(diguyCharacter* character,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef float diguyAltitudeFunction(diguyCharacter* character,
   float x,
   float y,
   float old_z,
   int * valid);

/****************************************************************************/
typedef int diguyFeelerFunction(diguyCharacter* character,
   float origin_x,
   float origin_y,
   float origin_z,
   float dir_x,
   float dir_y,
   float dir_z,
   float max_distance_to_test,
   float* intersection_x,
   float* intersection_y,
   float* intersection_z,
   float* normal_x,
   float* normal_y,
   float* normal_z);


/****************************************************************************/
typedef int diguyScenarioIntersectionFunction(diguyScenario* scenario,
   float origin_x,
   float origin_y,
   float origin_z,
   float dir_x,
   float dir_y,
   float dir_z,
   float max_distance_to_test,
   float* intersection_x,
   float* intersection_y,
   float* intersection_z,
   float* normal_x,
   float* normal_y,
   float* normal_z);

/****************************************************************************/
typedef int diguyScenarioZClearanceFunction(diguyScenario* scenario,
   float origin_x,
   float origin_y,
   float origin_z,
   float radius,
   float ground_angle,
   float z_clear_height,
   int check_below);

/****************************************************************************/
typedef int diguyCharacterLOSFunction(diguyCharacter* character,
   diguyCharacter* target_character,
   int visibility_type /*unused*/);

/****************************************************************************/
typedef int diguyPointLOSFunction(diguyCharacter* character,
   float x,
   float y,
   float z);

/****************************************************************************/
typedef int diguyGet6FloatsFunction(diguyCharacter* character,
   float* f0,
   float* f1,
   float* f2,
   float* f3,
   float* f4,
   float* f5);


/****************************************************************************/
/**
 *2  Scenario Typedefs.
 **
 */

/****************************************************************************/
typedef float diguyScenarioAltitudeFunction(diguyScenario* scenario,
   float x,
   float y,
   float old_z,
   int * valid);

/****************************************************************************/
typedef int diguyScenarioNamedCallback(diguyScenario* scenario,
   const char* callback_name,
   void* callback_user_data);

/****************************************************************************/
typedef int diguyScenarioFindImpactOnLineFunction(diguyImpact* impact,
   float from_x,
   float from_y,
   float from_z,
   float to_x,
   float to_y,
   float to_z,
   diguyScenario* s);

/****************************************************************************/
typedef int diguyExecProgramHandlerFunction(const char* command_line);

/****************************************************************************/
typedef diguyCallbackReturn diguyScenarioCallback(diguyScenario* scenario,
   int callback_id,
   void* callback_params,
   void* callback_user_data);


/****************************************************************************/
/**
 *2  Other DI-Guy Object Typedefs
 **
 */

/****************************************************************************/
typedef diguyCallbackReturn diguyCrowdCallback(diguyCrowd* crowd,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyCallbackReturn diguyCharacterGestureCallback(diguyCharacterGesture* gesture,
   int callback_id,
   void* callback_params,
   void* callback_user_data);


/****************************************************************************/
typedef diguyCallbackReturn diguyViewLightCallback(diguyViewLight* light,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyCallbackReturn diguySensorRegionCallback(diguySensorRegion* sensor_region,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyCallbackReturn diguySignalCallback(diguySignal* signal,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyCallbackReturn diguyVariableCallback(diguyVariable* variable,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyCallbackReturn diguyViewCameraCallback(diguyViewCamera* camera,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyCallbackReturn diguyViewCallback(diguyView* view,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyCallbackReturn diguyViewFogCallback(diguyViewFog* fog,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyCallbackReturn diguyViewLabelCallback(diguyViewLabel* character,
   int callback_id,
   void* callback_params,
   void* callback_user_data);

/****************************************************************************/
typedef diguyViewPainter* diguyViewPainterCreateFunc();


/****************************************************************************/
/**
 *2  Module Library Function Typedefs.
 **
 */
// takes no arguments, returns int
typedef int (*diguyModuleFunctionStandard)();

// takes no arguments, no return value
typedef void (*diguyModuleFunctionReturnsVoid)();

// takes C string argument, returns int
typedef int (*diguyModuleFunctionArgumentConstChar)(const char*);

// takes C string array argument, returns int
typedef int (*diguyModuleFunctionArgumentCharStarStar)(char**);

// takes two int arguments, returns int
typedef int (*diguyModuleFunctionArgument2Ints)(int, int);

// takes two double arguments, returns int
typedef int (*diguyModuleFunctionArgument2Doubles)(double, double);

// takes two double pointer arguments, returns int
typedef int (*diguyModuleFunctionArgument2DoublePtrs)(double*, double*);

// takes four three arguments, returns int
typedef int (*diguyModuleFunctionArgument3Floats)(float, float, float);

// takes four three pointer arguments, returns int
typedef int (*diguyModuleFunctionArgument3FloatPtrs)(float*, float*, float*);

// takes four float arguments, returns int
typedef int (*diguyModuleFunctionArgument4Floats)(float, float, float, float);

// takes four float pointer arguments, returns int
typedef int (*diguyModuleFunctionArgument4FloatPtrs)(float*, float*, float*, float*);

/*****************************************************************************/
/**
 *2  Graphics API Typedefs.
 **
 */

typedef diguyAuthorVisualWaypoint* diguyAuthorVisualWaypointCreateFunc(void* internal_data);
typedef diguyGraphicsFile*     diguyGraphicsFileCreateFunc(void* internal_data);
typedef diguyGraphicsFrameBuffer*  diguyGraphicsFrameBufferCreateFunc(void);
typedef diguyGraphicsInstanceGroup*  diguyGraphicsInstanceGroupCreateFunc(void* internal_data);
typedef diguyGraphicsLink*     diguyGraphicsLinkCreateFunc(void* internal_data);
typedef diguyGraphicsMaterial* diguyGraphicsMaterialCreateFunc(void* internal_data);
typedef diguyGraphicsMesh*     diguyGraphicsMeshCreateFunc(void* internal_data);
typedef diguyGraphicsShaderInstance* diguyGraphicsShaderInstanceCreateFunc(void* internal_data);
typedef diguyGraphicsShaderProgram*  diguyGraphicsShaderProgramCreateFunc(void* internal_data);
typedef diguyGraphicsShaderTechnique*  diguyGraphicsShaderTechniqueCreateFunc(void* internal_data);
typedef diguyGraphicsShape*    diguyGraphicsShapeCreateFunc(void* internal_data);
typedef diguyGraphicsState*    diguyGraphicsStateCreateFunc(void* internal_data);
typedef diguyGraphicsTexture*  diguyGraphicsTextureCreateFunc(void* internal_data);
typedef diguyGraphicsTextureArray*  diguyGraphicsTextureArrayCreateFunc(void* internal_data);
typedef diguyParticleSystem*       diguyParticleSystemCreateFunc(const char * particle_system_name);
typedef diguyParticleSystemRenderer*   diguyParticleRendererCreateFunc(void);
typedef diguyParticleManager* diguyParticleManagerCreateFunc(void);

/*****************************************************************************/
/**
 *2  Deprecated Typedefs.
 **
 */

/****************************************************************************/
typedef int (*diguyUserQueryYesNoFunction)(diguyVariable* result_variable,
   int pause_scenario,
   const char* caption,
   const char* text,
   const char* button0,
   const char* button1);

typedef const char* (*diguyUserQueryTextFunction)(diguyVariable* result_variable,
   int pause_scenario,
   const char* caption,
   const char* text);

typedef int (*diguyUserQueryItemFunction)(diguyVariable* result_variable,
   int pause_scenario,
   const char* caption,
   const char* question,
   const char* arg1,
   const char* arg2, // need at least 2 arguments
   const char* arg3,
   const char* arg4,
   const char* arg5,
   const char* arg6,
   const char* arg7,
   const char* arg8,
   const char* arg9,
   const char* arg10);

typedef int (*diguyUserInformFunction)(int pause_scenario,
   const char* caption,
   const char* text);

typedef int (*diguyStudentLogFunction)(int notify_level, const char* text);


#endif

