Compare commits
No commits in common. "main" and "fix/remove-lfs" have entirely different histories.
main
...
fix/remove
350 changed files with 72584 additions and 47672 deletions
8
.gitattributes
vendored
8
.gitattributes
vendored
|
|
@ -0,0 +1,8 @@
|
|||
*.png filter=lfs diff=lfs merge=lfs -text
|
||||
*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
*.ogg filter=lfs diff=lfs merge=lfs -text
|
||||
*.binka filter=lfs diff=lfs merge=lfs -text
|
||||
*.arc filter=lfs diff=lfs merge=lfs -text
|
||||
*.ttf filter=lfs diff=lfs merge=lfs -text
|
||||
*.bin filter=lfs diff=lfs merge=lfs -text
|
||||
*.ico filter=lfs diff=lfs merge=lfs -text
|
||||
BIN
.github/banner.png
vendored
BIN
.github/banner.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 646 KiB |
31
.github/workflows/build.yml
vendored
Normal file
31
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
name: Build Minecraft Legacy Console Edition
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-2022
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
configuration: [Release, Debug]
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup MSBuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Build Minecraft Legacy Console Edition
|
||||
run: |
|
||||
msbuild MinecraftConsoles.sln `
|
||||
/p:Configuration=${{ matrix.configuration }} `
|
||||
/p:Platform=Windows64 `
|
||||
/m
|
||||
|
||||
- name: Upload Release + Debug Artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: MinecraftClient-${{ matrix.configuration }}
|
||||
path: x64/${{ matrix.configuration }}
|
||||
32
.github/workflows/debug-test.yml
vendored
Normal file
32
.github/workflows/debug-test.yml
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
name: MSBuild Debug Test
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
paths-ignore:
|
||||
- '.gitignore'
|
||||
- '*.md'
|
||||
- '.github/*.md'
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths-ignore:
|
||||
- '.gitignore'
|
||||
- '*.md'
|
||||
- '.github/*.md'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Windows64 (DEBUG)
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup msbuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Build
|
||||
run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Debug /p:Platform="Windows64"
|
||||
167
.github/workflows/nightly-server.yml
vendored
167
.github/workflows/nightly-server.yml
vendored
|
|
@ -1,167 +0,0 @@
|
|||
name: Nightly Server Release
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths-ignore:
|
||||
- '.gitignore'
|
||||
- '*.md'
|
||||
- '.github/**'
|
||||
- '!.github/workflows/nightly-server.yml'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
packages: write
|
||||
|
||||
concurrency:
|
||||
group: nightly-server
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [Windows64]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set platform lowercase
|
||||
run: echo "MATRIX_PLATFORM=$('${{ matrix.platform }}'.ToLower())" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Setup CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Run CMake
|
||||
uses: lukka/run-cmake@v10
|
||||
env:
|
||||
VCPKG_ROOT: "" # Disable vcpkg for CI builds
|
||||
with:
|
||||
configurePreset: ${{ env.MATRIX_PLATFORM }}
|
||||
buildPreset: ${{ env.MATRIX_PLATFORM }}-release
|
||||
buildPresetAdditionalArgs: "['--target', 'Minecraft.Server']"
|
||||
|
||||
- name: Zip Build
|
||||
run: 7z a -r LCEServer${{ matrix.platform }}.zip ./build/${{ env.MATRIX_PLATFORM }}/Minecraft.Server/Release/* "-x!*.ipdb" "-x!*.iobj"
|
||||
|
||||
- name: Stage artifacts
|
||||
run: |
|
||||
New-Item -ItemType Directory -Force -Path staging
|
||||
Copy-Item LCEServer${{ matrix.platform }}.zip staging/
|
||||
|
||||
- name: Stage exe and pdb
|
||||
if: matrix.platform == 'Windows64'
|
||||
run: |
|
||||
Copy-Item ./build/${{ env.MATRIX_PLATFORM }}/Minecraft.Server/Release/Minecraft.Server.exe staging/
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: build-${{ matrix.platform }}
|
||||
path: staging/*
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
|
||||
- name: Update release
|
||||
uses: andelf/nightly-release@main
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: nightly-dedicated-server
|
||||
name: Nightly Dedicated Server Release
|
||||
body: |
|
||||
Dedicated Server runtime for Windows64.
|
||||
|
||||
Download `LCEServerWindows64.zip` and extract it to a folder where you'd like to keep the server runtime.
|
||||
files: |
|
||||
artifacts/*
|
||||
|
||||
docker:
|
||||
name: Build and Push Docker Image
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Download dedicated server runtime from artifacts
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: build-Windows64
|
||||
path: .artifacts/
|
||||
|
||||
- name: Prepare Docker runtime directory
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
rm -rf runtime
|
||||
mkdir -p runtime
|
||||
unzip .artifacts/LCEServerWindows64.zip -d runtime
|
||||
|
||||
- name: Compute image name
|
||||
id: image
|
||||
shell: bash
|
||||
run: |
|
||||
owner="$(echo "${{ vars.CONTAINER_REGISTRY_OWNER || github.repository_owner }}" | tr '[:upper:]' '[:lower:]')"
|
||||
image_tag="nightly"
|
||||
# if [[ "${{ github.ref }}" != "refs/heads/main" ]]; then
|
||||
# image_tag="nightly-test"
|
||||
# fi
|
||||
echo "owner=$owner" >> "$GITHUB_OUTPUT"
|
||||
echo "image=ghcr.io/$owner/minecraft-lce-dedicated-server" >> "$GITHUB_OUTPUT"
|
||||
echo "image_tag=$image_tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Extract Docker metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ steps.image.outputs.image }}
|
||||
tags: |
|
||||
type=raw,value=${{ steps.image.outputs.image_tag }}
|
||||
|
||||
- name: Login to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ secrets.GHCR_USERNAME || github.actor }}
|
||||
password: ${{ secrets.GHCR_TOKEN || secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Build and push image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: docker/dedicated-server/Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
build-args: |
|
||||
MC_RUNTIME_DIR=runtime
|
||||
|
||||
cleanup:
|
||||
needs: [build, release, docker]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cleanup artifacts
|
||||
uses: geekyeggo/delete-artifact@v5
|
||||
with:
|
||||
name: build-*
|
||||
82
.github/workflows/nightly.yml
vendored
82
.github/workflows/nightly.yml
vendored
|
|
@ -8,75 +8,25 @@ on:
|
|||
paths-ignore:
|
||||
- '.gitignore'
|
||||
- '*.md'
|
||||
- '.github/**'
|
||||
- '!.github/workflows/nightly.yml'
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: nightly
|
||||
cancel-in-progress: true
|
||||
- '.github/*.md'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Windows64
|
||||
runs-on: windows-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [Windows64]
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Set platform lowercase
|
||||
run: echo "MATRIX_PLATFORM=$('${{ matrix.platform }}'.ToLower())" >> $env:GITHUB_ENV
|
||||
- name: Setup msbuild
|
||||
uses: microsoft/setup-msbuild@v2
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Setup CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Run CMake
|
||||
uses: lukka/run-cmake@v10
|
||||
env:
|
||||
VCPKG_ROOT: "" # Disable vcpkg for CI builds
|
||||
with:
|
||||
configurePreset: ${{ env.MATRIX_PLATFORM }}
|
||||
buildPreset: ${{ env.MATRIX_PLATFORM }}-release
|
||||
buildPresetAdditionalArgs: "['--target', 'Minecraft.Client']"
|
||||
- name: Build
|
||||
run: MSBuild.exe MinecraftConsoles.sln /p:Configuration=Release /p:Platform="Windows64"
|
||||
|
||||
- name: Zip Build
|
||||
run: 7z a -r LCE${{ matrix.platform }}.zip ./build/${{ env.MATRIX_PLATFORM }}/Minecraft.Client/Release/* "-x!*.ipdb" "-x!*.iobj"
|
||||
|
||||
- name: Stage artifacts
|
||||
run: |
|
||||
New-Item -ItemType Directory -Force -Path staging
|
||||
Copy-Item LCE${{ matrix.platform }}.zip staging/
|
||||
|
||||
- name: Stage exe and pdb
|
||||
if: matrix.platform == 'Windows64'
|
||||
run: |
|
||||
Copy-Item ./build/${{ env.MATRIX_PLATFORM }}/Minecraft.Client/Release/Minecraft.Client.exe staging/
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v6
|
||||
with:
|
||||
name: build-${{ matrix.platform }}
|
||||
path: staging/*
|
||||
|
||||
release:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v7
|
||||
with:
|
||||
path: artifacts
|
||||
merge-multiple: true
|
||||
run: 7z a -r LCEWindows64.zip ./x64/Release/*
|
||||
|
||||
- name: Update release
|
||||
uses: andelf/nightly-release@main
|
||||
|
|
@ -84,21 +34,13 @@ jobs:
|
|||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: nightly
|
||||
name: Nightly Client Release
|
||||
name: Nightly Release
|
||||
body: |
|
||||
Requires at least Windows 7 and DirectX 11 compatible GPU to run.
|
||||
Requires at least Windows 7 and DirectX 11 compatible GPU to run. Compiled with MSVC v14.44.35207 in Release mode with Whole Program Optimization, as well as `/O2 /Ot /Oi /Ob3 /GF /fp:precise`.
|
||||
|
||||
# 🚨 First time here? 🚨
|
||||
If you've never downloaded the game before, you need to download `LCEWindows64.zip` and extract it to the folder where you'd like to keep the game. The other files are included in this `.zip` file!
|
||||
files: |
|
||||
artifacts/*
|
||||
|
||||
cleanup:
|
||||
needs: [build, release]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cleanup artifacts
|
||||
uses: geekyeggo/delete-artifact@v5
|
||||
with:
|
||||
name: build-*
|
||||
LCEWindows64.zip
|
||||
./x64/Release/Minecraft.Client.exe
|
||||
./x64/Release/Minecraft.Client.pdb
|
||||
|
|
|
|||
32
.github/workflows/pull-request.yml
vendored
32
.github/workflows/pull-request.yml
vendored
|
|
@ -1,32 +0,0 @@
|
|||
name: Pull Request Build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
types: [opened, reopened, synchronize]
|
||||
paths-ignore:
|
||||
- '.gitignore'
|
||||
- '*.md'
|
||||
- '.github/*.md'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Setup MSVC
|
||||
uses: ilammy/msvc-dev-cmd@v1
|
||||
|
||||
- name: Setup CMake
|
||||
uses: lukka/get-cmake@latest
|
||||
|
||||
- name: Run CMake
|
||||
uses: lukka/run-cmake@v10
|
||||
env:
|
||||
VCPKG_ROOT: "" # Disable vcpkg for CI builds
|
||||
with:
|
||||
configurePreset: windows64
|
||||
buildPreset: windows64-debug
|
||||
39
.gitignore
vendored
39
.gitignore
vendored
|
|
@ -379,8 +379,11 @@ MigrationBackup/
|
|||
FodyWeavers.xsd
|
||||
|
||||
# VS Code files for those working on multiple tools
|
||||
.vscode/
|
||||
!.vscode/*.example.json
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/tasks.json
|
||||
!.vscode/launch.json
|
||||
!.vscode/extensions.json
|
||||
*.code-workspace
|
||||
|
||||
# Local History for Visual Studio Code
|
||||
|
|
@ -407,10 +410,30 @@ enc_temp_folder/
|
|||
Minecraft.Client/Schematics/
|
||||
Minecraft.Client/Windows64/GameHDD/
|
||||
|
||||
# CMake build output
|
||||
build/
|
||||
# Intermediate build files (per-project)
|
||||
Minecraft.Client/x64/
|
||||
Minecraft.Client/Debug/
|
||||
Minecraft.Client/x64_Debug/
|
||||
Minecraft.Client/Release/
|
||||
Minecraft.Client/x64_Release/
|
||||
|
||||
# Server data
|
||||
tmp*/
|
||||
_server_asset_probe/
|
||||
server-data/
|
||||
Minecraft.World/x64/
|
||||
Minecraft.World/Debug/
|
||||
Minecraft.World/x64_Debug/
|
||||
Minecraft.World/Release/
|
||||
Minecraft.World/x64_Release/
|
||||
|
||||
build/*
|
||||
|
||||
# Existing build output files
|
||||
!x64/**/Effects.msscmp
|
||||
!x64/**/iggy_w64.dll
|
||||
!x64/**/mss64.dll
|
||||
!x64/**/redist64/
|
||||
|
||||
# Local saves
|
||||
Minecraft.Client/Saves/
|
||||
|
||||
# Visual Studio Per-User Config
|
||||
*.user
|
||||
/out
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
# Approach to Backported Features
|
||||
All backported features incorperated into MinecraftConsoles should be, when merged, functionally identical to their state in the version of the game we're currently targeting. This should be in reference to a known 4J build of LCE. Verification can either be done by doing a decompilation based match of the implementation or, alternatively, all functionality and limitations of the given feature should be compared against the version of LCE we're targeting.
|
||||
|
||||
# Approach to Bugfixes
|
||||
Anything that does not behave in an "expected" manner, especially if its behavior is not widely accepted as a gameplay mechanic, is valid for fixing in our repository. This includes bugfixes that were made in versions past the version we target, but excludes any visual changes that may not have been included at the build we're targeting.
|
||||
|
||||
If you provide a visual bugfix that fixes a distinctive quirk of the LCE renderer, it should be provided in an "off by default" state that can be toggled on in-game by the user. There is no guarantee that we will merge it.
|
||||
|
||||
If your visual bugfix is a fix added in a future version of LCE than the one we're targeting, it should also be put behind a toggle or equivalent system for keeping it off by default.
|
||||
|
||||
# Targeted Version
|
||||
We are currently accepting backports for up to and including TU24. Feature backports from TU25 and above will not be accepted.
|
||||
|
||||
# Original Codebase
|
||||
MinecraftConsoles is based on a WIP build of TU19, built on top of the December 2014 codebase.
|
||||
205
CMakeLists.txt
205
CMakeLists.txt
|
|
@ -13,101 +13,138 @@ if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|||
message(FATAL_ERROR "Use a 64-bit generator/toolchain (x64).")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CONFIGURATION_TYPES
|
||||
"Debug"
|
||||
"Release"
|
||||
CACHE STRING "" FORCE
|
||||
)
|
||||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
|
||||
|
||||
function(configure_compiler_target target)
|
||||
# MSVC and compatible compilers (like Clang-cl)
|
||||
if (MSVC)
|
||||
target_compile_options(${target} PRIVATE
|
||||
$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C,CXX>>:/W3>
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/W0>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/MP>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/FS>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/GS>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/EHsc>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/GR>
|
||||
$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C,CXX>>:/Od>
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/O2 /Oi /GT /GF>
|
||||
)
|
||||
endif()
|
||||
|
||||
# MSVC
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
target_compile_options(${target} PRIVATE
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/GL>
|
||||
)
|
||||
target_link_options(${target} PRIVATE
|
||||
$<$<CONFIG:Release>:/LTCG:incremental>
|
||||
)
|
||||
endif()
|
||||
|
||||
# Clang
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
target_compile_options(${target} PRIVATE
|
||||
$<$<AND:$<CONFIG:Debug>,$<COMPILE_LANGUAGE:C,CXX>>:-O0 -Wall>
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:-O2 -w -flto>
|
||||
)
|
||||
target_link_options(${target} PRIVATE
|
||||
$<$<CONFIG:Release>:-flto>
|
||||
)
|
||||
endif()
|
||||
function(configure_msvc_target target)
|
||||
target_compile_options(${target} PRIVATE
|
||||
$<$<AND:$<NOT:$<CONFIG:Release>>,$<COMPILE_LANGUAGE:C,CXX>>:/W3>
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/W0>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/MP>
|
||||
$<$<COMPILE_LANGUAGE:C,CXX>:/FS>
|
||||
$<$<COMPILE_LANGUAGE:CXX>:/EHsc>
|
||||
$<$<AND:$<CONFIG:Release>,$<COMPILE_LANGUAGE:C,CXX>>:/GL /O2 /Oi /GT /GF>
|
||||
)
|
||||
endfunction()
|
||||
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/WorldSources.cmake")
|
||||
include("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ClientSources.cmake")
|
||||
|
||||
# ---
|
||||
# Configuration
|
||||
# ---
|
||||
set(MINECRAFT_SHARED_DEFINES
|
||||
_LARGE_WORLDS
|
||||
_DEBUG_MENUS_ENABLED
|
||||
$<$<CONFIG:Debug>:_DEBUG>
|
||||
_CRT_NON_CONFORMING_SWPRINTFS
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
list(TRANSFORM MINECRAFT_WORLD_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/")
|
||||
list(TRANSFORM MINECRAFT_CLIENT_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/")
|
||||
list(APPEND MINECRAFT_CLIENT_SOURCES
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Xbox/MinecraftWindows.rc"
|
||||
)
|
||||
|
||||
# Add platform-specific defines
|
||||
list(APPEND MINECRAFT_SHARED_DEFINES ${PLATFORM_DEFINES})
|
||||
|
||||
# ---
|
||||
# Sources
|
||||
# ---
|
||||
add_subdirectory(Minecraft.World)
|
||||
add_subdirectory(Minecraft.Client)
|
||||
if(PLATFORM_NAME STREQUAL "Windows64") # Server is only supported on Windows for now
|
||||
add_subdirectory(Minecraft.Server)
|
||||
add_library(MinecraftWorld STATIC ${MINECRAFT_WORLD_SOURCES})
|
||||
target_include_directories(MinecraftWorld PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/x64headers"
|
||||
)
|
||||
target_compile_definitions(MinecraftWorld PRIVATE
|
||||
$<$<CONFIG:Debug>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
|
||||
$<$<NOT:$<CONFIG:Debug>>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_LIB;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
|
||||
)
|
||||
if(MSVC)
|
||||
configure_msvc_target(MinecraftWorld)
|
||||
endif()
|
||||
|
||||
# ---
|
||||
# Build versioning
|
||||
# ---
|
||||
set(BUILDVER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/cmake/GenerateBuildVer.cmake")
|
||||
set(BUILDVER_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/generated/Common/BuildVer.h")
|
||||
add_executable(MinecraftClient WIN32 ${MINECRAFT_CLIENT_SOURCES})
|
||||
target_include_directories(MinecraftClient PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Xbox/Sentient/Include"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.World/x64headers"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/"
|
||||
)
|
||||
target_compile_definitions(MinecraftClient PRIVATE
|
||||
$<$<CONFIG:Debug>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
|
||||
$<$<NOT:$<CONFIG:Debug>>:_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64>
|
||||
)
|
||||
if(MSVC)
|
||||
configure_msvc_target(MinecraftClient)
|
||||
target_link_options(MinecraftClient PRIVATE
|
||||
$<$<CONFIG:Release>:/LTCG /INCREMENTAL:NO>
|
||||
)
|
||||
endif()
|
||||
|
||||
add_custom_target(GenerateBuildVer
|
||||
COMMAND ${CMAKE_COMMAND}
|
||||
"-DOUTPUT_FILE=${BUILDVER_OUTPUT}"
|
||||
-P "${BUILDVER_SCRIPT}"
|
||||
COMMENT "Generating BuildVer.h..."
|
||||
VERBATIM
|
||||
set_target_properties(MinecraftClient PROPERTIES
|
||||
VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:MinecraftClient>"
|
||||
)
|
||||
|
||||
add_dependencies(Minecraft.World GenerateBuildVer)
|
||||
add_dependencies(Minecraft.Client GenerateBuildVer)
|
||||
if(PLATFORM_NAME STREQUAL "Windows64")
|
||||
add_dependencies(Minecraft.Server GenerateBuildVer)
|
||||
target_link_libraries(MinecraftClient PRIVATE
|
||||
MinecraftWorld
|
||||
d3d11
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggy_w64.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggyperfmon_w64.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/Iggy/lib/iggyexpruntime_w64.lib"
|
||||
$<$<CONFIG:Debug>:
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>:
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/Windows64/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
)
|
||||
|
||||
if(CMAKE_HOST_WIN32)
|
||||
message(STATUS "Starting redist copy...")
|
||||
execute_process(
|
||||
COMMAND robocopy.exe
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/x64/Release"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
/S /MT /R:0 /W:0 /NP
|
||||
)
|
||||
message(STATUS "Starting asset copy...")
|
||||
execute_process(
|
||||
COMMAND robocopy.exe
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}"
|
||||
/S /MT /R:0 /W:0 /NP
|
||||
/XF "*.cpp" "*.c" "*.h" "*.hpp" "*.asm"
|
||||
"*.xml" "*.lang" "*.vcxproj" "*.vcxproj.*" "*.sln"
|
||||
"*.docx" "*.xls"
|
||||
"*.bat" "*.cmd" "*.ps1" "*.py"
|
||||
"*Test*"
|
||||
/XD "Durango*" "Orbis*" "PS*" "Xbox"
|
||||
)
|
||||
message(STATUS "Patching Windows64Media...")
|
||||
execute_process(
|
||||
COMMAND robocopy.exe
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/DurangoMedia"
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/Windows64Media"
|
||||
/S /MT /R:0 /W:0 /NP
|
||||
/XF "*.h" "*.xml" "*.lang" "*.bat"
|
||||
)
|
||||
elseif(CMAKE_HOST_UNIX)
|
||||
message(STATUS "Starting redist copy...")
|
||||
execute_process(
|
||||
COMMAND rsync -av "${CMAKE_CURRENT_SOURCE_DIR}/x64/Release/" "${CMAKE_CURRENT_BINARY_DIR}/"
|
||||
)
|
||||
message(STATUS "Starting asset copy...")
|
||||
execute_process(
|
||||
COMMAND rsync -av
|
||||
"--exclude=*.cpp" "--exclude=*.c" "--exclude=*.h" "--exclude=*.hpp" "--exclude=*.asm"
|
||||
"--exclude=*.xml" "--exclude=*.lang" "--exclude=*.vcxproj" "--exclude=*.vcxproj.*" "--exclude=*.sln"
|
||||
"--exclude=*.docx" "--exclude=*.xls"
|
||||
"--exclude=*.bat" "--exclude=*.cmd" "--exclude=*.ps1" "--exclude=*.py"
|
||||
"--exclude=*Test*"
|
||||
"--exclude=Durango*" "--exclude=Orbis*" "--exclude=PS*" "--exclude=Xbox"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/" "${CMAKE_CURRENT_BINARY_DIR}/"
|
||||
)
|
||||
message(STATUS "Patching Windows64Media...")
|
||||
execute_process(
|
||||
COMMAND rsync -av
|
||||
"--exclude=*.h" "--exclude=*.xml" "--exclude=*.lang" "--exclude=*.bat"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Minecraft.Client/DurangoMedia/" "${CMAKE_CURRENT_BINARY_DIR}/Windows64Media/"
|
||||
)
|
||||
else()
|
||||
message(FATAL_ERROR "Redist and asset copying is only supported on Windows (Robocopy) and Unix systems (rsync).")
|
||||
endif()
|
||||
|
||||
# ---
|
||||
# Project organisation
|
||||
# ---
|
||||
# Set the startup project for Visual Studio
|
||||
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT Minecraft.Client)
|
||||
|
||||
# Setup folders for Visual Studio, just hides the build targets under a sub folder
|
||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||
set_property(TARGET GenerateBuildVer PROPERTY FOLDER "Build")
|
||||
set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT MinecraftClient)
|
||||
|
|
|
|||
|
|
@ -1,94 +0,0 @@
|
|||
{
|
||||
"version": 5,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "base",
|
||||
"generator": "Ninja Multi-Config",
|
||||
"binaryDir": "${sourceDir}/build/${presetName}",
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "windows64",
|
||||
"displayName": "Windows64",
|
||||
"inherits": "base",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "_WINDOWS64",
|
||||
"PLATFORM_NAME": "Windows64",
|
||||
"IGGY_LIBS": "iggy_w64.lib;iggyperfmon_w64.lib;iggyexpruntime_w64.lib"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "durango",
|
||||
"displayName": "Durango",
|
||||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/durango.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "_DURANGO;_XBOX_ONE",
|
||||
"PLATFORM_NAME": "Durango",
|
||||
"IGGY_LIBS": "iggy_durango.lib;iggyperfmon_durango.lib"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "orbis",
|
||||
"displayName": "ORBIS",
|
||||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/orbis.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "__ORBIS__",
|
||||
"PLATFORM_NAME": "Orbis",
|
||||
"IGGY_LIBS": "libiggy_orbis.a;libiggyperfmon_orbis.a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ps3",
|
||||
"displayName": "PS3",
|
||||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/ps3.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "__PS3__",
|
||||
"PLATFORM_NAME": "PS3",
|
||||
"IGGY_LIBS": "libiggy_ps3.a;libiggyperfmon_ps3.a;libiggyexpruntime_ps3.a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "psvita",
|
||||
"displayName": "PSVita",
|
||||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/psvita.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "__PSVITA__",
|
||||
"PLATFORM_NAME": "PSVita",
|
||||
"IGGY_LIBS": "libiggy_psp2.a;libiggyperfmon_psp2.a"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "xbox360",
|
||||
"displayName": "Xbox 360",
|
||||
"inherits": "base",
|
||||
"toolchainFile": "${sourceDir}/cmake/toolchains/xbox360.cmake",
|
||||
"cacheVariables": {
|
||||
"PLATFORM_DEFINES": "_XBOX",
|
||||
"PLATFORM_NAME": "Xbox"
|
||||
}
|
||||
}
|
||||
],
|
||||
"buildPresets": [
|
||||
{ "name": "windows64-debug", "displayName": "Windows64 - Debug", "configurePreset": "windows64", "configuration": "Debug" },
|
||||
{ "name": "windows64-release", "displayName": "Windows64 - Release", "configurePreset": "windows64", "configuration": "Release" },
|
||||
|
||||
{ "name": "durango-debug", "displayName": "Durango - Debug", "configurePreset": "durango", "configuration": "Debug" },
|
||||
{ "name": "durango-release", "displayName": "Durango - Release", "configurePreset": "durango", "configuration": "Release" },
|
||||
|
||||
{ "name": "orbis-debug", "displayName": "ORBIS - Debug", "configurePreset": "orbis", "configuration": "Debug" },
|
||||
{ "name": "orbis-release", "displayName": "ORBIS - Release", "configurePreset": "orbis", "configuration": "Release" },
|
||||
|
||||
{ "name": "ps3-debug", "displayName": "PS3 - Debug", "configurePreset": "ps3", "configuration": "Debug" },
|
||||
{ "name": "ps3-release", "displayName": "PS3 - Release", "configurePreset": "ps3", "configuration": "Release" },
|
||||
|
||||
{ "name": "psvita-debug", "displayName": "PSVita - Debug", "configurePreset": "psvita", "configuration": "Debug" },
|
||||
{ "name": "psvita-release", "displayName": "PSVita - Release", "configurePreset": "psvita", "configuration": "Release" },
|
||||
|
||||
{ "name": "xbox360-debug", "displayName": "Xbox 360 - Debug", "configurePreset": "xbox360", "configuration": "Debug" },
|
||||
{ "name": "xbox360-release", "displayName": "Xbox 360 - Release", "configurePreset": "xbox360", "configuration": "Release" }
|
||||
]
|
||||
}
|
||||
60
COMPILE.md
60
COMPILE.md
|
|
@ -1,78 +1,46 @@
|
|||
# Compile Instructions
|
||||
|
||||
## Visual Studio
|
||||
## Visual Studio (`.sln`)
|
||||
|
||||
1. Clone or download the repository
|
||||
1. Open the repo folder in Visual Studio 2022+.
|
||||
2. Wait for cmake to configure the project and load all assets (this may take a few minutes on the first run).
|
||||
3. Right click a folder in the solution explorer and switch to the 'CMake Targets View'
|
||||
4. Select platform and configuration from the dropdown. EG: `Windows64 - Debug` or `Windows64 - Release`
|
||||
5. Pick the startup project `Minecraft.Client.exe` or `Minecraft.Server.exe` using the debug targets dropdown
|
||||
6. Build and run the project:
|
||||
1. Open `MinecraftConsoles.sln` in Visual Studio 2022.
|
||||
2. Set `Minecraft.Client` as the Startup Project.
|
||||
3. Select configuration:
|
||||
- `Debug` (recommended), or
|
||||
- `Release`
|
||||
4. Select platform: `Windows64`.
|
||||
5. Build and run:
|
||||
- `Build > Build Solution` (or `Ctrl+Shift+B`)
|
||||
- Start debugging with `F5`.
|
||||
|
||||
### Dedicated server debug arguments
|
||||
|
||||
- Default debugger arguments for `Minecraft.Server`:
|
||||
- `-port 25565 -bind 0.0.0.0 -name DedicatedServer`
|
||||
- You can override arguments in:
|
||||
- `Project Properties > Debugging > Command Arguments`
|
||||
- `Minecraft.Server` post-build copies only the dedicated-server asset set:
|
||||
- `Common/Media/MediaWindows64.arc`
|
||||
- `Common/res`
|
||||
- `Windows64/GameHDD`
|
||||
|
||||
## CMake (Windows x64)
|
||||
|
||||
Configure (use your VS Community instance explicitly):
|
||||
|
||||
Open `Developer PowerShell for VS` and run:
|
||||
|
||||
```powershell
|
||||
cmake --preset windows64
|
||||
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_GENERATOR_INSTANCE="C:/Program Files/Microsoft Visual Studio/2022/Community"
|
||||
```
|
||||
|
||||
Build Debug:
|
||||
|
||||
```powershell
|
||||
cmake --build --preset windows64-debug --target Minecraft.Client
|
||||
cmake --build build --config Debug --target MinecraftClient
|
||||
```
|
||||
|
||||
Build Release:
|
||||
|
||||
```powershell
|
||||
cmake --build --preset windows64-release --target Minecraft.Client
|
||||
```
|
||||
|
||||
Build Dedicated Server (Debug):
|
||||
|
||||
```powershell
|
||||
cmake --build --preset windows64-debug --target Minecraft.Server
|
||||
```
|
||||
|
||||
Build Dedicated Server (Release):
|
||||
|
||||
```powershell
|
||||
cmake --build --preset windows64-release --target Minecraft.Server
|
||||
cmake --build build --config Release --target MinecraftClient
|
||||
```
|
||||
|
||||
Run executable:
|
||||
|
||||
```powershell
|
||||
cd .\build\windows64\Minecraft.Client\Debug
|
||||
.\Minecraft.Client.exe
|
||||
```
|
||||
|
||||
Run dedicated server:
|
||||
|
||||
```powershell
|
||||
cd .\build\windows64\Minecraft.Server\Debug
|
||||
.\Minecraft.Server.exe -port 25565 -bind 0.0.0.0 -name DedicatedServer
|
||||
cd .\build\Debug
|
||||
.\MinecraftClient.exe
|
||||
```
|
||||
|
||||
Notes:
|
||||
- The CMake build is Windows-only and x64-only.
|
||||
- Contributors on macOS or Linux need a Windows machine or VM to build the project. Running the game via Wine is separate from having a supported build environment.
|
||||
- Post-build asset copy is automatic for `Minecraft.Client` in CMake (Debug and Release variants).
|
||||
- Post-build asset copy is automatic for `MinecraftClient` in CMake (Debug and Release variants).
|
||||
- The game relies on relative paths (for example `Common\Media\...`), so launching from the output directory is required.
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
# Scope of Project
|
||||
At the moment, this project's scope is generally limited outside of adding new content to the game (blocks, mobs, items). We are currently prioritizing stability, quality of life, and platform support over these things.
|
||||
|
||||
## Backporting
|
||||
If you're backporting a feature, please read [BACKPORTING.md](./BACKPORTING.md)
|
||||
|
||||
## Parity
|
||||
We are attempting to keep our version of LCE as close to visual and experience parity with the original console experience of LCE as possible. This means that we will not be accepting changes that...
|
||||
- Backport things from Java Edition that did not ever exist in LCE
|
||||
|
|
@ -49,13 +46,6 @@ However, we would accept changes that...
|
|||
- Having workable multi-platform compilation for ARM, Consoles, Linux
|
||||
- Being a good base for further expansion and modding of LCE, such as backports and "modpacks".
|
||||
|
||||
# Scope of PRs
|
||||
All Pull Requests should fully document the changes they include in their file changes. They should also be limited to one general topic and not touch all over the codebase unless its justifiable.
|
||||
|
||||
For example, we would not accept a PR that reworks UI, multiplayer code, and furnace ticking even if its a "fixup" PR as its too difficult to review a ton of code changes that are all irrelevant from each other. However, a PR focused on adding a bunch of commands or fixes several crashes that are otherwise irrelevant to each other would be accepted.
|
||||
|
||||
If your PR includes any undocumented changes it will be closed.
|
||||
|
||||
# Use of AI and LLMs
|
||||
We currently do not accept any new code into the project that was written largely, entirely, or even noticably by an LLM. All contributions should be made by humans that understand the codebase.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,96 +0,0 @@
|
|||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Common.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Durango.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/ORBIS.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/PS3.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/PSVita.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Windows.cmake")
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/cmake/sources/Xbox360.cmake")
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/CommonSources.cmake")
|
||||
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/Utils.cmake")
|
||||
|
||||
# Combine all source files into a single variable for the target
|
||||
# We cant use CMAKE_CONFIGURE_PRESET here as VS doesn't set it, so just rely on the folder
|
||||
set(MINECRAFT_CLIENT_SOURCES
|
||||
${MINECRAFT_CLIENT_COMMON}
|
||||
$<$<STREQUAL:${PLATFORM_NAME},Durango>:${MINECRAFT_CLIENT_DURANGO}>
|
||||
$<$<STREQUAL:${PLATFORM_NAME},Orbis>:${MINECRAFT_CLIENT_ORBIS}>
|
||||
$<$<STREQUAL:${PLATFORM_NAME},PS3>:${MINECRAFT_CLIENT_PS3}>
|
||||
$<$<STREQUAL:${PLATFORM_NAME},PSVita>:${MINECRAFT_CLIENT_PSVITA}>
|
||||
$<$<STREQUAL:${PLATFORM_NAME},Windows64>:${MINECRAFT_CLIENT_WINDOWS}>
|
||||
$<$<STREQUAL:${PLATFORM_NAME},Xbox>:${MINECRAFT_CLIENT_XBOX360}>
|
||||
${SOURCES_COMMON}
|
||||
)
|
||||
|
||||
add_executable(Minecraft.Client ${MINECRAFT_CLIENT_SOURCES})
|
||||
|
||||
# Only define executable on windows
|
||||
if(PLATFORM_NAME STREQUAL "Windows64")
|
||||
set_target_properties(Minecraft.Client PROPERTIES WIN32_EXECUTABLE TRUE)
|
||||
endif()
|
||||
|
||||
target_include_directories(Minecraft.Client PRIVATE
|
||||
"${CMAKE_BINARY_DIR}/generated/" # This is for the generated BuildVer.h
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/Iggy/include"
|
||||
"${CMAKE_SOURCE_DIR}/include/"
|
||||
)
|
||||
target_compile_definitions(Minecraft.Client PRIVATE
|
||||
${MINECRAFT_SHARED_DEFINES}
|
||||
)
|
||||
target_precompile_headers(Minecraft.Client PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:stdafx.h>")
|
||||
set_source_files_properties(compat_shims.cpp PROPERTIES SKIP_PRECOMPILE_HEADERS ON) # This redefines internal MSVC CRT symbols which will cause an issue with PCH
|
||||
|
||||
configure_compiler_target(Minecraft.Client)
|
||||
|
||||
set_target_properties(Minecraft.Client PROPERTIES
|
||||
OUTPUT_NAME "Minecraft.Client"
|
||||
VS_DEBUGGER_WORKING_DIRECTORY "$<TARGET_FILE_DIR:Minecraft.Client>"
|
||||
)
|
||||
|
||||
target_link_libraries(Minecraft.Client PRIVATE
|
||||
Minecraft.World
|
||||
d3d11
|
||||
d3dcompiler
|
||||
XInput9_1_0
|
||||
wsock32
|
||||
legacy_stdio_definitions
|
||||
$<$<CONFIG:Debug>: # Debug 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage_d.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC_d.lib"
|
||||
>
|
||||
$<$<NOT:$<CONFIG:Debug>>: # Release 4J libraries
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Input.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Storage.lib"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/4JLibs/libs/4J_Render_PC.lib"
|
||||
>
|
||||
)
|
||||
|
||||
# Iggy libs
|
||||
foreach(lib IN LISTS IGGY_LIBS)
|
||||
target_link_libraries(Minecraft.Client PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}/Iggy/lib/${lib}")
|
||||
endforeach()
|
||||
|
||||
# ---
|
||||
# Asset / redist copy
|
||||
# ---
|
||||
include("${CMAKE_SOURCE_DIR}/cmake/CopyAssets.cmake")
|
||||
set(ASSET_FOLDER_PAIRS
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/music" "music"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Media" "Common/Media"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/res" "Common/res"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Trial" "Common/Trial"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Common/Tutorial" "Common/Tutorial"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/${PLATFORM_NAME}Media" "${PLATFORM_NAME}Media"
|
||||
)
|
||||
setup_asset_folder_copy(Minecraft.Client "${ASSET_FOLDER_PAIRS}")
|
||||
|
||||
# Copy redist files
|
||||
add_copyredist_target(Minecraft.Client)
|
||||
|
||||
# Make sure GameHDD exists on Windows
|
||||
if(PLATFORM_NAME STREQUAL "Windows64")
|
||||
add_gamehdd_target(Minecraft.Client)
|
||||
endif()
|
||||
|
|
@ -149,56 +149,8 @@ bool ClientConnection::isPrimaryConnection() const
|
|||
return g_NetworkManager.IsHost() || m_userIndex == ProfileManager.GetPrimaryPad();
|
||||
}
|
||||
|
||||
ClientConnection* ClientConnection::findPrimaryConnection() const
|
||||
{
|
||||
if (level == nullptr) return nullptr;
|
||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||
MultiPlayerLevel* mpLevel = (MultiPlayerLevel*)level;
|
||||
for (ClientConnection* conn : mpLevel->connections)
|
||||
{
|
||||
if (conn != this && conn->m_userIndex == primaryPad)
|
||||
return conn;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
bool ClientConnection::shouldProcessForEntity(int entityId) const
|
||||
{
|
||||
if (g_NetworkManager.IsHost()) return true;
|
||||
if (m_userIndex == ProfileManager.GetPrimaryPad()) return true;
|
||||
|
||||
ClientConnection* primary = findPrimaryConnection();
|
||||
if (primary == nullptr) return true;
|
||||
return !primary->isTrackingEntity(entityId);
|
||||
}
|
||||
|
||||
bool ClientConnection::shouldProcessForPosition(int blockX, int blockZ) const
|
||||
{
|
||||
if (g_NetworkManager.IsHost()) return true;
|
||||
if (m_userIndex == ProfileManager.GetPrimaryPad()) return true;
|
||||
|
||||
ClientConnection* primary = findPrimaryConnection();
|
||||
if (primary == nullptr) return true;
|
||||
return !primary->m_visibleChunks.count(chunkKey(blockX >> 4, blockZ >> 4));
|
||||
}
|
||||
|
||||
bool ClientConnection::anyOtherConnectionHasChunk(int x, int z) const
|
||||
{
|
||||
if (level == nullptr) return false;
|
||||
MultiPlayerLevel* mpLevel = (MultiPlayerLevel*)level;
|
||||
int64_t key = chunkKey(x, z);
|
||||
for (ClientConnection* conn : mpLevel->connections)
|
||||
{
|
||||
if (conn != this && conn->m_visibleChunks.count(key))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
ClientConnection::~ClientConnection()
|
||||
{
|
||||
m_trackedEntityIds.clear();
|
||||
m_visibleChunks.clear();
|
||||
delete connection;
|
||||
delete random;
|
||||
delete savedDataStorage;
|
||||
|
|
@ -712,7 +664,6 @@ void ClientConnection::handleAddEntity(shared_ptr<AddEntityPacket> packet)
|
|||
}
|
||||
e->entityId = packet->id;
|
||||
level->putEntity(packet->id, e);
|
||||
m_trackedEntityIds.insert(packet->id);
|
||||
|
||||
if (packet->data > -1) // 4J - changed "no data" value to be -1, we can have a valid entity id of 0
|
||||
{
|
||||
|
|
@ -761,7 +712,6 @@ void ClientConnection::handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket>
|
|||
e->xRot = 0;
|
||||
e->entityId = packet->id;
|
||||
level->putEntity(packet->id, e);
|
||||
m_trackedEntityIds.insert(packet->id);
|
||||
}
|
||||
|
||||
void ClientConnection::handleAddGlobalEntity(shared_ptr<AddGlobalEntityPacket> packet)
|
||||
|
|
@ -788,13 +738,13 @@ void ClientConnection::handleAddPainting(shared_ptr<AddPaintingPacket> packet)
|
|||
{
|
||||
shared_ptr<Painting> painting = std::make_shared<Painting>(level, packet->x, packet->y, packet->z, packet->dir, packet->motive);
|
||||
level->putEntity(packet->id, painting);
|
||||
m_trackedEntityIds.insert(packet->id);
|
||||
}
|
||||
|
||||
void ClientConnection::handleSetEntityMotion(shared_ptr<SetEntityMotionPacket> packet)
|
||||
{
|
||||
if (!shouldProcessForEntity(packet->id))
|
||||
if (!isPrimaryConnection())
|
||||
{
|
||||
// Secondary connection: only accept motion for our own local player (knockback)
|
||||
if (minecraft->localplayers[m_userIndex] == NULL ||
|
||||
packet->id != minecraft->localplayers[m_userIndex]->entityId)
|
||||
return;
|
||||
|
|
@ -989,7 +939,6 @@ void ClientConnection::handleAddPlayer(shared_ptr<AddPlayerPacket> packet)
|
|||
app.DebugPrintf("Custom cape for player %ls is %ls\n",player->name.c_str(),player->customTextureUrl2.c_str());
|
||||
|
||||
level->putEntity(packet->id, player);
|
||||
m_trackedEntityIds.insert(packet->id);
|
||||
|
||||
vector<shared_ptr<SynchedEntityData::DataItem> > *unpackedData = packet->getUnpackedData();
|
||||
if (unpackedData != nullptr)
|
||||
|
|
@ -1030,7 +979,7 @@ void ClientConnection::handleSetCarriedItem(shared_ptr<SetCarriedItemPacket> pac
|
|||
|
||||
void ClientConnection::handleMoveEntity(shared_ptr<MoveEntityPacket> packet)
|
||||
{
|
||||
if (!shouldProcessForEntity(packet->id)) return;
|
||||
if (!isPrimaryConnection()) return;
|
||||
shared_ptr<Entity> e = getEntity(packet->id);
|
||||
if (e == nullptr) return;
|
||||
e->xp += packet->xa;
|
||||
|
|
@ -1060,7 +1009,7 @@ void ClientConnection::handleRotateMob(shared_ptr<RotateHeadPacket> packet)
|
|||
|
||||
void ClientConnection::handleMoveEntitySmall(shared_ptr<MoveEntityPacketSmall> packet)
|
||||
{
|
||||
if (!shouldProcessForEntity(packet->id)) return;
|
||||
if (!isPrimaryConnection()) return;
|
||||
shared_ptr<Entity> e = getEntity(packet->id);
|
||||
if (e == nullptr) return;
|
||||
e->xp += packet->xa;
|
||||
|
|
@ -1119,7 +1068,6 @@ void ClientConnection::handleRemoveEntity(shared_ptr<RemoveEntitiesPacket> packe
|
|||
#endif
|
||||
for (int i = 0; i < packet->ids.length; i++)
|
||||
{
|
||||
m_trackedEntityIds.erase(packet->ids[i]);
|
||||
level->removeEntity(packet->ids[i]);
|
||||
}
|
||||
}
|
||||
|
|
@ -1188,35 +1136,19 @@ void ClientConnection::handleChunkVisibilityArea(shared_ptr<ChunkVisibilityAreaP
|
|||
{
|
||||
if (level == NULL) return;
|
||||
for(int z = packet->m_minZ; z <= packet->m_maxZ; ++z)
|
||||
{
|
||||
for(int x = packet->m_minX; x <= packet->m_maxX; ++x)
|
||||
{
|
||||
m_visibleChunks.insert(chunkKey(x, z));
|
||||
level->setChunkVisible(x, z, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ClientConnection::handleChunkVisibility(shared_ptr<ChunkVisibilityPacket> packet)
|
||||
{
|
||||
if (level == NULL) return;
|
||||
if (packet->visible)
|
||||
{
|
||||
m_visibleChunks.insert(chunkKey(packet->x, packet->z));
|
||||
level->setChunkVisible(packet->x, packet->z, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_visibleChunks.erase(chunkKey(packet->x, packet->z));
|
||||
if (!anyOtherConnectionHasChunk(packet->x, packet->z))
|
||||
{
|
||||
level->setChunkVisible(packet->x, packet->z, false);
|
||||
}
|
||||
}
|
||||
level->setChunkVisible(packet->x, packet->z, packet->visible);
|
||||
}
|
||||
|
||||
void ClientConnection::handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
// 4J - changed to encode level in packet
|
||||
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx];
|
||||
if( dimensionLevel )
|
||||
|
|
@ -1286,6 +1218,7 @@ void ClientConnection::handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket>
|
|||
|
||||
void ClientConnection::handleBlockRegionUpdate(shared_ptr<BlockRegionUpdatePacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
// 4J - changed to encode level in packet
|
||||
MultiPlayerLevel *dimensionLevel = (MultiPlayerLevel *)minecraft->levels[packet->levelIdx];
|
||||
if( dimensionLevel )
|
||||
|
|
@ -1346,6 +1279,7 @@ void ClientConnection::handleBlockRegionUpdate(shared_ptr<BlockRegionUpdatePacke
|
|||
|
||||
void ClientConnection::handleTileUpdate(shared_ptr<TileUpdatePacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
// 4J added - using a block of 255 to signify that this is a packet for destroying a tile, where we need to inform the level renderer that we are about to do so.
|
||||
// This is used in creative mode as the point where a tile is first destroyed at the client end of things. Packets formed like this are potentially sent from
|
||||
// ServerPlayerGameMode::destroyBlock
|
||||
|
|
@ -1460,7 +1394,7 @@ void ClientConnection::send(shared_ptr<Packet> packet)
|
|||
|
||||
void ClientConnection::handleTakeItemEntity(shared_ptr<TakeItemEntityPacket> packet)
|
||||
{
|
||||
if (!shouldProcessForEntity(packet->itemId)) return;
|
||||
if (!isPrimaryConnection()) return;
|
||||
shared_ptr<Entity> from = getEntity(packet->itemId);
|
||||
shared_ptr<LivingEntity> to = dynamic_pointer_cast<LivingEntity>(getEntity(packet->playerId));
|
||||
|
||||
|
|
@ -2480,8 +2414,6 @@ void ClientConnection::close()
|
|||
// If it's already done, then we don't need to do anything here. And in fact trying to do something could cause a crash
|
||||
if(done) return;
|
||||
done = true;
|
||||
m_trackedEntityIds.clear();
|
||||
m_visibleChunks.clear();
|
||||
connection->flush();
|
||||
connection->close(DisconnectPacket::eDisconnect_Closed);
|
||||
}
|
||||
|
|
@ -2521,7 +2453,6 @@ void ClientConnection::handleAddMob(shared_ptr<AddMobPacket> packet)
|
|||
mob->yd = packet->yd / 8000.0f;
|
||||
mob->zd = packet->zd / 8000.0f;
|
||||
level->putEntity(packet->id, mob);
|
||||
m_trackedEntityIds.insert(packet->id);
|
||||
|
||||
vector<shared_ptr<SynchedEntityData::DataItem> > *unpackedData = packet->getUnpackedData();
|
||||
if (unpackedData != nullptr)
|
||||
|
|
@ -2861,9 +2792,6 @@ void ClientConnection::handleRespawn(shared_ptr<RespawnPacket> packet)
|
|||
// so it doesn't leak into the new dimension
|
||||
level->playStreamingMusic(L"", 0, 0, 0);
|
||||
|
||||
m_trackedEntityIds.clear();
|
||||
m_visibleChunks.clear();
|
||||
|
||||
// Remove client connection from this level
|
||||
level->removeClientConnection(this, false);
|
||||
|
||||
|
|
@ -2971,7 +2899,8 @@ void ClientConnection::handleRespawn(shared_ptr<RespawnPacket> packet)
|
|||
|
||||
void ClientConnection::handleExplosion(shared_ptr<ExplodePacket> packet)
|
||||
{
|
||||
if (shouldProcessForPosition((int)packet->x, (int)packet->z))
|
||||
// World modification (block destruction) must only happen once
|
||||
if (isPrimaryConnection())
|
||||
{
|
||||
if(!packet->m_bKnockbackOnly)
|
||||
{
|
||||
|
|
@ -3315,6 +3244,7 @@ void ClientConnection::handleTileEditorOpen(shared_ptr<TileEditorOpenPacket> pac
|
|||
|
||||
void ClientConnection::handleSignUpdate(shared_ptr<SignUpdatePacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
app.DebugPrintf("ClientConnection::handleSignUpdate - ");
|
||||
if (minecraft->level->hasChunkAt(packet->x, packet->y, packet->z))
|
||||
{
|
||||
|
|
@ -3348,6 +3278,7 @@ void ClientConnection::handleSignUpdate(shared_ptr<SignUpdatePacket> packet)
|
|||
|
||||
void ClientConnection::handleTileEntityData(shared_ptr<TileEntityDataPacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
if (minecraft->level->hasChunkAt(packet->x, packet->y, packet->z))
|
||||
{
|
||||
shared_ptr<TileEntity> te = minecraft->level->getTileEntity(packet->x, packet->y, packet->z);
|
||||
|
|
@ -3400,6 +3331,7 @@ void ClientConnection::handleContainerClose(shared_ptr<ContainerClosePacket> pac
|
|||
|
||||
void ClientConnection::handleTileEvent(shared_ptr<TileEventPacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
PIXBeginNamedEvent(0,"Handle tile event\n");
|
||||
minecraft->level->tileEvent(packet->x, packet->y, packet->z, packet->tile, packet->b0, packet->b1);
|
||||
PIXEndNamedEvent();
|
||||
|
|
@ -3407,6 +3339,7 @@ void ClientConnection::handleTileEvent(shared_ptr<TileEventPacket> packet)
|
|||
|
||||
void ClientConnection::handleTileDestruction(shared_ptr<TileDestructionPacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
minecraft->level->destroyTileProgress(packet->getEntityId(), packet->getX(), packet->getY(), packet->getZ(), packet->getState());
|
||||
}
|
||||
|
||||
|
|
@ -3488,6 +3421,7 @@ void ClientConnection::handleGameEvent(shared_ptr<GameEventPacket> gameEventPack
|
|||
|
||||
void ClientConnection::handleComplexItemData(shared_ptr<ComplexItemDataPacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
if (packet->itemType == Item::map->id)
|
||||
{
|
||||
MapItem::getSavedData(packet->itemId, minecraft->level)->handleComplexItemData(packet->data);
|
||||
|
|
@ -3502,7 +3436,7 @@ void ClientConnection::handleComplexItemData(shared_ptr<ComplexItemDataPacket> p
|
|||
|
||||
void ClientConnection::handleLevelEvent(shared_ptr<LevelEventPacket> packet)
|
||||
{
|
||||
if (!shouldProcessForPosition(packet->x, packet->z)) return;
|
||||
if (!isPrimaryConnection()) return;
|
||||
if (packet->type == LevelEvent::SOUND_DRAGON_DEATH)
|
||||
{
|
||||
for(unsigned int i = 0; i < XUSER_MAX_COUNT; ++i)
|
||||
|
|
@ -3522,6 +3456,8 @@ void ClientConnection::handleLevelEvent(shared_ptr<LevelEventPacket> packet)
|
|||
{
|
||||
minecraft->level->levelEvent(packet->type, packet->x, packet->y, packet->z, packet->data);
|
||||
}
|
||||
|
||||
minecraft->level->levelEvent(packet->type, packet->x, packet->y, packet->z, packet->data);
|
||||
}
|
||||
|
||||
void ClientConnection::handleAwardStat(shared_ptr<AwardStatPacket> packet)
|
||||
|
|
@ -3724,6 +3660,7 @@ void ClientConnection::handlePlayerAbilities(shared_ptr<PlayerAbilitiesPacket> p
|
|||
|
||||
void ClientConnection::handleSoundEvent(shared_ptr<LevelSoundPacket> packet)
|
||||
{
|
||||
if (!isPrimaryConnection()) return;
|
||||
minecraft->level->playLocalSound(packet->getX(), packet->getY(), packet->getZ(), packet->getSound(), packet->getVolume(), packet->getPitch(), false);
|
||||
}
|
||||
|
||||
|
|
@ -4036,8 +3973,7 @@ void ClientConnection::handleSetPlayerTeamPacket(shared_ptr<SetPlayerTeamPacket>
|
|||
|
||||
void ClientConnection::handleParticleEvent(shared_ptr<LevelParticlesPacket> packet)
|
||||
{
|
||||
ePARTICLE_TYPE particleId = (ePARTICLE_TYPE)Integer::parseInt(packet->getName());
|
||||
|
||||
if (!isPrimaryConnection()) return;
|
||||
for (int i = 0; i < packet->getCount(); i++)
|
||||
{
|
||||
double xVarience = random->nextGaussian() * packet->getXDist();
|
||||
|
|
@ -4047,6 +3983,10 @@ void ClientConnection::handleParticleEvent(shared_ptr<LevelParticlesPacket> pack
|
|||
double ya = random->nextGaussian() * packet->getMaxSpeed();
|
||||
double za = random->nextGaussian() * packet->getMaxSpeed();
|
||||
|
||||
// TODO: determine particle ID from name
|
||||
assert(0);
|
||||
ePARTICLE_TYPE particleId = eParticleType_heart;
|
||||
|
||||
level->addParticle(particleId, packet->getX() + xVarience, packet->getY() + yVarience, packet->getZ() + zVarience, xa, ya, za);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
#pragma once
|
||||
#include <unordered_set>
|
||||
#include "..\Minecraft.World\net.minecraft.network.h"
|
||||
class Minecraft;
|
||||
class MultiPlayerLevel;
|
||||
|
|
@ -45,20 +44,6 @@ public:
|
|||
private:
|
||||
DWORD m_userIndex; // 4J Added
|
||||
bool isPrimaryConnection() const;
|
||||
|
||||
std::unordered_set<int> m_trackedEntityIds;
|
||||
std::unordered_set<int64_t> m_visibleChunks;
|
||||
|
||||
static int64_t chunkKey(int x, int z) { return ((int64_t)x << 32) | ((int64_t)z & 0xFFFFFFFF); }
|
||||
|
||||
ClientConnection* findPrimaryConnection() const;
|
||||
bool shouldProcessForEntity(int entityId) const;
|
||||
bool shouldProcessForPosition(int blockX, int blockZ) const;
|
||||
bool anyOtherConnectionHasChunk(int x, int z) const;
|
||||
|
||||
public:
|
||||
bool isTrackingEntity(int entityId) const { return m_trackedEntityIds.count(entityId) > 0; }
|
||||
|
||||
public:
|
||||
SavedDataStorage *savedDataStorage;
|
||||
ClientConnection(Minecraft *minecraft, const wstring& ip, int port);
|
||||
|
|
|
|||
|
|
@ -260,9 +260,9 @@ void SoundEngine::updateMiniAudio()
|
|||
continue;
|
||||
}
|
||||
|
||||
float finalVolume = s->info.volume * m_MasterEffectsVolume * SFX_VOLUME_MULTIPLIER;
|
||||
if (finalVolume > SFX_MAX_GAIN)
|
||||
finalVolume = SFX_MAX_GAIN;
|
||||
float finalVolume = s->info.volume * m_MasterEffectsVolume;
|
||||
if (finalVolume > 1.0f)
|
||||
finalVolume = 1.0f;
|
||||
|
||||
ma_sound_set_volume(&s->sound, finalVolume);
|
||||
ma_sound_set_pitch(&s->sound, s->info.pitch);
|
||||
|
|
@ -557,13 +557,10 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
|
|||
}
|
||||
|
||||
ma_sound_set_spatialization_enabled(&s->sound, MA_TRUE);
|
||||
ma_sound_set_min_distance(&s->sound, SFX_3D_MIN_DISTANCE);
|
||||
ma_sound_set_max_distance(&s->sound, SFX_3D_MAX_DISTANCE);
|
||||
ma_sound_set_rolloff(&s->sound, SFX_3D_ROLLOFF);
|
||||
|
||||
float finalVolume = volume * m_MasterEffectsVolume * SFX_VOLUME_MULTIPLIER;
|
||||
if (finalVolume > SFX_MAX_GAIN)
|
||||
finalVolume = SFX_MAX_GAIN;
|
||||
float finalVolume = volume * m_MasterEffectsVolume;
|
||||
if (finalVolume > 1.0f)
|
||||
finalVolume = 1.0f;
|
||||
|
||||
ma_sound_set_volume(&s->sound, finalVolume);
|
||||
ma_sound_set_pitch(&s->sound, pitch);
|
||||
|
|
|
|||
|
|
@ -6,12 +6,6 @@ using namespace std;
|
|||
|
||||
#include "miniaudio.h"
|
||||
|
||||
constexpr float SFX_3D_MIN_DISTANCE = 1.0f;
|
||||
constexpr float SFX_3D_MAX_DISTANCE = 16.0f;
|
||||
constexpr float SFX_3D_ROLLOFF = 0.5f;
|
||||
constexpr float SFX_VOLUME_MULTIPLIER = 1.5f;
|
||||
constexpr float SFX_MAX_GAIN = 1.5f;
|
||||
|
||||
enum eMUSICFILES
|
||||
{
|
||||
eStream_Overworld_Calm1 = 0,
|
||||
|
|
|
|||
28
Minecraft.Client/Common/CommonMedia.sln
Normal file
28
Minecraft.Client/Common/CommonMedia.sln
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2012
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CommonMedia", "CommonMedia.vcxproj", "{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(TeamFoundationVersionControl) = preSolution
|
||||
SccNumberOfProjects = 2
|
||||
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
|
||||
SccTeamFoundationServer = http://tfs_server:8080/tfs/storiespark
|
||||
SccProjectUniqueName0 = CommonMedia.vcxproj
|
||||
SccLocalPath0 = .
|
||||
SccLocalPath1 = .
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
115
Minecraft.Client/Common/CommonMedia.vcxproj
Normal file
115
Minecraft.Client/Common/CommonMedia.vcxproj
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Media\ChestMenu720.swf" />
|
||||
<None Include="Media\CreateWorldMenu720.swf" />
|
||||
<None Include="Media\CreativeMenu720.swf" />
|
||||
<None Include="Media\DebugMenu720.swf" />
|
||||
<None Include="Media\FullscreenProgress720.swf" />
|
||||
<None Include="Media\HUD720.swf" />
|
||||
<None Include="Media\InventoryMenu720.swf" />
|
||||
<None Include="Media\languages.loc" />
|
||||
<None Include="Media\LaunchMoreOptionsMenu720.swf" />
|
||||
<None Include="Media\LoadMenu720.swf" />
|
||||
<None Include="Media\LoadOrJoinMenu720.swf" />
|
||||
<None Include="Media\MainMenu720.swf" />
|
||||
<None Include="Media\media.arc" />
|
||||
<None Include="Media\Panorama720.swf" />
|
||||
<None Include="Media\PauseMenu720.swf" />
|
||||
<None Include="Media\skin.swf" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Media\strings.resx" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="Media\media.txt" />
|
||||
<Text Include="Media\strings_begin.txt" />
|
||||
<Text Include="Media\strings_Controls.txt" />
|
||||
<Text Include="Media\strings_Credits.txt" />
|
||||
<Text Include="Media\strings_Descriptions.txt" />
|
||||
<Text Include="Media\strings_end.txt" />
|
||||
<Text Include="Media\strings_HowToPlay.txt" />
|
||||
<Text Include="Media\strings_ItemsAndTiles.txt" />
|
||||
<Text Include="Media\strings_Misc.txt" />
|
||||
<Text Include="Media\strings_PotionsAndEnchantments.txt" />
|
||||
<Text Include="Media\strings_Tips.txt" />
|
||||
<Text Include="Media\strings_Tooltips.txt" />
|
||||
<Text Include="Media\strings_Tutorial.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Durango\strings.h" />
|
||||
<ClInclude Include="..\Orbis\strings.h" />
|
||||
<ClInclude Include="..\PS3\strings.h" />
|
||||
<ClInclude Include="..\Windows64\strings.h" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{21BBD32C-AF5E-4741-8B80-3B73FC0D0F27}</ProjectGuid>
|
||||
<Keyword>MakeFileProj</Keyword>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<NMakeBuildCommandLine>echo Creating languages.loc
|
||||
copy .\Media\strings.resx .\Media\en-EN.lang
|
||||
copy .\Media\fr-FR\strings.resx .\Media\fr-FR\fr-FR.lang
|
||||
copy .\Media\ja-JP\strings.resx .\Media\ja-JP\ja-JP.lang
|
||||
..\..\..\Tools\NewLocalisationPacker.exe --static .\Media .\Media\languages.loc
|
||||
|
||||
echo Making archive
|
||||
..\..\..\Tools\ArchiveFilePacker.exe -cd $(ProjectDir)\Media media.arc media.txt
|
||||
|
||||
echo Copying Durango strings.h
|
||||
copy .\Media\strings.h ..\Durango\strings.h
|
||||
|
||||
echo Copying PS3 strings.h
|
||||
copy .\Media\strings.h ..\PS3\strings.h
|
||||
|
||||
echo Copying PS4 strings.h
|
||||
copy .\Media\strings.h ..\Orbis\strings.h
|
||||
|
||||
echo Copying Win strings.h
|
||||
copy .\Media\strings.h ..\Windows64\strings.h</NMakeBuildCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
136
Minecraft.Client/Common/CommonMedia.vcxproj.filters
Normal file
136
Minecraft.Client/Common/CommonMedia.vcxproj.filters
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="IggyMedia">
|
||||
<UniqueIdentifier>{55c7ab2e-b3e5-4aed-9ffe-3308591d9c34}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Strings">
|
||||
<UniqueIdentifier>{eaa0eb72-0b27-4080-ad53-f68e42f37ba8}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Archive">
|
||||
<UniqueIdentifier>{711ad95b-eb56-4e18-b001-34ad7b8075a3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Archive\Win64">
|
||||
<UniqueIdentifier>{1432ec3d-c5d0-46da-91b6-e7737095a97e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Archive\PS4">
|
||||
<UniqueIdentifier>{4b2aeaf1-04d7-454d-b2d9-08364799831c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Archive\PS3">
|
||||
<UniqueIdentifier>{4b0eaef6-fa2f-4605-b0da-a81ffb5659bc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Archive\Durango">
|
||||
<UniqueIdentifier>{bf1c74da-21f1-4bdd-98ed-83457946e4cc}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Media\ChestMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\CreateWorldMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\CreativeMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\DebugMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\FullscreenProgress720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\HUD720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\InventoryMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\media.arc">
|
||||
<Filter>Archive</Filter>
|
||||
</None>
|
||||
<None Include="Media\languages.loc">
|
||||
<Filter>Archive</Filter>
|
||||
</None>
|
||||
<None Include="Media\skin.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\MainMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\Panorama720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\LoadOrJoinMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\LaunchMoreOptionsMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\LoadMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
<None Include="Media\PauseMenu720.swf">
|
||||
<Filter>IggyMedia</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Media\strings.resx">
|
||||
<Filter>Strings</Filter>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="Media\strings_begin.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_Controls.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_Credits.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_Descriptions.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_end.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_HowToPlay.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_ItemsAndTiles.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_Misc.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_PotionsAndEnchantments.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_Tips.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_Tooltips.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\strings_Tutorial.txt">
|
||||
<Filter>Strings</Filter>
|
||||
</Text>
|
||||
<Text Include="Media\media.txt">
|
||||
<Filter>Archive</Filter>
|
||||
</Text>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Durango\strings.h">
|
||||
<Filter>Archive\Durango</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\PS3\strings.h">
|
||||
<Filter>Archive\PS3</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Orbis\strings.h">
|
||||
<Filter>Archive\PS4</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Windows64\strings.h">
|
||||
<Filter>Archive\Win64</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -1,32 +1,21 @@
|
|||
#include "stdafx.h"
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "..\..\Minecraft.Server\ServerLogManager.h"
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
// Name: DebugSpewV()
|
||||
// Desc: Internal helper function
|
||||
//--------------------------------------------------------------------------------------
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
static VOID DebugSpewV( const CHAR* strFormat, va_list pArgList )
|
||||
static VOID DebugSpewV( const CHAR* strFormat, const va_list pArgList )
|
||||
{
|
||||
#if defined __PS3__ || defined __ORBIS__ || defined __PSVITA__
|
||||
assert(0);
|
||||
assert(0);
|
||||
#else
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Dedicated server routes legacy debug spew through ServerLogger to preserve CLI prompt handling.
|
||||
if (ServerRuntime::ServerLogManager::ShouldForwardClientDebugLogs())
|
||||
{
|
||||
ServerRuntime::ServerLogManager::ForwardClientDebugSpewLogV(strFormat, pArgList);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
CHAR str[2048];
|
||||
// Use the secure CRT to avoid buffer overruns. Specify a count of
|
||||
// _TRUNCATE so that too long strings will be silently truncated
|
||||
// rather than triggering an error.
|
||||
_vsnprintf_s( str, _TRUNCATE, strFormat, pArgList );
|
||||
OutputDebugStringA( str );
|
||||
CHAR str[2048];
|
||||
// Use the secure CRT to avoid buffer overruns. Specify a count of
|
||||
// _TRUNCATE so that too long strings will be silently truncated
|
||||
// rather than triggering an error.
|
||||
_vsnprintf_s( str, _TRUNCATE, strFormat, pArgList );
|
||||
OutputDebugStringA( str );
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
@ -42,9 +31,10 @@ VOID CDECL DebugPrintf( const CHAR* strFormat, ... )
|
|||
#endif
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
va_list pArgList;
|
||||
va_start( pArgList, strFormat );
|
||||
DebugSpewV( strFormat, pArgList );
|
||||
va_end( pArgList );
|
||||
va_list pArgList;
|
||||
va_start( pArgList, strFormat );
|
||||
DebugSpewV( strFormat, pArgList );
|
||||
va_end( pArgList );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,9 +38,6 @@
|
|||
#include "GameRules\ConsoleSchematicFile.h"
|
||||
#include "..\User.h"
|
||||
#include "..\..\Minecraft.World\LevelData.h"
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
#include "..\..\Minecraft.Server\ServerLogManager.h"
|
||||
#endif
|
||||
#include "..\..\Minecraft.World\net.minecraft.world.entity.player.h"
|
||||
#include "..\EntityRenderDispatcher.h"
|
||||
#include "..\..\Minecraft.World\compression.h"
|
||||
|
|
@ -243,21 +240,12 @@ void CMinecraftApp::DebugPrintf(const char *szFormat, ...)
|
|||
{
|
||||
|
||||
#ifndef _FINAL_BUILD
|
||||
va_list ap;
|
||||
va_start(ap, szFormat);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Dedicated server routes client debug spew through ServerLogger so CLI output stays prompt-safe.
|
||||
if (ServerRuntime::ServerLogManager::ShouldForwardClientDebugLogs())
|
||||
{
|
||||
ServerRuntime::ServerLogManager::ForwardClientAppDebugLogV(szFormat, ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
char buf[1024];
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
OutputDebugStringA(buf);
|
||||
char buf[1024];
|
||||
va_list ap;
|
||||
va_start(ap, szFormat);
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
OutputDebugStringA(buf);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
|
@ -265,62 +253,53 @@ void CMinecraftApp::DebugPrintf(const char *szFormat, ...)
|
|||
void CMinecraftApp::DebugPrintf(int user, const char *szFormat, ...)
|
||||
{
|
||||
#ifndef _FINAL_BUILD
|
||||
if(user == USER_NONE)
|
||||
return;
|
||||
va_list ap;
|
||||
va_start(ap, szFormat);
|
||||
#if defined(_WINDOWS64) && defined(MINECRAFT_SERVER_BUILD)
|
||||
// Dedicated server routes client debug spew through ServerLogger so CLI output stays prompt-safe.
|
||||
if (ServerRuntime::ServerLogManager::ShouldForwardClientDebugLogs())
|
||||
{
|
||||
ServerRuntime::ServerLogManager::ForwardClientUserDebugLogV(user, szFormat, ap);
|
||||
va_end(ap);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
char buf[1024];
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
if(user == USER_NONE)
|
||||
return;
|
||||
char buf[1024];
|
||||
va_list ap;
|
||||
va_start(ap, szFormat);
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
#ifdef __PS3__
|
||||
unsigned int writelen;
|
||||
sys_tty_write(SYS_TTYP_USER1 + ( user - 1 ), buf, strlen(buf), &writelen );
|
||||
unsigned int writelen;
|
||||
sys_tty_write(SYS_TTYP_USER1 + ( user - 1 ), buf, strlen(buf), &writelen );
|
||||
#elif defined __PSVITA__
|
||||
switch(user)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
SceUID tty2 = sceIoOpen("tty2:", SCE_O_WRONLY, 0);
|
||||
if(tty2>=0)
|
||||
{
|
||||
std::string string1(buf);
|
||||
sceIoWrite(tty2, string1.c_str(), string1.length());
|
||||
sceIoClose(tty2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
SceUID tty3 = sceIoOpen("tty3:", SCE_O_WRONLY, 0);
|
||||
if(tty3>=0)
|
||||
{
|
||||
std::string string1(buf);
|
||||
sceIoWrite(tty3, string1.c_str(), string1.length());
|
||||
sceIoClose(tty3);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OutputDebugStringA(buf);
|
||||
break;
|
||||
}
|
||||
switch(user)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
SceUID tty2 = sceIoOpen("tty2:", SCE_O_WRONLY, 0);
|
||||
if(tty2>=0)
|
||||
{
|
||||
std::string string1(buf);
|
||||
sceIoWrite(tty2, string1.c_str(), string1.length());
|
||||
sceIoClose(tty2);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
{
|
||||
SceUID tty3 = sceIoOpen("tty3:", SCE_O_WRONLY, 0);
|
||||
if(tty3>=0)
|
||||
{
|
||||
std::string string1(buf);
|
||||
sceIoWrite(tty3, string1.c_str(), string1.length());
|
||||
sceIoClose(tty3);
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
OutputDebugStringA(buf);
|
||||
break;
|
||||
}
|
||||
#else
|
||||
OutputDebugStringA(buf);
|
||||
OutputDebugStringA(buf);
|
||||
#endif
|
||||
#ifndef _XBOX
|
||||
if(user == USER_UI)
|
||||
{
|
||||
ui.logDebugString(buf);
|
||||
}
|
||||
if(user == USER_UI)
|
||||
{
|
||||
ui.logDebugString(buf);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
|
||||
const WCHAR *DLCManager::wchTypeNamesA[]=
|
||||
{
|
||||
L"XMLVERSION",
|
||||
L"DISPLAYNAME",
|
||||
L"THEMENAME",
|
||||
L"FREE",
|
||||
|
|
@ -388,65 +387,41 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||
// // unsigned long, p = number of parameters
|
||||
// // p * DLC_FILE_PARAM describing each parameter for this file
|
||||
// // ulFileSize bytes of data blob of the file added
|
||||
unsigned int uiVersion=readUInt32(pbData, false);
|
||||
unsigned int uiVersion=*(unsigned int *)pbData;
|
||||
uiCurrentByte+=sizeof(int);
|
||||
|
||||
bool bSwapEndian = false;
|
||||
unsigned int uiVersionSwapped = SwapInt32(uiVersion);
|
||||
if (uiVersion >= 0 && uiVersion <= CURRENT_DLC_VERSION_NUM) {
|
||||
bSwapEndian = false;
|
||||
} else if (uiVersionSwapped >= 0 && uiVersionSwapped <= CURRENT_DLC_VERSION_NUM) {
|
||||
bSwapEndian = true;
|
||||
} else {
|
||||
if(pbData!=nullptr) delete [] pbData;
|
||||
app.DebugPrintf("Unknown DLC version of %d\n", uiVersion);
|
||||
if(uiVersion < CURRENT_DLC_VERSION_NUM)
|
||||
{
|
||||
if(pbData!=nullptr) delete [] pbData;
|
||||
app.DebugPrintf("DLC version of %d is too old to be read\n", uiVersion);
|
||||
return false;
|
||||
}
|
||||
pack->SetDataPointer(pbData);
|
||||
unsigned int uiParameterCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian);
|
||||
unsigned int uiParameterCount=*(unsigned int *)&pbData[uiCurrentByte];
|
||||
uiCurrentByte+=sizeof(int);
|
||||
C4JStorage::DLC_FILE_PARAM *pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
||||
bool bXMLVersion = false;
|
||||
//DWORD dwwchCount=0;
|
||||
for(unsigned int i=0;i<uiParameterCount;i++)
|
||||
{
|
||||
pParams->dwType = bSwapEndian ? SwapInt32(pParams->dwType) : pParams->dwType;
|
||||
pParams->dwWchCount = bSwapEndian ? SwapInt32(pParams->dwWchCount) : pParams->dwWchCount;
|
||||
char16_t* wchData = reinterpret_cast<char16_t*>(pParams->wchData);
|
||||
if (bSwapEndian) {
|
||||
SwapUTF16Bytes(wchData, pParams->dwWchCount);
|
||||
}
|
||||
|
||||
// Map DLC strings to application strings, then store the DLC index mapping to application index
|
||||
wstring parameterName(static_cast<WCHAR *>(pParams->wchData));
|
||||
EDLCParameterType type = getParameterType(parameterName);
|
||||
if( type != e_DLCParamType_Invalid )
|
||||
{
|
||||
parameterMapping[pParams->dwType] = type;
|
||||
|
||||
if (type == e_DLCParamType_XMLVersion)
|
||||
{
|
||||
bXMLVersion = true;
|
||||
}
|
||||
}
|
||||
uiCurrentByte+= sizeof(C4JStorage::DLC_FILE_PARAM)+(pParams->dwWchCount*sizeof(WCHAR));
|
||||
pParams = (C4JStorage::DLC_FILE_PARAM *)&pbData[uiCurrentByte];
|
||||
}
|
||||
//ulCurrentByte+=ulParameterCount * sizeof(C4JStorage::DLC_FILE_PARAM);
|
||||
|
||||
if (bXMLVersion)
|
||||
{
|
||||
uiCurrentByte += sizeof(int);
|
||||
}
|
||||
|
||||
unsigned int uiFileCount=readUInt32(&pbData[uiCurrentByte], bSwapEndian);
|
||||
unsigned int uiFileCount=*(unsigned int *)&pbData[uiCurrentByte];
|
||||
uiCurrentByte+=sizeof(int);
|
||||
C4JStorage::DLC_FILE_DETAILS *pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[uiCurrentByte];
|
||||
|
||||
DWORD dwTemp=uiCurrentByte;
|
||||
for(unsigned int i=0;i<uiFileCount;i++)
|
||||
{
|
||||
pFile->dwWchCount = bSwapEndian ? SwapInt32(pFile->dwWchCount) : pFile->dwWchCount;
|
||||
dwTemp+=sizeof(C4JStorage::DLC_FILE_DETAILS)+pFile->dwWchCount*sizeof(WCHAR);
|
||||
pFile = (C4JStorage::DLC_FILE_DETAILS *)&pbData[dwTemp];
|
||||
}
|
||||
|
|
@ -455,13 +430,6 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||
|
||||
for(unsigned int i=0;i<uiFileCount;i++)
|
||||
{
|
||||
pFile->dwType = bSwapEndian ? SwapInt32(pFile->dwType) : pFile->dwType;
|
||||
pFile->uiFileSize = bSwapEndian ? SwapInt32(pFile->uiFileSize) : pFile->uiFileSize;
|
||||
char16_t* wchFile = reinterpret_cast<char16_t*>(pFile->wchFile);
|
||||
if (bSwapEndian) {
|
||||
SwapUTF16Bytes(wchFile, pFile->dwWchCount);
|
||||
}
|
||||
|
||||
EDLCType type = static_cast<EDLCType>(pFile->dwType);
|
||||
|
||||
DLCFile *dlcFile = nullptr;
|
||||
|
|
@ -477,18 +445,12 @@ bool DLCManager::processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD
|
|||
}
|
||||
|
||||
// Params
|
||||
uiParameterCount=readUInt32(pbTemp, bSwapEndian);
|
||||
uiParameterCount=*(unsigned int *)pbTemp;
|
||||
pbTemp+=sizeof(int);
|
||||
pParams = (C4JStorage::DLC_FILE_PARAM *)pbTemp;
|
||||
for(unsigned int j=0;j<uiParameterCount;j++)
|
||||
{
|
||||
//DLCManager::EDLCParameterType paramType = DLCManager::e_DLCParamType_Invalid;
|
||||
pParams->dwType = bSwapEndian ? SwapInt32(pParams->dwType) : pParams->dwType;
|
||||
pParams->dwWchCount = bSwapEndian ? SwapInt32(pParams->dwWchCount) : pParams->dwWchCount;
|
||||
char16_t* wchData = reinterpret_cast<char16_t*>(pParams->wchData);
|
||||
if (bSwapEndian) {
|
||||
SwapUTF16Bytes(wchData, pParams->dwWchCount);
|
||||
}
|
||||
|
||||
auto it = parameterMapping.find(pParams->dwType);
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ public:
|
|||
{
|
||||
e_DLCParamType_Invalid = -1,
|
||||
|
||||
e_DLCParamType_XMLVersion = 0,
|
||||
e_DLCParamType_DisplayName,
|
||||
e_DLCParamType_DisplayName = 0,
|
||||
e_DLCParamType_ThemeName,
|
||||
e_DLCParamType_Free, // identify free skins
|
||||
e_DLCParamType_Credit, // legal credits for DLC
|
||||
|
|
@ -95,30 +94,6 @@ public:
|
|||
bool readDLCDataFile(DWORD &dwFilesProcessed, const string &path, DLCPack *pack, bool fromArchive = false);
|
||||
DWORD retrievePackIDFromDLCDataFile(const string &path, DLCPack *pack);
|
||||
|
||||
static unsigned short SwapInt16(unsigned short value) {
|
||||
return (value >> 8) | (value << 8);
|
||||
}
|
||||
|
||||
static unsigned int SwapInt32(unsigned int value) {
|
||||
return ((value & 0xFF) << 24) |
|
||||
((value & 0xFF00) << 8) |
|
||||
((value & 0xFF0000) >> 8) |
|
||||
((value & 0xFF000000) >> 24);
|
||||
}
|
||||
|
||||
static void SwapUTF16Bytes(char16_t* buffer, size_t count) {
|
||||
for (size_t i = 0; i < count; ++i) {
|
||||
char16_t& c = buffer[i];
|
||||
c = (c >> 8) | (c << 8);
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int readUInt32(unsigned char* ptr, bool endian) {
|
||||
unsigned int val = *(unsigned int*)ptr;
|
||||
if (endian) val = SwapInt32(val);
|
||||
return val;
|
||||
}
|
||||
|
||||
private:
|
||||
bool processDLCDataFile(DWORD &dwFilesProcessed, PBYTE pbData, DWORD dwLength, DLCPack *pack);
|
||||
|
||||
|
|
|
|||
|
|
@ -344,7 +344,6 @@ void GameRuleManager::writeRuleFile(DataOutputStream *dos)
|
|||
// Write schematic files.
|
||||
unordered_map<wstring, ConsoleSchematicFile *> *files;
|
||||
files = getLevelGenerationOptions()->getUnfinishedSchematicFiles();
|
||||
dos->writeInt((int)files->size());
|
||||
for ( auto& it : *files )
|
||||
{
|
||||
const wstring& filename = it.first;
|
||||
|
|
@ -498,36 +497,17 @@ bool GameRuleManager::readRuleFile(LevelGenerationOptions *lgo, byte *dIn, UINT
|
|||
}*/
|
||||
|
||||
// subfile
|
||||
// Old saves didn't write a numFiles count before the schematic entries.
|
||||
// Detect this: a real count is small, but a UTF filename prefix reads as a large int.
|
||||
UINT numFiles = contentDis->readInt();
|
||||
|
||||
if (lgo->isFromSave() && numFiles > 100)
|
||||
for (UINT i = 0; i < numFiles; i++)
|
||||
{
|
||||
contentDis->skip(-4);
|
||||
while (true)
|
||||
{
|
||||
int peek = contentDis->readInt();
|
||||
if (peek <= 100) { contentDis->skip(-4); break; }
|
||||
contentDis->skip(-4);
|
||||
wstring sFilename = contentDis->readUTF();
|
||||
int length = contentDis->readInt();
|
||||
byteArray ba( length );
|
||||
|
||||
contentDis->read(ba);
|
||||
|
||||
levelGenerator->loadSchematicFile(sFilename, ba.data, ba.length);
|
||||
|
||||
wstring sFilename = contentDis->readUTF();
|
||||
int length = contentDis->readInt();
|
||||
byteArray ba( length );
|
||||
contentDis->read(ba);
|
||||
levelGenerator->loadSchematicFile(sFilename, ba.data, ba.length);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (UINT i = 0; i < numFiles; i++)
|
||||
{
|
||||
wstring sFilename = contentDis->readUTF();
|
||||
int length = contentDis->readInt();
|
||||
byteArray ba( length );
|
||||
contentDis->read(ba);
|
||||
levelGenerator->loadSchematicFile(sFilename, ba.data, ba.length);
|
||||
}
|
||||
}
|
||||
|
||||
LEVEL_GEN_ID lgoID = LEVEL_GEN_ID_NULL;
|
||||
|
|
|
|||
|
|
@ -455,74 +455,6 @@ unordered_map<wstring, ConsoleSchematicFile *> *LevelGenerationOptions::getUnfin
|
|||
|
||||
void LevelGenerationOptions::loadBaseSaveData()
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
|
||||
int gameRulesCount = m_parentDLCPack ? m_parentDLCPack->getDLCItemsCount(DLCManager::e_DLCType_GameRulesHeader) : 0;
|
||||
|
||||
wstring baseSave = getBaseSavePath();
|
||||
wstring packName = baseSave.substr(0, baseSave.find(L'.'));
|
||||
|
||||
for (int i = 0; i < gameRulesCount; ++i)
|
||||
{
|
||||
DLCGameRulesHeader* dlcFile = static_cast<DLCGameRulesHeader*>(m_parentDLCPack->getFile(DLCManager::e_DLCType_GameRulesHeader, i));
|
||||
|
||||
if (!dlcFile->getGrfPath().empty())
|
||||
{
|
||||
File grf(L"Windows64Media\\DLC\\" + packName + L"\\Data\\" + dlcFile->getGrfPath());
|
||||
|
||||
if (grf.exists())
|
||||
{
|
||||
wstring path = grf.getPath();
|
||||
HANDLE fileHandle = CreateFileW(path.c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, nullptr);
|
||||
|
||||
if (fileHandle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD dwFileSize = grf.length();
|
||||
DWORD bytesRead;
|
||||
PBYTE pbData = new BYTE[dwFileSize];
|
||||
BOOL bSuccess = ReadFile(fileHandle, pbData, dwFileSize, &bytesRead, nullptr);
|
||||
CloseHandle(fileHandle);
|
||||
|
||||
if (bSuccess)
|
||||
{
|
||||
dlcFile->setGrfData(pbData, dwFileSize, m_stringTable);
|
||||
app.m_gameRules.setLevelGenerationOptions(dlcFile->lgo);
|
||||
}
|
||||
delete[] pbData;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (requiresBaseSave() && !getBaseSavePath().empty())
|
||||
{
|
||||
File save(L"Windows64Media\\DLC\\" + packName + L"\\Data\\" + baseSave);
|
||||
|
||||
if (save.exists())
|
||||
{
|
||||
wstring path = save.getPath();
|
||||
HANDLE fileHandle = CreateFileW(path.c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, nullptr);
|
||||
|
||||
if (fileHandle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD dwFileSize = GetFileSize(fileHandle, nullptr);
|
||||
DWORD bytesRead;
|
||||
PBYTE pbData = new BYTE[dwFileSize];
|
||||
BOOL bSuccess = ReadFile(fileHandle, pbData, dwFileSize, &bytesRead, nullptr);
|
||||
CloseHandle(fileHandle);
|
||||
|
||||
if (bSuccess)
|
||||
setBaseSaveData(pbData, dwFileSize);
|
||||
else
|
||||
delete[] pbData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setLoadedData();
|
||||
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ReloadTexturePack);
|
||||
|
||||
#else
|
||||
int mountIndex = -1;
|
||||
if(m_parentDLCPack != nullptr) mountIndex = m_parentDLCPack->GetDLCMountIndex();
|
||||
|
||||
|
|
@ -549,7 +481,6 @@ void LevelGenerationOptions::loadBaseSaveData()
|
|||
setLoadedData();
|
||||
app.SetAction(ProfileManager.GetPrimaryPad(), eAppAction_ReloadTexturePack);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int LevelGenerationOptions::packMounted(LPVOID pParam,int iPad,DWORD dwErr,DWORD dwLicenceMask)
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -200,12 +200,10 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
#endif
|
||||
|
||||
int64_t seed = 0;
|
||||
bool dedicatedNoLocalHostPlayer = false;
|
||||
if (lpParameter != nullptr)
|
||||
{
|
||||
NetworkGameInitData *param = static_cast<NetworkGameInitData *>(lpParameter);
|
||||
seed = param->seed;
|
||||
dedicatedNoLocalHostPlayer = param->dedicatedNoLocalHostPlayer;
|
||||
|
||||
app.setLevelGenerationOptions(param->levelGen);
|
||||
if(param->levelGen != nullptr)
|
||||
|
|
@ -361,19 +359,9 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
// PRIMARY PLAYER
|
||||
|
||||
vector<ClientConnection *> createdConnections;
|
||||
ClientConnection *connection = nullptr;
|
||||
ClientConnection *connection;
|
||||
|
||||
if( g_NetworkManager.IsHost() && dedicatedNoLocalHostPlayer )
|
||||
{
|
||||
app.DebugPrintf("Dedicated server mode: skipping local host client connection\n");
|
||||
|
||||
// Keep telemetry behavior consistent with the host path.
|
||||
INT multiplayerInstanceId = TelemetryManager->GenerateMultiplayerInstanceId();
|
||||
TelemetryManager->SetMultiplayerInstanceId(multiplayerInstanceId);
|
||||
|
||||
app.SetGameMode( eMode_Multiplayer );
|
||||
}
|
||||
else if( g_NetworkManager.IsHost() )
|
||||
if( g_NetworkManager.IsHost() )
|
||||
{
|
||||
connection = new ClientConnection(minecraft, nullptr);
|
||||
}
|
||||
|
|
@ -402,18 +390,16 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
connection = new ClientConnection(minecraft, socket);
|
||||
}
|
||||
|
||||
if (connection != nullptr)
|
||||
if( !connection->createdOk )
|
||||
{
|
||||
if( !connection->createdOk )
|
||||
{
|
||||
assert(false);
|
||||
delete connection;
|
||||
connection = nullptr;
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
assert(false);
|
||||
delete connection;
|
||||
connection = nullptr;
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
|
||||
connection->send(std::make_shared<PreLoginPacket>(minecraft->user->name));
|
||||
connection->send(std::make_shared<PreLoginPacket>(minecraft->user->name));
|
||||
|
||||
// Tick connection until we're ready to go. The stages involved in this are:
|
||||
// (1) Creating the ClientConnection sends a prelogin packet to the server
|
||||
|
|
@ -448,9 +434,9 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
connection->close();
|
||||
}
|
||||
|
||||
if( connection->isStarted() && !connection->isClosed() )
|
||||
{
|
||||
createdConnections.push_back( connection );
|
||||
if( connection->isStarted() && !connection->isClosed() )
|
||||
{
|
||||
createdConnections.push_back( connection );
|
||||
|
||||
int primaryPad = ProfileManager.GetPrimaryPad();
|
||||
app.SetRichPresenceContext(primaryPad,CONTEXT_GAME_STATE_BLANK);
|
||||
|
|
@ -547,14 +533,13 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
|||
}
|
||||
}
|
||||
|
||||
app.SetGameMode( eMode_Multiplayer );
|
||||
}
|
||||
else if ( connection->isClosed() || !IsInSession())
|
||||
{
|
||||
app.SetGameMode( eMode_Multiplayer );
|
||||
}
|
||||
else if ( connection->isClosed() || !IsInSession())
|
||||
{
|
||||
// assert(false);
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
MinecraftServer::HaltServer();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -957,18 +942,13 @@ int CGameNetworkManager::ServerThreadProc( void* lpParameter )
|
|||
app.SetGameHostOption(eGameHostOption_All,param->settings);
|
||||
|
||||
// 4J Stu - If we are loading a DLC save that's separate from the texture pack, load
|
||||
if (param != nullptr && param->levelGen != nullptr && param->levelGen->isFromDLC())
|
||||
if( param->levelGen != nullptr && (param->texturePackId == 0 || param->levelGen->getRequiredTexturePackId() != param->texturePackId) )
|
||||
{
|
||||
while((Minecraft::GetInstance()->skins->needsUIUpdate() || ui.IsReloadingSkin()))
|
||||
{
|
||||
Sleep(1);
|
||||
}
|
||||
param->levelGen->loadBaseSaveData();
|
||||
|
||||
while (!param->levelGen->hasLoadedData())
|
||||
{
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@ public:
|
|||
{
|
||||
JOINGAME_SUCCESS,
|
||||
JOINGAME_FAIL_GENERAL,
|
||||
JOINGAME_FAIL_SERVER_FULL,
|
||||
JOINGAME_PENDING
|
||||
JOINGAME_FAIL_SERVER_FULL
|
||||
} eJoinGameResult;
|
||||
|
||||
void Initialise();
|
||||
|
|
|
|||
|
|
@ -173,11 +173,6 @@ bool CPlatformNetworkManagerStub::Initialise(CGameNetworkManager *pGameNetworkMa
|
|||
m_bSearchPending = false;
|
||||
|
||||
m_bIsOfflineGame = false;
|
||||
#ifdef _WINDOWS64
|
||||
m_bJoinPending = false;
|
||||
m_joinLocalUsersMask = 0;
|
||||
m_joinHostName[0] = 0;
|
||||
#endif
|
||||
m_pSearchParam = nullptr;
|
||||
m_SessionsUpdatedCallback = nullptr;
|
||||
|
||||
|
|
@ -245,13 +240,7 @@ void CPlatformNetworkManagerStub::DoWork()
|
|||
qnetPlayer->m_resolvedXuid = INVALID_XUID;
|
||||
qnetPlayer->m_gamertag[0] = 0;
|
||||
qnetPlayer->SetCustomDataValue(0);
|
||||
// Recalculate s_playerCount as the highest active slot + 1.
|
||||
// A blind decrement would hide players at higher-indexed slots when a
|
||||
// lower-indexed player disconnects first: GetPlayerBySmallId scans
|
||||
// [0, s_playerCount) so any slot at or above the decremented count
|
||||
// becomes invisible, causing its disconnect to be missed (ghost player).
|
||||
while (IQNet::s_playerCount > 1 &&
|
||||
IQNet::m_player[IQNet::s_playerCount - 1].GetCustomDataValue() == 0)
|
||||
if (IQNet::s_playerCount > 1)
|
||||
IQNet::s_playerCount--;
|
||||
}
|
||||
// NOTE: Do NOT call PushFreeSmallId here. The old PlayerConnection's
|
||||
|
|
@ -268,57 +257,6 @@ void CPlatformNetworkManagerStub::DoWork()
|
|||
SystemFlagRemoveBySmallId(disconnectedSmallId);
|
||||
}
|
||||
}
|
||||
|
||||
// Client-side host disconnect detection:
|
||||
// if TCP is gone, propagate through normal network-disconnect flow so UI returns to menus.
|
||||
// The processing from the Xbox version will be reused.
|
||||
if (_iQNetStubState == QNET_STATE_GAME_PLAY && !m_pIQNet->IsHost() && !m_bLeavingGame)
|
||||
{
|
||||
if (!WinsockNetLayer::IsConnected())
|
||||
{
|
||||
if (!m_bLeaveGameOnTick)
|
||||
{
|
||||
m_bLeaveGameOnTick = true;
|
||||
g_NetworkManager.HandleDisconnect(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_bLeaveGameOnTick = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_bJoinPending)
|
||||
{
|
||||
WinsockNetLayer::eJoinState state = WinsockNetLayer::GetJoinState();
|
||||
if (state == WinsockNetLayer::eJoinState_Success)
|
||||
{
|
||||
WinsockNetLayer::FinalizeJoin();
|
||||
|
||||
BYTE localSmallId = WinsockNetLayer::GetLocalSmallId();
|
||||
|
||||
IQNet::m_player[localSmallId].m_smallId = localSmallId;
|
||||
IQNet::m_player[localSmallId].m_isRemote = false;
|
||||
IQNet::m_player[localSmallId].m_isHostPlayer = false;
|
||||
IQNet::m_player[localSmallId].m_resolvedXuid = Win64Xuid::ResolvePersistentXuid();
|
||||
|
||||
Minecraft* pMinecraft = Minecraft::GetInstance();
|
||||
wcscpy_s(IQNet::m_player[localSmallId].m_gamertag, 32, pMinecraft->user->name.c_str());
|
||||
IQNet::s_playerCount = localSmallId + 1;
|
||||
|
||||
NotifyPlayerJoined(&IQNet::m_player[0]);
|
||||
NotifyPlayerJoined(&IQNet::m_player[localSmallId]);
|
||||
|
||||
m_pGameNetworkManager->StateChange_AnyToStarting();
|
||||
m_bJoinPending = false;
|
||||
}
|
||||
else if (state == WinsockNetLayer::eJoinState_Failed ||
|
||||
state == WinsockNetLayer::eJoinState_Rejected ||
|
||||
state == WinsockNetLayer::eJoinState_Cancelled)
|
||||
{
|
||||
m_bJoinPending = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -418,7 +356,6 @@ bool CPlatformNetworkManagerStub::LeaveGame(bool bMigrateHost)
|
|||
if( m_bLeavingGame ) return true;
|
||||
|
||||
m_bLeavingGame = true;
|
||||
m_bLeaveGameOnTick = false;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
WinsockNetLayer::StopAdvertising();
|
||||
|
|
@ -467,7 +404,6 @@ void CPlatformNetworkManagerStub::HostGame(int localUsersMask, bool bOnlineGame,
|
|||
localUsersMask |= GetLocalPlayerMask( g_NetworkManager.GetPrimaryPad() );
|
||||
|
||||
m_bLeavingGame = false;
|
||||
m_bLeaveGameOnTick = false;
|
||||
|
||||
m_pIQNet->HostGame();
|
||||
|
||||
|
|
@ -497,23 +433,9 @@ void CPlatformNetworkManagerStub::HostGame(int localUsersMask, bool bOnlineGame,
|
|||
|
||||
if (WinsockNetLayer::IsActive())
|
||||
{
|
||||
// For Dedicated Server, refer to `lan-advertise` in `server.properties`
|
||||
bool enableLanAdvertising = true;
|
||||
if (g_Win64DedicatedServer)
|
||||
{
|
||||
enableLanAdvertising = g_Win64DedicatedServerLanAdvertise;
|
||||
}
|
||||
|
||||
if (enableLanAdvertising)
|
||||
{
|
||||
const wchar_t* hostName = IQNet::m_player[0].m_gamertag;
|
||||
unsigned int settings = app.GetGameHostOption(eGameHostOption_All);
|
||||
WinsockNetLayer::StartAdvertising(port, hostName, settings, 0, 0, MINECRAFT_NET_VERSION);
|
||||
}
|
||||
else
|
||||
{
|
||||
WinsockNetLayer::StopAdvertising();
|
||||
}
|
||||
const wchar_t* hostName = IQNet::m_player[0].m_gamertag;
|
||||
unsigned int settings = app.GetGameHostOption(eGameHostOption_All);
|
||||
WinsockNetLayer::StartAdvertising(port, hostName, settings, 0, 0, MINECRAFT_NET_VERSION);
|
||||
}
|
||||
#endif
|
||||
//#endif
|
||||
|
|
@ -541,29 +463,42 @@ int CPlatformNetworkManagerStub::JoinGame(FriendSessionInfo* searchResult, int l
|
|||
return CGameNetworkManager::JOINGAME_FAIL_GENERAL;
|
||||
|
||||
m_bLeavingGame = false;
|
||||
m_bLeaveGameOnTick = false;
|
||||
IQNet::s_isHosting = false;
|
||||
m_pIQNet->ClientJoinGame();
|
||||
|
||||
IQNet::m_player[0].m_smallId = 0;
|
||||
IQNet::m_player[0].m_isRemote = true;
|
||||
IQNet::m_player[0].m_isHostPlayer = true;
|
||||
// Remote host still maps to legacy host XUID in mixed old/new sessions.
|
||||
IQNet::m_player[0].m_resolvedXuid = Win64Xuid::GetLegacyEmbeddedHostXuid();
|
||||
wcsncpy_s(IQNet::m_player[0].m_gamertag, 32, searchResult->data.hostName, _TRUNCATE);
|
||||
|
||||
WinsockNetLayer::StopDiscovery();
|
||||
|
||||
wcsncpy_s(m_joinHostName, 32, searchResult->data.hostName, _TRUNCATE);
|
||||
m_joinLocalUsersMask = localUsersMask;
|
||||
|
||||
if (!WinsockNetLayer::BeginJoinGame(hostIP, hostPort))
|
||||
if (!WinsockNetLayer::JoinGame(hostIP, hostPort))
|
||||
{
|
||||
app.DebugPrintf("Win64 LAN: Failed to connect to %s:%d\n", hostIP, hostPort);
|
||||
return CGameNetworkManager::JOINGAME_FAIL_GENERAL;
|
||||
}
|
||||
|
||||
m_bJoinPending = true;
|
||||
return CGameNetworkManager::JOINGAME_PENDING;
|
||||
BYTE localSmallId = WinsockNetLayer::GetLocalSmallId();
|
||||
|
||||
IQNet::m_player[localSmallId].m_smallId = localSmallId;
|
||||
IQNet::m_player[localSmallId].m_isRemote = false;
|
||||
IQNet::m_player[localSmallId].m_isHostPlayer = false;
|
||||
// Local non-host identity is the persistent uid.dat XUID.
|
||||
IQNet::m_player[localSmallId].m_resolvedXuid = Win64Xuid::ResolvePersistentXuid();
|
||||
|
||||
Minecraft* pMinecraft = Minecraft::GetInstance();
|
||||
wcscpy_s(IQNet::m_player[localSmallId].m_gamertag, 32, pMinecraft->user->name.c_str());
|
||||
IQNet::s_playerCount = localSmallId + 1;
|
||||
|
||||
NotifyPlayerJoined(&IQNet::m_player[0]);
|
||||
NotifyPlayerJoined(&IQNet::m_player[localSmallId]);
|
||||
|
||||
m_pGameNetworkManager->StateChange_AnyToStarting();
|
||||
|
||||
return CGameNetworkManager::JOINGAME_SUCCESS;
|
||||
#else
|
||||
return CGameNetworkManager::JOINGAME_SUCCESS;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -77,12 +77,6 @@ private:
|
|||
bool m_bIsPrivateGame;
|
||||
int m_flagIndexSize;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
bool m_bJoinPending;
|
||||
int m_joinLocalUsersMask;
|
||||
wchar_t m_joinHostName[32];
|
||||
#endif
|
||||
|
||||
// This is only maintained by the host, and is not valid on client machines
|
||||
GameSessionData m_hostGameSessionData;
|
||||
CGameNetworkManager *m_pGameNetworkManager;
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include "..\..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
|
||||
#include "..\..\MultiplayerLocalPlayer.h"
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "..\..\Options.h"
|
||||
|
||||
#ifdef __ORBIS__
|
||||
#include <pad.h>
|
||||
|
|
@ -17,6 +16,8 @@
|
|||
|
||||
#ifdef _WINDOWS64
|
||||
#include "..\..\Windows64\KeyboardMouseInput.h"
|
||||
|
||||
SavedInventoryCursorPos g_savedInventoryCursorPos = { 0.0f, 0.0f, false };
|
||||
#endif
|
||||
|
||||
IUIScene_AbstractContainerMenu::IUIScene_AbstractContainerMenu()
|
||||
|
|
@ -1297,8 +1298,10 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
|||
}
|
||||
}
|
||||
|
||||
vPointerPos.x = static_cast<float>(floor(vPointerPos.x + 0.5f));
|
||||
vPointerPos.y = static_cast<float>(floor(vPointerPos.y + 0.5f));
|
||||
vPointerPos.x = floor(vPointerPos.x);
|
||||
vPointerPos.x += ( static_cast<int>(vPointerPos.x)%2);
|
||||
vPointerPos.y = floor(vPointerPos.y);
|
||||
vPointerPos.y += ( static_cast<int>(vPointerPos.y)%2);
|
||||
m_pointerPos = vPointerPos;
|
||||
|
||||
adjustPointerForSafeZone();
|
||||
|
|
@ -1676,13 +1679,7 @@ vector<HtmlString> *IUIScene_AbstractContainerMenu::GetItemDescription(Slot *slo
|
|||
{
|
||||
if(slot == nullptr) return nullptr;
|
||||
|
||||
bool advanced = false;
|
||||
if (const Minecraft* pMinecraft = Minecraft::GetInstance())
|
||||
{
|
||||
if (pMinecraft->options)
|
||||
advanced = pMinecraft->options->advancedTooltips;
|
||||
}
|
||||
vector<HtmlString> *lines = slot->getItem()->getHoverText(nullptr, advanced);
|
||||
vector<HtmlString> *lines = slot->getItem()->getHoverText(nullptr, false);
|
||||
|
||||
// Add rarity to first line
|
||||
if (lines->size() > 0)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,15 @@
|
|||
#pragma once
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
struct SavedInventoryCursorPos
|
||||
{
|
||||
float x;
|
||||
float y;
|
||||
bool hasSavedPos;
|
||||
};
|
||||
extern SavedInventoryCursorPos g_savedInventoryCursorPos;
|
||||
#endif
|
||||
|
||||
// Uncomment to enable tap input detection to jump 1 slot. Doesn't work particularly well yet, and I feel the system does not need it.
|
||||
// Would probably be required if we decide to slow down the pointer movement.
|
||||
// 4J Stu - There was a request to be able to navigate the scenes with the dpad, so I have used much of the TAP_DETECTION
|
||||
|
|
|
|||
|
|
@ -20,9 +20,9 @@ protected:
|
|||
eGroupTab_Right
|
||||
};
|
||||
|
||||
static const int m_iMaxHSlotC = 40;
|
||||
static const int m_iMaxHCraftingSlotC = 40;
|
||||
static const int m_iMaxVSlotC = 99;
|
||||
static const int m_iMaxHSlotC = 12;
|
||||
static const int m_iMaxHCraftingSlotC = 10;
|
||||
static const int m_iMaxVSlotC = 17;
|
||||
static const int m_iMaxDisplayedVSlotC = 3;
|
||||
static const int m_iIngredients3x3SlotC = 9;
|
||||
static const int m_iIngredients2x2SlotC = 4;
|
||||
|
|
|
|||
|
|
@ -195,8 +195,8 @@ void IUIScene_HUD::renderPlayerHealth()
|
|||
// Update health
|
||||
bool blink = pMinecraft->localplayers[iPad]->invulnerableTime / 3 % 2 == 1;
|
||||
if (pMinecraft->localplayers[iPad]->invulnerableTime < 10) blink = false;
|
||||
int currentHealth = static_cast<int>(ceil(pMinecraft->localplayers[iPad]->getHealth()));
|
||||
int oldHealth = static_cast<int>(ceil(pMinecraft->localplayers[iPad]->lastHealth));
|
||||
int currentHealth = pMinecraft->localplayers[iPad]->getHealth();
|
||||
int oldHealth = pMinecraft->localplayers[iPad]->lastHealth;
|
||||
bool bHasPoison = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::poison);
|
||||
bool bHasWither = pMinecraft->localplayers[iPad]->hasEffect(MobEffect::wither);
|
||||
AttributeInstance *maxHealthAttribute = pMinecraft->localplayers[iPad]->getAttribute(SharedMonsterAttributes::MAX_HEALTH);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.network.packet.h"
|
||||
#include "..\..\Minecraft.h"
|
||||
#include "..\..\Options.h"
|
||||
#include "..\..\MultiPlayerLocalPlayer.h"
|
||||
#include "..\..\ClientConnection.h"
|
||||
#include "IUIScene_TradingMenu.h"
|
||||
|
|
@ -369,13 +368,7 @@ void IUIScene_TradingMenu::setTradeItem(int index, shared_ptr<ItemInstance> item
|
|||
|
||||
vector<HtmlString> *IUIScene_TradingMenu::GetItemDescription(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
bool advanced = false;
|
||||
if (const Minecraft* pMinecraft = Minecraft::GetInstance())
|
||||
{
|
||||
if (pMinecraft->options)
|
||||
advanced = pMinecraft->options->advancedTooltips;
|
||||
}
|
||||
vector<HtmlString> *lines = item->getHoverText(nullptr, advanced);
|
||||
vector<HtmlString> *lines = item->getHoverText(nullptr, false);
|
||||
|
||||
// Add rarity to first line
|
||||
if (lines->size() > 0)
|
||||
|
|
|
|||
|
|
@ -93,22 +93,18 @@ void UIComponent_Tooltips::updateSafeZone()
|
|||
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
|
@ -116,22 +112,22 @@ void UIComponent_Tooltips::updateSafeZone()
|
|||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
|
||||
default:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
}
|
||||
setSafeZone(safeTop, safeBottom, safeLeft, safeRight);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "UI.h"
|
||||
#include "UIComponent_TutorialPopup.h"
|
||||
#include "UISplitScreenHelpers.h"
|
||||
#include "..\..\Common\Tutorial\Tutorial.h"
|
||||
#include "..\..\..\Minecraft.World\StringHelpers.h"
|
||||
#include "..\..\MultiplayerLocalPlayer.h"
|
||||
|
|
@ -475,17 +474,27 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo
|
|||
{
|
||||
if(viewport != C4JRender::VIEWPORT_TYPE_FULLSCREEN)
|
||||
{
|
||||
// Derive the viewport origin and fit a 16:9 box inside it (same as UIScene::render),
|
||||
// then apply safezone nudges so the popup stays clear of screen edges.
|
||||
F32 originX, originY, viewW, viewH;
|
||||
GetViewportRect(ui.getScreenWidth(), ui.getScreenHeight(), viewport, originX, originY, viewW, viewH);
|
||||
|
||||
S32 fitW, fitH, offsetX, offsetY;
|
||||
Fit16x9(viewW, viewH, fitW, fitH, offsetX, offsetY);
|
||||
|
||||
S32 xPos = static_cast<S32>(originX) + offsetX;
|
||||
S32 yPos = static_cast<S32>(originY) + offsetY;
|
||||
|
||||
S32 xPos = 0;
|
||||
S32 yPos = 0;
|
||||
switch( viewport )
|
||||
{
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
|
||||
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
|
||||
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
|
||||
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
|
||||
xPos = static_cast<S32>(ui.getScreenWidth() / 2);
|
||||
yPos = static_cast<S32>(ui.getScreenHeight() / 2);
|
||||
break;
|
||||
}
|
||||
//Adjust for safezone
|
||||
switch( viewport )
|
||||
{
|
||||
|
|
@ -496,7 +505,6 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo
|
|||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
yPos += getSafeZoneHalfHeight();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
switch( viewport )
|
||||
{
|
||||
|
|
@ -507,11 +515,10 @@ void UIComponent_TutorialPopup::render(S32 width, S32 height, C4JRender::eViewpo
|
|||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
|
||||
xPos -= getSafeZoneHalfWidth();
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
ui.setupRenderPosition(xPos, yPos);
|
||||
|
||||
IggyPlayerSetDisplaySize( getMovie(), fitW, fitH );
|
||||
IggyPlayerSetDisplaySize( getMovie(), width, height );
|
||||
IggyPlayerDraw( getMovie() );
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -66,44 +66,12 @@ void UIControl_Slider::init(UIString label, int id, int min, int max, int curren
|
|||
#endif
|
||||
}
|
||||
|
||||
bool IsUsingKeyboardMouse()
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
|
||||
if (g_KBMInput.IsKBMActive()) return true;
|
||||
|
||||
return g_KBMInput.HasAnyInput();
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void UIControl_Slider::handleSliderMove(int newValue)
|
||||
{
|
||||
if (m_current!=newValue)
|
||||
{
|
||||
int valueCount = 1;
|
||||
if (!m_allPossibleLabels.empty()) {
|
||||
valueCount = static_cast<int>(m_allPossibleLabels.size());
|
||||
}
|
||||
else {
|
||||
long long range = static_cast<long long>(m_max) - static_cast<long long>(m_min) + 1;
|
||||
if (range <= 0) range = 1;
|
||||
valueCount = static_cast<int>(range);
|
||||
}
|
||||
|
||||
if (IsUsingKeyboardMouse() == true) {
|
||||
if (newValue % 10 == 0) {
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
m_current = newValue;
|
||||
} else if (valueCount <= 20) {
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
m_current = newValue;
|
||||
}
|
||||
} else {
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
m_current = newValue;
|
||||
}
|
||||
ui.PlayUISFX(eSFX_Scroll);
|
||||
m_current = newValue;
|
||||
|
||||
if(newValue < m_allPossibleLabels.size())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "UI.h"
|
||||
#include "UIControl_TextInput.h"
|
||||
#include "..\..\Screen.h"
|
||||
|
||||
UIControl_TextInput::UIControl_TextInput()
|
||||
{
|
||||
|
|
@ -212,31 +211,6 @@ UIControl_TextInput::EDirectEditResult UIControl_TextInput::tickDirectEdit()
|
|||
}
|
||||
}
|
||||
|
||||
// Paste from clipboard
|
||||
if (g_KBMInput.IsKeyPressed('V') && g_KBMInput.IsKeyDown(VK_CONTROL))
|
||||
{
|
||||
wstring pasted = Screen::getClipboard();
|
||||
wstring sanitized;
|
||||
sanitized.reserve(pasted.length());
|
||||
|
||||
for (wchar_t pc : pasted)
|
||||
{
|
||||
if (pc >= 0x20) // Keep printable characters
|
||||
{
|
||||
if (m_iCharLimit > 0 && (m_editBuffer.length() + sanitized.length()) >= (size_t)m_iCharLimit)
|
||||
break;
|
||||
sanitized += pc;
|
||||
}
|
||||
}
|
||||
|
||||
if (!sanitized.empty())
|
||||
{
|
||||
m_editBuffer.insert(m_iCursorPos, sanitized);
|
||||
m_iCursorPos += (int)sanitized.length();
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Arrow keys, Home, End, Delete for cursor movement
|
||||
if (g_KBMInput.IsKeyPressed(VK_LEFT) && m_iCursorPos > 0)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -172,22 +172,15 @@ void UIScene::updateSafeZone()
|
|||
{
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
|
||||
// safeTop mirrors SPLIT_TOP for visual symmetry. safeBottom omitted.
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
|
@ -195,22 +188,22 @@ void UIScene::updateSafeZone()
|
|||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
|
||||
default:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
}
|
||||
setSafeZone(safeTop, safeBottom, safeLeft, safeRight);
|
||||
|
|
@ -585,12 +578,9 @@ bool UIScene::handleMouseClick(F32 x, F32 y)
|
|||
if (bestCtrl->getControlType() == UIControl::eCheckBox)
|
||||
{
|
||||
UIControl_CheckBox *cb = static_cast<UIControl_CheckBox*>(bestCtrl);
|
||||
if (cb->IsEnabled())
|
||||
{
|
||||
bool newState = !cb->IsChecked();
|
||||
cb->setChecked(newState);
|
||||
handleCheckboxToggled((F64)bestId, newState);
|
||||
}
|
||||
bool newState = !cb->IsChecked();
|
||||
cb->setChecked(newState);
|
||||
handleCheckboxToggled((F64)bestId, newState);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ void UIScene_AbstractContainerMenu::handleDestroy()
|
|||
app.DebugPrintf("UIScene_AbstractContainerMenu::handleDestroy\n");
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
g_savedInventoryCursorPos.x = m_pointerPos.x;
|
||||
g_savedInventoryCursorPos.y = m_pointerPos.y;
|
||||
g_savedInventoryCursorPos.hasSavedPos = true;
|
||||
|
||||
g_KBMInput.SetScreenCursorHidden(false);
|
||||
g_KBMInput.SetCursorHiddenForUI(false);
|
||||
#endif
|
||||
|
|
@ -169,16 +173,16 @@ void UIScene_AbstractContainerMenu::PlatformInitialize(int iPad, int startIndex)
|
|||
m_pointerPos = vPointerPos;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if ((iPad == 0) && g_KBMInput.IsKBMActive())
|
||||
if (g_savedInventoryCursorPos.hasSavedPos)
|
||||
{
|
||||
m_pointerPos.x = ((m_fPanelMinX + m_fPanelMaxX) * 0.5f) - m_fPointerImageOffsetX;
|
||||
m_pointerPos.y = ((m_fPanelMinY + m_fPanelMaxY) * 0.5f) - m_fPointerImageOffsetY;
|
||||
}
|
||||
m_pointerPos.x = g_savedInventoryCursorPos.x;
|
||||
m_pointerPos.y = g_savedInventoryCursorPos.y;
|
||||
|
||||
if (m_pointerPos.x < m_fPointerMinX) m_pointerPos.x = m_fPointerMinX;
|
||||
if (m_pointerPos.x > m_fPointerMaxX) m_pointerPos.x = m_fPointerMaxX;
|
||||
if (m_pointerPos.y < m_fPointerMinY) m_pointerPos.y = m_fPointerMinY;
|
||||
if (m_pointerPos.y > m_fPointerMaxY) m_pointerPos.y = m_fPointerMaxY;
|
||||
if (m_pointerPos.x < m_fPointerMinX) m_pointerPos.x = m_fPointerMinX;
|
||||
if (m_pointerPos.x > m_fPointerMaxX) m_pointerPos.x = m_fPointerMaxX;
|
||||
if (m_pointerPos.y < m_fPointerMinY) m_pointerPos.y = m_fPointerMinY;
|
||||
if (m_pointerPos.y > m_fPointerMaxY) m_pointerPos.y = m_fPointerMaxY;
|
||||
}
|
||||
#endif
|
||||
|
||||
IggyEvent mouseEvent;
|
||||
|
|
|
|||
|
|
@ -2,16 +2,6 @@
|
|||
#include "UI.h"
|
||||
#include "UIScene_ConnectingProgress.h"
|
||||
#include "..\..\Minecraft.h"
|
||||
#ifdef _WINDOWS64
|
||||
#include "..\..\Windows64\Network\WinsockNetLayer.h"
|
||||
#include "..\..\..\Minecraft.World\DisconnectPacket.h"
|
||||
|
||||
static int ConnectingProgress_OnRejectedDialogOK(LPVOID, int iPad, const C4JStorage::EMessageResult)
|
||||
{
|
||||
ui.NavigateBack(iPad);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
UIScene_ConnectingProgress::UIScene_ConnectingProgress(int iPad, void *_initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
|
||||
{
|
||||
|
|
@ -53,12 +43,6 @@ UIScene_ConnectingProgress::UIScene_ConnectingProgress(int iPad, void *_initData
|
|||
m_cancelFuncParam = param->cancelFuncParam;
|
||||
m_removeLocalPlayer = false;
|
||||
m_showingButton = false;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
WinsockNetLayer::eJoinState initState = WinsockNetLayer::GetJoinState();
|
||||
m_asyncJoinActive = (initState != WinsockNetLayer::eJoinState_Idle && initState != WinsockNetLayer::eJoinState_Cancelled);
|
||||
m_asyncJoinFailed = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
UIScene_ConnectingProgress::~UIScene_ConnectingProgress()
|
||||
|
|
@ -69,18 +53,6 @@ UIScene_ConnectingProgress::~UIScene_ConnectingProgress()
|
|||
|
||||
void UIScene_ConnectingProgress::updateTooltips()
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
if (m_asyncJoinActive)
|
||||
{
|
||||
ui.SetTooltips( m_iPad, -1, IDS_TOOLTIPS_BACK);
|
||||
return;
|
||||
}
|
||||
if (m_asyncJoinFailed)
|
||||
{
|
||||
ui.SetTooltips( m_iPad, IDS_TOOLTIPS_SELECT, -1);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
// 4J-PB - removing the option of cancel join, since it didn't work anyway
|
||||
//ui.SetTooltips( m_iPad, -1, m_showTooltips?IDS_TOOLTIPS_CANCEL_JOIN:-1);
|
||||
ui.SetTooltips( m_iPad, -1, -1);
|
||||
|
|
@ -90,85 +62,6 @@ void UIScene_ConnectingProgress::tick()
|
|||
{
|
||||
UIScene::tick();
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (m_asyncJoinActive)
|
||||
{
|
||||
WinsockNetLayer::eJoinState state = WinsockNetLayer::GetJoinState();
|
||||
if (state == WinsockNetLayer::eJoinState_Connecting)
|
||||
{
|
||||
// connecting.............
|
||||
int attempt = WinsockNetLayer::GetJoinAttempt();
|
||||
int maxAttempts = WinsockNetLayer::GetJoinMaxAttempts();
|
||||
char buf[128];
|
||||
if (attempt <= 1)
|
||||
sprintf_s(buf, "Connecting...");
|
||||
else
|
||||
sprintf_s(buf, "Connecting failed, trying again (%d/%d)", attempt, maxAttempts);
|
||||
wchar_t wbuf[128];
|
||||
mbstowcs(wbuf, buf, 128);
|
||||
m_labelTitle.setLabel(wstring(wbuf));
|
||||
}
|
||||
else if (state == WinsockNetLayer::eJoinState_Success)
|
||||
{
|
||||
m_asyncJoinActive = false;
|
||||
// go go go
|
||||
}
|
||||
else if (state == WinsockNetLayer::eJoinState_Cancelled)
|
||||
{
|
||||
// cancel
|
||||
m_asyncJoinActive = false;
|
||||
navigateBack();
|
||||
}
|
||||
else if (state == WinsockNetLayer::eJoinState_Rejected)
|
||||
{
|
||||
// server full and banned are passed differently compared to other disconnects it seems
|
||||
m_asyncJoinActive = false;
|
||||
DisconnectPacket::eDisconnectReason reason = WinsockNetLayer::GetJoinRejectReason();
|
||||
int exitReasonStringId;
|
||||
switch (reason)
|
||||
{
|
||||
case DisconnectPacket::eDisconnect_ServerFull:
|
||||
exitReasonStringId = IDS_DISCONNECTED_SERVER_FULL;
|
||||
break;
|
||||
case DisconnectPacket::eDisconnect_Banned:
|
||||
exitReasonStringId = IDS_DISCONNECTED_KICKED;
|
||||
break;
|
||||
default:
|
||||
exitReasonStringId = IDS_CONNECTION_LOST_SERVER;
|
||||
break;
|
||||
}
|
||||
UINT uiIDA[1];
|
||||
uiIDA[0] = IDS_CONFIRM_OK;
|
||||
ui.RequestErrorMessage(IDS_CONNECTION_FAILED, exitReasonStringId, uiIDA, 1, ProfileManager.GetPrimaryPad(), ConnectingProgress_OnRejectedDialogOK, nullptr, nullptr);
|
||||
}
|
||||
else if (state == WinsockNetLayer::eJoinState_Failed)
|
||||
{
|
||||
// FAIL
|
||||
m_asyncJoinActive = false;
|
||||
m_asyncJoinFailed = true;
|
||||
|
||||
int maxAttempts = WinsockNetLayer::GetJoinMaxAttempts();
|
||||
char buf[256];
|
||||
sprintf_s(buf, "Failed to connect after %d attempts. The server may be unavailable.", maxAttempts);
|
||||
wchar_t wbuf[256];
|
||||
mbstowcs(wbuf, buf, 256);
|
||||
|
||||
// TIL that these exist
|
||||
// not going to use a actual popup due to it requiring messing with strings which can really mess things up
|
||||
// i dont trust myself with that
|
||||
// these need to be touched up later as teh button is a bit offset
|
||||
m_labelTitle.setLabel(L"Unable to connect to server");
|
||||
m_progressBar.setLabel(wstring(wbuf));
|
||||
m_progressBar.showBar(false);
|
||||
m_progressBar.setVisible(true);
|
||||
m_buttonConfirm.setVisible(true);
|
||||
m_showingButton = true;
|
||||
m_controlTimer.setVisible(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( m_removeLocalPlayer )
|
||||
{
|
||||
m_removeLocalPlayer = false;
|
||||
|
|
@ -201,8 +94,6 @@ void UIScene_ConnectingProgress::handleGainFocus(bool navBack)
|
|||
|
||||
void UIScene_ConnectingProgress::handleLoseFocus()
|
||||
{
|
||||
if (!m_runFailTimer) return;
|
||||
|
||||
int millisecsLeft = getTimer(0)->targetTime - System::currentTimeMillis();
|
||||
int millisecsTaken = getTimer(0)->duration - millisecsLeft;
|
||||
app.DebugPrintf("\n");
|
||||
|
|
@ -317,17 +208,6 @@ void UIScene_ConnectingProgress::handleInput(int iPad, int key, bool repeat, boo
|
|||
switch(key)
|
||||
{
|
||||
// 4J-PB - Removed the option to cancel join - it didn't work anyway
|
||||
#ifdef _WINDOWS64
|
||||
case ACTION_MENU_CANCEL:
|
||||
if (pressed && m_asyncJoinActive)
|
||||
{
|
||||
m_asyncJoinActive = false;
|
||||
WinsockNetLayer::CancelJoinGame();
|
||||
navigateBack();
|
||||
handled = true;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
// case ACTION_MENU_CANCEL:
|
||||
// {
|
||||
// if(m_cancelFunc != nullptr)
|
||||
|
|
@ -370,13 +250,6 @@ void UIScene_ConnectingProgress::handlePress(F64 controlId, F64 childId)
|
|||
case eControl_Confirm:
|
||||
if(m_showingButton)
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
if (m_asyncJoinFailed)
|
||||
{
|
||||
navigateBack();
|
||||
}
|
||||
else
|
||||
#endif
|
||||
if( m_iPad != ProfileManager.GetPrimaryPad() && g_NetworkManager.IsInSession() )
|
||||
{
|
||||
// The connection failed if we see the button, so the temp player should be removed and the viewports updated again
|
||||
|
|
|
|||
|
|
@ -13,11 +13,6 @@ private:
|
|||
void (*m_cancelFunc)(LPVOID param);
|
||||
LPVOID m_cancelFuncParam;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
bool m_asyncJoinActive;
|
||||
bool m_asyncJoinFailed;
|
||||
#endif
|
||||
|
||||
enum EControls
|
||||
{
|
||||
eControl_Confirm
|
||||
|
|
|
|||
|
|
@ -480,6 +480,14 @@ SCreditTextItemDef UIScene_Credits::gs_aCreditDefs[MAX_CREDIT_STRINGS] =
|
|||
{ L"Copyright (C) 2009-2013 by RAD Game Tools, Inc.", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line
|
||||
#else
|
||||
{ L"Copyright (C) 2009-2014 by RAD Game Tools, Inc.", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line
|
||||
#endif
|
||||
{ L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line
|
||||
{ L"", CREDIT_ICON, eCreditIcon_Miles,eSmallText }, // extra blank line
|
||||
{ L"Uses Miles Sound System.", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line
|
||||
#ifdef __PS3__
|
||||
{ L"Copyright (C) 1991-2013 by RAD Game Tools, Inc.", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line
|
||||
#else
|
||||
{ L"Copyright (C) 1991-2014 by RAD Game Tools, Inc.", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line
|
||||
#endif
|
||||
#ifdef __PS3__
|
||||
{ L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line
|
||||
|
|
@ -488,26 +496,6 @@ SCreditTextItemDef UIScene_Credits::gs_aCreditDefs[MAX_CREDIT_STRINGS] =
|
|||
{ L"are trademarks of Dolby Laboratories.", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING,eSmallText }, // extra blank line
|
||||
#endif
|
||||
#endif
|
||||
{L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"MinecraftConsoles", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eExtraLargeText},
|
||||
{L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"Project Maintainers", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eLargeText},
|
||||
{L"codeHusky", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"mattsumi", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"Former Maintainers", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eLargeText},
|
||||
{L"smartcmd", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"Patoke", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"rtm516", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"Thank you to our 120+ contributors on GitHub!", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eLargeText},
|
||||
{L"github.com/MCLCE/MinecraftConsoles", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"(formerly smartcmd/MinecraftConsoles)", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText},
|
||||
{L"Additional Thanks", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eLargeText},
|
||||
{L"notpies - Security Fixes", NO_TRANSLATED_STRING, NO_TRANSLATED_STRING, eSmallText}
|
||||
};
|
||||
|
||||
UIScene_Credits::UIScene_Credits(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ void UIScene_FullscreenProgress::handleInput(int iPad, int key, bool repeat, boo
|
|||
#ifdef __ORBIS__
|
||||
case ACTION_MENU_TOUCHPAD_PRESS:
|
||||
#endif
|
||||
if(pressed && m_threadCompleted)
|
||||
if(pressed)
|
||||
{
|
||||
sendInputToMovie(key, repeat, pressed, released);
|
||||
}
|
||||
|
|
@ -292,7 +292,6 @@ void UIScene_FullscreenProgress::handleInput(int iPad, int key, bool repeat, boo
|
|||
}
|
||||
break;
|
||||
}
|
||||
handled = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,26 +65,22 @@ void UIScene_HUD::updateSafeZone()
|
|||
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
|
||||
// safeTop mirrors SPLIT_TOP so both players have the same vertical inset
|
||||
// from their viewport's top edge (split divider), keeping GUI symmetrical.
|
||||
// safeBottom is intentionally omitted: it would shift m_Hud.y upward in
|
||||
// ActionScript, placing the hotbar too high relative to SPLIT_TOP.
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
|
@ -92,22 +88,22 @@ void UIScene_HUD::updateSafeZone()
|
|||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_FULLSCREEN:
|
||||
default:
|
||||
safeTop = getSafeZoneHalfHeight();
|
||||
safeBottom = getSafeZoneHalfHeight();
|
||||
safeLeft = getSafeZoneHalfWidth();
|
||||
|
||||
safeRight = getSafeZoneHalfWidth();
|
||||
break;
|
||||
}
|
||||
setSafeZone(safeTop, safeBottom, safeLeft, safeRight);
|
||||
|
|
@ -738,7 +734,7 @@ void UIScene_HUD::render(S32 width, S32 height, C4JRender::eViewportType viewpor
|
|||
|
||||
IggyPlayerSetDisplaySize( getMovie(), (S32)(m_movieWidth * scale), (S32)(m_movieHeight * scale) );
|
||||
|
||||
repositionHud(tileWidth, tileHeight, scale, needsYTile);
|
||||
repositionHud(tileWidth, tileHeight, scale);
|
||||
|
||||
m_renderWidth = tileWidth;
|
||||
m_renderHeight = tileHeight;
|
||||
|
|
@ -809,7 +805,7 @@ void UIScene_HUD::handleTimerComplete(int id)
|
|||
//setVisible(anyVisible);
|
||||
}
|
||||
|
||||
void UIScene_HUD::repositionHud(S32 tileWidth, S32 tileHeight, F32 scale, bool needsYTile)
|
||||
void UIScene_HUD::repositionHud(S32 tileWidth, S32 tileHeight, F32 scale)
|
||||
{
|
||||
if(!m_bSplitscreen) return;
|
||||
|
||||
|
|
|
|||
|
|
@ -176,5 +176,5 @@ protected:
|
|||
#endif
|
||||
|
||||
private:
|
||||
void repositionHud(S32 tileWidth, S32 tileHeight, F32 scale, bool needsYTile);
|
||||
void repositionHud(S32 tileWidth, S32 tileHeight, F32 scale);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -150,6 +150,8 @@ void UIScene_InGameInfoMenu::updateTooltips()
|
|||
void UIScene_InGameInfoMenu::handleDestroy()
|
||||
{
|
||||
g_NetworkManager.UnRegisterPlayerChangedCallback(m_iPad, &UIScene_InGameInfoMenu::OnPlayerChanged, this);
|
||||
|
||||
m_parentLayer->removeComponent(eUIComponent_MenuBackground);
|
||||
}
|
||||
|
||||
void UIScene_InGameInfoMenu::handleGainFocus(bool navBack)
|
||||
|
|
|
|||
|
|
@ -583,24 +583,6 @@ void UIScene_JoinMenu::JoinGame(UIScene_JoinMenu* pClass)
|
|||
// Alert the app the we no longer want to be informed of ethernet connections
|
||||
app.SetLiveLinkRequired( false );
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
if (result == CGameNetworkManager::JOINGAME_PENDING)
|
||||
{
|
||||
pClass->m_bIgnoreInput = false;
|
||||
|
||||
ConnectionProgressParams *param = new ConnectionProgressParams();
|
||||
param->iPad = ProfileManager.GetPrimaryPad();
|
||||
param->stringId = -1;
|
||||
param->showTooltips = true;
|
||||
param->setFailTimer = false;
|
||||
param->timerTime = 0;
|
||||
param->cancelFunc = nullptr;
|
||||
param->cancelFuncParam = nullptr;
|
||||
ui.NavigateToScene(ProfileManager.GetPrimaryPad(), eUIScene_ConnectingProgress, param);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
if( result != CGameNetworkManager::JOINGAME_SUCCESS )
|
||||
{
|
||||
int exitReasonStringId = -1;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include "stdafx.h"
|
||||
#include "UI.h"
|
||||
#include "UIScene_Keyboard.h"
|
||||
#include "..\..\Screen.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
// Global buffer that stores the text entered in the native keyboard scene.
|
||||
|
|
@ -225,38 +224,6 @@ void UIScene_Keyboard::tick()
|
|||
}
|
||||
}
|
||||
|
||||
// Paste from clipboard
|
||||
if (g_KBMInput.IsKeyPressed('V') && g_KBMInput.IsKeyDown(VK_CONTROL))
|
||||
{
|
||||
wstring pasted = Screen::getClipboard();
|
||||
wstring sanitized;
|
||||
sanitized.reserve(pasted.length());
|
||||
|
||||
for (wchar_t pc : pasted)
|
||||
{
|
||||
if (pc >= 0x20) // Keep printable characters
|
||||
{
|
||||
if (static_cast<int>(m_win64TextBuffer.length() + sanitized.length()) >= m_win64MaxChars)
|
||||
break;
|
||||
sanitized += pc;
|
||||
}
|
||||
}
|
||||
|
||||
if (!sanitized.empty())
|
||||
{
|
||||
if (m_bPCMode)
|
||||
{
|
||||
m_win64TextBuffer.insert(m_iCursorPos, sanitized);
|
||||
m_iCursorPos += (int)sanitized.length();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_win64TextBuffer += sanitized;
|
||||
}
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_bPCMode)
|
||||
{
|
||||
// Arrow keys, Home, End, Delete for cursor movement
|
||||
|
|
|
|||
|
|
@ -557,8 +557,8 @@ int UIScene_LaunchMoreOptionsMenu::KeyboardCompleteSeedCallback(LPVOID lpParam,b
|
|||
uint16_t pchText[128];
|
||||
ZeroMemory(pchText, 128 * sizeof(uint16_t));
|
||||
Win64_GetKeyboardText(pchText, 128);
|
||||
pClass->m_editSeed.setLabel(reinterpret_cast<wchar_t*>(pchText));
|
||||
pClass->m_params->seed = static_cast<wstring>(reinterpret_cast<wchar_t*>(pchText));
|
||||
pClass->m_editSeed.setLabel((wchar_t *)pchText);
|
||||
pClass->m_params->seed = (wchar_t *)pchText;
|
||||
#else
|
||||
#ifdef __PSVITA__
|
||||
uint16_t pchText[2048];
|
||||
|
|
@ -584,7 +584,7 @@ void UIScene_LaunchMoreOptionsMenu::getDirectEditInputs(vector<UIControl_TextInp
|
|||
void UIScene_LaunchMoreOptionsMenu::onDirectEditFinished(UIControl_TextInput *input, UIControl_TextInput::EDirectEditResult result)
|
||||
{
|
||||
if (result == UIControl_TextInput::eDirectEdit_Confirmed)
|
||||
m_params->seed = static_cast<wstring>(input->getEditBuffer());
|
||||
m_params->seed = input->getEditBuffer();
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -206,8 +206,6 @@ int UIScene_LoadOrJoinMenu::LoadSaveCallback(LPVOID lpParam,bool bRes)
|
|||
|
||||
UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer *parentLayer) : UIScene(iPad, parentLayer)
|
||||
{
|
||||
constexpr uint64_t MAXIMUM_SAVE_STORAGE = 4LL * 1024LL * 1024LL * 1024LL;
|
||||
|
||||
// Setup all the Iggy references we need for this scene
|
||||
initialiseMovie();
|
||||
app.SetLiveLinkRequired( true );
|
||||
|
|
@ -232,8 +230,8 @@ UIScene_LoadOrJoinMenu::UIScene_LoadOrJoinMenu(int iPad, void *initData, UILayer
|
|||
m_controlJoinTimer.setVisible( true );
|
||||
|
||||
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
m_spaceIndicatorSaves.init(L"",eControl_SpaceIndicator,0, MAXIMUM_SAVE_STORAGE);
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
m_spaceIndicatorSaves.init(L"",eControl_SpaceIndicator,0, (4LL *1024LL * 1024LL * 1024LL) );
|
||||
#endif
|
||||
m_bUpdateSaveSize = false;
|
||||
|
||||
|
|
@ -697,7 +695,7 @@ void UIScene_LoadOrJoinMenu::tick()
|
|||
if(m_eSaveTransferState == eSaveTransfer_Idle)
|
||||
m_bSaveTransferRunning = false;
|
||||
#endif
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
if(m_bUpdateSaveSize)
|
||||
{
|
||||
if((m_iDefaultButtonsC > 0) && (m_iSaveListIndex >= m_iDefaultButtonsC))
|
||||
|
|
@ -718,7 +716,7 @@ void UIScene_LoadOrJoinMenu::tick()
|
|||
if(m_pSaveDetails!=nullptr)
|
||||
{
|
||||
//CD - Fix - Adding define for ORBIS/XBOXONE
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
m_spaceIndicatorSaves.reset();
|
||||
#endif
|
||||
|
||||
|
|
@ -760,22 +758,6 @@ void UIScene_LoadOrJoinMenu::tick()
|
|||
{
|
||||
#if defined(_XBOX_ONE)
|
||||
m_spaceIndicatorSaves.addSave(m_pSaveDetails->SaveInfoA[i].totalSize);
|
||||
#elif defined(_WINDOWS64)
|
||||
int origIdx = sortedIdx[i];
|
||||
wchar_t wFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
ZeroMemory(wFilename, sizeof(wFilename));
|
||||
mbstowcs(wFilename, m_pSaveDetails->SaveInfoA[origIdx].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
|
||||
wstring filePath = wstring(L"Windows64\\GameHDD\\") + wstring(wFilename) + wstring(L"\\saveData.ms");
|
||||
|
||||
HANDLE hFile = CreateFileW(filePath.c_str(), GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_FLAG_SEQUENTIAL_SCAN, nullptr);
|
||||
DWORD fileSize = 0;
|
||||
|
||||
if (hFile != INVALID_HANDLE_VALUE) {
|
||||
fileSize = GetFileSize(hFile, nullptr);
|
||||
if (fileSize < 12 || fileSize == INVALID_FILE_SIZE) fileSize = 0;
|
||||
CloseHandle(hFile);
|
||||
}
|
||||
m_spaceIndicatorSaves.addSave(fileSize);
|
||||
#elif defined(__ORBIS__)
|
||||
m_spaceIndicatorSaves.addSave(m_pSaveDetails->SaveInfoA[i].blocksUsed * (32 * 1024) );
|
||||
#endif
|
||||
|
|
@ -788,8 +770,12 @@ void UIScene_LoadOrJoinMenu::tick()
|
|||
#else
|
||||
#ifdef _WINDOWS64
|
||||
{
|
||||
int origIdx = sortedIdx[i];
|
||||
wchar_t wFilename[MAX_SAVEFILENAME_LENGTH];
|
||||
ZeroMemory(wFilename, sizeof(wFilename));
|
||||
mbstowcs(wFilename, m_pSaveDetails->SaveInfoA[origIdx].UTF8SaveFilename, MAX_SAVEFILENAME_LENGTH - 1);
|
||||
wstring filePath = wstring(L"Windows64\\GameHDD\\") + wstring(wFilename) + wstring(L"\\saveData.ms");
|
||||
wstring levelName = ReadLevelNameFromSaveFile(filePath);
|
||||
|
||||
if (!levelName.empty())
|
||||
{
|
||||
m_buttonListSaves.addItem(levelName, wstring(L""));
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ private:
|
|||
{
|
||||
eControl_SavesList,
|
||||
eControl_GamesList,
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
eControl_SpaceIndicator,
|
||||
#endif
|
||||
};
|
||||
|
|
@ -52,7 +52,7 @@ protected:
|
|||
UIControl_SaveList m_buttonListGames;
|
||||
UIControl_Label m_labelSavesListTitle, m_labelJoinListTitle, m_labelNoGames;
|
||||
UIControl m_controlSavesTimer, m_controlJoinTimer;
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
UIControl_SpaceIndicatorBar m_spaceIndicatorSaves;
|
||||
#endif
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ private:
|
|||
UI_MAP_ELEMENT( m_controlSavesTimer, "SavesTimer")
|
||||
UI_MAP_ELEMENT( m_controlJoinTimer, "JoinTimer")
|
||||
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
UI_MAP_ELEMENT( m_spaceIndicatorSaves, "SaveSizeBar")
|
||||
#endif
|
||||
UI_END_MAP_ELEMENTS_AND_NAMES()
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ void UIScene_MainMenu::handlePress(F64 controlId, F64 childId)
|
|||
UINT uiIDA[2];
|
||||
uiIDA[0]=IDS_CANCEL;
|
||||
uiIDA[1]=IDS_OK;
|
||||
ui.RequestErrorMessage(IDS_WINDOWS_EXIT, IDS_WARNING_ARCADE_TEXT, uiIDA, 2, XUSER_INDEX_ANY,&UIScene_MainMenu::ExitGameReturned,this);
|
||||
ui.RequestErrorMessage(IDS_WARNING_ARCADE_TITLE, IDS_WARNING_ARCADE_TEXT, uiIDA, 2, XUSER_INDEX_ANY,&UIScene_MainMenu::ExitGameReturned,this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -222,8 +222,9 @@ void UIScene_SettingsGraphicsMenu::handleSliderMove(F64 sliderId, F64 currentVal
|
|||
const int fovValue = sliderValueToFov(value);
|
||||
pMinecraft->gameRenderer->SetFovVal(static_cast<float>(fovValue));
|
||||
app.SetGameSettings(m_iPad, eGameSetting_FOV, value);
|
||||
swprintf(TempString, 256, L"FOV: %d", fovValue);
|
||||
m_sliderFOV.setLabel(TempString);
|
||||
WCHAR tempString[256];
|
||||
swprintf(tempString, 256, L"FOV: %d", fovValue);
|
||||
m_sliderFOV.setLabel(tempString);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameRules", "GameRules.vcxproj", "{0DD2FD59-36AC-476F-9201-D687A4CE9E98}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(TeamFoundationVersionControl) = preSolution
|
||||
SccNumberOfProjects = 2
|
||||
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
|
||||
SccTeamFoundationServer = http://tfs_server:8080/tfs/storiespark
|
||||
SccProjectUniqueName0 = GameRules.vcxproj
|
||||
SccLocalPath0 = .
|
||||
SccLocalPath1 = .
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Xbox 360 = Debug|Xbox 360
|
||||
Release|Xbox 360 = Release|Xbox 360
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.Build.0 = Debug|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.Deploy.0 = Debug|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.ActiveCfg = Release|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.Build.0 = Release|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.Deploy.0 = Release|Xbox 360
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Xbox 360">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Xbox 360</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Xbox 360">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Xbox 360</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0DD2FD59-36AC-476F-9201-D687A4CE9E98}</ProjectGuid>
|
||||
<Keyword>MakeFileProj</Keyword>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">
|
||||
<NMakeOutput>
|
||||
</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<NMakeBuildCommandLine>BuildGameRule.cmd Tutorial</NMakeBuildCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">
|
||||
<NMakeOutput>GameRules.xex</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">
|
||||
<CustomBuild>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuild>
|
||||
<Deploy>
|
||||
<DeploymentType>CopyToHardDrive</DeploymentType>
|
||||
</Deploy>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Tutorial.pck" />
|
||||
<None Include="Tutorial\GameRules.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Boat.sch" />
|
||||
<None Include="Tutorial\schematics\CasTes1.sch" />
|
||||
<None Include="Tutorial\schematics\CasTes2.sch" />
|
||||
<None Include="Tutorial\schematics\CastleBottom.sch" />
|
||||
<None Include="Tutorial\schematics\CastleFront.sch" />
|
||||
<None Include="Tutorial\schematics\CastleLeft.sch" />
|
||||
<None Include="Tutorial\schematics\CastleMain.sch" />
|
||||
<None Include="Tutorial\schematics\CastleRight.sch" />
|
||||
<None Include="Tutorial\schematics\CastleTop.sch" />
|
||||
<None Include="Tutorial\schematics\JungleTemp.sch" />
|
||||
<None Include="Tutorial\schematics\Lava.sch" />
|
||||
<None Include="Tutorial\schematics\MinecraftSign.sch" />
|
||||
<None Include="Tutorial\schematics\Mushroom.sch" />
|
||||
<None Include="Tutorial\schematics\Pyramid.sch" />
|
||||
<None Include="Tutorial\schematics\Ship.sch" />
|
||||
<None Include="Tutorial\schematics\SnowHouse.sch" />
|
||||
<None Include="Tutorial\schematics\Spider.sch" />
|
||||
<None Include="Tutorial\schematics\Stairs.sch" />
|
||||
<None Include="Tutorial\schematics\StoneCircle.sch" />
|
||||
<None Include="Tutorial\schematics\Tower.sch" />
|
||||
<None Include="Tutorial\schematics\Tutorial.sch" />
|
||||
<None Include="Tutorial\Strings\en-EN.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\de-DE.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\es-ES.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\fr-FR.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\it-IT.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\ja-JP.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\ko-KR.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\pt-BR.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\pt-PT.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\zh-CHT.lang" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xsd Include="GameRulesDefinition.xsd">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
</Xsd>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Shared">
|
||||
<UniqueIdentifier>{ab02d5da-7fb3-494b-a636-03764d9a8acd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Tutorial">
|
||||
<UniqueIdentifier>{e1a87048-bca2-46e6-a234-91d7d64eb983}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Tutorial\schematics">
|
||||
<UniqueIdentifier>{da425f4a-cf76-48e8-87cb-d9fda0f42365}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Tutorial\Loc">
|
||||
<UniqueIdentifier>{c0ba5f53-4881-495e-8158-5d87f379426d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Tutorial\Loc\Microsoft">
|
||||
<UniqueIdentifier>{61651432-41a1-42f0-a853-c7795d813418}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Packs">
|
||||
<UniqueIdentifier>{e194e42b-1c9b-4e35-9a4b-dabd68eab3e0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Tutorial\GameRules.xml">
|
||||
<Filter>Tutorial</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\en-EN.lang">
|
||||
<Filter>Tutorial\Loc</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\de-DE.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\es-ES.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\fr-FR.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\it-IT.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\ja-JP.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\ko-KR.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\pt-BR.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\pt-PT.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\zh-CHT.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="..\Tutorial.pck">
|
||||
<Filter>Packs</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\JungleTemp.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Lava.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\MinecraftSign.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Mushroom.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Ship.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Spider.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Stairs.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\StoneCircle.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Tower.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Pyramid.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\CasTes1.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\CasTes2.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Boat.sch" />
|
||||
<None Include="Tutorial\schematics\CastleBottom.sch" />
|
||||
<None Include="Tutorial\schematics\CastleFront.sch" />
|
||||
<None Include="Tutorial\schematics\CastleLeft.sch" />
|
||||
<None Include="Tutorial\schematics\CastleMain.sch" />
|
||||
<None Include="Tutorial\schematics\CastleRight.sch" />
|
||||
<None Include="Tutorial\schematics\CastleTop.sch" />
|
||||
<None Include="Tutorial\schematics\Tutorial.sch" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xsd Include="GameRulesDefinition.xsd">
|
||||
<Filter>Shared</Filter>
|
||||
</Xsd>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GameRules", "GameRules.vcxproj", "{0DD2FD59-36AC-476F-9201-D687A4CE9E98}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(TeamFoundationVersionControl) = preSolution
|
||||
SccNumberOfProjects = 2
|
||||
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
|
||||
SccTeamFoundationServer = http://tfs_server:8080/tfs/storiespark
|
||||
SccProjectUniqueName0 = GameRules.vcxproj
|
||||
SccLocalPath0 = .
|
||||
SccLocalPath1 = .
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Xbox 360 = Debug|Xbox 360
|
||||
Release|Xbox 360 = Release|Xbox 360
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.ActiveCfg = Debug|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.Build.0 = Debug|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Debug|Xbox 360.Deploy.0 = Debug|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.ActiveCfg = Release|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.Build.0 = Release|Xbox 360
|
||||
{0DD2FD59-36AC-476F-9201-D687A4CE9E98}.Release|Xbox 360.Deploy.0 = Release|Xbox 360
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -0,0 +1,103 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Xbox 360">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Xbox 360</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Xbox 360">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Xbox 360</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{0DD2FD59-36AC-476F-9201-D687A4CE9E98}</ProjectGuid>
|
||||
<Keyword>MakeFileProj</Keyword>
|
||||
<SccProjectName>SAK</SccProjectName>
|
||||
<SccAuxPath>SAK</SccAuxPath>
|
||||
<SccLocalPath>SAK</SccLocalPath>
|
||||
<SccProvider>SAK</SccProvider>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">
|
||||
<NMakeOutput>
|
||||
</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
<NMakeBuildCommandLine>BuildGameRule.cmd Tutorial</NMakeBuildCommandLine>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">
|
||||
<NMakeOutput>GameRules.xex</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">
|
||||
<CustomBuild>
|
||||
<Command>
|
||||
</Command>
|
||||
</CustomBuild>
|
||||
<Deploy>
|
||||
<DeploymentType>CopyToHardDrive</DeploymentType>
|
||||
</Deploy>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Tutorial.pck" />
|
||||
<None Include="Tutorial\GameRules.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Boat.sch" />
|
||||
<None Include="Tutorial\schematics\CasTes1.sch" />
|
||||
<None Include="Tutorial\schematics\CasTes2.sch" />
|
||||
<None Include="Tutorial\schematics\CastleBottom.sch" />
|
||||
<None Include="Tutorial\schematics\CastleFront.sch" />
|
||||
<None Include="Tutorial\schematics\CastleLeft.sch" />
|
||||
<None Include="Tutorial\schematics\CastleMain.sch" />
|
||||
<None Include="Tutorial\schematics\CastleRight.sch" />
|
||||
<None Include="Tutorial\schematics\CastleTop.sch" />
|
||||
<None Include="Tutorial\schematics\JungleTemp.sch" />
|
||||
<None Include="Tutorial\schematics\Lava.sch" />
|
||||
<None Include="Tutorial\schematics\MinecraftSign.sch" />
|
||||
<None Include="Tutorial\schematics\Mushroom.sch" />
|
||||
<None Include="Tutorial\schematics\Pyramid.sch" />
|
||||
<None Include="Tutorial\schematics\Ship.sch" />
|
||||
<None Include="Tutorial\schematics\SnowHouse.sch" />
|
||||
<None Include="Tutorial\schematics\Spider.sch" />
|
||||
<None Include="Tutorial\schematics\Stairs.sch" />
|
||||
<None Include="Tutorial\schematics\StoneCircle.sch" />
|
||||
<None Include="Tutorial\schematics\Tower.sch" />
|
||||
<None Include="Tutorial\schematics\Tutorial.sch" />
|
||||
<None Include="Tutorial\Strings\en-EN.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\de-DE.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\es-ES.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\fr-FR.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\it-IT.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\ja-JP.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\ko-KR.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\pt-BR.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\pt-PT.lang" />
|
||||
<None Include="Tutorial\Strings\Microsoft\zh-CHT.lang" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xsd Include="GameRulesDefinition.xsd">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Xbox 360'">true</ExcludedFromBuild>
|
||||
</Xsd>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Shared">
|
||||
<UniqueIdentifier>{ab02d5da-7fb3-494b-a636-03764d9a8acd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Tutorial">
|
||||
<UniqueIdentifier>{e1a87048-bca2-46e6-a234-91d7d64eb983}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Tutorial\schematics">
|
||||
<UniqueIdentifier>{da425f4a-cf76-48e8-87cb-d9fda0f42365}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Tutorial\Loc">
|
||||
<UniqueIdentifier>{c0ba5f53-4881-495e-8158-5d87f379426d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Tutorial\Loc\Microsoft">
|
||||
<UniqueIdentifier>{61651432-41a1-42f0-a853-c7795d813418}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Packs">
|
||||
<UniqueIdentifier>{e194e42b-1c9b-4e35-9a4b-dabd68eab3e0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="Tutorial\GameRules.xml">
|
||||
<Filter>Tutorial</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\en-EN.lang">
|
||||
<Filter>Tutorial\Loc</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\de-DE.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\es-ES.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\fr-FR.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\it-IT.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\ja-JP.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\ko-KR.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\pt-BR.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\pt-PT.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\Strings\Microsoft\zh-CHT.lang">
|
||||
<Filter>Tutorial\Loc\Microsoft</Filter>
|
||||
</None>
|
||||
<None Include="..\Tutorial.pck">
|
||||
<Filter>Packs</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\JungleTemp.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Lava.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\MinecraftSign.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Mushroom.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Ship.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Spider.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Stairs.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\StoneCircle.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Tower.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Pyramid.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\CasTes1.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\CasTes2.sch">
|
||||
<Filter>Tutorial\schematics</Filter>
|
||||
</None>
|
||||
<None Include="Tutorial\schematics\Boat.sch" />
|
||||
<None Include="Tutorial\schematics\CastleBottom.sch" />
|
||||
<None Include="Tutorial\schematics\CastleFront.sch" />
|
||||
<None Include="Tutorial\schematics\CastleLeft.sch" />
|
||||
<None Include="Tutorial\schematics\CastleMain.sch" />
|
||||
<None Include="Tutorial\schematics\CastleRight.sch" />
|
||||
<None Include="Tutorial\schematics\CastleTop.sch" />
|
||||
<None Include="Tutorial\schematics\Tutorial.sch" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Xsd Include="GameRulesDefinition.xsd">
|
||||
<Filter>Shared</Filter>
|
||||
</Xsd>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "0"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<Contributor ComponentSource="c:\users\paddy\work\tfs\minecraft\dev-cu2-xb1-ps4-x360\commonmedia.vcxproj">
|
||||
<Configuration Name="Debug" />
|
||||
</Contributor>
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Package xmlns="http://schemas.microsoft.com/appx/2010/manifest" xmlns:mx="http://schemas.microsoft.com/appx/2013/xbox/manifest" IgnorableNamespaces="mx">
|
||||
<Identity Name="Minecraft" Publisher="CN=Publisher" Version="1.0.406.0" ProcessorArchitecture="x64" />
|
||||
<Properties>
|
||||
<DisplayName>Minecraft: Xbox One Edition</DisplayName>
|
||||
<PublisherDisplayName>Microsoft Studios</PublisherDisplayName>
|
||||
<Logo>StoreLogo.png</Logo>
|
||||
<Description>Minecraft</Description>
|
||||
</Properties>
|
||||
<Prerequisites>
|
||||
<OSMinVersion>6.2</OSMinVersion>
|
||||
<OSMaxVersionTested>6.2</OSMaxVersionTested>
|
||||
<mx:ApplicationEnvironment>title</mx:ApplicationEnvironment>
|
||||
<mx:OSName>era</mx:OSName>
|
||||
</Prerequisites>
|
||||
<Resources>
|
||||
<Resource Language="en-us" />
|
||||
<Resource Language="en-gb" />
|
||||
<Resource Language="de-de" />
|
||||
<Resource Language="es-es" />
|
||||
<Resource Language="es-mx" />
|
||||
<Resource Language="fr-fr" />
|
||||
<Resource Language="it-it" />
|
||||
<Resource Language="pt-br" />
|
||||
<Resource Language="pt-pt" />
|
||||
<Resource Language="ja-jp" />
|
||||
<Resource Language="ko-kr" />
|
||||
<Resource Language="zh-tw" />
|
||||
<Resource Language="zh-hk" />
|
||||
</Resources>
|
||||
<Applications>
|
||||
<Application Id="App" Executable="Minecraft.Client.exe" EntryPoint="Minecraft.App">
|
||||
<VisualElements DisplayName="Minecraft: Xbox One Edition" Logo="StoreLogo.png" SmallLogo="SmallLogo.png" Description="Minecraft" ForegroundText="light" BackgroundColor="#464646">
|
||||
<SplashScreen Image="SplashScreen.png" />
|
||||
</VisualElements>
|
||||
<Extensions>
|
||||
<mx:Extension Category="xbox.live">
|
||||
<mx:XboxLive TitleId="149E11AE" PrimaryServiceConfigId="05c20100-6e60-45d5-878a-4903149e11ae">
|
||||
<mx:ConnectedStorage MaxMegabytesPerUser="1024" />
|
||||
</mx:XboxLive>
|
||||
</mx:Extension>
|
||||
<mx:Extension Category="windows.xbox.networking">
|
||||
<mx:XboxNetworkingManifest>
|
||||
<mx:SocketDescriptions>
|
||||
<mx:SocketDescription Name="MultiplayerSocketUdp" SecureIpProtocol="Udp" BoundPort="8700">
|
||||
<mx:AllowedUsages>
|
||||
<mx:SecureDeviceSocketUsage Type="Initiate" />
|
||||
<mx:SecureDeviceSocketUsage Type="Accept" />
|
||||
<mx:SecureDeviceSocketUsage Type="SendGameData" />
|
||||
<mx:SecureDeviceSocketUsage Type="ReceiveGameData" />
|
||||
<mx:SecureDeviceSocketUsage Type="SendChat" />
|
||||
<mx:SecureDeviceSocketUsage Type="ReceiveChat" />
|
||||
</mx:AllowedUsages>
|
||||
</mx:SocketDescription>
|
||||
</mx:SocketDescriptions>
|
||||
<mx:SecureDeviceAssociationTemplates>
|
||||
<mx:SecureDeviceAssociationTemplate Name="MultiplayerUdp" InitiatorSocketDescription="MultiplayerSocketUdp" AcceptorSocketDescription="MultiplayerSocketUdp" MultiplayerSessionRequirement="Required">
|
||||
<mx:AllowedUsages>
|
||||
<mx:SecureDeviceAssociationUsage Type="Default" />
|
||||
</mx:AllowedUsages>
|
||||
</mx:SecureDeviceAssociationTemplate>
|
||||
</mx:SecureDeviceAssociationTemplates>
|
||||
</mx:XboxNetworkingManifest>
|
||||
</mx:Extension>
|
||||
</Extensions>
|
||||
</Application>
|
||||
</Applications>
|
||||
<Extensions>
|
||||
<mx:PackageExtension Category="xbox.store">
|
||||
<mx:XboxStore>
|
||||
<mx:RelatedProducts>
|
||||
<mx:RelatedProduct Id="582e7bcc-11bc-4702-ab1b-b31566f8e327" />
|
||||
</mx:RelatedProducts>
|
||||
</mx:XboxStore>
|
||||
</mx:PackageExtension>
|
||||
<Extension Category="windows.activatableClass.inProcessServer">
|
||||
<InProcessServer>
|
||||
<Path>windows.xbox.networking.realtimesession.dll</Path>
|
||||
<ActivatableClass ActivatableClassId="Windows.Xbox.Networking.RealtimeSession.Session" ThreadingModel="both" />
|
||||
</InProcessServer>
|
||||
</Extension>
|
||||
<Extension Category="windows.activatableClass.inProcessServer">
|
||||
<InProcessServer>
|
||||
<Path>Microsoft.Xbox.GameChat.dll</Path>
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.GameChat.ChatManager" ThreadingModel="both" />
|
||||
</InProcessServer>
|
||||
</Extension>
|
||||
<Extension Category="windows.activatableClass.inProcessServer">
|
||||
<InProcessServer>
|
||||
<Path>Microsoft.Xbox.Services.dll</Path>
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.XboxLiveContext" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Configuration" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Multiplayer.MultiplayerQualityOfServiceMeasurements" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionReference" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Multiplayer.MultiplayerSessionCapabilities" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Multiplayer.MultiplayerSession" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Matchmaking.CreateMatchTicketResponse" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Matchmaking.HopperStatisticsResponse" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Matchmaking.MatchTicketDetailsResponse" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Presence.PresenceData" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.TitleStorage.TitleStorageBlobMetadata" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.UserStatistics.RequestedStatistics" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Privacy.PermissionIdConstants" ThreadingModel="both" />
|
||||
<ActivatableClass ActivatableClassId="Microsoft.Xbox.Services.Social.SocialGroupConstants" ThreadingModel="both" />
|
||||
</InProcessServer>
|
||||
</Extension>
|
||||
</Extensions>
|
||||
<Capabilities>
|
||||
<Capability Name="internetClient" />
|
||||
<mx:Capability Name="kinectAudio" />
|
||||
<mx:Capability Name="kinectGamechat" />
|
||||
</Capabilities>
|
||||
</Package>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Minecraft.Client/DurangoMedia/Layout/Image/Loose/SmallLogo.png
Normal file
BIN
Minecraft.Client/DurangoMedia/Layout/Image/Loose/SmallLogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 1 MiB |
BIN
Minecraft.Client/DurangoMedia/Layout/Image/Loose/StoreLogo.png
Normal file
BIN
Minecraft.Client/DurangoMedia/Layout/Image/Loose/StoreLogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 60 KiB |
BIN
Minecraft.Client/DurangoMedia/Layout/Image/Loose/appdata.bin
Normal file
BIN
Minecraft.Client/DurangoMedia/Layout/Image/Loose/appdata.bin
Normal file
Binary file not shown.
Binary file not shown.
|
|
@ -89,11 +89,6 @@ void EnderDragonRenderer::render(shared_ptr<Entity> _mob, double x, double y, do
|
|||
// 4J - dynamic cast required because we aren't using templates/generics in our version
|
||||
shared_ptr<EnderDragon> mob = dynamic_pointer_cast<EnderDragon>(_mob);
|
||||
BossMobGuiInfo::setBossHealth(mob, false);
|
||||
if (!mob->getCustomName().empty())
|
||||
{
|
||||
BossMobGuiInfo::name = mob->getCustomName();
|
||||
}
|
||||
|
||||
MobRenderer::render(mob, x, y, z, rot, a);
|
||||
if (mob->nearestCrystal != nullptr)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -45,46 +45,46 @@ Font::Font(Options *options, const wstring& name, Textures* textures, bool enfor
|
|||
random = new Random();
|
||||
|
||||
// Load the image
|
||||
BufferedImage *img = textures->readImage(textureLocation->getTexture(), name);
|
||||
BufferedImage *img = textures->readImage(textureLocation->getTexture(), name);
|
||||
|
||||
/* - 4J - TODO
|
||||
try {
|
||||
img = ImageIO.read(Textures.class.getResourceAsStream(name));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
img = ImageIO.read(Textures.class.getResourceAsStream(name));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
*/
|
||||
|
||||
int w = img->getWidth();
|
||||
int h = img->getHeight();
|
||||
intArray rawPixels(w * h);
|
||||
img->getRGB(0, 0, w, h, rawPixels, 0, w);
|
||||
int w = img->getWidth();
|
||||
int h = img->getHeight();
|
||||
intArray rawPixels(w * h);
|
||||
img->getRGB(0, 0, w, h, rawPixels, 0, w);
|
||||
|
||||
for (int i = 0; i < charC; i++)
|
||||
for (int i = 0; i < charC; i++)
|
||||
{
|
||||
int xt = i % m_cols;
|
||||
int yt = i / m_cols;
|
||||
int xt = i % m_cols;
|
||||
int yt = i / m_cols;
|
||||
|
||||
int x = 7;
|
||||
for (; x >= 0; x--)
|
||||
int x = 7;
|
||||
for (; x >= 0; x--)
|
||||
{
|
||||
int xPixel = xt * 8 + x;
|
||||
bool emptyColumn = true;
|
||||
for (int y = 0; y < 8 && emptyColumn; y++)
|
||||
int xPixel = xt * 8 + x;
|
||||
bool emptyColumn = true;
|
||||
for (int y = 0; y < 8 && emptyColumn; y++)
|
||||
{
|
||||
int yPixel = (yt * 8 + y) * w;
|
||||
int yPixel = (yt * 8 + y) * w;
|
||||
bool emptyPixel = (rawPixels[xPixel + yPixel] >> 24) == 0; // Check the alpha value
|
||||
if (!emptyPixel) emptyColumn = false;
|
||||
}
|
||||
if (!emptyColumn)
|
||||
if (!emptyPixel) emptyColumn = false;
|
||||
}
|
||||
if (!emptyColumn)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == ' ') x = 4 - 2;
|
||||
charWidths[i] = x + 2;
|
||||
}
|
||||
if (i == ' ') x = 4 - 2;
|
||||
charWidths[i] = x + 2;
|
||||
}
|
||||
|
||||
delete img;
|
||||
|
||||
|
|
@ -130,7 +130,6 @@ Font::~Font()
|
|||
}
|
||||
#endif
|
||||
|
||||
// Legacy helper used by renderCharacter() only.
|
||||
void Font::renderStyleLine(float x0, float y0, float x1, float y1)
|
||||
{
|
||||
Tesselator* t = Tesselator::getInstance();
|
||||
|
|
@ -147,20 +146,7 @@ void Font::renderStyleLine(float x0, float y0, float x1, float y1)
|
|||
t->end();
|
||||
}
|
||||
|
||||
void Font::addSolidQuad(float x0, float y0, float x1, float y1)
|
||||
{
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
t->tex(0.0f, 0.0f);
|
||||
t->vertex(x0, y1, 0.0f);
|
||||
t->tex(0.0f, 0.0f);
|
||||
t->vertex(x1, y1, 0.0f);
|
||||
t->tex(0.0f, 0.0f);
|
||||
t->vertex(x1, y0, 0.0f);
|
||||
t->tex(0.0f, 0.0f);
|
||||
t->vertex(x0, y0, 0.0f);
|
||||
}
|
||||
|
||||
void Font::emitCharacterGeometry(wchar_t c)
|
||||
void Font::addCharacterQuad(wchar_t c)
|
||||
{
|
||||
float xOff = c % m_cols * m_charWidth;
|
||||
float yOff = c / m_cols * m_charHeight; // was m_charWidth — wrong when glyphs aren't square
|
||||
|
|
@ -194,45 +180,52 @@ void Font::emitCharacterGeometry(wchar_t c)
|
|||
t->tex(xOff / fontWidth, yOff / fontHeight);
|
||||
t->vertex(x0 + dx, y0, 0.0f);
|
||||
}
|
||||
|
||||
xPos += static_cast<float>(charWidths[c]);
|
||||
}
|
||||
|
||||
void Font::addCharacterQuad(wchar_t c)
|
||||
{
|
||||
float height = m_charHeight - .01f;
|
||||
float x0 = xPos;
|
||||
float y0 = yPos;
|
||||
float y1 = yPos + height;
|
||||
float advance = static_cast<float>(charWidths[c]);
|
||||
|
||||
emitCharacterGeometry(c);
|
||||
|
||||
if (m_underline)
|
||||
{
|
||||
addSolidQuad(x0, y1 - 1.0f, xPos + advance, y1);
|
||||
}
|
||||
|
||||
if (m_strikethrough)
|
||||
{
|
||||
float mid = y0 + height * 0.5f;
|
||||
addSolidQuad(x0, mid - 0.5f, xPos + advance, mid + 0.5f);
|
||||
}
|
||||
|
||||
xPos += advance;
|
||||
}
|
||||
|
||||
// Legacy helper used by drawLiteral() only.
|
||||
void Font::renderCharacter(wchar_t c)
|
||||
{
|
||||
float xOff = c % m_cols * m_charWidth;
|
||||
float yOff = c / m_cols * m_charHeight; // was m_charWidth — wrong when glyphs aren't square
|
||||
|
||||
float width = charWidths[c] - .01f;
|
||||
float height = m_charHeight - .01f;
|
||||
float x0 = xPos;
|
||||
float y0 = yPos;
|
||||
float y1 = yPos + height;
|
||||
|
||||
float fontWidth = m_cols * m_charWidth;
|
||||
float fontHeight = m_rows * m_charHeight;
|
||||
|
||||
const float shear = m_italic ? (height * 0.25f) : 0.0f;
|
||||
float x0 = xPos, x1 = xPos + width + shear;
|
||||
float y0 = yPos, y1 = yPos + height;
|
||||
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
emitCharacterGeometry(c);
|
||||
t->tex(xOff / fontWidth, (yOff + 7.99f) / fontHeight);
|
||||
t->vertex(x0, y1, 0.0f);
|
||||
t->tex((xOff + width) / fontWidth, (yOff + 7.99f) / fontHeight);
|
||||
t->vertex(x1, y1, 0.0f);
|
||||
t->tex((xOff + width) / fontWidth, yOff / fontHeight);
|
||||
t->vertex(x1, y0, 0.0f);
|
||||
t->tex(xOff / fontWidth, yOff / fontHeight);
|
||||
t->vertex(x0, y0, 0.0f);
|
||||
t->end();
|
||||
|
||||
if (m_bold)
|
||||
{
|
||||
float dx = 1.0f;
|
||||
t->begin();
|
||||
t->tex(xOff / fontWidth, (yOff + 7.99f) / fontHeight);
|
||||
t->vertex(x0 + dx, y1, 0.0f);
|
||||
t->tex((xOff + width) / fontWidth, (yOff + 7.99f) / fontHeight);
|
||||
t->vertex(x1 + dx, y1, 0.0f);
|
||||
t->tex((xOff + width) / fontWidth, yOff / fontHeight);
|
||||
t->vertex(x1 + dx, y0, 0.0f);
|
||||
t->tex(xOff / fontWidth, yOff / fontHeight);
|
||||
t->vertex(x0 + dx, y0, 0.0f);
|
||||
t->end();
|
||||
}
|
||||
|
||||
if (m_underline)
|
||||
renderStyleLine(x0, y1 - 1.0f, xPos + static_cast<float>(charWidths[c]), y1);
|
||||
|
||||
|
|
@ -247,8 +240,8 @@ void Font::renderCharacter(wchar_t c)
|
|||
|
||||
void Font::drawShadow(const wstring& str, int x, int y, int color)
|
||||
{
|
||||
draw(str, x + 1, y + 1, color, true);
|
||||
draw(str, x, y, color, false);
|
||||
draw(str, x + 1, y + 1, color, true);
|
||||
draw(str, x, y, color, false);
|
||||
}
|
||||
|
||||
void Font::drawShadowLiteral(const wstring& str, int x, int y, int color)
|
||||
|
|
@ -296,7 +289,7 @@ static bool isSectionFormatCode(wchar_t ca)
|
|||
return l == L'l' || l == L'o' || l == L'n' || l == L'm' || l == L'r' || l == L'k';
|
||||
}
|
||||
|
||||
void Font::draw(const wstring &str, bool dropShadow, int initialColor)
|
||||
void Font::draw(const wstring &str, bool dropShadow)
|
||||
{
|
||||
// Bind the texture
|
||||
textures->bindTexture(m_textureLocation);
|
||||
|
|
@ -304,11 +297,8 @@ void Font::draw(const wstring &str, bool dropShadow, int initialColor)
|
|||
m_bold = m_italic = m_underline = m_strikethrough = false;
|
||||
wstring cleanStr = sanitize(str);
|
||||
|
||||
int currentColor = initialColor;
|
||||
|
||||
Tesselator *t = Tesselator::getInstance();
|
||||
t->begin();
|
||||
t->color(currentColor & 0x00ffffff, (currentColor >> 24) & 255);
|
||||
|
||||
for (int i = 0; i < static_cast<int>(cleanStr.length()); ++i)
|
||||
{
|
||||
|
|
@ -320,8 +310,10 @@ void Font::draw(const wstring &str, bool dropShadow, int initialColor)
|
|||
wchar_t ca = cleanStr[i+1];
|
||||
if (!isSectionFormatCode(ca))
|
||||
{
|
||||
addCharacterQuad(167);
|
||||
addCharacterQuad(ca);
|
||||
t->end();
|
||||
renderCharacter(167);
|
||||
renderCharacter(ca);
|
||||
t->begin();
|
||||
i += 1;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -337,12 +329,7 @@ void Font::draw(const wstring &str, bool dropShadow, int initialColor)
|
|||
else if (l == L'o') m_italic = true;
|
||||
else if (l == L'n') m_underline = true;
|
||||
else if (l == L'm') m_strikethrough = true;
|
||||
else if (l == L'r')
|
||||
{
|
||||
m_bold = m_italic = m_underline = m_strikethrough = noise = false;
|
||||
currentColor = initialColor;
|
||||
t->color(currentColor & 0x00ffffff, (currentColor >> 24) & 255);
|
||||
}
|
||||
else if (l == L'r') m_bold = m_italic = m_underline = m_strikethrough = noise = false;
|
||||
else if (l == L'k') noise = true;
|
||||
}
|
||||
else
|
||||
|
|
@ -350,8 +337,8 @@ void Font::draw(const wstring &str, bool dropShadow, int initialColor)
|
|||
noise = false;
|
||||
if (colorN < 0 || colorN > 15) colorN = 15;
|
||||
if (dropShadow) colorN += 16;
|
||||
currentColor = (initialColor & 0xff000000) | colors[colorN];
|
||||
t->color(currentColor & 0x00ffffff, (currentColor >> 24) & 255);
|
||||
int color = colors[colorN];
|
||||
glColor3f((color >> 16) / 255.0F, ((color >> 8) & 255) / 255.0F, (color & 255) / 255.0F);
|
||||
}
|
||||
i += 1;
|
||||
continue;
|
||||
|
|
@ -384,11 +371,11 @@ void Font::draw(const wstring& str, int x, int y, int color, bool dropShadow)
|
|||
if (dropShadow) // divide RGB by 4, preserve alpha
|
||||
color = (color & 0xfcfcfc) >> 2 | (color & (-1 << 24));
|
||||
|
||||
glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
glColor4f((color >> 16 & 255) / 255.0F, (color >> 8 & 255) / 255.0F, (color & 255) / 255.0F, (color >> 24 & 255) / 255.0F);
|
||||
|
||||
xPos = x;
|
||||
yPos = y;
|
||||
draw(str, dropShadow, color);
|
||||
draw(str, dropShadow);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -435,9 +422,9 @@ wstring Font::sanitize(const wstring& str)
|
|||
{
|
||||
wstring sb = str;
|
||||
|
||||
for (unsigned int i = 0; i < sb.length(); i++)
|
||||
for (unsigned int i = 0; i < sb.length(); i++)
|
||||
{
|
||||
if (CharacterExists(sb[i]))
|
||||
if (CharacterExists(sb[i]))
|
||||
{
|
||||
sb[i] = MapCharacter(sb[i]);
|
||||
}
|
||||
|
|
@ -446,8 +433,8 @@ wstring Font::sanitize(const wstring& str)
|
|||
// If this character isn't supported, just show the first character (empty square box character)
|
||||
sb[i] = 0;
|
||||
}
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
return sb;
|
||||
}
|
||||
|
||||
int Font::MapCharacter(wchar_t c)
|
||||
|
|
@ -500,95 +487,95 @@ void Font::drawWordWrap(const wstring &string, int x, int y, int w, int col, boo
|
|||
|
||||
void Font::drawWordWrapInternal(const wstring& string, int x, int y, int w, int col, bool darken, int h)
|
||||
{
|
||||
vector<wstring>lines = stringSplit(string,L'\n');
|
||||
if (lines.size() > 1)
|
||||
vector<wstring>lines = stringSplit(string,L'\n');
|
||||
if (lines.size() > 1)
|
||||
{
|
||||
for ( auto& it : lines )
|
||||
{
|
||||
for ( auto& it : lines )
|
||||
{
|
||||
// 4J Stu - Don't draw text that will be partially cutoff/overlap something it shouldn't
|
||||
if( (y + this->wordWrapHeight(it, w)) > h) break;
|
||||
drawWordWrapInternal(it, x, y, w, col, h);
|
||||
y += this->wordWrapHeight(it, w);
|
||||
}
|
||||
return;
|
||||
}
|
||||
vector<wstring> words = stringSplit(string,L' ');
|
||||
unsigned int pos = 0;
|
||||
while (pos < words.size())
|
||||
drawWordWrapInternal(it, x, y, w, col, h);
|
||||
y += this->wordWrapHeight(it, w);
|
||||
}
|
||||
return;
|
||||
}
|
||||
vector<wstring> words = stringSplit(string,L' ');
|
||||
unsigned int pos = 0;
|
||||
while (pos < words.size())
|
||||
{
|
||||
wstring line = words[pos++] + L" ";
|
||||
while (pos < words.size() && width(line + words[pos]) < w)
|
||||
wstring line = words[pos++] + L" ";
|
||||
while (pos < words.size() && width(line + words[pos]) < w)
|
||||
{
|
||||
line += words[pos++] + L" ";
|
||||
}
|
||||
while (width(line) > w)
|
||||
line += words[pos++] + L" ";
|
||||
}
|
||||
while (width(line) > w)
|
||||
{
|
||||
int l = 0;
|
||||
while (width(line.substr(0, l + 1)) <= w)
|
||||
int l = 0;
|
||||
while (width(line.substr(0, l + 1)) <= w)
|
||||
{
|
||||
l++;
|
||||
}
|
||||
if (trimString(line.substr(0, l)).length() > 0)
|
||||
l++;
|
||||
}
|
||||
if (trimString(line.substr(0, l)).length() > 0)
|
||||
{
|
||||
draw(line.substr(0, l), x, y, col);
|
||||
y += 8;
|
||||
}
|
||||
line = line.substr(l);
|
||||
draw(line.substr(0, l), x, y, col);
|
||||
y += 8;
|
||||
}
|
||||
line = line.substr(l);
|
||||
|
||||
// 4J Stu - Don't draw text that will be partially cutoff/overlap something it shouldn't
|
||||
if( (y + 8) > h) break;
|
||||
}
|
||||
}
|
||||
// 4J Stu - Don't draw text that will be partially cutoff/overlap something it shouldn't
|
||||
if (trimString(line).length() > 0 && !( (y + 8) > h) )
|
||||
if (trimString(line).length() > 0 && !( (y + 8) > h) )
|
||||
{
|
||||
draw(line, x, y, col);
|
||||
y += 8;
|
||||
}
|
||||
}
|
||||
draw(line, x, y, col);
|
||||
y += 8;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int Font::wordWrapHeight(const wstring& string, int w)
|
||||
{
|
||||
vector<wstring> lines = stringSplit(string,L'\n');
|
||||
if (lines.size() > 1)
|
||||
vector<wstring> lines = stringSplit(string,L'\n');
|
||||
if (lines.size() > 1)
|
||||
{
|
||||
int h = 0;
|
||||
for ( auto& it : lines )
|
||||
{
|
||||
h += this->wordWrapHeight(it, w);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
int h = 0;
|
||||
for ( auto& it : lines )
|
||||
{
|
||||
h += this->wordWrapHeight(it, w);
|
||||
}
|
||||
return h;
|
||||
}
|
||||
vector<wstring> words = stringSplit(string,L' ');
|
||||
unsigned int pos = 0;
|
||||
int y = 0;
|
||||
while (pos < words.size())
|
||||
unsigned int pos = 0;
|
||||
int y = 0;
|
||||
while (pos < words.size())
|
||||
{
|
||||
wstring line = words[pos++] + L" ";
|
||||
while (pos < words.size() && width(line + words[pos]) < w)
|
||||
wstring line = words[pos++] + L" ";
|
||||
while (pos < words.size() && width(line + words[pos]) < w)
|
||||
{
|
||||
line += words[pos++] + L" ";
|
||||
}
|
||||
while (width(line) > w)
|
||||
line += words[pos++] + L" ";
|
||||
}
|
||||
while (width(line) > w)
|
||||
{
|
||||
int l = 0;
|
||||
int l = 0;
|
||||
while (width(line.substr(0, l + 1)) <= w)
|
||||
{
|
||||
l++;
|
||||
}
|
||||
if (trimString(line.substr(0, l)).length() > 0)
|
||||
l++;
|
||||
}
|
||||
if (trimString(line.substr(0, l)).length() > 0)
|
||||
{
|
||||
y += 8;
|
||||
}
|
||||
line = line.substr(l);
|
||||
}
|
||||
if (trimString(line).length() > 0) {
|
||||
y += 8;
|
||||
}
|
||||
}
|
||||
if (y < 8) y += 8;
|
||||
return y;
|
||||
y += 8;
|
||||
}
|
||||
line = line.substr(l);
|
||||
}
|
||||
if (trimString(line).length() > 0) {
|
||||
y += 8;
|
||||
}
|
||||
}
|
||||
if (y < 8) y += 8;
|
||||
return y;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ private:
|
|||
std::map<int, int> m_charMap;
|
||||
|
||||
public:
|
||||
Font(Options *options, const wstring& name, Textures* textures, bool enforceUnicode, ResourceLocation *textureLocation, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[] = nullptr);
|
||||
Font(Options *options, const wstring& name, Textures* textures, bool enforceUnicode, ResourceLocation *textureLocation, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[] = nullptr);
|
||||
#ifndef _XBOX
|
||||
// 4J Stu - This dtor clashes with one in xui! We never delete these anyway so take it out for now. Can go back when we have got rid of XUI
|
||||
~Font();
|
||||
|
|
@ -48,8 +48,6 @@ public:
|
|||
private:
|
||||
void renderCharacter(wchar_t c); // 4J added
|
||||
void addCharacterQuad(wchar_t c);
|
||||
void addSolidQuad(float x0, float y0, float x1, float y1);
|
||||
void emitCharacterGeometry(wchar_t c);
|
||||
void renderStyleLine(float x0, float y0, float x1, float y1); // solid line for underline/strikethrough
|
||||
|
||||
public:
|
||||
|
|
@ -67,7 +65,7 @@ public:
|
|||
private:
|
||||
wstring reorderBidi(const wstring &str);
|
||||
|
||||
void draw(const wstring &str, bool dropShadow, int baseColor);
|
||||
void draw(const wstring &str, bool dropShadow);
|
||||
void draw(const wstring& str, int x, int y, int color, bool dropShadow);
|
||||
void drawLiteral(const wstring& str, int x, int y, int color); // no § parsing
|
||||
int MapCharacter(wchar_t c); // 4J added
|
||||
|
|
|
|||
|
|
@ -359,17 +359,14 @@ void GameRenderer::pick(float a)
|
|||
}
|
||||
}
|
||||
|
||||
// Toru - wrapping these methods for backwards compatibility,
|
||||
// no longer setting m_fov as its use doesn't respect applyEffects param in GameRenderer::getFov
|
||||
void GameRenderer::SetFovVal(float fov)
|
||||
{
|
||||
//m_fov=fov;
|
||||
mc->options->set(Options::Option::FOV, (fov - 70) / 40);
|
||||
m_fov=fov;
|
||||
}
|
||||
|
||||
float GameRenderer::GetFovVal()
|
||||
{
|
||||
return 70 + mc->options->fov * 40;//m_fov;
|
||||
return m_fov;
|
||||
}
|
||||
|
||||
void GameRenderer::tickFov()
|
||||
|
|
@ -393,8 +390,6 @@ float GameRenderer::getFov(float a, bool applyEffects)
|
|||
shared_ptr<LocalPlayer> player = dynamic_pointer_cast<LocalPlayer>(mc->cameraTargetPlayer);
|
||||
int playerIdx = player ? player->GetXboxPad() : 0;
|
||||
float fov = m_fov;//70;
|
||||
if (fov < 1) fov = 1; // Crash fix
|
||||
|
||||
if (applyEffects)
|
||||
{
|
||||
fov += mc->options->fov * 40;
|
||||
|
|
|
|||
|
|
@ -443,8 +443,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
double maxHealth = minecraft->localplayers[iPad]->getAttribute(SharedMonsterAttributes.MAX_HEALTH);
|
||||
|
||||
double totalAbsorption = minecraft->localplayers[iPad]->getAbsorptionAmount();
|
||||
const double healthHalves = (maxHealth + totalAbsorption) / 2.0;
|
||||
int numHealthRows = Mth.ceil(healthHalves / (float) NUM_HEARTS_PER_ROW);
|
||||
int numHealthRows = Mth.ceil((maxHealth + totalAbsorption) / 2 / (float) NUM_HEARTS_PER_ROW);
|
||||
int healthRowHeight = Math.max(10 - (numHealthRows - 2), 3);
|
||||
int yLine2 = yLine1 - (numHealthRows - 1) * healthRowHeight - 10;
|
||||
absorption = totalAbsorption;
|
||||
|
|
@ -470,7 +469,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
}
|
||||
|
||||
//minecraft.profiler.popPush("health");
|
||||
for (int i = (int)Mth.ceil(healthHalves) - 1; i >= 0; i--)
|
||||
for (int i = Mth.ceil((maxHealth + totalAbsorption) / 2) - 1; i >= 0; i--)
|
||||
{
|
||||
int healthTexBaseX = 16;
|
||||
if (minecraft.player.hasEffect(MobEffect.poison))
|
||||
|
|
@ -608,11 +607,8 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
// render air bubbles
|
||||
if (minecraft->player->isUnderLiquid(Material::water))
|
||||
{
|
||||
const int airSupply = minecraft->player->getAirSupply();
|
||||
const float airScale = 10.0f / Player::TOTAL_AIR_SUPPLY;
|
||||
const float airSupplyScaled = airSupply * airScale;
|
||||
int count = (int) ceil((airSupply - 2) * airScale);
|
||||
int extra = (int) ceil(airSupplyScaled) - count;
|
||||
int count = (int) ceil((minecraft->player->getAirSupply() - 2) * 10.0f / Player::TOTAL_AIR_SUPPLY);
|
||||
int extra = (int) ceil((minecraft->player->getAirSupply()) * 10.0f / Player::TOTAL_AIR_SUPPLY) - count;
|
||||
for (int i = 0; i < count + extra; i++)
|
||||
{
|
||||
// Air bubbles
|
||||
|
|
@ -729,8 +725,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
Lighting::turnOn();
|
||||
glRotatef(-45 - 90, 0, 1, 0);
|
||||
|
||||
const float xRotAngle = -(float) atan(yd / 40.0f) * 20;
|
||||
glRotatef(xRotAngle, 1, 0, 0);
|
||||
glRotatef(-(float) atan(yd / 40.0f ) * 20, 1, 0, 0);
|
||||
float bodyRot = (minecraft->player->yBodyRotO + (minecraft->player->yBodyRot - minecraft->player->yBodyRotO));
|
||||
// Fixed rotation angle of degrees, adjusted by bodyRot to negate the rotation that occurs in the renderer
|
||||
// bodyRot in the rotation below is a simplification of "180 - (180 - bodyRot)" where the first 180 is EntityRenderDispatcher::instance->playerRotY that we set below
|
||||
|
|
@ -741,7 +736,7 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
// Set head rotation to body rotation to make head static
|
||||
minecraft->player->yRot = bodyRot;
|
||||
minecraft->player->yRotO = minecraft->player->yRot;
|
||||
minecraft->player->xRot = xRotAngle;
|
||||
minecraft->player->xRot = -(float) atan(yd / 40.0f) * 20;
|
||||
|
||||
minecraft->player->onFire = 0;
|
||||
minecraft->player->setSharedFlag(Entity::FLAG_ONFIRE, false);
|
||||
|
|
@ -854,6 +849,207 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
// font.draw(str, x + 1, y, 0xffffff);
|
||||
// }
|
||||
|
||||
#ifndef _FINAL_BUILD
|
||||
MemSect(31);
|
||||
|
||||
// temporarily render overlay at all times so version is more obvious in bug reports
|
||||
// we can turn this off once things stabilize
|
||||
if (true)// minecraft->options->renderDebug && minecraft->player != nullptr && minecraft->level != nullptr)
|
||||
{
|
||||
const int debugLeft = 1;
|
||||
const int debugTop = 1;
|
||||
const float maxContentWidth = 1200.f;
|
||||
const float maxContentHeight = 420.f;
|
||||
float scale = static_cast<float>(screenWidth - debugLeft - 8) / maxContentWidth;
|
||||
float scaleV = static_cast<float>(screenHeight - debugTop - 80) / maxContentHeight;
|
||||
if (scaleV < scale) scale = scaleV;
|
||||
if (scale > 1.f) scale = 1.f;
|
||||
if (scale < 0.5f) scale = 0.5f;
|
||||
glPushMatrix();
|
||||
glTranslatef(static_cast<float>(debugLeft), static_cast<float>(debugTop), 0.f);
|
||||
glScalef(scale, scale, 1.f);
|
||||
glTranslatef(static_cast<float>(-debugLeft), static_cast<float>(-debugTop), 0.f);
|
||||
|
||||
vector<wstring> lines;
|
||||
|
||||
lines.push_back(ClientConstants::VERSION_STRING);
|
||||
lines.push_back(ClientConstants::BRANCH_STRING);
|
||||
if (minecraft->options->renderDebug && minecraft->player != nullptr && minecraft->level != nullptr)
|
||||
{
|
||||
lines.push_back(minecraft->fpsString);
|
||||
lines.push_back(L"E: " + std::to_wstring(minecraft->level->getAllEntities().size())); // Could maybe use entity::shouldRender to work out how many are rendered but thats like expensive
|
||||
// TODO Add server information with packet counts - once multiplayer is more stable
|
||||
int renderDistance = app.GetGameSettings(iPad, eGameSetting_RenderDistance);
|
||||
// Calculate the chunk sections using 16 * (2n + 1)^2
|
||||
lines.push_back(L"C: " + std::to_wstring(16 * (2 * renderDistance + 1) * (2 * renderDistance + 1)) + L" D: " + std::to_wstring(renderDistance));
|
||||
lines.push_back(minecraft->gatherStats4()); // Chunk Cache
|
||||
|
||||
// Dimension
|
||||
wstring dimension = L"unknown";
|
||||
switch (minecraft->player->dimension)
|
||||
{
|
||||
case -1:
|
||||
dimension = L"minecraft:the_nether";
|
||||
break;
|
||||
case 0:
|
||||
dimension = L"minecraft:overworld";
|
||||
break;
|
||||
case 1:
|
||||
dimension = L"minecraft:the_end";
|
||||
break;
|
||||
}
|
||||
lines.push_back(dimension);
|
||||
|
||||
lines.push_back(L""); // Spacer
|
||||
|
||||
// Players block pos
|
||||
int xBlockPos = Mth::floor(minecraft->player->x);
|
||||
int yBlockPos = Mth::floor(minecraft->player->y);
|
||||
int zBlockPos = Mth::floor(minecraft->player->z);
|
||||
|
||||
// Chunk player is in
|
||||
int xChunkPos = xBlockPos >> 4;
|
||||
int yChunkPos = yBlockPos >> 4;
|
||||
int zChunkPos = zBlockPos >> 4;
|
||||
|
||||
// Players offset within the chunk
|
||||
int xChunkOffset = xBlockPos & 15;
|
||||
int yChunkOffset = yBlockPos & 15;
|
||||
int zChunkOffset = zBlockPos & 15;
|
||||
|
||||
// Format the position like java with limited decumal places
|
||||
WCHAR posString[44]; // Allows upto 7 digit positions (+-9_999_999)
|
||||
swprintf(posString, 44, L"%.3f / %.5f / %.3f", minecraft->player->x, minecraft->player->y, minecraft->player->z);
|
||||
|
||||
lines.push_back(L"XYZ: " + std::wstring(posString));
|
||||
lines.push_back(L"Block: " + std::to_wstring(static_cast<int>(xBlockPos)) + L" " + std::to_wstring(static_cast<int>(yBlockPos)) + L" " + std::to_wstring(static_cast<int>(zBlockPos)));
|
||||
lines.push_back(L"Chunk: " + std::to_wstring(xChunkOffset) + L" " + std::to_wstring(yChunkOffset) + L" " + std::to_wstring(zChunkOffset) + L" in " + std::to_wstring(xChunkPos) + L" " + std::to_wstring(yChunkPos) + L" " + std::to_wstring(zChunkPos));
|
||||
|
||||
// Wrap the yRot to 360 then adjust to (-180 to 180) range to match java
|
||||
float yRotDisplay = fmod(minecraft->player->yRot, 360.0f);
|
||||
if (yRotDisplay > 180.0f)
|
||||
{
|
||||
yRotDisplay -= 360.0f;
|
||||
}
|
||||
if (yRotDisplay < -180.0f)
|
||||
{
|
||||
yRotDisplay += 360.0f;
|
||||
}
|
||||
// Generate the angle string in the format "yRot / xRot" with one decimal place, similar to java edition
|
||||
WCHAR angleString[16];
|
||||
swprintf(angleString, 16, L"%.1f / %.1f", yRotDisplay, minecraft->player->xRot);
|
||||
|
||||
// Work out the named direction
|
||||
int direction = Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3;
|
||||
wstring cardinalDirection;
|
||||
switch (direction)
|
||||
{
|
||||
case 0:
|
||||
cardinalDirection = L"south";
|
||||
break;
|
||||
case 1:
|
||||
cardinalDirection = L"west";
|
||||
break;
|
||||
case 2:
|
||||
cardinalDirection = L"north";
|
||||
break;
|
||||
case 3:
|
||||
cardinalDirection = L"east";
|
||||
break;
|
||||
}
|
||||
|
||||
lines.push_back(L"Facing: " + cardinalDirection + L" (" + angleString + L")");
|
||||
|
||||
// We have to limit y to 256 as we don't get any information past that
|
||||
if (minecraft->level != NULL && minecraft->level->hasChunkAt(xBlockPos, fmod(yBlockPos, 256), zBlockPos))
|
||||
{
|
||||
LevelChunk *chunkAt = minecraft->level->getChunkAt(xBlockPos, zBlockPos);
|
||||
if (chunkAt != NULL)
|
||||
{
|
||||
int skyLight = chunkAt->getBrightness(LightLayer::Sky, xChunkOffset, yChunkOffset, zChunkOffset);
|
||||
int blockLight = chunkAt->getBrightness(LightLayer::Block, xChunkOffset, yChunkOffset, zChunkOffset);
|
||||
int maxLight = fmax(skyLight, blockLight);
|
||||
lines.push_back(L"Light: " + std::to_wstring(maxLight) + L" (" + std::to_wstring(skyLight) + L" sky, " + std::to_wstring(blockLight) + L" block)");
|
||||
|
||||
lines.push_back(L"CH S: " + std::to_wstring(chunkAt->getHeightmap(xChunkOffset, zChunkOffset)));
|
||||
|
||||
Biome *biome = chunkAt->getBiome(xChunkOffset, zChunkOffset, minecraft->level->getBiomeSource());
|
||||
lines.push_back(L"Biome: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")");
|
||||
|
||||
lines.push_back(L"Difficulty: " + std::to_wstring(minecraft->level->difficulty) + L" (Day " + std::to_wstring(minecraft->level->getGameTime() / Level::TICKS_PER_DAY) + L")");
|
||||
}
|
||||
}
|
||||
|
||||
// This is all LCE only stuff, it was never on java
|
||||
lines.push_back(L""); // Spacer
|
||||
lines.push_back(L"Seed: " + std::to_wstring(minecraft->level->getLevelData()->getSeed()));
|
||||
lines.push_back(minecraft->gatherStats1()); // Time to autosave
|
||||
lines.push_back(minecraft->gatherStats2()); // Empty currently - CPlatformNetworkManagerStub::GatherStats()
|
||||
lines.push_back(minecraft->gatherStats3()); // RTT
|
||||
}
|
||||
|
||||
#ifdef _DEBUG // Only show terrain features in debug builds not release
|
||||
// TERRAIN FEATURES
|
||||
if (minecraft->level->dimension->id == 0)
|
||||
{
|
||||
wstring wfeature[eTerrainFeature_Count];
|
||||
|
||||
wfeature[eTerrainFeature_Stronghold] = L"Stronghold: ";
|
||||
wfeature[eTerrainFeature_Mineshaft] = L"Mineshaft: ";
|
||||
wfeature[eTerrainFeature_Village] = L"Village: ";
|
||||
wfeature[eTerrainFeature_Ravine] = L"Ravine: ";
|
||||
|
||||
float maxW = static_cast<float>(screenWidth - debugLeft - 8) / scale;
|
||||
float maxWForContent = maxW - static_cast<float>(font->width(L"..."));
|
||||
bool truncated[eTerrainFeature_Count] = {};
|
||||
|
||||
for (size_t i = 0; i < app.m_vTerrainFeatures.size(); i++)
|
||||
{
|
||||
FEATURE_DATA *pFeatureData = app.m_vTerrainFeatures[i];
|
||||
int type = pFeatureData->eTerrainFeature;
|
||||
if (type < eTerrainFeature_Stronghold || type > eTerrainFeature_Ravine)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (truncated[type])
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
wstring itemInfo = L"[" + std::to_wstring(pFeatureData->x * 16) + L", " + std::to_wstring(pFeatureData->z * 16) + L"] ";
|
||||
if (font->width(wfeature[type] + itemInfo) <= maxWForContent)
|
||||
{
|
||||
wfeature[type] += itemInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
wfeature[type] += L"...";
|
||||
truncated[type] = true;
|
||||
}
|
||||
}
|
||||
|
||||
lines.push_back(L""); // Add a spacer line
|
||||
for (int i = eTerrainFeature_Stronghold; i <= static_cast<int>(eTerrainFeature_Ravine); i++)
|
||||
{
|
||||
lines.push_back(wfeature[i]);
|
||||
}
|
||||
lines.push_back(L"");
|
||||
}
|
||||
#endif
|
||||
|
||||
// Loop through the lines and draw them all on screen
|
||||
int yPos = debugTop;
|
||||
for (const auto &line : lines)
|
||||
{
|
||||
drawString(font, line, debugLeft, yPos, 0xffffff);
|
||||
yPos += 10;
|
||||
}
|
||||
|
||||
glPopMatrix();
|
||||
}
|
||||
MemSect(0);
|
||||
#endif
|
||||
|
||||
lastTickA = a;
|
||||
// 4J Stu - This is now displayed in a xui scene
|
||||
#if 0
|
||||
|
|
@ -1007,228 +1203,6 @@ void Gui::render(float a, bool mouseFree, int xMouse, int yMouse)
|
|||
glPopMatrix();
|
||||
}
|
||||
|
||||
#ifndef _FINAL_BUILD
|
||||
MemSect(31);
|
||||
if (true)
|
||||
{
|
||||
// Real window dimensions updated on every WM_SIZE — always current
|
||||
extern int g_rScreenWidth;
|
||||
extern int g_rScreenHeight;
|
||||
|
||||
// Set up a fresh projection using physical pixel coordinates so the debug
|
||||
// text is never distorted regardless of aspect ratio, splitscreen layout,
|
||||
// or menu state. 1 coordinate unit = 1 physical pixel.
|
||||
// Compute the actual viewport dimensions for this player's screen section.
|
||||
// glOrtho must match the viewport exactly for 1 unit = 1 physical pixel.
|
||||
int vpW = g_rScreenWidth;
|
||||
int vpH = g_rScreenHeight;
|
||||
switch (minecraft->player->m_iScreenSection)
|
||||
{
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_TOP:
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_BOTTOM:
|
||||
vpH /= 2;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_LEFT:
|
||||
case C4JRender::VIEWPORT_TYPE_SPLIT_RIGHT:
|
||||
vpW /= 2;
|
||||
break;
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_LEFT:
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_TOP_RIGHT:
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_LEFT:
|
||||
case C4JRender::VIEWPORT_TYPE_QUADRANT_BOTTOM_RIGHT:
|
||||
vpW /= 2;
|
||||
vpH /= 2;
|
||||
break;
|
||||
default: // VIEWPORT_TYPE_FULLSCREEN
|
||||
break;
|
||||
}
|
||||
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glOrtho(0, vpW, vpH, 0, 1000, 3000);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPushMatrix();
|
||||
glLoadIdentity();
|
||||
glTranslatef(0, 0, -2000);
|
||||
|
||||
// Font was designed for guiScale px/unit; scale up so characters appear
|
||||
// at the same physical size as the rest of the HUD at 0.5x.
|
||||
const float fontScale = static_cast<float>(guiScale) * 1.0f;
|
||||
const int debugLeft = 1;
|
||||
const int debugTop = 1;
|
||||
|
||||
glTranslatef(static_cast<float>(debugLeft), static_cast<float>(debugTop), 0.f);
|
||||
glScalef(fontScale, fontScale, 1.f);
|
||||
glTranslatef(static_cast<float>(-debugLeft), static_cast<float>(-debugTop), 0.f);
|
||||
|
||||
vector<wstring> lines;
|
||||
|
||||
// Only show version/branch for player 0 to avoid cluttering each splitscreen viewport
|
||||
if (iPad == 0)
|
||||
{
|
||||
lines.push_back(ClientConstants::VERSION_STRING);
|
||||
lines.push_back(ClientConstants::BRANCH_STRING);
|
||||
}
|
||||
|
||||
if (minecraft->options->renderDebug && minecraft->player != nullptr && minecraft->level != nullptr)
|
||||
{
|
||||
lines.push_back(minecraft->fpsString);
|
||||
lines.push_back(L"E: " + std::to_wstring(minecraft->level->getAllEntities().size()));
|
||||
int renderDistance = app.GetGameSettings(iPad, eGameSetting_RenderDistance);
|
||||
// Calculate the chunk sections using 16 * (2n + 1)^2
|
||||
lines.push_back(L"C: " + std::to_wstring(16 * (2 * renderDistance + 1) * (2 * renderDistance + 1)) + L" D: " + std::to_wstring(renderDistance));
|
||||
lines.push_back(minecraft->gatherStats4());
|
||||
|
||||
// Dimension
|
||||
wstring dimension = L"unknown";
|
||||
switch (minecraft->player->dimension)
|
||||
{
|
||||
case -1:
|
||||
dimension = L"minecraft:the_nether";
|
||||
break;
|
||||
case 0:
|
||||
dimension = L"minecraft:overworld";
|
||||
break;
|
||||
case 1:
|
||||
dimension = L"minecraft:the_end";
|
||||
break;
|
||||
}
|
||||
lines.push_back(dimension);
|
||||
|
||||
lines.push_back(L""); // Spacer
|
||||
|
||||
// Players block pos
|
||||
int xBlockPos = Mth::floor(minecraft->player->x);
|
||||
int yBlockPos = Mth::floor(minecraft->player->y);
|
||||
int zBlockPos = Mth::floor(minecraft->player->z);
|
||||
|
||||
// Chunk player is in
|
||||
int xChunkPos = xBlockPos >> 4;
|
||||
int yChunkPos = yBlockPos >> 4;
|
||||
int zChunkPos = zBlockPos >> 4;
|
||||
|
||||
// Players offset within the chunk
|
||||
int xChunkOffset = xBlockPos & 15;
|
||||
int yChunkOffset = yBlockPos & 15;
|
||||
int zChunkOffset = zBlockPos & 15;
|
||||
|
||||
// Format the position like java with limited decumal places
|
||||
WCHAR posString[44]; // Allows upto 7 digit positions (+-9_999_999)
|
||||
swprintf(posString, 44, L"%.3f / %.5f / %.3f", minecraft->player->x, minecraft->player->y, minecraft->player->z);
|
||||
|
||||
lines.push_back(L"XYZ: " + std::wstring(posString));
|
||||
lines.push_back(L"Block: " + std::to_wstring(xBlockPos) + L" " + std::to_wstring(yBlockPos) + L" " + std::to_wstring(zBlockPos));
|
||||
lines.push_back(L"Chunk: " + std::to_wstring(xChunkOffset) + L" " + std::to_wstring(yChunkOffset) + L" " + std::to_wstring(zChunkOffset) + L" in " + std::to_wstring(xChunkPos) + L" " + std::to_wstring(yChunkPos) + L" " + std::to_wstring(zChunkPos));
|
||||
|
||||
// Wrap the yRot to 360 then adjust to (-180 to 180) range to match java
|
||||
float yRotDisplay = fmod(minecraft->player->yRot, 360.0f);
|
||||
if (yRotDisplay > 180.0f) yRotDisplay -= 360.0f;
|
||||
if (yRotDisplay < -180.0f) yRotDisplay += 360.0f;
|
||||
// Generate the angle string in the format "yRot / xRot" with one decimal place, similar to java edition
|
||||
WCHAR angleString[16];
|
||||
swprintf(angleString, 16, L"%.1f / %.1f", yRotDisplay, minecraft->player->xRot);
|
||||
|
||||
// Work out the named direction
|
||||
int direction = Mth::floor(minecraft->player->yRot * 4.0f / 360.0f + 0.5) & 0x3;
|
||||
const wchar_t* cardinals[] = { L"south", L"west", L"north", L"east" };
|
||||
lines.push_back(L"Facing: " + std::wstring(cardinals[direction]) + L" (" + angleString + L")");
|
||||
|
||||
// We have to limit y to 256 as we don't get any information past that
|
||||
if (minecraft->level != NULL && minecraft->level->hasChunkAt(xBlockPos, fmod(yBlockPos, 256), zBlockPos))
|
||||
{
|
||||
LevelChunk *chunkAt = minecraft->level->getChunkAt(xBlockPos, zBlockPos);
|
||||
if (chunkAt != NULL)
|
||||
{
|
||||
int skyLight = chunkAt->getBrightness(LightLayer::Sky, xChunkOffset, yChunkOffset, zChunkOffset);
|
||||
int blockLight = chunkAt->getBrightness(LightLayer::Block, xChunkOffset, yChunkOffset, zChunkOffset);
|
||||
int maxLight = fmax(skyLight, blockLight);
|
||||
lines.push_back(L"Light: " + std::to_wstring(maxLight) + L" (" + std::to_wstring(skyLight) + L" sky, " + std::to_wstring(blockLight) + L" block)");
|
||||
|
||||
lines.push_back(L"CH S: " + std::to_wstring(chunkAt->getHeightmap(xChunkOffset, zChunkOffset)));
|
||||
|
||||
Biome *biome = chunkAt->getBiome(xChunkOffset, zChunkOffset, minecraft->level->getBiomeSource());
|
||||
lines.push_back(L"Biome: " + biome->m_name + L" (" + std::to_wstring(biome->id) + L")");
|
||||
|
||||
lines.push_back(L"Difficulty: " + std::to_wstring(minecraft->level->difficulty) + L" (Day " + std::to_wstring(minecraft->level->getGameTime() / Level::TICKS_PER_DAY) + L")");
|
||||
}
|
||||
}
|
||||
|
||||
// This is all LCE only stuff, it was never on java
|
||||
lines.push_back(L""); // Spacer
|
||||
lines.push_back(L"Seed: " + std::to_wstring(minecraft->level->getLevelData()->getSeed()));
|
||||
lines.push_back(minecraft->gatherStats1()); // Time to autosave
|
||||
lines.push_back(minecraft->gatherStats2()); // Empty currently - CPlatformNetworkManagerStub::GatherStats()
|
||||
lines.push_back(minecraft->gatherStats3()); // RTT
|
||||
|
||||
#ifdef _DEBUG // Only show terrain features in debug builds not release
|
||||
|
||||
// No point trying to render this when not in the overworld
|
||||
if (minecraft->level->dimension->id == 0)
|
||||
{
|
||||
wstring wfeature[eTerrainFeature_Count];
|
||||
wfeature[eTerrainFeature_Stronghold] = L"Stronghold: ";
|
||||
wfeature[eTerrainFeature_Mineshaft] = L"Mineshaft: ";
|
||||
wfeature[eTerrainFeature_Village] = L"Village: ";
|
||||
wfeature[eTerrainFeature_Ravine] = L"Ravine: ";
|
||||
|
||||
// maxW in font units: physical width divided by font scale
|
||||
float maxW = (static_cast<float>(g_rScreenWidth) - debugLeft - 8) / fontScale;
|
||||
float maxWForContent = maxW - static_cast<float>(font->width(L"..."));
|
||||
bool truncated[eTerrainFeature_Count] = {};
|
||||
|
||||
for (size_t i = 0; i < app.m_vTerrainFeatures.size(); i++)
|
||||
{
|
||||
FEATURE_DATA *pFeatureData = app.m_vTerrainFeatures[i];
|
||||
int type = pFeatureData->eTerrainFeature;
|
||||
if (type < eTerrainFeature_Stronghold || type > eTerrainFeature_Ravine) continue;
|
||||
if (truncated[type]) continue;
|
||||
|
||||
wstring itemInfo = L"[" + std::to_wstring(pFeatureData->x * 16) + L", " + std::to_wstring(pFeatureData->z * 16) + L"] ";
|
||||
if (font->width(wfeature[type] + itemInfo) <= maxWForContent)
|
||||
{
|
||||
wfeature[type] += itemInfo;
|
||||
}
|
||||
else
|
||||
{
|
||||
wfeature[type] += L"...";
|
||||
truncated[type] = true;
|
||||
}
|
||||
}
|
||||
|
||||
lines.push_back(L""); // Spacer
|
||||
for (int i = eTerrainFeature_Stronghold; i <= static_cast<int>(eTerrainFeature_Ravine); i++)
|
||||
{
|
||||
lines.push_back(wfeature[i]);
|
||||
}
|
||||
lines.push_back(L""); // Spacer
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Disable the depth test so the text shows on top of the paperdoll
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
// Loop through the lines and draw them all on screen
|
||||
int yPos = debugTop;
|
||||
for (const auto &line : lines)
|
||||
{
|
||||
drawString(font, line, debugLeft, yPos, 0xffffff);
|
||||
yPos += 10;
|
||||
}
|
||||
|
||||
// Restore the depth test
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glPopMatrix();
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
}
|
||||
MemSect(0);
|
||||
#endif
|
||||
|
||||
glColor4f(1, 1, 1, 1);
|
||||
glDisable(GL_BLEND);
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
|
|||
|
||||
if (riding)
|
||||
{
|
||||
if ((uiBitmaskOverrideAnim&(1<<eAnim_SmallModel)) == 0)
|
||||
if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel) == 0)
|
||||
{
|
||||
arm0->xRot += -HALF_PI * 0.4f;
|
||||
arm1->xRot += -HALF_PI * 0.4f;
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ void ItemInHandRenderer::renderItem(shared_ptr<LivingEntity> mob, shared_ptr<Ite
|
|||
// by texture lighting. This is for colourising things held in 3rd person view.
|
||||
if ( (setColor) && (item != nullptr) )
|
||||
{
|
||||
int col = Item::items[item->id]->getColor(item, layer);
|
||||
int col = Item::items[item->id]->getColor(item,0);
|
||||
float red = ((col >> 16) & 0xff) / 255.0f;
|
||||
float g = ((col >> 8) & 0xff) / 255.0f;
|
||||
float b = ((col) & 0xff) / 255.0f;
|
||||
|
|
@ -286,20 +286,6 @@ void ItemInHandRenderer::renderItem(shared_ptr<LivingEntity> mob, shared_ptr<Ite
|
|||
|
||||
float xo = 0.0f;
|
||||
float yo = 0.3f;
|
||||
|
||||
|
||||
// Re position height of held item if skin is small
|
||||
if (mob->getAnimOverrideBitmask() & (1 << HumanoidModel::eAnim_SmallModel))
|
||||
{
|
||||
if (mob->isRiding())
|
||||
{
|
||||
std::shared_ptr<Entity> ridingEntity = mob->riding;
|
||||
if (ridingEntity != nullptr) // Safety check;
|
||||
{
|
||||
yo += 0.3f; // reverts the change in Boat.cpp for smaller models.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
glEnable(GL_RESCALE_NORMAL);
|
||||
glTranslatef(-xo, -yo, 0);
|
||||
|
|
|
|||
48741
Minecraft.Client/Minecraft.Client.vcxproj
Normal file
48741
Minecraft.Client/Minecraft.Client.vcxproj
Normal file
File diff suppressed because it is too large
Load diff
6319
Minecraft.Client/Minecraft.Client.vcxproj.filters
Normal file
6319
Minecraft.Client/Minecraft.Client.vcxproj.filters
Normal file
File diff suppressed because it is too large
Load diff
11
Minecraft.Client/Minecraft.Client.vcxproj.vspscc
Normal file
11
Minecraft.Client/Minecraft.Client.vcxproj.vspscc
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
""
|
||||
{
|
||||
"FILE_VERSION" = "9237"
|
||||
"ENLISTMENT_CHOICE" = "NEVER"
|
||||
"PROJECT_FILE_RELATIVE_PATH" = ""
|
||||
"NUMBER_OF_EXCLUDED_FILES" = "1"
|
||||
"EXCLUDED_FILE0" = "Durango\\Autogenerated.appxmanifest"
|
||||
"ORIGINAL_PROJECT_FILE_PATH" = ""
|
||||
"NUMBER_OF_NESTED_PROJECTS" = "0"
|
||||
"SOURCE_CONTROL_SETTINGS_PROVIDER" = "PROVIDER"
|
||||
}
|
||||
|
|
@ -1629,7 +1629,7 @@ void Minecraft::run_middle()
|
|||
s_prevXButtons[i] = xCurButtons;
|
||||
}
|
||||
bool startJustPressed = s_startPressLatch[i] > 0;
|
||||
bool tryJoin = !pause && !ui.IsIgnorePlayerJoinMenuDisplayed(ProfileManager.GetPrimaryPad()) && g_NetworkManager.SessionHasSpace() && xCurButtons != 0 && g_KBMInput.IsWindowFocused();
|
||||
bool tryJoin = !pause && !ui.IsIgnorePlayerJoinMenuDisplayed(ProfileManager.GetPrimaryPad()) && g_NetworkManager.SessionHasSpace() && xCurButtons != 0;
|
||||
#else
|
||||
bool tryJoin = !pause && !ui.IsIgnorePlayerJoinMenuDisplayed(ProfileManager.GetPrimaryPad()) && g_NetworkManager.SessionHasSpace() && RenderManager.IsHiDef() && InputManager.ButtonPressed(i);
|
||||
#endif
|
||||
|
|
@ -3706,9 +3706,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
app.EnableDebugOverlay(options->renderDebug,iPad);
|
||||
#else
|
||||
// 4J Stu - The xbox uses a completely different way of navigating to this scene
|
||||
// Always open in the fullscreen group so the overlay spans the full window
|
||||
// regardless of split-screen viewport configuration.
|
||||
ui.NavigateToScene(0, eUIScene_DebugOverlay, nullptr, eUILayer_Debug, eUIGroup_Fullscreen);
|
||||
ui.NavigateToScene(0, eUIScene_DebugOverlay, nullptr, eUILayer_Debug);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
|
@ -3746,10 +3744,7 @@ void Minecraft::tick(bool bFirst, bool bUpdateTextures)
|
|||
if((player->ullButtonsPressed&(1LL<<MINECRAFT_ACTION_INVENTORY)) && gameMode->isInputAllowed(MINECRAFT_ACTION_INVENTORY))
|
||||
{
|
||||
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->player;
|
||||
if (!player->isRiding())
|
||||
{
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
}
|
||||
ui.PlayUISFX(eSFX_Press);
|
||||
|
||||
if(gameMode->isServerControlledInventory())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -569,7 +569,6 @@ MinecraftServer::MinecraftServer()
|
|||
playerIdleTimeout = 0;
|
||||
m_postUpdateThread = nullptr;
|
||||
forceGameType = false;
|
||||
m_spawnProtectionRadius = 0;
|
||||
|
||||
commandDispatcher = new ServerCommandDispatcher();
|
||||
InitializeCriticalSection(&m_consoleInputCS);
|
||||
|
|
@ -616,10 +615,6 @@ bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData *initData, DW
|
|||
logger.info("Loading properties");
|
||||
#endif
|
||||
settings = new Settings(new File(L"server.properties"));
|
||||
// Dedicated-only: spawn-protection radius in blocks; 0 disables protection.
|
||||
m_spawnProtectionRadius = GetDedicatedServerInt(settings, L"spawn-protection", 0);
|
||||
if (m_spawnProtectionRadius < 0) m_spawnProtectionRadius = 0;
|
||||
if (m_spawnProtectionRadius > 256) m_spawnProtectionRadius = 256;
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_Difficulty, GetDedicatedServerInt(settings, L"difficulty", app.GetGameHostOption(eGameHostOption_Difficulty)));
|
||||
app.SetGameHostOption(eGameHostOption_GameType, GetDedicatedServerInt(settings, L"gamemode", app.GetGameHostOption(eGameHostOption_GameType)));
|
||||
|
|
@ -636,7 +631,6 @@ bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData *initData, DW
|
|||
app.DebugPrintf("ServerSettings: pvp is %s\n",(app.GetGameHostOption(eGameHostOption_PvP)>0)?"on":"off");
|
||||
app.DebugPrintf("ServerSettings: fire spreads is %s\n",(app.GetGameHostOption(eGameHostOption_FireSpreads)>0)?"on":"off");
|
||||
app.DebugPrintf("ServerSettings: tnt explodes is %s\n",(app.GetGameHostOption(eGameHostOption_TNT)>0)?"on":"off");
|
||||
app.DebugPrintf("ServerSettings: spawn protection radius is %d\n", m_spawnProtectionRadius);
|
||||
app.DebugPrintf("\n");
|
||||
|
||||
// TODO 4J Stu - Init a load of settings based on data passed as params
|
||||
|
|
@ -657,7 +651,7 @@ bool MinecraftServer::initServer(int64_t seed, NetworkGameInitData *initData, DW
|
|||
setFlightAllowed(GetDedicatedServerBool(settings, L"allow-flight", true));
|
||||
|
||||
// 4J Stu - Enabling flight to stop it kicking us when we use it
|
||||
#if (defined _DEBUG_MENUS_ENABLED && defined _DEBUG)
|
||||
#ifdef _DEBUG_MENUS_ENABLED
|
||||
setFlightAllowed(true);
|
||||
#endif
|
||||
|
||||
|
|
@ -943,11 +937,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
|||
|
||||
storage = shared_ptr<McRegionLevelStorage>(new McRegionLevelStorage(newFormatSave, File(L"."), name, true));
|
||||
#else
|
||||
ConsoleSaveFileOriginal* pSave = new ConsoleSaveFileOriginal(L"");
|
||||
|
||||
pSave->ConvertToLocalPlatform();
|
||||
storage = std::make_shared<McRegionLevelStorage>(pSave, File(L"."), name, true);
|
||||
|
||||
storage = std::make_shared<McRegionLevelStorage>(new ConsoleSaveFileOriginal(L""), File(L"."), name, true);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
@ -1667,9 +1657,7 @@ Level *MinecraftServer::getCommandSenderWorld()
|
|||
|
||||
int MinecraftServer::getSpawnProtectionRadius()
|
||||
{
|
||||
// Client-host mode must never apply dedicated-server spawn protection settings.
|
||||
if (!ShouldUseDedicatedServerProperties()) return 0;
|
||||
return m_spawnProtectionRadius;
|
||||
return 16;
|
||||
}
|
||||
|
||||
bool MinecraftServer::isUnderSpawnProtection(Level *level, int x, int y, int z, shared_ptr<Player> player)
|
||||
|
|
@ -1715,345 +1703,330 @@ void MinecraftServer::setPlayerIdleTimeout(int playerIdleTimeout)
|
|||
extern int c0a, c0b, c1a, c1b, c1c, c2a, c2b;
|
||||
void MinecraftServer::run(int64_t seed, void *lpParameter)
|
||||
{
|
||||
NetworkGameInitData *initData = nullptr;
|
||||
DWORD initSettings = 0;
|
||||
bool findSeed = false;
|
||||
NetworkGameInitData *initData = nullptr;
|
||||
DWORD initSettings = 0;
|
||||
bool findSeed = false;
|
||||
if(lpParameter != nullptr)
|
||||
{
|
||||
initData = static_cast<NetworkGameInitData *>(lpParameter);
|
||||
initSettings = app.GetGameHostOption(eGameHostOption_All);
|
||||
findSeed = initData->findSeed;
|
||||
m_texturePackId = initData->texturePackId;
|
||||
}
|
||||
// try { // 4J - removed try/catch/finally
|
||||
bool didInit = false;
|
||||
{
|
||||
initData = static_cast<NetworkGameInitData *>(lpParameter);
|
||||
initSettings = app.GetGameHostOption(eGameHostOption_All);
|
||||
findSeed = initData->findSeed;
|
||||
m_texturePackId = initData->texturePackId;
|
||||
}
|
||||
// try { // 4J - removed try/catch/finally
|
||||
bool didInit = false;
|
||||
if (initServer(seed, initData, initSettings,findSeed))
|
||||
{
|
||||
didInit = true;
|
||||
ServerLevel *levelNormalDimension = levels[0];
|
||||
// 4J-PB - Set the Stronghold position in the leveldata if there isn't one in there
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
{
|
||||
didInit = true;
|
||||
ServerLevel *levelNormalDimension = levels[0];
|
||||
// 4J-PB - Set the Stronghold position in the leveldata if there isn't one in there
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
LevelData *pLevelData=levelNormalDimension->getLevelData();
|
||||
|
||||
if(pLevelData && pLevelData->getHasStronghold()==false)
|
||||
{
|
||||
{
|
||||
int x,z;
|
||||
if(app.GetTerrainFeaturePosition(eTerrainFeature_Stronghold,&x,&z))
|
||||
{
|
||||
pLevelData->setXStronghold(x);
|
||||
pLevelData->setZStronghold(z);
|
||||
pLevelData->setHasStronghold();
|
||||
}
|
||||
}
|
||||
{
|
||||
pLevelData->setXStronghold(x);
|
||||
pLevelData->setZStronghold(z);
|
||||
pLevelData->setHasStronghold();
|
||||
}
|
||||
}
|
||||
|
||||
int64_t lastTime = getCurrentTimeMillis();
|
||||
int64_t unprocessedTime = 0;
|
||||
while (running && !s_bServerHalted)
|
||||
{
|
||||
int64_t now = getCurrentTimeMillis();
|
||||
int64_t lastTime = getCurrentTimeMillis();
|
||||
int64_t unprocessedTime = 0;
|
||||
while (running && !s_bServerHalted)
|
||||
{
|
||||
int64_t now = getCurrentTimeMillis();
|
||||
|
||||
// 4J Stu - When we pause the server, we don't want to count that as time passed
|
||||
// 4J Stu - TU-1 hotifx - Remove this line. We want to make sure that we tick connections at the proper rate when paused
|
||||
// 4J Stu - When we pause the server, we don't want to count that as time passed
|
||||
// 4J Stu - TU-1 hotifx - Remove this line. We want to make sure that we tick connections at the proper rate when paused
|
||||
//Fix for #13191 - The host of a game can get a message informing them that the connection to the server has been lost
|
||||
//if(m_isServerPaused) lastTime = now;
|
||||
|
||||
int64_t passedTime = now - lastTime;
|
||||
if (passedTime > MS_PER_TICK * 40)
|
||||
{
|
||||
// logger.warning("Can't keep up! Did the system time change, or is the server overloaded?");
|
||||
passedTime = MS_PER_TICK * 40;
|
||||
}
|
||||
if (passedTime < 0)
|
||||
{
|
||||
// logger.warning("Time ran backwards! Did the system time change?");
|
||||
passedTime = 0;
|
||||
}
|
||||
unprocessedTime += passedTime;
|
||||
lastTime = now;
|
||||
int64_t passedTime = now - lastTime;
|
||||
if (passedTime > MS_PER_TICK * 40)
|
||||
{
|
||||
// logger.warning("Can't keep up! Did the system time change, or is the server overloaded?");
|
||||
passedTime = MS_PER_TICK * 40;
|
||||
}
|
||||
if (passedTime < 0)
|
||||
{
|
||||
// logger.warning("Time ran backwards! Did the system time change?");
|
||||
passedTime = 0;
|
||||
}
|
||||
unprocessedTime += passedTime;
|
||||
lastTime = now;
|
||||
|
||||
// 4J Added ability to pause the server
|
||||
// 4J Added ability to pause the server
|
||||
if( !m_isServerPaused )
|
||||
{
|
||||
bool didTick = false;
|
||||
if (levels[0]->allPlayersAreSleeping())
|
||||
{
|
||||
tick();
|
||||
unprocessedTime = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// int tickcount = 0;
|
||||
// int64_t beforeall = System::currentTimeMillis();
|
||||
while (unprocessedTime > MS_PER_TICK)
|
||||
{
|
||||
unprocessedTime -= MS_PER_TICK;
|
||||
chunkPacketManagement_PreTick();
|
||||
// int64_t before = System::currentTimeMillis();
|
||||
tick();
|
||||
// int64_t after = System::currentTimeMillis();
|
||||
// PIXReportCounter(L"Server time",(float)(after-before));
|
||||
{
|
||||
bool didTick = false;
|
||||
if (levels[0]->allPlayersAreSleeping())
|
||||
{
|
||||
tick();
|
||||
unprocessedTime = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// int tickcount = 0;
|
||||
// int64_t beforeall = System::currentTimeMillis();
|
||||
while (unprocessedTime > MS_PER_TICK)
|
||||
{
|
||||
unprocessedTime -= MS_PER_TICK;
|
||||
chunkPacketManagement_PreTick();
|
||||
// int64_t before = System::currentTimeMillis();
|
||||
tick();
|
||||
// int64_t after = System::currentTimeMillis();
|
||||
// PIXReportCounter(L"Server time",(float)(after-before));
|
||||
|
||||
chunkPacketManagement_PostTick();
|
||||
}
|
||||
// int64_t afterall = System::currentTimeMillis();
|
||||
// PIXReportCounter(L"Server time all",(float)(afterall-beforeall));
|
||||
// PIXReportCounter(L"Server ticks",(float)tickcount);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 4J Stu - TU1-hotfix
|
||||
chunkPacketManagement_PostTick();
|
||||
}
|
||||
// int64_t afterall = System::currentTimeMillis();
|
||||
// PIXReportCounter(L"Server time all",(float)(afterall-beforeall));
|
||||
// PIXReportCounter(L"Server ticks",(float)tickcount);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// 4J Stu - TU1-hotfix
|
||||
//Fix for #13191 - The host of a game can get a message informing them that the connection to the server has been lost
|
||||
// The connections should tick at the same frequency even when paused
|
||||
while (unprocessedTime > MS_PER_TICK)
|
||||
{
|
||||
unprocessedTime -= MS_PER_TICK;
|
||||
// Keep ticking the connections to stop them timing out
|
||||
connection->tick();
|
||||
}
|
||||
}
|
||||
// The connections should tick at the same frequency even when paused
|
||||
while (unprocessedTime > MS_PER_TICK)
|
||||
{
|
||||
unprocessedTime -= MS_PER_TICK;
|
||||
// Keep ticking the connections to stop them timing out
|
||||
connection->tick();
|
||||
}
|
||||
}
|
||||
if(MinecraftServer::setTimeAtEndOfTick)
|
||||
{
|
||||
MinecraftServer::setTimeAtEndOfTick = false;
|
||||
for (unsigned int i = 0; i < levels.length; i++)
|
||||
{
|
||||
// if (i == 0 || settings->getBoolean(L"allow-nether", true)) // 4J removed - we always have nether
|
||||
{
|
||||
ServerLevel *level = levels[i];
|
||||
{
|
||||
MinecraftServer::setTimeAtEndOfTick = false;
|
||||
for (unsigned int i = 0; i < levels.length; i++)
|
||||
{
|
||||
// if (i == 0 || settings->getBoolean(L"allow-nether", true)) // 4J removed - we always have nether
|
||||
{
|
||||
ServerLevel *level = levels[i];
|
||||
level->setGameTime( MinecraftServer::setTime );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(MinecraftServer::setTimeOfDayAtEndOfTick)
|
||||
{
|
||||
MinecraftServer::setTimeOfDayAtEndOfTick = false;
|
||||
for (unsigned int i = 0; i < levels.length; i++)
|
||||
{
|
||||
if (i == 0 || GetDedicatedServerBool(settings, L"allow-nether", true))
|
||||
{
|
||||
ServerLevel *level = levels[i];
|
||||
{
|
||||
MinecraftServer::setTimeOfDayAtEndOfTick = false;
|
||||
for (unsigned int i = 0; i < levels.length; i++)
|
||||
{
|
||||
if (i == 0 || GetDedicatedServerBool(settings, L"allow-nether", true))
|
||||
{
|
||||
ServerLevel *level = levels[i];
|
||||
level->setDayTime( MinecraftServer::setTimeOfDay );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Process delayed actions
|
||||
eXuiServerAction eAction;
|
||||
LPVOID param;
|
||||
// Process delayed actions
|
||||
eXuiServerAction eAction;
|
||||
LPVOID param;
|
||||
for(int i=0;i<XUSER_MAX_COUNT;i++)
|
||||
{
|
||||
eAction = app.GetXuiServerAction(i);
|
||||
param = app.GetXuiServerActionParam(i);
|
||||
{
|
||||
eAction = app.GetXuiServerAction(i);
|
||||
param = app.GetXuiServerActionParam(i);
|
||||
|
||||
switch(eAction)
|
||||
{
|
||||
case eXuiServerAction_AutoSaveGame:
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(MINECRAFT_SERVER_BUILD)
|
||||
{
|
||||
{
|
||||
case eXuiServerAction_AutoSaveGame:
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
PIXBeginNamedEvent(0, "Autosave");
|
||||
{
|
||||
PIXBeginNamedEvent(0,"Autosave");
|
||||
|
||||
// Get the frequency of the timer
|
||||
LARGE_INTEGER qwTicksPerSec, qwTime, qwNewTime, qwDeltaTime;
|
||||
float fElapsedTime = 0.0f;
|
||||
QueryPerformanceFrequency(&qwTicksPerSec);
|
||||
float fSecsPerTick = 1.0f / (float)qwTicksPerSec.QuadPart;
|
||||
// Get the frequency of the timer
|
||||
LARGE_INTEGER qwTicksPerSec, qwTime, qwNewTime, qwDeltaTime;
|
||||
float fElapsedTime = 0.0f;
|
||||
QueryPerformanceFrequency( &qwTicksPerSec );
|
||||
float fSecsPerTick = 1.0f / (float)qwTicksPerSec.QuadPart;
|
||||
|
||||
// Save the start time
|
||||
QueryPerformanceCounter(&qwTime);
|
||||
#endif
|
||||
// Save the start time
|
||||
QueryPerformanceCounter( &qwTime );
|
||||
|
||||
if (players != nullptr)
|
||||
{
|
||||
players->saveAll(nullptr);
|
||||
}
|
||||
if (players != nullptr)
|
||||
{
|
||||
players->saveAll(nullptr);
|
||||
}
|
||||
|
||||
for (unsigned int j = 0; j < levels.length; j++)
|
||||
{
|
||||
for (unsigned int j = 0; j < levels.length; j++)
|
||||
{
|
||||
if( s_bServerHalted ) break;
|
||||
// 4J Stu - Save the levels in reverse order so we don't overwrite the level.dat
|
||||
// with the data from the nethers leveldata.
|
||||
// Fix for #7418 - Functional: Gameplay: Saving after sleeping in a bed will place player at nighttime when restarting.
|
||||
ServerLevel *level = levels[levels.length - 1 - j];
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
PIXBeginNamedEvent(0, "Saving level %d", levels.length - 1 - j);
|
||||
#endif
|
||||
level->save(false, nullptr, true);
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
PIXEndNamedEvent();
|
||||
#endif
|
||||
}
|
||||
if (!s_bServerHalted)
|
||||
{
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
PIXBeginNamedEvent(0, "Saving game rules");
|
||||
#endif
|
||||
saveGameRules();
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
PIXEndNamedEvent();
|
||||
// 4J Stu - Save the levels in reverse order so we don't overwrite the level.dat
|
||||
// with the data from the nethers leveldata.
|
||||
// Fix for #7418 - Functional: Gameplay: Saving after sleeping in a bed will place player at nighttime when restarting.
|
||||
ServerLevel *level = levels[levels.length - 1 - j];
|
||||
PIXBeginNamedEvent(0, "Saving level %d",levels.length - 1 - j);
|
||||
level->save(false, nullptr, true);
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
if( !s_bServerHalted )
|
||||
{
|
||||
PIXBeginNamedEvent(0,"Saving game rules");
|
||||
saveGameRules();
|
||||
PIXEndNamedEvent();
|
||||
|
||||
PIXBeginNamedEvent(0, "Save to disc");
|
||||
#endif
|
||||
levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, true);
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
PIXEndNamedEvent();
|
||||
#endif
|
||||
}
|
||||
PIXBeginNamedEvent(0,"Save to disc");
|
||||
levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, true);
|
||||
PIXEndNamedEvent();
|
||||
}
|
||||
PIXEndNamedEvent();
|
||||
|
||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
||||
PIXEndNamedEvent();
|
||||
|
||||
QueryPerformanceCounter(&qwNewTime);
|
||||
qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart;
|
||||
fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
|
||||
app.DebugPrintf("Autosave: Elapsed time %f\n", fElapsedTime);
|
||||
QueryPerformanceCounter( &qwNewTime );
|
||||
qwDeltaTime.QuadPart = qwNewTime.QuadPart - qwTime.QuadPart;
|
||||
fElapsedTime = fSecsPerTick * ((FLOAT)(qwDeltaTime.QuadPart));
|
||||
app.DebugPrintf("Autosave: Elapsed time %f\n", fElapsedTime);
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
case eXuiServerAction_SaveGame:
|
||||
app.EnterSaveNotificationSection();
|
||||
if (players != nullptr)
|
||||
{
|
||||
players->saveAll(Minecraft::GetInstance()->progressRenderer);
|
||||
}
|
||||
case eXuiServerAction_SaveGame:
|
||||
app.EnterSaveNotificationSection();
|
||||
if (players != nullptr)
|
||||
{
|
||||
players->saveAll(Minecraft::GetInstance()->progressRenderer);
|
||||
}
|
||||
|
||||
players->broadcastAll(std::make_shared<UpdateProgressPacket>(20));
|
||||
players->broadcastAll(std::make_shared<UpdateProgressPacket>(20));
|
||||
|
||||
for (unsigned int j = 0; j < levels.length; j++)
|
||||
{
|
||||
for (unsigned int j = 0; j < levels.length; j++)
|
||||
{
|
||||
if( s_bServerHalted ) break;
|
||||
// 4J Stu - Save the levels in reverse order so we don't overwrite the level.dat
|
||||
// with the data from the nethers leveldata.
|
||||
// Fix for #7418 - Functional: Gameplay: Saving after sleeping in a bed will place player at nighttime when restarting.
|
||||
ServerLevel *level = levels[levels.length - 1 - j];
|
||||
// 4J Stu - Save the levels in reverse order so we don't overwrite the level.dat
|
||||
// with the data from the nethers leveldata.
|
||||
// Fix for #7418 - Functional: Gameplay: Saving after sleeping in a bed will place player at nighttime when restarting.
|
||||
ServerLevel *level = levels[levels.length - 1 - j];
|
||||
level->save(true, Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame));
|
||||
|
||||
players->broadcastAll(std::make_shared<UpdateProgressPacket>(33 + (j * 33)));
|
||||
}
|
||||
players->broadcastAll(std::make_shared<UpdateProgressPacket>(33 + (j * 33)));
|
||||
}
|
||||
if( !s_bServerHalted )
|
||||
{
|
||||
saveGameRules();
|
||||
{
|
||||
saveGameRules();
|
||||
|
||||
levels[0]->saveToDisc(Minecraft::GetInstance()->progressRenderer, (eAction==eXuiServerAction_AutoSaveGame));
|
||||
}
|
||||
app.LeaveSaveNotificationSection();
|
||||
break;
|
||||
case eXuiServerAction_DropItem:
|
||||
// Find the player, and drop the id at their feet
|
||||
{
|
||||
shared_ptr<ServerPlayer> player = players->players.at(0);
|
||||
}
|
||||
app.LeaveSaveNotificationSection();
|
||||
break;
|
||||
case eXuiServerAction_DropItem:
|
||||
// Find the player, and drop the id at their feet
|
||||
{
|
||||
shared_ptr<ServerPlayer> player = players->players.at(0);
|
||||
size_t id = (size_t) param;
|
||||
player->drop(std::make_shared<ItemInstance>(id, 1, 0));
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_SpawnMob:
|
||||
{
|
||||
shared_ptr<ServerPlayer> player = players->players.at(0);
|
||||
eINSTANCEOF factory = static_cast<eINSTANCEOF>((size_t)param);
|
||||
player->drop(std::make_shared<ItemInstance>(id, 1, 0));
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_SpawnMob:
|
||||
{
|
||||
shared_ptr<ServerPlayer> player = players->players.at(0);
|
||||
eINSTANCEOF factory = static_cast<eINSTANCEOF>((size_t)param);
|
||||
shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(EntityIO::newByEnumType(factory,player->level ));
|
||||
mob->moveTo(player->x+1, player->y, player->z+1, player->level->random->nextFloat() * 360, 0);
|
||||
mob->setDespawnProtected(); // 4J added, default to being protected against despawning (has to be done after initial position is set)
|
||||
player->level->addEntity(mob);
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_PauseServer:
|
||||
player->level->addEntity(mob);
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_PauseServer:
|
||||
m_isServerPaused = ( (size_t) param == TRUE );
|
||||
if( m_isServerPaused )
|
||||
{
|
||||
m_serverPausedEvent->Set();
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_ToggleRain:
|
||||
{
|
||||
bool isRaining = levels[0]->getLevelData()->isRaining();
|
||||
levels[0]->getLevelData()->setRaining(!isRaining);
|
||||
levels[0]->getLevelData()->setRainTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2);
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_ToggleThunder:
|
||||
{
|
||||
bool isThundering = levels[0]->getLevelData()->isThundering();
|
||||
levels[0]->getLevelData()->setThundering(!isThundering);
|
||||
levels[0]->getLevelData()->setThunderTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2);
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_ServerSettingChanged_Gamertags:
|
||||
players->broadcastAll(std::make_shared<ServerSettingsChangedPacket>(ServerSettingsChangedPacket::HOST_OPTIONS, app.GetGameHostOption(eGameHostOption_Gamertags)));
|
||||
break;
|
||||
case eXuiServerAction_ServerSettingChanged_BedrockFog:
|
||||
players->broadcastAll(std::make_shared<ServerSettingsChangedPacket>(ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, app.GetGameHostOption(eGameHostOption_All)));
|
||||
break;
|
||||
{
|
||||
m_serverPausedEvent->Set();
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_ToggleRain:
|
||||
{
|
||||
bool isRaining = levels[0]->getLevelData()->isRaining();
|
||||
levels[0]->getLevelData()->setRaining(!isRaining);
|
||||
levels[0]->getLevelData()->setRainTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2);
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_ToggleThunder:
|
||||
{
|
||||
bool isThundering = levels[0]->getLevelData()->isThundering();
|
||||
levels[0]->getLevelData()->setThundering(!isThundering);
|
||||
levels[0]->getLevelData()->setThunderTime(levels[0]->random->nextInt(Level::TICKS_PER_DAY * 7) + Level::TICKS_PER_DAY / 2);
|
||||
}
|
||||
break;
|
||||
case eXuiServerAction_ServerSettingChanged_Gamertags:
|
||||
players->broadcastAll(std::make_shared<ServerSettingsChangedPacket>(ServerSettingsChangedPacket::HOST_OPTIONS, app.GetGameHostOption(eGameHostOption_Gamertags)));
|
||||
break;
|
||||
case eXuiServerAction_ServerSettingChanged_BedrockFog:
|
||||
players->broadcastAll(std::make_shared<ServerSettingsChangedPacket>(ServerSettingsChangedPacket::HOST_IN_GAME_SETTINGS, app.GetGameHostOption(eGameHostOption_All)));
|
||||
break;
|
||||
|
||||
case eXuiServerAction_ServerSettingChanged_Difficulty:
|
||||
players->broadcastAll(std::make_shared<ServerSettingsChangedPacket>(ServerSettingsChangedPacket::HOST_DIFFICULTY, Minecraft::GetInstance()->options->difficulty));
|
||||
break;
|
||||
case eXuiServerAction_ExportSchematic:
|
||||
case eXuiServerAction_ServerSettingChanged_Difficulty:
|
||||
players->broadcastAll(std::make_shared<ServerSettingsChangedPacket>(ServerSettingsChangedPacket::HOST_DIFFICULTY, Minecraft::GetInstance()->options->difficulty));
|
||||
break;
|
||||
case eXuiServerAction_ExportSchematic:
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
app.EnterSaveNotificationSection();
|
||||
app.EnterSaveNotificationSection();
|
||||
|
||||
//players->broadcastAll( shared_ptr<UpdateProgressPacket>( new UpdateProgressPacket(20) ) );
|
||||
|
||||
if( !s_bServerHalted )
|
||||
{
|
||||
ConsoleSchematicFile::XboxSchematicInitParam *initData = static_cast<ConsoleSchematicFile::XboxSchematicInitParam *>(param);
|
||||
{
|
||||
ConsoleSchematicFile::XboxSchematicInitParam *initData = static_cast<ConsoleSchematicFile::XboxSchematicInitParam *>(param);
|
||||
#ifdef _XBOX
|
||||
File targetFileDir(File::pathRoot + File::pathSeparator + L"Schematics");
|
||||
File targetFileDir(File::pathRoot + File::pathSeparator + L"Schematics");
|
||||
#else
|
||||
File targetFileDir(L"Schematics");
|
||||
File targetFileDir(L"Schematics");
|
||||
#endif
|
||||
if(!targetFileDir.exists()) targetFileDir.mkdir();
|
||||
|
||||
wchar_t filename[128];
|
||||
wchar_t filename[128];
|
||||
swprintf(filename,128,L"%ls%dx%dx%d.sch",initData->name,(initData->endX - initData->startX + 1), (initData->endY - initData->startY + 1), (initData->endZ - initData->startZ + 1));
|
||||
|
||||
File dataFile = File( targetFileDir, wstring(filename) );
|
||||
if(dataFile.exists()) dataFile._delete();
|
||||
FileOutputStream fos = FileOutputStream(dataFile);
|
||||
DataOutputStream dos = DataOutputStream(&fos);
|
||||
ConsoleSchematicFile::generateSchematicFile(&dos, levels[0], initData->startX, initData->startY, initData->startZ, initData->endX, initData->endY, initData->endZ, initData->bSaveMobs, initData->compressionType);
|
||||
dos.close();
|
||||
FileOutputStream fos = FileOutputStream(dataFile);
|
||||
DataOutputStream dos = DataOutputStream(&fos);
|
||||
ConsoleSchematicFile::generateSchematicFile(&dos, levels[0], initData->startX, initData->startY, initData->startZ, initData->endX, initData->endY, initData->endZ, initData->bSaveMobs, initData->compressionType);
|
||||
dos.close();
|
||||
|
||||
delete initData;
|
||||
}
|
||||
app.LeaveSaveNotificationSection();
|
||||
delete initData;
|
||||
}
|
||||
app.LeaveSaveNotificationSection();
|
||||
#endif
|
||||
break;
|
||||
case eXuiServerAction_SetCameraLocation:
|
||||
break;
|
||||
case eXuiServerAction_SetCameraLocation:
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
{
|
||||
DebugSetCameraPosition *pos = static_cast<DebugSetCameraPosition *>(param);
|
||||
{
|
||||
DebugSetCameraPosition *pos = static_cast<DebugSetCameraPosition *>(param);
|
||||
|
||||
app.DebugPrintf( "DEBUG: Player=%i\n", pos->player );
|
||||
app.DebugPrintf( "DEBUG: Teleporting to pos=(%f.2, %f.2, %f.2), looking at=(%f.2,%f.2)\n",
|
||||
pos->m_camX, pos->m_camY, pos->m_camZ,
|
||||
pos->m_camX, pos->m_camY, pos->m_camZ,
|
||||
pos->m_yRot, pos->m_elev
|
||||
);
|
||||
|
||||
shared_ptr<ServerPlayer> player = players->players.at(pos->player);
|
||||
shared_ptr<ServerPlayer> player = players->players.at(pos->player);
|
||||
player->debug_setPosition( pos->m_camX, pos->m_camY, pos->m_camZ,
|
||||
pos->m_yRot, pos->m_elev );
|
||||
|
||||
// Doesn't work
|
||||
// Doesn't work
|
||||
//player->setYHeadRot(pos->m_yRot);
|
||||
//player->absMoveTo(pos->m_camX, pos->m_camY, pos->m_camZ, pos->m_yRot, pos->m_elev);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
app.SetXuiServerAction(i,eXuiServerAction_Idle);
|
||||
}
|
||||
}
|
||||
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
Sleep(1);
|
||||
}
|
||||
}
|
||||
//else
|
||||
//{
|
||||
//{
|
||||
// while (running)
|
||||
// {
|
||||
// {
|
||||
// handleConsoleInputs();
|
||||
// Sleep(10);
|
||||
// Sleep(10);
|
||||
// }
|
||||
//}
|
||||
#if 0
|
||||
|
|
@ -2080,9 +2053,9 @@ void MinecraftServer::run(int64_t seed, void *lpParameter)
|
|||
}
|
||||
#endif
|
||||
|
||||
// 4J Stu - Stop the server when the loops complete, as the finally would do
|
||||
stopServer(didInit);
|
||||
stopped = true;
|
||||
// 4J Stu - Stop the server when the loops complete, as the finally would do
|
||||
stopServer(didInit);
|
||||
stopped = true;
|
||||
}
|
||||
|
||||
void MinecraftServer::broadcastStartSavingPacket()
|
||||
|
|
@ -2390,9 +2363,6 @@ bool MinecraftServer::chunkPacketManagement_CanSendTo(INetworkPlayer *player)
|
|||
{
|
||||
if( player == nullptr ) return false;
|
||||
|
||||
#ifdef MINECRAFT_SERVER_BUILD
|
||||
return true;
|
||||
#else
|
||||
int time = GetTickCount();
|
||||
DWORD currentPlayerCount = g_NetworkManager.GetPlayerCount();
|
||||
if( currentPlayerCount == 0 ) return false;
|
||||
|
|
@ -2404,7 +2374,6 @@ bool MinecraftServer::chunkPacketManagement_CanSendTo(INetworkPlayer *player)
|
|||
}
|
||||
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
void MinecraftServer::chunkPacketManagement_DidSendTo(INetworkPlayer *player)
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ typedef struct _NetworkGameInitData
|
|||
LevelGenerationOptions *levelGen;
|
||||
DWORD texturePackId;
|
||||
bool findSeed;
|
||||
bool dedicatedNoLocalHostPlayer;
|
||||
unsigned int xzSize;
|
||||
unsigned char hellScale;
|
||||
ESavePlatform savePlatform;
|
||||
|
|
@ -58,7 +57,6 @@ typedef struct _NetworkGameInitData
|
|||
levelGen = nullptr;
|
||||
texturePackId = 0;
|
||||
findSeed = false;
|
||||
dedicatedNoLocalHostPlayer = false;
|
||||
xzSize = LEVEL_LEGACY_WIDTH;
|
||||
hellScale = HELL_LEVEL_LEGACY_SCALE;
|
||||
savePlatform = SAVE_FILE_PLATFORM_LOCAL;
|
||||
|
|
@ -121,7 +119,6 @@ public:
|
|||
int maxBuildHeight;
|
||||
int playerIdleTimeout;
|
||||
bool forceGameType;
|
||||
int m_spawnProtectionRadius;
|
||||
|
||||
private:
|
||||
// 4J Added
|
||||
|
|
|
|||
|
|
@ -12,7 +12,6 @@ using namespace std;
|
|||
|
||||
class MultiPlayerLevel : public Level
|
||||
{
|
||||
friend class ClientConnection;
|
||||
private:
|
||||
static const int TICKS_BEFORE_RESET = 20 * 4;
|
||||
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ void Options::init()
|
|||
particles = 0;
|
||||
fov = 0;
|
||||
gamma = 0;
|
||||
advancedTooltips = false;
|
||||
}
|
||||
|
||||
Options::Options(Minecraft *minecraft, File workingDirectory)
|
||||
|
|
@ -452,9 +451,8 @@ void Options::load()
|
|||
if (cmds[0] == L"fancyGraphics") fancyGraphics = cmds[1]==L"true";
|
||||
if (cmds[0] == L"ao") ambientOcclusion = cmds[1]==L"true";
|
||||
if (cmds[0] == L"clouds") renderClouds = cmds[1]==L"true";
|
||||
if (cmds[0] == L"advancedTooltips") advancedTooltips = cmds[1]==L"false";
|
||||
if (cmds[0] == L"skin") skin = cmds[1];
|
||||
if (cmds[0] == L"lastServer") lastMpIp = cmds[1];
|
||||
if (cmds[0] == L"skin") skin = cmds[1];
|
||||
if (cmds[0] == L"lastServer") lastMpIp = cmds[1];
|
||||
|
||||
for (int i = 0; i < keyMappings_length; i++)
|
||||
{
|
||||
|
|
@ -510,8 +508,7 @@ void Options::save()
|
|||
dos.writeChars(L"fancyGraphics:" + wstring(fancyGraphics ? L"true" : L"false"));
|
||||
dos.writeChars(ambientOcclusion ? L"ao:true" : L"ao:false");
|
||||
dos.writeChars(renderClouds ? L"clouds:true" : L"clouds:false");
|
||||
dos.writeChars(advancedTooltips ? L"advancedTooltips:true" : L"advancedTooltips:false");
|
||||
dos.writeChars(L"skin:" + skin);
|
||||
dos.writeChars(L"skin:" + skin);
|
||||
dos.writeChars(L"lastServer:" + lastMpIp);
|
||||
|
||||
for (int i = 0; i < keyMappings_length; i++)
|
||||
|
|
|
|||
|
|
@ -110,7 +110,6 @@ public:
|
|||
int particles; // 0 is all, 1 is decreased and 2 is minimal
|
||||
float fov;
|
||||
float gamma;
|
||||
bool advancedTooltips;
|
||||
|
||||
void init(); // 4J added
|
||||
Options(Minecraft *minecraft, File workingDirectory);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,72 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|PS3">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>PS3</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|PS3">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>PS3</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\HookSample.cpp" />
|
||||
<ClCompile Include="Main.cpp" />
|
||||
<ClCompile Include="Wait.cpp" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{F749F5D0-B972-4E99-8B4B-2B865D4A8BC9}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>GCC</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|PS3'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>GCC</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">
|
||||
<OutDir>$(ProjectDir)$(Platform)_$(Configuration)_VS2010\</OutDir>
|
||||
<IntDir>$(Platform)_$(Configuration)_VS2010\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">
|
||||
<OutDir>$(ProjectDir)$(Platform)_$(Configuration)_VS2010\</OutDir>
|
||||
<IntDir>$(Platform)_$(Configuration)_VS2010\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|PS3'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;__CELL_ASSERT__;%(PreprocessorDefinitions);;HEAPINSPECTOR_PS3=1</PreprocessorDefinitions>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>"$(SCE_PS3_ROOT)\target\ppu\lib\libm.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libio_stub.a";"..\..\..\Server\PS3\Debug\libHeapInspectorServer.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libpthread.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libnet_stub.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a";%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>-Wl,--wrap=malloc,--wrap=free,--wrap=calloc,--wrap=memalign,--wrap=realloc,--wrap=reallocalign,--wrap=_malloc_init %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|PS3'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);;HEAPINSPECTOR_PS3=1</PreprocessorDefinitions>
|
||||
<OptimizationLevel>Level2</OptimizationLevel>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>"..\..\..\Server\PS3\Release\libHeapInspectorServer.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libpthread.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libnet_stub.a";"$(SCE_PS3_ROOT)\target\ppu\lib\libsysmodule_stub.a";%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalOptions>-Wl,--wrap=malloc,--wrap=free,--wrap=calloc,--wrap=memalign,--wrap=realloc,--wrap=reallocalign,--wrap=_malloc_init %(AdditionalOptions)</AdditionalOptions>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Condition="'$(ConfigurationType)' == 'Makefile' and Exists('$(VCTargetsPath)\Platforms\$(Platform)\SCE.Makefile.$(Platform).targets')" Project="$(VCTargetsPath)\Platforms\$(Platform)\SCE.Makefile.$(Platform).targets" />
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue