1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-25 06:35:30 +00:00

Merge OpenMW/master

This commit is contained in:
AnyOldName3 2017-10-13 21:39:15 +01:00
commit 147455626e
11 changed files with 89 additions and 43 deletions

1
.gitignore vendored
View File

@ -26,6 +26,7 @@ Doxygen
.settings
.directory
.idea
cmake-build-*
files/windows/*.aps
## qt-creator
CMakeLists.txt.user*

View File

@ -88,6 +88,7 @@ Programmers
lazydev
Leon Krieg (lkrieg)
Leon Saunders (emoose)
Łukasz Gołębiewski (lukago)
logzero
lohikaarme
Lukasz Gromanowski (lgro)

View File

@ -750,19 +750,4 @@ if [ -z $VERBOSE ]; then
fi
fi
if [ -z $CI ]; then
echo "- Copying Runtime Resources/Config Files"
echo " gamecontrollerdb.txt"
cp gamecontrollerdb.txt $BUILD_CONFIG/gamecontrollerdb.txt
echo " openmw.cfg"
cp openmw.cfg.install $BUILD_CONFIG/openmw.cfg
echo " openmw-cs.cfg"
cp openmw-cs.cfg $BUILD_CONFIG/openmw-cs.cfg
echo " settings-default.cfg"
cp settings-default.cfg $BUILD_CONFIG/settings-default.cfg
echo " resources/"
cp -r resources $BUILD_CONFIG
echo
fi
exit $RET

View File

@ -313,27 +313,27 @@ endif (APPLE)
# Other files
configure_file(${OpenMW_SOURCE_DIR}/files/settings-default.cfg
"${OpenMW_BINARY_DIR}/settings-default.cfg")
configure_resource_file(${OpenMW_SOURCE_DIR}/files/settings-default.cfg
"${OpenMW_BINARY_DIR}" "settings-default.cfg")
if (NOT APPLE)
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg.local
"${OpenMW_BINARY_DIR}/openmw.cfg")
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg
"${OpenMW_BINARY_DIR}/openmw.cfg.install")
configure_resource_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg.local
"${OpenMW_BINARY_DIR}" "openmw.cfg")
configure_resource_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg
"${OpenMW_BINARY_DIR}" "openmw.cfg.install")
else ()
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg
"${OpenMW_BINARY_DIR}/openmw.cfg")
endif ()
configure_file(${OpenMW_SOURCE_DIR}/files/openmw-cs.cfg
"${OpenMW_BINARY_DIR}/openmw-cs.cfg")
configure_resource_file(${OpenMW_SOURCE_DIR}/files/openmw-cs.cfg
"${OpenMW_BINARY_DIR}" "openmw-cs.cfg")
configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters
"${OpenMW_BINARY_DIR}/resources/defaultfilters" COPYONLY)
configure_resource_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters
"${OpenMW_BINARY_DIR}" "resources/defaultfilters" COPYONLY)
configure_file(${OpenMW_SOURCE_DIR}/files/gamecontrollerdb.txt
"${OpenMW_BINARY_DIR}/gamecontrollerdb.txt")
configure_resource_file(${OpenMW_SOURCE_DIR}/files/gamecontrollerdb.txt
"${OpenMW_BINARY_DIR}" "gamecontrollerdb.txt")
if (NOT WIN32 AND NOT APPLE)
configure_file(${OpenMW_SOURCE_DIR}/files/openmw.desktop

View File

@ -430,6 +430,7 @@ namespace MWInput
MyGUI::InputManager::getInstance().injectMouseMove(static_cast<int>(mGuiCursorX), static_cast<int>(mGuiCursorY), mMouseWheel);
mInputManager->warpMouse(static_cast<int>(mGuiCursorX/mInvUiScalingFactor), static_cast<int>(mGuiCursorY/mInvUiScalingFactor));
MWBase::Environment::get().getWindowManager()->setCursorActive(true);
}
}
if (mMouseLookEnabled)

View File

@ -265,7 +265,6 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
// Autoequip clothing, armor and weapons.
// Equipping lights is handled in Actors::updateEquippedLight based on environment light.
for (ContainerStoreIterator iter (begin(ContainerStore::Type_Clothing | ContainerStore::Type_Armor)); iter!=end(); ++iter)
{
Ptr test = *iter;
@ -290,9 +289,12 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
std::pair<std::vector<int>, bool> itemsSlots =
iter->getClass().getEquipmentSlots (*iter);
// checking if current item poited by iter can be equipped
for (std::vector<int>::const_iterator iter2 (itemsSlots.first.begin());
iter2!=itemsSlots.first.end(); ++iter2)
{
// if true then it means slot is equipped already
// check if slot may require swapping if current item is more valueable
if (slots_.at (*iter2)!=end())
{
Ptr old = *slots_.at (*iter2);
@ -315,6 +317,26 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
}
else if (iter.getType() == ContainerStore::Type_Clothing)
{
// if left ring is equipped
if (*iter2 == Slot_LeftRing)
{
// if there is a place for right ring dont swap it
if (slots_.at(Slot_RightRing) == end())
{
continue;
}
else // if right ring is equipped too
{
Ptr rightRing = *slots_.at(Slot_RightRing);
// we want to swap cheaper ring only if both are equipped
if (rightRing.getClass().getValue(rightRing) < old.getClass().getValue(old))
{
continue;
}
}
}
if (old.getTypeName() == typeid(ESM::Clothing).name())
{
// check value
@ -337,6 +359,7 @@ void MWWorld::InventoryStore::autoEquip (const MWWorld::Ptr& actor)
}
}
// if we are here it means item can be equipped or swapped
slots_[*iter2] = iter;
break;
}

View File

@ -26,4 +26,6 @@ else ()
message(WARNING "Failed to get valid version information from Git")
endif ()
configure_file(${VERSION_IN_FILE} ${VERSION_FILE})
include(${MACROSFILE})
configure_resource_file(${VERSION_IN_FILE} ${VERSION_FILE_PATH_BASE} ${VERSION_FILE_PATH_RELATIVE})

View File

@ -88,13 +88,6 @@ endforeach (u)
source_group ("components\\${dir}" FILES ${files})
endmacro (add_component_qt_dir)
macro (copy_all_files source_dir destination_dir files)
foreach (f ${files})
get_filename_component(filename ${f} NAME)
configure_file(${source_dir}/${f} ${destination_dir}/${filename} COPYONLY)
endforeach (f)
endmacro (copy_all_files)
macro (add_file project type file)
list (APPEND ${project}${type} ${file})
endmacro (add_file)
@ -171,3 +164,40 @@ macro (openmw_add_executable target)
endif (CMAKE_VERSION VERSION_GREATER 3.8 OR CMAKE_VERSION VERSION_EQUAL 3.8)
endif (MSVC)
endmacro (openmw_add_executable)
macro (get_generator_is_multi_config VALUE)
if (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
get_cmake_property(${VALUE} GENERATOR_IS_MULTI_CONFIG)
else (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
list(LENGTH "${CMAKE_CONFIGURATION_TYPES}" ${VALUE})
endif (CMAKE_VERSION VERSION_GREATER 3.9 OR CMAKE_VERSION VERSION_EQUAL 3.9)
endmacro (get_generator_is_multi_config)
macro (copy_resource_file source_path destination_dir_base dest_path_relative)
get_generator_is_multi_config(multi_config)
if (multi_config)
foreach(cfgtype ${CMAKE_CONFIGURATION_TYPES})
configure_file(${source_path} "${destination_dir_base}/${cfgtype}/${dest_path_relative}" COPYONLY)
endforeach(cfgtype)
else (multi_config)
configure_file(${source_path} "${destination_dir_base}/${dest_path_relative}" COPYONLY)
endif (multi_config)
endmacro (copy_resource_file)
macro (configure_resource_file source_path destination_dir_base dest_path_relative)
get_generator_is_multi_config(multi_config)
if (multi_config)
foreach(cfgtype ${CMAKE_CONFIGURATION_TYPES})
configure_file(${source_path} "${destination_dir_base}/${cfgtype}/${dest_path_relative}")
endforeach(cfgtype)
else (multi_config)
configure_file(${source_path} "${destination_dir_base}/${dest_path_relative}")
endif (multi_config)
endmacro (configure_resource_file)
macro (copy_all_resource_files source_dir destination_dir_base destination_dir_relative files)
foreach (f ${files})
get_filename_component(filename ${f} NAME)
copy_resource_file("${source_dir}/${f}" "${destination_dir_base}" "${destination_dir_relative}/${filename}")
endforeach (f)
endmacro (copy_all_resource_files)

View File

@ -2,22 +2,25 @@ project (Components)
# Version file
set (VERSION_IN_FILE "${OpenMW_SOURCE_DIR}/files/version.in")
set (VERSION_FILE "${OpenMW_BINARY_DIR}/resources/version")
set (VERSION_FILE_PATH_BASE "${OpenMW_BINARY_DIR}")
set (VERSION_FILE_PATH_RELATIVE resources/version)
if (GIT_CHECKOUT)
add_custom_target (git-version
COMMAND ${CMAKE_COMMAND}
-DGIT_EXECUTABLE=${GIT_EXECUTABLE}
-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}
-DVERSION_IN_FILE=${VERSION_IN_FILE}
-DVERSION_FILE=${VERSION_FILE}
-DVERSION_FILE_PATH_BASE=${VERSION_FILE_PATH_BASE}
-DVERSION_FILE_PATH_RELATIVE=${VERSION_FILE_PATH_RELATIVE}
-DOPENMW_VERSION_MAJOR=${OPENMW_VERSION_MAJOR}
-DOPENMW_VERSION_MINOR=${OPENMW_VERSION_MINOR}
-DOPENMW_VERSION_RELEASE=${OPENMW_VERSION_RELEASE}
-DOPENMW_VERSION=${OPENMW_VERSION}
-DMACROSFILE=${CMAKE_SOURCE_DIR}/cmake/OpenMWMacros.cmake
-P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/GitVersion.cmake
VERBATIM)
else (GIT_CHECKOUT)
configure_file(${VERSION_IN_FILE} ${VERSION_FILE})
configure_resource_file(${VERSION_IN_FILE} ${VERSION_FILE_PATH_BASE} ${VERSION_FILE_PATH_RELATIVE})
endif (GIT_CHECKOUT)
if (OPENGL_ES)

View File

@ -4,7 +4,7 @@ endif()
# Copy resource files into the build directory
set(SDIR ${CMAKE_CURRENT_SOURCE_DIR})
set(DDIR ${OPENMW_MYGUI_FILES_ROOT}/resources/mygui)
set(DDIRRELATIVE resources/mygui)
set(MYGUI_FILES
core.skin
@ -97,4 +97,4 @@ set(MYGUI_FILES
)
copy_all_files(${CMAKE_CURRENT_SOURCE_DIR} ${DDIR} "${MYGUI_FILES}")
copy_all_resource_files(${CMAKE_CURRENT_SOURCE_DIR} ${OPENMW_MYGUI_FILES_ROOT} ${DDIRRELATIVE} "${MYGUI_FILES}")

View File

@ -4,7 +4,7 @@ endif()
# Copy resource files into the build directory
set(SDIR ${CMAKE_CURRENT_SOURCE_DIR})
set(DDIR ${OPENMW_SHADERS_ROOT}/resources/shaders)
set(DDIRRELATIVE resources/shaders)
set(SHADER_FILES
water_vertex.glsl
@ -18,4 +18,4 @@ set(SHADER_FILES
parallax.glsl
)
copy_all_files(${CMAKE_CURRENT_SOURCE_DIR} ${DDIR} "${SHADER_FILES}")
copy_all_resource_files(${CMAKE_CURRENT_SOURCE_DIR} ${OPENMW_SHADERS_ROOT} ${DDIRRELATIVE} "${SHADER_FILES}")