mirror of
https://github.com/celisej567/mcpe.git
synced 2026-09-11 20:11:18 +03:00
C++03 Support & Partial Xbox 360 Support (#37)
* WIP C++03 + Xbox 360 Support * math.h & _USE_MATH_DEFINES on Level.hpp Updated Xenon vcxproj file for new file structure. * * Fix bad GUI scale setup. * * Gui: Use ratios instead of hardcoded sub-1 floating point values, to make the mechanism more clear. * Add Direct Connect Button and Screen (#30) * Add Direct Connect Button and Screen * Remove accidental extra build directories for wasm * Add DirectConnectScreen.cpp to the CMake * Use Hungarian coding style notation * * Fix errors caused by #30 * * Improve the Chat Screen * * Improve the DirectConnectScreen, among other things. * * Update the game title once again. * * Add build-wasm.bat. * * Add info about compiling for wasm * * Fix send to specific GUID actually broadcasting to everyone * * Add command manager. * * Add writeable configuration. * * Allow dynamic screen size change on windows * * Allow the same thing on the emscripten version. * WIP C++03 + Xbox 360 Support * Fixed a possible merging issue that broke RakNet? * Additional Xbox 360 compatability fixes --------- Co-authored-by: Brent Da Mage <BrentDaMage@users.noreply.github.com> Co-authored-by: iProgramInCpp <iprogramincpp@gmail.com> Co-authored-by: ts <124226059+uniformization@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/********************************************************************
|
||||
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
|
||||
********************************************************************/
|
||||
@@ -9,7 +9,9 @@
|
||||
#include "CThread.hpp"
|
||||
#include "client/common/Utils.hpp"
|
||||
|
||||
#ifdef _WIN32
|
||||
#if defined(_XBOX)
|
||||
|
||||
#elif defined(_WIN32)
|
||||
#include <Windows.h> // for Sleep()
|
||||
#else
|
||||
#include <unistd.h>
|
||||
@@ -24,17 +26,26 @@ void CThread::sleep(uint32_t ms)
|
||||
#endif
|
||||
}
|
||||
|
||||
CThread::CThread(CThreadFunction func, void* parm)
|
||||
CThread::CThread(CThreadFunction func, void* param)
|
||||
{
|
||||
m_func = func;
|
||||
|
||||
|
||||
#ifdef USE_CPP11_THREADS
|
||||
std::thread thr(func, parm);
|
||||
std::thread thr(func, param);
|
||||
m_thrd.swap(thr);
|
||||
#elif defined(_XBOX)
|
||||
m_thrd = CreateThread(
|
||||
NULL, // not used
|
||||
0, // initial stack size
|
||||
func, // thread function
|
||||
param, // thread argument
|
||||
0, // creation option
|
||||
LPDWORD(1) // thread identifier (but does it really matter if I'm the one managing them...?)
|
||||
);
|
||||
#else
|
||||
pthread_attr_init(&m_thrd_attr);
|
||||
pthread_attr_setdetachstate(&m_thrd_attr, 1);
|
||||
pthread_create(&m_thrd, &m_thrd_attr, m_func, parm);
|
||||
pthread_create(&m_thrd, &m_thrd_attr, m_func, param);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -42,6 +53,8 @@ CThread::~CThread()
|
||||
{
|
||||
#ifdef USE_CPP11_THREADS
|
||||
m_thrd.join();
|
||||
#elif defined(_XBOX)
|
||||
|
||||
#else
|
||||
pthread_join(m_thrd, 0);
|
||||
pthread_attr_destroy(&m_thrd_attr);
|
||||
|
||||
Reference in New Issue
Block a user