Update of /cvsroot/simspark/simspark/spark/spark
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11197/spark
Modified Files:
spark.rb
Log Message:
- moved the setup of an InputSystem into sparkSetupInput
- allow the setup of an InputSystem other than InputSdl
Index: spark.rb
===================================================================
RCS file: /cvsroot/simspark/simspark/spark/spark/spark.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** spark.rb 18 Dec 2005 11:08:42 -0000 1.1
--- spark.rb 25 Dec 2005 16:12:06 -0000 1.2
***************
*** 7,10 ****
--- 7,19 ----
#
+ # (Inputsystem)
+ #
+
+ # the default InputSystem used to read keyboard, mouse and timer input
+ $defaultInputSystem = 'InputSystemSDL'
+
+ # the name of the default bundle that contains the default InputSystem
+ $defaultInputSystemBundle = 'inputsdl'
+
# (OpenGL rendering)
#
***************
*** 149,163 ****
# setup the InputServer
! # use the SDL input system and use a german keyboard layout
! importBundle 'inputsdl';
inputServer = new('kerosin/InputServer', $serverPath+'input')
inputServer.setScanCodeMapping('german.scan.rb');
! inputServer.init('InputSystemSDL')
!
! # add devices
! inputServer.createDevice('Timer')
! inputServer.createDevice('Keyboard')
! inputServer.createDevice('Mouse')
!
# setup the FontServer
new('kerosin/FontServer', $serverPath+'font');
--- 158,165 ----
# setup the InputServer
! # create the InputServer and use a german keyboard layout
inputServer = new('kerosin/InputServer', $serverPath+'input')
inputServer.setScanCodeMapping('german.scan.rb');
!
# setup the FontServer
new('kerosin/FontServer', $serverPath+'font');
***************
*** 169,174 ****
end
! def sparkSetupInput()
! print "(spark.rb) sparkSetupRendering\n"
#
--- 171,189 ----
end
! def sparkSetupInput(inputSystem = $defaultInputSystem)
! print "(spark.rb) sparkSetupInput\n"
! print "(spark.rb) using InputSystem '" + inputSystem + "'\n"
!
! # setup the SDL input system
! if (inputSystem == $defaultInputSystem)
! importBundle($defaultInputSystemBundle)
! end
!
! inputServer.init(inputSystem)
!
! # add devices
! inputServer.createDevice('Timer')
! inputServer.createDevice('Keyboard')
! inputServer.createDevice('Mouse')
#
|