well i've got somewhere! i now have a routine that generates an accurate map pretty well and saves it ^_^ However, i was hoping i could have it in my map editor updating on the fly so you could see how much of the map you had covered.. but its SO slow when you have covered most of the map! I was wondering if anyone could help with ideas to speed it up? Heres the code I wrote:
Function GenerateMiniMap()
increment_x = MapWidth / 100
increment_y = MapHeight / 100
set current bitmap 5
For x = 0 to MapWidth step increment_x
For y=0 to MapHeight step increment_y
If MapData(x, y).TileID > -1
col = GetImagePixel(MapData(x, y).TileID + TILE_START, 1, 1)
ink col, 0
dot x, y
Ink rgb(255,255,255), 0
Endif
next
next
get image 900, 0, 0, 100, 100
set current bitmap 0
EndFunction
Function GetImagePixel(ImageID as Integer, X as Integer, Y as Integer)
If Image Exist(ImageID)
Make Memblock From Image 1, ImageID
Width = Memblock Dword(1, 0)
Height = Memblock Dword(1, 4)
Depth = Memblock Dword(1, 8)
mem_x = x*4
mem_y = y * (width*4)
Pixel = Memblock Dword(1, mem_x + mem_y)
Delete Memblock 1
Endif
EndFunction Pixel
had to write my own get pixel routine for images >>;;
Anyway bitmap 5 is created once at the start of the program. This all *works* its just SO SLOW. Please help?
p4 2.4ghz, 768ddr ram, Geforce FX 5200
Innovate, redefine, recreate whats in your mind. It isnt fate, you decide, only you can cross that line.