mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
Dead code removal
This commit is contained in:
parent
e1f4a7f647
commit
c1edc30ad7
9 changed files with 1 additions and 216 deletions
171
CMakeLists.txt
171
CMakeLists.txt
|
@ -54,12 +54,9 @@ endif (ANDROID)
|
|||
configure_file ("${OpenMW_SOURCE_DIR}/docs/mainpage.hpp.cmake" "${OpenMW_BINARY_DIR}/docs/mainpage.hpp")
|
||||
|
||||
option(MYGUI_STATIC "Link static build of Mygui into the binaries" FALSE)
|
||||
option(OGRE_STATIC "Link static build of Ogre and Ogre Plugins into the binaries" FALSE)
|
||||
option(BOOST_STATIC "Link static build of Boost into the binaries" FALSE)
|
||||
option(SDL2_STATIC "Link static build of SDL into the binaries" FALSE)
|
||||
|
||||
set(CUSTOM_OGRE_PLUGIN_DIR "" CACHE PATH "Specify a custom directory for Ogre plugins (autodetected by default)")
|
||||
|
||||
option(OPENMW_UNITY_BUILD "Use fewer compilation units to speed up compile time" FALSE)
|
||||
|
||||
# Apps and tools
|
||||
|
@ -197,46 +194,9 @@ find_package(SDL2 REQUIRED)
|
|||
find_package(OpenAL REQUIRED)
|
||||
find_package(Bullet REQUIRED)
|
||||
|
||||
set(OGRE_PLUGIN_INCLUDE_DIRS "")
|
||||
set(OGRE_STATIC_PLUGINS "")
|
||||
|
||||
macro(add_static_ogre_plugin PLUGIN)
|
||||
if(OGRE_${PLUGIN}_FOUND)
|
||||
# strip RenderSystem_ or Plugin_ prefix from plugin name
|
||||
string(REPLACE "RenderSystem_" "" PLUGIN_TEMP ${PLUGIN})
|
||||
string(REPLACE "Plugin_" "" PLUGIN_NAME ${PLUGIN_TEMP})
|
||||
add_definitions(-DENABLE_PLUGIN_${PLUGIN_NAME})
|
||||
|
||||
list(APPEND OGRE_PLUGIN_INCLUDE_DIRS ${OGRE_${PLUGIN}_INCLUDE_DIRS})
|
||||
list(APPEND OGRE_STATIC_PLUGINS ${OGRE_${PLUGIN}_LIBRARIES})
|
||||
endif(OGRE_${PLUGIN}_FOUND)
|
||||
endmacro(add_static_ogre_plugin)
|
||||
|
||||
if(OGRE_STATIC)
|
||||
# set up OGRE_PLUGIN_INCLUDE_DIRS and OGRE_STATIC_PLUGINS
|
||||
add_static_ogre_plugin(Plugin_OctreeSceneManager)
|
||||
add_static_ogre_plugin(Plugin_ParticleFX)
|
||||
find_package(Cg)
|
||||
if(Cg_FOUND)
|
||||
add_static_ogre_plugin(Plugin_CgProgramManager)
|
||||
list(APPEND OGRE_STATIC_PLUGINS ${Cg_LIBRARIES})
|
||||
endif(Cg_FOUND)
|
||||
|
||||
if (ANDROID)
|
||||
add_static_ogre_plugin(RenderSystem_GLES2)
|
||||
else ()
|
||||
add_static_ogre_plugin(RenderSystem_GL)
|
||||
endif ()
|
||||
|
||||
if(WIN32)
|
||||
add_static_ogre_plugin(RenderSystem_Direct3D9)
|
||||
endif(WIN32)
|
||||
endif(OGRE_STATIC)
|
||||
|
||||
include_directories("." ${LIBS_DIR}
|
||||
SYSTEM
|
||||
${OGRE_INCLUDE_DIR} ${OGRE_INCLUDE_DIR}/Ogre ${OGRE_INCLUDE_DIR}/OGRE ${OGRE_INCLUDE_DIRS} ${OGRE_PLUGIN_INCLUDE_DIRS}
|
||||
${OGRE_INCLUDE_DIR}/Overlay ${OGRE_Overlay_INCLUDE_DIR}
|
||||
${OGRE_INCLUDE_DIR} ${OGRE_INCLUDE_DIR}/Ogre ${OGRE_INCLUDE_DIR}/OGRE ${OGRE_INCLUDE_DIRS}
|
||||
${SDL2_INCLUDE_DIR}
|
||||
${Boost_INCLUDE_DIR}
|
||||
${PLATFORM_INCLUDE_DIR}
|
||||
|
@ -252,31 +212,6 @@ if(MYGUI_STATIC)
|
|||
endif (MYGUI_STATIC)
|
||||
|
||||
if (APPLE)
|
||||
# List used Ogre plugins
|
||||
SET(USED_OGRE_PLUGINS ${OGRE_RenderSystem_GL_LIBRARY_REL}
|
||||
${OGRE_Plugin_ParticleFX_LIBRARY_REL})
|
||||
|
||||
# Actually we must use OGRE_Plugin_CgProgramManager_FOUND but it's
|
||||
# not reliable and equals TRUE even if there's no Ogre Cg plugin
|
||||
if (Cg_FOUND)
|
||||
set(USED_OGRE_PLUGINS ${USED_OGRE_PLUGINS}
|
||||
${OGRE_Plugin_CgProgramManager_LIBRARY_REL})
|
||||
endif ()
|
||||
|
||||
if (${OGRE_PLUGIN_DIR_REL}})
|
||||
set(OGRE_PLUGINS_REL_FOUND TRUE)
|
||||
endif ()
|
||||
|
||||
if (${OGRE_PLUGIN_DIR_DBG})
|
||||
set(OGRE_PLUGINS_DBG_FOUND TRUE)
|
||||
endif ()
|
||||
|
||||
if (${OGRE_PLUGINS_REL_FOUND})
|
||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_REL})
|
||||
else ()
|
||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_DBG})
|
||||
endif ()
|
||||
|
||||
configure_file(${OpenMW_SOURCE_DIR}/files/mac/Info.plist
|
||||
"${APP_BUNDLE_DIR}/Contents/Info.plist")
|
||||
|
||||
|
@ -287,28 +222,6 @@ endif (APPLE)
|
|||
# Set up DEBUG define
|
||||
set_directory_properties(PROPERTIES COMPILE_DEFINITIONS_DEBUG DEBUG=1)
|
||||
|
||||
# Set up Ogre plugin folder & debug suffix
|
||||
if (APPLE)
|
||||
# Ogre on OS X doesn't use "_d" suffix (see Ogre's CMakeLists.txt)
|
||||
add_definitions(-DOGRE_PLUGIN_DEBUG_SUFFIX="")
|
||||
else ()
|
||||
add_definitions(-DOGRE_PLUGIN_DEBUG_SUFFIX="_d")
|
||||
endif()
|
||||
|
||||
if (APPLE AND OPENMW_OSX_DEPLOYMENT)
|
||||
# make it empty so plugin loading code can check this and try to find plugins inside app bundle
|
||||
add_definitions(-DOGRE_PLUGIN_DIR="")
|
||||
else()
|
||||
if (CUSTOM_OGRE_PLUGIN_DIR STREQUAL "")
|
||||
set(OGRE_PLUGIN_DIR ${OGRE_PLUGIN_DIR_REL})
|
||||
else()
|
||||
set(OGRE_PLUGIN_DIR ${CUSTOM_OGRE_PLUGIN_DIR})
|
||||
endif()
|
||||
|
||||
add_definitions(-DOGRE_PLUGIN_DIR="${OGRE_PLUGIN_DIR}")
|
||||
endif()
|
||||
|
||||
|
||||
add_subdirectory(files/)
|
||||
|
||||
# Specify build paths
|
||||
|
@ -651,12 +564,6 @@ if (WIN32)
|
|||
4987 # nonstandard extension used (triggered by setjmp.h)
|
||||
4996 # Function was declared deprecated
|
||||
|
||||
# cause by ogre extensivly
|
||||
4193 # #pragma warning(pop) : no matching '#pragma warning(push)'
|
||||
4251 # class 'XXXX' needs to have dll-interface to be used by clients of class 'YYYY'
|
||||
4275 # non dll-interface struct 'XXXX' used as base for dll-interface class 'YYYY'
|
||||
4315 # undocumented, 'this' pointer for member might not be aligned (OgreMemoryStlAllocator.h)
|
||||
|
||||
# caused by boost
|
||||
4191 # 'type cast' : unsafe conversion (1.56, thread_primitives.hpp, normally off)
|
||||
|
||||
|
@ -722,90 +629,14 @@ if (APPLE)
|
|||
set(OPENCS_BUNDLE_NAME "OpenMW-CS.app")
|
||||
set(OPENCS_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${OPENCS_BUNDLE_NAME}")
|
||||
|
||||
set(ABSOLUTE_PLUGINS "")
|
||||
|
||||
foreach (PLUGIN ${USED_OGRE_PLUGINS})
|
||||
get_filename_component(PLUGIN_ABS ${PLUGIN} REALPATH)
|
||||
set(ABSOLUTE_PLUGINS ${PLUGIN_ABS} ${ABSOLUTE_PLUGINS})
|
||||
endforeach ()
|
||||
|
||||
install(CODE "
|
||||
set(BU_CHMOD_BUNDLE_ITEMS ON)
|
||||
include(BundleUtilities)
|
||||
" COMPONENT Runtime)
|
||||
|
||||
# installs used plugins in bundle at given path (bundle_path must be relative to ${CMAKE_INSTALL_PREFIX})
|
||||
# and returns list of install paths for all installed plugins
|
||||
function (install_plugins_for_bundle bundle_path plugins_var)
|
||||
set(RELATIVE_PLUGIN_INSTALL_BASE "${bundle_path}/Contents/Frameworks")
|
||||
|
||||
set(PLUGINS "")
|
||||
set(PLUGIN_INSTALL_BASE "\${CMAKE_INSTALL_PREFIX}/${RELATIVE_PLUGIN_INSTALL_BASE}")
|
||||
|
||||
foreach (PLUGIN ${ABSOLUTE_PLUGINS})
|
||||
get_filename_component(PLUGIN_RELATIVE ${PLUGIN} NAME)
|
||||
get_filename_component(PLUGIN_RELATIVE_WE ${PLUGIN} NAME_WE)
|
||||
|
||||
set(PLUGIN_DYLIB_IN_BUNDLE "${PLUGIN_INSTALL_BASE}/${PLUGIN_RELATIVE}/${PLUGIN_RELATIVE_WE}")
|
||||
set(PLUGINS ${PLUGINS} "${PLUGIN_DYLIB_IN_BUNDLE}")
|
||||
|
||||
install(CODE "
|
||||
copy_resolved_framework_into_bundle(\"${PLUGIN}/${PLUGIN_RELATIVE_WE}\" \"${PLUGIN_DYLIB_IN_BUNDLE}\")
|
||||
" COMPONENT Runtime)
|
||||
endforeach ()
|
||||
|
||||
set(${plugins_var} ${PLUGINS} PARENT_SCOPE)
|
||||
endfunction (install_plugins_for_bundle)
|
||||
|
||||
install_plugins_for_bundle("${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}" PLUGINS)
|
||||
install_plugins_for_bundle("${INSTALL_SUBDIR}/${OPENCS_BUNDLE_NAME}" OPENCS_PLUGINS)
|
||||
|
||||
#For now, search unresolved dependencies only in default system paths, so if you put unresolveable (i.e. with @executable_path in id name) lib or framework somewhere else, it would fail
|
||||
set(DIRS "")
|
||||
|
||||
# Overriding item resolving during installation, it needed if
|
||||
# some library already has been "fixed up", i.e. its id name contains @executable_path,
|
||||
# but library is not embedded in bundle. For example, it's Ogre.framework from Ogre SDK.
|
||||
# Current implementation of GetPrerequsities/BundleUtilities doesn't handle that case.
|
||||
#
|
||||
# Current limitations:
|
||||
# 1. Handles only frameworks, not simple libs
|
||||
INSTALL(CODE "
|
||||
cmake_policy(SET CMP0009 OLD)
|
||||
set(CMAKE_FIND_LIBRARY_PREFIXES ${CMAKE_FIND_LIBRARY_PREFIXES})
|
||||
set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||
set(CMAKE_SYSTEM_FRAMEWORK_PATH ${CMAKE_SYSTEM_FRAMEWORK_PATH})
|
||||
|
||||
set(OPENMW_RESOLVED_ITEMS \"\")
|
||||
|
||||
function(gp_resolve_item_override context item exepath dirs resolved_item_var resolved_var)
|
||||
if(item MATCHES \"@executable_path\" AND NOT \${\${resolved_var}})
|
||||
if (item MATCHES \"Frameworks\") # if it is a framework
|
||||
# get last segment of path
|
||||
get_filename_component(fname \"\${item}\" NAME_WE)
|
||||
find_library(ri NAMES \${fname} PATHS \${exepath} \${dirs} \${CMAKE_SYSTEM_FRAMEWORK_PATH})
|
||||
if (ri)
|
||||
string(REGEX REPLACE \"^.*/Frameworks/.*\\\\.framework\" \"\" item_part \${item})
|
||||
set(ri \"\${ri}\${item_part}\")
|
||||
set(\${resolved_item_var} \${ri} PARENT_SCOPE)
|
||||
set(\${resolved_var} 1 PARENT_SCOPE)
|
||||
endif()
|
||||
else()
|
||||
# code path for standard (non-framework) libs (ogre & qt pugins)
|
||||
get_filename_component(fname \"\${item}\" NAME_WE)
|
||||
string(REGEX REPLACE \"^lib\" \"\" fname \${fname})
|
||||
find_library(ri NAMES \${fname} PATHS \${exepath} \${dirs} /usr/lib /usr/local/lib)
|
||||
if (ri)
|
||||
set(\${resolved_item_var} \${ri} PARENT_SCOPE)
|
||||
set(\${resolved_var} 1 PARENT_SCOPE)
|
||||
endif ()
|
||||
endif()
|
||||
endif()
|
||||
endfunction(gp_resolve_item_override)
|
||||
|
||||
fixup_bundle(\"${OPENMW_APP}\" \"${PLUGINS}\" \"${DIRS}\")
|
||||
fixup_bundle(\"${OPENCS_APP}\" \"${OPENCS_PLUGINS}\" \"${DIRS}\")
|
||||
" COMPONENT Runtime)
|
||||
include(CPack)
|
||||
endif (APPLE)
|
||||
|
||||
|
|
|
@ -90,7 +90,6 @@ add_executable(openmw-launcher
|
|||
target_link_libraries(openmw-launcher
|
||||
${Boost_LIBRARIES}
|
||||
${OGRE_LIBRARIES}
|
||||
${OGRE_STATIC_PLUGINS}
|
||||
${SDL2_LIBRARY_ONLY}
|
||||
${QT_LIBRARIES}
|
||||
components
|
||||
|
|
|
@ -201,8 +201,6 @@ endif(APPLE)
|
|||
target_link_libraries(openmw-cs
|
||||
${OENGINE_LIBRARY}
|
||||
${OGRE_LIBRARIES}
|
||||
${OGRE_Overlay_LIBRARIES}
|
||||
${OGRE_STATIC_PLUGINS}
|
||||
${OPENSCENEGRAPH_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${BULLET_LIBRARIES}
|
||||
|
|
|
@ -129,7 +129,6 @@ include_directories(${SOUND_INPUT_INCLUDES})
|
|||
target_link_libraries(openmw
|
||||
${OENGINE_LIBRARY}
|
||||
${OGRE_LIBRARIES}
|
||||
${OGRE_STATIC_PLUGINS}
|
||||
${OPENSCENEGRAPH_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${OPENAL_LIBRARY}
|
||||
|
@ -144,13 +143,11 @@ target_link_libraries(openmw
|
|||
|
||||
if (ANDROID)
|
||||
target_link_libraries(openmw
|
||||
${OGRE_STATIC_PLUGINS}
|
||||
EGL
|
||||
android
|
||||
log
|
||||
dl
|
||||
MyGUIEngineStatic
|
||||
Plugin_StrangeButtonStatic
|
||||
cpufeatures
|
||||
BulletCollision
|
||||
BulletDynamics
|
||||
|
|
|
@ -277,16 +277,6 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
|
|||
mEnvironment.setStateManager (
|
||||
new MWState::StateManager (mCfgMgr.getUserDataPath() / "saves", mContentFiles.at (0)));
|
||||
|
||||
std::string renderSystem = settings.getString("render system", "Video");
|
||||
if (renderSystem == "")
|
||||
{
|
||||
#if OGRE_PLATFORM == OGRE_PLATFORM_WIN32
|
||||
renderSystem = "Direct3D9 Rendering Subsystem";
|
||||
#else
|
||||
renderSystem = "OpenGL Rendering Subsystem";
|
||||
#endif
|
||||
}
|
||||
|
||||
//OEngine::Render::WindowSettings windowSettings;
|
||||
//windowSettings.fullscreen = settings.getBool("fullscreen", "Video");
|
||||
//windowSettings.window_border = settings.getBool("window border", "Video");
|
||||
|
|
|
@ -75,11 +75,6 @@ namespace
|
|||
return MyGUI::utility::toString(xaspect) + " : " + MyGUI::utility::toString(yaspect);
|
||||
}
|
||||
|
||||
std::string hlslGlsl ()
|
||||
{
|
||||
return (Ogre::Root::getSingleton ().getRenderSystem ()->getName ().find("OpenGL") != std::string::npos) ? "glsl" : "hlsl";
|
||||
}
|
||||
|
||||
const char* checkButtonType = "CheckButton";
|
||||
const char* sliderType = "Slider";
|
||||
|
||||
|
@ -180,7 +175,6 @@ namespace MWGui
|
|||
getWidget(mAnisotropyLabel, "AnisotropyLabel");
|
||||
getWidget(mAnisotropyBox, "AnisotropyBox");
|
||||
getWidget(mShadersButton, "ShadersButton");
|
||||
getWidget(mShaderModeButton, "ShaderModeButton");
|
||||
getWidget(mShadowsEnabledButton, "ShadowsEnabledButton");
|
||||
getWidget(mShadowsTextureSize, "ShadowsTextureSize");
|
||||
getWidget(mControlsBox, "ControlsBox");
|
||||
|
@ -207,7 +201,6 @@ namespace MWGui
|
|||
mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord += MyGUI::newDelegate(this, &SettingsWindow::onWindowResize);
|
||||
|
||||
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onOkButtonClicked);
|
||||
mShaderModeButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onShaderModeToggled);
|
||||
mTextureFilteringButton->eventComboChangePosition += MyGUI::newDelegate(this, &SettingsWindow::onTextureFilteringChanged);
|
||||
mFPSButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SettingsWindow::onFpsToggled);
|
||||
mResolutionList->eventListChangePosition += MyGUI::newDelegate(this, &SettingsWindow::onResolutionSelected);
|
||||
|
@ -248,8 +241,6 @@ namespace MWGui
|
|||
|
||||
mShadowsTextureSize->setCaption (Settings::Manager::getString ("texture size", "Shadows"));
|
||||
|
||||
mShaderModeButton->setCaption (Settings::Manager::getString("shader mode", "General"));
|
||||
|
||||
if (!Settings::Manager::getBool("shaders", "Objects"))
|
||||
{
|
||||
mRefractionButton->setEnabled(false);
|
||||
|
@ -398,17 +389,6 @@ namespace MWGui
|
|||
}
|
||||
}
|
||||
|
||||
void SettingsWindow::onShaderModeToggled(MyGUI::Widget* _sender)
|
||||
{
|
||||
std::string val = hlslGlsl();
|
||||
|
||||
_sender->castType<MyGUI::Button>()->setCaption(val);
|
||||
|
||||
Settings::Manager::setString("shader mode", "General", val);
|
||||
|
||||
apply();
|
||||
}
|
||||
|
||||
void SettingsWindow::onFpsToggled(MyGUI::Widget* _sender)
|
||||
{
|
||||
int newLevel = (Settings::Manager::getInt("fps", "HUD") + 1) % 2;
|
||||
|
|
|
@ -37,7 +37,6 @@ namespace MWGui
|
|||
MyGUI::TextBox* mAnisotropyLabel;
|
||||
MyGUI::Widget* mAnisotropyBox;
|
||||
MyGUI::Button* mShadersButton;
|
||||
MyGUI::Button* mShaderModeButton;
|
||||
MyGUI::Button* mRefractionButton;
|
||||
|
||||
MyGUI::Button* mShadowsEnabledButton;
|
||||
|
@ -59,7 +58,6 @@ namespace MWGui
|
|||
void onResolutionAccept();
|
||||
void onResolutionCancel();
|
||||
|
||||
void onShaderModeToggled(MyGUI::Widget* _sender);
|
||||
void onShadowTextureSizeChanged(MyGUI::ComboBox* _sender, size_t pos);
|
||||
|
||||
void onRebindAction(MyGUI::Widget* _sender);
|
||||
|
|
|
@ -271,12 +271,6 @@
|
|||
<Property key="Caption" value="Object shaders"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
<Widget type="HBox" skin="" position="182 154 300 24">
|
||||
<Widget type="AutoSizedButton" skin="MW_Button" position="0 0 24 24" align="Left Top" name="ShaderModeButton"/>
|
||||
<Widget type="AutoSizedTextBox" skin="SandText" position="28 4 93 16" align="Left Top">
|
||||
<Property key="Caption" value="Shader mode"/>
|
||||
</Widget>
|
||||
</Widget>
|
||||
<Widget type="TextBox" skin="NormalText" position="0 198 329 18" align="Left Top" name="FovText">
|
||||
<Property key="Caption" value="Field of View"/>
|
||||
</Widget>
|
||||
|
|
|
@ -59,8 +59,6 @@ anisotropy = 4
|
|||
# Number of texture mipmaps to generate
|
||||
num mipmaps = 8
|
||||
|
||||
shader mode =
|
||||
|
||||
screenshot format = png
|
||||
|
||||
[Shadows]
|
||||
|
|
Loading…
Reference in a new issue