[svn:parrot] r37182 - in trunk/runtime/parrot/library: . SDL
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Sat Mar 7 20:47:52 UTC 2009
Author: fperrad
Date: Sat Mar 7 20:47:50 2009
New Revision: 37182
URL: https://trac.parrot.org/parrot/changeset/37182
Log:
[SDL] update PIR syntax (part of TT #411)
Modified:
trunk/runtime/parrot/library/SDL.pir
trunk/runtime/parrot/library/SDL/App.pir
trunk/runtime/parrot/library/SDL/Color.pir
trunk/runtime/parrot/library/SDL/Constants.pir
trunk/runtime/parrot/library/SDL/Event.pir
trunk/runtime/parrot/library/SDL/Font.pir
trunk/runtime/parrot/library/SDL/Image.pir
trunk/runtime/parrot/library/SDL/LCD.pir
trunk/runtime/parrot/library/SDL/Rect.pir
trunk/runtime/parrot/library/SDL/Surface.pir
Modified: trunk/runtime/parrot/library/SDL.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -53,7 +53,7 @@
.macro store_nci_func( func_name, signature )
c_func_name = prefix . .func_name
dlfunc c_function, libsdl, c_func_name, .signature
- store_global namespace, .func_name, c_function
+ set_hll_global ['SDL::NCI'], .func_name, c_function
.endm
.sub _sdl_init :load
@@ -61,7 +61,7 @@
.local pmc layouts
layouts = new 'OrderedHash'
- store_global 'SDL::NCI', 'layouts', layouts
+ set_hll_global ['SDL::NCI'], 'layouts', layouts
# this order matters; trust me!
_set_Event_layout( layouts )
@@ -124,43 +124,43 @@
.store_nci_func( 'Init', 'ii' )
# dlfunc sdl_function, libsdl, 'SDL_Init', 'ii'
-# store_global 'SDL::NCI', 'Init', sdl_function
+# set_hll_global ['SDL::NCI'], 'Init', sdl_function
dlfunc sdl_function, libsdl, 'SDL_SetVideoMode', 'piiil'
- store_global 'SDL::NCI', 'SetVideoMode', sdl_function
+ set_hll_global ['SDL::NCI'], 'SetVideoMode', sdl_function
dlfunc sdl_function, libsdl, 'SDL_Quit', 'v'
- store_global 'SDL::NCI', 'Quit', sdl_function
+ set_hll_global ['SDL::NCI'], 'Quit', sdl_function
dlfunc sdl_function, libsdl, 'SDL_FillRect', 'ippi'
- store_global 'SDL::NCI', 'FillRect', sdl_function
+ set_hll_global ['SDL::NCI'], 'FillRect', sdl_function
dlfunc sdl_function, libsdl, 'SDL_UpdateRect', 'vpiiii'
- store_global 'SDL::NCI', 'UpdateRect', sdl_function
+ set_hll_global ['SDL::NCI'], 'UpdateRect', sdl_function
dlfunc sdl_function, libsdl, 'SDL_UpdateRects', 'vpip'
- store_global 'SDL::NCI', 'UpdateRects', sdl_function
+ set_hll_global ['SDL::NCI'], 'UpdateRects', sdl_function
dlfunc sdl_function, libsdl, 'SDL_Flip', 'ip'
- store_global 'SDL::NCI', 'Flip', sdl_function
+ set_hll_global ['SDL::NCI'], 'Flip', sdl_function
dlfunc sdl_function, libsdl, 'SDL_FreeSurface', 'vp'
- store_global 'SDL::NCI', 'FreeSurface', sdl_function
+ set_hll_global ['SDL::NCI'], 'FreeSurface', sdl_function
dlfunc sdl_function, libsdl, 'SDL_LoadBMP_RW', 'ppi'
- store_global 'SDL::NCI', 'LoadBMP_RW', sdl_function
+ set_hll_global ['SDL::NCI'], 'LoadBMP_RW', sdl_function
dlfunc sdl_function, libsdl, 'SDL_DisplayFormat', 'pp'
- store_global 'SDL::NCI', 'DisplayFormat', sdl_function
+ set_hll_global ['SDL::NCI'], 'DisplayFormat', sdl_function
dlfunc sdl_function, libsdl, 'SDL_UpperBlit', 'ipppp'
- store_global 'SDL::NCI', 'BlitSurface', sdl_function
+ set_hll_global ['SDL::NCI'], 'BlitSurface', sdl_function
dlfunc sdl_function, libsdl, 'SDL_WaitEvent', 'ip'
- store_global 'SDL::NCI', 'WaitEvent', sdl_function
+ set_hll_global ['SDL::NCI'], 'WaitEvent', sdl_function
dlfunc sdl_function, libsdl, 'SDL_PollEvent', 'ip'
- store_global 'SDL::NCI', 'PollEvent', sdl_function
+ set_hll_global ['SDL::NCI'], 'PollEvent', sdl_function
dlfunc sdl_function, libsdl, 'SDL_GetKeyName', 'ti'
- store_global 'SDL::NCI', 'GetKeyName', sdl_function
+ set_hll_global ['SDL::NCI'], 'GetKeyName', sdl_function
dlfunc sdl_function, libsdl, 'SDL_GetError', 'tv'
- store_global 'SDL::NCI', 'GetError', sdl_function
+ set_hll_global ['SDL::NCI'], 'GetError', sdl_function
dlfunc sdl_function, libsdl, 'SDL_SetColorKey', 'ipii'
- store_global 'SDL::NCI', 'SetColorKey', sdl_function
+ set_hll_global ['SDL::NCI'], 'SetColorKey', sdl_function
dlfunc sdl_function, libsdl, 'SDL_LockSurface', 'ip'
- store_global 'SDL::NCI', 'LockSurface', sdl_function
+ set_hll_global ['SDL::NCI'], 'LockSurface', sdl_function
dlfunc sdl_function, libsdl, 'SDL_UnlockSurface', 'vp'
- store_global 'SDL::NCI', 'UnlockSurface', sdl_function
+ set_hll_global ['SDL::NCI'], 'UnlockSurface', sdl_function
dlfunc sdl_function, libsdl, 'SDL_CreateRGBSurface', 'piiiiiiii'
- store_global 'SDL::NCI', 'CreateRGBSurface', sdl_function
+ set_hll_global ['SDL::NCI'], 'CreateRGBSurface', sdl_function
.end
=item _init_image()
@@ -199,7 +199,7 @@
printerr "Hint: create a link from libSDL_image-1.2.so.0 to libSDL_image.so to disable the error messages.\n"
OK:
dlfunc nci_sub, image_lib, 'IMG_Load', 'pt'
- store_global 'SDL::NCI', 'IMG_Load', nci_sub
+ set_hll_global ['SDL::NCI'], 'IMG_Load', nci_sub
.end
=item _init_ttf()
@@ -224,7 +224,7 @@
dlfunc nci_sub, ttf_lib, 'TTF_Init', 'iv'
unless nci_sub goto error
- store_global 'SDL::NCI::TTF', 'Init', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'Init', nci_sub
# TTF_init() returns 0 if successful, -1 on error
.local int initialized
@@ -240,30 +240,30 @@
success:
dlfunc nci_sub, ttf_lib, 'TTF_OpenFont', 'pti'
- store_global 'SDL::NCI::TTF', 'OpenFont', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'OpenFont', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_RenderText_Solid', 'pptp'
- store_global 'SDL::NCI::TTF', 'RenderText_Solid', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'RenderText_Solid', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_RenderUTF8_Solid', 'pptp'
- store_global 'SDL::NCI::TTF', 'RenderUTF8_Solid', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'RenderUTF8_Solid', nci_sub
# this one could be wrong
dlfunc nci_sub, ttf_lib, 'TTF_RenderUNICODE_Solid', 'pptp'
- store_global 'SDL::NCI::TTF', 'RenderUNICODE_Solid', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'RenderUNICODE_Solid', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_SizeText', 'ipt33'
- store_global 'SDL::NCI::TTF', 'SizeText', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'SizeText', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_SizeUTF8', 'ipt33'
- store_global 'SDL::NCI::TTF', 'SizeUTF8', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'SizeUTF8', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_SizeUNICODE', 'ipt33'
- store_global 'SDL::NCI::TTF', 'SizeUNICODE', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'SizeUNICODE', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_CloseFont', 'vp'
- store_global 'SDL::NCI::TTF', 'CloseFont', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'CloseFont', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_Quit', 'vv'
- store_global 'SDL::NCI::TTF', 'Quit', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'Quit', nci_sub
dlfunc nci_sub, ttf_lib, 'TTF_WasInit', 'iv'
- store_global 'SDL::NCI::TTF', 'WasInit', nci_sub
+ set_hll_global ['SDL::NCI::TTF'], 'WasInit', nci_sub
.end
.sub _set_Event_layout
@@ -407,7 +407,7 @@
.param pmc layouts
.local pmc fetch_struct
- fetch_struct = find_global 'SDL::NCI', 'fetch_struct'
+ fetch_struct = get_hll_global ['SDL::NCI'], 'fetch_struct'
.local pmc rect
rect = fetch_struct( 'Rect', 0 )
@@ -431,7 +431,7 @@
.param pmc layouts
.local pmc fetch_struct
- fetch_struct = find_global 'SDL::NCI', 'fetch_struct'
+ fetch_struct = get_hll_global ['SDL::NCI'], 'fetch_struct'
# SDL_PixelFormat struct pointer
.local pmc pixelformat
@@ -531,7 +531,7 @@
.param pmc layouts
.local pmc fetch_struct
- fetch_struct = find_global 'SDL::NCI', 'fetch_struct'
+ fetch_struct = get_hll_global ['SDL::NCI'], 'fetch_struct'
.local pmc palette
palette = fetch_struct( 'Palette', 0 )
@@ -603,7 +603,7 @@
.param pmc layouts
.local pmc fetch_struct
- fetch_struct = find_global 'SDL::NCI', 'fetch_struct'
+ fetch_struct = get_hll_global ['SDL::NCI'], 'fetch_struct'
.local pmc color
color = fetch_struct( 'Color', 0 )
@@ -703,8 +703,8 @@
.local pmc initializer
.local pmc struct
- .local pmc fetch_layout
- fetch_layout = find_global 'SDL::NCI', 'fetch_layout'
+# .local pmc fetch_layout
+# fetch_layout = get_hll_global ['SDL::NCI'], 'fetch_layout'
initializer = fetch_layout( struct_name )
if managed == 1 goto build_managed
@@ -724,7 +724,7 @@
.local pmc layouts
.local pmc layout
- layouts = find_global 'SDL::NCI', 'layouts'
+ layouts = get_hll_global ['SDL::NCI'], 'layouts'
exists $I0, layouts[ layout_name ]
if $I0 goto found
Modified: trunk/runtime/parrot/library/SDL/App.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/App.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/App.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -121,7 +121,7 @@
.param int flags :named('flags')
.local pmc SetVideoMode
- SetVideoMode = find_global 'SDL::NCI', 'SetVideoMode'
+ SetVideoMode = get_hll_global ['SDL::NCI'], 'SetVideoMode'
.local pmc screen
screen = SetVideoMode( width, height, bpp, flags )
@@ -178,7 +178,7 @@
.sub quit :method
.local pmc SDL_Quit
- SDL_Quit = find_global 'SDL::NCI', 'Quit'
+ SDL_Quit = get_hll_global ['SDL::NCI'], 'Quit'
SDL_Quit()
.end
Modified: trunk/runtime/parrot/library/SDL/Color.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Color.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/Color.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -86,7 +86,7 @@
.param int blue :named( 'b' )
.local pmc fetch_layout
- find_global fetch_layout, 'SDL::NCI', 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
.local pmc layout
layout = fetch_layout( 'Color' )
Modified: trunk/runtime/parrot/library/SDL/Constants.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Constants.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/Constants.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -47,7 +47,7 @@
key_names = new 'FixedPMCArray'
key_names = 323
- store_global 'SDL::Constants', 'key_names', key_names
+ set_hll_global ['SDL::Constants'], 'key_names', key_names
# list created with:
# $ cat /usr/include/SDL/SDL_keysym.h |
Modified: trunk/runtime/parrot/library/SDL/Event.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Event.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/Event.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -60,7 +60,7 @@
.sub 'init' :method
.local pmc fetch_layout
- find_global fetch_layout, 'SDL::NCI', 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
.local pmc layout
layout = fetch_layout( 'Event::Generic' )
@@ -92,7 +92,7 @@
assign_event:
.local pmc fetch_layout
- find_global fetch_layout, 'SDL::NCI', 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
.local pmc layout
.local string ename
@@ -189,7 +189,7 @@
key_sym = event['sym']
.local pmc key_names
- find_global key_names, 'SDL::Constants', 'key_names'
+ get_hll_global key_names, ['SDL::Constants'], 'key_names'
.local string key_name
key_name = key_names[ key_sym ]
@@ -241,13 +241,13 @@
if check_interval < 0.0001 goto use_wait
polling = 1
- GetEvent = find_global 'SDL::NCI', 'PollEvent'
+ GetEvent = get_hll_global ['SDL::NCI'], 'PollEvent'
branch loop
use_wait:
polling = 0
- GetEvent = find_global 'SDL::NCI', 'WaitEvent'
+ GetEvent = get_hll_global ['SDL::NCI'], 'WaitEvent'
loop:
event = self.'event'( 'Generic' )
@@ -288,7 +288,7 @@
event = self.'event'()
.local pmc PollEvent
- find_global PollEvent, 'SDL::NCI', 'PollEvent'
+ get_hll_global PollEvent, ['SDL::NCI'], 'PollEvent'
.local int event_waiting
event_waiting = PollEvent( event )
Modified: trunk/runtime/parrot/library/SDL/Font.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Font.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/Font.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -39,7 +39,7 @@
.sub _sdl_init :load
.local pmc init_ttf
- init_ttf = find_global 'SDL', '_init_ttf'
+ init_ttf = get_hll_global ['SDL'], '_init_ttf'
init_ttf()
.local pmc font_class
@@ -65,7 +65,7 @@
.param int font_size :named( 'point_size' )
.local pmc OpenFont
- OpenFont = find_global 'SDL::NCI::TTF', 'OpenFont'
+ OpenFont = get_hll_global ['SDL::NCI::TTF'], 'OpenFont'
.local pmc font
font = OpenFont( font_name, font_size )
@@ -137,7 +137,7 @@
font_surface.'init'( 'height' => 0, 'width' => 0 )
.local pmc RenderText_Solid
- find_global RenderText_Solid, 'SDL::NCI::TTF', 'RenderText_Solid'
+ get_hll_global RenderText_Solid, ['SDL::NCI::TTF'], 'RenderText_Solid'
.local pmc color
color = color_pmc.'color'()
Modified: trunk/runtime/parrot/library/SDL/Image.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Image.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/Image.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -44,7 +44,7 @@
create_class:
.local pmc init_image
- init_image = find_global 'SDL', '_init_image'
+ init_image = get_hll_global ['SDL'], '_init_image'
init_image()
subclass image_class, 'SDL::Surface', 'SDL::Image'
@@ -62,7 +62,7 @@
.param string filename :named( 'file' )
.local pmc IMG_Load
- IMG_Load = find_global 'SDL::NCI', 'IMG_Load'
+ IMG_Load = get_hll_global ['SDL::NCI'], 'IMG_Load'
.local pmc image
Modified: trunk/runtime/parrot/library/SDL/LCD.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/LCD.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/LCD.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -51,7 +51,7 @@
.local pmc digits
digits = new 'SDL::Image'
digits.'init'( 'runtime/parrot/library/SDL/LCD.png' )
- global 'digits' = digits
+ set_global 'digits', digits
newclass class, 'SDL::LCD'
addattribute class, 'value'
@@ -176,7 +176,7 @@
drect.'x'( 0 )
drect.'y'( 0 )
- digits = find_global 'digits'
+ digits = get_global 'digits'
i = 0
LOOP:
@@ -256,7 +256,6 @@
.sub xpos :method
.param int val
- $I0 = classoffset self, "SDL::LCD"
$P0 = getattribute self, 'xpos'
$P0 = val
.end
Modified: trunk/runtime/parrot/library/SDL/Rect.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Rect.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/Rect.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -105,7 +105,7 @@
check_done:
.local pmc fetch_layout
- find_global fetch_layout, 'SDL::NCI', 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
.local pmc layout
layout = fetch_layout( 'Rect' )
Modified: trunk/runtime/parrot/library/SDL/Surface.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Surface.pir Sat Mar 7 20:40:58 2009 (r37181)
+++ trunk/runtime/parrot/library/SDL/Surface.pir Sat Mar 7 20:47:50 2009 (r37182)
@@ -92,7 +92,7 @@
alpha = 0
create_surface:
- SDL_CreateRGBSurface = find_global 'SDL::NCI', 'CreateRGBSurface'
+ SDL_CreateRGBSurface = get_hll_global ['SDL::NCI'], 'CreateRGBSurface'
.local pmc surface
surface = SDL_CreateRGBSurface( flags, width, height, depth, red, green, blue, alpha )
@@ -115,7 +115,7 @@
.param pmc surface_struct
.local pmc fetch_layout
- find_global fetch_layout, 'SDL::NCI', 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
.local pmc layout
layout = fetch_layout( 'Surface' )
@@ -207,7 +207,7 @@
.param pmc color_object
.local pmc SDL_FillRect
- SDL_FillRect = find_global 'SDL::NCI', 'FillRect'
+ SDL_FillRect = get_hll_global ['SDL::NCI'], 'FillRect'
.local pmc surface
getattribute surface, self, 'surface'
@@ -248,7 +248,7 @@
width = rect.'width'()
.local pmc SDL_UpdateRect
- SDL_UpdateRect = find_global 'SDL::NCI', 'UpdateRect'
+ SDL_UpdateRect = get_hll_global ['SDL::NCI'], 'UpdateRect'
SDL_UpdateRect( surface, x, y, width, height )
.end
@@ -267,7 +267,7 @@
set count, rects
.local pmc fetch_layout
- find_global fetch_layout, 'SDL::NCI', 'fetch_layout'
+ get_hll_global fetch_layout, ['SDL::NCI'], 'fetch_layout'
.local pmc rect_array_layout
@@ -309,7 +309,7 @@
getattribute surface, self, 'surface'
.local pmc UpdateRects
- UpdateRects = find_global 'SDL::NCI', 'UpdateRects'
+ UpdateRects = get_hll_global ['SDL::NCI'], 'UpdateRects'
UpdateRects( surface, count, rect_array )
.end
@@ -327,7 +327,7 @@
getattribute surface, self, 'surface'
.local pmc SDL_Flip
- SDL_Flip = find_global 'SDL::NCI', 'Flip'
+ SDL_Flip = get_hll_global ['SDL::NCI'], 'Flip'
SDL_Flip( surface )
@@ -351,7 +351,7 @@
.param pmc dest
.local pmc SDL_BlitSurface
- SDL_BlitSurface = find_global 'SDL::NCI', 'BlitSurface'
+ SDL_BlitSurface = get_hll_global ['SDL::NCI'], 'BlitSurface'
.local pmc source_surface
.local pmc dest_surface
@@ -400,7 +400,7 @@
getattribute surface, self, 'surface'
.local pmc SetColorKey
- SetColorKey = find_global 'SDL::NCI', 'SetColorKey'
+ SetColorKey = get_hll_global ['SDL::NCI'], 'SetColorKey'
SetColorKey( surface, 8, color_value )
.end
@@ -435,7 +435,7 @@
surface = self.'surface'()
.local pmc LockSurface
- find_global LockSurface, 'SDL::NCI', 'LockSurface'
+ get_hll_global LockSurface, ['SDL::NCI'], 'LockSurface'
LockSurface( surface )
@@ -453,7 +453,7 @@
surface = self.'surface'()
.local pmc UnlockSurface
- find_global UnlockSurface, 'SDL::NCI', 'UnlockSurface'
+ get_hll_global UnlockSurface, ['SDL::NCI'], 'UnlockSurface'
UnlockSurface( surface )
More information about the parrot-commits
mailing list