Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,179 @@
/******************************************************************************
Joystick.h : Definition of structures and Macros
Author : JENTEY F.
Last update : 06/03/97
20/11/97 DInput 5
******************************************************************************/
#ifndef _INO_MAIN_H
#define _INO_MAIN_H
#include "cpa_std.h"
#include "DInput.h"
/**************************************/
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
/**************************************/
#if !defined(U64)
#define INO_C_wNbMaxDevice 20
#define INO_C_wNbMaxAxis 6
#else /* U64, 4 joystick with only 2 axes */
#define INO_C_wNbMaxDevice 4
#define INO_C_wNbMaxAxis 2
#endif
/**************************************************************************
Device type.
***************************************************************************/
#define INO_C_uwUnknown 0
#define INO_C_uwMouse (1 << 2)
#define INO_C_uwKeyboard (1 << 3)
#define INO_C_uwJoystick (1 << 4)
#define INO_C_uwAnyType 0xFF
/**************************************************************************
Device status.
***************************************************************************/
#define INO_C_ucConnected 1
#define INO_C_ucAcquired (1 << 1)
#define INO_C_ucAccessError (1 << 2)
#define INO_C_ucGLDLink (1 << 3)
#define INO_C_ucActivated (1 << 4)
/**************************************************************************
Read mode for INO_fn_wReadAllDevices (short wMode).
***************************************************************************/
#define INO_C_wAllDevices 1
#define INO_C_wConnectedDevices 2
/**************************************************************************
Key or button state.
***************************************************************************/
#define INO_C_ucButtonDown 0x80
#define INO_C_ucKeyDown INO_C_ucButtonDown
#define INO_C_ucKeyToggled 0x01
/**************************************************************************
INO device common capabilities
***************************************************************************/
typedef struct stDevCaps
{
unsigned char m_ucNbButtons;
unsigned long m_ulCapsFlags;
} INO_tdstDevCaps;
/**************************************************************************
INO device state
***************************************************************************/
typedef struct stDevState
{
unsigned char m_ucStatus; /* Connected, acquired, link with GLD */
} INO_tdstDevState;
/**************************************************************************
INO axis capabilities
***************************************************************************/
typedef struct stAxisCaps
{
long m_lCenter;
long m_lRange;
long m_lThreshold;
} INO_tdstAxisCaps;
/**************************************************************************
INO device structure
***************************************************************************/
#ifdef __cplusplus
struct stDevice;
typedef struct stDevice INO_tdstDevice, *INO_tdhDevice;
#endif /* __cplusplus*/
typedef short (*INO_fn_wMethod)(INO_tdstDevice);
#ifndef __cplusplus
typedef
#endif
struct stDevice
{
unsigned short m_uwType;
INO_tdstDevCaps *m_p_stCaps; /* Device type specific caps */
INO_tdstDevState *m_p_stState; /* Device state, to cast acording to the device type */
unsigned long m_ulLastTimeCount;
/* Historic */
short m_wHistoricSize;
short m_wHistoricHead;
short m_wRecordNumber;
void *m_pvHistoric;
/* Device access methods */
INO_fn_wMethod m_pfnRead;
}
#ifdef __cplusplus
;
#else
INO_tdstDevice, *INO_tdhDevice;
#endif /* __cplusplus*/
/* Device capabilities */
#define INO_M_uwType(hDev) ((hDev)->m_uwType & 0xFF)
#define INO_M_uwSubType(hDev) ((hDev)->m_uwType)
#define INO_M_ucNbButtons(hDev) ((hDev)->m_p_stCaps->m_ucNbButtons)
#define INO_M_lNbKeys(hDev) INO_M_lNbButtons(hDev)
#define INO_M_ulAxes(hDev) ((hDev)->m_p_stCaps->m_ulCapsFlags & C_ulAxesMask)
/* Device state */
#define INO_M_wReadDevice(hDev) ((hDev)->m_pfnRead(hDev))
#define INO_M_bIsConnected(hDev) (((hDev)->m_p_stState->m_ucStatus & INO_C_ucConnected) != 0)
#define INO_M_bIsFocused(hDev) (((hDev)->m_p_stState->m_ucStatus & INO_C_ucAcquired) != 0)
#define INO_M_bDeviceReady(hDev) (((hDev)->m_p_stState->m_ucStatus & (INO_C_ucConnected | INO_C_ucAcquired)) \
== (INO_C_ucConnected | INO_C_ucAcquired) )
/******************************************************************************
All functions return 1 if Ok else 0
******************************************************************************/
#if defined(__cplusplus)
#define INO_EXTERN
extern "C"
{
#else
#define INO_EXTERN extern
#endif
INO_EXTERN CPA_EXPORT short INO_fn_wInit(HINSTANCE hInstance, HWND hWindow);
INO_EXTERN CPA_EXPORT void INO_fn_vRelease();
INO_EXTERN CPA_EXPORT INO_tdhDevice INO_fn_hCreateDevice(unsigned short uwType, short wHistoricSize);
INO_EXTERN CPA_EXPORT short INO_fn_wReleaseDevice(INO_tdhDevice hDevice);
INO_EXTERN CPA_EXPORT void INO_fn_vResetDevice(INO_tdhDevice hDevice);
INO_EXTERN CPA_EXPORT short INO_fn_wGetNbDevices(unsigned short uwType);
INO_EXTERN CPA_EXPORT short INO_fn_wIsHandleValid(INO_tdhDevice hDev);
INO_EXTERN CPA_EXPORT short INO_fn_wInvalidateHandle(INO_tdhDevice *hDev);
INO_EXTERN CPA_EXPORT short INO_fn_wIsConnected(INO_tdhDevice hDev);
INO_EXTERN CPA_EXPORT short INO_fn_wReadAllDevices(unsigned short uwType, short wMode);
INO_EXTERN CPA_EXPORT short INO_fn_wActivateDevice(INO_tdhDevice hDev);
INO_EXTERN CPA_EXPORT short INO_fn_wDeactivateDevice(INO_tdhDevice hDev);
INO_EXTERN CPA_EXPORT void INO_fn_vUpdateLastError(unsigned short uwErrorCode);
#if defined(__cplusplus)
#undef INO_EXTERN
}
#endif
#endif /* _INO_MAIN_H */

View File

