QuoteEdit:
New version, now writes 2 bytes, that should, for maps is enough.
Internally something altered, it is listed everything in Array's and is sorted.
http://www.glbasic.com/showroom.php?game=tmx_2_d2ma_v3&lang=de
Hi all,
downloadfiles are here, http://www.deuteriumoxid.com/glbasic/testfile.zip
Include a little Tutorial as DIVX Movi without sound.
Info: Tiled is a Java Program, more here, http://mapeditor.org
Please Feedback.
Cya
Oops, i forget the loader file ;)
Loaderfile :
// --------------------------------- //
// Project: D2MA_Loader
// Start: Wednesday, January 30, 2008
// IDE Version: 5.154
// (c)Fabbio Soddu
// d2o@deuteriumoxid.com
//
// +.d2ma Loader
comein$ = FILEREQUEST$(TRUE, "D2MA|*.d2ma|All|*.*")
byte = GETFILESIZE(comein$)
map = OPENFILE(0,comein$,TRUE)
READBYTE 0,lx //Width
READBYTE 0,ly //Higth
READBYTE 0,tilex
READBYTE 0,tiley
READBYTE 0,layer
DIM field[lx][ly][layer]
FOR la = 0 TO layer - 1
FOR iy = 0 TO ly - 1
FOR ix = 0 TO lx - 1
READBYTE 0,a
field[ix][iy][la] = a
NEXT
NEXT
NEXT
CLOSEFILE 0
/// End Loader
WHILE TRUE
FOR la = 0 TO layer - 1
FOR iy = 0 TO ly - 1
FOR ix = 0 TO lx - 1
a = field[ix][iy][la]
IF a <> 0 AND la = 0
DRAWRECT 0+(tilex*ix),0+(tiley*iy),tilex,tiley,RGB(0x00, 0x80, 0xff)
ENDIF
IF a <> 0 AND la = 1
DRAWRECT 0+(tilex*ix),0+(tiley*iy),tilex,tiley,RGB(0xff, 0x00, 0x00)
ENDIF
NEXT
NEXT
NEXT
SHOWSCREEN
SLEEP 200
WEND