Author: bernhard
Date: Wed May 16 14:51:19 2007
New Revision: 18575
Modified:
trunk/examples/sdl/bounce_parrot_logo.pir
trunk/examples/sdl/minesweeper/eventhandler.pir
trunk/examples/sdl/minesweeper/field.pir
trunk/examples/sdl/tetris/app.pir
trunk/examples/sdl/tetris/block.pir
trunk/examples/sdl/tetris/blockdata.pir
trunk/examples/sdl/tetris/blocks.pir
trunk/examples/sdl/tetris/board.pir
trunk/examples/sdl/tetris/boarddata.pir
trunk/examples/sdl/tetris/eventhandler.pir
Log:
[examples/sdl]
Put in the optional colon in the method declarations.
Modified: trunk/examples/sdl/bounce_parrot_logo.pir
==============================================================================
--- trunk/examples/sdl/bounce_parrot_logo.pir (original)
+++ trunk/examples/sdl/bounce_parrot_logo.pir Wed May 16 14:51:19 2007
@@ -127,7 +127,7 @@
.namespace [ 'MoveLogo::EventHandler' ]
-.sub update_position method
+.sub update_position :method
.param pmc sprite
.param int frame_count
@@ -185,7 +185,7 @@
.return( updated )
.end
-.sub draw_screen method
+.sub draw_screen :method
.param pmc screen
.param pmc sprite
@@ -204,7 +204,7 @@
.end
-.sub move_sprite_x method
+.sub move_sprite_x :method
.param pmc sprite
.param int direction
@@ -232,7 +232,7 @@
.end
-.sub move_sprite_y method
+.sub move_sprite_y :method
.param pmc sprite
.param int direction
@@ -260,7 +260,7 @@
.end
-.sub key_down_down method
+.sub key_down_down :method
.param pmc event_args
.local pmc screen
@@ -281,7 +281,7 @@
.end
-.sub key_down_up method
+.sub key_down_up :method
.param pmc event_args
.local pmc screen
@@ -302,7 +302,7 @@
.end
-.sub key_down_left method
+.sub key_down_left :method
.param pmc event_args
.local pmc screen
@@ -323,7 +323,7 @@
.end
-.sub key_down_right method
+.sub key_down_right :method
.param pmc event_args
.local pmc screen
@@ -344,7 +344,7 @@
.end
-.sub key_down_escape method
+.sub key_down_escape :method
.param pmc event_args
# XXX: a silly way to quit
Modified: trunk/examples/sdl/minesweeper/eventhandler.pir
==============================================================================
--- trunk/examples/sdl/minesweeper/eventhandler.pir (original)
+++ trunk/examples/sdl/minesweeper/eventhandler.pir Wed May 16 14:51:19 2007
@@ -42,7 +42,7 @@
=cut
-.sub mouse_button_down method
+.sub mouse_button_down :method
.param pmc event
.param pmc field
@@ -71,7 +71,7 @@
=cut
-.sub mouse_motion method
+.sub mouse_motion :method
.param pmc event
.param pmc field
@@ -102,7 +102,7 @@
=cut
-.sub mouse_button_up method
+.sub mouse_button_up :method
.param pmc event
.param pmc field
Modified: trunk/examples/sdl/minesweeper/field.pir
==============================================================================
--- trunk/examples/sdl/minesweeper/field.pir (original)
+++ trunk/examples/sdl/minesweeper/field.pir Wed May 16 14:51:19 2007
@@ -109,7 +109,7 @@
=cut
-.sub __init method
+.sub __init :method
.param pmc args
.local pmc field
.local pmc screen
@@ -224,7 +224,7 @@
=cut
-.sub newLevel method
+.sub newLevel :method
.param int level
.local pmc field
.local pmc cache
@@ -312,7 +312,7 @@
=cut
-.sub draw method
+.sub draw :method
.local pmc screen
.local pmc image
.local pmc dest_rect
@@ -484,7 +484,7 @@
=cut
-.sub reveal method
+.sub reveal :method
.param int x
.param int y
.local int width
@@ -542,7 +542,7 @@
=cut
-.sub setFlag method
+.sub setFlag :method
.param int x
.param int y
.local int width
@@ -639,7 +639,7 @@
=cut
-.sub undo_mark method
+.sub undo_mark :method
.param int i :optional
.param int has_i :opt_flag
@@ -685,7 +685,7 @@
=cut
-.sub mark method
+.sub mark :method
.param int x
.param int y
.local int width
@@ -780,7 +780,7 @@
=cut
-.sub click method
+.sub click :method
.param int x
.param int y
.param int b
@@ -812,7 +812,7 @@
=cut
-.sub reveal_recursive method
+.sub reveal_recursive :method
.param int x
.param int y
.param int width
@@ -887,7 +887,7 @@
=cut
-.sub lost method
+.sub lost :method
.local pmc field
.local int i
.local int max
@@ -930,7 +930,7 @@
=cut
-.sub won method
+.sub won :method
self."setStatus"( STATUS_WON )
.end
@@ -940,7 +940,7 @@
=cut
-.sub check_end method
+.sub check_end :method
.local pmc field
classoffset $I0, self, "Mines::Field"
@@ -975,7 +975,7 @@
=cut
-.sub setStatus method
+.sub setStatus :method
.param int s
.local pmc screen
.local pmc watch
@@ -1015,7 +1015,7 @@
=cut
-.sub update_stats method
+.sub update_stats :method
.local pmc field
.local int size
.local pmc count
Modified: trunk/examples/sdl/tetris/app.pir
==============================================================================
--- trunk/examples/sdl/tetris/app.pir (original)
+++ trunk/examples/sdl/tetris/app.pir Wed May 16 14:51:19 2007
@@ -86,7 +86,7 @@
=cut
-.sub BUILD method
+.sub BUILD :method
# create the app object
store_global "Tetris::App", "app", self
@@ -146,7 +146,7 @@
=cut
-.sub SDL method
+.sub SDL :method
classoffset $I0, self, "Tetris::App"
add $I0, tSDL
@@ -166,7 +166,7 @@
=cut
-.sub shutdown method
+.sub shutdown :method
.local pmc sdl
# XXX free data structures
@@ -193,7 +193,7 @@
$P0."timer"()
.end
-.sub run method
+.sub run :method
.local pmc eh
.local pmc loop
@@ -214,7 +214,7 @@
=cut
-.sub initTimer method
+.sub initTimer :method
$P0 = new SArray
$P1 = find_global "Tetris::App", "_app_timer"
$P0 = 8
@@ -250,7 +250,7 @@
=cut
-.sub setTimerStatus method
+.sub setTimerStatus :method
.param int status
classoffset $I0, self, "Tetris::App"
@@ -263,7 +263,7 @@
=cut
-.sub enableTimer method
+.sub enableTimer :method
classoffset $I0, self, "Tetris::App"
add $I0, tTimerDisableCount
getattribute $P0, self, $I0
@@ -277,7 +277,7 @@
=cut
-.sub disableTimer method
+.sub disableTimer :method
classoffset $I0, self, "Tetris::App"
add $I0, tTimerDisableCount
getattribute $P0, self, $I0
@@ -291,7 +291,7 @@
=cut
-.sub color method
+.sub color :method
.param int number
.local pmc palette
.local pmc color
@@ -308,7 +308,7 @@
=cut
-.sub palette method
+.sub palette :method
.local pmc palette
classoffset $I0, self, "Tetris::App"
@@ -336,7 +336,7 @@
=cut
-.sub genPalette method
+.sub genPalette :method
.local pmc palette
.local pmc hash
.local pmc color
@@ -401,7 +401,7 @@
=cut
-.sub board method
+.sub board :method
.param int boardID
.local pmc board
@@ -443,7 +443,7 @@
=cut
-.sub currentBlock method
+.sub currentBlock :method
.param int boardID
.local pmc temp
@@ -477,7 +477,7 @@
=cut
-.sub rotate method
+.sub rotate :method
.param int boardID
.param int dir
.local pmc block
@@ -536,7 +536,7 @@
=cut
-.sub move method
+.sub move :method
.param int boardID
.param int xval
.param int yval
@@ -585,7 +585,7 @@
=cut
-.sub nextBlock method
+.sub nextBlock :method
.param int boardID
.param int id
.local pmc temp
@@ -627,7 +627,7 @@
=cut
-.sub fall method
+.sub fall :method
.param int boardID
.local pmc board
.local int ret
@@ -659,7 +659,7 @@
=cut
-.sub falling method
+.sub falling :method
.param int boardID
.local pmc board
.local int ret
@@ -690,7 +690,7 @@
=cut
-.sub fallInterval method
+.sub fallInterval :method
.param int boardID
.local pmc board
.local num ret
@@ -721,7 +721,7 @@
=cut
-.sub nextFallTime method
+.sub nextFallTime :method
.param int boardID
.local pmc board
.local num ret
@@ -755,7 +755,7 @@
=cut
-.sub setNextFallTime method
+.sub setNextFallTime :method
.param int boardID
.param num val
.local pmc board
@@ -776,7 +776,7 @@
=cut
-.sub timer method
+.sub timer :method
.local pmc board
.local int redraw
.local int ret
@@ -849,7 +849,7 @@
=cut
-.sub drawScreen method
+.sub drawScreen :method
.param int full
.local pmc screen
.local pmc temp
@@ -918,7 +918,7 @@
=cut
-.sub drawBoards method
+.sub drawBoards :method
.param pmc screen
.param int full
.local pmc boards
@@ -945,7 +945,7 @@
=cut
-.sub boards method
+.sub boards :method
.local pmc boards
.local int count
@@ -968,7 +968,7 @@
=cut
-.sub registerBoard method
+.sub registerBoard :method
.param pmc board
.local pmc boards
.local int id
@@ -999,7 +999,7 @@
=cut
-.sub flag method
+.sub flag :method
.param string name
.param int value
.local pmc flag
@@ -1037,7 +1037,7 @@
=cut
-.sub newGame method
+.sub newGame :method
.param int players
.local pmc temp
.local int xpos
Modified: trunk/examples/sdl/tetris/block.pir
==============================================================================
--- trunk/examples/sdl/tetris/block.pir (original)
+++ trunk/examples/sdl/tetris/block.pir Wed May 16 14:51:19 2007
@@ -65,7 +65,7 @@
=cut
-.sub BUILD method
+.sub BUILD :method
.param pmc board
.local pmc prop
.local int id
@@ -115,7 +115,7 @@
=cut
-.sub fall method
+.sub fall :method
classoffset $I0, self, "Tetris::Block"
add $I0, Fall
getattribute $P0, self, $I0
@@ -128,7 +128,7 @@
=cut
-.sub falling method
+.sub falling :method
classoffset $I0, self, "Tetris::Block"
add $I0, Fall
getattribute $P0, self, $I0
@@ -143,7 +143,7 @@
=cut
-.sub position method
+.sub position :method
.local int xpos
.local int ypos
.local int vfree
@@ -195,7 +195,7 @@
=cut
-.sub rotate method
+.sub rotate :method
.param int val
.local pmc board
.local pmc temp
@@ -247,7 +247,7 @@
=cut
-.sub board method
+.sub board :method
# get the board
classoffset $I0, self, "Tetris::Block"
add $I0, Board
@@ -262,7 +262,7 @@
=cut
-.sub setBoard method
+.sub setBoard :method
.param pmc board
# get the board
@@ -284,7 +284,7 @@
=cut
-.sub validPosition method
+.sub validPosition :method
.local pmc board
.local pmc temp
.local int xpos
@@ -359,7 +359,7 @@
=cut
-.sub move method
+.sub move :method
.param int xval
.param int yval
.local pmc xpos
@@ -417,7 +417,7 @@
=cut
-.sub draw method
+.sub draw :method
.param pmc surface
.param int xshift
.param int yshift
@@ -545,7 +545,7 @@
=cut
-.sub timer method
+.sub timer :method
.local pmc board
.local pmc app
.local num curtime
@@ -600,7 +600,7 @@
=cut
-.sub moveDown method
+.sub moveDown :method
.local pmc board
.local int okay
@@ -626,7 +626,7 @@
=cut
-.sub application method
+.sub application :method
.local pmc temp
temp = self."board"()
@@ -635,7 +635,7 @@
.return (temp)
.end
-.sub setXPosition method
+.sub setXPosition :method
.param int pos
getprop $P0, "xpos", self
Modified: trunk/examples/sdl/tetris/blockdata.pir
==============================================================================
--- trunk/examples/sdl/tetris/blockdata.pir (original)
+++ trunk/examples/sdl/tetris/blockdata.pir Wed May 16 14:51:19 2007
@@ -45,7 +45,7 @@
=cut
-.sub rotateData method
+.sub rotateData :method
.param int val
.local int size
.local int x
@@ -106,7 +106,7 @@
=cut
-.sub vfree method
+.sub vfree :method
.local int size
.local int free
.local int i
@@ -144,7 +144,7 @@
=cut
-.sub hfree method
+.sub hfree :method
.local int size
.local int free
.local int i
@@ -208,7 +208,7 @@
=cut
-.sub size method
+.sub size :method
classoffset $I0, self, "Tetris::BlockData"
getattribute $P0, self, $I0
$I0 = 0
@@ -221,14 +221,14 @@
.return ($I0)
.end
-.sub __set_pmc method
+.sub __set_pmc :method
.param pmc data
classoffset $I0, self, "Tetris::BlockData"
setattribute self, $I0, data
.end
-.sub __get_integer_keyed method
+.sub __get_integer_keyed :method
.param pmc key
.local int index
@@ -253,7 +253,7 @@
throw $P0
.end
-.sub __set_integer_keyed method
+.sub __set_integer_keyed :method
.param pmc key
.param int val
.local int index
Modified: trunk/examples/sdl/tetris/blocks.pir
==============================================================================
--- trunk/examples/sdl/tetris/blocks.pir (original)
+++ trunk/examples/sdl/tetris/blocks.pir Wed May 16 14:51:19 2007
@@ -66,7 +66,7 @@
# ##
# ##
-.sub __init method
+.sub __init :method
.local pmc block
block = new IntList
@@ -77,7 +77,7 @@
assign self, block
.end
-.sub id method
+.sub id :method
.return (0)
.end
@@ -86,7 +86,7 @@
# ###
# #..
# ...
-.sub __init method
+.sub __init :method
.local pmc block
block = new IntList
@@ -102,7 +102,7 @@
assign self, block
.end
-.sub id method
+.sub id :method
.return (1)
.end
@@ -111,7 +111,7 @@
# ###
# ..#
# ...
-.sub __init method
+.sub __init :method
.local pmc block
block = new IntList
@@ -127,7 +127,7 @@
assign self, block
.end
-.sub id method
+.sub id :method
.return (2)
.end
@@ -136,7 +136,7 @@
# ##.
# .##
# ...
-.sub __init method
+.sub __init :method
.local pmc block
block = new IntList
@@ -152,7 +152,7 @@
assign self, block
.end
-.sub id method
+.sub id :method
.return (3)
.end
@@ -161,7 +161,7 @@
# .##
# ##.
# ...
-.sub __init method
+.sub __init :method
.local pmc block
block = new IntList
@@ -177,7 +177,7 @@
assign self, block
.end
-.sub id method
+.sub id :method
.return (4)
.end
@@ -186,7 +186,7 @@
# ###
# .#.
# ...
-.sub __init method
+.sub __init :method
.local pmc block
block = new IntList
@@ -202,7 +202,7 @@
assign self, block
.end
-.sub id method
+.sub id :method
.return (5)
.end
@@ -212,7 +212,7 @@
# ....
# ....
# ....
-.sub __init method
+.sub __init :method
.local pmc block
block = new IntList
@@ -235,7 +235,7 @@
assign self, block
.end
-.sub id method
+.sub id :method
.return (6)
.end
Modified: trunk/examples/sdl/tetris/board.pir
==============================================================================
--- trunk/examples/sdl/tetris/board.pir (original)
+++ trunk/examples/sdl/tetris/board.pir Wed May 16 14:51:19 2007
@@ -57,7 +57,7 @@
=cut
-.sub BUILD method
+.sub BUILD :method
.param pmc app
.local pmc temp
.local int w
@@ -133,7 +133,7 @@
=cut
-.sub application method
+.sub application :method
.local pmc app
getprop app, "app", self
@@ -148,7 +148,7 @@
=cut
-.sub getNextBlock method
+.sub getNextBlock :method
.local pmc block
getprop block, "nextblock", self
@@ -166,7 +166,7 @@
=cut
-.sub setNextBlock method
+.sub setNextBlock :method
.param pmc block
setprop self, "nextblock", block
@@ -181,13 +181,13 @@
=cut
-.sub setCurrentBlock method
+.sub setCurrentBlock :method
.param pmc block
setprop self, "block", block
.end
-.sub newCurrentBlock method
+.sub newCurrentBlock :method
.param pmc block
.local int width
.local int size
@@ -236,7 +236,7 @@
=cut
-.sub nextBlock method
+.sub nextBlock :method
.param int id
.local pmc block
.local pmc temp
@@ -271,7 +271,7 @@
=cut
-.sub fall method
+.sub fall :method
.local pmc block
getprop block, "block", self
@@ -286,7 +286,7 @@
=cut
-.sub falling method
+.sub falling :method
.param pmc self
.local pmc block
.local int ret
@@ -303,7 +303,7 @@
=cut
-.sub currentBlock method
+.sub currentBlock :method
.local pmc block
getprop block, "block", self
@@ -320,7 +320,7 @@
=cut
-.sub blockSize method
+.sub blockSize :method
.local pmc temp
.local int i
@@ -351,7 +351,7 @@
=cut
-.sub offset method
+.sub offset :method
.param int x
.param int y
.local int offset
@@ -392,7 +392,7 @@
=cut
-.sub translateBlockData method
+.sub translateBlockData :method
.param pmc block
.param pmc data
.param int value
@@ -453,7 +453,7 @@
=cut
-.sub lockBlock method
+.sub lockBlock :method
.param pmc block
.local int value
@@ -473,7 +473,7 @@
=cut
-.sub removeLine method
+.sub removeLine :method
.param int line
.local int w
.local int src
@@ -519,7 +519,7 @@
=cut
-.sub removeFullLines method
+.sub removeFullLines :method
.local pmc temp
.local int w
.local int h
@@ -587,7 +587,7 @@
=cut
-.sub draw method
+.sub draw :method
.param pmc surface
.param int full
.local pmc temp
@@ -764,7 +764,7 @@
=cut
-.sub timer method
+.sub timer :method
.local pmc block
.local int redraw
@@ -784,7 +784,7 @@
=cut
-.sub fallInterval method
+.sub fallInterval :method
.local pmc temp
.local num ret
@@ -801,7 +801,7 @@
=cut
-.sub nextFallTime method
+.sub nextFallTime :method
.local pmc temp
.local num ret
@@ -820,7 +820,7 @@
=cut
-.sub setNextFallTime method
+.sub setNextFallTime :method
.param num val
.local pmc temp
@@ -837,7 +837,7 @@
=cut
-.sub position method
+.sub position :method
.local int xpos
.local int ypos
.local pmc temp
@@ -856,7 +856,7 @@
=cut
-.sub setPosition method
+.sub setPosition :method
.param int xpos
.param int ypos
.local pmc temp
@@ -875,7 +875,7 @@
=cut
-.sub blockID method
+.sub blockID :method
.param int id
.local pmc blocks
.local int ret
Modified: trunk/examples/sdl/tetris/boarddata.pir
==============================================================================
--- trunk/examples/sdl/tetris/boarddata.pir (original)
+++ trunk/examples/sdl/tetris/boarddata.pir Wed May 16 14:51:19 2007
@@ -58,7 +58,7 @@
=cut
-.sub init method
+.sub init :method
.param int w
.param int h
.local pmc data
@@ -113,7 +113,7 @@
=cut
-.sub fill method
+.sub fill :method
.param int val
.local pmc data
.local int i
@@ -132,14 +132,14 @@
END:
.end
-.sub __get_integer method
+.sub __get_integer :method
classoffset $I0, self, "Tetris::BoardData"
getattribute $P0, self, $I0
$I0 = $P0
.return ($I0)
.end
-.sub __get_integer_keyed method
+.sub __get_integer_keyed :method
.param pmc key
classoffset $I0, self, "Tetris::BoardData"
@@ -159,7 +159,7 @@
.return ($I0)
.end
-.sub __set_integer_keyed method
+.sub __set_integer_keyed :method
.param pmc key
.param int val
@@ -168,7 +168,7 @@
$P0[key] = val
.end
-.sub __set_integer_native method
+.sub __set_integer_native :method
.param int val
classoffset $I0, self, "Tetris::BoardData"
@@ -176,7 +176,7 @@
$P0 = val
.end
-.sub __push_integer method
+.sub __push_integer :method
.param int val
classoffset $I0, self, "Tetris::BoardData"
@@ -190,7 +190,7 @@
=cut
-.sub width method
+.sub width :method
classoffset $I0, self, "Tetris::BoardData"
add $I0, bWidth
getattribute $P0, self, $I0
@@ -204,7 +204,7 @@
=cut
-.sub height method
+.sub height :method
classoffset $I0, self, "Tetris::BoardData"
add $I0, bHeight
getattribute $P0, self, $I0
@@ -218,7 +218,7 @@
=cut
-.sub dimensions method
+.sub dimensions :method
.local int w
.local int h
.local pmc temp
Modified: trunk/examples/sdl/tetris/eventhandler.pir
==============================================================================
--- trunk/examples/sdl/tetris/eventhandler.pir (original)
+++ trunk/examples/sdl/tetris/eventhandler.pir Wed May 16 14:51:19 2007
@@ -20,14 +20,14 @@
END:
.end
-.sub BUILD method
+.sub BUILD :method
.param pmc app
classoffset $I0, self, "Tetris::EventHandler"
setattribute self, $I0, app
.end
-.sub app method
+.sub app :method
.local pmc app
classoffset $I0, self, "Tetris::EventHandler"
@@ -35,7 +35,7 @@
.return (app)
.end
-.sub dispatch_event method
+.sub dispatch_event :method
.local pmc app
.local int ret
@@ -50,7 +50,7 @@
.return (ret)
.end
-.sub nextBlock method
+.sub nextBlock :method
.param int boardID
.param int blockID
.local pmc app
@@ -78,73 +78,73 @@
board."setNextBlock"( block )
.end
-.sub key_down_escape method
+.sub key_down_escape :method
end
.end
-.sub key_down_0 method
+.sub key_down_0 :method
self."nextBlock"( 0, -1 )
.end
-.sub key_down_1 method
+.sub key_down_1 :method
self."nextBlock"( 0, 0 )
.end
-.sub key_down_2 method
+.sub key_down_2 :method
self."nextBlock"( 0, 1 )
.end
-.sub key_down_3 method
+.sub key_down_3 :method
self."nextBlock"( 0, 2 )
.end
-.sub key_down_4 method
+.sub key_down_4 :method
self."nextBlock"( 0, 3 )
.end
-.sub key_down_5 method
+.sub key_down_5 :method
self."nextBlock"( 0, 4 )
.end
-.sub key_down_6 method
+.sub key_down_6 :method
self."nextBlock"( 0, 5 )
.end
-.sub key_down_7 method
+.sub key_down_7 :method
self."nextBlock"( 0, 6 )
.end
-.sub key_down_space method
+.sub key_down_space :method
$P0 = self."app"()
$P0."fall"( 0 )
.end
-.sub key_down_left method
+.sub key_down_left :method
$P0 = self."app"()
$P0."move"( 0, -1, 0 )
.end
-.sub key_down_right method
+.sub key_down_right :method
$P0 = self."app"()
$P0."move"( 0, +1, 0 )
.end
-.sub key_down_up method
+.sub key_down_up :method
$P0 = self."app"()
$P0."rotate"( 0, -1 )
.end
-.sub key_down_down method
+.sub key_down_down :method
$P0 = self."app"()
$P0."rotate"( 0, +1 )
.end
-.sub key_down_F1 method
+.sub key_down_F1 :method
$P0 = self."app"()
$P0."newGame"( 1 )
.end
-.sub key_down_F2 method
+.sub key_down_F2 :method
$P0 = self."app"()
$P0."newGame"( 2 )
.end