FIX: Increased save time

This commit is contained in:
2026-03-20 19:57:00 +03:00
parent e0dac8a95c
commit a317bf66af
4 changed files with 59 additions and 48 deletions

View File

@@ -5,7 +5,7 @@
#include <SDL/SDL.h>
#endif
#ifdef PLATFORM_GLFW
#ifdef PLATFORM_DESKTOP
#include <GLFW/glfw3.h>
#endif
@@ -34,7 +34,7 @@ void MouseHandler::grab() {
SDL_ShowCursor(0);
#endif
#ifdef PLATFORM_GLFW
#ifdef PLATFORM_DESKTOP
glfwSetInputMode(glfwGetCurrentContext(), GLFW_CURSOR, GLFW_CURSOR_DISABLED);
#endif
}
@@ -46,7 +46,7 @@ void MouseHandler::release() {
SDL_ShowCursor(1);
#endif
#ifdef PLATFORM_GLFW
#ifdef PLATFORM_DESKTOP
glfwSetInputMode(glfwGetCurrentContext(), GLFW_CURSOR, GLFW_CURSOR_NORMAL);
#endif
}

View File

@@ -22,12 +22,12 @@
#include "NinecraftApp.h"
#define MAIN_CLASS NinecraftApp
#ifdef PLATFORM_WINDOWS
#include "main_win32.h"
#endif
// #ifdef PLATFORM_WINDOWS
// #include "main_win32.h"
// #endif
#ifdef PLATFORM_GLFW
#ifdef PLATFORM_DESKTOP
#include "main_glfw.h"
#endif

View File

@@ -7,6 +7,7 @@
#include "../chunk/LevelChunk.h"
#include "../Level.h"
#include "../LevelConstants.h"
#include "platform/log.h"
#include "../tile/TreeTile.h"
#include "../../entity/EntityFactory.h"
#include "../../../nbt/NbtIo.h"
@@ -289,8 +290,9 @@ bool ExternalFileLevelStorage::readPlayerData(const std::string& filename, Level
void ExternalFileLevelStorage::tick()
{
tickCount++;
if ((tickCount % 50) == 0 && level)
{
if ((tickCount % 1000) == 0 && level) {
LOGI("Saving level...\n");
// look for chunks that needs to be saved
for (int z = 0; z < CHUNK_CACHE_WIDTH; z++)
{