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 - FRex

Pages: 1 ... 122 123 [124]
1846
General / Re: My scrolling appears quite jerky..
« on: August 05, 2012, 03:44:19 pm »
That's true but he's doing a float around 13,(3) movement each frame so that 'tearing' might be from this.
That vector complain reminded me: maybe if you have A LOT of tiles (like - enough to fill screen several times) then instead of iterating through all of them you can get the points of your view rectangle and only display what fits between them by dividing top bottom left and right by tilesize(if it's constant) and then using these to iterate part of the vector.

1847
General / Re: My scrolling appears quite jerky..
« on: August 05, 2012, 03:16:03 pm »
1.Why are you doing sf::Keyboard::isKeyPressed with every single event you process? It should be changed to checking if there was event of key press AND the key pressed was escape or put outside the event loop.

2. 1280x640 doesn't seem like valid full screen resolution(it isn't for me, I checked), you must run isValid() on your VideoMode or use one of resolutions returned by sf::VideoMode::getFullscreenModes() to make sure that you're using valid fullscreen resolution, because fullscreen doesn't work with all resolutions like window does. I think that might be it, but you must check with your rig to see if that resolution is valid for you.

3. In 1.6 windows used to hold references to views and if it went out of scope then interesting things happened and it was (at least for me) unituitive because view doesn't seem like something heavy to copy/store/create.

4. You must do .setSmooth(true) on texture your sprites use or it'll look ugly after any float rotation/movemenet/scaling, in 2.0 it isn't true by default like in 1.6.

1848
General / Re: Anyone know about this code example?
« on: August 03, 2012, 06:39:08 pm »
Could it be this(it's other loop but still list and hard to find tutorial)?
40 MainMenu::MenuResult MainMenu::HandleClick(int x, int y)
41 {
42   std::list<MenuItem>::iterator it;
43
44   for ( it = _menuItems.begin(); it != _menuItems.end(); it++)
45   {
46     sf::Rect<int> menuItemRect = (*it).rect;
47     if( menuItemRect.Bottom > y
48       && menuItemRect.Top < y
49       && menuItemRect.Left < x
50       && menuItemRect.Right > x)
51       {
52         return (*it).action;
53       }
54   }
55
56   return Nothing;
57 }
That's from game from scratch c++ edition part 3 : http://www.gamefromscratch.com/page/Game-From-Scratch-CPP-Edition-Part-3.aspx

Pages: 1 ... 122 123 [124]
anything