1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Change the fullscreen mode with JS too

But the fullscreen provided by the browser is not handled by the game.
It must be forwarded in the native code in order to switch properly the
fullscreen boolean.
This commit is contained in:
Mathieu Schroeter 2018-07-21 17:32:54 +02:00
parent a7704f9fa0
commit 298d02c6f9
2 changed files with 9 additions and 5 deletions

View File

@ -1030,9 +1030,9 @@ DoInit (int argc, char * argv[], bool & exit)
g_pPixmap->ChangeSprite (SPRITE_WAIT);
// g_updateThread = new std::thread (CheckForUpdates);
// if (zoom != g_zoom)
// g_pEvent->SetWindowSize (g_zoom);
// g_pEvent->SetFullScreen (g_bFullScreen);
if (zoom != g_zoom)
g_pEvent->SetWindowSize (g_zoom);
g_pEvent->SetFullScreen (g_bFullScreen);
g_pEvent->ChangePhase (EV_PHASE_INTRO1);
g_bTermInit = true;

View File

@ -37,6 +37,7 @@
#include "misc.h"
#include "movie.h"
#include "pixmap.h"
#include "platform.h"
#include "progress.h"
#include "sound.h"
#include "text.h"
@ -1723,12 +1724,15 @@ CEvent::GetMousePos ()
void
CEvent::SetFullScreen (bool bFullScreen, double prevScale)
{
g_bFullScreen = bFullScreen;
if (Platform::getType () == Platform::Type::JS)
return;
int x, y;
SDL_GetMouseState (&x, &y);
this->m_pPixmap->FromDisplayToGame (x, y, prevScale);
g_bFullScreen = bFullScreen;
int displayIndex = SDL_GetWindowDisplayIndex (g_window);
#ifdef _WIN32
if (g_zoom == 2)