diff --git a/code/win32/FeelIt/FEELitIFR.h b/code/win32/FeelIt/FEELitIFR.h deleted file mode 100644 index bbc39fe..0000000 --- a/code/win32/FeelIt/FEELitIFR.h +++ /dev/null @@ -1,247 +0,0 @@ -/********************************************************************** - Copyright (c) 1999 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FEELitIFR.h - - PURPOSE: Input/Output for IFR Files, FEELit version - - STARTED: - - NOTES/REVISIONS: - -**********************************************************************/ - -#if !defined( _FEELIT2_H_) -#define _FEELIT2_H_ - -#ifndef __FEELITAPI_INCLUDED__ - #error include 'dinput.h' before including this file for structures. -#endif /* !__DINPUT_INCLUDED__ */ - -#define IFRAPI __stdcall - -#if !defined(_FFCDLL_) -#define DLLAPI __declspec(dllimport) -#else -#define DLLAPI __declspec(dllexport) -#endif - -#if defined __cplusplus -extern "C" { -#endif /* __cplusplus */ - -/* -** CONSTANTS -*/ - -/* -** RT_FEELIT - Resource type for IFR projects stored as resources. -** This is the resource type looked for by IFLoadProjectResource(). -*/ -#define RT_FEELIT ((LPCSTR)"FEELIT") - - -/* -** TYPES/STRUCTURES -*/ - -/* -** HIFRPROJECT - used to identify a loaded project as a whole. -** individual objects within a project are uniquely referenced by name. -** Created by the IFLoadProject*() functions and released by IFReleaseProject(). -*/ -typedef LPVOID HIFRPROJECT; - -/* -** IFREffect - contains the information needed to create a DI effect -** using IDirectInputEffect::CreateEffect(). An array of pointers to these -** structures is allocated and returned by IFCreateEffectStructs(). -*/ -typedef struct { - GUID guid; - LPFEELIT_EFFECT lpDIEffect; -} IFREffect; - - -/* -** FUNCTION DECLARATIONS -*/ - -/* -** IFLoadProjectResource() - Load a project from a resource. -** hRsrcModule - handle of the module containing the project definition resource. -** pRsrcName - name or MAKEINTRESOURCE(id) identifier of resource to load. -** pDevice - device for which the project is being loaded. If NULL, -** effects will be created generically, and IFCreateEffects() will fail. -** Returns an identifier for the loaded project, or NULL if unsuccessful. -*/ -DLLAPI -HIFRPROJECT -IFRAPI -IFRLoadProjectResource( - HMODULE hRsrcModule, - LPCSTR pRsrcName, - LPIFEELIT_DEVICE pDevice ); - -/* -** IFLoadProjectPointer() - Load a project from a pointer. -** pProject - points to a project definition. -** pDevice - device for which the project is being loaded. If NULL, -** effects will be created generically, and IFCreateEffects() will fail. -** Returns an identifier for the loaded project, or NULL if unsuccessful. -*/ -DLLAPI -HIFRPROJECT -IFRAPI -IFRLoadProjectPointer( - LPVOID pProject, - LPIFEELIT_DEVICE pDevice ); - -/* -** IFLoadProjectFile() - Load a project from a file. -** pProjectFileName - points to a project file name. -** pDevice - device for which the project is being loaded. If NULL, -** effects will be created generically, and IFCreateEffects() will fail. -** Returns an identifier for the loaded project, or NULL if unsuccessful. -*/ -DLLAPI -HIFRPROJECT -IFRAPI -IFRLoadProjectFile( - LPCSTR pProjectFileName, - LPIFEELIT_DEVICE pDevice ); - -/* -** IFLoadProjectObjectPointer() - Load a project from a pointer to a single -** object definition (usually used only by the editor). -** pObject - points to an object definition. -** pDevice - device for which the project is being loaded. If NULL, -** effects will be created generically, and IFCreateEffects() will fail. -** Returns an identifier for the loaded project, or NULL if unsuccessful. -*/ -DLLAPI -HIFRPROJECT -IFRAPI -IFRLoadProjectObjectPointer( - LPVOID pObject, - LPIFEELIT_DEVICE pDevice ); - -/* -** IFReleaseProject() - Release a loaded project. -** hProject - identifies the project to be released. -** Returns TRUE if the project is released, FALSE if it is an invalid project. -*/ -DLLAPI -BOOL -IFRAPI -IFRReleaseProject( - HIFRPROJECT hProject ); - -/* -** IFCreateEffectStructs() - Create IFREffects for a named effect. -** hProject - identifies the project containing the object. -** pObjectName - name of the object for which to create structures. -** pNumEffects - if not NULL will be set to a count of the IFREffect -** structures in the array (not including the terminating NULL pointer.) -** Returns a pointer to the allocated array of pointers to IFREffect -** structures. The array is terminated with a NULL pointer. If the -** function fails, a NULL pointer is returned. -*/ -DLLAPI -IFREffect ** -IFRAPI -IFRCreateEffectStructs( - HIFRPROJECT hProject, - LPCSTR pObjectName, - int *pNumEffects ); - -DLLAPI -IFREffect ** -IFRAPI -IFRCreateEffectStructsByIndex( - HIFRPROJECT hProject, - int nObjectIndex, - int *pNumEffects ); - -DLLAPI -LPCSTR -IFRAPI -IFRGetObjectNameByIndex( - HIFRPROJECT hProject, - int nObjectIndex ); - -/* -** IFReleaseEffectStructs() - Release an array of IFREffects. -** hProject - identifies the project for which the effects were created. -** pEffects - points to the array of IFREffect pointers to be released. -** Returns TRUE if the array is released, FALSE if it is an invalid array. -*/ -DLLAPI -BOOL -IFRAPI -IFRReleaseEffectStructs( - HIFRPROJECT hProject, - IFREffect **pEffects ); - -/* -** IFCreateEffects() - Creates the DirectInput effects using -** IDirectInput::CreateEffect(). -** hProject - identifies the project containing the object. -** pObjectName - name of the object for which to create effects. -** pNumEffects - if not NULL will be set to a count of the IDirectInputEffect -** pointers in the array (not including the terminating NULL pointer.) -** Returns a pointer to the allocated array of pointers to IDirectInputEffects. -** The array is terminated with a NULL pointer. If the function fails, -** a NULL pointer is returned. -*/ -DLLAPI -LPIFEELIT_EFFECT * -IFRAPI -IFRCreateEffects( - HIFRPROJECT hProject, - LPCSTR pObjectName, - int *pNumEffects ); - -/* -** IFReleaseEffects() - Releases an array of IDirectInputEffect structures. -** hProject - identifies the project for which the effects were created. -** pEffects - points to the array if IDirectInputEffect pointers to be released. -** Returns TRUE if the array is released, FALSE if it is an invalid array. -*/ -DLLAPI -BOOL -IFRAPI -IFRReleaseEffects( - HIFRPROJECT hProject, - LPIFEELIT_EFFECT *pEffects ); - -DLLAPI -BOOL -IFRAPI -DllMain( - HINSTANCE hInstDLL, - DWORD fdwReason, - LPVOID lpvReserved ); - - -#if defined __cplusplus -} -#endif /* __cplusplus */ - -#endif /* !IForce2_h */ diff --git a/code/win32/FeelIt/FFC.h b/code/win32/FeelIt/FFC.h deleted file mode 100644 index 07cfeea..0000000 --- a/code/win32/FeelIt/FFC.h +++ /dev/null @@ -1,78 +0,0 @@ -/********************************************************************** - Copyright (c) 1997,8,9 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FFC.h - - PURPOSE: Class Types for the Force Foundation Classes - - STARTED: 10/29/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - -**********************************************************************/ - - -#if !defined(AFX_FFC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FFC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - - -#include "FeelBox.h" -#include "FeelCondition.h" -#include "FeelConstant.h" -#include "FeelDamper.h" -#include "FeelDevice.h" -#include "FeelDXDevice.h" -#include "FeelEffect.h" -#include "FeelEllipse.h" -#include "FeelEnclosure.h" -#include "FeelMouse.h" -#include "FeelFriction.h" -#include "FeelGrid.h" -#include "FeelInertia.h" -#include "FeelPeriodic.h" -#include "FeelProjects.h" -#include "FeelRamp.h" -#include "FeelSpring.h" -#include "FeelTexture.h" -#include "FFCErrors.h" - - -#endif // !defined(AFX_FFC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) - - - - - - - - - - - - - - - - - diff --git a/code/win32/FeelIt/FFC10.dll b/code/win32/FeelIt/FFC10.dll deleted file mode 100644 index 0536f23..0000000 Binary files a/code/win32/FeelIt/FFC10.dll and /dev/null differ diff --git a/code/win32/FeelIt/FFC10.lib b/code/win32/FeelIt/FFC10.lib deleted file mode 100644 index 54ca7f4..0000000 Binary files a/code/win32/FeelIt/FFC10.lib and /dev/null differ diff --git a/code/win32/FeelIt/FFC10d.dll b/code/win32/FeelIt/FFC10d.dll deleted file mode 100644 index 1f546c2..0000000 Binary files a/code/win32/FeelIt/FFC10d.dll and /dev/null differ diff --git a/code/win32/FeelIt/FFC10d.lib b/code/win32/FeelIt/FFC10d.lib deleted file mode 100644 index 786d23d..0000000 Binary files a/code/win32/FeelIt/FFC10d.lib and /dev/null differ diff --git a/code/win32/FeelIt/FFCErrors.h b/code/win32/FeelIt/FFCErrors.h deleted file mode 100644 index eff43b8..0000000 --- a/code/win32/FeelIt/FFCErrors.h +++ /dev/null @@ -1,171 +0,0 @@ -/********************************************************************** - Copyright (c) 1999 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FFCErrors.h - - PURPOSE: Error codes returned in FFC; Error handling in FFC - - STARTED: 2/28/99 by Jeff Mallett - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/6/99 jrm: Added user error handling control - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(FFCERRORS_H__INCLUDED_) -#define FFCERRORS_H__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include -#include "FeelBaseTypes.h" - - -/**************************************************************************** - * - * Error Codes - * - ****************************************************************************/ - -typedef enum { - FFC_ERR_OK = 0, - - FFC_ERR_UNKNOWN_ERROR = 1, - - FFC_ERR_ALLOCATION_FAILED = 2, - FFC_ERR_INVALID_PARAMETER = 3, - FFC_ERR_NULL_PARAMETER = 4, - FFC_ERR_WRONG_FORM = 5, - - FFC_ERR_DEVICE_IS_NULL = 6, - FFC_ERR_INVALID_GUID = 7, - FFC_ERR_EFFECT_NOT_INITIALIZED = 8, - - FFC_ERR_CANT_INITIALIZE_DEVICE = 9, - - FFC_ERR_CANT_CREATE_EFFECT = 10, - FFC_ERR_CANT_CREATE_EFFECT_FROM_IFR = 11, - FFC_ERR_NO_EFFECTS_FOUND = 12, - FFC_ERR_EFFECT_IS_COMPOUND = 13, - - FFC_ERR_PROJECT_ALREADY_OPEN = 14, - FFC_ERR_PROJECT_NOT_OPEN = 15 -} FFC_ERROR_CODE; - -typedef enum { - FFC_OUTPUT_ERR_TO_DEBUG = 0x0001, - FFC_OUTPUT_ERR_TO_DIALOG = 0x0002 -} FFC_ERROR_HANDLING_FLAGS; - - -/**************************************************************************** - * - * Macros - * - ****************************************************************************/ - -// -// ------ PUBLIC MACROS ------ -// -#define FFC_GET_LAST_ERROR CFFCErrors::GetLastErrorCode() -#define FFC_SET_ERROR_HANDLING CFFCErrors::SetErrorHandling - - -// -// ------ PRIVATE MACROS ------ -// -#if (FFC_VERSION >= 0x0110) - #define FFC_SET_ERROR(err) CFFCErrors::SetErrorCode(err, __FILE__, __LINE__) -#else - #define FFC_SET_ERROR(err) CFFCErrors::SetErrorCode(err) -#endif -#define FFC_CLEAR_ERROR FFC_SET_ERROR(FFC_ERR_OK) - - - -/**************************************************************************** - * - * CFFCErrors - * - ****************************************************************************/ -// All members are static. Don't bother instantiating an object of this class. - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFFCErrors -{ - // - // ATTRIBUTES - // - - public: - - static HRESULT - GetLastErrorCode() - { return m_Err; } - - static void - SetErrorHandling(unsigned long dwFlags) - { m_dwErrHandlingFlags = dwFlags; } - - -// -// ------ PRIVATE INTERFACE ------ -// - - // Internally used by FFC classes - static void - SetErrorCode( - HRESULT err -#if (FFC_VERSION >= 0x0110) - , const char *sFile, int nLine -#endif - ); - - // - // HELPERS - // - - protected: - - // - // INTERNAL DATA - // - - private: - - static HRESULT m_Err; - static unsigned long m_dwErrHandlingFlags; -}; - - -#endif // FFCERRORS_H__INCLUDED_ diff --git a/code/win32/FeelIt/FeelBaseTypes.h b/code/win32/FeelIt/FeelBaseTypes.h deleted file mode 100644 index e2a8c4f..0000000 --- a/code/win32/FeelIt/FeelBaseTypes.h +++ /dev/null @@ -1,265 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelBaseTypes.h - - PURPOSE: Base Types for Feelit API Foundation Classes - - STARTED: 10/29/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - -**********************************************************************/ - - -#if !defined(AFX_FEELBASETYPES_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELBASETYPES_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -//#include -#include "FeelitApi.h" - -#ifndef FFC_VERSION - #define FFC_VERSION 0x0100 -#endif - -#if (FFC_VERSION >= 0x0110) - #define FFC_START_DELAY - #define FFC_EFFECT_CACHING -#endif - -// These are defined in FEELitAPI.h -// -// #define FEELIT_DEVICETYPE_DEVICE 1 -// #define FEELIT_DEVICETYPE_MOUSE 2 -// #define FEELIT_DEVICETYPE_HID 0x00010000 -// -// Add define for DirectInput Device emulating FEELit Device -#define FEELIT_DEVICETYPE_DIRECTINPUT 3 - - -//================================================================ -// TYPE WRAPPERS -//================================================================ - -// -// FEEL --> FEELIT Wrappers -// -#define FEEL_DEVICETYPE_DEVICE FEELIT_DEVICETYPE_DEVICE -#define FEEL_DEVICETYPE_MOUSE FEELIT_DEVICETYPE_MOUSE -#define FEEL_DEVICETYPE_DIRECTINPUT FEELIT_DEVICETYPE_DIRECTINPUT - -#define FEEL_EFFECT FEELIT_EFFECT -#define LPFEEL_EFFECT LPFEELIT_EFFECT -#define LPCFEEL_EFFECT LPCFEELIT_EFFECT - -#define FEEL_CONDITION FEELIT_CONDITION -#define LPFEEL_CONDITION LPFEELIT_CONDITION -#define LPCFEEL_CONDITION LPCFEELIT_CONDITION - -#define FEEL_TEXTURE FEELIT_TEXTURE -#define LPFEEL_TEXTURE LPFEELIT_TEXTURE -#define LPCFEEL_TEXTURE LPCFEELIT_TEXTURE - -#define FEEL_PERIODIC FEELIT_PERIODIC -#define LPFEEL_PERIODIC LPFEELIT_PERIODIC -#define LPCFEEL_PERIODIC LPCFEELIT_PERIODIC - -#define FEEL_CONSTANTFORCE FEELIT_CONSTANTFORCE -#define LPFEEL_CONSTANTFORCE LPFEELIT_CONSTANTFORCE -#define LPCFEEL_CONSTANTFORCE LPCFEELIT_CONSTANTFORCE - -#define FEEL_RAMPFORCE FEELIT_RAMPFORCE -#define LPFEEL_RAMPFORCE LPFEELIT_RAMPFORCE -#define LPCFEEL_RAMPFORCE LPCFEELIT_RAMPFORCE - -#define FEEL_ENVELOPE FEELIT_ENVELOPE -#define LPFEEL_ENVELOPE LPFEELIT_ENVELOPE -#define LPCFEEL_ENVELOPE LPCFEELIT_ENVELOPE - -#define LPIFEEL_API LPIFEELIT -#define LPIFEEL_EFFECT LPIFEELIT_EFFECT -#define LPIFEEL_DEVICE LPIFEELIT_DEVICE - -#define LPFEEL_DEVICEINSTANCE LPFEELIT_DEVICEINSTANCE -#define LPCFEEL_DEVICEOBJECTINSTANCE LPCFEELIT_DEVICEOBJECTINSTANCE -#define LPCFEEL_EFFECTINFO LPCFEELIT_EFFECTINFO - - -#define FEEL_FPARAM_DURATION FEELIT_FPARAM_DURATION -#define FEEL_FPARAM_SAMPLEPERIOD FEELIT_FPARAM_SAMPLEPERIOD -#define FEEL_FPARAM_GAIN FEELIT_FPARAM_GAIN -#define FEEL_FPARAM_TRIGGERBUTTON FEELIT_FPARAM_TRIGGERBUTTON -#define FEEL_FPARAM_TRIGGERREPEATINTERVAL FEELIT_FPARAM_TRIGGERREPEATINTERVAL -#define FEEL_FPARAM_AXES FEELIT_FPARAM_AXES -#define FEEL_FPARAM_DIRECTION FEELIT_FPARAM_DIRECTION -#define FEEL_FPARAM_ENVELOPE FEELIT_FPARAM_ENVELOPE -#define FEEL_FPARAM_TYPESPECIFICPARAMS FEELIT_FPARAM_TYPESPECIFICPARAMS -#define FEEL_FPARAM_ALLPARAMS FEELIT_FPARAM_ALLPARAMS -#define FEEL_FPARAM_START FEELIT_FPARAM_START -#define FEEL_FPARAM_NORESTART FEELIT_FPARAM_NORESTART -#define FEEL_FPARAM_NODOWNLOAD FEELIT_FPARAM_NODOWNLOAD - -#define FEEL_FEFFECT_OBJECTIDS FEELIT_FEFFECT_OBJECTIDS -#define FEEL_FEFFECT_OBJECTOFFSETS FEELIT_FEFFECT_OBJECTOFFSETS -#define FEEL_FEFFECT_CARTESIAN FEELIT_FEFFECT_CARTESIAN -#define FEEL_FEFFECT_POLAR FEELIT_FEFFECT_POLAR -#define FEEL_FEFFECT_SPHERICAL FEELIT_FEFFECT_SPHERICAL - -#define FEEL_PARAM_NOTRIGGER FEELIT_PARAM_NOTRIGGER - -#define FEEL_MOUSEOFFSET_XAXIS FEELIT_MOUSEOFFSET_XAXIS -#define FEEL_MOUSEOFFSET_YAXIS FEELIT_MOUSEOFFSET_YAXIS -#define FEEL_MOUSEOFFSET_ZAXIS FEELIT_MOUSEOFFSET_ZAXIS - -// -// FORCE --> FEELIT Wrappers -// -#define FORCE_EFFECT FEELIT_EFFECT -#define LPFORCE_EFFECT LPFEELIT_EFFECT -#define LPCFORCE_EFFECT LPCFEELIT_EFFECT - -#define FORCE_CONDITION FEELIT_CONDITION -#define LPFORCE_CONDITION LPFEELIT_CONDITION -#define LPCFORCE_CONDITION LPCFEELIT_CONDITION - -#define FORCE_TEXTURE FEELIT_TEXTURE -#define LPFORCE_TEXTURE LPFEELIT_TEXTURE -#define LPCFORCE_TEXTURE LPCFEELIT_TEXTURE - -#define FORCE_PERIODIC FEELIT_PERIODIC -#define LPFORCE_PERIODIC LPFEELIT_PERIODIC -#define LPCFORCE_PERIODIC LPCFEELIT_PERIODIC - -#define FORCE_CONSTANTFORCE FEELIT_CONSTANTFORCE -#define LPFORCE_CONSTANTFORCE LPFEELIT_CONSTANTFORCE -#define LPCFORCE_CONSTANTFORCE LPCFEELIT_CONSTANTFORCE - -#define FORCE_RAMPFORCE FEELIT_RAMPFORCE -#define LPFORCE_RAMPFORCE LPFEELIT_RAMPFORCE -#define LPCFORCE_RAMPFORCE LPCFEELIT_RAMPFORCE - -#define FORCE_ENVELOPE FEELIT_ENVELOPE -#define LPFORCE_ENVELOPE LPFEELIT_ENVELOPE -#define LPCFORCE_ENVELOPE LPCFEELIT_ENVELOPE - -#define LPIFORCE_API LPIFEELIT -#define LPIFORCE_EFFECT LPIFEELIT_EFFECT -#define LPIFORCE_DEVICE LPIFEELIT_DEVICE - -#define LPFORCE_DEVICEINSTANCE LPFEELIT_DEVICEINSTANCE -#define LPCFORCE_DEVICEOBJECTINSTANCE LPCFEELIT_DEVICEOBJECTINSTANCE -#define LPCFORCE_EFFECTINFO LPCFEELIT_EFFECTINFO - - -#define FORCE_FPARAM_DURATION FEELIT_FPARAM_DURATION -#define FORCE_FPARAM_SAMPLEPERIOD FEELIT_FPARAM_SAMPLEPERIOD -#define FORCE_FPARAM_GAIN FEELIT_FPARAM_GAIN -#define FORCE_FPARAM_TRIGGERBUTTON FEELIT_FPARAM_TRIGGERBUTTON -#define FORCE_FPARAM_TRIGGERREPEATINTERVAL FEELIT_FPARAM_TRIGGERREPEATINTERVAL -#define FORCE_FPARAM_AXES FEELIT_FPARAM_AXES -#define FORCE_FPARAM_DIRECTION FEELIT_FPARAM_DIRECTION -#define FORCE_FPARAM_ENVELOPE FEELIT_FPARAM_ENVELOPE -#define FORCE_FPARAM_TYPESPECIFICPARAMS FEELIT_FPARAM_TYPESPECIFICPARAMS -#define FORCE_FPARAM_ALLPARAMS FEELIT_FPARAM_ALLPARAMS -#define FORCE_FPARAM_START FEELIT_FPARAM_START -#define FORCE_FPARAM_NORESTART FEELIT_FPARAM_NORESTART -#define FORCE_FPARAM_NODOWNLOAD FEELIT_FPARAM_NODOWNLOAD - -#define FORCE_FEFFECT_OBJECTIDS FEELIT_FEFFECT_OBJECTIDS -#define FORCE_FEFFECT_OBJECTOFFSETS FEELIT_FEFFECT_OBJECTOFFSETS -#define FORCE_FEFFECT_CARTESIAN FEELIT_FEFFECT_CARTESIAN -#define FORCE_FEFFECT_POLAR FEELIT_FEFFECT_POLAR -#define FORCE_FEFFECT_SPHERICAL FEELIT_FEFFECT_SPHERICAL - -#define FORCE_PARAM_NOTRIGGER FEELIT_PARAM_NOTRIGGER - -#define FORCE_MOUSEOFFSET_XAXIS FEELIT_MOUSEOFFSET_XAXIS -#define FORCE_MOUSEOFFSET_YAXIS FEELIT_MOUSEOFFSET_YAXIS -#define FORCE_MOUSEOFFSET_ZAXIS FEELIT_MOUSEOFFSET_ZAXIS - - -//================================================================ -// GUID WRAPPERS -//================================================================ - -// -// Feel --> Feelit Wrappers -// -#define GUID_Feel_ConstantForce GUID_Feelit_ConstantForce -#define GUID_Feel_RampForce GUID_Feelit_RampForce -#define GUID_Feel_Square GUID_Feelit_Square -#define GUID_Feel_Sine GUID_Feelit_Sine -#define GUID_Feel_Triangle GUID_Feelit_Triangle -#define GUID_Feel_SawtoothUp GUID_Feelit_SawtoothUp -#define GUID_Feel_SawtoothDown GUID_Feelit_SawtoothDown -#define GUID_Feel_Spring GUID_Feelit_Spring -#define GUID_Feel_DeviceSpring GUID_Feelit_DeviceSpring -#define GUID_Feel_Damper GUID_Feelit_Damper -#define GUID_Feel_Inertia GUID_Feelit_Inertia -#define GUID_Feel_Friction GUID_Feelit_Friction -#define GUID_Feel_Texture GUID_Feelit_Texture -#define GUID_Feel_Grid GUID_Feelit_Grid -#define GUID_Feel_Enclosure GUID_Feelit_Enclosure -#define GUID_Feel_Ellipse GUID_Feelit_Ellipse -#define GUID_Feel_CustomForce GUID_Feelit_CustomForce - -// -// Force --> Feelit Wrappers -// -#define GUID_Force_ConstantForce GUID_Feelit_ConstantForce -#define GUID_Force_RampForce GUID_Feelit_RampForce -#define GUID_Force_Square GUID_Feelit_Square -#define GUID_Force_Sine GUID_Feelit_Sine -#define GUID_Force_Triangle GUID_Feelit_Triangle -#define GUID_Force_SawtoothUp GUID_Feelit_SawtoothUp -#define GUID_Force_SawtoothDown GUID_Feelit_SawtoothDown -#define GUID_Force_Spring GUID_Feelit_Spring -#define GUID_Force_Damper GUID_Feelit_Damper -#define GUID_Force_Inertia GUID_Feelit_Inertia -#define GUID_Force_Friction GUID_Feelit_Friction -#define GUID_Force_Texture GUID_Feelit_Texture -#define GUID_Force_Grid GUID_Feelit_Grid -#define GUID_Force_Enclosure GUID_Feelit_Enclosure -#define GUID_Force_Ellipse GUID_Feelit_Ellipse -#define GUID_Force_CustomForce GUID_Feelit_CustomForce - - -#endif // !defined(AFX_FEELBASETYPES_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) - - - - - - - - - - - - - - - - - diff --git a/code/win32/FeelIt/FeelBox.h b/code/win32/FeelIt/FeelBox.h deleted file mode 100644 index d3e459c..0000000 --- a/code/win32/FeelIt/FeelBox.h +++ /dev/null @@ -1,178 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelBox.h - - PURPOSE: Box Class for Feelit API Foundation Classes - - STARTED: 11/04/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELBOX_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELBOX_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelEffect.h" -#include "FeelEnclosure.h" - - - -//================================================================ -// Constants -//================================================================ - -const POINT FEEL_BOX_MOUSE_POS_AT_START = { MAXLONG, MAXLONG }; - -#define FEEL_BOX_DEFAULT_STIFFNESS 5000 -#define FEEL_BOX_DEFAULT_WIDTH 10 -#define FEEL_BOX_DEFAULT_HEIGHT FEEL_ENCLOSURE_HEIGHT_AUTO -#define FEEL_BOX_DEFAULT_WALL_WIDTH FEEL_ENCLOSURE_WALL_WIDTH_AUTO - -#define FEEL_BOX_DEFAULT_CENTER_POINT FEEL_BOX_MOUSE_POS_AT_START - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_BOX_MOUSE_POS_AT_START FEEL_BOX_DEFAULT_STIFFNESS - -#define FORCE_BOX_DEFAULT_STIFFNESS FEEL_BOX_DEFAULT_STIFFNESS -#define FORCE_BOX_DEFAULT_WIDTH FEEL_BOX_DEFAULT_WIDTH -#define FORCE_BOX_DEFAULT_HEIGHT FEEL_BOX_DEFAULT_HEIGHT -#define FORCE_BOX_DEFAULT_WALL_WIDTH FEEL_BOX_DEFAULT_WALL_WIDTH - -#define FORCE_BOX_DEFAULT_CENTER_POINT FEEL_BOX_DEFAULT_CENTER_POINT - - - -//================================================================ -// CFeelBox -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelBox : public CFeelEnclosure -{ - // - // CONSTRUCTOR/DESCTRUCTOR - // - - public: - - // Constructor - CFeelBox(); - - // Destructor - virtual - ~CFeelBox(); - - - // - // ATTRIBUTES - // - - public: - - - BOOL - ChangeParameters( - POINT pntCenter, - LONG lStiffness = FEEL_EFFECT_DONT_CHANGE, - DWORD dwWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwHeight = FEEL_EFFECT_DONT_CHANGE, - DWORD dwWallWidth = FEEL_EFFECT_DONT_CHANGE, - CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE - ); - - BOOL - ChangeParameters( - LPCRECT pRectOutside, - LONG lStiffness = FEEL_EFFECT_DONT_CHANGE, - DWORD dwWallWidth = FEEL_EFFECT_DONT_CHANGE, - CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE - ); - - - // - // OPERATIONS - // - - public: - - - BOOL - Initialize( - CFeelDevice* pDevice, - DWORD dwWidth = FEEL_ENCLOSURE_DEFAULT_WIDTH, - DWORD dwHeight = FEEL_ENCLOSURE_DEFAULT_HEIGHT, - LONG lStiffness = FEEL_BOX_DEFAULT_STIFFNESS, - DWORD dwWallWidth = FEEL_BOX_DEFAULT_WALL_WIDTH, - POINT pntCenter = FEEL_BOX_DEFAULT_CENTER_POINT, - CFeelEffect* pInsideEffect = NULL - ); - - - BOOL - Initialize( - CFeelDevice* pDevice, - LPCRECT pRectOutside, - LONG lStiffness = FEEL_BOX_DEFAULT_STIFFNESS, - DWORD dwWallWidth = FEEL_BOX_DEFAULT_WALL_WIDTH, - CFeelEffect* pInsideEffect = NULL - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - - // - // INTERNAL DATA - // - - protected: - -}; - - -#endif // !defined(AFX_FEELBOX_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelCompoundEffect.h b/code/win32/FeelIt/FeelCompoundEffect.h deleted file mode 100644 index e2f688e..0000000 --- a/code/win32/FeelIt/FeelCompoundEffect.h +++ /dev/null @@ -1,184 +0,0 @@ -/********************************************************************** - Copyright (c) 1999 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelCompoundEffect.h - - PURPOSE: Manages Compound Effects for Force Foundation Classes - - STARTED: 2/24/99 by Jeff Mallett - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(__FEELCOMPOUNDEFFECT_H) -#define __FEELCOMPOUNDEFFECT_H - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelEffect.h" - -#include "FeelitIFR.h" - - -//================================================================ -// CFeelCompoundEffect -//================================================================ -// Represents a compound effect, such as might be created in -// I-FORCE Studio. Contains an array of effect objects. -// Methods iterate over component effects, passing the message -// to each one. -// Also, has stuff for being used by CFeelProject: -// * next pointer so can be put on a linked list -// * force name - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelCompoundEffect -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - protected: - // Constructs a CFeelCompoundEffect - // Don't try to construct a CFeelCompoundEffect yourself. - // Instead let CFeelProject construct it for you. - CFeelCompoundEffect( - IFREffect **hEffects, - long nEffects - ); - - public: - - ~CFeelCompoundEffect(); - - - // - // ATTRIBUTES - // - - public: - - long - GetNumberOfContainedEffects() const - { return m_nEffects; } - - const char * - GetName() const - { return m_lpszName; } - - GENERIC_EFFECT_PTR - GetContainedEffect( - long index - ); - - - // - // OPERATIONS - // - - public: - - // Start all the contained effects - BOOL Start( - DWORD dwIterations = 1, - DWORD dwFlags = 0 - ); - - // Stop all the contained effects - BOOL Stop(); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - BOOL initialize( - CFeelDevice* pDevice, - IFREffect **hEffects - ); - - BOOL - set_contained_effect( - GENERIC_EFFECT_PTR pObject, - int index = 0 - ); - - BOOL - set_name( - const char *lpszName - ); - - void - set_next( - CFeelCompoundEffect *pNext - ) - { m_pNext = pNext; } - - CFeelCompoundEffect * - get_next() const - { return m_pNext; } - - - // - // FRIENDS - // - - public: - - friend class CFeelProject; - - - // - // INTERNAL DATA - // - - protected: - - GENERIC_EFFECT_PTR *m_paEffects; // Array of force class object pointers - long m_nEffects; // Number of effects in m_paEffects - - private: - - char *m_lpszName; // Name of the compound effect - CFeelCompoundEffect *m_pNext; // Next compound effect in the project -}; - -#endif diff --git a/code/win32/FeelIt/FeelCondition.h b/code/win32/FeelIt/FeelCondition.h deleted file mode 100644 index 8218812..0000000 --- a/code/win32/FeelIt/FeelCondition.h +++ /dev/null @@ -1,345 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelCondition.h - - PURPOSE: Base Condition Class for Feelit API Foundation Classes - - STARTED: 10/10/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELCONDITION_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELCONDITION_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelEffect.h" - - - -//================================================================ -// Constants -//================================================================ - -const POINT FEEL_CONDITION_PT_NULL = { 0, 0 }; - -#define FEEL_CONDITION_DEFAULT_COEFFICIENT 2500 -#define FEEL_CONDITION_DEFAULT_SATURATION 10000 -#define FEEL_CONDITION_DEFAULT_DEADBAND 100 -#define FEEL_CONDITION_DEFAULT_CENTER_POINT FEEL_EFFECT_MOUSE_POS_AT_START -#define FEEL_CONDITION_DEFAULT_DURATION INFINITE - -typedef enum { - FC_NULL = 0, - FC_POSITIVE_COEFFICIENT, - FC_NEGATIVE_COEFFICIENT, - FC_POSITIVE_SATURATION, - FC_NEGATIVE_SATURATION, - FC_DEAD_BAND, - FC_AXIS, - FC_CENTER, - FC_DIRECTION_X, - FC_DIRECTION_Y, - FC_ANGLE, - FC_CONDITION_X, - FC_CONDITION_Y -} FC_ArgumentType; - -#define FC_CONDITION FC_CONDITION_X - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_CONDITION_PT_NULL FEEL_CONDITION_PT_NULL - -#define FORCE_CONDITION_DEFAULT_COEFFICIENT FEEL_CONDITION_DEFAULT_COEFFICIENT -#define FORCE_CONDITION_DEFAULT_SATURATION FEEL_CONDITION_DEFAULT_SATURATION -#define FORCE_CONDITION_DEFAULT_DEADBAND FEEL_CONDITION_DEFAULT_DEADBAND -#define FORCE_CONDITION_DEFAULT_CENTER_POINT FEEL_CONDITION_DEFAULT_CENTER_POINT -#define FORCE_CONDITION_DEFAULT_DURATION FEEL_CONDITION_DEFAULT_DURATION - - - -//================================================================ -// CFeelCondition -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelCondition : public CFeelEffect -{ - // - // CONSTRUCTOR/DESCTRUCTOR - // - - public: - - // Constructor - CFeelCondition( - const GUID& rguidEffect - ); - - // Destructor - virtual - ~CFeelCondition(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - // Use this form for single-axis and dual-axis effects - BOOL - ChangeConditionParams( - LPCFEELIT_CONDITION pConditionX, - LPCFEELIT_CONDITION pConditionY - ); - - // Use this form for directional effects - BOOL - ChangeConditionParams( - LPCFEELIT_CONDITION pCondition, - LONG lDirectionX, - LONG lDirectionY - ); - - // Use this form for directional effects - BOOL - ChangeConditionParamsPolar( - LPCFEELIT_CONDITION pCondition, - LONG lAngle - ); - - // Use this form for single-axis, dual-axis symetrical, or directional effects - BOOL - ChangeConditionParams( - LONG lPositiveCoefficient, - LONG lNegativeCoefficient = FEEL_EFFECT_DONT_CHANGE, - DWORD dwPositiveSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwNegativeSaturation = FEEL_EFFECT_DONT_CHANGE, - LONG lDeadBand = FEEL_EFFECT_DONT_CHANGE, - POINT pntCenter = FEEL_EFFECT_DONT_CHANGE_POINT, - LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE - ); - - // Use this form for single-axis, dual-axis symetrical, or directional effects - BOOL - ChangeConditionParamsPolar( - LONG lPositiveCoefficient, - LONG lNegativeCoefficient, - DWORD dwPositiveSaturation, - DWORD dwNegativeSaturation, - LONG lDeadBand, - POINT pntCenter, - LONG lAngle - ); - - - BOOL - SetCenter( - POINT pntCenter - ); - - BOOL - ChangeConditionParams2( - FC_ArgumentType type, - ... - ); - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - const FEEL_EFFECT &effect - ); - - // Use this form for single-axis and dual-axis effects - BOOL - InitCondition( - CFeelDevice* pDevice, - LPCFEELIT_CONDITION pConditionX, - LPCFEELIT_CONDITION pConditionY, - BOOL bUseDeviceCoordinates = FALSE - ); - - - // Use this form for directional effects - BOOL - InitCondition( - CFeelDevice* pDevice, - LPCFEELIT_CONDITION pCondition, - LONG lDirectionX, - LONG lDirectionY, - BOOL bUseDeviceCoordinates = FALSE - ); - - - // Use this form for directional effects - BOOL - InitConditionPolar( - CFeelDevice* pDevice, - LPCFEELIT_CONDITION pCondition, - LONG lAngle, - BOOL bUseDeviceCoordinates = FALSE - ); - - - // Use this form for single-axis, dual-axis symetrical, or directional effects - BOOL - InitCondition( - CFeelDevice* pDevice, - LONG lPositiveCoefficient = FEEL_CONDITION_DEFAULT_COEFFICIENT, - LONG lNegativeCoefficient = FEEL_CONDITION_DEFAULT_COEFFICIENT, - DWORD dwPositiveSaturation = FEEL_CONDITION_DEFAULT_SATURATION, - DWORD dwNegativeSaturation = FEEL_CONDITION_DEFAULT_SATURATION, - LONG lDeadBand = FEEL_CONDITION_DEFAULT_DEADBAND, - DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH, - POINT pntCenter = FEEL_CONDITION_DEFAULT_CENTER_POINT, - LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y, - BOOL bUseDeviceCoordinates = FALSE - ); - - // Use this form for directional effects - BOOL - InitConditionPolar( - CFeelDevice* pDevice, - LONG lPositiveCoefficient = FEEL_CONDITION_DEFAULT_COEFFICIENT, - LONG lNegativeCoefficient = FEEL_CONDITION_DEFAULT_COEFFICIENT, - DWORD dwPositiveSaturation = FEEL_CONDITION_DEFAULT_SATURATION, - DWORD dwNegativeSaturation = FEEL_CONDITION_DEFAULT_SATURATION, - LONG lDeadBand = FEEL_CONDITION_DEFAULT_DEADBAND, - POINT pntCenter = FEEL_CONDITION_DEFAULT_CENTER_POINT, - LONG lAngle = FEEL_EFFECT_DEFAULT_ANGLE, - BOOL bUseDeviceCoordinates = FALSE - ); - - - virtual BOOL -#ifdef FFC_START_DELAY - StartNow( -#else - Start( -#endif - DWORD dwIterations = 1, - DWORD dwFlags = 0 - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - void - convert_line_point_to_offset( - POINT pntOnLine - ); - - BOOL - set_parameters( - DWORD dwfAxis, - DWORD dwfCoordinates, - LONG lDirection0, - LONG lDirection1, - LPCFEELIT_CONDITION pConditionX, - LPCFEELIT_CONDITION pConditionY - ); - - BOOL - set_parameters( - DWORD dwfAxis, - DWORD dwfCoordinates, - LONG lDirection0, - LONG lDirection1, - LONG lPositiveCoefficient, - LONG lNegativeCoefficient, - DWORD dwPositiveSaturation, - DWORD dwNegativeSaturation, - LONG lDeadBand, - POINT pntCenter - ); - - // - // INTERNAL DATA - // - - FEEL_CONDITION m_aCondition[2]; - DWORD m_dwfAxis; - BOOL m_bUseMousePosAtStart; - - protected: - BOOL m_bUseDeviceCoordinates; - -}; - - -// -// INLINES -// - -inline BOOL -CFeelCondition::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Spring) || - IsEqualGUID(guid, GUID_Feel_DeviceSpring) || - IsEqualGUID(guid, GUID_Feel_Damper) || - IsEqualGUID(guid, GUID_Feel_Inertia) || - IsEqualGUID(guid, GUID_Feel_Friction) || - IsEqualGUID(guid, GUID_Feel_Texture) || - IsEqualGUID(guid, GUID_Feel_Grid); -} - -#endif // !defined(AFX_FEELCONDITION_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelConstant.h b/code/win32/FeelIt/FeelConstant.h deleted file mode 100644 index 5b586f4..0000000 --- a/code/win32/FeelIt/FeelConstant.h +++ /dev/null @@ -1,193 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelConstant.h - - PURPOSE: Base Constant Class for Feelit API Foundation Classes - - STARTED: 11/03/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELCONSTANT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELCONSTANT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelEffect.h" - - - -//================================================================ -// Constants -//================================================================ - -const POINT FEEL_CONSTANT_DEFAULT_DIRECTION = { 1, 0 }; -#define FEEL_CONSTANT_DEFAULT_DURATION 1000 // Milliseconds -#define FEEL_CONSTANT_DEFAULT_MAGNITUDE 5000 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_CONSTANT_DEFAULT_DIRECTION FEEL_CONSTANT_DEFAULT_DIRECTION -#define FORCE_CONSTANT_DEFAULT_DURATION FEEL_CONSTANT_DEFAULT_DURATION -#define FORCE_CONSTANT_DEFAULT_MAGNITUDE FEEL_CONSTANT_DEFAULT_MAGNITUDE - - -//================================================================ -// CFeelConstant -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelConstant : public CFeelEffect -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelConstant(); - - // Destructor - virtual - ~CFeelConstant(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - LONG lDirectionX, - LONG lDirectionY, - DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE, - LONG lMagnitude = FEEL_EFFECT_DONT_CHANGE, - LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR - ); - - BOOL - ChangeParametersPolar( - LONG lAngle, - DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE, - LONG lMagnitude = FEEL_EFFECT_DONT_CHANGE, - LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR - ); - - - // - // OPERATIONS - // - - public: - - virtual - BOOL - Initialize( - CFeelDevice* pDevice, - LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y, - DWORD dwDuration = FEEL_CONSTANT_DEFAULT_DURATION, - LONG lMagnitude = FEEL_CONSTANT_DEFAULT_MAGNITUDE, - LPFEEL_ENVELOPE pEnvelope = NULL - ); - - virtual - BOOL - InitializePolar( - CFeelDevice* pDevice, - LONG lArray = FEEL_EFFECT_DEFAULT_ANGLE, - DWORD dwDuration = FEEL_CONSTANT_DEFAULT_DURATION, - LONG lMagnitude = FEEL_CONSTANT_DEFAULT_MAGNITUDE, - LPFEEL_ENVELOPE pEnvelope = NULL - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - BOOL - set_parameters( - DWORD dwfCoordinates, - LONG lDirection0, - LONG lDirection1, - DWORD dwDuration, - LONG lMagnitude, - LPFEEL_ENVELOPE pEnvelope - ); - - - // - // INTERNAL DATA - // - - FEEL_CONSTANTFORCE m_ConstantForce; - - protected: - -}; - - - -// -// INLINES -// - -inline BOOL -CFeelConstant::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_ConstantForce); -} - - -#endif // !defined(AFX_FEELCONSTANT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelDXDevice.h b/code/win32/FeelIt/FeelDXDevice.h deleted file mode 100644 index 302fe1f..0000000 --- a/code/win32/FeelIt/FeelDXDevice.h +++ /dev/null @@ -1,126 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelDXDevice.h - - PURPOSE: Abstraction of DirectX Force Feedback device - - STARTED: 10/10/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - -#ifndef FeelDXDevice_h -#define FeelDXDevice_h - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelDevice.h" - - -//================================================================ -// CFeelDXDevice -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelDXDevice : public CFeelDevice -{ - - // - // CONSTRUCTOR/DESCTRUCTOR - // - - public: - - // Constructor - CFeelDXDevice(); - - // Destructor - virtual - ~CFeelDXDevice(); - - - // - // ATTRIBUTES - // - - public: - - virtual LPIFEEL_API - GetAPI() - { return (LPIFEEL_API) m_piApi; } // actually LPDIRECTINPUT - - virtual LPIFEEL_DEVICE - GetDevice() - { return (LPIFEEL_DEVICE) m_piDevice; } // actually LPDIRECTINPUTDEVICE2 - - - // - // OPERATIONS - // - - public: - - BOOL - Initialize( - HANDLE hinstApp, - HANDLE hwndApp, - LPDIRECTINPUT pDI = NULL, - LPDIRECTINPUTDEVICE2 piDevice = NULL - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - virtual void - reset(); - - - // - // INTERNAL DATA - // - - protected: - - BOOL m_bpDIPreExist; - BOOL m_bpDIDevicePreExist; - - LPDIRECTINPUT m_piApi; - LPDIRECTINPUTDEVICE2 m_piDevice; -}; - -#endif // ForceDXDevice_h diff --git a/code/win32/FeelIt/FeelDamper.h b/code/win32/FeelIt/FeelDamper.h deleted file mode 100644 index 1034b9d..0000000 --- a/code/win32/FeelIt/FeelDamper.h +++ /dev/null @@ -1,177 +0,0 @@ -/********************************************************************** - Copyright (c) 1997,8,9 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelDamper.h - - PURPOSE: Feelit API Damper Effect Class - - STARTED: 10/14/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELDamper_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELDamper_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include -#include "FeelCondition.h" - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_DAMPER_DEFAULT_VISCOSITY 2500 -#define FEEL_DAMPER_DEFAULT_SATURATION 10000 -#define FEEL_DAMPER_DEFAULT_MIN_VELOCITY 0 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_DAMPER_DEFAULT_VISCOSITY FEEL_DAMPER_DEFAULT_VISCOSITY -#define FORCE_DAMPER_DEFAULT_SATURATION FEEL_DAMPER_DEFAULT_SATURATION -#define FORCE_DAMPER_DEFAULT_MIN_VELOCITY FEEL_DAMPER_DEFAULT_MIN_VELOCITY - - -//================================================================ -// CFeelDamper -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelDamper : public CFeelCondition -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelDamper(); - - // Destructor - virtual ~CFeelDamper(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - DWORD dwViscosity, - DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwMinVelocity = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE - ); - - BOOL - ChangeParametersPolar( - DWORD dwViscosity, - DWORD dwSaturation, - DWORD dwMinVelocity, - LONG lAngle - ); - - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - DWORD dwViscosity = FEEL_DAMPER_DEFAULT_VISCOSITY, - DWORD dwSaturation = FEEL_DAMPER_DEFAULT_SATURATION, - DWORD dwMinVelocity = FEEL_DAMPER_DEFAULT_MIN_VELOCITY, - DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH, - LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y - ); - - virtual BOOL - InitializePolar( - CFeelDevice* pDevice, - DWORD dwViscosity, - DWORD dwSaturation, - DWORD dwMinVelocity, - LONG lAngle - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - // - // INTERNAL DATA - // - - protected: - -}; - - - -// -// INLINES -// - -inline BOOL -CFeelDamper::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Damper); -} - - -#endif // !defined(AFX_FEELDamper_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelDevice.h b/code/win32/FeelIt/FeelDevice.h deleted file mode 100644 index 2016219..0000000 --- a/code/win32/FeelIt/FeelDevice.h +++ /dev/null @@ -1,196 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelDevice.h - - PURPOSE: Abstract Base Device Class for Force Foundation Classes - - STARTED: 10/10/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - 3/16/99 jrm: Made abstract. Moved functionality to CFeelMouse/CFeelDXDevice - -**********************************************************************/ - -#if !defined(AFX_FORCEDEVICE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FORCEDEVICE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#define DIRECTINPUT_VERSION 0x0800 //[ 0x0300 | 0x0500 | 0x0700 | 0x0800 ] -#include "dinput.h" -#include "FeelBaseTypes.h" - -#ifdef FFC_EFFECT_CACHING - #include "FeelEffectSuite.h" -#endif - - - -//================================================================ -// CFeelDevice -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelDevice -{ - // - // CONSTRUCTOR/DESCTRUCTOR - // - - public: - - // Constructor - CFeelDevice(); - - // Destructor - virtual - ~CFeelDevice(); - - - // - // ATTRIBUTES - // - - public: - - virtual LPIFEEL_API - GetAPI() - = 0; // pure virtual function - - virtual LPIFEEL_DEVICE // Will actually return LPDIRECTINPUTDEVICE2 if non-FEELit - GetDevice() - = 0; // pure virtual function - - DWORD - GetDeviceType() const - { return m_dwDeviceType; } - - - // - // OPERATIONS - // - - public: - - static CFeelDevice * - CreateDevice(HINSTANCE hinstApp, HWND hwndApp); - - virtual BOOL - ChangeScreenResolution( - BOOL bAutoSet, - DWORD dwXScreenSize = 0, - DWORD dwYScreenSize = 0 - ); - - // The default state is using standard Win32 Mouse messages (e.g., WM_MOUSEMOVE) - // and functions (e.g, GetCursorPos). Call only to switch to relative mode - // if not using standard Win32 Mouse services (e.g., DirectInput) for mouse - // input. - BOOL - UsesWin32MouseServices( - BOOL bWin32MouseServ - ); - - // Another syntax for SwitchToAbsoluteMode. - // The default is Absolute mode. Call only to switch to Relative mode or - // to switch back to Absolute mode. - virtual BOOL - SwitchToAbsoluteMode( - BOOL bAbsMode - ); - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // CACHING - // - -#ifdef FFC_EFFECT_CACHING - public: - - void Cache_AddEffect(CFeelEffect *pFeelEffect); - void Cache_RemoveEffect(const CFeelEffect *pFeelEffect); - void Cache_SwapOutEffect(); - - protected: - - void Cache_LoadEffectSuite(CFeelEffectSuite *pSuite, BOOL bCreateOnDevice); - void Cache_UnloadEffectSuite(CFeelEffectSuite *pSuite, BOOL bUnloadFromDevice); - - CEffectList m_Cache; // List of all effects created on device -#endif - - // - // HELPERS - // - - protected: - - // Performs device preparation by setting the device's parameters - virtual BOOL - prepare_device(); - - virtual void - reset() - = 0; // pure virtual function - - static BOOL CALLBACK - enum_didevices_proc( - LPDIDEVICEINSTANCE pForceDevInst, - LPVOID pv - ); - - static BOOL CALLBACK - enum_devices_proc( - LPFORCE_DEVICEINSTANCE pForceDevInst, - LPVOID pv - ); - - - // - // INTERNAL DATA - // - - protected: - - BOOL m_bInitialized; - DWORD m_dwDeviceType; - GUID m_guidDevice; - BOOL m_bGuidValid; - -}; - - -#endif // !defined(AFX_FORCEDEVICE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelEffect.h b/code/win32/FeelIt/FeelEffect.h deleted file mode 100644 index d7039ef..0000000 --- a/code/win32/FeelIt/FeelEffect.h +++ /dev/null @@ -1,344 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelEffect.h - - PURPOSE: Base Effect Class for Feelit API Foundation Classes - - STARTED: 10/10/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID and feel_to_DI_GUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELEFFECT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELEFFECT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelDevice.h" -class CFeelProject; - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_EFFECT_AXIS_X 1 -#define FEEL_EFFECT_AXIS_Y 2 -#define FEEL_EFFECT_AXIS_BOTH 3 -#define FEEL_EFFECT_AXIS_DIRECTIONAL 4 -#define FEEL_EFFECT_DONT_CHANGE MINLONG -#define FEEL_EFFECT_DONT_CHANGE_PTR MAXDWORD -const POINT FEEL_EFFECT_DONT_CHANGE_POINT = { 0xFFFFFFFF, 0xFFFFFFFF }; -const POINT FEEL_EFFECT_MOUSE_POS_AT_START = { MAXLONG, MAXLONG }; - -#define FEEL_EFFECT_DEFAULT_ENVELOPE NULL -#define FEEL_EFFECT_DEFAULT_DIRECTION_X 1 -#define FEEL_EFFECT_DEFAULT_DIRECTION_Y 1 -#define FEEL_EFFECT_DEFAULT_ANGLE 0 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_EFFECT_AXIS_X FEEL_EFFECT_AXIS_X -#define FORCE_EFFECT_AXIS_Y FEEL_EFFECT_AXIS_Y -#define FORCE_EFFECT_AXIS_BOTH FEEL_EFFECT_AXIS_BOTH -#define FORCE_EFFECT_AXIS_DIRECTIONAL FEEL_EFFECT_AXIS_DIRECTIONAL -#define FORCE_EFFECT_DONT_CHANGE FEEL_EFFECT_DONT_CHANGE -#define FORCE_EFFECT_DONT_CHANGE_PTR FEEL_EFFECT_DONT_CHANGE_PTR -#define FORCE_EFFECT_DONT_CHANGE_POINT FEEL_EFFECT_DONT_CHANGE_POINT -#define FORCE_EFFECT_MOUSE_POS_AT_START FEEL_EFFECT_MOUSE_POS_AT_START - -#define FORCE_EFFECT_DEFAULT_ENVELOPE FEEL_EFFECT_DEFAULT_ENVELOPE -#define FORCE_EFFECT_DEFAULT_DIRECTION_X FEEL_EFFECT_DEFAULT_DIRECTION_X -#define FORCE_EFFECT_DEFAULT_DIRECTION_Y FEEL_EFFECT_DEFAULT_DIRECTION_Y -#define FORCE_EFFECT_DEFAULT_ANGLE FEEL_EFFECT_DEFAULT_ANGLE - - - -// GENERIC_EFFECT_PTR -// This is really a pointer to a child of CFeelEffect. -typedef class CFeelEffect * GENERIC_EFFECT_PTR; - - -//================================================================ -// CFeelEffect -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelEffect -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelEffect( - const GUID& rguidEffect - ); - - // Destructor - virtual - ~CFeelEffect(); - - // - // ATTRIBUTES - // - - public: - - LPIFEEL_EFFECT - GetEffect() - { return m_piFeelitEffect; } - - BOOL - GetStatus( - DWORD* pdwStatus - ) -#if (FFC_VERSION >= 0x0110) || defined(FFC_EFFECT_CACHING) - const -#endif - ; - - GUID - GetGUID() - { return m_guidEffect; } - - virtual BOOL - GetIsCompatibleGUID( - GUID & /* guid */ - ) - { return true; } - - // Allocates an object of the correct FFC class from the given GUID - static GENERIC_EFFECT_PTR - NewObjectFromGUID( - GUID &guid - ); - - BOOL - ChangeBaseParams( - LONG lDirectionX, - LONG lDirectionY, - DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE, - LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR, - DWORD dwSamplePeriod = FEEL_EFFECT_DONT_CHANGE, - DWORD dwGain = FEEL_EFFECT_DONT_CHANGE, - DWORD dwTriggerButton = FEEL_EFFECT_DONT_CHANGE, - DWORD dwTriggerRepeatInterval = FEEL_EFFECT_DONT_CHANGE -#ifdef FFC_START_DELAY - ,DWORD dwStartDelay = FEEL_EFFECT_DONT_CHANGE -#endif - ); - - BOOL - ChangeBaseParamsPolar( - LONG lAngle, - DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE, - LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR, - DWORD dwSamplePeriod = FEEL_EFFECT_DONT_CHANGE, - DWORD dwGain = FEEL_EFFECT_DONT_CHANGE, - DWORD dwTriggerButton = FEEL_EFFECT_DONT_CHANGE, - DWORD dwTriggerRepeatInterval = FEEL_EFFECT_DONT_CHANGE -#ifdef FFC_START_DELAY - ,DWORD dwStartDelay = FEEL_EFFECT_DONT_CHANGE -#endif - ); - - BOOL - ChangeDirection( - LONG lDirectionX, - LONG lDirectionY - ); - - BOOL - ChangeDirection( - LONG lAngle - ); - - - BOOL - SetEnvelope( - DWORD dwAttackLevel, - DWORD dwAttackTime, - DWORD dwFadeLevel, - DWORD dwFadeTime - ); - - BOOL - SetEnvelope( - LPFEEL_ENVELOPE pEnvelope - ); - - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - const FEEL_EFFECT &effect - ); - - virtual BOOL - InitializeFromProject( - CFeelProject &project, - LPCSTR lpszEffectName, - CFeelDevice* pDevice = NULL - ); - - virtual BOOL - Start( - DWORD dwIterations = 1, - DWORD dwFlags = 0 - ); - -#ifdef FFC_START_DELAY - virtual BOOL - StartNow( - DWORD dwIterations = 1, - DWORD dwFlags = 0 - ); -#endif - - virtual BOOL - Stop(); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // CACHING - // - -#ifdef FFC_EFFECT_CACHING - - public: - - BOOL GetIsPlaying() const; - BOOL GetIsTriggered() const; - short GetPriority() const { return m_Priority; } - void SetPriority(short priority) { m_Priority = priority; } - HRESULT Unload(); - void Reload(); - - public: - - ECacheState m_CacheState; // effect's status in the cache - BOOL m_bInCurrentSuite; // is the effect in the currently loaded suite? - short m_Priority; // Priority within suite: higher number is higher priority - DWORD m_dwLastStarted; // when last started (0 = never) or when param change made on device - DWORD m_dwLastStopped; // when last stopped (0 = not since last start) - DWORD m_dwLastLoaded; // when last loaded with CFeelEffectSuite::Load or Create - - protected: - - CFeelDevice *m_pFeelDevice; // ### Use instead of m_piFeelitDevice -#endif - - // - // HELPERS - // - protected: - -#ifdef FFC_EFFECT_CACHING - public: // initalize needs to be called by CFeelDevice -#endif - BOOL - initialize( - CFeelDevice* pDevice - ); -#ifdef FFC_EFFECT_CACHING - protected: -#endif - - HRESULT - set_parameters_on_device( - DWORD dwFlags - ); - - void - feel_to_DI_GUID( - GUID &guid - ); - - void - reset(); - - void - reset_effect_struct(); - - - // - // INTERNAL DATA - // - - protected: - - FEEL_EFFECT m_Effect; - DWORD m_dwaAxes[2]; - LONG m_laDirections[2]; - - GUID m_guidEffect; - BOOL m_bIsPlaying; - DWORD m_dwDeviceType; - LPIFEEL_DEVICE m_piFeelitDevice; // Might also be holding LPDIRECTINPUTDEVICE2 - LPIFEEL_EFFECT m_piFeelitEffect; - DWORD m_cAxes; // Number of axes - -#ifdef FFC_START_DELAY - public: - // Prevents access to dangling pointer when this is deleted - // All relevent code may be removed when all hardware and drivers support start delay - CFeelEffect **m_ppTimerRef; // pointer to pointer to this. -#endif -}; - - -#if (DIRECTINPUT_VERSION >= 0x0700) - #define DIRECT_INPUT_STARTDELAY_SUPPORTED TRUE -#else - #define DIRECT_INPUT_STARTDELAY_SUPPORTED FALSE -#endif /* DIRECTINPUT_VERSION >= 0x0700 */ - -#endif // !defined(AFX_FEELEFFECT_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelEllipse.h b/code/win32/FeelIt/FeelEllipse.h deleted file mode 100644 index 0484013..0000000 --- a/code/win32/FeelIt/FeelEllipse.h +++ /dev/null @@ -1,253 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelEllipse.h - - PURPOSE: Base Ellipse Class for Feelit API Foundation Classes - - STARTED: 10/29/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELELLIPSE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELELLIPSE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelEffect.h" - - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_ELLIPSE_DEFAULT_STIFFNESS 5000 -#define FEEL_ELLIPSE_DEFAULT_SATURATION 10000 -#define FEEL_ELLIPSE_DEFAULT_WIDTH 10 -#define FEEL_ELLIPSE_HEIGHT_AUTO MAXDWORD -#define FEEL_ELLIPSE_DEFAULT_HEIGHT FEEL_ELLIPSE_HEIGHT_AUTO -#define FEEL_ELLIPSE_WALL_WIDTH_AUTO MAXDWORD -#define FEEL_ELLIPSE_DEFAULT_WALL_WIDTH FEEL_ELLIPSE_WALL_WIDTH_AUTO -#define FEEL_ELLIPSE_DEFAULT_STIFFNESS_MASK FEELIT_FSTIFF_ANYWALL -#define FEEL_ELLIPSE_DEFAULT_CLIPPING_MASK FEELIT_FCLIP_NONE - -#define FEEL_ELLIPSE_DEFAULT_CENTER_POINT FEEL_EFFECT_MOUSE_POS_AT_START - -// -// FEEL --> FORCE Wrappers -// -#define FORCE_ELLIPSE_DEFAULT_STIFFNESS FEEL_ELLIPSE_DEFAULT_STIFFNESS -#define FORCE_ELLIPSE_DEFAULT_SATURATION FEEL_ELLIPSE_DEFAULT_SATURATION -#define FORCE_ELLIPSE_DEFAULT_WIDTH FEEL_ELLIPSE_DEFAULT_WIDTH -#define FORCE_ELLIPSE_HEIGHT_AUTO FEEL_ELLIPSE_HEIGHT_AUTO -#define FORCE_ELLIPSE_DEFAULT_HEIGHT FEEL_ELLIPSE_DEFAULT_HEIGHT -#define FORCE_ELLIPSE_WALL_WIDTH_AUTO FEEL_ELLIPSE_WALL_WIDTH_AUTO -#define FORCE_ELLIPSE_DEFAULT_WALL_WIDTH FEEL_ELLIPSE_DEFAULT_WALL_WIDTH -#define FORCE_ELLIPSE_DEFAULT_STIFFNESS_MASK FEEL_ELLIPSE_DEFAULT_STIFFNESS_MASK -#define FORCE_ELLIPSE_DEFAULT_CLIPPING_MASK FEEL_ELLIPSE_DEFAULT_CLIPPING_MASK - -#define FORCE_ELLIPSE_DEFAULT_CENTER_POINT FEEL_ELLIPSE_DEFAULT_CENTER_POINT - - - - -//================================================================ -// CFeelEllipse -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelEllipse : public CFeelEffect -{ - // - // CONSTRUCTOR/DESCTRUCTOR - // - - public: - - // Constructor - CFeelEllipse(); - - // Destructor - virtual - ~CFeelEllipse(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - POINT pntCenter, - DWORD dwWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwHeight = FEEL_EFFECT_DONT_CHANGE, - LONG lStiffness = FEEL_EFFECT_DONT_CHANGE, - DWORD dwWallWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwStiffnessMask = FEEL_EFFECT_DONT_CHANGE, - DWORD dwClippingMask = FEEL_EFFECT_DONT_CHANGE, - CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE - ); - - BOOL - ChangeParameters( - LPCRECT pRectOutside, - LONG lStiffness = FEEL_EFFECT_DONT_CHANGE, - DWORD dwWallWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwStiffnessMask = FEEL_EFFECT_DONT_CHANGE, - DWORD dwClippingMask = FEEL_EFFECT_DONT_CHANGE, - CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE - ); - - - BOOL - SetRect( - LPCRECT pRect - ); - - - BOOL - SetCenter( - POINT pntCenter - ); - - - BOOL - SetCenter( - LONG x, - LONG y - ); - - - // - // OPERATIONS - // - - public: - - BOOL - Initialize( - CFeelDevice* pDevice, - DWORD dwWidth = FEEL_ELLIPSE_DEFAULT_WIDTH, - DWORD dwHeight = FEEL_ELLIPSE_DEFAULT_HEIGHT, - LONG lStiffness = FEEL_ELLIPSE_DEFAULT_STIFFNESS, - DWORD dwWallWidth = FEEL_ELLIPSE_DEFAULT_WALL_WIDTH, - DWORD dwSaturation = FEEL_ELLIPSE_DEFAULT_SATURATION, - DWORD dwStiffnessMask = FEEL_ELLIPSE_DEFAULT_STIFFNESS_MASK, - DWORD dwClippingMask = FEEL_ELLIPSE_DEFAULT_CLIPPING_MASK, - POINT pntCenter = FEEL_ELLIPSE_DEFAULT_CENTER_POINT, - CFeelEffect* pInsideEffect = NULL - ); - - - BOOL - Initialize( - CFeelDevice* pDevice, - LPCRECT pRectOutside, - LONG lStiffness = FEEL_ELLIPSE_DEFAULT_STIFFNESS, - DWORD dwWallWidth = FEEL_ELLIPSE_DEFAULT_WALL_WIDTH, - DWORD dwSaturation = FEEL_ELLIPSE_DEFAULT_SATURATION, - DWORD dwStiffnessMask = FEEL_ELLIPSE_DEFAULT_STIFFNESS_MASK, - DWORD dwClippingMask = FEEL_ELLIPSE_DEFAULT_CLIPPING_MASK, - CFeelEffect* pInsideEffect = NULL - ); - - - virtual BOOL -#ifdef FFC_START_DELAY - StartNow( -#else - Start( -#endif - DWORD dwFlags = 0 - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - BOOL - set_parameters( - LPCRECT pRectOutside, - LONG lStiffness, - DWORD dwWallWidth, - DWORD dwSaturation, - DWORD dwStiffnessMask, - DWORD dwClippingMask, - CFeelEffect* pInsideEffect - ); - - // - // INTERNAL DATA - // - - protected: - - FEELIT_ELLIPSE m_ellipse; - BOOL m_bUseMousePosAtStart; - -}; - - - -// -// INLINES -// - -inline BOOL -CFeelEllipse::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Ellipse); -} - -#endif // !defined(AFX_FEELELLIPSE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelEnclosure.h b/code/win32/FeelIt/FeelEnclosure.h deleted file mode 100644 index aa79a1f..0000000 --- a/code/win32/FeelIt/FeelEnclosure.h +++ /dev/null @@ -1,268 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelEnclosure.h - - PURPOSE: Base Enclosure Class for Feelit API Foundation Classes - - STARTED: 10/29/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELENCLOSURE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELENCLOSURE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelEffect.h" - - - -//================================================================ -// Constants -//================================================================ - - -#define FEEL_ENCLOSURE_DEFAULT_STIFFNESS 5000 -#define FEEL_ENCLOSURE_DEFAULT_SATURATION 10000 -#define FEEL_ENCLOSURE_DEFAULT_WIDTH 10 -#define FEEL_ENCLOSURE_HEIGHT_AUTO MAXDWORD -#define FEEL_ENCLOSURE_DEFAULT_HEIGHT FEEL_ENCLOSURE_HEIGHT_AUTO -#define FEEL_ENCLOSURE_WALL_WIDTH_AUTO MAXDWORD -#define FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH FEEL_ENCLOSURE_WALL_WIDTH_AUTO -#define FEEL_ENCLOSURE_DEFAULT_STIFFNESS_MASK FEELIT_FSTIFF_ANYWALL -#define FEEL_ENCLOSURE_DEFAULT_CLIPPING_MASK FEELIT_FCLIP_NONE - -#define FEEL_ENCLOSURE_DEFAULT_CENTER_POINT FEEL_EFFECT_MOUSE_POS_AT_START - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_ENCLOSURE_DEFAULT_STIFFNESS FEEL_ENCLOSURE_DEFAULT_STIFFNESS -#define FORCE_ENCLOSURE_DEFAULT_SATURATION FEEL_ENCLOSURE_DEFAULT_SATURATION -#define FORCE_ENCLOSURE_DEFAULT_WIDTH FEEL_ENCLOSURE_DEFAULT_WIDTH -#define FORCE_ENCLOSURE_HEIGHT_AUTO FEEL_ENCLOSURE_HEIGHT_AUTO -#define FORCE_ENCLOSURE_DEFAULT_HEIGHT FEEL_ENCLOSURE_DEFAULT_HEIGHT -#define FORCE_ENCLOSURE_WALL_WIDTH_AUTO FEEL_ENCLOSURE_WALL_WIDTH_AUTO -#define FORCE_ENCLOSURE_DEFAULT_WALL_WIDTH FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH -#define FORCE_ENCLOSURE_DEFAULT_STIFFNESS_MASK FEEL_ENCLOSURE_DEFAULT_STIFFNESS_MASK -#define FORCE_ENCLOSURE_DEFAULT_CLIPPING_MASK FEEL_ENCLOSURE_DEFAULT_CLIPPING_MASK - -#define FORCE_ENCLOSURE_DEFAULT_CENTER_POINT FEEL_ENCLOSURE_DEFAULT_CENTER_POINT - - - - -//================================================================ -// CFeelEnclosure -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelEnclosure : public CFeelEffect -{ - // - // CONSTRUCTOR/DESCTRUCTOR - // - - public: - - // Constructor - CFeelEnclosure(); - - // Destructor - virtual - ~CFeelEnclosure(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - POINT pntCenter, - DWORD dwWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwHeight = FEEL_EFFECT_DONT_CHANGE, - LONG lTopAndBottomWallStiffness = FEEL_EFFECT_DONT_CHANGE, - LONG lLeftAndRightWallStiffness = FEEL_EFFECT_DONT_CHANGE, - DWORD dwTopAndBottomWallWallWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwLeftAndRightWallWallWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwTopAndBottomWallSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwLeftAndRightWallSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwStiffnessMask = FEEL_EFFECT_DONT_CHANGE, - DWORD dwClippingMask = FEEL_EFFECT_DONT_CHANGE, - CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE - ); - - BOOL - ChangeParameters( - LPCRECT pRectOutside, - LONG lTopAndBottomWallStiffness = FEEL_EFFECT_DONT_CHANGE, - LONG lLeftAndRightWallStiffness = FEEL_EFFECT_DONT_CHANGE, - DWORD dwTopAndBottomWallWallWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwLeftAndRightWallWallWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwTopAndBottomWallSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwLeftAndRightWallSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwStiffnessMask = FEEL_EFFECT_DONT_CHANGE, - DWORD dwClippingMask = FEEL_EFFECT_DONT_CHANGE, - CFeelEffect* pInsideEffect = (CFeelEffect*) FEEL_EFFECT_DONT_CHANGE - ); - - - BOOL - SetRect( - LPCRECT pRect - ); - - - BOOL - SetCenter( - POINT pntCenter - ); - - - BOOL - SetCenter( - LONG x, - LONG y - ); - - - // - // OPERATIONS - // - - public: - - BOOL - Initialize( - CFeelDevice* pDevice, - DWORD dwWidth = FEEL_ENCLOSURE_DEFAULT_WIDTH, - DWORD dwHeight = FEEL_ENCLOSURE_DEFAULT_HEIGHT, - LONG lTopAndBottomWallStiffness = FEEL_ENCLOSURE_DEFAULT_STIFFNESS, - LONG lLeftAndRightWallStiffness = FEEL_ENCLOSURE_DEFAULT_STIFFNESS, - DWORD dwTopAndBottomWallWallWidth = FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH, - DWORD dwLeftAndRightWallWallWidth = FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH, - DWORD dwTopAndBottomWallSaturation = FEEL_ENCLOSURE_DEFAULT_SATURATION, - DWORD dwLeftAndRightWallSaturation = FEEL_ENCLOSURE_DEFAULT_SATURATION, - DWORD dwStiffnessMask = FEEL_ENCLOSURE_DEFAULT_STIFFNESS_MASK, - DWORD dwClippingMask = FEEL_ENCLOSURE_DEFAULT_CLIPPING_MASK, - POINT pntCenter = FEEL_ENCLOSURE_DEFAULT_CENTER_POINT, - CFeelEffect* pInsideEffect = NULL - ); - - - BOOL - Initialize( - CFeelDevice* pDevice, - LPCRECT pRectOutside, - LONG lTopAndBottomWallStiffness = FEEL_ENCLOSURE_DEFAULT_STIFFNESS, - LONG lLeftAndRightWallStiffness = FEEL_ENCLOSURE_DEFAULT_STIFFNESS, - DWORD dwTopAndBottomWallWallWidth = FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH, - DWORD dwLeftAndRightWallWallWidth = FEEL_ENCLOSURE_DEFAULT_WALL_WIDTH, - DWORD dwTopAndBottomWallSaturation = FEEL_ENCLOSURE_DEFAULT_SATURATION, - DWORD dwLeftAndRightWallSaturation = FEEL_ENCLOSURE_DEFAULT_SATURATION, - DWORD dwStiffnessMask = FEEL_ENCLOSURE_DEFAULT_STIFFNESS_MASK, - DWORD dwClippingMask = FEEL_ENCLOSURE_DEFAULT_CLIPPING_MASK, - CFeelEffect* pInsideEffect = NULL - ); - - - virtual BOOL -#ifdef FFC_START_DELAY - StartNow( -#else - Start( -#endif - DWORD dwFlags = 0 - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - BOOL - set_parameters( - LPCRECT pRectOutside, - LONG lTopAndBottomWallStiffness, - LONG lLeftAndRightWallStiffness, - DWORD dwTopAndBottomWallWallWidth, - DWORD dwLeftAndRightWallWallWidth, - DWORD dwTopAndBottomWallSaturation, - DWORD dwLeftAndRightWallSaturation, - DWORD dwStiffnessMask, - DWORD dwClippingMask, - CFeelEffect* pInsideEffect - ); - - // - // INTERNAL DATA - // - - protected: - - FEELIT_ENCLOSURE m_enclosure; - BOOL m_bUseMousePosAtStart; - -}; - - -// -// INLINES -// - -inline BOOL -CFeelEnclosure::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Enclosure); -} - -#endif // !defined(AFX_FEELENCLOSURE_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelFriction.h b/code/win32/FeelIt/FeelFriction.h deleted file mode 100644 index 2548c47..0000000 --- a/code/win32/FeelIt/FeelFriction.h +++ /dev/null @@ -1,172 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelFriction.h - - PURPOSE: Feelit API Friction Effect Class - - STARTED: 12/29/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELFriction_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELFriction_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include -#include "FeelCondition.h" - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_FRICTION_DEFAULT_COEFFICIENT 2500 -#define FEEL_FRICTION_DEFAULT_MIN_VELOCITY 0 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_FRICTION_DEFAULT_COEFFICIENT FEEL_FRICTION_DEFAULT_COEFFICIENT -#define FORCE_FRICTION_DEFAULT_MIN_VELOCITY FEEL_FRICTION_DEFAULT_MIN_VELOCITY - - -//================================================================ -// CFeelFriction -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelFriction : public CFeelCondition -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelFriction(); - - // Destructor - virtual - ~CFeelFriction(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - DWORD dwCoefficient, - DWORD dwMinVelocity = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE - ); - - BOOL - ChangeParametersPolar( - DWORD dwCoefficient, - DWORD dwMinVelocity, - LONG lAngle - ); - - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - DWORD dwCoefficient = FEEL_FRICTION_DEFAULT_COEFFICIENT, - DWORD dwMinVelocity = FEEL_FRICTION_DEFAULT_MIN_VELOCITY, - DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH, - LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y - ); - - virtual BOOL - InitializePolar( - CFeelDevice* pDevice, - DWORD dwCoefficient, - DWORD dwMinVelocity, - LONG lAngle - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - // - // INTERNAL DATA - // - - protected: - -}; - - - -// -// INLINES -// - -inline BOOL -CFeelFriction::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Friction); -} - - -#endif // !defined(AFX_FEELFriction_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelGrid.h b/code/win32/FeelIt/FeelGrid.h deleted file mode 100644 index 807eba8..0000000 --- a/code/win32/FeelIt/FeelGrid.h +++ /dev/null @@ -1,171 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelGrid.h - - PURPOSE: Feelit API Grid Effect Class - - STARTED: 12/11/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELGrid_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELGrid_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include -#include "FeelCondition.h" - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_GRID_DEFAULT_HORIZ_OFFSET 0 -#define FEEL_GRID_DEFAULT_VERT_OFFSET 0 -#define FEEL_GRID_DEFAULT_HORIZ_SPACING 100 -#define FEEL_GRID_DEFAULT_VERT_SPACING 100 -#define FEEL_GRID_DEFAULT_NODE_STRENGTH 5000 -#define FEEL_GRID_DEFAULT_NODE_SATURATION 10000 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_GRID_DEFAULT_HORIZ_OFFSET FEEL_GRID_DEFAULT_HORIZ_OFFSET -#define FORCE_GRID_DEFAULT_VERT_OFFSET FEEL_GRID_DEFAULT_VERT_OFFSET -#define FORCE_GRID_DEFAULT_HORIZ_SPACING FEEL_GRID_DEFAULT_HORIZ_SPACING -#define FORCE_GRID_DEFAULT_VERT_SPACING FEEL_GRID_DEFAULT_VERT_SPACING -#define FORCE_GRID_DEFAULT_NODE_STRENGTH FEEL_GRID_DEFAULT_NODE_STRENGTH -#define FORCE_GRID_DEFAULT_NODE_SATURATION FEEL_GRID_DEFAULT_NODE_SATURATION - - -//================================================================ -// CFeelGrid -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelGrid : public CFeelCondition -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelGrid(); - - // Destructor - virtual - ~CFeelGrid(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - DWORD dwHorizSpacing, - DWORD dwVertSpacing, - LONG lHorizNodeStrength = FEEL_EFFECT_DONT_CHANGE, - LONG lVertNodeStrength = FEEL_EFFECT_DONT_CHANGE, - DWORD dwHorizOffset = FEEL_EFFECT_DONT_CHANGE, - DWORD dwVertOffset = FEEL_EFFECT_DONT_CHANGE, - DWORD dwHorizNodeSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwVertNodeSaturation = FEEL_EFFECT_DONT_CHANGE - ); - - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - DWORD dwHorizSpacing = FEEL_GRID_DEFAULT_HORIZ_SPACING, - DWORD dwVertSpacing = FEEL_GRID_DEFAULT_VERT_SPACING, - LONG lHorizNodeStrength = FEEL_GRID_DEFAULT_NODE_STRENGTH, - LONG lVertNodeStrength = FEEL_GRID_DEFAULT_NODE_STRENGTH, - DWORD dwHorizOffset = FEEL_GRID_DEFAULT_HORIZ_OFFSET, - DWORD dwVertOffset = FEEL_GRID_DEFAULT_VERT_OFFSET, - DWORD dwHorizNodeSaturation = FEEL_GRID_DEFAULT_NODE_SATURATION, - DWORD dwVertNodeSaturation = FEEL_GRID_DEFAULT_NODE_SATURATION - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - // - // INTERNAL DATA - // - - protected: - -}; - - - -// -// INLINES -// - -inline BOOL -CFeelGrid::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Grid); -} - -#endif // !defined(AFX_FEELGrid_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelInertia.h b/code/win32/FeelIt/FeelInertia.h deleted file mode 100644 index c1a22d3..0000000 --- a/code/win32/FeelIt/FeelInertia.h +++ /dev/null @@ -1,178 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelInertia.h - - PURPOSE: Feelit API Inertia Effect Class - - STARTED: 12/29/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELInertia_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELInertia_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include -#include "FeelCondition.h" - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_INERTIA_DEFAULT_COEFFICIENT 2500 -#define FEEL_INERTIA_DEFAULT_SATURATION 10000 -#define FEEL_INERTIA_DEFAULT_MIN_ACCELERATION 0 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_INERTIA_DEFAULT_COEFFICIENT FEEL_INERTIA_DEFAULT_COEFFICIENT -#define FORCE_INERTIA_DEFAULT_SATURATION FEEL_INERTIA_DEFAULT_SATURATION -#define FORCE_INERTIA_DEFAULT_MIN_ACCELERATION FEEL_INERTIA_DEFAULT_MIN_ACCELERATION - - -//================================================================ -// CFeelInertia -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelInertia : public CFeelCondition -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelInertia(); - - // Destructor - virtual - ~CFeelInertia(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - DWORD dwCoefficient, - DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwMinAcceleration = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE - ); - - BOOL - ChangeParametersPolar( - DWORD dwCoefficient, - DWORD dwSaturation, - DWORD dwMinAcceleration, - LONG lAngle - ); - - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - DWORD dwCoefficient = FEEL_INERTIA_DEFAULT_COEFFICIENT, - DWORD dwSaturation = FEEL_INERTIA_DEFAULT_SATURATION, - DWORD dwMinAcceleration = FEEL_INERTIA_DEFAULT_MIN_ACCELERATION, - DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH, - LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y - ); - - virtual BOOL - InitializePolar( - CFeelDevice* pDevice, - DWORD dwCoefficient, - DWORD dwSaturation, - DWORD dwMinAcceleration, - LONG lAngle - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - // - // INTERNAL DATA - // - - protected: - -}; - - - -// -// INLINES -// - -inline BOOL -CFeelInertia::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Inertia); -} - - -#endif // !defined(AFX_FEELInertia_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelMouse.h b/code/win32/FeelIt/FeelMouse.h deleted file mode 100644 index b0e3989..0000000 --- a/code/win32/FeelIt/FeelMouse.h +++ /dev/null @@ -1,143 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelMouse.h - - PURPOSE: Abstraction of Feelit mouse device - - STARTED: 10/10/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - -#ifndef FeelMouse_h -#define FeelMouse_h - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelDevice.h" - - -//================================================================ -// CFeelMouse -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelMouse : public CFeelDevice -{ - - // - // CONSTRUCTOR/DESCTRUCTOR - // - - public: - - // Constructor - CFeelMouse(); - - // Destructor - virtual - ~CFeelMouse(); - - - // - // ATTRIBUTES - // - - public: - - virtual LPIFEEL_API - GetAPI() - { return m_piApi; } - - virtual LPIFEEL_DEVICE - GetDevice() - { return m_piDevice; } - - BOOL - HaveForceFeelitMouse() - { return m_piDevice != NULL; } - - - // - // OPERATIONS - // - - public: - - BOOL - Initialize( - HANDLE hinstApp, - HANDLE hwndApp, - DWORD dwCooperativeFlag = FEELIT_FCOOPLEVEL_FOREGROUND - ); - - virtual BOOL - ChangeScreenResolution( - BOOL bAutoSet, - DWORD dwXScreenSize = 0, - DWORD dwYScreenSize = 0 - ); - - // Another syntax for SwitchToAbsoluteMode. - // The default is Absolute mode. Call only to switch to Relative mode or - // to switch back to Absolute mode. - virtual BOOL - SwitchToAbsoluteMode( - BOOL bAbsMode - ); - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - virtual void - reset(); - - virtual BOOL - prepare_device(); - - - // - // INTERNAL DATA - // - - protected: - - LPIFEEL_API m_piApi; - LPIFEEL_DEVICE m_piDevice; -}; - -#endif // ForceFeelitMouse_h \ No newline at end of file diff --git a/code/win32/FeelIt/FeelPeriodic.h b/code/win32/FeelIt/FeelPeriodic.h deleted file mode 100644 index bd870fd..0000000 --- a/code/win32/FeelIt/FeelPeriodic.h +++ /dev/null @@ -1,227 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelPeriodic.h - - PURPOSE: Base Periodic Class for Feelit API Foundation Classes - - STARTED: 11/03/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELPERIODIC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELPERIODIC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelEffect.h" - - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_PERIODIC_DEFAULT_DURATION 1000 // Milliseconds -#define FEEL_PERIODIC_DEFAULT_MAGNITUDE 5000 -#define FEEL_PERIODIC_DEFAULT_PERIOD 100 // Milliseconds -#define FEEL_PERIODIC_DEFAULT_OFFSET 0 -#define FEEL_PERIODIC_DEFAULT_PHASE 0 // Degrees -#define FEEL_PERIODIC_DEFAULT_DIRECTION_X 1 // Pixels -#define FEEL_PERIODIC_DEFAULT_DIRECTION_Y 0 // Pixels -#define FEEL_PERIODIC_DEFAULT_ANGLE 9000 // 100ths of degrees - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_PERIODIC_DEFAULT_DURATION FEEL_PERIODIC_DEFAULT_DURATION -#define FORCE_PERIODIC_DEFAULT_MAGNITUDE FEEL_PERIODIC_DEFAULT_MAGNITUDE -#define FORCE_PERIODIC_DEFAULT_PERIOD FEEL_PERIODIC_DEFAULT_PERIOD -#define FORCE_PERIODIC_DEFAULT_OFFSET FEEL_PERIODIC_DEFAULT_OFFSET -#define FORCE_PERIODIC_DEFAULT_PHASE FEEL_PERIODIC_DEFAULT_PHASE -#define FORCE_PERIODIC_DEFAULT_DIRECTION_X FEEL_PERIODIC_DEFAULT_DIRECTION_X -#define FORCE_PERIODIC_DEFAULT_DIRECTION_Y FEEL_PERIODIC_DEFAULT_DIRECTION_Y -#define FORCE_PERIODIC_DEFAULT_ANGLE FEEL_PERIODIC_DEFAULT_ANGLE - - - -//================================================================ -// CFeelPeriodic -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelPeriodic : public CFeelEffect -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructors - - // You may use this form if you will immediately initialize it - // from an IFR file... - CFeelPeriodic(); - - // Otherwise use this form... - CFeelPeriodic( - const GUID& rguidEffect - ); - - // Destructor - virtual - ~CFeelPeriodic(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - DWORD dwMagnitude, - DWORD dwPeriod = FEEL_EFFECT_DONT_CHANGE, - DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE, - LONG lOffset = FEEL_EFFECT_DONT_CHANGE, - DWORD dwPhase = FEEL_EFFECT_DONT_CHANGE, - LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR - ); - - BOOL - ChangeParametersPolar( - DWORD dwMagnitude, - DWORD dwPeriod = FEEL_EFFECT_DONT_CHANGE, - DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE, - LONG lAngle = FEEL_EFFECT_DONT_CHANGE, - LONG lOffset = FEEL_EFFECT_DONT_CHANGE, - DWORD dwPhase = FEEL_EFFECT_DONT_CHANGE, - LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR - ); - - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - DWORD dwMagnitude = FEEL_PERIODIC_DEFAULT_MAGNITUDE, - DWORD dwPeriod = FEEL_PERIODIC_DEFAULT_PERIOD, - DWORD dwDuration = FEEL_PERIODIC_DEFAULT_DURATION, - LONG lDirectionX = FEEL_PERIODIC_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_PERIODIC_DEFAULT_DIRECTION_Y, - LONG lOffset = FEEL_PERIODIC_DEFAULT_OFFSET, - DWORD dwPhase = FEEL_PERIODIC_DEFAULT_PHASE, - LPFEEL_ENVELOPE pEnvelope = NULL - ); - - virtual BOOL - InitializePolar( - CFeelDevice* pDevice, - DWORD dwMagnitude = FEEL_PERIODIC_DEFAULT_MAGNITUDE, - DWORD dwPeriod = FEEL_PERIODIC_DEFAULT_PERIOD, - DWORD dwDuration = FEEL_PERIODIC_DEFAULT_DURATION, - LONG lAngle = FEEL_PERIODIC_DEFAULT_ANGLE, - LONG lOffset = FEEL_PERIODIC_DEFAULT_OFFSET, - DWORD dwPhase = FEEL_PERIODIC_DEFAULT_PHASE, - LPFEEL_ENVELOPE pEnvelope = NULL - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - BOOL - set_parameters( - DWORD dwfCoordinates, - LONG lDirection0, - LONG lDirection1, - DWORD dwDuration, - DWORD dwMagnitude, - DWORD dwPeriod, - LONG lOffset, - DWORD dwPhase, - LPFEEL_ENVELOPE pEnvelope - ); - - - // - // INTERNAL DATA - // - - protected: - - FEEL_PERIODIC m_Periodic; - -}; - - -// -// INLINES -// - -inline BOOL -CFeelPeriodic::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Sine) || - IsEqualGUID(guid, GUID_Feel_Square) || - IsEqualGUID(guid, GUID_Feel_Triangle) || - IsEqualGUID(guid, GUID_Feel_SawtoothUp) || - IsEqualGUID(guid, GUID_Feel_SawtoothDown); -} - -#endif // !defined(AFX_FEELPERIODIC_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelProjects.h b/code/win32/FeelIt/FeelProjects.h deleted file mode 100644 index 46768dc..0000000 --- a/code/win32/FeelIt/FeelProjects.h +++ /dev/null @@ -1,302 +0,0 @@ -/********************************************************************** - Copyright (c) 1999 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelProjects.h - - PURPOSE: CFeelProject - Manages a set of forces in a project. - There will be a project for each opened IFR file. - CFeelProjects - Manages a set of projects - - STARTED: 2/22/99 by Jeff Mallett - - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - -#ifndef __FEEL_PROJECTS_H -#define __FEEL_PROJECTS_H - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - - -#include "FFCErrors.h" -#include "FeelBaseTypes.h" -#include "FeelDevice.h" -#include "FeelCompoundEffect.h" - -class CFeelProjects; - - -//================================================================ -// CFeelProject -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelProject -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - CFeelProject() : - m_hProj(NULL), m_pCreatedEffects(NULL), - m_pNext(NULL), m_pDevice(NULL) - { } - - ~CFeelProject(); - - void - Close(); - - - // - // ATTRIBUTES - // - - public: - - CFeelDevice* - GetDevice() const - { return m_pDevice; } - - BOOL - GetIsOpen() const - { return m_hProj != NULL; } - - CFeelCompoundEffect * - GetCreatedEffect( - LPCSTR lpszEffectName - ); - - - // - // OPERATIONS - // - - public: - - BOOL - Start( - LPCSTR lpszEffectName = NULL, - DWORD dwIterations = 1, - DWORD dwFlags = 0, - CFeelDevice* pDevice = NULL - ); - - BOOL - Stop( - LPCSTR lpszEffectName = NULL - ); - - BOOL - OpenFile( - LPCSTR lpszFilePath, - CFeelDevice *pDevice - ); - - LoadProjectObjectPointer( - BYTE *pMem, - CFeelDevice *pDevice - ); - - CFeelCompoundEffect * - CreateEffect( - LPCSTR lpszEffectName, - CFeelDevice* pDevice = NULL - ); - - CFeelCompoundEffect * - CreateEffectByIndex( - int nEffectIndex, - CFeelDevice* pDevice = NULL - ); - - CFeelCompoundEffect * - AddEffect( - LPCSTR lpszEffectName, - GENERIC_EFFECT_PTR pObject - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - void - set_next( - CFeelProject *pNext - ) - { m_pNext = pNext; } - - CFeelProject * - get_next() const - { return m_pNext; } - - void - append_effect_to_list( - CFeelCompoundEffect* pEffect - ); - - IFREffect ** - create_effect_structs( - LPCSTR lpszEffectName, - int &nEff - ); - - IFREffect ** - create_effect_structs_by_index( - int nEffectIndex, - int &nEff - ); - - BOOL - release_effect_structs( - IFREffect **hEffects - ); - - // - // FRIENDS - // - - public: - - friend BOOL - CFeelEffect::InitializeFromProject( - CFeelProject &project, - LPCSTR lpszEffectName, - CFeelDevice* pDevice /* = NULL */ - ); - - friend class CFeelProjects; - - // - // INTERNAL DATA - // - - protected: - - HIFRPROJECT m_hProj; - CFeelCompoundEffect* m_pCreatedEffects; - CFeelDevice* m_pDevice; - - private: - - CFeelProject* m_pNext; -}; - - - -//================================================================ -// CFeelProjects -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelProjects -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - CFeelProjects() : m_pProjects(NULL) { } - - ~CFeelProjects(); - - void - Close(); - - - // - // ATTRIBUTES - // - - public: - - CFeelProject * - GetProject( - int index = 0 - ); - - - // - // OPERATIONS - // - - public: - - BOOL - Stop(); - - long - OpenFile( - LPCSTR lpszFilePath, - CFeelDevice *pDevice - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - - // - // INTERNAL DATA - // - protected: - - CFeelProject *m_pProjects; -}; - - - -#endif // __FEEL_PROJECTS_H diff --git a/code/win32/FeelIt/FeelRamp.h b/code/win32/FeelIt/FeelRamp.h deleted file mode 100644 index 8fd98a4..0000000 --- a/code/win32/FeelIt/FeelRamp.h +++ /dev/null @@ -1,194 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelRamp.h - - PURPOSE: Base Ramp Force Class for Feelit API Foundation Classes - - STARTED: 12/11/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELRAMP_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELRAMP_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include "FeelBaseTypes.h" -#include "FeelEffect.h" - - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_RAMP_DEFAULT_DURATION 1000 // Milliseconds -#define FEEL_RAMP_DEFAULT_MAGNITUDE_START 0 -#define FEEL_RAMP_DEFAULT_MAGNITUDE_END 10000 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_RAMP_DEFAULT_DURATION FEEL_RAMP_DEFAULT_DURATION -#define FORCE_RAMP_DEFAULT_MAGNITUDE_START FEEL_RAMP_DEFAULT_MAGNITUDE_START -#define FORCE_RAMP_DEFAULT_MAGNITUDE_END FEEL_RAMP_DEFAULT_MAGNITUDE_END - - -//================================================================ -// CFeelRamp -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelRamp : public CFeelEffect -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelRamp(); - - // Destructor - virtual - ~CFeelRamp(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - LONG lDirectionX, - LONG lDirectionY, - DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE, - LONG lMagStart = FEEL_EFFECT_DONT_CHANGE, - LONG lMagEnd = FEEL_EFFECT_DONT_CHANGE, - LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR - ); - - BOOL - ChangeParametersPolar( - LONG lAngle, - DWORD dwDuration = FEEL_EFFECT_DONT_CHANGE, - LONG lMagStart = FEEL_EFFECT_DONT_CHANGE, - LONG lMagEnd = FEEL_EFFECT_DONT_CHANGE, - LPFEEL_ENVELOPE pEnvelope = (LPFEEL_ENVELOPE) FEEL_EFFECT_DONT_CHANGE_PTR - ); - - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y, - DWORD dwDuration = FEEL_RAMP_DEFAULT_DURATION, - LONG lMagStart = FEEL_RAMP_DEFAULT_MAGNITUDE_START, - LONG lMagEnd = FEEL_RAMP_DEFAULT_MAGNITUDE_END, - LPFEEL_ENVELOPE pEnvelope = NULL - ); - - virtual BOOL - InitializePolar( - CFeelDevice* pDevice, - LONG lAngle = FEEL_EFFECT_DEFAULT_ANGLE, - DWORD dwDuration = FEEL_RAMP_DEFAULT_DURATION, - LONG lMagStart = FEEL_RAMP_DEFAULT_MAGNITUDE_START, - LONG lMagEnd = FEEL_RAMP_DEFAULT_MAGNITUDE_END, - LPFEEL_ENVELOPE pEnvelope = NULL - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - BOOL - set_parameters( - DWORD dwfCoordinates, - LONG lDirection0, - LONG lDirection1, - DWORD dwDuration, - LONG lMagStart, - LONG lMagEnd, - LPFEEL_ENVELOPE pEnvelope - ); - - - // - // INTERNAL DATA - // - - protected: - - FEEL_RAMPFORCE m_RampForce; - -}; - - -// -// INLINES -// - -inline BOOL -CFeelRamp::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_RampForce); -} - -#endif // !defined(AFX_FEELRAMP_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelSpring.h b/code/win32/FeelIt/FeelSpring.h deleted file mode 100644 index 617ca75..0000000 --- a/code/win32/FeelIt/FeelSpring.h +++ /dev/null @@ -1,191 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelSpring.h - - PURPOSE: Feelit API Spring Class - - STARTED: 10/10/97 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FEELSPRING_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FEELSPRING_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include -#include "FeelCondition.h" - - -//================================================================ -// Constants -//================================================================ - -#define FEEL_SPRING_DEFAULT_STIFFNESS 2500 -#define FEEL_SPRING_DEFAULT_SATURATION 10000 -#define FEEL_SPRING_DEFAULT_DEADBAND 100 -#define FEEL_SPRING_DEFAULT_CENTER_POINT FEEL_EFFECT_MOUSE_POS_AT_START -#define FEEL_SPRING_DEFAULT_DIRECTION_X 1 -#define FEEL_SPRING_DEFAULT_DIRECTION_Y 0 -#define FEEL_SPRING_DEFAULT_ANGLE 0 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_SPRING_DEFAULT_STIFFNESS FEEL_SPRING_DEFAULT_STIFFNESS -#define FORCE_SPRING_DEFAULT_SATURATION FEEL_SPRING_DEFAULT_SATURATION -#define FORCE_SPRING_DEFAULT_DEADBAND FEEL_SPRING_DEFAULT_DEADBAND -#define FORCE_SPRING_DEFAULT_CENTER_POINT FEEL_SPRING_DEFAULT_CENTER_POINT -#define FORCE_SPRING_DEFAULT_DIRECTION_X FEEL_SPRING_DEFAULT_DIRECTION_X -#define FORCE_SPRING_DEFAULT_DIRECTION_Y FEEL_SPRING_DEFAULT_DIRECTION_Y -#define FORCE_SPRING_DEFAULT_ANGLE FEEL_SPRING_DEFAULT_ANGLE - - -//================================================================ -// CFeelSpring -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelSpring : public CFeelCondition -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelSpring(); - - // Destructor - virtual - ~CFeelSpring(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - BOOL - ChangeParameters( - POINT pntCenter, - LONG lStiffness = FEEL_EFFECT_DONT_CHANGE, - DWORD dwSaturation = FEEL_EFFECT_DONT_CHANGE, - DWORD dwDeadband = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE - ); - - BOOL - ChangeParametersPolar( - POINT pntCenter, - LONG lStiffness, - DWORD dwSaturation, - DWORD dwDeadband, - LONG lAngle - ); - - // - // OPERATIONS - // - - public: - - virtual BOOL - Initialize( - CFeelDevice* pDevice, - LONG lStiffness = FEEL_SPRING_DEFAULT_STIFFNESS, - DWORD dwSaturation = FEEL_SPRING_DEFAULT_SATURATION, - DWORD dwDeadband = FEEL_SPRING_DEFAULT_DEADBAND, - DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH, - POINT pntCenter = FEEL_SPRING_DEFAULT_CENTER_POINT, - LONG lDirectionX = FEEL_SPRING_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_SPRING_DEFAULT_DIRECTION_Y, - BOOL bUseDeviceCoordinates = FALSE - ); - - virtual BOOL - InitializePolar( - CFeelDevice* pDevice, - LONG lStiffness, - DWORD dwSaturation, - DWORD dwDeadband, - POINT pntCenter, - LONG lAngle, - BOOL bUseDeviceCoordinates = FALSE - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - // - // INTERNAL DATA - // - - protected: - -}; - - - -// -// INLINES -// - -inline BOOL -CFeelSpring::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Spring); -} - -#endif // !defined(AFX_FEELSPRING_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) - diff --git a/code/win32/FeelIt/FeelTexture.h b/code/win32/FeelIt/FeelTexture.h deleted file mode 100644 index b5a72c3..0000000 --- a/code/win32/FeelIt/FeelTexture.h +++ /dev/null @@ -1,287 +0,0 @@ -/********************************************************************** - Copyright (c) 1997 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelTexture.h - - PURPOSE: Texture Class for Feelit API Foundation Classes - - STARTED: 2/27/98 - - NOTES/REVISIONS: - 3/2/99 jrm (Jeff Mallett): Force-->Feel renaming - 3/2/99 jrm: Added GetIsCompatibleGUID - 3/15/99 jrm: __declspec(dllimport/dllexport) the whole class - -**********************************************************************/ - - -#if !defined(AFX_FeelTexture_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) -#define AFX_FeelTexture_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_ - -#if _MSC_VER >= 1000 -#pragma once -#endif // _MSC_VER >= 1000 - -#ifndef _FFCDLL_ -#define DLLFFC __declspec(dllimport) -#else -#define DLLFFC __declspec(dllexport) -#endif - -#include -#include "FeelBaseTypes.h" -#include "FeelEffect.h" - - - -//================================================================ -// Constants -//================================================================ - -const POINT FEEL_TEXTURE_PT_NULL = { 0, 0 }; -const POINT FEEL_TEXTURE_DEFAULT_OFFSET_POINT = { 0, 0}; - -#define FEEL_TEXTURE_DEFAULT_MAGNITUDE 5000 -#define FEEL_TEXTURE_DEFAULT_WIDTH 10 -#define FEEL_TEXTURE_DEFAULT_SPACING 20 - -// -// FORCE --> FEEL Wrappers -// -#define FORCE_TEXTURE_PT_NULL FEEL_TEXTURE_PT_NULL -#define FORCE_TEXTURE_DEFAULT_OFFSET_POINT FEEL_TEXTURE_DEFAULT_OFFSET_POINT - -#define FORCE_TEXTURE_DEFAULT_MAGNITUDE FEEL_TEXTURE_DEFAULT_MAGNITUDE -#define FORCE_TEXTURE_DEFAULT_WIDTH FEEL_TEXTURE_DEFAULT_WIDTH -#define FORCE_TEXTURE_DEFAULT_SPACING FEEL_TEXTURE_DEFAULT_SPACING - - -//================================================================ -// CFeelTexture -//================================================================ - -// -// ------ PUBLIC INTERFACE ------ -// - -class DLLFFC CFeelTexture : public CFeelEffect -{ - // - // CONSTRUCTOR/DESTRUCTOR - // - - public: - - // Constructor - CFeelTexture(); - - // Destructor - virtual - ~CFeelTexture(); - - - // - // ATTRIBUTES - // - - public: - - virtual BOOL - GetIsCompatibleGUID( - GUID &guid - ); - - // Use this form for single-axis and dual-axis effects - BOOL - ChangeTextureParams( - LPCFEELIT_TEXTURE pTextureX, - LPCFEELIT_TEXTURE pTextureY - ); - - // Use this form for directional effects - BOOL - ChangeTextureParams( - LPCFEELIT_TEXTURE pTexture, - LONG lDirectionX, - LONG lDirectionY - ); - - // Use this form for directional effects - BOOL - ChangeTextureParamsPolar( - LPCFEELIT_TEXTURE pTexture, - LONG lAngle - ); - - // Use this form for single-axis, dual-axis symetrical, or directional effects - BOOL - ChangeTextureParams( - LONG lPosBumpMag = FEEL_EFFECT_DONT_CHANGE, - DWORD dwPosBumpWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwPosBumpSpacing = FEEL_EFFECT_DONT_CHANGE, - LONG lNegBumpMag = FEEL_EFFECT_DONT_CHANGE, - DWORD dwNegBumpWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwNegBumpSpacing = FEEL_EFFECT_DONT_CHANGE, - POINT pntOffset = FEEL_EFFECT_DONT_CHANGE_POINT, - LONG lDirectionX = FEEL_EFFECT_DONT_CHANGE, - LONG lDirectionY = FEEL_EFFECT_DONT_CHANGE - ); - - // Use this form for single-axis, dual-axis symetrical, or directional effects - BOOL - ChangeTextureParamsPolar( - LONG lPosBumpMag = FEEL_EFFECT_DONT_CHANGE, - DWORD dwPosBumpWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwPosBumpSpacing = FEEL_EFFECT_DONT_CHANGE, - LONG lNegBumpMag = FEEL_EFFECT_DONT_CHANGE, - DWORD dwNegBumpWidth = FEEL_EFFECT_DONT_CHANGE, - DWORD dwNegBumpSpacing = FEEL_EFFECT_DONT_CHANGE, - POINT pntOffset = FEEL_EFFECT_DONT_CHANGE_POINT, - LONG lAngle = FEEL_EFFECT_DONT_CHANGE - ); - - BOOL - SetOffset( - POINT pntOffset - ); - - // - // OPERATIONS - // - - public: - - // Use this form for single-axis and dual-axis effects - BOOL - InitTexture( - CFeelDevice* pDevice, - LPCFEELIT_TEXTURE pTextureX, - LPCFEELIT_TEXTURE pTextureY - ); - - - // Use this form for directional effects - BOOL - InitTexture( - CFeelDevice* pDevice, - LPCFEELIT_TEXTURE pTexture, - LONG lDirectionX, - LONG lDirectionY - ); - - - // Use this form for directional effects - BOOL - InitTexturePolar( - CFeelDevice* pDevice, - LPCFEELIT_TEXTURE pTexture, - LONG lAngle - ); - - - // Use this form for single-axis, dual-axis symetrical, or directional effects - BOOL - InitTexture( - CFeelDevice* pDevice, - LONG lPosBumpMag = FEEL_TEXTURE_DEFAULT_MAGNITUDE, - DWORD dwPosBumpWidth = FEEL_TEXTURE_DEFAULT_WIDTH, - DWORD dwPosBumpSpacing = FEEL_TEXTURE_DEFAULT_SPACING, - LONG lNegBumpMag = FEEL_TEXTURE_DEFAULT_MAGNITUDE, - DWORD dwNegBumpWidth = FEEL_TEXTURE_DEFAULT_WIDTH, - DWORD dwNegBumpSpacing = FEEL_TEXTURE_DEFAULT_SPACING, - DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH, - POINT pntOffset = FEEL_TEXTURE_DEFAULT_OFFSET_POINT, - LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X, - LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y - ); - - // Use this form for directional effects - BOOL - InitTexturePolar( - CFeelDevice* pDevice, - LONG lPosBumpMag = FEEL_TEXTURE_DEFAULT_MAGNITUDE, - DWORD dwPosBumpWidth = FEEL_TEXTURE_DEFAULT_WIDTH, - DWORD dwPosBumpSpacing = FEEL_TEXTURE_DEFAULT_SPACING, - LONG lNegBumpMag = FEEL_TEXTURE_DEFAULT_MAGNITUDE, - DWORD dwNegBumpWidth = FEEL_TEXTURE_DEFAULT_WIDTH, - DWORD dwNegBumpSpacing = FEEL_TEXTURE_DEFAULT_SPACING, - POINT pntOffset = FEEL_TEXTURE_DEFAULT_OFFSET_POINT, - LONG lAngle = FEEL_EFFECT_DEFAULT_ANGLE - ); - - -// -// ------ PRIVATE INTERFACE ------ -// - - // - // HELPERS - // - - protected: - - BOOL - set_parameters( - DWORD dwfAxis, - DWORD dwfCoordinates, - LONG lDirection0, - LONG lDirection1, - LPCFEELIT_TEXTURE pTextureX, - LPCFEELIT_TEXTURE pTextureY - ); - - BOOL - set_parameters( - DWORD dwfAxis, - DWORD dwfCoordinates, - LONG lDirection0, - LONG lDirection1, - LONG lPosBumpMag, - DWORD dwPosBumpWidth, - DWORD dwPosBumpSpacing, - LONG lNegBumpMag, - DWORD dwNegBumpWidth, - DWORD dwNegBumpSpacing, - POINT pntOffset - ); - - // - // INTERNAL DATA - // - - FEEL_TEXTURE m_aTexture[2]; - DWORD m_dwfAxis; - - protected: - -}; - - - -// -// INLINES -// - -inline BOOL -CFeelTexture::GetIsCompatibleGUID(GUID &guid) -{ - return IsEqualGUID(guid, GUID_Feel_Texture); -} - -#endif // !defined(AFX_FeelTexture_H__135B88C4_4175_11D1_B049_0020AF30269A__INCLUDED_) diff --git a/code/win32/FeelIt/FeelitAPI.h b/code/win32/FeelIt/FeelitAPI.h deleted file mode 100644 index d88fc4e..0000000 --- a/code/win32/FeelIt/FeelitAPI.h +++ /dev/null @@ -1,1252 +0,0 @@ -/********************************************************************** - Copyright (c) 1997, 1998, 1999 Immersion Corporation - - Permission to use, copy, modify, distribute, and sell this - software and its documentation may be granted without fee; - interested parties are encouraged to request permission from - Immersion Corporation - 2158 Paragon Drive - San Jose, CA 95131 - 408-467-1900 - - IMMERSION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. - IN NO EVENT SHALL IMMERSION BE LIABLE FOR ANY SPECIAL, INDIRECT OR - CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, - NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - - FILE: FeelitAPI.h - - PURPOSE: Feelit API - - STARTED: 09/08/97 - - NOTES/REVISIONS: - -**********************************************************************/ - -#ifndef __FEELITAPI_INCLUDED__ -#define __FEELITAPI_INCLUDED__ - -#ifndef FEELIT_VERSION -#define FEELIT_VERSION 0x0103 -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -#if (FEELIT_VERSION >= 0x0101) -#undef IS_VXD -#endif // FEELIT_VERSION - -#ifndef IS_VXD - -#ifdef _WIN32 -#define COM_NO_WINDOWS_H -#include -#endif - -#endif // IS_VXD not defined - - -#ifndef IS_VXD - -/**************************************************************************** - * - * Class IDs - * - ****************************************************************************/ - -DEFINE_GUID(CLSID_Feelit, 0x5959df60,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(CLSID_FeelitDevice, 0x5959df61,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - - -/**************************************************************************** - * - * Interfaces - * - ****************************************************************************/ - -DEFINE_GUID(IID_IFeelit, 0x5959df62,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(IID_IFeelitDevice, 0x5959df63,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(IID_IFeelitEffect, 0x5959df64,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(IID_IFeelitConfig, 0x900c39e0,0xcc5c,0x11d2,0x8c,0x5d,0x00,0x10,0x5a,0x17,0x8a,0xd1); - - -/**************************************************************************** - * - * Predefined object types - * - ****************************************************************************/ - -DEFINE_GUID(GUID_Feelit_XAxis, 0x5959df65,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_YAxis, 0x5959df66,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_ZAxis, 0x5959df67,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_RxAxis, 0x5959df68,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_RyAxis, 0x5959df69,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_RzAxis, 0x5959df6a,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Slider, 0x5959df6b,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -DEFINE_GUID(GUID_Feelit_Button, 0x5959df6c,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Key, 0x5959df6d,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -DEFINE_GUID(GUID_Feelit_POV, 0x5959df6e,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -DEFINE_GUID(GUID_Feelit_Unknown, 0x5959df6f,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - - -/**************************************************************************** - * - * Predefined Product GUIDs - * - ****************************************************************************/ - -DEFINE_GUID(GUID_Feelit_Mouse, 0x99bb5400,0x2b94,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -/**************************************************************************** - * - * Force feedback effects - * - ****************************************************************************/ - - -/* Constant Force */ -DEFINE_GUID(GUID_Feelit_ConstantForce,0x5959df71,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -/* Ramp Force */ -DEFINE_GUID(GUID_Feelit_RampForce, 0x5959df72,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -/* Periodic Effects */ -DEFINE_GUID(GUID_Feelit_Square, 0x5959df73,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Sine, 0x5959df74,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Triangle, 0x5959df75,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_SawtoothUp, 0x5959df76,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_SawtoothDown,0x5959df77,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - - -/* Conditions */ -DEFINE_GUID(GUID_Feelit_Spring, 0x5959df78,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_DeviceSpring,0x5959df83,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Damper, 0x5959df79,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Inertia, 0x5959df7a,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Friction, 0x5959df7b,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Texture, 0x5959df7c,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Grid, 0x5959df7d,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -/* Enclosures */ -DEFINE_GUID(GUID_Feelit_Enclosure, 0x5959df7f,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); -DEFINE_GUID(GUID_Feelit_Ellipse, 0x5959df82,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -/* Custom Force */ -DEFINE_GUID(GUID_Feelit_CustomForce, 0x5959df7e,0x2911,0x11d1,0xb0,0x49,0x00,0x20,0xaf,0x30,0x26,0x9a); - -#endif // IS_VXD not defined - -/**************************************************************************** - * - * Interfaces and Structures... - * - ****************************************************************************/ - - -/**************************************************************************** - * - * IFeelitEffect - * - ****************************************************************************/ - -#define FEELIT_FEFFECTTYPE_ALL 0x00000000 - -#define FEELIT_FEFFECTTYPE_CONSTANTFORCE 0x00000001 -#define FEELIT_FEFFECTTYPE_RAMPFORCE 0x00000002 -#define FEELIT_FEFFECTTYPE_PERIODIC 0x00000003 -#define FEELIT_FEFFECTTYPE_CONDITION 0x00000004 -#define FEELIT_FEFFECTTYPE_ENCLOSURE 0x00000005 -#define FEELIT_FEFFECTTYPE_ELLIPSE 0x00000006 -#define FEELIT_FEFFECTTYPE_TEXTURE 0x00000007 -#define FEELIT_FEFFECTTYPE_CUSTOMFORCE 0x000000F0 -#define FEELIT_FEFFECTTYPE_HARDWARE 0x000000FF - -#define FEELIT_FEFFECTTYPE_FFATTACK 0x00000200 -#define FEELIT_FEFFECTTYPE_FFFADE 0x00000400 -#define FEELIT_FEFFECTTYPE_SATURATION 0x00000800 -#define FEELIT_FEFFECTTYPE_POSNEGCOEFFICIENTS 0x00001000 -#define FEELIT_FEFFECTTYPE_POSNEGSATURATION 0x00002000 -#define FEELIT_FEFFECTTYPE_DEADBAND 0x00004000 - -#define FEELIT_EFFECTTYPE_GETTYPE(n) LOBYTE(n) -#define FEELIT_EFFECTTYPE_GETFLAGS(n) ( n & 0xFFFFFF00 ) - -#define FEELIT_DEGREES 100 -#define FEELIT_FFNOMINALMAX 10000 -#define FEELIT_SECONDS 1000000 - -typedef struct FEELIT_CONSTANTFORCE { - LONG lMagnitude; /* Magnitude of the effect, in the range -10000 to 10000 */ -} FEELIT_CONSTANTFORCE, *LPFEELIT_CONSTANTFORCE; -typedef const FEELIT_CONSTANTFORCE *LPCFEELIT_CONSTANTFORCE; - -typedef struct FEELIT_RAMPFORCE { - LONG lStart; /* Magnitude at start of effect. Range -10000 to 10000 */ - LONG lEnd; /* Magnitude at end of effect. Range -10000 to 10000 */ -} FEELIT_RAMPFORCE, *LPFEELIT_RAMPFORCE; -typedef const FEELIT_RAMPFORCE *LPCFEELIT_RAMPFORCE; - -typedef struct FEELIT_PERIODIC { - DWORD dwMagnitude; /* Magnitude of the effect, in the range 0 to 10000 */ - LONG lOffset; /* Force will be gen'd in range lOffset - dwMagnitude to lOffset + dwMagnitude */ - DWORD dwPhase; /* Position in cycle at wich playback begins. Range 0 - 35,999 */ - DWORD dwPeriod; /* Period (length of one cycle) of the effect in microseconds */ -} FEELIT_PERIODIC, *LPFEELIT_PERIODIC; -typedef const FEELIT_PERIODIC *LPCFEELIT_PERIODIC; - -typedef struct FEELIT_CONDITION { - LONG lCenter; /* Center-point in screen coords. Axis depends on that in FEELIT_EFFECT */ - LONG lPositiveCoefficient; /* Coef. on pos. side of the offset. Range -10000 to 10000 */ - LONG lNegativeCoefficient; /* Coef. on neg. side of the offset. Range -10000 to 10000 */ - DWORD dwPositiveSaturation; /* Max force output on pos. side of offset. Range 0 to 10000 */ - DWORD dwNegativeSaturation; /* Max force output on neg. side of offset. Range 0 to 10000 */ - LONG lDeadBand; /* Region around lOffset where condition is not active. Range 0 to 10000 */ -} FEELIT_CONDITION, *LPFEELIT_CONDITION; -typedef const FEELIT_CONDITION *LPCFEELIT_CONDITION; - -typedef struct FEELIT_TEXTURE { - DWORD dwSize; /* sizeof(FEELIT_TEXTURE) */ - LONG lOffset; /* Offset in screen coords of first texture from left or top edge */ - LONG lPosBumpMag; /* Magnitude of bumps felt when mouse travels in positive direction */ - DWORD dwPosBumpWidth; /* Width of bumps felt when mouse travels in positive direction */ - DWORD dwPosBumpSpacing; /* Center-to-Center spacing of bumps felt when mouse travels in positive direction */ - LONG lNegBumpMag; /* Magnitude of bumps felt when mouse travels in negative direction */ - DWORD dwNegBumpWidth; /* Width of bumps felt when mouse travels in negative direction */ - DWORD dwNegBumpSpacing; /* Center-to-Center spacing of bumps felt when mouse travels in negative direction */ -} FEELIT_TEXTURE, *LPFEELIT_TEXTURE; -typedef const FEELIT_TEXTURE *LPCFEELIT_TEXTURE; - -typedef struct FEELIT_CUSTOMFORCE { - DWORD cChannels; /* No. of channels (axes) affected by this force */ - DWORD dwSamplePeriod; /* Sample period in microseconds */ - DWORD cSamples; /* Total number of samples in the rglForceData */ - LPLONG rglForceData; /* long[cSamples]. Array of force values. Channels are interleaved */ -} FEELIT_CUSTOMFORCE, *LPFEELIT_CUSTOMFORCE; -typedef const FEELIT_CUSTOMFORCE *LPCFEELIT_CUSTOMFORCE; - -typedef struct FEELIT_ENVELOPE { - DWORD dwSize; /* sizeof(FEELIT_ENVELOPE) */ - DWORD dwAttackLevel; /* Ampl. for start of env., rel. to baseline. Range 0 to 10000 */ - DWORD dwAttackTime; /* Time, in microseconds, to reach sustain level */ - DWORD dwFadeLevel; /* Ampl. for end of env., rel. to baseline. Range 0 to 10000 */ - DWORD dwFadeTime; /* Time, in microseconds, to reach fade level */ -} FEELIT_ENVELOPE, *LPFEELIT_ENVELOPE; -typedef const FEELIT_ENVELOPE *LPCFEELIT_ENVELOPE; - -typedef struct FEELIT_EFFECT { - DWORD dwSize; /* sizeof(FEELIT_EFFECT) */ - GUID guidEffect; /* Effect Identifier */ - DWORD dwFlags; /* FEELIT_FEFFECT_* */ - DWORD dwDuration; /* Microseconds */ - DWORD dwSamplePeriod; /* RESERVED */ - DWORD dwGain; /* RESERVED */ - DWORD dwTriggerButton; /* RESERVED */ - DWORD dwTriggerRepeatInterval; /* RESERVED */ - DWORD cAxes; /* Number of axes */ - LPDWORD rgdwAxes; /* Array of axes */ - LPLONG rglDirection; /* Array of directions */ - LPFEELIT_ENVELOPE lpEnvelope; /* Optional */ - DWORD cbTypeSpecificParams; /* Size of params */ - LPVOID lpvTypeSpecificParams; /* Pointer to params */ - DWORD dwStartDelay; /* Microseconds delay */ -} FEELIT_EFFECT, *LPFEELIT_EFFECT; -typedef const FEELIT_EFFECT *LPCFEELIT_EFFECT; - - -/* Effect Flags */ -#define FEELIT_FEFFECT_OBJECTIDS 0x00000001 -#define FEELIT_FEFFECT_OBJECTOFFSETS 0x00000002 -#define FEELIT_FEFFECT_CARTESIAN 0x00000010 -#define FEELIT_FEFFECT_POLAR 0x00000020 -#define FEELIT_FEFFECT_SPHERICAL 0x00000040 - -/* Parameter Flags */ -#define FEELIT_FPARAM_DURATION 0x00000001 -#define FEELIT_FPARAM_SAMPLEPERIOD 0x00000002 -#define FEELIT_FPARAM_GAIN 0x00000004 -#define FEELIT_FPARAM_TRIGGERBUTTON 0x00000008 -#define FEELIT_FPARAM_TRIGGERREPEATINTERVAL 0x00000010 -#define FEELIT_FPARAM_AXES 0x00000020 -#define FEELIT_FPARAM_DIRECTION 0x00000040 -#define FEELIT_FPARAM_ENVELOPE 0x00000080 -#define FEELIT_FPARAM_TYPESPECIFICPARAMS 0x00000100 -#define FEELIT_FPARAM_STARTDELAY 0x00000200 -#define FEELIT_FPARAM_ALLPARAMS 0x000003FF -#define FEELIT_FPARAM_START 0x20000000 -#define FEELIT_FPARAM_NORESTART 0x40000000 -#define FEELIT_FPARAM_NODOWNLOAD 0x80000000 - -#define FEELIT_PARAM_NOTRIGGER 0xFFFFFFFF - -/* Start Flags */ -#define FEELIT_FSTART_SOLO 0x00000001 -#define FEELIT_FSTART_NODOWNLOAD 0x80000000 - -/* Status Flags */ -#define FEELIT_FSTATUS_PLAYING 0x00000001 -#define FEELIT_FSTATUS_EMULATED 0x00000002 - -/* Stiffness Mask Flags */ -#define FEELIT_FSTIFF_NONE 0x00000000 -#define FEELIT_FSTIFF_OUTERLEFTWALL 0x00000001 -#define FEELIT_FSTIFF_INNERLEFTWALL 0x00000002 -#define FEELIT_FSTIFF_INNERRIGHTWALL 0x00000004 -#define FEELIT_FSTIFF_OUTERRIGHTWALL 0x00000008 -#define FEELIT_FSTIFF_OUTERTOPWALL 0x00000010 -#define FEELIT_FSTIFF_INNERTOPWALL 0x00000020 -#define FEELIT_FSTIFF_INNERBOTTOMWALL 0x00000040 -#define FEELIT_FSTIFF_OUTERBOTTOMWALL 0x00000080 -#define FEELIT_FSTIFF_OUTERANYWALL ( FEELIT_FSTIFF_OUTERTOPWALL | FEELIT_FSTIFF_OUTERBOTTOMWALL | FEELIT_FSTIFF_OUTERLEFTWALL | FEELIT_FSTIFF_OUTERRIGHTWALL ) -#define FEELIT_FSTIFF_INBOUNDANYWALL FEELIT_FSTIFF_OUTERANYWALL -#define FEELIT_FSTIFF_INNERANYWALL ( FEELIT_FSTIFF_INNERTOPWALL | FEELIT_FSTIFF_INNERBOTTOMWALL | FEELIT_FSTIFF_INNERLEFTWALL | FEELIT_FSTIFF_INNERRIGHTWALL ) -#define FEELIT_FSTIFF_OUTBOUNDANYWALL FEELIT_FSTIFF_INNERANYWALL -#define FEELIT_FSTIFF_ANYWALL ( FEELIT_FSTIFF_OUTERANYWALL | FEELIT_FSTIFF_INNERANYWALL ) - -/* Clipping Mask Flags */ -#define FEELIT_FCLIP_NONE 0x00000000 -#define FEELIT_FCLIP_OUTERLEFTWALL 0x00000001 -#define FEELIT_FCLIP_INNERLEFTWALL 0x00000002 -#define FEELIT_FCLIP_INNERRIGHTWALL 0x00000004 -#define FEELIT_FCLIP_OUTERRIGHTWALL 0x00000008 -#define FEELIT_FCLIP_OUTERTOPWALL 0x00000010 -#define FEELIT_FCLIP_INNERTOPWALL 0x00000020 -#define FEELIT_FCLIP_INNERBOTTOMWALL 0x00000040 -#define FEELIT_FCLIP_OUTERBOTTOMWALL 0x00000080 -#define FEELIT_FCLIP_OUTERANYWALL ( FEELIT_FCLIP_OUTERTOPWALL | FEELIT_FCLIP_OUTERBOTTOMWALL | FEELIT_FCLIP_OUTERLEFTWALL | FEELIT_FCLIP_OUTERRIGHTWALL ) -#define FEELIT_FCLIP_INNERANYWALL ( FEELIT_FCLIP_INNERTOPWALL | FEELIT_FCLIP_INNERBOTTOMWALL | FEELIT_FCLIP_INNERLEFTWALL | FEELIT_FCLIP_INNERRIGHTWALL ) -#define FEELIT_FCLIP_ANYWALL ( FEELIT_FCLIP_OUTERANYWALL | FEELIT_FCLIP_INNERANYWALL ) - -typedef struct FEELIT_EFFESCAPE { - DWORD dwSize; /* sizeof( FEELIT_EFFESCAPE ) */ - DWORD dwCommand; /* Driver-specific command number */ - LPVOID lpvInBuffer; /* Buffer containing data required to perform the operation */ - DWORD cbInBuffer; /* Size, in bytes, of lpvInBuffer */ - LPVOID lpvOutBuffer; /* Buffer in which the operation's output data is returned */ - DWORD cbOutBuffer; /* Size, in bytes, of lpvOutBuffer */ -} FEELIT_EFFESCAPE, *LPFEELIT_EFFESCAPE; - - -#ifndef IS_VXD - -#undef INTERFACE -#define INTERFACE IFeelitEffect - -DECLARE_INTERFACE_(IFeelitEffect, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IFeelitEffect methods ***/ - STDMETHOD(GetEffectGuid)(THIS_ LPGUID) PURE; - STDMETHOD(GetParameters)(THIS_ LPFEELIT_EFFECT,DWORD) PURE; - STDMETHOD(SetParameters)(THIS_ LPCFEELIT_EFFECT,DWORD) PURE; - STDMETHOD(Start)(THIS_ DWORD,DWORD) PURE; - STDMETHOD(Stop)(THIS) PURE; - STDMETHOD(GetEffectStatus)(THIS_ LPDWORD) PURE; - STDMETHOD(Download)(THIS) PURE; - STDMETHOD(Unload)(THIS) PURE; - STDMETHOD(Escape)(THIS_ LPFEELIT_EFFESCAPE) PURE; -}; - -typedef struct IFeelitEffect *LPIFEELIT_EFFECT; - - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IFeelitEffect_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IFeelitEffect_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IFeelitEffect_Release(p) (p)->lpVtbl->Release(p) -#define IFeelitEffect_GetEffectGuid(p,a) (p)->lpVtbl->GetEffectGuid(p,a) -#define IFeelitEffect_GetParameters(p,a,b) (p)->lpVtbl->GetParameters(p,a,b) -#define IFeelitEffect_SetParameters(p,a,b) (p)->lpVtbl->SetParameters(p,a,b) -#define IFeelitEffect_Start(p,a,b) (p)->lpVtbl->Start(p,a,b) -#define IFeelitEffect_Stop(p) (p)->lpVtbl->Stop(p) -#define IFeelitEffect_GetEffectStatus(p,a) (p)->lpVtbl->GetEffectStatus(p,a) -#define IFeelitEffect_Download(p) (p)->lpVtbl->Download(p) -#define IFeelitEffect_Unload(p) (p)->lpVtbl->Unload(p) -#define IFeelitEffect_Escape(p,a) (p)->lpVtbl->Escape(p,a) -#else -#define IFeelitEffect_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IFeelitEffect_AddRef(p) (p)->AddRef() -#define IFeelitEffect_Release(p) (p)->Release() -#define IFeelitEffect_GetEffectGuid(p,a) (p)->GetEffectGuid(a) -#define IFeelitEffect_GetParameters(p,a,b) (p)->GetParameters(a,b) -#define IFeelitEffect_SetParameters(p,a,b) (p)->SetParameters(a,b) -#define IFeelitEffect_Start(p,a,b) (p)->Start(a,b) -#define IFeelitEffect_Stop(p) (p)->Stop() -#define IFeelitEffect_GetEffectStatus(p,a) (p)->GetEffectStatus(a) -#define IFeelitEffect_Download(p) (p)->Download() -#define IFeelitEffect_Unload(p) (p)->Unload() -#define IFeelitEffect_Escape(p,a) (p)->Escape(a) -#endif - - -typedef struct FEELIT_ENCLOSURE { - DWORD dwSize; /* sizeof(FEELIT_ENCLOSURE) */ - RECT rectBoundary; /* Rectangle defining the boundaries of the effect, in screen coords */ - DWORD dwTopAndBottomWallThickness; /* Thickness (pixels) of top/bottom walls. Must be < rectOutside.Height()/2 */ - DWORD dwLeftAndRightWallThickness; /* Thickness (pixels) of left/right walls. Must be < rectOutside.Width()/2 */ - LONG lTopAndBottomWallStiffness; /* Stiffness of horizontal borders */ - LONG lLeftAndRightWallStiffness; /* Stiffness of vertical borders */ - DWORD dwStiffnessMask; /* Borders where stiffness is turned on (FEELIT_FSTIFF*) */ - DWORD dwClippingMask; /* Borders where clipping is turned on (FEELIT_FCLIP*) */ - DWORD dwTopAndBottomWallSaturation; /* Saturation level of spring effect for top/bottom borders */ - DWORD dwLeftAndRightWallSaturation; /* Saturation level of spring effect for left/right borders */ - LPIFEELIT_EFFECT piInsideEffect; /* Interface pointer to effect active in inner area of the enclosure */ -} FEELIT_ENCLOSURE, *LPFEELIT_ENCLOSURE; -typedef const FEELIT_ENCLOSURE *LPCFEELIT_ENCLOSURE; - - -typedef struct FEELIT_ELLIPSE { - DWORD dwSize; /* sizeof(FEELIT_ELLIPSE) */ - RECT rectBoundary; /* Rectangle which circumscribes the ellipse (screen coords) */ - DWORD dwWallThickness; /* Thickness (pixels) of ellipse wall at its thickest point */ - LONG lStiffness; /* Stiffness of ellipse borders */ - DWORD dwStiffnessMask; /* Borders where stiffness is turned on (FEELIT_FSTIFF*) */ - DWORD dwClippingMask; /* Borders where clipping is turned on (FEELIT_FCLIP*) */ - DWORD dwSaturation; /* Saturation level of spring effect for ellipse borders */ - LPIFEELIT_EFFECT piInsideEffect; /* Interface pointer to effect active in inner area of the ellipse */ -} FEELIT_ELLIPSE, *LPFEELIT_ELLIPSE; -typedef const FEELIT_ELLIPSE *LPCFEELIT_ELLIPSE; - -#endif // IS_VXD - -/**************************************************************************** - * - * IFeelitDevice - * - ****************************************************************************/ - -/* Device types */ -#define FEELIT_DEVICETYPE_DEVICE 1 -#define FEELIT_DEVICETYPE_MOUSE 2 -#define FEELIT_DEVICETYPE_HID 0x00010000 - -/* Device subtypes */ -#define FEELIT_DEVICETYPEMOUSE_UNKNOWN 1 -#define FEELIT_DEVICETYPEMOUSE_TRADITIONAL_FF 2 - -/* Device type macros */ -#define GET_FEELIT_DEVICE_TYPE(dwDevType) LOBYTE(dwDevType) -#define GET_FEELIT_DEVICE_SUBTYPE(dwDevType) HIBYTE(dwDevType) - -typedef struct FEELIT_DEVCAPS { - DWORD dwSize; /* sizeof( FEELIT_DEVCAPS ) */ - DWORD dwFlags; /* FEELIT_FDEVCAPS_* */ - DWORD dwDevType; /* FEELIT_DEVICETYPE* */ - DWORD dwAxes; /* No. of axes available on the device */ - DWORD dwButtons; /* No. of buttons available on the device */ - DWORD dwPOVs; /* No. of point-of-view controllers on the device */ - DWORD dwFFSamplePeriod; /* Min. time btwn playback of consec. raw force commands */ - DWORD dwFFMinTimeResolution; /* Min. time, in microseconds, the device can resolve */ - DWORD dwFirmwareRevision; /* Firmware revision number of the device */ - DWORD dwHardwareRevision; /* Hardware revision number of the device */ - DWORD dwFFDriverVersion; /* Version number of the device driver */ -} FEELIT_DEVCAPS, *LPFEELIT_DEVCAPS; -typedef const FEELIT_DEVCAPS *LPCFEELIT_DEVCAPS; - -/* Device capabilities flags */ -#define FEELIT_FDEVCAPS_ATTACHED 0x00000001 -#define FEELIT_FDEVCAPS_POLLEDDEVICE 0x00000002 -#define FEELIT_FDEVCAPS_EMULATED 0x00000004 -#define FEELIT_FDEVCAPS_POLLEDDATAFORMAT 0x00000008 -#define FEELIT_FDEVCAPS_FORCEFEEDBACK 0x00000100 -#define FEELIT_FDEVCAPS_FFATTACK 0x00000200 -#define FEELIT_FDEVCAPS_FFFADE 0x00000400 -#define FEELIT_FDEVCAPS_SATURATION 0x00000800 -#define FEELIT_FDEVCAPS_POSNEGCOEFFICIENTS 0x00001000 -#define FEELIT_FDEVCAPS_POSNEGSATURATION 0x00002000 -#define FEELIT_FDEVCAPS_DEADBAND 0x00004000 - - -/* Data Format Type Flags */ - -#define FEELIT_FOBJDATAFMT_ALL 0x00000000 - -#define FEELIT_FOBJDATAFMT_RELAXIS 0x00000001 -#define FEELIT_FOBJDATAFMT_ABSAXIS 0x00000002 -#define FEELIT_FOBJDATAFMT_AXIS 0x00000003 - -#define FEELIT_FOBJDATAFMT_PSHBUTTON 0x00000004 -#define FEELIT_FOBJDATAFMT_TGLBUTTON 0x00000008 -#define FEELIT_FOBJDATAFMT_BUTTON 0x0000000C - -#define FEELIT_FOBJDATAFMT_POV 0x00000010 - -#define FEELIT_FOBJDATAFMT_COLLECTION 0x00000040 -#define FEELIT_FOBJDATAFMT_NODATA 0x00000080 -#define FEELIT_FOBJDATAFMT_FFACTUATOR 0x01000000 -#define FEELIT_FOBJDATAFMT_FFEFFECTTRIGGER 0x02000000 -#define FEELIT_FOBJDATAFMT_NOCOLLECTION 0x00FFFF00 - -#define FEELIT_FOBJDATAFMT_ANYINSTANCE 0x00FFFF00 -#define FEELIT_FOBJDATAFMT_INSTANCEMASK FEELIT_FOBJDATAFMT_ANYINSTANCE - - -/* Data Format Type Macros */ -#define FEELIT_OBJDATAFMT_MAKEINSTANCE(n) ((WORD)(n) << 8) -#define FEELIT_OBJDATAFMT_GETTYPE(n) LOBYTE(n) -#define FEELIT_OBJDATAFMT_GETINSTANCE(n) LOWORD((n) >> 8) -#define FEELIT_OBJDATAFMT_ENUMCOLLECTION(n) ((WORD)(n) << 8) - -#ifndef IS_VXD - -typedef struct _FEELIT_OBJECTDATAFORMAT { - const GUID *pguid; /* Unique ID for the axis, button, or other input source. */ - DWORD dwOfs; /* Offset in data packet where input source data is stored */ - DWORD dwType; /* Device type describing the object. (FEELIT_FOBJDATAFMT_*) */ - DWORD dwFlags; /* Aspect flags. Zero or more of FEELIT_FDEVOBJINST_ASPECT* */ -} FEELIT_OBJECTDATAFORMAT, *LPFEELIT_OBJECTDATAFORMAT; -typedef const FEELIT_OBJECTDATAFORMAT *LPCFEELIT_OBJECTDATAFORMAT; - -typedef struct _FEELIT_DATAFORMAT { - DWORD dwSize; /* sizeof( FEELIT_DATAFORMAT ) */ - DWORD dwObjSize; /* sizeof( FEELIT_OBJECTDATAFORMAT ) */ - DWORD dwFlags; /* One of FEELIT_FDATAFORMAT_* */ - DWORD dwDataSize; /* Size, in bytes, of data packet returned by the device */ - DWORD dwNumObjs; /* Number of object in the rgodf array */ - LPFEELIT_OBJECTDATAFORMAT rgodf; /* Ptr to array of FEELIT_OBJECTDATAFORMAT */ -} FEELIT_DATAFORMAT, *LPFEELIT_DATAFORMAT; -typedef const FEELIT_DATAFORMAT *LPCFEELIT_DATAFORMAT; - -/* Data Format Flags */ -#define FEELIT_FDATAFORMAT_ABSAXIS 0x00000001 -#define FEELIT_FDATAFORMAT_RELAXIS 0x00000002 - -/* Predefined Data Formats */ -extern const FEELIT_DATAFORMAT c_dfFeelitMouse; - -typedef struct FEELIT_DEVICEOBJECTINSTANCE { - DWORD dwSize; /* sizeof( FEELIT_DEVICEOBJECTINSTANCE ) */ - GUID guidType; /* Optional unique ID indicating object type */ - DWORD dwOfs; /* Offset within data format for data from this object */ - DWORD dwType; /* Device type describing the object. (FEELIT_FOBJDATAFMT_*) */ - DWORD dwFlags; /* Zero or more of FEELIT_FDEVOBJINST_* */ - CHAR tszName[MAX_PATH]; /* Name of object (e.g. "X-Axis") */ - DWORD dwFFMaxForce; /* Mag. of max force created by actuator for this object */ - DWORD dwFFForceResolution; /* Force resolution of the actuator for this object */ - WORD wCollectionNumber; /* RESERVED */ - WORD wDesignatorIndex; /* RESERVED */ - WORD wUsagePage; /* HID usage page associated with the object */ - WORD wUsage; /* HID usage associated with the object */ - DWORD dwDimension; /* Dimensional units in which object's value is reported */ - WORD wExponent; /* Exponent to associate with the demension */ - WORD wReserved; -} FEELIT_DEVICEOBJECTINSTANCE, *LPFEELIT_DEVICEOBJECTINSTANCE; -typedef const FEELIT_DEVICEOBJECTINSTANCE *LPCFEELIT_DEVICEOBJECTINSTANCE; - -typedef BOOL (FAR PASCAL * LPFEELIT_ENUMDEVICEOBJECTSCALLBACK)(LPCFEELIT_DEVICEOBJECTINSTANCE, LPVOID); - -/* Device Object Instance Flags */ -#define FEELIT_FDEVOBJINST_FFACTUATOR 0x00000001 -#define FEELIT_FDEVOBJINST_FFEFFECTTRIGGER 0x00000002 -#define FEELIT_FDEVOBJINST_POLLED 0x00008000 -#define FEELIT_FDEVOBJINST_ASPECTPOSITION 0x00000100 -#define FEELIT_FDEVOBJINST_ASPECTVELOCITY 0x00000200 -#define FEELIT_FDEVOBJINST_ASPECTACCEL 0x00000300 -#define FEELIT_FDEVOBJINST_ASPECTFORCE 0x00000400 -#define FEELIT_FDEVOBJINST_ASPECTMASK 0x00000F00 - -#endif // IS_VXD - -typedef struct FEELIT_PROPHEADER { - DWORD dwSize; /* Size of enclosing struct, to which this struct is header */ - DWORD dwHeaderSize; /* sizeof ( FEELIT_PROPHEADER ) */ - DWORD dwObj; /* Object for which the property is to be accessed */ - DWORD dwHow; /* Specifies how dwObj is interpreted. ( FEELIT_FPROPHEADER_* ) */ -} FEELIT_PROPHEADER, *LPFEELIT_PROPHEADER; -typedef const FEELIT_PROPHEADER *LPCFEELIT_PROPHEADER; - -/* Prop header flags */ -#define FEELIT_FPROPHEADER_DEVICE 0 -#define FEELIT_FPROPHEADER_BYOFFSET 1 -#define FEELIT_FPROPHEADER_BYID 2 - -typedef struct FEELIT_PROPDWORD { - FEELIT_PROPHEADER feelitph; /* Feelit property header struct */ - DWORD dwData; /* Property-specific value being retrieved */ -} FEELIT_PROPDWORD, *LPFEELIT_PROPDWORD; -typedef const FEELIT_PROPDWORD *LPCFEELIT_PROPDWORD; - -typedef struct FEELIT_PROPRANGE { - FEELIT_PROPHEADER feelitph; /* Feelit property header struct */ - LONG lMin; /* Lower limit of range, inclusive */ - LONG lMax; /* Upper limit of range, inclusive */ -} FEELIT_PROPRANGE, *LPFEELIT_PROPRANGE; -typedef const FEELIT_PROPRANGE *LPCFEELIT_PROPRANGE; - -#define FEELIT_PROPRANGE_NOMIN ((LONG)0x80000000) -#define FEELIT_PROPRANGE_NOMAX ((LONG)0x7FFFFFFF) - -#ifdef __cplusplus -#define MAKE_FEELIT_PROP(prop) (*(const GUID *)(prop)) -#else -#define MAKE_FEELIT_PROP(prop) ((REFGUID)(prop)) -#endif - -#define FEELIT_PROP_BUFFERSIZE MAKE_FEELIT_PROP(1) - -#define FEELIT_PROP_AXISMODE MAKE_FEELIT_PROP(2) - -#define FEELIT_PROPAXISMODE_ABS 0 -#define FEELIT_PROPAXISMODE_REL 1 - -#define FEELIT_PROP_GRANULARITY MAKE_FEELIT_PROP(3) - -#define FEELIT_PROP_RANGE MAKE_FEELIT_PROP(4) - -#define FEELIT_PROP_DEADZONE MAKE_FEELIT_PROP(5) - -#define FEELIT_PROP_SATURATION MAKE_FEELIT_PROP(6) - -#define FEELIT_PROP_FFGAIN MAKE_FEELIT_PROP(7) - -#define FEELIT_PROP_FFLOAD MAKE_FEELIT_PROP(8) - -#define FEELIT_PROP_AUTOCENTER MAKE_FEELIT_PROP(9) - -#define FEELIT_PROPAUTOCENTER_OFF 0 -#define FEELIT_PROPAUTOCENTER_ON 1 - -#define FEELIT_PROP_CALIBRATIONMODE MAKE_FEELIT_PROP(10) - -#define FEELIT_PROPCALIBRATIONMODE_COOKED 0 -#define FEELIT_PROPCALIBRATIONMODE_RAW 1 - -// Device configuration/control, for use by control panels - -#define FEELIT_PROP_DEVICEGAIN MAKE_FEELIT_PROP(11) -#define FEELIT_PROP_BALLISTICS MAKE_FEELIT_PROP(12) - -typedef struct FEELIT_PROPBALLISTICS { - FEELIT_PROPHEADER feelitph; /* Feelit property header struct */ - INT Sensitivity; /* Property-specific value */ - INT LowThreshhold; /* Property-specific value */ - INT HighThreshhold; /* Property-specific value */ -} FEELIT_PROPBALLISTICS, *LPFEELIT_PROPBALLISTICS; -typedef const FEELIT_PROPBALLISTICS *LPCFEELIT_PROPBALLISTICS; - -#define FEELIT_PROP_SCREENSIZE MAKE_FEELIT_PROP(13) - -typedef struct FEELIT_PROPSCREENSIZE { - FEELIT_PROPHEADER feelitph; /* Feelit property header struct */ - DWORD dwXScreenSize; /* Max X screen coord value */ - DWORD dwYScreenSize; /* Max Y screen coord value */ -} FEELIT_PROPSCREENSIZE, *LPFEELIT_PROPSCREENSIZE; -typedef const FEELIT_PROPSCREENSIZE *LPCFEELIT_PROPSCREENSIZE; - -#define FEELIT_PROP_ABSOLUTEMODE MAKE_FEELIT_PROP(14) - -typedef struct FEELIT_PROPABSOLUTEMODE { - FEELIT_PROPHEADER feelitph; /* Feelit property header struct */ - BOOL bAbsMode; /* TRUE for Absolute mode FALSE for Relative mode */ -} FEELIT_PROPABSOLUTEMODE, *LPFEELIT_PROPABSOLUTEMODE; -typedef const FEELIT_PROPABSOLUTEMODE *LPCFEELIT_PROPABSOLUTEMODE; - - -#define FEELIT_PROP_DEVICEMODE MAKE_FEELIT_PROP(15) -#define FEELIT_PROPDEVICEMODE_MOUSE 1 -#define FEELIT_PROPDEVICEMODE_JOYSTICK 2 - - -typedef struct FEELIT_DEVICEOBJECTDATA { - DWORD dwOfs; /* Offset into current data format of this data's object */ - DWORD dwData; /* Data obtained from the device */ - DWORD dwTimeStamp; /* Tick count, in milliseconds, at which event was generated */ - DWORD dwSequence; /* Sequence number for this event */ -} FEELIT_DEVICEOBJECTDATA, *LPFEELIT_DEVICEOBJECTDATA; -typedef const FEELIT_DEVICEOBJECTDATA *LPCFEELIT_DEVICEOBJECTDATA; - -#define FEELIT_SEQUENCE_COMPARE(dwSequence1, cmp, dwSequence2) \ - ((int)((dwSequence1) - (dwSequence2)) cmp 0) - -/* GetDeviceData Flags */ -#define FEELIT_FGETDEVDATA_PEEK 0x00000001 - -/* Cooperative Level Flags */ -#define FEELIT_FCOOPLEVEL_FOREGROUND 0x00000004 -#define FEELIT_FCOOPLEVEL_BACKGROUND 0x00000008 - -#ifndef IS_VXD - -typedef struct FEELIT_DEVICEINSTANCE { - DWORD dwSize; /* sizeof ( FEELIT_DEVICEINSTANCE ) */ - GUID guidInstance; /* Unique id for instance of device */ - GUID guidProduct; /* Unique id for the product */ - DWORD dwDevType; /* Device type (FEELIT_DEVICETYPE*) */ - CHAR tszInstanceName[MAX_PATH]; /* Friendly name for the instance (e.g. "Feelit Mouse 1") */ - CHAR tszProductName[MAX_PATH]; /* Friendly name for the product (e.g. "Feelit Mouse") */ - GUID guidFFDriver; /* Unique id for the driver being used for force feedback */ - WORD wUsagePage; /* HID usage page code (if the device driver is a HID device) */ - WORD wUsage; /* HID usage code (if the device driver is a HID device) */ -} FEELIT_DEVICEINSTANCE, *LPFEELIT_DEVICEINSTANCE; -typedef const FEELIT_DEVICEINSTANCE *LPCFEELIT_DEVICEINSTANCE; - -#endif // IS_VXD - -#define FEELIT_FCOMMAND_RESET 0x00000001 -#define FEELIT_FCOMMAND_STOPALL 0x00000002 -#define FEELIT_FCOMMAND_PAUSE 0x00000004 -#define FEELIT_FCOMMAND_CONTINUE 0x00000008 -#define FEELIT_FCOMMAND_SETACTUATORSON 0x00000010 -#define FEELIT_FCOMMAND_SETACTUATORSOFF 0x00000020 - -#define FEELIT_FDEVICESTATE_EMPTY 0x00000001 -#define FEELIT_FDEVICESTATE_STOPPED 0x00000002 -#define FEELIT_FDEVICESTATE_PAUSED 0x00000004 -#define FEELIT_FDEVICESTATE_ACTUATORSON 0x00000010 -#define FEELIT_FDEVICESTATE_ACTUATORSOFF 0x00000020 -#define FEELIT_FDEVICESTATE_POWERON 0x00000040 -#define FEELIT_FDEVICESTATE_POWEROFF 0x00000080 -#define FEELIT_FDEVICESTATE_SAFETYSWITCHON 0x00000100 -#define FEELIT_FDEVICESTATE_SAFETYSWITCHOFF 0x00000200 -#define FEELIT_FDEVICESTATE_USERFFSWITCHON 0x00000400 -#define FEELIT_FDEVICESTATE_USERFFSWITCHOFF 0x00000800 -#define FEELIT_FDEVICESTATE_DEVICELOST 0x80000000 - -#ifndef IS_VXD - -typedef struct FEELIT_EFFECTINFO { - DWORD dwSize; /* sizeof( FEELIT_EFFECTINFO ) */ - GUID guid; /* Unique ID of the effect */ - DWORD dwEffType; /* Zero or more of FEELIT_FEFFECTTYPE_* */ - DWORD dwStaticParams; /* All params supported. Zero or more of FEELIT_FPARAM_* */ - DWORD dwDynamicParams; /* Params modifiable while effect playing. (FEELIT_FPARAM_*) */ - CHAR tszName[MAX_PATH]; /* Name of effect (e.g. "Enclosure" ) */ -} FEELIT_EFFECTINFO, *LPFEELIT_EFFECTINFO; -typedef const FEELIT_EFFECTINFO *LPCFEELIT_EFFECTINFO; - -typedef BOOL (FAR PASCAL * LPFEELIT_ENUMEFFECTSCALLBACK)(LPCFEELIT_EFFECTINFO, LPVOID); -typedef BOOL (FAR PASCAL * LPFEELIT_ENUMCREATEDEFFECTOBJECTSCALLBACK)(LPFEELIT_EFFECT, LPVOID); - -#endif // IS_VXD - - -/* - Feelit Events - -Feelit events are defined using a FEELIT_EVENT struct. They are created by -passing the struct to CreateFeelitEvent, which returns an HFEELITEVENT handle. -Feelit notifies clients that Feelit Event has triggered by sending a message to -the window handle associated with the event. Window handles are associated with -events using the hWndEventHandler param. of the FEELIT_EVENT struct. The window -message that Feelit sends to notify of an event, contains information in the -WPARAM and LPARAM as described below. - -DURING INITIALIZATION: -const UINT g_wmFeelitEvent = RegisterWindowMessage( FEELIT_EVENT_MSG_STRING ); - -IN MESSAGE LOOP: -if ( msgID == g_wmFeelitEvent ) -{ - WORD wRef = LOWORD(wParam); // 16-bit app-defined event id - WORD wfTriggers = HIWORD(wParam); // Trigger Flags - short xForce = (short) LOWORD(lParam); // Force applied along X-axis - short yForce = (short) HIWORD(lParam); // Force applied along Y-axis -} - -*/ - -#define FEELIT_EVENT_MSG_STRING "FEELIT_EVENT_MSG" - -typedef HANDLE HFEELITEVENT, *LPHFEELITEVENT; /* Handle type used to manage Feelit Events */ - -typedef struct FEELIT_EVENT { - DWORD dwSize; /* sizeof(FEELIT_EVENT) */ - HWND hWndEventHandler; /* Handle of window to which event msgs are sent */ - WORD wRef; /* 16-bit app-defined value to identify the event to the app */ - DWORD dwEventTriggerMask; /* Mask specifying events which trigger the callback (FEELIT_FTRIG*) */ - LPIFEELIT_EFFECT piEffect; /* Effect, if any, that this event is associated with */ -} FEELIT_EVENT, *LPFEELIT_EVENT; - -typedef const FEELIT_EVENT *LPCFEELIT_EVENT; - - -/* Event Trigger Flags */ - -#define FEELIT_FTRIG_NONE 0x00000000 -#define FEELIT_FTRIG_ENTER 0x00000001 -#define FEELIT_FTRIG_EXIT 0x00000002 -#define FEELIT_FTRIG_OUTER 0x00000004 -#define FEELIT_FTRIG_INBOUND FEELIT_FTRIG_OUTER -#define FEELIT_FTRIG_INNER 0x00000008 -#define FEELIT_FTRIG_OUTBOUND FEELIT_FTRIG_INNER -#define FEELIT_FTRIG_TOPWALL 0x00000010 -#define FEELIT_FTRIG_BOTTOMWALL 0x00000020 -#define FEELIT_FTRIG_LEFTWALL 0x00000040 -#define FEELIT_FTRIG_RIGHTWALL 0x00000080 -#define FEELIT_FTRIG_ANYWALL ( FEELIT_FTRIG_TOPWALL | FEELIT_FTRIG_BOTTOMWALL | FEELIT_FTRIG_LEFTWALL | FEELIT_FTRIG_RIGHTWALL ) -#define FEELIT_FTRIG_ONENTERANY ( FEELIT_FTRIG_ENTER | FEELIT_FTRIG_ANYWALL ) -#define FEELIT_FTRIG_ONEXITANY ( FEELIT_FTRIG_EXIT | FEELIT_FTRIG_ANYWALL ) -#define FEELIT_FTRIG_ONOUTERANY ( FEELIT_FTRIG_OUTER | FEELIT_FTRIG_ANYWALL ) -#define FEELIT_FTRIG_ONINBOUNDANY FEELIT_FTRIG_ONOUTERANY -#define FEELIT_FTRIG_ONINNERANY ( FEELIT_FTRIG_INNER | FEELIT_FTRIG_ANYWALL ) -#define FEELIT_FTRIG_ONOUTBOUNDANY FEELIT_FTRIG_ONINNERANY -#define FEELIT_FTRIG_ONANYENCLOSURE ( FEELIT_FTRIG_ONENTERANY | FEELIT_FTRIG_ONEXITANY | FEELIT_FTRIG_ONOUTERANY | FEELIT_FTRIG_ONINNERANY ) - -#define FEELIT_FTRIG_ONSCROLL 0x0000100 -#define FEELIT_FTRIG_ONEFFECTCOMPLETION 0x0000200 - -#ifndef IS_VXD - -#undef INTERFACE -#define INTERFACE IFeelitDevice - -DECLARE_INTERFACE_(IFeelitDevice, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IFeelitDevice methods ***/ - STDMETHOD(GetCapabilities)(THIS_ LPFEELIT_DEVCAPS) PURE; - STDMETHOD(EnumObjects)(THIS_ LPFEELIT_ENUMDEVICEOBJECTSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(GetProperty)(THIS_ REFGUID,LPFEELIT_PROPHEADER) PURE; - STDMETHOD(SetProperty)(THIS_ REFGUID,LPCFEELIT_PROPHEADER) PURE; - STDMETHOD(Acquire)(THIS) PURE; - STDMETHOD(Unacquire)(THIS) PURE; - STDMETHOD(GetDeviceState)(THIS_ DWORD,LPVOID) PURE; - STDMETHOD(GetDeviceData)(THIS_ DWORD,LPFEELIT_DEVICEOBJECTDATA,LPDWORD,DWORD) PURE; - STDMETHOD(SetDataFormat)(THIS_ LPCFEELIT_DATAFORMAT) PURE; - STDMETHOD(SetEventNotification)(THIS_ HANDLE) PURE; - STDMETHOD(SetCooperativeLevel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(GetObjectInfo)(THIS_ LPFEELIT_DEVICEOBJECTINSTANCE,DWORD,DWORD) PURE; - STDMETHOD(GetDeviceInfo)(THIS_ LPFEELIT_DEVICEINSTANCE) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(CreateEffect)(THIS_ LPCFEELIT_EFFECT,LPIFEELIT_EFFECT *,LPUNKNOWN) PURE; - STDMETHOD(EnumEffects)(THIS_ LPFEELIT_ENUMEFFECTSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(GetEffectInfo)(THIS_ LPFEELIT_EFFECTINFO,REFGUID) PURE; - STDMETHOD(GetForceFeedbackState)(THIS_ LPDWORD) PURE; - STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD) PURE; - STDMETHOD(EnumCreatedEffectObjects)(THIS_ LPFEELIT_ENUMCREATEDEFFECTOBJECTSCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(Escape)(THIS_ LPFEELIT_EFFESCAPE) PURE; - STDMETHOD(Poll)(THIS) PURE; - STDMETHOD(SendDeviceData)(THIS_ DWORD,LPFEELIT_DEVICEOBJECTDATA,LPDWORD,DWORD) PURE; - STDMETHOD(CreateFeelitEvent)(THIS_ LPCFEELIT_EVENT,LPHFEELITEVENT) PURE; - STDMETHOD(DestroyFeelitEvent)(THIS_ HFEELITEVENT) PURE; - STDMETHOD(EnableFeelitEvent)(THIS_ HFEELITEVENT,BOOL) PURE; - STDMETHOD(SetEventNotificationPeriodicity)(THIS_ DWORD) PURE; -}; - -typedef struct IFeelitDevice *LPIFEELIT_DEVICE; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IFeelitDevice_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IFeelitDevice_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IFeelitDevice_Release(p) (p)->lpVtbl->Release(p) -#define IFeelitDevice_GetCapabilities(p,a) (p)->lpVtbl->GetCapabilities(p,a) -#define IFeelitDevice_EnumObjects(p,a,b,c) (p)->lpVtbl->EnumObjects(p,a,b,c) -#define IFeelitDevice_GetProperty(p,a,b) (p)->lpVtbl->GetProperty(p,a,b) -#define IFeelitDevice_SetProperty(p,a,b) (p)->lpVtbl->SetProperty(p,a,b) -#define IFeelitDevice_Acquire(p) (p)->lpVtbl->Acquire(p) -#define IFeelitDevice_Unacquire(p) (p)->lpVtbl->Unacquire(p) -#define IFeelitDevice_GetDeviceState(p,a,b) (p)->lpVtbl->GetDeviceState(p,a,b) -#define IFeelitDevice_GetDeviceData(p,a,b,c,d) (p)->lpVtbl->GetDeviceData(p,a,b,c,d) -#define IFeelitDevice_SetDataFormat(p,a) (p)->lpVtbl->SetDataFormat(p,a) -#define IFeelitDevice_SetEventNotification(p,a) (p)->lpVtbl->SetEventNotification(p,a) -#define IFeelitDevice_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b) -#define IFeelitDevice_GetObjectInfo(p,a,b,c) (p)->lpVtbl->GetObjectInfo(p,a,b,c) -#define IFeelitDevice_GetDeviceInfo(p,a) (p)->lpVtbl->GetDeviceInfo(p,a) -#define IFeelitDevice_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IFeelitDevice_CreateEffect(p,a,b,c,d) (p)->lpVtbl->CreateEffect(p,a,b,c,d) -#define IFeelitDevice_EnumEffects(p,a,b,c) (p)->lpVtbl->EnumEffects(p,a,b,c) -#define IFeelitDevice_GetEffectInfo(p,a,b) (p)->lpVtbl->GetEffectInfo(p,a,b) -#define IFeelitDevice_GetForceFeedbackState(p,a) (p)->lpVtbl->GetForceFeedbackState(p,a) -#define IFeelitDevice_SendForceFeedbackCommand(p,a) (p)->lpVtbl->SendForceFeedbackCommand(p,a) -#define IFeelitDevice_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c) -#define IFeelitDevice_Escape(p,a) (p)->lpVtbl->Escape(p,a) -#define IFeelitDevice_Poll(p) (p)->lpVtbl->Poll(p) -#define IFeelitDevice_SendDeviceData(p,a,b,c,d) (p)->lpVtbl->SendDeviceData(p,a,b,c,d) -#define IFeelitDevice_CreateFeelitEvent(p,a,b) (p)->lpVtbl->CreateFeelitEvent(p,a,b) -#define IFeelitDevice_DestroyFeelitEvent(p,a) (p)->lpVtbl->DestroyFeelitEvent(p,a) -#define IFeelitDevice_EnableFeelitEvent(p,a,b) (p)->lpVtbl->EnableFeelitEvent(p,a,b) -#define IFeelitDevice_SetEventNotificationPeriodicity(p,a) (p)->lpVtbl->SetEventNotificationPeriodicity(p,a) -#else -#define IFeelitDevice_QueryInterface(p,a,b) (p)->QueryInterface(a,b) -#define IFeelitDevice_AddRef(p) (p)->AddRef() -#define IFeelitDevice_Release(p) (p)->Release() -#define IFeelitDevice_GetCapabilities(p,a) (p)->GetCapabilities(a) -#define IFeelitDevice_EnumObjects(p,a,b,c) (p)->EnumObjects(a,b,c) -#define IFeelitDevice_GetProperty(p,a,b) (p)->GetProperty(a,b) -#define IFeelitDevice_SetProperty(p,a,b) (p)->SetProperty(a,b) -#define IFeelitDevice_Acquire(p) (p)->Acquire() -#define IFeelitDevice_Unacquire(p) (p)->Unacquire() -#define IFeelitDevice_GetDeviceState(p,a,b) (p)->GetDeviceState(a,b) -#define IFeelitDevice_GetDeviceData(p,a,b,c,d) (p)->GetDeviceData(a,b,c,d) -#define IFeelitDevice_SetDataFormat(p,a) (p)->SetDataFormat(a) -#define IFeelitDevice_SetEventNotification(p,a) (p)->SetEventNotification(a) -#define IFeelitDevice_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b) -#define IFeelitDevice_GetObjectInfo(p,a,b,c) (p)->GetObjectInfo(a,b,c) -#define IFeelitDevice_GetDeviceInfo(p,a) (p)->GetDeviceInfo(a) -#define IFeelitDevice_RunControlPanel(p,a,b) (p)->RunControlPanel(a,b) -#define IFeelitDevice_CreateEffect(p,a,b,c,d) (p)->CreateEffect(a,b,c,d) -#define IFeelitDevice_EnumEffects(p,a,b,c) (p)->EnumEffects(a,b,c) -#define IFeelitDevice_GetEffectInfo(p,a,b) (p)->GetEffectInfo(a,b) -#define IFeelitDevice_GetForceFeedbackState(p,a) (p)->GetForceFeedbackState(a) -#define IFeelitDevice_SendForceFeedbackCommand(p,a) (p)->SendForceFeedbackCommand(a) -#define IFeelitDevice_EnumCreatedEffectObjects(p,a,b,c) (p)->EnumCreatedEffectObjects(a,b,c) -#define IFeelitDevice_Escape(p,a) (p)->Escape(a) -#define IFeelitDevice_Poll(p) (p)->Poll() -#define IFeelitDevice_SendDeviceData(p,a,b,c,d) (p)->SendDeviceData(a,b,c,d) -#define IFeelitDevice_CreateFeelitEvent(p,a,b) (p)->CreateFeelitEvent(a,b) -#define IFeelitDevice_DestroyFeelitEvent(p,a) (p)->DestroyFeelitEvent(a) -#define IFeelitDevice_EnableFeelitEvent(p,a,b) (p)->EnableFeelitEvent(a,b) -#define IFeelitDevice_SetEventNotificationPeriodicity(p,a) (p)->SetEventNotificationPeriodicity(a) -#endif - -#endif // IS_VXD - -/**************************************************************************** - * - * Mouse State - * - ****************************************************************************/ - -typedef struct _FEELIT_MOUSESTATE { - LONG lXpos; - LONG lYpos; - LONG lZpos; - LONG lXforce; - LONG lYforce; - LONG lZforce; - BYTE rgbButtons[4]; -} FEELIT_MOUSESTATE, *LPFEELIT_MOUSESTATE; - -#define FEELIT_MOUSEOFFSET_XAXIS FIELD_OFFSET(FEELIT_MOUSESTATE, lXpos) -#define FEELIT_MOUSEOFFSET_YAXIS FIELD_OFFSET(FEELIT_MOUSESTATE, lYpos) -#define FEELIT_MOUSEOFFSET_ZAXIS FIELD_OFFSET(FEELIT_MOUSESTATE, lZpos) -#define FEELIT_MOUSEOFFSET_XFORCE FIELD_OFFSET(FEELIT_MOUSESTATE, lXforce) -#define FEELIT_MOUSEOFFSET_YFORCE FIELD_OFFSET(FEELIT_MOUSESTATE, lYforce) -#define FEELIT_MOUSEOFFSET_ZFORCE FIELD_OFFSET(FEELIT_MOUSESTATE, lZforce) -#define FEELIT_MOUSEOFFSET_BUTTON0 (FIELD_OFFSET(FEELIT_MOUSESTATE, rgbButtons) + 0) -#define FEELIT_MOUSEOFFSET_BUTTON1 (FIELD_OFFSET(FEELIT_MOUSESTATE, rgbButtons) + 1) -#define FEELIT_MOUSEOFFSET_BUTTON2 (FIELD_OFFSET(FEELIT_MOUSESTATE, rgbButtons) + 2) -#define FEELIT_MOUSEOFFSET_BUTTON3 (FIELD_OFFSET(FEELIT_MOUSESTATE, rgbButtons) + 3) - - -/**************************************************************************** - * - * IFeelit - * - ****************************************************************************/ - -#define FEELIT_ENUM_STOP 0 -#define FEELIT_ENUM_CONTINUE 1 - -#ifndef IS_VXD -typedef BOOL (FAR PASCAL * LPFEELIT_ENUMDEVICESCALLBACK)(LPCFEELIT_DEVICEINSTANCE, LPVOID); -#endif // IS_VXD - -#define FEELIT_FENUMDEV_ALLDEVICES 0x00000000 -#define FEELIT_FENUMDEV_ATTACHEDONLY 0x00000001 -#define FEELIT_FENUMDEV_FORCEFEEDBACK 0x00000100 - -#ifndef IS_VXD - -#undef INTERFACE -#define INTERFACE IFeelit - -DECLARE_INTERFACE_(IFeelit, IUnknown) -{ - /*** IUnknown methods ***/ - STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE; - STDMETHOD_(ULONG,AddRef)(THIS) PURE; - STDMETHOD_(ULONG,Release)(THIS) PURE; - - /*** IFeelit methods ***/ - STDMETHOD(CreateDevice)(THIS_ REFGUID,LPIFEELIT_DEVICE *,LPUNKNOWN) PURE; - STDMETHOD(EnumDevices)(THIS_ DWORD,LPFEELIT_ENUMDEVICESCALLBACK,LPVOID,DWORD) PURE; - STDMETHOD(GetDeviceStatus)(THIS_ REFGUID) PURE; - STDMETHOD(RunControlPanel)(THIS_ HWND,DWORD) PURE; - STDMETHOD(Initialize)(THIS_ HINSTANCE,DWORD) PURE; -}; - -typedef struct IFeelit *LPIFEELIT; - -#if !defined(__cplusplus) || defined(CINTERFACE) -#define IFeelit_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b) -#define IFeelit_AddRef(p) (p)->lpVtbl->AddRef(p) -#define IFeelit_Release(p) (p)->lpVtbl->Release(p) -#define IFeelit_CreateDevice(p,a,b,c) (p)->lpVtbl->CreateDevice(p,a,b,c) -#define IFeelit_EnumDevices(p,a,b,c,d) (p)->lpVtbl->EnumDevices(p,a,b,c,d) -#define IFeelit_GetDeviceStatus(p,a) (p)->lpVtbl->GetDeviceStatus(p,a) -#define IFeelit_RunControlPanel(p,a,b) (p)->lpVtbl->RunControlPanel(p,a,b) -#define IFeelit_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b) -#define IFeelit_FindDevice(p,a,b,c) (p)->lpVtbl->FindDevice(p,a,b,c) -#endif - -extern HRESULT WINAPI FeelitCreateA(HINSTANCE hinst, DWORD dwVersion, LPIFEELIT *ppFeelit, LPUNKNOWN punkOuter); -#define FeelitCreate FeelitCreateA - -#endif // IS_VXD - - -/**************************************************************************** - * - * Return Codes - * - ****************************************************************************/ - -/* - * The operation completed successfully. - */ -#define FEELIT_RESULT_OK S_OK - -/* - * The device exists but is not currently attached. - */ -#define FEELIT_RESULT_NOTATTACHED S_FALSE - -/* - * The device buffer overflowed. Some input was lost. - */ -#define FEELIT_RESULT_BUFFEROVERFLOW S_FALSE - -/* - * The change in device properties had no effect. - */ -#define FEELIT_RESULT_PROPNOEFFECT S_FALSE - -/* - * The operation had no effect. - */ -#define FEELIT_RESULT_NOEFFECT S_FALSE - -/* - * The device is a polled device. As a result, device buffering - * will not collect any data and event notifications will not be - * signalled until GetDeviceState is called. - */ -#define FEELIT_RESULT_POLLEDDEVICE ((HRESULT)0x00000002L) - -/* - * The parameters of the effect were successfully updated by - * IFeelitEffect::SetParameters, but the effect was not - * downloaded because the device is not exclusively acquired - * or because the FEELIT_FPARAM_NODOWNLOAD flag was passed. - */ -#define FEELIT_RESULT_DOWNLOADSKIPPED ((HRESULT)0x00000003L) - -/* - * The parameters of the effect were successfully updated by - * IFeelitEffect::SetParameters, but in order to change - * the parameters, the effect needed to be restarted. - */ -#define FEELIT_RESULT_EFFECTRESTARTED ((HRESULT)0x00000004L) - -/* - * The parameters of the effect were successfully updated by - * IFeelitEffect::SetParameters, but some of them were - * beyond the capabilities of the device and were truncated. - */ -#define FEELIT_RESULT_TRUNCATED ((HRESULT)0x00000008L) - -/* - * Equal to FEELIT_RESULT_EFFECTRESTARTED | FEELIT_RESULT_TRUNCATED. - */ -#define FEELIT_RESULT_TRUNCATEDANDRESTARTED ((HRESULT)0x0000000CL) - -/* - * The application requires a newer version of Feelit. - */ -#define FEELIT_ERROR_OLDFEELITVERSION \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_OLD_WIN_VERSION) - -/* - * The application was written for an unsupported prerelease version - * of Feelit. - */ -#define FEELIT_ERROR_BETAFEELITVERSION \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_RMODE_APP) - -/* - * The object could not be created due to an incompatible driver version - * or mismatched or incomplete driver components. - */ -#define FEELIT_ERROR_BADDRIVERVER \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BAD_DRIVER_LEVEL) - -/* - * The device or device instance or effect is not registered with Feelit. - */ -#define FEELIT_ERROR_DEVICENOTREG REGDB_E_CLASSNOTREG - -/* - * The requested object does not exist. - */ -#define FEELIT_ERROR_NOTFOUND \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) - -/* - * The requested object does not exist. - */ -#define FEELIT_ERROR_OBJECTNOTFOUND \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_FILE_NOT_FOUND) - -/* - * An invalid parameter was passed to the returning function, - * or the object was not in a state that admitted the function - * to be called. - */ -#define FEELIT_ERROR_INVALIDPARAM E_INVALIDARG - -/* - * The specified interface is not supported by the object - */ -#define FEELIT_ERROR_NOINTERFACE E_NOINTERFACE - -/* - * An undetermined error occured inside the Feelit subsystem - */ -#define FEELIT_ERROR_GENERIC E_FAIL - -/* - * The Feelit subsystem couldn't allocate sufficient memory to complete the - * caller's request. - */ -#define FEELIT_ERROR_OUTOFMEMORY E_OUTOFMEMORY - -/* - * The function called is not supported at this time - */ -#define FEELIT_ERROR_UNSUPPORTED E_NOTIMPL - -/* - * This object has not been initialized - */ -#define FEELIT_ERROR_NOTINITIALIZED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_NOT_READY) - -/* - * This object is already initialized - */ -#define FEELIT_ERROR_ALREADYINITIALIZED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_ALREADY_INITIALIZED) - -/* - * This object does not support aggregation - */ -#define FEELIT_ERROR_NOAGGREGATION CLASS_E_NOAGGREGATION - -/* - * Another app has a higher priority level, preventing this call from - * succeeding. - */ -#define FEELIT_ERROR_OTHERAPPHASPRIO E_ACCESSDENIED - -/* - * Access to the device has been lost. It must be re-acquired. - */ -#define FEELIT_ERROR_INPUTLOST \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_READ_FAULT) - -/* - * The operation cannot be performed while the device is acquired. - */ -#define FEELIT_ERROR_ACQUIRED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_BUSY) - -/* - * The operation cannot be performed unless the device is acquired. - */ -#define FEELIT_ERROR_NOTACQUIRED \ - MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIN32, ERROR_INVALID_ACCESS) - -/* - * The specified property cannot be changed. - */ -#define FEELIT_ERROR_READONLY E_ACCESSDENIED - -/* - * The device already has an event notification associated with it. - */ -#define FEELIT_ERROR_HANDLEEXISTS E_ACCESSDENIED - -/* - * Data is not yet available. - */ -#ifndef E_PENDING -#define E_PENDING 0x80070007L -#endif - -/* - * Unable to perform the requested operation because the user - * does not have sufficient privileges. - */ -#define FEELIT_ERROR_INSUFFICIENTPRIVS 0x80040200L - -/* - * The device is full. - */ -#define FEELIT_ERROR_DEVICEFULL 0x80040201L - -/* - * Not all the requested information fit into the buffer. - */ -#define FEELIT_ERROR_MOREDATA 0x80040202L - -/* - * The effect is not downloaded. - */ -#define FEELIT_ERROR_NOTDOWNLOADED 0x80040203L - -/* - * The device cannot be reinitialized because there are still effects - * attached to it. - */ -#define FEELIT_ERROR_HASEFFECTS 0x80040204L - -/* - * The operation cannot be performed unless the device is acquired - * in FEELIT_FCOOPLEVEL_EXCLUSIVE mode. - */ -#define FEELIT_ERROR_NOTEXCLUSIVEACQUIRED 0x80040205L - -/* - * The effect could not be downloaded because essential information - * is missing. For example, no axes have been associated with the - * effect, or no type-specific information has been created. - */ -#define FEELIT_ERROR_INCOMPLETEEFFECT 0x80040206L - -/* - * Attempted to read buffered device data from a device that is - * not buffered. - */ -#define FEELIT_ERROR_NOTBUFFERED 0x80040207L - -/* - * An attempt was made to modify parameters of an effect while it is - * playing. Not all hardware devices support altering the parameters - * of an effect while it is playing. - */ -#define FEELIT_ERROR_EFFECTPLAYING 0x80040208L - -/* - * An internal error occurred (inside the API or the driver) - */ -#define FEELIT_ERROR_INTERNAL 0x80040209L - -/* - * Effect set referenced by a command is not the active set - */ -#define FEELIT_ERROR_INACTIVE 0x8004020AL - -#ifdef __cplusplus -}; -#endif - - -#endif /* __FEELITAPI_INCLUDED__ */ - diff --git a/code/win32/FeelIt/fffx.cpp b/code/win32/FeelIt/fffx.cpp deleted file mode 100644 index 74e8571..0000000 --- a/code/win32/FeelIt/fffx.cpp +++ /dev/null @@ -1,680 +0,0 @@ -// Filename:- fffx.cpp (Force-Feedback FX) -// -// (Function names with "_FF_" beginnings are my internal stuff only, "FF_" beginnings are for external stuff) -// -#define INITGUID // this will need removing if already defined in someone else's module. Only one must exist in whole game - -#include "../../client/client.h" -#include "../win_local.h" -#include "ffc.h" -#include "fffx_feel.h" - -// these now MUST default to NULL... -// -CFeelDevice *g_pFeelDevice=NULL; -CFeelProject *g_pFeelProject=NULL; -CFeelSpring *g_pFeelSpring=NULL; - - -ffFX_e ffFXLoaded[MAX_CONCURRENT_FFFXs]; - -//extern HINSTANCE global_hInstance; -//extern HWND cl_hwnd; -extern WinVars_t g_wv; - - -extern cvar_t *in_joystick; -cvar_t *use_ff; -cvar_t *ff_defaultTension; - - -void _FF_ClearUsageArray(void); -void _FF_ClearFXSlot(int i); -void _FF_ClearCreatePlayFXSlot(int iSlotNum, ffFX_e fffx); -void _FF_CreatePlayFXSlot(int iSlotNum, ffFX_e fffx); -void _FF_PlayFXSlot(int iSlotNum); - - - -// externally accessed -qboolean FF_IsAvailable(void) -{ - return g_pFeelDevice?TRUE:FALSE; -} - -qboolean FF_IsMouse(void) -{ - if (g_pFeelDevice && (g_pFeelDevice->GetDeviceType() == FEEL_DEVICETYPE_MOUSE)) - return TRUE; - - return FALSE; -} - - -// 4 semi-useful CMD functions... -void CMD_FF_UseMouse(void) -{ - FF_Init(TRUE); -} - -void CMD_FF_UseJoy(void) -{ - FF_Init(FALSE); -} - -// arg = 0..3 -// -void CMD_FF_Tension(void) -{ - if (Cmd_Argc() != 2) - { - Com_Printf ("ff_tension (default = 1)\n"); - return; - } - - int iTension = atoi(Cmd_Argv(1)); - if (iTension<0 || iTension>3) - { - Com_Printf ("ff_tension \n"); - return; - } - - if (g_pFeelSpring) - { - Com_Printf(va("Setting tension %d\n",iTension)); - Cvar_Set(ff_defaultTension->name,va("%d",iTension)); - FF_SetTension(iTension); - } - else - { - Com_Printf("No spring device\n"); - } -} - - -typedef struct -{ - char* psName; - ffFX_e eFXNum; -}FFFX_LOOKUP; - -#define FFFX_ENTRY(blah) {#blah,(ffFX_e)fffx_ ## blah} -FFFX_LOOKUP FFFX_Lookup[fffx_NUMBEROF]= -{ - FFFX_ENTRY( RandomNoise ), - FFFX_ENTRY( AircraftCarrierTakeOff ), // this one is pointless / dumb - FFFX_ENTRY( BasketballDribble ), - FFFX_ENTRY( CarEngineIdle ), - FFFX_ENTRY( ChainsawIdle ), - FFFX_ENTRY( ChainsawInAction ), - FFFX_ENTRY( DieselEngineIdle ), - FFFX_ENTRY( Jump ), - FFFX_ENTRY( Land ), - FFFX_ENTRY( MachineGun ), - FFFX_ENTRY( Punched ), - FFFX_ENTRY( RocketLaunch ), - FFFX_ENTRY( SecretDoor ), - FFFX_ENTRY( SwitchClick ), - FFFX_ENTRY( WindGust ), - FFFX_ENTRY( WindShear ), // also pretty crap - FFFX_ENTRY( Pistol ), - FFFX_ENTRY( Shotgun ), - FFFX_ENTRY( Laser1 ), - FFFX_ENTRY( Laser2 ), - FFFX_ENTRY( Laser3 ), - FFFX_ENTRY( Laser4 ), - FFFX_ENTRY( Laser5 ), - FFFX_ENTRY( Laser6 ), - FFFX_ENTRY( OutOfAmmo ), - FFFX_ENTRY( LightningGun ), - FFFX_ENTRY( Missile ), - FFFX_ENTRY( GatlingGun ), - FFFX_ENTRY( ShortPlasma ), - FFFX_ENTRY( PlasmaCannon1 ), - FFFX_ENTRY( PlasmaCannon2 ), - FFFX_ENTRY( Cannon ) -}; - -void CMD_FF_Play(void) -{ - if (Cmd_Argc() != 2 && Cmd_Argc() != 3) - { - Com_Printf ("ff_play (where n = 0..%d) || ff_play name \"fxname\"\n",fffx_NUMBEROF-1); - return; - } - - ffFX_e eFX = fffx_NULL; - - if (!Q_stricmp(Cmd_Argv(1),"name")) - { - if (Cmd_Argc() != 3) - { - Com_Printf ("ff_play (where n = 0..%d) || ff_play name \"fxname\"\n",0,fffx_NUMBEROF-1); - return; - } - - for (int i=0; i=0 && eFX\n"); - return; - } - - long lSpring = atoi(Cmd_Argv(1)); - if (lSpring<0 || lSpring>10000) - { - Com_Printf ("ff_spring <0..10000>\n"); - return; - } - - if (g_pFeelSpring) - { - Com_Printf(va("Setting spring to %d\n",lSpring)); - FF_SetSpring(lSpring); - } - else - { - Com_Printf("No spring device\n"); - } -} - - -// Called once only during .exe lifetime... -// -void FF_Init(qboolean bTryMouseFirst) -{ - FF_Shutdown(); - - Cmd_AddCommand ("ff_usemouse", CMD_FF_UseMouse); - Cmd_AddCommand ("ff_usejoy", CMD_FF_UseJoy); - Cmd_AddCommand ("ff_tension", CMD_FF_Tension); - Cmd_AddCommand ("ff_spring", CMD_FF_Spring); - Cmd_AddCommand ("ff_play", CMD_FF_Play); - - // ==================================== - - Com_Printf("\n" S_COLOR_CYAN "------- Force Feedback Initialization -------\n"); - - // for the moment default to OFF until usage tables are in... - use_ff = Cvar_Get ("use_ff", "0", CVAR_ARCHIVE); - ff_defaultTension = Cvar_Get ("ff_defaultTension", "1", CVAR_ARCHIVE); - - // don't bother initializing if user specifically turned off force feedback... - // - if (!use_ff->value) - { - Com_Printf("...inhibited, not initializing\n\n"); - return; - } - - Com_Printf("Creating feedback device:\n"); - - if ( bTryMouseFirst ) - { - CFeelMouse* m_pFeelMouse = new CFeelMouse; - if (m_pFeelMouse) - { - if (m_pFeelMouse->Initialize( g_wv.hInstance, g_wv.hWnd)) - { - g_pFeelDevice = m_pFeelMouse; - } - else - { - delete m_pFeelMouse; - m_pFeelMouse = NULL; - } - } - } - - if (!g_pFeelDevice) - { - // try a general DI FF device... - // - CFeelDXDevice* m_pFeelDXDevice = new CFeelDXDevice; - if (m_pFeelDXDevice) - { - if (m_pFeelDXDevice->Initialize( g_wv.hInstance, g_wv.hWnd)) - { - g_pFeelDevice = m_pFeelDXDevice; - } - else - { - delete m_pFeelDXDevice; - m_pFeelDXDevice = NULL; - } - } - } - - -// g_pFeelDevice = CFeelDevice::CreateDevice(g_wv.hInstance, g_wv.hWnd); - if (!g_pFeelDevice) - { - Com_Printf("...no feedback devices found\n"); - return; - } - else - { - _FeelInitEffects(); - - for (int _i=0; _iGetDeviceType() == FEEL_DEVICETYPE_MOUSE) - { - Com_Printf("...found FEELit Mouse\n"); - g_pFeelDevice->UsesWin32MouseServices(FALSE); - } - else if (g_pFeelDevice->GetDeviceType() == FEEL_DEVICETYPE_DIRECTINPUT) - { - Com_Printf("...found feedback device\n"); - g_pFeelSpring = new CFeelSpring; - if (!g_pFeelSpring->Initialize( g_pFeelDevice, - 2000, //10000, // LONG lStiffness = FEEL_SPRING_DEFAULT_STIFFNESS - 10000, //5000, // DWORD dwSaturation = FEEL_SPRING_DEFAULT_SATURATION - 1000, //0, // DWORD dwDeadband = FEEL_SPRING_DEFAULT_DEADBAND // must be 0..n..10000 - FEEL_EFFECT_AXIS_BOTH, // DWORD dwfAxis = FEEL_EFFECT_AXIS_BOTH - FEEL_SPRING_DEFAULT_CENTER_POINT, // POINT pntCenter = FEEL_SPRING_DEFAULT_CENTER_POINT - FEEL_EFFECT_DEFAULT_DIRECTION_X, // LONG lDirectionX = FEEL_EFFECT_DEFAULT_DIRECTION_X - FEEL_EFFECT_DEFAULT_DIRECTION_Y, // LONG lDirectionY = FEEL_EFFECT_DEFAULT_DIRECTION_Y - TRUE // TRUE = rel coords, else screen coords // BOOL bUseDeviceCoordinates = FALSE - ) - ) - { - Com_Printf("...(no device return spring)\n"); - delete g_pFeelSpring; - g_pFeelSpring = NULL; - } - else - { - Com_Printf("...device return spring ok\n"); - FF_SetTension(ff_defaultTension->integer); // 0..3 - } - }// if (g_pFeelDevice->GetDeviceType() == FEEL_DEVICETYPE_DIRECTINPUT) - } -} - - -// call this at app shutdown... (or when switching controllers) -// -// (also called by FF_Init in case you're switching controllers so do everything -// as if-protected) -// -void FF_Shutdown(void) -{ - // note the check first before print, since this is called from the init code - // as well, and it'd be weird to see the sutdown string first... - // - if (g_pFeelSpring || g_pFeelDevice) - { - Com_Printf("\n" S_COLOR_CYAN "------- Force Feedback Shutdown -------\n"); - } - - if (g_pFeelSpring) - { - Com_Printf("...closing return spring\n"); - delete g_pFeelSpring; - g_pFeelSpring = NULL; - } - - if (g_pFeelDevice) - { - Com_Printf("...closing feedback device\n"); - _FF_ClearUsageArray(); - delete g_pFeelDevice; - g_pFeelDevice = NULL; - } - - Cmd_RemoveCommand ("ff_usemouse"); - Cmd_RemoveCommand ("ff_usejoy"); - Cmd_RemoveCommand ("ff_tension"); - Cmd_RemoveCommand ("ff_spring"); - Cmd_RemoveCommand ("ff_play"); -} - - - - - - - - - -void FF_EnsurePlaying(ffFX_e fffx) -{ - if (fffx<0 || fffx>=fffx_NUMBEROF) - return; - - // if user has specifically turned off force feedback at command line, - // or is not using the joystick as current input method (though this can be ignored because stick has a hands-on sensor), - // then forget it... - // - if (!use_ff->value) - return; - - - if (FF_IsAvailable()) - { - // Have we already got this FF FX loaded? - // - for (int i=0; i=fffx_NUMBEROF) - return; - - // if user has specifically turned off force feedback at command line, - // or is not using the joystick as current input method (though this can be ignored because stick has a hands-on sensor), - // then forget it... - // - if (!use_ff->value) - return; - - if (FF_IsAvailable()) - { - // first, search for an instance of this FF FX that's already loaded, if found, start it off again... - // - for (i=0; iinteger); - } -} - - - - - -void _FF_ClearUsageArray(void) -{ - int i; - - for (i=0; i=fffx_NUMBEROF) - return; - - if (FF_IsAvailable()) - { - for (int i=0; iStart()) - { - return FALSE; - } - bFXPlaying = TRUE; - - static POINT p={0,0}; - g_pFeelSpring->ChangeParameters(p, lSpring); - } - else - { - if (bFXPlaying && !g_pFeelSpring->Stop()) - { - return FALSE; - } - bFXPlaying = FALSE; - } - - return TRUE; - } - } - - return FALSE; -} - -// tension is 0 (none) to 3 (max)... -// -qboolean FF_SetTension(int iTension) -{ - static long lSpringValues[4] = {0, 1000, 5000, 10000}; - - if (iTension>3) - iTension=3; - if (iTension<0) - iTension=0; - - return FF_SetSpring(lSpringValues[iTension]); -} - -///////////////////////// eof ////////////////////////////// - diff --git a/code/win32/FeelIt/fffx_feel.cpp b/code/win32/FeelIt/fffx_feel.cpp deleted file mode 100644 index bb34457..0000000 --- a/code/win32/FeelIt/fffx_feel.cpp +++ /dev/null @@ -1,689 +0,0 @@ -// Filename:- fffx_Feel.cpp (Force-Feedback FX) - -#include "../../client/client.h" -//#include "stdafx.h" -//#include "resource.h" -#include "fffx_feel.h" - -extern cvar_t* js_ffmult; - - -#define MAX_EFFECTS_IN_COMPOUND 3 // This needs to be at least 3 for now. I can add array bounds checking later - -CFeelEffect* g_pEffects[MAX_CONCURRENT_FFFXs][MAX_EFFECTS_IN_COMPOUND]; - -void _FeelInitEffects() -{ - for (int i = 0; i < MAX_CONCURRENT_FFFXs; i++) - { - for (int j = 0; j < MAX_EFFECTS_IN_COMPOUND; j++) - { - g_pEffects[i][j] = NULL; - } - } -} - -BOOL _FeelCreateEffect(int iSlotNum, ffFX_e fffx, CFeelDevice* pFeelDevice) -{ - BOOL success = TRUE; - FEELIT_ENVELOPE envelope; - envelope.dwSize = sizeof(FEELIT_ENVELOPE); - - switch (fffx) - { - case fffx_RandomNoise: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 7500 * js_ffmult->value, // magnitude - 95, // period - 10000, // duration - 0, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_SawtoothDown); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 8300 * js_ffmult->value, // magnitude - 160, // period - 10000, // duration - 9000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - g_pEffects[iSlotNum][2] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][2]))->InitializePolar(pFeelDevice, - 8300 * js_ffmult->value, // magnitude - 34, // period - 10000, // duration - 31000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - - success = FALSE; - break; - case fffx_AircraftCarrierTakeOff: - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 600000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 750000; - - g_pEffects[iSlotNum][0] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 0, // angle - 2500, // duration - 10000 * js_ffmult->value, // magnitude - &envelope))// envelope - - success = FALSE; - break; - case fffx_BasketballDribble: - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 40000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 30000; - - g_pEffects[iSlotNum][0] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 18000, // angle - 150, // duration - 5000 * js_ffmult->value, // magnitude - &envelope))// envelope - - success = FALSE; - break; - case fffx_CarEngineIdle: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 2500 * js_ffmult->value, // magnitude - 50, // period - 10000, // duration - 0, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_ChainsawIdle: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 3600 * js_ffmult->value, // magnitude - 60, // period - 1000, // duration - 9000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 4000 * js_ffmult->value, // magnitude - 100, // period - 1000, // duration - 18000, // angle - 4000, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_ChainsawInAction: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 6700 * js_ffmult->value, // magnitude - 60, // period - 1000, // duration - 9000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 5000 * js_ffmult->value, // magnitude - 100, // period - 1000, // duration - 18000, // angle - 5000, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - g_pEffects[iSlotNum][2] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][2]))->InitializePolar(pFeelDevice, - 10000 * js_ffmult->value, // magnitude - 340, // period - 1000, // duration - 18000, // angle - 4000, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_DieselEngineIdle: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_SawtoothDown); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 2000 * js_ffmult->value, // magnitude - 250, // period - 10000, // duration - 18000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 4000 * js_ffmult->value, // magnitude - 125, // period - 10000, // duration - 18000, // angle - 1500, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Jump: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 5000 * js_ffmult->value, // magnitude - 500, // period - 300, // duration - 18000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Land: - envelope.dwAttackLevel = 6000; - envelope.dwAttackTime = 200000; - envelope.dwFadeLevel = 3000; - envelope.dwFadeTime = 50000; - - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 1000 * js_ffmult->value, // magnitude - 750, // period - 250, // duration - 0, // angle - 0, // offset - 0, // phase - &envelope)) // envelope - success = FALSE; - break; - case fffx_MachineGun: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 3500 * js_ffmult->value, // magnitude - 70, // period - 1000, // duration - 0, // angle - 2500, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Punched: - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 0; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 50000; - - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 8000 * js_ffmult->value, // magnitude - 130, // period - 70, // duration - 0, // angle - 0, // offset - 0, // phase - &envelope)) // envelope - success = FALSE; - break; - case fffx_RocketLaunch: - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 200000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 0; - - g_pEffects[iSlotNum][1] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 18000, // angle - 400, // duration - 10000 * js_ffmult->value, // magnitude - &envelope))// envelope - success = FALSE; - - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 300000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 100000; - - g_pEffects[iSlotNum][0] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 0, // angle - 1000, // duration - 10000 * js_ffmult->value, // magnitude - &envelope))// envelope - success = FALSE; - break; - case fffx_SecretDoor: - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 400000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 0; - - g_pEffects[iSlotNum][0] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 0, // angle - 400, // duration - 10000 * js_ffmult->value, // magnitude - &envelope))// envelope - - success = FALSE; - break; - case fffx_SwitchClick: - g_pEffects[iSlotNum][0] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 18000, // angle - 50, // duration - 7000 * js_ffmult->value, // magnitude - NULL))// envelope - - success = FALSE; - break; - case fffx_WindGust: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 6000 * js_ffmult->value, // magnitude - 1000, // period - 500, // duration - 18000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_WindShear: - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 1500000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 500000; - - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_SawtoothDown); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 10000 * js_ffmult->value, // magnitude - 80, // period - 2000, // duration - 0, // angle - 0, // offset - 0, // phase - &envelope)) // envelope - success = FALSE; - break; - case fffx_Pistol: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 8500 * js_ffmult->value, // magnitude - 130, // period - 50, // duration - 0, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Shotgun: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 6000 * js_ffmult->value, // magnitude - 100, // period - 100, // duration - 18000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 100000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 100000; - - g_pEffects[iSlotNum][1] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 0, // angle - 300, // duration - 7000 * js_ffmult->value, // magnitude - &envelope))// envelope - success = FALSE; - break; - case fffx_Laser1: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 6000 * js_ffmult->value, // magnitude - 25, // period - 1000, // duration - 18000, // angle - 2000, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Laser2: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 5000 * js_ffmult->value, // magnitude - 25, // period - 1000, // duration - 0, // angle - 3000, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Laser3: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 5000 * js_ffmult->value, // magnitude - 25, // period - 1000, // duration - 9000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Laser4: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 7000 * js_ffmult->value, // magnitude - 25, // period - 1000, // duration - 9000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Laser5: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 5000 * js_ffmult->value, // magnitude - 25, // period - 1000, // duration - 0, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Laser6: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 5000 * js_ffmult->value, // magnitude - 25, // period - 1000, // duration - 0, // angle - 2000, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_OutOfAmmo: - g_pEffects[iSlotNum][0] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 18000, // angle - 10, // duration - 6000 * js_ffmult->value, // magnitude - NULL))// envelope - - success = FALSE; - break; - case fffx_LightningGun: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 1500 * js_ffmult->value, // magnitude - 250, // period - 1000, // duration - 18000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - - success = FALSE; - g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 6000 * js_ffmult->value, // magnitude - 50, // period - 1000, // duration - 0, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_Missile: - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 500000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 200000; - - g_pEffects[iSlotNum][0] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 0, // angle - 250, // duration - 10000 * js_ffmult->value, // magnitude - &envelope))// envelope - - success = FALSE; - break; - case fffx_GatlingGun: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_SawtoothDown); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 6000 * js_ffmult->value, // magnitude - 100, // period - 1000, // duration - 0, // angle - 1000, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - break; - case fffx_ShortPlasma: - envelope.dwAttackLevel = 7000; - envelope.dwAttackTime = 250000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 0; - - g_pEffects[iSlotNum][0] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 0, // angle - 250, // duration - 0, // magnitude - &envelope))// envelope - - success = FALSE; - - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 0; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 250000; - - g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 5000 * js_ffmult->value, // magnitude - 30, // period - 250, // duration - 0, // angle - 0, // offset - 0, // phase - &envelope)) // envelope - success = FALSE; - break; - case fffx_PlasmaCannon1: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 5000 * js_ffmult->value, // magnitude - 500, // period - 400, // duration - 18000, // angle - -5000, // offset - 0, // phase - NULL)) // envelope - - success = FALSE; - - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 250000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 0; - - g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 6000 * js_ffmult->value, // magnitude - 30, // period - 250, // duration - 0, // angle - 0, // offset - 0, // phase - &envelope)) // envelope - success = FALSE; - break; - case fffx_PlasmaCannon2: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 4000 * js_ffmult->value, // magnitude - 1000, // period - 800, // duration - 18000, // angle - -4000, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 500000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 0; - - g_pEffects[iSlotNum][1] = new CFeelPeriodic(GUID_Feel_Sine); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 8000 * js_ffmult->value, // magnitude - 35, // period - 500, // duration - 0, // angle - 0, // offset - 0, // phase - &envelope)) // envelope - success = FALSE; - break; - case fffx_Cannon: - g_pEffects[iSlotNum][0] = new CFeelPeriodic(GUID_Feel_Square); - if (!((CFeelPeriodic*)(g_pEffects[iSlotNum][0]))->InitializePolar(pFeelDevice, - 8000 * js_ffmult->value, // magnitude - 100, // period - 100, // duration - 18000, // angle - 0, // offset - 0, // phase - NULL)) // envelope - success = FALSE; - - envelope.dwAttackLevel = 0; - envelope.dwAttackTime = 100000; - envelope.dwFadeLevel = 0; - envelope.dwFadeTime = 100000; - - g_pEffects[iSlotNum][1] = new CFeelConstant; - if (!((CFeelConstant*)(g_pEffects[iSlotNum][1]))->InitializePolar(pFeelDevice, - 0, // angle - 300, // duration - 10000 * js_ffmult->value, // magnitude - &envelope))// envelope - success = FALSE; - break; - }// switch (fffx) - - // if any effect in the compound failed to initialize, dump the lot - if (!success) - { - for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++) - { - if (g_pEffects[iSlotNum][i]) - { - delete g_pEffects[iSlotNum][i]; - g_pEffects[iSlotNum][i] = NULL; - } - } - } - - return success; -} - -BOOL _FeelStartEffect(int iSlotNum, DWORD dwIterations, DWORD dwFlags) -{ - BOOL success = TRUE; - - for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++) - { - if (g_pEffects[iSlotNum][i]) - { - if (!g_pEffects[iSlotNum][i]->Start(dwIterations, dwFlags)) - success = FALSE; - } - } - - return success; -} - -BOOL _FeelEffectPlaying(int iSlotNum) -{ - DWORD dwFlags; - dwFlags = 0; - - // check to see if any effect within the compound is still playing - for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++) - { - if (g_pEffects[iSlotNum][i]) - { - g_pEffects[iSlotNum][i]->GetStatus(&dwFlags); - if (dwFlags & FEELIT_FSTATUS_PLAYING) - return TRUE; - } - } - - return FALSE; -} - -BOOL _FeelStopEffect(int iSlotNum) -{ - BOOL success = TRUE; - - for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++) - { - if (g_pEffects[iSlotNum][i]) - { - if (!g_pEffects[iSlotNum][i]->Stop()) - success = FALSE; - } - } - - return success; -} - -BOOL _FeelClearEffect(int iSlotNum) -{ - for (int i = 0; i < MAX_EFFECTS_IN_COMPOUND; i++) - { - if (g_pEffects[iSlotNum][i]) - { - delete g_pEffects[iSlotNum][i]; - g_pEffects[iSlotNum][i] = NULL; - } - } - - return TRUE; -} - - diff --git a/code/win32/FeelIt/fffx_feel.h b/code/win32/FeelIt/fffx_feel.h deleted file mode 100644 index 7f1661d..0000000 --- a/code/win32/FeelIt/fffx_feel.h +++ /dev/null @@ -1,29 +0,0 @@ -// Filename:- fffx_Feel.h (Force-Feedback FX) -// ADDED BY IMMRESION - -#ifndef FFFX_FEEL_H -#define FFFX_FEEL_H - -#include "../../client/fffx.h" -#include "ffc.h" - -///////////////////////////////////////////////////////////////////////// -/* These functions were created to make the code a little easier to read. - * _FeelCreateEffect is quite long since it needs to create different - * kinds of effects. When playing effects, the number of iterations - * may not act as expected. I can't use CFeelCompound effects since I - * don't have a Project (which requires an ifr file at this point). So, - * I simulate compound effects with arrays. If an effect has multiple - * CFeelEffect in it, each CFeelEffect will be started individually with - * that number of iterations. The only case where this will act strange - * is when the CFeelEffects have different durations. -*/ -///////////////////////////////////////////////////////////////////////// -void _FeelInitEffects(); -BOOL _FeelCreateEffect(int iSlotNum, ffFX_e fffx, CFeelDevice* pFeelDevice); -BOOL _FeelStartEffect(int iSlotNum, DWORD dwIterations, DWORD dwFlags); -BOOL _FeelEffectPlaying(int iSlotNum); -BOOL _FeelStopEffect(int iSlotNum); -BOOL _FeelClearEffect(int iSlotNum); - -#endif // #ifndef FFFX_FEEL_H diff --git a/code/win32/bink.h b/code/win32/bink.h deleted file mode 100644 index 4a4b273..0000000 --- a/code/win32/bink.h +++ /dev/null @@ -1,620 +0,0 @@ -#ifndef BINKH -#define BINKH - -#define BINKVERSION "1.0p" -#define BINKDATE "2000-06-26" - -#ifndef __RADRES__ - -#include "rad.h" - -RADDEFSTART - -typedef struct BINK PTR4* HBINK; - -typedef s32 (RADLINK PTR4* BINKIOOPEN) (struct BINKIO PTR4* Bnkio, const char PTR4 *name, u32 flags); -typedef u32 (RADLINK PTR4* BINKIOREADHEADER) (struct BINKIO PTR4* Bnkio, s32 Offset, void PTR4* Dest,u32 Size); -typedef u32 (RADLINK PTR4* BINKIOREADFRAME) (struct BINKIO PTR4* Bnkio, u32 Framenum,s32 origofs,void PTR4* dest,u32 size); -typedef u32 (RADLINK PTR4* BINKIOGETBUFFERSIZE)(struct BINKIO PTR4* Bnkio, u32 Size); -typedef void (RADLINK PTR4* BINKIOSETINFO) (struct BINKIO PTR4* Bnkio, void PTR4* Buf,u32 Size,u32 FileSize,u32 simulate); -typedef u32 (RADLINK PTR4* BINKIOIDLE) (struct BINKIO PTR4* Bnkio); -typedef void (RADLINK PTR4* BINKIOCLOSE) (struct BINKIO PTR4* Bnkio); - -typedef struct BINKIO { - BINKIOREADHEADER ReadHeader; - BINKIOREADFRAME ReadFrame; - BINKIOGETBUFFERSIZE GetBufferSize; - BINKIOSETINFO SetInfo; - BINKIOIDLE Idle; - BINKIOCLOSE Close; - HBINK bink; - volatile u32 ReadError; - volatile u32 DoingARead; - volatile u32 BytesRead; - volatile u32 Working; - volatile u32 TotalTime; - volatile u32 ForegroundTime; - volatile u32 IdleTime; - volatile u32 ThreadTime; - volatile u32 BufSize; - volatile u32 BufHighUsed; - volatile u32 CurBufSize; - volatile u32 CurBufUsed; - volatile u8 iodata[128]; -} BINKIO; - -typedef s32 (RADLINK PTR4* BINKSNDOPEN) (struct BINKSND PTR4* BnkSnd, u32 freq, s32 bits, s32 chans, u32 flags, HBINK bink); -typedef s32 (RADLINK PTR4* BINKSNDREADY) (struct BINKSND PTR4* BnkSnd); -typedef s32 (RADLINK PTR4* BINKSNDLOCK) (struct BINKSND PTR4* BnkSnd, u8 PTR4* PTR4* addr, u32 PTR4* len); -typedef s32 (RADLINK PTR4* BINKSNDUNLOCK) (struct BINKSND PTR4* BnkSnd, u32 filled); -typedef void (RADLINK PTR4* BINKSNDVOLUME) (struct BINKSND PTR4* BnkSnd, s32 volume); -typedef void (RADLINK PTR4* BINKSNDPAN) (struct BINKSND PTR4* BnkSnd, s32 pan); -typedef s32 (RADLINK PTR4* BINKSNDONOFF) (struct BINKSND PTR4* BnkSnd, s32 status); -typedef s32 (RADLINK PTR4* BINKSNDPAUSE) (struct BINKSND PTR4* BnkSnd, s32 status); -typedef void (RADLINK PTR4* BINKSNDCLOSE) (struct BINKSND PTR4* BnkSnd); - -typedef BINKSNDOPEN (RADLINK PTR4* BINKSNDSYSOPEN) (u32 param); - -typedef struct BINKSND { - BINKSNDREADY Ready; - BINKSNDLOCK Lock; - BINKSNDUNLOCK Unlock; - BINKSNDVOLUME Volume; - BINKSNDPAN Pan; - BINKSNDPAUSE Pause; - BINKSNDONOFF SetOnOff; - BINKSNDCLOSE Close; - u32 BestSizeIn16; - u32 SoundDroppedOut; - s32 OnOff; - u32 Latency; - u32 freq; - s32 bits,chans; - u8 snddata[128]; -} BINKSND; - -typedef struct BINKRECT { - s32 Left,Top,Width,Height; -} BINKRECT; - -#define BINKMAXDIRTYRECTS 8 - -typedef struct BUNDLEPOINTERS { - void* typeptr; - void* type16ptr; - void* colorptr; - void* bits2ptr; - void* motionXptr; - void* motionYptr; - void* dctptr; - void* mdctptr; - void* patptr; -} BUNDLEPOINTERS; - - -typedef struct BINK { - u32 Width; // Width (1 based, 640 for example) - u32 Height; // Height (1 based, 480 for example) - u32 Frames; // Number of frames (1 based, 100 = 100 frames) - u32 FrameNum; // Frame to *be* displayed (1 based) - u32 LastFrameNum; // Last frame decompressed or skipped (1 based) - - u32 FrameRate; // Frame Rate Numerator - u32 FrameRateDiv; // Frame Rate Divisor (frame rate=numerator/divisor) - - u32 ReadError; // Non-zero if a read error has ocurred - u32 OpenFlags; // flags used on open - u32 BinkType; // Bink flags - - u32 Size; // size of file - u32 FrameSize; // The current frame's size in bytes - u32 SndSize; // The current frame sound tracks' size in bytes - - BINKRECT FrameRects[BINKMAXDIRTYRECTS];// Dirty rects from BinkGetRects - s32 NumRects; - - u32 PlaneNum; // which set of planes is current - void PTR4* YPlane[2]; // pointer to the uncompressed Y (Cr and Cr follow) - void PTR4* APlane[2]; // decompressed alpha plane (if present) - u32 YWidth; // widths and heights of the video planes - u32 YHeight; - u32 UVWidth; - u32 UVHeight; - - void PTR4* MaskPlane; // pointer to the mask plane (Ywidth/16*Yheight/16) - u32 MaskPitch; // Mask Pitch - u32 MaskLength; // total length of the mask plane - - u32 LargestFrameSize; // Largest frame size - u32 InternalFrames; // how many frames were potentially compressed - - s32 NumTracks; // how many tracks - - u32 Highest1SecRate; // Highest 1 sec data rate - u32 Highest1SecFrame; // Highest 1 sec data rate starting frame - - s32 Paused; // is the bink movie paused? - - u32 BackgroundThread; // handle to background thread - - // everything below is for internal Bink use - - void PTR4* compframe; // compressed frame data - void PTR4* preloadptr; // preloaded compressed frame data - u32* frameoffsets; // offsets of each of the frames - - BINKIO bio; // IO structure - u8 PTR4* ioptr; // io buffer ptr - u32 iosize; // io buffer size - u32 decompwidth; // width not include scaling - u32 decompheight; // height not include scaling - - s32 trackindex; // track index - u32 PTR4* tracksizes; // largest single frame of track - u32 PTR4* tracktypes; // type of each sound track - s32 PTR4* trackIDs; // external track numbers - - u32 numrects; // number of rects from BinkGetRects - - u32 playedframes; // how many frames have we played - u32 firstframetime; // very first frame start - u32 startframetime; // start frame start - u32 startblittime; // start of blit period - u32 startsynctime; // start of synched time - u32 startsyncframe; // frame of startsynctime - u32 twoframestime; // two frames worth of time - u32 entireframetime; // entire frame time - - u32 slowestframetime; // slowest frame in ms - u32 slowestframe; // slowest frame number - u32 slowest2frametime; // second slowest frame in ms - u32 slowest2frame; // second slowest frame - - u32 soundon; // sound turned on? - u32 videoon; // video turned on? - - u32 totalmem; // total memory used - u32 timevdecomp; // total time decompressing video - u32 timeadecomp; // total time decompressing audio - u32 timeblit; // total time blitting - u32 timeopen; // total open time - - u32 fileframerate; // frame rate originally in the file - u32 fileframeratediv; - - volatile u32 threadcontrol; // controls the background reading thread - - u32 runtimeframes; // max frames for runtime analysis - u32 runtimemoveamt; // bytes to move each frame - u32 PTR4* rtframetimes; // start times for runtime frames - u32 PTR4* rtadecomptimes; // decompress times for runtime frames - u32 PTR4* rtvdecomptimes; // decompress times for runtime frames - u32 PTR4* rtblittimes; // blit times for runtime frames - u32 PTR4* rtreadtimes; // read times for runtime frames - u32 PTR4* rtidlereadtimes; // idle read times for runtime frames - u32 PTR4* rtthreadreadtimes;// thread read times for runtime frames - - u32 lastblitflags; // flags used on last blit - u32 lastdecompframe; // last frame number decompressed - - u32 sndbufsize; // sound buffer size - u8 PTR4* sndbuf; // sound buffer - u8 PTR4* sndend; // end of the sound buffer - u8 PTR4* sndwritepos; // current write position - u8 PTR4* sndreadpos; // current read position - u32 sndcomp; // sound compression handle - u32 sndamt; // amount of sound currently in the buffer - volatile u32 sndreenter; // re-entrancy check on the sound - u32 sndconvert8; // convert back to 8-bit sound at runtime - BINKSND bsnd; // SND structure - u32 skippedlastblit; // skipped last frame? - u32 skippedblits; // how many blits were skipped - u32 soundskips; // number of sound stops - u32 sndendframe; // frame number that the sound ends on - u32 sndprime; // amount of data to prime the playahead - u32 sndpad; // padded this much audio - - BUNDLEPOINTERS bunp; // pointers to internal temporary memory -} BINK; - - -typedef struct BINKSUMMARY { - u32 Width; // Width of frames - u32 Height; // Height of frames - u32 TotalTime; // total time (ms) - u32 FileFrameRate; // frame rate - u32 FileFrameRateDiv; // frame rate divisor - u32 FrameRate; // frame rate - u32 FrameRateDiv; // frame rate divisor - u32 TotalOpenTime; // Time to open and prepare for decompression - u32 TotalFrames; // Total Frames - u32 TotalPlayedFrames; // Total Frames played - u32 SkippedFrames; // Total number of skipped frames - u32 SkippedBlits; // Total number of skipped blits - u32 SoundSkips; // Total number of sound skips - u32 TotalBlitTime; // Total time spent blitting - u32 TotalReadTime; // Total time spent reading - u32 TotalVideoDecompTime; // Total time spent decompressing video - u32 TotalAudioDecompTime; // Total time spent decompressing audio - u32 TotalIdleReadTime; // Total time spent reading while idle - u32 TotalBackReadTime; // Total time spent reading in background - u32 TotalReadSpeed; // Total io speed (bytes/second) - u32 SlowestFrameTime; // Slowest single frame time (ms) - u32 Slowest2FrameTime; // Second slowest single frame time (ms) - u32 SlowestFrameNum; // Slowest single frame number - u32 Slowest2FrameNum; // Second slowest single frame number - u32 AverageDataRate; // Average data rate of the movie - u32 AverageFrameSize; // Average size of the frame - u32 HighestMemAmount; // Highest amount of memory allocated - u32 TotalIOMemory; // Total extra memory allocated - u32 HighestIOUsed; // Highest extra memory actually used - u32 Highest1SecRate; // Highest 1 second rate - u32 Highest1SecFrame; // Highest 1 second start frame -} BINKSUMMARY; - - -typedef struct BINKREALTIME { - u32 FrameNum; // Current frame number - u32 FrameRate; // frame rate - u32 FrameRateDiv; // frame rate divisor - u32 Frames; // frames in this sample period - u32 FramesTime; // time is ms for these frames - u32 FramesVideoDecompTime; // time decompressing these frames - u32 FramesAudioDecompTime; // time decompressing these frames - u32 FramesReadTime; // time reading these frames - u32 FramesIdleReadTime; // time reading these frames at idle - u32 FramesThreadReadTime; // time reading these frames in background - u32 FramesBlitTime; // time blitting these frames - u32 ReadBufferSize; // size of read buffer - u32 ReadBufferUsed; // amount of read buffer currently used - u32 FramesDataRate; // data rate for these frames -} BINKREALTIME; - -#define BINKMARKER1 'fKIB' -#define BINKMARKER2 'gKIB' // new Bink files use this tag -#define BINKMARKER3 'hKIB' // newer Bink files use this tag -#define BINKMARKER4 'iKIB' // even newer Bink files use this tag - -typedef struct BINKHDR { - u32 Marker; // Bink marker - u32 Size; // size of the file-8 - u32 Frames; // Number of frames (1 based, 100 = 100 frames) - u32 LargestFrameSize; // Size in bytes of largest frame - u32 InternalFrames; // Number of internal frames - - u32 Width; // Width (1 based, 640 for example) - u32 Height; // Height (1 based, 480 for example) - u32 FrameRate; // frame rate - u32 FrameRateDiv; // frame rate divisor (framerate/frameratediv=fps) - - u32 Flags; // height compression options - u32 NumTracks; // number of tracks -} BINKHDR; - - -//======================================================================= -#define BINKFRAMERATE 0x00001000L // Override fr (call BinkFrameRate first) -#define BINKPRELOADALL 0x00002000L // Preload the entire animation -#define BINKSNDTRACK 0x00004000L // Set the track number to play -#define BINKOLDFRAMEFORMAT 0x00008000L // using the old Bink frame format (internal use only) -#define BINKRBINVERT 0x00010000L // use reversed R and B planes (internal use only) -#define BINKGRAYSCALE 0x00020000L // Force Bink to use grayscale -#define BINKNOMMX 0x00040000L // Don't use MMX -#define BINKNOSKIP 0x00080000L // Don't skip frames if falling behind -#define BINKALPHA 0x00100000L // Decompress alpha plane (if present) -#define BINKNOFILLIOBUF 0x00200000L // Fill the IO buffer in SmackOpen -#define BINKSIMULATE 0x00400000L // Simulate the speed (call BinkSim first) -#define BINKFILEHANDLE 0x00800000L // Use when passing in a file handle -#define BINKIOSIZE 0x01000000L // Set an io size (call BinkIOSize first) -#define BINKIOPROCESSOR 0x02000000L // Set an io processor (call BinkIO first) -#define BINKFROMMEMORY 0x04000000L // Use when passing in a pointer to the file -#define BINKNOTHREADEDIO 0x08000000L // Don't use a background thread for IO - -#define BINKSURFACEFAST 0x00000000L -#define BINKSURFACESLOW 0x08000000L -#define BINKSURFACEDIRECT 0x04000000L - -#define BINKCOPYALL 0x80000000L // copy all pixels (not just changed) -#define BINKCOPY2XH 0x10000000L // Force doubling height scaling -#define BINKCOPY2XHI 0x20000000L // Force interleaving height scaling -#define BINKCOPY2XW 0x30000000L // copy the width zoomed by two -#define BINKCOPY2XWH 0x40000000L // copy the width and height zoomed by two -#define BINKCOPY2XWHI 0x50000000L // copy the width and height zoomed by two -#define BINKCOPY1XI 0x60000000L // copy the width and height zoomed by two -#define BINKCOPYNOSCALING 0x70000000L // Force scaling off - -//#define BINKALPHA 0x00100000L // Decompress alpha plane (if present) -//#define BINKNOSKIP 0x00080000L // don't skip the blit if behind in sound -//#define BINKNOMMX 0x00040000L // Don't skip frames if falling behind -//#define BINKGRAYSCALE 0x00020000L // force Bink to use grayscale -//#define BINKRBINVERT 0x00010000L // use reversed R and B planes - -#define BINKSURFACE8P 0 -#define BINKSURFACE24 1 -#define BINKSURFACE24R 2 -#define BINKSURFACE32 3 -#define BINKSURFACE32R 4 -#define BINKSURFACE32A 5 -#define BINKSURFACE32RA 6 -#define BINKSURFACE4444 7 -#define BINKSURFACE5551 8 -#define BINKSURFACE555 9 -#define BINKSURFACE565 10 -#define BINKSURFACE655 11 -#define BINKSURFACE664 12 -#define BINKSURFACEYUY2 13 -#define BINKSURFACEUYVY 14 -#define BINKSURFACEYV12 15 -#define BINKSURFACEMASK 15 - -#define BINKGOTOQUICK 1 - -#define BINKGETKEYPREVIOUS 0 -#define BINKGETKEYNEXT 1 -#define BINKGETKEYCLOSEST 2 -#define BINKGETKEYNOTEQUAL 128 - -//======================================================================= - -#ifdef __RADMAC__ - #include - - #pragma export on - - RADEXPFUNC HBINK RADEXPLINK BinkMacOpen(FSSpec* fsp,u32 flags); -#endif - -RADEXPFUNC void PTR4* RADEXPLINK BinkLogoAddress(void); - -RADEXPFUNC void RADEXPLINK BinkSetError(const char PTR4* err); -RADEXPFUNC char PTR4* RADEXPLINK BinkGetError(void); - -RADEXPFUNC HBINK RADEXPLINK BinkOpen(const char PTR4* name,u32 flags); - -RADEXPFUNC s32 RADEXPLINK BinkDoFrame(HBINK bnk); -RADEXPFUNC void RADEXPLINK BinkNextFrame(HBINK bnk); -RADEXPFUNC s32 RADEXPLINK BinkWait(HBINK bnk); -RADEXPFUNC void RADEXPLINK BinkClose(HBINK bnk); -RADEXPFUNC s32 RADEXPLINK BinkPause(HBINK bnk,s32 pause); -RADEXPFUNC s32 RADEXPLINK BinkCopyToBuffer(HBINK bnk,void* dest,s32 destpitch,u32 destheight,u32 destx,u32 desty,u32 flags); -RADEXPFUNC s32 RADEXPLINK BinkGetRects(HBINK bnk,u32 flags); -RADEXPFUNC void RADEXPLINK BinkGoto(HBINK bnk,u32 frame,s32 flags); // use 1 for the first frame -RADEXPFUNC u32 RADEXPLINK BinkGetKeyFrame(HBINK bnk,u32 frame,s32 flags); - -RADEXPFUNC s32 RADEXPLINK BinkSetVideoOnOff(HBINK bnk,s32 onoff); -RADEXPFUNC s32 RADEXPLINK BinkSetSoundOnOff(HBINK bnk,s32 onoff); -RADEXPFUNC void RADEXPLINK BinkSetVolume(HBINK bnk,s32 volume); -RADEXPFUNC void RADEXPLINK BinkSetPan(HBINK bnk,s32 pan); -RADEXPFUNC void RADEXPLINK BinkService(HBINK bink); - -typedef struct BINKTRACK PTR4* HBINKTRACK; - -typedef struct BINKTRACK -{ - u32 Frequency; - u32 Bits; - u32 Channels; - u32 MaxSize; - - HBINK bink; - u32 sndcomp; - s32 trackindex; -} BINKTRACK; - - -RADEXPFUNC HBINKTRACK RADEXPLINK BinkOpenTrack(HBINK bnk,u32 trackindex); -RADEXPFUNC void RADEXPLINK BinkCloseTrack(HBINKTRACK bnkt); -RADEXPFUNC u32 RADEXPLINK BinkGetTrackData(HBINKTRACK bnkt,void PTR4* dest); - -RADEXPFUNC u32 RADEXPLINK BinkGetTrackType(HBINK bnk,u32 trackindex); -RADEXPFUNC u32 RADEXPLINK BinkGetTrackMaxSize(HBINK bnk,u32 trackindex); -RADEXPFUNC u32 RADEXPLINK BinkGetTrackID(HBINK bnk,u32 trackindex); -RADEXPFUNC u32 RADEXPLINK BinkGetTrackLargest(HBINK bnk,u32 trackindex); - -RADEXPFUNC void RADEXPLINK BinkGetSummary(HBINK bnk,BINKSUMMARY PTR4* sum); -RADEXPFUNC void RADEXPLINK BinkGetRealtime(HBINK bink,BINKREALTIME PTR4* run,u32 frames); - -#define BINKNOSOUND 0xffffffff - -RADEXPFUNC void RADEXPLINK BinkSetSoundTrack(u32 track); -RADEXPFUNC void RADEXPLINK BinkSetIO(BINKIOOPEN io); -RADEXPFUNC void RADEXPLINK BinkSetFrameRate(u32 forcerate,u32 forceratediv); -RADEXPFUNC void RADEXPLINK BinkSetSimulate(u32 sim); -RADEXPFUNC void RADEXPLINK BinkSetIOSize(u32 iosize); - -RADEXPFUNC s32 RADEXPLINK BinkSetSoundSystem(BINKSNDSYSOPEN open, u32 param); - -#ifdef __RADWIN__ - - RADEXPFUNC BINKSNDOPEN RADEXPLINK BinkOpenDirectSound(u32 param); // don't call directly - #define BinkSoundUseDirectSound(lpDS) BinkSetSoundSystem(BinkOpenDirectSound,(u32)lpDS) - - RADEXPFUNC BINKSNDOPEN RADEXPLINK BinkOpenWaveOut(u32 param); // don't call directly - #define BinkSoundUseWaveOut() BinkSetSoundSystem(BinkOpenWaveOut,0) - - #define INCLUDE_MMSYSTEM_H - #include "windows.h" - #include "windowsx.h" - - #ifdef __RADNT__ // to combat WIN32_LEAN_AND_MEAN - #include "mmsystem.h" - #endif - -#endif - - -#ifndef __RADMAC__ - - RADEXPFUNC BINKSNDOPEN RADEXPLINK BinkOpenMiles(u32 param); // don't call directly - #define BinkSoundUseMiles(hdigdriver) BinkSetSoundSystem(BinkOpenMiles,(u32)hdigdriver) - -#endif - - -#ifdef __RADMAC__ - - RADEXPFUNC BINKSNDOPEN RADEXPLINK BinkOpenSoundManager(u32 param); // don't call directly - #define BinkSoundUseSoundManager() BinkSetSoundSystem(BinkOpenSoundManager,0) - -#endif - - -// The BinkBuffer API isn't currently implemented on DOS -#if !defined(__RADDOS__) - -//========================================================================= -typedef struct BINKBUFFER * HBINKBUFFER; - -#define BINKBUFFERSTRETCHXINT 0x80000000 -#define BINKBUFFERSTRETCHX 0x40000000 -#define BINKBUFFERSHRINKXINT 0x20000000 -#define BINKBUFFERSHRINKX 0x10000000 -#define BINKBUFFERSTRETCHYINT 0x08000000 -#define BINKBUFFERSTRETCHY 0x04000000 -#define BINKBUFFERSHRINKYINT 0x02000000 -#define BINKBUFFERSHRINKY 0x01000000 -#define BINKBUFFERSCALES 0xff000000 -#define BINKBUFFERRESOLUTION 0x00800000 - -#ifdef __RADMAC__ - -#include -#include -#include - -typedef struct BINKBUFFER { - u32 Width; - u32 Height; - u32 WindowWidth; - u32 WindowHeight; - u32 SurfaceType; - void* Buffer; - s32 BufferPitch; - u32 ScreenWidth; - u32 ScreenHeight; - u32 ScreenDepth; - u32 ScaleFlags; - - s32 destx,desty; - s32 wndx,wndy; - u32 wnd; - - s32 noclipping; - u32 type; - s32 issoftcur; - u32 cursorcount; - -} BINKBUFFER; - - -#define BINKBUFFERAUTO 0 -#define BINKBUFFERDIRECT 1 -#define BINKBUFFERGWORLD 2 -#define BINKBUFFERTYPEMASK 31 - -RADEXPFUNC HBINKBUFFER RADEXPLINK BinkBufferOpen( WindowPtr wnd, u32 width, u32 height, u32 bufferflags); -RADEXPFUNC s32 RADEXPLINK BinkGDSurfaceType( GDHandle gd ); -RADEXPFUNC s32 RADEXPLINK BinkIsSoftwareCursor(GDHandle gd); -RADEXPFUNC s32 RADEXPLINK BinkCheckCursor(WindowPtr wp,s32 x,s32 y,s32 w,s32 h); - -#else - -typedef struct BINKBUFFER { - u32 Width; - u32 Height; - u32 WindowWidth; - u32 WindowHeight; - u32 SurfaceType; - void* Buffer; - s32 BufferPitch; - s32 ClientOffsetX; - s32 ClientOffsetY; - u32 ScreenWidth; - u32 ScreenHeight; - u32 ScreenDepth; - u32 ExtraWindowWidth; - u32 ExtraWindowHeight; - u32 ScaleFlags; - u32 StretchWidth; - u32 StretchHeight; - - s32 surface; - void* ddsurface; - void* ddclipper; - s32 destx,desty; - s32 wndx,wndy; - u32 wnd; - s32 ddoverlay; - s32 ddoffscreen; - s32 lastovershow; - - s32 issoftcur; - u32 cursorcount; - void* buffertop; - u32 type; - s32 noclipping; - - s32 loadeddd; - s32 loadedwin; - - void* dibh; - void* dibbuffer; - s32 dibpitch; - void* dibinfo; - u32 dibdc; - u32 diboldbitmap; - -} BINKBUFFER; - - -#define BINKBUFFERAUTO 0 -#define BINKBUFFERPRIMARY 1 -#define BINKBUFFERDIBSECTION 2 -#define BINKBUFFERYV12OVERLAY 3 -#define BINKBUFFERYUY2OVERLAY 4 -#define BINKBUFFERUYVYOVERLAY 5 -#define BINKBUFFERYV12OFFSCREEN 6 -#define BINKBUFFERYUY2OFFSCREEN 7 -#define BINKBUFFERUYVYOFFSCREEN 8 -#define BINKBUFFERRGBOFFSCREENVIDEO 9 -#define BINKBUFFERRGBOFFSCREENSYSTEM 10 -#define BINKBUFFERLAST 10 -#define BINKBUFFERTYPEMASK 31 - -RADEXPFUNC HBINKBUFFER RADEXPLINK BinkBufferOpen( HWND wnd, u32 width, u32 height, u32 bufferflags); -RADEXPFUNC s32 RADEXPLINK BinkBufferSetHWND( HBINKBUFFER buf, HWND newwnd); -RADEXPFUNC s32 RADEXPLINK BinkDDSurfaceType(void PTR4* lpDDS); -RADEXPFUNC s32 RADEXPLINK BinkIsSoftwareCursor(void PTR4* lpDDSP,HCURSOR cur); -RADEXPFUNC s32 RADEXPLINK BinkCheckCursor(HWND wnd,s32 x,s32 y,s32 w,s32 h); -RADEXPFUNC s32 RADEXPLINK BinkBufferSetDirectDraw(void PTR4* lpDirectDraw, void PTR4* lpPrimary); - -#endif - -RADEXPFUNC void RADEXPLINK BinkBufferClose( HBINKBUFFER buf); -RADEXPFUNC s32 RADEXPLINK BinkBufferLock( HBINKBUFFER buf); -RADEXPFUNC s32 RADEXPLINK BinkBufferUnlock( HBINKBUFFER buf); -RADEXPFUNC void RADEXPLINK BinkBufferSetResolution( s32 w, s32 h, s32 bits); -RADEXPFUNC void RADEXPLINK BinkBufferCheckWinPos( HBINKBUFFER buf, s32 PTR4* NewWindowX, s32 PTR4* NewWindowY); -RADEXPFUNC s32 RADEXPLINK BinkBufferSetOffset( HBINKBUFFER buf, s32 destx, s32 desty); -RADEXPFUNC void RADEXPLINK BinkBufferBlit( HBINKBUFFER buf, BINKRECT PTR4* rects, u32 numrects ); -RADEXPFUNC s32 RADEXPLINK BinkBufferSetScale( HBINKBUFFER buf, u32 w, u32 h); -RADEXPFUNC char PTR4* RADEXPLINK BinkBufferGetDescription( HBINKBUFFER buf); -RADEXPFUNC char PTR4* RADEXPLINK BinkBufferGetError(); -RADEXPFUNC s32 RADEXPLINK BinkBufferClear(HBINKBUFFER buf, u32 RGB); - -RADEXPFUNC void RADEXPLINK BinkRestoreCursor(s32 checkcount); - -#endif - -#ifdef __RADMAC__ - -#pragma export off - -#endif - -RADDEFEND - -#endif - -#endif -