Jump to content
  • Advertisement
Sign in to follow this  
kingpinzs

basic begginers isometric drawing questions

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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.

Thanks for your help

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!