Exemplo n.º 1
0
//----------------------------------------------------------------//
void MOAIInputMgr::SetSensor ( u8 deviceID, u8 sensorID, cc8* name, u32 type ) {

	MOAIInputDevice* device = this->GetDevice ( deviceID );
	if ( device ) {
		device->SetSensor ( sensorID, name, type );
	}
}
Exemplo n.º 2
0
//----------------------------------------------------------------//
void MOAIInputMgr::ReserveSensors ( u8 deviceID, u8 total ) {

	MOAIInputDevice* device = this->GetDevice ( deviceID );
	if ( device ) {
		device->ReserveSensors ( total );
	}
}
Exemplo n.º 3
0
//----------------------------------------------------------------//
void MOAIInputMgr::SetDeviceActive ( u8 deviceID, bool active ) {

	MOAIInputDevice* device = this->GetDevice ( deviceID );
	if ( device ) {
		device->SetActive ( active );
	}
}
Exemplo n.º 4
0
//----------------------------------------------------------------//
void MOAIInputMgr::SetDeviceExtendedName ( u8 deviceID, cc8* nameExtended ) {

	MOAIInputDevice* device = this->GetDevice ( deviceID );
	if ( device ) {
		device->SetExtendedName(nameExtended);
	}
}
Exemplo n.º 5
0
//----------------------------------------------------------------//
MOAISensor* MOAIInputMgr::GetSensor ( u8 deviceID, u8 sensorID ) {

	MOAIInputDevice* device = this->GetDevice ( deviceID );
	if ( device ) {
		return device->GetSensor ( sensorID );
	}
	return 0;
}
Exemplo n.º 6
0
//----------------------------------------------------------------//
bool MOAIInputMgr::CheckSensor ( u8 deviceID, u8 sensorID, u32 type ) {

	MOAIInputDevice* device = this->GetDevice ( deviceID );
	if ( device && device->mIsActive ) {
		MOAISensor* sensor = device->GetSensor ( sensorID );
		return ( sensor && ( sensor->mType == type ));
	}
	return false;
}
Exemplo n.º 7
0
//----------------------------------------------------------------//
void MOAIInputMgr::Reset () {

	for ( u32 i = 0; i < this->mDevices.Size (); ++i ) {
		MOAIInputDevice* device = this->mDevices [ i ];
		if ( device ) {
			device->Reset ();
		}
	}
	this->mInput.Seek ( 0, SEEK_SET );
}
Exemplo n.º 8
0
//----------------------------------------------------------------//
void MOAIInputMgr::SetDevice ( u8 deviceID, cc8* name ) {

	MOAIInputDevice* device = new MOAIInputDevice ();
	
	device->SetName ( name );

	this->mDevices.Grow ( deviceID + 1 );
	this->mDevices [ deviceID ] = device;
	
	USLuaStateHandle state = USLuaRuntime::Get ().State ();
	this->PushLuaClassTable ( state );
	
	//if ( state.GetFieldWithType ( -1, LUAVAR_DEVICES, LUA_TTABLE )) {
		device->PushLuaUserdata ( state );
		lua_setfield ( state, -2, name );
	//}
}
Exemplo n.º 9
0
//----------------------------------------------------------------//
void MOAIInputMgr::SetDevice ( u8 deviceID, cc8* name ) {

	if ( !( deviceID < this->mDevices.Size ())) return;

	MOAIInputDevice* device = new MOAIInputDevice ();
	device->SetName ( name );
	
	this->LuaRelease ( this->mDevices [ deviceID ]);
	
	this->mDevices [ deviceID ] = device;
	this->LuaRetain ( device );
	
	MOAILuaStateHandle state = MOAILuaRuntime::Get ().State ();
	this->PushLuaClassTable ( state );
	
	device->PushLuaUserdata ( state );
	lua_setfield ( state, -2, name );
}