WIP Android Port (#79)

* 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>
This commit is contained in:
f
2023-11-03 11:54:39 +01:00
committed by GitHub
parent f119d89048
commit f83ead9f8d
59 changed files with 5742 additions and 424 deletions

8
.gitignore vendored
View File

@@ -441,3 +441,11 @@ Win32/
/game/assetsO
/game/assets/gui/feedback_fill.png
/game/assets/gui/feedback_outer.png
/platforms/android/minecraftcpp/minecraftcpp.Packaging/assets/environment
/platforms/android/minecraftcpp/minecraftcpp.Packaging/assets/font
/platforms/android/minecraftcpp/minecraftcpp.Packaging/assets/gui
/platforms/android/minecraftcpp/minecraftcpp.Packaging/assets/item
/platforms/android/minecraftcpp/minecraftcpp.Packaging/assets/mob/char.png
/platforms/android/minecraftcpp/minecraftcpp.Packaging/assets/patches
*.png
*.txt

View File

@@ -26,304 +26,9 @@ enum eSDLVirtualKeys
#include <Windows.h>
#endif
#ifdef PLATFORM_ANDROID
#ifdef __ANDROID__
#include <android/keycodes.h>
enum
{
//the real deal android key codes
AKEYCODE_UNKNOWN = 0,
AKEYCODE_SOFT_LEFT = 1,
AKEYCODE_SOFT_RIGHT = 2,
AKEYCODE_HOME = 3,
AKEYCODE_BACK = 4,
AKEYCODE_CALL = 5,
AKEYCODE_ENDCALL = 6,
AKEYCODE_0 = 7,
AKEYCODE_1 = 8,
AKEYCODE_2 = 9,
AKEYCODE_3 = 10,
AKEYCODE_4 = 11,
AKEYCODE_5 = 12,
AKEYCODE_6 = 13,
AKEYCODE_7 = 14,
AKEYCODE_8 = 15,
AKEYCODE_9 = 16,
AKEYCODE_STAR = 17,
AKEYCODE_POUND = 18,
AKEYCODE_DPAD_UP = 19,
AKEYCODE_DPAD_DOWN = 20,
AKEYCODE_DPAD_LEFT = 21,
AKEYCODE_DPAD_RIGHT = 22,
AKEYCODE_DPAD_CENTER = 23,
AKEYCODE_VOLUME_UP = 24,
AKEYCODE_VOLUME_DOWN = 25,
AKEYCODE_POWER = 26,
AKEYCODE_CAMERA = 27,
AKEYCODE_CLEAR = 28,
AKEYCODE_A = 29,
AKEYCODE_B = 30,
AKEYCODE_C = 31,
AKEYCODE_D = 32,
AKEYCODE_E = 33,
AKEYCODE_F = 34,
AKEYCODE_G = 35,
AKEYCODE_H = 36,
AKEYCODE_I = 37,
AKEYCODE_J = 38,
AKEYCODE_K = 39,
AKEYCODE_L = 40,
AKEYCODE_M = 41,
AKEYCODE_N = 42,
AKEYCODE_O = 43,
AKEYCODE_P = 44,
AKEYCODE_Q = 45,
AKEYCODE_R = 46,
AKEYCODE_S = 47,
AKEYCODE_T = 48,
AKEYCODE_U = 49,
AKEYCODE_V = 50,
AKEYCODE_W = 51,
AKEYCODE_X = 52,
AKEYCODE_Y = 53,
AKEYCODE_Z = 54,
AKEYCODE_COMMA = 55,
AKEYCODE_PERIOD = 56,
AKEYCODE_ALT_LEFT = 57,
AKEYCODE_ALT_RIGHT = 58,
AKEYCODE_SHIFT_LEFT = 59,
AKEYCODE_SHIFT_RIGHT = 60,
AKEYCODE_TAB = 61,
AKEYCODE_SPACE = 62,
AKEYCODE_SYM = 63,
AKEYCODE_EXPLORER = 64,
AKEYCODE_ENVELOPE = 65,
AKEYCODE_ENTER = 66,
AKEYCODE_DEL = 67,
AKEYCODE_GRAVE = 68,
AKEYCODE_MINUS = 69,
AKEYCODE_EQUALS = 70,
AKEYCODE_LEFT_BRACKET = 71,
AKEYCODE_RIGHT_BRACKET = 72,
AKEYCODE_BACKSLASH = 73,
AKEYCODE_SEMICOLON = 74,
AKEYCODE_APOSTROPHE = 75,
AKEYCODE_SLASH = 76,
AKEYCODE_AT = 77,
AKEYCODE_NUM = 78,
AKEYCODE_HEADSETHOOK = 79,
AKEYCODE_FOCUS = 80,
AKEYCODE_PLUS = 81,
AKEYCODE_MENU = 82,
AKEYCODE_NOTIFICATION = 83,
AKEYCODE_SEARCH = 84,
AKEYCODE_MEDIA_PLAY_PAUSE = 85,
AKEYCODE_MEDIA_STOP = 86,
AKEYCODE_MEDIA_NEXT = 87,
AKEYCODE_MEDIA_PREVIOUS = 88,
AKEYCODE_MEDIA_REWIND = 89,
AKEYCODE_MEDIA_FAST_FORWARD = 90,
AKEYCODE_MUTE = 91,
AKEYCODE_PAGE_UP = 92,
AKEYCODE_PAGE_DOWN = 93,
AKEYCODE_PICTSYMBOLS = 94,
AKEYCODE_SWITCH_CHARSET = 95,
AKEYCODE_BUTTON_A = 96,
AKEYCODE_BUTTON_B = 97,
AKEYCODE_BUTTON_C = 98,
AKEYCODE_BUTTON_X = 99,
AKEYCODE_BUTTON_Y = 100,
AKEYCODE_BUTTON_Z = 101,
AKEYCODE_BUTTON_L1 = 102,
AKEYCODE_BUTTON_R1 = 103,
AKEYCODE_BUTTON_L2 = 104,
AKEYCODE_BUTTON_R2 = 105,
AKEYCODE_BUTTON_THUMBL = 106,
AKEYCODE_BUTTON_THUMBR = 107,
AKEYCODE_BUTTON_START = 108,
AKEYCODE_BUTTON_SELECT = 109,
AKEYCODE_BUTTON_MODE = 110,
AKEYCODE_ESCAPE = 111,
AKEYCODE_FORWARD_DEL = 112,
AKEYCODE_CTRL_LEFT = 113,
AKEYCODE_CTRL_RIGHT = 114,
AKEYCODE_CAPS_LOCK = 115,
AKEYCODE_SCROLL_LOCK = 116,
AKEYCODE_META_LEFT = 117,
AKEYCODE_META_RIGHT = 118,
AKEYCODE_FUNCTION = 119,
AKEYCODE_SYSRQ = 120,
AKEYCODE_BREAK = 121,
AKEYCODE_MOVE_HOME = 122,
AKEYCODE_MOVE_END = 123,
AKEYCODE_INSERT = 124,
AKEYCODE_FORWARD = 125,
AKEYCODE_MEDIA_PLAY = 126,
AKEYCODE_MEDIA_PAUSE = 127,
AKEYCODE_MEDIA_CLOSE = 128,
AKEYCODE_MEDIA_EJECT = 129,
AKEYCODE_MEDIA_RECORD = 130,
AKEYCODE_F1 = 131,
AKEYCODE_F2 = 132,
AKEYCODE_F3 = 133,
AKEYCODE_F4 = 134,
AKEYCODE_F5 = 135,
AKEYCODE_F6 = 136,
AKEYCODE_F7 = 137,
AKEYCODE_F8 = 138,
AKEYCODE_F9 = 139,
AKEYCODE_F10 = 140,
AKEYCODE_F11 = 141,
AKEYCODE_F12 = 142,
AKEYCODE_NUM_LOCK = 143,
AKEYCODE_NUMPAD_0 = 144,
AKEYCODE_NUMPAD_1 = 145,
AKEYCODE_NUMPAD_2 = 146,
AKEYCODE_NUMPAD_3 = 147,
AKEYCODE_NUMPAD_4 = 148,
AKEYCODE_NUMPAD_5 = 149,
AKEYCODE_NUMPAD_6 = 150,
AKEYCODE_NUMPAD_7 = 151,
AKEYCODE_NUMPAD_8 = 152,
AKEYCODE_NUMPAD_9 = 153,
AKEYCODE_NUMPAD_DIVIDE = 154,
AKEYCODE_NUMPAD_MULTIPLY = 155,
AKEYCODE_NUMPAD_SUBTRACT = 156,
AKEYCODE_NUMPAD_ADD = 157,
AKEYCODE_NUMPAD_DOT = 158,
AKEYCODE_NUMPAD_COMMA = 159,
AKEYCODE_NUMPAD_ENTER = 160,
AKEYCODE_NUMPAD_EQUALS = 161,
AKEYCODE_NUMPAD_LEFT_PAREN = 162,
AKEYCODE_NUMPAD_RIGHT_PAREN = 163,
AKEYCODE_VOLUME_MUTE = 164,
AKEYCODE_INFO = 165,
AKEYCODE_CHANNEL_UP = 166,
AKEYCODE_CHANNEL_DOWN = 167,
AKEYCODE_ZOOM_IN = 168,
AKEYCODE_ZOOM_OUT = 169,
AKEYCODE_TV = 170,
AKEYCODE_WINDOW = 171,
AKEYCODE_GUIDE = 172,
AKEYCODE_DVR = 173,
AKEYCODE_BOOKMARK = 174,
AKEYCODE_CAPTIONS = 175,
AKEYCODE_SETTINGS = 176,
AKEYCODE_TV_POWER = 177,
AKEYCODE_TV_INPUT = 178,
AKEYCODE_STB_POWER = 179,
AKEYCODE_STB_INPUT = 180,
AKEYCODE_AVR_POWER = 181,
AKEYCODE_AVR_INPUT = 182,
AKEYCODE_PROG_RED = 183,
AKEYCODE_PROG_GREEN = 184,
AKEYCODE_PROG_YELLOW = 185,
AKEYCODE_PROG_BLUE = 186,
AKEYCODE_APP_SWITCH = 187,
AKEYCODE_BUTTON_1 = 188,
AKEYCODE_BUTTON_2 = 189,
AKEYCODE_BUTTON_3 = 190,
AKEYCODE_BUTTON_4 = 191,
AKEYCODE_BUTTON_5 = 192,
AKEYCODE_BUTTON_6 = 193,
AKEYCODE_BUTTON_7 = 194,
AKEYCODE_BUTTON_8 = 195,
AKEYCODE_BUTTON_9 = 196,
AKEYCODE_BUTTON_10 = 197,
AKEYCODE_BUTTON_11 = 198,
AKEYCODE_BUTTON_12 = 199,
AKEYCODE_BUTTON_13 = 200,
AKEYCODE_BUTTON_14 = 201,
AKEYCODE_BUTTON_15 = 202,
AKEYCODE_BUTTON_16 = 203,
AKEYCODE_LANGUAGE_SWITCH = 204,
AKEYCODE_MANNER_MODE = 205,
AKEYCODE_3D_MODE = 206,
AKEYCODE_CONTACTS = 207,
AKEYCODE_CALENDAR = 208,
AKEYCODE_MUSIC = 209,
AKEYCODE_CALCULATOR = 210,
AKEYCODE_ZENKAKU_HANKAKU = 211,
AKEYCODE_EISU = 212,
AKEYCODE_MUHENKAN = 213,
AKEYCODE_HENKAN = 214,
AKEYCODE_KATAKANA_HIRAGANA = 215,
AKEYCODE_YEN = 216,
AKEYCODE_RO = 217,
AKEYCODE_KANA = 218,
AKEYCODE_ASSIST = 219,
AKEYCODE_BRIGHTNESS_DOWN = 220,
AKEYCODE_BRIGHTNESS_UP = 221,
AKEYCODE_MEDIA_AUDIO_TRACK = 222,
AKEYCODE_SLEEP = 223,
AKEYCODE_WAKEUP = 224,
AKEYCODE_PAIRING = 225,
AKEYCODE_MEDIA_TOP_MENU = 226,
AKEYCODE_11 = 227,
AKEYCODE_12 = 228,
AKEYCODE_LAST_CHANNEL = 229,
AKEYCODE_TV_DATA_SERVICE = 230,
AKEYCODE_VOICE_ASSIST = 231,
AKEYCODE_TV_RADIO_SERVICE = 232,
AKEYCODE_TV_TELETEXT = 233,
AKEYCODE_TV_NUMBER_ENTRY = 234,
AKEYCODE_TV_TERRESTRIAL_ANALOG = 235,
AKEYCODE_TV_TERRESTRIAL_DIGITAL = 236,
AKEYCODE_TV_SATELLITE = 237,
AKEYCODE_TV_SATELLITE_BS = 238,
AKEYCODE_TV_SATELLITE_CS = 239,
AKEYCODE_TV_SATELLITE_SERVICE = 240,
AKEYCODE_TV_NETWORK = 241,
AKEYCODE_TV_ANTENNA_CABLE = 242,
AKEYCODE_TV_INPUT_HDMI_1 = 243,
AKEYCODE_TV_INPUT_HDMI_2 = 244,
AKEYCODE_TV_INPUT_HDMI_3 = 245,
AKEYCODE_TV_INPUT_HDMI_4 = 246,
AKEYCODE_TV_INPUT_COMPOSITE_1 = 247,
AKEYCODE_TV_INPUT_COMPOSITE_2 = 248,
AKEYCODE_TV_INPUT_COMPONENT_1 = 249,
AKEYCODE_TV_INPUT_COMPONENT_2 = 250,
AKEYCODE_TV_INPUT_VGA_1 = 251,
AKEYCODE_TV_AUDIO_DESCRIPTION = 252,
AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_UP = 253,
AKEYCODE_TV_AUDIO_DESCRIPTION_MIX_DOWN = 254,
AKEYCODE_TV_ZOOM_MODE = 255,
AKEYCODE_TV_CONTENTS_MENU = 256,
AKEYCODE_TV_MEDIA_CONTEXT_MENU = 257,
AKEYCODE_TV_TIMER_PROGRAMMING = 258,
AKEYCODE_HELP = 259,
AKEYCODE_NAVIGATE_PREVIOUS = 260,
AKEYCODE_NAVIGATE_NEXT = 261,
AKEYCODE_NAVIGATE_IN = 262,
AKEYCODE_NAVIGATE_OUT = 263,
AKEYCODE_STEM_PRIMARY = 264,
AKEYCODE_STEM_1 = 265,
AKEYCODE_STEM_2 = 266,
AKEYCODE_STEM_3 = 267,
AKEYCODE_DPAD_UP_LEFT = 268,
AKEYCODE_DPAD_DOWN_LEFT = 269,
AKEYCODE_DPAD_UP_RIGHT = 270,
AKEYCODE_DPAD_DOWN_RIGHT = 271,
AKEYCODE_MEDIA_SKIP_FORWARD = 272,
AKEYCODE_MEDIA_SKIP_BACKWARD = 273,
AKEYCODE_MEDIA_STEP_FORWARD = 274,
AKEYCODE_MEDIA_STEP_BACKWARD = 275,
AKEYCODE_SOFT_SLEEP = 276,
AKEYCODE_CUT = 277,
AKEYCODE_COPY = 278,
AKEYCODE_PASTE = 279,
AKEYCODE_SYSTEM_NAVIGATION_UP = 280,
AKEYCODE_SYSTEM_NAVIGATION_DOWN = 281,
AKEYCODE_SYSTEM_NAVIGATION_LEFT = 282,
AKEYCODE_SYSTEM_NAVIGATION_RIGHT = 283,
AKEYCODE_ALL_APPS = 284,
AKEYCODE_REFRESH = 285,
AKEYCODE_THUMBS_UP = 286,
AKEYCODE_THUMBS_DOWN = 287,
AKEYCODE_PROFILE_SWITCH = 288
};
// this sucks
#define AKEYCODE_ARROW_LEFT AKEYCODE_DPAD_LEFT
#define AKEYCODE_ARROW_RIGHT AKEYCODE_DPAD_RIGHT
#endif

View File

@@ -0,0 +1,330 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#define WIN32_LEAN_AND_MEAN
#include <fstream>
#include <sstream>
#include "AppPlatform_android.hpp"
#include "client/player/input/Mouse.hpp"
#include "thirdparty/stb_image.h"
#include "thirdparty/stb_image_write.h"
AppPlatform_android::AppPlatform_android()
{
m_UserInputStatus = -1;
m_bIsFocused = false;
m_bGrabbedMouse = false;
m_bActuallyGrabbedMouse = false;
m_bWasUnfocused = false;
m_bShiftPressed = false;
m_bIsKeyboardShown = false;
m_MouseDiffX = 0, m_MouseDiffY = 0;
m_pSoundSystem = nullptr;
}
AppPlatform_android::~AppPlatform_android()
{
SAFE_DELETE(m_pSoundSystem);
}
void AppPlatform_android::initConsts()
{
// just assume an 854x480 window for now:
m_ScreenWidth = C_DEFAULT_SCREEN_WIDTH;
m_ScreenHeight = C_DEFAULT_SCREEN_HEIGHT;
}
int AppPlatform_android::checkLicense()
{
// we own the game!!
return 1;
}
void AppPlatform_android::buyGame()
{
}
void AppPlatform_android::saveScreenshot(const std::string& fileName, int width, int height)
{
}
int AppPlatform_android::getScreenWidth() const
{
return m_ScreenWidth;
}
int AppPlatform_android::getScreenHeight() const
{
return m_ScreenHeight;
}
std::vector<std::string> AppPlatform_android::getUserInput()
{
return m_UserInput;
}
int AppPlatform_android::getUserInputStatus()
{
return m_UserInputStatus;
}
void AppPlatform_android::createUserInput()
{
m_UserInput.clear();
m_UserInputStatus = -1;
switch (m_DialogType)
{
case DLG_CREATE_WORLD:
{
// some placeholder for now
m_UserInput.push_back("New World");
m_UserInput.push_back("123456");
m_UserInputStatus = 1;
break;
}
}
}
void AppPlatform_android::showDialog(eDialogType type)
{
m_DialogType = type;
}
std::string AppPlatform_android::getDateString(int time)
{
const time_t t = time_t(time);
struct tm tf;
struct tm* tp = gmtime_r(&t, &tf);
char buffer[128];
strftime(buffer, sizeof buffer, "%d/%m/%y %H:%M", tp);
return std::string(buffer);
}
Texture AppPlatform_android::loadTexture(const std::string& str, bool b)
{
std::string realPath = str;
if (realPath.size() && realPath[0] == '/')
// trim it off
realPath = realPath.substr(1);
AAsset* asset = AAssetManager_open(m_app->activity->assetManager, str.c_str(), AASSET_MODE_BUFFER);
if (!asset) {
LOG_E("File %s couldn't be opened", realPath.c_str());
}
size_t cnt = AAsset_getLength(asset);
unsigned char* buffer = (unsigned char*)calloc(cnt, sizeof(unsigned char));
AAsset_read(asset, (void*)buffer, cnt);
AAsset_close(asset);
int width = 0, height = 0, channels = 0;
stbi_uc* img = stbi_load_from_memory(buffer, cnt, &width, &height, &channels, STBI_rgb_alpha);
if (!img)
{
LOG_E("File %s couldn't be loaded via stb_image", realPath.c_str());
}
free(buffer);
return Texture(width, height, (uint32_t*)img, 1, 0);
}
SoundSystem* const AppPlatform_android::getSoundSystem() const
{
return m_pSoundSystem;
}
void AppPlatform_android::initSoundSystem()
{
// TODO: SoundSystemSL!
if (!m_pSoundSystem)
m_pSoundSystem = new SoundSystem();
else
LOG_E("Trying to initialize SoundSystem more than once!");
}
bool AppPlatform_android::isTouchscreen()
{
return true;
}
/*
std::vector<std::string> AppPlatform_android::getOptionStrings()
{
std::vector<std::string> o;
//o.push_back("mp_username");
//o.push_back("iProgramInCpp");
std::ifstream ifs("options.txt");
if (!ifs.is_open())
return o;
std::string str;
while (true)
{
if (!std::getline(ifs, str, '\n'))
break;
if (str.empty() || str[0] == '#')
continue;
std::stringstream ss;
ss << str;
std::string key, value;
if (std::getline(ss, key, '|') && std::getline(ss, value))
{
o.push_back(key);
o.push_back(value);
}
}
return o;
}
void AppPlatform_android::setOptionStrings(const std::vector<std::string>& str)
{
assert(str.size() % 2 == 0);
std::ofstream os("options.txt");
os << "#Config file for Minecraft PE. The # at the start denotes a comment, removing it makes it a command.\n\n";
for (int i = 0; i < int(str.size()); i += 2)
os << str[i] << '|' << str[i + 1] << '\n';
}
*/
void AppPlatform_android::setScreenSize(int width, int height)
{
m_ScreenWidth = width;
m_ScreenHeight = height;
}
void AppPlatform_android::initAndroidApp(android_app* ptr)
{
m_app = ptr;
}
void AppPlatform_android::recenterMouse()
{
}
void AppPlatform_android::setMouseGrabbed(bool b)
{
m_bGrabbedMouse = b;
if (m_bActuallyGrabbedMouse == (b && m_bIsFocused))
return;
}
void AppPlatform_android::getMouseDiff(int& x, int& y)
{
x = m_MouseDiffX;
y = m_MouseDiffY;
}
void AppPlatform_android::clearDiff()
{
m_MouseDiffX = m_MouseDiffY = 0;
}
void AppPlatform_android::updateFocused(bool focused)
{
m_bIsFocused = focused;
setMouseGrabbed(m_bGrabbedMouse);
}
bool AppPlatform_android::shiftPressed()
{
return m_bShiftPressed;
}
void AppPlatform_android::setShiftPressed(bool b)
{
m_bShiftPressed = b;
}
void AppPlatform_android::showKeyboard(bool bShown)
{
JavaVM* pVM = m_app->activity->vm;
JNIEnv* pEnv = m_app->activity->env;
// This is horrible. However, I refuse to introduce J*va into my code.
// Stolen from https://stackoverflow.com/questions/5864790/how-to-show-the-soft-keyboard-on-native-activity
pVM->AttachCurrentThread(&pEnv, NULL);
jint flags = 0;
// Retrieves NativeActivity.
jobject lNativeActivity = m_app->activity->clazz;
jclass ClassNativeActivity = pEnv->GetObjectClass(lNativeActivity);
// Retrieves Context.INPUT_METHOD_SERVICE.
jclass ClassContext = pEnv->FindClass("android/content/Context");
jfieldID FieldINPUT_METHOD_SERVICE = pEnv->GetStaticFieldID(ClassContext, "INPUT_METHOD_SERVICE", "Ljava/lang/String;");
jobject INPUT_METHOD_SERVICE = pEnv->GetStaticObjectField(ClassContext, FieldINPUT_METHOD_SERVICE);
// Runs getSystemService(Context.INPUT_METHOD_SERVICE).
jclass ClassInputMethodManager = pEnv->FindClass("android/view/inputmethod/InputMethodManager");
jmethodID MethodGetSystemService = pEnv->GetMethodID(ClassNativeActivity, "getSystemService","(Ljava/lang/String;)Ljava/lang/Object;");
jobject lInputMethodManager = pEnv->CallObjectMethod(lNativeActivity, MethodGetSystemService,INPUT_METHOD_SERVICE);
// Runs getWindow().getDecorView().
jmethodID MethodGetWindow = pEnv->GetMethodID(ClassNativeActivity, "getWindow","()Landroid/view/Window;");
jobject lWindow = pEnv->CallObjectMethod(lNativeActivity,MethodGetWindow);
jclass ClassWindow = pEnv->FindClass("android/view/Window");
jmethodID MethodGetDecorView = pEnv->GetMethodID(ClassWindow, "getDecorView", "()Landroid/view/View;");
jobject lDecorView = pEnv->CallObjectMethod(lWindow,MethodGetDecorView);
if (bShown)
{
// Runs lInputMethodManager.showSoftInput(...).
jmethodID MethodShowSoftInput = pEnv->GetMethodID(ClassInputMethodManager, "showSoftInput","(Landroid/view/View;I)Z");
jboolean lResult = pEnv->CallBooleanMethod(lInputMethodManager, MethodShowSoftInput,lDecorView, flags);
m_bIsKeyboardShown = lResult;
}
else
{
// Runs lWindow.getViewToken()
jclass ClassView = pEnv->FindClass("android/view/View");
jmethodID MethodGetWindowToken = pEnv->GetMethodID(ClassView, "getWindowToken", "()Landroid/os/IBinder;");
jobject lBinder = pEnv->CallObjectMethod(lDecorView,MethodGetWindowToken);
// lInputMethodManager.hideSoftInput(...).
jmethodID MethodHideSoftInput = pEnv->GetMethodID(ClassInputMethodManager, "hideSoftInputFromWindow","(Landroid/os/IBinder;I)Z");
jboolean lResult = pEnv->CallBooleanMethod(lInputMethodManager, MethodHideSoftInput,lBinder, flags);
m_bIsKeyboardShown = false; // just treat it as hidden anyways why not
}
pVM->DetachCurrentThread();
}
void AppPlatform_android::onHideKeyboard()
{
m_bIsKeyboardShown = false;
}
int AppPlatform_android::getKeyboardUpOffset()
{
// @TODO
// For now we'll just return 1/2 of the screen height. That ought to cover most cases.
return m_ScreenHeight / 2;
}

View File

@@ -0,0 +1,85 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#pragma once
#include "thirdparty/GL/GL.hpp"
#include <ctime>
#include "client/app/AppPlatform.hpp"
#include "source/common/Utils.hpp"
#include "android_native_app_glue.h"
// note: probably won't add AppPlatform_android until it's time
// to build an Android app
class AppPlatform_android : public AppPlatform
{
public:
AppPlatform_android();
~AppPlatform_android();
void initConsts();
void buyGame() override;
void saveScreenshot(const std::string& fileName, int width, int height) override;
int checkLicense() override;
void createUserInput() override;
std::vector<std::string> getUserInput() override;
int getUserInputStatus() override;
int getScreenWidth() const override;
int getScreenHeight() const override;
void showDialog(eDialogType) override;
std::string getDateString(int time) override;
Texture loadTexture(const std::string& str, bool b) override;
//std::vector<std::string> getOptionStrings() override;
// Also add these to allow proper turning within the game.
void recenterMouse() override;
void setMouseGrabbed(bool b) override;
void getMouseDiff(int& x, int& y) override;
void clearDiff() override;
void updateFocused(bool focused) override;
// Also add these to allow proper text input within the game.
bool shiftPressed() override;
void setShiftPressed(bool b);
void showKeyboard(bool bShown) override;
void onHideKeyboard() override; // This is an event
int getKeyboardUpOffset() override;
// Also add these to allow saving options.
//void setOptionStrings(const std::vector <std::string>& str) override;
SoundSystem* const getSoundSystem() const override;
void initSoundSystem() override;
bool isTouchscreen() override;
void setScreenSize(int width, int height);
void initAndroidApp(android_app* ptr);
private:
int m_ScreenWidth;
int m_ScreenHeight;
std::vector<std::string> m_UserInput;
int m_UserInputStatus;
eDialogType m_DialogType;
bool m_bIsFocused;
bool m_bGrabbedMouse;
bool m_bActuallyGrabbedMouse;
bool m_bWasUnfocused;
bool m_bShiftPressed;
bool m_bIsKeyboardShown;
int m_MouseDiffX, m_MouseDiffY;
android_app* m_app;
SoundSystem* m_pSoundSystem;
};

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<MC_GLOBAL_PROPS>whattimeisit?</MC_GLOBAL_PROPS>
<MC_ROOT>$(ProjectDir)..\..\..\..</MC_ROOT>
<RAKNET_PATH>$(MC_ROOT)\thirdparty\raknet\</RAKNET_PATH>
</PropertyGroup>
</Project>

View File

@@ -0,0 +1,75 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.33920.266
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "minecraftcpp", "minecraftcpp", "{CB378121-2E54-4692-90F9-CFEFFF373ABB}"
EndProject
Project("{39E2626F-3545-4960-A6E8-258AD8476CE5}") = "minecraftcpp.Packaging", "minecraftcpp\minecraftcpp.Packaging\minecraftcpp.Packaging.androidproj", "{638896B6-8EAC-47D8-BFD8-6B74F88322CF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "minecraftcpp.NativeActivity", "minecraftcpp\minecraftcpp.NativeActivity\minecraftcpp.NativeActivity.vcxproj", "{C381C7AF-D139-41E9-A742-6B0006E25D64}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM = Debug|ARM
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM = Release|ARM
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|ARM.ActiveCfg = Debug|ARM
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|ARM.Build.0 = Debug|ARM
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|ARM.Deploy.0 = Debug|ARM
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|ARM64.ActiveCfg = Debug|ARM64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|ARM64.Build.0 = Debug|ARM64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|ARM64.Deploy.0 = Debug|ARM64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|x64.ActiveCfg = Debug|x64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|x64.Build.0 = Debug|x64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|x64.Deploy.0 = Debug|x64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|x86.ActiveCfg = Debug|x86
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|x86.Build.0 = Debug|x86
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Debug|x86.Deploy.0 = Debug|x86
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|ARM.ActiveCfg = Release|ARM
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|ARM.Build.0 = Release|ARM
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|ARM.Deploy.0 = Release|ARM
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|ARM64.ActiveCfg = Release|ARM64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|ARM64.Build.0 = Release|ARM64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|ARM64.Deploy.0 = Release|ARM64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|x64.ActiveCfg = Release|x64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|x64.Build.0 = Release|x64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|x64.Deploy.0 = Release|x64
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|x86.ActiveCfg = Release|x86
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|x86.Build.0 = Release|x86
{638896B6-8EAC-47D8-BFD8-6B74F88322CF}.Release|x86.Deploy.0 = Release|x86
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Debug|ARM.ActiveCfg = Debug|ARM
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Debug|ARM.Build.0 = Debug|ARM
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Debug|ARM64.ActiveCfg = Debug|ARM64
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Debug|ARM64.Build.0 = Debug|ARM64
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Debug|x64.ActiveCfg = Debug|x64
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Debug|x64.Build.0 = Debug|x64
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Debug|x86.ActiveCfg = Debug|x86
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Debug|x86.Build.0 = Debug|x86
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Release|ARM.ActiveCfg = Release|ARM
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Release|ARM.Build.0 = Release|ARM
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Release|ARM64.ActiveCfg = Release|ARM64
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Release|ARM64.Build.0 = Release|ARM64
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Release|x64.ActiveCfg = Release|x64
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Release|x64.Build.0 = Release|x64
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Release|x86.ActiveCfg = Release|x86
{C381C7AF-D139-41E9-A742-6B0006E25D64}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{638896B6-8EAC-47D8-BFD8-6B74F88322CF} = {CB378121-2E54-4692-90F9-CFEFFF373ABB}
{C381C7AF-D139-41E9-A742-6B0006E25D64} = {CB378121-2E54-4692-90F9-CFEFFF373ABB}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {469E02FA-FBC4-419C-8EA0-3055EE0AD3AC}
EndGlobalSection
EndGlobal

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<MC_ROOT>$(ProjectDir)..\..\..\..\</MC_ROOT>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="MC_ROOT">
<Value>$(MC_ROOT)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,437 @@
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#include <jni.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/resource.h>
#include "android_native_app_glue.h"
#include <android/log.h>
#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "ReMinecraftPE", __VA_ARGS__))
#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "ReMinecraftPE", __VA_ARGS__))
/* For debug builds, always enable the debug traces in this library */
#ifndef NDEBUG
# define LOGV(...) ((void)__android_log_print(ANDROID_LOG_VERBOSE, "threaded_app", __VA_ARGS__))
#else
# define LOGV(...) ((void)0)
#endif
static void free_saved_state(struct android_app* android_app) {
pthread_mutex_lock(&android_app->mutex);
if (android_app->savedState != NULL) {
free(android_app->savedState);
android_app->savedState = NULL;
android_app->savedStateSize = 0;
}
pthread_mutex_unlock(&android_app->mutex);
}
int8_t android_app_read_cmd(struct android_app* android_app) {
int8_t cmd;
if (read(android_app->msgread, &cmd, sizeof(cmd)) == sizeof(cmd)) {
switch (cmd) {
case APP_CMD_SAVE_STATE:
free_saved_state(android_app);
break;
}
return cmd;
} else {
LOGE("No data on command pipe!");
}
return -1;
}
static void print_cur_config(struct android_app* android_app) {
char lang[2], country[2];
AConfiguration_getLanguage(android_app->config, lang);
AConfiguration_getCountry(android_app->config, country);
LOGV("Config: mcc=%d mnc=%d lang=%c%c cnt=%c%c orien=%d touch=%d dens=%d "
"keys=%d nav=%d keysHid=%d navHid=%d sdk=%d size=%d long=%d "
"modetype=%d modenight=%d",
AConfiguration_getMcc(android_app->config),
AConfiguration_getMnc(android_app->config),
lang[0], lang[1], country[0], country[1],
AConfiguration_getOrientation(android_app->config),
AConfiguration_getTouchscreen(android_app->config),
AConfiguration_getDensity(android_app->config),
AConfiguration_getKeyboard(android_app->config),
AConfiguration_getNavigation(android_app->config),
AConfiguration_getKeysHidden(android_app->config),
AConfiguration_getNavHidden(android_app->config),
AConfiguration_getSdkVersion(android_app->config),
AConfiguration_getScreenSize(android_app->config),
AConfiguration_getScreenLong(android_app->config),
AConfiguration_getUiModeType(android_app->config),
AConfiguration_getUiModeNight(android_app->config));
}
void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd) {
switch (cmd) {
case APP_CMD_INPUT_CHANGED:
LOGV("APP_CMD_INPUT_CHANGED\n");
pthread_mutex_lock(&android_app->mutex);
if (android_app->inputQueue != NULL) {
AInputQueue_detachLooper(android_app->inputQueue);
}
android_app->inputQueue = android_app->pendingInputQueue;
if (android_app->inputQueue != NULL) {
LOGV("Attaching input queue to looper");
AInputQueue_attachLooper(android_app->inputQueue,
android_app->looper, LOOPER_ID_INPUT, NULL,
&android_app->inputPollSource);
}
pthread_cond_broadcast(&android_app->cond);
pthread_mutex_unlock(&android_app->mutex);
break;
case APP_CMD_INIT_WINDOW:
LOGV("APP_CMD_INIT_WINDOW\n");
pthread_mutex_lock(&android_app->mutex);
android_app->window = android_app->pendingWindow;
pthread_cond_broadcast(&android_app->cond);
pthread_mutex_unlock(&android_app->mutex);
break;
case APP_CMD_TERM_WINDOW:
LOGV("APP_CMD_TERM_WINDOW\n");
pthread_cond_broadcast(&android_app->cond);
break;
case APP_CMD_RESUME:
case APP_CMD_START:
case APP_CMD_PAUSE:
case APP_CMD_STOP:
LOGV("activityState=%d\n", cmd);
pthread_mutex_lock(&android_app->mutex);
android_app->activityState = cmd;
pthread_cond_broadcast(&android_app->cond);
pthread_mutex_unlock(&android_app->mutex);
break;
case APP_CMD_CONFIG_CHANGED:
LOGV("APP_CMD_CONFIG_CHANGED\n");
AConfiguration_fromAssetManager(android_app->config,
android_app->activity->assetManager);
print_cur_config(android_app);
break;
case APP_CMD_DESTROY:
LOGV("APP_CMD_DESTROY\n");
android_app->destroyRequested = 1;
break;
}
}
void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) {
switch (cmd) {
case APP_CMD_TERM_WINDOW:
LOGV("APP_CMD_TERM_WINDOW\n");
pthread_mutex_lock(&android_app->mutex);
android_app->window = NULL;
pthread_cond_broadcast(&android_app->cond);
pthread_mutex_unlock(&android_app->mutex);
break;
case APP_CMD_SAVE_STATE:
LOGV("APP_CMD_SAVE_STATE\n");
pthread_mutex_lock(&android_app->mutex);
android_app->stateSaved = 1;
pthread_cond_broadcast(&android_app->cond);
pthread_mutex_unlock(&android_app->mutex);
break;
case APP_CMD_RESUME:
free_saved_state(android_app);
break;
}
}
static void android_app_destroy(struct android_app* android_app) {
LOGV("android_app_destroy!");
free_saved_state(android_app);
pthread_mutex_lock(&android_app->mutex);
if (android_app->inputQueue != NULL) {
AInputQueue_detachLooper(android_app->inputQueue);
}
AConfiguration_delete(android_app->config);
android_app->destroyed = 1;
pthread_cond_broadcast(&android_app->cond);
pthread_mutex_unlock(&android_app->mutex);
// Can't touch android_app object after this.
}
static void process_input(struct android_app* app, struct android_poll_source* source) {
AInputEvent* event = NULL;
while (AInputQueue_getEvent(app->inputQueue, &event) >= 0) {
LOGV("New input event: type=%d\n", AInputEvent_getType(event));
if (AInputQueue_preDispatchEvent(app->inputQueue, event)) {
continue;
}
int32_t handled = 0;
if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event);
AInputQueue_finishEvent(app->inputQueue, event, handled);
}
}
static void process_cmd(struct android_app* app, struct android_poll_source* source) {
int8_t cmd = android_app_read_cmd(app);
android_app_pre_exec_cmd(app, cmd);
if (app->onAppCmd != NULL) app->onAppCmd(app, cmd);
android_app_post_exec_cmd(app, cmd);
}
static void* android_app_entry(void* param) {
struct android_app* android_app = (struct android_app*)param;
android_app->config = AConfiguration_new();
AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager);
print_cur_config(android_app);
android_app->cmdPollSource.id = LOOPER_ID_MAIN;
android_app->cmdPollSource.app = android_app;
android_app->cmdPollSource.process = process_cmd;
android_app->inputPollSource.id = LOOPER_ID_INPUT;
android_app->inputPollSource.app = android_app;
android_app->inputPollSource.process = process_input;
ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
ALooper_addFd(looper, android_app->msgread, LOOPER_ID_MAIN, ALOOPER_EVENT_INPUT, NULL,
&android_app->cmdPollSource);
android_app->looper = looper;
pthread_mutex_lock(&android_app->mutex);
android_app->running = 1;
pthread_cond_broadcast(&android_app->cond);
pthread_mutex_unlock(&android_app->mutex);
android_main(android_app);
android_app_destroy(android_app);
return NULL;
}
// --------------------------------------------------------------------
// Native activity interaction (called from main thread)
// --------------------------------------------------------------------
static struct android_app* android_app_create(ANativeActivity* activity,
void* savedState, size_t savedStateSize) {
struct android_app* android_app = (struct android_app*)malloc(sizeof(struct android_app));
memset(android_app, 0, sizeof(struct android_app));
android_app->activity = activity;
pthread_mutex_init(&android_app->mutex, NULL);
pthread_cond_init(&android_app->cond, NULL);
if (savedState != NULL) {
android_app->savedState = malloc(savedStateSize);
android_app->savedStateSize = savedStateSize;
memcpy(android_app->savedState, savedState, savedStateSize);
}
int msgpipe[2];
if (pipe(msgpipe)) {
LOGE("could not create pipe: %s", strerror(errno));
return NULL;
}
android_app->msgread = msgpipe[0];
android_app->msgwrite = msgpipe[1];
pthread_attr_t attr;
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
pthread_create(&android_app->thread, &attr, android_app_entry, android_app);
// Wait for thread to start.
pthread_mutex_lock(&android_app->mutex);
while (!android_app->running) {
pthread_cond_wait(&android_app->cond, &android_app->mutex);
}
pthread_mutex_unlock(&android_app->mutex);
return android_app;
}
static void android_app_write_cmd(struct android_app* android_app, int8_t cmd) {
if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd)) {
LOGE("Failure writing android_app cmd: %s\n", strerror(errno));
}
}
static void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue) {
pthread_mutex_lock(&android_app->mutex);
android_app->pendingInputQueue = inputQueue;
android_app_write_cmd(android_app, APP_CMD_INPUT_CHANGED);
while (android_app->inputQueue != android_app->pendingInputQueue) {
pthread_cond_wait(&android_app->cond, &android_app->mutex);
}
pthread_mutex_unlock(&android_app->mutex);
}
static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) {
pthread_mutex_lock(&android_app->mutex);
if (android_app->pendingWindow != NULL) {
android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW);
}
android_app->pendingWindow = window;
if (window != NULL) {
android_app_write_cmd(android_app, APP_CMD_INIT_WINDOW);
}
while (android_app->window != android_app->pendingWindow) {
pthread_cond_wait(&android_app->cond, &android_app->mutex);
}
pthread_mutex_unlock(&android_app->mutex);
}
static void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) {
pthread_mutex_lock(&android_app->mutex);
android_app_write_cmd(android_app, cmd);
while (android_app->activityState != cmd) {
pthread_cond_wait(&android_app->cond, &android_app->mutex);
}
pthread_mutex_unlock(&android_app->mutex);
}
static void android_app_free(struct android_app* android_app) {
pthread_mutex_lock(&android_app->mutex);
android_app_write_cmd(android_app, APP_CMD_DESTROY);
while (!android_app->destroyed) {
pthread_cond_wait(&android_app->cond, &android_app->mutex);
}
pthread_mutex_unlock(&android_app->mutex);
close(android_app->msgread);
close(android_app->msgwrite);
pthread_cond_destroy(&android_app->cond);
pthread_mutex_destroy(&android_app->mutex);
free(android_app);
}
static void onDestroy(ANativeActivity* activity) {
LOGV("Destroy: %p\n", activity);
android_app_free((struct android_app*)activity->instance);
}
static void onStart(ANativeActivity* activity) {
LOGV("Start: %p\n", activity);
android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_START);
}
static void onResume(ANativeActivity* activity) {
LOGV("Resume: %p\n", activity);
android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_RESUME);
}
static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) {
struct android_app* android_app = (struct android_app*)activity->instance;
void* savedState = NULL;
LOGV("SaveInstanceState: %p\n", activity);
pthread_mutex_lock(&android_app->mutex);
android_app->stateSaved = 0;
android_app_write_cmd(android_app, APP_CMD_SAVE_STATE);
while (!android_app->stateSaved) {
pthread_cond_wait(&android_app->cond, &android_app->mutex);
}
if (android_app->savedState != NULL) {
savedState = android_app->savedState;
*outLen = android_app->savedStateSize;
android_app->savedState = NULL;
android_app->savedStateSize = 0;
}
pthread_mutex_unlock(&android_app->mutex);
return savedState;
}
static void onPause(ANativeActivity* activity) {
LOGV("Pause: %p\n", activity);
android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_PAUSE);
}
static void onStop(ANativeActivity* activity) {
LOGV("Stop: %p\n", activity);
android_app_set_activity_state((struct android_app*)activity->instance, APP_CMD_STOP);
}
static void onConfigurationChanged(ANativeActivity* activity) {
struct android_app* android_app = (struct android_app*)activity->instance;
LOGV("ConfigurationChanged: %p\n", activity);
android_app_write_cmd(android_app, APP_CMD_CONFIG_CHANGED);
}
static void onLowMemory(ANativeActivity* activity) {
struct android_app* android_app = (struct android_app*)activity->instance;
LOGV("LowMemory: %p\n", activity);
android_app_write_cmd(android_app, APP_CMD_LOW_MEMORY);
}
static void onWindowFocusChanged(ANativeActivity* activity, int focused) {
LOGV("WindowFocusChanged: %p -- %d\n", activity, focused);
android_app_write_cmd((struct android_app*)activity->instance,
focused ? APP_CMD_GAINED_FOCUS : APP_CMD_LOST_FOCUS);
}
static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) {
LOGV("NativeWindowCreated: %p -- %p\n", activity, window);
android_app_set_window((struct android_app*)activity->instance, window);
}
static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window) {
LOGV("NativeWindowDestroyed: %p -- %p\n", activity, window);
android_app_set_window((struct android_app*)activity->instance, NULL);
}
static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) {
LOGV("InputQueueCreated: %p -- %p\n", activity, queue);
android_app_set_input((struct android_app*)activity->instance, queue);
}
static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) {
LOGV("InputQueueDestroyed: %p -- %p\n", activity, queue);
android_app_set_input((struct android_app*)activity->instance, NULL);
}
void ANativeActivity_onCreate(ANativeActivity* activity,
void* savedState, size_t savedStateSize) {
LOGV("Creating: %p\n", activity);
activity->callbacks->onDestroy = onDestroy;
activity->callbacks->onStart = onStart;
activity->callbacks->onResume = onResume;
activity->callbacks->onSaveInstanceState = onSaveInstanceState;
activity->callbacks->onPause = onPause;
activity->callbacks->onStop = onStop;
activity->callbacks->onConfigurationChanged = onConfigurationChanged;
activity->callbacks->onLowMemory = onLowMemory;
activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
activity->callbacks->onInputQueueCreated = onInputQueueCreated;
activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
activity->instance = android_app_create(activity, savedState, savedStateSize);
}

