mirror of
https://github.com/celisej567/mcpe.git
synced 2026-01-04 14:09:47 +03:00
CMake: Refactor build system
This commit is contained in:
37
CMakeLists.txt
Normal file
37
CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
|
||||
# Use actual name as some IDEs can show them
|
||||
project(ReMinecraftPE)
|
||||
|
||||
set(PLATFORM sdl2 CACHE STRING "Active platform")
|
||||
set_property(CACHE PLATFORM PROPERTY STRINGS android macos sdl2 windows xenon)
|
||||
|
||||
message(STATUS "Current platform: ${PLATFORM}")
|
||||
if (PLATFORM STREQUAL android)
|
||||
message(STATUS "Android library will be only built. For apk use gradle")
|
||||
# Set -fPIC
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
|
||||
add_subdirectory(platforms/android/project/app/src/main/cpp)
|
||||
elseif (PLATFORM STREQUAL macos)
|
||||
message(FATAL_ERROR "${PLATFORM} currently can't be built using cmake. Use XCode instead")
|
||||
elseif (PLATFORM STREQUAL sdl2)
|
||||
set(USE_SDL 1)
|
||||
add_compile_definitions(USE_SDL USE_OPENAL HANDLE_CHARS_SEPARATELY)
|
||||
add_subdirectory(platforms/sdl)
|
||||
elseif (PLATFORM STREQUAL windows
|
||||
OR PLATFORM STREQUAL xenon)
|
||||
message(FATAL_ERROR "${PLATFORM} currently can't be built using cmake. Use Visual Studio instead")
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown platform!")
|
||||
endif()
|
||||
|
||||
# Sound Data
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/sound_data/sounds.h")
|
||||
if(NOT DEFINED ENV{CI})
|
||||
message(WARNING "Missing sound data! Did you run tools/grabsounds.py?")
|
||||
endif()
|
||||
target_compile_definitions(reminecraftpe-core PRIVATE MISSING_SOUND_DATA)
|
||||
endif()
|
||||
|
||||
# Include source code tree
|
||||
add_subdirectory(source)
|
||||
@@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.16.0)
|
||||
|
||||
# Declares and names the project.
|
||||
|
||||
project("reminecraftpe")
|
||||
project("reminecraftpe-android")
|
||||
|
||||
# Add the ANDROID flag. Used by our core
|
||||
set(ANDROID)
|
||||
@@ -32,6 +32,7 @@ add_library( # Sets the name of the library.
|
||||
${MC_ROOT}/platforms/android/AppPlatform_android.cpp
|
||||
${MC_ROOT}/platforms/android/main.cpp
|
||||
${MC_ROOT}/thirdparty/stb_image_impl.c)
|
||||
target_include_directories(reminecraftpe PUBLIC ${MC_ROOT} ${MC_ROOT}/source ${MC_ROOT}/thirdparty/raknet)
|
||||
|
||||
# Check for the presence of some optional asset based features.
|
||||
if(NOT EXISTS "${MC_ROOT}/game/assets/gui/background/panorama_0.png")
|
||||
@@ -51,7 +52,6 @@ if(NOT EXISTS "${MC_ROOT}/game/assets/misc/foliagecolor.png")
|
||||
endif()
|
||||
|
||||
# Add the core as part of the library.
|
||||
add_subdirectory(${MC_ROOT}/source source)
|
||||
target_link_libraries(reminecraftpe reminecraftpe-core)
|
||||
|
||||
# Searches for a specified prebuilt library and stores the path as a
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
project(reminecraftpe-openal)
|
||||
|
||||
# Build
|
||||
add_library(reminecraftpe-openal STATIC
|
||||
SoundSystemAL.cpp
|
||||
SoundSystemAL.cpp SoundSystemAL.hpp
|
||||
)
|
||||
|
||||
# Core
|
||||
target_link_libraries(reminecraftpe-openal PUBLIC reminecraftpe-core)
|
||||
target_link_libraries(reminecraftpe-openal PUBLIC reminecraftpe-client)
|
||||
|
||||
# OpenAL
|
||||
if(EMSCRIPTEN)
|
||||
@@ -19,3 +15,4 @@ endif()
|
||||
|
||||
# Headers
|
||||
target_include_directories(reminecraftpe-openal PUBLIC .)
|
||||
target_include_directories(reminecraftpe-openal PRIVATE ../../source)
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
project(reminecraftpe-sdl)
|
||||
|
||||
# SDL Build
|
||||
add_compile_definitions(USE_SDL USE_OPENAL HANDLE_CHARS_SEPARATELY)
|
||||
set(USE_SDL 1)
|
||||
|
||||
# WASM
|
||||
if(EMSCRIPTEN)
|
||||
@@ -16,7 +11,7 @@ if(EMSCRIPTEN)
|
||||
endif()
|
||||
|
||||
# Clang
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wno-inconsistent-missing-override -Wno-enum-compare-switch -Wno-register)
|
||||
endif()
|
||||
|
||||
@@ -36,22 +31,22 @@ endif()
|
||||
# Build
|
||||
set(SOURCES
|
||||
main.cpp
|
||||
base/AppPlatform_sdl_base.cpp
|
||||
base/AppPlatform_sdl_base.cpp base/AppPlatform_sdl_base.hpp
|
||||
)
|
||||
if(EMSCRIPTEN)
|
||||
list(APPEND SOURCES emscripten/AppPlatform_sdl.cpp)
|
||||
list(APPEND SOURCES emscripten/AppPlatform_sdl.cpp emscripten/AppPlatform_sdl.hpp)
|
||||
else()
|
||||
list(APPEND SOURCES desktop/AppPlatform_sdl.cpp)
|
||||
list(APPEND SOURCES desktop/AppPlatform_sdl.cpp desktop/AppPlatform_sdl.hpp)
|
||||
endif()
|
||||
add_executable(reminecraftpe ${SOURCES})
|
||||
|
||||
# Core
|
||||
add_subdirectory(../../source source)
|
||||
target_link_libraries(reminecraftpe reminecraftpe-core)
|
||||
|
||||
# OpenAL
|
||||
add_subdirectory(../openal openal)
|
||||
target_link_libraries(reminecraftpe reminecraftpe-openal)
|
||||
|
||||
target_link_libraries(reminecraftpe
|
||||
reminecraftpe-core
|
||||
reminecraftpe-openal
|
||||
)
|
||||
|
||||
# LibPNG (If Needed)
|
||||
if(NOT EMSCRIPTEN)
|
||||
@@ -60,6 +55,17 @@ if(NOT EMSCRIPTEN)
|
||||
endif()
|
||||
|
||||
# SDL
|
||||
add_library(SDL INTERFACE)
|
||||
if(EMSCRIPTEN)
|
||||
set(SDL_FLAG -sUSE_SDL=2)
|
||||
target_compile_options(SDL INTERFACE "${SDL_FLAG}")
|
||||
target_link_options(SDL INTERFACE "${SDL_FLAG}")
|
||||
else()
|
||||
find_package(SDL2 REQUIRED)
|
||||
target_link_libraries(SDL INTERFACE SDL2::SDL2)
|
||||
endif()
|
||||
target_link_libraries(reminecraftpe SDL)
|
||||
|
||||
if(TARGET SDL2::SDL2main)
|
||||
target_link_libraries(reminecraftpe SDL2::SDL2main)
|
||||
endif()
|
||||
|
||||
@@ -16,6 +16,8 @@ typedef AppPlatform_sdl UsedAppPlatform;
|
||||
#include "client/app/NinecraftApp.hpp"
|
||||
#include "client/player/input/Multitouch.hpp"
|
||||
|
||||
#include "compat/KeyCodes.hpp"
|
||||
|
||||
static float g_fPointToPixelScale = 1.0f;
|
||||
|
||||
UsedAppPlatform *g_pAppPlatform;
|
||||
|
||||
@@ -1,301 +1,22 @@
|
||||
cmake_minimum_required(VERSION 3.16.0)
|
||||
project(reminecraftpe-core)
|
||||
|
||||
if(NOT ANDROID)
|
||||
set(INCLUDES . .. ../thirdparty/zlib)
|
||||
else()
|
||||
set(INCLUDES . ..)
|
||||
endif()
|
||||
include_directories(. ..)
|
||||
|
||||
# Build
|
||||
add_library(reminecraftpe-core STATIC
|
||||
common/Random.cpp
|
||||
common/Utils.cpp
|
||||
common/Matrix.cpp
|
||||
common/Mth.cpp
|
||||
common/Timer.cpp
|
||||
common/CThread.cpp
|
||||
common/Util.cpp
|
||||
common/Logger.cpp
|
||||
common/SmoothFloat.cpp
|
||||
client/app/App.cpp
|
||||
client/app/AppPlatform.cpp
|
||||
client/app/Minecraft.cpp
|
||||
client/app/NinecraftApp.cpp
|
||||
client/options/Options.cpp
|
||||
client/renderer/LevelRenderer.cpp
|
||||
client/renderer/Culler.cpp
|
||||
client/renderer/entity/HumanoidMobRenderer.cpp
|
||||
client/renderer/entity/TntRenderer.cpp
|
||||
client/renderer/entity/MobRenderer.cpp
|
||||
client/renderer/entity/FallingTileRenderer.cpp
|
||||
client/renderer/entity/EntityRenderer.cpp
|
||||
client/renderer/entity/ItemRenderer.cpp
|
||||
client/renderer/entity/TripodCameraRenderer.cpp
|
||||
client/renderer/entity/ItemSpriteRenderer.cpp
|
||||
client/renderer/entity/EntityRenderDispatcher.cpp
|
||||
client/renderer/RenderList.cpp
|
||||
client/renderer/Chunk.cpp
|
||||
client/renderer/RenderChunk.cpp
|
||||
client/renderer/Frustum.cpp
|
||||
client/renderer/ItemInHandRenderer.cpp
|
||||
client/renderer/DynamicTexture.cpp
|
||||
client/renderer/GameRenderer.cpp
|
||||
client/renderer/Textures.cpp
|
||||
client/renderer/FrustumCuller.cpp
|
||||
client/renderer/LightUpdate.cpp
|
||||
client/renderer/Font.cpp
|
||||
client/renderer/WaterSideTexture.cpp
|
||||
client/renderer/Tesselator.cpp
|
||||
client/renderer/TileRenderer.cpp
|
||||
client/renderer/LightLayer.cpp
|
||||
client/renderer/WaterTexture.cpp
|
||||
client/renderer/PatchManager.cpp
|
||||
client/renderer/LavaTexture.cpp
|
||||
client/renderer/LavaSideTexture.cpp
|
||||
client/renderer/FireTexture.cpp
|
||||
client/renderer/FoliageColor.cpp
|
||||
client/renderer/GrassColor.cpp
|
||||
client/sound/SoundData.cpp
|
||||
client/sound/SoundSystem.cpp
|
||||
client/sound/SoundRepository.cpp
|
||||
client/sound/SoundEngine.cpp
|
||||
client/gui/Screen.cpp
|
||||
client/gui/screens/OptionsScreen.cpp
|
||||
client/gui/screens/StartMenuScreen.cpp
|
||||
client/gui/screens/CreateWorldScreen.cpp
|
||||
client/gui/screens/DirectConnectScreen.cpp
|
||||
client/gui/screens/SelectWorldScreen.cpp
|
||||
client/gui/screens/SavingWorldScreen.cpp
|
||||
client/gui/screens/InvalidLicenseScreen.cpp
|
||||
client/gui/screens/ConfirmScreen.cpp
|
||||
client/gui/screens/DeleteWorldScreen.cpp
|
||||
client/gui/screens/DeathScreen.cpp
|
||||
client/gui/screens/ChatScreen.cpp
|
||||
client/gui/screens/RenameMPLevelScreen.cpp
|
||||
client/gui/screens/ProgressScreen.cpp
|
||||
client/gui/screens/JoinGameScreen.cpp
|
||||
client/gui/screens/IngameBlockSelectionScreen.cpp
|
||||
client/gui/screens/PauseScreen.cpp
|
||||
client/gui/screens/DeathScreen.cpp
|
||||
client/gui/components/ScrolledSelectionList.cpp
|
||||
client/gui/components/AvailableGamesList.cpp
|
||||
client/gui/components/RolledSelectionList.cpp
|
||||
client/gui/components/Button.cpp
|
||||
client/gui/components/TextInputBox.cpp
|
||||
client/gui/components/SmallButton.cpp
|
||||
client/gui/components/WorldSelectionList.cpp
|
||||
client/gui/components/OptionList.cpp
|
||||
client/gui/Gui.cpp
|
||||
client/gui/GuiComponent.cpp
|
||||
client/model/PolygonQuad.cpp
|
||||
client/model/Model.cpp
|
||||
client/model/HumanoidModel.cpp
|
||||
client/model/PigModel.cpp
|
||||
client/model/Cube.cpp
|
||||
client/player/input/ControllerTurnInput.cpp
|
||||
client/player/input/Controller.cpp
|
||||
client/player/input/Mouse.cpp
|
||||
client/player/input/Keyboard.cpp
|
||||
client/player/input/MouseTurnInput.cpp
|
||||
client/player/input/KeyboardInput.cpp
|
||||
client/player/input/ITurnInput.cpp
|
||||
client/player/input/IBuildInput.cpp
|
||||
client/player/input/IncludeExcludeArea.cpp
|
||||
client/player/input/MouseHandler.cpp
|
||||
client/player/input/PolygonArea.cpp
|
||||
client/player/input/RectangleArea.cpp
|
||||
client/player/input/MouseDevice.cpp
|
||||
client/player/input/Multitouch.cpp
|
||||
client/player/input/CustomInputHolder.cpp
|
||||
client/player/input/IInputHolder.cpp
|
||||
client/player/input/IMoveInput.cpp
|
||||
client/player/input/ITouchScreenModel.cpp
|
||||
client/player/input/TouchAreaModel.cpp
|
||||
client/player/input/TouchInputHolder.cpp
|
||||
client/player/input/TouchscreenInput_TestFps.cpp
|
||||
client/player/input/UnifiedTurnBuild.cpp
|
||||
client/network/ClientSideNetworkHandler.cpp
|
||||
network/packets/UpdateBlockPacket.cpp
|
||||
network/packets/RequestChunkPacket.cpp
|
||||
network/packets/PlayerEquipmentPacket.cpp
|
||||
network/packets/ChunkDataPacket.cpp
|
||||
network/packets/LevelDataPacket.cpp
|
||||
network/packets/PlaceBlockPacket.cpp
|
||||
network/packets/LoginPacket.cpp
|
||||
network/packets/StartGamePacket.cpp
|
||||
network/packets/RemoveEntityPacket.cpp
|
||||
network/packets/AddPlayerPacket.cpp
|
||||
network/packets/RemoveBlockPacket.cpp
|
||||
network/packets/MovePlayerPacket.cpp
|
||||
network/packets/MessagePacket.cpp
|
||||
network/ServerSideNetworkHandler.cpp
|
||||
network/RakNetInstance.cpp
|
||||
network/MinecraftPackets.cpp
|
||||
network/NetEventCallback.cpp
|
||||
world/level/levelgen/synth/Synth.cpp
|
||||
world/level/levelgen/synth/ImprovedNoise.cpp
|
||||
world/level/levelgen/synth/PerlinNoise.cpp
|
||||
world/phys/HitResult.cpp
|
||||
world/phys/Vec3.cpp
|
||||
world/phys/AABB.cpp
|
||||
world/gamemode/SurvivalMode.cpp
|
||||
world/gamemode/GameMode.cpp
|
||||
world/gamemode/CreativeMode.cpp
|
||||
world/entity/Mob.cpp
|
||||
world/entity/LocalPlayer.cpp
|
||||
world/entity/Player.cpp
|
||||
world/entity/PrimedTnt.cpp
|
||||
world/entity/Entity.cpp
|
||||
world/entity/FallingTile.cpp
|
||||
world/entity/TripodCamera.cpp
|
||||
world/entity/Pig.cpp
|
||||
world/entity/ItemEntity.cpp
|
||||
world/level/Dimension.cpp
|
||||
world/level/Material.cpp
|
||||
world/level/LevelListener.cpp
|
||||
world/level/TickNextTickData.cpp
|
||||
world/level/Explosion.cpp
|
||||
world/level/storage/LevelStorageSource.cpp
|
||||
world/level/storage/MemoryLevelStorageSource.cpp
|
||||
world/level/storage/LevelData.cpp
|
||||
world/level/storage/ExternalFileLevelStorage.cpp
|
||||
world/level/storage/RegionFile.cpp
|
||||
world/level/storage/LevelStorage.cpp
|
||||
world/level/storage/MemoryLevelStorage.cpp
|
||||
world/level/storage/ChunkStorage.cpp
|
||||
world/level/storage/LevelSource.cpp
|
||||
world/level/storage/MemoryChunkStorage.cpp
|
||||
world/level/storage/ExternalFileLevelStorageSource.cpp
|
||||
world/level/levelgen/feature/BirchFeature.cpp
|
||||
world/level/levelgen/feature/LargeFeature.cpp
|
||||
world/level/levelgen/feature/Feature.cpp
|
||||
world/level/levelgen/feature/LargeCaveFeature.cpp
|
||||
world/level/levelgen/feature/SpringFeature.cpp
|
||||
world/level/levelgen/feature/TreeFeature.cpp
|
||||
world/level/levelgen/feature/PineFeature.cpp
|
||||
world/level/levelgen/feature/ReedsFeature.cpp
|
||||
world/level/levelgen/feature/OreFeature.cpp
|
||||
world/level/levelgen/feature/ClayFeature.cpp
|
||||
world/level/levelgen/feature/FlowerFeature.cpp
|
||||
world/level/levelgen/feature/SpruceFeature.cpp
|
||||
world/level/levelgen/biome/Biome.cpp
|
||||
world/level/levelgen/biome/BiomeSource.cpp
|
||||
world/level/levelgen/chunk/RandomLevelSource.cpp
|
||||
world/level/levelgen/chunk/LevelChunk.cpp
|
||||
world/level/levelgen/chunk/ChunkCache.cpp
|
||||
world/level/levelgen/chunk/ChunkSource.cpp
|
||||
world/level/levelgen/chunk/PerformanceTestChunkSource.cpp
|
||||
world/level/levelgen/chunk/TestChunkSource.cpp
|
||||
world/level/Level.cpp
|
||||
world/level/Region.cpp
|
||||
world/item/TilePlanterItem.cpp
|
||||
world/item/CameraItem.cpp
|
||||
world/item/TileItem.cpp
|
||||
world/item/Inventory.cpp
|
||||
world/item/DoorItem.cpp
|
||||
world/item/ItemInstance.cpp
|
||||
world/item/Item.cpp
|
||||
world/particle/RedDustParticle.cpp
|
||||
world/particle/TerrainParticle.cpp
|
||||
world/particle/BubbleParticle.cpp
|
||||
world/particle/ExplodeParticle.cpp
|
||||
world/particle/ParticleEngine.cpp
|
||||
world/particle/FlameParticle.cpp
|
||||
world/particle/SmokeParticle.cpp
|
||||
world/particle/Particle.cpp
|
||||
world/particle/LavaParticle.cpp
|
||||
world/tile/InvisibleTile.cpp
|
||||
world/tile/Sapling.cpp
|
||||
world/tile/TreeTile.cpp
|
||||
world/tile/GrassTile.cpp
|
||||
world/tile/HalfTransparentTile.cpp
|
||||
world/tile/ClothTile.cpp
|
||||
world/tile/TorchTile.cpp
|
||||
world/tile/MetalTile.cpp
|
||||
world/tile/SpongeTile.cpp
|
||||
world/tile/GlassTile.cpp
|
||||
world/tile/SandTile.cpp
|
||||
world/tile/Tile.cpp
|
||||
world/tile/ClayTile.cpp
|
||||
world/tile/StoneTile.cpp
|
||||
world/tile/LadderTile.cpp
|
||||
world/tile/IceTile.cpp
|
||||
world/tile/TopSnowTile.cpp
|
||||
world/tile/ReedTile.cpp
|
||||
world/tile/Bush.cpp
|
||||
world/tile/RedStoneOreTile.cpp
|
||||
world/tile/DirtTile.cpp
|
||||
world/tile/LiquidTileStatic.cpp
|
||||
world/tile/BookshelfTile.cpp
|
||||
world/tile/TntTile.cpp
|
||||
world/tile/OreTile.cpp
|
||||
world/tile/StairTile.cpp
|
||||
world/tile/SandStoneTile.cpp
|
||||
world/tile/FireTile.cpp
|
||||
world/tile/StoneSlabTile.cpp
|
||||
world/tile/LiquidTile.cpp
|
||||
world/tile/GravelTile.cpp
|
||||
world/tile/LiquidTileDynamic.cpp
|
||||
world/tile/TransparentTile.cpp
|
||||
world/tile/LeafTile.cpp
|
||||
world/tile/ObsidianTile.cpp
|
||||
world/tile/FarmTile.cpp
|
||||
world/tile/DoorTile.cpp
|
||||
renderer/GL/GL.cpp
|
||||
add_subdirectory(common)
|
||||
add_subdirectory(network)
|
||||
add_subdirectory(renderer)
|
||||
add_subdirectory(world)
|
||||
|
||||
add_subdirectory(client)
|
||||
|
||||
add_library(reminecraftpe-core INTERFACE)
|
||||
target_include_directories(reminecraftpe-core INTERFACE . ..)
|
||||
target_link_libraries(reminecraftpe-core INTERFACE
|
||||
reminecraftpe-common
|
||||
#reminecraftpe-network
|
||||
#reminecraftpe-renderer
|
||||
reminecraftpe-world
|
||||
reminecraftpe-client
|
||||
)
|
||||
|
||||
target_include_directories(reminecraftpe-core PUBLIC ${INCLUDES})
|
||||
|
||||
# RakNet
|
||||
add_subdirectory(../thirdparty/raknet raknet)
|
||||
target_link_libraries(reminecraftpe-core PUBLIC raknet)
|
||||
|
||||
# zlib - Android builds with its own version
|
||||
# Hack - If we're not building for Android, surely we're building with SDL
|
||||
if(USE_SDL)
|
||||
add_subdirectory(../thirdparty/zlib zlib)
|
||||
target_link_libraries(reminecraftpe-core PUBLIC zlib)
|
||||
|
||||
# SDL
|
||||
add_library(SDL INTERFACE)
|
||||
if(EMSCRIPTEN)
|
||||
set(SDL_FLAG -sUSE_SDL=2)
|
||||
target_compile_options(SDL INTERFACE "${SDL_FLAG}")
|
||||
target_link_options(SDL INTERFACE "${SDL_FLAG}")
|
||||
else()
|
||||
find_package(SDL2 REQUIRED)
|
||||
target_link_libraries(SDL INTERFACE SDL2::SDL2)
|
||||
endif()
|
||||
target_link_libraries(reminecraftpe-core PUBLIC SDL)
|
||||
|
||||
# OpenGL
|
||||
if(NOT EMSCRIPTEN)
|
||||
option(USE_GLES1_COMPATIBILITY_LAYER "Whether To Enable The GLESv1_CM Compatibility Layer" TRUE)
|
||||
else()
|
||||
set(USE_GLES1_COMPATIBILITY_LAYER TRUE)
|
||||
endif()
|
||||
if(USE_GLES1_COMPATIBILITY_LAYER)
|
||||
set(GLES_COMPATIBILITY_LAYER_USE_SDL TRUE CACHE BOOL "" FORCE)
|
||||
set(GLES_COMPATIBILITY_LAYER_DEPENDENCY SDL CACHE STRING "" FORCE)
|
||||
add_subdirectory(../thirdparty/gles-compatibility-layer gles-compatibility-layer)
|
||||
target_link_libraries(reminecraftpe-core PUBLIC gles-compatibility-layer)
|
||||
target_compile_definitions(reminecraftpe-core PUBLIC USE_GLES1_COMPATIBILITY_LAYER)
|
||||
if(EMSCRIPTEN)
|
||||
target_link_options(reminecraftpe-core PUBLIC -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2)
|
||||
endif()
|
||||
else()
|
||||
find_package(OpenGL REQUIRED)
|
||||
target_link_libraries(reminecraftpe-core PUBLIC OpenGL::OpenGL OpenGL::GLU)
|
||||
endif()
|
||||
elseif(ANDROID)
|
||||
# Add Android related stuff here.
|
||||
endif()
|
||||
|
||||
# Sound Data
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../sound_data/sounds.h")
|
||||
if(NOT DEFINED ENV{CI})
|
||||
message(WARNING "Missing sound data! Did you run tools/grabsounds.py?")
|
||||
endif()
|
||||
target_compile_definitions(reminecraftpe-core PRIVATE MISSING_SOUND_DATA)
|
||||
endif()
|
||||
|
||||
84
source/client/CMakeLists.txt
Normal file
84
source/client/CMakeLists.txt
Normal file
@@ -0,0 +1,84 @@
|
||||
add_library(reminecraftpe-client STATIC
|
||||
app/App.cpp app/App.hpp
|
||||
app/AppPlatform.cpp app/AppPlatform.hpp
|
||||
app/Minecraft.cpp app/Minecraft.hpp
|
||||
app/NinecraftApp.cpp app/NinecraftApp.hpp
|
||||
model/Cube.cpp model/Cube.hpp
|
||||
model/HumanoidModel.cpp model/HumanoidModel.hpp
|
||||
model/Model.cpp model/Model.hpp
|
||||
model/PigModel.cpp model/PigModel.hpp
|
||||
model/PolygonQuad.cpp model/PolygonQuad.hpp
|
||||
network/ClientSideNetworkHandler.cpp network/ClientSideNetworkHandler.hpp
|
||||
options/Options.cpp options/Options.hpp
|
||||
player/LocalPlayer.cpp player/LocalPlayer.hpp
|
||||
player/input/Controller.cpp player/input/Controller.hpp
|
||||
player/input/ControllerTurnInput.cpp player/input/ControllerTurnInput.hpp
|
||||
player/input/CustomInputHolder.cpp player/input/CustomInputHolder.hpp
|
||||
player/input/IBuildInput.cpp player/input/IBuildInput.hpp
|
||||
player/input/IInputHolder.cpp player/input/IInputHolder.hpp
|
||||
player/input/IMoveInput.cpp player/input/IMoveInput.hpp
|
||||
player/input/ITouchScreenModel.cpp player/input/ITouchScreenModel.hpp
|
||||
player/input/ITurnInput.cpp player/input/ITurnInput.hpp
|
||||
player/input/IncludeExcludeArea.cpp player/input/IncludeExcludeArea.hpp
|
||||
player/input/Keyboard.cpp player/input/Keyboard.hpp
|
||||
player/input/KeyboardInput.cpp player/input/KeyboardInput.hpp
|
||||
player/input/Mouse.cpp player/input/Mouse.hpp
|
||||
player/input/MouseDevice.cpp player/input/MouseDevice.hpp
|
||||
player/input/MouseHandler.cpp player/input/MouseHandler.hpp
|
||||
player/input/MouseTurnInput.cpp player/input/MouseTurnInput.hpp
|
||||
player/input/Multitouch.cpp player/input/Multitouch.hpp
|
||||
player/input/PolygonArea.cpp player/input/PolygonArea.hpp
|
||||
player/input/RectangleArea.cpp player/input/RectangleArea.hpp
|
||||
player/input/TouchAreaModel.cpp player/input/TouchAreaModel.hpp
|
||||
player/input/TouchInputHolder.cpp player/input/TouchInputHolder.hpp
|
||||
player/input/TouchscreenInput_TestFps.cpp player/input/TouchscreenInput_TestFps.hpp
|
||||
player/input/UnifiedTurnBuild.cpp player/input/UnifiedTurnBuild.hpp
|
||||
renderer/Chunk.cpp renderer/Chunk.hpp
|
||||
renderer/Culler.cpp renderer/Culler.hpp
|
||||
renderer/DynamicTexture.cpp renderer/DynamicTexture.hpp
|
||||
renderer/FireTexture.cpp
|
||||
renderer/FoliageColor.cpp renderer/FoliageColor.hpp
|
||||
renderer/Font.cpp renderer/Font.hpp
|
||||
renderer/Frustum.cpp renderer/Frustum.hpp
|
||||
renderer/FrustumCuller.cpp renderer/FrustumCuller.hpp
|
||||
renderer/GameRenderer.cpp renderer/GameRenderer.hpp
|
||||
renderer/GrassColor.cpp renderer/GrassColor.hpp
|
||||
renderer/ItemInHandRenderer.cpp renderer/ItemInHandRenderer.hpp
|
||||
renderer/LavaSideTexture.cpp
|
||||
renderer/LavaTexture.cpp
|
||||
renderer/LevelRenderer.cpp renderer/LevelRenderer.hpp
|
||||
renderer/LightLayer.cpp renderer/LightLayer.hpp
|
||||
renderer/LightUpdate.cpp renderer/LightUpdate.hpp
|
||||
renderer/Matrix.cpp renderer/Matrix.hpp
|
||||
renderer/PatchManager.cpp renderer/PatchManager.hpp
|
||||
renderer/RenderChunk.cpp renderer/RenderChunk.hpp
|
||||
renderer/RenderList.cpp renderer/RenderList.hpp
|
||||
renderer/Tesselator.cpp renderer/Tesselator.hpp
|
||||
renderer/Textures.cpp renderer/Textures.hpp
|
||||
renderer/TileRenderer.cpp renderer/TileRenderer.hpp
|
||||
renderer/WaterSideTexture.cpp
|
||||
renderer/WaterTexture.cpp
|
||||
renderer/entity/EntityRenderDispatcher.cpp renderer/entity/EntityRenderDispatcher.hpp
|
||||
renderer/entity/EntityRenderer.cpp renderer/entity/EntityRenderer.hpp
|
||||
renderer/entity/FallingTileRenderer.cpp renderer/entity/FallingTileRenderer.hpp
|
||||
renderer/entity/HumanoidMobRenderer.cpp renderer/entity/HumanoidMobRenderer.hpp
|
||||
renderer/entity/ItemRenderer.cpp renderer/entity/ItemRenderer.hpp
|
||||
renderer/entity/ItemSpriteRenderer.cpp renderer/entity/ItemSpriteRenderer.hpp
|
||||
renderer/entity/MobRenderer.cpp renderer/entity/MobRenderer.hpp
|
||||
renderer/entity/TntRenderer.cpp renderer/entity/TntRenderer.hpp
|
||||
renderer/entity/TripodCameraRenderer.cpp renderer/entity/TripodCameraRenderer.hpp
|
||||
sound/SoundData.cpp sound/SoundData.hpp
|
||||
sound/SoundEngine.cpp sound/SoundEngine.hpp
|
||||
sound/SoundRepository.cpp sound/SoundRepository.hpp
|
||||
sound/SoundSystem.cpp sound/SoundSystem.hpp
|
||||
)
|
||||
add_subdirectory(gui)
|
||||
#add_subdirectory(player/input)
|
||||
|
||||
#add_library(reminecraftpe-client INTERFACE)
|
||||
target_link_libraries(reminecraftpe-client PUBLIC
|
||||
reminecraftpe-gui
|
||||
reminecraftpe-renderer
|
||||
#reminecraftpe-network
|
||||
#reminecraftpe-input
|
||||
)
|
||||
@@ -16,6 +16,7 @@
|
||||
#include "client/gui/Screen.hpp"
|
||||
#include "network/RakNetInstance.hpp"
|
||||
#include "network/NetEventCallback.hpp"
|
||||
#include "client/player/LocalPlayer.hpp"
|
||||
#include "client/player/input/IInputHolder.hpp"
|
||||
#include "client/player/input/MouseHandler.hpp"
|
||||
#include "client/player/input/BuildActionIntention.hpp"
|
||||
@@ -24,7 +25,6 @@
|
||||
#include "client/renderer/entity/EntityRenderDispatcher.hpp"
|
||||
#include "client/sound/SoundEngine.hpp"
|
||||
#include "world/level/Level.hpp"
|
||||
#include "world/entity/LocalPlayer.hpp"
|
||||
#include "world/gamemode/GameMode.hpp"
|
||||
#include "world/particle/ParticleEngine.hpp"
|
||||
|
||||
|
||||
31
source/client/gui/CMakeLists.txt
Normal file
31
source/client/gui/CMakeLists.txt
Normal file
@@ -0,0 +1,31 @@
|
||||
add_library(reminecraftpe-gui STATIC
|
||||
Gui.cpp Gui.hpp
|
||||
GuiComponent.cpp GuiComponent.hpp
|
||||
Screen.cpp Screen.hpp
|
||||
components/AvailableGamesList.cpp components/AvailableGamesList.hpp
|
||||
components/Button.cpp components/Button.hpp
|
||||
components/OptionList.cpp components/OptionList.hpp
|
||||
components/RolledSelectionList.cpp components/RolledSelectionList.hpp
|
||||
components/ScrolledSelectionList.cpp components/ScrolledSelectionList.hpp
|
||||
components/SmallButton.cpp components/SmallButton.hpp
|
||||
components/TextInputBox.cpp components/TextInputBox.hpp
|
||||
components/WorldSelectionList.cpp components/WorldSelectionList.hpp
|
||||
screens/ChatScreen.cpp screens/ChatScreen.hpp
|
||||
screens/ConfirmScreen.cpp screens/ConfirmScreen.hpp
|
||||
screens/CreateWorldScreen.cpp screens/CreateWorldScreen.hpp
|
||||
screens/DeathScreen.cpp screens/DeathScreen.hpp
|
||||
screens/DeathScreen.cpp screens/DeathScreen.hpp
|
||||
screens/DeleteWorldScreen.cpp screens/DeleteWorldScreen.hpp
|
||||
screens/DirectConnectScreen.cpp screens/DirectConnectScreen.hpp
|
||||
screens/IngameBlockSelectionScreen.cpp screens/IngameBlockSelectionScreen.hpp
|
||||
screens/InvalidLicenseScreen.cpp screens/InvalidLicenseScreen.hpp
|
||||
screens/JoinGameScreen.cpp screens/JoinGameScreen.hpp
|
||||
screens/OptionsScreen.cpp screens/OptionsScreen.hpp
|
||||
screens/PauseScreen.cpp screens/PauseScreen.hpp
|
||||
screens/ProgressScreen.cpp screens/ProgressScreen.hpp
|
||||
screens/RenameMPLevelScreen.cpp screens/RenameMPLevelScreen.hpp
|
||||
screens/SavingWorldScreen.cpp screens/SavingWorldScreen.hpp
|
||||
screens/SelectWorldScreen.cpp screens/SelectWorldScreen.hpp
|
||||
screens/StartMenuScreen.cpp screens/StartMenuScreen.hpp
|
||||
)
|
||||
target_link_libraries(reminecraftpe-gui PUBLIC reminecraftpe-common reminecraftpe-client)
|
||||
@@ -6,6 +6,8 @@
|
||||
SPDX-License-Identifier: BSD-1-Clause
|
||||
********************************************************************/
|
||||
|
||||
#include "compat/KeyCodes.hpp"
|
||||
|
||||
#include "TextInputBox.hpp"
|
||||
#include "client/app/Minecraft.hpp"
|
||||
#ifndef ORIGINAL_CODE
|
||||
|
||||
25
source/client/player/input/CMakeLists.txt
Normal file
25
source/client/player/input/CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
add_library(reminecraftpe-input STATIC
|
||||
Controller.cpp Controller.hpp
|
||||
ControllerTurnInput.cpp ControllerTurnInput.hpp
|
||||
CustomInputHolder.cpp CustomInputHolder.hpp
|
||||
IBuildInput.cpp IBuildInput.hpp
|
||||
IInputHolder.cpp IInputHolder.hpp
|
||||
IMoveInput.cpp IMoveInput.hpp
|
||||
ITouchScreenModel.cpp ITouchScreenModel.hpp
|
||||
ITurnInput.cpp ITurnInput.hpp
|
||||
IncludeExcludeArea.cpp IncludeExcludeArea.hpp
|
||||
Keyboard.cpp Keyboard.hpp
|
||||
KeyboardInput.cpp KeyboardInput.hpp
|
||||
Mouse.cpp Mouse.hpp
|
||||
MouseDevice.cpp MouseDevice.hpp
|
||||
MouseHandler.cpp MouseHandler.hpp
|
||||
MouseTurnInput.cpp MouseTurnInput.hpp
|
||||
Multitouch.cpp Multitouch.hpp
|
||||
PolygonArea.cpp PolygonArea.hpp
|
||||
RectangleArea.cpp RectangleArea.hpp
|
||||
TouchAreaModel.cpp TouchAreaModel.hpp
|
||||
TouchInputHolder.cpp TouchInputHolder.hpp
|
||||
TouchscreenInput_TestFps.cpp TouchscreenInput_TestFps.hpp
|
||||
UnifiedTurnBuild.cpp UnifiedTurnBuild.hpp
|
||||
)
|
||||
target_link_libraries(reminecraftpe-input PRIVATE reminecraftpe-client)
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common/Matrix.hpp"
|
||||
#include "Matrix.hpp"
|
||||
#include "world/phys/AABB.hpp"
|
||||
|
||||
class Frustum
|
||||
@@ -36,4 +36,4 @@ public:
|
||||
|
||||
public:
|
||||
Frustum x;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstring>
|
||||
#include "Mth.hpp"
|
||||
#include "common/Mth.hpp"
|
||||
#include "thirdparty/GL/GL.hpp"
|
||||
|
||||
class Matrix
|
||||
@@ -129,14 +129,26 @@ void EntityRenderDispatcher::render(Entity* entity, float a, float b, float c, f
|
||||
if (pRenderer)
|
||||
{
|
||||
#ifndef ORIGINAL_CODE
|
||||
if (pRenderer == &m_HumanoidMobRenderer)
|
||||
m_HumanoidMobRenderer.m_pHumanoidModel->field_10BE = entity->isSneaking();
|
||||
if (pRenderer == &m_HumanoidRenderer)
|
||||
m_HumanoidRenderer.m_pHumanoidModel->field_10BE = entity->isSneaking();
|
||||
else
|
||||
m_HumanoidMobRenderer.m_pHumanoidModel->field_10BE = false;
|
||||
m_HumanoidRenderer.m_pHumanoidModel->field_10BE = false;
|
||||
#endif
|
||||
|
||||
pRenderer->render(entity, a, b, c, d, e);
|
||||
}
|
||||
|
||||
/*
|
||||
glColor4f(1.0f, 0.0f, 0.0f, 1.0f);
|
||||
AABB hitbox = entity->m_hitbox;
|
||||
float hx = hitbox.min.x, hy = hitbox.min.y, hz = hitbox.min.z;
|
||||
float hw = hitbox.max.x - hx, hh = hitbox.max.y - hy, hd = hitbox.max.z - hz;
|
||||
printf("%f\n", hx);
|
||||
Cube cube(0, 0);
|
||||
cube.addBox(hx, hy, hz, hw, hh, hd);
|
||||
//cube.setPos(a, b, c);
|
||||
cube.render(e);
|
||||
*/
|
||||
}
|
||||
|
||||
void EntityRenderDispatcher::setLevel(Level* level)
|
||||
|
||||
@@ -156,8 +156,8 @@ void MobRenderer::renderName(Mob* mob, float x, float y, float z)
|
||||
return;
|
||||
|
||||
Player* player = (Player*)mob;
|
||||
if (player == m_pDispatcher->m_pMinecraft->m_pLocalPlayer)
|
||||
return;
|
||||
//if (player == m_pDispatcher->m_pMinecraft->m_pLocalPlayer)
|
||||
// return;
|
||||
|
||||
// @TODO: don't know why but I have to add this correction. look into it and fix it!
|
||||
renderNameTag(mob, player->m_name, x, y - 1.5f, z, mob->isSneaking() ? 32 : 64);
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
// mcpe01_canada.apk file.
|
||||
// --------------------------------------------------------------------
|
||||
#ifndef MISSING_SOUND_DATA
|
||||
#include "../../sound_data/sounds.h"
|
||||
#include "sound_data/sounds.h"
|
||||
#endif
|
||||
|
||||
28
source/common/CMakeLists.txt
Normal file
28
source/common/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
# Common (low-level?) stuff
|
||||
|
||||
add_library(reminecraftpe-common STATIC
|
||||
Random.cpp Random.hpp
|
||||
Utils.cpp Utils.hpp
|
||||
Mth.cpp Mth.hpp
|
||||
Timer.cpp Timer.hpp
|
||||
CThread.cpp CThread.hpp
|
||||
Util.cpp Util.hpp
|
||||
Logger.cpp Logger.hpp
|
||||
SmoothFloat.cpp SmoothFloat.hpp
|
||||
)
|
||||
|
||||
target_link_libraries(reminecraftpe-common PUBLIC
|
||||
reminecraftpe-network
|
||||
)
|
||||
#target_link_libraries(reminecraftpe-common PRIVATE
|
||||
# reminecraftpe-renderer
|
||||
#)
|
||||
|
||||
# zlib - Android builds with its own version
|
||||
# Hack - If we're not building for Android, surely we're building with SDL
|
||||
if (USE_SDL)
|
||||
add_subdirectory(../../thirdparty/zlib zlib)
|
||||
target_link_libraries(reminecraftpe-common PUBLIC zlib)
|
||||
elseif (NOT ANDROID)
|
||||
target_include_directories(reminecraftpe-common PRIVATE ../../thirdparty/zlib)
|
||||
endif()
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "CThread.hpp"
|
||||
#include "common/Utils.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
#if defined(_WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include "LongHack.hpp"
|
||||
#include "common/Utils.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
// This appears to be VERY similar to https://github.com/SethRobinson/proton/blob/master/shared/util/CRandom.h#L10
|
||||
// It turns out, RTsoft, Mojang, and the author of Game Coding Complete used the same reference implementation of
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
********************************************************************/
|
||||
|
||||
#include "Timer.hpp"
|
||||
#include "common/Utils.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
#if !defined(_WIN32) && defined(USE_ACCURATE_TIMER)
|
||||
#error "Implement getAccurateTimeMs() for your platform!"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
// note: not an official file name
|
||||
|
||||
#include "common/Utils.hpp"
|
||||
#include "Utils.hpp"
|
||||
|
||||
#if defined(_WIN32) && !defined(_XBOX)
|
||||
|
||||
|
||||
@@ -110,7 +110,6 @@ void closedir(DIR* dir);
|
||||
|
||||
#endif
|
||||
|
||||
#include "../../compat/KeyCodes.hpp"
|
||||
#include "Logger.hpp"
|
||||
|
||||
// options:
|
||||
|
||||
25
source/network/CMakeLists.txt
Normal file
25
source/network/CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
add_library(reminecraftpe-network
|
||||
MinecraftPackets.cpp MinecraftPackets.hpp
|
||||
NetEventCallback.cpp NetEventCallback.hpp
|
||||
Packet.hpp
|
||||
PingedCompatibleServer.hpp
|
||||
RakNetInstance.cpp RakNetInstance.hpp
|
||||
ServerSideNetworkHandler.cpp ServerSideNetworkHandler.hpp
|
||||
packets/AddPlayerPacket.cpp
|
||||
packets/ChunkDataPacket.cpp
|
||||
packets/LevelDataPacket.cpp
|
||||
packets/LoginPacket.cpp
|
||||
packets/MessagePacket.cpp
|
||||
packets/MovePlayerPacket.cpp
|
||||
packets/PlaceBlockPacket.cpp
|
||||
packets/PlayerEquipmentPacket.cpp
|
||||
packets/RemoveBlockPacket.cpp
|
||||
packets/RemoveEntityPacket.cpp
|
||||
packets/RequestChunkPacket.cpp
|
||||
packets/StartGamePacket.cpp
|
||||
packets/UpdateBlockPacket.cpp
|
||||
)
|
||||
# RakNet
|
||||
add_subdirectory(../../thirdparty/raknet raknet)
|
||||
target_link_libraries(reminecraftpe-network PUBLIC raknet)
|
||||
target_link_libraries(reminecraftpe-network PRIVATE reminecraftpe-renderer)
|
||||
37
source/renderer/CMakeLists.txt
Normal file
37
source/renderer/CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
set(RENDER GL CACHE STRING "Active renderer")
|
||||
set_property(CACHE RENDER PROPERTY STRINGS GL)
|
||||
|
||||
#add_library(reminecraftpe-renderer STATIC)
|
||||
if (RENDER STREQUAL GL)
|
||||
# OpenGL
|
||||
set(USE_GL 1)
|
||||
set(SOURCES GL/GL.cpp GL/GL.hpp)
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
option(USE_GLES1_COMPATIBILITY_LAYER "Whether To Enable The GLESv1_CM Compatibility Layer" TRUE)
|
||||
else()
|
||||
set(USE_GLES1_COMPATIBILITY_LAYER TRUE)
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown renderer!")
|
||||
endif()
|
||||
|
||||
add_library(reminecraftpe-renderer STATIC ${SOURCES})
|
||||
target_include_directories(reminecraftpe-renderer PUBLIC .)
|
||||
target_include_directories(reminecraftpe-renderer PRIVATE ../..)
|
||||
|
||||
if (USE_GL)
|
||||
if(USE_GLES1_COMPATIBILITY_LAYER)
|
||||
set(GLES_COMPATIBILITY_LAYER_USE_SDL TRUE CACHE BOOL "" FORCE)
|
||||
set(GLES_COMPATIBILITY_LAYER_DEPENDENCY SDL CACHE STRING "" FORCE)
|
||||
add_subdirectory(../../thirdparty/gles-compatibility-layer gles-compatibility-layer)
|
||||
target_link_libraries(reminecraftpe-renderer PUBLIC gles-compatibility-layer)
|
||||
target_compile_definitions(reminecraftpe-renderer PUBLIC USE_GLES1_COMPATIBILITY_LAYER)
|
||||
if(EMSCRIPTEN)
|
||||
target_link_options(reminecraftpe-core PUBLIC -sMIN_WEBGL_VERSION=2 -sMAX_WEBGL_VERSION=2)
|
||||
endif()
|
||||
else()
|
||||
find_package(OpenGL REQUIRED)
|
||||
target_link_libraries(reminecraftpe-renderer PUBLIC OpenGL::OpenGL OpenGL::GLU)
|
||||
endif()
|
||||
endif()
|
||||
115
source/world/CMakeLists.txt
Normal file
115
source/world/CMakeLists.txt
Normal file
@@ -0,0 +1,115 @@
|
||||
add_library(reminecraftpe-world STATIC
|
||||
entity/Entity.cpp entity/Entity.hpp
|
||||
entity/FallingTile.cpp entity/FallingTile.hpp
|
||||
entity/ItemEntity.cpp entity/ItemEntity.hpp
|
||||
entity/Mob.cpp entity/Mob.hpp
|
||||
entity/Pig.cpp entity/Pig.hpp
|
||||
entity/Player.cpp entity/Player.hpp
|
||||
entity/PrimedTnt.cpp entity/PrimedTnt.hpp
|
||||
entity/TripodCamera.cpp entity/TripodCamera.hpp
|
||||
gamemode/CreativeMode.cpp gamemode/CreativeMode.hpp
|
||||
gamemode/GameMode.cpp gamemode/GameMode.hpp
|
||||
gamemode/SurvivalMode.cpp gamemode/SurvivalMode.hpp
|
||||
item/CameraItem.cpp item/CameraItem.hpp
|
||||
item/DoorItem.cpp item/DoorItem.hpp
|
||||
item/Inventory.cpp item/Inventory.hpp
|
||||
item/Item.cpp item/Item.hpp
|
||||
item/ItemInstance.cpp item/ItemInstance.hpp
|
||||
item/TileItem.cpp item/TileItem.hpp
|
||||
item/TilePlanterItem.cpp item/TilePlanterItem.hpp
|
||||
level/Dimension.cpp level/Dimension.hpp
|
||||
level/Explosion.cpp level/Explosion.hpp
|
||||
level/Level.cpp level/Level.hpp
|
||||
level/LevelListener.cpp level/LevelListener.hpp
|
||||
level/Material.cpp level/Material.hpp
|
||||
level/Region.cpp level/Region.hpp
|
||||
level/TickNextTickData.cpp level/TickNextTickData.hpp
|
||||
level/levelgen/biome/Biome.cpp level/levelgen/biome/Biome.hpp
|
||||
level/levelgen/biome/BiomeSource.cpp level/levelgen/biome/BiomeSource.hpp
|
||||
level/levelgen/chunk/ChunkCache.cpp level/levelgen/chunk/ChunkCache.hpp
|
||||
level/levelgen/chunk/ChunkSource.cpp level/levelgen/chunk/ChunkSource.hpp
|
||||
level/levelgen/chunk/LevelChunk.cpp level/levelgen/chunk/LevelChunk.hpp
|
||||
level/levelgen/chunk/PerformanceTestChunkSource.cpp level/levelgen/chunk/PerformanceTestChunkSource.hpp
|
||||
level/levelgen/chunk/RandomLevelSource.cpp level/levelgen/chunk/RandomLevelSource.hpp
|
||||
level/levelgen/chunk/TestChunkSource.cpp level/levelgen/chunk/TestChunkSource.hpp
|
||||
level/levelgen/feature/BirchFeature.cpp
|
||||
level/levelgen/feature/ClayFeature.cpp
|
||||
level/levelgen/feature/Feature.cpp level/levelgen/feature/Feature.hpp
|
||||
level/levelgen/feature/FlowerFeature.cpp
|
||||
level/levelgen/feature/LargeCaveFeature.cpp
|
||||
level/levelgen/feature/LargeFeature.cpp
|
||||
level/levelgen/feature/OreFeature.cpp
|
||||
level/levelgen/feature/PineFeature.cpp
|
||||
level/levelgen/feature/ReedsFeature.cpp
|
||||
level/levelgen/feature/SpringFeature.cpp
|
||||
level/levelgen/feature/SpruceFeature.cpp
|
||||
level/levelgen/feature/TreeFeature.cpp
|
||||
level/levelgen/synth/ImprovedNoise.cpp level/levelgen/synth/ImprovedNoise.hpp
|
||||
level/levelgen/synth/PerlinNoise.cpp level/levelgen/synth/PerlinNoise.hpp
|
||||
level/levelgen/synth/Synth.cpp level/levelgen/synth/Synth.hpp
|
||||
level/storage/ChunkStorage.cpp level/storage/ChunkStorage.hpp
|
||||
level/storage/ExternalFileLevelStorage.cpp level/storage/ExternalFileLevelStorage.hpp
|
||||
level/storage/ExternalFileLevelStorageSource.cpp level/storage/ExternalFileLevelStorageSource.hpp
|
||||
level/storage/LevelData.cpp level/storage/LevelData.hpp
|
||||
level/storage/LevelSource.cpp level/storage/LevelSource.hpp
|
||||
level/storage/LevelStorage.cpp level/storage/LevelStorage.hpp
|
||||
level/storage/LevelStorageSource.cpp level/storage/LevelStorageSource.hpp
|
||||
level/storage/MemoryChunkStorage.cpp level/storage/MemoryChunkStorage.hpp
|
||||
level/storage/MemoryLevelStorage.cpp level/storage/MemoryLevelStorage.hpp
|
||||
level/storage/MemoryLevelStorageSource.cpp level/storage/MemoryLevelStorageSource.hpp
|
||||
level/storage/RegionFile.cpp level/storage/RegionFile.hpp
|
||||
particle/BubbleParticle.cpp
|
||||
particle/ExplodeParticle.cpp
|
||||
particle/FlameParticle.cpp
|
||||
particle/LavaParticle.cpp
|
||||
particle/Particle.cpp particle/Particle.hpp
|
||||
particle/ParticleEngine.cpp particle/ParticleEngine.hpp
|
||||
particle/RedDustParticle.cpp
|
||||
particle/SmokeParticle.cpp
|
||||
particle/TerrainParticle.cpp
|
||||
phys/AABB.cpp phys/AABB.hpp
|
||||
phys/HitResult.cpp phys/HitResult.hpp
|
||||
phys/Vec3.cpp phys/Vec3.hpp
|
||||
tile/BookshelfTile.cpp tile/BookshelfTile.hpp
|
||||
tile/Bush.cpp tile/Bush.hpp
|
||||
tile/ClayTile.cpp tile/ClayTile.hpp
|
||||
tile/ClothTile.cpp tile/ClothTile.hpp
|
||||
tile/DirtTile.cpp tile/DirtTile.hpp
|
||||
tile/DoorTile.cpp tile/DoorTile.hpp
|
||||
tile/FarmTile.cpp tile/FarmTile.hpp
|
||||
tile/FireTile.cpp tile/FireTile.hpp
|
||||
tile/GlassTile.cpp tile/GlassTile.hpp
|
||||
tile/GrassTile.cpp tile/GrassTile.hpp
|
||||
tile/GravelTile.cpp tile/GravelTile.hpp
|
||||
tile/HalfTransparentTile.cpp tile/HalfTransparentTile.hpp
|
||||
tile/IceTile.cpp tile/IceTile.hpp
|
||||
tile/InvisibleTile.cpp tile/InvisibleTile.hpp
|
||||
tile/LadderTile.cpp tile/LadderTile.hpp
|
||||
tile/LeafTile.cpp tile/LeafTile.hpp
|
||||
tile/LiquidTile.cpp tile/LiquidTile.hpp
|
||||
tile/LiquidTileDynamic.cpp tile/LiquidTileDynamic.hpp
|
||||
tile/LiquidTileStatic.cpp tile/LiquidTileStatic.hpp
|
||||
tile/MetalTile.cpp tile/MetalTile.hpp
|
||||
tile/ObsidianTile.cpp tile/ObsidianTile.hpp
|
||||
tile/OreTile.cpp tile/OreTile.hpp
|
||||
tile/RedStoneOreTile.cpp tile/RedStoneOreTile.hpp
|
||||
tile/ReedTile.cpp tile/ReedTile.hpp
|
||||
tile/SandStoneTile.cpp tile/SandStoneTile.hpp
|
||||
tile/SandTile.cpp tile/SandTile.hpp
|
||||
tile/Sapling.cpp tile/Sapling.hpp
|
||||
tile/SpongeTile.cpp tile/SpongeTile.hpp
|
||||
tile/StairTile.cpp tile/StairTile.hpp
|
||||
tile/StoneSlabTile.cpp tile/StoneSlabTile.hpp
|
||||
tile/StoneTile.cpp tile/StoneTile.hpp
|
||||
tile/Tile.cpp tile/Tile.hpp
|
||||
tile/TntTile.cpp tile/TntTile.hpp
|
||||
tile/TopSnowTile.cpp tile/TopSnowTile.hpp
|
||||
tile/TorchTile.cpp tile/TorchTile.hpp
|
||||
tile/TransparentTile.cpp tile/TransparentTile.hpp
|
||||
tile/TreeTile.cpp tile/TreeTile.hpp
|
||||
)
|
||||
#add_subdirectory(level)
|
||||
target_link_libraries(reminecraftpe-world PUBLIC
|
||||
reminecraftpe-common
|
||||
reminecraftpe-client
|
||||
)
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "client/model/Model.hpp"
|
||||
//#include "client/model/Model.hpp"
|
||||
#include "world/phys/Vec3.hpp"
|
||||
#include "world/phys/AABB.hpp"
|
||||
#include "world/level/Material.hpp"
|
||||
@@ -19,6 +19,7 @@
|
||||
class Level;
|
||||
class Player;
|
||||
class ItemInstance;
|
||||
class Model;
|
||||
|
||||
enum eEntityRenderType
|
||||
{
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
class Level;
|
||||
class Player;
|
||||
class PigModel;
|
||||
|
||||
class Pig : public Mob
|
||||
{
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "Player.hpp"
|
||||
#include "world/level/Level.hpp"
|
||||
#include "client/model/Model.hpp"
|
||||
|
||||
Player::Player(Level* pLevel) : Mob(pLevel),
|
||||
m_model(0.0f, 0.0f)
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
void interact(Entity* pEnt);
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
Model *getModel();
|
||||
Model *getModel() override;
|
||||
|
||||
public:
|
||||
//TODO
|
||||
@@ -91,6 +91,7 @@ public:
|
||||
bool m_bHaveRespawnPos;
|
||||
//TODO
|
||||
|
||||
private:
|
||||
HumanoidModel m_model;
|
||||
};
|
||||
|
||||
|
||||
@@ -24,6 +24,6 @@ ItemInstance* CameraItem::use(ItemInstance* inst, Level* level, Player* player)
|
||||
return inst;
|
||||
#endif
|
||||
|
||||
level->addEntity(new TripodCamera(level, player, player->m_pos.x, player->m_pos.y, player->m_pos.z));
|
||||
level->addEntity(new Pig(level, player->m_pos.x, player->m_pos.y, player->m_pos.z)); //(new TripodCamera(level, player, player->m_pos.x, player->m_pos.y, player->m_pos.z));
|
||||
return inst;
|
||||
}
|
||||
|
||||
4
source/world/level/CMakeLists.txt
Normal file
4
source/world/level/CMakeLists.txt
Normal file
@@ -0,0 +1,4 @@
|
||||
add_library(reminecraftpe-level STATIC
|
||||
)
|
||||
target_link_libraries(reminecraftpe-level PUBLIC reminecraftpe-world)
|
||||
#target_link_libraries(reminecraftpe-level PUBLIC reminecraftpe-network reminecraftpe-renderer)
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
#include "world/tile/Tile.hpp"
|
||||
#include "world/entity/Entity.hpp"
|
||||
#include "world/entity/LocalPlayer.hpp"
|
||||
#include "client/player/LocalPlayer.hpp"
|
||||
#include "world/level/levelgen/chunk/LevelChunk.hpp"
|
||||
#include "world/level/levelgen/chunk/ChunkSource.hpp"
|
||||
#include "world/level/storage/LevelStorageSource.hpp"
|
||||
|
||||
2
thirdparty/raknet/CMakeLists.txt
vendored
2
thirdparty/raknet/CMakeLists.txt
vendored
@@ -114,4 +114,6 @@ add_library(raknet STATIC
|
||||
RakNetSocket2_360_720.cpp
|
||||
RakSleep.cpp
|
||||
)
|
||||
# Avoid 'register' keyword removal in C++17
|
||||
set_target_properties(raknet PROPERTIES CXX_STANDARD 11)
|
||||
target_include_directories(raknet PUBLIC .)
|
||||
|
||||
Reference in New Issue
Block a user