@@ -0,0 +1,597 @@
/******************************************************************************
Joystick.h : Definition of structures and Macros
Author : JENTEY F.
Last update : 06/03/97
******************************************************************************/
#ifndef _INO_JOYSTICK_H
#define _INO_JOYSTICK_H
#ifndef u_short
#define u_short unsigned short
#endif
#ifndef u_long
#define u_long unsigned long
#endif
/**************************************/
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
/**************************************/
/**************************************************************************
All functions return a short value that should be compared with the
following ones.
***************************************************************************/
#define C_wJoyError 32767
#define C_wJoyTrue 32766
#define C_wJoyFalse 32765
/**************************************************************************
Define the joystick type.
***************************************************************************/
#define C_wJoyNone 1
#define C_wJoyTypeJoystick 2
#define C_wJoyTypePad 3
#define C_wJoyTypeVolant 4
/**************************************************************************
Define the executing mode of the device.
***************************************************************************/
#define C_wJoyNormalMode 0
#define C_wJoyDemoRecordingMode 1
#define C_wJoyDemoPlayingMode 2
/**************************************************************************
Define the fn_wJoyReadJoystick mode.
***************************************************************************/
#define C_wJoyReadAll 0
#define C_wJoyReadConnected 1
/**************************************************************************
These constants can be used with the wJoystickNum parameter of functions.
***************************************************************************/
#define C_wJoystick1 0
#define C_wJoystick2 1
#define C_wJoystick3 2
#define C_wJoystick4 3
#define C_wJoystick5 4
#define C_wJoystick6 5
#define C_wJoystick7 6
#define C_wJoystick8 7
#define C_wJoystick9 8
#define C_wJoystick10 9
#define C_wJoystick11 10
#define C_wJoystick12 11
#define C_wJoystick13 12
#define C_wJoystick14 13
#define C_wJoystick15 14
#define C_wJoystick16 15
/**************************************************************************
These constants can be used with the ulButtonFlag parameter of functions
***************************************************************************/
#define C_ulButtonFlag1 1
#define C_ulButtonFlag2 1 << 1
#define C_ulButtonFlag3 1 << 2
#define C_ulButtonFlag4 1 << 3
#define C_ulButtonFlag5 1 << 4
#define C_ulButtonFlag6 1 << 5
#define C_ulButtonFlag7 1 << 6
#define C_ulButtonFlag8 1 << 7
#define C_ulButtonFlag9 1 << 8
#define C_ulButtonFlag10 1 << 9
#define C_ulButtonFlag11 1 << 10
#define C_ulButtonFlag12 1 << 11
#define C_ulButtonFlag13 1 << 12
#define C_ulButtonFlag14 1 << 13
#define C_ulButtonFlag15 1 << 14
#define C_ulButtonFlag16 1 << 15
#define C_ulButtonFlag17 1 << 16
#define C_ulButtonFlag18 1 << 17
#define C_ulButtonFlag19 1 << 18
#define C_ulButtonFlag20 1 << 19
#define C_ulButtonFlag21 1 << 20
#define C_ulButtonFlag22 1 << 21
#define C_ulButtonFlag23 1 << 22
#define C_ulButtonFlag24 1 << 23
#define C_ulButtonFlag25 1 << 24
#define C_ulButtonFlag26 1 << 25
#define C_ulButtonFlag27 1 << 26
#define C_ulButtonFlag28 1 << 27
#define C_ulButtonFlag29 1 << 28
#define C_ulButtonFlag30 1 << 29
#define C_ulButtonFlag31 1 << 30
#define C_ulButtonFlag32 1 << 31
#define C_ulButtonAll 0xFFFFFFFF
/**************************************************************************
Joystick capabilities flags
***************************************************************************/
#define C_ulJoyX 1
#define C_ulJoyY 1 << 1
#define C_ulJoyZ 1 << 2
#define C_ulJoyR 1 << 3
#define C_ulJoyU 1 << 4
#define C_ulJoyV 1 << 5
#define C_ulJoyDiscretPOV 1 << 6
#define C_ulJoyContinuousPOV 1 << 7
/**************************************************************************
Joystick directions flags
***************************************************************************/
#define C_ulJoyLeft 1
#define C_ulJoyRight 1 << 1
#define C_ulJoyUp 1 << 2
#define C_ulJoyDown 1 << 3
#define C_ulJoyZUp 1 << 4
#define C_ulJoyZDown 1 << 5
#define C_ulJoyPOVCentered 1 << 6
#define C_ulJoyPOVLeft 1 << 7
#define C_ulJoyPOVRight 1 << 8
#define C_ulJoyPOVForward 1 << 9
#define C_ulJoyPOVBackward 1 << 10
/**************************************************************************
Joystick error code
***************************************************************************/
#define C_FirstErrorJoystick 0x1000
#define C_ErrNoJoystickDriver ( C_FirstErrorJoystick + 0 )
#define C_ErrDriverNotInitialized ( C_FirstErrorJoystick + 1 )
#define C_ErrJoystickNotActive ( C_FirstErrorJoystick + 2 )
#define C_ErrFeatureNotAvailable ( C_FirstErrorJoystick + 3 )
#define C_ErrBadButtonFlag ( C_FirstErrorJoystick + 4 )
#define C_ErrBadJoystick ( C_FirstErrorJoystick + 5 )
#define C_ErrNotInJoyRecordingMode ( C_FirstErrorJoystick + 6 )
#define C_ErrNotInJoyNormalMode ( C_FirstErrorJoystick + 7 )
#define C_ErrNotInJoyPlayingMode ( C_FirstErrorJoystick + 7 )
#define C_ErrJoyBadFileFormat ( C_FirstErrorJoystick + 9 )
#define C_ErrJoyDemoFileError ( C_FirstErrorJoystick + 10 )
#define C_ErrJoyHistoricOverflow ( C_FirstErrorJoystick + 11 )
#define C_ErrJoystickNotAllocated ( C_FirstErrorJoystick + 12 )
#define C_ErrJoystickNotConfigured ( C_FirstErrorJoystick + 13 )
#define C_ErrNoJoystickAvailable ( C_FirstErrorJoystick + 14 )
#define C_ErrAlreadyAllocated ( C_FirstErrorJoystick + 15 )
#define C_ErrMemoryError ( C_FirstErrorJoystick + 16 )
/******************************************************************************
All functions return a short type value that must be compared with the
C_wJoyError to check if the function success. You can then read the error
code with the error management functions.
******************************************************************************/
#if defined(__cplusplus)
extern "C"
{
/******************************************************************************
Joystick configuration functions.
******************************************************************************/
/*
This function must be called one time when the game is launched. The
parameter HistorySize is the number of previous status conserve.
*/
/*CPA_EXPORT short INO_fn_wInitGamePort(short wHistorySize);*/
/*
Reinitialization of the joysticks. The history is clear and it check if
configuration has changed (new joysticks are connected).
*/
CPA_EXPORT short INO_fn_wResetGamePort(void);
/*
This function free memory and release joystick ressource.
*/
CPA_EXPORT short INO_fn_wFreeGamePort(void);
/*
Check if there is a gameport driver.
Return C_wJoyTrue or C_wJoyFalse
*/
CPA_EXPORT short INO_fn_wUpdateGamePort(void);
/*
Try to allocate a joystick.
If ok return a handle to the joystick
*/
CPA_EXPORT short INO_fn_wAllocJoystick(short wJoystickNum);
/*
Returns the id ( C_wJoystick'n' ) of the first connected joystick.
*/
CPA_EXPORT short INO_fn_wAllocFirstJoystickAvailable(void);
/*
fn_wJoyFreeJoystick.
*/
CPA_EXPORT short INO_fn_wFreeJoystick(short wJoystickNum);
/*
Update the specified joystick capabilities and state.
*/
CPA_EXPORT short INO_fn_wUpdateJoystick(short wJoystickNum);
/*
This function return the maximum joystick number supported by the driver.
*/
CPA_EXPORT short INO_fn_wGetMaximumJoystickNumber(void);
/*
This function checks if the specified joystick is connected.
The result can be C_wJoyTrue, C_wJoyFalse or C_wJoyError.
*/
CPA_EXPORT short INO_fn_wIsJoystickConnected(short wJoystickNum);
/*
fn_wJoyIsAllocated
*/
CPA_EXPORT short INO_fn_wIsJoystickAllocated(short wJoystickNum);
/*
Set the type of joystick
*/
CPA_EXPORT short INO_fn_wSetJoystickType(short wJoystickNum, short wType);
/*
Get the type of joystick
*/
CPA_EXPORT short INO_fn_wGetJoystickType(short wJoystickNum);
/*
This function returns the number of buttons of the specified joystick.
*/
CPA_EXPORT short INO_fn_wGetJoystickButtonNumber(short wJoystickNum);
/*
Number of direction axis of the specified joystick.
*/
CPA_EXPORT short INO_fn_wGetJoystickAxisNumber(short wJoystickNum);
/*
This function filled the ulFlagInfo parameter with the capabilities flags
(defined in this file) of the specified joystick.
*/
CPA_EXPORT short INO_fn_wGetJoystickMovmentCaps(short wJoystickNum, u_long *p_ulFlagInfo);
/*
This function sets the joystick extra features (like z-axis) the fn_JoyReadJoystick
muist update. The ulFlagInfo parameter is a combinaisson of the capabilities flags.
*/
CPA_EXPORT short INO_fn_wSetJoystickActiveCaps(u_long ulCapsFlag);
/*****************************************************************
Demo mode function support
*****************************************************************/
/*
With this function, you can define the exit demo button for the
specified joystick. You can select several button by a combinaison
the C_ulButtonFlag'n' value, or all button with C_ulButtonAll.
Default is none.
For the joystick you are recording, you shouldn't specified a
button that is used in the game.
*/
CPA_EXPORT short INO_fn_wSetStopRecordingJoystickButton(short wJoystickNum, u_long ulButtonFlag);
/*
This function define the joystick to record. Default is
C_wJoystick1.
*/
CPA_EXPORT short INO_fn_wSetJoystickToRecord(short wJoystickNum);
/*
This function start the demo recording mode.
*/
CPA_EXPORT short INO_fn_wStartRecordingJoystick(char *p_szFileName, short wDemoSize);
/*
This function quit the demo recording mode.
*/
CPA_EXPORT short INO_fn_wStopRecordingJoystick(void);
/*
This function return the number of frame of the demo sequence.
*/
CPA_EXPORT u_long INO_fn_ulGetJoystickDemoFrameCount(void);
/*
This function start the demo playing mode with the given file sequence.
*/
CPA_EXPORT short INO_fn_wStartJoystickDemo(char *p_szFileName);
/*
This function quit the demo playing mode.
You quit the demo playing mode automatically when you push a joystick button.
But you also can associate this function to a key stroke for example.
*/
CPA_EXPORT short INO_fn_wStopJoystickDemo(void);
/*
This function return the current joystick mode.(normal,demo
recording or demo playing).
*/
CPA_EXPORT short INO_fn_wGetJoystickCurrentMode(void);
/******************************************************************************
This section defines the query functions.
******************************************************************************/
/*
This function must be called at regular interval, for example each VBL.
Update the informations about active joysticks.
wReadMode indicates if you wanted to read all allocated joystick (C_wJoyReadAll)
,(useful to test if joystick are plugged, unplugged.
or only plugged joystick (C_wJoyReadConnected).
*/
CPA_EXPORT short INO_fn_wReadJoystick(short wReadMode);
/*
Set a connected joystick as Active. By default, only the first joystick is
active.
*/
CPA_EXPORT short INO_fn_wAddActiveJoystick(short wJoystickNum);
/*
Remove a joystick from the active joystick list.
*/
CPA_EXPORT short INO_fn_wRemoveActiveJoystick(short wJoystickNum);
/*
The 10 following functions check the current directions for the
specified joystick. The result must be check with C_wJoyTrue, C_wJoyFlase
or C_wJoyError.
*/
CPA_EXPORT short INO_fn_wIsJoystickLeft(short wJoystickNum);
CPA_EXPORT short INO_fn_wIsJoystickRight(short wJoystickNum);
CPA_EXPORT short INO_fn_wIsJoystickUp(short wJoystickNum);
CPA_EXPORT short INO_fn_wIsJoystickDown(short wJoystickNum);
CPA_EXPORT short INO_fn_wIsJoystickZUp(short wJoystickNum);
CPA_EXPORT short INO_fn_wIsJoystickZDown(short wJoystickNum);
CPA_EXPORT short INO_fn_wJoystickJustLeft(short wJoystickNum);
CPA_EXPORT short INO_fn_wJoystickJustRight(short wJoystickNum);
CPA_EXPORT short INO_fn_wJoystickJustUp(short wJoystickNum);
CPA_EXPORT short INO_fn_wJoystickJustDown(short wJoystickNum);
/*
Return the current position of the joystick along the specified axis
The return value is a double contained between -1.0 to 1.0
*/
CPA_EXPORT short INO_fn_wGetJoystickCurrentPosition(short wJoystickNum, short wAxis, double *pdfPosition);
/*
This function test the buttons of th specified joystick. If several
buttons are specified, the result is true if all selected buttons
are pressed.
*/
CPA_EXPORT short INO_fn_wIsJoystickButtonPressed(short wJoystickNum, u_long ulButtonFlag);
CPA_EXPORT short INO_fn_wJoystickButtonJustPressed(short wJoystickNum, u_long ulButtonFlag);
CPA_EXPORT short INO_fn_wJoystickButtonJustReleased(short wJoystickNum, u_long ulButtonFlag);
CPA_EXPORT short INO_fn_wGetJoystickCurrentButton(short wJoystickNum, u_long *p_ulButtonFlag);
/*
The next 2 functions fill the second parameter with the current direction
flags or current pressed button flags of the selected joystick.
*/
CPA_EXPORT short INO_fn_wGetJoystickCurrentDirection(short wJoystickNum, u_long *p_ulDirectionFlag);
CPA_EXPORT short INO_fn_wJoystickDirectionJustReleased(short wJoystickNum, u_long ulDirectionFlag);
/*
The following functions check a previous direction or button status for the
specified joystick. The result must be check with C_wJoyTrue, C_wJoyFlase
or C_wJoyError.
*/
CPA_EXPORT short INO_fn_wWasJoystickLeft(short wJoystickNum, short wHistoryNum);
CPA_EXPORT short INO_fn_wWasJoystickRight(short wJoystickNum, short wHistoryNum);
CPA_EXPORT short INO_fn_wWasJoystickUp(short wJoystickNum, short wHistoryNum);
CPA_EXPORT short INO_fn_wWasJoystickDown(short wJoystickNum, short wHistoryNum);
CPA_EXPORT short INO_fn_wWasJoystickZUp(short wJoystickNum, short wHistoryNum);
CPA_EXPORT short INO_fn_wWasJoystickZDown(short wJoystickNum, short wHistoryNum);
/*
This function test the buttons of the specified joystick. If several
buttons are specified, the result is true if all selected buttons
were pressed.
*/
CPA_EXPORT short INO_fn_wWasJoystickButtonPressed(short wJoystickNum, u_long ulButtonFlag, short wHistoryNum);
/*
The next 2 functions fill the third parameter with the current direction
flags or current pressed button flags of the selected joystick.
*/
CPA_EXPORT short INO_fn_wGetJoystickPreviousDirection(short wJoystickNum, short wHistoryNum, u_long *p_ulDirectionFlag);
CPA_EXPORT short INO_fn_wGetJoystickPreviousButton(short wJoystickNum, short wHistoryNum, u_long *p_ulButtonFlag);
/*
Return the position of the joystick in a previous state along the specified axis
The return value is a double contained between -1.0 to 1.0
*/
CPA_EXPORT short INO_fn_wGetJoystickPreviousPosition(short wJoystickNum, short wAxis, short wHistoryNum, double *pdfPosition);
/*
If not C_wJoyError, the result is the elapsed time of inactivity
of the selected joystick.
*/
/*
CPA_EXPORT short fn_wJoyInactivityTime(short wJoystickNum , u_long *p_ulLaps);
*/
/*
Return the time between the specified prevoius state of the joystick and
the actual state.
*/
/*
CPA_EXPORT short fn_wJoyElapsedTime (short wJoystickNum , short wHistoryNum , u_long *p_ulLaps );
*/
/*
This function returns a pointer to the last error message string.
*/
CPA_EXPORT short INO_fn_wGetJoystickErrorString( char **pp_szErrorString);
/*
This function returns the last error code.
*/
CPA_EXPORT u_long INO_fn_wJGetLastJoystickErrorCode(void);
}
#else /* Prototype C */
extern CPA_EXPORT short INO_fn_wInitGamePort(short wHistorySize);
extern CPA_EXPORT short INO_fn_wResetGamePort(void);
extern CPA_EXPORT short INO_fn_wUpdateGamePort(void);
extern CPA_EXPORT short INO_fn_wFreeGamePort(void);
extern CPA_EXPORT short INO_fn_wAllocJoystick(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wFreeJoystick(short wJoyHandle);
extern CPA_EXPORT short INO_fn_wAllocFirstJoystickAvailable();
extern CPA_EXPORT short INO_fn_wUpdateJoystick(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wGetMaximumJoystickNumber(void);
extern CPA_EXPORT short INO_fn_wIsJoystickConnected(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wIsJoystickAllocated(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wSetJoystickType(short wJoystickNum, short wType);
extern CPA_EXPORT short INO_fn_wGetJoystickType(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wGetJoystickButtonNumber(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wGetJoystickAxisNumber(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wGetJoystickMovmentCaps(short wJoystickNum, u_long *p_ulFlagInfo);
extern CPA_EXPORT short INO_fn_wSetJoystickActiveCaps(u_long ulCapsFlag);
extern CPA_EXPORT short INO_fn_wSetStopRecordingJoystickButton(short wJoystickNum, u_long ulButtonFlag);
extern CPA_EXPORT short INO_fn_wSetJoystickToRecord(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wStartRecordingJoystick(char *p_szFileName, short wDemoSize);
extern CPA_EXPORT short INO_fn_wStopRecordingJoystick(void);
extern CPA_EXPORT short INO_fn_wStartJoystickDemo(char *p_szFileName);
extern CPA_EXPORT short INO_fn_wStopJoystickDemo(void);
extern CPA_EXPORT short INO_fn_wGetJoystickCurrentMode(void);
extern CPA_EXPORT u_long INO_fn_ulGetJoystickDemoFrameCount(void);
extern CPA_EXPORT short INO_fn_wReadJoystick(short wReadMode);
extern CPA_EXPORT short INO_fn_wAddActiveJoystick(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wRemoveActiveJoystick(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wIsJoystickLeft(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wIsJoystickRight(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wIsJoystickUp(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wIsJoystickDown(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wIsJoystickZUp(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wIsJoystickZDown(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wJoystickJustLeft(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wJoystickJustRight(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wJoystickJustUp(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wJoystickJustDown(short wJoystickNum);
extern CPA_EXPORT short INO_fn_wGetJoystickCurrentPosition(short wJoystickNum, short wAxis, double *pdfPosition);
extern CPA_EXPORT short INO_fn_wIsJoystickButtonPressed(short wJoystickNum, u_long ulButtonFlag);
extern CPA_EXPORT short INO_fn_wJoystickButtonJustPressed(short wJoystickNum, u_long ulButtonFlag);
extern CPA_EXPORT short INO_fn_wJoystickButtonJustReleased(short wJoystickNum, u_long ulButtonFlag);
extern CPA_EXPORT short INO_fn_wGetJoystickCurrentDirection(short wJoystickNum, u_long *p_ulDirectionFlag);
extern CPA_EXPORT short INO_fn_wJoystickDirectionJustReleased(short wJoystickNum, u_long ulDirectionFlag);
extern CPA_EXPORT short INO_fn_wGetJoystickCurrentButton(short wJoystickNum, u_long *p_ulButtonFlag);
extern CPA_EXPORT short INO_fn_wWasJoystickLeft(short wJoystickNum, short wHistoryNum);
extern CPA_EXPORT short INO_fn_wWasJoystickRight(short wJoystickNum, short wHistoryNum);
extern CPA_EXPORT short INO_fn_wWasJoystickUp(short wJoystickNum, short wHistoryNum);
extern CPA_EXPORT short INO_fn_wWasJoystickDown(short wJoystickNum, short wHistoryNum);
extern CPA_EXPORT short INO_fn_wWasJoystickZUp(short wJoystickNum, short wHistoryNum);
extern CPA_EXPORT short INO_fn_wWasJoystickZDown(short wJoystickNum, short wHistoryNum);
extern CPA_EXPORT short INO_fn_wWasJoystickButtonPressed(short wJoystickNum, u_long ulButtonFlag, short wHistoryNum);
extern CPA_EXPORT short INO_fn_wGetJoystickPreviousDirection(short wJoystickNum, short wHistoryNum, u_long *p_ulDirectionFlag);
extern CPA_EXPORT short INO_fn_wGetJoystickPreviousButton(short wJoystickNum, short wHistoryNum, u_long *p_ulButtonFlag);
extern CPA_EXPORT short INO_fn_wGetJoystickPreviousPosition(short wJoystickNum, short wAxis, short wHistoryNum, double *pdfPosition);
/*fn_wJoyInactivityTime(short wJoystickNum , u_long *p_ulLaps);*/
/*fn_wJoyElapsedTime (short wJoystickNum , short wHistoryNum , u_long *p_ulLaps );*/
extern CPA_EXPORT short INO_fn_wGetJoystickErrorString(char **pp_szErrorString);
extern CPA_EXPORT u_long INO_fn_wJGetLastJoystickErrorCode(void);
#endif
/* Old prototype compatibility */
#define fn_wJoyInitGamePort(A) INO_fn_wInitGamePort(A)
#define fn_wJoyResetGamePort() INO_fn_wResetGamePort()
#define fn_wJoyUpdateGamePort() INO_fn_wUpdateGamePort()
#define fn_wJoyFreeGamePort() INO_fn_wFreeGamePort()
#define fn_wJoyAllocJoystick(A) INO_fn_wAllocJoystick(A)
#define fn_wJoyAllocFirstJoystickAvailable() INO_fn_wAllocFirstJoystickAvailable()
#define fn_wJoyUpdateJoystick(A) INO_fn_wUpdateJoystick(A)
#define fn_wJoyFreeJoystick(A) INO_fn_wFreeJoystick(A)
#define fn_wJoyMaximumJoystickNumber() INO_fn_wGetMaximumJoystickNumber()
#define fn_wJoyIsConnected(A) INO_fn_wIsJoystickConnected(A)
#define fn_wJoyIsAllocated(A) INO_fn_wIsJoystickAllocated(A)
#define fn_wJoySetJoystickType(A, B) INO_fn_wSetJoystickType(A, B)
#define fn_wJoyGetJoystickType(A) INO_fn_wGetJoystickType(A)
#define fn_wJoyButtonNumber(A) INO_fn_wGetJoystickButtonNumber(A)
#define fn_wJoyAxisNumber(A) INO_fn_wGetJoystickAxisNumber(A)
#define fn_wJoyMovmentCaps(A, B) INO_fn_wGetJoystickMovmentCaps(A, B)
#define fn_wJoySetActiveCaps(A) INO_fn_wSetJoystickActiveCaps(A)
#define fn_wJoySetDemoRecordExitButton(A, B) INO_fn_wSetStopRecordingJoystickButton(A, B)
#define fn_wJoySetRecordJoystick(A) INO_fn_wSetJoystickToRecord(A)
#define fn_wJoyStartDemoRecording(A, B) INO_fn_wStartRecordingJoystick(A, B)
#define fn_wJoyExitDemoRecording() INO_fn_wStopRecordingJoystick()
#define fn_wJoyStartDemoPlaying(A) INO_fn_wStartJoystickDemo(A)
#define fn_wJoyExitDemoPlaying() INO_fn_wStopJoystickDemo()
#define fn_wJoyGetCurrentMode() INO_fn_wGetJoystickCurrentMode()
#define fn_ulJoyGetDemoFrameCount() INO_fn_ulGetJoystickDemoFrameCount()
#define fn_wJoyReadJoystick(A) INO_fn_wReadJoystick(A)
#define fn_wJoyAddActiveJoystick(A) INO_fn_wAddActiveJoystick(A)
#define fn_wJoyRemoveActiveJoystick(A) INO_fn_wRemoveActiveJoystick(A)
#define fn_wJoyIsLeft(A) INO_fn_wIsJoystickLeft(A)
#define fn_wJoyIsRight(A) INO_fn_wIsJoystickRight(A)
#define fn_wJoyIsUp(A) INO_fn_wIsJoystickUp(A)
#define fn_wJoyIsDown(A) INO_fn_wIsJoystickDown(A)
#define fn_wJoyIsZUp(A) INO_fn_wIsJoystickZUp(A)
#define fn_wJoyIsZDown(A) INO_fn_wIsJoystickZDown(A)
#define fn_wJoyJustLeft(A) INO_fn_wJoystickJustLeft(A)
#define fn_wJoyJustRight(A) INO_fn_wJoystickJustRight(A)
#define fn_wJoyJustUp(A) INO_fn_wJoystickJustUp(A)
#define fn_wJoyJustDown(A) INO_fn_wJoystickJustDown(A)
#define fn_wJoyGetCurrentPosition(A, B, C) INO_fn_wGetJoystickCurrentPosition(A, B, C)
#define fn_wJoyIsButtonPressed(A, B) INO_fn_wIsJoystickButtonPressed(A, B)
#define fn_wJoyCurrentDirection(A, B) INO_fn_wGetJoystickCurrentDirection(A, B)
#define fn_wJoyCurrentButton(A, B) INO_fn_wGetJoystickCurrentButton(A, B)
#define fn_wJoyWasLeft(A, B) INO_fn_wWasJoystickLeft(A, B)
#define fn_wJoyWasRight(A, B) INO_fn_wWasJoystickRight(A, B)
#define fn_wJoyWasUp(A, B) INO_fn_wWasJoystickUp(A, B)
#define fn_wJoyWasDown(A, B) INO_fn_wWasJoystickDown(A, B)
#define fn_wJoyWasZUp(A, B) INO_fn_wWasJoystickZUp(A, B)
#define fn_wJoyWasZDown(A, B) INO_fn_wWasJoystickZDown(A, B)
#define fn_wJoyWasPressed(A, B, C) INO_fn_wWasJoystickButtonPressed(A, B, C)
#define fn_wJoyPreviousDirection(A, B, C) INO_fn_wGetJoystickPreviousDirection(A, B, C)
#define fn_wJoyPreviousButton(A, B, C) INO_fn_wGetJoystickPreviousButton(A, B, C)
#define fn_wJoyGetPreviousPosition(A, B, C, D) INO_fn_wGetJoystickPreviousPosition(A, B, C, D)
#define fn_wJoyGetErrorString(A) INO_fn_wGetJoystickErrorString(A)
#define fn_wJoyGetLastErrorCode() INO_fn_wJGetLastJoystickErrorCode()
#endif /* _INO_JOYSTICK_H_ */

View File

@@ -0,0 +1,448 @@
/*
Keyboard.h : Functions definition for the keyboard management.
Author : JENTEY F.
Last update : 03/07/96
01/08/97 Direct Input
*/
#ifndef _INO_KEYBOARD_H
#define _INO_KEYBOARD_H
#include "cpa_std.h"
#include "dinput.h"
#ifndef u_short
#define u_short unsigned short
#endif
#ifndef u_long
#define u_long unsigned long
#endif
/**************************************/
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
/**************************************/
/* All functions return a short value that should be compared with this constant */
#define C_wKbError 32767
#define C_wKbTrue 32766
#define C_wKbFalse 32765
/* Keyboard error code */
#define C_FirstErrorKeyboard 0x2000
#define C_ErrKeyboardNotInitialized ( C_FirstErrorKeyboard + 0 )
#define C_ErrBadKeyCode ( C_FirstErrorKeyboard + 1 )
#define C_ErrNotInRecordingMode ( C_FirstErrorKeyboard + 2 )
#define C_ErrNotInNormalMode ( C_FirstErrorKeyboard + 3 )
#define C_ErrNotInPlayingMode ( C_FirstErrorKeyboard + 4 )
#define C_ErrDemoBadFileFormat ( C_FirstErrorKeyboard + 5 )
#define C_ErrDemoFileError ( C_FirstErrorKeyboard + 6 )
#define C_ErrHistoricOverflow ( C_FirstErrorKeyboard + 7 )
#define C_ErrFocusLost ( C_FirstErrorKeyboard + 8 )
#define C_ErrDirectInputError ( C_FirstErrorKeyboard + 9 )
/* Key state */
#define C_ucKeyPressed 0x80
/* Constant to use to select key */
#define C_ucKey_SQUARE DIK_GRAVE
#define C_ucKey_1 DIK_1
#define C_ucKey_2 DIK_2
#define C_ucKey_3 DIK_3
#define C_ucKey_4 DIK_4
#define C_ucKey_5 DIK_5
#define C_ucKey_6 DIK_6
#define C_ucKey_7 DIK_7
#define C_ucKey_8 DIK_8
#define C_ucKey_9 DIK_9
#define C_ucKey_0 DIK_0
#define C_ucKey_END_BRACET DIK_MINUS
#define C_ucKey_EQUAL DIK_EQUALS
#define C_ucKey_A DIK_Q
#define C_ucKey_Z DIK_W
#define C_ucKey_E DIK_E
#define C_ucKey_R DIK_R
#define C_ucKey_T DIK_T
#define C_ucKey_Y DIK_Y
#define C_ucKey_U DIK_U
#define C_ucKey_I DIK_I
#define C_ucKey_O DIK_O
#define C_ucKey_P DIK_P
#define C_ucKey_EXP DIK_LBRACKET
#define C_ucKey_DOLLAR DIK_RBRACKET
#define C_ucKey_Q DIK_A
#define C_ucKey_S DIK_S
#define C_ucKey_D DIK_D
#define C_ucKey_F DIK_F
#define C_ucKey_G DIK_G
#define C_ucKey_H DIK_H
#define C_ucKey_J DIK_J
#define C_ucKey_K DIK_K
#define C_ucKey_L DIK_L
#define C_ucKey_M DIK_SEMICOLON
#define C_ucKey_PERCENT DIK_APOSTROPHE
#define C_ucKey_MUL DIK_BACKSLASH
#define C_ucKey_INF 0x56 /* Not define in dinput.h */
#define C_ucKey_W DIK_Z
#define C_ucKey_X DIK_X
#define C_ucKey_C DIK_C
#define C_ucKey_V DIK_V
#define C_ucKey_B DIK_B
#define C_ucKey_N DIK_N
#define C_ucKey_VIRG DIK_M
#define C_ucKey_PVIRG DIK_COMMA
#define C_ucKey_PP DIK_PERIOD
#define C_ucKey_NOT DIK_SLASH
#define C_ucKey_F1 DIK_F1
#define C_ucKey_F2 DIK_F2
#define C_ucKey_F3 DIK_F3
#define C_ucKey_F4 DIK_F4
#define C_ucKey_F5 DIK_F5
#define C_ucKey_F6 DIK_F6
#define C_ucKey_F7 DIK_F7
#define C_ucKey_F8 DIK_F8
#define C_ucKey_F9 DIK_F9
#define C_ucKey_F10 DIK_F10
#define C_ucKey_F11 DIK_F11
#define C_ucKey_F12 DIK_F12
#define C_ucKey_SYSTEM DIK_SYSRQ
#define C_ucKey_SCROLL DIK_SCROLL
#define C_ucKey_PAUSE 0x69 /* Not define in dinput.h*/
#define C_ucKey_SPACE DIK_SPACE
#define C_ucKey_ESC DIK_ESCAPE
#define C_ucKey_TAB DIK_TAB
#define C_ucKey_CAPSLOCK DIK_CAPITAL
#define C_ucKey_LSHIFT DIK_LSHIFT
#define C_ucKey_RSHIFT DIK_RSHIFT
#define C_ucKey_RCTRL DIK_RCONTROL
#define C_ucKey_LCTRL DIK_LCONTROL
#define C_ucKey_LALT DIK_LMENU
#define C_ucKey_RALT DIK_RMENU
#define C_ucKey_ALTGR DIK_LCONTROL
#define C_ucKey_ENTER DIK_RETURN
#define C_ucKey_BACK DIK_BACK
#define C_ucKey_INS DIK_INSERT
#define C_ucKey_DEL DIK_DELETE
#define C_ucKey_HOME DIK_HOME
#define C_ucKey_END DIK_END
#define C_ucKey_PRIOR DIK_PRIOR
#define C_ucKey_NEXT DIK_NEXT
#define C_ucKey_UP DIK_UP
#define C_ucKey_DOWN DIK_DOWN
#define C_ucKey_LEFT DIK_LEFT
#define C_ucKey_RIGHT DIK_RIGHT
#define C_ucKey_PAD_ENTER DIK_NUMPADENTER
#define C_ucKey_NUMLOCK 0xc5 /* DIK_NUMLOCK ?? */
#define C_ucKey_PAD_DIV DIK_DIVIDE
#define C_ucKey_PAD_MUL DIK_MULTIPLY
#define C_ucKey_PAD_SUB DIK_SUBTRACT
#define C_ucKey_PAD_ADD DIK_ADD
#define C_ucKey_PAD_POINT DIK_DECIMAL
#define C_ucKey_PAD_0 DIK_NUMPAD0
#define C_ucKey_PAD_1 DIK_NUMPAD1
#define C_ucKey_PAD_2 DIK_NUMPAD2
#define C_ucKey_PAD_3 DIK_NUMPAD3
#define C_ucKey_PAD_4 DIK_NUMPAD4
#define C_ucKey_PAD_5 DIK_NUMPAD5
#define C_ucKey_PAD_6 DIK_NUMPAD6
#define C_ucKey_PAD_7 DIK_NUMPAD7
#define C_ucKey_PAD_8 DIK_NUMPAD8
#define C_ucKey_PAD_9 DIK_NUMPAD9
#define C_ucKey_LWIN DIK_LWIN
#define C_ucKey_RWIN DIK_RWIN
#define C_ucKey_APPS DIK_APPS
/******************************************************************************
All functions return a short type value that must be compared with the
C_wKbError to check if the function success. You can then read the error
code with the error management functions.
******************************************************************************/
#if !defined U64
/*////////////////////*/
/* Global Variables //*/
/*////////////////////*/
#undef EXTERN
#undef extern
#if !defined(__DeclareGlobalVariableIntell_h__)
#define EXTERN extern
#else
#define EXTERN
#endif /* __DeclareGlobalVariableIntell_h__*/
EXTERN char g_cIsAzerty;
#endif /* U64*/
#if defined(__cplusplus)
extern "C"
{
/******************************************************************************
Keyboard initialisation functions.
******************************************************************************/
/*
This function must be called one time when the game is launched. The
parameter HistorySize is the number of previous status conserve.
*/
CPA_EXPORT short INO_fn_wInitKeyboard(short wHistorySize, HINSTANCE hInstance, HWND hWindow);
/*
Reinitialization of the keyboard. The history is clear.
*/
CPA_EXPORT short INO_fn_wResetKeyboard(void);
/*
This function free memory and release keyboard ressource.
*/
CPA_EXPORT short INO_fn_wFreeKeyboard(void);
/*
This function returns the number of keys of the keyboard.
*/
CPA_EXPORT short INO_fn_wGetNumberOfKey(void);
/******************************************************************************
Keyboard state.
******************************************************************************/
/*
This function must be called at regular interval, for example each VBL.
It Update the informations about the keyboard.
*/
CPA_EXPORT short INO_fn_wReadKeyboard(void);
/*
Retrun C_wKbTrue if the application has the keyboard focus
*/
CPA_EXPORT short INO_fn_wIsKeyboardAcquired(void);
/*
Remove an active key. An error occurs when the specified key isn't
active.
*/
CPA_EXPORT short INO_fn_wRemoveActiveKey(short wKeyCode);
/*
Add a key to be managed. There is an error if the specified key is
already active.
*/
CPA_EXPORT short INO_fn_wAddActiveKey(short wKeyCode);
/*
Return the code of the last pressed key.
*/
CPA_EXPORT short INO_fn_wGetLastKey(void);
/*
This function return c_wKbTrue if the keyboard state has changed since
the last
*/
CPA_EXPORT short INO_fn_wKeyboardStateHasChanged(void);
/*
This function returns C_wKbTrue if the specified key is down else the result
is C_wKbFalse.
*/
CPA_EXPORT short INO_fn_wKeyDown(short wKeyCode);
/*
This function returns C_wKbTrue if the specified key has just been pressed.
( it wasn't pressed after the previous call of fn_wKbReadKeyboard and it is
pressed after the last call of this fonction).
*/
CPA_EXPORT short INO_fn_wKeyJustDown(short wKeyCode);
/*
This function returns C_wKbTrue if the specified key has just been released.
( it was pressed after the previous call of fn_wKbReadKeyboard and it isn't
yet).
*/
CPA_EXPORT short INO_fn_wKeyJustUp(short wKeyCode);
/*
This function return C_wKbTrue if the selected key was down in the
specified previous state.
*/
CPA_EXPORT short INO_fn_wKeyWasDown(short wKeycode, short wHistoryIndex);
/*
This fonction returns the ASCII code corresponding to a key code if this key
is printable.
*/
/*
CPA_EXPORT short INO_fn_wGetASCIICodeOfKey(short wKeyCode);
*/
/*
This fonction returns the ASCII code corresponding to the keyboard current state.
If the last pressed key is not printable, return an error.
*/
CPA_EXPORT short INO_fn_wGetLastASCIICode(void);
/*
This function compares the string pointed by the p_szTestString with the
string formed with the last pressed key.
*/
CPA_EXPORT short INO_fn_wCompareWithCurrentString(char *p_szTestString);
/*
If not C_wJoyError, the result is the elapsed time of inactivity
of the keyboard.
*/
CPA_EXPORT short INO_fn_wGetKeyboardInactivityTime(u_long *p_ulCount);
/*
If not C_wJoyError, the result is the elapsed time since the
specified previous state.
*/
CPA_EXPORT short INO_fn_wKbElapsedTime(short wHistoryIndex, u_long *p_ulCount);
/*
This function returns a pointer to the last error message string.
*/
CPA_EXPORT short INO_fn_wGetErrorString(char **pp_szErrorString);
/*
This function returns a last error code.
*/
CPA_EXPORT u_long INO_fn_ulGetLastErrorCode(void);
/*********************************************************************
Demo mode functions
*********************************************************************/
/*
DEFINE THE KEYS TO STOP THE DEMO RECORDING MODE.
OF COURSE, THE DEFINE HERE SHOULDN'T BE USED IN THE GAME.
DEFAULT IS ESC.
*/
CPA_EXPORT short INO_fn_wAddStopRecordingKey(short wKeyCode);
/*
REMOVE A KEY FROM THE EXIT DEMO KEY LIST.
*/
CPA_EXPORT short INO_fn_wRemoveStopRecordingKey(short wKeyCode);
/*
STARTS THE DEMO RECORDING MODE. A FILE IS CREATE WITH THE NAME INDICATED BY
p_szFileName.
*/
CPA_EXPORT short INO_fn_wStartRecordingKeyboard(char *p_szFileName);
/*
Quit the demo recording mode. The data of the demo sequence are stored in the file
open in the fn_wKbStartDemoRecordMode.
*/
CPA_EXPORT short INO_fn_wStopRecordingKeyboard(void);
/*
THIS FUNCTION RETURN THE NUMBER OF FRAME OF THE DEMO SEQUENCE.
*/
CPA_EXPORT short INO_fn_wGetKeyboardDemoFrameCount(void);
/*
THIS FUNCTION START THE DEMO PLAYING MODE.
*/
CPA_EXPORT short INO_fn_wStartKeyboardDemo(char *p_szFileName);
/*
THIS FUNCTION QUIT THE DEMO PLAYING MODE.
*/
CPA_EXPORT short INO_fn_wStopKeyboardDemo(void);
/*
THIS FUNCTION RETURN THE CURRENT KEYBOARD MODE.(NORMAL, DEMO RECORDING
OR DEMO PLAYING).
*/
CPA_EXPORT short INO_fn_wGetKeyboardCurrentMode(void);
}
#else /* C prototype */
extern CPA_EXPORT short INO_fn_wInitKeyboard(short wHistorySize, HINSTANCE hInstance, HWND hWindow);
extern CPA_EXPORT short INO_fn_wResetKeyboard(void);
extern CPA_EXPORT short INO_fn_wFreeKeyboard(void);
extern CPA_EXPORT short INO_fn_wGetNumberOfKey(void);
extern CPA_EXPORT short INO_fn_wReadKeyboard(void);
extern CPA_EXPORT short INO_fn_wIsKeyboardAcquired(void);
extern CPA_EXPORT short INO_fn_wRemoveActiveKey(short wKeyCode);
extern CPA_EXPORT short INO_fn_wAddActiveKey(short wKeyCode);
extern CPA_EXPORT short INO_fn_wGetLastKey(void);
extern CPA_EXPORT short INO_fn_wKeyboardStateHasChanged(void);
extern CPA_EXPORT short INO_fn_wKeyDown(short wKeyCode);
extern CPA_EXPORT short INO_fn_wKeyJustDown(short wKeyCode);
extern CPA_EXPORT short INO_fn_wKeyJustUp(short wKeyCode);
extern CPA_EXPORT short INO_fn_wKeyWasDown(short wKeycode, short wHistoryIndex);
/*CPA_EXPORT short INO_fn_wGetASCIICodeOfKey(short wKeyCode);*/
extern CPA_EXPORT short INO_fn_wGetLastASCIICode(void);
extern CPA_EXPORT short INO_fn_wCompareWithCurrentString(char *p_szTestString);
extern CPA_EXPORT short INO_fn_wGetKeyboardInactivityTime(u_long *p_ulCount);
extern CPA_EXPORT short INO_fn_wKbElapsedTime(short wHistoryIndex, u_long *p_ulCount);
extern CPA_EXPORT short INO_fn_wGetErrorString(char **pp_szErrorString);
extern CPA_EXPORT u_long INO_fn_ulGetLastErrorCode(void);
extern CPA_EXPORT short INO_fn_wAddStopRecordingKey(short wKeyCode);
extern CPA_EXPORT short INO_fn_wRemoveStopRecordingKey(short wKeyCode);
extern CPA_EXPORT short INO_fn_wStartRecordingKeyboard(char *p_szFileName);
extern CPA_EXPORT short INO_fn_wStopRecordingKeyboard(void);
extern CPA_EXPORT short INO_fn_wGetKeyboardDemoFrameCount(void);
extern CPA_EXPORT short INO_fn_wStartKeyboardDemo(char *p_szFileName);
extern CPA_EXPORT short INO_fn_wStopKeyboardDemo(void);
extern CPA_EXPORT short INO_fn_wGetKeyboardCurrentMode(void);
#endif
/* Old prototype compatibility */
#define fn_wKbInitKeyboard(A,B,C) INO_fn_wInitKeyboard(A,B,C)
#define fn_wKbResetKeyboard() INO_fn_wResetKeyboard()
#define fn_wKbFreeKeyboard() INO_fn_wFreeKeyboard()
#define fn_wKbKeyNumber() INO_fn_wGetNumberOfKey()
#define fn_wKbReadKeyboard() INO_fn_wReadKeyboard()
#define fn_wKbIsKeyboardAcquired() INO_fn_wIsKeyboardAcquired()
#define fn_wKbRemoveActiveKey(A) INO_fn_wRemoveActiveKey(A)
#define fn_wKbAddActiveKey(A) INO_fn_wAddActiveKey(A)
#define fn_wKbLastKey() INO_fn_wGetLastKey()
#define fn_wKbStateHasChanged() INO_fn_wKeyboardStateHasChanged()
#define fn_wKbIsDown(A) INO_fn_wKeyDown(A)
#define fn_wKbJustDown(A) INO_fn_wKeyJustDown(A)
#define fn_wKbJustUp(A) INO_fn_wKeyJustUp(A)
#define fn_wKbWasDown(A,B) INO_fn_wKeyWasDown(A,B)
#define fn_wKbGetLastASCII() INO_fn_wGetCurrentASCIICode()
#define fn_wKbCompareString(A) INO_fn_wCompareWithCurrentString(A)
#define fn_wKbInactivityTime(A) INO_fn_wGetKeyboardInactivityTime(A)
#define fn_wKbElapsedTime(A,B) INO_fn_wKbElapsedTime(A,B)
#define fn_wKbAddExitDemoKey(A) INO_fn_wAddStopRecordingKey(A)
#define fn_wKbRemoveExitDemoKey(A) INO_fn_wRemoveStopRecordingKey(A)
#define fn_wKbStartDemoRecording(A) INO_fn_wStartRecordingKeyboard(A)
#define fn_wKbExitDemoRecording() INO_fn_wStopRecordingKeyboard()
#define fn_wKbGetDemoFrameCount() INO_fn_wGetKeyboardDemoFrameCount()
#define fn_wKbStartDemoPlaying(A) INO_fn_wStartKeyboardDemo(A)
#define fn_wKbExitDemoPlaying() INO_fn_wStopKeyboardDemo()
#define fn_wKbGetCurrentMode() INO_fn_wGetKeyboardCurrentMode()
#define fn_wKbGetErrorString(A) INO_fn_wGetErrorString(A)
#define fn_ulKbGetLastErrorCode() INO_fn_ulGetLastErrorCode()
#endif /* _INO_KEYBOARD_H */

View File

@@ -0,0 +1,58 @@
/*///////////////////////////////////////////////////////////*/
/* //*/
/* Memory Management of the Module : INO //*/
/* // */
/* File Name : MmgINO.h //*/
/* Date : 29/03/97 //*/
/* Author : Francis Jentey //*/
/* //*/
/*///////////////////////////////////////////////////////////*/
#ifndef __MemINO_H__
#define __MemINO_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* For DLLs who are using this module : */
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#ifndef __Mmg_H__
#include "MMG.h"
#endif
typedef enum e_ucINOStaticBlocks_{
E_ucINOBlock1,
E_ucINOBlock2,
E_ucINOBlock3,
E_ucINOBlock4,
E_ucINOMaxBlocksNb /* maximum number of static block, You have to follow this syntax 'E_uc+ Abbreviation Module +MaxBlocksNb'*/
} e_ucINOStaticBlocks;
#undef __MMG_INO_EXTERN
#ifdef __DeclareGlobalVariableMmgINO_h__
#define __MMG_INO_EXTERN /*nothing*/
#else /* no __DeclareGlobalVariableMmgINO_h__*/
#define __MMG_INO_EXTERN extern
#endif /*__DeclareGlobalVariableMmgINO_h__*/
__MMG_INO_EXTERN CPA_EXPORT struct tdstBlockInfo_ g_a_stINOBlocksInfo[E_ucINOMaxBlocksNb];
#ifdef __DYNAMIC_MALLOC_ALLOWED__
#ifdef __DEBUG_MALLOC_MODE__
__MMG_INO_EXTERN CPA_EXPORT struct tdstDynInfo_ g_stINODynInfo;
#endif /*__DEBUG_MALLOC_MODE__*/
#endif /*__DYNAMIC_MALLOC_ALLOWED__*/
#ifdef __cplusplus
};
#endif /* __cplusplus */
#endif /*__MemINO_H__*/

View File

@@ -0,0 +1,125 @@
/******************************************************************************
Mouse.h : Definition of structures and Macros for mouse
Author : JENTEY F.
Last update : 09/08/97
******************************************************************************/
#ifndef _INO_MOUSE_H
#define _INO_MOUSE_H
#include "cpa_std.h"
#include "GLD.h"
#include "dinput.h"
#ifndef u_short
#define u_short unsigned short
#endif
#ifndef u_long
#define u_long unsigned long
#endif
/**************************************/
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
/**************************************/
/* All functions return a short value that should be compared with this constant */
#define C_wMouseError 32767
#define C_wMouseTrue 32766
#define C_wMouseFalse 32765
/* Mouse error code */
#define C_FirstErrorMouse 0x3000
#define C_ErrMouseInvalidGLDDeviceHandle ( C_FirstErrorMouse + 0 )
#define C_ErrMouseNotInitialized ( C_FirstErrorMouse + 1 )
#define C_ErrMouseFailedGettingDeviceAttributes ( C_FirstErrorMouse + 2 )
#define C_ErrNoGLDDeviceLinkedWithMouse ( C_FirstErrorMouse + 3 )
#define C_ErrMouseFocusLost ( C_FirstErrorMouse + 4 )
#define C_ErrMouseDirectInputError ( C_FirstErrorMouse + 5 )
#if defined(__cplusplus)
extern "C"
{
/**************************************************************/
/* Init mouse with the given GLD Device */
CPA_EXPORT short INO_fn_wInitMouseWithGLD(HINSTANCE hInstance, GLD_tdhDevice tdGLDDeviceHandle);
/**************************************************************/
/* Init mouse with the given window */
/* INO_fn_wGetMousePositionInGldDevice isn't available */
CPA_EXPORT short INO_fn_wInitMouse(HINSTANCE hInstance, HWND hWindow);
/**************************************************************/
/* Release mouse ressource */
CPA_EXPORT short INO_fn_wFreeMouse(void);
/**************************************************************/
/* Get mouse capabilities */
CPA_EXPORT short INO_fn_wGetMouseNumberOfButtons(void);
CPA_EXPORT short INO_fn_wGetMouseNumberOfAxes(void);
/**************************************************************/
/* The polling function to call each engine loop */
CPA_EXPORT short INO_fn_wReadMouse(void);
/**************************************************************/
/* Give the current mouse position in the attached GLD Device */
/* For a 640, 480 device: */
/* (0.0 , 0.0) means (0 , 0) in pixel coordinate */
/* (1.0 , 1.0) means (639 , 439) in pixel coordinate */
CPA_EXPORT short INO_fn_wGetMousePositionInGldDevice(float *p_fX, float *p_fY);
/**************************************************************/
CPA_EXPORT short INO_fn_wGetMousePosition(int *p_iX, int *p_iY);
/* Mouse Button state */
CPA_EXPORT short INO_fn_wLeftMouseButtonDown(void);
CPA_EXPORT short INO_fn_wRightMouseButtonDown(void);
CPA_EXPORT short INO_fn_wLeftMouseButtonJustDown(void);
CPA_EXPORT short INO_fn_wRightMouseButtonJustDown(void);
CPA_EXPORT short INO_fn_wLeftMouseButtonJustUp(void);
CPA_EXPORT short INO_fn_wRightMouseButtonJustUp(void);
/**************************************************************/
/* Get mouse last error code */
CPA_EXPORT u_long INO_fn_ulGetMouseErrorCode(void);
}
#else /* C prototype */
extern CPA_EXPORT short INO_fn_wInitMouseWithGLD(HINSTANCE hInstance, GLD_tdhDevice tdGLDDeviceHandle);
extern CPA_EXPORT short INO_fn_wInitMouse(HINSTANCE hInstance, HWND hWindow);
extern CPA_EXPORT short INO_fn_wFreeMouse(void);
extern CPA_EXPORT short INO_fn_wGetMouseNumberOfButtons(void);
extern CPA_EXPORT short INO_fn_wGetMouseNumberOfAxes(void);
extern CPA_EXPORT short INO_fn_wReadMouse(void);
extern CPA_EXPORT short INO_fn_wGetMousePositionInGldDevice(float *p_fX, float *p_fY);
extern CPA_EXPORT short INO_fn_wGetMousePosition(int *p_iX, int *p_iY);
extern CPA_EXPORT short INO_fn_wLeftMouseButtonDown(void);
extern CPA_EXPORT short INO_fn_wRightMouseButtonDown(void);
extern CPA_EXPORT short INO_fn_wLeftMouseButtonJustDown(void);
extern CPA_EXPORT short INO_fn_wRightMouseButtonJustDown(void);
extern CPA_EXPORT short INO_fn_wLeftMouseButtonJustUp(void);
extern CPA_EXPORT short INO_fn_wRightMouseButtonJustUp(void);
extern CPA_EXPORT u_long INO_fn_ulGetMouseErrorCode(void);
#endif
#endif /* _INO_MOUSE_H */

View File

@@ -0,0 +1,78 @@
/******************************************************************************
Joy.h : Definition of structures and Macros
PC Version
Author : M. TRABUCATO
Last update : 28.04.98
******************************************************************************/
#ifndef _JOY_H_
#define _JOY_H_
/**************************************/
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
/**************************************/
#if defined(__cplusplus)
extern "C"
{
/*
This function must be called one time when the game is launched. The
parameter HistorySize is the number of previous status conserve.
*/
CPA_EXPORT short INO_fn_wInitGamePort(short wHistorySize);
/******************************************************************************
This section defines the query functions.
******************************************************************************/
/*
This function must be called at regular interval, for example each VBL.
Update the informations about active joysticks.
wReadMode indicates if you wanted to read all allocated joystick (C_wJoyReadAll)
,(useful to test if joystick are plugged, unplugged.
or only plugged joystick (C_wJoyReadConnected).
*/
CPA_EXPORT short INO_fn_wReadJoystick(short wReadMode);
/******************************************************************************
******************************************************************************/
/*
Return the current position of the joystick along the specified axis
The return value is a double contained between -1.0 to 1.0
*/
CPA_EXPORT short INO_fn_wGetJoystickCurrentPosition(short wJoystickNum, short wAxis, double *pdfPosition);
/*
Return the position of the joystick in a previous state along the specified axis
The return value is a double contained between -1.0 to 1.0
*/
CPA_EXPORT short INO_fn_wGetJoystickPreviousPosition(short wJoystickNum, short wAxis, short wHistoryNum, double *pdfPosition);
}
#else /* Prototype C */
extern CPA_EXPORT short INO_fn_wInitGamePort(short wHistorySize);
extern CPA_EXPORT short INO_fn_wReadJoystick(short wReadMode);
extern CPA_EXPORT short INO_fn_wGetJoystickCurrentPosition(short wJoystickNum, short wAxis, double *pdfPosition);
extern CPA_EXPORT short INO_fn_wGetJoystickPreviousPosition(short wJoystickNum, short wAxis, short wHistoryNum, double *pdfPosition);
#endif /* __cpluspluc */
/**************************************/
#endif /* _JOY_H_ */

View File

@@ -0,0 +1,171 @@
/*///////////////////////////////////////////////////////////*/
/**/
/* Management of the Module : INO*/
/**/
/* File Name : ErrINO.h*/
/* Date : 07/03/97*/
/* Author : Francis Jentey*/
/**/
/*///////////////////////////////////////////////////////////*/
/**/
/* abbreviation of the module-name. Used in macro is 'INO'*/
/**/
/*///////////////////////////////////////////////////////////*/
#ifndef __ERRINO_H__
#define __ERRINO_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
#define C_szINOVersion "INO V5.1.0" /* The format is INO Va.b.c with INO is the Tag of the module */
#define C_szINOFullName "Module InOut"/* the complete and clear name of the module */
#define C_szINODate "Nov 21 1997" /*The format is "Mmm dd yyyy".You can use __DATE__ but be careful that you have the control of the compilation*/
/* For DLLs who are using this module : */
#undef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#include "ERM.h"
#define __FATAL_ERR_INO__
#define __WARNING1_ERR_INO__
#define __WARNING2_ERR_INO__
#define __WARNING3_ERR_INO__
/*----------*/
/* Constant */
/*----------*/
/* error of the INO Module*/
typedef enum e_uwINOErrNumber_{
E_uwINOFatalErr,
#ifdef __FATAL_ERR_INO__
E_uwINO_FatalFailedAllocationMem,
E_uwINO_FatalDirectInpuNotFound,
E_uwINO_DirectInputError,
E_uwINO_NotInitialized,
E_uwINO_TooManyDevice,
/* -----------------*/
#endif /*__FATAL_ERR_INO__*/
E_uwINOStartOfWarning,/* important constant, it allows to recognize if an error is fatal or not.*/
#ifdef __WARNING1_ERR_INO__
/* ------------------- Common error code*/
E_uwINO_WarningInvalidDevice,
E_uwINO_DeviceInitFailed,
/* ------------------- Joystick error code*/
/* E_uwINO_Joystick_NotInNormalMode,
E_uwINO_Joystick_NotInRecordingMode,
E_uwINO_Joystick_NotInPlayingMode,
E_uwINO_Joystick_DemoFileError,
E_uwINO_Joystick_BadFileFormat,
// ------------------- Keyboard error code
E_uwINO_Keyboard_NotInRecordingMode,
E_uwINO_Keyboard_NotInNormalMode,
E_uwINO_Keyboard_NotInPlayingMode,
E_uwINO_Keyboard_DemoBadFileFormat,
E_uwINO_Keyboard_DemoFileError,*/
/* ------------------- Mouse error code*/
E_uwINO_Mouse_InvalidGLDDeviceHandle,
E_uwINO_Mouse_FailedGettingDeviceAttributes,
E_uwINO_Mouse_NoGLDDeviceLinked,
#endif /*__WARNING1_ERR_INO__*/
#ifdef __WARNING2_ERR_INO__
/* -------------------*/
#endif /*__WARNING2_ERR_INO__*/
#ifdef __WARNING3_ERR_INO__
/* -------------------*/
#endif /*__WARNING3_ERR_INO__*/
E_uwINOErrNumber
} e_uwINOErrNumber;
/*------------------*/
/* Global Variables*/
/*------------------*/
#undef __ERRINO_EXTERN
#ifndef __DeclareGlobalVariableErrINO_h__
#define __ERRINO_EXTERN extern /*external declaration*/
#else /*__DeclareGlobalVariableErrINO_h__*/
#define __ERRINO_EXTERN /*replace by nothing : we have to declare*/
#endif /*__DeclareGlobalVariableErrINO_h__*/
__ERRINO_EXTERN CPA_EXPORT unsigned char g_ucINOModuleId /*number of identification of the Erm module*/
#if defined(__DeclareGlobalVariableErrINO_h__) && !defined(CPA_WANTS_IMPORT)
= C_ucModuleNotInitialized
#endif /*__DeclareGlobalVariableErrINO_h__&& CPA_WANTS_IMPORT*/
;
#ifdef __ERROR_STRINGS__
__ERRINO_EXTERN CPA_EXPORT char * g_a_szINOInformationModule []
#if defined(__DeclareGlobalVariableErrINO_h__) && !defined(CPA_WANTS_IMPORT)
= {C_szINOVersion, C_szINOFullName, C_szINODate}
#endif /*__DeclareGlobalVariableErrINO_h__ && CPA_WANTS_IMPORT*/
;
__ERRINO_EXTERN CPA_EXPORT char * g_szINOModuleName /* Mandatory syntax 'g_sz'+[Abbreviation of ModuleName]+'ModuleName'*/
#if defined(__DeclareGlobalVariableErrINO_h__) && !defined(CPA_WANTS_IMPORT)
= "Module INO"
#endif /*__DeclareGlobalVariableErrINO_h__ && CPA_WANTS_IMPORT*/
;
__ERRINO_EXTERN CPA_EXPORT struct tdstErrorMsg_ g_a_stINOTabErr [] /* Mandatory syntax 'g_a_st'+[Abbreviation of ModuleName]+'TabErr'*/
#if defined(__DeclareGlobalVariableErrINO_h__) && !defined(CPA_WANTS_IMPORT)
={
#ifdef __FATAL_ERR_INO__
/* -------------*/
E_uwINO_FatalFailedAllocationMem, "Memory allocation failed.",
E_uwINO_FatalDirectInpuNotFound, "Direct Input init failed.",
E_uwINO_DirectInputError, "Direct input error.",
E_uwINO_NotInitialized,"Module INO is not initialized.",
E_uwINO_TooManyDevice,"Too many devices.",
#endif /*__FATAL_ERR_INO__*/
#ifdef __WARNING1_ERR_INO__
/* ---------------- Common error string*/
E_uwINO_WarningInvalidDevice, "The specified device doesn't exist.",
E_uwINO_DeviceInitFailed,"Device init failure.",
/* ---------------- Joystick error string*/
/* E_uwINO_Joystick_NotInNormalMode, "Joystick is not in normal mode",
E_uwINO_Joystick_NotInRecordingMode, "Joystick is not in recording mode",
E_uwINO_Joystick_NotInPlayingMode, "Joystick is not in playing mode",
E_uwINO_Joystick_DemoFileError, "Demo file access error.",
E_uwINO_Joystick_BadFileFormat, "This file is not a demo file.",
// ---------------- Keyboard error string
E_uwINO_Keyboard_NotInRecordingMode,"This function can only be called in demo recording mode.",
E_uwINO_Keyboard_NotInNormalMode,"You are currently in demo recording or playing mode.",
E_uwINO_Keyboard_NotInPlayingMode,"This function can only be called in demo playing mode.",
E_uwINO_Keyboard_DemoBadFileFormat,"Unrecognized file format.",
E_uwINO_Keyboard_DemoFileError,"The function can't open or read the demo file.",*/
/* ------------------- Mouse error string*/
E_uwINO_Mouse_InvalidGLDDeviceHandle,"Invalid GLD device handle.",
E_uwINO_Mouse_FailedGettingDeviceAttributes,"Failed to get GLD device attributes.",
E_uwINO_Mouse_NoGLDDeviceLinked,"No GLD device linked with the mouse",
#endif /*__WARNING1_ERR_INO__*/
#ifdef __WARNING2_ERR_INO__
/* ----------------*/
#endif /*__WARNING2_ERR_INO__*/
#ifdef __WARNING3_ERR_INO__
/* ----------------*/
#endif /*__WARNING3_ERR_INO__*/
0xFFFF, "\0"/*fin*/
};
#endif /*__DeclareGlobalVariableErrINO_h__ && CPA_WANTS_IMPORT*/
;
#endif /*__ERROR_STRINGS__*/
#ifdef __cplusplus
};
#endif /* __cplusplus */
#endif /*__ERRINO_H__*/