View File

@@ -0,0 +1,344 @@
/*
* Copyright (C) 2010 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef _ANDROID_NATIVE_APP_GLUE_H
#define _ANDROID_NATIVE_APP_GLUE_H
#include <poll.h>
#include <pthread.h>
#include <sched.h>
#include <android/configuration.h>
#include <android/looper.h>
#include <android/native_activity.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* The native activity interface provided by <android/native_activity.h>
* is based on a set of application-provided callbacks that will be called
* by the Activity's main thread when certain events occur.
*
* This means that each one of this callbacks _should_ _not_ block, or they
* risk having the system force-close the application. This programming
* model is direct, lightweight, but constraining.
*
* The 'threaded_native_app' static library is used to provide a different
* execution model where the application can implement its own main event
* loop in a different thread instead. Here's how it works:
*
* 1/ The application must provide a function named "android_main()" that
* will be called when the activity is created, in a new thread that is
* distinct from the activity's main thread.
*
* 2/ android_main() receives a pointer to a valid "android_app" structure
* that contains references to other important objects, e.g. the
* ANativeActivity obejct instance the application is running in.
*
* 3/ the "android_app" object holds an ALooper instance that already
* listens to two important things:
*
* - activity lifecycle events (e.g. "pause", "resume"). See APP_CMD_XXX
* declarations below.
*
* - input events coming from the AInputQueue attached to the activity.
*
* Each of these correspond to an ALooper identifier returned by
* ALooper_pollOnce with values of LOOPER_ID_MAIN and LOOPER_ID_INPUT,
* respectively.
*
* Your application can use the same ALooper to listen to additional
* file-descriptors. They can either be callback based, or with return
* identifiers starting with LOOPER_ID_USER.
*
* 4/ Whenever you receive a LOOPER_ID_MAIN or LOOPER_ID_INPUT event,
* the returned data will point to an android_poll_source structure. You
* can call the process() function on it, and fill in android_app->onAppCmd
* and android_app->onInputEvent to be called for your own processing
* of the event.
*
* Alternatively, you can call the low-level functions to read and process
* the data directly... look at the process_cmd() and process_input()
* implementations in the glue to see how to do this.
*
* See the sample named "native-activity" that comes with the NDK with a
* full usage example. Also look at the JavaDoc of NativeActivity.
*/
struct android_app;
/**
* Data associated with an ALooper fd that will be returned as the "outData"
* when that source has data ready.
*/
struct android_poll_source {
// The identifier of this source. May be LOOPER_ID_MAIN or
// LOOPER_ID_INPUT.
int32_t id;
// The android_app this ident is associated with.
struct android_app* app;
// Function to call to perform the standard processing of data from
// this source.
void (*process)(struct android_app* app, struct android_poll_source* source);
};
/**
* This is the interface for the standard glue code of a threaded
* application. In this model, the application's code is running
* in its own thread separate from the main thread of the process.
* It is not required that this thread be associated with the Java
* VM, although it will need to be in order to make JNI calls any
* Java objects.
*/
struct android_app {
// The application can place a pointer to its own state object
// here if it likes.
void* userData;
// Fill this in with the function to process main app commands (APP_CMD_*)
void (*onAppCmd)(struct android_app* app, int32_t cmd);
// Fill this in with the function to process input events. At this point
// the event has already been pre-dispatched, and it will be finished upon
// return. Return 1 if you have handled the event, 0 for any default
// dispatching.
int32_t (*onInputEvent)(struct android_app* app, AInputEvent* event);
// The ANativeActivity object instance that this app is running in.
ANativeActivity* activity;
// The current configuration the app is running in.
AConfiguration* config;
// This is the last instance's saved state, as provided at creation time.
// It is NULL if there was no state. You can use this as you need; the
// memory will remain around until you call android_app_exec_cmd() for
// APP_CMD_RESUME, at which point it will be freed and savedState set to NULL.
// These variables should only be changed when processing a APP_CMD_SAVE_STATE,
// at which point they will be initialized to NULL and you can malloc your
// state and place the information here. In that case the memory will be
// freed for you later.
void* savedState;
size_t savedStateSize;
// The ALooper associated with the app's thread.
ALooper* looper;
// When non-NULL, this is the input queue from which the app will
// receive user input events.
AInputQueue* inputQueue;
// When non-NULL, this is the window surface that the app can draw in.
ANativeWindow* window;
// Current content rectangle of the window; this is the area where the
// window's content should be placed to be seen by the user.
ARect contentRect;
// Current state of the app's activity. May be either APP_CMD_START,
// APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP; see below.
int activityState;
// This is non-zero when the application's NativeActivity is being
// destroyed and waiting for the app thread to complete.
int destroyRequested;
// -------------------------------------------------
// Below are "private" implementation of the glue code.
pthread_mutex_t mutex;
pthread_cond_t cond;
int msgread;
int msgwrite;
pthread_t thread;
struct android_poll_source cmdPollSource;
struct android_poll_source inputPollSource;
int running;
int stateSaved;
int destroyed;
int redrawNeeded;
AInputQueue* pendingInputQueue;
ANativeWindow* pendingWindow;
ARect pendingContentRect;
};
enum {
/**
* Looper data ID of commands coming from the app's main thread, which
* is returned as an identifier from ALooper_pollOnce(). The data for this
* identifier is a pointer to an android_poll_source structure.
* These can be retrieved and processed with android_app_read_cmd()
* and android_app_exec_cmd().
*/
LOOPER_ID_MAIN = 1,
/**
* Looper data ID of events coming from the AInputQueue of the
* application's window, which is returned as an identifier from
* ALooper_pollOnce(). The data for this identifier is a pointer to an
* android_poll_source structure. These can be read via the inputQueue
* object of android_app.
*/
LOOPER_ID_INPUT = 2,
/**
* Start of user-defined ALooper identifiers.
*/
LOOPER_ID_USER = 3,
};
enum {
/**
* Command from main thread: the AInputQueue has changed. Upon processing
* this command, android_app->inputQueue will be updated to the new queue
* (or NULL).
*/
APP_CMD_INPUT_CHANGED,
/**
* Command from main thread: a new ANativeWindow is ready for use. Upon
* receiving this command, android_app->window will contain the new window
* surface.
*/
APP_CMD_INIT_WINDOW,
/**
* Command from main thread: the existing ANativeWindow needs to be
* terminated. Upon receiving this command, android_app->window still
* contains the existing window; after calling android_app_exec_cmd
* it will be set to NULL.
*/
APP_CMD_TERM_WINDOW,
/**
* Command from main thread: the current ANativeWindow has been resized.
* Please redraw with its new size.
*/
APP_CMD_WINDOW_RESIZED,
/**
* Command from main thread: the system needs that the current ANativeWindow
* be redrawn. You should redraw the window before handing this to
* android_app_exec_cmd() in order to avoid transient drawing glitches.
*/
APP_CMD_WINDOW_REDRAW_NEEDED,
/**
* Command from main thread: the content area of the window has changed,
* such as from the soft input window being shown or hidden. You can
* find the new content rect in android_app::contentRect.
*/
APP_CMD_CONTENT_RECT_CHANGED,
/**
* Command from main thread: the app's activity window has gained
* input focus.
*/
APP_CMD_GAINED_FOCUS,
/**
* Command from main thread: the app's activity window has lost
* input focus.
*/
APP_CMD_LOST_FOCUS,
/**
* Command from main thread: the current device configuration has changed.
*/
APP_CMD_CONFIG_CHANGED,
/**
* Command from main thread: the system is running low on memory.
* Try to reduce your memory use.
*/
APP_CMD_LOW_MEMORY,
/**
* Command from main thread: the app's activity has been started.
*/
APP_CMD_START,
/**
* Command from main thread: the app's activity has been resumed.
*/
APP_CMD_RESUME,
/**
* Command from main thread: the app should generate a new saved state
* for itself, to restore from later if needed. If you have saved state,
* allocate it with malloc and place it in android_app.savedState with
* the size in android_app.savedStateSize. The will be freed for you
* later.
*/
APP_CMD_SAVE_STATE,
/**
* Command from main thread: the app's activity has been paused.
*/
APP_CMD_PAUSE,
/**
* Command from main thread: the app's activity has been stopped.
*/
APP_CMD_STOP,
/**
* Command from main thread: the app's activity is being destroyed,
* and waiting for the app thread to clean up and exit before proceeding.
*/
APP_CMD_DESTROY,
};
/**
* Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next
* app command message.
*/
int8_t android_app_read_cmd(struct android_app* android_app);
/**
* Call with the command returned by android_app_read_cmd() to do the
* initial pre-processing of the given command. You can perform your own
* actions for the command after calling this function.
*/
void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd);
/**
* Call with the command returned by android_app_read_cmd() to do the
* final post-processing of the given command. You must have done your own
* actions for the command before calling this function.
*/
void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd);
/**
* This is the function that application code must implement, representing
* the main entry to the app.
*/
extern void android_main(struct android_app* app);
#ifdef __cplusplus
}
#endif
#endif /* _ANDROID_NATIVE_APP_GLUE_H */

