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:
parent
a7704f9fa0
commit
298d02c6f9
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user