Skip to content

Commit

Permalink
修正依赖问题 & 升级依赖版本
Browse files Browse the repository at this point in the history
  • Loading branch information
9chu committed Feb 15, 2024
1 parent 6faa65b commit 438e190
Show file tree
Hide file tree
Showing 24 changed files with 313 additions and 531 deletions.
510 changes: 230 additions & 280 deletions cmake/External.cmake

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion include/lstg/Core/Math/Collider2D/IntersectCheck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* 此文件为 LuaSTGPlus 项目的一部分,版权与许可声明详见 COPYRIGHT.txt。
*/
#pragma once
#include <glm/gtx/norm.hpp>
#include "ColliderShape.hpp"
#include "../VectorHelper.hpp"

Expand Down
1 change: 1 addition & 0 deletions include/lstg/Core/Math/VectorHelper.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* 此文件为 LuaSTGPlus 项目的一部分,版权与许可声明详见 COPYRIGHT.txt。
*/
#pragma once
#define GLM_ENABLE_EXPERIMENTAL
#include <glm/vec2.hpp>
#include <glm/gtx/norm.hpp>

Expand Down
31 changes: 0 additions & 31 deletions patch/diligent-std-move-patch.patch

This file was deleted.

38 changes: 0 additions & 38 deletions patch/diligent-vk-device-select-patch.patch

This file was deleted.

12 changes: 0 additions & 12 deletions patch/sdl2-sdlchecks-patch.patch

This file was deleted.

37 changes: 0 additions & 37 deletions patch/sdl_android-patch.patch

This file was deleted.

76 changes: 0 additions & 76 deletions patch/sdl_sound-patch.patch

This file was deleted.

37 changes: 27 additions & 10 deletions src/Core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,31 @@ if(LSTG_PLATFORM_LINUX)
endif()
endif()

set(LSTG_CORE_DEPS_PUBLIC fmt liblua-static glm::glm nlohmann_json)
set(LSTG_CORE_DEPS_PRIVATE spdlog SDL2-static imgui implot zlib-ng stb freetype icu_libsicuuc harfbuzz-icu freetype IcuData ryu SDL2_sound-static)
set(LSTG_CORE_DEPS_PUBLIC
fmt::fmt
lstg::liblua-static
glm::glm
nlohmann_json::nlohmann_json)
set(LSTG_CORE_DEPS_PRIVATE
spdlog::spdlog
sdl2::SDL2-static
imgui::imgui
implot::implot
zlib::zlib
stb::stb
freetype::freetype
icu.libsicuuc
harfbuzz::harfbuzz-icu
lstg::IcuData
ryu
sdl2_sound::SDL2_sound-static)
if(LSTG_X11_ENABLE)
list(APPEND LSTG_CORE_DEPS_PRIVATE X11::xcb X11::X11_xcb)
endif()
if(NOT LSTG_PLATFORM_EMSCRIPTEN)
list(APPEND LSTG_CORE_DEPS_PRIVATE mojoal)
list(APPEND LSTG_CORE_DEPS_PRIVATE mojoal::mojoal)
else()
list(APPEND LSTG_CORE_DEPS_PRIVATE luabitop)
list(APPEND LSTG_CORE_DEPS_PRIVATE luabitop::luabitop-static brotli::brotlicommon)
endif()

# 平台相关库
Expand Down Expand Up @@ -66,13 +82,15 @@ if(LSTG_PLATFORM_MACOS)
endif()