View File

@@ -0,0 +1,426 @@
#include <jni.h>
#include <errno.h>
#include "android_native_app_glue.h"
#include <string.h>
#include <unistd.h>
#include <sys/resource.h>
#include <thread>
#include <android/sensor.h>
#include <android/log.h>
#include "compat/KeyCodes.hpp"
#include "thirdparty/GL/GL.hpp"
#include "platforms/android/AppPlatform_android.hpp"
#include "client/app/NinecraftApp.hpp"
#include "client/gui/screens/ProgressScreen.hpp"
#include "client/player/input/Controller.hpp"
#include "client/player/input/Mouse.hpp"
#include "client/player/input/Multitouch.hpp"
AppPlatform_android g_AppPlatform;
bool g_LButtonDown, g_RButtonDown;
int g_MousePosX, g_MousePosY;
struct engine
{
struct android_app* androidApp;
EGLDisplay display = nullptr;
EGLSurface surface = nullptr;
EGLContext context = nullptr;
int animating = 0;
bool initted = false;
NinecraftApp* ninecraftApp = nullptr;
};
static float mapStick(AInputEvent* event, int32_t axis)
{
const float deadZone = .265f;
float value = AMotionEvent_getAxisValue(event, axis, 0);
if (value > deadZone)
return (value - deadZone) / (1.f - deadZone);
else if (value < -deadZone)
return (value + deadZone) / (1.f - deadZone);
else
return 0.f;
}
static float mapTrigger(AInputEvent* event, int32_t axis)
{
const float deadZone = .1f;
float value = AMotionEvent_getAxisValue(event, axis, 0);
if (value > deadZone)
return (value - deadZone) / (1.f - deadZone);
else
return 0.f;
}
static bool s_lastR = false;
static bool s_lastL = false;
static char getCharFromKey(int32_t keyCode, int32_t metaState)
{
bool bShiftPressed = metaState & AMETA_SHIFT_ON;
// well you can't really press alt-X or ctrl-X and expect an actual character
if (metaState & (AMETA_ALT_ON | AMETA_CTRL_ON))
return '\0';
// Alphabet
if (keyCode >= AKEYCODE_A && keyCode <= AKEYCODE_Z)
return char((keyCode - AKEYCODE_A) + (bShiftPressed ? 'A' : 'a'));
// Digits
if (keyCode >= AKEYCODE_0 && keyCode <= AKEYCODE_9)
{
static const char* shiftmap = ")!@#$%^&*(";
return char(bShiftPressed ? shiftmap[keyCode - AKEYCODE_0] : (keyCode - AKEYCODE_0 + '0'));
}
// NumPad
if (keyCode >= AKEYCODE_NUMPAD_0 && keyCode <= AKEYCODE_NUMPAD_9)
return char(keyCode + '0' - AKEYCODE_NUMPAD_0);
switch (keyCode)
{
case AKEYCODE_DEL: return '\b';
case AKEYCODE_FORWARD_DEL: return '\001';
case AKEYCODE_ARROW_LEFT: return '\002';
case AKEYCODE_ARROW_RIGHT: return '\003';
case AKEYCODE_SPACE: return ' ';
case AKEYCODE_COMMA: return bShiftPressed ? '<' : ',';
case AKEYCODE_PERIOD: return bShiftPressed ? '>' : '.';
case AKEYCODE_EQUALS: return bShiftPressed ? '+' : '=';
case AKEYCODE_MINUS: return bShiftPressed ? '_' : '-';
case AKEYCODE_SEMICOLON: return bShiftPressed ? ':' : ';';
case AKEYCODE_SLASH: return bShiftPressed ? '?' : '/';
case AKEYCODE_GRAVE: return bShiftPressed ? '~' : '`';
case AKEYCODE_BACKSLASH: return bShiftPressed ? '|' : '\\';
case AKEYCODE_APOSTROPHE: return bShiftPressed ? '"' : '\'';
case AKEYCODE_LEFT_BRACKET: return bShiftPressed ? '{' : '[';
case AKEYCODE_RIGHT_BRACKET: return bShiftPressed ? '}' : ']';
}
return '\0';
}
static int evalKeyInput(struct engine* engine, AInputEvent* event)
{
bool keyDown = AKeyEvent_getAction(event) == AKEY_EVENT_ACTION_DOWN;
int keyCode = AKeyEvent_getKeyCode(event);
bool isBack = true;
if (keyCode != AKEYCODE_BACK || AInputEvent_getDeviceId(event) != 0)
isBack = false;
int repeatCount = AKeyEvent_getRepeatCount(event);
if (repeatCount <= 0 && !isBack)
Keyboard::feed(keyDown ? Keyboard::DOWN : Keyboard::UP, keyCode);
// We define HANDLE_CHARS_SEPARATELY but have to fake it
if (keyDown) {
char chr = getCharFromKey(keyCode, AKeyEvent_getMetaState(event));
if (chr != '\0')
engine->ninecraftApp->handleCharInput(chr);
}
if (keyCode == AKEYCODE_BACK)
{
if (repeatCount == 0)
engine->ninecraftApp->handleBack(keyDown);
return 1;
}
// let Android handle those
if (keyCode >= AKEYCODE_VOLUME_UP && keyCode <= AKEYCODE_VOLUME_DOWN)
return 0;
return 1;
}
#define COMPARE_SOURCE(v, s) ((v & s) == s)
static void nativeMouseDown(int id, int x, int y)
{
Mouse::feed(BUTTON_LEFT, true, x, y);
Multitouch::feed(BUTTON_LEFT, true, x, y, id);
}
static void nativeMouseUp(int id, int x, int y)
{
Mouse::feed(BUTTON_LEFT, false, x, y);
Multitouch::feed(BUTTON_LEFT, false, x, y, id);
}
static void nativeMouseMove(int id, int x, int y)
{
Mouse::feed(BUTTON_NONE, false, x, y);
Multitouch::feed(BUTTON_NONE, false, x, y, id);
}
static int32_t evalMotionInput(struct engine* engine, AInputEvent* event, int32_t source)
{
size_t pointerCount = AMotionEvent_getPointerCount(event);
//! NOTE: Android documentation clearly states that pointerCount is always >=1.
if (pointerCount <= 0)
return 1;
int actionp = AMotionEvent_getAction(event);
int action = actionp & AMOTION_EVENT_ACTION_MASK;
int pointerId = AMotionEvent_getPointerId(event, (actionp & AMOTION_EVENT_ACTION_POINTER_INDEX_MASK) >> AMOTION_EVENT_ACTION_POINTER_INDEX_SHIFT);
int x = AMotionEvent_getX(event, pointerId);
int y = AMotionEvent_getY(event, pointerId);
switch (action)
{
case AMOTION_EVENT_ACTION_DOWN:
case AMOTION_EVENT_ACTION_POINTER_DOWN:
nativeMouseDown(pointerId, x, y);
break;
case AMOTION_EVENT_ACTION_UP:
case AMOTION_EVENT_ACTION_POINTER_UP:
nativeMouseUp(pointerId, x, y);
break;
case AMOTION_EVENT_ACTION_MOVE:
{
int pc = AMotionEvent_getPointerCount(event);
for (int i = 0; i < pc; i++)
{
nativeMouseMove(AMotionEvent_getPointerId(event, i),
AMotionEvent_getX(event, i),
AMotionEvent_getY(event, i));
}
break;
}
}
return 1;
}
static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
{
struct engine* engine = (struct engine*)app->userData;
int32_t type = AInputEvent_getType(event);
int32_t source = AInputEvent_getSource(event);
switch (type)
{
case AINPUT_EVENT_TYPE_KEY:
return evalKeyInput(engine, event);
case AINPUT_EVENT_TYPE_MOTION:
return evalMotionInput(engine, event, source);
}
return 0;
}
static std::string getExternalStorageDir(struct engine* engine)
{
// Normally we would use the external storage directory. However, late Android is being
// very bitchy about giving us the permission. And that's probably a good thing, actually.
// This returns a directory path that looks something like the following, which is still
// exposed to the user, therefore we get the benefits of having it exposed, aside from the
// fact that removing the app will delete all your worlds.
// /.../Android/data/com.minecraftcpp/files
#ifndef USE_EXTERNAL_STORAGE
return std::string(engine->androidApp->activity->externalDataPath);
#else
ANativeActivity* pActivity = engine->androidApp->activity;
JNIEnv* pJNIEnv = pActivity->env;
pActivity->vm->AttachCurrentThread(&pJNIEnv, nullptr);
jclass Environment = pJNIEnv->FindClass("android/os/Environment");
jmethodID GetDirId = pJNIEnv->GetStaticMethodID(Environment, "getExternalStorageDirectory", "()Ljava/io/File;");
if (pJNIEnv->ExceptionOccurred())
pJNIEnv->ExceptionDescribe();
// Since it takes a String
jobject FileObject = pJNIEnv->CallStaticObjectMethod(Environment, GetDirId);
jclass FileClass = pJNIEnv->GetObjectClass(FileObject);
jmethodID AbsPathId = pJNIEnv->GetMethodID(FileClass, "getAbsolutePath", "()Ljava/lang/String;");
jobject PathObject = pJNIEnv->CallObjectMethod(FileObject, AbsPathId);
const char* PathString = pJNIEnv->GetStringUTFChars((jstring) PathObject, nullptr);
std::string result(PathString);
pJNIEnv->ReleaseStringUTFChars((jstring) PathObject, PathString);
pActivity->vm->DetachCurrentThread();
return result;
#endif
}
/**
* Process the next main command.
*/
static void initWindow(struct engine* engine, struct android_app* app)
{
if (engine->androidApp->window == NULL)
{
LOG_E("no active window?");
return;
}
EGLint w, h, format;
//EGLint numConfigs;
engine->display = eglGetDisplay(EGL_DEFAULT_DISPLAY);
if (!eglInitialize(engine->display, 0, 0))
{
LOG_E("eglInitialize failed %i", eglGetError());
return;
}
EGLConfig config;
EGLint attribs[] = {
EGL_SURFACE_TYPE, EGL_OPENGL_ES2_BIT,
EGL_DEPTH_SIZE, 0x10,
EGL_RENDERABLE_TYPE, EGL_VERSION_1_3,
EGL_NONE
};
EGLint numConfigs = 0;
if (!(eglChooseConfig(engine->display, attribs, &config, 1, &numConfigs) && numConfigs > 0))
{
LOG_E("eglChooseConfig failed %i", eglGetError());
return;
}
eglGetConfigAttrib(engine->display, config, EGL_NATIVE_VISUAL_ID, &format);
ANativeWindow_setBuffersGeometry(app->window, 0, 0, format);
engine->surface = eglCreateWindowSurface(engine->display, config, app->window, NULL);
engine->context = eglCreateContext(engine->display, config, NULL, NULL);
if (!engine->context)
{
LOG_E("cant create egl context %x", eglGetError());
return;
}
if (eglMakeCurrent(engine->display, engine->surface, engine->surface, engine->context) == EGL_FALSE)
{
LOG_E("Unable to eglMakeCurrent");
return;
}
eglQuerySurface(engine->display, engine->surface, EGL_WIDTH, &w);
eglQuerySurface(engine->display, engine->surface, EGL_HEIGHT, &h);
g_AppPlatform.initConsts();
g_AppPlatform.setScreenSize(w, h);
g_AppPlatform.initAndroidApp(app);
engine->ninecraftApp->width = w;
engine->ninecraftApp->height = h;
if (!engine->initted)
{
engine->ninecraftApp->m_externalStorageDir = getExternalStorageDir(engine);
engine->ninecraftApp->init();
}
else
{
engine->ninecraftApp->onGraphicsReset();
}
engine->ninecraftApp->sizeUpdate(w, h);
engine->initted = true;
LOG_I("finished initializing");
engine->animating = 1;
}
static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
struct engine* engine = (struct engine*)app->userData;
switch (cmd) {
case APP_CMD_CONFIG_CHANGED:
LOG_I("APP_CMD_CONFIG_CHANGED");
break;
case APP_CMD_SAVE_STATE:
//ninecraftApp saveState not implemented do nothing
break;
case APP_CMD_INIT_WINDOW:
LOG_I("APP_CMD_INIT_WINDOW");
initWindow(engine, app);
break;
case APP_CMD_TERM_WINDOW:
LOG_I("APP_CMD_TERM_WINDOW");
if (engine->display)
{
eglMakeCurrent(engine->display, 0, 0, 0);
if (engine->context)
eglDestroyContext(engine->display, engine->context);
if (engine->surface)
eglDestroySurface(engine->display, engine->surface);
eglTerminate(engine->display);
}
break;
case APP_CMD_GAINED_FOCUS:
engine->animating = 1;
break;
case APP_CMD_LOST_FOCUS:
engine->animating = 0;
break;
}
}
void android_main(struct android_app* state) {
struct engine engine;
memset(&engine, 0, sizeof(engine));
state->userData = &engine;
state->onAppCmd = engine_handle_cmd;
state->onInputEvent = engine_handle_input;
engine.androidApp = state;
engine.ninecraftApp = new NinecraftApp;
engine.ninecraftApp->m_pPlatform = &g_AppPlatform;
while (1)
{
int ident;
int events;
struct android_poll_source* source;
while ((ident = ALooper_pollAll(engine.animating ? 0 : -1, NULL, &events,
(void**)&source)) >= 0) {
if (source != NULL) {
source->process(state, source);
}
}
if (engine.animating)
{
if (engine.ninecraftApp->wantToQuit())
break;
engine.ninecraftApp->update();
eglSwapBuffers(engine.display, engine.surface);
}
}
engine.ninecraftApp->saveOptions();
delete engine.ninecraftApp;
}

