Skip to content

Commit

Permalink
Merge pull request OpenXRay#18 from Zegeri/clean
Browse files Browse the repository at this point in the history
Fix windows build and add some minor fixes
  • Loading branch information
q4a authored and drug007 committed Nov 4, 2018
2 parents 18a86ef + 93682da commit 99b302b
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmake/utils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ macro(add_dir DIRS)
file( GLOB ${dir}__INCLUDES_H ${dir} ${dir}/*.h)
file( GLOB ${dir}__INCLUDES_HPP ${dir} ${dir}/*.hpp)
list( APPEND ${PROJECT_NAME}__INCLUDES ${${dir}__INCLUDES_H} ${${dir}__INCLUDES_HPP} )
file( GLOB ${dir}__SOURCES_CPP ${dir} ${dir}/*.cpp)
file( GLOB ${dir}__SOURCES_CPP ${dir} ${dir}/*.cpp ${dir}/*.cxx)
file( GLOB ${dir}__SOURCES_C ${dir} ${dir}/*.c)
list( APPEND ${PROJECT_NAME}__SOURCES ${${dir}__SOURCES_C} ${${dir}__SOURCES_CPP} )
endforeach()
Expand Down
2 changes: 1 addition & 1 deletion res/fsgame.ltx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ $arch_dir$ = false| false| $fs_root$
$game_arch_mp$ = false| false| $fs_root$| mp\
$arch_dir_levels$ = false| false| $fs_root$| levels\
$arch_dir_resources$ = false| false| $fs_root$| resources\
$arch_dir_localization$ = false| false| $fs_root$| localization\
$arch_dir_localization$ = false| false| $fs_root$| Localization\
$arch_dir_patches$ = false| true| $fs_root$| patches\
$game_data$ = false| true| $fs_root$| gamedata\
$game_ai$ = true| false| $game_data$| ai\
Expand Down
2 changes: 1 addition & 1 deletion src/Layers/xrRender/dxUIRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ LPCSTR dxUIRender::UpdateShaderName(LPCSTR tex_name, LPCSTR sh_name)
u32 v_need = CAP_VERSION(2, 0);
// strstr(Core.Params,"-ps_movie") &&
if ((v_dev >= v_need) && FS.exist(buff, "$game_textures$", tex_name, ".ogm"))
return "hud" DELIMITER "movie";
return "hud\\movie";
else
return sh_name;
}
Expand Down
2 changes: 1 addition & 1 deletion src/xrAICore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ include_directories(
# endif()
#endforeach()

add_definitions(-DXRAICORE_EXPORTS)
add_definitions(-DXRAICORE_EXPORTS -D_SECURE_SCL=0)
add_library(${PROJECT_NAME} SHARED ${${PROJECT_NAME}__SOURCES} ${${PROJECT_NAME}__INCLUDES})

set_target_properties(${PROJECT_NAME} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "pch.hpp")
Expand Down
4 changes: 2 additions & 2 deletions src/xrAICore/Navigation/graph_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
#include "xrAICore/Navigation/vertex_manager_fixed.h"
#include "xrAICore/Navigation/vertex_allocator_fixed.h"
#include "xrAICore/Navigation/data_storage_bucket_list.h"
#include "xrAICore/Navigation/PathManagers/path_manager.h"
#include "xrAICore/Navigation/graph_engine_space.h"
#ifndef AI_COMPILER
#include "xrAICore/Navigation/vertex_manager_hash_fixed.h"
#include "xrAICore/Navigation/data_storage_binary_heap.h"
#endif
#include "xrAICore/Navigation/PathManagers/path_manager.h"
#include "xrAICore/Navigation/graph_engine_space.h"
#include "xrEngine/profiler.h"
#include "xrAICore/Components/problem_solver.h"
#include "xrAICore/Components/operator_condition.h"
Expand Down
10 changes: 6 additions & 4 deletions src/xrAICore/Navigation/vertex_manager_hash_fixed_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@

#pragma once

namespace hash_fixed_vertex_manager
{
extern u32 to_u32(const GraphEngineSpace::CWorldState& other);
extern u32 to_u32(const shared_str& other);
}

#define TEMPLATE_SPECIALIZATION \
template <typename TPathId, typename TIndex, u32 HashSize, u32 FixSize> \
template <typename TPathBuilder, typename TVertexAllocator, typename TCompoundVertex>
Expand Down Expand Up @@ -67,11 +73,7 @@ inline bool CHashFixedVertexManager::is_opened(const Vertex& vertex) const { ret
TEMPLATE_SPECIALIZATION
inline u32 CHashFixedVertexManager::hash_index(const Index& vertex_id) const
{
#ifdef LINUX // FIXME!!
return 0;
#else
return hash_fixed_vertex_manager::to_u32(vertex_id) % HashSize;
#endif
}

TEMPLATE_SPECIALIZATION
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/HUDCrosshair.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

CHUDCrosshair::CHUDCrosshair()
{
hShader->create("hud" DELIMITER "crosshair");
hShader->create("hud\\crosshair");
radius = 0;
}

Expand Down
4 changes: 4 additions & 0 deletions src/xrGame/ik/limb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@
#include "StdAfx.h"
#include "limb.h"

#ifdef LINUX
#undef roundup // defined in <sys/param.h>
#endif

enum
{
SolvePosOnly = 1,
Expand Down
1 change: 1 addition & 0 deletions src/xrUICore/Static/UILanimController.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct XRUICORE_API color_animation
Flags8 m_lanimFlags;
};

// Unused
struct xform_animation : public color_animation
{
xform_animation();
Expand Down
9 changes: 4 additions & 5 deletions src/xrUICore/XML/UITextureMaster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@
#include "uiabstract.h"
#include "xrUIXmlParser.h"
#include "Include/xrRender/UIShader.h"
#include "xrCore/Threading/Lock.hpp"
#include "xrCore/Threading/ScopeLock.hpp"
#include <iostream>
#include <mutex>

xr_map<shared_str, TEX_INFO> CUITextureMaster::m_textures;
xr_map<sh_pair, ui_shader> CUITextureMaster::m_shaders;
Expand Down Expand Up @@ -55,10 +56,8 @@ void CUITextureMaster::ParseShTexInfo(pcstr path, pcstr xml_file)
/* avo: fix issue when values were not updated (silently skipped) when same key is encountered more than once. This is how std::map is designed.
/* Also used more efficient C++11 std::map::emplace method instead of outdated std::pair::make_pair */
/* XXX: avo: note that xxx.insert(mk_pair(v1,v2)) pattern is used extensively throughout solution so there is a good potential for other bug fixes/improvements */
#ifdef LINUX
static std::mutex new_texture_mutex;
std::scoped_lock new_texture_lock (new_texture_mutex);
#endif
static Lock new_texture_lock;
ScopeLock new_texture_guard(&new_texture_lock);
if (m_textures.find(id) == m_textures.end())
m_textures.emplace(id, info);
else
Expand Down

0 comments on commit 99b302b

Please sign in to comment.