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

Author Topic: Tilemap showing blue lines when moving sf::view - SFML 1.6  (Read 3676 times)

0 Members and 1 Guest are viewing this topic.

Sumzary

  • Guest
Tilemap showing blue lines when moving sf::view - SFML 1.6
« on: August 16, 2012, 09:30:52 pm »
Okay, so the reason why I am still using 1.6 instead of 2.0 is because it wont bloody work on my pc.
I have the problem where moving the mouse or pressing buttons makes the app freeze.
So, after many hours of googeling and doing stupid stuff, I decided to downgrade to 1.6.

Weeks later I reach this issue, moving the view causes these blue lines to appear.
I am using the tiled map loader and am moving the view smoothly with acceleration and deceleration.
The view is scaled to 3x size. I understand other people were having these issues as well, but I don't grasp the idea behind solving this thing.

Here is a picture showing the problem:



Specs:
WinXP
C++
SFML 1.6
MSVC 2008 Compiler
Qt Creator IDE

I apologize for any mistakes in my poor english.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10820
    • View Profile
    • development blog
    • Email
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #1 on: August 16, 2012, 10:46:19 pm »
Oh right, I forgot: We are magicians and with our magic balls we can see your code and identify the problem... ::)

If you want us to help, you have to provide a complete and minimal example, so other could try it, or find out what the problem is...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #2 on: August 16, 2012, 10:49:57 pm »
Quote
So, after many hours of googeling and doing stupid stuff, I decided to downgrade to 1.6.
Why not ask here instead of wasting your time and take bad decisions? ;)

Quote
Okay, so the reason why I am still using 1.6 instead of 2.0 is because it wont bloody work on my pc.
I have the problem where moving the mouse or pressing buttons makes the app freeze.
Do you use the RC? Does it happen with the precompiled examples too?

Quote
I understand other people were having these issues as well, but I don't grasp the idea behind solving this thing.
You can try two things:
- keep your images sharp (image.SetSmooth(false))
- round the view's coordinates to integers
Laurent Gomila - SFML developer

Sumzary

  • Guest
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #3 on: August 17, 2012, 01:01:01 pm »
Sorry for answering a day later :]
I also apologize if I was arrogant, I am not used to the whole forum thing and I was annoyed at the time.  :-\

Quote
Why not ask here instead of wasting your time and take bad decisions? ;)
Well I saw several topics on the problem and after trying all the solutions offered I didn't feel the need to create a new topic.

Quote
Do you use the RC? Does it happen with the precompiled examples too?
I did use RC and it does happen with the examples and anything else that is made in 2.0.

Quote
You can try two things:
- keep your images sharp (image.SetSmooth(false))
- round the view's coordinates to integers
I already am making all the images nonsmooth.

Rounding fixed it, I just added these lines where they were needed.
viewPort.x = std::floor(viewPort.x + 0.5);
viewPort.y = std::floor(viewPort.y + 0.5);

This has made the scrolling clucky, however.
At this point I may have to abandon the sexy smooth scrolling entirely  :(
Thanks for the help :]

pdinklag

  • Sr. Member
  • ****
  • Posts: 330
  • JSFML Developer
    • View Profile
    • JSFML Website
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #4 on: August 17, 2012, 01:13:44 pm »
This has made the scrolling clucky, however.
At this point I may have to abandon the sexy smooth scrolling entirely  :(
Nah, you could still pre-render the map (that is, as much as you can see on the screen, +1 tile left and right) to a RenderTexture and make a sprite of it which again you can move smoothly.

But if I remember correctly, those RenderTextures are a SFML 2 feature... ;)

I'm pretty certain there's a fix for your freezing problem. Try providing a more detailed description of the problem and - like Laurent would say - give us a minimal amount of code that reproduces the problem.
JSFML - The Java binding to SFML.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10820
    • View Profile
    • development blog
    • Email
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #5 on: August 17, 2012, 01:17:10 pm »
Nah, you could still pre-render the map (that is, as much as you can see on the screen, +1 tile left and right) to a RenderTexture and make a sprite of it which again you can move smoothly.

But if I remember correctly, those RenderTextures are a SFML 2 feature... ;)
Or you could use the recommended way with a VertexArray which again is a SFML 2 feature. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Sumzary

  • Guest
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #6 on: August 17, 2012, 02:20:09 pm »
Teasing bastards  ;D

Quote
I'm pretty certain there's a fix for your freezing problem. Try providing a more detailed description of the problem and - like Laurent would say - give us a minimal amount of code that reproduces the problem.

Well there is no code I can give, even if the program just a screen, moving the mouse on the screen or holding any button on the keyboard will throw the CPU usage on the task manager up to 99 and the program will freeze.

FRex

  • Hero Member
  • *****
  • Posts: 1845
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #7 on: August 17, 2012, 02:41:20 pm »
Do you poll all of your events asap?
Back to C++ gamedev with SFML in May 2023

Sumzary

  • Guest
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #8 on: August 17, 2012, 03:16:22 pm »
It doesn't matter, the problem is still there.
I tried all the examples that came with SFML 2, funny enough, with the 'shader' example, if I move the mouse outside of the screen, the effect works perfectly, when inside, the problem arises again.
If I can't fix this problem somehow, the absolutely wonderous amazing game I'm working on will be called off :(
So, ANY ideas?

Edit:

I dont even need SFML 2 really, seem as though I have written alot in 1.6 already, just getting rid of those awful blue lines would be great. Now, how?
« Last Edit: August 17, 2012, 04:13:02 pm by Sumzary »

Sumzary

  • Guest
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #9 on: August 17, 2012, 05:30:09 pm »
Seem as though I was using a Tiled map loader this is going to be a bit of a pain, but I am going to have a separate image for all the different tiles. Thanks for your help, all of ye :]

exafi

  • Newbie
  • *
  • Posts: 41
    • View Profile
Re: Tilemap showing blue lines when moving sf::view - SFML 1.6
« Reply #10 on: August 23, 2012, 09:50:23 pm »
sf::Image::SetSmooth(false);

 

anything