forked from Kolyah35/minecraft-pe-0.6.1
Compare commits
8 Commits
b6e7414f04
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| fd3ee23e4e | |||
| e9766ed2a1 | |||
| 298451c290 | |||
| 668fc9d16f | |||
| 5717aeab24 | |||
| 9af1496b9d | |||
| 6bfae5a14e | |||
| 4034cf243d |
81
.github/workflows/build.yml
vendored
81
.github/workflows/build.yml
vendored
@@ -18,7 +18,7 @@ permissions:
|
||||
|
||||
jobs:
|
||||
build-windows:
|
||||
name: Windows Build
|
||||
name: Build Windows
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
@@ -68,13 +68,12 @@ jobs:
|
||||
name: mcpe-windows
|
||||
path: |
|
||||
${{github.workspace}}/build/MinecraftPE.exe
|
||||
${{github.workspace}}/build/glfw3.dll
|
||||
${{github.workspace}}/build/libpng16.dll
|
||||
${{github.workspace}}/build/OpenAL32.dll
|
||||
${{github.workspace}}/build/z.dll
|
||||
${{github.workspace}}/build/libz.dll
|
||||
|
||||
build-linux:
|
||||
name: Linux Build
|
||||
name: Build Linux
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -120,7 +119,7 @@ jobs:
|
||||
${{github.workspace}}/build/MinecraftPE-server
|
||||
|
||||
build-android: # pray to god
|
||||
name: Build Android APK (${{ matrix.abi }})
|
||||
name: Build Android (${{ matrix.abi }})
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
@@ -215,10 +214,59 @@ jobs:
|
||||
name: minecraftpe-apk-${{ matrix.abi }}
|
||||
path: ${{ github.workspace }}/build-apk/minecraftpe-*-debug.apk
|
||||
|
||||
build-web:
|
||||
name: Build Web
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Setup caches
|
||||
uses: ./.github/actions/setup-cache
|
||||
with:
|
||||
host: linux
|
||||
target: linux
|
||||
|
||||
- name: Setup Ninja
|
||||
uses: ./.github/actions/setup-ninja
|
||||
with:
|
||||
host: linux
|
||||
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
version: 5.0.3
|
||||
actions-cache-folder: 'emsdk-cache'
|
||||
|
||||
- name: Create Build Environment
|
||||
# Some projects don't allow in-source building, so create a separate build directory
|
||||
# We'll use this as our working directory for all subsequent commands
|
||||
run: cmake -E make_directory ${{github.workspace}}/build
|
||||
|
||||
- name: Configure CMake
|
||||
# Use a bash shell so we can use the same syntax for environment variable
|
||||
# access regardless of the host operating system
|
||||
shell: bash
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -G Ninja -DCMAKE_TOOLCHAIN_FILE="$GITHUB_WORKSPACE/emsdk-cache/emsdk-main/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake"
|
||||
|
||||
- name: Build
|
||||
working-directory: ${{github.workspace}}/build
|
||||
run: cmake --build . --config $BUILD_TYPE --target MinecraftPE --parallel
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: mcpe-web
|
||||
path: |
|
||||
${{github.workspace}}/build/MinecraftPE.js
|
||||
${{github.workspace}}/build/MinecraftPE.wasm
|
||||
${{github.workspace}}/build/MinecraftPE.data
|
||||
|
||||
publish:
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ build-windows, build-linux, build-android ]
|
||||
needs: [ build-windows, build-linux, build-android, build-web ]
|
||||
if: github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -236,13 +284,13 @@ jobs:
|
||||
- name: Zip Windows Artifacts
|
||||
uses: vimtor/action-zip@v1.2
|
||||
with:
|
||||
files: data mcpe-windows/MinecraftPE.exe mcpe-windows/glfw3.dll mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/z.dll
|
||||
files: mcpe-windows/MinecraftPE.exe mcpe-windows/libpng16.dll mcpe-windows/OpenAL32.dll mcpe-windows/libz.dll
|
||||
dest: minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip
|
||||
|
||||
- name: Zip Linux Artifacts
|
||||
uses: vimtor/action-zip@v1.2
|
||||
with:
|
||||
files: data mcpe-linux/MinecraftPE
|
||||
files: mcpe-linux/MinecraftPE
|
||||
dest: minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip
|
||||
|
||||
- name: Zip Linux Server Artifacts
|
||||
@@ -263,6 +311,19 @@ jobs:
|
||||
files: minecraftpe-apk-armeabi-v7a/minecraftpe-v7a-debug.apk
|
||||
dest: minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip
|
||||
|
||||
- name: Zip Web Artifact
|
||||
uses: vimtor/action-zip@v1.2
|
||||
with:
|
||||
files: mcpe-web/MinecraftPE.js mcpe-web/MinecraftPE.wasm mcpe-web/MinecraftPE.data misc/web/index.html
|
||||
dest: minecraftpe-${{ steps.ref.outputs.hash }}-web.zip
|
||||
|
||||
- name: Zip Data
|
||||
uses: vimtor/action-zip@v1.2
|
||||
with:
|
||||
files: data
|
||||
recursive: false
|
||||
dest: data.zip
|
||||
|
||||
- name: Update Development Release
|
||||
uses: andelf/nightly-release@main
|
||||
env:
|
||||
@@ -273,8 +334,10 @@ jobs:
|
||||
body: |
|
||||
MinecraftPE development release for commit ${{ github.sha }}.
|
||||
files: |
|
||||
./data.zip
|
||||
./minecraftpe-${{ steps.ref.outputs.hash }}-windows.zip
|
||||
./minecraftpe-${{ steps.ref.outputs.hash }}-linux.zip
|
||||
./minecraftpe-server-${{ steps.ref.outputs.hash }}.zip
|
||||
./minecraftpe-${{ steps.ref.outputs.hash }}-android-arm64-v8a.zip
|
||||
./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip
|
||||
./minecraftpe-${{ steps.ref.outputs.hash }}-android-armeabi-v7a.zip
|
||||
./minecraftpe-${{ steps.ref.outputs.hash }}-web.zip
|
||||
@@ -7,10 +7,6 @@ set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
set(CMAKE_POLICY_VERSION_MINIMUM 3.10)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "-Wno-c++11-narrowing -Wno-narrowing -Wno-invalid-source-encoding -Wno-reserved-user-defined-literal")
|
||||
endif()
|
||||
|
||||
include(cmake/EnumOption.cmake)
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
@@ -26,6 +22,14 @@ find_package(OpenSSL)
|
||||
if (${PLATFORM} STREQUAL "Desktop")
|
||||
set(PLATFORM_CPP "PLATFORM_DESKTOP")
|
||||
|
||||
if (MINGW)
|
||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libstdc++ -static-libgcc")
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-c++11-narrowing -Wno-narrowing -Wno-invalid-source-encoding -Wno-reserved-user-defined-literal")
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
include_directories(misc/windows)
|
||||
@@ -102,6 +106,8 @@ CPMAddPackage(
|
||||
"ALSOFT_UTILS OFF"
|
||||
"LIBTYPE ${AL_LIBTYPE}"
|
||||
"ALSOFT_ENABLE_MODULES OFF"
|
||||
"ALSOFT_STATIC_STDCXX ON"
|
||||
"ALSOFT_STATIC_LIBGCC ON"
|
||||
)
|
||||
|
||||
# TODO: Clear this paths with *
|
||||
@@ -321,7 +327,7 @@ target_include_directories(${PROJECT_NAME} PUBLIC
|
||||
if(${PLATFORM} MATCHES "Web")
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
# uuuh i hate it
|
||||
set(EM_FLAGS "-pthread -sUSE_PTHREADS=1 -sSHARED_MEMORY=1")
|
||||
set(EM_FLAGS "-pthread -sUSE_PTHREADS=1 -sUSE_LIBPNG=1 -sSHARED_MEMORY=1")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EM_FLAGS}")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EM_FLAGS}")
|
||||
|
||||
@@ -153,7 +153,11 @@ void OptionsScreen::buttonClicked(Button* button) {
|
||||
|
||||
if (button == btnClose) {
|
||||
minecraft->options.save();
|
||||
minecraft->screenChooser.setScreen(SCREEN_STARTMENU);
|
||||
if (minecraft->screen != NULL) {
|
||||
minecraft->setScreen(NULL);
|
||||
} else {
|
||||
minecraft->screenChooser.setScreen(SCREEN_STARTMENU);
|
||||
}
|
||||
}
|
||||
else if (button->id > 1 && button->id < 7) {
|
||||
int categoryButton = button->id - categoryButtons[0]->id;
|
||||
|
||||
@@ -5,12 +5,16 @@
|
||||
#include "../../../util/Mth.h"
|
||||
#include "../../../network/RakNetInstance.h"
|
||||
#include "../../../network/ServerSideNetworkHandler.h"
|
||||
#include "client/Options.h"
|
||||
#include "client/gui/components/Button.h"
|
||||
#include "client/gui/screens/OptionsScreen.h"
|
||||
|
||||
PauseScreen::PauseScreen(bool wasBackPaused)
|
||||
: saveStep(0),
|
||||
visibleTime(0),
|
||||
bContinue(0),
|
||||
bQuit(0),
|
||||
bOptions(0),
|
||||
bQuitAndSaveLocally(0),
|
||||
bServerVisibility(0),
|
||||
// bThirdPerson(0),
|
||||
@@ -39,18 +43,21 @@ PauseScreen::~PauseScreen() {
|
||||
delete bQuit;
|
||||
delete bQuitAndSaveLocally;
|
||||
delete bServerVisibility;
|
||||
delete bOptions;
|
||||
// delete bThirdPerson;
|
||||
}
|
||||
|
||||
void PauseScreen::init() {
|
||||
if (minecraft->useTouchscreen()) {
|
||||
bContinue = new Touch::TButton(1, "Back to game");
|
||||
bOptions = new Touch::TButton(5, "Options");
|
||||
bQuit = new Touch::TButton(2, "Quit to title");
|
||||
bQuitAndSaveLocally = new Touch::TButton(3, "Quit and copy map");
|
||||
bServerVisibility = new Touch::TButton(4, "");
|
||||
// bThirdPerson = new Touch::TButton(5, "Toggle 3:rd person view");
|
||||
} else {
|
||||
bContinue = new Button(1, "Back to game");
|
||||
bOptions = new Button(5, "Options");
|
||||
bQuit = new Button(2, "Quit to title");
|
||||
bQuitAndSaveLocally = new Button(3, "Quit and copy map");
|
||||
bServerVisibility = new Button(4, "");
|
||||
@@ -59,7 +66,7 @@ void PauseScreen::init() {
|
||||
|
||||
buttons.push_back(bContinue);
|
||||
buttons.push_back(bQuit);
|
||||
|
||||
buttons.push_back(bOptions);
|
||||
// bSound.updateImage(&minecraft->options);
|
||||
bThirdPerson.updateImage(&minecraft->options);
|
||||
bHideGui.updateImage(&minecraft->options);
|
||||
@@ -99,21 +106,24 @@ void PauseScreen::setupPositions() {
|
||||
saveStep = 0;
|
||||
int yBase = 16;
|
||||
|
||||
bContinue->width = bQuit->width = /*bThirdPerson->w =*/ 160;
|
||||
bContinue->width = bOptions->width = bQuit->width = /*bThirdPerson->w =*/ 160;
|
||||
bQuitAndSaveLocally->width = bServerVisibility->width = 160;
|
||||
|
||||
bContinue->x = (width - bContinue->width) / 2;
|
||||
bContinue->y = yBase + 32 * 1;
|
||||
|
||||
bOptions->x = (width - bOptions->width) / 2;
|
||||
bOptions->y = yBase + 32 * 2;
|
||||
|
||||
bQuit->x = (width - bQuit->width) / 2;
|
||||
bQuit->y = yBase + 32 * 2;
|
||||
bQuit->y = yBase + 32 * 3;
|
||||
|
||||
#if APPLE_DEMO_PROMOTION
|
||||
bQuit->y += 16;
|
||||
#endif
|
||||
|
||||
bQuitAndSaveLocally->x = bServerVisibility->x = (width - bQuitAndSaveLocally->width) / 2;
|
||||
bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 32 * 3;
|
||||
bQuitAndSaveLocally->y = bServerVisibility->y = yBase + 32 * 4;
|
||||
|
||||
// bSound.y = bThirdPerson.y = 8;
|
||||
// bSound.x = 4;
|
||||
@@ -157,7 +167,9 @@ void PauseScreen::buttonClicked(Button* button) {
|
||||
if (button->id == bQuitAndSaveLocally->id) {
|
||||
minecraft->leaveGame(true);
|
||||
}
|
||||
|
||||
if (button->id == bOptions->id) {
|
||||
minecraft->setScreen(new OptionsScreen());
|
||||
}
|
||||
if (button->id == bServerVisibility->id) {
|
||||
if (minecraft->raknetInstance && minecraft->netCallback && minecraft->raknetInstance->isServer()) {
|
||||
ServerSideNetworkHandler* ss = (ServerSideNetworkHandler*) minecraft->netCallback;
|
||||
|
||||
@@ -33,7 +33,9 @@ private:
|
||||
Button* bQuit;
|
||||
Button* bQuitAndSaveLocally;
|
||||
Button* bServerVisibility;
|
||||
// Button* bThirdPerson;
|
||||
Button* bOptions;
|
||||
|
||||
// Button* bThirdPerson;
|
||||
|
||||
// OptionButton bSound;
|
||||
OptionButton bThirdPerson;
|
||||
|
||||
@@ -205,16 +205,16 @@ int main(void) {
|
||||
|
||||
delete app;
|
||||
|
||||
appContext.platform->finish();
|
||||
|
||||
delete appContext.platform;
|
||||
|
||||
#ifndef STANDALONE_SERVER
|
||||
// Exit.
|
||||
glfwDestroyWindow(platform->window);
|
||||
glfwTerminate();
|
||||
#endif
|
||||
|
||||
appContext.platform->finish();
|
||||
|
||||
delete appContext.platform;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user