Browse Source

Cleanups.

Mark Sibly 7 years ago
parent
commit
e3a0f2c048

+ 0 - 24
modules/mojo/input/device.monkey2

@@ -1,24 +0,0 @@
-
-Namespace mojo.input
-
-Class InputDevice
-
-	#rem monkeydoc @hidden
-	#end
-'	Method GetAxis:Float( index:Int ) Virtual
-'		Return 0
-'	End
-	
-	#rem monkeydoc @hidden
-	#end
-'	Method GetButton:Bool( index:Int ) Virtual
-'		Return 0
-'	End
-	
-	#rem monkeydoc @hidden
-	#end
-'	Method GetPointer:Vec2i( index:Int ) Virtual
-'		Return New Vec2i
-'	End
-
-End

+ 0 - 102
modules/mojo/input/gamecontroller.monkey2

@@ -1,102 +0,0 @@
-
-Namespace mojo.input
-
-#rem monkeydoc @hidden
-#end
-Enum GameControllerButton	'uses SDL values
-	A=0
-	B=1
-	X=2
-	Y=3
-	Back=4
-	Guide=5
-	Start=6
-	LeftStick=7
-	RightStick=8
-	LeftShoulder=9
-	RightShoulder=10
-	DpadUp=11
-	DpadDown=12
-	DpadLeft=13
-	DpadRight=14
-End
-
-#rem monkeydoc @hidden
-#end
-Enum GameControllerAxis		'uses SDL values
-	LeftX=0
-	LeftY=1
-	RightX=2
-	RightY=3
-	LeftTrigger=4
-	RightTrigger=5
-End
-
-#rem monkeydoc @hidden
-#end
-Class GameController Extends InputDevice
-
-	Method New( axisDevice:InputDevice,buttonDevice:InputDevice,_pointerDevice:InputDevice )
-		_axisDevice=axisDevice
-		_buttonDevice=buttonDevice
-		_pointerDevice=pointerDevice
-		For Local i:=0 Until _axisMap.Length
-			_axisMap[i]=i
-		Next
-		For Local i:=0 Until _buttonMap.Length
-			_buttonMap[i]=i
-		Next
-		For Local i:=0 Until _pointerMap.Length
-			_pointerMap[i]=i
-		Next
-	End
-	
-	Method GetAxis:Float( axis:GameControllerAxis ) Override
-		If _axisDevice Return _axisDevice.GetAxis( _axisMap[axis] )
-		Return 0
-	End
-	
-	Method GetButton:Bool( button:GameControllerButton ) Override
-		If _buttonDevice Return _buttonDevice.GetButton( _buttonMap[button] )
-		Return False
-	End
-	
-	Method GetPointer:Vec2i( pointer:Int ) Override
-		If _pointerDevice Return _pointerDevice.GetPointer( _pointerMap[pointer] )
-	End
-	
-	Method MapAxis( axis:GameControllerAxis,deviceAxis:Int )
-		_axisMap[axis]=deviceAxis
-	End
-	
-	Method MapButton( button:GameControllerButton,deviceButton:Int )
-		_buttonMap[button]=deviceButton
-	End
-	
-	Method MapPointer( pointer:Int,devicePointer:Int )
-		_pointerMap[pointer]=devicePointer
-	End
-	
-	Function WASD:GameController()
-		If Not _wasd
-			_wasd=New GameController( Null,Keyboard )
-			_wasd.MapButton( GameControllerButton.DpadLeft,Key.A )
-			_wasd.MapButton( GameControllerButton.DpadRight,Key.D )
-			_wasd.MapButton( GameControllerButton.DpadUp,Key.W )
-			_wasd.MapButton( GameControllerButton.DpadDown,Key.S )
-		Endif
-		Return _wasd
-	End
-	
-	Private
-	
-	Global _wasd:GameController
-	
-	Field _axisDevice:InputDevice
-	Field _buttonDevice:InputDevice
-	Field _pointerDevice:InputDevice
-	Field _axisMap:=New Int[6]
-	Field _buttonMap:=New Int[16]
-	Field _pointerMap:=New Int[10]
-	
-End

+ 1 - 1
modules/mojo/input/joystick.monkey2

@@ -30,7 +30,7 @@ End
 
 
 #rem monkeydoc The JoystickDevice class.
 #rem monkeydoc The JoystickDevice class.
 #end
 #end
-Class JoystickDevice Extends InputDevice
+Class JoystickDevice
 
 
 	#rem monkeydoc @hidden
 	#rem monkeydoc @hidden
 	#end	
 	#end	

+ 1 - 1
modules/mojo/input/keyboard.monkey2

@@ -33,7 +33,7 @@ A raw key represents the physical location of a key on US keyboards. For example
 QWERTY keys, as this is where the 'Q' key is on US keyboards.
 QWERTY keys, as this is where the 'Q' key is on US keyboards.
 
 
 #end
 #end
-Class KeyboardDevice Extends InputDevice
+Class KeyboardDevice
 
 
 	#rem monkeydoc The current state of the modifier keys.
 	#rem monkeydoc The current state of the modifier keys.
 	#end
 	#end

+ 1 - 1
modules/mojo/input/mouse.monkey2

@@ -63,7 +63,7 @@ To access the mouse device, use the global [[Mouse]] constant.
 The mouse device should only used after a new [[AppInstance]] is created.
 The mouse device should only used after a new [[AppInstance]] is created.
 
 
 #end
 #end
-Class MouseDevice Extends InputDevice
+Class MouseDevice
 
 
 	#rem monkeydoc The mouse cursor, see [[MouseCursor]] enumeration for details.
 	#rem monkeydoc The mouse cursor, see [[MouseCursor]] enumeration for details.
 	
 	

+ 1 - 1
modules/mojo/input/touch.monkey2

@@ -12,7 +12,7 @@ To access the touch device, use the global [[Touch]] constant.
 The touch device should only used after a new [[AppInstance]] is created.
 The touch device should only used after a new [[AppInstance]] is created.
 
 
 #end
 #end
-Class TouchDevice Extends InputDevice
+Class TouchDevice
 
 
 	Method FingerDown:Bool( finger:Int )
 	Method FingerDown:Bool( finger:Int )
 		DebugAssert( finger>=0 And finger<10,"Finger index out of range" )
 		DebugAssert( finger>=0 And finger<10,"Finger index out of range" )

+ 0 - 1
modules/mojo/mojo.monkey2

@@ -40,7 +40,6 @@ Namespace mojo
 #Import "graphics/image"
 #Import "graphics/image"
 #Import "graphics/shadowcaster"
 #Import "graphics/shadowcaster"
 
 
-#Import "input/device"
 #Import "input/keyboard"
 #Import "input/keyboard"
 #Import "input/mouse"
 #Import "input/mouse"
 #Import "input/touch"
 #Import "input/touch"