View File

@@ -0,0 +1,969 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{c381c7af-d139-41e9-a742-6b0006e25d64}</ProjectGuid>
<Keyword>Android</Keyword>
<RootNamespace>minecraftcpp</RootNamespace>
<DefaultLanguage>en-US</DefaultLanguage>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<ApplicationType>Android</ApplicationType>
<ApplicationTypeRevision>3.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>Clang_5_0</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>Clang_5_0</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>Clang_5_0</PlatformToolset>
<AndroidAPILevel>android-21</AndroidAPILevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>Clang_5_0</PlatformToolset>
<AndroidAPILevel>android-21</AndroidAPILevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>Clang_5_0</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>Clang_5_0</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>Clang_5_0</PlatformToolset>
<AndroidAPILevel>android-21</AndroidAPILevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>Clang_5_0</PlatformToolset>
<AndroidAPILevel>android-21</AndroidAPILevel>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<UseMultiToolTask>true</UseMultiToolTask>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<UseMultiToolTask>true</UseMultiToolTask>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<UseMultiToolTask>true</UseMultiToolTask>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<UseMultiToolTask>true</UseMultiToolTask>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<UseMultiToolTask>true</UseMultiToolTask>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<UseMultiToolTask>true</UseMultiToolTask>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<UseMultiToolTask>true</UseMultiToolTask>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<UseMultiToolTask>true</UseMultiToolTask>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(MC_ROOT);$(MC_ROOT)\source;$(MC_ROOT)\thirdparty\raknet;$(SolutionDir)\minecraftcpp\minecraftcpp.NativeActivity;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;OpenSLES;m;z</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(MC_ROOT);$(MC_ROOT)\source;$(MC_ROOT)\thirdparty\raknet;$(SolutionDir)\minecraftcpp\minecraftcpp.NativeActivity;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;OpenSLES;m;z</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(MC_ROOT);$(MC_ROOT)\source;$(MC_ROOT)\thirdparty\raknet;$(SolutionDir)\minecraftcpp\minecraftcpp.NativeActivity;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;OpenSLES;m;z</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(MC_ROOT);$(MC_ROOT)\source;$(MC_ROOT)\thirdparty\raknet;$(SolutionDir)\minecraftcpp\minecraftcpp.NativeActivity;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;OpenSLES;m;z</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(MC_ROOT);$(MC_ROOT)\source;$(MC_ROOT)\thirdparty\raknet;$(SolutionDir)\minecraftcpp\minecraftcpp.NativeActivity;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;OpenSLES;m;z</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(MC_ROOT);$(MC_ROOT)\source;$(MC_ROOT)\thirdparty\raknet;$(SolutionDir)\minecraftcpp\minecraftcpp.NativeActivity;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;OpenSLES;m;z</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(MC_ROOT);$(MC_ROOT)\source;$(MC_ROOT)\thirdparty\raknet;$(SolutionDir)\minecraftcpp\minecraftcpp.NativeActivity;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;OpenSLES;m;z</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<CompileAs>CompileAsCpp</CompileAs>
<AdditionalIncludeDirectories>$(MC_ROOT);$(MC_ROOT)\source;$(MC_ROOT)\thirdparty\raknet;$(SolutionDir)\minecraftcpp\minecraftcpp.NativeActivity;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ExceptionHandling>Enabled</ExceptionHandling>
<RuntimeTypeInfo>true</RuntimeTypeInfo>
</ClCompile>
<Link>
<LibraryDependencies>%(LibraryDependencies);GLESv1_CM;EGL;OpenSLES;m;z</LibraryDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="$(MC_ROOT)\GameMods.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\app\App.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\app\AppPlatform.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\app\Minecraft.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\app\NinecraftApp.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\AvailableGamesList.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\Button.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\RolledSelectionList.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\ScrolledSelectionList.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\SmallButton.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\TextInputBox.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\components\WorldSelectionList.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\Gui.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\GuiComponent.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\Screen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\ChatScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\ConfirmScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\CreateWorldScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\DeathScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\DeleteWorldScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\DirectConnectScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\IngameBlockSelectionScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\InvalidLicenseScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\JoinGameScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\OptionsScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\PauseScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\ProgressScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\RenameMPLevelScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\SavingWorldScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\SelectWorldScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\gui\screens\StartMenuScreen.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\model\Cube.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\model\HumanoidModel.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\model\Model.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\model\PolygonQuad.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\network\ClientSideNetworkHandler.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\options\Options.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\Controller.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\ControllerTurnInput.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\ITurnInput.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\Keyboard.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\KeyboardInput.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\Mouse.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\MouseTurnInput.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\User.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\Chunk.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\Culler.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\DynamicTexture.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\EntityRenderDispatcher.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\EntityRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\FallingTileRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\HumanoidMobRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\ItemRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\ItemSpriteRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\MobRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\TntRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\entity\TripodCameraRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\Font.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\Frustum.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\FrustumCuller.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\GameRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\ItemInHandRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\LevelRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\LightLayer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\LightUpdate.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\PatchManager.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\RenderChunk.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\RenderList.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\Tesselator.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\Texture.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\Textures.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\TileRenderer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\renderer\VertexPT.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\sound\SoundData.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\sound\SoundDefs.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\sound\SoundEngine.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\sound\SoundRepository.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\sound\SoundSystem.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\IArea.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\IBuildInput.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\IncludeExcludeArea.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\MouseHandler.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\PolygonArea.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\RectangleArea.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\MouseDevice.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\Multitouch.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\CustomInputHolder.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\IInputHolder.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\IMoveInput.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\ITouchScreenModel.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\TouchAreaModel.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\TouchInputHolder.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\TouchscreenInput_TestFps.hpp" />
<ClInclude Include="$(MC_ROOT)\source\client\player\input\UnifiedTurnBuild.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\CThread.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\Logger.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\LongHack.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\Matrix.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\Mth.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\Random.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\Timer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\Util.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\Utils.hpp" />
<ClInclude Include="$(MC_ROOT)\source\common\SmoothFloat.hpp" />
<ClInclude Include="$(MC_ROOT)\thirdparty\GL\GL.hpp" />
<ClInclude Include="$(MC_ROOT)\thirdparty\GL\glext.h" />
<ClInclude Include="$(RAKNET_PATH)\AutopatcherPatchContext.h" />
<ClInclude Include="$(RAKNET_PATH)\AutopatcherRepositoryInterface.h" />
<ClInclude Include="$(RAKNET_PATH)\Base64Encoder.h" />
<ClInclude Include="$(RAKNET_PATH)\BitStream.h" />
<ClInclude Include="$(RAKNET_PATH)\CCRakNetSlidingWindow.h" />
<ClInclude Include="$(RAKNET_PATH)\CCRakNetUDT.h" />
<ClInclude Include="$(RAKNET_PATH)\CheckSum.h" />
<ClInclude Include="$(RAKNET_PATH)\CloudClient.h" />
<ClInclude Include="$(RAKNET_PATH)\CloudCommon.h" />
<ClInclude Include="$(RAKNET_PATH)\CloudServer.h" />
<ClInclude Include="$(RAKNET_PATH)\CommandParserInterface.h" />
<ClInclude Include="$(RAKNET_PATH)\ConnectionGraph2.h" />
<ClInclude Include="$(RAKNET_PATH)\ConsoleServer.h" />
<ClInclude Include="$(RAKNET_PATH)\DataCompressor.h" />
<ClInclude Include="$(RAKNET_PATH)\DirectoryDeltaTransfer.h" />
<ClInclude Include="$(RAKNET_PATH)\DR_SHA1.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_BinarySearchTree.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_BPlusTree.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_BytePool.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_ByteQueue.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_Hash.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_Heap.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_HuffmanEncodingTree.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_HuffmanEncodingTreeFactory.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_HuffmanEncodingTreeNode.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_LinkedList.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_List.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_Map.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_MemoryPool.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_Multilist.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_OrderedChannelHeap.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_OrderedList.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_Queue.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_QueueLinkedList.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_RangeList.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_Table.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_ThreadsafeAllocatingQueue.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_Tree.h" />
<ClInclude Include="$(RAKNET_PATH)\DS_WeightedGraph.h" />
<ClInclude Include="$(RAKNET_PATH)\DynDNS.h" />
<ClInclude Include="$(RAKNET_PATH)\EmailSender.h" />
<ClInclude Include="$(RAKNET_PATH)\EmptyHeader.h" />
<ClInclude Include="$(RAKNET_PATH)\EpochTimeToString.h" />
<ClInclude Include="$(RAKNET_PATH)\Export.h" />
<ClInclude Include="$(RAKNET_PATH)\FileList.h" />
<ClInclude Include="$(RAKNET_PATH)\FileListNodeContext.h" />
<ClInclude Include="$(RAKNET_PATH)\FileListTransfer.h" />
<ClInclude Include="$(RAKNET_PATH)\FileListTransferCBInterface.h" />
<ClInclude Include="$(RAKNET_PATH)\FileOperations.h" />
<ClInclude Include="$(RAKNET_PATH)\FormatString.h" />
<ClInclude Include="$(RAKNET_PATH)\FullyConnectedMesh2.h" />
<ClInclude Include="$(RAKNET_PATH)\Getche.h" />
<ClInclude Include="$(RAKNET_PATH)\Gets.h" />
<ClInclude Include="$(RAKNET_PATH)\GetTime.h" />
<ClInclude Include="$(RAKNET_PATH)\gettimeofday.h" />
<ClInclude Include="$(RAKNET_PATH)\GridSectorizer.h" />
<ClInclude Include="$(RAKNET_PATH)\HTTPConnection.h" />
<ClInclude Include="$(RAKNET_PATH)\HTTPConnection2.h" />
<ClInclude Include="$(RAKNET_PATH)\IncrementalReadInterface.h" />
<ClInclude Include="$(RAKNET_PATH)\InternalPacket.h" />
<ClInclude Include="$(RAKNET_PATH)\Itoa.h" />
<ClInclude Include="$(RAKNET_PATH)\Kbhit.h" />
<ClInclude Include="$(RAKNET_PATH)\LinuxStrings.h" />
<ClInclude Include="$(RAKNET_PATH)\LocklessTypes.h" />
<ClInclude Include="$(RAKNET_PATH)\LogCommandParser.h" />
<ClInclude Include="$(RAKNET_PATH)\MessageFilter.h" />
<ClInclude Include="$(RAKNET_PATH)\MessageIdentifiers.h" />
<ClInclude Include="$(RAKNET_PATH)\MTUSize.h" />
<ClInclude Include="$(RAKNET_PATH)\NativeFeatureIncludes.h" />
<ClInclude Include="$(RAKNET_PATH)\NativeFeatureIncludesOverrides.h" />
<ClInclude Include="$(RAKNET_PATH)\NativeTypes.h" />
<ClInclude Include="$(RAKNET_PATH)\NatPunchthroughClient.h" />
<ClInclude Include="$(RAKNET_PATH)\NatPunchthroughServer.h" />
<ClInclude Include="$(RAKNET_PATH)\NatTypeDetectionClient.h" />
<ClInclude Include="$(RAKNET_PATH)\NatTypeDetectionCommon.h" />
<ClInclude Include="$(RAKNET_PATH)\NatTypeDetectionServer.h" />
<ClInclude Include="$(RAKNET_PATH)\NetworkIDManager.h" />
<ClInclude Include="$(RAKNET_PATH)\NetworkIDObject.h" />
<ClInclude Include="$(RAKNET_PATH)\PacketConsoleLogger.h" />
<ClInclude Include="$(RAKNET_PATH)\PacketFileLogger.h" />
<ClInclude Include="$(RAKNET_PATH)\PacketizedTCP.h" />
<ClInclude Include="$(RAKNET_PATH)\PacketLogger.h" />
<ClInclude Include="$(RAKNET_PATH)\PacketOutputWindowLogger.h" />
<ClInclude Include="$(RAKNET_PATH)\PacketPool.h" />
<ClInclude Include="$(RAKNET_PATH)\PacketPriority.h" />
<ClInclude Include="$(RAKNET_PATH)\PluginInterface2.h" />
<ClInclude Include="$(RAKNET_PATH)\PS3Includes.h" />
<ClInclude Include="$(RAKNET_PATH)\PS4Includes.h" />
<ClInclude Include="$(RAKNET_PATH)\Rackspace.h" />
<ClInclude Include="$(RAKNET_PATH)\RakAlloca.h" />
<ClInclude Include="$(RAKNET_PATH)\RakAssert.h" />
<ClInclude Include="$(RAKNET_PATH)\RakMemoryOverride.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetCommandParser.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetDefines.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetDefinesOverrides.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetSmartPtr.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetSocket.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetSocket2.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetStatistics.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetTime.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetTransport2.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetTypes.h" />
<ClInclude Include="$(RAKNET_PATH)\RakNetVersion.h" />
<ClInclude Include="$(RAKNET_PATH)\RakPeer.h" />
<ClInclude Include="$(RAKNET_PATH)\RakPeerInterface.h" />
<ClInclude Include="$(RAKNET_PATH)\RakSleep.h" />
<ClInclude Include="$(RAKNET_PATH)\RakString.h" />
<ClInclude Include="$(RAKNET_PATH)\RakThread.h" />
<ClInclude Include="$(RAKNET_PATH)\RakWString.h" />
<ClInclude Include="$(RAKNET_PATH)\Rand.h" />
<ClInclude Include="$(RAKNET_PATH)\RandSync.h" />
<ClInclude Include="$(RAKNET_PATH)\ReadyEvent.h" />
<ClInclude Include="$(RAKNET_PATH)\RefCountedObj.h" />
<ClInclude Include="$(RAKNET_PATH)\RelayPlugin.h" />
<ClInclude Include="$(RAKNET_PATH)\ReliabilityLayer.h" />
<ClInclude Include="$(RAKNET_PATH)\ReplicaEnums.h" />
<ClInclude Include="$(RAKNET_PATH)\ReplicaManager3.h" />
<ClInclude Include="$(RAKNET_PATH)\Router2.h" />
<ClInclude Include="$(RAKNET_PATH)\RPC4Plugin.h" />
<ClInclude Include="$(RAKNET_PATH)\SecureHandshake.h" />
<ClInclude Include="$(RAKNET_PATH)\SendToThread.h" />
<ClInclude Include="$(RAKNET_PATH)\SignaledEvent.h" />
<ClInclude Include="$(RAKNET_PATH)\SimpleMutex.h" />
<ClInclude Include="$(RAKNET_PATH)\SimpleTCPServer.h" />
<ClInclude Include="$(RAKNET_PATH)\SingleProducerConsumer.h" />
<ClInclude Include="$(RAKNET_PATH)\SocketDefines.h" />
<ClInclude Include="$(RAKNET_PATH)\SocketIncludes.h" />
<ClInclude Include="$(RAKNET_PATH)\SocketLayer.h" />
<ClInclude Include="$(RAKNET_PATH)\StatisticsHistory.h" />
<ClInclude Include="$(RAKNET_PATH)\StringCompressor.h" />
<ClInclude Include="$(RAKNET_PATH)\StringTable.h" />
<ClInclude Include="$(RAKNET_PATH)\SuperFastHash.h" />
<ClInclude Include="$(RAKNET_PATH)\TableSerializer.h" />
<ClInclude Include="$(RAKNET_PATH)\TCPInterface.h" />
<ClInclude Include="$(RAKNET_PATH)\TeamBalancer.h" />
<ClInclude Include="$(RAKNET_PATH)\TeamManager.h" />
<ClInclude Include="$(RAKNET_PATH)\TelnetTransport.h" />
<ClInclude Include="$(RAKNET_PATH)\ThreadPool.h" />
<ClInclude Include="$(RAKNET_PATH)\ThreadsafePacketLogger.h" />
<ClInclude Include="$(RAKNET_PATH)\TransportInterface.h" />
<ClInclude Include="$(RAKNET_PATH)\TwoWayAuthentication.h" />
<ClInclude Include="$(RAKNET_PATH)\UDPForwarder.h" />
<ClInclude Include="$(RAKNET_PATH)\UDPProxyClient.h" />
<ClInclude Include="$(RAKNET_PATH)\UDPProxyCommon.h" />
<ClInclude Include="$(RAKNET_PATH)\UDPProxyCoordinator.h" />
<ClInclude Include="$(RAKNET_PATH)\UDPProxyServer.h" />
<ClInclude Include="$(RAKNET_PATH)\VariableDeltaSerializer.h" />
<ClInclude Include="$(RAKNET_PATH)\VariableListDeltaTracker.h" />
<ClInclude Include="$(RAKNET_PATH)\VariadicSQLParser.h" />
<ClInclude Include="$(RAKNET_PATH)\VitaIncludes.h" />
<ClInclude Include="$(RAKNET_PATH)\WindowsIncludes.h" />
<ClInclude Include="$(RAKNET_PATH)\WSAStartupSingleton.h" />
<ClInclude Include="$(RAKNET_PATH)\XBox360Includes.h" />
<ClInclude Include="$(RAKNET_PATH)\_FindFirst.h" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\Entity.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\FallingTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\ItemEntity.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\LocalPlayer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\Mob.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\Player.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\PrimedTnt.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\entity\TripodCamera.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\gamemode\CreativeMode.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\gamemode\GameMode.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\gamemode\SurvivalMode.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\CameraItem.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\DoorItem.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\Inventory.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\Item.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\ItemInstance.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\TileItem.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\item\TilePlanterItem.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\Dimension.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\Explosion.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\Level.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\biome\Biome.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\biome\BiomeSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\chunk\ChunkCache.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\chunk\ChunkSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\chunk\LevelChunk.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\chunk\PerformanceTestChunkSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\chunk\RandomLevelSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\chunk\TestChunkSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\feature\Feature.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\feature\LargeCaveFeature.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\feature\LargeFeature.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\synth\ImprovedNoise.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\synth\PerlinNoise.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\levelgen\synth\Synth.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\LevelListener.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\Material.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\Region.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\ChunkStorage.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\ExternalFileLevelStorage.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\ExternalFileLevelStorageSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\LevelData.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\LevelSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\LevelStorage.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\LevelStorageSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\MemoryChunkStorage.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\MemoryLevelStorage.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\MemoryLevelStorageSource.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\storage\RegionFile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\level\TickNextTickData.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\particle\Particle.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\particle\ParticleEngine.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\phys\AABB.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\phys\HitResult.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\phys\Vec3.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\BookshelfTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\Bush.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\ClayTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\ClothTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\DirtTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\DoorTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\FarmTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\FireTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\GlassTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\GrassTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\GravelTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\HalfTransparentTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\IceTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\InvisibleTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\LadderTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\LeafTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\LiquidTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\LiquidTileDynamic.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\LiquidTileStatic.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\MetalTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\ObsidianTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\OreTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\RedStoneOreTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\ReedTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\SandStoneTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\SandTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\Sapling.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\SpongeTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\StairTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\StoneSlabTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\StoneTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\Tile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\TntTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\TopSnowTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\TorchTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\TransparentTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\TreeTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\world\tile\WireTile.hpp" />
<ClInclude Include="$(MC_ROOT)\source\network\MinecraftPackets.hpp" />
<ClInclude Include="$(MC_ROOT)\source\network\NetEventCallback.hpp" />
<ClInclude Include="$(MC_ROOT)\source\network\Packet.hpp" />
<ClInclude Include="$(MC_ROOT)\source\network\PingedCompatibleServer.hpp" />
<ClInclude Include="$(MC_ROOT)\source\network\RakNetInstance.hpp" />
<ClInclude Include="$(MC_ROOT)\source\network\ServerSideNetworkHandler.hpp" />
<ClInclude Include="$(MC_ROOT)\platforms\android\AppPlatform_android.hpp" />
<ClInclude Include="android_native_app_glue.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(MC_ROOT)\source\client\app\App.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\app\AppPlatform.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\app\Minecraft.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\app\NinecraftApp.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\AvailableGamesList.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\Button.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\RolledSelectionList.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\ScrolledSelectionList.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\SmallButton.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\TextInputBox.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\components\WorldSelectionList.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\Gui.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\GuiComponent.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\Screen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\ChatScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\ConfirmScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\CreateWorldScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\DeathScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\DeleteWorldScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\DirectConnectScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\IngameBlockSelectionScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\InvalidLicenseScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\JoinGameScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\OptionsScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\PauseScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\ProgressScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\RenameMPLevelScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\SavingWorldScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\SelectWorldScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\gui\screens\StartMenuScreen.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\model\Cube.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\model\HumanoidModel.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\model\Model.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\model\PolygonQuad.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\network\ClientSideNetworkHandler.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\options\Options.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\Controller.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\ControllerTurnInput.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\ITurnInput.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\Keyboard.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\KeyboardInput.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\Mouse.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\MouseTurnInput.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\Chunk.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\Culler.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\DynamicTexture.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\EntityRenderDispatcher.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\EntityRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\FallingTileRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\HumanoidMobRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\ItemRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\ItemSpriteRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\MobRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\TntRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\entity\TripodCameraRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\FireTexture.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\Font.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\Frustum.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\FrustumCuller.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\GameRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\ItemInHandRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\LavaSideTexture.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\LavaTexture.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\LevelRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\LightLayer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\LightUpdate.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\PatchManager.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\RenderChunk.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\RenderList.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\Tesselator.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\Textures.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\TileRenderer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\WaterSideTexture.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\renderer\WaterTexture.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\sound\SoundData.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\sound\SoundEngine.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\sound\SoundRepository.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\sound\SoundSystem.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\IBuildInput.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\IncludeExcludeArea.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\MouseHandler.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\PolygonArea.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\RectangleArea.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\MouseDevice.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\Multitouch.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\CustomInputHolder.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\IInputHolder.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\IMoveInput.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\ITouchScreenModel.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\TouchAreaModel.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\TouchInputHolder.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\TouchscreenInput_TestFps.cpp" />
<ClCompile Include="$(MC_ROOT)\source\client\player\input\UnifiedTurnBuild.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\CThread.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Logger.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Matrix.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Mth.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Random.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Timer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Util.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\Utils.cpp" />
<ClCompile Include="$(MC_ROOT)\source\common\SmoothFloat.cpp" />
<ClCompile Include="$(MC_ROOT)\thirdparty\GL\GLExt.cpp" />
<ClCompile Include="$(RAKNET_PATH)\Base64Encoder.cpp" />
<ClCompile Include="$(RAKNET_PATH)\BitStream.cpp" />
<ClCompile Include="$(RAKNET_PATH)\CCRakNetSlidingWindow.cpp" />
<ClCompile Include="$(RAKNET_PATH)\CCRakNetUDT.cpp" />
<ClCompile Include="$(RAKNET_PATH)\CheckSum.cpp" />
<ClCompile Include="$(RAKNET_PATH)\CloudClient.cpp" />
<ClCompile Include="$(RAKNET_PATH)\CloudCommon.cpp" />
<ClCompile Include="$(RAKNET_PATH)\CloudServer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\CommandParserInterface.cpp" />
<ClCompile Include="$(RAKNET_PATH)\ConnectionGraph2.cpp" />
<ClCompile Include="$(RAKNET_PATH)\ConsoleServer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\DataCompressor.cpp" />
<ClCompile Include="$(RAKNET_PATH)\DirectoryDeltaTransfer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\DR_SHA1.cpp" />
<ClCompile Include="$(RAKNET_PATH)\DS_BytePool.cpp" />
<ClCompile Include="$(RAKNET_PATH)\DS_ByteQueue.cpp" />
<ClCompile Include="$(RAKNET_PATH)\DS_HuffmanEncodingTree.cpp" />
<ClCompile Include="$(RAKNET_PATH)\DS_Table.cpp" />
<ClCompile Include="$(RAKNET_PATH)\DynDNS.cpp" />
<ClCompile Include="$(RAKNET_PATH)\EmailSender.cpp" />
<ClCompile Include="$(RAKNET_PATH)\EpochTimeToString.cpp" />
<ClCompile Include="$(RAKNET_PATH)\FileList.cpp" />
<ClCompile Include="$(RAKNET_PATH)\FileListTransfer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\FileOperations.cpp" />
<ClCompile Include="$(RAKNET_PATH)\FormatString.cpp" />
<ClCompile Include="$(RAKNET_PATH)\FullyConnectedMesh2.cpp" />
<ClCompile Include="$(RAKNET_PATH)\Getche.cpp" />
<ClCompile Include="$(RAKNET_PATH)\Gets.cpp" />
<ClCompile Include="$(RAKNET_PATH)\GetTime.cpp" />
<ClCompile Include="$(RAKNET_PATH)\gettimeofday.cpp" />
<ClCompile Include="$(RAKNET_PATH)\GridSectorizer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\HTTPConnection.cpp" />
<ClCompile Include="$(RAKNET_PATH)\HTTPConnection2.cpp" />
<ClCompile Include="$(RAKNET_PATH)\IncrementalReadInterface.cpp" />
<ClCompile Include="$(RAKNET_PATH)\Itoa.cpp" />
<ClCompile Include="$(RAKNET_PATH)\LinuxStrings.cpp" />
<ClCompile Include="$(RAKNET_PATH)\LocklessTypes.cpp" />
<ClCompile Include="$(RAKNET_PATH)\LogCommandParser.cpp" />
<ClCompile Include="$(RAKNET_PATH)\MessageFilter.cpp" />
<ClCompile Include="$(RAKNET_PATH)\NatPunchthroughClient.cpp" />
<ClCompile Include="$(RAKNET_PATH)\NatPunchthroughServer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\NatTypeDetectionClient.cpp" />
<ClCompile Include="$(RAKNET_PATH)\NatTypeDetectionCommon.cpp" />
<ClCompile Include="$(RAKNET_PATH)\NatTypeDetectionServer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\NetworkIDManager.cpp" />
<ClCompile Include="$(RAKNET_PATH)\NetworkIDObject.cpp" />
<ClCompile Include="$(RAKNET_PATH)\PacketConsoleLogger.cpp" />
<ClCompile Include="$(RAKNET_PATH)\PacketFileLogger.cpp" />
<ClCompile Include="$(RAKNET_PATH)\PacketizedTCP.cpp" />
<ClCompile Include="$(RAKNET_PATH)\PacketLogger.cpp" />
<ClCompile Include="$(RAKNET_PATH)\PacketOutputWindowLogger.cpp" />
<ClCompile Include="$(RAKNET_PATH)\PluginInterface2.cpp" />
<ClCompile Include="$(RAKNET_PATH)\PS4Includes.cpp" />
<ClCompile Include="$(RAKNET_PATH)\Rackspace.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakMemoryOverride.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetCommandParser.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_360_720.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_Berkley.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_Berkley_NativeClient.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_NativeClient.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_PS3_PS4.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_PS4.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_Vita.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_WindowsStore8.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_Windows_Linux.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetSocket2_Windows_Linux_360.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetStatistics.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetTransport2.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakNetTypes.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakPeer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakSleep.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakString.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakThread.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RakWString.cpp" />
<ClCompile Include="$(RAKNET_PATH)\Rand.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RandSync.cpp" />
<ClCompile Include="$(RAKNET_PATH)\ReadyEvent.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RelayPlugin.cpp" />
<ClCompile Include="$(RAKNET_PATH)\ReliabilityLayer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\ReplicaManager3.cpp" />
<ClCompile Include="$(RAKNET_PATH)\Router2.cpp" />
<ClCompile Include="$(RAKNET_PATH)\RPC4Plugin.cpp" />
<ClCompile Include="$(RAKNET_PATH)\SecureHandshake.cpp" />
<ClCompile Include="$(RAKNET_PATH)\SendToThread.cpp" />
<ClCompile Include="$(RAKNET_PATH)\SignaledEvent.cpp" />
<ClCompile Include="$(RAKNET_PATH)\SimpleMutex.cpp" />
<ClCompile Include="$(RAKNET_PATH)\SocketLayer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\StatisticsHistory.cpp" />
<ClCompile Include="$(RAKNET_PATH)\StringCompressor.cpp" />
<ClCompile Include="$(RAKNET_PATH)\StringTable.cpp" />
<ClCompile Include="$(RAKNET_PATH)\SuperFastHash.cpp" />
<ClCompile Include="$(RAKNET_PATH)\TableSerializer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\TCPInterface.cpp" />
<ClCompile Include="$(RAKNET_PATH)\TeamBalancer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\TeamManager.cpp" />
<ClCompile Include="$(RAKNET_PATH)\TelnetTransport.cpp" />
<ClCompile Include="$(RAKNET_PATH)\ThreadsafePacketLogger.cpp" />
<ClCompile Include="$(RAKNET_PATH)\TwoWayAuthentication.cpp" />
<ClCompile Include="$(RAKNET_PATH)\UDPForwarder.cpp" />
<ClCompile Include="$(RAKNET_PATH)\UDPProxyClient.cpp" />
<ClCompile Include="$(RAKNET_PATH)\UDPProxyCoordinator.cpp" />
<ClCompile Include="$(RAKNET_PATH)\UDPProxyServer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\VariableDeltaSerializer.cpp" />
<ClCompile Include="$(RAKNET_PATH)\VariableListDeltaTracker.cpp" />
<ClCompile Include="$(RAKNET_PATH)\VariadicSQLParser.cpp" />
<ClCompile Include="$(RAKNET_PATH)\VitaIncludes.cpp" />
<ClCompile Include="$(RAKNET_PATH)\WSAStartupSingleton.cpp" />
<ClCompile Include="$(RAKNET_PATH)\_FindFirst.cpp" />
<ClCompile Include="$(MC_ROOT)\source\renderer\GL\GL.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\Entity.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\FallingTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\ItemEntity.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\LocalPlayer.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\Mob.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\Player.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\PrimedTnt.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\entity\TripodCamera.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\gamemode\CreativeMode.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\gamemode\GameMode.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\gamemode\SurvivalMode.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\CameraItem.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\DoorItem.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\Inventory.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\Item.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\ItemInstance.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\TileItem.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\item\TilePlanterItem.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\Dimension.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\Explosion.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\Level.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\biome\Biome.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\biome\BiomeSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\chunk\ChunkCache.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\chunk\ChunkSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\chunk\LevelChunk.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\chunk\PerformanceTestChunkSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\chunk\RandomLevelSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\chunk\TestChunkSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\BirchFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\ClayFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\Feature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\FlowerFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\LargeCaveFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\LargeFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\OreFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\PineFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\ReedsFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\SpringFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\SpruceFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\feature\TreeFeature.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\synth\ImprovedNoise.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\synth\PerlinNoise.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\levelgen\synth\Synth.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\LevelListener.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\Material.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\Region.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\ChunkStorage.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\ExternalFileLevelStorage.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\ExternalFileLevelStorageSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\LevelData.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\LevelSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\LevelStorage.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\LevelStorageSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\MemoryChunkStorage.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\MemoryLevelStorage.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\MemoryLevelStorageSource.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\storage\RegionFile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\level\TickNextTickData.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\BubbleParticle.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\ExplodeParticle.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\FlameParticle.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\LavaParticle.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\Particle.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\ParticleEngine.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\RedDustParticle.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\SmokeParticle.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\particle\TerrainParticle.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\phys\AABB.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\phys\HitResult.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\phys\Vec3.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\BookshelfTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\Bush.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\ClayTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\ClothTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\DirtTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\DoorTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\FarmTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\FireTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\GlassTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\GrassTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\GravelTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\HalfTransparentTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\IceTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\InvisibleTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\LadderTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\LeafTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\LiquidTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\LiquidTileDynamic.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\LiquidTileStatic.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\MetalTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\ObsidianTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\OreTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\RedStoneOreTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\ReedTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\SandStoneTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\SandTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\Sapling.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\SpongeTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\StairTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\StoneSlabTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\StoneTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\Tile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\TntTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\TopSnowTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\TorchTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\TransparentTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\TreeTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\world\tile\WireTile.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\MinecraftPackets.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\NetEventCallback.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\AddPlayerPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\ChunkDataPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\LevelDataPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\LoginPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\MessagePacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\MovePlayerPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\PlaceBlockPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\PlayerEquipmentPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\RemoveBlockPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\RemoveEntityPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\RequestChunkPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\StartGamePacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\packets\UpdateBlockPacket.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\RakNetInstance.cpp" />
<ClCompile Include="$(MC_ROOT)\source\network\ServerSideNetworkHandler.cpp" />
<ClCompile Include="$(MC_ROOT)\platforms\android\AppPlatform_android.cpp" />
<ClCompile Include="$(MC_ROOT)\thirdparty\stb_image_impl.c" />
<ClCompile Include="android_native_app_glue.c" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Changes made to Package Name should also be reflected in the Debugging - Package Name property, in the Property Pages -->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.reminecraftpe"
android:versionCode="1"
android:versionName="1.0">
<!-- This is the platform API where NativeActivity was introduced. -->
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="22"/>
<!-- This .apk has no Java code itself, so set hasCode to false. -->
<application android:label="@string/app_name" android:hasCode="false">
<!-- Our activity is the built-in NativeActivity framework class.
This will take care of integrating with our NDK code. -->
<activity android:name="android.app.NativeActivity"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
android:label="@string/app_name"
android:configChanges="orientation|keyboardHidden"
android:screenOrientation="landscape">
<!-- Tell NativeActivity the name of our .so -->
<meta-data android:name="android.app.lib_name"
android:value="$(AndroidAppLibName)" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros">
<MC_ROOT>$(ProjectDir)..\..\..\..\</MC_ROOT>
</PropertyGroup>
<PropertyGroup />
<ItemDefinitionGroup />
<ItemGroup>
<BuildMacro Include="MC_ROOT">
<Value>$(MC_ROOT)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="$(projectname)" default="help">
<!-- The ant.properties file can be created by you. It is only edited by the
'android' tool to add properties to it.
This is the place to change some Ant specific build properties.
Here are some properties you may want to change/update:
source.dir
The name of the source directory. Default is 'src'.
out.dir
The name of the output directory. Default is 'bin'.
For other overridable properties, look at the beginning of the rules
files in the SDK, at tools/ant/build.xml
Properties related to the SDK location or the project target should
be updated using the 'android' tool with the 'update' action.
This file is an integral part of the build system for your
application and should be checked into Version Control Systems.
-->
<property file="ant.properties" />
<!-- if sdk.dir was not set from one of the property file, then
get it from the ANDROID_HOME env var. -->
<property environment="env" />
<condition property="sdk.dir" value="${env.ANDROID_HOME}">
<isset property="env.ANDROID_HOME" />
</condition>
<!-- The project.properties file contains project specific properties such as
project target, and library dependencies. Lower level build properties are
stored in ant.properties
This file is an integral part of the build system for your
application and should be checked into Version Control Systems. -->
<loadproperties srcFile="project.properties" />
<!-- quick check on sdk.dir -->
<fail
message="sdk.dir is missing. Make sure ANDROID_HOME environment variable is correctly set."
unless="sdk.dir"
/>
<!--
Import per project custom build rules if present at the root of the project.
This is the place to put custom intermediary targets such as:
-pre-build
-pre-compile
-post-compile (This is typically used for code obfuscation.
Compiled code location: ${out.classes.absolute.dir}
If this is not done in place, override ${out.dex.input.absolute.dir})
-post-package
-post-build
-pre-clean
-->
<import file="custom_rules.xml" optional="true" />
<!-- Import the actual build file.
To customize existing targets, there are two options:
- Customize only one target:
- copy/paste the target into this file, *before* the
<import> task.
- customize it to your needs.
- Customize the whole content of build.xml
- copy/paste the content of the rules files (minus the top node)
into this file, replacing the <import> task.
- customize to your needs.
***********************
****** IMPORTANT ******
***********************
In all cases you must update the value of version-tag below to read 'custom' instead of an integer,
in order to avoid having your file be overridden by tools such as "android update project"
-->
<!-- version-tag: 1 -->
<import file="${sdk.dir}/tools/ant/build.xml" />
<target name="-pre-compile">
<path id="project.all.jars.path">
<path path="${toString:project.all.jars.path}"/>
<fileset dir="${jar.libs.dir}">
<include name="*.jar"/>
</fileset>
</path>
</target>
</project>

