Descent3/lib/intelliVIBE.h

122 lines
3.7 KiB
C
Raw Normal View History

2024-04-16 03:43:29 +00:00
#ifndef __INTELLIVIBE_H_
#define __INTELLIVIBE_H_
2024-04-16 18:56:40 +00:00
#include <windows.h> //needed for HWND and HINSTANCE
typedef struct {
float x, y, z;
} fvector;
typedef struct {
HWND hwnd; // handle to the Window associated with Descent 3
HINSTANCE hinst; // instance of the Descent 3 application
} d3_init_info;
typedef struct {
float frametime; // time, in seconds, that the last frame of the game took
float gametime; // time, in seconds, that we have been actively playing the current level
int game_paused; // 1 if the game is currently paused, 0 if it isn't. Note: if the game is paused, Gametime and
// Frametime will be invalid
} d3_frame_info;
typedef struct {
int weapon_index; // what kind of weapon the player is firing, see weapon defines)
} d3_fire_info;
typedef struct {
// Values for thrust are from -1.0 to 1.0)
float pitch_thrust;
float heading_thrust;
float bank_thrust;
float vertical_thrust;
float sideways_thrust;
float forward_thrust;
float afterburn_thrust;
fvector current_velocity; // current velocity of the ship
float shake_magnitude; // If the player's ship is shaking due to some external force, it will be in this value,
// 0<=magnitude<=120
} d3_controls_info;
typedef struct {
fvector force_vector; // direction and magnitude of the instantaneous force
} d3_force_info;
typedef struct {
float damage_amount; // how much damage is being done
} d3_damage_info;
typedef struct {
d3_frame_info frame_info;
d3_fire_info fire_info;
d3_controls_info controls_info;
d3_force_info force_info;
d3_damage_info damage_info;
int flags;
} d3_intellivibe;
2024-04-16 03:43:29 +00:00
////////////////////////////////////////////////////////////
// Flag Defines
2024-04-16 18:56:40 +00:00
#define VIBEFLAG_PLAYER_DEAD 0x00000001
2024-04-16 03:43:29 +00:00
#define VIBEFLAG_PLAYER_RESPAWN 0x00000002
2024-04-16 18:56:40 +00:00
#define VIBEFLAG_LEVEL_END 0x00000004
#define VIBEFLAG_WEAPON_FIRED 0x00000008
#define VIBEFLAG_FORCE_APPLIED 0x00000010
2024-04-16 03:43:29 +00:00
#define VIBEFLAG_PLAYER_DAMAGED 0x00000020
2024-04-16 18:56:40 +00:00
#define VIBEFLAG_QUATERFRAME_0 0x00000040
#define VIBEFLAG_QUATERFRAME_1 0x00000080
#define VIBEFLAG_QUATERFRAME_2 0x00000100
#define VIBEFLAG_QUATERFRAME_3 0x00000200
2024-04-16 03:43:29 +00:00
////////////////////////////////////////////////////////////
// Weapon Defines
2024-04-16 18:56:40 +00:00
#define WEAPON_LASER 0
#define WEAPON_VAUSS 1
#define WEAPON_MICROWAVE 2
#define WEAPON_PLASMA 3
#define WEAPON_FUSION 4
#define WEAPON_SUPER_LASER 5
#define WEAPON_MASSDRIVER 6
#define WEAPON_NAPALM 7
#define WEAPON_EMD 8
#define WEAPON_OMEGA 9
#define WEAPON_CONCUSSION 10
#define WEAPON_HOMING 11
2024-04-16 03:43:29 +00:00
#define WEAPON_IMPACTMORTAR 12
2024-04-16 18:56:40 +00:00
#define WEAPON_SMART 13
#define WEAPON_MEGA 14
#define WEAPON_FRAG 15
#define WEAPON_GUIDED 16
2024-04-16 03:43:29 +00:00
#define WEAPON_NAPALMROCKET 17
2024-04-16 18:56:40 +00:00
#define WEAPON_CYCLONE 18
#define WEAPON_BLACKSHARK 19
#define WEAPON_FLARE 20
2024-04-16 03:43:29 +00:00
////////////////////////////////////////////////////////////
// Functions
#define STDCALLFUNC _stdcall
#ifdef __cplusplus
#define CEXTERN extern "C"
#else
#define CEXTERN
#endif
// Called once, during initialization to initialize the IntelliVIBE device.
// If initialization fails, then it should return 0, else return 1.
CEXTERN int STDCALLFUNC IntelliVIBE_Initialize(d3_init_info *init_info);
2024-04-16 18:56:40 +00:00
typedef int(STDCALLFUNC *IntelliVIBE_Initialize_fp)(d3_init_info *init_info);
2024-04-16 03:43:29 +00:00
// Called once when Descent 3 is about to shutdown, to do any final shutdown
// procedures needed by the device.
CEXTERN void STDCALLFUNC IntelliVIBE_Shutdown(void);
2024-04-16 18:56:40 +00:00
typedef void(STDCALLFUNC *IntelliVIBE_Shutdown_fp)(void);
2024-04-16 03:43:29 +00:00
// Called once per frame during game play. This allows the device to perform
// anything that needs to be done on a frame interval.
CEXTERN void STDCALLFUNC IntelliVIBE_DoQuaterFrame(d3_intellivibe *frame_info);
2024-04-16 18:56:40 +00:00
typedef void(STDCALLFUNC *IntelliVIBE_DoQuaterFrame_fp)(d3_intellivibe *frame_info);
2024-04-16 03:43:29 +00:00
#endif