SFML community forums
Help => Graphics => Topic started by: klusark on July 29, 2009, 05:13:43 am
-
I have a video (http://files.getdropbox.com/u/820737/mdpr%202009-07-28%2019-55-24-86.avi)(913kb) showing the two problems I am having.
First is the white lines. The sprite sheet I have has white padding. Is there any way to solve this with out editing the image?
Second, witch is kind of hard to see, is it looks quit shaky when moving. The movement is using a sf::View and setting the center to the sprites position every frame. Is there a better way for the camera to follow the sprite?
Edit Fixed this one. I was drawing before moving the view. Now i move the view and then draw.
But I now have a new problem. Why does turning on vsync use one prosseser? vsync off and frame limit at 60 3-4% cpu usage vsync on no matter what the frame limit is 100% cpu usage.
The code can all be found at my projects Google code page (http://code.google.com/p/mdpr/).
-
I can't play your video, you should rather post a screenshot.
You shouldn't use both V-sync and framerate limit at the same time.
-
I am not using them at the same time.
When vsync is on by its self. It uses 100% cpu.
When frame limiting is on by its self at 60 fps it uses 4% cpu.
I have a nvidia gtx 285 with the latest drivers.
-
With one of my other problems.
Sometimes there are these white bars.
(http://files.getdropbox.com/u/820737/shot1.png)
or
(http://files.getdropbox.com/u/820737/shot2.png)
the sprite sheet I am using
(http://files.getdropbox.com/u/820737/player.png)
Is there a way to fix this without changing the images?
-
well, between each of your tiles of the image is a white line. i guess thats your problem xD
to fix that, you need to place the subrect of the sprite not +width but +width+1 or something
-
Only problem is the top bar and bottom bars. Some/most sprites are right on the bottom so i cannot cut off a pixel. I know that this has something to do with Anti Aliasing/ smoothing.
-
Which version of SFML are you using? If it's 1.5, you should try the last revision from SVN. There's a fix for this kind of issues.
-
I fixed it using Image->CreateMaskFromColor(sf::Color(255,255,255)); to make the padding all transparent.
But I am still wondering about vsync.