1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-25 22:18:30 +02:00
VVVVVV/desktop_version/src
Misa 03a0b1feb2 Call VVV_exit() when SDL_QUIT is received
This fixes a regression introduced by #535 where a quit signal (e.g.
Ctrl-C) sent to the window while the game was in unfocus pause wouldn't
close the game.

One problem was that key.quitProgram would only be checked when control
flow switched back to the outer loop in main(), which would only happen
when the loop order state machine switched to a delta function. As the
unfocused func table didn't have any delta functions, this means
key.quitProgram would never be checked.

So a naïve solution to this would just be to add a no-op delta func
entry to the unfocused func table. However, we then run into a separate
issue where a delta function at the end of a func list never reassigns
the active funcs, causing the game to be stuck in the unfocus pause
forever. Active func reassignment only happens after fixed funcs. So
then a naïve solution after that would be to simply add a no-op fixed
func entry after that. And indeed, that would fix the whole issue.

However, I want to do things the right way. And this does not seem like
the right way. Even putting aside the separate last-func-being-delta
issue, it mandates that every func list needs a delta function. Which
seems quite unnecessary to me.

Another solution I considered was copy-pasting the key.quitProgram check
to the inner loops, or adding some sort of signal propagation to
the inner loops - implemented by copy-pasting checks after each loop -
so we didn't need to copy-paste key.quitProgram... but that seems really
messy, too.

