Author: bernhard
Date: Mon Apr 24 12:25:04 2006
New Revision: 12412
Modified:
trunk/runtime/parrot/library/SDL/App.pir
trunk/runtime/parrot/library/SDL/Button.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/EventHandler.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/Sprite.pir
trunk/runtime/parrot/library/SDL/StopWatch.pir
trunk/runtime/parrot/library/SDL/Surface.pir
Log:
Replace Perl PMC in the SDL with their standard counterparts.
Some SDL examples are still working, the others already were broken.
Modified: trunk/runtime/parrot/library/SDL/App.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/App.pir (original)
+++ trunk/runtime/parrot/library/SDL/App.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::App - Parrot extension for SDL Applications
@@ -16,7 +19,7 @@
# set the app's arguments
.local pmc app_args
- app_args = new PerlHash
+ app_args = new .Hash
app_args[ 'height' ] = 480
app_args[ 'width' ] = 640
app_args[ 'bpp' ] = 0
@@ -76,7 +79,7 @@
addattribute app_class, 'surface'
.local pmc initializer
- new initializer, .PerlString
+ new initializer, .String
initializer = '_new'
setprop app_class, 'BUILD', initializer
@@ -85,7 +88,7 @@
=item _new( app_args )
Initialize the new object with the necessary arguments. The single argument,
-C<app_args>, should be a C<PerlHash> PMC containing the following keys:
+C<app_args>, should be a C<Hash> PMC containing the following keys:
=over 4
@@ -154,21 +157,21 @@
# set all other offsets in self
classoffset offset, self, 'SDL::App'
- intvalue = new PerlInt
+ intvalue = new .Integer
set intvalue, height
setattribute self, offset, intvalue
- intvalue = new PerlInt
+ intvalue = new .Integer
set intvalue, width
inc offset
setattribute self, offset, intvalue
- intvalue = new PerlInt
+ intvalue = new .Integer
set intvalue, bpp
inc offset
setattribute self, offset, intvalue
- intvalue = new PerlInt
+ intvalue = new .Integer
set intvalue, flags
inc offset
setattribute self, offset, intvalue
@@ -284,6 +287,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Button.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Button.pir (original)
+++ trunk/runtime/parrot/library/SDL/Button.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Button - A multi state SDL Button
@@ -5,7 +8,7 @@
=head1 SYNOPSIS
# the image to use for the button
- $P0 = new PerlString
+ $P0 = new .String
$P0 = "filename/to/image.png"
# create the button
@@ -72,13 +75,13 @@
# status
inc $I0
- $P0 = new PerlInt
+ $P0 = new .Integer
$P0 = 0
setattribute self, $I0, $P0
# states
inc $I0
- $P0 = new PerlInt
+ $P0 = new .Integer
$P0 = 1
setattribute self, $I0, $P0
@@ -90,13 +93,13 @@
# clicked
inc $I0
- $P0 = new PerlInt
+ $P0 = new .Integer
$P0 = 0
setattribute self, $I0, $P0
# actions
inc $I0
- $P0 = new PerlArray
+ $P0 = new .ResizablePMCArray
setattribute self, $I0, $P0
.end
@@ -330,6 +333,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Color.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Color.pir (original)
+++ trunk/runtime/parrot/library/SDL/Color.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Color - Parrot class representing colors in Parrot SDL
@@ -15,7 +18,7 @@
# set the color values; this one's blue
.local pmc color_args
- color_args = new PerlHash
+ color_args = new .Hash
color_args[ 'r' ] = 0
color_args[ 'g' ] = 0
@@ -62,7 +65,7 @@
addattribute color_class, 'b'
.local pmc initializer
- new initializer, .PerlString
+ new initializer, .String
initializer = '_new'
setprop color_class, 'BUILD', initializer
@@ -71,7 +74,7 @@
=item _new( color_args )
Initialize the new object with the necessary arguments, The single argument,
-C<color_args>, should be a C<PerlHash> PMC containing the following keys:
+C<color_args>, should be a C<Hash> PMC containing the following keys:
=over 4
@@ -108,10 +111,10 @@
.local int offset
- color = new PerlInt
- red = new PerlInt
- green = new PerlInt
- blue = new PerlInt
+ color = new .Integer
+ red = new .Integer
+ green = new .Integer
+ blue = new .Integer
arg_color = args['r']
red = arg_color
@@ -241,6 +244,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Constants.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Constants.pir (original)
+++ trunk/runtime/parrot/library/SDL/Constants.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Constants - constants used in Parrot SDL
@@ -300,6 +303,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Event.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Event.pir (original)
+++ trunk/runtime/parrot/library/SDL/Event.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Event - Parrot extension representing SDL Events
@@ -48,7 +51,7 @@
addattribute event_class, 'event'
.local pmc initializer
- new initializer, .PerlString
+ new initializer, .String
set initializer, 'BUILD'
setprop event_class, 'BUILD', initializer
@@ -229,7 +232,7 @@
=item process_events( event_handler, handler_args, [ check_interval ] )
Given an C<event_handler> object (either subclassing C<SDL::EventHandler> or
-implementing its necessary methods) and a C<PerlHash> of arguments to pass to
+implementing its necessary methods) and a C<Hash> of arguments to pass to
all event handlers, loops around SDL's event loop and calls appropriate methods
in C<event_handler> corresponding to what happens.
@@ -292,7 +295,7 @@
=item handle_event( event_handler, handler_args )
Given an C<event_handler> object (either subclass L<SDL::EventHandler> or
-reimplement the appropriate methods yourself) and a C<PerlHash> PMC of data to
+reimplement the appropriate methods yourself) and a C<Hash> PMC of data to
pass to all handler calls, handles I<one> event, if any are present. If there
are no events pending, this will return directly.
@@ -373,6 +376,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/EventHandler.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/EventHandler.pir (original)
+++ trunk/runtime/parrot/library/SDL/EventHandler.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::EventHandler - base class for application-specific SDL event handlers
@@ -34,7 +37,7 @@
# create and populate some event_arguments
.local pmc event_args
- new event_args, .PerlHash
+ new event_args, .Hash
event_args[ 'main_surface' ] = main_surface
event_args[ 'sprite_list' ] = sprites
@@ -72,7 +75,7 @@
addattribute handler_class, 'args'
.local pmc initializer
- new initializer, .PerlString
+ new initializer, .String
set initializer, 'BUILD'
setprop handler_class, 'BUILD', initializer
@@ -364,6 +367,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Font.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Font.pir (original)
+++ trunk/runtime/parrot/library/SDL/Font.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Font - Parrot class representing fonts in Parrot SDL
@@ -9,7 +12,7 @@
# set the font's arguments
.local pmc font_args
- font_args = new PerlHash
+ font_args = new .Hash
font_args[ 'font_file' ] = 'myfont.ttf'
font_args[ 'point_size' ] = 48
@@ -53,7 +56,7 @@
addattribute font_class, 'size'
.local pmc initializer
- initializer = new PerlString
+ initializer = new .String
initializer = '_BUILD'
setprop font_class, 'BUILD', initializer
@@ -62,7 +65,7 @@
=item _BUILD( font_args )
-Given a Perlhash containing arguments, set the attributes of this font. The
+Given a C<Hash> containing arguments, set the attributes of this font. The
keys of this hash are C<font_file> and C<point_size>, two strings containing
the path to a TrueType font to load and the size of the font when drawn, in
pixels.
@@ -127,7 +130,7 @@
.local pmc rect
.local pmc rect_args
- rect_args = new PerlHash
+ rect_args = new .Hash
rect_args[ 'x' ] = 0
rect_args[ 'y' ] = 0
@@ -247,6 +250,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Image.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Image.pir (original)
+++ trunk/runtime/parrot/library/SDL/Image.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Image - Parrot class representing images in Parrot SDL
@@ -9,7 +12,7 @@
# set a filename in a PMC
.local pmc filename
- new filename, .PerlString
+ new filename, .String
set filename, 'examples/sdl/parrot_small.png'
# create a new SDL::Image object
@@ -54,7 +57,7 @@
subclass image_class, surface_type, 'SDL::Image'
.local pmc initializer
- new initializer, .PerlString
+ new initializer, .String
set initializer, 'BUILD'
setprop image_class, 'BUILD', initializer
END:
@@ -97,6 +100,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/LCD.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/LCD.pir (original)
+++ trunk/runtime/parrot/library/SDL/LCD.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::LCD - A LCD object
@@ -43,7 +46,7 @@
load_bytecode "library/SDL/Image.pir"
load_bytecode "library/SDL/Rect.pir"
- $P0 = new PerlString
+ $P0 = new .String
$P0 = "runtime/parrot/library/SDL/LCD.png"
$I0 = find_type "SDL::Image"
$P0 = new $I0, $P0
@@ -60,21 +63,21 @@
.sub __init method
$I0 = classoffset self, "SDL::LCD"
- $P0 = new PerlString
+ $P0 = new .String
setattribute self, $I0, $P0
inc $I0
- $P0 = new PerlInt
+ $P0 = new .Integer
$P0 = -1
setattribute self, $I0, $P0
inc $I0
- $P0 = new PerlInt
+ $P0 = new .Integer
$P0 = 0
setattribute self, $I0, $P0
inc $I0
- $P0 = new PerlInt
+ $P0 = new .Integer
$P0 = 0
setattribute self, $I0, $P0
.end
@@ -170,7 +173,7 @@
val = $S0
LEN_OK:
- rect = new PerlHash
+ rect = new .Hash
rect["width"] = 10
rect["height"] = 21
$I0 = find_type "SDL::Rect"
@@ -292,6 +295,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Rect.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Rect.pir (original)
+++ trunk/runtime/parrot/library/SDL/Rect.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Rect - Parrot class representing rectangles in Parrot SDL
@@ -17,7 +20,7 @@
# set some arguments for this SDL::Rect
.local pmc rect_args
- new rect_args, .PerlHash
+ new rect_args, .Hash
rect_args[ 'x' ] = 270
rect_args[ 'y' ] = 190
rect_args[ 'height' ] = 100
@@ -54,7 +57,7 @@
addattribute rect_class, '_rect'
.local pmc initializer
- new initializer, .PerlString
+ new initializer, .String
initializer = '_new'
setprop rect_class, 'BUILD', initializer
END:
@@ -63,7 +66,7 @@
=item _new( rect_args )
-Given a PerlHash of arguments, sets the attributes of this object. The hash
+Given a C<Hash> of arguments, sets the attributes of this object. The hash
has the following keys:
=over 4
@@ -273,6 +276,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Sprite.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Sprite.pir (original)
+++ trunk/runtime/parrot/library/SDL/Sprite.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Sprite - Parrot class representing sprites in Parrot SDL
@@ -12,7 +15,7 @@
# set the sprite's arguments
.local pmc sprite_args
- sprite_args = new PerlHash
+ sprite_args = new .Hash
sprite_args[ 'surface' ] = image
sprite_args[ 'source_x' ] = 0
sprite_args[ 'source_y' ] = 0
@@ -69,7 +72,7 @@
addattribute sprite_class, 'y_velocity'
.local pmc initializer
- initializer = new PerlString
+ initializer = new .String
set initializer, '_new'
setprop sprite_class, 'BUILD', initializer
@@ -77,7 +80,7 @@
=item _new( sprite_args )
-Given a PerlHash full of arguments, sets the attributes of this object. The
+Given a C<Hash> full of arguments, sets the attributes of this object. The
useful hash keys are as follows:
=over 4
@@ -178,7 +181,7 @@
done:
.local pmc rect_args
- rect_args = new PerlHash
+ rect_args = new .Hash
rect_args[ 'x' ] = x
rect_args[ 'y' ] = y
rect_args[ 'height' ] = height
@@ -232,13 +235,13 @@
# and finally the x and y velocities
.local pmc x_velocity
- x_velocity = new PerlInt
+ x_velocity = new .Integer
x_velocity = 0
setattribute self, offset, x_velocity
inc offset
.local pmc y_velocity
- y_velocity = new PerlInt
+ y_velocity = new .Integer
y_velocity = 0
setattribute self, offset, y_velocity
@@ -637,6 +640,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/StopWatch.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/StopWatch.pir (original)
+++ trunk/runtime/parrot/library/SDL/StopWatch.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::StopWatch - A stopwatch using SDL::LCD
@@ -60,17 +63,17 @@
$I0 = classoffset self, 'SDL::StopWatch'
- $P0 = new PerlNum
+ $P0 = new .Float
$P0 = 0
setattribute self, $I0, $P0
inc $I0
- $P0 = new PerlNum
+ $P0 = new .Float
$P0 = 0.1
setattribute self, $I0, $P0
inc $I0
- $P0 = new PerlNum
+ $P0 = new .Float
$P0 = 0
setattribute self, $I0, $P0
@@ -266,7 +269,7 @@
.sub __onload :load
# XXX: an old array will be overwritten when loading this file again
- $P0 = new PerlArray
+ $P0 = new .ResizablePMCArray
store_global "SDL::StopWatch::Timer", "array", $P0
$P0 = new SArray
@@ -347,6 +350,6 @@
=head1 COPYRIGHT
-Copyright (c) 2004, The Perl Foundation.
+Copyright (c) 2004-2006, The Perl Foundation.
=cut
Modified: trunk/runtime/parrot/library/SDL/Surface.pir
==============================================================================
--- trunk/runtime/parrot/library/SDL/Surface.pir (original)
+++ trunk/runtime/parrot/library/SDL/Surface.pir Mon Apr 24 12:25:04 2006
@@ -1,3 +1,6 @@
+
+# $Id$
+
=head1 NAME
SDL::Surface - Parrot class representing surfaces in Parrot SDL
@@ -9,7 +12,7 @@
# set the surface's arguments
.local pmc surface_args
- surface_args = new PerlHash
+ surface_args = new .Hash
surface_args[ 'height' ] = 480
surface_args[ 'width' ] = 640
@@ -54,7 +57,7 @@
=item _new( surface_args )
-Given a PerlHash of arguments, set the attributes of this surface. The keys of
+Given a C<Hash> of arguments, set the attributes of this surface. The keys of
this hash are C<height> and C<width>, two integer values representing the
height and width of this surface in pixels.