Commit Graph

11 Commits

Author SHA1 Message Date
Jonas Kulla 8dd6b63fc4 EventThread: Mouse button IDs greater than 'SDL_BUTTON_X2' are possible 2013-10-29 08:54:57 +01:00
Jonas Kulla 58bd60a70f Graphics: Attempt to provide more consistent frame timings
We now actively track how far behind / in front of an
ideal timestep we are during each frame, and try to
catch up / delay approximate this timing.

Therefore we use more precise timers and sleep functions
(nanosleep if available). We also delay **before** the
final buffer swap so the frame displays at more consistent
points in time.

Not only should this provide a somewhat more consistent
looking map scrolling at lower frame rates, it also
guarantees that we don't fall out of sync eg. with the
Audio during longer cutscenes.

'Graphics.frameReset()' now finally has a function, in
that it resets the ideal timestep approximation, which I
beliefe was also its job in the original RMXP engine.

I'm not sure how well this will work when the frame rate
is set to the monitor refresh rate and vsync is turned on.
Very likely unnecessary frame skips will occur here and there
due to imprecise timers. In the future we should probably
check if the frame rate is equal to or higher than the
monitor rate, and disable frame skip accordingly.

These changes currently break the F2 FPS display (it shows
a value that's slightly too high).
2013-10-22 17:05:46 +02:00
Jonas Kulla 39436ad231 Fix up SDL2 include paths
Using "SDL2/SDL_xxx.h" instead of "SDL_xxx.h" caused
the include paths provided by pkg-config to be ignored,
and headers from a standard include path to be used instead.
2013-10-13 23:21:34 +02:00
Jonas Kulla 89238aebe9 s/rgss/RGSS 2013-10-06 07:11:03 +02:00
Jonas Kulla 26843f2e51 Implement FPS display (F2 to toggle ON/OFF) 2013-10-06 07:05:01 +02:00
Jonas Kulla fe557bca1d Implement "show_cursor" attribute in Graphics module
If false (the default), the system cursor is hidden
inside the game window.
2013-09-24 22:56:25 +02:00
Jonas Kulla f00136c489 Implement fixed aspect ratio 2013-09-23 10:39:16 +02:00
Jonas Kulla a75dea3ffe Rename 'resetInput' to 'resetInputStates' 2013-09-04 13:28:05 +02:00
Jonas Kulla d0fa2dd37a Document 'WindowSizeNotify' 2013-09-04 12:09:09 +02:00
Jonas Kulla 5b6d4e0026 Clean up remainind references to 'render thread' 2013-09-04 12:07:59 +02:00
Jonas Kulla ff25887f41 Initial commit 2013-09-01 16:27:21 +02:00