1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-26 14:38:30 +02:00
VVVVVV/desktop_version/src
Misa 5e94239967 Optimize 30-mode FPS loop to use SDL_Delay()
This patch optimizes the loop used to limit the framerate in 30-FPS-only
mode so that it uses SDL_Delay() instead of an accumulator. This means
that the game will take up less CPU power in 30-FPS-only mode. This also
means that the game loop code has been simplified, so there's only two
while-loops, and only two places where game.over30mode is checked, thus
leading to easier-to-understand logic.

Using an accumulator here would essentially mean busywaiting until the
34 millisecond timer was up. (The following is just what leo60228 told
me.) Busywaiting is bad because it's inefficient. The operating system
assumes that if you're busywaiting, you're performing a complex
calculation and handles your process accordingly. And this is why
sleeping was invented, so you could busywait without taking up
unnecessary CPU time.
2020-07-14 00:44:42 -04:00
..
BinaryBlob.cpp Ensure that all member attributes are initialized 2020-07-08 19:14:21 -04:00
BinaryBlob.h Add binaryBlob::getExtra() 2020-06-30 21:07:05 -04:00
BlockV.cpp Remove unnecessary string initializations from constructors 2020-07-08 19:14:21 -04:00
BlockV.h Remove blockclass::clear(), simplify blockclass initializations 2020-04-03 23:28:47 -04:00
Credits.h Turn (super)patrons/githubfriends into arrays & move them to new file 2020-07-06 11:19:24 -04:00
editor.cpp Remove unnecessary string initializations from constructors 2020-07-08 19:14:21 -04:00
editor.h Turn ed.contents/vmult into arrays 2020-07-06 11:19:24 -04:00
Ent.cpp Fix red pill/mannequins/transmittor/radar dish being offset for 1 frame 2020-06-19 09:05:48 -04:00
Ent.h Fix, for in-GAMEMODE sprites, their colors updating too fast 2020-06-19 09:05:48 -04:00
Entity.cpp Ensure that all member attributes are initialized 2020-07-08 19:14:21 -04:00
Entity.h Turn obj.collect and obj.customcollect into plain arrays 2020-07-06 11:19:24 -04:00
Enums.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
FileSystemUtils.cpp Initialize saveDir and levelDir in FileSystemUtils.cpp 2020-07-08 19:14:21 -04:00
FileSystemUtils.h Only re-color one-ways if assets are not mounted 2020-06-30 18:06:14 -04:00
Finalclass.cpp Remove useless attribute rcol from finalclass 2020-07-08 19:14:21 -04:00
Finalclass.h Remove useless attribute rcol from finalclass 2020-07-08 19:14:21 -04:00
Game.cpp Fall back to default settings when screenbuffer is not present 2020-07-13 16:09:48 -04:00
Game.h Fix -playmusic command line option not working 2020-07-11 15:03:37 -04:00
GOGNetwork.c Add support for multiple Network backends, stub in GOGNetwork 2020-01-13 11:15:22 -05:00
Graphics.cpp Remove unnecessary stub destructors 2020-07-08 19:14:21 -04:00
Graphics.h Remove unnecessary stub destructors 2020-07-08 19:14:21 -04:00
GraphicsResources.cpp Ensure that all member attributes are initialized 2020-07-08 19:14:21 -04:00
GraphicsResources.h Remove unused vars from Graphics/GraphicsResources 2020-07-06 11:19:24 -04:00
GraphicsUtil.cpp Add BlitSurfaceTinted() 2020-06-29 19:07:45 -04:00
GraphicsUtil.h Add BlitSurfaceTinted() 2020-06-29 19:07:45 -04:00
Input.cpp Fix being able to circumvent not-in-Flip-Mode detection 2020-07-10 21:35:47 -04:00
Input.h Remove global args from Input.cpp 2020-04-03 10:40:50 -04:00
KeyPoll.cpp Ensure that all member attributes are initialized 2020-07-08 19:14:21 -04:00
KeyPoll.h Remove unused vars relating to esc/keybuffer from KeyPoll 2020-07-08 19:14:21 -04:00
Labclass.cpp Remove unused coin attributes from finalclass and warpclass 2020-07-08 19:14:21 -04:00
Labclass.h Remove unused coin attributes from finalclass and warpclass 2020-07-08 19:14:21 -04:00
Logic.cpp Turn (super)patrons/githubfriends into arrays & move them to new file 2020-07-06 11:19:24 -04:00
Logic.h Fix delta rendering glitch when going to options from new Esc menu 2020-06-23 15:23:57 -04:00
main.cpp Optimize 30-mode FPS loop to use SDL_Delay() 2020-07-14 00:44:42 -04:00
MakeAndPlay.h Re-comment out #define MAKEANDPLAY 2020-02-09 10:42:03 -05:00
Map.cpp Ensure that all member attributes are initialized 2020-07-08 19:14:21 -04:00
Map.h Move Roomtext struct to Map.h 2020-07-08 19:14:21 -04:00
Maths.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
Music.cpp Ensure that all member attributes are initialized 2020-07-08 19:14:21 -04:00
Music.h Account for extra tracks in musicclass::play() 2020-06-30 21:07:05 -04:00
Network.c Allow for conditional building of Steam and GOG APIs 2020-06-01 14:21:06 -04:00
Network.h Add support for multiple Network backends, stub in GOGNetwork 2020-01-13 11:15:22 -05:00
Otherlevel.cpp Remove roomtext from otherlevelclass 2020-07-08 19:14:21 -04:00
Otherlevel.h Remove unused <vector> include from Otherlevel.h 2020-07-08 19:14:21 -04:00
preloader.cpp Move preloader update code to new function preloaderlogic() 2020-06-19 09:05:48 -04:00
preloader.h Move preloader update code to new function preloaderlogic() 2020-06-19 09:05:48 -04:00
Render.cpp Haiku: Keep the option visible, but note the bug 2020-07-08 14:43:04 -04:00
Render.h Merge towerrender() into gamerender() 2020-04-26 19:07:40 -04:00
Screen.cpp Set both filter and vsync hints with override priority 2020-07-08 21:43:05 -04:00
Screen.h Refactor startup to load config before calling Screen::init 2020-07-08 14:30:57 -04:00
Script.cpp Don't remove non-player entities in scriptclass::hardreset() 2020-07-11 15:29:33 -04:00
Script.h Make std::string-using script funcs pass around const references 2020-07-06 11:19:24 -04:00
Scripts.cpp Fix Vitellary looking left for one frame in "Now Stay Close To Me..." 2020-07-08 07:18:04 -04:00
SoundSystem.cpp Remove extraneous semicolon from MusicTrack::MusicTrack() 2020-06-30 21:07:05 -04:00
SoundSystem.h Revert "Add destructor for SoundTrack/MusicTrack (and explicitly define move constructor to prevent double-free)" 2020-06-07 22:40:03 -04:00
Spacestation2.cpp Fix 'Prize for the Reckless' spikes when switching game modes 2020-07-06 22:04:04 -04:00
Spacestation2.h Turn map.contents into a plain array 2020-07-06 11:19:24 -04:00
SteamNetwork.c Fix build on DragonFlyBSD 2020-04-23 23:35:33 -04:00
TerminalScripts.cpp Make scriptclass::load(other) rely less on std::string 2020-07-06 11:19:24 -04:00
Textbox.cpp Ensure that all member attributes are initialized 2020-07-08 19:14:21 -04:00
Textbox.h Fix special text box images sometimes flashing 2020-06-19 09:05:48 -04:00
Tower.cpp Turn tower vectors into plain arrays 2020-07-06 11:19:24 -04:00
Tower.h Turn tower vectors into plain arrays 2020-07-06 11:19:24 -04:00
UtilityClass.cpp Statically allocate strings in UtilityClass::number() 2020-07-06 11:19:24 -04:00
UtilityClass.h Turn splitseconds into an array 2020-07-06 11:19:24 -04:00
WarpClass.cpp Remove unused coin attributes from finalclass and warpclass 2020-07-08 19:14:21 -04:00
WarpClass.h Remove unused coin attributes from finalclass and warpclass 2020-07-08 19:14:21 -04:00