# 目标
add_library(LuaSTGPlusCore STATIC ${LSTG_CORE_SOURCES} ${LSTG_CORE_SOURCES_GEN})
target_include_directories(LuaSTGPlusCore
add_library(lstg.Core STATIC ${LSTG_CORE_SOURCES} ${LSTG_CORE_SOURCES_GEN})
add_library(lstg::Core ALIAS lstg.Core)
target_include_directories(lstg.Core
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../include
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/Subsystem/Render/detail/LuaEffectBuilder)
target_link_libraries(LuaSTGPlusCore PUBLIC ${LSTG_CORE_DEPS_PUBLIC} PRIVATE ${LSTG_CORE_DEPS_PRIVATE})
target_link_libraries(lstg.Core PUBLIC ${LSTG_CORE_DEPS_PUBLIC} PRIVATE ${LSTG_CORE_DEPS_PRIVATE})
set_target_properties(lstg.Core PROPERTIES EXPORT_NAME Core OUTPUT_NAME LuaSTGPlusCore)

# 宏(公开的)
set(LSTG_CORE_DEFS_PUBLIC LSTG_APP_NAME="${LSTG_APP_NAME}")
Expand Down Expand Up @@ -109,10 +127,9 @@ if(LSTG_PLATFORM_MACOS) # Apple = MacOS | iOS
list(APPEND LSTG_CORE_DEFS_PUBLIC LSTG_PLATFORM_APPLE)
endif()
message("[LSTG] Public compiler definitions: ${LSTG_CORE_DEFS_PUBLIC}")
target_compile_definitions(LuaSTGPlusCore PUBLIC ${LSTG_CORE_DEFS_PUBLIC})
target_compile_definitions(LuaSTGPlusCore PRIVATE ${LSTG_CORE_DEFS_PRIVATE})
target_compile_definitions(lstg.Core PUBLIC ${LSTG_CORE_DEFS_PUBLIC})
target_compile_definitions(lstg.Core PRIVATE ${LSTG_CORE_DEFS_PRIVATE})

# 优化 IDE 展示
source_group(TREE ${CMAKE_SOURCE_DIR} FILES ${LSTG_CORE_SOURCES})
source_group(TREE ${CMAKE_CURRENT_BINARY_DIR} PREFIX generated FILES ${LSTG_CORE_SOURCES_GEN})

8 changes: 4 additions & 4 deletions src/Core/Subsystem/DebugGUI/detail/ImGuiRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,10 +398,10 @@ void ImGuiRenderer::CreateDeviceObjects()
RefCntAutoPtr<IShader> vertexShader;
{
ShaderCreateInfo shaderCreateInfo;
shaderCreateInfo.UseCombinedTextureSamplers = true;
shaderCreateInfo.SourceLanguage = SHADER_SOURCE_LANGUAGE_DEFAULT;
shaderCreateInfo.Desc.ShaderType = SHADER_TYPE_VERTEX;
shaderCreateInfo.Desc.Name = "ImGui VS";
shaderCreateInfo.Desc.UseCombinedTextureSamplers = true;
switch (deviceType)
{
case RENDER_DEVICE_TYPE_VULKAN:
Expand All @@ -422,7 +422,7 @@ void ImGuiRenderer::CreateDeviceObjects()
break;
default:
assert(false);
LSTG_THROW(ImGuiRendererInitializeFailedException, "Unknown device {}", deviceType);
LSTG_THROW(ImGuiRendererInitializeFailedException, "Unknown device {}", static_cast<int>(deviceType));
}
renderDevice->CreateShader(shaderCreateInfo, &vertexShader);
if (!vertexShader)
Expand All @@ -432,10 +432,10 @@ void ImGuiRenderer::CreateDeviceObjects()
RefCntAutoPtr<IShader> pixelShader;
{
ShaderCreateInfo shaderCreateInfo;
shaderCreateInfo.UseCombinedTextureSamplers = true;
shaderCreateInfo.SourceLanguage = SHADER_SOURCE_LANGUAGE_DEFAULT;
shaderCreateInfo.Desc.ShaderType = SHADER_TYPE_PIXEL;
shaderCreateInfo.Desc.Name = "ImGui PS";
shaderCreateInfo.Desc.UseCombinedTextureSamplers = true;
switch (deviceType)
{
case RENDER_DEVICE_TYPE_VULKAN:
Expand All @@ -456,7 +456,7 @@ void ImGuiRenderer::CreateDeviceObjects()
break;
default:
assert(false);
LSTG_THROW(ImGuiRendererInitializeFailedException, "Unknown device {}", deviceType);
LSTG_THROW(ImGuiRendererInitializeFailedException, "Unknown device {}", static_cast<int>(deviceType));
}
renderDevice->CreateShader(shaderCreateInfo, &pixelShader);
if (!pixelShader)
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Subsystem/DebugGUISystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,8 @@ void DebugGUISystem::OnEvent(SubsystemEvent& event) noexcept
case SDL_KEYUP:
UpdateKeyModifiers(io, static_cast<SDL_Keymod>(platformEvent->key.keysym.mod));
t = static_cast<int>(SDLKeyCodeToImGui(platformEvent->key.keysym.sym));
io.AddKeyEvent(t, (platformEvent->type == SDL_KEYDOWN));
io.SetKeyEventNativeData(t, platformEvent->key.keysym.sym, platformEvent->key.keysym.scancode,
io.AddKeyEvent(static_cast<ImGuiKey>(t), (platformEvent->type == SDL_KEYDOWN));
io.SetKeyEventNativeData(static_cast<ImGuiKey>(t), platformEvent->key.keysym.sym, platformEvent->key.keysym.scancode,
platformEvent->key.keysym.scancode);
break;
case SDL_WINDOWEVENT:
Expand Down
7 changes: 3 additions & 4 deletions src/Core/Subsystem/Render/EffectFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,14 +225,13 @@ Result<GraphDef::ImmutableShaderDefinitionPtr> EffectFactory::CompileShader(cons
ci.Source = source.c_str();
ci.SourceLength = source.length();
ci.EntryPoint = ret->GetEntry().c_str();
ci.UseCombinedTextureSamplers = true;
ci.CombinedSamplerSuffix = "Sampler";
ci.Desc.UseCombinedTextureSamplers = true;
ci.Desc.CombinedSamplerSuffix = "Sampler";
ci.Desc.Name = ret->GetName().c_str();
ci.Desc.ShaderType = (ret->GetType() == GraphDef::ShaderDefinition::ShaderTypes::VertexShader ?
Diligent::SHADER_TYPE_VERTEX : Diligent::SHADER_TYPE_PIXEL);
ci.SourceLanguage = Diligent::SHADER_SOURCE_LANGUAGE_HLSL;
ci.ppCompilerOutput = &compilerOutputBlob;
device->CreateShader(ci, &shaderOutput);
device->CreateShader(ci, &shaderOutput, &compilerOutputBlob);

string_view compilerOutput = compilerOutputBlob ? reinterpret_cast<const char*>(compilerOutputBlob->GetConstDataPtr()) : "";
string_view generatedSource = compilerOutputBlob ?
Expand Down
4 changes: 2 additions & 2 deletions src/Core/Subsystem/Render/detail/ClearHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ ClearHelper::ClearHelper(RenderDevice* device)
RefCntAutoPtr<IShader> vertexShader;
{
ShaderCreateInfo shaderCreateInfo;
shaderCreateInfo.UseCombinedTextureSamplers = true;
shaderCreateInfo.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL;
shaderCreateInfo.Desc.ShaderType = SHADER_TYPE_VERTEX;
shaderCreateInfo.Desc.Name = "Viewport Clear VS";
shaderCreateInfo.Desc.UseCombinedTextureSamplers = true;
shaderCreateInfo.Source = kViewportClearVertexShaderHLSL;
renderDevice->CreateShader(shaderCreateInfo, &vertexShader);
if (!vertexShader)
Expand All @@ -79,10 +79,10 @@ ClearHelper::ClearHelper(RenderDevice* device)
RefCntAutoPtr<IShader> pixelShader;
{
ShaderCreateInfo shaderCreateInfo;
shaderCreateInfo.UseCombinedTextureSamplers = true;
shaderCreateInfo.SourceLanguage = SHADER_SOURCE_LANGUAGE_HLSL;
shaderCreateInfo.Desc.ShaderType = SHADER_TYPE_PIXEL;
shaderCreateInfo.Desc.Name = "Viewport Clear PS";
shaderCreateInfo.Desc.UseCombinedTextureSamplers = true;
shaderCreateInfo.Source = kViewportClearPixelShaderHLSL;
renderDevice->CreateShader(shaderCreateInfo, &pixelShader);
if (!pixelShader)
Expand Down
Loading

0 comments on commit 438e190

Please sign in to comment.