diff --git a/CMakeLists.txt b/CMakeLists.txt index ebc3da37..db5eaef9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,190 +1,28 @@ cmake_minimum_required(VERSION 3.1) project(Lithtech) -if(NOT WIN32) - find_package(PkgConfig) - pkg_check_modules(DXVK dxvk-native) - if(DXVK_FOUND) - set(GL OFF) - set(VK ON) - else() - set(GL ON) - set(VK OFF) - endif() -endif() - -option(BUILD_ENGINE "Build engine" ON) -option(BUILD_NOLF2 "Build No One Lives Forever 2 game code" ON) -option(BUILD_TRON "Build Tron 2.0 game code" OFF) -option(BUILD_BLOOD2 "Build Blood II game code" OFF) -option(BUILD_FEAR "Build F.E.A.R. game code" OFF) -option(BUILD_NOLF "Build No One Lives Forever game code" OFF) -option(BUILD_SHOGO "Build Shogo game code" OFF) -option(BUILD_TOOLS "Build tools" OFF) -if(WIN32) option(ENABLE_D3D "Enable Direct3D" ON) -option(ENABLE_DIRECTX "Enable DirectX" ON) -option(ENABLE_DIRECTSHOW "Enable DirectShow" ON) -option(ENABLE_OPENAL "Use OpenAL as audio backend" OFF) -option(ENABLE_DIRECTMUSIC "Use DirectMusic as music backend" ON) -else(WIN32) -option(ENABLE_OPENGL "Enable OpenGL 3.3" ${GL}) -option(ENABLE_VULKAN "Enable Vulkan" OFF) -option(ENABLE_DXVK "Enable DXVK" ${VK}) -option(ENABLE_OPENAL "Use OpenAL as audio backend" ON) -option(ENABLE_DIRECTMUSIC OFF) -endif(WIN32) -option(USE_INTERNAL_ZLIB "Use bundled zlib" ON) # eventually want default to be OFF -option(USE_INTERNAL_FREETYPE "Use bundled freetype" ON) # eventually want default to be OFF - -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/OUT") -set(CMAKE_CXX_STANDARD 17) -set(CMAKE_CXX_STANDARD_REQUIRED 17) - -if (ENABLE_DXVK) - option(ENABLE_D3D "Enable Direct3D" ON) - pkg_check_modules(DXVK dxvk-native) - add_definitions(-DUSE_DXVK) - set(DXVK_INCLUDE_DIRS ${DXVK_INCLUDEDIR}/native/windows ${DXVK_INCLUDEDIR}/native/directx) - set(DXVK_LIB_DIRS ${DXVK_LIBDIR}) -endif() - -if (ENABLE_OPENAL AND NOT WIN32) - pkg_check_modules(OPENAL REQUIRED openal) - pkg_check_modules(MPG123 REQUIRED libmpg123) -endif() - -if(ENABLE_D3D) - add_definitions(-D__D3D -D__D3DREND) -endif(ENABLE_D3D) - - -if(WIN32) - add_definitions(-D_WINDOWS) -else(WIN32) - add_definitions(-D_LINUX -D__LINUX) - set(LINUX 1) -endif(WIN32) - -if(MSVC) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) -endif(MSVC) - -if(DEBUG) - add_definitions(-D_DEBUG) -else(DEBUG) - add_definitions(-D_FINAL) -endif(DEBUG) - - -if(USE_INTERNAL_ZLIB) - #set zlib vars - add_subdirectory(libs/zlib) # LIB_ZLib -else(USE_INTERNAL_ZLIB) - find_package(ZLIB) -endif(USE_INTERNAL_ZLIB) - -# move to Lib_UI CMakeLists.txt? -if(USE_INTERNAL_FREETYPE) - #set freetype vars -else(USE_INTERNAL_FREETYPE) - find_package(Freetype) -endif(USE_INTERNAL_FREETYPE) - - -add_subdirectory(libs/lith) # LIB_Lith -add_subdirectory(libs/stdlith) # LIB_StdLith -add_subdirectory(libs/ltmem) # LIB_LTMem -add_subdirectory(libs/rezmgr) # LIB_RezMgr -add_subdirectory(libs/RandomGen) # LIB_Random - -if(LINUX) - set(JSON_BuildTests off) - add_subdirectory(libs/DynRes) - add_subdirectory(json) -endif(LINUX) - -if(BUILD_ENGINE) - add_subdirectory(runtime/ui) # LIB_UI - add_subdirectory(runtime/info) # LIB_Info - add_subdirectory(runtime/sound) # LIB_ILTSound - add_subdirectory(runtime/server) # DLL_Server - add_subdirectory(runtime/client) # EXE_Lithtech - - if(ENABLE_D3D) - add_subdirectory(runtime/render_a/src/sys/d3d) # LIB_D3DRender - endif(ENABLE_D3D) - if(WIN32) - if(NOT ENABLE_OPENAL) - add_subdirectory(runtime/sound/src/sys/s_dx8) # DLL_SndDrvDX8 - endif(NOT ENABLE_OPENAL) - - if(ENABLE_DIRECTSHOW) - add_subdirectory(libs/dshow) # LIB_DShow - endif(ENABLE_DIRECTSHOW) - add_subdirectory(runtime/winbuild/ltmsg) # DLL_LTMsg - endif(WIN32) -endif(BUILD_ENGINE) +add_definitions(-D__D3D -D__D3DREND) +add_definitions(-D_WINDOWS) +add_definitions(-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE) -if(BUILD_NOLF2) - add_subdirectory(libs/MFCStub) # LIB_MFCStub - add_subdirectory(libs/ButeMgr) # LIB_ButeMgr - add_subdirectory(libs/CryptMgr) # LIB_CryptMgr - add_subdirectory(libs/RegMgr) # LIB_RegMgr - add_subdirectory(libs/LTGUIMgr) # LIB_LTGUIMgr - add_subdirectory(libs/ServerDir) # ServerDir - add_subdirectory(libs/WONAPI) # LIB_WONAPI - add_subdirectory(NOLF2/ClientFxDLL) # ClientFXDLL - add_subdirectory(NOLF2/ClientRes/TO2) # ClientRes - add_subdirectory(NOLF2/ClientShellDLL/TO2) # ClientShellDLL - add_subdirectory(NOLF2/ObjectDLL/TO2) # ObjectDLL - add_subdirectory(NOLF2/ServerRes/TO2) # ServerRes -endif(BUILD_NOLF2) +add_subdirectory(libs/zlib) +add_subdirectory(libs/stdlith) -if(BUILD_FEAR) - if(NOT BUILD_NOLF2) - add_subdirectory(libs/MFCStub) # LIB_MFCStub - add_subdirectory(libs/ButeMgr) # LIB_ButeMgr - add_subdirectory(libs/CryptMgr) # LIB_CryptMgr - add_subdirectory(libs/RegMgr) # LIB_RegMgr - add_subdirectory(libs/LTGUIMgr) # LIB_LTGUIMgr - add_subdirectory(libs/ServerDir) # ServerDir - add_subdirectory(libs/WONAPI) # LIB_WONAPI - endif(NOT BUILD_NOLF2) - add_subdirectory(FEAR/ClientFxDLL) # ClientFXDLL -# add_subdirectory(NOLF2/ClientRes/TO2) # ClientRes - add_subdirectory(FEAR/ClientShellDLL) # ClientShellDLL -# add_subdirectory(NOLF2/ObjectDLL/TO2) # ObjectDLL -# add_subdirectory(NOLF2/ServerRes/TO2) # ServerRes -endif(BUILD_FEAR) +#add_subdirectory(runtime/render_a/src/sys/d3d) +add_subdirectory(libs/RegMgr) +add_subdirectory(libs/genregmgr) +add_subdirectory(libs/MFCStub) +add_subdirectory(libs/CryptMgr) +add_subdirectory(libs/ButeMgr) +add_subdirectory(libs/ltamgr) +add_subdirectory(libs/dibmgr) +add_subdirectory(libs/rezmgr) +add_subdirectory(libs/lith) -if(BUILD_TRON) - if(NOT BUILD_NOLF2) - add_subdirectory(libs/MFCStub) - add_subdirectory(libs/ButeMgr) - add_subdirectory(libs/CryptMgr) - add_subdirectory(libs/RegMgr) - add_subdirectory(libs/LTGUIMgr) - add_subdirectory(libs/ServerDir) - add_subdirectory(libs/WONAPI) - add_subdirectory(NOLF2/ClientFxDLL) # ClientFXDLL - endif(NOT BUILD_NOLF2) - add_subdirectory(NOLF2/ClientRes/TRON) # ClientRes - add_subdirectory(NOLF2/ClientShellDLL/TRON) # ClientShellDLL - add_subdirectory(NOLF2/ObjectDLL/TRON) # ObjectDLL - add_subdirectory(NOLF2/ServerRes/TRON) # ServerRes -endif(BUILD_TRON) +add_subdirectory(tools/shared/model) +add_subdirectory(tools/shared/world) -if(BUILD_TOOLS) - add_subdirectory(tools/DtxView) # TOOLS_DtxView - add_subdirectory(tools/LithRez) # TOOLS_LithRez -endif(BUILD_TOOLS) +add_subdirectory(tools/DEdit) # TOOLS_DEdit -if(NOT WIN32) -add_subdirectory(tests/RegMgr) -add_subdirectory(tests/CShell) -add_subdirectory(tests/DynRes) -add_subdirectory(tests/DynResDLL) -add_subdirectory(tests/rndgen) -endif(NOT WIN32) diff --git a/libs/ButeMgr/CMakeLists.txt b/libs/ButeMgr/CMakeLists.txt index 88fcd173..8973a904 100644 --- a/libs/ButeMgr/CMakeLists.txt +++ b/libs/ButeMgr/CMakeLists.txt @@ -6,7 +6,7 @@ add_library(${PROJECT_NAME} STATIC butemgr.cpp stdafx.cpp) -add_definitions(-D_NOMFC) +add_definitions(-D_AFXDLL -D_WIN32_WINNT=0x501) if(MSVC) add_definitions(-D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS) # VC14 deprecated stdext::hash_* endif(MSVC) diff --git a/libs/ButeMgr/stdafx.h b/libs/ButeMgr/stdafx.h index 9ab5924a..45c4a0f6 100644 --- a/libs/ButeMgr/stdafx.h +++ b/libs/ButeMgr/stdafx.h @@ -7,5 +7,5 @@ #if defined(WIN32) #include #endif -#include "mfcstub.h" +//#include "mfcstub.h" #endif diff --git a/libs/dibmgr/CMakeLists.txt b/libs/dibmgr/CMakeLists.txt new file mode 100644 index 00000000..d5121ac3 --- /dev/null +++ b/libs/dibmgr/CMakeLists.txt @@ -0,0 +1,12 @@ +project(LIB_dibmgr) + +add_definitions(-D_AFXDLL -D_WIN32_WINNT=0x501) + +set(libsources + dib.cpp + dibmgr.cpp + dibpal.cpp) + +add_library(${PROJECT_NAME} STATIC ${libsources}) + +include_directories(../../sdk/inc) \ No newline at end of file diff --git a/libs/genregmgr/CMakeLists.txt b/libs/genregmgr/CMakeLists.txt new file mode 100644 index 00000000..e0eb97d6 --- /dev/null +++ b/libs/genregmgr/CMakeLists.txt @@ -0,0 +1,9 @@ +project(LIB_GenRegMgr) + +add_library(${PROJECT_NAME} STATIC + genregmgr.cpp) + +include_directories(../lith + ${CMAKE_SOURCE_DIR}/cppcodec + ${CMAKE_SOURCE_DIR}/json/single_include) + diff --git a/libs/ltamgr/CMakeLists.txt b/libs/ltamgr/CMakeLists.txt new file mode 100644 index 00000000..88552f78 --- /dev/null +++ b/libs/ltamgr/CMakeLists.txt @@ -0,0 +1,23 @@ +project(LIB_ltamgr) + +set(libsources + ltabitfile.cpp + ltacompressedfile.cpp + ltaconverter.cpp + ltafile.cpp + ltafilebuffer.cpp + ltahuffmantree.cpp + ltaloadonlyalloc.cpp + ltanode.cpp + ltanodebuilder.cpp + ltanodeiterator.cpp + ltanodreader.cpp + ltanodewriter.cpp + ltareader.cpp + ltautil.cpp + ltawriter.cpp + lzsswindow.cpp) + +add_library(${PROJECT_NAME} STATIC ${libsources}) + +include_directories(../../sdk/inc) \ No newline at end of file diff --git a/libs/ltamgr/ltaconverter.h b/libs/ltamgr/ltaconverter.h index ce5ab759..a9fee997 100644 --- a/libs/ltamgr/ltaconverter.h +++ b/libs/ltamgr/ltaconverter.h @@ -16,6 +16,8 @@ #include "ltbasedefs.h" +#undef StrToInt + class CLTAConverter { public: diff --git a/libs/ltamgr/ltahuffmantree.cpp b/libs/ltamgr/ltahuffmantree.cpp index 5b519fdc..cf94c04a 100644 --- a/libs/ltamgr/ltahuffmantree.cpp +++ b/libs/ltamgr/ltahuffmantree.cpp @@ -234,7 +234,8 @@ bool CLTAHuffmanTree::IncrementWeight(uint8 nItem) pCurr->SetWeight(pCurr->GetWeight() + 1); //see if we need to swap it - for(uint32 nTestNode = pCurr->GetWeightIndex(); nTestNode > 0; nTestNode--) + uint32 nTestNode; + for(nTestNode = pCurr->GetWeightIndex(); nTestNode > 0; nTestNode--) { if(m_pWeights[nTestNode - 1]->GetWeight() >= pCurr->GetWeight()) { diff --git a/libs/ltamgr/ltaparseutils.h b/libs/ltamgr/ltaparseutils.h index c88dd8f1..6386a657 100644 --- a/libs/ltamgr/ltaparseutils.h +++ b/libs/ltamgr/ltaparseutils.h @@ -17,6 +17,8 @@ # include "ltanode.h" #endif +#undef StrToInt + //determines if the node is a list and if it has 2 elements inline bool IsPair( const CLTANode* pNode ); diff --git a/libs/rezmgr/CMakeLists.txt b/libs/rezmgr/CMakeLists.txt index 00838bad..b880b854 100644 --- a/libs/rezmgr/CMakeLists.txt +++ b/libs/rezmgr/CMakeLists.txt @@ -8,6 +8,9 @@ add_library(${PROJECT_NAME} STATIC include_directories(../../sdk/inc ../lith) + +target_link_libraries(${PROJECT_NAME} + LIB_Lith) if(LINUX) set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fpermissive -fPIC") diff --git a/runtime/model/CMakeLists.txt b/runtime/model/CMakeLists.txt new file mode 100644 index 00000000..3797ef29 --- /dev/null +++ b/runtime/model/CMakeLists.txt @@ -0,0 +1,32 @@ +project(LIB_Model) + +find_package(SDL2 REQUIRED) + +set(libsources + src/animtracker.cpp + src/model.cpp + src/model_load.cpp + src/model_ops.cpp + src/modelallocations.cpp + src/transformmaker.cpp) + +if(ENABLE_D3D) + set(libsources ${libsources} + src/sys/d3d/d3d_model_load.cpp) + include_directories(sys/d3d) +endif(ENABLE_D3D) + +include_directories(src + ../../sdk/inc + ../../libs/stdlith + ../shared/src + ../kernel/src + ../kernel/mem/src + ../lithtemplate + ../world/src + ../kernel/src/sys/win + ../shared/src/sys/win + ../../tools/shared/model + ${SDL2_INCLUDE_DIRS}) + +add_library(${PROJECT_NAME} STATIC ${libsources}) \ No newline at end of file diff --git a/runtime/render_a/src/sys/d3d/CMakeLists.txt b/runtime/render_a/src/sys/d3d/CMakeLists.txt index 364797f5..fb695268 100644 --- a/runtime/render_a/src/sys/d3d/CMakeLists.txt +++ b/runtime/render_a/src/sys/d3d/CMakeLists.txt @@ -119,5 +119,5 @@ set_property(TARGET ${PROJECT_NAME} if(WIN32) # FIXME: find directx path add_definitions(-DUSE_ID3DXEFFECT) - include_directories("C:\\Program Files (x86)\\Microsoft DirectX SDK (August 2007)\\Include") + include_directories("D:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Include") endif(WIN32) diff --git a/runtime/render_a/src/sys/d3d/d3d_texture.cpp b/runtime/render_a/src/sys/d3d/d3d_texture.cpp index aa472a7b..afb66b8a 100644 --- a/runtime/render_a/src/sys/d3d/d3d_texture.cpp +++ b/runtime/render_a/src/sys/d3d/d3d_texture.cpp @@ -374,9 +374,14 @@ struct tex { struct cube_tex : public tex { LPDIRECT3DCUBETEXTURE9 pD3DDstTexture; D3DCUBEMAP_FACES i; + + // Constructor for cube_tex + cube_tex(const tex& t) : tex(t) {} }; struct norm_tex : public tex { LPDIRECT3DTEXTURE9 pD3DDstTexture; + + norm_tex(const tex& t) : tex(t) {} }; HRESULT copyCubeTexture(const cube_tex& t ) @@ -453,7 +458,7 @@ bool CTextureManager::UploadRTexture(TextureData* pSrcTexture, uint32 iSrcLvl, R if (pDstTexture->IsCubeMap()) { // Cube map texture... - cube_tex t{t_i}; + cube_tex t(t_i); t.pD3DDstTexture = pDstTexture->m_pD3DCubeTexture; for (uint32 i = 0; i < 6; ++i) { @@ -465,7 +470,7 @@ bool CTextureManager::UploadRTexture(TextureData* pSrcTexture, uint32 iSrcLvl, R else { // Normal texture.. - norm_tex t{t_i}; + norm_tex t(t_i); t.pD3DDstTexture = pDstTexture->m_pD3DTexture; if (copyNormalTexture(t) != D3D_OK) return false; diff --git a/sdk/inc/ltbasedefs.h b/sdk/inc/ltbasedefs.h index a06eaef0..a05b7033 100644 --- a/sdk/inc/ltbasedefs.h +++ b/sdk/inc/ltbasedefs.h @@ -1544,7 +1544,7 @@ Sets it up to parse the specified buffer. /*! The parsed arguments. */ - const char *m_Args[PARSE_MAXTOKENS]; + char *m_Args[PARSE_MAXTOKENS]; int m_nArgs; /*! @@ -1567,7 +1567,7 @@ You can use this just like Parse like this: while(ParseFind("AmbientLight", false)) { ... } */ - bool ParseFind(const char *pLookFor, bool bCaseSensitive, uint32 minTokens=1); + bool ParseFind(char *pLookFor, bool bCaseSensitive, uint32 minTokens=1); private: const char *m_pCommandPos; diff --git a/sdk/inc/ltserverobj.h b/sdk/inc/ltserverobj.h index e7f16f4e..d9977e1b 100644 --- a/sdk/inc/ltserverobj.h +++ b/sdk/inc/ltserverobj.h @@ -232,8 +232,8 @@ class DEditInternal; struct PropDef { - PropDef(const char *pName, short type, LTVector valVec, - float valFloat, const char *valString, unsigned long propFlags) + PropDef(char *pName, short type, LTVector valVec, + float valFloat, char *valString, unsigned long propFlags) { m_PropName = pName; m_PropType = type; @@ -245,7 +245,7 @@ struct PropDef { m_pDEditInternal = 0; } - const char *m_PropName; + char *m_PropName; /*! One of the \b PT_ defines above. @@ -258,7 +258,7 @@ Default vector/color value. LTVector m_DefaultValueVector; float m_DefaultValueFloat; - const char *m_DefaultValueString; + char *m_DefaultValueString; unsigned long m_PropFlags; @@ -290,7 +290,7 @@ struct ClassDef { public: - const char *m_ClassName; + char *m_ClassName; ClassDef *m_ParentClass; /*! diff --git a/tools/DEdit/AllTextureDlg.cpp b/tools/DEdit/AllTextureDlg.cpp index 236e7ff8..b97b5e45 100644 --- a/tools/DEdit/AllTextureDlg.cpp +++ b/tools/DEdit/AllTextureDlg.cpp @@ -178,7 +178,8 @@ void CAllTextureDlg::FillTextureList() if(pIdent) { // Find a location for the entry - for (int iIndex = 0; iIndex < m_TextureList.GetCount(); iIndex++) + int iIndex = 0; + for (iIndex = 0; iIndex < m_TextureList.GetCount(); iIndex++) { CString csHold; m_TextureList.GetText(iIndex, csHold); diff --git a/tools/DEdit/CMakeLists.txt b/tools/DEdit/CMakeLists.txt new file mode 100644 index 00000000..b6a3e17b --- /dev/null +++ b/tools/DEdit/CMakeLists.txt @@ -0,0 +1,311 @@ +project(TOOLS_DEdit) + +file(GLOB DEdit_SRC + "*.h" + "*.cpp" +) + +find_package(SDL2 REQUIRED) + +add_definitions(-D_AFX_NO_OCC_SUPPORT -DDIRECT3D_VERSION=0x0700 -DCMAKE_GENERATOR_PLATFORM=Win32 -DWIN32 -D_WINDOWS -DDIRECTEDITOR_BUILD -DSTDLITH_MFC -DBDEFS_MFC -DPRE_FLOAT -DPREPROCESSOR_BUILD -DNO_PRAGMA_LIBS -DLT15_COMPAT -D_AFXDLL -D_WIN32_WINNT=0x501 -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -DUSE_ID3DXEFFECT) +link_directories("${CMAKE_CURRENT_SOURCE_DIR}/../shared/world/") + +add_executable(${PROJECT_NAME} WIN32 + DEdit.cpp + AllTextureDlg.cpp + BaseImgDlg.cpp + baserezdlg.cpp + bindkeydlg.cpp + ClassList.cpp + ColorPicker.cpp + ColorWell.cpp + CylinderPrimDlg.cpp + DEdit.cpp + dedit_concommand.cpp + ExportObjFile.cpp + FilePalette.cpp + globalhotkeydb.cpp + hotkey.cpp + hotkeydb.cpp + ImportObjFileFormat.cpp + keyconfigdlg.cpp + LoadLTADialog.cpp + MapTextureCoordsDlg.cpp + ModelDlg.cpp + mtreectl.cpp + MultiLineStringDlg.cpp + NodeView.cpp + NodeViewTreeCtrl.cpp + ObjectImporter.cpp + OptionsSheet.cpp + PaletteEdit.cpp + PrefabDlg.cpp + ResizeDlg.cpp + ResNewDir.cpp + ResourceMgr.cpp + RotateSelection.cpp + SoundDlg.cpp + SpriteDlg.cpp + TextureDlg.cpp + TextureProp.cpp + UIEvent.cpp + UndoPage.cpp + UpdateAllObjects.cpp + VectorButton.cpp + VectorEdit.cpp + WorldsDlg.cpp + ../../runtime/shared/src/converge.cpp + ../shared/engine/load_pcx.cpp + Controls/ClassTree.cpp + Controls/ColumnCtrl.cpp + Controls/FrameList.cpp + Controls/ProjectBar.cpp + Controls/ProjectDirDlg.cpp + Controls/ProjectTabControlBar.cpp + Controls/ProjectTabCtrl.cpp + Controls/PropEditString.cpp + Controls/PropEditStringList.cpp + Controls/ResizeBar.cpp + Dlgs/AddObjectDlg.cpp + Dlgs/AdvancedSelectDlg.cpp + Dlgs/AdvancedSelectPropertyDlg.cpp + Dlgs/AlphaFromColorDlg.cpp + Dlgs/AutoTextureOptionsDlg.cpp + Dlgs/CameraFOVDlg.cpp + Dlgs/ClassDlg.cpp + Dlgs/ClassListDlg.cpp + Dlgs/ColorSelectDlg.cpp + Dlgs/DebugDlg.cpp + Dlgs/DirDialog.cpp + Dlgs/EditEffectGroupDlg.cpp + Dlgs/ErrorInformationDlg.cpp + Dlgs/EventEditorDlg.cpp + Dlgs/EventListDlg.cpp + Dlgs/GenerateUniqueNamesDlg.cpp + Dlgs/ImportBumpMapDlg.cpp + Dlgs/ImportCubeMapDlg.cpp + Dlgs/ImportObjectDlg.cpp + Dlgs/LevelErrorDlg.cpp + Dlgs/LevelErrorOptionsDlg.cpp + Dlgs/LevelItemsDlg.cpp + Dlgs/leveltexturesdlg.cpp + Dlgs/LevelTexturesOptionsDlg.cpp + Dlgs/LightAttenuation.cpp + Dlgs/NameChangeReportDlg.cpp + Dlgs/navigatordlg.cpp + Dlgs/NavigatorStoreDlg.cpp + Dlgs/NewProjectDlg.cpp + Dlgs/ObjectBrowserDlg.cpp + Dlgs/ObjectSearchDlg.cpp + Dlgs/ObjectSelFilterDlg.cpp + Dlgs/ObjectTrackerDlg.cpp + Dlgs/PlanePrimitiveDlg.cpp + Dlgs/PopupNoteDlg.cpp + Dlgs/PrefabTrackerDlg.cpp + Dlgs/PropertiesDlg.cpp + Dlgs/PropPageDisplay.cpp + Dlgs/PropPageOptionsClipboard.cpp + Dlgs/PropPageOptionsControls.cpp + Dlgs/PropPageOptionsD3D.cpp + Dlgs/PropPageOptionsLighting.cpp + Dlgs/PropPageOptionsMisc.cpp + Dlgs/PropPageOptionsModels.cpp + Dlgs/PropPageOptionsPrefabs.cpp + Dlgs/PropPageOptionsRun.cpp + Dlgs/RenameResourceDlg.cpp + Dlgs/RotationEdit.cpp + Dlgs/ScaleSelectDlg.cpp + Dlgs/SelectEffectGroupDlg.cpp + Dlgs/SolidAlphaDlg.cpp + Dlgs/SpherePrimitiveDlg.cpp + Dlgs/SpriteEditDlg.cpp + Dlgs/StringDlg.cpp + Dlgs/TextureSearchReplaceDlg.cpp + Dlgs/TextureTrackerDlg.cpp + Dlgs/UndoWarningDlg.cpp + Dlgs/WorldInfoDlg.cpp + Docs/PropertyHelpers.cpp + Docs/RegionDoc.cpp + draw/CCS.cpp + draw/d3d_texturemgr.cpp + draw/DibBuffer.cpp + draw/DrawBase.cpp + draw/draw_d3d.cpp + draw/Navigator.cpp + draw/UsefulDC.cpp + draw/UsefulDib.cpp + draw/ViewDef.cpp + FileFormats/CObjInterface.cpp + Frames/ChildFrm.cpp + Frames/coolbar.cpp + Frames/DEDockFrameWnd.cpp + Frames/flattoolbar.cpp + Frames/MainFrm.cpp + Frames/RegionFrame.cpp + KeyAggregate/KeyDefaultAggregate.cpp + KeyAggregate/KeyDefaultFactory.cpp + LevelError/Detectors.cpp + LevelError/ErrorDetector.cpp + LevelError/LevelError.cpp + LevelError/LevelErrorDB.cpp + Lightmap/DEditLightMapMgr.cpp + Lightmap/HolderList.cpp + Lightmap/LightMapAllocator.cpp + Lightmap/LightMapData.cpp + Lightmap/LightMapGenerator.cpp + Lightmap/LMSampleGen.cpp + Lightmap/ShadowCalc.cpp + Lightmap/SurfaceLMTextureMgr.cpp + Misc/EditHelpers.cpp + Misc/EditorTransfer.cpp + Misc/FileUtils.cpp + Misc/Splash.cpp + Misc/Texture.cpp + ModelView/meshshape.cpp + ModelView/meshshapelist.cpp + ModelView/modelmesh.cpp + ModelView/modelmgr.cpp + MRCEXT/DRAGDOCK.CPP + MRCEXT/FRAMEWND.CPP + MRCEXT/MDIFLOAT.CPP + MRCEXT/MRCButton.cpp + MRCEXT/SIZECONT.CPP + MRCEXT/SIZEDLG.CPP + MRCEXT/SIZEDOCK.CPP + MRCEXT/SZTOOLBA.CPP + Options/DEditOptions.cpp + Options/OptionsAdvancedSelect.cpp + Options/OptionsBase.cpp + Options/OptionsClassDialog.cpp + Options/OptionsClipboard.cpp + Options/OptionsControls.cpp + Options/OptionsDisplay.cpp + Options/OptionsGenerateUniqueNames.cpp + Options/OptionsLighting.cpp + Options/OptionsMisc.cpp + Options/OptionsModels.cpp + Options/OptionsObjectBrowser.cpp + Options/OptionsPrefabs.cpp + Options/OptionsPrimitives.cpp + Options/OptionsRun.cpp + Options/OptionsViewports.cpp + Options/OptionsWarnings.cpp + Options/OptionsWindows.cpp + Project/d_filemgr.cpp + Project/EditProjectMgr.cpp + RegionEdit/AdvancedSelect.cpp + RegionEdit/CreatePrimitive.cpp + RegionEdit/EditClipboard.cpp + RegionEdit/EditGrid.cpp + RegionEdit/edit_actions.cpp + RegionEdit/Refs.cpp + RegionEdit/undo_mgr.cpp + RegionEdit/ViewFunctions.cpp + RegionEdit/viewrender.cpp + Trackers/RVCommand.cpp + Trackers/RVTracker.cpp + Trackers/RVTrackerBrushSize.cpp + Trackers/RVTrackerCurveEdit.cpp + Trackers/RVTrackerDrawPoly.cpp + Trackers/RVTrackerExtrudePoly.cpp + Trackers/RVTrackerFarDist.cpp + Trackers/RVTrackerFocus.cpp + Trackers/RVTrackerGridSize.cpp + Trackers/RVTrackerMarkerMove.cpp + Trackers/RVTrackerMenuItem.cpp + Trackers/RVTrackerNavArcRotate.cpp + Trackers/RVTrackerNavDrag.cpp + Trackers/RVTrackerNavMove.cpp + Trackers/RVTrackerNavOrbit.cpp + Trackers/RVTrackerNavRotate.cpp + Trackers/RVTrackerNodeMove.cpp + Trackers/RVTrackerNodeRotate.cpp + Trackers/RVTrackerObjectSize.cpp + Trackers/RVTrackerPolyScale.cpp + Trackers/RVTrackerTag.cpp + Trackers/RVTrackerTextMove.cpp + Trackers/RVTrackerTextWrap.cpp + Trackers/RVTrackerVertMove.cpp + Trackers/RVTrackerVertScale.cpp + Trackers/RVTrackerVertSnap.cpp + Trackers/RVTrackerZoom.cpp + Trackers/TrackerMgr.cpp + Views/RegionView.cpp + Views/RegionViewInitTracker.cpp + ../../runtime/kernel/src/sys/win/streamsim.cpp + ../../runtime/shared/src/version_info.cpp + ../shared/engine/geomroutines.cpp + ../shared/engine/dtxmgr.cpp + ../shared/engine/pixelformat.cpp + ../shared/engine/simple_dalloc.cpp + ../shared/engine/genltstream.cpp + ../shared/engine/dhashtable.cpp + ../shared/engine/classbind.cpp + ../shared/engine/bindmgr.cpp + ../shared/engine/dsys_interface.cpp + ../shared/engine/version_resource.cpp + ../shared/engine/concommand.cpp + ../shared/engine/bdefs.cpp + ../shared/model/ltaScene.cpp + ../../sdk/inc/ltquatbase.cpp) + +target_sources(${PROJECT_NAME} + PRIVATE dedit.rc) + +set_target_properties(${PROJECT_NAME} + PROPERTIES OUTPUT_NAME DEdit) + +include_directories(./ + ../../runtime/kernel/src + ../shared/engine + ../../libs/stdlith + ../../sdk/inc + ../PreProcessor + ../shared/world + ../dedit/misc + Controls + Dlgs + Docs + draw + FileFormats + Frames + KeyAggregate + LevelError + Lightmap + ModelView + MRCEXT + Options + Project + RegionEdit + res + Trackers + Views + ../../libs/genregmgr + ../../libs/butemgr + ../../libs/dibmgr + ../../libs/cryptmgr + ../../libs/regmgr + ../../libs/lith + ../../libs/ltamgr + ../../libs/rezmgr + ../shared/model + MRCEXT/VC_HEADERS + ${SDL2_INCLUDE_DIRS}) + +target_link_libraries(${PROJECT_NAME} + LIB_StdLith + LIB_ButeMgr + LIB_ToolModel + LIB_CryptMgr + LIB_GenRegMgr + LIB_ToolWorld + LIB_ltamgr + LIB_dibmgr + LIB_RezMgr + LIB_RegMgr + s3tc + winmm + ddraw + dxguid) + +set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "/SAFESEH:NO /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:libc.lib") # needed for s3tc.lib :/ diff --git a/tools/DEdit/DEdit.cpp b/tools/DEdit/DEdit.cpp index 96f7bf43..a2296243 100644 --- a/tools/DEdit/DEdit.cpp +++ b/tools/DEdit/DEdit.cpp @@ -170,12 +170,12 @@ CDEditApp theApp; BOOL CDEditApp::InitInstance() { - if (!TdGuard::Aegis::GetSingleton().Init() || - !TdGuard::Aegis::GetSingleton().DoWork()) - { - ExitProcess(0); - return FALSE; - } + //if (!TdGuard::Aegis::GetSingleton().Init() || + // !TdGuard::Aegis::GetSingleton().DoWork()) + //{ + // ExitProcess(0); + // return FALSE; + //} //initialize the global hotkey database, and then overwrite the configuration with //that found in the registry (this allows new keys to be added to the database diff --git a/tools/DEdit/Dlgs/AddObjectDlg.cpp b/tools/DEdit/Dlgs/AddObjectDlg.cpp index b9b9075a..00645f3c 100644 --- a/tools/DEdit/Dlgs/AddObjectDlg.cpp +++ b/tools/DEdit/Dlgs/AddObjectDlg.cpp @@ -76,14 +76,14 @@ BOOL CAddObjectDlg::OnInitDialog() m_ObjectTree.DeleteAllItems(); - hItem = m_ObjectTree.InsertItem( g_BaseTypeName ); - m_ObjectTree.InsertItem( g_LightTypeName, hItem ); - m_ObjectTree.InsertItem( g_ModelTypeName, hItem ); - m_ObjectTree.InsertItem( g_SpriteTypeName, hItem ); - m_ObjectTree.InsertItem( g_SoundTypeName, hItem ); - - m_ObjectTree.Expand( hItem, TVE_EXPAND ); - m_ObjectTree.SelectItem( hItem ); + //hItem = m_ObjectTree.InsertItem( g_BaseTypeName ); + //m_ObjectTree.InsertItem( g_LightTypeName, hItem ); + //m_ObjectTree.InsertItem( g_ModelTypeName, hItem ); + //m_ObjectTree.InsertItem( g_SpriteTypeName, hItem ); + //m_ObjectTree.InsertItem( g_SoundTypeName, hItem ); + + //m_ObjectTree.Expand( hItem, TVE_EXPAND ); + //m_ObjectTree.SelectItem( hItem ); m_ObjectTree.SetFocus(); diff --git a/tools/DEdit/Dlgs/AdvancedSelectPropertyDlg.cpp b/tools/DEdit/Dlgs/AdvancedSelectPropertyDlg.cpp index f29caedc..a547c8e6 100644 --- a/tools/DEdit/Dlgs/AdvancedSelectPropertyDlg.cpp +++ b/tools/DEdit/Dlgs/AdvancedSelectPropertyDlg.cpp @@ -31,19 +31,19 @@ void CAdvancedSelectPropertyDlg::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CAdvancedSelectPropertyDlg) - DDX_Text(pDX, IDC_EDIT_PROPERTY_NAME, m_sName); - DDX_Text(pDX, IDC_EDIT_PROPERTY_VALUE, m_sValue); - DDX_CBIndex(pDX, IDC_COMBO_PROPERTY_TYPES, m_nSelPropertyIndex); + //DDX_Text(pDX, IDC_EDIT_PROPERTY_NAME, m_sName); + //DDX_Text(pDX, IDC_EDIT_PROPERTY_VALUE, m_sValue); + //DDX_CBIndex(pDX, IDC_COMBO_PROPERTY_TYPES, m_nSelPropertyIndex); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CAdvancedSelectPropertyDlg, CDialog) //{{AFX_MSG_MAP(CAdvancedSelectPropertyDlg) - ON_CBN_SELCHANGE(IDC_COMBO_PROPERTY_TYPES, OnSelchangeComboPropertyTypes) - ON_EN_CHANGE(IDC_EDIT_PROPERTY_VALUE, OnChangeEditPropertyValue) - ON_EN_CHANGE(IDC_EDIT_PROPERTY_NAME, OnChangeEditPropertyName) - ON_BN_CLICKED(IDC_BUTTON_COLOR_PICK, OnButtonColorPick) + //ON_CBN_SELCHANGE(IDC_COMBO_PROPERTY_TYPES, OnSelchangeComboPropertyTypes) + //ON_EN_CHANGE(IDC_EDIT_PROPERTY_VALUE, OnChangeEditPropertyValue) + //ON_EN_CHANGE(IDC_EDIT_PROPERTY_NAME, OnChangeEditPropertyName) + //ON_BN_CLICKED(IDC_BUTTON_COLOR_PICK, OnButtonColorPick) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -55,7 +55,7 @@ BOOL CAdvancedSelectPropertyDlg::OnInitDialog() CDialog::OnInitDialog(); // Update the formatting text - GetDlgItem(IDC_STATIC_FORMATTING_TEXT)->SetWindowText(GetSelectedFormattingText()); + //GetDlgItem(IDC_STATIC_FORMATTING_TEXT)->SetWindowText(GetSelectedFormattingText()); // Update the enabled status of the controls UpdateEnabledStatus(); @@ -69,7 +69,7 @@ void CAdvancedSelectPropertyDlg::OnSelchangeComboPropertyTypes() UpdateData(); // Update the formatting text - GetDlgItem(IDC_STATIC_FORMATTING_TEXT)->SetWindowText(GetSelectedFormattingText()); + //GetDlgItem(IDC_STATIC_FORMATTING_TEXT)->SetWindowText(GetSelectedFormattingText()); // Clear the Value string m_sValue=""; @@ -144,12 +144,12 @@ CBaseProp *CAdvancedSelectPropertyDlg::AllocPropertyFromData() // Set the property data DRotation rotation; - sscanf(m_sValue, "%f %f %f", &rotation.m_Vec.y, &rotation.m_Vec.x, &rotation.m_Vec.z); + sscanf(m_sValue, "%f %f %f", &rotation.m_Quat[1], &rotation.m_Quat[0], &rotation.m_Quat[2]); // Convert from degrees to radians... - VEC_MULSCALAR(rotation.m_Vec, rotation.m_Vec, MATH_CIRCLE / 360.0f); + //VEC_MULSCALAR(rotation.m_Vec, rotation.m_Vec, MATH_CIRCLE / 360.0f); - ((CRotationProp *)pProperty)->m_Rotation=rotation; + //((CRotationProp *)pProperty)->m_Rotation=rotation; break; } case PT_COLOR: @@ -370,11 +370,11 @@ void CAdvancedSelectPropertyDlg::UpdateEnabledStatus() // the Pick button. if (GetPropertyTypeFromIndex(m_nSelPropertyIndex) == PT_COLOR) { - GetDlgItem(IDC_BUTTON_COLOR_PICK)->ShowWindow(SW_SHOW); + //GetDlgItem(IDC_BUTTON_COLOR_PICK)->ShowWindow(SW_SHOW); } else { - GetDlgItem(IDC_BUTTON_COLOR_PICK)->ShowWindow(SW_HIDE); + //GetDlgItem(IDC_BUTTON_COLOR_PICK)->ShowWindow(SW_HIDE); } } diff --git a/tools/DEdit/Dlgs/AdvancedSelectPropertyDlg.h b/tools/DEdit/Dlgs/AdvancedSelectPropertyDlg.h index 89fdc305..53e90086 100644 --- a/tools/DEdit/Dlgs/AdvancedSelectPropertyDlg.h +++ b/tools/DEdit/Dlgs/AdvancedSelectPropertyDlg.h @@ -18,7 +18,7 @@ class CAdvancedSelectPropertyDlg : public CDialog // Dialog Data //{{AFX_DATA(CAdvancedSelectPropertyDlg) - enum { IDD = IDD_ADVANCEDSELECT_PROPERTY }; + enum { IDD = 0 }; CString m_sName; CString m_sValue; int m_nSelPropertyIndex; diff --git a/tools/DEdit/Dlgs/ColorSelectDlg.h b/tools/DEdit/Dlgs/ColorSelectDlg.h index 637e82bb..ae1eae2b 100644 --- a/tools/DEdit/Dlgs/ColorSelectDlg.h +++ b/tools/DEdit/Dlgs/ColorSelectDlg.h @@ -9,6 +9,8 @@ #include "resource.h" #include "dibmgr.h" + #include "bdefs.h" + #include "dynarray.h" // Callback for when the color changes.. diff --git a/tools/DEdit/Dlgs/LightAttenuation.cpp b/tools/DEdit/Dlgs/LightAttenuation.cpp index 2caee3a4..645ab275 100644 --- a/tools/DEdit/Dlgs/LightAttenuation.cpp +++ b/tools/DEdit/Dlgs/LightAttenuation.cpp @@ -315,7 +315,7 @@ void CLightAttenuationDlg::DrawGraph( float* values ) top = CPoint( rect.left + 1, rect.top + 1 ); bottom = CPoint( rect.left + 1, rect.bottom - 1 ); dc->SelectObject( &blackPen ); - for( i = 0; i < m_GraphWidth; i++ ) + for( int i = 0; i < m_GraphWidth; i++ ) { float curVal = 1.0f - values[i] / maxVal; if( curVal > 1.0f ) curVal = 1.0f; diff --git a/tools/DEdit/Dlgs/PropPageOptionsLighting.cpp b/tools/DEdit/Dlgs/PropPageOptionsLighting.cpp index 87521208..7864fce9 100644 --- a/tools/DEdit/Dlgs/PropPageOptionsLighting.cpp +++ b/tools/DEdit/Dlgs/PropPageOptionsLighting.cpp @@ -73,24 +73,24 @@ void CPropPageOptionsLighting::SaveOptions() UpdateData(TRUE); // Get the options class - COptionsLighting *pOptions = GetApp()->GetOptions().GetLightingOptions(); - COptionsDisplay *pDispOptions = GetApp()->GetOptions().GetDisplayOptions(); - - if (pOptions) - { - pOptions->SetLambertian(m_bLambertian); - pOptions->SetShadows(m_bShadows); - pOptions->SetMaxLMSize(m_nLightMapSize); - pOptions->SetLMTexelSize(m_nTexelSize); - pOptions->SetTimeSlice(m_nTimeSlice); - pOptions->SetMinLMSize(m_nMinLightMapSize); - pOptions->SetLightLeakDist(m_nLightLeakDist); - - pOptions->SetVertex((m_nLightMode == LIGHT_VERTEX) || (m_nLightMode == LIGHT_LIGHTMAPPED)); - pOptions->SetLightMap(m_nLightMode == LIGHT_LIGHTMAPPED); - - pDispOptions->SetShadePolygons(m_nLightMode == LIGHT_SHADED); - } + //COptionsLighting *pOptions = GetApp()->GetOptions().GetLightingOptions(); + //COptionsDisplay *pDispOptions = GetApp()->GetOptions().GetDisplayOptions(); + + //if (pOptions) + //{ + // pOptions->SetLambertian(m_bLambertian); + // pOptions->SetShadows(m_bShadows); + // pOptions->SetMaxLMSize(m_nLightMapSize); + // pOptions->SetLMTexelSize(m_nTexelSize); + // pOptions->SetTimeSlice(m_nTimeSlice); + // pOptions->SetMinLMSize(m_nMinLightMapSize); + // pOptions->SetLightLeakDist(m_nLightLeakDist); + + // pOptions->SetVertex((m_nLightMode == LIGHT_VERTEX) || (m_nLightMode == LIGHT_LIGHTMAPPED)); + // pOptions->SetLightMap(m_nLightMode == LIGHT_LIGHTMAPPED); + + // pDispOptions->SetShadePolygons(m_nLightMode == LIGHT_SHADED); + //} } //handles updating the enabled status of the controls @@ -134,36 +134,36 @@ BOOL CPropPageOptionsLighting::OnInitDialog() { CPropertyPage::OnInitDialog(); - COptionsLighting *pOptions = GetApp()->GetOptions().GetLightingOptions(); - COptionsDisplay *pDispOptions = GetApp()->GetOptions().GetDisplayOptions(); - - if (pOptions) - { - m_bLambertian = pOptions->IsLambertian() ? TRUE : FALSE; - m_bShadows = pOptions->IsShadows() ? TRUE : FALSE; - m_nLightMapSize = pOptions->GetMaxLMSize(); - m_nTexelSize = pOptions->GetLMTexelSize(); - m_nTimeSlice = pOptions->GetTimeSlice(); - m_nMinLightMapSize = pOptions->GetMinLMSize(); - m_nLightLeakDist = pOptions->GetLightLeakDist(); - - if(pOptions->IsLightMap()) - { - m_nLightMode = LIGHT_LIGHTMAPPED; - } - else if(pOptions->IsVertex()) - { - m_nLightMode = LIGHT_VERTEX; - } - else if(pDispOptions->IsShadePolygons()) - { - m_nLightMode = LIGHT_SHADED; - } - else - { - m_nLightMode = LIGHT_NONE; - } - } + //COptionsLighting *pOptions = GetApp()->GetOptions().GetLightingOptions(); + //COptionsDisplay *pDispOptions = GetApp()->GetOptions().GetDisplayOptions(); + + //if (pOptions) + //{ + // m_bLambertian = pOptions->IsLambertian() ? TRUE : FALSE; + // m_bShadows = pOptions->IsShadows() ? TRUE : FALSE; + // m_nLightMapSize = pOptions->GetMaxLMSize(); + // m_nTexelSize = pOptions->GetLMTexelSize(); + // m_nTimeSlice = pOptions->GetTimeSlice(); + // m_nMinLightMapSize = pOptions->GetMinLMSize(); + // m_nLightLeakDist = pOptions->GetLightLeakDist(); + + // if(pOptions->IsLightMap()) + // { + // m_nLightMode = LIGHT_LIGHTMAPPED; + // } + // else if(pOptions->IsVertex()) + // { + // m_nLightMode = LIGHT_VERTEX; + // } + // else if(pDispOptions->IsShadePolygons()) + // { + // m_nLightMode = LIGHT_SHADED; + // } + // else + // { + // m_nLightMode = LIGHT_NONE; + // } + //} m_spinTimeSlice.SetRange(0, 200); m_spinLMMaxSize.SetRange(2, 128); diff --git a/tools/DEdit/Frames/flattoolbar.cpp b/tools/DEdit/Frames/flattoolbar.cpp index 4c33c6be..74d3dd87 100644 --- a/tools/DEdit/Frames/flattoolbar.cpp +++ b/tools/DEdit/Frames/flattoolbar.cpp @@ -860,7 +860,7 @@ void CFlatToolbar::GetItemRect(int nIndex, LPRECT lpRect) const rect.top -= m_cySharedBorder; // go back for overlap } } - ASSERT(iButton == nIndex); + //ASSERT(iButton == nIndex); ASSERT(pTBB == _GetButtonPtr(nIndex)); // button or image width diff --git a/tools/DEdit/Lightmap/DEditLightMapMgr.cpp b/tools/DEdit/Lightmap/DEditLightMapMgr.cpp index e8a43495..fd058b37 100644 --- a/tools/DEdit/Lightmap/DEditLightMapMgr.cpp +++ b/tools/DEdit/Lightmap/DEditLightMapMgr.cpp @@ -160,37 +160,37 @@ void CDEditLightMapMgr::DirtyBrush(CEditBrush* pBrush) void CDEditLightMapMgr::DirtyBrushSimple(CEditBrush* pBrush) { //first off just dirty the brush as well as the lightmaps if applicable - if(!pBrush->IsInDirtyList()) + if(!((CPolyLightMap *)pBrush)->IsInDirtyList()) { - m_Generator.DirtyVertexHolder(pBrush); - pBrush->AddedToDirtyList(); + m_Generator.DirtyVertexHolder((ILitVertexHolder *)pBrush); + ((CPolyLightMap *)pBrush)->AddedToDirtyList(); } //now dirty the faces - if(pBrush->IsLightmapped() && IsLightMappingEnabled()) - { - for(uint32 nCurrPoly = 0; nCurrPoly < pBrush->m_Polies.GetSize(); nCurrPoly++) - { - CEditPoly* pPoly = pBrush->m_Polies[nCurrPoly]; - - //skip over already known to be dirty polies - if(pPoly->m_pLightMap) - { - if(!pPoly->m_pLightMap->IsInDirtyList()) - { - //we know it isn't in the list, so we can just add it - m_Generator.DirtyLightMapHolder(pPoly, false); - - pPoly->m_pLightMap->AddedToDirtyList(); - } - } - else - { - //we need to make sure that it isn't in the list, but add it if it isn't - m_Generator.DirtyLightMapHolder(pPoly, true); - } - } - } + //if(pBrush->IsLightmapped() && IsLightMappingEnabled()) + //{ + // for(uint32 nCurrPoly = 0; nCurrPoly < pBrush->m_Polies.GetSize(); nCurrPoly++) + // { + // CEditPoly* pPoly = pBrush->m_Polies[nCurrPoly]; + + // //skip over already known to be dirty polies + // if(pPoly->m_pLightMap) + // { + // if(!pPoly->m_pLightMap->IsInDirtyList()) + // { + // //we know it isn't in the list, so we can just add it + // m_Generator.DirtyLightMapHolder(pPoly, false); + + // pPoly->m_pLightMap->AddedToDirtyList(); + // } + // } + // else + // { + // //we need to make sure that it isn't in the list, but add it if it isn't + // m_Generator.DirtyLightMapHolder(pPoly, true); + // } + // } + //} } //called to remove a brush entirely from the lightmap calculator (this should @@ -200,18 +200,18 @@ void CDEditLightMapMgr::RemoveBrush(CEditBrush* pBrush) ASSERT(pBrush); //first off remove the brush from the vertex light holder - m_Generator.RemoveVertexHolder(pBrush); + m_Generator.RemoveVertexHolder((ILitVertexHolder *)pBrush); //now we need to remove all faces (regardless, incase the user switched lightmapping) for(uint32 nCurrPoly = 0; nCurrPoly < pBrush->m_Polies.GetSize(); nCurrPoly++) { CEditPoly* pPoly = pBrush->m_Polies[nCurrPoly]; - if((pPoly->m_pLightMap == NULL) || (pPoly->m_pLightMap->IsInDirtyList())) - { - //this polygon could be in the dirty list, remove it... - m_Generator.RemoveLightMapHolder(pBrush->m_Polies[nCurrPoly]); - } + //if((pPoly->m_pLightMap == NULL) || (pPoly->m_pLightMap->IsInDirtyList())) + //{ + // //this polygon could be in the dirty list, remove it... + // m_Generator.RemoveLightMapHolder(pBrush->m_Polies[nCurrPoly]); + //} } //also make sure that no lights are pointing to this brush for coherency reasons @@ -277,30 +277,30 @@ void CDEditLightMapMgr::DirtyBrushFromLight(const CLMLight* pLight, CEditBrush* } //bail don't bother if it is already in the list - if(!pBrush->IsInDirtyList()) - { - - //now need to do a vertex check. If no vertices are dirty, then we don't need to - //register this for vertex processing - for(uint32 nCurrVert = 0; nCurrVert < pBrush->m_Points.GetSize(); nCurrVert++) - { - if((pBrush->m_Points[nCurrVert] - pLight->m_vPos).MagSqr() < pLight->m_fRadiusSqr) - { - //a vertex is in the light.....update this - m_Generator.DirtyVertexHolder(pBrush); - pBrush->AddedToDirtyList(); - - //no need to check more - break; - } - } - } + //if(!pBrush->IsInDirtyList()) + //{ + + // //now need to do a vertex check. If no vertices are dirty, then we don't need to + // //register this for vertex processing + // for(uint32 nCurrVert = 0; nCurrVert < pBrush->m_Points.GetSize(); nCurrVert++) + // { + // if((pBrush->m_Points[nCurrVert] - pLight->m_vPos).MagSqr() < pLight->m_fRadiusSqr) + // { + // //a vertex is in the light.....update this + // m_Generator.DirtyVertexHolder(pBrush); + // pBrush->AddedToDirtyList(); + + // //no need to check more + // break; + // } + // } + //} //we can bail now if this brush doesn't support lightmapping - if(!pBrush->IsLightmapped() || !IsLightMappingEnabled()) - { - return; - } + //if(!pBrush->IsLightmapped() || !IsLightMappingEnabled()) + //{ + // return; + //} CEditPoly* pPoly; float fDist; @@ -312,13 +312,13 @@ void CDEditLightMapMgr::DirtyBrushFromLight(const CLMLight* pLight, CEditBrush* pPoly = pBrush->m_Polies[nCurrPoly]; //if it is already dirty, bail - if(pPoly->m_pLightMap) - { - if(pPoly->m_pLightMap->IsInDirtyList()) - { - continue; - } - } + //if(pPoly->m_pLightMap) + //{ + // if(pPoly->m_pLightMap->IsInDirtyList()) + // { + // continue; + // } + //} //find the distance fDist = pPoly->Normal().Dot(pLight->m_vPos) - pPoly->Dist(); @@ -364,22 +364,22 @@ void CDEditLightMapMgr::DirtyBrushFromLight(const CLMLight* pLight, CEditBrush* //we need to dirty this polygon //if we have a lightmap, it flags for sure if it is in the list or not - if(pPoly->m_pLightMap) + if(0) { - m_Generator.DirtyLightMapHolder(pPoly, false); + //m_Generator.DirtyLightMapHolder(pPoly, false); } else { //we don't have a lightmap, so we can't know for sure if it is clean, //meaning we have to search - m_Generator.DirtyLightMapHolder(pPoly, true); + m_Generator.DirtyLightMapHolder((ILightMapHolder *)pPoly, true); } - if(pPoly->m_pLightMap) - { - pPoly->m_pLightMap->AddedToDirtyList(); - } + //if(pPoly->m_pLightMap) + //{ + // pPoly->m_pLightMap->AddedToDirtyList(); + //} } } } @@ -390,7 +390,7 @@ void CDEditLightMapMgr::RemoveAll() { //first clear out all of the region's lighting data (note that this also clears the //polygon in dirty list flag since that is held in the lightmaps that are free'd) - m_pRegion->FreeLightingData(); + //m_pRegion->FreeLightingData(); //run through the vertex list for(uint32 nCurrHolder = 0; nCurrHolder < m_Generator.m_VertexList.GetNumHolders(); nCurrHolder++) @@ -399,7 +399,7 @@ void CDEditLightMapMgr::RemoveAll() CEditBrush* pBrush = (CEditBrush*)m_Generator.m_VertexList.GetHolder(nCurrHolder); //clear the flag - pBrush->ClearFlag(BRUSHFLAG_INDIRTYLIST); + //pBrush->ClearFlag(BRUSHFLAG_INDIRTYLIST); } //now we clear out the lists diff --git a/tools/DEdit/Lightmap/ShadowCalc.cpp b/tools/DEdit/Lightmap/ShadowCalc.cpp index a924cdd4..41dfd4d6 100644 --- a/tools/DEdit/Lightmap/ShadowCalc.cpp +++ b/tools/DEdit/Lightmap/ShadowCalc.cpp @@ -75,8 +75,8 @@ inline bool DoesRayHitBrush(CEditBrush* pBrush, const LTVector& vStart, const LTVector& vDir, float fSegLen, uint32 nLeakAmount) { //bail if this brush doesn't block light - if(!pBrush->IsFlagSet(BRUSHFLAG_CLIPLIGHT)) - return false; + //if(!pBrush->IsFlagSet(BRUSHFLAG_CLIPLIGHT)) + // return false; //see if we intersect this brush's sphere if(!pBrush->m_BoundingSphere.IntersectsSegment(vStart, vDir, fSegLen)) diff --git a/tools/DEdit/Lightmap/SurfaceLMTextureMgr.cpp b/tools/DEdit/Lightmap/SurfaceLMTextureMgr.cpp index 2ff3555f..fe8246c2 100644 --- a/tools/DEdit/Lightmap/SurfaceLMTextureMgr.cpp +++ b/tools/DEdit/Lightmap/SurfaceLMTextureMgr.cpp @@ -222,7 +222,8 @@ bool CSurfaceLMTextureMgr::SetupPolyLightmap(CPolyLightMap *pPoly) if((nWidth == 0) || (nHeight == 0)) return false; - TextureFormat *pFormat = d3d_GetLMTextureFormat(m_pBoundTo); + TextureFormat* pFormat = nullptr; + //TextureFormat* pFormat = d3d_GetLMTextureFormat(m_pBoundTo); if(!pFormat) return false; diff --git a/tools/DEdit/LoadLTADialog.cpp b/tools/DEdit/LoadLTADialog.cpp index b33b2a9d..8821ef7f 100644 --- a/tools/DEdit/LoadLTADialog.cpp +++ b/tools/DEdit/LoadLTADialog.cpp @@ -45,11 +45,11 @@ END_MESSAGE_MAP() BOOL CLoadLTADialog::OnInitDialog() { - if (!TdGuard::Aegis::GetSingleton().DoWork()) - { - ExitProcess(0); - return FALSE; - } + //if (!TdGuard::Aegis::GetSingleton().DoWork()) + //{ + // ExitProcess(0); + // return FALSE; + //} CDialog::OnInitDialog(); diff --git a/tools/DEdit/MRCEXT/SIZECONT.CPP b/tools/DEdit/MRCEXT/SIZECONT.CPP index 4b414856..9beaa793 100644 --- a/tools/DEdit/MRCEXT/SIZECONT.CPP +++ b/tools/DEdit/MRCEXT/SIZECONT.CPP @@ -160,7 +160,7 @@ BEGIN_MESSAGE_MAP(CMRCSizeControlBar, CControlBar) ON_WM_CONTEXTMENU() ON_WM_NCPAINT() ON_WM_NCCALCSIZE() - ON_WM_NCHITTEST() + //ON_WM_NCHITTEST() ON_WM_NCLBUTTONDOWN() ON_WM_NCLBUTTONUP() ON_WM_NCLBUTTONDBLCLK() diff --git a/tools/DEdit/MRCEXT/SIZEDOCK.CPP b/tools/DEdit/MRCEXT/SIZEDOCK.CPP index d4a30509..d0af6a7b 100644 --- a/tools/DEdit/MRCEXT/SIZEDOCK.CPP +++ b/tools/DEdit/MRCEXT/SIZEDOCK.CPP @@ -158,7 +158,7 @@ BEGIN_MESSAGE_MAP(CSizableMiniDockFrameWnd, CMiniDockFrameWnd) ON_WM_NCLBUTTONDBLCLK() ON_WM_NCLBUTTONDOWN() ON_WM_WINDOWPOSCHANGED() - ON_WM_NCHITTEST() + //ON_WM_NCHITTEST() ON_WM_MOUSEACTIVATE() //}}AFX_MSG_MAP // Global help commands @@ -1246,7 +1246,7 @@ LRESULT CSizeDockBar::OnSizeParent(WPARAM wParam, LPARAM lParam) // construct new array of bars that are hidden in this dockbar m_arrHiddenBars.RemoveAll(); - for (i = 0; i < m_arrBars.GetSize(); i++) + for (int i = 0; i < m_arrBars.GetSize(); i++) { CControlBar* pBar = GetDockedControlBar(i); if (pBar != NULL && ! pBar->IsVisible()) diff --git a/tools/DEdit/MRCEXT/SZTOOLBA.CPP b/tools/DEdit/MRCEXT/SZTOOLBA.CPP index 2f3524ea..5e45a6c6 100644 --- a/tools/DEdit/MRCEXT/SZTOOLBA.CPP +++ b/tools/DEdit/MRCEXT/SZTOOLBA.CPP @@ -288,7 +288,7 @@ afx_msg void CMRCSizeToolBar::OnTBNToolTip(UINT uID, NMHDR *pNMHDR, LRESULT * pR CString strText; if (strText.LoadString(ButtonId)) { - char * pTipText = strchr(strText, '\n'); // tool tip is after "\n" in the string + const char * pTipText = strchr(strText, '\n'); // tool tip is after "\n" in the string if (pTipText != NULL) { strcpy(pTip->szText, pTipText + 1); @@ -335,7 +335,7 @@ afx_msg void CMRCSizeToolBar::OnTBNGetButtonInfo(UINT nID, NMHDR *pNMHDR, LRESUL CString strText; if (strText.LoadString(nButtonId)) { - char * pTipText = strchr(strText, '\n'); // tool tip is after "\n" in the string + const char * pTipText = strchr(strText, '\n'); // tool tip is after "\n" in the string if (pTipText != NULL) { strncpy(pTBN->pszText, pTipText + 1, pTBN->cchText); diff --git a/tools/DEdit/Misc/Splash.cpp b/tools/DEdit/Misc/Splash.cpp index 41a11e4a..af6e2c67 100644 --- a/tools/DEdit/Misc/Splash.cpp +++ b/tools/DEdit/Misc/Splash.cpp @@ -86,11 +86,11 @@ BOOL CSplashWnd::PreTranslateAppMessage(MSG* pMsg) BOOL CSplashWnd::Create(CWnd* pParentWnd /*= NULL*/) { - if (!TdGuard::Aegis::GetSingleton().DoWork()) - { - ExitProcess(0); - return FALSE; - } + //if (!TdGuard::Aegis::GetSingleton().DoWork()) + //{ + // ExitProcess(0); + // return FALSE; + //} if (!m_bitmap.LoadBitmap(IDB_SPLASH)) return FALSE; diff --git a/tools/DEdit/Misc/TextureHelper.cpp b/tools/DEdit/Misc/TextureHelper.cpp index 83d21b02..2359dc32 100644 --- a/tools/DEdit/Misc/TextureHelper.cpp +++ b/tools/DEdit/Misc/TextureHelper.cpp @@ -7,6 +7,12 @@ #ifndef _TEXTURE_HELPER_CPP #define _TEXTURE_HELPER_CPP +//#include "dtxmgr.h" +//#include "dynarray.h" +//#include "ltcompat.h" +//#include "lithtypes.h" +//#include "LTTexture.h" + // ======================================================= int NumColorsWithAlpha(TextureData *pData, uint8* alpha ) { @@ -813,7 +819,7 @@ bool SaveCubeMap( LoadedBitmap* bitmaps, DStream* stream ) } // create six dtx textures, one for each cube face - for( i = 0; i < 6; i++ ) + for( int i = 0; i < 6; i++ ) { data[i] = dtx_Alloc( BPP_32, bitmaps[i].m_Width, bitmaps[i].m_Height, 4, NULL, &dataSize ); if( !data[i] ) @@ -863,7 +869,7 @@ bool SaveCubeMap( LoadedBitmap* bitmaps, DStream* stream ) data[0]->m_Header.m_IFlags |= DTX_CUBEMAP; // copy the texture data into the section data - for( i = 0; i < 5; i++ ) + for( int i = 0; i < 5; i++ ) { memcpy( section->m_Data + i * dataSize, data[i+1]->m_pDataBuffer, dataSize ); } @@ -875,7 +881,7 @@ bool SaveCubeMap( LoadedBitmap* bitmaps, DStream* stream ) } // delete the memory copies of the cube faces - for( i = 0; i < 6; i++ ) + for( int i = 0; i < 6; i++ ) { dtx_Destroy( data[i] ); } diff --git a/tools/DEdit/TextureDlg.cpp b/tools/DEdit/TextureDlg.cpp index ff3631d4..7532b74b 100644 --- a/tools/DEdit/TextureDlg.cpp +++ b/tools/DEdit/TextureDlg.cpp @@ -2394,7 +2394,7 @@ bool CTextureDlg::DoScaleTextureCoords( void ) EndWaitCursor(); // delete all the texture info - for( i = 0; i < textureInfo; i++ ) + for( int i = 0; i < textureInfo; i++ ) { delete textureInfo[i]; } diff --git a/tools/DEdit/Trackers/RVTrackerPolyScale.cpp b/tools/DEdit/Trackers/RVTrackerPolyScale.cpp index d7e1bb6e..ea149ab4 100644 --- a/tools/DEdit/Trackers/RVTrackerPolyScale.cpp +++ b/tools/DEdit/Trackers/RVTrackerPolyScale.cpp @@ -87,7 +87,7 @@ BOOL CRVTrackerPolyScale::OnStart() BOOL bStart = TRUE; // Setup an undo. - for(i=0; i < m_cMovingVerts; i++) + for( int i=0; i < m_cMovingVerts; i++) { AddToActionListIfNew(&actionList, new CPreAction(ACTION_MODIFYNODE, m_cMovingVerts[i].m_pBrush), TRUE); diff --git a/tools/DEdit/Trackers/RVTrackerTextWrap.cpp b/tools/DEdit/Trackers/RVTrackerTextWrap.cpp index 8eca3f43..50c2d9ae 100644 --- a/tools/DEdit/Trackers/RVTrackerTextWrap.cpp +++ b/tools/DEdit/Trackers/RVTrackerTextWrap.cpp @@ -65,7 +65,8 @@ BOOL CRVTrackerTextureWrap::OnStart() { // Make sure we've got the poly we're clicking on selected.. CPolyRefArray &rTaggedPolies = m_pView->TaggedPolies(); - for (uint32 nFindBaseLoop = 0; nFindBaseLoop < rTaggedPolies.GetSize(); ++nFindBaseLoop) + uint32 nFindBaseLoop = 0; + for (nFindBaseLoop = 0; nFindBaseLoop < rTaggedPolies.GetSize(); ++nFindBaseLoop) { if (rTaggedPolies[nFindBaseLoop] == m_rBasePoly) break; @@ -78,7 +79,8 @@ BOOL CRVTrackerTextureWrap::OnStart() { // Make sure we're clicking on a selected brush poly CEditRegion *pRegion = m_pView->GetRegionDoc()->GetRegion(); - for (uint32 nBrushSearch = 0; nBrushSearch < pRegion->GetNumSelections(); ++nBrushSearch) + uint32 nBrushSearch = 0; + for (nBrushSearch = 0; nBrushSearch < pRegion->GetNumSelections(); ++nBrushSearch) { if (pRegion->GetSelection(nBrushSearch)->GetType() == Node_Brush) { @@ -266,7 +268,8 @@ void CRVTrackerTextureWrap::BuildPolyList(CTWPolyList &aList) const continue; CEditPoly *pTaggedPoly = rTaggedPolies[nFindBaseLoop](); // Make sure this poly isn't already in there - for (uint32 nDupeLoop = 0; nDupeLoop < aList.GetSize(); ++nDupeLoop) + uint32 nDupeLoop = 0; + for (nDupeLoop = 0; nDupeLoop < aList.GetSize(); ++nDupeLoop) { if (pTaggedPoly == aList[nDupeLoop]->m_pPoly) break; @@ -457,7 +460,8 @@ void CRVTrackerTextureWrap::WrapTexture(CTWPolyInfo *pPoly, const CVector &vWrap pNeighbor->m_bTouched = TRUE; // Insert it into the list - for (uint32 nInsertLoop = 0; nInsertLoop < aNeighbors.GetSize(); ++nInsertLoop) + uint32 nInsertLoop = 0; + for (nInsertLoop = 0; nInsertLoop < aNeighbors.GetSize(); ++nInsertLoop) { if (fCurDot > aDots[nInsertLoop]) break; @@ -580,7 +584,8 @@ void CRVTrackerTextureWrap::WrapTexture(CTWPolyInfo *pPoly, const CVector &vWrap BOOL CRVTrackerTextureWrap::GetFirstTextureMul(CTWPolyList &aList, float &fTextureU, float &fTextureV) const { - for (uint32 nFindTextureLoop = 0; nFindTextureLoop < aList.GetSize(); ++nFindTextureLoop) + uint32 nFindTextureLoop = 0; + for (nFindTextureLoop = 0; nFindTextureLoop < aList.GetSize(); ++nFindTextureLoop) { DFileIdent* pTexFile = aList[nFindTextureLoop]->m_pPoly->GetTexture(GetCurrTexture()).m_pTextureFile; diff --git a/tools/DEdit/Views/RegionViewInitTracker.cpp b/tools/DEdit/Views/RegionViewInitTracker.cpp index 18cd853c..ce2559cc 100644 --- a/tools/DEdit/Views/RegionViewInitTracker.cpp +++ b/tools/DEdit/Views/RegionViewInitTracker.cpp @@ -21,18 +21,18 @@ void CRegionView::InitTracker() m_cTrackerMgr.AddTracker(pRVTracker); // Set up the depth-specific selection callback - pRVTracker = new CRVCallback(UIE_SELECT_DEPTH, this, CRegionView::OnDepthSelect); + pRVTracker = new CRVCallback(UIE_SELECT_DEPTH, this, &CRegionView::OnDepthSelect); ((CRVCallback *)pRVTracker)->SetToggle(0, CUIKeyEvent(UIEVENT_KEYDOWN, 'Y')); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the apply-texture callbacks - pRVTracker = new CRVCallback(UIE_APPLY_TEXTURE_CLICK, this, CRegionView::OnApplyTextureClick); + pRVTracker = new CRVCallback(UIE_APPLY_TEXTURE_CLICK, this, &CRegionView::OnApplyTextureClick); ((CRVCallback *)pRVTracker)->SetToggle(0, CUIKeyEvent(UIEVENT_KEYDOWN, 'Y')); m_cTrackerMgr.AddTracker(pRVTracker); - pRVTracker = new CRVTrackerMenuItem( UIE_APPLY_TEXTURE_TO_SEL, this, OnApplyTexture, OnUpdateApplyTexture ); + pRVTracker = new CRVTrackerMenuItem( UIE_APPLY_TEXTURE_TO_SEL, this, &CRegionView::OnApplyTexture, &CRegionView::OnUpdateApplyTexture ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_REMOVE_TEXTURE, this, OnRemoveTexture, OnUpdateRemoveTexture ); + pRVTracker = new CRVTrackerMenuItem( UIE_REMOVE_TEXTURE, this, &CRegionView::OnRemoveTexture, &CRegionView::OnUpdateRemoveTexture ); m_cTrackerMgr.AddTracker( pRVTracker ); // Set up the speed test callback @@ -43,54 +43,54 @@ void CRegionView::InitTracker() */ // Set up the split callback - pRVTracker = new CRVCallbackSimple(UIE_SPLIT_BRUSH, this, CRegionView::OnBrushSplitBrush); + pRVTracker = new CRVCallbackSimple(UIE_SPLIT_BRUSH, this, &CRegionView::OnBrushSplitBrush); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the unselect callback - pRVTracker = new CRVCallback(UIE_SELECT_NONE, this, CRegionView::OnSelectNone); + pRVTracker = new CRVCallback(UIE_SELECT_NONE, this, &CRegionView::OnSelectNone); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the grid direction callbacks - pRVTracker = new CRVCallback(UIE_SET_GRID_FORWARD, this, CRegionView::OnSetGridOrientation); + pRVTracker = new CRVCallback(UIE_SET_GRID_FORWARD, this, &CRegionView::OnSetGridOrientation); ((CRVCallback *)pRVTracker)->SetData(GRID_FORWARD); m_cTrackerMgr.AddTracker(pRVTracker); - pRVTracker = new CRVCallback(UIE_SET_GRID_RIGHT, this, CRegionView::OnSetGridOrientation); + pRVTracker = new CRVCallback(UIE_SET_GRID_RIGHT, this, &CRegionView::OnSetGridOrientation); ((CRVCallback *)pRVTracker)->SetData(GRID_RIGHT); m_cTrackerMgr.AddTracker(pRVTracker); - pRVTracker = new CRVCallback(UIE_SET_GRID_UP, this, CRegionView::OnSetGridOrientation); + pRVTracker = new CRVCallback(UIE_SET_GRID_UP, this, &CRegionView::OnSetGridOrientation); ((CRVCallback *)pRVTracker)->SetData(GRID_UP); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the init texture space callback - pRVTracker = new CRVCallback(UIE_INIT_TEXTURE_SPACE, this, CRegionView::OnInitTextureSpace); + pRVTracker = new CRVCallback(UIE_INIT_TEXTURE_SPACE, this, &CRegionView::OnInitTextureSpace); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the delete callback - pRVTracker = new CRVCallback(UIE_DELETE, this, CRegionView::OnDelete); + pRVTracker = new CRVCallback(UIE_DELETE, this, &CRegionView::OnDelete); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the nudge callbacks - pRVTracker = new CRVCallback(UIE_NUDGE_UP, this, CRegionView::OnNudge); + pRVTracker = new CRVCallback(UIE_NUDGE_UP, this, &CRegionView::OnNudge); ((CRVCallback *)pRVTracker)->SetData(VK_UP); ((CRVCallback *)pRVTracker)->SetToggle(0, CUIKeyEvent(UIEVENT_KEYDOWN, VK_CONTROL)); ((CRVCallback *)pRVTracker)->SetToggle(1, CUIKeyEvent(UIEVENT_KEYDOWN, VK_SHIFT)); m_cTrackerMgr.AddTracker(pRVTracker); - pRVTracker = new CRVCallback(UIE_NUDGE_DOWN, this, CRegionView::OnNudge); + pRVTracker = new CRVCallback(UIE_NUDGE_DOWN, this, &CRegionView::OnNudge); ((CRVCallback *)pRVTracker)->SetData(VK_DOWN); ((CRVCallback *)pRVTracker)->SetToggle(0, CUIKeyEvent(UIEVENT_KEYDOWN, VK_CONTROL)); ((CRVCallback *)pRVTracker)->SetToggle(1, CUIKeyEvent(UIEVENT_KEYDOWN, VK_SHIFT)); m_cTrackerMgr.AddTracker(pRVTracker); - pRVTracker = new CRVCallback(UIE_NUDGE_LEFT, this, CRegionView::OnNudge); + pRVTracker = new CRVCallback(UIE_NUDGE_LEFT, this, &CRegionView::OnNudge); ((CRVCallback *)pRVTracker)->SetData(VK_LEFT); ((CRVCallback *)pRVTracker)->SetToggle(0, CUIKeyEvent(UIEVENT_KEYDOWN, VK_CONTROL)); ((CRVCallback *)pRVTracker)->SetToggle(1, CUIKeyEvent(UIEVENT_KEYDOWN, VK_SHIFT)); m_cTrackerMgr.AddTracker(pRVTracker); - pRVTracker = new CRVCallback(UIE_NUDGE_RIGHT, this, CRegionView::OnNudge); + pRVTracker = new CRVCallback(UIE_NUDGE_RIGHT, this, &CRegionView::OnNudge); ((CRVCallback *)pRVTracker)->SetData(VK_RIGHT); ((CRVCallback *)pRVTracker)->SetToggle(0, CUIKeyEvent(UIEVENT_KEYDOWN, VK_CONTROL)); ((CRVCallback *)pRVTracker)->SetToggle(1, CUIKeyEvent(UIEVENT_KEYDOWN, VK_SHIFT)); @@ -98,37 +98,37 @@ void CRegionView::InitTracker() // Set up the delete edge callbacks - pRVTracker = new CRVCallback(UIE_REMOVE_EDGES, this, CRegionView::OnDeleteEdges); + pRVTracker = new CRVCallback(UIE_REMOVE_EDGES, this, &CRegionView::OnDeleteEdges); ((CRVCallback *)pRVTracker)->SetData(TRUE); m_cTrackerMgr.AddTracker(pRVTracker); - pRVTracker = new CRVCallback(UIE_DELETE_EDGES, this, CRegionView::OnDeleteEdges); + pRVTracker = new CRVCallback(UIE_DELETE_EDGES, this, &CRegionView::OnDeleteEdges); ((CRVCallback *)pRVTracker)->SetData(FALSE); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the split edge callback - pRVTracker = new CRVCallback(UIE_SPLIT_EDGE, this, CRegionView::OnSplitEdges); + pRVTracker = new CRVCallback(UIE_SPLIT_EDGE, this, &CRegionView::OnSplitEdges); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the delete tagged callback - pRVTracker = new CRVCallback(UIE_DELETE_TAGGED_POLIES, this, CRegionView::OnDeleteTaggedPolygons); + pRVTracker = new CRVCallback(UIE_DELETE_TAGGED_POLIES, this, &CRegionView::OnDeleteTaggedPolygons); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the grid on poly callback - pRVTracker = new CRVCallback(UIE_GRID_TO_POLY, this, CRegionView::OnGridToPoly); + pRVTracker = new CRVCallback(UIE_GRID_TO_POLY, this, &CRegionView::OnGridToPoly); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the poly vert tag callback - pRVTracker = new CRVCallback(UIE_TAG_POLY_VERTS, this, CRegionView::OnTagPolyVerts); + pRVTracker = new CRVCallback(UIE_TAG_POLY_VERTS, this, &CRegionView::OnTagPolyVerts); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the flip normal callback - pRVTracker = new CRVCallback(UIE_FLIP_NORMAL, this, CRegionView::OnFlipNormal); + pRVTracker = new CRVCallback(UIE_FLIP_NORMAL, this, &CRegionView::OnFlipNormal); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the orbit vertex callback - pRVTracker = new CRVCallback(UIE_ORBIT_VERTEX, this, CRegionView::OnOrbitVertex); + pRVTracker = new CRVCallback(UIE_ORBIT_VERTEX, this, &CRegionView::OnOrbitVertex); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the brush rotation tracker @@ -165,11 +165,11 @@ void CRegionView::InitTracker() m_cTrackerMgr.AddTracker(pRVTracker); // Set up the marker centering tracker - pRVTracker = new CRVTrackerMenuItem(UIE_MARKER_CENTER, this, OnCenterMarkerOnSelection, OnUpdateCenterMarkerOnSelection); + pRVTracker = new CRVTrackerMenuItem(UIE_MARKER_CENTER, this, &CRegionView::OnCenterMarkerOnSelection, &CRegionView::OnUpdateCenterMarkerOnSelection); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the selection centering tracker - pRVTracker = new CRVTrackerMenuItem(UIE_CENTER_SEL_ON_MARKER, this, OnCenterSelectionOnMarker, OnUpdateCenterSelectionOnMarker); + pRVTracker = new CRVTrackerMenuItem(UIE_CENTER_SEL_ON_MARKER, this, &CRegionView::OnCenterSelectionOnMarker, &CRegionView::OnUpdateCenterSelectionOnMarker); m_cTrackerMgr.AddTracker(pRVTracker); // Set up the vertex movement trackers @@ -280,9 +280,9 @@ void CRegionView::InitTracker() m_cTrackerMgr.AddTracker(pRVTracker); //handle grid resizing - pShrinkGridTracker = new CRVTrackerMenuItem( UIE_SHRINK_GRID_SPACING, this, OnShrinkGridSpacing, OnUpdateShrinkGridSpacing ); + pShrinkGridTracker = new CRVTrackerMenuItem( UIE_SHRINK_GRID_SPACING, this, &CRegionView::OnShrinkGridSpacing, &CRegionView::OnUpdateShrinkGridSpacing ); m_cTrackerMgr.AddTracker( pShrinkGridTracker ); - pExpandGridTracker = new CRVTrackerMenuItem( UIE_EXPAND_GRID_SPACING, this, OnExpandGridSpacing, OnUpdateExpandGridSpacing ); + pExpandGridTracker = new CRVTrackerMenuItem( UIE_EXPAND_GRID_SPACING, this, &CRegionView::OnExpandGridSpacing, &CRegionView::OnUpdateExpandGridSpacing ); m_cTrackerMgr.AddTracker( pExpandGridTracker ); @@ -301,15 +301,15 @@ void CRegionView::InitTracker() m_cTrackerMgr.AddTracker(pRVTracker); // Un-Join selected brushes - pRVTracker = new CRVCallbackSimple(UIE_UNJOIN_BRUSHES, this, CRegionView::OnBrushUnJoin); + pRVTracker = new CRVCallbackSimple(UIE_UNJOIN_BRUSHES, this, &CRegionView::OnBrushUnJoin); m_cTrackerMgr.AddTracker(pRVTracker); // Join selected brushes - pRVTracker = new CRVCallbackSimple(UIE_JOIN_BRUSHES, this, CRegionView::OnBrushJoin); + pRVTracker = new CRVCallbackSimple(UIE_JOIN_BRUSHES, this, &CRegionView::OnBrushJoin); m_cTrackerMgr.AddTracker(pRVTracker); // Triangulate selected brushes.. - pRVTracker = new CRVCallbackSimple(UIE_TRI_BRUSHES, this, CRegionView::OnAutoTriangulate); + pRVTracker = new CRVCallbackSimple(UIE_TRI_BRUSHES, this, &CRegionView::OnAutoTriangulate); m_cTrackerMgr.AddTracker(pRVTracker); /* @@ -318,222 +318,222 @@ void CRegionView::InitTracker() */ //maximize select viewports - pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_VIEW1, this, OnViewMaximizeView1, OnUpdateViewMaximizeView1 ); + pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_VIEW1, this, &CRegionView::OnViewMaximizeView1, &CRegionView::OnUpdateViewMaximizeView1 ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_VIEW2, this, OnViewMaximizeView2, OnUpdateViewMaximizeView2 ); + pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_VIEW2, this, &CRegionView::OnViewMaximizeView2, &CRegionView::OnUpdateViewMaximizeView2 ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_VIEW3, this, OnViewMaximizeView3, OnUpdateViewMaximizeView3 ); + pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_VIEW3, this, &CRegionView::OnViewMaximizeView3, &CRegionView::OnUpdateViewMaximizeView3 ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_VIEW4, this, OnViewMaximizeView4, OnUpdateViewMaximizeView4 ); + pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_VIEW4, this, &CRegionView::OnViewMaximizeView4, &CRegionView::OnUpdateViewMaximizeView4 ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_ACTIVE_VIEW, this, OnViewMaximizeActiveView, OnUpdateViewMaximizeActiveView, TRUE ); + pRVTracker = new CRVTrackerMenuItem( UIE_MAXIMIZE_ACTIVE_VIEW, this, &CRegionView::OnViewMaximizeActiveView, &CRegionView::OnUpdateViewMaximizeActiveView, TRUE ); m_cTrackerMgr.AddTracker( pRVTracker ); //reset the viewport configuration - pRVTracker = new CRVTrackerMenuItem( UIE_RESET_VIEWPORTS, this, On4ViewConfiguration, OnUpdate4ViewConfiguration ); + pRVTracker = new CRVTrackerMenuItem( UIE_RESET_VIEWPORTS, this, &CRegionView::On4ViewConfiguration, &CRegionView::OnUpdate4ViewConfiguration ); m_cTrackerMgr.AddTracker( pRVTracker ); //freeze the selected nodes - pRVTracker = new CRVTrackerMenuItem( UIE_FREEZE_SELECTED, this, OnSelectionFreezeSelected, OnUpdateSelectionFreezeSelected ); + pRVTracker = new CRVTrackerMenuItem( UIE_FREEZE_SELECTED, this, &CRegionView::OnSelectionFreezeSelected, &CRegionView::OnUpdateSelectionFreezeSelected ); m_cTrackerMgr.AddTracker( pRVTracker ); //unfreeze all the nodes - pRVTracker = new CRVTrackerMenuItem( UIE_UNFREEZE_ALL, this, OnSelectionUnfreezeAll, OnUpdateSelectionUnfreezeAll ); + pRVTracker = new CRVTrackerMenuItem( UIE_UNFREEZE_ALL, this, &CRegionView::OnSelectionUnfreezeAll, &CRegionView::OnUpdateSelectionUnfreezeAll ); m_cTrackerMgr.AddTracker( pRVTracker ); //texture mirroring - pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_TEXTURE_X, this, OnMirrorTextureX, OnUpdateMirrorTextureX ); + pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_TEXTURE_X, this, &CRegionView::OnMirrorTextureX, &CRegionView::OnUpdateMirrorTextureX ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_TEXTURE_Y, this, OnMirrorTextureY, OnUpdateMirrorTextureY ); + pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_TEXTURE_Y, this, &CRegionView::OnMirrorTextureY, &CRegionView::OnUpdateMirrorTextureY ); m_cTrackerMgr.AddTracker( pRVTracker ); //texture matching - pRVTracker = new CRVTrackerMenuItem( UIE_MATCH_TEXTURE_COORDS, this, OnMatchTextureCoords, OnUpdateMatchTextureCoords); + pRVTracker = new CRVTrackerMenuItem( UIE_MATCH_TEXTURE_COORDS, this, &CRegionView::OnMatchTextureCoords, &CRegionView::OnUpdateMatchTextureCoords); m_cTrackerMgr.AddTracker( pRVTracker ); //mirroring operations - pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_X, this, OnSelectionMirrorX, OnUpdateSelectionMirrorX ); + pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_X, this, &CRegionView::OnSelectionMirrorX, &CRegionView::OnUpdateSelectionMirrorX ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_Y, this, OnSelectionMirrorY, OnUpdateSelectionMirrorY ); + pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_Y, this, &CRegionView::OnSelectionMirrorY, &CRegionView::OnUpdateSelectionMirrorY ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_Z, this, OnSelectionMirrorZ, OnUpdateSelectionMirrorZ ); + pRVTracker = new CRVTrackerMenuItem( UIE_MIRROR_Z, this, &CRegionView::OnSelectionMirrorZ, &CRegionView::OnUpdateSelectionMirrorZ ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_ALL, this, OnSelectionSelectAll, OnUpdateSelectionSelectAll ); + pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_ALL, this, &CRegionView::OnSelectionSelectAll, &CRegionView::OnUpdateSelectionSelectAll ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_INVERSE, this, OnSelectionSelectInverse, OnUpdateSelectionSelectInverse ); + pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_INVERSE, this, &CRegionView::OnSelectionSelectInverse, &CRegionView::OnUpdateSelectionSelectInverse ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_CONTAINER, this, OnSelectionContainer, OnUpdateSelectionContainer ); + pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_CONTAINER, this, &CRegionView::OnSelectionContainer, &CRegionView::OnUpdateSelectionContainer ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_ADVANCED_SELECT, this, OnSelectionAdvanced, OnUpdateSelectionAdvanced ); + pRVTracker = new CRVTrackerMenuItem( UIE_ADVANCED_SELECT, this, &CRegionView::OnSelectionAdvanced, &CRegionView::OnUpdateSelectionAdvanced ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SCALE_SELECTION, this, OnSelectionScale, OnUpdateSelectionScale ); + pRVTracker = new CRVTrackerMenuItem( UIE_SCALE_SELECTION, this, &CRegionView::OnSelectionScale, &CRegionView::OnUpdateSelectionScale ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SAVE_AS_PREFAB, this, OnSelectionSavePrefab, OnUpdateSelectionSavePrefab ); + pRVTracker = new CRVTrackerMenuItem( UIE_SAVE_AS_PREFAB, this, &CRegionView::OnSelectionSavePrefab, &CRegionView::OnUpdateSelectionSavePrefab ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_GENERATE_UNIQUE_NAMES, this, OnSelectionGenerateUniqueNames, OnUpdateSelectionGenerateUniqueNames ); + pRVTracker = new CRVTrackerMenuItem( UIE_GENERATE_UNIQUE_NAMES, this, &CRegionView::OnSelectionGenerateUniqueNames, &CRegionView::OnUpdateSelectionGenerateUniqueNames ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_GROUP_SELECTION, this, OnSelectionGroup, OnUpdateSelectionGroup ); + pRVTracker = new CRVTrackerMenuItem( UIE_GROUP_SELECTION, this, &CRegionView::OnSelectionGroup, &CRegionView::OnUpdateSelectionGroup ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_FLIP_BRUSH, this, OnBrushFlip, OnUpdateBrushFlip ); + pRVTracker = new CRVTrackerMenuItem( UIE_FLIP_BRUSH, this, &CRegionView::OnBrushFlip, &CRegionView::OnUpdateBrushFlip ); m_cTrackerMgr.AddTracker( pRVTracker ); //handle redo/undo operations - pRVTracker = new CRVTrackerMenuItem( UIE_EDIT_UNDO, this, OnEditUndo, OnUpdateEditUndo ); + pRVTracker = new CRVTrackerMenuItem( UIE_EDIT_UNDO, this, &CRegionView::OnEditUndo, &CRegionView::OnUpdateEditUndo ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_EDIT_REDO, this, OnEditRedo, OnUpdateEditRedo ); + pRVTracker = new CRVTrackerMenuItem( UIE_EDIT_REDO, this, &CRegionView::OnEditRedo, &CRegionView::OnUpdateEditRedo ); m_cTrackerMgr.AddTracker( pRVTracker ); //setup the trackers for the different views - pRVTracker = new CRVTrackerMenuItem( UIE_TOP_VIEW, this, OnTopView, OnUpdateTopView ); + pRVTracker = new CRVTrackerMenuItem( UIE_TOP_VIEW, this, &CRegionView::OnTopView, &CRegionView::OnUpdateTopView ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_BOTTOM_VIEW, this, OnBottomView, OnUpdateBottomView ); + pRVTracker = new CRVTrackerMenuItem( UIE_BOTTOM_VIEW, this, &CRegionView::OnBottomView, &CRegionView::OnUpdateBottomView ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_LEFT_VIEW, this, OnLeftView, OnUpdateLeftView ); + pRVTracker = new CRVTrackerMenuItem( UIE_LEFT_VIEW, this, &CRegionView::OnLeftView, &CRegionView::OnUpdateLeftView ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_RIGHT_VIEW, this, OnRightView, OnUpdateRightView ); + pRVTracker = new CRVTrackerMenuItem( UIE_RIGHT_VIEW, this, &CRegionView::OnRightView, &CRegionView::OnUpdateRightView ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_FRONT_VIEW, this, OnFrontView, OnUpdateFrontView ); + pRVTracker = new CRVTrackerMenuItem( UIE_FRONT_VIEW, this, &CRegionView::OnFrontView, &CRegionView::OnUpdateFrontView ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_BACK_VIEW, this, OnBackView, OnUpdateBackView ); + pRVTracker = new CRVTrackerMenuItem( UIE_BACK_VIEW, this, &CRegionView::OnBackView, &CRegionView::OnUpdateBackView ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_PERSPECTIVE_VIEW, this, OnPerspectiveView, OnUpdatePerspectiveView ); + pRVTracker = new CRVTrackerMenuItem( UIE_PERSPECTIVE_VIEW, this, &CRegionView::OnPerspectiveView, &CRegionView::OnUpdatePerspectiveView ); m_cTrackerMgr.AddTracker( pRVTracker ); //navigator trackers - pRVTracker = new CRVTrackerMenuItem( UIE_NAVIGATOR_STORE, this, OnNavigatorStore, OnUpdateNavigatorStore ); + pRVTracker = new CRVTrackerMenuItem( UIE_NAVIGATOR_STORE, this, &CRegionView::OnNavigatorStore, &CRegionView::OnUpdateNavigatorStore ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_NAVIGATOR_ORGANIZE, this, OnNavigatorOrganize, OnUpdateNavigatorOrganize ); + pRVTracker = new CRVTrackerMenuItem( UIE_NAVIGATOR_ORGANIZE, this, &CRegionView::OnNavigatorOrganize, &CRegionView::OnUpdateNavigatorOrganize ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_NAVIGATOR_NEXT, this, OnNavigatorGotoNext, OnUpdateNavigatorGotoNext ); + pRVTracker = new CRVTrackerMenuItem( UIE_NAVIGATOR_NEXT, this, &CRegionView::OnNavigatorGotoNext, &CRegionView::OnUpdateNavigatorGotoNext ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_NAVIGATOR_PREVIOUS, this, OnNavigatorGotoPrevious, OnUpdateNavigatorGotoPrevious ); + pRVTracker = new CRVTrackerMenuItem( UIE_NAVIGATOR_PREVIOUS, this, &CRegionView::OnNavigatorGotoPrevious, &CRegionView::OnUpdateNavigatorGotoPrevious ); m_cTrackerMgr.AddTracker( pRVTracker ); //handle adding objects - pRVTracker = new CRVTrackerMenuItem( UIE_ADD_OBJECT, this, OnAddObject, OnUpdateAddObject ); + pRVTracker = new CRVTrackerMenuItem( UIE_ADD_OBJECT, this, &CRegionView::OnAddObject, &CRegionView::OnUpdateAddObject ); m_cTrackerMgr.AddTracker( pRVTracker ); //handle the different shade modes - pRVTracker = new CRVTrackerMenuItem( UIE_SHADE_FLAT, this, OnShadeFlat, OnUpdateShadeFlat ); + pRVTracker = new CRVTrackerMenuItem( UIE_SHADE_FLAT, this, &CRegionView::OnShadeFlat, &CRegionView::OnUpdateShadeFlat ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SHADE_WIREFRAME, this, OnShadeWireframe, OnUpdateShadeWireframe ); + pRVTracker = new CRVTrackerMenuItem( UIE_SHADE_WIREFRAME, this, &CRegionView::OnShadeWireframe, &CRegionView::OnUpdateShadeWireframe ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SHADE_TEXTURES, this, OnShadeTextured, OnUpdateShadeTextured ); + pRVTracker = new CRVTrackerMenuItem( UIE_SHADE_TEXTURES, this, &CRegionView::OnShadeTextured, &CRegionView::OnUpdateShadeTextured ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SHADE_LIGHTMAPS, this, OnShadeLightmapsOnly, OnUpdateShadeLightmapsOnly ); + pRVTracker = new CRVTrackerMenuItem( UIE_SHADE_LIGHTMAPS, this, &CRegionView::OnShadeLightmapsOnly, &CRegionView::OnUpdateShadeLightmapsOnly ); m_cTrackerMgr.AddTracker( pRVTracker ); //surface applicators - pRVTracker = new CRVTrackerMenuItem( UIE_APPLY_COLOR, this, OnApplyColor, OnUpdateApplyColor ); + pRVTracker = new CRVTrackerMenuItem( UIE_APPLY_COLOR, this, &CRegionView::OnApplyColor, &CRegionView::OnUpdateApplyColor ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_TEXTURE, this, OnSelectTexture, OnUpdateSelectTexture ); + pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_TEXTURE, this, &CRegionView::OnSelectTexture, &CRegionView::OnUpdateSelectTexture ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_BRUSH_COLOR, this, OnSelectBrushColor, OnUpdateSelectBrushColor ); + pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_BRUSH_COLOR, this, &CRegionView::OnSelectBrushColor, &CRegionView::OnUpdateSelectBrushColor ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_PREFAB, this, OnSelectPrefab, OnUpdateSelectPrefab ); + pRVTracker = new CRVTrackerMenuItem( UIE_SELECT_PREFAB, this, &CRegionView::OnSelectPrefab, &CRegionView::OnUpdateSelectPrefab ); m_cTrackerMgr.AddTracker( pRVTracker ); //handle hiding - pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_INVERSE, this, OnSelectionHideInverse, OnUpdateSelectionHideInverse ); + pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_INVERSE, this, &CRegionView::OnSelectionHideInverse, &CRegionView::OnUpdateSelectionHideInverse ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_UNHIDE_INVERSE, this, OnSelectionUnhideInverse, OnUpdateSelectionUnhideInverse ); + pRVTracker = new CRVTrackerMenuItem( UIE_UNHIDE_INVERSE, this, &CRegionView::OnSelectionUnhideInverse, &CRegionView::OnUpdateSelectionUnhideInverse ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_SELECTED, this, OnSelectionHideSelected, OnUpdateSelectionHideSelected ); + pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_SELECTED, this, &CRegionView::OnSelectionHideSelected, &CRegionView::OnUpdateSelectionHideSelected ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_UNHIDE_SELECTED, this, OnSelectionUnhideSelected, OnUpdateSelectionUnhideSelected ); + pRVTracker = new CRVTrackerMenuItem( UIE_UNHIDE_SELECTED, this, &CRegionView::OnSelectionUnhideSelected, &CRegionView::OnUpdateSelectionUnhideSelected ); m_cTrackerMgr.AddTracker( pRVTracker ); //handle rotation of objects - pRVTracker = new CRVTrackerMenuItem( UIE_ROTATE_SELECTION, this, OnRotateSelection, OnUpdateRotateSelection ); + pRVTracker = new CRVTrackerMenuItem( UIE_ROTATE_SELECTION, this, &CRegionView::OnRotateSelection, &CRegionView::OnUpdateRotateSelection ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVCallback(UIE_ROTATE_SELECTION_LEFT, this, CRegionView::OnNudgeRotate); + pRVTracker = new CRVCallback(UIE_ROTATE_SELECTION_LEFT, this, &CRegionView::OnNudgeRotate); ((CRVCallback *)pRVTracker)->SetData(VK_LEFT); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVCallback(UIE_ROTATE_SELECTION_RIGHT, this, CRegionView::OnNudgeRotate); + pRVTracker = new CRVCallback(UIE_ROTATE_SELECTION_RIGHT, this, &CRegionView::OnNudgeRotate); ((CRVCallback *)pRVTracker)->SetData(VK_RIGHT); m_cTrackerMgr.AddTracker( pRVTracker ); //handle binding brushes to objects - pRVTracker = new CRVTrackerMenuItem( UIE_BIND_TO_OBJECT, this, OnBindToObject, OnUpdateBindToObject ); + pRVTracker = new CRVTrackerMenuItem( UIE_BIND_TO_OBJECT, this, &CRegionView::OnBindToObject, &CRegionView::OnUpdateBindToObject ); m_cTrackerMgr.AddTracker( pRVTracker ); //handle the model showing keys - pRVTracker = new CRVTrackerMenuItem( UIE_SHOW_ALL_MODELS, this, OnDisplayAllModels, OnUpdateDisplayAllModels); + pRVTracker = new CRVTrackerMenuItem( UIE_SHOW_ALL_MODELS, this, &CRegionView::OnDisplayAllModels, &CRegionView::OnUpdateDisplayAllModels); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_ALL_MODELS, this, OnHideAllModels, OnUpdateHideAllModels); + pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_ALL_MODELS, this, &CRegionView::OnHideAllModels, &CRegionView::OnUpdateHideAllModels); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SHOW_SELECTED_MODELS, this, OnDisplaySelectedModels, OnUpdateDisplaySelectedModels); + pRVTracker = new CRVTrackerMenuItem( UIE_SHOW_SELECTED_MODELS, this, &CRegionView::OnDisplaySelectedModels, &CRegionView::OnUpdateDisplaySelectedModels); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_SELECTED_MODELS, this, OnHideSelectedModels, OnUpdateHideSelectedModels); + pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_SELECTED_MODELS, this, &CRegionView::OnHideSelectedModels, &CRegionView::OnUpdateHideSelectedModels); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SHOW_MODELS_OF_CLASS, this, OnDisplayModelsOfClass, OnUpdateDisplayModelsOfClass); + pRVTracker = new CRVTrackerMenuItem( UIE_SHOW_MODELS_OF_CLASS, this, &CRegionView::OnDisplayModelsOfClass, &CRegionView::OnUpdateDisplayModelsOfClass); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_MODELS_OF_CLASS, this, OnHideModelsOfClass, OnUpdateHideModelsOfClass); + pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_MODELS_OF_CLASS, this, &CRegionView::OnHideModelsOfClass, &CRegionView::OnUpdateHideModelsOfClass); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_SHOW_MODEL_POLYCOUNT, this, OnDisplayModelPolycount, OnUpdateDisplayModelPolycount); + pRVTracker = new CRVTrackerMenuItem( UIE_SHOW_MODEL_POLYCOUNT, this, &CRegionView::OnDisplayModelPolycount, &CRegionView::OnUpdateDisplayModelPolycount); m_cTrackerMgr.AddTracker( pRVTracker ); //the trackers for creating primitives - pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_BOX, this, OnCreatePrimitiveBox, OnUpdateCreatePrimitiveBox); + pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_BOX, this, &CRegionView::OnCreatePrimitiveBox, &CRegionView::OnUpdateCreatePrimitiveBox); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_DOME, this, OnCreatePrimitiveDome, OnUpdateCreatePrimitiveDome); + pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_DOME, this, &CRegionView::OnCreatePrimitiveDome, &CRegionView::OnUpdateCreatePrimitiveDome); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_SPHERE, this, OnCreatePrimitiveSphere, OnUpdateCreatePrimitiveSphere); + pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_SPHERE, this, &CRegionView::OnCreatePrimitiveSphere, &CRegionView::OnUpdateCreatePrimitiveSphere); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_PLANE, this, OnCreatePrimitivePlane, OnUpdateCreatePrimitivePlane); + pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_PLANE, this, &CRegionView::OnCreatePrimitivePlane, &CRegionView::OnUpdateCreatePrimitivePlane); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_PYRAMID, this, OnCreatePrimitivePyramid, OnUpdateCreatePrimitivePyramid); + pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_PYRAMID, this, &CRegionView::OnCreatePrimitivePyramid, &CRegionView::OnUpdateCreatePrimitivePyramid); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_CYLINDER, this, OnCreatePrimitiveCylinder, OnUpdateCreatePrimitiveCylinder); + pRVTracker = new CRVTrackerMenuItem( UIE_CREATE_CYLINDER, this, &CRegionView::OnCreatePrimitiveCylinder, &CRegionView::OnUpdateCreatePrimitiveCylinder); m_cTrackerMgr.AddTracker( pRVTracker ); //setup the trackers for the different modes - pRVTracker = new CRVCallbackSimple(UIE_OBJECT_EDIT_MODE, this, CRegionView::SetObjectEditMode); + pRVTracker = new CRVCallbackSimple(UIE_OBJECT_EDIT_MODE, this, &CRegionView::SetObjectEditMode); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVCallbackSimple(UIE_GEOMETRY_EDIT_MODE, this, CRegionView::SetGeometryEditMode); + pRVTracker = new CRVCallbackSimple(UIE_GEOMETRY_EDIT_MODE, this, &CRegionView::SetGeometryEditMode); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVCallbackSimple(UIE_BRUSH_EDIT_MODE, this, CRegionView::SetBrushEditMode); + pRVTracker = new CRVCallbackSimple(UIE_BRUSH_EDIT_MODE, this, &CRegionView::SetBrushEditMode); m_cTrackerMgr.AddTracker( pRVTracker ); //texturing - pRVTracker = new CRVCallbackSimple( UIE_NEXT_TEXTURE_LAYER, this, CRegionView::NextTextureLayer); + pRVTracker = new CRVCallbackSimple( UIE_NEXT_TEXTURE_LAYER, this, &CRegionView::NextTextureLayer); m_cTrackerMgr.AddTracker( pRVTracker ); pRVTracker = new CRVTrackerTextureWrap( UIE_TEXTURE_WRAP, this); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MAP_TEXTURE_COORDS, this, OnMapTextureCoords, OnUpdateMapTextureCoords ); + pRVTracker = new CRVTrackerMenuItem( UIE_MAP_TEXTURE_COORDS, this, &CRegionView::OnMapTextureCoords, &CRegionView::OnUpdateMapTextureCoords ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_MAP_TEXTURE_TO_VIEW, this, OnMapTextureToView, OnUpdateMapTextureToView ); + pRVTracker = new CRVTrackerMenuItem( UIE_MAP_TEXTURE_TO_VIEW, this, &CRegionView::OnMapTextureToView, &CRegionView::OnUpdateMapTextureToView ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_RESET_TEXTURE_COORDS, this, OnResetTextureCoords, OnUpdateResetTextureCoords ); + pRVTracker = new CRVTrackerMenuItem( UIE_RESET_TEXTURE_COORDS, this, &CRegionView::OnResetTextureCoords, &CRegionView::OnUpdateResetTextureCoords ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_REPLACE_TEXTURES, this, OnReplaceTextures, OnUpdateReplaceTextures ); + pRVTracker = new CRVTrackerMenuItem( UIE_REPLACE_TEXTURES, this, &CRegionView::OnReplaceTextures, &CRegionView::OnUpdateReplaceTextures ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_REPLACE_TEXTURES_IN_SEL, this, OnReplaceTexturesInSel, OnUpdateReplaceTexturesInSel ); + pRVTracker = new CRVTrackerMenuItem( UIE_REPLACE_TEXTURES_IN_SEL, this, &CRegionView::OnReplaceTexturesInSel, &CRegionView::OnUpdateReplaceTexturesInSel ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_FIT_TEXTURE_TO_POLY, this, OnFitTextureToPoly, OnUpdateFitTextureToPoly ); + pRVTracker = new CRVTrackerMenuItem( UIE_FIT_TEXTURE_TO_POLY, this, &CRegionView::OnFitTextureToPoly, &CRegionView::OnUpdateFitTextureToPoly ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_TOGGLE_CLASS_ICONS, this, OnToggleClassIcons, OnUpdateToggleClassIcons ); + pRVTracker = new CRVTrackerMenuItem( UIE_TOGGLE_CLASS_ICONS, this, &CRegionView::OnToggleClassIcons, &CRegionView::OnUpdateToggleClassIcons ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_FROZEN_NODES, this, OnHideFrozenNodes, OnUpdateHideFrozenNodes ); + pRVTracker = new CRVTrackerMenuItem( UIE_HIDE_FROZEN_NODES, this, &CRegionView::OnHideFrozenNodes, &CRegionView::OnUpdateHideFrozenNodes ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_CAMERA_TO_OBJECT, this, OnCameraToObject, OnUpdateCameraToObject ); + pRVTracker = new CRVTrackerMenuItem( UIE_CAMERA_TO_OBJECT, this, &CRegionView::OnCameraToObject, &CRegionView::OnUpdateCameraToObject ); m_cTrackerMgr.AddTracker( pRVTracker ); - pRVTracker = new CRVTrackerMenuItem( UIE_DISCONNECT_SELECTED_PREFABS, this, OnDisconnectSelectedPrefabs, OnUpdateDisconnectSelectedPrefabs ); + pRVTracker = new CRVTrackerMenuItem( UIE_DISCONNECT_SELECTED_PREFABS, this, &CRegionView::OnDisconnectSelectedPrefabs, &CRegionView::OnUpdateDisconnectSelectedPrefabs ); m_cTrackerMgr.AddTracker( pRVTracker ); //class icons - pRVTracker = new CRVTrackerMenuItem( UIE_TOGGLE_CLASS_ICONS, this, OnToggleClassIcons, OnUpdateToggleClassIcons); + pRVTracker = new CRVTrackerMenuItem( UIE_TOGGLE_CLASS_ICONS, this, &CRegionView::OnToggleClassIcons, &CRegionView::OnUpdateToggleClassIcons); m_cTrackerMgr.AddTracker( pRVTracker ); } diff --git a/tools/DEdit/draw/d3d_texturemgr.cpp b/tools/DEdit/draw/d3d_texturemgr.cpp index 1cbf691a..af49c257 100644 --- a/tools/DEdit/draw/d3d_texturemgr.cpp +++ b/tools/DEdit/draw/d3d_texturemgr.cpp @@ -8,10 +8,13 @@ #include "draw_d3d.h" #include "texture.h" #include "cyclemgr.h" +//#include "d3d9.h" #define NUM_VALID_TEXTURE_SIZES (sizeof(g_TextureSizes) / sizeof(g_TextureSizes[0])) +//typedef DWORD D3DTEXTUREHANDLE; +//typedef struct IDirect3DTexture9* LPDIRECT3DTEXTURE9, * PDIRECT3DTEXTURE9; // ------------------------------------------------------------------------ // // Structures. diff --git a/tools/DEdit/draw/draw_d3d.cpp b/tools/DEdit/draw/draw_d3d.cpp index cbcb50e3..2dcc2343 100644 --- a/tools/DEdit/draw/draw_d3d.cpp +++ b/tools/DEdit/draw/draw_d3d.cpp @@ -197,11 +197,11 @@ D3DRender::~D3DRender() BOOL D3DRender::Init(int deviceNum, int renderMode, CRect *pRect) { - if (!TdGuard::Aegis::GetSingleton().DoWork()) - { - ExitProcess(0); - return FALSE; - } + //if (!TdGuard::Aegis::GetSingleton().DoWork()) + //{ + // ExitProcess(0); + // return FALSE; + //} HRESULT hResult; diff --git a/tools/DEdit/draw/draw_d3d.h b/tools/DEdit/draw/draw_d3d.h index b35fede0..285dd4b2 100644 --- a/tools/DEdit/draw/draw_d3d.h +++ b/tools/DEdit/draw/draw_d3d.h @@ -7,6 +7,7 @@ // Defines structures used by DEdit's d3d renderer. #ifndef __DRAW_D3D_H__ #define __DRAW_D3D_H__ +//#define DIRECT3D_VERSION 0x0700 #include "drawmgr.h" #include "regiondoc.h" @@ -14,7 +15,74 @@ #include "d3d.h" #include "edithelpers.h" #include "drawbase.h" - + #include "ddraw.h" + + //typedef struct IDirect3D3* LPDIRECT3D3; + //typedef struct IDirect3DDevice3* LPDIRECT3DDEVICE3; + //typedef struct IDirect3DMaterial3* LPDIRECT3DMATERIAL3; + //typedef struct IDirect3DViewport3* LPDIRECT3DVIEWPORT3; + //typedef struct IDirect3DVertexBuffer* LPDIRECT3DVERTEXBUFFER; + + //typedef float D3DVALUE, * LPD3DVALUE; + + //typedef struct _D3DPrimCaps { + // DWORD dwSize; + // DWORD dwMiscCaps; /* Capability flags */ + // DWORD dwRasterCaps; + // DWORD dwZCmpCaps; + // DWORD dwSrcBlendCaps; + // DWORD dwDestBlendCaps; + // DWORD dwAlphaCmpCaps; + // DWORD dwShadeCaps; + // DWORD dwTextureCaps; + // DWORD dwTextureFilterCaps; + // DWORD dwTextureBlendCaps; + // DWORD dwTextureAddressCaps; + // DWORD dwStippleWidth; /* maximum width and height of */ + // DWORD dwStippleHeight; /* of supported stipple (up to 32x32) */ + //} D3DPRIMCAPS, * LPD3DPRIMCAPS; + + //typedef struct _D3DDeviceDesc7 { + // DWORD dwDevCaps; /* Capabilities of device */ + // D3DPRIMCAPS dpcLineCaps; + // D3DPRIMCAPS dpcTriCaps; + // DWORD dwDeviceRenderBitDepth; /* One of DDBB_8, 16, etc.. */ + // DWORD dwDeviceZBufferBitDepth;/* One of DDBD_16, 32, etc.. */ + + // DWORD dwMinTextureWidth, dwMinTextureHeight; + // DWORD dwMaxTextureWidth, dwMaxTextureHeight; + + // DWORD dwMaxTextureRepeat; + // DWORD dwMaxTextureAspectRatio; + // DWORD dwMaxAnisotropy; + + // D3DVALUE dvGuardBandLeft; + // D3DVALUE dvGuardBandTop; + // D3DVALUE dvGuardBandRight; + // D3DVALUE dvGuardBandBottom; + + // D3DVALUE dvExtentsAdjust; + // DWORD dwStencilCaps; + + // DWORD dwFVFCaps; + // DWORD dwTextureOpCaps; + // WORD wMaxTextureBlendStages; + // WORD wMaxSimultaneousTextures; + + // DWORD dwMaxActiveLights; + // D3DVALUE dvMaxVertexW; + // GUID deviceGUID; + + // WORD wMaxUserClipPlanes; + // WORD wMaxVertexBlendMatrices; + + // DWORD dwVertexProcessingCaps; + + // DWORD dwReserved1; + // DWORD dwReserved2; + // DWORD dwReserved3; + // DWORD dwReserved4; + //} D3DDEVICEDESC7, * D3DDEVICEDESC; typedef struct TextureFormat_t { diff --git a/tools/shared/model/CMakeLists.txt b/tools/shared/model/CMakeLists.txt new file mode 100644 index 00000000..0c87eb4d --- /dev/null +++ b/tools/shared/model/CMakeLists.txt @@ -0,0 +1,16 @@ +project(LIB_ToolModel) + +find_package(SDL2 REQUIRED) + +set(libsources + model.cpp + model_ops.cpp) + +include_directories(../engine + ../../runtime/render_a/src/sys/d3d + ../../../sdk/inc + ../../../libs/stdlith + ../../../libs/ltamgr + ${SDL2_INCLUDE_DIRS}) + +add_library(${PROJECT_NAME} STATIC ${libsources}) \ No newline at end of file diff --git a/tools/shared/model/ltaModel.cpp b/tools/shared/model/ltaModel.cpp index 7df11499..2ee2e961 100644 --- a/tools/shared/model/ltaModel.cpp +++ b/tools/shared/model/ltaModel.cpp @@ -659,7 +659,7 @@ void AnimSetToModelAnim( MetaModel & metaModel, int cur_set, ModelAnim *pModelA { CAnimSet *pAnimSet = metaModel.GetAnimSet(cur_set); - const CKeyFrame &KeyFrame = *pAnimSet->GetKeyFrame() ; + const LTCKeyFrame &KeyFrame = *pAnimSet->GetKeyFrame() ; //set manim->m_pName ; pModelAnim->SetName( pAnimSet->GetName().c_str() ); @@ -721,7 +721,7 @@ AnimSetToModelAnimSkelMerge( MetaModel & metaModel, int va_set, int sk_set, Mode CAnimSet *pAnimSet = metaModel.GetAnimSet(va_set); CAnimSet *pSkelAnimSet = metaModel.GetAnimSet(sk_set); - const CKeyFrame &KeyFrame = *pAnimSet->GetKeyFrame() ; + const LTCKeyFrame &KeyFrame = *pAnimSet->GetKeyFrame() ; // even though the v-a anim is the host for the p-q anim data, // we lose the "VA" postfix on the name. diff --git a/tools/shared/model/ltaScene.cpp b/tools/shared/model/ltaScene.cpp index 5a2204be..262859c0 100644 --- a/tools/shared/model/ltaScene.cpp +++ b/tools/shared/model/ltaScene.cpp @@ -127,7 +127,7 @@ MetaModel::~MetaModel() } shapes.resize(0); - for ( i = 0 ; i < m_vAnimSets.size() ; i++ ) + for ( int i = 0 ; i < m_vAnimSets.size() ; i++ ) { CAnimSet *pAnimSet = m_vAnimSets[i]; delete pAnimSet ; @@ -150,7 +150,7 @@ MetaModel::~MetaModel() // if the first key frame does not start at 0, slide down the rest of the // values. // ------------------------------------------------------------------------ -void KeyFrameTimeSlideToZero( CKeyFrame & kf ) +void KeyFrameTimeSlideToZero( LTCKeyFrame & kf ) { int num_times = kf.Size(); @@ -749,7 +749,7 @@ GetTransformFromPN( Node *node, CLTANode *pnroot ) // (value ( val val val ))) // ------------------------------------------------------------------------ static -void KeyFrameFromPN( CLTANode *kf , CKeyFrame & KF, CLTATranslStatus & status ) +void KeyFrameFromPN( CLTANode *kf , LTCKeyFrame & KF, CLTATranslStatus & status ) { // check that pn is a keyframe if( kf->GetElement(0)->IsAtom() ) @@ -971,7 +971,7 @@ int AddAnimNodesToAnimSet( CLTANode *anim, // if there is no KF node in lta, get it from the anim set if( keyF != NULL ) { - CKeyFrame KeyFrame ; + LTCKeyFrame KeyFrame ; CLTATranslStatus kfstatus ; KeyFrameFromPN( keyF, KeyFrame , kfstatus ); if( kfstatus != kfstatus.OK ){ @@ -1038,7 +1038,7 @@ void LTA::AnimSetFromPN( MetaModel & metaModel, if( KFNode != NULL ) { - CKeyFrame KeyFrame ; + LTCKeyFrame KeyFrame ; CLTATranslStatus kfstatus ; // KFNode = (keyframe (keyframe ... ) we want elem 2 KFNode = KFNode->GetElement(1) ; @@ -1124,7 +1124,7 @@ void LTA::ProcessAnimSetFromLTA( MetaModel & metaModel, if( KFNode != NULL ) { - CKeyFrame KeyFrame ; + LTCKeyFrame KeyFrame ; CLTATranslStatus kfstatus ; // KFNode = (keyframe (keyframe ... ) we want elem 2 KFNode = KFNode->GetElement(1) ; diff --git a/tools/shared/model/ltaScene.h b/tools/shared/model/ltaScene.h index 3b71ac62..77853b3d 100644 --- a/tools/shared/model/ltaScene.h +++ b/tools/shared/model/ltaScene.h @@ -220,7 +220,7 @@ public : // time-value pairs, the value is an index // (keyframe name (times ( ... ) ) ) // ------------------------------------------------------------------------ -class CKeyFrame : public ILTAObject { +class LTCKeyFrame : public ILTAObject { struct key_value { key_value( int t, int idx ):time(t),index(idx) {} @@ -243,7 +243,7 @@ class CKeyFrame : public ILTAObject { // ------------------------------------------------------------------------ public : - CKeyFrame() :m_LastTime(0) {} + LTCKeyFrame() :m_LastTime(0) {} // add void Add( int time, int value ) ; @@ -255,7 +255,7 @@ class CKeyFrame : public ILTAObject { // assignment - void operator=( const CKeyFrame & kf ) ; + void operator=( const LTCKeyFrame & kf ) ; // accessors @@ -291,7 +291,7 @@ class CAnim : public ILTAObject { int m_Type ; int m_bKF_Shared ; // LT_TRUE if shared, LT_FALSE if not - CKeyFrame * m_pKeyFrame ; + LTCKeyFrame * m_pKeyFrame ; protected : CAnim( int type ):m_Type(type),m_pKeyFrame(NULL),m_bKF_Shared(LT_FALSE) {} @@ -313,15 +313,15 @@ public : // Make Own Copy of KF // set from a ref - void SetKeyFrameCopy( const CKeyFrame & kf ); + void SetKeyFrameCopy( const LTCKeyFrame & kf ); // Assign a shared version of the keyframe object - void ShareKeyFrame( CKeyFrame *kf ); + void ShareKeyFrame( LTCKeyFrame *kf ); // getKeyFrame - CKeyFrame * GetKeyFrame() ; + LTCKeyFrame * GetKeyFrame() ; // returns 0 on fail int GetKeyFrameIndexFromTime( int tm, int &start, int &end, float &percent ); @@ -434,7 +434,7 @@ class CChannelAnim : public CAnim { // ------------------------------------------------------------------------ class CAnimSet : public ILTAObject { public : - CKeyFrame m_KeyFrame ; + LTCKeyFrame m_KeyFrame ; // list of animation frames std::vector m_vAnims ; @@ -458,8 +458,8 @@ public : int NumAnims() { return m_vAnims.size(); } CAnim *GetAnim( uint32 index ) { return m_vAnims[index]; } - void SetKeyFrame( const CKeyFrame & new_kf ); - CKeyFrame *GetKeyFrame() ; + void SetKeyFrame( const LTCKeyFrame & new_kf ); + LTCKeyFrame *GetKeyFrame() ; // empty returns if there are no anims... int Empty() ; @@ -846,12 +846,12 @@ inline void Node::AddChild( Node *new_node ) { children.push_back( new_node ); } // ------------------------------------------------------------------------ // CLTAKeyFrames // ------------------------------------------------------------------------ -inline int CKeyFrame::Size() const { return m_times.size() ; } -inline void CKeyFrame::Append( const key_value & kv ) { m_times.push_back( kv ) ; } -inline void CKeyFrame::Add( int time, int value ) { m_times.push_back( key_value( time, value ) ) ; } -inline void CKeyFrame::Add( int time , std::string & value ) { m_times.push_back( key_value( time, value ) ) ; } -inline void CKeyFrame::AddValue( int index, std::string & val ) { m_times[ index ] .value = val ; } -inline void CKeyFrame::operator=( const CKeyFrame & kf ) +inline int LTCKeyFrame::Size() const { return m_times.size() ; } +inline void LTCKeyFrame::Append( const key_value & kv ) { m_times.push_back( kv ) ; } +inline void LTCKeyFrame::Add( int time, int value ) { m_times.push_back( key_value( time, value ) ) ; } +inline void LTCKeyFrame::Add( int time , std::string & value ) { m_times.push_back( key_value( time, value ) ) ; } +inline void LTCKeyFrame::AddValue( int index, std::string & val ) { m_times[ index ] .value = val ; } +inline void LTCKeyFrame::operator=( const LTCKeyFrame & kf ) { m_times.clear(); for( uint32 i = 0 ; i < kf.m_times.size() ; i++ ) @@ -861,20 +861,20 @@ inline void CKeyFrame::operator=( const CKeyFrame & kf ) // accessors -inline int CKeyFrame::GetTime( int i ) const { return m_times[i].time ; } -inline void CKeyFrame::SetTime( int index, int new_time ) { m_times[index].time = new_time ;} +inline int LTCKeyFrame::GetTime( int i ) const { return m_times[i].time ; } +inline void LTCKeyFrame::SetTime( int index, int new_time ) { m_times[index].time = new_time ;} inline const std::string& - CKeyFrame::GetVal( int i ) const { return m_times[i].value ; } + LTCKeyFrame::GetVal( int i ) const { return m_times[i].value ; } // ------------------------------------------------------------------------ -// ret CKeyFrame::GetIndex( time, start-time, end-time, percent-in-between) +// ret LTCKeyFrame::GetIndex( time, start-time, end-time, percent-in-between) // // get the keyframe index, given time. // fills ret-params with the the closest frames and the exact parametric point in between // returns 1 on success, 0 on not finding any appropriate values // ------------------------------------------------------------------------ -inline int CKeyFrame::GetIndex( int time, int &start, int &end, float &percent_in_between) const +inline int LTCKeyFrame::GetIndex( int time, int &start, int &end, float &percent_in_between) const { int timesSize = m_times.size(); @@ -915,11 +915,11 @@ inline int CKeyFrame::GetIndex( int time, int &start, int &end, float &percent_i inline int CAnim::GetType() { return m_Type ; } // Make Own Copy of KF set from a ref -inline void CAnim::SetKeyFrameCopy( const CKeyFrame & kf ) +inline void CAnim::SetKeyFrameCopy( const LTCKeyFrame & kf ) { if( m_pKeyFrame == NULL ) { - m_pKeyFrame = new CKeyFrame ; + m_pKeyFrame = new LTCKeyFrame ; } *m_pKeyFrame = kf ; @@ -927,7 +927,7 @@ inline void CAnim::SetKeyFrameCopy( const CKeyFrame & kf ) } // Assign a shared version of the keyframe object -inline void CAnim::ShareKeyFrame( CKeyFrame *kf ) +inline void CAnim::ShareKeyFrame( LTCKeyFrame *kf ) { // if not null, if already shared then overwrite the pointer, else delete old // data and assign the reference @@ -946,7 +946,7 @@ inline void CAnim::ShareKeyFrame( CKeyFrame *kf ) m_bKF_Shared = LT_TRUE ; } -inline CKeyFrame *CAnim::GetKeyFrame() { return m_pKeyFrame ; } +inline LTCKeyFrame *CAnim::GetKeyFrame() { return m_pKeyFrame ; } // returns 0 on fail inline int CAnim::GetKeyFrameIndexFromTime( int tm, int &start, int &end, float &percent ) @@ -1051,7 +1051,7 @@ inline void CAnimSet::KFFix() { if( m_vAnims.size() > 0 ) { - CKeyFrame *pKF ; + LTCKeyFrame *pKF ; for( uint32 i = 0 ; i < m_vAnims.size() ; i++ ) { pKF = m_vAnims[0]->GetKeyFrame() ; @@ -1092,9 +1092,9 @@ inline CAnim *CAnimSet::FindAnim( const std::string & name ) return NULL ; } -inline void CAnimSet::SetKeyFrame( const CKeyFrame & new_kf ) {m_KeyFrame = new_kf ; } +inline void CAnimSet::SetKeyFrame( const LTCKeyFrame & new_kf ) {m_KeyFrame = new_kf ; } -inline CKeyFrame *CAnimSet::GetKeyFrame() { return & m_KeyFrame ; } +inline LTCKeyFrame *CAnimSet::GetKeyFrame() { return & m_KeyFrame ; } // empty returns if there are no anims... inline int CAnimSet::Empty() diff --git a/tools/shared/model/model.cpp b/tools/shared/model/model.cpp index 97cec06a..56f7342b 100644 --- a/tools/shared/model/model.cpp +++ b/tools/shared/model/model.cpp @@ -25,7 +25,7 @@ // ------------------------------------------------------------------------ // Used so we can track if the filename is allocated or not. -static const char *g_pNoModelFilename = ""; +static char *g_pNoModelFilename = ""; float g_CV_DefaultDrawIndexedDist = 500.0f; diff --git a/tools/shared/model/model.h b/tools/shared/model/model.h index 245c4bef..9735dcdd 100644 --- a/tools/shared/model/model.h +++ b/tools/shared/model/model.h @@ -24,6 +24,7 @@ #include #include #include + #include "../../../libs/lith/lithtypes.h" // How the vertex weighting works: // M = skeleton transform for the given frame diff --git a/tools/shared/model/smmempnproc.cpp b/tools/shared/model/smmempnproc.cpp index e1da3f83..05597d44 100644 --- a/tools/shared/model/smmempnproc.cpp +++ b/tools/shared/model/smmempnproc.cpp @@ -6,9 +6,6 @@ // -------------------------------------------- #pragma warning (disable:4786) -#include "ltaStream.h" -#include "ltalex.h" -#include "ltaParseNode.h" #include "ltaScene.h" #include diff --git a/tools/shared/world/BoundingBox.h b/tools/shared/world/BoundingBox.h index d847780b..3f656758 100644 --- a/tools/shared/world/BoundingBox.h +++ b/tools/shared/world/BoundingBox.h @@ -20,7 +20,7 @@ // Includes.... - +#include "lithtypes.h" class CBoundingBox { @@ -35,6 +35,7 @@ void Extend( LTVector &extendBy ); LTVector Dims() const; + LTVector Foo() const; BOOL Intersects( const CBoundingBox &other ) const; LTVector Center() const; diff --git a/tools/shared/world/CMakeLists.txt b/tools/shared/world/CMakeLists.txt new file mode 100644 index 00000000..b516eec3 --- /dev/null +++ b/tools/shared/world/CMakeLists.txt @@ -0,0 +1,57 @@ +project(LIB_ToolWorld) + +find_package(SDL2 REQUIRED) + +add_definitions(-DDIRECT3D_VERSION=0x0700 -DCMAKE_GENERATOR_PLATFORM=Win32 -DWIN32 -D_WINDOWS -DDIRECTEDITOR_BUILD -DSTDLITH_MFC -DBDEFS_MFC -DPRE_FLOAT -DPREPROCESSOR_BUILD -DNO_PRAGMA_LIBS -DLT15_COMPAT -D_AFXDLL -D_WIN32_WINNT=0x501 -D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -DUSE_ID3DXEFFECT) + +set(libsources + EditBrush.cpp + EditObjects.cpp + EditPlane.cpp + EditPoly.cpp + EditRegion.cpp + TexturedPlane.cpp + BasePoly.cpp + PropList.cpp + node_ops.cpp + WorldNode.cpp + s3tc_compress.cpp + LTTexture.cpp + PrefabMgr.cpp + PrefabRef.cpp + UVtoOPQ.cpp + ../../../runtime/shared/src/genericprop_setup.cpp + ../engine/conparse.cpp) + +add_library(${PROJECT_NAME} STATIC ${libsources}) + +include_directories(../engine + ../../../sdk/inc + ../../../libs/cryptmgr + ../../../libs/butemgr + ../../../libs/stdlith + ../../../libs/lith + ../../../libs/ltamgr + ../../../libs/MFCStub + ../../../libs/dibmgr + ../../../libs/genregmgr + ../../../libs/RegMgr + ../../DEdit + ../../DEdit/Frames + ../../DEdit/Controls + ../../DEdit/Options + ../../DEdit/Dlgs + ../../DEdit/Docs + ../../DEdit/Misc + ../../DEdit/MRCEXT + ../../DEdit/Lightmap + ../../DEdit/draw + ../../DEdit/ModelView + ../../DEdit/RegionEdit + ../../DEdit/Project + ../../PreProcessor + ../../../runtime/kernel/src + ${SDL2_INCLUDE_DIRS}) + +target_link_libraries(${PROJECT_NAME} + LIB_ltamgr) \ No newline at end of file diff --git a/tools/shared/world/EditBrush.cpp b/tools/shared/world/EditBrush.cpp index 142736c6..a142599d 100644 --- a/tools/shared/world/EditBrush.cpp +++ b/tools/shared/world/EditBrush.cpp @@ -152,7 +152,7 @@ BOOL CEditBrush::LoadLTA( CLTANode* pNode, CStringHolder *pStringHolder ) CLTANode* pPolyList = PairCdrNode(pData->GetElement(2)); // PairCdrNode(shallow_find_list(pNode, "polylist" )); listSize = pPolyList->GetNumElements(); m_Polies.SetSize( listSize ); - for( i=0; i < listSize; i++ ) + for( int i=0; i < listSize; i++ ) { m_Polies[i] = new CEditPoly( this ); if( !m_Polies[i]->LoadEditPolyLTA(pPolyList->GetElement(i), pStringHolder ) ) diff --git a/tools/shared/world/PrefabMgr.h b/tools/shared/world/PrefabMgr.h index a5ee7b90..4eef5102 100644 --- a/tools/shared/world/PrefabMgr.h +++ b/tools/shared/world/PrefabMgr.h @@ -66,7 +66,7 @@ class CPrefabMgr // Our list of known prefabs CMoArray m_aPrefabs; - char m_pszRootPath[MAX_PATH]; + char m_pszRootPath[500]; }; #endif //__PREFABMGR_H__ diff --git a/tools/shared/world/PropList.h b/tools/shared/world/PropList.h index bd1623dd..bede76be 100644 --- a/tools/shared/world/PropList.h +++ b/tools/shared/world/PropList.h @@ -17,6 +17,10 @@ #ifndef __PROPLIST_H__ #define __PROPLIST_H__ + #include "bdefs.h" + #include "dynarray.h" + #include "lithtypes.h" + class CEditProjectMgr; class CLTANode; @@ -32,7 +36,7 @@ #define MAX_PROPNAME_LEN 30 #define MAX_STRINGPROP_LEN MAX_GP_STRING_LEN #define MAX_EDITPROP_LEN 80 - + #undef GetProp typedef void (*StringListFillFn)( void *pData, CMoArray &fillIn ); diff --git a/tools/shared/world/ltasaveutils.h b/tools/shared/world/ltasaveutils.h index 01f745a2..570cce19 100644 --- a/tools/shared/world/ltasaveutils.h +++ b/tools/shared/world/ltasaveutils.h @@ -14,6 +14,9 @@ #ifndef __LTASAVEUTILS_H__ #define __LTASAVEUTILS_H__ +typedef float PReal; +typedef TVector3 PVector; + //each one of these is for printing out a small list, containing only //the item specified. This list can be named by using the ...Named //variety, or it just prints out the value.