Finish MouseMotionEvent and fixed some tyops
Kartik Thakore [Sun, 8 Nov 2009 02:59:32 +0000 (21:59 -0500)]
src/Core/objects/ActiveEvent.xs
src/Core/objects/JoyHatEvent.xs
src/Core/objects/MouseMotionEvent.xs

index 09c3fa3..6fa0934 100644 (file)
@@ -69,7 +69,7 @@ aevent_state ( event, ... )
                RETVAL
 
 void
-uevent_DESTROY(self)
+aevent_DESTROY(self)
        SDL_ActiveEvent *self
        CODE:
                safefree( (char *)self );
index c4801ba..e14c34d 100644 (file)
@@ -58,6 +58,7 @@ jhevent_which ( event, ... )
 Uint8
 jhevent_hat ( event, ... )
        SDL_JoyHatEvent *event
+       CODE:
        if( items > 1 )
                {
                        event->hat = SvIV( ST(1) );
@@ -65,7 +66,6 @@ jhevent_hat ( event, ... )
                }
 
 
-       CODE: 
                RETVAL = event->hat;
        OUTPUT:
                RETVAL
index 4836df8..da80e6d 100644 (file)
@@ -45,6 +45,11 @@ Uint8
 mmevent_state ( event, ... )
        SDL_MouseMotionEvent *event
        CODE: 
+       if( items > 1 )
+               {
+                       event->state = SvIV( ST(1) );
+
+               }
                RETVAL = event->state;
        OUTPUT:
                RETVAL
@@ -53,6 +58,11 @@ Uint16
 mmevent_x ( event, ... )
        SDL_MouseMotionEvent *event
        CODE: 
+       if( items > 1 )
+               {
+                       event->x = SvIV( ST(1) );
+
+               }
                RETVAL = event->x;
        OUTPUT:
                RETVAL
@@ -61,6 +71,11 @@ Uint16
 mmevent_y ( event, ... )
        SDL_MouseMotionEvent *event
        CODE: 
+       if( items > 1 )
+               {
+                       event->y = SvIV( ST(1) );
+
+               }
                RETVAL = event->y;
        OUTPUT:
                RETVAL
@@ -69,14 +84,31 @@ Uint16
 mmevent_xrel ( event, ... )
        SDL_MouseMotionEvent *event
        CODE: 
+       if( items > 1 )
+               {
+                       event->xrel = SvIV( ST(1) );
+
+               }
                RETVAL = event->xrel;
        OUTPUT:
                RETVAL
 
+
 Uint16
 mmevent_yrel ( event, ... )
        SDL_MouseMotionEvent *event
        CODE: 
+       if( items > 1 )
+               {
+                       event->yrel = SvIV( ST(1) );
+
+               }
                RETVAL = event->yrel;
        OUTPUT:
                RETVAL
+
+void
+mmtevent_DESTROY(self)
+       SDL_MouseMotionEvent *self
+       CODE:
+               safefree( (char *)self );