Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [Isometric] dont draw correctly ( black lines ? )  (Read 1884 times)

0 Members and 1 Guest are viewing this topic.

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
[Isometric] dont draw correctly ( black lines ? )
« on: December 11, 2012, 02:33:55 pm »
Simple question:


I have my isometric map that i initialize in this mode:

        for (int i = 0; i < Xmapsize; i++)
                 for (int j = Ymapsize - 1; j >= 0; j--)
                 {
                        tile_map[i][j].setTexture(texture);
            float x = (j * tile_width / 2) + (i * tile_width / 2);
            float y = (i * tile_height / 2) - (j * tile_height / 2);

                        tile_map[i][j].setPosition(x,y);
                 }



and i draw it in the simplest mode possible:

                for (int i = 0; i < Xmapsize; i++)
                        for (int j = Ymapsize - 1; j >= 0; j--)
                                window.draw(tile_map[i][j]);



Any1 know why in my map there are some orrible black lines ?

This is the image:





Ty in advance!


some stuff: sfml 2, visual studio 10 , the error persist in debug n release mode

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10821
    • View Profile
    • development blog
    • Email
Re: [Isometric] dont draw correctly ( black lines ? )
« Reply #1 on: December 11, 2012, 03:26:37 pm »
I'd say your coordinates are 1 pixel off, but I don't want to think your calculations through. If you're 100% that they are correct, then maybe you should try rounding the coordinates to non-decimal numbers, so you'd get an accurate positioning...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

player931402

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
Re: [Isometric] dont draw correctly ( black lines ? )
« Reply #2 on: December 11, 2012, 05:03:37 pm »
solved by fixing image lenght
« Last Edit: December 11, 2012, 05:43:59 pm by player931402 »