home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ Games Programming
/
CPPGAMES.ISO
/
thx
/
source
/
theatrix
/
jsfold.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-25
|
1KB
|
54 lines
#include "standard.h"
#include "jsfold.h"
void JoystickFolder::register_joystickbutton(Hand* hand,int b,callback cb)
{
if (b==BUTTONONE)
button1list.add(hand,cb);
else
button2list.add(hand,cb);
}
void JoystickFolder::unregister_joystickbutton(Hand* hand,int b,callback cb)
{
if (b==BUTTONONE)
button1list.del(hand,cb);
else
button2list.del(hand,cb);
}
void JoystickFolder::register_joystickmove(Hand* hand,callback cb)
{
list.add(hand,cb);
}
void JoystickFolder::unregister_joystickmove(Hand* hand,callback cb)
{
list.del(hand,cb);
}
void JoystickFolder::delHand(Hand* h)
{
button1list.delHand(h);
button2list.delHand(h);
list.delHand(h);
}
void JoystickFolder::reset()
{
button1list.reset();
button2list.reset();
list.reset();
}
void JoystickFolder::dispatch(int x, int y, int sw)
{
if (sw & 0x10)
button1list.execute_callbacks(x,y);
if (sw & 0x20)
button2list.execute_callbacks(x,y);
if (x || y)
list.execute_callbacks(x,y);
}