View File

@@ -0,0 +1,207 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
<Configuration>Debug</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM">
<Configuration>Release</Configuration>
<Platform>ARM</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<RootNamespace>minecraftcpp</RootNamespace>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
<ProjectVersion>1.0</ProjectVersion>
<ProjectGuid>{638896b6-8eac-47d8-bfd8-6b74f88322cf}</ProjectGuid>
</PropertyGroup>
<Import Project="$(AndroidTargetsPath)\Android.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'" Label="Configuration">
<UseDebugLibraries>true</UseDebugLibraries>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'" Label="Configuration">
<UseDebugLibraries>false</UseDebugLibraries>
<ConfigurationType>Application</ConfigurationType>
</PropertyGroup>
<Import Project="$(AndroidTargetsPath)\Android.props" />
<ImportGroup Label="ExtensionSettings" />
<ImportGroup Label="Shared" />
<PropertyGroup Label="UserMacros" />
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="PropertySheet.props" />
</ImportGroup>
<PropertyGroup />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<AntPackage>
<AndroidAppLibName>$(RootNamespace)</AndroidAppLibName>
</AntPackage>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<AntPackage>
<AndroidAppLibName>$(RootNamespace)</AndroidAppLibName>
</AntPackage>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
<AntPackage>
<AndroidAppLibName>$(RootNamespace)</AndroidAppLibName>
<AntTarget>debug</AntTarget>
</AntPackage>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
<AntPackage>
<AndroidAppLibName>$(RootNamespace)</AndroidAppLibName>
</AntPackage>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AntPackage>
<AndroidAppLibName>$(RootNamespace)</AndroidAppLibName>
</AntPackage>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AntPackage>
<AndroidAppLibName>$(RootNamespace)</AndroidAppLibName>
</AntPackage>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<AntPackage>
<AndroidAppLibName>$(RootNamespace)</AndroidAppLibName>
</AntPackage>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AntPackage>
<AndroidAppLibName>$(RootNamespace)</AndroidAppLibName>
</AntPackage>
</ItemDefinitionGroup>
<ItemGroup>
<Content Include="assets/icon.png" />
<Content Include="assets/particles.png" />
<Content Include="assets/readme.txt" />
<Content Include="assets/terrain.png" />
<Content Include="assets/environment/clouds.png" />
<Content Include="assets/font/default.png" />
<Content Include="assets/gui/background.png" />
<Content Include="assets/gui/default_world.png" />
<Content Include="assets/gui/feedback_fill.png" />
<Content Include="assets/gui/feedback_outer.png" />
<Content Include="assets/gui/gui.png" />
<Content Include="assets/gui/gui_blocks.png" />
<Content Include="assets/gui/icons.png" />
<Content Include="assets/gui/items.png" />
<Content Include="assets/gui/raknet.png" />
<Content Include="assets/gui/title.png" />
<Content Include="assets/gui/background/panorama_0.png" />
<Content Include="assets/gui/background/panorama_1.png" />
<Content Include="assets/gui/background/panorama_2.png" />
<Content Include="assets/gui/background/panorama_3.png" />
<Content Include="assets/gui/background/panorama_4.png" />
<Content Include="assets/gui/background/panorama_5.png" />
<Content Include="assets/item/camera.png" />
<Content Include="assets/mob/char.png" />
<Content Include="assets/patches/a_cryingobsidian.png" />
<Content Include="assets/patches/c_bricks.png" />
<Content Include="assets/patches/c_cloth.png" />
<Content Include="assets/patches/c_emerald.png" />
<Content Include="assets/patches/c_glass.png" />
<Content Include="assets/patches/c_gold.png" />
<Content Include="assets/patches/c_grass_top.png" />
<Content Include="assets/patches/c_iron.png" />
<Content Include="assets/patches/c_i_coal.png" />
<Content Include="assets/patches/c_i_emerald.png" />
<Content Include="assets/patches/c_i_gold.png" />
<Content Include="assets/patches/c_i_iron.png" />
<Content Include="assets/patches/c_leaves_opa.png" />
<Content Include="assets/patches/c_leaves_tra.png" />
<Content Include="assets/patches/c_rose.png" />
<Content Include="assets/patches/patch_data.txt" />
<Content Include="res\values\strings.xml" />
<AntBuildXml Include="build.xml" />
<AndroidManifest Include="AndroidManifest.xml" />
<AntProjectPropertiesFile Include="project.properties" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\minecraftcpp.NativeActivity\minecraftcpp.NativeActivity.vcxproj">
<Project>{c381c7af-d139-41e9-a742-6b0006e25d64}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(AndroidTargetsPath)\Android.targets" />
<ImportGroup Label="ExtensionTargets" />
</Project>

