Author: bernhard
Date: Tue Dec 30 13:21:21 2008
New Revision: 34673

Modified:
   trunk/CREDITS
   trunk/examples/sdl/anim_image.pir
   trunk/examples/sdl/anim_image_dblbuf.pir
   trunk/examples/sdl/bounce_parrot_logo.pir
   trunk/examples/sdl/mandel.pir
   trunk/examples/sdl/move_parrot_logo.pir
   trunk/runtime/parrot/library/SDL.pir
   trunk/runtime/parrot/library/SDL/Event.pir

Log:
RT #61858: SDL library bindings and examples broken
Courtesy of Markus Mayr.


Modified: trunk/CREDITS
==============================================================================
--- trunk/CREDITS       (original)
+++ trunk/CREDITS       Tue Dec 30 13:21:21 2008
@@ -593,8 +593,9 @@
 N: Markus Amsler
 D: httpd.imc, bugfixes
 
-N: Markus Mays
+N: Markus Mayr
 D: Implementation of the Rational PMC
+D: Fixing SDL-bindings and examples
 
 N: Matt Diephouse
 U: mdiep

Modified: trunk/examples/sdl/anim_image.pir
==============================================================================
--- trunk/examples/sdl/anim_image.pir   (original)
+++ trunk/examples/sdl/anim_image.pir   Tue Dec 30 13:21:21 2008
@@ -94,7 +94,7 @@
     .local pmc rect
 
     .local pmc rect_array
-    rect_array = new Array
+    rect_array = new 'Array'
     set rect_array, 2
 
 _loop:

Modified: trunk/examples/sdl/anim_image_dblbuf.pir
==============================================================================
--- trunk/examples/sdl/anim_image_dblbuf.pir    (original)
+++ trunk/examples/sdl/anim_image_dblbuf.pir    Tue Dec 30 13:21:21 2008
@@ -21,7 +21,7 @@
 
     .local pmc app
     app = new 'SDL::App'
-    app.init( 'height' => 480, 'width' => 640, 'bpp' => 0, 'flags' => 
1073741825 )
+    app.'init'( 'height' => 480, 'width' => 640, 'bpp' => 0, 'flags' => 
1073741825 )
 
     .local pmc main_screen
     main_screen = app.'surface'()

Modified: trunk/examples/sdl/bounce_parrot_logo.pir
==============================================================================
--- trunk/examples/sdl/bounce_parrot_logo.pir   (original)
+++ trunk/examples/sdl/bounce_parrot_logo.pir   Tue Dec 30 13:21:21 2008
@@ -174,7 +174,7 @@
     .local pmc prev_rect
     .local pmc rect
     .local pmc rect_array
-    rect_array = new Array
+    rect_array = new 'Array'
     set rect_array, 2
 
     (prev_rect, rect) = sprite.'draw_undraw'( screen )

Modified: trunk/examples/sdl/mandel.pir
==============================================================================
--- trunk/examples/sdl/mandel.pir       (original)
+++ trunk/examples/sdl/mandel.pir       Tue Dec 30 13:21:21 2008
@@ -258,7 +258,7 @@
     flags |= .PARROT_CLONE_CLASSES
     thr.'run'(flags, raw_calc_f, h2, h, args)
     raw_calc(0, h2, args)
-    thr.join()
+    thr.'join'()
     main_screen.'unlock'()
     .return()
 plain:

Modified: trunk/examples/sdl/move_parrot_logo.pir
==============================================================================
--- trunk/examples/sdl/move_parrot_logo.pir     (original)
+++ trunk/examples/sdl/move_parrot_logo.pir     Tue Dec 30 13:21:21 2008
@@ -89,7 +89,7 @@
        .local pmc prev_rect
        .local pmc rect
        .local pmc rect_array
-       rect_array = new Array
+       rect_array = new 'Array'
        set rect_array, 2
 
        (prev_rect, rect) = sprite.'draw_undraw'( screen )

Modified: trunk/runtime/parrot/library/SDL.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL.pir        (original)
+++ trunk/runtime/parrot/library/SDL.pir        Tue Dec 30 13:21:21 2008
@@ -87,23 +87,19 @@
     .local pmc sdl_function
 
     loadlib libsdl, 'libSDL'
-    $I0 = typeof libsdl
-    if $I0 != .Undef goto OK
+    if libsdl goto OK
 
     # second try
     loadlib libsdl, 'libSDL-1.2'
-    $I0 = typeof libsdl
-    if $I0 != .Undef goto OK_HINT1
+    if libsdl goto OK_HINT1
 
     # third try
     loadlib libsdl, 'libSDL-1.2.so.0'
-    $I0 = typeof libsdl
-    if $I0 != .Undef goto OK_HINT2
+    if libsdl goto OK_HINT2
 
     # cygwin
     loadlib libsdl, 'cygSDL-1-2-0'
-    $I0 = typeof libsdl
-    if $I0 != .Undef goto OK
+    if libsdl goto OK
 
     # failed to load libSDL
     $P0 = new 'Exception'
@@ -180,20 +176,16 @@
     .local pmc nci_sub
 
     loadlib image_lib, 'libSDL_image'
-    $I0 = typeof image_lib
-    if $I0 != .Undef goto OK
+    if image_lib goto OK
 
     loadlib image_lib, 'libSDL_image-1.2'
-    $I0 = typeof image_lib
-    if $I0 != .Undef goto OK_HINT1
+    if image_lib goto OK_HINT1
 
     loadlib image_lib, 'libSDL_image-1.2.so.0'
-    $I0 = typeof image_lib
-    if $I0 != .Undef goto OK_HINT2
+    if image_lib goto OK_HINT2
 
     loadlib image_lib, 'cygSDL_image-1-2-0'
-    $I0 = typeof image_lib
-    if $I0 != .Undef goto OK
+    if image_lib goto OK
 
     # failed to load libSDL
     $P0 = new 'Exception'

Modified: trunk/runtime/parrot/library/SDL/Event.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Event.pir  (original)
+++ trunk/runtime/parrot/library/SDL/Event.pir  Tue Dec 30 13:21:21 2008
@@ -127,7 +127,7 @@
     .param int incoming_type
 
     .local pmc event_types
-    event_types = new OrderedHash
+    event_types = new 'OrderedHash'
 
     event_types[  0 ] = 'no_event'
     event_types[  1 ] = 'active_event'

Reply via email to