Author: jquelin
Date: Wed Oct 3 10:10:58 2007
New Revision: 21793
Modified:
branches/pdd15oo/examples/sdl/lcd/clock.pir
branches/pdd15oo/examples/sdl/mandel.pir
branches/pdd15oo/examples/sdl/move_parrot_logo.pir
branches/pdd15oo/examples/sdl/raw_pixels.pir
Log:
more find_type removal
Modified: branches/pdd15oo/examples/sdl/lcd/clock.pir
==============================================================================
--- branches/pdd15oo/examples/sdl/lcd/clock.pir (original)
+++ branches/pdd15oo/examples/sdl/lcd/clock.pir Wed Oct 3 10:10:58 2007
@@ -39,14 +39,12 @@
$P0["flags"] = 5
# create the SDL application object
- $I0 = find_type "SDL::App"
- $P0 = new $I0, $P0
+ $P0 = new 'SDL::App', $P0
$P0 = $P0."surface"()
global "screen" = $P0
# create the LCD
- $I0 = find_type "SDL::LCD"
- $P0 = new $I0
+ $P0 = new 'SDL::LCD'
global "LCD" = $P0
# draw the watch
@@ -69,10 +67,8 @@
.local pmc eh
.local pmc loop
- find_type $I0, "SDL::EventHandler"
- eh = new $I0
- find_type $I0, "SDL::Event"
- loop = new $I0
+ eh = new "SDL::EventHandler"
+ loop = new "SDL::Event"
loop."process_events"( 0.1, eh )
.end
Modified: branches/pdd15oo/examples/sdl/mandel.pir
==============================================================================
--- branches/pdd15oo/examples/sdl/mandel.pir (original)
+++ branches/pdd15oo/examples/sdl/mandel.pir Wed Oct 3 10:10:58 2007
@@ -436,8 +436,7 @@
.sub create_palette :method
.local pmc palette, col, main_screen
main_screen = self.'surface'()
- .local int r, g, b, color_type
- find_type color_type, 'SDL::Color'
+ .local int r, g, b
palette = new 'ResizablePMCArray'
r = 0
loop_r:
@@ -445,7 +444,7 @@
loop_g:
b = 0
loop_b:
- col = new color_type
+ col = new 'SDL::Color'
col.'init'( 'r' => r, 'g' => g, 'b' => b )
push palette, col
b += 36
Modified: branches/pdd15oo/examples/sdl/move_parrot_logo.pir
==============================================================================
--- branches/pdd15oo/examples/sdl/move_parrot_logo.pir (original)
+++ branches/pdd15oo/examples/sdl/move_parrot_logo.pir Wed Oct 3 10:10:58 2007
@@ -23,8 +23,7 @@
.local pmc app
.local int app_type
- find_type app_type, 'SDL::App'
- app = new app_type
+ app = new 'SDL::App'
app.'init'( 'width' => 640, 'height' => 480, 'bpp' => 0, 'flags' => 0 )
@@ -34,8 +33,7 @@
.local pmc black
.local int color_type
- find_type color_type, 'SDL::Color'
- black = new color_type
+ black = new 'SDL::Color'
black.'init'( 'r' => 0, 'g' => 0, 'b' => 0 )
.local pmc image
@@ -43,8 +41,7 @@
.local string filename
- find_type image_type, 'SDL::Image'
- image = new image_type
+ image = new 'SDL::Image'
filename = 'examples/sdl/parrot_small.png'
image.'init'( 'file' => filename )
@@ -54,8 +51,7 @@
.local pmc sprite
.local int sprite_type
- find_type sprite_type, 'SDL::Sprite'
- sprite = new sprite_type
+ sprite = new 'SDL::Sprite'
sprite.'init'( 'surface' => image, 'source_x' => 0, 'source_y' =>
0, 'dest_x' => 270, 'dest_y' => 212, 'bgcolor' => black )
.local pmc parent_class
@@ -66,14 +62,12 @@
.local pmc event_handler
.local int handler_type
- find_type handler_type, 'MoveLogo::EventHandler'
- event_handler = new handler_type
+ event_handler = new 'MoveLogo::EventHandler'
.local pmc event
.local int event_type
- find_type event_type, 'SDL::Event'
- event = new event_type
+ event = new 'SDL::Event'
event.'init'()
.local pmc handler_args
Modified: branches/pdd15oo/examples/sdl/raw_pixels.pir
==============================================================================
--- branches/pdd15oo/examples/sdl/raw_pixels.pir (original)
+++ branches/pdd15oo/examples/sdl/raw_pixels.pir Wed Oct 3 10:10:58 2007
@@ -24,8 +24,7 @@
.local pmc app
.local int app_type
- find_type app_type, 'SDL::App'
- app = new app_type
+ app = new 'SDL::App'
app.'init'( 'height' => 480, 'width' => 640, 'bpp' => 0, 'flags' => 1 )
# fetch the SDL::Surface representing the main window
@@ -36,21 +35,17 @@
# create an SDL::Rect representing the entire main screen
.local pmc rect
.local int rect_type
- find_type rect_type, 'SDL::Rect'
- rect = new rect_type
+ rect = new 'SDL::Rect'
rect.'init'( 'height' => 480, 'width' => 640, 'x' => 0, 'y' => 0 )
- .local int color_type
- find_type color_type, 'SDL::Color'
-
# create a white color to paint the background; make new pixels show up
.local pmc white
- white = new color_type
+ white = new 'SDL::Color'
white.'init'( 'r' => 255, 'g' => 255, 'b' => 255 )
# create a blue color to paint the new pixels
.local pmc blue
- blue = new color_type
+ blue = new 'SDL::Color'
blue.'init'( 'r' => 0, 'g' => 0, 'b' => 255 )
# draw the background