#pragma once
//===========================================================================//
// File:	 ForceFeedback.hpp												 //
// Project:  GameOS					                                         //
// Contents: ForceFeedback routines											 //
//---------------------------------------------------------------------------//
// Date      Who    Modification                                             // 
// 03/09/99  JTR    Created													 //
//																			 //
//---------------------------------------------------------------------------//
// Copyright (C) 1999 Microsoft Corp.						                 //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//

#define GROUP_FORCEFEEDBACK "Group_ForceFeedback"

struct FFEffectData
{
	GUID diGUID;
	DIEFFECT diEffectData;
	LPDIRECTINPUTEFFECT diEffect;
	UCHAR diTypeSpecific[64];
	DIENVELOPE diEnvelope;
	DWORD rgdwAxes[12];
	LONG rglDirection[12];
	FFEffectData * pNextEffect;
};

struct gosForceEffect
{
public:
	FFEffectData * ffEffectData;
	gosForce m_eType;
	gosForceEffect * pNext;
	DWORD dwStick;
	double longestDuration;
	double startTime;
	bool bStatus;
	bool fromFile;
public:
	gosForceEffect(gosJoystick_ForceEffect * fe, DWORD joy);
	gosForceEffect(const char * fe, DWORD joy);
	void ReCreate();
	~gosForceEffect();
	void Play(DWORD times);
	void Stop();
	void Update(gosJoystick_ForceEffect * fe);
};