Finished up ExposeEvent, JoyAxisEvent, and JoyBallEvent.
Kartik Thakore [Sun, 8 Nov 2009 01:04:23 +0000 (20:04 -0500)]
src/Core/objects/ExposeEvent.xs
src/Core/objects/JoyAxisEvent.xs
src/Core/objects/JoyBallEvent.xs
t/core_events.t

index 1ba38e2..eac183c 100644 (file)
@@ -37,3 +37,9 @@ weevent_type ( event, ... )
                RETVAL = event->type;
        OUTPUT:
                RETVAL
+
+void
+weevent_DESTROY(self)
+       SDL_ExposeEvent *self
+       CODE:
+               safefree( (char *)self );
index b19b9f6..fa51e98 100644 (file)
@@ -45,6 +45,12 @@ Uint8
 jaevent_which ( event, ... )
        SDL_JoyAxisEvent *event
        CODE: 
+               if( items > 1 )
+               {
+                       event->which = SvIV( ST(1) );
+
+               }
+
                RETVAL = event->which;
        OUTPUT:
                RETVAL
@@ -52,7 +58,13 @@ jaevent_which ( event, ... )
 Uint8
 jaevent_axis ( event, ... )
        SDL_JoyAxisEvent *event
-       CODE: 
+       CODE:
+               if( items > 1 )
+               {
+                       event->axis = SvIV( ST(1) );
+
+               }
+
                RETVAL = event->axis;
        OUTPUT:
                RETVAL
@@ -61,6 +73,18 @@ Sint16
 jaevent_value ( event, ... )
        SDL_JoyAxisEvent *event
        CODE: 
+               if( items > 1 )
+               {
+                       event->value = SvIV( ST(1) );
+
+               }
+
                RETVAL = event->value;
        OUTPUT:
                RETVAL
+
+void
+jaevent_DESTROY(self)
+       SDL_JoyAxisEvent *self
+       CODE:
+               safefree( (char *)self );
index 7ef2a02..eb50e35 100644 (file)
@@ -45,6 +45,12 @@ Uint8
 jtevent_which ( event, ... )
        SDL_JoyBallEvent *event
        CODE: 
+               if( items > 1 )
+               {
+                       event->which = SvIV( ST(1) );
+
+               }
+               
                RETVAL = event->which;
        OUTPUT:
                RETVAL
@@ -52,7 +58,14 @@ jtevent_which ( event, ... )
 Uint8
 jtevent_ball ( event, ... )
        SDL_JoyBallEvent *event
-       CODE: 
+       CODE:
+               if( items > 1 )
+               {
+                       event->ball = SvIV( ST(1) );
+
+               }
+               
                RETVAL = event->ball;
        OUTPUT:
                RETVAL
@@ -61,6 +74,12 @@ Sint16
 jtevent_xrel ( event, ... )
        SDL_JoyBallEvent *event
        CODE: 
+               if( items > 1 )
+               {
+                       event->xrel = SvIV( ST(1) );
+
+               }
+
                RETVAL = event->xrel;
        OUTPUT:
                RETVAL
@@ -69,6 +88,19 @@ Sint16
 jtevent_yrel ( event, ... )
        SDL_JoyBallEvent *event
        CODE: 
+               if( items > 1 )
+               {
+                       event->yrel = SvIV( ST(1) );
+
+               }
+
+
                RETVAL = event->yrel;
        OUTPUT:
                RETVAL
+
+void
+jtevent_DESTROY(self)
+       SDL_JoyBallEvent *self
+       CODE:
+               safefree( (char *)self );
index 9866d98..a4a9bcf 100644 (file)
@@ -23,6 +23,7 @@ plan ( tests => 51 );
 
 my @done =qw/
 pump_events 
+peep_events 
 /;
 
 my @done_event =qw/
@@ -169,7 +170,6 @@ is(SDL::Events::wait_event(), 1,  '[wait_event] Returns 1 on success');
 
 
 my @left = qw/
-peep_events 
 poll_event
 push_event
 wait_event