View File

@@ -0,0 +1,3 @@
# Project target
target=$(androidapilevel)
# Provide path to the directory where prebuilt external jar files are by setting jar.libs.dir=

View File

@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ReMinecraftPE</string>
</resources>

View File

@@ -28,7 +28,7 @@ public:
Texture loadTexture(const std::string& path, bool b = false) override = 0;
int getUserInputStatus() override;
SoundSystem* const getSoundSystem() const override { return m_pSoundSystem; }
// Also add these to allow proper turning within the game.
void setMouseGrabbed(bool b) override;
void setMouseDiff(int x, int y);

View File

@@ -140,6 +140,19 @@ bool AppPlatform::shiftPressed()
return false;
}
void AppPlatform::showKeyboard(bool bShown)
{
}
void AppPlatform::onHideKeyboard()
{
}
int AppPlatform::getKeyboardUpOffset()
{
return 0;
}
bool AppPlatform::hasFileSystemAccess()
{
return false;

View File

@@ -59,6 +59,10 @@ public:
virtual void updateFocused(bool focused);
// Also add this to allow proper text input within the game.
virtual bool shiftPressed();
virtual void showKeyboard(bool bShown);
virtual void onHideKeyboard(); // called by the runner, not the game
virtual int getKeyboardUpOffset();
virtual bool hasFileSystemAccess();
// Also add this to allow dynamic patching.
virtual std::string getPatchData();

View File

@@ -523,7 +523,7 @@ void Minecraft::tickInput()
// We are instead keyboard operated, so check for the KM_DESTROY key being held down
(!m_options->field_19 && Keyboard::isKeyDown(m_options->m_keyMappings[KM_DESTROY].value)) ||
// The build action intention is a remove one
b && bai.isRemove());
(b && bai.isRemove()));
if (flag && !m_pScreen && (field_DA8 - field_DAC) >= (m_timer.m_ticksPerSecond * 0.25f))
{
@@ -868,7 +868,7 @@ void Minecraft::prepareLevel(const std::string& unused)
float time1 = getTimeS();
// generating all the chunks at once
TileID unused = m_pLevel->getTile(i, (C_MAX_Y + C_MIN_Y) / 2, j);
(void) m_pLevel->getTile(i, (C_MAX_Y + C_MIN_Y) / 2, j);
if (time1 != -1.0f)
getTimeS();
@@ -993,8 +993,7 @@ void Minecraft::generateLevel(const std::string& unused, Level* pLevel)
if (time != -1.0f)
getTimeS(); //@QUIRK: unused return value
#pragma warning(disable : 26444) // C26444: Don't try to declare a local variable with no name.
std::string("Level generated: "); //@QUIRK: unused string instance
// std::string("Level generated: "); //@QUIRK: unused string instance
LocalPlayer* pLocalPlayer = m_pLocalPlayer;
if (!pLocalPlayer)

View File

@@ -28,13 +28,18 @@ bool NinecraftApp::handleBack(bool b)
{
if (!m_pScreen)
return false;
return m_pScreen->handleBackEvent(b);
}
if (b)
return 1;
if (!m_pScreen) return false;
if (!m_pScreen)
{
pauseGame();
return false;
}
if (m_pScreen->handleBackEvent(b))
return true;
@@ -45,8 +50,6 @@ bool NinecraftApp::handleBack(bool b)
void NinecraftApp::initGLStates()
{
GL_TEXTURE_2D;
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glEnable(GL_ALPHA_TEST);
@@ -55,6 +58,7 @@ void NinecraftApp::initGLStates()
glEnable(GL_TEXTURE_2D);
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_FASTEST);
glDisable(GL_LIGHTING);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
}
int NinecraftApp::getFpsIntlCounter()
@@ -110,11 +114,6 @@ void NinecraftApp::update()
++m_fps;
Multitouch::commit();
Minecraft::update();
#ifdef ORIGINAL_CODE
eglSwapBuffers(field_8, m_rotY);
#endif
Mouse::reset2();
updateStats();
}

View File

@@ -417,7 +417,7 @@ int Gui::getSlotIdAt(int mouseX, int mouseY)
if (slotX >= 0)
slotX--;
if (slotX > getNumSlots())
if (slotX >= getNumSlots())
slotX = -1;
return slotX;

View File

