Okay, so here is a little program I wrote to rip a tile set from WarCraft 1 to use in my clone as I could not find the plains tile set already ripped(found the swamp tile set and everything else). Its not super efficient, but that was never my goal. Its not terribly customizable, but again not my goal, however it would not be too hard to set up a CONST area where custom values could be used for tile size, image size, ect... . The program does demonstrate some old classic sprite usage with GET\PUT if you just wanted to see how they can, and often were, used way back when. I do not advise there use 'mainstream' now with _putimage being, quite honestly, easier to use, though having its own restrictions. Like not being able to move something around the screen without first putting it on a different image layer.
Not really going to go over the code, just wanted to throw it out there maybe someone else could have a use for it. If you have any questions on parts of it go ahead and ask here. there are quite a few comments in the code but its my 'chicken scratches' so-to-speak so might not be clear to everybody. kind of fun to watch working with the delays on, I believe its like 15-20 mins with them set at there current values. my first run would have taken nearly 75 mins! cause I had them set sooo high. On the map I was using I forgot to move the cursor off the screen when I screen captured so it finds a lot of extra tiles, soooo I'm going to have to recapture the whole thing again. :-{
I've PNGed the map for size, for people with slower connections, and if you have trouble loading it download the latest DB(dirty build) or use build 82(20171106/82) cause that is what I am working with.
'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&
.