mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-21 02:39:17 +00:00
LibCommon now being integrated as an add_subdirectory submodule
This commit is contained in:
@@ -2,8 +2,6 @@ cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(pwe_core CXX C)
|
||||
|
||||
find_package(libcommon CONFIG REQUIRED)
|
||||
find_package(codegen CONFIG REQUIRED)
|
||||
find_package(tinyxml2 CONFIG REQUIRED)
|
||||
find_package(nod CONFIG REQUIRED)
|
||||
find_package(logvisor CONFIG REQUIRED)
|
||||
@@ -15,8 +13,6 @@ find_package(ZLIB REQUIRED)
|
||||
# AssImp's cmake config is pretty awful. It doesn't include necesary libraries. Hopefully this can be fixed later.
|
||||
find_library(IIRXML_LIBRARY NAMES IrrXMLd IrrXML)
|
||||
|
||||
include(codegen)
|
||||
|
||||
file(GLOB_RECURSE source_files
|
||||
"*.c"
|
||||
"*.cpp"
|
||||
@@ -37,12 +33,11 @@ target_include_directories(pwe_core
|
||||
|
||||
target_link_libraries(
|
||||
pwe_core
|
||||
libcommon::libcommon
|
||||
libcommon
|
||||
nod::nod
|
||||
logvisor::logvisor
|
||||
lzokay::lzokay
|
||||
OpenGL::GL
|
||||
codegen::codegen
|
||||
assimp::assimp
|
||||
${IIRXML_LIBRARY}
|
||||
${ZLIB_LIBRARY}
|
||||
@@ -57,14 +52,14 @@ target_compile_definitions(
|
||||
GLEW_STATIC
|
||||
)
|
||||
|
||||
gather_include_directories(pwecore_include_directories pwe_core)
|
||||
gather_include_directories(pwe_core_include_directories pwe_core)
|
||||
|
||||
add_codegen_targets(
|
||||
"${source_files}"
|
||||
codegen_generated_files
|
||||
"${PROJECT_SOURCE_DIR}"
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${pwecore_include_directories}"
|
||||
"${pwe_core_include_directories}"
|
||||
)
|
||||
add_custom_target(pwe_core_codegen DEPENDS ${codegen_generated_files} SOURCES ${source_files})
|
||||
|
||||
|
||||
@@ -83,6 +83,11 @@ void CBasicViewport::mousePressEvent(QMouseEvent *pEvent)
|
||||
|
||||
if (IsMouseInputActive())
|
||||
{
|
||||
#if __APPLE__
|
||||
// This will zero out the drag accumulators
|
||||
gpMouseDragCocoaEventFilter->claimX();
|
||||
gpMouseDragCocoaEventFilter->claimY();
|
||||
#endif
|
||||
SetCursorVisible(false);
|
||||
mMouseMoved = false;
|
||||
mMoveTimer.Restart();
|
||||
@@ -266,6 +271,10 @@ void CBasicViewport::ProcessInput()
|
||||
if (IsMouseInputActive())
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
// QCursor::setPos only works on macOS when the user permits PWE
|
||||
// to control the computer via Universal Access.
|
||||
// As an alternative to relying on the delta of a warped mouse,
|
||||
// use the accumulated delta directly reported by AppKit.
|
||||
float XMovement = gpMouseDragCocoaEventFilter->claimX() * 0.01f;
|
||||
float YMovement = gpMouseDragCocoaEventFilter->claimY() * 0.01f;
|
||||
#else
|
||||
|
||||
@@ -124,6 +124,20 @@ target_compile_definitions(
|
||||
UNICODE
|
||||
)
|
||||
|
||||
gather_include_directories(pwe_editor_include_directories pwe_editor)
|
||||
|
||||
add_codegen_targets(
|
||||
"${source_files}"
|
||||
codegen_generated_files
|
||||
"${PROJECT_SOURCE_DIR}"
|
||||
"${PROJECT_BINARY_DIR}"
|
||||
"${pwe_editor_include_directories}"
|
||||
)
|
||||
add_custom_target(pwe_editor_codegen DEPENDS ${codegen_generated_files} SOURCES ${source_files})
|
||||
|
||||
# Add the generated sources to the library target
|
||||
target_sources(pwe_editor PRIVATE ${codegen_generated_files})
|
||||
|
||||
if (WIN32 OR APPLE)
|
||||
set(CPACK_GENERATOR ZIP)
|
||||
set(CPACK_STRIP_FILES ON)
|
||||
|
||||
@@ -38,24 +38,6 @@ public:
|
||||
void SetActiveModel(CModel *pModel);
|
||||
CModelEditorViewport* Viewport() const;
|
||||
|
||||
public slots:
|
||||
void RefreshViewport();
|
||||
void SetActiveMaterial(int MatIndex);
|
||||
void SetActivePass(int PassIndex);
|
||||
void UpdateMaterial();
|
||||
void UpdateMaterial(int Value);
|
||||
void UpdateMaterial(int ValueA, int ValueB);
|
||||
void UpdateMaterial(double Value);
|
||||
void UpdateMaterial(bool Value);
|
||||
void UpdateMaterial(QColor Value);
|
||||
void UpdateMaterial(QString Value);
|
||||
void UpdateUI(int Value);
|
||||
void UpdateAnimParamUI(EUVAnimMode Mode);
|
||||
|
||||
private:
|
||||
void ActivateMatEditUI(bool Active);
|
||||
void RefreshMaterial();
|
||||
|
||||
enum class EModelEditorWidget
|
||||
{
|
||||
SetSelectComboBox,
|
||||
@@ -99,6 +81,24 @@ private:
|
||||
AnimParamDSpinBox,
|
||||
};
|
||||
|
||||
public slots:
|
||||
void RefreshViewport();
|
||||
void SetActiveMaterial(int MatIndex);
|
||||
void SetActivePass(int PassIndex);
|
||||
void UpdateMaterial();
|
||||
void UpdateMaterial(int Value);
|
||||
void UpdateMaterial(int ValueA, int ValueB);
|
||||
void UpdateMaterial(double Value);
|
||||
void UpdateMaterial(bool Value);
|
||||
void UpdateMaterial(QColor Value);
|
||||
void UpdateMaterial(QString Value);
|
||||
void UpdateUI(int Value);
|
||||
void UpdateAnimParamUI(EUVAnimMode Mode);
|
||||
|
||||
private:
|
||||
void ActivateMatEditUI(bool Active);
|
||||
void RefreshMaterial();
|
||||
|
||||
private slots:
|
||||
void Import();
|
||||
void ConvertToDDS();
|
||||
|
||||
@@ -18,6 +18,7 @@ class CPoiMapSidebar : public CWorldEditorSidebar
|
||||
Q_OBJECT
|
||||
Ui::CPoiMapSidebar *ui;
|
||||
|
||||
public:
|
||||
enum class EHighlightMode
|
||||
{
|
||||
HighlightAll,
|
||||
@@ -25,10 +26,6 @@ class CPoiMapSidebar : public CWorldEditorSidebar
|
||||
HighlightSelected
|
||||
};
|
||||
|
||||
CPoiMapModel mSourceModel;
|
||||
QSortFilterProxyModel mModel;
|
||||
EHighlightMode mHighlightMode;
|
||||
|
||||
// Viewport Picking
|
||||
enum class EPickType
|
||||
{
|
||||
@@ -36,8 +33,14 @@ class CPoiMapSidebar : public CWorldEditorSidebar
|
||||
AddMeshes,
|
||||
RemoveMeshes,
|
||||
AddPOIs
|
||||
} mPickType;
|
||||
};
|
||||
|
||||
private:
|
||||
CPoiMapModel mSourceModel;
|
||||
QSortFilterProxyModel mModel;
|
||||
EHighlightMode mHighlightMode;
|
||||
|
||||
EPickType mPickType;
|
||||
CModelNode *mpHoverModel;
|
||||
|
||||
static const CColor skNormalColor;
|
||||
|
||||
Reference in New Issue
Block a user