Public Group

basic begginers isometric drawing questions

This topic is 4835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I have a working 2d engine that I am trying to turn into a isometric engine. I am using directdraw. I load the mao from a text file and draw them with only only one function then flip them to the primary surface. all my tiles are in one bitmap. Issue I am having is that the tiles will not line up correctly. When I send them to the screen they have 1 pixel space between them. I whent through the articles on this site and they did not help me in displaying the tiles in directdraw.I am using a tile set from article Mouse Maps for Isometric Height Maps.They are 64x64 as far as i can tell. How do I take a single iso tile and use directdraw to display it on the screen? Do I have to do alot of math to make it work? The tiles have padding I think I am assining 64x64 the width nad hight. that may be were my problem lays I am not sure.
void draw_tiles(void)
{
for(Tileset.y=0; Tileset.y <Mapy;Tileset.y++)
{for(Tileset.x=0; Tileset.x < Mapx; Tileset.x++)
{  //what does this do?

Tileset.offset_x= Tileset.world_camerax+ (screenx/2);
Tileset.offset_y=Tileset.world_cameray+(screeny/2);

Tileset.tiles = map[Tileset.y ][Tileset.x ];

tile_src.left = (Tileset.tiles %20) *Tileset.Tile_Width;
tile_src.top =  (Tileset.tiles /20) * Tileset.Tile_Hight ;
tile_src.right = tile_src.left + Tileset.Tile_Width ;
tile_src.bottom = tile_src.top + Tileset.Tile_Hight  ;

dstr.left= ((Tileset.x-Tileset.y)*Tileset.Tile_Width/2)+Tileset.offset_x;
dstr.right = dstr.left + Tileset.Tile_Width  ;

dstr.top=  ((Tileset.y+Tileset.x)*Tileset.Tile_Hight/2)-Tileset.offset_y;
dstr.bottom = dstr.top +(Tileset.Tile_Hight + Tileset.Tile_Width) ;

lpBackBuffer->Blt(&dstr,g_pddTile,&tile_src,DDBLT_WAIT|DDBLT_KEYSRC,NULL);
}
}
}


1) I loop through the map array 2) I find the offset were the map will start displaying from 3) find the size of the tile and were it is loacted in the bitmap that I want to use 4) I find the array on the screen were I want to place it 5) I blt it to the back buffer 6) What you cant see is then I flip it to the primary surface and then clear the back buffer So can any one tell me were I am going wrong?

Share on other sites
Well, it's hard to tell without seeing a screenshot, but you may not be doing anything wrong. The tile images you are using have a dark line around their edges, which would lead to apparent "gaps" between them, as seen in the screenshots in the article you got them from. Is that what you mean?

Share on other sites
you know you are 100% correct. what happen was that I change the colur of the tiles and back ground so it was not a completline but just dots along the edges so I thought it was my fault but when I left it a default then I seen the line.

1. 1
2. 2
3. 3
4. 4
frob
15
5. 5

• 16
• 12
• 20
• 12
• 14
• Forum Statistics

• Total Topics
632155
• Total Posts
3004477

×