mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Remove passing around pointer to gameScreen from KeyPoll::Poll()
Makes for cleaner code this way.
This commit is contained in:
parent
30bcc08bec
commit
51d852601d
3 changed files with 6 additions and 6 deletions
|
@ -68,7 +68,7 @@ void KeyPoll::disabletextentry()
|
||||||
SDL_StopTextInput();
|
SDL_StopTextInput();
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyPoll::Poll(Screen *screen)
|
void KeyPoll::Poll()
|
||||||
{
|
{
|
||||||
SDL_Event evt;
|
SDL_Event evt;
|
||||||
while (SDL_PollEvent(&evt))
|
while (SDL_PollEvent(&evt))
|
||||||
|
@ -248,7 +248,7 @@ void KeyPoll::Poll(Screen *screen)
|
||||||
{
|
{
|
||||||
if (wasFullscreen)
|
if (wasFullscreen)
|
||||||
{
|
{
|
||||||
screen->isWindowed = false;
|
gameScreen.isWindowed = false;
|
||||||
SDL_SetWindowFullscreen(
|
SDL_SetWindowFullscreen(
|
||||||
SDL_GetWindowFromID(evt.window.windowID),
|
SDL_GetWindowFromID(evt.window.windowID),
|
||||||
SDL_WINDOW_FULLSCREEN_DESKTOP
|
SDL_WINDOW_FULLSCREEN_DESKTOP
|
||||||
|
@ -262,8 +262,8 @@ void KeyPoll::Poll(Screen *screen)
|
||||||
isActive = false;
|
isActive = false;
|
||||||
if (!useFullscreenSpaces)
|
if (!useFullscreenSpaces)
|
||||||
{
|
{
|
||||||
wasFullscreen = !screen->isWindowed;
|
wasFullscreen = !gameScreen.isWindowed;
|
||||||
screen->isWindowed = true;
|
gameScreen.isWindowed = true;
|
||||||
SDL_SetWindowFullscreen(
|
SDL_SetWindowFullscreen(
|
||||||
SDL_GetWindowFromID(evt.window.windowID),
|
SDL_GetWindowFromID(evt.window.windowID),
|
||||||
0
|
0
|
||||||
|
|
|
@ -54,7 +54,7 @@ public:
|
||||||
|
|
||||||
void disabletextentry();
|
void disabletextentry();
|
||||||
|
|
||||||
void Poll(Screen *screen);
|
void Poll();
|
||||||
|
|
||||||
bool isDown(SDL_Keycode key);
|
bool isDown(SDL_Keycode key);
|
||||||
|
|
||||||
|
|
|
@ -339,7 +339,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
key.Poll(&gameScreen);
|
key.Poll();
|
||||||
if(key.toggleFullscreen)
|
if(key.toggleFullscreen)
|
||||||
{
|
{
|
||||||
if(!gameScreen.isWindowed)
|
if(!gameScreen.isWindowed)
|
||||||
|
|
Loading…
Reference in a new issue