' ################################################################################################################################################################
' Speed tests and demos of various methods draw a 2-color 8x8 tile
' From thread:
' Re: fastest way to draw a 2-color 8x8 tile (with variable colors)?
' https://qb64forum.alephc.xyz/index.php?topic=4674.msg140904#msg140904
' ################################################################################################################################################################
' ===============================================================================
' GLOBAL CONSTANTS
' ===============================================================================
' BOOLEAN VALUES
' ===============================================================================
' USER DEFINED TYPES
' ===============================================================================
' UDT TO HOLD COORDINATES FOR DRAWING A RECTANGLE
' UDT FOR PRECALCULATED TILESHEET
' UDT FOR PRECALCULATED TILE MAP
' ===============================================================================
' GLOBAL VARIABLES
' ===============================================================================
Dim Shared m_bDebug
As Integer: m_bDebug
= TRUE
' ENABLES/DISABLES CONSOLE WINDOW AND DebugPrint
' Used for Steve's very different custom screen:
Dim Shared m_ScreenArray
(99, 74) As _Unsigned Long ' Here, I'm creating a screen array to hold the information of EVERY character I place onto the screen, and its tile
' ===============================================================================
' LOCAL VARIABLES
' ===============================================================================
' ****************************************************************************************************************************************************************
' ACTIVATE DEBUGGING WINDOW
_Echo "Started " + m_ProgramName$
' ****************************************************************************************************************************************************************
' ===============================================================================
' START THE MAIN ROUTINE
' ===============================================================================
main
' ===============================================================================
' FINISH
' ===============================================================================
Print m_ProgramName$
+ " finished." Input "Press <ENTER> to continue", in$
' ****************************************************************************************************************************************************************
' DEACTIVATE DEBUGGING WINDOW
' ****************************************************************************************************************************************************************
System ' return control to the operating system
' ################################################################################################################################################################
' BEGIN MAIN MENU
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
Dim result$: result$
= "" Print "RE: fastest way to draw a 2-color 8x8 tile (with variable colors)?"
Print "1) DrawingSpeedTest7" Print "2) HardwareImageDemo2" Print "3) GetAllPossibleShapesTest" Print "4) FindOptimizedVectorTest - find minimum shapes to draw a tile" Print "5) GetVectorTilesTest" Print "6) MakePaletteImageTest" Print "7) DrawVectorTilePutImageTest" Print "A) TestCustomHardwareScreen1" Print "B) ^ instructions" Print "C) TestSoftwareScreen1" Print "D) ^ instructions"
Print "E) TestCustomHardwareScreen2"
GetAllPossibleShapesTest:
Exit Do FindOptimizedVectorTest:
Exit Do DrawVectorTilePutImageTest:
Exit Do TestCustomHardwareScreen1:
Exit Do ShowInstructions
(GetInstructions1$
):
Exit Do ShowInstructions
(GetInstructions2$
):
Exit Do
TestCustomHardwareScreen2:
Exit Do
' ################################################################################################################################################################
' END MAIN MENU
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN DRAWING SPEED TEST
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
Dim imgHardwareScreen
As Long ' copy of the software screen, transformed into a hardware image Dim imgTiles
As Long ' original tileset, black on transparent Dim imgHardwareTiles
As Long ' copy of the tileset, tranformed into a hardware image Dim imgTilesRed
As Long ' colored tileset copy Dim imgTilesGreen
As Long ' colored tileset copy Dim imgTilesBlue
As Long ' colored tileset copy Dim imgTilesYellow
As Long ' colored tileset copy Dim imgColorTiles
As Long ' holds 4 copies of tileset in different colors (red, green, blue, yellow) Dim imgTilesAllColorsSW
As Long ' holds n copies of tileset in all combinations of specified foreground/background colors Dim imgTilesAllColorsHW
As Long ' copy of the tileset, tranformed into a hardware image
Dim imgPalette
As Long ' contains palette of colors Dim imgPaletteHW
As Long ' hardware image of palette of colors 'Dim iCols As Integer
'Dim iRows As Integer
ReDim arrTileIndex
(-1) As Long ' stores x positions for tiles (0-255) for COLORED TILESET COPIES v2 ReDim arrColorIndex
(-1, -1) As Long ' stores y positions for (fgColorIndex, bgColorIndex) for COLORED TILESET COPIES v2
' ================================================================================================================================================================
' INIT SCREEN
' ================================================================================================================================================================
'iCols = _Width(imgScreen) \ 8
'iRows = _Height(imgScreen) \ 8
iMinX = 1: iMaxX = 16
iMinY = 3: iMaxY = 18
' ================================================================================================================================================================
' INITIALIZE NEUTRAL COLOR GRAPHICS TILES (BLACK ON TRANSPARENT)
' ================================================================================================================================================================
'' LOAD TILES (16 cols x 16 rows of 8x8 tiles) FROM FILE
'sFile$ = Left$(Command$(0), _InStrRev(Command$(0), "\")) + "Font_8x8_128x128_v3.png" ' 128x128 pixels, 16 rows x 16 columns of 8x8 tiles
'imgTiles = _LoadImage(sFile$, 32)
' LOAD TILES FROM TEXT DEFINITIONS IN Sub GetTileText
sError = GetTiles$(imgTiles, cBlack, cEmpty)
' ================================================================================================================================================================
' CREATE COLORED TILESET COPIES v1
' ================================================================================================================================================================
MakeColoredTileset imgTiles, imgTilesRed, cRed, cBlack
MakeColoredTileset imgTiles, imgTilesGreen, cLime, cBlack
MakeColoredTileset imgTiles, imgTilesBlue, cBlue, cBlack
MakeColoredTileset imgTiles, imgTilesYellow, cYellow, cBlack
' Make one big tileset with all colors
_PutImage (0, 0), imgTilesRed
, imgColorTiles
, (0, 0)-(128, 128) _PutImage (128, 0), imgTilesGreen
, imgColorTiles
, (0, 0)-(128, 128) _PutImage (256, 0), imgTilesBlue
, imgColorTiles
, (0, 0)-(128, 128) _PutImage (384, 0), imgTilesYellow
, imgColorTiles
, (0, 0)-(128, 128)
imgHardwareTiles
= _CopyImage(imgColorTiles
, 33) ' Copy tilesheet for hardware image
' ================================================================================================================================================================
' CREATE COLORED TILESET COPIES v2
' ================================================================================================================================================================
'ReDim arrColors(0 To 4) As _UNSIGNED Long
'arrColors(0) = cRed
'arrColors(1) = cLime
'arrColors(2) = cBlue
'arrColors(3) = cYellow
'arrColors(4) = cBlack
arrColors(0) = cRed
arrColors(1) = cOrangeRed
arrColors(2) = cDarkOrange
arrColors(3) = cOrange
arrColors(4) = cGold
arrColors(5) = cYellow
arrColors(6) = cChartreuse
arrColors(7) = cOliveDrab1
arrColors(8) = cLime
arrColors(9) = cMediumSpringGreen
arrColors(10) = cCyan
arrColors(11) = cDeepSkyBlue
arrColors(12) = cDodgerBlue
arrColors(13) = cSeaBlue
arrColors(14) = cBlue
arrColors(15) = cBluePurple
arrColors(16) = cDeepPurple
arrColors(17) = cPurple
arrColors(18) = cPurpleRed
arrColors(19) = cDarkRed
arrColors(20) = cBrickRed
arrColors(21) = cDarkGreen
arrColors(22) = cGreen
arrColors(23) = cOliveDrab
arrColors(24) = cLightPink
arrColors(25) = cHotPink
arrColors(26) = cDeepPink
arrColors(27) = cMagenta
arrColors(28) = cBlack
arrColors(29) = cDimGray
arrColors(30) = cGray
arrColors(31) = cDarkGray
arrColors(32) = cSilver
arrColors(33) = cLightGray
arrColors(34) = cGainsboro
arrColors(35) = cWhiteSmoke
arrColors(36) = cWhite
arrColors(37) = cDarkBrown
arrColors(38) = cLightBrown
arrColors(39) = cKhaki
iFirstColor2
= LBound(arrColors
) iLastColor2
= UBound(arrColors
)
' Make one big tileset with all possible foreground/background color combinations
MakeColoredTileset2 imgTiles, imgTilesAllColorsSW, arrColors(), arrTileIndex(), arrColorIndex()
imgTilesAllColorsHW
= _CopyImage(imgTilesAllColorsSW
, 33) ' Copy tilesheet for hardware image
' ================================================================================================================================================================
' VECTOR TILES SETUP
' ================================================================================================================================================================
' set up vector tiles
GetVectorTiles
' set up colors for vector HW tiles
arrColor(0) = cRed
arrColor(1) = cLime
arrColor(2) = cBlue
arrColor(3) = cYellow
arrColor(4) = cBlack
arrColor(5) = cEmpty
MakePaletteImage imgPalette, arrColor()
imgPaletteHW
= _CopyImage(imgPalette
, 33) ' Copy palette for hardware image
' ================================================================================================================================================================
' METHOD #1
' _PUTIMAGE with SOFTWARE IMAGES
' ================================================================================================================================================================
Color cWhite
, cBlack:
Locate 1, 1:
Print "Test #1: DrawTile8 routine using 4 tilesets (1 per color) and regular _putimage using using SOFTWARE images..."
iCount1 = 0
iCount1 = iCount1 + 1
iFirstColor
= iFirstColor
Xor 1 iFgColorIndex = iFirstColor
iY = iMinY
iX = iMinX
DrawTile8 imgTilesRed, iTileNum, imgScreen, iX, iY
DrawTile8 imgTilesGreen, iTileNum, imgScreen, iX, iY
DrawTile8 imgTilesBlue, iTileNum, imgScreen, iX, iY
DrawTile8 imgTilesYellow, iTileNum, imgScreen, iX, iY
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iLastColor
Then iFgColorIndex
= iFirstColor
' ================================================================================================================================================================
' METHOD #2
' COLOR SWAP with SOFTWARE IMAGES
' ================================================================================================================================================================
Color cWhite
, cBlack:
Locate 1, 1:
Print "Test #2: DrawColorTile routine using 1 tileset with DoColorSwap using SOFTWARE images...";
iCount2 = 0
iCount2 = iCount2 + 1
iFirstColor
= iFirstColor
Xor 1 iFgColorIndex = iFirstColor
iY = iMinY
iX = iMinX
fgColor = cRed: bgColor = cBlack
fgColor = cLime: bgColor = cBlack
fgColor = cBlue: bgColor = cBlack
fgColor = cYellow: bgColor = cBlack
DrawColorTile imgScreen, imgTiles, iTileNum, fgColor, bgColor, iX, iY
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iLastColor
Then iFgColorIndex
= iFirstColor
' ================================================================================================================================================================
' METHOD #3
' _PUTIMAGE with HARDWARE IMAGES
' ================================================================================================================================================================
Color cWhite
, cBlack:
Locate 1, 1:
Print "Test #3: DrawTileHw8 routine using 1 big multi-tileset and HARDWARE images...";
iCount3 = 0
iCount3 = iCount3 + 1
iFirstColor
= iFirstColor
Xor 1 iFgColorIndex = iFirstColor
iY = iMinY
iX = iMinX
DrawTileHw8 imgHardwareTiles, iTileNum, imgScreen, iX, iY, iFgColorIndex
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iLastColor
Then iFgColorIndex
= iFirstColor
If imgHardwareScreen
< -1 Or imgHardwareScreen
> 0 Then _FreeImage imgHardwareScreen
' FREE MEMORY If imgHardwareTiles
< -1 Or imgHardwareTiles
> 0 Then _FreeImage imgHardwareTiles
' FREE MEMORY
' ================================================================================================================================================================
' METHOD #4
' VECTOR-BASED TILES USING LINE
' ================================================================================================================================================================
Color cWhite
, cBlack:
Locate 1, 1:
Print "Test #4: DrawVectorTileLine routine using 1 vector-based tileset drawn with Line shapes...";
iCount4 = 0
iCount4 = iCount4 + 1
iFirstColor
= iFirstColor
Xor 1 iFgColorIndex = iFirstColor
iY = iMinY
iX = iMinX
fgColor = cRed: bgColor = cBlack
fgColor = cLime: bgColor = cBlack
fgColor = cBlue: bgColor = cBlack
fgColor = cYellow: bgColor = cBlack
'DrawShape iTileNum, iX, iY, fgColor, bgColor
DrawVectorTileLine iTileNum, iX * 8, iY * 8, fgColor, bgColor
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iLastColor
Then iFgColorIndex
= iFirstColor
' ================================================================================================================================================================
' METHOD #5
' VECTOR-BASED TILES USING _PutImage
' ================================================================================================================================================================
Color cWhite
, cBlack:
Locate 1, 1:
Print "Test #5: DrawVectorTilePutImage routine using 1 vector-based tileset drawn with _PutImage...";
iBgColorIndex = 4
iCount5 = 0
iCount5 = iCount5 + 1
iFirstColor
= iFirstColor
Xor 1 iFgColorIndex = iFirstColor
iY = iMinY
iX = iMinX
'DrawVectorTileLine iTileNum, iX*8, iY*8, fgColor, bgColor
DrawVectorTilePutImage _
imgScreen, imgPalette, arrColor(), _
iTileNum, iX, iY, _
iFgColorIndex, iBgColorIndex
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iLastColor
Then iFgColorIndex
= iFirstColor
' ================================================================================================================================================================
' METHOD #6
' VECTOR-BASED TILES USING _PutImage with HARDWARE IMAGES
' ================================================================================================================================================================
Color cWhite
, cBlack:
Locate 1, 1:
Print "Test #6: DrawVectorTilePutImageHW routine using 1 vector-based tileset drawn with hardware images...";
iBgColorIndex = 4
iCount6 = 0
iCount6 = iCount6 + 1
iFirstColor
= iFirstColor
Xor 1 iFgColorIndex = iFirstColor
iY = iMinY
iX = iMinX
'DrawVectorTileLine iTileNum, iX*8, iY*8, fgColor, bgColor
DrawVectorTilePutImageHW _
imgPaletteHW, arrColor(), _
iTileNum, iX, iY, _
iFgColorIndex, iBgColorIndex
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iLastColor
Then iFgColorIndex
= iFirstColor
If imgHardwareScreen
< -1 Or imgHardwareScreen
> 0 Then _FreeImage imgHardwareScreen
' FREE MEMORY
' ================================================================================================================================================================
' METHOD #7
' SOLID BOXES WITH LINE
' ================================================================================================================================================================
iCount7 = 0
iCount7 = iCount7 + 1
iFirstColor
= iFirstColor
Xor 1 iFgColorIndex = iFirstColor
iY = iMinY
iX = iMinX
fgColor = cRed: bgColor = cBlack
fgColor = cLime: bgColor = cBlack
fgColor = cBlue: bgColor = cBlack
fgColor = cYellow: bgColor = cBlack
'DrawShape iTileNum, iX, iY, fgColor, bgColor
'DrawVectorTileLine iTileNum, iX*8, iY*8, fgColor, bgColor
Line (iX
* 8, iY
* 8)-((iX
* 8) + 7, (iY
* 8) + 7), fgColor
, BF
' Draw a solid box
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iLastColor
Then iFgColorIndex
= iFirstColor
' ================================================================================================================================================================
' METHOD #8
' _PUTIMAGE with HARDWARE IMAGES v2 (ALL COLOR COMBINATIONS)
' ================================================================================================================================================================
Color cWhite
, cBlack:
Locate 1, 1:
Print "Test #8: DrawColorTileHw8 routine using 1 big multi-tileset and HARDWARE images...";
''_PutImage (xDest%, yDest%), imgTiles&, imgScreen&, (sx1%, sy1%)-(sx2%, sy2%)
'_PutImage (0, 0), imgTilesAllColorsSW, imgScreen
'sleep
'IF TRUE=FALSE THEN
iCount8 = 0
iCount8 = iCount8 + 1
iFirstColor2
= iFirstColor2
Xor 1 iFgColorIndex = iFirstColor2
iBgColorIndex
= iFgColorIndex
+ 1:
If iBgColorIndex
> iLastColor2
Then iBgColorIndex
= iFirstColor2
iY = iMinY
iX = iMinX
DrawColorTileHw8 imgTilesAllColorsHW, iTileNum, imgScreen, iX, iY, iFgColorIndex, iBgColorIndex, arrTileIndex(), arrColorIndex()
iFgColorIndex = iFgColorIndex + 1
If iFgColorIndex
> iLastColor2
Then iFgColorIndex = iFirstColor2
iBgColorIndex = iBgColorIndex + 1
If iBgColorIndex
> iLastColor2
Then iBgColorIndex = iFirstColor2
If imgHardwareScreen
< -1 Or imgHardwareScreen
> 0 Then _FreeImage imgHardwareScreen
' FREE MEMORY 'END IF
If imgTilesAllColorsHW
< -1 Or imgTilesAllColorsHW
> 0 Then _FreeImage imgTilesAllColorsHW
' FREE MEMORY
' ================================================================================================================================================================
' SHOW RESULTS
' ================================================================================================================================================================
Print Using "DrawTile8 ###,###,###,###,###,### refreshes in 3 seconds."; iCount1
Print Using "DrawColorTile ###,###,###,###,###,### refreshes in 3 seconds."; iCount2
Print Using "DrawTileHw8 ###,###,###,###,###,### refreshes in 3 seconds."; iCount3
Print Using "DrawVectorTileLine ###,###,###,###,###,### refreshes in 3 seconds."; iCount4
Print Using "DrawVectorTilePutImage ###,###,###,###,###,### refreshes in 3 seconds."; iCount5
Print Using "DrawVectorTilePutImageHW ###,###,###,###,###,### refreshes in 3 seconds."; iCount6
Print Using "Solid boxes with Line ###,###,###,###,###,### refreshes in 3 seconds."; iCount7
Print Using "DrawColorTileHw8 ###,###,###,###,###,### refreshes in 3 seconds."; iCount8
Print "PRESS ANY KEY TO CONTINUE"
' ================================================================================================================================================================
' CLEANUP AND EXIT
' ================================================================================================================================================================
Screen 0 ' RETURN TO TEXT SCREEN 'If imgHardwareScreen < -1 Or imgHardwareScreen > 0 Then _FreeImage imgHardwareScreen ' FREE MEMORY
'If imgHardwareTiles < -1 Or imgHardwareTiles > 0 Then _FreeImage imgHardwareTiles ' FREE MEMORY
If imgTilesAllColorsSW
< -1 Or imgTilesAllColorsSW
> 0 Then _FreeImage imgTilesAllColorsSW
' FREE MEMORY 'If imgTilesAllColorsHW < -1 Or imgTilesAllColorsHW > 0 Then _FreeImage imgTilesAllColorsHW ' FREE MEMORY
'If imgPaletteHW < -1 Or imgPaletteHW > 0 Then _FreeImage imgPaletteHW ' FREE MEMORY
' ################################################################################################################################################################
' END DRAWING SPEED TEST
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN Steve's very different custom screen
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
Sub TestCustomHardwareScreen2
imgDisplay
= _NewImage(800, 600, 32) ' my main screenwich is 100 by 75 characters with 8x8 font. imgTile
= _NewImage(8 * 256, 8, 32) ' 8x8 tiles in 256 colors imgFont
= _NewImage(8 * 256, 8 * 256, 32) ' 256 characters of an 8x8 font, in all 256 possible colors.
' Set the main screen for starters so it'll go ahead
' and create itself properly while I'm working on making my tiles and fonts
' very tiny 256 color screen, just to borrow the palette from
' 40 colors
' since I don't know your color palette, I'll just copy the QB64 256 color palette. ;)
arrColors
(iLoop
) = _RGB32(_Red(iLoop
, imgTempScreen256
), _Green(iLoop
, imgTempScreen256
), _Blue(iLoop
, imgTempScreen256
)) If imgTempScreen256
< -1 Or imgTempScreen256
> 0 Then _FreeImage imgTempScreen256
' FREE MEMORY
' Create my software tiles of 256 colors
For iLoop
= 0 To 255 ' 256 tiles, one for each color ' all drawn sequentially onto a sprite sheet
Line (iLoop
* 8, 0)-Step(8, 8), arrColors
(iLoop
), BF
' I'm just going to use the built in QB64 8x8 font for quick and easy sheet creation.
For iColor
= 0 To 255 ' 256 colors Color arrColors
(iColor
), 0 ' make our font the proper color For iTile
= 0 To 255 ' 256 characters ' print the characters row by row to the screen
'Sleep ' View the blank screen until a key is hit
Screen imgTile
' View the tiles DebugPrint "Viewing the tiles (imgTile) - press any key to continue"
Sleep ' until a key is hit
Screen imgFont
' view the fonts DebugPrint "Viewing the fonts (imgFont) - press any key to continue"
Sleep ' until a key is hit
Screen imgDisplay
' and back to the normal blank screen _Delay .2 ' time to remove finger from key 'Dim Shared As Long m_TileHw, m_FontHw
m_TileHw
= _CopyImage(imgTile
, 33) ' hardware copy of the tile image m_FontHw
= _CopyImage(imgFont
, 33) ' hardware copy of the font image
If imgTile
< -1 Or imgTile
> 0 Then _FreeImage imgTile
' FREE MEMORY 'free unused images when done with them If imgFont
< -1 Or imgFont
> 0 Then _FreeImage imgFont
' FREE MEMORY 'free unused images when done with them
' From this point onwards, I'm *ONLY* going to use my hardware layer
'' Here, I'm creating a screen array to hold the information
'' of EVERY character I place onto the screen, and its tile
'Dim Shared m_ScreenArray(99, 74) As _Unsigned Long
' To start with, let's put all 256 chracters on the screen,
' on a color 40 tile (red), in a color 3 font (cyan)
iX = 0: iY = 0
' 40 tile color, 3 font color, iLoop is the character
iX
= iX
+ 1:
If iX
> 99 Then iX
= 0: iY
= iY
+ 1 m_ScreenArray(iX, iY) = SetAll(40, 3, iLoop)
' And then let's show these results on the screen.
' Take a moment to open task manager and see how little resources we're using here.
DebugPrint "Viewing the whole screen full of these tiles + characters"
DebugPrint "press ENTER to continue"
' Draw a whole screen full of these tiles + characters
ScreenRender
_Delay .2 ' time to lift up the key so we don't instantly blow past the next loop
iX = 0: iY = 0
' and here I'm going to set all these tiles to have incremental background tile colors
' from left to right, top to bottom
iX
= iX
+ 1:
If iX
> 99 Then iX
= 0: iY
= iY
+ 1 SetArrayTile iX, iY, iLoop ' set each tile to become an ever increasing color value
' And then let's show these results on the screen.
DebugPrint "Viewing the screen with incremental colors"
DebugPrint "press ENTER to continue"
' Draw a whole screen full of these tiles + characters
ScreenRender
' And to finish up, let's do a quick count of how many loops per second
' we *could* process, with the whole screen being redrawn over and over like this
DebugPrint "Counting how many loops per second for 3 seconds..."
count& = 0
count& = count& + 1
ScreenRender
' Return to normal software screen
DebugPrint "Returning to normal software screen"
Print "Whole screen rendering of color tile + color font = "; count&;
" times in 3 seconds." Input "PRESS <ENTER> TO CONTINUE"; in$
End Sub ' TestCustomHardwareScreen2
' /////////////////////////////////////////////////////////////////////////////
Sub TestCustomHardwareScreen1
Print "Custom hardware screen test. Press <ENTER> to proceed through each step." Input "PRESS <ENTER> TO START"; in$
imgDisplay
= _NewImage(800, 600, 32) ' my main screenwich is 100 by 75 characters with 8x8 font. imgTile
= _NewImage(8 * 256, 8, 32) ' 8x8 tiles in 256 colors imgFont
= _NewImage(8 * 256, 8 * 256, 32) ' 256 characters of an 8x8 font, in all 256 possible colors.
' Set the main screen for starters so it'll go ahead
' and create itself properly while I'm working on making my tiles and fonts
' very tiny 256 color screen, just to borrow the palette from
For iLoop
= 0 To 255 ' 40 colors ' since I don't know your color palette, I'll just copy the QB64 256 color palette. ;)
arrColors
(iLoop
) = _RGB32(_Red(iLoop
, imgTempScreen256
), _Green(iLoop
, imgTempScreen256
), _Blue(iLoop
, imgTempScreen256
)) If imgTempScreen256
< -1 Or imgTempScreen256
> 0 Then _FreeImage imgTempScreen256
' FREE MEMORY
' Create my software tiles of 256 colors
For iLoop
= 0 To 255 ' 256 tiles, one for each color Line (iLoop
* 8, 0)-Step(8, 8), arrColors
(iLoop
), BF
' all drawn sequentially onto a sprite sheet
' I'm just going to use the built in QB64 8x8 font for quick and easy sheet creation.
For iColor
= 0 To 255 ' 256 colors Color arrColors
(iColor
), 0 ' make our font the proper color For iTile
= 0 To 255 ' 256 characters _PrintString (iTile
* 8, iColor
* 8), Chr$(iTile
) ' print the characters row by row to the screen
Sleep ' View the blank screen until a key is hit
Screen imgTile
' View the tiles Sleep ' until a key is hit
Screen imgFont
' view the fonts Sleep ' until a key is hit
Screen imgDisplay
' and back to the normal blank screen _Delay .2 ' time to remove finger from key 'Dim Shared As Long m_TileHw, m_FontHw
m_TileHw
= _CopyImage(imgTile
, 33) ' hardware copy of the tile image m_FontHw
= _CopyImage(imgFont
, 33) ' hardware copy of the font image
If imgTile
< -1 Or imgTile
> 0 Then _FreeImage imgTile
' FREE MEMORY 'free unused images when done with them If imgFont
< -1 Or imgFont
> 0 Then _FreeImage imgFont
' FREE MEMORY 'free unused images when done with them
' From this point onwards, I'm *ONLY* going to use my hardware layer
'' Here, I'm creating a screen array to hold the information
'' of EVERY character I place onto the screen, and its tile
'Dim Shared m_ScreenArray(99, 74) As _Unsigned Long
' To start with, let's put all 256 chracters on the screen,
' on a color 40 tile (red), in a color 3 font (cyan)
iX = 0: iY = 0
' 40 tile color, 3 font color, iLoop is the character
iX
= iX
+ 1:
If iX
> 99 Then iX
= 0: iY
= iY
+ 1 m_ScreenArray(iX, iY) = SetAll(40, 3, iLoop)
' And then let's show these results on the screen.
' Take a moment to open task manager and see how little resources we're using here.
' Draw a whole screen full of these tiles + characters
ScreenRender
_Delay .2 ' time to lift up the key so we don't instantly blow past the next loop
iX = 0: iY = 0
' and here I'm going to set all these tiles to have incremental background tile colors
' from left to right, top to bottom
iX
= iX
+ 1:
If iX
> 99 Then iX
= 0: iY
= iY
+ 1 SetArrayTile iX, iY, iLoop ' set each tile to become an ever increasing color value
' And then let's show these results on the screen.
' Draw a whole screen full of these tiles + characters
ScreenRender
' And to finish up, let's do a quick count of how many loops per second
' we *could* process, with the whole screen being redrawn over and over like this
count& = 0
count& = count& + 1
ScreenRender
' Return to normal software screen
Print "Whole screen rendering of color tile + color font = "; count&;
" times in 3 seconds."
Input "PRESS <ENTER> TO CONTINUE"; in$
End Sub ' TestCustomHardwareScreen1
' /////////////////////////////////////////////////////////////////////////////
tileColor = m_ScreenArray(iX, iY) \ (256 * 256)
fontColor = (m_ScreenArray(iX, iY) - tileColor * 256 * 256) \ 256
character
= m_ScreenArray
(iX
, iY
) Mod 256 _PutImage (iX
* 8, iY
* 8)-Step(7, 7), m_FontHw
, , (character
* 8, fontColor
* 8)-Step(7, 7)
' /////////////////////////////////////////////////////////////////////////////
Function SetAll&&
(tile
, fontcolor
, character
) SetAll&& = tile * 256 * 256 + fontcolor * 256 + character
' /////////////////////////////////////////////////////////////////////////////
Sub SetArrayTile
(iX
, iY
, newTileColor
)
temp&& = m_ScreenArray(iX, iY)
oldTile&& = temp&& \ (256 * 256)
m_ScreenArray(iX, iY) = temp&& - oldTile&& + newTileColor * 256 * 256
' /////////////////////////////////////////////////////////////////////////////
Sub SetArrayFontColor
(iX
, iY
, newFontColor
)
temp&& = m_ScreenArray(iX, iY)
oldTile&& = temp&& \ (256 * 256)
oldFont&& = (temp&& - oldTile&&) \ 256
m_ScreenArray(iX, iY) = temp&& - oldFont&& + newFontColor * 256
' /////////////////////////////////////////////////////////////////////////////
Sub SetArrayCharacter
(iX
, iY
, newCharacter
)
temp&& = m_ScreenArray(iX, iY)
oldCharacter&&
= temp&&
Mod 256 m_ScreenArray(iX, iY) = temp&& - oldCharacter&& + newCharacter
' ################################################################################################################################################################
' Re: fastest way to draw a 2-color 8x8 tile (with variable colors)?
' https://qb64forum.alephc.xyz/index.php?topic=4674.msg140904#msg140904
' SMcNeill, QB64 Developer
' Reply #18 on: Yesterday at 05:08:58 pm
'
' One thing that would be *very* different with all hardware images vs what
' you're doing currently, is the fact that you have to remember:
' Hardware images display once and then flush themselves from the GPU buffer.
'
' You can't just print to a tile, and then read the information for the color of
' that tile, and instantly turn that color into another one. You have write
' access to hardware images, but not read access -- and the images aren't
' persistent like the software images are.
'
' For something like this to work for a whole screen in hardware image mode,
' you'd have to sort out some sort of way to store your screen's info and then
' constantly redraw everything over and over again to keep it refreshed on the
' display.
'
' The way I'd go about doing something like this would be to make myself a
' custom SCREEN 0-style memory array. Screen 0 stores all our information for
' each character in 2 bytes -- one for color, one for character. I'd basically
' do the same, but with 3 bytes -- one for tile color, one for font color, one
' for character.
'
' Let me toss a simple demo of this line of thinking for you:
' (TestCustomHardwareScreen1)
'
' I tried to comment the heck out of the code to help explain what it's doing
' from line to line, so I hope this isn't too hard to sort out and understand.
'
' The beginning is nothing more than initializing things and making 2 different
' sprite sheets that I'll make use of later -- one for the tiles and one for the
' characters.
'
' Then there's the mid section where you can SLEEP step through and view the
' various resource sheets.
'
' Then an example of all the characters in a cyan font, resting atop a red tile.
' (You have to hit ENTER to move on from this screen.)
'
' Then an example of all those tiles that go under the characters being replaced
' with sequential colored tiles. (A lot of these tiles are simply BLACK, but
' that's the nature of the 256 color palette as those multiple blacks are there
' to be replaced with custom color values instead.)
'
' Once more, you'll have to hit ENTER to continue.
'
' And then I do a quick time loop to count how many times we can redraw the whole
' screen of tiles + characters in 3 seconds.
'
' For an 800x600 screen (100 x 75 characters and tiles), my laptop does a max of
' about 1800 refreshes in that time. That's around 600 FPS, which would be more
' than enough for any sort of game display or use that I think I could come up
' with, and that's without me trying to optimize math or any such things to
' reduce calculations and speed the process up any more. (Keep in mind, this is
' 1800 full pages of a 800x600 screen -- if your screen has a lower overall
' resolution, then you'd draw more loops with less to process, but a higher
' resolution screen would draw fewer loops with more to process.)
'
' No _MEM access. No optimization work. Just 600 FPS rendering of a whole page
' of tiles and colored characters. (And, YES, it is a whole page being rendered
' repeatedly -- even if I didn't bother to fill in the vast majority of that page
' with anything more than black tiles, black fonts, and chr$(0) blank spaces...)
'
' It's a completely different approach to displaying stuff than what you've been
' doing, but it seems as if what you've been doing isn't working as it must be
' running too slow for you. You wouldn't be able to use the normal PRINT
' statements to display to the faux screen memory array I've created; you'd have
' to write your own.
'
' For a quick speed comparison, here's the same type process ran using PRINT
' and a software screen of the same size:
' (TestSoftwareScreen1)
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
in$ = ""
in$
= in$
+ "Re: fastest way to draw a 2-color 8x8 tile (with variable colors)?" + Chr$(13) in$
= in$
+ "https://qb64forum.alephc.xyz/index.php?topic=4674.msg140904#msg140904" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "SMcNeill, QB64 Developer" + Chr$(13) in$
= in$
+ "Reply #18 on: Yesterday at 05:08:58 pm" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "One thing that would be *very* different with all hardware images vs what " + Chr$(13) in$
= in$
+ "you're doing currently, is the fact that you have to remember: " + Chr$(13) in$
= in$
+ "Hardware images display once and then flush themselves from the GPU buffer. " + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "You can't just print to a tile, and then read the information for the color of " + Chr$(13) in$
= in$
+ "that tile, and instantly turn that color into another one. You have write " + Chr$(13) in$
= in$
+ "access to hardware images, but not read access -- and the images aren't " + Chr$(13) in$
= in$
+ "persistent like the software images are." + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "For something like this to work for a whole screen in hardware image mode, " + Chr$(13) in$
= in$
+ "you'd have to sort out some sort of way to store your screen's info and then " + Chr$(13) in$
= in$
+ "constantly redraw everything over and over again to keep it refreshed on the " + Chr$(13) in$
= in$
+ "display." + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "The way I'd go about doing something like this would be to make myself a " + Chr$(13) in$
= in$
+ "custom SCREEN 0-style memory array. Screen 0 stores all our information for " + Chr$(13) in$
= in$
+ "each character in 2 bytes -- one for color, one for character. I'd basically " + Chr$(13) in$
= in$
+ "do the same, but with 3 bytes -- one for tile color, one for font color, one " + Chr$(13) in$
= in$
+ "for character." + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "Let me toss a simple demo of this line of thinking for you:" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "I tried to comment the heck out of the code to help explain what it's doing " + Chr$(13) in$
= in$
+ "from line to line, so I hope this isn't too hard to sort out and understand." + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "The beginning is nothing more than initializing things and making 2 different " + Chr$(13) in$
= in$
+ "sprite sheets that I'll make use of later -- one for the tiles and one for the " + Chr$(13) in$
= in$
+ "characters." + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "Then there's the mid section where you can SLEEP step through and view the " + Chr$(13) in$
= in$
+ "various resource sheets." + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "Then an example of all the characters in a cyan font, resting atop a red tile. " + Chr$(13) in$
= in$
+ "(You have to hit ENTER to move on from this screen.)" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "Then an example of all those tiles that go under the characters being replaced " + Chr$(13) in$
= in$
+ "with sequential colored tiles. (A lot of these tiles are simply BLACK, but " + Chr$(13) in$
= in$
+ "that's the nature of the 256 color palette as those multiple blacks are there " + Chr$(13) in$
= in$
+ "to be replaced with custom color values instead.)" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "Once more, you'll have to hit ENTER to continue." + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "And then I do a quick time loop to count how many times we can redraw the whole " + Chr$(13) in$
= in$
+ "screen of tiles + characters in 3 seconds." + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "For an 800x600 screen (100 x 75 characters and tiles), my laptop does a max of " + Chr$(13) in$
= in$
+ "about 1800 refreshes in that time. That's around 600 FPS, which would be more " + Chr$(13) in$
= in$
+ "than enough for any sort of game display or use that I think I could come up " + Chr$(13) in$
= in$
+ "with, and that's without me trying to optimize math or any such things to " + Chr$(13) in$
= in$
+ "reduce calculations and speed the process up any more. (Keep in mind, this is " + Chr$(13) in$
= in$
+ "1800 full pages of a 800x600 screen -- if your screen has a lower overall " + Chr$(13) in$
= in$
+ "resolution, then you'd draw more loops with less to process, but a higher " + Chr$(13) in$
= in$
+ "resolution screen would draw fewer loops with more to process.)" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "No _MEM access. No optimization work. Just 600 FPS rendering of a whole page " + Chr$(13) in$
= in$
+ "of tiles and colored characters. (And, YES, it is a whole page being rendered " + Chr$(13) in$
= in$
+ "repeatedly -- even if I didn't bother to fill in the vast majority of that page " + Chr$(13) in$
= in$
+ "with anything more than black tiles, black fonts, and chr$(0) blank spaces...)" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "It's a completely different approach to displaying stuff than what you've been " + Chr$(13) in$
= in$
+ "doing, but it seems as if what you've been doing isn't working as it must be " + Chr$(13) in$
= in$
+ "running too slow for you. You wouldn't be able to use the normal PRINT " + Chr$(13) in$
= in$
+ "statements to display to the faux screen memory array I've created; you'd have " + Chr$(13) in$
= in$
+ "to write your own." + Chr$(13) GetInstructions1$ = in$
' /////////////////////////////////////////////////////////////////////////////
in$ = ""
in$
= in$
+ "Re: fastest way to draw a 2-color 8x8 tile (with variable colors)?" + Chr$(13) in$
= in$
+ "https://qb64forum.alephc.xyz/index.php?topic=4674.msg140904#msg140904" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "SMcNeill, QB64 Developer" + Chr$(13) in$
= in$
+ "Reply #18 on: Yesterday at 05:08:58 pm" + Chr$(13) in$
= in$
+ " " + Chr$(13) in$
= in$
+ "For a quick speed comparison, here's the same type process ran using PRINT " + Chr$(13) in$
= in$
+ "and a software screen of the same size:" + Chr$(13) GetInstructions2$ = in$
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
count = 0
count = count + 1
iTile
= (iTile
+ 1) Mod 256
Print count;
"total screen replacements in 3 seconds." Input "PRESS <ENTER> TO CONTINUE"; in$
' ################################################################################################################################################################
' END Steve's very different custom screen
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN VECTOR-BASED TILE ROUTINES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
Sub DrawVectorTilePutImageTest
Dim imgPalette
As Long ' contains palette of colors Dim iFgColorIndex
As Integer: iFgColorIndex
= iMinFgColorIndex
Dim iBgColorIndex
As Integer: iBgColorIndex
= iMinBgColorIndex
' Initialize colors
arrColor(0) = cBlack
arrColor(1) = cRed
arrColor(2) = cYellow
arrColor(3) = cLime
arrColor(4) = cCyan
arrColor(5) = cBlue
arrColor(6) = cPurple
arrColor(7) = cMagenta
arrColor(8) = cEmpty
' Initialize color names (for test output)
arrColorNames(0) = "cBlack"
arrColorNames(1) = "cRed"
arrColorNames(2) = "cYellow"
arrColorNames(3) = "cLime"
arrColorNames(4) = "cCyan"
arrColorNames(5) = "cBlue"
arrColorNames(6) = "cPurple"
arrColorNames(7) = "cMagenta"
arrColorNames(8) = "cEmpty"
' Set up screen
' Generate color palette
MakePaletteImage imgPalette, arrColor()
'' Draw palette on screen:
''_PutImage (xDest%, yDest%), imgSource&, imgDest&, (sx1%, sy1%)-(sx2%, sy2%)
'_PutImage (400, 300), imgPalette, imgScreen, (0,0)-(_WIDTH(imgPalette), _HEIGHT(imgPalette))
' Set up tiles
GetVectorTiles
' Set up screen boundaries, initial colors, etc.
iMinX
= 0: iMaxX
= _Width(0) \
8 DebugPrint "iMaxX = _Width(0) = " + cstr$(iMaxX)
DebugPrint "iMaxY = _Height(0) = " + cstr$(iMaxY)
iFgColorIndex = iMinFgColorIndex - 1
' Freeze dislay
' Test text
'MyString = "#"
'MyString = "BOO!"
MyString
= "HELLO WORLD " + chr$(147) + " " + chr$(154) + " " + chr$(191) + chr$(13) + _
"THIS IS A TEST!"
iY = 5
iX = 5
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iMaxFgColorIndex
Then iFgColorIndex
= iMinFgColorIndex
iBgColorIndex
= iBgColorIndex
+ 1:
If iBgColorIndex
> iMaxBgColorIndex
Then iBgColorIndex
= iMinBgColorIndex
iTileNum
= Asc(Mid$(MyString
, iLoop
, 1)) ' Linebreak = go to a new line
iX
= iMinX: iY
= iY
+ 1:
If iY
> iMaxY
Then iY
= iMinY
DrawVectorTilePutImage _
imgScreen, imgPalette, arrColor(), _
iTileNum, iX, iY, _
iFgColorIndex, iBgColorIndex
iX
= iX
+ 1:
If iX
> iMaxX
Then iX
= iMinX: iY
= iY
+ 1:
If iY
> iMaxY
Then iY
= iMinY
'iX = iX + 1: iY = iY + 1
' Resume display
' Promput user
Print "Press any key to continue";
Screen 0 ' RETURN TO TEXT SCREEN End Sub ' DrawVectorTilePutImageTest
' /////////////////////////////////////////////////////////////////////////////
' Draw the shape with _PutImage commands using hardware images:
' Requires that this global shared variable be declared:
' Dim Shared m_arrLineTiles(0 To 255, 0 To 32) As RectangleType
' containing
' m_arrLineTiles({iTileNum}, {iShapeNum})
' where for each tile, dimension 2 index 0:
' m_arrLineTiles({iTileNum}, 0).PixelCount
' holds the last used {iShapeNum} index.
' Receives:
' imgScreen& = image handle of the screen to draw to
' imgPalette& = image handle of the palette containing 8x8 squares each with the desired color
' arrColor() = array containing _UNSIGNED Long RGB color values
' iTileNum% = 0-255, number of the tile in m_arrLineTiles to draw
' iX, iY = x/y position to draw 8x8 tile to (multiplied by 8 to get screen position)
' fgColor, bgColor = index for foreground/background color in arrColor (which contains the actual RGB values)
Sub DrawVectorTilePutImage
( _
Dim sc%
' source column on tile sheet Dim sr%
' source row on tile sheet Dim sx1%
' source start x Dim sy1%
' source start y Dim xDest%
' destination x Dim yDest%
' destination y
' Copy from palette
' Draw to screen
' GET THE ROW OF TILE # TileNum% ON THE SOURCE TILE SHEET
sr% = 0 ' TileNum% \ rows%
' GET THE START Y COORDINATE ON THE SOURCE TILE SHEET
sy1% = sr% * 8
' draw background if not transparent
If arrColor
(bgColorIndex
) <> cEmpty
Then ' GET THE COLUMN OF TILE # TileNum% ON THE SOURCE TILE SHEET
sc% = bgColorIndex ' TileNum% Mod rows%
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
sx1% = sc% * 8
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
sx2% = sx1% + 7
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
sy2% = sy1% + 7
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = iX * 8 ' dx% * 8
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = iY * 8 ' (dy% * 8) '+ yOffset%
' Copy portion of source to the top-left corner of the destination page
imgPalette&, imgScreen&, _
(sx1%, sy1%)-(sx2%, sy2%)
For iLoop
= 1 To m_arrLineTiles
(iTileNum
, 0).PixelCount
' GET THE COLUMN OF TILE # TileNum% ON THE SOURCE TILE SHEET
sc% = fgColorIndex ' TileNum% Mod rows%
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
sx1% = sc% * 8
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
'sx2% = sx1% + 7
sx2% = sx1% + (m_arrLineTiles(iTileNum, iLoop).x2 - m_arrLineTiles(iTileNum, iLoop).x1)
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
'sy2% = sy1% + 7
sy2% = sy1% + (m_arrLineTiles(iTileNum, iLoop).y2 - m_arrLineTiles(iTileNum, iLoop).y1)
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = (iX * 8) + m_arrLineTiles(iTileNum, iLoop).x1 ' dx% * 8
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = (iY * 8) + m_arrLineTiles(iTileNum, iLoop).y1 ' (dy% * 8) '+ yOffset%
' Copy portion of source to the top-left corner of the destination page
imgPalette&, imgScreen&, _
(sx1%, sy1%)-(sx2%, sy2%)
End Sub ' DrawVectorTilePutImage
' /////////////////////////////////////////////////////////////////////////////
' (Same as DrawVectorTilePutImage but uses hardware images.)
' Draw the shape with _PutImage commands using hardware images:
' Requires that this global shared variable be declared:
' Dim Shared m_arrLineTiles(0 To 255, 0 To 32) As RectangleType
' containing
' m_arrLineTiles({iTileNum}, {iShapeNum})
' where for each tile, dimension 2 index 0:
' m_arrLineTiles({iTileNum}, 0).PixelCount
' holds the last used {iShapeNum} index.
' Receives:
' imgScreen& = image handle of hardware image for the screen to draw to
' imgPalette& = image handle of hardware image for palette containing 8x8 squares each with the desired color
' arrColor() = array containing _UNSIGNED Long RGB color values
' iTileNum% = 0-255, number of the tile in m_arrLineTiles to draw
' iX, iY = x/y position to draw 8x8 tile to (multiplied by 8 to get screen position)
' fgColor, bgColor = index for foreground/background color in arrColor (which contains the actual RGB values)
Sub DrawVectorTilePutImageHW
( _
Dim sc%
' source column on tile sheet Dim sr%
' source row on tile sheet Dim sx1%
' source start x Dim sy1%
' source start y Dim xDest%
' destination x Dim yDest%
' destination y
' GET THE ROW OF TILE # TileNum% ON THE SOURCE TILE SHEET
sr% = 0 ' TileNum% \ rows%
' GET THE START Y COORDINATE ON THE SOURCE TILE SHEET
sy1% = sr% * 8
' draw background if not transparent
If arrColor
(bgColorIndex
) <> cEmpty
Then ' GET THE COLUMN OF TILE # TileNum% ON THE SOURCE TILE SHEET
sc% = bgColorIndex ' TileNum% Mod rows%
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
sx1% = sc% * 8
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
sx2% = sx1% + 7
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
sy2% = sy1% + 7
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = iX * 8
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = iY * 8
' Copy portion of source to the top-left corner of the destination page
imgPalette&, , _
(sx1%, sy1%)-(sx2%, sy2%)
For iLoop
= 1 To m_arrLineTiles
(iTileNum
, 0).PixelCount
' GET THE COLUMN/ROW OF TILE # TileNum% ON THE SOURCE TILE SHEET
sc% = fgColorIndex ' TileNum% Mod rows%
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
sx1% = sc% * 8
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
sx2% = sx1% + (m_arrLineTiles(iTileNum, iLoop).x2 - m_arrLineTiles(iTileNum, iLoop).x1)
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
sy2% = sy1% + (m_arrLineTiles(iTileNum, iLoop).y2 - m_arrLineTiles(iTileNum, iLoop).y1)
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = (iX * 8) + m_arrLineTiles(iTileNum, iLoop).x1
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = (iY * 8) + m_arrLineTiles(iTileNum, iLoop).y1
' Copy portion of source to the top-left corner of the destination page
imgPalette&, , _
(sx1%, sy1%)-(sx2%, sy2%)
End Sub ' DrawVectorTilePutImageHW
' /////////////////////////////////////////////////////////////////////////////
' Receives an array of _Unsigned Long RGB color values
' and returns a new image imgNew
' containing 8x8 squares with each color
' Usage:
' MakePaletteImage imgNew, arrColorRGB()
Dim tw%
' width/height of tile
tw% = 8 ' SIZE OF TILE
iY = tw%
iX
= ((UBound(arrColorRGB
) - LBound(arrColorRGB
)) + 1) * tw%
iY = 0
iCount = -1
iCount = iCount + 1
iX = iCount * tw%
Line (iX
, iY
)-(iX
+ 7, iY
+ 7), arrColorRGB
(iCount
), BF
' /////////////////////////////////////////////////////////////////////////////
Dim imgPalette
As Long ' contains palette of colors
arrColor(0) = cBlack
arrColor(1) = cRed
arrColor(2) = cYellow
arrColor(3) = cLime
arrColor(4) = cCyan
arrColor(5) = cBlue
arrColor(6) = cPurple
arrColor(7) = cMagenta
'arrColor(8) = cEmpty
MakePaletteImage imgPalette, arrColor()
' Draw palette on screen:
'_PutImage (xDest%, yDest%), imgSource&, imgDest&, (sx1%, sy1%)-(sx2%, sy2%)
' Promput user
'PrintString1 15, 1, "Press any key to continue"
Screen 0 ' RETURN TO TEXT SCREEN
' /////////////////////////////////////////////////////////////////////////////
' Draw the shape with Line commands:
' Requires that this global shared variable be declared:
' Dim Shared m_arrLineTiles(0 To 255, 0 To 32) As RectangleType
' containing
' m_arrLineTiles({iTileNum}, {iShapeNum})
' where for each tile, dimension 2 index 0:
' m_arrLineTiles({iTileNum}, 0).PixelCount
' holds the last used {iShapeNum} index.
Line (iX
, iY
)-(iX
+ 7, iY
+ 7), bgColor
, BF
For iLoop
= 1 To m_arrLineTiles
(iTileNum
, 0).PixelCount
Line (iX
+m_arrLineTiles
(iTileNum
, iLoop
).x1
, _
iY+m_arrLineTiles(iTileNum, iLoop).y1 _
)-(iX+m_arrLineTiles(iTileNum, iLoop).x2, _
iY+m_arrLineTiles(iTileNum, iLoop).y2), _
fgColor, BF
' /////////////////////////////////////////////////////////////////////////////
' Get line drawing coordinates for 8x8 tileset.
' Requires that this global shared variable be declared:
' Dim Shared m_arrLineTiles(0 To 255, 0 To 32) As RectangleType
' containing
' m_arrLineTiles({iTileNum}, {iShapeNum})
' where for each tile, dimension 2 index 0:
' m_arrLineTiles({iTileNum}, 0).PixelCount
' holds the last used {iShapeNum} index.
' VECTOR TILE DRAWING EXPERIMENT
' Translates an 8x8 raster tileset into a set of (hopefully)
' optimized rectangle coordinates that can be quickly drawn to
' the screen with Line.
' GOAL: Optimize for each shape by determining how to draw it with the
' minimum number of line commands.
'
' For example this:
' ' DRAW WITH HORIZONTAL LINES
' Line (iX + 6, iY + 3)-(iX + 6, iY + 3), fgColor
' Line (iX + 6, iY + 4)-(iX + 6, iY + 4), fgColor
' could be replaced with:
' ' DRAW WITH VERTICAL LINES
' Line (iX + 6, iY + 3)-(iX + 6, iY + 4), fgColor
' For each tile, we store a list of line coordinates (x1,y1,x2,y2)
' in a 2D array, and draw using a simple drawing routine that
' receives the list of coordinates, fgColor and bgColor,
' and draws all shapes (solid rectangles) with Line.
' If bgColor is not transparent and if we want a background color
' then we first draw an 8x8 bgColor rectangle first and then
' draw the shape on top of that.
' Rather than compute this on the fly, we could precompute it and
' for each given tile, store the list of those rectangle coordinates
' (x1,y1,x2,y2) for drawing it indexed by the tile's definition in
' hexidecimal where 16-bits (0-F) defines the bit pattern for each
' row in the tile, therefore a tile's definition can be stored by
' 8 characters (or less if we use base 64). Perhaps build a utility
' that will compute the optimal drawing pattern for every possible
' combination of an 8x8 grid, and index them all by the tile's 8-byte
' hexidecimal definition. It might take a while to run, but once it
' does, we will have a database of every possible tile's optimized
' drawing instructions that can be quickly looked up.
' Then we only pull out those definitions for the tiles that our
' given program uses, so the data would be relatively small
' (even smaller if we encode it with base-64).
' TODO: maybe optimize with linked list?
Dim RoutineName
As String: RoutineName
= "GetVectorTiles" ReDim arrShapes1
(-1) As RectangleType
'' DEBUG
'Dim sStartTime As String : sStartTime = "TBD"
'Dim sEndTime As String : sEndTime = "TBD"
'sStartTime = CurrentDateTime$
'DebugPrint CurrentDateTime$ + " started " + RoutineName
' Get raster tiles as a string array
GetTileText arrTileText()
' Get minimum set of Line coordinates for each tile
FindOptimizedVector arrTileText(iTileNum), arrShapes1()
' If we have coordinates, add it to the database
'DebugPrint "# x1 y1 x2 y2 Pixels IsActive"
'for iLoop1 = lbound(arrShapes1) to ubound(arrShapes1)
' sLine = ""
' sLine = sLine + left$(cstr$(iLoop1) + String$(4, " "), 4)
' sLine = sLine + left$(cstr$(arrShapes1(iLoop1).x1) + String$(2, " "), 2) + " "
' sLine = sLine + left$(cstr$(arrShapes1(iLoop1).y1) + String$(2, " "), 2) + " "
' sLine = sLine + left$(cstr$(arrShapes1(iLoop1).x2) + String$(2, " "), 2) + " "
' sLine = sLine + left$(cstr$(arrShapes1(iLoop1).y2) + String$(2, " "), 2) + " "
' sLine = sLine + left$(cstr$(arrShapes1(iLoop1).PixelCount) + String$(7, " "), 7) + " "
' sLine = sLine + TrueFalse$(arrShapes1(iLoop1).IsActive)
' DebugPrint sLine
'next iLoop1
' SAVE SHAPES TO TILE
iLen = 0
If arrShapes1
(iLoop1
).IsActive
= TRUE
Then iLen = iLen + 1
' NOTE: we do -1 because FindOptimizedVector does it 1-based,
' don't ask me why, i was confused and don't want to
' spend time right now to fix it,
' but it saves math later to do 0-based
m_arrLineTiles(iTileNum, iLen).x1 = arrShapes1(iLoop1).x1 - 1
m_arrLineTiles(iTileNum, iLen).y1 = arrShapes1(iLoop1).y1 - 1
m_arrLineTiles(iTileNum, iLen).x2 = arrShapes1(iLoop1).x2 - 1
m_arrLineTiles(iTileNum, iLen).y2 = arrShapes1(iLoop1).y2 - 1
m_arrLineTiles(iTileNum, iLen).PixelCount = arrShapes1(iLoop1).PixelCount
m_arrLineTiles(iTileNum, iLen).IsActive = arrShapes1(iLoop1).IsActive
' MARK TILE (ubound 2, index 0) AS HAVING SHAPES + SAVE COUNT
m_arrLineTiles(iTileNum, 0).IsActive = TRUE
m_arrLineTiles(iTileNum, 0).PixelCount = iLen ' (iTileNum, 0).PixelCount stores the # of shapes
' DISABLE ANY REMAINING ENTRIES
m_arrLineTiles(iTileNum, iLoop1).IsActive = FALSE
' This tile must have been blank
'DebugPrint "*** NO SHAPES TO DRAW THIS TILE ***"
' MARK THIS TILE AS HAVING NO SHAPES
m_arrLineTiles(iTileNum, 0).IsActive = FALSE
m_arrLineTiles(iTileNum, 0).PixelCount = 0 ' (iTileNum, 0).PixelCount stores the # of shapes
'' DEBUG
'sEndTime = CurrentDateTime$
'DebugPrint RoutineName + " finished:"
'DebugPrint " started at: " + sStartTime
'DebugPrint " finished at: " + sEndTime
' /////////////////////////////////////////////////////////////////////////////
' 254 solid
' 253 empty
' 252 shaded
' 241 bricks
' 191 checker
' 194 - 197 arrows u/d/l/r
' 169 top left corner
' 154 diamond
' 155 +
' 151 empty circle
' 145 solid circle
' 147 heart
Dim iFgColorIndex
As Integer: iFgColorIndex
= iMinFgColorIndex
Dim iBgColorIndex
As Integer: iBgColorIndex
= iMinBgColorIndex
' Initialize colors
arrColor(0) = cBlack
arrColor(1) = cRed
arrColor(2) = cYellow
arrColor(3) = cLime
arrColor(4) = cCyan
arrColor(5) = cBlue
arrColor(6) = cPurple
arrColor(7) = cMagenta
arrColor(8) = cEmpty
' Set up screen
' Set up tiles
GetVectorTiles
' Test text
MyString
= "HELLO WORLD " + chr$(147) + " " + chr$(154) + " " + chr$(191) + chr$(13) + _
"THIS IS A TEST!"
' Set up screen boundaries, initial colors, etc.
iMinX
= 0: iMaxX
= _Width(0) \
8 iFgColorIndex = iMinFgColorIndex - 1
iY = 5
iX = 5
iFgColorIndex
= iFgColorIndex
+ 1:
If iFgColorIndex
> iMaxFgColorIndex
Then iFgColorIndex
= iMinFgColorIndex
iBgColorIndex
= iBgColorIndex
+ 1:
If iBgColorIndex
> iMaxBgColorIndex
Then iBgColorIndex
= iMinBgColorIndex
iTileNum
= Asc(Mid$(MyString
, iLoop
, 1)) ' Linebreak = go to a new line
iX
= iMinX: iY
= iY
+ 1:
If iY
> iMaxY
Then iY
= iMinY
'DrawVectorTileLine iTileNum, iX*8, iY*8, arrColor(iFgColorIndex), cEmpty
DrawVectorTileLine iTileNum, iX * 8, iY * 8, arrColor(iFgColorIndex), arrColor(iBgColorIndex)
iX
= iX
+ 1:
If iX
> iMaxX
Then iX
= iMinX: iY
= iY
+ 1:
If iY
> iMaxY
Then iY
= iMinY
' Promput user
Print "Press any key to continue";
Screen 0 ' RETURN TO TEXT SCREEN
' /////////////////////////////////////////////////////////////////////////////
' Calculates and returns the coordinates for every possible rectangle shape
' from 1-8 pixels high, and 1-8 pixels wide.
Sub GetAllPossibleShapes
(arrShapes1
() As RectangleType
) ReDim arrShapes1
(-1) As RectangleType
' Add next shape to array
iIndex
= UBound(arrShapes1
) + 1
' Save coordinates
arrShapes1(iIndex).x1 = 1
arrShapes1(iIndex).y1 = 1
arrShapes1(iIndex).x2 = iLoopCols
arrShapes1(iIndex).y2 = iLoopRows
arrShapes1
(UBound(arrShapes1
)).PixelCount
= 0
' Count Pixels
iLoopY >= arrShapes1(iIndex).y1 _
iLoopY <= arrShapes1(iIndex).y2 _
iLoopX >= arrShapes1(iIndex).x1 _
iLoopX <= arrShapes1(iIndex).x2 _
'sLine = sLine + "#"
arrShapes1
(UBound(arrShapes1
)).PixelCount
= arrShapes1
(UBound(arrShapes1
)).PixelCount
+ 1 'sLine = sLine + "."
'DebugPrint sLine
End Sub ' GetAllPossibleShapes
' /////////////////////////////////////////////////////////////////////////////
' Tests GetAllPossibleShapes to retrieve the coordinates for every possible
' rectangle shape from 1-8 pixels high, and 1-8 pixels wide,
' and uses Line to draw them on the screen.
Sub GetAllPossibleShapesTest
ReDim arrShapes1
(-1) As RectangleType
iMinX = 0
iMinY = 17
iMaxX
= (_Width(0) / 8) ' iMaxX = _Width(0) - 16 iOffsetY = iMinY
iOffsetX = iMinX
arrColor(0) = cBlack
arrColor(1) = cRed
arrColor(2) = cYellow
arrColor(3) = cLime
arrColor(4) = cCyan
arrColor(5) = cBlue
arrColor(6) = cPurple
arrColor(7) = cMagenta
GetAllPossibleShapes arrShapes1()
iColorIndex = iMinColorIndex
DebugPrint _
"(" + cstr$(arrShapes1(iLoopShape).x1) + ", " + cstr$(arrShapes1(iLoopShape).y1) + ")-" + _
"(" + cstr$(arrShapes1(iLoopShape).x2) + ", " + cstr$(arrShapes1(iLoopShape).y2) + ") " + _
cstr$(arrShapes1(iLoopShape).PixelCount) + " pixels"
iX = arrShapes1(iLoopShape).x1 + iOffsetX
iY = arrShapes1(iLoopShape).y1 + iOffsetY
iSizeW = (arrShapes1(iLoopShape).x2 - arrShapes1(iLoopShape).x1) + 1
iSizeH = (arrShapes1(iLoopShape).y2 - arrShapes1(iLoopShape).y1) + 1
fgColor = arrColor(iColorIndex)
DrawRectSolid iX, iY, iSizeW, iSizeH, fgColor
iOffsetX
= iOffsetX
+ 16:
If iOffsetX
> iMaxX
Then iOffsetX
= iMinX: iOffsetY
= iOffsetY
+ 16:
If iOffsetY
> iMaxY
Then iOffsetY
= iMinY
iColorIndex
= iColorIndex
+ 1:
If iColorIndex
> iMaxColorIndex
Then iColorIndex
= iMinColorIndex
Input "PRESS <ENTER> TO CONTINUE"; in$
End Sub ' GetAllPossibleShapes
' /////////////////////////////////////////////////////////////////////////////
DebugPrint sVarName + ":"
DebugPrint "RectangleType:"
DebugPrint _
"(" + cstr$(oShape.x1) + ", " + cstr$(oShape.y1) + ")-" + _
"(" + cstr$(oShape.x2) + ", " + cstr$(oShape.y2) + ") " + _
cstr$(oShape.PixelCount) + " pixels, " + _
"IsActive=" + TrueFalse$(oShape.IsActive)
sLine = ""
iLoopY >= oShape.y1 _
iLoopY <= oShape.y2 _
iLoopX >= oShape.x1 _
iLoopX <= oShape.x2 _
sLine = sLine + "#"
sLine = sLine + "."
DebugPrint sLine
DebugPrint ""
' /////////////////////////////////////////////////////////////////////////////
' Dump all shapes in array.
' {i} in sVarName is replaced by array index
Sub DumpShapeList
(arrShapes
() As RectangleType
, sVarName
As String)
sNextVarName = Replace$(sVarName, "{i}", cstr$(iLoop1))
DumpNextShape arrShapes(iLoop1), sVarName
' /////////////////////////////////////////////////////////////////////////////
' Receives an array of shapes
'
Sub GetActiveShapes
(arrShapes2
() As RectangleType
, arrShapes3
() As RectangleType
) ReDim arrShapes3
(-1) As RectangleType
If arrShapes2
(iLoopShape
).IsActive
= TRUE
Then iIndex
= UBound(arrShapes3
) + 1 arrShapes3(iIndex).y1 = arrShapes2(iLoopShape).y1
arrShapes3(iIndex).x1 = arrShapes2(iLoopShape).x1
arrShapes3(iIndex).y2 = arrShapes2(iLoopShape).y2
arrShapes3(iIndex).x2 = arrShapes2(iLoopShape).x2
arrShapes3(iIndex).PixelCount = arrShapes2(iLoopShape).PixelCount
arrShapes3(iIndex).IsActive = arrShapes2(iLoopShape).IsActive
' /////////////////////////////////////////////////////////////////////////////
' Convert delimited lists into integer arrays
GetIntegerArrayFromDelimList sList1, sDelim, 0, arrList1()
GetIntegerArrayFromDelimList sList2, sDelim, 0, arrList2()
' Are lists same size?
bResult = TRUE
' Check list #2 against list #1
' Are all items in list #1 in list #2?
bFound = FALSE
If arrList2
(iLoop2
) = arrList1
(iLoop1
) Then bFound = TRUE
' not found, lists not equal
bResult = FALSE
' Check list #1 against list #2
bFound = FALSE
If arrList1
(iLoop2
) = arrList2
(iLoop1
) Then bFound = TRUE
' not found, lists not equal
bResult = FALSE
' Return results
DelimIntegerListsAreEqual% = bResult
' /////////////////////////////////////////////////////////////////////////////
' DumpTileFromShapes arrShapes1(), bIncludeInactive, bShowRowsAndColumns
Sub DumpTileFromShapes
(arrShapes1
() As RectangleType
, bIncludeInactive
As Integer, bShowRowsAndColumns
As Integer)
' Initialize next tile
For iDestY
= 1 To 8:
For iDestX
= 1 To 8: arrTile1
(iDestY
, iDestX
) = ".":
Next iDestX:
Next iDestY
' Draw all (active) shapes onto tile
If arrShapes1
(iLoop1
).IsActive
= TRUE
Or bIncludeInactive
= TRUE
Then If iDestY
>= arrShapes1
(iLoop1
).y1
Then If iDestY
<= arrShapes1
(iLoop1
).y2
Then If iDestX
>= arrShapes1
(iLoop1
).x1
Then If iDestX
<= arrShapes1
(iLoop1
).x2
Then arrTile1(iDestY, iDestX) = "#"
' Output the shape
If bShowRowsAndColumns
= TRUE
Then DebugPrint
" 12345678" sLine = ""
If bShowRowsAndColumns
= TRUE
Then sLine
= sLine
+ cstr$
(iDestY
) sLine = sLine + arrTile1(iDestY, iDestX)
If bShowRowsAndColumns
= TRUE
Then sLine
= sLine
+ cstr$
(iDestY
) DebugPrint sLine
If bShowRowsAndColumns
= TRUE
Then DebugPrint
" 12345678"
' /////////////////////////////////////////////////////////////////////////////
' DumpTile arrTile1(), bShowRowsAndColumns
' Output the tile
If bShowRowsAndColumns
= TRUE
Then DebugPrint
" 12345678" sLine = ""
If bShowRowsAndColumns
= TRUE
Then sLine
= sLine
+ cstr$
(iDestY
) sLine = sLine + arrTile1(iDestY, iDestX)
If bShowRowsAndColumns
= TRUE
Then sLine
= sLine
+ cstr$
(iDestY
) DebugPrint sLine
If bShowRowsAndColumns
= TRUE
Then DebugPrint
" 12345678"
' /////////////////////////////////////////////////////////////////////////////
' Receives an 8x8 raster tile definition and returns a list of coordinates
' for the minimum number of rectangles to draw that tile.
' This version uses a brute force method, ie draw every size rectangle
' from 1x1 up to 8x8 (which can themselves be precalculated) in every
' available location in the 8x8 grid (where no part of any rectangle falls
' off the grid), then tries every combination of those rectangles to find
' the combination where the the minimum number of rectangles cover all
' points (or if 2 combinations have the same # of rectangles, the one that
' covers the lesser total points).
' (You can try searching for "rectangular decomposition of binary images"
' and similar to find a better algorithm.)
' Receives:
' TileString (String) = contains 8x8 raster tile definition as a string, where
' empty space represended by ".",
' pixel represented by any non-whitespace character,
' each row separated by chr$(13).
' Returns (byref):
' arrOptimizedShapes (array of RectangleType) = array of rectangle coordinates
' defining the shapes that will draw the tile.
'
' Return value = empty string if successful, error message if not.
Sub FindOptimizedVector
(TileString
As String, arrShapes1
() As RectangleType
) Dim RoutineName
As String: RoutineName
= "FindOptimizedVector" ReDim arrShapes2
(-1) As RectangleType
ReDim arrCompare
(-1) As DrawCompareType
Dim oShapeSet
As DrawCompareType
'' ****************************************************************************************************************************************************************
'' DEBUG:
'Dim sStartTime As String : sStartTime = CurrentDateTime$
'Dim sEndTime As String : sEndTime = ""
'DebugPrint sStartTime + " started " + RoutineName
'' ****************************************************************************************************************************************************************
' =============================================================================
' INITIALIZE
' -----------------------------------------------------------------------------
' Init results
ReDim arrShapes1
(-1) As RectangleType
' -----------------------------------------------------------------------------
' Turn tile into 2D array
StringTo2dArray arrTile1(), TileString
' -----------------------------------------------------------------------------
' Count pixels
iPixelCount = 0
If arrTile1
(iLoopY
, iLoopX
) <> "." Then iPixelCount = iPixelCount + 1
' If shape is blank no need to continue looking
' we can just return an empty array
bContinue = FALSE
' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
' BEGIN LOOK FOR MINIMUM COMBINATION OF SHAPES TO DRAW TILE
' =============================================================================
' Get a set of every size shape (rectangle) from 1x1 up to 8x8
GetAllPossibleShapes arrShapes1()
'DebugPrint "ALL POSSIBLE SHAPES:"
'DumpShapeList arrShapes1(), "arrShapes1{i}"
' =============================================================================
' Try each shape in every location on the tile, to see which fit
' Try plotting next shape in every position
' Track whether shape is fully on the tile at this position
bShapeFits = FALSE
' Does shape fit at this Y position?
iSizeY = arrShapes1(iLoop1).y2 - arrShapes1(iLoop1).y1
iEndY = iDestY + iSizeY
' Does shape fit at this X position?
iSizeX = arrShapes1(iLoop1).x2 - arrShapes1(iLoop1).x1
iEndX = iDestX + iSizeX
' The shape is fully on the tile here
bShapeFits = TRUE
' Now see if any of shape's pixels fall outside of tile's pixels?
For iTestY
= iDestY
To iEndY
For iTestX
= iDestX
To iEndX
If arrTile1
(iTestY
, iTestX
) = "." Then ' No pixel here, shape fails
bShapeFits = FALSE
' If shape fits, add it to the list of shapes/positions that work for the tile
iIndex
= UBound(arrShapes2
) + 1 arrShapes2(iIndex).y1 = iDestY
arrShapes2(iIndex).x1 = iDestX
arrShapes2(iIndex).y2 = iEndY
arrShapes2(iIndex).x2 = iEndX
arrShapes2(iIndex).PixelCount = arrShapes1(iLoop1).PixelCount
arrShapes2(iIndex).IsActive = TRUE
' Eliminate non-active shapes
GetActiveShapes arrShapes2(), arrShapes1()
'DebugPrint "ALL SHAPES/LOCATIONS THAT MATCHED + FIT:"
'DumpShapeList arrShapes2(), "arrShapes2{i}"
' =============================================================================
' Remove redundant shapes (any where another shape covers more points)
' make sure shape #1 was not eliminated
If arrShapes1
(iLoop1
).IsActive
= TRUE
Then ' compare shape #1 against all other shapes
' don't compare against itself
' make sure shape #2 was not eliminated
If arrShapes1
(iLoop2
).IsActive
= TRUE
Then ' can shape #2 do what shape #1 can do? (covers all points shape #1 does)
arrShapes1(iLoop1).y1 >= arrShapes1(iLoop2).y1 _
arrShapes1(iLoop1).y2 <= arrShapes1(iLoop2).y2 _
arrShapes1(iLoop1).x1 >= arrShapes1(iLoop2).x1 _
arrShapes1(iLoop1).x2 <= arrShapes1(iLoop2).x2 _
' does shape #2 do it better? (cover more points than shape #1)
If arrShapes1
(iLoop2
).PixelCount
>= arrShapes1
(iLoop1
).PixelCount
Then ' Remove shape #1
arrShapes1(iLoop1).IsActive = FALSE
' Eliminate non-active shapes
GetActiveShapes arrShapes1(), arrShapes2()
'DebugPrint "SHAPES THAT MATCHED + FIT, NON-REDUNDANT LEVEL 1:"
'DumpShapeList arrShapes2(), "arrShapes2{i}"
' =============================================================================
' Can we do without any?
' Compare all combinations subtractively:
' 1. Count enabled shapes + total pixels for full list of shapes "set A".
' 2. Save "set A" to the "contender list",
' with the shape count and total pixel count.
' 3. For each shape "x":
' a) see if full tile can still be drawn without "x"
' (where the set of shapes minus "x" is "set y").
' b) If full tile can be drawn, save "set y" to the "contender list"
' with the shape count and total pixel count.
' 4. When done, identify the winner "set z" that can draw the full tile
' using the minimum shape coverage.
' a) The set with the smallest tile count wins.
' b) In the event of a tie, the set with the least total pixel count wins.
' c) In the event of another tie, just use the first finalist.
' 5. Disable all shapes NOT in the winning "set z".
' 6. Save list of enabled shapes to "last winner".
' 7. Repeat steps 1-5 until, comparing the list of enabled shapes to
' the list "last winner". When the list stops changing (lists are equal),
' we have gone as far as we can go.
' 8. Return shapes in "last winner" as final result.
' -----------------------------------------------------------------------------
' Start with all
' 1. Count enabled shapes + total pixels for full list of shapes "set A".
' 2. Save "set A" to the "contender list",
' with the shape count and total pixel count.
sItemList = ""
iShapeCount = 0
iPixelCount = 0
sItemList
= sItemList
+ IIFSTR$
(Len(sItemList
) = 0, "", ",") + cstr$
(iLoop1
) iShapeCount = iShapeCount + 1
iPixelCount = iPixelCount + arrShapes2(iLoop1).PixelCount
oShapeSet.IndexList = sItemList
oShapeSet.ShapeCount = iShapeCount
oShapeSet.PixelCount = iPixelCount
oShapeSet.IsActive = TRUE
' -----------------------------------------------------------------------------
' Now see which combinations can draw the tile
iRound = 0
bFinished = FALSE
' At the top of the loop, oShapeSet contains the latest set of shapes
iRound = iRound + 1
' Get the list of shapes (indexes pointing to each shape in arrShapes2)
' All this packing and unpacking probably wastes cycles
' It might not be necessary if we had arrays inside of types!
GetIntegerArrayFromDelimList oShapeSet.IndexList, ",", 0, arrTestIndex()
' Clear the list of contenders
ReDim arrCompare
(-1) As DrawCompareType
'' ****************************************************************************************************************************************************************
'DebugPrint "################################################################################################################################################################"
'DebugPrint "Round " + cstr$(iRound) + " shapes to dedupe:"
'for iLoop2 = lbound(arrTestIndex) to ubound(arrTestIndex)
' iIndex = arrTestIndex(iLoop2)
' DumpNextShape arrShapes2(iIndex), "Shape " + cstr$(iIndex) + " round " + cstr$(iRound) + ""
' DebugPrint ""
'Next iLoop2
'DebugPrint "################################################################################################################################################################"
'' ****************************************************************************************************************************************************************
' 3. For each shape "x":
' a) see if full tile can still be drawn without "x"
' (where the set of shapes minus "x" is "set y").
' b) If full tile can be drawn, save "set y" to the "contender list"
' with the shape count and total pixel count.
''DEBUG:
'DebugPrint "????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????"
'DebugPrint "Can we eliminate " + cstr$(iLoop1) ' this shape?"
'DumpNextShape arrShapes2(iLoop1), "arrShapes2(" + cstr$(iLoop1) + ")"
'DebugPrint "????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????"
'DebugPrint ""
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Clear test tile
arrTile2(iDestY, iDestX) = "."
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Try drawing next combination of shapes in the test tile
sItemList = ""
iShapeCount = 0
iPixelCount = 0
' Make sure it's not shape "x"
iIndex = arrTestIndex(iLoop2)
sItemList
= sItemList
+ IIFSTR$
(Len(sItemList
) = 0, "", ",") + cstr$
(iIndex
) iShapeCount = iShapeCount + 1
iPixelCount = iPixelCount + arrShapes2(iIndex).PixelCount
If iDestY
>= arrShapes2
(iIndex
).y1
Then If iDestY
<= arrShapes2
(iIndex
).y2
Then If iDestX
>= arrShapes2
(iIndex
).x1
Then If iDestX
<= arrShapes2
(iIndex
).x2
Then arrTile2(iDestY, iDestX) = "#"
''DebugPrint "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
''DebugPrint "Attempted drawing tile without " + cstr$(iLoop1) ' item #" + cstr$(iLoop1)
''DumpTile arrTile2(), TRUE
'DebugPrint "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
'DebugPrint ""
'DebugPrint "RESULT$:"
iShapeIndex = arrTestIndex(iLoop1)
' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' Does the test tile match the real tile?
sCompare = TilesAreEqual$(arrTile1(), arrTile2())
' Add to the list of contenders
iIndex
= UBound(arrCompare
) + 1 arrCompare(iIndex).IndexList = sItemList
arrCompare(iIndex).ShapeCount = iShapeCount
arrCompare(iIndex).PixelCount = iPixelCount
arrCompare(iIndex).IsActive = TRUE
'DebugPrint "*******************************************************************************"
'DebugPrint "YES: Tile can be drawn without shape " + cstr$(iShapeIndex) + " round " + cstr$(iRound)
'DebugPrint "arrCompare(" + cstr$(iIndex) + ").IndexList = " + sItemList
'DebugPrint "arrCompare(" + cstr$(iIndex) + ").ShapeCount = " + cstr$(iShapeCount)
'DebugPrint "arrCompare(" + cstr$(iIndex) + ").PixelCount = " + cstr$(PixelCount)
'DebugPrint "*******************************************************************************"
'else
'DebugPrint "*******************************************************************************"
'DebugPrint "NOPE: Tile cannot be drawn without shape " + cstr$(iShapeIndex) + " round " + cstr$(iRound)
'DebugPrint sCompare
'DebugPrint "Attempted with:"
'DebugPrint ".IndexList = " + sItemList
'DebugPrint ".ShapeCount = " + cstr$(iShapeCount)
'DebugPrint ".PixelCount = " + cstr$(PixelCount)
'DebugPrint "*******************************************************************************"
' =============================================================================
' Identify the best combination that uses the least # of shapes + pixels
' DEDUPE IF THERE ARE >1 GROUPS
'' ****************************************************************************************************************************************************************
''DEBUG:
'DebugPrint "RESULTS BEFORE DEDUPE:"
'sLine = ","
'for iLoop2 = lbound(arrCompare) to ubound(arrCompare)
' if arrCompare(iLoop2).IsActive = TRUE then
' sLine = sLine + cstr$(iLoop2) + ","
' DebugPrint "-------------------------------------------------------------------------------"
' DebugPrint "arrCompare(" + cstr$(iLoop2) + ").IndexList = " + arrCompare(iLoop2).IndexList
' DebugPrint "arrCompare(" + cstr$(iLoop2) + ").ShapeCount = " + cstr$(arrCompare(iLoop2).ShapeCount)
' DebugPrint "arrCompare(" + cstr$(iLoop2) + ").PixelCount = " + cstr$(arrCompare(iLoop2).PixelCount)
' DebugPrint "arrCompare(" + cstr$(iLoop2) + ").IsActive = " + TrueFalse$(arrCompare(iLoop2).IsActive)
' end if
'next iLoop2
'DebugPrint ""
'' ****************************************************************************************************************************************************************
If arrCompare
(iLoop1
).IsActive
= TRUE
Then If arrCompare
(iLoop2
).IsActive
= TRUE
Then If arrCompare
(iLoop2
).ShapeCount
< arrCompare
(iLoop1
).ShapeCount
Then arrCompare(iLoop1).IsActive = FALSE
ElseIf arrCompare
(iLoop2
).ShapeCount
> arrCompare
(iLoop1
).ShapeCount
Then arrCompare(iLoop2).IsActive = FALSE
If arrCompare
(iLoop2
).PixelCount
< arrCompare
(iLoop1
).PixelCount
Then arrCompare(iLoop1).IsActive = FALSE
ElseIf arrCompare
(iLoop2
).PixelCount
> arrCompare
(iLoop1
).PixelCount
Then arrCompare(iLoop2).IsActive = FALSE
arrCompare(iLoop2).IsActive = FALSE
'' ****************************************************************************************************************************************************************
''DEBUG:
'DebugPrint "RESULTS AFTER DEDUPE:"
'for iLoop2 = lbound(arrCompare) to ubound(arrCompare)
' if InStr(1, sLine, "," + cstr$(iLoop2) + ",") > 0 then
' DebugPrint "-------------------------------------------------------------------------------"
' DebugPrint "arrCompare(" + cstr$(iLoop2) + ").IndexList = " + arrCompare(iLoop2).IndexList
' DebugPrint "arrCompare(" + cstr$(iLoop2) + ").ShapeCount = " + cstr$(arrCompare(iLoop2).ShapeCount)
' DebugPrint "arrCompare(" + cstr$(iLoop2) + ").PixelCount = " + cstr$(arrCompare(iLoop2).PixelCount)
' DebugPrint "arrCompare(" + cstr$(iLoop2) + ").IsActive = " + TrueFalse$(arrCompare(iLoop2).IsActive)
' end if
'next iLoop2
'DebugPrint ""
'' ****************************************************************************************************************************************************************
' =============================================================================
' Identify the winner!
' Look at the list of indexes that make up the winning shape combination,
' and pick the first one.
'DebugPrint "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
'DebugPrint "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
'DebugPrint "LOOK FOR THE WINNER, END ROUND " + cstr$(iRound)
'DebugPrint "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
'DebugPrint "%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%"
iIndex = -1
'DebugPrint "arrCompare(" + cstr$(lbound(arrCompare)) + " To " + cstr$(ubound(arrCompare)) + ")"
'DebugPrint ""
'DebugPrint "Group Status"
'DebugPrint "----- ----------"
If arrCompare
(iLoop1
).IsActive
= TRUE
Then iIndex = iLoop1
' DebugPrint left$(cstr$(iLoop1) + " ", 5) + " " + "IsActive WINNER"
' else
' DebugPrint left$(cstr$(iLoop1) + " ", 5) + " " + "IsActive"
' else
' DebugPrint left$(cstr$(iLoop1) + " ", 5) + " " + "(disabled)"
'DebugPrint ""
' =============================================================================
' Has it changed from the last round?
'DebugPrint "////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"
'DebugPrint "Has it changed from the last round?"
'DebugPrint "iIndex=" + cstr$(iIndex)
'DebugPrint "////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"
'DebugPrint ""
'DebugPrint "Comparing arrCompare(" + cstr$(iIndex) + ").IndexList: " + arrCompare(iIndex).IndexList
'DebugPrint " to oShapeSet.IndexList: " + oShapeSet.IndexList
'DebugPrint ""
If DelimIntegerListsAreEqual%
(arrCompare
(iIndex
).IndexList
, oShapeSet.IndexList
, ",") = TRUE
Then 'DebugPrint "DelimIntegerListsAreEqual% returns TRUE"
'DebugPrint "FOUND WINNER (Group #" + cstr$(iIndex) + ") exiting..."
' no change, we have reduced as much as possible, exit
bFinished = TRUE
'DebugPrint "DelimIntegerListsAreEqual% returns FALSE"
'DebugPrint "None yet, try next data"
'DebugPrint "Replacing old best set: "
'DebugPrint " IndexList=" + oShapeSet.IndexList
'DebugPrint " ShapeCount=" + cstr$(oShapeSet.ShapeCount)
'DebugPrint " PixelCount=" + cstr$(oShapeSet.PixelCount)
'DebugPrint " IsActive =" + TrueFalse$(oShapeSet.IsActive)
'DebugPrint "with arrCompare(" + cstr$(iIndex) + ")"
'DebugPrint " IndexList=" + arrCompare(iIndex).IndexList
'DebugPrint " ShapeCount=" + cstr$(arrCompare(iIndex).ShapeCount)
'DebugPrint " PixelCount=" + cstr$(arrCompare(iIndex).PixelCount)
'DebugPrint " IsActive =" + TrueFalse$(arrCompare(iIndex).IsActive)
'DebugPrint "and continuing to compare..."
' Continue reducing with the latest set
oShapeSet.IndexList = arrCompare(iIndex).IndexList
oShapeSet.ShapeCount = arrCompare(iIndex).ShapeCount
oShapeSet.PixelCount = arrCompare(iIndex).PixelCount
oShapeSet.IsActive = TRUE
'DebugPrint "(NONE FOUND THAT WORKED, USE THE EXISTING oShapeSet)"
'DebugPrint "Replacing old best set: "
'DebugPrint " oShapeSet.IndexList=" + oShapeSet.IndexList
'DebugPrint " oShapeSet.ShapeCount=" + cstr$(oShapeSet.ShapeCount)
'DebugPrint " oShapeSet.PixelCount=" + cstr$(oShapeSet.PixelCount)
'DebugPrint " oShapeSet.IsActive =" + TrueFalse$(oShapeSet.IsActive)
' none found that works, exit
bFinished = TRUE
' =============================================================================
' Build results
' Get the list of shapes (indexes pointing to each shape in arrShapes1)
GetIntegerArrayFromDelimList oShapeSet.IndexList, ",", 0, arrTestIndex()
' Initialize the final output
ReDim arrShapes1
(-1) As RectangleType
' Add the shapes to the final list
iShapeIndex = arrTestIndex(iLoop2)
iIndex
= UBound(arrShapes1
) + 1
'DebugPrint "Copying arrShapes2(" + cstr$(iShapeIndex) + ") to arrShapes1(" + cstr$(iIndex) + "):"
If arrShapes2
(iShapeIndex
).IsActive
= TRUE
Then arrShapes1(iIndex).x1 = arrShapes2(iShapeIndex).x1
arrShapes1(iIndex).y1 = arrShapes2(iShapeIndex).y1
arrShapes1(iIndex).x2 = arrShapes2(iShapeIndex).x2
arrShapes1(iIndex).y2 = arrShapes2(iShapeIndex).y2
arrShapes1(iIndex).PixelCount = arrShapes2(iShapeIndex).PixelCount
arrShapes1(iIndex).IsActive = arrShapes2(iShapeIndex).IsActive
''DEBUG:
'DumpNextShape arrShapes1(iIndex), "arrShapes1(" + cstr$(iIndex) + ")"
' END LOOK FOR MINIMUM COMBINATION OF SHAPES TO DRAW TILE
' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'' ****************************************************************************************************************************************************************
'' DEBUG:
'DumpTileFromShapes arrShapes1(), FALSE, TRUE
'
'sEndTime = CurrentDateTime$
'DebugPrint RoutineName + " finished:"
'DebugPrint " started at: " + sStartTime
'DebugPrint " finished at: " + sEndTime
'' ****************************************************************************************************************************************************************
' /////////////////////////////////////////////////////////////////////////////
' Test routine for the FindOptimizedVector routine.
Sub FindOptimizedVectorTest
Dim RoutineName
As String: RoutineName
= "FindOptimizedVectorTest" ReDim arrOptimizedShapes
(-1) As RectangleType
' Start output
DebugPrint "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
DebugPrint "Testing tiles: " + sTestList
DebugPrint ""
' Get raster tiles as a string array
GetTileText arrTileText()
' List of tiles to test
'sTestList = "254,253,247,32,238,241,225,233,213,214,212,203,194,193,192,169,154,151,145,147,129,115,114,84,65,46,44,35,252"
'sTestList = "46,35"
'sTestList = "84,253,192,151,147,114,65"
'sTestList = "43,44,45,46"
'sTestList = "60,62" ' 84 + 192 work, the rest don't
'sTestList = "254,252"
sTestList = "84,60,62,75,141,142,150,207,217,252,192" ' 84 + 192 work, the rest don't
'sTestList = "60,62,75,141,142,150,207,217,252" ' 84 + 192 work, the rest don't
'sTestList="75"
'DebugPrint "GETTING LIST OF TILES..."
GetIntegerArrayFromDelimList sTestList, ",", 0, arrTestIndex()
' Test tiles
'for iLoop1 = lbound(arrTestIndex) to ubound(arrTestIndex)
' iIndex = arrTestIndex(iLoop1)
DebugPrint "----------------------------------------------------------------------------------------------------------------------------------------------------------------"
DebugPrint "Tile #" + cstr$(iIndex) + ":"
DebugPrint arrTileText(iIndex)
DebugPrint ""
' Process next tile and generate line drawing routines
FindOptimizedVector arrTileText(iIndex), arrOptimizedShapes()
DebugPrint "# x1 y1 x2 y2 Pixels IsActive"
sLine = ""
sLine
= sLine
+ Left$(cstr$
(arrOptimizedShapes
(iLoop2
).x1
) + String$(2, " "), 2) + " " sLine
= sLine
+ Left$(cstr$
(arrOptimizedShapes
(iLoop2
).y1
) + String$(2, " "), 2) + " " sLine
= sLine
+ Left$(cstr$
(arrOptimizedShapes
(iLoop2
).x2
) + String$(2, " "), 2) + " " sLine
= sLine
+ Left$(cstr$
(arrOptimizedShapes
(iLoop2
).y2
) + String$(2, " "), 2) + " " sLine
= sLine
+ Left$(cstr$
(arrOptimizedShapes
(iLoop2
).PixelCount
) + String$(7, " "), 7) + " " sLine = sLine + TrueFalse$(arrOptimizedShapes(iLoop2).IsActive)
DebugPrint sLine
DebugPrint "*** NO SHAPES TO DRAW THIS TILE ***"
DebugPrint "ERROR FOR TILE #" + cstr$(iIndex) + ": " + sError
DebugPrint ""
'next iLoop1
' DONE
DebugPrint RoutineName + " finished."
'Input "PRESS <ENTER> TO CONTINUE";in$
End Sub ' FindOptimizedVectorTest
' /////////////////////////////////////////////////////////////////////////////
' Receives two 2D string arrays and compares the dimensions
' and makes sure that the any blank pixel value "." matches
' (any other non-whitespace characters are considered a pixel
' as long as they are not "." they are considered a match).
' Returns empty string if they match, else returns a difference report.
bMatch = TRUE
sTemp
= " 12345678 " + Chr$(13) iY = 0
iY = iY + 1
sTemp = sTemp + cstr$(iY)
If arrTile1
(iLoopY
, iLoopX
) = "." And arrTile2
(iLoopY
, iLoopX
) <> "." Then bMatch = FALSE
sTemp = sTemp + "?"
ElseIf arrTile1
(iLoopY
, iLoopX
) <> "." And arrTile2
(iLoopY
, iLoopX
) = "." Then bMatch = FALSE
sTemp = sTemp + "?"
sTemp = sTemp + arrTile1(iLoopY, iLoopX)
sTemp
= sTemp
+ cstr$
(iY
) + Chr$(13) sTemp
= sTemp
+ " 12345678 " + Chr$(13) sResult = sTemp
sResult
= "ubound(arrTile1, 2)=" + cstr$
(ubound(arrTile1
, 2)) + _
" <> " + _
"ubound(arrTile2, 2)=" + cstr$
(ubound(arrTile2
, 2)) sResult
= "lbound(arrTile1, 2)=" + cstr$
(lbound(arrTile1
, 2)) + _
" <> " + _
"lbound(arrTile2, 2)=" + cstr$
(lbound(arrTile2
, 2))
sResult
= "ubound(arrTile1, 1)=" + cstr$
(ubound(arrTile1
, 1)) + _
" <> " + _
"ubound(arrTile2, 1)=" + cstr$
(ubound(arrTile2
, 1)) sResult
= "lbound(arrTile1, 1)=" + cstr$
(lbound(arrTile1
, 1)) + _
" <> " + _
"lbound(arrTile2, 1)=" + cstr$
(lbound(arrTile2
, 1)) TilesAreEqual$ = sResult
' ################################################################################################################################################################
' END VECTOR-BASED TILE ROUTINES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN BOX DRAWING ROUTINES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D BOX (OUTLINE)
' https://www.qb64.org/wiki/LINE
Line (iX
, iY
)-(iX
+ (iSize
- 1), iY
+ (iSize
- 1)), fgColor
, B
' Draw box outline
' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D BOX (SOLID)
' https://www.qb64.org/wiki/LINE
' Renamed DrawBox/DrawBoxLine to DrawSolidBox
Line (iX
, iY
)-(iX
+ (iSize
- 1), iY
+ (iSize
- 1)), fgColor
, BF
' Draw a solid box
' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D RECTANGLE (OUTLINE)
Line (iX
, iY
)-(iX
+ (iSizeW
- 1), iY
+ (iSizeH
- 1)), fgColor
, B
' Draw rectangle outline
' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D RECTANGLE (SOLID)
Line (iX
, iY
)-(iX
+ (iSizeW
- 1), iY
+ (iSizeH
- 1)), fgColor
, BF
' Draw a solid rectangle
' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D BOX (OUTLINE)
' https://www.qb64.org/wiki/LINE
' The style parameter 0-255 doesn't seem to have a solid line?
' For that, use DrawOutlineBox.
' LINE [STEP] [(column1, row1)]-[STEP] (column2, row2), color[, [{B|BF}], style%]
' B creates a box outline with each side parallel to the program screen sides. BF creates a filled box.
' The style% signed INTEGER value sets a dotted pattern to draw the line or rectangle outline.
Sub DrawStyledOutlineBox
(iX%
, iY%
, iSize%
, iColor~&
, iStyle%
) Line (iX%
, iY%
)-(iX%
+ (iSize%
- 1), iY%
+ (iSize%
- 1)), iColor~&
, B
, iStyle%
End Sub ' DrawStyledOutlineBox
' /////////////////////////////////////////////////////////////////////////////
' DRAW A 2-D BOX (OUTLINE) WITH A SOLID LINE
Sub DrawOutlineBox
(iX%
, iY%
, iSize2%
, iColor~&
, iWeight2%
) iSize% = iSize2% - 1
iWeight% = iWeight2% - 1
' TOP LINE
iFromX% = iX%
iFromY% = iY%
iToX% = iX% + iSize%
iToY% = iY%
Line (iFromX%
, iFromY%
)-(iToX%
, iToY%
), iColor~&
, BF
' BOTTOM LINE
iFromX% = iX%
iFromY% = iY% + iSize%
iToX% = iX% + iSize%
iToY% = iY% + iSize%
Line (iFromX%
, iFromY%
)-(iToX%
, iToY%
), iColor~&
, BF
' LEFT LINE
iFromX% = iX%
iFromY% = iY%
iToX% = iX%
iToY% = iY% + iSize%
Line (iFromX%
, iFromY%
)-(iToX%
, iToY%
), iColor~&
, BF
' RIGHT LINE
iFromX% = iX% + iSize%
iFromY% = iY%
iToX% = iX% + iSize%
iToY% = iY% + iSize%
Line (iFromX%
, iFromY%
)-(iToX%
, iToY%
), iColor~&
, BF
' TOP LINE
For iFromY%
= iY%
To (iY%
+ iWeight%
) iFromX% = iX%
'iFromY% = iY%
iToX% = iX% + iSize%
iToY% = iFromY%
Line (iFromX%
, iFromY%
)-(iToX%
, iToY%
), iColor~&
, BF
' BOTTOM LINE
For iFromY%
= ((iY%
+ iSize%
) - iWeight%
) To (iY%
+ iSize%
) iFromX% = iX%
'iFromY% = iY% + iSize%
iToX% = iX% + iSize%
iToY% = iFromY%
Line (iFromX%
, iFromY%
)-(iToX%
, iToY%
), iColor~&
, BF
' LEFT LINE
For iFromX%
= iX%
To (iX%
+ iWeight%
) 'iFromX% = iX%
iFromY% = iY%
iToX% = iFromX%
iToY% = iY% + iSize%
Line (iFromX%
, iFromY%
)-(iToX%
, iToY%
), iColor~&
, BF
' RIGHT LINE
For iFromX%
= ((iX%
+ iSize%
) - iWeight%
) To (iX%
+ iSize%
) 'iFromX% = iX% + iSize%
iFromY% = iY%
iToX% = iFromX%
iToY% = iY% + iSize%
Line (iFromX%
, iFromY%
)-(iToX%
, iToY%
), iColor~&
, BF
' ################################################################################################################################################################
' END BOX DRAWING ROUTINES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN DRAW TILES, COLOR SWAP with HARDWARE IMAGES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' Same as DrawColorTile but using hardware images.
' Receives:
' imgTiles& = handle to 16x16 tile sheet of 16x16 pixel tiles colored black (256 tiles)
' TileNum% = ordinal number of tile on tile sheet to draw (0-255)
' TileColor~& = color to use for tile
' imgScreen& = handle to screen to draw tile on
' dx% = column # to draw tile at (where each column is 16 pixels wide)
' dy% = row # to draw tile at (where each row is 16 pixels high)
' xOffset% = offset tile this many columns over
' yOffset% = offset tile this many rows down
' # OF COLUMNS / ROWS ON SOURCE TILE SHEET
cols% = 16
rows% = 16
' GET THE COLUMN/ROW OF TILE # iTileNum ON THE SOURCE TILE SHEET
sr% = iTileNum \ rows%
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
sx1% = sc% * 8
' GET THE START Y COORDINATE ON THE SOURCE TILE SHEET
sy1% = sr% * 8
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
sx2% = sx1% + 7
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
sy2% = sy1% + 7
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = dx * 8
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = dy * 8
' IS THERE A BACKGROUND COLOR?
imgColorSpriteHW
= _CopyImage(imgColorSprite
, 33) ' Copy for hardware image '_Dest imgColorSprite
' COPY THE TEMPORARY TILE TO THE SCREEN imgHardwareScreen
'_Source imgColorSprite
'SOFTWARE IMAGE:
'_PutImage (xDest%, yDest%), imgColorSprite, imgHardwareScreen, (0, 0)-(7, 7) ' portion of source to the top-left corner of the destination page
'HARDWARE IMAGE:
_PutImage (xDest%
, yDest%
), imgColorSpriteHW
, , (0, 0)-(7, 7) ' portion of source to the top-left corner of the destination page
' CREATE A TEMPORARY TILE TO COLOR
' COPY THE TILE TO THE TEMPORARY ONE
'SOFTWARE IMAGE:
'_PutImage (0, 0), imgTiles, imgUniversalSprite, (sx1%, sy1%)-(sx2%, sy2%)
'HARDWARE IMAGE:
_PutImage (0, 0), imgHardwareTiles
, , (sx1%
, sy1%
)-(sx2%
, sy2%
)
' COLOR IN THE TEMPORARY TILE
' REPLACING BLACK (THE SOURCE COLOR) WITH THE TILE COLOR
'SOFTWARE IMAGE:
'IF imgColorSprite < -1 OR imgColorSprite > 0 THEN _FreeImage imgColorSprite
'DoColorSwap imgUniversalSprite, cBlack, fgColor, imgColorSprite
'HARDWARE IMAGE:
DoColorSwapHW imgUniversalSpriteHW, cBlack, fgColor, imgColorSpriteHW
' COPY THE TEMPORARY TILE TO THE SCREEN imgHardwareScreen
'SOFTWARE IMAGE:
'_PutImage (xDest%, yDest%), imgColorSprite, , (0, 0)-(7, 7)
'HARDWARE IMAGE:
_PutImage (xDest%
, yDest%
), imgColorSprite
, , (0, 0)-(7, 7)
' ADDED PER FellipeHeitor
If imgUniversalSpriteHW
< -1 Or imgUniversalSpriteHW
> 0 Then _FreeImage imgUniversalSpriteHW
' /////////////////////////////////////////////////////////////////////////////
' Same as DoColorSwap but using hardware images.
' Latest version with NOVARSEG's changes.
' Based on code from:
' Image color swap?
' https://www.qb64.org/forum/index.php?topic=2312.0
' Like Function swapcolor& except returns new image in a parameter
' in case being a function causes a memory leak?
a = 0
a = a + 4
' ################################################################################################################################################################
' END DRAW TILES, COLOR SWAP with HARDWARE IMAGES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN DRAW TILES, COLOR SWAP with SOFTWARE IMAGES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' Simple version which calculates coordinates on tile sheet and destination
' screen every time. For a faster version uses precalculated coordinates,
' see DrawColorTileFast. This version does not support offsetX, offsetY.
' Receives:
' imgScreen& = handle to screen to draw tile on
' imgTiles& = handle to 16x16 tile sheet of 8x8 pixel tiles colored black (256 tiles)
' TileNum% = ordinal number of tile on tile sheet to draw (0-255)
' TileColor~& = foreground color to use for tile
' BackColor~& = background color to use for tile
' dx% = column # to draw tile at (where each column is 8 pixels wide)
' dy% = row # to draw tile at (where each row is 8 pixels high)
' Usage:
' DrawColorTile imgScreen&, imgTiles&, TileNum%, TileColor~&, BackColor~&, dx%, dy%
Sub DrawColorTile
(imgScreen&
, imgTiles&
, TileNum%
, TileColor~&
, BackColor~&
, dx%
, dy%
)
' # OF COLUMNS / ROWS ON SOURCE TILE SHEET
cols% = 16
rows% = 16
' GET THE COLUMN/ROW OF TILE # TileNum% ON THE SOURCE TILE SHEET
sr% = TileNum% \ rows%
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
sx1% = sc% * 8
' GET THE START Y COORDINATE ON THE SOURCE TILE SHEET
sy1% = sr% * 8
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
sx2% = sx1% + 7
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
sy2% = sy1% + 7
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = dx% * 8
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = dy% * 8
' IS THERE A BACKGROUND COLOR?
' COPY THE TEMPORARY TILE TO THE SCREEN imgScreen&
_PutImage (xDest%
, yDest%
), ColorSprite&
, imgScreen&
, (0, 0)-(7, 7) ' portion of source to the top-left corner of the destination page
' CREATE A TEMPORARY TILE TO COLOR
' COPY THE TILE TO THE TEMPORARY ONE
_PutImage (0, 0), imgTiles&
, UniversalSprite&
, (sx1%
, sy1%
)-(sx2%
, sy2%
)
' COLOR IN THE TEMPORARY TILE
' REPLACING BLACK (THE SOURCE COLOR) WITH THE TILE COLOR
DoColorSwap UniversalSprite&, cBlack, TileColor~&, ColorSprite&
' COPY THE TEMPORARY TILE TO THE SCREEN imgScreen&
_PutImage (xDest%
, yDest%
), ColorSprite&
, imgScreen&
, (0, 0)-(7, 7) ' portion of source to the top-left corner of the destination page
' ADDED PER FellipeHeitor
' /////////////////////////////////////////////////////////////////////////////
' Latest version with NOVARSEG's changes.
' Based on code from:
' Image color swap?
' https://www.qb64.org/forum/index.php?topic=2312.0
' Like Function swapcolor& except returns new image in a parameter
' in case being a function causes a memory leak?
Sub DoColorSwap
(imgOriginal&
, oldcolor~&
, newcolor~&
, imgNew&
) a = 0
a = a + 4
_MemPut m
, m.OFFSET
+ a
, newcolor~&
' ################################################################################################################################################################
' END DRAW TILES, COLOR SWAP with SOFTWARE IMAGES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN DRAW TILES, _PUTIMAGE with SOFTWARE IMAGES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' Draws an 8x8 tile at the specified column/row dx%, dy%
' Original version which calculates coordinates on tile sheet and destination
' screen every time. For a faster version uses precalculated coordinates,
' see DrawTileFast.
' tw% = tile width/height (in pixels)
' DIV and MOD:
' c% = a% \ b% ' DIV (INTEGER DIVISION)
' d% = a% MOD b% ' MODULO (DIVISION REMAINDER)
'_PUTIMAGE (0, 0), i ' places image at upper left corner of window w/o stretching it
'_PUTIMAGE (dx1, dy1), sourceHandle&, destHandle&, (sx1, sy1)-(sx2, sy2) ' portion of source to the top-left corner of the destination page
'_PUTIMAGE (64, 128), imgTiles&, imgScreen&, (128, 128)-(164, 164) ' portion of source to the top-left corner of the destination page
'_PutImage (64, 128), imgTiles&, imgScreen&, (128, 128)-(164, 164) ' portion of source to the top-left corner of the destination page
Sub DrawTile8
(imgTiles&
, TileNum%
, imgScreen&
, dx%
, dy%
) Dim tw%
' width/height of tile Dim tw_minus1%
' width/height of tile -1 Dim cols%
' # tiles across on tile sheet Dim rows%
' # tile rows on tile sheet Dim sc%
' source column on tile sheet Dim sr%
' source row on tile sheet Dim sx1%
' source start x Dim sy1%
' source start y Dim xDest%
' destination x Dim yDest%
' destination y
' SIZE OF TILE
tw% = 8
tw_minus1% = 7
' # OF COLUMNS / ROWS ON SOURCE TILE SHEET
cols% = 16
rows% = 16
' GET THE COLUMN/ROW OF TILE # TileNum% ON THE SOURCE TILE SHEET
sr% = TileNum% \ rows%
'Print "Tile#" + cstr$(TileNum%) + " at sc%=" + cstr$(sc%) + ",sr%=" + cstr$(sr%)
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
sx1% = sc% * tw%
' GET THE START Y COORDINATE ON THE SOURCE TILE SHEET
sy1% = sr% * tw%
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
sx2% = sx1% + tw_minus1%
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
sy2% = sy1% + tw_minus1%
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = dx% * tw%
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = (dy% * tw%) '+ yOffset%
'Print "Tile#" + cstr$(TileNum%) + _
' " at r" + cstr$(sr%) + "c" + cstr$(sc%) + _
' " pixel location r" + cstr$(sy1%) + "c" + cstr$(sx1%) + _
' " through r" + cstr$(sy2%) + "c" + cstr$(sx2%)
' portion of source to the top-left corner of the destination page
_PutImage (xDest%
, yDest%
), imgTiles&
, imgScreen&
, (sx1%
, sy1%
)-(sx2%
, sy2%
)
' ################################################################################################################################################################
' END DRAW TILES, _PUTIMAGE with SOFTWARE IMAGES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN DRAW TILES, _PUTIMAGE with HARDWARE IMAGES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' Draws an 8x8 tile at the specified column/row dx%, dy%
' using hardware images
' Usage:
' Dim imgHardwareTiles As Long ' the hardware image copy of the tileset
' imgHardwareTiles = _CopyImage(imgTiles, 33) ' Copy tilesheet for hardware image
' DrawTileHw8 imgHardwareTiles, iTileNum, imgScreen, iColumn, iRow, iSubTileset
' where iSubTileset% = iFgColorIndex
Sub DrawTileHw8
(imgHardwareTiles&
, TileNum%
, imgScreen&
, dx%
, dy%
, iSubTileset%
) Dim tw%
' width/height of tile Dim tw_minus1%
' width/height of tile -1 Dim cols%
' # tiles across on tile sheet Dim rows%
' # tile rows on tile sheet Dim sc%
' source column on tile sheet Dim sr%
' source row on tile sheet Dim sx1%
' source start x Dim sy1%
' source start y Dim xDest%
' destination x Dim yDest%
' destination y
' CALCULATE OFFSET
xOffset% = 128 * iSubTileset%
' SIZE OF TILE
tw% = 8
tw_minus1% = 7
' # OF COLUMNS / ROWS ON SOURCE TILE SHEET
cols% = 16
rows% = 16
' GET THE COLUMN/ROW OF TILE # TileNum% ON THE SOURCE TILE SHEET
sr% = TileNum% \ rows%
'Print "Tile#" + cstr$(TileNum%) + " at sc%=" + cstr$(sc%) + ",sr%=" + cstr$(sr%)
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
sx1% = (sc% * tw%) + xOffset%
' GET THE START Y COORDINATE ON THE SOURCE TILE SHEET
sy1% = sr% * tw%
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
sx2% = sx1% + tw_minus1%
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
sy2% = sy1% + tw_minus1%
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = dx% * tw%
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = (dy% * tw%) '+ yOffset%
'Print "Tile#" + cstr$(TileNum%) + _
' " at r" + cstr$(sr%) + "c" + cstr$(sc%) + _
' " pixel location r" + cstr$(sy1%) + "c" + cstr$(sx1%) + _
' " through r" + cstr$(sy2%) + "c" + cstr$(sx2%)
' portion of source to the top-left corner of the destination page
'_PutImage (xDest%, yDest%), imgHardwareTiles&, imgScreen&, (sx1%, sy1%)-(sx2%, sy2%)
'_PutImage (200, 100)-Step(100, 100), imgHardwareTiles&, , (0, 0)-(40, 40)
_PutImage (xDest%
, yDest%
), imgHardwareTiles&
, , (sx1%
, sy1%
)-(sx2%
, sy2%
)
' /////////////////////////////////////////////////////////////////////////////
' Receives an image imgTiles of 8x8 tiles
' colored black on transparent background
' and returns a new image imgNew
' copied from the tiles in imgTiles,
' except colored to foreground color fgColor,
' and background color bgColor
' Usage:
' MakeColoredTileset imgTiles, imgNew, fgColor, bgColor
iTileNum = 0
DrawColorTile imgNew, imgTiles, iTileNum, fgColor, bgColor, iX, iY
iTileNum = iTileNum + 1
' /////////////////////////////////////////////////////////////////////////////
' Receives an image imgTiles of 8x8 tiles
' colored black on transparent background
' and an array of colors,
' and returns a new image imgNew
' copied from the tiles in imgTiles,
' with every combination of the colors in the array
' as the foreground/background color.
' Usage:
' MakeColoredTileset2 imgTiles, imgNew, arrColor(), arrTileIndex(), arrColorIndex()
' Input: iTileNum, bgColor, fgColor
' X Index: arrTileIndex(iTileNum) = returns x position for iTileNum
' Y Index: arrColorIndex(fgColor, bgColor) = returns y position for fgColor, bgColor
Sub MakeColoredTileset2
( _
' FIGURE OUT SIZE OF TARGET IMAGE
iHeight = (iColorCount * iColorCount) * 8
iWidth = 256 * 8
' CREATE TARGET IMAGE
'imgNew = _NewImage(_Width(imgTiles), _Height(imgTiles), 32)
' INITIALIZE X POSITION INDEX
' INITIALIZE Y POSITION INDEX
' POPULATE X POSITION INDEX
iX = 0
arrTileIndex(iTileNum) = iX
iX = iX + 8
' CREATE TILE MAP FOR ALL COMBINATIONS OF FOREGROUND + BACKGROUND COLORS
' AND POPULATE Y POSITION INDEX
iY = 0
iX = arrTileIndex(iTileNum)
fgColor = arrColor(iFG)
bgColor = arrColor(iBG)
DrawColorTile imgNew, imgTiles, iTileNum, fgColor, bgColor, iX \ 8, iY \ 8
arrColorIndex(iFG, iBG) = iY
iY = iY + 8
' /////////////////////////////////////////////////////////////////////////////
' Draws an 8x8 tile at the specified column/row dx%, dy%
' in the specified foreground/background color
' using hardware images.
' Usage:
' Dim imgHardwareTiles As Long ' the hardware image copy of the tileset
' imgHardwareTiles = _CopyImage(imgTiles, 33) ' Copy tilesheet for hardware image
' DrawTileHw8 imgHardwareTiles, iTileNum, imgScreen, iColumn, iRow, iSubTileset
' THIS:
' DrawColorTileHw8 imgTilesAllColorsHW, iTileNum, imgScreen, iX, iY, iFgColorIndex, iBgColorIndex, arrTileIndex(), arrColorIndex()
Sub DrawColorTileHw8
(imgHardwareTiles&
, TileNum%
, imgScreen&
, dx%
, dy%
, _
Dim tw%
' width/height of tile Dim tw_minus1%
' width/height of tile -1 Dim cols%
' # tiles across on tile sheet Dim rows%
' # tile rows on tile sheet Dim sc%
' source column on tile sheet Dim sr%
' source row on tile sheet Dim sx1%
' source start x Dim sy1%
' source start y Dim xDest%
' destination x Dim yDest%
' destination y
'' CALCULATE OFFSET
'xOffset% = 128 * iSubTileset%
' SIZE OF TILE
tw% = 8
tw_minus1% = 7
'' # OF COLUMNS / ROWS ON SOURCE TILE SHEET
'cols% = 16
'rows% = 16
'' GET THE COLUMN/ROW OF TILE # TileNum% ON THE SOURCE TILE SHEET
'sc% = TileNum% Mod rows%
'sr% = TileNum% \ rows%
'Print "Tile#" + cstr$(TileNum%) + " at sc%=" + cstr$(sc%) + ",sr%=" + cstr$(sr%)
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
'sx1% = (sc% * tw%) + xOffset%
sx1% = arrTileIndex(TileNum%)
' GET THE START Y COORDINATE ON THE SOURCE TILE SHEET
'sy1% = sr% * tw%
sy1% = arrColorIndex(iFgColorIndex, iBgColorIndex)
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
sx2% = sx1% + tw_minus1%
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
sy2% = sy1% + tw_minus1%
' GET THE DESTINATION X COORDINATE ON THE SCREEN
xDest% = dx% * tw%
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
yDest% = (dy% * tw%) '+ yOffset%
'Print "Tile#" + cstr$(TileNum%) + _
' " at r" + cstr$(sr%) + "c" + cstr$(sc%) + _
' " pixel location r" + cstr$(sy1%) + "c" + cstr$(sx1%) + _
' " through r" + cstr$(sy2%) + "c" + cstr$(sx2%)
' portion of source to the top-left corner of the destination page
'_PutImage (xDest%, yDest%), imgHardwareTiles&, imgScreen&, (sx1%, sy1%)-(sx2%, sy2%)
'_PutImage (200, 100)-Step(100, 100), imgHardwareTiles&, , (0, 0)-(40, 40)
_PutImage (xDest%
, yDest%
), imgHardwareTiles&
, , (sx1%
, sy1%
)-(sx2%
, sy2%
)
' ################################################################################################################################################################
' END DRAW TILES, _PUTIMAGE with HARDWARE IMAGES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN TILE PRECALCULATION UTILITIES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' Precalculates the tile locations ahead of time to save time copying them
' to the screen.
' Requires the following types be declared:
'
' Type TileSheetMapType ' UDT FOR PRECALCULATED TILESHEET
' xStart As Integer
' xEnd As Integer
' yStart As Integer
' yEnd As Integer
' End Type
' Type TileMapType ' UDT FOR PRECALCULATED TILE MAP
' xPos As Integer
' yPos As Integer
' End Type
'
' EXAMPLE USAGE:
'
' Dim TileCount%
' Dim TilesheetCols%
' Dim TilesheetRows%
' Dim tileHeightPx%
' Dim tileWidthPx%
' Dim xOffset%
' Dim yOffset%
' Dim numTilesX%
' Dim numTilesY%
' REDIM arrTileSheetMap(255) AS TileSheetMapType
' REDIM arrTileMap(20, 20) AS TileMapType
' TileCount% = 256 ' TOTAL # OF TILES
' TilesheetCols% = 16 ' # OF COLUMNS ON SOURCE TILE SHEET
' TilesheetRows% = 16 ' # OF ROWS ON SOURCE TILE SHEET
' tileHeightPx% = 32 ' TILE HEIGHT
' tileWidthPx% = 32 ' TILE WIDTH
' xOffset% = 0 ' SCREEN OFFSET X
' yOffset% = 64 ' SCREEN OFFSET Y
' numTilesX% = 20 ' HOW MANY TILES ACROSS (ON DESTINATION)
' numTilesY% = 20 ' HOW MANY TILES UP/DOWN (ON DESTINATION)
' ComputeTileLocations arrTileSheetMap(), arrTileMap(), TileCount%, _
' TilesheetCols%, TilesheetRows%, tileWidthPx%, tileHeightPx%, _
' xOffset%, yOffset%, numTilesX%, numTilesY%
' TODO: this can be simplified & optimized:
' - we don't need x/y offsets
' - tile height/width can be hardcoded
' - etc.
Sub ComputeTileLocations
(arrTileSheetMap
() As TileSheetMapType
, arrTileMap
() As TileMapType
, TileCount%
, TilesheetCols%
, TilesheetRows%
, tileWidthPx%
, tileHeightPx%
, xOffset%
, yOffset%
, numTilesX%
, numTilesY%
)
' -----------------------------------------------------------------------------
' CALCULATE TILE SHEET COORDINATES FOR TILES 0-255
For TileNum%
= 0 To (TileCount%
- 1)
' GET THE COLUMN/ROW OF TILE # TileNum% ON THE SOURCE TILE SHEET
sc%
= TileNum%
Mod TilesheetCols%
sr% = TileNum% \ TilesheetRows%
'Print "Tile#" + cstr$(TileNum%) + " at sc%=" + cstr$(sc%) + ",sr%=" + cstr$(sr%)
' GET THE START X COORDINATE ON THE SOURCE TILE SHEET
'sx1% = sc% * tw%
sx1% = sc% * tileWidthPx%
' GET THE START Y COORDINATE ON THE SOURCE TILE SHEET
'sy1% = sr% * tw%
sy1% = sr% * tileHeightPx%
' GET THE END X COORDINATE ON THE SOURCE TILE SHEET
'sx2% = sx1% + (tw% - 1)
sx2% = sx1% + (tileWidthPx% - 1)
' GET THE END y COORDINATE ON THE SOURCE TILE SHEET
'sy2% = sy1% + (tw% - 1)
sy2% = sy1% + (tileHeightPx% - 1)
' SAVE THE COORDINATES FOR TileNum% IN THE ARRAY
arrTileSheetMap(TileNum%).xStart = sx1%
arrTileSheetMap(TileNum%).xEnd = sx2%
arrTileSheetMap(TileNum%).yStart = sy1%
arrTileSheetMap(TileNum%).yEnd = sy2%
' -----------------------------------------------------------------------------
' CALCULATE SCREEN COORDINATES FOR TILES
For dx%
= 0 To (numTilesX%
- 1) For dy%
= 0 To (numTilesY%
- 1)
' GET THE DESTINATION X COORDINATE ON THE SCREEN
'xDest% = dx% * tw%
xDest% = (dx% * tileWidthPx%) + xOffset%
' GET THE DESTINATION Y COORDINATE ON THE SCREEN
'yDest% = (dy% * tw%) + 64
yDest% = (dy% * tileHeightPx%) + yOffset%
'Print "Tile#" + cstr$(TileNum%) + " at r" + cstr$(sr%) + "c" + cstr$(sc%) + " pixel location r" + cstr$(sy1%) + "c" + cstr$(sx1%) + " through r" + cstr$(sy2%) + "c" + cstr$(sx2%)
' SAVE THE SCREEN PIXEL COORDINATES FOR dx%, dy% IN THE ARRAY
' WHERE dx% and dy% ARE 1-BASED
arrTileMap(dx% + 1, dy% + 1).xPos = xDest%
arrTileMap(dx% + 1, dy% + 1).yPos = yDest%
End Sub ' ComputeTileLocations
' ################################################################################################################################################################
' END TILE PRECALCULATION UTILITIES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN TILE TO IMAGE ROUTINES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' Loads tileset of 256 8x8 tiles into a 128x128 image (16 columns x 16 rows)
' where tiles are a single color.
' Parameters:
' imgTiles& = contains the resulting tileset image
' fgColor = tile color
' bgColor = tile background color
' Do not try to free image handles currently being used as the active SCREEN. Change screen modes first.
' _DISPLAY turns off the auto refresh screen default _AUTODISPLAY behavior. Prevents screen flickering.
' Cls , cEmpty ' set the background color as transparent
'Screen imgTiles&
'Cls , bgColor ' set the background color as transparent
'DrawRect 0, 0, 128, 128, cEmpty
'DrawBox 0, 0, 128, cWhite
Cls , cEmpty
' set the background color as transparent
GetTileText arrTileText()
iTileX = 0
iTileY = 0
bFinished = FALSE
split arrTileText
(iTileNum
), Chr$(13), arrLines
() iToY = iTileY * 8
sResult = "iToY value " + cstr$(iToY) + " " + _
"exceeded image height " + cstr$
(_Height(imgTiles&
)) + ". " + _
"Exiting " + RoutineName + " at iTileNum=" + cstr$(iTileNum) + "."
bFinished = TRUE
sLine = arrLines(iFromY)
iToX = iTileX * 8
sChar
= Mid$(sLine
, iFromX
, 1) pixelColor = bgColor ' cEmpty ' POINT(iFromX, iFromY)
pixelColor = fgColor ' cBlack
PSet (iToX
, iToY
), pixelColor
iToX = iToX + 1
sResult = "iToX value " + cstr$(iToX) + " " + _
"exceeded image width " + cstr$
(_Width(imgTiles&
)) + ". " + _
"Exiting " + RoutineName + " at iTileNum=" + cstr$(iTileNum) + "."
bFinished = TRUE
iToY = iToY + 1
iTileX = iTileX + 1
iTileX = 0
iTileY = iTileY + 1
'if iTileY > 15 then
' sResult = "Exceeded max 16 rows of tiles." + _
' "Exiting " + RoutineName + " at iTileNum=" + cstr$(iTileNum) + "."
' bFinished = TRUE
' exit for
'end if
GetTiles$ = sResult
' /////////////////////////////////////////////////////////////////////////////
' Loads tileset of 256 8x8 tiles into a 2048 x 8 image
' (256 8x8 pixel tiles organized left to right)
' where tiles are a single color.
' Parameters:
' imgTiles& = contains the resulting tileset image
' fgColor = tile color
' bgColor = tile background color
' Do not try to free image handles currently being used as the active SCREEN. Change screen modes first.
' _DISPLAY turns off the auto refresh screen default _AUTODISPLAY behavior. Prevents screen flickering.
' Cls , cEmpty ' set the background color as transparent
'Screen imgTiles&
'Cls , bgColor ' set the background color as transparent
'DrawRect 0, 0, 128, 128, cEmpty
'DrawBox 0, 0, 128, cWhite
Cls , cEmpty
' set the background color as transparent
GetTileText arrTileText()
iTileX = 0
iTileY = 0
iToY = 0
bFinished = FALSE
split arrTileText
(iTileNum
), Chr$(13), arrLines
() iToY = iTileY * 8
sResult = "iToY value " + cstr$(iToY) + " " + _
"exceeded image height " + cstr$
(_Height(imgTiles&
)) + ". " + _
"Exiting " + RoutineName + " at iTileNum=" + cstr$(iTileNum) + "."
bFinished = TRUE
sLine = arrLines(iFromY)
iToX = iTileX * 8
sChar
= Mid$(sLine
, iFromX
, 1) pixelColor = bgColor ' cEmpty ' POINT(iFromX, iFromY)
pixelColor = fgColor ' cBlack
PSet (iToX
, iToY
), pixelColor
iToX = iToX + 1
sResult = "iToX value " + cstr$(iToX) + " " + _
"exceeded image width " + cstr$
(_Width(imgTiles&
)) + ". " + _
"Exiting " + RoutineName + " at iTileNum=" + cstr$(iTileNum) + "."
bFinished = TRUE
iToY = iToY + 1
iTileX = iTileX + 1
'If iTileX > 15 Then
' iTileX = 0
' iTileY = iTileY + 1
'End If
GetTiles2$ = sResult
' ################################################################################################################################################################
' END TILE TO IMAGE ROUTINES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN TILE DEFINITIONS
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' Returns an array of 256 8x8 tiles defined in text
' where each tile is defined by "." as blank and anything else is a pixel
' and each row is delimited by chr$(13)
m$ = ""
m$
= m$
+ "22....22" + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "2..2...2" + Chr$(13) m$
= m$
+ "2...2..2" + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "22....22" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(0) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(1) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(2) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(3) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(4) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(5) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(6) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(7) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(8) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(9) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(10) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(11) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(12) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(13) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(14) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(15) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(16) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(17) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(18) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(19) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(20) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(21) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(22) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(23) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(24) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(25) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(26) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(27) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(28) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(29) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(30) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(31) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(32) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(33) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(34) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(35) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(36) = m$
m$ = ""
m$
= m$
+ ".22...2." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".2...22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(37) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ ".22..222" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(38) = m$
m$ = ""
m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(39) = m$
m$ = ""
m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(40) = m$
m$ = ""
m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(41) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(42) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(43) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) arrTileText(44) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(45) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(46) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(47) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22.222." + Chr$(13) m$
= m$
+ ".222.22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(48) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(49) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(50) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(51) = m$
m$ = ""
m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "....222." + Chr$(13) m$
= m$
+ "...2222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(52) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(53) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(54) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(55) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(56) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(57) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(58) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) arrTileText(59) = m$
m$ = ""
m$
= m$
+ "....222." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "....222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(60) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(61) = m$
m$ = ""
m$
= m$
+ ".222...." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ ".222...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(62) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(63) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22.222." + Chr$(13) m$
= m$
+ ".22.222." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22...2." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(64) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(65) = m$
m$ = ""
m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(66) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(67) = m$
m$ = ""
m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(68) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(69) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(70) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22.222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(71) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(72) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(73) = m$
m$ = ""
m$
= m$
+ "...2222." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(74) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ ".222...." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(75) = m$
m$ = ""
m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(76) = m$
m$ = ""
m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ ".222.222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".22.2.22" + Chr$(13) m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(77) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".222.22." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22.222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(78) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(79) = m$
m$ = ""
m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(80) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "....222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(81) = m$
m$ = ""
m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(82) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(83) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(84) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(85) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(86) = m$
m$ = ""
m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ ".22.2.22" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".222.222" + Chr$(13) m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(87) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(88) = m$
m$ = ""
m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(89) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(90) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(91) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(92) = m$
m$ = ""
m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(93) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(94) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(95) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(96) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(97) = m$
m$ = ""
m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(98) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(99) = m$
m$ = ""
m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(100) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(101) = m$
m$ = ""
m$
= m$
+ "....222." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(102) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(103) = m$
m$ = ""
m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(104) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(105) = m$
m$ = ""
m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(106) = m$
m$ = ""
m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(107) = m$
m$ = ""
m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(108) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".22.2.22" + Chr$(13) m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(109) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(110) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(111) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(112) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(113) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(114) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".22222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(115) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "....222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(116) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(117) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(118) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22...22" + Chr$(13) m$
= m$
+ ".22.2.22" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "..22.22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(119) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(120) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(121) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(122) = m$
m$ = ""
m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..2....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "..2....." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(123) = m$
m$ = ""
m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(124) = m$
m$ = ""
m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ ".....2.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....2.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(125) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".22....2" + Chr$(13) m$
= m$
+ "2..2..2." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(126) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(127) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(128) = m$
m$ = ""
m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(129) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(130) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(131) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(132) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(133) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(134) = m$
m$ = ""
m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) arrTileText(135) = m$
m$ = ""
m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) arrTileText(136) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(137) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(138) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(139) = m$
m$ = ""
m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(140) = m$
m$ = ""
m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ ".222...." + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "....222." + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) arrTileText(141) = m$
m$ = ""
m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ "....222." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "..222..." + Chr$(13) m$
= m$
+ ".222...." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "22......" + Chr$(13) arrTileText(142) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) arrTileText(143) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) arrTileText(144) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(145) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(146) = m$
m$ = ""
m$
= m$
+ "..22.22." + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(147) = m$
m$ = ""
m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) arrTileText(148) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(149) = m$
m$ = ""
m$
= m$
+ "22....22" + Chr$(13) m$
= m$
+ "222..222" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "222..222" + Chr$(13) m$
= m$
+ "22....22" + Chr$(13) arrTileText(150) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(151) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(152) = m$
m$ = ""
m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) arrTileText(153) = m$
m$ = ""
m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ "...222.." + Chr$(13) m$
= m$
+ "....2..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(154) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(155) = m$
m$ = ""
m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) arrTileText(156) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(157) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "..22222." + Chr$(13) m$
= m$
+ ".222.22." + Chr$(13) m$
= m$
+ "..22.22." + Chr$(13) m$
= m$
+ "..22.22." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(158) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ "..222222" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ ".......2" + Chr$(13) arrTileText(159) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(160) = m$
m$ = ""
m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) arrTileText(161) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(162) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(163) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(164) = m$
m$ = ""
m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) arrTileText(165) = m$
m$ = ""
m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) arrTileText(166) = m$
m$ = ""
m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) arrTileText(167) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) arrTileText(168) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "2222222." + Chr$(13) m$
= m$
+ "222222.." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "2......." + Chr$(13) arrTileText(169) = m$
m$ = ""
m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) arrTileText(170) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(171) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) arrTileText(172) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(173) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(174) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(175) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(176) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(177) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(178) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(179) = m$
m$ = ""
m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) arrTileText(180) = m$
m$ = ""
m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) arrTileText(181) = m$
m$ = ""
m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) arrTileText(182) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(183) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(184) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(185) = m$
m$ = ""
m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(186) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) arrTileText(187) = m$
m$ = ""
m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(188) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(189) = m$
m$ = ""
m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(190) = m$
m$ = ""
m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) arrTileText(191) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2.....2" + Chr$(13) m$
= m$
+ ".2.....2" + Chr$(13) m$
= m$
+ ".2.....2" + Chr$(13) m$
= m$
+ ".2.....2" + Chr$(13) m$
= m$
+ ".2.....2" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) arrTileText(192) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) arrTileText(193) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(194) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "..2222.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(195) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(196) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".....2.." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".2222222" + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".....2.." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(197) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(198) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2.2..2.2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2.2..2.2" + Chr$(13) m$
= m$
+ "2.2222.2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) arrTileText(199) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2.2..2.2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2.2222.2" + Chr$(13) m$
= m$
+ "2.2..2.2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) arrTileText(200) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(201) = m$
m$ = ""
m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ "....22.." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(202) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(203) = m$
m$ = ""
m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) m$
= m$
+ "..22...." + Chr$(13) arrTileText(204) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(205) = m$
m$ = ""
m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) arrTileText(206) = m$
m$ = ""
m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) arrTileText(207) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(208) = m$
m$ = ""
m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) arrTileText(209) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(210) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(211) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(212) = m$
m$ = ""
m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) arrTileText(213) = m$
m$ = ""
m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) arrTileText(214) = m$
m$ = ""
m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) arrTileText(215) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) arrTileText(216) = m$
m$ = ""
m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) m$
= m$
+ "22..22.." + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "..22..22" + Chr$(13) m$
= m$
+ ".22..22." + Chr$(13) arrTileText(217) = m$
m$ = ""
m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) arrTileText(218) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(219) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) arrTileText(220) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(221) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(222) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(223) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22222" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(224) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(225) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(226) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) arrTileText(227) = m$
m$ = ""
m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) m$
= m$
+ "22......" + Chr$(13) arrTileText(228) = m$
m$ = ""
m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) m$
= m$
+ "222....." + Chr$(13) arrTileText(229) = m$
m$ = ""
m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) m$
= m$
+ ".....222" + Chr$(13) arrTileText(230) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(231) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(232) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(233) = m$
m$ = ""
m$
= m$
+ ".......2" + Chr$(13) m$
= m$
+ "......22" + Chr$(13) m$
= m$
+ ".....22." + Chr$(13) m$
= m$
+ ".22.22.." + Chr$(13) m$
= m$
+ ".2222..." + Chr$(13) m$
= m$
+ ".222...." + Chr$(13) m$
= m$
+ ".22....." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(234) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) arrTileText(235) = m$
m$ = ""
m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(236) = m$
m$ = ""
m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "...22..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "22222..." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(237) = m$
m$ = ""
m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(238) = m$
m$ = ""
m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "2222...." + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) m$
= m$
+ "....2222" + Chr$(13) arrTileText(239) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(240) = m$
m$ = ""
m$
= m$
+ "22222.22" + Chr$(13) m$
= m$
+ "22222.22" + Chr$(13) m$
= m$
+ "22222.22" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "22.22222" + Chr$(13) m$
= m$
+ "22.22222" + Chr$(13) m$
= m$
+ "22.22222" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(241) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".222222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(242) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(243) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...2222." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(244) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ ".222...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(245) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2222." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(246) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ "...2...." + Chr$(13) m$
= m$
+ ".222...." + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(247) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(248) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(249) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(250) = m$
m$ = ""
m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) m$
= m$
+ "........" + Chr$(13) arrTileText(251) = m$
m$ = ""
m$
= m$
+ "2.2.2.2." + Chr$(13) m$
= m$
+ ".2.2.2.2" + Chr$(13) m$
= m$
+ "2.2.2.2." + Chr$(13) m$
= m$
+ ".2.2.2.2" + Chr$(13) m$
= m$
+ "2.2.2.2." + Chr$(13) m$
= m$
+ ".2.2.2.2" + Chr$(13) m$
= m$
+ "2.2.2.2." + Chr$(13) m$
= m$
+ ".2.2.2.2" + Chr$(13) arrTileText(252) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "2......2" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(253) = m$
m$ = ""
m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(254) = m$
m$ = ""
m$ = ""
m$
= m$
+ "22....22" + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "22.....2" + Chr$(13) m$
= m$
+ "22222..2" + Chr$(13) m$
= m$
+ "2..22..2" + Chr$(13) m$
= m$
+ "22....22" + Chr$(13) m$
= m$
+ "22222222" + Chr$(13) arrTileText(255) = m$
' ################################################################################################################################################################
' END TILE DEFINITIONS
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN COLOR FUNCTIONS
' ################################################################################################################################################################
cWhite
= _RGB32(255, 255, 255)
cMagenta
= _RGB32(255, 0, 255)
' ################################################################################################################################################################
' END COLOR FUNCTIONS
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN GENERAL PURPOSE ROUTINES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' See also StringTo2dArray
MyString = ""
sLine = ""
sLine = sLine + MyArray(iY, iX)
MyString
= MyString
+ sLine
+ Chr$(13) Array2dToString$ = MyString
' /////////////////////////////////////////////////////////////////////////////
'Function Array2dToStringTest$ (MyArray() As String)
' Dim MyString As String
' Dim iY As Integer
' Dim iX As Integer
' Dim sLine As String
' MyString = ""
' MyString = MyString + " 11111111112222222222333" + Chr$(13)
' MyString = MyString + " 12345678901234567890123456789012" + Chr$(13)
' For iY = LBound(MyArray, 1) To UBound(MyArray, 1)
' sLine = ""
' sLine = sLine + Right$(" " + cstr$(iY), 2)
' For iX = LBound(MyArray, 2) To UBound(MyArray, 2)
' sLine = sLine + MyArray(iY, iX)
' Next iX
' sLine = sLine + Right$(" " + cstr$(iY), 2)
' MyString = MyString + sLine + Chr$(13)
' Next iY
' MyString = MyString + " 12345678901234567890123456789012" + Chr$(13)
' MyString = MyString + " 11111111112222222222333" + Chr$(13)
' Array2dToStringTest$ = MyString
'End Function ' Array2dToStringTest$
' /////////////////////////////////////////////////////////////////////////////
'cstr$ = LTRIM$(RTRIM$(STR$(myValue)))
' /////////////////////////////////////////////////////////////////////////////
' Simple timestamp function
CurrentDateTime$
= Mid$(Date$, 7, 4) + "-" + _
' /////////////////////////////////////////////////////////////////////////////
' Receives an {sDelim} delimited list {sInput}
' returns the list with all duplicate entries removed.
split sInput, sDelim, arrLines()
sOutput = sDelim
If InStr(1, sOutput
, sDelim
+ arrLines
(iLoop
) + sDelim
) = 0 Then sOutput = sOutput + arrLines(iLoop) + sDelim
DedupeDelimList$ = sOutput
' /////////////////////////////////////////////////////////////////////////////
' Use with timer functions to avoid "after midnight" bug.
' Re: how to time something (ie do loop for n seconds)
' https://qb64forum.alephc.xyz/index.php?topic=4682.0
' SMcNeill, QB64 Developer
' « Reply #1 on: Today at 11:26:52 am »
'
' One caveat here: You *can* experience bugs with this after midnight.
'
' Program starts at 23:59:59.
' Add three seconds -- 24:00:02... (In seconds, and not hours and minutes like this, though hours and minutes are easier to visualize.)
' Clock hits midnight: 0:00:00
'
' At no point will you ever have TIMER become greater than t#.
'
' If you're going to have a program which might run into this issue,
' I'd suggest just plugging in my ExtendedTimer and use it instead:
'
' Most of us write time code to test little snippets for which method might
' be faster for us while we're coding. The clock resetting on us isn't
' normally such a big deal. When it is, however, all you have to do is
' swap to the ExtendedTimer function [below]
'
' Returns a value for you based off DAY + TIME, rather than just time alone!
' No midnight clock issues with something like that in our programs. ;)
' Usage:
' ' DO SOMETHING FOR 3 SECONDS
' t# = ExtendedTimer + 3
' Do
' '(SOMETHING)
' Loop Until Timer > t#
l1
= InStr(l
+ 1, d$
, "-") Select Case i
'Add the number of days for each previous month passed Case 1: d
= d
'January doestn't have any carry over days. Case 2, 4, 6, 8, 9, 11: d
= d
+ 31 Case 5, 7, 10, 12: d
= d
+ 30 d = d + 365
If m
> 2 Then d
= d
+ 1 'add an extra day for leap year every 4 years, starting in 1970 d = d - 1 'for year 2000
s~&& = d * 24 * 60 * 60 'Seconds are days * 24 hours * 60 minutes * 60 seconds
ExtendedTimer##
= (s~&&
+ Timer)
' /////////////////////////////////////////////////////////////////////////////
' Receives a {sDelimeter} delimited list of numbers {MyString}
' and splits it up into an integer array arrInteger()
' beginning at index {iMinIndex}.
'DebugPrint "GetIntegerArrayFromDelimList " + _
' "MyString=" + chr$(34) + MyString + chr$(34) + ", " + _
' "sDelimiter=" + chr$(34) + sDelimiter + chr$(34) + ", " + _
' "iMinIndex=" + cstr$(iMinIndex) + ", " + _
' "arrInteger()"
CleanString = MyString
CleanString = Replace$(CleanString, " ", "")
split CleanString, sDelimiter, arrString()
iCount = iMinIndex - 1
If IsNum%
(arrString
(iLoop
)) = TRUE
Then iCount = iCount + 1
arrInteger
(iCount
) = Val(arrString
(iLoop
)) 'DebugPrint "5633 arrInteger(" + cstr$(iCount) + ") = VAL(arrString(" + cstr$(iLoop) + ")) = " + cstr$(arrInteger(iCount))
If IsNum%
(MyString
) = TRUE
Then arrInteger
(iMinIndex
) = Val(MyString
)
'CleanString=""
'for iLoop=lbound(arrInteger) to ubound(arrInteger)
'CleanString = CleanString + iifstr$(iLoop=lbound(arrInteger), "", ",") + cstr$(arrInteger(iLoop))
'next iLoop
'DebugPrint "arrInteger=(" + CleanString + ")"
End Sub ' GetIntegerArrayFromDelimList
' /////////////////////////////////////////////////////////////////////////////
Function IIF
(Condition
, IfTrue
, IfFalse
)
' /////////////////////////////////////////////////////////////////////////////
Function IIFSTR$
(Condition
, IfTrue$
, IfFalse$
) If Condition
Then IIFSTR$
= IfTrue$
Else IIFSTR$
= IfFalse$
' /////////////////////////////////////////////////////////////////////////////
' By sMcNeill from https://www.qb64.org/forum/index.php?topic=896.0
IsNum% = TRUE
IsNum% = FALSE
' /////////////////////////////////////////////////////////////////////////////
' Does a _PrintString at the specified row+column.
' iRow and iCol are 0-based.
' /////////////////////////////////////////////////////////////////////////////
' Does a _PrintString at the specified row+column.
' iRow and iCol are 1-based.
' /////////////////////////////////////////////////////////////////////////////
' FROM: String Manipulation
' found at abandoned, outdated and now likely malicious qb64 dot net website
' http://www.qb64.[net]/forum/index_topic_5964-0/
'
'SUMMARY:
' Purpose: A library of custom functions that transform strings.
' Author: Dustinian Camburides (dustinian@gmail.com)
' Platform: QB64 (www.qb64.org)
' Revision: 1.6
' Updated: 5/28/2012
'SUMMARY:
'[Replace$] replaces all instances of the [Find] sub-string with the [Add] sub-string within the [Text] string.
'INPUT:
'Text: The input string; the text that's being manipulated.
'Find: The specified sub-string; the string sought within the [Text] string.
'Add: The sub-string that's being added to the [Text] string.
' VARIABLES:
Dim lngLocation
As Long ' The address of the [Find] substring within the [Text] string. Dim strBefore
As String ' The characters before the string to be replaced. Dim strAfter
As String ' The characters after the string to be replaced.
' INITIALIZE:
' MAKE COPIESSO THE ORIGINAL IS NOT MODIFIED (LIKE ByVal IN VBA)
Text2 = Text1
Find2 = Find1
Add2 = Add1
lngLocation
= InStr(1, Text2
, Find2
)
' PROCESSING:
' While [Find2] appears in [Text2]...
' Extract all Text2 before the [Find2] substring:
strBefore
= Left$(Text2
, lngLocation
- 1)
' Extract all text after the [Find2] substring:
strAfter
= Right$(Text2
, ((Len(Text2
) - (lngLocation
+ Len(Find2
) - 1))))
' Return the substring:
Text2 = strBefore + Add2 + strAfter
' Locate the next instance of [Find2]:
lngLocation
= InStr(1, Text2
, Find2
)
' Next instance of [Find2]...
' OUTPUT:
Replace$ = Text2
' /////////////////////////////////////////////////////////////////////////////
' Split and join strings
' https://www.qb64.org/forum/index.php?topic=1073.0
'
' FROM luke, QB64 Developer
' Date: February 15, 2019, 04:11:07 AM
'
' Given a string of words separated by spaces (or any other character),
' splits it into an array of the words. I've no doubt many people have
' written a version of this over the years and no doubt there's a million
' ways to do it, but I thought I'd put mine here so we have at least one
' version. There's also a join function that does the opposite
' array -> single string.
'
' Code is hopefully reasonably self explanatory with comments and a little demo.
' Note, this is akin to Python/JavaScript split/join, PHP explode/implode.
'Split in$ into pieces, chopping at every occurrence of delimiter$. Multiple consecutive occurrences
'of delimiter$ are treated as a single instance. The chopped pieces are stored in result$().
'
'delimiter$ must be one character long.
'result$() must have been REDIMmed previously.
' Modified to handle multi-character delimiters
Sub split
(in$
, delimiter$
, result$
())
iDelimLen
= Len(delimiter$
)
start = 1
'While Mid$(in$, start, 1) = delimiter$
While Mid$(in$
, start
, iDelimLen
) = delimiter$
'start = start + 1
start = start + iDelimLen
finish
= InStr(start
, in$
, delimiter$
)
result$
(UBound(result$
)) = Mid$(in$
, start
, finish
- start
) start = finish + 1
' /////////////////////////////////////////////////////////////////////////////
' Converts a chr$(13) delimited string
' into a 2-dimensional array.
' Usage:
' Dim StringArray(1 To 48, 1 To 128) As String
' StringTo2dArray StringArray(), GetMap$
' Version 2 with indexed array(row, columm)
' Renamed StringToArray to StringTo2dArray.
' See also: Array2dToString$
split MyString, sDelim, arrLines()
sChar
= Mid$(arrLines
(iRow
), iCol
, 1)
sChar = "."
iIndex1 = iRow + iDim1
iIndex2 = (iCol - 1) + iDim2
MyArray(iIndex1, iIndex2) = sChar
'DebugPrint "MyArray(" + cstr$(iIndex1) + ", " + cstr$(iIndex2) + " = " + chr$(34) + sChar + chr$(34)
' Exit if out of bounds
' Exit if out of bounds
' /////////////////////////////////////////////////////////////////////////////
TrueFalse$ = "TRUE"
TrueFalse$ = "FALSE"
' ################################################################################################################################################################
' END GENERAL PURPOSE ROUTINES
' ################################################################################################################################################################
' ################################################################################################################################################################
' BEGIN HARDWARE IMAGES DEMO #2 (WORKS)
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
' Re: fastest way to draw a 2-color 8x8 tile (with variable colors)?
' https://qb64forum.alephc.xyz/index.php?topic=4674.0
' madscijr
' « Reply #5 on: Yesterday at 09:46:53 pm »
' Quote from: SMcNeill on Yesterday at 07:56:57 pm:
' Hardware images basically get their speed by being a sort of "Write Only"
' method for images. You can make them, you can put them on the screen,
' but you can't edit them or read information back from them.
' ...
' 2) You don't have to specify where they show up as a destination with putimage.
' ...
' If you have any specific questions, feel free to ask them and I'll do my
' best to answer for you, if I can. ;)
'
' Thanks for taking the time to explain all that. When I'm back at the PC,
' I'll try out your example.
'
' For now, just one question: if you can't read information from them or even
' specify where on the destination they go, how are they even useful?
' Maybe it will click when I run your example or read up on it, but I just
' don't see what the use of an image would be if you can't control where on
' the screen it is drawn? Or how it would help speed up drawing a map of
' colored tiles to the screen.
'
' Thanks again...
' SMcNeill, QB64 Developer
' « Reply #6 on: Today at 01:14:28 am »
'
' Try this out and see if it doesn't help answer your questions:
Print "First, let's create a normal sortware screen and fill it with 40x40 tiles of random colors." Print "Press <ANY KEY> to view this screen."
Line (x
, y
)-Step(40, 40), &HFF000000 + Rnd * &HFFFFFF, BF
Print "As you can see, this is a simple software screen." Print "Now, I'm going to copy that software screen and make it a hardware screen." Print "Press <ANY KEY> for me to do so!"
Print "Now, I'm back to my blank screen, but I now have a hardware screen to work with." Print "To keep things simple, let's showcase the differences between using _putimage with a software screen, and then with the hardware screen." Print "First, the software screen! Press <ANY KEY> to continue."
_PutImage (0, 100)-Step(100, 100), Software
, Display
, (0, 0)-(40, 40) Print "As you can see, all I did here was copy a single tile from the software screen and then scale it to fit upon the current screen." Print "Press <ANY KEY> to continue, as I'll now do the same with a hardware image."
Print "As you can see from the above, we have the same tile copied and scaled onto the screen, just to the right of the software image." Print "Doesn't really seem to be very different at all, now does it?" Print "Press <ANY KEY> to continue."
Print "BUT WAIT A MOMENT!! What the heck happened to our hardware tile??!!??" Print "It's no longer on the screen, as it was previously. Why??" Print "Because it was never on the software screen at all, but was instead on it's own hardware layer ABOVE the software screen." Print "Hardware images only display ONCE, once _DISPLAY is called, and then they flush from the graphics buffer." Print "Draw. Display. Flush. <-- that's the basic process of how a hardware image works." Print "If we want one to remain on the screen, we have to do it either by:" Print "1) Not updating the screen after we draw and display the image, as I did above with the tile I displayed." Print "2) Refresh displaying the image in our main loop (which is what we do even with software images for most games and such)." Print "Press <ANY KEY> to continue."
Print "So, as you can see, hardware images have a few drawbacks to them, with the most obvious being they only display once," Print "then flush from memory. If you want persistant hardware images, they're best used in a loop." Print "But, if they've got drawbacks, then one has to ask, 'What's the advantages to using them?'" Print "Press <ANY KEY> to find out!"
't# = ExtendedTimer + 3
count = count + 1
x = x + 40
If x
> 1024 Then x
= 0: y
= y
+ 40
Print "See lots of flashing tiles on the screen for the last three seconds?" Print "That was us using _PUTIMAGE with the software screen, and we put"; count;
"tiles on the screen in those 3 seconds." Print "Now press <ANY KEY> and we'll do the exact same thing with hardware images."
count = 0: x = 0: y = 0
count = count + 1
x = x + 40
If x
> 1024 Then x
= 0: y
= y
+ 40
Print "Didn't seem very different at the rate of which we were running things, now did it?" Print "Would you be surprised to find out that we put"; count
* 2;
"hardware images on the screen in those same 3 seconds?" Print "And if you look close, I counted each loop twice, as we didn't just put the hardware image to the screen, but also a" Print "complete copy of the original software screen as well!" Print "The reason why I did this?" Print "So I could completely elimimate all software iamges and JUST work with the much faster hardware layer!" Print "Press <ANY KEY> to continue"
Print "So, as you can see, hardware images are multiple times faster to display and render than software images." Print "But here's something else for you to notice -- I'm going to update the screen with constant, limitless tile refeshes." Print "To start with, I'm going to do this in a LOOP with the software images." Print "CTRL-TAB out of this demo program, open your task manager, and see how much memory and CPU processing power the program uses." Print "Then TAB back to this program and hit <ESC> to do the same with the hardware images."
_PutImage (0, 100)-(1024, 720), Software
, Display
, (x
, y
)-Step(40, 40) x = x + 40
If x
> 1024 Then x
= 0: y
= y
+ 40
Print "PRESS <SPACE BAR> to stop the hardware iamges!!" x = 0: y = 0
x = x + 40
If x
> 1024 Then x
= 0: y
= y
+ 40
Print "On my laptop, these two methods use the following amounts of CPU power:" Print "Software, 60 FPS -- 3% CPU" Print "Hardware, 60 FPS -- 0.1% CPU" Print "If I go in and change the limits to something much higher, these are the results (test them for yourselves, please):" Print "Software, 600 FPS -- 10.3% CPU" Print "Hardware, 600 FPS -- 0.1% CPU" Print "So, as you can see, the disadvantage to hardware images are they display once, then flush from memory." Print "While the advantages to their usage is MUCH faster processing times, and an immense reduction on CPU usage. (The GPU picks up the work for us!)" Print "You basically use them just like you would any other normal image, though you have to keep in mind that they render" Print "to their own hardware layer, which you can specify to go on below or above your software screen." Print "(Or, you can _DISPLAYORDER _HARDWARE and *only* display the hardware layer, removing software rendering completely!)" Print "And THAT, my friends, is basically the lowdown on hardware vs software images. ;)" Print "And this was another Steve(tm) Tutorial! Enjoy!!"
' ################################################################################################################################################################
' END HARDWARE IMAGES DEMO #2 (WORKS)
' ################################################################################################################################################################
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' BEGIN DEBUGGING ROUTINES #DEBUGGING
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'_Echo MyString
split MyString
, Chr$(13), arrLines
()
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' END DEBUGGING ROUTINES @DEBUGGING
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' ################################################################################################################################################################
' BEGIN MENU HELPER ROUTINES
' ################################################################################################################################################################
' /////////////////////////////////////////////////////////////////////////////
Sub ShowInstructions
(in$
) split in$
, Chr$(13), arrLines
() ' SPLIT OUTPUT INTO LINES iCount = iCount + 1
'INPUT "PRESS <ENTER> TO CONTINUE"; in$
iCount = 0
Input "PRESS <ENTER> TO CONTINUE"; in$
' ################################################################################################################################################################
' END MENU HELPER ROUTINES
' ################################################################################################################################################################
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
' #REFERENCE
' =============================================================================
' SOME USEFUL STUFF FOR REFERENCE:
' Type Name Type suffix symbol Minimum value Maximum value Size in Bytes
' --------------------- ------------------ ---------------------------- -------------------------- -------------
' _BIT ` -1 0 1/8
' _BIT * n `n -128 127 n/8
' _UNSIGNED _BIT ~` 0 1 1/8
' _BYTE %% -128 127 1
' _UNSIGNED _BYTE ~%% 0 255 1
' INTEGER % -32,768 32,767 2
' _UNSIGNED INTEGER ~% 0 65,535 2
' LONG & -2,147,483,648 2,147,483,647 4
' _UNSIGNED LONG ~& 0 4,294,967,295 4
' _INTEGER64 && -9,223,372,036,854,775,808 9,223,372,036,854,775,807 8
' _UNSIGNED _INTEGER64 ~&& 0 18,446,744,073,709,551,615 8
' SINGLE ! or none -2.802597E-45 +3.402823E+38 4
' DOUBLE # -4.490656458412465E-324 +1.797693134862310E+308 8
' _FLOAT ## -1.18E-4932 +1.18E+4932 32(10 used)
' _OFFSET %& -9,223,372,036,854,775,808 9,223,372,036,854,775,807 Use LEN
' _UNSIGNED _OFFSET ~%& 0 18,446,744,073,709,551,615 Use LEN
' _MEM none combined memory variable type N/A Use LEN
' div: int1% = num1% \ den1%
' mod: rem1% = num1% MOD den1%
' @REFERENCE
' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++