So, I realized that we could throw away key.quitProgram, and simply call
VVV_exit() directly when we receive an SDL_QUIT event. This fixes the
issue, this removes an unnecessary middleman variable, and it's pretty
cleanly and simply the right thing to do.
2021-04-02 11:14:24 -04:00
..
BinaryBlob.cpp Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
BinaryBlob.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
BlockV.cpp Remove unused x and y attributes of blockclass 2021-02-27 18:27:28 -05:00
BlockV.h Remove unused x and y attributes of blockclass 2021-02-27 18:27:28 -05:00
Credits.h Put Misa at the top of GitHub Friends 2021-03-31 02:43:15 -04:00
DeferCallbacks.c Add deferred callbacks to game loop 2021-03-21 02:55:42 -04:00
DeferCallbacks.h Add deferred callbacks to game loop 2021-03-21 02:55:42 -04:00
editor.cpp VS2010 buildfix 2021-03-30 11:51:42 -04:00
editor.h Refactor room properties to use setter and getter funcs 2021-03-24 15:55:34 -04:00
Ent.cpp Split onground/onroof into visual and logical variables 2021-03-21 02:55:42 -04:00
Ent.h Split onground/onroof into visual and logical variables 2021-03-21 02:55:42 -04:00
Entity.cpp Fix tile of disappearing platforms during final stretch 2021-03-30 23:55:34 -07:00
Entity.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Enums.h Hello WWWWWWorld! 2020-01-08 10:37:50 -05:00
Exit.h Add VVV_exit() 2021-02-15 23:07:35 -05:00
FileSystemUtils.cpp Replace other usage of PHYSFS_getBaseDir() with SDL_GetBasePath() 2021-03-31 02:51:52 -04:00
FileSystemUtils.h Make one-way recolors check for specific files 2021-03-06 16:00:57 -05:00
Finalclass.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
Finalclass.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
Game.cpp Set fademode to temp 0 when going to in-game options 2021-03-25 23:32:39 -04:00
Game.h Remove mainmenu from Game 2021-03-25 23:32:39 -04:00
GOGNetwork.c Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Graphics.cpp Add Graphics::bigrprint() 2021-03-30 23:57:00 -07:00
Graphics.h Add Graphics::bigrprint() 2021-03-30 23:57:00 -07:00
GraphicsResources.cpp Free data upon failure in LoadImage() 2021-01-18 13:06:43 -05:00
GraphicsResources.h Consistently use angle brackets for SDL.h includes 2020-07-19 21:37:40 -04:00
GraphicsUtil.cpp Use SDL_floor() instead of libc floor() 2021-03-06 16:01:29 -05:00
GraphicsUtil.h Add ClearSurface() 2021-02-25 19:38:25 -05:00
Input.cpp Fix background not changing when pressing Esc on main menu 2021-03-25 23:32:59 -04:00
Input.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
KeyPoll.cpp Call VVV_exit() when SDL_QUIT is received 2021-04-02 11:14:24 -04:00
KeyPoll.h Call VVV_exit() when SDL_QUIT is received 2021-04-02 11:14:24 -04:00
Labclass.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
Labclass.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
Logic.cpp Fix tile of disappearing platforms during final stretch 2021-03-30 23:55:34 -07:00
Logic.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
main.cpp Call VVV_exit() when SDL_QUIT is received 2021-04-02 11:14:24 -04:00
MakeAndPlay.h Re-comment out #define MAKEANDPLAY 2020-02-09 10:42:03 -05:00
Map.cpp Add bounds checks to room explored getter and setter 2021-03-24 15:55:34 -04:00
Map.h Refactor explored rooms to use setters and getters 2021-03-24 15:55:34 -04:00
Maths.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Music.cpp Move resumesong assignment to songend() 2021-03-10 09:45:20 -05:00
Music.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Network.c Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Network.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Otherlevel.cpp Bounds check all entity getters that can return 0 2020-09-25 13:51:47 -04:00
Otherlevel.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
preloader.cpp Change all surface-clearing FillRect()s to use ClearSurface() 2021-02-25 19:38:25 -05:00
preloader.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Render.cpp Outline all gravitron text 2021-03-30 23:57:00 -07:00
Render.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
RenderFixed.cpp Remove game.gametimer in favor of game.frames 2021-03-21 20:53:11 -04:00
RenderFixed.h Remove now-unneeded deltaframe fix when going to in-game settings 2021-03-21 02:55:42 -04:00
Screen.cpp Skip the icon on Apple targets, it also has the icns 2021-03-31 02:50:38 -04:00
Screen.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
ScreenSettings.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Script.cpp Refactor explored rooms to use setters and getters 2021-03-24 15:55:34 -04:00
Script.h Remove script.dontrunnextframe kludge 2021-03-21 02:55:42 -04:00
Scripts.cpp Make 'custom_' check more readable 2020-09-27 16:31:40 -04:00
SoundSystem.cpp Visual Studio buildfix 2021-03-21 17:15:36 -04:00
SoundSystem.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Spacestation2.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
Spacestation2.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
SteamNetwork.c Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
TerminalScripts.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
Textbox.cpp Add flipme attribute to textboxclass 2021-03-21 02:53:25 -04:00
Textbox.h Add flipme attribute to textboxclass 2021-03-21 02:53:25 -04:00
ThirdPartyDeps.c Reduce dependency on libc functions 2021-01-12 14:02:31 -05:00
Tower.cpp Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
Tower.h Explicitly declare void for all void parameter functions (#628) 2021-02-25 17:23:59 -05:00
TowerBG.h Move mapclass r/g/b variables off onto TowerBG 2021-01-07 21:15:34 -05:00
UtilityClass.cpp Refactor endsWith() to not use the STL 2021-02-27 01:40:05 -05:00
UtilityClass.h Refactor endsWith() to not use the STL 2021-02-27 01:40:05 -05:00
Version.h Don't recompile all files when the commit hash is changed 2020-12-25 20:17:01 -05:00
Version.h.in Don't recompile all files when the commit hash is changed 2020-12-25 20:17:01 -05:00
WarpClass.cpp Separate includes into sections and alphabetize them 2020-07-19 21:37:40 -04:00
WarpClass.h Remove unnecessary includes from header files 2020-07-19 21:37:40 -04:00
XMLUtils.cpp Move all settings to settings.vvv 2020-11-04 12:06:57 -05:00
XMLUtils.h Move all settings to settings.vvv 2020-11-04 12:06:57 -05:00