How To Load Map Array
BlitzPlus Forums/BlitzPlus Beginners Area/How To Load Map Array
| ||
Hello, I've Been Trying To load A Map Array Into Blitz Plus So I Can Draw The Map Without Having to create a bitmap file for it (because a bitmap file of it would be 64000x48000 pixels Which would use up probably half the memory on my computer!!!) Does anyone know how???? If so then Please Help!!!!! P.S. For those of you who don't know, A Map array is an array of numbers(currently on Notepad) that combine to create a map And no I won't type it all in( It would take about a week of non-stop typing!!!) And I can't CopyPaste it because I only have one text editor that uses the same clipboard object as BP and it Can only hold about 1/100 of the array ( The down side of homemade VB Programs...) |
| ||
function loadmap(filename$) infile=readfile(filename$) if infile<>0 then ;The next few lines really depend on how ;you have stored your map array. ;There are innumerable methods for doing ;this but here are is one method ; ; bank=createbank(filesize(filename$)) readbytes bank,infile,0,banksize(bank) else runtimeerror("File Not Found:"+FileName$) endif ;return the bank handle which will ;allow you to peek directly to the bank to get ;the maparray data. ; ;As I don't know how you have stored/arranged ;the data I cannot tell you how to parse / extract ;your data from the bank ; return bank end function |
| ||
It Isn't Working With That Code........ It's save with Mappy As A .MAR file |
| ||
Does this recent post in B3D help at all? http://blitzbasic.com/Community/posts.php?topic=80168 Reading the data from external file shouldn't be that different. |
| ||
It Isn't Working With That Code........ You could have probably saved Matty some time if you'd bothered to mention that in the first place.It's save with Mappy As A .MAR file Some people here might be clever, but they aren't clairvoyant. |