home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / source / theatrix / jsfold.cpp < prev    next >
C/C++ Source or Header  |  1995-04-25  |  1KB  |  54 lines

  1. #include "standard.h"
  2. #include "jsfold.h"
  3.  
  4. void JoystickFolder::register_joystickbutton(Hand* hand,int b,callback cb)
  5.   {
  6.   if (b==BUTTONONE)
  7.     button1list.add(hand,cb);
  8.   else
  9.     button2list.add(hand,cb);
  10.   }
  11.  
  12. void JoystickFolder::unregister_joystickbutton(Hand* hand,int b,callback cb)
  13.   {
  14.   if (b==BUTTONONE)
  15.     button1list.del(hand,cb);
  16.   else
  17.     button2list.del(hand,cb);
  18.   }
  19.  
  20. void JoystickFolder::register_joystickmove(Hand* hand,callback cb)
  21.   {
  22.   list.add(hand,cb);
  23.   }
  24.  
  25. void JoystickFolder::unregister_joystickmove(Hand* hand,callback cb)
  26.   {
  27.   list.del(hand,cb);
  28.   }
  29.  
  30. void JoystickFolder::delHand(Hand* h)
  31.   {
  32.   button1list.delHand(h);
  33.   button2list.delHand(h);
  34.   list.delHand(h);
  35.   }
  36.  
  37. void JoystickFolder::reset()
  38.   {
  39.   button1list.reset();
  40.   button2list.reset();
  41.   list.reset();
  42.   }
  43.  
  44. void JoystickFolder::dispatch(int x, int y, int sw)
  45.   {
  46.   if (sw & 0x10)
  47.     button1list.execute_callbacks(x,y);
  48.   if (sw & 0x20)
  49.     button2list.execute_callbacks(x,y);
  50.   if (x || y)
  51.     list.execute_callbacks(x,y);
  52.   }
  53.  
  54.