@@ -15,6 +15,7 @@ class GuiComponent
{
public:
GuiComponent();
virtual ~GuiComponent() {}
void blit(int dstX, int dstY, int srcX, int srcY, int dstWidth, int dstHeight, int srcWidth, int srcHeight);
void drawCenteredString(Font*, const std::string&, int cx, int cy, int color);

View File

@@ -15,6 +15,7 @@ Screen::Screen()
field_10 = false;
m_tabButtonIndex = 0;
m_pClickedButton = 0;
m_yOffset = -1;
}
Screen::~Screen()
@@ -253,6 +254,25 @@ void Screen::mouseClicked(int xPos, int yPos, int d) // d = clicked?
TextInputBox* textInput = m_textInputs[i];
textInput->onClick(xPos, yPos);
}
// if the keyboard is shown:
if (m_pMinecraft->platform()->getKeyboardUpOffset())
{
// if there are none focused at the moment:
bool areAnyFocused = false;
for (int i = 0; i < int(m_textInputs.size()); i++)
{
TextInputBox* textInput = m_textInputs[i];
if (textInput->m_bFocused)
{
areAnyFocused = true;
break;
}
}
if (!areAnyFocused)
m_pMinecraft->platform()->showKeyboard(false);
}
#endif
}
@@ -306,6 +326,59 @@ void Screen::setSize(int width, int height)
init();
}
void Screen::onRender(int mouseX, int mouseY, float f)
{
m_yOffset = getYOffset();
if (m_yOffset != 0) {
// push the entire screen up
glPushMatrix();
glTranslatef(0.0f, -float(m_yOffset), 0.0f);
}
render(mouseX, mouseY, f);
if (m_yOffset != 0)
glPopMatrix();
}
int Screen::getYOffset()
{
int keybOffset = m_pMinecraft->platform()->getKeyboardUpOffset();
if (!keybOffset)
return 0;
int offset = 0;
// look through every text box, see if one's open
// and determine its offset from there
for (int i = 0; i < int(m_textInputs.size()); i++)
{
TextInputBox* pBox = m_textInputs[i];
if (!pBox->m_bFocused)
continue;
int heightLeft = m_height - int(float(keybOffset) * Gui::InvGuiScale);
// we want to keep the center of the text box in the center of the screen
int textCenterY = pBox->m_yPos + pBox->m_height / 2;
int scrnCenterY = heightLeft / 2;
int diff = textCenterY - scrnCenterY;
// Prevent the difference from revealing the outside of the screen.
if (diff > m_height - heightLeft)
diff = m_height - heightLeft;
if (diff < 0)
diff = 0;
offset = diff;
break;
}
return offset;
}
void Screen::updateEvents()
{
if (field_10) return;
@@ -329,9 +402,9 @@ void Screen::mouseEvent()
if (pAction->isButton())
{
if (Mouse::getEventButtonState())
mouseClicked (m_width * pAction->_posX / Minecraft::width, m_height * pAction->_posY / Minecraft::height - 1, Mouse::getEventButton());
mouseClicked (m_width * pAction->_posX / Minecraft::width, m_height * pAction->_posY / Minecraft::height - 1 + getYOffset(), Mouse::getEventButton());
else
mouseReleased(m_width * pAction->_posX / Minecraft::width, m_height * pAction->_posY / Minecraft::height - 1, Mouse::getEventButton());
mouseReleased(m_width * pAction->_posX / Minecraft::width, m_height * pAction->_posY / Minecraft::height - 1 + getYOffset(), Mouse::getEventButton());
}
}
@@ -339,7 +412,9 @@ void Screen::renderBackground(int unk)
{
if (m_pMinecraft->isLevelGenerated())
{
fillGradient(0, 0, m_width, m_height, 0xC0101010, 0xD0101010);
// draw the background offset by the Y offset so that the smaller virtual
// keyboards don't reveal undrawn areas
fillGradient(0, m_yOffset, m_width, m_height, 0xC0101010, 0xD0101010);
}
else
{
@@ -361,11 +436,13 @@ void Screen::renderDirtBackground(int unk)
Tesselator& t = Tesselator::instance;
t.begin();
t.offset(0, m_yOffset, 0);
t.color(0x404040);
t.vertexUV(0.0f, float(m_height), 0, 0, float(unk) + float(m_height) / 32.0f);
t.vertexUV(float(m_width), float(m_height), 0, float(m_width) / 32.0f, float(unk) + float(m_height) / 32.0f);
t.vertexUV(float(m_width), 0, 0, float(m_width) / 32.0f, float(unk) + 0.0f);
t.vertexUV(0.0f, 0, 0, 0, float(unk) + 0.0f);
t.offset(0, 0, 0);
t.draw();
}

View File

@@ -14,6 +14,7 @@
#include "components/TextInputBox.hpp"
class Button;
class TextInputBox;
class Screen : public GuiComponent
{
@@ -24,6 +25,8 @@ public:
void init(Minecraft*, int, int);
void updateTabButtonSelection();
void setSize(int width, int height);
void onRender(int mouseX, int mouseY, float f);
int getYOffset();
virtual void render(int, int, float);
virtual void init();
@@ -62,6 +65,7 @@ public:
#ifndef ORIGINAL_CODE
std::vector<TextInputBox*> m_textInputs;
int m_yOffset;
#endif
};

View File

@@ -15,6 +15,7 @@ class ScrolledSelectionList : public GuiComponent
{
public:
ScrolledSelectionList(Minecraft*, int, int, int, int, int);
virtual ~ScrolledSelectionList() {}
virtual void setRenderSelection(bool);
virtual int getNumberOfItems() = 0;

View File

@@ -10,7 +10,11 @@
#include "client/app/Minecraft.hpp"
#ifndef ORIGINAL_CODE
TextInputBox::TextInputBox(int id, int x, int y, int width, int height, const std::string& placeholder, const std::string& text)
#ifdef __ANDROID__
#define HANDLE_CHARS_SEPARATELY // faked though, see platforms/android/minecraftcpp/minecraftcpp.NativeActivity/main.cpp
#endif
TextInputBox::TextInputBox(Screen* parent, int id, int x, int y, int width, int height, const std::string& placeholder, const std::string& text)
{
m_ID = id;
m_xPos = x;
@@ -25,6 +29,7 @@ TextInputBox::TextInputBox(int id, int x, int y, int width, int height, const st
m_insertHead = 0;
m_lastFlashed = 0;
m_pFont = nullptr;
m_pParent = parent;
}
void TextInputBox::init(Font* pFont)
@@ -185,7 +190,12 @@ void TextInputBox::setFocused(bool b)
m_lastFlashed = getTimeMs();
m_bCursorOn = true;
m_insertHead = int(m_text.size());
m_pParent->m_pMinecraft->platform()->showKeyboard(true);
}
// don't actually hide the keyboard when unfocusing
// - we may be undoing the work of another text box
}
void TextInputBox::onClick(int x, int y)

View File

@@ -9,8 +9,10 @@
#pragma once
#include "../GuiComponent.hpp"
#include "../Screen.hpp"
#include "common/Utils.hpp"
class Screen;
class Minecraft;
// @NOTE: This is NOT original Mojang code.
@@ -20,7 +22,7 @@ class Minecraft;
class TextInputBox : public GuiComponent
{
public:
TextInputBox(int id, int x, int y, int width = 200, int height = 12, const std::string& placeholder = "", const std::string& text = "");
TextInputBox(Screen*, int id, int x, int y, int width = 200, int height = 12, const std::string& placeholder = "", const std::string& text = "");
void init(Font* pFont);
void setEnabled(bool bEnabled);
@@ -46,6 +48,7 @@ public:
int m_insertHead;
int m_lastFlashed;
Font* m_pFont;
Screen* m_pParent;
};
#endif

View File

@@ -10,7 +10,7 @@
// @NOTE: This is unused.
ChatScreen::ChatScreen(bool slash) : m_textChat(1, 0, 0), m_btnSend(2, 0, 0, "Send")
ChatScreen::ChatScreen(bool slash) : m_textChat(this, 1, 0, 0), m_btnSend(2, 0, 0, "Send")
{
if (slash)
m_textChat.m_text = "/";

View File

@@ -9,22 +9,22 @@
#include "ConfirmScreen.hpp"
ConfirmScreen::ConfirmScreen(Screen* pScreen, const std::string& line1, const std::string& line2, int x) :
m_btnOK (0, 0, 0, "Ok"),
m_btnCancel(1, 0, 0, "Cancel"),
m_pScreen(pScreen),
field_40(x),
m_textLine1(line1),
m_textLine2(line2),
m_pScreen(pScreen),
field_40(x)
m_btnOK (0, 0, 0, "Ok"),
m_btnCancel(1, 0, 0, "Cancel")
{
}
ConfirmScreen::ConfirmScreen(Screen* pScreen, const std::string& line1, const std::string& line2, const std::string& ok, const std::string& cancel, int x) :
m_btnOK (0, 0, 0, ok),
m_btnCancel(1, 0, 0, cancel),
m_pScreen(pScreen),
field_40(x),
m_textLine1(line1),
m_textLine2(line2),
m_pScreen(pScreen),
field_40(x)
m_btnOK (0, 0, 0, ok),
m_btnCancel(1, 0, 0, cancel)
{
}

View File

@@ -12,13 +12,15 @@
#include "common/Util.hpp"
CreateWorldScreen::CreateWorldScreen() :
m_textName(1, 0, 0, 0, 0, "", "Unnamed world"),
m_textSeed(2, 0, 0, 0, 0, ""),
m_textName(this, 1, 0, 0, 0, 0, "", "Unnamed world"),
m_textSeed(this, 2, 0, 0, 0, 0, ""),
m_btnBack(3, "Cancel"),
m_btnCreate(4, "Create New World")
{
}
#define CRAMPED() (100 + 32 + 58 > m_height)
void CreateWorldScreen::init()
{
m_textName.m_width = m_textSeed.m_width = 200;
@@ -43,6 +45,19 @@ void CreateWorldScreen::init()
m_buttonTabList.push_back(&m_btnCreate);
m_textName.init(m_pFont);
m_textSeed.init(m_pFont);
// 100 - yPos of textSeed
// 32 - offset + height of "Leave blank for random" text
// 58 - approximately the Y position of the create button
bool crampedMode = CRAMPED();
if (crampedMode)
{
// crush everything down as much as we can
m_textName.m_yPos = 40;
m_textSeed.m_yPos = 80;
m_btnCreate.m_yPos += 10;
m_btnBack.m_yPos += 5;
}
}
static char g_CreateWorldFilterArray[] = { '/','\n','\r','\x09','\0','\xC','`','?','*','\\','<','>','|','"',':' };
@@ -114,7 +129,7 @@ void CreateWorldScreen::render(int mouseX, int mouseY, float f)
renderBackground();
Screen::render(mouseX, mouseY, f);
drawCenteredString(m_pFont, "Create New World", m_width / 2, 30, 0xFFFFFF);
drawCenteredString(m_pFont, "Create New World", m_width / 2, CRAMPED() ? 10 : 30, 0xFFFFFF);
drawString(m_pFont, "World name", m_textName.m_xPos, m_textName.m_yPos - 10, 0xDDDDDD);
drawString(m_pFont, "Seed for the World Generator", m_textSeed.m_xPos, m_textSeed.m_yPos - 10, 0xDDDDDD);
drawString(m_pFont, "Leave blank for a random seed", m_textSeed.m_xPos, m_textSeed.m_yPos + 22, 0x999999);

View File

@@ -12,9 +12,9 @@
#include "common/Util.hpp"
DirectConnectScreen::DirectConnectScreen() :
m_textAddress(1, 0, 0, 0, 0, "Server address"),
m_btnJoin(2, "Connect"),
m_btnQuit(3, "Cancel")
m_textAddress(this, 1, 0, 0, 0, 0, "Server address"),
m_btnQuit(3, "Cancel"),
m_btnJoin(2, "Connect")
{}
void DirectConnectScreen::init()

View File

@@ -11,7 +11,7 @@
#include "network/ServerSideNetworkHandler.hpp"
PauseScreen::PauseScreen() :
field_3C(0),
//field_3C(0),
field_40(0),
m_btnBack(1, "Back to game"),
m_btnQuit(2, "Quit to title"),
@@ -25,27 +25,45 @@ PauseScreen::PauseScreen() :
void PauseScreen::init()
{
bool bAddVisibleButton = m_pMinecraft->m_pRakNetInstance && m_pMinecraft->m_pRakNetInstance->m_bIsHost;
int nButtons = 2;
if (bAddVisibleButton)
nButtons++;
#ifdef ENH_ADD_OPTIONS_PAUSE
nButtons++;
#endif
int currY = 48, inc = 32;
bool cramped = m_height < currY + inc * nButtons + 10; // also add some padding
if (cramped)
inc = 25;
m_btnQuit.m_width = 160;
m_btnBack.m_width = 160;
m_btnVisible.m_width = 160;
m_btnQuitAndCopy.m_width = 160;
m_btnBack.m_yPos = 48;
m_btnQuit.m_yPos = 80;
m_btnBack.m_yPos = currY; currY += inc;
m_btnQuit.m_yPos = currY; currY += inc;
m_btnBack.m_xPos = (m_width - 160) / 2;
m_btnQuit.m_xPos = (m_width - 160) / 2;
m_btnVisible.m_xPos = (m_width - 160) / 2;
m_btnQuitAndCopy.m_xPos = (m_width - 160) / 2;
m_btnVisible.m_yPos = 112;
m_btnQuitAndCopy.m_yPos = 112;
m_btnVisible.m_yPos =
m_btnQuitAndCopy.m_yPos = currY;
#ifdef ENH_ADD_OPTIONS_PAUSE
// TODO: when visible or quit&copy are on, lower this
m_btnOptions.m_width = 160;
m_btnOptions.m_yPos = 112;
m_btnOptions.m_yPos = currY;
m_btnOptions.m_xPos = m_btnBack.m_xPos;
#endif
currY += inc;
// add the buttons to the screen:
m_buttons.push_back(&m_btnBack);
@@ -57,12 +75,12 @@ void PauseScreen::init()
//m_buttons.push_back(&m_btnQuitAndCopy);
if (m_pMinecraft->m_pRakNetInstance && m_pMinecraft->m_pRakNetInstance->m_bIsHost)
if (bAddVisibleButton)
{
updateServerVisibilityText();
m_buttons.push_back(&m_btnVisible);
#ifdef ENH_ADD_OPTIONS_PAUSE
m_btnOptions.m_yPos += 32;
m_btnOptions.m_yPos += inc;
#endif
}

View File

@@ -22,7 +22,7 @@ public:
void updateServerVisibilityText();
private:
int field_3C;
//int field_3C;
int field_40;
Button m_btnBack;
Button m_btnQuit;

View File

@@ -150,13 +150,6 @@ void ClientSideNetworkHandler::handle(const RakNet::RakNetGUID& rakGuid, RemoveE
Entity* pEnt = m_pLevel->getEntity(pRemoveEntityPkt->m_id);
#if defined(ORIGINAL_CODE) || UINTPTR_MAX == UINT32_MAX
// @NOTE: On x64 systems, this won't print the right things.
printf_ignorable("RemoveEntityPacket %d %d", pEnt, m_pMinecraft->m_pLocalPlayer);
#else
printf_ignorable("RemoveEntityPacket %p %p", pEnt, m_pMinecraft->m_pLocalPlayer);
#endif
if (pEnt)
m_pLevel->removeEntity(pEnt);
}

View File

@@ -19,7 +19,7 @@ struct SBufferedBlockUpdate
uint8_t tile, data;
SBufferedBlockUpdate(int x, int y, int z, TileID tile, int data) :
x(x), y(uint8_t(y)), z(z), tile(uint8_t(tile)), data(uint8_t(data))
x(x), z(z), y(uint8_t(y)), tile(uint8_t(tile)), data(uint8_t(data))
{}
};

View File

@@ -142,7 +142,7 @@ void Options::_initDefaultValues()
KM(KM_FLY_DOWN, SDLVK_x);
KM(KM_CHAT_CMD, SDLVK_SLASH);
#endif
#ifdef PLATFORM_ANDROID
#ifdef __ANDROID__
// -- Original xperia play controls
//KM(KM_FORWARD, AKEYCODE_DPAD_UP);
//KM(KM_LEFT, AKEYCODE_DPAD_LEFT);
@@ -162,24 +162,25 @@ void Options::_initDefaultValues()
//KM(KM_FLY_UP, AKEYCODE_BUTTON_R1);
//KM(KM_FLY_DOWN, AKEYCODE_BUTTON_L1);
//use controller input on android for now.
KM(KM_FORWARD, AKEYCODE_W);
KM(KM_LEFT, AKEYCODE_A);
KM(KM_BACKWARD, AKEYCODE_S);
KM(KM_RIGHT, AKEYCODE_D);
KM(KM_JUMP, AKEYCODE_SPACE);
KM(KM_JUMP, AKEYCODE_BUTTON_A);
KM(KM_DESTROY, AKEYCODE_X);
KM(KM_PLACE, AKEYCODE_C);
KM(KM_MENU_NEXT, AKEYCODE_DPAD_DOWN);
KM(KM_MENU_PREVIOUS, AKEYCODE_DPAD_UP);
KM(KM_MENU_OK, AKEYCODE_ENTER);
KM(KM_MENU_CANCEL, AKEYCODE_ESCAPE);
KM(KM_MENU_CANCEL, AKEYCODE_BUTTON_START);
// custom
KM(KM_SLOT_L, AKEYCODE_Y);
KM(KM_SLOT_R, AKEYCODE_U);
KM(KM_SLOT_L, AKEYCODE_BUTTON_L1);
KM(KM_SLOT_R, AKEYCODE_BUTTON_R1);
KM(KM_DROP, AKEYCODE_Q);
KM(KM_CHAT, AKEYCODE_T);
KM(KM_FOG, AKEYCODE_F);
KM(KM_INVENTORY, AKEYCODE_F);
KM(KM_INVENTORY, AKEYCODE_BUTTON_Y);
KM(KM_SNEAK, AKEYCODE_SHIFT_LEFT);
KM(KM_SLOT_1, AKEYCODE_1);
KM(KM_SLOT_2, AKEYCODE_2);

View File

@@ -1,19 +1,21 @@
/********************************************************************
Minecraft: Pocket Edition - Decompilation Project
Copyright (C) 2023 iProgramInCpp
The following code is licensed under the BSD 1 clause license.
SPDX-License-Identifier: BSD-1-Clause
********************************************************************/
#include "Controller.hpp"
#include <cmath>
bool Controller::isTouchedValues[2];
float Controller::stickValuesX[2];
float Controller::stickValuesY[2];
#ifndef __ANDROID__
const float Controller_unk_1[3] = { 0.0f, 0.64f, -0.64f };
#endif
bool Controller::isValidStick(int stickNo)
{
@@ -50,12 +52,21 @@ void Controller::feed(int stickNo, int touched, float x, float y)
if (!isValidStick(stickNo))
return;
#ifdef __ANDROID__
int index = stickNo - 1;
#else
int index = (x >= 0.0f) ? 1 : 0;
#endif
// maybe the 2 'touch sticks' are actually internally 1 single surface??
isTouchedValues[index] = touched != 0;
#ifdef __ANDROID__
stickValuesX[index] = x;
#else
stickValuesX[index] = linearTransform(x + Controller_unk_1[index + 1], 0.0f, 2.78f, true);
#endif
stickValuesY[index] = y;
}

View File

@@ -22,6 +22,10 @@ ControllerTurnInput::ControllerTurnInput()
TurnDelta ControllerTurnInput::getTurnDelta()
{
#ifdef __ANDROID__
return TurnDelta(Controller::getX(m_stickNo) * 50.f, Controller::getY(m_stickNo) * 60.f);
#endif
bool isTouched = Controller::isTouched(m_stickNo);
float deltaX, deltaY;

View File

@@ -28,7 +28,7 @@ bool PolygonArea::isInside(float x, float y)
while (idx < m_count)
{
// horrible ass condition
if ((m_yPos[idx] <= y && m_yPos[idx2] > y || m_yPos[idx2] <= y && m_yPos[idx] > y)
if (((m_yPos[idx] <= y && m_yPos[idx2] > y) || (m_yPos[idx2] <= y && m_yPos[idx] > y))
&& ((((m_xPos[idx2] - m_xPos[idx]) * (y - m_yPos[idx]))
/ (m_yPos[idx2] - m_yPos[idx]))
+ m_xPos[idx]) > x)

View File

@@ -207,7 +207,7 @@ void GameRenderer::setupGuiScreen()
{
float x = Gui::InvGuiScale * Minecraft::width;
float y = Gui::InvGuiScale * Minecraft::height;
glClear(GL_ACCUM);
glClear(GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
xglOrthof(0, x, y, 0, 2000.0f, 3000.0f);
@@ -326,8 +326,8 @@ void GameRenderer::setupFog(int i)
if (m_pMinecraft->m_pMobPersp->isUnderLiquid(Material::water))
{
#ifdef ORIGINAL_CODE
glFogx(GL_FOG_MODE, 0x0800);
#if defined(ORIGINAL_CODE) || defined(__ANDROID__)
glFogx(GL_FOG_MODE, GL_EXP);
#else
glFogi(GL_FOG_MODE, GL_EXP);
#endif
@@ -336,8 +336,8 @@ void GameRenderer::setupFog(int i)
}
else if (m_pMinecraft->m_pMobPersp->isUnderLiquid(Material::lava))
{
#ifdef ORIGINAL_CODE
glFogx(GL_FOG_MODE, 0x0800);
#if defined(ORIGINAL_CODE) || defined(__ANDROID__)
glFogx(GL_FOG_MODE, GL_EXP);
#else
glFogi(GL_FOG_MODE, GL_EXP);
#endif
@@ -346,23 +346,25 @@ void GameRenderer::setupFog(int i)
}
else
{
#ifdef ORIGINAL_CODE
#if defined(ORIGINAL_CODE) || defined(__ANDROID__)
glFogx(GL_FOG_MODE, GL_LINEAR);
#else
glFogi(GL_FOG_MODE, GL_LINEAR);
#endif
glFogf(GL_FOG_START, field_8 * 0.25f);
glFogf(GL_FOG_END, field_8);
glFogf(GL_FOG_END, field_8);
if (i < 0)
{
glFogf(GL_FOG_START, 0.0f);
glFogf(GL_FOG_END, field_8 * 0.8f);
glFogf(GL_FOG_END, field_8 * 0.8f);
}
if (m_pMinecraft->m_pLevel->m_pDimension->field_C)
{
glFogf(GL_FOG_START, 0.0f);
}
#endif
}
glEnable(GL_COLOR_MATERIAL);
@@ -647,8 +649,8 @@ void GameRenderer::render(float f)
if (m_pMinecraft->m_pScreen)
{
glClear(GL_ACCUM);
m_pMinecraft->m_pScreen->render(mouseX, mouseY, f);
glClear(GL_DEPTH_BUFFER_BIT);
m_pMinecraft->m_pScreen->onRender(mouseX, mouseY, f);
if (m_pMinecraft->m_pScreen && !m_pMinecraft->m_pScreen->isInGameScreen())
{

View File

@@ -53,9 +53,9 @@ LevelRenderer::LevelRenderer(Minecraft* pMC, Textures* pTexs)
m_pBuffers = new GLuint[m_nBuffers];
xglGenBuffers(m_nBuffers, m_pBuffers);
LOG_I("numBuffers: %d", m_nBuffers);
xglGenBuffers(1, &field_D8);
xglGenBuffers(1, &m_skyBuffer);
generateSky(); // inlined in the 0.1.0 demo
}
@@ -64,7 +64,7 @@ void LevelRenderer::generateSky()
{
Tesselator& t = Tesselator::instance;
t.begin();
field_DC = 0;
m_skyBufferCount = 0;
//float m = 16.0f;
int n = 4;
@@ -79,11 +79,11 @@ void LevelRenderer::generateSky()
t.vertex(float(i + p) , 16.0f, float(j + p) );
t.vertex(float(i + 0.0f), 16.0f, float(j + p) );
field_DC += 4;
m_skyBufferCount += 4;
}
}
t.end(field_D8);
t.end(m_skyBuffer);
}
void LevelRenderer::deleteChunks()
@@ -379,6 +379,9 @@ void LevelRenderer::onGraphicsReset()
{
xglGenBuffers(m_nBuffers, m_pBuffers);
allChanged();
xglGenBuffers(1, &m_skyBuffer);
generateSky(); // inlined in the 0.1.0 demo
}
void LevelRenderer::render(const AABB& aabb) const
@@ -1252,7 +1255,7 @@ void LevelRenderer::renderSky(float f)
glColor4f(skyColor.x, skyColor.y, Mth::Min(1.0f, skyColor.z), 1.0f);
glDepthMask(false);
glColor4f(skyColor.x, skyColor.y, skyColor.z, 1.0f);
drawArrayVT(field_D8, field_DC, sizeof(Tesselator::Vertex));
drawArrayVT(m_skyBuffer, m_skyBufferCount, sizeof(Tesselator::Vertex));
glEnable(GL_TEXTURE_2D);
glDepthMask(true);
}

View File

@@ -143,8 +143,8 @@ public:
//...
int m_nBuffers;
GLuint* m_pBuffers;
GLuint field_D8;
int field_DC;
GLuint m_skyBuffer;
int m_skyBufferCount;
//...
Textures* m_pTextures;
};

View File

@@ -91,6 +91,7 @@ void Textures::clear()
m_textures.clear();
m_textureData.clear();
m_currBoundTex = -1;
}
Textures::Textures(Options* pOptions, AppPlatform* pAppPlatform)

View File

@@ -14,6 +14,7 @@
TileRenderer* ItemRenderer::tileRenderer = new TileRenderer;
#ifndef ENH_3D_INVENTORY_TILES
const uint8_t g_ItemFrames[C_MAX_TILES] =
{
0, 1, 2, 3, 4, 5, 0, 6, 0, 0, 0, 0, 7, 8, 9, 10,
@@ -25,6 +26,7 @@ const uint8_t g_ItemFrames[C_MAX_TILES] =
0, 0, 0, 0, 0, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 0
};
#endif
ItemRenderer::ItemRenderer()
{

View File

@@ -17,7 +17,7 @@ public:
static Logger* const singleton();
Logger();
~Logger();
virtual ~Logger();
const char* GetTag(eLogLevel ll);
virtual void print(eLogLevel, const char* const str);
@@ -26,20 +26,37 @@ public:
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 PLATFORM_ANDROID
#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(ignored, ...) __android_log_print(ANDROID_LOG_DEFAULT, "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__)
#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

View File

@@ -138,7 +138,7 @@ float Mth::abs(float f)
int Mth::abs(int d)
{
return ::abs(d);
return Mth::abs((float)d);
}
float Mth::absMax(float a2, float a3)

View File

@@ -22,7 +22,7 @@ float SmoothFloat::getNewDeltaValue(float a1, float a2)
float v1 = (field_0 - field_4) * a2;
field_8 += 0.5f * (v1 - field_8);
if (v1 > 0.0f && field_8 < v1 || v1<0.0f && field_8>v1)
if ((v1 > 0.0f && field_8 < v1) || (v1 < 0.0f && field_8 > v1))
v1 = field_8;
field_4 += v1;

View File

@@ -31,11 +31,12 @@
#endif
// include zlib stuff
// cant get zlib to build on android, they include prebuilt one anyways. using that one
#include "zlib.h"
int g_TimeSecondsOnInit = 0;
#if !defined(USE_SDL) || defined(_WIN32)
#if (!defined(USE_SDL) || defined(_WIN32)) && !defined(__ANDROID__)
DIR* opendir(const char* name)
{

View File

@@ -58,8 +58,8 @@ public:
LoginPacket(const std::string& uname) { m_str = RakNet::RakString(uname.c_str()); }
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
RakNet::RakString m_str;
};
@@ -74,8 +74,8 @@ public:
}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
RakNet::RakString m_str;
};
@@ -89,8 +89,8 @@ public:
m_time = 0;
}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
TLong field_4;
int field_8;
@@ -108,8 +108,8 @@ public:
AddPlayerPacket() {}
AddPlayerPacket(const RakNet::RakNetGUID& guid, RakNet::RakString name, int id, float x, float y, float z);
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int field_4;
RakNet::RakNetGUID m_guid;
@@ -128,8 +128,8 @@ public:
RemoveEntityPacket(int id) { m_id = id; }
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_id;
};
@@ -140,8 +140,8 @@ public:
MovePlayerPacket() {}
MovePlayerPacket(int id, float x, float y, float z, float pitch, float yaw): m_id(id), m_x(x), m_y(y), m_z(z), m_pitch(pitch), m_yaw(yaw) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_id;
float m_x;
@@ -166,8 +166,8 @@ public:
}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_playerID;
int m_x;
@@ -184,8 +184,8 @@ public:
RemoveBlockPacket(int id, int x, int y, int z) :m_playerID(id), m_x(x), m_z(z), m_y(uint8_t(y)) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_playerID;
int m_x;
@@ -197,8 +197,8 @@ class UpdateBlockPacket : public Packet
{
public:
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_x;
int m_z;
@@ -213,8 +213,8 @@ public:
RequestChunkPacket() {}
RequestChunkPacket(int x, int z) { m_x = x; m_z = z; }
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_x;
int m_z;
@@ -226,8 +226,8 @@ public:
ChunkDataPacket() {}
ChunkDataPacket(int x, int z, LevelChunk* c) :m_x(x), m_z(z), m_pChunk(c) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_x;
int m_z;
@@ -241,8 +241,8 @@ public:
LevelDataPacket() {}
LevelDataPacket(Level* level) : m_pLevel(level) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
RakNet::BitStream m_data;
Level* m_pLevel;
@@ -254,8 +254,8 @@ public:
PlayerEquipmentPacket() {}
PlayerEquipmentPacket(int playerID, int itemID): m_playerID(playerID), m_itemID(itemID) {}
void handle(const RakNet::RakNetGUID&, NetEventCallback* pCallback) override;
void write(RakNet::BitStream*);
void read(RakNet::BitStream*);
void write(RakNet::BitStream*) override;
void read(RakNet::BitStream*) override;
public:
int m_playerID;
uint8_t m_itemID;

View File

@@ -63,7 +63,12 @@ public:
void swing();
void take(Entity* pEnt, int x);
void touch(Entity* pEnt);
// QUIRK: Yes, I did mean it like that, as did Mojang.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
void interact(Entity* pEnt);
#pragma GCC diagnostic pop
public:
//TODO

View File

@@ -14,7 +14,7 @@ class CreativeMode : public GameMode
{
public:
CreativeMode(Minecraft*);
bool destroyBlock(int, int, int, int);
bool destroyBlock(int, int, int, int) override;
float getPickRange() override;
bool isCreativeType() override;
@@ -24,8 +24,8 @@ public:
void startDestroyBlock(int x, int y, int z, int i) override;
void continueDestroyBlock(int x, int y, int z, int i) override;
void stopDestroyBlock() override;
void tick();
void render(float f);
void tick() override;
void render(float f) override;
public:
int m_destroyingX;

View File

@@ -31,8 +31,12 @@ public:
bool blocksLight();
int getDir(int data);
void setShape(int dir);
void setOpen(Level*, int x, int y, int z, bool bOpen);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
void setShape(int dir);
#pragma GCC diagnostic pop
// @NOTE: These are inlined.
inline bool isOpen(int data)

151
thirdparty/GL/GL.hpp vendored
View File

@@ -8,10 +8,144 @@
#pragma once
#include "common/Utils.hpp"
#include <common/Utils.hpp> // it includes GL/gl.h
#ifdef __ANDROID__
#define USE_GLES
#include <EGL/egl.h>
#endif
#ifdef USE_GLES1_COMPATIBILITY_LAYER
#define USE_GLES // GLES or its compatibility layer.
#endif
#ifdef USE_GLES
#include <GLES/gl.h>
#define GL_QUADS 0x7
#define USE_OPENGL_2_FEATURES
#include <cmath>
// https://cgit.freedesktop.org/mesa/glu/tree/src/libutil/project.c
static inline void __gluMakeIdentityf(GLfloat m[16]) {
m[0 + 4 * 0] = 1; m[0 + 4 * 1] = 0; m[0 + 4 * 2] = 0; m[0 + 4 * 3] = 0;
m[1 + 4 * 0] = 0; m[1 + 4 * 1] = 1; m[1 + 4 * 2] = 0; m[1 + 4 * 3] = 0;
m[2 + 4 * 0] = 0; m[2 + 4 * 1] = 0; m[2 + 4 * 2] = 1; m[2 + 4 * 3] = 0;
m[3 + 4 * 0] = 0; m[3 + 4 * 1] = 0; m[3 + 4 * 2] = 0; m[3 + 4 * 3] = 1;
}
static inline void gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, GLfloat zFar) {
GLfloat m[4][4];
float sine, cotangent, deltaZ;
float radians = fovy / 2 * M_PI / 180;
deltaZ = zFar - zNear;
sine = sin(radians);
if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
return;
}
cotangent = cosf(radians) / sine;
__gluMakeIdentityf(&m[0][0]);
m[0][0] = cotangent / aspect;
m[1][1] = cotangent;
m[2][2] = -(zFar + zNear) / deltaZ;
m[2][3] = -1;
m[3][2] = -2 * zNear * zFar / deltaZ;
m[3][3] = 0;
glMultMatrixf(&m[0][0]);
}
#define USE_GL_ORTHO_F
#else
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef _WIN32
#pragma comment(lib, "opengl32.lib")
#pragma comment(lib, "glu32.lib")
#endif
#ifdef __APPLE__
#include <OpenGL/glu.h>
#else
#include <GL/glu.h>
#endif
#ifdef USE_SDL
#define USE_OPENGL_2_FEATURES
#define GL_GLEXT_PROTOTYPES
#include "thirdparty/SDL2/SDL_opengl.h"
#ifndef _WIN32
#include <SDL2/SDL_opengl_glext.h>
#endif
#ifndef __APPLE__
#include <GL/glext.h> // it'll include from a different dir, namely thirdparty/GL/glext.h
#endif
#elif !defined __APPLE__
#include <GL/glext.h> // it'll include from a different dir, namely thirdparty/GL/glext.h
#endif
// use our macro for glOrtho
#endif
#ifdef USE_OPENGL_2_FEATURES
#define xglBindBuffer glBindBuffer
#define xglBufferData glBufferData
#define xglGenBuffers glGenBuffers
#define xglDeleteBuffers glDeleteBuffers
#define xglEnableClientState glEnableClientState
#define xglDisableClientState glDisableClientState
#define xglTexCoordPointer glTexCoordPointer
#define xglColorPointer glColorPointer
#define xglVertexPointer glVertexPointer
#define xglDrawArrays glDrawArrays
#else
void xglInit();
bool xglInitted();
void xglBindBuffer(GLenum target, GLuint buffer);
void xglBufferData(GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
void xglGenBuffers(GLsizei num, GLuint* buffers);
void xglDeleteBuffers(GLsizei num, GLuint* buffers);
void xglOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearpl, GLfloat farpl);
void xglSwapIntervalEXT(int interval);
void xglEnableClientState(GLenum _array);
void xglDisableClientState(GLenum _array);
void xglTexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
void xglColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
void xglVertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
void xglDrawArrays(GLenum mode, GLint first, GLsizei count);
#endif
#ifdef _WIN32
// Win32 defines xglOrthof as a regular function
#elif defined USE_GL_ORTHO_F
#define xglOrthof glOrthof
#else
#define xglOrthof(left, right, bottom, top, nearpl, farpl) glOrtho((GLdouble) (left), (GLdouble) (right), (GLdouble) (bottom), (GLdouble) (top), (GLdouble) (nearpl), (GLdouble) (farpl))
#endif
#if 0
#ifdef __ANDROID__
#include <EGL/egl.h>
#endif
#if defined(USE_SDL) || defined(__ANDROID__)
#if defined(USE_GLES1_COMPATIBILITY_LAYER) || defined(__ANDROID__)
#include <GLES/gl.h>
#define GL_QUADS 0x7
@@ -62,10 +196,10 @@ static inline void gluPerspective(GLfloat fovy, GLfloat aspect, GLfloat zNear, G
#ifdef USE_SDL
#define USE_OPENGL_2
#define GL_GLEXT_PROTOTYPES
#include "thirdparty/SDL2/SDL_opengl.h"
#ifndef _WIN32
#include <SDL2/SDL_opengl_glext.h>
#if defined(USE_GLES) || defined(__ANDROID__)
#define xglOrthof glOrthof
#else
#define xglOrthof(left, right, bottom, top, nearpl, farpl) glOrtho((GLdouble) (left), (GLdouble) (right), (GLdouble) (bottom), (GLdouble) (top), (GLdouble) (nearpl), (GLdouble) (farpl))
#endif
#else
@@ -107,10 +241,15 @@ void xglDrawArrays(GLenum mode, GLint first, GLsizei count);
#define xglVertexPointer glVertexPointer
#define xglDrawArrays glDrawArrays
#ifdef USE_GLES1_COMPATIBILITY_LAYER
#ifdef USE_GLES
#define xglOrthof glOrthof
#else
#define xglOrthof(left, right, bottom, top, nearpl, farpl) glOrtho((GLdouble) (left), (GLdouble) (right), (GLdouble) (bottom), (GLdouble) (top), (GLdouble) (nearpl), (GLdouble) (farpl))
#endif
#endif
#endif
#endif

View File

@@ -127,11 +127,15 @@ void xglDrawArrays(GLenum mode, GLint first, GLsizei count)
}
#endif
#ifndef USE_GL_ORTHO_F
void xglOrthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat nearpl, GLfloat farpl)
{
return glOrtho(GLdouble(left), GLdouble(right), GLdouble(bottom), GLfloat(top), GLdouble(nearpl), GLdouble(farpl));
}
#endif
void xglSwapIntervalEXT(int interval)
{
#ifndef USE_OPENGL_2

View File

@@ -42,7 +42,7 @@ public:
{
char fullPathToDir[1024];
if (onFileStruct->fileName && onFileStruct->fileData && subdirLen < strlen(onFileStruct->fileName))
if (/* onFileStruct->fileName && */ onFileStruct->fileData && subdirLen < strlen(onFileStruct->fileName))
{
strcpy(fullPathToDir, outputSubdir);
strcat(fullPathToDir, onFileStruct->fileName+subdirLen);
@@ -58,7 +58,7 @@ public:
{
char fullPathToDir[1024];
if (fps->onFileStruct->fileName && subdirLen < strlen(fps->onFileStruct->fileName))
if (/* fps->onFileStruct->fileName && */ subdirLen < strlen(fps->onFileStruct->fileName))
{
strcpy(fullPathToDir, outputSubdir);
strcat(fullPathToDir, fps->onFileStruct->fileName+subdirLen);

View File

@@ -20,7 +20,7 @@
#include <io.h>
#elif !defined ( __APPLE__ ) && !defined ( __APPLE_CC__ ) && !defined ( __PPC__ ) && !defined ( __FreeBSD__ ) && !defined ( __S3E__ ) && !defined( __EMSCRIPTEN__ )
#elif !defined ( __APPLE__ ) && !defined ( __APPLE_CC__ ) && !defined ( __PPC__ ) && !defined ( __FreeBSD__ ) && !defined ( __S3E__ ) && !defined( __EMSCRIPTEN__) && !defined( __ANDROID__ )
#include <sys/io.h>
#endif