[svn:parrot] r46460 - trunk/examples/nci

plobsing at svn.parrot.org plobsing at svn.parrot.org
Mon May 10 05:54:56 UTC 2010


Author: plobsing
Date: Mon May 10 05:54:56 2010
New Revision: 46460
URL: https://trac.parrot.org/parrot/changeset/46460

Log:
eliminate .nci_call statements

Modified:
   trunk/examples/nci/sdl_blue_rectangle.pir

Modified: trunk/examples/nci/sdl_blue_rectangle.pir
==============================================================================
--- trunk/examples/nci/sdl_blue_rectangle.pir	Mon May 10 05:43:57 2010	(r46459)
+++ trunk/examples/nci/sdl_blue_rectangle.pir	Mon May 10 05:54:56 2010	(r46460)
@@ -33,19 +33,9 @@
     SDL_FillRect   = global ['SDL'; 'SDL_FillRect']
     new_SDL_Rect   = global "new_SDL_Rect"
 
-    .begin_call
-        .set_arg 65535
-        .nci_call SDL_Init
-    .end_call
-
-    .begin_call
-        .set_arg 640
-        .set_arg 480
-        .set_arg  0
-        .set_arg   0
-        .nci_call SetVideoMode
-        .result screen
-    .end_call
+    SDL_Init(65535)
+
+    screen = SetVideoMode(640, 480, 0, 0)
 
     .local object blue_rect
     #.local object blue_color
@@ -67,30 +57,15 @@
     set blue_rect['x'], 270
     set blue_rect['y'], 190
 
-    .begin_call
-        .set_arg screen
-        .set_arg blue_rect
-        .set_arg blue
-        .nci_call SDL_FillRect
-        .local int ok
-        .result ok
-    .end_call
+    .local int ok
+    ok = SDL_FillRect(screen, blue_rect, blue)
 
     # update full screen (all 0 arguments)
-    .begin_call
-        .set_arg screen
-        .set_arg 0
-        .set_arg 0
-        .set_arg 0
-        .set_arg 0
-        .nci_call SDL_UpdateRect
-    .end_call
+    SDL_UpdateRect(screen, 0, 0, 0, 0)
 
     sleep 2
 
-    .begin_call
-        .nci_call SDL_Quit
-    .end_call
+    SDL_Quit()
 
     .begin_return
     .end_return


More information about the parrot-commits mailing list