- procedure RenderVillage();
- var x,y: Integer;
- tmp_gid : Integer;
- x1,y1,x2,y2: single;
- tilefloatwidth,tilefloatheight: single;
- imagewidth,imageheight: Integer;
- begin
- For x := 1 to mapwidth do
- For y := 1 to mapheight do
- begin
- tmp_gid := gidMap[x,y];
- tileSetsImages[0].Bind();
- imagewidth := Round(tileSets[0].imagewidth/tileWidth);
- imageheight :=Round(tileSets[0].imageheight/tileHeight);
- x1 := (tmp_gid-1) mod imagewidth;
- y1 := ceil((tmp_gid-1)/imagewidth);
- x2 := x1+1;
- y2 := y1-1;
- Form1.DrawQuad(mapwidth-x*8,mapheight-y*8,0,8,8,x1/imagewidth,y2/imageheight,x2/imagewidth,y1/imageheight);
- end;
- end;