* Start work on ExternalFileLevelStorage

This commit is contained in:
iProgramInCpp
2023-08-02 09:07:20 +03:00
parent 858315ce54
commit 865d688212
9 changed files with 378 additions and 1 deletions

View File

@@ -11,17 +11,40 @@
#include "Utils.hpp"
#ifdef _WIN32
#include <Windows.h>
#include <io.h>
#include <direct.h>
// XPL means "Cross PLatform"
#define XPL_ACCESS _access
#define XPL_MKDIR(path, mode) _mkdir(path)
// Why are we not using GetTickCount64()? It's simple -- getTimeMs has the exact same problem as using regular old GetTickCount.
#pragma warning(disable : 28159)
#else
#include <sys/time.h>
#include <unistd.h>
#include <sys/stat.h>
#define XPL_ACCESS access
#define XPL_MKDIR(path, mode) mkdir(path, mode)
#endif
#include "compat/GL.hpp"
int g_TimeSecondsOnInit = 0;
bool createFolderIfNotExists(const char* pDir)
{
if (!XPL_ACCESS(pDir, 0))
return true;
return XPL_MKDIR(pDir, 0755) == 0;
}
const char* GetTerrainName()
{
return "terrain.png";

View File

@@ -504,6 +504,7 @@ constexpr float Lerp(float a, float b, float progress)
return a + progress * (b - a);
}
bool createFolderIfNotExists(const char* pDir);
// things that we added:
#ifndef ORIGINAL_CODE
@@ -537,3 +538,23 @@ void SetHWND(HWND hwnd);
#define LogMsgNoCR(...)
#endif
#ifdef MC_DEBUG
#ifdef PLATFORM_ANDROID
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO, "MinecraftPE", __VA_ARGS__)
#define LOGW(...) __android_log_print(ANDROID_LOG_WARN, "MinecraftPE", __VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, "MinecraftPE", __VA_ARGS__)
#else
#define LOGI(...) printf("Info: " __VA_ARGS__)
#define LOGW(...) printf("WARN: " __VA_ARGS__)
#define LOGE(...) printf("ERROR: " __VA_ARGS__)
#endif
#else
#define LOGI(...) printf(__VA_ARGS__)
#define LOGW(...) printf(__VA_ARGS__)
#define LOGE(...) printf(__VA_ARGS__)
#endif