'WarCraft 1 Tile Ripper
'2018 08 17 - 13:45 V1.0 Alpha Build 0001
'by Cobalt
'with help from:
' SMcNeill
' FellippeHeitor
' Petr
' www.QB64.org
_DONTBLEND 'for whatever reason this is needed for certain things to show up.
'debug information
'clear and display progress area
LINE (0, 416)-(1023, 431), _RGB(0, 0, 0), BF
LINE (0 + 16 * X%%
, 416)-(15 + 16 * X%%
, 431), _RGB32(200, 200, 15), BF
GET (0 + (X%%
* 16), 0 + (Y%%
* 16))-(15 + (X%%
* 16), 15 + (Y%%
* 16)), temp
() 'clear test area
'put test peice for reference
newtile%% = TRUE
'do not test for first tile as there is nothing to test yet.
PUT (0 + tx%%
* 16, 0 + ty%%
* 16), temp
() tx%% = tx%% + 1: peices% = peices% + 1
IF tx%%
= 40 THEN ty%%
= ty%%
+ 1: tx%%
= 0 'test the peice placing 2 copies of each found tile and XOR the test peice
' over to see if it erases
px%% = 0: py%% = 0
'first line of found tiles
'cycle through test peices and check for match
'progress bar for peices tested
LINE (0 + px%%
* 16, 360)-(15 + px%%
* 16, 375), _RGB32(0, 128, 255), BF
'current line of tiles to test
'clear test area
'current check image
LINE (299, 199)-(316, 216), _RGB32(255, 255, 0), B
_PUTIMAGE (300, 200), tile&
, _DISPLAY, (0 + px%%
* 16, 0 + py%%
* 16)-(15 + px%%
* 16, 15 + py%%
* 16) 'place the test copy
_PUTIMAGE (320, 200), tile&
, _DISPLAY, (0 + px%%
* 16, 0 + py%%
* 16)-(15 + px%%
* 16, 15 + py%%
* 16)
'put the tile to check over the test copy with XOR
'zoom in on that area
LINE (0, 0)-(127, 127), _RGB32(0, 0, 0), BF
'clear zoom layer _PUTIMAGE (0, 0), _DISPLAY, Zoom&
, (299, 200)-(336, 215) 'put test area in zoom layer _PUTIMAGE (0, 0)-(128, 64), Zoom&
, _DISPLAY, (0, 0)-(37, 15) 'put enlarged image back on display
'get the test copy to see if it was erased
GET (320, 200)-(335, 215), temp
(257)
IF TileCount2
= 0 THEN 'matchfound newtile%% = FALSE
i% = peices% + 1
px%% = px%% + 1
IF px%%
= 40 THEN py%%
= py%%
+ 1: px%%
= 0
IF newtile%%
THEN 'no matches found LOCATE 12, 1:
PRINT TileCount2
'rgb brightness value(I think) PUT (0 + tx%%
* 16, 0 + ty%%
* 16), temp
() tx%% = tx%% + 1: peices% = peices% + 1
IF tx%%
= 40 THEN ty%%
= ty%%
+ 1: tx%%
= 0
px%% = px%% + 1
IF px%%
= 40 THEN py%%
= py%%
+ 1: px%%
= 0
IF X%%
< 65 THEN SCREEN tile&
'dont display if user pressed ESC
v& = v& + (r~%% + b~%% + g~%%)
TileCount = v&
v& = v& + (r~%% + b~%% + g~%%)
TileCount2 = v&