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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - freetheworld

Pages: [1]
1
Graphics / Bug in scalling up small sprites... or am I doing it wrong
« on: April 26, 2017, 08:21:17 pm »
I don't know; if this has ever been brought up, It's happened like this for me ever since I started using sfml back around 1.4, if it's a bug, or I'm just doing it wrong.

I use the sprite.setScale() to set the size of my sprites no matter what the size of the incoming texture is, but for some reason it doesnt work if the texture is smaller than 32x32

float width = 64;
float height = 64;

sprite.setScale(width / sprite.getLocalBounds().width, height / sprite.getLocalBounds().height);

Funny part is, say I know my texture is 16x16 so I plug the numbers in without using getLocalBounds(), it works fine. ie...

sprite.setScale(width / 16, height / 16);

does exactly what I would expect.

2
General / Re: Fraps slows application way down?
« on: July 05, 2012, 05:10:11 am »
Yes I use one sf::Clock that gets reset at the end of each frame (game loop), before which i record the time it took to finish that frame. I use that time in the next frame to calculate changes. I do use separate timers for somethings though, things such as updating the path finding for ai really only needs to be done every so often.

I'm not going to bother with fixed time steps, especially when it seems like sfml already has that built in with setFrameRateLimit or maybe I miss read how that bit works.

Either way there is no reason to limit the usage of cpu/gpu on a desktop GAME as a whole, if a game wants to eat up gig's of ram, let it. If it wants to swamp an 8ghz cpu, let it. Aslong as the game runs as intended, there's no reason to purposely bottleneck your game.

Before I get pounded for that, realize I said DESKTOP GAME, not app, not phone app. I totally understand if it's a phone/tablet/pda app, cause you dont want to drain the battery just playing your game for 5 minutes.

3
General / Re: Fraps slows application way down?
« on: July 05, 2012, 02:46:12 am »
god I feel so dumb.... mixed two timers together. Was using a timer I set up just to test an idea for one piece of code and the frame timer for the rest... Was sampling the first time almost immediately so it wasn't taking into account the delay (sleep()) that sfml was calling.

Still there should be nothing breaking in letting a game run as fast as it can.... even if I get 3K frames that is still within the limits of a 32 bit signed float representing seconds.

4
General / Fraps slows application way down?
« on: July 04, 2012, 11:50:32 pm »
I use the free version of fraps to do my video recording of projects but ever since I switched to sfml, I haven't been able to use it cause it messes with sfml::clock somehow.

This slowdown is only noticed when I'm actually recording, keeping fraps in the background as a fps counter doesnt effect anything.

Not recording my framtimes average 0.0003 seconds.
with recording my frametimes average 0.003 seconds.

That's a 10% jump all of a sudden and is enough to bring my game to a snails pace on anything that updates based on frame time. Which all my movements are.

no one else seems to have brought this up, or im just that bad at using search and google. Id post my code but it's quite alot. but here are basic specs im using

sfml 2.0
compiled in release mode (dur, I know but everyone always asks)
dynamic libraries
windows 7
radeon 5850 (11.12 catalyst try'd the newest 12.4 and still the same effect)
no vsync

Pages: [1]
anything