Old fashion design for PC-104
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

57 lines
1.4 KiB

//----------------------------------------------------------------------------
// Laser Guard Ltd.
// Copyright © 2000-2002. All Rights Reserved.
// Version 1.0 01/01/2000
// Last modification: 08/10/2003
// PROJECT:
// SUBSYSTEM:
// FILE: DirectInputSet.cpp
// AUTHOR: Sergey Chizhevskiy
// OVERVIEW
// ~~~~~~~~
// Source file of DirectInputSet.cpp
//----------------------------------------------------------------------------
#include "stdafx.h"
#include "DirectInputSet.h"
#include "..\..\LgLib\Version.h"
CDirectInputSet::CDirectInputSet()
{
m_ppInput = NULL;
m_nInput = 0;
}
CDirectInputSet::~CDirectInputSet()
{
if( m_ppInput )
{
for( int i = 0; i < m_nInput; i++ )
delete m_ppInput[i];
free( m_ppInput );
}
}
void CDirectInputSet::Reset()
{
for( int i = 0; i < m_nInput; i++ )
m_ppInput[i]->CmdReset();
}
BOOL CDirectInputSet::ConnectToDevice( CDeviceDI *pDeviceDI, int nDeviceBit, int nSensorBit )
{
CDirectInput *pDirectInput = new CDirectInput;
if( !pDirectInput )
return FALSE;
m_ppInput = (CDirectInput**)realloc( m_ppInput, sizeof(CDirectInput*) * (m_nInput + 1) );
if( !m_ppInput )
{
m_nInput = 0;
delete pDirectInput;
return FALSE;
}
m_ppInput[ m_nInput ] = pDirectInput;
return m_ppInput[ m_nInput++ ]->ConnectToDevice( pDeviceDI, nDeviceBit, nSensorBit );
}