Skip to content

Commit

Permalink
vsync rollback
Browse files Browse the repository at this point in the history
  • Loading branch information
mehah committed Nov 25, 2023
1 parent bcf163a commit 8ae69c2
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
8 changes: 0 additions & 8 deletions src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,6 @@ void Game::processGameStart()
m_online = true;
g_app.resetTargetFps();

g_window.setVerticalSync(g_window.vsyncEnabled());

// synchronize fight modes with the server
m_protocolGame->sendChangeFightModes(m_fightMode, m_chaseMode, m_safeFight, m_pvpMode);

Expand Down Expand Up @@ -196,12 +194,6 @@ void Game::processGameEnd()
// FPS fixed at 60 for when UI is rendering alone.
g_app.setTargetFps(60u);

g_dispatcher.addEvent([vsyncEnabled = g_window.vsyncEnabled()] {
g_window.setVerticalSync(vsyncEnabled);
});

g_window.setVerticalSync(false);

m_online = false;
g_lua.callGlobalField("g_game", "onGameEnd");

Expand Down
1 change: 0 additions & 1 deletion src/framework/core/graphicalapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ void GraphicalApplication::repaintMap() { g_drawPool.get(DrawPoolType::MAP)->rep
void GraphicalApplication::repaint() { g_drawPool.get(DrawPoolType::FOREGROUND)->repaint(); }
bool GraphicalApplication::canDrawTexts() const { return m_drawText && (!g_map.getStaticTexts().empty() || !g_map.getAnimatedTexts().empty()); }

bool GraphicalApplication::isOnline() const { return g_game.isOnline(); }
bool GraphicalApplication::isLoadingAsyncTexture() { return m_loadingAsyncTexture || g_game.isUsingProtobuf(); }

void GraphicalApplication::setLoadingAsyncTexture(bool v) {
Expand Down
1 change: 0 additions & 1 deletion src/framework/core/graphicalapplication.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class GraphicalApplication : public Application

void resetTargetFps() { m_frameCounter.resetTargetFps(); }

bool isOnline() const;
bool isOnInputEvent() { return m_onInputEvent; }
bool mustOptimize() {
#ifdef NDEBUG
Expand Down
3 changes: 0 additions & 3 deletions src/framework/platform/win32window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -939,9 +939,6 @@ void WIN32Window::setVerticalSync(bool enable)
{
m_vsync = enable;

if (!g_app.isOnline())
return;

g_mainDispatcher.addEvent([this, enable] {
#ifdef OPENGL_ES
eglSwapInterval(m_eglDisplay, enable);
Expand Down

0 comments on commit 8ae69c2

Please sign in to comment.