mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-03 05:49:04 +03:00
* WIP Android Port Android port. Still needs touch controls and mouse turning (if that's even possible on android) and file saving and SoundSystemSL You control the camera and movement with your controller for now. You can navigate the gui using touch. Options.cpp,LocalPlayer.cpp,Minecraft.cpp is configured to use controller. Blocked out some code in ControllerTurnInput.cpp,Controller.cpp that didn't make sense. * Fix glClear glClear is supossed to use GL_DEPTH_BUFFER_BIT (thx TheBrokenRail) * * Fix build. * * Ignore assets. * * More stuff * * Fix more build errors. * * It finally built What I needed to do is rebuild the debug keystore because apparently android studio created it with sha1 digest alg which isn't supported by ant * * Clean up filters. * * Add cramped mode to the pause screen. * * Fix a bug with the hotbar * * In NinecraftApp::handleBack, pause the game if there is no screen. * * AppPlatform_android: Add placeholder SoundSystem instance till we get SoundSystemSL working * * Add properly working touch code. * * Oh, remove some testing things * * Fix state resetting when going in background and back in foreground * Fix bug where the sky isn't being regenerated on graphics reset * Fix bug where the m_currBoundTex isn't reset in Textures::clear potentially leaving a texture with that ID unassigned and corrupted * Fix bug in CThread where the thread is detached and then also joined. * Don't log anything if the program isn't in debug mode. * * Add virtual keyboard support. The screen instance slides so that the focused text box is kept visible. * Rename from com.minecraftcpp to com.reminecraftpe --------- Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com>
70 lines
1.4 KiB
C++
70 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
enum eLogLevel
|
|
{
|
|
LOG_INFO,
|
|
LOG_WARN,
|
|
LOG_ERR,
|
|
};
|
|
|
|
class Logger
|
|
{
|
|
private:
|
|
static Logger* m_singleton;
|
|
public:
|
|
static Logger* const singleton();
|
|
|
|
Logger();
|
|
virtual ~Logger();
|
|
|
|
const char* GetTag(eLogLevel ll);
|
|
virtual void print(eLogLevel, const char* const str);
|
|
virtual void print(eLogLevel, std::string str);
|
|
virtual void vprintf(eLogLevel, const char* const fmt, va_list argPtr);
|
|
virtual void printf(eLogLevel, const char* const fmt, ...);
|
|
};
|
|
|
|
// TODO: For now
|
|
#ifdef __ANDROID__
|
|
#ifndef NDEBUG
|
|
#define _DEBUG
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef _DEBUG
|
|
|
|
#define LOG(level, ...) Logger::singleton()->printf(level, __VA_ARGS__)
|
|
|
|
#ifdef __ANDROID__
|
|
|
|
#undef LOG
|
|
#define LOG_INFO ANDROID_LOG_INFO
|
|
#define LOG_ERR ANDROID_LOG_ERROR
|
|
#define LOG_WARN ANDROID_LOG_WARN
|
|
|
|
#include <android/log.h>
|
|
// TODO: Add a LoggerAndroid
|
|
#define LOG(level, ...) __android_log_print(level, "ReMinecraftPE", __VA_ARGS__)
|
|
#define LOG_I(...) __android_log_print(ANDROID_LOG_INFO, "ReMinecraftPE", __VA_ARGS__)
|
|
#define LOG_W(...) __android_log_print(ANDROID_LOG_WARN, "ReMinecraftPE", __VA_ARGS__)
|
|
#define LOG_E(...) __android_log_print(ANDROID_LOG_ERROR, "ReMinecraftPE", __VA_ARGS__)
|
|
|
|
#else
|
|
|
|
#define LOG_I(...) LOG(LOG_INFO, __VA_ARGS__)
|
|
#define LOG_W(...) LOG(LOG_WARN, __VA_ARGS__)
|
|
#define LOG_E(...) LOG(LOG_ERR, __VA_ARGS__)
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#define LOG(...)
|
|
#define LOG_I(...)
|
|
#define LOG_W(...)
|
|
#define LOG_E(...)
|
|
|
|
#endif
|