From: Kartik Thakore Date: Sun, 8 Nov 2009 01:04:23 +0000 (-0500) Subject: Finished up ExposeEvent, JoyAxisEvent, and JoyBallEvent. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=984ef389938ba80bd0f0413122199699b0a08576;p=sdlgit%2FSDL_perl.git Finished up ExposeEvent, JoyAxisEvent, and JoyBallEvent. --- diff --git a/src/Core/objects/ExposeEvent.xs b/src/Core/objects/ExposeEvent.xs index 1ba38e2..eac183c 100644 --- a/src/Core/objects/ExposeEvent.xs +++ b/src/Core/objects/ExposeEvent.xs @@ -37,3 +37,9 @@ weevent_type ( event, ... ) RETVAL = event->type; OUTPUT: RETVAL + +void +weevent_DESTROY(self) + SDL_ExposeEvent *self + CODE: + safefree( (char *)self ); diff --git a/src/Core/objects/JoyAxisEvent.xs b/src/Core/objects/JoyAxisEvent.xs index b19b9f6..fa51e98 100644 --- a/src/Core/objects/JoyAxisEvent.xs +++ b/src/Core/objects/JoyAxisEvent.xs @@ -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 ); diff --git a/src/Core/objects/JoyBallEvent.xs b/src/Core/objects/JoyBallEvent.xs index 7ef2a02..eb50e35 100644 --- a/src/Core/objects/JoyBallEvent.xs +++ b/src/Core/objects/JoyBallEvent.xs @@ -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 ); diff --git a/t/core_events.t b/t/core_events.t index 9866d98..a4a9bcf 100644 --- a/t/core_events.t +++ b/t/core_events.t @@ -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