1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-16 09:38:29 +02:00

Remove passing around pointer to gameScreen from KeyPoll::Poll()

Makes for cleaner code this way.
This commit is contained in:
Misa 2020-06-13 11:44:22 -07:00 committed by Ethan Lee
parent 30bcc08bec
commit 51d852601d
3 changed files with 6 additions and 6 deletions

View File

@ -68,7 +68,7 @@ void KeyPoll::disabletextentry()
SDL_StopTextInput();
}
void KeyPoll::Poll(Screen *screen)
void KeyPoll::Poll()
{
SDL_Event evt;
while (SDL_PollEvent(&evt))
@ -248,7 +248,7 @@ void KeyPoll::Poll(Screen *screen)
{
if (wasFullscreen)
{
screen->isWindowed = false;
gameScreen.isWindowed = false;
SDL_SetWindowFullscreen(
SDL_GetWindowFromID(evt.window.windowID),
SDL_WINDOW_FULLSCREEN_DESKTOP
@ -262,8 +262,8 @@ void KeyPoll::Poll(Screen *screen)
isActive = false;
if (!useFullscreenSpaces)
{
wasFullscreen = !screen->isWindowed;
screen->isWindowed = true;
wasFullscreen = !gameScreen.isWindowed;
gameScreen.isWindowed = true;
SDL_SetWindowFullscreen(
SDL_GetWindowFromID(evt.window.windowID),
0

View File

@ -54,7 +54,7 @@ public:
void disabletextentry();
void Poll(Screen *screen);
void Poll();
bool isDown(SDL_Keycode key);

View File

@ -339,7 +339,7 @@ int main(int argc, char *argv[])
key.Poll(&gameScreen);
key.Poll();
if(key.toggleFullscreen)
{
if(!gameScreen.isWindowed)