Advertisement
jargon

Roe sprites

May 4th, 2021
3,160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. declare sub puttile overload (tilename as string="pndxpike", x as integer = 0, y as integer = 0 , PColor as integer = 15)
  2.  
  3. declare sub puttile overload (destination as any ptr = NULL, tilename as string="pndxpike", x as integer = 0, y as integer = 0 , PColor as integer = 15)
  4.  
  5. sub puttile overload (tilename as string="pndxpike", x as integer = 0, y as integer = 0 , PColor as integer = 15)
  6.     puttile NULL, tilename, x, y, PColor
  7. end sub
  8.  
  9. sub puttile overload (destination as any ptr = NULL, tilename as string="pndxpike", x as integer = 0, y as integer = 0 , PColor as integer = 15)
  10.    
  11.     dim as string a_filename, o_filename
  12.    
  13.     a_filename = space(0)
  14.     o_filename = space(0)
  15.    
  16.     dim as integer a_colspan=0, a_rowspan=0
  17.     dim as integer o_colspan=0, o_rowspan=0
  18.    
  19.     dim as any ptr a, o
  20.  
  21.     select case lcase( left( tilename, 4 ) )
  22.     case "lttr":
  23.         o_filename = ".\bitmaps\fonts\rgb\" + tilename + ".bmp"
  24.         a_filename = ".\bitmaps\fonts\mask\" + tilename + ".bmp"
  25.  
  26.     case else:
  27.         o_filename = ".\bitmaps\tiles\rgb\" + tilename + ".bmp"
  28.         a_filename = ".\bitmaps\tiles\mask\" + tilename + ".bmp"
  29.        
  30.     end select
  31.    
  32.     if ( fileexists( o_filename ) = 0 ) or ( fileexists( a_filename ) = 0 ) then
  33.    
  34.         o_filename = ".\bitmaps\logos\rgb\" + tilename + ".bmp"
  35.         a_filename = ".\bitmaps\logos\mask\" + tilename + ".bmp"
  36.    
  37.     endif
  38.    
  39.     if not( len( a_filename ) = 0 ) then
  40.         a = NULL
  41.         a = loadBMP( a_filename )
  42.         Imageinfo ( @a, a_colspan, a_rowspan)
  43.         if not( a = NULL ) then
  44.             if destination = NULL then
  45.                 put( x, y ), a, and
  46.             else
  47.                 put destination,( x, y ), a, and
  48.             end if
  49.             imageDestroy( a )
  50.         end if
  51.     end if
  52.    
  53.     if not( len( o_filename ) = 0 ) then
  54.         o = NULL
  55.         o = loadBMP( o_filename )
  56.         Imageinfo ( @o, o_colspan, o_rowspan)  
  57.         if not( o = NULL ) then
  58.             if destination = NULL then
  59.                 put( x, y ), o, or
  60.             else
  61.                 put destination, ( x, y ), o, or
  62.             end if
  63.             imageDestroy( o )
  64.         end if
  65.     end if
  66.    
  67. end sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement