diff --git a/src/3rd party/crypto/crypto.h b/src/3rd party/crypto/crypto.h index 43ab69e53f1..74c629907c2 100644 --- a/src/3rd party/crypto/crypto.h +++ b/src/3rd party/crypto/crypto.h @@ -1,7 +1,7 @@ #ifndef CRYPTO_INCLUDED #define CRYPTO_INCLUDED -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #include "xr_dsa.h" #include "xr_sha.h" diff --git a/src/3rd party/crypto/xr_dsa.h b/src/3rd party/crypto/xr_dsa.h index fdf9a434126..c59dd0c0ecd 100644 --- a/src/3rd party/crypto/xr_dsa.h +++ b/src/3rd party/crypto/xr_dsa.h @@ -2,7 +2,7 @@ #define XR_DSA_INCLUDED #include "crypto_api_def.h" -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" struct dsa_st; diff --git a/src/3rd party/crypto/xr_sha.h b/src/3rd party/crypto/xr_sha.h index c946cb6eb80..041a87a1ae2 100644 --- a/src/3rd party/crypto/xr_sha.h +++ b/src/3rd party/crypto/xr_sha.h @@ -2,7 +2,7 @@ #define XR_SHA_INCLUDED #include "crypto_api_def.h" -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" struct SHAstate_st; diff --git a/src/Include/xrRender/FactoryPtr.h b/src/Include/xrRender/FactoryPtr.h index a5a4cd3f815..1dc5194ff66 100644 --- a/src/Include/xrRender/FactoryPtr.h +++ b/src/Include/xrRender/FactoryPtr.h @@ -3,7 +3,7 @@ #pragma once #include "RenderFactory.h" -#include "../../Include/xrAPI/xrAPI.h" +#include "Include/xrAPI/xrAPI.h" #define FACTORY_PTR_INSTANCIATE(Class) \ inline void FactoryPtr::CreateObject(void) \ diff --git a/src/Include/xrRender/KinematicsAnimated.h b/src/Include/xrRender/KinematicsAnimated.h index 417b9939987..4468953f372 100644 --- a/src/Include/xrRender/KinematicsAnimated.h +++ b/src/Include/xrRender/KinematicsAnimated.h @@ -4,7 +4,7 @@ #include "xrCore/Animation/SkeletonMotions.hpp" #include "animation_blend.h" -#include "../../layers/xrrender/KinematicAnimatedDefs.h" +#include "Layers/xrrender/KinematicAnimatedDefs.h" class IKinematics; class CBlend; diff --git a/src/Include/xrRender/RainRender.h b/src/Include/xrRender/RainRender.h index 0a583e49798..fabb070e58a 100644 --- a/src/Include/xrRender/RainRender.h +++ b/src/Include/xrRender/RainRender.h @@ -5,7 +5,7 @@ class CEffect_Rain; //struct Fsphere; -#include "../../xrCore/_sphere.h" +#include "xrCore/_sphere.h" class IRainRender { diff --git a/src/Layers/xrAPI/xrAPI.cpp b/src/Layers/xrAPI/xrAPI.cpp index 928dde7fa24..40bfb6a61ed 100644 --- a/src/Layers/xrAPI/xrAPI.cpp +++ b/src/Layers/xrAPI/xrAPI.cpp @@ -2,7 +2,7 @@ // #include "stdafx.h" -#include "../../Include/xrApi/xrAPI.h" +#include "Include/xrAPI/xrAPI.h" XRAPI_API IRender_interface* Render = NULL; XRAPI_API IRenderFactory* RenderFactory = NULL; diff --git a/src/Layers/xrRender/Blender_Recorder_StandartBinding.cpp b/src/Layers/xrRender/Blender_Recorder_StandartBinding.cpp index 2a4882eb55b..0cc69b8d619 100644 --- a/src/Layers/xrRender/Blender_Recorder_StandartBinding.cpp +++ b/src/Layers/xrRender/Blender_Recorder_StandartBinding.cpp @@ -10,8 +10,8 @@ #include "blenders\Blender_Recorder.h" #include "blenders\Blender.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "dxRenderDeviceRender.h" diff --git a/src/Layers/xrRender/D3DUtils.cpp b/src/Layers/xrRender/D3DUtils.cpp index 19ec4776142..8fc78f00cd5 100644 --- a/src/Layers/xrRender/D3DUtils.cpp +++ b/src/Layers/xrRender/D3DUtils.cpp @@ -3,7 +3,7 @@ #include "stdafx.h" #pragma hdrstop -#include "../../xrEngine/gamefont.h" +#include "xrEngine/gamefont.h" #include "d3dutils.h" #include "du_box.h" #include "du_sphere.h" diff --git a/src/Layers/xrRender/DetailManager.cpp b/src/Layers/xrRender/DetailManager.cpp index a9d809427e2..eb64157000e 100644 --- a/src/Layers/xrRender/DetailManager.cpp +++ b/src/Layers/xrRender/DetailManager.cpp @@ -15,8 +15,8 @@ # include "igame_persistent.h" # include "environment.h" #else -# include "../../xrEngine/igame_persistent.h" -# include "../../xrEngine/environment.h" +# include "xrEngine/igame_persistent.h" +# include "xrEngine/environment.h" # include #endif diff --git a/src/Layers/xrRender/DetailManager.h b/src/Layers/xrRender/DetailManager.h index ff5a72e8932..9205571279d 100644 --- a/src/Layers/xrRender/DetailManager.h +++ b/src/Layers/xrRender/DetailManager.h @@ -6,7 +6,7 @@ #define DetailManagerH #pragma once -#include "../../xrCore/xrpool.h" +#include "xrCore/xrpool.h" #include "detailformat.h" #include "detailmodel.h" diff --git a/src/Layers/xrRender/DetailManager_Decompress.cpp b/src/Layers/xrRender/DetailManager_Decompress.cpp index a22e56c039d..f7b71b1d336 100644 --- a/src/Layers/xrRender/DetailManager_Decompress.cpp +++ b/src/Layers/xrRender/DetailManager_Decompress.cpp @@ -42,7 +42,7 @@ IC bool InterpolateAndDither(float* alpha255, u32 x, u32 y, u32 sx, u32 sy, u32 #ifndef _EDITOR #ifdef DEBUG -//#include "../../Include/xrRender/DebugRender.h" +//#include "Include/xrRender/DebugRender.h" #include "dxDebugRender.h" static void draw_obb ( const Fmatrix &matrix, const u32 &color ) { diff --git a/src/Layers/xrRender/DetailManager_VS.cpp b/src/Layers/xrRender/DetailManager_VS.cpp index f82981f467b..e04b7843a9e 100644 --- a/src/Layers/xrRender/DetailManager_VS.cpp +++ b/src/Layers/xrRender/DetailManager_VS.cpp @@ -7,8 +7,8 @@ # include "igame_persistent.h" # include "environment.h" #else -# include "../../xrEngine/igame_persistent.h" -# include "../../xrEngine/environment.h" +# include "xrEngine/igame_persistent.h" +# include "xrEngine/environment.h" #endif #include "../xrRenderDX10/dx10BufferUtils.h" diff --git a/src/Layers/xrRender/ETextureParams.cpp b/src/Layers/xrRender/ETextureParams.cpp index 986d77a08dc..98de96ac87a 100644 --- a/src/Layers/xrRender/ETextureParams.cpp +++ b/src/Layers/xrRender/ETextureParams.cpp @@ -152,7 +152,7 @@ void STextureParams::Save(IWriter& F) #ifdef _EDITOR -#include "../../xrServerEntities/PropertiesListHelper.h" +#include "xrServerEntities/PropertiesListHelper.h" void STextureParams::OnTypeChange(PropValue* prop) { diff --git a/src/Layers/xrRender/FBasicVisual.cpp b/src/Layers/xrRender/FBasicVisual.cpp index b845d74e298..fb7d83c8ae6 100644 --- a/src/Layers/xrRender/FBasicVisual.cpp +++ b/src/Layers/xrRender/FBasicVisual.cpp @@ -6,7 +6,7 @@ #pragma hdrstop #ifndef _EDITOR -# include "../../xrEngine/render.h" +# include "xrEngine/render.h" #endif // #ifndef _EDITOR #include "fbasicvisual.h" diff --git a/src/Layers/xrRender/FBasicVisual.h b/src/Layers/xrRender/FBasicVisual.h index c732c9384fa..d3ae658c7cf 100644 --- a/src/Layers/xrRender/FBasicVisual.h +++ b/src/Layers/xrRender/FBasicVisual.h @@ -2,9 +2,9 @@ #define FBasicVisualH #pragma once -#include "../../xrEngine/vis_common.h" +#include "xrEngine/vis_common.h" -#include "../../Include/xrRender/RenderVisual.h" +#include "Include/xrRender/RenderVisual.h" #define VLOAD_NOVERTICES (1<<0) diff --git a/src/Layers/xrRender/FHierrarhyVisual.cpp b/src/Layers/xrRender/FHierrarhyVisual.cpp index 289a9517dad..4692dde2c96 100644 --- a/src/Layers/xrRender/FHierrarhyVisual.cpp +++ b/src/Layers/xrRender/FHierrarhyVisual.cpp @@ -8,9 +8,9 @@ #include "FHierrarhyVisual.h" #include "xrCore/FMesh.hpp" #ifndef _EDITOR -#include "../../xrEngine/render.h" +#include "xrEngine/render.h" #else -#include "../../Include/xrAPI/xrAPI.h" +#include "Include/xrAPI/xrAPI.h" #endif ////////////////////////////////////////////////////////////////////// diff --git a/src/Layers/xrRender/FSkinned.cpp b/src/Layers/xrRender/FSkinned.cpp index 440a078106d..ce52d297cdb 100644 --- a/src/Layers/xrRender/FSkinned.cpp +++ b/src/Layers/xrRender/FSkinned.cpp @@ -16,7 +16,7 @@ #include "../xrRenderDX10/dx10BufferUtils.h" -#include "../../xrEngine/EnnumerateVertices.h" +#include "xrEngine/EnnumerateVertices.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// diff --git a/src/Layers/xrRender/FTreeVisual.cpp b/src/Layers/xrRender/FTreeVisual.cpp index 4938b4c977f..85b4a09f2d1 100644 --- a/src/Layers/xrRender/FTreeVisual.cpp +++ b/src/Layers/xrRender/FTreeVisual.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #pragma hdrstop -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/igame_level.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/igame_level.h" +#include "xrEngine/environment.h" #include "xrCore/FMesh.hpp" #include "ftreevisual.h" diff --git a/src/Layers/xrRender/HOM.cpp b/src/Layers/xrRender/HOM.cpp index bd8628bb7cb..dd183c83632 100644 --- a/src/Layers/xrRender/HOM.cpp +++ b/src/Layers/xrRender/HOM.cpp @@ -5,7 +5,7 @@ #include "stdafx.h" #include "HOM.h" #include "occRasterizer.h" -#include "../../xrEngine/GameFont.h" +#include "xrEngine/GameFont.h" #include "dxRenderDeviceRender.h" diff --git a/src/Layers/xrRender/HOM.h b/src/Layers/xrRender/HOM.h index f9846d47122..8e810be4ab8 100644 --- a/src/Layers/xrRender/HOM.h +++ b/src/Layers/xrRender/HOM.h @@ -3,7 +3,7 @@ ////////////////////////////////////////////////////////////////////// #pragma once -#include "../../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" class occTri; diff --git a/src/Layers/xrRender/HW.cpp b/src/Layers/xrRender/HW.cpp index 2c14dcefe4d..8f348577c4d 100644 --- a/src/Layers/xrRender/HW.cpp +++ b/src/Layers/xrRender/HW.cpp @@ -8,7 +8,7 @@ #include #pragma warning(default:4995) #include "HW.h" -#include "../../xrEngine/XR_IOConsole.h" +#include "xrEngine/XR_IOConsole.h" #ifndef _EDITOR void fill_vid_mode_list (CHW* _hw); @@ -90,7 +90,7 @@ void CHW::Reset (HWND hwnd) //xr_token* vid_mode_token = NULL; //extern xr_token* vid_mode_token; -#include "../../Include/xrAPI/xrAPI.h" +#include "Include/xrAPI/xrAPI.h" //xr_token* vid_quality_token = NULL; void CHW::CreateD3D () diff --git a/src/Layers/xrRender/IRenderDetailModel.h b/src/Layers/xrRender/IRenderDetailModel.h index 4cd00d50b96..578f18ec760 100644 --- a/src/Layers/xrRender/IRenderDetailModel.h +++ b/src/Layers/xrRender/IRenderDetailModel.h @@ -2,7 +2,7 @@ #define IRenderDetailModelH #pragma once -#include "../../Include/xrRender/RenderDetailModel.h" +#include "Include/xrRender/RenderDetailModel.h" ////////////////////////////////////////////////////////////////////////// // definition (Detail Model) diff --git a/src/Layers/xrRender/LightTrack.cpp b/src/Layers/xrRender/LightTrack.cpp index 3bb94e553bf..099862cb9c9 100644 --- a/src/Layers/xrRender/LightTrack.cpp +++ b/src/Layers/xrRender/LightTrack.cpp @@ -4,15 +4,15 @@ #include "stdafx.h" #include "LightTrack.h" -#include "../../include/xrRender/RenderVisual.h" -#include "../../xrEngine/xr_object.h" +#include "Include/xrRender/RenderVisual.h" +#include "xrEngine/xr_object.h" #ifdef _EDITOR # include "igame_persistent.h" # include "environment.h" #else -# include "../../xrEngine/igame_persistent.h" -# include "../../xrEngine/environment.h" +# include "xrEngine/igame_persistent.h" +# include "xrEngine/environment.h" #endif ////////////////////////////////////////////////////////////////////// diff --git a/src/Layers/xrRender/Light_DB.cpp b/src/Layers/xrRender/Light_DB.cpp index 7a07c0871ee..fee38514b66 100644 --- a/src/Layers/xrRender/Light_DB.cpp +++ b/src/Layers/xrRender/Light_DB.cpp @@ -1,8 +1,8 @@ #include "StdAfx.h" -#include "../../xrEngine/_d3d_extensions.h" -#include "../../xrEngine/xrLevel.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/_d3d_extensions.h" +#include "xrEngine/xrLevel.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../../utils/xrLC_Light/R_light.h" #include "light_db.h" diff --git a/src/Layers/xrRender/ModelPool.cpp b/src/Layers/xrRender/ModelPool.cpp index 49fb4f50749..976113cd117 100644 --- a/src/Layers/xrRender/ModelPool.cpp +++ b/src/Layers/xrRender/ModelPool.cpp @@ -4,7 +4,7 @@ #include "ModelPool.h" #ifndef _EDITOR - #include "../../xrEngine/IGame_Persistent.h" + #include "xrEngine/IGame_Persistent.h" #include "xrCore/FMesh.hpp" #include "fhierrarhyvisual.h" #include "SkeletonAnimated.h" diff --git a/src/Layers/xrRender/PSLibrary.h b/src/Layers/xrRender/PSLibrary.h index 750b89c155f..01a147f6604 100644 --- a/src/Layers/xrRender/PSLibrary.h +++ b/src/Layers/xrRender/PSLibrary.h @@ -4,7 +4,7 @@ #ifndef PSLibraryH #define PSLibraryH -#include "../../include/xrRender/particles_systems_library_interface.hpp" +#include "Include/xrRender/particles_systems_library_interface.hpp" namespace PS { class CPEDef; diff --git a/src/Layers/xrRender/ParticleEffect.h b/src/Layers/xrRender/ParticleEffect.h index 4be8d6704be..c87caf828ea 100644 --- a/src/Layers/xrRender/ParticleEffect.h +++ b/src/Layers/xrRender/ParticleEffect.h @@ -6,8 +6,8 @@ #include "ParticleEffectDef.h" #ifdef _EDITOR -# include "../../Layers/xrRender/FBasicVisual.h" -# include "../../Layers/xrRender/dxParticleCustom.h" +# include "Layers/xrRender/FBasicVisual.h" +# include "Layers/xrRender/dxParticleCustom.h" #else // _EDITOR # include "../xrRender/FBasicVisual.h" # include "../xrRender/dxParticleCustom.h" diff --git a/src/Layers/xrRender/ParticleGroup.cpp b/src/Layers/xrRender/ParticleGroup.cpp index f7784f3c8fb..c35604f2b12 100644 --- a/src/Layers/xrRender/ParticleGroup.cpp +++ b/src/Layers/xrRender/ParticleGroup.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #pragma hdrstop -#include "../../xrParticles/psystem.h" +#include "xrParticles/psystem.h" #ifndef _EDITOR -#include "../../xrServerEntities/smart_cast.h" +#include "xrServerEntities/smart_cast.h" #endif #include "ParticleGroup.h" diff --git a/src/Layers/xrRender/R_Backend_Runtime.cpp b/src/Layers/xrRender/R_Backend_Runtime.cpp index 3664ff92dfb..72bd153c1a4 100644 --- a/src/Layers/xrRender/R_Backend_Runtime.cpp +++ b/src/Layers/xrRender/R_Backend_Runtime.cpp @@ -6,7 +6,7 @@ #include #pragma warning(pop) -#include "../../xrCDB/frustum.h" +#include "xrCDB/frustum.h" #if defined(USE_DX10) || defined(USE_DX11) #include "../xrRenderDX10/StateManager/dx10StateManager.h" diff --git a/src/Layers/xrRender/ResourceManager_Reset.cpp b/src/Layers/xrRender/ResourceManager_Reset.cpp index 9de2b2f1ebb..ac0bcceed4e 100644 --- a/src/Layers/xrRender/ResourceManager_Reset.cpp +++ b/src/Layers/xrRender/ResourceManager_Reset.cpp @@ -3,9 +3,9 @@ #include "ResourceManager.h" #ifndef _EDITOR -#include "../../xrEngine/Render.h" +#include "xrEngine/Render.h" #else - #include "../../Include/xrAPI/xrAPI.h" + #include "Include/xrAPI/xrAPI.h" #endif void CResourceManager::reset_begin () diff --git a/src/Layers/xrRender/ResourceManager_Resources.cpp b/src/Layers/xrRender/ResourceManager_Resources.cpp index 0fa69a7ce51..bf3fa7b77a8 100644 --- a/src/Layers/xrRender/ResourceManager_Resources.cpp +++ b/src/Layers/xrRender/ResourceManager_Resources.cpp @@ -5,7 +5,7 @@ #include #ifndef _EDITOR #pragma comment( lib, "d3dx9.lib" ) -#include "../../xrEngine/render.h" +#include "xrEngine/render.h" #endif #pragma warning(default:4995) diff --git a/src/Layers/xrRender/ResourceManager_Scripting.cpp b/src/Layers/xrRender/ResourceManager_Scripting.cpp index 93326cf6fa8..0cec06a2608 100644 --- a/src/Layers/xrRender/ResourceManager_Scripting.cpp +++ b/src/Layers/xrRender/ResourceManager_Scripting.cpp @@ -3,13 +3,13 @@ #include -#include "../../xrEngine/Render.h" +#include "xrEngine/Render.h" #include "ResourceManager.h" #include "tss.h" #include "blenders\blender.h" #include "blenders\blender_recorder.h" -#include "../../xrEngine/ai_script_space.h" -#include "../../xrEngine/ai_script_lua_extension.h" +#include "xrEngine/ai_script_space.h" +#include "xrEngine/ai_script_lua_extension.h" #include "luabind/return_reference_to_policy.hpp" #include "dxRenderDeviceRender.h" @@ -112,7 +112,7 @@ static void *lua_alloc_dl (void *ud, void *ptr, size_t osize, size_t nsize) { } #else // USE_DL_ALLOCATOR -#include "../../xrCore/memory_allocator_options.h" +#include "xrCore/memory_allocator_options.h" #ifdef USE_ARENA_ALLOCATOR static const u32 s_arena_size = 8*1024*1024; diff --git a/src/Layers/xrRender/SH_Atomic.h b/src/Layers/xrRender/SH_Atomic.h index 36c8ef9829c..311c1306d2b 100644 --- a/src/Layers/xrRender/SH_Atomic.h +++ b/src/Layers/xrRender/SH_Atomic.h @@ -1,7 +1,7 @@ #ifndef sh_atomicH #define sh_atomicH #pragma once -#include "../../xrCore/xr_resource.h" +#include "xrCore/xr_resource.h" #include "tss_def.h" #if defined(USE_DX10) || defined(USE_DX11) diff --git a/src/Layers/xrRender/SH_Constant.cpp b/src/Layers/xrRender/SH_Constant.cpp index 984b2075e94..277554bbb42 100644 --- a/src/Layers/xrRender/SH_Constant.cpp +++ b/src/Layers/xrRender/SH_Constant.cpp @@ -2,7 +2,7 @@ #pragma hdrstop /* -#include "../../xrCore/xr_resource.h" +#include "xrCore/xr_resource.h" // res class test_resource : public xr_resource { diff --git a/src/Layers/xrRender/SH_Constant.h b/src/Layers/xrRender/SH_Constant.h index cbf9ba2d000..6217e835ecd 100644 --- a/src/Layers/xrRender/SH_Constant.h +++ b/src/Layers/xrRender/SH_Constant.h @@ -2,7 +2,7 @@ #define SH_CONSTANT_H #pragma once -#include "../../xrEngine/WaveForm.h" +#include "xrEngine/WaveForm.h" class IReader; class IWriter; diff --git a/src/Layers/xrRender/SH_Matrix.h b/src/Layers/xrRender/SH_Matrix.h index af23a96d1f6..dbeafab594d 100644 --- a/src/Layers/xrRender/SH_Matrix.h +++ b/src/Layers/xrRender/SH_Matrix.h @@ -2,7 +2,7 @@ #define SH_MATRIX_H #pragma once -#include "../../xrEngine/WaveForm.h" +#include "xrEngine/WaveForm.h" class IReader; class IWriter; diff --git a/src/Layers/xrRender/SH_Texture.cpp b/src/Layers/xrRender/SH_Texture.cpp index 7eed649518f..189c073c1c9 100644 --- a/src/Layers/xrRender/SH_Texture.cpp +++ b/src/Layers/xrRender/SH_Texture.cpp @@ -4,11 +4,11 @@ #include "ResourceManager.h" #ifndef _EDITOR -#include "../../xrEngine/render.h" +#include "xrEngine/render.h" #endif -#include "../../xrEngine/tntQAVI.h" -#include "../../xrEngine/xrTheora_Surface.h" +#include "xrEngine/tntQAVI.h" +#include "xrEngine/xrTheora_Surface.h" #include "dxRenderDeviceRender.h" diff --git a/src/Layers/xrRender/SH_Texture.h b/src/Layers/xrRender/SH_Texture.h index 83ca7a0142f..3e7fb0d2870 100644 --- a/src/Layers/xrRender/SH_Texture.h +++ b/src/Layers/xrRender/SH_Texture.h @@ -2,7 +2,7 @@ #define SH_TEXTURE_H #pragma once -#include "../../xrCore/xr_resource.h" +#include "xrCore/xr_resource.h" class ENGINE_API CAviPlayerCustom; class CTheoraSurface; diff --git a/src/Layers/xrRender/Shader.h b/src/Layers/xrRender/Shader.h index 9d7df0479c9..f3aaf4257cb 100644 --- a/src/Layers/xrRender/Shader.h +++ b/src/Layers/xrRender/Shader.h @@ -7,7 +7,7 @@ #pragma once #include "r_constants.h" -#include "../../xrCore/xr_resource.h" +#include "xrCore/xr_resource.h" #include "sh_atomic.h" #include "sh_texture.h" diff --git a/src/Layers/xrRender/SkeletonAnimated.cpp b/src/Layers/xrRender/SkeletonAnimated.cpp index 3857e65fc81..869454422e5 100644 --- a/src/Layers/xrRender/SkeletonAnimated.cpp +++ b/src/Layers/xrRender/SkeletonAnimated.cpp @@ -8,7 +8,7 @@ #include "SkeletonX.h" #include "xrCore/FMesh.hpp" #ifdef DEBUG -#include "../../xrcore/dump_string.h" +#include "xrCore/dump_string.h" #endif extern int psSkeletonUpdate; using namespace animation; diff --git a/src/Layers/xrRender/SkeletonAnimated.h b/src/Layers/xrRender/SkeletonAnimated.h index 6d311516e68..c5cb346cdc0 100644 --- a/src/Layers/xrRender/SkeletonAnimated.h +++ b/src/Layers/xrRender/SkeletonAnimated.h @@ -6,7 +6,7 @@ #include "animation.h" #include "xrCore/Animation/SkeletonMotions.hpp" -#include "../../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" //*** Bone Instance ******************************************************************************* #pragma pack(push,8) diff --git a/src/Layers/xrRender/SkeletonCustom.cpp b/src/Layers/xrRender/SkeletonCustom.cpp index d9e812a48f0..b8274b5f036 100644 --- a/src/Layers/xrRender/SkeletonCustom.cpp +++ b/src/Layers/xrRender/SkeletonCustom.cpp @@ -6,7 +6,7 @@ #include "SkeletonX.h" #include "xrCore/FMesh.hpp" #ifndef _EDITOR -#include "../../xrEngine/Render.h" +#include "xrEngine/Render.h" #endif int psSkeletonUpdate = 32; xrCriticalSection UCalc_Mutex @@ -16,9 +16,9 @@ xrCriticalSection UCalc_Mutex ; #ifndef _EDITOR -#include "../../xrServerEntities/smart_cast.h" +#include "xrServerEntities/smart_cast.h" #else -#include "../../Include/xrAPI/xrAPI.h" +#include "Include/xrAPI/xrAPI.h" #endif ////////////////////////////////////////////////////////////////////// diff --git a/src/Layers/xrRender/SkeletonCustom.h b/src/Layers/xrRender/SkeletonCustom.h index 48eadf93f72..2546c02af33 100644 --- a/src/Layers/xrRender/SkeletonCustom.h +++ b/src/Layers/xrRender/SkeletonCustom.h @@ -4,7 +4,7 @@ #include "fhierrarhyvisual.h" #include "xrCore/Animation/Bone.hpp" -#include "../../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" // consts extern xrCriticalSection UCalc_Mutex ; diff --git a/src/Layers/xrRender/SkeletonX.cpp b/src/Layers/xrRender/SkeletonX.cpp index d4726bf38db..627360b3283 100644 --- a/src/Layers/xrRender/SkeletonX.cpp +++ b/src/Layers/xrRender/SkeletonX.cpp @@ -10,9 +10,9 @@ #pragma warning(default:4995) #ifndef _EDITOR - #include "../../xrEngine/Render.h" + #include "xrEngine/Render.h" #else - #include "../../Include/xrAPI/xrAPI.h" + #include "Include/xrAPI/xrAPI.h" #endif #include "SkeletonX.h" diff --git a/src/Layers/xrRender/WallmarksEngine.cpp b/src/Layers/xrRender/WallmarksEngine.cpp index 88fa7d006e1..1b5a14914b7 100644 --- a/src/Layers/xrRender/WallmarksEngine.cpp +++ b/src/Layers/xrRender/WallmarksEngine.cpp @@ -5,9 +5,9 @@ #include "stdafx.h" #include "WallmarksEngine.h" -#include "../../xrEngine/xr_object.h" -#include "../../xrEngine/x_ray.h" -#include "../../xrEngine/GameFont.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/GameFont.h" #include "SkeletonCustom.h" u32 g_r = 1; diff --git a/src/Layers/xrRender/blenders/Blender.h b/src/Layers/xrRender/blenders/Blender.h index 3e55ed482af..09a3e1cb831 100644 --- a/src/Layers/xrRender/blenders/Blender.h +++ b/src/Layers/xrRender/blenders/Blender.h @@ -6,7 +6,7 @@ #define AFX_BLENDER_H__A023332E_C09B_4D93_AA53_57C052CCC075__INCLUDED_ #pragma once -#include "../../xrEngine/properties.h" +#include "xrEngine/properties.h" #include "Blender_Recorder.h" #pragma pack(push,4) diff --git a/src/Layers/xrRender/blenders/Blender_Palette.cpp b/src/Layers/xrRender/blenders/Blender_Palette.cpp index 76bd2d2c6d6..77979da584e 100644 --- a/src/Layers/xrRender/blenders/Blender_Palette.cpp +++ b/src/Layers/xrRender/blenders/Blender_Palette.cpp @@ -62,7 +62,7 @@ void IBlender::CreatePalette(xr_vector &palette) #ifndef _EDITOR // Engine -#include "../../../xrEngine/render.h" +#include "xrEngine/render.h" IBlender* IBlender::Create (CLASS_ID cls) { return ::RImplementation.blender_create (cls); @@ -74,23 +74,23 @@ void IBlender::Destroy (IBlender*& B) #else // Editor -#include "../Layers/xrRenderPC_R1/blenderdefault.h" -#include "../Layers/xrRenderPC_R1/blender_default_aref.h" -#include "../Layers/xrRenderPC_R1/blender_vertex.h" -#include "../Layers/xrRenderPC_R1/blender_vertex_aref.h" +#include "Layers/xrRenderPC_R1/blenderdefault.h" +#include "Layers/xrRenderPC_R1/blender_default_aref.h" +#include "Layers/xrRenderPC_R1/blender_vertex.h" +#include "Layers/xrRenderPC_R1/blender_vertex_aref.h" #include "blender_screen_set.h" -#include "../Layers/xrRenderPC_R1/blender_screen_gray.h" +#include "Layers/xrRenderPC_R1/blender_screen_gray.h" #include "blender_editor_wire.h" #include "blender_editor_selection.h" #include "blender_light.h" -#include "../Layers/xrRenderPC_R1/blender_LaEmB.h" +#include "Layers/xrRenderPC_R1/blender_LaEmB.h" #include "blender_Lm(EbB).h" #include "blender_BmmD.h" #include "blender_B.h" #include "blender_shadow_texture.h" -#include "../Layers/xrRenderPC_R1/blender_shadow_world.h" -#include "../Layers/xrRenderPC_R1/blender_blur.h" -#include "../Layers/xrRenderPC_R1/blender_model.h" +#include "Layers/xrRenderPC_R1/blender_shadow_world.h" +#include "Layers/xrRenderPC_R1/blender_blur.h" +#include "Layers/xrRenderPC_R1/blender_model.h" #include "blender_model_ebb.h" #include "blender_detail_still.h" #include "blender_tree.h" diff --git a/src/Layers/xrRender/dxApplicationRender.cpp b/src/Layers/xrRender/dxApplicationRender.cpp index 9b9748c307d..c029051bf8c 100644 --- a/src/Layers/xrRender/dxApplicationRender.cpp +++ b/src/Layers/xrRender/dxApplicationRender.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "dxApplicationRender.h" -#include "../../xrEngine/x_ray.h" -#include "../../xrEngine/GameFont.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/GameFont.h" void draw_multiline_text(CGameFont* F, float fTargetWidth, LPCSTR pszText); diff --git a/src/Layers/xrRender/dxDebugRender.h b/src/Layers/xrRender/dxDebugRender.h index 78c57f80977..9219fb17a41 100644 --- a/src/Layers/xrRender/dxDebugRender.h +++ b/src/Layers/xrRender/dxDebugRender.h @@ -4,7 +4,7 @@ #ifdef DEBUG -#include "../../Include/xrRender/DebugRender.h" +#include "Include/xrRender/DebugRender.h" class dxDebugRender : public IDebugRender { diff --git a/src/Layers/xrRender/dxEnvironmentRender.cpp b/src/Layers/xrRender/dxEnvironmentRender.cpp index b77383ab2dd..ccccf3896d0 100644 --- a/src/Layers/xrRender/dxEnvironmentRender.cpp +++ b/src/Layers/xrRender/dxEnvironmentRender.cpp @@ -3,10 +3,10 @@ #include "dxRenderDeviceRender.h" -#include "../../xrEngine/environment.h" -#include "../../Layers/xrRender/ResourceManager.h" +#include "xrEngine/environment.h" +#include "Layers/xrRender/ResourceManager.h" -#include "../../xrEngine/xr_efflensflare.h" +#include "xrEngine/xr_efflensflare.h" ////////////////////////////////////////////////////////////////////////// diff --git a/src/Layers/xrRender/dxFontRender.cpp b/src/Layers/xrRender/dxFontRender.cpp index bb8b107e984..9ea46aacdac 100644 --- a/src/Layers/xrRender/dxFontRender.cpp +++ b/src/Layers/xrRender/dxFontRender.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "dxFontRender.h" -#include "../../xrEngine/GameFont.h" +#include "xrEngine/GameFont.h" dxFontRender::dxFontRender() { diff --git a/src/Layers/xrRender/dxLensFlareRender.cpp b/src/Layers/xrRender/dxLensFlareRender.cpp index 7c25f28e87a..0f66c9b407d 100644 --- a/src/Layers/xrRender/dxLensFlareRender.cpp +++ b/src/Layers/xrRender/dxLensFlareRender.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "dxLensFlareRender.h" -#include "../../xrEngine/xr_efflensflare.h" -#include "../../xrEngine/iGame_persistent.h" +#include "xrEngine/xr_efflensflare.h" +#include "xrEngine/iGame_persistent.h" #define MAX_Flares 24 #define FAR_DIST g_pGamePersistent->Environment().CurrentEnv->far_plane diff --git a/src/Layers/xrRender/dxParticleCustom.h b/src/Layers/xrRender/dxParticleCustom.h index b861d73aa2d..a9673582229 100644 --- a/src/Layers/xrRender/dxParticleCustom.h +++ b/src/Layers/xrRender/dxParticleCustom.h @@ -2,7 +2,7 @@ #ifndef ParticleCustomH #define ParticleCustomH -#include "../../Include/xrRender/ParticleCustom.h" +#include "Include/xrRender/ParticleCustom.h" #include "FBasicVisual.h" //--------------------------------------------------------------------------- class dxParticleCustom : public dxRender_Visual, public IParticleCustom diff --git a/src/Layers/xrRender/dxRainRender.cpp b/src/Layers/xrRender/dxRainRender.cpp index bc8c00f1274..3d6b9536f04 100644 --- a/src/Layers/xrRender/dxRainRender.cpp +++ b/src/Layers/xrRender/dxRainRender.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "dxRainRender.h" -#include "../../xrEngine/Rain.h" +#include "xrEngine/Rain.h" // Warning: duplicated in rain.cpp static const int max_desired_items = 2500; @@ -46,7 +46,7 @@ void dxRainRender::Copy(IRainRender &_in) *this = *(dxRainRender*)&_in; } -#include "../../xrEngine/iGame_persistent.h" +#include "xrEngine/iGame_persistent.h" void dxRainRender::Render(CEffect_Rain &owner) { diff --git a/src/Layers/xrRender/dxStatGraphRender.h b/src/Layers/xrRender/dxStatGraphRender.h index 7c7d55a9f16..013f4e48049 100644 --- a/src/Layers/xrRender/dxStatGraphRender.h +++ b/src/Layers/xrRender/dxStatGraphRender.h @@ -4,7 +4,7 @@ #include "..\..\Include\xrRender\StatGraphRender.h" -#include "../../xrEngine/StatGraph.h" +#include "xrEngine/StatGraph.h" class dxStatGraphRender : public IStatGraphRender { diff --git a/src/Layers/xrRender/dxStatsRender.cpp b/src/Layers/xrRender/dxStatsRender.cpp index 6a69241c2e3..dcd52c22f56 100644 --- a/src/Layers/xrRender/dxStatsRender.cpp +++ b/src/Layers/xrRender/dxStatsRender.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "dxStatsRender.h" -#include "../../xrEngine/GameFont.h" +#include "xrEngine/GameFont.h" #include "dxRenderDeviceRender.h" void dxStatsRender::Copy(IStatsRender&_in) diff --git a/src/Layers/xrRender/dxThunderboltRender.cpp b/src/Layers/xrRender/dxThunderboltRender.cpp index dad0d8186db..ed00573eee5 100644 --- a/src/Layers/xrRender/dxThunderboltRender.cpp +++ b/src/Layers/xrRender/dxThunderboltRender.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "dxThunderboltRender.h" -#include "../../xrEngine/thunderbolt.h" +#include "xrEngine/thunderbolt.h" #include "dxThunderboltDescRender.h" #include "dxLensFlareRender.h" diff --git a/src/Layers/xrRender/light.h b/src/Layers/xrRender/light.h index c867968e1a1..9f3b6023658 100644 --- a/src/Layers/xrRender/light.h +++ b/src/Layers/xrRender/light.h @@ -1,7 +1,7 @@ #ifndef LAYERS_XRRENDER_LIGHT_H_INCLUDED #define LAYERS_XRRENDER_LIGHT_H_INCLUDED -#include "../../xrcdb/ispatial.h" +#include "xrCDB/ispatial.h" #if (RENDER==R_R2) || (RENDER==R_R3) || (RENDER==R_R4) # include "light_package.h" diff --git a/src/Layers/xrRender/r__dsgraph_build.cpp b/src/Layers/xrRender/r__dsgraph_build.cpp index 0f7f28fb1bc..089f7bc1ef3 100644 --- a/src/Layers/xrRender/r__dsgraph_build.cpp +++ b/src/Layers/xrRender/r__dsgraph_build.cpp @@ -3,7 +3,7 @@ #include "fhierrarhyvisual.h" #include "SkeletonCustom.h" #include "xrCore/FMesh.hpp" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/irenderable.h" #include "flod.h" #include "particlegroup.h" diff --git a/src/Layers/xrRender/r__dsgraph_render.cpp b/src/Layers/xrRender/r__dsgraph_render.cpp index 4b43e00d827..103dc2f755b 100644 --- a/src/Layers/xrRender/r__dsgraph_render.cpp +++ b/src/Layers/xrRender/r__dsgraph_render.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" -#include "../../xrEngine/render.h" -#include "../../xrEngine/irenderable.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" -#include "../../xrEngine/CustomHUD.h" +#include "xrEngine/render.h" +#include "xrEngine/irenderable.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" +#include "xrEngine/CustomHUD.h" #include "FBasicVisual.h" diff --git a/src/Layers/xrRender/r__dsgraph_render_lods.cpp b/src/Layers/xrRender/r__dsgraph_render_lods.cpp index e15eab25b97..2d9cde761af 100644 --- a/src/Layers/xrRender/r__dsgraph_render_lods.cpp +++ b/src/Layers/xrRender/r__dsgraph_render_lods.cpp @@ -5,8 +5,8 @@ #include "igame_persistent.h" #include "environment.h" #else -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #endif extern float r_ssaLOD_A; diff --git a/src/Layers/xrRender/r__dsgraph_structure.h b/src/Layers/xrRender/r__dsgraph_structure.h index 71a1ccc6ef9..116cf1bf2dd 100644 --- a/src/Layers/xrRender/r__dsgraph_structure.h +++ b/src/Layers/xrRender/r__dsgraph_structure.h @@ -1,7 +1,7 @@ #pragma once -#include "../../xrEngine/render.h" -#include "../../xrcdb/ispatial.h" +#include "xrEngine/render.h" +#include "xrCDB/ispatial.h" #include "r__dsgraph_types.h" #include "r__sector.h" diff --git a/src/Layers/xrRender/r__dsgraph_types.h b/src/Layers/xrRender/r__dsgraph_types.h index 41aa3638486..ccbdfd74412 100644 --- a/src/Layers/xrRender/r__dsgraph_types.h +++ b/src/Layers/xrRender/r__dsgraph_types.h @@ -1,13 +1,13 @@ #pragma once -#include "../../xrCore/fixedmap.h" +#include "xrCore/fixedmap.h" //#ifndef USE_MEMORY_MONITOR # define USE_DOUG_LEA_ALLOCATOR_FOR_RENDER //#endif // USE_MEMORY_MONITOR #ifdef USE_DOUG_LEA_ALLOCATOR_FOR_RENDER -# include "../../xrCore/doug_lea_allocator.h" +# include "xrCore/doug_lea_allocator.h" extern doug_lea_allocator g_render_lua_allocator; template diff --git a/src/Layers/xrRender/r__screenshot.cpp b/src/Layers/xrRender/r__screenshot.cpp index 8580997c48f..2bdb0dfe699 100644 --- a/src/Layers/xrRender/r__screenshot.cpp +++ b/src/Layers/xrRender/r__screenshot.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" -//#include "../../xrEngine/xr_effgamma.h" +//#include "xrEngine/xr_effgamma.h" #include "xr_effgamma.h" #include "dxRenderDeviceRender.h" #include "../xrRender/tga.h" -#include "../../xrEngine/xrImage_Resampler.h" +#include "xrEngine/xrImage_Resampler.h" #if defined(USE_DX10) || defined(USE_DX11) #include "d3dx10tex.h" diff --git a/src/Layers/xrRender/r__sector.cpp b/src/Layers/xrRender/r__sector.cpp index 4df9018cb66..b2267b535fb 100644 --- a/src/Layers/xrRender/r__sector.cpp +++ b/src/Layers/xrRender/r__sector.cpp @@ -4,10 +4,10 @@ #include "stdafx.h" #include "r__sector.h" -#include "../../xrEngine/xrLevel.h" -#include "../../xrEngine/xr_object.h" +#include "xrEngine/xrLevel.h" +#include "xrEngine/xr_object.h" #include "fbasicvisual.h" -#include "../../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #include "dxRenderDeviceRender.h" ////////////////////////////////////////////////////////////////////// diff --git a/src/Layers/xrRender/r__sector_traversal.cpp b/src/Layers/xrRender/r__sector_traversal.cpp index 012e599d438..abc5d97faa3 100644 --- a/src/Layers/xrRender/r__sector_traversal.cpp +++ b/src/Layers/xrRender/r__sector_traversal.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "fvf.h" CPortalTraverser PortalTraverser; diff --git a/src/Layers/xrRender/r_constants.cpp b/src/Layers/xrRender/r_constants.cpp index 9e8df5c3887..c1c8d0425f4 100644 --- a/src/Layers/xrRender/r_constants.cpp +++ b/src/Layers/xrRender/r_constants.cpp @@ -7,7 +7,7 @@ #include "ResourceManager.h" -#include "../../xrCore/xrPool.h" +#include "xrCore/xrPool.h" #include "r_constants.h" #include "../xrRender/dxRenderDeviceRender.h" diff --git a/src/Layers/xrRender/r_constants.h b/src/Layers/xrRender/r_constants.h index 01e9dc0d883..58fdff79f8c 100644 --- a/src/Layers/xrRender/r_constants.h +++ b/src/Layers/xrRender/r_constants.h @@ -2,7 +2,7 @@ #define r_constantsH #pragma once -#include "../../xrcore/xr_resource.h" +#include "xrCore/xr_resource.h" #if defined(USE_DX10) || defined(USE_DX11) diff --git a/src/Layers/xrRender/xrRender_console.cpp b/src/Layers/xrRender/xrRender_console.cpp index 48c8c9fb5fd..07e939fd262 100644 --- a/src/Layers/xrRender/xrRender_console.cpp +++ b/src/Layers/xrRender/xrRender_console.cpp @@ -229,8 +229,8 @@ int ps_r3_dyn_wet_surf_sm_res = 256; // 256 float ps_r2_gloss_factor = 4.0f; //- Mad Max #ifndef _EDITOR -#include "../../xrEngine/xr_ioconsole.h" -#include "../../xrEngine/xr_ioc_cmd.h" +#include "xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioc_cmd.h" #if defined(USE_DX10) || defined(USE_DX11) #include "../xrRenderDX10/StateManager/dx10SamplerStateCache.h" diff --git a/src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp b/src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp index 01213b76a88..d07226f6d2a 100644 --- a/src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp +++ b/src/Layers/xrRenderDX10/3DFluid/dx103DFluidObstacles.cpp @@ -2,10 +2,10 @@ #include "dx103DFluidObstacles.h" #include "../../xrRender/dxRenderDeviceRender.h" -#include "../../../xrEngine/xr_object.h" -#include "../../../xrEngine/IPhysicsShell.h" -#include "../../../xrEngine/IObjectPhysicsCollision.h" -#include "../../../xrEngine/IPhysicsGeometry.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/IPhysicsShell.h" +#include "xrEngine/IObjectPhysicsCollision.h" +#include "xrEngine/IPhysicsGeometry.h" #include "dx103DFluidBlenders.h" #include "dx103DFluidData.h" diff --git a/src/Layers/xrRenderDX10/dx10DetailManager_VS.cpp b/src/Layers/xrRenderDX10/dx10DetailManager_VS.cpp index 4c0803b47da..a6078aa1235 100644 --- a/src/Layers/xrRenderDX10/dx10DetailManager_VS.cpp +++ b/src/Layers/xrRenderDX10/dx10DetailManager_VS.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "../xrRender/DetailManager.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRenderDX10/dx10BufferUtils.h" diff --git a/src/Layers/xrRenderDX10/dx10HW.cpp b/src/Layers/xrRenderDX10/dx10HW.cpp index 36e59011e40..32a76c60a9b 100644 --- a/src/Layers/xrRenderDX10/dx10HW.cpp +++ b/src/Layers/xrRenderDX10/dx10HW.cpp @@ -8,8 +8,8 @@ #include #pragma warning(default:4995) #include "../xrRender/HW.h" -#include "../../xrEngine/XR_IOConsole.h" -#include "../../Include/xrAPI/xrAPI.h" +#include "xrEngine/XR_IOConsole.h" +#include "Include/xrAPI/xrAPI.h" #include "StateManager\dx10SamplerStateCache.h" #include "StateManager\dx10StateCache.h" diff --git a/src/Layers/xrRenderDX10/dx10ResourceManager_Resources.cpp b/src/Layers/xrRenderDX10/dx10ResourceManager_Resources.cpp index aca50d2a2a1..6256863e9dd 100644 --- a/src/Layers/xrRenderDX10/dx10ResourceManager_Resources.cpp +++ b/src/Layers/xrRenderDX10/dx10ResourceManager_Resources.cpp @@ -5,7 +5,7 @@ #include #ifndef _EDITOR #pragma comment( lib, "d3dx9.lib" ) -#include "../../xrEngine/render.h" +#include "xrEngine/render.h" #endif #pragma warning(default:4995) diff --git a/src/Layers/xrRenderDX10/dx10ResourceManager_Scripting.cpp b/src/Layers/xrRenderDX10/dx10ResourceManager_Scripting.cpp index d929db86302..bc917e76121 100644 --- a/src/Layers/xrRenderDX10/dx10ResourceManager_Scripting.cpp +++ b/src/Layers/xrRenderDX10/dx10ResourceManager_Scripting.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #pragma hdrstop -#include "../../xrEngine/Render.h" +#include "xrEngine/Render.h" #include "../xrRender/ResourceManager.h" #include "../xrRender/tss.h" #include "../xrRender/blenders/blender.h" @@ -9,9 +9,9 @@ // adopt_compiler don't have = operator And it can't have = operator #pragma warning( push ) #pragma warning( disable : 4512) -#include "../../xrEngine/ai_script_space.h" +#include "xrEngine/ai_script_space.h" #pragma warning( pop ) -#include "../../xrEngine/ai_script_lua_extension.h" +#include "xrEngine/ai_script_lua_extension.h" #include "luabind/return_reference_to_policy.hpp" #include "../xrRender/dxRenderDeviceRender.h" @@ -158,7 +158,7 @@ static void *lua_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { } #else // USE_DL_ALLOCATOR -#include "../../xrCore/memory_allocator_options.h" +#include "xrCore/memory_allocator_options.h" #ifdef USE_ARENA_ALLOCATOR static const u32 s_arena_size = 8*1024*1024; diff --git a/src/Layers/xrRenderDX10/dx10SH_Texture.cpp b/src/Layers/xrRenderDX10/dx10SH_Texture.cpp index 39c15e9660a..74b49cf5dee 100644 --- a/src/Layers/xrRenderDX10/dx10SH_Texture.cpp +++ b/src/Layers/xrRenderDX10/dx10SH_Texture.cpp @@ -4,11 +4,11 @@ #include "../xrRender/ResourceManager.h" #ifndef _EDITOR -#include "../../xrEngine/render.h" +#include "xrEngine/render.h" #endif -#include "../../xrEngine/tntQAVI.h" -#include "../../xrEngine/xrTheora_Surface.h" +#include "xrEngine/tntQAVI.h" +#include "xrEngine/xrTheora_Surface.h" #include "../xrRender/dxRenderDeviceRender.h" diff --git a/src/Layers/xrRenderDX10/dx10r_constants.cpp b/src/Layers/xrRenderDX10/dx10r_constants.cpp index 96336a0b5bc..42efec8192c 100644 --- a/src/Layers/xrRenderDX10/dx10r_constants.cpp +++ b/src/Layers/xrRenderDX10/dx10r_constants.cpp @@ -7,7 +7,7 @@ #include "../xrRender/ResourceManager.h" -#include "../../xrCore/xrPool.h" +#include "xrCore/xrPool.h" #include "../xrRender/r_constants.h" #include "../xrRender/dxRenderDeviceRender.h" diff --git a/src/Layers/xrRenderPC_R1/FStaticRender.cpp b/src/Layers/xrRenderPC_R1/FStaticRender.cpp index 2ef2c3daa05..7fb59410325 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender.cpp @@ -3,18 +3,18 @@ ////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRender/fbasicvisual.h" -#include "../../xrEngine/CustomHUD.h" -#include "../../xrEngine/xr_object.h" +#include "xrEngine/CustomHUD.h" +#include "xrEngine/xr_object.h" #include "xrCore/FMesh.hpp" #include "../xrRender/SkeletonCustom.h" #include "../xrRender/lighttrack.h" #include "../xrRender/dxRenderDeviceRender.h" #include "../xrRender/dxWallMarkArray.h" #include "../xrRender/dxUIShader.h" -//#include "../../xrServerEntities/smart_cast.h" +//#include "xrServerEntities/smart_cast.h" #ifndef _EDITOR #include "../../xrCPU_Pipe/ttapi.h" @@ -262,7 +262,7 @@ void CRender::add_Occluder (Fbox2& bb_screenspace ) HOM.occlude (bb_screenspace); } -#include "../../xrEngine/PS_instance.h" +#include "xrEngine/PS_instance.h" void CRender::set_Object (IRenderable* O ) { VERIFY (g_bRendering); @@ -645,7 +645,7 @@ void CRender::ApplyBlur4 (FVF::TL4uv* pv, u32 w, u32 h, float k) pv->p.set(float(_w+EPS),EPS, EPS,1.f); pv->color=_c; pv->uv[0].set(p1.x-kw,p0.y-kh);pv->uv[1].set(p1.x+kw,p0.y+kh);pv->uv[2].set(p1.x+kw,p0.y-kh);pv->uv[3].set(p1.x-kw,p0.y+kh);pv++; } -#include "../../xrEngine/GameFont.h" +#include "xrEngine/GameFont.h" void CRender::Statistics (CGameFont* _F) { CGameFont& F = *_F; diff --git a/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp b/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp index 18a8ce10e0e..c8361c4fd7d 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender_Loader.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "../xrRender/fbasicvisual.h" #include "xrCore/FMesh.hpp" -#include "../../xrEngine/xrLevel.h" -#include "../../xrEngine/x_ray.h" -#include "../../xrEngine/IGame_Persistent.h" -#include "../../xrCore/stream_reader.h" +#include "xrEngine/xrLevel.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/IGame_Persistent.h" +#include "xrCore/stream_reader.h" #include "../xrRender/dxRenderDeviceRender.h" diff --git a/src/Layers/xrRenderPC_R1/FStaticRender_RenderTarget.cpp b/src/Layers/xrRenderPC_R1/FStaticRender_RenderTarget.cpp index 2a4c9ce8d6a..31caca927c5 100644 --- a/src/Layers/xrRenderPC_R1/FStaticRender_RenderTarget.cpp +++ b/src/Layers/xrRenderPC_R1/FStaticRender_RenderTarget.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "fstaticrender_rendertarget.h" -#include "../../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" static LPCSTR RTname = "$user$rendertarget"; diff --git a/src/Layers/xrRenderPC_R1/GlowManager.cpp b/src/Layers/xrRenderPC_R1/GlowManager.cpp index 4229833b6f1..e5b9fe6a395 100644 --- a/src/Layers/xrRenderPC_R1/GlowManager.cpp +++ b/src/Layers/xrRenderPC_R1/GlowManager.cpp @@ -3,12 +3,12 @@ ////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" -#include "../../xrEngine/x_ray.h" -#include "../../xrEngine/GameFont.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/GameFont.h" #include "GlowManager.h" -#include "../../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" #define FADE_SCALE_UP 4096.f #define FADE_SCALE_DOWN 1024.f diff --git a/src/Layers/xrRenderPC_R1/GlowManager.h b/src/Layers/xrRenderPC_R1/GlowManager.h index 472659c3b87..2b036880740 100644 --- a/src/Layers/xrRenderPC_R1/GlowManager.h +++ b/src/Layers/xrRenderPC_R1/GlowManager.h @@ -6,8 +6,8 @@ #define AFX_GLOWMANAGER_H__EC35911F_479B_469A_845C_1A64D81D0326__INCLUDED_ #pragma once -#include "../../xrcdb/ispatial.h" -#include "../../xrcdb/xr_collide_defs.h" +#include "xrCDB/ispatial.h" +#include "xrCDB/xr_collide_defs.h" class CGlow : public IRender_Glow, public ISpatial { diff --git a/src/Layers/xrRenderPC_R1/LightPPA.cpp b/src/Layers/xrRenderPC_R1/LightPPA.cpp index c325d7fbfa1..09f6eb3a469 100644 --- a/src/Layers/xrRenderPC_R1/LightPPA.cpp +++ b/src/Layers/xrRenderPC_R1/LightPPA.cpp @@ -4,10 +4,10 @@ #include "stdafx.h" #include "LightPPA.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRender/fbasicvisual.h" -#include "../../xrEngine/CustomHUD.h" +#include "xrEngine/CustomHUD.h" const u32 MAX_POLYGONS = 1024*8; const float MAX_DISTANCE = 50.f; diff --git a/src/Layers/xrRenderPC_R1/LightProjector.cpp b/src/Layers/xrRenderPC_R1/LightProjector.cpp index 68166820c17..d9495b8a9e3 100644 --- a/src/Layers/xrRenderPC_R1/LightProjector.cpp +++ b/src/Layers/xrRenderPC_R1/LightProjector.cpp @@ -4,8 +4,8 @@ #include "stdafx.h" #include "LightProjector.h" -#include "../../include/xrRender/RenderVisual.h" -#include "../../xrEngine/xr_object.h" +#include "Include/xrRender/RenderVisual.h" +#include "xrEngine/xr_object.h" #include "../xrRender/lighttrack.h" #ifndef _EDITOR diff --git a/src/Layers/xrRenderPC_R1/LightShadows.cpp b/src/Layers/xrRenderPC_R1/LightShadows.cpp index da9f2a246bb..2feb193e978 100644 --- a/src/Layers/xrRenderPC_R1/LightShadows.cpp +++ b/src/Layers/xrRenderPC_R1/LightShadows.cpp @@ -5,9 +5,9 @@ #include "stdafx.h" #include "LightShadows.h" #include "../xrRender/LightTrack.h" -#include "../../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" #include "../xrRender/fbasicvisual.h" -#include "../../xrEngine/CustomHUD.h" +#include "xrEngine/CustomHUD.h" #ifndef _EDITOR #include "../../xrCPU_Pipe/ttapi.h" diff --git a/src/Layers/xrRenderPC_R1/stdafx.h b/src/Layers/xrRenderPC_R1/stdafx.h index cb87fcc99aa..6cf97140111 100644 --- a/src/Layers/xrRenderPC_R1/stdafx.h +++ b/src/Layers/xrRenderPC_R1/stdafx.h @@ -5,7 +5,7 @@ #pragma once #pragma warning(disable:4995) -#include "../../xrEngine/stdafx.h" +#include "xrEngine/stdafx.h" #pragma warning(disable:4995) #include #pragma warning(default:4995) @@ -28,16 +28,16 @@ #include "../xrRender/resourcemanager.h" -#include "../../xrEngine/vis_common.h" -#include "../../xrEngine/render.h" -#include "../../xrEngine/_d3d_extensions.h" +#include "xrEngine/vis_common.h" +#include "xrEngine/render.h" +#include "xrEngine/_d3d_extensions.h" #ifndef _EDITOR -#include "../../xrEngine/igame_level.h" +#include "xrEngine/igame_level.h" #include "../xrRender/blenders\blender.h" #include "../xrRender/blenders\blender_clsid.h" -#include "../../xrParticles/psystem.h" +#include "xrParticles/psystem.h" #include "../xrRender/xrRender_console.h" #include "FStaticRender.h" #endif diff --git a/src/Layers/xrRenderPC_R2/r2.cpp b/src/Layers/xrRenderPC_R2/r2.cpp index f1ad8fd9ad6..a8a6886fdd6 100644 --- a/src/Layers/xrRenderPC_R2/r2.cpp +++ b/src/Layers/xrRenderPC_R2/r2.cpp @@ -1,16 +1,16 @@ #include "stdafx.h" #include "r2.h" #include "../xrRender/fbasicvisual.h" -#include "../../xrEngine/xr_object.h" -#include "../../xrEngine/CustomHUD.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/CustomHUD.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRender/SkeletonCustom.h" #include "../xrRender/LightTrack.h" #include "../xrRender/dxRenderDeviceRender.h" #include "../xrRender/dxWallMarkArray.h" #include "../xrRender/dxUIShader.h" -//#include "../../xrServerEntities/smart_cast.h" +//#include "xrServerEntities/smart_cast.h" CRender RImplementation; @@ -524,7 +524,7 @@ CRender::~CRender() { } -#include "../../xrEngine/GameFont.h" +#include "xrEngine/GameFont.h" void CRender::Statistics (CGameFont* _F) { CGameFont& F = *_F; diff --git a/src/Layers/xrRenderPC_R2/r2.h b/src/Layers/xrRenderPC_R2/r2.h index 4e2abe9d1c8..6b4cf240364 100644 --- a/src/Layers/xrRenderPC_R2/r2.h +++ b/src/Layers/xrRenderPC_R2/r2.h @@ -19,7 +19,7 @@ #include "../xrRender/LightTrack.h" #include "../xrRender/r_sun_cascades.h" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/irenderable.h" #include "xrCore/FMesh.hpp" diff --git a/src/Layers/xrRenderPC_R2/r2_R_calculate.cpp b/src/Layers/xrRenderPC_R2/r2_R_calculate.cpp index af6c4887a5a..7c41eea915f 100644 --- a/src/Layers/xrRenderPC_R2/r2_R_calculate.cpp +++ b/src/Layers/xrRenderPC_R2/r2_R_calculate.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../../xrEngine/customhud.h" +#include "xrEngine/customhud.h" float g_fSCREEN ; diff --git a/src/Layers/xrRenderPC_R2/r2_R_render.cpp b/src/Layers/xrRenderPC_R2/r2_R_render.cpp index c8b05835bf9..fb513589694 100644 --- a/src/Layers/xrRenderPC_R2/r2_R_render.cpp +++ b/src/Layers/xrRenderPC_R2/r2_R_render.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #include "../xrRender/FBasicVisual.h" -#include "../../xrEngine/customhud.h" -#include "../../xrEngine/xr_object.h" +#include "xrEngine/customhud.h" +#include "xrEngine/xr_object.h" IC bool pred_sp_sort (ISpatial* _1, ISpatial* _2) { diff --git a/src/Layers/xrRenderPC_R2/r2_R_sun.cpp b/src/Layers/xrRenderPC_R2/r2_R_sun.cpp index bad8fa3d67a..09f41b73940 100644 --- a/src/Layers/xrRenderPC_R2/r2_R_sun.cpp +++ b/src/Layers/xrRenderPC_R2/r2_R_sun.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/irenderable.h" #include "../xrRender/FBasicVisual.h" const float tweak_COP_initial_offs = 1200.f ; diff --git a/src/Layers/xrRenderPC_R2/r2_loader.cpp b/src/Layers/xrRenderPC_R2/r2_loader.cpp index acf5bd30cef..d6851c7ceb3 100644 --- a/src/Layers/xrRenderPC_R2/r2_loader.cpp +++ b/src/Layers/xrRenderPC_R2/r2_loader.cpp @@ -3,10 +3,10 @@ #include "../xrRender/ResourceManager.h" #include "../xrRender/fbasicvisual.h" #include "xrCore/FMesh.hpp" -#include "../../xrEngine/xrLevel.h" -#include "../../xrEngine/x_ray.h" -#include "../../xrEngine/IGame_Persistent.h" -#include "../../xrCore/stream_reader.h" +#include "xrEngine/xrLevel.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/IGame_Persistent.h" +#include "xrCore/stream_reader.h" #include "../xrRender/dxRenderDeviceRender.h" diff --git a/src/Layers/xrRenderPC_R2/r2_rendertarget_accum_direct.cpp b/src/Layers/xrRenderPC_R2/r2_rendertarget_accum_direct.cpp index 3686a29f0fd..a47e0e87173 100644 --- a/src/Layers/xrRenderPC_R2/r2_rendertarget_accum_direct.cpp +++ b/src/Layers/xrRenderPC_R2/r2_rendertarget_accum_direct.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" ////////////////////////////////////////////////////////////////////////// // tables to calculate view-frustum bounds in world space diff --git a/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_bloom.cpp b/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_bloom.cpp index 820503d04bc..6948ab043c7 100644 --- a/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_bloom.cpp +++ b/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_bloom.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #pragma pack(push,4) struct v_build { diff --git a/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_combine.cpp b/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_combine.cpp index 8e6a7c2d40b..c8590454308 100644 --- a/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_combine.cpp +++ b/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_combine.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRender/dxEnvironmentRender.h" diff --git a/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_ssao.cpp b/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_ssao.cpp index cada539ba6d..265dce41cb9 100644 --- a/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_ssao.cpp +++ b/src/Layers/xrRenderPC_R2/r2_rendertarget_phase_ssao.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" -//#include "../../xrEngine/igame_persistent.h" -//#include "../../xrEngine/environment.h" +//#include "xrEngine/igame_persistent.h" +//#include "xrEngine/environment.h" #pragma pack(push,4) struct v_ssao { diff --git a/src/Layers/xrRenderPC_R2/stdafx.h b/src/Layers/xrRenderPC_R2/stdafx.h index 29df40a7cb4..cffecaf7a45 100644 --- a/src/Layers/xrRenderPC_R2/stdafx.h +++ b/src/Layers/xrRenderPC_R2/stdafx.h @@ -5,7 +5,7 @@ #pragma once #pragma warning(disable:4995) -#include "../../xrEngine/stdafx.h" +#include "xrEngine/stdafx.h" #pragma warning(disable:4995) #include #pragma warning(default:4995) @@ -29,13 +29,13 @@ #include "../xrRender/resourcemanager.h" -#include "../../xrEngine/vis_common.h" -#include "../../xrEngine/render.h" -#include "../../xrEngine/_d3d_extensions.h" -#include "../../xrEngine/igame_level.h" +#include "xrEngine/vis_common.h" +#include "xrEngine/render.h" +#include "xrEngine/_d3d_extensions.h" +#include "xrEngine/igame_level.h" #include "../xrRender/blenders\blender.h" #include "../xrRender/blenders\blender_clsid.h" -#include "../../xrParticles/psystem.h" +#include "xrParticles/psystem.h" #include "../xrRender/xrRender_console.h" #include "r2.h" diff --git a/src/Layers/xrRenderPC_R3/r2_R_calculate.cpp b/src/Layers/xrRenderPC_R3/r2_R_calculate.cpp index af6c4887a5a..7c41eea915f 100644 --- a/src/Layers/xrRenderPC_R3/r2_R_calculate.cpp +++ b/src/Layers/xrRenderPC_R3/r2_R_calculate.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../../xrEngine/customhud.h" +#include "xrEngine/customhud.h" float g_fSCREEN ; diff --git a/src/Layers/xrRenderPC_R3/r2_R_sun.cpp b/src/Layers/xrRenderPC_R3/r2_R_sun.cpp index 71ed0e41044..8bb235a0912 100644 --- a/src/Layers/xrRenderPC_R3/r2_R_sun.cpp +++ b/src/Layers/xrRenderPC_R3/r2_R_sun.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/irenderable.h" #include "../xrRender/FBasicVisual.h" #include "r3_R_sun_support.h" diff --git a/src/Layers/xrRenderPC_R3/r3.cpp b/src/Layers/xrRenderPC_R3/r3.cpp index 072c088f5b2..55e108be7fe 100644 --- a/src/Layers/xrRenderPC_R3/r3.cpp +++ b/src/Layers/xrRenderPC_R3/r3.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "r3.h" #include "../xrRender/fbasicvisual.h" -#include "../../xrEngine/xr_object.h" -#include "../../xrEngine/CustomHUD.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/CustomHUD.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRender/SkeletonCustom.h" #include "../xrRender/LightTrack.h" #include "../xrRender/dxRenderDeviceRender.h" @@ -658,7 +658,7 @@ CRender::~CRender() { } -#include "../../xrEngine/GameFont.h" +#include "xrEngine/GameFont.h" void CRender::Statistics (CGameFont* _F) { CGameFont& F = *_F; diff --git a/src/Layers/xrRenderPC_R3/r3.h b/src/Layers/xrRenderPC_R3/r3.h index f47bbf414c1..3762eaf4df0 100644 --- a/src/Layers/xrRenderPC_R3/r3.h +++ b/src/Layers/xrRenderPC_R3/r3.h @@ -19,7 +19,7 @@ #include "../xrRender/LightTrack.h" #include "../xrRender/r_sun_cascades.h" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/irenderable.h" #include "xrCore/FMesh.hpp" diff --git a/src/Layers/xrRenderPC_R3/r3_R_rain.cpp b/src/Layers/xrRenderPC_R3/r3_R_rain.cpp index f6be2b69bc5..95101d65f7b 100644 --- a/src/Layers/xrRenderPC_R3/r3_R_rain.cpp +++ b/src/Layers/xrRenderPC_R3/r3_R_rain.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/irenderable.h" #include "../xrRender/FBasicVisual.h" #include "r3_R_sun_support.h" diff --git a/src/Layers/xrRenderPC_R3/r3_R_render.cpp b/src/Layers/xrRenderPC_R3/r3_R_render.cpp index 15bb5f51554..7523617d738 100644 --- a/src/Layers/xrRenderPC_R3/r3_R_render.cpp +++ b/src/Layers/xrRenderPC_R3/r3_R_render.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #include "../xrRender/FBasicVisual.h" -#include "../../xrEngine/customhud.h" -#include "../../xrEngine/xr_object.h" +#include "xrEngine/customhud.h" +#include "xrEngine/xr_object.h" #include "../xrRender/QueryHelper.h" diff --git a/src/Layers/xrRenderPC_R3/r3_loader.cpp b/src/Layers/xrRenderPC_R3/r3_loader.cpp index 6987ddfcadc..09280aacb47 100644 --- a/src/Layers/xrRenderPC_R3/r3_loader.cpp +++ b/src/Layers/xrRenderPC_R3/r3_loader.cpp @@ -3,10 +3,10 @@ #include "../xrRender/ResourceManager.h" #include "../xrRender/fbasicvisual.h" #include "xrCore/FMesh.hpp" -#include "../../xrEngine/xrLevel.h" -#include "../../xrEngine/x_ray.h" -#include "../../xrEngine/IGame_Persistent.h" -#include "../../xrCore/stream_reader.h" +#include "xrEngine/xrLevel.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/IGame_Persistent.h" +#include "xrCore/stream_reader.h" #include "../xrRender/dxRenderDeviceRender.h" diff --git a/src/Layers/xrRenderPC_R3/r3_rendertarget_accum_direct.cpp b/src/Layers/xrRenderPC_R3/r3_rendertarget_accum_direct.cpp index ca0f5b17916..014f5298618 100644 --- a/src/Layers/xrRenderPC_R3/r3_rendertarget_accum_direct.cpp +++ b/src/Layers/xrRenderPC_R3/r3_rendertarget_accum_direct.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" ////////////////////////////////////////////////////////////////////////// // tables to calculate view-frustum bounds in world space diff --git a/src/Layers/xrRenderPC_R3/r3_rendertarget_phase_bloom.cpp b/src/Layers/xrRenderPC_R3/r3_rendertarget_phase_bloom.cpp index 0b9da47157c..ba9348b39d3 100644 --- a/src/Layers/xrRenderPC_R3/r3_rendertarget_phase_bloom.cpp +++ b/src/Layers/xrRenderPC_R3/r3_rendertarget_phase_bloom.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #pragma pack(push,4) struct v_build { diff --git a/src/Layers/xrRenderPC_R3/r3_rendertarget_phase_combine.cpp b/src/Layers/xrRenderPC_R3/r3_rendertarget_phase_combine.cpp index 828fe1ac146..53e677e20ea 100644 --- a/src/Layers/xrRenderPC_R3/r3_rendertarget_phase_combine.cpp +++ b/src/Layers/xrRenderPC_R3/r3_rendertarget_phase_combine.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRender/dxEnvironmentRender.h" diff --git a/src/Layers/xrRenderPC_R3/stdafx.h b/src/Layers/xrRenderPC_R3/stdafx.h index a25a4b77dc6..6c4f2e7890d 100644 --- a/src/Layers/xrRenderPC_R3/stdafx.h +++ b/src/Layers/xrRenderPC_R3/stdafx.h @@ -5,7 +5,7 @@ #pragma once #pragma warning(disable:4995) -#include "../../xrEngine/stdafx.h" +#include "xrEngine/stdafx.h" #pragma warning(disable:4995) #include #pragma warning(default:4995) @@ -30,7 +30,7 @@ #define RENDER R_R3 -#include "../../xrParticles/psystem.h" +#include "xrParticles/psystem.h" #include "../xrRender/HW.h" #include "../xrRender/Shader.h" @@ -39,10 +39,10 @@ #include "../xrRender/resourcemanager.h" -#include "../../xrEngine/vis_common.h" -#include "../../xrEngine/render.h" -#include "../../xrEngine/_d3d_extensions.h" -#include "../../xrEngine/igame_level.h" +#include "xrEngine/vis_common.h" +#include "xrEngine/render.h" +#include "xrEngine/_d3d_extensions.h" +#include "xrEngine/igame_level.h" #include "../xrRender/blenders\blender.h" #include "../xrRender/blenders\blender_clsid.h" #include "../xrRender/xrRender_console.h" diff --git a/src/Layers/xrRenderPC_R4/r2_R_calculate.cpp b/src/Layers/xrRenderPC_R4/r2_R_calculate.cpp index af6c4887a5a..7c41eea915f 100644 --- a/src/Layers/xrRenderPC_R4/r2_R_calculate.cpp +++ b/src/Layers/xrRenderPC_R4/r2_R_calculate.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../../xrEngine/customhud.h" +#include "xrEngine/customhud.h" float g_fSCREEN ; diff --git a/src/Layers/xrRenderPC_R4/r2_R_sun.cpp b/src/Layers/xrRenderPC_R4/r2_R_sun.cpp index 2a5b0ec3b4f..5fe11425355 100644 --- a/src/Layers/xrRenderPC_R4/r2_R_sun.cpp +++ b/src/Layers/xrRenderPC_R4/r2_R_sun.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/irenderable.h" #include "../xrRender/FBasicVisual.h" #include "r4_R_sun_support.h" diff --git a/src/Layers/xrRenderPC_R4/r4.cpp b/src/Layers/xrRenderPC_R4/r4.cpp index da78151a5ee..5766797a6ce 100644 --- a/src/Layers/xrRenderPC_R4/r4.cpp +++ b/src/Layers/xrRenderPC_R4/r4.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "r4.h" #include "../xrRender/fbasicvisual.h" -#include "../../xrEngine/xr_object.h" -#include "../../xrEngine/CustomHUD.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/CustomHUD.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRender/SkeletonCustom.h" #include "../xrRender/LightTrack.h" #include "../xrRender/dxRenderDeviceRender.h" @@ -672,7 +672,7 @@ CRender::~CRender() { } -#include "../../xrEngine/GameFont.h" +#include "xrEngine/GameFont.h" void CRender::Statistics (CGameFont* _F) { CGameFont& F = *_F; diff --git a/src/Layers/xrRenderPC_R4/r4.h b/src/Layers/xrRenderPC_R4/r4.h index aa0563ac78d..71b1800b639 100644 --- a/src/Layers/xrRenderPC_R4/r4.h +++ b/src/Layers/xrRenderPC_R4/r4.h @@ -19,7 +19,7 @@ #include "../xrRender/LightTrack.h" #include "../xrRender/r_sun_cascades.h" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/irenderable.h" #include "xrCore/FMesh.hpp" class dxRender_Visual; diff --git a/src/Layers/xrRenderPC_R4/r4_R_rain.cpp b/src/Layers/xrRenderPC_R4/r4_R_rain.cpp index e45b30adc4d..1ce52c675a3 100644 --- a/src/Layers/xrRenderPC_R4/r4_R_rain.cpp +++ b/src/Layers/xrRenderPC_R4/r4_R_rain.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/irenderable.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/irenderable.h" #include "../xrRender/FBasicVisual.h" #include "r4_R_sun_support.h" diff --git a/src/Layers/xrRenderPC_R4/r4_R_render.cpp b/src/Layers/xrRenderPC_R4/r4_R_render.cpp index 724e8bf622d..06d76476a31 100644 --- a/src/Layers/xrRenderPC_R4/r4_R_render.cpp +++ b/src/Layers/xrRenderPC_R4/r4_R_render.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #include "../xrRender/FBasicVisual.h" -#include "../../xrEngine/customhud.h" -#include "../../xrEngine/xr_object.h" +#include "xrEngine/customhud.h" +#include "xrEngine/xr_object.h" #include "../xrRender/QueryHelper.h" diff --git a/src/Layers/xrRenderPC_R4/r4_loader.cpp b/src/Layers/xrRenderPC_R4/r4_loader.cpp index ed16a6a8560..d589b23fcd7 100644 --- a/src/Layers/xrRenderPC_R4/r4_loader.cpp +++ b/src/Layers/xrRenderPC_R4/r4_loader.cpp @@ -3,10 +3,10 @@ #include "../xrRender/ResourceManager.h" #include "../xrRender/fbasicvisual.h" #include "xrCore/FMesh.hpp" -#include "../../xrEngine/xrLevel.h" -#include "../../xrEngine/x_ray.h" -#include "../../xrEngine/IGame_Persistent.h" -#include "../../xrCore/stream_reader.h" +#include "xrEngine/xrLevel.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/IGame_Persistent.h" +#include "xrCore/stream_reader.h" #include "../xrRender/dxRenderDeviceRender.h" diff --git a/src/Layers/xrRenderPC_R4/r4_rendertarget_accum_direct.cpp b/src/Layers/xrRenderPC_R4/r4_rendertarget_accum_direct.cpp index 918e03e0989..932ff606ff9 100644 --- a/src/Layers/xrRenderPC_R4/r4_rendertarget_accum_direct.cpp +++ b/src/Layers/xrRenderPC_R4/r4_rendertarget_accum_direct.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" ////////////////////////////////////////////////////////////////////////// // tables to calculate view-frustum bounds in world space diff --git a/src/Layers/xrRenderPC_R4/r4_rendertarget_phase_bloom.cpp b/src/Layers/xrRenderPC_R4/r4_rendertarget_phase_bloom.cpp index 405fd4ff874..e800b95645f 100644 --- a/src/Layers/xrRenderPC_R4/r4_rendertarget_phase_bloom.cpp +++ b/src/Layers/xrRenderPC_R4/r4_rendertarget_phase_bloom.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #pragma pack(push,4) struct v_build { diff --git a/src/Layers/xrRenderPC_R4/r4_rendertarget_phase_combine.cpp b/src/Layers/xrRenderPC_R4/r4_rendertarget_phase_combine.cpp index d5427a4b5f8..004119ca6c7 100644 --- a/src/Layers/xrRenderPC_R4/r4_rendertarget_phase_combine.cpp +++ b/src/Layers/xrRenderPC_R4/r4_rendertarget_phase_combine.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../xrEngine/igame_persistent.h" -#include "../../xrEngine/environment.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/environment.h" #include "../xrRender/dxEnvironmentRender.h" diff --git a/src/Layers/xrRenderPC_R4/stdafx.h b/src/Layers/xrRenderPC_R4/stdafx.h index 856c4044d57..a900b4dceaa 100644 --- a/src/Layers/xrRenderPC_R4/stdafx.h +++ b/src/Layers/xrRenderPC_R4/stdafx.h @@ -5,7 +5,7 @@ #pragma once #pragma warning(disable:4995) -#include "../../xrEngine/stdafx.h" +#include "xrEngine/stdafx.h" #pragma warning(disable:4995) #include #pragma warning(default:4995) @@ -28,7 +28,7 @@ #define R_R4 4 #define RENDER R_R4 -#include "../../xrParticles/psystem.h" +#include "xrParticles/psystem.h" #include "../xrRender/HW.h" #include "../xrRender/Shader.h" @@ -37,10 +37,10 @@ #include "../xrRender/resourcemanager.h" -#include "../../xrEngine/vis_common.h" -#include "../../xrEngine/render.h" -#include "../../xrEngine/_d3d_extensions.h" -#include "../../xrEngine/igame_level.h" +#include "xrEngine/vis_common.h" +#include "xrEngine/render.h" +#include "xrEngine/_d3d_extensions.h" +#include "xrEngine/igame_level.h" #include "../xrRender/blenders\blender.h" #include "../xrRender/blenders\blender_clsid.h" #include "../xrRender/xrRender_console.h" diff --git a/src/editors/ECore/Editor/EditObject.h b/src/editors/ECore/Editor/EditObject.h index aa90d24a4b9..b979fda9c48 100644 --- a/src/editors/ECore/Editor/EditObject.h +++ b/src/editors/ECore/Editor/EditObject.h @@ -4,12 +4,12 @@ #include "xrCore/Animation/Bone.hpp" #include "xrCore/Animation/Motion.hpp" #ifdef _EDITOR -# include "../../../xrServerEntities/PropertiesListTypes.h" +# include "xrServerEntities/PropertiesListTypes.h" // #include "PropertiesListHelper.h" # include "xrCore/MaterialLib/GameMtlLib.h" # include "pick_defs.h" #endif -# include "../../../include/xrrender/kinematics.h" +# include "Include/xrRender/kinematics.h" #include "physicsshellholdereditorbase.h" //---------------------------------------------------- diff --git a/src/editors/ECore/Editor/ExportSkeleton.cpp b/src/editors/ECore/Editor/ExportSkeleton.cpp index 6973de9a1a7..e3c90ee7a4e 100644 --- a/src/editors/ECore/Editor/ExportSkeleton.cpp +++ b/src/editors/ECore/Editor/ExportSkeleton.cpp @@ -22,7 +22,7 @@ #include "ui_toolscustom.h" #endif -//#include "../../../Layers/xrRender/SkeletonAnimated.h" +//#include "Layers/xrRender/SkeletonAnimated.h" ECORE_API BOOL g_force16BitTransformQuant = FALSE; diff --git a/src/editors/ECore/Editor/ExportSkeleton.h b/src/editors/ECore/Editor/ExportSkeleton.h index f496c6fd627..cf46e21f8ef 100644 --- a/src/editors/ECore/Editor/ExportSkeleton.h +++ b/src/editors/ECore/Editor/ExportSkeleton.h @@ -2,7 +2,7 @@ #define ExportSkeletonH #include "utils/ETools/PropSlimTools.h" -//#include "../../../Layers/xrRender/SkeletonCustom.h" +//#include "Layers/xrRender/SkeletonCustom.h" #include "EditMesh.h" //--------------------------------------------------------------------------- const int clpSMX = 28, clpSMY=16, clpSMZ=28; diff --git a/src/editors/ECore/Editor/ExportSkeletonCalculateTB.cpp b/src/editors/ECore/Editor/ExportSkeletonCalculateTB.cpp index 15d143f3cda..408b90db607 100644 --- a/src/editors/ECore/Editor/ExportSkeletonCalculateTB.cpp +++ b/src/editors/ECore/Editor/ExportSkeletonCalculateTB.cpp @@ -7,13 +7,13 @@ #ifndef _EDITOR // -#include "../../xrEngine/defines.h" +#include "xrEngine/defines.h" // -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" -#include "../../../Layers/xrRender/hwcaps.h" -#include "../../../Layers/xrRender/hw.h" -#include "../../../xrEngine/pure.h" +#include "Layers/xrRender/hwcaps.h" +#include "Layers/xrRender/hw.h" +#include "xrEngine/pure.h" class CGameFont; #include "..\..\include\xrRender\drawutils.h" #include "..\..\Layers\xrRender\xrD3dDefs.h" diff --git a/src/plugins/Max/Export/MeshExpUtility.cpp b/src/plugins/Max/Export/MeshExpUtility.cpp index e3727793448..7fbcf30fc50 100644 --- a/src/plugins/Max/Export/MeshExpUtility.cpp +++ b/src/plugins/Max/Export/MeshExpUtility.cpp @@ -4,7 +4,7 @@ #pragma hdrstop #include "MeshExpUtility.h" -#include "..\..\..\xrCore\FileSystem.h" +#include "..\..\xrCore/FileSystem.h" #include "MeshExpUtility.rh" #include "..\..\..\editors\ECore\Editor\EditObject.h" #include "..\..\..\editors\ECore\Editor\EditMesh.h" diff --git a/src/plugins/Max/Export/Stdafx.h b/src/plugins/Max/Export/Stdafx.h index 3fde64c1ef1..ea3ff0a047c 100644 --- a/src/plugins/Max/Export/Stdafx.h +++ b/src/plugins/Max/Export/Stdafx.h @@ -11,7 +11,7 @@ #pragma warning (disable:4995) #include "Max.h" -#include "../../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #undef _MIN #undef _MAX diff --git a/src/plugins/Max/Material/Stdafx.h b/src/plugins/Max/Material/Stdafx.h index 3fde64c1ef1..ea3ff0a047c 100644 --- a/src/plugins/Max/Material/Stdafx.h +++ b/src/plugins/Max/Material/Stdafx.h @@ -11,7 +11,7 @@ #pragma warning (disable:4995) #include "Max.h" -#include "../../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #undef _MIN #undef _MAX diff --git a/src/plugins/Maya/Export/Stdafx.h b/src/plugins/Maya/Export/Stdafx.h index 6abc696deca..c730a0e94a3 100644 --- a/src/plugins/Maya/Export/Stdafx.h +++ b/src/plugins/Maya/Export/Stdafx.h @@ -8,7 +8,7 @@ #define ENGINE_API #define _WIN32_WINNT 0x0500 -#include "../../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #pragma warning(push) #pragma warning(disable:4995) diff --git a/src/plugins/Maya/Material/Stdafx.h b/src/plugins/Maya/Material/Stdafx.h index 0196f3ca7ea..539ced7447a 100644 --- a/src/plugins/Maya/Material/Stdafx.h +++ b/src/plugins/Maya/Material/Stdafx.h @@ -7,7 +7,7 @@ #pragma once #define _WIN32_WINNT 0x0500 -#include "../../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #include #pragma warning(push) diff --git a/src/plugins/lw/Export/LW_export_keys.cpp b/src/plugins/lw/Export/LW_export_keys.cpp index ee93a36c552..59b4da405cb 100644 --- a/src/plugins/lw/Export/LW_export_keys.cpp +++ b/src/plugins/lw/Export/LW_export_keys.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../../xrCore/FileSystem.h" -#include "../../../xrCore/FS.h" +#include "xrCore/FileSystem.h" +#include "xrCore/FS.h" #include "utils/LWO/envelope.h" #include "xrCore/Animation/Bone.hpp" #include "xrCore/Animation/Motion.hpp" diff --git a/src/plugins/lw/Export/LW_export_motion.cpp b/src/plugins/lw/Export/LW_export_motion.cpp index 7ee6e7064ce..4fe3654f6fc 100644 --- a/src/plugins/lw/Export/LW_export_motion.cpp +++ b/src/plugins/lw/Export/LW_export_motion.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../../../xrCore/FileSystem.h" -#include "../../../xrCore/FS.h" +#include "xrCore/FileSystem.h" +#include "xrCore/FS.h" #include "utils/LWO/envelope.h" #include "xrCore/Animation/Bone.hpp" #include "xrCore/Animation/Motion.hpp" diff --git a/src/plugins/lw/Export/LW_export_object.cpp b/src/plugins/lw/Export/LW_export_object.cpp index 6639bd80992..7d9277cd700 100644 --- a/src/plugins/lw/Export/LW_export_object.cpp +++ b/src/plugins/lw/Export/LW_export_object.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" -#include "../../../editors/ECore/Editor/editobject.h" -#include "../../../xrCore/FileSystem.h" -#include "../../../xrCore/FS.h" +#include "../editors/ECore/Editor/editobject.h" +#include "xrCore/FileSystem.h" +#include "xrCore/FS.h" #include "xrCore/Animation/Bone.hpp" #include "Globals.hpp" diff --git a/src/plugins/lw/Export/stdafx.h b/src/plugins/lw/Export/stdafx.h index cb02e70bd5c..19c1f8df0bb 100644 --- a/src/plugins/lw/Export/stdafx.h +++ b/src/plugins/lw/Export/stdafx.h @@ -7,7 +7,7 @@ #pragma once -#include "../../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #define ENGINE_API diff --git a/src/plugins/lw/Shader/stdafx.h b/src/plugins/lw/Shader/stdafx.h index 2a252dc41a0..037026a0556 100644 --- a/src/plugins/lw/Shader/stdafx.h +++ b/src/plugins/lw/Shader/stdafx.h @@ -7,7 +7,7 @@ #pragma once -#include "../../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #define ENGINE_API diff --git a/src/utils/CompressionTest/CompressionTest.cpp b/src/utils/CompressionTest/CompressionTest.cpp index 17bd6207005..7ec1412429b 100644 --- a/src/utils/CompressionTest/CompressionTest.cpp +++ b/src/utils/CompressionTest/CompressionTest.cpp @@ -1,12 +1,12 @@ #include #include #include - #include "../../xrcore/PPMd.h" - #include "../../xrcore/compression_ppmd_stream.h" + #include "xrCore/PPMd.h" + #include "xrCore/compression_ppmd_stream.h" #pragma warning( disable: 193 128 810 ) - #include "../xrcompress/lzo/lzo1x.h" - #include "../xrcompress/lzo/lzo1y.h" + #include "utils/xrCompress/lzo/lzo1x.h" + #include "utils/xrCompress/lzo/lzo1y.h" #pragma warning( default: 193 128 810 ) extern compression::ppmd::stream* trained_model; diff --git a/src/utils/ETools/ETools.h b/src/utils/ETools/ETools.h index 8171b8c83b2..30fd50def9a 100644 --- a/src/utils/ETools/ETools.h +++ b/src/utils/ETools/ETools.h @@ -7,7 +7,7 @@ #define ETOOLS_API __declspec( dllimport ) #endif -#include "../../xrCDB/xrCDB.h" +#include "xrCDB/xrCDB.h" class IKinematics; extern "C" { // fast functions diff --git a/src/utils/ETools/Intersect.cpp b/src/utils/ETools/Intersect.cpp index fc3be8d8a2e..d523e13301d 100644 --- a/src/utils/ETools/Intersect.cpp +++ b/src/utils/ETools/Intersect.cpp @@ -2,7 +2,7 @@ #include "etools.h" -#include "../../include/xrrender/kinematics.h" +#include "Include/xrRender/kinematics.h" #define ECORE_API #include "xrCore/Animation/Bone.hpp" diff --git a/src/utils/ETools/StdAfx.h b/src/utils/ETools/StdAfx.h index 4be8d210b38..a3b993398e0 100644 --- a/src/utils/ETools/StdAfx.h +++ b/src/utils/ETools/StdAfx.h @@ -11,7 +11,7 @@ #define ENGINE_API #define NO_XRC_STATS -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #pragma warning(push) #pragma warning(disable:4995) diff --git a/src/utils/ETools/object.h b/src/utils/ETools/object.h index 1a7ce8a3d22..13f29908266 100644 --- a/src/utils/ETools/object.h +++ b/src/utils/ETools/object.h @@ -59,7 +59,7 @@ struct MyTri #define MESHPT_APP_DEFINED MyPt mypt; -#include "../../xrcore/xrCore.h" +#include "xrCore/xrCore.h" #include "mesh.h" #include "MxQMetric.h" diff --git a/src/utils/ETools/xrXRC.h b/src/utils/ETools/xrXRC.h index abb43f20ec8..83bd88b31f5 100644 --- a/src/utils/ETools/xrXRC.h +++ b/src/utils/ETools/xrXRC.h @@ -6,7 +6,7 @@ #define AFX_XRXRC_H__9AA25268_621F_4FCA_BD75_AF2E9822B8E3__INCLUDED_ #pragma once -#include "../../xrCDB/xrCDB.h" +#include "xrCDB/xrCDB.h" class ENGINE_API xrXRC { diff --git a/src/utils/ctool/PPMTrain.cpp b/src/utils/ctool/PPMTrain.cpp index 263190d4712..4a6e56b02e5 100644 --- a/src/utils/ctool/PPMTrain.cpp +++ b/src/utils/ctool/PPMTrain.cpp @@ -10,7 +10,7 @@ #include #pragma hdrstop #include "PPMT_SA.hpp" -#include "../../xrcore/_types.h" +#include "xrCore/_types.h" const int MAX_O=8; const int UP_FREQ=5, INT_BITS=7, PERIOD_BITS=7, TOT_BITS=INT_BITS+PERIOD_BITS, diff --git a/src/utils/ctool/ctool.cpp b/src/utils/ctool/ctool.cpp index dadb258a2a3..a189d2cbc52 100644 --- a/src/utils/ctool/ctool.cpp +++ b/src/utils/ctool/ctool.cpp @@ -1,7 +1,7 @@ #include - #include "../../xrcore/_types.h" + #include "xrCore/_types.h" #undef FLT_MAX #undef FLT_MIN #include diff --git a/src/utils/mp_configs_verifyer/configs_common.h b/src/utils/mp_configs_verifyer/configs_common.h index 1767922aee7..475b429a7aa 100644 --- a/src/utils/mp_configs_verifyer/configs_common.h +++ b/src/utils/mp_configs_verifyer/configs_common.h @@ -1,7 +1,7 @@ #ifndef CONFIGS_COMMON_INCLUDED #define CONFIGS_COMMON_INCLUDED -#include "../../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" namespace mp_anticheat { diff --git a/src/utils/mp_configs_verifyer/mp_config_sections.h b/src/utils/mp_configs_verifyer/mp_config_sections.h index 85a93af9123..33e47438bbe 100644 --- a/src/utils/mp_configs_verifyer/mp_config_sections.h +++ b/src/utils/mp_configs_verifyer/mp_config_sections.h @@ -1,8 +1,8 @@ #ifndef MP_CONFIG_SECTIONS_INCLUDED #define MP_CONFIG_SECTIONS_INCLUDED -#include "../../xrCore/xrCore.h" -#include "../../xrCore/LocatorAPI.h" +#include "xrCore/xrCore.h" +#include "xrCore/LocatorAPI.h" //#include "anticheat_dumpable_object.h" class CGameObject; diff --git a/src/utils/mp_configs_verifyer/pch.h b/src/utils/mp_configs_verifyer/pch.h index 7f71b82eefe..2c47613fa1e 100644 --- a/src/utils/mp_configs_verifyer/pch.h +++ b/src/utils/mp_configs_verifyer/pch.h @@ -1,15 +1,15 @@ #ifndef PCH_H_INCLUDED #define PCH_H_INCLUDED -#include "../../xrCore/xrCore.h" -#include "../../xrCore/LocatorAPI.h" -#include "../../xrCore/ppmd_compressor.h" -#include "../../3rd party/crypto/crypto.h" +#include "xrCore/xrCore.h" +#include "xrCore/LocatorAPI.h" +#include "xrCore/ppmd_compressor.h" +#include "3rd party/crypto/crypto.h" #include #include -#include "../../xrServerEntities/object_broker.h" -#include "../../xrServerEntities/associative_vector.h" +#include "xrServerEntities/object_broker.h" +#include "xrServerEntities/associative_vector.h" #endif // #define PCH_H_INCLUDED \ No newline at end of file diff --git a/src/utils/mp_configs_verifyer/xr_dsa_verifyer.h b/src/utils/mp_configs_verifyer/xr_dsa_verifyer.h index 20675b34115..c440bbde2f6 100644 --- a/src/utils/mp_configs_verifyer/xr_dsa_verifyer.h +++ b/src/utils/mp_configs_verifyer/xr_dsa_verifyer.h @@ -1,7 +1,7 @@ #ifndef XR_DSA_VERIFYER_INCLUDED #define XR_DSA_VERIFYER_INCLUDED -#include "../../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" class xr_dsa_verifyer { diff --git a/src/utils/mp_screenshots_info/pch.h b/src/utils/mp_screenshots_info/pch.h index d8bf827b026..25169e7bb2b 100644 --- a/src/utils/mp_screenshots_info/pch.h +++ b/src/utils/mp_screenshots_info/pch.h @@ -1,13 +1,13 @@ #ifndef PCH_H_INCLUDED #define PCH_H_INCLUDED -#include "../../xrCore/xrCore.h" -#include "../../xrCore/LocatorAPI.h" -#include "../../3rd party/crypto/crypto.h" +#include "xrCore/xrCore.h" +#include "xrCore/LocatorAPI.h" +#include "3rd party/crypto/crypto.h" #include #include -#include "../../xrServerEntities/object_broker.h" -#include "../../xrServerEntities/associative_vector.h" +#include "xrServerEntities/object_broker.h" +#include "xrServerEntities/associative_vector.h" #endif // #define PCH_H_INCLUDED \ No newline at end of file diff --git a/src/utils/mp_screenshots_info/xr_dsa_signer.h b/src/utils/mp_screenshots_info/xr_dsa_signer.h index d3106c765f1..40339cc5e6a 100644 --- a/src/utils/mp_screenshots_info/xr_dsa_signer.h +++ b/src/utils/mp_screenshots_info/xr_dsa_signer.h @@ -1,7 +1,7 @@ #ifndef XR_DSA_SIGNER_INCLUDED #define XR_DSA_SIGNER_INCLUDED -#include "../../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" typedef fastdelegate::FastDelegate1< long > sha_process_yielder; diff --git a/src/utils/xrAI/StdAfx.h b/src/utils/xrAI/StdAfx.h index 356d4e284dc..8b48514568b 100644 --- a/src/utils/xrAI/StdAfx.h +++ b/src/utils/xrAI/StdAfx.h @@ -8,7 +8,7 @@ #pragma once -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #pragma warning(disable:4995) #include @@ -18,9 +18,9 @@ #define ENGINE_API #define ECORE_API #define XR_EPROPS_API -#include "../../xrcore/clsid.h" +#include "xrCore/clsid.h" #include "defines.h" -#include "../../xrcdb/xrCDB.h" +#include "xrCDB/xrCDB.h" #include "_d3d_extensions.h" #include @@ -37,7 +37,7 @@ extern CThreadManager::ReportStatusFunc ProxyStatus; extern CThreadManager::ReportProgressFunc ProxyProgress; #ifdef AI_COMPILER -# include "../../xrServerEntities/smart_cast.h" +# include "xrServerEntities/smart_cast.h" #endif // TODO: reference additional headers your program requires here diff --git a/src/utils/xrAI/compiler.h b/src/utils/xrAI/compiler.h index 01ba81ec579..042662b03d0 100644 --- a/src/utils/xrAI/compiler.h +++ b/src/utils/xrAI/compiler.h @@ -2,11 +2,11 @@ #pragma comment(lib,"FreeImage.lib") -#include "../../xrcdb/xrCDB.h" -#include "../../xrEngine/xrLevel.h" +#include "xrCDB/xrCDB.h" +#include "xrEngine/xrLevel.h" #include "AIMapExport.h" #include "utils/Shader_xrLC.h" -#include "../../editors/LevelEditor/Engine/communicate.h" +#include "editors/LevelEditor/Engine/communicate.h" #include "Etextureparams.h" // base patch used all the time up to merging diff --git a/src/utils/xrAI/game_graph_builder.h b/src/utils/xrAI/game_graph_builder.h index 91232100d3a..8df334738c2 100644 --- a/src/utils/xrAI/game_graph_builder.h +++ b/src/utils/xrAI/game_graph_builder.h @@ -8,7 +8,7 @@ #pragma once -#include "../../xrEngine/xrLevel.h" +#include "xrEngine/xrLevel.h" #include "alife_space.h" class CLevelGraph; diff --git a/src/utils/xrAI/game_level_cross_table.h b/src/utils/xrAI/game_level_cross_table.h index 6a67959613f..83515fc2c3c 100644 --- a/src/utils/xrAI/game_level_cross_table.h +++ b/src/utils/xrAI/game_level_cross_table.h @@ -9,9 +9,9 @@ #pragma once #ifdef AI_COMPILER -# include "../../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #else // AI_COMPILER -# include "../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #endif // AI_COMPILER #include "alife_space.h" diff --git a/src/utils/xrAI/guid_generator.h b/src/utils/xrAI/guid_generator.h index 0c9978ab452..4f9d397d76e 100644 --- a/src/utils/xrAI/guid_generator.h +++ b/src/utils/xrAI/guid_generator.h @@ -10,7 +10,7 @@ #define guid_generatorH #pragma once -#include "../../xrEngine/xrLevel.h" +#include "xrEngine/xrLevel.h" ENGINE_API extern xrGUID generate_guid(); ENGINE_API extern LPCSTR generate_guid(const xrGUID &guid, LPSTR buffer, const u32 &buffer_size); diff --git a/src/utils/xrAI/level_graph.h b/src/utils/xrAI/level_graph.h index c7384949af3..887fda9e147 100644 --- a/src/utils/xrAI/level_graph.h +++ b/src/utils/xrAI/level_graph.h @@ -9,9 +9,9 @@ #pragma once #ifndef AI_COMPILER -# include "../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #else -# include "../../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #endif #include "alife_space.h" diff --git a/src/utils/xrAI/xrAI.cpp b/src/utils/xrAI/xrAI.cpp index 8bd2fa704cc..3a3c38e1414 100644 --- a/src/utils/xrAI/xrAI.cpp +++ b/src/utils/xrAI/xrAI.cpp @@ -2,7 +2,7 @@ // #include "stdafx.h" -#include "../../xrcore/xr_ini.h" +#include "xrCore/xr_ini.h" #include "process.h" #include "xrAI.h" @@ -57,131 +57,131 @@ CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast( extern LPCSTR LEVEL_GRAPH_NAME; -extern void xrCompiler (LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR out_name); -extern void test_smooth_path (LPCSTR name); -extern void test_hierarchy (LPCSTR name); -extern void xrConvertMaps (); -extern void test_goap (); -extern void smart_cover (LPCSTR name); -extern void verify_level_graph (LPCSTR name, bool verbose); -//extern void connectivity_test (LPCSTR); -extern void compare_graphs (LPCSTR level_name); -extern void test_levels (); +extern void xrCompiler (LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR out_name); +extern void test_smooth_path (LPCSTR name); +extern void test_hierarchy (LPCSTR name); +extern void xrConvertMaps (); +extern void test_goap (); +extern void smart_cover (LPCSTR name); +extern void verify_level_graph (LPCSTR name, bool verbose); +//extern void connectivity_test (LPCSTR); +extern void compare_graphs (LPCSTR level_name); +extern void test_levels (); static const char* h_str = - "The following keys are supported / required:\n" - "-? or -h == this help\n" - "-f == compile level in gamedata/levels//\n" - "-o == modify build options\n" - "-s == build game spawn data\n" - "\n" - "NOTE: The last key is required for any functionality\n"; + "The following keys are supported / required:\n" + "-? or -h == this help\n" + "-f == compile level in gamedata/levels//\n" + "-o == modify build options\n" + "-s == build game spawn data\n" + "\n" + "NOTE: The last key is required for any functionality\n"; void Help() -{ MessageBox(0,h_str,"Command line options",MB_OK|MB_ICONINFORMATION); } +{ MessageBox(0,h_str,"Command line options",MB_OK|MB_ICONINFORMATION); } string_path INI_FILE; extern LPCSTR GAME_CONFIG; -extern void clear_temp_folder (); +extern void clear_temp_folder (); -void execute (LPSTR cmd) +void execute (LPSTR cmd) { - // Load project - string4096 name; - name[0]=0; - if (strstr(cmd,"-f")) - sscanf (strstr(cmd,"-f")+2,"%s",name); - else - if (strstr(cmd,"-s")) - sscanf (strstr(cmd,"-s")+2,"%s",name); - else - if (strstr(cmd,"-t")) - sscanf (strstr(cmd,"-t")+2,"%s",name); - else - if (strstr(cmd,"-verify")) - sscanf (strstr(cmd,"-verify")+xr_strlen("-verify"),"%s",name); - - if (xr_strlen(name)) - xr_strcat (name,"\\"); - - string_path prjName; - prjName [0] = 0; - bool can_use_name = false; - if (xr_strlen(name) < sizeof(string_path)) { - can_use_name = true; - FS.update_path (prjName,"$game_levels$",name); - } - - FS.update_path (INI_FILE,"$game_config$",GAME_CONFIG); - - if (strstr(cmd,"-f")) { - R_ASSERT3 (can_use_name,"Too big level name",name); - - char *output = strstr(cmd,"-out"); - string256 temp0; - if (output) { - output += xr_strlen("-out"); - sscanf (output,"%s",temp0); - _TrimLeft (temp0); - output = temp0; - } - else - output = (pstr)LEVEL_GRAPH_NAME; - - xrCompiler (prjName,!!strstr(cmd,"-draft"),!!strstr(cmd,"-pure_covers"),output); - } - else { - if (strstr(cmd,"-s")) { - if (xr_strlen(name)) - name[xr_strlen(name) - 1] = 0; - char *output = strstr(cmd,"-out"); - string256 temp0, temp1; - if (output) { - output += xr_strlen("-out"); - sscanf (output,"%s",temp0); - _TrimLeft (temp0); - output = temp0; - } - char *start = strstr(cmd,"-start"); - if (start) { - start += xr_strlen("-start"); - sscanf (start,"%s",temp1); - _TrimLeft (temp1); - start = temp1; - } - char *no_separator_check = strstr(cmd,"-no_separator_check"); - clear_temp_folder (); - CGameSpawnConstructor(name,output,start,!!no_separator_check); - } - else - if (strstr(cmd,"-verify")) { - R_ASSERT3 (can_use_name,"Too big level name",name); - verify_level_graph (prjName,!strstr(cmd,"-noverbose")); - } - } + // Load project + string4096 name; + name[0]=0; + if (strstr(cmd,"-f")) + sscanf (strstr(cmd,"-f")+2,"%s",name); + else + if (strstr(cmd,"-s")) + sscanf (strstr(cmd,"-s")+2,"%s",name); + else + if (strstr(cmd,"-t")) + sscanf (strstr(cmd,"-t")+2,"%s",name); + else + if (strstr(cmd,"-verify")) + sscanf (strstr(cmd,"-verify")+xr_strlen("-verify"),"%s",name); + + if (xr_strlen(name)) + xr_strcat (name,"\\"); + + string_path prjName; + prjName [0] = 0; + bool can_use_name = false; + if (xr_strlen(name) < sizeof(string_path)) { + can_use_name = true; + FS.update_path (prjName,"$game_levels$",name); + } + + FS.update_path (INI_FILE,"$game_config$",GAME_CONFIG); + + if (strstr(cmd,"-f")) { + R_ASSERT3 (can_use_name,"Too big level name",name); + + char *output = strstr(cmd,"-out"); + string256 temp0; + if (output) { + output += xr_strlen("-out"); + sscanf (output,"%s",temp0); + _TrimLeft (temp0); + output = temp0; + } + else + output = (pstr)LEVEL_GRAPH_NAME; + + xrCompiler (prjName,!!strstr(cmd,"-draft"),!!strstr(cmd,"-pure_covers"),output); + } + else { + if (strstr(cmd,"-s")) { + if (xr_strlen(name)) + name[xr_strlen(name) - 1] = 0; + char *output = strstr(cmd,"-out"); + string256 temp0, temp1; + if (output) { + output += xr_strlen("-out"); + sscanf (output,"%s",temp0); + _TrimLeft (temp0); + output = temp0; + } + char *start = strstr(cmd,"-start"); + if (start) { + start += xr_strlen("-start"); + sscanf (start,"%s",temp1); + _TrimLeft (temp1); + start = temp1; + } + char *no_separator_check = strstr(cmd,"-no_separator_check"); + clear_temp_folder (); + CGameSpawnConstructor(name,output,start,!!no_separator_check); + } + else + if (strstr(cmd,"-verify")) { + R_ASSERT3 (can_use_name,"Too big level name",name); + verify_level_graph (prjName,!strstr(cmd,"-noverbose")); + } + } } void Startup(LPSTR lpCmdLine) { - string4096 cmd; - BOOL bModifyOptions = FALSE; - - xr_strcpy(cmd,lpCmdLine); - strlwr(cmd); - if (strstr(cmd,"-?") || strstr(cmd,"-h")) { Help(); return; } - if ((strstr(cmd,"-f")==0) && (strstr(cmd,"-g")==0) && (strstr(cmd,"-m")==0) && (strstr(cmd,"-s")==0) && (strstr(cmd,"-t")==0) && (strstr(cmd,"-c")==0) && (strstr(cmd,"-verify")==0) && (strstr(cmd,"-patch")==0)) { Help(); return; } - if (strstr(cmd,"-o")) bModifyOptions = TRUE; - Logger.Initialize("xrAI"); - u32 dwStartupTime = timeGetTime(); - execute(cmd); - // Show statistic - char stats[256]; - u32 dwEndTime = timeGetTime(); - xr_sprintf(stats,"Time elapsed: %s",make_time((dwEndTime-dwStartupTime)/1000).c_str()); + string4096 cmd; + BOOL bModifyOptions = FALSE; + + xr_strcpy(cmd,lpCmdLine); + strlwr(cmd); + if (strstr(cmd,"-?") || strstr(cmd,"-h")) { Help(); return; } + if ((strstr(cmd,"-f")==0) && (strstr(cmd,"-g")==0) && (strstr(cmd,"-m")==0) && (strstr(cmd,"-s")==0) && (strstr(cmd,"-t")==0) && (strstr(cmd,"-c")==0) && (strstr(cmd,"-verify")==0) && (strstr(cmd,"-patch")==0)) { Help(); return; } + if (strstr(cmd,"-o")) bModifyOptions = TRUE; + Logger.Initialize("xrAI"); + u32 dwStartupTime = timeGetTime(); + execute(cmd); + // Show statistic + char stats[256]; + u32 dwEndTime = timeGetTime(); + xr_sprintf(stats,"Time elapsed: %s",make_time((dwEndTime-dwStartupTime)/1000).c_str()); Logger.Success(stats); - FlushLog(); + FlushLog(); Logger.Destroy(); } @@ -189,36 +189,36 @@ void Startup(LPSTR lpCmdLine) #include "quadtree.h" -Factory_Create *create_entity = 0; -Factory_Destroy *destroy_entity = 0; +Factory_Create *create_entity = 0; +Factory_Destroy *destroy_entity = 0; -void buffer_vector_test (); +void buffer_vector_test (); int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { - Debug._initialize (false); - Core._initialize ("xrai",0); + Debug._initialize (false); + Core._initialize ("xrai",0); - buffer_vector_test (); + buffer_vector_test (); - HMODULE hFactory; - LPCSTR g_name = "xrSE_Factory.dll"; - Log ("Loading DLL:",g_name); - hFactory = LoadLibrary (g_name); - if (0==hFactory) R_CHK (GetLastError()); - R_ASSERT2 (hFactory,"Factory DLL raised exception during loading or there is no factory DLL at all"); + HMODULE hFactory; + LPCSTR g_name = "xrSE_Factory.dll"; + Log ("Loading DLL:",g_name); + hFactory = LoadLibrary (g_name); + if (0==hFactory) R_CHK (GetLastError()); + R_ASSERT2 (hFactory,"Factory DLL raised exception during loading or there is no factory DLL at all"); - create_entity = (Factory_Create*) GetProcAddress(hFactory,"_create_entity@4"); R_ASSERT(create_entity); - destroy_entity = (Factory_Destroy*) GetProcAddress(hFactory,"_destroy_entity@4"); R_ASSERT(destroy_entity); + create_entity = (Factory_Create*) GetProcAddress(hFactory,"_create_entity@4"); R_ASSERT(create_entity); + destroy_entity = (Factory_Destroy*) GetProcAddress(hFactory,"_destroy_entity@4"); R_ASSERT(destroy_entity); - Startup (lpCmdLine); + Startup (lpCmdLine); - FreeLibrary (hFactory); + FreeLibrary (hFactory); - Core._destroy (); + Core._destroy (); - return (0); + return (0); } \ No newline at end of file diff --git a/src/utils/xrAI/xrCrossTable.h b/src/utils/xrAI/xrCrossTable.h index fe7fdd58624..0efd9eac3e9 100644 --- a/src/utils/xrAI/xrCrossTable.h +++ b/src/utils/xrAI/xrCrossTable.h @@ -8,7 +8,7 @@ #pragma once -#include "../../xrEngine/xrLevel.h" +#include "xrEngine/xrLevel.h" #include "alife_space.h" #include "game_level_cross_table.h" #include "game_graph.h" diff --git a/src/utils/xrAI/xr_graph_merge.cpp b/src/utils/xrAI/xr_graph_merge.cpp index dadb19dad6d..0b05c68d2da 100644 --- a/src/utils/xrAI/xr_graph_merge.cpp +++ b/src/utils/xrAI/xr_graph_merge.cpp @@ -7,8 +7,8 @@ //////////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "../../xrcore/xr_ini.h" -#include "../../xrEngine/xrLevel.h" +#include "xrCore/xr_ini.h" +#include "xrEngine/xrLevel.h" #include "xrAI.h" #include "xrServer_Objects_ALife_All.h" #include "factory_api.h" diff --git a/src/utils/xrCompress/StdAfx.h b/src/utils/xrCompress/StdAfx.h index 29945de5ab2..65da5d884b2 100644 --- a/src/utils/xrCompress/StdAfx.h +++ b/src/utils/xrCompress/StdAfx.h @@ -2,7 +2,7 @@ //. #define MOD_COMPRESS -#include "../../xrcore/xrCore.h" +#include "xrCore/xrCore.h" #include "lzo\lzo1x.h" #include diff --git a/src/utils/xrCompress/xrCompress.cpp b/src/utils/xrCompress/xrCompress.cpp index 0e3448990d7..fed9bf83804 100644 --- a/src/utils/xrCompress/xrCompress.cpp +++ b/src/utils/xrCompress/xrCompress.cpp @@ -7,7 +7,7 @@ //# define TRIVIAL_ENCRYPTOR_ENCODER //# define TRIVIAL_ENCRYPTOR_DECODER -//# include "../../xrEngine/trivial_encryptor.h" +//# include "xrEngine/trivial_encryptor.h" //# undef TRIVIAL_ENCRYPTOR_ENCODER //# undef TRIVIAL_ENCRYPTOR_DECODER diff --git a/src/utils/xrDO_Light/StdAfx.h b/src/utils/xrDO_Light/StdAfx.h index 86279265a71..94e471d5e37 100644 --- a/src/utils/xrDO_Light/StdAfx.h +++ b/src/utils/xrDO_Light/StdAfx.h @@ -8,7 +8,7 @@ #pragma once -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #pragma warning(disable:4995) #include @@ -18,9 +18,9 @@ #define ENGINE_API #define ECORE_API #define XR_EPROPS_API -#include "../../xrCore/clsid.h" +#include "xrCore/clsid.h" #include "defines.h" -#include "../../xrcdb/xrCDB.h" +#include "xrCDB/xrCDB.h" #include "_d3d_extensions.h" #include diff --git a/src/utils/xrDO_Light/xrDO_Light.cpp b/src/utils/xrDO_Light/xrDO_Light.cpp index 14562f5c466..c0d6f8114b8 100644 --- a/src/utils/xrDO_Light/xrDO_Light.cpp +++ b/src/utils/xrDO_Light/xrDO_Light.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "process.h" -#include "../xrlc_light/xrlc_light.h" +#include "utils/xrLC_Light/xrlc_light.h" #include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp" #include "utils/xrLCUtil/cdecl_cast.hpp" #include "utils/xrLCUtil/xrLCUtil.hpp" @@ -42,48 +42,48 @@ CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast( ); static const char* h_str = - "The following keys are supported / required:\n" - "-? or -h == this help\n" - "-f == compile level in gamedata\\levels\\\\\n" - "-o == modify build options\n" - "\n" - "NOTE: The last key is required for any functionality\n"; + "The following keys are supported / required:\n" + "-? or -h == this help\n" + "-f == compile level in gamedata\\levels\\\\\n" + "-o == modify build options\n" + "\n" + "NOTE: The last key is required for any functionality\n"; void Help() -{ MessageBox(0,h_str,"Command line options",MB_OK|MB_ICONINFORMATION); } +{ MessageBox(0,h_str,"Command line options",MB_OK|MB_ICONINFORMATION); } void Startup(LPSTR lpCmdLine) { - char cmd[512]; -// BOOL bModifyOptions = FALSE; - bool bNet = false; - xr_strcpy(cmd,lpCmdLine); - strlwr(cmd); - if (strstr(cmd,"-?") || strstr(cmd,"-h")) { Help(); return; } - if (strstr(cmd,"-f")==0) { Help(); return; } -// if (strstr(cmd,"-o")) bModifyOptions = TRUE; - if ( strstr(cmd,"-net") ) - bNet = true; - // Load project + char cmd[512]; +// BOOL bModifyOptions = FALSE; + bool bNet = false; + xr_strcpy(cmd,lpCmdLine); + strlwr(cmd); + if (strstr(cmd,"-?") || strstr(cmd,"-h")) { Help(); return; } + if (strstr(cmd,"-f")==0) { Help(); return; } +// if (strstr(cmd,"-o")) bModifyOptions = TRUE; + if ( strstr(cmd,"-net") ) + bNet = true; + // Load project char name[256]; *name = 0; sscanf(strstr(cmd,"-f")+2,"%s",name); - string256 temp; - xr_sprintf (temp, "%s - Detail Compiler", name); + string256 temp; + xr_sprintf (temp, "%s - Detail Compiler", name); Logger.Initialize(temp); - //FS.update_path (name,"$game_levels$",name); - FS.get_path ("$level$")->_set (name); + //FS.update_path (name,"$game_levels$",name); + FS.get_path ("$level$")->_set (name); - CTimer dwStartupTime; dwStartupTime.Start(); + CTimer dwStartupTime; dwStartupTime.Start(); - xrCompileDO (bNet); + xrCompileDO (bNet); - // Show statistic - char stats[256]; - xr_sprintf (stats,"Time elapsed: %s",make_time((dwStartupTime.GetElapsed_ms())/1000).c_str()); + // Show statistic + char stats[256]; + xr_sprintf (stats,"Time elapsed: %s",make_time((dwStartupTime.GetElapsed_ms())/1000).c_str()); - if (!strstr(cmd,"-silent")) + if (!strstr(cmd,"-silent")) Logger.Success(stats); Logger.Destroy(); } @@ -93,10 +93,10 @@ int APIENTRY WinMain(HINSTANCE hInstance, LPSTR lpCmdLine, int nCmdShow) { - // Initialize debugging - Debug._initialize (false); - Core._initialize ("xrDO"); - Startup (lpCmdLine); - - return 0; + // Initialize debugging + Debug._initialize (false); + Core._initialize ("xrDO"); + Startup (lpCmdLine); + + return 0; } diff --git a/src/utils/xrDXT/StdAfx.h b/src/utils/xrDXT/StdAfx.h index 68aac5086c6..d97c72de409 100644 --- a/src/utils/xrDXT/StdAfx.h +++ b/src/utils/xrDXT/StdAfx.h @@ -9,7 +9,7 @@ #pragma once -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #include #include #include diff --git a/src/utils/xrLC/Build.cpp b/src/utils/xrLC/Build.cpp index 0f02e42dc7b..f3f7ca831a8 100644 --- a/src/utils/xrLC/Build.cpp +++ b/src/utils/xrLC/Build.cpp @@ -1,21 +1,12 @@ -// Build.cpp: implementation of the CBuild class. -// -////////////////////////////////////////////////////////////////////// - #include "stdafx.h" - #include "build.h" +#include "utils/xrLC_Light/xrMU_Model.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" +#include "utils/xrLC_Light/mu_model_light.h" +#include "utils/xrLC_Light/net_cl_data_prepare.h" +#include "utils/xrLC_Light/serialize.h" -#include "../xrLC_Light/xrMU_Model.h" - - - -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrface.h" -#include "../xrLC_Light/mu_model_light.h" -#include "../xrLC_Light/net_cl_data_prepare.h" -#include "../xrLC_Light/serialize.h" -//#include "../xrLC_Light/lcnet_task_manager.h" void calc_ogf ( xrMU_Model & mu_model ); void export_geometry ( xrMU_Model & mu_model ); @@ -39,9 +30,6 @@ void CBuild::CheckBeforeSave( u32 stage ) R_ASSERT( b_g_XSplit_empty ); bool b_IsOGFContainersEmpty = IsOGFContainersEmpty(); R_ASSERT( b_IsOGFContainersEmpty ); - - - } void CBuild::TempSave( u32 stage ) diff --git a/src/utils/xrLC/Build.h b/src/utils/xrLC/Build.h index 91a975ca392..50e3b51c4ba 100644 --- a/src/utils/xrLC/Build.h +++ b/src/utils/xrLC/Build.h @@ -1,27 +1,12 @@ -// Build.h: interface for the CBuild class. -// -////////////////////////////////////////////////////////////////////// - -#if !defined(AFX_BUILD_H__C7D43EBA_1C15_4FF4_A3ED_E89F6D759F58__INCLUDED_) -#define AFX_BUILD_H__C7D43EBA_1C15_4FF4_A3ED_E89F6D759F58__INCLUDED_ #pragma once - -//#include "../../editors/LevelEditor/Engine/communicate.h" - -#include "../../xrcore/fs.h" -//.#include "../../xrEngine/xrLevel.h" - -#include "../shader_xrlc.h" -//#include "xrMU_Model.h" - -struct STextureParams; +#include "xrCore/FS.h" +#include "utils/Shader_xrLC.h" +struct STextureParams; #pragma comment(lib,"dxt.lib") extern "C" bool __declspec(dllimport) __stdcall DXTCompress(LPCSTR out_name, u8* raw_data, u8* normal_map, u32 w, u32 h, u32 pitch, STextureParams* fmt, u32 depth); -//#include "../xrLC_Light/xrLC_GlobalData.h" -//#include "../xrLC_Light/xrface.h" -#include "../xrLC_Light/b_build_texture.h" -#include "../xrLC_Light/xrfacedefs.h" +#include "utils/xrLC_Light/b_build_texture.h" +#include "utils/xrLC_Light/xrfacedefs.h" class xrLC_GlobalData; class xrMU_Model; @@ -30,8 +15,6 @@ extern "C" XRLC_LIGHT_API xrLC_GlobalData* lc_global_data(); ////////////////////////////////////////////////////////////////////////// // tesselator callbacks - - typedef int tesscb_estimator ( const Face* F ); // -1 = none, 0,1,2 = edge-number typedef void tesscb_face (Face* F); // new face typedef void tesscb_vertex (Vertex* V); // new vertex @@ -123,7 +106,5 @@ class CBuild ~CBuild (); }; -extern CBuild* pBuild; ; -extern vec2Face g_XSplit ; - -#endif // !defined(AFX_BUILD_H__C7D43EBA_1C15_4FF4_A3ED_E89F6D759F58__INCLUDED_) +extern CBuild* pBuild;; +extern vec2Face g_XSplit; diff --git a/src/utils/xrLC/Build_Load.cpp b/src/utils/xrLC/Build_Load.cpp index 1ef0610b446..7e3f47d61a9 100644 --- a/src/utils/xrLC/Build_Load.cpp +++ b/src/utils/xrLC/Build_Load.cpp @@ -5,12 +5,12 @@ #include "build.h" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" -#include "../xrLC_Light/xrMU_Model.h" -#include "../xrLC_Light/xrMU_Model_Reference.h" +#include "utils/xrLC_Light/xrMU_Model.h" +#include "utils/xrLC_Light/xrMU_Model_Reference.h" extern u32 version; diff --git a/src/utils/xrLC/MeshMenderLayerOGF.h b/src/utils/xrLC/MeshMenderLayerOGF.h index 5bfd1fbd162..d80489aaab0 100644 --- a/src/utils/xrLC/MeshMenderLayerOGF.h +++ b/src/utils/xrLC/MeshMenderLayerOGF.h @@ -1,11 +1,11 @@ #ifndef _MESH_MENDER_LAYER_OGF_H_ #define _MESH_MENDER_LAYER_OGF_H_ -#include "../../common/NvMender2003/nvMeshMender.h" -#include "../../common/NvMender2003/mender_input_output.h" -#include "../../common/NvMender2003/remove_isolated_verts.h" +#include "common/NvMender2003/nvMeshMender.h" +#include "common/NvMender2003/mender_input_output.h" +#include "common/NvMender2003/remove_isolated_verts.h" -#include "OGF_Face.h" +#include "OGF_Face.h" IC void set_vertex( MeshMender::Vertex &out_vertex, const OGF_Vertex& in_vertex ) { diff --git a/src/utils/xrLC/MeshMenderLayerOrdinaryStatic.h b/src/utils/xrLC/MeshMenderLayerOrdinaryStatic.h index ec9527b29e4..3bab79d5b15 100644 --- a/src/utils/xrLC/MeshMenderLayerOrdinaryStatic.h +++ b/src/utils/xrLC/MeshMenderLayerOrdinaryStatic.h @@ -1,10 +1,10 @@ #ifndef _MESH_MENDER_LAYER_ORDINARY_STATIC_H_ #define _MESH_MENDER_LAYER_ORDINARY_STATIC_H_ -#include "../../common/NvMender2003/nvMeshMender.h" -#include "../../common/NvMender2003/mender_input_output.h" +#include "common/NvMender2003/nvMeshMender.h" +#include "common/NvMender2003/mender_input_output.h" -#include "../xrlc_light/xrFace.h" +#include "utils/xrLC_Light/xrFace.h" IC void set_vertex( MeshMender::Vertex &out_vertex, const Vertex& in_veretex, const Fvector2 Ftc ) { diff --git a/src/utils/xrLC/OGF_Face.cpp b/src/utils/xrLC/OGF_Face.cpp index ac6a946f2a9..720ed9de532 100644 --- a/src/utils/xrLC/OGF_Face.cpp +++ b/src/utils/xrLC/OGF_Face.cpp @@ -2,7 +2,7 @@ #include "build.h" #include "ogf_face.h" //#include "std_classes.h" -#include "../../xrcore/fs.h" +#include "xrCore/fs.h" #include "xrCore/FMesh.hpp" #include "xrOcclusion.h" diff --git a/src/utils/xrLC/OGF_Face.h b/src/utils/xrLC/OGF_Face.h index 5e43da6acd5..f38bb465d5f 100644 --- a/src/utils/xrLC/OGF_Face.h +++ b/src/utils/xrLC/OGF_Face.h @@ -8,9 +8,9 @@ #include "utils/ETools/PropSlimTools.h" #include "vbm.h" -#include "../xrlc_light/xruvpoint.h" -#include "../xrlc_light/base_basis.h" -#include "../xrlc_light/base_color.h" +#include "utils/xrLC_Light/xruvpoint.h" +#include "utils/xrLC_Light/base_basis.h" +#include "utils/xrLC_Light/base_color.h" struct OGF_Texture { diff --git a/src/utils/xrLC/OGF_Face_Save.cpp b/src/utils/xrLC/OGF_Face_Save.cpp index f309358c3af..f0321397698 100644 --- a/src/utils/xrLC/OGF_Face_Save.cpp +++ b/src/utils/xrLC/OGF_Face_Save.cpp @@ -2,7 +2,7 @@ #include "build.h" #include "ogf_face.h" //#include "std_classes.h" -#include "../../xrcore/fs.h" +#include "xrCore/fs.h" #include "xrCore/FMesh.hpp" using namespace std; diff --git a/src/utils/xrLC/StdAfx.h b/src/utils/xrLC/StdAfx.h index 5fc77456a42..8d3a947c795 100644 --- a/src/utils/xrLC/StdAfx.h +++ b/src/utils/xrLC/StdAfx.h @@ -1,23 +1,12 @@ -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#if !defined(AFX_STDAFX_H__81632403_DFD8_4A42_A4D3_0AFDD8EA0D25__INCLUDED_) -#define AFX_STDAFX_H__81632403_DFD8_4A42_A4D3_0AFDD8EA0D25__INCLUDED_ - #pragma once - -//#include "../../xrCore/xrCore.h" - -#include "../xrLC_Light/xrLC_Light.h" +#include "utils/xrLC_Light/xrLC_Light.h" #define ENGINE_API // fake, to enable sharing with engine //comment - ne figa oni ne sharyatsya #define ECORE_API // fake, to enable sharing with editors #define XR_EPROPS_API -#include "../../xrcore/clsid.h" +#include "xrCore/clsid.h" #include "defines.h" #include "utils/xrLCUtil/ILevelCompilerLogger.hpp" #include "utils/xrLCUtil/xrThread.hpp" @@ -28,15 +17,4 @@ extern CThread::LogFunc ProxyMsg; extern CThreadManager::ReportStatusFunc ProxyStatus; extern CThreadManager::ReportProgressFunc ProxyProgress; -//#include "_d3d_extensions.h" -//#include "../../editors/LevelEditor/Engine/communicate.h" - - #include "b_globals.h" - -// TODO: reference additional headers your program requires here - -//{{AFX_INSERT_LOCATION}} -// Microsoft Visual C++ will insert additional declarations immediately before the previous line. - -#endif // !defined(AFX_STDAFX_H__81632403_DFD8_4A42_A4D3_0AFDD8EA0D25__INCLUDED_) diff --git a/src/utils/xrLC/b_globals.h b/src/utils/xrLC/b_globals.h index d89e3ab8a5d..13155391592 100644 --- a/src/utils/xrLC/b_globals.h +++ b/src/utils/xrLC/b_globals.h @@ -14,8 +14,8 @@ BOOL exact_normalize (Fvector3& a); BOOL exact_normalize (float* a); -//#include "../xrLC_Light/xrFace.h" -//#include "../xrLC_Light/xrDeflector.h" +//#include "utils/xrLC_Light/xrFace.h" +//#include "utils/xrLC_Light/xrDeflector.h" //#include "vbm.h" //#include "OGF_Face.h" diff --git a/src/utils/xrLC/net.cpp b/src/utils/xrLC/net.cpp index ac6c05d5fb0..11f28bf0188 100644 --- a/src/utils/xrLC/net.cpp +++ b/src/utils/xrLC/net.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" -#include "../xrLC_Light/net_task_manager.h" +#include "utils/xrLC_Light/net_task_manager.h" -#include "../xrLC_Light/lcnet_task_manager.h" +#include "utils/xrLC_Light/lcnet_task_manager.h" -#include "../xrLC_Light/lcnet_execution_tasks_add.h" -#include "../xrLC_Light/net_exec_pool.h" +#include "utils/xrLC_Light/lcnet_execution_tasks_add.h" +#include "utils/xrLC_Light/net_exec_pool.h" void net_light () { diff --git a/src/utils/xrLC/std_classes.h b/src/utils/xrLC/std_classes.h index 193de0175f7..8c2a46122cf 100644 --- a/src/utils/xrLC/std_classes.h +++ b/src/utils/xrLC/std_classes.h @@ -1,7 +1,7 @@ #ifndef _STD_CLSID_ #define _STD_CLSID_ -#include "../../xrcore/clsid.h" +#include "xrCore/clsid.h" //***** Standart extension classes #define CLSID_HUDMANAGER MK_CLSID('H','U','D','_','M','N','G','R') diff --git a/src/utils/xrLC/vbm.h b/src/utils/xrLC/vbm.h index 30441129fa4..41a46012361 100644 --- a/src/utils/xrLC/vbm.h +++ b/src/utils/xrLC/vbm.h @@ -1,7 +1,7 @@ #pragma once #include "xrCore/FMesh.hpp" -#include "../../xrcore/fs.h" +#include "xrCore/fs.h" static const u32 c_VB_maxSize = 4096*1024; // bytes // Vertex containers diff --git a/src/utils/xrLC/xrBuildCForm.cpp b/src/utils/xrLC/xrBuildCForm.cpp index a8809431cb3..a7e3cf81895 100644 --- a/src/utils/xrLC/xrBuildCForm.cpp +++ b/src/utils/xrLC/xrBuildCForm.cpp @@ -1,14 +1,14 @@ #include "stdafx.h" //#include "cl_collector.h" #include "build.h" -#include "../xrLC_Light/xrMU_Model.h" -#include "../xrLC_Light/xrMU_Model_Reference.h" +#include "utils/xrLC_Light/xrMU_Model.h" +#include "utils/xrLC_Light/xrMU_Model_Reference.h" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" -#include "../../xrcore/fs.h" -#include "../../xrcdb/xrcdb.h" +#include "xrCore/fs.h" +#include "xrCDB/xrCDB.h" int GetVertexIndex(Vertex *F) { diff --git a/src/utils/xrLC/xrBuildRapidModel.cpp b/src/utils/xrLC/xrBuildRapidModel.cpp index 706cd1fdd97..421019afa74 100644 --- a/src/utils/xrLC/xrBuildRapidModel.cpp +++ b/src/utils/xrLC/xrBuildRapidModel.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" //#include "cl_collector.h" #include "build.h" -#include "../xrLC_Light/xrMU_Model.h" -#include "../xrLC_Light/xrMU_Model_Reference.h" +#include "utils/xrLC_Light/xrMU_Model.h" +#include "utils/xrLC_Light/xrMU_Model_Reference.h" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../../xrcdb/xrcdb.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "xrCDB/xrCDB.h" +#include "utils/xrLC_Light/xrface.h" //.#include "communicate.h" diff --git a/src/utils/xrLC/xrCalcNormals.cpp b/src/utils/xrLC/xrCalcNormals.cpp index fb427de9294..76167a43263 100644 --- a/src/utils/xrLC/xrCalcNormals.cpp +++ b/src/utils/xrLC/xrCalcNormals.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "build.h" -#include "../xrLC_Light/xrface.h" -#include "../xrLC_Light/calculate_normals.h" -#include "../xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" +#include "utils/xrLC_Light/calculate_normals.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" diff --git a/src/utils/xrLC/xrFlex2OGF.cpp b/src/utils/xrLC/xrFlex2OGF.cpp index 58ae32066d0..e2d7c9cd35a 100644 --- a/src/utils/xrLC/xrFlex2OGF.cpp +++ b/src/utils/xrLC/xrFlex2OGF.cpp @@ -2,9 +2,8 @@ #include "build.h" #include "OGF_Face.h" #include "vbm.h" -//#include "std_classes.h" -#include "../xrlc_light/lightmap.h" -#include "../xrlc_light/xrface.h" +#include "utils/xrLC_Light/lightmap.h" +#include "utils/xrLC_Light/xrface.h" #define TRY(a) try { a; } catch (...) { Logger.clMsg("* E: %s", #a); } diff --git a/src/utils/xrLC/xrLC.cpp b/src/utils/xrLC/xrLC.cpp index a99c7619a3c..5c9d683d302 100644 --- a/src/utils/xrLC/xrLC.cpp +++ b/src/utils/xrLC/xrLC.cpp @@ -3,7 +3,7 @@ #include "stdafx.h" #include "math.h" #include "build.h" -#include "../xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" #include "utils/xrLCUtil/LevelCompilerLoggerWindow.hpp" //#pragma comment(linker,"/STACK:0x800000,0x400000") @@ -22,15 +22,15 @@ #define PROTECTED_BUILD #ifdef PROTECTED_BUILD -# define TRIVIAL_ENCRYPTOR_ENCODER -# define TRIVIAL_ENCRYPTOR_DECODER -# include "../../xrEngine/trivial_encryptor.h" -# undef TRIVIAL_ENCRYPTOR_ENCODER -# undef TRIVIAL_ENCRYPTOR_DECODER +# define TRIVIAL_ENCRYPTOR_ENCODER +# define TRIVIAL_ENCRYPTOR_DECODER +# include "xrEngine/trivial_encryptor.h" +# undef TRIVIAL_ENCRYPTOR_ENCODER +# undef TRIVIAL_ENCRYPTOR_DECODER #endif // PROTECTED_BUILD -CBuild* pBuild = NULL; -u32 version = 0; +CBuild* pBuild = NULL; +u32 version = 0; ILevelCompilerLogger& Logger = LevelCompilerLoggerWindow(); CThread::LogFunc ProxyMsg = cdecl_cast( @@ -60,120 +60,120 @@ CThreadManager::ReportProgressFunc ProxyProgress = cdecl_cast( static const char* h_str = - "The following keys are supported / required:\n" - "-? or -h == this help\n" - "-o == modify build options\n" - "-nosun == disable sun-lighting\n" - "-f == compile level in GameData\\Levels\\\\\n" - "\n" - "NOTE: The last key is required for any functionality\n"; + "The following keys are supported / required:\n" + "-? or -h == this help\n" + "-o == modify build options\n" + "-nosun == disable sun-lighting\n" + "-f == compile level in GameData\\Levels\\\\\n" + "\n" + "NOTE: The last key is required for any functionality\n"; void Help() { - MessageBox(0,h_str,"Command line options",MB_OK|MB_ICONINFORMATION); + MessageBox(0,h_str,"Command line options",MB_OK|MB_ICONINFORMATION); } typedef int __cdecl xrOptions(b_params* params, u32 version, bool bRunBuild); void Startup(LPSTR lpCmdLine) -{ - create_global_data(); +{ + create_global_data(); char cmd[512]; - BOOL bModifyOptions = FALSE; - - xr_strcpy(cmd,lpCmdLine); - strlwr(cmd); - if (strstr(cmd,"-?") || strstr(cmd,"-h")) { Help(); return; } - if (strstr(cmd,"-f")==0) { Help(); return; } - if (strstr(cmd,"-o")) bModifyOptions = TRUE; - if (strstr(cmd,"-gi")) g_build_options.b_radiosity = TRUE; - if (strstr(cmd,"-noise")) g_build_options.b_noise = TRUE; - if (strstr(cmd,"-net")) g_build_options.b_net_light = TRUE; - VERIFY( lc_global_data() ); - lc_global_data()->b_nosun_set ( !!strstr(cmd,"-nosun") ); - //if (strstr(cmd,"-nosun")) b_nosun = TRUE; + BOOL bModifyOptions = FALSE; + + xr_strcpy(cmd,lpCmdLine); + strlwr(cmd); + if (strstr(cmd,"-?") || strstr(cmd,"-h")) { Help(); return; } + if (strstr(cmd,"-f")==0) { Help(); return; } + if (strstr(cmd,"-o")) bModifyOptions = TRUE; + if (strstr(cmd,"-gi")) g_build_options.b_radiosity = TRUE; + if (strstr(cmd,"-noise")) g_build_options.b_noise = TRUE; + if (strstr(cmd,"-net")) g_build_options.b_net_light = TRUE; + VERIFY( lc_global_data() ); + lc_global_data()->b_nosun_set ( !!strstr(cmd,"-nosun") ); + //if (strstr(cmd,"-nosun")) b_nosun = TRUE; char name[256]; *name = 0; sscanf(strstr(cmd, "-f")+2, "%s", name); string256 temp; xr_sprintf(temp, "%s - Levels Compiler", name); Logger.Initialize(temp); - // Faster FPU - SetPriorityClass (GetCurrentProcess(),NORMAL_PRIORITY_CLASS); - /* - u32 dwMin = 1800*(1024*1024); - u32 dwMax = 1900*(1024*1024); - if (0==SetProcessWorkingSetSize(GetCurrentProcess(),dwMin,dwMax)) - { - clMsg("*** Failed to expand working set"); - }; - */ - - // Load project - string_path prjName; - FS.update_path (prjName,"$game_levels$",strconcat(sizeof(prjName),prjName,name,"\\build.prj")); - string256 phaseName; - Logger.Phase(strconcat(sizeof(phaseName), phaseName, "Reading project [", name, "]...")); - - string256 inf; - IReader* F = FS.r_open(prjName); - if (NULL==F){ - xr_sprintf (inf,"Build failed!\nCan't find level: '%s'",name); + // Faster FPU + SetPriorityClass (GetCurrentProcess(),NORMAL_PRIORITY_CLASS); + /* + u32 dwMin = 1800*(1024*1024); + u32 dwMax = 1900*(1024*1024); + if (0==SetProcessWorkingSetSize(GetCurrentProcess(),dwMin,dwMax)) + { + clMsg("*** Failed to expand working set"); + }; + */ + + // Load project + string_path prjName; + FS.update_path (prjName,"$game_levels$",strconcat(sizeof(prjName),prjName,name,"\\build.prj")); + string256 phaseName; + Logger.Phase(strconcat(sizeof(phaseName), phaseName, "Reading project [", name, "]...")); + + string256 inf; + IReader* F = FS.r_open(prjName); + if (NULL==F){ + xr_sprintf (inf,"Build failed!\nCan't find level: '%s'",name); Logger.clMsg(inf); Logger.Failure(inf); Logger.Destroy(); - return; - } + return; + } - // Version - F->r_chunk (EB_Version,&version); + // Version + F->r_chunk (EB_Version,&version); Logger.clMsg("version: %d", version); - R_ASSERT(XRCL_CURRENT_VERSION==version); + R_ASSERT(XRCL_CURRENT_VERSION==version); - // Header - b_params Params; - F->r_chunk (EB_Parameters,&Params); + // Header + b_params Params; + F->r_chunk (EB_Parameters,&Params); - // Show options if needed - if (bModifyOptions) - { + // Show options if needed + if (bModifyOptions) + { Logger.Phase("Project options..."); - HMODULE L = LoadLibrary ("xrLC_Options.dll"); - void* P = GetProcAddress (L,"_frmScenePropertiesRun"); - R_ASSERT (P); - xrOptions* O = (xrOptions*)P; - int R = O(&Params,version,false); - FreeLibrary (L); - if (R==2) { - ExitProcess(0); - } - } - - // Conversion + HMODULE L = LoadLibrary ("xrLC_Options.dll"); + void* P = GetProcAddress (L,"_frmScenePropertiesRun"); + R_ASSERT (P); + xrOptions* O = (xrOptions*)P; + int R = O(&Params,version,false); + FreeLibrary (L); + if (R==2) { + ExitProcess(0); + } + } + + // Conversion Logger.Phase("Converting data structures..."); - pBuild = xr_new(); - pBuild->Load (Params,*F); - FS.r_close (F); - - // Call for builder - string_path lfn; - CTimer dwStartupTime; dwStartupTime.Start(); - FS.update_path (lfn,_game_levels_,name); - pBuild->Run (lfn); - xr_delete (pBuild); - - // Show statistic - u32 dwEndTime = dwStartupTime.GetElapsed_ms(); - xr_sprintf (inf,"Time elapsed: %s",make_time(dwEndTime/1000).c_str()); + pBuild = xr_new(); + pBuild->Load (Params,*F); + FS.r_close (F); + + // Call for builder + string_path lfn; + CTimer dwStartupTime; dwStartupTime.Start(); + FS.update_path (lfn,_game_levels_,name); + pBuild->Run (lfn); + xr_delete (pBuild); + + // Show statistic + u32 dwEndTime = dwStartupTime.GetElapsed_ms(); + xr_sprintf (inf,"Time elapsed: %s",make_time(dwEndTime/1000).c_str()); Logger.clMsg("Build succesful!\n%s", inf); - if (!strstr(cmd,"-silent")) + if (!strstr(cmd,"-silent")) Logger.Success(inf); Logger.Destroy(); } //typedef void DUMMY_STUFF (const void*,const u32&,void*); -//XRCORE_API DUMMY_STUFF *g_temporary_stuff; -//XRCORE_API DUMMY_STUFF *g_dummy_stuff; +//XRCORE_API DUMMY_STUFF *g_temporary_stuff; +//XRCORE_API DUMMY_STUFF *g_dummy_stuff; @@ -182,18 +182,18 @@ int APIENTRY WinMain(HINSTANCE hInst, LPSTR lpCmdLine, int nCmdShow) { -// g_temporary_stuff = &trivial_encryptor::decode; -// g_dummy_stuff = &trivial_encryptor::encode; - - // Initialize debugging - Debug._initialize (false); - Core._initialize ("xrLC"); - - if(strstr(Core.Params,"-nosmg")) - g_using_smooth_groups = false; - - Startup (lpCmdLine); - Core._destroy (); - - return 0; +// g_temporary_stuff = &trivial_encryptor::decode; +// g_dummy_stuff = &trivial_encryptor::encode; + + // Initialize debugging + Debug._initialize (false); + Core._initialize ("xrLC"); + + if(strstr(Core.Params,"-nosmg")) + g_using_smooth_groups = false; + + Startup (lpCmdLine); + Core._destroy (); + + return 0; } diff --git a/src/utils/xrLC/xrLight.cpp b/src/utils/xrLC/xrLight.cpp index 9db750129d0..17b58059417 100644 --- a/src/utils/xrLC/xrLight.cpp +++ b/src/utils/xrLC/xrLight.cpp @@ -1,16 +1,16 @@ #include "stdafx.h" #include "build.h" -#include "../xrlc_light/xrdeflector.h" +#include "utils/xrLC_Light/xrdeflector.h" #include "utils/xrLCUtil/xrThread.hpp" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrLightVertex.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrLightVertex.h" -#include "../../xrcore/xrSyncronize.h" +#include "xrCore/xrSyncronize.h" #include "net.h" -//#include "../xrLC_Light/net_task_manager.h" -#include "../xrLC_Light/lcnet_task_manager.h" -#include "../xrLC_Light/mu_model_light.h" +//#include "utils/xrLC_Light/net_task_manager.h" +#include "utils/xrLC_Light/lcnet_task_manager.h" +#include "utils/xrLC_Light/mu_model_light.h" xrCriticalSection task_CS #ifdef PROFILE_CRITICAL_SECTIONS (MUTEX_PROFILE_ID(task_C_S)) diff --git a/src/utils/xrLC/xrMU_Model_Calc_ogf.cpp b/src/utils/xrLC/xrMU_Model_Calc_ogf.cpp index 51154bf9092..7fadd955a5a 100644 --- a/src/utils/xrLC/xrMU_Model_Calc_ogf.cpp +++ b/src/utils/xrLC/xrMU_Model_Calc_ogf.cpp @@ -1,6 +1,5 @@ #include "stdafx.h" - -#include "../xrLC_Light/xrMU_Model.h" +#include "utils/xrLC_Light/xrMU_Model.h" #include "OGF_Face.h" #include "build.h" @@ -15,8 +14,8 @@ void MModel_face2OGF_Vertices( const _face &FF, OGF_Vertex V[3], const xrMU_Mode V[k].P = _V->P; V[k].N = _V->N; V[k].Color = model.color[id]; - V[k].T.set (0,0,0); //. - V[k].B.set (0,0,0); //. + V[k].T.set (0,0,0); + V[k].B.set (0,0,0); V[k].UV.push_back(FF.tc[k]); } } diff --git a/src/utils/xrLC/xrMU_Model_export_OGF.cpp b/src/utils/xrLC/xrMU_Model_export_OGF.cpp index be43bfa8426..ca571b01881 100644 --- a/src/utils/xrLC/xrMU_Model_export_OGF.cpp +++ b/src/utils/xrLC/xrMU_Model_export_OGF.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#include "../xrLC_Light/xrMU_Model.h" -#include "../xrLC_Light/xrMU_Model_Reference.h" +#include "utils/xrLC_Light/xrMU_Model.h" +#include "utils/xrLC_Light/xrMU_Model_Reference.h" #include "build.h" #include "OGF_Face.h" diff --git a/src/utils/xrLC/xrMU_Model_export_geometry.cpp b/src/utils/xrLC/xrMU_Model_export_geometry.cpp index b84a22ec208..fcddfe4d4d0 100644 --- a/src/utils/xrLC/xrMU_Model_export_geometry.cpp +++ b/src/utils/xrLC/xrMU_Model_export_geometry.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../xrLC_Light/xrMU_Model.h" +#include "utils/xrLC_Light/xrMU_Model.h" #include "OGF_Face.h" const u32 max_tile = 16; diff --git a/src/utils/xrLC/xrOptimizeCFORM_qslim.cpp b/src/utils/xrLC/xrOptimizeCFORM_qslim.cpp index 0ff9b7872ff..52c2090ccff 100644 --- a/src/utils/xrLC/xrOptimizeCFORM_qslim.cpp +++ b/src/utils/xrLC/xrOptimizeCFORM_qslim.cpp @@ -2,8 +2,8 @@ #include "build.h" #include "MxStdModel.h" #include "MxQSlim.h" -#include "../../xrcdb/xrcdb.h" -#include "../../common/face_smoth_flags.h" +#include "xrCDB/xrCDB.h" +#include "common/face_smoth_flags.h" #pragma comment (lib,"xrQSlim.lib") diff --git a/src/utils/xrLC/xrPhase_AdaptiveHT.cpp b/src/utils/xrLC/xrPhase_AdaptiveHT.cpp index 6091abbedc9..2051a9645d3 100644 --- a/src/utils/xrLC/xrPhase_AdaptiveHT.cpp +++ b/src/utils/xrLC/xrPhase_AdaptiveHT.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" #include "build.h" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/light_point.h" -#include "../xrLC_Light/xrdeflector.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/light_point.h" +#include "utils/xrLC_Light/xrDeflector.h" +#include "utils/xrLC_Light/xrFace.h" -#include "../../xrcdb/xrcdb.h" -#include "../../common/face_smoth_flags.h" +#include "xrCDB/xrCDB.h" +#include "common/face_smoth_flags.h" #include "utils/xrLCUtil/xrThread.hpp" const float aht_max_edge = c_SS_maxsize/2.5f; // 2.0f; // 2 m diff --git a/src/utils/xrLC/xrPhase_GI.cpp b/src/utils/xrLC/xrPhase_GI.cpp index 611e6c22c32..d6c72403702 100644 --- a/src/utils/xrLC/xrPhase_GI.cpp +++ b/src/utils/xrLC/xrPhase_GI.cpp @@ -3,11 +3,11 @@ #include "build.h" #include "utils/xrLCUtil/xrThread.hpp" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" -#include "../../xrcore/xrSyncronize.h" -#include "../../xrcdb/xrcdb.h" +#include "xrCore/xrSyncronize.h" +#include "xrCDB/xrCDB.h" #define GI_THREADS 2 diff --git a/src/utils/xrLC/xrPhase_MergeGeometry.cpp b/src/utils/xrLC/xrPhase_MergeGeometry.cpp index cdaaee8c4d2..54778394c57 100644 --- a/src/utils/xrLC/xrPhase_MergeGeometry.cpp +++ b/src/utils/xrLC/xrPhase_MergeGeometry.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "build.h" -#include "../xrlc_light/xrface.h" +#include "utils/xrLC_Light/xrface.h" extern void Detach (vecFace* S); diff --git a/src/utils/xrLC/xrPhase_MergeLM.cpp b/src/utils/xrLC/xrPhase_MergeLM.cpp index 1008d64319e..4c3768879a0 100644 --- a/src/utils/xrLC/xrPhase_MergeLM.cpp +++ b/src/utils/xrLC/xrPhase_MergeLM.cpp @@ -3,9 +3,9 @@ #include "build.h" #include "xrPhase_MergeLM_Rect.h" -#include "../xrlc_light/xrdeflector.h" -#include "../xrlc_light/xrlc_globaldata.h" -#include "../xrlc_light/lightmap.h" +#include "utils/xrLC_Light/xrdeflector.h" +#include "utils/xrLC_Light/xrlc_globaldata.h" +#include "utils/xrLC_Light/lightmap.h" // Surface access extern void _InitSurface (); extern BOOL _rect_place (L_rect &r, lm_layer* D); @@ -191,9 +191,9 @@ void CBuild::xrPhase_MergeLM() #include "build.h" #include "xrPhase_MergeLM_Rect.h" -#include "../xrlc_light/xrdeflector.h" -#include "../xrlc_light/xrlc_globaldata.h" -#include "../xrlc_light/lightmap.h" +#include "utils/xrLC_Light/xrdeflector.h" +#include "utils/xrLC_Light/xrlc_globaldata.h" +#include "utils/xrLC_Light/lightmap.h" // Surface access extern void _InitSurface (); extern BOOL _rect_place (L_rect &r, lm_layer* D); diff --git a/src/utils/xrLC/xrPhase_MergeLM_Surface.cpp b/src/utils/xrLC/xrPhase_MergeLM_Surface.cpp index db48087209e..65e6f5135c4 100644 --- a/src/utils/xrLC/xrPhase_MergeLM_Surface.cpp +++ b/src/utils/xrLC/xrPhase_MergeLM_Surface.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "build.h" #include "xrPhase_MergeLM_Rect.h" -#include "../xrlc_light/xrdeflector.h" +#include "utils/xrLC_Light/xrdeflector.h" #include #include diff --git a/src/utils/xrLC/xrPhase_ResolveMaterials.cpp b/src/utils/xrLC/xrPhase_ResolveMaterials.cpp index 8a533719b8b..3fea2d51dc4 100644 --- a/src/utils/xrLC/xrPhase_ResolveMaterials.cpp +++ b/src/utils/xrLC/xrPhase_ResolveMaterials.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "build.h" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" extern void Detach (vecFace* S); diff --git a/src/utils/xrLC/xrPhase_Subdivide.cpp b/src/utils/xrLC/xrPhase_Subdivide.cpp index af4e86e2597..09a77ee8ce7 100644 --- a/src/utils/xrLC/xrPhase_Subdivide.cpp +++ b/src/utils/xrLC/xrPhase_Subdivide.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "build.h" -#include "../xrlc_light/xrdeflector.h" -#include "../xrlc_light/xrface.h" -#include "../xrlc_light/xrlc_globaldata.h" +#include "utils/xrLC_Light/xrdeflector.h" +#include "utils/xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrlc_globaldata.h" extern void Detach (vecFace* S); diff --git a/src/utils/xrLC/xrPhase_TangentBasis.cpp b/src/utils/xrLC/xrPhase_TangentBasis.cpp index 8285f6c8ee5..943b14afbc3 100644 --- a/src/utils/xrLC/xrPhase_TangentBasis.cpp +++ b/src/utils/xrLC/xrPhase_TangentBasis.cpp @@ -2,7 +2,7 @@ #include "build.h" #include "MeshMenderLayerOrdinaryStatic.h" -#include "../xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" static u32 find_same_vertex( const xr_vector &m, const Fvector2 &Ftc, const xr_vector< MeshMender::Vertex > &theVerts ) { diff --git a/src/utils/xrLC/xrPhase_UVmap.cpp b/src/utils/xrLC/xrPhase_UVmap.cpp index 0158846771d..5474de8c13a 100644 --- a/src/utils/xrLC/xrPhase_UVmap.cpp +++ b/src/utils/xrLC/xrPhase_UVmap.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "build.h" -#include "../xrLC_Light/xrDeflector.h" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrDeflector.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" diff --git a/src/utils/xrLC/xrPreOptimize.cpp b/src/utils/xrLC/xrPreOptimize.cpp index 15e5a8e2928..0f62c3af1af 100644 --- a/src/utils/xrLC/xrPreOptimize.cpp +++ b/src/utils/xrLC/xrPreOptimize.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "build.h" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" const int HDIM_X = 56; const int HDIM_Y = 24; diff --git a/src/utils/xrLC/xrT_Junction.cpp b/src/utils/xrLC/xrT_Junction.cpp index eb639ba9851..1400289f2fa 100644 --- a/src/utils/xrLC/xrT_Junction.cpp +++ b/src/utils/xrLC/xrT_Junction.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "build.h" -#include "../xrLC_Light/xrLC_GlobalData.h" -#include "../xrLC_Light/xrface.h" +#include "utils/xrLC_Light/xrLC_GlobalData.h" +#include "utils/xrLC_Light/xrface.h" //#define VPUSH(a) ((a).x), ((a).y), ((a).z) IC float SqrDistance2Segment(const Fvector& P, const Fvector& A, const Fvector& B) diff --git a/src/utils/xrLC_Light/calculate_normals.h b/src/utils/xrLC_Light/calculate_normals.h index 25a749ab20a..808d79801b2 100644 --- a/src/utils/xrLC_Light/calculate_normals.h +++ b/src/utils/xrLC_Light/calculate_normals.h @@ -2,7 +2,7 @@ #define __CALCULATE_NORMALS_H__ #include "itterate_adjacents_static.h" -#include "../../common/itterate_adjacents.h" +#include "common/itterate_adjacents.h" template class calculate_normals diff --git a/src/utils/xrLC_Light/compiler.cpp b/src/utils/xrLC_Light/compiler.cpp index 21886a56014..b42df2e5a07 100644 --- a/src/utils/xrLC_Light/compiler.cpp +++ b/src/utils/xrLC_Light/compiler.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../../xrEngine/xrlevel.h" +#include "xrEngine/xrlevel.h" #include "utils/xrLCUtil/xrThread.hpp" diff --git a/src/utils/xrLC_Light/detail_slot_calculate.cpp b/src/utils/xrLC_Light/detail_slot_calculate.cpp index d0dd0c5ab0d..df80ca08b24 100644 --- a/src/utils/xrLC_Light/detail_slot_calculate.cpp +++ b/src/utils/xrLC_Light/detail_slot_calculate.cpp @@ -6,11 +6,10 @@ #include "stdafx.h" #include "detail_slot_calculate.h" - #include "xrCDB/Intersect.hpp" #include "base_lighting.h" #include "global_calculation_data.h" -#include "../shader_xrlc.h" +#include "utils/Shader_xrLC.h" enum { diff --git a/src/utils/xrLC_Light/global_calculation_data.cpp b/src/utils/xrLC_Light/global_calculation_data.cpp index 58484f1eadb..26455dad3f0 100644 --- a/src/utils/xrLC_Light/global_calculation_data.cpp +++ b/src/utils/xrLC_Light/global_calculation_data.cpp @@ -1,15 +1,10 @@ #include "stdafx.h" - #include "global_calculation_data.h" - -#include "../shader_xrlc.h" +#include "utils/Shader_xrLC.h" #include "serialize.h" global_claculation_data gl_data; - - - template void transfer(const char *name, xr_vector &dest, IReader& F, u32 chunk) { @@ -27,10 +22,6 @@ void transfer(const char *name, xr_vector &dest, IReader& F, u32 chunk) extern u32* Surface_Load (char* name, u32& w, u32& h); extern void Surface_Init (); -// - - - void global_claculation_data::xrLoad() { string_path N; diff --git a/src/utils/xrLC_Light/global_calculation_data.h b/src/utils/xrLC_Light/global_calculation_data.h index fbbad286ec1..8f74bf66b8e 100644 --- a/src/utils/xrLC_Light/global_calculation_data.h +++ b/src/utils/xrLC_Light/global_calculation_data.h @@ -1,12 +1,10 @@ -#ifndef __GLOBAL_CALCULATION_DATA_H__ -#define __GLOBAL_CALCULATION_DATA_H__ - -#include "../../editors/LevelEditor/Engine/communicate.h" +#pragma once +#include "editors/LevelEditor/Engine/communicate.h" #include "base_lighting.h" #include "global_slots_data.h" #include "b_build_texture.h" #include "global_slots_data.h" -#include "../../xrcdb/xrcdb.h" +#include "xrCDB/xrCDB.h" class Shader_xrLC_LIB; //----------------------------------------------------------------- struct global_claculation_data @@ -32,5 +30,3 @@ struct global_claculation_data void xrLoad ( ); }; extern global_claculation_data gl_data; -//----------------------------------------------------------------- -#endif //__GLOBAL_CALCULATION_DATA_H__ \ No newline at end of file diff --git a/src/utils/xrLC_Light/itterate_adjacents_static.h b/src/utils/xrLC_Light/itterate_adjacents_static.h index 09d46f30c51..799688a5873 100644 --- a/src/utils/xrLC_Light/itterate_adjacents_static.h +++ b/src/utils/xrLC_Light/itterate_adjacents_static.h @@ -1,10 +1,6 @@ #ifndef _ITTERATE_ADJACENTS_STATIC_H_ #define _ITTERATE_ADJACENTS_STATIC_H_ -#include "../../common/face_smoth_flags.h" - - - - +#include "common/face_smoth_flags.h" template struct itterate_adjacents_params_static diff --git a/src/utils/xrLC_Light/light_execute.h b/src/utils/xrLC_Light/light_execute.h index 75038f3fc9d..ef9950ce51c 100644 --- a/src/utils/xrLC_Light/light_execute.h +++ b/src/utils/xrLC_Light/light_execute.h @@ -2,7 +2,7 @@ #include "xrdeflectordefs.h" #include "base_lighting.h" -#include "../../xrcdb/xrcdb.h" +#include "xrCDB/xrCDB.h" diff --git a/src/utils/xrLC_Light/mu_model_face.cpp b/src/utils/xrLC_Light/mu_model_face.cpp index f8d58f5bd22..dab6be4caba 100644 --- a/src/utils/xrLC_Light/mu_model_face.cpp +++ b/src/utils/xrLC_Light/mu_model_face.cpp @@ -6,7 +6,7 @@ #include "serialize.h" -#include "../../xrcore/xrPool.h" +#include "xrCore/xrPool.h" poolSS<_vertex,8*1024> &mu_vertices_pool(); diff --git a/src/utils/xrLC_Light/mu_model_light_threads.cpp b/src/utils/xrLC_Light/mu_model_light_threads.cpp index 54545039726..1cf980c3730 100644 --- a/src/utils/xrLC_Light/mu_model_light_threads.cpp +++ b/src/utils/xrLC_Light/mu_model_light_threads.cpp @@ -14,7 +14,7 @@ //#include "mu_model_face.h" #include "utils/xrLCUtil/xrThread.hpp" -#include "../../xrcore/xrSyncronize.h" +#include "xrCore/xrSyncronize.h" diff --git a/src/utils/xrLC_Light/net_cl_data_prepare.cpp b/src/utils/xrLC_Light/net_cl_data_prepare.cpp index 1289694e60b..253cc61584f 100644 --- a/src/utils/xrLC_Light/net_cl_data_prepare.cpp +++ b/src/utils/xrLC_Light/net_cl_data_prepare.cpp @@ -9,7 +9,7 @@ #include "xrlc_globaldata.h" #include "mu_light_net.h" #include "utils/xrLCUtil/xrThread.hpp" -#include "../../xrcore/xrSyncronize.h" +#include "xrCore/xrSyncronize.h" bool global_compile_data_initialized = false; bool base_global_compile_data_initialized = false; diff --git a/src/utils/xrLC_Light/net_execution_factory_register.cpp b/src/utils/xrLC_Light/net_execution_factory_register.cpp index 1972a8b9714..60d5dca88f4 100644 --- a/src/utils/xrLC_Light/net_execution_factory_register.cpp +++ b/src/utils/xrLC_Light/net_execution_factory_register.cpp @@ -4,7 +4,7 @@ #include "net_all_executions.h" #include "net_execution_globals.h" -#include "../../xrcore/xrPool.h" +#include "xrCore/xrPool.h" namespace lc_net{ diff --git a/src/utils/xrLC_Light/net_execution_lightmaps.cpp b/src/utils/xrLC_Light/net_execution_lightmaps.cpp index b23b0347917..6b0774f3278 100644 --- a/src/utils/xrLC_Light/net_execution_lightmaps.cpp +++ b/src/utils/xrLC_Light/net_execution_lightmaps.cpp @@ -8,7 +8,7 @@ #include "xrdeflector.h" #include "execute_statistics.h" -#include "../../xrcore/ftimer.h" +#include "xrCore/ftimer.h" namespace lc_net { diff --git a/src/utils/xrLC_Light/net_execution_vertex_light.cpp b/src/utils/xrLC_Light/net_execution_vertex_light.cpp index 483fdfa725c..ea4e7ef9333 100644 --- a/src/utils/xrLC_Light/net_execution_vertex_light.cpp +++ b/src/utils/xrLC_Light/net_execution_vertex_light.cpp @@ -9,7 +9,7 @@ #include "xrlc_globaldata.h" #include "xrface.h" #include "light_point.h" -#include "../../xrcdb/xrCDB.h" +#include "xrCDB/xrCDB.h" extern XRLC_LIGHT_API void LightPoint (CDB::COLLIDER* DB, CDB::MODEL* MDL, base_color_c &C, Fvector &P, Fvector &N, base_lighting& lights, u32 flags, Face* skip); void g_trans_register (Vertex* V); namespace lc_net diff --git a/src/utils/xrLC_Light/net_stream.cpp b/src/utils/xrLC_Light/net_stream.cpp index 582dedbdede..925fd5ae4cb 100644 --- a/src/utils/xrLC_Light/net_stream.cpp +++ b/src/utils/xrLC_Light/net_stream.cpp @@ -306,7 +306,7 @@ CReadMemoryBlock:: ~CReadMemoryBlock () //Memory.mem_free( data ); } -#include "../../xrCore/FS_impl.h" +#include "xrCore/FS_impl.h" u32 INetReader::find_chunk (u32 ID, BOOL* bCompressed) { R_ASSERT( false ); diff --git a/src/utils/xrLC_Light/stdafx.h b/src/utils/xrLC_Light/stdafx.h index 8db2f11bc49..72f1ad2212c 100644 --- a/src/utils/xrLC_Light/stdafx.h +++ b/src/utils/xrLC_Light/stdafx.h @@ -28,7 +28,7 @@ // Windows Header Files: #include */ -//#include "../../xrCore/xrCore.h" +//#include "xrCore/xrCore.h" //#define COLLECT_EXECUTION_STATS #pragma warning (disable:4661) diff --git a/src/utils/xrLC_Light/xrDeflector.h b/src/utils/xrLC_Light/xrDeflector.h index cb67eccd50c..7bec047024b 100644 --- a/src/utils/xrLC_Light/xrDeflector.h +++ b/src/utils/xrLC_Light/xrDeflector.h @@ -4,7 +4,7 @@ #include "base_color.h" #include "lm_layer.h" #include "uv_tri.h" -#include "../../xrcdb/xrCDB.h" +#include "xrCDB/xrCDB.h" #include "serialize.h" #include "xrdeflectordefs.h" #include "execute_statistics.h" diff --git a/src/utils/xrLC_Light/xrFace.h b/src/utils/xrLC_Light/xrFace.h index fbbcdac77e3..e0957c8b9cc 100644 --- a/src/utils/xrLC_Light/xrFace.h +++ b/src/utils/xrLC_Light/xrFace.h @@ -1,12 +1,9 @@ #pragma once -#include "../shader_xrlc.h" -//#include "r_light.h" - +#include "utils/Shader_xrLC.h" #include "tcf.h" #include "base_face.h" - #include "MeshStructure.h" #include "serialize.h" diff --git a/src/utils/xrLC_Light/xrLC_GlobalData.cpp b/src/utils/xrLC_Light/xrLC_GlobalData.cpp index 6e3a8010512..3cdd88e4b2b 100644 --- a/src/utils/xrLC_Light/xrLC_GlobalData.cpp +++ b/src/utils/xrLC_Light/xrLC_GlobalData.cpp @@ -8,7 +8,7 @@ #include "mu_model_face.h" #include "xrmu_model.h" #include "xrmu_model_reference.h" -#include "../../xrcdb/xrcdb.h" +#include "xrCDB/xrCDB.h" bool g_using_smooth_groups = true; bool g_smooth_groups_by_faces = false; diff --git a/src/utils/xrLC_Light/xrLC_GlobalData.h b/src/utils/xrLC_Light/xrLC_GlobalData.h index 172fc75773f..53821addfb2 100644 --- a/src/utils/xrLC_Light/xrLC_GlobalData.h +++ b/src/utils/xrLC_Light/xrLC_GlobalData.h @@ -1,15 +1,12 @@ #pragma once -#include "../shader_xrlc.h" -#include "../../xrcore/xrPool.h" -//#include "xrface.h" +#include "utils/Shader_xrLC.h" +#include "xrCore/xrPool.h" #include "xrfacedefs.h" #include "xrdeflectordefs.h" #include "b_build_texture.h" #include "base_lighting.h" -#include "../../editors/LevelEditor/Engine/communicate.h" -//#include "mu_model_face.h" -//#include "mu_model_face_defs.h" +#include "editors/LevelEditor/Engine/communicate.h" //struct _face; //struct _vertex; namespace CDB{ diff --git a/src/utils/xrLC_Light/xrLC_Light.cpp b/src/utils/xrLC_Light/xrLC_Light.cpp index 53a88736f98..8f7cfcb7b1a 100644 --- a/src/utils/xrLC_Light/xrLC_Light.cpp +++ b/src/utils/xrLC_Light/xrLC_Light.cpp @@ -10,42 +10,42 @@ #pragma managed(push, off) #endif -b_params &g_params() +b_params &g_params() { - VERIFY(inlc_global_data()); - return inlc_global_data()->g_params(); + VERIFY(inlc_global_data()); + return inlc_global_data()->g_params(); } BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved - ) + ) { - switch(ul_reason_for_call) { - case DLL_PROCESS_ATTACH: - { - Debug._initialize (false); - bool init_log = (0 != xr_strcmp( Core.ApplicationName, "XRayEditorTools" )); - Core._initialize ("xrLC_Light",0,FALSE); - if( init_log ) - CreateLog( ); - - //FPU::m64r (); - break; - } - case DLL_THREAD_ATTACH: - break; - case DLL_THREAD_DETACH: - break; - case DLL_PROCESS_DETACH: - if(inlc_global_data()) - destroy_global_data(); - Core._destroy(); - break; - } - return TRUE; - + switch(ul_reason_for_call) { + case DLL_PROCESS_ATTACH: + { + Debug._initialize (false); + bool init_log = (0 != xr_strcmp( Core.ApplicationName, "XRayEditorTools" )); + Core._initialize ("xrLC_Light",0,FALSE); + if( init_log ) + CreateLog( ); + + //FPU::m64r (); + break; + } + case DLL_THREAD_ATTACH: + break; + case DLL_THREAD_DETACH: + break; + case DLL_PROCESS_DETACH: + if(inlc_global_data()) + destroy_global_data(); + Core._destroy(); + break; + } + return TRUE; + } diff --git a/src/utils/xrLC_Light/xrLC_Light.h b/src/utils/xrLC_Light/xrLC_Light.h index 03d53a4f389..e565f9f29d8 100644 --- a/src/utils/xrLC_Light/xrLC_Light.h +++ b/src/utils/xrLC_Light/xrLC_Light.h @@ -1,15 +1,12 @@ -#ifndef _XRLC_LIGHT_H_ -#define _XRLC_LIGHT_H_ #pragma once -#include "../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #ifdef XRLC_LIGHT_EXPORTS # define XRLC_LIGHT_API __declspec(dllexport) #else # define XRLC_LIGHT_API __declspec(dllimport) #endif - #pragma warning(disable:4995) #include #include @@ -18,10 +15,8 @@ #include #pragma warning(default:4995) -//#include "cl_log.h" #include "_d3d_extensions.h" -#include "../../editors/LevelEditor/Engine/communicate.h" -//#include "Etextureparams.h" +#include "editors/LevelEditor/Engine/communicate.h" static const int edge2idx3 [3][3] = { {0,1,2}, {1,2,0}, {2,0,1} }; static const int edge2idx [3][2] = { {0,1}, {1,2}, {2,0} }; @@ -45,6 +40,3 @@ IC u8 u8_clr (float a) { s32 _a = iFloor(a*255.f); clamp(_a,0,2 #define X_TRY try #define X_CATCH catch(...) #endif - -#endif - diff --git a/src/utils/xrLC_Light/xrLightVertex.cpp b/src/utils/xrLC_Light/xrLightVertex.cpp index 337694b0e4e..feb3a6884a1 100644 --- a/src/utils/xrLC_Light/xrLightVertex.cpp +++ b/src/utils/xrLC_Light/xrLightVertex.cpp @@ -5,7 +5,7 @@ #include "xrLC_GlobalData.h" #include "light_point.h" -#include "../../xrcdb/xrCDB.h" +#include "xrCDB/xrCDB.h" //----------------------------------------------------------------------- typedef xr_multimap mapVert; typedef mapVert::iterator mapVertIt; diff --git a/src/utils/xrLC_Light/xrLight_Implicit.cpp b/src/utils/xrLC_Light/xrLight_Implicit.cpp index f8aeac46745..798ee2517b6 100644 --- a/src/utils/xrLC_Light/xrLight_Implicit.cpp +++ b/src/utils/xrLC_Light/xrLight_Implicit.cpp @@ -16,7 +16,7 @@ #include "xrlight_implicitcalcglobs.h" #include "net_task_callback.h" -#include "../../xrcdb/xrcdb.h" +#include "xrCDB/xrCDB.h" extern "C" bool __declspec(dllimport) __stdcall DXTCompress(LPCSTR out_name, u8* raw_data, u8* normal_map, u32 w, u32 h, u32 pitch, STextureParams* fmt, u32 depth); diff --git a/src/utils/xrLC_Light/xrMU_Model.cpp b/src/utils/xrLC_Light/xrMU_Model.cpp index 4d0643ff584..f2333541a93 100644 --- a/src/utils/xrLC_Light/xrMU_Model.cpp +++ b/src/utils/xrLC_Light/xrMU_Model.cpp @@ -4,7 +4,7 @@ #include "serialize.h" #include "mu_model_face.h" #include "vector_clear.h" -#include "../../xrcore/xrPool.h" +#include "xrCore/xrPool.h" xrMU_Model::xrMU_Model(): m_lod_ID(u16(-1)),read_faces(0),read_vertices(0),write_faces(0), write_vertices(0) diff --git a/src/utils/xrLC_Light/xrMU_Model_Calc_lighting.cpp b/src/utils/xrLC_Light/xrMU_Model_Calc_lighting.cpp index 9771ed833dc..55471fa4da8 100644 --- a/src/utils/xrLC_Light/xrMU_Model_Calc_lighting.cpp +++ b/src/utils/xrLC_Light/xrMU_Model_Calc_lighting.cpp @@ -1,13 +1,8 @@ #include "stdafx.h" - - -//#include "build.h" #include "xrMU_Model.h" -//#include "xrLC_GlobalData.h" #include "light_point.h" -//#include "xrDeflector.h" -#include "../../xrcdb/xrcdb.h" -#include "../shader_xrlc.h" +#include "xrCDB/xrCDB.h" +#include "utils/Shader_xrLC.h" #include "mu_model_face.h" #include "xrface.h" #include "xrLC_GlobalData.h" diff --git a/src/utils/xrLC_Light/xrMU_Model_Calc_materials.cpp b/src/utils/xrLC_Light/xrMU_Model_Calc_materials.cpp index 3eeaa0ebf78..b67a8da1340 100644 --- a/src/utils/xrLC_Light/xrMU_Model_Calc_materials.cpp +++ b/src/utils/xrLC_Light/xrMU_Model_Calc_materials.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "xrMU_Model.h" -#include "../shader_xrlc.h" +#include "utils/Shader_xrLC.h" bool cmp_face_material (_face* f1, _face* f2) { diff --git a/src/utils/xrLC_Light/xrMU_Model_Calc_normals.cpp b/src/utils/xrLC_Light/xrMU_Model_Calc_normals.cpp index 480b61bc0b9..ed559462c15 100644 --- a/src/utils/xrLC_Light/xrMU_Model_Calc_normals.cpp +++ b/src/utils/xrLC_Light/xrMU_Model_Calc_normals.cpp @@ -4,7 +4,7 @@ #include "calculate_normals.h" #include "xrMU_Model.h" -#include "../../xrcore/xrPool.h" +#include "xrCore/xrPool.h" //#include "build.h" diff --git a/src/utils/xrLC_Light/xrMU_Model_Load.cpp b/src/utils/xrLC_Light/xrMU_Model_Load.cpp index fa2432e57b7..3a53fc9abae 100644 --- a/src/utils/xrLC_Light/xrMU_Model_Load.cpp +++ b/src/utils/xrLC_Light/xrMU_Model_Load.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "xrMU_Model.h" //#include "build.h" -#include "../../xrcore/xrPool.h" +#include "xrCore/xrPool.h" poolSS<_face,8*1024> &mu_faces_pool(); poolSS<_vertex,8*1024> &mu_vertices_pool(); //extern u32 version; diff --git a/src/utils/xrLC_Light/xrMU_Model_Reference.cpp b/src/utils/xrLC_Light/xrMU_Model_Reference.cpp index b1af95d1314..e774c717b36 100644 --- a/src/utils/xrLC_Light/xrMU_Model_Reference.cpp +++ b/src/utils/xrLC_Light/xrMU_Model_Reference.cpp @@ -1,13 +1,9 @@ #include "stdafx.h" - #include "xrMU_Model_Reference.h" #include "xrLC_GlobalData.h" #include "xrMU_Model.h" - - - -#include "../../xrcdb/xrcdb.h" -#include "../shader_xrlc.h" +#include "xrCDB/xrCDB.h" +#include "utils/Shader_xrLC.h" #include "xrface.h" #include "serialize.h" diff --git a/src/utils/xrLC_Light/xrMU_Model_export_cform_rcast.cpp b/src/utils/xrLC_Light/xrMU_Model_export_cform_rcast.cpp index abcfbf9be86..94926ebb96a 100644 --- a/src/utils/xrLC_Light/xrMU_Model_export_cform_rcast.cpp +++ b/src/utils/xrLC_Light/xrMU_Model_export_cform_rcast.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "xrMU_Model.h" #include "xrMU_Model_Reference.h" +#include "xrCDB/xrCDB.h" +#include "utils/Shader_xrLC.h" -#include "../../xrcdb/xrcdb.h" -#include "../shader_xrlc.h" void xrMU_Model::export_cform_rcast (CDB::CollectorPacked& CL, Fmatrix& xform) { for (u32 fit=0; fitflags.bProcessed = false; diff --git a/src/utils/xrLC_LightStab/xrLC_LightStab.cpp b/src/utils/xrLC_LightStab/xrLC_LightStab.cpp index 319b9155b96..99d680105d0 100644 --- a/src/utils/xrLC_LightStab/xrLC_LightStab.cpp +++ b/src/utils/xrLC_LightStab/xrLC_LightStab.cpp @@ -1,7 +1,7 @@ #include "xrlc_lightstab.h" -#include "../xrlc_light/net_light.h" +#include "utils/xrLC_Light/net_light.h" -#include "../xrlc_light/lightstab_interface.h" +#include "utils/xrLC_Light/lightstab_interface.h" #pragma comment(lib,"xrLC_Light.lib") diff --git a/src/utils/xrQSlim/src/stdafx.h b/src/utils/xrQSlim/src/stdafx.h index c789ea50cd3..0da5e66fdf5 100644 --- a/src/utils/xrQSlim/src/stdafx.h +++ b/src/utils/xrQSlim/src/stdafx.h @@ -4,7 +4,7 @@ # pragma once #endif -#include "../../../xrCore/xrCore.h" +#include "xrCore/xrCore.h" /************************************************************************ diff --git a/src/utils/xrSE_Factory/script_properties_list_helper.h b/src/utils/xrSE_Factory/script_properties_list_helper.h index 8dde101a3ab..021274d6e5b 100644 --- a/src/utils/xrSE_Factory/script_properties_list_helper.h +++ b/src/utils/xrSE_Factory/script_properties_list_helper.h @@ -8,9 +8,9 @@ #pragma once -#include "../../xrcdb/xrCDB.h" +#include "xrCDB/xrCDB.h" #ifndef XRGAME_EXPORTS -# include "../xrSound/Sound.h" +# include "xrSound/Sound.h" #endif #include "xrEProps.h" #include "script_export_space.h" diff --git a/src/utils/xrSE_Factory/stdafx.h b/src/utils/xrSE_Factory/stdafx.h index 85e1b0e8a60..ba0fa7d9fd3 100644 --- a/src/utils/xrSE_Factory/stdafx.h +++ b/src/utils/xrSE_Factory/stdafx.h @@ -8,11 +8,7 @@ #pragma once -#include "../../xrCore/xrCore.h" - -#define STRINGIZE(a) #a -#define UP(a) STRINGIZE(../../##a) -//#undef STRINGIZE +#include "xrCore/xrCore.h" #define WIN32_LEAN_AND_MEAN diff --git a/src/utils/xrSE_Factory/xrUIXmlParser.cpp b/src/utils/xrSE_Factory/xrUIXmlParser.cpp index 1218041a046..86395c3d269 100644 --- a/src/utils/xrSE_Factory/xrUIXmlParser.cpp +++ b/src/utils/xrSE_Factory/xrUIXmlParser.cpp @@ -2,7 +2,7 @@ #include "xrUIXmlParser.h" #ifdef XRGAME_EXPORTS -# include "../ui_base.h" +#include "xrGame/ui_base.h" #endif // XRGAME_EXPORTS shared_str CUIXml::correct_file_name (LPCSTR path, LPCSTR fn) diff --git a/src/utils/xrSE_Factory/xrUIXmlParser.h b/src/utils/xrSE_Factory/xrUIXmlParser.h index 1646b68181c..6d52e416ffd 100644 --- a/src/utils/xrSE_Factory/xrUIXmlParser.h +++ b/src/utils/xrSE_Factory/xrUIXmlParser.h @@ -1,6 +1,5 @@ #pragma once - -#include UP(xrXMLParser/xrXMLParser.h) +#include "xrXMLParser/xrXMLParser.h" class CUIXml :public CXml { diff --git a/src/xrCDB/Frustum.h b/src/xrCDB/Frustum.h index 5321f3dbb26..f20af48a2cf 100644 --- a/src/xrCDB/Frustum.h +++ b/src/xrCDB/Frustum.h @@ -9,7 +9,7 @@ //#pragma once -#include "../xrcore/fixedvector.h" +#include "xrCore/fixedvector.h" #pragma pack(push,4) diff --git a/src/xrCDB/ISpatial.cpp b/src/xrCDB/ISpatial.cpp index 28c33346141..57abaa9762a 100644 --- a/src/xrCDB/ISpatial.cpp +++ b/src/xrCDB/ISpatial.cpp @@ -2,11 +2,11 @@ #include "stdafx.h" #include "ispatial.h" -#include "../xrengine/render.h" +#include "xrEngine/render.h" #ifdef DEBUG -#include "../xrengine/xr_object.h" -#include "../xrengine/PS_Instance.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/PS_Instance.h" #endif diff --git a/src/xrCDB/ISpatial.h b/src/xrCDB/ISpatial.h index e590238c223..c898de89d5e 100644 --- a/src/xrCDB/ISpatial.h +++ b/src/xrCDB/ISpatial.h @@ -2,7 +2,7 @@ #define XRENGINE_ISPATIAL_H_INCLUDED //#pragma once -#include "../xrCore/xrPool.h" +#include "xrCore/xrPool.h" #include "xr_collide_defs.h" diff --git a/src/xrCDB/OPC_TreeBuilders.h b/src/xrCDB/OPC_TreeBuilders.h index 585d7209a78..8be5c9da3ba 100644 --- a/src/xrCDB/OPC_TreeBuilders.h +++ b/src/xrCDB/OPC_TreeBuilders.h @@ -21,7 +21,7 @@ #define __OPC_TREEBUILDERS_H__ #include "opc_aabbtree.h" -#include "../xrCore/xrPool.h" +#include "xrCore/xrPool.h" //! Tree splitting rules enum SplittingRules { diff --git a/src/xrCDB/StdAfx.h b/src/xrCDB/StdAfx.h index e152b3d2f10..9a3bebbeb72 100644 --- a/src/xrCDB/StdAfx.h +++ b/src/xrCDB/StdAfx.h @@ -7,10 +7,10 @@ #define stdafxH //#pragma once -#include "../xrCore/xrCore.h" +#include "xrCore/xrCore.h" -#include "../xrCore/doug_lea_allocator.h" -#include "../xrCore/memory_allocator_options.h" +#include "xrCore/doug_lea_allocator.h" +#include "xrCore/memory_allocator_options.h" #ifdef USE_ARENA_ALLOCATOR extern doug_lea_allocator g_collision_allocator; diff --git a/src/xrCDB/xrCDB_Collector.cpp b/src/xrCDB/xrCDB_Collector.cpp index ab9d239af06..587cda0c500 100644 --- a/src/xrCDB/xrCDB_Collector.cpp +++ b/src/xrCDB/xrCDB_Collector.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -//.#include "../xrCore/xrCore.h" +//.#include "xrCore/xrCore.h" #pragma hdrstop #include "xrCDB.h" diff --git a/src/xrCDB/xr_area.cpp b/src/xrCDB/xr_area.cpp index 5598dfa411c..0f8a106f4a3 100644 --- a/src/xrCDB/xr_area.cpp +++ b/src/xrCDB/xr_area.cpp @@ -2,10 +2,10 @@ //#include "igame_level.h" #include "xr_area.h" -#include "../xrengine/xr_object.h" -#include "../xrengine/xrLevel.h" -#include "../xrengine/xr_collide_form.h" -//#include "../xrsound/sound.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/xrLevel.h" +#include "xrEngine/xr_collide_form.h" +//#include "xrSound/sound.h" //#include "x_ray.h" //#include "GameFont.h" diff --git a/src/xrCDB/xr_area.h b/src/xrCDB/xr_area.h index 5486503927b..b7638f26b75 100644 --- a/src/xrCDB/xr_area.h +++ b/src/xrCDB/xr_area.h @@ -9,8 +9,8 @@ class ISpatial; class ICollisionForm; class CObject; -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/ObjectSpaceRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/ObjectSpaceRender.h" #include "xrXRC.h" #include "xrcdb.h" diff --git a/src/xrCDB/xr_area_query.cpp b/src/xrCDB/xr_area_query.cpp index 01b1b0e654c..a83a250043f 100644 --- a/src/xrCDB/xr_area_query.cpp +++ b/src/xrCDB/xr_area_query.cpp @@ -2,7 +2,7 @@ #include "xr_area.h" #include "frustum.h" -#include "../xrCore/_vector3d_ext.h" +#include "xrCore/_vector3d_ext.h" using namespace collide; diff --git a/src/xrCDB/xr_area_raypick.cpp b/src/xrCDB/xr_area_raypick.cpp index 3850b6b5810..2814342c9c4 100644 --- a/src/xrCDB/xr_area_raypick.cpp +++ b/src/xrCDB/xr_area_raypick.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "xr_area.h" #include "ispatial.h" -#include "../xrengine/xr_collide_form.h" -#include "../xrengine/xr_object.h" +#include "xrEngine/xr_collide_form.h" +#include "xrEngine/xr_object.h" #include "Intersect.hpp" #include "d3d9types.h" //#include "igame_level.h" diff --git a/src/xrCPU_Pipe/StdAfx.h b/src/xrCPU_Pipe/StdAfx.h index 6580676650f..f33d125197c 100644 --- a/src/xrCPU_Pipe/StdAfx.h +++ b/src/xrCPU_Pipe/StdAfx.h @@ -20,13 +20,13 @@ # include "skeletonX.h" # include "skeletoncustom.h" #else // _EDITOR - #include "../xrCore/xrCore.h" - #include "../Layers/xrRender/SkeletonXVertRender.h" - #include "../xrCore/Animation/Bone.hpp" + #include "xrCore/xrCore.h" + #include "Layers/xrRender/SkeletonXVertRender.h" + #include "xrCore/Animation/Bone.hpp" #define RENDER 1 - #include "../xrEngine/Render.h" - #include "../xrEngine/Device.h" - #include "../Layers/xrRender/light.h" + #include "xrEngine/Render.h" + #include "xrEngine/Device.h" + #include "Layers/xrRender/light.h" #endif // _EDITOR #include "xrCPU_Pipe.h" diff --git a/src/xrCore/FS_impl.h b/src/xrCore/FS_impl.h index 5eac40b5cf7..7e7651c0ae9 100644 --- a/src/xrCore/FS_impl.h +++ b/src/xrCore/FS_impl.h @@ -176,7 +176,7 @@ IC u32 IReaderBase::find_chunk (u32 ID, BOOL* bCompressed) #ifdef FIND_CHUNK_VEC -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" struct IReaderBase_Test { @@ -246,7 +246,7 @@ IC u32 IReaderBase::find_chunk (u32 ID, BOOL* bCompressed) #ifdef FIND_CHUNK_MAP -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" struct IReaderBase_Test { diff --git a/src/xrCore/stdafx.h b/src/xrCore/stdafx.h index 4fd830eb389..ce470d7ecb7 100644 --- a/src/xrCore/stdafx.h +++ b/src/xrCore/stdafx.h @@ -11,7 +11,7 @@ #include "xrCore.h" #include "xrCore_platform.h" #include "Common/Util.hpp" -//.#include "../../Include/xrAPI/xrAPI.h" +//.#include "Include/xrAPI/xrAPI.h" #endif #pragma hdrstop diff --git a/src/xrEngine/Device_Initialize.cpp b/src/xrEngine/Device_Initialize.cpp index 376198dff65..36b8c6e116c 100644 --- a/src/xrEngine/Device_Initialize.cpp +++ b/src/xrEngine/Device_Initialize.cpp @@ -3,7 +3,7 @@ #include "dedicated_server_only.h" #ifdef INGAME_EDITOR -# include "../include/editor/ide.hpp" +# include "Include/editor/ide.hpp" # include "engine_impl.hpp" #endif // #ifdef INGAME_EDITOR diff --git a/src/xrEngine/Device_create.cpp b/src/xrEngine/Device_create.cpp index bfa907a30ca..11f61d7f7a1 100644 --- a/src/xrEngine/Device_create.cpp +++ b/src/xrEngine/Device_create.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" //#include "resourcemanager.h" -#include "../Include/xrRender/DrawUtils.h" +#include "Include/xrRender/DrawUtils.h" //#include "xr_effgamma.h" #include "render.h" #include "dedicated_server_only.h" -#include "../xrcdb/xrxrc.h" +#include "xrCDB/xrxrc.h" #include "securom_api.h" diff --git a/src/xrEngine/Device_destroy.cpp b/src/xrEngine/Device_destroy.cpp index d0f64d8bf74..45ca4cf5f91 100644 --- a/src/xrEngine/Device_destroy.cpp +++ b/src/xrEngine/Device_destroy.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "../Include/xrRender/DrawUtils.h" +#include "Include/xrRender/DrawUtils.h" #include "render.h" #include "IGame_Persistent.h" #include "xr_IOConsole.h" diff --git a/src/xrEngine/Engine.h b/src/xrEngine/Engine.h index f1f0dc72feb..a0c63980b44 100644 --- a/src/xrEngine/Engine.h +++ b/src/xrEngine/Engine.h @@ -8,7 +8,7 @@ #include "engineAPI.h" #include "eventAPI.h" -#include "../xrCPU_Pipe/xrCPU_Pipe.h" +#include "xrCPU_Pipe/xrCPU_Pipe.h" #include "xrSheduler.h" class ENGINE_API CEngine diff --git a/src/xrEngine/EngineAPI.cpp b/src/xrEngine/EngineAPI.cpp index 9b4e0c7d0d6..bba24f09c35 100644 --- a/src/xrEngine/EngineAPI.cpp +++ b/src/xrEngine/EngineAPI.cpp @@ -4,7 +4,7 @@ #include "stdafx.h" #include "EngineAPI.h" -#include "../xrcdb/xrXRC.h" +#include "xrCDB/xrXRC.h" #include "securom_api.h" diff --git a/src/xrEngine/Environment.cpp b/src/xrEngine/Environment.cpp index aaf95fec54a..abd890ddab9 100644 --- a/src/xrEngine/Environment.cpp +++ b/src/xrEngine/Environment.cpp @@ -21,12 +21,12 @@ #endif //#include "D3DUtils.h" -#include "../xrcore/xrCore.h" +#include "xrCore/xrCore.h" -#include "../Include/xrRender/EnvironmentRender.h" -#include "../Include/xrRender/LensFlareRender.h" -#include "../Include/xrRender/RainRender.h" -#include "../Include/xrRender/ThunderboltRender.h" +#include "Include/xrRender/EnvironmentRender.h" +#include "Include/xrRender/LensFlareRender.h" +#include "Include/xrRender/RainRender.h" +#include "Include/xrRender/ThunderboltRender.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction diff --git a/src/xrEngine/Environment.h b/src/xrEngine/Environment.h index 015eb9a1462..a3088a8a21c 100644 --- a/src/xrEngine/Environment.h +++ b/src/xrEngine/Environment.h @@ -20,8 +20,8 @@ class CLensFlareDescriptor; #define DAY_LENGTH 86400.f -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/EnvironmentRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/EnvironmentRender.h" #ifdef INGAME_EDITOR # define INGAME_EDITOR_VIRTUAL virtual diff --git a/src/xrEngine/Environment_misc.cpp b/src/xrEngine/Environment_misc.cpp index 32351540750..1b65bc63164 100644 --- a/src/xrEngine/Environment_misc.cpp +++ b/src/xrEngine/Environment_misc.cpp @@ -7,8 +7,8 @@ #include "rain.h" #include "IGame_Level.h" -#include "../xrServerEntities/object_broker.h" -#include "../xrServerEntities/LevelGameDef.h" +#include "xrServerEntities/object_broker.h" +#include "xrServerEntities/LevelGameDef.h" #include "securom_api.h" diff --git a/src/xrEngine/EventAPI.h b/src/xrEngine/EventAPI.h index 9571a947545..e62d9db26e6 100644 --- a/src/xrEngine/EventAPI.h +++ b/src/xrEngine/EventAPI.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrcore/xrSyncronize.h" +#include "xrCore/xrSyncronize.h" class ENGINE_API CEvent; typedef CEvent* EVENT; diff --git a/src/xrEngine/Feel_Vision.h b/src/xrEngine/Feel_Vision.h index 64e5e578b6f..6ebfae1664f 100644 --- a/src/xrEngine/Feel_Vision.h +++ b/src/xrEngine/Feel_Vision.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrcdb/xr_collide_defs.h" +#include "xrCDB/xr_collide_defs.h" #include "render.h" #include "pure_relcase.h" diff --git a/src/xrEngine/GameFont.cpp b/src/xrEngine/GameFont.cpp index b047bddb2fb..ddb2bb1e716 100644 --- a/src/xrEngine/GameFont.cpp +++ b/src/xrEngine/GameFont.cpp @@ -13,9 +13,9 @@ unsigned short int mbhMulti2Wide extern ENGINE_API BOOL g_bRendering; ENGINE_API Fvector2 g_current_font_scale = {1.0f, 1.0f}; -#include "../Include/xrAPI/xrAPI.h" -#include "../Include/xrRender/RenderFactory.h" -#include "../Include/xrRender/FontRender.h" +#include "Include/xrAPI/xrAPI.h" +#include "Include/xrRender/RenderFactory.h" +#include "Include/xrRender/FontRender.h" CGameFont::CGameFont(LPCSTR section, u32 flags) { diff --git a/src/xrEngine/GameFont.h b/src/xrEngine/GameFont.h index 9d01ea8eddf..16cb858e22a 100644 --- a/src/xrEngine/GameFont.h +++ b/src/xrEngine/GameFont.h @@ -4,7 +4,7 @@ #include "MbHelpers.h" -#include "../Include/xrRender/FontRender.h" +#include "Include/xrRender/FontRender.h" class ENGINE_API CGameFont { diff --git a/src/xrEngine/ICollidable.cpp b/src/xrEngine/ICollidable.cpp index 959f08d34d4..320ef4e1fc0 100644 --- a/src/xrEngine/ICollidable.cpp +++ b/src/xrEngine/ICollidable.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../xrcdb/ispatial.h" +#include "xrCDB/ispatial.h" #include "icollidable.h" #include "xr_collide_form.h" diff --git a/src/xrEngine/IGame_Level.cpp b/src/xrEngine/IGame_Level.cpp index 177e58b29f6..64b156e628a 100644 --- a/src/xrEngine/IGame_Level.cpp +++ b/src/xrEngine/IGame_Level.cpp @@ -143,7 +143,7 @@ bool IGame_Level::Load(u32 dwNum) } #ifndef _EDITOR -#include "../xrCPU_Pipe/ttapi.h" +#include "xrCPU_Pipe/ttapi.h" #endif int psNET_DedicatedSleep = 5; diff --git a/src/xrEngine/IGame_Level.h b/src/xrEngine/IGame_Level.h index 8835922fd3d..1bcf06ce301 100644 --- a/src/xrEngine/IGame_Level.h +++ b/src/xrEngine/IGame_Level.h @@ -5,7 +5,7 @@ #include "iinputreceiver.h" #include "xr_object_list.h" -#include "../xrcdb/xr_area.h" +#include "xrCDB/xr_area.h" // refs class ENGINE_API CCameraManager; diff --git a/src/xrEngine/IRenderable.cpp b/src/xrEngine/IRenderable.cpp index e9dbd311e7f..a6489e676e2 100644 --- a/src/xrEngine/IRenderable.cpp +++ b/src/xrEngine/IRenderable.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../xrcdb/ispatial.h" +#include "xrCDB/ispatial.h" #include "irenderable.h" IRenderable::IRenderable() diff --git a/src/xrEngine/LightAnimLibrary.h b/src/xrEngine/LightAnimLibrary.h index adb7051951f..188e4d1a4bf 100644 --- a/src/xrEngine/LightAnimLibrary.h +++ b/src/xrEngine/LightAnimLibrary.h @@ -4,7 +4,7 @@ #define LightAnimLibraryH //--------------------------------------------------------------------------- #ifdef _EDITOR -#include "../xrEProps/FolderLib.h" +#include "editors/xrEProps/FolderLib.h" #endif class ENGINE_API CLAItem diff --git a/src/xrEngine/ObjectAnimator.cpp b/src/xrEngine/ObjectAnimator.cpp index 6af7bb6bfac..314f5c87473 100644 --- a/src/xrEngine/ObjectAnimator.cpp +++ b/src/xrEngine/ObjectAnimator.cpp @@ -142,7 +142,7 @@ float CObjectAnimator::GetLength () #ifdef _EDITOR -#include "../ECORE/editor/d3dutils.h" +#include "editors/ECore/Editor/d3dutils.h" #include "envelope.h" static FvectorVec path_points; diff --git a/src/xrEngine/ObjectDump.cpp b/src/xrEngine/ObjectDump.cpp index 87f018dac5c..bcef6745c76 100644 --- a/src/xrEngine/ObjectDump.cpp +++ b/src/xrEngine/ObjectDump.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../xrengine/xr_object.h" +#include "xrEngine/xr_object.h" #ifdef DEBUG #include "ObjectDump.h" diff --git a/src/xrEngine/PS_instance.h b/src/xrEngine/PS_instance.h index f0736b55882..2bd234247ba 100644 --- a/src/xrEngine/PS_instance.h +++ b/src/xrEngine/PS_instance.h @@ -1,7 +1,7 @@ #ifndef _CPS_Instance_H_ #define _CPS_Instance_H_ -#include "../xrcdb/ispatial.h" +#include "xrCDB/ispatial.h" #include "isheduled.h" #include "irenderable.h" diff --git a/src/xrEngine/Rain.cpp b/src/xrEngine/Rain.cpp index 55d7b6daeb9..e669df3424f 100644 --- a/src/xrEngine/Rain.cpp +++ b/src/xrEngine/Rain.cpp @@ -10,7 +10,7 @@ #else #include "render.h" #include "igame_level.h" -#include "../xrcdb/xr_area.h" +#include "xrCDB/xr_area.h" #include "xr_object.h" #endif diff --git a/src/xrEngine/Rain.h b/src/xrEngine/Rain.h index f1cdae81b17..b9b9668a685 100644 --- a/src/xrEngine/Rain.h +++ b/src/xrEngine/Rain.h @@ -6,13 +6,13 @@ #define RainH #pragma once -#include "../xrcdb/xr_collide_defs.h" +#include "xrCDB/xr_collide_defs.h" //refs class ENGINE_API IRender_DetailModel; -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/RainRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/RainRender.h" // class ENGINE_API CEffect_Rain { diff --git a/src/xrEngine/Render.h b/src/xrEngine/Render.h index 8c7d729cecf..ff3b0d5b9a9 100644 --- a/src/xrEngine/Render.h +++ b/src/xrEngine/Render.h @@ -1,15 +1,15 @@ #ifndef _RENDER_H_ #define _RENDER_H_ -#include "../xrCDB/frustum.h" +#include "xrCDB/frustum.h" #include "vis_common.h" //#include "IRenderDetailModel.h" -#include "../Include/xrAPI/xrAPI.h" -#include "../Include/xrRender/FactoryPtr.h" +#include "Include/xrAPI/xrAPI.h" +#include "Include/xrRender/FactoryPtr.h" class IUIShader; typedef FactoryPtr wm_shader; -//#include "../Include/xrRender/WallMarkArray.h" +//#include "Include/xrRender/WallMarkArray.h" #ifdef _EDITOR //. #error you cant include this file in borland diff --git a/src/xrEngine/StatGraph.h b/src/xrEngine/StatGraph.h index 252565cf5e2..e9c6c438941 100644 --- a/src/xrEngine/StatGraph.h +++ b/src/xrEngine/StatGraph.h @@ -2,8 +2,8 @@ #ifndef StatGraphH #define StatGraphH -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/StatGraphRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/StatGraphRender.h" //--------------------------------------------------------------------------- class ENGINE_API CStatGraph : public pureRender diff --git a/src/xrEngine/Stats.cpp b/src/xrEngine/Stats.cpp index d1c77e28b54..458af4ffcc0 100644 --- a/src/xrEngine/Stats.cpp +++ b/src/xrEngine/Stats.cpp @@ -2,12 +2,12 @@ #include "GameFont.h" #pragma hdrstop -#include "../xrcdb/ISpatial.h" +#include "xrCDB/ISpatial.h" #include "IGame_Persistent.h" #include "render.h" #include "xr_object.h" -#include "../Include/xrRender/DrawUtils.h" +#include "Include/xrRender/DrawUtils.h" int g_ErrorLineCount = 15; Flags32 g_stats_flags = {0}; diff --git a/src/xrEngine/Stats.h b/src/xrEngine/Stats.h index 4f7726f541a..dc976bdc3c0 100644 --- a/src/xrEngine/Stats.h +++ b/src/xrEngine/Stats.h @@ -8,8 +8,8 @@ class ENGINE_API CGameFont; -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/StatsRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/StatsRender.h" DECLARE_MESSAGE(Stats); diff --git a/src/xrEngine/XR_IOConsole.cpp b/src/xrEngine/XR_IOConsole.cpp index 1ec0389b64e..c1acd863adc 100644 --- a/src/xrEngine/XR_IOConsole.cpp +++ b/src/xrEngine/XR_IOConsole.cpp @@ -13,7 +13,7 @@ #include "xr_ioc_cmd.h" #include "GameFont.h" -#include "../Include/xrRender/UIRender.h" +#include "Include/xrRender/UIRender.h" #include "securom_api.h" diff --git a/src/xrEngine/XR_IOConsole.h b/src/xrEngine/XR_IOConsole.h index 81060239cec..dc002389504 100644 --- a/src/xrEngine/XR_IOConsole.h +++ b/src/xrEngine/XR_IOConsole.h @@ -4,8 +4,8 @@ #ifndef XR_IOCONSOLE_H_INCLUDED #define XR_IOCONSOLE_H_INCLUDED -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/UIShader.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/UIShader.h" //refs class ENGINE_API CGameFont; diff --git a/src/xrEngine/Xr_input.cpp b/src/xrEngine/Xr_input.cpp index 6ae01e538fc..6d2d9f7d644 100644 --- a/src/xrEngine/Xr_input.cpp +++ b/src/xrEngine/Xr_input.cpp @@ -3,7 +3,7 @@ #include "xr_input.h" #include "IInputReceiver.h" -#include "../include/editor/ide.hpp" +#include "Include/editor/ide.hpp" #ifndef _EDITOR # include "xr_input_xinput.h" diff --git a/src/xrEngine/cf_dynamic_mesh.cpp b/src/xrEngine/cf_dynamic_mesh.cpp index 228aaf596db..f3ba58a0d51 100644 --- a/src/xrEngine/cf_dynamic_mesh.cpp +++ b/src/xrEngine/cf_dynamic_mesh.cpp @@ -4,8 +4,8 @@ #include "xr_object.h" -#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/Kinematics.h" #ifdef DEBUG #include "iphdebug.h" diff --git a/src/xrEngine/device.cpp b/src/xrEngine/device.cpp index 1b42b678a03..a9752ad874c 100644 --- a/src/xrEngine/device.cpp +++ b/src/xrEngine/device.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../xrCDB/frustum.h" +#include "xrCDB/frustum.h" #pragma warning(disable:4995) // mmsystem.h @@ -18,10 +18,10 @@ // must be defined before include of FS_impl.h #define INCLUDE_FROM_ENGINE -#include "../xrCore/FS_impl.h" +#include "xrCore/FS_impl.h" #ifdef INGAME_EDITOR -# include "../include/editor/ide.hpp" +# include "Include/editor/ide.hpp" # include "engine_impl.hpp" #endif // #ifdef INGAME_EDITOR diff --git a/src/xrEngine/device.h b/src/xrEngine/device.h index 1baf9741a6a..e7e38f1a21a 100644 --- a/src/xrEngine/device.h +++ b/src/xrEngine/device.h @@ -11,7 +11,7 @@ #include "pure.h" //#include "hw.h" -#include "../xrcore/ftimer.h" +#include "xrCore/ftimer.h" #include "stats.h" //#include "shader.h" //#include "R_Backend.h" @@ -20,11 +20,11 @@ #define DEVICE_RESET_PRECACHE_FRAME_COUNT 10 -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/RenderDeviceRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/RenderDeviceRender.h" #ifdef INGAME_EDITOR -# include "../Include/editor/interfaces.hpp" +# include "Include/editor/interfaces.hpp" #endif // #ifdef INGAME_EDITOR class engine_impl; diff --git a/src/xrEngine/editor_environment_ambients_ambient.hpp b/src/xrEngine/editor_environment_ambients_ambient.hpp index b606f3b02fe..672a8e7b32b 100644 --- a/src/xrEngine/editor_environment_ambients_ambient.hpp +++ b/src/xrEngine/editor_environment_ambients_ambient.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "property_collection_forward.hpp" #include "environment.h" diff --git a/src/xrEngine/editor_environment_ambients_effect_id.hpp b/src/xrEngine/editor_environment_ambients_effect_id.hpp index 575196d7b42..55707a40466 100644 --- a/src/xrEngine/editor_environment_ambients_effect_id.hpp +++ b/src/xrEngine/editor_environment_ambients_effect_id.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" namespace editor { diff --git a/src/xrEngine/editor_environment_ambients_sound_id.hpp b/src/xrEngine/editor_environment_ambients_sound_id.hpp index 18baf85b42c..5f9e5150f0a 100644 --- a/src/xrEngine/editor_environment_ambients_sound_id.hpp +++ b/src/xrEngine/editor_environment_ambients_sound_id.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" namespace editor { diff --git a/src/xrEngine/editor_environment_effects_effect.cpp b/src/xrEngine/editor_environment_effects_effect.cpp index 89b48911864..d425bf62016 100644 --- a/src/xrEngine/editor_environment_effects_effect.cpp +++ b/src/xrEngine/editor_environment_effects_effect.cpp @@ -11,7 +11,7 @@ #ifdef INGAME_EDITOR #include "editor_environment_effects_effect.hpp" -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "editor_environment_manager.hpp" #include "ide.hpp" #include "editor_environment_effects_manager.hpp" diff --git a/src/xrEngine/editor_environment_effects_effect.hpp b/src/xrEngine/editor_environment_effects_effect.hpp index 30e3255cd0a..08d722d6e48 100644 --- a/src/xrEngine/editor_environment_effects_effect.hpp +++ b/src/xrEngine/editor_environment_effects_effect.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "environment.h" namespace editor diff --git a/src/xrEngine/editor_environment_effects_manager.cpp b/src/xrEngine/editor_environment_effects_manager.cpp index bfd04ae408d..85acd64528e 100644 --- a/src/xrEngine/editor_environment_effects_manager.cpp +++ b/src/xrEngine/editor_environment_effects_manager.cpp @@ -2,7 +2,7 @@ #ifdef INGAME_EDITOR #include "editor_environment_effects_manager.hpp" -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "property_collection.hpp" #include "editor_environment_effects_effect.hpp" #include "editor_environment_detail.hpp" diff --git a/src/xrEngine/editor_environment_levels_manager.cpp b/src/xrEngine/editor_environment_levels_manager.cpp index da64a66ffdd..bb6455e3541 100644 --- a/src/xrEngine/editor_environment_levels_manager.cpp +++ b/src/xrEngine/editor_environment_levels_manager.cpp @@ -12,8 +12,8 @@ #include "editor_environment_levels_manager.hpp" #include "editor_environment_weathers_manager.hpp" -#include "../include/editor/property_holder.hpp" -#include "../include/editor/ide.hpp" +#include "Include/editor/property_holder.hpp" +#include "Include/editor/ide.hpp" #include "ide.hpp" using editor::environment::levels::manager; diff --git a/src/xrEngine/editor_environment_levels_manager.hpp b/src/xrEngine/editor_environment_levels_manager.hpp index 20b56f0af30..6ffe41a762b 100644 --- a/src/xrEngine/editor_environment_levels_manager.hpp +++ b/src/xrEngine/editor_environment_levels_manager.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../xrserverentities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" namespace editor { diff --git a/src/xrEngine/editor_environment_manager.cpp b/src/xrEngine/editor_environment_manager.cpp index 1174d1d1bfc..460ec7b3fd7 100644 --- a/src/xrEngine/editor_environment_manager.cpp +++ b/src/xrEngine/editor_environment_manager.cpp @@ -19,11 +19,11 @@ #include "editor_environment_weathers_manager.hpp" #include "editor_environment_detail.hpp" #include "ide.hpp" -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" #include "LightAnimLibrary.h" #include "editor_environment_weathers_time.hpp" -#include "../include/xrrender/particles_systems_library_interface.hpp" -#include "../Include/xrRender/RenderDeviceRender.h" +#include "Include/xrRender/particles_systems_library_interface.hpp" +#include "Include/xrRender/RenderDeviceRender.h" #include "editor_environment_ambients_ambient.hpp" #include "xr_efflensflare.h" diff --git a/src/xrEngine/editor_environment_sound_channels_channel.hpp b/src/xrEngine/editor_environment_sound_channels_channel.hpp index 3d90d6777cc..087b7f46686 100644 --- a/src/xrEngine/editor_environment_sound_channels_channel.hpp +++ b/src/xrEngine/editor_environment_sound_channels_channel.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "property_collection_forward.hpp" #include "environment.h" diff --git a/src/xrEngine/editor_environment_sound_channels_source.hpp b/src/xrEngine/editor_environment_sound_channels_source.hpp index 7f9c5da4738..2fd96903c68 100644 --- a/src/xrEngine/editor_environment_sound_channels_source.hpp +++ b/src/xrEngine/editor_environment_sound_channels_source.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" namespace editor { diff --git a/src/xrEngine/editor_environment_suns_blend.cpp b/src/xrEngine/editor_environment_suns_blend.cpp index e250cf7ab11..3db47271d13 100644 --- a/src/xrEngine/editor_environment_suns_blend.cpp +++ b/src/xrEngine/editor_environment_suns_blend.cpp @@ -10,7 +10,7 @@ #ifdef INGAME_EDITOR #include "editor_environment_suns_blend.hpp" -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" using editor::environment::suns::blend; using editor::environment::suns::manager; diff --git a/src/xrEngine/editor_environment_suns_flare.cpp b/src/xrEngine/editor_environment_suns_flare.cpp index e632f57f9af..5a4579bab55 100644 --- a/src/xrEngine/editor_environment_suns_flare.cpp +++ b/src/xrEngine/editor_environment_suns_flare.cpp @@ -10,7 +10,7 @@ #ifdef INGAME_EDITOR #include "editor_environment_suns_flare.hpp" -#include "../include/editor/ide.hpp" +#include "Include/editor/ide.hpp" #include "ide.hpp" #include "editor_environment_detail.hpp" diff --git a/src/xrEngine/editor_environment_suns_flare.hpp b/src/xrEngine/editor_environment_suns_flare.hpp index 2ac60ea5fd5..e5ae6e3cc1d 100644 --- a/src/xrEngine/editor_environment_suns_flare.hpp +++ b/src/xrEngine/editor_environment_suns_flare.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" namespace editor { diff --git a/src/xrEngine/editor_environment_suns_flares.cpp b/src/xrEngine/editor_environment_suns_flares.cpp index 396fd1913e8..cf8608c60c9 100644 --- a/src/xrEngine/editor_environment_suns_flares.cpp +++ b/src/xrEngine/editor_environment_suns_flares.cpp @@ -10,7 +10,7 @@ #ifdef INGAME_EDITOR #include "editor_environment_suns_flares.hpp" -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "property_collection.hpp" #include "editor_environment_suns_flare.hpp" #include "editor_environment_suns_manager.hpp" diff --git a/src/xrEngine/editor_environment_suns_gradient.cpp b/src/xrEngine/editor_environment_suns_gradient.cpp index 98edac68d49..5127821518a 100644 --- a/src/xrEngine/editor_environment_suns_gradient.cpp +++ b/src/xrEngine/editor_environment_suns_gradient.cpp @@ -10,7 +10,7 @@ #ifdef INGAME_EDITOR #include "editor_environment_suns_gradient.hpp" -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "editor_environment_suns_manager.hpp" #include "editor_environment_manager.hpp" #include "editor_environment_detail.hpp" diff --git a/src/xrEngine/editor_environment_suns_manager.cpp b/src/xrEngine/editor_environment_suns_manager.cpp index 39425a6e057..1336acb7f5b 100644 --- a/src/xrEngine/editor_environment_suns_manager.cpp +++ b/src/xrEngine/editor_environment_suns_manager.cpp @@ -11,9 +11,9 @@ #ifdef INGAME_EDITOR #include "editor_environment_suns_manager.hpp" #include "editor_environment_suns_sun.hpp" -#include "../include/editor/ide.hpp" -#include "../include/editor/property_holder.hpp" -#include "../xrServerEntities/object_broker.h" +#include "Include/editor/ide.hpp" +#include "Include/editor/property_holder.hpp" +#include "xrServerEntities/object_broker.h" #include "ide.hpp" #include "property_collection.hpp" #include "editor_environment_detail.hpp" diff --git a/src/xrEngine/editor_environment_suns_sun.cpp b/src/xrEngine/editor_environment_suns_sun.cpp index 0f9907deb78..e45cdda00a5 100644 --- a/src/xrEngine/editor_environment_suns_sun.cpp +++ b/src/xrEngine/editor_environment_suns_sun.cpp @@ -10,7 +10,7 @@ #ifdef INGAME_EDITOR #include "editor_environment_suns_sun.hpp" -#include "../include/editor/ide.hpp" +#include "Include/editor/ide.hpp" #include "editor_environment_manager.hpp" #include "ide.hpp" #include "editor_environment_detail.hpp" diff --git a/src/xrEngine/editor_environment_suns_sun.hpp b/src/xrEngine/editor_environment_suns_sun.hpp index 14d4f42d507..c7bfe7d6162 100644 --- a/src/xrEngine/editor_environment_suns_sun.hpp +++ b/src/xrEngine/editor_environment_suns_sun.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "xr_efflensflare.h" namespace editor diff --git a/src/xrEngine/editor_environment_thunderbolts_collection.hpp b/src/xrEngine/editor_environment_thunderbolts_collection.hpp index 4773aaa3775..7b4c7d3a6e9 100644 --- a/src/xrEngine/editor_environment_thunderbolts_collection.hpp +++ b/src/xrEngine/editor_environment_thunderbolts_collection.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "property_collection_forward.hpp" #include "thunderbolt.h" diff --git a/src/xrEngine/editor_environment_thunderbolts_gradient.hpp b/src/xrEngine/editor_environment_thunderbolts_gradient.hpp index 076c65b724c..a6dbb90a18c 100644 --- a/src/xrEngine/editor_environment_thunderbolts_gradient.hpp +++ b/src/xrEngine/editor_environment_thunderbolts_gradient.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "thunderbolt.h" namespace editor diff --git a/src/xrEngine/editor_environment_thunderbolts_thunderbolt.hpp b/src/xrEngine/editor_environment_thunderbolts_thunderbolt.hpp index 6e8413ec5c8..018c9a49296 100644 --- a/src/xrEngine/editor_environment_thunderbolts_thunderbolt.hpp +++ b/src/xrEngine/editor_environment_thunderbolts_thunderbolt.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "editor_environment_thunderbolts_gradient.hpp" #include "thunderbolt.h" diff --git a/src/xrEngine/editor_environment_thunderbolts_thunderbolt_id.hpp b/src/xrEngine/editor_environment_thunderbolts_thunderbolt_id.hpp index f857e170095..9a29dabafa4 100644 --- a/src/xrEngine/editor_environment_thunderbolts_thunderbolt_id.hpp +++ b/src/xrEngine/editor_environment_thunderbolts_thunderbolt_id.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" namespace editor { diff --git a/src/xrEngine/editor_environment_weathers_manager.cpp b/src/xrEngine/editor_environment_weathers_manager.cpp index 2e16ada7ec6..54f54b70a0e 100644 --- a/src/xrEngine/editor_environment_weathers_manager.cpp +++ b/src/xrEngine/editor_environment_weathers_manager.cpp @@ -12,8 +12,8 @@ #include "editor_environment_weathers_manager.hpp" #include "editor_environment_detail.hpp" #include "ide.hpp" -#include "../include/editor/property_holder.hpp" -#include "../xrServerEntities/object_broker.h" +#include "Include/editor/property_holder.hpp" +#include "xrServerEntities/object_broker.h" #include "editor_environment_weathers_weather.hpp" #include "editor_environment_weathers_time.hpp" #include "property_collection.hpp" diff --git a/src/xrEngine/editor_environment_weathers_time.hpp b/src/xrEngine/editor_environment_weathers_time.hpp index 89ff974e5fa..7845c3ba88e 100644 --- a/src/xrEngine/editor_environment_weathers_time.hpp +++ b/src/xrEngine/editor_environment_weathers_time.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "environment.h" namespace editor diff --git a/src/xrEngine/editor_environment_weathers_weather.hpp b/src/xrEngine/editor_environment_weathers_weather.hpp index 47b78b744f2..801538b42b3 100644 --- a/src/xrEngine/editor_environment_weathers_weather.hpp +++ b/src/xrEngine/editor_environment_weathers_weather.hpp @@ -12,7 +12,7 @@ #ifdef INGAME_EDITOR #include -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include "property_collection_forward.hpp" namespace editor diff --git a/src/xrEngine/engine_impl.hpp b/src/xrEngine/engine_impl.hpp index cf19ef6856d..31bb4ce1c7a 100644 --- a/src/xrEngine/engine_impl.hpp +++ b/src/xrEngine/engine_impl.hpp @@ -11,7 +11,7 @@ #ifdef INGAME_EDITOR -#include "../include/editor/engine.hpp" +#include "Include/editor/engine.hpp" class IInputReceiver; diff --git a/src/xrEngine/ide.hpp b/src/xrEngine/ide.hpp index d3d4821bfa1..7fa9e451f76 100644 --- a/src/xrEngine/ide.hpp +++ b/src/xrEngine/ide.hpp @@ -11,7 +11,7 @@ #ifdef INGAME_EDITOR -#include "../include/editor/ide.hpp" +#include "Include/editor/ide.hpp" namespace editor { diff --git a/src/xrEngine/line_edit_control.cpp b/src/xrEngine/line_edit_control.cpp index c76cf8330a6..1a8a3c819f6 100644 --- a/src/xrEngine/line_edit_control.cpp +++ b/src/xrEngine/line_edit_control.cpp @@ -8,8 +8,8 @@ #include "stdafx.h" #include "line_edit_control.h" -#include "../xrCore/os_clipboard.h" -#include "../xrServerEntities/object_broker.h" +#include "xrCore/os_clipboard.h" +#include "xrServerEntities/object_broker.h" #include "xr_input.h" #include "edit_actions.h" diff --git a/src/xrEngine/property_collection.hpp b/src/xrEngine/property_collection.hpp index 39ea5c3bd78..63f526af6fc 100644 --- a/src/xrEngine/property_collection.hpp +++ b/src/xrEngine/property_collection.hpp @@ -9,9 +9,9 @@ #ifndef PROPERTY_COLLECTION_HPP_INCLUDED #define PROPERTY_COLLECTION_HPP_INCLUDED -#include "../include/editor/property_holder.hpp" +#include "Include/editor/property_holder.hpp" #include -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" template class property_collection : diff --git a/src/xrEngine/stdafx.h b/src/xrEngine/stdafx.h index 79c0de04a0c..3189aa86935 100644 --- a/src/xrEngine/stdafx.h +++ b/src/xrEngine/stdafx.h @@ -16,8 +16,8 @@ # define _WIN32_WINNT 0x0550 #endif // #ifdef INGAME_EDITOR -#include "../xrCore/xrCore.h" -#include "../Include/xrAPI/xrAPI.h" +#include "xrCore/xrCore.h" +#include "Include/xrAPI/xrAPI.h" #ifdef _DEBUG # define D3D_DEBUG_INFO @@ -50,14 +50,14 @@ #include "engine.h" #include "defines.h" #ifndef NO_XRLOG -#include "../xrcore/log.h" +#include "xrCore/log.h" #endif #include "device.h" -#include "../xrcore/fs.h" +#include "xrCore/fs.h" -#include "../xrcdb/xrXRC.h" +#include "xrCDB/xrXRC.h" -#include "../xrSound/sound.h" +#include "xrSound/sound.h" extern ENGINE_API CInifile* pGameIni; diff --git a/src/xrEngine/thunderbolt.cpp b/src/xrEngine/thunderbolt.cpp index a2a3dde0f51..baa102786e3 100644 --- a/src/xrEngine/thunderbolt.cpp +++ b/src/xrEngine/thunderbolt.cpp @@ -12,7 +12,7 @@ #include "ui_toolscustom.h" #else #include "igame_level.h" -#include "../xrcdb/xr_area.h" +#include "xrCDB/xr_area.h" #include "xr_object.h" #endif diff --git a/src/xrEngine/thunderbolt.h b/src/xrEngine/thunderbolt.h index a08e8287af3..bb0bb4346f3 100644 --- a/src/xrEngine/thunderbolt.h +++ b/src/xrEngine/thunderbolt.h @@ -10,10 +10,10 @@ class ENGINE_API IRender_DetailModel; class ENGINE_API CLAItem; -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/LensFlareRender.h" -#include "../Include/xrRender/ThunderboltDescRender.h" -#include "../Include/xrRender/ThunderboltRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/LensFlareRender.h" +#include "Include/xrRender/ThunderboltDescRender.h" +#include "Include/xrRender/ThunderboltRender.h" #ifdef INGAME_EDITOR # define INGAME_EDITOR_VIRTUAL virtual diff --git a/src/xrEngine/x_ray.cpp b/src/xrEngine/x_ray.cpp index 18a1925788a..eb22d806939 100644 --- a/src/xrEngine/x_ray.cpp +++ b/src/xrEngine/x_ray.cpp @@ -11,7 +11,7 @@ #include "dedicated_server_only.h" #include "no_single.h" -#include "../xrNetServer/NET_AuthCheck.h" +#include "xrNetServer/NET_AuthCheck.h" #include "xr_input.h" #include "xr_ioconsole.h" @@ -20,7 +20,7 @@ #include "GameFont.h" #include "resource.h" #include "LightAnimLibrary.h" -#include "../xrcdb/ispatial.h" +#include "xrCDB/ispatial.h" #include "CopyProtection.h" #include "Text_Console.h" #include @@ -65,7 +65,7 @@ static int start_year = 1999; // 1999 #ifndef DEDICATED_SERVER -#include "../xrGameSpy/gamespy/md5c.c" +#include "xrGameSpy/gamespy/md5c.c" #include #define DEFAULT_MODULE_HASH "3CAABCFCFF6F3A810019C6A72180F166" diff --git a/src/xrEngine/x_ray.h b/src/xrEngine/x_ray.h index af6823a4d8a..8622c495b16 100644 --- a/src/xrEngine/x_ray.h +++ b/src/xrEngine/x_ray.h @@ -4,8 +4,8 @@ // refs class ENGINE_API CGameFont; -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/ApplicationRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/ApplicationRender.h" // definition class ENGINE_API CApplication : diff --git a/src/xrEngine/xrTheora_Stream.h b/src/xrEngine/xrTheora_Stream.h index 07644d3f421..0af7fafff97 100644 --- a/src/xrEngine/xrTheora_Stream.h +++ b/src/xrEngine/xrTheora_Stream.h @@ -3,7 +3,7 @@ #pragma once #include -#include "../xrCore/Stream_Reader.h" +#include "xrCore/Stream_Reader.h" class ENGINE_API CTheoraStream { diff --git a/src/xrEngine/xr_collide_form.h b/src/xrEngine/xr_collide_form.h index dd9dd6f9a4c..957b328f9da 100644 --- a/src/xrEngine/xr_collide_form.h +++ b/src/xrEngine/xr_collide_form.h @@ -1,7 +1,7 @@ #ifndef __XR_COLLIDE_FORM_H__ #define __XR_COLLIDE_FORM_H__ -#include "../xrcdb/xr_collide_defs.h" +#include "xrCDB/xr_collide_defs.h" // refs class ENGINE_API CObject; diff --git a/src/xrEngine/xr_efflensflare.h b/src/xrEngine/xr_efflensflare.h index 8c027c6bc63..3543e0fde40 100644 --- a/src/xrEngine/xr_efflensflare.h +++ b/src/xrEngine/xr_efflensflare.h @@ -1,10 +1,10 @@ #ifndef xr_efflensflareH #define xr_efflensflareH -#include "../xrcdb/xr_collide_defs.h" +#include "xrCDB/xr_collide_defs.h" -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/LensFlareRender.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/LensFlareRender.h" class ENGINE_API CInifile; class ENGINE_API CEnvironment; diff --git a/src/xrEngine/xr_ioc_cmd.cpp b/src/xrEngine/xr_ioc_cmd.cpp index 0902fb47ff7..abf53246b26 100644 --- a/src/xrEngine/xr_ioc_cmd.cpp +++ b/src/xrEngine/xr_ioc_cmd.cpp @@ -11,7 +11,7 @@ #include "xr_input.h" #include "CustomHUD.h" -#include "../Include/xrRender/RenderDeviceRender.h" +#include "Include/xrRender/RenderDeviceRender.h" #include "xr_object.h" diff --git a/src/xrEngine/xr_object.cpp b/src/xrEngine/xr_object.cpp index a0152f081e9..4863ef736ff 100644 --- a/src/xrEngine/xr_object.cpp +++ b/src/xrEngine/xr_object.cpp @@ -2,12 +2,12 @@ #include "igame_level.h" #include "xr_object.h" -#include "../xrcdb/xr_area.h" +#include "xrCDB/xr_area.h" #include "render.h" #include "xrLevel.h" //#include "fbasicvisual.h" -#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/Kinematics.h" #include "x_ray.h" #include "GameFont.h" diff --git a/src/xrEngine/xr_object.h b/src/xrEngine/xr_object.h index a72d3284de5..14dcb2fe43e 100644 --- a/src/xrEngine/xr_object.h +++ b/src/xrEngine/xr_object.h @@ -1,7 +1,7 @@ #ifndef __XR_OBJECT_H__ #define __XR_OBJECT_H__ -#include "../xrcdb/ispatial.h" +#include "xrCDB/ispatial.h" #include "isheduled.h" //#include "iinputreceiver.h" #include "irenderable.h" diff --git a/src/xrEngine/xr_object_list.cpp b/src/xrEngine/xr_object_list.cpp index 6bc901b7749..12724af4650 100644 --- a/src/xrEngine/xr_object_list.cpp +++ b/src/xrEngine/xr_object_list.cpp @@ -7,7 +7,7 @@ #include "std_classes.h" #include "xr_object.h" -#include "../xrCore/net_utils.h" +#include "xrCore/net_utils.h" #include "CustomHUD.h" diff --git a/src/xrGame/AI_PhraseDialogManager.cpp b/src/xrGame/AI_PhraseDialogManager.cpp index cff2297c704..e25cd228e73 100644 --- a/src/xrGame/AI_PhraseDialogManager.cpp +++ b/src/xrGame/AI_PhraseDialogManager.cpp @@ -28,7 +28,7 @@ void CAI_PhraseDialogManager::ReceivePhrase (DIALOG_SHARED_PTR& phrase_dialog) CPhraseDialogManager::ReceivePhrase(phrase_dialog); } #include "uigamesp.h" -#include "level.h" +#include "Level.h" #include "ui/UItalkWnd.h" void CAI_PhraseDialogManager::AnswerPhrase (DIALOG_SHARED_PTR& phrase_dialog) diff --git a/src/xrGame/ActivatingCharCollisionDelay.cpp b/src/xrGame/ActivatingCharCollisionDelay.cpp index 91e7a1bbb61..cce7dd811ac 100644 --- a/src/xrGame/ActivatingCharCollisionDelay.cpp +++ b/src/xrGame/ActivatingCharCollisionDelay.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "activatingcharcollisiondelay.h" -#include "characterphysicssupport.h" +#include "CharacterPhysicsSupport.h" #include "phmovementcontrol.h" #ifdef DEBUG #include "phdebug.h" diff --git a/src/xrGame/Actor.cpp b/src/xrGame/Actor.cpp index d577f8d5270..60cd76c2473 100644 --- a/src/xrGame/Actor.cpp +++ b/src/xrGame/Actor.cpp @@ -21,14 +21,14 @@ #include "CustomOutfit.h" #include "actorcondition.h" #include "UIGameCustom.h" -#include "../xrphysics/matrix_utils.h" +#include "xrPhysics/matrix_utils.h" #include "clsid_game.h" #include "game_cl_base_weapon_usage_statistic.h" #include "Grenade.h" #include "Torch.h" // breakpoints -#include "../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" // #include "Actor.h" #include "ActorAnimation.h" @@ -39,7 +39,7 @@ #include "trade.h" #include "inventory.h" //#include "Physics.h" -#include "level.h" +#include "Level.h" #include "GamePersistent.h" #include "game_cl_base.h" #include "game_cl_single.h" @@ -49,11 +49,11 @@ #include "xrCDB/Intersect.hpp" //#include "ExtendedGeom.h" #include "alife_registry_wrappers.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "artefact.h" #include "CharacterPhysicsSupport.h" #include "material_manager.h" -#include "../xrphysics/IColisiondamageInfo.h" +#include "xrPhysics/IColisiondamageInfo.h" #include "ui/UIMainIngameWnd.h" #include "map_manager.h" #include "GameTaskManager.h" @@ -66,7 +66,7 @@ #include "player_hud.h" #include "ai/monsters/basemonster/base_monster.h" -#include "../Include/xrRender/UIRender.h" +#include "Include/xrRender/UIRender.h" #include "ai_object_location.h" #include "ui/uiMotionIcon.h" diff --git a/src/xrGame/Actor.h b/src/xrGame/Actor.h index 46a619a806e..ee3bc1eeb02 100644 --- a/src/xrGame/Actor.h +++ b/src/xrGame/Actor.h @@ -1,17 +1,17 @@ #pragma once -#include "../xrEngine/feel_touch.h" -#include "../xrEngine/feel_sound.h" -#include "../xrEngine/iinputreceiver.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "xrEngine/feel_touch.h" +#include "xrEngine/feel_sound.h" +#include "xrEngine/iinputreceiver.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "actor_flags.h" #include "actor_defs.h" #include "fire_disp_controller.h" #include "entity_alive.h" #include "PHMovementControl.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "InventoryOwner.h" -#include "../xrEngine/StatGraph.h" +#include "xrEngine/StatGraph.h" #include "PhraseDialogManager.h" #include "ui_defs.h" diff --git a/src/xrGame/ActorAnimation.cpp b/src/xrGame/ActorAnimation.cpp index c7337731a17..147b5f6f8a5 100644 --- a/src/xrGame/ActorAnimation.cpp +++ b/src/xrGame/ActorAnimation.cpp @@ -5,7 +5,7 @@ #include "weapon.h" #include "inventory.h" #include "missile.h" -#include "level.h" +#include "Level.h" #ifdef DEBUG #include "PHDebug.h" #include "ui_base.h" @@ -13,7 +13,7 @@ #include "hit.h" #include "PHDestroyable.h" #include "Car.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ai_object_location.h" #include "game_cl_base.h" #include "xrCore/Animation/Motion.hpp" diff --git a/src/xrGame/ActorCameraCollision.cpp b/src/xrGame/ActorCameraCollision.cpp deleted file mode 100644 index b6b0dbb9563..00000000000 --- a/src/xrGame/ActorCameraCollision.cpp +++ /dev/null @@ -1,286 +0,0 @@ -#include "stdafx.h" - -#include "Actor.h" - -#include "../xrEngine/CameraBase.h" -#include "../xrEngine/gamemtllib.h" - -#include "phworld.h" -#include "phcollidevalidator.h" -#include "PHShell.h" -#include "matrix_utils.h" -#include "ai/stalker/ai_stalker.h" -#include "GeometryBits.h" -#include "characterphysicssupport.h" -#ifdef DEBUG -#include "phdebug.h" -#endif -CPhysicsShell* CActor::actor_camera_shell = NULL; - -static bool cam_collided = false; -static bool cam_step = false; -extern dJointGroupID ContactGroup; -static const float camera_collision_sckin_depth = 0.04f; -static const float camera_collision_character_sckin_depth = 0.5f; -static void cammera_shell_collide_callback( bool& do_collide, bool bo1, dContact& c, SGameMtl* material_1, SGameMtl* material_2 ) -{ - if( !do_collide ) - return; - do_collide = false; - SGameMtl* oposite_matrial = bo1 ? material_1 : material_2 ; - if(oposite_matrial->Flags.test(SGameMtl::flPassable)) - return; - - dxGeomUserData *my_data = retrieveGeomUserData( bo1 ? c.geom.g1 : c.geom.g2 ); - dxGeomUserData *oposite_data = retrieveGeomUserData( bo1 ? c.geom.g2 : c.geom.g1 ) ; - - VERIFY( my_data ); - if( oposite_data && oposite_data->ph_ref_object == my_data->ph_ref_object ) - return; - if( c.geom.depth > camera_collision_sckin_depth/2.f ) - cam_collided = true; - - if( !cam_step ) - return; - c.surface.mu = 0; - c.surface.soft_cfm =0.01f; - dJointID contact_joint = dJointCreateContactSpecial(0, ContactGroup, &c);//dJointCreateContact(0, ContactGroup, &c);// - CPHObject* obj = (CPHObject*)my_data->callback_data; - VERIFY( obj ); - - obj->Island().DActiveIsland()->ConnectJoint(contact_joint); - - if(bo1) - dJointAttach (contact_joint, dGeomGetBody(c.geom.g1), 0); - else - dJointAttach (contact_joint, 0, dGeomGetBody(c.geom.g2)); - -} -static void cammera_shell_character_collide_callback( bool& do_collide, bool bo1, dContact& c, SGameMtl* material_1, SGameMtl* material_2 ) -{ - dxGeomUserData *oposite_data = retrieveGeomUserData( bo1 ? c.geom.g2 : c.geom.g1 ) ; - do_collide = false; - if( !oposite_data || !oposite_data->ph_object || oposite_data->ph_object->CastType()!=CPHObject::tpCharacter) - return; - - if( !smart_cast(oposite_data->ph_ref_object) ) - return; - - do_collide = true; - cammera_shell_collide_callback(do_collide,bo1,c,material_1,material_2); -} - - -static void get_viewport_geom(Fvector &box, Fmatrix &form, const CCameraBase &camera , float _viewport_near ) -{ - box.z = _viewport_near / 2.f; - viewport_size ( _viewport_near, camera, box.x, box.y ); - form.identity(); - form.i.set( camera.Right() ); - form.j.set( camera.Up() ); - form.k.set( camera.Direction() ); - form.c.mad( camera.Position(), camera.Direction(), _viewport_near/2.f ); -#ifdef DEBUG - if( !_valid( form ) ) - { - dump( "form", form ); - dump( "camera.Right()", camera.Right() ); - dump( "camera.Up()", camera.Up() ); - dump( "camera.Direction()", camera.Direction() ); - dump( "camera.Position()", camera.Position() ); - dump( "box", box ); - VERIFY(false); - } -#endif -} - -static const float actor_camera_hudge_mass = 10.f; -static const float actor_camera_hudge_mass_size = 10000000.f; -CPhysicsShell * create_camera_shell( ) -{ - CGameObject *actor = smart_cast( Level().CurrentEntity() ); - VERIFY( Level().CurrentEntity() ); - CPhysicsShell *shell = P_build_SimpleShell( actor, actor_camera_hudge_mass , true ); - CPhysicsElement* roote = shell->get_ElementByStoreOrder( 0 ); - Fobb obb; obb.m_halfsize.set(0.5f,0.5f,0.5f); obb.m_rotate.identity();obb.m_translate.set(0,0,0); - //roote->add_Box(obb); - CODEGeom* character_test_geom = smart_cast(xr_new(obb)); - character_test_geom->build( Fvector().set( 0, 0, 0 ) );//roote->mass_Center() - character_test_geom->set_body( roote->get_body() ); - character_test_geom->set_ref_object(smart_cast(actor)); - CPHGeometryBits::set_ignore_static( *character_test_geom ); - roote->add_geom( character_test_geom ); - VERIFY( shell ); - shell->set_ApplyByGravity( false ); - shell->set_ObjectContactCallback( cammera_shell_collide_callback ); - character_test_geom->set_obj_contact_cb( cammera_shell_character_collide_callback ); - shell->set_ContactCallback( 0 ); - shell->set_CallbackData( smart_cast(shell) ); - dMass m; - dMassSetSphere(&m,1,actor_camera_hudge_mass_size ); - dMassAdjust( &m, actor_camera_hudge_mass ); - shell->setEquelInertiaForEls( m ); - VERIFY( roote ); - roote->set_local_mass_center( Fvector().set(0,0,0) ); - VERIFY( roote->numberOfGeoms() ); - CODEGeom *root_geom = roote->geometry( 0 ); - VERIFY( root_geom ); - root_geom->set_local_form_bt( Fidentity ); - shell->DisableCollision(); - shell->Disable(); - return shell; -} - - -#ifdef DEBUG -BOOL dbg_draw_camera_collision = FALSE; -#endif -const u16 cam_correction_steps_num = 100; -void update_current_entity_camera_collision( CPhysicsShellHolder* l_actor ) -{ - - if( CActor::actor_camera_shell && - CActor::actor_camera_shell->get_ElementByStoreOrder( 0 )->PhysicsRefObject() - != - l_actor ) - destroy_physics_shell( CActor::actor_camera_shell ); - - if( !CActor::actor_camera_shell ) - CActor::actor_camera_shell = create_camera_shell( ); -} - -void get_camera_box( Fvector &box_size, Fmatrix &xform, const CCameraBase & camera, float _viewport_near) -{ - get_viewport_geom ( box_size, xform, camera, _viewport_near ); - box_size.add(Fvector().set(camera_collision_sckin_depth,camera_collision_sckin_depth,camera_collision_sckin_depth)); -} -void get_old_camera_box( Fvector &old_box_size, Fmatrix &old_form, const CPhysicsElement *roote, const CBoxGeom* box ) -{ - roote->GetGlobalTransformDynamic( &old_form ); - box->get_size( old_box_size ); -} - -void set_camera_collision( const Fvector &box_size, const Fmatrix &xform, CPhysicsElement *roote, CBoxGeom* box ) -{ - box->set_size( box_size ); - CBoxGeom* character_collision_geom = smart_cast( roote->geometry( 1 ) ); - VERIFY( character_collision_geom ); - const Fvector character_collision_box_size = - Fvector().add( box_size, - Fvector().set( camera_collision_character_sckin_depth, - camera_collision_character_sckin_depth, - camera_collision_character_sckin_depth - ) - ); - character_collision_geom->set_size( character_collision_box_size ); - VERIFY( _valid(xform) ); - roote->SetTransform( xform ); -} - -void do_collide_and_move(const Fmatrix &xform, CPhysicsShellHolder* l_actor, CPhysicsShell *shell, CPhysicsElement *roote ) -{ - /////////////////////////////////////////////////////////////////// - VERIFY( ph_world ); - VERIFY( !ph_world->Processing() ); - cam_collided = false; - cam_step = false; - VERIFY( l_actor ); - VERIFY( l_actor->character_physics_support() ); - VERIFY( l_actor->character_physics_support()->movement() ); - l_actor->character_physics_support()->movement()->CollisionEnable( FALSE ); - shell->EnableCollision(); - shell->CollideAll(); - - if(cam_collided) - { - cam_step = true; - for( u16 i = 0; i < cam_correction_steps_num; ++i ) - { - shell->set_LinearVel( Fvector().set(0,0,0) ); - shell->set_AngularVel( Fvector().set(0,0,0) ); - roote->setQuaternion( Fquaternion().set( xform ) ); - cam_collided = false; - shell->PureStep(); - if( !cam_collided ) - break; - } - cam_step = false; - } - shell->DisableCollision(); - l_actor->character_physics_support()->movement()->CollisionEnable( TRUE ); - shell->Disable(); -} - -bool do_collide_not_move(const Fmatrix &xform, CPhysicsShellHolder* l_actor, CPhysicsShell *shell, CPhysicsElement *roote) -{ - /////////////////////////////////////////////////////////////////// - VERIFY( ph_world ); - VERIFY( !ph_world->Processing() ); - cam_collided = false; - cam_step = false; - VERIFY( l_actor ); - VERIFY( l_actor->character_physics_support() ); - VERIFY( l_actor->character_physics_support()->movement() ); - l_actor->character_physics_support()->movement()->CollisionEnable( FALSE ); - shell->EnableCollision(); - shell->CollideAll(); - shell->DisableCollision(); - l_actor->character_physics_support()->movement()->CollisionEnable( TRUE ); - shell->Disable(); - return cam_collided; -} - -bool test_camera_box( const Fvector &box_size, const Fmatrix &xform ) -{ - CPhysicsShellHolder* l_actor = smart_cast( Level().CurrentEntity() ); - update_current_entity_camera_collision( l_actor ); - - CPhysicsShell *shell = CActor::actor_camera_shell; - VERIFY( shell ); - CPhysicsElement *roote = shell->get_ElementByStoreOrder( 0 ); - VERIFY( roote ); - CODEGeom *root_geom = roote->geometry( 0 ); - VERIFY( root_geom ); - CBoxGeom* box = smart_cast( root_geom ); - VERIFY( box ); - Fvector old_box_size; Fmatrix old_form; - get_old_camera_box( old_box_size, old_form, roote, box ); - - set_camera_collision( box_size, xform, roote, box ); - bool ret = do_collide_not_move( xform, l_actor, shell, roote ); - set_camera_collision( old_box_size, old_form, roote, box ); - - return ret; -} - -void collide_camera( CCameraBase & camera, float _viewport_near ) -{ - CPhysicsShellHolder* l_actor = smart_cast( Level().CurrentEntity() ); - update_current_entity_camera_collision( l_actor ); - Fvector box_size; Fmatrix xform; - get_camera_box( box_size, xform , camera, _viewport_near ); - CPhysicsShell *shell = CActor::actor_camera_shell; - VERIFY( shell ); - CPhysicsElement *roote = shell->get_ElementByStoreOrder( 0 ); - VERIFY( roote ); - CODEGeom *root_geom = roote->geometry( 0 ); - VERIFY( root_geom ); - CBoxGeom* box = smart_cast( root_geom ); - VERIFY( box ); - Fvector old_box_size; Fmatrix old_form; - get_old_camera_box( old_box_size, old_form, roote, box ); - if( clamp_change( old_form, xform, EPS,EPS,EPS,EPS) && Fvector().sub( old_box_size, box_size ).magnitude() < EPS ) - return; - set_camera_collision( box_size, xform, roote, box ); -#ifdef DEBUG - if( dbg_draw_camera_collision ) - shell->dbg_draw_geometry( 1, D3DCOLOR_XRGB(0, 0, 255 ) ); -#endif - do_collide_and_move( xform, l_actor, shell, roote ); -#ifdef DEBUG - if( dbg_draw_camera_collision ) - shell->dbg_draw_geometry( 1, D3DCOLOR_XRGB(0, 255, 0 ) ); -#endif - roote->GetGlobalPositionDynamic( &camera.vPosition ); - camera.vPosition.mad( camera.Direction(), -_viewport_near/2.f ); -} \ No newline at end of file diff --git a/src/xrGame/ActorCameras.cpp b/src/xrGame/ActorCameras.cpp index 7fc7de15e7c..d01d4a9f1a4 100644 --- a/src/xrGame/ActorCameras.cpp +++ b/src/xrGame/ActorCameras.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "Actor.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" #ifdef DEBUG #include "PHDebug.h" #endif @@ -13,7 +13,7 @@ #include "SleepEffector.h" #include "ActorEffector.h" -#include "level.h" +#include "Level.h" #include "xrCDB/Intersect.hpp" //#include "elevatorstate.h" @@ -21,8 +21,8 @@ #include "EffectorShot.h" #include "PHMovementControl.h" -#include "../xrphysics/ielevatorstate.h" -#include "../xrphysics/actorcameracollision.h" +#include "xrPhysics/ielevatorstate.h" +#include "xrPhysics/actorcameracollision.h" #include "IKLimbsController.h" #include "GamePersistent.h" diff --git a/src/xrGame/ActorCondition.cpp b/src/xrGame/ActorCondition.cpp index 0a18bd751de..73b4e777a9b 100644 --- a/src/xrGame/ActorCondition.cpp +++ b/src/xrGame/ActorCondition.cpp @@ -3,7 +3,7 @@ #include "actor.h" #include "actorEffector.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "sleepeffector.h" #include "game_base_space.h" #include "autosave_manager.h" @@ -392,7 +392,7 @@ void CActorCondition::AffectDamage_InjuriousMaterialAndMonstersInfluence() }//while } -#include "characterphysicssupport.h" +#include "CharacterPhysicsSupport.h" float CActorCondition::GetInjuriousMaterialDamage() { u16 mat_injurios = m_object->character_physics_support()->movement()->injurious_material_idx(); diff --git a/src/xrGame/ActorEffector.cpp b/src/xrGame/ActorEffector.cpp index c215123d1b8..9e7bcf0006a 100644 --- a/src/xrGame/ActorEffector.cpp +++ b/src/xrGame/ActorEffector.cpp @@ -2,8 +2,8 @@ #include "ActorEffector.h" #include "PostprocessAnimator.h" -#include "../xrEngine/effectorPP.h" -#include "../xrEngine/ObjectAnimator.h" +#include "xrEngine/effectorPP.h" +#include "xrEngine/ObjectAnimator.h" #include "object_broker.h" #include "actor.h" diff --git a/src/xrGame/ActorEffector_script.cpp b/src/xrGame/ActorEffector_script.cpp index cdbe09a47ab..6ed988d05aa 100644 --- a/src/xrGame/ActorEffector_script.cpp +++ b/src/xrGame/ActorEffector_script.cpp @@ -2,7 +2,7 @@ #include "ai_space.h" #include "script_engine.h" #include "ActorEffector.h" -#include "../xrEngine/ObjectAnimator.h" +#include "xrEngine/ObjectAnimator.h" void CAnimatorCamEffectorScriptCB::ProcessIfInvalid(SCamEffectorInfo& info) { diff --git a/src/xrGame/ActorHelmet.cpp b/src/xrGame/ActorHelmet.cpp index 65e57992fa4..b008041fe30 100644 --- a/src/xrGame/ActorHelmet.cpp +++ b/src/xrGame/ActorHelmet.cpp @@ -4,7 +4,7 @@ #include "Inventory.h" #include "Torch.h" #include "BoneProtections.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" //#include "CustomOutfit.h" CHelmet::CHelmet() diff --git a/src/xrGame/ActorInput.cpp b/src/xrGame/ActorInput.cpp index a646552c79b..145fdd1598d 100644 --- a/src/xrGame/ActorInput.cpp +++ b/src/xrGame/ActorInput.cpp @@ -3,7 +3,7 @@ #include "Actor.h" #include "Torch.h" #include "trade.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" #ifdef DEBUG # include "PHDebug.h" @@ -14,7 +14,7 @@ #include "Car.h" #include "UIGameSP.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" #include "xr_level_controller.h" #include "UsableScriptObject.h" @@ -27,7 +27,7 @@ #include "CharacterPhysicsSupport.h" #include "InventoryBox.h" #include "player_hud.h" -#include "../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" #include "flare.h" #include "CustomDetector.h" #include "clsid_game.h" diff --git a/src/xrGame/ActorMountedWeapon.cpp b/src/xrGame/ActorMountedWeapon.cpp index 6a26da0622f..0c233c9b7c9 100644 --- a/src/xrGame/ActorMountedWeapon.cpp +++ b/src/xrGame/ActorMountedWeapon.cpp @@ -2,7 +2,7 @@ #pragma hdrstop #include "actor.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" #include "ActorEffector.h" #include "CharacterPhysicsSupport.h" diff --git a/src/xrGame/ActorVehicle.cpp b/src/xrGame/ActorVehicle.cpp index 5093a9ca6e7..e1a975af7d9 100644 --- a/src/xrGame/ActorVehicle.cpp +++ b/src/xrGame/ActorVehicle.cpp @@ -2,7 +2,7 @@ #pragma hdrstop #include "actor.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" #include "ActorEffector.h" #include "holder_custom.h" @@ -13,12 +13,12 @@ #include "hit.h" #include "PHDestroyable.h" #include "Car.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" //#include "PHShellSplitter.h" #include "actor_anim_defs.h" #include "game_object_space.h" -#include "characterphysicssupport.h" +#include "CharacterPhysicsSupport.h" #include "inventory.h" void CActor::attach_Vehicle(CHolderCustom* vehicle) diff --git a/src/xrGame/Actor_Events.cpp b/src/xrGame/Actor_Events.cpp index 08cfee019cd..accd207450e 100644 --- a/src/xrGame/Actor_Events.cpp +++ b/src/xrGame/Actor_Events.cpp @@ -7,7 +7,7 @@ #include "silencer.h" #include "grenadelauncher.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "xr_level_controller.h" #include "FoodItem.h" #include "ActorCondition.h" diff --git a/src/xrGame/Actor_Feel.cpp b/src/xrGame/Actor_Feel.cpp index 7c5504b1c0b..1aebc17fb63 100644 --- a/src/xrGame/Actor_Feel.cpp +++ b/src/xrGame/Actor_Feel.cpp @@ -144,7 +144,7 @@ void CActor::PickupModeUpdate() } } -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" BOOL g_b_COD_PickUpMode = TRUE; void CActor::PickupModeUpdate_COD () { diff --git a/src/xrGame/Actor_Movement.cpp b/src/xrGame/Actor_Movement.cpp index 03612c33f90..7a04ae028b0 100644 --- a/src/xrGame/Actor_Movement.cpp +++ b/src/xrGame/Actor_Movement.cpp @@ -3,10 +3,10 @@ #include "actor.h" #include "inventory.h" #include "weapon.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" #include "xrMessages.h" -#include "level.h" +#include "Level.h" #include "UIGameCustom.h" #include "string_table.h" #include "actorcondition.h" diff --git a/src/xrGame/Actor_Network.cpp b/src/xrGame/Actor_Network.cpp index 1ae7c804b17..53debb20acb 100644 --- a/src/xrGame/Actor_Network.cpp +++ b/src/xrGame/Actor_Network.cpp @@ -5,20 +5,20 @@ #include "inventory.h" #include "xrserver_objects_alife_monsters.h" #include "xrServer.h" -#include "../xrEngine/CustomHUD.h" +#include "xrEngine/CustomHUD.h" #include "CameraLook.h" #include "CameraFirstEye.h" #include "ActorEffector.h" -#include "../xrphysics/iPHWorld.h" -#include "../xrphysics/actorcameracollision.h" -#include "level.h" +#include "xrPhysics/iPHWorld.h" +#include "xrPhysics/actorcameracollision.h" +#include "Level.h" #include "xr_level_controller.h" #include "game_cl_base.h" #include "infoportion.h" #include "alife_registry_wrappers.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "client_spawn_manager.h" #include "hit.h" #include "PHDestroyable.h" @@ -43,12 +43,12 @@ #include "holder_custom.h" #include "actor_memory.h" #include "actor_statistic_mgr.h" -#include "characterphysicssupport.h" +#include "CharacterPhysicsSupport.h" #include "game_cl_base_weapon_usage_statistic.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" #ifdef DEBUG # include "debug_renderer.h" -# include "../xrPhysics/phvalide.h" +# include "xrPhysics/phvalide.h" #endif int g_cl_InterpolationType = 0; diff --git a/src/xrGame/Actor_Weapon.cpp b/src/xrGame/Actor_Weapon.cpp index 2018ee7425d..6782b35720f 100644 --- a/src/xrGame/Actor_Weapon.cpp +++ b/src/xrGame/Actor_Weapon.cpp @@ -9,7 +9,7 @@ #include "inventory.h" #include "weapon.h" #include "map_manager.h" -#include "level.h" +#include "Level.h" #include "CharacterPhysicsSupport.h" #include "EffectorShot.h" #include "WeaponMagazined.h" diff --git a/src/xrGame/AdvancedDetector.cpp b/src/xrGame/AdvancedDetector.cpp index a0f2e5ba88c..dde0842daaa 100644 --- a/src/xrGame/AdvancedDetector.cpp +++ b/src/xrGame/AdvancedDetector.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "AdvancedDetector.h" #include "ui/ArtefactDetectorUI.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "player_hud.h" #include "game_object_space.h" diff --git a/src/xrGame/AmebaZone.cpp b/src/xrGame/AmebaZone.cpp deleted file mode 100644 index 1ef948a264d..00000000000 --- a/src/xrGame/AmebaZone.cpp +++ /dev/null @@ -1,111 +0,0 @@ -#include "stdafx.h" -/* -#include "CustomZone.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "ZoneVisual.h" -#include "PHObject.h" -#include "PHMovementControl.h" -#include "AmebaZone.h" -#include "hudmanager.h" -#include "level.h" -#include "entity_alive.h" -#include "CharacterPhysicsSupport.h" - -CAmebaZone::CAmebaZone() -{ - m_fVelocityLimit=1.f; -} - -CAmebaZone::~CAmebaZone() -{ -} - -void CAmebaZone::Load(LPCSTR section) -{ - inherited::Load (section); - m_fVelocityLimit = pSettings->r_float(section,"max_velocity_in_zone"); -} - -bool CAmebaZone::BlowoutState() -{ - bool result = inherited::BlowoutState(); - if(!result) - UpdateBlowout (); - - for(OBJECT_INFO_VEC_IT it = m_ObjectInfoMap.begin(); m_ObjectInfoMap.end() != it; ++it) - Affect (&(*it)); - - return result; -} - -void CAmebaZone::Affect(SZoneObjectInfo* O) -{ - CPhysicsShellHolder *pGameObject = smart_cast(O->object); - if(!pGameObject) return; - - if(O->zone_ignore) return; - - Fvector hit_dir; - hit_dir.set(::Random.randF(-.5f,.5f), - ::Random.randF(.0f,1.f), - ::Random.randF(-.5f,.5f)); - hit_dir.normalize(); - - - Fvector position_in_bone_space; - - float power = Power(distance_to_center(O->object)); - float power_critical = 0.0f; - float impulse = m_fHitImpulseScale*power*pGameObject->GetMass(); - - if(power > 0.01f) - { - m_dwDeltaTime = 0; - position_in_bone_space.set(0.f,0.f,0.f); - - CreateHit(pGameObject->ID(),ID(),hit_dir,power,power_critical,0,position_in_bone_space,impulse,m_eHitTypeBlowout); - - PlayHitParticles(pGameObject); - } -} - -void CAmebaZone::PhTune(dReal step) -{ - OBJECT_INFO_VEC_IT it; - for(it = m_ObjectInfoMap.begin(); m_ObjectInfoMap.end() != it; ++it) - { - CEntityAlive* EA = smart_cast((*it).object); - if(EA) - { - CPHMovementControl* mc = EA->character_physics_support()->movement(); - if(mc) - { - if(distance_to_center(EA)SetVelocityLimit(m_fVelocityLimit); - } - } - } -} - -void CAmebaZone::SwitchZoneState(EZoneState new_state) -{ - if(new_state==eZoneStateBlowout&&m_eZoneState!=eZoneStateBlowout) - { - CPHUpdateObject::Activate(); - } - - if(new_state!=eZoneStateBlowout&&m_eZoneState==eZoneStateBlowout) - { - CPHUpdateObject::Deactivate(); - } - inherited::SwitchZoneState(new_state); -} - -float CAmebaZone::distance_to_center(CObject* O) -{ - Fvector P; - XFORM().transform_tiny(P,CFORM()->getSphere().P); - Fvector OP;OP.set(O->Position()); - return _sqrt((P.x-OP.x)*(P.x-OP.x)+(P.x-OP.x)*(P.x-OP.x)); -} -*/ \ No newline at end of file diff --git a/src/xrGame/AmebaZone.h b/src/xrGame/AmebaZone.h deleted file mode 100644 index 42596403743..00000000000 --- a/src/xrGame/AmebaZone.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -/* -class CAmebaZone : - public CVisualZone, - public CPHUpdateObject -{ -typedef CVisualZone inherited; -float m_fVelocityLimit; -public: - CAmebaZone () ; - ~CAmebaZone () ; - virtual void Affect (SZoneObjectInfo* O) ; - -protected: - virtual void PhTune (dReal step) ; - virtual void PhDataUpdate (dReal step) {;} - virtual bool BlowoutState () ; - virtual void SwitchZoneState (EZoneState new_state) ; - virtual void Load (LPCSTR section) ; - virtual float distance_to_center (CObject* O) ; -}; -*/ \ No newline at end of file diff --git a/src/xrGame/Artefact.cpp b/src/xrGame/Artefact.cpp index 21f1051da6f..3b0097f77e7 100644 --- a/src/xrGame/Artefact.cpp +++ b/src/xrGame/Artefact.cpp @@ -1,19 +1,19 @@ #include "stdafx.h" #include "artefact.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "PhysicsShellHolder.h" #include "game_cl_base.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "ai_object_location.h" #include "xrServer_Objects_ALife_Monsters.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphworld.h" #include "restriction_space.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #include "artefact_activation.h" diff --git a/src/xrGame/Artefact.h b/src/xrGame/Artefact.h index 66796ff7030..7d01a3042df 100644 --- a/src/xrGame/Artefact.h +++ b/src/xrGame/Artefact.h @@ -2,7 +2,7 @@ #include "hud_item_object.h" #include "hit_immunity.h" -#include "../xrphysics/PHUpdateObject.h" +#include "xrPhysics/PHUpdateObject.h" #include "script_export_space.h" #include "patrol_path.h" diff --git a/src/xrGame/Artifact.cpp b/src/xrGame/Artifact.cpp deleted file mode 100644 index 0db9cd91750..00000000000 --- a/src/xrGame/Artifact.cpp +++ /dev/null @@ -1,749 +0,0 @@ -#include "stdafx.h" -#include "artifact.h" -#include "PhysicsShell.h" -#include "PhysicsShellHolder.h" -#include "game_cl_base.h" - -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" - -#include "inventory.h" -#include "level.h" -#include "ai_object_location.h" -#include "xrServer_Objects_ALife_Monsters.h" -#include "phworld.h" -#include "restriction_space.h" -#include "../xrEngine/IGame_Persistent.h" - -#include "ai_space.h" -#include "patrol_path.h" -#include "patrol_path_storage.h" - -#define FASTMODE_DISTANCE (50.f) //distance to camera from sphere, when zone switches to fast update sequence - -#define CHOOSE_MAX(x,inst_x,y,inst_y,z,inst_z)\ - if(x>y)\ - if(x>z){inst_x;}\ - else{inst_z;}\ - else\ - if(y>z){inst_y;}\ - else{inst_z;} - -struct SArtefactActivation{ - enum EActivationStates {eNone=0, eStarting, eFlying, eBeforeSpawn, eSpawnZone, eMax}; - struct SStateDef{ - float m_time; - shared_str m_snd; - Fcolor m_light_color; - float m_light_range; - shared_str m_particle; - shared_str m_animation; - - SStateDef ():m_time(0.0f){}; - void Load (LPCSTR section, LPCSTR name); - }; - - SArtefactActivation (CArtefact* af, u32 owner_id); - ~SArtefactActivation (); - CArtefact* m_af; - svector m_activation_states; - EActivationStates m_cur_activation_state; - float m_cur_state_time; - - ref_light m_light; - ref_sound m_snd; - - u32 m_owner_id; - - void UpdateActivation (); - void Load (); - void Start (); - void ChangeEffects (); - void UpdateEffects (); - void SpawnAnomaly (); - void PhDataUpdate (dReal step); -}; - - -CArtefact::CArtefact() -{ - shedule.t_min = 20; - shedule.t_max = 50; - m_sParticlesName = NULL; - m_pTrailLight = NULL; - m_activationObj = NULL; - m_detectorObj = NULL; -} - - -CArtefact::~CArtefact() -{} - -void CArtefact::Load(LPCSTR section) -{ - inherited::Load (section); - - - if (pSettings->line_exist(section, "particles")) - m_sParticlesName = pSettings->r_string(section, "particles"); - - m_bLightsEnabled = !!pSettings->r_bool(section, "lights_enabled"); - if(m_bLightsEnabled){ - sscanf(pSettings->r_string(section,"trail_light_color"), "%f,%f,%f", - &m_TrailLightColor.r, &m_TrailLightColor.g, &m_TrailLightColor.b); - m_fTrailLightRange = pSettings->r_float(section,"trail_light_range"); - } - - - m_fHealthRestoreSpeed = pSettings->r_float (section,"health_restore_speed" ); - m_fRadiationRestoreSpeed = pSettings->r_float (section,"radiation_restore_speed" ); - m_fSatietyRestoreSpeed = pSettings->r_float (section,"satiety_restore_speed" ); - m_fPowerRestoreSpeed = pSettings->r_float (section,"power_restore_speed" ); - m_fBleedingRestoreSpeed = pSettings->r_float (section,"bleeding_restore_speed" ); - - if(pSettings->section_exist(pSettings->r_string(section,"hit_absorbation_sect"))) - { - m_ArtefactHitImmunities.LoadImmunities(pSettings->r_string(section,"hit_absorbation_sect"),pSettings); - } - m_bCanSpawnZone = !!pSettings->line_exist("artefact_spawn_zones", section); - m_af_rank = pSettings->r_u8(section, "af_rank"); -} - -BOOL CArtefact::net_Spawn(CSE_Abstract* DC) -{ - if(pSettings->r_bool(cNameSect(),"can_be_controlled") ) - m_detectorObj = xr_new(this); - - BOOL result = inherited::net_Spawn(DC); - if (m_sParticlesName.c_str()) - { - Fvector dir; - dir.set(0,1,0); - CParticlesPlayer::StartParticles(m_sParticlesName,dir,ID(),-1, false); - } - - VERIFY (m_pTrailLight == NULL); - m_pTrailLight = ::Render->light_create(); - m_pTrailLight->set_shadow (true); - - StartLights(); - m_CarringBoneID = u16(-1); - IKinematicsAnimated *K = smart_cast(Visual()); - if(K) - K->PlayCycle("idle"); - - o_fastmode = FALSE; // start initially with fast-mode enabled - o_render_frame = 0; - SetState (eHidden); - - return result; -} - -void CArtefact::net_Destroy() -{ - inherited::net_Destroy (); - - StopLights (); - m_pTrailLight.destroy (); - CPHUpdateObject::Deactivate (); - xr_delete (m_activationObj); - xr_delete (m_detectorObj); -} - -void CArtefact::OnH_A_Chield() -{ - inherited::OnH_A_Chield (); - - StopLights(); - if (IsGameTypeSingle()) - { - if (m_sParticlesName.c_str()) - { - CParticlesPlayer::StopParticles(m_sParticlesName, BI_NONE, true); - } - } - else - { - IKinematics* K = smart_cast(H_Parent()->Visual()); - if (K) - m_CarringBoneID = K->LL_BoneID("bip01_head"); - else - m_CarringBoneID = u16(-1); - } - if(m_detectorObj) - { - m_detectorObj->m_currPatrolPath = NULL; - m_detectorObj->m_currPatrolVertex = NULL; - } -} - -void CArtefact::OnH_B_Independent(bool just_before_destroy) -{ - VERIFY(!ph_world->Processing()); - inherited::OnH_B_Independent(just_before_destroy); - - StartLights(); - if (m_sParticlesName.c_str()) - { - Fvector dir; - dir.set(0,1,0); - CParticlesPlayer::StartParticles(m_sParticlesName,dir,ID(),-1, false); - } -} - -// called only in "fast-mode" -void CArtefact::UpdateCL () -{ - inherited::UpdateCL (); - - if (o_fastmode || m_activationObj) - UpdateWorkload (Device.dwTimeDelta); - -} - -void CArtefact::UpdateWorkload (u32 dt) -{ - - VERIFY(!ph_world->Processing()); - // particles - velocity - Fvector vel = {0, 0, 0}; - if (H_Parent()) - { - CPhysicsShellHolder* pPhysicsShellHolder = smart_cast(H_Parent()); - if(pPhysicsShellHolder) pPhysicsShellHolder->PHGetLinearVell(vel); - } - CParticlesPlayer::SetParentVel (vel); - - // - UpdateLights (); - if(m_activationObj) - { - CPHUpdateObject::Activate (); - m_activationObj->UpdateActivation (); - return; - } - - // custom-logic - UpdateCLChild (); -} - -void CArtefact::shedule_Update (u32 dt) -{ - inherited::shedule_Update (dt); - - ////////////////////////////////////////////////////////////////////////// - // check "fast-mode" border - if (H_Parent()) o_switch_2_slow (); - else { - Fvector center; Center(center); - BOOL rendering = (Device.dwFrame==o_render_frame); - float cam_distance = Device.vCameraPosition.distance_to(center)-Radius(); - if (rendering || (cam_distance < FASTMODE_DISTANCE)) o_switch_2_fast (); - else o_switch_2_slow (); - } - if (!o_fastmode) UpdateWorkload (dt); - - if(!H_Parent() && m_detectorObj) - { - m_detectorObj->UpdateOnFrame(); - } -} - - -void CArtefact::create_physic_shell () -{ - m_pPhysicsShell=P_build_Shell(this,false); - m_pPhysicsShell->Deactivate(); -} - -void CArtefact::StartLights() -{ - VERIFY(!ph_world->Processing()); - if(!m_bLightsEnabled) return; - - m_pTrailLight->set_color (m_TrailLightColor); - m_pTrailLight->set_range (m_fTrailLightRange); - m_pTrailLight->set_position (Position()); - m_pTrailLight->set_active (true); -} - -void CArtefact::StopLights() -{ - VERIFY(!ph_world->Processing()); - if(!m_bLightsEnabled) return; - m_pTrailLight->set_active(false); -} - -void CArtefact::UpdateLights() -{ - VERIFY(!ph_world->Processing()); - if(!m_bLightsEnabled || !m_pTrailLight->get_active()) return; - m_pTrailLight->set_position(Position()); -} - -void CArtefact::ActivateArtefact () -{ - VERIFY(m_bCanSpawnZone); - VERIFY( H_Parent() ); - m_activationObj = xr_new(this,H_Parent()->ID()); - m_activationObj->Start(); - -} - -void CArtefact::PhDataUpdate (dReal step) -{ - if(m_activationObj) - m_activationObj->PhDataUpdate (step); -} - -bool CArtefact::CanTake() const -{ - if(!inherited::CanTake())return false; - return (m_activationObj==NULL); -} - -void CArtefact::Hide() -{ - SwitchState(eHiding); -} - -void CArtefact::Show() -{ - SwitchState(eShowing); -} - -#include "inventoryOwner.h" -#include "Entity_alive.h" -void CArtefact::UpdateXForm() -{ - if (Device.dwFrame!=dwXF_Frame) - { - dwXF_Frame = Device.dwFrame; - - if (0==H_Parent()) return; - - // Get access to entity and its visual - CEntityAlive* E = smart_cast(H_Parent()); - - if(!E) return ; - - const CInventoryOwner *parent = smart_cast(E); - if (parent && parent->use_simplified_visual()) - return; - - VERIFY (E); - IKinematics* V = smart_cast (E->Visual()); - VERIFY (V); - - // Get matrices - int boneL,boneR,boneR2; - E->g_WeaponBones (boneL,boneR,boneR2); - - boneL = boneR2; - - V->CalculateBones (); - Fmatrix& mL = V->LL_GetTransform(u16(boneL)); - Fmatrix& mR = V->LL_GetTransform(u16(boneR)); - - // Calculate - Fmatrix mRes; - Fvector R,D,N; - D.sub (mL.c,mR.c); D.normalize_safe(); - R.crossproduct (mR.j,D); R.normalize_safe(); - N.crossproduct (D,R); N.normalize_safe(); - mRes.set (R,N,D,mR.c); - mRes.mulA_43 (E->XFORM()); -// UpdatePosition (mRes); - XFORM().mul (mRes,offset()); - } -} -#include "xr_level_controller.h" -bool CArtefact::Action(s32 cmd, u32 flags) -{ - switch (cmd) - { - case kWPN_FIRE: - { - if (flags&CMD_START && m_bCanSpawnZone){ - SwitchState(eActivating); - return true; - } - if (flags&CMD_STOP && m_bCanSpawnZone && GetState()==eActivating) - { - SwitchState(eIdle); - return true; - } - }break; - default: - break; - } - return inherited::Action(cmd,flags); -} - -void CArtefact::OnStateSwitch(u32 S) -{ - inherited::OnStateSwitch (S); - switch(S){ - case eShowing: - { - PlayHUDMotion("anm_show", FALSE, this, S); - }break; - case eHiding: - { - PlayHUDMotion("anm_hide", FALSE, this, S); - }break; - case eActivating: - { - PlayHUDMotion("anm_activate", FALSE, this, S); - }break; - case eIdle: - { - PlayAnimIdle(); - }break; - }; -} - -void CArtefact::PlayAnimIdle() -{ - PlayHUDMotion("anm_idle", FALSE, NULL, eIdle); -} - -void CArtefact::OnAnimationEnd(u32 state) -{ - switch (state) - { - case eHiding: - { - SwitchState(eHidden); - }break; - case eShowing: - { - SwitchState(eIdle); - }break; - case eActivating: - { - if(Local()) - { - SwitchState (eHiding); - NET_Packet P; - u_EventGen (P, GEG_PLAYER_ACTIVATEARTEFACT, H_Parent()->ID()); - P.w_u16 (ID()); - u_EventSend (P); - } - }break; - }; -} - -void CArtefact::FollowByPath(LPCSTR path_name, int start_idx, Fvector magic_force) -{ - if(m_detectorObj) - m_detectorObj->FollowByPath(path_name, start_idx, magic_force); -} - -bool CArtefact::CanBeInvisible() -{ - return (m_detectorObj!=NULL); -} - -void CArtefact::SwitchVisibility(bool b) -{ - if(m_detectorObj) - m_detectorObj->SetVisible(b); -} - - -//---SArtefactActivation---- -SArtefactActivation::SArtefactActivation(CArtefact* af,u32 owner_id) -{ - m_af = af; - Load (); - m_light = ::Render->light_create(); - m_light->set_shadow(true); - m_owner_id = owner_id; -} - -SArtefactActivation::~SArtefactActivation() -{ - m_light.destroy(); -} - -void SArtefactActivation::Load() -{ - for(int i=0; i<(int)eMax; ++i) - m_activation_states.push_back(SStateDef()); - - LPCSTR activation_seq = pSettings->r_string(*m_af->cNameSect(),"artefact_activation_seq"); - - - m_activation_states[(int)eStarting].Load(activation_seq, "starting"); - m_activation_states[(int)eFlying].Load(activation_seq, "flying"); - m_activation_states[(int)eBeforeSpawn].Load(activation_seq, "idle_before_spawning"); - m_activation_states[(int)eSpawnZone].Load(activation_seq, "spawning"); - -} - -void SArtefactActivation::Start() -{ - VERIFY(!ph_world->Processing()); - m_af->StopLights (); - m_cur_activation_state = eStarting; - m_cur_state_time = 0.0f; - - m_af->processing_activate(); - - NET_Packet P; - CGameObject::u_EventGen (P,GE_OWNERSHIP_REJECT, m_af->H_Parent()->ID()); - P.w_u16 (m_af->ID()); - if (OnServer()) - CGameObject::u_EventSend (P); - m_light->set_active (true); - ChangeEffects (); -} - -void SArtefactActivation::UpdateActivation() -{ - VERIFY(!ph_world->Processing()); - m_cur_state_time += Device.fTimeDelta; - if(m_cur_state_time >= m_activation_states[int(m_cur_activation_state)].m_time){ - m_cur_activation_state = (EActivationStates)(int)(m_cur_activation_state+1); - - if(m_cur_activation_state == eMax){ - m_cur_activation_state = eNone; - - m_af->processing_deactivate (); - m_af->CPHUpdateObject::Deactivate (); - m_af->DestroyObject(); - } - - m_cur_state_time = 0.0f; - ChangeEffects (); - - - if(m_cur_activation_state==eSpawnZone && OnServer()) - SpawnAnomaly (); - - } - UpdateEffects (); - -} - -void SArtefactActivation::PhDataUpdate(dReal step) -{ - if (m_cur_activation_state==eFlying) { - Fvector dir = {0, -1.f, 0}; - if(Level().ObjectSpace.RayTest(m_af->Position(), dir, 1.0f, collide::rqtBoth,NULL,m_af) ){ - dir.y = ph_world->Gravity()*1.1f; - m_af->m_pPhysicsShell->applyGravityAccel(dir); - } - } - -} -void SArtefactActivation::ChangeEffects() -{ - VERIFY(!ph_world->Processing()); - SStateDef& state_def = m_activation_states[(int)m_cur_activation_state]; - - if(m_snd._feedback()) - m_snd.stop(); - - if(state_def.m_snd.size()) - { - m_snd.create (state_def.m_snd.c_str(),st_Effect,sg_SourceType); - m_snd.play_at_pos (m_af, m_af->Position()); - }; - - m_light->set_range ( state_def.m_light_range); - m_light->set_color ( state_def.m_light_color.r, - state_def.m_light_color.g, - state_def.m_light_color.b); - - if(state_def.m_particle.size()) - { - Fvector dir; - dir.set(0,1,0); - - m_af->CParticlesPlayer::StartParticles( state_def.m_particle, - dir, - m_af->ID(), - iFloor(state_def.m_time*1000) ); - }; - if(state_def.m_animation.size()) - { - IKinematicsAnimated *K=smart_cast(m_af->Visual()); - if(K)K->PlayCycle(state_def.m_animation.c_str()); - } - -} - -void SArtefactActivation::UpdateEffects() -{ - VERIFY(!ph_world->Processing()); - if(m_snd._feedback()) - m_snd.set_position( m_af->Position() ); - - m_light->set_position(m_af->Position()); -} - -void SArtefactActivation::SpawnAnomaly() -{ - VERIFY(!ph_world->Processing()); - string128 tmp; - LPCSTR str = pSettings->r_string("artefact_spawn_zones",*m_af->cNameSect()); - VERIFY3(3==_GetItemCount(str),"Bad record format in artefact_spawn_zones",str); - float zone_radius = (float)atof(_GetItem(str,1,tmp)); - float zone_power = (float)atof(_GetItem(str,2,tmp)); - LPCSTR zone_sect = _GetItem(str,0,tmp); //must be last call of _GetItem... (LPCSTR !!!) - - Fvector pos; - m_af->Center(pos); - CSE_Abstract *object = Level().spawn_item( zone_sect, - pos, - (g_dedicated_server)?u32(-1):m_af->ai_location().level_vertex_id(), - 0xffff, - true - ); - CSE_ALifeAnomalousZone* AlifeZone = smart_cast(object); - VERIFY(AlifeZone); - CShapeData::shape_def _shape; - _shape.data.sphere.P.set (0.0f,0.0f,0.0f); - _shape.data.sphere.R = zone_radius; - _shape.type = CShapeData::cfSphere; - AlifeZone->assign_shapes (&_shape,1); - AlifeZone->m_maxPower = zone_power; - AlifeZone->m_owner_id = m_owner_id; - AlifeZone->m_space_restrictor_type = RestrictionSpace::eRestrictorTypeNone; - - NET_Packet P; - object->Spawn_Write (P,TRUE); - Level().Send (P,net_flags(TRUE)); - F_entity_Destroy (object); -//. #ifdef DEBUG - Msg("artefact [%s] spawned a zone [%s] at [%f]", *m_af->cName(), zone_sect, Device.fTimeGlobal); -//. #endif -} -shared_str clear_brackets(LPCSTR src) -{ - if (0==src) return shared_str(0); - - if( NULL == strchr(src,'"') ) return shared_str(src); - - string512 _original; - strcpy_s (_original,src); - u32 _len = xr_strlen(_original); - if (0==_len) return shared_str(""); - if ('"'==_original[_len-1]) _original[_len-1]=0; // skip end - if ('"'==_original[0]) return shared_str(&_original[0] + 1); // skip begin - return shared_str(_original); - -} - -void SArtefactActivation::SStateDef::Load(LPCSTR section, LPCSTR name) -{ - LPCSTR str = pSettings->r_string(section,name); - VERIFY(_GetItemCount(str)==8); - - - string128 tmp; - - m_time = (float)atof( _GetItem(str,0,tmp) ); - - m_snd = clear_brackets( _GetItem(str,1,tmp) ) ; - - m_light_color.r = (float)atof( _GetItem(str,2,tmp) ); - m_light_color.g = (float)atof( _GetItem(str,3,tmp) ); - m_light_color.b = (float)atof( _GetItem(str,4,tmp) ); - - m_light_range = (float)atof( _GetItem(str,5,tmp) ); - - m_particle = clear_brackets( _GetItem(str,6,tmp) ); - m_animation = clear_brackets( _GetItem(str,7,tmp) ); -} - -SArtefactDetectorsSupport::SArtefactDetectorsSupport(CArtefact* A) -:m_parent(A),m_currPatrolPath(NULL),m_currPatrolVertex(NULL),m_switchVisTime(0) -{ -} - -SArtefactDetectorsSupport::~SArtefactDetectorsSupport() -{ - m_sound.destroy(); -} - -void SArtefactDetectorsSupport::SetVisible(bool b) -{ - if(b == !!m_parent->getVisible()) return; - m_switchVisTime = Device.dwTimeGlobal; - LPCSTR curr = pSettings->r_string(m_parent->cNameSect().c_str(), (b)?"det_show_particles":"det_hide_particles"); - m_parent->CParticlesPlayer::StartParticles(curr,Fvector().set(0,1,0),m_parent->ID()); - curr = pSettings->r_string(m_parent->cNameSect().c_str(), (b)?"det_show_snd":"det_hide_snd"); - m_sound.create (curr, st_Effect, sg_SourceType); - m_sound.play_at_pos (0, m_parent->Position(), 0); - - m_parent->setVisible(b); -//. m_parent->setEnabled(b); -} - -void SArtefactDetectorsSupport::UpdateOnFrame() -{ - if(m_currPatrolPath) - { - if(m_parent->Position().distance_to(m_destPoint) < 2.0f) - { - CPatrolPath::const_iterator b,e; - m_currPatrolPath->begin(m_currPatrolVertex,b,e); - if(b!=e) - { - std::advance(b, ::Random.randI(s32(e-b))); - m_currPatrolVertex = m_currPatrolPath->vertex((*b).vertex_id()); - m_destPoint = m_currPatrolVertex->data().position(); - } - } - float cos_et = _cos(deg2rad(45.f)); - Fvector dir; - dir.sub (m_destPoint, m_parent->Position()).normalize_safe(); - - Fvector v; - m_parent->PHGetLinearVell(v); - float cosa = v.dotproduct(dir); - if(v.square_magnitude() < (0.7f*0.7f) || (cosam_pPhysicsShell->applyGravityAccel(power); - } - } - - if(m_parent->GetAfRank()!=0 && m_switchVisTime+5000 < Device.dwTimeGlobal) - SetVisible(false); -} - -void SArtefactDetectorsSupport::FollowByPath(LPCSTR path_name, int start_idx, Fvector force) -{ - m_currPatrolPath = ai().patrol_paths().path(path_name,true); - if(m_currPatrolPath) - { - m_currPatrolVertex = m_currPatrolPath->vertex(start_idx); - m_destPoint = m_currPatrolVertex->data().position(); - m_path_moving_force = force; - } -} -void CArtefact::OnActiveItem () -{ - SwitchState (eShowing); - inherited::OnActiveItem (); - SetState (eIdle); - SetNextState (eIdle); -} - -void CArtefact::OnHiddenItem () -{ - if(IsGameTypeSingle()) - SwitchState(eHiding); - else - SwitchState(eHidden); - - inherited::OnHiddenItem (); - SetState (eHidden); - SetNextState (eHidden); -} diff --git a/src/xrGame/Artifact.h b/src/xrGame/Artifact.h deleted file mode 100644 index ba1bd1360b7..00000000000 --- a/src/xrGame/Artifact.h +++ /dev/null @@ -1,136 +0,0 @@ -#pragma once - -#include "hud_item_object.h" -#include "hit_immunity.h" -#include "PHObject.h" -#include "script_export_space.h" -#include "patrol_path.h" - -class SArtefactActivation; -struct SArtefactDetectorsSupport; - -class CArtefact : public CHudItemObject, - public CPHUpdateObject -{ - typedef CHudItemObject inherited; -public: - CArtefact (); - virtual ~CArtefact (); - - virtual void Load (LPCSTR section); - virtual BOOL net_Spawn (CSE_Abstract* DC); - virtual void net_Destroy (); - - virtual void OnH_A_Chield (); - virtual void OnH_B_Independent (bool just_before_destroy); - virtual void OnActiveItem (); - virtual void OnHiddenItem (); - - virtual void UpdateCL (); - virtual void shedule_Update (u32 dt); - void UpdateWorkload (u32 dt); - - - virtual bool CanTake () const; - - virtual BOOL renderable_ShadowGenerate () { return FALSE; } - virtual BOOL renderable_ShadowReceive () { return TRUE; } - virtual void create_physic_shell (); - - virtual CArtefact* cast_artefact () {return this;} - -protected: - virtual void UpdateCLChild () {}; - virtual void CreateArtefactActivation (); - - SArtefactActivation* m_activationObj; - SArtefactDetectorsSupport* m_detectorObj; - - u16 m_CarringBoneID; - shared_str m_sParticlesName; - - ref_light m_pTrailLight; - Fcolor m_TrailLightColor; - float m_fTrailLightRange; - u8 m_af_rank; - bool m_bLightsEnabled; - - virtual void UpdateLights (); -public: - IC u8 GetAfRank () const {return m_af_rank;} - IC bool CanBeActivated () {return m_bCanSpawnZone;}; - void ActivateArtefact (); - void FollowByPath (LPCSTR path_name, int start_idx, Fvector magic_force); - bool CanBeInvisible (); - void SwitchVisibility (bool); - - virtual void StartLights(); - virtual void StopLights(); - - virtual void PhDataUpdate (dReal step); - virtual void PhTune (dReal step) {}; - - bool m_bCanSpawnZone; - float m_fHealthRestoreSpeed; - float m_fRadiationRestoreSpeed; - float m_fSatietyRestoreSpeed; - float m_fPowerRestoreSpeed; - float m_fBleedingRestoreSpeed; - CHitImmunity m_ArtefactHitImmunities; -public: - enum EAFHudStates { - eActivating = eLastBaseState+1, - }; - virtual void PlayAnimIdle (); - virtual void MoveTo(Fvector const & position); - virtual void StopActivation (); - - virtual void ForceTransform (const Fmatrix& m); - - virtual void Hide (); - virtual void Show (); - virtual void UpdateXForm (); - virtual bool Action (s32 cmd, u32 flags); - virtual void OnStateSwitch (u32 S); - virtual void OnAnimationEnd (u32 state); - virtual bool IsHidden () const {return GetState()==eHidden;} - - // optimization FAST/SLOW mode - u32 o_render_frame ; - BOOL o_fastmode ; - IC void o_switch_2_fast () { - if (o_fastmode) return ; - o_fastmode = TRUE ; - //processing_activate (); - } - IC void o_switch_2_slow () { - if (!o_fastmode) return ; - o_fastmode = FALSE ; - //processing_deactivate (); - } - - DECLARE_SCRIPT_REGISTER_FUNCTION -}; - -struct SArtefactDetectorsSupport -{ - CArtefact* m_parent; - ref_sound m_sound; - - Fvector m_path_moving_force; - u32 m_switchVisTime; - const CPatrolPath* m_currPatrolPath; - const CPatrolPath::CVertex* m_currPatrolVertex; - Fvector m_destPoint; - - SArtefactDetectorsSupport (CArtefact* A); - ~SArtefactDetectorsSupport (); - void SetVisible (bool); - void FollowByPath (LPCSTR path_name, int start_idx, Fvector force); - void UpdateOnFrame (); -}; - -add_to_type_list(CArtefact) -#undef script_type_list -#define script_type_list save_type_list(CArtefact) - diff --git a/src/xrGame/BastArtifact.cpp b/src/xrGame/BastArtifact.cpp index fbeef566e68..66429789eeb 100644 --- a/src/xrGame/BastArtifact.cpp +++ b/src/xrGame/BastArtifact.cpp @@ -5,8 +5,8 @@ #include "stdafx.h" #include "BastArtifact.h" -#include "../xrphysics/PhysicsShell.h" -#include "../xrphysics/extendedgeom.h" +#include "xrPhysics/PhysicsShell.h" +#include "xrPhysics/extendedgeom.h" #include "ParticlesObject.h" diff --git a/src/xrGame/BastArtifact.h b/src/xrGame/BastArtifact.h index 9a1815e8c88..025a4dab7bf 100644 --- a/src/xrGame/BastArtifact.h +++ b/src/xrGame/BastArtifact.h @@ -5,7 +5,7 @@ #pragma once #include "artefact.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" #include "entity_alive.h" diff --git a/src/xrGame/BlackDrops.cpp b/src/xrGame/BlackDrops.cpp index 8b0086f069f..6be15e4b52c 100644 --- a/src/xrGame/BlackDrops.cpp +++ b/src/xrGame/BlackDrops.cpp @@ -5,7 +5,7 @@ #include "stdafx.h" #include "BlackDrops.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CBlackDrops::CBlackDrops(void) diff --git a/src/xrGame/BlackGraviArtifact.cpp b/src/xrGame/BlackGraviArtifact.cpp index 76cb4844698..a9a09dab3f3 100644 --- a/src/xrGame/BlackGraviArtifact.cpp +++ b/src/xrGame/BlackGraviArtifact.cpp @@ -6,14 +6,14 @@ #include "stdafx.h" #include "BlackGraviArtifact.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "entity_alive.h" #include "ParticlesObject.h" #include "phmovementcontrol.h" #include "xrmessages.h" #include "physicsshellholder.h" #include "explosive.h" -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" #include "CharacterPhysicsSupport.h" //extern CPHWorld* ph_world; CBlackGraviArtefact::CBlackGraviArtefact(void) diff --git a/src/xrGame/BlackGraviArtifact.h b/src/xrGame/BlackGraviArtifact.h index 95f0fd787e8..54200abf7c4 100644 --- a/src/xrGame/BlackGraviArtifact.h +++ b/src/xrGame/BlackGraviArtifact.h @@ -6,7 +6,7 @@ #pragma once #include "GraviArtifact.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" #include "PhysicsShellHolder.h" DEFINE_VECTOR (CPhysicsShellHolder*, GAME_OBJECT_LIST, GAME_OBJECT_LIST_it); diff --git a/src/xrGame/Bolt.cpp b/src/xrGame/Bolt.cpp index 93a418a32c5..92229e0a9c2 100644 --- a/src/xrGame/Bolt.cpp +++ b/src/xrGame/Bolt.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "bolt.h" #include "ParticlesObject.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "xr_level_controller.h" CBolt::CBolt(void) diff --git a/src/xrGame/Bolt.h b/src/xrGame/Bolt.h index 0c08e5b0c2c..081fbb30187 100644 --- a/src/xrGame/Bolt.h +++ b/src/xrGame/Bolt.h @@ -1,6 +1,6 @@ #pragma once #include "missile.h" -#include "../xrphysics/DamageSource.h" +#include "xrPhysics/DamageSource.h" class CBolt : public CMissile, public IDamageSource diff --git a/src/xrGame/BoneProtections.cpp b/src/xrGame/BoneProtections.cpp index a2eaa69655f..db6d2aee1e5 100644 --- a/src/xrGame/BoneProtections.cpp +++ b/src/xrGame/BoneProtections.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "BoneProtections.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "xrCore/Animation/Bone.hpp" #include "Level.h" diff --git a/src/xrGame/BreakableObject.cpp b/src/xrGame/BreakableObject.cpp index 26b3d57700a..916374ae683 100644 --- a/src/xrGame/BreakableObject.cpp +++ b/src/xrGame/BreakableObject.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" #include "BreakableObject.h" #include "xrserver_objects_alife.h" -#include "../xrphysics/IPHStaticGeomShell.h" -#include "../xrphysics/PhysicsShell.h" -//#include "../xrphysics/extendedgeom.h" -//#include "../xrphysics/mathutilsode.h" +#include "xrPhysics/IPHStaticGeomShell.h" +#include "xrPhysics/PhysicsShell.h" +//#include "xrPhysics/extendedgeom.h" +//#include "xrPhysics/mathutilsode.h" //#include "Physics.h" -#include "../xrEngine/xr_collide_form.h" -#include "../Include/xrRender/Kinematics.h" +#include "xrEngine/xr_collide_form.h" +#include "Include/xrRender/Kinematics.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction diff --git a/src/xrGame/BreakableObject.h b/src/xrGame/BreakableObject.h index ff49a98d47b..c7db9220040 100644 --- a/src/xrGame/BreakableObject.h +++ b/src/xrGame/BreakableObject.h @@ -8,7 +8,7 @@ #pragma once #include "physicsshellholder.h" -#include "../xrphysics/icollisiondamagereceiver.h" +#include "xrPhysics/icollisiondamagereceiver.h" class IPHStaticGeomShell; //struct dContact; diff --git a/src/xrGame/CameraEffector.h b/src/xrGame/CameraEffector.h index c98756ee21e..cc7df501d7b 100644 --- a/src/xrGame/CameraEffector.h +++ b/src/xrGame/CameraEffector.h @@ -1,8 +1,8 @@ #pragma once -#include "../xrEngine/CameraManager.h" -#include "../xrEngine/effector.h" -#include "../xrEngine/effectorPP.h" +#include "xrEngine/CameraManager.h" +#include "xrEngine/effector.h" +#include "xrEngine/effectorPP.h" #define eStartEffectorID 50 diff --git a/src/xrGame/CameraFirstEye.cpp b/src/xrGame/CameraFirstEye.cpp index cb0c1e85dbc..5b801a31c15 100644 --- a/src/xrGame/CameraFirstEye.cpp +++ b/src/xrGame/CameraFirstEye.cpp @@ -3,7 +3,7 @@ #include "CameraFirstEye.h" #include "xr_level_controller.h" -#include "../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction diff --git a/src/xrGame/CameraFirstEye.h b/src/xrGame/CameraFirstEye.h index 94c5d8de5de..0d9e81052da 100644 --- a/src/xrGame/CameraFirstEye.h +++ b/src/xrGame/CameraFirstEye.h @@ -1,7 +1,7 @@ #ifndef __CAMERA_FE_H__ #define __CAMERA_FE_H__ -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" class CCameraFirstEye : public CCameraBase { diff --git a/src/xrGame/CaptureBoneCallback.h b/src/xrGame/CaptureBoneCallback.h index 0d31f7743d3..f031d9970b5 100644 --- a/src/xrGame/CaptureBoneCallback.h +++ b/src/xrGame/CaptureBoneCallback.h @@ -1,7 +1,7 @@ #pragma once; -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" struct CPHCaptureBoneCallback : public NearestToPointCallback diff --git a/src/xrGame/Car.cpp b/src/xrGame/Car.cpp index fd6f34b81ae..d10b6ca809c 100644 --- a/src/xrGame/Car.cpp +++ b/src/xrGame/Car.cpp @@ -6,7 +6,7 @@ //#include "Physics.h" #ifdef DEBUG -# include "../xrEngine/StatGraph.h" +# include "xrEngine/StatGraph.h" # include "PHDebug.h" #endif // DEBUG @@ -21,8 +21,8 @@ #include "script_entity_action.h" #include "inventory.h" #include "xrserver_objects_alife_items.h" -#include "../Include/xrRender/Kinematics.h" -#include "level.h" +#include "Include/xrRender/Kinematics.h" +#include "Level.h" #include "ui/UIMainIngameWnd.h" #include "CarWeapon.h" #include "game_object_space.h" @@ -30,7 +30,7 @@ //#include "PHActivationShape.h" #include "CharacterPhysicsSupport.h" #include "car_memory.h" -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" BONE_P_MAP CCar::bone_map=BONE_P_MAP(); //extern CPHWorld* ph_world; diff --git a/src/xrGame/Car.h b/src/xrGame/Car.h index 781dc2c9d98..84dda7e5d0a 100644 --- a/src/xrGame/Car.h +++ b/src/xrGame/Car.h @@ -3,9 +3,9 @@ //#if 0 #include "entity.h" -//#include "../xrphysics/PHDynamicData.h" -#include "../xrphysics/PhysicsShell.h" -#include "../xrphysics/phupdateobject.h" +//#include "xrPhysics/PHDynamicData.h" +#include "xrPhysics/PhysicsShell.h" +#include "xrPhysics/phupdateobject.h" #include "script_entity.h" #include "CarLights.h" //#include "phobject.h" @@ -31,7 +31,7 @@ struct dSurfaceParameters; // defs #ifdef DEBUG - #include "../xrEngine/StatGraph.h" + #include "xrEngine/StatGraph.h" #include "PHDebug.h" #endif diff --git a/src/xrGame/CarCameras.cpp b/src/xrGame/CarCameras.cpp index 2038d552c71..959e13c1178 100644 --- a/src/xrGame/CarCameras.cpp +++ b/src/xrGame/CarCameras.cpp @@ -3,7 +3,7 @@ #ifdef DEBUG #include "PHDebug.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphworld.h" #endif #include "alife_space.h" #include "hit.h" @@ -12,8 +12,8 @@ #include "actor.h" #include "cameralook.h" #include "camerafirsteye.h" -#include "level.h" -#include "../xrEngine/cameramanager.h" +#include "Level.h" +#include "xrEngine/cameramanager.h" bool CCar::HUDView() const { diff --git a/src/xrGame/CarDamageParticles.cpp b/src/xrGame/CarDamageParticles.cpp index 02dac0f67a0..93195e2ef52 100644 --- a/src/xrGame/CarDamageParticles.cpp +++ b/src/xrGame/CarDamageParticles.cpp @@ -8,8 +8,8 @@ #include "hit.h" #include "PHDestroyable.h" #include "Car.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrphysics/IPHWorld.h" +#include "Include/xrRender/Kinematics.h" +#include "xrPhysics/IPHWorld.h" //#include "PHWorld.h" //extern CPHWorld* ph_world; void read_bones(IKinematics *K, LPCSTR S , xr_vector& bones) diff --git a/src/xrGame/CarDoors.cpp b/src/xrGame/CarDoors.cpp index 310c99fa487..f5aece11e45 100644 --- a/src/xrGame/CarDoors.cpp +++ b/src/xrGame/CarDoors.cpp @@ -7,8 +7,8 @@ #include "hit.h" #include "PHDestroyable.h" #include "car.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrphysics/MathUtils.h" +#include "Include/xrRender/Kinematics.h" +#include "xrPhysics/MathUtils.h" #include "game_object_space.h" ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool CCar::DoorHit(float P,s16 element,ALife::EHitType hit_type) diff --git a/src/xrGame/CarExhaust.cpp b/src/xrGame/CarExhaust.cpp index 24582f70068..9e49df4a07a 100644 --- a/src/xrGame/CarExhaust.cpp +++ b/src/xrGame/CarExhaust.cpp @@ -7,8 +7,8 @@ #include "hit.h" #include "PHDestroyable.h" #include "car.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrphysics/IPHWorld.h" +#include "Include/xrRender/Kinematics.h" +#include "xrPhysics/IPHWorld.h" //#include "PHWorld.h" //extern CPHWorld* ph_world; diff --git a/src/xrGame/CarInput.cpp b/src/xrGame/CarInput.cpp index 28918e27851..d1961dafa62 100644 --- a/src/xrGame/CarInput.cpp +++ b/src/xrGame/CarInput.cpp @@ -13,8 +13,8 @@ #include "camerafirsteye.h" #include "script_entity_action.h" #include "xr_level_controller.h" -#include "../Include/xrRender/Kinematics.h" -#include "level.h" +#include "Include/xrRender/Kinematics.h" +#include "Level.h" #include "CarWeapon.h" void CCar::OnMouseMove(int dx, int dy) diff --git a/src/xrGame/CarLights.cpp b/src/xrGame/CarLights.cpp index 407fad04cef..f3099532331 100644 --- a/src/xrGame/CarLights.cpp +++ b/src/xrGame/CarLights.cpp @@ -8,10 +8,10 @@ #include "hit.h" #include "PHDestroyable.h" #include "Car.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" //#include "PHWorld.h" //extern CPHWorld* ph_world; -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" SCarLight::SCarLight() { diff --git a/src/xrGame/CarLights.h b/src/xrGame/CarLights.h index 16bbd101f71..224354d05e8 100644 --- a/src/xrGame/CarLights.h +++ b/src/xrGame/CarLights.h @@ -2,7 +2,7 @@ #define CAR_LIGHTS_H #pragma once -#include "../xrEngine/Render.h" +#include "xrEngine/Render.h" class CCarLights; class CCar; diff --git a/src/xrGame/CarSound.cpp b/src/xrGame/CarSound.cpp index cde0990bac6..c6abe967bfe 100644 --- a/src/xrGame/CarSound.cpp +++ b/src/xrGame/CarSound.cpp @@ -6,10 +6,10 @@ #include "hit.h" #include "PHDestroyable.h" #include "car.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" //#include "PHWorld.h" //extern CPHWorld* ph_world; -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" CCar::SCarSound::SCarSound(CCar* car) { volume =1.f; diff --git a/src/xrGame/CarWeapon.cpp b/src/xrGame/CarWeapon.cpp index fe0c98f29b0..3e906dadb2c 100644 --- a/src/xrGame/CarWeapon.cpp +++ b/src/xrGame/CarWeapon.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "CarWeapon.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "PhysicsShellHolder.h" -//#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/Kinematics.h" +//#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "object_broker.h" #include "ai_sounds.h" #include "weaponAmmo.h" diff --git a/src/xrGame/CarWheels.cpp b/src/xrGame/CarWheels.cpp index 6a6aec571bf..c19ac2289f9 100644 --- a/src/xrGame/CarWheels.cpp +++ b/src/xrGame/CarWheels.cpp @@ -7,8 +7,8 @@ #include "hit.h" #include "PHDestroyable.h" #include "car.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrphysics/ExtendedGeom.h" +#include "Include/xrRender/Kinematics.h" +#include "xrPhysics/ExtendedGeom.h" CCar::SWheel::SWheelCollisionParams::SWheelCollisionParams() { diff --git a/src/xrGame/CharacterPhysicsSupport.cpp b/src/xrGame/CharacterPhysicsSupport.cpp index 20eae8de3cb..1823bd19c8a 100644 --- a/src/xrGame/CharacterPhysicsSupport.cpp +++ b/src/xrGame/CharacterPhysicsSupport.cpp @@ -9,18 +9,18 @@ -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" -#include "../xrphysics/PhysicsShell.h" -#include "../xrphysics/iActivationShape.h" -//#include "../xrphysics/Extendedgeom.h" -#include "../xrphysics/geometry.h" -//#include "../xrphysics/phdynamicdata.h" -#include "../xrphysics/IPHCapture.h" -//#include "../xrphysics/ICollideValidator.h" -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/PhysicsShell.h" +#include "xrPhysics/iActivationShape.h" +//#include "xrPhysics/Extendedgeom.h" +#include "xrPhysics/geometry.h" +//#include "xrPhysics/phdynamicdata.h" +#include "xrPhysics/IPHCapture.h" +//#include "xrPhysics/ICollideValidator.h" +#include "xrPhysics/IPHWorld.h" //#include "Physics.h" @@ -45,7 +45,7 @@ extern BOOL death_anim_debug; #endif // DEBUG -#include "../xrEngine/device.h" +#include "xrEngine/device.h" #define USE_SMART_HITS #define USE_IK diff --git a/src/xrGame/ClimableObject.cpp b/src/xrGame/ClimableObject.cpp index 0c60700e4ef..e2bc239cca7 100644 --- a/src/xrGame/ClimableObject.cpp +++ b/src/xrGame/ClimableObject.cpp @@ -1,14 +1,14 @@ #include "stdafx.h" #include "climableobject.h " -#include "../xrphysics/IPHStaticGeomShell.h" +#include "xrPhysics/IPHStaticGeomShell.h" #include "xrServer_Objects_ALife.h" -#include "../xrphysics/PHCharacter.h" -#include "../xrphysics/MathUtils.h" -#include "../xrphysics/extendedgeom.h" +#include "xrPhysics/PHCharacter.h" +#include "xrPhysics/MathUtils.h" +#include "xrPhysics/extendedgeom.h" #include "xrEngine/GameMtlLib.h" #ifdef DEBUG # include "debug_renderer.h" -# include "level.h" +# include "Level.h" # include "PHDebug.h" #endif diff --git a/src/xrGame/ClimableObject.h b/src/xrGame/ClimableObject.h index fac5e51127e..b90e958acc0 100644 --- a/src/xrGame/ClimableObject.h +++ b/src/xrGame/ClimableObject.h @@ -1,6 +1,6 @@ #pragma once #include "physicsshellholder.h" -#include "../xrphysics/iclimableobject.h" +#include "xrPhysics/iclimableobject.h" class IPHStaticGeomShell; class CPHCharacter; struct dContact; diff --git a/src/xrGame/CustomDetector.cpp b/src/xrGame/CustomDetector.cpp index c030fc43b21..2678e7ef4da 100644 --- a/src/xrGame/CustomDetector.cpp +++ b/src/xrGame/CustomDetector.cpp @@ -3,7 +3,7 @@ #include "ui/ArtefactDetectorUI.h" #include "hudmanager.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "map_manager.h" #include "ActorEffector.h" #include "actor.h" diff --git a/src/xrGame/CustomDetector.h b/src/xrGame/CustomDetector.h index 023eff50d6a..51887c58f2b 100644 --- a/src/xrGame/CustomDetector.h +++ b/src/xrGame/CustomDetector.h @@ -1,6 +1,6 @@ #pragma once #include "inventory_item_object.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" #include "hudsound.h" #include "customzone.h" #include "artefact.h" diff --git a/src/xrGame/CustomMonster.cpp b/src/xrGame/CustomMonster.cpp index ae2189cd40a..5d6f9a041c9 100644 --- a/src/xrGame/CustomMonster.cpp +++ b/src/xrGame/CustomMonster.cpp @@ -14,7 +14,7 @@ #include "squad_hierarchy_holder.h" #include "group_hierarchy_holder.h" #include "customzone.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "detail_path_manager.h" #include "memory_manager.h" #include "visual_memory_manager.h" @@ -28,7 +28,7 @@ #include "movement_manager.h" #include "entitycondition.h" #include "sound_player.h" -#include "level.h" +#include "Level.h" #include "level_debug.h" #include "material_manager.h" #include "sound_user_data_visitor.h" @@ -36,7 +36,7 @@ #include "PHMovementControl.h" #include "profiler.h" #include "date_time.h" -#include "characterphysicssupport.h" +#include "CharacterPhysicsSupport.h" #include "ai/monsters/snork/snork.h" #include "ai/monsters/burer/burer.h" #include "GamePersistent.h" @@ -48,10 +48,10 @@ #include "level_path_manager.h" // Lain: added -#include "../xrEngine/IGame_Level.h" -#include "../xrCore/_vector3d_ext.h" +#include "xrEngine/IGame_Level.h" +#include "xrCore/_vector3d_ext.h" #include "debug_text_tree.h" -#include "../xrPhysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" #ifdef DEBUG # include "debug_renderer.h" diff --git a/src/xrGame/CustomMonster.h b/src/xrGame/CustomMonster.h index e3c248613a7..dcf0b3d1ad5 100644 --- a/src/xrGame/CustomMonster.h +++ b/src/xrGame/CustomMonster.h @@ -6,10 +6,10 @@ #include "entity_alive.h" #include "script_entity.h" -#include "../xrEngine/feel_vision.h" -#include "../xrEngine/feel_sound.h" -#include "../xrEngine/feel_touch.h" -#include "../Include/xrRender/Kinematics.h" +#include "xrEngine/feel_vision.h" +#include "xrEngine/feel_sound.h" +#include "xrEngine/feel_touch.h" +#include "Include/xrRender/Kinematics.h" #include "associative_vector.h" #include "trajectories.h" diff --git a/src/xrGame/CustomOutfit.cpp b/src/xrGame/CustomOutfit.cpp index f6a5c6d78f7..a8ffcc11f6b 100644 --- a/src/xrGame/CustomOutfit.cpp +++ b/src/xrGame/CustomOutfit.cpp @@ -1,14 +1,14 @@ #include "stdafx.h" #include "customoutfit.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "inventory_space.h" #include "Inventory.h" #include "Actor.h" #include "game_cl_base.h" #include "Level.h" #include "BoneProtections.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "player_hud.h" #include "ActorHelmet.h" diff --git a/src/xrGame/CustomRocket.cpp b/src/xrGame/CustomRocket.cpp index 18535889b7e..9126810bdc9 100644 --- a/src/xrGame/CustomRocket.cpp +++ b/src/xrGame/CustomRocket.cpp @@ -6,16 +6,16 @@ #include "stdafx.h" #include "customrocket.h" #include "ParticlesObject.h" -#include "../xrphysics/PhysicsShell.h" -#include "../xrphysics/extendedgeom.h" -#include "../xrphysics/calculatetriangle.h" -#include "../xrphysics/tri-colliderknoopc/dctriangle.h" +#include "xrPhysics/PhysicsShell.h" +#include "xrPhysics/extendedgeom.h" +#include "xrPhysics/calculatetriangle.h" +#include "xrPhysics/tri-colliderknoopc/dctriangle.h" -#include "level.h" +#include "Level.h" #include "xrMessages.h" #include "xrEngine/GameMtlLib.h" //#include "tri-colliderknoopc/dTriList.h" -#include "../Include/xrRender/RenderVisual.h" +#include "Include/xrRender/RenderVisual.h" //#include "CalculateTriangle.h" #include "actor.h" #ifdef DEBUG diff --git a/src/xrGame/CustomRocket.h b/src/xrGame/CustomRocket.h index 7e70bb82ae3..eac776f7c46 100644 --- a/src/xrGame/CustomRocket.h +++ b/src/xrGame/CustomRocket.h @@ -6,7 +6,7 @@ #pragma once #include "physic_item.h" -#include "../xrphysics/PHUpdateObject.h" +#include "xrPhysics/PHUpdateObject.h" class CRocketLauncher; struct dContact; diff --git a/src/xrGame/CustomZone.cpp b/src/xrGame/CustomZone.cpp index 25d69dcf773..d3f4a9a2a25 100644 --- a/src/xrGame/CustomZone.cpp +++ b/src/xrGame/CustomZone.cpp @@ -1,19 +1,19 @@ #include "stdafx.h" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" #include "customzone.h" #include "hit.h" #include "PHDestroyable.h" #include "actor.h" #include "ParticlesObject.h" #include "xrserver_objects_alife_monsters.h" -#include "../xrEngine/LightAnimLibrary.h" -#include "level.h" +#include "xrEngine/LightAnimLibrary.h" +#include "Level.h" #include "game_cl_base.h" -#include "../xrEngine/igame_persistent.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/xr_collide_form.h" #include "artefact.h" #include "ai_object_location.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "zone_effector.h" #include "breakableobject.h" #include "GamePersistent.h" diff --git a/src/xrGame/CustomZone.h b/src/xrGame/CustomZone.h index eb79f7ac2f6..27fc82b2c5d 100644 --- a/src/xrGame/CustomZone.h +++ b/src/xrGame/CustomZone.h @@ -1,7 +1,7 @@ #pragma once #include "space_restrictor.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" class CActor; class CLAItem; diff --git a/src/xrGame/DemoInfo.cpp b/src/xrGame/DemoInfo.cpp index 6e6ee3c87cb..38a7df23aa9 100644 --- a/src/xrGame/DemoInfo.cpp +++ b/src/xrGame/DemoInfo.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "game_sv_mp.h" #include "game_cl_mp.h" -#include "level.h" +#include "Level.h" #include "DemoInfo.h" -#include "../xrCore/stream_reader.h" +#include "xrCore/stream_reader.h" #include "object_broker.h" LPCSTR GameTypeToString(EGameIDs gt, bool bShort); diff --git a/src/xrGame/DemoInfo_Loader.cpp b/src/xrGame/DemoInfo_Loader.cpp index 288220edf47..ccb24155817 100644 --- a/src/xrGame/DemoInfo_Loader.cpp +++ b/src/xrGame/DemoInfo_Loader.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "DemoInfo_Loader.h" -#include "../xrCore/stream_reader.h" +#include "xrCore/stream_reader.h" #include "Level.h" #include "object_broker.h" diff --git a/src/xrGame/DemoInfo_Loader.h b/src/xrGame/DemoInfo_Loader.h index 4b2ac43710a..a210a0fc2eb 100644 --- a/src/xrGame/DemoInfo_Loader.h +++ b/src/xrGame/DemoInfo_Loader.h @@ -2,7 +2,7 @@ #define DEMO_INFO_LOADER #include "DemoInfo.h" -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" class demo_info_loader { diff --git a/src/xrGame/DestroyablePhysicsObject.cpp b/src/xrGame/DestroyablePhysicsObject.cpp index 9f6b1b5771c..514bbed36b6 100644 --- a/src/xrGame/DestroyablePhysicsObject.cpp +++ b/src/xrGame/DestroyablePhysicsObject.cpp @@ -6,15 +6,15 @@ #include "hit_immunity.h" #include "damage_manager.h" #include "DestroyablePhysicsObject.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" #include "xrServer_Objects_ALife.h" #include "game_object_space.h" #include "script_callback_ex.h" #include "script_game_object.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #ifdef DEBUG -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" //#include "PHWorld.h" //extern CPHWorld *ph_world; #endif diff --git a/src/xrGame/DummyArtifact.cpp b/src/xrGame/DummyArtifact.cpp index e50d8344ecc..117e13478e1 100644 --- a/src/xrGame/DummyArtifact.cpp +++ b/src/xrGame/DummyArtifact.cpp @@ -5,7 +5,7 @@ #include "stdafx.h" #include "DummyArtifact.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CDummyArtefact::CDummyArtefact(void) diff --git a/src/xrGame/EffectorBobbing.h b/src/xrGame/EffectorBobbing.h index a4ca55c4a33..8bde53bf741 100644 --- a/src/xrGame/EffectorBobbing.h +++ b/src/xrGame/EffectorBobbing.h @@ -3,7 +3,7 @@ #pragma once #include "CameraEffector.h" -#include "../xrEngine/cameramanager.h" +#include "xrEngine/cameramanager.h" class CEffectorBobbing : public CEffectorCam { diff --git a/src/xrGame/EffectorFall.h b/src/xrGame/EffectorFall.h index 1b4d1acbbfb..55d1544aef9 100644 --- a/src/xrGame/EffectorFall.h +++ b/src/xrGame/EffectorFall.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrEngine/Effector.h" +#include "xrEngine/Effector.h" // ïðèñåäàíèå ïîñëå ïàäåíèÿ class CEffectorFall : public CEffectorCam diff --git a/src/xrGame/EffectorShot.h b/src/xrGame/EffectorShot.h index 503f0758497..baf78065b8e 100644 --- a/src/xrGame/EffectorShot.h +++ b/src/xrGame/EffectorShot.h @@ -5,7 +5,7 @@ #pragma once #include "CameraEffector.h" -#include "../xrEngine/cameramanager.h" +#include "xrEngine/cameramanager.h" #include "Actor.h" #include "CameraRecoil.h" diff --git a/src/xrGame/EffectorShotX.cpp b/src/xrGame/EffectorShotX.cpp index 7cc903c5722..d8487ed3c5e 100644 --- a/src/xrGame/EffectorShotX.cpp +++ b/src/xrGame/EffectorShotX.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "EffectorShotX.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" /*CCameraShotEffectorX::CCameraShotEffectorX (float max_angle, float relax_speed, float max_angle_horz, float step_angle_horz, float angle_frac) : diff --git a/src/xrGame/EffectorZoomInertion.h b/src/xrGame/EffectorZoomInertion.h index 7fdfe4e55b0..6bb7574cb34 100644 --- a/src/xrGame/EffectorZoomInertion.h +++ b/src/xrGame/EffectorZoomInertion.h @@ -1,7 +1,7 @@ #pragma once #include "CameraEffector.h" -#include "../xrEngine/cameramanager.h" +#include "xrEngine/cameramanager.h" #include "WeaponMagazined.h" class CEffectorZoomInertion : public CEffectorCam diff --git a/src/xrGame/ElectricBall.cpp b/src/xrGame/ElectricBall.cpp index 730ac347d56..d5d348867cf 100644 --- a/src/xrGame/ElectricBall.cpp +++ b/src/xrGame/ElectricBall.cpp @@ -5,7 +5,7 @@ #include "stdafx.h" #include "ElectricBall.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CElectricBall::CElectricBall(void) diff --git a/src/xrGame/EliteDetector.cpp b/src/xrGame/EliteDetector.cpp index c0dbcf09a0e..9b41af9f309 100644 --- a/src/xrGame/EliteDetector.cpp +++ b/src/xrGame/EliteDetector.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "EliteDetector.h" #include "player_hud.h" -#include "../Include/xrRender/UIRender.h" +#include "Include/xrRender/UIRender.h" #include "ui/UIXmlInit.h" #include "ui/xrUIXmlParser.h" #include "ui/UIStatic.h" diff --git a/src/xrGame/EliteDetector.h b/src/xrGame/EliteDetector.h index 9aca6359dc4..0ef110609e1 100644 --- a/src/xrGame/EliteDetector.h +++ b/src/xrGame/EliteDetector.h @@ -1,6 +1,6 @@ #pragma once #include "CustomDetector.h" -#include "level.h" +#include "Level.h" class CUIArtefactDetectorElite; diff --git a/src/xrGame/Entity.cpp b/src/xrGame/Entity.cpp index c30470185a9..c9e1b21bafa 100644 --- a/src/xrGame/Entity.cpp +++ b/src/xrGame/Entity.cpp @@ -7,12 +7,12 @@ #include "actor.h" #include "xrserver_objects_alife_monsters.h" #include "entity.h" -#include "level.h" +#include "Level.h" #include "seniority_hierarchy_holder.h" #include "team_hierarchy_holder.h" #include "squad_hierarchy_holder.h" #include "group_hierarchy_holder.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "monster_community.h" #include "ai_space.h" #include "alife_simulator.h" diff --git a/src/xrGame/EntityCondition.cpp b/src/xrGame/EntityCondition.cpp index 6a1688cf76d..5d81e15cd36 100644 --- a/src/xrGame/EntityCondition.cpp +++ b/src/xrGame/EntityCondition.cpp @@ -4,11 +4,11 @@ #include "customoutfit.h" #include "inventory.h" #include "wound.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" #include "entity_alive.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" #include "object_broker.h" #include "ActorHelmet.h" diff --git a/src/xrGame/Explosive.cpp b/src/xrGame/Explosive.cpp index 1e8fbd80507..fab926991fc 100644 --- a/src/xrGame/Explosive.cpp +++ b/src/xrGame/Explosive.cpp @@ -6,7 +6,7 @@ #include "explosive.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "entity.h" //#include "PSObject.h" #include "ParticlesObject.h" @@ -16,25 +16,25 @@ #include "actor.h" #include "actoreffector.h" -#include "level.h" +#include "Level.h" #include "level_bullet_manager.h" #include "xrmessages.h" #include "xrEngine/GameMtlLib.h" #ifdef DEBUG -# include "../xrEngine/StatGraph.h" +# include "xrEngine/StatGraph.h" # include "PHDebug.h" #endif //#include "Physics.h" -#include "../xrphysics/MathUtils.h" -//#include "../xrphysics/phvalidevalues.h" -#include "../xrphysics/iActivationShape.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/MathUtils.h" +//#include "xrPhysics/phvalidevalues.h" +#include "xrPhysics/iActivationShape.h" +#include "xrPhysics/iphworld.h" #include "game_base_space.h" #include "profiler.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #define EFFECTOR_RADIUS 30.f const u16 TEST_RAYS_PER_OBJECT=5; const u16 BLASTED_OBJ_PROCESSED_PER_FRAME=3; diff --git a/src/xrGame/Explosive.h b/src/xrGame/Explosive.h index 04722818c18..9b606f84b56 100644 --- a/src/xrGame/Explosive.h +++ b/src/xrGame/Explosive.h @@ -4,12 +4,12 @@ #pragma once -#include "../xrEngine/Render.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/Render.h" +#include "xrEngine/feel_touch.h" #include "inventory_item.h" #include "ai_sounds.h" #include "script_export_space.h" -#include "../xrphysics/DamageSource.h" +#include "xrPhysics/DamageSource.h" #include "wallmark_manager.h" #include "ParticlesObject.h" class IRender_Light; diff --git a/src/xrGame/ExplosiveRocket.cpp b/src/xrGame/ExplosiveRocket.cpp index 05ffeec699a..e3b4c05eb65 100644 --- a/src/xrGame/ExplosiveRocket.cpp +++ b/src/xrGame/ExplosiveRocket.cpp @@ -4,10 +4,10 @@ ////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ExplosiveRocket.h" #include "physicsshellholder.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" CExplosiveRocket::CExplosiveRocket() diff --git a/src/xrGame/FadedBall.cpp b/src/xrGame/FadedBall.cpp index de86e3422da..e8973a967eb 100644 --- a/src/xrGame/FadedBall.cpp +++ b/src/xrGame/FadedBall.cpp @@ -5,7 +5,7 @@ #include "stdafx.h" #include "FadedBall.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CFadedBall::CFadedBall(void) diff --git a/src/xrGame/GameObject.cpp b/src/xrGame/GameObject.cpp index 1b1c38270c0..cd0f9b83da7 100644 --- a/src/xrGame/GameObject.cpp +++ b/src/xrGame/GameObject.cpp @@ -1,13 +1,13 @@ #include "pch_script.h" #include "GameObject.h" -//#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/RenderVisual.h" -#include "../xrphysics/PhysicsShell.h" +//#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/RenderVisual.h" +#include "xrPhysics/PhysicsShell.h" #include "ai_space.h" #include "CustomMonster.h" #include "physicobject.h" #include "HangingLamp.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "game_sv_single.h" #include "level_graph.h" #include "ph_shell_interface.h" @@ -16,14 +16,14 @@ #include "xrServer_Objects_ALife_Items.h" #include "game_cl_base.h" #include "object_factory.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ai_object_location_impl.h" #include "game_graph.h" #include "ai_debug.h" -#include "../xrEngine/igame_level.h" -#include "level.h" +#include "xrEngine/igame_level.h" +#include "Level.h" #include "script_callback_ex.h" -#include "../xrphysics/MathUtils.h" +#include "xrPhysics/MathUtils.h" #include "game_cl_base_weapon_usage_statistic.h" #include "game_cl_mp.h" #include "reward_event_generator.h" @@ -31,7 +31,7 @@ #include "ai_obstacle.h" #include "magic_box3.h" #include "animation_movement_controller.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" extern MagicBox3 MagicMinBox (int iQuantity, const Fvector* akPoint); #pragma warning(push) diff --git a/src/xrGame/GameObject.h b/src/xrGame/GameObject.h index 448aff3bb27..52bb9b02b50 100644 --- a/src/xrGame/GameObject.h +++ b/src/xrGame/GameObject.h @@ -6,7 +6,7 @@ #define AFX_GAMEOBJECT_H__3DA72D03_C759_4688_AEBB_89FA812AA873__INCLUDED_ #pragma once -#include "../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" #include "xrServer_Space.h" #include "alife_space.h" #include "UsableScriptObject.h" diff --git a/src/xrGame/GamePersistent.cpp b/src/xrGame/GamePersistent.cpp index 1e38721d58e..f6d9b8aafe4 100644 --- a/src/xrGame/GamePersistent.cpp +++ b/src/xrGame/GamePersistent.cpp @@ -1,14 +1,14 @@ #include "pch_script.h" #include "gamepersistent.h" #include "xrCore/FMesh.hpp" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" #include "xrEngine/GameMtlLib.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "profiler.h" #include "MainMenu.h" #include "UICursor.h" #include "game_base_space.h" -#include "level.h" +#include "Level.h" #include "ParticlesObject.h" #include "game_base_space.h" #include "stalker_animation_data_storage.h" @@ -20,14 +20,14 @@ #include "UI/UItextureMaster.h" -#include "../xrEngine/xrSASH.h" +#include "xrEngine/xrSASH.h" #include "ai_space.h" -#include "../xrServerEntities/script_engine.h" +#include "xrServerEntities/script_engine.h" #include "holder_custom.h" #include "game_cl_base.h" #include "xrserver_objects_alife_monsters.h" -#include "../xrServerEntities/xrServer_Object_Base.h" +#include "xrServerEntities/xrServer_Object_Base.h" #include "UI/UIGameTutorial.h" #ifndef MASTER_GOLD @@ -807,7 +807,7 @@ void CGamePersistent::OnRenderPPUI_PP() MainMenu()->OnRenderPPUI_PP(); } #include "string_table.h" -#include "../xrEngine/x_ray.h" +#include "xrEngine/x_ray.h" void CGamePersistent::LoadTitle(bool change_tip, shared_str map_name) { pApp->LoadStage(); diff --git a/src/xrGame/GamePersistent.h b/src/xrGame/GamePersistent.h index 5ae67824f21..6dbfa06c152 100644 --- a/src/xrGame/GamePersistent.h +++ b/src/xrGame/GamePersistent.h @@ -2,7 +2,7 @@ #define GamePersistentH #pragma once -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" class CMainMenu; class CUICursor; class CParticlesObject; diff --git a/src/xrGame/GameTask.cpp b/src/xrGame/GameTask.cpp index e6a7a3b15cb..1c27361d6a0 100644 --- a/src/xrGame/GameTask.cpp +++ b/src/xrGame/GameTask.cpp @@ -6,7 +6,7 @@ #include "map_spot.h" #include "map_manager.h" -#include "level.h" +#include "Level.h" #include "actor.h" #include "script_engine.h" #include "script_callback_ex.h" diff --git a/src/xrGame/GameTask.h b/src/xrGame/GameTask.h index 9bdc47690c7..9c3d7ec14a1 100644 --- a/src/xrGame/GameTask.h +++ b/src/xrGame/GameTask.h @@ -1,9 +1,8 @@ #pragma once - #include "encyclopedia_article_defs.h" #include "GameTaskDefs.h" #include "script_export_space.h" -#include "../../sdk/include/luabind/functor.hpp" +#include "luabind/functor.hpp" class CGameTaskManager; class CMapLocation; diff --git a/src/xrGame/Geometry.cpp b/src/xrGame/Geometry.cpp deleted file mode 100644 index 8c4fa0a6186..00000000000 --- a/src/xrGame/Geometry.cpp +++ /dev/null @@ -1,774 +0,0 @@ -#include "stdafx.h" -#include "Geometry.h" -#include "PHDynamicData.h" -#include "ExtendedGeom.h" -#include "dcylinder//dCylinder.h" - -#include "../xrEngine/bone.h" - -//global -#ifdef DEBUG -# include "phdebug.h" -#endif // #ifdef DEBUG - -static void computeFinalTx(dGeomID geom_transform,dReal* final_pos,dReal* final_R) -{ - R_ASSERT2(dGeomGetClass(geom_transform)==dGeomTransformClass,"is not a geom transform"); - dGeomID obj=dGeomTransformGetGeom(geom_transform); - const dReal *R =dGeomGetRotation(geom_transform); - const dReal *pos=dGeomGetPosition(geom_transform); - dMULTIPLY0_331 (final_pos,R,dGeomGetPosition(obj)); - final_pos[0] += pos[0]; - final_pos[1] += pos[1]; - final_pos[2] += pos[2]; - dMULTIPLY0_333 (final_R,R,dGeomGetRotation(obj)); -} - -void GetBoxExtensions(dGeomID box,const dReal* axis, - const dReal *pos, const dReal *rot, - float center_prg,dReal* lo_ext,dReal* hi_ext) -{ - R_ASSERT2(dGeomGetClass(box)==dBoxClass,"is not a box"); - dVector3 length; - dGeomBoxGetLengths(box,length); - dReal dif=dDOT(pos,axis)-center_prg; - dReal ful_ext=dFabs(dDOT14(axis,rot+0))*length[0] - +dFabs(dDOT14(axis,rot+1))*length[1] - +dFabs(dDOT14(axis,rot+2))*length[2]; - ful_ext/=2.f; - *lo_ext=-ful_ext+dif; - *hi_ext=ful_ext+dif; -} - -void GetCylinderExtensions(dGeomID cyl,const dReal* axis, - const dReal *pos, const dReal *rot, - float center_prg,dReal* lo_ext,dReal* hi_ext) -{ - R_ASSERT2(dGeomGetClass(cyl)==dCylinderClassUser,"is not a cylinder"); - dReal radius,length; - dGeomCylinderGetParams(cyl,&radius,&length); - dReal dif=dDOT(pos,axis)-center_prg; - dReal _cos=dFabs(dDOT14(axis,rot+1)); - dReal cos1=dDOT14(axis,rot+0); - dReal cos3=dDOT14(axis,rot+2); - dReal _sin=_sqrt(cos1*cos1+cos3*cos3); - length/=2.f; - dReal ful_ext=_cos*length+_sin*radius; - *lo_ext=-ful_ext+dif; - *hi_ext=ful_ext+dif; -} - -void GetSphereExtensions(dGeomID sphere,const dReal* axis, - const dReal *pos, - float center_prg,dReal* lo_ext,dReal* hi_ext) -{ - R_ASSERT2(dGeomGetClass(sphere)==dSphereClass,"is not a sphere"); - dReal radius=dGeomSphereGetRadius(sphere); - dReal dif=dDOT(pos,axis)-center_prg; - *lo_ext=-radius+dif; - *hi_ext=radius+dif; -} - -void TransformedGeometryExtensionLocalParams(dGeomID geom_transform,const dReal* axis,float center_prg,dReal* local_axis,dReal& local_center_prg) -{ - R_ASSERT2(dGeomGetClass(geom_transform)==dGeomTransformClass,"is not a geom transform"); - const dReal* rot=dGeomGetRotation(geom_transform); - const dReal* pos=dGeomGetPosition(geom_transform); - dVector3 local_pos; - - dMULTIPLY1_331(local_axis,rot,axis); - dMULTIPLY1_331(local_pos,rot,pos); - local_center_prg=center_prg-dDOT(local_pos,local_axis); -} - - - -CODEGeom::CODEGeom() -{ - m_geom_transform=NULL; - m_bone_id=u16(-1); -} - -CODEGeom::~CODEGeom() -{ - if(m_geom_transform) destroy(); -} - -void CODEGeom::get_mass(dMass& m,const Fvector& ref_point, float density) -{ - get_mass(m); - dMassAdjust(&m,density*volume()); - Fvector l; - l.sub(local_center(),ref_point); - dMassTranslate(&m,l.x,l.y,l.z); -} - -void CODEGeom::get_mass(dMass& m,const Fvector& ref_point) -{ - get_mass(m); - Fvector l; - l.sub(local_center(),ref_point); - dMassTranslate(&m,l.x,l.y,l.z); -} - -void CODEGeom::add_self_mass(dMass& m,const Fvector& ref_point, float density) -{ - dMass self_mass; - get_mass(self_mass,ref_point,density); - dMassAdd(&m,&self_mass); -} - -void CODEGeom::add_self_mass(dMass& m,const Fvector& ref_point) -{ - dMass self_mass; - get_mass(self_mass,ref_point); - dMassAdd(&m,&self_mass); -} - -void CODEGeom::get_local_center_bt(Fvector& center) -{ - if(! m_geom_transform) return; - if(!geom()) //geom is not transformed - { - center.set(0.f,0.f,0.f); - } - center.set(*((const Fvector*)dGeomGetPosition(geom()))); -} -void CODEGeom::get_local_form_bt(Fmatrix& form) -{ - PHDynamicData::DMXPStoFMX(dGeomGetRotation(geom()),dGeomGetPosition(geom()),form); -} -void CODEGeom::get_global_center_bt(Fvector& center) -{ - center.set(*((const Fvector*)dGeomGetPosition(m_geom_transform))); - dVector3 add; - dMULTIPLY0_331 (add,dGeomGetRotation(m_geom_transform),dGeomGetPosition(geom())); - center.x += add[0]; - center.y += add[1]; - center.z += add[2]; -} -void CODEGeom:: get_xform( Fmatrix& form ) const -{ - VERIFY ( m_geom_transform ); - const dReal *rot =NULL ; - const dReal *pos =NULL ; - dVector3 p ; - dMatrix3 r ; - get_final_tx_bt( pos, rot, p, r ) ; - - PHDynamicData::DMXPStoFMX( rot, pos, form ); -} - -bool CODEGeom:: collide_fluids () const -{ - return !m_flags.test( SBoneShape::sfNoFogCollider ); -} -void CODEGeom:: get_Box ( Fmatrix& form, Fvector& sz )const -{ - get_xform( form ); - Fvector c; - t_get_box( this, form, sz, c ); - form.c = c; -} -/* -void CODEGeom::get_global_form_bt(Fmatrix& form) -{ - dMULTIPLY0_331 ((dReal*)(&form.c),dGeomGetRotation(m_geom_transform),dGeomGetPosition(geom())); - form.c.add(*((const Fvector*)dGeomGetPosition(m_geom_transform))); - dMULTIPLY3_333 ((dReal*)(&form),dGeomGetRotation(m_geom_transform),dGeomGetRotation(geom())); - //PHDynamicData::DMXtoFMX((dReal*)(&form),form); -} -*/ -void CODEGeom::set_static_ref_form(const Fmatrix& form) -{ - dGeomSetPosition(geometry_transform(),form.c.x,form.c.y,form.c.z); - Fmatrix33 m33; - m33.set(form); - dMatrix3 R; - PHDynamicData::FMX33toDMX(m33,R); - dGeomSetRotation(geometry_transform(),R); -} -void CODEGeom:: clear_motion_history() -{ - dGeomUserDataResetLastPos(geom()); -} - -void CODEGeom::set_build_position(const Fvector& /*ref_point*/) -{ - clear_motion_history(); -} - -void CODEGeom::set_body(dBodyID body) -{ - if(m_geom_transform) dGeomSetBody(m_geom_transform,body); -} - -void CODEGeom::add_to_space(dSpaceID space) -{ - if(m_geom_transform) dSpaceAdd(space,m_geom_transform); -} -void CODEGeom::remove_from_space(dSpaceID space) -{ - if(m_geom_transform) dSpaceRemove(space,m_geom_transform); -} -void CODEGeom::clear_cashed_tries() -{ - if(!m_geom_transform)return; - dGeomID g=geom(); - if(g) - { - VERIFY(dGeomGetUserData(g)); - dGeomUserDataClearCashedTries(g); - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomUserDataClearCashedTries(m_geom_transform); - } -} -void CODEGeom::set_material(u16 ul_material) -{ - if(!m_geom_transform) return; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - dGeomGetUserData(geom())->material=ul_material; - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomGetUserData(m_geom_transform)->material=ul_material; - } -} - -void CODEGeom::set_contact_cb(ContactCallbackFun* ccb) -{ - if(!m_geom_transform) return; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - dGeomUserDataSetContactCallback(geom(),ccb); - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomUserDataSetContactCallback(m_geom_transform,ccb); - } -} - -void CODEGeom::set_obj_contact_cb(ObjectContactCallbackFun* occb) -{ - if(!m_geom_transform) return; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - dGeomUserDataSetObjectContactCallback(geom(),occb); - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomUserDataSetObjectContactCallback(m_geom_transform,occb); - } -} -void CODEGeom::add_obj_contact_cb(ObjectContactCallbackFun* occb) -{ - if(!m_geom_transform) return; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - dGeomUserDataAddObjectContactCallback(geom(),occb); - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomUserDataAddObjectContactCallback(m_geom_transform,occb); - } -} -void CODEGeom::remove_obj_contact_cb(ObjectContactCallbackFun* occb) -{ - if(!m_geom_transform) return; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - dGeomUserDataRemoveObjectContactCallback(geom(),occb); - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomUserDataRemoveObjectContactCallback(m_geom_transform,occb); - } -} -void CODEGeom::set_callback_data(void *cd) -{ - if(!m_geom_transform) return; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - dGeomUserDataSetCallbackData(geom(),cd); - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomUserDataSetCallbackData(m_geom_transform,cd); - } -} -void* CODEGeom::get_callback_data() -{ - if(!m_geom_transform) return NULL; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - return dGeomGetUserData(geom())->callback_data; - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - return dGeomGetUserData(m_geom_transform)->callback_data; - } -} -void CODEGeom::set_ref_object(CPhysicsShellHolder* ro) -{ - if(!m_geom_transform) return; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - dGeomUserDataSetPhysicsRefObject(geom(),ro); - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomUserDataSetPhysicsRefObject(m_geom_transform,ro); - } -} - -void CODEGeom::set_ph_object(CPHObject* o) -{ - if(!m_geom_transform) return; - if(geom()) - { - VERIFY(dGeomGetUserData(geom())); - dGeomGetUserData(geom())->ph_object=o; - } - else - { - VERIFY(dGeomGetUserData(m_geom_transform)); - dGeomGetUserData(m_geom_transform)->ph_object=o; - } -} -void CODEGeom::move_local_basis(const Fmatrix& inv_new_mul_old) -{ - Fmatrix new_form; - get_local_form (new_form); - new_form.mulA_43 (inv_new_mul_old); - set_local_form (new_form); -} -void CODEGeom::build(const Fvector& ref_point) -{ - init(); - set_build_position(ref_point); -} -void CODEGeom::init() -{ - dGeomID geom=create(); - m_geom_transform=dCreateGeomTransform(0); - dGeomTransformSetCleanup(m_geom_transform,0); - dGeomSetData(m_geom_transform,0); - dGeomTransformSetGeom(m_geom_transform,geom); - dGeomTransformSetInfo(m_geom_transform,1); - dGeomCreateUserData(geom); - dGeomUserDataSetBoneId(geom,m_bone_id); -} -void CODEGeom::destroy() -{ - if(!m_geom_transform) return; - if(geom()) - { - dGeomDestroyUserData(geom()); - dGeomDestroy(geom()); - dGeomTransformSetGeom(m_geom_transform,0); - } - dGeomDestroyUserData(m_geom_transform); - dGeomDestroy(m_geom_transform); - m_geom_transform=NULL; -} - -CBoxGeom::CBoxGeom(const Fobb& box) -{ - m_box=box; -} - -void CBoxGeom::get_mass(dMass& m) -{ - Fvector& hside=m_box.m_halfsize; - dMassSetBox(&m,1.f,hside.x*2.f,hside.y*2.f,hside.z*2.f); - dMatrix3 DMatx; - PHDynamicData::FMX33toDMX(m_box.m_rotate,DMatx); - dMassRotate(&m,DMatx); -} - -float CBoxGeom::volume() -{ - return m_box.m_halfsize.x*m_box.m_halfsize.y*m_box.m_halfsize.z*8.f; -} - -float CBoxGeom::radius() -{ - return m_box.m_halfsize.x; -} -void CODEGeom::get_final_tx_bt(const dReal* &p, const dReal* &R,dReal *bufV, dReal *bufM) const -{ - VERIFY(m_geom_transform); - //dGeomID g = geometry_bt() ; - get_final_tx (m_geom_transform,p,R,bufV,bufM) ; - -} -void CODEGeom::get_final_tx(dGeomID g,const dReal* &p,const dReal* &R,dReal * bufV, dReal* bufM) -{ - if(is_transform(g)) - { - computeFinalTx(g,bufV,bufM); - R=bufM;p=bufV; - }else - { - R=dGeomGetRotation(g); - p=dGeomGetPosition(g); - } -} - - -void CODEGeom:: set_local_form_bt ( const Fmatrix& xform ) -{ - dMatrix3 R; - PHDynamicData::FMXtoDMX( xform,R ); - dGeomSetRotation( geom(), R ); - dGeomSetPosition( geom(), xform.c.x, xform.c.y, xform.c.z ); -} - -void CBoxGeom::get_Extensions( const Fvector& axis, float center_prg, float& lo_ext, float& hi_ext ) const -{ - - VERIFY ( m_geom_transform ); - const dReal *rot =NULL ; - const dReal *pos =NULL ; - dVector3 p ; - dMatrix3 r ; - dGeomID g =geometry_bt() ; - get_final_tx_bt( pos, rot, p, r ) ; - GetBoxExtensions( g, cast_fp(axis), pos, rot, center_prg, &lo_ext, &hi_ext ); -} - -void CBoxGeom::get_max_area_dir_bt(Fvector& dir) -{ - dVector3 length,ddir; - dGeomBoxGetLengths (geometry(),length); - dReal S1=length[0]*length[1],S2=length[0]*length[2],S3=length[1]*length[2]; - const dReal* R= dGeomGetRotation(geometry()); - if(S1>S2) - { - if(S1>S3) - { - ddir[0]=R[2];ddir[1]=R[6];ddir[2]=R[10];//S1 - } - else - { - ddir[0]=R[0];ddir[1]=R[4];ddir[2]=R[8];//S3 - } - } - else - { - if(S2>S3) - { - ddir[0]=R[1];ddir[1]=R[5];ddir[2]=R[9];//S2 - } - else - { - ddir[0]=R[0];ddir[1]=R[4];ddir[2]=R[8];//S3 - } - } - - if(geom()) - { - const dReal* TR=dGeomGetRotation(geometry_transform()); - dir.x=dDOT(ddir,TR); - dir.y=dDOT(ddir,TR+4); - dir.z=dDOT(ddir,TR+8); - } - else - { - dir.x=ddir[0]; - dir.y=ddir[1]; - dir.z=ddir[2]; - } -} - -const Fvector& CBoxGeom::local_center() -{ - return m_box.m_translate; -} - -void CBoxGeom::get_local_form(Fmatrix& form) -{ - form._14=0; - form._24=0; - form._34=0; - form._44=1; - form.i.set(m_box.m_rotate.i); - form.j.set(m_box.m_rotate.j); - form.k.set(m_box.m_rotate.k); - form.c.set(m_box.m_translate); -} -void CBoxGeom::set_local_form(const Fmatrix& form) -{ - m_box.m_rotate.i.set(form.i); - m_box.m_rotate.j.set(form.j); - m_box.m_rotate.k.set(form.k); - m_box.m_translate.set(form.c); -} - - -dGeomID CBoxGeom::create() -{ - -return dCreateBox(0, - m_box.m_halfsize.x*2.f, - m_box.m_halfsize.y*2.f, - m_box.m_halfsize.z*2.f - ); -} -void CBoxGeom::set_size(const Fvector& half_size ) -{ - m_box.m_halfsize.set( half_size ); - VERIFY( geom() ); - dGeomBoxSetLengths( geom(), - m_box.m_halfsize.x*2.f, - m_box.m_halfsize.y*2.f, - m_box.m_halfsize.z*2.f - ); -} -void CBoxGeom::get_size(Fvector& half_size ) const -{ - VERIFY( geom() ); - dGeomBoxGetLengths( geom(), - cast_fp( half_size ) - ); - half_size.mul( 0.5f ); - -} -void CBoxGeom::set_build_position(const Fvector& ref_point) -{ - - inherited::set_build_position(ref_point); - - dVector3 local_position={m_box.m_translate.x-ref_point.x, - m_box.m_translate.y-ref_point.y, - m_box.m_translate.z-ref_point.z - }; - dGeomSetPosition(geom(), - local_position[0], - local_position[1], - local_position[2] - ); - dMatrix3 R; - PHDynamicData::FMX33toDMX(m_box.m_rotate,R); - dGeomSetRotation(geom(),R); -} - -CSphereGeom::CSphereGeom(const Fsphere& sphere) -{ - m_sphere=sphere; -} -void CSphereGeom::get_mass(dMass& m) -{ - dMassSetSphere(&m,1.f,m_sphere.R); -} - -float CSphereGeom::volume() -{ - return 4.f*M_PI*m_sphere.R*m_sphere.R*m_sphere.R/3.f; -} - -float CSphereGeom::radius() -{ - return m_sphere.R; -} - -void CSphereGeom::get_Extensions( const Fvector& axis, float center_prg, float& lo_ext, float& hi_ext )const -{ - VERIFY ( m_geom_transform ); - const dReal *rot =NULL ; - const dReal *pos =NULL ; - dVector3 p ; - dMatrix3 r ; - dGeomID g =geometry_bt() ; - get_final_tx_bt( pos, rot, p, r ) ; - GetSphereExtensions( g, cast_fp( axis ), pos, center_prg, &lo_ext, &hi_ext ); -} -const Fvector& CSphereGeom::local_center() -{ - return m_sphere.P; -} - -void CSphereGeom::get_local_form(Fmatrix& form) -{ - form.identity(); - form.c.set(m_sphere.P); -} -void CSphereGeom::set_local_form(const Fmatrix& form) -{ - m_sphere.P.set(form.c); -} -dGeomID CSphereGeom::create() -{ - return dCreateSphere(0,m_sphere.R); -} - -void CSphereGeom::set_build_position(const Fvector& ref_point) -{ - - inherited::set_build_position(ref_point); - dVector3 local_position={ - m_sphere.P.x-ref_point.x, - m_sphere.P.y-ref_point.y, - m_sphere.P.z-ref_point.z - }; - - dGeomSetPosition(geom(),local_position[0],local_position[1],local_position[2]); -} - -CCylinderGeom::CCylinderGeom(const Fcylinder& cyl) -{ - m_cylinder=cyl; -} -void CCylinderGeom::get_mass(dMass& m) -{ - dMassSetCylinder(&m,1.f,2,m_cylinder.m_radius,m_cylinder.m_height); - dMatrix3 DMatx; - Fmatrix33 m33; - m33.j.set(m_cylinder.m_direction); - Fvector::generate_orthonormal_basis(m33.j,m33.k,m33.i); - PHDynamicData::FMX33toDMX(m33,DMatx); - dMassRotate(&m,DMatx); -} - -float CCylinderGeom::volume() -{ - return M_PI*m_cylinder.m_radius*m_cylinder.m_radius*m_cylinder.m_height; -} - -float CCylinderGeom::radius() -{ - return m_cylinder.m_radius; -} - -void CCylinderGeom::get_Extensions( const Fvector& axis, float center_prg, float& lo_ext, float& hi_ext )const -{ - VERIFY (m_geom_transform) ; - const dReal *rot =NULL ; - const dReal *pos =NULL ; - dVector3 p ; - dMatrix3 r ; - dGeomID g =geometry_bt() ; - get_final_tx_bt( pos, rot, p, r ) ; - GetCylinderExtensions( g, cast_fp( axis ), pos, rot, center_prg, &lo_ext, &hi_ext ); -} -const Fvector& CCylinderGeom::local_center() -{ - return m_cylinder.m_center; -} - -void CCylinderGeom::get_local_form(Fmatrix& form) -{ - form._14=0; - form._24=0; - form._34=0; - form._44=1; - form.j.set(m_cylinder.m_direction); - Fvector::generate_orthonormal_basis(form.j,form.k,form.i); - form.c.set(m_cylinder.m_center); -} -void CCylinderGeom::set_local_form(const Fmatrix& form) -{ - m_cylinder.m_center.set(form.c); - m_cylinder.m_direction.set(form.j); -} -dGeomID CCylinderGeom::create() -{ -return dCreateCylinder( - 0, - m_cylinder.m_radius, - m_cylinder.m_height - ); -} -void CCylinderGeom::set_build_position(const Fvector& ref_point) -{ - - inherited::set_build_position(ref_point); - dVector3 local_position={ - m_cylinder.m_center.x-ref_point.x, - m_cylinder.m_center.y-ref_point.y, - m_cylinder.m_center.z-ref_point.z - }; - - dGeomSetPosition( - geom(), - local_position[0], - local_position[1], - local_position[2] - ); - dMatrix3 R; - Fmatrix33 m33; - m33.j.set(m_cylinder.m_direction); - Fvector::generate_orthonormal_basis(m33.j,m33.k,m33.i); - PHDynamicData::FMX33toDMX(m33,R); - dGeomSetRotation(geom(),R); -} - - - -#ifdef DEBUG -void CODEGeom:: dbg_draw ( float scale, u32 color, Flags32 flags )const -{ - Fmatrix m; - get_xform( m ); - DBG_DrawMatrix( m, 0.02f ); - DBG_DrawPoint( m.c, 0.001f, D3DCOLOR_XRGB(0, 255, 255 ) ); -} - - - -void CBoxGeom:: dbg_draw ( float scale, u32 color, Flags32 flags )const -{ - inherited::dbg_draw( scale, color, flags ); - - dGeomID g = geom(); - VERIFY( g ); - - Fmatrix m; - get_xform( m ); - - dVector3 l; - dGeomBoxGetLengths( g, l ); - - DBG_DrawOBB( m, cast_fv( l ).mul( 0.5f ), color ); -} - -void CSphereGeom:: dbg_draw ( float scale, u32 color, Flags32 flags )const -{ - inherited::dbg_draw( scale, color, flags ); - - Fmatrix m; - get_xform( m ); - - dGeomID g = geom(); - VERIFY( g ); - dGeomSphereGetRadius( g ); - - DBG_DrawPoint( m.c, dGeomSphereGetRadius( g ), color ); - -} - -void CCylinderGeom:: dbg_draw ( float scale, u32 color, Flags32 flags )const -{ - inherited::dbg_draw( scale, color, flags ); -} -#endif \ No newline at end of file diff --git a/src/xrGame/Geometry.h b/src/xrGame/Geometry.h deleted file mode 100644 index 983983d2bc1..00000000000 --- a/src/xrGame/Geometry.h +++ /dev/null @@ -1,216 +0,0 @@ -#ifndef GEOMETRY_H -#define GEOMETRY_H -#include "PhysicsCommon.h" -#include "ExtendedGeom.h" - -#include "../xrEngine/iphysicsgeometry.h" - -//this is equivalent dMULTIPLYOP0_333 whith consequent transposion of A -#define dMULTIPLYOP3_333(A,op,B,C) \ - (A)[0] op dDOT14((B), (C)); \ - (A)[1] op dDOT14((B+4),(C)); \ - (A)[2] op dDOT14((B+8),(C)); \ - (A)[4] op dDOT14((B), (C+1)); \ - (A)[5] op dDOT14((B+4),(C+1)); \ - (A)[6] op dDOT14((B+8),(C+1)); \ - (A)[8] op dDOT14((B), (C+2)); \ - (A)[9] op dDOT14((B+4),(C+2)); \ - (A)[10] op dDOT14((B+8),(C+2)); - -inline void dMULTIPLY3_333(dReal *A, const dReal *B, const dReal *C) -{ dMULTIPLYOP3_333(A,=,B,C) } - - -class CGameObject; -class CPHObject; -class CODEGeom: -public IPhysicsGeometry -{ -protected: - dGeomID m_geom_transform; - u16 m_bone_id; - Flags16 m_flags; -protected: - - -public: - //get - virtual float volume () =0; - virtual void get_mass ( dMass& m ) =0; //unit dencity mass; - void get_mass ( dMass& m,const Fvector& ref_point, float density) ; - void get_mass ( dMass& m,const Fvector& ref_point) ; - void add_self_mass ( dMass& m,const Fvector& ref_point) ; - void add_self_mass ( dMass& m,const Fvector& ref_point, float density) ; - void get_local_center_bt ( Fvector& center ) ; //for built - void get_global_center_bt( Fvector& center ) ; //for built - void get_local_form_bt ( Fmatrix& form ) ; //for built - virtual void get_xform ( Fmatrix& form ) const ; -#ifdef DEBUG - virtual void dbg_draw ( float scale, u32 color, Flags32 flags ) const; -#endif - virtual void get_Box ( Fmatrix& form, Fvector& sz )const ; - virtual bool collide_fluids () const ; - void set_static_ref_form (const Fmatrix& form) ; //for built - virtual void get_max_area_dir_bt (Fvector& dir) =0; - virtual float radius () =0; - virtual void get_Extensions (const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext)const =0; - - void clear_cashed_tries () ; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - IC dGeomID geom() - { - return dGeomTransformGetGeom(m_geom_transform); - } - IC dGeomID geometry_transform () - { - return m_geom_transform; - } - IC dGeomID geometry() - { - return m_geom_transform ? (geom() ? geom() : m_geom_transform) : NULL; - } - IC dGeomID geometry_bt() - { - if(is_transformed_bt()) return geom() ; - else return geometry_transform(); - - } - IC const dGeomID geom()const - { - return dGeomTransformGetGeom(m_geom_transform); - } - IC const dGeomID geometry_transform ()const - { - return m_geom_transform; - } - IC const dGeomID geometry()const - { - return m_geom_transform ? (geom() ? geom() : m_geom_transform) : NULL; - } - IC const dGeomID geometry_bt()const - { - if(is_transformed_bt()) return geom() ; - else return geometry_transform(); - - } -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ICF static bool is_transform(dGeomID g) - { - return dGeomGetClass(g)==dGeomTransformClass; - } - IC bool is_transformed_bt() const - { - return is_transform(m_geom_transform); - } - IC u16& element_position() - { - return dGeomGetUserData(geometry())->element_position; - } -virtual const Fvector& local_center () =0; -virtual void get_local_form (Fmatrix& form) =0; -virtual void set_local_form (const Fmatrix& form) =0; - void set_local_form_bt ( const Fmatrix& xform ) ; - //set - //element part - void set_body (dBodyID body) ; - void set_bone_id (u16 id) {m_bone_id=id ;} - u16 bone_id () {return m_bone_id ;} - void set_shape_flags ( const Flags16 &_flags ) { m_flags = _flags ;} - void add_to_space (dSpaceID space) ; - void remove_from_space (dSpaceID space) ; - void set_material (u16 ul_material) ; - void set_contact_cb (ContactCallbackFun* ccb) ; - void set_obj_contact_cb (ObjectContactCallbackFun* occb) ; - void add_obj_contact_cb (ObjectContactCallbackFun* occb) ; - void remove_obj_contact_cb(ObjectContactCallbackFun* occb) ; - void set_callback_data (void *cd) ; - void *get_callback_data () ; - void set_ref_object (CPhysicsShellHolder* ro) ; - void set_ph_object (CPHObject* o) ; - - //build/destroy -protected: - void init () ; - void get_final_tx_bt ( const dReal* &p, const dReal* &R, dReal * bufV, dReal* bufM ) const; - virtual dGeomID create () =0; -public: - static void get_final_tx ( dGeomID g, const dReal* &p, const dReal* &R,dReal * bufV, dReal* bufM ); - void build ( const Fvector& ref_point ) ; - virtual void set_build_position ( const Fvector& ref_point ) ;//for build geom - void clear_motion_history(); - void move_local_basis ( const Fmatrix& inv_new_mul_old ) ; - void destroy () ; - CODEGeom () ; - virtual ~ CODEGeom () ; -}; - -class CBoxGeom : public CODEGeom -{ - typedef CODEGeom inherited ; - Fobb m_box; -public: - CBoxGeom (const Fobb& box) ; -// virtual ~CBoxGeom (const Fobb& box) ; - virtual float volume () ; - virtual float radius () ; - virtual void get_Extensions (const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext)const ; - virtual void get_max_area_dir_bt (Fvector& dir) ; - virtual void get_mass (dMass& m) ;//unit dencity mass; -virtual const Fvector& local_center () ; - virtual void get_local_form (Fmatrix& form) ; -virtual void set_local_form (const Fmatrix& form) ; - virtual dGeomID create () ; - virtual void set_build_position (const Fvector& ref_point) ; - void set_size (const Fvector& half_size ) ; - void get_size (Fvector& half_size ) const ; -private: -#ifdef DEBUG - virtual void dbg_draw ( float scale, u32 color, Flags32 flags ) const ; -#endif -}; - -class CSphereGeom : public CODEGeom -{ - typedef CODEGeom inherited ; - Fsphere m_sphere; -public: - CSphereGeom (const Fsphere& sphere) ; - virtual float volume () ; - virtual float radius () ; - virtual void get_Extensions (const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext)const; - virtual void get_max_area_dir_bt (Fvector& dir) {}; - virtual void get_mass (dMass& m) ;//unit dencity mass; -virtual const Fvector& local_center () ; - virtual void get_local_form (Fmatrix& form) ; - virtual void set_local_form (const Fmatrix& form) ; - virtual dGeomID create () ; - virtual void set_build_position (const Fvector& ref_point) ; -private: -#ifdef DEBUG - virtual void dbg_draw ( float scale, u32 color, Flags32 flags ) const; -#endif -}; -class CCylinderGeom : public CODEGeom -{ - typedef CODEGeom inherited ; - Fcylinder m_cylinder; -public: - CCylinderGeom (const Fcylinder& cyl) ; - virtual float volume () ; - virtual float radius () ; - virtual void get_Extensions (const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext)const; - virtual void get_max_area_dir_bt (Fvector& dir) {}; -virtual const Fvector& local_center () ; - virtual void get_mass (dMass& m) ;//unit dencity mass; - virtual void get_local_form (Fmatrix& form) ; - virtual void set_local_form (const Fmatrix& form) ; - virtual dGeomID create () ; - virtual void set_build_position (const Fvector& ref_point) ; - private: -#ifdef DEBUG - virtual void dbg_draw ( float scale, u32 color, Flags32 flags ) const; -#endif -}; -#endif //GEOMETRY_H \ No newline at end of file diff --git a/src/xrGame/GeometryBits.cpp b/src/xrGame/GeometryBits.cpp deleted file mode 100644 index 52782abdbed..00000000000 --- a/src/xrGame/GeometryBits.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include "stdafx.h" - -#include "GeometryBits.h" - -#include "phworld.h" -#include "geometry.h" - -static enum geom_category { - gct_static = 1<< 0, - gct_dynamic = 1<< 1 -}; - - -void CPHGeometryBits::init_geom( CODEGeom &g ) -{ - -} - -void CPHGeometryBits::init_geom( CPHMesh &g ) -{ - dGeomSetCategoryBits( g.GetGeom(), gct_static ); -} -void CPHGeometryBits::set_ignore_static( CODEGeom &g ) -{ - dGeomSetCollideBits( g.geometry_transform(), dGeomGetCollideBits(g.geometry_transform()) & ~gct_static ); -} \ No newline at end of file diff --git a/src/xrGame/GeometryBits.h b/src/xrGame/GeometryBits.h deleted file mode 100644 index 6101a5053d1..00000000000 --- a/src/xrGame/GeometryBits.h +++ /dev/null @@ -1,12 +0,0 @@ -#pragma once - - -class CPHMesh; -class CODEGeom; -class CPHGeometryBits -{ - public: - static void init_geom( CODEGeom &g ); - static void init_geom( CPHMesh &g ); - static void set_ignore_static( CODEGeom &g ); -}; \ No newline at end of file diff --git a/src/xrGame/GlobalFeelTouch.hpp b/src/xrGame/GlobalFeelTouch.hpp index 47efb8a3a01..99a6b54a88f 100644 --- a/src/xrGame/GlobalFeelTouch.hpp +++ b/src/xrGame/GlobalFeelTouch.hpp @@ -1,7 +1,7 @@ #ifndef GLOBAL_FEEL_TOUCH_HPP #define GLOBAL_FEEL_TOUCH_HPP -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" //this class implements only denie functionality class GlobalFeelTouch : public Feel::Touch diff --git a/src/xrGame/GraviArtifact.cpp b/src/xrGame/GraviArtifact.cpp index 2650ad79820..c4a843aa934 100644 --- a/src/xrGame/GraviArtifact.cpp +++ b/src/xrGame/GraviArtifact.cpp @@ -6,12 +6,12 @@ #include "stdafx.h" #include "GraviArtifact.h" -#include "../xrphysics/PhysicsShell.h" -#include "level.h" +#include "xrPhysics/PhysicsShell.h" +#include "Level.h" #include "xrmessages.h" #include "game_cl_base.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrphysics/IPHWorld.h" +#include "Include/xrRender/Kinematics.h" +#include "xrPhysics/IPHWorld.h" //extern CPHWorld* ph_world; #define CHOOSE_MAX(x,inst_x,y,inst_y,z,inst_z)\ if(x>y)\ diff --git a/src/xrGame/GraviZone.cpp b/src/xrGame/GraviZone.cpp index 1c77825833c..c70172f1985 100644 --- a/src/xrGame/GraviZone.cpp +++ b/src/xrGame/GraviZone.cpp @@ -2,7 +2,7 @@ #include "gravizone.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "entity_alive.h" #include "phmovementcontrol.h" #include "xrmessages.h" diff --git a/src/xrGame/Grenade.cpp b/src/xrGame/Grenade.cpp index 151d37633df..f9c2b47f63a 100644 --- a/src/xrGame/Grenade.cpp +++ b/src/xrGame/Grenade.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "grenade.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" //.#include "WeaponHUD.h" #include "entity.h" #include "ParticlesObject.h" #include "actor.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "xrmessages.h" #include "xr_level_controller.h" #include "game_cl_base.h" diff --git a/src/xrGame/Grenade.h b/src/xrGame/Grenade.h index f1356a9f713..ebe8e657789 100644 --- a/src/xrGame/Grenade.h +++ b/src/xrGame/Grenade.h @@ -1,7 +1,7 @@ #pragma once #include "missile.h" #include "explosive.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" class CGrenade : public CMissile, diff --git a/src/xrGame/HUDManager.cpp b/src/xrGame/HUDManager.cpp index a307096bfce..62f2b6fb9c3 100644 --- a/src/xrGame/HUDManager.cpp +++ b/src/xrGame/HUDManager.cpp @@ -2,8 +2,8 @@ #include "HUDManager.h" #include "hudtarget.h" #include "actor.h" -#include "../xrEngine/igame_level.h" -#include "../xrEngine/xr_input.h" +#include "xrEngine/igame_level.h" +#include "xrEngine/xr_input.h" #include "GamePersistent.h" #include "MainMenu.h" #include "grenade.h" diff --git a/src/xrGame/HUDManager.h b/src/xrGame/HUDManager.h index 43dbd0250ea..6ee032d9c9d 100644 --- a/src/xrGame/HUDManager.h +++ b/src/xrGame/HUDManager.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrEngine/CustomHUD.h" +#include "xrEngine/CustomHUD.h" #include "HitMarker.h" class CHUDTarget; diff --git a/src/xrGame/HUDTarget.cpp b/src/xrGame/HUDTarget.cpp index 9815ad6bdc0..121a862263a 100644 --- a/src/xrGame/HUDTarget.cpp +++ b/src/xrGame/HUDTarget.cpp @@ -2,12 +2,12 @@ #include "hudtarget.h" #include "xrEngine/GameMtlLib.h" -#include "../xrEngine/Environment.h" -#include "../xrEngine/CustomHUD.h" +#include "xrEngine/Environment.h" +#include "xrEngine/CustomHUD.h" #include "Entity.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #include "ui_base.h" #include "InventoryOwner.h" diff --git a/src/xrGame/HUDTarget.h b/src/xrGame/HUDTarget.h index 0ad2af0283d..c931b8c6e6f 100644 --- a/src/xrGame/HUDTarget.h +++ b/src/xrGame/HUDTarget.h @@ -1,7 +1,7 @@ #pragma once #include "HUDCrosshair.h" -#include "../xrcdb/xr_collide_defs.h" +#include "xrCDB/xr_collide_defs.h" class CHUDManager; diff --git a/src/xrGame/HairsZone.cpp b/src/xrGame/HairsZone.cpp index 60a07ce21c7..81604522c32 100644 --- a/src/xrGame/HairsZone.cpp +++ b/src/xrGame/HairsZone.cpp @@ -1,11 +1,11 @@ #include "pch_script.h" #include "HairsZone.h" -#include "level.h" +#include "Level.h" #include "PhysicsShellHolder.h" #include "entity_alive.h" #include "PHMovementControl.h" #include "CharacterPhysicsSupport.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" bool CHairsZone::BlowoutState() { bool result = inherited::BlowoutState(); diff --git a/src/xrGame/HairsZone.h b/src/xrGame/HairsZone.h index 2b0ae86af23..b29c3433b3d 100644 --- a/src/xrGame/HairsZone.h +++ b/src/xrGame/HairsZone.h @@ -1,8 +1,8 @@ #pragma once #include "CustomZone.h" -//#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/KinematicsAnimated.h" +//#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "ZoneVisual.h" #include "script_export_space.h" diff --git a/src/xrGame/HangingLamp.cpp b/src/xrGame/HangingLamp.cpp index e0b12d1e034..c85df15d790 100644 --- a/src/xrGame/HangingLamp.cpp +++ b/src/xrGame/HangingLamp.cpp @@ -1,14 +1,14 @@ #include "pch_script.h" #include "HangingLamp.h" -#include "../xrEngine/LightAnimLibrary.h" -#include "../xrEngine/xr_collide_form.h" -#include "../xrphysics/PhysicsShell.h" -#include "../xrphysics/MathUtils.h" +#include "xrEngine/LightAnimLibrary.h" +#include "xrEngine/xr_collide_form.h" +#include "xrPhysics/PhysicsShell.h" +#include "xrPhysics/MathUtils.h" //#include "Physics.h" #include "xrserver_objects_alife.h" //#include "PHElement.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "game_object_space.h" #include "script_callback_ex.h" #include "script_game_object.h" diff --git a/src/xrGame/Helicopter.cpp b/src/xrGame/Helicopter.cpp index c3ec23ded34..657fce5b18c 100644 --- a/src/xrGame/Helicopter.cpp +++ b/src/xrGame/Helicopter.cpp @@ -1,15 +1,15 @@ #include "pch_script.h" #include "helicopter.h" #include "xrserver_objects_alife.h" -#include "../xrphysics/PhysicsShell.h" -#include "level.h" +#include "xrPhysics/PhysicsShell.h" +#include "Level.h" #include "ai_sounds.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "script_callback_ex.h" #include "game_object_space.h" #include "script_game_object.h" -#include "../xrEngine/LightAnimLibrary.h" +#include "xrEngine/LightAnimLibrary.h" //#include "physicscommon.h" #include "ui_base.h" //50fps fixed diff --git a/src/xrGame/Helicopter2.cpp b/src/xrGame/Helicopter2.cpp index e4c317fccfa..05037b657b4 100644 --- a/src/xrGame/Helicopter2.cpp +++ b/src/xrGame/Helicopter2.cpp @@ -1,15 +1,15 @@ #include "pch_script.h" #include "helicopter.h" -//#include "level.h" +//#include "Level.h" #include "script_game_object.h" //#include "game_object_space.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrEngine/LightAnimLibrary.h" -//#include "../xrphysics/PhysicsShell.h" +#include "Include/xrRender/Kinematics.h" +#include "xrEngine/LightAnimLibrary.h" +//#include "xrPhysics/PhysicsShell.h" #include "script_callback_ex.h" #include "ai/stalker/ai_stalker.h" #include "CustomZone.h" -#include "../xrphysics/MathUtils.h" +#include "xrPhysics/MathUtils.h" #include "actor.h" #include "physics_game.h" @@ -263,7 +263,7 @@ void CHelicopter::PHHit(SHit &H) #include "team_hierarchy_holder.h" #include "squad_hierarchy_holder.h" -#include "../xrphysics/extendedgeom.h" +#include "xrPhysics/extendedgeom.h" void CollisionCallbackDead(bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2) { do_colide=true; diff --git a/src/xrGame/HelicopterMovementManager.cpp b/src/xrGame/HelicopterMovementManager.cpp index 342f1a20e22..6fb3b46b218 100644 --- a/src/xrGame/HelicopterMovementManager.cpp +++ b/src/xrGame/HelicopterMovementManager.cpp @@ -1,6 +1,6 @@ #include "pch_script.h" #include "Helicopter.h" -#include "level.h" +#include "Level.h" #include "patrol_path.h" #include "patrol_path_storage.h" #include "script_game_object.h" diff --git a/src/xrGame/HelicopterWeapon.cpp b/src/xrGame/HelicopterWeapon.cpp index 28ee6cbe471..843785288fb 100644 --- a/src/xrGame/HelicopterWeapon.cpp +++ b/src/xrGame/HelicopterWeapon.cpp @@ -2,7 +2,7 @@ #include "helicopter.h" #include "ExplosiveRocket.h" #include "xrMessages.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "Level.h" void diff --git a/src/xrGame/Hit.cpp b/src/xrGame/Hit.cpp index a98325603e4..9e1167db938 100644 --- a/src/xrGame/Hit.cpp +++ b/src/xrGame/Hit.cpp @@ -5,7 +5,7 @@ #include "xrCore/Animation/Bone.hpp" #include "xrMessages.h" #include "Level.h" -#include "../xrphysics/mathutils.h" +#include "xrPhysics/mathutils.h" SHit::SHit(float powerA, Fvector &dirA, CObject *whoA, u16 elementA, Fvector p_in_bone_spaceA,\ float impulseA, ALife::EHitType hit_typeA, float armor_piercingA, bool AimBullet) { diff --git a/src/xrGame/HitMarker.cpp b/src/xrGame/HitMarker.cpp index b47ffb3e30e..23819c7dc27 100644 --- a/src/xrGame/HitMarker.cpp +++ b/src/xrGame/HitMarker.cpp @@ -1,14 +1,14 @@ // exxZERO Time Stamp AddIn. Document modified at : Thursday, March 07, 2002 14:12:50 , by user : Oles , from computer : OLES #include "stdafx.h" #include "HitMarker.h" -#include "../xrEngine/render.h" -#include "../xrEngine/LightAnimLibrary.h" +#include "xrEngine/render.h" +#include "xrEngine/LightAnimLibrary.h" #include "UIStaticItem.h" #include "grenade.h" -#include "../Include/xrRender/UIRender.h" -#include "../Include/xrRender/UIShader.h" +#include "Include/xrRender/UIRender.h" +#include "Include/xrRender/UIShader.h" //-------------------------------------------------------------------- diff --git a/src/xrGame/HitMarker.h b/src/xrGame/HitMarker.h index f31fd4a1323..8d393eefdcf 100644 --- a/src/xrGame/HitMarker.h +++ b/src/xrGame/HitMarker.h @@ -2,7 +2,7 @@ #define __XR_HITMARKER_H__ #pragma once -#include "../Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/FactoryPtr.h" class IUIShader; #include "ui_defs.h" diff --git a/src/xrGame/HudItem.cpp b/src/xrGame/HudItem.cpp index eaec7d7e4e7..e4657199bab 100644 --- a/src/xrGame/HudItem.cpp +++ b/src/xrGame/HudItem.cpp @@ -5,9 +5,9 @@ #include "actoreffector.h" #include "Missile.h" #include "xrmessages.h" -#include "level.h" +#include "Level.h" #include "inventory.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" #include "player_hud.h" #include "xrCore/Animation/SkeletonMotions.hpp" diff --git a/src/xrGame/IKFoot.cpp b/src/xrGame/IKFoot.cpp index d90b6ec36c3..834bd78a5f1 100644 --- a/src/xrGame/IKFoot.cpp +++ b/src/xrGame/IKFoot.cpp @@ -7,10 +7,10 @@ //#include "ode_include.h" -#include "../xrphysics/MathUtils.h" -#include "../include/xrrender/Kinematics.h" +#include "xrPhysics/MathUtils.h" +#include "Include/xrRender/Kinematics.h" #include "xrCore/Animation/Bone.hpp" -#include "../xrEngine/ennumerateVertices.h" +#include "xrEngine/ennumerateVertices.h" #include diff --git a/src/xrGame/IKLimbsController.cpp b/src/xrGame/IKLimbsController.cpp index b8c15c88cb7..4d5eea674d6 100644 --- a/src/xrGame/IKLimbsController.cpp +++ b/src/xrGame/IKLimbsController.cpp @@ -6,11 +6,11 @@ #include "physicsshellholder.h" #include "ik_anim_state.h" -#include "../xrphysics/mathutils.h" -#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/Kinematics.h" +#include "xrPhysics/mathutils.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/Kinematics.h" //#include "ode_include.h" -#include "characterphysicssupport.h" +#include "CharacterPhysicsSupport.h" #include "xrCore/Animation/Motion.hpp" #ifdef DEBUG # include "PHDebug.h" diff --git a/src/xrGame/InfoDocument.cpp b/src/xrGame/InfoDocument.cpp index b6ebdf21038..00c234e124e 100644 --- a/src/xrGame/InfoDocument.cpp +++ b/src/xrGame/InfoDocument.cpp @@ -4,7 +4,7 @@ /////////////////////////////////////////////////////////////// #include "stdafx.h" #include "InfoDocument.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "PDA.h" #include "inventoryowner.h" #include "xrserver_objects_alife_items.h" diff --git a/src/xrGame/Inventory.cpp b/src/xrGame/Inventory.cpp index 2e2a36a8e66..7bbfa80fb37 100644 --- a/src/xrGame/Inventory.cpp +++ b/src/xrGame/Inventory.cpp @@ -12,7 +12,7 @@ #include "script_engine.h" #include "xrmessages.h" #include "xr_level_controller.h" -#include "level.h" +#include "Level.h" #include "ai_space.h" #include "entitycondition.h" #include "game_base_space.h" diff --git a/src/xrGame/InventoryBox.cpp b/src/xrGame/InventoryBox.cpp index 8d809ffc6db..cd7a16a4dbe 100644 --- a/src/xrGame/InventoryBox.cpp +++ b/src/xrGame/InventoryBox.cpp @@ -1,6 +1,6 @@ #include "pch_script.h" #include "InventoryBox.h" -#include "level.h" +#include "Level.h" #include "actor.h" #include "game_object_space.h" @@ -83,7 +83,7 @@ void CInventoryBox::net_Destroy() { inherited::net_Destroy (); } -#include "../xrServerEntities/xrServer_Objects_Alife.h" +#include "xrServerEntities/xrServer_Objects_Alife.h" BOOL CInventoryBox::net_Spawn(CSE_Abstract* DC) { inherited::net_Spawn (DC); diff --git a/src/xrGame/InventoryOwner.cpp b/src/xrGame/InventoryOwner.cpp index 5e154689157..b2e81cc0f36 100644 --- a/src/xrGame/InventoryOwner.cpp +++ b/src/xrGame/InventoryOwner.cpp @@ -10,7 +10,7 @@ #include "script_game_object.h" #include "script_engine.h" #include "AI_PhraseDialogManager.h" -#include "level.h" +#include "Level.h" #include "game_base_space.h" #include "PhraseDialog.h" #include "xrserver.h" diff --git a/src/xrGame/Level_Bullet_Manager.cpp b/src/xrGame/Level_Bullet_Manager.cpp index 95cfb111874..78d1dba2d6a 100644 --- a/src/xrGame/Level_Bullet_Manager.cpp +++ b/src/xrGame/Level_Bullet_Manager.cpp @@ -13,8 +13,8 @@ #include "game_cl_mp.h" #include "reward_event_generator.h" -#include "../Include/xrRender/UIRender.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/UIRender.h" +#include "Include/xrRender/Kinematics.h" #ifdef DEBUG # include "debug_renderer.h" diff --git a/src/xrGame/Level_GameSpy_Funcs.cpp b/src/xrGame/Level_GameSpy_Funcs.cpp index 935bf7ceaca..4ccc3ca7677 100644 --- a/src/xrGame/Level_GameSpy_Funcs.cpp +++ b/src/xrGame/Level_GameSpy_Funcs.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" #include "Level.h" #include "xrMessages.h" -#include "../xrEngine/x_ray.h" +#include "xrEngine/x_ray.h" #include "GameSpy/GameSpy_GCD_Client.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" void CLevel::OnGameSpyChallenge (NET_Packet* P) { #ifndef MASTER_GOLD diff --git a/src/xrGame/Level_SLS_Default.cpp b/src/xrGame/Level_SLS_Default.cpp index 976c6ed53d8..eb833692503 100644 --- a/src/xrGame/Level_SLS_Default.cpp +++ b/src/xrGame/Level_SLS_Default.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "level.h" +#include "Level.h" #include "xrserver.h" void CLevel::SLS_Default () // Default/Editor Load diff --git a/src/xrGame/Level_SLS_Load.cpp b/src/xrGame/Level_SLS_Load.cpp index 0e3e9e2de3c..ca7f23a3844 100644 --- a/src/xrGame/Level_SLS_Load.cpp +++ b/src/xrGame/Level_SLS_Load.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "level.h" +#include "Level.h" void CLevel::net_Load (LPCSTR name) // Game Load { diff --git a/src/xrGame/Level_SLS_Save.cpp b/src/xrGame/Level_SLS_Save.cpp index 9aebf168951..56a3646c31e 100644 --- a/src/xrGame/Level_SLS_Save.cpp +++ b/src/xrGame/Level_SLS_Save.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "../xrEngine/xrLevel.h" +#include "xrEngine/xrLevel.h" #include "Level.h" #include "xrserver.h" diff --git a/src/xrGame/Level_bullet_manager_firetrace.cpp b/src/xrGame/Level_bullet_manager_firetrace.cpp index ff527a8d1f0..ae15afeaea8 100644 --- a/src/xrGame/Level_bullet_manager_firetrace.cpp +++ b/src/xrGame/Level_bullet_manager_firetrace.cpp @@ -7,17 +7,17 @@ #include "Level_Bullet_Manager.h" #include "entity.h" #include "xrEngine/GameMtlLib.h" -#include "level.h" +#include "Level.h" #include "gamepersistent.h" #include "game_cl_base.h" #include "xrmessages.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "Actor.h" #include "AI/Stalker/ai_stalker.h" #include "character_info.h" #include "game_cl_base_weapon_usage_statistic.h" -#include "../xrcdb/xr_collide_defs.h" -#include "../xrengine/xr_collide_form.h" +#include "xrCDB/xr_collide_defs.h" +#include "xrEngine/xr_collide_form.h" #include "weapon.h" #include "ik/math3d.h" #include "actor.h" diff --git a/src/xrGame/Level_input.cpp b/src/xrGame/Level_input.cpp index 444f74ce103..099b8b16cf1 100644 --- a/src/xrGame/Level_input.cpp +++ b/src/xrGame/Level_input.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" #include -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" #include "entity_alive.h" #include "game_sv_single.h" #include "alife_simulator.h" #include "alife_simulator_header.h" #include "level_graph.h" -#include "../xrEngine/fdemorecord.h" -#include "level.h" +#include "xrEngine/fdemorecord.h" +#include "Level.h" #include "xr_level_controller.h" #include "game_cl_base.h" #include "stalker_movement_manager_smart_cover.h" @@ -19,10 +19,10 @@ #include "huditem.h" #include "UIGameCustom.h" #include "UI/UIDialogWnd.h" -#include "../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" #include "saved_game_wrapper.h" -#include "../Include/xrRender/DebugRender.h" +#include "Include/xrRender/DebugRender.h" #ifdef DEBUG # include "ai/monsters/BaseMonster/base_monster.h" diff --git a/src/xrGame/Level_load.cpp b/src/xrGame/Level_load.cpp index b63421d383e..bc2e5562032 100644 --- a/src/xrGame/Level_load.cpp +++ b/src/xrGame/Level_load.cpp @@ -5,11 +5,11 @@ #include "script_process.h" #include "script_engine.h" #include "script_engine_space.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" -#include "../xrEngine/x_ray.h" +#include "xrEngine/x_ray.h" #include "xrEngine/GameMtlLib.h" -#include "../xrphysics/PhysicsCommon.h" +#include "xrPhysics/PhysicsCommon.h" #include "level_sounds.h" #include "GamePersistent.h" diff --git a/src/xrGame/Level_network.cpp b/src/xrGame/Level_network.cpp index 921c16f7116..ae143c5c934 100644 --- a/src/xrGame/Level_network.cpp +++ b/src/xrGame/Level_network.cpp @@ -18,9 +18,9 @@ #include "file_transfer.h" #include "UI/UIGameTutorial.h" #include "ui/UIPdaWnd.h" -#include "../xrNetServer/NET_AuthCheck.h" +#include "xrNetServer/NET_AuthCheck.h" -#include "../xrphysics/physicscommon.h" +#include "xrPhysics/physicscommon.h" ENGINE_API bool g_dedicated_server; const int max_objects_size = 2*1024; diff --git a/src/xrGame/Level_network_Demo.cpp b/src/xrGame/Level_network_Demo.cpp index 95f31fc276f..cb915476fd6 100644 --- a/src/xrGame/Level_network_Demo.cpp +++ b/src/xrGame/Level_network_Demo.cpp @@ -7,11 +7,11 @@ #include "actor.h" #include "game_cl_base.h" #include "game_cl_mp.h" -#include "../xrCore/stream_reader.h" +#include "xrCore/stream_reader.h" #include "Message_Filter.h" #include "DemoPlay_Control.h" #include "DemoInfo.h" -#include "../xrEngine/CameraManager.h" +#include "xrEngine/CameraManager.h" void CLevel::PrepareToSaveDemo () { diff --git a/src/xrGame/Level_network_compressed_updates.cpp b/src/xrGame/Level_network_compressed_updates.cpp index cab804e4af2..19314f48aa3 100644 --- a/src/xrGame/Level_network_compressed_updates.cpp +++ b/src/xrGame/Level_network_compressed_updates.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "Level.h" -#include "../xrCore/ppmd_compressor.h" -#include "../xrphysics/iphworld.h" +#include "xrCore/ppmd_compressor.h" +#include "xrPhysics/iphworld.h" #include "xrServer_updates_compressor.h" void CLevel::ProcessCompressedUpdate(NET_Packet& P, u8 const compress_type) diff --git a/src/xrGame/Level_network_digest_computer.cpp b/src/xrGame/Level_network_digest_computer.cpp index 2361e2f3e1a..f1fdb6a8ee8 100644 --- a/src/xrGame/Level_network_digest_computer.cpp +++ b/src/xrGame/Level_network_digest_computer.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "Level.h" -#include "../xrGameSpy/gamespy/md5.h" +#include "xrGameSpy/gamespy/md5.h" extern void GetCDKey_FromRegistry(char* CDKeyStr); char const * ComputeClientDigest(string128& dest) diff --git a/src/xrGame/Level_network_map_sync.cpp b/src/xrGame/Level_network_map_sync.cpp index 7b7578182e3..8b1692e8ccd 100644 --- a/src/xrGame/Level_network_map_sync.cpp +++ b/src/xrGame/Level_network_map_sync.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" -#include "level.h" +#include "Level.h" #include "xrServerMapSync.h" -#include "../xrCore/stream_reader.h" +#include "xrCore/stream_reader.h" #include "MainMenu.h" #include "string_table.h" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" static const u32 r_buffer_size = 131072; //128 Kb void CLevel::CalculateLevelCrc32() diff --git a/src/xrGame/Level_network_messages.cpp b/src/xrGame/Level_network_messages.cpp index 5e4f4351b84..1db98ece692 100644 --- a/src/xrGame/Level_network_messages.cpp +++ b/src/xrGame/Level_network_messages.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "entity.h" #include "xrserver_objects.h" -#include "level.h" +#include "Level.h" #include "xrmessages.h" #include "game_cl_base.h" #include "net_queue.h" @@ -15,7 +15,7 @@ #include "level_graph.h" #include "file_transfer.h" #include "message_filter.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphworld.h" extern LPCSTR map_ver_string; LPSTR remove_version_option(LPCSTR opt_str, LPSTR new_opt_str, u32 new_opt_str_size) diff --git a/src/xrGame/Level_network_spawn.cpp b/src/xrGame/Level_network_spawn.cpp index d536b7afc89..23d8d6b0ed5 100644 --- a/src/xrGame/Level_network_spawn.cpp +++ b/src/xrGame/Level_network_spawn.cpp @@ -1,14 +1,14 @@ #include "pch_script.h" #include "xrServer_Objects_ALife_All.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" #include "net_queue.h" #include "ai_space.h" #include "game_level_cross_table.h" #include "level_graph.h" #include "client_spawn_manager.h" -#include "../xrEngine/xr_object.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/IGame_Persistent.h" void CLevel::cl_Process_Spawn(NET_Packet& P) { diff --git a/src/xrGame/Level_network_start_client.cpp b/src/xrGame/Level_network_start_client.cpp index 253619c10b6..3f467f552dc 100644 --- a/src/xrGame/Level_network_start_client.cpp +++ b/src/xrGame/Level_network_start_client.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" //#include "PHdynamicdata.h" //#include "Physics.h" -#include "level.h" -#include "../xrEngine/x_ray.h" -#include "../xrEngine/igame_persistent.h" +#include "Level.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/igame_persistent.h" #include "ai_space.h" #include "game_cl_base.h" @@ -11,7 +11,7 @@ #include "file_transfer.h" #include "hudmanager.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphworld.h" #include "phcommander.h" diff --git a/src/xrGame/Level_start.cpp b/src/xrGame/Level_start.cpp index 4d607b18251..8b37c329250 100644 --- a/src/xrGame/Level_start.cpp +++ b/src/xrGame/Level_start.cpp @@ -1,14 +1,14 @@ #include "stdafx.h" -#include "level.h" +#include "Level.h" #include "Level_Bullet_Manager.h" #include "xrserver.h" #include "game_cl_base.h" #include "xrmessages.h" #include "xrGameSpyServer.h" -#include "../xrEngine/x_ray.h" -#include "../xrEngine/device.h" -#include "../xrEngine/IGame_Persistent.h" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/device.h" +#include "xrEngine/IGame_Persistent.h" +#include "xrEngine/xr_ioconsole.h" #include "MainMenu.h" #include "string_table.h" #include "UIGameCustom.h" diff --git a/src/xrGame/MainMenu.cpp b/src/xrGame/MainMenu.cpp index 449c64c6e49..4d9466f3040 100644 --- a/src/xrGame/MainMenu.cpp +++ b/src/xrGame/MainMenu.cpp @@ -2,9 +2,9 @@ #include "MainMenu.h" #include "UI/UIDialogWnd.h" #include "ui/UIMessageBoxEx.h" -#include "../xrEngine/xr_IOConsole.h" -#include "../xrEngine/IGame_Level.h" -#include "../xrEngine/CameraManager.h" +#include "xrEngine/xr_IOConsole.h" +#include "xrEngine/IGame_Level.h" +#include "xrEngine/CameraManager.h" #include "xr_Level_controller.h" #include "ui\UITextureMaster.h" #include "ui\UIXmlInit.h" @@ -16,7 +16,7 @@ #include "gamespy/GameSpy_Available.h" #include "gamespy/CdkeyDecode/cdkeydecode.h" #include "string_table.h" -#include "../xrCore/os_clipboard.h" +#include "xrCore/os_clipboard.h" #include "DemoInfo.h" #include "DemoInfo_Loader.h" diff --git a/src/xrGame/MainMenu.h b/src/xrGame/MainMenu.h index 7975f3c1473..e03ecc610ac 100644 --- a/src/xrGame/MainMenu.h +++ b/src/xrGame/MainMenu.h @@ -9,8 +9,8 @@ class CGameSpy_Full; class demo_info_loader; -#include "../xrEngine/IInputReceiver.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IInputReceiver.h" +#include "xrEngine/IGame_Persistent.h" #include "UIDialogHolder.h" #include "ui/UIWndCallback.h" #include "ui_base.h" diff --git a/src/xrGame/MercuryBall.cpp b/src/xrGame/MercuryBall.cpp index b9b03bd73b1..8c308400b2a 100644 --- a/src/xrGame/MercuryBall.cpp +++ b/src/xrGame/MercuryBall.cpp @@ -6,7 +6,7 @@ #include "stdafx.h" #include "MercuryBall.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CMercuryBall::CMercuryBall(void) diff --git a/src/xrGame/Message_Filter.h b/src/xrGame/Message_Filter.h index 55b22c5db22..5506bc298b2 100644 --- a/src/xrGame/Message_Filter.h +++ b/src/xrGame/Message_Filter.h @@ -1,8 +1,8 @@ #ifndef DEMO_MESSAGE_FILER #define DEMO_MESSAGE_FILER -#include "../xrCore/fastdelegate.h" -#include "../xrCore/net_utils.h" +#include "xrCore/fastdelegate.h" +#include "xrCore/net_utils.h" #include "associative_vector.h" #define FILTERS_COUNT 32 diff --git a/src/xrGame/Mincer.cpp b/src/xrGame/Mincer.cpp index b6b1f0046af..1b74dc9a6fa 100644 --- a/src/xrGame/Mincer.cpp +++ b/src/xrGame/Mincer.cpp @@ -4,7 +4,7 @@ #include "PHDestroyable.h" #include "mincer.h" #include "xrmessages.h" -#include "level.h" +#include "Level.h" #include "CustomZone.h" #include "entity_alive.h" #include "PHDestroyableNotificate.h" diff --git a/src/xrGame/Missile.cpp b/src/xrGame/Missile.cpp index 35163dcfdb0..51d98ca25ab 100644 --- a/src/xrGame/Missile.cpp +++ b/src/xrGame/Missile.cpp @@ -1,20 +1,20 @@ #include "stdafx.h" #include "missile.h" //.#include "WeaponHUD.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "actor.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" #include "xrserver_objects_alife.h" #include "ActorEffector.h" -#include "level.h" +#include "Level.h" #include "xr_level_controller.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ai_object_location.h" -#include "../xrphysics/ExtendedGeom.h" -#include "../xrphysics/MathUtils.h" -#include "characterphysicssupport.h" +#include "xrPhysics/ExtendedGeom.h" +#include "xrPhysics/MathUtils.h" +#include "CharacterPhysicsSupport.h" #include "inventory.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #ifdef DEBUG # include "phdebug.h" #endif diff --git a/src/xrGame/MosquitoBald.cpp b/src/xrGame/MosquitoBald.cpp index f7699456d31..c62f439df3e 100644 --- a/src/xrGame/MosquitoBald.cpp +++ b/src/xrGame/MosquitoBald.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "mosquitobald.h" #include "ParticlesObject.h" -#include "level.h" +#include "Level.h" #include "physicsshellholder.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" CMosquitoBald::CMosquitoBald(void) { diff --git a/src/xrGame/Needles.cpp b/src/xrGame/Needles.cpp index f827e2b0a9c..098ed5a17b1 100644 --- a/src/xrGame/Needles.cpp +++ b/src/xrGame/Needles.cpp @@ -10,7 +10,7 @@ #include "stdafx.h" #include "Needles.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CNeedles::CNeedles(void) diff --git a/src/xrGame/NoGravityZone.cpp b/src/xrGame/NoGravityZone.cpp index 0a9dba9ae73..ae107e62285 100644 --- a/src/xrGame/NoGravityZone.cpp +++ b/src/xrGame/NoGravityZone.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "nogravityzone.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" #include "entity_alive.h" #include "PHMovementControl.h" //#include "PhWorld.h" #include "CharacterPhysicsSupport.h" //extern CPHWorld *ph_world; -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" void CNoGravityZone::enter_Zone(SZoneObjectInfo& io) { inherited::enter_Zone(io); diff --git a/src/xrGame/PDA.cpp b/src/xrGame/PDA.cpp index 36c9ce9423c..29db44d3188 100644 --- a/src/xrGame/PDA.cpp +++ b/src/xrGame/PDA.cpp @@ -1,16 +1,16 @@ #include "pch_script.h" #include "pda.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "Entity.h" #include "actor.h" #include "xrserver.h" #include "xrServer_Objects_ALife_Items.h" -#include "level.h" +#include "Level.h" #include "specific_character.h" #include "alife_registry_wrappers.h" -#include "../xrServerEntities/script_engine.h" +#include "xrServerEntities/script_engine.h" CPda::CPda(void) diff --git a/src/xrGame/PDA.h b/src/xrGame/PDA.h index 1f8495ea6b0..d382a1adf31 100644 --- a/src/xrGame/PDA.h +++ b/src/xrGame/PDA.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" #include "inventory_item_object.h" #include "InfoPortionDefs.h" diff --git a/src/xrGame/PHAICharacter.cpp b/src/xrGame/PHAICharacter.cpp deleted file mode 100644 index 07b4c7ecb38..00000000000 --- a/src/xrGame/PHAICharacter.cpp +++ /dev/null @@ -1,214 +0,0 @@ -#include "stdafx.h" - - -#include "PHDynamicData.h" -#include "Physics.h" -#include "ExtendedGeom.h" -#include "../xrEngine/cl_intersect.h" -#include "tri-colliderKNoOPC\__aabb_tri.h" - -#include "phaicharacter.h" - -#ifdef DEBUG -# include "../xrEngine/StatGraph.h" -# include "PHDebug.h" -# include "level.h" -# include "debug_renderer.h" -#endif - -CPHAICharacter::CPHAICharacter() -{ - m_forced_physics_control=false; -} -void CPHAICharacter::Create(dVector3 sizes) -{ - inherited::Create(sizes); - - m_forced_physics_control=false;//. -} -bool CPHAICharacter::TryPosition(Fvector pos,bool exact_state){ - if(!b_exist) return false; - if(m_forced_physics_control||JumpState()) return false;//b_was_on_object||b_on_object|| - if( DoCollideObj ()) return false; - Fvector current_pos; - GetPosition(current_pos); - Fvector cur_vel;GetVelocity(cur_vel); - - Fvector displace;displace.sub(pos,current_pos); - float disp_mag=displace.magnitude(); - - if( fis_zero( disp_mag ) || fis_zero( Device.fTimeDelta ) ) - return true ; - const u32 max_steps = 15 ; - const float fmax_steps = float ( max_steps ) ; - float fsteps_num = 1.f ; - u32 steps_num = 1 ; - float disp_pstep = FootRadius ( ); - float rest = 0.f; - - float parts = disp_mag / disp_pstep ; - fsteps_num = floor ( parts ); - steps_num = iFloor ( parts ); - if( steps_num > max_steps ) - { - steps_num = max_steps ; - fsteps_num = fmax_steps ; - disp_pstep = disp_mag / fsteps_num ; - } - rest = disp_mag - fsteps_num * disp_pstep ; - - Fvector vel;vel.mul(displace,disp_pstep/fixed_step/disp_mag); - bool ret=true; - int save_gm=dBodyGetGravityMode(m_body); - dBodySetGravityMode(m_body,0); - for(u32 i=0;steps_num>i;++i) - { - SetVelocity(vel); - Enable(); - if(!step_single(fixed_step)) - { - SetVelocity(cur_vel); - ret= false; - break; - } - } - - vel.mul(displace,rest/fixed_step/disp_mag); - SetVelocity(vel); - Enable(); - ret = step_single(fixed_step); - - - dBodySetGravityMode(m_body,save_gm); - SetVelocity(cur_vel); - Fvector pos_new;GetPosition(pos_new); - -#if 0 - Fvector dif;dif .sub( pos, pos_new ); - float dif_m = dif.magnitude(); - if(ret&&dif_m>EPS_L) - { - Msg("dif vec %f,%f,%f \n",dif.x,dif.y,dif.z); - Msg("dif mag %f \n",dif_m); - } -#endif - - SetPosition(pos_new); - m_last_move.sub(pos_new,current_pos).mul(1.f/Device.fTimeDelta); - m_body_interpolation.UpdatePositions(); - m_body_interpolation.UpdatePositions(); - if(ret) - Disable(); - m_collision_damage_info.m_contact_velocity=0.f; - return ret; -} -/* -void CPHAICharacter:: SetPosition (const Fvector &pos) -{ - //m_vDesiredPosition.set(pos); - inherited::SetPosition(pos); - -} -*/ -/* -void CPHAICharacter::BringToDesired(float time,float velocity,float force) -{ - Fvector pos,move; - GetPosition(pos); - - move.sub(m_vDesiredPosition,pos); - move.y=0.f; - float dist=move.magnitude(); - - float vel; - if(dist>EPS_L*100.f) - { - vel=dist/time; - move.mul(1.f/dist); - } - else if(dist>EPS_L*10.f) - { - vel=dist*dist*dist; - move.mul(1.f/dist); - } - else - { - vel=0.f; - move.set(0,0,0); - } - - if(vel>velocity)//&&velocity>EPS_L - vel=velocity; - - if(velocitysurface.mu = 0.00f; - dxGeomUserData* D1=retrieveGeomUserData(c->geom.g1); - dxGeomUserData* D2=retrieveGeomUserData(c->geom.g2); - if(D1&&D2&&D1->ph_object&&D2->ph_object&&D1->ph_object->CastType()==tpCharacter&&D2->ph_object->CastType()==tpCharacter) - { - b_on_object=true; - b_valide_wall_contact=false; - } -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgNeverUseAiPhMove))do_collide=false; -#endif -} -/* -EEnvironment CPHAICharacter::CheckInvironment() -{ - - return inherited::CheckInvironment(); -} -*/ -#ifdef DEBUG -void CPHAICharacter::OnRender() -{ - inherited::OnRender(); - - if(!b_exist) return; - - Fvector pos; - GetDesiredPosition(pos); - pos.y+=m_radius; - - - Fvector scale; - scale.set(0.35f,0.35f,0.35f); - Fmatrix M; - M.identity(); - M.scale(scale); - M.c.set(pos); - - - Level().debug_renderer().draw_ellipse(M, 0xffffffff); -} -#endif \ No newline at end of file diff --git a/src/xrGame/PHAICharacter.h b/src/xrGame/PHAICharacter.h deleted file mode 100644 index b0e5777eb5c..00000000000 --- a/src/xrGame/PHAICharacter.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once -#include "PHSimpleCharacter.h" -class CPHAICharacter : public CPHSimpleCharacter -{ - typedef CPHSimpleCharacter inherited; - - - bool m_forced_physics_control; -public: - CPHAICharacter (); - virtual CPHAICharacter *CastAICharacter () {return this;} - //virtual void SetPosition (const Fvector &pos); - //virtual void SetDesiredPosition (const Fvector& pos) {m_vDesiredPosition.set(pos) ;} - //virtual void GetDesiredPosition (Fvector& dpos) {dpos.set(m_vDesiredPosition) ;} - virtual void ValidateWalkOn () ; -// virtual void BringToDesired (float time,float velocity,float force=1.f) ; - virtual bool TryPosition (Fvector pos,bool exact_state) ; - virtual void Jump (const Fvector& jump_velocity) ; - virtual void SetMaximumVelocity (dReal vel) {m_max_velocity=vel ;} - virtual void InitContact (dContact* c,bool &do_collide,u16 material_idx_1,u16 material_idx_2) ; - virtual void SetForcedPhysicsControl (bool v){m_forced_physics_control=v;} - virtual bool ForcedPhysicsControl (){return m_forced_physics_control;} - virtual void Create (dVector3 sizes) ; -private: - //virtual EEnvironment CheckInvironment (); -#ifdef DEBUG - virtual void OnRender () ; -#endif - -}; \ No newline at end of file diff --git a/src/xrGame/PHActivationShape.cpp b/src/xrGame/PHActivationShape.cpp deleted file mode 100644 index 3c305e603c6..00000000000 --- a/src/xrGame/PHActivationShape.cpp +++ /dev/null @@ -1,381 +0,0 @@ -#include "stdafx.h" -#include "PHObject.h" -#include "Physics.h" -#include "MathUtils.h" -#include "phvalidevalues.h" -#include "PHActivationShape.h" -#include "Extendedgeom.h" -#include "SpaceUtils.h" -#include "MathUtils.h" -#include "../xrEngine/gamemtllib.h" -#include "Level.h" -#include "PHWorld.h" -#include "../3rd party/ode/ode/src/util.h" - -#ifdef DEBUG -# include "PHDebug.h" -#endif // DEBUG - -#include "PHDynamicData.h" -#include "PHSynchronize.h" -#include "phnetstate.h" -static float max_depth =0.f; -static float friction_factor =0.f; -static const float cfm =1.e-10f; -static const float erp =1.f; -/* -static const float static_cfm =1.e-10f; -static const float static_erp =1.f; - -static const float dynamic_cfm = 1.f;//static_cfm;// -static const float dynamic_erp = 1.f / 1000.f;//static_erp;// -*/ - -#ifdef DEBUG -#define CHECK_POS(pos,msg,br) if (!valid_pos(pos,phBoundaries)){Msg("pos:%f,%f,%f",pos.x,pos.y,pos.z);Msg(msg);VERIFY(!br);} - -#else -#define CHECK_POS(pos,msg,br) -#endif -extern int dTriListClass; - -static void ActivateTestDepthCallback (bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2) -{ - - if(!do_colide|| - material_1->Flags.test(SGameMtl::flPassable) || - material_2->Flags.test(SGameMtl::flPassable) - ) - return; - - float& depth=c.geom.depth; - float test_depth=depth; - save_max(max_depth,test_depth); - c.surface.mu*=friction_factor; - c.surface.soft_cfm=cfm; - c.surface.soft_erp=erp; -/* - - - VERIFY(dTriListClass != dGeomGetClass(c.geom.g2)); - bool cl_statics = (dTriListClass == dGeomGetClass(c.geom.g1)); - VERIFY( bo1 || cl_statics ); - CPHObject* self = static_cast ( ( (CPHActivationShape*)(retrieveGeomUserData( bo1 ? c.geom.g1 : c.geom.g2 )->callback_data) ) ); - VERIFY( self ); - - if( cl_statics ) - { - c.surface.soft_cfm=static_cfm; - c.surface.soft_erp=static_erp; - dJointID contact_joint = dJointCreateContactSpecial( 0, ContactGroup, &c ); - self->DActiveIsland()->ConnectJoint(contact_joint); - dJointAttach(contact_joint, dGeomGetBody(c.geom.g1), dGeomGetBody(c.geom.g2)); - do_colide = false; - return; - } - - c.surface.soft_cfm=dynamic_cfm; - c.surface.soft_erp=dynamic_erp; - - dxGeomUserData* data_oposite = retrieveGeomUserData( bo1 ? c.geom.g2 : c.geom.g1 ); - - if( !data_oposite || !data_oposite->ph_object ) - return; - - CPHObject* obj1 = 0, *obj2 = 0; - if(bo1) - { - obj1 = self; - obj2 = data_oposite->ph_object; - } else - { - obj2 = self; - obj1 = data_oposite->ph_object; - } - - do_colide = false; - - VERIFY( obj1 && obj2 ); - - int max_contacts; - if( !obj1->DActiveIsland()->CanMerge(obj2->DActiveIsland(),max_contacts ) ) - return; - if( max_contacts < 1 ) - return; - - dJointID contact_joint = dJointCreateContactSpecial( 0, ContactGroup, &c ); - obj1->DActiveIsland()->ConnectJoint(contact_joint); - dJointAttach (contact_joint, dGeomGetBody(c.geom.g1), dGeomGetBody(c.geom.g2)); - - obj1->DActiveIsland()->Merge( obj2->DActiveIsland() ); - obj2->EnableObject( obj1 ); - */ - -} - -void StaticEnvironment (bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2) -{ - dJointID contact_joint = dJointCreateContact(0, ContactGroup, &c); - - if(bo1) - { - ((CPHActivationShape*)(retrieveGeomUserData(c.geom.g1)->callback_data))->DActiveIsland()->ConnectJoint(contact_joint); - dJointAttach (contact_joint, dGeomGetBody(c.geom.g1), 0); - } - else - { - ((CPHActivationShape*)(retrieveGeomUserData(c.geom.g2)->callback_data))->DActiveIsland()->ConnectJoint(contact_joint); - dJointAttach (contact_joint, 0, dGeomGetBody(c.geom.g2)); - } - do_colide=false; -} -void GetMaxDepthCallback (bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2) -{ - - if(!do_colide || - material_1->Flags.test(SGameMtl::flPassable) || - material_2->Flags.test(SGameMtl::flPassable) - ) - return; - - float& depth=c.geom.depth; - float test_depth=depth; - //save_max(max_depth,test_depth); - max_depth+=test_depth; -} - -void RestoreVelocityState(V_PH_WORLD_STATE& state) -{ - V_PH_WORLD_STATE::iterator i=state.begin(),e=state.end(); - for(;e!=i;++i) - { - CPHSynchronize& sync=*i->first; - SPHNetState& old_s =i->second; - SPHNetState new_s;sync.get_State(new_s); - new_s.angular_vel.set(old_s.angular_vel); - new_s.linear_vel.set(old_s.linear_vel); - new_s.enabled=old_s.enabled; - sync.set_State(new_s); - } -} - -CPHActivationShape::CPHActivationShape() -{ - m_geom=NULL; - m_body=NULL; - m_flags.zero(); - m_flags.set(flFixedRotation,TRUE); -} -CPHActivationShape::~CPHActivationShape() -{ - VERIFY(!m_body&&!m_geom); -} -void CPHActivationShape::Create(const Fvector start_pos,const Fvector start_size,CPhysicsShellHolder* ref_obj,EType _type/*=etBox*/,u16 flags) -{ - VERIFY(ref_obj); - R_ASSERT(_valid( start_pos ) ); - R_ASSERT( _valid( start_size ) ); - - m_body = dBodyCreate (0) ; - dMass m; - dMassSetSphere(&m,1.f,100000.f); - dMassAdjust(&m,1.f); - dBodySetMass(m_body,&m); - switch(_type) - { - case etBox: - m_geom = dCreateBox (0,start_size.x,start_size.y,start_size.z) ; - break; - - case etSphere: - m_geom = dCreateSphere (0,start_size.x); - break; - }; - - dGeomCreateUserData (m_geom) ; - dGeomUserDataSetObjectContactCallback(m_geom,ActivateTestDepthCallback) ; - dGeomUserDataSetPhysicsRefObject(m_geom,ref_obj) ; - dGeomSetBody (m_geom,m_body) ; - dBodySetPosition (m_body,start_pos.x,start_pos.y,start_pos.z) ; - Island() .AddBody (m_body) ; - dBodyEnable (m_body) ; - m_safe_state .create(m_body) ; - spatial_register () ; - m_flags.set(flags,TRUE); -} -void CPHActivationShape:: Destroy () -{ - VERIFY(m_geom&&m_body) ; - spatial_unregister () ; - CPHObject::deactivate () ; - dGeomDestroyUserData (m_geom) ; - dGeomDestroy (m_geom) ; - m_geom =NULL ; - dBodyDestroy (m_body) ; - m_body =NULL ; -} -bool CPHActivationShape:: Activate (const Fvector need_size,u16 steps,float max_displacement,float max_rotation,bool un_freeze_later/* =false*/) -{ - -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawDeathActivationBox)) - { - DBG_OpenCashedDraw(); - Fmatrix M; - PHDynamicData::DMXPStoFMX(dBodyGetRotation(m_body),dBodyGetPosition(m_body),M); - Fvector v;dGeomBoxGetLengths(m_geom,cast_fp(v));v.mul(0.5f); - DBG_DrawOBB(M,v,D3DCOLOR_XRGB(0,255,0)); - } -#endif - VERIFY(m_geom&&m_body); - CPHObject::activate(); - ph_world->Freeze(); - UnFreeze(); - max_depth=0.f; - - dGeomUserDataSetObjectContactCallback(m_geom,GetMaxDepthCallback) ; - //ph_world->Step(); - ph_world->StepTouch(); - u16 num_it =15; - float fnum_it=float(num_it); - float fnum_steps=float(steps); - float fnum_steps_r=1.f/fnum_steps; - float resolve_depth=0.01f; - float max_vel=max_depth/fnum_it*fnum_steps_r/fixed_step; - float limit_l_vel=_max(_max(need_size.x,need_size.y),need_size.z)/fnum_it*fnum_steps_r/fixed_step; - - if(limit_l_vel>default_l_limit) - limit_l_vel=default_l_limit; - - if(max_vel>limit_l_vel) - max_vel=limit_l_vel; - - float max_a_vel=max_rotation/fnum_it*fnum_steps_r/fixed_step; - - if(max_a_vel>default_w_limit) - max_a_vel=default_w_limit; - - //ph_world->CutVelocity(0.f,0.f); - dGeomUserDataSetCallbackData(m_geom,this); - dGeomUserDataSetObjectContactCallback( m_geom, ActivateTestDepthCallback ); - if( m_flags.test( flStaticEnvironment ) ) - dGeomUserDataAddObjectContactCallback(m_geom,StaticEnvironment); - max_depth=0.f; - - Fvector from_size; - Fvector step_size,size; - dGeomBoxGetLengths(m_geom,cast_fp(from_size)); - step_size.sub(need_size,from_size); - step_size.mul(fnum_steps_r); - size.set(from_size); - bool ret=false; - V_PH_WORLD_STATE temp_state; - ph_world->GetState(temp_state); - for(int m=0;steps>m;++m) - { - //float param =fnum_steps_r*(1+m); - //InterpolateBox(id,param); - size.add(step_size); - dGeomBoxSetLengths(m_geom,size.x,size.y,size.z); - u16 attempts=10; - do{ - - ret=false; - for(int i=0;num_it>i;++i) - { - max_depth=0.f; - ph_world->Step(); - CHECK_POS(Position(),"pos after ph_world->Step()",false); - ph_world->CutVelocity(max_vel,max_a_vel); - CHECK_POS(Position(),"pos after CutVelocity",true); - //if(m==0&&i==0)ph_world->GetState(temp_state); - if(max_depth < resolve_depth) - { - ret=true; - break; - } - } - attempts--; - }while(!ret&&attempts>0); -#ifdef DEBUG - Msg("correction attempts %d",10-attempts); -#endif - - } - RestoreVelocityState(temp_state); - CHECK_POS(Position(),"pos after RestoreVelocityState(temp_state);",true); - if(!un_freeze_later)ph_world->UnFreeze(); -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawDeathActivationBox)) - { - DBG_OpenCashedDraw(); - Fmatrix M; - PHDynamicData::DMXPStoFMX(dBodyGetRotation(m_body),dBodyGetPosition(m_body),M); - Fvector v;v.set(need_size);v.mul(0.5f); - DBG_DrawOBB(M,v,D3DCOLOR_XRGB(0,255,255)); - DBG_ClosedCashedDraw(30000); - } -#endif - return ret; -} -const Fvector& CPHActivationShape:: Position () -{ - return cast_fv(dBodyGetPosition(m_body)); -} -void CPHActivationShape:: Size (Fvector &size) -{ - dGeomBoxGetLengths(m_geom,cast_fp(size)); -} - -void CPHActivationShape:: PhDataUpdate (dReal step) -{ - m_safe_state.new_state(m_body); -} -void CPHActivationShape:: PhTune (dReal step) -{ - -} -dGeomID CPHActivationShape:: dSpacedGeom () -{ - return m_geom; -} -void CPHActivationShape:: get_spatial_params () -{ - spatialParsFromDGeom(m_geom,spatial.sphere.P,AABB,spatial.sphere.R); -} - -void CPHActivationShape:: InitContact (dContact* c,bool& do_collide,u16 ,u16 ) -{ - -} - -void CPHActivationShape::CutVelocity(float l_limit,float /*a_limit*/) -{ - dVector3 limitedl,diffl; - if(dVectorLimit(dBodyGetLinearVel(m_body),l_limit,limitedl)) - { - dVectorSub(diffl,limitedl,dBodyGetLinearVel(m_body)); - dBodySetLinearVel(m_body,diffl[0],diffl[1],diffl[2]); - dBodySetAngularVel(m_body,0.f,0.f,0.f); - dxStepBody(m_body,fixed_step); - dBodySetLinearVel(m_body,limitedl[0],limitedl[1],limitedl[2]); - } -} - -void CPHActivationShape:: set_rotation (const Fmatrix &sof) -{ - dMatrix3 rot;PHDynamicData::FMXtoDMX(sof,rot); - dBodySetRotation(ODEBody(),rot); - m_safe_state.set_rotation( rot ); -} - -#ifdef DEBUG -CPhysicsShellHolder* CPHActivationShape::ref_object () -{ - VERIFY(m_geom); - dxGeomUserData* ud = retrieveGeomUserData( m_geom ); - VERIFY( ud ); - return ud->ph_ref_object; - -} -#endif \ No newline at end of file diff --git a/src/xrGame/PHActivationShape.h b/src/xrGame/PHActivationShape.h deleted file mode 100644 index 0cb1dd90ab2..00000000000 --- a/src/xrGame/PHActivationShape.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef PH_ACTIVATION_SHAPE -#define PH_ACTIVATION_SHAPE -#endif -#include "MathUtils.h" -#include "phvalidevalues.h" -class CPHActivationShape : public CPHObject -{ -dBodyID m_body ; -dGeomID m_geom ; -Flags16 m_flags ; -CSafeFixedRotationState m_safe_state ; - -#ifdef DEBUG -virtual CPhysicsShellHolder *ref_object (); -#endif - -public: -enum EType -{ - etBox, - etCylinder, - etSphere -}; - -enum { - flFixedRotation =1<<0, - flFixedPosition =1<<1, - flStaticEnvironment =1<<2, - flGravity =1<<3 - }; - CPHActivationShape () ; - ~CPHActivationShape () ; - void Create (const Fvector start_pos,const Fvector start_size,CPhysicsShellHolder* ref_obj,EType type=etBox,u16 flags=0) ; - void Destroy () ; - bool Activate (const Fvector need_size,u16 steps,float max_displacement,float max_rotation,bool un_freeze_later =false) ; -const Fvector &Position () ; - void Size (Fvector &size) ; - dBodyID ODEBody () {return m_body ;} - void set_rotation (const Fmatrix &rot) ; -private: -virtual void PhDataUpdate (dReal step) ; -virtual void PhTune (dReal step) ; -virtual void CutVelocity (float l_limit,float a_limit) ; -virtual void InitContact (dContact* c,bool& do_collide,u16 ,u16 ) ; -virtual dGeomID dSpacedGeom () ; -virtual void get_spatial_params () ; -virtual u16 get_elements_number () {return 0;} -virtual CPHSynchronize *get_element_sync (u16 element) {return NULL;} - -}; \ No newline at end of file diff --git a/src/xrGame/PHActorCharacter.cpp b/src/xrGame/PHActorCharacter.cpp deleted file mode 100644 index aab149c4ed8..00000000000 --- a/src/xrGame/PHActorCharacter.cpp +++ /dev/null @@ -1,346 +0,0 @@ -#include "stdafx.h" -#include "phactorcharacter.h" -#include "Extendedgeom.h" -#include "PhysicsCommon.h" -#include "GameObject.h" -#include "PhysicsShellHolder.h" -#include "ai/stalker/ai_stalker.h" -#include "Actor.h" -#include "../xrEngine/gamemtllib.h" -#include "level.h" - -//const float JUMP_HIGHT=0.5; -const float JUMP_UP_VELOCITY=6.0f;//5.6f; -const float JUMP_INCREASE_VELOCITY_RATE=1.2f; - -CPHActorCharacter::CPHActorCharacter() -{ - SetRestrictionType(CPHCharacter::rtActor); - - //std::fill(m_restrictors_index,m_restrictors_index+CPHCharacter::rtNone,end(m_restrictors)); - //m_restrictors_index[CPHCharacter::rtStalker] =begin(m_restrictors)+0; - //m_restrictors_index[CPHCharacter::rtMonsterMedium] =begin(m_restrictors)+1; - - { - m_restrictors.resize(3); - m_restrictors[0]=(xr_new()); - m_restrictors[1]=xr_new(); - m_restrictors[2]=(xr_new()); - } -} - -CPHActorCharacter::~CPHActorCharacter(void) -{ - ClearRestrictors(); -} -static u16 slide_material_index = GAMEMTL_NONE_IDX; -void CPHActorCharacter::Create(dVector3 sizes) -{ - if(b_exist) return; - inherited::Create(sizes); - if(!IsGameTypeSingle()) - { - ClearRestrictors(); - } - RESTRICTOR_I i=begin(m_restrictors),e=end(m_restrictors); - for(;e!=i;++i) - { - (*i)->Create(this,sizes); - } - - if(m_phys_ref_object) - { - SetPhysicsRefObject(m_phys_ref_object); - } - if(slide_material_index == GAMEMTL_NONE_IDX) - { - GameMtlIt mi = GMLib.GetMaterialIt("materials\\earth_slide"); - if( mi != GMLib.LastMaterial ()) - slide_material_index =u16( mi - GMLib.FirstMaterial() ); - //slide_material_index = GMLib.GetMaterialIdx("earth_slide"); - } -} -void CPHActorCharacter:: ValidateWalkOn () -{ - - if( LastMaterialIDX( ) == slide_material_index ) - b_clamb_jump = false; - else - inherited::ValidateWalkOn(); -} -void SPHCharacterRestrictor::Create(CPHCharacter* ch,dVector3 sizes) -{ - VERIFY(ch); - if(m_character)return; - m_character=ch; - m_restrictor=dCreateCylinder(0,m_restrictor_radius,sizes[1]); - dGeomSetPosition(m_restrictor,0.f,sizes[1]/2.f,0.f); - m_restrictor_transform=dCreateGeomTransform(0); - dGeomTransformSetCleanup(m_restrictor_transform,0); - dGeomTransformSetInfo(m_restrictor_transform,1); - dGeomTransformSetGeom(m_restrictor_transform,m_restrictor); - dGeomCreateUserData(m_restrictor); - dGeomGetUserData(m_restrictor)->b_static_colide=false; - - dGeomSetBody(m_restrictor_transform,m_character->get_body()); - dSpaceAdd(m_character->dSpace(),m_restrictor_transform); - dGeomUserDataSetPhObject(m_restrictor,(CPHObject*)m_character); - switch(m_type) { - case CPHCharacter::rtStalker:static_cast(this)->Create(ch,sizes); - break; - case CPHCharacter::rtStalkerSmall:static_cast(this)->Create(ch,sizes); - break; - case CPHCharacter::rtMonsterMedium:static_cast(this)->Create(ch,sizes); - break; - default:NODEFAULT; - } - -} - -RESTRICTOR_I CPHActorCharacter::Restrictor(CPHCharacter::ERestrictionType rtype) -{ - R_ASSERT2(rtype0)(*Restrictor(rtype))->SetRadius(r); -} - -void SPHCharacterRestrictor::SetRadius(float r) -{ - m_restrictor_radius=r; - if(m_character) - { - float h; - dGeomCylinderGetParams(m_restrictor,&r,&h); - dGeomCylinderSetParams(m_restrictor,m_restrictor_radius,h); - } -} -void CPHActorCharacter::Destroy() -{ - if(!b_exist) return; - RESTRICTOR_I i=begin(m_restrictors),e=end(m_restrictors); - for(;e!=i;++i) - { - (*i)->Destroy(); - } - inherited::Destroy(); -} -void CPHActorCharacter::ClearRestrictors() -{ - RESTRICTOR_I i=begin(m_restrictors),e=end(m_restrictors); - for(;e!=i;++i) - { - (*i)->Destroy(); - xr_delete(*i); - } - m_restrictors.clear(); -} -void SPHCharacterRestrictor::Destroy() -{ - if(m_restrictor) { - dGeomDestroyUserData(m_restrictor); - dGeomDestroy(m_restrictor); - m_restrictor=NULL; - } - - if(m_restrictor_transform){ - dGeomDestroyUserData(m_restrictor_transform); - m_restrictor_transform=NULL; - } - m_character=NULL; -} -void CPHActorCharacter::SetPhysicsRefObject(CPhysicsShellHolder* ref_object) -{ - inherited::SetPhysicsRefObject(ref_object); - RESTRICTOR_I i=begin(m_restrictors),e=end(m_restrictors); - for(;e!=i;++i) - { - (*i)->SetPhysicsRefObject(ref_object); - } -} -void SPHCharacterRestrictor::SetPhysicsRefObject(CPhysicsShellHolder* ref_object) -{ - if(m_character) - dGeomUserDataSetPhysicsRefObject(m_restrictor,ref_object); -} -void CPHActorCharacter::SetMaterial (u16 material) -{ - inherited::SetMaterial(material); - if(!b_exist) return; - RESTRICTOR_I i=begin(m_restrictors),e=end(m_restrictors); - for(;e!=i;++i) - { - (*i)->SetMaterial(material); - } -} -void SPHCharacterRestrictor::SetMaterial(u16 material) -{ - dGeomGetUserData(m_restrictor)->material=material; -} -void CPHActorCharacter::SetAcceleration(Fvector accel) -{ - Fvector cur_a,input_a;float cur_mug,input_mug; - cur_a.set(m_acceleration);cur_mug=m_acceleration.magnitude(); - if(!fis_zero(cur_mug))cur_a.mul(1.f/cur_mug); - input_a.set(accel);input_mug=accel.magnitude(); - if(!fis_zero(input_mug))input_a.mul(1.f/input_mug); - if(!cur_a.similar(input_a,0.05f)||!fis_zero(input_mug-cur_mug,0.5f)) - inherited::SetAcceleration(accel); -} -bool CPHActorCharacter:: CanJump () -{ - return !b_lose_control && - LastMaterialIDX( ) != slide_material_index && - (m_ground_contact_normal[1]>0.5f - || - m_elevator_state.ClimbingState()); -} -void CPHActorCharacter::Jump(const Fvector& accel) -{ - if(!b_exist) return; - if(CanJump()) - { - b_jump=true; - const dReal* vel=dBodyGetLinearVel(m_body); - dReal amag =m_acceleration.magnitude(); - if(amag<1.f)amag=1.f; - if(m_elevator_state.ClimbingState()) - { - m_elevator_state.GetJumpDir(m_acceleration,m_jump_accel); - m_jump_accel.mul(JUMP_UP_VELOCITY/2.f); - //if(accel.square_magnitude()>EPS_L)m_jump_accel.mul(4.f); - } - else{ - m_jump_accel.set(vel[0]*JUMP_INCREASE_VELOCITY_RATE+m_acceleration.x/amag*0.2f,jump_up_velocity,vel[2]*JUMP_INCREASE_VELOCITY_RATE +m_acceleration.z/amag*0.2f); - } - Enable(); - } -} -void CPHActorCharacter::SetObjectContactCallback(ObjectContactCallbackFun* callback) -{ - inherited::SetObjectContactCallback(callback); - -} - -void CPHActorCharacter::Disable() -{ - inherited::Disable(); -} - - -struct SFindPredicate -{ - SFindPredicate(const dContact* ac,bool *b) - { - c=ac; - b1=b; - } - bool *b1 ; - const dContact *c ; - bool operator () (SPHCharacterRestrictor* o) - { - *b1=c->geom.g1==o->m_restrictor_transform; - return *b1||c->geom.g2==o->m_restrictor_transform; - } -}; -void CPHActorCharacter::InitContact(dContact* c,bool &do_collide,u16 material_idx_1,u16 material_idx_2 ) -{ - - bool b1; - SFindPredicate fp(c,&b1); - RESTRICTOR_I r=std::find_if(begin(m_restrictors),end(m_restrictors),fp); - bool b_restrictor=(r!=end(m_restrictors)); - SGameMtl* material_1=GMLib.GetMaterialByIdx(material_idx_1); - SGameMtl* material_2=GMLib.GetMaterialByIdx(material_idx_2); - if((material_1&&material_1->Flags.test(SGameMtl::flActorObstacle))||(material_2&&material_2->Flags.test(SGameMtl::flActorObstacle))) - do_collide=true; - if(IsGameTypeSingle()) - { - - if(b_restrictor) - { - b_side_contact=true; - //MulSprDmp(c->surface.soft_cfm,c->surface.soft_erp,def_spring_rate,def_dumping_rate); - c->surface.mu =0.00f; - } - else - inherited::InitContact(c,do_collide,material_idx_1,material_idx_2); - if(b_restrictor&& - do_collide&& - !(b1 ? static_cast(retrieveGeomUserData(c->geom.g2)->ph_object)->ActorMovable():static_cast(retrieveGeomUserData(c->geom.g1)->ph_object)->ActorMovable()) - ) - { - dJointID contact_joint = dJointCreateContactSpecial(0, ContactGroup, c); - Enable(); - CPHObject::Island().DActiveIsland()->ConnectJoint(contact_joint); - if(b1) - dJointAttach (contact_joint, dGeomGetBody(c->geom.g1), 0); - else - dJointAttach (contact_joint, 0, dGeomGetBody(c->geom.g2)); - do_collide=false; - m_friction_factor*=0.1f; - - } - } - else - { - - dxGeomUserData* D1=retrieveGeomUserData(c->geom.g1); - dxGeomUserData* D2=retrieveGeomUserData(c->geom.g2); - if(D1&&D2) - { - CActor* A1=smart_cast(D1->ph_ref_object); - CActor* A2=smart_cast(D2->ph_ref_object); - if(A1&&A2) - { - do_collide=do_collide&&!b_restrictor&&(A1->PPhysicsShell()==0)==(A2->PPhysicsShell()==0); - c->surface.mu=1.f; - } - } - if(do_collide)inherited::InitContact(c,do_collide,material_idx_1,material_idx_2); - } -} - -void CPHActorCharacter::ChooseRestrictionType (CPHCharacter::ERestrictionType my_type,float my_depth,CPHCharacter *ch) -{ -if (my_type!=rtStalker||(ch->RestrictionType()!=rtStalker&&ch->RestrictionType()!=rtStalkerSmall))return; -float checkR=m_restrictors[rtStalkerSmall]->m_restrictor_radius;//1.5f;//+m_restrictors[rtStalker]->m_restrictor_radius)/2.f; - -switch(ch->RestrictionType()) -{ -case rtStalkerSmall: - if( ch->ObjectRadius() > checkR ) - { - //if(my_depth>0.05f) - ch->SetNewRestrictionType(rtStalker); - Enable(); - //else ch->SetRestrictionType(rtStalker); -#ifdef DEBUG - if(ph_dbg_draw_mask1.test(ph_m1_DbgActorRestriction)) - Msg("restriction ready to change small -> large"); -#endif - } - break; -case rtStalker: - if( ch->ObjectRadius() < checkR ) - { -#ifdef DEBUG - if(ph_dbg_draw_mask1.test(ph_m1_DbgActorRestriction)) - Msg("restriction change large -> small"); -#endif - ch->SetRestrictionType(rtStalkerSmall); - Enable(); - } - break; -default:NODEFAULT; -} - -} - -void CPHActorCharacter ::update_last_material() -{ - if( ignore_material( *p_lastMaterialIDX ) ) - inherited::update_last_material(); -} \ No newline at end of file diff --git a/src/xrGame/PHActorCharacter.h b/src/xrGame/PHActorCharacter.h deleted file mode 100644 index 63bf4361e37..00000000000 --- a/src/xrGame/PHActorCharacter.h +++ /dev/null @@ -1,120 +0,0 @@ -#pragma once -#include "phsimplecharacter.h" -#include "PHActorCharacterInline.h" - -class CPhysicShellHolder; -struct SPHCharacterRestrictor -{ - SPHCharacterRestrictor (CPHCharacter::ERestrictionType Ttype) - { - m_type=Ttype; - m_character=NULL; - m_restrictor=NULL; - m_restrictor_transform=NULL; - m_restrictor_radius=0.1f; - } - ~SPHCharacterRestrictor () - { - Destroy(); - }; - CPHCharacter* m_character; - CPHCharacter::ERestrictionType m_type; - - dGeomID m_restrictor; - dGeomID m_restrictor_transform; - float m_restrictor_radius; - void SetObjectContactCallback (ObjectContactCallbackFun* callback); - void SetMaterial (u16 material); - void Create (CPHCharacter* ch,dVector3 sizes); - void Destroy (void); - void SetPhysicsRefObject (CPhysicsShellHolder* ref_object); - void SetRadius (float r); -}; - -template -struct TPHCharacterRestrictor : public SPHCharacterRestrictor -{ - TPHCharacterRestrictor():SPHCharacterRestrictor(Ttype){} - void Create(CPHCharacter* ch,dVector3 sizes) - { - dGeomUserDataSetObjectContactCallback(m_restrictor,RestrictorCallBack); - } -static void RestrictorCallBack (bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2) - { - do_colide=false; - dBodyID b1 = dGeomGetBody(c.geom.g1); - dBodyID b2 = dGeomGetBody(c.geom.g2); - if(!(b1&&b2)) return; - dxGeomUserData *ud1 = retrieveGeomUserData(c.geom.g1); - dxGeomUserData *ud2 = retrieveGeomUserData(c.geom.g2); - if(!(ud1&&ud2))return; - - CPHObject *o1 = NULL;if(ud1)o1=ud1->ph_object; - CPHObject *o2 = NULL;if(ud2)o2=ud2->ph_object; - if(!(o1&&o2)) return; - if(o1->CastType()!=CPHObject::tpCharacter||o2->CastType()!=CPHObject::tpCharacter) return; - - CPHCharacter* ch1 = static_cast(o1); - CPHCharacter* ch2 = static_cast(o2); - - if(bo1) - { - ch1 -> ChooseRestrictionType(Ttype,c.geom.depth,ch2); - do_colide = ch2->TouchRestrictor(Ttype); - } - else - { - ch2 -> ChooseRestrictionType(Ttype,c.geom.depth,ch1); - do_colide = ch1->TouchRestrictor(Ttype); - } - } - }; -DEFINE_VECTOR(SPHCharacterRestrictor*,RESRICTORS_V,RESTRICTOR_I); -//typedef SPHCharacterRestrictor* RESRICTORS_V[2]; -//typedef SPHCharacterRestrictor** RESTRICTOR_I; -IC RESTRICTOR_I begin(RESRICTORS_V& v) -{ - //return v; - return v.begin(); -} - -IC RESTRICTOR_I end(RESRICTORS_V& v) -{ - //return v+sizeof(RESRICTORS_V)/sizeof(SPHCharacterRestrictor*); - return v.end(); -} - -class CPHActorCharacter : - public CPHSimpleCharacter -{ - typedef CPHSimpleCharacter inherited; - - RESRICTORS_V m_restrictors; - float m_speed_goal; -public: - typedef TPHCharacterRestrictor stalker_restrictor; - typedef TPHCharacterRestrictor stalker_small_restrictor; - typedef TPHCharacterRestrictor medium_monster_restrictor; -public: - virtual CPHActorCharacter *CastActorCharacter (){return this;} - virtual void SetObjectContactCallback (ObjectContactCallbackFun* callback); - virtual void SetMaterial (u16 material); - virtual void Create (dVector3 sizes); - virtual void Destroy (void); - virtual void SetPhysicsRefObject (CPhysicsShellHolder* ref_object); - virtual void SetAcceleration (Fvector accel); - virtual void Disable (); - virtual void Jump (const Fvector& jump_velocity); - virtual void InitContact (dContact* c,bool &do_collide,u16 material_idx_1 ,u16 material_idx_2); - void SetRestrictorRadius (CPHCharacter::ERestrictionType rtype,float r); -virtual void ChooseRestrictionType (ERestrictionType my_type,float my_depth,CPHCharacter *ch); - CPHActorCharacter (); - virtual ~CPHActorCharacter (void); -private: - virtual void ValidateWalkOn (); - bool CanJump (); - virtual void update_last_material (); -private: - void ClearRestrictors (); - RESTRICTOR_I Restrictor (CPHCharacter::ERestrictionType rtype); -}; diff --git a/src/xrGame/PHActorCharacterInline.h b/src/xrGame/PHActorCharacterInline.h deleted file mode 100644 index 8b137891791..00000000000 --- a/src/xrGame/PHActorCharacterInline.h +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/xrGame/PHBaseBodyEffector.h b/src/xrGame/PHBaseBodyEffector.h deleted file mode 100644 index 48b04c65d75..00000000000 --- a/src/xrGame/PHBaseBodyEffector.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef PH_BASE_BODY_EFFECTOR_H -#define PH_BASE_BODY_EFFECTOR_H - -#include "ode_include.h" - -class CPHBaseBodyEffector -{ -protected: - dBodyID m_body; -public: - void Init(dBodyID body) - { - m_body=body; - } -}; -#endif \ No newline at end of file diff --git a/src/xrGame/PHCapture.cpp b/src/xrGame/PHCapture.cpp deleted file mode 100644 index f9028865603..00000000000 --- a/src/xrGame/PHCapture.cpp +++ /dev/null @@ -1,360 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -#include "StdAfx.h" - -#include "PHCapture.h" -#include "phcharacter.h" -#include "Physics.h" -#include "ExtendedGeom.h" - -#include "entity_alive.h" -#include "phmovementcontrol.h" -#include "../Include/xrRender/Kinematics.h" -#include "characterphysicssupport.h" -/////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////// - - -void CPHCapture::CreateBody() -{ - m_body= dBodyCreate(0); - m_island.AddBody(m_body); - dMass m; - dMassSetSphere(&m,1.f,1000000.f); - dMassAdjust(&m,100000.f); - dBodySetMass(m_body,&m); - dBodySetGravityMode(m_body,0); -} - -CPHCapture::~CPHCapture() -{ - Deactivate(); -} - -bool CPHCapture::Invalid() -{ - return - !m_taget_object->PPhysicsShell()|| - !m_taget_object->PPhysicsShell()->isActive()|| - !m_character->b_exist; -} - -void CPHCapture::PhDataUpdate(dReal /**step/**/) -{ - - switch(e_state) - { - case cstFree: - break; - case cstPulling: PullingUpdate(); - break; - case cstCaptured: CapturedUpdate(); - break; - case cstReleased: ReleasedUpdate(); - break; - default: NODEFAULT; - } -} - -void CPHCapture::PhTune(dReal /**step/**/) -{ - if(e_state == cstFree) - return; - - //if(!m_taget_object->PPhysicsShell()) { - // b_failed=true; - // return; //. hack - //} - VERIFY(m_character && m_character->b_exist); - VERIFY(m_taget_object); - VERIFY(m_taget_object->PPhysicsShell()); - VERIFY(m_taget_object->PPhysicsShell()->isFullActive()); - VERIFY( m_taget_element ); - VERIFY( m_taget_element->isFullActive()); - VERIFY( m_island.DActiveIsland() == &m_island ); - - bool act_capturer=m_character->CPHObject::is_active(); - bool act_taget=m_taget_object->PPhysicsShell()->isEnabled(); - - b_disabled=!act_capturer&&!act_taget; - if(act_capturer) - { - m_taget_element->Enable(); - } - if(act_taget) - { - m_character->Enable(); - } - switch(e_state) - { - case cstPulling: ; - break; - case cstCaptured: - { - if(b_disabled) dBodyDisable(m_body); - else - { - m_character->Island().Merge(&m_island); - m_taget_element->PhysicsShell()->PIsland()->Merge(&m_island); - VERIFY(!m_island.IsActive()); - } - } - break; - case cstReleased: ; - break; - default: NODEFAULT; - } - -} - -void CPHCapture::PullingUpdate() -{ - if(!m_taget_element->isActive()||Device.dwTimeGlobal-m_time_start>m_capture_time) - { - Release(); - return; - } - - Fvector dir; - Fvector capture_bone_position; - CObject* object=smart_cast(m_character->PhysicsRefObject()); - capture_bone_position.set(m_capture_bone->mTransform.c); - object->XFORM().transform_tiny(capture_bone_position); - m_taget_element->GetGlobalPositionDynamic(&dir); - dir.sub(capture_bone_position,dir); - float dist=dir.magnitude(); - if(dist>m_pull_distance) - { - Release(); - return; - } - dir.mul(1.f/dist); - if(distget_body()); - dJointAttach(m_ajoint,m_body,m_taget_element->get_body()); - dJointSetFeedback (m_joint, &m_joint_feedback); - dJointSetFeedback (m_ajoint, &m_joint_feedback); - dJointSetBallAnchor(m_joint,capture_bone_position.x,capture_bone_position.y,capture_bone_position.z); - - - dJointSetAMotorAxis (m_ajoint, 0, 1, dir.x, dir.y, dir.z); - - if(dir.x>EPS) - { - if(dir.y>EPS) - { - float mag=dir.x*dir.x+dir.y*dir.y; - dJointSetAMotorAxis (m_ajoint, 2, 2, -dir.y/mag, dir.x/mag, 0.f); - } - else if(dir.z>EPS) - { - float mag=dir.x*dir.x+dir.z*dir.z; - dJointSetAMotorAxis (m_ajoint, 2, 2, -dir.z/mag,0.f,dir.x/mag); - } - else - { - dJointSetAMotorAxis (m_ajoint, 2, 2, 1.f,0.f,0.f); - } - } - else - { - if(dir.y>EPS) - { - - if(dir.z>EPS) - { - float mag=dir.y*dir.y+dir.z*dir.z; - dJointSetAMotorAxis (m_ajoint, 2, 2,0.f,-dir.z/mag,dir.y/mag); - } - else - { - dJointSetAMotorAxis (m_ajoint, 2, 2, 0.f,1.f,0.f); - } - } - else - { - dJointSetAMotorAxis (m_ajoint, 2, 2, 0.f,0.f,1.f); - } - } - //float hi=-M_PI/2.f,lo=-hi; - //dJointSetAMotorParam(m_ajoint,dParamLoStop ,lo); - //dJointSetAMotorParam(m_ajoint,dParamHiStop ,hi); - //dJointSetAMotorParam(m_ajoint,dParamLoStop2 ,lo); - //dJointSetAMotorParam(m_ajoint,dParamHiStop2 ,hi); - //dJointSetAMotorParam(m_ajoint,dParamLoStop3 ,lo); - //dJointSetAMotorParam(m_ajoint,dParamHiStop3 ,hi); - - - dJointSetAMotorParam(m_ajoint,dParamFMax ,m_capture_force*0.2f); - dJointSetAMotorParam(m_ajoint,dParamVel ,0.f); - - dJointSetAMotorParam(m_ajoint,dParamFMax2 ,m_capture_force*0.2f); - dJointSetAMotorParam(m_ajoint,dParamVel2 ,0.f); - - dJointSetAMotorParam(m_ajoint,dParamFMax3 ,m_capture_force*0.2f); - dJointSetAMotorParam(m_ajoint,dParamVel3 ,0.f); - - -/////////////////////////////////// - float sf=0.1f,df=10.f; - - float erp=ERP(world_spring*sf,world_damping*df); - float cfm=CFM(world_spring*sf,world_damping*df); - dJointSetAMotorParam(m_ajoint,dParamStopERP ,erp); - dJointSetAMotorParam(m_ajoint,dParamStopCFM ,cfm); - - dJointSetAMotorParam(m_ajoint,dParamStopERP2 ,erp); - dJointSetAMotorParam(m_ajoint,dParamStopCFM2 ,cfm); - - dJointSetAMotorParam(m_ajoint,dParamStopERP3 ,erp); - dJointSetAMotorParam(m_ajoint,dParamStopCFM3 ,cfm); - ///////////////////////////////////////////////////////////////////// - ///dJointSetAMotorParam(m_joint1,dParamFudgeFactor ,0.1f); - //dJointSetAMotorParam(m_joint1,dParamFudgeFactor2 ,0.1f); - //dJointSetAMotorParam(m_joint1,dParamFudgeFactor3 ,0.1f); - ///////////////////////////////////////////////////////////////////////////// - sf=0.1f,df=10.f; - erp=ERP(world_spring*sf,world_damping*df); - cfm=CFM(world_spring*sf,world_damping*df); - dJointSetAMotorParam(m_ajoint,dParamCFM ,cfm); - dJointSetAMotorParam(m_ajoint,dParamCFM2 ,cfm); - dJointSetAMotorParam(m_ajoint,dParamCFM3 ,cfm); - - -/////////////////////////// - - //dJointSetAMotorParam(m_ajoint,dParamLoStop ,0.f); - //dJointSetAMotorParam(m_ajoint,dParamHiStop ,0.f); - m_taget_element->set_LinearVel ( Fvector().set( 0 ,0, 0 ) ); - m_taget_element->set_AngularVel( Fvector().set( 0 ,0, 0 ) ); - - - m_taget_element->set_DynamicLimits(); - //m_taget_object->PPhysicsShell()->set_JointResistance() - e_state=cstCaptured; - return; - } - m_taget_element->applyForce(dir,m_pull_force); -} - -void CPHCapture::CapturedUpdate() -{ - m_island.Unmerge(); - if(m_character->CPHObject::is_active()) - { - m_taget_element->Enable(); - } - - if(!m_taget_element->isActive()||dDOT(m_joint_feedback.f2,m_joint_feedback.f2)>m_capture_force*m_capture_force) - { - Release(); - return; - } - - float mag=dSqrt(dDOT(m_joint_feedback.f1,m_joint_feedback.f1)); - - //m_back_force=m_back_force*0.999f+ ((magm_capture_force/2.2f) - { - float f=mag/(m_capture_force/15.f); - m_character->ApplyForce(m_joint_feedback.f1[0]/f,m_joint_feedback.f1[1]/f,m_joint_feedback.f1[2]/f); - } - - Fvector capture_bone_position; - CObject* object=smart_cast(m_character->PhysicsRefObject()); - capture_bone_position.set(m_capture_bone->mTransform.c); - object->XFORM().transform_tiny(capture_bone_position); - dBodySetPosition(m_body,capture_bone_position.x,capture_bone_position.y,capture_bone_position.z); -} - -void CPHCapture::ReleasedUpdate() -{ - if(b_disabled) return; - if(!b_collide) - { - e_state=cstFree; - m_taget_element->Enable(); - } - b_collide=false; -} - -void CPHCapture::ReleaseInCallBack() -{ - // if(!b_failed) return; - b_collide=true; -} - - -void CPHCapture::object_contactCallbackFun(bool& do_colide,bool bo1,dContact& c,SGameMtl * /*material_1*/,SGameMtl * /*material_2*/) -{ - - dxGeomUserData *l_pUD1 = NULL; - dxGeomUserData *l_pUD2 = NULL; - l_pUD1 = retrieveGeomUserData(c.geom.g1); - l_pUD2 = retrieveGeomUserData(c.geom.g2); - - if(! l_pUD1) return; - if(!l_pUD2) return; - - CEntityAlive* capturer=smart_cast(l_pUD1->ph_ref_object); - if(capturer) - { - CPHCapture* capture=capturer->character_physics_support()->movement()->PHCapture(); - if(capture) - { - if(capture->m_taget_element->PhysicsRefObject()==l_pUD2->ph_ref_object) - { - do_colide = false; - capture->m_taget_element->Enable(); - if(capture->e_state==CPHCapture::cstReleased) capture->ReleaseInCallBack(); - } - - } - - - } - - capturer=smart_cast(l_pUD2->ph_ref_object); - if(capturer) - { - CPHCapture* capture=capturer->character_physics_support()->movement()->PHCapture(); - if(capture) - { - if(capture->m_taget_element->PhysicsRefObject()==l_pUD1->ph_ref_object) - { - do_colide = false; - capture->m_taget_element->Enable(); - if(capture->e_state==CPHCapture::cstReleased) capture->ReleaseInCallBack(); - } - - } - - } -} -void CPHCapture::RemoveConnection(CObject* O) -{ - if(static_cast(m_taget_object)==O) - { - Deactivate(); - } -} - -void CPHCapture::NetRelcase (CPhysicsShell *s) -{ - VERIFY( s ); - VERIFY( s->get_ElementByStoreOrder(0) ); - VERIFY( s->get_ElementByStoreOrder(0)->PhysicsRefObject() ); - RemoveConnection(s->get_ElementByStoreOrder(0)->PhysicsRefObject()); -} \ No newline at end of file diff --git a/src/xrGame/PHCapture.h b/src/xrGame/PHCapture.h deleted file mode 100644 index ed61fce2758..00000000000 --- a/src/xrGame/PHCapture.h +++ /dev/null @@ -1,75 +0,0 @@ -#pragma once -#ifndef PH_CAPTURE_H -#define PH_CAPTURE_H - -#include "phobject.h" -#include "gameobject.h" -#include "physicsshellholder.h" - -class CPhysicShellHolder; -class CPHCharacter; -class CPhysicsElement; -struct CPHCaptureBoneCallback; -class CPHCapture : public CPHUpdateObject -{ -public: - CPHCapture (CPHCharacter *a_character,CPhysicsShellHolder *a_taget_object, CPHCaptureBoneCallback* cb /*=0*/); - CPHCapture (CPHCharacter *a_character,CPhysicsShellHolder *a_taget_object,u16 a_taget_elemrnt); -virtual ~CPHCapture (); - -bool Failed (){return e_state == cstFree;} - -void Release (); -void RemoveConnection(CObject* O); - -protected: -CPHCharacter *m_character; -CPhysicsElement* m_taget_element; -CPhysicsShellHolder* m_taget_object; -dJointID m_joint; -dJointID m_ajoint; -dJointFeedback m_joint_feedback; -Fvector m_capture_pos; -float m_back_force; -float m_pull_force; -float m_capture_force; -float m_capture_distance; -float m_pull_distance; -u32 m_capture_time; -u32 m_time_start; -CBoneInstance *m_capture_bone; -dBodyID m_body; -CPHIsland m_island; -//bool b_failed; -bool b_collide; -bool b_disabled; -bool b_character_feedback; - -private: - enum - { - cstPulling, - cstCaptured, - cstReleased, - cstFree, - cstFailed - } e_state; - - void PullingUpdate(); - void CapturedUpdate(); - void ReleasedUpdate(); - void ReleaseInCallBack(); - void Init( ); - - void Deactivate(); - void CreateBody(); - bool Invalid(); -static void object_contactCallbackFun(bool& do_colide,bool bo1,dContact& c,SGameMtl* /*material_1*/,SGameMtl* /*material_2*/); - -///////////CPHObject///////////////////////////// - virtual void PhDataUpdate(dReal step); - virtual void PhTune(dReal step); - virtual void NetRelcase (CPhysicsShell *s); - -}; -#endif \ No newline at end of file diff --git a/src/xrGame/PHCaptureInit.cpp b/src/xrGame/PHCaptureInit.cpp deleted file mode 100644 index bce89645b02..00000000000 --- a/src/xrGame/PHCaptureInit.cpp +++ /dev/null @@ -1,294 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////// -#include "StdAfx.h" -#include "phcharacter.h" -#include "Physics.h" -#include "ExtendedGeom.h" -#include "PHCapture.h" -#include "Entity.h" -#include "inventory_item.h" -#include "../Include/xrRender/Kinematics.h" -#include "Actor.h" -#include "Inventory.h" -#include "CaptureBoneCallback.h" -extern class CPHWorld *ph_world; -/////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////// -bool can_capture( CPHCharacter *a_character, CPhysicsShellHolder *a_taget_object ) -{ - if(!a_taget_object || - !a_taget_object->m_pPhysicsShell || - !a_taget_object->m_pPhysicsShell->isActive() || - smart_cast(a_taget_object) || - !a_character || - !a_character->b_exist || - !a_character->PhysicsRefObject() || - !a_character->PhysicsRefObject()->Visual( ) - ) return false; - - IKinematics* p_kinematics = smart_cast( a_character->PhysicsRefObject()->Visual( ) ); - VERIFY( p_kinematics ); - CInifile* ini = p_kinematics->LL_UserData(); - if(!ini || - !ini->section_exist( "capture" ) - ) return false; - return true; -} - -bool can_capture( CPHCharacter *a_character, CPhysicsShellHolder *a_taget_object, u16 a_taget_element ) -{ - - if( !can_capture( a_character, a_taget_object) || - a_taget_element == BI_NONE || - !a_taget_object->Visual() - ) return false; - - IKinematics* K= smart_cast( a_taget_object->Visual( ) ); - - if(!K || !K->LL_GetBoneInstance(a_taget_element).callback_param() ) - return false; - return true; -} - -static CBoneInstance * get_capture_bone( CPHCharacter *a_character ) -{ - VERIFY( a_character ); - VERIFY( a_character->PhysicsRefObject() ); - IKinematics* p_kinematics = smart_cast( a_character->PhysicsRefObject()->Visual( ) ); - VERIFY( p_kinematics ); - CInifile* ini = p_kinematics->LL_UserData(); - VERIFY( ini ); - VERIFY( ini->section_exist( "capture" ) ); - u16 capture_bone_id =p_kinematics->LL_BoneID( ini->r_string( "capture", "bone" ) ); - - R_ASSERT2( capture_bone_id != BI_NONE, "wrong capture bone" ); - - return &p_kinematics->LL_GetBoneInstance( capture_bone_id ); - -} - -/* -CPHCharacter *m_character; -CPhysicsElement* m_taget_element; -CPhysicsShellHolder* m_taget_object; -dJointID m_joint; -dJointID m_ajoint; -dJointFeedback m_joint_feedback; -Fvector m_capture_pos; -float m_back_force; -float m_pull_force; -float m_capture_force; -float m_capture_distance; -float m_pull_distance; -u32 m_capture_time; -u32 m_time_start; -CBoneInstance *m_capture_bone; -dBodyID m_body; -CPHIsland m_island; -//bool b_failed; -bool b_collide; -bool b_disabled; -bool b_character_feedback; -*/ - -CPHCapture::CPHCapture ( CPHCharacter *a_character, CPhysicsShellHolder *a_taget_object, CPHCaptureBoneCallback* cb /*=0*/ ): - m_joint ( NULL ) , - m_ajoint ( NULL ) , - m_body ( NULL ) , - m_taget_object ( a_taget_object ) , - m_character ( a_character ) , - b_disabled ( false ) , - b_character_feedback ( false ) , - e_state ( cstFree ) , -/////////////////////////////////////////////////////////////// - m_taget_element (0) , - //dJointFeedback m_joint_feedback; , - m_capture_pos (Fvector().set(0,0,0)) , - m_back_force ( 0 ) , - m_pull_force ( 0 ) , - m_capture_force ( 0 ) , - m_capture_distance ( 0 ) , - m_capture_time ( 0 ) , - m_time_start ( 0 ) , - m_capture_bone ( 0 ) , - //CPHIsland m_island; - b_collide ( false ) - -{ - if( !can_capture( a_character, a_taget_object) ) - return; - - VERIFY( m_taget_object ); - VERIFY( m_taget_object->m_pPhysicsShell ); - VERIFY( a_character ); - m_capture_bone =get_capture_bone( a_character ); - VERIFY( m_capture_bone ); - m_taget_element =m_taget_object->m_pPhysicsShell->NearestToPoint( m_capture_bone->mTransform.c, cb ); - if( ! m_taget_element ) - return; - Init( ); -} - -///////////////////////////////////////////////////////////////////////////////////////////////////////// - CPHCapture::CPHCapture(CPHCharacter *a_character,CPhysicsShellHolder *a_taget_object,u16 a_taget_element): - m_joint ( NULL ) , - m_ajoint ( NULL ) , - m_body ( NULL ) , - b_disabled ( false ) , - b_character_feedback ( false ) , - m_taget_object ( a_taget_object ) , - m_character ( a_character ) , - e_state ( cstFree ) , - -/////////////////////////////////////////////////////////////// - m_taget_element (0) , - //dJointFeedback m_joint_feedback; , - m_capture_pos (Fvector().set(0,0,0)) , - m_back_force ( 0 ) , - m_pull_force ( 0 ) , - m_capture_force ( 0 ) , - m_capture_distance ( 0 ) , - m_capture_time ( 0 ) , - m_time_start ( 0 ) , - m_capture_bone ( 0 ) , - //CPHIsland m_island; - b_collide ( false ) - - -{ - - if( !can_capture( a_character, a_taget_object, a_taget_element ) ) - return; - VERIFY( m_taget_object ); - VERIFY( a_character ); - m_capture_bone =get_capture_bone( a_character ) ; - - IRenderVisual* V=m_taget_object->Visual( ); - VERIFY( V ); - - IKinematics* K= smart_cast( m_taget_object->Visual( ) ); - VERIFY( K ); - - CBoneInstance& tag_bone=K->LL_GetBoneInstance( a_taget_element ); - VERIFY( tag_bone.callback_param( ) ); - - m_taget_element =(CPhysicsElement*)tag_bone.callback_param(); - VERIFY( m_taget_element ); - - Init( ); -} - -void CPHCapture::Init( ) -{ - VERIFY( m_taget_element ); - VERIFY( m_character ); - VERIFY( m_character->PhysicsRefObject() ); - VERIFY( m_character->PhysicsRefObject()->Visual( ) ); - VERIFY( m_capture_bone ); - - IKinematics* p_kinematics = smart_cast( m_character->PhysicsRefObject()->Visual( ) ); - VERIFY( p_kinematics ); - CInifile * ini = p_kinematics->LL_UserData(); - VERIFY( ini ); - - Fvector dir; - Fvector capture_bone_position; - capture_bone_position.set(m_capture_bone->mTransform.c); - b_character_feedback=true; - (m_character->PhysicsRefObject())->XFORM().transform_tiny(capture_bone_position); - - m_taget_element->GetGlobalPositionDynamic(&dir); - dir.sub(capture_bone_position,dir); - - m_pull_distance=ini->r_float("capture","pull_distance"); - if(dir.magnitude()>m_pull_distance) - return; - - float pool_force_factor=4.f; - m_capture_distance =ini->r_float("capture","distance"); //distance - m_capture_force =ini->r_float("capture","capture_force"); //capture force - m_capture_time =ini->r_u32("capture","time_limit")*1000; //time; - m_time_start =Device.dwTimeGlobal; - float max_pull_force =ini->r_float("capture","pull_force"); //pull force - m_pull_force =pool_force_factor*ph_world->Gravity()*m_taget_element->PhysicsShell()->getMass(); - if(m_pull_force>max_pull_force) - m_pull_force=max_pull_force; - float pulling_vel_scale =ini->r_float("capture","velocity_scale"); // - - m_taget_element->set_DynamicLimits(default_l_limit*pulling_vel_scale,default_w_limit*pulling_vel_scale); - //m_taget_element->PhysicsShell()->set_ObjectContactCallback(object_contactCallbackFun); - m_character->SetObjectContactCallback(object_contactCallbackFun); - m_island.Init(); - CActor* A=smart_cast(m_character->PhysicsRefObject()); - if(A) - { - A->SetWeaponHideState(INV_STATE_BLOCK_ALL,true); - } - CPHUpdateObject::Activate(); - e_state = cstPulling; -} - -void CPHCapture::Release() -{ - if( e_state==cstReleased || e_state== cstFree ) - return; - VERIFY( m_island.DActiveIsland() == &m_island ); - - if( m_joint ) - { - m_island.RemoveJoint(m_joint); - dJointDestroy(m_joint); - } - m_joint=NULL; - if( m_ajoint ) - { - m_island.RemoveJoint( m_ajoint ); - dJointDestroy(m_ajoint); - } - m_ajoint=NULL; - - if(m_body) - { - m_island.RemoveBody( m_body ); - dBodyDestroy(m_body); - } - m_body=NULL; - - if(e_state==cstPulling&&m_taget_element&&!m_taget_object->getDestroy()&&m_taget_object->PPhysicsShell()&&m_taget_object->PPhysicsShell()->isActive()) - { - m_taget_element->set_DynamicLimits(); - } - - b_collide=true; - CActor* A=smart_cast(m_character->PhysicsRefObject()); - if(A) - { - A->SetWeaponHideState(INV_STATE_BLOCK_ALL,false); -//. A->inventory().setSlotsBlocked(false); - } - - e_state=cstReleased; -} -#include "phelement.h" -void CPHCapture::Deactivate() -{ - - Release(); - if(m_taget_element) - { - VERIFY(dynamic_cast(m_taget_element)); - - m_taget_element->Enable(); - } - //if(m_taget_object&&m_taget_element&&!m_taget_object->getDestroy()&&m_taget_object->m_pPhysicsShell&&m_taget_object->m_pPhysicsShell->isActive()) - //{ - // m_taget_element->set_ObjectContactCallback(0); - - //} - if(m_character) - m_character->SetObjectContactCallback(0); - CPHUpdateObject::Deactivate(); - e_state =cstFree; - m_character =NULL; - m_taget_object =NULL; - m_taget_element =NULL; -} \ No newline at end of file diff --git a/src/xrGame/PHCharacter.cpp b/src/xrGame/PHCharacter.cpp deleted file mode 100644 index a06eaf859a4..00000000000 --- a/src/xrGame/PHCharacter.cpp +++ /dev/null @@ -1,173 +0,0 @@ -#include "stdafx.h" - -#include "phcharacter.h" -#include "PHDynamicData.h" -#include "Physics.h" -#include "ExtendedGeom.h" -#include "physicsshellholder.h" - -#include "../xrEngine/cl_intersect.h" -#include "../xrEngine/gamemtllib.h" - -#include "tri-colliderKNoOPC\__aabb_tri.h" -#include "../3rd party/ode/ode/src/util.h" - -CPHCharacter::CPHCharacter(void): - CPHDisablingTranslational() -{ - -m_params.acceleration =0.001f ; -m_params.velocity =0.0001f ; -m_body =NULL ; -m_safe_velocity[0] =0.f ; -m_safe_velocity[1] =0.f ; -m_safe_velocity[2] =0.f ; -m_mean_y =0.f ; -m_new_restriction_type=m_restriction_type =rtNone ; -b_actor_movable =true ; -p_lastMaterialIDX =&lastMaterialIDX ; -lastMaterialIDX =GAMEMTL_NONE_IDX ; -injuriousMaterialIDX =GAMEMTL_NONE_IDX ; -m_creation_step =u64(-1) ; -b_in_touch_resrtrictor =false ; -m_current_object_radius =-1.f ; -} - -CPHCharacter::~CPHCharacter(void) -{ - -} - -void CPHCharacter::FreezeContent() -{ - - dBodyDisable(m_body); - CPHObject::FreezeContent(); -} -void CPHCharacter::UnFreezeContent() -{ - - dBodyEnable(m_body); - CPHObject::UnFreezeContent(); -} -void CPHCharacter::getForce(Fvector& force) -{ - if(!b_exist)return; - force.set(*(Fvector*)dBodyGetForce(m_body)); -} -void CPHCharacter::setForce(const Fvector &force) -{ - if(!b_exist)return; - dBodySetForce(m_body,force.x,force.y,force.z); -} - - -void CPHCharacter::get_State(SPHNetState& state) -{ - GetPosition(state.position); - m_body_interpolation.GetPosition(state.previous_position,0); - GetVelocity(state.linear_vel); - getForce(state.force); - - state.angular_vel.set(0.f,0.f,0.f); - state.quaternion.identity(); - state.previous_quaternion.identity(); - state.torque.set(0.f,0.f,0.f); -// state.accel = GetAcceleration(); -// state.max_velocity = GetMaximumVelocity(); - - if(!b_exist) - { - state.enabled=false; - return; - } - state.enabled=CPHObject::is_active();//!!dBodyIsEnabled(m_body); -} -void CPHCharacter::set_State(const SPHNetState& state) -{ - m_body_interpolation.SetPosition(state.previous_position,0); - m_body_interpolation.SetPosition(state.position,1); - SetPosition(state.position); - SetVelocity(state.linear_vel); - setForce(state.force); - -// SetAcceleration(state.accel); -// SetMaximumVelocity(state.max_velocity); - - if(!b_exist) return; - if(state.enabled) - { - Enable(); - }; - if(!state.enabled ) - { - Disable(); - }; - VERIFY2(dBodyStateValide(m_body),"WRONG BODYSTATE WAS SET"); -} - -void CPHCharacter::Disable() -{ - - CPHObject::deactivate(); - dBodyDisable(m_body); - m_body_interpolation.ResetPositions(); -} - -void CPHCharacter::Enable() -{ - if(!b_exist) return; - CPHObject::activate(); - dBodyEnable(m_body); - -} - - - - - - - -void CarHitCallback(bool& /**do_colide/**/,dContact& /**c/**/) -{ - -} - -void CPHCharacter::GetSavedVelocity(Fvector& vvel) -{ - - if(IsEnabled())vvel.set(m_safe_velocity); - else GetVelocity(vvel); -} - -void CPHCharacter::CutVelocity(float l_limit,float /*a_limit*/) -{ - dVector3 limitedl,diffl; - if(dVectorLimit(dBodyGetLinearVel(m_body),l_limit,limitedl)) - { - dVectorSub(diffl,limitedl,dBodyGetLinearVel(m_body)); - dBodySetLinearVel(m_body,diffl[0],diffl[1],diffl[2]); - dBodySetAngularVel(m_body,0.f,0.f,0.f); - dxStepBody(m_body,fixed_step); - dBodySetLinearVel(m_body,limitedl[0],limitedl[1],limitedl[2]); - } -} - -const Fmatrix& CPHCharacter::XFORM () const -{ - return m_phys_ref_object->XFORM();//>renderable.xform; -} -void CPHCharacter::get_LinearVel ( Fvector& velocity ) const -{ - GetVelocity( velocity ); - -} -void CPHCharacter::get_AngularVel ( Fvector& velocity ) const -{ - velocity.set(0,0,0); -} - -const Fvector &CPHCharacter::mass_Center () const -{ - return cast_fv( dBodyGetLinearVel(m_body) ); -} \ No newline at end of file diff --git a/src/xrGame/PHCharacter.h b/src/xrGame/PHCharacter.h deleted file mode 100644 index fc8dc24ba57..00000000000 --- a/src/xrGame/PHCharacter.h +++ /dev/null @@ -1,203 +0,0 @@ -#pragma once -#include "PHObject.h" -#include "PHInterpolation.h" -#include "PHSynchronize.h" -#include "PHDisabling.h" - -#include "../xrEngine/iphysicsshell.h" - - -class CPhysicsShellHolder; -class CClimableObject; -class CGameObject; -class ICollisionDamageInfo; -class CElevatorState; -class CPHActorCharacter; -class CPHAICharacter; -namespace ALife { - enum EHitType; -}; - static enum EEnvironment - { - peOnGround, - peAtWall, - peInAir - }; - - -class CPHCharacter : - public CPHObject, - public CPHSynchronize, - public CPHDisablingTranslational, - public IPhysicsElement -#ifdef DEBUG - ,public pureRender -#endif -{ -public: - -u64 m_creation_step ; -bool b_exist ; -protected: - -////////////////////////// dynamic - -CPHInterpolation m_body_interpolation; -dBodyID m_body; -CPhysicsShellHolder* m_phys_ref_object; - - -dReal m_mass; -bool was_enabled_before_freeze; - -///////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////// -u16* p_lastMaterialIDX; -u16 lastMaterialIDX; -u16 injuriousMaterialIDX; -/////////////////////////////////////////////////////////////////////////// -dVector3 m_safe_velocity; -dVector3 m_safe_position; -dReal m_mean_y; -public: -enum ERestrictionType -{ - - rtStalker =0 , - rtStalkerSmall , - rtMonsterMedium , - rtNone , - rtActor -}; - -private: - -#ifdef DEBUG - virtual CPhysicsShellHolder *ref_object () { return PhysicsRefObject () ;} -#endif - -protected: -ERestrictionType m_new_restriction_type; -ERestrictionType m_restriction_type; -bool b_actor_movable; - -bool b_in_touch_resrtrictor ; -float m_current_object_radius ; -public: - virtual ECastType CastType (){return CPHObject::tpCharacter;} - virtual CPHActorCharacter *CastActorCharacter (){return NULL;} - virtual CPHAICharacter *CastAICharacter (){return NULL;} - ERestrictionType RestrictionType (){return m_restriction_type;} - void SetNewRestrictionType (ERestrictionType rt){m_new_restriction_type=rt;} - void SetRestrictionType (ERestrictionType rt){m_new_restriction_type=m_restriction_type=rt;} - void SetObjectRadius (float R){m_current_object_radius=R;} - float ObjectRadius (){return m_current_object_radius;} - virtual void ChooseRestrictionType (ERestrictionType my_type,float my_depth,CPHCharacter *ch) {} - virtual bool UpdateRestrictionType (CPHCharacter* ach) =0; - virtual void FreezeContent () ; - virtual void UnFreezeContent () ; - virtual dBodyID get_body () {return m_body;} - virtual dSpaceID dSpace () =0; - virtual void Disable () ; - virtual void ReEnable () {;} - virtual void Enable () ; //!! - virtual void SwitchOFFInitContact () =0; - virtual void SwitchInInitContact () =0; - bool IsEnabled () { if(!b_exist)return false; return !!dBodyIsEnabled(m_body);} - bool ActorMovable () {return b_actor_movable;} - void SetActorMovable (bool v) {b_actor_movable=v;} -virtual const ICollisionDamageInfo *CollisionDamageInfo()const =0; -virtual void Reinit () =0; -void SetPLastMaterialIDX (u16* p) {p_lastMaterialIDX=p;} -const u16 &LastMaterialIDX ()const {return *p_lastMaterialIDX;} - u16 InjuriousMaterialIDX ()const {return injuriousMaterialIDX;} - -virtual void SetHitType (ALife::EHitType type) =0; -virtual bool TouchRestrictor (ERestrictionType rttype) =0; -virtual void SetElevator (CClimableObject* climable) {}; -virtual void SetMaterial (u16 material) =0 ; -virtual void SetMaximumVelocity (dReal /**vel/**/) {} //!! -virtual dReal GetMaximumVelocity () {return 0;} -virtual void SetJupmUpVelocity (dReal /**velocity/**/) {} //!! -virtual void IPosition (Fvector& /**pos/**/) {} -virtual u16 ContactBone () {return 0;} -virtual void DeathPosition (Fvector& /**deathPos/**/) {} -virtual void ApplyImpulse (const Fvector& /**dir/**/,const dReal /**P/**/) {} -virtual void ApplyForce (const Fvector& force) =0 ; -virtual void ApplyForce (const Fvector& dir,float force) =0 ; -virtual void ApplyForce (float x,float y, float z) =0 ; -virtual void AddControlVel (const Fvector& vel) =0 ; -virtual void Jump (const Fvector& jump_velocity) =0 ; -virtual bool JumpState () =0 ; -virtual EEnvironment CheckInvironment () =0 ; -virtual bool ContactWas () =0 ; -virtual void GroundNormal (Fvector &norm) =0 ; -virtual void Create (dVector3 /**sizes/**/) =0 ; -virtual void Destroy (void) =0 ; -virtual void SetBox (const dVector3 &sizes) =0 ; -virtual void SetAcceleration (Fvector accel) =0 ; -virtual void SetForcedPhysicsControl (bool v){} -virtual bool ForcedPhysicsControl () {return false;} -virtual void SetCamDir (const Fvector& cam_dir) =0 ; -virtual const Fvector& CamDir ()const =0 ; -virtual Fvector GetAcceleration () =0 ; -virtual void SetPosition (const Fvector &pos) =0 ; -virtual void SetApplyGravity (BOOL flag) { dBodySetGravityMode(m_body,flag); } -virtual void SetObjectContactCallbackData ( void* callback ) =0 ; -virtual void SetObjectContactCallback (ObjectContactCallbackFun* callback) =0 ; -virtual void SetWheelContactCallback (ObjectContactCallbackFun* callback) =0 ; -virtual ObjectContactCallbackFun* ObjectContactCallBack () {return NULL;} -virtual void GetVelocity (Fvector& vvel)const =0 ; -virtual void GetSavedVelocity (Fvector& vvel) ; -virtual void GetSmothedVelocity (Fvector& vvel) =0 ; -virtual void SetVelocity (Fvector vel) =0 ; -virtual void SetAirControlFactor (float factor) =0 ; -virtual void GetPosition (Fvector& vpos) =0 ; -virtual void GetFootCenter (Fvector& vpos) {vpos.set(*(Fvector*)dBodyGetPosition(m_body));} -virtual void SetMas (dReal mass) =0 ; -virtual void SetCollisionDamageFactor (float f) =0 ; -virtual float Mass () =0 ; -virtual void SetPhysicsRefObject (CPhysicsShellHolder* ref_object) =0 ; -virtual void SetNonInteractive (bool v) =0 ; -virtual CPhysicsShellHolder* PhysicsRefObject () {return m_phys_ref_object;} - -//AICharacter -virtual void GetDesiredPosition (Fvector& /**dpos/**/) {} -virtual void SetDesiredPosition (const Fvector& /**pos/**/) {} -virtual void BringToDesired (float /**time/**/,float /**velocity/**/,float force=1.f) {} -virtual bool TryPosition (Fvector /**pos/**/,bool) {return false;} -virtual bool TouchBorder () {return false;} -virtual void getForce (Fvector& force) ; -virtual void setForce (const Fvector& force) ; -virtual float FootRadius () =0 ; -virtual void get_State ( SPHNetState& state) ; -virtual void set_State (const SPHNetState& state) ; -virtual void cv2obj_Xfrom (const Fquaternion& q,const Fvector& pos, Fmatrix& xform) {;} -virtual void cv2bone_Xfrom (const Fquaternion& q,const Fvector& pos, Fmatrix& xform) {;} -virtual const Fvector& ControlAccel ()const =0; -virtual float &FrictionFactor () =0; -virtual void CutVelocity (float l_limit,float a_limit) ; -virtual u16 get_elements_number () {return 1;}; -virtual CPHSynchronize *get_element_sync (u16 element) {VERIFY(element==0);return static_cast(this);}; -virtual CElevatorState *ElevatorState () =0; - -protected: -virtual const Fmatrix &XFORM () const ; -virtual void get_LinearVel ( Fvector& velocity ) const ; -virtual void get_AngularVel ( Fvector& velocity ) const ; -virtual u16 numberOfGeoms () const { return 0; } -virtual const IPhysicsGeometry*geometry ( u16 i ) const { return 0; } -virtual const Fvector &mass_Center () const ; - -virtual void get_xform ( Fmatrix& form ) const { form.set( XFORM()); } -virtual bool collide_fluids () const { return true ; } -public: -virtual void update_last_material() =0; - -public: - CPHCharacter (void) ; -virtual ~CPHCharacter (void) ; -}; - - diff --git a/src/xrGame/PHCollideValidator.cpp b/src/xrGame/PHCollideValidator.cpp deleted file mode 100644 index e757bdddf8a..00000000000 --- a/src/xrGame/PHCollideValidator.cpp +++ /dev/null @@ -1,116 +0,0 @@ -#include "stdafx.h" -#include "PHObject.h" -#include "phcollidevalidator.h" - -CGID CPHCollideValidator::freeGroupID=0; -_flags CPHCollideValidator::ClassFlags={CLClassBits(0)}; -_flags CPHCollideValidator::ClassNCFlags={CLClassBits(0)}; -_flags CPHCollideValidator::NonTypeFlags={CLClassBits(0)}; -void CPHCollideValidator::Init() -{ - freeGroupID=0; - NonTypeFlags.set(cbNCGroupObject,TRUE); - - ClassFlags.set(cbClassDynamic|cbClassCharacter|cbClassRagDoll|cbClassAnimated,TRUE); - ClassNCFlags.set(cbNCClassCharacter|cbNCClassDynamic|cbNCClassRagDoll|cbNCClassAnimated,TRUE); - -} -CGID CPHCollideValidator::RegisterGroup() -{ - ++freeGroupID; - return freeGroupID-1; -} - -void CPHCollideValidator::InitObject(CPHObject& obj) -{ - obj.collide_class_bits().assign(0); - obj.collide_class_bits().set(cbClassDynamic,TRUE); - obj.collide_bits()=0; -} -void CPHCollideValidator::RegisterObjToGroup(CGID group,CPHObject& obj) -{ - R_ASSERT(group ClassFlags; -static _flags ClassNCFlags; -static _flags NonTypeFlags; -}; - - -#endif \ No newline at end of file diff --git a/src/xrGame/PHCollisionDamageReceiver.cpp b/src/xrGame/PHCollisionDamageReceiver.cpp index 2b809428ad8..ad1439f1f84 100644 --- a/src/xrGame/PHCollisionDamageReceiver.cpp +++ b/src/xrGame/PHCollisionDamageReceiver.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "phcollisiondamagereceiver.h" -#include "../xrphysics/IPhysicsShellHolder.h" -#include "../xrcore/xr_ini.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrphysics/geometry.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/IPhysicsShellHolder.h" +#include "xrCore/xr_ini.h" +#include "Include/xrRender/Kinematics.h" +#include "xrPhysics/geometry.h" +#include "xrPhysics/PhysicsShell.h" //#include "xrCore/MaterialLib/GameMtlLib.h" //#include "Physics.h" #include "xrMessages.h" diff --git a/src/xrGame/PHCollisionDamageReceiver.h b/src/xrGame/PHCollisionDamageReceiver.h index e02cfda9fc2..597f11e0f80 100644 --- a/src/xrGame/PHCollisionDamageReceiver.h +++ b/src/xrGame/PHCollisionDamageReceiver.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrphysics/icollisiondamagereceiver.h" +#include "xrPhysics/icollisiondamagereceiver.h" class CPhysicsShellHolder; //struct dContact; diff --git a/src/xrGame/PHCommander.cpp b/src/xrGame/PHCommander.cpp index 5dc191c9b17..39e38ef3e89 100644 --- a/src/xrGame/PHCommander.cpp +++ b/src/xrGame/PHCommander.cpp @@ -5,7 +5,7 @@ #ifdef DEBUG //#include "phworld.h" //extern CPHWorld *ph_world; -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" #endif CPHCall::CPHCall(CPHCondition* condition,CPHAction* action) diff --git a/src/xrGame/PHCommander.h b/src/xrGame/PHCommander.h index 8d3b29c411c..0e67357bbbe 100644 --- a/src/xrGame/PHCommander.h +++ b/src/xrGame/PHCommander.h @@ -2,7 +2,7 @@ #define PH_COMMANDER_H class CPHReqBase; class CPHReqComparerV; -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphworld.h" class CPhysicsShell; class CPHReqBase { diff --git a/src/xrGame/PHContactBodyEffector.cpp b/src/xrGame/PHContactBodyEffector.cpp deleted file mode 100644 index fb9493ba188..00000000000 --- a/src/xrGame/PHContactBodyEffector.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "stdafx.h" -#include "PHContactBodyEffector.h" -#include "ExtendedGeom.h" -#include "tri-colliderknoopc/dTriList.h" -#include "PhysicsCommon.h" -#include "../xrEngine/gamemtllib.h" -#include "MathUtils.h" -void CPHContactBodyEffector::Init(dBodyID body,const dContact& contact,SGameMtl* material) -{ - CPHBaseBodyEffector::Init(body); - m_contact=contact; - m_recip_flotation=1.f-material->fFlotationFactor; - m_material=material; -} -void CPHContactBodyEffector::Merge(const dContact& contact, SGameMtl* material) -{ - m_recip_flotation=_max(1.f-material->fFlotationFactor,m_recip_flotation); - //m_contact.geom.normal[0]+=contact.geom.normal[0]; - //m_contact.geom.normal[1]+=contact.geom.normal[1]; - //m_contact.geom.normal[2]+=contact.geom.normal[2]; -} - -void CPHContactBodyEffector::Apply() -{ - const dReal* linear_velocity =dBodyGetLinearVel(m_body); - dReal linear_velocity_smag =dDOT(linear_velocity,linear_velocity); - dReal linear_velocity_mag =_sqrt(linear_velocity_smag); - dReal effect =10000.f*m_recip_flotation*m_recip_flotation; - dMass mass; - dBodyGetMass(m_body,&mass); - dReal l_air=linear_velocity_mag*effect;//force/velocity !!! - if(l_air>mass.mass/fixed_step) l_air=mass.mass/fixed_step;//validate - - if(!fis_zero(l_air)) - { - dVector3 force={ - -linear_velocity[0]*l_air, - -linear_velocity[1]*l_air, - -linear_velocity[2]*l_air, - 0.f - }; - - if(!m_material->Flags.is(SGameMtl::flPassable)) - { - dVector3& norm=m_contact.geom.normal; - accurate_normalize(norm); - dMass m; - dBodyGetMass(m_body,&m); - dReal prg=1.f*dDOT(force,norm);//+dDOT(linear_velocity,norm)*m.mass/fixed_step - force[0]-=prg*norm[0]; - force[1]-=prg*norm[1]; - force[2]-=prg*norm[2]; - } - dBodyAddForce( - m_body, - force[0], - force[1], - force[2] - ); - } - dBodySetData(m_body,NULL); -} \ No newline at end of file diff --git a/src/xrGame/PHContactBodyEffector.h b/src/xrGame/PHContactBodyEffector.h deleted file mode 100644 index 833a79bdd09..00000000000 --- a/src/xrGame/PHContactBodyEffector.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef PH_CONTACT_BODY_EFFECTOR_H -#define PH_CONTACT_BODY_EFFECTOR_H -#include "PHBaseBodyEffector.h" -struct SGameMtl; -class CPHContactBodyEffector : public CPHBaseBodyEffector -{ -dContact m_contact; -float m_recip_flotation; -SGameMtl* m_material; -public: -void Init(dBodyID body,const dContact& contact,SGameMtl* material); -void Merge(const dContact& contact, SGameMtl* material); -void Apply(); -}; -#endif //PH_CONTACT_BODY_EFFECTOR_H \ No newline at end of file diff --git a/src/xrGame/PHDebug.cpp b/src/xrGame/PHDebug.cpp index 01e09681bd4..747edca824d 100644 --- a/src/xrGame/PHDebug.cpp +++ b/src/xrGame/PHDebug.cpp @@ -2,14 +2,14 @@ #ifdef DEBUG //#include "physics.h" //#include "MathUtils.h" -#include "../xrEngine/StatGraph.h" +#include "xrEngine/StatGraph.h" #include "PHDebug.h" //#include "physics.h" -#include "../xrphysics/MathUtils.h" +#include "xrPhysics/MathUtils.h" //#include "PHObject.h" -#include "../xrphysics/ExtendedGeom.h" -#include "../xrphysics/iphworld.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/ExtendedGeom.h" +#include "xrPhysics/iphworld.h" +#include "xrPhysics/physicsshell.h" #include "Level.h" @@ -17,10 +17,10 @@ #include "debug_renderer.h" #include "physicsshellholder.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "xrCore/Animation/Bone.hpp" -#include "../xrEngine/iphdebug.h" +#include "xrEngine/iphdebug.h" //#include "phelement.h" #include "ui_base.h" diff --git a/src/xrGame/PHDebug.h b/src/xrGame/PHDebug.h index c96c559a886..bf6005a44dd 100644 --- a/src/xrGame/PHDebug.h +++ b/src/xrGame/PHDebug.h @@ -2,8 +2,8 @@ #define PH_DEBUG_H #ifdef DEBUG struct dContact; -#include "../xrEngine/StatGraph.h" -#include "../xrphysics/debug_output.h" +#include "xrEngine/StatGraph.h" +#include "xrPhysics/debug_output.h" #define DRAW_CONTACTS diff --git a/src/xrGame/PHDefs.h b/src/xrGame/PHDefs.h deleted file mode 100644 index 51531388d70..00000000000 --- a/src/xrGame/PHDefs.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef PHDEFS_H -#define PHDEFS_H -class CPHElement; -class CPHJoint; -class CPhysicsShell; - -//class CPHFracture; -class CShellSplitInfo; - -typedef std::pair shell_root; - -DEFINE_VECTOR(CPHElement*,ELEMENT_STORAGE,ELEMENT_I) -typedef xr_vector::const_iterator ELEMENT_CI; -DEFINE_VECTOR(CPHJoint*,JOINT_STORAGE,JOINT_I) -DEFINE_VECTOR(shell_root,PHSHELL_PAIR_VECTOR,SHELL_PAIR_I) -typedef xr_vector::reverse_iterator SHELL_PAIR_RI; - -typedef xr_vector::reverse_iterator ELEMENT_RI; - -#endif \ No newline at end of file diff --git a/src/xrGame/PHDestroyable.cpp b/src/xrGame/PHDestroyable.cpp index a90dc4847a1..431c37a483d 100644 --- a/src/xrGame/PHDestroyable.cpp +++ b/src/xrGame/PHDestroyable.cpp @@ -7,7 +7,7 @@ #include "object_factory.h" #include "xrServer_Objects_ALife.h" #include "Level.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "Actor.h" #include "CharacterPhysicsSupport.h" #include "ai_object_location.h" @@ -15,12 +15,12 @@ #include "game_graph.h" //#include "PHCollideValidator.h" //#include "PHShell.h" -#include "../xrphysics/MathUtils.h" +#include "xrPhysics/MathUtils.h" #ifdef DEBUG -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" #endif -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" /* [impulse_transition_to_parts] random_min =1 ; õ ìàññó îáúåêòà = âåëè÷èíà ñëó÷àéíî íàïðàâëåííîãî èìïóëüñà diff --git a/src/xrGame/PHDestroyableNotificate.cpp b/src/xrGame/PHDestroyableNotificate.cpp index b38c53298e3..bb4bcc927d6 100644 --- a/src/xrGame/PHDestroyableNotificate.cpp +++ b/src/xrGame/PHDestroyableNotificate.cpp @@ -5,7 +5,7 @@ #include "PHDestroyable.h" #include "Level.h" #include "xrServer_Object_Base.h" -#include "../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" #include "PhysicsShellHolder.h" #include "xrServer_Objects.h" void CPHDestroyableNotificate::spawn_notificate(CSE_Abstract* so) diff --git a/src/xrGame/PHDisabling.cpp b/src/xrGame/PHDisabling.cpp deleted file mode 100644 index c0c75c77c66..00000000000 --- a/src/xrGame/PHDisabling.cpp +++ /dev/null @@ -1,273 +0,0 @@ -#include "stdafx.h" -#include "PHDisabling.h" -#include "PhysicsCommon.h" -#include "Physics.h" -#include "mathutils.h" -#ifdef DEBUG -#include "phdebug.h" -#endif - -extern CPHWorld* ph_world; -SDisableVector::SDisableVector() -{ - Init(); -} - - - -void SDisableVector::Reset() -{ - sum.set(0.f,0.f,0.f); -} - -void SDisableVector::Init() -{ - previous.set(0.f,0.f,0.f); - Reset(); -} - -float SDisableVector::Update(const Fvector& new_vector) -{ - Fvector dif; - dif.sub(new_vector,previous); - previous.set(new_vector); - sum.add(dif); - return dif.magnitude(); -} - -float SDisableVector::UpdatePrevious(const Fvector& new_vector) -{ - Fvector dif; - dif.sub(new_vector,previous); - previous.set(new_vector); - return dif.magnitude(); -} - -float SDisableVector::SumMagnitude() -{ - return sum.magnitude(); -} - -SDisableUpdateState::SDisableUpdateState() -{ - Reset(); -} - - - -void SDisableUpdateState::Reset() -{ - disable = false ; - enable = false ; -} - -SDisableUpdateState& SDisableUpdateState::operator &= (SDisableUpdateState& lstate) -{ - disable = disable && lstate.disable; - enable = enable || lstate.enable; - return *this; -} - -CBaseDisableData::CBaseDisableData(): m_disabled(false), m_last_frame_updated(u16(-1)) -{ - - m_frames =worldDisablingParams.objects_params.L2frames ; - Reinit(); - -} - -void CBaseDisableData::Reinit() -{ - m_count =m_frames ; - if(ph_world) - m_count=m_count+ph_world->disable_count ; - m_stateL1 .Reset() ; - m_stateL2 .Reset() ; - -} -void CBaseDisableData::Disabling() -{ - - - VERIFY(ph_world); - if(ph_world->IsFreezed()) - return; - if( m_last_frame_updated == ph_world->StepsShortCnt() ) - return; - m_last_frame_updated = ph_world->StepsShortCnt(); - dBodyID body = get_body(); - m_count--; - - UpdateL1(); - - CheckState(m_stateL1); - - if(m_count==0)//ph_world->disable_count==dis_frames//m_count==m_frames - { - UpdateL2(); - CheckState(m_stateL2); - m_count=m_frames; - } - const dReal* force=dBodyGetForce(body); - const dReal* torqu=dBodyGetTorque(body); - if(dDOT(force,force)>0.f || dDOT(torqu,torqu)>0.f) m_disabled=false; - if(dBodyIsEnabled(body)) - { - ReEnable(); - if(!m_disabled&& (ph_world->disable_count!=m_count%worldDisablingParams.objects_params.L2frames)) - { - m_count=m_frames+ph_world->disable_count; - } - } - if(m_disabled) - Disable();//dBodyDisable(body); - -} - -void CPHDisablingBase::Reinit() -{ - m_mean_velocity.Init() ; - m_mean_acceleration.Init() ; - CBaseDisableData::Reinit() ; - bool disable=!dBodyIsEnabled(get_body()); - m_stateL1.disable=disable; - m_stateL1.enable=!disable; - m_stateL2.disable=disable; - m_stateL2.enable=!disable; -} -void CPHDisablingBase::UpdateValues(const Fvector &new_pos,const Fvector &new_vel) -{ - - if(m_count m_params.velocity*worldDisablingParams.reanable_factor || - accel > m_params.acceleration*worldDisablingParams.reanable_factor) - state.enable=true ; - } -protected: - - SDisableVector m_mean_velocity ; - SDisableVector m_mean_acceleration ; - SOneDDOParams m_params ; -}; - -class CPHDisablingRotational : - public CPHDisablingBase -{ -public: - CPHDisablingRotational () ; - void Reinit () ; - virtual void UpdateL1 () ; - virtual void set_DisableParams (const SAllDDOParams& params) ; -}; - -class CPHDisablingTranslational : - public CPHDisablingBase -{ -public: - CPHDisablingTranslational () ; - void Reinit () ; - virtual void UpdateL1 () ; - virtual void set_DisableParams (const SAllDDOParams& params) ; -}; - -class CPHDisablingFull : - public CPHDisablingTranslational, - public CPHDisablingRotational -{ -public: - void Reinit () ; - virtual void UpdateL1 () ; - virtual void UpdateL2 () ; - virtual void set_DisableParams (const SAllDDOParams& params) ; -}; -#endif \ No newline at end of file diff --git a/src/xrGame/PHDynamicData.cpp b/src/xrGame/PHDynamicData.cpp deleted file mode 100644 index 51c3ac83322..00000000000 --- a/src/xrGame/PHDynamicData.cpp +++ /dev/null @@ -1,207 +0,0 @@ -// PHDynamicData.cpp: implementation of the PHDynamicData class. -// -////////////////////////////////////////////////////////////////////// -#include "stdafx.h" -#include "PHDynamicData.h" - -////////////////////////////////////////////////////////////////////// -// Construction/Destruction -////////////////////////////////////////////////////////////////////// - -#if 0 - -PHDynamicData::PHDynamicData() -{ - numOfChilds=0; - //Childs=NULL; - p_parent_body_interpolation=NULL; -} - -PHDynamicData::~PHDynamicData() -{ - if(numOfChilds){ - //for(unsigned int i=0;i0) - //Childs[childNum].Childs=new PHDynamicData[numOfchilds]; - Childs[childNum].Childs.resize(numOfchilds); - else - //Childs[childNum].Childs=NULL; - Childs[childNum].numOfChilds=0; - - Childs[childNum].geom=NULL; - Childs[childNum].transform=NULL; - return true; - } - else return false; -} - -void PHDynamicData::CalculateR_N_PosOfChilds(dBodyID parent) -{ - Fmatrix parent_transform;//,mYM; - //mYM.rotateY (deg2rad(-90.f)); - DMXPStoFMX(dBodyGetRotation(parent),dBodyGetPosition(parent),parent_transform); - DMXPStoFMX(dBodyGetRotation(body),dBodyGetPosition(body),BoneTransform); - parent_transform.mulB_43 (ZeroTransform); - //parent_transform.mulA(mYM); - parent_transform.invert (); - - //BoneTransform.mulA(mYM); - BoneTransform.mulA_43 (parent_transform); - - for(unsigned int i=0;iInterpolateRotation(parent_transform); - p_parent_body_interpolation->InterpolatePosition(parent_transform.c); - - body_interpolation.InterpolateRotation(transform); - - body_interpolation.InterpolatePosition(transform.c); - parent_transform.mulB_43 (ZeroTransform); - - parent_transform.invert(); - - - //BoneTransform.mulA(parent_transform); - transform.mulA_43 (parent_transform); -} -PHDynamicData * PHDynamicData::GetChild(unsigned int ChildNum) -{ - if(ChildNum 1000 -#pragma once -#endif // _MSC_VER > 1000 - -class PHDynamicData -{ -public: -dVector3 pos; -dMatrix3 R; -Fmatrix BoneTransform; -private: -dBodyID body; -CPHInterpolation* p_parent_body_interpolation; -CPHInterpolation body_interpolation; -dGeomID geom; -dGeomID transform; -//PHDynamicData* Childs; -//xr_vector Childs; -unsigned int numOfChilds; -Fmatrix ZeroTransform; -public: - inline void UpdateInterpolation(){ - body_interpolation.UpdatePositions(); - body_interpolation.UpdateRotations(); - } - void UpdateInterpolationRecursive() ; - void InterpolateTransform(Fmatrix& transform); - void InterpolateTransformVsParent(Fmatrix& transform); -// PHDynamicData& operator [] (unsigned int i) {return Childs[i];}; - void Destroy(); - void Create(unsigned int numOfchilds,dBodyID Body); - void CalculateData(void); - PHDynamicData * GetChild(unsigned int ChildNum); - bool SetChild(unsigned int ChildNum,unsigned int numOfchilds,dBodyID body); - void SetAsZero(); - void SetAsZeroRecursive(); - void SetZeroTransform(Fmatrix& aTransform); - PHDynamicData(unsigned int numOfchilds,dBodyID body); - PHDynamicData(); -// virtual ~PHDynamicData(); - void GetWorldMX(Fmatrix& aTransform){ - dMatrix3 R; - dQtoR(dBodyGetQuaternion(body),R); - DMXPStoFMX(R,dBodyGetPosition(body),aTransform); - } - void GetTGeomWorldMX(Fmatrix& aTransform){ - if(!transform) return; - Fmatrix NormTransform,Transform; - dVector3 P0={0,0,0,-1}; - Fvector Translate,Translate1; - //compute_final_tx(geom); - //dQtoR(dBodyGetQuaternion(body),R); - DMXPStoFMX(dBodyGetRotation(body),P0,NormTransform); - DMXPStoFMX(dGeomGetRotation(dGeomTransformGetGeom(transform)),P0,Transform); - - - dVectorSet((dReal*)&Translate,dGeomGetPosition(dGeomTransformGetGeom(transform))); - dVectorSet((dReal*)&Translate1,dBodyGetPosition(body)); - - aTransform.identity (); - aTransform.translate_over (Translate); - aTransform.mulA_43 (NormTransform); - aTransform.translate_over (Translate1); - aTransform.mulA_43 (Transform); - - // Translate.add(Translate1); - //transform.translate_over(Translate1); - - //transform.translate_add - //normalTransform=oMatrix4x4(dGeomGetRotation(dGeomTransformGetGeom(geom)))*normalTransform; - //oMatrix4x4 meshTransform(normalTransform); - - //meshTransform.PreTranslate(oVector3(dGeomGetPosition(dGeomTransformGetGeom(geom)))); - //meshTransform.PostTranslate(oVector3(dBodyGetPosition(body))); - } - static inline void DMXPStoFMX(const dReal* R,const dReal* pos,Fmatrix& aTransform){ - - CopyMemory(&aTransform,R,sizeof(dMatrix3)); - aTransform.transpose(); - CopyMemory(&aTransform.c,pos,sizeof(Fvector)); - aTransform._14=0.f; - aTransform._24=0.f; - aTransform._34=0.f; - aTransform._44=1.f; - }; - static inline void DMXtoFMX(const dReal* R,Fmatrix& aTransform){ - aTransform._11=R[0]; - aTransform._12=R[4]; - aTransform._13=R[8]; - aTransform._14=0.f; - - aTransform._21=R[1]; - aTransform._22=R[5]; - aTransform._23=R[9]; - aTransform._24=0.f; - - aTransform._31=R[2]; - aTransform._32=R[6]; - aTransform._33=R[10]; - aTransform._34=0.f; - aTransform._44=1.f; - }; - static inline void FMX33toDMX(const Fmatrix33& aTransform,dReal* R){ - R[0]=aTransform._11; - R[4]=aTransform._12; - R[8]=aTransform._13; - - R[1]=aTransform._21; - R[5]=aTransform._22; - R[9]=aTransform._23; - - R[2]=aTransform._31; - R[6]=aTransform._32; - R[10]=aTransform._33; - }; - static inline void FMXtoDMX(const Fmatrix& aTransform,dReal* R){ - R[0]=aTransform._11; - R[4]=aTransform._12; - R[8]=aTransform._13; - - R[1]=aTransform._21; - R[5]=aTransform._22; - R[9]=aTransform._23; - - R[2]=aTransform._31; - R[6]=aTransform._32; - R[10]=aTransform._33; - }; -private: - void CalculateR_N_PosOfChilds(dBodyID parent); -public: - bool SetGeom(dGeomID ageom); - bool SetTransform(dGeomID ageom); -}; - -#endif // !defined(AFX_PHDynamicData_H__ACC01646_B581_4639_B78C_30311432021B__INCLUDED_) diff --git a/src/xrGame/PHElement.cpp b/src/xrGame/PHElement.cpp deleted file mode 100644 index dc83287ef18..00000000000 --- a/src/xrGame/PHElement.cpp +++ /dev/null @@ -1,1684 +0,0 @@ -#include "StdAfx.h" -#include "PHDynamicData.h" -#include "Physics.h" -#include "tri-colliderknoopc/dTriList.h" -#include "PHFracture.h" -#include "PHContactBodyEffector.h" -#include "MathUtils.h" -#include "matrix_utils.h" -#include "PhysicsShellHolder.h" -#include "game_object_space.h" -//#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "../3rd party/ode/ode/src/util.h" -#ifdef DEBUG -# include "PHDebug.h" -# include "objectdump.h" -#endif // DEBUG - -/////////////////////////////////////////////////////////////// -#pragma warning(disable:4995) -#pragma warning(disable:4267) - -#include "../3rd party/ode/ode/src/collision_kernel.h" - - -#pragma warning(default:4267) -#pragma warning(default:4995) -/////////////////////////////////////////////////////////////////// - -#include "ExtendedGeom.h" - -#include "PHShell.h" -#include "PHElement.h" -#include "PHElementInline.h" -extern CPHWorld* ph_world; - - - - -///////////////////////////////////////////////////////////////////////////////////////////////////////// -//////Implementation for CPhysicsElement -CPHElement::CPHElement() //aux -{ - m_w_limit = default_w_limit; - m_l_limit = default_l_limit; - m_l_scale=default_l_scale; - m_w_scale=default_w_scale; - - //push_untill=0; - - //temp_for_push_out=NULL; - - m_body=NULL; - //bActive=false; - //bActivating=false; - m_flags.set(flActive,FALSE); - m_flags.set(flActivating,FALSE); - m_parent_element=NULL; - m_shell=NULL; - - - k_w=default_k_w; - k_l=default_k_l;//1.8f; - m_fratures_holder=NULL; - //b_enabled_onstep=false; - //m_flags.set(flEnabledOnStep,FALSE); - m_flags.assign(0); - mXFORM.identity(); - m_mass.setZero(); - m_mass_center.set(0,0,0); - m_volume=0.f; -} - -void CPHElement::add_Box (const Fobb& V) -{ - CPHGeometryOwner::add_Box(V); -} - - -void CPHElement::add_Sphere (const Fsphere& V) -{ - CPHGeometryOwner::add_Sphere(V); -} - -void CPHElement::add_Cylinder (const Fcylinder& V) -{ - CPHGeometryOwner::add_Cylinder(V); -} - -void CPHElement:: build (){ - - m_body=dBodyCreate(0);//phWorld - //m_saved_contacts=dJointGroupCreate (0); - //b_contacts_saved=false; - dBodyDisable(m_body); - //dBodySetFiniteRotationMode(m_body,1); - //dBodySetFiniteRotationAxis(m_body,0,0,0); - VERIFY2(dMass_valide(&m_mass),"Element has bad mass"); - if(m_geoms.empty()) - { - Fix(); - } - else - { - VERIFY2(m_mass.mass>0.f,"Element has bad mass"); - dBodySetMass(m_body,&m_mass); - } - - VERIFY_BOUNDARIES2(m_mass_center,phBoundaries,PhysicsRefObject(),"m_mass_center"); - - dBodySetPosition(m_body,m_mass_center.x,m_mass_center.y,m_mass_center.z); - - CPHDisablingTranslational::Reinit(); - /////////////////////////////////////////////////////////////////////////////////////// - CPHGeometryOwner::build(); - set_body(m_body); -} - -void CPHElement::RunSimulation() -{ - //if(push_untill) - //push_untill+=Device.dwTimeGlobal; - - if(group_space()) - dSpaceAdd(m_shell->dSpace(),(dGeomID)group_space()); - - //else - // if(!m_geoms.empty())(*m_geoms.begin())->add_to_space(m_shell->dSpace()); - if(!m_body->world) - { - //dWorldAddBody(phWorld, m_body); - m_shell->Island().AddBody(m_body); - } - dBodyEnable(m_body); -} - -void CPHElement::destroy () -{ - //dJointGroupDestroy(m_saved_contacts); - CPHGeometryOwner::destroy(); - if(m_body)//&&m_body->world - { - if(m_body->world)m_shell->Island().RemoveBody(m_body); - dBodyDestroy(m_body); - m_body=NULL; - } - DestroyGroupSpace(); - -} - -void CPHElement::calculate_it_data(const Fvector& mc,float mas) -{ - float density=mas/m_volume; - calculate_it_data_use_density(mc,density); -} - -static float static_dencity; -void CPHElement::calc_it_fract_data_use_density(const Fvector& mc,float density) -{ - m_mass_center.set(mc); - dMassSetZero(&m_mass); - static_dencity=density; - recursive_mass_summ(0,m_fratures_holder->m_fractures.begin()); -} -void CPHElement::set_local_mass_center(const Fvector &mc ) -{ - m_mass_center.set(mc); - dVectorSet( m_mass.c, cast_fp( mc ) ); -} -dMass CPHElement::recursive_mass_summ(u16 start_geom,FRACTURE_I cur_fracture) -{ - dMass end_mass; - dMassSetZero(&end_mass); - GEOM_I i_geom=m_geoms.begin()+start_geom, e=m_geoms.begin()+cur_fracture->m_start_geom_num; - for(;i_geom!=e;++i_geom)(*i_geom)->add_self_mass(end_mass,m_mass_center,static_dencity); - dMassAdd(&m_mass,&end_mass); - start_geom=cur_fracture->m_start_geom_num; - ++cur_fracture; - if(m_fratures_holder->m_fractures.end() != cur_fracture) - cur_fracture->SetMassParts(m_mass,recursive_mass_summ(start_geom,cur_fracture)); - return end_mass; -} -void CPHElement:: setDensity (float M) -{ - calculate_it_data_use_density(get_mc_data(),M); -} - -void CPHElement:: setMass (float M) -{ - - calculate_it_data(get_mc_data(),M); -} - -void CPHElement:: setDensityMC (float M,const Fvector& mass_center) -{ - m_mass_center.set(mass_center); - calc_volume_data(); - calculate_it_data_use_density(mass_center,M); -} - -void CPHElement:: setMassMC (float M,const Fvector& mass_center) -{ - m_mass_center.set(mass_center); - calc_volume_data(); - calculate_it_data(mass_center,M); -} - - - -void CPHElement::Start() -{ - build(); - RunSimulation(); -} - -void CPHElement::Deactivate() -{ - VERIFY(isActive()); - - destroy(); - m_flags.set(flActive,FALSE); - m_flags.set(flActivating,FALSE); - //bActive=false; - //bActivating=false; - IKinematics* K=m_shell->PKinematics(); - if(K) - { - if( K->LL_GetBoneInstance(m_SelfID).callback_type() == bctPhysics ) - ClearBoneCallback(); - } -} - -void CPHElement::SetTransform(const Fmatrix &m0){ - VERIFY2(_valid(m0), make_string( "invalid_form_in_set_transform" ) + dbg_object_full_capped_dump_string( PhysicsRefObject() ) ); - VERIFY2(valid_pos( m0.c ), dbg_valide_pos_string( m0.c, PhysicsRefObject(), "invalid_form_in_set_transform" ) ); - Fvector mc; - CPHGeometryOwner::get_mc_vs_transform(mc,m0); - VERIFY_BOUNDARIES2(mc,phBoundaries,PhysicsRefObject(),"mass center in set transform"); - dBodySetPosition(m_body,mc.x,mc.y,mc.z); - Fmatrix33 m33; - m33.set(m0); - dMatrix3 R; - PHDynamicData::FMX33toDMX(m33,R); - dBodySetRotation(m_body,R); - CPHDisablingFull::Reinit(); - - VERIFY2(dBodyGetPosition(m_body),"not valide safe position"); - VERIFY2(dBodyGetLinearVel(m_body),"not valide safe velocity"); - m_flags.set(flUpdate,TRUE); - m_shell->spatial_move(); - CPHGeometryOwner::clear_motion_history(); -} - -void CPHElement::getQuaternion(Fquaternion& quaternion) -{ - if(!isActive()) return; - const float* q=dBodyGetQuaternion(m_body); - quaternion.set(-q[0],q[1],q[2],q[3]); - VERIFY(_valid(quaternion)); -} -void CPHElement::setQuaternion(const Fquaternion& quaternion) -{ - VERIFY(_valid(quaternion)); - if(!isActive()) return; - dQuaternion q={-quaternion.w,quaternion.x,quaternion.y,quaternion.z}; - dBodySetQuaternion(m_body,q); - CPHDisablingRotational::Reinit(); - m_flags.set(flUpdate,TRUE); - m_shell->spatial_move(); -} -void CPHElement::GetGlobalPositionDynamic(Fvector* v) -{ - if(!isActive()) return; - v->set((*(Fvector*)dBodyGetPosition(m_body))); - VERIFY(_valid(*v)); -} - -void CPHElement::SetGlobalPositionDynamic(const Fvector& position) -{ - if(!isActive()) return; - VERIFY(_valid(position)); - VERIFY_BOUNDARIES2(position,phBoundaries,PhysicsRefObject(),"SetGlobalPosition argument "); - dBodySetPosition(m_body,position.x,position.y,position.z); - CPHDisablingTranslational::Reinit(); - m_flags.set(flUpdate,TRUE); - m_shell->spatial_move(); -} - -void CPHElement::TransformPosition(const Fmatrix &form) -{ - if(!isActive())return; - VERIFY(_valid(form)); - R_ASSERT2(m_body,"body is not created"); - Fmatrix bm; - PHDynamicData::DMXPStoFMX(dBodyGetRotation(m_body),dBodyGetPosition(m_body),bm); - Fmatrix new_bm; - new_bm.mul(form,bm); - dMatrix3 dBM; - PHDynamicData::FMXtoDMX(new_bm,dBM); - dBodySetRotation(m_body,dBM); - VERIFY_BOUNDARIES2(new_bm.c,phBoundaries,PhysicsRefObject(),"TransformPosition dest pos"); - dBodySetPosition(m_body,new_bm.c.x,new_bm.c.y,new_bm.c.z); - CPHDisablingFull::Reinit(); - m_body_interpolation.ResetPositions(); - m_body_interpolation.ResetRotations(); - m_flags.set(flUpdate,TRUE); - m_shell->spatial_move(); -} -CPHElement::~CPHElement () -{ - VERIFY(!isActive()); - DeleteFracturesHolder(); -} - -void CPHElement:: SetBoneCallback () -{ - IKinematics* K = m_shell->PKinematics(); - VERIFY( K ); - K->LL_GetBoneInstance(m_SelfID).set_callback(bctPhysics,m_shell->GetBonesCallback(), cast_PhysicsElement( this ) ); -} -void CPHElement:: ClearBoneCallback () -{ - IKinematics* K = m_shell->PKinematics(); - K->LL_GetBoneInstance(m_SelfID).reset_callback(); -} - -void CPHElement::Activate(const Fmatrix &transform,const Fvector& lin_vel,const Fvector& ang_vel,bool disable){ - VERIFY(!isActive()); - mXFORM.set(transform); - Start(); - SetTransform(transform); - - dBodySetLinearVel(m_body,lin_vel.x,lin_vel.y,lin_vel.z); - - dBodySetAngularVel(m_body,ang_vel.x,ang_vel.y,ang_vel.z); - VERIFY(dBodyStateValide(m_body)); -// dVectorSet(m_safe_position,dBodyGetPosition(m_body)); -// dQuaternionSet(m_safe_quaternion,dBodyGetQuaternion(m_body)); -// dVectorSet(m_safe_velocity,dBodyGetLinearVel(m_body)); - - m_body_interpolation.SetBody(m_body); - - if(disable) dBodyDisable(m_body); - m_flags.set(flActive,TRUE); - m_flags.set(flActivating,TRUE); - if(m_shell->PKinematics()) - SetBoneCallback(); -} -void CPHElement::Activate(const Fmatrix &m0,float dt01,const Fmatrix &m2,bool disable){ - - Fvector lvel,avel; - lvel.set(m2.c.x-m0.c.x,m2.c.y-m0.c.y,m2.c.z-m0.c.z); - avel.set(0.f,0.f,0.f); - Activate(m0,lvel,avel,disable); - -} - - -void CPHElement::Activate(bool disable, bool /*not_set_bone_callbacks*/ ){ - - Fvector lvel,avel; - lvel.set(0.f,0.f,0.f); - avel.set(0.f,0.f,0.f); - Activate(mXFORM,lvel,avel,disable); - -} - -void CPHElement::Activate(const Fmatrix& start_from,bool disable){ - VERIFY(_valid(start_from)); - Fmatrix globe; - globe.mul_43(start_from,mXFORM); - - Fvector lvel,avel; - lvel.set(0.f,0.f,0.f); - avel.set(0.f,0.f,0.f); - Activate(globe,lvel,avel,disable); - -} - -void CPHElement::Update(){ - if(!isActive()) return; - if(m_flags.test(flActivating)) m_flags.set(flActivating,FALSE); - if( !dBodyIsEnabled(m_body)&&!m_flags.test(flUpdate)/*!bUpdate*/) return; - - InterpolateGlobalTransform(&mXFORM); - VERIFY2(_valid(mXFORM),"invalid position in update"); -} - -void CPHElement::PhTune(dReal step) -{ - if(!isActive()) return; - CPHContactBodyEffector* contact_effector= - (CPHContactBodyEffector*) dBodyGetData(m_body); - if(contact_effector)contact_effector->Apply(); - VERIFY_BOUNDARIES2(cast_fv(dBodyGetPosition(m_body)),phBoundaries,PhysicsRefObject(),"PhTune body position"); -} -void CPHElement::PhDataUpdate(dReal step){ - - if(! isActive())return; - - ///////////////skip for disabled elements//////////////////////////////////////////////////////////// - //b_enabled_onstep=!!dBodyIsEnabled(m_body); - //VERIFY_BOUNDARIES2(cast_fv(dBodyGetPosition(m_body)),phBoundaries,PhysicsRefObject(),"PhDataUpdate begin, body position"); -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawMassCenters)) - { - DBG_DrawPoint(cast_fv(dBodyGetPosition(m_body)),0.03f,D3DCOLOR_XRGB(255,0,0)); - } -#endif - - m_flags.set(flEnabledOnStep,!!dBodyIsEnabled(m_body)); - if(!m_flags.test(flEnabledOnStep)/*!b_enabled_onstep*/) return; - - - - //////////////////////////////////base pointers///////////////////////////////////////////////// - const dReal* linear_velocity = dBodyGetLinearVel(m_body) ; - const dReal* angular_velocity = dBodyGetAngularVel(m_body) ; - - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - ///////////////scale velocity/////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - VERIFY(dV_valid(linear_velocity)); -#ifdef DEBUG - if(!dV_valid(angular_velocity)) - { - Msg("angular vel %f,%f,%f",angular_velocity[0],angular_velocity[1],angular_velocity[2]); - Msg("linear vel %f,%f,%f",linear_velocity[0],linear_velocity[1],linear_velocity[2]); - Msg("position %f,%f,%f",dBodyGetPosition(m_body)[0],dBodyGetPosition(m_body)[1],dBodyGetPosition(m_body)[2]); - Msg("quaternion %f,%f,%f,%f",dBodyGetQuaternion(m_body)[0],dBodyGetQuaternion(m_body)[1],dBodyGetQuaternion(m_body)[2],dBodyGetQuaternion(m_body)[3]); - Msg("matrix"); - Msg("x %f,%f,%f",dBodyGetRotation(m_body)[0],dBodyGetRotation(m_body)[4],dBodyGetRotation(m_body)[8]); - Msg("y %f,%f,%f",dBodyGetRotation(m_body)[1],dBodyGetRotation(m_body)[5],dBodyGetRotation(m_body)[9]); - Msg("z %f,%f,%f",dBodyGetRotation(m_body)[2],dBodyGetRotation(m_body)[6],dBodyGetRotation(m_body)[10]); - CPhysicsShellHolder* ph=PhysicsRefObject(); - Msg("name visual %s",*ph->cNameVisual()); - Msg("name obj %s",ph->Name()); - Msg("name section %s",*ph->cNameSect()); - VERIFY2(0,"bad angular velocity"); - } -#endif - VERIFY(!fis_zero(m_l_scale)); - VERIFY(!fis_zero(m_w_scale)); - dBodySetLinearVel( - m_body, - linear_velocity[0] /m_l_scale , - linear_velocity[1] /m_l_scale , - linear_velocity[2] /m_l_scale - ); - dBodySetAngularVel( - m_body, - angular_velocity[0] /m_w_scale , - angular_velocity[1] /m_w_scale , - angular_velocity[2] /m_w_scale - ); - - - ///////////////////scale changes values directly so get base values after it///////////////////////// - /////////////////////////////base values//////////////////////////////////////////////////////////// - dReal linear_velocity_smag = dDOT(linear_velocity,linear_velocity); - dReal linear_velocity_mag = _sqrt(linear_velocity_smag); - - dReal angular_velocity_smag = dDOT(angular_velocity,angular_velocity); - dReal angular_velocity_mag = _sqrt(angular_velocity_smag); - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////limit velocity & secure ///////////////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - ////////////////limit linear vel//////////////////////////////////////////////////////////////////////////////////////// - - VERIFY(dV_valid(linear_velocity)); - if(linear_velocity_mag>m_l_limit) - { - CutVelocity(m_l_limit,m_w_limit); - VERIFY_BOUNDARIES2(cast_fv(dBodyGetPosition(m_body)),phBoundaries,PhysicsRefObject(),"PhDataUpdate end, body position"); - linear_velocity_smag = dDOT(linear_velocity,linear_velocity); - linear_velocity_mag = _sqrt(linear_velocity_smag); - angular_velocity_smag = dDOT(angular_velocity,angular_velocity); - angular_velocity_mag = _sqrt(angular_velocity_smag); - } - ////////////////secure position/////////////////////////////////////////////////////////////////////////////////// - const dReal* position=dBodyGetPosition(m_body); - VERIFY(dV_valid(position)); - /////////////////limit & secure angular vel/////////////////////////////////////////////////////////////////////////////// - VERIFY(dV_valid(angular_velocity)); - - if(angular_velocity_mag>m_w_limit) - { - CutVelocity(m_l_limit,m_w_limit); - angular_velocity_smag = dDOT(angular_velocity,angular_velocity); - angular_velocity_mag = _sqrt(angular_velocity_smag); - linear_velocity_smag = dDOT(linear_velocity,linear_velocity); - linear_velocity_mag = _sqrt(linear_velocity_smag); - } - - ////////////////secure rotation//////////////////////////////////////////////////////////////////////////////////////// - { - - VERIFY(dQ_valid(dBodyGetQuaternion(m_body))); - - - } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /////////////////disable/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - if(dBodyIsEnabled(m_body)) Disabling(); - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /////////////////position update/////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - VERIFY(dBodyStateValide(m_body)); - VERIFY2(dV_valid(dBodyGetPosition(m_body)),"invalid body position"); - VERIFY2(dV_valid(dBodyGetQuaternion(m_body)),"invalid body rotation"); -/* - if(!valid_pos(cast_fv(dBodyGetPosition(m_body)),phBoundaries)) //hack - { //hack - Fvector pos; //hack - m_body_interpolation.GetPosition(pos,0); //hack - dBodySetPosition(m_body,pos.x,pos.y,pos.z); //hack - } //hack -*/ - VERIFY_BOUNDARIES2(cast_fv(dBodyGetPosition(m_body)),phBoundaries,PhysicsRefObject(),"PhDataUpdate end, body position"); - UpdateInterpolation (); - - if(!dBodyIsEnabled(m_body)) - return; - - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - //////////////////air resistance///////////////////////////////////////////////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - if(!fis_zero(k_w)) - dBodyAddTorque( - m_body, - -angular_velocity[0]*k_w, - -angular_velocity[1]*k_w, - -angular_velocity[2]*k_w - ); - - dMass mass; - dBodyGetMass(m_body,&mass); - dReal l_air=linear_velocity_mag*k_l;//force/velocity !!! - if(l_air>mass.mass/fixed_step) l_air=mass.mass/fixed_step;//validate - - if(!fis_zero(l_air)) - dBodyAddForce( - m_body, - -linear_velocity[0]*l_air, - -linear_velocity[1]*l_air, - -linear_velocity[2]*l_air - ); - -} - -void CPHElement::Enable() { - if(!isActive()) return; - m_shell->EnableObject(0); - if(dBodyIsEnabled(m_body)) return; - dBodyEnable(m_body); -} - -void CPHElement::Disable() { - -// return; - if(!isActive()||!dBodyIsEnabled(m_body)) return; - FillInterpolation(); - - dBodyDisable(m_body); -} - -void CPHElement::ReEnable(){ - - //dJointGroupEmpty(m_saved_contacts); - //b_contacts_saved=false; - -} - -void CPHElement::Freeze() -{ - if(!m_body) return; - - m_flags.set(flWasEnabledBeforeFreeze,!!dBodyIsEnabled(m_body)); - dBodyDisable(m_body); -} -void CPHElement::UnFreeze() -{ - if(!m_body) return; - if(m_flags.test(flWasEnabledBeforeFreeze)/*was_enabled_before_freeze*/)dBodyEnable(m_body); -} - -bool dbg_draw_ph_force_apply = false; - -void CPHElement::applyImpulseVsMC(const Fvector& pos,const Fvector& dir, float val) -{ - if(!isActive()||m_flags.test(flFixed)) return; - if( !dBodyIsEnabled(m_body)) dBodyEnable(m_body); - ///////////////////////////////////////////////////////////////////////// - Fvector impulse; - val/=fixed_step; - impulse.set(dir); - impulse.mul(val); -#ifdef DEBUG - if( dbg_draw_ph_force_apply ) - { - Fvector draw_pos; draw_pos.add( cast_fv( dBodyGetPosition( m_body ) ), pos ); - DBG_OpenCashedDraw(); - DBG_DrawLine( draw_pos, Fvector().add( draw_pos, dir ), D3DCOLOR_XRGB(255,0,0) ); - DBG_ClosedCashedDraw( 50000 ); - } -#endif - dBodyAddForceAtRelPos(m_body, impulse.x,impulse.y,impulse.z,pos.x, pos.y,pos.z); - BodyCutForce(m_body,m_l_limit,m_w_limit); - //////////////////////////////////////////////////////////////////////// -} -void CPHElement::applyImpulseVsGF(const Fvector& pos,const Fvector& dir, float val) -{ - VERIFY(_valid(pos)&&_valid(dir)&&_valid(val)); - if(!isActive()||m_flags.test(flFixed)) return; - if( !dBodyIsEnabled(m_body)) dBodyEnable(m_body); - ///////////////////////////////////////////////////////////////////////// -#ifdef DEBUG - if( dbg_draw_ph_force_apply ) - { - DBG_OpenCashedDraw(); - DBG_DrawLine( pos, Fvector().add( pos, dir ), D3DCOLOR_XRGB(255,05,0) ); - DBG_ClosedCashedDraw( 50000 ); - } -#endif - ///////////////////////////////////////////////////////////////////////// - Fvector impulse; - val/=fixed_step; - impulse.set(dir); - impulse.mul(val); - dBodyAddForceAtPos(m_body, impulse.x,impulse.y,impulse.z,pos.x, pos.y,pos.z); - BodyCutForce(m_body,m_l_limit,m_w_limit); - VERIFY(dBodyStateValide(m_body)); - //////////////////////////////////////////////////////////////////////// -} -void CPHElement:: applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val,u16 id) -{ - - VERIFY(_valid(pos)&&_valid(dir)&&_valid(val)); - if(!isActive()||m_flags.test(flFixed)) return; - Fvector body_pos; - if(id!=BI_NONE) - { - if(id==m_SelfID) - { - body_pos.sub(pos,m_mass_center); - } - else - { - IKinematics* K=m_shell->PKinematics(); - if(K) - { - Fmatrix(). - mul_43( Fmatrix().invert( K->LL_GetTransform( m_SelfID ) ), - K->LL_GetTransform( id ) ) - .transform(body_pos,pos); - body_pos.sub(m_mass_center); - } - else - { - body_pos.set(0.f,0.f,0.f); - } - } - } - else - { - body_pos.set(0.f,0.f,0.f); - } -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phHitApplicationPoints)) - { - DBG_OpenCashedDraw(); - Fvector dbg_position;dbg_position.set(body_pos); - dMULTIPLY0_331 (cast_fp(dbg_position),dBodyGetRotation(m_body),cast_fp(body_pos)); - dbg_position.add(cast_fv(dBodyGetPosition(m_body))); - DBG_DrawPoint(dbg_position,0.01f,D3DCOLOR_XRGB(255,255,255)); - DBG_DrawLine(cast_fv(dBodyGetPosition(m_body)),dbg_position,D3DCOLOR_XRGB(255,255,255)); - DBG_DrawLine(dbg_position,Fvector().add(dbg_position,Fvector().mul(dir,0.4f)),D3DCOLOR_XRGB(255,0,255)); - DBG_ClosedCashedDraw(10000); - } -#endif - applyImpulseVsMC(body_pos,dir,val); - if(m_fratures_holder) - { - ///impulse.add(*((Fvector*)dBodyGetPosition(m_body))); - Fvector impulse;impulse.set(dir);impulse.mul(val/fixed_step); - m_fratures_holder->AddImpact(impulse,body_pos,m_shell->BoneIdToRootGeom(id)); - } -} -void CPHElement::applyImpact(const SPHImpact& I) -{ - Fvector pos; - pos.add(I.point,m_mass_center); - Fvector dir; - dir.set(I.force); - float val=I.force.magnitude(); - - if(!fis_zero(val)&& GeomByBoneID(I.geom)) - { - - dir.mul(1.f/val); - applyImpulseTrace(pos,dir,val,I.geom); - } - -} -void CPHElement::InterpolateGlobalTransform(Fmatrix* m){ - if(!m_flags.test(flUpdate)) - { - GetGlobalTransformDynamic(m); - VERIFY(_valid(*m)); - return; - } - m_body_interpolation.InterpolateRotation(*m); - m_body_interpolation.InterpolatePosition(m->c); - MulB43InverceLocalForm(*m); - m_flags.set(flUpdate,FALSE); - VERIFY(_valid(*m)); -} -void CPHElement::GetGlobalTransformDynamic(Fmatrix* m) const -{ - PHDynamicData::DMXPStoFMX(dBodyGetRotation(m_body),dBodyGetPosition(m_body),*m); - MulB43InverceLocalForm(*m); - VERIFY(_valid(*m)); -} - -void CPHElement::InterpolateGlobalPosition(Fvector* v){ - m_body_interpolation.InterpolatePosition(*v); - VERIFY(_valid(*v)); -} - - - - -void CPHElement::build(bool disable){ - - if(isActive()) return; - //bActive=true; - //bActivating=true; - m_flags.set(flActive,TRUE); - m_flags.set(flActivating,TRUE); - build(); - // if(place_current_forms) - { - - SetTransform(mXFORM); - } - - m_body_interpolation.SetBody(m_body); - //previous_f[0]=dInfinity; - if(disable) dBodyDisable(m_body); - - -} - -void CPHElement::RunSimulation(const Fmatrix& start_from) -{ - - RunSimulation(); - // if(place_current_forms) - { - Fmatrix globe; - globe.mul(start_from,mXFORM); - SetTransform(globe); - } - //dVectorSet(m_safe_position,dBodyGetPosition(m_body)); - //dQuaternionSet(m_safe_quaternion,dBodyGetQuaternion(m_body)); - //dVectorSet(m_safe_velocity,dBodyGetLinearVel(m_body)); - -} - - - -void CPHElement::StataticRootBonesCallBack(CBoneInstance* B) -{ - VERIFY( false ); - Fmatrix parent; - VERIFY2( isActive(),"the element is not active"); - VERIFY(_valid(m_shell->mXFORM)); - //VERIFY2(fsimilar(DET(B->mTransform),1.f,DET_CHECK_EPS),"Bones callback resive 0 matrix"); - VERIFY_RMATRIX(B->mTransform); - VERIFY(valid_pos(B->mTransform.c,phBoundaries)); - if(m_flags.test(flActivating)) - { - //if(!dBodyIsEnabled(m_body)) - // dBodyEnable(m_body); - VERIFY(!ph_world->Processing()); - VERIFY(_valid(B->mTransform)); - VERIFY(!m_shell->dSpace()->lock_count); - mXFORM.set(B->mTransform); - //m_start_time=Device.fTimeGlobal; - Fmatrix global_transform; - //if(m_parent_element) - global_transform.mul_43(m_shell->mXFORM,mXFORM); - SetTransform(global_transform); - - FillInterpolation(); - //bActivating=false; - m_flags.set(flActivating,FALSE); - if(!m_parent_element) - { - m_shell->m_object_in_root.set(mXFORM); - m_shell->m_object_in_root.invert(); - m_shell->SetNotActivating(); - } - B->set_callback_overwrite(TRUE); - //VERIFY2(fsimilar(DET(B->mTransform),1.f,DET_CHECK_EPS),"Bones callback returns 0 matrix"); - VERIFY_RMATRIX(B->mTransform); - VERIFY(valid_pos(B->mTransform.c,phBoundaries)); - //return; - } - - - - //VERIFY2(fsimilar(DET(B->mTransform),1.f,DET_CHECK_EPS),"Bones callback returns 0 matrix"); - VERIFY_RMATRIX(B->mTransform); - VERIFY(valid_pos(B->mTransform.c,phBoundaries)); - //if( !m_shell->is_active() && !m_flags.test(flUpdate)/*!bUpdate*/ ) return; - - { - //InterpolateGlobalTransform(&mXFORM); - parent.invert (m_shell->mXFORM); - B->mTransform.mul_43 (parent,mXFORM); - } - //VERIFY2(fsimilar(DET(B->mTransform),1.f,DET_CHECK_EPS),"Bones callback returns 0 matrix"); - VERIFY_RMATRIX(B->mTransform); - VERIFY(valid_pos(B->mTransform.c,phBoundaries)); - VERIFY2(_valid(B->mTransform),"Bones callback returns bad matrix"); - //else - //{ - - // InterpolateGlobalTransform(&m_shell->mXFORM); - // mXFORM.identity(); - // B->mTransform.set(mXFORM); - //parent.set(B->mTransform); - //parent.invert(); - //m_shell->mXFORM.mulB(parent); - - //} - - -} - -void CPHElement::BoneGlPos(Fmatrix &m, const CBoneInstance* B) const -{ - VERIFY(m_shell); - m.mul_43(m_shell->mXFORM, B->mTransform); -} - -void CPHElement::GetAnimBonePos(Fmatrix &bp) -{ - VERIFY(m_shell->PKinematics()); - IKinematics *pK = m_shell->PKinematics(); - //IKinematicsAnimated *ak = pK->dcast_PKinematicsAnimated(); - //VERIFY(ak); - CBoneInstance *BI = &pK->LL_GetBoneInstance(m_SelfID); - if(!BI->callback())//. - { - bp.set(BI->mTransform); - return; - } - - pK->Bone_GetAnimPos( bp, m_SelfID, u8(-1), true ); - -} - -IC bool put_in_range( Fvector &v, float range ) -{ - VERIFY( range > EPS_S ); - float sq_mag=v.square_magnitude( ); - if( sq_mag > range*range ) - { - float mag=_sqrt( sq_mag ); - v.mul( range/mag ); - return true; - } - return false; -} - - - -bool CPHElement::AnimToVel( float dt, float l_limit, float a_limit ) -{ - VERIFY(m_shell); - VERIFY(m_shell->PKinematics()); - //CBoneInstance *BI = &m_shell->PKinematics()->LL_GetBoneInstance(m_SelfID); -// -// Fmatrix bp;BoneGlPos(bp,BI); -// - CPhysicsShellHolder *ph = PhysicsRefObject(); - VERIFY(ph); - Fmatrix bpl;GetAnimBonePos(bpl); - Fmatrix bp;bp.mul_43(ph->XFORM(),bpl); - //BoneGlPos(bp,BI); - - Fmatrix cp; - GetGlobalTransformDynamic(&cp); - - //Fquaternion q0; q0.set(cp); - - cp.invert(); - Fmatrix diff;diff.mul_43(cp,bp); - if(dtProcessing(), *PhysicsRefObject()->cNameSect() ); - VERIFY( _valid( B->mTransform ) ); - VERIFY( !m_shell->dSpace()->lock_count ); - - //mXFORM.set( B->mTransform ); - - //Fmatrix global_transform; - BoneGlPos( mXFORM, B ); - SetTransform( mXFORM ); - FillInterpolation( ); -} - -void CPHElement::SetBoneCallbackOverwrite( bool v ) -{ - VERIFY(m_shell); - VERIFY(m_shell->PKinematics()); - m_shell->PKinematics()->LL_GetBoneInstance(m_SelfID).set_callback_overwrite (v); -} - -void CPHElement::BonesCallBack( CBoneInstance* B ) -{ - Fmatrix parent; - VERIFY ( isActive() ); - VERIFY( _valid( m_shell->mXFORM ) ); - //VERIFY2(fsimilar(DET(B->mTransform),1.f,DET_CHECK_EPS),"Bones callback receive 0 matrix"); - VERIFY_RMATRIX( B->mTransform ); - VERIFY_BOUNDARIES2( B->mTransform.c, phBoundaries, PhysicsRefObject(), "BonesCallBack incoming bone position" ); - - if( m_flags.test( flActivating ) ) - { - ToBonePos( B ); - m_flags.set( flActivating, FALSE ); - if( !m_parent_element ) - { - m_shell->m_object_in_root.set( B->mTransform ); - m_shell->m_object_in_root.invert( ); - m_shell->SetNotActivating( ); - } - B->set_callback_overwrite( TRUE ); - //VERIFY2(fsimilar(DET(B->mTransform),1.f,DET_CHECK_EPS),"Bones callback returns 0 matrix"); - VERIFY_RMATRIX( B->mTransform ); - VERIFY( valid_pos( B->mTransform.c, phBoundaries ) ); - return; - } - - VERIFY_RMATRIX( B->mTransform ); - VERIFY( valid_pos( B->mTransform.c, phBoundaries ) ); - - parent.invert ( m_shell->mXFORM ); - B->mTransform.mul_43( parent, mXFORM ); - - VERIFY_RMATRIX( B->mTransform ); - VERIFY( valid_pos( B->mTransform.c, phBoundaries ) ); - VERIFY2( _valid( B->mTransform ), "Bones callback returns bad matrix" ); - -} - -void CPHElement::set_PhysicsRefObject(CPhysicsShellHolder* ref_object) -{ - CPHGeometryOwner::set_PhysicsRefObject(ref_object); -} - - -void CPHElement::set_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - CPHGeometryOwner::set_ObjectContactCallback(callback); -} -void CPHElement::add_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - CPHGeometryOwner::add_ObjectContactCallback(callback); -} -void CPHElement::remove_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - CPHGeometryOwner::remove_ObjectContactCallback(callback); -} -ObjectContactCallbackFun* CPHElement::get_ObjectContactCallback() -{ - return CPHGeometryOwner::get_ObjectContactCallback(); -} -void CPHElement::set_CallbackData(void * cd) -{ - CPHGeometryOwner::set_CallbackData(cd); -} -void* CPHElement:: get_CallbackData () -{ - return CPHGeometryOwner::get_CallbackData(); -} -void CPHElement::set_ContactCallback(ContactCallbackFun* callback) -{ - //push_untill=0; - CPHGeometryOwner::set_ContactCallback(callback); -} - -void CPHElement::SetMaterial(u16 m) -{ - CPHGeometryOwner::SetMaterial(m); -} - -dMass* CPHElement::getMassTensor() //aux -{ - return &m_mass; -} - -void CPHElement::setInertia(const dMass& M) -{ - m_mass=M; - if(!isActive()||m_flags.test(flFixed))return; - dBodySetMass(m_body,&M); -} - -void CPHElement::addInertia(const dMass& M) -{ - dMassAdd(&m_mass,&M); - if(!isActive())return; - dBodySetMass(m_body,&m_mass); -} -void CPHElement::get_LinearVel(Fvector& velocity) const -{ - if( !isActive()|| - ( !m_flags.test( flAnimated ) && !dBodyIsEnabled( m_body ) ) - ) - { - velocity.set(0,0,0); - return; - } - dVectorSet((dReal*)&velocity,dBodyGetLinearVel(m_body)); - -} -void CPHElement::get_AngularVel (Fvector& velocity) const -{ - if( !isActive()|| - ( !m_flags.test( flAnimated ) && !dBodyIsEnabled( m_body ) ) - ) - { - velocity.set(0,0,0); - return; - } - dVectorSet((dReal*)&velocity,dBodyGetAngularVel(m_body)); -} - - -void CPHElement::set_LinearVel (const Fvector& velocity) -{ - - if(!isActive()||m_flags.test(flFixed)) return; - VERIFY2(_valid(velocity),"not valid arqument velocity"); - Fvector vel = velocity; -#ifdef DEBUG - if( velocity.magnitude() > m_l_limit ) - Msg(" CPHElement::set_LinearVel set velocity magnitude is too large %f",velocity.magnitude()); -#endif - put_in_range(vel,m_l_limit); - dBodySetLinearVel(m_body,vel.x,vel.y,vel.z); - //dVectorSet(m_safe_velocity,dBodyGetLinearVel(m_body)); -} - - -void CPHElement::set_AngularVel (const Fvector& velocity) -{ - VERIFY(_valid(velocity)); - if(!isActive()||m_flags.test(flFixed)) return; - - Fvector vel = velocity; -#ifdef DEBUG - if( velocity.magnitude() > m_w_limit ) - Msg("CPHElement::set_AngularVel set velocity magnitude is too large %f",velocity.magnitude()); -#endif - put_in_range(vel,m_w_limit); - dBodySetAngularVel(m_body,vel.x,vel.y,vel.z); -} - -void CPHElement::getForce(Fvector& force) -{ - if(!isActive()) return; - force.set(*(Fvector*)dBodyGetForce(m_body)); - VERIFY(dBodyStateValide(m_body)); -} -void CPHElement::getTorque(Fvector& torque) -{ - if(!isActive()) return; - torque.set(*(Fvector*)dBodyGetTorque(m_body)); - VERIFY(dBodyStateValide(m_body)); -} -void CPHElement::setForce(const Fvector& force) -{ - if(!isActive()||m_flags.test(flFixed)) return; - if( !dBodyIsEnabled(m_body)) dBodyEnable(m_body); - m_shell->EnableObject(0); - dBodySetForce(m_body,force.x,force.y,force.z); - BodyCutForce(m_body,m_l_limit,m_w_limit); - VERIFY(dBodyStateValide(m_body)); -} -void CPHElement::setTorque(const Fvector& torque) -{ - if(!isActive()||m_flags.test(flFixed)) return; - if( !dBodyIsEnabled(m_body)) dBodyEnable(m_body); - m_shell->EnableObject(0); - dBodySetTorque(m_body,torque.x,torque.y,torque.z); - BodyCutForce(m_body,m_l_limit,m_w_limit); - VERIFY(dBodyStateValide(m_body)); -} - -void CPHElement::applyForce(const Fvector& dir, float val) //aux -{ - applyForce (dir.x*val,dir.y*val,dir.z*val); -} -void CPHElement::applyForce(float x,float y,float z) //called anywhere ph state influent -{ - VERIFY(_valid(x)&&_valid(y)&&_valid(z)); - if(!isActive())return;//hack?? - if(m_flags.test(flFixed)) return; - if( !dBodyIsEnabled(m_body)) dBodyEnable(m_body); - m_shell->EnableObject(0); - dBodyAddForce(m_body,x,y,z); - BodyCutForce(m_body,m_l_limit,m_w_limit); - VERIFY(dBodyStateValide(m_body)); -} - -void CPHElement::applyImpulse(const Fvector& dir, float val)//aux -{ - - applyForce(dir.x*val/fixed_step,dir.y*val/fixed_step,dir.z*val/fixed_step); -} - - - -void CPHElement::add_Shape(const SBoneShape& shape,const Fmatrix& offset) -{ - CPHGeometryOwner::add_Shape(shape,offset); -} - -void CPHElement::add_Shape(const SBoneShape& shape) -{ - CPHGeometryOwner::add_Shape(shape); -} - - - -void CPHElement:: add_geom ( CODEGeom* g ) -{ - Fmatrix gf; - g->get_xform( gf ); - - Fmatrix bf; - PHDynamicData::DMXPStoFMX( dBodyGetRotation( m_body ), dBodyGetPosition( m_body ), bf ); - - Fmatrix diff = Fmatrix().mul_43( Fmatrix().invert( bf ), gf ) ; - - dMatrix3 m; - PHDynamicData::FMXtoDMX( diff, m ); - - VERIFY(g->geom()); - dGeomSetPosition( g->geom(), diff.c.x, diff.c.y, diff.c.z ); - dGeomSetRotation( g->geom(), m ); - - g->set_body( m_body ); - CPHGeometryOwner::add_geom( g ); - -} - -void CPHElement:: remove_geom ( CODEGeom* g ) -{ - g->set_body( 0 ); - CPHGeometryOwner::remove_geom(g); -} - - - -#pragma todo(remake it using Geometry functions) - -void CPHElement::add_Mass(const SBoneShape& shape,const Fmatrix& offset,const Fvector& mass_center,float mass,CPHFracture* fracture) -{ - - dMass m; - dMatrix3 DMatx; - switch(shape.type) - { - case SBoneShape::stBox : - { - dMassSetBox(&m,1.f,shape.box.m_halfsize.x*2.f,shape.box.m_halfsize.y*2.f,shape.box.m_halfsize.z*2.f); - dMassAdjust(&m,mass); - Fmatrix box_transform; - shape.box.xform_get(box_transform); - PHDynamicData::FMX33toDMX(shape.box.m_rotate,DMatx); - dMassRotate(&m,DMatx); - dMassTranslate(&m,shape.box.m_translate.x-mass_center.x,shape.box.m_translate.y-mass_center.y,shape.box.m_translate.z-mass_center.z); - break; - } - case SBoneShape::stSphere : - { - shape.sphere; - dMassSetSphere(&m,1.f,shape.sphere.R); - dMassAdjust(&m,mass); - dMassTranslate(&m,shape.sphere.P.x-mass_center.x,shape.sphere.P.y-mass_center.y,shape.sphere.P.z-mass_center.z); - break; - } - - - case SBoneShape::stCylinder : - { - const Fvector& pos=shape.cylinder.m_center; - Fvector l; - l.sub(pos,mass_center); - dMassSetCylinder(&m,1.f,2,shape.cylinder.m_radius,shape.cylinder.m_height); - dMassAdjust(&m,mass); - dMatrix3 DMatx; - Fmatrix33 m33; - m33.j.set(shape.cylinder.m_direction); - Fvector::generate_orthonormal_basis(m33.j,m33.k,m33.i); - PHDynamicData::FMX33toDMX(m33,DMatx); - dMassRotate(&m,DMatx); - dMassTranslate(&m,l.x,l.y,l.z); - break; - } - - case SBoneShape::stNone : - break; - default: NODEFAULT; - } - PHDynamicData::FMXtoDMX(offset,DMatx); - dMassRotate(&m,DMatx); - - Fvector mc; - offset.transform_tiny(mc,mass_center); - //calculate _new mass_center - //new_mc=(m_mass_center*m_mass.mass+mc*mass)/(mass+m_mass.mass) - Fvector tmp1; - tmp1.set(m_mass_center); - tmp1.mul(m_mass.mass); - Fvector tmp2; - tmp2.set(mc); - tmp2.mul(mass); - Fvector new_mc; - new_mc.add(tmp1,tmp2); - new_mc.mul(1.f/(mass+m_mass.mass)); - mc.sub(new_mc); - dMassTranslate(&m,mc.x,mc.y,mc.z); - m_mass_center.sub(new_mc); - dMassTranslate(&m_mass,m_mass_center.x,m_mass_center.y,m_mass_center.z); - if(m_fratures_holder) - { - m_fratures_holder->DistributeAdditionalMass(u16(m_geoms.size()-1),m); - } - if(fracture) - { - fracture->MassAddToSecond(m); - } - R_ASSERT2(dMass_valide(&m),"bad bone mass params"); - dMassAdd(&m_mass,&m); - R_ASSERT2(dMass_valide(&m),"bad result mass params"); - m_mass_center.set(new_mc); -} - -void CPHElement::set_BoxMass(const Fobb& box, float mass) -{ - dMassSetZero(&m_mass); - m_mass_center.set(box.m_translate); - const Fvector& hside=box.m_halfsize; - dMassSetBox(&m_mass,1,hside.x*2.f,hside.y*2.f,hside.z*2.f); - dMassAdjust(&m_mass,mass); - dMatrix3 DMatx; - PHDynamicData::FMX33toDMX(box.m_rotate,DMatx); - dMassRotate(&m_mass,DMatx); - -} - -void CPHElement::calculate_it_data_use_density(const Fvector& mc,float density) -{ - dMassSetZero(&m_mass); - GEOM_I i_geom=m_geoms.begin(),e=m_geoms.end(); - for(;i_geom!=e;++i_geom)(*i_geom)->add_self_mass(m_mass,mc,density); - VERIFY2(dMass_valide(&m_mass),"non valide mass obtained!"); -} - -float CPHElement::getRadius() -{ - return CPHGeometryOwner::getRadius(); -} - -void CPHElement::set_DynamicLimits(float l_limit,float w_limit) -{ - m_l_limit=l_limit; - m_w_limit=w_limit; -} - -void CPHElement::set_DynamicScales(float l_scale/* =default_l_scale */,float w_scale/* =default_w_scale */) -{ - m_l_scale=l_scale; - m_w_scale=w_scale; -} - -void CPHElement::set_DisableParams (const SAllDDOParams& params) -{ - CPHDisablingFull::set_DisableParams(params); -} - - - - -void CPHElement::get_Extensions(const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext) const -{ - CPHGeometryOwner::get_Extensions(axis,center_prg,lo_ext,hi_ext); -} - -const Fvector& CPHElement::mass_Center()const -{ - VERIFY(dBodyStateValide(m_body)); - return *((const Fvector*)dBodyGetPosition(m_body)); -} - -CPhysicsShell* CPHElement::PhysicsShell() -{ - return smart_cast(m_shell); -} - -CPHShell* CPHElement::PHShell() -{ - return (m_shell); -} -void CPHElement::SetShell(CPHShell* p) -{ - if(!m_body||!m_shell) - { - m_shell=p; - return; - } - if(m_shell!=p) - { - m_shell->Island().RemoveBody(m_body); - p->Island().AddBody(m_body); - m_shell=p; - } - -} -void CPHElement::PassEndGeoms(u16 from,u16 to,CPHElement* dest) -{ - GEOM_I i_from=m_geoms.begin()+from,e=m_geoms.begin()+to; - u16 shift=to-from; - GEOM_I i=i_from; - for(;i!=e;++i) - { - //(*i)->remove_from_space( group_space() ); - group_remove( *(*i) ); - //(*i)->add_to_space(dest->m_group); - //(*i)->set_body(dest->m_body); - (*i)->set_body(0); - u16& element_pos=(*i)->element_position(); - element_pos=element_pos-shift; - } - GEOM_I last=m_geoms.end(); - for(;i!=last;++i) - { - u16& element_pos=(*i)->element_position(); - element_pos=element_pos-shift; - } - - dest->m_geoms.insert(dest->m_geoms.end(),i_from,e); - dest->b_builded=true; - m_geoms.erase(i_from,e); -} -void CPHElement::SplitProcess(ELEMENT_PAIR_VECTOR &new_elements) -{ - m_fratures_holder->SplitProcess(this,new_elements); - if(!m_fratures_holder->m_fractures.size()) xr_delete(m_fratures_holder); -} -void CPHElement::DeleteFracturesHolder() -{ - xr_delete(m_fratures_holder); -} - -void CPHElement::CreateSimulBase() -{ - m_body=dBodyCreate(0); - m_shell->Island().AddBody(m_body); - //m_saved_contacts=dJointGroupCreate (0); - //b_contacts_saved=false; - dBodyDisable(m_body); - //CPHGeometryOwner::CreateGroupSpace( ); -} -void CPHElement::ReAdjustMassPositions(const Fmatrix &shift_pivot,float density) -{ - - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) - { - (*i)->move_local_basis(shift_pivot); - } - if(m_shell->PKinematics()) - { - float mass; - get_mc_kinematics(m_shell->PKinematics(),m_mass_center,mass); - calculate_it_data(m_mass_center,mass); - } - else - { - - setDensity(density); - } - - dBodySetMass(m_body,&m_mass); - //m_inverse_local_transform.identity(); - //m_inverse_local_transform.c.set(m_mass_center); - //m_inverse_local_transform.invert(); - //dBodySetPosition(m_body,m_mass_center.x,m_mass_center.y,m_mass_center.z); -} -void CPHElement::ResetMass(float density) -{ - Fvector tmp,shift_mc; - - tmp.set(m_mass_center); - - - setDensity(density); - dBodySetMass(m_body,&m_mass); - - shift_mc.sub(m_mass_center,tmp); - tmp.set(*(Fvector *)dBodyGetPosition(m_body)); - tmp.add(shift_mc); - - - //bActivating = true; - m_flags.set(flActivating,TRUE); - - CPHGeometryOwner::setPosition(m_mass_center); -} -void CPHElement::ReInitDynamics(const Fmatrix &shift_pivot,float density) -{ - VERIFY(_valid(shift_pivot)&&_valid(density)); - ReAdjustMassPositions(shift_pivot,density); - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) - { - (*i)->set_build_position(m_mass_center); - (*i)->set_body(m_body); - //if(object_contact_callback)geom.set_obj_contact_cb(object_contact_callback); - //if(m_phys_ref_object) geom.set_ref_object(m_phys_ref_object); -/* - if(m_group) - { - (*i)->add_to_space((dSpaceID)m_group); - } -*/ - group_add(*(*i)); - } -} - -void CPHElement::PresetActive() -{ - if(isActive()) return; - - CBoneInstance& B=m_shell->PKinematics()->LL_GetBoneInstance(m_SelfID); - mXFORM.set(B.mTransform); - //m_start_time=Device.fTimeGlobal; - Fmatrix global_transform; - global_transform.mul_43(m_shell->mXFORM, mXFORM); - SetTransform(global_transform); - - if(!m_parent_element) - { - m_shell->m_object_in_root.set(mXFORM); - m_shell->m_object_in_root.invert(); - - } - //dVectorSet(m_safe_position,dBodyGetPosition(m_body)); - //dQuaternionSet(m_safe_quaternion,dBodyGetQuaternion(m_body)); - //dVectorSet(m_safe_velocity,dBodyGetLinearVel(m_body)); - - ////////////////////////////////////////////////////////////// - //initializing values for disabling////////////////////////// - ////////////////////////////////////////////////////////////// - VERIFY(dBodyStateValide(m_body)); - m_body_interpolation.SetBody(m_body); - FillInterpolation(); - //bActive=true; - m_flags.set(flActive,TRUE); - RunSimulation(); - VERIFY(dBodyStateValide(m_body)); -} - - -bool CPHElement::isBreakable() -{ - return !!m_fratures_holder; -} -u16 CPHElement::setGeomFracturable(CPHFracture& fracture) -{ - if(!m_fratures_holder) m_fratures_holder=xr_new(); - return m_fratures_holder->AddFracture(fracture); -} - -CPHFracture& CPHElement::Fracture(u16 num) -{ - R_ASSERT2(m_fratures_holder,"no fractures!"); - return m_fratures_holder->Fracture(num); -} -u16 CPHElement::numberOfGeoms()const -{ - return CPHGeometryOwner::numberOfGeoms(); -} - - -void CPHElement::cv2bone_Xfrom(const Fquaternion& q,const Fvector& pos, Fmatrix& xform) -{ - VERIFY2(_valid(q)&&_valid(pos),"cv2bone_Xfrom receive wrong data"); - xform.rotation(q); - xform.c.set(pos); - //xform.mulB(m_inverse_local_transform); - MulB43InverceLocalForm(xform); - VERIFY2(_valid(xform),"cv2bone_Xfrom returns wrong data"); -} -void CPHElement::cv2obj_Xfrom(const Fquaternion& q,const Fvector& pos, Fmatrix& xform) -{ - - cv2bone_Xfrom(q,pos,xform); - xform.mulB_43(m_shell->m_object_in_root); - VERIFY2(_valid(xform),"cv2obj_Xfrom returns wrong data"); -} - -void CPHElement::set_ApplyByGravity(bool flag) -{ - if(!isActive()||m_flags.test(flFixed)) return; - dBodySetGravityMode(m_body,flag); -} -bool CPHElement::get_ApplyByGravity() -{ - return (!!dBodyGetGravityMode(m_body)); -} - -void CPHElement::Fix() -{ - m_flags.set(flFixed,TRUE); - FixBody(m_body); -} - -void CPHElement::SetAnimated( bool v ) -{ - m_flags.set( flAnimated, BOOL( v ) ); -} - -void CPHElement::ReleaseFixed() -{ - if(!isFixed()) return; - m_flags.set(flFixed,FALSE); - if(!isActive())return; - dBodySetMass(m_body,&m_mass); -} -void CPHElement::applyGravityAccel (const Fvector& accel) -{ - VERIFY(_valid(accel)); - if(m_flags.test(flFixed)) return; - if( !dBodyIsEnabled(m_body)) dBodyEnable(m_body); - m_shell->EnableObject(0); - Fvector val; - val.set(accel); - val.mul(m_mass.mass); - //ApplyGravityAccel(m_body,(const dReal*)(&accel)); - applyForce(val.x,val.y,val.z); -} - - -void CPHElement::CutVelocity(float l_limit,float a_limit) -{ - - if(!isActive())return; - VERIFY(_valid(l_limit)&&_valid(a_limit)); - dVector3 limitedl,limiteda,diffl,diffa; - bool blimitl=dVectorLimit(dBodyGetLinearVel(m_body),l_limit,limitedl); - bool blimita=dVectorLimit(dBodyGetAngularVel(m_body),a_limit,limiteda); - - if(blimitl||blimita) - { - dVectorSub(diffl,limitedl,dBodyGetLinearVel(m_body)); - dVectorSub(diffa,limiteda,dBodyGetAngularVel(m_body)); - dBodySetLinearVel(m_body,diffl[0],diffl[1],diffl[2]); - dBodySetAngularVel(m_body,diffa[0],diffa[1],diffa[2]); - dxStepBody(m_body,fixed_step); - dBodySetLinearVel(m_body,limitedl[0],limitedl[1],limitedl[2]); - dBodySetAngularVel(m_body,limiteda[0],limiteda[1],limiteda[2]); - } -} -void CPHElement::ClearDestroyInfo() -{ - xr_delete(m_fratures_holder); -} - -#ifdef DEBUG - -void CPHElement::dbg_draw_velocity ( float scale, u32 color ) -{ - VERIFY( isActive() ); - VERIFY( m_shell ); - VERIFY( m_shell->PKinematics() ); - Fmatrix bone; - GetGlobalTransformDynamic( &bone ); - VERIFY( m_body ); - dVector3 res; - dBodyGetPointVel( m_body, bone.c.x, bone.c.y, bone.c.z, res ); - DBG_DrawPoint( bone.c, 0.01f, color ); - DBG_DrawLine( bone.c, Fvector().add( bone.c, cast_fv( res ).mul( scale ) ) , color ); - //m_shell->PKinematics()->LL_GetTransform() -} - -static void dBodyGetPointForce (dBodyID b, dReal px, dReal py, dReal pz, - dVector3 result) -{ - VERIFY (b); - dVector3 p; - p[0] = px - b->pos[0]; - p[1] = py - b->pos[1]; - p[2] = pz - b->pos[2]; - p[3] = 0; - result[0] = b->facc[0]; - result[1] = b->facc[1]; - result[2] = b->facc[2]; - dCROSS (result,+=,b->tacc,p); -} - -void CPHElement::dbg_draw_force ( float scale, u32 color ) -{ - VERIFY( isActive() ); - VERIFY( m_shell ); - VERIFY( m_shell->PKinematics() ); - Fmatrix bone; - GetGlobalTransformDynamic( &bone ); - VERIFY( m_body ); - dVector3 res; - dBodyGetPointForce( m_body, bone.c.x, bone.c.y, bone.c.z, res ); - DBG_DrawPoint( bone.c, 0.01f, color ); - DBG_DrawLine( bone.c, Fvector().add( bone.c, cast_fv( res ).mul( scale ) ) , color ); -} - -void CPHElement:: dbg_draw_geometry( float scale, u32 color, Flags32 flags /*= Flags32().assign( 0 )*/ ) const -{ - CPHGeometryOwner::dbg_draw( scale, color, flags ); -} -#endif -//bool CPHElement::CheckBreakConsistent() -//{ -// if(!m_fratures_holder) return true; -// m_fratures_holder->m_fractures -// m_fratures_holder->Fracture() -//}) return true; -// m_fratures_holder->m_fractures -// m_fratures_holder->Fracture() -//} \ No newline at end of file diff --git a/src/xrGame/PHElement.h b/src/xrGame/PHElement.h deleted file mode 100644 index 538cd4dee6c..00000000000 --- a/src/xrGame/PHElement.h +++ /dev/null @@ -1,279 +0,0 @@ -///////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -///////////////////////////Implemetation//for//CPhysicsElement////////////////// -//////////////////////////////////////////////////////////////////////////////// -#include "Geometry.h" -#include "phdefs.h" -#include "PhysicsCommon.h" -#include "PHSynchronize.h" -#include "PHDisabling.h" -#include "PHGeometryOwner.h" -#include "PHInterpolation.h" -#include "PHFracture.h" - -#ifndef PH_ELEMENT -#define PH_ELEMENT -class CPHElement; -class CPHShell; - - -struct SPHImpact; -class CPHFracturesHolder; - -class CPHElement : - public CPhysicsElement , - public CPHSynchronize, - public CPHDisablingFull, - public CPHGeometryOwner -{ - friend class CPHFracturesHolder; - - //float m_start_time; //uu ->to shell ?? //aux - dMass m_mass; //e ?? //bl - dBodyID m_body; //e //st - dReal m_l_scale; // ->to shell ?? //bl - dReal m_w_scale; // ->to shell ?? //bl - CPHElement *m_parent_element; //bool ! //bl - CPHShell *m_shell; //e //bl - CPHInterpolation m_body_interpolation; //e //bl - CPHFracturesHolder *m_fratures_holder; //e //bl - - dReal m_w_limit ; //->to shell ?? //bl - dReal m_l_limit ; //->to shell ?? //bl -// dVector3 m_safe_position; //e //st -// dQuaternion m_safe_quaternion; -// dVector3 m_safe_velocity; //e //st -// Fmatrix m_inverse_local_transform; //e //bt - dReal k_w; //->to shell ?? //st - dReal k_l; //->to shell ?? //st - //ObjectContactCallbackFun* temp_for_push_out; //->to shell ?? //aux - //u32 push_untill; //->to shell ?? //st - Flags8 m_flags; // - enum - { - flActive = 1<<0, - flActivating = 1<<1, - flUpdate = 1<<2, - flWasEnabledBeforeFreeze= 1<<3, - flEnabledOnStep = 1<<4, - flFixed = 1<<5, - flAnimated = 1<<6 - }; -// bool was_enabled_before_freeze; -// bool bUpdate; //->to shell ?? //st -// bool b_enabled_onstep; -private: -////////////////////////////////////////////Interpolation///////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - void FillInterpolation () //interpolation called anywhere visual influent - { - m_body_interpolation.ResetPositions(); - m_body_interpolation.ResetRotations(); - //bUpdate=true; - m_flags.set(flUpdate,TRUE); - } -IC void UpdateInterpolation () //interpolation called from ph update visual influent - { - ///VERIFY(dBodyStateValide(m_body)); - m_body_interpolation.UpdatePositions(); - m_body_interpolation.UpdateRotations(); - //bUpdate=true; - m_flags.set(flUpdate,TRUE); - } -public: -////////////////////////////////////////////////Geometry///////////////////////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void add_Sphere (const Fsphere& V); //aux - virtual void add_Box (const Fobb& V); //aux - virtual void add_Cylinder (const Fcylinder& V); //aux - virtual void add_Shape (const SBoneShape& shape); //aux - virtual void add_Shape (const SBoneShape& shape,const Fmatrix& offset); //aux - virtual CODEGeom* last_geom (){return CPHGeometryOwner::last_geom();} - virtual CODEGeom* geometry ( u16 i ){ return CPHGeometryOwner::Geom( i ); } - virtual const IPhysicsGeometry* geometry ( u16 i )const { return CPHGeometryOwner::Geom( i ); }; - virtual void add_geom ( CODEGeom* g ); - virtual void remove_geom ( CODEGeom* g ); - virtual bool has_geoms (){return CPHGeometryOwner::has_geoms();} - virtual void set_ContactCallback (ContactCallbackFun* callback); //aux (may not be) - virtual void set_ObjectContactCallback (ObjectContactCallbackFun* callback); //called anywhere ph state influent - virtual void add_ObjectContactCallback (ObjectContactCallbackFun* callback); //called anywhere ph state influent - virtual void remove_ObjectContactCallback (ObjectContactCallbackFun* callback); - virtual void set_CallbackData (void * cd); - virtual void *get_CallbackData (); - virtual ObjectContactCallbackFun *get_ObjectContactCallback (); - virtual void set_PhysicsRefObject (CPhysicsShellHolder* ref_object); //aux - virtual CPhysicsShellHolder* PhysicsRefObject (){return m_phys_ref_object;} //aux - virtual void SetMaterial (u16 m); //aux - virtual void SetMaterial (LPCSTR m){CPHGeometryOwner::SetMaterial(m);} //aux - virtual u16 numberOfGeoms ()const; //aux - virtual const Fvector& local_mass_Center () {return CPHGeometryOwner::local_mass_Center();} //aux - virtual float getVolume () {return CPHGeometryOwner::get_volume();} //aux - virtual void get_Extensions (const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext) const ; //aux - virtual void get_MaxAreaDir (Fvector& dir){CPHGeometryOwner::get_MaxAreaDir(dir);} - virtual float getRadius (); -////////////////////////////////////////////////////Mass///////////////////////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -private: - void calculate_it_data (const Fvector& mc,float mass); //aux - void calculate_it_data_use_density (const Fvector& mc,float density); //aux - void calc_it_fract_data_use_density (const Fvector& mc,float density);//sets element mass and fractures parts mass //aux - dMass recursive_mass_summ (u16 start_geom,FRACTURE_I cur_fracture); //aux -public: // - virtual const Fvector& mass_Center ()const ; //aux - virtual void setDensity (float M); //aux - virtual float getDensity (){return m_mass.mass/m_volume;} //aux - virtual void setMassMC (float M,const Fvector& mass_center); //aux - virtual void setDensityMC (float M,const Fvector& mass_center); //aux - virtual void set_local_mass_center (const Fvector &mc ); - virtual void setInertia (const dMass& M); //aux - virtual void addInertia (const dMass& M); - virtual void add_Mass (const SBoneShape& shape,const Fmatrix& offset,const Fvector& mass_center,float mass,CPHFracture* fracture=NULL);//aux - virtual void set_BoxMass (const Fobb& box, float mass); //aux - virtual void setMass (float M); //aux - virtual float getMass (){return m_mass.mass;} //aux - virtual dMass* getMassTensor (); //aux - void ReAdjustMassPositions (const Fmatrix &shift_pivot,float density); //aux - void ResetMass (float density); //aux - void CutVelocity (float l_limit,float a_limit); -///////////////////////////////////////////////////PushOut/////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -private: // - -public: // -//////////////////////////////////////////////Disable///////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void Disable () ; // - virtual void ReEnable () ; // - void Enable () ; //aux - virtual bool isEnabled () const {return isActive()&&dBodyIsEnabled(m_body);} - virtual bool isFullActive () const {return isActive()&&!m_flags.test(flActivating);} - virtual bool isActive () const {return !!m_flags.test(flActive);} - virtual void Freeze () ; // - virtual void UnFreeze () ; // - virtual bool EnabledStateOnStep () {return dBodyIsEnabled(m_body)||m_flags.test(flEnabledOnStep);} // -////////////////////////////////////////////////Updates/////////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - bool AnimToVel ( float dt, float l_limit,float a_limit ); - void BoneGlPos (Fmatrix &m, const CBoneInstance* B)const; - void ToBonePos (const CBoneInstance* B); -#ifdef DEBUG - virtual void dbg_draw_velocity ( float scale, u32 color ); - virtual void dbg_draw_force ( float scale, u32 color ); - virtual void dbg_draw_geometry ( float scale, u32 color, Flags32 flags = Flags32().assign( 0 ) ) const; -#endif - void SetBoneCallbackOverwrite (bool v); - void BonesCallBack (CBoneInstance* B); //called from updateCL visual influent - void StataticRootBonesCallBack (CBoneInstance* B); - void PhDataUpdate (dReal step); //ph update - void PhTune (dReal step); //ph update - virtual void Update (); //called update CL visual influence -//////////////////////////////////////////////////Dynamics//////////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetAirResistance (dReal linear=default_k_l, dReal angular=default_k_w) //aux (may not be) - { // - k_w= angular; // - k_l=linear; // - } // - virtual void GetAirResistance (float &linear, float &angular) // - { // - linear= k_l; // - angular=k_w; // - } - virtual void applyImpact (const SPHImpact& impact); // - virtual void applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val,const u16 id) ; //called anywhere ph state influent - virtual void set_DisableParams (const SAllDDOParams& params) ; // - virtual void set_DynamicLimits (float l_limit=default_l_limit,float w_limit=default_w_limit); //aux (may not be) - virtual void set_DynamicScales (float l_scale=default_l_scale,float w_scale=default_w_scale); //aux (may not be) - virtual void Fix (); - virtual void SetAnimated ( bool v ); - virtual void ReleaseFixed (); - virtual bool isFixed (){return !!(m_flags.test(flFixed));} - virtual void applyForce (const Fvector& dir, float val); //aux - virtual void applyForce (float x,float y,float z); //called anywhere ph state influent - virtual void applyImpulse (const Fvector& dir, float val);//aux - virtual void applyImpulseVsMC (const Fvector& pos,const Fvector& dir, float val); // - virtual void applyImpulseVsGF (const Fvector& pos,const Fvector& dir, float val); // - virtual void applyGravityAccel (const Fvector& accel); - virtual void getForce (Fvector& force); - virtual void getTorque (Fvector& torque); - virtual void get_LinearVel (Fvector& velocity) const; //aux - virtual void get_AngularVel (Fvector& velocity) const; //aux - virtual void set_LinearVel (const Fvector& velocity); //called anywhere ph state influent - virtual void set_AngularVel (const Fvector& velocity); //called anywhere ph state influent - virtual void setForce (const Fvector& force); // - virtual void setTorque (const Fvector& torque); // - virtual void set_ApplyByGravity (bool flag) ; // - virtual bool get_ApplyByGravity () ; // -///////////////////////////////////////////////////Net//////////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void get_State ( SPHNetState& state); // - virtual void set_State (const SPHNetState& state); // - virtual void net_Import (NET_Packet& P) ; - virtual void net_Export (NET_Packet& P) ; -///////////////////////////////////////////////////Position/////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetTransform (const Fmatrix& m0); // - virtual void TransformPosition (const Fmatrix &form); - virtual void getQuaternion (Fquaternion& quaternion); // - virtual void setQuaternion (const Fquaternion& quaternion); // - virtual void SetGlobalPositionDynamic (const Fvector& position); // - virtual void GetGlobalPositionDynamic (Fvector* v); // - virtual void cv2obj_Xfrom (const Fquaternion& q,const Fvector& pos, Fmatrix& xform); // - virtual void cv2bone_Xfrom (const Fquaternion& q,const Fvector& pos, Fmatrix& xform); // - virtual void InterpolateGlobalTransform (Fmatrix* m); //called UpdateCL vis influent - virtual void InterpolateGlobalPosition (Fvector* v); //aux - virtual void GetGlobalTransformDynamic (Fmatrix* m) const ; //aux -IC void InverceLocalForm (Fmatrix&) ; -IC void MulB43InverceLocalForm (Fmatrix&) const; - -////////////////////////////////////////////////////Structure///////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual CPhysicsShell* PhysicsShell (); //aux - CPHShell* PHShell (); - virtual void set_ParentElement (CPhysicsElement* p){ m_parent_element=(CPHElement*)p; } //aux -#ifdef DEBUG - CPHElement* parent_element (){ return m_parent_element; } -#endif - void SetShell (CPHShell* p); //aux - virtual dBodyID get_body () {return m_body;}; //aux - virtual const dBodyID get_bodyConst ()const {return m_body;}; //aux -//////////////////////////////////////////////////////Breakable////////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - IC CPHFracturesHolder* FracturesHolder (){return m_fratures_holder;} //aux - IC const CPHFracturesHolder* constFracturesHolder ()const{return m_fratures_holder;} //aux - void DeleteFracturesHolder (); // - virtual bool isBreakable (); //aux - virtual u16 setGeomFracturable (CPHFracture& fracture); //aux - virtual CPHFracture& Fracture (u16 num); //aux - void SplitProcess (ELEMENT_PAIR_VECTOR &new_elements); //aux - void PassEndGeoms (u16 from,u16 to,CPHElement* dest); //aux -////////////////////////////////////////////////////Build/Activate//////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void Activate (const Fmatrix& m0, float dt01, const Fmatrix& m2,bool disable=false); //some isues not to be aux - virtual void Activate (const Fmatrix &transform,const Fvector& lin_vel,const Fvector& ang_vel,bool disable=false);//some isues not to be aux - virtual void Activate (bool disable=false, bool not_set_bone_callbacks = false); //some isues not to be aux - virtual void Activate (const Fmatrix& start_from, bool disable=false); //some isues not to be aux - virtual void Deactivate (); //aux //aux - void SetBoneCallback (); - void ClearBoneCallback (); - void CreateSimulBase ();//create body & cpace //aux - void ReInitDynamics (const Fmatrix &shift_pivot,float density); //set body & geom positions - void PresetActive (); // - void build (); //aux - void build (bool disable); //aux - void destroy (); //called anywhere ph state influent - void Start (); //aux - void RunSimulation (); //called anywhere ph state influent - void RunSimulation (const Fmatrix& start_from); // - void ClearDestroyInfo (); - void GetAnimBonePos (Fmatrix &bp); - // bool CheckBreakConsistent () - CPHElement (); //aux - virtual ~CPHElement (); //aux -}; - -IC CPHElement* cast_PHElement(CPhysicsElement* e){return static_cast(static_cast(e));} -IC CPHElement* cast_PHElement(void* e){return static_cast(static_cast(e));} -IC CPhysicsElement* cast_PhysicsElement(CPHElement* e){return static_cast(static_cast(e));} -#endif \ No newline at end of file diff --git a/src/xrGame/PHElementInline.h b/src/xrGame/PHElementInline.h deleted file mode 100644 index 4904175e50c..00000000000 --- a/src/xrGame/PHElementInline.h +++ /dev/null @@ -1,16 +0,0 @@ - - -IC void CPHElement::InverceLocalForm(Fmatrix& m) -{ - m.identity(); - m.c.set(m_mass_center); - m.invert(); -} - -IC void CPHElement::MulB43InverceLocalForm(Fmatrix& m) const -{ - Fvector ic;ic.set(m_mass_center); - ic.invert(); - m.transform_dir(ic); - m.c.add(ic); -} \ No newline at end of file diff --git a/src/xrGame/PHElementNetState.cpp b/src/xrGame/PHElementNetState.cpp deleted file mode 100644 index 50af65dcade..00000000000 --- a/src/xrGame/PHElementNetState.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "StdAfx.h" -#include "physicsshell.h" -#include "phinterpolation.h" -#include "phelement.h" -#include "phobject.h" -#include "phworld.h" -#include "phshell.h" - -void CPHElement::get_State(SPHNetState& state) -{ - GetGlobalPositionDynamic(&state.position); - getQuaternion(state.quaternion); - m_body_interpolation.GetPosition(state.previous_position,0); - m_body_interpolation.GetRotation(state.previous_quaternion,0); - get_LinearVel(state.linear_vel); - get_AngularVel(state.angular_vel); - getForce(state.force); - getTorque(state.torque); - if(!isActive()) - { - state.enabled=false; - return; - } - state.enabled=!!dBodyIsEnabled(m_body); -} -void CPHElement::set_State(const SPHNetState& state) -{ - //bUpdate=true; - m_flags.set(flUpdate,TRUE); - SetGlobalPositionDynamic(state.position); - setQuaternion(state.quaternion); - m_body_interpolation.SetPosition(state.previous_position,0); - m_body_interpolation.SetRotation(state.previous_quaternion,0); - m_body_interpolation.SetPosition(state.position,1); - m_body_interpolation.SetRotation(state.quaternion,1); - set_LinearVel(state.linear_vel); - set_AngularVel(state.angular_vel); - setForce(state.force); - setTorque(state.torque); - if(!isActive()) return; -#if 1 - if(state.enabled&& !dBodyIsEnabled(m_body)) - { - dBodyEnable(m_body); - m_shell->EnableObject(0); - } - if(!state.enabled && dBodyIsEnabled(m_body)) - { - m_shell->DisableObject(); - Disable(); - } -#endif - CPHDisablingFull::Reinit(); - m_flags.set(flUpdate,TRUE); -} - -void CPHElement ::net_Export(NET_Packet& P) -{ - SPHNetState state; - get_State(state); - state.net_Export(P); -} - -void CPHElement::net_Import(NET_Packet& P) -{ - SPHNetState state; - state.net_Import(P); - set_State(state); -} \ No newline at end of file diff --git a/src/xrGame/PHFracture.cpp b/src/xrGame/PHFracture.cpp deleted file mode 100644 index d695ba8076a..00000000000 --- a/src/xrGame/PHFracture.cpp +++ /dev/null @@ -1,600 +0,0 @@ -#include "stdafx.h" -#include "PHFracture.h" -#include "Physics.h" -#include "PHElement.h" -#include "PHShell.h" -#include "../Include/xrRender/Kinematics.h" - -#include "../xrEngine/bone.h" - -#pragma warning(disable:4995) -#pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/joint.h" -#pragma warning(default:4995) -#pragma warning(default:4267) -extern class CPHWorld *ph_world; -static const float torque_factor=10000000.f; -CPHFracturesHolder::CPHFracturesHolder() -{ - m_has_breaks=false; -} -CPHFracturesHolder::~CPHFracturesHolder() -{ - m_has_breaks=false; - m_fractures.clear(); - m_impacts.clear(); - m_feedbacks.clear(); -} -void CPHFracturesHolder::ApplyImpactsToElement(CPHElement* E) -{ - PH_IMPACT_I i=m_impacts.begin(),e=m_impacts.end(); - BOOL ac_state=E->isActive(); - //E->bActive=true; - E->m_flags.set(CPHElement::flActive,TRUE); - for(;e!=i;++i) - { - E->applyImpact(*i); - } - //E->bActive=ac_state; - E->m_flags.set(CPHElement::flActive,ac_state); -} -element_fracture CPHFracturesHolder::SplitFromEnd(CPHElement* element,u16 fracture) -{ - FRACTURE_I fract_i =m_fractures.begin()+fracture; - u16 geom_num =fract_i->m_start_geom_num; - u16 end_geom_num =fract_i->m_end_geom_num; - SubFractureMass (fracture); - - CPHElement* new_element =cast_PHElement(P_create_Element()); - new_element->m_SelfID=fract_i->m_bone_id; - new_element->mXFORM.set(element->mXFORM); - element->PassEndGeoms(geom_num,end_geom_num,new_element); - ///////////////////////////////////////////// - IKinematics* pKinematics= element->m_shell->PKinematics(); - const CBoneInstance& new_bi=pKinematics->LL_GetBoneInstance(new_element->m_SelfID); - const CBoneInstance& old_bi=pKinematics->LL_GetBoneInstance(element->m_SelfID); - - - - Fmatrix shift_pivot; - shift_pivot.set (new_bi.mTransform); - shift_pivot.invert (); - shift_pivot.mulB_43 (old_bi.mTransform); - ///////////////////////////////////////////// - float density=element->getDensity(); - new_element->SetShell(element->PHShell()); - Fmatrix current_transtform; - element->GetGlobalTransformDynamic(¤t_transtform); - InitNewElement(new_element,shift_pivot,density); - Fmatrix shell_form; - element->PHShell()->GetGlobalTransformDynamic(&shell_form); - current_transtform.mulA_43 (shell_form); - new_element->SetTransform (current_transtform); - - - //dBodyID new_element_body=new_element->get_body(); - //dBodyAddForce(new_element_body,fract_i->m_pos_in_element[0], - // fract_i->m_pos_in_element[1], - // fract_i->m_pos_in_element[2]); - ApplyImpactsToElement(new_element); - - //dBodyAddTorque(new_element->get_body(),fract_i->m_break_force, - // fract_i->m_break_torque, - // fract_i->m_add_torque_z); - //BodyCutForce(new_element_body,default_l_limit,default_w_limit); - element_fracture ret =mk_pair(new_element,(CShellSplitInfo)(*fract_i)); - - if(m_fractures.size()-fracture>0) - { - if(new_element->m_fratures_holder==NULL)//create fractures holder if it was not created before - { - new_element->m_fratures_holder=xr_new(); - } - PassEndFractures(fracture,new_element); - } - - return ret; -} - -void CPHFracturesHolder::PassEndFractures(u16 from,CPHElement* dest) -{ - FRACTURE_I i=m_fractures.begin(),i_from=m_fractures.begin()+from,e=m_fractures.end(); - u16 end_geom=i_from->m_end_geom_num; - u16 begin_geom_num=i_from->m_start_geom_num; - u16 leaved_geoms=begin_geom_num; - u16 passed_geoms=end_geom-begin_geom_num; - if(i_from==e) return; - - for(;i!=i_from;++i)//correct end geoms for fractures leaved in source - { - u16& cur_end_geom=i->m_end_geom_num; - if(cur_end_geom>begin_geom_num) cur_end_geom=cur_end_geom-passed_geoms; - } - - i++; // omit used fracture; - //these to be passed - for(;i!=e;i++)//itterate antil a fracture where geom num > end geom num - { - u16 &cur_end_geom =i->m_end_geom_num; - u16 &cur_geom =i->m_start_geom_num; - if(cur_geom>=end_geom) break; - cur_end_geom=cur_end_geom-leaved_geoms; - cur_geom=cur_geom-leaved_geoms; - } - FRACTURE_I i_to=i; - for(;i!=e;++i)//correct data in the rest leaved fractures - { - u16 &cur_end_geom =i->m_end_geom_num; - u16 &cur_geom =i->m_start_geom_num; - cur_end_geom =cur_end_geom-passed_geoms; - cur_geom =cur_geom-passed_geoms; - } - - if(i_from + 1 != i_to)//insure it!! - { - - CPHFracturesHolder* &dest_fract_holder=dest->m_fratures_holder; - if(!dest_fract_holder) dest_fract_holder=xr_new(); - //pass fractures not including end fracture - dest_fract_holder->m_fractures.insert(dest_fract_holder->m_fractures.end(),i_from+1,i_to); - - //u16 deb=u16(i_to-i_from-1); - //deb++;deb--; - } - m_fractures.erase(i_from,i_to);//erase along whith used fracture -} -void CPHFracturesHolder::SplitProcess(CPHElement* element,ELEMENT_PAIR_VECTOR &new_elements) -{ - //FRACTURE_RI i=m_fractures.rbegin(),e=m_fractures.rend();//reversed - u16 i=u16(m_fractures.size()-1); - - for(;i!=u16(-1);i--) - { - if(m_fractures[i].Breaked()) - { - //float density = element->getDensity(); - new_elements.push_back(SplitFromEnd(element,i)); - //element->ResetMass(density); - } - } - - -} - -void CPHFracturesHolder::InitNewElement(CPHElement* element,const Fmatrix &shift_pivot,float density) -{ -element->CreateSimulBase(); -element->ReInitDynamics(shift_pivot,density); -VERIFY(dBodyStateValide(element->get_body())); -} - -void CPHFracturesHolder::PhTune(dBodyID body) -{ - //iterate through all body's joints and set joints feedbacks where is not already set - //contact feedbacks stored in global storage - ContactFeedBacks wich cleared on each step - //breacable joints already has their feedbacks, - //feedbacks for rest noncontact joints stored in m_feedbacks in runtime in this function and - //and killed by destructor - - //int dBodyGetNumJoints (dBodyID b); - //dJointID dBodyGetJoint (dBodyID, int index); - //dJointGetType - //dJointTypeContact - - int num=dBodyGetNumJoints(body); - for(int i=0;iJointDestroyInfo())) dJointSetFeedback(joint,ContactFeedBacks.add()); - //if(!dJointGetFeedback(joint)) - //{ - // m_feedbacks.push_back(dJointFeedback()); - // dJointSetFeedback(joint,&m_feedbacks.back()); - //} - } - } - -} -bool CPHFracturesHolder::PhDataUpdate(CPHElement* element) -{ - FRACTURE_I i=m_fractures.begin(),e=m_fractures.end(); - for(;i!=e;++i) - { - m_has_breaks=i->Update(element)||m_has_breaks; - } - if(!m_has_breaks)m_impacts.clear(); - return m_has_breaks; - -} - -void CPHFracturesHolder::AddImpact(const Fvector& force,const Fvector& point,u16 id) -{ - m_impacts.push_back(SPHImpact(force,point,id)); -} -u16 CPHFracturesHolder::AddFracture(const CPHFracture& fracture) -{ - m_fractures.push_back(fracture); - return u16(m_fractures.size()-1); -} -CPHFracture& CPHFracturesHolder::Fracture(u16 num) -{ - R_ASSERT2(numm_start_geom_num,"fracture does not initialized!"); - - if(f_i->m_end_geom_num==u16(-1))f_i->MassAddToSecond(m) ; - else f_i->MassAddToFirst(m) ; - - - - //f_i->MassAddToFirst(m); - } -} -void CPHFracturesHolder::SubFractureMass(u16 fracture_num) -{ - FRACTURE_I f_i=m_fractures.begin(),f_e=m_fractures.end(); - FRACTURE_I fracture=f_i+fracture_num; - u16 start_geom=fracture->m_start_geom_num; - u16 end_geom =fracture->m_end_geom_num; - dMass& second_mass=fracture->m_secondM; - dMass& first_mass=fracture->m_firstM; - for(;f_i!=f_e;++f_i) - { - if(f_i==fracture) continue; - R_ASSERT2(start_geom!=f_i->m_start_geom_num,"Double fracture!!!"); - - - if(start_geom>f_i->m_start_geom_num) - { - - if(end_geom<=f_i->m_end_geom_num) f_i->MassSubFromSecond(second_mass);//tag fracture is in current - else - { - R_ASSERT2(start_geom>=f_i->m_end_geom_num,"Odd fracture!!!"); - f_i->MassSubFromFirst(second_mass);//tag fracture is ouside current - } - } - else - { - - if(end_geom>=f_i->m_end_geom_num) f_i->MassSubFromFirst(first_mass);//current fracture is in tag - else - { - R_ASSERT2(end_geom<=f_i->m_start_geom_num,"Odd fracture!!!"); - f_i->MassSubFromFirst(second_mass);//tag fracture is ouside current - } - } - } -} - -CPHFracture::CPHFracture() -{ -//m_bone_id=bone_id; -//m_position.set(position); -//m_direction.set(direction); -//m_break_force=break_force; -//m_break_torque=break_torque; -m_start_geom_num=u16(-1); -m_end_geom_num =u16(-1); -m_breaked=false; -} - -//#define DBG_BREAK -bool CPHFracture::Update(CPHElement* element) -{ - - ////itterate through impacts & calculate - dBodyID body=element->get_body(); - //const Fvector& v_bodyvel=*((Fvector*)dBodyGetLinearVel(body)); - CPHFracturesHolder* holder=element->FracturesHolder(); - PH_IMPACT_STORAGE& impacts=holder->Impacts(); - - Fvector second_part_force,first_part_force,second_part_torque,first_part_torque; - second_part_force.set(0.f,0.f,0.f); - first_part_force.set(0.f,0.f,0.f); - second_part_torque.set(0.f,0.f,0.f); - first_part_torque.set(0.f,0.f,0.f); - - //const Fvector& body_local_pos=element->local_mass_Center(); - const Fvector& body_global_pos=*(const Fvector*)dBodyGetPosition(body); - Fvector body_to_first, body_to_second; - body_to_first.set(*((const Fvector*)m_firstM.c));//,body_local_pos - body_to_second.set(*((const Fvector*)m_secondM.c));//,body_local_pos - //float body_to_first_smag=body_to_first.square_magnitude(); - //float body_to_second_smag=body_to_second.square_magnitude(); - int num=dBodyGetNumJoints(body); - for(int i=0;inode[1].body==body); - Fvector joint_position; - if(dJointGetType(joint)==dJointTypeContact) - { - dxJointContact* c_joint=(dxJointContact*)joint; - dGeomID first_geom=c_joint->contact.geom.g1; - dGeomID second_geom=c_joint->contact.geom.g2; - joint_position.set(*(Fvector*)c_joint->contact.geom.pos); - if(dGeomGetClass(first_geom)==dGeomTransformClass) - { - first_geom=dGeomTransformGetGeom(first_geom); - } - if(dGeomGetClass(second_geom)==dGeomTransformClass) - { - second_geom=dGeomTransformGetGeom(second_geom); - } - dxGeomUserData* UserData; - UserData=dGeomGetUserData(first_geom); - if(UserData) - { - u16 el_position=UserData->element_position; - //define if the contact applied to second part; - if(el_positionnumberOfGeoms()&& - el_position>=m_start_geom_num&& - el_positionGeom(el_position)->geometry() - ) applied_to_second=true; - } - UserData=dGeomGetUserData(second_geom); - if(UserData) - { - u16 el_position=UserData->element_position; - if(el_positionnumberOfGeoms()&& - el_position>=m_start_geom_num&& - el_positionGeom(el_position)->geometry() - ) applied_to_second=true; - } - - } - else - { - CPHJoint* J = (CPHJoint*) dJointGetData(joint); - if(!J)continue;//hack.. - J->PSecondElement()->InterpolateGlobalPosition(&joint_position); - CODEGeom* root_geom=J->RootGeom(); - if(root_geom) - { - u16 el_position=root_geom->element_position(); - if(element==J->PFirst_element()&& - el_positionnumberOfGeoms()&& - el_position>=m_start_geom_num&& - el_positionf2); - second_part_force.add(joint_force); - Fvector torque; - torque.crossproduct(shoulder,joint_force); - second_part_torque.add(torque); - - } - else - { - - Fvector joint_force; - joint_force.set(*(const Fvector*)feedback->f1); - second_part_force.add(joint_force); - - Fvector torque; - torque.crossproduct(shoulder,joint_force); - second_part_torque.add(torque); - } - } - else - { - Fvector shoulder; - shoulder.sub(body_to_joint,body_to_first); - if(b_body_second) - { - - Fvector joint_force; - joint_force.set(*(const Fvector*)feedback->f2); - first_part_force.add(joint_force); - Fvector torque; - torque.crossproduct(shoulder,joint_force); - first_part_torque.add(torque); - } - else - { - Fvector joint_force; - joint_force.set(*(const Fvector*)feedback->f1); - first_part_force.add(joint_force); - Fvector torque; - torque.crossproduct(shoulder,joint_force); - first_part_torque.add(torque); - } - } - - } - - PH_IMPACT_I i_i=impacts.begin(),i_e=impacts.end(); - for(;i_i!=i_e;i_i++) - { - u16 geom = i_i->geom; - - if((geom>=m_start_geom_num&&geomforce); - force.mul(phRigidBreakWeaponFactor); - Fvector second_to_point; - second_to_point.sub(body_to_second,i_i->point); - //force.mul(30.f); - second_part_force.add(force); - Fvector torque; - torque.crossproduct(second_to_point,force); - second_part_torque.add(torque); - } - else - { - Fvector force; - force.set(i_i->force); - Fvector first_to_point; - first_to_point.sub(body_to_first,i_i->point); - //force.mul(4.f); - first_part_force.add(force); - Fvector torque; - torque.crossproduct(first_to_point,force); - second_part_torque.add(torque); - } - } - Fvector gravity_force; - gravity_force.set(0.f,-ph_world->Gravity()*m_firstM.mass,0.f); - first_part_force.add(gravity_force); - second_part_force.add(gravity_force); - dMatrix3 glI1,glI2,glInvI,tmp; - - // compute inertia tensors in global frame - dMULTIPLY2_333 (tmp,body->invI,body->R); - dMULTIPLY0_333 (glInvI,body->R,tmp); - - dMULTIPLY2_333 (tmp,m_firstM.I,body->R); - dMULTIPLY0_333 (glI1,body->R,tmp); - - dMULTIPLY2_333 (tmp,m_secondM.I,body->R); - dMULTIPLY0_333 (glI2,body->R,tmp); - //both parts have eqiual start angular vel same as have body so we ignore it - - //compute breaking torque - ///break_torque=glI2*glInvI*first_part_torque-glI1*glInvI*second_part_torque+crossproduct(second_in_bone,second_part_force)-crossproduct(first_in_bone,first_part_force) - Fvector break_torque,vtemp; - - dMULTIPLY0_331 ((float*)&break_torque,glInvI,(float*)&first_part_torque); - dMULTIPLY0_331 ((float*)&break_torque,glI2,(float*)&break_torque); - - dMULTIPLY0_331 ((float*)&vtemp,glInvI,(float*)&second_part_torque); - dMULTIPLY0_331 ((float*)&vtemp,glI1,(float*)&vtemp); - break_torque.sub(vtemp); - - //Fvector first_in_bone,second_in_bone; - //first_in_bone.sub(*((const Fvector*)m_firstM.c),m_pos_in_element); - //second_in_bone.sub(*((const Fvector*)m_secondM.c),m_pos_in_element); - - //vtemp.crossproduct(second_in_bone,second_part_force); - //break_torque.add(vtemp); - //vtemp.crossproduct(first_in_bone,first_part_force); - //break_torque.sub(vtemp); -#ifdef DBG_BREAK - float btm_dbg=break_torque.magnitude()*phBreakCommonFactor/torque_factor; -#endif - if(break_torque.magnitude()*phBreakCommonFactor>m_break_torque*torque_factor) - { - //m_break_torque.set(second_part_torque); - m_pos_in_element.set(second_part_force); - m_break_force=second_part_torque.x; - m_break_torque=second_part_torque.y; - m_add_torque_z=second_part_torque.z; - m_breaked=true; -#ifndef DBG_BREAK - return m_breaked; -#endif - } - - Fvector break_force;//=1/(m1+m2)*(F1*m2-F2*m1)+r2xT2/(r2^2)-r1xT1/(r1^2) - break_force.set(first_part_force); - break_force.mul(m_secondM.mass); - vtemp.set(second_part_force); - vtemp.mul(m_firstM.mass); - break_force.sub(vtemp); - break_force.mul(1.f/element->getMass());//element->getMass()//body->mass.mass - - //vtemp.crossproduct(second_in_bone,second_part_torque); - //break_force.add(vtemp); - //vtemp.crossproduct(first_in_bone,first_part_torque); - //break_force.sub(vtemp); - - float bfm=break_force.magnitude()*phBreakCommonFactor; - - if(m_break_force element_fracture; -typedef xr_vector::reverse_iterator ELEMENT_PAIR_RI; -typedef xr_vector::reverse_iterator FRACTURE_RI; -DEFINE_VECTOR(element_fracture,ELEMENT_PAIR_VECTOR,ELEMENT_PAIR_I) - -class CPHFracturesHolder //stored in CPHElement -{ -friend class CPHElement; -friend class CPHShellSplitterHolder; -bool m_has_breaks; - -FRACTURE_STORAGE m_fractures; -PH_IMPACT_STORAGE m_impacts; //filled in anytime from CPHElement applyImpulseTrace cleared in PhDataUpdate -CFEEDBACK_STORAGE m_feedbacks; //this store feedbacks for non contact joints -public: -CPHFracturesHolder (); - -~CPHFracturesHolder (); -void DistributeAdditionalMass (u16 geom_num,const dMass& m);// -void SubFractureMass (u16 fracture_num); -void AddImpact (const Fvector& force,const Fvector& point,u16 id); -PH_IMPACT_STORAGE& Impacts (){return m_impacts;} - -CPHFracture& LastFracture (){return m_fractures.back();} -protected: -private: - -u16 CheckFractured (); //returns first breaked fracture - -element_fracture SplitFromEnd (CPHElement* element,u16 geom_num); -void InitNewElement (CPHElement* element,const Fmatrix &shift_pivot,float density); -void PassEndFractures(u16 from,CPHElement* dest); -public: -void SplitProcess (CPHElement* element,ELEMENT_PAIR_VECTOR &new_elements); -u16 AddFracture (const CPHFracture& fracture); -CPHFracture& Fracture (u16 num); -void PhTune (dBodyID body); //set feedback for joints called from PhTune of ShellSplitterHolder -bool PhDataUpdate (CPHElement* element); //collect joints and external impacts in fractures Update which set m_fractured; called from PhDataUpdate of ShellSplitterHolder returns true if has breaks -void ApplyImpactsToElement(CPHElement* element); -}; - -IC void sub_diapasones(u16 &from1,u16 &to1,const u16 &from0,const u16 &to0) -{ - if(from0==to0 ||from1==to1|| to1<=from0||to1==u16(-1)) return; - R_ASSERT(from0>=from1&&to0<=to1); - u16 dip=to0-from0; - to1=to1-dip; -} - -#endif PH_FRACTURE_H \ No newline at end of file diff --git a/src/xrGame/PHGeometryOwner.cpp b/src/xrGame/PHGeometryOwner.cpp deleted file mode 100644 index 76a96c05569..00000000000 --- a/src/xrGame/PHGeometryOwner.cpp +++ /dev/null @@ -1,480 +0,0 @@ -#include "stdafx.h" -#include "PHGeometryOwner.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrEngine/bone.h" - -CPHGeometryOwner::CPHGeometryOwner() -{ - b_builded=false; - m_mass_center.set(0,0,0); - contact_callback=ContactShotMark; - object_contact_callback=NULL; - ul_material=GMLib.GetMaterialIdx("objects\\small_box"); - m_group=NULL; - m_phys_ref_object=NULL; -} - -CPHGeometryOwner::~CPHGeometryOwner() -{ - GEOM_I i_geom=m_geoms.begin(),e=m_geoms.end(); - for(;i_geom!=e;++i_geom)xr_delete(*i_geom); - m_geoms.clear(); - DestroyGroupSpace(); - //if( b_builded ) - //{ - //VERIFY( m_group ); - //if( m_group ) - // dSpaceDestroy( m_group ); - - //} -} -void CPHGeometryOwner::group_add( CODEGeom& g ) -{ - if(!m_group) - { - CreateGroupSpace(); - } - VERIFY( m_group ); - { - g.add_to_space((dSpaceID)m_group); - } -} - -void CPHGeometryOwner::group_remove( CODEGeom& g ) -{ - VERIFY( m_group ); - g.remove_from_space( m_group ); - if( dSpaceGetNumGeoms( m_group ) ==0 ) - DestroyGroupSpace(); -} - -void CPHGeometryOwner:: build_Geom (CODEGeom& geom) -{ - - geom.build(m_mass_center); - //geom.set_body(m_body); - geom.set_material(ul_material); - if(contact_callback)geom.set_contact_cb(contact_callback); - if(object_contact_callback)geom.set_obj_contact_cb(object_contact_callback); - if(m_phys_ref_object) geom.set_ref_object(m_phys_ref_object); - //VERIFY( m_group ); - group_add( geom ); - -} - -void CPHGeometryOwner::build_Geom(u16 i) -{ - CODEGeom& geom=*m_geoms[i]; - build_Geom(geom); - geom.element_position()=i; -} - -void CPHGeometryOwner::build() -{ - if(b_builded) return; - //if(m_geoms.size()>1)//add/remove geom issues - //VERIFY(!m_group); - - u16 geoms_size=u16(m_geoms.size()); - for(u16 i=0;idestroy(); - } - b_builded=false; -} -void CPHGeometryOwner::set_body(dBodyID body) -{ - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->set_body(body); -} - -Fvector CPHGeometryOwner:: get_mc_data (){ - Fvector s; - float pv; - m_mass_center.set(0,0,0); - m_volume=0.f; - GEOM_I i_geom=m_geoms.begin(),e=m_geoms.end(); - for(;i_geom!=e;++i_geom) - { - pv=(*i_geom)->volume(); - s.mul((*i_geom)->local_center(),pv); - m_volume+=pv; - m_mass_center.add(s); - } - m_mass_center.mul(1.f/m_volume); - return m_mass_center; -} - -Fvector CPHGeometryOwner:: get_mc_geoms (){ - ////////////////////to be implemented - Fvector mc; - mc.set(0.f,0.f,0.f); - return mc; -} -void CPHGeometryOwner::get_mc_kinematics(IKinematics* K,Fvector& mc,float& mass) -{ - - mc.set(0.f,0.f,0.f); - mass=0.f; - m_volume=0.f; - GEOM_I i_geom=m_geoms.begin(),e=m_geoms.end(); - for(;i_geom!=e;++i_geom) - { - CBoneData& data=K->LL_GetData((*i_geom)->bone_id()); - Fvector add; - mass+=data.mass; - m_volume+=(*i_geom)->volume(); - add.set(data.center_of_mass); - add.mul(data.mass); - mc.add(add); - } - mc.mul(1.f/mass); -} -void CPHGeometryOwner:: calc_volume_data () -{ - m_volume=0.f; - GEOM_I i_geom=m_geoms.begin(),e=m_geoms.end(); - for(;i_geom!=e;++i_geom) - { - m_volume+=(*i_geom)->volume(); - } -} - -void CPHGeometryOwner::SetMaterial(u16 m) -{ - ul_material=m; - if(!b_builded) return; - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->set_material(m); -} - -void CPHGeometryOwner::SetPhObjectInGeomData(CPHObject* O) -{ - if(!b_builded) return; - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->set_ph_object(O); -} - -dGeomID CPHGeometryOwner::dSpacedGeometry() -{ - if(!b_builded) return 0; - VERIFY( m_group ); - //if(m_group) - return (dGeomID) group_space();//(dGeomID)m_group; - //else return (*m_geoms.begin())->geometry_transform(); -} - -void CPHGeometryOwner:: add_Box (const Fobb& V) -{ - Fobb box; - box=V; - if(box.m_halfsize.x<0.005f) box.m_halfsize.x=0.005f; - if(box.m_halfsize.y<0.005f) box.m_halfsize.y=0.005f; - if(box.m_halfsize.z<0.005f) box.m_halfsize.z=0.005f; - m_geoms.push_back(smart_cast(xr_new(box))); - -} - -void CPHGeometryOwner:: add_Sphere (const Fsphere& V) -{ - m_geoms.push_back(smart_cast(xr_new(V))); -} - -void CPHGeometryOwner::add_Cylinder (const Fcylinder& V) -{ - m_geoms.push_back(smart_cast(xr_new(V))); -} - - -void CPHGeometryOwner::add_Shape(const SBoneShape& shape,const Fmatrix& offset) -{ - switch(shape.type) { - case SBoneShape::stBox : - { - Fobb box=shape.box; - Fmatrix m; - m.set(offset); - //Fmatrix position; - //position.set(box.m_rotate); - //position.c.set(box.m_translate); - //position.mulA(offset); - //box.m_rotate.set(position); - //box.m_translate.set(position.c); - box.transform(box,m); - add_Box(box); - break; - } - case SBoneShape::stSphere : - { - Fsphere sphere=shape.sphere; - offset.transform_tiny(sphere.P); - add_Sphere(sphere); - break; - } - - - case SBoneShape::stCylinder : - { - Fcylinder C=shape.cylinder; - offset.transform_tiny(C.m_center); - offset.transform_dir(C.m_direction); - add_Cylinder(C); - break; - } - - - case SBoneShape::stNone : - break; - default: NODEFAULT; - } -} - -void CPHGeometryOwner::add_Shape(const SBoneShape& shape) -{ - switch(shape.type) { - case SBoneShape::stBox : - { - add_Box(shape.box); - break; - } - case SBoneShape::stSphere : - { - add_Sphere(shape.sphere); - break; - } - - - case SBoneShape::stCylinder : - { - add_Cylinder(shape.cylinder); - break; - } - - case SBoneShape::stNone : - break; - default: NODEFAULT; - } -} - - -void CPHGeometryOwner::set_ContactCallback(ContactCallbackFun* callback) -{ - contact_callback=callback; - if(!b_builded)return; - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->set_contact_cb(callback); -} - - -void CPHGeometryOwner::set_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - object_contact_callback= callback; - if(!b_builded)return; - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->set_obj_contact_cb(callback); -} - -void CPHGeometryOwner::add_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - - if(!object_contact_callback) - { - object_contact_callback= callback; - } - if(!b_builded)return; - { - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->add_obj_contact_cb(callback); - } -} - -void CPHGeometryOwner::remove_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - - if(object_contact_callback==callback) - { - object_contact_callback= NULL; - } - if(!b_builded)return; - { - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->remove_obj_contact_cb(callback); - } -} - -ObjectContactCallbackFun* CPHGeometryOwner::get_ObjectContactCallback() -{ - return object_contact_callback; -} -void CPHGeometryOwner::set_CallbackData(void * cd) -{ - VERIFY(b_builded); - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->set_callback_data(cd); -} -void* CPHGeometryOwner::get_CallbackData() -{ - VERIFY(b_builded); - return (*m_geoms.begin())->get_callback_data (); -} -void CPHGeometryOwner::set_PhysicsRefObject(CPhysicsShellHolder* ref_object) -{ - m_phys_ref_object=ref_object; - if(!b_builded) return; - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->set_ref_object(ref_object); -} - -u16 CPHGeometryOwner::numberOfGeoms() const -{ - return (u16)m_geoms.size(); -} - -void CPHGeometryOwner::get_Extensions(const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext) const -{ - t_get_extensions( m_geoms,axis, center_prg, lo_ext, hi_ext ); - /* - lo_ext=dInfinity;hi_ext=-dInfinity; - GEOM_CI i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) - { - float temp_lo_ext,temp_hi_ext; - (*i)->get_Extensions(axis,center_prg,temp_lo_ext,temp_hi_ext); - if(lo_ext>temp_lo_ext)lo_ext=temp_lo_ext; - if(hi_extget_max_area_dir_bt(dir); -} -float CPHGeometryOwner::getRadius() -{ - if(!m_geoms.empty()) return m_geoms.back()->radius(); - else return 0.f; -} - -void CPHGeometryOwner::get_mc_vs_transform(Fvector& mc,const Fmatrix& m) -{ - mc.set(m_mass_center); - m.transform_tiny(mc); - VERIFY2(_valid(mc),"invalid mc in_set_transform"); -} - -void CPHGeometryOwner::setStaticForm(const Fmatrix& form) -{ - if(!b_builded) return; - Fmatrix f; - f.set(form); - get_mc_vs_transform(f.c,form); - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) (*i)->set_static_ref_form(f); -} - -void CPHGeometryOwner::setPosition(const Fvector& pos) -{ - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) - { - (*i)->set_build_position(pos); - } -} -void CPHGeometryOwner::CreateGroupSpace() -{ - VERIFY(!m_group); - m_group=dSimpleSpaceCreate(0); - dSpaceSetCleanup(m_group,0); - -} -void CPHGeometryOwner:: DestroyGroupSpace() -{ - if(m_group){ - dGeomDestroy((dGeomID)m_group); - m_group=NULL; - } -} -struct SFindPred -{ - u16 m_val; - SFindPred(u16 val) - { - m_val=val; - } -bool operator () (CODEGeom* g) - { - return g->bone_id()==m_val; - } -}; -CODEGeom* CPHGeometryOwner::GeomByBoneID(u16 bone_id) -{ - - GEOM_I g=std::find_if(m_geoms.begin(),m_geoms.end(),SFindPred(bone_id)); - if(g!=m_geoms.end()) - { - return *g; - } - else - { - return NULL; - } -} - -void CPHGeometryOwner::clear_cashed_tries() -{ - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) - { - (*i)->clear_cashed_tries(); - } -} - -void CPHGeometryOwner::clear_motion_history() -{ - GEOM_I i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) - { - (*i)->clear_motion_history(); - } -} - -void CPHGeometryOwner::add_geom( CODEGeom* g ) -{ - VERIFY( b_builded ); - VERIFY( m_group ); - m_geoms.push_back( g ); - group_add( *g ); - //g->add_to_space( m_group ); -} - -void CPHGeometryOwner::remove_geom( CODEGeom* g ) -{ - VERIFY( b_builded ); - VERIFY( m_group ); - GEOM_I gi = std::find( m_geoms.begin(), m_geoms.end(), g ); - VERIFY( gi != m_geoms.end()); - //(*gi)->remove_from_space( m_group ); - group_remove( *g ); - m_geoms.erase( gi ); -} - -#ifdef DEBUG -void CPHGeometryOwner::dbg_draw( float scale, u32 color, Flags32 flags )const -{ - VERIFY( b_builded ); - GEOM_CI i=m_geoms.begin(),e=m_geoms.end(); - for(;i!=e;++i) - { - (*i)->dbg_draw( scale, color, flags ); - } -} -#endif \ No newline at end of file diff --git a/src/xrGame/PHGeometryOwner.h b/src/xrGame/PHGeometryOwner.h deleted file mode 100644 index f73ffec775c..00000000000 --- a/src/xrGame/PHGeometryOwner.h +++ /dev/null @@ -1,107 +0,0 @@ -#ifndef PH_GEOMETRY_OWNER_H -#define PH_GEOMETRY_OWNER_H -#include "Geometry.h" -#include "../xrEngine/gamemtllib.h" - -DEFINE_VECTOR(CODEGeom*,GEOM_STORAGE,GEOM_I) -typedef xr_vector::const_iterator GEOM_CI; -struct SBoneShape; -class IKinematics; - -class CPHGeometryOwner -{ -protected: - GEOM_STORAGE m_geoms; //e - //bl - bool b_builded; -private: - dSpaceID m_group; //e //bl -protected: - Fvector m_mass_center; //e ?? //bl - CPhysicsShellHolder* m_phys_ref_object; //->to shell ?? //bl - float m_volume; //e ?? //bl - u16 ul_material; //e ?? //bl - ContactCallbackFun* contact_callback; //->to shell ?? //bt - ObjectContactCallbackFun* object_contact_callback;//->to shell ?? //st -public: - /// - void add_Sphere (const Fsphere& V); //aux - void add_Box (const Fobb& V); //aux - void add_Cylinder (const Fcylinder& V); //aux - void add_Shape (const SBoneShape& shape); //aux - void add_Shape (const SBoneShape& shape,const Fmatrix& offset); //aux - CODEGeom* last_geom (){if(m_geoms.empty())return NULL; return m_geoms.back();} //aux - bool has_geoms (){return !m_geoms.empty();} - void add_geom ( CODEGeom* g ); - void remove_geom ( CODEGeom* g ); -protected: - void group_add ( CODEGeom& g ); - void group_remove ( CODEGeom& g ); -public: - - void set_ContactCallback (ContactCallbackFun* callback); //aux (may not be) - void set_ObjectContactCallback (ObjectContactCallbackFun* callback); //called anywhere ph state influent - void add_ObjectContactCallback (ObjectContactCallbackFun* callback); //called anywhere ph state influent - void remove_ObjectContactCallback (ObjectContactCallbackFun* callback); //called anywhere ph state influent - void set_CallbackData (void * cd); - void *get_CallbackData (); - ObjectContactCallbackFun *get_ObjectContactCallback (); - void set_PhysicsRefObject (CPhysicsShellHolder* ref_object); //aux - CPhysicsShellHolder* PhysicsRefObject (){return m_phys_ref_object;} //aux - void SetPhObjectInGeomData (CPHObject* O); -#ifdef DEBUG - void dbg_draw ( float scale, u32 color, Flags32 flags )const; -#endif - void SetMaterial (u16 m) ; - void SetMaterial (LPCSTR m){SetMaterial(GMLib.GetMaterialIdx(m));} //aux - IC CODEGeom* Geom (u16 num) {R_ASSERT2 (num -void t_get_extensions( const xr_vector& geoms, const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext) -{ - lo_ext=dInfinity;hi_ext=-dInfinity; - xr_vector::const_iterator i=geoms.begin(),e=geoms.end(); - for(;i!=e;++i) - { - float temp_lo_ext,temp_hi_ext; - (*i)->get_Extensions(axis,center_prg,temp_lo_ext,temp_hi_ext); - if(lo_ext>temp_lo_ext)lo_ext=temp_lo_ext; - if(hi_extm_frame_time/fixed_step); - //else - //pos.lerp(*bkp_pos,bk_pos,ph_world->FrameTime(b_frame_mark)/fixed_step); -} - - - -void CPHInterpolation::InterpolateRotation(Fmatrix& rot){ - Fquaternion q; - float t = ph_world->m_frame_time/fixed_step; - VERIFY (t>=0.f && t<=1.f); - //if(!b_udating_rotations) - q.slerp(qRotations[0],qRotations[1],t); -// else - //q.slerp(*bkp_quat,bk_quat,t); - rot.rotation(q); -} - -void CPHInterpolation::ResetPositions() -{ - VERIFY2(dBodyStateValide(m_body),"Invalid body state"); - qPositions.fill_in(*((Fvector*) dBodyGetPosition(m_body))); -} - -void CPHInterpolation::ResetRotations() -{ - VERIFY2(dBodyStateValide(m_body),"Invalid body state"); - const dReal* dQ=dBodyGetQuaternion(m_body); - Fquaternion fQ; - fQ.set(-dQ[0],dQ[1],dQ[2],dQ[3]); - qRotations.fill_in(fQ); -} - -void CPHInterpolation::GetRotation(Fquaternion& q, u16 num) -{ - if(!m_body) return; - q.set(qRotations[num]); -} - -void CPHInterpolation::GetPosition(Fvector& p,u16 num) -{ - if(!m_body) return; - p.set(qPositions[num]); -} -void CPHInterpolation::SetPosition(const Fvector& p, u16 num) -{ - if(!m_body) return; - qPositions[num].set(p); -} - -void CPHInterpolation::SetRotation(const Fquaternion& q, u16 num) -{ - if(!m_body) return; - qRotations[num]=q; -} \ No newline at end of file diff --git a/src/xrGame/PHInterpolation.h b/src/xrGame/PHInterpolation.h deleted file mode 100644 index 79722775fab..00000000000 --- a/src/xrGame/PHInterpolation.h +++ /dev/null @@ -1,28 +0,0 @@ -#include "CycleConstStorage.h" -#ifndef PHINTERPOLATON_H -#define PHINTERPOLATON_H - -#include "ode_include.h" - -class CPHInterpolation { - -public: -CPHInterpolation(); -void SetBody(dBodyID body); -static const u16 PH_INTERPOLATION_POINTS=2; -void InterpolatePosition (Fvector& pos); -void InterpolateRotation (Fmatrix& rot); -void UpdatePositions (); -void UpdateRotations (); -void ResetPositions (); -void ResetRotations (); -void GetRotation (Fquaternion& q, u16 num); -void GetPosition (Fvector& p, u16 num); -void SetRotation (const Fquaternion& q, u16 num); -void SetPosition (const Fvector& p, u16 num); -private: - dBodyID m_body; - CCycleConstStorage qPositions; - CCycleConstStorage qRotations; -}; -#endif \ No newline at end of file diff --git a/src/xrGame/PHIsland.cpp b/src/xrGame/PHIsland.cpp deleted file mode 100644 index 9741f2d7145..00000000000 --- a/src/xrGame/PHIsland.cpp +++ /dev/null @@ -1,40 +0,0 @@ -#include "stdafx.h" -#include "PHIsland.h" -#include "physics.h" -void CPHIsland:: Step(dReal step) -{ - if(!m_flags.is_active()) return; - //dWorldStepFast1 (DWorld(), fixed_step, phIterations/*+Random.randI(0,phIterationCycle)*/); - if(m_flags.is_exact_integration_prefeared() && nj < max_joint_allowed_for_exeact_integration) - dWorldStep(DWorld(),fixed_step); - else - dWorldQuickStep (DWorld(), fixed_step); - //dWorldStep(DWorld(),fixed_step); -} - -void CPHIsland::Enable() -{ - if(!m_flags.is_active()) return; - - for (dxBody *body = DWorld()->firstbody; body; body = (dxBody *) body->next)body->flags &= ~dxBodyDisabled; - -} -void CPHIsland::Repair() -{ - if(!m_flags.is_active()) return; - dBodyID body; - for (body = firstbody; body; body = (dxBody *) body->next) - { - if(!dV_valid(dBodyGetAngularVel(body))) - dBodySetAngularVel(body,0.f,0.f,0.f); - if(!dV_valid(dBodyGetLinearVel(body))) - dBodySetLinearVel(body,0.f,0.f,0.f); - if(!dV_valid(dBodyGetPosition(body))) - dBodySetPosition(body,0.f,0.f,0.f); - if(!dQ_valid(dBodyGetQuaternion(body))) - { - dQuaternion q={1.f,0.f,0.f,0.f};//dQSetIdentity(q); - dBodySetQuaternion(body,q); - } - } -} \ No newline at end of file diff --git a/src/xrGame/PHIsland.h b/src/xrGame/PHIsland.h deleted file mode 100644 index e67abd36d30..00000000000 --- a/src/xrGame/PHIsland.h +++ /dev/null @@ -1,253 +0,0 @@ -#ifndef PH_ISLAND_H -#define PH_ISLAND_H - -#pragma warning(disable:4995) -#pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/objects.h" -#include "../3rd party/ode/ode/src/joint.h" -#pragma warning(default:4995) -#pragma warning(default:4267) -#include "PhysicsCommon.h" - - -class CPHIslandFlags -{ - static const int base = 8 ; - static const int shift_to_variable = base/2 ; - static const int mask_static = 0xf ; - Flags8 flags ; - - enum - { - stActive = 1<<0, - flPrefereExactIntegration = 1<<1 - }; -public: - - CPHIslandFlags () {init();} - - IC void init () {flags.zero();flags.set(stActive,TRUE);unmerge();} - IC BOOL is_active () {return flags.test(stActive<m_nb; -} -IC bool IsJointGroun() -{ - return nj>m_nj; -} -IC bool CheckSize() -{ - return njnj; -} - -IC int MaxBodies(CPHIsland* island) -{ - return BODIES_LIMIT-nb-island->nb; -} - -IC bool CanMerge(CPHIsland* island,int& MAX_JOINTS) -{ - MAX_JOINTS=MaxJoints(island); - return MAX_JOINTS>0 && ((nb+island->nb)m_flags.is_active()) m_self_active=m_self_active->m_self_active; -} -IC void Merge(CPHIsland* island) -{ - //VERIFY2(b_active&&island->b_active,"no active island"); - CPHIsland* first_island=DActiveIsland(); - CPHIsland* second_island=island->DActiveIsland(); - if(first_island==second_island)return; - - *(second_island->m_joints_tail)=first_island->firstjoint; - first_island->firstjoint=second_island->firstjoint; - if(0==first_island->nj&&0!=second_island->nj) - { - first_island->m_joints_tail=second_island->m_joints_tail; - } - - *(second_island->m_bodies_tail)=first_island->firstbody; - first_island->firstbody=second_island->firstbody; - - first_island->nj+=second_island->nj; - first_island->nb+=second_island->nb; - VERIFY(!(*(first_island->m_bodies_tail))); - VERIFY(!(*(first_island->m_joints_tail))); - VERIFY(!((!(first_island->nj))&&(first_island->firstjoint))); - second_island->m_self_active=first_island; - //second_island->b_active=false; - m_flags.merge(second_island->m_flags); -} -IC void Unmerge() -{ - firstjoint=m_first_joint; - firstbody=m_first_body; - if(!m_nj) - { - m_joints_tail=&firstjoint; - *m_joints_tail=0; - } - else - { - firstjoint->tome=(dObject**)&firstjoint; - } - *m_joints_tail=0; - *m_bodies_tail=0; - //b_active=true; - m_flags.unmerge(); - m_self_active=this; - nj=m_nj; - nb=m_nb; - -} -IC void Init() -{ - //b_active=true; - m_flags.init(); - m_nj=nj=0; - m_nb=nb=0; - m_first_joint=firstjoint=0; - m_first_body=firstbody=0; - m_joints_tail=&firstjoint; - m_bodies_tail=&firstbody; - m_self_active=this; -} -IC void AddBody(dxBody* body) -{ - VERIFY2(m_nj==nj&&m_nb==nb&& m_flags.is_active(),"can not remove/add during processing phase"); - dWorldAddBody(DWorld(),body); - m_first_body=body; - if(m_nb==0) - { - m_bodies_tail=(dxBody**)&body->next; - } - m_nb++; -} -IC void RemoveBody(dxBody* body) -{ - VERIFY2(m_nj==nj&&m_nb==nb && m_flags.is_active() ,"can not remove/add during processing phase"); - if(m_first_body==body)m_first_body=(dxBody*)body->next; - if(m_bodies_tail==(dxBody**)(&(body->next))) - { - m_bodies_tail=(dxBody**)body->tome; - } - dWorldRemoveBody((dxWorld*)this,body); - m_nb--; -} -IC void AddJoint(dxJoint* joint) -{ - VERIFY2(m_nj==nj&&m_nb==nb&&m_flags.is_active(),"can not remove/add during processing phase"); - dWorldAddJoint(DWorld(),joint); - m_first_joint=joint; - if(!m_nj) - { - VERIFY(joint->next==0); - m_joints_tail=(dxJoint**)(&(joint->next)); - - } - m_nj++; -} - -IC void ConnectJoint(dxJoint* joint) -{ - if(!nj) - { - m_joints_tail=(dxJoint**)(&(joint->next)); - VERIFY(!firstjoint); - } - dWorldAddJoint(DWorld(),joint); - VERIFY(!(*(m_joints_tail))); -} - -IC void DisconnectJoint(dxJoint* joint) -{ - dWorldRemoveJoint(DWorld(),joint); -} - -IC void ConnectBody(dxBody* body) -{ - dWorldAddBody(DWorld(),body); -} -IC void DisconnectBody(dxBody* body) -{ - dWorldRemoveBody(DWorld(),body); -} -IC void RemoveJoint(dxJoint* joint) -{ - VERIFY2(m_nj==nj&&m_nb==nb&&m_flags.is_active(),"can not remove/add during processing phase"); - if(m_first_joint==joint) - m_first_joint=(dxJoint*)joint->next; - if(m_joints_tail==(dxJoint**)(&(joint->next))) - { - m_joints_tail=(dxJoint**)joint->tome; - } - dWorldRemoveJoint(DWorld(),joint); - VERIFY(!*(m_joints_tail)); - m_nj--; -} -void SetPrefereExactIntegration(){m_flags.set_prefere_exact_integration();} -void Step(dReal step); -void Enable(); -void Repair(); -protected: -private: -}; -#endif \ No newline at end of file diff --git a/src/xrGame/PHItemList.h b/src/xrGame/PHItemList.h deleted file mode 100644 index ac857c4fb49..00000000000 --- a/src/xrGame/PHItemList.h +++ /dev/null @@ -1,103 +0,0 @@ -#ifndef PH_ITEM_LIST_H -#define PH_ITEM_LIST_H -/* -#define DECLARE_PHLIST_ITEM(class_name) public:\ - class CPHListItem\ - {\ - friend class CPHItemList;\ - friend class CPHItemList::iterator;\ - class_name* next;\ - class_name** tome;\ - };\ - private: -*/ -#define DECLARE_PHLIST_ITEM(class_name) friend class CPHItemList;\ - friend class CPHItemList::iterator;\ - class_name* next;\ - class_name** tome; -#define DECLARE_PHSTACK_ITEM(class_name) DECLARE_PHLIST_ITEM(class_name)\ - friend class CPHItemStack;\ - u16 stack_pos; - -//#define TPI(item) ((T::CPHListItem*)item) - -template - class CPHItemList - { - T *first_next ; - T **last_tome ; - protected: - u16 size ; - - public: - - class iterator; - typedef class iterator - { - - T *my_ptr; - public: - iterator(){my_ptr=0;} - iterator(T* i){ my_ptr=i; } - iterator operator ++ () {return my_ptr=((my_ptr)->next);} - T* operator * () {return my_ptr;} - bool operator != (iterator right){return my_ptr!=right.my_ptr;} - }; - CPHItemList () { empty();} - u16 count () {return size;} - void push_back (T* item) - { - *(last_tome)=item; - item->tome= last_tome; - last_tome=&((item)->next); - item->next=0; - size++; - } - void move_items (CPHItemList& sourse_list) - { - if(!sourse_list.first_next) return; - *(last_tome)=sourse_list.first_next; - sourse_list.first_next->tome= last_tome; - last_tome=sourse_list.last_tome; - size=size+sourse_list.size; - sourse_list.empty(); - } - void erase (iterator i) - { - T* item=*i; - T* next=item->next; - *(item->tome)=next; - if(next)next->tome=item->tome; - else last_tome=item->tome; - size--; - } - void empty () - { - last_tome=&first_next; - first_next=0; - size=0; - } - iterator begin() - { - return iterator(first_next); - } - iterator end() - { - return iterator(0); - } - }; - -template - class CPHItemStack : - public CPHItemList - { - public: - void push_back (T* item) - { - item->stack_pos=size; - CPHItemList::push_back(item); - } - }; -#define DEFINE_PHITEM_LIST(T,N,I) typedef CPHItemList N; typedef CPHItemList::iterator I; -#define DEFINE_PHITEM_STACK(T,N,I) typedef CPHItemStack N; typedef CPHItemStack::iterator I; -#endif diff --git a/src/xrGame/PHJoint.cpp b/src/xrGame/PHJoint.cpp deleted file mode 100644 index a6e396855fd..00000000000 --- a/src/xrGame/PHJoint.cpp +++ /dev/null @@ -1,1281 +0,0 @@ -#include "StdAfx.h" -#include "PHDynamicData.h" -#include "Physics.h" -#include "tri-colliderknoopc/dTriList.h" -#include "PHJointDestroyInfo.h" -/////////////////////////////////////////////////////////////// -///#pragma warning(disable:4995) -////#include "../xrEngine/ode/src/collision_kernel.h" -//#include <../ode/src/joint.h> -//#include <../ode/src/objects.h> - -//#pragma warning(default:4995) -/////////////////////////////////////////////////////////////////// - -#include "ExtendedGeom.h" - -#include "PHElement.h" -#include "PHJoint.h" -#include "PHShell.h" - -const float hinge2_spring=20000.f; -const float hinge2_damping=1000.f; - -IC dBodyID body_for_joint(CPhysicsElement* e) -{ - return e->isFixed() ? 0 : e->get_body();//return e->get_body();// -} -IC void SwapLimits(float &lo,float &hi) -{ - float t=-lo; - lo=-hi; - hi=t; -} -CPHJoint::~CPHJoint(){ - xr_delete(m_destroy_info); - VERIFY(!bActive); - axes.clear(); - if(m_back_ref)*m_back_ref=NULL; -}; - -void CPHJoint::SetBackRef(CPhysicsJoint** j) -{ - R_ASSERT2(*j==static_cast(this),"wronng reference"); - m_back_ref=j; -} -void CPHJoint::CreateBall() -{ - - m_joint=dJointCreateBall(0,0); - Fvector pos; - Fmatrix first_matrix,second_matrix; - CPHElement* first=(pFirst_element); - CPHElement* second=(pSecond_element); - - VERIFY(first&&second); - first->GetGlobalTransformDynamic(&first_matrix); - second->GetGlobalTransformDynamic(&second_matrix); -pos.set(0,0,0); - switch(vs_anchor){ -case vs_first :first_matrix.transform_tiny(pos,anchor); break; -case vs_second:second_matrix.transform_tiny(pos,anchor); break; -case vs_global:pShell->mXFORM.transform_tiny(pos,anchor);break; -default:NODEFAULT; - } - - - - dJointAttach(m_joint,body_for_joint(first),body_for_joint(second)); - dJointSetBallAnchor(m_joint,pos.x,pos.y,pos.z); - -} - - - -void CPHJoint::CreateHinge() -{ - - m_joint=dJointCreateHinge(0,0); - - Fvector pos; - Fmatrix first_matrix,second_matrix; - Fvector axis; - - - CPHElement* first=(pFirst_element); - CPHElement* second=(pSecond_element); - VERIFY(first&&second); - first->GetGlobalTransformDynamic(&first_matrix); - second->GetGlobalTransformDynamic(&second_matrix); - -pos.set(0,0,0); -switch(vs_anchor) -{ -case vs_first :first_matrix.transform_tiny(pos,anchor); break; -case vs_second:second_matrix.transform_tiny(pos,anchor); break; -case vs_global:pShell->mXFORM.transform_tiny(pos,anchor);break; -default:NODEFAULT; -} - - - axis.set(0,0,0); - - first_matrix.invert(); - - Fmatrix rotate; - rotate.mul(first_matrix,second_matrix); - - float hi,lo; - CalcAxis(0,axis,lo,hi,first_matrix,second_matrix,rotate); - dBodyID b1=body_for_joint(first);if(!b1)axis.invert();//SwapLimits(lo,hi); - dJointAttach(m_joint,b1,body_for_joint(second)); - - dJointSetHingeAnchor(m_joint,pos.x,pos.y,pos.z); - dJointSetHingeAxis(m_joint,axis.x,axis.y,axis.z); - - dJointSetHingeParam(m_joint,dParamLoStop ,lo); - dJointSetHingeParam(m_joint,dParamHiStop ,hi); - if(axes[0].force>0.f){ - dJointSetHingeParam(m_joint,dParamFMax ,axes[0].force); - dJointSetHingeParam(m_joint,dParamVel ,axes[0].velocity); - } - dJointSetHingeParam(m_joint,dParamStopERP ,axes[0].erp); - dJointSetHingeParam(m_joint,dParamStopCFM ,axes[0].cfm); - - dJointSetHingeParam(m_joint,dParamCFM ,m_cfm); -} - - -void CPHJoint::CreateHinge2() -{ - - m_joint=dJointCreateHinge2(0,0); - - Fvector pos; - Fmatrix first_matrix,second_matrix; - Fvector axis; - CPHElement* first=(pFirst_element); - CPHElement* second=(pSecond_element); - VERIFY(first&&second); - first->GetGlobalTransformDynamic(&first_matrix); - second->GetGlobalTransformDynamic(&second_matrix); - pos.set(0,0,0); - switch(vs_anchor) - { - case vs_first :first_matrix.transform_tiny(pos,anchor); break; - case vs_second:second_matrix.transform_tiny(pos,anchor); break; - case vs_global:pShell->mXFORM.transform_tiny(pos,anchor);break; - default:NODEFAULT; - } - ////////////////////////////////////// - - dBodyID b1=body_for_joint(first); - dJointAttach(m_joint,b1,body_for_joint(second)); - dJointSetHinge2Anchor(m_joint,pos.x,pos.y,pos.z); - - ///////////////////////////////////////////// - - Fmatrix first_matrix_inv; - first_matrix_inv.set(first_matrix); - first_matrix_inv.invert(); - Fmatrix rotate; - - rotate.mul(first_matrix_inv,second_matrix); - ///////////////////////////////////////////// - - float lo; - float hi; - ////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////// - axis.set(0,0,0); - CalcAxis(0,axis,lo,hi,first_matrix,second_matrix,rotate); - if(!b1)axis.invert();//SwapLimits(lo,hi); - dJointSetHinge2Axis1 (m_joint, axis.x, axis.y, axis.z); - - - dJointSetHinge2Param(m_joint,dParamLoStop ,lo); - dJointSetHinge2Param(m_joint,dParamHiStop ,hi); - - if(!(axes[0].force<0.f)){ - dJointSetHinge2Param(m_joint,dParamFMax,axes[0].force); - dJointSetHinge2Param(m_joint,dParamVel ,axes[0].velocity); - } - - CalcAxis(1,axis,lo,hi,first_matrix,second_matrix,rotate); - - dJointSetHinge2Axis2 (m_joint, axis.x, axis.y, axis.z); - - dJointSetHinge2Param(m_joint,dParamLoStop2 ,lo); - dJointSetHinge2Param(m_joint,dParamHiStop2 ,hi); - if(!(axes[1].force<0.f)){ - dJointSetHinge2Param(m_joint,dParamFMax2 ,axes[1].force); - dJointSetHinge2Param(m_joint,dParamVel2 ,axes[1].velocity); - } - ////////////////////////////////////////////////////////////////// - - dJointSetHinge2Param(m_joint, dParamSuspensionERP, m_erp); - dJointSetHinge2Param(m_joint, dParamSuspensionCFM, m_cfm); - //dJointSetHinge2Param(m_joint, dParamStopERP, 1.f); - //dJointSetHinge2Param(m_joint, dParamStopCFM,0.f); - dJointSetHinge2Param(m_joint, dParamStopERP,axes[0].erp); - dJointSetHinge2Param(m_joint, dParamStopCFM,axes[0].cfm); -} -void CPHJoint::CreateSlider() -{ - Fvector pos; - Fmatrix first_matrix,second_matrix; - Fvector axis; - CPHElement* first=(pFirst_element); - CPHElement* second=(pSecond_element); - - VERIFY(first); - first->GetGlobalTransformDynamic(&first_matrix); - dBodyID body1=body_for_joint(first); - VERIFY(second); - second->GetGlobalTransformDynamic(&second_matrix); - dBodyID body2=body_for_joint(second); - - - pos.set(0,0,0); - switch(vs_anchor){ - case vs_first :first_matrix.transform_tiny(pos,anchor); break; - case vs_second:second_matrix.transform_tiny(pos,anchor); break; - case vs_global:pShell->mXFORM.transform_tiny(pos,anchor);break; - default:NODEFAULT; - } - ////////////////////////////////////// - - - m_joint=dJointCreateSlider(0,0); - dJointAttach(m_joint,body1,body2); - if (body1) - { - axes[0].vs=vs_first; - axes[1].vs=vs_first; - } - else - if (body2) - { - axes[0].vs=vs_second; - axes[1].vs=vs_second; - } - - - - m_joint1=dJointCreateAMotor(0,0); - dJointSetAMotorMode (m_joint1, dAMotorEuler); - dJointSetAMotorNumAxes (m_joint1, 1); - - dJointAttach(m_joint1,body1,body2); - - ///////////////////////////////////////////// - - Fmatrix first_matrix_inv; - first_matrix_inv.set(first_matrix); - first_matrix_inv.invert(); - Fmatrix rotate; - rotate.mul(first_matrix_inv,second_matrix); - ///////////////////////////////////////////// - - float lo; - float hi; - ////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////// - axis.set(0,0,0); - //axis 0 - CalcAxis(0,axis,lo,hi,first_matrix,second_matrix,rotate); - //if(body1)axis.invert();//SwapLimits(lo,hi);!!! - - dJointSetSliderAxis(m_joint, -axis.x, -axis.y, -axis.z); - - dJointSetSliderParam( m_joint, dParamLoStop, axes[0].low ); - dJointSetSliderParam( m_joint, dParamHiStop, axes[0].high ); - - if(!(axes[0].force<0.f)){ - dJointSetSliderParam( m_joint,dParamFMax, axes[0].force ); - dJointSetSliderParam( m_joint,dParamVel, axes[0].velocity ); - } - dJointSetSliderParam( m_joint, dParamStopERP ,axes[0].erp ); - dJointSetSliderParam( m_joint, dParamStopCFM ,axes[0].cfm ); - - //axis 1 - - CalcAxis(1,axis,lo,hi,first_matrix,second_matrix,rotate); - if(!body1)axis.invert();//SwapLimits(lo,hi); - int rel = body1 ? 1 : 2; - dJointSetAMotorAxis (m_joint1, 0,rel, axis.x, axis.y, axis.z); - dJointSetAMotorParam(m_joint1,dParamLoStop ,lo); - dJointSetAMotorParam(m_joint1,dParamHiStop ,hi); - if(!(axes[1].force<0.f)){ - dJointSetAMotorParam(m_joint1,dParamFMax ,axes[1].force); - dJointSetAMotorParam(m_joint1,dParamVel ,axes[1].velocity); - } - - - - dJointSetAMotorParam(m_joint1,dParamStopERP ,axes[1].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM ,axes[1].cfm); - - - ///////////////////////////////////////////////////////////////////// - ///dJointSetAMotorParam(m_joint1,dParamFudgeFactor ,0.1f); - //dJointSetAMotorParam(m_joint1,dParamFudgeFactor2 ,0.1f); - //dJointSetAMotorParam(m_joint1,dParamFudgeFactor3 ,0.1f); - ///////////////////////////////////////////////////////////////////////////// - dJointSetAMotorParam(m_joint1,dParamCFM ,m_cfm); - dJointSetSliderParam(m_joint,dParamCFM,m_cfm); -} - -#ifdef ODE_SLOW_SOLVER -#define FIX_BY_ONE_HINGE -#endif -void CPHJoint::CreateFullControl() -{ - - - Fvector pos; - Fmatrix first_matrix,second_matrix; - Fvector axis; - CPHElement* first=(pFirst_element); - CPHElement* second=(pSecond_element); - VERIFY(first); - first->GetGlobalTransformDynamic(&first_matrix); - dBodyID body1=body_for_joint(first); - VERIFY(second); - second->GetGlobalTransformDynamic(&second_matrix); - dBodyID body2=body_for_joint(second); - - - - -pos.set(0,0,0); -switch(vs_anchor){ -case vs_first :first_matrix.transform_tiny(pos,anchor); break; -case vs_second:second_matrix.transform_tiny(pos,anchor); break; -case vs_global:pShell->mXFORM.transform_tiny(pos,anchor);break; -default:NODEFAULT; - } - ////////////////////////////////////// - - - - m_joint=dJointCreateBall(0,0); - dJointAttach(m_joint,body1,body2); - dJointSetBallAnchor(m_joint,pos.x,pos.y,pos.z); - - - - m_joint1=dJointCreateAMotor(0,0); - dJointSetAMotorMode (m_joint1, dAMotorEuler); - dJointSetAMotorNumAxes (m_joint1, 3); - - dJointAttach(m_joint1,body1,body2); - - ///////////////////////////////////////////// - - Fmatrix first_matrix_inv; - first_matrix_inv.set(first_matrix); - first_matrix_inv.invert(); - Fmatrix rotate; - rotate.mul(first_matrix_inv,second_matrix); - ///////////////////////////////////////////// - - float lo; - float hi; - ////////////////////////////////////////////////////////// - ///////////////////////////////////////////////////////// - axis.set(0,0,0); - //axis 0 - CalcAxis(0,axis,lo,hi,first_matrix,second_matrix,rotate); - if(!body1)axis.invert();//SwapLimits(lo,hi); - dJointSetAMotorAxis (m_joint1, 0, 1, axis.x, axis.y, axis.z); - dJointSetAMotorParam(m_joint1,dParamLoStop ,lo); - dJointSetAMotorParam(m_joint1,dParamHiStop ,hi); - - if(!(axes[0].force<0.f)){ - dJointSetAMotorParam(m_joint1,dParamFMax ,axes[0].force); - dJointSetAMotorParam(m_joint1,dParamVel ,axes[0].velocity); - } - - //axis 1 - CalcAxis(1,axis,lo,hi,first_matrix,second_matrix,rotate); - if(!body1)axis.invert();//SwapLimits(lo,hi); - dJointSetAMotorParam(m_joint1,dParamLoStop2 ,lo); - dJointSetAMotorParam(m_joint1,dParamHiStop2 ,hi); - if(!(axes[1].force<0.f)){ - dJointSetAMotorParam(m_joint1,dParamFMax2 ,axes[1].force); - dJointSetAMotorParam(m_joint1,dParamVel2 ,axes[1].velocity); - } - - //axis 2 - CalcAxis(2,axis,lo,hi,first_matrix,second_matrix,rotate); - if(!body1)axis.invert();//SwapLimits(lo,hi); - dJointSetAMotorAxis (m_joint1, 2, 2, axis.x, axis.y, axis.z); - dJointSetAMotorParam(m_joint1,dParamLoStop3 ,lo); - dJointSetAMotorParam(m_joint1,dParamHiStop3 ,hi); - if(!(axes[2].force<0.f)){ - dJointSetAMotorParam(m_joint1,dParamFMax3 ,axes[2].force); - dJointSetAMotorParam(m_joint1,dParamVel3 ,axes[2].velocity); - } - - dJointSetAMotorParam(m_joint1,dParamStopERP ,axes[0].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM ,axes[0].cfm); - - dJointSetAMotorParam(m_joint1,dParamStopERP2 ,axes[1].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM2 ,axes[1].cfm); - - dJointSetAMotorParam(m_joint1,dParamStopERP3 ,axes[2].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM3 ,axes[2].cfm); -///////////////////////////////////////////////////////////////////// - ///dJointSetAMotorParam(m_joint1,dParamFudgeFactor ,0.1f); - //dJointSetAMotorParam(m_joint1,dParamFudgeFactor2 ,0.1f); - //dJointSetAMotorParam(m_joint1,dParamFudgeFactor3 ,0.1f); -///////////////////////////////////////////////////////////////////////////// - dJointSetAMotorParam(m_joint1,dParamCFM ,m_cfm); - dJointSetAMotorParam(m_joint1,dParamCFM2 ,m_cfm); - dJointSetAMotorParam(m_joint1,dParamCFM3 ,m_cfm); -} - - -void CPHJoint::SetAnchor(const float x,const float y,const float z) -{ - vs_anchor=vs_global; - anchor.set(x,y,z); -} - -void CPHJoint::SetAnchorVsFirstElement(const float x,const float y,const float z) -{ - vs_anchor=vs_first; - anchor.set(x,y,z); -} - -void CPHJoint::SetAnchorVsSecondElement(const float x,const float y,const float z) -{ - vs_anchor=vs_second; - anchor.set(x,y,z); -} - -void CPHJoint::SetAxisDir(const float x,const float y,const float z,const int axis_num) -{ - int ax=axis_num; - LimitAxisNum(ax); - if(-1==ax) return; - axes[ax].vs=vs_global; - axes[ax].direction.set(x,y,z); -} - -void CPHJoint::SetAxisDirVsFirstElement(const float x,const float y,const float z,const int axis_num) -{ - int ax=axis_num; - LimitAxisNum(ax); - if(-1==ax) return; - axes[ax].vs=vs_first; - axes[ax].direction.set(x,y,z); -} - -void CPHJoint::SetAxisDirVsSecondElement(const float x,const float y,const float z,const int axis_num) -{ - int ax=axis_num; - LimitAxisNum(ax); - if(-1==ax) return; - axes[ax].vs=vs_second; - axes[ax].direction.set(x,y,z); - -} - -void CPHJoint::SetLimits(const float low, const float high, const int axis_num) -{ - if(!(pFirst_element&&pSecond_element))return; - - int ax=axis_num; - LimitAxisNum(ax); - if(-1==ax)return; - - Fvector axis; - switch(axes[ax].vs){ - case vs_first :pFirst_element->mXFORM.transform_dir(axis,axes[ax].direction); break; - case vs_second:pSecond_element->mXFORM.transform_dir(axis,axes[ax].direction); break; - case vs_global: - default: axis.set(axes[ax].direction); - } - - axes[ax].low=low; - axes[ax].high=high; - Fmatrix m1,m2; - m1.set(pFirst_element->mXFORM); - m1.invert(); - m2.mul(m1,pSecond_element->mXFORM); - //m2.mul(pSecond_element->mXFORM,m1); - - - - float zer; - //axis_angleB(m2,axis,zer); - axis_angleA(m2,axes[ax].direction,zer); - - axes[ax].zero=zer; - //m2.invert(); - //axes[ax].zero_transform.set(m2); - if(bActive)SetLimitsActive(axis_num); -} - - -CPHJoint::CPHJoint(CPhysicsJoint::enumType type ,CPhysicsElement* first,CPhysicsElement* second) -{ - - pShell=NULL; - m_bone_id=u16(-1); - m_back_ref =NULL; - m_destroy_info=NULL; - pFirstGeom =NULL; - pFirst_element=cast_PHElement(first); - pSecond_element=cast_PHElement(second); - m_joint=NULL; - m_joint1=NULL; - eType=type; - bActive=false; - -#ifndef ODE_SLOW_SOLVER - m_erp=world_erp; - m_cfm=world_cfm; -#else - m_erp=world_erp; - m_cfm=world_cfm; -#endif - - SPHAxis axis,axis2,axis3; - axis2.set_direction(1,0,0); - axis3.direction.crossproduct(axis.direction,axis3.direction); - vs_anchor=vs_first; - - switch(eType){ - case ball: ; break; - case hinge: axes.push_back(axis); - break; - case hinge2: - axes.push_back(axis); - axes.push_back(axis2); - break; - case full_control: - axes.push_back(axis); - axes.push_back(axis2); - axes.push_back(axis3); - case slider: - axes.push_back(axis); - axes.push_back(axis); - } - -} - -void CPHJoint::SetLimitsVsFirstElement(const float low, const float high,const int axis_num) -{ -} - -void CPHJoint::SetLimitsVsSecondElement(const float low, const float high,const int axis_num) -{ -} - -void CPHJoint::Create() -{ - if(bActive) return; - switch(eType){ - case ball: CreateBall(); break; - case hinge: CreateHinge(); break; - case hinge2: CreateHinge2(); break; - case full_control: CreateFullControl(); break; - case slider: CreateSlider(); break; - } - if(m_destroy_info) - { - dJointSetFeedback(m_joint,m_destroy_info->JointFeedback()); - if(m_joint1)dJointSetFeedback(m_joint1,m_destroy_info->JointFeedback()); - } - dJointSetData(m_joint,(void*)this); - if(m_joint1)dJointSetData(m_joint1,(void*)this); - bActive=true; -} -void CPHJoint::RunSimulation() -{ - pShell->Island().AddJoint(m_joint); - ///dWorldAddJoint(phWorld,m_joint); - if(m_joint1) - { - //dWorldAddJoint(phWorld,m_joint1); - pShell->Island().AddJoint(m_joint1); - } -} -void CPHJoint::Activate() -{ - Create(); - RunSimulation(); -} -void CPHJoint::Deactivate() -{ - if(!bActive) return; - switch(eType){ - case ball: ; - case hinge: ; - case hinge2: ; - if(m_joint->world)pShell->Island().RemoveJoint(m_joint); - dJointDestroy(m_joint); - break; - case full_control: - case slider: - if(m_joint->world)pShell->Island().RemoveJoint(m_joint); - if(m_joint1->world)pShell->Island().RemoveJoint(m_joint1); - dJointDestroy(m_joint); - dJointDestroy(m_joint1); - m_joint1=NULL; - break; - } - m_joint=NULL; - bActive=false; -} -void CPHJoint::ReattachFirstElement(CPHElement* new_element) -{ - Deactivate(); - pFirst_element=(new_element); - Activate(); - //dJointAttach(m_joint,pFirst_element->get_body(),pSecond_element->get_body()); - //if(m_joint1)dJointAttach(m_joint1,pFirst_element->get_body(),pSecond_element->get_body()); -} -void CPHJoint::SetForceAndVelocity (const float force,const float velocity,const int axis_num) -{ - if(pShell&&pShell->isActive())pShell->Enable(); - SetForce(force,axis_num); - SetVelocity(velocity,axis_num); -} - -void CPHJoint::GetMaxForceAndVelocity(float &force,float &velocity,int axis_num) -{ - force=axes[axis_num].force; - velocity=axes[axis_num].velocity; -} - - -void CPHJoint::SetForce (const float force,const int axis_num){ - int ax; - ax=axis_num; - LimitAxisNum(ax); - - if(ax==-1) - switch(eType){ - case ball: return; - case hinge: - axes[0].force=force; - break; - case hinge2: ; - case slider: ; - axes[0].force=force; - axes[1].force=force; - break; - case full_control: - axes[0].force=force; - axes[1].force=force; - axes[2].force=force; - break; - } - - else{ - axes[ax].force=force; - } - - if(bActive) - { - SetForceActive(ax); - } -} - - -void CPHJoint::SetForceActive (const int axis_num) -{ - switch(eType){ - - case hinge2:switch(axis_num) - { - case -1: - dJointSetHinge2Param(m_joint,dParamFMax ,axes[0].force); - dJointSetHinge2Param(m_joint,dParamFMax2 ,axes[1].force); - case 0: dJointSetHinge2Param(m_joint,dParamFMax ,axes[0].force);break; - case 1: dJointSetHinge2Param(m_joint,dParamFMax2 ,axes[1].force);break; - } - break; - case slider:switch(axis_num) - { - case -1: - dJointSetSliderParam(m_joint,dParamFMax ,axes[0].force); - dJointSetAMotorParam(m_joint1,dParamFMax ,axes[1].force); - case 0: dJointSetSliderParam(m_joint,dParamFMax ,axes[0].force);break; - case 1: dJointSetAMotorParam(m_joint1,dParamFMax ,axes[1].force);break; - } - break; - case ball: break; - case hinge: dJointSetHingeParam(m_joint,dParamFMax ,axes[0].force); - break; - - - - case full_control: - switch(axis_num){ - case -1: - dJointSetAMotorParam(m_joint1,dParamFMax ,axes[0].force); - dJointSetAMotorParam(m_joint1,dParamFMax2 ,axes[1].force); - dJointSetAMotorParam(m_joint1,dParamFMax3 ,axes[2].force); - case 0:dJointSetAMotorParam(m_joint1,dParamFMax ,axes[0].force);break; - case 1:dJointSetAMotorParam(m_joint1,dParamFMax2 ,axes[1].force);break; - case 2:dJointSetAMotorParam(m_joint1,dParamFMax3 ,axes[2].force);break; - } - break; - } -} - -void CPHJoint::SetVelocity (const float velocity,const int axis_num){ - int ax; - ax=axis_num; - LimitAxisNum(ax); - - - if(ax==-1) - switch(eType){ - case ball: return; - case hinge: - axes[0].velocity=velocity; - break; - case hinge2: ; - case slider: ; - axes[0].velocity=velocity; - axes[1].velocity=velocity; - break; - case full_control: - axes[0].velocity=velocity; - axes[1].velocity=velocity; - axes[2].velocity=velocity; - break; - } - - else{ - axes[ax].velocity=velocity; - } - - if(bActive) - { - SetVelocityActive(ax); - } -} - -void CPHJoint::SetVelocityActive(const int axis_num) -{ - switch(eType){ - - case hinge2:switch(axis_num) - { - case -1: - dJointSetHinge2Param(m_joint,dParamVel ,axes[0].velocity); - dJointSetHinge2Param(m_joint,dParamVel2 ,axes[1].velocity); - case 0: dJointSetHinge2Param(m_joint,dParamVel ,axes[0].velocity);break; - case 1: dJointSetHinge2Param(m_joint,dParamVel2 ,axes[1].velocity);break; - } - break; - case slider:switch(axis_num) - { - case -1: - dJointSetSliderParam(m_joint,dParamVel ,axes[0].velocity); - dJointSetAMotorParam(m_joint1,dParamVel ,axes[1].velocity); - case 0: dJointSetSliderParam(m_joint,dParamVel ,axes[0].velocity);break; - case 1: dJointSetAMotorParam(m_joint1,dParamVel ,axes[1].velocity);break; - } - break; - case ball: break; - case hinge: dJointSetHingeParam(m_joint,dParamVel ,axes[0].velocity); - break; - - - - case full_control: - switch(axis_num){ - case -1: - dJointSetAMotorParam(m_joint1,dParamVel ,axes[0].velocity); - dJointSetAMotorParam(m_joint1,dParamVel2 ,axes[1].velocity); - dJointSetAMotorParam(m_joint1,dParamVel3 ,axes[2].velocity); - case 0:dJointSetAMotorParam(m_joint1,dParamVel ,axes[0].velocity);break; - case 1:dJointSetAMotorParam(m_joint1,dParamVel2 ,axes[1].velocity);break; - case 2:dJointSetAMotorParam(m_joint1,dParamVel3 ,axes[2].velocity);break; - } - break; - } -} - -void CPHJoint::SetLimitsActive(int axis_num) -{ - switch(eType){ - - case hinge2: - switch(axis_num) - { - case -1: - case 0: - case 1: - dJointSetHinge2Param(m_joint,dParamLoStop ,axes[0].low); - dJointSetHinge2Param(m_joint,dParamHiStop,axes[0].high);break; - } - break; - case slider:switch(axis_num) - { - case -1: - dJointSetSliderParam(m_joint,dParamLoStop ,axes[0].low); - dJointSetSliderParam(m_joint,dParamHiStop ,axes[0].high); - dJointSetAMotorParam(m_joint1,dParamLoStop ,axes[1].low); - dJointSetAMotorParam(m_joint1,dParamHiStop ,axes[1].high); - case 0: dJointSetSliderParam(m_joint,dParamLoStop ,axes[0].low); - dJointSetSliderParam(m_joint,dParamHiStop ,axes[0].high);break; - case 1: dJointSetAMotorParam(m_joint1,dParamLoStop ,axes[1].low); - dJointSetAMotorParam(m_joint1,dParamHiStop ,axes[1].high);break; - } - break; - case ball: break; - case hinge: dJointSetHingeParam(m_joint,dParamLoStop ,axes[0].low); - dJointSetHingeParam(m_joint,dParamHiStop ,axes[0].high); - break; - - - - case full_control: - switch(axis_num){ - case -1: - dJointSetAMotorParam(m_joint1,dParamLoStop ,axes[0].low); - dJointSetAMotorParam(m_joint1,dParamLoStop ,axes[0].low); - dJointSetAMotorParam(m_joint1,dParamLoStop2 ,axes[1].low); - dJointSetAMotorParam(m_joint1,dParamHiStop2 ,axes[1].high); - dJointSetAMotorParam(m_joint1,dParamHiStop3 ,axes[2].high); - dJointSetAMotorParam(m_joint1,dParamHiStop3 ,axes[2].high); - case 0:dJointSetAMotorParam(m_joint1,dParamLoStop ,axes[0].low); - dJointSetAMotorParam(m_joint1,dParamHiStop ,axes[0].high); - break; - case 1:dJointSetAMotorParam(m_joint1,dParamLoStop2 ,axes[1].low); - dJointSetAMotorParam(m_joint1,dParamHiStop2 ,axes[1].high); - break; - case 2:dJointSetAMotorParam(m_joint1,dParamLoStop3 ,axes[2].low); - dJointSetAMotorParam(m_joint1,dParamHiStop3 ,axes[2].high); - break; - } - break; - } -} - -float CPHJoint::GetAxisAngle(int axis_num) -{ - float ret=dInfinity; - switch(eType){ - case hinge2: ret= dJointGetHinge2Angle1(m_joint);break; - case ball: ret= dInfinity;break; - case hinge: ret= dJointGetHingeAngle(m_joint);break; - case full_control: ret= dJointGetAMotorAngle(m_joint1,axis_num);break; - case slider: - switch (axis_num){ - case 0: ret= dJointGetSliderPosition(m_joint);break; - case 1: ret= dJointGetAMotorAngle(m_joint1,0);break; - };break; - } - return ret;// body_for_joint(pFirst_element) ? ret : - -} -void CPHJoint::LimitAxisNum(int &axis_num) -{ - if(axis_num<-1) - { - axis_num=-1; - return; - } - - switch(eType){ - case ball: axis_num=-1; - break; - case hinge: axis_num=0; - break; - case slider: - case hinge2: axis_num= axis_num>1 ? 1 : axis_num; - break; - - case full_control: axis_num= axis_num>2 ? 2 : axis_num; - break; - - } - -} - -void CPHJoint::SetAxis(const SPHAxis& axis,const int axis_num) -{ -int ax=axis_num; -LimitAxisNum(ax); -if(ax==-1) - switch(eType){ - case ball: - break; - case hinge: - axes[0]=axis; - break; - case hinge2: ; - case slider: ; - axes[0]=axis; - axes[1]=axis; - break; - case full_control: - axes[0]=axis; - axes[1]=axis; - axes[2]=axis; - break; - } -else - axes[ax]=axis; -} - -void CPHJoint::SetAxisSDfactors(float spring_factor,float damping_factor,int axis_num) - -{ - int ax=axis_num; - LimitAxisNum(ax); - if(ax==-1) - { - switch(eType){ - case ball: - break; - case hinge: - axes[0].set_sd_factors(spring_factor,damping_factor,eType); - break; - case hinge2: ; - case slider: ; - axes[0].set_sd_factors(spring_factor,damping_factor,eType); - axes[1].set_sd_factors(spring_factor,damping_factor,eType); - break; - - case full_control: - axes[0].set_sd_factors(spring_factor,damping_factor,eType); - axes[1].set_sd_factors(spring_factor,damping_factor,eType); - axes[2].set_sd_factors(spring_factor,damping_factor,eType); - break; - } - - if(bActive)SetLimitsSDfactorsActive(); - } - else - { - axes[ax].set_sd_factors(spring_factor,damping_factor,eType); - if(bActive)SetAxisSDfactorsActive(ax); - } -} - - -void CPHJoint::SetJointSDfactors(float spring_factor,float damping_factor) -{ - switch(eType){ - case hinge2: - m_cfm=CFM(hinge2_spring*spring_factor,hinge2_damping*damping_factor); - m_erp=ERP(hinge2_spring*spring_factor,hinge2_damping*damping_factor); - break; - case ball: ; - case hinge: ; - case full_control: ; - case slider: ; - m_erp=ERP(world_spring*spring_factor,world_damping*damping_factor); - m_cfm=CFM(world_spring*spring_factor,world_damping*damping_factor); - break; - } - if(bActive) SetJointSDfactorsActive(); -} - -void CPHJoint::SetJointSDfactorsActive() -{ - switch(eType){ - case hinge2: dJointSetHinge2Param(m_joint, dParamSuspensionERP, m_erp); - dJointSetHinge2Param(m_joint, dParamSuspensionCFM, m_cfm); break ; - case ball: break ; - case hinge: dJointSetHingeParam(m_joint,dParamCFM ,m_cfm); break ; - case full_control: dJointSetAMotorParam(m_joint1,dParamCFM ,m_cfm); - dJointSetAMotorParam(m_joint1,dParamCFM2 ,m_cfm); - dJointSetAMotorParam(m_joint1,dParamCFM3 ,m_cfm); break ; - case slider: dJointSetSliderParam(m_joint,dParamCFM ,m_cfm); break ; - } -} -void CPHJoint::SetLimitsSDfactorsActive() -{ - switch(eType){ - case hinge2: dJointSetHinge2Param(m_joint, dParamStopERP,axes[0].erp); - dJointSetHinge2Param(m_joint, dParamStopCFM,axes[0].cfm); break ; - case ball: break ; - case hinge: dJointSetHingeParam(m_joint,dParamStopERP ,axes[0].erp); - dJointSetHingeParam(m_joint,dParamStopCFM ,axes[0].cfm); break ; - case full_control: dJointSetAMotorParam(m_joint1,dParamStopERP ,axes[0].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM ,axes[0].cfm); - dJointSetAMotorParam(m_joint1,dParamStopERP2 ,axes[1].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM2 ,axes[1].cfm); - dJointSetAMotorParam(m_joint1,dParamStopERP3 ,axes[2].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM3 ,axes[2].cfm); break ; - case slider: dJointSetSliderParam(m_joint,dParamStopERP,axes[0].erp); - dJointSetSliderParam(m_joint,dParamStopCFM,axes[0].cfm); - dJointSetAMotorParam(m_joint1,dParamStopERP ,axes[1].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM ,axes[1].cfm); break ; - - } -} -void CPHJoint::SetAxisSDfactorsActive(int axis_num) -{ - LimitAxisNum(axis_num); - - switch(eType){ - case hinge2: dJointSetHinge2Param(m_joint, dParamStopERP,axes[0].erp); - dJointSetHinge2Param(m_joint, dParamStopCFM,axes[0].cfm); - break ; - case ball: break ; - case hinge: dJointSetHingeParam(m_joint,dParamStopERP ,axes[0].erp); - dJointSetHingeParam(m_joint,dParamStopCFM ,axes[0].cfm); - break ; - case full_control: switch(axis_num) - { - case 0: - dJointSetAMotorParam(m_joint1,dParamStopERP ,axes[axis_num].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM ,axes[0].cfm); - break; - case 1: - dJointSetAMotorParam(m_joint1,dParamStopERP2 ,axes[1].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM2 ,axes[1].cfm); - break; - case 2: - dJointSetAMotorParam(m_joint1,dParamStopERP3 ,axes[2].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM3 ,axes[2].cfm); - break; - } - break; - case slider: switch(axis_num) - { - case 0: - dJointSetSliderParam(m_joint,dParamStopERP,axes[0].erp); - dJointSetSliderParam(m_joint,dParamStopCFM,axes[0].cfm); - case 1: - dJointSetAMotorParam(m_joint1,dParamStopERP ,axes[1].erp); - dJointSetAMotorParam(m_joint1,dParamStopCFM ,axes[1].cfm); - } - break ; - - - } -} -void CPHJoint::GetJointSDfactors(float& spring_factor,float& damping_factor) -{ -spring_factor =SPRING(m_cfm,m_erp); -damping_factor=DAMPING(m_cfm,m_erp); -if(eType==hinge2) - { - spring_factor/=hinge2_spring; - damping_factor/=hinge2_damping; - } -else - { - spring_factor/=world_spring; - damping_factor/=world_damping; - } -} -void CPHJoint::GetAxisSDfactors(float& spring_factor,float& damping_factor,int axis_num) -{ - LimitAxisNum(axis_num); - spring_factor=SPRING(axes[axis_num].cfm,axes[axis_num].erp)/world_spring; - damping_factor=DAMPING(axes[axis_num].cfm,axes[axis_num].erp)/world_damping; -} -u16 CPHJoint::GetAxesNumber() -{ - return u16(axes.size()); -} -void CPHJoint::CalcAxis(int ax_num,Fvector& axis, float& lo,float& hi,const Fmatrix& first_matrix,const Fmatrix& second_matrix,const Fmatrix& rotate) -{ - switch(axes[ax_num].vs) - { - case vs_first :first_matrix.transform_dir(axis,axes[ax_num].direction) ; break; - case vs_second:second_matrix.transform_dir(axis,axes[ax_num].direction) ; break; - case vs_global:pShell->mXFORM.transform_dir(axis,axes[ax_num].direction);break; - default: NODEFAULT; - } - lo=axes[ax_num].low; - hi=axes[ax_num].high; - if(lo<-M_PI){ - hi-=(lo+M_PI); - lo=-M_PI; - } - if(lo>0.f) { - hi-=lo; - lo=0.f; - } - if(hi>M_PI) { - lo-=(hi-M_PI); - hi=M_PI; - } - if(hi<0.f) { - lo-=hi; - hi=0.f; - } -} - -void CPHJoint::CalcAxis(int ax_num,Fvector& axis,float& lo,float& hi,const Fmatrix& first_matrix,const Fmatrix& second_matrix) -{ - switch(axes[ax_num].vs) - { - - case vs_first :first_matrix.transform_dir(axis,axes[ax_num].direction); break; - case vs_second:second_matrix.transform_dir(axis,axes[ax_num].direction); break; - case vs_global:pShell->mXFORM.transform_dir(axis,axes[ax_num].direction);break; - default: NODEFAULT; - } - - - Fmatrix inv_first_matrix; - inv_first_matrix.set(first_matrix); - inv_first_matrix.invert(); - - Fmatrix rotate; - rotate.mul(inv_first_matrix,second_matrix); - - float shift_angle; - axis_angleA(rotate,axes[ax_num].direction,shift_angle); - - shift_angle-=axes[ax_num].zero; - - if(shift_angle>M_PI) shift_angle-=2.f*M_PI; - if(shift_angle<-M_PI) shift_angle+=2.f*M_PI; - - - lo=axes[ax_num].low;//+shift_angle; - hi=axes[ax_num].high;//+shift_angle; - if(lo<-M_PI){ - hi-=(lo+M_PI); - lo=-M_PI; - } - if(lo>0.f) { - hi-=lo; - lo=0.f; - } - if(hi>M_PI) { - lo-=(hi-M_PI); - hi=M_PI; - } - if(hi<0.f) { - lo-=hi; - hi=0.f; - } - - -} - -void CPHJoint::GetLimits (float& lo_limit,float& hi_limit,int axis_num) -{ - LimitAxisNum(axis_num); - if( body_for_joint(pFirst_element)) - { - - lo_limit=axes[axis_num].low; - hi_limit=axes[axis_num].high; - }else - { - lo_limit=-axes[axis_num].high; - hi_limit=-axes[axis_num].low; - } -} - - -void CPHJoint::GetAxisDir(int num, Fvector& axis, eVs& vs) -{ -LimitAxisNum(num); -vs=axes[num].vs; -axis.set(axes[num].direction); -} - -void CPHJoint::GetAxisDirDynamic(int num,Fvector& axis) -{ - LimitAxisNum(num); - dVector3 result; - switch(eType) - { - - case ball: ; - return; - case hinge: dJointGetHingeAxis (m_joint,result); - break; - case hinge2: if(num) dJointGetHinge2Axis2 (m_joint,result); - else dJointGetHinge2Axis1 (m_joint,result); - break; - case full_control: dJointGetAMotorAxis (m_joint1,num,result); - break; - case slider: dJointGetSliderAxis(m_joint,result); - - } - axis.set(result[0],result[1],result[2]); -} - -void CPHJoint::GetAnchorDynamic(Fvector& anchor) -{ - - dVector3 result; - switch(eType) - { - case hinge: dJointGetHingeAnchor (m_joint,result); - break; - case hinge2: dJointGetHingeAnchor (m_joint,result); - break; - case ball: ; - case full_control: dJointGetBallAnchor (m_joint,result); - break; - case slider: R_ASSERT2(false,"position of slider joint is undefinite"); - } - anchor.set(result[0],result[1],result[2]); -} - -CPHJoint::SPHAxis::SPHAxis(){ - high=dInfinity; - low=-dInfinity; - zero=0.f; - //erp=ERP(world_spring/5.f,world_damping*5.f); - //cfm=CFM(world_spring/5.f,world_damping*5.f); -#ifndef ODE_SLOW_SOLVER - erp=world_erp; - cfm=world_cfm; -#else - erp=0.3f; - cfm=0.000001f; -#endif - direction.set(0,0,1); - vs=vs_first; - force=0.f; - velocity=0.f; -} - -void CPHJoint::SPHAxis::set_sd_factors(float sf,float df,enumType jt) -{ - switch(jt) - { - case hinge2: -#ifndef ODE_SLOW_SOLVER - cfm=0.f; - erp=1.f; - break; -#endif - case ball: ; - case hinge: ; - case full_control: ; - case slider: ; - erp=ERP(world_spring*sf,world_damping*df); - cfm=CFM(world_spring*sf,world_damping*df); - break; - } -} -CPhysicsElement* CPHJoint::PFirst_element() -{ - return cast_PhysicsElement(pFirst_element); -} -CPhysicsElement* CPHJoint::PSecond_element() -{ - return cast_PhysicsElement(pSecond_element); -} -void CPHJoint::SetBreakable(float force,float torque) -{ - if(!m_destroy_info) m_destroy_info=xr_new(force,torque); -} - -void CPHJoint::SetShell(CPHShell* p) -{ - if(!m_joint||!pShell) - { - pShell=p; - return; - } - if(pShell!=p) - { - pShell->Island().RemoveJoint(m_joint); - p->Island().AddJoint(m_joint); - if(m_joint1) - { - pShell->Island().RemoveJoint(m_joint1); - p->Island().AddJoint(m_joint1); - } - pShell=p; - } -} -void CPHJoint::ClearDestroyInfo() -{ - xr_delete(m_destroy_info); -} \ No newline at end of file diff --git a/src/xrGame/PHJoint.h b/src/xrGame/PHJoint.h deleted file mode 100644 index f5b8ac3e989..00000000000 --- a/src/xrGame/PHJoint.h +++ /dev/null @@ -1,238 +0,0 @@ -///////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////// -#ifndef PH_JOINT -#define PH_JOINT -#include "PhysicsShell.h" -class CPHJointDestroyInfo; -class CPHJoint: public CPhysicsJoint{ -/////////////////////////////////////////////////////// - u16 m_bone_id ; - CPHElement *pFirst_element ; - CPHElement *pSecond_element ; - CODEGeom *pFirstGeom ; - ///////////////////////////////////////////////////////// - CPHShell *pShell ; - dJointID m_joint ; - dJointID m_joint1 ; - CPhysicsJoint **m_back_ref ; - CPHJointDestroyInfo *m_destroy_info ; - float m_erp ; //joint erp - float m_cfm ; //joint cfm -/////////////////////////////////////////////////////////////////////////////////////////////////////////////// - struct SPHAxis { - float high ; //high limit - float low ; //law limit - float zero ; //zero angle position - float erp ; //limit erp - float cfm ; //limit cfm - eVs vs ; //coordinate system - float force ; //max force - float velocity ; //velocity to achieve - Fvector direction ; //axis direction - IC void set_limits (float h, float l) {high=h; low=l ;} - IC void set_direction (const Fvector& v) {direction.set(v) ;} - IC void set_direction (const float x,const float y,const float z) {direction.set(x,y,z) ;} - IC void set_param (const float e,const float c) {erp=e;cfm=c ;} - void set_sd_factors (float sf,float df,enumType jt) ; - SPHAxis (); - }; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////// - xr_vector axes ; - Fvector anchor ; - eVs vs_anchor ; -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - void CreateBall () ; - void CreateHinge () ; - void CreateHinge2 () ; - void CreateFullControl () ; - void CreateSlider () ; - void LimitAxisNum (int &axis_num) ; - void SetForceActive (const int axis_num) ; - void SetVelocityActive (const int axis_num) ; - void SetLimitsActive (int axis_num) ; - void CalcAxis (int ax_num,Fvector& axis,float& lo,float& hi,const Fmatrix& first_matrix,const Fmatrix& second_matrix) ; - void CalcAxis (int ax_num,Fvector& axis,float& lo,float& hi,const Fmatrix& first_matrix,const Fmatrix& second_matrix,const Fmatrix& rotate) ; - virtual u16 GetAxesNumber () ; - virtual void SetAxisSDfactors (float spring_factor,float damping_factor,int axis_num) ; - virtual void SetJointSDfactors (float spring_factor,float damping_factor) ; - virtual void SetJointSDfactorsActive () ; - virtual void SetLimitsSDfactorsActive () ; - virtual void SetAxisSDfactorsActive (int axis_num) ; - virtual void SetAxis (const SPHAxis& axis,const int axis_num) ; - virtual void SetAnchor (const Fvector& position) {SetAnchor(position.x,position.y,position.z);} - virtual void SetAnchorVsFirstElement (const Fvector& position) {SetAnchorVsFirstElement(position.x,position.y,position.z) ;} - virtual void SetAnchorVsSecondElement (const Fvector& position) {SetAnchorVsSecondElement(position.x,position.y,position.z) ;} -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetAxisDir (const Fvector& orientation,const int axis_num) {SetAxisDir(orientation.x,orientation.y,orientation.z,axis_num) ;} - virtual void SetAxisDirVsFirstElement (const Fvector& orientation,const int axis_num) {SetAxisDirVsFirstElement(orientation.x,orientation.y,orientation.z,axis_num) ;} - virtual void SetAxisDirVsSecondElement (const Fvector& orientation,const int axis_num) {SetAxisDirVsSecondElement(orientation.x,orientation.y,orientation.z,axis_num) ;} -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetLimits (const float low,const float high,const int axis_num) ; - virtual void SetLimitsVsFirstElement (const float low,const float high,const int axis_num) ; - virtual void SetLimitsVsSecondElement (const float low,const float high,const int axis_num) ; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetAnchor (const float x,const float y,const float z) ; - virtual void SetAnchorVsFirstElement (const float x,const float y,const float z) ; - virtual void SetAnchorVsSecondElement (const float x,const float y,const float z) ; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetAxisDir (const float x,const float y,const float z,const int axis_num) ; - virtual void SetAxisDirVsFirstElement (const float x,const float y,const float z,const int axis_num) ; - virtual void SetAxisDirVsSecondElement (const float x,const float y,const float z,const int axis_num) ; -public: - virtual CPhysicsElement *PFirst_element () ; - virtual CPhysicsElement *PSecond_element () ; - virtual u16 BoneID () {return m_bone_id ;} - virtual void SetBoneID (u16 bone_id) {m_bone_id=bone_id ;} -IC CPHElement *PFirstElement () {return pFirst_element ;} -IC CPHElement *PSecondElement () {return pSecond_element ;} - virtual void Activate () ; - virtual void Create () ; - virtual void RunSimulation () ; - virtual void SetBackRef (CPhysicsJoint **j) ; - virtual void SetForceAndVelocity (const float force,const float velocity=0.f,const int axis_num=-1) ; - virtual void SetForce (const float force,const int axis_num=-1) ; - virtual void SetVelocity (const float velocity=0.f,const int axis_num=-1) ; - virtual void SetBreakable (float force, float torque) ; - virtual bool isBreakable () {return !!m_destroy_info;} - virtual dJointID GetDJoint () {return m_joint ;} - virtual dJointID GetDJoint1 () {return m_joint1 ;} - virtual void GetLimits (float& lo_limit,float& hi_limit,int axis_num) ; - virtual void GetAxisDir (int num,Fvector& axis,eVs& vs) ; - virtual void GetAxisDirDynamic (int num,Fvector& axis) ; - virtual void GetAnchorDynamic (Fvector& anchor) ; - virtual void GetAxisSDfactors (float& spring_factor,float& damping_factor,int axis_num) ; - virtual void GetJointSDfactors (float& spring_factor,float& damping_factor) ; - virtual void GetMaxForceAndVelocity (float &force,float &velocity,int axis_num) ; - virtual float GetAxisAngle (int axis_num) ; - virtual void Deactivate () ; - void ReattachFirstElement (CPHElement* new_element) ; - CODEGeom *&RootGeom () {return pFirstGeom ;} - virtual CPHJointDestroyInfo *JointDestroyInfo () {return m_destroy_info ;} - CPHJoint (CPhysicsJoint::enumType type ,CPhysicsElement* first,CPhysicsElement* second) ; - virtual ~CPHJoint () ; - void SetShell (CPHShell* p) ; - - void ClearDestroyInfo (); - -}; - - - - - - -/////////////////////////////////////////////////////////////////////////////////////////////////// -IC void own_axis(const Fmatrix& m,Fvector& axis){ - if(m._11==1.f) {axis.set(1.f,0.f,0.f); return;} - float k=m._13*m._21-m._11*m._23+m._23; - - if(k==0.f){ - if(m._13==0.f) {axis.set(0.f,0.f,1.f);return;} - float k1=m._13/(1.f-m._11); - axis.z=_sqrt(1.f/(1.f+k1*k1)); - axis.x=axis.z*k1; - axis.y=0.f; - return; - } - - float k_zy=-(m._12*m._21-m._11*m._22+m._11+m._22-1.f)/k; - float k_xy=(m._12+m._13*k_zy)/(1.f-m._11); - axis.y=_sqrt(1.f/(k_zy*k_zy+k_xy*k_xy+1.f)); - axis.x=axis.y*k_xy; - axis.z=axis.y*k_zy; - return; -} - - - -IC void own_axis_angle(const Fmatrix& m,Fvector& axis,float& angle){ - own_axis(m,axis); - Fvector ort1,ort2; - if(!(axis.z==0.f&&axis.y==0.f)){ - ort1.set(0.f,-axis.z,axis.y); - ort2.crossproduct(axis,ort1); - } - else{ - ort1.set(0.f,1.f,0.f); - ort2.crossproduct(axis,ort1); - } - ort1.normalize(); - ort2.normalize(); - - Fvector ort1_t; - m.transform_dir(ort1_t,ort1); - - float cosinus=ort1.dotproduct(ort1_t); - float sinus=ort2.dotproduct(ort1_t); - angle=acosf(cosinus); - if(sinus<0.f) angle= -angle; - -} - -IC void axis_angleB(const Fmatrix& m, const Fvector& axis,float& angle){ - - Fvector ort1,ort2; - if(!(fis_zero(axis.z)&&fis_zero(axis.y))){ - ort1.set(0.f,-axis.z,axis.y); - ort2.crossproduct(axis,ort1); - } - else{ - ort1.set(0.f,1.f,0.f); - ort2.crossproduct(axis,ort1); - } - ort1.normalize(); - ort2.normalize(); - Fvector ort1_t; - m.transform_dir(ort1_t,ort1); - Fvector ort_r; - float pr1,pr2; - pr1=ort1.dotproduct(ort1_t); - pr2=ort2.dotproduct(ort1_t); - if(pr1==0.f&&pr2==0.f){angle=0.f;return;} - ort_r.set(pr1*ort1.x+pr2*ort2.x, - pr1*ort1.y+pr2*ort2.y, - pr1*ort1.z+pr2*ort2.z); - - ort_r.normalize(); - float cosinus=ort1.dotproduct(ort_r); - float sinus=ort2.dotproduct(ort_r); - angle=acosf(cosinus); - if(sinus<0.f) angle= -angle; -} - - - -IC void axis_angleA(const Fmatrix& m, const Fvector& axis,float& angle){ - - Fvector ort1,ort2,axis_t; - m.transform_dir(axis_t,axis); - if(!(fis_zero(axis_t.z)&&fis_zero(axis_t.y))){ - ort1.set(0.f,-axis_t.z,axis_t.y); - ort2.crossproduct(axis_t,ort1); - } - else{ - ort1.set(0.f,1.f,0.f); - ort2.crossproduct(axis_t,ort1); - } - ort1.normalize(); - ort2.normalize(); - Fvector ort1_t; - m.transform_dir(ort1_t,ort1); - Fvector ort_r; - float pr1,pr2; - pr1=ort1.dotproduct(ort1_t); - pr2=ort2.dotproduct(ort1_t); - if(pr1==0.f&&pr2==0.f){angle=0.f;return;} - ort_r.set(pr1*ort1.x+pr2*ort2.x, - pr1*ort1.y+pr2*ort2.y, - pr1*ort1.z+pr2*ort2.z); - - ort_r.normalize(); - float cosinus=ort1.dotproduct(ort_r); - float sinus=ort2.dotproduct(ort_r); - angle=acosf(cosinus); - if(sinus<0.f) angle= -angle; - //if(angle>M_PI) angle=angle-2.f*M_PI; - //if(angle<-M_PI) angle=angle+2.f*M_PI; -} -#endif \ No newline at end of file diff --git a/src/xrGame/PHJointDestroyInfo.cpp b/src/xrGame/PHJointDestroyInfo.cpp deleted file mode 100644 index 95b4fb9b49b..00000000000 --- a/src/xrGame/PHJointDestroyInfo.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "stdafx.h" -#include "PHJointDestroyInfo.h" -#include "PhysicsCommon.h" -#include "MathUtils.h" -CPHJointDestroyInfo::CPHJointDestroyInfo(float break_force,float break_torque) -{ - //m_bone_id=bone_id; - m_sq_break_force=break_force*break_force; - m_sq_break_torque=break_torque*break_torque; - dVectorSetZero(m_joint_feedback.f1); - dVectorSetZero(m_joint_feedback.f2); - dVectorSetZero(m_joint_feedback.t1); - dVectorSetZero(m_joint_feedback.t2); - m_breaked=false; -} - -bool CPHJointDestroyInfo::Update() -{ - dReal sq_breack_force=m_sq_break_force/phBreakCommonFactor; - if(dDOT(m_joint_feedback.f1,m_joint_feedback.f1)>sq_breack_force) - { - m_breaked=true; - return true; - } - if(dDOT(m_joint_feedback.f2,m_joint_feedback.f2)>sq_breack_force) - { - m_breaked=true; - return true; - } - if(dDOT(m_joint_feedback.t1,m_joint_feedback.t1)>sq_breack_force) - { - m_breaked=true; - return true; - } - if(dDOT(m_joint_feedback.t2,m_joint_feedback.t2)>sq_breack_force) - { - m_breaked=true; - return true; - } - return false; -} \ No newline at end of file diff --git a/src/xrGame/PHJointDestroyInfo.h b/src/xrGame/PHJointDestroyInfo.h deleted file mode 100644 index c627554f9dd..00000000000 --- a/src/xrGame/PHJointDestroyInfo.h +++ /dev/null @@ -1,25 +0,0 @@ -#ifndef PHJOINT_DESTROY_INFO_H -#define PHJOINT_DESTROY_INFO_H - -#include "ode_include.h" - -class CPHJointDestroyInfo -{ -friend class CPHShellSplitterHolder; -friend class CPHShell; -dJointFeedback m_joint_feedback; -float m_sq_break_force; -float m_sq_break_torque; -u16 m_end_element; -u16 m_end_joint; -bool m_breaked; -public: - CPHJointDestroyInfo (float break_force,float break_torque); -IC dJointFeedback* JointFeedback (){return &m_joint_feedback;} - -IC bool Breaked (){return m_breaked;}; - bool Update (); -}; - - -#endif PHJOINT_DESTROY_INFO_H \ No newline at end of file diff --git a/src/xrGame/PHMoveStorage.cpp b/src/xrGame/PHMoveStorage.cpp deleted file mode 100644 index c0c15f67730..00000000000 --- a/src/xrGame/PHMoveStorage.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "stdafx.h" -#include "phmovestorage.h" -#pragma warning(disable:4995) -#pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/collision_kernel.h" -#pragma warning(default:4995) -#pragma warning(default:4267) -struct dxGeomTransform : public dxGeom { - dxGeom *obj; // object that is being transformed - int cleanup; // 1 to destroy obj when destroyed - int infomode; // 1 to put Tx geom in dContactGeom g1 - - // cached final object transform (body tx + relative tx). this is set by - // computeAABB(), and it is valid while the AABB is valid. - dVector3 final_pos; - dMatrix3 final_R; - dxGeomTransform::dxGeomTransform (dSpaceID space) : dxGeom (space,1) - { - type = dGeomTransformClass; - obj = 0; - cleanup = 0; - infomode = 0; - dSetZero (final_pos,4); - dRSetIdentity (final_R); - } -}; -void CPHPositionsPairs::Positions(const Fvector* &p0,const Fvector* &p1) -{ - CODEGeom *g=*geom; - if(g->is_transformed_bt()) - { - g->geometry_transform()->recomputeAABB(); - p0=(const Fvector*)dGeomGetUserData(g->geom())->last_pos; - p1=(const Fvector*)((dxGeomTransform*)g->geometry_transform())->final_pos; - } - else - { - p1=(const Fvector*)dGeomGetPosition(g->geometry_transform()); - p0=(const Fvector*)dGeomGetUserData(g->geometry_transform())->last_pos; - } - -} \ No newline at end of file diff --git a/src/xrGame/PHMoveStorage.h b/src/xrGame/PHMoveStorage.h deleted file mode 100644 index 169199f5286..00000000000 --- a/src/xrGame/PHMoveStorage.h +++ /dev/null @@ -1,55 +0,0 @@ -#ifndef PHMOVESTORAGE_H -#define PHMOVESTORAGE_H -#include "phgeometryowner.h" -//DEFINE_VECTOR(dReal *&,POSITIONS_STORAGE,POSITIONS_I); - -class CPHPositionsPairs -{ - GEOM_I geom; -public: - CPHPositionsPairs(GEOM_I i) - { - geom=i; - } - void Positions(const Fvector *&p0,const Fvector *&p1); - IC CPHPositionsPairs& operator ++ () - { - ++geom; - return *this; - } - IC dGeomID dGeom() - { - return (*geom)->geometry_transform(); - } - IC CPHPositionsPairs& operator ++ (int) - { - geom++; - return *this; - } - IC CPHPositionsPairs& operator = (const CPHPositionsPairs& right) - { - geom=right.geom; - } - IC bool operator == (const CPHPositionsPairs& right ) const - { - return geom==right.geom; - } - IC bool operator != (const CPHPositionsPairs& right ) const - { - return geom!=right.geom; - } -}; - -class CPHMoveStorage -{ - GEOM_STORAGE m_trace_geometries; -public: - typedef CPHPositionsPairs iterator; - IC iterator begin () {return CPHPositionsPairs(m_trace_geometries.begin());} - IC iterator end () {return CPHPositionsPairs(m_trace_geometries.end());} - IC bool empty ()const {return m_trace_geometries.empty();} - void add (CODEGeom* g) {m_trace_geometries.push_back(g);} - void clear () {m_trace_geometries.clear();} -}; - -#endif \ No newline at end of file diff --git a/src/xrGame/PHMovementControl.cpp b/src/xrGame/PHMovementControl.cpp index 9d5fa24ac3f..2108842599b 100644 --- a/src/xrGame/PHMovementControl.cpp +++ b/src/xrGame/PHMovementControl.cpp @@ -2,7 +2,7 @@ #include "phmovementcontrol.h" #include "xrCDB/Intersect.hpp" -#include "../xrserverentities/alife_space.h" +#include "xrServerEntities/alife_space.h" //#include "entity.h" //#include "PHDynamicData.h" @@ -11,19 +11,19 @@ //#include "PHAICharacter.h" //#include "PHActorCharacter.h" -#include "../xrphysics/phCharacter.h" -#include "../xrphysics/IPHCapture.h" -#include "../xrphysics/iphysicsshellholder.h" -#include "../xrphysics/ElevatorState.h" -#include "../xrphysics/CalculateTriangle.h" -#include "../xrphysics/Icolisiondamageinfo.h" -#include "../xrphysics/phvalide.h" -#include "../xrphysics/physicsshell.h" -#include "../xrphysics/iphworld.h" -//#include "../xrserverentities/ai_space.h" +#include "xrPhysics/phCharacter.h" +#include "xrPhysics/IPHCapture.h" +#include "xrPhysics/iphysicsshellholder.h" +#include "xrPhysics/ElevatorState.h" +#include "xrPhysics/CalculateTriangle.h" +#include "xrPhysics/Icolisiondamageinfo.h" +#include "xrPhysics/phvalide.h" +#include "xrPhysics/physicsshell.h" +#include "xrPhysics/iphworld.h" +//#include "xrServerEntities/ai_space.h" #include "detail_path_manager.h" #include "xrEngine/GameMtlLib.h" -#include "../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" #include "CaptureBoneCallback.h" #include "Level.h" #include "physicsshellholder.h" @@ -31,8 +31,8 @@ #include "phdebug.h" #endif -//#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/Kinematics.h" +//#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" #define GROUND_FRICTION 10.0f #define AIR_FRICTION 0.01f @@ -264,7 +264,7 @@ void CPHMovementControl::UpdateCollisionDamage( ) #include #include -#include "../xrCore/_vector3d_ext.h" +#include "xrCore/_vector3d_ext.h" bool CPHMovementControl::MakeJumpPath(xr_vector & out_path, u32 & travel_point, diff --git a/src/xrGame/PHMovementControl.h b/src/xrGame/PHMovementControl.h index a6f76da4048..d74c5158dd3 100644 --- a/src/xrGame/PHMovementControl.h +++ b/src/xrGame/PHMovementControl.h @@ -2,11 +2,11 @@ #ifndef CPHMOVEMENT_CONTROL_H #define CPHMOVEMENT_CONTROL_H -//#include "../xrphysics/PHCharacter.h" -//#include "../xrphysics/MathUtils.h" -#include "../xrphysics/physicsexternalcommon.h" -#include "../xrphysics/mathutils.h" -#include "../xrphysics/movementboxdynamicactivate.h" +//#include "xrPhysics/PHCharacter.h" +//#include "xrPhysics/MathUtils.h" +#include "xrPhysics/physicsexternalcommon.h" +#include "xrPhysics/mathutils.h" +#include "xrPhysics/movementboxdynamicactivate.h" namespace ALife { enum EHitType; }; diff --git a/src/xrGame/PHMovementDynamicActivate.cpp b/src/xrGame/PHMovementDynamicActivate.cpp index 7e65674f04d..204311cb51f 100644 --- a/src/xrGame/PHMovementDynamicActivate.cpp +++ b/src/xrGame/PHMovementDynamicActivate.cpp @@ -9,10 +9,10 @@ //#include "Level.h" //#include "xrCore/MaterialLib/GameMtlLib.h" //#include "IPhysicsShellHolder.h" -//#include "../xrphysics/IPHWorld.h" +//#include "xrPhysics/IPHWorld.h" //extern class CPHWorld *ph_world; -#include "../xrphysics/phcharacter.h" -#include "../xrphysics/iphysicsshellholder.h" +#include "xrPhysics/phcharacter.h" +#include "xrPhysics/iphysicsshellholder.h" bool CPHMovementControl:: ActivateBoxDynamic(DWORD id,int num_it/*=8*/,int num_steps/*5*/,float resolve_depth/*=0.01f*/) { bool character_exist=CharacterExist(); diff --git a/src/xrGame/PHObject.cpp b/src/xrGame/PHObject.cpp deleted file mode 100644 index ce8226528f6..00000000000 --- a/src/xrGame/PHObject.cpp +++ /dev/null @@ -1,258 +0,0 @@ -#include "stdafx.h" -#include "Physics.h" -#include "PHObject.h" -#include "PHWorld.h" -#include "PHMoveStorage.h" -#include "dRayMotions.h" -#include "PHCollideValidator.h" -#ifdef DEBUG -#include "phdebug.h" -#endif -extern CPHWorld* ph_world; - -CPHObject::CPHObject () : ISpatial(g_SpatialSpacePhysic) -{ - m_flags.flags = 0; - spatial.type |= STYPE_PHYSIC; - m_island.Init (); - m_check_count =0; - CPHCollideValidator::InitObject (*this); -} - -void CPHObject::activate() -{ - R_ASSERT2(dSpacedGeom(),"trying to activate destroyed or not created object!"); - if(m_flags.test(st_activated))return; - if(m_flags.test(st_freezed)) {UnFreeze();return;} - if(m_flags.test(st_recently_deactivated))remove_from_recently_deactivated(); - ph_world->AddObject(this); - vis_update_activate(); - m_flags.set(st_activated,TRUE); -} - -void CPHObject::EnableObject(CPHObject* obj) -{ - activate(); -} - -void CPHObject::deactivate() -{ - if(!m_flags.test(st_activated))return; - VERIFY2(m_island.IsActive(),"can not do it during processing"); - ph_world->RemoveObject(PH_OBJECT_I(this)); - vis_update_deactivate(); - m_flags.set(st_activated,FALSE); -} - -void CPHObject::put_in_recently_deactivated() -{ - VERIFY(!m_flags.test(st_activated)&&!m_flags.test(st_freezed)); - if(m_flags.test(st_recently_deactivated))return; - m_check_count=u8(ph_tri_clear_disable_count); - m_flags.set(st_recently_deactivated,TRUE); - ph_world->AddRecentlyDisabled(this); -} -void CPHObject::remove_from_recently_deactivated() -{ - if(!m_flags.test(st_recently_deactivated))return; - m_check_count=0; - m_flags.set(st_recently_deactivated,FALSE); - ph_world->RemoveFromRecentlyDisabled(PH_OBJECT_I(this)); -} -void CPHObject::check_recently_deactivated() -{ - if(m_check_count==0){ - ClearRecentlyDeactivated(); - remove_from_recently_deactivated(); - } - else m_check_count--; -} -void CPHObject::spatial_move() -{ - get_spatial_params(); - ISpatial::spatial_move(); - m_flags.set(st_dirty,TRUE); -} - -void CPHObject::Collide() -{ - if(m_flags.test(fl_ray_motions)) - { - CPHMoveStorage* tracers=MoveStorage(); - CPHMoveStorage::iterator I=tracers->begin(),E=tracers->end(); - for(;E!=I;I++) - { - const Fvector *from=0, *to=0; - Fvector dir; - I.Positions(from,to); - if(from->x==-dInfinity) continue; - dir.sub(*to,*from); - float magnitude=dir.magnitude(); - if(magnitudeq_ray(ph_world->r_spatial,0,STYPE_PHYSIC,*from,dir,magnitude);//|ISpatial_DB::O_ONLYFIRST -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawRayMotions)) - { - DBG_OpenCashedDraw(); - DBG_DrawLine(*from,Fvector().add(*from,Fvector().mul(dir,magnitude)),D3DCOLOR_XRGB(0,255,0)); - DBG_ClosedCashedDraw(30000); - } - -#endif - qResultVec& result=ph_world->r_spatial; - qResultIt i=result.begin(),e=result.end(); - for(;i!=e;++i) { - CPHObject* obj2=static_cast(*i); - if(obj2==this || !obj2->m_flags.test(st_dirty)) continue; - dGeomID motion_ray=ph_world->GetMotionRayGeom(); - dGeomRayMotionSetGeom(motion_ray,I.dGeom()); - dGeomRayMotionsSet(motion_ray,(const dReal*) from,(const dReal*)&dir,magnitude); - NearCallback(this,obj2,motion_ray,obj2->dSpacedGeom()); - } - } - } - CollideDynamics (); -/////////////////////////////// - if(CPHCollideValidator::DoCollideStatic(*this)) CollideStatic(dSpacedGeom(),this); - m_flags.set(st_dirty,FALSE); -} -void CPHObject:: CollideDynamics () -{ - g_SpatialSpacePhysic->q_box (ph_world->r_spatial,0,STYPE_PHYSIC,spatial.sphere.P,AABB); - qResultVec& result=ph_world->r_spatial ; - qResultIt i=result.begin(),e=result.end(); - for(;i!=e;++i) { - CPHObject* obj2=static_cast(*i); - if(obj2==this || !obj2->m_flags.test(st_dirty)) continue; - if(CPHCollideValidator::DoCollide(*this,*obj2)) NearCallback(this,obj2,dSpacedGeom(),obj2->dSpacedGeom()); - } -} -void CPHObject::reinit_single() -{ - IslandReinit (); - qResultVec& result=ph_world->r_spatial ; - qResultIt i=result.begin(),e=result.end(); - for(;i!=e;++i) - { - CPHObject* obj=static_cast(*i); - obj->IslandReinit(); - } - result.clear_not_free(); - dJointGroupEmpty(ContactGroup); - ContactFeedBacks.empty(); - ContactEffectors.empty(); -} - -void CPHObject:: step_prediction (float time) -{ - //general idea: - //perform normal step by time as local as possible for this object then return world to - //the pervious state - -} -bool CPHObject::step_single(dReal step) -{ - - CollideDynamics (); - bool ret=!m_island.IsObjGroun (); - if(ret) - { - //PhTune (step); - IslandStep (step); - reinit_single (); - //PhDataUpdate (step); - spatial_move (); - CollideDynamics (); - ret =!m_island.IsObjGroun (); - } - reinit_single (); - return ret ; -} - -void CPHObject:: step( float time ) //it is still not a true step for object because it collide the object only not subsequent collision is doing -{ - ph_world->r_spatial.clear_not_free (); - reinit_single (); - Collide (); - IslandStep ( time ); - reinit_single (); -} - -bool CPHObject:: DoCollideObj () -{ - CollideDynamics (); - bool ret=m_island.IsObjGroun (); - reinit_single(); - return ret; -} - -void CPHObject::FreezeContent() -{ - R_ASSERT(!m_flags.test(st_freezed)); - m_flags.set(st_freezed,TRUE); - m_flags.set(st_activated,FALSE); - vis_update_deactivate(); -} -void CPHObject::UnFreezeContent() -{ - R_ASSERT(m_flags.test(st_freezed)); - m_flags.set(st_freezed,FALSE); - m_flags.set(st_activated,TRUE); - vis_update_activate(); -} - -void CPHObject::spatial_register() -{ - get_spatial_params(); - ISpatial::spatial_register(); - m_flags.set(st_dirty,TRUE); -} - -void CPHObject::collision_disable() -{ - ISpatial::spatial_unregister(); -} -void CPHObject::collision_enable() -{ - ISpatial::spatial_register(); -} - -void CPHObject::Freeze() -{ - if(!m_flags.test(st_activated))return; - ph_world->RemoveObject(this); - ph_world->AddFreezedObject(this); - FreezeContent(); -} - -void CPHObject::UnFreeze() -{ - if(!m_flags.test(st_freezed)) return; - UnFreezeContent(); - ph_world->RemoveFreezedObject(this); - ph_world->AddObject(this); -} - - - -CPHUpdateObject::CPHUpdateObject() -{ - b_activated=false; -} - -void CPHUpdateObject::Activate() -{ - if(b_activated)return; - ph_world->AddUpdateObject(this); - b_activated=true; -} - -void CPHUpdateObject::Deactivate() -{ - if(!b_activated)return; - ph_world->RemoveUpdateObject(this); - b_activated=false; -} - - diff --git a/src/xrGame/PHObject.h b/src/xrGame/PHObject.h deleted file mode 100644 index 689931f58e6..00000000000 --- a/src/xrGame/PHObject.h +++ /dev/null @@ -1,149 +0,0 @@ -#pragma once -#ifndef CPHOBJECT -#define CPHOBJECT -#include "../xrEngine/ispatial.h" -#include "PHItemList.h" -#include "PHIsland.h" -typedef u32 CLClassBits; -typedef u32 CLBits; -DEFINE_VECTOR(ISpatial*,qResultVec,qResultIt) -class CPHObject; -class CPHUpdateObject; -class CPHMoveStorage; -class CPHSynchronize; -typedef void CollideCallback(CPHObject* obj1,CPHObject* obj2, dGeomID o1, dGeomID o2); -#ifdef DEBUG -class CPhysicsShellHolder; -#endif -class CPHObject : - public ISpatial -{ -#ifdef DEBUG - friend struct SPHObjDBGDraw; -#endif - DECLARE_PHLIST_ITEM(CPHObject) - - Flags8 m_flags; - - enum{ - st_activated =(1<<0), - st_freezed =(1<<1), - st_dirty =(1<<2), - st_net_interpolation =(1<<3), - fl_ray_motions =(1<<4), - st_recently_deactivated =(1<<5) - }; - - CPHIsland m_island; - CLBits m_collide_bits; - u8 m_check_count; - _flags m_collide_class_bits; - -public: - enum ECastType - { - tpNotDefinite, - tpShell, - tpCharacter, - tpStaticShell - }; -protected: - Fvector AABB; -protected: - - virtual dGeomID dSpacedGeom () =0; - virtual void get_spatial_params () =0; - virtual void spatial_register () ; - void SetRayMotions () {m_flags.set(fl_ray_motions,TRUE);} - void UnsetRayMotions () {m_flags.set(fl_ray_motions,FALSE);} - - void SetPrefereExactIntegration () {m_island.SetPrefereExactIntegration();} - - - - CPHObject* SelfPointer () {return this;} -public: - IC BOOL IsRayMotion () {return m_flags.test(fl_ray_motions);} - void IslandReinit () {m_island.Unmerge();} - void IslandStep (dReal step) {m_island.Step(step);} - void MergeIsland (CPHObject* obj) {m_island.Merge(&obj->m_island);} - CPHIsland& Island () {return m_island;} - dWorldID DActiveWorld () {return m_island.DActiveWorld();} - CPHIsland* DActiveIsland () {return m_island.DActiveIsland();} - dWorldID DWorld () {return m_island.DWorld();} - - virtual void FreezeContent () ; - virtual void UnFreezeContent () ; - virtual void EnableObject (CPHObject* obj) ; - virtual bool DoCollideObj () ; - virtual bool step_single (dReal step) ; - void reinit_single () ; - void step_prediction (float time) ; - void step (float time) ; - virtual void PhDataUpdate (dReal step) =0; - virtual void PhTune (dReal step) =0; - virtual void spatial_move () ; - virtual void InitContact (dContact* c,bool& do_collide,u16 /*material_idx_1*/,u16 /*material_idx_2*/) =0; - virtual void CutVelocity (float l_limit,float a_limit) {}; - - void Freeze () ; - void UnFreeze () ; - IC bool IsFreezed () {return !!(m_flags.test(st_freezed));} - void NetInterpolationON () {m_flags.set(st_net_interpolation,TRUE);} - void NetInterpolationOFF () {m_flags.set(st_net_interpolation,TRUE);} - bool NetInterpolation () {return !!(m_flags.test(st_net_interpolation));} - virtual u16 get_elements_number () = 0; - virtual CPHSynchronize *get_element_sync (u16 element) = 0; - //virtual void StepFrameUpdate(dReal step)=0; - - - CPHObject () ; - void activate () ; - IC bool is_active () const {return !!m_flags.test(st_activated)/*b_activated*/;} - void deactivate () ; - void put_in_recently_deactivated () ; - void remove_from_recently_deactivated() ; - void check_recently_deactivated () ; - void collision_disable () ; - void collision_enable () ; -virtual void ClearRecentlyDeactivated () {;} -virtual void Collide () ; -virtual void near_callback (CPHObject* obj) {;} -virtual void RMotionsQuery (qResultVec &res) {;} -virtual CPHMoveStorage* MoveStorage () {return NULL;} -virtual ECastType CastType (){return tpNotDefinite;} -virtual void vis_update_activate () {} -virtual void vis_update_deactivate () {} - -#ifdef DEBUG -virtual CPhysicsShellHolder *ref_object () =0; -#endif - -IC CLBits& collide_bits () {return m_collide_bits;} -IC _flags& collide_class_bits () {return m_collide_class_bits;} -IC const CLBits& collide_bits ()const {return m_collide_bits;} -IC const _flags& collide_class_bits ()const {return m_collide_class_bits;} - void CollideDynamics () ; -}; - - -class CPhysicsShell; -class CPHUpdateObject -{ - DECLARE_PHLIST_ITEM(CPHUpdateObject) - bool b_activated ; - -public: - CPHUpdateObject () ; - virtual ~CPHUpdateObject() {Deactivate();} - void Activate () ; - void Deactivate () ; -IC bool IsActive () {return b_activated;} - virtual void PhDataUpdate (dReal step) =0; - virtual void PhTune (dReal step) =0; - virtual void NetRelcase (CPhysicsShell *s) {}; -}; - -DEFINE_PHITEM_LIST(CPHObject,PH_OBJECT_STORAGE,PH_OBJECT_I) -DEFINE_PHITEM_LIST(CPHUpdateObject,PH_UPDATE_OBJECT_STORAGE,PH_UPDATE_OBJECT_I) -#endif//CPHOBJECT \ No newline at end of file diff --git a/src/xrGame/PHScriptCall.cpp b/src/xrGame/PHScriptCall.cpp index 14953e0b2ab..959d5d09327 100644 --- a/src/xrGame/PHScriptCall.cpp +++ b/src/xrGame/PHScriptCall.cpp @@ -5,7 +5,7 @@ #include "PHCommander.h" -#include "../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" /* diff --git a/src/xrGame/PHShell.cpp b/src/xrGame/PHShell.cpp deleted file mode 100644 index 0e985b6ca24..00000000000 --- a/src/xrGame/PHShell.cpp +++ /dev/null @@ -1,1878 +0,0 @@ -///////////////////////////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////////////////// -#include "StdAfx.h" -#include "PHDynamicData.h" -#include "Physics.h" -#include "tri-colliderknoopc/dTriList.h" -#include "PHShellSplitter.h" -#include "PHFracture.h" -#include "PHJointDestroyInfo.h" -#include "SpaceUtils.h" -#include "MathUtils.h" -#include "PhysicsShellHolder.h" -#include "../Include/xrRender/Kinematics.h" -#include "PHCollideValidator.h" -#include "game_object_space.h" -//#pragma warning(disable:4995) -//#pragma warning(disable:4267) -//#include "../3rd party/ode/ode/src/collision_kernel.h" -//#pragma warning(default:4995) -//#pragma warning(default:4267) -/////////////////////////////////////////////////////////////// -///#pragma warning(disable:4995) - -//#include "../3rd party/ode/ode/src/joint.h" -//#include "../3rd party/ode/ode/src/objects.h" - -//#pragma warning(default:4995) -/////////////////////////////////////////////////////////////////// - -#include "ExtendedGeom.h" -#include "PHElement.h" -#include "PHShell.h" -#include "PHCollideValidator.h" -#include "PHElementInline.h" -#include "PhysicsShellAnimator.h" - -#include -#ifdef DEBUG -#include "phdebug.h" -#endif -IC bool PhOutOfBoundaries (const Fvector& v) -{ - return v.y < phBoundaries.y1; -} -CPHShell::~CPHShell () -{ - - m_pKinematics = 0; - VERIFY(!isActive()); - - xr_vector::iterator i; - for(i=elements.begin();elements.end()!=i;++i) - xr_delete(*i); - elements.clear(); - - xr_vector::iterator j; - for(j=joints.begin();joints.end()!=j;++j) - xr_delete(*j); - joints.clear(); - if(m_spliter_holder)xr_delete(m_spliter_holder); - -} -CPHShell::CPHShell() -{ - //bActive=false; - //bActivating=false; - m_flags.assign(0); - m_flags.set(flActivating,FALSE); - m_flags.set(flActive,FALSE); - m_space=NULL; - m_pKinematics=NULL; - m_spliter_holder=NULL; - m_object_in_root.identity(); - m_active_count=0; - m_pPhysicsShellAnimatorC=NULL; -} - -void CPHShell::EnableObject(CPHObject* obj) -{ - CPHObject::activate(); - if(m_spliter_holder)m_spliter_holder->Activate(); -} -void CPHShell::DisableObject() -{ - - CPhysicsShellHolder* ref_object=(*elements.begin())->PhysicsRefObject(); -//. if (!ref_object) return; - - if (ref_object) - ref_object->on_physics_disable (); - - //InterpolateGlobalTransform(&mXFORM); - CPHObject::deactivate(); - if(m_spliter_holder)m_spliter_holder->Deactivate(); - if(m_flags.test(flRemoveCharacterCollisionAfterDisable)) - DisableCharacterCollision (); -} -void CPHShell:: DisableCharacterCollision () -{ - CPHCollideValidator::SetCharacterClassNotCollide(*this); -} -void CPHShell::Disable() -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - DisableObject(); - for( ;i!=e;++i) - { - (*i)->Disable(); - } - ClearCashedTries(); -} -void CPHShell::DisableCollision() -{ - CPHObject::collision_disable(); -} -void CPHShell::EnableCollision() -{ - CPHObject::collision_enable(); -} -void CPHShell::ReanableObject() -{ - //if(b_contacts_saved) dJointGroupEmpty(m_saved_contacts); - //b_contacts_saved=false; - -} - -void CPHShell::vis_update_activate() -{ - ++m_active_count; - CPhysicsShellHolder* ref_object=(*elements.begin())->PhysicsRefObject(); - if(ref_object&&m_active_count>0) - { - m_active_count=0; - ref_object->processing_activate(); - } -} - -void CPHShell::vis_update_deactivate() -{ - --m_active_count; - //CPhysicsShellHolder* ref_object=(*elements.begin())->PhysicsRefObject(); - //if(ref_object&&!m_flags.test(flProcessigDeactivated)) - //{ - // //ref_object->processing_deactivate(); - // m_flags.set(flProcessigDeactivate,TRUE); - //} -} -void CPHShell::setDensity(float M) -{ - ELEMENT_I i; - //float volume=0.f; - //for(i=elements.begin();elements.end() != i;++i) volume+=(*i)->get_volume(); - - for(i=elements.begin();elements.end() != i;++i) - (*i)->setDensity(M); -} - - -void CPHShell::setMass(float M){ - ELEMENT_I i; - float volume=0.f; - for(i=elements.begin();elements.end() != i;++i) volume+=(*i)->get_volume(); - - for(i=elements.begin();elements.end() != i;++i) - (*i)->setMass( - (*i)->get_volume()/volume*M - ); -} - -void CPHShell::setMass1(float M){ - ELEMENT_I i; - - - for(i=elements.begin();elements.end() != i;++i) - (*i)->setMass( - M/elements.size() - ); -} -float CPHShell::getMass() -{ - float m=0.f; - - ELEMENT_I i; - - for(i=elements.begin();elements.end() != i;++i) m+=(*i)->getMass(); - - return m; -} - -void CPHShell::get_spatial_params() -{ - spatialParsFromDGeom((dGeomID)m_space,spatial.sphere.P,AABB,spatial.sphere.R); -} - -float CPHShell::getVolume() -{ - float v=0.f; - - ELEMENT_I i; - - for(i=elements.begin();elements.end() != i;++i) v+=(*i)->getVolume(); - - return v; -} - -float CPHShell::getDensity() -{ - return getMass()/getVolume(); -} - - - - -void CPHShell::PhDataUpdate(dReal step){ - - ELEMENT_I i=elements.begin(),e=elements.end(); - bool disable=true; - for(; e!=i ;++i) - { - (*i)->PhDataUpdate(step); - dBodyID body=(*i)->get_body(); - if(body&&disable&&dBodyIsEnabled(body)) - disable=false; - } - if(disable) - { - DisableObject(); - CPHObject::put_in_recently_deactivated(); - } - else - ReanableObject(); -#if 0 - DBG_OpenCashedDraw(); - dbg_draw_velocity ( 0.1f, D3DCOLOR_XRGB( 255, 0, 0 ) ); - dbg_draw_force ( 0.1f, D3DCOLOR_XRGB( 0, 0, 255 ) ); - DBG_ClosedCashedDraw( 10000 ); - //dbg_draw_geometry -#endif - if(PhOutOfBoundaries(cast_fv(dBodyGetPosition((*elements.begin())->get_body())))) - Disable(); - -} - - - -void CPHShell::PhTune(dReal step){ - ELEMENT_I i=elements.begin(),e=elements.end(); - for(; e!=i ;++i) - (*i)->PhTune(step); -} - -void CPHShell::Update(){ - if(!isActive()) return; - if(m_flags.test(flActivating)) m_flags.set(flActivating,FALSE); - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - (*i)->Update(); - - mXFORM.set((*elements.begin())->mXFORM); - VERIFY2(_valid(mXFORM),"invalid position in update"); -} - -void CPHShell::Freeze() -{ - CPHObject::Freeze(); -} -void CPHShell::UnFreeze() -{ - CPHObject::UnFreeze(); -} -void CPHShell::FreezeContent() -{ - - CPHObject::FreezeContent(); - ELEMENT_I i=elements.begin(),e=elements.end(); - for(; e!=i ;++i) - (*i)->Freeze(); - -} -void CPHShell::UnFreezeContent() -{ - CPHObject::UnFreezeContent(); - ELEMENT_I i=elements.begin(),e=elements.end(); - for(; e!=i ;++i) - (*i)->UnFreeze(); - -} -void CPHShell:: applyForce (const Fvector& dir, float val) -{ - if(!isActive()) return; - ELEMENT_I i=elements.begin(),e=elements.end(); - val/=getMass(); - for(; e!=i ;++i) - (*i)->applyForce( dir, val*(*i)->getMass()); - EnableObject(0); -}; -void CPHShell:: applyForce (float x,float y,float z) -{ -Fvector dir;dir.set(x,y,z); -float val=dir.magnitude(); - if(!fis_zero(val)) - { - dir.mul(1.f/val); - applyForce(dir,val); - } -}; -void CPHShell:: applyImpulse (const Fvector& dir, float val) -{ - if(!isActive()) return; - (*elements.begin())->applyImpulse ( dir, val); - EnableObject(0); -}; -void CPHShell:: applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val){ - if(!isActive()) return; - (*elements.begin())->applyImpulseTrace ( pos, dir, val, 0); - EnableObject(0); -} - -void CPHShell:: applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val,const u16 id){ - if(!isActive()) return; - VERIFY(m_pKinematics); - CBoneInstance& instance=m_pKinematics->LL_GetBoneInstance (id); - if(instance.callback_type()!=bctPhysics || !instance.callback_param()) return; - - ((CPhysicsElement*)instance.callback_param())->applyImpulseTrace ( pos, dir, val, id); - EnableObject(0); -} - -CPhysicsElement* CPHShell::get_Element (const shared_str & bone_name) -{ - VERIFY(m_pKinematics); - return get_Element(m_pKinematics->LL_BoneID(bone_name)); -} -CPhysicsElement* CPHShell::get_Element (LPCSTR bone_name) -{ - return get_Element((const shared_str&)(bone_name)); -} -CPhysicsElement* CPHShell::get_ElementByStoreOrder(u16 num) -{ - R_ASSERT2(num(elements[element]); -} - -CPhysicsElement* CPHShell::get_PhysicsParrentElement( u16 bone_id ) -{ - VERIFY( PKinematics() ); - CPhysicsElement* E = get_Element( bone_id ); - u16 bid = bone_id; - while( !E && bid != PKinematics()->LL_GetBoneRoot() ) - { - CBoneData &bd = PKinematics()->LL_GetData( bid ); - bid = bd.GetParentID(); - E = get_Element( bid ); - } - return E; -} - -CPhysicsElement* CPHShell::get_Element( u16 bone_id ) -{ - if(m_pKinematics&& isActive()) - { - CBoneInstance& instance=m_pKinematics->LL_GetBoneInstance (bone_id); - if(instance.callback()==BonesCallback||instance.callback()==StataticRootBonesCallBack) - { - return (instance.callback_type()==bctPhysics)?(CPhysicsElement*)instance.callback_param():NULL; - } - } - - ELEMENT_I i=elements.begin(),e=elements.end(); - for(; e!=i ;++i) - if((*i)->m_SelfID==bone_id) - return (CPhysicsElement*)(*i); - return NULL; -} - -CPhysicsJoint* CPHShell::get_Joint(u16 bone_id) -{ - JOINT_I i= joints.begin(),e=joints.end(); - for(;e!=i;i++) - if((*i)->BoneID()==bone_id) - return (CPhysicsJoint*)(*i); - return NULL; -} -CPhysicsJoint* CPHShell::get_Joint(const shared_str &bone_name) -{ - VERIFY(m_pKinematics); - return get_Joint(m_pKinematics->LL_BoneID(bone_name)); -} - -CPhysicsJoint* CPHShell::get_Joint(LPCSTR bone_name) -{ - return get_Joint((const shared_str&)bone_name); -} - -CPhysicsJoint* CPHShell::get_JointByStoreOrder (u16 num) -{ - return (CPhysicsJoint*) joints[num]; -} - -u16 CPHShell::get_JointsNumber () -{ - return u16(joints.size()); -} - -void CPHShell:: update_root_transforms () -{ - u16 anim_root = PKinematics()->LL_GetBoneRoot(); - u16 phys_root = root_element().m_SelfID; - VERIFY( BI_NONE != anim_root ); - VERIFY( BI_NONE != phys_root ); - - if( anim_root == phys_root ) - { - mXFORM.set( root_element().mXFORM ); - return; - } - - - //Fmatrix anim_root_transform = PKinematics()->LL_GetBindTransform( anim_root ); - - -} - -void CPHShell:: BonesCallback ( CBoneInstance* B ){ - ///CPHElement* E = smart_cast (static_cast(B->Callback_Param)); - - CPHElement* E = cast_PHElement( B->callback_param() ); - //if( E == &root_element() ) - //{ - - //} - E->BonesCallBack(B); - R_ASSERT2( _valid(B->mTransform), "CPHShell:: BonesCallback" ); -} - - -void CPHShell::StataticRootBonesCallBack (CBoneInstance* B){ - ///CPHElement* E = smart_cast (static_cast(B->Callback_Param)); - - CPHElement* E = cast_PHElement(B->callback_param()); - E->StataticRootBonesCallBack(B); -} - - -void CPHShell::SetTransform (const Fmatrix& m0){ - - mXFORM.set(m0); - ELEMENT_I i=elements.begin(); - for( ;elements.end() != i; ++i) - { - (*i)->SetTransform(m0); - } - spatial_move(); -} - - -void CPHShell::Enable() -{ - if(!isActive()) - return; - - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - //if(dBodyIsEnabled((*i)->get_body())) return; - for( ;i!=e;++i) - (*i)->Enable(); - EnableObject(0); -} - -void CPHShell::set_PhysicsRefObject (CPhysicsShellHolder* ref_object) -{ - - - if(elements.empty()) return; - if((*elements.begin())->PhysicsRefObject()==ref_object) return; - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - { - (*i)->set_PhysicsRefObject(ref_object); - } - - - -} - - - -void CPHShell::set_ContactCallback(ContactCallbackFun* callback) -{ - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - (*i)->set_ContactCallback(callback); -} - - -void CPHShell::set_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - (*i)->set_ObjectContactCallback(callback); -} -void CPHShell::add_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - (*i)->add_ObjectContactCallback(callback); -} -void CPHShell::remove_ObjectContactCallback(ObjectContactCallbackFun* callback) -{ - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - (*i)->remove_ObjectContactCallback(callback); -} -void CPHShell::set_CallbackData(void *cd) -{ - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - (*i)->set_CallbackData(cd); -} -void CPHShell::SetPhObjectInElements() -{ - if(!isActive()) return; - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i ) - (*i)->SetPhObjectInGeomData((CPHObject*)this); -} - -void CPHShell::SetMaterial(LPCSTR m) -{ - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - { - (*i)->SetMaterial(m); - } -} - -void CPHShell::SetMaterial(u16 m) -{ - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - { - (*i)->SetMaterial(m); - } -} - -void CPHShell::get_LinearVel(Fvector& velocity) const -{ - - (*elements.begin())->get_LinearVel(velocity); -} - -void CPHShell::get_AngularVel(Fvector& velocity) const -{ - - (*elements.begin())->get_AngularVel(velocity); -} - -void CPHShell::set_LinearVel(const Fvector& velocity) -{ - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;i++) (*i)->set_LinearVel(velocity); -} - -void CPHShell::set_AngularVel(const Fvector& velocity) -{ - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;i++) (*i)->set_AngularVel(velocity); -} - - -void CPHShell::TransformPosition(const Fmatrix &form) -{ - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;i++) (*i)->TransformPosition(form); -} - -void CPHShell::SetGlTransformDynamic(const Fmatrix &form) -{ - VERIFY(isActive()); - VERIFY(_valid(form)); - Fmatrix current,replace; - GetGlobalTransformDynamic(¤t); - current.invert(); - replace.mul(form,current); - TransformPosition(replace); -} -void CPHShell::SmoothElementsInertia(float k) -{ - dMass m_avrg; - dReal krc=1.f-k; - dMassSetZero(&m_avrg); - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - { - - dMassAdd(&m_avrg,(*i)->getMassTensor()); - - } - int n = (int)elements.size(); - m_avrg.mass*=k/float(n); - for(int j=0;j<4*3;++j) m_avrg.I[j]*=k/float(n); - - for(i=elements.begin();elements.end() != i;++i) - { - dVector3 tmp; - dMass* m=(*i)->getMassTensor(); - dVectorSet(tmp,m->c); - - m->mass*=krc; - for(int j=0;j<4*3;++j) m->I[j]*=krc; - dMassAdd(m,&m_avrg); - - dVectorSet(m->c,tmp); - } -} - -void CPHShell::setEquelInertiaForEls(const dMass& M) -{ - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i) - { - (*i)->setInertia(M); - } -} - -void CPHShell::addEquelInertiaToEls(const dMass& M) -{ - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i) - { - (*i)->addInertia(M); - } -} -static BONE_P_MAP* spGetingMap=NULL; -void CPHShell::build_FromKinematics(IKinematics* K,BONE_P_MAP* p_geting_map) -{ - VERIFY( K ); - phys_shell_verify_model ( *K ); - m_pKinematics =K; - spGetingMap =p_geting_map; - //CBoneData& bone_data = m_pKinematics->LL_GetData(0); - if(!m_spliter_holder) m_spliter_holder=xr_new(this); - bool vis_check = false; - AddElementRecursive(0,m_pKinematics->LL_GetBoneRoot(),Fidentity,0,&vis_check); - //R_ASSERT2((*elements.begin())->numberOfGeoms(),"No physics shapes was assigned for model or no shapes in main root bone!!!"); - //SetCallbacks(BonesCallback); - if(m_spliter_holder->isEmpty())ClearBreakInfo(); -} - -void CPHShell::preBuild_FromKinematics(IKinematics* K,BONE_P_MAP* p_geting_map) -{ - VERIFY( K ); - phys_shell_verify_model ( *K ); - m_pKinematics =K; - spGetingMap =p_geting_map; - //CBoneData& bone_data = m_pKinematics->LL_GetData(0); - if(!m_spliter_holder) m_spliter_holder=xr_new(this); - bool vis_check=false; - AddElementRecursive(0,m_pKinematics->LL_GetBoneRoot(),Fidentity,0,&vis_check); - //R_ASSERT2((*elements.begin())->numberOfGeoms(),"No physics shapes was assigned for model or no shapes in main root bone!!!"); - if(m_spliter_holder->isEmpty())ClearBreakInfo(); - m_pKinematics=0; -} -void CPHShell::ClearBreakInfo() -{ - { - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i)(*i)->ClearDestroyInfo(); - } - - { - JOINT_I i=joints.begin(),e=joints.end(); - for(;i!=e;++i) (*i)->ClearDestroyInfo(); - } - xr_delete(m_spliter_holder); -} - - -ICF bool no_physics_shape(const SBoneShape& shape) -{ - return shape.type==SBoneShape::stNone||shape.flags.test(SBoneShape::sfNoPhysics); -} - -bool shape_is_physic( const SBoneShape& shape ) -{ - return !no_physics_shape( shape ); -} - -void CPHShell::AddElementRecursive(CPhysicsElement* root_e, u16 id,Fmatrix global_parent,u16 element_number,bool* vis_check) -{ - - //CBoneInstance& B = m_pKinematics->LL_GetBoneInstance(u16(id)); -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - - CBoneData& bone_data= m_pKinematics->LL_GetData(u16(id)); - SJointIKData& joint_data=bone_data.IK_data; - Fmatrix fm_position; - fm_position.set (bone_data.bind_transform); - fm_position.mulA_43 (global_parent); - Flags64 mask; - mask.assign(m_pKinematics->LL_GetBonesVisible()); - bool no_visible=!mask.is(1ui64<<(u64)id); - bool lvis_check=false; - if(no_visible) - { - - for (vecBonesIt it=bone_data.children.begin(); bone_data.children.end() != it; ++it) - AddElementRecursive (root_e,(*it)->GetSelfID(),fm_position,element_number,&lvis_check); - return; - } - - CPhysicsElement* E = 0; - CPhysicsJoint* J = 0; - bool breakable=joint_data.ik_flags.test(SJointIKData::flBreakable) && - root_e && - !( - no_physics_shape(bone_data.shape)&& - joint_data.type==jtRigid - ) - ; - - /////////////////////////////////////////////////////////////// - lvis_check=(check_obb_sise(bone_data.obb)); - - bool *arg_check=vis_check; - if(breakable||!root_e)//. - { - arg_check=&lvis_check; - } - else - { - *vis_check=*vis_check||lvis_check; - } - ///////////////////////////////////////////////////////////////////// - - bool element_added=false;//set true when if elemen created and added by this call - u16 splitter_position=0; - u16 fracture_num=u16(-1); - - if(!no_physics_shape(bone_data.shape) || !root_e) // - { - - if(joint_data.type==jtRigid && root_e ) // - { - - Fmatrix vs_root_position; - vs_root_position.set(root_e->mXFORM); - vs_root_position.invert(); - vs_root_position.mulB_43(fm_position); - - E=root_e; - if(breakable) - { - CPHFracture fracture; - fracture.m_bone_id =id; - R_ASSERT2(id<64,"ower 64 bones in breacable are not supported"); - fracture.m_start_geom_num =E->numberOfGeoms(); - fracture.m_end_geom_num =u16(-1); - fracture.m_start_el_num =u16(elements.size()); - fracture.m_start_jt_num =u16(joints.size()); - fracture.MassSetFirst (*(E->getMassTensor())); - fracture.m_pos_in_element .set(vs_root_position.c); - VERIFY (u16(-1)!=fracture.m_start_geom_num); - fracture.m_break_force =joint_data.break_force; - fracture.m_break_torque =joint_data.break_torque; - root_e->add_Shape(bone_data.shape,vs_root_position); - root_e->add_Mass(bone_data.shape,vs_root_position,bone_data.center_of_mass,bone_data.mass,&fracture); - - fracture_num=E->setGeomFracturable(fracture); - } - else - { - root_e->add_Shape(bone_data.shape,vs_root_position); - root_e->add_Mass(bone_data.shape,vs_root_position,bone_data.center_of_mass,bone_data.mass); - } - - - //B.Callback_Param=root_e; - //B.Callback=NULL; - - } - else // - { - E = P_create_Element(); - E->m_SelfID=id; - E->mXFORM.set (fm_position); - E->SetMaterial (bone_data.game_mtl_idx); - //Fvector mc; - //fm_position.transform_tiny(mc,bone_data.center_of_mass); - E->set_ParentElement(root_e); - ///B.set_callback(BonesCallback1,E); - if(!no_physics_shape(bone_data.shape)){ - E->add_Shape(bone_data.shape); - E->setMassMC(bone_data.mass,bone_data.center_of_mass); - } - element_number=u16(elements.size()); - add_Element(E); - element_added=true; - - - if(root_e) - { - switch(joint_data.type) - { - case jtSlider: - { - J= P_create_Joint(CPhysicsJoint::slider,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetLimits(joint_data.limits[0].limit.x,joint_data.limits[0].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[0].spring_factor,joint_data.limits[0].damping_factor,0); - if(joint_data.limits[1].limit.y-joint_data.limits[1].limit.xSetLimits(joint_data.limits[1].limit.x,joint_data.limits[1].limit.y,1); - J->SetAxisSDfactors(joint_data.limits[1].spring_factor,joint_data.limits[1].damping_factor,1); - } - break; - } - case jtCloth: - { - J= P_create_Joint(CPhysicsJoint::ball,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - break; - } - case jtJoint: - { - bool eqx=!!fsimilar(joint_data.limits[0].limit.x,joint_data.limits[0].limit.y), - eqy=!!fsimilar(joint_data.limits[1].limit.x,joint_data.limits[1].limit.y), - eqz=!!fsimilar(joint_data.limits[2].limit.x,joint_data.limits[2].limit.y); - - if(eqx) - { - if(eqy) - { - J= P_create_Joint(CPhysicsJoint::hinge,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetAxisDirVsSecondElement (0.f,0.f,1.f,0); - if(joint_data.limits[2].limit.y-joint_data.limits[2].limit.xSetLimits(joint_data.limits[2].limit.x,joint_data.limits[2].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[2].spring_factor,joint_data.limits[2].damping_factor,0); - } - break; - } - if(eqz) - { - J= P_create_Joint(CPhysicsJoint::hinge,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetAxisDirVsSecondElement(0,1,0,0); - if(joint_data.limits[1].limit.y-joint_data.limits[1].limit.xSetLimits(joint_data.limits[1].limit.x,joint_data.limits[1].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[1].spring_factor,joint_data.limits[1].damping_factor,0); - } - break; - } - J= P_create_Joint(CPhysicsJoint::full_control,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetAxisDirVsSecondElement(0.f,0.f,1.f,0);//2-0 - //0-1 - J->SetAxisDirVsSecondElement(0.f,1.f,0.f,2);//1-2 - - if(joint_data.limits[2].limit.y-joint_data.limits[2].limit.xSetLimits(joint_data.limits[2].limit.x,joint_data.limits[2].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[2].spring_factor,joint_data.limits[2].damping_factor,0); - } - if(joint_data.limits[0].limit.y-joint_data.limits[0].limit.xSetLimits(joint_data.limits[0].limit.x,joint_data.limits[0].limit.y,1); - J->SetAxisSDfactors(joint_data.limits[0].spring_factor,joint_data.limits[0].damping_factor,1); - } - - if(joint_data.limits[1].limit.y-joint_data.limits[1].limit.xSetLimits(joint_data.limits[1].limit.x,joint_data.limits[1].limit.y,2); - J->SetAxisSDfactors(joint_data.limits[1].spring_factor,joint_data.limits[1].damping_factor,2); - } - - break; - - } - - if(eqy) - { - if(eqz) - { - J= P_create_Joint(CPhysicsJoint::hinge,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetAxisDirVsSecondElement(1,0,0,0); - if(joint_data.limits[0].limit.y-joint_data.limits[0].limit.xSetLimits(joint_data.limits[0].limit.x,joint_data.limits[0].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[0].spring_factor,joint_data.limits[0].damping_factor,0); - } - break; - } - - J= P_create_Joint(CPhysicsJoint::full_control,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetAxisDirVsSecondElement(0.f,0.f,1.f,0);//2-0 - //1-1 - J->SetAxisDirVsSecondElement(1.f,0.f,0.f,2);//0-2 - if(joint_data.limits[2].limit.y-joint_data.limits[2].limit.xSetLimits(joint_data.limits[2].limit.x,joint_data.limits[2].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[2].spring_factor,joint_data.limits[2].damping_factor,0); - } - if(joint_data.limits[0].limit.y-joint_data.limits[0].limit.xSetLimits(joint_data.limits[0].limit.x,joint_data.limits[0].limit.y,2); - J->SetAxisSDfactors(joint_data.limits[0].spring_factor,joint_data.limits[0].damping_factor,2); - } - - if(joint_data.limits[1].limit.y-joint_data.limits[1].limit.xSetLimits(joint_data.limits[1].limit.x,joint_data.limits[1].limit.y,1); - J->SetAxisSDfactors(joint_data.limits[1].spring_factor,joint_data.limits[1].damping_factor,1); - } - break; - } - - if(eqz) - { - J= P_create_Joint(CPhysicsJoint::full_control,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetAxisDirVsSecondElement(1.f,0.f,0.f,0);//0-0 - //2-1 - J->SetAxisDirVsSecondElement(0.f,1.f,0.f,2);//1-2 - if(joint_data.limits[2].limit.y-joint_data.limits[2].limit.xSetLimits(joint_data.limits[2].limit.x,joint_data.limits[2].limit.y,1); - J->SetAxisSDfactors(joint_data.limits[2].spring_factor,joint_data.limits[2].damping_factor,1); - } - if(joint_data.limits[0].limit.y-joint_data.limits[0].limit.xSetLimits(joint_data.limits[0].limit.x,joint_data.limits[0].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[0].spring_factor,joint_data.limits[0].damping_factor,0); - } - - if(joint_data.limits[1].limit.y-joint_data.limits[1].limit.xSetLimits(joint_data.limits[1].limit.x,joint_data.limits[1].limit.y,2); - J->SetAxisSDfactors(joint_data.limits[1].spring_factor,joint_data.limits[1].damping_factor,2); - } - break; - } - J= P_create_Joint(CPhysicsJoint::full_control,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetAxisDirVsSecondElement(0.f,0.f,1.f,0);//2-0 - //0-1 - J->SetAxisDirVsSecondElement(0.f,1.f,0.f,2);//1-2 - if(joint_data.limits[2].limit.y-joint_data.limits[2].limit.xSetLimits(joint_data.limits[2].limit.x,joint_data.limits[2].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[2].spring_factor,joint_data.limits[2].damping_factor,0); - } - if(joint_data.limits[0].limit.y-joint_data.limits[0].limit.xSetLimits(joint_data.limits[0].limit.x,joint_data.limits[0].limit.y,1); - J->SetAxisSDfactors(joint_data.limits[0].spring_factor,joint_data.limits[0].damping_factor,1); - } - - if(joint_data.limits[1].limit.y-joint_data.limits[1].limit.xSetLimits(joint_data.limits[1].limit.x,joint_data.limits[1].limit.y,2); - J->SetAxisSDfactors(joint_data.limits[1].spring_factor,joint_data.limits[1].damping_factor,2); - } - - break; - } - case jtWheel: - { - J= P_create_Joint(CPhysicsJoint::hinge2,root_e,E); - J->SetAnchorVsSecondElement (0,0,0); - J->SetJointSDfactors(joint_data.spring_factor,joint_data.damping_factor); - J->SetAxisDirVsSecondElement(1,0,0,0); - J->SetAxisDirVsSecondElement(0,0,1,1); - if(joint_data.limits[0].limit.y-joint_data.limits[0].limit.xSetLimits(joint_data.limits[0].limit.x,joint_data.limits[0].limit.y,0); - J->SetAxisSDfactors(joint_data.limits[0].spring_factor,joint_data.limits[0].damping_factor,0); - } - break; - } - - case jtNone: break; - - default: NODEFAULT; - } - if(J) - { - - J->SetForceAndVelocity(joint_data.friction);//joint_data.friction - SetJointRootGeom(root_e,J); - J->SetBoneID(id); - add_Joint (J); - if(breakable) - { - setEndJointSplitter(); - J->SetBreakable(joint_data.break_force,joint_data.break_torque); - } - } - } - if(m_spliter_holder) - { - splitter_position=u16(m_spliter_holder->m_splitters.size()); - } - } - } - else - { - //B.set_callback(0,root_e); - E=root_e; - } - - if(!no_physics_shape(bone_data.shape)) - { - CODEGeom* added_geom = E->last_geom(); - if(added_geom) - { - added_geom->set_bone_id(id); - added_geom->set_shape_flags( bone_data.shape.flags ); - } - } -#ifdef DEBUG - if(E->last_geom()) - VERIFY(E->last_geom()->bone_id()!=u16(-1)); -#endif - if(m_spliter_holder&&E->has_geoms()) - { - m_spliter_holder->AddToGeomMap(mk_pair(id,E->last_geom())); - } - - if(spGetingMap) - { - const BONE_P_PAIR_IT c_iter= spGetingMap->find(id); - if(spGetingMap->end()!=c_iter) - { - c_iter->second.joint=J; - c_iter->second.element=E; - } - } - - - ///////////////////////////////////////////////////////////////////////////////////// - for (vecBonesIt it=bone_data.children.begin(); bone_data.children.end() != it; ++it) - AddElementRecursive (E,(*it)->GetSelfID(),fm_position,element_number,arg_check); - ///////////////////////////////////////////////////////////////////////////////////// - if(breakable) - { - if(joint_data.type==jtRigid) - { - CPHFracture& fracture=E->Fracture(fracture_num); - fracture.m_bone_id =id; - fracture.m_end_geom_num =E->numberOfGeoms(); - fracture.m_end_el_num =u16(elements.size());//just after this el = current+1 - fracture.m_end_jt_num =u16(joints.size()); //current+1 - - } - else - { - if(J) - { - J->JointDestroyInfo()->m_end_element=u16(elements.size()); - J->JointDestroyInfo()->m_end_joint=u16(joints.size()); - } - } - } - - if(element_added&&E->isBreakable())setElementSplitter(element_number,splitter_position); -#ifdef DEBUG - bool bbb = lvis_check||(!breakable && root_e); - if(!bbb) - { - IKinematics* K = m_pKinematics; - - Msg("all bones transform:--------"); - - for(u16 ii=0; iiLL_BoneCount();++ii){ - Fmatrix tr; - - tr = K->LL_GetTransform(ii); - Log("bone ",K->LL_BoneName_dbg(ii)); - Log("bone_matrix",tr); - } - Log("end-------"); - } - - VERIFY3(bbb,*dbg_obj->cNameVisual(),"has breaking parts with no vertexes or size less than 1mm");// -#endif - -} - -void CPHShell::ResetCallbacks(u16 id,Flags64 &mask) -{ - ResetCallbacksRecursive(id,u16(-1),mask); -} - -void CPHShell::ResetCallbacksRecursive(u16 id,u16 element,Flags64 &mask) -{ - - //if(elements.size()==element) return; - CBoneInstance& B = m_pKinematics->LL_GetBoneInstance(u16(id)); - CBoneData& bone_data= m_pKinematics->LL_GetData(u16(id)); - SJointIKData& joint_data=bone_data.IK_data; - - if( mask.is(1ui64<<(u64)id) ) - { - - if(no_physics_shape(bone_data.shape)||joint_data.type==jtRigid&& element!=u16(-1)) - { - - B.set_callback(bctPhysics,0,cast_PhysicsElement(elements[element])); - } - else - { - - element++; - R_ASSERT2(elementGetSelfID(),element,mask); -} - -void CPHShell::EnabledCallbacks(BOOL val) -{ - if (val){ - SetCallbacks( ); - // set callback owervrite in used bones - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i){ - CBoneInstance& B = m_pKinematics->LL_GetBoneInstance((*i)->m_SelfID); - B.set_callback_overwrite(TRUE); - } - }else ZeroCallbacks(); -} - - - -template< typename T> -void for_each_bone_id( IKinematics &K, T op ) -{ - u16 bn = K.LL_BoneCount(); - for(u16 i = 0; i < bn; ++i ) - op( i ); -} - -CPHElement* get_physics_parent( IKinematics &k, u16 id ) -{ - VERIFY( BI_NONE != id ); - - while( true ) - { - CBoneInstance & B = k.LL_GetBoneInstance( u16(id) ); - CBoneData & bone_data = k.LL_GetData( u16(id) ); - if( B.callback_type() == bctPhysics && B.callback_param() ) - return cast_PHElement( B.callback_param() ); - - if( k.LL_GetBoneRoot() == id ) - return 0; - - id = bone_data.GetParentID(); - - if( BI_NONE == id ) - return 0; - } -} -static u16 element_position_in_set_calbacks=u16(-1); -void CPHShell::SetCallbacks( ) -{ - - struct set_bone_callback - { - void operator() ( CPHElement* e){e->SetBoneCallback(); } - }; - std::for_each( elements.begin(), elements.end(), set_bone_callback() ); - - struct set_bone_reference: private boost::noncopyable - { - IKinematics &K; - set_bone_reference( IKinematics &K_ ): K( K_ ){} - void operator() ( u16 id ) - { - CBoneInstance &bi = K.LL_GetBoneInstance(id); - if(!bi.callback() || bi.callback_type() != bctPhysics ) - { - CPHElement *root_e = get_physics_parent( K, id ); - if( root_e && K.LL_GetBoneVisible( id ) ) - bi.set_callback( bctPhysics, 0, cast_PhysicsElement( root_e ) ); - } - } - }; - for_each_bone_id( *PKinematics(), set_bone_reference( *PKinematics() ) ); - - //element_position_in_set_calbacks=u16(-1); - - //SetCallbacksRecursive(m_pKinematics->LL_GetBoneRoot(),element_position_in_set_calbacks); -} - - - -void CPHShell::SetCallbacksRecursive(u16 id,u16 element) -{ - VERIFY( false ); - //if(elements.size()==element) return; - CBoneInstance& B = m_pKinematics->LL_GetBoneInstance(u16(id)); - CBoneData& bone_data= m_pKinematics->LL_GetData(u16(id)); - SJointIKData& joint_data=bone_data.IK_data; - Flags64 mask; - mask.assign(m_pKinematics->LL_GetBonesVisible()); - if(mask.is(1ui64<<(u64)id)) - { - if((no_physics_shape(bone_data.shape)||joint_data.type==jtRigid) && element!=u16(-1)){ - B.set_callback(bctPhysics,0,cast_PhysicsElement(elements[element])); - }else{ - element_position_in_set_calbacks++; - element=element_position_in_set_calbacks; - R_ASSERT2(elementGetSelfID(),element); -} - -void CPHShell::ZeroCallbacks() -{ - if (m_pKinematics) ZeroCallbacksRecursive(m_pKinematics->LL_GetBoneRoot()); -} -void CPHShell::ZeroCallbacksRecursive(u16 id) -{ - CBoneInstance& B = m_pKinematics->LL_GetBoneInstance(u16(id)); - CBoneData& bone_data= m_pKinematics->LL_GetData(u16(id)); - if(B.callback_type() == bctPhysics) - { - B.reset_callback (); - } - for (vecBonesIt it=bone_data.children.begin(); bone_data.children.end() != it; ++it) - ZeroCallbacksRecursive ((*it)->GetSelfID()); - -} -void CPHShell::set_DynamicLimits(float l_limit,float w_limit) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->set_DynamicLimits(l_limit,w_limit); -} - -void CPHShell::set_DynamicScales(float l_scale/* =default_l_scale */,float w_scale/* =default_w_scale */) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->set_DynamicScales(l_scale,w_scale); -} - -void CPHShell::set_DisableParams(const SAllDDOParams& params) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->set_DisableParams(params); -} - -void CPHShell::UpdateRoot() -{ - - ELEMENT_I i=elements.begin(); - if( !(*i)->isFullActive()) return; - - (*i)->InterpolateGlobalTransform(&mXFORM); - -} - -Fmatrix& CPHShell::get_animation_root_matrix( Fmatrix& m ) -{ - - return m; -} - -void CPHShell::InterpolateGlobalTransform(Fmatrix* m) -{ - - //if(!CPHObject::is_active()&&!CPHObject::NetInterpolation()) return; - - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->InterpolateGlobalTransform(&(*i)->mXFORM); - - m->set( root_element().mXFORM ); - - m->mulB_43 (m_object_in_root); - - mXFORM.set(*m); - - VERIFY2(_valid(*m),"not valide transform"); - - CPhysicsShellHolder* ref_object=(*elements.begin())->PhysicsRefObject(); - if(ref_object&&m_active_count<0) - { - ref_object->processing_deactivate(); - ref_object->spatial_move(); - m_active_count=0; - } - -} - -void CPHShell::GetGlobalTransformDynamic(Fmatrix* m) -{ - ELEMENT_CI i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->GetGlobalTransformDynamic(&(*i)->mXFORM); - m->set((*elements.begin())->mXFORM); - - m->mulB_43 (m_object_in_root); - mXFORM.set(*m); - - VERIFY2(_valid(*m),"not valide transform"); - -} -void CPHShell::InterpolateGlobalPosition(Fvector* v) -{ - (*elements.begin())->InterpolateGlobalPosition(v); - - v->add(m_object_in_root.c); - - VERIFY2(_valid(*v),"not valide result position"); -} - -void CPHShell::GetGlobalPositionDynamic(Fvector* v) -{ - (*elements.begin())->GetGlobalPositionDynamic(v); - VERIFY2(_valid(*v),"not valide result position"); -} - - -void CPHShell::ObjectToRootForm(const Fmatrix& form) -{ - Fmatrix M; - Fmatrix ILF; - (*elements.begin())->InverceLocalForm(ILF); - M.mul(m_object_in_root,ILF); - M.invert(); - mXFORM.mul(form,M); - VERIFY2(_valid(form),"not valide transform"); - -} - - - -CPhysicsElement* CPHShell::NearestToPoint(const Fvector& point, NearestToPointCallback *cb /*=0*/) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - float min_distance =dInfinity; - CPHElement* nearest_element=NULL; - for( ; i!=e; ++i ) - { - Fvector tmp; - float distance; - if( cb && ! (*cb)( *i ) ) - continue; - (*i)->GetGlobalPositionDynamic(&tmp); - tmp.sub(point); - distance=tmp.magnitude(); - if(distanceelements.empty()) (*i_from)->set_ParentElement(dest->elements.back()); - else (*i_from)->set_ParentElement(NULL); - } - for(ELEMENT_I i=i_from;i!=e;++i) - { - dGeomID spaced_geom=(*i)->dSpacedGeometry(); - if(spaced_geom)//for active elems - { - dSpaceRemove (m_space,spaced_geom ); - dSpaceAdd(dest->m_space,spaced_geom); - } - VERIFY(_valid(dest->mXFORM)); - (*i)->SetShell(dest); - } - dest->elements.insert(dest->elements.end(),i_from,e); - elements.erase(i_from,e); - -} - -void CPHShell::PassEndJoints(u16 from,u16 to,CPHShell *dest) -{ - JOINT_I i_from=joints.begin()+from,e=joints.begin()+to; - JOINT_I i=i_from; - for(;i!=e;i++) - { - (*i)->SetShell(dest); - } - dest->joints.insert(dest->joints.end(),i_from,e); - joints.erase(i_from,e); -} - -void CPHShell::DeleteElement(u16 element) -{ - elements[element]->Deactivate(); - xr_delete(elements[element]); - elements.erase(elements.begin()+element); -} -void CPHShell::DeleteJoint(u16 joint) -{ - joints[joint]->Deactivate(); - xr_delete(joints[joint]); - joints.erase(joints.begin()+joint); -} - -void CPHShell::setEndElementSplitter() -{ - - if(!elements.back()->FracturesHolder())//adding fracture for element supposed before adding splitter. Need only one splitter for an element - AddSplitter(CPHShellSplitter::splElement,u16(elements.size()-1),u16(joints.size()-1)); -} - -void CPHShell::setElementSplitter(u16 element_number,u16 splitter_position) -{ - AddSplitter(CPHShellSplitter::splElement,element_number,element_number-1,splitter_position); -} -void CPHShell::AddSplitter(CPHShellSplitter::EType type,u16 element,u16 joint) -{ - if(!m_spliter_holder) m_spliter_holder=xr_new(this); - m_spliter_holder->AddSplitter(type,element,joint); -} - -void CPHShell::AddSplitter(CPHShellSplitter::EType type,u16 element,u16 joint,u16 position) -{ - if(!m_spliter_holder) m_spliter_holder=xr_new(this); - m_spliter_holder->AddSplitter(type,element,joint,position); -} -void CPHShell::setEndJointSplitter() -{ - if(!joints.back()->JointDestroyInfo())//setting joint breacable supposed before adding splitter. Need only one splitter for a joint - AddSplitter(CPHShellSplitter::splJoint,u16(elements.size()-1),u16(joints.size()-1)); -} - -bool CPHShell::isBreakable() -{ - return (m_spliter_holder&&!m_spliter_holder->IsUnbreakable()); -} - -bool CPHShell::isFractured() -{ - return(m_spliter_holder&&m_spliter_holder->Breaked()); -} - -void CPHShell::SplitProcess(PHSHELL_PAIR_VECTOR &out_shels) -{ - if(! m_spliter_holder) return; - m_spliter_holder->SplitProcess(out_shels); - if(!m_spliter_holder->m_splitters.size()) xr_delete(m_spliter_holder); -} - -u16 CPHShell::BoneIdToRootGeom(u16 id) -{ - if(! m_spliter_holder)return u16(-1); - return m_spliter_holder->FindRootGeom(id); -} - -void CPHShell::SetJointRootGeom(CPhysicsElement* root_e,CPhysicsJoint* J) -{ - R_ASSERT(root_e); - R_ASSERT( J ); - CPHElement* e=cast_PHElement(root_e); - CPHJoint* j=static_cast(J); - - CPHFracturesHolder* f_holder=e->FracturesHolder(); - if(!f_holder) return; - j->RootGeom()=e->Geom(f_holder->LastFracture().m_start_geom_num); -} - -void CPHShell::set_ApplyByGravity(bool flag) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->set_ApplyByGravity(flag); -} - -bool CPHShell::get_ApplyByGravity() -{ - if (elements.empty()) - return (false); - - VERIFY (elements.front()); - return (elements.front()->get_ApplyByGravity()); -} - -void CPHShell::applyGravityAccel(const Fvector& accel) -{ - if(!isActive())return; - ELEMENT_I i,e; - Fvector a; - a.set(accel); - a.mul((float)elements.size()); - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->applyGravityAccel(a); - EnableObject(0); -} - -void CPHShell::PlaceBindToElForms() -{ - Flags64 mask; - mask.assign(m_pKinematics->LL_GetBonesVisible()); - PlaceBindToElFormsRecursive(Fidentity,m_pKinematics->LL_GetBoneRoot(),0,mask); -} -void CPHShell:: setTorque (const Fvector& torque) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->setTorque(torque); -} -void CPHShell:: setForce (const Fvector& force) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->setForce(force); -} -void CPHShell::PlaceBindToElFormsRecursive(Fmatrix parent,u16 id,u16 element,Flags64 &mask) -{ - - - CBoneData& bone_data= m_pKinematics->LL_GetData(u16(id)); - SJointIKData& joint_data=bone_data.IK_data; - - if(mask.is(1ui64<<(u64)id)) - { - - if(no_physics_shape(bone_data.shape)||joint_data.type==jtRigid&& element!=u16(-1)) - { - - - } - else - { - - element++; - R_ASSERT2(elementmXFORM.mul(parent,bone_data.bind_transform); - - } - } - for (vecBonesIt it=bone_data.children.begin(); it!=bone_data.children.end(); ++it) - PlaceBindToElFormsRecursive(mXFORM,(*it)->GetSelfID(),element,mask); - -} - -void CPHShell::BonesBindCalculate(u16 id_from) -{ - BonesBindCalculateRecursive(Fidentity,0); -} -void CPHShell::BonesBindCalculateRecursive(Fmatrix parent,u16 id) -{ - - CBoneInstance& bone_instance=m_pKinematics->LL_GetBoneInstance(id); - CBoneData& bone_data= m_pKinematics->LL_GetData(u16(id)); - - bone_instance.mTransform.mul(parent,bone_data.bind_transform); - - for (vecBonesIt it=bone_data.children.begin(); it!=bone_data.children.end(); ++it) - BonesBindCalculateRecursive(bone_instance.mTransform,(*it)->GetSelfID()); -} - -void CPHShell::AddTracedGeom (u16 element/*=0*/,u16 geom/*=0*/) -{ - CODEGeom* g=elements[element]->Geom(geom); - g->set_ph_object(this); - m_traced_geoms.add(g); - EnableGeomTrace (); -} -void CPHShell::SetAllGeomTraced() -{ - ELEMENT_I i, e, b; - b = elements.begin(); e=elements.end(); - for( i=b ;i!=e; ++i ) - { - u16 gn=(*i)->numberOfGeoms(); - for(u16 j=0;jSetShell(this); - elements.push_back(ph_element); - -} - -void CPHShell::add_Joint (CPhysicsJoint* J) { - if(!J)return; - joints.push_back(static_cast(J)); - joints.back()->SetShell(this); -} - -CODEGeom* CPHShell::get_GeomByID(u16 bone_id) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - { - CODEGeom* ret=(*i)->GeomByBoneID(bone_id); - if(ret) return ret; - } - return NULL; -} -void CPHShell::PureStep(float step) -{ - //CPHObject::Island().Step(step); - //PhDataUpdate(step); - CPHObject::step( step ); -} -void CPHShell::CollideAll() -{ - CPHObject::Collide(); - CPHObject::reinit_single(); -} - -void CPHShell::RegisterToCLGroup (CGID g) -{ - CPHCollideValidator::RegisterObjToGroup(g,*static_cast(this)); -} - -bool CPHShell::IsGroupObject() -{ - return CPHCollideValidator::IsGroupObject(*this); -}; - -void CPHShell::SetIgnoreStatic() -{ - CPHCollideValidator::SetStaticNotCollide(*this); -} - -void CPHShell::SetIgnoreDynamic() -{ - CPHCollideValidator::SetDynamicNotCollide(*this); -} - -void CPHShell::SetRagDoll() -{ - CPHCollideValidator::SetRagDollClass(*this); -} - -void CPHShell::SetIgnoreRagDoll() -{ - CPHCollideValidator::SetRagDollClassNotCollide(*this); -} - - - //Äåëàåò äàííûé ôèçè÷åñêèé îáúåê àíèìèðîâàííûì -void CPHShell::CreateShellAnimator( CInifile* ini, LPCSTR section ) -{ - //Äëÿ ôèëüòðà êîëëèçèé îòíîñèì äàííûé îáúåêò ê êëàññó àíèìèðîâàííûõ - CPHCollideValidator::SetAnimatedClass(*this); - m_pPhysicsShellAnimatorC=xr_new( this, ini, section ); - VERIFY( PhysicsRefObject( ) ); - PhysicsRefObject()->processing_activate(); - //m_pPhysicsShellAnimatorC->ResetCallbacks(); -} - -//Íàñòðàèâàåò ôèëüòð êîëëèçèé íà èãíîðèðîâàíèå ñòîëêíîâåííèé äàííîãî -//ôèçè÷åñêîãî îáúåêòà ñ àíèìèðîâàííûì ôèçè÷åñêèì îáúåêòîì -void CPHShell::SetIgnoreAnimated() -{ - //Äëÿ ôèëüòðà êîëëèçèé óêàçûâàåì, ÷òî äàííûé - //ôèçè÷åñêèé îáúåêò èãíîðèðóåò àíèìèðîâàííûå ôèçè÷åñêèå òåëà - - CPHCollideValidator::SetAnimatedClassNotCollide(*this); -} - -//Âûäàåò èíôîðìàöèþ î òîì ÿâëÿåòñÿ ëè äàííûé îáúåêò àíèìèðîâàííûì - - -void CPHShell:: SetSmall() -{ - CPHCollideValidator::SetClassSmall(*this); -} - -void CPHShell:: SetIgnoreSmall() -{ - CPHCollideValidator::SetClassSmallNotCollide(*this); -} -void CPHShell::CutVelocity(float l_limit,float a_limit) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i)(*i)->CutVelocity(l_limit,a_limit); -} - -void CPHShell::ClearRecentlyDeactivated() -{ - ClearCashedTries(); -} - -void CPHShell::ClearCashedTries() -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i)(*i)->clear_cashed_tries(); -} - -void CPHShell::get_Extensions(const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext) const -{ - t_get_extensions( elements, axis, center_prg, lo_ext, hi_ext ); - /* - lo_ext=dInfinity;hi_ext=-dInfinity; - ELEMENT_CI i=elements.begin(),e=elements.end(); - for(;i!=e;++i) - { - float temp_lo_ext,temp_hi_ext; - (*i)->get_Extensions(axis,center_prg,temp_lo_ext,temp_hi_ext); - if(lo_ext>temp_lo_ext)lo_ext=temp_lo_ext; - if(hi_extget_CallbackData(); -} - -void CPHShell:: SetBonesCallbacksOverwrite(bool v) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ;i!=e;++i) - (*i)->SetBoneCallbackOverwrite(v); -} - - -void CPHShell:: ToAnimBonesPositions () -{ - VERIFY( PKinematics() ); - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - for( ; i!=e; ++i ) - (*i)->ToBonePos( &PKinematics()->LL_GetBoneInstance( (*i)->m_SelfID ) ); -} - -bool CPHShell:: AnimToVelocityState ( float dt, float l_limit, float a_limit ) -{ - ELEMENT_I i,e; - i=elements.begin(); e=elements.end(); - bool ret = true; - for( ;i!=e; ++i ) - ret =(*i)->AnimToVel( dt, l_limit, a_limit ) && ret; - return ret; -} - -void CPHShell::SetAnimated( bool v ) -{ - ELEMENT_I i, e; - i = elements.begin(); e=elements.end(); - for( ; i!=e; ++i ) - (*i)->SetAnimated( v ); - -} - - - - -#ifdef DEBUG -void CPHShell:: dbg_draw_velocity ( float scale, u32 color ) -{ - ELEMENT_I i, e; - i = elements.begin(); e=elements.end(); - for( ; i!=e; ++i ) - (*i)->dbg_draw_velocity( scale, color ); - -} -void CPHShell:: dbg_draw_force ( float scale, u32 color ) -{ - ELEMENT_I i, e; - i = elements.begin(); e=elements.end(); - for( ; i!=e; ++i ) - (*i)->dbg_draw_force( scale, color ); -} - -void CPHShell::dbg_draw_geometry ( float scale, u32 color, Flags32 flags /*= Flags32().assign( 0 )*/ ) const -{ - ELEMENT_CI i, e; - i = elements.begin(); e=elements.end(); - for( ; i!=e; ++i ) - (*i)->dbg_draw_geometry( scale, color, flags ); -} - -#endif diff --git a/src/xrGame/PHShell.h b/src/xrGame/PHShell.h deleted file mode 100644 index 5daebad8a23..00000000000 --- a/src/xrGame/PHShell.h +++ /dev/null @@ -1,286 +0,0 @@ -/////////////////////////////////////////////////////////////////////// - -#ifndef PH_SHELL -#define PH_SHELL - -class CPHShell; -class CPHShellSplitterHolder; -#include "PHJoint.h" -#include "PHElement.h" -#include "PHDefs.h" -#include "PHShellSplitter.h" -#include "phmovestorage.h" - - - - -class CPhysicsShellAnimator; - - -class CPHShell: public CPhysicsShell,public CPHObject { - - friend class CPHShellSplitterHolder; - enum - { - flActive = 1<<0, - flActivating = 1<<1, - flRemoveCharacterCollisionAfterDisable = 1<<2, - }; - s16 m_active_count; - Flags8 m_flags; - ELEMENT_STORAGE elements; - JOINT_STORAGE joints; - CPHShellSplitterHolder *m_spliter_holder; - CPHMoveStorage m_traced_geoms; - - - CPhysicsShellAnimator* m_pPhysicsShellAnimatorC; - -private: - -#ifdef DEBUG - virtual CPhysicsShellHolder *ref_object () { return PhysicsRefObject() ;} -#endif - -protected: - dSpaceID m_space; -public: - Fmatrix m_object_in_root; - CPHShell (); - virtual ~CPHShell (); - virtual void applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val,const u16 id); - virtual void applyHit (const Fvector& pos, const Fvector& dir, float val,const u16 id,ALife::EHitType hit_type); - - static void BonesCallback (CBoneInstance* B); - static void StataticRootBonesCallBack (CBoneInstance* B); - virtual BoneCallbackFun* GetBonesCallback () {return BonesCallback ;} - virtual BoneCallbackFun* GetStaticObjectBonesCallback() { VERIFY( false ); return StataticRootBonesCallBack; } - virtual void add_Element (CPhysicsElement* E); - virtual void ToAnimBonesPositions (); - virtual bool AnimToVelocityState (float dt, float l_limit, float a_limit ); - virtual void SetBonesCallbacksOverwrite(bool v); - void SetPhObjectInElements (); - virtual void EnableObject (CPHObject* obj); - virtual void DisableObject (); - virtual void SetAirResistance (dReal linear=default_k_l, dReal angular=default_k_w) - { - xr_vector::iterator i; - for(i=elements.begin();elements.end()!=i;++i) - (*i)->SetAirResistance(linear,angular); - } - virtual void GetAirResistance (float& linear, float& angular) - { - (*elements.begin())->GetAirResistance(linear,angular); - } - virtual void add_Joint (CPhysicsJoint* J); - - virtual CPHIsland* PIsland (){return &Island();}; - virtual void applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val) ; - - virtual void Update () ; - - virtual void Activate (const Fmatrix& m0, float dt01, const Fmatrix& m2,bool disable=false); - virtual void Activate (const Fmatrix &transform,const Fvector& lin_vel,const Fvector& ang_vel,bool disable=false); - virtual void Activate (bool disable=false, bool not_set_bone_callbacks = false); - virtual void Activate (const Fmatrix& start_from, bool disable=false){}; - - - virtual CPhysicsShellAnimator* PPhysicsShellAnimator(){return m_pPhysicsShellAnimatorC;}; - -private: - void activate (bool disable); -public: - virtual void Build (bool disable=false); - virtual void RunSimulation (bool place_current_forms=true); - virtual void net_Import (NET_Packet& P); - virtual void net_Export (NET_Packet& P); - void PresetActive (); - void AfterSetActive (); - void PureActivate (); - virtual void Deactivate (); - virtual const CGID& GetCLGroup ()const; - virtual void RegisterToCLGroup (CGID g) ; - virtual bool IsGroupObject () ; - virtual void SetIgnoreStatic () ; - virtual void SetIgnoreDynamic () ; - virtual void SetRagDoll () ; - virtual void SetIgnoreRagDoll () ; - - virtual void CreateShellAnimator ( CInifile* ini, LPCSTR section ) ; - virtual void SetIgnoreAnimated () ; - - virtual void SetSmall () ; - virtual void SetIgnoreSmall () ; - virtual void setMass (float M) ; - - virtual void setMass1 (float M) ; - virtual void setEquelInertiaForEls (const dMass& M) ; - virtual void addEquelInertiaToEls (const dMass& M) ; - virtual float getMass () ; - virtual void setDensity (float M) ; - virtual float getDensity () ; - virtual float getVolume () ; - virtual void get_Extensions (const Fvector& axis,float center_prg,float& lo_ext, float& hi_ext) const; - virtual void applyForce (const Fvector& dir, float val) ; - virtual void applyForce (float x,float y,float z) ; - virtual void applyImpulse (const Fvector& dir, float val) ; - virtual void applyGravityAccel (const Fvector& accel); - virtual void setTorque (const Fvector& torque); - virtual void setForce (const Fvector& force); - virtual void set_JointResistance (float force) - { - JOINT_I i; - for(i=joints.begin();joints.end() != i;++i) - { - (*i)->SetForce(force); - (*i)->SetVelocity(); - } - //(*i)->SetForceAndVelocity(force); - } - virtual void set_DynamicLimits (float l_limit=default_l_limit,float w_limit=default_w_limit); - virtual void set_DynamicScales (float l_scale=default_l_scale,float w_scale=default_w_scale); - virtual void set_ContactCallback (ContactCallbackFun* callback); - virtual void set_ObjectContactCallback (ObjectContactCallbackFun* callback); - virtual void SetAnimated ( bool v ); - virtual void add_ObjectContactCallback (ObjectContactCallbackFun* callback); - virtual void remove_ObjectContactCallback (ObjectContactCallbackFun* callback); - virtual void set_CallbackData (void * cd); - virtual void *get_CallbackData (); - virtual void set_PhysicsRefObject (CPhysicsShellHolder* ref_object); - CPhysicsShellHolder*PhysicsRefObject (){ return (*elements.begin())->PhysicsRefObject(); } - - //breakbable interface - virtual bool isBreakable (); - virtual bool isFractured (); - virtual CPHShellSplitterHolder* SplitterHolder (){return m_spliter_holder;} - virtual void SplitProcess (PHSHELL_PAIR_VECTOR &out_shels); - virtual void BlockBreaking (){if(m_spliter_holder)m_spliter_holder->SetUnbreakable();} - virtual void UnblockBreaking (){if(m_spliter_holder)m_spliter_holder->SetBreakable();} - virtual bool IsBreakingBlocked (){return m_spliter_holder&&m_spliter_holder->IsUnbreakable();} - /////// //////////////////////////////////////////////////////////////////////////////////////////// - virtual void get_LinearVel (Fvector& velocity) const ; - virtual void get_AngularVel (Fvector& velocity) const ; - virtual void set_LinearVel (const Fvector& velocity); - virtual void set_AngularVel (const Fvector& velocity); - virtual void TransformPosition (const Fmatrix &form); - virtual void SetGlTransformDynamic (const Fmatrix &form); - virtual void set_ApplyByGravity (bool flag); - virtual bool get_ApplyByGravity (); - virtual void SetMaterial (u16 m); - virtual void SetMaterial (LPCSTR m); - virtual ELEMENT_STORAGE &Elements (){return elements;} - virtual CPhysicsElement *get_Element (u16 bone_id); - virtual CPhysicsElement *get_Element (const shared_str & bone_name); - virtual CPhysicsElement *get_Element (LPCSTR bone_name); - virtual const CPhysicsElement *get_ElementByStoreOrder (u16 num) const; - virtual CPhysicsElement *get_ElementByStoreOrder (u16 num); - CPhysicsElement *get_PhysicsParrentElement ( u16 bone_id ); - virtual u16 get_ElementsNumber ()const{return (u16)elements.size();} - virtual CPHSynchronize *get_ElementSync (u16 element); - virtual u16 get_elements_number (){return get_ElementsNumber();} - virtual CPHSynchronize *get_element_sync (u16 element){return get_ElementSync(element);} - virtual CPhysicsElement *NearestToPoint (const Fvector& point, NearestToPointCallback *cb = 0 ); - virtual CPhysicsJoint *get_Joint (u16 bone_id); - virtual CPhysicsJoint *get_Joint (const shared_str & bone_name); - virtual CPhysicsJoint *get_Joint (LPCSTR bone_name); - virtual CPhysicsJoint *get_JointByStoreOrder (u16 num); - virtual u16 get_JointsNumber (); - virtual CODEGeom *get_GeomByID (u16 bone_id); - - virtual void Enable (); - virtual void Disable (); - virtual void DisableCollision (); - virtual void EnableCollision (); - virtual void DisableCharacterCollision (); - virtual void SetRemoveCharacterCollLADisable (){m_flags.set(flRemoveCharacterCollisionAfterDisable,TRUE);} - virtual bool isEnabled ()const {return CPHObject::is_active();} - virtual bool isActive ()const {return !!m_flags.test(flActive);} - virtual bool isFullActive ()const {return isActive()&&!m_flags.test(flActivating);} - void SetNotActivating (){m_flags.set(flActivating,FALSE);} -//CPHObject - virtual void vis_update_activate (); - virtual void vis_update_deactivate (); - virtual void PureStep (float step); - virtual void CollideAll (); - virtual void PhDataUpdate (dReal step); - virtual void PhTune (dReal step); - virtual void InitContact (dContact* c,bool &do_collide,u16 /*material_idx_1*/,u16 /*material_idx_2*/){}; - virtual void FreezeContent (); - virtual void UnFreezeContent (); - virtual void Freeze (); - virtual void UnFreeze (); - virtual void NetInterpolationModeON (){CPHObject::NetInterpolationON();} - virtual void NetInterpolationModeOFF (){CPHObject::NetInterpolationOFF();} - virtual void StepFrameUpdate (dReal step){}; - virtual CPHMoveStorage* MoveStorage (){return &m_traced_geoms;} - virtual void build_FromKinematics (IKinematics* K,BONE_P_MAP* p_geting_map=NULL); - virtual void preBuild_FromKinematics (IKinematics* K,BONE_P_MAP* p_geting_map); - virtual void ZeroCallbacks (); - virtual void ResetCallbacks (u16 id,Flags64 &mask); - void PlaceBindToElForms (); - virtual void SetCallbacks ( ); - virtual void EnabledCallbacks (BOOL val); - virtual void set_DisableParams (const SAllDDOParams& params); - virtual void UpdateRoot (); - virtual void SmoothElementsInertia (float k); - virtual void InterpolateGlobalTransform (Fmatrix* m); - virtual void InterpolateGlobalPosition (Fvector* v); - virtual void GetGlobalTransformDynamic (Fmatrix* m) ; - virtual void GetGlobalPositionDynamic (Fvector* v); - virtual Fmatrix& ObjectInRoot (){return m_object_in_root;} - virtual void ObjectToRootForm (const Fmatrix& form); - virtual dSpaceID dSpace (){return m_space;} - virtual void SetTransform (const Fmatrix& m0); - - virtual void AddTracedGeom (u16 element=0,u16 geom=0); - virtual void SetAllGeomTraced (); - - virtual void ClearTracedGeoms (); - virtual void DisableGeomTrace (); - virtual void EnableGeomTrace (); - - virtual void SetPrefereExactIntegration (); - virtual void CutVelocity (float l_limit,float a_limit); -/////////// ////////////////////////////////////////////////////////////////////////////////////////// - void CreateSpace () ; - void PassEndElements (u16 from,u16 to,CPHShell *dest) ; - void PassEndJoints (u16 from,u16 to,CPHShell *dest) ; - void DeleteElement (u16 element) ; - void DeleteJoint (u16 joint) ; - u16 BoneIdToRootGeom (u16 id) ; -///////////////////////////////////////////////////////////////////////////////////////////////////// -protected: - virtual void get_spatial_params () ; - virtual dGeomID dSpacedGeom () {return (dGeomID)m_space;} - - virtual void ClearRecentlyDeactivated () ; - void ClearCashedTries () ; -private: - //breakable - void setEndElementSplitter () ; - void setElementSplitter (u16 element_number,u16 splitter_position) ; - void setEndJointSplitter () ; - void AddSplitter (CPHShellSplitter::EType type,u16 element,u16 joint) ; - void AddSplitter (CPHShellSplitter::EType type,u16 element,u16 joint,u16 position) ; -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - void AddElementRecursive (CPhysicsElement* root_e, u16 id,Fmatrix global_parent,u16 element_number,bool *vis_check) ; - void PlaceBindToElFormsRecursive (Fmatrix parent,u16 id,u16 element,Flags64 &mask); - void BonesBindCalculate (u16 id_from=0); - void BonesBindCalculateRecursive (Fmatrix parent,u16 id); - void ZeroCallbacksRecursive (u16 id) ; - void SetCallbacksRecursive (u16 id,u16 element) ; - void ResetCallbacksRecursive (u16 id,u16 element,Flags64 &mask) ; - void SetJointRootGeom (CPhysicsElement* root_e,CPhysicsJoint* J) ; - void ReanableObject () ; - void ExplosionHit (const Fvector& pos, const Fvector& dir, float val,const u16 id) ; - void ClearBreakInfo (); - Fmatrix& get_animation_root_matrix ( Fmatrix& m ); - void update_root_transforms (); -IC CPHElement &root_element () { VERIFY( !elements.empty() ); return *(*elements.begin()); } -#ifdef DEBUG - virtual void dbg_draw_velocity ( float scale, u32 color ); - virtual void dbg_draw_force ( float scale, u32 color ); - virtual void dbg_draw_geometry ( float scale, u32 color, Flags32 flags = Flags32().assign( 0 ) ) const ; -#endif -}; -#endif \ No newline at end of file diff --git a/src/xrGame/PHShellActivate.cpp b/src/xrGame/PHShellActivate.cpp deleted file mode 100644 index 6aa89254da1..00000000000 --- a/src/xrGame/PHShellActivate.cpp +++ /dev/null @@ -1,289 +0,0 @@ -#include "StdAfx.h" -#include "PHDynamicData.h" -#include "Physics.h" -#include "tri-colliderknoopc/dTriList.h" -#include "PHShellSplitter.h" -#include "PHFracture.h" -#include "PHJointDestroyInfo.h" -#include "PHCollideValidator.h" -#include "Level.h" -#include "physicsshellholder.h" -#include "PhysicsShellAnimator.h" - - -/////////////////////////////////////////////////////////////// -///#pragma warning(disable:4995) -//#include "../3rd party/ode/ode/src/collision_kernel.h" -//#include "../3rd party/ode/ode/src/joint.h" -//#include "../3rd party/ode/ode/src/objects.h" - -//#pragma warning(default:4995) -/////////////////////////////////////////////////////////////////// - -#include "ExtendedGeom.h" - -#include "PHElement.h" -#include "PHShell.h" -void CPHShell::activate(bool disable) -{ - PresetActive(); - if(!CPHObject::is_active()) vis_update_deactivate(); - if(!disable)EnableObject(0); - -} -void CPHShell::Activate(const Fmatrix &m0,float dt01,const Fmatrix &m2,bool disable){ - - if(isActive())return; - activate(disable); -// ELEMENT_I i; - mXFORM.set(m0); - //for(i=elements.begin();elements.end() != i;++i){ - - // (*i)->Activate(m0,dt01, m2, disable); - //} - - { - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i)(*i)->Activate(mXFORM,disable); - } - - { - JOINT_I i=joints.begin(),e=joints.end(); - for(;i!=e;++i) (*i)->Activate(); - } - - Fmatrix m; - { - Fmatrix old_m = mXFORM;//+GetGlobalTransformDynamic update mXFORM; - GetGlobalTransformDynamic (&m); - mXFORM = old_m; - } - m.invert();m.mulA_43 (mXFORM); - TransformPosition(m); - if(PKinematics()) - { - SetCallbacks( ); - } - - //bActive=true; - //bActivating=true; - m_flags.set(flActive,TRUE); - m_flags.set(flActivating,TRUE); - spatial_register(); -/////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////// - //mXFORM.set(m0); - //Activate(disable); - Fvector lin_vel; - lin_vel.sub(m2.c,m0.c); - set_LinearVel(lin_vel); -} - - - -void CPHShell::Activate(const Fmatrix &transform,const Fvector& lin_vel,const Fvector& ang_vel,bool disable){ - - if(isActive())return; - activate(disable); - - ELEMENT_I i; - mXFORM.set(transform); - for(i=elements.begin();elements.end() != i;++i){ - (*i)->Activate(transform,lin_vel, ang_vel); - } - - { - JOINT_I i=joints.begin(),e=joints.end(); - for(;i!=e;++i) (*i)->Activate(); - } - - if(PKinematics()) - { - SetCallbacks( ); - } - spatial_register(); - //bActive=true; - //bActivating=true; - m_flags.set(flActivating,TRUE); - m_flags.set(flActive,TRUE); -///////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////// - //mXFORM.set(transform); - //Activate(disable); - //set_LinearVel(lin_vel); - //set_AngularVel(ang_vel); - -} - - - -void CPHShell::Activate(bool disable, bool not_set_bone_callbacks /*= false*/) -{ - if(isActive())return; - - activate(disable); - { - IKinematics* K = m_pKinematics; - if(not_set_bone_callbacks) - m_pKinematics = 0; - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i)(*i)->Activate(mXFORM,disable); - m_pKinematics = K; - } - - { - JOINT_I i=joints.begin(),e=joints.end(); - for(;i!=e;++i) (*i)->Activate(); - } - - if(PKinematics() && !not_set_bone_callbacks ) - { - SetCallbacks( ); - } - spatial_register(); - m_flags.set(flActivating,TRUE); - m_flags.set(flActive,TRUE); - -} - - -void CPHShell::Build(bool disable/*false*/) -{ - if(isActive())return; - - PresetActive(); - m_flags.set(flActivating,TRUE); - m_flags.set(flActive,TRUE); - - { - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i) - { - (*i)->build(disable); - } - } - - { - JOINT_I i=joints.begin(),e=joints.end(); - for(;i!=e;++i) (*i)->Create(); - } - -} - -void CPHShell::RunSimulation(bool place_current_forms/*true*/) -{ - if(!CPHObject::is_active()) vis_update_deactivate(); - EnableObject(0); - - - dSpaceSetCleanup(m_space,0); - - { - ELEMENT_I i=elements.begin(),e=elements.end(); - if(place_current_forms) for(;i!=e;++i)(*i)->RunSimulation(mXFORM); - } - { - JOINT_I i=joints.begin(),e=joints.end(); - for(;i!=e;++i) (*i)->RunSimulation(); - } - - spatial_register(); -} - -void CPHShell::AfterSetActive() -{ - if(isActive()) return; - PureActivate(); - //bActive=true; - m_flags.set(flActive,TRUE); - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i)(*i)->PresetActive(); - -} - -void CPHShell::PureActivate() -{ - if(isActive()) return; - //bActive=true; - m_flags.set(flActive,TRUE); - if(!CPHObject::is_active()) vis_update_deactivate(); - EnableObject(0); - m_object_in_root.identity(); - spatial_register(); -} - -void CPHShell::PresetActive() -{ - VERIFY(!isActive()); - if(!m_space) - { - m_space=dSimpleSpaceCreate(0); - dSpaceSetCleanup(m_space,0); - - } -} - - - -void CPHShell::Deactivate(){ - - VERIFY(ph_world); - ph_world->NetRelcase(this); - - if (m_pPhysicsShellAnimatorC) - { - VERIFY( PhysicsRefObject( ) ); - PhysicsRefObject( )->processing_deactivate(); - xr_delete(m_pPhysicsShellAnimatorC); - } - - - if(!isActive())return; - R_ASSERT2(!ph_world->Processing(),"can not deactivate physics shell during physics processing!!!"); - R_ASSERT2(!ph_world->IsFreezed(),"can not deactivate physics shell when ph world is freezed!!!"); - R_ASSERT2(!CPHObject::IsFreezed(),"can not deactivate freezed !!!"); - ZeroCallbacks(); - VERIFY(ph_world&&ph_world->Exist()); - if(isFullActive()) - { - vis_update_deactivate(); - CPHObject::activate(); - ph_world->Freeze(); - CPHObject::UnFreeze(); - ph_world->StepTouch(); - ph_world->UnFreeze(); - //Fmatrix m; - //InterpolateGlobalTransform(&m); - } - spatial_unregister(); - - vis_update_activate(); - //if(ref_object && !CPHObject::is_active() && m_active_count == 0) - //{ - // ref_object->processing_activate(); - //} - DisableObject(); - CPHObject::remove_from_recently_deactivated(); - - - ELEMENT_I i; - for(i=elements.begin();elements.end() != i;++i) - (*i)->Deactivate(); - - JOINT_I j; - for(j=joints.begin();joints.end() != j;++j) - (*j)->Deactivate(); - - - - if(m_space) { - dSpaceDestroy(m_space); - m_space=NULL; - } - //bActive=false; - //bActivating=false; - m_flags.set(flActivating,FALSE); - m_flags.set(flActive,FALSE); - m_traced_geoms.clear(); - CPHObject::UnsetRayMotions(); -} \ No newline at end of file diff --git a/src/xrGame/PHShellCreator.cpp b/src/xrGame/PHShellCreator.cpp index 539fe3929f4..f98bb0b0d6b 100644 --- a/src/xrGame/PHShellCreator.cpp +++ b/src/xrGame/PHShellCreator.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "PHShellCreator.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "gameobject.h" #include "physicsshellholder.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" void CPHShellSimpleCreator::CreatePhysicsShell() { diff --git a/src/xrGame/PHShellNetState.cpp b/src/xrGame/PHShellNetState.cpp deleted file mode 100644 index 2f6d3c63d48..00000000000 --- a/src/xrGame/PHShellNetState.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include "stdafx.h" -#include "physicsshell.h" -#include "phinterpolation.h" -#include "phobject.h" -#include "phworld.h" -#include "phshell.h" - -void CPHShell::net_Import(NET_Packet& P) -{ - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i) - { - (*i)->net_Import(P); - } -} - -void CPHShell::net_Export(NET_Packet& P) -{ - ELEMENT_I i=elements.begin(),e=elements.end(); - for(;i!=e;++i) - { - (*i)->net_Export(P); - } -} \ No newline at end of file diff --git a/src/xrGame/PHShellSplitter.cpp b/src/xrGame/PHShellSplitter.cpp deleted file mode 100644 index 17b798ea849..00000000000 --- a/src/xrGame/PHShellSplitter.cpp +++ /dev/null @@ -1,528 +0,0 @@ -#include "stdafx.h" -#include "Physics.h" -#include "PHShell.h" -#include "PHShellSplitter.h" -#include "PHFracture.h" -#include "PHJointDestroyInfo.h" -#include "Geometry.h" -#include "MathUtils.h" -#include "../Include/xrRender/Kinematics.h" -#include "PHCollideValidator.h" -CPHShellSplitterHolder::CPHShellSplitterHolder(CPHShell* shell) -{ - m_pShell=shell; - m_has_breaks=false; - m_unbreakable=false; -} - -CPHShellSplitterHolder::~CPHShellSplitterHolder() -{ - Deactivate(); - m_splitters.clear(); - m_geom_root_map.clear(); -} -//the simpliest case - a joint to be destroied -shell_root CPHShellSplitterHolder::SplitJoint(u16 aspl) -{ - //create _new physics shell - - CPhysicsShell *new_shell=P_create_Shell(); - CPHShell *new_shell_desc=smart_cast(new_shell); - new_shell_desc->mXFORM.set(m_pShell->mXFORM); - new_shell_desc->m_object_in_root.set(m_pShell->m_object_in_root); - SPLITTER_I splitter=m_splitters.begin()+aspl; - u16 start_element=splitter->m_element; - u16 start_joint=splitter->m_joint; - - u16 end_element=m_pShell->joints[start_joint]->JointDestroyInfo()->m_end_element; - u16 end_joint=m_pShell->joints[start_joint]->JointDestroyInfo()->m_end_joint; - - - shell_root ret = mk_pair(new_shell,(m_pShell->joints[start_joint])->BoneID()); - - - - CShellSplitInfo split_inf; - split_inf.m_bone_id=m_pShell->joints[start_joint]->BoneID(); - split_inf.m_start_el_num=start_element; - split_inf.m_end_el_num=end_element; - split_inf.m_start_jt_num=start_joint; - split_inf.m_end_jt_num=end_joint; - - m_splitters.erase(splitter); - PassEndSplitters(split_inf,new_shell_desc,1,0); - - InitNewShell(new_shell_desc); - m_pShell->PassEndElements(start_element,end_element,new_shell_desc); - m_pShell->PassEndJoints(start_joint+1,end_joint,new_shell_desc); - new_shell_desc->set_PhysicsRefObject(0); - new_shell_desc->PureActivate(); - //new_shell_desc->ObjectInRoot().identity(); - m_pShell->DeleteJoint(start_joint); - new_shell->set_ObjectContactCallback(NULL); - new_shell->set_PhysicsRefObject(NULL); - return ret; -} - -void CPHShellSplitterHolder::PassEndSplitters(const CShellSplitInfo& spl_inf,CPHShell* dest,u16 jt_add_shift,u16 el_add_shift) -{ - - - CPHShellSplitterHolder* &dest_holder=dest->m_spliter_holder; - if(!dest_holder)dest_holder=xr_new(dest); - - ELEMENT_STORAGE &source_elements=m_pShell->elements; - ELEMENT_STORAGE &dest_elements=dest->elements; - ELEMENT_I i_elem=source_elements.begin(),e_elem=source_elements.begin()+spl_inf.m_start_el_num; - u16 shift_e=spl_inf.m_end_el_num-spl_inf.m_start_el_num; - u16 shift_j=spl_inf.m_end_jt_num-spl_inf.m_start_jt_num; - - R_ASSERT2(source_elements.size()>=spl_inf.m_start_el_num&&source_elements.size()>=spl_inf.m_end_el_num,"wrong spl_inf"); - - - for(;i_elem!=e_elem;++i_elem) //until start elem in both joint or elem split fractures - //end elems have to be corrected - //if grater then end elem in moving diapason - { - CPHFracturesHolder *fracturesHolder=(*i_elem)->FracturesHolder(); - if(!fracturesHolder) continue; - FRACTURE_I f_i=fracturesHolder->m_fractures.begin(),f_e=fracturesHolder->m_fractures.end(); - for(;f_i!=f_e;++f_i) - { - - u16 &end_el_num=f_i->m_end_el_num; - u16 &start_el_num=f_i->m_start_el_num; - if(end_el_num>=spl_inf.m_end_el_num) end_el_num=end_el_num-shift_e; - if(start_el_num>=spl_inf.m_end_el_num) start_el_num=start_el_num-shift_e; - - u16 &end_jt_num=f_i->m_end_jt_num; - u16 &start_jt_num=f_i->m_start_jt_num; - if(end_jt_num>=spl_inf.m_end_jt_num) end_jt_num=end_jt_num-shift_j; - if(start_jt_num>=spl_inf.m_end_jt_num) start_jt_num=start_jt_num-shift_j; - } - } - - //same for joints - JOINT_STORAGE &source_joints=m_pShell->joints; - JOINT_I i_joint=source_joints.begin(),e_joint; - if(u16(-1)!=spl_inf.m_start_jt_num) - { - R_ASSERT2(source_joints.size()>=spl_inf.m_start_jt_num&&source_joints.size()>=spl_inf.m_end_jt_num,"wrong spl_inf"); - e_joint=source_joints.begin()+spl_inf.m_start_jt_num; - for(;i_joint!=e_joint;i_joint++) - { - CPHJointDestroyInfo* jointDestroyInfo=(*i_joint)->JointDestroyInfo(); - if(!jointDestroyInfo) continue; - u16 &end_element = jointDestroyInfo->m_end_element; - if(end_element>=spl_inf.m_end_el_num) end_element=end_element-shift_e; - u16 &end_joint = jointDestroyInfo->m_end_joint; - if(end_joint>=spl_inf.m_end_jt_num) end_joint=end_joint-shift_j; - } - } - - - //now process diapason that tobe unsplited - - e_elem=source_elements.begin()+spl_inf.m_end_el_num; - u16 passed_shift_e=spl_inf.m_start_el_num-u16(dest_elements.size()); - u16 passed_shift_j = u16(-1) & (spl_inf.m_start_jt_num + jt_add_shift); - for(;i_elem!=e_elem;++i_elem) - - { - CPHFracturesHolder *fracturesHolder=(*i_elem)->FracturesHolder(); - if(!fracturesHolder) continue; - FRACTURE_I f_i=fracturesHolder->m_fractures.begin(),f_e=fracturesHolder->m_fractures.end(); - for(;f_i!=f_e;++f_i) - { - u16 &end_el_num=f_i->m_end_el_num; - u16 &start_el_num=f_i->m_start_el_num; - end_el_num=end_el_num-passed_shift_e; - start_el_num=start_el_num-passed_shift_e; - - u16 &end_jt_num=f_i->m_end_jt_num; - u16 &start_jt_num=f_i->m_start_jt_num; - end_jt_num=end_jt_num-passed_shift_j; - start_jt_num=start_jt_num-passed_shift_j; - } - } - -//////correct data in fractures for elements allready added to dest with fractures from source/////// -ELEMENT_I i_dest_elem=dest_elements.begin(),e_dest_elem=dest_elements.end(); -for(;i_dest_elem!=e_dest_elem;++i_dest_elem) -{ - CPHFracturesHolder *fracturesHolder=(*i_dest_elem)->FracturesHolder(); - if(!fracturesHolder) continue; - FRACTURE_I f_i=fracturesHolder->m_fractures.begin(),f_e=fracturesHolder->m_fractures.end(); - for(;f_i!=f_e;f_i++) - { - u16 &end_el_num=f_i->m_end_el_num; - u16 &start_el_num=f_i->m_start_el_num; - end_el_num=end_el_num-passed_shift_e; - start_el_num=start_el_num-passed_shift_e; - - u16 &end_jt_num=f_i->m_end_jt_num; - u16 &start_jt_num=f_i->m_start_jt_num; - end_jt_num=end_jt_num-passed_shift_j; - start_jt_num=start_jt_num-passed_shift_j; - } -} -///////////////////////////////////////////////////////////////////////////////////////////////////// - -if(spl_inf.m_end_jt_num!=u16(-1)) -{ - e_joint=source_joints.begin()+spl_inf.m_end_jt_num; - for(;i_joint!=e_joint;++i_joint) - { - CPHJointDestroyInfo* jointDestroyInfo=(*i_joint)->JointDestroyInfo(); - if(!jointDestroyInfo) continue; - u16 &end_element = jointDestroyInfo->m_end_element; - u16 &end_joint = jointDestroyInfo->m_end_joint; - end_element=end_element-passed_shift_e; - end_joint=end_joint-passed_shift_j; - } -} - //the rest unconditionaly shift end & begin - e_elem=source_elements.end(); - for(;i_elem!=e_elem;++i_elem) - - { - CPHFracturesHolder *fracturesHolder=(*i_elem)->FracturesHolder(); - if(!fracturesHolder) continue; - FRACTURE_I f_i=fracturesHolder->m_fractures.begin(),f_e=fracturesHolder->m_fractures.end(); - for(;f_i!=f_e;++f_i) - { - u16 &end_el_num=f_i->m_end_el_num; - u16 &start_el_num=f_i->m_start_el_num; - end_el_num=end_el_num-shift_e; - start_el_num=start_el_num-shift_e; - - u16 &end_jt_num=f_i->m_end_jt_num; - u16 &start_jt_num=f_i->m_start_jt_num; - end_jt_num=end_jt_num-shift_j; - start_jt_num=start_jt_num-shift_j; - } - } - - e_joint=source_joints.end(); - for(;i_joint!=e_joint;++i_joint) - { - CPHJointDestroyInfo* jointDestroyInfo=(*i_joint)->JointDestroyInfo(); - if(!jointDestroyInfo) continue; - u16 &end_element = jointDestroyInfo->m_end_element; - u16 &end_joint = jointDestroyInfo->m_end_joint; - if(end_element>spl_inf.m_end_el_num) end_element=end_element-shift_e; - if(end_joint>spl_inf.m_end_jt_num) end_joint=end_joint-shift_j; - } - // at rest!! pass splitters it is very similar passing fractures - // correct data for splitters before passed and find start splitter to pass - SPLITTER_I spl_e=m_splitters.end(),spl_i=m_splitters.begin(); - for(;spl_i!=spl_e;++spl_i) - { - u16 &elem = spl_i->m_element; - u16 &joint = spl_i->m_joint; - if(spl_i->m_type==CPHShellSplitter::splElement) - { - if( elem!=u16(-1) && elem>=spl_inf.m_start_el_num) break;//we at begining - } - else - { - if( joint!=u16(-1) && joint>=spl_inf.m_start_jt_num) break;//we at begining - } - if(elem!=u16(-1) && elem>spl_inf.m_end_el_num) elem=elem-shift_e; - if(joint!=u16(-1) && joint>spl_inf.m_end_jt_num) joint=joint-shift_j; - } - SPLITTER_I i_from = spl_i; - //correct data for passing splitters and find last splitter to pass - for(;spl_i!=spl_e;++spl_i) - { - u16 &elem = spl_i->m_element; - u16 &joint = spl_i->m_joint; - if(spl_i->m_type==CPHShellSplitter::splElement) - { - if(elem!=u16(-1) && elem>=spl_inf.m_end_el_num) break;//we after begining - } - else - { - if(joint!=u16(-1) && joint>=spl_inf.m_end_jt_num) break;//we after begining - } - if(elem!=u16(-1) ) elem=elem-passed_shift_e; - if(joint!=u16(-1)) joint=joint-passed_shift_j; - - } - - SPLITTER_I i_to = spl_i; - - //corect data for all rest splitters - for(;spl_i!=spl_e;++spl_i) - { - u16 &elem = spl_i->m_element; - u16 &joint = spl_i->m_joint; - if(elem!=u16(-1)) elem=elem-shift_e; - if(joint!=u16(-1)) joint=joint-shift_j; - } - - dest_holder->m_splitters.insert(dest_holder->m_splitters.end(),i_from,i_to); - m_splitters.erase(i_from,i_to); -} - -static ELEMENT_PAIR_VECTOR new_elements; -DEFINE_VECTOR(Fmatrix,TRANSFORM_VECTOR,TRANSFORM_I) -static TRANSFORM_VECTOR bones_bind_forms; -shell_root CPHShellSplitterHolder::ElementSingleSplit(const element_fracture &split_elem,const CPHElement* source_element) -{ - - //const CPHShellSplitter& splitter=m_splitters[aspl]; - //CPHElement* element=m_pShell->elements[splitter.m_element]; - CPhysicsShell *new_shell_last=P_create_Shell(); - CPHShell *new_shell_last_desc=smart_cast(new_shell_last); - new_shell_last->mXFORM.set(m_pShell->mXFORM); const u16 start_joint=split_elem.second.m_start_jt_num; - R_ASSERT(_valid(new_shell_last->mXFORM)); - const u16 end_joint=split_elem.second.m_end_jt_num; - //it is not right for multiple joints attached to the unsplited part becource all these need to be reattached - if(start_joint!=end_joint) - { - JOINT_STORAGE& joints=m_pShell->joints; - JOINT_I i=joints.begin()+ start_joint,e=joints.begin()+ end_joint; - for(;i!=e;++i) - { - - CPHJoint* joint=(*i); - if(joint->PFirst_element()==source_element) - { - IKinematics* K = m_pShell->PKinematics(); - dVector3 safe_pos1, safe_pos2; - dQuaternion safe_q1, safe_q2; - CPhysicsElement* el1=cast_PhysicsElement(split_elem.first),*el2=joint->PSecond_element(); - dBodyID body1=el1->get_body(), body2=el2->get_body(); - dVectorSet(safe_pos1,dBodyGetPosition(body1)); - dVectorSet(safe_pos2,dBodyGetPosition(body2)); - - dQuaternionSet(safe_q1,dBodyGetQuaternion(body1)); - dQuaternionSet(safe_q2,dBodyGetQuaternion(body2)); - - //m_pShell->PlaceBindToElForms(); - - K->LL_GetBindTransform(bones_bind_forms); - el1->SetTransform(bones_bind_forms[el1->m_SelfID]); - el2->SetTransform(bones_bind_forms[el2->m_SelfID]); - joint->ReattachFirstElement(split_elem.first); - - dVectorSet(const_cast(dBodyGetPosition(body1)),safe_pos1); - dVectorSet(const_cast(dBodyGetPosition(body2)),safe_pos2); - - dQuaternionSet(const_cast(dBodyGetQuaternion(body1)),safe_q1); - dQuaternionSet(const_cast(dBodyGetQuaternion(body2)),safe_q2); - - dBodySetPosition(body1,safe_pos1[0],safe_pos1[1],safe_pos1[2]); - dBodySetPosition(body2,safe_pos2[0],safe_pos2[1],safe_pos2[2]); - dBodySetQuaternion(body1,safe_q1); - dBodySetQuaternion(body2,safe_q2); - } - } - // m_pShell->joints[split_elem.second.m_start_jt_num]->ReattachFirstElement(split_elem.first); - } - - //the last new shell will have all splitted old elements end joints and one new element reattached to old joint - //m_splitters.erase(m_splitters.begin()+aspl); - //now aspl points to the next splitter - if((split_elem.first)->FracturesHolder())//if this element can be splitted add a splitter for it - new_shell_last_desc->AddSplitter(CPHShellSplitter::splElement,0,u16(-1));// - - new_shell_last_desc->add_Element(split_elem.first); - //pass splitters taking into account that one element was olready added - PassEndSplitters(split_elem.second,new_shell_last_desc,0,0); - - - InitNewShell(new_shell_last_desc); - m_pShell->PassEndElements(split_elem.second.m_start_el_num,split_elem.second.m_end_el_num,new_shell_last_desc); - - - - m_pShell->PassEndJoints(split_elem.second.m_start_jt_num,split_elem.second.m_end_jt_num,new_shell_last_desc); - new_shell_last_desc->set_PhysicsRefObject(0); -///////////////////temporary for initialization set old Kinematics in new shell///////////////// - new_shell_last->set_Kinematics(m_pShell->PKinematics()); - new_shell_last_desc->AfterSetActive(); - new_shell_last->set_Kinematics(NULL); - VERIFY2(split_elem.second.m_bone_id<64,"strange root"); - VERIFY(_valid(new_shell_last->mXFORM)); - VERIFY(dBodyStateValide(source_element->get_bodyConst())); - VERIFY(dBodyStateValide(split_elem.first->get_body())); - new_shell_last->set_ObjectContactCallback(NULL); - new_shell_last->set_PhysicsRefObject(NULL); - return mk_pair(new_shell_last,split_elem.second.m_bone_id); - -} - - -IC void correct_diapasones(ELEMENT_PAIR_VECTOR& element_pairs) -{ - ELEMENT_PAIR_I i,b=element_pairs.begin(),e=element_pairs.end(); - - for(i=b;i!=e;++i) - { - ELEMENT_PAIR_I j=i+1; - for(;j!=e;++j) - { - j->second.sub_diapasone(CShellSplitInfo(i->second)); - } - - } - -} - -void CPHShellSplitterHolder::SplitElement(u16 aspl,PHSHELL_PAIR_VECTOR &out_shels) -{ - - new_elements.clear(); - SPLITTER_I spl_i=(m_splitters.begin()+aspl); - CPHElement* E= m_pShell->elements[spl_i->m_element]; - E->SplitProcess(new_elements); - - correct_diapasones(new_elements); - - ELEMENT_PAIR_I i=new_elements.begin(),e=new_elements.end(); - - for(;i!=e;++i) - { - out_shels.push_back(ElementSingleSplit(*i,E)); - VERIFY(dBodyStateValide(out_shels.back().first->get_ElementByStoreOrder(0)->get_body())); - } - - if(!E->FracturesHolder()) m_splitters.erase(spl_i);//delete splitter if the element no longer have fractures - else spl_i->m_breaked=false;//it is no longer breaked - -} - -void CPHShellSplitterHolder::SplitProcess(PHSHELL_PAIR_VECTOR &out_shels) -{ - //any split process must start from the end of the elment storage - //this based on that all childs in the bone hierarchy was added after their parrent - - u16 i=u16(m_splitters.size()-1); - for(;u16(-1)!=i;--i) - { - if(m_splitters[i].m_breaked) - switch(m_splitters[i].m_type) - { - case CPHShellSplitter::splJoint: - out_shels.push_back(SplitJoint(i)); - - break; - case CPHShellSplitter::splElement: - SplitElement(i,out_shels); - break; - default: NODEFAULT; - } - } - //VERIFY(dBodyStateValide(out_shels.back().first->get_ElementByStoreOrder(0)->get_body())); - m_has_breaks=false; -} -void CPHShellSplitterHolder::InitNewShell(CPHShell* shell) -{ - shell->PresetActive(); - if(m_pShell->IsGroupObject()) - CPHCollideValidator::RegisterObjToGroup(m_pShell->collide_bits(),*static_cast(shell)); -} - -void CPHShellSplitterHolder::PhTune(dReal step) -{ - SPLITTER_I i=m_splitters.begin(),e=m_splitters.end(); - for(;i!=e;++i) - { - switch(i->m_type) - { - case CPHShellSplitter::splElement: - { - CPHElement* element=m_pShell->elements[i->m_element]; - element->FracturesHolder()->PhTune(element->get_body()); - break; - } - case CPHShellSplitter::splJoint: - { - break; - } - default: NODEFAULT; - } - } -} -void CPHShellSplitterHolder::PhDataUpdate(dReal step) -{ - SPLITTER_I i=m_splitters.begin(),e=m_splitters.end(); - for(;i!=e;++i) - { - switch(i->m_type) - { - case CPHShellSplitter::splElement: - { - CPHElement* element=m_pShell->elements[i->m_element]; - dBodyID body=element->get_body();//!element->EnabledStateOnStep() - if(!dBodyIsEnabled(body)) return;// - i->m_breaked=(element->FracturesHolder()->PhDataUpdate(element))||i->m_breaked; - break; - } - case CPHShellSplitter::splJoint: - { - CPHJoint *j=m_pShell->joints[i->m_joint]; - //if(j->bActive) - i->m_breaked=j->JointDestroyInfo()->Update()||i->m_breaked; - break; - } - default: NODEFAULT; - } - m_has_breaks=m_has_breaks||i->m_breaked; - } -} -void CPHShellSplitterHolder::Activate() -{ - if(m_unbreakable) return; - CPHUpdateObject::Activate(); - if(m_pShell->isActive())PhTune(fixed_step); -} - -void CPHShellSplitterHolder::Deactivate() -{ - CPHUpdateObject::Deactivate(); -} -void CPHShellSplitterHolder::AddSplitter(CPHShellSplitter::EType type,u16 element,u16 joint) -{ - m_splitters.push_back(CPHShellSplitter(type,element,joint)); -} -void CPHShellSplitterHolder::AddSplitter(CPHShellSplitter::EType type,u16 element,u16 joint,u16 position) -{ - m_splitters.insert(m_splitters.begin()+position,CPHShellSplitter(type,element,joint)); -} -CPHShellSplitter::CPHShellSplitter(CPHShellSplitter::EType type,u16 element,u16 joint) -{ - m_breaked=false; - m_type=type; - m_element=element; - m_joint=joint; -} - -void CPHShellSplitterHolder::AddToGeomMap(const id_geom& id_rootgeom) -{ - m_geom_root_map.insert(id_rootgeom); -} - -u16 CPHShellSplitterHolder::FindRootGeom(u16 bone_id) -{ - GEOM_MAP_I iter=m_geom_root_map.find(bone_id); - if(iter==m_geom_root_map.end()) return u16(-1); - - return iter->second->element_position(); - -} -void CPHShellSplitterHolder::SetUnbreakable() -{ - Deactivate();m_unbreakable=true; -} -void CPHShellSplitterHolder::SetBreakable() -{ - m_unbreakable=false;if(m_pShell->isEnabled())Activate(); -} -CPHShellSplitter::CPHShellSplitter() -{ - m_breaked=false; -} - diff --git a/src/xrGame/PHShellSplitter.h b/src/xrGame/PHShellSplitter.h deleted file mode 100644 index 667f89f3ad6..00000000000 --- a/src/xrGame/PHShellSplitter.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef PHSHELL_SPLITTER_H -#define PHSHELL_SPLITTER_H -#include "PHDefs.h" -#include "PHObject.h" -#include "PHFracture.h" - -class CPHShellSplitter; - -class CPHShell; -class CODEGeom; -typedef std::pair id_geom; -DEFINE_MAP(u16,CODEGeom*,GEOM_MAP,GEOM_MAP_I) - -class CPHShellSplitter -{ - friend class CPHShellSplitterHolder; - friend class CPHShell; - -public: - enum EType {splElement,splJoint} ; -private: - bool m_breaked ; - EType m_type ; - u16 m_element ; - u16 m_joint ; - CPHShellSplitter (CPHShellSplitter::EType type,u16 element,u16 joint) ; - CPHShellSplitter () ; -}; - -DEFINE_VECTOR(CPHShellSplitter,SPLITTER_STORAGE,SPLITTER_I) -typedef xr_vector::reverse_iterator SPLITTER_RI; - - -class CPHShellSplitterHolder : public CPHUpdateObject //call all Fractures and Breakable Joints Updates -{ -friend class CPHShell; -bool m_has_breaks ; -bool m_unbreakable ; -CPHShell* m_pShell ; //purpose: to extract elements and joints corresponded splitters -SPLITTER_STORAGE m_splitters ; // -GEOM_MAP m_geom_root_map ; //to find geom pointer by bone id -virtual void PhTune (dReal step) ; //call fractures PhTune for element splitters m_pShell->m_elements[m_splitters[i]->m_element]->m_pFracturesHolder->PhTune() -virtual void PhDataUpdate (dReal step) ; //call fractures PhDataUpdate for element splitters m_pShell->m_elements[m_splitters[i]->m_element]->m_pFracturesHolder->PhDataUpdate() - bool CheckSplitter (u16 aspl) ; // - shell_root SplitJoint (u16 aspl) ; //create new shell moving into it departed elements and joints - shell_root ElementSingleSplit (const element_fracture &split_elem,const CPHElement* source_element) ; - void SplitElement (u16 aspl,PHSHELL_PAIR_VECTOR &out_shels) ;// - void PassEndSplitters (const CShellSplitInfo& spl_inf,CPHShell* dest,u16 jt_add_shift,u16 el_add_shift) ; - void InitNewShell (CPHShell* shell) ; //inits new active shell -public: - CPHShellSplitterHolder (CPHShell* shell) ; -virtual ~CPHShellSplitterHolder () ; - void Activate () ; - void Deactivate () ; - void AddSplitter (CPHShellSplitter::EType type,u16 element,u16 joint) ; - void AddSplitter (CPHShellSplitter::EType type,u16 element,u16 joint,u16 position) ; - void SplitProcess (PHSHELL_PAIR_VECTOR &out_shels) ; - void AddToGeomMap (const id_geom& id_rootgeom) ; - u16 FindRootGeom (u16 bone_id) ; -IC bool Breaked () {return m_has_breaks;} -IC bool isEmpty () {return m_splitters.empty() ;} - void SetUnbreakable () ; - void SetBreakable () ; - bool IsUnbreakable () {return m_unbreakable ;} -}; - - - -#endif \ No newline at end of file diff --git a/src/xrGame/PHSimpleCalls.cpp b/src/xrGame/PHSimpleCalls.cpp index 9cc11c132b0..5d90760f3c2 100644 --- a/src/xrGame/PHSimpleCalls.cpp +++ b/src/xrGame/PHSimpleCalls.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" #include "phsimplecalls.h" //#include "phobject.h" //#include "PHWorld.h" //extern CPHWorld *ph_world; -#include "../xrphysics/IPHWorld.h" +#include "xrPhysics/IPHWorld.h" CPHCallOnStepCondition::CPHCallOnStepCondition() { diff --git a/src/xrGame/PHSimpleCallsScript.cpp b/src/xrGame/PHSimpleCallsScript.cpp index f629d6bc532..b8b4ab087cf 100644 --- a/src/xrGame/PHSimpleCallsScript.cpp +++ b/src/xrGame/PHSimpleCallsScript.cpp @@ -1,7 +1,7 @@ #include "pch_script.h" #include "PHSimpleCalls.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" using namespace luabind; diff --git a/src/xrGame/PHSimpleCharacter.cpp b/src/xrGame/PHSimpleCharacter.cpp deleted file mode 100644 index 84e3995aec0..00000000000 --- a/src/xrGame/PHSimpleCharacter.cpp +++ /dev/null @@ -1,1976 +0,0 @@ -#include "stdafx.h" - -#include "PHDynamicData.h" -#include "ExtendedGeom.h" -#include "../xrEngine/cl_intersect.h" -#include "tri-colliderKNoOPC\__aabb_tri.h" -#include "PHSimpleCharacter.h" -#include "PHContactBodyEffector.h" -#include "ui/uistatic.h" -#include "SpaceUtils.h" -#include "PhysicsGamePars.h" -#include "MathUtils.h" -#include "level.h" -#include "../xrEngine/gamemtllib.h" -#include "gameobject.h" -#include "physicsshellholder.h" -#include "../Include/xrRender/Kinematics.h" -#include "PHSimpleCharacterInline.h" -#include "DamageSource.h" -#include "PHCollideValidator.h" -#include "CalculateTriangle.h" -#include "game_base_space.h" -#include "geometry.h" -//#include "phvalide.h" - - - -IC bool PhOutOfBoundaries (const Fvector& v) -{ - return v.y < phBoundaries.y1; -} -#ifdef DEBUG -# include "debug_renderer.h" -#endif - -const float LOSE_CONTROL_DISTANCE=0.5f; //fly distance to lose control -const float CLAMB_DISTANCE=0.5f; -const float CLIMB_GETUP_HEIGHT=0.3f; - -float IC sgn(float v) -{ - return v<0.f ? -1.f:1.f; -} -bool test_sides(const Fvector ¢er,const Fvector &side_dir,const Fvector &fv_dir,const Fvector &box,int tri_id) -{ - Triangle tri; - InitTriangle(Level().ObjectSpace.GetStaticTris()+tri_id,tri); - Fvector* verts=Level().ObjectSpace.GetStaticVerts(); - { - float dist=cast_fv(tri.norm).dotproduct(center)-tri.dist; - //if(dist<0.f)return false; - //////////////////////////////////////////////tri norm - float fvn=cast_fv(tri.norm).dotproduct(fv_dir);float sg_fvn= sgn(fvn); - float sdn=cast_fv(tri.norm).dotproduct(side_dir);float sg_sdn= sgn(sdn); - if(sg_fvn*fvn*box.z+sg_sdn*sdn*box.x+_abs(tri.norm[1])*box.y>_abs(dist))return false; - } - { - - ///////////////////////////////////////////////side/////////////////////////////////////////////////////////////////////////////////////////////////// - float sdc=side_dir.dotproduct(center); - float sd0=cast_fv(tri.side0).dotproduct(side_dir);float sg_sd0=sgn(sd0); - float sd1=cast_fv(tri.side1).dotproduct(side_dir);float sg_sd1=sgn(sd1); - float abs_sd0=sg_sd0*sd0; - float abs_sd1=sg_sd1*sd1; - - float sd,abs_sd,sg_sd; - u32 v; - if(sg_sd0==sg_sd1) - { - sd=-sd0-sd1; - abs_sd=abs_sd0+abs_sd1; - sg_sd=-sg_sd0; - v=tri.T->verts[2]; - }else if(abs_sd0>abs_sd1) - { - sd=sd0;abs_sd=abs_sd0;sg_sd=sg_sd0; - v=tri.T->verts[0]; - }else - { - sd=sd1;abs_sd=abs_sd1;sg_sd=sg_sd1; - v=tri.T->verts[1]; - } - - float vp=side_dir.dotproduct(verts[v]); - float dist=vp-sdc; - float sg_dist=sgn(dist); - float abs_dist=sg_dist*dist; - - if(sg_dist!=sg_sd) - { - if(abs_dist-abs_sd>box.x)return false; - }else - { - if(abs_dist>box.x) return false; - } - } -////sides cross/////////////////////////////////////////////////////////////////////////////////////////////// - Fvector crses[3]; - crses[0].set(-tri.side0[2],0,tri.side0[0]); - crses[1].set(-tri.side1[2],0,tri.side1[0]); - const Fvector& v2=verts[tri.T->verts[2]]; - const Fvector& v0=verts[tri.T->verts[0]]; - crses[2].x=-(v0.z-v2.z); - crses[2].y=0.f; - crses[2].z=v0.x-v2.x; - for(u8 i=0;3>i;++i) - { - const Fvector &crs=crses[i]; - u32 sv=tri.T->verts[i%3]; - u32 ov=tri.T->verts[(i+2)%3]; - - float c_prg=crs.dotproduct(center); - float sv_prg=crs.dotproduct(verts[sv]); - float ov_prg=crs.dotproduct(verts[ov]); - float dist=c_prg-sv_prg; - float sg_dist=sgn(dist); - if(sgn(ov_prg-c_prg)!=sg_dist) - { - if(_abs(fv_dir.dotproduct(crs))*box.z+_abs(side_dir.dotproduct(crs))*box.x(retrieveGeomUserData(c.geom.g1)->ph_object); - }else - { - ch=static_cast(retrieveGeomUserData(c.geom.g2)->ph_object); - } - VERIFY(ch); - ch->b_side_contact=true; -} - -void CPHSimpleCharacter::SetBox(const dVector3 &sizes) -{ - m_radius=_min(sizes[0],sizes[2])/2.f; - m_cyl_hight=sizes[1]-2.f*m_radius; - if (m_cyl_hight<0.f) m_cyl_hight=0.01f; - const dReal k=1.20f; - dReal doun=m_radius*_sqrt(1.f-1.f/k/k)/2.f; - //m_geom_shell=dCreateCylinder(0,m_radius/k,m_cyl_hight+doun); - dGeomCylinderSetParams(m_geom_shell,m_radius/k,m_cyl_hight+doun); - //m_wheel=dCreateSphere(0,m_radius); - dGeomSphereSetRadius(m_wheel,m_radius); - //m_hat=dCreateSphere(0,m_radius/k); - dGeomSphereSetRadius(m_hat,m_radius/k); - - dGeomSetPosition(m_hat,0.f,m_cyl_hight,0.f); - dGeomSetPosition(m_geom_shell,0.f,m_cyl_hight/2.f-doun,0.f); - - float test_radius=m_radius*2.f; - float test_height=test_radius+m_radius/2.f; - //m_cap=dCreateSphere(0,test_radius); - dGeomSphereSetRadius(m_cap,test_radius); - dGeomSetPosition(m_cap,0.f,test_height,0.f); -} -void CPHSimpleCharacter::get_Box ( Fvector& sz, Fvector& c )const -{ - float r,h; - dGeomCylinderGetParams( m_geom_shell, &r, &h ); - sz.set( 2*r, 2*r + h, 2*r ); - const dReal *rot =NULL ; - const dReal *pos =NULL ; - dMatrix3 rr ; - CODEGeom::get_final_tx( m_shell_transform,pos, rot, cast_fp( c ), rr ); -} - -void CPHSimpleCharacter::Create(dVector3 sizes){ - - if(b_exist) return; - - b_air_contact_state = false ; - lastMaterialIDX = GAMEMTL_NONE_IDX ; - injuriousMaterialIDX= GAMEMTL_NONE_IDX ; - m_creation_step = ph_world->m_steps_num; - //////////////////////////////////////////////////////// - - m_radius=_min(sizes[0],sizes[2])/2.f; - m_current_object_radius=m_radius; - m_cyl_hight=sizes[1]-2.f*m_radius; - if (m_cyl_hight<0.f) m_cyl_hight=0.01f; - - b_exist=true; - const dReal k=1.20f; - dReal doun=m_radius*_sqrt(1.f-1.f/k/k)/2.f; - - m_geom_shell=dCreateCylinder(0,m_radius/k,m_cyl_hight+doun); - - m_wheel=dCreateSphere(0,m_radius); - m_hat=dCreateSphere(0,m_radius/k); - - - - - m_shell_transform=dCreateGeomTransform(0); - dGeomTransformSetCleanup(m_shell_transform,0); - m_hat_transform=dCreateGeomTransform(0); - dGeomTransformSetCleanup(m_hat_transform,0); - //m_wheel_transform=dCreateGeomTransform(0); - - dGeomTransformSetInfo(m_shell_transform,1); - dGeomTransformSetInfo(m_hat_transform,1); - //dGeomTransformSetInfo(m_wheel_transform,1); - //////////////////////////////////////////////////////////////////////// - - - dGeomSetPosition(m_hat,0.f,m_cyl_hight,0.f); - //////////////////////////////////////////////////////////////////////// - - //dGeomSetPosition(chSphera2,0.f,-0.7f,0.f); - - //////////////////////////////////////////////////////////////////////// - dGeomSetPosition(m_geom_shell,0.f,m_cyl_hight/2.f-doun,0.f); - - dGeomTransformSetGeom(m_hat_transform,m_hat); - - dGeomTransformSetGeom(m_shell_transform,m_geom_shell); - m_body=dBodyCreate(0); - Island().AddBody(m_body); - - dGeomSetBody(m_shell_transform,m_body); - dGeomSetBody(m_hat_transform,m_body); - dGeomSetBody(m_wheel,m_body); - - dGeomCreateUserData(m_geom_shell); - - dGeomCreateUserData(m_wheel); - dGeomCreateUserData(m_hat); - - dGeomUserDataSetPhObject(m_wheel,(CPHObject*)this); - dGeomUserDataSetPhObject(m_geom_shell,(CPHObject*)this); - dGeomUserDataSetPhObject(m_hat,(CPHObject*)this); - - ///////////////////////////////////////////////////////////////////////// - dMass m; - dMassSetBox(&m,1,1000000.f,1000000.f,1000000.f); - dMassAdjust(&m,m_mass); - dBodySetMass(m_body,&m); - - m_space=dSimpleSpaceCreate(0); - //dGeomGroupAdd(m_geom_group,m_wheel_transform); - dSpaceAdd(m_space,m_wheel); - - dSpaceAdd(m_space,m_shell_transform); - dSpaceAdd(m_space,m_hat_transform); - //dGeomGroupAdd(chRGeomGroup,chRCylinder); - m_body_interpolation.SetBody(m_body); - - - - float test_radius=m_radius*2.f; - float test_height=test_radius+m_radius/2.f; - m_cap=dCreateSphere(0,test_radius); - dGeomSetPosition(m_cap,0.f,test_height,0.f); - m_cap_transform=dCreateGeomTransform(0); - dGeomTransformSetCleanup(m_cap_transform,0); - dGeomTransformSetInfo(m_cap_transform,1); - dGeomTransformSetGeom(m_cap_transform,m_cap); - dGeomCreateUserData(m_cap); - dGeomGetUserData(m_cap)->b_static_colide=false; - - dGeomUserDataSetPhObject(m_cap,(CPHObject*)this); - dSpaceAdd(m_space,m_cap_transform); - dGeomSetBody(m_cap_transform,m_body); - dGeomUserDataSetObjectContactCallback(m_cap,TestPathCallback); - dGeomGetUserData(m_cap)->b_static_colide=false; - if(m_phys_ref_object) - { - SetPhysicsRefObject(m_phys_ref_object); - } - if(m_object_contact_callback) - { - SetObjectContactCallback(m_object_contact_callback); - } - SetStaticContactCallBack(CharacterContactShotMark); - m_elevator_state.SetCharacter(static_cast(this)); - CPHObject::activate(); - spatial_register(); - m_last_move.set(0,0,0) ; - CPHCollideValidator::SetCharacterClass(*this); - m_collision_damage_info.Construct(); - m_last_environment_update = Fvector().set( -FLT_MAX, -FLT_MAX, -FLT_MAX ); - m_last_picked_material = GAMEMTL_NONE_IDX; -} -void CPHSimpleCharacter::SwitchOFFInitContact() -{ - VERIFY(b_exist); - dGeomUserDataSetPhObject(m_wheel,0); - dGeomUserDataSetPhObject(m_geom_shell,0); - dGeomUserDataSetPhObject(m_hat,0); - b_lose_control=true; - b_any_contacts=false; - is_contact=false; - b_foot_mtl_check =true ; - b_on_ground=b_valide_ground_contact=false; -} -void CPHSimpleCharacter::SwitchInInitContact() -{ - VERIFY(b_exist); - dGeomUserDataSetPhObject(m_wheel,(CPHObject*)this); - dGeomUserDataSetPhObject(m_geom_shell,(CPHObject*)this); - dGeomUserDataSetPhObject(m_hat,(CPHObject*)this); - -} -void CPHSimpleCharacter::Destroy(){ - if(!b_exist) return; - b_exist=false; - R_ASSERT2(!ph_world->Processing(),"can not deactivate physics character shell during physics processing!!!");//if(ph_world) - R_ASSERT2(!ph_world->IsFreezed(),"can not deactivate physics character when ph world is freezed!!!"); - R_ASSERT2(!CPHObject::IsFreezed(),"can not deactivate freezed !!!"); - m_elevator_state.Deactivate(); - - spatial_unregister(); - CPHObject::deactivate(); - - - if(m_cap) { - dGeomDestroyUserData(m_cap); - dGeomDestroy(m_cap); - m_cap=NULL; - } - - if(m_cap_transform){ - dGeomDestroyUserData(m_cap_transform); - dGeomDestroy(m_cap_transform); - m_cap_transform=NULL; - } - - if(m_geom_shell){ - dGeomDestroyUserData(m_geom_shell); - dGeomDestroy(m_geom_shell); - m_geom_shell=NULL; - } - - if(m_wheel) { - dGeomDestroyUserData(m_wheel); - dGeomDestroy(m_wheel); - m_wheel=NULL; - } - - if(m_shell_transform){ - dGeomDestroyUserData(m_shell_transform); - dGeomDestroy(m_shell_transform); - m_shell_transform=NULL; - } - - - - - if(m_wheel_transform){ - dGeomDestroyUserData(m_wheel_transform); - dGeomDestroy(m_wheel_transform); - m_wheel_transform=NULL; - } - - - if(m_hat){ - dGeomDestroyUserData(m_hat); - dGeomDestroy(m_hat); - m_hat=NULL; - } - if(m_hat_transform){ - dGeomDestroyUserData(m_hat_transform); - dGeomDestroy(m_hat_transform); - m_hat_transform=NULL; - } - - if(m_space){ - dSpaceDestroy(m_space); - m_space=NULL; - } - - if(m_body) { - Island().RemoveBody(m_body); - dBodyDestroy(m_body); - m_body=NULL; - } - - -} -const static u64 impulse_time_constant=30; -void CPHSimpleCharacter::ApplyImpulse(const Fvector& dir,dReal P) -{ - if(!b_exist||b_external_impulse) return; - //if(!dBodyIsEnabled(m_body)) dBodyEnable(m_body); - m_ext_imulse.set(dir); - if(b_lose_control||b_jumping||b_jump) - { - //m_ext_imulse.y-=3.f ; - //m_ext_imulse.normalize_safe() ; - m_ext_imulse.set(0,-1,0); - //P*=0.3f ; - } - Enable(); - b_lose_control=true; - b_external_impulse=true; - m_ext_impuls_stop_step=ph_world->m_steps_num+impulse_time_constant; - //m_ext_imulse.set(Fvector().mul(dir,P/fixed_step/impulse_time_constant)); - dBodySetForce(m_body,m_ext_imulse.x*P/fixed_step,m_ext_imulse.y*P/fixed_step,m_ext_imulse.z*P/fixed_step); -} - -void CPHSimpleCharacter::ApplyForce(const Fvector& force) -{ - ApplyForce(force.x,force.y,force.z); -} - -void CPHSimpleCharacter::ApplyForce(float x, float y, float z) -{ - if(!b_exist) return; - Enable(); - dBodyAddForce(m_body,x,y,z); - //BodyCutForce(m_body,5.f,0.f); -} - -void CPHSimpleCharacter::ApplyForce(const Fvector& dir,float force) -{ - ApplyForce(dir.x*force,dir.y*force,dir.z*force); -} - -void CPHSimpleCharacter::PhDataUpdate(dReal /**step/**/){ - /////////////////// - - - SafeAndLimitVelocity(); - - if( !dBodyIsEnabled(m_body)) { - if(!ph_world->IsFreezed())b_lose_control=false; - return; - } - if(is_contact&&!is_control&&!b_lose_ground) - Disabling(); - - - /////////////////////// - if(ph_world->m_steps_num>m_ext_impuls_stop_step) - { - b_external_impulse = false ; - m_ext_impuls_stop_step = u64(-1) ; - m_ext_imulse .set(0,0,0) ; - Fvector vel ; - GetVelocity (vel) ; - dVectorLimit (cast_fp(vel),m_max_velocity,cast_fp(vel)); - SetVelocity(Fvector().set(0,0,0)) ; - } - was_contact = is_contact ; - was_control = is_control ; - b_was_side_contact = b_side_contact ; - is_contact = false ; - b_side_contact = false ; - b_any_contacts = false ; - b_valide_ground_contact = false ; - b_valide_wall_contact = false ; - - - b_was_on_object = b_on_object ; - b_on_object = false ; - b_death_pos = false ; - m_contact_count = 0 ; - m_friction_factor = 0.f ; - b_collision_restrictor_touch= false ; - b_foot_mtl_check = true ; - dMatrix3 R; - dRSetIdentity (R); - dBodySetAngularVel(m_body,0.f,0.f,0.f); - dBodySetRotation(m_body,R); - - dMass mass; - const float *linear_velocity =dBodyGetLinearVel(m_body); - dReal linear_velocity_mag =_sqrt(dDOT(linear_velocity,linear_velocity)); - dBodyGetMass(m_body,&mass); - dReal l_air=linear_velocity_mag*default_k_l;//force/velocity !!! - if(l_air>mass.mass/fixed_step) l_air=mass.mass/fixed_step;//validate - - if(!fis_zero(l_air)) - dBodyAddForce( - m_body, - -linear_velocity[0]*l_air, - -linear_velocity[1]*l_air, - -linear_velocity[2]*l_air - ); - if(b_non_interactive) - { - Disable(); - dBodySetPosition( m_body, m_last_move.x, m_last_move.y, m_last_move.z ); - } - m_last_move.sub(cast_fv(dBodyGetPosition(m_body)),m_last_move); - m_last_move.mul(1.f/fixed_step); - VERIFY2(dBodyStateValide(m_body),"WRONG BODYSTATE IN PhDataUpdate"); - if(PhOutOfBoundaries(cast_fv(dBodyGetPosition(m_body))))Disable(); - VERIFY_BOUNDARIES(cast_fv(dBodyGetPosition(m_body)),phBoundaries,PhysicsRefObject()); - m_body_interpolation.UpdatePositions(); -} - -void CPHSimpleCharacter::PhTune(dReal step){ - - //if(b_non_interactive) - //{ - // dGeomSetBody(m_shell_transform,m_body); - // dGeomSetBody(m_hat_transform,m_body); - // dGeomSetBody(m_wheel,m_body); - // dGeomSetBody(m_cap_transform,m_body); - //} - - m_last_move.set(cast_fv(dBodyGetPosition(m_body))); - m_elevator_state.PhTune(step); - - - - b_air_contact_state=!is_contact; - - -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgCharacterControl)) - { - if(b_air_contact_state)DBG_DrawPoint(cast_fv(dBodyGetPosition(m_body)),m_radius,D3DCOLOR_XRGB(255,0,0)); - - } -#endif - bool b_good_graund=b_valide_ground_contact&&m_ground_contact_normal[1]>M_SQRT1_2; - - dxGeomUserData *ud=dGeomGetUserData(m_wheel); - if((ud->pushing_neg||ud->pushing_b_neg)&&!b_death_pos) - { - b_death_pos=true; -//#ifdef DEBUG -// Msg("death pos %f2.2,%f2.2,%f2.2",ud->last_pos[0],ud->last_pos[1],ud->last_pos[2]); -//#endif - Fvector pos;pos.set(cast_fv(dBodyGetPosition(m_body))); - Fvector d;d.set(cast_fv(dBodyGetLinearVel(m_body)));d.mul(fixed_step); - pos.sub(d); - if(!ud->pushing_b_neg) - { - //Fvector movement;movement.sub(cast_fv(dGeomGetPosition(m_wheel)),cast_fv(ud->last_pos)); - - dVectorSet(m_death_position,cast_fp(pos)); - } - else - { - dVectorSet(m_death_position,cast_fp(pos)); - } - } - - if(b_death_pos&&!(ud->pushing_neg||ud->pushing_b_neg)) - { - b_death_pos=false; - } - - CPHContactBodyEffector* contact_effector= - (CPHContactBodyEffector*) dBodyGetData(m_body); - if(contact_effector)contact_effector->Apply(); - - if(!dBodyIsEnabled(m_body)) - { - if(!ph_world->IsFreezed())b_lose_control=false; - return; - } - - if(m_acceleration.magnitude()>0.1f) is_control=true; - else is_control=false; - - b_depart=was_contact&&(!is_contact); - b_stop_control=was_control&&(!is_control); - b_meet=(!was_contact)&&(is_contact); - if(b_lose_control&&(is_contact||m_elevator_state.ClimbingState())) - b_meet_control=true; - b_on_ground=b_valide_ground_contact ||(b_meet&&(!b_depart)); - - - if(m_elevator_state.ClimbingState()) - { - b_side_contact=false; - m_friction_factor=1.f; - if(b_stop_control) - dBodySetLinearVel(m_body,0.f,0.f,0.f); - } - - //save depart position - if(b_depart) - dVectorSet(m_depart_position,dBodyGetPosition(m_body)); - - const dReal* velocity=dBodyGetLinearVel(m_body); - dReal linear_vel_smag=dDOT(velocity,velocity); - if(b_lose_control && - ( - b_on_ground && - m_ground_contact_normal[1]>M_SQRT1_2/2.f - //&& -// !b_external_impulse - /*&& - dSqrt(velocity[0]*velocity[0]+velocity[2]*velocity[2])<5.*/|| - fis_zero(linear_vel_smag) || - m_elevator_state.ClimbingState() - ) - ) - b_lose_control=false; - - - if(b_jumping&&b_good_graund ||(m_elevator_state.ClimbingState()&&b_valide_wall_contact)) //b_good_graund=b_valide_ground_contact&&m_ground_contact_normal[1]>M_SQRT1_2 - b_jumping=false; - - //deside if control lost - if(!b_on_ground && !m_elevator_state.ClimbingState()) - { - const dReal* current_pos=dBodyGetPosition(m_body); - dVector3 dif={current_pos[0]-m_depart_position[0], - current_pos[1]-m_depart_position[1], - current_pos[2]-m_depart_position[2]}; - if(dDOT(dif,dif)> - LOSE_CONTROL_DISTANCE* - LOSE_CONTROL_DISTANCE&&dFabs(dif[1])>0.1) - { - b_lose_control=true; - b_depart_control=true; - } - } - - ValidateWalkOn(); - - //jump - if(b_jump) - { - b_lose_control=true; - dBodySetLinearVel(m_body,m_jump_accel.x,m_jump_accel.y,m_jump_accel.z);//vel[1]+ - //Log("jmp",m_jump_accel); - dVectorSet(m_jump_depart_position,dBodyGetPosition(m_body)); - //m_jump_accel=m_acceleration; - b_jump=false; - b_jumping=true; - m_elevator_state.Depart(); - Enable(); - } - - b_lose_ground=!(b_good_graund||m_elevator_state.ClimbingState())||b_lose_control; - - - - ApplyAcceleration(); - - - - dReal* chVel=const_cast(dBodyGetLinearVel(m_body)); - //if(b_jump) - // dBodyAddForce(m_body,0.f,m_control_force[1],0.f);//+2.f*9.8f*70.f - //else - dMass m; - dBodyGetMass(m_body,&m); - if(is_control){ - dVector3 sidedir; - dVector3 y={0.,1.,0.}; - dCROSS(sidedir,=,m_control_force,y); - accurate_normalize(sidedir); - dReal vProj=dDOT(sidedir,chVel); - - dBodyAddForce(m_body,m_control_force[0],m_control_force[1],m_control_force[2]);//+2.f*9.8f*70.f - if(!b_lose_control||b_clamb_jump) - dBodyAddForce(m_body, - -sidedir[0]*vProj*(500.f+200.f*b_clamb_jump)*m_friction_factor, - -m.mass*(50.f)*(!b_lose_control&&!(is_contact||(b_any_contacts))),//&&!b_climb - -sidedir[2]*vProj*(500.f+200.f*b_clamb_jump)*m_friction_factor - ); -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgCharacterControl)) - { - const Fvector dipsp = Fvector().set(0,0.02f,0); - DBG_DrawLine(cast_fv(dBodyGetPosition(m_body)),Fvector().add(cast_fv(dBodyGetPosition(m_body)),Fvector().mul(cast_fv(sidedir),1.f)),D3DCOLOR_XRGB(0,0,255)); - DBG_DrawLine(cast_fv(dBodyGetPosition(m_body)),Fvector().add(cast_fv(dBodyGetPosition(m_body)),Fvector().mul(cast_fv(m_control_force),1.f/1000.f)),D3DCOLOR_XRGB(0,0,255)); - DBG_DrawLine(Fvector().add(cast_fv(dBodyGetPosition(m_body)),dipsp), - Fvector().add(Fvector().add(cast_fv(dBodyGetPosition(m_body)),dipsp),Fvector().mul(cast_fv(dBodyGetForce(m_body)),1.f/1000.f)),D3DCOLOR_XRGB(255,0,0)); - } -#endif - //if(b_clamb_jump){ - //accurate_normalize(m_control_force); - //dReal proj=dDOT(m_control_force,chVel); - //if(proj<0.f) - // dBodyAddForce(m_body,-chVel[0]*500.f,-chVel[1]*500.f,-chVel[2]*500.f); - // } - } - - - if(b_jumping) - { - - dReal proj=m_acceleration.x*chVel[0]+m_acceleration.z*chVel[2]; - - const dReal* current_pos=dBodyGetPosition(m_body); - dVector3 dif={current_pos[0]-m_jump_depart_position[0], - current_pos[1]-m_jump_depart_position[1], - current_pos[2]-m_jump_depart_position[2]}; - dReal amag =_sqrt(m_acceleration.x*m_acceleration.x+m_acceleration.z*m_acceleration.z); - if(amag>0.f) - if(dif[0]*m_acceleration.x/amag+dif[2]*m_acceleration.z/amag<0.3f) - { - dBodyAddForce(m_body,m_acceleration.x/amag*1000.f,0,m_acceleration.z/amag*1000.f); - } - if(proj<0.f){ - - dReal vmag=chVel[0]*chVel[0]+chVel[2]*chVel[2]; - dBodyAddForce(m_body,chVel[0]/vmag/amag*proj*3000.f,0,chVel[2]/vmag/amag*proj*3000.f); - } - } - //else - //dBodyAddForce(m_body,-chVel[0]*10.f,-20.f*70.f*(!is_contact),-chVel[2]*10.f); - - //if(b_depart&&!b_clamb_jump&&!b_jump&&!b_jumping&&is_control&&!b_external_impulse&&!m_elevator_state.Active()){ - // dBodyAddForce(m_body,0,-m.mass*ph_world->Gravity()/fixed_step,0); - //} - - BodyCutForce(m_body,5.f,0.f); -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgCharacterControl)) - { - const Fvector dipsp = Fvector().set(0,0.02f,0); - DBG_DrawLine(Fvector().add(cast_fv(dBodyGetPosition(m_body)),dipsp), - Fvector().add(Fvector().add(cast_fv(dBodyGetPosition(m_body)),dipsp),Fvector().mul(cast_fv(dBodyGetForce(m_body)),1.f/1000.f)),D3DCOLOR_XRGB(255,0,0)); - } -#endif -} - - - -const float CHWON_ACCLEL_SHIFT=0.4f; -const float CHWON_AABB_FACTOR =1.f; -const float CHWON_ANG_COS =M_SQRT1_2; -const float CHWON_CALL_UP_SHIFT=0.05f; -const float CHWON_CALL_FB_HIGHT=1.5f; -const float CHWON_AABB_FB_FACTOR =1.f; - -void CPHSimpleCharacter::ValidateWalkOn() -{ - if(b_on_object||b_was_on_object) - { - b_clamb_jump=ValidateWalkOnMesh(); - ValidateWalkOnObject(); - } - else b_clamb_jump=ValidateWalkOnMesh()&&!m_elevator_state.NearDown(); -} -bool CPHSimpleCharacter::ValidateWalkOnObject() -{ - //deside to stop clamb - if(b_clamb_jump){ - const dReal* current_pos=dBodyGetPosition(m_body); - dVector3 dif={current_pos[0]-m_clamb_depart_position[0], - current_pos[1]-m_clamb_depart_position[1], - current_pos[2]-m_clamb_depart_position[2]}; - if( //!b_valide_wall_contact|| - //(dDOT(dif,dif)>CLAMB_DISTANCE*CLAMB_DISTANCE)) // (m_wall_contact_normal[1]> M_SQRT1_2) || ] - dFabs(dif[1])>CLAMB_DISTANCE){ - b_clamb_jump=false; - // dBodySetLinearVel(m_body,0.f,0.f,0.f); - } - } - - //decide to clamb - if(!m_elevator_state.Active() &&b_valide_wall_contact && (m_contact_count>1)&&(m_wall_contact_normal[1]0.001f) - if(((m_wall_contact_position[0]-m_ground_contact_position[0])*m_control_force[0]+ - (m_wall_contact_position[2]-m_ground_contact_position[2])*m_control_force[2])>0.05f && - m_wall_contact_position[1]-m_ground_contact_position[1]>0.01f) - b_clamb_jump=true; - - - } - - if(b_valide_wall_contact && (m_contact_count>1)&& b_clamb_jump) - if( - dFabs((m_wall_contact_position[0]-m_ground_contact_position[0])+ //*m_control_force[0] - (m_wall_contact_position[2]-m_ground_contact_position[2]))>0.05f &&//0.01f//*m_control_force[2] - m_wall_contact_position[1]-m_ground_contact_position[1]>0.01f) - dVectorSet(m_clamb_depart_position,dBodyGetPosition(m_body)); - return b_clamb_jump; -} -bool CPHSimpleCharacter::ValidateWalkOnMesh() -{ - Fvector AABB,AABB_forbid,center,center_forbid,accel_add,accel; - - AABB.x=m_radius; - AABB.y=m_radius; - AABB.z=m_radius; - - AABB_forbid.set(AABB); - //AABB_forbid.x*=0.7f; - //AABB_forbid.z*=0.7f; - AABB_forbid.y+=m_radius; - AABB_forbid.mul(CHWON_AABB_FB_FACTOR); - - accel_add.set(m_acceleration); - float mag=accel_add.magnitude(); - if(!(mag>0.f)) return - true; - accel_add.mul(CHWON_ACCLEL_SHIFT/mag); - accel.set(accel_add); - accel.div(CHWON_ACCLEL_SHIFT); - AABB.mul(CHWON_AABB_FACTOR); - GetPosition(center); - center.add(accel_add); - center_forbid.set(center); - center_forbid.y+=CHWON_CALL_FB_HIGHT; - center.y+=m_radius+CHWON_CALL_UP_SHIFT; - - // perform single query / two usages - Fbox query,tmp ; - Fvector q_c, q_d ; - query.set (center_forbid,center_forbid); - query.grow (AABB_forbid ); - tmp.set (center,center ); - tmp.grow (AABB ); - query.merge (tmp); - query.get_CD (q_c,q_d); - - XRC.box_options (0); - XRC.box_query (Level().ObjectSpace.GetStaticModel(),q_c,q_d); - //Fvector fv_dir;fv_dir.mul(accel,1.f/mag); - Fvector sd_dir;sd_dir.set(-accel.z,0,accel.x); - Fvector obb_fb;obb_fb.set(m_radius*0.5f,m_radius*2.f,m_radius*0.7f); - Fvector obb;obb.set(m_radius*0.5f,m_radius,m_radius*0.7f); -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgCharacterControl)) - { - Fmatrix m;m.identity(); - m.i.set(sd_dir); - m.k.set(accel); - m.c.set(center); - DBG_DrawOBB(m,obb,D3DCOLOR_XRGB(0,255,0)); - m.c.set(center_forbid); - DBG_DrawOBB(m,obb_fb,D3DCOLOR_XRGB(255,0,0)); - } -#endif - - //if(XRC.r_end()!=XRC.r_begin()) return false; - CDB::RESULT* R_begin = XRC.r_begin(); - CDB::RESULT* R_end = XRC.r_end(); - for (CDB::RESULT* Res=R_begin; Res!=R_end; ++Res) - { - SGameMtl* m = GMLib.GetMaterialByIdx(Res->material); - if(m->Flags.test(SGameMtl::flPassable))continue; - //CDB::TRI* T = T_array + Res->id; - Point vertices[3]={Point((dReal*)&Res->verts[0]),Point((dReal*)&Res->verts[1]),Point((dReal*)&Res->verts[2])}; - if(__aabb_tri(Point((float*)¢er_forbid),Point((float*)&AABB_forbid),vertices)) - { - - - if( test_sides(center_forbid,sd_dir,accel,obb_fb,Res->id)) - { -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgCharacterControl)) - { - DBG_DrawTri(Res,D3DCOLOR_XRGB(255,0,0)); - } -#endif - b_side_contact=true; - return - false; - } - //cast_fv(side0).sub(Res->verts[1],Res->verts[0]); - //cast_fv(side1).sub(Res->verts[2],Res->verts[1]); - //dCROSS(norm,=,side0,side1);//optimize it !!! - //cast_fv(norm).normalize(); - - //if(dDOT(norm,(float*)&accel)<-CHWON_ANG_COS) - - } - } - - for (CDB::RESULT* Res=R_begin; Res!=R_end; ++Res) - { - //CDB::TRI* T = T_array + Res->id; - SGameMtl* m = GMLib.GetMaterialByIdx(Res->material); - if(m->Flags.test(SGameMtl::flPassable))continue; - Point vertices[3]={Point((dReal*)&Res->verts[0]),Point((dReal*)&Res->verts[1]),Point((dReal*)&Res->verts[2])}; - if(__aabb_tri(Point((float*)¢er),Point((float*)&AABB),vertices)){ - if(test_sides(center,sd_dir,accel,obb,Res->id)) - { -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgCharacterControl)) - { - DBG_DrawTri(Res,D3DCOLOR_XRGB(0,255,0)); - } -#endif - return true; - } - } - } - return - false; -} -void CPHSimpleCharacter::SetAcceleration(Fvector accel){ - if(!b_exist) return; - - if(!dBodyIsEnabled( m_body)) - if(!fsimilar(0.f,accel.magnitude())) - Enable(); - m_acceleration=accel; -} -void CPHSimpleCharacter::SetCamDir(const Fvector& cam_dir) -{ - m_cam_dir.set(cam_dir); -} -static const float pull_force=25.f; -void CPHSimpleCharacter::ApplyAcceleration() -{ - - dVectorSetZero(m_control_force); - //if(m_max_velocityM_SQRT1_2)){//M_SQRT1_2//0.8660f - dCROSS(fvdir,=,sidedir,m_ground_contact_normal); - accurate_normalize(fvdir); - dVectorAddMul(m_control_force,fvdir,m.mass*pull_force); - } - else{ - dVectorSet(fvdir,accel); - accurate_normalize(fvdir); - dVectorAddMul(m_control_force,fvdir,m.mass*pull_force*1.5f); - } - - } - if(!m_elevator_state.ClimbingState()&&b_clamb_jump){//&&m_wall_contact_normal[1]=0.f ? m_control_force[0] : -m_control_force[0]; - m_control_force[2]=m_control_force[2]*accel[2]>=0.f ? m_control_force[2] : -m_control_force[2]; - } - dVectorMul(m_control_force,m_friction_factor); -} - - -void CPHSimpleCharacter::IPosition(Fvector& pos) { - - if(!b_exist){ - pos.set(cast_fv(m_safe_position)); - } - else{ - m_body_interpolation.InterpolatePosition(pos); - pos.y-=m_radius; - } - VERIFY_BOUNDARIES(pos,phBoundaries,PhysicsRefObject()); - return; -} - -void CPHSimpleCharacter::SetPosition(const Fvector &pos){ - VERIFY_BOUNDARIES(pos,phBoundaries,PhysicsRefObject()); - if(!b_exist) return; - m_death_position[0]=pos.x; - m_death_position[1]=pos.y+m_radius; - m_death_position[2]=pos.z; - m_safe_position[0]=pos.x; - m_safe_position[1]=pos.y+m_radius; - m_safe_position[2]=pos.z; - b_death_pos=false; - - dGeomGetUserData(m_wheel)->pushing_b_neg=false; - dGeomGetUserData(m_hat)->pushing_b_neg=false; - dGeomGetUserData(m_geom_shell)->pushing_b_neg=false; - dGeomGetUserData(m_hat)->pushing_b_neg=false; - dGeomGetUserData(m_wheel)->pushing_neg=false; - dGeomGetUserData(m_hat)->pushing_neg=false; - dGeomGetUserData(m_geom_shell)->pushing_neg=false; - dGeomGetUserData(m_hat)->pushing_neg=false; - - dBodySetPosition(m_body,pos.x,pos.y+m_radius,pos.z); - CPHDisablingTranslational::Reinit(); - m_body_interpolation.ResetPositions(); - CPHObject::spatial_move(); -} - - - -void CPHSimpleCharacter::GetPosition(Fvector& vpos) -{ - if(!b_exist){ - vpos.set(m_safe_position[0],m_safe_position[1]-m_radius,m_safe_position[2]); - } - else{ - const dReal* pos=dBodyGetPosition(m_body); - dVectorSet((dReal*)&vpos,pos); - vpos.y-=m_radius; - } - - VERIFY_BOUNDARIES(vpos,phBoundaries,PhysicsRefObject()); -} -void CPHSimpleCharacter:: GetPreviousPosition (Fvector& pos) -{ - VERIFY(b_exist); - VERIFY(!ph_world->Processing()); - m_body_interpolation.GetPosition(pos,0); -} -void CPHSimpleCharacter::GetVelocity(Fvector& vvel) const -{ - if(!b_exist){ - - vvel.set(m_safe_velocity[0],m_safe_velocity[1],m_safe_velocity[2]); - return ; - } - const dReal* vel=dBodyGetLinearVel(m_body); - dVectorSet((dReal*)&vvel,vel); - return; -} - - -void CPHSimpleCharacter::SetVelocity(Fvector vel) -{ - if(!b_exist) return; - float sq_mag=vel.square_magnitude(); - if(sq_mag>default_l_limit*default_l_limit) - { - float mag=_sqrt(sq_mag); - vel.mul(default_l_limit/mag); -#ifdef DEBUG - Msg("set velocity magnitude is too large %f",mag); -#endif - } - dBodySetLinearVel(m_body,vel.x,vel.y,vel.z); -} - - -void CPHSimpleCharacter::SetMas(dReal mass){ - m_mass=mass; - if(!b_exist) return; - dMass m; - //dMassSetBox(&m,1,1000000.f,1000000.f,1000000.f); - dMassSetSphere(&m,1,1000000.f/2.f); - dMassAdjust(&m,mass); - dBodySetMass(m_body,&m); -} -#ifdef DEBUG -void CPHSimpleCharacter::OnRender(){ - if(!b_exist) return; - Fmatrix m; - m.identity(); - Fvector n=*(Fvector*)m_ground_contact_normal; - n.mul(100.f); - Fvector pos; - GetPosition(pos); - pos.y+=m_radius; - Level().debug_renderer().draw_line(m,pos,*(Fvector*)m_control_force, color_rgba(256,0,0,1)); - Level().debug_renderer().draw_line(m,pos,n, 0xefffffff); - - - Fvector scale; - scale.set(0.35f,0.35f,0.35f); - Fmatrix M; - M.identity(); - M.scale(scale); - M.c.set(pos); - - - Level().debug_renderer().draw_ellipse(M, 0xffffffff); - -#ifdef DRAW_BOXES - Level().debug_renderer().draw_aabb (m_bcenter,m_AABB.x,m_AABB.y,m_AABB.z,D3DCOLOR_XRGB(0,0,255)); - Level().debug_renderer().draw_aabb (m_bcenter_forbid,m_AABB_forbid.x,m_AABB_forbid.y,m_AABB_forbid.z,D3DCOLOR_XRGB(255,0,0)); -#endif - ///M.c.set(0.f,1.f,0.f); - //Level().debug_renderer().draw_ellipse(M, 0xffffffff); -} -#endif - - -EEnvironment CPHSimpleCharacter::CheckInvironment() -{ - //if(b_on_ground||(is_control&&!b_lose_control)) - if(b_lose_control) - return peInAir; - //else return peAtWall; - else if(m_elevator_state.ClimbingState()) - return peAtWall; - - return peOnGround; - -} - - - -void CPHSimpleCharacter::SetPhysicsRefObject (CPhysicsShellHolder* ref_object) -{ - m_phys_ref_object=ref_object; - if(b_exist) - { - dGeomUserDataSetPhysicsRefObject(m_geom_shell,ref_object); - dGeomUserDataSetPhysicsRefObject(m_wheel,ref_object); - dGeomUserDataSetPhysicsRefObject(m_hat,ref_object); - dGeomUserDataSetPhysicsRefObject(m_cap,m_phys_ref_object); - } -} - - -/* -void CPHSimpleCharacter::CaptureObject(dBodyID body,const dReal* anchor) -{ - m_capture_joint=dJointCreateBall(0,0); - Island().AddJoint(m_capture_joint); - dJointAttach(m_capture_joint,m_body,body); - dJointSetBallAnchor(m_capture_joint,anchor[0],anchor[1],anchor[2]); - dJointSetFeedback(m_capture_joint,&m_capture_joint_feedback); -} -*/ -/* -void CPHSimpleCharacter::CapturedSetPosition(const dReal* position) -{ - //if(!m_capture_joint) return; - //dJointSetBallAnchor(m_capture_joint,position[0],position[1],position[2]); -} - -void CPHSimpleCharacter::CheckCaptureJoint() -{ - //m_capture_joint_feedback -} - -void CPHSimpleCharacter::doCaptureExist(bool& do_exist) -{ - do_exist=!!m_capture_joint; -} -*/ -void CPHSimpleCharacter::SafeAndLimitVelocity() -{ - - const float *linear_velocity =dBodyGetLinearVel(m_body); - if(dV_valid(linear_velocity)) - { - dReal mag=_sqrt(linear_velocity[0]*linear_velocity[0]+linear_velocity[1]*linear_velocity[1]+linear_velocity[2]*linear_velocity[2]);//; - //limit velocity - dReal l_limit; - if(is_control&&!b_lose_control) - l_limit = m_max_velocity/phTimefactor; - else - l_limit=default_l_limit; - - if(b_external_impulse) - { - float sq_mag=m_acceleration.square_magnitude(); - float ll_limit=m_ext_imulse.dotproduct(cast_fv(linear_velocity))*10.f/fixed_step; - if(sq_mag>EPS_L) - { - Fvector acc;acc.set(Fvector().mul(m_acceleration,1.f/_sqrt(sq_mag))); - Fvector vll;vll.mul(cast_fv(linear_velocity),1.f/mag); - float mxa=vll.dotproduct(acc); - if(mxa*ll_limit>l_limit&&!fis_zero(mxa)){ - ll_limit=l_limit/mxa; - } - - } - if(ll_limit>l_limit) - l_limit=ll_limit; - } -//////////////////////////////////////////////////////////////////////////////////////////// - m_mean_y=m_mean_y*0.9999f+linear_velocity[1]*0.0001f; - if(mag>l_limit) - { //CutVelocity(m_l_limit,m_w_limit); - if(!fis_zero(l_limit)) - { - - dReal f=mag/l_limit; - - if(b_lose_ground&&linear_velocity[1]<0.f&&linear_velocity[1]>-default_l_limit) - dBodySetLinearVel(m_body,linear_velocity[0]/f,linear_velocity[1],linear_velocity[2]/f);///f - else - CutVelocity(l_limit,0.f); - //dBodySetLinearVel(m_body,linear_velocity[0]/f,linear_velocity[1]/f,linear_velocity[2]/f);///f - if(is_control&&!b_lose_control) - { - dBodySetPosition(m_body, - m_safe_position[0]+linear_velocity[0]*fixed_step, - m_safe_position[1]+linear_velocity[1]*fixed_step, - m_safe_position[2]+linear_velocity[2]*fixed_step); - VERIFY_BOUNDARIES(cast_fv(dBodyGetPosition(m_body)),phBoundaries,PhysicsRefObject()); - } - }else dBodySetLinearVel(m_body,0,0,0); - - - } - } - else - { - dBodySetLinearVel(m_body,m_safe_velocity[0],m_safe_velocity[1],m_safe_velocity[2]); - } - - if(!dV_valid(dBodyGetPosition(m_body))) - dBodySetPosition(m_body,m_safe_position[0]-m_safe_velocity[0]*fixed_step, - m_safe_position[1]-m_safe_velocity[1]*fixed_step, - m_safe_position[2]-m_safe_velocity[2]*fixed_step); - - - dVectorSet(m_safe_position,dBodyGetPosition(m_body)); - dVectorSet(m_safe_velocity,linear_velocity); - -} - -void CPHSimpleCharacter::SetObjectContactCallback(ObjectContactCallbackFun* callback) -{ - m_object_contact_callback=callback; - if(!b_exist)return; - - dGeomUserDataSetObjectContactCallback(m_hat,callback); - dGeomUserDataSetObjectContactCallback(m_geom_shell,callback); - dGeomUserDataSetObjectContactCallback(m_wheel,callback); -} -void CPHSimpleCharacter::SetObjectContactCallbackData( void* data ) -{ - VERIFY( b_exist ); - dGeomUserDataSetCallbackData(m_hat,data); - dGeomUserDataSetCallbackData(m_geom_shell,data); - dGeomUserDataSetCallbackData(m_wheel,data); -} - -void CPHSimpleCharacter::AddObjectContactCallback(ObjectContactCallbackFun* callback) -{ - - VERIFY(b_exist); - - dGeomUserDataAddObjectContactCallback(m_hat,callback); - dGeomUserDataAddObjectContactCallback(m_geom_shell,callback); - dGeomUserDataAddObjectContactCallback(m_wheel,callback); -} -void CPHSimpleCharacter::RemoveObjectContactCallback(ObjectContactCallbackFun* callback) -{ - VERIFY(m_object_contact_callback!=callback); - if(!b_exist) return; - - dGeomUserDataRemoveObjectContactCallback(m_hat,callback); - dGeomUserDataRemoveObjectContactCallback(m_geom_shell,callback); - dGeomUserDataRemoveObjectContactCallback(m_wheel,callback); -} - -void CPHSimpleCharacter::Disable() -{ - //if(is_contact&&!is_control&&!b_lose_ground) - { - dGeomGetUserData(m_wheel)->pushing_neg =false; - dGeomGetUserData(m_wheel)->pushing_b_neg =false; - dGeomGetUserData(m_geom_shell)->pushing_neg =false; - dGeomGetUserData(m_geom_shell)->pushing_b_neg =false; - dGeomGetUserData(m_hat)->pushing_neg =false; - dGeomGetUserData(m_hat)->pushing_b_neg =false; - dGeomGetUserData(m_cap)->pushing_neg =false; - dGeomGetUserData(m_cap)->pushing_b_neg =false; - CPHCharacter::Disable(); - } -} -void CPHSimpleCharacter::Enable() -{ - if(!b_exist)return; - dGeomGetUserData(m_wheel)->pushing_neg =false; - dGeomGetUserData(m_wheel)->pushing_b_neg =false; - dGeomGetUserData(m_geom_shell)->pushing_neg =false; - dGeomGetUserData(m_geom_shell)->pushing_b_neg =false; - dGeomGetUserData(m_hat)->pushing_neg =false; - dGeomGetUserData(m_hat)->pushing_b_neg =false; - dGeomGetUserData(m_cap)->pushing_neg =false; - dGeomGetUserData(m_cap)->pushing_b_neg =false; - CPHCharacter::Enable(); -} -void CPHSimpleCharacter::EnableObject(CPHObject* obj) -{ - dGeomGetUserData(m_wheel)->pushing_neg =false; - dGeomGetUserData(m_wheel)->pushing_b_neg =false; - dGeomGetUserData(m_geom_shell)->pushing_neg =false; - dGeomGetUserData(m_geom_shell)->pushing_b_neg =false; - dGeomGetUserData(m_hat)->pushing_neg =false; - dGeomGetUserData(m_hat)->pushing_b_neg =false; - dGeomGetUserData(m_cap)->pushing_neg =false; - dGeomGetUserData(m_cap)->pushing_b_neg =false; - CPHCharacter::EnableObject(obj); -} -void CPHSimpleCharacter::SetWheelContactCallback (ObjectContactCallbackFun* callback) -{ - VERIFY(b_exist); - dGeomUserDataSetObjectContactCallback(m_wheel,callback); -} -void CPHSimpleCharacter::SetStaticContactCallBack(ContactCallbackFun* callback) -{ - if(!b_exist) return; - - dGeomUserDataSetContactCallback(m_hat,callback); - dGeomUserDataSetContactCallback(m_geom_shell,callback); - dGeomUserDataSetContactCallback(m_wheel,callback); -} - -ObjectContactCallbackFun* CPHSimpleCharacter::ObjectContactCallBack() -{ - return m_object_contact_callback; -} - -u16 CPHSimpleCharacter::RetriveContactBone() -{ - Fvector dir; - m_collision_damage_info.HitDir(dir); - collide::ray_defs Q(m_collision_damage_info.HitPos(), dir, m_radius, CDB::OPT_ONLYNEAREST|CDB::OPT_CULL,collide::rqtBoth); // CDB::OPT_ONLYFIRST CDB::OPT_ONLYNEAREST - RQR.r_clear (); - u16 contact_bone = 0; - CObject* object = smart_cast(m_phys_ref_object); - VERIFY (object) ; - VERIFY (!fis_zero(Q.dir.square_magnitude())); - if (g_pGameLevel->ObjectSpace.RayQuery(RQR,object->collidable.model,Q)) { - collide::rq_result* R = RQR.r_begin() ; - contact_bone=(u16)R->element ; - //int y=result.r_count(); - //for (int k=0; kelement,i)) - // { - // i->second.Use(); - // return false; - - // } - //} - - } - else - { - IKinematics* K=smart_cast(object->Visual()); - u16 count=K->LL_BoneCount(); - CBoneInstance* bone_instances=&K->LL_GetBoneInstance(0); - Fvector pos_in_object; - pos_in_object.sub(m_collision_damage_info.HitPos(),object->Position());//vector from object center to contact position currently in global frame - Fmatrix object_form; - object_form.set(object->XFORM()); - object_form.transpose(); - object_form.transform_dir(pos_in_object); //project pos_in_object on object axes now it is position of contact in object frame - float sq_dist=dInfinity; - for(u16 i=0;igeom.normal; - const dReal* pos=c->geom.pos; - const dGeomID g1=c->geom.g1; - const dGeomID g2=c->geom.g2; - bool bo1=(g1==m_wheel)||g1==m_cap_transform||g1==m_shell_transform||g1==m_hat_transform; - - //SGameMtl* tri_material=GMLib.GetMaterialByIdx((u16)c->surface.mode); - - u16 contact_material=bo1 ? material_idx_2:material_idx_1; - SGameMtl* tri_material=GMLib.GetMaterialByIdx(contact_material); - - bool bClimable=!!tri_material->Flags.test(SGameMtl::flClimable); - if(is_control&&m_elevator_state.ClimbingState()) - { - c->surface.mu=0.f; - c->surface.soft_cfm=world_cfm*2.f; - c->surface.soft_erp=world_erp; - b_any_contacts=true; - is_contact=true; - } - u16 foot_material_idx = ((dxGeomUserData*)dGeomGetData(m_wheel))->tri_material; - if(tri_material->Flags.test(SGameMtl::flPassable)&&!do_collide) - { - - UpdateStaticDamage(c,tri_material,bo1); - foot_material_update(contact_material,foot_material_idx); - return; - } - if(do_collide) - { - b_any_contacts=true; - is_contact=true; - } - dReal spring_rate=def_spring_rate; - dReal dumping_rate=def_dumping_rate; - bool object=(dGeomGetBody(g1)&&dGeomGetBody(g2)); - b_on_object=b_on_object||object; - - -////////////////////////íóæíî ñìåñòèòü êîëèæåí!! -////////////// - FootProcess(c,do_collide,bo1); - if(!do_collide) return; - if(g1==m_hat_transform||g2==m_hat_transform) - { - b_side_contact=true; - MulSprDmp(c->surface.soft_cfm,c->surface.soft_erp,spring_rate,dumping_rate); - c->surface.mu =0.00f; - } - - if(object){ - spring_rate*=10.f; - dBodyID b; - u16 obj_material_idx=u16(-1); - if(bo1) - { - b=dGeomGetBody(c->geom.g2); - obj_material_idx=material_idx_2; - } - else - { - b=dGeomGetBody(c->geom.g1); - obj_material_idx=material_idx_1; - } - UpdateDynamicDamage(c,obj_material_idx,b,bo1); - if(g1==m_wheel||g2==m_wheel) - { - dxGeomUserData *ud=bo1 ? retrieveGeomUserData(c->geom.g2) : retrieveGeomUserData(c->geom.g1); - foot_material_idx = ud->material; - } - contact_material=obj_material_idx; - } - - foot_material_update(contact_material,foot_material_idx); - - //if(!((g1==m_wheel) || (g2==m_wheel)||(m_elevator_state.ClimbingState()) ))// - // return; - - float friction=1.f; - if(!object && !b_side_contact) - { - friction=c->surface.mu; - } - if(m_friction_factorm_ground_contact_normal[1]||!b_valide_ground_contact)// - { - dVectorSet(m_ground_contact_normal,normal); - dVectorSet(m_ground_contact_position,pos); - b_valide_ground_contact=true; - } - if(dXZDot(normal,cast_fp(m_acceleration))geom.normal); - dVectorSet(m_wall_contact_position,c->geom.pos); - b_valide_wall_contact=true; - } - } - else{ - - if(normal[1]<-m_ground_contact_normal[1]||!b_valide_ground_contact)// - { - dVectorSetInvert(m_ground_contact_normal,normal); - dVectorSet(m_ground_contact_position,pos); - b_valide_ground_contact=true; - } - if(dXZDot(normal,cast_fp(m_acceleration)) > -dXZDot(m_wall_contact_normal,cast_fp(m_acceleration))||!b_valide_wall_contact)// - { - dVectorSetInvert(m_wall_contact_normal,normal); - dVectorSet(m_wall_contact_position,pos); - b_valide_wall_contact=true; - } - } - float soft_param=dumping_rate+normal[1]*(1.f-dumping_rate);//=(1.f-normal[1])*dumping_rate +normal[1] - if(is_control){//&&!b_lose_control||b_jumping - if(g1==m_wheel||g2==m_wheel&&!bClimable) - { - c->surface.mu = 0.f;//0.00f; - - } - else{ - c->surface.mu = 0.00f; - } - MulSprDmp(c->surface.soft_cfm,c->surface.soft_erp ,spring_rate,soft_param); - } - else - { - MulSprDmp(c->surface.soft_cfm,c->surface.soft_erp,spring_rate,soft_param); - c->surface.mu *= (1.f+b_clamb_jump*3.f)*m_friction_factor; - } - UpdateStaticDamage(c,tri_material,bo1); -} - -void CPHSimpleCharacter::FootProcess(dContact* c,bool &do_collide ,bool bo) -{ - - - const dGeomID g1 =c->geom.g1 ; - const dGeomID g2 =c->geom.g2 ; - dGeomID g =g1 ; - float sign =1.f ; - dReal* normal =c->geom.normal ; - if(!bo) {g=g2; sign=-1.f; } - if(m_elevator_state.ClimbingState() ||!is_control||!b_clamb_jump||b_was_side_contact||b_side_contact||b_jumping||b_jump) - { - if(g==m_wheel&&sign*normal[1]<0.f) do_collide=false; - return; - } - -/////////////////////////////////////////////////////////////////////////////////// - - dReal* pos =c->geom.pos ; - - - float c_pos =pos[1]-dBodyGetPosition(m_body)[1] ; - - -///////////////////////////////////////////////////////////////////////////////////// - - - if(dXZDot(m_acceleration,cast_fv(normal))*sign>0.f)return; - if(g==m_wheel) - { - if(sign*normal[1]<=0.f) - { - normal[0]=normal[2]=0.f;normal[1]=sign; - c->geom.depth=c_pos+m_radius; - } - } - - if(g==m_shell_transform) - { - if(c_pos<0.f) - { - normal[0]=normal[2]=0.f;normal[1]=sign; - c->geom.depth=c_pos+m_radius; - } - } -} -void CPHSimpleCharacter::GroundNormal(Fvector &norm) -{ - if(m_elevator_state.ClimbingState()) - { - m_elevator_state.GetLeaderNormal(norm); - - } - else - { - norm.set(*((Fvector*)m_ground_contact_normal)); - } -} -u16 CPHSimpleCharacter::ContactBone() -{ - return RetriveContactBone(); -} -void CPHSimpleCharacter::SetMaterial (u16 material) -{ - if(!b_exist) return; - dGeomGetUserData(m_geom_shell)->material=material; - dGeomGetUserData(m_wheel)->material =material; - dGeomGetUserData(m_cap)->material =material; - dGeomGetUserData(m_hat)->material =material; -} -void CPHSimpleCharacter::get_State(SPHNetState& state) -{ - CPHCharacter::get_State(state); - - state.previous_position.y-=m_radius; -} -void CPHSimpleCharacter::set_State(const SPHNetState& state) -{ - CPHCharacter::set_State (state); -} - -void CPHSimpleCharacter::get_spatial_params() -{ - spatialParsFromDGeom((dGeomID)m_space,spatial.sphere.P,AABB,spatial.sphere.R); -} - -float CPHSimpleCharacter::FootRadius() -{ - if(b_exist) return m_radius; - else return 0.f; - -} -void CPHSimpleCharacter::DeathPosition(Fvector& deathPos) -{ - if(!b_exist)return; - - if(b_death_pos) - deathPos.set(m_death_position); - else - { - deathPos.set(cast_fv(dBodyGetPosition(m_body))); - if(!_valid(deathPos))deathPos.set(m_safe_position); - } - deathPos.y-=m_radius; -} -void CPHSimpleCharacter:: AddControlVel (const Fvector& vel) -{ - m_acceleration.add(vel); - m_max_velocity+=vel.magnitude(); -} - -u16 CPHSimpleCharacter::DamageInitiatorID()const -{ - u16 ret=u16(-1);//m_collision_damage_info.DamageInitiatorID(); - - CPhysicsShellHolder* object = 0; - if( m_collision_damage_info.m_obj_id != u16(-1) ) - object=static_cast(Level().Objects.net_Find(m_collision_damage_info.m_obj_id)); - if(object&&!object->getDestroy()) - { - IDamageSource* ds=object->cast_IDamageSource(); - if(ds) ret= ds->Initiator(); - } - // return u16(-1); - - if(ret==u16(-1)) ret = m_phys_ref_object->ID(); - return ret; -} - -CObject* CPHSimpleCharacter::DamageInitiator() const -{ - VERIFY(m_phys_ref_object); - if(m_collision_damage_info.m_dmc_type==SCollisionDamageInfo::ctStatic) return (CObject*) (m_phys_ref_object); - u16 initiator_id=DamageInitiatorID(); - VERIFY(initiator_id!=u16(-1)); - if(initiator_id==m_phys_ref_object->ID()) - return static_cast (m_phys_ref_object); - else - { - return Level().Objects.net_Find(initiator_id); - } -} - -CPHSimpleCharacter::SCollisionDamageInfo::SCollisionDamageInfo() -{ - Construct(); -} -void CPHSimpleCharacter::SCollisionDamageInfo::Construct() -{ - m_contact_velocity=0.f; - SCollisionDamageInfo::Reinit(); - m_hit_type = ALife::eHitTypeStrike; - //m_damege_contact; - - //m_dmc_signum; - //m_dmc_type; - -} -float CPHSimpleCharacter::SCollisionDamageInfo::ContactVelocity()const -{ - dReal ret= m_contact_velocity; - m_contact_velocity=0; - return ret; -} - -void CPHSimpleCharacter::SCollisionDamageInfo::HitDir(Fvector& dir) const -{ - dir.set(m_damege_contact.geom.normal[0]*m_dmc_signum,m_damege_contact.geom.normal[1]*m_dmc_signum,m_damege_contact.geom.normal[2]*m_dmc_signum); -} - -//u16 CPHSimpleCharacter::SCollisionDamageInfo::DamageInitiatorID() const -//{ -// //if(!m_object) -// //return u16(-1); -// CPhysicsShellHolder* object =static_cast(Level().Objects.net_Find(m_obj_id)); -// if(!object)return u16(-1); -// IDamageSource* ds=m_object->cast_IDamageSource(); -// if(ds) return ds->Initiator(); -// return u16(-1); -//} -void CPHSimpleCharacter::SCollisionDamageInfo::Reinit() -{ - //m_damege_contact; - - m_obj_id =u16(-1); - m_hit_callback=NULL; - m_contact_velocity=0; - //float m_dmc_signum; - //enum{ctStatic,ctObject} m_dmc_type; -} -void CPHSimpleCharacter::GetSmothedVelocity(Fvector& vvel) -{ - if(!b_exist) {vvel.set(0,0,0);return;} - vvel.set(m_last_move); - - //if(IsEnabled()&&m_countph_object) return; - if(obj_data->ph_object->CastType()!=tpCharacter) return; - CPHActorCharacter *actor_character =(static_cast(obj_data->ph_object))->CastActorCharacter(); - if(!actor_character) return; - CPHSimpleCharacter *ch_this =static_cast(retrieveGeomUserData(g_this)->ph_object); - VERIFY(ch_this); - save_max(restrictor_depth,c.geom.depth); - do_colide=true; - c.surface.mu=0.f; -} - -bool CPHSimpleCharacter:: UpdateRestrictionType(CPHCharacter* ach) -{ - VERIFY(ph_world); - VERIFY(ph_world->Exist()); - if(m_restriction_type==m_new_restriction_type) return true; - ach->Enable(); - Enable(); - restrictor_depth=0.f; - //bool state=IsEnabled(); - - ph_world->Freeze(); - ERestrictionType old=m_restriction_type; - m_restriction_type=m_new_restriction_type; - AddObjectContactCallback(TestRestrictorContactCallbackFun); - UnFreeze(); - ph_world->StepTouch(); - ach->SwitchOFFInitContact(); - if(restrictor_depthUnFreeze(); - ach->SwitchInInitContact(); - //if(!state)Disable(); - return true; - } - u16 num_steps=2*(u16)iCeil(restrictor_depth/resolve_depth); - for(u16 i=0;num_steps>i;++i) - { - //Calculate(Fvector().set(0,0,0),Fvector().set(1,0,0),0,0,0,0); - restrictor_depth=0.f; - ach->Enable(); - Enable(); - //ach->ApplyForce(0,ph_world->Gravity()*ach->Mass(),0); - ph_world->Step(); - - if(restrictor_depthUnFreeze(); - ach->SwitchInInitContact(); - //if(!state)Disable(); - return true; - } - } - RemoveObjectContactCallback(TestRestrictorContactCallbackFun); - ach->SwitchInInitContact(); - ph_world->UnFreeze(); - //if(!state)Disable(); - m_new_restriction_type=old; -#ifdef DEBUG - if(ph_dbg_draw_mask1.test(ph_m1_DbgActorRestriction)) - Msg("restriction can not change change small -> large"); -#endif - return false; -} -bool CPHSimpleCharacter:: TouchRestrictor (ERestrictionType rttype) -{ - b_collision_restrictor_touch=true; - return rttype==RestrictionType(); -} - - - -IC bool valide_res( u16& res_material_idx, const collide::rq_result &R ) -{ - if(!R.O) - { - CDB::TRI * tri = Level( ).ObjectSpace.GetStaticTris( ) + R.element; - VERIFY( tri ); - res_material_idx = tri->material; - return !ignore_material( res_material_idx ); - } - IRenderVisual* V =R.O->Visual(); - if( !V ) - return false; - IKinematics *K = V->dcast_PKinematics(); - CBoneData &bd = K->LL_GetData( (u16)R.element ); - res_material_idx= bd.game_mtl_idx; - return true; -} - -bool PickMaterial( u16& res_material_idx, const Fvector &pos_, const Fvector &dir_,float range_, CObject* ignore_object ) -{ - Fvector pos = pos_; pos.y+=EPS_L; - Fvector dir = dir_; - float range = range_; - collide::rq_result R; - res_material_idx = GAMEMTL_NONE_IDX; - while( g_pGameLevel->ObjectSpace.RayPick( pos, dir, range, collide::rqtBoth, R, ignore_object ) ) - { - float r_range = R.range + EPS_L; - Fvector next_pos = pos.mad( dir, r_range ) ; - float next_range = range - r_range; - if( valide_res( res_material_idx, R ) ) - return true; - range = next_range; - pos = next_pos; - if( range < EPS_L ) - return false; - } - return false; -} -const float material_pick_dist = 0.5f; -const float material_update_tolerance = 1.5f; -void CPHSimpleCharacter::update_last_material() -{ - //if( ignore_material( *p_lastMaterialIDX ) ) - //{ - Fvector pos;GetPosition( pos ); - if( m_last_picked_material != GAMEMTL_NONE_IDX && pos.similar( m_last_environment_update, material_update_tolerance ) ) - { - *p_lastMaterialIDX = m_last_picked_material; - return; - } - u16 new_material; - if( PickMaterial( new_material, pos, Fvector().set( 0, -1, 0 ), material_pick_dist, PhysicsRefObject() ) ) - { - m_last_picked_material = new_material; - *p_lastMaterialIDX = new_material; - m_last_environment_update = pos; - } - //} - //m->flActorObstacle -} - -void CPHSimpleCharacter::SetNonInteractive (bool v) -{ - b_non_interactive = v; -} - -void CPHSimpleCharacter::Collide () -{ - OnStartCollidePhase(); - - inherited::Collide(); - if( injuriousMaterialIDX == GAMEMTL_NONE_IDX && (*p_lastMaterialIDX)!=GAMEMTL_NONE_IDX && GMLib.GetMaterialByIdx(*p_lastMaterialIDX)->Flags.test(SGameMtl::flInjurious) ) - injuriousMaterialIDX = *p_lastMaterialIDX; - -} -void CPHSimpleCharacter::OnStartCollidePhase () -{ - injuriousMaterialIDX = GAMEMTL_NONE_IDX; - -} \ No newline at end of file diff --git a/src/xrGame/PHSimpleCharacter.h b/src/xrGame/PHSimpleCharacter.h deleted file mode 100644 index 9a042038d46..00000000000 --- a/src/xrGame/PHSimpleCharacter.h +++ /dev/null @@ -1,261 +0,0 @@ -#pragma once -#include "PHCharacter.h" -#include "Physics.h" -#include "MathUtils.h" -#include "ElevatorState.h" -#include "IColisiondamageInfo.h" -#include "../xrEngine/gamemtllib.h" -namespace ALife { - enum EHitType; -}; -#ifdef DEBUG -#include "PHDebug.h" -#endif - - -class CPHSimpleCharacter : - public CPHCharacter, - ICollisionDamageInfo -{ - typedef CPHCharacter inherited; -private: - - collide::rq_results RQR; - -protected: - CElevatorState m_elevator_state; - ////////////////////////////damage//////////////////////////////////////// -#ifdef DEBUG - public: -#endif - struct SCollisionDamageInfo - { - SCollisionDamageInfo () ; - void Construct () ; - float ContactVelocity () const ; - void HitDir (Fvector &dir) const ; - IC const Fvector& HitPos () const {return cast_fv(m_damege_contact.geom.pos);} - void Reinit () ; - dContact m_damege_contact; - SCollisionHitCallback *m_hit_callback; - u16 m_obj_id; - float m_dmc_signum; - enum{ctStatic,ctObject} m_dmc_type; - ALife::EHitType m_hit_type; - mutable float m_contact_velocity; - }; -#ifdef DEBUG - SCollisionDamageInfo& dbg_get_collision_dmg_info(){ return m_collision_damage_info ;} -#endif -protected: - SCollisionDamageInfo m_collision_damage_info; - /////////////////////////// callback - ObjectContactCallbackFun* m_object_contact_callback; - ////////////////////////// geometry - Fvector m_last_move; - dGeomID m_geom_shell; - dGeomID m_wheel; - dGeomID m_hat; - dGeomID m_cap; - - dGeomID m_hat_transform; - dGeomID m_wheel_transform; - dGeomID m_shell_transform; - dGeomID m_cap_transform; - - dSpaceID m_space; - - dReal m_radius; - dReal m_cyl_hight; - /////////////////////////////////// - //dJointID m_capture_joint; - //dJointFeedback m_capture_joint_feedback; - ////////////////////////// movement - dVector3 m_control_force; - Fvector m_acceleration; - Fvector m_cam_dir; - dVector3 m_wall_contact_normal; - dVector3 m_ground_contact_normal; - dVector3 m_clamb_depart_position; - dVector3 m_depart_position; - dVector3 m_wall_contact_position; - dVector3 m_ground_contact_position; - dReal jump_up_velocity;//=6.0f;//5.6f; - dReal m_collision_damage_factor; - dReal m_max_velocity; - - float m_air_control_factor; - - dVector3 m_jump_depart_position; - dVector3 m_death_position; - Fvector m_jump_accel; - - Fvector m_last_environment_update; - u16 m_last_picked_material; - //movement state - bool is_contact ; - bool was_contact ; - bool b_depart ; - bool b_meet ; - bool b_side_contact ; - bool b_was_side_contact ; - bool b_any_contacts ; - bool b_air_contact_state ; - - bool b_valide_ground_contact ; - bool b_valide_wall_contact ; - bool b_on_object ; - bool b_was_on_object ; - bool b_on_ground ; - bool b_lose_ground ; - bool b_collision_restrictor_touch; - u32 m_contact_count ; - - bool is_control ; - bool b_meet_control ; - bool b_lose_control ; - bool was_control ; - bool b_stop_control ; - bool b_depart_control ; - bool b_jump ; - bool b_jumping ; - bool b_clamb_jump ; - bool b_external_impulse ; - u64 m_ext_impuls_stop_step ; - Fvector m_ext_imulse ; - bool b_death_pos ; - bool b_foot_mtl_check ; - dReal m_friction_factor ; - bool b_non_interactive ; -public: - CPHSimpleCharacter () ; - virtual ~CPHSimpleCharacter () {Destroy();} - - /////////////////CPHObject////////////////////////////////////////////// - virtual void PhDataUpdate (dReal step) ; - virtual void PhTune (dReal step) ; - virtual void InitContact (dContact* c,bool &do_collide,u16 /*material_idx_1*/,u16 /*material_idx_2*/) ; - virtual dSpaceID dSpace () {return m_space;} - virtual dGeomID dSpacedGeom () {return (dGeomID)m_space;} - virtual void get_spatial_params () ; - /////////////////CPHCharacter//////////////////////////////////////////// -public: - //update - - - //Check state - virtual bool ContactWas () {if(b_meet_control) {b_meet_control=false;return true;} else return false;} - virtual EEnvironment CheckInvironment () ; - virtual void GroundNormal (Fvector &norm) ; - virtual const ICollisionDamageInfo *CollisionDamageInfo ()const {return this;} -private: - virtual float ContactVelocity ()const {return m_collision_damage_info.ContactVelocity();} - virtual void HitDir (Fvector& dir)const {return m_collision_damage_info.HitDir(dir);} - virtual const Fvector& HitPos ()const {return m_collision_damage_info.HitPos();} - virtual u16 DamageInitiatorID ()const ; - virtual CObject *DamageInitiator ()const ; - virtual ALife::EHitType HitType ()const {return m_collision_damage_info.m_hit_type; }; - - virtual void SetHitType (ALife::EHitType type){ m_collision_damage_info.m_hit_type = type; }; - virtual SCollisionHitCallback *HitCallback ()const ; - virtual void Reinit () {m_collision_damage_info.Reinit();}; -public: - //Creating - virtual void Create (dVector3 sizes) ; - virtual void Destroy (void) ; - virtual void Disable () ; - virtual void EnableObject (CPHObject* obj) ; - virtual void Enable () ; - virtual void SetBox (const dVector3 &sizes); - virtual bool UpdateRestrictionType (CPHCharacter* ach); - //get-set - virtual void SetObjectContactCallback (ObjectContactCallbackFun* callback); - virtual void SetObjectContactCallbackData ( void* data ); - virtual void SetWheelContactCallback (ObjectContactCallbackFun* callback); -private: - void RemoveObjectContactCallback (ObjectContactCallbackFun* callback); - void AddObjectContactCallback (ObjectContactCallbackFun* callback); -static void TestRestrictorContactCallbackFun (bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2); -public: - virtual ObjectContactCallbackFun* ObjectContactCallBack (); - void SetStaticContactCallBack (ContactCallbackFun* calback); - virtual void SwitchOFFInitContact () ; - virtual void SwitchInInitContact () ; - virtual void SetAcceleration (Fvector accel) ; - virtual Fvector GetAcceleration () { return m_acceleration; }; - virtual void SetCamDir (const Fvector& cam_dir); - virtual const Fvector& CamDir ()const {return m_cam_dir;} - virtual void SetMaterial (u16 material) ; - virtual void SetPosition (const Fvector &pos); - virtual void GetVelocity (Fvector& vvel)const; - virtual void GetSmothedVelocity (Fvector& vvel) ; - virtual void SetVelocity (Fvector vel) ; - virtual void SetAirControlFactor (float factor) {m_air_control_factor=factor;} - virtual void SetElevator (CClimableObject* climable){m_elevator_state.SetElevator(climable);}; - virtual CElevatorState *ElevatorState () ; - virtual void SetCollisionDamageFactor (float f) {m_collision_damage_factor=f;} - virtual void GetPosition (Fvector& vpos) ; - virtual void GetPreviousPosition (Fvector& pos) ; - virtual float FootRadius () ; - virtual void DeathPosition (Fvector& deathPos) ; - virtual void IPosition (Fvector& pos) ; - virtual u16 ContactBone (); - virtual void ApplyImpulse (const Fvector& dir, const dReal P); - virtual void ApplyForce (const Fvector& force); - virtual void ApplyForce (const Fvector& dir,float force); - virtual void ApplyForce (float x,float y, float z); - virtual void AddControlVel (const Fvector& vel); - virtual void SetMaximumVelocity (dReal vel) {m_max_velocity=vel;} - virtual dReal GetMaximumVelocity () { return m_max_velocity;} - virtual void SetJupmUpVelocity (dReal velocity) {jump_up_velocity=velocity;} - virtual bool JumpState () { - return b_jumping||b_jump; - }; - virtual const Fvector& ControlAccel ()const {return m_acceleration;} - virtual bool TouchRestrictor (ERestrictionType rttype); - virtual float &FrictionFactor () {return m_friction_factor;} - virtual void SetMas (dReal mass) ; - virtual float Mass () {return m_mass;}; - virtual void SetPhysicsRefObject (CPhysicsShellHolder* ref_object); - virtual void SetNonInteractive (bool v); - - //virtual void CaptureObject (dBodyID body,const dReal* anchor); - //virtual void CapturedSetPosition (const dReal* position); - //virtual void doCaptureExist (bool& do_exist); - - virtual void get_State ( SPHNetState& state) ; - virtual void set_State (const SPHNetState& state) ; - virtual void ValidateWalkOn (); - bool ValidateWalkOnMesh () ; - bool ValidateWalkOnObject () ; -private: - void CheckCaptureJoint (); - void ApplyAcceleration (); - - u16 RetriveContactBone (); - void SafeAndLimitVelocity (); - void UpdateStaticDamage (dContact* c,SGameMtl* tri_material,bool bo1); - void UpdateDynamicDamage (dContact* c,u16 obj_material_idx,dBodyID b,bool bo1); -IC void FootProcess (dContact* c,bool &do_collide ,bool bo); -IC void foot_material_update (u16 tri_material,u16 foot_material_idx); - static void TestPathCallback(bool& do_colide,bool bo1,dContact& c,SGameMtl * /*material_1*/,SGameMtl * /*material_2*/); -virtual void Collide (); - void OnStartCollidePhase (); -protected: -virtual void get_Box ( Fvector& sz, Fvector& c )const; - protected: -virtual void update_last_material (); -public: -#ifdef DEBUG - virtual void OnRender (); -#endif -}; - -const dReal def_spring_rate=0.5f; -const dReal def_dumping_rate=20.1f; - -IC bool ignore_material( u16 material_idx ) -{ - SGameMtl* material=GMLib.GetMaterialByIdx( material_idx ); - return !!material->Flags.test( SGameMtl::flActorObstacle ); -} \ No newline at end of file diff --git a/src/xrGame/PHSimpleCharacterInline.h b/src/xrGame/PHSimpleCharacterInline.h deleted file mode 100644 index ad4586d2484..00000000000 --- a/src/xrGame/PHSimpleCharacterInline.h +++ /dev/null @@ -1,154 +0,0 @@ -void CPHSimpleCharacter::UpdateStaticDamage(dContact* c,SGameMtl* tri_material,bool bo1) -{ - const dReal *v = dBodyGetLinearVel(m_body); - dReal norm_prg = dFabs(dDOT(v,c->geom.normal)); - dReal smag = dDOT(v,v); - dReal plane_pgr = _sqrt(smag-norm_prg*norm_prg); - dReal mag = 0.f; - if(tri_material->Flags.test(SGameMtl::flPassable)) - { - mag = _sqrt(smag)*tri_material->fBounceDamageFactor; - } - else - { - float vel_prg;vel_prg=_max(plane_pgr*tri_material->fPHFriction,norm_prg); - mag = (vel_prg)*tri_material->fBounceDamageFactor; - } - if(mag>m_collision_damage_info.m_contact_velocity) - { - m_collision_damage_info.m_contact_velocity = mag; - m_collision_damage_info.m_dmc_signum = bo1 ? 1.f : -1.f; - m_collision_damage_info.m_dmc_type = SCollisionDamageInfo::ctStatic; - m_collision_damage_info.m_damege_contact = *c; - //m_collision_damage_info.m_object = 0; - m_collision_damage_info.m_obj_id = u16(-1); - } -} - -void CPHSimpleCharacter::UpdateDynamicDamage(dContact* c,u16 obj_material_idx,dBodyID b,bool bo1) -{ - - //if(ph_world ->IsFreezed()) - //return; - const dReal* vel=dBodyGetLinearVel(m_body); - dReal c_vel; - dMass m; - dBodyGetMass(b,&m); - - const dReal* obj_vel=dBodyGetLinearVel(b); - const dReal* norm=c->geom.normal; - dReal norm_vel=dDOT(vel,norm); - dReal norm_obj_vel=dDOT(obj_vel,norm); - - if((bo1&&norm_vel>norm_obj_vel)|| - (!bo1&&norm_obj_vel>norm_vel) - ) return ; - - - dVector3 Pc={vel[0]*m_mass+obj_vel[0]*m.mass,vel[1]*m_mass+obj_vel[1]*m.mass,vel[2]*m_mass+obj_vel[2]*m.mass}; - //dVectorMul(Vc,1.f/(m_mass+m.mass)); - //dVector3 vc_obj={obj_vel[0]-Vc[0],obj_vel[1]-Vc[1],obj_vel[2]-Vc[2]}; - //dVector3 vc_self={vel[0]-Vc[0],vel[1]-Vc[1],vel[2]-Vc[2]}; - //dReal vc_obj_norm=dDOT(vc_obj,norm); - //dReal vc_self_norm=dDOT(vc_self,norm); - - dReal Kself=norm_vel*norm_vel*m_mass/2.f; - dReal Kobj=norm_obj_vel*norm_obj_vel*m.mass/2.f; - - dReal Pcnorm=dDOT(Pc,norm); - dReal KK=Pcnorm*Pcnorm/(m_mass+m.mass)/2.f; - dReal accepted_energy=Kself*m_collision_damage_factor+Kobj*object_damage_factor-KK; - //DeltaK=m1*m2*(v1-v2)^2/(2*(m1+m2)) - if(accepted_energy>0.f) - { - SGameMtl *obj_material=GMLib.GetMaterialByIdx(obj_material_idx); - c_vel=dSqrt(accepted_energy/m_mass*2.f)*obj_material->fBounceDamageFactor; - } - else c_vel=0.f; -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDispObjCollisionDammage)&&c_vel>dbg_vel_collid_damage_to_display) - { - float dbg_my_norm_vell=norm_vel; - float dbg_obj_norm_vell=norm_obj_vel; - float dbg_my_kinetic_e=Kself; - float dbg_obj_kinetic_e=Kobj; - float dbg_my_effective_e=Kself*m_collision_damage_factor; - float dbg_obj_effective_e=Kobj*object_damage_factor; - float dbg_free_energy=KK; - Msg("-----------------------------------------------------------------------------------------"); - Msg("cd %s -effective vell %f", *PhysicsRefObject()->cName(), c_vel); - Msg("cd %s -my_norm_vell %f", *PhysicsRefObject()->cName(), dbg_my_norm_vell); - Msg("cd %s -obj_norm_vell %f", *PhysicsRefObject()->cName(), dbg_obj_norm_vell); - Msg("cd %s -my_kinetic_e %f", *PhysicsRefObject()->cName(), dbg_my_kinetic_e); - Msg("cd %s -obj_kinetic_e %f", *PhysicsRefObject()->cName(), dbg_obj_kinetic_e); - Msg("cd %s -my_effective_e %f", *PhysicsRefObject()->cName(), dbg_my_effective_e); - Msg("cd %s -obj_effective_e %f", *PhysicsRefObject()->cName(), dbg_obj_effective_e); - Msg("cd %s -effective_acceted_e %f",*PhysicsRefObject()->cName(), accepted_energy); - Msg("cd %s -real_acceted_e %f", *PhysicsRefObject()->cName(), Kself+Kobj-KK); - Msg("cd %s -free_energy %f", *PhysicsRefObject()->cName(), dbg_free_energy); - Msg("-----------------------------------------------------------------------------------------"); - /* - static float dbg_my_norm_vell=0.f; - static float dbg_obj_norm_vell=0.f; - static float dbg_my_kinetic_e=0.f; - static float dbg_obj_kinetic_e=0.f; - static float dbg_my_effective_e=0.f; - static float dbg_obj_effective_e=0.f; - static float dbg_free_energy=0.f; - if() - dbg_my_norm_vell=norm_vel; - dbg_obj_norm_vell=norm_obj_vel; - dbg_my_kinetic_e=Kself; - dbg_obj_kinetic_e=Kobj; - dbg_my_effective_e=Kself*m_collision_damage_factor; - dbg_obj_effective_e=Kobj*object_damage_factor; - dbg_free_energy=KK; - DBG_OutText("-----dbg obj collision damage-------"); - DBG_OutText("my_norm_vell %f",dbg_my_norm_vell); - DBG_OutText("obj_norm_vell %f",dbg_obj_norm_vell); - DBG_OutText("my_kinetic_e %f",dbg_my_kinetic_e); - DBG_OutText("obj_kinetic_e %f", dbg_obj_kinetic_e); - DBG_OutText("my_effective_e %f",dbg_my_effective_e); - DBG_OutText("obj_effective_e %f",dbg_obj_effective_e); - DBG_OutText("free_energy %f",dbg_free_energy); - DBG_OutText("-----------------------------------"); - */ - } -#endif - if(c_vel>m_collision_damage_info.m_contact_velocity) - { - CPhysicsShellHolder* obj=bo1 ? retrieveRefObject(c->geom.g2) : retrieveRefObject(c->geom.g1); - VERIFY(obj); - if(!obj->getDestroy()) - { - m_collision_damage_info.m_contact_velocity=c_vel; - m_collision_damage_info.m_dmc_signum=bo1 ? 1.f : -1.f; - m_collision_damage_info.m_dmc_type=SCollisionDamageInfo::ctObject; - m_collision_damage_info.m_damege_contact=*c; - m_collision_damage_info.m_hit_callback=obj->get_collision_hit_callback(); - m_collision_damage_info.m_obj_id=obj->ID(); - } - } -} - - -IC void CPHSimpleCharacter::foot_material_update(u16 contact_material_idx,u16 foot_material_idx) -{ - if(*p_lastMaterialIDX!=u16(-1)&&GMLib.GetMaterialByIdx( *p_lastMaterialIDX)->Flags.test(SGameMtl:: flPassable)&&!b_foot_mtl_check) return ; - b_foot_mtl_check =false ; - - const SGameMtl* contact_material = GMLib.GetMaterialByIdx(contact_material_idx); - - if(contact_material->Flags.test(SGameMtl::flPassable)) - { - if(contact_material->Flags.test(SGameMtl::flInjurious)) - injuriousMaterialIDX = contact_material_idx ; - else - *p_lastMaterialIDX = contact_material_idx ; - - } - else - *p_lastMaterialIDX=foot_material_idx ; - -} - diff --git a/src/xrGame/PHSkeleton.cpp b/src/xrGame/PHSkeleton.cpp index 89b011bc772..aad8929384f 100644 --- a/src/xrGame/PHSkeleton.cpp +++ b/src/xrGame/PHSkeleton.cpp @@ -3,13 +3,13 @@ #include "PhysicsShellHolder.h" #include "xrServer_Objects_ALife.h" #include "Level.h" -#include "../xrphysics/PHDefs.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PHDefs.h" +#include "xrPhysics/PhysicsShell.h" #include "PHSynchronize.h" -#include "../xrphysics/MathUtils.h" -#include "../Include/xrRender/Kinematics.h" +#include "xrPhysics/MathUtils.h" +#include "Include/xrRender/Kinematics.h" //#include "PHObject.h" -//#include "../xrphysics/PHCollideValidator.h" +//#include "xrPhysics/PHCollideValidator.h" #include "ai_object_location.h" #include "ai_space.h" #include "game_graph.h" diff --git a/src/xrGame/PHSkeleton.h b/src/xrGame/PHSkeleton.h index f68bba4d38f..3f33b258ee9 100644 --- a/src/xrGame/PHSkeleton.h +++ b/src/xrGame/PHSkeleton.h @@ -1,7 +1,7 @@ #ifndef PH_SKELETON_H #define PH_SKELETON_H -#include "../xrphysics/PHDefs.h" +#include "xrPhysics/PHDefs.h" #include "PHDestroyableNotificate.h" class CPhysicsShellHolder; class CSE_ALifePHSkeletonObject; diff --git a/src/xrGame/PHSplitedShell.cpp b/src/xrGame/PHSplitedShell.cpp deleted file mode 100644 index 7ce8fdaa480..00000000000 --- a/src/xrGame/PHSplitedShell.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "stdafx.h" -#include "PhysicsShell.h" -#include "PHObject.h" -#include "PHWorld.h" -#include "PHInterpolation.h" -#include "PHShell.h" -#include "PHJoint.h" -#include "PHElement.h" -#include "PHSplitedShell.h" -#include "Physics.h" -#include "SpaceUtils.h" -void CPHSplitedShell::Collide() -{ - /////////////////////////////// - CollideStatic(dSpacedGeom(),CPHObject::SelfPointer()); - //near_callback(this,0,(dGeomID)dSpace(),ph_world->GetMeshGeom()); -} - -void CPHSplitedShell::get_spatial_params() -{ - spatialParsFromDGeom((dGeomID)m_space,spatial.sphere.P,AABB,spatial.sphere.R); - if(spatial.sphere.R>m_max_AABBradius) spatial.sphere.R=m_max_AABBradius; -} - -void CPHSplitedShell::DisableObject() -{ - CPHObject::deactivate(); -} diff --git a/src/xrGame/PHSplitedShell.h b/src/xrGame/PHSplitedShell.h deleted file mode 100644 index 4cd7affe3ab..00000000000 --- a/src/xrGame/PHSplitedShell.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef PH_SPLITED_SELL -#define PH_SPLITED_SELL - -#include "PHShell.h" - -class CPHSplitedShell: - public CPHShell -{ - float m_max_AABBradius; - virtual void SetMaxAABBRadius (float size){m_max_AABBradius=size;} -protected: - virtual void Collide () ; - virtual void get_spatial_params () ; - virtual void DisableObject () ; -private: -public: - CPHSplitedShell (){m_max_AABBradius=dInfinity;} -}; - -#endif \ No newline at end of file diff --git a/src/xrGame/PHStaticGeomShell.cpp b/src/xrGame/PHStaticGeomShell.cpp deleted file mode 100644 index a14fe7f0c1a..00000000000 --- a/src/xrGame/PHStaticGeomShell.cpp +++ /dev/null @@ -1,87 +0,0 @@ -#include "stdafx.h" -#include "PHStaticGeomShell.h" -#include "SpaceUtils.h" -#include "GameObject.h" -#include "PhysicsShellHolder.h" -#include "../Include/xrRender/Kinematics.h" -#include "PHCollideValidator.h" -#include "game_object_space.h" - -void CPHStaticGeomShell::get_spatial_params() -{ - Fvector AABB; - spatialParsFromDGeom (dSpacedGeometry(),spatial.sphere.P,AABB,spatial.sphere.R); -} - -void CPHStaticGeomShell::PhDataUpdate (dReal step) -{ - Island().Step(step); - Island().Unmerge(); - PhysicsRefObject()->enable_notificate(); - CPHUpdateObject::Deactivate(); -} -void CPHStaticGeomShell::Activate(const Fmatrix& form) -{ - build(); - setStaticForm(form); - get_spatial_params(); - spatial_register(); -} - -void CPHStaticGeomShell::Deactivate() -{ - spatial_unregister(); - CPHUpdateObject::Deactivate(); - destroy(); -} - -CPHStaticGeomShell::CPHStaticGeomShell() -{ - spatial.type|=STYPE_PHYSIC; -} - -void cb(CBoneInstance* B) -{ - -} - -void P_BuildStaticGeomShell(CPHStaticGeomShell* pUnbrokenObject,CGameObject* obj,ObjectContactCallbackFun* object_contact_callback,Fobb &b) -{ - pUnbrokenObject->add_Box (b); - pUnbrokenObject->Activate (obj->XFORM()); - - pUnbrokenObject->set_PhysicsRefObject(smart_cast(obj)); - //m_pUnbrokenObject->SetPhObjectInGeomData(m_pUnbrokenObject); - pUnbrokenObject->set_ObjectContactCallback(object_contact_callback); - CPHCollideValidator::SetNonDynamicObject(*pUnbrokenObject); -} -CPHStaticGeomShell* P_BuildStaticGeomShell(CGameObject* obj,ObjectContactCallbackFun* object_contact_callback,Fobb &b) -{ - CPHStaticGeomShell* pUnbrokenObject=xr_new(); - P_BuildStaticGeomShell(pUnbrokenObject,obj,object_contact_callback,b); - return pUnbrokenObject; -} - -CPHStaticGeomShell* P_BuildStaticGeomShell(CGameObject* obj,ObjectContactCallbackFun* object_contact_callback) -{ - Fobb b; - IRenderVisual* V=obj->Visual(); - R_ASSERT2(V,"need visual to build"); - - smart_cast(V)->CalculateBones (TRUE); //. bForce - was TRUE - V->getVisData().box.getradius (b.m_halfsize); - - b.xform_set (Fidentity); - CPHStaticGeomShell* pUnbrokenObject =P_BuildStaticGeomShell(obj,object_contact_callback,b); - - - IKinematics* K=smart_cast(V); VERIFY(K); - K->CalculateBones(TRUE); - for (u16 k=0; kLL_BoneCount(); k++){ - K->LL_GetBoneInstance(k).set_callback( bctPhysics,cb,K->LL_GetBoneInstance(k).callback_param(), TRUE); - //K->LL_GetBoneInstance(k).Callback_overwrite = TRUE; - //K->LL_GetBoneInstance(k).Callback = cb; - } - return pUnbrokenObject; -} - diff --git a/src/xrGame/PHStaticGeomShell.h b/src/xrGame/PHStaticGeomShell.h deleted file mode 100644 index aa969ea6d8f..00000000000 --- a/src/xrGame/PHStaticGeomShell.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef PH_STATIC_GEOM_SHELL_H -#define PH_STATIC_GEOM_SHELL_H -#include "PHGeometryOwner.h" -#include "PHObject.h" - -class CPHStaticGeomShell: - public CPHGeometryOwner, - public CPHObject, - public CPHUpdateObject -{ - -#ifdef DEBUG - virtual CPhysicsShellHolder *ref_object () { return CPHGeometryOwner::PhysicsRefObject() ;} -#endif - - void get_spatial_params (); -virtual void EnableObject (CPHObject* obj){CPHUpdateObject::Activate();} -virtual dGeomID dSpacedGeom (){return dSpacedGeometry();} -virtual void PhDataUpdate (dReal step); -virtual void PhTune (dReal step){} -virtual void InitContact (dContact* c,bool& do_collide,u16 /*material_idx_1*/,u16 /*material_idx_2*/){} -virtual u16 get_elements_number () {return 0;}; -virtual CPHSynchronize *get_element_sync (u16 element) {return NULL;}; -public: - void Activate (const Fmatrix& form); - void Deactivate (); - CPHStaticGeomShell (); -}; - -CPHStaticGeomShell* P_BuildStaticGeomShell(CGameObject* obj,ObjectContactCallbackFun* object_contact_callback); -CPHStaticGeomShell* P_BuildStaticGeomShell(CGameObject* obj,ObjectContactCallbackFun* object_contact_callback,Fobb &b); -void P_BuildStaticGeomShell(CPHStaticGeomShell* shell,CGameObject* obj,ObjectContactCallbackFun* object_contact_callback,Fobb &b); -#endif \ No newline at end of file diff --git a/src/xrGame/PHValideValues.h b/src/xrGame/PHValideValues.h deleted file mode 100644 index c7aa46c0f16..00000000000 --- a/src/xrGame/PHValideValues.h +++ /dev/null @@ -1,145 +0,0 @@ -#ifndef PH_VALIDE_VALUES -#define PH_VALIDE_VALUES - -class CSafeValue -{ - float m_safe_value ; -public: - CSafeValue (float val) - { - R_ASSERT(_valid(val));m_safe_value=val; - } - CSafeValue () - { - m_safe_value=0.f; - } - IC void new_val (float& val) - { - if(_valid(val))m_safe_value=val;else val=m_safe_value; - } - -}; - - -class CSafeVector3 -{ - CSafeValue m_safe_values [3] ; -public: - - IC void new_val (float *val) - { - m_safe_values[0].new_val(val[0]); - m_safe_values[1].new_val(val[1]); - m_safe_values[2].new_val(val[2]); - } -}; - -class CSafeVector4 -{ - CSafeValue m_safe_values [4] ; -public: - - IC void new_val (float *val) - { - m_safe_values[0].new_val(val[0]); - m_safe_values[1].new_val(val[1]); - m_safe_values[2].new_val(val[2]); - m_safe_values[3].new_val(val[3]); - } -}; - -class CSafeBodyLinearState -{ - CSafeVector3 m_safe_position ; - CSafeVector3 m_safe_linear_vel ; -public: - IC void create (dBodyID b) - { - R_ASSERT(dBodyStateValide(b)); - new_state(b); - } - IC void new_state (dBodyID b) - { - dVector3 v; - dVectorSet(v,dBodyGetPosition(b)); - m_safe_position.new_val(v); - dBodySetPosition(b,v[0],v[1],v[2]); - - dVectorSet(v,dBodyGetLinearVel(b)); - m_safe_linear_vel.new_val(v); - dBodySetLinearVel(b,v[0],v[1],v[2]); - - } -}; - -class CSafeFixedRotationState -{ - dMatrix3 rotation; - CSafeBodyLinearState m_safe_linear_state; -public: - CSafeFixedRotationState() - { - dRSetIdentity( rotation ); - } - IC void create (dBodyID b) - { - R_ASSERT(dBodyStateValide(b)); - std::copy_n( dBodyGetRotation(b), sizeof(rotation)/sizeof(dReal), rotation ); - new_state(b); - } - IC void set_rotation ( const dMatrix3 r ) - { - VERIFY( sizeof(rotation) == sizeof(dMatrix3) ); - std::copy_n( r, sizeof(rotation)/sizeof(dReal), rotation ); - } - IC void new_state (dBodyID b) - { - - dBodySetRotation(b,rotation); - dBodySetAngularVel(b,0.f,0.f,0.f); - m_safe_linear_state.new_state(b); - } -}; -class CSafeBodyAngularState -{ - CSafeVector3 m_safe_angular_vel ; - CSafeVector4 m_safe_quaternion ; -public: - IC void create (dBodyID b) - { - R_ASSERT(dBodyStateValide(b)); - new_state(b); - } - IC void new_state (dBodyID b) - { - dVector3 v; - - dVectorSet(v,dBodyGetAngularVel(b)); - m_safe_angular_vel.new_val(v); - dBodySetAngularVel(b,v[0],v[1],v[2]); - - dQuaternion q; - dQuaternionSet(q,dBodyGetQuaternion(b)); - m_safe_quaternion.new_val(q); - dBodySetQuaternion(b,q); - } -}; - -class CSafeBodyState -{ - CSafeBodyLinearState m_safe_linear_state; - CSafeBodyAngularState m_safe_angular_state; -public: - IC void create (dBodyID b) - { - R_ASSERT(dBodyStateValide(b)); - new_state(b); - } - IC void new_state (dBodyID b) - { - m_safe_linear_state.new_state(b); - m_safe_angular_state.new_state(b); - } - -}; -#endif \ No newline at end of file diff --git a/src/xrGame/PHWorld.cpp b/src/xrGame/PHWorld.cpp deleted file mode 100644 index 476b5921b2a..00000000000 --- a/src/xrGame/PHWorld.cpp +++ /dev/null @@ -1,590 +0,0 @@ -#include "stdafx.h" - -#include "PHWorld.h" -#include "tri-colliderknoopc/dTriList.h" -#include "PhysicsCommon.h" -#include "Level.h" -#include "ExtendedGeom.h" -#include "draymotions.h" -#include "PHCollideValidator.h" -#include "../xrEngine/gamemtllib.h" -#ifdef DEBUG -# include "PHDebug.h" -#endif -#include "PHCommander.h" -#include "PHSimpleCalls.h" -#include "PHSynchronize.h" -#include "phnetstate.h" -#include "geometrybits.h" - -#ifdef DEBUG -void DBG_ObjAfterPhDataUpdate ( CPHObject *obj ); -void DBG_ObjBeforePhDataUpdate ( CPHObject *obj ); -void DBG_ObjAfterStep ( CPHObject *obj ); -void DBG_ObjBeforeStep ( CPHObject *obj ); -void DBG_ObjeAfterPhTune ( CPHObject *obj ); -void DBG_ObjBeforePhTune ( CPHObject *obj ); -void DBG_ObjAfterCollision ( CPHObject *obj ); -void DBG_ObjBeforeCollision ( CPHObject *obj ); -#endif -////////////////////////////////////////////////////////////// -//////////////CPHMesh/////////////////////////////////////////// -/////////////////////////////////////////////////////////// -BOOL g_bDebugDumpPhysicsStep = 0; - -void CPHMesh ::Create(dSpaceID space, dWorldID world){ - Geom = dCreateTriList(space, 0, 0); - CPHGeometryBits::init_geom( *this ); -} -///////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////// - -void CPHMesh ::Destroy(){ - - dGeomDestroy(Geom); - dTriListClass=-1; - -} - - - -//////////////////////////////////////////////////////////////////////////// -///////////CPHWorld///////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////// -//#define PH_PLAIN -#ifdef PH_PLAIN -dGeomID plane; -#endif - -#ifdef DEBUG - -void CPHWorld::OnRender() -{ - - PH_DBG_Render(); -} -#endif -CPHWorld::CPHWorld() -{ - disable_count=0; - m_frame_time=0.f; - m_previous_frame_time=0.f; - b_frame_mark=false; - m_steps_num=0; - m_steps_short_num = 0; - m_frame_sum=0.f; - m_delay=0; - m_previous_delay=0; - m_reduce_delay=0; - m_update_delay_count=0; - b_world_freezed=false; - b_processing=false; - m_gravity =default_world_gravity; - b_exist=false; -} -void CPHWorld::SetStep(dReal s) -{ - fixed_step = s; - world_cfm = CFM(SPRING_S(base_cfm,base_erp,base_fixed_step),DAMPING(base_cfm,base_erp)); - world_erp = ERP(SPRING_S(base_cfm,base_erp,base_fixed_step),DAMPING(base_cfm,base_erp)); - world_spring = 1.0f*SPRING (world_cfm,world_erp); - world_damping = 1.0f*DAMPING(world_cfm,world_erp); - if(ph_world&&ph_world->Exist()) - { - float frame_time = Device.fTimeDelta; - u32 it_number = iFloor (frame_time /fixed_step); - frame_time -= it_number*fixed_step; - ph_world->m_previous_frame_time = frame_time; - ph_world->m_frame_time = frame_time; - } -} -void CPHWorld::Create() -{ - dWorldID phWorld=0; - - if (psDeviceFlags.test(mtPhysics)) Device.seqFrameMT.Add (this,REG_PRIORITY_HIGH); - else Device.seqFrame.Add (this,REG_PRIORITY_LOW); - - m_commander =xr_new(); - //dVector3 extensions={2048,256,2048}; - /* - Fbox level_box = Level().ObjectSpace.GetBoundingVolume(); - Fvector level_size,level_center; - level_box . getsize (level_size); - level_box . getcenter (level_center); - dVector3 extensions = { level_size.x ,256.f,level_size.z}; - dVector3 center = {level_center.x,0.f,level_center.z}; - */ - -#ifdef ODE_SLOW_SOLVER -#else - - dWorldSetAutoEnableDepthSF1(phWorld, 100000000); - ///dWorldSetContactSurfaceLayer(phWorld,0.f); - //phWorld->contactp.min_depth =0.f; - -#endif - ContactGroup = dJointGroupCreate(0); - dWorldSetGravity (phWorld, 0,-Gravity(), 0);//-2.f*9.81f - Mesh.Create (0,phWorld); -#ifdef PH_PLAIN - plane=dCreatePlane(Space,0,1,0,0.3f); -#endif - - //const dReal k_p=2400000.f;//550000.f;///1000000.f; - //const dReal k_d=200000.f; - dWorldSetERP(phWorld, ERP(world_spring,world_damping) ); - dWorldSetCFM(phWorld, CFM(world_spring,world_damping)); - //dWorldSetERP(phWorld, 0.2f); - //dWorldSetCFM(phWorld, 0.000001f); - disable_count=0; - m_motion_ray=dCreateRayMotions(0); - phBoundaries.set(Level().ObjectSpace.GetBoundingVolume()); - phBoundaries.y1-=30.f; - CPHCollideValidator::Init(); - b_exist=true; -} - -///////////////////////////////////////////////////////////////////////////// - -void CPHWorld::Destroy() -{ - r_spatial.clear(); - xr_delete(m_commander); - Mesh.Destroy(); -#ifdef PH_PLAIN - dGeomDestroy(plane); -#endif -#ifdef DEBUG - PH_DBG_Clear(); -#endif - dGeomDestroy(m_motion_ray); - dJointGroupEmpty(ContactGroup); - dJointGroupDestroy(ContactGroup); - ContactFeedBacks.clear(); - ContactEffectors.clear(); - dCloseODE(); - dCylinderClassUser=-1; - dRayMotionsClassUser=-1; - Device.seqFrameMT.Remove (this); - Device.seqFrame.Remove (this); - b_exist=false; -} -void CPHWorld::SetGravity(float g) -{ - m_gravity =g; - dWorldID phWorld =0; - dWorldSetGravity (phWorld, 0,-m_gravity, 0);//-2.f*9.81f - -} - -void CPHWorld::OnFrame() -{ - // Msg ("------------- physics: %d / %d",u32(Device.dwFrame),u32(m_steps_num)); - //ïðîñ÷èòàòü ïîëåò ïóëü - /* - Device.Statistic->TEST0.Begin (); - Level().BulletManager().Update (); - Device.Statistic->TEST0.End (); - */ -#ifdef DEBUG - //DBG_DrawFrameStart(); - //DBG_DrawStatBeforeFrameStep(); -#endif - Device.Statistic->Physics.Begin (); - FrameStep (Device.fTimeDelta); - Device.Statistic->Physics.End (); -#ifdef DEBUG - //DBG_DrawStatAfterFrameStep(); - -#endif -} - -////////////////////////////////////////////////////////////////////////////// -//static dReal frame_time=0.f; -static u32 start_time=0; -void CPHWorld::Step() -{ -#ifdef DEBUG - dbg_reused_queries_per_step =0 ; - dbg_new_queries_per_step =0 ; -#endif - - VERIFY(b_processing||IsFreezed()); - - PH_OBJECT_I i_object; - PH_UPDATE_OBJECT_I i_update_object; - - if(disable_count==0) - { - disable_count=worldDisablingParams.objects_params.L2frames; - for(i_object=m_recently_disabled_objects.begin();m_recently_disabled_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - obj->check_recently_deactivated(); - ++i_object; - } - } - if(!IsFreezed()) - --disable_count; - - ++m_steps_num; - ++m_steps_short_num; - Device.Statistic->ph_collision.Begin (); - - - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); -#ifdef DEBUG - DBG_ObjBeforeCollision( obj ); -#endif - obj->Collide(); -#ifdef DEBUG - DBG_ObjAfterCollision( obj ); -#endif - ++i_object; - } - - - - Device.Statistic->ph_collision.End (); - -#ifdef DEBUG - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - if( ph_dbg_draw_mask.test(phDbgDrawEnabledAABBS) ) - DBG_DrawPHObject(obj); - ++i_object; - } -#endif - - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - ++i_object; - -#ifdef DEBUG - DBG_ObjBeforePhTune( obj ); -#endif - - obj->PhTune(fixed_step); - -#ifdef DEBUG - DBG_ObjeAfterPhTune( obj ); -#endif - - } - - for(i_update_object=m_update_objects.begin();m_update_objects.end() != i_update_object;) - { CPHUpdateObject* obj=(*i_update_object); - ++i_update_object; - obj->PhTune(fixed_step); - } - - Device.Statistic->ph_core.Begin (); - -#ifdef DEBUG - dbg_bodies_num=0; - dbg_joints_num=0; - dbg_islands_num=0; -#endif -////////////////////////////////////////////////////////////////////// - m_commander ->update(); -////////////////////////////////////////////////////////////////////// - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - ++i_object; -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawObjectStatistics)) - { - if(obj->Island().IsActive()) - { - dbg_islands_num++; - dbg_joints_num+=obj->Island().nj; - dbg_bodies_num+=obj->Island().nb; - } - } -#endif - -#ifdef DEBUG - DBG_ObjBeforeStep( obj ); -#endif - obj->IslandStep(fixed_step); - -#ifdef DEBUG - DBG_ObjAfterStep( obj ); -#endif - } - - Device.Statistic->ph_core.End (); - - - - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - ++i_object; - obj->IslandReinit(); - -#ifdef DEBUG - DBG_ObjBeforePhDataUpdate( obj ); -#endif - - obj->PhDataUpdate(fixed_step); - -#ifdef DEBUG - DBG_ObjAfterPhDataUpdate( obj ); -#endif - - obj->spatial_move(); - } - - for(i_update_object=m_update_objects.begin();m_update_objects.end() != i_update_object;) - { - CPHUpdateObject* obj=*i_update_object; - ++i_update_object; - obj->PhDataUpdate(fixed_step); - } - - - -#ifdef DEBUG - dbg_contacts_num=ContactGroup->num; -#endif - dJointGroupEmpty(ContactGroup);//this is to be called after PhDataUpdate!!!-the order is critical!!! - ContactFeedBacks.empty(); - ContactEffectors.empty(); - - - - if(physics_step_time_callback) - { - physics_step_time_callback(start_time,start_time+u32(fixed_step*1000)); - start_time += u32(fixed_step*1000); - }; -} - -void CPHWorld::StepTouch() -{ - PH_OBJECT_I i_object; - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - obj->Collide(); - - ++i_object; - } - - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - ++i_object; - obj->Island().Enable(); - } - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - ++i_object; - obj->IslandReinit(); - obj->spatial_move(); - } - dJointGroupEmpty(ContactGroup); - ContactFeedBacks.empty(); - ContactEffectors.empty(); -} - -u32 CPHWorld::CalcNumSteps (u32 dTime) -{ - if (dTime < m_frame_time*1000) return 0; - u32 res = iCeil((float(dTime) - m_frame_time*1000) / (fixed_step*1000)); -// if (dTime < fixed_step*1000) return 0; -// u32 res = iFloor((float(dTime) / 1000 / fixed_step)+0.5f); - return res; -}; - -void CPHWorld::FrameStep(dReal step) -{ - if(IsFreezed()) return; - - VERIFY (_valid(step)) ; - step *= phTimefactor ; - // compute contact joints and forces - - //step+=astep; - - //const dReal k_p=24000000.f;//550000.f;///1000000.f; - //const dReal k_d=400000.f; - u32 it_number; - float frame_time=m_frame_time; - frame_time+=step; - //m_frame_sum+=step; -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawObjectStatistics)) - { - static float dbg_iterations=0.f; - dbg_iterations=dbg_iterations*0.9f+step/fixed_step*0.1f; - b_processing=true; - DBG_OutText("phys steps per frame %2.1f",dbg_iterations); - b_processing=false; - } -#endif - if(!(frame_time20)Msg("!!!TOO MANY PHYSICS STEPS PER FRAME = %d !!!",it_number); - for(UINT i=0; i ::iterator i= m_objects.end(); - //return (--m_objects.end()); -}; -void CPHWorld::AddRecentlyDisabled(CPHObject* object) -{ - m_recently_disabled_objects.push_back(object); -} -void CPHWorld::RemoveFromRecentlyDisabled(PH_OBJECT_I i) -{ - m_recently_disabled_objects.erase(i); -} - -void CPHWorld::AddUpdateObject(CPHUpdateObject* object) -{ -//. if(object->IsFreezed())m_freezed_update_objects.erase(i); - m_update_objects.push_back(object); -} - -void CPHWorld::RemoveUpdateObject(PH_UPDATE_OBJECT_I i) -{ - m_update_objects.erase(i); -} - -void CPHWorld::RemoveObject(PH_OBJECT_I i){ - m_objects.erase((i)); -}; - -void CPHWorld::AddFreezedObject(CPHObject* obj) -{ - m_freezed_objects.push_back(obj); -} - -void CPHWorld::RemoveFreezedObject(PH_OBJECT_I i) -{ - m_freezed_objects.erase(i); -} -void CPHWorld::Freeze() -{ - R_ASSERT2(!b_world_freezed,"already freezed!!!"); - m_freezed_objects.move_items(m_objects); - - PH_OBJECT_I iter=m_freezed_objects.begin(), - e= m_freezed_objects.end() ; - - - - for(; e != iter;++iter) - (*iter)->FreezeContent(); - - m_freezed_update_objects.move_items(m_update_objects); - - b_world_freezed=true; -} -void CPHWorld::UnFreeze() -{ - R_ASSERT2(b_world_freezed,"is not freezed!!!"); - PH_OBJECT_I iter=m_freezed_objects.begin(), - e= m_freezed_objects.end() ; - for(; e != iter;++iter) - (*iter)->UnFreezeContent(); - - m_objects.move_items(m_freezed_objects); - - m_update_objects.move_items(m_freezed_update_objects); - b_world_freezed=false; -} -bool CPHWorld::IsFreezed() -{ - return b_world_freezed; -} - -void CPHWorld::CutVelocity(float l_limit,float a_limit) -{ - PH_OBJECT_I i_object; - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - obj->CutVelocity(l_limit,a_limit); - ++i_object; - } -} -void CPHWorld::NetRelcase(CPhysicsShell *s) -{ - CPHReqComparerHasShell c(s); - m_commander->remove_calls(&c); - - PH_UPDATE_OBJECT_I i_update_object; - for(i_update_object=m_update_objects.begin();m_update_objects.end() != i_update_object;) - { CPHUpdateObject* obj=(*i_update_object); - ++i_update_object; - obj->NetRelcase( s ); - //obj->PhTune(fixed_step); - } - -} -void CPHWorld::AddCall(CPHCondition*c,CPHAction*a) -{ - m_commander->add_call(c,a); -} -u16 CPHWorld::ObjectsNumber() -{ - return m_objects.count(); -} -u16 CPHWorld::UpdateObjectsNumber() -{ - return m_update_objects.count(); -} -void CPHWorld::GetState(V_PH_WORLD_STATE& state) -{ - state.clear(); - PH_OBJECT_I i_object; - for(i_object=m_objects.begin();m_objects.end() != i_object;) - { - CPHObject* obj=(*i_object); - const u16 els=obj->get_elements_number(); - for(u16 i=0;els>i;++i) - { - std::pair s; - s.first=obj->get_element_sync(i); - s.first->get_State(s.second); - state.push_back(s); - } - ++i_object; - } -} \ No newline at end of file diff --git a/src/xrGame/PHWorld.h b/src/xrGame/PHWorld.h deleted file mode 100644 index be9f86a7353..00000000000 --- a/src/xrGame/PHWorld.h +++ /dev/null @@ -1,111 +0,0 @@ -#ifndef PH_WORLD_H -#define PH_WORLD_H -#include "Physics.h" - -// refs -struct SGameMtlPair; -class CPHCommander; -class CPHCondition; -class CPHAction; -struct SPHNetState; -class CPHSynchronize; -typedef xr_vector > V_PH_WORLD_STATE; -class CPHMesh { - dGeomID Geom; -public: - dGeomID GetGeom(){return Geom;} - void Create(dSpaceID space, dWorldID world); - void Destroy(); -}; - -#define PHWORLD_SOUND_CACHE_SIZE 8 - -//////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////// - -class CPHWorld : public pureFrame -#ifdef DEBUG -, public pureRender -#endif -{ - double m_start_time ; - u32 m_delay ; - u32 m_previous_delay ; - u32 m_reduce_delay ; - u32 m_update_delay_count ; - bool b_world_freezed ; - bool b_processing; - bool b_exist; - static const u32 update_delay=1 ; -/// dSpaceID Space ; - - CPHMesh Mesh ; - PH_OBJECT_STORAGE m_objects ; - PH_OBJECT_STORAGE m_freezed_objects ; - PH_OBJECT_STORAGE m_recently_disabled_objects ; - PH_UPDATE_OBJECT_STORAGE m_update_objects ; - PH_UPDATE_OBJECT_STORAGE m_freezed_update_objects ; - dGeomID m_motion_ray; - CPHCommander *m_commander; -public: - xr_vector r_spatial; -public: - u64 m_steps_num ; -private: - u16 m_steps_short_num ; -public: - double m_frame_sum ; - dReal m_previous_frame_time ; - bool b_frame_mark ; - dReal m_frame_time ; - float m_update_time ; - u16 disable_count ; - float m_gravity ; - CPHWorld () ; - virtual ~CPHWorld (){} ; - -//IC dSpaceID GetSpace () {return Space;} ; -IC bool Exist () {return b_exist ;} - void Create () ; - void SetGravity (float g) ; -IC float Gravity () {return m_gravity;} - void AddObject (CPHObject* object) ; - void AddUpdateObject (CPHUpdateObject* object) ; - void AddRecentlyDisabled (CPHObject* object) ; - void RemoveFromRecentlyDisabled (PH_OBJECT_I i) ; - void RemoveObject (PH_OBJECT_I i) ; - void RemoveUpdateObject (PH_UPDATE_OBJECT_I i) ; - dGeomID GetMeshGeom () {return Mesh.GetGeom();} -IC dGeomID GetMotionRayGeom () {return m_motion_ray;} - void static SetStep (dReal s) ; - void Destroy () ; -IC float FrameTime (bool frame_mark){return b_frame_mark==frame_mark ? m_frame_time :m_previous_frame_time;} - - void FrameStep (dReal step=0.025f) ; - void Step () ; - void StepTouch () ; - void CutVelocity (float l_limit, float a_limit); - void GetState (V_PH_WORLD_STATE& state) ; - void Freeze () ; - void UnFreeze () ; - void AddFreezedObject (CPHObject* obj) ; - void RemoveFreezedObject (PH_OBJECT_I i) ; - bool IsFreezed () ; -IC bool Processing () {return b_processing;} - u32 CalcNumSteps (u32 dTime) ; - u16 ObjectsNumber () ; - u16 UpdateObjectsNumber () ; -IC u16 StepsShortCnt () {return m_steps_short_num;} - void NetRelcase (CPhysicsShell* s) ; - void AddCall (CPHCondition*c,CPHAction*a); -#ifdef DEBUG - virtual void OnRender () ; -#endif - virtual void OnFrame () ; - - DECLARE_SCRIPT_REGISTER_FUNCTION -}; -add_to_type_list(CPHWorld) -#undef script_type_list -#define script_type_list save_type_list(CPHWorld) -#endif \ No newline at end of file diff --git a/src/xrGame/PHWorldScript.cpp b/src/xrGame/PHWorldScript.cpp deleted file mode 100644 index 40355c45e42..00000000000 --- a/src/xrGame/PHWorldScript.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "pch_script.h" -#include "Physics.h" -#include "PHWorld.h" -#include "PHCommander.h" - -using namespace luabind; - -#pragma optimize("s",on) -void CPHWorld::script_register(lua_State *L) -{ - module(L) - [ - class_("physics_world") - .def("set_gravity", &CPHWorld::SetGravity) - .def("gravity", &CPHWorld::Gravity) - .def("add_call", &CPHWorld::AddCall) - ]; -} diff --git a/src/xrGame/ParticlesObject.cpp b/src/xrGame/ParticlesObject.cpp index f49a14ad982..12d1ed6a538 100644 --- a/src/xrGame/ParticlesObject.cpp +++ b/src/xrGame/ParticlesObject.cpp @@ -5,12 +5,12 @@ #pragma hdrstop #include "ParticlesObject.h" -#include "../xrEngine/defines.h" -#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/ParticleCustom.h" -#include "../xrEngine/render.h" -#include "../xrEngine/IGame_Persistent.h" -#include "../xrEngine/environment.h" +#include "xrEngine/defines.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/ParticleCustom.h" +#include "xrEngine/render.h" +#include "xrEngine/IGame_Persistent.h" +#include "xrEngine/environment.h" const Fvector zero_vel = {0.f,0.f,0.f}; diff --git a/src/xrGame/ParticlesObject.h b/src/xrGame/ParticlesObject.h index 378bf1ca71c..41b0bfc39a2 100644 --- a/src/xrGame/ParticlesObject.h +++ b/src/xrGame/ParticlesObject.h @@ -1,7 +1,7 @@ #ifndef ParticlesObjectH #define ParticlesObjectH -#include "../xrEngine/PS_instance.h" +#include "xrEngine/PS_instance.h" extern const Fvector zero_vel; diff --git a/src/xrGame/ParticlesPlayer.cpp b/src/xrGame/ParticlesPlayer.cpp index dba04dd55e6..3e69d9c553a 100644 --- a/src/xrGame/ParticlesPlayer.cpp +++ b/src/xrGame/ParticlesPlayer.cpp @@ -4,8 +4,8 @@ /////////////////////////////////////////////////////////////// #include "stdafx.h" #include "ParticlesPlayer.h" -#include "../xrEngine/xr_object.h" -#include "../Include/xrRender/Kinematics.h" +#include "xrEngine/xr_object.h" +#include "Include/xrRender/Kinematics.h" //------------------------------------------------------------------------------------- static void generate_orthonormal_basis(const Fvector& dir,Fmatrix &result) { diff --git a/src/xrGame/PhraseDialogDefs.h b/src/xrGame/PhraseDialogDefs.h index 4a4c1930b9a..8d690623593 100644 --- a/src/xrGame/PhraseDialogDefs.h +++ b/src/xrGame/PhraseDialogDefs.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrCore/intrusive_ptr.h" +#include "xrCore/intrusive_ptr.h" class CPhraseDialog; diff --git a/src/xrGame/PhysicObject.cpp b/src/xrGame/PhysicObject.cpp index 0f461047041..88787b7fad6 100644 --- a/src/xrGame/PhysicObject.cpp +++ b/src/xrGame/PhysicObject.cpp @@ -1,21 +1,21 @@ #include "pch_script.h" #include "physicobject.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" //#include "Physics.h" #include "xrserver_objects_alife.h" #include "Level.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "../xrEngine/xr_collide_form.h" -#include "../xrEngine/cf_dynamic_mesh.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "xrEngine/xr_collide_form.h" +#include "xrEngine/cf_dynamic_mesh.h" #include "PHSynchronize.h" #include "game_object_space.h" -//#include "../xrphysics/PhysicsShellAnimator.h" +//#include "xrPhysics/PhysicsShellAnimator.h" #include "moving_bones_snd_player.h" -#include "../xrphysics/extendedgeom.h" +#include "xrPhysics/extendedgeom.h" #ifdef DEBUG #include "phdebug.h" -#include "../xrengine/objectdump.h" +#include "xrEngine/objectdump.h" #endif BOOL dbg_draw_doors = false; CPhysicObject::CPhysicObject(void): diff --git a/src/xrGame/Physics.cpp b/src/xrGame/Physics.cpp deleted file mode 100644 index c0f2a79b45a..00000000000 --- a/src/xrGame/Physics.cpp +++ /dev/null @@ -1,542 +0,0 @@ -#include "StdAfx.h" -#include "PHDynamicData.h" -#include "Physics.h" -#include "tri-colliderknoopc/dTriList.h" -#include "PHContactBodyEffector.h" -#include "../xrEngine/gamemtllib.h" -#include "gameobject.h" -#include "PhysicsShellHolder.h" -#include "PHCollideValidator.h" -#ifdef DEBUG -#include "PHDebug.h" -#endif -/////////////////////////////////////////////////////////////// -#pragma warning(disable:4995) -#pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/collision_kernel.h" -#include "../3rd party/ode/ode/src/joint.h" -#include "../3rd party/ode/ode/src/objects.h" -#pragma warning(default:4267) -#pragma warning(default:4995) - -extern CPHWorld *ph_world; -/////////////////////////////////////////////////////////////////// - -#include "ExtendedGeom.h" -//union dInfBytes dInfinityValue = {{0,0,0x80,0x7f}}; -PhysicsStepTimeCallback *physics_step_time_callback = 0; - -const dReal default_w_limit = 9.8174770f;//(M_PI/16.f/(fixed_step=0.02f)); -const dReal default_l_limit = 150.f;//(3.f/fixed_step=0.02f); -const dReal default_l_scale = 1.01f; -const dReal default_w_scale = 1.01f; -const dReal default_k_l = 0.0002f;//square resistance !! -const dReal default_k_w = 0.05f; - -const dReal mass_limit = 10000.f;//some conventional value used as evaluative param (there is no code restriction on mass) -extern const u16 max_joint_allowed_for_exeact_integration = 30; - -//base params -const dReal base_fixed_step = 0.02f ; -const dReal base_erp = 0.54545456f ; -const dReal base_cfm = 1.1363636e-006f ; -//base params -dReal fixed_step = 0.01f; -dReal world_cfm = CFM(SPRING_S(base_cfm,base_erp,base_fixed_step),DAMPING(base_cfm,base_erp)); -dReal world_erp = ERP(SPRING_S(base_cfm,base_erp,base_fixed_step),DAMPING(base_cfm,base_erp)); -dReal world_spring = 1.0f*SPRING (world_cfm,world_erp); -dReal world_damping = 1.0f*DAMPING(world_cfm,world_erp); - - -const dReal default_world_gravity = 2*9.81f; - - -///////////////////////////////////////////////////// - -int phIterations = 18; -float phTimefactor = 1.f; -float phBreakCommonFactor = 0.01f; -float phRigidBreakWeaponFactor = 1.f; -Fbox phBoundaries = {1000.f,1000.f,-1000.f,-1000.f}; -float ph_tri_query_ex_aabb_rate = 1.3f; -int ph_tri_clear_disable_count = 10; -dWorldID phWorld; - -///////////////////////////////////// -dJointGroupID ContactGroup; -CBlockAllocator ContactFeedBacks; -CBlockAllocator ContactEffectors; - -/////////////////////////////////////////////////////////// -class SApplyBodyEffectorPred -{ - -public: - SApplyBodyEffectorPred() - { - } - - void operator ()(CPHContactBodyEffector* pointer) const - { - pointer->Apply(); - } -}; -///////////////////////////////////////////////////////////////////////////// -IC void add_contact_body_effector(dBodyID body,const dContact& c,SGameMtl* material) -{ - CPHContactBodyEffector* effector=(CPHContactBodyEffector*)dBodyGetData(body); - if(effector) - effector->Merge(c,material); - else - { - effector=ContactEffectors.add(); - effector->Init(body,c,material); - dBodySetData(body,(void*)effector); - } -} - - - - - - - - -IC static int CollideIntoGroup(dGeomID o1, dGeomID o2,dJointGroupID jointGroup,CPHIsland* world,const int &MAX_CONTACTS) -{ - const int RS= 800+10; - const int N = RS; - - static dContact contacts[RS]; - int collided_contacts=0; - // get the contacts up to a maximum of N contacts - int n; - - VERIFY (o1); - VERIFY (o2); - VERIFY(&contacts[0].geom); - n = dCollide(o1, o2, N, &contacts[0].geom, sizeof(dContact)); - - if(n>N-1) - n=N-1; - int i; - - - for(i = 0; i < n; ++i) - { - dContact &c =contacts[i]; - dContactGeom &cgeom =c.geom; - dSurfaceParameters &surface=c.surface; - dGeomID g1 =cgeom.g1; - dGeomID g2 =cgeom.g2; - bool pushing_neg= false; - bool do_collide = true; - dxGeomUserData* usr_data_1 =NULL; - dxGeomUserData* usr_data_2 =NULL; - u16 material_idx_1 =0; - u16 material_idx_2 =0; - - surface.mu =1.f;// 5000.f; - surface.soft_erp=1.f;//ERP(world_spring,world_damping); - surface.soft_cfm=1.f;//CFM(world_spring,world_damping); - surface.bounce = 0.01f;//0.1f; - surface.bounce_vel =1.5f;//0.005f; - usr_data_1 = retrieveGeomUserData(g1); - usr_data_2 = retrieveGeomUserData(g2); - /////////////////////////////////////////////////////////////////////////////////////////////////// - if(usr_data_2) material_idx_2=usr_data_2->material; - if(usr_data_1) material_idx_1=usr_data_1->material; - bool is_tri_1=dTriListClass == dGeomGetClass(g1); - bool is_tri_2=dTriListClass == dGeomGetClass(g2); - if(!is_tri_2&&!is_tri_1) surface.mode=0; - if(is_tri_1) material_idx_1=(u16)surface.mode; - if(is_tri_2) material_idx_2=(u16)surface.mode; - SGameMtl* material_1=GMLib.GetMaterialByIdx(material_idx_1); - SGameMtl* material_2=GMLib.GetMaterialByIdx(material_idx_2); - ////////////////params can be changed in callbacks////////////////////////////////////////////////////////////////////////// - surface.mode =dContactApprox1|dContactSoftERP|dContactSoftCFM; - float spring =material_2->fPHSpring*material_1->fPHSpring*world_spring; - float damping =material_2->fPHDamping*material_1->fPHDamping*world_damping; - surface.soft_erp=ERP(spring,damping); - surface.soft_cfm=CFM(spring,damping); - surface.mu=material_2->fPHFriction*material_1->fPHFriction; - ///////////////////////////////////////////////////////////////////////////////////////////////// - - - Flags32 &flags_1=material_1->Flags; - Flags32 &flags_2=material_2->Flags; - - if(is_tri_1) - { -#pragma warning(push) -#pragma warning(disable:4245) - if(material_1->Flags.test(SGameMtl::flSlowDown)&&!(usr_data_2->pushing_neg||usr_data_2->pushing_b_neg)) -#pragma warning(pop) - { - dBodyID body=dGeomGetBody(g2); - R_ASSERT2(body,"static - static collision !!!"); - if(material_1->Flags.test(SGameMtl::flLiquid)) - { - add_contact_body_effector(body,c,material_1); - } - else - { - if(!usr_data_2 || !usr_data_2->ph_object || !usr_data_2->ph_object->IsRayMotion()) - { - add_contact_body_effector(body,c,material_1); - } - } - - } - if(material_1->Flags.test(SGameMtl::flPassable)) - do_collide=false; - // if(material_2->Flags.is(SGameMtl::flClimable)) - // do_collide=false; - } - if(is_tri_2) - { -#pragma warning(push) -#pragma warning(disable:4245) - if(material_2->Flags.test(SGameMtl::flSlowDown)&&!(usr_data_1->pushing_neg||usr_data_1->pushing_b_neg)) -#pragma warning(pop) - { - - dBodyID body=dGeomGetBody(g1); - R_ASSERT2(body,"static - static collision !!!"); - if(material_2->Flags.test(SGameMtl::flLiquid)) - { - add_contact_body_effector(body,c,material_2); - } - else - { - if(!usr_data_1 || !usr_data_1->ph_object || !usr_data_1->ph_object->IsRayMotion()) - { - add_contact_body_effector(body,c,material_2); - } - } - - } - if(material_2->Flags.test(SGameMtl::flPassable)) - do_collide=false; - - } - - if(flags_1.test(SGameMtl::flBounceable)&&flags_2.test(SGameMtl::flBounceable)) - { - surface.mode |= dContactBounce; - surface.bounce_vel = _max(material_1->fPHBounceStartVelocity,material_2->fPHBounceStartVelocity); - surface.bounce = _min(material_1->fPHBouncing,material_2->fPHBouncing); - } - ///////////////////////////////////////////////////////////////////////////////////////////////// - if(usr_data_2&&usr_data_2->object_callbacks){ - usr_data_2->object_callbacks->Call(do_collide,false,c,material_1,material_2); - } - - if(usr_data_1&&usr_data_1->object_callbacks){ - usr_data_1->object_callbacks->Call(do_collide,true,c,material_1,material_2); - } - - if(usr_data_2){ - usr_data_2->pushing_b_neg = usr_data_2->pushing_b_neg && !GMLib.GetMaterialByIdx(usr_data_2->b_neg_tri->material)->Flags.test(SGameMtl::flPassable); - usr_data_2->pushing_neg = usr_data_2->pushing_neg && !GMLib.GetMaterialByIdx(usr_data_2->neg_tri->material)->Flags.test(SGameMtl::flPassable); - pushing_neg=usr_data_2->pushing_b_neg||usr_data_2->pushing_neg; - if(usr_data_2->ph_object){ - usr_data_2->ph_object->InitContact(&c,do_collide,material_idx_1,material_idx_2); - } - - } - /////////////////////////////////////////////////////////////////////////////////////// - if(usr_data_1){ - usr_data_1->pushing_b_neg = usr_data_1->pushing_b_neg && !GMLib.GetMaterialByIdx(usr_data_1->b_neg_tri->material)->Flags.test(SGameMtl::flPassable); - usr_data_1->pushing_neg = usr_data_1->pushing_neg && !GMLib.GetMaterialByIdx(usr_data_1->neg_tri->material)->Flags.test(SGameMtl::flPassable); - pushing_neg=usr_data_1->pushing_b_neg||usr_data_1->pushing_neg; - if(usr_data_1->ph_object){ - usr_data_1->ph_object->InitContact(&c,do_collide,material_idx_1,material_idx_2); - - } - } - - - if (pushing_neg) - surface.mu=dInfinity; - if (do_collide && collided_contactsConnectJoint(contact_joint); - dJointAttach (contact_joint, dGeomGetBody(g1), dGeomGetBody(g2)); - } - } - return collided_contacts; -} - -void NearCallback(CPHObject* obj1,CPHObject* obj2, dGeomID o1, dGeomID o2) -{ - - CPHIsland* island1=obj1->DActiveIsland(); - CPHIsland* island2=obj2->DActiveIsland(); - obj2->near_callback(obj1); - int MAX_CONTACTS=-1; - if(!island1->CanMerge(island2,MAX_CONTACTS)) return; - if(CollideIntoGroup(o1,o2,ContactGroup,island1,MAX_CONTACTS)!=0) - { - obj1->MergeIsland(obj2); - if(!obj2->is_active())obj2->EnableObject(obj1); - } -} - -void CollideStatic(dGeomID o2,CPHObject* obj2) -{ - - CPHIsland* island2=obj2->DActiveIsland(); - CollideIntoGroup(ph_world->GetMeshGeom(),o2,ContactGroup,island2,island2->MaxJoints()); -} - - - - -//half square time - -/* -void BodyCutForce(dBodyID body) -{ -dReal linear_limit=l_limit; -//applyed force -const dReal* force= dBodyGetForce(body); - -//body mass -dMass m; -dBodyGetMass(body,&m); - -//accceleration correspondent to the force -dVector3 a={force[0]/m.mass,force[1]/m.mass,force[2]/m.mass}; - -//current velocity -const dReal* start_vel=dBodyGetLinearVel(body); - -//velocity adding during one step -dVector3 add_vel={a[0]*fixed_step,a[1]*fixed_step,a[2]*fixed_step}; - -//result velocity -dVector3 vel={start_vel[0]+add_vel[0],start_vel[1]+add_vel[1],start_vel[2]+add_vel[2]}; - -//result velocity magnitude -dReal speed=dSqrt(dDOT(vel,vel)); - -if(speed>linear_limit) //then we need to cut applied force -{ -//solve the triangle - cutted velocity - current veocity - add velocity -//to find cutted adding velocity - -//add_vell magnitude -dReal add_speed=dSqrt(dDOT(add_vel,add_vel)); - -//current velocity magnitude -dReal start_speed=dSqrt(dDOT(start_vel,start_vel)); - -//cosinus of the angle between vel ang add_vell -dReal cosinus1=dFabs(dDOT(add_vel,start_vel)/start_speed/add_speed); - -dReal cosinus1_2=cosinus1*cosinus1; -if(cosinus1_2>1.f) -cosinus1_2=1.f; -dReal cutted_add_speed; -if(cosinus1_2==1.f) -cutted_add_speed=linear_limit-start_speed; -else -{ -//sinus -dReal sinus1_2=1.f-cosinus1_2; - - -dReal sinus1=dSqrt(sinus1_2); - - -//sinus of the angle between cutted velocity and adding velociity (sinus theorem) -dReal sinus2=sinus1/linear_limit*start_speed; -dReal sinus2_2=sinus2*sinus2; -if(sinus2_2>1.f)sinus2_2=1.f; - -dReal cosinus2_2=1.f-sinus2_2; -dReal cosinus2=dSqrt(cosinus2_2); - -//sinus of 180-ang1-ang2 -dReal sinus3=sinus1*cosinus2+cosinus1*sinus2; - -//cutted adding velocity magnitude (sinus theorem) - -cutted_add_speed=linear_limit/sinus1*sinus3; -} -//substitude force - -dBodyAddForce(body, -cutted_add_speed/add_speed/fixed_step*m.mass*add_vel[0]-force[0], -cutted_add_speed/add_speed/fixed_step*m.mass*add_vel[1]-force[1], -cutted_add_speed/add_speed/fixed_step*m.mass*add_vel[2]-force[2] -); -} - -} -*/ -//limit for angular accel -void dBodyAngAccelFromTorqu(const dBodyID body, dReal* ang_accel, const dReal* torque){ - dMass m; - dMatrix3 invI; - dBodyGetMass(body,&m); - dInvertPDMatrix (m.I, invI, 3); - dMULTIPLY1_333(ang_accel,invI, torque); -} -void FixBody(dBodyID body,float ext_param,float mass_param) -{ - dMass m; - dMassSetSphere(&m,1.f,ext_param); - dMassAdjust(&m,mass_param); - dBodySetMass(body,&m); - dBodySetGravityMode(body,0); - dBodySetLinearVel(body,0,0,0); - dBodySetAngularVel(body,0,0,0); - dBodySetForce(body,0,0,0); - dBodySetTorque(body,0,0,0); -} -void FixBody(dBodyID body) -{ - FixBody(body,fix_ext_param,fix_mass_param); -} - - -void BodyCutForce(dBodyID body,float l_limit,float w_limit) -{ - const dReal wa_limit=w_limit/fixed_step; - const dReal* force= dBodyGetForce(body); - dReal force_mag=dSqrt(dDOT(force,force)); - - //body mass - dMass m; - dBodyGetMass(body,&m); - - dReal force_limit =l_limit/fixed_step*m.mass; - - if(force_mag>force_limit) - { - dBodySetForce(body, - force[0]/force_mag*force_limit, - force[1]/force_mag*force_limit, - force[2]/force_mag*force_limit - ); - } - - - const dReal* torque=dBodyGetTorque(body); - dReal torque_mag=dSqrt(dDOT(torque,torque)); - - if(torque_mag<0.001f) return; - - dMatrix3 tmp,invI,I; - - // compute inertia tensor in global frame - dMULTIPLY2_333 (tmp,m.I,body->R); - dMULTIPLY0_333 (I,body->R,tmp); - - // compute inverse inertia tensor in global frame - dMULTIPLY2_333 (tmp,body->invI,body->R); - dMULTIPLY0_333 (invI,body->R,tmp); - - //angular accel - dVector3 wa; - dMULTIPLY0_331(wa,invI,torque); - dReal wa_mag=dSqrt(dDOT(wa,wa)); - - if(wa_mag>wa_limit) - { - //scale w - for(int i=0;i<3;++i)wa[i]*=wa_limit/wa_mag; - dVector3 new_torqu; - - dMULTIPLY0_331(new_torqu,I,wa); - - dBodySetTorque - ( - body, - new_torqu[0], - new_torqu[1], - new_torqu[2] - ); - } -} - -void dMassSub(dMass *a,const dMass *b) -{ - int i; - VERIFY (a && b); - dReal denom = dRecip (a->mass-b->mass); - for (i=0; i<3; ++i) a->c[i] = (a->c[i]*a->mass - b->c[i]*b->mass)*denom; - a->mass-=b->mass; - for (i=0; i<12; ++i) a->I[i] -= b->I[i]; -} - - -////Energy of non Elastic collision; -//body - static case -float E_NlS(dBodyID body,const dReal* norm,float norm_sign)//if body c.geom.g1 norm_sign + else - -{ //norm*norm_sign - to body - const dReal* vel=dBodyGetLinearVel(body); - dReal prg=-dDOT(vel,norm)*norm_sign; - prg=prg<0.f ? prg=0.f : prg; - dMass mass; - dBodyGetMass(body,&mass); - return mass.mass*prg*prg/2; -} - -//body - body case -float E_NLD(dBodyID b1,dBodyID b2,const dReal* norm)// norm - from 2 to 1 -{ - dMass m1,m2; - dBodyGetMass(b1,&m1);dBodyGetMass(b2,&m2); - const dReal* vel1 =dBodyGetLinearVel(b1); - const dReal* vel2 =dBodyGetLinearVel(b2); - - dReal vel_pr1=dDOT(vel1,norm); - dReal vel_pr2=dDOT(vel2,norm); - - if(vel_pr1>vel_pr2) return 0.f; //exit if the bodies are departing - - dVector3 impuls1={vel1[0]*m1.mass,vel1[1]*m1.mass,vel1[2]*m1.mass}; - dVector3 impuls2={vel2[0]*m2.mass,vel2[1]*m2.mass,vel2[2]*m2.mass}; - - dVector3 c_mas_impuls={impuls1[0]+impuls2[0],impuls1[1]+impuls2[1],impuls1[2]+impuls2[2]}; - dReal cmass=m1.mass+m2.mass; - dVector3 c_mass_vel={c_mas_impuls[0]/cmass,c_mas_impuls[1]/cmass,c_mas_impuls[2]/cmass}; - - dReal c_mass_vel_prg=dDOT(c_mass_vel,norm); - - dReal kin_energy_start=vel_pr1*vel_pr1*m1.mass/2.f+vel_pr2*vel_pr2*m2.mass/2.f; - dReal kin_energy_end=c_mass_vel_prg*c_mass_vel_prg*cmass/2.f; - - return (kin_energy_start-kin_energy_end); -} -float E_NL(dBodyID b1,dBodyID b2,const dReal* norm) -{ - VERIFY(b1||b2); - if(b1) - { - if(b2)return E_NLD(b1,b2,norm);else return E_NlS(b1,norm,1); - }else return E_NlS(b2,norm,-1); -} -void ApplyGravityAccel(dBodyID body,const dReal* accel) -{ - dMass m; - dBodyGetMass(body,&m); - dBodyAddForce(body,accel[0]*m.mass,accel[1]*m.mass,accel[2]*m.mass); -} - -const dReal* dJointGetPositionContact(dJointID joint) -{ - VERIFY2(dJointGetType(joint)==dJointTypeContact,"not a contact!"); - dxJointContact* c_joint=(dxJointContact*)joint; - return c_joint->contact.geom.pos; - -} diff --git a/src/xrGame/Physics.h b/src/xrGame/Physics.h deleted file mode 100644 index 992d0b836c0..00000000000 --- a/src/xrGame/Physics.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef PHYSICS_H -#define PHYSICS_H - - -#include "dCylinder/dCylinder.h" -#include "PhysicsShell.h" -#include "PHObject.h" -#include "PHInterpolation.h" -#include "../xrcore/_cylinder.h" -#include "BlockAllocator.h" -#include "PhysicsCommon.h" -#include "PHWorld.h" -#include "PHContactBodyEffector.h" -#include "phvalide.h" -//#define ODE_SLOW_SOLVER -/////////////////////////////////////////////////////////////////////////////// - - void BodyCutForce (dBodyID body,float l_limit,float w_limit) ; - void dBodyAngAccelFromTorqu (const dBodyID body, dReal* ang_accel, const dReal* torque) ; - float E_NlS (dBodyID body,const dReal* norm,float norm_sign) ; - float E_NLD (dBodyID b1,dBodyID b2,const dReal* norm); - float E_NL (dBodyID b1,dBodyID b2,const dReal* norm); - void ApplyGravityAccel (dBodyID body,const dReal* accel); -const dReal fix_ext_param =10000.f; -const dReal fix_mass_param =100000000.f; - void FixBody (dBodyID body) ; - void dMassSub (dMass *a,const dMass *b) ; - void SaveContacts (dGeomID o1, dGeomID o2,dJointGroupID jointGroup) ; -const dReal *dJointGetPositionContact (dJointID joint); - - - -//const dReal world_spring=24000000.f;//2400000.f;//550000.f;///1000000.f;; -//const dReal world_damping=400000.f;//erp/cfm1.1363636e-006f,0.54545456f - - -extern class CBlockAllocator ContactFeedBacks; -extern CBlockAllocator ContactEffectors; -//void NearCallback(void* /*data*/, dGeomID o1, dGeomID o2); -void NearCallback(CPHObject* obj1,CPHObject* obj2, dGeomID o1, dGeomID o2); -void CollideStatic(dGeomID o2,CPHObject* obj2); - - - -class CPHElement; -class CPHShell; -extern dJointGroupID ContactGroup; -extern Fbox phBoundaries; - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#endif PHYSICS_H \ No newline at end of file diff --git a/src/xrGame/PhysicsCommon.h b/src/xrGame/PhysicsCommon.h deleted file mode 100644 index 3435041cada..00000000000 --- a/src/xrGame/PhysicsCommon.h +++ /dev/null @@ -1,87 +0,0 @@ -#ifndef PHYSICS_COMMON_H -#define PHYSICS_COMMON_H - -#include "DisablingParams.h" -#include "ode_include.h" - -extern const dReal default_l_limit ; -extern const dReal default_w_limit ; -extern const dReal default_k_l ; -extern const dReal default_k_w ; -extern const dReal default_l_scale ; -extern const dReal default_w_scale ; - -extern const dReal base_fixed_step ; -extern const dReal base_erp ; -extern const dReal base_cfm ; - -extern dReal fixed_step ; -extern dReal world_cfm ; -extern dReal world_erp ; -extern dReal world_spring ; -extern dReal world_damping ; - -extern const dReal mass_limit ; -extern const u16 max_joint_allowed_for_exeact_integration ; -extern const dReal default_world_gravity ; -extern float phTimefactor ; -extern int phIterations ; -extern float phBreakCommonFactor ; -extern float phRigidBreakWeaponFactor ; -extern float ph_tri_query_ex_aabb_rate ; -extern int ph_tri_clear_disable_count ; - -struct SGameMtl; -#define ERP_S(k_p,k_d,s) ((s*(k_p)) / (((s)*(k_p)) + (k_d))) -#define CFM_S(k_p,k_d,s) (1.f / (((s)*(k_p)) + (k_d))) -#define SPRING_S(cfm,erp,s) ((erp)/(cfm)/s) - -////////////////////////////////////////////////////////////////////////////////// -#define DAMPING(cfm,erp) ((1.f-(erp))/(cfm)) -#define ERP(k_p,k_d) ERP_S(k_p,k_d,fixed_step) -#define CFM(k_p,k_d) CFM_S(k_p,k_d,fixed_step) -#define SPRING(cfm,erp) SPRING_S(cfm,erp,fixed_step) - - - - -IC float Erp(float k_p,float k_d,float s=fixed_step) {return ((s*(k_p)) / (((s)*(k_p)) + (k_d)));} -IC float Cfm(float k_p,float k_d,float s=fixed_step) {return (1.f / (((s)*(k_p)) + (k_d)));} -IC float Spring(float cfm,float erp,float s=fixed_step) {return ((erp)/(cfm)/s);} -IC float Damping(float cfm,float erp) {return ((1.f-(erp))/(cfm));} -IC void MulSprDmp(float &cfm,float &erp,float mul_spring,float mul_damping) -{ - float factor=1.f/(mul_spring*erp+mul_damping*(1-erp)); - cfm*=factor; - erp*=(factor*mul_spring); -} -typedef void ContactCallbackFun(CDB::TRI* T,dContactGeom* c); -typedef void ObjectContactCallbackFun(bool& do_colide,bool bo1,dContact& c,SGameMtl* material_1,SGameMtl* material_2); - - -typedef void BoneCallbackFun(CBoneInstance* B); - - - -extern ContactCallbackFun *ContactShotMark; -extern ContactCallbackFun *CharacterContactShotMark; - -typedef void PhysicsStepTimeCallback (u32 step_start,u32 step_end); -extern PhysicsStepTimeCallback *physics_step_time_callback; - -template -void t_get_box( const geom_type* shell, const Fmatrix& form, Fvector& sz, Fvector& c ) -{ - c.set(0,0,0); - VERIFY( sizeof( form.i ) + sizeof( form._14_ ) == 4* sizeof( float ) ); - for(int i=0;3>i;++i) - { - float lo,hi; - const Fvector &ax=cast_fv(((const float*)&form+i*4)); - shell->get_Extensions(ax,0,lo,hi); - sz[i]=hi-lo;c.add(Fvector().mul(ax,(lo+hi)/2)); - } -} - - -#endif //PHYSICS_COMMON_H \ No newline at end of file diff --git a/src/xrGame/PhysicsShell.cpp b/src/xrGame/PhysicsShell.cpp deleted file mode 100644 index 3946f5116e1..00000000000 --- a/src/xrGame/PhysicsShell.cpp +++ /dev/null @@ -1,277 +0,0 @@ -#include "stdafx.h" -#pragma hdrstop -#include "physicsshell.h" -#include "PHDynamicData.h" -#include "Physics.h" -#include "PHJoint.h" -#include "PHShell.h" -#include "PHJoint.h" -#include "PHJointDestroyInfo.h" -#include "PHSplitedShell.h" -#include "gameobject.h" -#include "physicsshellholder.h" -#include "../Include/xrRender/Kinematics.h" -#include "objectdump.h" -#include "phvalide.h" -extern CPHWorld *ph_world; -CPhysicsShell::~CPhysicsShell() -{ - - //if(ph_world)ph_world->NetRelcase(this); -} - -CPhysicsElement* P_create_Element () -{ - CPHElement* element=xr_new (); - return element; -} - -CPhysicsShell* P_create_Shell () -{ - CPhysicsShell* shell=xr_new (); - return shell; -} - -CPhysicsShell* P_create_splited_Shell () -{ - CPhysicsShell* shell=xr_new (); - return shell; -} - -CPhysicsJoint* P_create_Joint (CPhysicsJoint::enumType type ,CPhysicsElement* first,CPhysicsElement* second) -{ - CPhysicsJoint* joint=xr_new ( type , first, second); - return joint; -} - - -CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,BONE_P_MAP* bone_map, bool not_set_bone_callbacks) -{ - VERIFY( obj ); - phys_shell_verify_object_model( *obj ); - - IKinematics* pKinematics=smart_cast(obj->Visual()); - - CPhysicsShell* pPhysicsShell = P_create_Shell(); -#ifdef DEBUG - pPhysicsShell->dbg_obj=smart_cast(obj); -#endif - pPhysicsShell->build_FromKinematics(pKinematics,bone_map); - - pPhysicsShell->set_PhysicsRefObject(smart_cast(obj)); - pPhysicsShell->mXFORM.set(obj->XFORM()); - pPhysicsShell->Activate( not_active_state, not_set_bone_callbacks );//, - //m_pPhysicsShell->SmoothElementsInertia(0.3f); - pPhysicsShell->SetAirResistance();//0.0014f,1.5f - - return pPhysicsShell; -} - -void fix_bones(LPCSTR fixed_bones,CPhysicsShell* shell ) -{ - VERIFY(fixed_bones); - VERIFY(shell); - IKinematics *pKinematics = shell->PKinematics(); - VERIFY(pKinematics); - int count = _GetItemCount(fixed_bones); - for (int i=0 ;iLL_BoneID(fixed_bone) ; - R_ASSERT2(BI_NONE!=fixed_bone_id,"wrong fixed bone") ; - CPhysicsElement* E = shell->get_Element(fixed_bone_id) ; - if(E) - E->Fix(); - } -} -CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,BONE_P_MAP* p_bone_map,LPCSTR fixed_bones) -{ - CPhysicsShell* pPhysicsShell; - IKinematics* pKinematics=smart_cast(obj->Visual()); - if(fixed_bones) - { - - - int count = _GetItemCount(fixed_bones); - for (int i=0 ;iLL_BoneID(fixed_bone) ; - R_ASSERT2(BI_NONE!=fixed_bone_id,"wrong fixed bone") ; - p_bone_map->insert(mk_pair(fixed_bone_id,physicsBone())) ; - } - - pPhysicsShell=P_build_Shell(obj,not_active_state,p_bone_map); - - //m_pPhysicsShell->add_Joint(P_create_Joint(CPhysicsJoint::enumType::full_control,0,fixed_element)); - } - else - pPhysicsShell=P_build_Shell(obj,not_active_state); - - - BONE_P_PAIR_IT i=p_bone_map->begin(),e=p_bone_map->end(); - if(i!=e) pPhysicsShell->SetPrefereExactIntegration(); - for(;i!=e;i++) - { - CPhysicsElement* fixed_element=i->second.element; - R_ASSERT2(fixed_element,"fixed bone has no physics"); - //if(!fixed_element) continue; - fixed_element->Fix(); - } - return pPhysicsShell; -} - -CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,LPCSTR fixed_bones) -{ - U16Vec f_bones; - if(fixed_bones){ - IKinematics* K = smart_cast(obj->Visual()); - int count = _GetItemCount(fixed_bones); - for (int i=0 ;iLL_BoneID(fixed_bone)); - R_ASSERT2(BI_NONE!=f_bones.back(),"wrong fixed bone") ; - } - } - return P_build_Shell (obj,not_active_state,f_bones); -} - -static BONE_P_MAP bone_map=BONE_P_MAP(); -CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,U16Vec& fixed_bones) -{ - bone_map.clear (); - CPhysicsShell* pPhysicsShell; - if(!fixed_bones.empty()) - for (U16It it=fixed_bones.begin(); it!=fixed_bones.end(); it++) - bone_map.insert(mk_pair(*it,physicsBone())); - pPhysicsShell=P_build_Shell(obj,not_active_state,&bone_map); - - // fix bones - BONE_P_PAIR_IT i=bone_map.begin(),e=bone_map.end(); - if(i!=e) pPhysicsShell->SetPrefereExactIntegration(); - for(;i!=e;i++){ - CPhysicsElement* fixed_element=i->second.element; - //R_ASSERT2(fixed_element,"fixed bone has no physics"); - if(!fixed_element) continue; - fixed_element->Fix(); - } - return pPhysicsShell; -} - -CPhysicsShell* P_build_SimpleShell(CGameObject* obj,float mass,bool not_active_state) -{ - CPhysicsShell* pPhysicsShell = P_create_Shell(); -#ifdef DEBUG - pPhysicsShell->dbg_obj=smart_cast(obj); -#endif - Fobb obb; obj->Visual()->getVisData().box.get_CD(obb.m_translate,obb.m_halfsize); obb.m_rotate.identity(); - CPhysicsElement* E = P_create_Element(); R_ASSERT(E); E->add_Box(obb); - pPhysicsShell->add_Element(E); - pPhysicsShell->setMass(mass); - pPhysicsShell->set_PhysicsRefObject(smart_cast(obj)); - if(!obj->H_Parent()) - pPhysicsShell->Activate(obj->XFORM(),0,obj->XFORM(),not_active_state); - return pPhysicsShell; -} - -void ApplySpawnIniToPhysicShell(CInifile* ini,CPhysicsShell* physics_shell,bool fixed) -{ - if(!ini) - return; - if(ini->section_exist("physics_common")) - { - fixed = fixed || (ini->line_exist("physics_common","fixed_bones")) ; -#pragma todo("not ignore static if non realy fixed! ") - fix_bones(ini->r_string("physics_common","fixed_bones"),physics_shell); - } - if(ini->section_exist("collide")) - { - - if((ini->line_exist("collide","ignore_static")&&fixed)||(ini->line_exist("collide","ignore_static")&&ini->section_exist("animated_object"))) - { - physics_shell->SetIgnoreStatic(); - } - if(ini->line_exist("collide","small_object")) - { - physics_shell->SetSmall(); - } - if(ini->line_exist("collide","ignore_small_objects")) - { - physics_shell->SetIgnoreSmall(); - } - if(ini->line_exist("collide","ignore_ragdoll")) - { - physics_shell->SetIgnoreRagDoll(); - } - - - //If need, then show here that it is needed to ignore collisions with "animated_object" - if (ini->line_exist("collide","ignore_animated_objects")) - { - physics_shell->SetIgnoreAnimated(); - } - - } - //If next section is available then given "PhysicShell" is classified - //as animated and we read options for his animation - - if (ini->section_exist("animated_object")) - { - //Show that given "PhysicShell" animated - physics_shell->CreateShellAnimator( ini, "animated_object" ); - } - -} - - - -void get_box( const CPhysicsBase* shell, const Fmatrix& form, Fvector& sz, Fvector& c ) -{ - t_get_box( shell, form, sz, c ); -} - - - - - -void destroy_physics_shell(CPhysicsShell* &p) -{ - if (p) - p->Deactivate(); - xr_delete(p); -} - -bool bone_has_pysics( IKinematics& K, u16 bone_id ) -{ - return K.LL_GetBoneVisible( bone_id ) && shape_is_physic(K.LL_GetData( bone_id ).shape); -} - -bool has_physics_collision_shapes( IKinematics& K ) -{ - u16 nbb = K.LL_BoneCount(); - for(u16 i = 0; i < nbb; ++i ) - if( bone_has_pysics( K, i ) ) - return true; - return false; -} - -void phys_shell_verify_model( IKinematics& K ) -{ - IRenderVisual* V = K.dcast_RenderVisual(); - VERIFY( V ); - VERIFY2( has_physics_collision_shapes( K ), make_string( "Can not create physics shell for model %s because it has no physics collision shapes set", V->getDebugName().c_str() ) ); -} - -void phys_shell_verify_object_model( CObject& O ) -{ - IRenderVisual *V = O.Visual(); - VERIFY2( V, make_string( "Can not create physics shell for object %s it has no model", O.cName().c_str() )+ make_string("\n object dump: \n") + dbg_object_full_dump_string( &O ) ); - IKinematics *K = V->dcast_PKinematics(); - VERIFY2( K, make_string( "Can not create physics shell for object %s, model %s is not skeleton", O.cName().c_str(), O.cNameVisual().c_str() ) ); - VERIFY2( has_physics_collision_shapes( *K ), make_string( "Can not create physics shell for object %s, model %s has no physics collision shapes set", O.cName().c_str(), O.cNameVisual().c_str() )+ make_string("\n object dump: \n") + dbg_object_full_dump_string( &O ) ); - VERIFY2( _valid( O.XFORM() ), make_string( "create physics shell: object matrix is not valide" ) + make_string("\n object dump: \n") + dbg_object_full_dump_string( &O ) ); - VERIFY2(valid_pos( O.XFORM().c ), dbg_valide_pos_string( O.XFORM().c, &O, "create physics shell" ) ); -} \ No newline at end of file diff --git a/src/xrGame/PhysicsShell.h b/src/xrGame/PhysicsShell.h deleted file mode 100644 index afb2b19681d..00000000000 --- a/src/xrGame/PhysicsShell.h +++ /dev/null @@ -1,403 +0,0 @@ -#ifndef PhysicsShellH -#define PhysicsShellH -#pragma once - -#include "PHDefs.h" -#include "PhysicsCommon.h" -#include "alife_space.h" -#include "script_export_space.h" -#include "../xrEngine/iphysicsshell.h" - -class CPhysicsJoint; -class CPhysicsElement; -class CPhysicsShell; -class CPHFracture; -class CPHJointDestroyInfo; -class CODEGeom; -class CPHSynchronize; -class CPhysicsShellHolder; -class CGameObject; -class NET_Packet; -struct SBoneShape; -struct NearestToPointCallback; -class CPHShellSplitterHolder; -class IKinematics; -typedef u32 CLClassBits; -typedef u32 CLBits; -typedef u32 CGID; -struct physicsBone -{ - CPhysicsJoint* joint; - CPhysicsElement* element; - physicsBone() - { - joint=NULL; - element=NULL; - } -}; -DEFINE_MAP (u16, physicsBone, BONE_P_MAP, BONE_P_PAIR_IT); -typedef const BONE_P_MAP :: iterator BONE_P_PAIR_CIT; -// ABSTRACT: -class CPhysicsBase ; -void get_box( const CPhysicsBase* shell, const Fmatrix& form, Fvector& sz, Fvector& c ); - -class CPhysicsBase -{ -public: - Fmatrix mXFORM ; // In parent space -public: - virtual void Activate (const Fmatrix& m0, float dt01, const Fmatrix& m2,bool disable=false) = 0; - virtual void Activate (const Fmatrix &transform,const Fvector& lin_vel,const Fvector& ang_vel,bool disable=false) = 0; - virtual void Activate (bool disable=false, bool not_set_bone_callbacks = false) = 0; - virtual void Activate (const Fmatrix& form,bool disable=false) = 0; - virtual const Fmatrix &XFORM ()const { return mXFORM; } - virtual void get_xform ( Fmatrix& form ) const { form.set( XFORM() ); } - virtual void InterpolateGlobalTransform (Fmatrix* m) = 0; -// virtual void GetGlobalTransformDynamic (Fmatrix* m) const = 0; - virtual void InterpolateGlobalPosition (Fvector* v) = 0; - virtual void net_Import (NET_Packet& P) = 0; - virtual void net_Export (NET_Packet& P) = 0; - virtual void GetGlobalPositionDynamic (Fvector* v) = 0; - virtual bool isBreakable () = 0; - virtual bool isEnabled () const = 0; - virtual bool isActive () const = 0; - virtual bool isFullActive () const = 0; - virtual void Deactivate () = 0; - virtual void Enable () = 0; -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void setMass (float M) = 0; - virtual void setDensity (float M) = 0; - virtual float getMass () = 0; - virtual float getDensity () = 0; - virtual float getVolume () = 0; - virtual void get_Extensions ( const Fvector& axis, float center_prg, float& lo_ext, float& hi_ext ) const = 0; - virtual void get_Box ( Fvector& sz, Fvector& c )const { get_box( this, mXFORM, sz, c ); } -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void applyForce (const Fvector& dir, float val) = 0; - virtual void applyForce (float x,float y,float z) = 0; - virtual void applyImpulse (const Fvector& dir, float val) = 0; - virtual void setTorque (const Fvector& torque) = 0; - virtual void setForce (const Fvector& force) = 0; - virtual void applyGravityAccel (const Fvector& accel) = 0; - virtual void SetAirResistance (float linear=default_k_l, float angular=default_k_w) = 0; - virtual void GetAirResistance (float &linear, float &angular) = 0; - virtual void set_DynamicLimits (float l_limit=default_l_limit,float w_limit=default_w_limit) = 0; - virtual void set_DynamicScales (float l_scale=default_l_scale,float w_scale=default_w_scale) = 0; - virtual void set_ContactCallback (ContactCallbackFun* callback) = 0; - virtual void set_ObjectContactCallback (ObjectContactCallbackFun* callback) = 0; - virtual void SetAnimated ( bool v ) = 0; - virtual void add_ObjectContactCallback (ObjectContactCallbackFun* callback) = 0; - virtual void remove_ObjectContactCallback (ObjectContactCallbackFun* callback) = 0; - virtual void set_CallbackData (void * cd) = 0; - virtual void *get_CallbackData () = 0; - virtual void set_PhysicsRefObject (CPhysicsShellHolder* ref_object) = 0; -// virtual void get_LinearVel (Fvector& velocity) const = 0; -// virtual void get_AngularVel (Fvector& velocity) const = 0; - virtual void set_LinearVel (const Fvector& velocity) = 0; - virtual void set_AngularVel (const Fvector& velocity) = 0; - virtual void TransformPosition (const Fmatrix &form) = 0; - virtual void set_ApplyByGravity (bool flag) = 0; - virtual bool get_ApplyByGravity () = 0; - - virtual void SetMaterial (u16 m) = 0; - virtual void SetMaterial (LPCSTR m) = 0; - virtual void set_DisableParams (const SAllDDOParams& params) = 0; - virtual void SetTransform (const Fmatrix& m0) = 0; -#ifdef DEBUG - virtual void dbg_draw_velocity ( float scale, u32 color ) = 0; - virtual void dbg_draw_force ( float scale, u32 color ) = 0; - virtual void dbg_draw_geometry ( float scale, u32 color, Flags32 flags = Flags32().assign( 0 ) ) const = 0; -#endif - virtual ~CPhysicsBase () {}; -}; - -// ABSTRACT: -// Element is fully Rigid and consists of one or more forms, such as sphere, box, cylinder, etc. -class CPhysicsElement : - public CPhysicsBase, - public IPhysicsElement -{ - -public: - u16 m_SelfID ; - virtual CPhysicsShell *PhysicsShell () = 0; - virtual void set_ContactCallback (ContactCallbackFun *callback) = 0; - virtual CPhysicsShellHolder *PhysicsRefObject () = 0; - virtual void add_Sphere (const Fsphere& V) = 0; - virtual void add_Box (const Fobb& V) = 0; - virtual void add_Cylinder (const Fcylinder& V) = 0; - virtual void add_Shape (const SBoneShape& shape) = 0; - virtual void add_Shape (const SBoneShape& shape,const Fmatrix& offset) = 0; - virtual CODEGeom *last_geom () = 0; - virtual CODEGeom* geometry ( u16 i ) = 0; - virtual void add_geom ( CODEGeom* g ) = 0; - virtual void remove_geom ( CODEGeom* g ) = 0; - virtual const IPhysicsGeometry* geometry ( u16 i )const = 0; - - virtual bool has_geoms () = 0; - virtual void add_Mass (const SBoneShape& shape,const Fmatrix& offset,const Fvector& mass_center,float mass,CPHFracture* fracture=NULL) = 0; - virtual void set_ParentElement (CPhysicsElement* p) = 0; -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void set_BoxMass (const Fobb& box, float mass) = 0; - virtual void setInertia (const dMass& M) = 0; - virtual void addInertia (const dMass& M) = 0; - virtual void setMassMC (float M,const Fvector& mass_center) = 0; - virtual void applyImpulseVsMC (const Fvector& pos,const Fvector& dir, float val) = 0; - virtual void applyImpulseVsGF (const Fvector& pos,const Fvector& dir, float val) = 0; - virtual void applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val,const u16 id) = 0; -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void setDensityMC (float M,const Fvector& mass_center) = 0; - virtual void set_local_mass_center (const Fvector &mc ) = 0; - virtual void setQuaternion (const Fquaternion& quaternion) = 0; - virtual u16 setGeomFracturable (CPHFracture &fracture) = 0; - virtual CPHFracture &Fracture (u16 num) = 0; -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual u16 numberOfGeoms ()const = 0; - virtual dBodyID get_body () = 0; - virtual const Fvector &mass_Center ()const = 0; - virtual const Fvector &local_mass_Center () = 0; - virtual float getRadius () = 0; - virtual void GetGlobalTransformDynamic (Fmatrix* m) const = 0; - virtual dMass *getMassTensor () = 0; - virtual void get_MaxAreaDir (Fvector& dir) = 0; - virtual ObjectContactCallbackFun *get_ObjectContactCallback () = 0; - virtual void Fix () = 0; - virtual void ReleaseFixed () = 0; - virtual bool isFixed () = 0; -////////////////////////////////////////////////////////////////IPhysicsElement//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual const Fmatrix &XFORM () const { return CPhysicsBase::XFORM(); } -// virtual void get_LinearVel ( Fvector& velocity ) const { get_LinearVel( velocity ); } -// virtual void get_AngularVel ( Fvector& velocity ) const { get_AngularVel( velocity ); } - virtual void get_Box ( Fvector& sz, Fvector& c )const { return CPhysicsBase::get_Box( sz, c ); } -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual ~CPhysicsElement () {}; - DECLARE_SCRIPT_REGISTER_FUNCTION -}; - -add_to_type_list(CPhysicsElement) -#undef script_type_list -#define script_type_list save_type_list(CPhysicsElement) - -//ABSTRACT: -// Joint between two elements - -class CPhysicsJoint -{ - -public: - bool bActive ; - enum eVs { //coordinate system - vs_first , //in first local - vs_second , //in second local - vs_global //in global - }; - enum enumType{ //joint type - ball , // ball-socket - hinge , // standart hinge 1 - axis - hinge2 , // for car wheels 2-axes - full_control , // 3 - axes control (eiler - angles) - slider - }; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - enumType eType ; //type of the joint -public: - virtual ~CPhysicsJoint () {}; - virtual u16 BoneID () =0; - virtual void SetBoneID (u16 bone_id) =0; - virtual CPhysicsElement* PFirst_element () =0; - virtual CPhysicsElement* PSecond_element () =0; - virtual u16 GetAxesNumber () =0; - virtual void Activate () =0; - virtual void Create () =0; - virtual void RunSimulation () =0; - virtual void Deactivate () =0; - virtual void SetBackRef (CPhysicsJoint** j) =0; - virtual void SetAnchor (const Fvector& position) =0; - virtual void SetAxisSDfactors (float spring_factor,float damping_factor,int axis_num) =0; - virtual void SetJointSDfactors (float spring_factor,float damping_factor) =0; - virtual void SetAnchorVsFirstElement (const Fvector& position) =0; - virtual void SetAnchorVsSecondElement (const Fvector& position) =0; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetAxisDir (const Fvector& orientation,const int axis_num) =0; - virtual void SetAxisDirVsFirstElement (const Fvector& orientation,const int axis_num) =0; - virtual void SetAxisDirVsSecondElement (const Fvector& orientation,const int axis_num) =0; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetAnchor (const float x,const float y,const float z) =0; - virtual void SetAnchorVsFirstElement (const float x,const float y,const float z) =0; - virtual void SetAnchorVsSecondElement (const float x,const float y,const float z) =0; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetAxisDir (const float x,const float y,const float z,const int axis_num) =0; - virtual void SetAxisDirVsFirstElement (const float x,const float y,const float z,const int axis_num) =0; - virtual void SetAxisDirVsSecondElement (const float x,const float y,const float z,const int axis_num) =0; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetLimits (const float low,const float high,const int axis_num) =0; - virtual void SetLimitsVsFirstElement (const float low,const float high,const int axis_num) =0; - virtual void SetLimitsVsSecondElement (const float low,const float high,const int axis_num) =0; -////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void SetBreakable (float force, float torque) =0; - virtual CPHJointDestroyInfo *JointDestroyInfo () =0; - virtual bool isBreakable () =0; - virtual void SetForceAndVelocity (const float force,const float velocity=0.f,const int axis_num=-1) =0; - virtual void GetMaxForceAndVelocity (float &force,float &velocity,int axis_num) =0; - virtual float GetAxisAngle (int axis_num) =0; - virtual dJointID GetDJoint () =0; - virtual void GetAxisSDfactors (float& spring_factor,float& damping_factor,int axis_num) =0; - virtual void GetJointSDfactors (float& spring_factor,float& damping_factor) =0; - virtual void GetLimits (float& lo_limit,float& hi_limit,int axis_num) =0; - virtual void GetAxisDir (int num,Fvector& axis,eVs& vs) =0; - virtual void GetAxisDirDynamic (int num,Fvector& axis) =0; - virtual void GetAnchorDynamic (Fvector& anchor) =0; - DECLARE_SCRIPT_REGISTER_FUNCTION -}; -add_to_type_list(CPhysicsJoint) -#undef script_type_list -#define script_type_list save_type_list(CPhysicsJoint) -// ABSTRACT: -class CPHIsland; -class CPhysicsShellAnimator; - -class CPhysicsShell : - public CPhysicsBase, - public IPhysicsShell -{ -protected: - IKinematics *m_pKinematics ; -public: -#ifdef DEBUG - CPhysicsShellHolder *dbg_obj ; -#endif -public: -IC IKinematics *PKinematics () {return m_pKinematics ;} -////////////////////////////////////////////////////IPhysicsShell/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -virtual const Fmatrix &XFORM ()const { return CPhysicsBase::XFORM(); } -virtual const IPhysicsElement &Element ( u16 index ) const { return *get_ElementByStoreOrder( index ); }; -virtual void GetGlobalTransformDynamic (Fmatrix* m) = 0; -//virtual u16 get_ElementsNumber ( ) const = 0; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual CPhysicsShellAnimator* PPhysicsShellAnimator () = 0; - void set_Kinematics (IKinematics* p) {m_pKinematics=p ;} - virtual void set_JointResistance (float force) = 0; - virtual void add_Element (CPhysicsElement* E) = 0; - virtual void add_Joint (CPhysicsJoint* E) = 0; - virtual CPHIsland *PIsland () = 0; -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /////////// - virtual const CGID &GetCLGroup ()const = 0; - virtual void RegisterToCLGroup (CGID g) = 0; - virtual bool IsGroupObject () = 0; - virtual void SetIgnoreStatic () = 0; - virtual void SetIgnoreDynamic () = 0; - virtual void SetRagDoll () = 0; - virtual void SetIgnoreRagDoll () = 0; - - virtual void CreateShellAnimator ( CInifile* ini, LPCSTR section ) = 0; - virtual void SetIgnoreAnimated () = 0; -// virtual bool Animated () = 0; - - virtual void SetSmall () = 0; - virtual void SetIgnoreSmall () = 0; - virtual bool isFractured () = 0; - virtual CPHShellSplitterHolder *SplitterHolder () = 0; - virtual void SplitProcess (PHSHELL_PAIR_VECTOR &out_shels) = 0; - virtual void BlockBreaking () = 0; - virtual void UnblockBreaking () = 0; - virtual bool IsBreakingBlocked () = 0; - virtual void applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val) = 0; - virtual void applyImpulseTrace (const Fvector& pos, const Fvector& dir, float val,const u16 id) = 0; - virtual void applyHit (const Fvector& pos, const Fvector& dir, float val,const u16 id,ALife::EHitType hit_type) = 0; - virtual BoneCallbackFun* GetBonesCallback () = 0; - virtual BoneCallbackFun* GetStaticObjectBonesCallback () = 0; - virtual void Update () = 0; -///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void get_LinearVel (Fvector& velocity) const = 0; - virtual void get_AngularVel (Fvector& velocity) const = 0; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - virtual void setMass1 (float M) = 0; - virtual void SmoothElementsInertia (float k) = 0; - virtual void setEquelInertiaForEls (const dMass& M) = 0; - virtual void addEquelInertiaToEls (const dMass& M) = 0; - virtual ELEMENT_STORAGE &Elements () = 0; - virtual CPhysicsElement *get_Element (u16 bone_id) = 0; - virtual CPhysicsElement *get_Element (const shared_str & bone_name) = 0; - virtual CPhysicsElement *get_Element (LPCSTR bone_name) = 0; - virtual CPhysicsElement *get_ElementByStoreOrder (u16 num) = 0; - virtual const CPhysicsElement *get_ElementByStoreOrder (u16 num) const = 0; - virtual CPhysicsElement *get_PhysicsParrentElement ( u16 bone_id ) = 0; - virtual u16 get_ElementsNumber ()const = 0; - virtual CPHSynchronize *get_ElementSync (u16 element) = 0; - virtual CPhysicsJoint *get_Joint (u16 bone_id) = 0; - virtual CPhysicsJoint *get_Joint (const shared_str & bone_name) = 0; - virtual CPhysicsJoint *get_Joint (LPCSTR bone_name) = 0; - virtual CPhysicsJoint *get_JointByStoreOrder (u16 num) = 0; - virtual u16 get_JointsNumber () = 0; - virtual CODEGeom *get_GeomByID (u16 bone_id) = 0; - virtual void Freeze () = 0; - virtual void UnFreeze () = 0; - virtual void NetInterpolationModeON () = 0; - virtual void NetInterpolationModeOFF () = 0; - virtual void Disable () = 0; - virtual void DisableCollision () = 0; - virtual void EnableCollision () = 0; - virtual void SetRemoveCharacterCollLADisable () = 0; - virtual void DisableCharacterCollision () = 0; - virtual void PureStep (float step = fixed_step) = 0; - virtual void SetGlTransformDynamic (const Fmatrix &form) = 0; - virtual void CollideAll () = 0; - virtual CPhysicsElement *NearestToPoint (const Fvector& point, NearestToPointCallback *cb = 0 ) = 0; - virtual void build_FromKinematics (IKinematics* K,BONE_P_MAP* p_geting_map=NULL) = 0; - virtual void preBuild_FromKinematics (IKinematics* K,BONE_P_MAP* p_geting_map=NULL) = 0; - virtual void Build (bool disable=false) = 0; - virtual void SetMaxAABBRadius (float size) {}; - - virtual void AddTracedGeom (u16 element=0,u16 geom=0) = 0; - virtual void SetAllGeomTraced () = 0; - virtual void ClearTracedGeoms () = 0; - virtual void DisableGeomTrace () = 0; - virtual void EnableGeomTrace () = 0; - - virtual void RunSimulation (bool place_current_forms=true) = 0; - virtual void UpdateRoot () = 0; - virtual void ZeroCallbacks () = 0; - virtual void ResetCallbacks (u16 id,Flags64 &mask) = 0; - virtual void SetCallbacks ( ) = 0; - virtual void EnabledCallbacks (BOOL val) = 0; - virtual void ToAnimBonesPositions () = 0; - virtual bool AnimToVelocityState (float dt, float l_limit, float a_limit ) = 0; - virtual void SetBonesCallbacksOverwrite (bool v) = 0; - virtual Fmatrix &ObjectInRoot () = 0; - virtual void ObjectToRootForm (const Fmatrix& form) = 0; - virtual void SetPrefereExactIntegration () = 0; - virtual ~CPhysicsShell () ; - //build_FromKinematics in returns elements & joint pointers according bone IDs; - DECLARE_SCRIPT_REGISTER_FUNCTION - }; -add_to_type_list(CPhysicsShell) -#undef script_type_list -#define script_type_list save_type_list(CPhysicsShell) - - - -// Implementation creator -CPhysicsJoint* P_create_Joint (CPhysicsJoint::enumType type ,CPhysicsElement* first,CPhysicsElement* second) ; -CPhysicsElement* P_create_Element () ; -CPhysicsShell* P_create_Shell () ; -CPhysicsShell* P_create_splited_Shell () ; -CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,LPCSTR fixed_bones) ; -CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,U16Vec& fixed_bones) ; -CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,BONE_P_MAP* bone_map, LPCSTR fixed_bones) ; -CPhysicsShell* P_build_Shell (CGameObject* obj,bool not_active_state,BONE_P_MAP* bone_map = 0, bool not_set_bone_callbacks = false) ; -CPhysicsShell* P_build_SimpleShell (CGameObject* obj,float mass,bool not_active_state) ; - void ApplySpawnIniToPhysicShell (CInifile* ini,CPhysicsShell* physics_shell,bool fixed) ; - void fix_bones (LPCSTR fixed_bones,CPhysicsShell* shell ) ; - void destroy_physics_shell (CPhysicsShell* &p) ; - void destroy_physics_shell (CPhysicsShell* &p) ; - -struct NearestToPointCallback -{ - virtual bool operator() ( CPhysicsElement* e ) = 0; -}; - bool shape_is_physic ( const SBoneShape& shape ); - bool has_physics_collision_shapes ( IKinematics& K ); - void phys_shell_verify_object_model ( CObject& O ); - void phys_shell_verify_model ( IKinematics& K ); -#endif // PhysicsShellH \ No newline at end of file diff --git a/src/xrGame/PhysicsShellAnimator.cpp b/src/xrGame/PhysicsShellAnimator.cpp deleted file mode 100644 index 70f4bb73bda..00000000000 --- a/src/xrGame/PhysicsShellAnimator.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "StdAfx.h" -#include "PhysicsShellAnimator.h" -#include "PhysicsShellAnimatorBoneData.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/Kinematics.h" -#include "PHDynamicData.h" -#include "game_object_space.h" -#include "PhysicsShellHolder.h" -#include "../xrEngine/bone.h" - - - - -CPhysicsShellAnimator::CPhysicsShellAnimator( CPhysicsShell* _pPhysicsShell, CInifile* ini, LPCSTR section ) : m_pPhysicsShell( _pPhysicsShell ) -{ - VERIFY( ini->section_exist( section ) ); - CPhysicsShellHolder *obj = (*(_pPhysicsShell->Elements().begin()))->PhysicsRefObject(); - m_StartXFORM.set( obj->XFORM() ); - bool all_bones = true; - if( ini->line_exist( section, "controled_bones" ) ) - { - LPCSTR controled = ini->r_string( section, "controled_bones" ); - all_bones = xr_strcmp( controled , "all" ) == 0; - if( !all_bones ) - CreateJoints( controled ); - } - - if( all_bones ) - for (xr_vector::iterator i=m_pPhysicsShell->Elements().begin();i!=m_pPhysicsShell->Elements().end();i++) - CreateJoint(*i); - - if( ini->line_exist( section, "leave_joints" ) && xr_strcmp( ini->r_string( section, "leave_joints" ), "all" ) == 0 ) - return ; - - for (u16 i=0;iget_JointsNumber();i++) - { - ((CPHShell*)(m_pPhysicsShell))->DeleteJoint(i); - } - -} - -CPhysicsShellAnimator::~CPhysicsShellAnimator() -{ - for (xr_vector::iterator i=m_bones_data.begin();i!=m_bones_data.end();i++) - { - ((CPHShell*)(m_pPhysicsShell))->Island().DActiveIsland()->RemoveJoint(i->m_anim_fixed_dJointID); - dJointDestroy(i->m_anim_fixed_dJointID); - } -} -void CPhysicsShellAnimator:: CreateJoints( LPCSTR controled ) -{ - CPhysicsShellHolder *obj = (*(m_pPhysicsShell->Elements().begin()))->PhysicsRefObject(); - const u16 nb =( u16 )_GetItemCount( controled ); - for(u16 i = 0 ; nb > i ; ++i ) - { - string64 n; - _GetItem( controled, i, n ); - u16 bid = m_pPhysicsShell->PKinematics()->LL_BoneID(n); - VERIFY2( bid != BI_NONE, make_string( "shell_animation - controled bone %s not found! object: %s, model: %s", n, obj->cName().c_str(), obj->cNameVisual().c_str() ) ); - CPHElement *e = smart_cast( m_pPhysicsShell->get_Element( bid ) ); - VERIFY2( e, make_string( "shell_animation - controled bone %s has no physics collision! object: %s, model: %s", n, obj->cName().c_str(), obj->cNameVisual().c_str() ) ); - CreateJoint( e ); - } -} -void CPhysicsShellAnimator:: CreateJoint( CPHElement *e ) -{ - CPhysicsShellAnimatorBoneData PhysicsShellAnimatorBoneDataC; - PhysicsShellAnimatorBoneDataC.m_element=e; - PhysicsShellAnimatorBoneDataC.m_anim_fixed_dJointID=dJointCreateFixed(0,0); - ((CPHShell*)(m_pPhysicsShell))->Island().DActiveIsland()->AddJoint(PhysicsShellAnimatorBoneDataC.m_anim_fixed_dJointID); - dJointAttach(PhysicsShellAnimatorBoneDataC.m_anim_fixed_dJointID,PhysicsShellAnimatorBoneDataC.m_element->get_body(),0); - dJointSetFixed(PhysicsShellAnimatorBoneDataC.m_anim_fixed_dJointID); - m_bones_data.push_back(PhysicsShellAnimatorBoneDataC); -} -void CPhysicsShellAnimator::OnFrame() -{ - - - m_pPhysicsShell->Enable(); - - for (xr_vector::iterator i=m_bones_data.begin();i!=m_bones_data.end();i++) - { - Fmatrix target_obj_posFmatrixS; - CBoneInstance& B=m_pPhysicsShell->PKinematics()->LL_GetBoneInstance(i->m_element->m_SelfID); - //B.Callback_overwrite = FALSE; - //B.Callback = 0; - #pragma todo("reset callback?") - B.set_callback(B.callback_type(),0,B.callback_param(),FALSE); - - m_pPhysicsShell->PKinematics()->CalculateBones_Invalidate(); - m_pPhysicsShell->PKinematics()->CalculateBones(TRUE); - - target_obj_posFmatrixS.mul_43(m_StartXFORM,B.mTransform); - dQuaternion target_obj_quat_dQuaternionS; - dMatrix3 ph_mat; - PHDynamicData::FMXtoDMX(target_obj_posFmatrixS,ph_mat); - dQfromR(target_obj_quat_dQuaternionS,ph_mat); - Fvector mc; - i->m_element->CPHGeometryOwner::get_mc_vs_transform(mc,target_obj_posFmatrixS); - dJointSetFixedQuaternionPos(i->m_anim_fixed_dJointID,target_obj_quat_dQuaternionS,&mc.x); - } - //(*(m_pPhysicsShell->Elements().begin()))->PhysicsRefObject()->XFORM().set(m_pPhysicsShell->mXFORM); -} \ No newline at end of file diff --git a/src/xrGame/PhysicsShellAnimator.h b/src/xrGame/PhysicsShellAnimator.h deleted file mode 100644 index 052aacd1281..00000000000 --- a/src/xrGame/PhysicsShellAnimator.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "PhysicsShell.h" -#include "PhysicsShellAnimatorBoneData.h" -class animation_movement_controller; -class CPhysicsShellAnimator -{ - friend class CPhysicsShellAnimatorBoneData; - xr_vector m_bones_data; - CPhysicsShell* m_pPhysicsShell; - Fmatrix m_StartXFORM; - - void CreateJoints( LPCSTR controled ); - void CreateJoint( CPHElement *e ); -public: - CPhysicsShellAnimator ( CPhysicsShell* _pPhysicsShell, CInifile* ini, LPCSTR section ); - ~CPhysicsShellAnimator (); - void OnFrame (); -}; - - diff --git a/src/xrGame/PhysicsShellAnimatorBoneData.h b/src/xrGame/PhysicsShellAnimatorBoneData.h deleted file mode 100644 index c78f997a268..00000000000 --- a/src/xrGame/PhysicsShellAnimatorBoneData.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "PHShell.h" - -class CPhysicsShellAnimatorBoneData//Ñîäåðæèò èíôîðìàöèþ îá öåëåâîé ìàòðèöå àíèìàöèè -{ - friend class CPhysicsShellAnimator; - dJointID m_anim_fixed_dJointID; - CPHElement* m_element; -}; \ No newline at end of file diff --git a/src/xrGame/PhysicsShellHolder.cpp b/src/xrGame/PhysicsShellHolder.cpp index 7b64e20e1f3..21a1287f86b 100644 --- a/src/xrGame/PhysicsShellHolder.cpp +++ b/src/xrGame/PhysicsShellHolder.cpp @@ -1,9 +1,9 @@ #include "pch_script.h" #include "PhysicsShellHolder.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "xrMessages.h" #include "ph_shell_interface.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "script_callback_ex.h" #include "Level.h" #include "PHCommander.h" @@ -12,16 +12,16 @@ #include "Grenade.h" //#include "phactivationshape.h" -#include "../xrphysics/iphworld.h" -#include "../xrphysics/iActivationShape.h" -//#include "../xrphysics/phvalide.h" -#include "characterphysicssupport.h" +#include "xrPhysics/iphworld.h" +#include "xrPhysics/iActivationShape.h" +//#include "xrPhysics/phvalide.h" +#include "CharacterPhysicsSupport.h" #include "phmovementcontrol.h" #include "physics_shell_animated.h" #include "phcollisiondamagereceiver.h" -#include "../xrEngine/iphysicsshell.h" +#include "xrEngine/iphysicsshell.h" #ifdef DEBUG -#include "../xrengine/objectdump.h" +#include "xrEngine/objectdump.h" #endif CPhysicsShellHolder::CPhysicsShellHolder() { diff --git a/src/xrGame/PhysicsShellHolder.h b/src/xrGame/PhysicsShellHolder.h index 482494d39ca..8f7cd778529 100644 --- a/src/xrGame/PhysicsShellHolder.h +++ b/src/xrGame/PhysicsShellHolder.h @@ -3,8 +3,8 @@ #include "GameObject.h" #include "ParticlesPlayer.h" -#include "../xrEngine/iobjectphysicscollision.h" -#include "../xrphysics/iphysicsshellholder.h" +#include "xrEngine/iobjectphysicscollision.h" +#include "xrPhysics/iphysicsshellholder.h" class CPHDestroyable; class CPHCollisionDamageReceiver; diff --git a/src/xrGame/PhysicsSkeletonObject.cpp b/src/xrGame/PhysicsSkeletonObject.cpp index 4a35d32d191..f2f847109fd 100644 --- a/src/xrGame/PhysicsSkeletonObject.cpp +++ b/src/xrGame/PhysicsSkeletonObject.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" #include "physicsskeletonobject.h" //#include "PhysicsShell.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" #include "phsynchronize.h" #include "xrserver_objects_alife.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrEngine/xr_collide_form.h" +#include "Include/xrRender/Kinematics.h" +#include "xrEngine/xr_collide_form.h" CPhysicsSkeletonObject::CPhysicsSkeletonObject() { diff --git a/src/xrGame/RadioactiveZone.cpp b/src/xrGame/RadioactiveZone.cpp index 2c5124c9500..9cbe5ad439c 100644 --- a/src/xrGame/RadioactiveZone.cpp +++ b/src/xrGame/RadioactiveZone.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "radioactivezone.h" -#include "level.h" +#include "Level.h" #include "xrmessages.h" #include "xrCore/Animation/Bone.hpp" #include "actor.h" #include "game_base_space.h" #include "Hit.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" CRadioactiveZone::CRadioactiveZone(void) {} diff --git a/src/xrGame/RegistryFuncs.cpp b/src/xrGame/RegistryFuncs.cpp index 4c3f7129cd9..765704bbb56 100644 --- a/src/xrGame/RegistryFuncs.cpp +++ b/src/xrGame/RegistryFuncs.cpp @@ -1,6 +1,6 @@ #include "StdAfx.h" #include "RegistryFuncs.h" -#include "../xrGameSpy/xrGameSpy_MainDefs.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" #define REGISTRY_BASE HKEY_LOCAL_MACHINE diff --git a/src/xrGame/RocketLauncher.cpp b/src/xrGame/RocketLauncher.cpp index 2dd853fd303..e3384544394 100644 --- a/src/xrGame/RocketLauncher.cpp +++ b/src/xrGame/RocketLauncher.cpp @@ -7,9 +7,9 @@ #include "RocketLauncher.h" #include "CustomRocket.h" #include "xrserver_objects_alife_items.h" -#include "level.h" +#include "Level.h" #include "ai_object_location.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" CRocketLauncher::CRocketLauncher() { diff --git a/src/xrGame/ShellHit.cpp b/src/xrGame/ShellHit.cpp deleted file mode 100644 index 548d7916e48..00000000000 --- a/src/xrGame/ShellHit.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "StdAfx.h" -#include "PHDynamicData.h" -#include "Physics.h" -#include "tri-colliderknoopc/dTriList.h" -#include "PHShellSplitter.h" -#include "PHFracture.h" -#include "PHJointDestroyInfo.h" -#include "ExtendedGeom.h" - -#include "PHElement.h" -#include "PHShell.h" - - -void CPHShell::applyHit(const Fvector& pos, const Fvector& dir, float val,const u16 id,ALife::EHitType hit_type) -{ - if(id==u16(-1)) return;// -#pragma todo("Kosya to kosya:this code shold treat all hit types") - if(!m_pKinematics) - { - applyImpulseTrace(pos,dir,val); - return; - } - switch(hit_type) { - case ALife::eHitTypeExplosion: - ExplosionHit(pos,dir,val,id); - break; - default: applyImpulseTrace(pos,dir,val,id); - } -} - -void CPHShell::ExplosionHit(const Fvector& pos, const Fvector& dir, float val,const u16 id) -{ - if(!isActive()) return; - EnableObject(0); - //Fvector local_pos;local_pos.set(0.f,0.f,0.f); - ELEMENT_I i=elements.begin(),e=elements.end(); - float impulse=val/_sqrt(_sqrt((float)elements.size())); - for(;i!=e;i++) - { - //Fvector max_area_dir; - CPHElement* element=(*i); - //element->get_MaxAreaDir(max_area_dir); - //float sign=max_area_dir.dotproduct(dir)>0.f ? 1.f : -1.f; - //max_area_dir.mul(sign); - u16 gn=element->CPHGeometryOwner::numberOfGeoms(); - float g_impulse=impulse/gn; - for(u16 j=0;jgetRadius(); - r_box.set(rad,rad,rad); - r_pos.random_point(r_box); - r_dir.random_dir(); - if(!fis_zero(pos.magnitude(),EPS_L)) - { - r_dir.mul(0.5f); - r_dir.add(dir); - } - - r_dir.normalize_safe();//safe??? - element->applyImpulseTrace(r_pos,r_dir,g_impulse,element->CPHGeometryOwner::Geom(j)->bone_id()); - } - } -} diff --git a/src/xrGame/ShootingObject.cpp b/src/xrGame/ShootingObject.cpp index 9273e9f00c4..e8ce580ecf8 100644 --- a/src/xrGame/ShootingObject.cpp +++ b/src/xrGame/ShootingObject.cpp @@ -13,7 +13,7 @@ #include "actor.h" #include "spectator.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "level_bullet_manager.h" #include "game_cl_single.h" diff --git a/src/xrGame/ShootingObject.h b/src/xrGame/ShootingObject.h index e31ebb3beb0..699f577ca34 100644 --- a/src/xrGame/ShootingObject.h +++ b/src/xrGame/ShootingObject.h @@ -7,7 +7,7 @@ #pragma once #include "alife_space.h" -#include "../xrEngine/render.h" +#include "xrEngine/render.h" #include "anticheat_dumpable_object.h" class CCartridge; diff --git a/src/xrGame/SimpleDetector.cpp b/src/xrGame/SimpleDetector.cpp index ff3d1ec6b21..73661a2bd35 100644 --- a/src/xrGame/SimpleDetector.cpp +++ b/src/xrGame/SimpleDetector.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "simpledetector.h" #include "ui/ArtefactDetectorUI.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrEngine/LightAnimLibrary.h" +#include "Include/xrRender/Kinematics.h" +#include "xrEngine/LightAnimLibrary.h" #include "player_hud.h" CSimpleDetector::CSimpleDetector(void) diff --git a/src/xrGame/Spectator.cpp b/src/xrGame/Spectator.cpp index 3eed118a370..51bdb1efe40 100644 --- a/src/xrGame/Spectator.cpp +++ b/src/xrGame/Spectator.cpp @@ -10,13 +10,13 @@ #include "actor.h" #include "xrServer_Objects.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "xr_level_controller.h" #include "seniority_hierarchy_holder.h" #include "team_hierarchy_holder.h" #include "squad_hierarchy_holder.h" #include "group_hierarchy_holder.h" -#include "../xrEngine/CameraManager.h" +#include "xrEngine/CameraManager.h" #include "Inventory.h" #include "huditem.h" #include "game_cl_mp.h" @@ -500,7 +500,7 @@ BOOL CSpectator::net_Spawn ( CSE_Abstract* DC ) return TRUE; }; -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" void CSpectator::net_Destroy () { inherited::net_Destroy (); diff --git a/src/xrGame/Spectator.h b/src/xrGame/Spectator.h index 8bced71f6b4..3686b084182 100644 --- a/src/xrGame/Spectator.h +++ b/src/xrGame/Spectator.h @@ -3,8 +3,8 @@ #pragma once -#include "../xrEngine/feel_touch.h" -#include "../xrEngine/iinputreceiver.h" +#include "xrEngine/feel_touch.h" +#include "xrEngine/iinputreceiver.h" #include "entity.h" #include "actor_flags.h" diff --git a/src/xrGame/StdAfx.h b/src/xrGame/StdAfx.h index cbbc5927838..421ae4ac702 100644 --- a/src/xrGame/StdAfx.h +++ b/src/xrGame/StdAfx.h @@ -1,7 +1,7 @@ #pragma once #pragma warning(disable:4995) -#include "../xrEngine/stdafx.h" +#include "xrEngine/stdafx.h" #include "DPlay/dplay8.h" #pragma warning(default:4995) #pragma warning( 4 : 4018 ) @@ -18,8 +18,8 @@ # define THROW3 VERIFY3 #endif -#include "../xrEngine/gamefont.h" -#include "../xrEngine/xr_object.h" -#include "../xrEngine/igame_level.h" -#include "../xrphysics/xrphysics.h" +#include "xrEngine/gamefont.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/igame_level.h" +#include "xrPhysics/xrphysics.h" #include "xrServerEntities/smart_cast.h" \ No newline at end of file diff --git a/src/xrGame/TeleWhirlwind.cpp b/src/xrGame/TeleWhirlwind.cpp index a0bee52fd54..e8a3c0df011 100644 --- a/src/xrGame/TeleWhirlwind.cpp +++ b/src/xrGame/TeleWhirlwind.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" #include "telewhirlwind.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "PhysicsShellHolder.h" -#include "level.h" +#include "Level.h" #include "hit.h" #include "phdestroyable.h" #include "xrmessages.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" //#include "PHWorld.h" CTeleWhirlwind ::CTeleWhirlwind () { diff --git a/src/xrGame/TeleWhirlwind.h b/src/xrGame/TeleWhirlwind.h index e692766cd6f..683235caf7e 100644 --- a/src/xrGame/TeleWhirlwind.h +++ b/src/xrGame/TeleWhirlwind.h @@ -2,7 +2,7 @@ #define TELE_WHIRLWIND #include "ai/monsters/telekinesis.h" #include "ai/monsters/telekinetic_object.h" -#include "../xrphysics/PHImpact.h" +#include "xrPhysics/PHImpact.h" class CTeleWhirlwind; class CGameObject; diff --git a/src/xrGame/ThornArtifact.cpp b/src/xrGame/ThornArtifact.cpp index 64b8855137d..c6a0a7ab0c7 100644 --- a/src/xrGame/ThornArtifact.cpp +++ b/src/xrGame/ThornArtifact.cpp @@ -5,7 +5,7 @@ #include "stdafx.h" #include "ThornArtifact.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CThornArtefact::CThornArtefact(void) diff --git a/src/xrGame/Torch.cpp b/src/xrGame/Torch.cpp index e5761d65c92..60d22068539 100644 --- a/src/xrGame/Torch.cpp +++ b/src/xrGame/Torch.cpp @@ -2,15 +2,15 @@ #include "torch.h" #include "entity.h" #include "actor.h" -#include "../xrEngine/LightAnimLibrary.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrEngine/LightAnimLibrary.h" +#include "xrPhysics/PhysicsShell.h" #include "xrserver_objects_alife_items.h" #include "ai_sounds.h" -#include "level.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrEngine/camerabase.h" -#include "../xrengine/xr_collide_form.h" +#include "Level.h" +#include "Include/xrRender/Kinematics.h" +#include "xrEngine/camerabase.h" +#include "xrEngine/xr_collide_form.h" #include "inventory.h" #include "game_base_space.h" diff --git a/src/xrGame/TorridZone.cpp b/src/xrGame/TorridZone.cpp index 2cc0b612511..ba30c55d166 100644 --- a/src/xrGame/TorridZone.cpp +++ b/src/xrGame/TorridZone.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "torridZone.h" -#include "../xrEngine/objectanimator.h" +#include "xrEngine/objectanimator.h" #include "xrServer_Objects_ALife_Monsters.h" CTorridZone::CTorridZone() diff --git a/src/xrGame/Tracer.cpp b/src/xrGame/Tracer.cpp index 6587196e492..07570ae73d2 100644 --- a/src/xrGame/Tracer.cpp +++ b/src/xrGame/Tracer.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "Tracer.h" -#include "../xrEngine/render.h" +#include "xrEngine/render.h" -#include "../Include/xrRender/UIShader.h" -#include "../Include/xrRender/UIRender.h" +#include "Include/xrRender/UIShader.h" +#include "Include/xrRender/UIRender.h" const u32 MAX_TRACERS = (1024*5); const float TRACER_SIZE = 0.13f; diff --git a/src/xrGame/UICustomItem.cpp b/src/xrGame/UICustomItem.cpp deleted file mode 100644 index 5863d10ec83..00000000000 --- a/src/xrGame/UICustomItem.cpp +++ /dev/null @@ -1,196 +0,0 @@ -#include "stdafx.h" -#include "uicustomitem.h" -#include "hudmanager.h" -#include "../Include/xrRender/UIRender.h" - -CUICustomItem::CUICustomItem() -{ - uAlign = alNone; - uFlags.zero (); - iVisRect.set (0,0,0,0); - iOriginalRect.set (0,0,0,0); - iHeadingPivot.set (0,0); - iHeadingOffset.set (0,0); -} -//-------------------------------------------------------------------- - -CUICustomItem::~CUICustomItem() -{ -} - -void CUICustomItem::Render(const Fvector2& pos, u32 color, - float x1, float y1, float x2, float y2) -{ - Fvector2 ts; - UIRender->GetActiveTextureResolution(ts); - - if ( !uFlags.test(flValidRect) ) - { - SetRect (0,0,ts.x,ts.y); - } - if ( !uFlags.test(flValidOriginalRect) ) - { - iOriginalRect.set(0,0,ts.x,ts.y); - uFlags.set(flValidOriginalRect,TRUE); - } - - Fvector2 LTp,RBp; - Fvector2 LTt,RBt; - //êîîðäèíàòû íà ýêðàíå â ïèêñåëÿõ - UI()->ClientToScreenScaled (LTp, x1,y1); - LTp.add (pos); - - UI()->ClientToScreenScaled (RBp, x2,y2); - RBp.add (pos); - - //òåêñòóðíûå êîîðäèíàòû - LTt.set ( iOriginalRect.x1/ts.x, iOriginalRect.y1/ts.y); - RBt.set ( iOriginalRect.x2/ts.x, iOriginalRect.y2/ts.y); - - float offset = -0.5f; - if(UI()->m_currentPointType==IUIRender::pttLIT) - offset = 0.0f; - // clip poly - sPoly2D S; - S.resize (4); - S[0].set (LTp.x+offset, LTp.y+offset, LTt.x, LTt.y); // LT - S[1].set (RBp.x+offset, LTp.y+offset, RBt.x, LTt.y); // RT - S[2].set (RBp.x+offset, RBp.y+offset, RBt.x, RBt.y); // RB - S[3].set (LTp.x+offset, RBp.y+offset, LTt.x, RBt.y); // LB - - sPoly2D D; - sPoly2D* R = NULL; - - if(UI()->m_currentPointType!=IUIRender::pttLIT) - R = UI()->ScreenFrustum().ClipPoly(S,D); - else - R = &S; - - if (R && R->size()) - { - for (u32 k=0; ksize()-2; ++k) - { - UIRender->PushPoint((*R)[0+0].pt.x, (*R)[0+0].pt.y, 0, color, (*R)[0+0].uv.x, (*R)[0+0].uv.y); - UIRender->PushPoint((*R)[k+1].pt.x, (*R)[k+1].pt.y, 0, color, (*R)[k+1].uv.x, (*R)[k+1].uv.y); - UIRender->PushPoint((*R)[k+2].pt.x, (*R)[k+2].pt.y, 0, color, (*R)[k+2].uv.x, (*R)[k+2].uv.y); - } - } -} -//-------------------------------------------------------------------- -void CUICustomItem::Render(const Fvector2& pos, u32 color) -{ - Render(pos,color,iVisRect.x1,iVisRect.y1,iVisRect.x2,iVisRect.y2); -} -//-------------------------------------------------------------------- - -void CUICustomItem::Render(const Fvector2& pos_ns, u32 color, float angle) -{ - Fvector2 ts; - Fvector2 hp; - - UIRender->GetActiveTextureResolution(ts); - hp.set (0.5f/ts.x,0.5f/ts.y); - - if ( !uFlags.test(flValidRect) ) - SetRect (0,0,ts.x,ts.y); - - if (!uFlags.test(flValidOriginalRect) ) - { - iOriginalRect.set(0,0,ts.x,ts.y); - uFlags.set(flValidOriginalRect,TRUE); - } - - Fvector2 pivot,offset,SZ; - SZ.set (iVisRect.rb); - - - float cosA = _cos(angle); - float sinA = _sin(angle); - - // Rotation - if( !uFlags.test(flValidHeadingPivot) ) - pivot.set(iVisRect.x2/2.f, iVisRect.y2/2.f); - else - pivot.set(iHeadingPivot.x, iHeadingPivot.y); - - pivot.set (pivot); - offset.set (pos_ns); - - offset.add (iHeadingOffset); - - Fvector2 LTt,RBt; - LTt.set (iOriginalRect.x1/ts.x+hp.x, iOriginalRect.y1/ts.y+hp.y); - RBt.set (iOriginalRect.x2/ts.x+hp.x, iOriginalRect.y2/ts.y+hp.y); - - float kx = (UI()->is_16_9_mode())?0.8333f:1.0f; - - // clip poly - sPoly2D S; - S.resize (4); - // LT - S[0].set (0.f,0.f,LTt.x,LTt.y); - S[0].rotate_pt (pivot,cosA,sinA,kx); - S[0].pt.add (offset); - - // RT - S[1].set (SZ.x,0.f,RBt.x,LTt.y); - S[1].rotate_pt (pivot,cosA,sinA,kx); - S[1].pt.add (offset); - // RB - S[2].set (SZ.x,SZ.y,RBt.x,RBt.y); - S[2].rotate_pt (pivot,cosA,sinA,kx); - S[2].pt.add (offset); - // LB - S[3].set (0.f,SZ.y,LTt.x,RBt.y); - S[3].rotate_pt (pivot,cosA,sinA,kx); - S[3].pt.add (offset); - - for(int i=0; i<4;++i) - UI()->ClientToScreenScaled (S[i].pt); - - sPoly2D D; - sPoly2D* R = UI()->ScreenFrustum().ClipPoly(S,D); - if (R&&R->size()){ - for (u32 k=0; ksize()-2; k++) - { - UIRender->PushPoint((*R)[0+0].pt.x, (*R)[0+0].pt.y, 0, color, (*R)[0+0].uv.x, (*R)[0+0].uv.y); - UIRender->PushPoint((*R)[k+1].pt.x, (*R)[k+1].pt.y, 0, color, (*R)[k+1].uv.x, (*R)[k+1].uv.y); - UIRender->PushPoint((*R)[k+2].pt.x, (*R)[k+2].pt.y, 0, color, (*R)[k+2].uv.x, (*R)[k+2].uv.y); - } - } -/* this is tri-fan drawing - if (R&&R->size()) - for (u32 k=0; ksize(); k++) - { - UIRender->PushPoint((*R)[k].pt.x, (*R)[k].pt.y, 0, color, (*R)[k].uv.x, (*R)[k].uv.y); - } -*/ -} - -Frect CUICustomItem::GetOriginalRect() const -{ - return iOriginalRect; -} - -void CUICustomItem::SetOriginalRect(float x, float y, float width, float height) -{ - iOriginalRect.set(x,y,x+width,y+height); - uFlags.set(flValidOriginalRect, TRUE); -} - -void CUICustomItem::ResetHeadingPivot() -{ - uFlags.set(flValidHeadingPivot, FALSE); - uFlags.set(flFixedLTWhileHeading,FALSE); -} - -void CUICustomItem::SetHeadingPivot(const Fvector2& p, const Fvector2& offset, bool fixedLT) -{ - iHeadingPivot=p; - iHeadingOffset=offset; - uFlags.set(flValidHeadingPivot, TRUE); - if(fixedLT) - uFlags.set(flFixedLTWhileHeading,TRUE); - else - uFlags.set(flFixedLTWhileHeading,FALSE); -} diff --git a/src/xrGame/UICustomItem.h b/src/xrGame/UICustomItem.h deleted file mode 100644 index 6f443a22aa6..00000000000 --- a/src/xrGame/UICustomItem.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once - -enum EUIItemAlign{ - alNone = 0x0000, - alLeft = 0x0001, - alRight = 0x0002, - alTop = 0x0004, - alBottom= 0x0008, - alCenter= 0x0010 -}; - -class CUICustomItem -{ -protected: - enum { - flValidRect =(1<<0), - flValidOriginalRect =(1<<1), - flValidHeadingPivot =(1<<2), - flFixedLTWhileHeading =(1<<3), - }; - //ïðÿìîóãîëüíèê(â ïèêñåëÿõ) - //ãåîì. ðåãèîí íà êîòîðûé íàòÿãèêàåòñÿ òåêñòóðà ñ òåêñòóðíûìè êîîðäèíàòàìè iOriginalRect - Frect iVisRect; - - //ôðåéì òåêñòóðû â ïèêñåëÿõ îòí. 0/0 - Frect iOriginalRect; - - // òî÷êà, îòíîñèòåëüíî êîòîðîé ïðèìåíÿåì ïîâîðîò - Fvector2 iHeadingPivot; - Fvector2 iHeadingOffset; - - Flags32 uFlags; - u32 uAlign; - -public: - CUICustomItem (); - virtual ~CUICustomItem (); - IC void SetRect (float x1, float y1, float x2, float y2){iVisRect.set(x1,y1,x2,y2); uFlags.set(flValidRect,TRUE); } - IC void SetRect (const Frect& r){iVisRect.set(r); uFlags.set(flValidRect, TRUE); } - void SetOriginalRect (float x, float y, float width, float height); - - IC Frect GetRect () {return iVisRect;} - Frect GetOriginalRect () const; - - void SetHeadingPivot (const Fvector2& p, const Fvector2& offset, bool fixedLT); - void ResetHeadingPivot (); - IC bool GetFixedLTWhileHeading () const {return !!uFlags.test(flFixedLTWhileHeading);} - Fvector2 GetHeadingPivot () {return iHeadingPivot;} - - void Render (const Fvector2& pos, u32 color, - float x1, float y1, - float x2, float y2); - - void Render (const Fvector2& pos, u32 color); - void Render (const Fvector2& pos, u32 color, float angle); - - IC void SetAlign (u32 align) {uAlign=align;}; - IC u32 GetAlign () {return uAlign;} - -}; diff --git a/src/xrGame/UIDMStatisticWnd.cpp b/src/xrGame/UIDMStatisticWnd.cpp deleted file mode 100644 index f6b75026f89..00000000000 --- a/src/xrGame/UIDMStatisticWnd.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#include "stdafx.h" -#include "UIDMStatisticWnd.h" -#include "Level.h" -#include "game_cl_base_weapon_usage_statistic.h" - -const char * const STATS_XML = "statisticwnd.xml"; - -CUIDMStatisticWnd::CUIDMStatisticWnd () : - CUIStatsWnd(STATS_XML) -{ - - SetHeaderColumnText(0, "Name"); - SetHeaderColumnText(1, "Efficiency"); - SetHeaderColumnText(2, "Hits/Shots"); - SetHeaderColumnText(3, "Kills"); - - Show(); -}; - -CUIDMStatisticWnd::~CUIDMStatisticWnd () -{ -}; - -bool CUIDMStatisticWnd::SetItemData (Weapon_Statistic* pWS, CUIStatsListItem *pItem) -{ - if (!pWS) return false; - - string1024 Text; - pItem->FieldsVector[0]->SetText(*pWS->InvName); - float Eff = float(pWS->m_dwHitsScored)/((pWS->m_dwBulletsFired != 0) ? (pWS->m_dwBulletsFired) : 1); - sprintf_s(Text, "%.2f", Eff); pItem->FieldsVector[1]->SetText(Text); - u32 Hits = u32(pWS->m_dwRoundsFired*Eff); - sprintf_s(Text, "%d / %d", Hits, pWS->m_dwRoundsFired); - pItem->FieldsVector[2]->SetText(Text); - sprintf_s(Text, "%d", pWS->m_dwKillsScored); pItem->FieldsVector[3]->SetText(Text); - - return true; -}; - -void CUIDMStatisticWnd::Update () -{ - inherited::Update(); - //----------------------------------- - if (!Game().local_player) return; - - PLAYERS_STATS_it pPlayerI; - if (!Game().m_WeaponUsageStatistic->GetPlayer(Game().local_player->getName(), pPlayerI)) - { - while (GetItemCount()) - { - RemoveItem(0); - } - return; - }; - Player_Statistic* pPS = &(*pPlayerI); - //----------------------------------------- - while (pPS->aWeaponStats.size() < GetItemCount()) - { - RemoveItem(0); - }; - //--------------------------------------- - while (pPS->aWeaponStats.size() > GetItemCount()) - { - AddItem(); - }; - //--------------------------------------- - for (u32 i=0; iaWeaponStats[i]), pItem)) continue; - - pItem->FieldsVector[0]->SetText(NULL); - pItem->FieldsVector[1]->SetText(NULL); - pItem->FieldsVector[2]->SetText(NULL); - }; -}; - -void CUIDMStatisticWnd::Draw() -{ - inherited::Draw(); -} \ No newline at end of file diff --git a/src/xrGame/UIDMStatisticWnd.h b/src/xrGame/UIDMStatisticWnd.h deleted file mode 100644 index 1a67ce8c773..00000000000 --- a/src/xrGame/UIDMStatisticWnd.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "ui/UIStatsWnd.h" -#include "game_cl_base.h" - -struct Weapon_Statistic; - -class CUIDMStatisticWnd:public CUIStatsWnd -{ - typedef CUIStatsWnd inherited; - -protected: - bool SetItemData (Weapon_Statistic* pWS, CUIStatsListItem *pItem); - virtual u32 GetItemCount () {return UIStatsList.GetItemsCount();}; - virtual CUIStatsListItem* GetItem (int index) - { - return (smart_cast (UIStatsList.GetItem(index))); - }; -public: - CUIDMStatisticWnd (); - ~CUIDMStatisticWnd (); - - virtual void Update (); - virtual void Draw(); - -}; diff --git a/src/xrGame/UIDialogHolder.cpp b/src/xrGame/UIDialogHolder.cpp index 6c4f9cf139d..cf4cefc6a9e 100644 --- a/src/xrGame/UIDialogHolder.cpp +++ b/src/xrGame/UIDialogHolder.cpp @@ -3,10 +3,10 @@ #include "ui/UIDialogWnd.h" #include "UIGameCustom.h" #include "UICursor.h" -#include "level.h" +#include "Level.h" #include "actor.h" #include "xr_level_controller.h" -#include "../xrEngine/CustomHud.h" +#include "xrEngine/CustomHud.h" dlgItem::dlgItem(CUIWindow* pWnd) { diff --git a/src/xrGame/UIDialogHolder.h b/src/xrGame/UIDialogHolder.h index 38231d595ec..e6974dec0ae 100644 --- a/src/xrGame/UIDialogHolder.h +++ b/src/xrGame/UIDialogHolder.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrEngine/dedicated_server_only.h" -#include "../xrEngine/no_single.h" +#include "xrEngine/dedicated_server_only.h" +#include "xrEngine/no_single.h" class CUIDialogWnd; class CUIWindow; diff --git a/src/xrGame/UIGameAHunt.cpp b/src/xrGame/UIGameAHunt.cpp index f618e2639d5..0b8397ee6e6 100644 --- a/src/xrGame/UIGameAHunt.cpp +++ b/src/xrGame/UIGameAHunt.cpp @@ -2,7 +2,7 @@ #include "UIGameAHunt.h" #include "team_base_zone.h" -#include "level.h" +#include "Level.h" #include "game_cl_ArtefactHunt.h" #include "ui/UIStatic.h" #include "ui/UIXmlInit.h" diff --git a/src/xrGame/UIGameCTA.cpp b/src/xrGame/UIGameCTA.cpp index 56650351502..d15975e9471 100644 --- a/src/xrGame/UIGameCTA.cpp +++ b/src/xrGame/UIGameCTA.cpp @@ -9,7 +9,7 @@ #include "game_cl_capture_the_artefact.h" #include "game_cl_mp.h" -#include "level.h" +#include "Level.h" #include "actor.h" #include "artefact.h" #include "inventory.h" diff --git a/src/xrGame/UIGameCustom.cpp b/src/xrGame/UIGameCustom.cpp index 96a5bf8f258..99327458691 100644 --- a/src/xrGame/UIGameCustom.cpp +++ b/src/xrGame/UIGameCustom.cpp @@ -1,6 +1,6 @@ #include "pch_script.h" #include "UIGameCustom.h" -#include "level.h" +#include "Level.h" #include "ui/UIXmlInit.h" #include "ui/UIStatic.h" #include "object_broker.h" diff --git a/src/xrGame/UIGameCustom_script.cpp b/src/xrGame/UIGameCustom_script.cpp index 3d2664ce78f..5cbc9e8aac0 100644 --- a/src/xrGame/UIGameCustom_script.cpp +++ b/src/xrGame/UIGameCustom_script.cpp @@ -1,6 +1,6 @@ #include "pch_script.h" #include "UIGameCustom.h" -#include "level.h" +#include "Level.h" #include "ui/uistatic.h" using namespace luabind; diff --git a/src/xrGame/UIGameDM.cpp b/src/xrGame/UIGameDM.cpp index fc042aca54d..d9969ac1fc8 100644 --- a/src/xrGame/UIGameDM.cpp +++ b/src/xrGame/UIGameDM.cpp @@ -6,7 +6,7 @@ #include "ui/UIPdaWnd.h" #include "ui/UIMapDesc.h" #include "ui/KillMessageStruct.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" #include "Spectator.h" #include "Inventory.h" diff --git a/src/xrGame/UIGameSP.cpp b/src/xrGame/UIGameSP.cpp index c04f97e29bd..73d9992c728 100644 --- a/src/xrGame/UIGameSP.cpp +++ b/src/xrGame/UIGameSP.cpp @@ -1,8 +1,8 @@ #include "pch_script.h" #include "uigamesp.h" #include "actor.h" -#include "level.h" -#include "../xrEngine/xr_input.h" +#include "Level.h" +#include "xrEngine/xr_input.h" #ifdef DEBUG #include "attachable_item.h" @@ -11,7 +11,7 @@ #include "game_cl_Single.h" #include "xr_level_controller.h" #include "actorcondition.h" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" #include "object_broker.h" #include "GameTaskManager.h" #include "GameTask.h" diff --git a/src/xrGame/UIPlayerItem.h b/src/xrGame/UIPlayerItem.h index 4f48ac768d2..a6dd4d30884 100644 --- a/src/xrGame/UIPlayerItem.h +++ b/src/xrGame/UIPlayerItem.h @@ -7,7 +7,7 @@ #include "game_cl_base.h" #include "string_table.h" -#include "level.h" +#include "Level.h" #include "associative_vector.h" class UITeamState; diff --git a/src/xrGame/UITeamHeader.h b/src/xrGame/UITeamHeader.h index 71a55b1b2a5..54455b7be61 100644 --- a/src/xrGame/UITeamHeader.h +++ b/src/xrGame/UITeamHeader.h @@ -7,7 +7,7 @@ #include "game_cl_base.h" #include "string_table.h" -#include "level.h" +#include "Level.h" #include "associative_vector.h" class CUIStatic; diff --git a/src/xrGame/UITeamState.h b/src/xrGame/UITeamState.h index 557d48ac236..d6be66c6c82 100644 --- a/src/xrGame/UITeamState.h +++ b/src/xrGame/UITeamState.h @@ -8,7 +8,7 @@ #include "game_cl_base.h" #include "string_table.h" #include "game_base.h" -#include "level.h" +#include "Level.h" #include "associative_vector.h" diff --git a/src/xrGame/UIZoneMap.cpp b/src/xrGame/UIZoneMap.cpp index 041395f98a2..dc5a5321e94 100644 --- a/src/xrGame/UIZoneMap.cpp +++ b/src/xrGame/UIZoneMap.cpp @@ -5,7 +5,7 @@ #include "Pda.h" #include "Grenade.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" #include "actor.h" diff --git a/src/xrGame/Weapon.cpp b/src/xrGame/Weapon.cpp index 3cc4733c8ab..8906b8eb16b 100644 --- a/src/xrGame/Weapon.cpp +++ b/src/xrGame/Weapon.cpp @@ -7,12 +7,12 @@ #include "xrserver_objects_alife_items.h" #include "actor.h" #include "actoreffector.h" -#include "level.h" +#include "Level.h" #include "xr_level_controller.h" #include "game_cl_base.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ai_object_location.h" -#include "../xrphysics/mathutils.h" +#include "xrPhysics/mathutils.h" #include "object_broker.h" #include "player_hud.h" #include "gamepersistent.h" diff --git a/src/xrGame/Weapon.h b/src/xrGame/Weapon.h index 41dce7c0d39..c5ffc56df7c 100644 --- a/src/xrGame/Weapon.h +++ b/src/xrGame/Weapon.h @@ -1,13 +1,13 @@ #pragma once -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "weaponammo.h" #include "PHShellCreator.h" #include "ShootingObject.h" #include "hud_item_object.h" #include "Actor_Flags.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "firedeps.h" #include "game_cl_single.h" #include "first_bullet_controller.h" diff --git a/src/xrGame/WeaponAmmo.cpp b/src/xrGame/WeaponAmmo.cpp index a59803bf4c6..63dd2f47fc9 100644 --- a/src/xrGame/WeaponAmmo.cpp +++ b/src/xrGame/WeaponAmmo.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "weaponammo.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "xrserver_objects_alife_items.h" #include "Actor_Flags.h" #include "inventory.h" @@ -8,7 +8,7 @@ #include "level_bullet_manager.h" #include "ai_space.h" #include "xrEngine/GameMtlLib.h" -#include "level.h" +#include "Level.h" #include "string_table.h" #define BULLET_MANAGER_SECTION "bullet_manager" diff --git a/src/xrGame/WeaponAutomaticShotgun.cpp b/src/xrGame/WeaponAutomaticShotgun.cpp index 1e56d334afa..7379f2b4636 100644 --- a/src/xrGame/WeaponAutomaticShotgun.cpp +++ b/src/xrGame/WeaponAutomaticShotgun.cpp @@ -4,7 +4,7 @@ #include "ParticlesObject.h" #include "xr_level_controller.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "actor.h" CWeaponAutomaticShotgun::CWeaponAutomaticShotgun() diff --git a/src/xrGame/WeaponBinoculars.cpp b/src/xrGame/WeaponBinoculars.cpp index 635c210d077..37873abce69 100644 --- a/src/xrGame/WeaponBinoculars.cpp +++ b/src/xrGame/WeaponBinoculars.cpp @@ -3,7 +3,7 @@ #include "xr_level_controller.h" -#include "level.h" +#include "Level.h" #include "ui\UIFrameWindow.h" #include "WeaponBinocularsVision.h" #include "object_broker.h" diff --git a/src/xrGame/WeaponBinocularsVision.cpp b/src/xrGame/WeaponBinocularsVision.cpp index 81d31d063ea..3c3be16387f 100644 --- a/src/xrGame/WeaponBinocularsVision.cpp +++ b/src/xrGame/WeaponBinocularsVision.cpp @@ -13,7 +13,7 @@ #include "Level.h" #include "game_cl_base.h" #include "AI/Monsters/BaseMonster/base_monster.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #define RECT_SIZE 11 diff --git a/src/xrGame/WeaponHUD.cpp b/src/xrGame/WeaponHUD.cpp deleted file mode 100644 index c567122e2b0..00000000000 --- a/src/xrGame/WeaponHUD.cpp +++ /dev/null @@ -1,199 +0,0 @@ -// WeaponHUD.cpp: HUD äëÿ îðóæèÿ è ïðî÷èõ ïðåäìåòîâ, êîòîðûå -// ìîãóò äåðæàòü â ðóêàõ ïåðñîíàæè, òàêæå èñïîëüçóåòñÿ -// äëÿ ñèíõðîíèçàöèè àíèìàöèé ñ âèäîì îò 3-ãî ëèöà -////////////////////////////////////////////////////////////////////// -#include "stdafx.h" -#include "WeaponHUD.h" -#include "Weapon.h" -#include "../xrEngine/Motion.h" -#include "../Include/xrRender/Kinematics.h" -#include "level.h" -#include "MathUtils.h" -weapon_hud_container* g_pWeaponHUDContainer=0; - -BOOL weapon_hud_value::load(const shared_str& section, CHudItem* owner) -{ - // Geometry and transform - Fvector pos,ypr; - pos = pSettings->r_fvector3(section,"position"); - ypr = pSettings->r_fvector3(section,"orientation"); - ypr.mul (PI/180.f); - - m_offset.setHPB (ypr.x,ypr.y,ypr.z); - m_offset.translate_over (pos); - - // Visual - LPCSTR visual_name = pSettings->r_string(section, "visual"); - IRenderVisual *pV = ::Render->model_Create(visual_name); - m_animations = smart_cast(pV); - IKinematics *pK = smart_cast(pV); - - // fire bone - if(smart_cast(owner)){ - LPCSTR fire_bone = pSettings->r_string (section,"fire_bone"); - m_fire_bone = pK->LL_BoneID (fire_bone); - if (m_fire_bone>=pK->LL_BoneCount()) - Debug.fatal (DEBUG_INFO,"There is no '%s' bone for weapon '%s'.",fire_bone, *section); - m_fp_offset = pSettings->r_fvector3 (section,"fire_point"); - if(pSettings->line_exist(section,"fire_point2")) - m_fp2_offset = pSettings->r_fvector3 (section,"fire_point2"); - else - m_fp2_offset = m_fp_offset; - if(pSettings->line_exist(owner->object().cNameSect(), "shell_particles")) - m_sp_offset = pSettings->r_fvector3 (section,"shell_point"); - else - m_sp_offset.set (0,0,0); - }else{ - m_fire_bone = -1; - m_fp_offset.set (0,0,0); - m_fp2_offset.set (0,0,0); - m_sp_offset.set (0,0,0); - } - return TRUE; -} - -weapon_hud_value::~weapon_hud_value() -{ - //::Render->model_Delete (m_animations); - IRenderVisual *pVisual = smart_cast(m_animations); - ::Render->model_Delete (pVisual); - // model_Delete clears the pointer - m_animations = 0; -} - -u32 shared_weapon_hud::motion_length(MotionID M) -{ - IKinematicsAnimated *skeleton_animated = p_->m_animations; - VERIFY (skeleton_animated); - CMotionDef *motion_def = skeleton_animated->LL_GetMotionDef(M); - VERIFY (motion_def); - - if (motion_def->flags & esmStopAtEnd) { - CMotion* motion = skeleton_animated->LL_GetRootMotion(M); - return iFloor(0.5f + 1000.f*motion->GetLength()/ motion_def->Dequantize(motion_def->speed)); - } - return 0; -} - -MotionID shared_weapon_hud::motion_id(LPCSTR name) -{ - return p_->m_animations->ID_Cycle_Safe(name); -} - -CWeaponHUD::CWeaponHUD (CHudItem* pHudItem) -{ - m_bVisible = false; - m_pParentWeapon = pHudItem; - m_bHidden = true; - m_bStopAtEndAnimIsRunning = false; - m_pCallbackItem = NULL; - m_Transform.identity (); -} - -CWeaponHUD::~CWeaponHUD() -{ -} - -void CWeaponHUD::Load(LPCSTR section) -{ - m_shared_data.create (section,m_pParentWeapon); -} - -void CWeaponHUD::Init() -{ - m_bStopAtEndAnimIsRunning = false; - m_pCallbackItem = NULL; -} - - -void CWeaponHUD::net_DestroyHud() -{ - m_bStopAtEndAnimIsRunning = false; - m_pCallbackItem = NULL; - Visible (false); -} - -void CWeaponHUD::UpdatePosition(const Fmatrix& trans) -{ - m_Transform.mul (trans,m_shared_data.get_value()->m_offset); - VERIFY (!fis_zero(DET(m_Transform))); -} - -MotionID CWeaponHUD::animGet(LPCSTR name) -{ - return m_shared_data.motion_id (name); -} - -void CWeaponHUD::animDisplay(MotionID M, BOOL bMixIn) -{ - if(m_bVisible){ - IRenderVisual *pV = Visual(); - IKinematicsAnimated* PKinematicsAnimated = smart_cast(pV); - IKinematics* pK = smart_cast(pV); - VERIFY (PKinematicsAnimated); - PKinematicsAnimated->PlayCycle (M,bMixIn); - pK->CalculateBones_Invalidate (); - } -} -void CWeaponHUD::animPlay (MotionID M, BOOL bMixIn, CHudItem* W, u32 state) -{ -//. if(m_bStopAtEndAnimIsRunning) -//. StopCurrentAnim (); - - - m_startedAnimState = state; - Show (); - animDisplay (M, bMixIn); - u32 anim_time = m_shared_data.motion_length(M); - if (anim_time>0){ - m_bStopAtEndAnimIsRunning = true; - m_pCallbackItem = W; - m_dwAnimEndTime = Device.dwTimeGlobal + anim_time; - }else{ - m_pCallbackItem = NULL; - } -} - -void CWeaponHUD::Update () -{ - if(m_bStopAtEndAnimIsRunning && Device.dwTimeGlobal > m_dwAnimEndTime) - StopCurrentAnim (); - if(m_bVisible) - smart_cast(Visual())->UpdateTracks (); -} - -void CWeaponHUD::StopCurrentAnim() -{ - m_dwAnimEndTime = 0; - m_bStopAtEndAnimIsRunning = false; - if(m_pCallbackItem) - m_pCallbackItem->OnAnimationEnd (m_startedAnimState); -} - -void CWeaponHUD::StopCurrentAnimWithoutCallback () -{ - m_dwAnimEndTime = 0; - m_bStopAtEndAnimIsRunning = false; - - m_pCallbackItem = NULL; -} - -void CWeaponHUD::CreateSharedContainer () -{ - VERIFY(0==g_pWeaponHUDContainer); - g_pWeaponHUDContainer = xr_new(); -} -void CWeaponHUD::DestroySharedContainer () -{ - xr_delete (g_pWeaponHUDContainer); -} -void CWeaponHUD::CleanSharedContainer () -{ - VERIFY(g_pWeaponHUDContainer); - g_pWeaponHUDContainer->clean(false); -} - -MotionID random_anim(MotionSVec& v) -{ - return v[Random.randI(v.size())]; -} diff --git a/src/xrGame/WeaponHUD.h b/src/xrGame/WeaponHUD.h index 9138dac7a84..9afd24f2342 100644 --- a/src/xrGame/WeaponHUD.h +++ b/src/xrGame/WeaponHUD.h @@ -1,7 +1,5 @@ #pragma once - -//#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" class CHudItem; struct weapon_hud_value: public shared_value diff --git a/src/xrGame/WeaponKnife.cpp b/src/xrGame/WeaponKnife.cpp index 82b7b877ab0..358c83fdda7 100644 --- a/src/xrGame/WeaponKnife.cpp +++ b/src/xrGame/WeaponKnife.cpp @@ -3,10 +3,10 @@ #include "WeaponKnife.h" #include "Entity.h" #include "Actor.h" -#include "level.h" +#include "Level.h" #include "xr_level_controller.h" #include "game_cl_base.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "xrEngine/GameMtlLib.h" #include "level_bullet_manager.h" #include "ai_sounds.h" diff --git a/src/xrGame/WeaponKnife.h b/src/xrGame/WeaponKnife.h index 68f1bf4a536..8c4571aa591 100644 --- a/src/xrGame/WeaponKnife.h +++ b/src/xrGame/WeaponKnife.h @@ -2,7 +2,7 @@ #include "WeaponCustomPistol.h" #include "script_export_space.h" -#include "../xrEngine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" class CWeaponKnife: public CWeapon { private: diff --git a/src/xrGame/WeaponMagazinedWGrenade.cpp b/src/xrGame/WeaponMagazinedWGrenade.cpp index ccbbcf98c7e..5ae5b712427 100644 --- a/src/xrGame/WeaponMagazinedWGrenade.cpp +++ b/src/xrGame/WeaponMagazinedWGrenade.cpp @@ -7,10 +7,10 @@ #include "ExplosiveRocket.h" #include "Actor.h" #include "xr_level_controller.h" -#include "level.h" +#include "Level.h" #include "object_broker.h" #include "game_base_space.h" -#include "../xrphysics/MathUtils.h" +#include "xrPhysics/MathUtils.h" #include "player_hud.h" #ifdef DEBUG diff --git a/src/xrGame/WeaponMounted.cpp b/src/xrGame/WeaponMounted.cpp deleted file mode 100644 index de72d395aa9..00000000000 --- a/src/xrGame/WeaponMounted.cpp +++ /dev/null @@ -1,373 +0,0 @@ -#include "stdafx.h" -#pragma hdrstop - -#include "WeaponMounted.h" -#include "xrServer_Objects_ALife.h" -#include "camerafirsteye.h" -#include "actor.h" -#include "weaponammo.h" - - -#include "actoreffector.h" -#include "effectorshot.h" -#include "ai_sounds.h" -#include "level.h" -#include "xr_level_controller.h" -#include "../Include/xrRender/Kinematics.h" -#include "game_object_space.h" - -//---------------------------------------------------------------------------------------- - -void CWeaponMounted::BoneCallbackX(CBoneInstance *B) -{ - CWeaponMounted *P = static_cast(B->callback_param()); - - if (P->Owner()){ - Fmatrix rX; rX.rotateX (P->camera->pitch+P->m_dAngle.y); - B->mTransform.mulB_43(rX); - } -} - -void CWeaponMounted::BoneCallbackY(CBoneInstance *B) -{ - CWeaponMounted *P = static_cast(B->callback_param()); - - if (P->Owner()){ - Fmatrix rY; rY.rotateY (P->camera->yaw+P->m_dAngle.x); - B->mTransform.mulB_43(rY); - } -} -//---------------------------------------------------------------------------------------- - -CWeaponMounted::CWeaponMounted() -{ - camera = xr_new (this, CCameraBase::flRelativeLink|CCameraBase::flPositionRigid|CCameraBase::flDirectionRigid); - camera->Load ("mounted_weapon_cam"); -} - -CWeaponMounted::~CWeaponMounted() -{ - xr_delete(camera); -} - -void CWeaponMounted::Load(LPCSTR section) -{ - inherited::Load(section); - CShootingObject::Load (section); - - HUD_SOUND::LoadSound(section,"snd_shoot", sndShot, SOUND_TYPE_WEAPON_SHOOTING); - - //òèï èñïîëüçóåìûõ ïàòðîíîâ - m_sAmmoType = pSettings->r_string(section, "ammo_class"); - m_CurrentAmmo.Load(*m_sAmmoType, 0); - - //ïîäáðàñûâàíèå êàìåðû âî âðåìÿ îòäà÷è - camMaxAngle = pSettings->r_float (section,"cam_max_angle" ); - camMaxAngle = deg2rad (camMaxAngle); - camRelaxSpeed = pSettings->r_float (section,"cam_relax_speed" ); - camRelaxSpeed = deg2rad (camRelaxSpeed); - -} - -BOOL CWeaponMounted::net_Spawn(CSE_Abstract* DC) -{ - CSE_Abstract *e = (CSE_Abstract*)(DC); - CSE_ALifeMountedWeapon *mw = smart_cast(e); - R_ASSERT (mw); - - if (!inherited::net_Spawn(DC)) - return (FALSE); - - R_ASSERT (Visual() && smart_cast(Visual())); - - IKinematics* K = smart_cast(Visual()); - CInifile* pUserData = K->LL_UserData(); - - R_ASSERT3 (pUserData,"Empty MountedWeapon user data!",mw->get_visual()); - - fire_bone = K->LL_BoneID (pUserData->r_string("mounted_weapon_definition","fire_bone")); - actor_bone = K->LL_BoneID (pUserData->r_string("mounted_weapon_definition","actor_bone")); - rotate_x_bone = K->LL_BoneID (pUserData->r_string("mounted_weapon_definition","rotate_x_bone")); - rotate_y_bone = K->LL_BoneID (pUserData->r_string("mounted_weapon_definition","rotate_y_bone")); - camera_bone = K->LL_BoneID (pUserData->r_string("mounted_weapon_definition","camera_bone")); - - CBoneData& bdX = K->LL_GetData(rotate_x_bone); VERIFY(bdX.IK_data.type==jtJoint); - camera->lim_pitch.set (bdX.IK_data.limits[0].limit.x,bdX.IK_data.limits[0].limit.y); - CBoneData& bdY = K->LL_GetData(rotate_y_bone); VERIFY(bdY.IK_data.type==jtJoint); - camera->lim_yaw.set (bdY.IK_data.limits[1].limit.x,bdY.IK_data.limits[1].limit.y); - - U16Vec fixed_bones; - fixed_bones.push_back (K->LL_GetBoneRoot()); - PPhysicsShell() = P_build_Shell(this,false,fixed_bones); - K ->CalculateBones_Invalidate(); - K ->CalculateBones(); - - CShootingObject::Light_Create(); - - setVisible (TRUE); - setEnabled (TRUE); - - - - return TRUE; -} - -void CWeaponMounted::net_Destroy() -{ - CShootingObject::Light_Destroy(); - - inherited::net_Destroy(); - xr_delete(m_pPhysicsShell); -} - -void CWeaponMounted::net_Export(NET_Packet& P) -{ - inherited::net_Export(P); -} - -void CWeaponMounted::net_Import(NET_Packet& P) -{ - inherited::net_Import(P); -} - -void CWeaponMounted::UpdateCL() -{ - inherited::UpdateCL (); - if (Owner()){ - IKinematics* K = smart_cast(Visual()); - K->CalculateBones (); - // update fire pos & fire_dir - fire_bone_xform = K->LL_GetTransform(fire_bone); - fire_bone_xform.mulA_43 (XFORM()); - fire_pos.set (0,0,0); - fire_bone_xform.transform_tiny (fire_pos); - fire_dir.set (0,0,1); - fire_bone_xform.transform_dir (fire_dir); - - UpdateFire (); - - if(OwnerActor() && OwnerActor()->IsMyCamera()) - { - cam_Update(Device.fTimeDelta, g_fov); - OwnerActor()->Cameras().UpdateFromCamera(Camera()); - OwnerActor()->Cameras().ApplyDevice(VIEWPORT_NEAR); - } - } -} - -void CWeaponMounted::shedule_Update(u32 dt) -{ - inherited::shedule_Update(dt); -} - -void CWeaponMounted::renderable_Render() -{ - //íàðèñîâàòü ïîäñâåòêó - RenderLight(); - - inherited::renderable_Render (); -} - -void CWeaponMounted::OnMouseMove (int dx, int dy) -{ - if (Remote()) return; - - CCameraBase* C = camera; - float scale = (C->f_fov/g_fov)*psMouseSens * psMouseSensScale/50.f; - if (dx){ - float d = float(dx)*scale; - C->Move ((d<0)?kLEFT:kRIGHT, _abs(d)); - } - if (dy){ - float d = ((psMouseInvert.test(1))?-1:1)*float(dy)*scale*3.f/4.f; - C->Move ((d>0)?kUP:kDOWN, _abs(d)); - } -} -void CWeaponMounted::OnKeyboardPress (int dik) -{ - if (Remote()) return; - - switch (dik) - { - case kWPN_FIRE: - FireStart(); - break; - }; - -} -void CWeaponMounted::OnKeyboardRelease (int dik) -{ - if (Remote()) return; - switch (dik) - { - case kWPN_FIRE: - FireEnd(); - break; - }; -} -void CWeaponMounted::OnKeyboardHold (int dik) -{ - if (Remote()) return; - -// switch(dik) -// { -// } -} - -void CWeaponMounted::cam_Update (float dt, float fov) -{ - Fvector P,Da; - Da.set (0,0,0); - - IKinematics* K = smart_cast(Visual()); - K->CalculateBones_Invalidate (); - K->CalculateBones (); - const Fmatrix& C = K->LL_GetTransform(camera_bone); - XFORM().transform_tiny (P,C.c); - - if(OwnerActor()){ - // rotate head - OwnerActor()->Orientation().yaw = -Camera()->yaw; - OwnerActor()->Orientation().pitch = -Camera()->pitch; - } - Camera()->Update (P,Da); - Level().Cameras().UpdateFromCamera (Camera()); -} - -bool CWeaponMounted::Use (const Fvector& pos,const Fvector& dir,const Fvector& foot_pos) -{ - return !Owner(); -} -bool CWeaponMounted::attach_Actor (CGameObject* actor) -{ - m_dAngle.set(0.0f,0.0f); - CHolderCustom::attach_Actor(actor); - IKinematics* K = smart_cast(Visual()); - // óáðàòü îðóæèå èç ðóê - // disable shell callback - m_pPhysicsShell->EnabledCallbacks(FALSE); - // enable actor rotate callback - CBoneInstance& biX = smart_cast(Visual())->LL_GetBoneInstance(rotate_x_bone); - biX.set_callback (bctCustom,BoneCallbackX,this); - CBoneInstance& biY = smart_cast(Visual())->LL_GetBoneInstance(rotate_y_bone); - biY.set_callback (bctCustom,BoneCallbackY,this); - // set actor to mounted position - const Fmatrix& A = K->LL_GetTransform(actor_bone); - Fvector ap; - XFORM().transform_tiny (ap,A.c); - Fmatrix AP; AP.translate(ap); - if(OwnerActor()) OwnerActor()->SetPhPosition (AP); - processing_activate (); - return true; -} -void CWeaponMounted::detach_Actor () -{ - CHolderCustom::detach_Actor(); - // disable actor rotate callback - CBoneInstance& biX = smart_cast(Visual())->LL_GetBoneInstance(rotate_x_bone); - biX.reset_callback (); - CBoneInstance& biY = smart_cast(Visual())->LL_GetBoneInstance(rotate_y_bone); - biY.reset_callback (); - // enable shell callback - m_pPhysicsShell->EnabledCallbacks(TRUE); - - //çàêîí÷èòü ñòðåëüáó - FireEnd(); - - processing_deactivate (); -} - -Fvector CWeaponMounted::ExitPosition () -{ - return XFORM().c; -} - -CCameraBase* CWeaponMounted::Camera () -{ - return camera; -} - - -void CWeaponMounted::FireStart() -{ - m_dAngle.set(0.0f,0.0f); - CShootingObject::FireStart(); -} -void CWeaponMounted::FireEnd() -{ - m_dAngle.set(0.0f,0.0f); - CShootingObject::FireEnd(); - StopFlameParticles (); - RemoveShotEffector (); -} - - -void CWeaponMounted::OnShot () -{ - VERIFY(Owner()); - - FireBullet(get_CurrentFirePoint(),fire_dir, - fireDispersionBase, - m_CurrentAmmo, Owner()->ID(),ID(), SendHitAllowed(Owner())); - - StartShotParticles (); - - if(m_bLightShotEnabled) - Light_Start (); - - StartFlameParticles(); - StartSmokeParticles(fire_pos, zero_vel); - OnShellDrop(fire_pos, zero_vel); - - bool b_hud_mode = (Level().CurrentEntity() == smart_cast(Owner())); - HUD_SOUND::PlaySound(sndShot, fire_pos, Owner(), b_hud_mode); - - //äîáàâèòü ýôôåêòîð ñòðåëüáû - AddShotEffector (); - m_dAngle.set( ::Random.randF(-fireDispersionBase,fireDispersionBase), - ::Random.randF(-fireDispersionBase,fireDispersionBase)); -} - -void CWeaponMounted::UpdateFire() -{ - fTime -= Device.fTimeDelta; - - - CShootingObject::UpdateFlameParticles(); - CShootingObject::UpdateLight(); - - if(!IsWorking()){ - if(fTime<0) fTime = 0.f; - return; - } - - if(fTime<=0){ - OnShot(); - fTime += fTimeToFire; - }else{ - angle_lerp (m_dAngle.x,0.f,5.f,Device.fTimeDelta); - angle_lerp (m_dAngle.y,0.f,5.f,Device.fTimeDelta); - } -} - -const Fmatrix& CWeaponMounted::get_ParticlesXFORM () -{ - return fire_bone_xform; -} - -void CWeaponMounted::AddShotEffector () -{ - if(OwnerActor()) - { - CCameraShotEffector* S = smart_cast(OwnerActor()->Cameras().GetCamEffector(eCEShot)); - if (!S) S = (CCameraShotEffector*)OwnerActor()->Cameras().AddCamEffector(xr_new (camMaxAngle,camRelaxSpeed, 0.25f, 0.01f, 0.7f)); - R_ASSERT (S); - S->Shot (0.01f); - } -} - -void CWeaponMounted::RemoveShotEffector () -{ - if(OwnerActor()) - OwnerActor()->Cameras().RemoveCamEffector (eCEShot); -} \ No newline at end of file diff --git a/src/xrGame/WeaponMounted.h b/src/xrGame/WeaponMounted.h deleted file mode 100644 index 34a5b3d2320..00000000000 --- a/src/xrGame/WeaponMounted.h +++ /dev/null @@ -1,101 +0,0 @@ -#ifndef WeaponMountedH -#define WeaponMountedH -#pragma once - -#include "holder_custom.h" -#include "shootingobject.h" - -#include "hudsound.h" -#include "weaponammo.h" -#include "physicsshellholder.h" - -class CWeaponMounted : public CPhysicsShellHolder, - public CHolderCustom, - public CShootingObject -{ -private: - ////////////////////////////////////////////////////////////////////////// - // General - ////////////////////////////////////////////////////////////////////////// - typedef CPhysicsShellHolder inherited; - CCameraBase* camera; - u16 fire_bone; - u16 actor_bone; - u16 rotate_x_bone; - u16 rotate_y_bone; - u16 camera_bone; - - Fvector fire_pos, fire_dir; - Fmatrix fire_bone_xform; - Fvector2 m_dAngle; - static void BoneCallbackX (CBoneInstance *B); - static void BoneCallbackY (CBoneInstance *B); -public: - CWeaponMounted (); - virtual ~CWeaponMounted (); - - // for shooting object - virtual const Fvector& get_CurrentFirePoint() {return fire_pos;} - virtual const Fmatrix& get_ParticlesXFORM() ; - - ////////////////////////////////////////////////// - // íåïîñðåäñòâåííî îáðàáîòêà ñòðåëüáû - ////////////////////////////////////////////////// -protected: - virtual void FireStart (); - virtual void FireEnd (); - virtual void UpdateFire (); - virtual void OnShot (); - void AddShotEffector (); - void RemoveShotEffector (); -protected: - shared_str m_sAmmoType; - CCartridge m_CurrentAmmo; - - //çâóê ñòðåëüáû - HUD_SOUND sndShot; - - //äëÿ îòäà÷è - float camRelaxSpeed; - float camMaxAngle; - - - ///////////////////////////////////////////////// - // Generic - ///////////////////////////////////////////////// -public: - virtual CHolderCustom *cast_holder_custom () {return this;} - virtual void Load (LPCSTR section); - - virtual BOOL net_Spawn (CSE_Abstract* DC); - virtual void net_Destroy (); - virtual void net_Export (NET_Packet& P); // export to server - virtual void net_Import (NET_Packet& P); // import from server - - virtual void UpdateCL (); - virtual void shedule_Update (u32 dt); - - virtual void renderable_Render (); - - virtual BOOL UsedAI_Locations (){return FALSE;} - - // control functions - virtual void OnMouseMove (int x, int y); - virtual void OnKeyboardPress (int dik); - virtual void OnKeyboardRelease (int dik); - virtual void OnKeyboardHold (int dik); - - virtual CInventory* GetInventory (){return 0;} - - virtual void cam_Update (float dt, float fov=90.0f); - - virtual bool Use (const Fvector& pos,const Fvector& dir,const Fvector& foot_pos); - virtual bool attach_Actor (CGameObject* actor); - virtual void detach_Actor (); - virtual Fvector ExitPosition (); - virtual bool allowWeapon () const {return false;}; - virtual bool HUDView () const {return true;}; - - virtual CCameraBase* Camera (); -}; -#endif // WeaponMountedH diff --git a/src/xrGame/WeaponRG6.cpp b/src/xrGame/WeaponRG6.cpp index a452b1664a2..d68b3bba267 100644 --- a/src/xrGame/WeaponRG6.cpp +++ b/src/xrGame/WeaponRG6.cpp @@ -2,8 +2,8 @@ #include "WeaponRG6.h" #include "entity.h" #include "explosiveRocket.h" -#include "level.h" -#include "../xrphysics/MathUtils.h" +#include "Level.h" +#include "xrPhysics/MathUtils.h" #include "actor.h" #ifdef DEBUG diff --git a/src/xrGame/WeaponRPG7.cpp b/src/xrGame/WeaponRPG7.cpp index 86762e95c2c..fdcfb6005cd 100644 --- a/src/xrGame/WeaponRPG7.cpp +++ b/src/xrGame/WeaponRPG7.cpp @@ -3,7 +3,7 @@ #include "xrserver_objects_alife_items.h" #include "explosiverocket.h" #include "entity.h" -#include "level.h" +#include "Level.h" #include "player_hud.h" #include "hudmanager.h" diff --git a/src/xrGame/WeaponShotgun.cpp b/src/xrGame/WeaponShotgun.cpp index 0272f4a6d8c..a82981624fd 100644 --- a/src/xrGame/WeaponShotgun.cpp +++ b/src/xrGame/WeaponShotgun.cpp @@ -4,7 +4,7 @@ #include "ParticlesObject.h" #include "xr_level_controller.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "actor.h" CWeaponShotgun::CWeaponShotgun() diff --git a/src/xrGame/WeaponStatMgun.cpp b/src/xrGame/WeaponStatMgun.cpp index 455fb11ca0c..9a1bc915a3f 100644 --- a/src/xrGame/WeaponStatMgun.cpp +++ b/src/xrGame/WeaponStatMgun.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "WeaponStatMgun.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrphysics/PhysicsShell.h" +#include "Include/xrRender/Kinematics.h" +#include "xrPhysics/PhysicsShell.h" #include "weaponAmmo.h" #include "object_broker.h" #include "ai_sounds.h" @@ -10,7 +10,7 @@ #include "camerafirsteye.h" #include "xr_level_controller.h" #include "game_object_space.h" -#include "level.h" +#include "Level.h" void CWeaponStatMgun::BoneCallbackX (CBoneInstance *B) { diff --git a/src/xrGame/WeaponStatMgunFire.cpp b/src/xrGame/WeaponStatMgunFire.cpp index 442a34617bf..49ad490ba7d 100644 --- a/src/xrGame/WeaponStatMgunFire.cpp +++ b/src/xrGame/WeaponStatMgunFire.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "WeaponStatMgun.h" -#include "level.h" +#include "Level.h" #include "entity_alive.h" #include "hudsound.h" #include "actor.h" diff --git a/src/xrGame/ZoneCampfire.cpp b/src/xrGame/ZoneCampfire.cpp index 871b64e69a6..0f1b7120527 100644 --- a/src/xrGame/ZoneCampfire.cpp +++ b/src/xrGame/ZoneCampfire.cpp @@ -2,7 +2,7 @@ #include "ZoneCampfire.h" #include "ParticlesObject.h" #include "GamePersistent.h" -#include "../xrEngine/LightAnimLibrary.h" +#include "xrEngine/LightAnimLibrary.h" /* CZoneCampfire* g_zone = NULL; void turn_zone() diff --git a/src/xrGame/ZoneVisual.cpp b/src/xrGame/ZoneVisual.cpp index 545c796a6b0..731e352a397 100644 --- a/src/xrGame/ZoneVisual.cpp +++ b/src/xrGame/ZoneVisual.cpp @@ -1,11 +1,10 @@ #include "stdafx.h" #include "CustomZone.h" -//#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "ZoneVisual.h" #include "xrServer_Objects_ALife_Monsters.h" -//#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include//xrRender/RenderVisual.h" +#include "Include/xrRender/RenderVisual.h" + CVisualZone::CVisualZone () { } diff --git a/src/xrGame/ZudaArtifact.cpp b/src/xrGame/ZudaArtifact.cpp index 70bcc089d3f..e744faabceb 100644 --- a/src/xrGame/ZudaArtifact.cpp +++ b/src/xrGame/ZudaArtifact.cpp @@ -5,7 +5,7 @@ #include "stdafx.h" #include "ZudaArtifact.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CZudaArtefact::CZudaArtefact(void) diff --git a/src/xrGame/account_manager_console.h b/src/xrGame/account_manager_console.h index 44b379407ef..99ff6d4250d 100644 --- a/src/xrGame/account_manager_console.h +++ b/src/xrGame/account_manager_console.h @@ -1,8 +1,8 @@ #ifndef ACCOUNT_MANAGER_CONSOLE #define ACCOUNT_MANAGER_CONSOLE -#include "../xrEngine/xr_ioconsole.h" -#include "../xrEngine/xr_ioc_cmd.h" +#include "xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioc_cmd.h" class CCC_CreateGameSpyAccount : public IConsole_Command { diff --git a/src/xrGame/action_base_inline.h b/src/xrGame/action_base_inline.h index a7d26d4423c..2d69efc6af9 100644 --- a/src/xrGame/action_base_inline.h +++ b/src/xrGame/action_base_inline.h @@ -8,7 +8,7 @@ #pragma once -#include "level.h" +#include "Level.h" #define TEMPLATE_SPECIALIZATION template #define CBaseAction CActionBase<_object_type> diff --git a/src/xrGame/actor_anim_defs.h b/src/xrGame/actor_anim_defs.h index 604fff55c01..7901653f71e 100644 --- a/src/xrGame/actor_anim_defs.h +++ b/src/xrGame/actor_anim_defs.h @@ -1,6 +1,6 @@ #pragma once -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" struct SAnimState { diff --git a/src/xrGame/actor_communication.cpp b/src/xrGame/actor_communication.cpp index f64dc0c8598..56d2d1570b3 100644 --- a/src/xrGame/actor_communication.cpp +++ b/src/xrGame/actor_communication.cpp @@ -2,7 +2,7 @@ #include "actor.h" #include "UIGameSP.h" #include "PDA.h" -#include "level.h" +#include "Level.h" #include "string_table.h" #include "PhraseDialog.h" #include "character_info.h" diff --git a/src/xrGame/actor_input_handler.cpp b/src/xrGame/actor_input_handler.cpp index 0818f2c2226..1efe265697e 100644 --- a/src/xrGame/actor_input_handler.cpp +++ b/src/xrGame/actor_input_handler.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "actor_input_handler.h" #include "actor.h" -#include "level.h" +#include "Level.h" void CActorInputHandler::reinit() { diff --git a/src/xrGame/actor_memory.cpp b/src/xrGame/actor_memory.cpp index 2a6e84e0437..0b4ed9aae92 100644 --- a/src/xrGame/actor_memory.cpp +++ b/src/xrGame/actor_memory.cpp @@ -9,7 +9,7 @@ #include "stdafx.h" #include "actor_memory.h" #include "actor.h" -#include "../xrEngine/camerabase.h" +#include "xrEngine/camerabase.h" #include "gamepersistent.h" CActorMemory::CActorMemory (CActor *actor) : diff --git a/src/xrGame/actor_mp_client.cpp b/src/xrGame/actor_mp_client.cpp index f73e5915a91..acef0542f69 100644 --- a/src/xrGame/actor_mp_client.cpp +++ b/src/xrGame/actor_mp_client.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "actor_mp_client.h" #include "actorcondition.h" -#include "../xrEngine/CameraBase.h" -#include "../xrEngine/CameraManager.h" +#include "xrEngine/CameraBase.h" +#include "xrEngine/CameraManager.h" #include "game_cl_base.h" #include "ui/UIActorMenu.h" diff --git a/src/xrGame/actor_mp_client_export.cpp b/src/xrGame/actor_mp_client_export.cpp index cfb94fe3ca0..416cf69fca7 100644 --- a/src/xrGame/actor_mp_client_export.cpp +++ b/src/xrGame/actor_mp_client_export.cpp @@ -2,7 +2,7 @@ #include "actor_mp_client.h" #include "CharacterPhysicsSupport.h" #include "inventory.h" -#include "../xrphysics/phvalide.h" +#include "xrPhysics/phvalide.h" //#include "Physics.h" /// DONE (111 bytes cut from 138 bytes = 27 bytes, total 511.11% or 19.56%) diff --git a/src/xrGame/actor_mp_client_import.cpp b/src/xrGame/actor_mp_client_import.cpp index d0e8ed969c0..9d2c33558e0 100644 --- a/src/xrGame/actor_mp_client_import.cpp +++ b/src/xrGame/actor_mp_client_import.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "actor_mp_client.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "GamePersistent.h" #include "game_cl_base.h" -#include "../xrEngine/camerabase.h" +#include "xrEngine/camerabase.h" //#include "Physics.h" -#include "../xrphysics/phvalide.h" +#include "xrPhysics/phvalide.h" void CActorMP::net_Import ( NET_Packet &P) { diff --git a/src/xrGame/actor_mp_server_export.cpp b/src/xrGame/actor_mp_server_export.cpp index c2d953e9441..88cc0212ab1 100644 --- a/src/xrGame/actor_mp_server_export.cpp +++ b/src/xrGame/actor_mp_server_export.cpp @@ -2,7 +2,7 @@ #include "actor_mp_server.h" //#include "Physics.h" //#include "mathutils.h" -#include "../xrphysics/phvalide.h" +#include "xrPhysics/phvalide.h" void CSE_ActorMP::fill_state (actor_mp_state &state) diff --git a/src/xrGame/actor_mp_server_import.cpp b/src/xrGame/actor_mp_server_import.cpp index e1cae0c8081..a9fa163888a 100644 --- a/src/xrGame/actor_mp_server_import.cpp +++ b/src/xrGame/actor_mp_server_import.cpp @@ -2,7 +2,7 @@ #include "actor_mp_server.h" //#include "Physics.h" //#include "mathutils.h" -#include "../xrphysics/phvalide.h" +#include "xrPhysics/phvalide.h" void CSE_ActorMP::UPDATE_Read (NET_Packet &packet) { diff --git a/src/xrGame/ai/ai_monsters_anims.h b/src/xrGame/ai/ai_monsters_anims.h index 3592ac6230f..2bb5d371039 100644 --- a/src/xrGame/ai/ai_monsters_anims.h +++ b/src/xrGame/ai/ai_monsters_anims.h @@ -8,8 +8,8 @@ #pragma once -#include "../../Include/xrRender/KinematicsAnimated.h" -#include "../ai_debug.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "ai_debug.h" DEFINE_VECTOR (MotionID,ANIM_VECTOR, ANIM_IT); diff --git a/src/xrGame/ai/ai_monsters_misc.cpp b/src/xrGame/ai/ai_monsters_misc.cpp index 0e8caaffa7d..e1042d1ffb0 100644 --- a/src/xrGame/ai/ai_monsters_misc.cpp +++ b/src/xrGame/ai/ai_monsters_misc.cpp @@ -8,22 +8,21 @@ #include "pch_script.h" #include "ai_monsters_misc.h" -#include "../ai_space.h" -#include "../custommonster.h" -#include "../ef_storage.h" -#include "../seniority_hierarchy_holder.h" -#include "../team_hierarchy_holder.h" -#include "../squad_hierarchy_holder.h" -#include "../group_hierarchy_holder.h" -//#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "ai_space.h" +#include "custommonster.h" +#include "ef_storage.h" +#include "seniority_hierarchy_holder.h" +#include "team_hierarchy_holder.h" +#include "squad_hierarchy_holder.h" +#include "group_hierarchy_holder.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "ai_monsters_anims.h" -#include "../ef_pattern.h" -#include "../memory_manager.h" -#include "../enemy_manager.h" -#include "../level.h" -#include "../agent_manager.h" -#include "../agent_member_manager.h" +#include "ef_pattern.h" +#include "memory_manager.h" +#include "enemy_manager.h" +#include "Level.h" +#include "agent_manager.h" +#include "agent_member_manager.h" #include "stalker/ai_stalker.h" bool bfGetActionSuccessProbability(GroupHierarchyHolder::MEMBER_REGISTRY &Members, const xr_vector &VisibleEnemies, float fMinProbability, CBaseFunction &fSuccessProbabilityFunction) diff --git a/src/xrGame/ai/crow/ai_crow.cpp b/src/xrGame/ai/crow/ai_crow.cpp index ceb6e26235a..cf017f25a89 100644 --- a/src/xrGame/ai/crow/ai_crow.cpp +++ b/src/xrGame/ai/crow/ai_crow.cpp @@ -7,20 +7,20 @@ //////////////////////////////////////////////////////////////////////////// #include "pch_script.h" -#include "../../../xrphysics/physicsshell.h" -#include "../../../xrphysics/phvalide.h" +#include "xrPhysics/physicsshell.h" +#include "xrPhysics/phvalide.h" #include "ai_crow.h" -#include "../../level.h" -#include "../../../Include/xrRender/RenderVisual.h" -#include "../../../Include/xrRender/Kinematics.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" -#include "../../actor.h" +#include "Level.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Actor.h" #include "script_callback_ex.h" #include "game_object_space.h" #include "script_game_object.h" #include "hit.h" #ifdef DEBUG -//#include "../xrphysics/phvalide.h" +//#include "xrPhysics/phvalide.h" #endif void CAI_Crow::SAnim::Load (IKinematicsAnimated* visual, LPCSTR prefix) diff --git a/src/xrGame/ai/crow/ai_crow.h b/src/xrGame/ai/crow/ai_crow.h index 8dc4ff76083..bd0cd67a1c7 100644 --- a/src/xrGame/ai/crow/ai_crow.h +++ b/src/xrGame/ai/crow/ai_crow.h @@ -6,8 +6,8 @@ #ifndef __XRAY_AI_CROW__ #define __XRAY_AI_CROW__ -#include "../../entity_alive.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" +#include "entity_alive.h" +#include "Include/xrRender/KinematicsAnimated.h" class CMotionDef; class CBlend; diff --git a/src/xrGame/ai/monsters/ai_monster_bones.cpp b/src/xrGame/ai/monsters/ai_monster_bones.cpp index 778d5690ad7..9be32a8e462 100644 --- a/src/xrGame/ai/monsters/ai_monster_bones.cpp +++ b/src/xrGame/ai/monsters/ai_monster_bones.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "ai_monster_bones.h" -#include "../../../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "xrCore/Animation/Bone.hpp" diff --git a/src/xrGame/ai/monsters/ai_monster_defs.h b/src/xrGame/ai/monsters/ai_monster_defs.h index acf027d268f..70d003957aa 100644 --- a/src/xrGame/ai/monsters/ai_monster_defs.h +++ b/src/xrGame/ai/monsters/ai_monster_defs.h @@ -1,7 +1,7 @@ #pragma once -#include "../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../xrEngine/cameramanager.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "xrEngine/cameramanager.h" typedef u32 TTime; diff --git a/src/xrGame/ai/monsters/ai_monster_effector.h b/src/xrGame/ai/monsters/ai_monster_effector.h index d51062031ff..637b00d523b 100644 --- a/src/xrGame/ai/monsters/ai_monster_effector.h +++ b/src/xrGame/ai/monsters/ai_monster_effector.h @@ -1,6 +1,6 @@ #pragma once -#include "../../ActorEffector.h" +#include "ActorEffector.h" ////////////////////////////////////////////////////////////////////////// // CMonsterEffector diff --git a/src/xrGame/ai/monsters/ai_monster_squad.cpp b/src/xrGame/ai/monsters/ai_monster_squad.cpp index 53c359c164e..505be63fc3d 100644 --- a/src/xrGame/ai/monsters/ai_monster_squad.cpp +++ b/src/xrGame/ai/monsters/ai_monster_squad.cpp @@ -1,9 +1,8 @@ #include "stdafx.h" #include "ai_monster_squad.h" -#include "../../entity.h" -#include "../../entity_alive.h" -#include "../../memory_manager.h" - +#include "Entity.h" +#include "entity_alive.h" +#include "memory_manager.h" #include "basemonster/base_monster.h" CMonsterSquad::CMonsterSquad() : leader(0), m_home_danger_end_tick(0), m_home_danger_mode_time(8000) diff --git a/src/xrGame/ai/monsters/ai_monster_squad.h b/src/xrGame/ai/monsters/ai_monster_squad.h index f9f61d9058a..03aab606366 100644 --- a/src/xrGame/ai/monsters/ai_monster_squad.h +++ b/src/xrGame/ai/monsters/ai_monster_squad.h @@ -1,7 +1,7 @@ #pragma once // Lain: -#include "../../steering_behaviour.h" +#include "steering_behaviour.h" class CEntity; class CEntityAlive; diff --git a/src/xrGame/ai/monsters/ai_monster_squad_attack.cpp b/src/xrGame/ai/monsters/ai_monster_squad_attack.cpp index 3187eaf01ed..06903866561 100644 --- a/src/xrGame/ai/monsters/ai_monster_squad_attack.cpp +++ b/src/xrGame/ai/monsters/ai_monster_squad_attack.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "ai_monster_squad.h" -#include "../../entity.h" -#include "../../entity_alive.h" -#include "../monsters/basemonster/base_monster.h " +#include "Entity.h" +#include "entity_alive.h" +#include "BaseMonster/base_monster.h" #include "monster_home.h" void CMonsterSquad::ProcessAttack() diff --git a/src/xrGame/ai/monsters/ai_monster_squad_manager.cpp b/src/xrGame/ai/monsters/ai_monster_squad_manager.cpp index 6580cb23a66..37668199f2d 100644 --- a/src/xrGame/ai/monsters/ai_monster_squad_manager.cpp +++ b/src/xrGame/ai/monsters/ai_monster_squad_manager.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "ai_monster_squad_manager.h" #include "ai_monster_squad.h" -#include "../../entity.h" +#include "Entity.h" ////////////////////////////////////////////////////////////////////////// // SQUAD MANAGER Implementation diff --git a/src/xrGame/ai/monsters/ai_monster_squad_rest.cpp b/src/xrGame/ai/monsters/ai_monster_squad_rest.cpp index 8b49057e033..610cbbff11d 100644 --- a/src/xrGame/ai/monsters/ai_monster_squad_rest.cpp +++ b/src/xrGame/ai/monsters/ai_monster_squad_rest.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "ai_monster_squad.h" -#include "../../entity.h" -#include "../../ai_object_location.h" +#include "Entity.h" +#include "ai_object_location.h" void CMonsterSquad::ProcessIdle() { diff --git a/src/xrGame/ai/monsters/ai_monster_utils.cpp b/src/xrGame/ai/monsters/ai_monster_utils.cpp index d306de22ddc..e6aad6f1c43 100644 --- a/src/xrGame/ai/monsters/ai_monster_utils.cpp +++ b/src/xrGame/ai/monsters/ai_monster_utils.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "ai_monster_utils.h" -#include "../../entity.h" -#include "../../ai_object_location.h" -#include "../../ai_space.h" -#include "../../level_graph.h" -#include "../../../Include/xrRender/Kinematics.h" +#include "Entity.h" +#include "ai_object_location.h" +#include "ai_space.h" +#include "level_graph.h" +#include "Include/xrRender/Kinematics.h" #include "basemonster/base_monster.h" // ïðîâåðèòü, íàõîäèòñÿ ëè îáúåêò entity íà íîäå // âîçâðàùàåò ïîçèöèþ îáúåêòà, åñëè îí íàõîäèòñÿ íà íîäå, èëè öåíòð åãî íîäû diff --git a/src/xrGame/ai/monsters/anim_triple.h b/src/xrGame/ai/monsters/anim_triple.h index 2c1c18b3826..9211b6b1e7b 100644 --- a/src/xrGame/ai/monsters/anim_triple.h +++ b/src/xrGame/ai/monsters/anim_triple.h @@ -1,7 +1,7 @@ #pragma once #include "control_combase.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" enum EStateAnimTriple { eStatePrepare, diff --git a/src/xrGame/ai/monsters/anomaly_detector.cpp b/src/xrGame/ai/monsters/anomaly_detector.cpp index e5c43910607..3e20e4fc6dd 100644 --- a/src/xrGame/ai/monsters/anomaly_detector.cpp +++ b/src/xrGame/ai/monsters/anomaly_detector.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "anomaly_detector.h" #include "BaseMonster/base_monster.h" -#include "../../restricted_object.h" -#include "../../customzone.h" -#include "../../level.h" -#include "../../space_restriction_manager.h" +#include "restricted_object.h" +#include "CustomZone.h" +#include "Level.h" +#include "space_restriction_manager.h" CAnomalyDetector::CAnomalyDetector(CBaseMonster *monster) : m_object(monster) { diff --git a/src/xrGame/ai/monsters/anti_aim_ability.cpp b/src/xrGame/ai/monsters/anti_aim_ability.cpp index 17fa72e36d0..78513106e44 100644 --- a/src/xrGame/ai/monsters/anti_aim_ability.cpp +++ b/src/xrGame/ai/monsters/anti_aim_ability.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "anti_aim_ability.h" #include "basemonster/base_monster.h" -#include "../../Actor.h" -#include "../../ActorEffector.h" -#include "../../../xrCore/_vector3d_ext.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "xrCore/_vector3d_ext.h" #include "control_animation_base.h" -#include "../../Inventory.h" -#include "../../Weapon.h" +#include "Inventory.h" +#include "Weapon.h" namespace detail { @@ -256,8 +256,8 @@ float anti_aim_ability::calculate_angle () const return _max (0.f, deviation - max_deviation); } -#include "../../level_debug.h" -#include "../../debug_text_tree.h" +#include "level_debug.h" +#include "debug_text_tree.h" extern CActor* g_actor; diff --git a/src/xrGame/ai/monsters/basemonster/base_monster.cpp b/src/xrGame/ai/monsters/basemonster/base_monster.cpp index bc25e8d57cb..fe5e712a37b 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster.cpp @@ -1,52 +1,51 @@ #include "stdafx.h" #include "base_monster.h" -#include "../../../../xrphysics/PhysicsShell.h" -#include "../../../hit.h" -#include "../../../PHDestroyable.h" -#include "../../../CharacterPhysicsSupport.h" -#include "../../../game_level_cross_table.h" -#include "../../../game_graph.h" -#include "../../../phmovementcontrol.h" -#include "../ai_monster_squad_manager.h" -#include "../../../../xrServerEntities/xrserver_objects_alife_monsters.h" -#include "../corpse_cover.h" -#include "../../../cover_evaluators.h" -#include "../../../seniority_hierarchy_holder.h" -#include "../../../team_hierarchy_holder.h" -#include "../../../squad_hierarchy_holder.h" -#include "../../../group_hierarchy_holder.h" -#include "../../../phdestroyable.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../detail_path_manager.h" -#include "../../../memory_manager.h" -#include "../../../visual_memory_manager.h" -#include "../monster_velocity_space.h" -#include "../../../entitycondition.h" -#include "../../../sound_player.h" -#include "../../../level.h" -#include "../state_manager.h" -#include "../controlled_entity.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" -#include "../anomaly_detector.h" -#include "../monster_cover_manager.h" -#include "../monster_home.h" -#include "../../../inventory.h" -#include "../../../xrserver.h" -#include "../ai_monster_squad.h" -#include "../../../actor.h" -#include "../../../ai_object_location.h" -#include "../../../ai_space.h" -#include "../../../../xrServerEntities/script_engine.h" - -#include "../anti_aim_ability.h" +#include "xrPhysics/PhysicsShell.h" +#include "hit.h" +#include "PHDestroyable.h" +#include "CharacterPhysicsSupport.h" +#include "game_level_cross_table.h" +#include "game_graph.h" +#include "level_graph.h" +#include "PHMovementControl.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "xrServerEntities/xrserver_objects_alife_monsters.h" +#include "ai/Monsters/corpse_cover.h" +#include "cover_evaluators.h" +#include "seniority_hierarchy_holder.h" +#include "team_hierarchy_holder.h" +#include "squad_hierarchy_holder.h" +#include "group_hierarchy_holder.h" +#include "PHDestroyable.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" +#include "memory_manager.h" +#include "visual_memory_manager.h" +#include "ai/Monsters/monster_velocity_space.h" +#include "EntityCondition.h" +#include "sound_player.h" +#include "Level.h" +#include "ai/Monsters/state_manager.h" +#include "ai/Monsters/controlled_entity.h" +#include "ai/Monsters/control_animation_base.h" +#include "ai/Monsters/control_direction_base.h" +#include "ai/Monsters/control_movement_base.h" +#include "ai/Monsters/control_path_builder_base.h" +#include "ai/Monsters/anomaly_detector.h" +#include "ai/Monsters/monster_cover_manager.h" +#include "ai/Monsters/monster_home.h" +#include "Inventory.h" +#include "xrServer.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "Actor.h" +#include "ai_object_location.h" +#include "ai_space.h" +#include "xrServerEntities/script_engine.h" +#include "ai/Monsters/anti_aim_ability.h" // Lain: added -#include "../../../level_debug.h" -#include "../../../../xrEngine/xrLevel.h" -#include "../../../level_graph.h" +#include "level_debug.h" +#include "xrEngine/xrLevel.h" #ifdef DEBUG #include "debug_text_tree.h" #endif diff --git a/src/xrGame/ai/monsters/basemonster/base_monster.h b/src/xrGame/ai/monsters/basemonster/base_monster.h index b5fb5fbdc6b..e8087386aa7 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster.h +++ b/src/xrGame/ai/monsters/basemonster/base_monster.h @@ -1,30 +1,23 @@ #pragma once -#include "../../../CustomMonster.h" - -#include "../monster_enemy_memory.h" -#include "../monster_corpse_memory.h" -#include "../monster_sound_memory.h" -#include "../monster_hit_memory.h" - -#include "../monster_enemy_manager.h" -#include "../monster_corpse_manager.h" - -#include "../../../step_manager.h" -#include "../monster_event_manager.h" -#include "../melee_checker.h" -#include "../monster_morale.h" - -#include "../control_manager.h" -#include "../control_sequencer.h" - -#include "../ai_monster_utils.h" - -#include "../control_manager_custom.h" -#include "../ai_monster_shared_data.h" -#include "../monster_sound_defs.h" - -#include "../monster_aura.h" +#include "CustomMonster.h" +#include "ai/Monsters/monster_enemy_memory.h" +#include "ai/Monsters/monster_corpse_memory.h" +#include "ai/Monsters/monster_sound_memory.h" +#include "ai/Monsters/monster_hit_memory.h" +#include "ai/Monsters/monster_enemy_manager.h" +#include "ai/Monsters/monster_corpse_manager.h" +#include "step_manager.h" +#include "ai/Monsters/monster_event_manager.h" +#include "ai/Monsters/melee_checker.h" +#include "ai/Monsters/monster_morale.h" +#include "ai/Monsters/control_manager.h" +#include "ai/Monsters/control_sequencer.h" +#include "ai/Monsters/ai_monster_utils.h" +#include "ai/Monsters/control_manager_custom.h" +#include "ai/Monsters/ai_monster_shared_data.h" +#include "ai/Monsters/monster_sound_defs.h" +#include "ai/Monsters/monster_aura.h" class CCharacterPhysicsSupport; class CMonsterCorpseCoverEvaluator; @@ -628,7 +621,7 @@ IC void wake_up (){m_bSleep = false;} // CBaseMonster's debug template functions //------------------------------------------------------------------- -#include "../../../ai_debug_variables.h" +#include "ai_debug_variables.h" #ifdef DEBUG template diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_anim.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_anim.cpp index 1fcffc9b5eb..d0936952a53 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_anim.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_anim.cpp @@ -8,10 +8,10 @@ #include "stdafx.h" #include "base_monster.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../sound_player.h" -#include "../../../ai_monster_space.h" -#include "../control_animation_base.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "sound_player.h" +#include "ai_monster_space.h" +#include "ai/Monsters/control_animation_base.h" // Óñòàíîâêà àíèìàöèè void CBaseMonster::SelectAnimation(const Fvector &/**_view/**/, const Fvector &/**_move/**/, float /**speed/**/) diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_debug.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_debug.cpp index bd6d38c4981..01dbda2f965 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_debug.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_debug.cpp @@ -1,36 +1,35 @@ #include "pch_script.h" #include "base_monster.h" -#include "../../../level.h" -#include "../../../level_debug.h" -#include "../../../entitycondition.h" -#include "../../../ai_debug.h" -#include "../state_defs.h" -#include "../state_manager.h" -#include "../../../phmovementcontrol.h" -#include "../../../characterphysicssupport.h" -#include "../../../actor.h" - +#include "Level.h" +#include "level_debug.h" +#include "EntityCondition.h" +#include "ai_debug.h" +#include "ai/Monsters/state_defs.h" +#include "ai/Monsters/state_manager.h" +#include "PHMovementControl.h" +#include "CharacterPhysicsSupport.h" +#include "Actor.h" // Lain: added -#include "../../../debug_text_tree.h" -#include "../../../memory_manager.h" -#include "../../../visual_memory_manager.h" -#include "../../../sound_memory_manager.h" -#include "../../../hit_memory_manager.h" -#include "../../../actor_memory.h" -#include "../../../inventory.h" -#include "../../../weapon.h" -#include "../../../ai_object_location.h" -#include "../../../movement_manager_space.h" -#include "../control_animation_base.h" -#include "../monster_state_manager.h" -#include "../../../sound_player.h" -#include "../../../game_path_manager.h" -#include "../../../detail_path_manager.h" -#include "../../../patrol_path_manager.h" -#include "../../../script_entity_action.h" -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" -#include "../monster_home.h" +#include "debug_text_tree.h" +#include "memory_manager.h" +#include "visual_memory_manager.h" +#include "sound_memory_manager.h" +#include "hit_memory_manager.h" +#include "actor_memory.h" +#include "inventory.h" +#include "weapon.h" +#include "ai_object_location.h" +#include "movement_manager_space.h" +#include "ai/Monsters/control_animation_base.h" +#include "ai/Monsters/monster_state_manager.h" +#include "sound_player.h" +#include "game_path_manager.h" +#include "detail_path_manager.h" +#include "patrol_path_manager.h" +#include "script_entity_action.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "ai/Monsters/monster_home.h" #ifdef DEBUG CBaseMonster::SDebugInfo CBaseMonster::show_debug_info() diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp index d35eb50796e..b3569993e52 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_feel.cpp @@ -8,23 +8,23 @@ #include "pch_script.h" #include "base_monster.h" -#include "../../../actor.h" -#include "../../../ActorEffector.h" -#include "../ai_monster_effector.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../sound_player.h" -#include "../../../level.h" -#include "../../../script_callback_ex.h" -#include "../../../script_game_object.h" -#include "../../../game_object_space.h" -#include "../../../ai_monster_space.h" -#include "../control_animation_base.h" -#include "../../../UIGameCustom.h" -#include "../../../UI/UIStatic.h" -#include "../../../ai_object_location.h" -#include "../../../profiler.h" -#include "../../../ActorEffector.h" -#include "../../../../xrEngine/CameraBase.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "ai/Monsters/ai_monster_effector.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "sound_player.h" +#include "Level.h" +#include "script_callback_ex.h" +#include "script_game_object.h" +#include "game_object_space.h" +#include "ai_monster_space.h" +#include "ai/Monsters/control_animation_base.h" +#include "UIGameCustom.h" +#include "UI/UIStatic.h" +#include "ai_object_location.h" +#include "profiler.h" +#include "ActorEffector.h" +#include "xrEngine/CameraBase.h" void CBaseMonster::feel_sound_new(CObject* who, int eType, CSound_UserDataPtr user_data, const Fvector &Position, float power) { diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_misc.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_misc.cpp index 962adac31a2..563c144b0e1 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_misc.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_misc.cpp @@ -8,7 +8,7 @@ #include "stdafx.h" #include "base_monster.h" -#include "../../../entitycondition.h" +#include "EntityCondition.h" //////////////////////////////////////////////////////////////////////////////////////////////////////// // Âõîäíûå âîçäåéñòâèÿ diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_net.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_net.cpp index a4f4c8d4263..6dbf1498776 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_net.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_net.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "base_monster.h" +#include "ai_object_location.h" +#include "game_graph.h" +#include "ai_space.h" +#include "hit.h" +#include "PHDestroyable.h" +#include "CharacterPhysicsSupport.h" -#include "../../../ai_object_location.h" -#include "../../../game_graph.h" -#include "../../../ai_space.h" -#include "../../../hit.h" -#include "../../../PHDestroyable.h" -#include "../../../CharacterPhysicsSupport.h" void CBaseMonster::net_Save (NET_Packet& P) { inherited::net_Save(P); diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_path.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_path.cpp index ecc2d364fe1..105a4c61f2e 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_path.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_path.cpp @@ -8,11 +8,11 @@ #include "stdafx.h" #include "base_monster.h" -#include "../corpse_cover.h" -#include "../../../cover_manager.h" -#include "../../../cover_point.h" -#include "../../../ai_space.h" -#include "../control_direction_base.h" +#include "ai/Monsters/corpse_cover.h" +#include "cover_manager.h" +#include "cover_point.h" +#include "ai_space.h" +#include "ai/Monsters/control_direction_base.h" // êàæäûé ìîíñòð ìîæåò ïî-ðàçíîìó ðåàëèçâàòü ýòó ôóíê (e.g. êðîâîñîñ ñ ïîâîðîòîì ãîëîâû è ò.ï.) void CBaseMonster::LookPosition(Fvector to_point, float angular_speed) diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_script.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_script.cpp index 85814f2d97a..7ae7872aafc 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_script.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_script.cpp @@ -1,33 +1,27 @@ #include "pch_script.h" #include "base_monster.h" -#include "../../../script_entity_action.h" -#include "../../../phmovementcontrol.h" -#include "../../../sight_manager.h" -#include "../../../detail_path_manager.h" -#include "../../../ai_object_location.h" -#include "../../../sound_player.h" -#include "../../../ai_monster_space.h" -#include "../state_manager.h" - -#include "../../../ai_debug.h" -#include "../../../level.h" -#include "../../../level_debug.h" - -#include "../control_animation_base.h" -#include "../control_path_builder_base.h" - -#include "../../../patrol_path_manager.h" -#include "../../../patrol_path_manager_space.h" - -// #include "ai/monsters/ai_monster_squad.h" -// #include "ai/monsters/ai_monster_squad_manager.h" -#include "../../../level_graph.h" -#include "../../../game_path_manager.h" -#include "../../../alife_simulator.h" -#include "../../../alife_group_registry.h" -#include "../../../alife_object_registry.h" -#include "../../../../xrCore/_vector3d_ext.h" -#include "../../../../xrServerEntities/xrServer_Objects_Alife_Monsters.h" +#include "script_entity_action.h" +#include "phmovementcontrol.h" +#include "sight_manager.h" +#include "detail_path_manager.h" +#include "ai_object_location.h" +#include "sound_player.h" +#include "ai_monster_space.h" +#include "ai/Monsters/state_manager.h" +#include "ai_debug.h" +#include "Level.h" +#include "level_debug.h" +#include "ai/Monsters/control_animation_base.h" +#include "ai/Monsters/control_path_builder_base.h" +#include "patrol_path_manager.h" +#include "patrol_path_manager_space.h" +#include "level_graph.h" +#include "game_path_manager.h" +#include "alife_simulator.h" +#include "alife_group_registry.h" +#include "alife_object_registry.h" +#include "xrCore/_vector3d_ext.h" +#include "xrServerEntities/xrServer_Objects_Alife_Monsters.h" using namespace MonsterSpace; using namespace MonsterSound; diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_startup.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_startup.cpp index 9d8eeccf2ed..ef30a4f4c19 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_startup.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_startup.cpp @@ -1,37 +1,36 @@ #include "stdafx.h" #include "base_monster.h" -#include "../../../ai_space.h" -#include "../../../hit.h" -#include "../../../PHDestroyable.h" -#include "../../../CharacterPhysicsSupport.h" -#include "../../../phmovementcontrol.h" -#include "../ai_monster_squad_manager.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../detail_path_manager.h" -#include "../../../level_graph.h" -#include "../corpse_cover.h" -#include "../../../cover_evaluators.h" -#include "../../../sound_player.h" - -#include "../state_manager.h" -#include "../controlled_entity.h" -#include "../anomaly_detector.h" -#include "../monster_cover_manager.h" -#include "../monster_home.h" -#include "../../../ai_object_location.h" -#include "../../../level.h" -#include "../../../../xrServerEntities/xrserver_objects_alife_monsters.h" -#include "../../../alife_simulator.h" -#include "../../../alife_object_registry.h" -#include "../../../xrServer.h" -#include "../../../inventory_item.h" -#include "../../../../xrServerEntities/xrServer_objects_ALife.h" -#include "../../../phMovementControl.h" -#include "../ai_monster_squad.h" -#include "../control_movement_base.h" -#include "../control_animation_base.h" -#include "../monster_velocity_space.h" -#include "../anti_aim_ability.h" +#include "ai_space.h" +#include "hit.h" +#include "PHDestroyable.h" +#include "CharacterPhysicsSupport.h" +#include "PHMovementControl.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" +#include "level_graph.h" +#include "ai/Monsters/corpse_cover.h" +#include "cover_evaluators.h" +#include "sound_player.h" +#include "ai/Monsters/state_manager.h" +#include "ai/Monsters/controlled_entity.h" +#include "ai/Monsters/anomaly_detector.h" +#include "ai/Monsters/monster_cover_manager.h" +#include "ai/Monsters/monster_home.h" +#include "ai_object_location.h" +#include "Level.h" +#include "xrServerEntities/xrserver_objects_alife_monsters.h" +#include "alife_simulator.h" +#include "alife_object_registry.h" +#include "xrServer.h" +#include "inventory_item.h" +#include "xrServerEntities/xrServer_objects_ALife.h" +#include "phMovementControl.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/control_movement_base.h" +#include "ai/Monsters/control_animation_base.h" +#include "ai/Monsters/monster_velocity_space.h" +#include "ai/Monsters/anti_aim_ability.h" namespace detail { diff --git a/src/xrGame/ai/monsters/basemonster/base_monster_think.cpp b/src/xrGame/ai/monsters/basemonster/base_monster_think.cpp index 88689866f35..42200b69869 100644 --- a/src/xrGame/ai/monsters/basemonster/base_monster_think.cpp +++ b/src/xrGame/ai/monsters/basemonster/base_monster_think.cpp @@ -1,14 +1,14 @@ #include "stdafx.h" #include "base_monster.h" -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" -#include "../../../profiler.h" -#include "../state_manager.h" -#include "../../../../xrphysics/PhysicsShell.h" -#include "../../../detail_path_manager.h" -#include "../monster_velocity_space.h" -#include "../../../level.h" -#include "../control_animation_base.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "profiler.h" +#include "ai/Monsters/state_manager.h" +#include "xrPhysics/PhysicsShell.h" +#include "detail_path_manager.h" +#include "ai/Monsters/monster_velocity_space.h" +#include "Level.h" +#include "ai/Monsters/control_animation_base.h" void CBaseMonster::Think() { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp b/src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp index 1726e53f72d..fb391597f22 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp @@ -1,35 +1,30 @@ #include "stdafx.h" #include "bloodsucker.h" #include "bloodsucker_state_manager.h" -#include "../../../actor.h" -#include "../../../ActorEffector.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../level.h" -#include "../../../material_manager.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Level.h" +#include "material_manager.h" #include "bloodsucker_vampire_effector.h" -#include "../../../detail_path_manager.h" -#include "../../../level_debug.h" -#include "../monster_velocity_space.h" -#include "../../../gamepersistent.h" -#include "../../../game_object_space.h" - -#include "../control_animation_base.h" -#include "../control_movement_base.h" -#include "../control_rotation_jump.h" - -#include "../../../sound_player.h" -#include "../../../../xrEngine/camerabase.h" -#include "../../../xr_level_controller.h" -#include "../../../ActorCondition.h" - -#include "../../../PHDestroyable.h" -#include "../../../CharacterPhysicsSupport.h" - +#include "detail_path_manager.h" +#include "level_debug.h" +#include "ai/monsters/monster_velocity_space.h" +#include "GamePersistent.h" +#include "game_object_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/Monsters/control_rotation_jump.h" +#include "sound_player.h" +#include "xrEngine/camerabase.h" +#include "xr_level_controller.h" +#include "ActorCondition.h" +#include "PHDestroyable.h" +#include "CharacterPhysicsSupport.h" #ifdef DEBUG -# include +#include #endif // DEBUG - namespace detail { namespace bloodsucker diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker.h index 1cfa74d8661..905ab10eafb 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker.h @@ -1,14 +1,12 @@ #pragma once - -#include "../BaseMonster/base_monster.h" -#include "../ai_monster_bones.h" -#include "../controlled_entity.h" -#include "../controlled_actor.h" -#include "../anim_triple.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/ai_monster_bones.h" +#include "ai/Monsters/controlled_entity.h" +#include "ai/Monsters/controlled_actor.h" +#include "ai/Monsters/anim_triple.h" +#include "xrServerEntities/script_export_space.h" #include "bloodsucker_alien.h" - class CAI_Bloodsucker : public CBaseMonster, public CControlledActor { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_alien.cpp b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_alien.cpp index 171817a0d9d..64b64a10675 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_alien.cpp +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_alien.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "bloodsucker_alien.h" #include "bloodsucker.h" -#include "../../../level.h" -#include "../../../Actor.h" -#include "../../../ActorEffector.h" -#include "../../../inventory.h" -#include "../../../HudItem.h" -#include "../../../../xrEngine/CustomHUD.h" +#include "Level.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "Inventory.h" +#include "HudItem.h" +#include "xrEngine/CustomHUD.h" #define EFFECTOR_ID_GEN(type) (type( u32(u64(this) & u32(-1)) )) diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state.h index 8b3d5e96f72..e6795d75fb6 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state.h @@ -1,5 +1,5 @@ #pragma once -#include "../states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_attack.h" template class CBloodsuckerStateAttack : public CStateMonsterAttack<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_hide.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_hide.h index 0ae61a29522..85fff498412 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_hide.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_hide.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CBloodsuckerStateAttackHide : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_hide_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_hide_inline.h index ec5e57b6183..24c2b3fee30 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_hide_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_hide_inline.h @@ -2,16 +2,16 @@ #pragma once -#include "../states/state_move_to_point.h" +#include "ai/Monsters/states/state_move_to_point.h" #include "bloodsucker_predator_lite.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" -#include "../monster_home.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" +#include "ai/Monsters/monster_home.h" -#include "../../../actor.h" -#include "../../../actor_memory.h" -#include "../../../visual_memory_manager.h" +#include "Actor.h" +#include "actor_memory.h" +#include "visual_memory_manager.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_inline.h index 19e45c86592..ab1801364b6 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_attack_state_inline.h @@ -1,7 +1,7 @@ #pragma once //#include "bloodsucker_attack_state_hide.h" -#include "../states/state_move_to_point.h" +#include "ai/Monsters/states/state_move_to_point.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator.h index 1a904109670..43f2b359c7a 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBloodsuckerPredator : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_inline.h index 3913fa1879a..49801b82914 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_inline.h @@ -1,15 +1,15 @@ #pragma once -#include "../states/state_move_to_point.h" -#include "../states/state_look_point.h" -#include "../states/state_custom_action.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" -#include "../monster_home.h" - -#include "../../../actor.h" -#include "../../../actor_memory.h" -#include "../../../visual_memory_manager.h" +#include "ai/Monsters/states/state_move_to_point.h" +#include "ai/Monsters/states/state_look_point.h" +#include "ai/Monsters/states/state_custom_action.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" +#include "ai/Monsters/monster_home.h" + +#include "Actor.h" +#include "actor_memory.h" +#include "visual_memory_manager.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_lite.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_lite.h index 77c9486878d..22c4bd3eb21 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_lite.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_lite.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBloodsuckerPredatorLite : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_lite_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_lite_inline.h index 00d67541c16..1073fd6ec60 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_lite_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_predator_lite_inline.h @@ -1,15 +1,15 @@ #pragma once -#include "../states/state_move_to_point.h" -#include "../states/state_look_point.h" -#include "../states/state_custom_action.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" -#include "../monster_home.h" - -#include "../../../actor.h" -#include "../../../actor_memory.h" -#include "../../../visual_memory_manager.h" +#include "ai/Monsters/states/state_move_to_point.h" +#include "ai/Monsters/states/state_look_point.h" +#include "ai/Monsters/states/state_custom_action.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" +#include "ai/Monsters/monster_home.h" + +#include "Actor.h" +#include "actor_memory.h" +#include "visual_memory_manager.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump.h index 933067ce66c..1012a8c5303 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump.h @@ -1,7 +1,7 @@ #pragma once -#include "../state.h" -//#include "../../../entitycondition.h" +#include "ai/Monsters/state.h" +//#include "EntityCondition.h" template class CStateCaptureJumpBloodsucker : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump_inline.h index 42d02a450c2..4f356f18f09 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_capture_jump_inline.h @@ -1,7 +1,7 @@ #pragma once -//#include "../states/monster_state_rest_idle.h" -#include "../states/state_custom_action.h" +//#include "ai/Monsters/states/monster_state_rest_idle.h" +#include "ai/Monsters/states/state_custom_action.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.cpp b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.cpp index f871d20dea0..ea6751a5155 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.cpp +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.cpp @@ -2,18 +2,18 @@ #include "bloodsucker_state_manager.h" #include "bloodsucker.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" - -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" + +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" #include "bloodsucker_vampire.h" #include "bloodsucker_predator.h" diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.h index 91b410cdd6d..41df723f1a0 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CAI_Bloodsucker; diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire.h index 161915958da..57629fe6237 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" -#include "../../../../xrServerEntities/clsid_game.h" +#include "ai/Monsters/state.h" +#include "xrServerEntities/clsid_game.h" template class CStateBloodsuckerVampire : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_approach.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_approach.h index 69d03b0fa5e..201a6e37678 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_approach.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_approach.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBloodsuckerVampireApproach : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_effector.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_effector.h index 1c7588fd153..475b5dfb087 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_effector.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_effector.h @@ -1,8 +1,7 @@ #pragma once - -#include "../../../../xrEngine/effectorPP.h" -#include "../../../CameraEffector.h" -#include "../../../../xrEngine/cameramanager.h" +#include "xrEngine/EffectorPP.h" +#include "CameraEffector.h" +#include "xrEngine/CameraManager.h" class CVampirePPEffector : public CEffectorPP { typedef CEffectorPP inherited; diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute.h index ccc1fe3996d..b16b03e5099 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBloodsuckerVampireExecute : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute_inline.h index 84bb84571d4..532ed4615d3 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_execute_inline.h @@ -1,12 +1,8 @@ #pragma once - -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../actor.h" -#include "../../../../xrEngine/CameraBase.h" - -// #include "../../../../xrEngine/CameraBase.h" -//#include "../../../ActorCondition.h" -#include "../../../HudManager.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Actor.h" +#include "xrEngine/CameraBase.h" +#include "HUDManager.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide.h index c5bf64ffcec..3c06c83ead9 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBloodsuckerVampireHide : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide_inline.h index 3651a7a6af8..8f6049c1451 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_hide_inline.h @@ -1,5 +1,5 @@ #pragma once -#include "../states/state_hide_from_point.h" +#include "ai/Monsters/states/state_hide_from_point.h" #include "bloodsucker_predator.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h index 61be0011d8d..24c0441e58f 100644 --- a/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h +++ b/src/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h @@ -1,7 +1,7 @@ #pragma once #include "bloodsucker_vampire_execute.h" -#include "../states/state_hide_from_point.h" +#include "ai/Monsters/states/state_hide_from_point.h" #include "bloodsucker_vampire_approach.h" #include "bloodsucker_vampire_hide.h" diff --git a/src/xrGame/ai/monsters/boar/boar.cpp b/src/xrGame/ai/monsters/boar/boar.cpp index 628dccee7ad..fc56453413a 100644 --- a/src/xrGame/ai/monsters/boar/boar.cpp +++ b/src/xrGame/ai/monsters/boar/boar.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" #include "boar.h" #include "boar_state_manager.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../monster_velocity_space.h" -#include "../../../game_object_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "ai/monsters/monster_velocity_space.h" +#include "game_object_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" CAI_Boar::CAI_Boar() diff --git a/src/xrGame/ai/monsters/boar/boar.h b/src/xrGame/ai/monsters/boar/boar.h index 3279e75fc2d..e23d18b530e 100644 --- a/src/xrGame/ai/monsters/boar/boar.h +++ b/src/xrGame/ai/monsters/boar/boar.h @@ -1,8 +1,8 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../controlled_entity.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/controlled_entity.h" +#include "xrServerEntities/script_export_space.h" class CAI_Boar : public CBaseMonster, public CControlledEntity { diff --git a/src/xrGame/ai/monsters/boar/boar_state_manager.cpp b/src/xrGame/ai/monsters/boar/boar_state_manager.cpp index dafbe56f3be..260fcfdd6d3 100644 --- a/src/xrGame/ai/monsters/boar/boar_state_manager.cpp +++ b/src/xrGame/ai/monsters/boar/boar_state_manager.cpp @@ -2,20 +2,20 @@ #include "boar.h" #include "boar_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../states/monster_state_controlled.h" -#include "../states/monster_state_help_sound.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "ai/Monsters/states/monster_state_controlled.h" +#include "ai/Monsters/states/monster_state_help_sound.h" CStateManagerBoar::CStateManagerBoar(CAI_Boar *monster) : inherited(monster) { diff --git a/src/xrGame/ai/monsters/boar/boar_state_manager.h b/src/xrGame/ai/monsters/boar/boar_state_manager.h index ade2a2438c8..1c8d68b1a36 100644 --- a/src/xrGame/ai/monsters/boar/boar_state_manager.h +++ b/src/xrGame/ai/monsters/boar/boar_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CAI_Boar; diff --git a/src/xrGame/ai/monsters/burer/burer.cpp b/src/xrGame/ai/monsters/burer/burer.cpp index 16cbbbf0ce1..c91b698305b 100644 --- a/src/xrGame/ai/monsters/burer/burer.cpp +++ b/src/xrGame/ai/monsters/burer/burer.cpp @@ -1,29 +1,26 @@ #include "stdafx.h" #include "burer.h" -#include "../../../../xrphysics/PhysicsShell.h" -#include "../../../characterphysicssupport.h" -#include "../../../actor.h" +#include "xrPhysics/PhysicsShell.h" +#include "CharacterPhysicsSupport.h" +#include "Actor.h" #include "burer_state_manager.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../sound_player.h" -#include "../../../level.h" -#include "../../../ai_monster_space.h" -#include "../../../level_debug.h" -#include "../monster_velocity_space.h" -#include "../../../GamePersistent.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "sound_player.h" +#include "Level.h" +#include "ai_monster_space.h" +#include "level_debug.h" +#include "ai/monsters/monster_velocity_space.h" +#include "GamePersistent.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" #include "burer_fast_gravi.h" -#include "../anti_aim_ability.h" -#include "../anti_aim_ability.h" - -#include "../../../Inventory.h" -#include "../../../ActorCondition.h" -#include "../../../xr_level_controller.h" -#include "../../../weapon.h" - -#include "../../../../xrCore/_vector3d_ext.h" -#include "../control_direction_base.h" +#include "ai/monsters/anti_aim_ability.h" +#include "Inventory.h" +#include "ActorCondition.h" +#include "xr_level_controller.h" +#include "weapon.h" +#include "xrCore/_vector3d_ext.h" +#include "ai/monsters/control_direction_base.h" bool CBurer::can_scan = true; diff --git a/src/xrGame/ai/monsters/burer/burer.h b/src/xrGame/ai/monsters/burer/burer.h index 5acf213dd78..507197e7b49 100644 --- a/src/xrGame/ai/monsters/burer/burer.h +++ b/src/xrGame/ai/monsters/burer/burer.h @@ -1,9 +1,9 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../telekinesis.h" -#include "../anim_triple.h" -#include "../scanning_ability.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/telekinesis.h" +#include "ai/Monsters/anim_triple.h" +#include "ai/Monsters/scanning_ability.h" +#include "xrServerEntities/script_export_space.h" class CCharacterPhysicsSupport; class CBurerFastGravi; diff --git a/src/xrGame/ai/monsters/burer/burer_fast_gravi.cpp b/src/xrGame/ai/monsters/burer/burer_fast_gravi.cpp index 1074cdd3fef..729e360151f 100644 --- a/src/xrGame/ai/monsters/burer/burer_fast_gravi.cpp +++ b/src/xrGame/ai/monsters/burer/burer_fast_gravi.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "burer_fast_gravi.h" #include "burer.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" bool CBurerFastGravi::check_start_conditions() { diff --git a/src/xrGame/ai/monsters/burer/burer_fast_gravi.h b/src/xrGame/ai/monsters/burer/burer_fast_gravi.h index 9ed08785f09..b86d39ba7a7 100644 --- a/src/xrGame/ai/monsters/burer/burer_fast_gravi.h +++ b/src/xrGame/ai/monsters/burer/burer_fast_gravi.h @@ -1,5 +1,5 @@ #pragma once -#include "../control_combase.h" +#include "ai/Monsters/control_combase.h" class CBurerFastGravi : public CControl_ComCustom<> { typedef CControl_ComCustom<> inherited; diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack.h b/src/xrGame/ai/monsters/burer/burer_state_attack.h index 4ae2a40919a..9e2373bc369 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBurerAttack : public CState diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim.h b/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim.h index ed182cab8ee..c52662805e4 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBurerAntiAim : public CState diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim_inline.h b/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim_inline.h index 2c5c99caee6..3e598df4415 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim_inline.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_antiaim_inline.h @@ -1,6 +1,6 @@ #pragma once -#include "../anti_aim_ability.h" +#include "ai/monsters/anti_aim_ability.h" template CStateBurerAntiAim::CStateBurerAntiAim (Object *obj) : inherited(obj) diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_gravi.h b/src/xrGame/ai/monsters/burer/burer_state_attack_gravi.h index 502249726d8..af1bccf079b 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_gravi.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_gravi.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBurerAttackGravi : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_inline.h b/src/xrGame/ai/monsters/burer/burer_state_attack_inline.h index 483ccb6423d..c324f05b083 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_inline.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_inline.h @@ -4,8 +4,8 @@ #include "burer_state_attack_gravi.h" #include "burer_state_attack_shield.h" #include "burer_state_attack_melee.h" -#include "../states/state_look_point.h" -#include "../states/state_move_to_restrictor.h" +#include "ai/Monsters/states/state_look_point.h" +#include "ai/Monsters/states/state_move_to_restrictor.h" #include "burer_state_attack_run_around.h" #include "burer_state_attack_antiaim.h" diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_melee.h b/src/xrGame/ai/monsters/burer/burer_state_attack_melee.h index aecf024fb47..6fd306b58e8 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_melee.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_melee.h @@ -1,7 +1,7 @@ #pragma once -#include "../state.h" -#include "../states/monster_state_attack.h" +#include "ai/Monsters/state.h" +#include "ai/Monsters/states/monster_state_attack.h" template class CStateBurerAttackMelee : public CStateMonsterAttack<_Object> { diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_run_around.h b/src/xrGame/ai/monsters/burer/burer_state_attack_run_around.h index 8cfebb391b2..2a42dcefed2 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_run_around.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_run_around.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBurerAttackRunAround : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_shield.h b/src/xrGame/ai/monsters/burer/burer_state_attack_shield.h index b3cda18d0a8..b4c688add5a 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_shield.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_shield.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateBurerShield : public CState diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_tele.h b/src/xrGame/ai/monsters/burer/burer_state_attack_tele.h index 7c95520d21c..d666ce51bd9 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_tele.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_tele.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" -#include "../../../grenade.h" +#include "ai/Monsters/state.h" +#include "Grenade.h" template diff --git a/src/xrGame/ai/monsters/burer/burer_state_attack_tele_inline.h b/src/xrGame/ai/monsters/burer/burer_state_attack_tele_inline.h index 8153cf44d0e..fee7049ebbb 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_attack_tele_inline.h +++ b/src/xrGame/ai/monsters/burer/burer_state_attack_tele_inline.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../level.h" +#include "Level.h" #define GOOD_DISTANCE_FOR_TELE 15.f #define MAX_TIME_CHECK_FAILURE 6000 diff --git a/src/xrGame/ai/monsters/burer/burer_state_manager.cpp b/src/xrGame/ai/monsters/burer/burer_state_manager.cpp index cee46be72de..50952dd8347 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_manager.cpp +++ b/src/xrGame/ai/monsters/burer/burer_state_manager.cpp @@ -2,18 +2,18 @@ #include "burer.h" #include "burer_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../states/state_custom_action.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "ai/Monsters/states/state_custom_action.h" #include "burer_state_attack.h" diff --git a/src/xrGame/ai/monsters/burer/burer_state_manager.h b/src/xrGame/ai/monsters/burer/burer_state_manager.h index f59433ecc14..d085453a765 100644 --- a/src/xrGame/ai/monsters/burer/burer_state_manager.h +++ b/src/xrGame/ai/monsters/burer/burer_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CBurer; diff --git a/src/xrGame/ai/monsters/cat/cat.cpp b/src/xrGame/ai/monsters/cat/cat.cpp index 5b3bcd6c6ce..808592c67ee 100644 --- a/src/xrGame/ai/monsters/cat/cat.cpp +++ b/src/xrGame/ai/monsters/cat/cat.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "cat.h" #include "cat_state_manager.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../monster_velocity_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "ai/monsters/monster_velocity_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" CCat::CCat() diff --git a/src/xrGame/ai/monsters/cat/cat.h b/src/xrGame/ai/monsters/cat/cat.h index b797464bfc5..e481b0ba65f 100644 --- a/src/xrGame/ai/monsters/cat/cat.h +++ b/src/xrGame/ai/monsters/cat/cat.h @@ -1,6 +1,6 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "xrServerEntities/script_export_space.h" class CCat : public CBaseMonster{ typedef CBaseMonster inherited; diff --git a/src/xrGame/ai/monsters/cat/cat_state_manager.cpp b/src/xrGame/ai/monsters/cat/cat_state_manager.cpp index 0b0057938b9..65bd8c8ac50 100644 --- a/src/xrGame/ai/monsters/cat/cat_state_manager.cpp +++ b/src/xrGame/ai/monsters/cat/cat_state_manager.cpp @@ -2,21 +2,21 @@ #include "cat.h" #include "cat_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../states/state_test_look_actor.h" -#include "../../../entitycondition.h" -#include "../states/monster_state_help_sound.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "ai/Monsters/states/state_test_look_actor.h" +#include "EntityCondition.h" +#include "ai/Monsters/states/monster_state_help_sound.h" CStateManagerCat::CStateManagerCat(CCat *obj) : inherited(obj) { diff --git a/src/xrGame/ai/monsters/cat/cat_state_manager.h b/src/xrGame/ai/monsters/cat/cat_state_manager.h index 8fa8617c4f5..008ffa5f3d4 100644 --- a/src/xrGame/ai/monsters/cat/cat_state_manager.h +++ b/src/xrGame/ai/monsters/cat/cat_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CCat; diff --git a/src/xrGame/ai/monsters/chimera/chimera.cpp b/src/xrGame/ai/monsters/chimera/chimera.cpp index 9c4f1bff063..43ef92bf8e4 100644 --- a/src/xrGame/ai/monsters/chimera/chimera.cpp +++ b/src/xrGame/ai/monsters/chimera/chimera.cpp @@ -1,15 +1,13 @@ #include "stdafx.h" #include "chimera.h" #include "chimera_state_manager.h" -//#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../detail_path_manager.h" -#include "../monster_velocity_space.h" -#include "../../../level.h" -//#include "../../../PhysicsShell.h" -#include "../../../sound_player.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "detail_path_manager.h" +#include "ai/monsters/monster_velocity_space.h" +#include "Level.h" +#include "sound_player.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" CChimera::CChimera () diff --git a/src/xrGame/ai/monsters/chimera/chimera.h b/src/xrGame/ai/monsters/chimera/chimera.h index b5793069c16..18e30c94144 100644 --- a/src/xrGame/ai/monsters/chimera/chimera.h +++ b/src/xrGame/ai/monsters/chimera/chimera.h @@ -1,6 +1,6 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "xrServerEntities/script_export_space.h" class CChimera : public CBaseMonster { diff --git a/src/xrGame/ai/monsters/chimera/chimera_attack_state_inline.h b/src/xrGame/ai/monsters/chimera/chimera_attack_state_inline.h index 837a154346b..a49dec81fde 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_attack_state_inline.h +++ b/src/xrGame/ai/monsters/chimera/chimera_attack_state_inline.h @@ -2,8 +2,7 @@ #define CHIMERA_ATTACK_STATE_INLINE_H_INCLUDED #include "chimera_attack_state.h" - -#include "../../../debug_renderer.h" +#include "debug_renderer.h" #ifdef DEBUG #define DEBUG_STATE diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_hunting.h b/src/xrGame/ai/monsters/chimera/chimera_state_hunting.h index e01b3d43c1d..8bbe16ed7b3 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_hunting.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_hunting.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateChimeraHunting : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_hunting_come_out.h b/src/xrGame/ai/monsters/chimera/chimera_state_hunting_come_out.h index 7e79c2e93b1..40148a78df6 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_hunting_come_out.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_hunting_come_out.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateChimeraHuntingComeOut : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_hunting_move_to_cover.h b/src/xrGame/ai/monsters/chimera/chimera_state_hunting_move_to_cover.h index 680da72ba69..09e46bc4c1d 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_hunting_move_to_cover.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_hunting_move_to_cover.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateChimeraHuntingMoveToCover : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_manager.cpp b/src/xrGame/ai/monsters/chimera/chimera_state_manager.cpp index 3a87e05690b..164b338bbac 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_manager.cpp +++ b/src/xrGame/ai/monsters/chimera/chimera_state_manager.cpp @@ -2,20 +2,20 @@ #include "chimera.h" #include "chimera_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" #include "chimera_state_threaten.h" -#include "../states/state_test_state.h" +#include "ai/Monsters/states/state_test_state.h" #include "chimera_attack_state.h" diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_manager.h b/src/xrGame/ai/monsters/chimera/chimera_state_manager.h index a751a52f3d0..5c3c0792a6d 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_manager.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CChimera; diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_threaten.h b/src/xrGame/ai/monsters/chimera/chimera_state_threaten.h index e1a5180b242..7d1f8f62b4a 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_threaten.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_threaten.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateChimeraThreaten : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_threaten_roar.h b/src/xrGame/ai/monsters/chimera/chimera_state_threaten_roar.h index 53eb701509b..3e74d49bea3 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_threaten_roar.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_threaten_roar.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateChimeraThreatenRoar : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_threaten_steal.h b/src/xrGame/ai/monsters/chimera/chimera_state_threaten_steal.h index 720acfea8c1..54be51bc959 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_threaten_steal.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_threaten_steal.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateChimeraThreatenSteal : public CStateMonsterMoveToPointEx<_Object> { diff --git a/src/xrGame/ai/monsters/chimera/chimera_state_threaten_walk.h b/src/xrGame/ai/monsters/chimera/chimera_state_threaten_walk.h index 27bb1654e6e..90332a7391d 100644 --- a/src/xrGame/ai/monsters/chimera/chimera_state_threaten_walk.h +++ b/src/xrGame/ai/monsters/chimera/chimera_state_threaten_walk.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateChimeraThreatenWalk : public CStateMonsterMoveToPointEx<_Object> { diff --git a/src/xrGame/ai/monsters/control_animation.cpp b/src/xrGame/ai/monsters/control_animation.cpp index e882b39c028..9dead918f86 100644 --- a/src/xrGame/ai/monsters/control_animation.cpp +++ b/src/xrGame/ai/monsters/control_animation.cpp @@ -2,11 +2,7 @@ #include "control_animation.h" #include "BaseMonster/base_monster.h" #include "control_manager.h" -#include "../../profiler.h" - -//#ifdef _DEBUG -//#include "control_animation_base.h" -//#endif +#include "profiler.h" void SAnimationPart::set_motion (MotionID const& m) { diff --git a/src/xrGame/ai/monsters/control_animation.h b/src/xrGame/ai/monsters/control_animation.h index bd2a6b2b846..8c81f533bb0 100644 --- a/src/xrGame/ai/monsters/control_animation.h +++ b/src/xrGame/ai/monsters/control_animation.h @@ -1,9 +1,9 @@ #pragma once #include "control_combase.h" -//#include "../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../Include/xrRender/RenderVisual.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" +//#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/KinematicsAnimated.h" struct SAnimationPart { CBlend *blend; diff --git a/src/xrGame/ai/monsters/control_animation_base.cpp b/src/xrGame/ai/monsters/control_animation_base.cpp index 6309812a9ad..7b2d3e96e46 100644 --- a/src/xrGame/ai/monsters/control_animation_base.cpp +++ b/src/xrGame/ai/monsters/control_animation_base.cpp @@ -3,14 +3,14 @@ #include "control_direction_base.h" #include "control_movement_base.h" #include "BaseMonster/base_monster.h" -#include "../../PHMovementControl.h" +#include "PHMovementControl.h" #include "anim_triple.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" -#include "../../detail_path_manager.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" #include "monster_velocity_space.h" #include "monster_event_manager.h" #include "control_jump.h" -#include "../../sound_player.h" +#include "sound_player.h" // DEBUG purpose only char *dbg_action_name_table[] = { diff --git a/src/xrGame/ai/monsters/control_animation_base_accel.cpp b/src/xrGame/ai/monsters/control_animation_base_accel.cpp index 650f88ed37a..55d54a3848a 100644 --- a/src/xrGame/ai/monsters/control_animation_base_accel.cpp +++ b/src/xrGame/ai/monsters/control_animation_base_accel.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "control_animation_base.h" #include "BaseMonster/base_monster.h" -#include "../../detail_path_manager.h" +#include "detail_path_manager.h" #include "monster_velocity_space.h" void CControlAnimationBase::accel_init() diff --git a/src/xrGame/ai/monsters/control_animation_base_update.cpp b/src/xrGame/ai/monsters/control_animation_base_update.cpp index 575f5c95e11..0536edab531 100644 --- a/src/xrGame/ai/monsters/control_animation_base_update.cpp +++ b/src/xrGame/ai/monsters/control_animation_base_update.cpp @@ -3,11 +3,11 @@ #include "control_direction_base.h" #include "control_movement_base.h" #include "BaseMonster/base_monster.h" -#include "../../CharacterPhysicsSupport.h" -#include "../../PHMovementControl.h" -#include "../../detail_path_manager.h" +#include "CharacterPhysicsSupport.h" +#include "PHMovementControl.h" +#include "detail_path_manager.h" #include "monster_velocity_space.h" -#include "control_path_builder_base.h" +#include "ai/monsters/control_path_builder_base.h" // DEBUG purpose only char *dbg_anim_name_table[] = { diff --git a/src/xrGame/ai/monsters/control_direction.cpp b/src/xrGame/ai/monsters/control_direction.cpp index 70e057959c5..52238e5319c 100644 --- a/src/xrGame/ai/monsters/control_direction.cpp +++ b/src/xrGame/ai/monsters/control_direction.cpp @@ -2,13 +2,11 @@ #include "control_direction.h" #include "BaseMonster/base_monster.h" #include "control_manager.h" - -#include "../../detail_path_manager.h" -#include "../../level_graph.h" -#include "../../ai_space.h" -#include "../../ai_object_location.h" - -#include "../../detail_path_manager_space.h" +#include "detail_path_manager.h" +#include "level_graph.h" +#include "ai_space.h" +#include "ai_object_location.h" +#include "detail_path_manager_space.h" void CControlDirection::reinit() { diff --git a/src/xrGame/ai/monsters/control_direction_base.cpp b/src/xrGame/ai/monsters/control_direction_base.cpp index a9ea268e386..b5f708ce598 100644 --- a/src/xrGame/ai/monsters/control_direction_base.cpp +++ b/src/xrGame/ai/monsters/control_direction_base.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "control_direction_base.h" #include "basemonster/base_monster.h" -#include "../../detail_path_manager.h" +#include "detail_path_manager.h" void CControlDirectionBase::reinit() { diff --git a/src/xrGame/ai/monsters/control_jump.cpp b/src/xrGame/ai/monsters/control_jump.cpp index 4158b876bb9..0669810a025 100644 --- a/src/xrGame/ai/monsters/control_jump.cpp +++ b/src/xrGame/ai/monsters/control_jump.cpp @@ -2,27 +2,27 @@ #include "control_jump.h" #include "BaseMonster/base_monster.h" #include "control_manager.h" -#include "../../PHMovementControl.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" -#include "../../detail_path_manager.h" -#include "../../level.h" +#include "PHMovementControl.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" +#include "Level.h" #include "control_animation_base.h" #include "control_direction_base.h" #include "control_movement_base.h" -#include "control_path_builder_base.h" +#include "ai/monsters/control_path_builder_base.h" #include "monster_velocity_space.h" -#include "../../ai_space.h" -#include "../../level_graph.h" -#include "../../ai_object_location.h" -#include "../../CharacterPhysicsSupport.h" +#include "ai_space.h" +#include "level_graph.h" +#include "ai_object_location.h" +#include "CharacterPhysicsSupport.h" #ifdef DEBUG -#include "../../level_debug.h" +#include "level_debug.h" #endif -#include "../../trajectories.h" -#include "../../../xrPhysics/IPHWorld.h" -#include "../../../xrPhysics/PHCharacter.h" -#include "../../../xrCore/_vector3d_ext.h" +#include "trajectories.h" +#include "xrPhysics/IPHWorld.h" +#include "xrPhysics/PHCharacter.h" +#include "xrCore/_vector3d_ext.h" void CControlJump::reinit() { diff --git a/src/xrGame/ai/monsters/control_jump.h b/src/xrGame/ai/monsters/control_jump.h index c8916ed2867..00071622a3f 100644 --- a/src/xrGame/ai/monsters/control_jump.h +++ b/src/xrGame/ai/monsters/control_jump.h @@ -1,6 +1,6 @@ #pragma once #include "control_combase.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" struct SControlJumpData : public ControlCom::IComData { CObject *target_object; diff --git a/src/xrGame/ai/monsters/control_manager.cpp b/src/xrGame/ai/monsters/control_manager.cpp index b6cd8b88e2e..01535dbe908 100644 --- a/src/xrGame/ai/monsters/control_manager.cpp +++ b/src/xrGame/ai/monsters/control_manager.cpp @@ -5,7 +5,7 @@ // Lain: added #ifdef DEBUG -#include "../../debug_text_tree.h" +#include "debug_text_tree.h" #endif enum EActiveComAction { diff --git a/src/xrGame/ai/monsters/control_manager_custom.cpp b/src/xrGame/ai/monsters/control_manager_custom.cpp index 02a579c5ff5..638deae99e9 100644 --- a/src/xrGame/ai/monsters/control_manager_custom.cpp +++ b/src/xrGame/ai/monsters/control_manager_custom.cpp @@ -4,13 +4,12 @@ #include "control_sequencer.h" #include "control_run_attack.h" #include "control_threaten.h" -#include "../../../xrphysics/PhysicsShell.h" -#include "../../detail_path_manager.h" -#include "../../level.h" +#include "xrPhysics/PhysicsShell.h" +#include "detail_path_manager.h" +#include "Level.h" #include "control_animation_base.h" #include "control_critical_wound.h" - CControlManagerCustom::CControlManagerCustom() { m_sequencer = 0; diff --git a/src/xrGame/ai/monsters/control_melee_jump.h b/src/xrGame/ai/monsters/control_melee_jump.h index 12b728aadf3..7a7567c501e 100644 --- a/src/xrGame/ai/monsters/control_melee_jump.h +++ b/src/xrGame/ai/monsters/control_melee_jump.h @@ -1,6 +1,6 @@ #pragma once #include "control_combase.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" struct SControlMeleeJumpData : public ControlCom::IComData { MotionID anim_ls; diff --git a/src/xrGame/ai/monsters/control_movement.cpp b/src/xrGame/ai/monsters/control_movement.cpp index 133a897f3a7..1e269fd2ebd 100644 --- a/src/xrGame/ai/monsters/control_movement.cpp +++ b/src/xrGame/ai/monsters/control_movement.cpp @@ -2,8 +2,9 @@ #include "control_movement.h" #include "BaseMonster/base_monster.h" #include "control_manager.h" -#include "../../PHMovementControl.h" -#include "../../CharacterPhysicsSupport.h" +#include "PHMovementControl.h" +#include "CharacterPhysicsSupport.h" + void CControlMovement::reinit() { inherited::reinit (); diff --git a/src/xrGame/ai/monsters/control_movement_base.cpp b/src/xrGame/ai/monsters/control_movement_base.cpp index f537403931c..28cb091b718 100644 --- a/src/xrGame/ai/monsters/control_movement_base.cpp +++ b/src/xrGame/ai/monsters/control_movement_base.cpp @@ -4,7 +4,7 @@ #include "control_direction_base.h" #include "BaseMonster/base_monster.h" #include "monster_velocity_space.h" -#include "../../detail_path_manager.h" +#include "detail_path_manager.h" using namespace MonsterMovement; diff --git a/src/xrGame/ai/monsters/control_path_builder.cpp b/src/xrGame/ai/monsters/control_path_builder.cpp index 1461ef397a8..f9a7598dc84 100644 --- a/src/xrGame/ai/monsters/control_path_builder.cpp +++ b/src/xrGame/ai/monsters/control_path_builder.cpp @@ -2,16 +2,16 @@ #include "control_path_builder.h" #include "control_manager.h" #include "BaseMonster/base_monster.h" -#include "../../game_location_selector.h" -#include "../../level_location_selector.h" -#include "../../detail_path_manager.h" -#include "../../ai_object_location.h" -#include "../../ai_space.h" -#include "../../movement_manager_space.h" -#include "../../level_path_manager.h" -#include "../../actor.h" -#include "../../Actor_Memory.h" -#include "../../visual_memory_manager.h" +#include "game_location_selector.h" +#include "level_location_selector.h" +#include "detail_path_manager.h" +#include "ai_object_location.h" +#include "ai_space.h" +#include "movement_manager_space.h" +#include "level_path_manager.h" +#include "Actor.h" +#include "Actor_Memory.h" +#include "visual_memory_manager.h" #ifdef DEBUG extern bool show_restrictions(CRestrictedObject *object); diff --git a/src/xrGame/ai/monsters/control_path_builder.h b/src/xrGame/ai/monsters/control_path_builder.h index 56d3da0b54a..600eca3b9b4 100644 --- a/src/xrGame/ai/monsters/control_path_builder.h +++ b/src/xrGame/ai/monsters/control_path_builder.h @@ -1,7 +1,6 @@ #pragma once - #include "control_combase.h" -#include "../../movement_manager.h" +#include "movement_manager.h" class CCustomMonster; class CControl_Manager; diff --git a/src/xrGame/ai/monsters/control_path_builder_base.cpp b/src/xrGame/ai/monsters/control_path_builder_base.cpp index 4f50be24222..a26cead8888 100644 --- a/src/xrGame/ai/monsters/control_path_builder_base.cpp +++ b/src/xrGame/ai/monsters/control_path_builder_base.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" -#include "control_path_builder_base.h" +#include "ai/monsters/control_path_builder_base.h" #include "BaseMonster/base_monster.h" -#include "../../phmovementcontrol.h" -#include "../../cover_evaluators.h" -#include "../../level_path_manager.h" -#include "../../detail_path_manager.h" -#include "../../level_location_selector.h" -#include "../../ai_object_location.h" +#include "phmovementcontrol.h" +#include "cover_evaluators.h" +#include "level_path_manager.h" +#include "detail_path_manager.h" +#include "level_location_selector.h" +#include "ai_object_location.h" const u32 pmt_global_failed_duration = 3000; diff --git a/src/xrGame/ai/monsters/control_path_builder_base.h b/src/xrGame/ai/monsters/control_path_builder_base.h index 6555df6aaba..245dde66915 100644 --- a/src/xrGame/ai/monsters/control_path_builder_base.h +++ b/src/xrGame/ai/monsters/control_path_builder_base.h @@ -1,8 +1,7 @@ #pragma once - #include "ai_monster_defs.h" #include "control_combase.h" -#include "../../movement_manager_space.h" +#include "movement_manager_space.h" class CMotionStats; class CCoverEvaluatorCloseToEnemy; diff --git a/src/xrGame/ai/monsters/control_path_builder_base_path.cpp b/src/xrGame/ai/monsters/control_path_builder_base_path.cpp index 015e1fade19..d7ce102dac5 100644 --- a/src/xrGame/ai/monsters/control_path_builder_base_path.cpp +++ b/src/xrGame/ai/monsters/control_path_builder_base_path.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" -#include "control_path_builder_base.h" -#include "../../cover_point.h" -#include "../../cover_manager.h" -#include "../../cover_evaluators.h" -#include "BaseMonster/base_monster.h" -#include "../../detail_path_manager.h" -#include "../../level_location_selector.h" -#include "../../level_path_manager.h" -#include "../../ai_object_location.h" +#include "ai/monsters/control_path_builder_base.h" +#include "cover_point.h" +#include "cover_manager.h" +#include "cover_evaluators.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "detail_path_manager.h" +#include "level_location_selector.h" +#include "level_path_manager.h" +#include "ai_object_location.h" const float pmt_find_point_dist = 30.f; const u32 pmt_find_random_pos_attempts = 5; diff --git a/src/xrGame/ai/monsters/control_path_builder_base_set.cpp b/src/xrGame/ai/monsters/control_path_builder_base_set.cpp index fdf27b34ca2..a7861d985ed 100644 --- a/src/xrGame/ai/monsters/control_path_builder_base_set.cpp +++ b/src/xrGame/ai/monsters/control_path_builder_base_set.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#include "control_path_builder_base.h" +#include "ai/monsters/control_path_builder_base.h" #include "BaseMonster/base_monster.h" -#include "../../level_graph.h" -#include "../../ai_space.h" +#include "level_graph.h" +#include "ai_space.h" ////////////////////////////////////////////////////////////////////////// // Method: prepare_builder diff --git a/src/xrGame/ai/monsters/control_path_builder_base_update.cpp b/src/xrGame/ai/monsters/control_path_builder_base_update.cpp index e92dbb32877..664d259d406 100644 --- a/src/xrGame/ai/monsters/control_path_builder_base_update.cpp +++ b/src/xrGame/ai/monsters/control_path_builder_base_update.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#include "control_path_builder_base.h" +#include "ai/monsters/control_path_builder_base.h" #include "BaseMonster/base_monster.h" -#include "../../detail_path_manager.h" -#include "../../profiler.h" +#include "detail_path_manager.h" +#include "profiler.h" void CControlPathBuilderBase::update_frame() { diff --git a/src/xrGame/ai/monsters/control_rotation_jump.h b/src/xrGame/ai/monsters/control_rotation_jump.h index 2de22993a8c..7d01d02b086 100644 --- a/src/xrGame/ai/monsters/control_rotation_jump.h +++ b/src/xrGame/ai/monsters/control_rotation_jump.h @@ -1,6 +1,6 @@ #pragma once #include "control_combase.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" struct SControlRotationJumpData : public ControlCom::IComData { MotionID anim_stop_ls,anim_run_ls; diff --git a/src/xrGame/ai/monsters/control_sequencer.h b/src/xrGame/ai/monsters/control_sequencer.h index 955666c0b0a..8a3753914cf 100644 --- a/src/xrGame/ai/monsters/control_sequencer.h +++ b/src/xrGame/ai/monsters/control_sequencer.h @@ -1,7 +1,7 @@ #pragma once #include "control_combase.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" struct SAnimationSequencerData : public ControlCom::IComData { xr_vector motions; diff --git a/src/xrGame/ai/monsters/controlled_actor.cpp b/src/xrGame/ai/monsters/controlled_actor.cpp index 79c1961d53d..4462bb41e90 100644 --- a/src/xrGame/ai/monsters/controlled_actor.cpp +++ b/src/xrGame/ai/monsters/controlled_actor.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" #include "controlled_actor.h" -#include "../../actor.h" -#include "../../../xrEngine/CameraBase.h" -#include "../../xr_level_controller.h" -#include "../../level.h" +#include "Actor.h" +#include "xrEngine/CameraBase.h" +#include "xr_level_controller.h" +#include "Level.h" #include "ai_monster_utils.h" -#include "../../inventory.h" +#include "Inventory.h" #define SPEED_MIN 0.5f #define SPEED_MAX 4.f diff --git a/src/xrGame/ai/monsters/controlled_actor.h b/src/xrGame/ai/monsters/controlled_actor.h index 76fcac4415d..af663c1614a 100644 --- a/src/xrGame/ai/monsters/controlled_actor.h +++ b/src/xrGame/ai/monsters/controlled_actor.h @@ -1,6 +1,5 @@ #pragma once - -#include "../../actor_input_handler.h" +#include "actor_input_handler.h" class CControlledActor : public CActorInputHandler { typedef CActorInputHandler inherited; diff --git a/src/xrGame/ai/monsters/controller/controller.cpp b/src/xrGame/ai/monsters/controller/controller.cpp index 8c5c876b0f7..2da8a69eb84 100644 --- a/src/xrGame/ai/monsters/controller/controller.cpp +++ b/src/xrGame/ai/monsters/controller/controller.cpp @@ -1,48 +1,41 @@ #include "stdafx.h" #include "controller.h" #include "controller_state_manager.h" -#include "../controlled_entity.h" -#include "../../../actor.h" -#include "../../../ActorEffector.h" -#include "../../../ActorCondition.h" -#include "../ai_monster_effector.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../level.h" -#include "../../../sound_player.h" -#include "../../../ai_monster_space.h" -#include "../../../UIGameCustom.h" -#include "../../../ui/UIStatic.h" - -#include "../monster_velocity_space.h" -#include "../../../level_debug.h" -#include "../../../game_object_space.h" -#include "../../../detail_path_manager.h" -#include "../../../ai_space.h" -#include "../../../cover_point.h" -#include "../../../cover_manager.h" - -#include "controller_animation.h" -#include "controller_direction.h" - -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" - -#include "../../../level_graph.h" -#include "../../../ai_object_location.h" - -#include "../../../Inventory.h" -#include "../../../monster_community.h" -#include "../../../character_community.h" -#include "../../../InventoryOwner.h" -#include "../../../../xrServerEntities/character_info.h" - -#include "controller_psy_hit.h" -#include "../monster_cover_manager.h" -#include "controller_psy_aura.h" +#include "ai/Monsters/controlled_entity.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "ActorCondition.h" +#include "ai/Monsters/ai_monster_effector.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Level.h" +#include "sound_player.h" +#include "ai_monster_space.h" +#include "UIGameCustom.h" +#include "ui/UIStatic.h" +#include "ai/Monsters/monster_velocity_space.h" +#include "level_debug.h" +#include "game_object_space.h" +#include "detail_path_manager.h" +#include "ai_space.h" +#include "cover_point.h" +#include "cover_manager.h" +#include "ai/Monsters/Controller/controller_animation.h" +#include "ai/Monsters/Controller/controller_direction.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" +#include "level_graph.h" +#include "ai_object_location.h" +#include "Inventory.h" +#include "monster_community.h" +#include "character_community.h" +#include "InventoryOwner.h" +#include "xrServerEntities/character_info.h" +#include "ai/Monsters/Controller/controller_psy_hit.h" +#include "ai/Monsters/monster_cover_manager.h" #ifdef _DEBUG -# include +#include #endif const u32 _pmt_psy_attack_delay = 2000; diff --git a/src/xrGame/ai/monsters/controller/controller.h b/src/xrGame/ai/monsters/controller/controller.h index d202b31590c..6b574d45b28 100644 --- a/src/xrGame/ai/monsters/controller/controller.h +++ b/src/xrGame/ai/monsters/controller/controller.h @@ -1,14 +1,13 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../anim_triple.h" -#include "../../../../xrServerEntities/script_export_space.h" -#include "../controlled_actor.h" +#include "ai/monsters/BaseMonster/base_monster.h" +#include "ai/monsters/anim_triple.h" +#include "xrServerEntities/script_export_space.h" +#include "ai/monsters/controlled_actor.h" class CControllerAnimation; class CControllerDirection; class SndShockEffector; class CControllerPsyHit; -class CControllerAura; class CController : public CBaseMonster, public CControlledActor diff --git a/src/xrGame/ai/monsters/controller/controller_animation.cpp b/src/xrGame/ai/monsters/controller/controller_animation.cpp index 7fed1c99bd0..3a55002f89b 100644 --- a/src/xrGame/ai/monsters/controller/controller_animation.cpp +++ b/src/xrGame/ai/monsters/controller/controller_animation.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "controller_animation.h" #include "controller.h" -#include "../../../detail_path_manager.h" -#include "../../../level.h" -#include "../control_direction_base.h" -#include "../control_path_builder_base.h" +#include "detail_path_manager.h" +#include "Level.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_path_builder_base.h" #include "controller_direction.h" -#include "../monster_velocity_space.h" +#include "ai/monsters/monster_velocity_space.h" const float _pmt_psy_attack_time = 0.5f; diff --git a/src/xrGame/ai/monsters/controller/controller_animation.h b/src/xrGame/ai/monsters/controller/controller_animation.h index 95cc72c8898..505e4c77ccc 100644 --- a/src/xrGame/ai/monsters/controller/controller_animation.h +++ b/src/xrGame/ai/monsters/controller/controller_animation.h @@ -1,8 +1,7 @@ #pragma once - -#include "../control_animation_base.h" -#include "../ai_monster_defs.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" +#include "ai/Monsters/control_animation_base.h" +#include "ai/Monsters/ai_monster_defs.h" +#include "Include/xrRender/KinematicsAnimated.h" class CController; diff --git a/src/xrGame/ai/monsters/controller/controller_direction.cpp b/src/xrGame/ai/monsters/controller/controller_direction.cpp index b4bf0adfa5e..ad6efb367b9 100644 --- a/src/xrGame/ai/monsters/controller/controller_direction.cpp +++ b/src/xrGame/ai/monsters/controller/controller_direction.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "controller_direction.h" #include "controller.h" -#include "../../../game_object_space.h" +#include "game_object_space.h" const float _pmt_head_bone_limit = PI_DIV_6; const float _pmt_torso_bone_limit = PI_DIV_3; diff --git a/src/xrGame/ai/monsters/controller/controller_direction.h b/src/xrGame/ai/monsters/controller/controller_direction.h index 70cd98291c1..559a2716ee4 100644 --- a/src/xrGame/ai/monsters/controller/controller_direction.h +++ b/src/xrGame/ai/monsters/controller/controller_direction.h @@ -1,8 +1,8 @@ #pragma once -#include "../control_direction_base.h" -#include "../ai_monster_bones.h" -#include "../../../ai_monster_space.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/Monsters/ai_monster_bones.h" +#include "ai_monster_space.h" class CController; diff --git a/src/xrGame/ai/monsters/controller/controller_psy_aura.cpp b/src/xrGame/ai/monsters/controller/controller_psy_aura.cpp deleted file mode 100644 index 60c688180dc..00000000000 --- a/src/xrGame/ai/monsters/controller/controller_psy_aura.cpp +++ /dev/null @@ -1,174 +0,0 @@ -#include "stdafx.h" -#include "controller_psy_aura.h" -#include "controller.h" -#include "../../../actor.h" -#include "../../../level.h" -#include "../../../CameraEffector.h" -#include "../../../ActorEffector.h" - -CPPEffectorControllerAura::CPPEffectorControllerAura(const SPPInfo &ppi, u32 time_to_fade, const ref_sound &snd_left, const ref_sound &snd_right) -: inherited(ppi) -{ - m_time_to_fade = time_to_fade; - m_effector_state = eStateFadeIn; - m_time_state_started = Device.dwTimeGlobal; - - m_snd_left.clone (snd_left,st_Effect,sg_SourceType); - m_snd_right.clone (snd_right,st_Effect,sg_SourceType); - - m_snd_left.play_at_pos (Actor(), Fvector().set(-1.f, 0.f, 1.f), sm_Looped | sm_2D); - m_snd_right.play_at_pos (Actor(), Fvector().set(-1.f, 0.f, 1.f), sm_Looped | sm_2D); - -} - -void CPPEffectorControllerAura::switch_off() -{ - m_effector_state = eStateFadeOut; - m_time_state_started = Device.dwTimeGlobal; -} - - -BOOL CPPEffectorControllerAura::update() -{ - // update factor - if (m_effector_state == eStatePermanent) { - m_factor = 1.f; - } else { - m_factor = float(Device.dwTimeGlobal - m_time_state_started) / float(m_time_to_fade); - if (m_effector_state == eStateFadeOut) m_factor = 1 - m_factor; - - if (m_factor > 1) { - m_effector_state = eStatePermanent; - m_factor = 1.f; - } else if (m_factor < 0) { - if (m_snd_left._feedback()) m_snd_left.stop(); - if (m_snd_right._feedback()) m_snd_right.stop(); - - return FALSE; - } - } - - // start new or play again? - if (!m_snd_left._feedback() && !m_snd_right._feedback()) { - m_snd_left.play_at_pos (Actor(), Fvector().set(-1.f, 0.f, 1.f), sm_Looped | sm_2D); - m_snd_right.play_at_pos (Actor(), Fvector().set(-1.f, 0.f, 1.f), sm_Looped | sm_2D); - } - - if (m_snd_left._feedback()) m_snd_left.set_volume (m_factor); - if (m_snd_right._feedback()) m_snd_right.set_volume (m_factor); - - return TRUE; -} - -////////////////////////////////////////////////////////////////////////// -// -////////////////////////////////////////////////////////////////////////// - -#define FAKE_AURA_DURATION 3000 -#define FAKE_AURA_DELAY 8000 -#define FAKE_MAX_ADD_DIST 90.f -#define FAKE_MIN_ADD_DIST 20.f - - -void CControllerAura::update_schedule() -{ - if (!m_object->g_Alive()) return; - - float dist_to_actor = Actor()->Position().distance_to(m_object->Position()); - - if ((dist_to_actor > aura_radius + FAKE_MIN_ADD_DIST) && (dist_to_actor < aura_radius + FAKE_MAX_ADD_DIST)) - { - - // first time? - if (m_time_fake_aura == 0) { - m_time_fake_aura = time() + 5000 + Random.randI(FAKE_AURA_DELAY); - - if (active()) { - m_effector->switch_off (); - m_effector = 0; - } - } else { - if (active()) { - // check to stop - if (m_time_fake_aura < time()) { - m_effector->switch_off (); - m_effector = 0; - m_time_fake_aura = time() + 5000 + Random.randI(FAKE_AURA_DELAY); - } - } else { - // check to start - if (m_time_fake_aura < time()) { - m_effector = xr_new (m_state, 5000, aura_sound.left, aura_sound.right); - Actor()->Cameras().AddPPEffector (m_effector); - - m_time_fake_aura = time() + 5000 + Random.randI(FAKE_AURA_DURATION); - } - } - } - } else { - m_time_fake_aura = 0; - - bool need_be_active = (dist_to_actor < aura_radius); - - if (active()) - { - if (!need_be_active) - { - m_effector->switch_off (); - m_effector = 0; - } - } - else - { - if ( need_be_active ) - { - // create effector - m_effector = xr_new (m_state, 5000, aura_sound.left, aura_sound.right); - Actor()->Cameras().AddPPEffector (m_effector); - m_time_started = time(); - } - } - } - - if (active()) { - CEffectorCam* ce = Actor()->Cameras().GetCamEffector((ECamEffectorType)effControllerAura2); - if(!ce) AddEffector(Actor(), effControllerAura2, "effector_controller_aura2", 0.15f); - }else{ - CEffectorCam* ce = Actor()->Cameras().GetCamEffector((ECamEffectorType)effControllerAura2); - if(ce) - RemoveEffector(Actor(), effControllerAura2); - } -} - -void CControllerAura::update_frame() -{ -} - -void CControllerAura::on_death() -{ - if (active()) { - m_effector->switch_off (); - m_effector = 0; - } -} - -void CControllerAura::load(LPCSTR section) -{ - inherited::load (pSettings->r_string(section,"aura_effector")); - - aura_sound.left.create (pSettings->r_string(section,"PsyAura_SoundLeftPath"),st_Effect,sg_SourceType); - aura_sound.right.create (pSettings->r_string(section,"PsyAura_SoundRightPath"),st_Effect,sg_SourceType); - - aura_radius = READ_IF_EXISTS(pSettings,r_float,section,"PsyAura_Radius", 40.f); - - m_time_fake_aura = 0; - - m_time_fake_aura_duration = READ_IF_EXISTS(pSettings,r_u32,section,"PsyAura_Fake_Duration", 3000); - m_time_fake_aura_delay = READ_IF_EXISTS(pSettings,r_u32,section,"PsyAura_Fake_Delay", 8000); - m_fake_max_add_dist = READ_IF_EXISTS(pSettings,r_float,section,"PsyAura_Fake_MaxAddDist", 90.f); - m_fake_min_add_dist = READ_IF_EXISTS(pSettings,r_float,section,"PsyAura_Fake_MinAddDist", 20.f); - - m_time_started = 0; -} - - diff --git a/src/xrGame/ai/monsters/controller/controller_psy_aura.h b/src/xrGame/ai/monsters/controller/controller_psy_aura.h deleted file mode 100644 index 65db46dab37..00000000000 --- a/src/xrGame/ai/monsters/controller/controller_psy_aura.h +++ /dev/null @@ -1,60 +0,0 @@ -#pragma once -//////////////////////////////////////////////////////////////////////// -// Effector controlling class -//////////////////////////////////////////////////////////////////////// -#include "../../../pp_effector_custom.h" - -class CController; - -struct SAuraSound { - ref_sound left; - ref_sound right; -}; - - -class CPPEffectorControllerAura : public CPPEffectorCustom { - typedef CPPEffectorCustom inherited; - - enum {eStateFadeIn, eStateFadeOut, eStatePermanent} m_effector_state; - - u32 m_time_state_started; - u32 m_time_to_fade; - - ref_sound m_snd_left; - ref_sound m_snd_right; - -public: - CPPEffectorControllerAura (const SPPInfo &ppi, u32 time_to_fade, const ref_sound &snd_left, const ref_sound &snd_right); - virtual BOOL update (); - void switch_off (); -}; - -class CControllerAura : public CPPEffectorCustomController{ - typedef CPPEffectorCustomController inherited; - - CController *m_object; - u32 m_time_last_update; - - SAuraSound aura_sound; - float aura_radius; - - u32 m_time_fake_aura; - - u32 m_time_fake_aura_duration; - u32 m_time_fake_aura_delay; - float m_fake_max_add_dist; - float m_fake_min_add_dist; - - u32 m_time_started; - - -public: - CControllerAura (CController *monster) : m_object(monster){} - virtual void load (LPCSTR section); - - void on_death (); - void update_schedule (); - void update_frame (); -}; - - diff --git a/src/xrGame/ai/monsters/controller/controller_psy_hit.cpp b/src/xrGame/ai/monsters/controller/controller_psy_hit.cpp index c8fc39ff621..839ada7171e 100644 --- a/src/xrGame/ai/monsters/controller/controller_psy_hit.cpp +++ b/src/xrGame/ai/monsters/controller/controller_psy_hit.cpp @@ -1,18 +1,18 @@ #include "stdafx.h" #include "controller_psy_hit.h" -#include "../BaseMonster/base_monster.h" +#include "ai/Monsters/BaseMonster/base_monster.h" #include "controller.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../../../level.h" -#include "../../../actor.h" -#include "../../../ActorEffector.h" -#include "../../../../xrEngine/CameraBase.h" -#include "../../../CharacterPhysicsSupport.h" -#include "../../../level_debug.h" -#include "../../../ActorCondition.h" -#include "../../../HudManager.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "Level.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "xrEngine/CameraBase.h" +#include "CharacterPhysicsSupport.h" +#include "level_debug.h" +#include "ActorCondition.h" +#include "HUDManager.h" void CControllerPsyHit::load(LPCSTR section) { diff --git a/src/xrGame/ai/monsters/controller/controller_psy_hit.h b/src/xrGame/ai/monsters/controller/controller_psy_hit.h index 4ca8175d3ac..fa19a6c8226 100644 --- a/src/xrGame/ai/monsters/controller/controller_psy_hit.h +++ b/src/xrGame/ai/monsters/controller/controller_psy_hit.h @@ -1,6 +1,6 @@ #pragma once -#include "../control_combase.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" +#include "ai/Monsters/control_combase.h" +#include "Include/xrRender/KinematicsAnimated.h" class CPsyHitEffectorCam; class CPsyHitEffectorPP; diff --git a/src/xrGame/ai/monsters/controller/controller_psy_hit_effector.h b/src/xrGame/ai/monsters/controller/controller_psy_hit_effector.h index 9eb48633088..3274420b5bf 100644 --- a/src/xrGame/ai/monsters/controller/controller_psy_hit_effector.h +++ b/src/xrGame/ai/monsters/controller/controller_psy_hit_effector.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../../xrEngine/effector.h" -#include "../../../pp_effector_custom.h" +#include "xrEngine/effector.h" +#include "pp_effector_custom.h" //////////////////////////////////////////////////////////////////////////////////// // CPsyHitEffectorPP diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack.h b/src/xrGame/ai/monsters/controller/controller_state_attack.h index 3f64d1a269e..125605edbb3 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack.h @@ -1,7 +1,7 @@ #pragma once -#include "../state.h" -#include "../../../ai_debug.h" +#include "ai/Monsters/state.h" +#include "ai_debug.h" template class CStateControllerAttack : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack_fast_move.h b/src/xrGame/ai/monsters/controller/controller_state_attack_fast_move.h index 7c947aa6cc8..50a9fe4fb79 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack_fast_move.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack_fast_move.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateControllerFastMove : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack_hide_inline.h b/src/xrGame/ai/monsters/controller/controller_state_attack_hide_inline.h index 090668d6a3a..c3b649bf72c 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack_hide_inline.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack_hide_inline.h @@ -1,10 +1,10 @@ #pragma once -#include "../../../ai_space.h" -#include "../monster_cover_manager.h" -#include "../../../cover_point.h" -#include "../../../level.h" -#include "../../../level_debug.h" +#include "ai_space.h" +#include "ai/monsters/monster_cover_manager.h" +#include "cover_point.h" +#include "Level.h" +#include "level_debug.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/controller/controller_state_attack_hide_lite_inline.h b/src/xrGame/ai/monsters/controller/controller_state_attack_hide_lite_inline.h index a517f77776f..e099d753f9c 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_attack_hide_lite_inline.h +++ b/src/xrGame/ai/monsters/controller/controller_state_attack_hide_lite_inline.h @@ -1,10 +1,10 @@ #pragma once -#include "../../../ai_space.h" -#include "../monster_cover_manager.h" -#include "../../../cover_point.h" -#include "../../../level.h" -#include "../../../level_debug.h" +#include "ai_space.h" +#include "ai/monsters/monster_cover_manager.h" +#include "cover_point.h" +#include "Level.h" +#include "level_debug.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/controller/controller_state_manager.cpp b/src/xrGame/ai/monsters/controller/controller_state_manager.cpp index 7098edcbbca..83371025f7b 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_manager.cpp +++ b/src/xrGame/ai/monsters/controller/controller_state_manager.cpp @@ -4,26 +4,26 @@ #include "controller_animation.h" #include "controller_direction.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" -#include "../controlled_entity.h" +#include "ai/Monsters/controlled_entity.h" -#include "../states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_rest.h" #include "controller_state_attack.h" -#include "../states/monster_state_attack_melee.h" -#include "../states/monster_state_attack_run.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../states/monster_state_attack.h" - -#include "../../../entitycondition.h" - -#include "../states/state_test_state.h" +#include "ai/Monsters/states/monster_state_attack_melee.h" +#include "ai/Monsters/states/monster_state_attack_run.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "ai/Monsters/states/monster_state_attack.h" + +#include "EntityCondition.h" + +#include "ai/Monsters/states/state_test_state.h" CStateManagerController::CStateManagerController(CController *obj) : inherited(obj) { diff --git a/src/xrGame/ai/monsters/controller/controller_state_manager.h b/src/xrGame/ai/monsters/controller/controller_state_manager.h index 60642afc214..9a71079dc95 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_manager.h +++ b/src/xrGame/ai/monsters/controller/controller_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CController; diff --git a/src/xrGame/ai/monsters/controller/controller_state_panic.h b/src/xrGame/ai/monsters/controller/controller_state_panic.h index c67af9768d2..0b2a87ba389 100644 --- a/src/xrGame/ai/monsters/controller/controller_state_panic.h +++ b/src/xrGame/ai/monsters/controller/controller_state_panic.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateControllerPanic : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/controller/controller_tube.h b/src/xrGame/ai/monsters/controller/controller_tube.h index c73389d773d..d0adae86288 100644 --- a/src/xrGame/ai/monsters/controller/controller_tube.h +++ b/src/xrGame/ai/monsters/controller/controller_tube.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateControllerTube : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/corpse_cover.cpp b/src/xrGame/ai/monsters/corpse_cover.cpp index 4cbb532b7eb..af6d4b1a6b0 100644 --- a/src/xrGame/ai/monsters/corpse_cover.cpp +++ b/src/xrGame/ai/monsters/corpse_cover.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "corpse_cover.h" -#include "../../cover_point.h" -#include "../../ai_space.h" -#include "../../level_graph.h" +#include "cover_point.h" +#include "ai_space.h" +#include "level_graph.h" void CMonsterCorpseCoverEvaluator::evaluate_cover (const CCoverPoint *cover_point, float weight) { diff --git a/src/xrGame/ai/monsters/corpse_cover.h b/src/xrGame/ai/monsters/corpse_cover.h index 02c9bc0a61a..b7920157ea2 100644 --- a/src/xrGame/ai/monsters/corpse_cover.h +++ b/src/xrGame/ai/monsters/corpse_cover.h @@ -1,6 +1,5 @@ #pragma once - -#include "../../cover_evaluators.h" +#include "cover_evaluators.h" class CMonsterCorpseCoverEvaluator: public CCoverEvaluatorBase { protected: diff --git a/src/xrGame/ai/monsters/dog/dog.cpp b/src/xrGame/ai/monsters/dog/dog.cpp index e4ba9aa8729..ca2f9d86a25 100644 --- a/src/xrGame/ai/monsters/dog/dog.cpp +++ b/src/xrGame/ai/monsters/dog/dog.cpp @@ -1,20 +1,20 @@ #include "stdafx.h" #include "dog.h" #include "dog_state_manager.h" -#include "../monster_velocity_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" -#include "../../../date_time.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../monster_home.h" -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" -#include "../../../CharacterPhysicsSupport.h" - -#include "../../../level_graph.h" -#include "../../../ai_space.h" -#include "../../../ai_object_location.h" -#include "../../../actor.h" +#include "ai/monsters/monster_velocity_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" +#include "date_time.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "ai/Monsters/monster_home.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "CharacterPhysicsSupport.h" + +#include "level_graph.h" +#include "ai_space.h" +#include "ai_object_location.h" +#include "Actor.h" #ifdef _DEBUG # include diff --git a/src/xrGame/ai/monsters/dog/dog.h b/src/xrGame/ai/monsters/dog/dog.h index 6cadc83f765..134b4a77c9c 100644 --- a/src/xrGame/ai/monsters/dog/dog.h +++ b/src/xrGame/ai/monsters/dog/dog.h @@ -1,8 +1,8 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../controlled_entity.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/controlled_entity.h" +#include "xrServerEntities/script_export_space.h" class CAI_Dog : public CBaseMonster, public CControlledEntity { diff --git a/src/xrGame/ai/monsters/dog/dog_state_manager.cpp b/src/xrGame/ai/monsters/dog/dog_state_manager.cpp index b914f26949e..405d7333472 100644 --- a/src/xrGame/ai/monsters/dog/dog_state_manager.cpp +++ b/src/xrGame/ai/monsters/dog/dog_state_manager.cpp @@ -1,19 +1,19 @@ #include "stdafx.h" -#include "dog.h" -#include "dog_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hitted.h" -#include "../states/monster_state_controlled.h" -#include "../states/monster_state_help_sound.h" -#include "../group_states/group_state_attack.h" -#include "../group_states/group_state_rest.h" -#include "../group_states/group_state_eat.h" -#include "../group_states/group_state_panic.h" -#include "../group_states/group_state_hear_danger_sound.h" +#include "ai/Monsters/Dog/dog.h" +#include "ai/Monsters/Dog/dog_state_manager.h" +#include "ai/Monsters/control_animation_base.h" +#include "ai/Monsters/control_direction_base.h" +#include "ai/Monsters/control_movement_base.h" +#include "ai/Monsters/control_path_builder_base.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "ai/Monsters/states/monster_state_controlled.h" +#include "ai/Monsters/states/monster_state_help_sound.h" +#include "ai/Monsters/group_states/group_state_attack.h" +#include "ai/Monsters/group_states/group_state_rest.h" +#include "ai/Monsters/group_states/group_state_eat.h" +#include "ai/Monsters/group_states/group_state_panic.h" +#include "ai/Monsters/group_states/group_state_hear_danger_sound.h" namespace detail { diff --git a/src/xrGame/ai/monsters/dog/dog_state_manager.h b/src/xrGame/ai/monsters/dog/dog_state_manager.h index b9c44963987..24dc16f2b13 100644 --- a/src/xrGame/ai/monsters/dog/dog_state_manager.h +++ b/src/xrGame/ai/monsters/dog/dog_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CAI_Dog; diff --git a/src/xrGame/ai/monsters/energy_holder.cpp b/src/xrGame/ai/monsters/energy_holder.cpp index 3544b24128b..3d7dd237d52 100644 --- a/src/xrGame/ai/monsters/energy_holder.cpp +++ b/src/xrGame/ai/monsters/energy_holder.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "energy_holder.h" -#include "../../gameobject.h" +#include "GameObject.h" CEnergyHolder::CEnergyHolder() { diff --git a/src/xrGame/ai/monsters/flesh/flesh.cpp b/src/xrGame/ai/monsters/flesh/flesh.cpp index f71c3790f41..82280fef7db 100644 --- a/src/xrGame/ai/monsters/flesh/flesh.cpp +++ b/src/xrGame/ai/monsters/flesh/flesh.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "flesh.h" -#include "../../../ai_space.h" +#include "ai_space.h" #include "flesh_state_manager.h" -#include "../monster_velocity_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" +#include "ai/monsters/monster_velocity_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" CAI_Flesh::CAI_Flesh() diff --git a/src/xrGame/ai/monsters/flesh/flesh.h b/src/xrGame/ai/monsters/flesh/flesh.h index d8d7e0a5cfc..ddcc0fe3b51 100644 --- a/src/xrGame/ai/monsters/flesh/flesh.h +++ b/src/xrGame/ai/monsters/flesh/flesh.h @@ -1,7 +1,7 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../controlled_entity.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/controlled_entity.h" +#include "xrServerEntities/script_export_space.h" class CAI_Flesh : public CBaseMonster, public CControlledEntity { diff --git a/src/xrGame/ai/monsters/flesh/flesh_state_manager.cpp b/src/xrGame/ai/monsters/flesh/flesh_state_manager.cpp index a50291a731e..875cc957dfe 100644 --- a/src/xrGame/ai/monsters/flesh/flesh_state_manager.cpp +++ b/src/xrGame/ai/monsters/flesh/flesh_state_manager.cpp @@ -1,22 +1,20 @@ #include "stdafx.h" -#include "flesh.h" -#include "flesh_state_manager.h" - -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" - -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../states/monster_state_controlled.h" -#include "../states/monster_state_help_sound.h" -#include "../group_states/group_state_home_point_attack.h" +#include "ai/Monsters/Flesh/flesh.h" +#include "ai/Monsters/Flesh/flesh_state_manager.h" +#include "ai/Monsters/control_animation_base.h" +#include "ai/Monsters/control_direction_base.h" +#include "ai/Monsters/control_movement_base.h" +#include "ai/Monsters/control_path_builder_base.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "ai/Monsters/states/monster_state_controlled.h" +#include "ai/Monsters/states/monster_state_help_sound.h" +#include "ai/Monsters/group_states/group_state_home_point_attack.h" CStateManagerFlesh::CStateManagerFlesh(CAI_Flesh *monster) : inherited(monster) { diff --git a/src/xrGame/ai/monsters/flesh/flesh_state_manager.h b/src/xrGame/ai/monsters/flesh/flesh_state_manager.h index c3d22090870..2373dd13951 100644 --- a/src/xrGame/ai/monsters/flesh/flesh_state_manager.h +++ b/src/xrGame/ai/monsters/flesh/flesh_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CAI_Flesh; diff --git a/src/xrGame/ai/monsters/fracture/fracture.cpp b/src/xrGame/ai/monsters/fracture/fracture.cpp index 82f39aede5a..2f9758a973c 100644 --- a/src/xrGame/ai/monsters/fracture/fracture.cpp +++ b/src/xrGame/ai/monsters/fracture/fracture.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "fracture.h" #include "fracture_state_manager.h" -#include "../monster_velocity_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" +#include "ai/monsters/monster_velocity_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" CFracture::CFracture() diff --git a/src/xrGame/ai/monsters/fracture/fracture.h b/src/xrGame/ai/monsters/fracture/fracture.h index 5d34d93bd64..6df57d0d569 100644 --- a/src/xrGame/ai/monsters/fracture/fracture.h +++ b/src/xrGame/ai/monsters/fracture/fracture.h @@ -1,6 +1,6 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "xrServerEntities/script_export_space.h" class CStateManagerFracture; diff --git a/src/xrGame/ai/monsters/fracture/fracture_state_manager.cpp b/src/xrGame/ai/monsters/fracture/fracture_state_manager.cpp index d007d2ede56..f383b748950 100644 --- a/src/xrGame/ai/monsters/fracture/fracture_state_manager.cpp +++ b/src/xrGame/ai/monsters/fracture/fracture_state_manager.cpp @@ -2,19 +2,19 @@ #include "fracture.h" #include "fracture_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" - -#include "../states/monster_state_rest.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" - -#include "../../../entitycondition.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" + +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" + +#include "EntityCondition.h" CStateManagerFracture::CStateManagerFracture(CFracture *obj) : inherited(obj) { diff --git a/src/xrGame/ai/monsters/fracture/fracture_state_manager.h b/src/xrGame/ai/monsters/fracture/fracture_state_manager.h index 7c9155efb33..d6fa11a71d9 100644 --- a/src/xrGame/ai/monsters/fracture/fracture_state_manager.h +++ b/src/xrGame/ai/monsters/fracture/fracture_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CFracture; diff --git a/src/xrGame/ai/monsters/group_states/group_state_attack.h b/src/xrGame/ai/monsters/group_states/group_state_attack.h index 07d376feb7a..ec18788f70d 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_attack.h +++ b/src/xrGame/ai/monsters/group_states/group_state_attack.h @@ -1,7 +1,7 @@ #pragma once -#include "../state.h" -#include "../../../ai_debug.h" +#include "ai/Monsters/state.h" +#include "ai_debug.h" template class CStateGroupAttack : public CState<_Object> diff --git a/src/xrGame/ai/monsters/group_states/group_state_attack_inline.h b/src/xrGame/ai/monsters/group_states/group_state_attack_inline.h index 83fc97d8c55..b945ec41b55 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_attack_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_attack_inline.h @@ -1,17 +1,17 @@ #pragma once -#include "../states/monster_state_attack_melee.h" -#include "../states/monster_state_attack_run_attack.h" -#include "../states/state_hide_from_point.h" -#include "../states/monster_state_find_enemy.h" +#include "ai/Monsters/states/monster_state_attack_melee.h" +#include "ai/Monsters/states/monster_state_attack_run_attack.h" +#include "ai/Monsters/states/state_hide_from_point.h" +#include "ai/Monsters/states/monster_state_find_enemy.h" #include "group_state_squad_move_to_radius.h " #include "group_state_home_point_attack.h" #include "group_state_custom.h" -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" #include "group_state_attack_run.h" -#include "../../../entity_alive.h" -#include "../../../actor.h" +#include "entity_alive.h" +#include "Actor.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/group_states/group_state_attack_run.h b/src/xrGame/ai/monsters/group_states/group_state_attack_run.h index 1cffb5850e5..a9aaa30cc47 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_attack_run.h +++ b/src/xrGame/ai/monsters/group_states/group_state_attack_run.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateGroupAttackRun : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/group_state_attack_run_inline.h b/src/xrGame/ai/monsters/group_states/group_state_attack_run_inline.h index 9847221edf1..76786ae93d2 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_attack_run_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_attack_run_inline.h @@ -1,7 +1,7 @@ #pragma once -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/group_states/group_state_custom.h b/src/xrGame/ai/monsters/group_states/group_state_custom.h index d44bc1e113e..6f2104238e8 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_custom.h +++ b/src/xrGame/ai/monsters/group_states/group_state_custom.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateCustomGroup : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/group_state_custom_inline.h b/src/xrGame/ai/monsters/group_states/group_state_custom_inline.h index cd8da7cca01..516c787d917 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_custom_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_custom_inline.h @@ -1,6 +1,6 @@ #pragma once -#include "../states/state_custom_action.h" +#include "ai/Monsters/states/state_custom_action.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat.h b/src/xrGame/ai/monsters/group_states/group_state_eat.h index 540d6998e57..496654b2e70 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateGroupEat : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat_drag_inline.h b/src/xrGame/ai/monsters/group_states/group_state_eat_drag_inline.h index a9c7d61547a..fe82825df95 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat_drag_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat_drag_inline.h @@ -1,9 +1,7 @@ #pragma once - -//#include "../../../PHCharacter.h" -#include "../../../../xrphysics/IPHCapture.h" -#include "../../../CaptureBoneCallback.h" -#include "../../../../include/xrrender/Kinematics.h" +#include "xrPhysics/IPHCapture.h" +#include "CaptureBoneCallback.h" +#include "Include/xrRender/Kinematics.h" #include #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat_eat.h b/src/xrGame/ai/monsters/group_states/group_state_eat_eat.h index 6602bf7ecea..1493770475e 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat_eat.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat_eat.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateGroupEating : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/group_state_eat_inline.h b/src/xrGame/ai/monsters/group_states/group_state_eat_inline.h index 28e78d2c684..e3e19962b09 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_eat_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_eat_inline.h @@ -1,12 +1,12 @@ #pragma once -#include "../states/state_data.h" -#include "../states/state_move_to_point.h" -#include "../states/state_hide_from_point.h" -#include "../states/state_custom_action.h" -#include "../../../../xrphysics/PhysicsShell.h" -#include "../../../PHMovementControl.h" -#include "../../../CharacterPhysicsSupport.h" +#include "ai/Monsters/states/state_data.h" +#include "ai/Monsters/states/state_move_to_point.h" +#include "ai/Monsters/states/state_hide_from_point.h" +#include "ai/Monsters/states/state_custom_action.h" +#include "xrPhysics/PhysicsShell.h" +#include "PHMovementControl.h" +#include "CharacterPhysicsSupport.h" #include "group_state_eat_drag.h" #include "group_state_custom.h" #include "group_state_eat_eat.h " diff --git a/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound.h b/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound.h index 999ddf61b54..3180037d034 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound.h +++ b/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateGroupHearDangerousSound : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound_inline.h b/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound_inline.h index 109c8119222..f6d8358d0a2 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_hear_danger_sound_inline.h @@ -1,11 +1,9 @@ #pragma once - -#include "../states/state_move_to_point.h" -#include "../states/monster_state_home_point_danger.h" - -#include "../ai_monster_squad.h" -#include "../../../entity.h" -#include "../../../ai_object_location.h" +#include "ai/Monsters/states/state_move_to_point.h" +#include "ai/Monsters/states/monster_state_home_point_danger.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "Entity.h" +#include "ai_object_location.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/group_states/group_state_home_point_attack.h b/src/xrGame/ai/monsters/group_states/group_state_home_point_attack.h index 5e0849e931c..6ab38865928 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_home_point_attack.h +++ b/src/xrGame/ai/monsters/group_states/group_state_home_point_attack.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateGroupAttackMoveToHomePoint : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/group_state_home_point_attack_inline.h b/src/xrGame/ai/monsters/group_states/group_state_home_point_attack_inline.h index 4b32259f6ad..172213ad198 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_home_point_attack_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_home_point_attack_inline.h @@ -1,10 +1,10 @@ #pragma once -#include "../states/state_move_to_point.h" -#include "../states/state_look_point.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" -#include "../monster_home.h" +#include "ai/Monsters/states/state_move_to_point.h" +#include "ai/Monsters/states/state_look_point.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" +#include "ai/Monsters/monster_home.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/group_states/group_state_panic.h b/src/xrGame/ai/monsters/group_states/group_state_panic.h index 6eccecf4c43..5004ef5aae6 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_panic.h +++ b/src/xrGame/ai/monsters/group_states/group_state_panic.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateGroupPanic : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/group_state_panic_inline.h b/src/xrGame/ai/monsters/group_states/group_state_panic_inline.h index 9d7516c6742..5312950f928 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_panic_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_panic_inline.h @@ -1,10 +1,10 @@ #pragma once -#include "../states/state_data.h" -#include "../states/state_move_to_point.h" -#include "../states/state_look_unprotected_area.h" +#include "ai/Monsters/states/state_data.h" +#include "ai/Monsters/states/state_move_to_point.h" +#include "ai/Monsters/states/state_look_unprotected_area.h" #include "group_state_panic_run.h" -#include "../states/monster_state_home_point_attack.h" +#include "ai/Monsters/states/monster_state_home_point_attack.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/group_states/group_state_rest.h b/src/xrGame/ai/monsters/group_states/group_state_rest.h index 9aa71b40257..78390c77976 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_rest.h +++ b/src/xrGame/ai/monsters/group_states/group_state_rest.h @@ -1,8 +1,8 @@ #pragma once -#include "../state.h" -#include "../../../entitycondition.h" -#include "../states/state_data.h" +#include "ai/Monsters/state.h" +#include "EntityCondition.h" +#include "ai/Monsters/states/state_data.h" template class CStateGroupRest : public CState<_Object> { protected: diff --git a/src/xrGame/ai/monsters/group_states/group_state_rest_idle.h b/src/xrGame/ai/monsters/group_states/group_state_rest_idle.h index 247e93395ec..090fcbd9dbc 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_rest_idle.h +++ b/src/xrGame/ai/monsters/group_states/group_state_rest_idle.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateGroupRestIdle : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/group_state_rest_idle_inline.h b/src/xrGame/ai/monsters/group_states/group_state_rest_idle_inline.h index 7c3c70c1852..9382fb0b966 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_rest_idle_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_rest_idle_inline.h @@ -1,10 +1,10 @@ #pragma once -#include "../states/state_move_to_point.h" -#include "../states/state_look_point.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" -#include "../states/state_custom_action.h" +#include "ai/Monsters/states/state_move_to_point.h" +#include "ai/Monsters/states/state_look_point.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" +#include "ai/Monsters/states/state_custom_action.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/group_states/group_state_rest_inline.h b/src/xrGame/ai/monsters/group_states/group_state_rest_inline.h index 95a2c95e534..e17c2ce0398 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_rest_inline.h +++ b/src/xrGame/ai/monsters/group_states/group_state_rest_inline.h @@ -1,13 +1,12 @@ #pragma once - -#include "../states/monster_state_rest_sleep.h" -#include "../states/state_move_to_restrictor.h" -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" -#include "../monster_home.h" -#include "../anomaly_detector.h" -#include "../states/monster_state_home_point_rest.h" -#include "../states/monster_state_smart_terrain_task.h" +#include "ai/Monsters/states/monster_state_rest_sleep.h" +#include "ai/Monsters/states/state_move_to_restrictor.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "ai/Monsters/monster_home.h" +#include "ai/Monsters/anomaly_detector.h" +#include "ai/Monsters/states/monster_state_home_point_rest.h" +#include "ai/Monsters/states/monster_state_smart_terrain_task.h" #include "group_state_rest_idle.h" #include "group_state_custom.h" diff --git a/src/xrGame/ai/monsters/group_states/group_state_squad_move_to_radius.h b/src/xrGame/ai/monsters/group_states/group_state_squad_move_to_radius.h index a46a373dfd2..42cc1c3d2a5 100644 --- a/src/xrGame/ai/monsters/group_states/group_state_squad_move_to_radius.h +++ b/src/xrGame/ai/monsters/group_states/group_state_squad_move_to_radius.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" -#include "../states/state_data.h" +#include "ai/Monsters/state.h" +#include "ai/Monsters/states/state_data.h" template class CStateGroupSquadMoveToRadiusEx : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/group_states/state_adapter.h b/src/xrGame/ai/monsters/group_states/state_adapter.h index 6fab1f5064c..21eff3e2d1e 100644 --- a/src/xrGame/ai/monsters/group_states/state_adapter.h +++ b/src/xrGame/ai/monsters/group_states/state_adapter.h @@ -9,8 +9,8 @@ #ifndef GROUP_STATE_ADAPTER_H_INCLUDED #define GROUP_STATE_ADAPTER_H_INCLUDED -#include "../state.h" -#include "../basemonster/base_monster.h" +#include "ai/Monsters/state.h" +#include "ai/Monsters/BaseMonster/base_monster.h" class CBaseMonster; diff --git a/src/xrGame/ai/monsters/melee_checker.cpp b/src/xrGame/ai/monsters/melee_checker.cpp index a99782dbaf3..defc9c610e7 100644 --- a/src/xrGame/ai/monsters/melee_checker.cpp +++ b/src/xrGame/ai/monsters/melee_checker.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "melee_checker.h" #include "basemonster/base_monster.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../xrEngine/xr_collide_form.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "xrEngine/xr_collide_form.h" #define MAX_TRACE_ENEMY_RANGE 6.f diff --git a/src/xrGame/ai/monsters/monster_aura.cpp b/src/xrGame/ai/monsters/monster_aura.cpp index 953738cd688..52d0f3ccbf8 100644 --- a/src/xrGame/ai/monsters/monster_aura.cpp +++ b/src/xrGame/ai/monsters/monster_aura.cpp @@ -1,9 +1,8 @@ #include "stdafx.h" #include "monster_aura.h" #include "basemonster/base_monster.h" -#include "../../Actor.h" -#include "../../ActorEffector.h" -//#include "../../HudSound.h" +#include "Actor.h" +#include "ActorEffector.h" namespace detail { diff --git a/src/xrGame/ai/monsters/monster_corpse_manager.cpp b/src/xrGame/ai/monsters/monster_corpse_manager.cpp index 754210a1126..33f45072480 100644 --- a/src/xrGame/ai/monsters/monster_corpse_manager.cpp +++ b/src/xrGame/ai/monsters/monster_corpse_manager.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "monster_corpse_manager.h" #include "BaseMonster/base_monster.h" -#include "../../ai_object_location.h" +#include "ai_object_location.h" CMonsterCorpseManager::CMonsterCorpseManager() { diff --git a/src/xrGame/ai/monsters/monster_corpse_memory.cpp b/src/xrGame/ai/monsters/monster_corpse_memory.cpp index 98808d55ee3..0a36776d8f8 100644 --- a/src/xrGame/ai/monsters/monster_corpse_memory.cpp +++ b/src/xrGame/ai/monsters/monster_corpse_memory.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "monster_corpse_memory.h" #include "BaseMonster/base_monster.h" -#include "../../memory_manager.h" -#include "../../visual_memory_manager.h" -#include "../../item_manager.h" -#include "../../ai_object_location.h" +#include "memory_manager.h" +#include "visual_memory_manager.h" +#include "item_manager.h" +#include "ai_object_location.h" CMonsterCorpseMemory::CMonsterCorpseMemory() { diff --git a/src/xrGame/ai/monsters/monster_cover_manager.cpp b/src/xrGame/ai/monsters/monster_cover_manager.cpp index c780f4d945c..e42d9496737 100644 --- a/src/xrGame/ai/monsters/monster_cover_manager.cpp +++ b/src/xrGame/ai/monsters/monster_cover_manager.cpp @@ -1,16 +1,16 @@ #include "stdafx.h" #include "monster_cover_manager.h" #include "BaseMonster/base_monster.h" -#include "../../cover_evaluators.h" -#include "../../cover_point.h" -#include "../../ai_space.h" -#include "../../level_graph.h" -#include "../../game_graph.h" -#include "../../game_level_cross_table.h" -#include "../../level.h" -#include "../../level_debug.h" -#include "../../cover_manager.h" -#include "../../ai_object_location.h" +#include "cover_evaluators.h" +#include "cover_point.h" +#include "ai_space.h" +#include "level_graph.h" +#include "game_graph.h" +#include "game_level_cross_table.h" +#include "Level.h" +#include "level_debug.h" +#include "cover_manager.h" +#include "ai_object_location.h" #include "ai_monster_squad.h" #include "ai_monster_squad_manager.h" #include diff --git a/src/xrGame/ai/monsters/monster_enemy_manager.cpp b/src/xrGame/ai/monsters/monster_enemy_manager.cpp index 137d2190c44..32f57602b2e 100644 --- a/src/xrGame/ai/monsters/monster_enemy_manager.cpp +++ b/src/xrGame/ai/monsters/monster_enemy_manager.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "monster_enemy_manager.h" #include "BaseMonster/base_monster.h" -#include "../ai_monsters_misc.h" -#include "../../ai_object_location.h" -#include "../../memory_manager.h" -#include "../../visual_memory_manager.h" -#include "../../actor.h" -#include "../../actor_memory.h" +#include "ai/ai_monsters_misc.h" +#include "ai_object_location.h" +#include "memory_manager.h" +#include "visual_memory_manager.h" +#include "actor.h" +#include "actor_memory.h" CMonsterEnemyManager::CMonsterEnemyManager() { diff --git a/src/xrGame/ai/monsters/monster_enemy_memory.cpp b/src/xrGame/ai/monsters/monster_enemy_memory.cpp index d4d86cfedb2..cf800cb0bc6 100644 --- a/src/xrGame/ai/monsters/monster_enemy_memory.cpp +++ b/src/xrGame/ai/monsters/monster_enemy_memory.cpp @@ -1,16 +1,16 @@ #include "pch_script.h" #include "monster_enemy_memory.h" #include "BaseMonster/base_monster.h" -#include "../../memory_manager.h" -#include "../../visual_memory_manager.h" -#include "../../enemy_manager.h" -#include "../../ai_object_location.h" +#include "memory_manager.h" +#include "visual_memory_manager.h" +#include "enemy_manager.h" +#include "ai_object_location.h" #include "monster_home.h" #include "Dog/dog.h" #include "ai_monster_squad.h" #include "ai_monster_squad_manager.h" -#include "../../Actor.h" -#include "../../actor_memory.h" +#include "Actor.h" +#include "actor_memory.h" CMonsterEnemyMemory::CMonsterEnemyMemory() { diff --git a/src/xrGame/ai/monsters/monster_home.cpp b/src/xrGame/ai/monsters/monster_home.cpp index eb93b02c9aa..401541730be 100644 --- a/src/xrGame/ai/monsters/monster_home.cpp +++ b/src/xrGame/ai/monsters/monster_home.cpp @@ -1,15 +1,15 @@ #include "stdafx.h" #include "monster_home.h" #include "BaseMonster/base_monster.h" -#include "../../ai_space.h" -#include "../../patrol_path_storage.h" -#include "../../patrol_path.h" -#include "../../level_graph.h" -#include "../../cover_point.h" +#include "ai_space.h" +#include "patrol_path_storage.h" +#include "patrol_path.h" +#include "level_graph.h" +#include "cover_point.h" #include "monster_cover_manager.h" -#include "../../ai_object_location.h" -#include "../../restricted_object.h" -# include "../../game_graph.h" +#include "ai_object_location.h" +#include "restricted_object.h" +#include "game_graph.h" #ifdef _DEBUG diff --git a/src/xrGame/ai/monsters/monster_sound_memory.h b/src/xrGame/ai/monsters/monster_sound_memory.h index 208b2dd2ff0..be13e03bb49 100644 --- a/src/xrGame/ai/monsters/monster_sound_memory.h +++ b/src/xrGame/ai/monsters/monster_sound_memory.h @@ -1,7 +1,7 @@ #pragma once #include "ai_monster_defs.h" -#include "../../../xrServerEntities/ai_sounds.h" +#include "xrServerEntities/ai_sounds.h" class CBaseMonster; diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist.cpp index 53e56754769..5b5c1a34a4e 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist.cpp @@ -1,24 +1,24 @@ #include "stdafx.h" #include "poltergeist.h" #include "poltergeist_state_manager.h" -#include "../../../characterphysicssupport.h" -#include "../../../PHMovementControl.h" -#include "../../../PhysicsShellHolder.h" -#include "../../../ai_debug.h" +#include "CharacterPhysicsSupport.h" +#include "PHMovementControl.h" +#include "PhysicsShellHolder.h" +#include "ai_debug.h" #include "poltergeist_movement.h" -#include "../../../detail_path_manager.h" -#include "../monster_velocity_space.h" -#include "../../../level.h" -#include "../../../level_debug.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" -#include "../../../../xrphysics/PhysicsShell.h" -#include "../../../actor.h" -#include "../../../actor_memory.h" -#include "../../../visual_memory_manager.h" +#include "detail_path_manager.h" +#include "ai/monsters/monster_velocity_space.h" +#include "Level.h" +#include "level_debug.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" +#include "xrPhysics/PhysicsShell.h" +#include "Actor.h" +#include "actor_memory.h" +#include "visual_memory_manager.h" #include "ActorEffector.h" -#include "../../../ActorCondition.h" +#include "ActorCondition.h" void SetActorVisibility(u16 who, float value); diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist.h b/src/xrGame/ai/monsters/poltergeist/poltergeist.h index 4cead4abceb..8ca50ee15b8 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist.h @@ -1,8 +1,8 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../telekinesis.h" -#include "../energy_holder.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/telekinesis.h" +#include "ai/Monsters/energy_holder.h" +#include "xrServerEntities/script_export_space.h" class CPhysicsShellHolder; class CStateManagerPoltergeist; diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp index 3889ab714dd..2b3febfa4d9 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_ability.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "poltergeist.h" -#include "../../../../xrphysics/PhysicsShell.h" -#include "../../../level.h" -#include "../../../material_manager.h" -#include "../../../level_debug.h" +#include "xrPhysics/PhysicsShell.h" +#include "Level.h" +#include "material_manager.h" +#include "level_debug.h" CPolterSpecialAbility::CPolterSpecialAbility(CPoltergeist *polter) diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_flame_thrower.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist_flame_thrower.cpp index dac4b60d807..8f8c4c8741f 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_flame_thrower.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_flame_thrower.cpp @@ -1,14 +1,14 @@ #include "stdafx.h" #include "poltergeist.h" -#include "../../../../xrServerEntities/xrmessages.h" -#include "../../../ai_object_location.h" -#include "../../../level_graph.h" -#include "../../../level.h" -#include "../../../ai_space.h" -#include "../../../restricted_object.h" -#include "../../../actor.h" -#include "../../../actorEffector.h" -#include "../ai_monster_effector.h" +#include "xrServerEntities/xrmessages.h" +#include "ai_object_location.h" +#include "level_graph.h" +#include "Level.h" +#include "ai_space.h" +#include "restricted_object.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "ai/Monsters/ai_monster_effector.h" CPolterFlame::CPolterFlame(CPoltergeist *polter) : inherited (polter) { diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_movement.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist_movement.cpp index 8dec959bb1c..b712f821686 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_movement.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_movement.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "poltergeist_movement.h" #include "poltergeist.h" -#include "../../../detail_path_manager.h" +#include "detail_path_manager.h" void CPoltergeisMovementManager::move_along_path(CPHMovementControl *movement_control, Fvector &dest_position, float time_delta) { diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_movement.h b/src/xrGame/ai/monsters/poltergeist/poltergeist_movement.h index 2c79a5d0f6d..2960c4816cb 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_movement.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_movement.h @@ -1,6 +1,6 @@ #pragma once -#include "../control_path_builder.h" +#include "ai/Monsters/control_path_builder.h" class CPoltergeist; class CCustomMonster; diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden.h b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden.h index 655d5dd7bcd..871f621c0a3 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStatePoltergeistAttackHidden : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden_inline.h b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden_inline.h index b34186dc24e..4f1ebca6bdf 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden_inline.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_attack_hidden_inline.h @@ -1,7 +1,7 @@ #pragma once -#include "../../../sound_player.h" -#include "../../../../xrCore/_vector3d_ext.h" +#include "sound_player.h" +#include "xrCore/_vector3d_ext.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.cpp index 3c6a08a3981..fdc109096ef 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.cpp @@ -2,20 +2,20 @@ #include "poltergeist.h" #include "poltergeist_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" #include "poltergeist_state_rest.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" #include "poltergeist_state_attack_hidden.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../../../entitycondition.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "EntityCondition.h" CStateManagerPoltergeist::CStateManagerPoltergeist(CPoltergeist *obj) : inherited(obj) { diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.h b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.h index aca1ae7b1ff..73bd0cb54dd 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CPoltergeist; diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_rest.h b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_rest.h index 7bc313e9f35..abd97841399 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_state_rest.h +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_state_rest.h @@ -1,6 +1,6 @@ #pragma once -#include "../states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_rest.h" template class CPoltergeistStateRest : public CStateMonsterRest<_Object> { diff --git a/src/xrGame/ai/monsters/poltergeist/poltergeist_telekinesis.cpp b/src/xrGame/ai/monsters/poltergeist/poltergeist_telekinesis.cpp index bcea73c34c7..7ce9e2f6c0d 100644 --- a/src/xrGame/ai/monsters/poltergeist/poltergeist_telekinesis.cpp +++ b/src/xrGame/ai/monsters/poltergeist/poltergeist_telekinesis.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "poltergeist.h" -#include "../../../PhysicsShellHolder.h" -#include "../../../level.h" -#include "../../../actor.h" -#include "../../../../xrPhysics/icolisiondamageinfo.h" +#include "PhysicsShellHolder.h" +#include "Level.h" +#include "Actor.h" +#include "xrPhysics/icolisiondamageinfo.h" CPolterTele::CPolterTele(CPoltergeist *polter) : inherited (polter),m_pmt_object_collision_damage(0.5f) { } diff --git a/src/xrGame/ai/monsters/pseudodog/pseudodog.cpp b/src/xrGame/ai/monsters/pseudodog/pseudodog.cpp index 601a7ca9eeb..5c19b5bcf06 100644 --- a/src/xrGame/ai/monsters/pseudodog/pseudodog.cpp +++ b/src/xrGame/ai/monsters/pseudodog/pseudodog.cpp @@ -1,23 +1,23 @@ #include "stdafx.h" #include "pseudodog.h" #include "pseudodog_state_manager.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../sound_player.h" -#include "../../../level.h" -#include "../../../ai_monster_space.h" -#include "../monster_velocity_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "sound_player.h" +#include "Level.h" +#include "ai_monster_space.h" +#include "ai/monsters/monster_velocity_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" #ifdef _DEBUG # include -# include "../../../ai_object_location.h" -# include "../../../level_debug.h" -# include "../../../level_graph.h" -# include "../../../ai_space.h" -# include "../../../alife_simulator.h" -# include "../../../../xrServerEntities/xrServer_Object_Base.h" -# include "../../../xrserver.h" +# include "ai_object_location.h" +# include "level_debug.h" +# include "level_graph.h" +# include "ai_space.h" +# include "alife_simulator.h" +# include "xrServerEntities/xrServer_Object_Base.h" +# include "xrServer.h" #endif CAI_PseudoDog::CAI_PseudoDog() diff --git a/src/xrGame/ai/monsters/pseudodog/pseudodog.h b/src/xrGame/ai/monsters/pseudodog/pseudodog.h index dc56157aebf..a0d0cefa447 100644 --- a/src/xrGame/ai/monsters/pseudodog/pseudodog.h +++ b/src/xrGame/ai/monsters/pseudodog/pseudodog.h @@ -1,7 +1,7 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "xrServerEntities/script_export_space.h" class CAI_PseudoDog : public CBaseMonster { typedef CBaseMonster inherited; diff --git a/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.cpp b/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.cpp index 991f87da779..40b7b48d7df 100644 --- a/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.cpp +++ b/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.cpp @@ -1,22 +1,19 @@ #include "stdafx.h" -#include "pseudodog.h" -#include "pseudodog_state_manager.h" - -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" - -#include "../../../actor.h" -#include "../../stalker/ai_stalker.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" - +#include "ai/Monsters/Pseudodog/pseudodog.h" +#include "ai/Monsters/Pseudodog/pseudodog_state_manager.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" +#include "Actor.h" +#include "ai/stalker/ai_stalker.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" CStateManagerPseudodog::CStateManagerPseudodog(CAI_PseudoDog *monster) : inherited(monster) { diff --git a/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.h b/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.h index fddc7fda7ea..3e43399156e 100644 --- a/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.h +++ b/src/xrGame/ai/monsters/pseudodog/pseudodog_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CAI_PseudoDog; diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog.cpp b/src/xrGame/ai/monsters/pseudodog/psy_dog.cpp index ef1a3c827be..c795a6f9e55 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog.cpp +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog.cpp @@ -1,22 +1,22 @@ #include "stdafx.h" -#include "psy_dog.h" -#include "../../../level_graph.h" -#include "../../../ai_space.h" -#include "../../../alife_simulator.h" -#include "../../../../xrServerEntities/xrServer_Object_Base.h" -#include "../../../xrserver.h" -#include "../../../ai_object_location.h" -#include "../../../level.h" -#include "../control_movement_base.h" -#include "../monster_velocity_space.h" -#include "../../../restricted_object.h" -#include "../../../actor.h" -#include "../ai_monster_effector.h" -#include "../../../ActorEffector.h" -#include "psy_dog_aura.h" -#include "psy_dog_state_manager.h" -#include "../../../alife_object_registry.h" -#include "../../../../xrServerEntities/xrserver_objects_alife_monsters.h" +#include "ai/Monsters/Pseudodog/psy_dog.h" +#include "level_graph.h" +#include "ai_space.h" +#include "alife_simulator.h" +#include "xrServerEntities/xrServer_Object_Base.h" +#include "xrServer.h" +#include "ai_object_location.h" +#include "Level.h" +#include "ai/Monsters/control_movement_base.h" +#include "ai/Monsters/monster_velocity_space.h" +#include "restricted_object.h" +#include "Actor.h" +#include "ai/Monsters/ai_monster_effector.h" +#include "ActorEffector.h" +#include "ai/Monsters/Pseudodog/psy_dog_aura.h" +#include "ai/Monsters/Pseudodog/psy_dog_state_manager.h" +#include "alife_object_registry.h" +#include "xrServerEntities/xrserver_objects_alife_monsters.h" CPsyDog::CPsyDog() { diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog.h b/src/xrGame/ai/monsters/pseudodog/psy_dog.h index a4303fbb720..213a6714a7b 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog.h +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog.h @@ -1,6 +1,6 @@ #pragma once #include "pseudodog.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" class CPsyDogPhantom; diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog_aura.cpp b/src/xrGame/ai/monsters/pseudodog/psy_dog_aura.cpp index 1acc285257a..ba8ed80ed51 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog_aura.cpp +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog_aura.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" #include "psy_dog_aura.h" #include "psy_dog.h" -#include "../../../actor.h" -#include "../../../ActorEffector.h" -#include "../../../actor_memory.h" -#include "../../../visual_memory_manager.h" -#include "../../../level.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "actor_memory.h" +#include "visual_memory_manager.h" +#include "Level.h" CPPEffectorPsyDogAura::CPPEffectorPsyDogAura(const SPPInfo &ppi, u32 time_to_fade) : inherited(ppi) diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog_aura.h b/src/xrGame/ai/monsters/pseudodog/psy_dog_aura.h index de2115bf781..b196b708df8 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog_aura.h +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog_aura.h @@ -2,7 +2,7 @@ //////////////////////////////////////////////////////////////////////// // Effector controlling class //////////////////////////////////////////////////////////////////////// -#include "../../../pp_effector_custom.h" +#include "pp_effector_custom.h" class CPPEffectorPsyDogAura : public CPPEffectorCustom { typedef CPPEffectorCustom inherited; diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_manager.cpp b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_manager.cpp index d130c00afe6..ed47841dc7d 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_manager.cpp +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_manager.cpp @@ -1,14 +1,14 @@ #include "stdafx.h" #include "psy_dog.h" #include "psy_dog_state_manager.h" -#include "../../../actor.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" -#include "../control_animation_base.h" -#include "../../../ai_object_location.h" -#include "../../../sound_player.h" -#include "../../../level_graph.h" +#include "Actor.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai_object_location.h" +#include "sound_player.h" +#include "level_graph.h" #include "psy_dog_state_psy_attack.h" diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack.h b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack.h index 812092eaa37..236ef7a9227 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack.h +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStatePsyDogPsyAttack : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide_inline.h b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide_inline.h index 838572825aa..dd111caeb02 100644 --- a/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide_inline.h +++ b/src/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide_inline.h @@ -1,8 +1,8 @@ #pragma once -#include "../../../ai_space.h" -#include "../monster_cover_manager.h" -#include "../../../cover_point.h" +#include "ai_space.h" +#include "ai/monsters/monster_cover_manager.h" +#include "cover_point.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.cpp b/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.cpp index 16909a08634..1c32fc7bc83 100644 --- a/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.cpp +++ b/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.cpp @@ -1,21 +1,20 @@ #include "stdafx.h" -#include "pseudo_gigant.h" -#include "pseudo_gigant_step_effector.h" -#include "../../../actor.h" -#include "../../../ActorEffector.h" -#include "../../../level.h" +#include "ai/Monsters/PseudoGigant/pseudo_gigant.h" +#include "ai/Monsters/PseudoGigant/pseudo_gigant_step_effector.h" +#include "Actor.h" +#include "ActorEffector.h" +#include "Level.h" #include "pseudogigant_state_manager.h" -#include "../monster_velocity_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" -#include "../ai_monster_effector.h" -#include "../../../../xrEngine/CameraBase.h" -#include "../../../xr_level_controller.h" -#include "../../../detail_path_manager_space.h" -#include "../../../detail_path_manager.h" -#include "../../../CharacterPhysicsSupport.h" -#include "../control_path_builder_base.h" - +#include "ai/monsters/monster_velocity_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/Monsters/ai_monster_effector.h" +#include "xrEngine/CameraBase.h" +#include "xr_level_controller.h" +#include "detail_path_manager_space.h" +#include "detail_path_manager.h" +#include "CharacterPhysicsSupport.h" +#include "ai/monsters/control_path_builder_base.h" CPseudoGigant::CPseudoGigant() { diff --git a/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.h b/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.h index 228307ee37a..4f40d321453 100644 --- a/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.h +++ b/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant.h @@ -1,7 +1,7 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../controlled_entity.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/controlled_entity.h" +#include "xrServerEntities/script_export_space.h" class CPseudoGigant : public CBaseMonster, diff --git a/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant_step_effector.h b/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant_step_effector.h index 0a87ce4dec3..7bc5473aaa2 100644 --- a/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant_step_effector.h +++ b/src/xrGame/ai/monsters/pseudogigant/pseudo_gigant_step_effector.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../CameraEffector.h" +#include "CameraEffector.h" class CPseudogigantStepEffector : public CEffectorCam { typedef CEffectorCam inherited; diff --git a/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.cpp b/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.cpp index af2a2933b0a..4fa7200dc15 100644 --- a/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.cpp +++ b/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.cpp @@ -2,21 +2,21 @@ #include "pseudo_gigant.h" #include "pseudogigant_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../../../entitycondition.h" -#include "../states/monster_state_controlled.h" -#include "../states/monster_state_help_sound.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "EntityCondition.h" +#include "ai/Monsters/states/monster_state_controlled.h" +#include "ai/Monsters/states/monster_state_help_sound.h" CStateManagerGigant::CStateManagerGigant(CPseudoGigant *monster) : inherited(monster) { diff --git a/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.h b/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.h index 5f99d45834d..cac19f1b7ee 100644 --- a/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.h +++ b/src/xrGame/ai/monsters/pseudogigant/pseudogigant_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/monsters/monster_state_manager.h" class CPseudoGigant; diff --git a/src/xrGame/ai/monsters/psy_aura.h b/src/xrGame/ai/monsters/psy_aura.h index 4eab2e9d30c..a781e45f870 100644 --- a/src/xrGame/ai/monsters/psy_aura.h +++ b/src/xrGame/ai/monsters/psy_aura.h @@ -1,5 +1,5 @@ #pragma once -#include "../../../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" #include "energy_holder.h" class CBaseMonster; diff --git a/src/xrGame/ai/monsters/rats/ai_rat.cpp b/src/xrGame/ai/monsters/rats/ai_rat.cpp index 98532fee27d..356fdd432f6 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat.cpp @@ -7,44 +7,33 @@ //////////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "ai_rat.h" -#include "../../ai_monsters_misc.h" -#include "../../../../xrphysics/PhysicsShell.h" -#include "../../../game_graph.h" -#include "../../../game_level_cross_table.h" -#include "../../../../xrServerEntities/xrserver_objects_alife_monsters.h" - -#include "ai_rat_space.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../detail_path_manager.h" -#include "../../../ai_object_location.h" -#include "../../../movement_manager.h" -#include "../../../location_manager.h" -#include "../../../../xrServerEntities/ai_sounds.h" -#include "../../../sound_player.h" -#include "ai_rat_impl.h" -#include "../../../ai_space.h" - -#include "../../../rat_state_manager.h" -#include "../../../rat_states.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "ai/ai_monsters_misc.h" +#include "xrPhysics/PhysicsShell.h" +#include "game_graph.h" +#include "game_level_cross_table.h" +#include "xrServerEntities/xrserver_objects_alife_monsters.h" +#include "ai/Monsters/rats/ai_rat_space.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" +#include "ai_object_location.h" +#include "movement_manager.h" +#include "location_manager.h" +#include "xrServerEntities/ai_sounds.h" +#include "sound_player.h" +#include "ai/Monsters/rats/ai_rat_impl.h" +#include "ai_space.h" +#include "rat_state_manager.h" +#include "rat_states.h" #include "object_broker.h" -#include "../ai_monster_squad_manager.h" -#include "../ai_monster_squad.h" -#include "../../../patrol_path_storage.h" -#include "../../../patrol_path.h" -#include "../../../Actor.h" - - -#ifdef DEBUG -#endif +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "patrol_path_storage.h" +#include "patrol_path.h" +#include "Actor.h" using namespace RatSpace; -// #include "../../../steering_behaviour_manager.h" -// #include "../../../steering_behaviour_cohesion.h" -// #include "../../../steering_behaviour_alignment.h" -// #include "../../../steering_behaviour_separation.h" - CAI_Rat::CAI_Rat() : m_behaviour_manager (0) { diff --git a/src/xrGame/ai/monsters/rats/ai_rat.h b/src/xrGame/ai/monsters/rats/ai_rat.h index 14c5782f239..d49dba1879b 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat.h +++ b/src/xrGame/ai/monsters/rats/ai_rat.h @@ -7,14 +7,13 @@ //////////////////////////////////////////////////////////////////////////// #pragma once - -#include "../../../CustomMonster.h" -#include "../../../eatable_item.h" -#include "../../../seniority_hierarchy_holder.h" -#include "../../../team_hierarchy_holder.h" -#include "../../../squad_hierarchy_holder.h" -#include "../../../group_hierarchy_holder.h" -#include "../../../../xrServerEntities/game_graph_space.h" +#include "CustomMonster.h" +#include "eatable_item.h" +#include "seniority_hierarchy_holder.h" +#include "team_hierarchy_holder.h" +#include "squad_hierarchy_holder.h" +#include "group_hierarchy_holder.h" +#include "xrServerEntities/game_graph_space.h" class CBlend; class CPatrolPath; diff --git a/src/xrGame/ai/monsters/rats/ai_rat_animations.cpp b/src/xrGame/ai/monsters/rats/ai_rat_animations.cpp index db2b1f0fe22..667ce2802b6 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_animations.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat_animations.cpp @@ -7,10 +7,10 @@ //////////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "ai_rat.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../ai_debug.h" -#include "../../../movement_manager.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "ai_debug.h" +#include "movement_manager.h" #define MIN_TURN_ANGLE PI_DIV_6*.5f diff --git a/src/xrGame/ai/monsters/rats/ai_rat_feel.cpp b/src/xrGame/ai/monsters/rats/ai_rat_feel.cpp index bd65e6de5c9..db166210317 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_feel.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat_feel.cpp @@ -7,10 +7,10 @@ //////////////////////////////////////////////////////////////////////////// #include "pch_script.h" -#include "ai_rat.h" -#include "../../../memory_manager.h" -#include "../../../enemy_manager.h" -#include "../../../../xrServerEntities/ai_sounds.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "memory_manager.h" +#include "enemy_manager.h" +#include "xrServerEntities/ai_sounds.h" bool CAI_Rat::feel_vision_isRelevant(CObject* O) { diff --git a/src/xrGame/ai/monsters/rats/ai_rat_fire.cpp b/src/xrGame/ai/monsters/rats/ai_rat_fire.cpp index bee596d54ec..14c329c9ba8 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_fire.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat_fire.cpp @@ -7,13 +7,13 @@ //////////////////////////////////////////////////////////////////////////// #include "pch_script.h" -#include "ai_rat.h" -#include "ai_rat_impl.h" -#include "ai_rat_space.h" -#include "../../../memory_manager.h" -#include "../../../enemy_manager.h" -#include "../../../item_manager.h" -#include "../../../sound_player.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "ai/Monsters/rats/ai_rat_impl.h" +#include "ai/Monsters/rats/ai_rat_space.h" +#include "memory_manager.h" +#include "enemy_manager.h" +#include "item_manager.h" +#include "sound_player.h" using namespace RatSpace; diff --git a/src/xrGame/ai/monsters/rats/ai_rat_fsm.cpp b/src/xrGame/ai/monsters/rats/ai_rat_fsm.cpp index 1cbb57dc88a..5d8c6b8408b 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_fsm.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat_fsm.cpp @@ -7,22 +7,22 @@ //////////////////////////////////////////////////////////////////////////// #include "pch_script.h" -#include "ai_rat.h" -#include "../../ai_monsters_misc.h" -#include "../../../game_level_cross_table.h" -#include "../../../game_graph.h" -#include "ai_rat_space.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../detail_path_manager.h" -#include "../../../memory_manager.h" -#include "../../../enemy_manager.h" -#include "../../../item_manager.h" -#include "../../../memory_space.h" -#include "../../../ai_object_location.h" -#include "../../../movement_manager.h" -#include "../../../sound_player.h" -#include "ai_rat_impl.h" -#include "../../../ai_space.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "ai/ai_monsters_misc.h" +#include "game_level_cross_table.h" +#include "game_graph.h" +#include "ai/Monsters/rats/ai_rat_space.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" +#include "memory_manager.h" +#include "enemy_manager.h" +#include "item_manager.h" +#include "memory_space.h" +#include "ai_object_location.h" +#include "movement_manager.h" +#include "sound_player.h" +#include "ai/Monsters/rats/ai_rat_impl.h" +#include "ai_space.h" using namespace RatSpace; diff --git a/src/xrGame/ai/monsters/rats/ai_rat_impl.h b/src/xrGame/ai/monsters/rats/ai_rat_impl.h index d2388d4d2f6..fdb76da1855 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_impl.h +++ b/src/xrGame/ai/monsters/rats/ai_rat_impl.h @@ -7,13 +7,12 @@ //////////////////////////////////////////////////////////////////////////// #pragma once - -#include "../../../level.h" -#include "../../../seniority_hierarchy_holder.h" -#include "../../../team_hierarchy_holder.h" -#include "../../../squad_hierarchy_holder.h" -#include "../../../group_hierarchy_holder.h" -#include "../../../../xrServerEntities/ai_sounds.h" +#include "Level.h" +#include "seniority_hierarchy_holder.h" +#include "team_hierarchy_holder.h" +#include "squad_hierarchy_holder.h" +#include "group_hierarchy_holder.h" +#include "xrServerEntities/ai_sounds.h" IC void CAI_Rat::add_active_member (bool bForceActive) { diff --git a/src/xrGame/ai/monsters/rats/ai_rat_templates.cpp b/src/xrGame/ai/monsters/rats/ai_rat_templates.cpp index f3ddabe7d69..20b08d4ab0b 100644 --- a/src/xrGame/ai/monsters/rats/ai_rat_templates.cpp +++ b/src/xrGame/ai/monsters/rats/ai_rat_templates.cpp @@ -7,23 +7,23 @@ //////////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "ai_rat.h" -#include "../../ai_monsters_misc.h" -#include "../../../game_graph.h" -#include "../../../magic_box3.h" -#include "../../../../Include/xrRender/RenderVisual.h" -#include "../../../ai_object_location.h" -#include "../../../level_graph.h" -#include "../../../movement_manager.h" -#include "../../../location_manager.h" -#include "../../../level.h" -#include "../../../random32.h" -#include "../../../ai_space.h" -#include "../../../restricted_object.h" -#include "../../../patrol_path.h" -#include "../../../debug_renderer.h" -#include "../ai_monster_squad_manager.h" -#include "../ai_monster_squad.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "ai/ai_monsters_misc.h" +#include "game_graph.h" +#include "magic_box3.h" +#include "Include/xrRender/RenderVisual.h" +#include "ai_object_location.h" +#include "level_graph.h" +#include "movement_manager.h" +#include "location_manager.h" +#include "Level.h" +#include "random32.h" +#include "ai_space.h" +#include "restricted_object.h" +#include "patrol_path.h" +#include "debug_renderer.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "ai/Monsters/ai_monster_squad.h" IC bool CAI_Rat::bfCheckIfOutsideAIMap(Fvector &tTemp1) { diff --git a/src/xrGame/ai/monsters/rats/rat_state_activation.cpp b/src/xrGame/ai/monsters/rats/rat_state_activation.cpp index 93b4b756b31..319b6e9e3ab 100644 --- a/src/xrGame/ai/monsters/rats/rat_state_activation.cpp +++ b/src/xrGame/ai/monsters/rats/rat_state_activation.cpp @@ -1,20 +1,20 @@ #include "pch_script.h" -#include "ai_rat.h" -#include "../../ai_monsters_misc.h" -#include "../../../game_level_cross_table.h" -#include "../../../game_graph.h" -#include "ai_rat_space.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../detail_path_manager.h" -#include "../../../memory_manager.h" -#include "../../../enemy_manager.h" -#include "../../../item_manager.h" -#include "../../../memory_space.h" -#include "../../../ai_object_location.h" -#include "../../../movement_manager.h" -#include "../../../sound_player.h" -#include "ai_rat_impl.h" -#include "../../../ai_space.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "ai/ai_monsters_misc.h" +#include "game_level_cross_table.h" +#include "game_graph.h" +#include "ai/Monsters/rats/ai_rat_space.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" +#include "memory_manager.h" +#include "enemy_manager.h" +#include "item_manager.h" +#include "memory_space.h" +#include "ai_object_location.h" +#include "movement_manager.h" +#include "sound_player.h" +#include "ai/Monsters/rats/ai_rat_impl.h" +#include "ai_space.h" using namespace RatSpace; diff --git a/src/xrGame/ai/monsters/rats/rat_state_initialize.cpp b/src/xrGame/ai/monsters/rats/rat_state_initialize.cpp index e2f62f8785f..3a0bb0d77cb 100644 --- a/src/xrGame/ai/monsters/rats/rat_state_initialize.cpp +++ b/src/xrGame/ai/monsters/rats/rat_state_initialize.cpp @@ -1,20 +1,20 @@ #include "pch_script.h" -#include "ai_rat.h" -#include "../../ai_monsters_misc.h" -#include "../../../game_level_cross_table.h" -#include "../../../game_graph.h" -#include "ai_rat_space.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../detail_path_manager.h" -#include "../../../memory_manager.h" -#include "../../../enemy_manager.h" -#include "../../../item_manager.h" -#include "../../../memory_space.h" -#include "../../../ai_object_location.h" -#include "../../../movement_manager.h" -#include "../../../sound_player.h" -#include "ai_rat_impl.h" -#include "../../../ai_space.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "ai/ai_monsters_misc.h" +#include "game_level_cross_table.h" +#include "game_graph.h" +#include "ai/Monsters/rats/ai_rat_space.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" +#include "memory_manager.h" +#include "enemy_manager.h" +#include "item_manager.h" +#include "memory_space.h" +#include "ai_object_location.h" +#include "movement_manager.h" +#include "sound_player.h" +#include "ai/Monsters/rats/ai_rat_impl.h" +#include "ai_space.h" void CAI_Rat::init_state_under_fire() { diff --git a/src/xrGame/ai/monsters/rats/rat_state_switch.cpp b/src/xrGame/ai/monsters/rats/rat_state_switch.cpp index f8d6d2d2a5a..80cebb74087 100644 --- a/src/xrGame/ai/monsters/rats/rat_state_switch.cpp +++ b/src/xrGame/ai/monsters/rats/rat_state_switch.cpp @@ -1,22 +1,22 @@ #include "pch_script.h" -#include "ai_rat.h" -#include "../../ai_monsters_misc.h" -#include "../../../game_level_cross_table.h" -#include "../../../game_graph.h" +#include "ai/Monsters/rats/ai_rat.h" +#include "ai/ai_monsters_misc.h" +#include "game_level_cross_table.h" +#include "game_graph.h" #include "ai_rat_space.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../detail_path_manager.h" -#include "../../../memory_manager.h" -#include "../../../enemy_manager.h" -#include "../../../item_manager.h" -#include "../../../memory_space.h" -#include "../../../ai_object_location.h" -#include "../../../movement_manager.h" -#include "../../../sound_player.h" -#include "ai_rat_impl.h" -#include "../../../ai_space.h" -#include "ai/monsters/ai_monster_squad_manager.h" -#include "ai/monsters/ai_monster_squad.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "detail_path_manager.h" +#include "memory_manager.h" +#include "enemy_manager.h" +#include "item_manager.h" +#include "memory_space.h" +#include "ai_object_location.h" +#include "movement_manager.h" +#include "sound_player.h" +#include "ai/Monsters/rats/ai_rat_impl.h" +#include "ai_space.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "ai/Monsters/ai_monster_squad.h" bool CAI_Rat::switch_to_attack_melee() { diff --git a/src/xrGame/ai/monsters/snork/snork.cpp b/src/xrGame/ai/monsters/snork/snork.cpp index 3a74f77060f..29d1d146789 100644 --- a/src/xrGame/ai/monsters/snork/snork.cpp +++ b/src/xrGame/ai/monsters/snork/snork.cpp @@ -1,27 +1,23 @@ #include "stdafx.h" -#include "snork.h" -#include "snork_state_manager.h" -#include "../../../detail_path_manager_space.h" -#include "../../../detail_path_manager.h" -#include "../../../level.h" -#include "../monster_velocity_space.h" -#include "../../../sound_player.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" -#include "../../../PHMovementControl.h" - +#include "ai/Monsters/snork/snork.h" +#include "ai/Monsters/snork/snork_state_manager.h" +#include "detail_path_manager_space.h" +#include "detail_path_manager.h" +#include "Level.h" +#include "ai/monsters/monster_velocity_space.h" +#include "sound_player.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" +#include "PHMovementControl.h" #ifdef _DEBUG -# include -# include "../../../actor.h" -# include "../../../ai_object_location.h" -# include "../../../level_debug.h" -# include "../../../cover_point.h" -# include "../monster_cover_manager.h" +#include +#include "Actor.h" +#include "ai_object_location.h" +#include "level_debug.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" #endif - - - CSnork::CSnork() { StateMan = xr_new (this); diff --git a/src/xrGame/ai/monsters/snork/snork.h b/src/xrGame/ai/monsters/snork/snork.h index 60b75b9e7e3..fcbfdc53464 100644 --- a/src/xrGame/ai/monsters/snork/snork.h +++ b/src/xrGame/ai/monsters/snork/snork.h @@ -1,6 +1,6 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "xrServerEntities/script_export_space.h" class CSnork : public CBaseMonster { typedef CBaseMonster inherited; diff --git a/src/xrGame/ai/monsters/snork/snork_jump.cpp b/src/xrGame/ai/monsters/snork/snork_jump.cpp index 7fe6ba97c6d..d5dacb07f98 100644 --- a/src/xrGame/ai/monsters/snork/snork_jump.cpp +++ b/src/xrGame/ai/monsters/snork/snork_jump.cpp @@ -1,9 +1,8 @@ #include "stdafx.h" -#include "snork.h" -#include "snork_jump.h" -//#include "../jump_ability.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../level.h" +#include "ai/Monsters/snork/snork.h" +#include "ai/Monsters/snork/snork_jump.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Level.h" //CSnorkJump::CSnorkJump(CSnork *monster) //{ diff --git a/src/xrGame/ai/monsters/snork/snork_state_manager.cpp b/src/xrGame/ai/monsters/snork/snork_state_manager.cpp index 82e7f726f04..dd455f4c1fa 100644 --- a/src/xrGame/ai/monsters/snork/snork_state_manager.cpp +++ b/src/xrGame/ai/monsters/snork/snork_state_manager.cpp @@ -2,26 +2,26 @@ #include "snork.h" #include "snork_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" - -#include "../../../level.h" -#include "../../../level_debug.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../states/state_look_point.h" -#include "../states/state_test_look_actor.h" -#include "../states/state_test_state.h" -#include "../states/monster_state_help_sound.h" - -#include "../../../entitycondition.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" + +#include "Level.h" +#include "level_debug.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "ai/Monsters/states/state_look_point.h" +#include "ai/Monsters/states/state_test_look_actor.h" +#include "ai/Monsters/states/state_test_state.h" +#include "ai/Monsters/states/monster_state_help_sound.h" + +#include "EntityCondition.h" CStateManagerSnork::CStateManagerSnork(CSnork *obj) : inherited(obj) { diff --git a/src/xrGame/ai/monsters/snork/snork_state_manager.h b/src/xrGame/ai/monsters/snork/snork_state_manager.h index 44c6ea2539a..1c7e20cd4d0 100644 --- a/src/xrGame/ai/monsters/snork/snork_state_manager.h +++ b/src/xrGame/ai/monsters/snork/snork_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/Monsters/monster_state_manager.h" class CSnork; diff --git a/src/xrGame/ai/monsters/states/monster_state_attack.h b/src/xrGame/ai/monsters/states/monster_state_attack.h index 9d9fd6fd8fb..718a587fcb9 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack.h @@ -1,7 +1,7 @@ #pragma once -#include "../state.h" -#include "../../../ai_debug.h" +#include "ai/Monsters/state.h" +#include "ai_debug.h" template class CStateMonsterAttack : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_camp.h b/src/xrGame/ai/monsters/states/monster_state_attack_camp.h index 981c153a50f..89a6b9e5429 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_camp.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_camp.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterAttackCamp : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_camp_inline.h b/src/xrGame/ai/monsters/states/monster_state_attack_camp_inline.h index 6296e41daef..b46e80aef21 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_camp_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_camp_inline.h @@ -3,8 +3,8 @@ #include "state_move_to_point.h" #include "state_look_point.h" #include "monster_state_attack_camp_stealout.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_inline.h b/src/xrGame/ai/monsters/states/monster_state_attack_inline.h index 7f34f102c89..2f3398b8b0c 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_inline.h @@ -9,11 +9,9 @@ #include "monster_state_steal.h" #include "monster_state_attack_camp.h" #include "monster_state_home_point_attack.h" - -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" - -#include "../../../actor.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "Actor.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_melee.h b/src/xrGame/ai/monsters/states/monster_state_attack_melee.h index dcf95eadbd3..4c38bd54e14 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_melee.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_melee.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterAttackMelee : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_on_run.h b/src/xrGame/ai/monsters/states/monster_state_attack_on_run.h index 5b66fad32c2..d1ad950d4d4 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_on_run.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_on_run.h @@ -1,9 +1,9 @@ #ifndef MONSTER_STATE_ATTACK_ON_RUN_H #define MONSTER_STATE_ATTACK_ON_RUN_H -#include "../state.h" +#include "ai/Monsters/state.h" -#include "../../weighted_random.h" +#include "ai/weighted_random.h" inline TTime current_time () { return Device.dwTimeGlobal; } diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_on_run_inline.h b/src/xrGame/ai/monsters/states/monster_state_attack_on_run_inline.h index e9744380146..dbc02f47f7b 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_on_run_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_on_run_inline.h @@ -1,10 +1,10 @@ #ifndef MONSTER_STATE_ATTACK_ON_RUN_INLINE_H #define MONSTER_STATE_ATTACK_ON_RUN_INLINE_H -#include "../monster_velocity_space.h" +#include "ai/monsters/monster_velocity_space.h" -#include "../../../../xrCore/_vector3d_ext.h" -#include "../../../level_graph.h" +#include "xrCore/_vector3d_ext.h" +#include "level_graph.h" #define TEMPLATE_SIGNATURE template @@ -96,8 +96,8 @@ bool ATTACK_ON_RUN_STATE::check_control_start_conditions (ControlCom::EControl return true; } -#include "../../../level_debug.h" -#include "../../../debug_text_tree.h" +#include "level_debug.h" +#include "debug_text_tree.h" TEMPLATE_SIGNATURE void ATTACK_ON_RUN_STATE::set_movement_phaze (phaze const new_phaze) @@ -435,7 +435,7 @@ void ATTACK_ON_RUN_STATE::select_prepare_fallback_target () m_target = ai().level_graph().vertex_position(m_target_vertex); } -#include "../../../ai_debug_variables.h" +#include "ai_debug_variables.h" TEMPLATE_SIGNATURE void ATTACK_ON_RUN_STATE::update_try_min_time () diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_run.h b/src/xrGame/ai/monsters/states/monster_state_attack_run.h index aa1fb53f8df..5a2f1c27844 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_run.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_run.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterAttackRun : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_run_attack.h b/src/xrGame/ai/monsters/states/monster_state_attack_run_attack.h index f05ed9520c5..e7b4fae56a7 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_run_attack.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_run_attack.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterAttackRunAttack : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_run_attack_inline.h b/src/xrGame/ai/monsters/states/monster_state_attack_run_attack_inline.h index f7a449c02cc..5e371903f0d 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_run_attack_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_run_attack_inline.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_velocity_space.h" +#include "ai/monsters/monster_velocity_space.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/monster_state_attack_run_inline.h b/src/xrGame/ai/monsters/states/monster_state_attack_run_inline.h index 3213c24ec5d..42f3a193a6c 100644 --- a/src/xrGame/ai/monsters/states/monster_state_attack_run_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_attack_run_inline.h @@ -1,7 +1,7 @@ #pragma once -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/monster_state_controlled.h b/src/xrGame/ai/monsters/states/monster_state_controlled.h index 97f82ef4519..f96b5ee89a1 100644 --- a/src/xrGame/ai/monsters/states/monster_state_controlled.h +++ b/src/xrGame/ai/monsters/states/monster_state_controlled.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterControlled : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_controlled_attack.h b/src/xrGame/ai/monsters/states/monster_state_controlled_attack.h index 08656a5277d..fb52f07b504 100644 --- a/src/xrGame/ai/monsters/states/monster_state_controlled_attack.h +++ b/src/xrGame/ai/monsters/states/monster_state_controlled_attack.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" #include "monster_state_attack.h" template diff --git a/src/xrGame/ai/monsters/states/monster_state_controlled_follow.h b/src/xrGame/ai/monsters/states/monster_state_controlled_follow.h index d0286e2c4f2..6403f0ef2e1 100644 --- a/src/xrGame/ai/monsters/states/monster_state_controlled_follow.h +++ b/src/xrGame/ai/monsters/states/monster_state_controlled_follow.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterControlledFollow : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_eat.h b/src/xrGame/ai/monsters/states/monster_state_eat.h index 11c2a548a9d..d836e7bd942 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterEat : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_eat_drag_inline.h b/src/xrGame/ai/monsters/states/monster_state_eat_drag_inline.h index ec59f5538fa..6725addac19 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat_drag_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat_drag_inline.h @@ -1,7 +1,6 @@ #pragma once -//#include "../../../PHCharacter.h" -#include "../../../../xrphysics/IPHCapture.h" +#include "xrPhysics/IPHCapture.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/monster_state_eat_eat.h b/src/xrGame/ai/monsters/states/monster_state_eat_eat.h index dac18406f3e..a29da15d955 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat_eat.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat_eat.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterEating : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_eat_inline.h b/src/xrGame/ai/monsters/states/monster_state_eat_inline.h index 3cc552dd3f4..2ceedf50850 100644 --- a/src/xrGame/ai/monsters/states/monster_state_eat_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_eat_inline.h @@ -6,12 +6,12 @@ #include "state_custom_action.h" #include "monster_state_eat_eat.h" #include "monster_state_eat_drag.h" -#include "../../../../xrphysics/PhysicsShell.h" -#include "../../../PHMovementControl.h" -#include "../../../CharacterPhysicsSupport.h" +#include "xrPhysics/PhysicsShell.h" +#include "PHMovementControl.h" +#include "CharacterPhysicsSupport.h" #ifdef _DEBUG -# include "../../../level.h" -# include "../../../level_debug.h" +# include "Level.h" +# include "level_debug.h" #endif #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy.h index 140c3e02bee..e0346829b6d 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy_angry.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy_angry.h index 699a6bfd920..971792fb118 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy_angry.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy_angry.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterFindEnemyAngry : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy_look.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy_look.h index 11465345984..f10c9d8343a 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy_look.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy_look.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterFindEnemyLook : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy_run.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy_run.h index 285fe2393ca..1c08ef5307e 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy_run.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy_run.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterFindEnemyRun : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_find_enemy_walk.h b/src/xrGame/ai/monsters/states/monster_state_find_enemy_walk.h index f8c70cac3e0..36568684671 100644 --- a/src/xrGame/ai/monsters/states/monster_state_find_enemy_walk.h +++ b/src/xrGame/ai/monsters/states/monster_state_find_enemy_walk.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterFindEnemyWalkAround : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_hear_danger_sound.h b/src/xrGame/ai/monsters/states/monster_state_hear_danger_sound.h index fe9c3354749..6362c52ab3c 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hear_danger_sound.h +++ b/src/xrGame/ai/monsters/states/monster_state_hear_danger_sound.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterHearDangerousSound : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_hear_int_sound.h b/src/xrGame/ai/monsters/states/monster_state_hear_int_sound.h index ec09dce5a85..1e8869c2e2c 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hear_int_sound.h +++ b/src/xrGame/ai/monsters/states/monster_state_hear_int_sound.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterHearInterestingSound : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_help_sound.h b/src/xrGame/ai/monsters/states/monster_state_help_sound.h index 0a0c5810109..cf317b68487 100644 --- a/src/xrGame/ai/monsters/states/monster_state_help_sound.h +++ b/src/xrGame/ai/monsters/states/monster_state_help_sound.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterHearHelpSound : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_hitted.h b/src/xrGame/ai/monsters/states/monster_state_hitted.h index 5d848184f78..189098ee713 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hitted.h +++ b/src/xrGame/ai/monsters/states/monster_state_hitted.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterHitted : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_hitted_moveout.h b/src/xrGame/ai/monsters/states/monster_state_hitted_moveout.h index 68dc387a4d3..aec3bedc56b 100644 --- a/src/xrGame/ai/monsters/states/monster_state_hitted_moveout.h +++ b/src/xrGame/ai/monsters/states/monster_state_hitted_moveout.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../detail_path_manager.h" +#include "detail_path_manager.h" template class CStateMonsterHittedMoveOut : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_attack.h b/src/xrGame/ai/monsters/states/monster_state_home_point_attack.h index 7d15d82154d..b92190db9c3 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_attack.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_attack.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterAttackMoveToHomePoint : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_attack_inline.h b/src/xrGame/ai/monsters/states/monster_state_home_point_attack_inline.h index 492a493cba1..3794eae8d31 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_attack_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_attack_inline.h @@ -3,9 +3,9 @@ #include "state_move_to_point.h" #include "state_look_point.h" #include "state_custom_action.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" -#include "../monster_home.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" +#include "ai/Monsters/monster_home.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_danger.h b/src/xrGame/ai/monsters/states/monster_state_home_point_danger.h index 9e52bfc20be..5c8050309b3 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_danger.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_danger.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterDangerMoveToHomePoint : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_danger_inline.h b/src/xrGame/ai/monsters/states/monster_state_home_point_danger_inline.h index 65d5db3cc91..d6122a5bc78 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_danger_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_danger_inline.h @@ -3,9 +3,9 @@ #include "state_move_to_point.h" #include "state_look_point.h" #include "state_custom_action.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" -#include "../monster_home.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" +#include "ai/Monsters/monster_home.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_rest.h b/src/xrGame/ai/monsters/states/monster_state_home_point_rest.h index ba67ddf0634..aff925b7976 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_rest.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_rest.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterRestMoveToHomePoint : public CStateMove<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_home_point_rest_inline.h b/src/xrGame/ai/monsters/states/monster_state_home_point_rest_inline.h index fadd7316adb..639a86475a5 100644 --- a/src/xrGame/ai/monsters/states/monster_state_home_point_rest_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_home_point_rest_inline.h @@ -1,6 +1,6 @@ #pragma once -#include "../monster_home.h" +#include "ai/Monsters/monster_home.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/monster_state_panic.h b/src/xrGame/ai/monsters/states/monster_state_panic.h index 386071b6651..cd70d750ef2 100644 --- a/src/xrGame/ai/monsters/states/monster_state_panic.h +++ b/src/xrGame/ai/monsters/states/monster_state_panic.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterPanic : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_rest.h b/src/xrGame/ai/monsters/states/monster_state_rest.h index b1e77cac5ff..c2b2f2cb1a5 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest.h @@ -1,7 +1,7 @@ #pragma once -#include "../state.h" -#include "../../../entitycondition.h" +#include "ai/Monsters/state.h" +#include "EntityCondition.h" template class CStateMonsterRest : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_fun.h b/src/xrGame/ai/monsters/states/monster_state_rest_fun.h index 6a85f496632..cb24a1da416 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_fun.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_fun.h @@ -1,7 +1,7 @@ #pragma once -#include "../state.h" -#include "../../../ai_debug.h" +#include "ai/Monsters/state.h" +#include "ai_debug.h" template class CStateMonsterRestFun : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_fun_inline.h b/src/xrGame/ai/monsters/states/monster_state_rest_fun_inline.h index 1aa3d5bd49f..bae49f03bb8 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_fun_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_fun_inline.h @@ -1,8 +1,5 @@ #pragma once - -#include "../../../../xrphysics/PhysicsShell.h" -//#include "../../../PHInterpolation.h" -//#include "../../../PHElement.h" +#include "xrPhysics/PhysicsShell.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_idle.h b/src/xrGame/ai/monsters/states/monster_state_rest_idle.h index 52c144bf130..4a68d91ca96 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_idle.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_idle.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterRestIdle : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_idle_inline.h b/src/xrGame/ai/monsters/states/monster_state_rest_idle_inline.h index 698e88b8877..3d8e8ab3e2f 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_idle_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_idle_inline.h @@ -3,8 +3,8 @@ #include "state_move_to_point.h" #include "state_look_point.h" #include "state_custom_action.h" -#include "../../../cover_point.h" -#include "../monster_cover_manager.h" +#include "cover_point.h" +#include "ai/monsters/monster_cover_manager.h" #define TEMPLATE_SPECIALIZATION template <\ diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_inline.h b/src/xrGame/ai/monsters/states/monster_state_rest_inline.h index 5115b942275..58a5b7c2677 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_inline.h @@ -1,5 +1,4 @@ #pragma once - #include "monster_state_rest_sleep.h" #include "monster_state_rest_walk_graph.h" #include "monster_state_rest_idle.h" @@ -7,9 +6,9 @@ #include "monster_state_squad_rest.h" #include "monster_state_squad_rest_follow.h" #include "state_move_to_restrictor.h" -#include "../ai_monster_squad.h" -#include "../ai_monster_squad_manager.h" -#include "../anomaly_detector.h" +#include "ai/Monsters/ai_monster_squad.h" +#include "ai/Monsters/ai_monster_squad_manager.h" +#include "ai/Monsters/anomaly_detector.h" #include "monster_state_home_point_rest.h" #include "monster_state_smart_terrain_task.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_sleep.h b/src/xrGame/ai/monsters/states/monster_state_rest_sleep.h index 91a441fd900..8a3730f526b 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_sleep.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_sleep.h @@ -1,7 +1,7 @@ #pragma once -#include "../state.h" -#include "../../../ai_debug.h" +#include "ai/Monsters/state.h" +#include "ai_debug.h" template class CStateMonsterRestSleep : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_rest_walk_graph.h b/src/xrGame/ai/monsters/states/monster_state_rest_walk_graph.h index 86b0e1c5c40..1ae5619f64c 100644 --- a/src/xrGame/ai/monsters/states/monster_state_rest_walk_graph.h +++ b/src/xrGame/ai/monsters/states/monster_state_rest_walk_graph.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterRestWalkGraph : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task.h b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task.h index ca846af9393..405f121d513 100644 --- a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task.h +++ b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task.h @@ -1,7 +1,6 @@ #pragma once -#include "../state.h" - -#include "../../../alife_smart_terrain_task.h" +#include "ai/Monsters/state.h" +#include "alife_smart_terrain_task.h" template class CStateMonsterSmartTerrainTask : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_graph_walk.h b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_graph_walk.h index 8a621cafe48..935a05542be 100644 --- a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_graph_walk.h +++ b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_graph_walk.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterSmartTerrainTaskGraphWalk : public CStateMove<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_inline.h b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_inline.h index 0b95b7cfde5..ebbade5fc26 100644 --- a/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_smart_terrain_task_inline.h @@ -1,10 +1,8 @@ #pragma once - -#include "../../../alife_simulator.h" -#include "../../../alife_object_registry.h" -#include "../../../../xrServerEntities/xrserver_objects_alife_monsters.h" -#include "../../../../xrServerEntities/alife_monster_brain.h" - +#include "alife_simulator.h" +#include "alife_object_registry.h" +#include "xrServerEntities/xrserver_objects_alife_monsters.h" +#include "xrServerEntities/alife_monster_brain.h" #include "state_move_to_point.h" #include "state_custom_action.h" #include "monster_state_smart_terrain_task_graph_walk.h" diff --git a/src/xrGame/ai/monsters/states/monster_state_squad_rest.h b/src/xrGame/ai/monsters/states/monster_state_squad_rest.h index d7c427c09aa..4779e255f58 100644 --- a/src/xrGame/ai/monsters/states/monster_state_squad_rest.h +++ b/src/xrGame/ai/monsters/states/monster_state_squad_rest.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterSquadRest : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_squad_rest_follow.h b/src/xrGame/ai/monsters/states/monster_state_squad_rest_follow.h index f034b82cbe5..76ed573a5aa 100644 --- a/src/xrGame/ai/monsters/states/monster_state_squad_rest_follow.h +++ b/src/xrGame/ai/monsters/states/monster_state_squad_rest_follow.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterSquadRestFollow : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/monster_state_squad_rest_inline.h b/src/xrGame/ai/monsters/states/monster_state_squad_rest_inline.h index cedc615e51f..d8c141fe533 100644 --- a/src/xrGame/ai/monsters/states/monster_state_squad_rest_inline.h +++ b/src/xrGame/ai/monsters/states/monster_state_squad_rest_inline.h @@ -1,11 +1,10 @@ #pragma once - -#include "../../../ai_space.h" -#include "../../../level_graph.h" -#include "../../../ai_object_location.h" +#include "ai_space.h" +#include "level_graph.h" +#include "ai_object_location.h" #include "state_custom_action.h" #include "state_move_to_point.h" -#include "../../../restricted_object.h" +#include "restricted_object.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/monster_state_steal.h b/src/xrGame/ai/monsters/states/monster_state_steal.h index 431a9e2b75f..74e28699e4e 100644 --- a/src/xrGame/ai/monsters/states/monster_state_steal.h +++ b/src/xrGame/ai/monsters/states/monster_state_steal.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterSteal : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/state_custom_action.h b/src/xrGame/ai/monsters/states/state_custom_action.h index 389bbb5c54e..f40e15a90e8 100644 --- a/src/xrGame/ai/monsters/states/state_custom_action.h +++ b/src/xrGame/ai/monsters/states/state_custom_action.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" #include "state_data.h" template diff --git a/src/xrGame/ai/monsters/states/state_custom_action_look.h b/src/xrGame/ai/monsters/states/state_custom_action_look.h index 407893f35b8..d10b2d348c4 100644 --- a/src/xrGame/ai/monsters/states/state_custom_action_look.h +++ b/src/xrGame/ai/monsters/states/state_custom_action_look.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" #include "state_data.h" template diff --git a/src/xrGame/ai/monsters/states/state_hide_from_point.h b/src/xrGame/ai/monsters/states/state_hide_from_point.h index 99a76a60fec..7841d7b0a99 100644 --- a/src/xrGame/ai/monsters/states/state_hide_from_point.h +++ b/src/xrGame/ai/monsters/states/state_hide_from_point.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" #include "state_data.h" template diff --git a/src/xrGame/ai/monsters/states/state_hit_object.h b/src/xrGame/ai/monsters/states/state_hit_object.h index b755bc10bf2..d6985845b22 100644 --- a/src/xrGame/ai/monsters/states/state_hit_object.h +++ b/src/xrGame/ai/monsters/states/state_hit_object.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterHitObject : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/state_look_point.h b/src/xrGame/ai/monsters/states/state_look_point.h index 34474804c66..c186f555433 100644 --- a/src/xrGame/ai/monsters/states/state_look_point.h +++ b/src/xrGame/ai/monsters/states/state_look_point.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" #include "state_data.h" template diff --git a/src/xrGame/ai/monsters/states/state_look_unprotected_area.h b/src/xrGame/ai/monsters/states/state_look_unprotected_area.h index 14b98eefc77..b0d6664a0e7 100644 --- a/src/xrGame/ai/monsters/states/state_look_unprotected_area.h +++ b/src/xrGame/ai/monsters/states/state_look_unprotected_area.h @@ -1,9 +1,9 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" #include "state_data.h" -#include "../../../ai_object_location.h" -#include "../../../ai_space.h" -#include "../../../level_graph.h" +#include "ai_object_location.h" +#include "ai_space.h" +#include "level_graph.h" template class CStateMonsterLookToUnprotectedArea : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/state_look_unprotected_area_inline.h b/src/xrGame/ai/monsters/states/state_look_unprotected_area_inline.h index 9e7b1d19f46..3dda6900c95 100644 --- a/src/xrGame/ai/monsters/states/state_look_unprotected_area_inline.h +++ b/src/xrGame/ai/monsters/states/state_look_unprotected_area_inline.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../sound_player.h" +#include "sound_player.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/state_move_around_point.h b/src/xrGame/ai/monsters/states/state_move_around_point.h index 5d161476efd..67959d7b5b4 100644 --- a/src/xrGame/ai/monsters/states/state_move_around_point.h +++ b/src/xrGame/ai/monsters/states/state_move_around_point.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" #include "state_data.h" template diff --git a/src/xrGame/ai/monsters/states/state_move_to_point.h b/src/xrGame/ai/monsters/states/state_move_to_point.h index 90c32a41cba..0c7f2618ae4 100644 --- a/src/xrGame/ai/monsters/states/state_move_to_point.h +++ b/src/xrGame/ai/monsters/states/state_move_to_point.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" #include "state_data.h" template diff --git a/src/xrGame/ai/monsters/states/state_move_to_restrictor.h b/src/xrGame/ai/monsters/states/state_move_to_restrictor.h index 5f8d7ac903e..c12cbf90236 100644 --- a/src/xrGame/ai/monsters/states/state_move_to_restrictor.h +++ b/src/xrGame/ai/monsters/states/state_move_to_restrictor.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterMoveToRestrictor : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/state_test_look_actor.h b/src/xrGame/ai/monsters/states/state_test_look_actor.h index 67193de46c1..025e59c5170 100644 --- a/src/xrGame/ai/monsters/states/state_test_look_actor.h +++ b/src/xrGame/ai/monsters/states/state_test_look_actor.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterLookActor : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/state_test_look_actor_inline.h b/src/xrGame/ai/monsters/states/state_test_look_actor_inline.h index 06210587115..c1fd5d2c33c 100644 --- a/src/xrGame/ai/monsters/states/state_test_look_actor_inline.h +++ b/src/xrGame/ai/monsters/states/state_test_look_actor_inline.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../level.h" +#include "Level.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/states/state_test_state.h b/src/xrGame/ai/monsters/states/state_test_state.h index f951eacba8e..a000a3c8f5e 100644 --- a/src/xrGame/ai/monsters/states/state_test_state.h +++ b/src/xrGame/ai/monsters/states/state_test_state.h @@ -1,5 +1,5 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateMonsterTestState : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/states/state_test_state_inline.h b/src/xrGame/ai/monsters/states/state_test_state_inline.h index 9b19689093b..08065f6596e 100644 --- a/src/xrGame/ai/monsters/states/state_test_state_inline.h +++ b/src/xrGame/ai/monsters/states/state_test_state_inline.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../level.h" +#include "Level.h" #include "state_move_to_point.h" #include "state_custom_action.h" diff --git a/src/xrGame/ai/monsters/telekinesis.cpp b/src/xrGame/ai/monsters/telekinesis.cpp index 38b2ecf7ec6..6365724a788 100644 --- a/src/xrGame/ai/monsters/telekinesis.cpp +++ b/src/xrGame/ai/monsters/telekinesis.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "telekinesis.h" -#include "../../entity_alive.h" -#include "../../../xrphysics/PhysicsShell.h" +#include "entity_alive.h" +#include "xrPhysics/PhysicsShell.h" CTelekinesis::CTelekinesis() { diff --git a/src/xrGame/ai/monsters/telekinesis.h b/src/xrGame/ai/monsters/telekinesis.h index c19605e8b71..9875e07b690 100644 --- a/src/xrGame/ai/monsters/telekinesis.h +++ b/src/xrGame/ai/monsters/telekinesis.h @@ -1,10 +1,6 @@ #pragma once - #include "telekinetic_object.h" -#include "../../../xrphysics/PHUpdateObject.h" - - - +#include "xrPhysics/PHUpdateObject.h" class CTelekinesis : public CPHUpdateObject { diff --git a/src/xrGame/ai/monsters/telekinetic_object.cpp b/src/xrGame/ai/monsters/telekinetic_object.cpp index b6d92b0c939..73697fc4dea 100644 --- a/src/xrGame/ai/monsters/telekinetic_object.cpp +++ b/src/xrGame/ai/monsters/telekinetic_object.cpp @@ -1,13 +1,10 @@ #include "stdafx.h" -#include "../../physicsshellholder.h" +#include "PhysicsShellHolder.h" #include "telekinetic_object.h" -#include "../../../xrphysics/PhysicsShell.h" -#include "../../../xrphysics/MathUtils.h" -//#include "../../PHInterpolation.h" -//#include "../../PHElement.h" -#include "../../level.h" -#include "../../gameobject.h" - +#include "xrPhysics/PhysicsShell.h" +#include "xrPhysics/MathUtils.h" +#include "Level.h" +#include "GameObject.h" #define KEEP_IMPULSE_UPDATE 200 #define FIRE_TIME 3000 diff --git a/src/xrGame/ai/monsters/tushkano/tushkano.cpp b/src/xrGame/ai/monsters/tushkano/tushkano.cpp index 11d898abfe7..430dd7fa7de 100644 --- a/src/xrGame/ai/monsters/tushkano/tushkano.cpp +++ b/src/xrGame/ai/monsters/tushkano/tushkano.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "tushkano.h" #include "tushkano_state_manager.h" -#include "../monster_velocity_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" +#include "ai/monsters/monster_velocity_space.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" CTushkano::CTushkano() diff --git a/src/xrGame/ai/monsters/tushkano/tushkano.h b/src/xrGame/ai/monsters/tushkano/tushkano.h index dd8793b0825..0cd08ced629 100644 --- a/src/xrGame/ai/monsters/tushkano/tushkano.h +++ b/src/xrGame/ai/monsters/tushkano/tushkano.h @@ -1,7 +1,7 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../controlled_entity.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/controlled_entity.h" +#include "xrServerEntities/script_export_space.h" class CTushkano : public CBaseMonster, public CControlledEntity { diff --git a/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.cpp b/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.cpp index cb8eac8cb1b..b8a24606e54 100644 --- a/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.cpp +++ b/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.cpp @@ -2,21 +2,21 @@ #include "tushkano.h" #include "tushkano_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_panic.h" -#include "../states/monster_state_hear_danger_sound.h" -#include "../states/monster_state_hitted.h" -#include "../states/monster_state_controlled.h" -#include "../states/monster_state_help_sound.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_panic.h" +#include "ai/Monsters/states/monster_state_hear_danger_sound.h" +#include "ai/Monsters/states/monster_state_hitted.h" +#include "ai/Monsters/states/monster_state_controlled.h" +#include "ai/Monsters/states/monster_state_help_sound.h" -#include "../../../entitycondition.h" +#include "EntityCondition.h" CStateManagerTushkano::CStateManagerTushkano(CTushkano *obj) : inherited(obj) diff --git a/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.h b/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.h index 89424b741db..46cb9f5f89b 100644 --- a/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.h +++ b/src/xrGame/ai/monsters/tushkano/tushkano_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/Monsters/monster_state_manager.h" class CTushkano; diff --git a/src/xrGame/ai/monsters/zombie/zombie.cpp b/src/xrGame/ai/monsters/zombie/zombie.cpp index 93909d3a5f7..943765f8798 100644 --- a/src/xrGame/ai/monsters/zombie/zombie.cpp +++ b/src/xrGame/ai/monsters/zombie/zombie.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" #include "zombie.h" #include "zombie_state_manager.h" -#include "../../../profiler.h" -#include "../../../../Include/xrRender/KinematicsAnimated.h" -#include "../../../entitycondition.h" -#include "../monster_velocity_space.h" +#include "profiler.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "EntityCondition.h" +#include "ai/monsters/monster_velocity_space.h" -#include "../control_animation_base.h" -#include "../control_movement_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_movement_base.h" #ifdef _DEBUG #include diff --git a/src/xrGame/ai/monsters/zombie/zombie.h b/src/xrGame/ai/monsters/zombie/zombie.h index 1f0261c0976..e4e9088d9f1 100644 --- a/src/xrGame/ai/monsters/zombie/zombie.h +++ b/src/xrGame/ai/monsters/zombie/zombie.h @@ -1,9 +1,9 @@ #pragma once -#include "../BaseMonster/base_monster.h" -#include "../controlled_entity.h" -#include "../ai_monster_bones.h" -#include "../anim_triple.h" -#include "../../../../xrServerEntities/script_export_space.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "ai/Monsters/controlled_entity.h" +#include "ai/Monsters/ai_monster_bones.h" +#include "ai/Monsters/anim_triple.h" +#include "xrServerEntities/script_export_space.h" #define FAKE_DEATH_TYPES_COUNT 4 diff --git a/src/xrGame/ai/monsters/zombie/zombie_state_attack_run.h b/src/xrGame/ai/monsters/zombie/zombie_state_attack_run.h index 199c001916d..c0167c9339d 100644 --- a/src/xrGame/ai/monsters/zombie/zombie_state_attack_run.h +++ b/src/xrGame/ai/monsters/zombie/zombie_state_attack_run.h @@ -1,6 +1,6 @@ #pragma once -#include "../state.h" +#include "ai/Monsters/state.h" template class CStateZombieAttackRun : public CState<_Object> { diff --git a/src/xrGame/ai/monsters/zombie/zombie_state_attack_run_inline.h b/src/xrGame/ai/monsters/zombie/zombie_state_attack_run_inline.h index c566ce1241b..b1f49d12e0b 100644 --- a/src/xrGame/ai/monsters/zombie/zombie_state_attack_run_inline.h +++ b/src/xrGame/ai/monsters/zombie/zombie_state_attack_run_inline.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../sound_player.h" +#include "sound_player.h" #define TEMPLATE_SPECIALIZATION template <\ typename _Object\ diff --git a/src/xrGame/ai/monsters/zombie/zombie_state_manager.cpp b/src/xrGame/ai/monsters/zombie/zombie_state_manager.cpp index 9a3b100ee57..e1e3313191f 100644 --- a/src/xrGame/ai/monsters/zombie/zombie_state_manager.cpp +++ b/src/xrGame/ai/monsters/zombie/zombie_state_manager.cpp @@ -2,20 +2,20 @@ #include "zombie.h" #include "zombie_state_manager.h" -#include "../control_animation_base.h" -#include "../control_direction_base.h" -#include "../control_movement_base.h" -#include "../control_path_builder_base.h" +#include "ai/monsters/control_animation_base.h" +#include "ai/monsters/control_direction_base.h" +#include "ai/monsters/control_movement_base.h" +#include "ai/monsters/control_path_builder_base.h" -#include "../states/monster_state_rest.h" -#include "../states/monster_state_attack.h" -#include "../states/monster_state_eat.h" -#include "../states/monster_state_hear_int_sound.h" +#include "ai/Monsters/states/monster_state_rest.h" +#include "ai/Monsters/states/monster_state_attack.h" +#include "ai/Monsters/states/monster_state_eat.h" +#include "ai/Monsters/states/monster_state_hear_int_sound.h" #include "zombie_state_attack_run.h" -#include "../../../entitycondition.h" -#include "../../../detail_path_manager.h" -#include "../states/monster_state_controlled.h" -#include "../states/monster_state_help_sound.h" +#include "EntityCondition.h" +#include "detail_path_manager.h" +#include "ai/Monsters/states/monster_state_controlled.h" +#include "ai/Monsters/states/monster_state_help_sound.h" CStateManagerZombie::CStateManagerZombie(CZombie *obj) : inherited(obj) { diff --git a/src/xrGame/ai/monsters/zombie/zombie_state_manager.h b/src/xrGame/ai/monsters/zombie/zombie_state_manager.h index 4d733f4a6dc..2070ccd4da3 100644 --- a/src/xrGame/ai/monsters/zombie/zombie_state_manager.h +++ b/src/xrGame/ai/monsters/zombie/zombie_state_manager.h @@ -1,5 +1,5 @@ #pragma once -#include "../monster_state_manager.h" +#include "ai/Monsters/monster_state_manager.h" class CZombie; diff --git a/src/xrGame/ai/phantom/phantom.cpp b/src/xrGame/ai/phantom/phantom.cpp index 4d137e64702..c73c994a88d 100644 --- a/src/xrGame/ai/phantom/phantom.cpp +++ b/src/xrGame/ai/phantom/phantom.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "phantom.h" -#include "../../level.h" -#include "../../../xrServerEntities/xrserver_objects_alife_monsters.h" +#include "Level.h" +#include "xrServerEntities/xrserver_objects_alife_monsters.h" #include "xrCore/Animation/Motion.hpp" -#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/KinematicsAnimated.h" CPhantom::CPhantom() { diff --git a/src/xrGame/ai/phantom/phantom.h b/src/xrGame/ai/phantom/phantom.h index d1b97f134f5..218008aa234 100644 --- a/src/xrGame/ai/phantom/phantom.h +++ b/src/xrGame/ai/phantom/phantom.h @@ -1,7 +1,6 @@ #pragma once - -#include "../../entity.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" +#include "Entity.h" +#include "Include/xrRender/KinematicsAnimated.h" class CParticlesObject; diff --git a/src/xrGame/ai/stalker/ai_stalker.cpp b/src/xrGame/ai/stalker/ai_stalker.cpp index 88dd6454818..a803d85aa0e 100644 --- a/src/xrGame/ai/stalker/ai_stalker.cpp +++ b/src/xrGame/ai/stalker/ai_stalker.cpp @@ -8,65 +8,65 @@ #include "pch_script.h" #include "ai_stalker.h" -#include "../ai_monsters_misc.h" -#include "../../weapon.h" -#include "../../hit.h" -#include "../../phdestroyable.h" -#include "../../CharacterPhysicsSupport.h" -#include "../../script_entity_action.h" -#include "../../game_level_cross_table.h" -#include "../../game_graph.h" -#include "../../inventory.h" -#include "../../artefact.h" -#include "../../phmovementcontrol.h" -#include "../../../xrServerEntities/xrserver_objects_alife_monsters.h" -#include "../../cover_evaluators.h" -#include "../../xrserver.h" -#include "../../xr_level_controller.h" -#include "../../../Include/xrRender/Kinematics.h" -#include "../../../xrServerEntities/character_info.h" -#include "../../actor.h" -#include "../../relation_registry.h" -#include "../../stalker_animation_manager.h" -#include "../../stalker_planner.h" -#include "../../script_game_object.h" -#include "../../detail_path_manager.h" -#include "../../agent_manager.h" -#include "../../agent_corpse_manager.h" -#include "../../object_handler_planner.h" -#include "../../object_handler_space.h" -#include "../../memory_manager.h" -#include "../../sight_manager.h" -#include "../../ai_object_location.h" -#include "../../stalker_movement_manager_smart_cover.h" -#include "../../entitycondition.h" -#include "../../../xrServerEntities/script_engine.h" +#include "ai/ai_monsters_misc.h" +#include "Weapon.h" +#include "Hit.h" +#include "PHDestroyable.h" +#include "CharacterPhysicsSupport.h" +#include "script_entity_action.h" +#include "game_level_cross_table.h" +#include "game_graph.h" +#include "Inventory.h" +#include "Artefact.h" +#include "PHMovementControl.h" +#include "xrServerEntities/xrserver_objects_alife_monsters.h" +#include "cover_evaluators.h" +#include "xrServer.h" +#include "xr_level_controller.h" +#include "Include/xrRender/Kinematics.h" +#include "xrServerEntities/character_info.h" +#include "Actor.h" +#include "relation_registry.h" +#include "stalker_animation_manager.h" +#include "stalker_planner.h" +#include "script_game_object.h" +#include "detail_path_manager.h" +#include "agent_manager.h" +#include "agent_corpse_manager.h" +#include "object_handler_planner.h" +#include "object_handler_space.h" +#include "memory_manager.h" +#include "sight_manager.h" +#include "ai_object_location.h" +#include "stalker_movement_manager_smart_cover.h" +#include "EntityCondition.h" +#include "xrServerEntities/script_engine.h" #include "ai_stalker_impl.h" -#include "../../sound_player.h" -#include "../../stalker_sound_data.h" -#include "../../stalker_sound_data_visitor.h" +#include "sound_player.h" +#include "stalker_sound_data.h" +#include "stalker_sound_data_visitor.h" #include "ai_stalker_space.h" -#include "../../mt_config.h" -#include "../../effectorshot.h" -#include "../../visual_memory_manager.h" -#include "../../enemy_manager.h" -#include "../../../xrServerEntities/alife_human_brain.h" -#include "../../profiler.h" -#include "../../BoneProtections.h" -#include "../../stalker_animation_names.h" -#include "../../stalker_decision_space.h" -#include "../../agent_member_manager.h" -#include "../../location_manager.h" +#include "mt_config.h" +#include "EffectorShot.h" +#include "visual_memory_manager.h" +#include "enemy_manager.h" +#include "xrServerEntities/alife_human_brain.h" +#include "profiler.h" +#include "BoneProtections.h" +#include "stalker_animation_names.h" +#include "stalker_decision_space.h" +#include "agent_member_manager.h" +#include "location_manager.h" #include "smart_cover_animation_selector.h" #include "smart_cover_animation_planner.h" #include "smart_cover_planner_target_selector.h" #ifdef DEBUG -# include "../../alife_simulator.h" -# include "../../alife_object_registry.h" -# include "../../level.h" -# include "../../map_location.h" -# include "../../map_manager.h" +# include "alife_simulator.h" +# include "alife_object_registry.h" +# include "Level.h" +# include "map_location.h" +# include "map_manager.h" #endif // DEBUG using namespace StalkerSpace; @@ -932,7 +932,7 @@ CPHDestroyable* CAI_Stalker:: ph_destroyable () return smart_cast(character_physics_support()); } -#include "../../enemy_manager.h" +#include "enemy_manager.h" void CAI_Stalker::shedule_Update ( u32 DT ) { diff --git a/src/xrGame/ai/stalker/ai_stalker.h b/src/xrGame/ai/stalker/ai_stalker.h index 141ce6dfdcb..529ddb2cc1d 100644 --- a/src/xrGame/ai/stalker/ai_stalker.h +++ b/src/xrGame/ai/stalker/ai_stalker.h @@ -7,12 +7,11 @@ //////////////////////////////////////////////////////////////////////////// #pragma once - -#include "../../CustomMonster.h" -#include "../../object_handler.h" -#include "../../AI_PhraseDialogManager.h" -#include "../../step_manager.h" -#include "../../../xrServerEntities/script_export_space.h" +#include "CustomMonster.h" +#include "object_handler.h" +#include "AI_PhraseDialogManager.h" +#include "step_manager.h" +#include "xrServerEntities/script_export_space.h" #ifdef DEBUG template diff --git a/src/xrGame/ai/stalker/ai_stalker_cover.cpp b/src/xrGame/ai/stalker/ai_stalker_cover.cpp index 4cfe1704cd4..07b85c9ca63 100644 --- a/src/xrGame/ai/stalker/ai_stalker_cover.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_cover.cpp @@ -8,23 +8,23 @@ #include "pch_script.h" #include "ai_stalker.h" -#include "../../cover_point.h" -#include "../../cover_evaluators.h" -#include "../../ai_space.h" -#include "../../cover_manager.h" -#include "../../stalker_movement_restriction.h" -#include "../../level_graph.h" -#include "../../inventory_item.h" -#include "../../agent_member_manager.h" -#include "../../memory_manager.h" -#include "../../enemy_manager.h" -#include "../../stalker_movement_manager_smart_cover.h" -#include "../../smart_cover.h" -#include "../../smart_cover_planner_target_selector.h" -#include "../../smart_cover_animation_planner.h" -#include "../../script_game_object.h" -#include "../../stalker_decision_space.h" -#include "../../weapon.h" +#include "cover_point.h" +#include "cover_evaluators.h" +#include "ai_space.h" +#include "cover_manager.h" +#include "stalker_movement_restriction.h" +#include "level_graph.h" +#include "inventory_item.h" +#include "agent_member_manager.h" +#include "memory_manager.h" +#include "enemy_manager.h" +#include "stalker_movement_manager_smart_cover.h" +#include "smart_cover.h" +#include "smart_cover_planner_target_selector.h" +#include "smart_cover_animation_planner.h" +#include "script_game_object.h" +#include "stalker_decision_space.h" +#include "Weapon.h" extern const float MIN_SUITABLE_ENEMY_DISTANCE = 3.f; diff --git a/src/xrGame/ai/stalker/ai_stalker_debug.cpp b/src/xrGame/ai/stalker/ai_stalker_debug.cpp index c60a9bc728a..f846fae1b7a 100644 --- a/src/xrGame/ai/stalker/ai_stalker_debug.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_debug.cpp @@ -10,52 +10,52 @@ #ifdef DEBUG #include "ai_stalker.h" -#include "../../memory_manager.h" -#include "../../visual_memory_manager.h" -#include "../../sound_memory_manager.h" -#include "../../hit_memory_manager.h" -#include "../../enemy_manager.h" -#include "../../danger_manager.h" -#include "../../item_manager.h" -#include "../../actor.h" -#include "../../stalker_planner.h" -#include "../../script_game_object.h" -#include "../../stalker_animation_manager.h" -#include "../../weapon.h" -#include "../../sound_player.h" -#include "../../inventory.h" -#include "../../object_handler_planner.h" -#include "../../stalker_movement_manager_smart_cover.h" -#include "../../movement_manager_space.h" -#include "../../patrol_path_manager.h" -#include "../../level_path_manager.h" -#include "../../game_path_manager.h" -#include "../../detail_path_manager.h" -#include "../../sight_manager.h" -#include "../../ai_object_location.h" -#include "../../entitycondition.h" -#include "../ai_monsters_misc.h" -#include "../../agent_manager.h" -#include "../../agent_member_manager.h" -#include "../../agent_enemy_manager.h" -#include "../../agent_corpse_manager.h" -#include "../../agent_location_manager.h" -#include "../../cover_point.h" -#include "../../../xrEngine/camerabase.h" -#include "../../mt_config.h" -#include "../../weaponmagazined.h" -#include "../../object_handler_space.h" -#include "../../debug_renderer.h" -#include "../../CharacterPhysicsSupport.h" -#include "../../smart_cover_animation_selector.h" -#include "../../animation_movement_controller.h" -#include "../../phdebug.h" -#include "../../game_object_space.h" -#include "../../aimers_weapon.h" -#include "../../aimers_bone.h" -#include "../../smart_cover_planner_target_selector.h" -#include "../../ui_base.h" -#include "../../doors_actor.h" +#include "memory_manager.h" +#include "visual_memory_manager.h" +#include "sound_memory_manager.h" +#include "hit_memory_manager.h" +#include "enemy_manager.h" +#include "danger_manager.h" +#include "item_manager.h" +#include "Actor.h" +#include "stalker_planner.h" +#include "script_game_object.h" +#include "stalker_animation_manager.h" +#include "Weapon.h" +#include "sound_player.h" +#include "Inventory.h" +#include "object_handler_planner.h" +#include "stalker_movement_manager_smart_cover.h" +#include "movement_manager_space.h" +#include "patrol_path_manager.h" +#include "level_path_manager.h" +#include "game_path_manager.h" +#include "detail_path_manager.h" +#include "sight_manager.h" +#include "ai_object_location.h" +#include "EntityCondition.h" +#include "ai/ai_monsters_misc.h" +#include "agent_manager.h" +#include "agent_member_manager.h" +#include "agent_enemy_manager.h" +#include "agent_corpse_manager.h" +#include "agent_location_manager.h" +#include "cover_point.h" +#include "xrEngine/camerabase.h" +#include "mt_config.h" +#include "weaponmagazined.h" +#include "object_handler_space.h" +#include "debug_renderer.h" +#include "CharacterPhysicsSupport.h" +#include "smart_cover_animation_selector.h" +#include "animation_movement_controller.h" +#include "phdebug.h" +#include "game_object_space.h" +#include "aimers_weapon.h" +#include "aimers_bone.h" +#include "smart_cover_planner_target_selector.h" +#include "ui_base.h" +#include "doors_actor.h" CActor *g_debug_actor = 0; diff --git a/src/xrGame/ai/stalker/ai_stalker_events.cpp b/src/xrGame/ai/stalker/ai_stalker_events.cpp index ce31996d43f..3263d006bc2 100644 --- a/src/xrGame/ai/stalker/ai_stalker_events.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_events.cpp @@ -8,13 +8,13 @@ #include "stdafx.h" #include "ai_stalker.h" -#include "../../pda.h" -#include "../../inventory.h" -#include "../../../xrServerEntities/xrmessages.h" -#include "../../shootingobject.h" -#include "../../level.h" -#include "../../ai_monster_space.h" -#include "../../characterphysicssupport.h" +#include "PDA.h" +#include "Inventory.h" +#include "xrServerEntities/xrmessages.h" +#include "ShootingObject.h" +#include "Level.h" +#include "ai_monster_space.h" +#include "CharacterPhysicsSupport.h" using namespace StalkerSpace; using namespace MonsterSpace; diff --git a/src/xrGame/ai/stalker/ai_stalker_feel.cpp b/src/xrGame/ai/stalker/ai_stalker_feel.cpp index 8726df73377..baca04a06dd 100644 --- a/src/xrGame/ai/stalker/ai_stalker_feel.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_feel.cpp @@ -8,16 +8,16 @@ #include "stdafx.h" #include "ai_stalker.h" -#include "../../inventory_item.h" -#include "../../memory_manager.h" -#include "../../visual_memory_manager.h" -#include "../../sight_manager.h" -#include "../../stalker_movement_manager_smart_cover.h" -#include "../../stalker_animation_manager.h" +#include "inventory_item.h" +#include "memory_manager.h" +#include "visual_memory_manager.h" +#include "sight_manager.h" +#include "stalker_movement_manager_smart_cover.h" +#include "stalker_animation_manager.h" #ifdef DEBUG -# include "../../ai_debug.h" - extern Flags32 psAI_Flags; +#include "ai_debug.h" +extern Flags32 psAI_Flags; #endif // DEBUG bool CAI_Stalker::feel_vision_isRelevant(CObject* O) diff --git a/src/xrGame/ai/stalker/ai_stalker_fire.cpp b/src/xrGame/ai/stalker/ai_stalker_fire.cpp index 49f1843c1e3..f82854ad420 100644 --- a/src/xrGame/ai/stalker/ai_stalker_fire.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_fire.cpp @@ -9,49 +9,48 @@ #include "pch_script.h" #include "ai_stalker.h" #include "ai_stalker_impl.h" -#include "../../script_entity_action.h" -#include "../../inventory.h" -#include "../../ef_storage.h" -#include "../../stalker_decision_space.h" -#include "../../script_game_object.h" -#include "../../customzone.h" -#include "../../../Include/xrRender/KinematicsAnimated.h" -#include "../../agent_manager.h" -#include "../../stalker_animation_manager.h" -#include "../../stalker_planner.h" -#include "../../ef_pattern.h" -#include "../../memory_manager.h" -#include "../../hit_memory_manager.h" -#include "../../enemy_manager.h" -#include "../../item_manager.h" -#include "../../stalker_movement_manager_smart_cover.h" -#include "../../entitycondition.h" -#include "../../sound_player.h" -#include "../../cover_point.h" -#include "../../agent_member_manager.h" -#include "../../agent_location_manager.h" -#include "../../danger_cover_location.h" -#include "../../object_handler_planner.h" -#include "../../object_handler_space.h" -#include "../../visual_memory_manager.h" -#include "../../weapon.h" +#include "script_entity_action.h" +#include "Inventory.h" +#include "ef_storage.h" +#include "stalker_decision_space.h" +#include "script_game_object.h" +#include "CustomZone.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "agent_manager.h" +#include "stalker_animation_manager.h" +#include "stalker_planner.h" +#include "ef_pattern.h" +#include "memory_manager.h" +#include "hit_memory_manager.h" +#include "enemy_manager.h" +#include "item_manager.h" +#include "stalker_movement_manager_smart_cover.h" +#include "EntityCondition.h" +#include "sound_player.h" +#include "cover_point.h" +#include "agent_member_manager.h" +#include "agent_location_manager.h" +#include "danger_cover_location.h" +#include "object_handler_planner.h" +#include "object_handler_space.h" +#include "visual_memory_manager.h" +#include "Weapon.h" #include "ai_stalker_space.h" -#include "../../effectorshot.h" -#include "../../BoneProtections.h" -#include "../../RadioactiveZone.h" -#include "../../restricted_object.h" -#include "../../ai_object_location.h" -#include "../../missile.h" -#include "../../../xrphysics/iphworld.h" -#include "../../stalker_animation_names.h" -#include "../../agent_corpse_manager.h" -#include "../../CharacterPhysicsSupport.h" -#include "../../stalker_planner.h" -#include "../../stalker_decision_space.h" -#include "../../script_game_object.h" -#include "../../inventory.h" - -#include "../../trajectories.h" +#include "EffectorShot.h" +#include "BoneProtections.h" +#include "RadioactiveZone.h" +#include "restricted_object.h" +#include "ai_object_location.h" +#include "Missile.h" +#include "xrPhysics/iphworld.h" +#include "stalker_animation_names.h" +#include "agent_corpse_manager.h" +#include "CharacterPhysicsSupport.h" +#include "stalker_planner.h" +#include "stalker_decision_space.h" +#include "script_game_object.h" +#include "Inventory.h" +#include "trajectories.h" using namespace StalkerSpace; diff --git a/src/xrGame/ai/stalker/ai_stalker_impl.h b/src/xrGame/ai/stalker/ai_stalker_impl.h index 42431dd7cca..ea80642d6a0 100644 --- a/src/xrGame/ai/stalker/ai_stalker_impl.h +++ b/src/xrGame/ai/stalker/ai_stalker_impl.h @@ -7,13 +7,12 @@ //////////////////////////////////////////////////////////////////////////// #pragma once - -#include "../../level.h" -#include "../../seniority_hierarchy_holder.h" -#include "../../team_hierarchy_holder.h" -#include "../../squad_hierarchy_holder.h" -#include "../../group_hierarchy_holder.h" -#include "../../effectorshot.h" +#include "Level.h" +#include "seniority_hierarchy_holder.h" +#include "team_hierarchy_holder.h" +#include "squad_hierarchy_holder.h" +#include "group_hierarchy_holder.h" +#include "EffectorShot.h" #include "stalker_movement_manager_smart_cover.h" #include "smart_cover_animation_selector.h" #include "smart_cover_animation_planner.h" diff --git a/src/xrGame/ai/stalker/ai_stalker_misc.cpp b/src/xrGame/ai/stalker/ai_stalker_misc.cpp index d271649c742..f1205ad5418 100644 --- a/src/xrGame/ai/stalker/ai_stalker_misc.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_misc.cpp @@ -9,26 +9,26 @@ #include "pch_script.h" #include "ai_stalker.h" #include "ai_stalker_space.h" -#include "../../bolt.h" -#include "../../inventory.h" -#include "../../../xrServerEntities/character_info.h" -#include "../../relation_registry.h" -#include "../../memory_manager.h" -#include "../../item_manager.h" -#include "../../stalker_movement_manager_smart_cover.h" -#include "../../explosive.h" -#include "../../agent_manager.h" -#include "../../agent_member_manager.h" -#include "../../agent_explosive_manager.h" -#include "../../agent_location_manager.h" -#include "../../danger_object_location.h" -#include "../../member_order.h" -#include "../../level.h" -#include "../../sound_player.h" -#include "../../enemy_manager.h" -#include "../../danger_manager.h" -#include "../../visual_memory_manager.h" -#include "../../agent_enemy_manager.h" +#include "Bolt.h" +#include "Inventory.h" +#include "xrServerEntities/character_info.h" +#include "relation_registry.h" +#include "memory_manager.h" +#include "item_manager.h" +#include "stalker_movement_manager_smart_cover.h" +#include "Explosive.h" +#include "agent_manager.h" +#include "agent_member_manager.h" +#include "agent_explosive_manager.h" +#include "agent_location_manager.h" +#include "danger_object_location.h" +#include "member_order.h" +#include "Level.h" +#include "sound_player.h" +#include "enemy_manager.h" +#include "danger_manager.h" +#include "visual_memory_manager.h" +#include "agent_enemy_manager.h" const u32 TOLLS_INTERVAL = 2000; const u32 GRENADE_INTERVAL = 0*1000; diff --git a/src/xrGame/ai/stalker/ai_stalker_script.cpp b/src/xrGame/ai/stalker/ai_stalker_script.cpp index 255f2c055f4..387c35068f4 100644 --- a/src/xrGame/ai/stalker/ai_stalker_script.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_script.cpp @@ -8,10 +8,10 @@ #include "pch_script.h" #include "ai_stalker.h" -#include "../../stalker_decision_space.h" +#include "stalker_decision_space.h" #include "ai_stalker_space.h" -#include "../../script_game_object.h" -#include "../../stalker_planner.h" +#include "script_game_object.h" +#include "stalker_planner.h" using namespace luabind; diff --git a/src/xrGame/ai/stalker/ai_stalker_script_entity.cpp b/src/xrGame/ai/stalker/ai_stalker_script_entity.cpp index 763d12e7047..8a8b6120079 100644 --- a/src/xrGame/ai/stalker/ai_stalker_script_entity.cpp +++ b/src/xrGame/ai/stalker/ai_stalker_script_entity.cpp @@ -8,17 +8,17 @@ #include "stdafx.h" #include "ai_stalker.h" -#include "../../stalker_animation_manager.h" -#include "../../script_entity_action.h" -#include "../../torch.h" -#include "../../inventory.h" -#include "../../weapon.h" -#include "../../weaponmagazined.h" -#include "../../../Include/xrRender/Kinematics.h" -#include "../../../xrServerEntities/script_engine.h" -#include "../../sight_manager.h" -#include "../../stalker_movement_manager_smart_cover.h" -#include "../../ai_space.h" +#include "stalker_animation_manager.h" +#include "script_entity_action.h" +#include "Torch.h" +#include "Inventory.h" +#include "Weapon.h" +#include "WeaponMagazined.h" +#include "Include/xrRender/Kinematics.h" +#include "xrServerEntities/script_engine.h" +#include "sight_manager.h" +#include "stalker_movement_manager_smart_cover.h" +#include "ai_space.h" CWeapon *CAI_Stalker::GetCurrentWeapon() const { diff --git a/src/xrGame/ai/trader/ai_trader.cpp b/src/xrGame/ai/trader/ai_trader.cpp index d0bf6a695f7..222c1fa2f90 100644 --- a/src/xrGame/ai/trader/ai_trader.cpp +++ b/src/xrGame/ai/trader/ai_trader.cpp @@ -8,21 +8,21 @@ #include "pch_script.h" #include "ai_trader.h" -#include "../../trade.h" -#include "../../script_entity_action.h" -#include "../../script_game_object.h" -#include "../../inventory.h" -#include "../../../xrServerEntities/xrserver_objects_alife_monsters.h" -#include "../../artefact.h" -#include "../../xrserver.h" -#include "../../relation_registry.h" -#include "../../../xrServerEntities/object_broker.h" -#include "../../sound_player.h" -#include "../../level.h" -#include "../../script_callback_ex.h" -#include "../../game_object_space.h" +#include "Trade.h" +#include "script_entity_action.h" +#include "script_game_object.h" +#include "Inventory.h" +#include "xrServerEntities/xrserver_objects_alife_monsters.h" +#include "Artefact.h" +#include "xrServer.h" +#include "relation_registry.h" +#include "xrServerEntities/object_broker.h" +#include "sound_player.h" +#include "Level.h" +#include "script_callback_ex.h" +#include "game_object_space.h" #include "trader_animation.h" -#include "../../../xrServerEntities/clsid_game.h" +#include "xrServerEntities/clsid_game.h" CAI_Trader::CAI_Trader() { diff --git a/src/xrGame/ai/trader/ai_trader.h b/src/xrGame/ai/trader/ai_trader.h index eb7c5ab58c1..9aa599583f0 100644 --- a/src/xrGame/ai/trader/ai_trader.h +++ b/src/xrGame/ai/trader/ai_trader.h @@ -8,12 +8,12 @@ #pragma once -#include "../../CustomMonster.h" -#include "../../inventoryowner.h" -#include "../../script_entity.h" -#include "../../sound_player.h" -#include "../../AI_PhraseDialogManager.h" -#include "../../../xrServerEntities/script_export_space.h" +#include "CustomMonster.h" +#include "InventoryOwner.h" +#include "script_entity.h" +#include "sound_player.h" +#include "AI_PhraseDialogManager.h" +#include "xrServerEntities/script_export_space.h" class CInventoryItem; class CArtefact; diff --git a/src/xrGame/ai/trader/trader_animation.cpp b/src/xrGame/ai/trader/trader_animation.cpp index ea94aa5e083..2a56fa9812d 100644 --- a/src/xrGame/ai/trader/trader_animation.cpp +++ b/src/xrGame/ai/trader/trader_animation.cpp @@ -1,8 +1,8 @@ #include "pch_script.h" #include "trader_animation.h" #include "ai_trader.h" -#include "../../script_callback_ex.h" -#include "../../game_object_space.h" +#include "script_callback_ex.h" +#include "game_object_space.h" ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/xrGame/ai/trader/trader_animation.h b/src/xrGame/ai/trader/trader_animation.h index 9beec401e30..6b529e4e956 100644 --- a/src/xrGame/ai/trader/trader_animation.h +++ b/src/xrGame/ai/trader/trader_animation.h @@ -1,6 +1,6 @@ #pragma once -#include "../../../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" class CAI_Trader; diff --git a/src/xrGame/ai_obstacle.cpp b/src/xrGame/ai_obstacle.cpp index dbdab5d3c2e..ce6795f2746 100644 --- a/src/xrGame/ai_obstacle.cpp +++ b/src/xrGame/ai_obstacle.cpp @@ -11,7 +11,7 @@ #include "ai_space.h" #include "level_graph.h" #include "GameObject.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include #include "xrCore/Animation/Bone.hpp" diff --git a/src/xrGame/ai_space.cpp b/src/xrGame/ai_space.cpp index 17f8a149154..072e0beb84f 100644 --- a/src/xrGame/ai_space.cpp +++ b/src/xrGame/ai_space.cpp @@ -20,8 +20,8 @@ #include "alife_simulator.h" #include "moving_objects.h" #include "doors_manager.h" -#include "../xrEngine/dedicated_server_only.h" -#include "../xrEngine/no_single.h" +#include "xrEngine/dedicated_server_only.h" +#include "xrEngine/no_single.h" ENGINE_API bool g_dedicated_server; diff --git a/src/xrGame/aimers_base.cpp b/src/xrGame/aimers_base.cpp index d3fb9e26fa1..19066e6f3ee 100644 --- a/src/xrGame/aimers_base.cpp +++ b/src/xrGame/aimers_base.cpp @@ -9,7 +9,7 @@ #include "stdafx.h" #include "aimers_base.h" #include "gameobject.h" -#include "../include/xrrender/kinematics.h" +#include "Include/xrRender/kinematics.h" #include "animation_movement_controller.h" using aimers::base; diff --git a/src/xrGame/aimers_base.h b/src/xrGame/aimers_base.h index 38440f45b2b..15b2933dbc1 100644 --- a/src/xrGame/aimers_base.h +++ b/src/xrGame/aimers_base.h @@ -9,7 +9,7 @@ #ifndef AIMERS_BASE_H_INCLUDED #define AIMERS_BASE_H_INCLUDED -#include "../include/xrrender/animation_motion.h" +#include "Include/xrRender/animation_motion.h" #include class CGameObject; diff --git a/src/xrGame/aimers_bone.h b/src/xrGame/aimers_bone.h index aa6279cc7f6..44f486458ef 100644 --- a/src/xrGame/aimers_bone.h +++ b/src/xrGame/aimers_bone.h @@ -10,7 +10,7 @@ #define AIMERS_BONE_H_INCLUDED #include "aimers_base.h" -#include "../include/xrrender/kinematics.h" +#include "Include/xrRender/kinematics.h" #include "animation_movement_controller.h" #include "game_object_space.h" diff --git a/src/xrGame/aimers_weapon.cpp b/src/xrGame/aimers_weapon.cpp index 5c3604a1fb6..e77dbe34dfb 100644 --- a/src/xrGame/aimers_weapon.cpp +++ b/src/xrGame/aimers_weapon.cpp @@ -8,7 +8,7 @@ #include "stdafx.h" #include "aimers_weapon.h" -#include "../include/xrrender/kinematics.h" +#include "Include/xrRender/kinematics.h" #include "animation_movement_controller.h" #include "game_object_space.h" #include "gameobject.h" diff --git a/src/xrGame/alife_dynamic_object.cpp b/src/xrGame/alife_dynamic_object.cpp index 141db3d69e2..40104d6fb9a 100644 --- a/src/xrGame/alife_dynamic_object.cpp +++ b/src/xrGame/alife_dynamic_object.cpp @@ -40,7 +40,7 @@ void CSE_ALifeDynamicObject::on_before_register () { } -#include "level.h" +#include "Level.h" #include "map_manager.h" void CSE_ALifeDynamicObject::on_unregister() diff --git a/src/xrGame/alife_graph_registry.cpp b/src/xrGame/alife_graph_registry.cpp index 0ac1496fd71..9dee7592d71 100644 --- a/src/xrGame/alife_graph_registry.cpp +++ b/src/xrGame/alife_graph_registry.cpp @@ -8,7 +8,7 @@ #include "stdafx.h" #include "alife_graph_registry.h" -#include "../xrEngine/x_ray.h" +#include "xrEngine/x_ray.h" using namespace ALife; diff --git a/src/xrGame/alife_online_offline_group_brain.cpp b/src/xrGame/alife_online_offline_group_brain.cpp index 962d8bb65aa..6c0cac98176 100644 --- a/src/xrGame/alife_online_offline_group_brain.cpp +++ b/src/xrGame/alife_online_offline_group_brain.cpp @@ -26,7 +26,7 @@ # include "alife_time_manager.h" # include "date_time.h" # ifdef DEBUG -# include "level.h" +# include "Level.h" # include "map_location.h" # include "map_manager.h" # endif diff --git a/src/xrGame/alife_simulator.cpp b/src/xrGame/alife_simulator.cpp index 8ec95435614..b2523bc5071 100644 --- a/src/xrGame/alife_simulator.cpp +++ b/src/xrGame/alife_simulator.cpp @@ -10,12 +10,12 @@ #include "alife_simulator.h" #include "xrServer_Objects_ALife.h" #include "ai_space.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #include "script_engine.h" #include "mainmenu.h" #include "object_factory.h" #include "alife_object_registry.h" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" #ifdef DEBUG # include "moving_objects.h" diff --git a/src/xrGame/alife_simulator_base.cpp b/src/xrGame/alife_simulator_base.cpp index 05acaeddfd8..361c23f47a2 100644 --- a/src/xrGame/alife_simulator_base.cpp +++ b/src/xrGame/alife_simulator_base.cpp @@ -21,7 +21,7 @@ #include "xrserver.h" #include "level_graph.h" #include "inventory_upgrade_manager.h" -#include "level.h" +#include "Level.h" #pragma warning(push) #pragma warning(disable:4995) diff --git a/src/xrGame/alife_simulator_script.cpp b/src/xrGame/alife_simulator_script.cpp index 594db97a847..b48912a9c7d 100644 --- a/src/xrGame/alife_simulator_script.cpp +++ b/src/xrGame/alife_simulator_script.cpp @@ -18,7 +18,7 @@ #include "alife_spawn_registry.h" #include "alife_registry_container.h" #include "xrServer.h" -#include "level.h" +#include "Level.h" using namespace luabind; diff --git a/src/xrGame/alife_spawn_registry_header.cpp b/src/xrGame/alife_spawn_registry_header.cpp index 3df70d3faa5..d75866e2785 100644 --- a/src/xrGame/alife_spawn_registry_header.cpp +++ b/src/xrGame/alife_spawn_registry_header.cpp @@ -9,7 +9,7 @@ #include "stdafx.h" #include "alife_spawn_registry_header.h" #include "alife_space.h" -#include "../xrEngine/xrlevel.h" +#include "xrEngine/xrlevel.h" CALifeSpawnHeader::~CALifeSpawnHeader () { diff --git a/src/xrGame/alife_spawn_registry_header.h b/src/xrGame/alife_spawn_registry_header.h index 5221adeab4c..d51f56e7c9e 100644 --- a/src/xrGame/alife_spawn_registry_header.h +++ b/src/xrGame/alife_spawn_registry_header.h @@ -8,7 +8,7 @@ #pragma once -#include "../xrEngine/xrLevel.h" +#include "xrEngine/xrLevel.h" class CALifeSpawnHeader { protected: diff --git a/src/xrGame/alife_storage_manager.cpp b/src/xrGame/alife_storage_manager.cpp index 9fe13b8cdb9..67540846a06 100644 --- a/src/xrGame/alife_storage_manager.cpp +++ b/src/xrGame/alife_storage_manager.cpp @@ -16,11 +16,11 @@ #include "alife_group_registry.h" #include "alife_registry_container.h" #include "xrserver.h" -#include "level.h" -#include "../xrEngine/x_ray.h" +#include "Level.h" +#include "xrEngine/x_ray.h" #include "saved_game_wrapper.h" #include "string_table.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #include "autosave_manager.h" XRCORE_API string_path g_bug_report_file; diff --git a/src/xrGame/alife_switch_manager.cpp b/src/xrGame/alife_switch_manager.cpp index c4f255fd334..1fd8ccbd9db 100644 --- a/src/xrGame/alife_switch_manager.cpp +++ b/src/xrGame/alife_switch_manager.cpp @@ -18,7 +18,7 @@ #include "level_graph.h" #ifdef DEBUG -# include "level.h" +# include "Level.h" #endif // DEBUG using namespace ALife; diff --git a/src/xrGame/alife_update_manager.cpp b/src/xrGame/alife_update_manager.cpp index 30594e0351e..68f343e2b80 100644 --- a/src/xrGame/alife_update_manager.cpp +++ b/src/xrGame/alife_update_manager.cpp @@ -16,9 +16,9 @@ #include "alife_object_registry.h" #include "ef_storage.h" #include "xrserver.h" -#include "level.h" +#include "Level.h" #include "graph_engine.h" -#include "../xrEngine/x_ray.h" +#include "xrEngine/x_ray.h" #include "restriction_space.h" #include "profiler.h" #include "mt_config.h" @@ -227,7 +227,7 @@ bool CALifeUpdateManager::change_level (NET_Packet &net_packet) return (true); } -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" void CALifeUpdateManager::new_game (LPCSTR save_name) { // g_pGamePersistent->LoadTitle ("st_creating_new_game"); diff --git a/src/xrGame/ammunition_groups.cpp b/src/xrGame/ammunition_groups.cpp index 55a717f04f8..43c182cbf52 100644 --- a/src/xrGame/ammunition_groups.cpp +++ b/src/xrGame/ammunition_groups.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "ammunition_groups.h" #include "ui/UIBuyWndShared.h" -#include "../xrCore/xr_ini.h" +#include "xrCore/xr_ini.h" namespace award_system { diff --git a/src/xrGame/ammunition_groups.h b/src/xrGame/ammunition_groups.h index 4184b0c0581..fe4060cc4df 100644 --- a/src/xrGame/ammunition_groups.h +++ b/src/xrGame/ammunition_groups.h @@ -1,7 +1,7 @@ #ifndef AMMUNITION_GROUPS_INCLUDED #define AMMUNITION_GROUPS_INCLUDED -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" class CItemMgr; diff --git a/src/xrGame/animation_movement_controller.cpp b/src/xrGame/animation_movement_controller.cpp index bb3be09b9fe..61958e3d947 100644 --- a/src/xrGame/animation_movement_controller.cpp +++ b/src/xrGame/animation_movement_controller.cpp @@ -1,9 +1,9 @@ #include "StdAfx.h" #include "animation_movement_controller.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "game_object_space.h" -#include "../xrphysics/matrix_utils.h" +#include "xrPhysics/matrix_utils.h" #ifdef DEBUG #include "phdebug.h" #endif diff --git a/src/xrGame/animation_movement_controller.h b/src/xrGame/animation_movement_controller.h index 7a781263ac4..043812af738 100644 --- a/src/xrGame/animation_movement_controller.h +++ b/src/xrGame/animation_movement_controller.h @@ -1,7 +1,7 @@ #pragma once #include -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "poses_blending.h" //class IKinematicsAnimated; diff --git a/src/xrGame/animation_script_callback.cpp b/src/xrGame/animation_script_callback.cpp index c306fd1c17e..4509d9b3519 100644 --- a/src/xrGame/animation_script_callback.cpp +++ b/src/xrGame/animation_script_callback.cpp @@ -4,7 +4,7 @@ #include "script_callback_ex.h" #include "gameobject.h" #include "game_object_space.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" CBlend *PlayMotionByParts(IKinematicsAnimated* sa, MotionID motion_ID, BOOL bMixIn, PlayCallback Callback, LPVOID CallbackParam) { diff --git a/src/xrGame/animation_utils.cpp b/src/xrGame/animation_utils.cpp index be442374865..e79f4996b64 100644 --- a/src/xrGame/animation_utils.cpp +++ b/src/xrGame/animation_utils.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "animation_utils.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "xrCore/Animation/Bone.hpp" #include "game_object_space.h" diff --git a/src/xrGame/antirad.cpp b/src/xrGame/antirad.cpp index c420c3b8dbf..c775c5d6f67 100644 --- a/src/xrGame/antirad.cpp +++ b/src/xrGame/antirad.cpp @@ -6,7 +6,7 @@ #include "stdafx.h" #include "antirad.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CAntirad::CAntirad(void) { diff --git a/src/xrGame/artefact_activation.cpp b/src/xrGame/artefact_activation.cpp index c86c8f71d53..95ea74338e2 100644 --- a/src/xrGame/artefact_activation.cpp +++ b/src/xrGame/artefact_activation.cpp @@ -8,20 +8,20 @@ #include "stdafx.h" #include "artefact_activation.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "PhysicsShellHolder.h" #include "game_cl_base.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "ai_object_location.h" #include "xrServer_Objects_ALife_Monsters.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphworld.h" #include "restriction_space.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" SArtefactActivation::SArtefactActivation(CArtefact* af,u32 owner_id) { diff --git a/src/xrGame/atlas_submit_queue.h b/src/xrGame/atlas_submit_queue.h index 0b5aeaff85a..51dd39e4a71 100644 --- a/src/xrGame/atlas_submit_queue.h +++ b/src/xrGame/atlas_submit_queue.h @@ -2,7 +2,7 @@ #define ATLAS_SUBMIT_QUEUE_INCLUDED #include -#include "../xrCore/fastdelegate.h" +#include "xrCore/fastdelegate.h" #include "profile_data_types.h" namespace gamespy_profile diff --git a/src/xrGame/attachable_item.cpp b/src/xrGame/attachable_item.cpp index 8ee62f433b4..f57acd2cc6f 100644 --- a/src/xrGame/attachable_item.cpp +++ b/src/xrGame/attachable_item.cpp @@ -11,7 +11,7 @@ #include "attachable_item.h" #include "inventoryowner.h" #include "inventory.h" -#include "../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" #include "ui_base.h" #ifdef DEBUG diff --git a/src/xrGame/attachment_owner.cpp b/src/xrGame/attachment_owner.cpp index eceb3c2ce2e..500c59d84dc 100644 --- a/src/xrGame/attachment_owner.cpp +++ b/src/xrGame/attachment_owner.cpp @@ -9,7 +9,7 @@ #include "stdafx.h" #include "attachment_owner.h" #include "attachable_item.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "inventory_item.h" #include "physicsshellholder.h" diff --git a/src/xrGame/autosave_manager.cpp b/src/xrGame/autosave_manager.cpp index 261e40dcdfd..d60c64c88fd 100644 --- a/src/xrGame/autosave_manager.cpp +++ b/src/xrGame/autosave_manager.cpp @@ -10,7 +10,7 @@ #include "autosave_manager.h" #include "date_time.h" #include "ai_space.h" -#include "level.h" +#include "Level.h" #include "xrMessages.h" #include "UIGameCustom.h" #include "Actor.h" diff --git a/src/xrGame/awards_store.h b/src/xrGame/awards_store.h index 64f151fd5f0..a07d1ec0de9 100644 --- a/src/xrGame/awards_store.h +++ b/src/xrGame/awards_store.h @@ -1,10 +1,10 @@ #ifndef AWARD_SYSTEM_INCLUDED #define AWARD_SYSTEM_INCLUDED -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" #include #include "profile_data_types.h" -#include "../xrGameSpy/GameSpy/sake/sake.h" +#include "xrGameSpy/GameSpy/sake/sake.h" #include "gsc_dsigned_ltx.h" class CGameSpy_Full; diff --git a/src/xrGame/base_client_classes_script.cpp b/src/xrGame/base_client_classes_script.cpp index 9e7f0d87980..a6ed51acf14 100644 --- a/src/xrGame/base_client_classes_script.cpp +++ b/src/xrGame/base_client_classes_script.cpp @@ -9,10 +9,10 @@ #include "pch_script.h" #include "base_client_classes.h" #include "base_client_classes_wrappers.h" -#include "../xrEngine/feel_sound.h" -//#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/Kinematics.h" +#include "xrEngine/feel_sound.h" +//#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/Kinematics.h" #include "ai/stalker/ai_stalker.h" using namespace luabind; diff --git a/src/xrGame/base_client_classes_wrappers.h b/src/xrGame/base_client_classes_wrappers.h index 004f361d01b..6b063f874bf 100644 --- a/src/xrGame/base_client_classes_wrappers.h +++ b/src/xrGame/base_client_classes_wrappers.h @@ -10,12 +10,12 @@ #include "script_export_space.h" #include "base_client_classes.h" -#include "../xrEngine/engineapi.h" -#include "../xrcdb/ispatial.h" -#include "../xrEngine/isheduled.h" -#include "../xrEngine/irenderable.h" -#include "../xrEngine/icollidable.h" -#include "../xrEngine/xr_object.h" +#include "xrEngine/engineapi.h" +#include "xrCDB/ispatial.h" +#include "xrEngine/isheduled.h" +#include "xrEngine/irenderable.h" +#include "xrEngine/icollidable.h" +#include "xrEngine/xr_object.h" #include "entity.h" #include "ai_space.h" #include "script_engine.h" diff --git a/src/xrGame/best_scores_store.h b/src/xrGame/best_scores_store.h index f4b9a4ab609..c03cd537e96 100644 --- a/src/xrGame/best_scores_store.h +++ b/src/xrGame/best_scores_store.h @@ -2,8 +2,8 @@ #define BEST_SCORES_SYSTEM_INCLUDED #include -#include "../xrServerEntities/associative_vector.h" -#include "../xrGameSpy/GameSpy/sake/sake.h" +#include "xrServerEntities/associative_vector.h" +#include "xrGameSpy/GameSpy/sake/sake.h" #include "profile_data_types.h" class CGameSpy_Full; diff --git a/src/xrGame/black_list.cpp b/src/xrGame/black_list.cpp index 36e8d14f385..ebcc19582fa 100644 --- a/src/xrGame/black_list.cpp +++ b/src/xrGame/black_list.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "black_list.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" #include "game_state_accumulator.h" diff --git a/src/xrGame/bone_groups.cpp b/src/xrGame/bone_groups.cpp index cb355262d42..f2469dcfa2f 100644 --- a/src/xrGame/bone_groups.cpp +++ b/src/xrGame/bone_groups.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "bone_groups.h" #include "Actor.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" namespace award_system { diff --git a/src/xrGame/bone_groups.h b/src/xrGame/bone_groups.h index 2b0519ec49c..8de4d72599f 100644 --- a/src/xrGame/bone_groups.h +++ b/src/xrGame/bone_groups.h @@ -1,7 +1,7 @@ #ifndef BONE_GROUP_INCLUDED #define BONE_GROUP_INCLUDED -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" class CActor; diff --git a/src/xrGame/cameralook.cpp b/src/xrGame/cameralook.cpp index 9028c63443f..74a92a6f510 100644 --- a/src/xrGame/cameralook.cpp +++ b/src/xrGame/cameralook.cpp @@ -2,7 +2,7 @@ #pragma hdrstop #include "CameraLook.h" -#include "../xrEngine/Cameramanager.h" +#include "xrEngine/Cameramanager.h" #include "xr_level_controller.h" #include "actor.h" @@ -82,7 +82,7 @@ void CCameraLook::OnActivate( CCameraBase* old_cam ) if (yaw<-PI_MUL_2)yaw+=PI_MUL_2; } -#include "../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" #include "visual_memory_manager.h" #include "actor_memory.h" diff --git a/src/xrGame/cameralook.h b/src/xrGame/cameralook.h index bd29c45bb15..eefb7e0bc5f 100644 --- a/src/xrGame/cameralook.h +++ b/src/xrGame/cameralook.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" class CCameraLook : public CCameraBase { diff --git a/src/xrGame/character_hit_animations.cpp b/src/xrGame/character_hit_animations.cpp index e9cf3735a64..8f18ece4180 100644 --- a/src/xrGame/character_hit_animations.cpp +++ b/src/xrGame/character_hit_animations.cpp @@ -5,7 +5,7 @@ #include "character_hit_animations_params.h" #include "entity_alive.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "animation_utils.h" #ifdef DEBUG #include "phdebug.h" diff --git a/src/xrGame/character_hit_animations.h b/src/xrGame/character_hit_animations.h index 56b10547f28..f4089eaa063 100644 --- a/src/xrGame/character_hit_animations.h +++ b/src/xrGame/character_hit_animations.h @@ -2,8 +2,8 @@ class CEntityAlive; class IKinematics; -//#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/KinematicsAnimated.h" +//#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" class character_hit_animation_controller { public: diff --git a/src/xrGame/character_shell_control.cpp b/src/xrGame/character_shell_control.cpp index ee17f04e7b0..276cc81adee 100644 --- a/src/xrGame/character_shell_control.cpp +++ b/src/xrGame/character_shell_control.cpp @@ -2,14 +2,14 @@ #include "character_shell_control.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "xrCore/Animation/Bone.hpp" //#include "Physics.h" -#include "../xrphysics/ExtendedGeom.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/ExtendedGeom.h" +#include "xrPhysics/PhysicsShell.h" //#include "hit.h" -#include "level.h" +#include "Level.h" #include "CustomZone.h" #ifdef DEBUG diff --git a/src/xrGame/client_spawn_manager.cpp b/src/xrGame/client_spawn_manager.cpp index ef2e24b675a..74fd5d2e042 100644 --- a/src/xrGame/client_spawn_manager.cpp +++ b/src/xrGame/client_spawn_manager.cpp @@ -10,7 +10,7 @@ #include "client_spawn_manager.h" #include "ai_space.h" #include "script_engine.h" -#include "level.h" +#include "Level.h" #include "gameobject.h" #include "script_game_object.h" diff --git a/src/xrGame/configs_common.h b/src/xrGame/configs_common.h index dc2e63ab4ff..475b429a7aa 100644 --- a/src/xrGame/configs_common.h +++ b/src/xrGame/configs_common.h @@ -1,7 +1,7 @@ #ifndef CONFIGS_COMMON_INCLUDED #define CONFIGS_COMMON_INCLUDED -#include "../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" namespace mp_anticheat { diff --git a/src/xrGame/configs_dumper.cpp b/src/xrGame/configs_dumper.cpp index b90e212c937..e82e11d4d35 100644 --- a/src/xrGame/configs_dumper.cpp +++ b/src/xrGame/configs_dumper.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" #include "configs_dumper.h" #include "configs_common.h" -#include "../xrCore/ppmd_compressor.h" -#include "../xrCore/xr_ini.h" +#include "xrCore/ppmd_compressor.h" +#include "xrCore/xr_ini.h" #include "GameObject.h" -#include "level.h" +#include "Level.h" #include "actor_mp_client.h" #include "inventory.h" #include "weapon.h" diff --git a/src/xrGame/console_commands.cpp b/src/xrGame/console_commands.cpp index 5eac47287fc..94a8ea33a4c 100644 --- a/src/xrGame/console_commands.cpp +++ b/src/xrGame/console_commands.cpp @@ -1,12 +1,12 @@ #include "pch_script.h" -#include "../xrEngine/xr_ioconsole.h" -#include "../xrEngine/xr_ioc_cmd.h" -#include "../xrEngine/customhud.h" -#include "../xrEngine/fdemorecord.h" -#include "../xrEngine/fdemoplay.h" +#include "xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioc_cmd.h" +#include "xrEngine/customhud.h" +#include "xrEngine/fdemorecord.h" +#include "xrEngine/fdemoplay.h" #include "xrMessages.h" #include "xrserver.h" -#include "level.h" +#include "Level.h" #include "script_debugger.h" #include "ai_debug.h" #include "alife_simulator.h" @@ -23,8 +23,8 @@ #include "script_process.h" #include "xrServer_Objects.h" #include "ui/UIMainIngameWnd.h" -//#include "../xrphysics/PhysicsGamePars.h" -#include "../xrphysics/iphworld.h" +//#include "xrPhysics/PhysicsGamePars.h" +#include "xrPhysics/iphworld.h" #include "string_table.h" #include "autosave_manager.h" #include "ai_space.h" @@ -40,8 +40,8 @@ #include "MainMenu.h" #include "saved_game_wrapper.h" #include "level_graph.h" -//#include "../xrEngine/resourcemanager.h" -#include "../xrEngine/doug_lea_memory_allocator.h" +//#include "xrEngine/resourcemanager.h" +#include "xrEngine/doug_lea_memory_allocator.h" #include "cameralook.h" #include "character_hit_animations_params.h" #include "inventory_upgrade_manager.h" @@ -50,7 +50,7 @@ #include "GameSpy/GameSpy_Patching.h" #include "ai_debug_variables.h" -#include "../xrphysics/console_vars.h" +#include "xrPhysics/console_vars.h" #ifdef DEBUG # include "PHDebug.h" # include "ui/UIDebugFonts.h" diff --git a/src/xrGame/console_commands_mp.cpp b/src/xrGame/console_commands_mp.cpp index 9d6d54b9083..c23bd65c411 100644 --- a/src/xrGame/console_commands_mp.cpp +++ b/src/xrGame/console_commands_mp.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" -#include "../xrEngine/xr_ioconsole.h" -#include "../xrEngine/xr_ioc_cmd.h" -#include "level.h" +#include "xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioc_cmd.h" +#include "Level.h" #include "xrServer.h" #include "game_cl_base.h" #include "game_cl_mp.h" @@ -17,7 +17,7 @@ #include "date_time.h" #include "game_cl_base_weapon_usage_statistic.h" #include "string_table.h" -#include "../xrGameSpy/xrGameSpy_MainDefs.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" #include "DemoPlay_Control.h" #include "account_manager_console.h" #include "gamespy/GameSpy_GP.h" diff --git a/src/xrGame/console_registrator_script.cpp b/src/xrGame/console_registrator_script.cpp index 0e35a25b3c4..6f2018b114e 100644 --- a/src/xrGame/console_registrator_script.cpp +++ b/src/xrGame/console_registrator_script.cpp @@ -1,6 +1,6 @@ #include "pch_script.h" #include "console_registrator.h" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" using namespace luabind; diff --git a/src/xrGame/cta_game_artefact_activation.cpp b/src/xrGame/cta_game_artefact_activation.cpp index ff5b6085fcf..8f216603c89 100644 --- a/src/xrGame/cta_game_artefact_activation.cpp +++ b/src/xrGame/cta_game_artefact_activation.cpp @@ -8,20 +8,20 @@ #include "stdafx.h" #include "cta_game_artefact_activation.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" #include "PhysicsShellHolder.h" #include "game_cl_base.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "inventory.h" -#include "level.h" +#include "Level.h" #include "ai_object_location.h" #include "xrServer_Objects_ALife_Monsters.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphworld.h" #include "restriction_space.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" CtaArtefactActivation::CtaArtefactActivation(CArtefact* af, u32 owner_id) : SArtefactActivation(af, owner_id) diff --git a/src/xrGame/dRayMotions.cpp b/src/xrGame/dRayMotions.cpp deleted file mode 100644 index 5e539f89cbd..00000000000 --- a/src/xrGame/dRayMotions.cpp +++ /dev/null @@ -1,135 +0,0 @@ -#include "stdafx.h" -#include "dCylinder/dCylinder.h" -int dCollideCylRay(dxGeom *o1, dxGeom *o2, int flags,dContactGeom *contact, int skip); -//#pragma warning(disable:4995) -//#pragma warning(disable:4267) -//#include "../3rd party/ode/ode/src/collision_kernel.h" -//#pragma warning(default:4995) -//#pragma warning(default:4267) - -#pragma warning(disable:4995) -#pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/collision_std.h" -#pragma warning(default:4995) -#pragma warning(default:4267) -struct dxRayMotions -{ - dGeomID ray; - dGeomID ray_ownwer; - dxRayMotions() - { - ray=0; - ray_ownwer=0; - } -}; - -int dRayMotionsClassUser = -1; - -#define CONTACT(p,skip) ((dContactGeom*) (((char*)p) + (skip))) - - - - - - -int dCollideRMB (dxGeom *o1, dxGeom *o2, int flags, - dContactGeom *contact, int skip) -{ - dxRayMotions *rm = (dxRayMotions*) dGeomGetClassData(o1); - int ret= dCollideRayBox (rm->ray,o2, flags,contact,skip); - for (int i=0; ig1 = rm->ray_ownwer; - //c->depth*=60.f; - } - return ret; -} - -int dCollideRMS(dxGeom *o1, dxGeom *o2, int flags, - dContactGeom *contact, int skip) -{ - dxRayMotions *rm = (dxRayMotions*) dGeomGetClassData(o1); - int ret= dCollideRaySphere (rm->ray, o2,flags, contact, skip); - for (int i=0; ig1 = rm->ray_ownwer; - //c->depth*=60.f; - } - return ret; -} -inline void revert_contact(dContactGeom *c) -{ - c->normal[0] = -c->normal[0]; - c->normal[1] = -c->normal[1]; - c->normal[2] = -c->normal[2]; - dxGeom *tmp = c->g1; - c->g1 = c->g2; - c->g2 = tmp; -} -int dCollideRMCyl (dxGeom *o1, dxGeom *o2, int flags, - dContactGeom *contact, int skip) -{ - dxRayMotions *rm = (dxRayMotions*) dGeomGetClassData(o1); - int ret= dCollideCylRay (o2,rm->ray,flags,contact,skip); - for (int i=0; ig1 = rm->ray_ownwer; - } - return ret; -} - -static dColliderFn * dRayMotionsColliderFn (int num) -{ - if (num == dBoxClass) return (dColliderFn *) &dCollideRMB; - if (num == dSphereClass) return (dColliderFn *) &dCollideRMS; - if (num == dCylinderClassUser) return (dColliderFn *) &dCollideRMCyl; - return 0; -} - - -static void dRayMotionsAABB (dxGeom *geom, dReal aabb[6]) -{ - dxRayMotions *c = (dxRayMotions*) dGeomGetClassData(geom); - dGeomGetAABB(c->ray,aabb); - ///dInfiniteAABB(geom,aabb); -} -void dGeomRayMotionDestroy (dGeomID ray) -{ - dGeomDestroy(((dxRayMotions*)dGeomGetClassData(ray))->ray); -} -dxGeom *dCreateRayMotions (dSpaceID space) -{ - if (dRayMotionsClassUser == -1) - { - dGeomClass c; - c.bytes = sizeof (dxRayMotions); - c.collider = &dRayMotionsColliderFn; - c.aabb = &dRayMotionsAABB; - c.aabb_test = 0; - c.dtor = &dGeomRayMotionDestroy; - dRayMotionsClassUser =dCreateGeomClass (&c); - - } - dGeomID g = dCreateGeom (dRayMotionsClassUser); - if (space) dSpaceAdd (space,g); - dxRayMotions *c = (dxRayMotions*) dGeomGetClassData(g); - c->ray=dCreateRay(space,REAL(1.)); - return g; -} - -void dGeomRayMotionsSet (dGeomID g,const dReal* p,const dReal* d, dReal l) -{ - dxRayMotions *c = (dxRayMotions*) dGeomGetClassData(g); - dGeomRaySetLength (c->ray, l); - dGeomRaySet (c->ray, p[0], p[1], p[2], - d[0], d[1], d[2]); - dGeomMoved(g); - -} - -void dGeomRayMotionSetGeom(dGeomID rm,dGeomID g) -{ - dxRayMotions *c = (dxRayMotions*) dGeomGetClassData(rm); - c->ray_ownwer=g; -} diff --git a/src/xrGame/dRayMotions.h b/src/xrGame/dRayMotions.h deleted file mode 100644 index c2ec12fe6fb..00000000000 --- a/src/xrGame/dRayMotions.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef dRayMotions_h -#define dRayMotions_h - -struct dxRayMotions; -extern int dRayMotionsClassUser; - - -dxGeom *dCreateRayMotions (dSpaceID space); -void dGeomRayMotionsSet (dGeomID g,const dReal* p,const dReal* d, dReal l); -void dGeomRayMotionSetGeom(dGeomID rm,dGeomID g); - -#endif //dRayMotions_h \ No newline at end of file diff --git a/src/xrGame/damage_manager.cpp b/src/xrGame/damage_manager.cpp index 21887d73390..df4e4ac6ea0 100644 --- a/src/xrGame/damage_manager.cpp +++ b/src/xrGame/damage_manager.cpp @@ -9,8 +9,8 @@ #include "stdafx.h" #include "damage_manager.h" -#include "../xrEngine/xr_object.h" -#include "../Include/xrRender/Kinematics.h" +#include "xrEngine/xr_object.h" +#include "Include/xrRender/Kinematics.h" #include "xrCore/Animation/Bone.hpp" CDamageManager::CDamageManager () diff --git a/src/xrGame/dbg_draw_frustum.cpp b/src/xrGame/dbg_draw_frustum.cpp index 9e88e95837e..d5983b02b10 100644 --- a/src/xrGame/dbg_draw_frustum.cpp +++ b/src/xrGame/dbg_draw_frustum.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "level.h" -#include "../xrCDB/frustum.h" +#include "Level.h" +#include "xrCDB/frustum.h" #ifdef DEBUG # include "debug_renderer.h" diff --git a/src/xrGame/dcylinder/dCylinder.cpp b/src/xrGame/dcylinder/dCylinder.cpp deleted file mode 100644 index 4eab319ae67..00000000000 --- a/src/xrGame/dcylinder/dCylinder.cpp +++ /dev/null @@ -1,1545 +0,0 @@ -#include "stdafx.h" -#include "dCylinder.h" -// given a pointer `p' to a dContactGeom, return the dContactGeom at -// p + skip bytes. - -#define M_SIN_PI_3 REAL(0.8660254037844386467637231707529362) -#define M_COS_PI_3 REAL(0.5000000000000000000000000000000000) - -struct dxCylinder { // cylinder - dReal radius,lz; // radius, length along y axis // -}; - -int dCylinderClassUser = -1; - -#define NUMC_MASK (0xffff) - -#define CONTACT(p,skip) ((dContactGeom*) (((char*)p) + (skip))) - -///////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////circleIntersection////////////////////////////////////////////////// -//this does following: -//takes two circles as normals to planes n1,n2, center points cp1,cp2,and radiuses r1,r2 -//finds line on which circles' planes intersect -//finds four points O1,O2 - intersection between the line and sphere with center cp1 radius r1 -// O3,O4 - intersection between the line and sphere with center cp2 radius r2 -//returns false if there is no intersection -//computes distances O1-O3, O1-O4, O2-O3, O2-O4 -//in "point" returns mean point between intersection points with smallest distance -///////////////////////////////////////////////////////////////////////////////////////////////// -inline bool circleIntersection(const dReal* n1,const dReal* cp1,dReal r1,const dReal* n2,const dReal* cp2,dReal r2,dVector3 point){ -dReal c1=dDOT14(cp1,n1); -dReal c2=dDOT14(cp2,n2); -dReal _cos=dDOT44(n1,n2); -dReal cos_2=_cos*_cos; -dReal sin_2=1.f-cos_2; -dReal p1=(c1-c2*_cos)/sin_2; -dReal p2=(c2-c1*_cos)/sin_2; -dVector3 lp={p1*n1[0]+p2*n2[0],p1*n1[4]+p2*n2[4],p1*n1[8]+p2*n2[8]}; -dVector3 n; -dCROSS144(n,=,n1,n2); -dVector3 LC1={lp[0]-cp1[0],lp[1]-cp1[1],lp[2]-cp1[2]}; -dVector3 LC2={lp[0]-cp2[0],lp[1]-cp2[1],lp[2]-cp2[2]}; -dReal A,B,C,B_A,B_A_2,D; -dReal t1,t2,t3,t4; -A=dDOT(n,n); -B=dDOT(LC1,n); -C=dDOT(LC1,LC1)-r1*r1; -B_A=B/A; -B_A_2=B_A*B_A; -D=B_A_2-C; -if(D<0.f){ //somewhat strange solution - //- it is needed to set some - //axis to sepparate cylinders - //when their edges approach - t1=-B_A+dSqrt(-D); - t2=-B_A-dSqrt(-D); -// return false; - } -else{ -t1=-B_A-dSqrt(D); -t2=-B_A+dSqrt(D); -} -B=dDOT(LC2,n); -C=dDOT(LC2,LC2)-r2*r2; -B_A=B/A; -B_A_2=B_A*B_A; -D=B_A_2-C; - -if(D<0.f) { - t3=-B_A+dSqrt(-D); - t4=-B_A-dSqrt(-D); -// return false; - } -else{ -t3=-B_A-dSqrt(D); -t4=-B_A+dSqrt(D); -} -dVector3 O1={lp[0]+n[0]*t1,lp[1]+n[1]*t1,lp[2]+n[2]*t1}; -dVector3 O2={lp[0]+n[0]*t2,lp[1]+n[1]*t2,lp[2]+n[2]*t2}; - -dVector3 O3={lp[0]+n[0]*t3,lp[1]+n[1]*t3,lp[2]+n[2]*t3}; -dVector3 O4={lp[0]+n[0]*t4,lp[1]+n[1]*t4,lp[2]+n[2]*t4}; - -dVector3 L1_3={O3[0]-O1[0],O3[1]-O1[1],O3[2]-O1[2]}; -dVector3 L1_4={O4[0]-O1[0],O4[1]-O1[1],O4[2]-O1[2]}; - -dVector3 L2_3={O3[0]-O2[0],O3[1]-O2[1],O3[2]-O2[2]}; -dVector3 L2_4={O4[0]-O2[0],O4[1]-O2[1],O4[2]-O2[2]}; - - -dReal l1_3=dDOT(L1_3,L1_3); -dReal l1_4=dDOT(L1_4,L1_4); - -dReal l2_3=dDOT(L2_3,L2_3); -dReal l2_4=dDOT(L2_4,L2_4); - - -if (l1_3 0) return 0; \ - if (s2 > s) { \ - s = s2; \ - normalR = norm; \ - invert_normal = ((expr1) < 0); \ - *code = (cc); \ - } - - s = -dInfinity; - invert_normal = 0; - *code = 0; - - // separating axis = cylinder ax u2 - //used when a box vertex touches a flat face of the cylinder - TEST (pp[1],(hlz + B1*Q21 + B2*Q22 + B3*Q23),R1+1,0); - - - // separating axis = box axis v1,v2,v3 - //used when cylinder edge touches box face - //there is two ways to compute sQ: sQ21=dSqrt(1.f-Q21*Q21); or sQ21=dSqrt(Q23*Q23+Q22*Q22); - //if we did not need Q23 and Q22 the first way might be used to quiken the routine but then it need to - //check if Q21<=1.f, becouse it may slightly exeed 1.f. - - - sQ21=dSqrt(Q23*Q23+Q22*Q22); - TEST (dDOT41(R2+0,p),(radius*sQ21 + hlz*Q21 + B1),R2+0,1); - - sQ22=dSqrt(Q23*Q23+Q21*Q21); - TEST (dDOT41(R2+1,p),(radius*sQ22 + hlz*Q22 + B2),R2+1,2); - - sQ23=dSqrt(Q22*Q22+Q21*Q21); - TEST (dDOT41(R2+2,p),(radius*sQ23 + hlz*Q23 + B3),R2+2,3); - - -#undef TEST -#define TEST(expr1,expr2,n1,n2,n3,cc) \ - s2 = dFabs(expr1) - (expr2); \ - if (s2 > 0) return 0; \ - if (s2 > s) { \ - s = s2; \ - normalR = 0; \ - normalC[0] = (n1); normalC[1] = (n2); normalC[2] = (n3); \ - invert_normal = ((expr1) < 0); \ - *code = (cc); \ - } - - - -// separating axis is a normal to the cylinder axis passing across the nearest box vertex -//used when a box vertex touches the lateral surface of the cylinder - -dReal proj,boxProj,_cos,_sin,cos1,cos3; -dVector3 tAx,Ax,pb; -{ -//making Ax which is perpendicular to cyl ax to box position// -proj=dDOT14(p2,R1+1)-dDOT14(p1,R1+1); - -Ax[0]=p2[0]-p1[0]-R1[1]*proj; -Ax[1]=p2[1]-p1[1]-R1[5]*proj; -Ax[2]=p2[2]-p1[2]-R1[9]*proj; -dNormalize3(Ax); -//using Ax find box vertex which is nearest to the cylinder axis - dReal sign; - - for (i=0; i<3; ++i) pb[i] = p2[i]; - sign = (dDOT14(Ax,R2+0) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) pb[i] += sign * B1 * R2[i*4]; - sign = (dDOT14(Ax,R2+1) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) pb[i] += sign * B2 * R2[i*4+1]; - sign = (dDOT14(Ax,R2+2) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) pb[i] += sign * B3 * R2[i*4+2]; - -//building axis which is normal to cylinder ax to the nearest box vertex -proj=dDOT14(pb,R1+1)-dDOT14(p1,R1+1); - -Ax[0]=pb[0]-p1[0]-R1[1]*proj; -Ax[1]=pb[1]-p1[1]-R1[5]*proj; -Ax[2]=pb[2]-p1[2]-R1[9]*proj; -dNormalize3(Ax); -} - -boxProj=dFabs(dDOT14(Ax,R2+0)*B1)+ - dFabs(dDOT14(Ax,R2+1)*B2)+ - dFabs(dDOT14(Ax,R2+2)*B3); - -TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(radius+boxProj),Ax[0],Ax[1],Ax[2],4); - - -//next three test used to handle collisions between cylinder circles and box ages -proj=dDOT14(p1,R2+0)-dDOT14(p2,R2+0); - -tAx[0]=-p1[0]+p2[0]+R2[0]*proj; -tAx[1]=-p1[1]+p2[1]+R2[4]*proj; -tAx[2]=-p1[2]+p2[2]+R2[8]*proj; -dNormalize3(tAx); - -//now tAx is normal to first ax of the box to cylinder center -//making perpendicular to tAx lying in the plane which is normal to the cylinder axis -//it is tangent in the point where projection of tAx on cylinder's ring intersect edge circle - -_cos=dDOT14(tAx,R1+0); -_sin=dDOT14(tAx,R1+2); -tAx[0]=R1[2]*_cos-R1[0]*_sin; -tAx[1]=R1[6]*_cos-R1[4]*_sin; -tAx[2]=R1[10]*_cos-R1[8]*_sin; - - -//use cross between tAx and first ax of the box as separating axix - -dCROSS114(Ax,=,tAx,R2+0); -dNormalize3(Ax); - -boxProj=dFabs(dDOT14(Ax,R2+1)*B2)+ - dFabs(dDOT14(Ax,R2+0)*B1)+ - dFabs(dDOT14(Ax,R2+2)*B3); - - _cos=dFabs(dDOT14(Ax,R1+1)); - cos1=dDOT14(Ax,R1+0); - cos3=dDOT14(Ax,R1+2); - _sin=dSqrt(cos1*cos1+cos3*cos3); - -TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(_sin*radius+_cos*hlz+boxProj),Ax[0],Ax[1],Ax[2],5); - - -//same thing with the second axis of the box -proj=dDOT14(p1,R2+1)-dDOT14(p2,R2+1); - -tAx[0]=-p1[0]+p2[0]+R2[1]*proj; -tAx[1]=-p1[1]+p2[1]+R2[5]*proj; -tAx[2]=-p1[2]+p2[2]+R2[9]*proj; -dNormalize3(tAx); - - -_cos=dDOT14(tAx,R1+0); -_sin=dDOT14(tAx,R1+2); -tAx[0]=R1[2]*_cos-R1[0]*_sin; -tAx[1]=R1[6]*_cos-R1[4]*_sin; -tAx[2]=R1[10]*_cos-R1[8]*_sin; - -dCROSS114(Ax,=,tAx,R2+1); -dNormalize3(Ax); - -boxProj=dFabs(dDOT14(Ax,R2+0)*B1)+ - dFabs(dDOT14(Ax,R2+1)*B2)+ - dFabs(dDOT14(Ax,R2+2)*B3); - - _cos=dFabs(dDOT14(Ax,R1+1)); - cos1=dDOT14(Ax,R1+0); - cos3=dDOT14(Ax,R1+2); - _sin=dSqrt(cos1*cos1+cos3*cos3); -TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(_sin*radius+_cos*hlz+boxProj),Ax[0],Ax[1],Ax[2],6); - -//same thing with the third axis of the box -proj=dDOT14(p1,R2+2)-dDOT14(p2,R2+2); - -Ax[0]=-p1[0]+p2[0]+R2[2]*proj; -Ax[1]=-p1[1]+p2[1]+R2[6]*proj; -Ax[2]=-p1[2]+p2[2]+R2[10]*proj; -dNormalize3(tAx); - -_cos=dDOT14(tAx,R1+0); -_sin=dDOT14(tAx,R1+2); -tAx[0]=R1[2]*_cos-R1[0]*_sin; -tAx[1]=R1[6]*_cos-R1[4]*_sin; -tAx[2]=R1[10]*_cos-R1[8]*_sin; - -dCROSS114(Ax,=,tAx,R2+2); -dNormalize3(Ax); -boxProj=dFabs(dDOT14(Ax,R2+1)*B2)+ - dFabs(dDOT14(Ax,R2+2)*B3)+ - dFabs(dDOT14(Ax,R2+0)*B1); - - _cos=dFabs(dDOT14(Ax,R1+1)); - cos1=dDOT14(Ax,R1+0); - cos3=dDOT14(Ax,R1+2); - _sin=dSqrt(cos1*cos1+cos3*cos3); -TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(_sin*radius+_cos*hlz+boxProj),Ax[0],Ax[1],Ax[2],7); - - -#undef TEST - -// note: cross product axes need to be scaled when s is computed. -// normal (n1,n2,n3) is relative to box 1. - -#define TEST(expr1,expr2,n1,n2,n3,cc) \ - s2 = dFabs(expr1) - (expr2); \ - if (s2 > 0) return 0; \ - l = dSqrt ((n1)*(n1) + (n2)*(n2) + (n3)*(n3)); \ - if (l > 0) { \ - s2 /= l; \ - if (s2 > s) { \ - s = s2; \ - normalR = 0; \ - normalC[0] = (n1)/l; normalC[1] = (n2)/l; normalC[2] = (n3)/l; \ - invert_normal = ((expr1) < 0); \ - *code = (cc); \ - } \ - } - -//crosses between cylinder axis and box axes - // separating axis = u2 x (v1,v2,v3) - TEST(pp[0]*R31-pp[2]*R11,(radius+B2*Q23+B3*Q22),R31,0,-R11,8); - TEST(pp[0]*R32-pp[2]*R12,(radius+B1*Q23+B3*Q21),R32,0,-R12,9); - TEST(pp[0]*R33-pp[2]*R13,(radius+B1*Q22+B2*Q21),R33,0,-R13,10); - - -#undef TEST - - // if we get to this point, the boxes interpenetrate. compute the normal - // in global coordinates. - if (normalR) { - normal[0] = normalR[0]; - normal[1] = normalR[4]; - normal[2] = normalR[8]; - } - else { - if(*code>7) dMULTIPLY0_331 (normal,R1,normalC); - else {normal[0] =normalC[0];normal[1] = normalC[1];normal[2] = normalC[2];} - } - - if (invert_normal) { - normal[0] = -normal[0]; - normal[1] = -normal[1]; - normal[2] = -normal[2]; - } - *depth = -s; - - // compute contact point(s) - - if (*code > 7) { - //find point on the cylinder pa deepest along normal - dVector3 pa; - dReal sign, cos1,cos3,factor; - - - for (i=0; i<3; ++i) pa[i] = p1[i]; - - cos1 = dDOT14(normal,R1+0); - cos3 = dDOT14(normal,R1+2) ; - factor=dSqrt(cos1*cos1+cos3*cos3); - - cos1/=factor; - cos3/=factor; - - for (i=0; i<3; ++i) pa[i] += cos1 * radius * R1[i*4]; - - sign = (dDOT14(normal,R1+1) > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) pa[i] += sign * hlz * R1[i*4+1]; - - - for (i=0; i<3; ++i) pa[i] += cos3 * radius * R1[i*4+2]; - - // find vertex of the box deepest along normal - dVector3 pb; - for (i=0; i<3; ++i) pb[i] = p2[i]; - sign = (dDOT14(normal,R2+0) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) pb[i] += sign * B1 * R2[i*4]; - sign = (dDOT14(normal,R2+1) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) pb[i] += sign * B2 * R2[i*4+1]; - sign = (dDOT14(normal,R2+2) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) pb[i] += sign * B3 * R2[i*4+2]; - - - dReal alpha,beta; - dVector3 ua,ub; - for (i=0; i<3; ++i) ua[i] = R1[1 + i*4]; - for (i=0; i<3; ++i) ub[i] = R2[*code-8 + i*4]; - - lineClosestApproach (pa,ua,pb,ub,&alpha,&beta); - for (i=0; i<3; ++i) pa[i] += ua[i]*alpha; - for (i=0; i<3; ++i) pb[i] += ub[i]*beta; - - for (i=0; i<3; ++i) contact[0].pos[i] = REAL(0.5)*(pa[i]+pb[i]); - contact[0].depth = *depth; - return 1; - } - - - if(*code==4){ - for (i=0; i<3; ++i) contact[0].pos[i] = pb[i]; - contact[0].depth = *depth; - return 1; - } - - - dVector3 vertex; - if (*code == 0) { - - dReal sign; - for (i=0; i<3; ++i) vertex[i] = p2[i]; - sign = (dDOT14(normal,R2+0) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) vertex[i] += sign * B1 * R2[i*4]; - sign = (dDOT14(normal,R2+1) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) vertex[i] += sign * B2 * R2[i*4+1]; - sign = (dDOT14(normal,R2+2) > 0) ? REAL(-1.0) : REAL(1.0); - for (i=0; i<3; ++i) vertex[i] += sign * B3 * R2[i*4+2]; - } - else { - - dReal sign,cos1,cos3,factor; - dVector3 center; - cos1 = dDOT14(normal,R1+0) ; - cos3 = dDOT14(normal,R1+2); - factor=dSqrt(cos1*cos1+cos3*cos3); - factor= factor ? factor : 1.f; - cos1/=factor; - cos3/=factor; - sign = (dDOT14(normal,R1+1) > 0) ? REAL(1.0) : REAL(-1.0); - - for (i=0; i<3; ++i) center[i] = p1[i]+sign * hlz * R1[i*4+1]; - for (i=0; i<3; ++i) vertex[i] = center[i]+cos1 * radius * R1[i*4]; - for (i=0; i<3; ++i) vertex[i] += cos3 * radius * R1[i*4+2]; - if(*code<4) - { - - dReal A1,A3,centerDepth,Q1,Q3,sQ2; - - - Q1=Q11;Q3=Q31;sQ2=sQ21; - int ret=1; - switch(*code) { - //case 1: - // centerDepth=*depth-radius*sQ21; - // Q1=Q11;Q3=Q31; - // break; - case 2: - sQ2=sQ22; - Q1=Q12;Q3=Q32; - break; - case 3: - sQ2=sQ23; - Q1=Q13;Q3=Q33; - break; - - } - - if(sQ2pos[0]=center[0]+A1*R1[0]+A3*R1[2]; - CONTACT(contact,ret*skip)->pos[1]=center[1]+A1*R1[4]+A3*R1[6]; - CONTACT(contact,ret*skip)->pos[2]=center[2]+A1*R1[8]+A3*R1[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+Q1*A1+Q3*A3; - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - - A1=(-cos1*M_COS_PI_3+cos3*M_SIN_PI_3)*radius; - A3=(-cos3*M_COS_PI_3-cos1*M_SIN_PI_3)*radius; - CONTACT(contact,ret*skip)->pos[0]=center[0]+A1*R1[0]+A3*R1[2]; - CONTACT(contact,ret*skip)->pos[1]=center[1]+A1*R1[4]+A3*R1[6]; - CONTACT(contact,ret*skip)->pos[2]=center[2]+A1*R1[8]+A3*R1[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+Q1*A1+Q3*A3; - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - } - - for (i=0; i<3; ++i) contact[0].pos[i] = vertex[i]; - contact[0].depth = *depth; - return ret; - } - - } - for (i=0; i<3; ++i) contact[0].pos[i] = vertex[i]; - contact[0].depth = *depth; - return 1; -} - -//**************************************************************************** - -extern "C" int dCylCyl (const dVector3 p1, const dMatrix3 R1, - const dReal radius1,const dReal lz1, const dVector3 p2, - const dMatrix3 R2, const dReal radius2,const dReal lz2, - dVector3 normal, dReal *depth, int *code, - int maxc, dContactGeom *contact, int skip) -{ - dVector3 p,pp1,pp2,normalC; - const dReal *normalR = 0; - dReal hlz1,hlz2,s,s2; - int i,invert_normal; - - // get vector3 from centers of box 1 to box 2, relative to box 1 - p[0] = p2[0] - p1[0]; - p[1] = p2[1] - p1[1]; - p[2] = p2[2] - p1[2]; - dMULTIPLY1_331 (pp1,R1,p); // get pp1 = p relative to body 1 - dMULTIPLY1_331 (pp2,R2,p); - // get side lengths / 2 - hlz1 = lz1*REAL(0.5); - hlz2 = lz2*REAL(0.5); - - dReal proj,cos1,cos3; - - - -#define TEST(expr1,expr2,norm,cc) \ - s2 = dFabs(expr1) - (expr2); \ - if (s2 > 0) return 0; \ - if (s2 > s) { \ - s = s2; \ - normalR = norm; \ - invert_normal = ((expr1) < 0); \ - *code = (cc); \ - } - - s = -dInfinity; - invert_normal = 0; - *code = 0; - - dReal c_cos=dFabs(dDOT44(R1+1,R2+1)); - dReal c_sin=dSqrt(1.f-(c_cos>1.f ? 1.f : c_cos)); - - TEST (pp1[1],(hlz1 + radius2*c_sin + hlz2*c_cos ),R1+1,0);//pp - - /// TEST (pp2[1],(radius1*c_sin + hlz1*c_cos + hlz2),R2+1,1); - - - - // note: cross product axes need to be scaled when s is computed. - -#undef TEST -#define TEST(expr1,expr2,n1,n2,n3,cc) \ - s2 = dFabs(expr1) - (expr2); \ - if (s2 > 0) return 0; \ - if (s2 > s) { \ - s = s2; \ - normalR = 0; \ - normalC[0] = (n1); normalC[1] = (n2); normalC[2] = (n3); \ - invert_normal = ((expr1) < 0); \ - *code = (cc); \ - } - - -dVector3 tAx,Ax,pa,pb; - -//cross between cylinders' axes -dCROSS144(Ax,=,R1+1,R2+1); -dNormalize3(Ax); -TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],radius1+radius2,Ax[0],Ax[1],Ax[2],6); - - -{ - - dReal sign, factor; - - //making ax which is perpendicular to cyl1 ax passing across cyl2 position// - //(project p on cyl1 flat surface ) - for (i=0; i<3; ++i) pb[i] = p2[i]; - //cos1 = dDOT14(p,R1+0); - //cos3 = dDOT14(p,R1+2) ; - tAx[0]=pp1[0]*R1[0]+pp1[2]*R1[2]; - tAx[1]=pp1[0]*R1[4]+pp1[2]*R1[6]; - tAx[2]=pp1[0]*R1[8]+pp1[2]*R1[10]; - dNormalize3(tAx); - -//find deepest point pb of cyl2 on opposite direction of tAx - cos1 = dDOT14(tAx,R2+0); - cos3 = dDOT14(tAx,R2+2) ; - factor=dSqrt(cos1*cos1+cos3*cos3); - cos1/=factor; - cos3/=factor; - for (i=0; i<3; ++i) pb[i] -= cos1 * radius2 * R2[i*4]; - - sign = (dDOT14(tAx,R2+1) > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) pb[i] -= sign * hlz2 * R2[i*4+1]; - - for (i=0; i<3; ++i) pb[i] -= cos3 * radius2 * R2[i*4+2]; - -//making perpendicular to cyl1 ax passing across pb - proj=dDOT14(pb,R1+1)-dDOT14(p1,R1+1); - - Ax[0]=pb[0]-p1[0]-R1[1]*proj; - Ax[1]=pb[1]-p1[1]-R1[5]*proj; - Ax[2]=pb[2]-p1[2]-R1[9]*proj; - -} - -dNormalize3(Ax); - - - dReal _cos=dFabs(dDOT14(Ax,R2+1)); - cos1=dDOT14(Ax,R2+0); - cos3=dDOT14(Ax,R2+2); - dReal _sin=dSqrt(cos1*cos1+cos3*cos3); - -TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],radius1+_cos*hlz2+_sin*radius2,Ax[0],Ax[1],Ax[2],3); - - - -{ - - dReal sign, factor; - - for (i=0; i<3; ++i) pa[i] = p1[i]; - - //making ax which is perpendicular to cyl2 ax passing across cyl1 position// - //(project p on cyl2 flat surface ) - //cos1 = dDOT14(p,R2+0); - //cos3 = dDOT14(p,R2+2) ; - tAx[0]=pp2[0]*R2[0]+pp2[2]*R2[2]; - tAx[1]=pp2[0]*R2[4]+pp2[2]*R2[6]; - tAx[2]=pp2[0]*R2[8]+pp2[2]*R2[10]; - dNormalize3(tAx); - - cos1 = dDOT14(tAx,R1+0); - cos3 = dDOT14(tAx,R1+2) ; - factor=dSqrt(cos1*cos1+cos3*cos3); - cos1/=factor; - cos3/=factor; - -//find deepest point pa of cyl2 on direction of tAx - for (i=0; i<3; ++i) pa[i] += cos1 * radius1 * R1[i*4]; - - sign = (dDOT14(tAx,R1+1) > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) pa[i] += sign * hlz1 * R1[i*4+1]; - - - for (i=0; i<3; ++i) pa[i] += cos3 * radius1 * R1[i*4+2]; - - proj=dDOT14(pa,R2+1)-dDOT14(p2,R2+1); - - Ax[0]=pa[0]-p2[0]-R2[1]*proj; - Ax[1]=pa[1]-p2[1]-R2[5]*proj; - Ax[2]=pa[2]-p2[2]-R2[9]*proj; - -} -dNormalize3(Ax); - - - - _cos=dFabs(dDOT14(Ax,R1+1)); - cos1=dDOT14(Ax,R1+0); - cos3=dDOT14(Ax,R1+2); - _sin=dSqrt(cos1*cos1+cos3*cos3); - -TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],radius2+_cos*hlz1+_sin*radius1,Ax[0],Ax[1],Ax[2],4); - - -////test circl - -//@ this needed to set right normal when cylinders edges intersect -//@ the most precise axis for this test may be found as a line between nearest points of two -//@ circles. But it needs comparatively a lot of computation. -//@ I use a trick which lets not to solve quadric equation. -//@ In the case when cylinder eidges touches the test below rather accurate. -//@ I still not sure about problems with sepparation but they have not been revealed during testing. -dVector3 point; -{ - dVector3 ca,cb; - dReal sign; - for (i=0; i<3; ++i) ca[i] = p1[i]; - for (i=0; i<3; ++i) cb[i] = p2[i]; -//find two nearest flat rings - sign = (pp1[1] > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) ca[i] += sign * hlz1 * R1[i*4+1]; - - sign = (pp2[1] > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) cb[i] -= sign * hlz2 * R2[i*4+1]; - - dVector3 tAx,tAx1; - circleIntersection(R1+1,ca,radius1,R2+1,cb,radius2,point); - - Ax[0]=point[0]-ca[0]; - Ax[1]=point[1]-ca[1]; - Ax[2]=point[2]-ca[2]; - - cos1 = dDOT14(Ax,R1+0); - cos3 = dDOT14(Ax,R1+2) ; - - tAx[0]=cos3*R1[0]-cos1*R1[2]; - tAx[1]=cos3*R1[4]-cos1*R1[6]; - tAx[2]=cos3*R1[8]-cos1*R1[10]; - - Ax[0]=point[0]-cb[0]; - Ax[1]=point[1]-cb[1]; - Ax[2]=point[2]-cb[2]; - - - cos1 = dDOT14(Ax,R2+0); - cos3 = dDOT14(Ax,R2+2) ; - - tAx1[0]=cos3*R2[0]-cos1*R2[2]; - tAx1[1]=cos3*R2[4]-cos1*R2[6]; - tAx1[2]=cos3*R2[8]-cos1*R2[10]; - dCROSS(Ax,=,tAx,tAx1); - - - - -dNormalize3(Ax); -dReal cyl1Pr,cyl2Pr; - - _cos=dFabs(dDOT14(Ax,R1+1)); - cos1=dDOT14(Ax,R1+0); - cos3=dDOT14(Ax,R1+2); - _sin=dSqrt(cos1*cos1+cos3*cos3); - cyl1Pr=_cos*hlz1+_sin*radius1; - - _cos=dFabs(dDOT14(Ax,R2+1)); - cos1=dDOT14(Ax,R2+0); - cos3=dDOT14(Ax,R2+2); - _sin=dSqrt(cos1*cos1+cos3*cos3); - cyl2Pr=_cos*hlz2+_sin*radius2; -TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],cyl1Pr+cyl2Pr,Ax[0],Ax[1],Ax[2],5); - - -} - - -#undef TEST - - - - // if we get to this point, the cylinders interpenetrate. compute the normal - // in global coordinates. - if (normalR) { - normal[0] = normalR[0]; - normal[1] = normalR[4]; - normal[2] = normalR[8]; - } - else { - normal[0] =normalC[0];normal[1] = normalC[1];normal[2] = normalC[2]; - } - if (invert_normal) { - normal[0] = -normal[0]; - normal[1] = -normal[1]; - normal[2] = -normal[2]; - } - - *depth = -s; - - // compute contact point(s) - - if(*code==3){ - for (i=0; i<3; ++i) contact[0].pos[i] = pb[i]; - contact[0].depth = *depth; - return 1; - } - - if(*code==4){ - for (i=0; i<3; ++i) contact[0].pos[i] = pa[i]; - contact[0].depth = *depth; - return 1; - } - - if(*code==5){ - for (i=0; i<3; ++i) contact[0].pos[i] = point[i]; - contact[0].depth = *depth; - return 1; - } - -if (*code == 6) { - dVector3 pa; - dReal sign, cos1,cos3,factor; - - - for (i=0; i<3; ++i) pa[i] = p1[i]; - - cos1 = dDOT14(normal,R1+0); - cos3 = dDOT14(normal,R1+2) ; - factor=dSqrt(cos1*cos1+cos3*cos3); - if(factor>0.f) - { - cos1/=factor; - cos3/=factor; - } - for (i=0; i<3; ++i) pa[i] += cos1 * radius1 * R1[i*4]; - - sign = (dDOT14(normal,R1+1) > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) pa[i] += sign * hlz1 * R1[i*4+1]; - - - for (i=0; i<3; ++i) pa[i] += cos3 * radius1 * R1[i*4+2]; - - // find a point pb on the intersecting edge of cylinder 2 - dVector3 pb; - for (i=0; i<3; ++i) pb[i] = p2[i]; - cos1 = dDOT14(normal,R2+0); - cos3 = dDOT14(normal,R2+2) ; - factor=dSqrt(cos1*cos1+cos3*cos3); - if(factor>0.f) - { - cos1/=factor; - cos3/=factor; - } - for (i=0; i<3; ++i) pb[i] -= cos1 * radius2 * R2[i*4]; - - sign = (dDOT14(normal,R2+1) > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) pb[i] -= sign * hlz2 * R2[i*4+1]; - - - for (i=0; i<3; ++i) pb[i] -= cos3 * radius2 * R2[i*4+2]; - - - dReal alpha,beta; - dVector3 ua,ub; - for (i=0; i<3; ++i) ua[i] = R1[1 + i*4]; - for (i=0; i<3; ++i) ub[i] = R2[1 + i*4]; - lineClosestApproach (pa,ua,pb,ub,&alpha,&beta); - for (i=0; i<3; ++i) pa[i] += ua[i]*alpha; - for (i=0; i<3; ++i) pb[i] += ub[i]*beta; - - for (i=0; i<3; ++i) contact[0].pos[i] = REAL(0.5)*(pa[i]+pb[i]); - contact[0].depth = *depth; - return 1; - } - - // okay, we have a face-something intersection (because the separating - // axis is perpendicular to a face). - - // @@@ temporary: make deepest point on the "other" cylinder the contact point. - // @@@ this kind of works, but we need multiple contact points for stability, - // @@@ especially for face-face contact. - - dVector3 vertex; - int ret=1; - if (*code == 0) { - - // flat face from cylinder 1 touches a edge/face from cylinder 2. - dReal sign,cos1,cos3,factor; - // for (i=0; i<3; ++i) vertex[i] = p2[i]; - cos1 = dDOT14(normal,R2+0) ; - cos3 = dDOT14(normal,R2+2); - factor=dSqrt(cos1*cos1+cos3*cos3); - if(factor>0.f) - { - cos1/=factor; - cos3/=factor; - } - dVector3 center; - - sign = (dDOT14(normal,R2+1) > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) center[i] =p2[i]- sign * hlz2 * R2[i*4+1]; - - for (i=0; i<3; ++i) vertex[i] =center[i]- cos1 * radius2 * R2[i*4]; - - for (i=0; i<3; ++i) vertex[i] -=cos3 * radius2 * R2[i*4+2]; - - - dReal A1,A3,centerDepth,Q1,Q3; - centerDepth=*depth-radius2*(factor); - Q1=-(dDOT14(normal,R2+0));Q3=-(dDOT14(normal,R2+2)); - - A1=-(-cos1*M_COS_PI_3-cos3*M_SIN_PI_3)*radius2; - A3=-(-cos3*M_COS_PI_3+cos1*M_SIN_PI_3)*radius2; - CONTACT(contact,ret*skip)->pos[0]=center[0]+A1*R2[0]+A3*R2[2]; - CONTACT(contact,ret*skip)->pos[1]=center[1]+A1*R2[4]+A3*R2[6]; - CONTACT(contact,ret*skip)->pos[2]=center[2]+A1*R2[8]+A3*R2[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+(Q1*A1)+(Q3*A3); - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - - A1=-(-cos1*M_COS_PI_3+cos3*M_SIN_PI_3)*radius2; - A3=-(-cos3*M_COS_PI_3-cos1*M_SIN_PI_3)*radius2; - CONTACT(contact,ret*skip)->pos[0]=center[0]+A1*R2[0]+A3*R2[2]; - CONTACT(contact,ret*skip)->pos[1]=center[1]+A1*R2[4]+A3*R2[6]; - CONTACT(contact,ret*skip)->pos[2]=center[2]+A1*R2[8]+A3*R2[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+(Q1*A1)+(Q3*A3); - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - - } - else { - // flat face from cylinder 2 touches a edge/face from cylinder 1. - dReal sign,cos1,cos3,factor; - // for (i=0; i<3; ++i) vertex[i] = p1[i]; - cos1 = dDOT14(normal,R1+0) ; - cos3 = dDOT14(normal,R1+2); - factor=dSqrt(cos1*cos1+cos3*cos3); - if(factor>0.f) - { - cos1/=factor; - cos3/=factor; - } - - dVector3 center; - - sign = (dDOT14(normal,R1+1) > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) center[i] =p1[i]+sign * hlz1 * R1[i*4+1]; - - - for (i=0; i<3; ++i) vertex[i] =center[i]+cos1 * radius1 * R1[i*4]; - for (i=0; i<3; ++i) vertex[i] += cos3 * radius1 * R1[i*4+2]; - - - dReal A1,A3,centerDepth,Q1,Q3; - centerDepth=*depth-radius1*(factor); - Q1=(dDOT(R2+1,R1+0));Q3=(dDOT(R2+1,R1+2)); - - - A1=(-cos1*M_COS_PI_3-cos3*M_SIN_PI_3)*radius1; - A3=(-cos3*M_COS_PI_3+cos1*M_SIN_PI_3)*radius1; - CONTACT(contact,ret*skip)->pos[0]=center[0]+A1*R1[0]+A3*R1[2]; - CONTACT(contact,ret*skip)->pos[1]=center[1]+A1*R1[4]+A3*R1[6]; - CONTACT(contact,ret*skip)->pos[2]=center[2]+A1*R1[8]+A3*R1[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+dFabs(Q1*A1)+dFabs(Q3*A3); - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - - A1=(-cos1*M_COS_PI_3+cos3*M_SIN_PI_3)*radius1; - A3=(-cos3*M_COS_PI_3-cos1*M_SIN_PI_3)*radius1; - CONTACT(contact,ret*skip)->pos[0]=center[0]+A1*R1[0]+A3*R1[2]; - CONTACT(contact,ret*skip)->pos[1]=center[1]+A1*R1[4]+A3*R1[6]; - CONTACT(contact,ret*skip)->pos[2]=center[2]+A1*R1[8]+A3*R1[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+dFabs(Q1*A1)+dFabs(Q3*A3); - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - - - } - for (i=0; i<3; ++i) contact[0].pos[i] = vertex[i]; - contact[0].depth = *depth; - return ret; -} - -#pragma todo(optimize factor==0.f) -//**************************************************************************** - - -int dCollideCylS (dxGeom *o1, dxGeom *o2, int flags, - dContactGeom *contact, int skip) -{ - - - VERIFY (skip >= (int)sizeof(dContactGeom)); - VERIFY (dGeomGetClass(o2) == dSphereClass); - VERIFY (dGeomGetClass(o1) == dCylinderClassUser); - const dReal* p1=dGeomGetPosition(o1); - const dReal* p2=dGeomGetPosition(o2); - const dReal* R=dGeomGetRotation(o1); - dVector3 p,normalC,normal; - const dReal *normalR = 0; - dReal cylRadius; - dReal hl; - dGeomCylinderGetParams(o1,&cylRadius,&hl); - hl/=2.f; - dReal sphereRadius; - sphereRadius=dGeomSphereGetRadius(o2); - - int i,invert_normal; - - // get vector3 from centers of cyl to shere - p[0] = p2[0] - p1[0]; - p[1] = p2[1] - p1[1]; - p[2] = p2[2] - p1[2]; - -dReal s,s2; -unsigned char code; -#define TEST(expr1,expr2,norm,cc) \ - s2 = dFabs(expr1) - (expr2); \ - if (s2 > 0) return 0; \ - if (s2 > s) { \ - s = s2; \ - normalR = norm; \ - invert_normal = ((expr1) < 0); \ - code = (cc); \ - } - - s = -dInfinity; - invert_normal = 0; - code = 0; - - // separating axis cyl ax - - TEST (dDOT14(p,R+1),sphereRadius+hl,R+1,2); - // note: cross product axes need to be scaled when s is computed. - // normal (n1,n2,n3) is relative to -#undef TEST -#define TEST(expr1,expr2,n1,n2,n3,cc) \ - s2 = dFabs(expr1) - (expr2); \ - if (s2 > 0) return 0; \ - if (s2 > s) { \ - s = s2; \ - normalR = 0; \ - normalC[0] = (n1); normalC[1] = (n2); normalC[2] = (n3); \ - invert_normal = ((expr1) < 0); \ - code = (cc); \ - } - -//making ax which is perpendicular to cyl1 ax to sphere center// - -dReal proj,_cos,_sin,cos1,cos3; -dVector3 Ax; - proj=dDOT14(p2,R+1)-dDOT14(p1,R+1); - - Ax[0]=p2[0]-p1[0]-R[1]*proj; - Ax[1]=p2[1]-p1[1]-R[5]*proj; - Ax[2]=p2[2]-p1[2]-R[9]*proj; -dNormalize3(Ax); -TEST(dDOT(p,Ax),sphereRadius+cylRadius,Ax[0],Ax[1],Ax[2],9); - - -Ax[0]=p[0]; -Ax[1]=p[1]; -Ax[2]=p[2]; -dNormalize3(Ax); - - dVector3 pa; - dReal sign, factor; - for (i=0; i<3; ++i) pa[i] = p1[i]; - - cos1 = dDOT14(Ax,R+0); - cos3 = dDOT14(Ax,R+2) ; - factor=dSqrt(cos1*cos1+cos3*cos3); - cos1/=factor; - cos3/=factor; - for (i=0; i<3; ++i) pa[i] += cos1 * cylRadius * R[i*4]; - sign = (dDOT14(Ax,R+1) > 0) ? REAL(1.0) : REAL(-1.0); - for (i=0; i<3; ++i) pa[i] += sign * hl * R[i*4+1]; - for (i=0; i<3; ++i) pa[i] += cos3 * cylRadius * R[i*4+2]; - -Ax[0]=p2[0]-pa[0]; -Ax[1]=p2[1]-pa[1]; -Ax[2]=p2[2]-pa[2]; -dNormalize3(Ax); - - _cos=dFabs(dDOT14(Ax,R+1)); - cos1=dDOT14(Ax,R+0); - cos3=dDOT14(Ax,R+2); - _sin=dSqrt(cos1*cos1+cos3*cos3); -TEST(dDOT(p,Ax),sphereRadius+cylRadius*_sin+hl*_cos,Ax[0],Ax[1],Ax[2],14); - - -#undef TEST - - if (normalR) { - normal[0] = normalR[0]; - normal[1] = normalR[4]; - normal[2] = normalR[8]; - } - else { - - normal[0] = normalC[0]; - normal[1] = normalC[1]; - normal[2] = normalC[2]; - } - if (invert_normal) { - normal[0] = -normal[0]; - normal[1] = -normal[1]; - normal[2] = -normal[2]; - } - // compute contact point(s) -contact->depth=-s; -contact->normal[0]=-normal[0]; -contact->normal[1]=-normal[1]; -contact->normal[2]=-normal[2]; -contact->g1=const_cast (o1); -contact->g2=const_cast (o2); -contact->pos[0]=p2[0]-normal[0]*sphereRadius; -contact->pos[1]=p2[1]-normal[1]*sphereRadius; -contact->pos[2]=p2[2]-normal[2]*sphereRadius; -return 1; -} - - - -int dCollideCylB (dxGeom *o1, dxGeom *o2, int flags, - dContactGeom *contact, int skip) -{ - dVector3 normal; - dReal depth; - int code; - dReal cylRadius,cylLength; - dVector3 boxSides; - dGeomCylinderGetParams(o1,&cylRadius,&cylLength); - dGeomBoxGetLengths(o2,boxSides); - int num = dCylBox(dGeomGetPosition(o1),dGeomGetRotation(o1),cylRadius,cylLength, - dGeomGetPosition(o2),dGeomGetRotation(o2),boxSides, - normal,&depth,&code,flags & NUMC_MASK,contact,skip); - for (int i=0; inormal[0] = -normal[0]; - CONTACT(contact,i*skip)->normal[1] = -normal[1]; - CONTACT(contact,i*skip)->normal[2] = -normal[2]; - CONTACT(contact,i*skip)->g1 = const_cast (o1); - CONTACT(contact,i*skip)->g2 = const_cast (o2); - } - return num; -} - -int dCollideCylCyl (dxGeom *o1, dxGeom *o2, int flags, - dContactGeom *contact, int skip) -{ - dVector3 normal; - dReal depth; - int code; -dReal cylRadius1,cylRadius2; -dReal cylLength1,cylLength2; -dGeomCylinderGetParams(o1,&cylRadius1,&cylLength1); -dGeomCylinderGetParams(o2,&cylRadius2,&cylLength2); -int num = dCylCyl (dGeomGetPosition(o1),dGeomGetRotation(o1),cylRadius1,cylLength1, - dGeomGetPosition(o2),dGeomGetRotation(o2),cylRadius2,cylLength2, - normal,&depth,&code,flags & NUMC_MASK,contact,skip); - - for (int i=0; inormal[0] = -normal[0]; - CONTACT(contact,i*skip)->normal[1] = -normal[1]; - CONTACT(contact,i*skip)->normal[2] = -normal[2]; - CONTACT(contact,i*skip)->g1 = const_cast (o1); - CONTACT(contact,i*skip)->g2 = const_cast (o2); - } - return num; -} - -struct dxPlane { - dReal p[4]; -}; - - -int dCollideCylPlane - ( - dxGeom *o1, dxGeom *o2, int flags, - dContactGeom *contact, int skip){ - VERIFY (skip >= (int)sizeof(dContactGeom)); - VERIFY (dGeomGetClass(o1) == dCylinderClassUser); - VERIFY (dGeomGetClass(o2) == dPlaneClass); - contact->g1 = const_cast (o1); - contact->g2 = const_cast (o2); - - unsigned int ret = 0; - - dReal radius; - dReal hlz; - dGeomCylinderGetParams(o1,&radius,&hlz); - hlz/=REAL(2.); - const dReal *R = dGeomGetRotation(o1);// rotation of cylinder - const dReal* p = dGeomGetPosition(o1); - dVector4 n; // normal vector3 - dReal pp; - dGeomPlaneGetParams (o2, n); - pp=n[3]; - dReal cos1,sin1; - cos1=dFabs(dDOT14(n,R+1)); - -cos1=cos10 ? hlz*R[1]:-hlz*R[1]; - pos[1]-= A2>0 ? hlz*R[5]:-hlz*R[5]; - pos[2]-= A2>0 ? hlz*R[9]:-hlz*R[9]; - - - - contact->pos[0] = pos[0]; - contact->pos[1] = pos[1]; - contact->pos[2] = pos[2]; - contact->depth = outDepth; - ret=1; - -if(dFabs(Q2)>M_SQRT1_2){ - - CONTACT(contact,ret*skip)->pos[0]=pos[0]+2.f*A1*R[0]; - CONTACT(contact,ret*skip)->pos[1]=pos[1]+2.f*A1*R[4]; - CONTACT(contact,ret*skip)->pos[2]=pos[2]+2.f*A1*R[8]; - CONTACT(contact,ret*skip)->depth=outDepth-dFabs(Q1*2.f*A1); - - if(CONTACT(contact,ret*skip)->depth>0.f) - ++ret; - - - CONTACT(contact,ret*skip)->pos[0]=pos[0]+2.f*A3*R[2]; - CONTACT(contact,ret*skip)->pos[1]=pos[1]+2.f*A3*R[6]; - CONTACT(contact,ret*skip)->pos[2]=pos[2]+2.f*A3*R[10]; - CONTACT(contact,ret*skip)->depth=outDepth-dFabs(Q3*2.f*A3); - - if(CONTACT(contact,ret*skip)->depth>0.f) ++ret; -} else { - - CONTACT(contact,ret*skip)->pos[0]=pos[0]+2.f*(A2>0 ? hlz*R[1]:-hlz*R[1]); - CONTACT(contact,ret*skip)->pos[1]=pos[1]+2.f*(A2>0 ? hlz*R[5]:-hlz*R[5]); - CONTACT(contact,ret*skip)->pos[2]=pos[2]+2.f*(A2>0 ? hlz*R[9]:-hlz*R[9]); - CONTACT(contact,ret*skip)->depth=outDepth-dFabs(Q2*2.f*A2); - - if(CONTACT(contact,ret*skip)->depth>0.f) ++ret; -} - - - - for (unsigned int i=0; ig1 = const_cast (o1); - CONTACT(contact,i*skip)->g2 = const_cast (o2); - CONTACT(contact,i*skip)->normal[0] =n[0]; - CONTACT(contact,i*skip)->normal[1] =n[1]; - CONTACT(contact,i*skip)->normal[2] =n[2]; - } - return ret; -} - -int dCollideCylRay(dxGeom *o1, dxGeom *o2, int flags, - dContactGeom *contact, int skip) { - VERIFY (skip >= (int)sizeof(dContactGeom)); - VERIFY (dGeomGetClass(o1) == dCylinderClassUser); - VERIFY (dGeomGetClass(o2) == dRayClass); - contact->g1 = const_cast (o1); - contact->g2 = const_cast (o2); - dReal radius; - dReal lz; - dGeomCylinderGetParams(o1,&radius,&lz); - dReal lz2=lz*REAL(0.5); - const dReal *R = dGeomGetRotation(o1); // rotation of the cylinder - const dReal *p = dGeomGetPosition(o1); // position of the cylinder - dVector3 start,dir; - dGeomRayGet(o2,start,dir); // position and orientation of the ray - dReal length = dGeomRayGetLength(o2); - - // compute some useful info - dVector3 cs,q,r; - dReal C,k; - cs[0] = start[0] - p[0]; - cs[1] = start[1] - p[1]; - cs[2] = start[2] - p[2]; - k = dDOT41(R+1,cs); // position of ray start along cyl axis (Y) - q[0] = k*R[0*4+1] - cs[0]; - q[1] = k*R[1*4+1] - cs[1]; - q[2] = k*R[2*4+1] - cs[2]; - C = dDOT(q,q) - radius*radius; - // if C < 0 then ray start position within infinite extension of cylinder - // if ray start position is inside the cylinder - int inside_cyl=0; - if (C<0 && !(k<-lz2 || k>lz2)) inside_cyl=1; - // compute ray collision with infinite cylinder, except for the case where - // the ray is outside the cylinder but within the infinite cylinder - // (it that case the ray can only hit endcaps) - if (!inside_cyl && C < 0) { - // set k to cap position to check - if (k < 0) k = -lz2; else k = lz2; - } - else { - dReal uv = dDOT41(R+1,dir); - r[0] = uv*R[0*4+1] - dir[0]; - r[1] = uv*R[1*4+1] - dir[1]; - r[2] = uv*R[2*4+1] - dir[2]; - dReal A = dDOT(r,r); - dReal B = 2*dDOT(q,r); - k = B*B-4*A*C; - if (k < 0) { - // the ray does not intersect the infinite cylinder, but if the ray is - // inside and parallel to the cylinder axis it may intersect the end - // caps. set k to cap position to check. - if (!inside_cyl) return 0; - if (uv < 0) k = -lz2; else k = lz2; - } - else { - k = dSqrt(k); - A = dRecip (2*A); - dReal alpha = (-B-k)*A; - if (alpha < 0) { - alpha = (-B+k)*A; - if (alpha<0) return 0; - } - if (alpha>length) return 0; - // the ray intersects the infinite cylinder. check to see if the - // intersection point is between the caps - contact->pos[0] = start[0] + alpha*dir[0]; - contact->pos[1] = start[1] + alpha*dir[1]; - contact->pos[2] = start[2] + alpha*dir[2]; - q[0] = contact->pos[0] - p[0]; - q[1] = contact->pos[1] - p[1]; - q[2] = contact->pos[2] - p[2]; - k = dDOT14(q,R+1); - dReal nsign = inside_cyl ? -REAL(1.) :REAL(1.); - if (k >= -lz2 && k <= lz2) { - contact->normal[0] = nsign * (contact->pos[0] - - (p[0] + k*R[0*4+1])); - contact->normal[1] = nsign * (contact->pos[1] - - (p[1] + k*R[1*4+1])); - contact->normal[2] = nsign * (contact->pos[2] - - (p[2] + k*R[2*4+1])); - dNormalize3 (contact->normal); - contact->depth = alpha; - return 1; - } - // the infinite cylinder intersection point is not between the caps. - // set k to cap position to check. - if (k < 0) k = -lz2; else k = lz2; - } - } - // check for ray intersection with the caps. k must indicate the cap - // position to check - // perform a ray plan interesection - // R+1 is the plan normal - q[0] = start[0] - (p[0] + k*R[0*4+1]); - q[1] = start[1] - (p[1] + k*R[1*4+1]); - q[2] = start[2] - (p[2] + k*R[2*4+1]); - dReal alpha = -dDOT14(q,R+1); - dReal k2 = dDOT14(dir,R+1); - if (k2==0) return 0; // ray parallel to the plane - alpha/=k2; - if (alpha<0 || alpha>length) return 0; // too short - contact->pos[0]=start[0]+alpha*dir[0]; - contact->pos[1]=start[1]+alpha*dir[1]; - contact->pos[2]=start[2]+alpha*dir[2]; - dReal nsign = (k<0)?-REAL(1.):REAL(1.); - contact->normal[0]=nsign*R[0*4+1]; - contact->normal[1]=nsign*R[1*4+1]; - contact->normal[2]=nsign*R[2*4+1]; - contact->depth=alpha; - return 1; - } - -static dColliderFn * dCylinderColliderFn (int num) -{ - if (num == dBoxClass) return (dColliderFn *) &dCollideCylB; - if (num == dSphereClass) return (dColliderFn *) &dCollideCylS; - if (num == dCylinderClassUser) return (dColliderFn *) &dCollideCylCyl; - if (num == dPlaneClass) return (dColliderFn *) &dCollideCylPlane; - return 0; -} - - -static void dCylinderAABB (dxGeom *geom, dReal aabb[6]) -{ - dReal radius,lz; - dGeomCylinderGetParams(geom,&radius,&lz); -const dReal* R= dGeomGetRotation(geom); -const dReal* pos= dGeomGetPosition(geom); - - - dReal xrange = REAL(0.5) * dFabs (R[1] * lz) + (dSqrt(R[0]*R[0]+R[2]*R[2]) * radius); - - dReal yrange = REAL(0.5) * dFabs (R[5] * lz) + (dSqrt(R[4]*R[4]+R[6]*R[6]) * radius); - - dReal zrange = REAL(0.5) * dFabs (R[9] * lz) + (dSqrt(R[8]*R[8]+R[10]*R[10]) * radius); - - aabb[0] = pos[0] - xrange; - aabb[1] = pos[0] + xrange; - aabb[2] = pos[1] - yrange; - aabb[3] = pos[1] + yrange; - aabb[4] = pos[2] - zrange; - aabb[5] = pos[2] + zrange; -} - -dxGeom *dCreateCylinder (dSpaceID space, dReal r, dReal lz) -{ - VERIFY (r > 0 && lz > 0); - if (dCylinderClassUser == -1) - { - dGeomClass c; - c.bytes = sizeof (dxCylinder); - c.collider = &dCylinderColliderFn; - c.aabb = &dCylinderAABB; - c.aabb_test = 0; - c.dtor = 0; - dCylinderClassUser=dCreateGeomClass (&c); - - } - - dGeomID g = dCreateGeom (dCylinderClassUser); - if (space) dSpaceAdd (space,g); - dxCylinder *c = (dxCylinder*) dGeomGetClassData(g); - - c->radius = r; - c->lz = lz; - return g; -} - - - -void dGeomCylinderSetParams (dGeomID g, dReal radius, dReal length) -{ - VERIFY2 (g && dGeomGetClass(g) == dCylinderClassUser ,"argument not a cylinder"); - VERIFY (radius > 0 && length > 0); - dxCylinder *c = (dxCylinder*) dGeomGetClassData(g); - c->radius = radius; - c->lz = length; -} - - - -void dGeomCylinderGetParams (dGeomID g, dReal *radius, dReal *length) -{ - VERIFY2 (g && dGeomGetClass(g) == dCylinderClassUser ,"argument not a cylinder"); - dxCylinder *c = (dxCylinder*) dGeomGetClassData(g); - *radius = c->radius; - *length = c->lz; -} - diff --git a/src/xrGame/dcylinder/dCylinder.h b/src/xrGame/dcylinder/dCylinder.h deleted file mode 100644 index 8fd6870a4e9..00000000000 --- a/src/xrGame/dcylinder/dCylinder.h +++ /dev/null @@ -1,15 +0,0 @@ - -#ifndef dCylinder_h -#define dCylinder_h - -#include "../ode_include.h" - -struct dxCylinder; -extern int dCylinderClassUser; - - -dxGeom *dCreateCylinder (dSpaceID space, dReal r, dReal lz); -void dGeomCylinderSetParams (dGeomID g, dReal radius, dReal length); - -void dGeomCylinderGetParams (dGeomID g, dReal *radius, dReal *length); -#endif //dCylinder_h \ No newline at end of file diff --git a/src/xrGame/death_anims.cpp b/src/xrGame/death_anims.cpp index c5a7d84b03c..58421b5cd24 100644 --- a/src/xrGame/death_anims.cpp +++ b/src/xrGame/death_anims.cpp @@ -2,7 +2,7 @@ #include "death_anims.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "entity_alive.h" diff --git a/src/xrGame/death_anims.h b/src/xrGame/death_anims.h index 45c567536df..52085a2929b 100644 --- a/src/xrGame/death_anims.h +++ b/src/xrGame/death_anims.h @@ -1,7 +1,7 @@ #pragma once struct SHit; -#include "../include/xrRender/animation_motion.h" +#include "Include/xrRender/animation_motion.h" struct MotionID; class CInifile; diff --git a/src/xrGame/debug_renderer.h b/src/xrGame/debug_renderer.h index 28999f0cc88..9e56758b3c8 100644 --- a/src/xrGame/debug_renderer.h +++ b/src/xrGame/debug_renderer.h @@ -10,7 +10,7 @@ #ifdef DEBUG -#include "../Include/xrRender/DebugRender.h" +#include "Include/xrRender/DebugRender.h" class CDebugRenderer { private: diff --git a/src/xrGame/doors_manager.cpp b/src/xrGame/doors_manager.cpp index 8c20cbbd44c..6b0778eac4f 100644 --- a/src/xrGame/doors_manager.cpp +++ b/src/xrGame/doors_manager.cpp @@ -24,7 +24,7 @@ manager::~manager ( ) VERIFY2 ( m_doors.empty(), make_string("there are %d still registered doors", m_doors.size()) ); } -//#include "level.h" +//#include "Level.h" //#include "script_game_object.h" // //void manager::check_bug_door ( ) const diff --git a/src/xrGame/double_shot_double_kill.cpp b/src/xrGame/double_shot_double_kill.cpp index 462680772ec..9a2abcdbd78 100644 --- a/src/xrGame/double_shot_double_kill.cpp +++ b/src/xrGame/double_shot_double_kill.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "double_shot_double_kill.h" #include "game_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" namespace award_system diff --git a/src/xrGame/encyclopedia_article.cpp b/src/xrGame/encyclopedia_article.cpp index c90d9f2e61c..fbb386ae22d 100644 --- a/src/xrGame/encyclopedia_article.cpp +++ b/src/xrGame/encyclopedia_article.cpp @@ -9,7 +9,7 @@ #include "ui/UIXmlInit.h" #include "ui/UIInventoryUtilities.h" #include "object_broker.h" -#include "../Include/xrRender/UIShader.h" +#include "Include/xrRender/UIShader.h" using namespace InventoryUtilities; diff --git a/src/xrGame/enemy_manager.cpp b/src/xrGame/enemy_manager.cpp index 97b79608388..1d7e95d9808 100644 --- a/src/xrGame/enemy_manager.cpp +++ b/src/xrGame/enemy_manager.cpp @@ -16,7 +16,7 @@ #include "autosave_manager.h" #include "ai_object_location.h" #include "level_graph.h" -#include "level.h" +#include "Level.h" #include "script_game_object.h" #include "ai_space.h" #include "profiler.h" diff --git a/src/xrGame/entity_alive.cpp b/src/xrGame/entity_alive.cpp index 04b548003b4..e1a0f4defad 100644 --- a/src/xrGame/entity_alive.cpp +++ b/src/xrGame/entity_alive.cpp @@ -2,13 +2,13 @@ #include "entity_alive.h" #include "inventoryowner.h" #include "inventory.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" #include "xrEngine/GameMtlLib.h" #include "phmovementcontrol.h" #include "wound.h" #include "xrmessages.h" -#include "level.h" -#include "../Include/xrRender/Kinematics.h" +#include "Level.h" +#include "Include/xrRender/Kinematics.h" #include "relation_registry.h" #include "monster_community.h" #include "entitycondition.h" @@ -772,7 +772,7 @@ void CEntityAlive:: destroy_anim_mov_ctrl( ) cs->on_destroy_anim_mov_ctrl( ); } -#include "../xrEngine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" struct element_predicate { inline bool operator( ) (CCF_Skeleton::SElement const& element, u16 element_id ) const diff --git a/src/xrGame/event_conditions_collection.cpp b/src/xrGame/event_conditions_collection.cpp index 1b2de8e9c09..53bb0163c09 100644 --- a/src/xrGame/event_conditions_collection.cpp +++ b/src/xrGame/event_conditions_collection.cpp @@ -2,7 +2,7 @@ #include "event_conditions_collection.h" #include "object_broker.h" #include "game_state_accumulator.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" namespace award_system diff --git a/src/xrGame/faster_than_bullets_time.cpp b/src/xrGame/faster_than_bullets_time.cpp index 2c8b6668b59..402ec82af57 100644 --- a/src/xrGame/faster_than_bullets_time.cpp +++ b/src/xrGame/faster_than_bullets_time.cpp @@ -2,7 +2,7 @@ #include "faster_than_bullets_time.h" #include "hits_store.h" #include "game_state_accumulator.h" -#include "level.h" +#include "Level.h" namespace award_system { diff --git a/src/xrGame/file_transfer.h b/src/xrGame/file_transfer.h index 6209a59a9ee..13fa4e82ebc 100644 --- a/src/xrGame/file_transfer.h +++ b/src/xrGame/file_transfer.h @@ -1,19 +1,13 @@ #ifndef FILETRANSFER #define FILETRANSFER - #include "associative_vector.h" -#include "..\xrEngine\StatGraph.h" +#include "xrEngine/StatGraph.h" #include "filetransfer_node.h" #include "filereceiver_node.h" - //this module is an implementation of file transfering ... namespace file_transfer { - - - - class server_site { public: diff --git a/src/xrGame/fire_disp_controller.cpp b/src/xrGame/fire_disp_controller.cpp index 658d8bb8642..6938e157bb6 100644 --- a/src/xrGame/fire_disp_controller.cpp +++ b/src/xrGame/fire_disp_controller.cpp @@ -3,7 +3,7 @@ #include "Actor.h" #include "inventory.h" #include "weapon.h" -#include "level.h" +#include "Level.h" float const CFireDispertionController::default_inertion = 5.91f; //time to pass value of dispertion = 1 diff --git a/src/xrGame/first_bullet_controller.cpp b/src/xrGame/first_bullet_controller.cpp index 260d3e2ef9b..a79bc7a7a30 100644 --- a/src/xrGame/first_bullet_controller.cpp +++ b/src/xrGame/first_bullet_controller.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "first_bullet_controller.h" -#include "level.h" +#include "Level.h" first_bullet_controller::first_bullet_controller() { diff --git a/src/xrGame/flare.cpp b/src/xrGame/flare.cpp index ec5b0b4b1d7..638b17580df 100644 --- a/src/xrGame/flare.cpp +++ b/src/xrGame/flare.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "flare.h" #include "player_hud.h" -#include "../xrEngine/LightAnimLibrary.h" +#include "xrEngine/LightAnimLibrary.h" void CFlare::Load(LPCSTR section) { diff --git a/src/xrGame/fs_registrator_script.cpp b/src/xrGame/fs_registrator_script.cpp index a19f5753305..21b8233e5af 100644 --- a/src/xrGame/fs_registrator_script.cpp +++ b/src/xrGame/fs_registrator_script.cpp @@ -1,6 +1,6 @@ #include "pch_script.h" #include "fs_registrator.h" -#include "../xrcore/LocatorApi.h" +#include "xrCore/LocatorApi.h" using namespace luabind; diff --git a/src/xrGame/game_base.cpp b/src/xrGame/game_base.cpp index 9e05ca51843..fbd347db0f8 100644 --- a/src/xrGame/game_base.cpp +++ b/src/xrGame/game_base.cpp @@ -2,7 +2,7 @@ #include "game_base.h" #include "ai_space.h" #include "script_engine.h" -#include "level.h" +#include "Level.h" #include "xrMessages.h" u64 g_qwStartGameTime = 12*60*60*1000; diff --git a/src/xrGame/game_cl_artefacthunt.cpp b/src/xrGame/game_cl_artefacthunt.cpp index 002eea9b034..d368861daa7 100644 --- a/src/xrGame/game_cl_artefacthunt.cpp +++ b/src/xrGame/game_cl_artefacthunt.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "game_cl_artefacthunt.h" #include "xrMessages.h" -#include "level.h" +#include "Level.h" #include "UIGameAHunt.h" #include "map_manager.h" #include "LevelGameDef.h" @@ -32,7 +32,7 @@ #define MESSAGE_MENUS "ahunt_messages_menu" #include "game_cl_artefacthunt_snd_msg.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #include "reward_event_generator.h" diff --git a/src/xrGame/game_cl_base.cpp b/src/xrGame/game_cl_base.cpp index cfa26b6ecc7..e73a39d22bb 100644 --- a/src/xrGame/game_cl_base.cpp +++ b/src/xrGame/game_cl_base.cpp @@ -1,6 +1,6 @@ #include "pch_script.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "GamePersistent.h" #include "UIGameCustom.h" #include "script_engine.h" diff --git a/src/xrGame/game_cl_base.h b/src/xrGame/game_cl_base.h index 9feb05494bd..2cb78896b08 100644 --- a/src/xrGame/game_cl_base.h +++ b/src/xrGame/game_cl_base.h @@ -1,7 +1,7 @@ #pragma once #include "game_base.h" -#include "../xrCore/client_id.h" +#include "xrCore/client_id.h" #include "WeaponAmmo.h" class NET_Packet; diff --git a/src/xrGame/game_cl_base_weapon_usage_statistic.cpp b/src/xrGame/game_cl_base_weapon_usage_statistic.cpp index 72bf853fc2b..67541676541 100644 --- a/src/xrGame/game_cl_base_weapon_usage_statistic.cpp +++ b/src/xrGame/game_cl_base_weapon_usage_statistic.cpp @@ -8,7 +8,7 @@ #include "ExplosiveItem.h" #include "xrServer.h" #include "game_cl_base_weapon_usage_statistic.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "game_cl_mp.h" #include diff --git a/src/xrGame/game_cl_capture_the_artefact.cpp b/src/xrGame/game_cl_capture_the_artefact.cpp index f49d78995bd..d508d8ccafb 100644 --- a/src/xrGame/game_cl_capture_the_artefact.cpp +++ b/src/xrGame/game_cl_capture_the_artefact.cpp @@ -19,7 +19,7 @@ #include "weapon.h" #include "game_cl_base_weapon_usage_statistic.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #include "ui/UIActorMenu.h" #include "ui/UIDemoPlayControl.h" diff --git a/src/xrGame/game_cl_capturetheartefact_buywnd.cpp b/src/xrGame/game_cl_capturetheartefact_buywnd.cpp index 8a3f60fb14b..c94d1449661 100644 --- a/src/xrGame/game_cl_capturetheartefact_buywnd.cpp +++ b/src/xrGame/game_cl_capturetheartefact_buywnd.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "game_cl_capture_the_artefact.h" -#include "level.h" +#include "Level.h" #include "actor.h" #include "inventory.h" #include "xrServer_Objects_ALife_Items.h" diff --git a/src/xrGame/game_cl_deathmatch.cpp b/src/xrGame/game_cl_deathmatch.cpp index a2302cbb00b..e89e2765be4 100644 --- a/src/xrGame/game_cl_deathmatch.cpp +++ b/src/xrGame/game_cl_deathmatch.cpp @@ -3,7 +3,7 @@ #include "xrMessages.h" #include "UIGameDM.h" #include "Spectator.h" -#include "level.h" +#include "Level.h" #include "xr_level_controller.h" #include "actor.h" #include "ui/UIMainIngameWnd.h" diff --git a/src/xrGame/game_cl_deathmatch_buywnd.cpp b/src/xrGame/game_cl_deathmatch_buywnd.cpp index eecf3fb2953..e0b3df25e34 100644 --- a/src/xrGame/game_cl_deathmatch_buywnd.cpp +++ b/src/xrGame/game_cl_deathmatch_buywnd.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "game_cl_deathmatch.h" -#include "level.h" +#include "Level.h" #include "actor.h" #include "inventory.h" #include "xrServer_Objects_ALife_Items.h" diff --git a/src/xrGame/game_cl_mp.cpp b/src/xrGame/game_cl_mp.cpp index c1d6da20df8..f61dd18b21b 100644 --- a/src/xrGame/game_cl_mp.cpp +++ b/src/xrGame/game_cl_mp.cpp @@ -4,7 +4,7 @@ #include "xrMessages.h" #include "Actor.h" #include "ExplosiveItem.h" -#include "level.h" +#include "Level.h" #include #include "CustomZone.h" #include "game_base_kill_type.h" @@ -30,12 +30,12 @@ #include "mainmenu.h" #include "WeaponKnife.h" #include "RegistryFuncs.h" -#include "../xrGameSpy/xrGameSpy_MainDefs.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" #include "screenshot_server.h" -#include "../xrCore/ppmd_compressor.h" -#include "../xrCore/rt_compressor.h" +#include "xrCore/ppmd_compressor.h" +#include "xrCore/rt_compressor.h" #include "game_cl_mp_snd_messages.h" -#include "../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" #include "reward_event_generator.h" #include "game_cl_base_weapon_usage_statistic.h" diff --git a/src/xrGame/game_cl_mp.h b/src/xrGame/game_cl_mp.h index 5b1a0a7eed0..0793876b106 100644 --- a/src/xrGame/game_cl_mp.h +++ b/src/xrGame/game_cl_mp.h @@ -8,7 +8,7 @@ #include "configs_dumper.h" #include "configs_dump_verifyer.h" #include "screenshot_server.h" -#include "../xrCore/fastdelegate.h" +#include "xrCore/fastdelegate.h" class CUIWindow; class CUISpeechMenu; diff --git a/src/xrGame/game_cl_teamdeathmatch.cpp b/src/xrGame/game_cl_teamdeathmatch.cpp index 66f557c5d5c..fb3ef8c71dc 100644 --- a/src/xrGame/game_cl_teamdeathmatch.cpp +++ b/src/xrGame/game_cl_teamdeathmatch.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "game_cl_teamdeathmatch.h" #include "xrMessages.h" -#include "level.h" +#include "Level.h" #include "UIGameTDM.h" #include "xr_level_controller.h" #include "map_manager.h" diff --git a/src/xrGame/game_level_cross_table.h b/src/xrGame/game_level_cross_table.h index 6a67959613f..83515fc2c3c 100644 --- a/src/xrGame/game_level_cross_table.h +++ b/src/xrGame/game_level_cross_table.h @@ -9,9 +9,9 @@ #pragma once #ifdef AI_COMPILER -# include "../../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #else // AI_COMPILER -# include "../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #endif // AI_COMPILER #include "alife_space.h" diff --git a/src/xrGame/game_sv_base.cpp b/src/xrGame/game_sv_base.cpp index 4f91aea9d81..7e2b8c9e018 100644 --- a/src/xrGame/game_sv_base.cpp +++ b/src/xrGame/game_sv_base.cpp @@ -4,12 +4,12 @@ #include "xrServer_Objects_ALife_Monsters.h" #include "script_engine.h" #include "script_engine_space.h" -#include "level.h" +#include "Level.h" #include "xrserver.h" #include "ai_space.h" #include "game_sv_event_queue.h" -#include "../xrEngine/XR_IOConsole.h" -#include "../xrEngine/xr_ioc_cmd.h" +#include "xrEngine/XR_IOConsole.h" +#include "xrEngine/xr_ioc_cmd.h" #include "string_table.h" #include "debug_renderer.h" diff --git a/src/xrGame/game_sv_base.h b/src/xrGame/game_sv_base.h index 25dc216a5e0..1e893bcf6f0 100644 --- a/src/xrGame/game_sv_base.h +++ b/src/xrGame/game_sv_base.h @@ -3,11 +3,11 @@ #include "game_base.h" #include "alife_space.h" #include "script_export_space.h" -#include "../xrCore/client_id.h" +#include "xrCore/client_id.h" #include "game_sv_base_console_vars.h" #include "game_sv_event_queue.h" #include "game_sv_item_respawner.h" -#include "../xrNetServer/NET_Server.h" +#include "xrNetServer/NET_Server.h" #define MAX_PLAYERS_COUNT 32 diff --git a/src/xrGame/game_sv_capture_the_artefact.cpp b/src/xrGame/game_sv_capture_the_artefact.cpp index 6d9be2620f7..a6ed5f7aaaa 100644 --- a/src/xrGame/game_sv_capture_the_artefact.cpp +++ b/src/xrGame/game_sv_capture_the_artefact.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "game_sv_capture_the_artefact.h" #include "xrserver_objects_alife_monsters.h" -#include "level.h" +#include "Level.h" #include "xrserver.h" #include "Inventory.h" #include "CustomZone.h" -#include "../xrEngine/igame_persistent.h" -#include "../xrEngine/CameraManager.h" +#include "xrEngine/igame_persistent.h" +#include "xrEngine/CameraManager.h" #include "Actor.h" #include "Artefact.h" #include "game_cl_base.h" @@ -21,7 +21,7 @@ #include "ui\UIBuyWndShared.h" #include "UIGameCTA.h" #include "string_table.h" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" //------------------------------------------------------------- u32 g_sv_cta_dwInvincibleTime = 5; //5 seconds diff --git a/src/xrGame/game_sv_capture_the_artefact_myteam_impl.cpp b/src/xrGame/game_sv_capture_the_artefact_myteam_impl.cpp index ef9c45758a6..339ab140713 100644 --- a/src/xrGame/game_sv_capture_the_artefact_myteam_impl.cpp +++ b/src/xrGame/game_sv_capture_the_artefact_myteam_impl.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" -#include "level.h" +#include "Level.h" #include "game_sv_capture_the_artefact.h" diff --git a/src/xrGame/game_sv_deathmatch.cpp b/src/xrGame/game_sv_deathmatch.cpp index 0f719742f30..395618421c6 100644 --- a/src/xrGame/game_sv_deathmatch.cpp +++ b/src/xrGame/game_sv_deathmatch.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" #include "game_sv_deathmatch.h" #include "xrserver_objects_alife_monsters.h" -#include "level.h" +#include "Level.h" #include "xrserver.h" #include "Inventory.h" #include "CustomZone.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #include "Actor.h" #include "game_cl_base.h" #include "xr_level_controller.h" @@ -18,7 +18,7 @@ //#define DELAYED_ROUND_TIME 7000 #include "ui\UIBuyWndShared.h" -#include "../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" #define UNBUYABLESLOT 20 diff --git a/src/xrGame/game_sv_deathmatch.h b/src/xrGame/game_sv_deathmatch.h index 7c2acde1c0c..47f9f0e6148 100644 --- a/src/xrGame/game_sv_deathmatch.h +++ b/src/xrGame/game_sv_deathmatch.h @@ -2,9 +2,9 @@ #include "game_sv_mp.h" #include "inventory_space.h" -#include "../xrCore/client_id.h" +#include "xrCore/client_id.h" #include "Hit.h" -#include "../xrEngine/pure_relcase.h" +#include "xrEngine/pure_relcase.h" class IClient; diff --git a/src/xrGame/game_sv_item_respawner.cpp b/src/xrGame/game_sv_item_respawner.cpp index 090328d510c..4a14d9c83dc 100644 --- a/src/xrGame/game_sv_item_respawner.cpp +++ b/src/xrGame/game_sv_item_respawner.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "game_sv_item_respawner.h" #include "game_sv_base.h" -#include "level.h" +#include "Level.h" #include "xrServer_Objects_Alife_Items.h" #include diff --git a/src/xrGame/game_sv_mp.cpp b/src/xrGame/game_sv_mp.cpp index d6c6ae36b1c..61d1258303a 100644 --- a/src/xrGame/game_sv_mp.cpp +++ b/src/xrGame/game_sv_mp.cpp @@ -4,11 +4,11 @@ #include "xrMessages.h" #include "xrServer_Object_Base.h" #include "xrServer_Objects.h" -#include "level.h" +#include "Level.h" #include "xrserver_objects_alife_monsters.h" #include "actor.h" -#include "../xrEngine/XR_IOConsole.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/XR_IOConsole.h" +#include "xrEngine/igame_persistent.h" #include "date_time.h" #include "game_cl_base.h" #include "Spectator.h" @@ -684,7 +684,7 @@ void game_sv_mp::SetSkin (CSE_Abstract* E, u16 Team, u16 ID) //------------------------------------------- }; -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" bool game_sv_mp::GetPosAngleFromActor (ClientID id, Fvector& Pos, Fvector &Angle) { diff --git a/src/xrGame/game_sv_single.cpp b/src/xrGame/game_sv_single.cpp index 776edf93234..b48cac50a06 100644 --- a/src/xrGame/game_sv_single.cpp +++ b/src/xrGame/game_sv_single.cpp @@ -8,9 +8,9 @@ #include "object_broker.h" #include "gamepersistent.h" #include "xrServer.h" -#include "../xrEngine/x_ray.h" -#include "../xrEngine/dedicated_server_only.h" -#include "../xrEngine/no_single.h" +#include "xrEngine/x_ray.h" +#include "xrEngine/dedicated_server_only.h" +#include "xrEngine/no_single.h" game_sv_Single::game_sv_Single () { diff --git a/src/xrGame/gamespy/GameSpy_Browser.cpp b/src/xrGame/gamespy/GameSpy_Browser.cpp index 2ec4c8ffe9d..ce20ee95a54 100644 --- a/src/xrGame/gamespy/GameSpy_Browser.cpp +++ b/src/xrGame/gamespy/GameSpy_Browser.cpp @@ -1,16 +1,14 @@ #include "StdAfx.h" #include "game_base_space.h" -#include "../Spectator.h" +#include "Spectator.h" #include "GameSpy_Browser.h" #include "GameSpy_Base_Defs.h" -#include "../ui/ServerList.h" -#include "../MainMenu.h" - +#include "ui/ServerList.h" +#include "MainMenu.h" #include "GameSpy_Available.h" #include "GameSpy_QR2.h" - #include "object_broker.h" -#include "../string_table.h" +#include "string_table.h" void __cdecl SBCallback(ServerBrowser sb, SBCallbackReason reason, SBServer server, void *instance); EGameIDs ParseStringToGameType(LPCSTR str); diff --git a/src/xrGame/gamespy/GameSpy_Full.cpp b/src/xrGame/gamespy/GameSpy_Full.cpp index ace55acc8f4..010dc1aa1c6 100644 --- a/src/xrGame/gamespy/GameSpy_Full.cpp +++ b/src/xrGame/gamespy/GameSpy_Full.cpp @@ -1,6 +1,5 @@ #include "StdAfx.h" #include "GameSpy_Full.h" - #include "GameSpy_Available.h" #include "GameSpy_Patching.h" #include "GameSpy_HTTP.h" @@ -8,10 +7,9 @@ #include "GameSpy_GP.h" #include "GameSpy_SAKE.h" #include "GameSpy_ATLAS.h" -#include "../MainMenu.h" +#include "MainMenu.h" #include "object_broker.h" - CGameSpy_Full::CGameSpy_Full() { m_pGSA = NULL; diff --git a/src/xrGame/gamespy/GameSpy_Full.h b/src/xrGame/gamespy/GameSpy_Full.h index 3b454771c61..7ab8f3105dd 100644 --- a/src/xrGame/gamespy/GameSpy_Full.h +++ b/src/xrGame/gamespy/GameSpy_Full.h @@ -9,7 +9,7 @@ class CGameSpy_SAKE; class CGameSpy_ATLAS; #include "GameSpy_FuncDefs.h" -//#include "../../xrGameSpy/GameSpy/common/gsCore.h" +//#include "xrGameSpy/GameSpy/common/gsCore.h" typedef unsigned int gsi_time; // must be 32 bits - sorry for copying :( class CGameSpy_Full diff --git a/src/xrGame/gamespy/GameSpy_FuncDefs.h b/src/xrGame/gamespy/GameSpy_FuncDefs.h index 099020cb9f6..d338847fba3 100644 --- a/src/xrGame/gamespy/GameSpy_FuncDefs.h +++ b/src/xrGame/gamespy/GameSpy_FuncDefs.h @@ -1,18 +1,18 @@ #pragma once -#include "../../xrGameSpy/GameSpy/Common/gsCommon.h" -#include "../../xrGameSpy/GameSpy/Common/gsAvailable.h" -#include "../../xrGameSpy/GameSpy/ghttp/ghttp.h" - -#include "../../xrGameSpy/GameSpy/qr2/qr2.h" -#include "../../xrGameSpy/GameSpy/gcdkey/gcdkeyc.h" -#include "../../xrGameSpy/GameSpy/gcdkey/gcdkeys.h" -#include "../../xrGameSpy/GameSpy/serverbrowsing/sb_serverbrowsing.h" - -#include "../../xrGameSpy/GameSpy/pt/pt.h" -#include "../../xrGameSpy/GameSpy/gp/gp.h" -#include "../../xrGameSpy/GameSpy/sake/sake.h" -#include "../../xrGameSpy/GameSpy/sc/sc.h" +#include "xrGameSpy/GameSpy/Common/gsCommon.h" +#include "xrGameSpy/GameSpy/Common/gsAvailable.h" +#include "xrGameSpy/GameSpy/ghttp/ghttp.h" + +#include "xrGameSpy/GameSpy/qr2/qr2.h" +#include "xrGameSpy/GameSpy/gcdkey/gcdkeyc.h" +#include "xrGameSpy/GameSpy/gcdkey/gcdkeys.h" +#include "xrGameSpy/GameSpy/serverbrowsing/sb_serverbrowsing.h" + +#include "xrGameSpy/GameSpy/pt/pt.h" +#include "xrGameSpy/GameSpy/gp/gp.h" +#include "xrGameSpy/GameSpy/sake/sake.h" +#include "xrGameSpy/GameSpy/sc/sc.h" #undef max diff --git a/src/xrGame/gamespy/GameSpy_GCD_Server.cpp b/src/xrGame/gamespy/GameSpy_GCD_Server.cpp index 7c121756317..447786fc0a3 100644 --- a/src/xrGame/gamespy/GameSpy_GCD_Server.cpp +++ b/src/xrGame/gamespy/GameSpy_GCD_Server.cpp @@ -2,7 +2,7 @@ #include "GameSpy_GCD_Server.h" #include "GameSpy_FuncDefs.h" #include "GameSpy_Base_Defs.h" -#include "../xrGameSpyServer.h" +#include "xrGameSpyServer.h" CGameSpy_GCD_Server::CGameSpy_GCD_Server() { diff --git a/src/xrGame/gamespy/GameSpy_GP.cpp b/src/xrGame/gamespy/GameSpy_GP.cpp index 277a9c635a5..0befead5c47 100644 --- a/src/xrGame/gamespy/GameSpy_GP.cpp +++ b/src/xrGame/gamespy/GameSpy_GP.cpp @@ -2,7 +2,8 @@ #include "GameSpy_GP.h" #include "account_manager.h" #include "login_manager.h" -#include "../MainMenu.h" //in case of fatal error, deleting profile class instance +#include "MainMenu.h" +//in case of fatal error, deleting profile class instance shared_str CGameSpy_GP::TryToTranslate(GPResult const & res) { diff --git a/src/xrGame/gamespy/GameSpy_GP.h b/src/xrGame/gamespy/GameSpy_GP.h index 37fa7f5610d..6ccb6f9cad5 100644 --- a/src/xrGame/gamespy/GameSpy_GP.h +++ b/src/xrGame/gamespy/GameSpy_GP.h @@ -3,7 +3,7 @@ #include "GameSpy_FuncDefs.h" -#include "../../xrGameSpy/GameSpy/GP/gp.h" +#include "xrGameSpy/GameSpy/GP/gp.h" class CGameSpy_GP { diff --git a/src/xrGame/gamespy/GameSpy_HTTP.cpp b/src/xrGame/gamespy/GameSpy_HTTP.cpp index 0126b229ac1..53013e90b3e 100644 --- a/src/xrGame/gamespy/GameSpy_HTTP.cpp +++ b/src/xrGame/gamespy/GameSpy_HTTP.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "GameSpy_HTTP.h" #include "GameSpy_Base_Defs.h" -#include "../MainMenu.h" +#include "MainMenu.h" CGameSpy_HTTP::CGameSpy_HTTP() { diff --git a/src/xrGame/gamespy/GameSpy_Patching.cpp b/src/xrGame/gamespy/GameSpy_Patching.cpp index 0ec8575465b..3c938ff058b 100644 --- a/src/xrGame/gamespy/GameSpy_Patching.cpp +++ b/src/xrGame/gamespy/GameSpy_Patching.cpp @@ -1,9 +1,9 @@ #include "StdAfx.h" #include "GameSpy_Patching.h" #include "GameSpy_Base_Defs.h" -#include "../MainMenu.h" -#include "../xrGameSpy/xrGameSpy_MainDefs.h" -#include "../xrEngine/no_single.h" +#include "MainMenu.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" +#include "xrEngine/no_single.h" CGameSpy_Patching::CGameSpy_Patching() { diff --git a/src/xrGame/gamespy/GameSpy_QR2_callbacks.cpp b/src/xrGame/gamespy/GameSpy_QR2_callbacks.cpp index 5ce6efb9056..f407506dc09 100644 --- a/src/xrGame/gamespy/GameSpy_QR2_callbacks.cpp +++ b/src/xrGame/gamespy/GameSpy_QR2_callbacks.cpp @@ -1,13 +1,11 @@ #include "StdAfx.h" - -#include "../xrGameSpyServer.h" +#include "xrGameSpyServer.h" #include "GameSpy_Keys.h" #include "GameSpy_GCD_Client.h" +#include "Level.h" +#include "game_sv_artefacthunt.h" +#include "ui/UIInventoryUtilities.h" -#include "../Level.h" - -#include "../game_sv_artefacthunt.h" -#include "../ui/UIInventoryUtilities.h" //--------------------------- QR2 callbacks --------------------------------------- #define ADD_KEY_VAL(g, q, qf, o, gf) {if (g) {q->qf(o, g->gf);} else q->BufferAdd(o, "");} #define ADD_KEY_VAL_INT(g, q, qf, o, gf) {if (g) {q->qf(o, int(g->gf));} else q->BufferAdd(o, "");} diff --git a/src/xrGame/gamespy/GameSpy_SAKE.cpp b/src/xrGame/gamespy/GameSpy_SAKE.cpp index e3310c456c8..5324125eccd 100644 --- a/src/xrGame/gamespy/GameSpy_SAKE.cpp +++ b/src/xrGame/gamespy/GameSpy_SAKE.cpp @@ -1,9 +1,8 @@ #include "stdafx.h" #include "GameSpy_Full.h" #include "GameSpy_SAKE.h" -#include "../MainMenu.h" -#include "../profile_store.h" - +#include "MainMenu.h" +#include "profile_store.h" shared_str const CGameSpy_SAKE::TryToTranslate(SAKERequestResult const & request_result) { diff --git a/src/xrGame/gsc_dsigned_ltx.cpp b/src/xrGame/gsc_dsigned_ltx.cpp index 587d59174df..dc4e12338c1 100644 --- a/src/xrGame/gsc_dsigned_ltx.cpp +++ b/src/xrGame/gsc_dsigned_ltx.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "gsc_dsigned_ltx.h" -#include "../xrCore/xr_ini.h" +#include "xrCore/xr_ini.h" gsc_dsigned_ltx_writer::gsc_dsigned_ltx_writer(u8 const p_number[crypto::xr_dsa::public_key_length], u8 const q_number[crypto::xr_dsa::private_key_length], diff --git a/src/xrGame/gsc_dsigned_ltx.h b/src/xrGame/gsc_dsigned_ltx.h index acf9f93cfa6..89986a71c98 100644 --- a/src/xrGame/gsc_dsigned_ltx.h +++ b/src/xrGame/gsc_dsigned_ltx.h @@ -1,7 +1,7 @@ #ifndef GSC_DSINGNED_LTX_INCLUDED #define GSC_DSINGNED_LTX_INCLUDED -#include "../xrCore/fastdelegate.h" +#include "xrCore/fastdelegate.h" #include "xr_dsa_signer.h" #include "xr_dsa_verifyer.h" diff --git a/src/xrGame/harvest_time.cpp b/src/xrGame/harvest_time.cpp index cab54c6fb43..00d0389c882 100644 --- a/src/xrGame/harvest_time.cpp +++ b/src/xrGame/harvest_time.cpp @@ -2,7 +2,7 @@ #include "harvest_time.h" #include "kills_store.h" #include "game_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" namespace award_system diff --git a/src/xrGame/hit_memory_manager.cpp b/src/xrGame/hit_memory_manager.cpp index ab8f0d16ea3..7ecd19540a7 100644 --- a/src/xrGame/hit_memory_manager.cpp +++ b/src/xrGame/hit_memory_manager.cpp @@ -21,7 +21,7 @@ #include "profiler.h" #include "client_spawn_manager.h" #include "memory_manager.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #ifndef MASTER_GOLD # include "actor.h" diff --git a/src/xrGame/hits_store.cpp b/src/xrGame/hits_store.cpp index 020a25e8baa..1cfd0a95de2 100644 --- a/src/xrGame/hits_store.cpp +++ b/src/xrGame/hits_store.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "hits_store.h" -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" namespace award_system { diff --git a/src/xrGame/hits_store.h b/src/xrGame/hits_store.h index 0e2eceeaa6f..8859a5dd164 100644 --- a/src/xrGame/hits_store.h +++ b/src/xrGame/hits_store.h @@ -2,7 +2,7 @@ #define HITS_STORE_INCLUDED #include "obsolete_queue.h" -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" namespace award_system { diff --git a/src/xrGame/ik/IKLimb.cpp b/src/xrGame/ik/IKLimb.cpp index 11177e9e7d0..67a5a12f14a 100644 --- a/src/xrGame/ik/IKLimb.cpp +++ b/src/xrGame/ik/IKLimb.cpp @@ -1,24 +1,17 @@ #include "stdafx.h" #include "IKLimb.h" - #include - -#include "../../include/xrrender/Kinematics.h" - -#include "gameobject.h" - -#include "../game_object_space.h" -#include "../ik_anim_state.h" - -//#include "../ode_include.h" -#include "../../xrphysics/MathUtils.h" -#include "../../xrphysics/matrix_utils.h" -#include "../pose_extrapolation.h" +#include "Include/xrRender/Kinematics.h" +#include "GameObject.h" +#include "game_object_space.h" +#include "ik_anim_state.h" +#include "xrPhysics/MathUtils.h" +#include "xrPhysics/matrix_utils.h" +#include "pose_extrapolation.h" #ifdef DEBUG -#include "../PHDebug.h" +#include "PHDebug.h" #endif - extern int ik_allign_free_foot; int ik_blend_free_foot = 1; diff --git a/src/xrGame/ik/IKLimb.h b/src/xrGame/ik/IKLimb.h index c1ef902fbac..bf4bd32423c 100644 --- a/src/xrGame/ik/IKLimb.h +++ b/src/xrGame/ik/IKLimb.h @@ -1,15 +1,12 @@ #pragma once - - #include "limb.h" -#include "ikfoot.h" - -#include "../../include/xrrender/KinematicsAnimated.h" -#include "../ik_anim_state.h" -#include "../ik_calculate_data.h" -#include "../ik_limb_state.h" -#include "../ik_collide_data.h" -#include "../ik_limb_state_predict.h" +#include "IKFoot.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "ik_anim_state.h" +#include "ik_calculate_data.h" +#include "ik_limb_state.h" +#include "ik_collide_data.h" +#include "ik_limb_state_predict.h" class IKinematics ; class CDB::TRI ; diff --git a/src/xrGame/ik/limb.cxx b/src/xrGame/ik/limb.cxx index 0fba713510f..c419e47eb49 100644 --- a/src/xrGame/ik/limb.cxx +++ b/src/xrGame/ik/limb.cxx @@ -30,12 +30,9 @@ */ -//#include -//#include -//#include #include "stdafx.h" #include "limb.h" -//#include "../ode_include.h" + enum { SolvePosOnly = 1, SolvePosAndOrientation = 2 }; // diff --git a/src/xrGame/ik_anim_state.cpp b/src/xrGame/ik_anim_state.cpp index 237b0325cef..4ca5ca4428d 100644 --- a/src/xrGame/ik_anim_state.cpp +++ b/src/xrGame/ik_anim_state.cpp @@ -2,8 +2,8 @@ #include "ik_anim_state.h" -//#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/KinematicsAnimated.h" +//#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "xrCore/Animation/Motion.hpp" IC bool is_in( const motion_marks::interval &i, float v ) diff --git a/src/xrGame/ik_foot_collider.cpp b/src/xrGame/ik_foot_collider.cpp index 019396602ce..5497134ae2d 100644 --- a/src/xrGame/ik_foot_collider.cpp +++ b/src/xrGame/ik_foot_collider.cpp @@ -3,14 +3,14 @@ #include "xrEngine/GameMtlLib.h" #include "xrCDB/Intersect.hpp" -#include "../include/xrrender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "Level.h" #include "GameObject.h" #include "entity_alive.h" //#include "ode_include.h" -#include "../xrphysics/MathUtils.h" +#include "xrPhysics/MathUtils.h" #include "ik_collide_data.h" diff --git a/src/xrGame/ik_limb_state.h b/src/xrGame/ik_limb_state.h index 42c46dcedad..cc2bf9cc888 100644 --- a/src/xrGame/ik_limb_state.h +++ b/src/xrGame/ik_limb_state.h @@ -2,7 +2,7 @@ #include "ik_calculate_data.h" -#include "../include/xrrender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" class CIKLimb; IC bool state_valide( const calculate_state &prev_state ); diff --git a/src/xrGame/ik_object_shift.cpp b/src/xrGame/ik_object_shift.cpp index ec10e6bf4a4..1bd913b214f 100644 --- a/src/xrGame/ik_object_shift.cpp +++ b/src/xrGame/ik_object_shift.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "ik_object_shift.h" #include "pose_extrapolation.h" -#include "../xrphysics/mathutils.h" +#include "xrPhysics/mathutils.h" #ifdef DEBUG #include "phdebug.h" #endif diff --git a/src/xrGame/imotion_position.cpp b/src/xrGame/imotion_position.cpp index ec92a5950ae..e058748f63c 100644 --- a/src/xrGame/imotion_position.cpp +++ b/src/xrGame/imotion_position.cpp @@ -2,11 +2,11 @@ #include "imotion_position.h" -#include "../xrphysics/physicsshell.h" -#include "../xrphysics/MathUtils.h" -#include "../xrphysics/extendedgeom.h" +#include "xrPhysics/physicsshell.h" +#include "xrPhysics/MathUtils.h" +#include "xrPhysics/extendedgeom.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include /////////////////////////////////////////////////////////////////////////////////////// #include "physicsshellholder.h" diff --git a/src/xrGame/imotion_position.h b/src/xrGame/imotion_position.h index 729f7c46acb..2fb1cec79f5 100644 --- a/src/xrGame/imotion_position.h +++ b/src/xrGame/imotion_position.h @@ -1,7 +1,7 @@ #pragma once #include "interactive_motion.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" class imotion_position; enum motion_history_state; class imotion_position: diff --git a/src/xrGame/imotion_velocity.cpp b/src/xrGame/imotion_velocity.cpp index 27daf47a7cd..1e0447649f0 100644 --- a/src/xrGame/imotion_velocity.cpp +++ b/src/xrGame/imotion_velocity.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "imotion_velocity.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" void imotion_velocity::state_start( ) { diff --git a/src/xrGame/interactive_animation.cpp b/src/xrGame/interactive_animation.cpp index b49f10924bb..921eea674da 100644 --- a/src/xrGame/interactive_animation.cpp +++ b/src/xrGame/interactive_animation.cpp @@ -2,12 +2,12 @@ #include "interactive_animation.h" -#include "../xrphysics/physicsshell.h" -#include "../xrphysics/ExtendedGeom.h" -#include "../xrphysics/mathutils.h" +#include "xrPhysics/physicsshell.h" +#include "xrPhysics/ExtendedGeom.h" +#include "xrPhysics/mathutils.h" //#include "phobject.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" diff --git a/src/xrGame/interactive_motion.cpp b/src/xrGame/interactive_motion.cpp index 30de278f53e..c1406dbf7cd 100644 --- a/src/xrGame/interactive_motion.cpp +++ b/src/xrGame/interactive_motion.cpp @@ -2,10 +2,10 @@ #include "interactive_motion.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" #include "PhysicsShellHolder.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "game_object_space.h" diff --git a/src/xrGame/interactive_motion.h b/src/xrGame/interactive_motion.h index 5e82c5ff8a8..302956a89f9 100644 --- a/src/xrGame/interactive_motion.h +++ b/src/xrGame/interactive_motion.h @@ -1,5 +1,5 @@ #pragma once -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" class CPhysicsShell; class interactive_motion { diff --git a/src/xrGame/inventory_item.cpp b/src/xrGame/inventory_item.cpp index de1cb55e900..ea3d8864621 100644 --- a/src/xrGame/inventory_item.cpp +++ b/src/xrGame/inventory_item.cpp @@ -18,10 +18,10 @@ #include "game_cl_base.h" #include "Actor.h" #include "string_table.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ai_object_location.h" #include "object_broker.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #ifdef DEBUG diff --git a/src/xrGame/inventory_owner_info.cpp b/src/xrGame/inventory_owner_info.cpp index 0cfad76138d..3bf3682d10e 100644 --- a/src/xrGame/inventory_owner_info.cpp +++ b/src/xrGame/inventory_owner_info.cpp @@ -12,7 +12,7 @@ #include "alife_simulator.h" #include "alife_registry_container.h" #include "script_game_object.h" -#include "level.h" +#include "Level.h" #include "infoportion.h" #include "alife_registry_wrappers.h" #include "script_callback_ex.h" diff --git a/src/xrGame/inventory_quickswitch.cpp b/src/xrGame/inventory_quickswitch.cpp index f3e29a477dd..b0aa6a97310 100644 --- a/src/xrGame/inventory_quickswitch.cpp +++ b/src/xrGame/inventory_quickswitch.cpp @@ -2,7 +2,7 @@ #include "inventory.h" #include "weapon.h" #include "actor.h" -#include "../xrCore/xr_ini.h" +#include "xrCore/xr_ini.h" static u32 const ammo_to_cost_map_koef = 3; class next_weapon_searcher diff --git a/src/xrGame/inventory_upgrade.cpp b/src/xrGame/inventory_upgrade.cpp index 4f0cc1d1d8b..b27a4df870f 100644 --- a/src/xrGame/inventory_upgrade.cpp +++ b/src/xrGame/inventory_upgrade.cpp @@ -8,7 +8,7 @@ #include "pch_script.h" #include "ai_space.h" -#include "../xrServerEntities/script_engine.h" +#include "xrServerEntities/script_engine.h" #include "string_table.h" #include "inventory_upgrade.h" diff --git a/src/xrGame/inventory_upgrade_property.cpp b/src/xrGame/inventory_upgrade_property.cpp index ca156207999..b3b4749e135 100644 --- a/src/xrGame/inventory_upgrade_property.cpp +++ b/src/xrGame/inventory_upgrade_property.cpp @@ -8,7 +8,7 @@ #include "pch_script.h" #include "ai_space.h" -#include "../xrServerEntities/script_engine.h" +#include "xrServerEntities/script_engine.h" #include "string_table.h" #include "inventory_upgrade_property.h" diff --git a/src/xrGame/killer_victim_velocity_angle.cpp b/src/xrGame/killer_victim_velocity_angle.cpp index 8663a59deca..829dbdc3502 100644 --- a/src/xrGame/killer_victim_velocity_angle.cpp +++ b/src/xrGame/killer_victim_velocity_angle.cpp @@ -2,12 +2,12 @@ #include "killer_victim_velocity_angle.h" #include "game_state_accumulator.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "ammunition_groups.h" #include "actor.h" #include "CharacterPhysicsSupport.h" #include "PHMovementControl.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" namespace award_system { diff --git a/src/xrGame/kills_store.cpp b/src/xrGame/kills_store.cpp index fa1c1520de4..ef3f848d194 100644 --- a/src/xrGame/kills_store.cpp +++ b/src/xrGame/kills_store.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "kills_store.h" -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" namespace award_system { diff --git a/src/xrGame/kills_store.h b/src/xrGame/kills_store.h index cce4626573a..3bde151b065 100644 --- a/src/xrGame/kills_store.h +++ b/src/xrGame/kills_store.h @@ -3,7 +3,7 @@ #include "obsolete_queue.h" #include "game_base_kill_type.h" -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" namespace award_system { diff --git a/src/xrGame/level_changer.cpp b/src/xrGame/level_changer.cpp index 615f4d6f66f..b082daee684 100644 --- a/src/xrGame/level_changer.cpp +++ b/src/xrGame/level_changer.cpp @@ -11,14 +11,14 @@ #include "hit.h" #include "actor.h" #include "xrserver_objects_alife.h" -#include "level.h" +#include "Level.h" #include "ai_object_location.h" #include "ai_space.h" #include "level_graph.h" #include "game_level_cross_table.h" #include "UIGameSP.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" xr_vector g_lchangers; diff --git a/src/xrGame/level_changer.h b/src/xrGame/level_changer.h index b86c84fd116..42daf1f0908 100644 --- a/src/xrGame/level_changer.h +++ b/src/xrGame/level_changer.h @@ -9,7 +9,7 @@ #pragma once #include "GameObject.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" #include "game_graph_space.h" class CLevelChanger : public CGameObject, public Feel::Touch { diff --git a/src/xrGame/level_debug.cpp b/src/xrGame/level_debug.cpp index 86a343107e1..309bbe9734f 100644 --- a/src/xrGame/level_debug.cpp +++ b/src/xrGame/level_debug.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "level_debug.h" -#include "../xrEngine/xr_object.h" -#include "level.h" +#include "xrEngine/xr_object.h" +#include "Level.h" #ifdef DEBUG # include "debug_renderer.h" diff --git a/src/xrGame/level_graph.h b/src/xrGame/level_graph.h index 2f0e8fc8f76..5a1df8d1c01 100644 --- a/src/xrGame/level_graph.h +++ b/src/xrGame/level_graph.h @@ -9,16 +9,16 @@ #pragma once #ifndef AI_COMPILER -# include "../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #else -# include "../../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #endif #include "alife_space.h" #include "level_graph_space.h" #include "game_graph_space.h" -#include "../Include/xrRender/DebugShader.h" +#include "Include/xrRender/DebugShader.h" namespace LevelGraph { class CHeader; diff --git a/src/xrGame/level_graph_debug.cpp b/src/xrGame/level_graph_debug.cpp index a7d52625bee..21c027df80c 100644 --- a/src/xrGame/level_graph_debug.cpp +++ b/src/xrGame/level_graph_debug.cpp @@ -12,7 +12,7 @@ #ifndef AI_COMPILER #include "level_graph.h" -#include "level.h" +#include "Level.h" #include "game_base_space.h" #include "xrserver_objects_alife_monsters.h" #include "alife_simulator.h" diff --git a/src/xrGame/level_graph_debug2.cpp b/src/xrGame/level_graph_debug2.cpp index da1cff26b6f..7ec6694ff0b 100644 --- a/src/xrGame/level_graph_debug2.cpp +++ b/src/xrGame/level_graph_debug2.cpp @@ -12,7 +12,7 @@ #ifndef AI_COMPILER #include "level_graph.h" -#include "../xrEngine/customhud.h" +#include "xrEngine/customhud.h" #include "ai_space.h" #include "ui_base.h" #include "game_graph.h" @@ -36,7 +36,7 @@ #include "memory_manager.h" #include "enemy_manager.h" #include "memory_space.h" -#include "level.h" +#include "Level.h" #include "ai_object_location.h" #include "movement_manager.h" #include "graph_engine.h" diff --git a/src/xrGame/level_script.cpp b/src/xrGame/level_script.cpp index eef046821bc..0148c617fc2 100644 --- a/src/xrGame/level_script.cpp +++ b/src/xrGame/level_script.cpp @@ -7,13 +7,13 @@ //////////////////////////////////////////////////////////////////////////// #include "pch_script.h" -#include "level.h" +#include "Level.h" #include "actor.h" #include "script_game_object.h" #include "patrol_path_storage.h" #include "xrServer.h" #include "client_spawn_manager.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #include "game_cl_base.h" #include "UIGameCustom.h" #include "UI/UIDialogWnd.h" diff --git a/src/xrGame/level_sounds.cpp b/src/xrGame/level_sounds.cpp index b64894879ee..c75222dd9a9 100644 --- a/src/xrGame/level_sounds.cpp +++ b/src/xrGame/level_sounds.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #pragma hdrstop -#include "level.h" +#include "Level.h" #include "level_sounds.h" //----------------------------------------------------------------------------- diff --git a/src/xrGame/login_manager.cpp b/src/xrGame/login_manager.cpp index 53e7dd15aba..22cb8e5073b 100644 --- a/src/xrGame/login_manager.cpp +++ b/src/xrGame/login_manager.cpp @@ -7,7 +7,7 @@ #include "gamespy/GameSpy_ATLAS.h" #include "gamespy/GameSpy_Patching.h" #include "RegistryFuncs.h" -#include "../xrGameSpy/xrGameSpy_MainDefs.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" #include "player_name_modifyer.h" #include "ui/UICDkey.h" #include "secure_messaging.h" diff --git a/src/xrGame/login_manager.h b/src/xrGame/login_manager.h index 069987d2ae3..f95995db6ff 100644 --- a/src/xrGame/login_manager.h +++ b/src/xrGame/login_manager.h @@ -4,7 +4,7 @@ #include #include "mixed_delegate.h" -#include "../xrGameSpy/GameSpy/GP/gp.h" +#include "xrGameSpy/GameSpy/GP/gp.h" #include "account_manager.h" #include "script_export_space.h" #include "login_manager.h" diff --git a/src/xrGame/map_location.cpp b/src/xrGame/map_location.cpp index cf29cd95511..859861f6667 100644 --- a/src/xrGame/map_location.cpp +++ b/src/xrGame/map_location.cpp @@ -3,8 +3,8 @@ #include "map_spot.h" #include "map_manager.h" -#include "level.h" -#include "../xrEngine/xr_object.h" +#include "Level.h" +#include "xrEngine/xr_object.h" #include "ai_space.h" #include "game_graph.h" #include "xrServer.h" diff --git a/src/xrGame/map_manager.cpp b/src/xrGame/map_manager.cpp index 5548d1a6a50..60a24b30b0e 100644 --- a/src/xrGame/map_manager.cpp +++ b/src/xrGame/map_manager.cpp @@ -2,7 +2,7 @@ #include "map_manager.h" #include "alife_registry_wrappers.h" #include "inventoryowner.h" -#include "level.h" +#include "Level.h" #include "actor.h" #include "relation_registry.h" #include "GameObject.h" diff --git a/src/xrGame/map_spot.cpp b/src/xrGame/map_spot.cpp index a8e4fff0fe6..301ce0aa121 100644 --- a/src/xrGame/map_spot.cpp +++ b/src/xrGame/map_spot.cpp @@ -4,14 +4,14 @@ #include "ui/UIXmlInit.h" #include "ui/UIMApWnd.h" -#include "level.h" +#include "Level.h" #include "ui/UIInventoryUtilities.h" -#include "../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" #include "object_broker.h" #include "ui/UITextureMaster.h" #include "ui/UIHelper.h" -#include "../Include/xrRender/UIShader.h" +#include "Include/xrRender/UIShader.h" #include "gametaskmanager.h" #include "gametask.h" diff --git a/src/xrGame/material_manager.cpp b/src/xrGame/material_manager.cpp index 90e79276101..fc4959ad9c1 100644 --- a/src/xrGame/material_manager.cpp +++ b/src/xrGame/material_manager.cpp @@ -12,7 +12,7 @@ #include "phmovementcontrol.h" #include "entity_alive.h" #include "CharacterPhysicsSupport.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" CMaterialManager::CMaterialManager (CObject *object, CPHMovementControl *movement_control) { diff --git a/src/xrGame/medkit.cpp b/src/xrGame/medkit.cpp index 62c98a6802a..a0b8a6823b4 100644 --- a/src/xrGame/medkit.cpp +++ b/src/xrGame/medkit.cpp @@ -6,7 +6,7 @@ #include "stdafx.h" #include "medkit.h" -#include "../xrphysics/PhysicsShell.h" +#include "xrPhysics/PhysicsShell.h" CMedkit::CMedkit() { diff --git a/src/xrGame/memory_space_impl.h b/src/xrGame/memory_space_impl.h index 6fd4951e2c0..2b3a2a37157 100644 --- a/src/xrGame/memory_space_impl.h +++ b/src/xrGame/memory_space_impl.h @@ -10,7 +10,7 @@ #include "memory_space.h" #include "gameobject.h" -#include "level.h" +#include "Level.h" #include "ai_space.h" #include "ai_object_location.h" #include "level_graph.h" diff --git a/src/xrGame/mixed_delegate.h b/src/xrGame/mixed_delegate.h index 739ae0187dc..fff884cfe5e 100644 --- a/src/xrGame/mixed_delegate.h +++ b/src/xrGame/mixed_delegate.h @@ -1,7 +1,7 @@ #ifndef MIXED_DELEGATE_INCLUDED #define MIXED_DELEGATE_INCLUDED -#include "../xrCore/fastdelegate.h" +#include "xrCore/fastdelegate.h" #include "pch_script.h" #include "script_export_space.h" #include "script_callback_ex.h" diff --git a/src/xrGame/movement_manager_physic.cpp b/src/xrGame/movement_manager_physic.cpp index 696a29ddd4c..183a39edf88 100644 --- a/src/xrGame/movement_manager_physic.cpp +++ b/src/xrGame/movement_manager_physic.cpp @@ -10,9 +10,9 @@ #include "movement_manager.h" #include "PHMovementControl.h" #include "detail_path_manager.h" -#include "level.h" +#include "Level.h" #include "custommonster.h" -#include "../xrphysics/IColisiondamageInfo.h" +#include "xrPhysics/IColisiondamageInfo.h" #include "profiler.h" diff --git a/src/xrGame/moving_bones_snd_player.cpp b/src/xrGame/moving_bones_snd_player.cpp index d2c9690696e..cc4f240fe9f 100644 --- a/src/xrGame/moving_bones_snd_player.cpp +++ b/src/xrGame/moving_bones_snd_player.cpp @@ -2,11 +2,11 @@ #include "moving_bones_snd_player.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "xrCore/Animation/Bone.hpp" #include "gameobject.h" -#include "../xrphysics/matrix_utils.h" +#include "xrPhysics/matrix_utils.h" #ifdef DEBUG #include "phdebug.h" #endif diff --git a/src/xrGame/mp_config_sections.h b/src/xrGame/mp_config_sections.h index 82cea98e477..92f8b6792b8 100644 --- a/src/xrGame/mp_config_sections.h +++ b/src/xrGame/mp_config_sections.h @@ -1,8 +1,8 @@ #ifndef MP_CONFIG_SECTIONS_INCLUDED #define MP_CONFIG_SECTIONS_INCLUDED -#include "../xrCore/xr_ini.h" -#include "../xrCore/FS.h" +#include "xrCore/xr_ini.h" +#include "xrCore/FS.h" #include "anticheat_dumpable_object.h" class CGameObject; diff --git a/src/xrGame/object_handler.cpp b/src/xrGame/object_handler.cpp index 5d231025730..b8621a95179 100644 --- a/src/xrGame/object_handler.cpp +++ b/src/xrGame/object_handler.cpp @@ -18,7 +18,7 @@ #include "ai/stalker/ai_stalker.h" #include "inventory.h" #include "torch.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "memory_manager.h" #include "enemy_manager.h" #include "ai_object_location.h" diff --git a/src/xrGame/obsolete_queue_inline.h b/src/xrGame/obsolete_queue_inline.h index f15c7baf3c9..0b17e2013d8 100644 --- a/src/xrGame/obsolete_queue_inline.h +++ b/src/xrGame/obsolete_queue_inline.h @@ -1,4 +1,4 @@ -#include "../xrCore/buffer_vector.h" +#include "xrCore/buffer_vector.h" template class obsolete_queue, MaxCount> diff --git a/src/xrGame/patrol_path_manager.h b/src/xrGame/patrol_path_manager.h index 38b1f61856f..652a4fe5098 100644 --- a/src/xrGame/patrol_path_manager.h +++ b/src/xrGame/patrol_path_manager.h @@ -8,7 +8,7 @@ #pragma once -#include "level.h" +#include "Level.h" #include "script_engine.h" #include "patrol_path_storage.h" #include "patrol_path.h" diff --git a/src/xrGame/phvalide.cpp b/src/xrGame/phvalide.cpp deleted file mode 100644 index f911aa06a2c..00000000000 --- a/src/xrGame/phvalide.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "stdafx.h" - -#include "phvalide.h" -#include "mathutils.h" -#include "objectdump.h" - - -extern Fbox phBoundaries; - -bool valid_pos( const Fvector &P ) -{ - return valid_pos( P, phBoundaries ); -} - -/* - Msg(" %s \n", msg);\ - Msg(" pos: %e,%e,%e, seems to be invalid", pos.x,pos.y,pos.z);\ - Msg("Level box: %e,%e,%e-%e,%e,%e,",bounds.x1,bounds.y1,bounds.z1,bounds.x2,bounds.y2,bounds.z2);\ - Msg("Object: %s",(obj->cName().c_str()));\ - Msg("Visual: %s",(obj->cNameVisual().c_str()));\ -*/ - - -#ifdef DEBUG -std::string dbg_valide_pos_string( const Fvector &pos,const Fbox &bounds, const CObject *obj, LPCSTR msg ) -{ - return std::string( msg ) + - make_string( "\n pos: %s , seems to be invalid ", get_string( pos ).c_str() ) + - make_string( "\n Level box: %s ", get_string( bounds ).c_str() ) + - std::string( "\n object dump: \n" ) + - dbg_object_full_dump_string( obj ); -} -std::string dbg_valide_pos_string( const Fvector &pos, const CObject *obj, LPCSTR msg ) -{ - return dbg_valide_pos_string( pos, phBoundaries, obj, msg ); -} -#endif diff --git a/src/xrGame/phvalide.h b/src/xrGame/phvalide.h deleted file mode 100644 index 04299d8e236..00000000000 --- a/src/xrGame/phvalide.h +++ /dev/null @@ -1,55 +0,0 @@ -#pragma once - -#include "ode_include.h" - -IC BOOL dV_valid (const dReal * v) -{ - return _valid(v[0])&&_valid(v[1])&&_valid(v[2]); -} - -IC BOOL dM_valid (const dReal* m) -{ - return _valid(m[0])&&_valid(m[1])&&_valid(m[2])&& - _valid(m[4])&&_valid(m[5])&&_valid(m[6])&& - _valid(m[8])&&_valid(m[9])&&_valid(m[10]); -} - -IC BOOL dV4_valid (const dReal* v4) -{ - return _valid(v4[0])&&_valid(v4[1])&& - _valid(v4[2])&&_valid(v4[3]); -} -IC BOOL dQ_valid (const dReal* q) -{ - return dV4_valid(q); -} -IC BOOL dMass_valide(const dMass* m) -{ - return _valid(m->mass)&& - dV_valid(m->c)&& - dM_valid(m->I); -} -IC BOOL dBodyStateValide(const dBodyID body) -{ - return dM_valid(dBodyGetRotation(body)) && - dV_valid(dBodyGetPosition(body))&& - dV_valid(dBodyGetLinearVel(body))&& - dV_valid(dBodyGetAngularVel(body))&& - dV_valid(dBodyGetTorque(body))&& - dV_valid(dBodyGetForce(body)) - ; -} -bool valid_pos( const Fvector &P ); - -#ifdef DEBUG - -std::string dbg_valide_pos_string( const Fvector &pos,const Fbox &bounds, const CObject *obj, LPCSTR msg ); -std::string dbg_valide_pos_string( const Fvector &pos, const CObject *obj, LPCSTR msg ); - -#define VERIFY_BOUNDARIES2(pos,bounds,obj,msg) VERIFY2( valid_pos( pos, bounds ), dbg_valide_pos_string( pos, bounds, obj, msg ) ) -#define VERIFY_BOUNDARIES(pos,bounds,obj) VERIFY_BOUNDARIES2(pos,bounds,obj," ") - -#else -#define VERIFY_BOUNDARIES(pos,bounds,obj) -#define VERIFY_BOUNDARIES2(pos,bounds,obj,msg) -#endif \ No newline at end of file diff --git a/src/xrGame/physic_item.cpp b/src/xrGame/physic_item.cpp index e1b4c140ccb..ddf83e90bfb 100644 --- a/src/xrGame/physic_item.cpp +++ b/src/xrGame/physic_item.cpp @@ -8,11 +8,11 @@ #include "stdafx.h" #include "physic_item.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" #include "xrserver_objects.h" -#include "../Include/xrRender/RenderVisual.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/RenderVisual.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" #define CHOOSE_MAX(x,inst_x,y,inst_y,z,inst_z)\ if(x>y)\ if(x>z){inst_x;}\ diff --git a/src/xrGame/physics_element_scripted.h b/src/xrGame/physics_element_scripted.h index b5dcb411861..b10a149c6ef 100644 --- a/src/xrGame/physics_element_scripted.h +++ b/src/xrGame/physics_element_scripted.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrphysics/iphysics_scripted.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/iphysics_scripted.h" +#include "xrPhysics/physicsshell.h" #include "script_export_space.h" class CPhysicsElement; diff --git a/src/xrGame/physics_game.cpp b/src/xrGame/physics_game.cpp index ea0d8bd1d47..6650d3bcbbd 100644 --- a/src/xrGame/physics_game.cpp +++ b/src/xrGame/physics_game.cpp @@ -1,23 +1,23 @@ #include "stdafx.h" #include "ParticlesObject.h" #include "xrEngine/GameMtlLib.h" -#include "level.h" +#include "Level.h" #include "gamepersistent.h" -#include "../xrphysics/Extendedgeom.h" +#include "xrPhysics/Extendedgeom.h" #include "PhysicsGamePars.h" //#include "PhysicsCommon.h" -#include "../xrphysics/PhysicsExternalCommon.h" +#include "xrPhysics/PhysicsExternalCommon.h" #include "PhSoundPlayer.h" #include "PhysicsShellHolder.h" #include "PHCommander.h" -#include "../xrphysics/MathUtils.h" -#include "../xrphysics/iPHWorld.h" -//#include "../xrphysics/physicsshell.h" +#include "xrPhysics/MathUtils.h" +#include "xrPhysics/iPHWorld.h" +//#include "xrPhysics/physicsshell.h" #include "phreqcomparer.h" -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/WallMarkArray.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/WallMarkArray.h" //#ifdef DEBUG //#include "phdebug.h" //#endif diff --git a/src/xrGame/physics_joint_scripted.h b/src/xrGame/physics_joint_scripted.h index ef35edfe005..2ee827bdc38 100644 --- a/src/xrGame/physics_joint_scripted.h +++ b/src/xrGame/physics_joint_scripted.h @@ -1,7 +1,7 @@ #pragma once -#include "../xrphysics/iphysics_scripted.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/iphysics_scripted.h" +#include "xrPhysics/physicsshell.h" #include "script_export_space.h" class cphysics_element_scripted; class CPhysicsJoint; diff --git a/src/xrGame/physics_shell_animated.cpp b/src/xrGame/physics_shell_animated.cpp index 73b6b829b72..53dcc82f02a 100644 --- a/src/xrGame/physics_shell_animated.cpp +++ b/src/xrGame/physics_shell_animated.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "physics_shell_animated.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/physicsshell.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" physics_shell_animated::physics_shell_animated( CPhysicsShellHolder* O, bool _update_velocity ): update_velocity( _update_velocity ) diff --git a/src/xrGame/physics_shell_scripted.h b/src/xrGame/physics_shell_scripted.h index cdf5aa8986d..5228aa389ec 100644 --- a/src/xrGame/physics_shell_scripted.h +++ b/src/xrGame/physics_shell_scripted.h @@ -1,7 +1,7 @@ #pragma once -#include "../xrphysics/iphysics_scripted.h" -#include "../xrphysics/physicsshell.h" +#include "xrPhysics/iphysics_scripted.h" +#include "xrPhysics/physicsshell.h" #include "script_export_space.h" class CPhysicsShell; diff --git a/src/xrGame/physics_world_scripted.cpp b/src/xrGame/physics_world_scripted.cpp index 376268649fc..51e38142721 100644 --- a/src/xrGame/physics_world_scripted.cpp +++ b/src/xrGame/physics_world_scripted.cpp @@ -2,7 +2,7 @@ #include "physics_world_scripted.h" -#include "level.h" +#include "Level.h" #include "PHCommander.h" diff --git a/src/xrGame/physics_world_scripted.h b/src/xrGame/physics_world_scripted.h index 5e18b45f048..3bafb5a1737 100644 --- a/src/xrGame/physics_world_scripted.h +++ b/src/xrGame/physics_world_scripted.h @@ -1,7 +1,7 @@ #pragma once -#include "../xrphysics/iphysics_scripted.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphysics_scripted.h" +#include "xrPhysics/iphworld.h" #include "script_export_space.h" class CPHCondition; diff --git a/src/xrGame/player_hud.cpp b/src/xrGame/player_hud.cpp index 04bcf37ad64..ded4736502e 100644 --- a/src/xrGame/player_hud.cpp +++ b/src/xrGame/player_hud.cpp @@ -6,7 +6,7 @@ #include "physic_item.h" #include "static_cast_checked.hpp" #include "actoreffector.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" player_hud* g_player_hud = NULL; Fvector _ancor_pos; diff --git a/src/xrGame/player_hud.h b/src/xrGame/player_hud.h index e23e698bdce..6f46e23acc8 100644 --- a/src/xrGame/player_hud.h +++ b/src/xrGame/player_hud.h @@ -1,8 +1,8 @@ #pragma once #include "firedeps.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "actor_defs.h" class player_hud; diff --git a/src/xrGame/player_hud_tune.cpp b/src/xrGame/player_hud_tune.cpp index a849f4399e0..e0ff83bb41d 100644 --- a/src/xrGame/player_hud_tune.cpp +++ b/src/xrGame/player_hud_tune.cpp @@ -1,13 +1,13 @@ #include "stdafx.h" #include "player_hud.h" -#include "level.h" +#include "Level.h" #include "debug_renderer.h" -#include "../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" #include "HudManager.h" #include "HudItem.h" -#include "../xrEngine/Effector.h" -#include "../xrEngine/CameraManager.h" -#include "../xrEngine/FDemoRecord.h" +#include "xrEngine/Effector.h" +#include "xrEngine/CameraManager.h" +#include "xrEngine/FDemoRecord.h" #include "ui_base.h" #include "debug_renderer.h" diff --git a/src/xrGame/player_state_achilles_heel.cpp b/src/xrGame/player_state_achilles_heel.cpp index 450d1a71ca4..e1159510859 100644 --- a/src/xrGame/player_state_achilles_heel.cpp +++ b/src/xrGame/player_state_achilles_heel.cpp @@ -2,7 +2,7 @@ #include "player_state_achilles_heel.h" #include "game_state_accumulator.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "ammunition_groups.h" namespace award_system diff --git a/src/xrGame/player_state_avenger.cpp b/src/xrGame/player_state_avenger.cpp index 5457d5aec8f..3a294b144c5 100644 --- a/src/xrGame/player_state_avenger.cpp +++ b/src/xrGame/player_state_avenger.cpp @@ -2,7 +2,7 @@ #include "player_state_avenger.h" #include "kills_store.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" namespace award_system diff --git a/src/xrGame/player_state_cherub.cpp b/src/xrGame/player_state_cherub.cpp index e342d4f967e..cd1fcd1f9c7 100644 --- a/src/xrGame/player_state_cherub.cpp +++ b/src/xrGame/player_state_cherub.cpp @@ -2,7 +2,7 @@ #include "player_state_cherub.h" #include "kills_store.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" namespace award_system diff --git a/src/xrGame/player_state_climber.cpp b/src/xrGame/player_state_climber.cpp index b849be4bbf8..4aabd3fcc4a 100644 --- a/src/xrGame/player_state_climber.cpp +++ b/src/xrGame/player_state_climber.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "player_state_climber.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" namespace award_system diff --git a/src/xrGame/player_state_marksman.cpp b/src/xrGame/player_state_marksman.cpp index c61e719967c..087d46b6274 100644 --- a/src/xrGame/player_state_marksman.cpp +++ b/src/xrGame/player_state_marksman.cpp @@ -2,7 +2,7 @@ #include "player_state_marksman.h" #include "kills_store.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" #include "actor.h" diff --git a/src/xrGame/player_state_multichampion.cpp b/src/xrGame/player_state_multichampion.cpp index 17098fba9bc..9eb7aec1153 100644 --- a/src/xrGame/player_state_multichampion.cpp +++ b/src/xrGame/player_state_multichampion.cpp @@ -2,7 +2,7 @@ #include "player_state_multichampion.h" #include "player_spot_params.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" namespace award_system diff --git a/src/xrGame/player_state_opener.cpp b/src/xrGame/player_state_opener.cpp index d90f613342a..da247ddf85e 100644 --- a/src/xrGame/player_state_opener.cpp +++ b/src/xrGame/player_state_opener.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "player_state_opener.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" namespace award_system diff --git a/src/xrGame/player_state_remembrance.cpp b/src/xrGame/player_state_remembrance.cpp index ab8cc2411a8..74c08d22727 100644 --- a/src/xrGame/player_state_remembrance.cpp +++ b/src/xrGame/player_state_remembrance.cpp @@ -2,7 +2,7 @@ #include "player_state_remembrance.h" #include "kills_store.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "game_state_accumulator.h" #include "actor.h" diff --git a/src/xrGame/pose_extrapolation.h b/src/xrGame/pose_extrapolation.h index 6271d459386..c493213e34d 100644 --- a/src/xrGame/pose_extrapolation.h +++ b/src/xrGame/pose_extrapolation.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrphysics/CycleConstStorage.h" +#include "xrPhysics/CycleConstStorage.h" namespace extrapolation { diff --git a/src/xrGame/pp_effector_custom.h b/src/xrGame/pp_effector_custom.h index 2f241ef8d2e..8c81cef503d 100644 --- a/src/xrGame/pp_effector_custom.h +++ b/src/xrGame/pp_effector_custom.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrEngine/effectorPP.h" -#include "../xrEngine/cameramanager.h" +#include "xrEngine/effectorPP.h" +#include "xrEngine/cameramanager.h" ////////////////////////////////////////////////////////////////////////// diff --git a/src/xrGame/profile_data_types.h b/src/xrGame/profile_data_types.h index 5b3c691639c..5fd1c434058 100644 --- a/src/xrGame/profile_data_types.h +++ b/src/xrGame/profile_data_types.h @@ -1,7 +1,7 @@ #ifndef PLAYER_AWARDS #define PLAYER_AWARDS -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" #include "mixed_delegate.h" #include "atlas_stalkercoppc_v1.h" #include "script_export_space.h" diff --git a/src/xrGame/profile_store.h b/src/xrGame/profile_store.h index 0eadc9fe891..0a77c679e56 100644 --- a/src/xrGame/profile_store.h +++ b/src/xrGame/profile_store.h @@ -2,7 +2,7 @@ #define GAMESPY_PROFILE_STORE #include -#include "../xrEngine/ISheduled.h" +#include "xrEngine/ISheduled.h" #include "profile_data_types.h" #include "script_export_space.h" #include "queued_async_method.h" diff --git a/src/xrGame/profiler.cpp b/src/xrGame/profiler.cpp index 728cf4d4758..521a4764270 100644 --- a/src/xrGame/profiler.cpp +++ b/src/xrGame/profiler.cpp @@ -8,7 +8,7 @@ #include "stdafx.h" #include "profiler.h" -#include "../xrEngine/gamefont.h" +#include "xrEngine/gamefont.h" #ifdef PROFILE_CRITICAL_SECTIONS static volatile LONG critical_section_counter = 0; diff --git a/src/xrGame/purchase_list.cpp b/src/xrGame/purchase_list.cpp index c99961526cd..84e6396349b 100644 --- a/src/xrGame/purchase_list.cpp +++ b/src/xrGame/purchase_list.cpp @@ -11,7 +11,7 @@ #include "inventoryowner.h" #include "gameobject.h" #include "ai_object_location.h" -#include "level.h" +#include "Level.h" static float min_deficit_factor = .3f; diff --git a/src/xrGame/restricted_object.cpp b/src/xrGame/restricted_object.cpp index 4d49acaf344..2e3d9d545cb 100644 --- a/src/xrGame/restricted_object.cpp +++ b/src/xrGame/restricted_object.cpp @@ -10,7 +10,7 @@ #include "restricted_object.h" #include "space_restriction_manager.h" #include "xrServer_Objects_ALife_Monsters.h" -#include "level.h" +#include "Level.h" #include "ai_space.h" #include "level_graph.h" #include "space_restriction.h" diff --git a/src/xrGame/reward_manager.cpp b/src/xrGame/reward_manager.cpp index b180d1be913..f5055116d02 100644 --- a/src/xrGame/reward_manager.cpp +++ b/src/xrGame/reward_manager.cpp @@ -4,7 +4,7 @@ #include "UIGameMP.h" #include "reward_snd_messages.h" #include "HUDManager.h" -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" namespace award_system { diff --git a/src/xrGame/rewarding_events_handlers.cpp b/src/xrGame/rewarding_events_handlers.cpp index 5ca60b46672..805349d2533 100644 --- a/src/xrGame/rewarding_events_handlers.cpp +++ b/src/xrGame/rewarding_events_handlers.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "rewarding_events_handlers.h" #include "reward_event_handler.h" -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" namespace award_system { diff --git a/src/xrGame/rewarding_events_handlers.h b/src/xrGame/rewarding_events_handlers.h index 85a76e0ab01..c8108b47eba 100644 --- a/src/xrGame/rewarding_events_handlers.h +++ b/src/xrGame/rewarding_events_handlers.h @@ -3,7 +3,7 @@ #include "event_conditions_collection.h" //for event_action_delegate_t #include "game_cl_base_weapon_usage_statistic.h" -#include "../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" #include "game_events_handler.h" namespace award_system diff --git a/src/xrGame/screenshot_manager.cpp b/src/xrGame/screenshot_manager.cpp index d4f43920022..a3e08cc6929 100644 --- a/src/xrGame/screenshot_manager.cpp +++ b/src/xrGame/screenshot_manager.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "screenshot_manager.h" -#include "level.h" +#include "Level.h" #include "game_cl_mp.h" #include "xrCore/ppmd_compressor.h" #include "screenshots_writer.h" diff --git a/src/xrGame/screenshot_server.cpp b/src/xrGame/screenshot_server.cpp index 3fb5c44632d..e3ddfa1d398 100644 --- a/src/xrGame/screenshot_server.cpp +++ b/src/xrGame/screenshot_server.cpp @@ -5,7 +5,7 @@ #include "xrServer.h" #include "game_sv_base.h" #include "game_cl_mp.h" -#include "../xrCore/fastdelegate.h" +#include "xrCore/fastdelegate.h" extern BOOL g_sv_mp_save_proxy_screenshots; extern BOOL g_sv_mp_save_proxy_configs; diff --git a/src/xrGame/screenshots_common.h b/src/xrGame/screenshots_common.h index fbfcfffde0c..9836c68173a 100644 --- a/src/xrGame/screenshots_common.h +++ b/src/xrGame/screenshots_common.h @@ -1,7 +1,7 @@ #ifndef SCREENSHOTS_COMMON_INCLUDED #define SCREENSHOTS_COMMON_INCLUDED -#include "../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" namespace screenshots { diff --git a/src/xrGame/script_binder.cpp b/src/xrGame/script_binder.cpp index 220e1c456f0..2a51109a555 100644 --- a/src/xrGame/script_binder.cpp +++ b/src/xrGame/script_binder.cpp @@ -14,7 +14,7 @@ #include "script_binder_object.h" #include "script_game_object.h" #include "gameobject.h" -#include "level.h" +#include "Level.h" // comment next string when commiting //#define DBG_DISABLE_SCRIPTS diff --git a/src/xrGame/script_effector.h b/src/xrGame/script_effector.h index 8b888b39156..d2cb379197c 100644 --- a/src/xrGame/script_effector.h +++ b/src/xrGame/script_effector.h @@ -8,9 +8,9 @@ #pragma once -#include "../xrEngine/effectorpp.h" +#include "xrEngine/effectorpp.h" #include "script_export_space.h" -#include "../xrEngine/cameramanager.h" +#include "xrEngine/cameramanager.h" class CScriptEffector : public CEffectorPP { public: diff --git a/src/xrGame/script_entity.cpp b/src/xrGame/script_entity.cpp index df4725165fe..7f031572725 100644 --- a/src/xrGame/script_entity.cpp +++ b/src/xrGame/script_entity.cpp @@ -9,9 +9,9 @@ #include "pch_script.h" #include "script_entity.h" #include "CustomMonster.h" -#include "../xrEngine/feel_vision.h" +#include "xrEngine/feel_vision.h" #include "xrCore/Animation/Motion.hpp" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "script_entity_action.h" #include "weapon.h" #include "ParticlesObject.h" diff --git a/src/xrGame/script_entity.h b/src/xrGame/script_entity.h index 08bbe6643f9..8bbf27db9b6 100644 --- a/src/xrGame/script_entity.h +++ b/src/xrGame/script_entity.h @@ -9,8 +9,8 @@ #pragma once #include "script_entity_space.h" -//#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" +//#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" class CSE_Abstract; class CGameObject; diff --git a/src/xrGame/script_game_object.cpp b/src/xrGame/script_game_object.cpp index 11f36c0de39..11faacf1057 100644 --- a/src/xrGame/script_game_object.cpp +++ b/src/xrGame/script_game_object.cpp @@ -23,7 +23,7 @@ #include "xrmessages.h" #include "inventory.h" #include "script_ini_file.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "HangingLamp.h" #include "patrol_path_manager.h" #include "ai_object_location.h" diff --git a/src/xrGame/script_game_object2.cpp b/src/xrGame/script_game_object2.cpp index de2a611c8fe..1048337ade1 100644 --- a/src/xrGame/script_game_object2.cpp +++ b/src/xrGame/script_game_object2.cpp @@ -15,7 +15,7 @@ #include "script_zone.h" #include "object_handler.h" #include "script_hit.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "pda.h" #include "InfoPortion.h" #include "memory_manager.h" @@ -31,8 +31,8 @@ #include "danger_manager.h" #include "memory_space.h" #include "actor.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrEngine/CameraBase.h" +#include "Include/xrRender/Kinematics.h" +#include "xrEngine/CameraBase.h" #include "ai/stalker/ai_stalker.h" #include "car.h" #include "movement_manager.h" diff --git a/src/xrGame/script_game_object_inventory_owner.cpp b/src/xrGame/script_game_object_inventory_owner.cpp index ad471e8f473..5e667717aed 100644 --- a/src/xrGame/script_game_object_inventory_owner.cpp +++ b/src/xrGame/script_game_object_inventory_owner.cpp @@ -11,7 +11,7 @@ #include "character_info.h" #include "gametask.h" #include "actor.h" -#include "level.h" +#include "Level.h" #include "date_time.h" #include "uigamesp.h" #include "restricted_object.h" diff --git a/src/xrGame/script_game_object_script2.cpp b/src/xrGame/script_game_object_script2.cpp index eacc4a13849..2ec86ee7f6b 100644 --- a/src/xrGame/script_game_object_script2.cpp +++ b/src/xrGame/script_game_object_script2.cpp @@ -21,7 +21,7 @@ #include "script_monster_hit_info.h" #include "script_entity_action.h" #include "action_planner.h" -//#include "../xrphysics/PhysicsShell.h" +//#include "xrPhysics/PhysicsShell.h" #include "helicopter.h" #include "script_zone.h" #include "relation_registry.h" diff --git a/src/xrGame/script_game_object_use.cpp b/src/xrGame/script_game_object_use.cpp index 80d76c820ec..dc076297aa1 100644 --- a/src/xrGame/script_game_object_use.cpp +++ b/src/xrGame/script_game_object_use.cpp @@ -17,7 +17,7 @@ #include "PHCommander.h" #include "PHScriptCall.h" #include "PHSimpleCalls.h" -#include "../xrphysics/iphworld.h" +#include "xrPhysics/iphworld.h" #include "doors_manager.h" void CScriptGameObject::SetTipText (LPCSTR tip_text) diff --git a/src/xrGame/script_lanim.cpp b/src/xrGame/script_lanim.cpp index a4ee1ac4fdb..d62cd9d30ad 100644 --- a/src/xrGame/script_lanim.cpp +++ b/src/xrGame/script_lanim.cpp @@ -8,7 +8,7 @@ #include "pch_script.h" #include "script_lanim.h" -#include "../xrEngine/LightAnimLibrary.h" +#include "xrEngine/LightAnimLibrary.h" using namespace luabind; diff --git a/src/xrGame/script_particles.cpp b/src/xrGame/script_particles.cpp index 724f50a4036..1436a44857b 100644 --- a/src/xrGame/script_particles.cpp +++ b/src/xrGame/script_particles.cpp @@ -8,7 +8,7 @@ #include "stdafx.h" #include "script_particles.h" -#include "../xrEngine/objectanimator.h" +#include "xrEngine/objectanimator.h" CScriptParticlesCustom::CScriptParticlesCustom(CScriptParticles* owner, LPCSTR caParticlesName):CParticlesObject(caParticlesName,FALSE,true) { diff --git a/src/xrGame/script_zone.cpp b/src/xrGame/script_zone.cpp index 6e07a761fea..910e93e821a 100644 --- a/src/xrGame/script_zone.cpp +++ b/src/xrGame/script_zone.cpp @@ -10,12 +10,12 @@ #include "script_zone.h" #include "script_game_object.h" #include "xrserver_objects_alife_monsters.h" -#include "../xrEngine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" #include "script_callback_ex.h" #include "game_object_space.h" #ifdef DEBUG -# include "level.h" +# include "Level.h" # include "debug_renderer.h" #endif diff --git a/src/xrGame/script_zone.h b/src/xrGame/script_zone.h index ed24bb4615c..ea4cecaa7dd 100644 --- a/src/xrGame/script_zone.h +++ b/src/xrGame/script_zone.h @@ -9,7 +9,7 @@ #pragma once #include "space_restrictor.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" #include "script_space_forward.h" #include "script_export_space.h" diff --git a/src/xrGame/searchlight.cpp b/src/xrGame/searchlight.cpp index 8aa469a9397..53b1c988472 100644 --- a/src/xrGame/searchlight.cpp +++ b/src/xrGame/searchlight.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "searchlight.h" -#include "../xrEngine/LightAnimLibrary.h" +#include "xrEngine/LightAnimLibrary.h" #include "script_entity_action.h" #include "xrServer_Objects_ALife.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "game_object_space.h" ////////////////////////////////////////////////////////////////////// diff --git a/src/xrGame/secure_messaging.h b/src/xrGame/secure_messaging.h index 33ea29b5918..9372ddc327b 100644 --- a/src/xrGame/secure_messaging.h +++ b/src/xrGame/secure_messaging.h @@ -2,7 +2,7 @@ #define SECRET_KEY_GENERATOR_INCLUDED #include -#include "../xrCore/_random.h" +#include "xrCore/_random.h" namespace secure_messaging { diff --git a/src/xrGame/smart_cover_action.cpp b/src/xrGame/smart_cover_action.cpp index dadd79828f3..7f765052a5e 100644 --- a/src/xrGame/smart_cover_action.cpp +++ b/src/xrGame/smart_cover_action.cpp @@ -10,7 +10,7 @@ #include "ai_monster_space.h" #include "ai_space.h" #include "level_graph.h" -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" using smart_cover::detail::parse_string; using smart_cover::detail::parse_int; diff --git a/src/xrGame/smart_cover_animation_selector.cpp b/src/xrGame/smart_cover_animation_selector.cpp index a51c7cdd287..600bd6d0838 100644 --- a/src/xrGame/smart_cover_animation_selector.cpp +++ b/src/xrGame/smart_cover_animation_selector.cpp @@ -11,7 +11,7 @@ #include "smart_cover_animation_planner.h" #include "smart_cover_planner_actions.h" #include "script_game_object.h" -#include "../include/xrrender/kinematicsanimated.h" +#include "Include/xrRender/kinematicsanimated.h" #include "stalker_animation_manager.h" #include "smart_cover_planner_actions.h" #include "stalker_movement_manager_smart_cover.h" diff --git a/src/xrGame/smart_cover_animation_selector.h b/src/xrGame/smart_cover_animation_selector.h index 59cbec21fc6..2c4e64e9145 100644 --- a/src/xrGame/smart_cover_animation_selector.h +++ b/src/xrGame/smart_cover_animation_selector.h @@ -10,7 +10,7 @@ #include "smart_cover_detail.h" #include -#include "../include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/KinematicsAnimated.h" #include "smart_cover_animation_planner.h" class CAI_Stalker; diff --git a/src/xrGame/smart_cover_object.cpp b/src/xrGame/smart_cover_object.cpp index 696af8890ce..b8ddd80db04 100644 --- a/src/xrGame/smart_cover_object.cpp +++ b/src/xrGame/smart_cover_object.cpp @@ -8,8 +8,8 @@ #include "pch_script.h" #include "smart_cover_object.h" -#include "../xrServerEntities/xrServer_Objects_ALife_Smartcovers.h" -#include "level.h" +#include "xrServerEntities/xrServer_Objects_ALife_Smartcovers.h" +#include "Level.h" #include "debug_renderer.h" #include "ai_space.h" #include "cover_manager.h" @@ -17,7 +17,7 @@ #include "smart_cover.h" #include "smart_cover_description.h" #include "smart_cover_loophole.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" using smart_cover::object; void object::Load (LPCSTR section) diff --git a/src/xrGame/smart_cover_transition.cpp b/src/xrGame/smart_cover_transition.cpp index 2a52154dfda..b5a41ff1126 100644 --- a/src/xrGame/smart_cover_transition.cpp +++ b/src/xrGame/smart_cover_transition.cpp @@ -11,7 +11,7 @@ #include "smart_cover_detail.h" #include "ai_space.h" #include "script_engine.h" -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" using smart_cover::detail::parse_table; using smart_cover::detail::parse_string; diff --git a/src/xrGame/sound_memory_manager.cpp b/src/xrGame/sound_memory_manager.cpp index 2e90fe017f0..b487925fa56 100644 --- a/src/xrGame/sound_memory_manager.cpp +++ b/src/xrGame/sound_memory_manager.cpp @@ -23,7 +23,7 @@ #include "profiler.h" #include "client_spawn_manager.h" #include "memory_manager.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #ifndef MASTER_GOLD # include "actor.h" diff --git a/src/xrGame/sound_player.cpp b/src/xrGame/sound_player.cpp index 9c4372953d5..57b66a26cad 100644 --- a/src/xrGame/sound_player.cpp +++ b/src/xrGame/sound_player.cpp @@ -11,9 +11,9 @@ #include "script_engine.h" #include "ai/stalker/ai_stalker_space.h" #include "ai_space.h" -#include "../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" #include "xrCore/Animation/Bone.hpp" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "profiler.h" #include "sound_collection_storage.h" #include "object_broker.h" diff --git a/src/xrGame/space_restriction_composition.cpp b/src/xrGame/space_restriction_composition.cpp index 04a3f866982..d7825604706 100644 --- a/src/xrGame/space_restriction_composition.cpp +++ b/src/xrGame/space_restriction_composition.cpp @@ -21,7 +21,7 @@ #pragma warning(pop) #ifdef DEBUG -# include "level.h" +# include "Level.h" # include "space_restrictor.h" #endif // DEBUG diff --git a/src/xrGame/space_restriction_shape.h b/src/xrGame/space_restriction_shape.h index f044c22f62b..a280ed16370 100644 --- a/src/xrGame/space_restriction_shape.h +++ b/src/xrGame/space_restriction_shape.h @@ -9,7 +9,7 @@ #pragma once #include "space_restriction_base.h" -#include "../xrEngine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" class CSpaceRestrictor; diff --git a/src/xrGame/space_restrictor.cpp b/src/xrGame/space_restrictor.cpp index f71bffcaeb8..14e301be85c 100644 --- a/src/xrGame/space_restrictor.cpp +++ b/src/xrGame/space_restrictor.cpp @@ -9,12 +9,12 @@ #include "pch_script.h" #include "space_restrictor.h" #include "xrServer_Objects_ALife.h" -#include "level.h" +#include "Level.h" #include "space_restriction_manager.h" #include "restriction_space.h" #include "ai_space.h" #include "CustomZone.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/xr_collide_form.h" #ifdef DEBUG # include "debug_renderer.h" #endif diff --git a/src/xrGame/spectator_camera_first_eye.cpp b/src/xrGame/spectator_camera_first_eye.cpp index b27049a8eee..44fbaee142f 100644 --- a/src/xrGame/spectator_camera_first_eye.cpp +++ b/src/xrGame/spectator_camera_first_eye.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "spectator_camera_first_eye.h" #include "xr_level_controller.h" -#include "../xrEngine/xr_object.h" +#include "xrEngine/xr_object.h" CSpectrCameraFirstEye::CSpectrCameraFirstEye(float const & fTimeDelta, CObject* p, diff --git a/src/xrGame/spectator_camera_first_eye.h b/src/xrGame/spectator_camera_first_eye.h index 4cfeb87ceea..f878bee9959 100644 --- a/src/xrGame/spectator_camera_first_eye.h +++ b/src/xrGame/spectator_camera_first_eye.h @@ -1,7 +1,7 @@ #ifndef SPECTATOR_CAMERA_FIRST_EYE #define SPECTATOR_CAMERA_FIRST_EYE -#include "../xrcore/ftimer.h" +#include "xrCore/ftimer.h" #include "CameraFirstEye.h" class CSpectrCameraFirstEye : public CCameraFirstEye diff --git a/src/xrGame/sprinter_stopper.cpp b/src/xrGame/sprinter_stopper.cpp index 61c1925fcd3..6e3733f71e4 100644 --- a/src/xrGame/sprinter_stopper.cpp +++ b/src/xrGame/sprinter_stopper.cpp @@ -2,7 +2,7 @@ #include "sprinter_stopper.h" #include "game_state_accumulator.h" #include "game_cl_base.h" -#include "level.h" +#include "Level.h" #include "ammunition_groups.h" #include "actor.h" diff --git a/src/xrGame/stalker_animation_data_storage.cpp b/src/xrGame/stalker_animation_data_storage.cpp index f7e70a20072..b1f2398f3b6 100644 --- a/src/xrGame/stalker_animation_data_storage.cpp +++ b/src/xrGame/stalker_animation_data_storage.cpp @@ -10,7 +10,7 @@ #include "stalker_animation_data_storage.h" #include "stalker_animation_data.h" #include "object_broker.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" CStalkerAnimationDataStorage *g_stalker_animation_data_storage = 0; diff --git a/src/xrGame/stalker_animation_pair.h b/src/xrGame/stalker_animation_pair.h index 05e3bbcf3f3..fcce9701e43 100644 --- a/src/xrGame/stalker_animation_pair.h +++ b/src/xrGame/stalker_animation_pair.h @@ -8,7 +8,7 @@ #pragma once -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ai/ai_monsters_anims.h" class CBlend; diff --git a/src/xrGame/stalker_animation_state.cpp b/src/xrGame/stalker_animation_state.cpp index d79e0bd9cbd..aef846cbd98 100644 --- a/src/xrGame/stalker_animation_state.cpp +++ b/src/xrGame/stalker_animation_state.cpp @@ -9,7 +9,7 @@ #include "stdafx.h" #include "stalker_animation_state.h" #include "object_broker.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" CStalkerAnimationState::CStalkerAnimationState () { diff --git a/src/xrGame/stalker_anomaly_actions.cpp b/src/xrGame/stalker_anomaly_actions.cpp index 4bb588526dd..4a56bc86373 100644 --- a/src/xrGame/stalker_anomaly_actions.cpp +++ b/src/xrGame/stalker_anomaly_actions.cpp @@ -28,7 +28,7 @@ #include "radioactivezone.h" #include "alife_simulator.h" #include "alife_object_registry.h" -#include "../xrServerEntities/xrServer_Objects_ALife_Monsters.h" +#include "xrServerEntities/xrServer_Objects_ALife_Monsters.h" using namespace StalkerSpace; using namespace StalkerDecisionSpace; diff --git a/src/xrGame/stalker_death_actions.cpp b/src/xrGame/stalker_death_actions.cpp index 94d5cb5b6fa..aaa6d0495ef 100644 --- a/src/xrGame/stalker_death_actions.cpp +++ b/src/xrGame/stalker_death_actions.cpp @@ -18,7 +18,7 @@ #include "weapon.h" #include "xr_level_controller.h" #include "clsid_game.h" -#include "characterphysicssupport.h" +#include "CharacterPhysicsSupport.h" #include "weaponmagazined.h" using namespace StalkerDecisionSpace; diff --git a/src/xrGame/stalker_movement_manager_smart_cover.h b/src/xrGame/stalker_movement_manager_smart_cover.h index 5e8dc516891..1e3b8fcecba 100644 --- a/src/xrGame/stalker_movement_manager_smart_cover.h +++ b/src/xrGame/stalker_movement_manager_smart_cover.h @@ -10,7 +10,7 @@ #define STALKER_MOVEMENT_MANAGER_SMART_COVER_H_INCLUDED #include "stalker_movement_manager_obstacles.h" -#include "../include/xrrender/animation_motion.h" +#include "Include/xrRender/animation_motion.h" class CCoverPoint; class CPropertyStorage; diff --git a/src/xrGame/stats_submitter.h b/src/xrGame/stats_submitter.h index d6d27af0040..e765dfc9c20 100644 --- a/src/xrGame/stats_submitter.h +++ b/src/xrGame/stats_submitter.h @@ -5,7 +5,7 @@ #include "gamespy/GameSpy_ATLAS.h" #include "profile_data_types.h" #include "gsc_dsigned_ltx.h" -#include "../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" class CGameSpy_Full; diff --git a/src/xrGame/steering_behaviour.h b/src/xrGame/steering_behaviour.h index 972e82b58a9..fc787e52d47 100644 --- a/src/xrGame/steering_behaviour.h +++ b/src/xrGame/steering_behaviour.h @@ -9,7 +9,7 @@ #ifndef STEERING_BEHAVIOUR_INCLUDED #define STEERING_BEHAVIOUR_INCLUDED -#include "../xrCore/_vector3d_ext.h" +#include "xrCore/_vector3d_ext.h" //---------------------------------------------------------- // Steering Behaviour Namespace diff --git a/src/xrGame/steering_behaviour_manager.h b/src/xrGame/steering_behaviour_manager.h deleted file mode 100644 index cb93260c752..00000000000 --- a/src/xrGame/steering_behaviour_manager.h +++ /dev/null @@ -1,43 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : steering_behaviour_manager.h -// Created : 07.11.2007 -// Modified : 07.11.2007 -// Author : Dmitriy Iassenev -// Description : steering behaviour manager class -//////////////////////////////////////////////////////////////////////////// - -#ifndef STEERING_BEHAVIOUR_MANAGER_H_INCLUDED -#define STEERING_BEHAVIOUR_MANAGER_H_INCLUDED - -#include -#include "smart_cover_detail.h" - -class CAI_Rat; - -// #include "../../../steering_behaviour_manager.h" -// #include "../../../steering_behaviour_cohesion.h" -// #include "../../../steering_behaviour_alignment.h" -// #include "../../../steering_behaviour_separation.h" private boost::noncopyable, - private debug::make_final, - private boost::noncopyable -{ -public: - manager (CAI_Rat const *object); - ~manager (); - void add (base *behaviour, float const &factor); - void remove (base *behaviour); - Fvector new_position (float const &time_delta); - -private: - void clear (); - -private: - typedef xr_map Behaviours; - -private: - Behaviours m_behaviours; -}; - -} // namespace steering_behaviour - -#endif // STEERING_BEHAVIOUR_MANAGER_H_INCLUDED \ No newline at end of file diff --git a/src/xrGame/step_manager.cpp b/src/xrGame/step_manager.cpp index 94f4caff092..eb39cc155cd 100644 --- a/src/xrGame/step_manager.cpp +++ b/src/xrGame/step_manager.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "step_manager.h" #include "entity_alive.h" -#include "../Include/xrRender/Kinematics.h" -#include "level.h" +#include "Include/xrRender/Kinematics.h" +#include "Level.h" #include "gamepersistent.h" #include "material_manager.h" #include "profiler.h" diff --git a/src/xrGame/step_manager_defs.h b/src/xrGame/step_manager_defs.h index 02c96a2485c..719344a1e00 100644 --- a/src/xrGame/step_manager_defs.h +++ b/src/xrGame/step_manager_defs.h @@ -5,7 +5,7 @@ #define MIN_LEGS_COUNT 1 #define MAX_LEGS_COUNT 4 -#include "../include/xrRender/animation_motion.h" +#include "Include/xrRender/animation_motion.h" struct SStepParam { struct{ diff --git a/src/xrGame/team_base_zone.cpp b/src/xrGame/team_base_zone.cpp index 52e66dd4af0..d958733b9f4 100644 --- a/src/xrGame/team_base_zone.cpp +++ b/src/xrGame/team_base_zone.cpp @@ -11,13 +11,13 @@ #include "xrserver_objects_alife_monsters.h" #include "hit.h" #include "Actor.h" -#include "level.h" +#include "Level.h" #include "xrserver.h" #include "game_cl_base.h" #include "map_manager.h" #include "map_location.h" -#include "../xrEngine/IGame_Persistent.h" -#include "../xrengine/xr_collide_form.h" +#include "xrEngine/IGame_Persistent.h" +#include "xrEngine/xr_collide_form.h" #ifdef DEBUG # include "debug_renderer.h" #endif diff --git a/src/xrGame/team_base_zone.h b/src/xrGame/team_base_zone.h index f7e54583e3d..1e2d06bb6d5 100644 --- a/src/xrGame/team_base_zone.h +++ b/src/xrGame/team_base_zone.h @@ -9,7 +9,7 @@ #pragma once #include "GameObject.h" -#include "../xrEngine/feel_touch.h" +#include "xrEngine/feel_touch.h" class CTeamBaseZone : public CGameObject, public Feel::Touch { protected: diff --git a/src/xrGame/trade.cpp b/src/xrGame/trade.cpp index af234199038..4477cd0759d 100644 --- a/src/xrGame/trade.cpp +++ b/src/xrGame/trade.cpp @@ -8,7 +8,7 @@ #include "xrmessages.h" #include "character_info.h" #include "relation_registry.h" -#include "level.h" +#include "Level.h" #include "script_callback_ex.h" #include "script_game_object.h" #include "game_object_space.h" diff --git a/src/xrGame/trade2.cpp b/src/xrGame/trade2.cpp index 26426d39397..fff418996fa 100644 --- a/src/xrGame/trade2.cpp +++ b/src/xrGame/trade2.cpp @@ -8,7 +8,7 @@ #include "xrmessages.h" #include "character_info.h" #include "relation_registry.h" -#include "level.h" +#include "Level.h" #include "script_callback_ex.h" #include "script_game_object.h" #include "game_object_space.h" diff --git a/src/xrGame/traffic_optimization.h b/src/xrGame/traffic_optimization.h index 7e9036dbd08..df78ebb39bf 100644 --- a/src/xrGame/traffic_optimization.h +++ b/src/xrGame/traffic_optimization.h @@ -1,8 +1,8 @@ #ifndef TRAFFIC_OPTIMIZATION_INCLUDED #define TRAFFIC_OPTIMIZATION_INCLUDED -#include "../xrCore/compression_ppmd_stream.h" -#include "../xrCore/lzo_compressor.h" +#include "xrCore/compression_ppmd_stream.h" +#include "xrCore/lzo_compressor.h" namespace compression { diff --git a/src/xrGame/trajectories.cpp b/src/xrGame/trajectories.cpp index 5f6d8ebf9d9..0664a214539 100644 --- a/src/xrGame/trajectories.cpp +++ b/src/xrGame/trajectories.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "trajectories.h" #include "Level.h" -#include "../xrPhysics/IPHWorld.h" -#include "../xrGame/ai_debug_variables.h" +#include "xrPhysics/IPHWorld.h" +#include "xrGame/ai_debug_variables.h" -#include "../xrCore/_vector3d_ext.h" +#include "xrCore/_vector3d_ext.h" static void trajectory_get_position (Fvector &result, const Fvector &start_position, const Fvector &velocity, const Fvector &gravity, const float &time) diff --git a/src/xrGame/tri-colliderknoopc/TriPrimitiveCollideClassDef.h b/src/xrGame/tri-colliderknoopc/TriPrimitiveCollideClassDef.h deleted file mode 100644 index 63417d94d49..00000000000 --- a/src/xrGame/tri-colliderknoopc/TriPrimitiveCollideClassDef.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef TRI_PRIMITIVE_COLIDE_CLASS_DEF -#define TRI_PRIMITIVE_COLIDE_CLASS_DEF - -#define TRI_PRIMITIVE_COLIDE_CLASS_DECLARE(primitive) \ -class primitive##Tri\ -{\ - dcTriListCollider &m_tri_list ;\ - primitive##Tri& operator = (primitive##Tri& nx_nado) {;} \ -public:\ - explicit primitive##Tri (dcTriListCollider &tri_list):m_tri_list(tri_list) {};\ - IC float Proj (dxGeom* o,const dReal* normal);\ - IC int Collide(\ - const dReal* v0,const dReal* v1,const dReal* v2,\ - Triangle* T,\ - dxGeom *o1,dxGeom *o2,\ - int flags, dContactGeom *contact, int skip\ - );\ - IC int CollidePlain(\ - const dReal* triSideAx0,const dReal* triSideAx1,\ - const dReal* triAx,\ - CDB::TRI* T,\ - dReal dist,\ - dxGeom *o1, dxGeom *o2,\ - int flags, dContactGeom *contact, int skip\ - );\ -\ -}; - - -#define TRI_PRIMITIVE_COLIDE_CLASS_IMPLEMENT(primitive) \ - IC float dcTriListCollider::primitive##Tri:: Proj (dxGeom* o,const dReal* normal){return m_tri_list.d##primitive##Proj(o,normal);}\ - IC int dcTriListCollider::primitive##Tri:: Collide(\ - const dReal* v0,const dReal* v1,const dReal* v2,\ - Triangle* T,\ - dxGeom *o1,dxGeom *o2,\ - int flags, dContactGeom *contact, int skip\ - ){\ - return m_tri_list.dTri##primitive(v0,v1,v2,T,o1,o2,flags,contact,skip);\ - }\ - IC int dcTriListCollider::primitive##Tri::CollidePlain(\ - const dReal* triSideAx0,const dReal* triSideAx1,\ - const dReal* triAx,\ - CDB::TRI* T,\ - dReal dist,\ - dxGeom *o1, dxGeom *o2,\ - int flags, dContactGeom *contact, int skip\ - )\ - {\ - return m_tri_list.dSortedTri##primitive(triSideAx0,triSideAx1,triAx,T,dist,o1,o2,flags,contact,skip);\ - } -#endif \ No newline at end of file diff --git a/src/xrGame/tri-colliderknoopc/__aabb_tri.h b/src/xrGame/tri-colliderknoopc/__aabb_tri.h deleted file mode 100644 index 421b700cdc7..00000000000 --- a/src/xrGame/tri-colliderknoopc/__aabb_tri.h +++ /dev/null @@ -1,329 +0,0 @@ -#pragma once - - class Point - { - public: - - //! Empty constructor - IC Point() {} - //! Constructor from floats - IC Point(float _x, float _y, float _z) : x(_x), y(_y), z(_z) {} - //! Constructor from array - IC Point(float f[3]) : x(f[0]), y(f[1]), z(f[2]) {} - //! Constructor from array - IC Point(const float f[3]) : x(f[0]), y(f[1]), z(f[2]) {} - //! Copy constructor - IC Point(const Point& p) : x(p.x), y(p.y), z(p.z) {} - //! Destructor - IC ~Point() {} - - //! Returns MIN(x, y, z); - //IC float Min() const { return MIN(x, MIN(y, z)); } - //! Returns MAX(x, y, z); - //IC float Max() const { return MAX(x, MAX(y, z)); } - //! TO BE DOCUMENTED - //IC Point& Min(const Point& p) { x = MIN(x, p.x); y = MIN(y, p.y); z = MIN(z, p.z); return *this; } - //! TO BE DOCUMENTED - //IC Point& Max(const Point& p) { x = MAX(x, p.x); y = MAX(y, p.y); z = MAX(z, p.z); return *this; } - - //! Computes square magnitude - IC float SquareMagnitude() const { return x*x + y*y + z*z; } - //! Computes magnitude - IC float Magnitude() const { return _sqrt(x*x + y*y + z*z); } - - //! Return largest axis - IC u32 LargestAxis() const - { - const float* Vals = &x; - u32 m = 0; - if(Vals[1] > Vals[m]) m = 1; - if(Vals[2] > Vals[m]) m = 2; - return m; - } - - // Arithmetic operators - //! Operator for Point Negate = - Point - ICF Point operator-() const { return Point(-x, -y, -z); } - - //! Operator for Point Plus = Point + Point. - ICF Point operator+(const Point& p) const { return Point(x + p.x, y + p.y, z + p.z); } - //! Operator for Point Minus = Point - Point. - ICF Point operator-(const Point& p) const { return Point(x - p.x, y - p.y, z - p.z); } - //! Operator for Point Scale = Point * float. - ICF Point operator*(float s) const { return Point(x * s, y * s, z * s ); } - //! Operator for Point Scale = float * Point. - friend Point operator*(float s, const Point& p) { return Point(s * p.x, s * p.y, s * p.z); } - //! Operator for Point Scale = Point / float. - ICF Point operator/(float s) const { s = 1.0f / s; return Point(x * s, y * s, z * s); } - - //! Operator for float DotProd = Point | Point. - ICF float operator|(const Point& p) const { return x*p.x + y*p.y + z*p.z; } - //! Operator for Point VecProd = Point ^ Point. - ICF Point operator^(const Point& p) const - { - return Point( - y * p.z - z * p.y, - z * p.x - x * p.z, - x * p.y - y * p.x ); - } - - //! Operator for Point += Point. - ICF Point& operator+=(const Point& p) { x += p.x; y += p.y; z += p.z; return *this; } - //! Operator for Point += float. - ICF Point& operator+=(float s) { x += s; y += s; z += s; return *this; } - - //! Operator for Point -= Point. - ICF Point& operator-=(const Point& p) { x -= p.x; y -= p.y; z -= p.z; return *this; } - //! Operator for Point -= float. - ICF Point& operator-=(float s) { x -= s; y -= s; z -= s; return *this; } - //! Operator for Point *= float. - ICF Point& operator*=(float s) { x *= s; y *= s; z *= s; return *this; } - //! Operator for Point /= float. - ICF Point& operator/=(float s) { s = 1.0f/s; x *= s; y *= s; z *= s; return *this; } - - // Arithmetic operators - //! Operator for Point Mul = Point * Matrix3x3. - // Point operator*(const Matrix3x3& mat) const; - //! Operator for Point Mul = Point * Matrix4x4. - // Point operator*(const Matrix4x4& mat) const; - //! Operator for Point *= Matrix3x3. - /// Point& operator*=(const Matrix3x3& mat); - //! Operator for Point *= Matrix4x4. - // Point& operator*=(const Matrix4x4& mat); - - //! Access as array - ICF operator const float*() const { return &x; } - //! Access as array - ICF operator float*() { return &x; } - - public: - float x; //!< x coordinate - float y; //!< y coordinate - float z; //!< z coordinate - }; -//using namespace CDB; -using namespace Opcode; -//typedef float* Point; -//typedef dVector3 Point -//! This macro quickly finds the min & max values among 3 variables -#define FINDMINMAX(x0, x1, x2, min, max) \ - min = max = x0; \ - if(x1max) max=x1; \ - if(x2max) max=x2; - -#define EXITMINMAX(x0, x1, x2, min, max) \ - if(x0max&&x1>max&&x2>max)return false; - -//! TO BE DOCUMENTED -ICF bool planeBoxOverlap_slow(const Point& normal, const float d, const Point& maxbox) -{ - Point vmin, vmax; - if(normal[0]>0.0f) { vmin[0] =-maxbox[0]; vmax[0]= maxbox[0]; } - else { vmin[0] = maxbox[0]; vmax[0]=-maxbox[0]; } - if(normal[1]>0.0f) { vmin[1] =-maxbox[1]; vmax[1]= maxbox[1]; } - else { vmin[1] = maxbox[1]; vmax[1]=-maxbox[1]; } - if(normal[2]>0.0f) { vmin[2] =-maxbox[2]; vmax[2]= maxbox[2]; } - else { vmin[2] = maxbox[2]; vmax[2]=-maxbox[2]; } - if((normal|vmin)+d >= 0.0f) return false; - if((normal|vmax)+d > 0.0f) return true; - return false ; -} - -ICF bool planeBoxOverlap(const Point& normal, const float d, const Point& maxbox) -{ - float norm_box_proj=_abs(maxbox.x*normal.x)+_abs(maxbox.y*normal.y)+_abs(maxbox.z*normal.z); - if(d>-norm_box_proj&&dmax) {const float tmp=max; max=min; min=tmp; } \ - rad = fa * extents.y + fb * extents.z; \ - if(min>rad || max<-rad) return false; - -//! TO BE DOCUMENTED -#define AXISTEST_X2(a, b, fa, fb) \ - min = a*v0.y - b*v0.z; \ - max = a*v1.y - b*v1.z; \ - if(min>max) {const float tmp=max; max=min; min=tmp; } \ - rad = fa * extents.y + fb * extents.z; \ - if(min>rad || max<-rad) return false; - -//! TO BE DOCUMENTED -#define AXISTEST_Y02(a, b, fa, fb) \ - min = b*v0.z - a*v0.x; \ - max = b*v2.z - a*v2.x; \ - if(min>max) {const float tmp=max; max=min; min=tmp; } \ - rad = fa * extents.x + fb * extents.z; \ - if(min>rad || max<-rad) return false; - -//! TO BE DOCUMENTED -#define AXISTEST_Y1(a, b, fa, fb) \ - min = b*v0.z - a*v0.x; \ - max = b*v1.z - a*v1.x; \ - if(min>max) {const float tmp=max; max=min; min=tmp; } \ - rad = fa * extents.x + fb * extents.z; \ - if(min>rad || max<-rad) return false; - -//! TO BE DOCUMENTED -#define AXISTEST_Z12(a, b, fa, fb) \ - min = a*v1.x - b*v1.y; \ - max = a*v2.x - b*v2.y; \ - if(min>max) {const float tmp=max; max=min; min=tmp; } \ - rad = fa * extents.x + fb * extents.y; \ - if(min>rad || max<-rad) return false; - -//! TO BE DOCUMENTED -#define AXISTEST_Z0(a, b, fa, fb) \ - min = a*v0.x - b*v0.y; \ - max = a*v1.x - b*v1.y; \ - if(min>max) {const float tmp=max; max=min; min=tmp; } \ - rad = fa * extents.x + fb * extents.y; \ - if(min>rad || max<-rad) return false; - - - -IC bool aabb_tri_aabb(Point center,Point extents,const Point* mLeafVerts) -{ - Point v0, v1, v2; - //Fvector v0,v1,v2; - v0.x = mLeafVerts[0].x - center.x; - v1.x = mLeafVerts[1].x - center.x; - v2.x = mLeafVerts[2].x - center.x; - - // First, test overlap in the {x,y,z}-directions - //float min,max; - // Find min, max of the triangle in x-direction, and test for overlap in X - //FINDMINMAX(v0.x, v1.x, v2.x, min, max); - //if(min>extents.x || max<-extents.x) return false; - EXITMINMAX(v0.x, v1.x, v2.x,-extents.x,extents.x) - // Same for Y - v0.y = mLeafVerts[0].y - center.y; - v1.y = mLeafVerts[1].y - center.y; - v2.y = mLeafVerts[2].y - center.y; - - //FINDMINMAX(v0.y, v1.y, v2.y, min, max); - //if(min>extents.y || max<-extents.y) return false; - EXITMINMAX(v0.y, v1.y, v2.y,-extents.y,extents.y) - // Same for Z - v0.z = mLeafVerts[0].z - center.z; - v1.z = mLeafVerts[1].z - center.z; - v2.z = mLeafVerts[2].z - center.z; - - //FINDMINMAX(v0.z, v1.z, v2.z, min, max); - //if(min>extents.z || max<-extents.z) return false; - EXITMINMAX(v0.z, v1.z, v2.z,-extents.z,extents.z) - // 2) Test if the box intersects the plane of the triangle - // compute plane equation of triangle: normal*x+d=0 - // ### could be precomputed since we use the same leaf triangle several times - const Point e0 = v1 - v0; - const Point e1 = v2 - v1; - const Point normal = e0 ^ e1; - const float d = -normal|v0; - bool r0 = planeBoxOverlap(normal, d, extents); - -#ifdef DEBUG - if (r0 != planeBoxOverlap_slow(normal, d, extents)) - { - Msg("planeBoxOverlap != planeBoxOverlap_slow"); - Msg("normal %f,%f,%f", normal.x,normal.y,normal.z); - Msg("dist %f",d); - Msg("extents %f,%f,%f", extents.x,extents.y,extents.z); - } -#endif - if(!r0) return false; - return true; -} -IC bool __aabb_tri (Point center,Point extents,const Point* mLeafVerts) - { - // move everything so that the boxcenter is in (0,0,0) - Point v0, v1, v2; - //Fvector v0,v1,v2; - v0.x = mLeafVerts[0].x - center.x; - v1.x = mLeafVerts[1].x - center.x; - v2.x = mLeafVerts[2].x - center.x; - - // First, test overlap in the {x,y,z}-directions - float min,max; - // Find min, max of the triangle in x-direction, and test for overlap in X - FINDMINMAX(v0.x, v1.x, v2.x, min, max); - if(min>extents.x || max<-extents.x) return false; - - // Same for Y - v0.y = mLeafVerts[0].y - center.y; - v1.y = mLeafVerts[1].y - center.y; - v2.y = mLeafVerts[2].y - center.y; - - FINDMINMAX(v0.y, v1.y, v2.y, min, max); - if(min>extents.y || max<-extents.y) return false; - - // Same for Z - v0.z = mLeafVerts[0].z - center.z; - v1.z = mLeafVerts[1].z - center.z; - v2.z = mLeafVerts[2].z - center.z; - - FINDMINMAX(v0.z, v1.z, v2.z, min, max); - if(min>extents.z || max<-extents.z) return false; - - // 2) Test if the box intersects the plane of the triangle - // compute plane equation of triangle: normal*x+d=0 - // ### could be precomputed since we use the same leaf triangle several times - const Point e0 = v1 - v0; - const Point e1 = v2 - v1; - const Point normal = e0 ^ e1; - const float d = -normal|v0; - bool r0 = planeBoxOverlap(normal, d, extents); -#ifdef DEBUG - if (r0 != planeBoxOverlap_slow(normal, d, extents)) - { - Msg("planeBoxOverlap != planeBoxOverlap_slow"); - Msg("normal %f,%f,%f", normal.x,normal.y,normal.z); - Msg("dist %f",d); - Msg("extents %f,%f,%f", extents.x,extents.y,extents.z); - } -#endif - if (!r0) return false; - - // 3) "Class III" tests - //if(bClass3) - { - float rad; - float min, max; - // compute triangle edges - // - edges lazy evaluated to take advantage of early exits - // - fabs precomputed (half less work, possible since extents are always >0) - // - customized macros to take advantage of the null component - // - axis vector3 discarded, possibly saves useless movs - - const float fey0 = _abs(e0.y); - const float fez0 = _abs(e0.z); - AXISTEST_X01(e0.z, e0.y, fez0, fey0); - const float fex0 = _abs(e0.x); - AXISTEST_Y02(e0.z, e0.x, fez0, fex0); - AXISTEST_Z12(e0.y, e0.x, fey0, fex0); - - const float fey1 = _abs(e1.y); - const float fez1 = _abs(e1.z); - AXISTEST_X01(e1.z, e1.y, fez1, fey1); - const float fex1 = _abs(e1.x); - AXISTEST_Y02(e1.z, e1.x, fez1, fex1); - AXISTEST_Z0(e1.y, e1.x, fey1, fex1); - - const Point e2 = mLeafVerts[0] - mLeafVerts[2]; - const float fey2 = _abs(e2.y); - const float fez2 = _abs(e2.z); - AXISTEST_X2(e2.z, e2.y, fez2, fey2); - const float fex2 = _abs(e2.x); - AXISTEST_Y1(e2.z, e2.x, fez2, fex2); - AXISTEST_Z12(e2.y, e2.x, fey2, fex2); - } - return true; - } - - diff --git a/src/xrGame/tri-colliderknoopc/dSortTriPrimitive.cpp b/src/xrGame/tri-colliderknoopc/dSortTriPrimitive.cpp deleted file mode 100644 index c4364afc9b1..00000000000 --- a/src/xrGame/tri-colliderknoopc/dSortTriPrimitive.cpp +++ /dev/null @@ -1,2 +0,0 @@ -#include "stdafx.h" -//#include "dSortTriPrimitive.h" diff --git a/src/xrGame/tri-colliderknoopc/dSortTriPrimitive.h b/src/xrGame/tri-colliderknoopc/dSortTriPrimitive.h deleted file mode 100644 index 6c41477f9e8..00000000000 --- a/src/xrGame/tri-colliderknoopc/dSortTriPrimitive.h +++ /dev/null @@ -1,348 +0,0 @@ -#ifndef D_SORT_TRI_PRIMITIVE_H -#define D_SORT_TRI_PRIMITIVE_H -#include "dTriCollideK.h" -#include "dTriColliderCommon.h" -#include "dTriColliderMath.h" -#include "__aabb_tri.h" -#include "../MathUtils.h" -#ifdef DEBUG -#include "../PHDebug.h" -#endif - - -template -IC int dcTriListCollider::dSortTriPrimitiveCollide ( - T primitive, - dxGeom *o1, dxGeom *o2, - int flags, dContactGeom *contact, int skip, - const Fvector& AABB - ) -{ - dxGeomUserData* data=dGeomGetUserData(o1); - dReal* last_pos=data->last_pos; - bool no_last_pos =last_pos[0]==-dInfinity; - const dReal* p=dGeomGetPosition(o1); - - Fbox last_box;last_box.setb(data->last_aabb_pos,data->last_aabb_size); - Fbox box;box.setb(cast_fv(p),AABB); - - - CDB::TRI* T_array = Level().ObjectSpace.GetStaticTris(); - const Fvector* V_array = Level().ObjectSpace.GetStaticVerts(); - if(no_last_pos||!last_box.contains(box)) - { - - Fvector aabb;aabb.set(AABB); - aabb.mul(ph_tri_query_ex_aabb_rate); - /////////////////////////////////////////////////////////////////////////////////////////////// - XRC.box_options (0); - XRC.box_query (Level().ObjectSpace.GetStaticModel(),cast_fv(p),aabb); - - CDB::RESULT* R_begin = XRC.r_begin() ; - CDB::RESULT* R_end = XRC.r_end() ; -#ifdef DEBUG - - dbg_total_saved_tries-=data->cashed_tries.size(); - dbg_new_queries_per_step++; -#endif - data->cashed_tries .clear() ; - for (CDB::RESULT* Res=R_begin; Res!=R_end; ++Res) - { - data->cashed_tries.push_back(Res->id); - } -#ifdef DEBUG - dbg_total_saved_tries+=data->cashed_tries.size(); -#endif - data->last_aabb_pos.set(cast_fv(p)); - data->last_aabb_size.set(aabb); - } -#ifdef DEBUG - else - dbg_reused_queries_per_step++; -#endif -/////////////////////////////////////////////////////////////////////////////////////////////// - int ret = 0; - - pos_tries.clear (); - dReal neg_depth=dInfinity,b_neg_depth=dInfinity; - UINT b_count =0 ; - bool intersect = false ; - -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawTriTestAABB)) - DBG_DrawAABB(cast_fv(p),AABB,D3DCOLOR_XRGB(0,0,255)); -#endif - - - bool* pushing_neg=&data->pushing_neg; - bool* pushing_b_neg=&data->pushing_b_neg; - bool spushing_neg=*pushing_neg; - bool spushing_b_neg=*pushing_b_neg; - Triangle neg_tri;//=&(data->neg_tri); - Triangle b_neg_tri;//=&(data->b_neg_tri); - if(*pushing_neg){ - CalculateTri(data->neg_tri,p,neg_tri,V_array); - if(neg_tri.dist<0.f) - { - dReal sidePr=primitive.Proj(o1,neg_tri.norm); - neg_tri.depth=sidePr-neg_tri.dist; - neg_depth=neg_tri.depth; - } - else - { - *pushing_neg=false; - } - -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawSavedTries)) - DBG_DrawTri(neg_tri.T,V_array,D3DCOLOR_XRGB(255,0,0)); -#endif - - } - - if(*pushing_b_neg){ - CalculateTri(data->b_neg_tri,p,b_neg_tri,V_array); - if(b_neg_tri.dist<0.f) - { - dReal sidePr=primitive.Proj(o1,b_neg_tri.norm); - b_neg_tri.depth=sidePr-b_neg_tri.dist; - b_neg_depth=b_neg_tri.depth; - } - else - { - *pushing_b_neg=false; - } - -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawSavedTries)) - DBG_DrawTri(b_neg_tri.T,V_array,D3DCOLOR_XRGB(0,0,255)); -#endif - - } - - bool b_pushing=*pushing_neg||*pushing_b_neg; - gl_cl_tries_state.resize(data->cashed_tries.size(),Flags8().assign(0)); - B=data->cashed_tries.begin(),E=data->cashed_tries.end(); - for (I=B; I!=E; ++I) - { -#ifdef DEBUG - dbg_saved_tries_for_active_objects++; -#endif - //if(ignored_tries[I-B])continue; - CDB::TRI* T = T_array + *I; - const Point vertices[3]={Point((dReal*)&V_array[T->verts[0]]),Point((dReal*)&V_array[T->verts[1]]),Point((dReal*)&V_array[T->verts[2]])}; - if(!aabb_tri_aabb(Point(p),Point((float*)&AABB),vertices)) - continue; -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDBgDrawIntersectedTries)) - DBG_DrawTri(T,V_array,D3DCOLOR_XRGB(0,255,0)); - dbg_tries_num++; -#endif - Triangle tri; - CalculateTri(T,p,tri,vertices); - if(tri.dist<0.f){ -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDBgDrawNegativeTries)) - DBG_DrawTri(T,V_array,D3DCOLOR_XRGB(0,0,255)); -#endif - float last_pos_dist=dDOT(last_pos,tri.norm)-tri.pos; - if((!(last_pos_dist<0.f))||b_pushing) - if(__aabb_tri(Point(p),Point((float*)&AABB),vertices)) - { -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDBgDrawTriesChangesSign)) - DBG_DrawTri(T,V_array,D3DCOLOR_XRGB(0,255,0)); -#endif - bool contain_pos=TriContainPoint( - vertices[0], - vertices[1], - vertices[2], - tri.norm,tri.side0, - tri.side1,p); - if(!b_pushing) - { - if(!no_last_pos) - { -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawTriTrace)) - DBG_DrawLine(cast_fv(last_pos),cast_fv(p),D3DCOLOR_XRGB(255,0,255)); -#endif - dVector3 tri_point; - PlanePoint(tri,last_pos,p,last_pos_dist,tri_point); -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDbgDrawTriPoint)) - DBG_DrawPoint(cast_fv(tri_point),0.01f,D3DCOLOR_XRGB(255,0,255)); -#endif - intersect=intersect||TriContainPoint( - vertices[0], - vertices[1], - vertices[2], - tri.norm,tri.side0, - tri.side1,tri_point); - } - else - { - if(contain_pos&&primitive.Proj(o1,tri.norm)>-tri.dist) - intersect=true; - } - } - else - { - intersect=true; - } - - if( - contain_pos - ){ - dReal sidePr=primitive.Proj(o1,tri.norm); - tri.depth=sidePr-tri.dist; - if(neg_depth>tri.depth&&(!(*pushing_neg||spushing_neg)||dDOT(neg_tri.norm,tri.norm)>-M_SQRT1_2)&&(!(*pushing_b_neg||spushing_b_neg)||dDOT(b_neg_tri.norm,tri.norm)>-M_SQRT1_2))//exclude switching on opposite side &&(!*pushing_b_neg||dDOT(b_neg_tri->norm,tri.norm)>-M_SQRT1_2) - { - neg_depth=tri.depth; - neg_tri=tri; - data->neg_tri=tri.T; - //ret=0; - //if(intersect)*pushing_neg=true; - } - - - } - else{ - ++b_count; - dReal sidePr=primitive.Proj(o1,tri.norm); - tri.depth=sidePr-tri.dist; - if(b_neg_depth>tri.depth&&(!(*pushing_b_neg||spushing_b_neg)||dDOT(b_neg_tri.norm,tri.norm)>-M_SQRT1_2)&&((!*pushing_neg||!spushing_neg)||dDOT(neg_tri.norm,tri.norm)>-M_SQRT1_2)){//exclude switching on opposite side &&(!*pushing_neg||dDOT(neg_tri->norm,tri.norm)>-M_SQRT1_2) - b_neg_depth=tri.depth; - b_neg_tri=tri; - data->b_neg_tri=tri.T; - //ret=0; - //if(intersect)*pushing_b_neg=true; - } - } - } - } - else{ -#ifdef DEBUG - if(ph_dbg_draw_mask.test(phDBgDrawPositiveTries)) - DBG_DrawTri(T,V_array,D3DCOLOR_XRGB(255,0,0)); -#endif - if(ret>flags-10) - continue; - if(!b_pushing&&(!intersect||no_last_pos)) - ret+=primitive.Collide( - vertices[0], - vertices[1], - vertices[2], - &tri, - o1, - o2, - 3, - CONTACT(contact, ret * skip), skip); - if(no_last_pos) - pos_tries.push_back(tri); - } - } - - //if(intersect) ret=0; - xr_vector::iterator i; - - if(intersect) - { - - if(neg_depthT->verts[0]], - (dReal*)&V_array[i->T->verts[1]], - (dReal*)&V_array[i->T->verts[2]], - i->norm,i->side0, - i->side1,p)) - if( - !((dDOT(neg_tri.norm,(dReal*)&V_array[i->T->verts[0]])-neg_tri.pos)>0.f)|| - !((dDOT(neg_tri.norm,(dReal*)&V_array[i->T->verts[1]])-neg_tri.pos)>0.f)|| - !((dDOT(neg_tri.norm,(dReal*)&V_array[i->T->verts[2]])-neg_tri.pos)>0.f) - ){ - include=false; - break; - } - }; - - if(include){ - VERIFY(neg_tri.T&&neg_tri.dist!=-dInfinity); - int bret=primitive.CollidePlain( - neg_tri.side0,neg_tri.side1,neg_tri.norm, - neg_tri.T, - neg_tri.dist, - o1,o2,flags, - CONTACT(contact, 0), - skip); - *pushing_neg=!!bret; - if(*pushing_neg)ret=bret; - } - - } - - - //for(i=pos_tries.begin();pos_tries.end() != i;++i){ - // CDB::TRI* T=i->T; - // ret+=dTriPrimitive( - // (const dReal*)&V_array[T->verts[0]], - // (const dReal*)&V_array[T->verts[1]], - // (const dReal*)&V_array[T->verts[2]], - // T, - // o1, - // o2, - // 3, - // CONTACT(contact, ret * skip), skip); - - //} - - - - if(b_neg_depthT->verts[0]])-b_neg_tri.pos)>0.f)|| - !((dDOT(b_neg_tri.norm,(dReal*)&V_array[i->T->verts[1]])-b_neg_tri.pos)>0.f)|| - !((dDOT(b_neg_tri.norm,(dReal*)&V_array[i->T->verts[2]])-b_neg_tri.pos)>0.f) - - ){ - include=false; - break; - } - }; - - if(include) - { - VERIFY(b_neg_tri.T); - int bret = 0; - if(ret= (int)sizeof(dContactGeom)); - VERIFY (dGeomGetClass(o1) == dBoxClass); - - - - const dReal *R = dGeomGetRotation(o1); - const dReal* p=dGeomGetPosition(o1); - dVector3 hside; - dGeomBoxGetLengths(o1,hside); - hside[0]/=2.f;hside[1]/=2.f;hside[2]/=2.f; - // find number of contacts requested - int maxc = flags & NUMC_MASK; - if (maxc < 1) maxc = 1; - if (maxc > 3) maxc = 3; // no more than 3 contacts per box allowed - - int code=0; - dReal outDepth; - char signum;//,sn; - - - dReal sidePr= - dFabs(dDOT14(triAx,R+0)*hside[0])+ - dFabs(dDOT14(triAx,R+1)*hside[1])+ - dFabs(dDOT14(triAx,R+2)*hside[2]); - - -dReal depth=sidePr-dist;//dFabs(dist); -outDepth=depth; -signum=-1;//dist<0.f ? -1 : 1; -code=0; - -if(depth<0.f) return 0; - -unsigned int i; - -dVector3 norm,pos; -unsigned int ret=1; - -if(code==0){ - norm[0]=triAx[0]*signum; - norm[1]=triAx[1]*signum; - norm[2]=triAx[2]*signum; - -/////////////////////////////////////////// from geom.cpp dCollideBP - dReal Q1 = -signum*dDOT14(triAx,R+0); - dReal Q2 = -signum*dDOT14(triAx,R+1); - dReal Q3 = -signum*dDOT14(triAx,R+2); - dReal A1 = 2.f*hside[0] * Q1; - dReal A2 = 2.f*hside[1] * Q2; - dReal A3 = 2.f*hside[2] * Q3; - dReal B1 = dFabs(A1); - dReal B2 = dFabs(A2); - dReal B3 = dFabs(A3); - - pos[0]=p[0]; - pos[1]=p[1]; - pos[2]=p[2]; - -#define FOO(i,op) \ - pos[0] op hside[i] * R[0+i]; \ - pos[1] op hside[i] * R[4+i]; \ - pos[2] op hside[i] * R[8+i]; -#define BAR(i,iinc) if (A ## iinc > 0) { FOO(i,-=) } else { FOO(i,+=) } - BAR(0,1); - BAR(1,2); - BAR(2,3); -#undef FOO -#undef BAR - -/////////////////////////////////////////////////////////// - - -if (maxc == 1) goto done; - - // get the second and third contact points by starting from `p' and going - // along the two sides with the smallest projected length. - -//(@slipch) it is not perfectly right for triangle collision -//because it need to check if additional points are in the triangle but it seems cause no problem - -#define FOO(i,j,op) \ - CONTACT(contact,i*skip)->pos[0] = pos[0] op 2.f*hside[j] * R[0+j]; \ - CONTACT(contact,i*skip)->pos[1] = pos[1] op 2.f*hside[j] * R[4+j]; \ - CONTACT(contact,i*skip)->pos[2] = pos[2] op 2.f*hside[j] * R[8+j]; -#define BAR(ctact,side,sideinc) \ - depth -= B ## sideinc; \ - if (depth < 0) goto done; \ - if (A ## sideinc > 0) { FOO(ctact,side,+) } else { FOO(ctact,side,-) } \ - CONTACT(contact,ctact*skip)->depth = depth; \ - ++ret; - - CONTACT(contact,skip)->normal[0] = triAx[0]*signum; - CONTACT(contact,skip)->normal[1] = triAx[1]*signum; - CONTACT(contact,skip)->normal[2] = triAx[2]*signum; - if (maxc == 3) { - CONTACT(contact,2*skip)->normal[0] = triAx[0]*signum; - CONTACT(contact,2*skip)->normal[1] = triAx[1]*signum; - CONTACT(contact,2*skip)->normal[2] = triAx[2]*signum; - } - - if (B1 < B2) { - if (B3 < B1) goto use_side_3; else { - BAR(1,0,1); // use side 1 - if (maxc == 2) goto done; - if (B2 < B3) goto contact2_2; else goto contact2_3; - } - } - else { - if (B3 < B2) { - use_side_3: // use side 3 - BAR(1,2,3); - if (maxc == 2) goto done; - if (B1 < B2) goto contact2_1; else goto contact2_2; - } - else { - BAR(1,1,2); // use side 2 - if (maxc == 2) goto done; - if (B1 < B3) goto contact2_1; else goto contact2_3; - } - } - - contact2_1: BAR(2,0,1); goto done; - contact2_2: BAR(2,1,2); goto done; - contact2_3: BAR(2,2,3); goto done; -#undef FOO -#undef BAR - - done: ; - -////////////////////////////////////////////////////////////// end (from geom.cpp dCollideBP) - - } - - -contact->pos[0] = pos[0]; -contact->pos[1] = pos[1]; -contact->pos[2] = pos[2]; - -contact->depth = outDepth; - - for (i=0; ig1 = const_cast (o2); - CONTACT(contact,i*skip)->g2 = const_cast (o1); - CONTACT(contact,i*skip)->normal[0] = norm[0]; - CONTACT(contact,i*skip)->normal[1] = norm[1]; - CONTACT(contact,i*skip)->normal[2] = norm[2]; - SURFACE(contact,i*skip)->mode=T->material; - } - if(ret&&dGeomGetUserData(o1)->callback)dGeomGetUserData(o1)->callback(T,contact); - return ret; - -} - -/* -bool test_cross_side( dReal* outAx, dReal& outDepth, dReal *pos, dReal& outSignum, int &code, u8 c, const dReal* R, const dReal* hside, const dReal* p, const dReal* triSideAx, const dReal* vax, const dReal* vox ) -{ - -for( u8 i=0;i<3;++i){ - dVector3 axis; - dCROSS114(axis,=,triSideAx ,R+i ); - accurate_normalize(axis); - int ix1=(i+1)%3; - int ix2=(i+2)%3; - dReal sidePr= - dFabs(dDOT14(axis,R+ix1)*hside[ix1])+ - dFabs(dDOT14(axis,R+ix2)*hside[ix2]); - - dReal dist_ax=dDOT(vax,axis)-dDOT(p,axis); - dReal dist_ox=dDOT(vox,axis)-dDOT(p,axis); - - bool isPdistax=dist_ax>0.f; - bool isPdistox=dist_ox>0.f; - if(isPdistax != isPdistox) continue; - - dReal depth_ax=sidePr-dFabs(dist_ax); - dReal depth_ox=sidePr-dFabs(dist_ox); - if( depth_ax>depth_ox ){ - if(depth_ax>0.f){ - if(depth_ax*1.05f= (int)sizeof(dContactGeom)); - VERIFY (dGeomGetClass(o1) == dBoxClass); - - - - const dReal *R = dGeomGetRotation(o1); - const dReal* p=dGeomGetPosition(o1); - dVector3 hside; - dGeomBoxGetLengths(o1,hside); - hside[0]/=2.f;hside[1]/=2.f;hside[2]/=2.f; - - // find number of contacts requested - int maxc = flags & NUMC_MASK; - if (maxc < 1) maxc = 1; - if (maxc > 3) maxc = 3; // no more than 3 contacts per box allowed - - //dVector3 triAx; - const dReal* triSideAx0=T->side0;//{v1[0]-v0[0],v1[1]-v0[1],v1[2]-v0[2]}; - const dReal* triSideAx1=T->side1;//{v2[0]-v1[0],v2[1]-v1[1],v2[2]-v1[2]}; - dVector3 triSideAx2={v0[0]-v2[0],v0[1]-v2[1],v0[2]-v2[2]}; - //dCROSS(triAx,=,triSideAx0,triSideAx1); - int code=0; - dReal outDepth; - dReal signum; - //sepparation along tri plane normal; - const dReal *triAx =T->norm; - //accurate_normalize(triAx); - - - dReal sidePr= - dFabs(dDOT14(triAx,R+0)*hside[0])+ - dFabs(dDOT14(triAx,R+1)*hside[1])+ - dFabs(dDOT14(triAx,R+2)*hside[2]); - -dReal dist=-T->dist; -//dist=dDOT(triAx,v0)-dDOT(triAx,p); -dReal depth=sidePr-dFabs(dist); -outDepth=depth; -signum=dist<0.f ? -1.f : 1.f; -code=0; -if(depth<0.f) return 0; - - -bool isPdist0,isPdist1,isPdist2; -bool test0=true,test1=true,test2=true; -bool test00,test01,test02; -bool test10,test11,test12; -bool test20,test21,test22; - -dReal depth0,depth1,depth2; -dReal dist0,dist1,dist2; - - - -#define CMP(sd,c) \ -if(depth0>depth1)\ - if(depth0>depth2) \ - if(test0##sd){\ - if(test0)\ - if(depth0depth2)\ - if(test1##sd){\ - if(test1)\ - if(depth10.f;\ -isPdist1=dist1>0.f;\ -isPdist2=dist2>0.f;\ -\ -depth0=hside[sd]-dFabs(dist0);\ -depth1=hside[sd]-dFabs(dist1);\ -depth2=hside[sd]-dFabs(dist2);\ -test0##sd = depth0>0.f;\ -test1##sd = depth1>0.f;\ -test2##sd = depth2>0.f;\ -\ -test0 =test0 && test0##sd;\ -test1 =test1 && test1##sd;\ -test2 =test2 && test2##sd;\ -\ -if(isPdist0==isPdist1 && isPdist1==isPdist2)\ -{\ -CMP(sd,c)\ -} - -TEST(0,1) -TEST(1,4) -TEST(2,7) - -#undef CMP -#undef TEST - -unsigned int i; - -dVector3 axis,outAx; - -/* -#define TEST(ax,ox,c) \ -for(i=0;i<3;++i){\ - dCROSS114(axis,=,triSideAx##ax,R+i);\ - accurate_normalize(axis);\ - int ix1=(i+1)%3;\ - int ix2=(i+2)%3;\ - sidePr=\ - dFabs(dDOT14(axis,R+ix1)*hside[ix1])+\ - dFabs(dDOT14(axis,R+ix2)*hside[ix2]);\ -\ - dist##ax=(dDOT(v##ax,axis)-dDOT(p,axis));\ - dist##ox=(dDOT(v##ox,axis)-dDOT(p,axis));\ - signum=dist##ox<0.f ? -1.f : 1.f;\ -\ -depth##ax=sidePr-signum*dist##ax;\ -depth##ox=sidePr-signum*dist##ox;\ - if(depth##ax0.f){\ - if(depth##ax0.f;\ -isPdist##ox=dist##ox>0.f;\ -if(isPdist##ax != isPdist##ox) continue;\ -\ -depth##ax=sidePr-dFabs(dist##ax);\ -depth##ox=sidePr-dFabs(dist##ox);\ - if(depth##ax>depth##ox){\ - if(depth##ax>0.f){\ - if(depth##ax*1.05f 0) { FOO(i,-=) } else { FOO(i,+=) } - BAR(0,1); - BAR(1,2); - BAR(2,3); -#undef FOO -#undef BAR - -/////////////////////////////////////////////////////////// - - -#define TRI_CONTAIN_POINT(pos) {\ - dVector3 cross0, cross1, cross2;\ - dReal ds0,ds1,ds2;\ - \ - dCROSS(cross0,=,triAx,triSideAx0);\ - ds0=dDOT(cross0,v0);\ -\ - dCROSS(cross1,=,triAx,triSideAx1);\ - ds1=dDOT(cross1,v1);\ -\ - dCROSS(cross2,=,triAx,triSideAx2);\ - ds2=dDOT(cross2,v2);\ -\ - if(dDOT(cross0,pos)-ds0>0.f && \ - dDOT(cross1,pos)-ds1>0.f && \ - dDOT(cross2,pos)-ds2>0.f) ++ret;\ -} -/////////////////////////////////////////////////////////// - - - // get the second and third contact points by starting from `p' and going - // along the two sides with the smallest projected length. - -dReal* pdepth; -dContactGeom* prc,*c=CONTACT(contact,ret*skip); -prc=c; -#define FOO(j,op,spoint) \ - c->pos[0] = spoint##[0] op 2.f*hside[j] * R[0+j]; \ - c->pos[1] = spoint##[1] op 2.f*hside[j] * R[4+j]; \ - c->pos[2] = spoint##[2] op 2.f*hside[j] * R[8+j]; -#define BAR(side,sideinc,spos,sdepth) \ - {\ - pdepth=&(c->depth);\ - *pdepth =sdepth-B ## sideinc; \ - if (A ## sideinc > 0) { FOO(side,+,spos) } else { FOO(side,-,spos) } \ - prc=c;\ - if (!(*pdepth < 0)) \ - {\ - ++ret;\ - c=CONTACT(contact,ret*skip);\ - }\ - } - //TRI_CONTAIN_POINT(CONTACT(contact,ret*skip)->pos) - - if(B1pos,prc->depth); - - } - else - { - BAR(2,3,pos,depth); - BAR(0,1,prc->pos,prc->depth); - } - } - else - { - BAR(1,2,pos,depth); - if(B1pos,prc->depth); - } - else - { - BAR(2,3,pos,depth); - BAR(1,2,prc->pos,prc->depth); - } - } - /* - - if (B1 < B2) { - if (B3 < B1) goto use_side_3; else { - BAR(0,1,pos); // use side 1 - if (maxc == 2) goto done; - if (B2 < B3) goto contact2_2; else goto contact2_3; - } - } - else { - if (B3 < B2) { - use_side_3: // use side 3 - BAR(2,3,pos); - if (maxc == 2) goto done; - if (B1 < B2) goto contact2_1; else goto contact2_2; - } - else { - BAR(1,2,pos); // use side 2 - if (maxc == 2) goto done; - if (B1 < B3) goto contact2_1; else goto contact2_3; - } - } - - contact2_1: BAR(0,1,pos); goto done; - contact2_2: BAR(1,2,pos); goto done; - contact2_3: BAR(2,3,pos); goto done; -*/ -#undef FOO -#undef FOO1 -#undef BAR -#undef TRI_CONTAIN_POINT - //done: ; - -////////////////////////////////////////////////////////////// end (from geom.cpp dCollideBP) - - } -else - if(code<=9) -{ - switch((code-1)%3){ - case 0: - pos[0]=v0[0]; - pos[1]=v0[1]; - pos[2]=v0[2]; - break; - case 1: - pos[0]=v1[0]; - pos[1]=v1[1]; - pos[2]=v1[2]; - break; - case 2: - pos[0]=v2[0]; - pos[1]=v2[1]; - pos[2]=v2[2]; - break; - } -switch((code-1)/3){ - case 0: - { - norm[0]=R[0]*signum; - norm[1]=R[4]*signum; - norm[2]=R[8]*signum; - } - break; - - case 1: - { - norm[0]=R[1]*signum; - norm[1]=R[5]*signum; - norm[2]=R[9]*signum; - } - break; - case 2: - { - norm[0]=R[2]*signum; - norm[1]=R[6]*signum; - norm[2]=R[10]*signum; - } - break; - } -} -else { - norm[0]=outAx[0]*signum; - norm[1]=outAx[1]*signum; - norm[2]=outAx[2]*signum; - - //pos[0]=crpos[0]; - //pos[1]=crpos[1]; - //pos[2]=crpos[2]; - - -///////////// -/* - dReal Q1 = -signum*dDOT14(outAx,R+0); - dReal Q2 = -signum*dDOT14(outAx,R+1); - dReal Q3 = -signum*dDOT14(outAx,R+2); - dReal A1 = 2.f*hside[0] * Q1; - dReal A2 = 2.f*hside[1] * Q2; - dReal A3 = 2.f*hside[2] * Q3; - pos[0]=p[0]; - pos[1]=p[1]; - pos[2]=p[2]; - -#define FOO(i,op) \ - pos[0] op hside[i] * R[0+i]; \ - pos[1] op hside[i] * R[4+i]; \ - pos[2] op hside[i] * R[8+i]; -#define BAR(i,iinc) if (A ## iinc > 0) { FOO(i,-=) } else { FOO(i,+=) } - BAR(0,1); - BAR(1,2); - BAR(2,3); -#undef FOO -#undef BAR -//////////////// - - -switch((code-10)/3){ - -case 0: - CrossProjLine1(v0,triSideAx0,pos,R+(code-10),pos); - if(pos[0]==dInfinity){ - pos[0]=(v1[0]+v0[0])/2.f; - pos[1]=(v1[1]+v0[1])/2.f; - pos[2]=(v1[2]+v0[2])/2.f; - } -break; - -case 1: - CrossProjLine1(v1,triSideAx1,pos,R+(code-13),pos); - if(pos[0]==dInfinity){ - pos[0]=(v2[0]+v1[0])/2.f; - pos[1]=(v2[1]+v1[1])/2.f; - pos[2]=(v2[2]+v1[2])/2.f; - } -break; - -case 2: - CrossProjLine1(v0,triSideAx2,pos,R+(code-16),pos); - if(pos[0]==dInfinity){ - pos[0]=(v2[0]+v0[0])/2.f; - pos[1]=(v2[1]+v0[1])/2.f; - pos[2]=(v2[2]+v0[2])/2.f; - } - -} -*/ -} - -if(dDOT(norm,triAx)>0.f) return 0; - - -//if(0!=code){ -contact->pos[0] = pos[0]; -contact->pos[1] = pos[1]; -contact->pos[2] = pos[2]; - - -//contact->pos[0] = crossprg[0]; -//contact->pos[1] = crossprg[1]; -//contact->pos[2] = crossprg[2]; - -contact->depth = outDepth; - -//} - for (u32 i=0; ig1 = const_cast (o2); - CONTACT(contact,i*skip)->g2 = const_cast (o1); - CONTACT(contact,i*skip)->normal[0] = norm[0]; - CONTACT(contact,i*skip)->normal[1] = norm[1]; - CONTACT(contact,i*skip)->normal[2] = norm[2]; - SURFACE(contact,i*skip)->mode=T->T->material; - } - if(ret&&dGeomGetUserData(o1)->callback)dGeomGetUserData(o1)->callback(T->T,contact); - return ret; - -} - diff --git a/src/xrGame/tri-colliderknoopc/dTriBox.h b/src/xrGame/tri-colliderknoopc/dTriBox.h deleted file mode 100644 index f6fa13ce01f..00000000000 --- a/src/xrGame/tri-colliderknoopc/dTriBox.h +++ /dev/null @@ -1,383 +0,0 @@ -#ifndef D_TRI_BOX_H -#define D_TRI_BOX_H - -#include "TriPrimitiveCollideClassDef.h" -#include "../ode_include.h" -#include "../MathUtils.h" -#include "dcTriListCollider.h" -struct Triangle; -struct dxBox { - dVector3 side; // side lengths (x,y,z) -}; - -IC float dcTriListCollider:: dBoxProj(dxGeom* box,const dReal* normal) -{ - VERIFY (dGeomGetClass(box)== dBoxClass); - float hside[3]; - dGeomBoxGetLengths(box,hside); - hside[0]*=.5f;hside[1]*=0.5f;hside[2]*=0.5f; - const dReal* R=dGeomGetRotation(box); - return - dFabs(dDOT14(normal,R+0)*hside[0])+ - dFabs(dDOT14(normal,R+1)*hside[1])+ - dFabs(dDOT14(normal,R+2)*hside[2]); -} - - - -IC void dcTriListCollider::CrossProjLine(const dReal* pt1,const dReal* vc1,const dReal* pt2,const dReal* vc2,dReal* proj){ - dVector3 ac={pt1[0]-pt2[0],pt1[1]-pt2[1],pt1[2]-pt2[2]}; - dReal factor=(dDOT(vc2,vc2)*dDOT44(vc1,vc1)-dDOT14(vc2,vc1)*dDOT14(vc2,vc1)); - if(factor==0.f){ - proj[0]=dInfinity; - //proj[1]=dInfinity; - //proj[2]=dInfinity; - return; - } - dReal t=(dDOT(ac,vc2)*dDOT41(vc1,vc2)-dDOT41(vc1,ac)*dDOT(vc2,vc2)) - / - factor; - - proj[0]=pt1[0]+vc1[0]*t; - proj[1]=pt1[1]+vc1[4]*t; - proj[2]=pt1[2]+vc1[8]*t; - - -} - -IC void dcTriListCollider::CrossProjLine1(const dReal* pt1,const dReal* vc1,const dReal* pt2,const dReal* vc2,dReal* proj){ - dVector3 ac={pt1[0]-pt2[0],pt1[1]-pt2[1],pt1[2]-pt2[2]}; - dReal factor=(dDOT44(vc2,vc2)*dDOT(vc1,vc1)-dDOT41(vc2,vc1)*dDOT41(vc2,vc1)); - if(factor==0.f){ - proj[0]=dInfinity; - //proj[1]=dInfinity; - //proj[2]=dInfinity; - return; - } - dReal t=(dDOT14(ac,vc2)*dDOT14(vc1,vc2)-dDOT(vc1,ac)*dDOT44(vc2,vc2)) - / - factor; - - proj[0]=pt1[0]+vc1[0]*t; - proj[1]=pt1[1]+vc1[1]*t; - proj[2]=pt1[2]+vc1[2]*t; - - -} - - -IC bool dcTriListCollider:: CrossProjLine14(const dReal* pt1,const dReal* vc1,const dReal* pt2,const dReal* vc2,dReal hside,dReal* proj){ - dVector3 ac={pt1[0]-pt2[0],pt1[1]-pt2[1],pt1[2]-pt2[2]}; - - //dReal vc2_2=dDOT44(vc2,vc2); - dReal vc1_vc2=dDOT41(vc2,vc1); - dReal vc1_2=dDOT(vc1,vc1); - - dReal factor=/*vc2_2*/vc1_2-vc1_vc2*vc1_vc2; - if(factor==0.f){ - //proj[0]=dInfinity; - //proj[1]=dInfinity; - //proj[2]=dInfinity; - return false; - } - dReal ac_vc1=dDOT(vc1,ac); - dReal ac_vc2=dDOT14(ac,vc2); - dReal t1=(ac_vc2*vc1_vc2-ac_vc1/*vc2_2*/) - / - factor; - - if(t1<0.f) return false; - if(t1>1.f) return false; - - dReal t2=(ac_vc1*vc1_vc2-ac_vc2*vc1_2) - /factor; - - dReal nt2=t2;//*_sqrt(vc2_2); - if(nt2>hside || nt2 < -hside) return false; - - proj[0]=pt1[0]+vc1[0]*t1; - proj[1]=pt1[1]+vc1[1]*t1; - proj[2]=pt1[2]+vc1[2]*t1; - - return true; -} -//is point in Box -IC bool dcTriListCollider::IsPtInBx(const dReal* Pt,const dReal* BxP,const dReal* BxEx,const dReal* BxR){ - dVector3 BxPR,PtR; - - dMULTIPLY1_331 (BxPR,BxR,BxP); - dMULTIPLY1_331 (PtR,BxR,Pt); - return - - dFabs(BxPR[0]-PtR[0])0.f - && - (dDOT(fragmentonAx,Pt1)-BxPPr+BxExPr/2.f)* - (dDOT(fragmentonAx,Pt2)-BxPPr+BxExPr/2.f)>0.f - ) return -1.f; - - - dVector3 crossAx0; - dCROSS114(crossAx0,=,fragmentonAx,R+0); - accurate_normalize(crossAx0); - BxExPr= - dFabs(dDOT14(crossAx0,R+0)*BxEx[0])+ - dFabs(dDOT14(crossAx0,R+1)*BxEx[1])+ - dFabs(dDOT14(crossAx0,R+2)*BxEx[2]); - dReal distance0=dDOT(crossAx0,Pt1)-dDOT(crossAx0,BxP); - if(dFabs(distance0)>BxExPr/2.f) return -1.f; - dReal depth0=BxExPr/2.f-dFabs(distance0); - - dVector3 crossAx1; - dCROSS114(crossAx1,=,fragmentonAx,R+1); - accurate_normalize(crossAx1); - BxExPr= - dFabs(dDOT14(crossAx1,R+0)*BxEx[0])+ - dFabs(dDOT14(crossAx1,R+1)*BxEx[1])+ - dFabs(dDOT14(crossAx1,R+2)*BxEx[2]); - dReal distance1=dDOT(crossAx1,Pt1)-dDOT(crossAx1,BxP); - if(dFabs(distance1)>BxExPr/2.f) return -1.f; - dReal depth1=BxExPr/2.f-dFabs(distance1); - - dVector3 crossAx2; - dCROSS114(crossAx2,=,fragmentonAx,R+2); - accurate_normalize(crossAx2); - BxExPr= - dFabs(dDOT14(crossAx2,R+0)*BxEx[0])+ - dFabs(dDOT14(crossAx2,R+1)*BxEx[1])+ - dFabs(dDOT14(crossAx2,R+2)*BxEx[2]); - dReal distance2=dDOT(crossAx2,Pt1)-dDOT(crossAx2,BxP); - if(dFabs(distance2)>BxExPr/2.f) return -1.f; - dReal depth2=BxExPr/2.f-dFabs(distance2); - - - if(depth00.f -&& -(currentDistance+BxExPr/2.f)* -(distance+BxExPr/2.f)>0.f -) return -1.f; - -if(depth<0.f&¤tDepth>=0.f) { -depth=currentDepth; -distance=currentDistance; -} -else -dVector3 crossAx0; -dCROSS114(crossAx0,=,fragmentonAx,R+0); -accurate_normalize(crossAx0); -BxExPr= -dFabs(dDOT14(crossAx0,R+0)*BxEx[0])+ -dFabs(dDOT14(crossAx0,R+1)*BxEx[1])+ -dFabs(dDOT14(crossAx0,R+2)*BxEx[2]); -dReal distance0=dDOT(crossAx0,Pt1)-dDOT(crossAx0,BxP); -if(dFabs(distance0)>BxExPr/2.f) return -1.f; -dReal depth0=BxExPr/2.f-dFabs(distance0); - -dVector3 crossAx1; -dCROSS114(crossAx1,=,fragmentonAx,R+1); -accurate_normalize(crossAx1); -BxExPr= -dFabs(dDOT14(crossAx1,R+0)*BxEx[0])+ -dFabs(dDOT14(crossAx1,R+1)*BxEx[1])+ -dFabs(dDOT14(crossAx1,R+2)*BxEx[2]); -dReal distance1=dDOT(crossAx1,Pt1)-dDOT(crossAx1,BxP); -if(dFabs(distance1)>BxExPr/2.f) return -1.f; -dReal depth1=BxExPr/2.f-dFabs(distance1); - -dVector3 crossAx2; -dCROSS114(crossAx2,=,fragmentonAx,R+2); -accurate_normalize(crossAx2); -BxExPr= -dFabs(dDOT14(crossAx2,R+0)*BxEx[0])+ -dFabs(dDOT14(crossAx2,R+1)*BxEx[1])+ -dFabs(dDOT14(crossAx2,R+2)*BxEx[2]); -dReal distance2=dDOT(crossAx2,Pt1)-dDOT(crossAx2,BxP); -if(dFabs(distance2)>BxExPr/2.f) return -1.f; -dReal depth2=BxExPr/2.f-dFabs(distance2); - - -if(depth0 gl_cl_tries_state ; -extern xr_vector::iterator I,E,B ; - - -#define CONTACT(Ptr, Stride) ((dContactGeom*) (((byte*)Ptr) + (Stride))) -#define SURFACE(Ptr, Stride) ((dSurfaceParameters*) (((byte*)Ptr) + (Stride-sizeof(dSurfaceParameters)))) -#define NUMC_MASK (0xffff) - -#define M_SIN_PI_3 REAL(0.8660254037844386467637231707529362) -#define M_COS_PI_3 REAL(0.5000000000000000000000000000000000) -#endif diff --git a/src/xrGame/tri-colliderknoopc/dTriColliderMath.h b/src/xrGame/tri-colliderknoopc/dTriColliderMath.h deleted file mode 100644 index 8b9c0eb7ae7..00000000000 --- a/src/xrGame/tri-colliderknoopc/dTriColliderMath.h +++ /dev/null @@ -1,113 +0,0 @@ -#ifndef D_TRI_COLLIDER_MATH_H -#define D_TRI_COLLIDER_MATH_H -#include "__aabb_tri.h" -#include "../ode_include.h" -#include "../mathutils.h" -#include "dcTriangle.h" - -inline bool TriContainPoint(const dReal* v0,const dReal* v1,const dReal* v2, - const dReal* triSideAx0,const dReal* triSideAx1,const dReal* triSideAx2, - const dReal* triAx, const dReal* pos){ - dVector3 cross0, cross1, cross2; - dCROSS(cross0,=,triAx,triSideAx0); - if(dDOT(cross0,pos)0.f) return true; - else return false; - - - } - - inline bool TriPlaneContainPoint(const dReal* triAx,const dReal* v0, const dReal* pos){ - - - if(dDOT(triAx,pos)-dDOT(triAx,v0)>0.f) return true; - else return false; - - - } - - inline bool TriPlaneContainPoint(Triangle* T) - { - return T->dist>0.f; - } - - inline void PlanePoint(const Triangle& tri,const dReal* from,const dReal* to,float from_dist,dReal* point) - { - dVector3 dir = {to[0]-from[0],to[1]-from[1],to[2]-from[2]} ; - dReal cosinus = (tri.dist-from_dist) ; - VERIFY2(cosinus<0.f,"wrong positions") ; - dReal mul=(from_dist)/cosinus ; - dir[0]*=mul; dir[1]*=mul; dir[2]*=mul ; - point[0]=from[0]-dir[0] ; - point[1]=from[1]-dir[1] ; - point[2]=from[2]-dir[2] ; - - } - - - ICF void InitTriangle(CDB::TRI* XTri,Triangle& triangle,const Point* VRT) - { - dVectorSub(triangle.side0,VRT[1],VRT[0]) ; - dVectorSub(triangle.side1,VRT[2],VRT[1]) ; - triangle.T=XTri ; - dCROSS(triangle.norm,=,triangle.side0,triangle.side1) ; - cast_fv(triangle.norm).normalize() ; - triangle.pos=dDOT(VRT[0],triangle.norm) ; - } - ICF void InitTriangle(CDB::TRI* XTri,Triangle& triangle,const Fvector* V_array) - { - const Point vertices[3]={Point((dReal*)&V_array[XTri->verts[0]]),Point((dReal*)&V_array[XTri->verts[1]]),Point((dReal*)&V_array[XTri->verts[2]])}; - InitTriangle(XTri,triangle,vertices); - } - - ICF void CalculateTri(CDB::TRI* XTri,const float* pos,Triangle& triangle,const Fvector* V_array) - { - InitTriangle(XTri,triangle,V_array); - triangle.dist=dDOT(pos,triangle.norm)-triangle.pos; - } - - ICF void CalculateTri(CDB::TRI* XTri,const float* pos,Triangle& triangle,const Point* VRT) - { - InitTriangle(XTri,triangle,VRT); - triangle.dist=dDOT(pos,triangle.norm)-triangle.pos; - } - #endif \ No newline at end of file diff --git a/src/xrGame/tri-colliderknoopc/dTriCylinder.cpp b/src/xrGame/tri-colliderknoopc/dTriCylinder.cpp deleted file mode 100644 index 9aef84b938c..00000000000 --- a/src/xrGame/tri-colliderknoopc/dTriCylinder.cpp +++ /dev/null @@ -1,807 +0,0 @@ -#include "stdafx.h" -#include "dTriColliderCommon.h" -#include "../dCylinder/dCylinder.h" -#include "dTriCylinder.h" -#include "../MathUtils.h" -#include "dcTrilistCollider.h" -////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////// - -/*(lp+t*lv-cp)^2=r^2 => t1,t2 =>O1=lp+t1*lv;O2=lp+t2*lv */ -//O1,O2 seems to be sphere line intersections -bool dcTriListCollider::circleLineIntersection(const dReal* cn,const dReal* cp,dReal r,const dReal* lv,const dReal* lp,dReal sign,dVector3 point){ - - dVector3 LC={lp[0]-cp[0],lp[1]-cp[1],lp[2]-cp[2]}; - - dReal A,B,C,B_A,B_A_2,D; - dReal t1,t2; - A=dDOT(lv,lv); - B=dDOT(LC,lv); - C=dDOT(LC,LC)-r*r; - B_A=B/A; - B_A_2=B_A*B_A; - D=B_A_2-C; - if(D<0.f){ - - point[0]=lp[0]-lv[0]*B; - point[1]=lp[1]-lv[1]*B; - point[2]=lp[2]-lv[2]*B; - return false; - - } - else{ - t1=-B_A-_sqrt(D); - t2=-B_A+_sqrt(D); - - dVector3 O1={lp[0]+lv[0]*t1,lp[1]+lv[1]*t1,lp[2]+lv[2]*t1}; - dVector3 O2={lp[0]+lv[0]*t2,lp[1]+lv[1]*t2,lp[2]+lv[2]*t2}; - //dVector3 test1={O1[0]-cp[0],O1[1]-cp[1],O1[2]-cp[2]}; - //dVector3 test2={O2[0]-cp[0],O2[1]-cp[1],O2[2]-cp[2]}; - //dReal t=_sqrt(dDOT(test1,test1)); - //t=_sqrt(dDOT(test2,test2)); - - dReal cpPr=sign*dDOT(cn,cp); - - dReal dist1=(sign*dDOT41(cn,O1)-cpPr); - dReal dist2=(sign*dDOT41(cn,O2)-cpPr); - - if(dist1 3) maxc = 3; // no more than 3 contacts per box allowed - - dReal signum, outDepth,cos1,sin1; - //////////////////////////////////////////////////////////////////////////// - //sepparation along tri plane normal;/////////////////////////////////////// - //////////////////////////////////////////////////////////////////////////// - - - //cos0=dDOT14(triAx,R+0); - cos1=dFabs(dDOT14(triAx,R+1)); - //cos2=dDOT14(triAx,R+2); - - //sin1=_sqrt(cos0*cos0+cos2*cos2); - - //////////////////////// - //another way ////////// - cos1=cos10.f) - return 0; - dReal depth=sidePr-dist; - outDepth=depth; - signum=-1.f; - - int code=0; - if(depth<0.f) return 0; - - dVector3 norm; - unsigned int ret=0; - dVector3 pos; - if(code==0){ - norm[0]=triAx[0]*signum; - norm[1]=triAx[1]*signum; - norm[2]=triAx[2]*signum; - - - dReal Q1 = signum*dDOT14(triAx,R+0); - dReal Q2 = signum*dDOT14(triAx,R+1); - dReal Q3 = signum*dDOT14(triAx,R+2); - dReal factor =_sqrt(Q1*Q1+Q3*Q3); - dReal C1,C3; - dReal centerDepth;//depth in the cirle centre - if(factor>0.f) - { - C1=Q1/factor; - C3=Q3/factor; - - } - else - { - C1=1.f; - C3=0.f; - - } - - dReal A1 = radius * C1;//cosinus - dReal A2 = hlz*Q2; - dReal A3 = radius * C3;//sinus - - if(factor>0.f) centerDepth=outDepth-A1*Q1-A3*Q3; else centerDepth=outDepth; - - pos[0]=p[0]; - pos[1]=p[1]; - pos[2]=p[2]; - - pos[0]+= A2>0 ? hlz*R[1]:-hlz*R[1]; - pos[1]+= A2>0 ? hlz*R[5]:-hlz*R[5]; - pos[2]+= A2>0 ? hlz*R[9]:-hlz*R[9]; - - - - - ret=0; - contact->pos[0] = pos[0]+A1*R[0]+A3*R[2]; - contact->pos[1] = pos[1]+A1*R[4]+A3*R[6]; - contact->pos[2] = pos[2]+A1*R[8]+A3*R[10]; - - { - contact->depth = outDepth; - ret=1; - } - - if(dFabs(Q2)>M_SQRT1_2){ - - A1=(-C1*M_COS_PI_3-C3*M_SIN_PI_3)*radius; - A3=(-C3*M_COS_PI_3+C1*M_SIN_PI_3)*radius; - CONTACT(contact,ret*skip)->pos[0]=pos[0]+A1*R[0]+A3*R[2]; - CONTACT(contact,ret*skip)->pos[1]=pos[1]+A1*R[4]+A3*R[6]; - CONTACT(contact,ret*skip)->pos[2]=pos[2]+A1*R[8]+A3*R[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+Q1*A1+Q3*A3; - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - - A1=(-C1*M_COS_PI_3+C3*M_SIN_PI_3)*radius; - A3=(-C3*M_COS_PI_3-C1*M_SIN_PI_3)*radius; - CONTACT(contact,ret*skip)->pos[0]=pos[0]+A1*R[0]+A3*R[2]; - CONTACT(contact,ret*skip)->pos[1]=pos[1]+A1*R[4]+A3*R[6]; - CONTACT(contact,ret*skip)->pos[2]=pos[2]+A1*R[8]+A3*R[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+Q1*A1+Q3*A3; - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - } else { - - CONTACT(contact,ret*skip)->pos[0]=contact->pos[0]-2.f*(A2>0 ? hlz*R[1]:-hlz*R[1]); - CONTACT(contact,ret*skip)->pos[1]=contact->pos[1]-2.f*(A2>0 ? hlz*R[5]:-hlz*R[5]); - CONTACT(contact,ret*skip)->pos[2]=contact->pos[2]-2.f*(A2>0 ? hlz*R[9]:-hlz*R[9]); - CONTACT(contact,ret*skip)->depth=outDepth-Q2*2.f*A2; - - if(CONTACT(contact,ret*skip)->depth>0.f)++ret; - } - } - - if((int)ret>maxc) ret=(unsigned int)maxc; - - for (unsigned int i=0; ig1 = const_cast (o2); - CONTACT(contact,i*skip)->g2 = const_cast (o1); - CONTACT(contact,i*skip)->normal[0] = norm[0]; - CONTACT(contact,i*skip)->normal[1] = norm[1]; - CONTACT(contact,i*skip)->normal[2] = norm[2]; - SURFACE(contact,i*skip)->mode=T->material; - } - if(ret&&dGeomGetUserData(o1)->callback)dGeomGetUserData(o1)->callback(T,contact); - return ret; -} - -////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////////// - -IC bool dcTriListCollider::cylinderCrossesLine(const dReal* p,const dReal* R,dReal hlz, - const dReal* v0,const dReal* v1,const dReal* l,dVector3 pos){ - dReal _cos=dDOT14(l,R); - - if(!(dFabs(_cos)<1.f)) return false; - - dReal sin2=1.f-_cos*_cos; - - dVector3 vp={v0[0]-p[0],v0[1]-p[1],v0[2]-p[2]}; - dReal c1=dDOT(vp,l); - dReal c2=dDOT14(vp,R); - - dReal t=(c2*_cos-c1)/sin2; - dReal q=(c2-c1*_cos)/sin2; - - if(dFabs(q)>hlz) return false; - - dVector3 v01={v1[0]-v0[0],v1[1]-v0[1],v1[2]-v0[2]}; - dReal sidelength2=dDOT(v01,v01); - - if(t*t>sidelength2) return false; - - pos[0]=v0[0]+l[0]*t; - pos[1]=v0[1]+l[1]*t; - pos[2]=v0[2]+l[2]*t; - - return true; - -} -///////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////// -///////////////////////////////////////////////////////////////////////////////// -//#define CHECK_EXIT -#ifdef CHECK_EXIT - int Check (int check) - { - return check; - } - #define RETURN0 return Check(0) -#else - #define RETURN0 return 0 -#endif - -int dcTriListCollider::dTriCyl ( - const dReal* v0,const dReal* v1,const dReal* v2, - Triangle* T, - dxGeom *o1, dxGeom *o2, - int flags, dContactGeom *contact, int skip - ) -{ - - // VERIFY (skip >= (int)sizeof(dContactGeom)); - VERIFY (dGeomGetClass(o1)== dCylinderClassUser); - - - - - const dReal *R = dGeomGetRotation(o1); - const dReal* p=dGeomGetPosition(o1); - dReal radius; - dReal hlz; - dGeomCylinderGetParams(o1,&radius,&hlz); - hlz/=2.f; - - // find number of contacts requested - int maxc = flags & NUMC_MASK; - if (maxc < 1) maxc = 1; - if (maxc > 3) maxc = 3; // no more than 3 contacts per box allowed - - - const dVector3 &triAx=T->norm; - dVector3 triSideAx0={T->side0[0],T->side0[1],T->side0[2]}; //{v1[0]-v0[0],v1[1]-v0[1],v1[2]-v0[2]}; - dVector3 triSideAx1={T->side1[0],T->side1[1],T->side1[2]}; //{v2[0]-v1[0],v2[1]-v1[1],v2[2]-v1[2]}; - dVector3 triSideAx2={v0[0]-v2[0],v0[1]-v2[1],v0[2]-v2[2]}; - //dCROSS(triAx,=,triSideAx0,triSideAx1); - int code=0; - dReal signum, outDepth,cos0,cos1,cos2,sin1; -//////////////////////////////////////////////////////////////////////////// -//sepparation along tri plane normal;/////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////// -//accurate_normalize(triAx); - -//cos0=dDOT14(triAx,R+0); -cos1=dFabs(dDOT14(triAx,R+1)); -//cos2=dDOT14(triAx,R+2); - -//sin1=_sqrt(cos0*cos0+cos2*cos2); - -//////////////////////// -//another way ////////// -cos1=cos1dist; //dDOT(triAx,v0)-dDOT(triAx,p); -if(dist>0.f) RETURN0; -dReal depth=sidePr-dFabs(dist); -outDepth=depth; -signum=dist>0.f ? 1.f : -1.f; - -code=0; -if(depth<0.f) RETURN0; - -dReal depth0,depth1,depth2,dist0,dist1,dist2; -bool isPdist0,isPdist1,isPdist2; -bool testV0,testV1,testV2; -bool sideTestV00,sideTestV01,sideTestV02; -bool sideTestV10,sideTestV11,sideTestV12; -bool sideTestV20,sideTestV21,sideTestV22; - - -////////////////////////////////////////////////////////////////////////////// -//cylinder axis - one of the triangle vertexes touches cylinder's flat surface -////////////////////////////////////////////////////////////////////////////// -dist0=dDOT14(v0,R+1)-dDOT14(p,R+1); -dist1=dDOT14(v1,R+1)-dDOT14(p,R+1); -dist2=dDOT14(v2,R+1)-dDOT14(p,R+1); - -isPdist0=dist0>0.f; -isPdist1=dist1>0.f; -isPdist2=dist2>0.f; - -depth0=hlz-dFabs(dist0); -depth1=hlz-dFabs(dist1); -depth2=hlz-dFabs(dist2); - -testV0=depth0>0.f; -testV1=depth1>0.f; -testV2=depth2>0.f; - -if(isPdist0==isPdist1 && isPdist1== isPdist2) //(here and lower) check the tryangle is on one side of the cylinder - -{ -if(depth0>depth1) - if(depth0>depth2) - if(testV0){ - if(depth0depth2) - if(testV1){ - if(depth10.f;\ - isPdist1=dist1>0.f;\ - isPdist2=dist2>0.f;\ -\ - depth0=radius-dFabs(dist0);\ - depth1=radius-dFabs(dist1);\ - depth2=radius-dFabs(dist2);\ -\ - sideTestV##vx##0=depth0>0.f;\ - sideTestV##vx##1=depth1>0.f;\ - sideTestV##vx##2=depth2>0.f;\ -\ - if(isPdist0==isPdist1 && isPdist1== isPdist2)\ -\ - {\ - if(sideTestV##vx##0||sideTestV##vx##1||sideTestV##vx##2){\ - if(!(depth##vx pointDepth)\ - {\ - pointDepth=depth##vx;\ - signum= isPdist##vx ? 1.f : -1.f;\ - outAx[0]=axis[0];\ - outAx[1]=axis[1];\ - outAx[2]=axis[2];\ - code=c;\ - }\ - }\ - }\ - else RETURN0;\ - \ -\ -\ - }\ -} - -if(testV0) TEST(0,1,2,4) -if(testV1 ) TEST(1,2,0,5) -//&& sideTestV01 -if(testV2 ) TEST(2,0,1,6) -//&& sideTestV02 && sideTestV12 -#undef TEST - -dVector3 tpos,pos; -if(code>3) outDepth=pointDepth; //deepest vertex axis used if its depth less than outDepth -//else{ -//bool outV0=!(testV0&&sideTestV00&&sideTestV10&&sideTestV20); -//bool outV1=!(testV1&&sideTestV01&&sideTestV11&&sideTestV21); -//bool outV2=!(testV2&&sideTestV02&&sideTestV12&&sideTestV22); -bool outV0=true; -bool outV1=true; -bool outV2=true; -///////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -///crosses between triangle sides and cylinder axis////////////////////////// -///////////////////////////////////////////////////////////////////////////// -#define TEST(ax,nx,ox,c) if(cylinderCrossesLine(p,R+1,hlz,v##ax,v##nx,triSideAx##ax,tpos)) {\ - dCROSS114(axis,=,triSideAx##ax,R+1);\ - accurate_normalize(axis);\ - dist##ax=dDOT(v##ax,axis)-dDOT(p,axis);\ - dist##ox=dDOT(v##ox,axis)-dDOT(p,axis);\ -\ - isPdist##ax=dist##ax>0.f;\ - isPdist##ox=dist##ox>0.f;\ -\ - if(isPdist##ax == isPdist##ox)\ -{\ -depth##ax=radius-dFabs(dist##ax);\ -depth##ox=radius-dFabs(dist##ox);\ - \ - if(depth##ax>0.f){\ - if(depth##ax<=outDepth && depth##ax>=depth##ox) \ - {\ - outDepth=depth##ax;\ - signum= isPdist##ax ? 1.f : -1.f;\ - outAx[0]=axis[0];\ - outAx[1]=axis[1];\ - outAx[2]=axis[2];\ - pos[0]=tpos[0];\ - pos[1]=tpos[1];\ - pos[2]=tpos[2];\ - code=c;\ - }\ - }\ - else if(depth##ox<0.f) RETURN0;\ -\ -}\ -} - -accurate_normalize(triSideAx0); -if(outV0&&outV1) -TEST(0,1,2,7) - -accurate_normalize(triSideAx1); -if(outV1&&outV2) -TEST(1,2,0,8) - -accurate_normalize(triSideAx2); -if(outV2&&outV0) -TEST(2,0,1,9) -#undef TEST - -//////////////////////////////////// -//test cylinder rings on triangle sides//// -//////////////////////////////////// - -dVector3 tAx,cen; -dReal sign; -bool cs; - -#define TEST(ax,nx,ox,c) \ -{\ -posProj=dDOT(p,triSideAx##ax)-dDOT(v##ax,triSideAx##ax);\ -axis[0]=p[0]-v0[0]-triSideAx##ax[0]*posProj;\ -axis[1]=p[1]-v0[1]-triSideAx##ax[1]*posProj;\ -axis[2]=p[2]-v0[2]-triSideAx##ax[2]*posProj;\ - \ -sign=dDOT14(axis,R+1)>0.f ? 1.f :-1.f;\ -cen[0]=p[0]-sign*R[1]*hlz;\ -cen[1]=p[1]-sign*R[5]*hlz;\ -cen[2]=p[2]-sign*R[9]*hlz;\ -\ -cs=circleLineIntersection(R+1,cen,radius,triSideAx##ax,v##ax,-sign,tpos);\ -\ -axis[0]=tpos[0]-cen[0];\ -axis[1]=tpos[1]-cen[1];\ -axis[2]=tpos[2]-cen[2];\ -\ -if(cs){ \ -\ -cos0=dDOT14(axis,R+0);\ -cos2=dDOT14(axis,R+2);\ -tAx[0]=R[2]*cos0-R[0]*cos2;\ -tAx[1]=R[6]*cos0-R[4]*cos2;\ -tAx[2]=R[10]*cos0-R[8]*cos2;\ -\ -dCROSS(axis,=,triSideAx##ax,tAx);\ -\ -}\ -accurate_normalize(axis);\ -dist##ax=dDOT(v##ax,axis)-dDOT(p,axis);\ -if(dist##ax*dDOT(axis,triSideAx##nx)>0.f){\ -\ -cos0=dDOT14(axis,R+0);\ -cos1=dFabs(dDOT14(axis,R+1));\ -cos2=dDOT14(axis,R+2);\ -\ -\ -sin1=_sqrt(cos0*cos0+cos2*cos2);\ -\ -sidePr=cos1*hlz+sin1*radius;\ -\ -\ - dist##ox=dDOT(v##ox,axis)-dDOT(p,axis);\ -\ - isPdist##ax=dist##ax>0.f;\ - isPdist##ox=dist##ox>0.f;\ -\ - if(isPdist##ax == isPdist##ox) \ -\ -{\ -depth##ax=sidePr-dFabs(dist##ax);\ -depth##ox=sidePr-dFabs(dist##ox);\ - \ - if(depth##ax>0.f){\ - if(depth##ax0.f) - { - C1=Q1/factor; - C3=Q3/factor; - - } - else - { - C1=1.f; - C3=0.f; - - } - - dReal A1 = radius * C1;//cosinus - dReal A2 = hlz;//Q2 - dReal A3 = radius * C3;//sinus - - if(factor>0.f) centerDepth=outDepth-A1*Q1-A3*Q3; else centerDepth=outDepth; - - pos[0]=p[0]; - pos[1]=p[1]; - pos[2]=p[2]; - - pos[0]+= Q2>0 ? hlz*R[1]:-hlz*R[1]; - pos[1]+= Q2>0 ? hlz*R[5]:-hlz*R[5]; - pos[2]+= Q2>0 ? hlz*R[9]:-hlz*R[9]; - - - - - ret=0; - dVector3 cross0, cross1, cross2; - dReal ds0,ds1,ds2; - - dCROSS(cross0,=,triAx,triSideAx0); - ds0=dDOT(cross0,v0); - - dCROSS(cross1,=,triAx,triSideAx1); - ds1=dDOT(cross1,v1); - - dCROSS(cross2,=,triAx,triSideAx2); - ds2=dDOT(cross2,v2); - - contact->pos[0] = pos[0]+A1*R[0]+A3*R[2]; - contact->pos[1] = pos[1]+A1*R[4]+A3*R[6]; - contact->pos[2] = pos[2]+A1*R[8]+A3*R[10]; - - if(dDOT(cross0,contact->pos)-ds0>0.f && - dDOT(cross1,contact->pos)-ds1>0.f && - dDOT(cross2,contact->pos)-ds2>0.f){ - contact->depth = outDepth; - ret=1; - } - -if(dFabs(Q2)>M_SQRT1_2){ - - A1=(-C1*M_COS_PI_3-C3*M_SIN_PI_3)*radius; - A3=(-C3*M_COS_PI_3+C1*M_SIN_PI_3)*radius; - CONTACT(contact,ret*skip)->pos[0]=pos[0]+A1*R[0]+A3*R[2]; - CONTACT(contact,ret*skip)->pos[1]=pos[1]+A1*R[4]+A3*R[6]; - CONTACT(contact,ret*skip)->pos[2]=pos[2]+A1*R[8]+A3*R[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+Q1*A1+Q3*A3; - - if(CONTACT(contact,ret*skip)->depth>0.f) - if(dDOT(cross0,CONTACT(contact,ret*skip)->pos)-ds0>0.f && - dDOT(cross1,CONTACT(contact,ret*skip)->pos)-ds1>0.f && - dDOT(cross2,CONTACT(contact,ret*skip)->pos)-ds2>0.f) ++ret; - - A1=(-C1*M_COS_PI_3+C3*M_SIN_PI_3)*radius; - A3=(-C3*M_COS_PI_3-C1*M_SIN_PI_3)*radius; - CONTACT(contact,ret*skip)->pos[0]=pos[0]+A1*R[0]+A3*R[2]; - CONTACT(contact,ret*skip)->pos[1]=pos[1]+A1*R[4]+A3*R[6]; - CONTACT(contact,ret*skip)->pos[2]=pos[2]+A1*R[8]+A3*R[10]; - CONTACT(contact,ret*skip)->depth=centerDepth+Q1*A1+Q3*A3; - - if(CONTACT(contact,ret*skip)->depth>0.f) - if(dDOT(cross0,CONTACT(contact,ret*skip)->pos)-ds0>0.f && - dDOT(cross1,CONTACT(contact,ret*skip)->pos)-ds1>0.f && - dDOT(cross2,CONTACT(contact,ret*skip)->pos)-ds2>0.f) ++ret; -} else { - - CONTACT(contact,ret*skip)->pos[0]=contact->pos[0]-2.f*(Q2>0 ? hlz*R[1]:-hlz*R[1]); - CONTACT(contact,ret*skip)->pos[1]=contact->pos[1]-2.f*(Q2>0 ? hlz*R[5]:-hlz*R[5]); - CONTACT(contact,ret*skip)->pos[2]=contact->pos[2]-2.f*(Q2>0 ? hlz*R[9]:-hlz*R[9]); - CONTACT(contact,ret*skip)->depth=outDepth-dFabs(Q2*2.f*A2); - - if(CONTACT(contact,ret*skip)->depth>0.f) - if(dDOT(cross0,CONTACT(contact,ret*skip)->pos)-ds0>0.f && - dDOT(cross1,CONTACT(contact,ret*skip)->pos)-ds1>0.f && - dDOT(cross2,CONTACT(contact,ret*skip)->pos)-ds2>0.f) ++ret; -} - } -else if(code<7)//1-6 - { - ret=1; - contact->depth = outDepth; - switch((code-1)%3){ - case 0: - if(gl_state.test(fl_engaged_v0))RETURN0; - VxToGlClTriState(T->T->verts[0],T_array); - contact->pos[0]=v0[0]; - contact->pos[1]=v0[1]; - contact->pos[2]=v0[2]; - break; - case 1: - if(gl_state.test(fl_engaged_v1))RETURN0; - VxToGlClTriState(T->T->verts[1],T_array); - contact->pos[0]=v1[0]; - contact->pos[1]=v1[1]; - contact->pos[2]=v1[2]; - break; - case 2: - if(gl_state.test(fl_engaged_v2)) - RETURN0; - VxToGlClTriState(T->T->verts[2],T_array); - contact->pos[0]=v2[0]; - contact->pos[1]=v2[1]; - contact->pos[2]=v2[2]; - break; - } - -if(code<4){//1-3 - norm[0]=R[1]*signum; - norm[1]=R[5]*signum; - norm[2]=R[9]*signum; - } -else { - norm[0]=outAx[0]*signum; - norm[1]=outAx[1]*signum; - norm[2]=outAx[2]*signum; - } -} - -else {//7-12 - ret=1; - int iv0=(code-7)%3; - int iv1=(iv0+1)%3; - int flag=fl_engaged_s0<<(iv0); - if(gl_state.test(u8(flag&0xff))) - RETURN0; - SideToGlClTriState(T->T->verts[iv0],T->T->verts[iv1],T_array); - contact->depth = outDepth; - norm[0]=outAx[0]*signum; - norm[1]=outAx[1]*signum; - norm[2]=outAx[2]*signum; - contact->pos[0] = pos[0]; - contact->pos[1] = pos[1]; - contact->pos[2] = pos[2]; -} - - if((int)ret>maxc) ret=(unsigned int)maxc; - - for (unsigned int i=0; ig1 = const_cast (o2); - CONTACT(contact,i*skip)->g2 = const_cast (o1); - CONTACT(contact,i*skip)->normal[0] = norm[0]; - CONTACT(contact,i*skip)->normal[1] = norm[1]; - CONTACT(contact,i*skip)->normal[2] = norm[2]; - SURFACE(contact,i*skip)->mode=T->T->material; - } - if(ret&&dGeomGetUserData(o1)->callback)dGeomGetUserData(o1)->callback(T->T,contact); - return ret; -} - diff --git a/src/xrGame/tri-colliderknoopc/dTriCylinder.h b/src/xrGame/tri-colliderknoopc/dTriCylinder.h deleted file mode 100644 index ec74ceab2e5..00000000000 --- a/src/xrGame/tri-colliderknoopc/dTriCylinder.h +++ /dev/null @@ -1,27 +0,0 @@ -#ifndef D_TRI_CYLINDER_H -#define D_TRI_CYLINDER_H -#include "../dCylinder/dCylinder.h" -#include "TriPrimitiveCollideClassDef.h" -#include "dcTriListCollider.h" -struct dxCylinder { // cylinder - dReal radius,lz; // radius, length along z axis */ -}; - - - -IC float dcTriListCollider:: dCylProj(dxGeom* cylinder,const dReal* normal) -{ - VERIFY(dGeomGetClass(cylinder)== dCylinderClassUser); - float hlz,radius; - dGeomCylinderGetParams(cylinder,&radius,&hlz); - const dReal* R=dGeomGetRotation(cylinder); - hlz*=0.5f; - float cos1=dFabs(dDOT14(normal,R+1)); - cos1=cos1Collider; - -} - - - -inline bool ValidateCollision(dxGeom* o1, dxGeom* o2){ - return dGeomGetUserData(o1)->b_static_colide; - /* - dxBody* b1 = dGeomGetBody(o1); - - dxBody* b2 = dGeomGetBody(o2); - - - - if (b1){ - - if (!dBodyIsEnabled(b1)){ - - b1 = 0; - - } - - } - - if (b2){ - - if (!dBodyIsEnabled(b2)){ - - b2 = 0; - - } - - } - - return b1 || b2; - */ - //return true; -} - - - -int dCollideSTL(dxGeom* TriList, dxGeom* Sphere, int Flags, dContactGeom* Contact, int Stride) throw() -{ - - if (ValidateCollision(Sphere, TriList)){ - - return GetData(TriList)->CollideSphere(Sphere, Flags, Contact, Stride); - - } - - else return 0; - -} - - - -int dCollideBTL(dxGeom* TriList, dxGeom* Box, int Flags, dContactGeom* Contact, int Stride)throw() -{ - - if (ValidateCollision(Box, TriList)){ - - return GetData(TriList)->CollideBox(Box, Flags, Contact, Stride); - - } - - else return 0; - -} - -int dCollideCTL(dxGeom* TriList, dxGeom* Cyl, int Flags, dContactGeom* Contact, int Stride)throw() -{ - - if (ValidateCollision(Cyl, TriList)){ - - return GetData(TriList)->CollideCylinder(Cyl, Flags, Contact, Stride); - - } - - else return 0; - -} - - - -dColliderFn* dTriListColliderFn(int num) -{ - // Log("in dTriListColliderFn "); - // Msg("num=%d",num); - if (num ==dBoxClass){ - return (dColliderFn*)&dCollideBTL; - } - if (num ==dSphereClass) { - return (dColliderFn*)&dCollideSTL; - } - - if (num == dCylinderClassUser) return (dColliderFn*)&dCollideCTL; - - return 0; - -} - -int dAABBTestTL(dxGeom* TriList, dxGeom* Object, dReal AABB[6]) throw() -{ - - return 1; -} - -void dDestroyTriList(dGeomID g){ - - xr_delete(((dxTriList*)dGeomGetClassData(g))->Collider); -} - - - -/* External functions */ - -void dGeomTriListSetCallback(dGeomID g, dTriCallback* Callback){ - - dxTriList* Data = (dxTriList*)dGeomGetClassData(g); - - Data->Callback = Callback; - -} - - - -dTriCallback* dGeomTriListGetCallback(dGeomID g){ - - dxTriList* Data = (dxTriList*)dGeomGetClassData(g); - - return Data->Callback; - -} - - - -void dGeomTriListSetArrayCallback(dGeomID g, dTriArrayCallback* ArrayCallback){ - - dxTriList* Data = (dxTriList*)dGeomGetClassData(g); - - Data->ArrayCallback = ArrayCallback; - -} - - - -dTriArrayCallback* dGeomTriListGetArrayCallback(dGeomID g){ - - dxTriList* Data = (dxTriList*)dGeomGetClassData(g); - - return Data->ArrayCallback; - -} - - - -dxGeom* dCreateTriList(dSpaceID space, dTriCallback* Callback, dTriArrayCallback* ArrayCallback){ - - if (dTriListClass == -1){ - - dGeomClass c; - - c.bytes = sizeof(dxTriList); - - c.collider = &dTriListColliderFn; - - c.aabb = &dInfiniteAABB; - - c.aabb_test = &dAABBTestTL; - - // c.aabb_test=NULL; - c.dtor = &dDestroyTriList; - - - - dTriListClass = dCreateGeomClass(&c); - - } - - - - dxGeom* g = dCreateGeom(dTriListClass); - - if (space) dSpaceAdd(space, g); - - - - dxTriList* Data = (dxTriList*)dGeomGetClassData(g); - - Data->Callback = Callback; - - Data->ArrayCallback = ArrayCallback; - - Data->Collider = xr_new(g); - - - - return g; - -} - - - diff --git a/src/xrGame/tri-colliderknoopc/dTriList.h b/src/xrGame/tri-colliderknoopc/dTriList.h deleted file mode 100644 index bfbaccfdc33..00000000000 --- a/src/xrGame/tri-colliderknoopc/dTriList.h +++ /dev/null @@ -1,55 +0,0 @@ -//#include "stdafx.h" -#include "ode_include.h" - - -/* Class ID */ - -extern int dTriListClass; - - - -/* Single precision, no padding vector3 used for storage */ - -struct dcVector3{ - - float x, y, z; - -}; - - - -/* Per triangle callback */ - -typedef int dTriCallback(dGeomID TriList, dGeomID RefObject, int TriangleIndex); - -void dGeomTriListSetCallback(dGeomID g, dTriCallback* Callback); - -dTriCallback* dGeomTriListGetCallback(dGeomID g); - - - -/* Per object callback */ - -typedef void dTriArrayCallback(dGeomID TriList, dGeomID RefObject, const int* TriIndices, int TriCount); - -void dGeomTriListSetArrayCallback(dGeomID g, dTriArrayCallback* ArrayCallback); - -dTriArrayCallback* dGeomTriListGetArrayCallback(dGeomID g); - - - -/* Construction */ - -dxGeom* dCreateTriList(dSpaceID space, dTriCallback* Callback, dTriArrayCallback* ArrayCallback); - - - -/* Setting data */ - -void dGeomTriListBuild(dGeomID g, const dcVector3* Vertices, int VertexCount, const int* Indices, int IndexCount); - - - -/* Getting data */ - -void dGeomTriListGetTriangle(dGeomID g, int Index, dVector3* v0, dVector3* v1, dVector3* v2); \ No newline at end of file diff --git a/src/xrGame/tri-colliderknoopc/dTriSphere.cpp b/src/xrGame/tri-colliderknoopc/dTriSphere.cpp deleted file mode 100644 index 635af345e26..00000000000 --- a/src/xrGame/tri-colliderknoopc/dTriSphere.cpp +++ /dev/null @@ -1,254 +0,0 @@ -#include "stdafx.h" -#include "dTriColliderCommon.h" -#include "dTriColliderMath.h" -#include "dTriSphere.h" -#include "dctrilistcollider.h" -//////////////////////////////////////////////////////////////////////////// -IC dReal dcTriListCollider::PointSphereTest(const dReal* center, const dReal radius, - const dReal* pt,dReal* norm) -{ - - norm[0]=center[0]-pt[0]; - norm[1]=center[1]-pt[1]; - norm[2]=center[2]-pt[2]; - dReal mag=dSqrt(dDOT(norm,norm)); - dReal depth=radius-mag; - if(depth<0.f) return -1.f; - if(mag>0.f) - { - norm[0]/=mag;norm[1]/=mag;norm[2]/=mag; - } - else - { - norm[0]=0;norm[1]=1;norm[2]=0; - } - return depth; - -} - - -inline dReal dcTriListCollider::FragmentonSphereTest(const dReal* center, const dReal radius, - const dReal* pt1, const dReal* pt2,dReal* norm) -{ - dVector3 direction={pt2[0]-pt1[0],pt2[1]-pt1[1],pt2[2]-pt1[2]}; - cast_fv(direction).normalize(); - dReal center_prg=dDOT(center,direction); - dReal pt1_prg=dDOT(pt1,direction); - dReal pt2_prg=dDOT(pt2,direction); - dReal from1_dist=center_prg-pt1_prg; - if(center_prgpt2_prg) return -1; - dVector3 line_to_center={ - -pt1[0]-direction[0]*from1_dist+center[0], - -pt1[1]-direction[1]*from1_dist+center[1], - -pt1[2]-direction[2]*from1_dist+center[2] - }; - - float mag=dSqrt(dDOT(line_to_center,line_to_center)); - //dNormalize3(norm); - - - dReal depth=radius-mag; - if(depth<0.f) return -1.f; - if(mag>0.f) - { - norm[0]=line_to_center[0]/mag; - norm[1]=line_to_center[1]/mag; - norm[2]=line_to_center[2]/mag; - } - else - { - norm[0]=0; - norm[1]=1; - norm[2]=0; - } - return depth; -} - - -/////////////////////////////////////////////////////////////////////////////// -IC bool dcTriListCollider::FragmentonSphereTest(const dReal* center, const dReal radius, - const dReal* pt1, const dReal* pt2,dReal* norm,dReal& depth) -{ - dVector3 V={pt2[0]-pt1[0],pt2[1]-pt1[1],pt2[2]-pt1[2]}; - dVector3 L={pt1[0]-center[0],pt1[1]-center[1],pt1[2]-center[2]}; - dReal sq_mag_V=dDOT(V,V); - dReal dot_L_V=dDOT(L,V); - dReal t=-dot_L_V/sq_mag_V;//t - if(t<0.f||t>1.f)return false; - dVector3 Pc={pt1[0]+t*V[0],pt1[1]+t*V[1],pt1[2]+t*V[2]}; - dVector3 Dc={center[0]-Pc[0],center[1]-Pc[1],center[2]-Pc[2]}; - dReal sq_mag_Dc=dDOT(Dc,Dc); - if(sq_mag_Dc>radius*radius)return false; - //dReal dot_V_Pc=dDOT(V,Pc); - //if(dDOT(V,pt1)>dot_V_Pc||dDOT(V,pt2)0.f) - { - norm[0]=Dc[0]/mag; - norm[1]=Dc[1]/mag; - norm[2]=Dc[2]/mag; - } - else - { - norm[0]=0; - norm[1]=1; - norm[2]=0; - } - return true; -} - -IC bool dcTriListCollider:: PointSphereTest(const dReal* center, const dReal radius, - const dReal* pt,dReal* norm,dReal &depth) -{ - - norm[0]=center[0]-pt[0]; - norm[1]=center[1]-pt[1]; - norm[2]=center[2]-pt[2]; - dReal smag=dDOT(norm,norm); - if(smag >radius*radius)return false; - float mag=dSqrt(smag); - depth=radius-mag; - if(mag>0.f) - { - norm[0]/=mag;norm[1]/=mag;norm[2]/=mag; - } - else - { - norm[0]=0;norm[1]=1;norm[2]=0; - } - return true; - -} -///////////////////////////////////////////////////////////////////////////// -////////////////////////////////////////////////////////////////////////////// -int dcTriListCollider::dSortedTriSphere(const dReal* /**v1/**/,const dReal* /**v2/**/, - const dReal* triAx, - CDB::TRI* T, - dReal dist, - dxGeom* Sphere, - dxGeom* Geometry, - int Flags, - dContactGeom* Contacts, - int skip - ){ - - - //const dReal* v1=(dReal*)T->verts[1]; - //const dReal* v2=(dReal*)T->verts[2]; - const dReal* SphereCenter=dGeomGetPosition(Sphere); - const float SphereRadius = dGeomSphereGetRadius(Sphere); - - - - // dNormalize3(triAx); - const dReal *ContactNormal=triAx;//{triAx[0],triAx[1],triAx[2]}; - dVector3 ContactPos={SphereCenter[0]-triAx[0]* SphereRadius,SphereCenter[1]-triAx[1]* SphereRadius,SphereCenter[2]-triAx[2]* SphereRadius}; - - float ContactDepth= -dist + SphereRadius; - if (ContactDepth >= 0){ - - Contacts->normal[0] =-ContactNormal[0]; - Contacts->normal[1] =-ContactNormal[1]; - Contacts->normal[2] =-ContactNormal[2]; - Contacts->depth = ContactDepth; - //////////////////// - - Contacts->pos[0]=ContactPos[0]; - Contacts->pos[1]=ContactPos[1]; - Contacts->pos[2]=ContactPos[2]; - Contacts->g1 = Geometry; - Contacts->g2 = Sphere; - ((dxGeomUserData*)dGeomGetData(Sphere))->tri_material=T->material; - if(dGeomGetUserData(Sphere)->callback)dGeomGetUserData(Sphere)->callback(T,Contacts); - SURFACE(Contacts,0)->mode=T->material; - ////////////////////////////////// - return 1; - - } - - return 0; - } - - -int dcTriListCollider::dTriSphere(const dReal* v0,const dReal* v1,const dReal* v2, - Triangle* T, - dxGeom* Sphere,dxGeom* Geometry, int Flags, - dContactGeom* Contacts,int /**skip/**/) - { - - - const dVector3 &triSideAx0 =T->side0 ; - const dVector3 &triSideAx1 =T->side1 ; - const dVector3 &triAx =T->norm ; - - //if(!TriPlaneContainPoint(triAx,v0,SphereCenter)) return 0; - - - const dReal radius=dGeomSphereGetRadius(Sphere); - float Depth=-T->dist+radius; - if(Depth<0.f) return 0; - const dReal* pos=dGeomGetPosition(Sphere); - dVector3 ContactNormal; - if(TriContainPoint(v0,v1,v2,triAx,triSideAx0,triSideAx1,pos)) - { - ContactNormal[0]=triAx[0];ContactNormal[1]=triAx[1];ContactNormal[2]=triAx[2]; - //dVector3 ContactPos={pos[0]-triAx[0]* radius,pos[1]-triAx[1]* radius,pos[2]-triAx[2]* radius}; - } - else - { - CDB::TRI* T_array = Level().ObjectSpace.GetStaticTris(); - flags8& gl_state=gl_cl_tries_state[I-B]; - if(gl_state.test(fl_engaged_s0)||gl_state.test(fl_engaged_s1)||gl_state.test(fl_engaged_s2)) - return 0; - if(FragmentonSphereTest(pos,radius,v0,v1,ContactNormal,Depth)) - { - SideToGlClTriState(T->T->verts[0],T->T->verts[1],T_array); - } - else if(FragmentonSphereTest(pos,radius,v1,v2,ContactNormal,Depth)) - { - SideToGlClTriState(T->T->verts[1],T->T->verts[2],T_array ); - } - else if(FragmentonSphereTest(pos,radius,v2,v0,ContactNormal,Depth)) - { - SideToGlClTriState(T->T->verts[2],T->T->verts[0],T_array ); - } - else{ - if(gl_state.test(fl_engaged_v0)||gl_state.test(fl_engaged_v1)||gl_state.test(fl_engaged_v2)) - return 0; - if(PointSphereTest(pos,radius,v0,ContactNormal,Depth)) - { - VxToGlClTriState(T->T->verts[0],T_array ); - } - else if(PointSphereTest(pos,radius,v1,ContactNormal,Depth)) - { - VxToGlClTriState(T->T->verts[1],T_array ); - } - else if(PointSphereTest(pos,radius,v2,ContactNormal,Depth)) - { - VxToGlClTriState(T->T->verts[2],T_array ); - } - else return 0; - } - } - - Contacts->normal[0] =-ContactNormal[0]; - Contacts->normal[1] =-ContactNormal[1]; - Contacts->normal[2] =-ContactNormal[2]; - Contacts->depth = Depth; - //////////////////// - - Contacts->pos[0]=pos[0]-ContactNormal[0]*radius; - Contacts->pos[1]=pos[1]-ContactNormal[1]*radius; - Contacts->pos[2]=pos[2]-ContactNormal[2]*radius; - Contacts->g1 = Geometry; - Contacts->g2 = Sphere; - ((dxGeomUserData*)dGeomGetData(Sphere))->tri_material=T->T->material; - if(dGeomGetUserData(Sphere)->callback)dGeomGetUserData(Sphere)->callback(T->T,Contacts); - SURFACE(Contacts,0)->mode=T->T->material; - ////////////////////////////////// - // ++OutTriCount; - return 1; - } - diff --git a/src/xrGame/tri-colliderknoopc/dTriSphere.h b/src/xrGame/tri-colliderknoopc/dTriSphere.h deleted file mode 100644 index a3be876c595..00000000000 --- a/src/xrGame/tri-colliderknoopc/dTriSphere.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef D_TRI_SPHERE_H -#define D_TRI_SPHERE_H -#include "TriPrimitiveCollideClassDef.h" -#include "../MathUtils.h" - - - - -#endif \ No newline at end of file diff --git a/src/xrGame/tri-colliderknoopc/dcTriListCollider.cpp b/src/xrGame/tri-colliderknoopc/dcTriListCollider.cpp deleted file mode 100644 index ee22579c6b1..00000000000 --- a/src/xrGame/tri-colliderknoopc/dcTriListCollider.cpp +++ /dev/null @@ -1,132 +0,0 @@ -// Do NOT build this file seperately. It is included in dTriList.cpp automatically. - - -#include "../../xrEngine/cl_intersect.h" -#include "dTriCollideK.h" -#include "dSortTriPrimitive.h" -#include "../dCylinder/dCylinder.h" -#include "../MathUtils.h" -#include "../level.h" -#ifdef DEBUG -#include "../phdebug.h" -#endif - -dcTriListCollider::dcTriListCollider(dxGeom* Geometry) -{ - this->Geometry = Geometry; - GeomData = (dxTriList*)dGeomGetClassData(Geometry); - - -} - -dcTriListCollider::~dcTriListCollider() -{ - -} - -int dCollideBP (const dxGeom* o1, const dxGeom* o2, int flags, dContactGeom *contact, int skip); // ODE internal function - - - -#define CONTACT(Ptr, Stride) ((dContactGeom*) (((byte*)Ptr) + (Stride))) -#define SURFACE(Ptr, Stride) ((dSurfaceParameters*) (((byte*)Ptr) + (Stride-sizeof(dSurfaceParameters)))) - -int dcTriListCollider::CollideBox(dxGeom* Box, int Flags, dContactGeom* Contacts, int Stride) -{ - Fvector AABB; - dVector3 BoxSides; - dGeomBoxGetLengths(Box,BoxSides); - dReal* R=const_cast(dGeomGetRotation(Box)); - AABB.x=(dFabs(BoxSides[0]*R[0])+dFabs(BoxSides[1]*R[1])+dFabs(BoxSides[2]*R[2]))/2.f +10.f*EPS_L; - AABB.y=(dFabs(BoxSides[0]*R[4])+dFabs(BoxSides[1]*R[5])+dFabs(BoxSides[2]*R[6]))/2.f +10.f*EPS_L; - AABB.z=(dFabs(BoxSides[0]*R[8])+dFabs(BoxSides[1]*R[9])+dFabs(BoxSides[2]*R[10]))/2.f+10.f*EPS_L; - dBodyID box_body=dGeomGetBody(Box); - if(box_body) { - const dReal*velocity=dBodyGetLinearVel(box_body); - AABB.x+=dFabs(velocity[0])*0.04f; - AABB.y+=dFabs(velocity[1])*0.04f; - AABB.z+=dFabs(velocity[2])*0.04f; - - } - - - BoxTri bt(*this); - return dSortTriPrimitiveCollide - (bt, - Box, - Geometry, - Flags, - Contacts, - Stride, - AABB - ); -} - - - -int dcTriListCollider::CollideCylinder(dxGeom* Cylinder, int Flags, dContactGeom* Contacts, int Stride){ - - - - Fvector AABB; - dReal CylinderRadius,CylinderLength; - - - dGeomCylinderGetParams (Cylinder, &CylinderRadius,&CylinderLength); - - dReal* R=const_cast(dGeomGetRotation(Cylinder)); - - AABB.x = REAL(0.5) * dFabs (R[1] * CylinderLength) + (_sqrt(R[0]*R[0]+R[2]*R[2]) * CylinderRadius); - - AABB.y = REAL(0.5) * dFabs (R[5] * CylinderLength) + (_sqrt(R[4]*R[4]+R[6]*R[6]) * CylinderRadius); - - AABB.z = REAL(0.5) * dFabs (R[9] * CylinderLength) + (_sqrt(R[8]*R[8]+R[10]*R[10]) * CylinderRadius); - - const dReal*velocity=dBodyGetLinearVel(dGeomGetBody(Cylinder)); - AABB.x+=dFabs(velocity[0])*0.04f; - AABB.y+=dFabs(velocity[1])*0.04f; - AABB.z+=dFabs(velocity[2])*0.04f; - - CylTri ct(*this); - return dSortTriPrimitiveCollide - ( - ct, - Cylinder, - Geometry, - Flags, - Contacts, - Stride, - AABB - ); - -} - - - //////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - int dcTriListCollider::CollideSphere(dxGeom* Sphere, int Flags, dContactGeom* Contacts, int Stride){ - - const float SphereRadius = dGeomSphereGetRadius(Sphere); - Fvector AABB; - - - // Make AABB - AABB.x=SphereRadius; - AABB.y=SphereRadius; - AABB.z=SphereRadius; - - const dReal*velocity=dBodyGetLinearVel(dGeomGetBody(Sphere)); - AABB.x+=dFabs(velocity[0])*0.04f; - AABB.y+=dFabs(velocity[1])*0.04f; - AABB.z+=dFabs(velocity[2])*0.04f; - SphereTri st(*this); - return dSortTriPrimitiveCollide(st,Sphere,Geometry,Flags,Contacts,Stride, - AABB); - - } - - - - - diff --git a/src/xrGame/tri-colliderknoopc/dcTriListCollider.h b/src/xrGame/tri-colliderknoopc/dcTriListCollider.h deleted file mode 100644 index f131ef231b9..00000000000 --- a/src/xrGame/tri-colliderknoopc/dcTriListCollider.h +++ /dev/null @@ -1,162 +0,0 @@ -//#include "stdafx.h" -#ifndef __DCTRILISTCOLLIDER_INCLUDED__ -#define __DCTRILISTCOLLIDER_INCLUDED__ -#include "dcTriangle.h" -struct dxGeom; -struct dxTriList; -enum{ - fl_engaged_v0 =1<<0, - fl_engaged_v1 =1<<1, - fl_engaged_v2 =1<<2, - fl_engaged_s0 =1<<3, - fl_engaged_s1 =1<<4, - fl_engaged_s2 =1<<5, -}; -class dcTriListCollider; -class dcTriListCollider -{ - dxGeom* Geometry; // The geom object - dxTriList* GeomData; // Buffered pointer to classdata - - xr_vector pos_tries ; - xr_vector neg_tries ; - xr_vector< flags8 > gl_cl_tries_state ; - xr_vector::iterator I,E,B ; -public: - dcTriListCollider(dxGeom* Geometry); - ~dcTriListCollider(); - int CollideBox(dxGeom* Box, int Flags, dContactGeom* Contact, int Stride); - int CollideSphere(dxGeom* Sphere, int Flags, dContactGeom* Contact, int Stride); - int CollideCylinder(dxGeom* Cylinder, int Flags, dContactGeom* Contacts, int Stride); -private: - IC void VxToGlClTriState(u32 v,CDB::TRI* T_array); - IC void SideToGlClTriState(u32 v0,u32 v1,CDB::TRI* T_array); - template -IC int dSortTriPrimitiveCollide (T primitive, - dxGeom *o1, dxGeom *o2, - int flags, dContactGeom *contact, int skip, - const Fvector& AABB - ); - IC dReal PointSphereTest(const dReal* center, const dReal radius, - const dReal* pt,dReal* norm); - IC dReal FragmentonSphereTest(const dReal* center, const dReal radius, - const dReal* pt1, const dReal* pt2,dReal* norm); - IC bool FragmentonSphereTest(const dReal* center, const dReal radius, - const dReal* pt1, const dReal* pt2,dReal* norm,dReal& depth); - IC bool PointSphereTest(const dReal* center, const dReal radius, - const dReal* pt,dReal* norm,dReal &depth); - int dSortedTriSphere(const dReal* /**v1/**/,const dReal* /**v2/**/, - const dReal* triAx, - CDB::TRI* T, - dReal dist, - dxGeom* Sphere, - dxGeom* Geometry, - int Flags, - dContactGeom* Contacts, - int skip - ); -IC float dSphereProj(dxGeom* sphere,const dReal* /**normal/**/) - { - VERIFY (dGeomGetClass(sphere)== dSphereClass); - return dGeomSphereGetRadius(sphere); - } -int dTriSphere(const dReal* v0,const dReal* v1,const dReal* v2, - Triangle* T, - dxGeom* Sphere,dxGeom* Geometry, int Flags, - dContactGeom* Contacts,int /**skip/**/); -IC float dBoxProj(dxGeom* box,const dReal* normal); -IC void CrossProjLine(const dReal* pt1,const dReal* vc1,const dReal* pt2,const dReal* vc2,dReal* proj); -IC void CrossProjLine1(const dReal* pt1,const dReal* vc1,const dReal* pt2,const dReal* vc2,dReal* proj); -IC bool CrossProjLine14(const dReal* pt1,const dReal* vc1,const dReal* pt2,const dReal* vc2,dReal hside,dReal* proj); -IC bool IsPtInBx(const dReal* Pt,const dReal* BxP,const dReal* BxEx,const dReal* BxR); -IC dReal FragmentonBoxTest(const dReal* Pt1,const dReal* Pt2,const dReal* BxP,const dReal* BxEx,const dReal* R,dReal* norm,dReal* pos); - int dSortedTriBox ( - const dReal* triSideAx0,const dReal* triSideAx1, - const dReal* triAx, - //const dReal* v0, - //const dReal* v1, - //const dReal* v2, - CDB::TRI* T, - dReal dist, - dxGeom *o1, dxGeom *o2, - int flags, dContactGeom *contact, int skip - ); -int dTriBox ( - const dReal* v0,const dReal* v1,const dReal* v2, - Triangle* T, - dxGeom *o1, dxGeom *o2, - int flags, dContactGeom *contact, int skip - ); -IC bool circleLineIntersection(const dReal* cn,const dReal* cp,dReal r,const dReal* lv,const dReal* lp,dReal sign,dVector3 point); -IC float dCylProj(dxGeom* cylinder,const dReal* normal); - int dSortedTriCyl ( - const dReal* triSideAx0,const dReal* triSideAx1, - const dReal* triAx, - //const dReal* v0, - //const dReal* v1, - //const dReal* v2, - CDB::TRI* T, - dReal dist, - dxGeom *o1, dxGeom *o2, - int flags, dContactGeom *contact, int skip - ); - int dTriCyl ( - const dReal* v0,const dReal* v1,const dReal* v2, - Triangle* T, - dxGeom *o1, dxGeom *o2, - int flags, dContactGeom *contact, int skip - ); -IC bool cylinderCrossesLine(const dReal* p,const dReal* R,dReal hlz, - const dReal* v0,const dReal* v1,const dReal* l,dVector3 pos); -IC float Proj (dxGeom* o,const dReal* normal); -IC int Collide( - const dReal* v0,const dReal* v1,const dReal* v2, - Triangle* T, - dxGeom *o1,dxGeom *o2, - int flags, dContactGeom *contact, int skip - ); -IC int CollidePlain( - const dReal* triSideAx0,const dReal* triSideAx1, - const dReal* triAx, - CDB::TRI* T, - dReal dist, - dxGeom *o1, dxGeom *o2, - int flags, dContactGeom *contact, int skip - ); -TRI_PRIMITIVE_COLIDE_CLASS_DECLARE(Cyl) -TRI_PRIMITIVE_COLIDE_CLASS_DECLARE(Sphere) -TRI_PRIMITIVE_COLIDE_CLASS_DECLARE(Box) -}; - -TRI_PRIMITIVE_COLIDE_CLASS_IMPLEMENT(Box) -TRI_PRIMITIVE_COLIDE_CLASS_IMPLEMENT(Cyl) - TRI_PRIMITIVE_COLIDE_CLASS_IMPLEMENT(Sphere) -IC void dcTriListCollider::VxToGlClTriState(u32 v,CDB::TRI* T_array) -{ - //CDB::TRI* T_array = Level().ObjectSpace.GetStaticTris(); - xr_vector::iterator LI=I+1; - for(;E!=LI;++LI) - { - u32* verts=T_array[*LI].verts; - flags8 &state =gl_cl_tries_state[LI-B]; - if(verts[0]==v)state.set(fl_engaged_v0,TRUE); - if(verts[1]==v)state.set(fl_engaged_v1,TRUE); - if(verts[2]==v)state.set(fl_engaged_v2,TRUE); - } -} -IC void dcTriListCollider::SideToGlClTriState(u32 v0,u32 v1,CDB::TRI* T_array) -{ - // = Level().ObjectSpace.GetStaticTris(); - xr_vector::iterator LI=I+1; - for(;E!=LI;++LI) - { - u32* verts=T_array[*LI].verts; - flags8 &state =gl_cl_tries_state[LI-B]; - if(verts[0]==v1&&verts[1]==v0)state.set(fl_engaged_s0,TRUE); - if(verts[1]==v1&&verts[2]==v0)state.set(fl_engaged_s1,TRUE); - if(verts[2]==v1&&verts[0]==v0)state.set(fl_engaged_s2,TRUE); - } -} - - -#endif //__DCTRILISTCOLLIDER_INCLUDED__( \ No newline at end of file diff --git a/src/xrGame/tri-colliderknoopc/dcTriangle.h b/src/xrGame/tri-colliderknoopc/dcTriangle.h deleted file mode 100644 index 2fa2128560e..00000000000 --- a/src/xrGame/tri-colliderknoopc/dcTriangle.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -struct Triangle -{ - //dReal* v0; - //dReal* v1; - //dReal* v2; - dVector3 side0; - dVector3 side1; - dVector3 norm; - dReal dist; - dReal pos; - dReal depth; - CDB::TRI* T ; - Triangle() - { - T =NULL; -#ifdef DEBUG - depth =-dInfinity; - dist =-dInfinity; -#endif - } -}; \ No newline at end of file diff --git a/src/xrGame/tri-colliderknoopc/dxTriList.h b/src/xrGame/tri-colliderknoopc/dxTriList.h deleted file mode 100644 index ac06b96d977..00000000000 --- a/src/xrGame/tri-colliderknoopc/dxTriList.h +++ /dev/null @@ -1,475 +0,0 @@ -//#include "stdafx.h" -#ifndef __DXTRILIST_INCLUDED__ - -#define __DXTRILIST_INCLUDED__ - - -#include "../ode_include.h" - - - - -struct dcVector3{ - - float x, y, z; - - - - dcVector3(){} - - dcVector3(dReal x, dReal y, dReal z){ - - this->x = (float)x; - - this->y = (float)y; - - this->z = (float)z; - - } - - - - dcVector3(const dReal* v){ - - x = (float)v[0]; - - y = (float)v[1]; - - z = (float)v[2]; - - } - - - - ~dcVector3(){} - - - - - operator float* (){ //&slipch - - return reinterpret_cast(this); - } - /* Add */ - - dcVector3 operator+(const dcVector3& v) const{ - - dcVector3 Out; - - Out.x = x + v.x; - - Out.y = y + v.y; - - Out.z = z + v.z; - - return Out; - - } - - - - dcVector3& operator+=(const dcVector3& v){ - - x += v.x; - - y += v.y; - - z += v.z; - - return *this; - - } - - - - /* Sub */ - - dcVector3 operator-(const dcVector3& v) const{ - - dcVector3 Out; - - Out.x = x - v.x; - - Out.y = y - v.y; - - Out.z = z - v.z; - - return Out; - - } - - - - dcVector3& operator-=(const dcVector3& v){ - - x -= v.x; - - y -= v.y; - - z -= v.z; - - return *this; - - } - - - - /* Mul */ - - dcVector3 operator*(const dcVector3& v) const{ - - dcVector3 Out; - - Out.x = x * v.x; - - Out.y = y * v.y; - - Out.z = z * v.z; - - return Out; - - } - - - - dcVector3 operator*(float Scalar) const{ - - dcVector3 Out; - - Out.x = x * Scalar; - - Out.y = y * Scalar; - - Out.z = z * Scalar; - - return Out; - - } - - - - dcVector3& operator*=(const dcVector3& v){ - - x *= v.x; - - y *= v.y; - - z *= v.z; - - return *this; - - } - - - - dcVector3& operator*=(float Scalar){ - - x *= Scalar; - - y *= Scalar; - - z *= Scalar; - - return *this; - - } - - - - /* Div */ - - dcVector3 operator/(const dcVector3& v) const{ - - dcVector3 Out; - - Out.x = x / v.x; - - Out.y = y / v.y; - - Out.z = z / v.z; - - return Out; - - } - - - - dcVector3 operator/(float Scalar) const{ - - dcVector3 Out; - - Out.x = x / Scalar; - - Out.y = y / Scalar; - - Out.z = z / Scalar; - - return Out; - - } - - - - dcVector3& operator/=(const dcVector3& v){ - - x /= v.x; - - y /= v.y; - - z /= v.z; - - return *this; - - } - - - - dcVector3& operator/=(float Scalar){ - - x /= Scalar; - - y /= Scalar; - - z /= Scalar; - - return *this; - - } - - - - /* Negative */ - - dcVector3& operator-(){ - - x = -x; - - y = -y; - - z = -z; - - return *this; - - } - - - - /* Comparison */ - - bool operator==(const dcVector3& v) const{ - - return x == v.x && y == v.y && z == v.z; - - } - - - - bool operator!=(const dcVector3& v) const{ - - return v.x != x || v.y != y || v.z != z; - - } - - - - float DotProduct(const dcVector3& v) const{ - - return x * v.x + y * v.y + z * v.z; - - } - - - - dcVector3 CrossProduct(const dcVector3& v) const{ - - dcVector3 Out; - - Out.x = y * v.z - z * v.y; - - Out.y = z * v.x - x * v.z; - - Out.z = x * v.y - y * v.x; - - return Out; - - } - - - - float MagnitudeSq() const{ - - return DotProduct(*this); - - } - - - - float Magnitude() const{ - - return _sqrt(MagnitudeSq()); - - } - - - - void Normalize(){ - - operator/=(Magnitude()); - - } - - - - /* Member access */ - - float& operator[](int Index){ - - return *(&x + Index); - - } - - - - float operator[](int Index) const{ - - return *(&x + Index); - - } - -}; - - - - - -/* Class ID */ - -extern int dTriListClass; - - - -/* Per triangle callback */ - -typedef int dTriCallback(dGeomID TriList, dGeomID RefObject, int TriangleIndex); - -void dGeomTriListSetCallback(dGeomID g, dTriCallback* Callback); - -dTriCallback* dGeomTriListGetCallback(dGeomID g); - - - -/* Per object callback */ - -typedef void dTriArrayCallback(dGeomID TriList, dGeomID RefObject, const int* TriIndices, int TriCount); - -void dGeomTriListSetArrayCallback(dGeomID g, dTriArrayCallback* ArrayCallback); - -dTriArrayCallback* dGeomTriListGetArrayCallback(dGeomID g); - - - -/* Construction */ - -dxGeom* dCreateTriList(dSpaceID space, dTriCallback* Callback, dTriArrayCallback* ArrayCallback); - - - -/* Setting data */ - -void dGeomTriListBuild(dGeomID g, const dcVector3* Vertices, int VertexCount, const int* Indices, int IndexCount); - - - -/* Getting data */ - -void dGeomTriListGetTriangle(dGeomID g, int Index, dVector3* v0, dVector3* v1, dVector3* v2); - - - -/* Internal types */ - -class dcTriListCollider; - - - -struct dxTriList{ - - dReal p[4]; // dxPlane - - dTriCallback* Callback; - - dTriArrayCallback* ArrayCallback; - - dcTriListCollider* Collider; - -}; - - - -struct dcPlane{ - - dcVector3 Normal; - - float Distance; - - - - dcPlane(){} - - dcPlane(const dcVector3& v0, const dcVector3& v1, const dcVector3& v2){ - - dcVector3 u = v1 - v0; - - dcVector3 v = v2 - v0; - - - - Normal = u.CrossProduct(v); - - Distance = v0.DotProduct(Normal); - - Normalize(); - - } - - - - void Normalize(){ - - float Factor = 1.0f / Normal.Magnitude(); - - Normal *= Factor; - - Distance *= Factor; - - } - - - - bool Contains(const dcVector3& RefObject, float Epsilon = 0.0f) const{ - - return Normal.DotProduct(RefObject) - Distance >= - Epsilon; //@slipch ">=" instead ">" - - } - -}; - - - -template const T& dcMAX(const T& x, const T& y){ - - return x > y ? x : y; - -} - - - -template const T& dcMIN(const T& x, const T& y){ - - return x < y ? x : y; - -} - - - -#endif //__DXTRILIST_INCLUDED__ \ No newline at end of file diff --git a/src/xrGame/ui/ChangeWeatherDialog.cpp b/src/xrGame/ui/ChangeWeatherDialog.cpp index eb628982878..b9c3d5bf0ac 100644 --- a/src/xrGame/ui/ChangeWeatherDialog.cpp +++ b/src/xrGame/ui/ChangeWeatherDialog.cpp @@ -2,13 +2,13 @@ #include "ChangeWeatherDialog.hpp" #include "UIXmlInit.h" #include "UI3tButton.h" -#include "../game_cl_teamdeathmatch.h" +#include "game_cl_teamdeathmatch.h" #include "UIKickPlayer.h" #include "UIChangeMap.h" #include #include "xrEngine/XR_IOConsole.h" #include "UIMapList.h" -#include "../UIGameCustom.h" +#include "UIGameCustom.h" ButtonListDialog::ButtonListDialog() { diff --git a/src/xrGame/ui/FactionState.cpp b/src/xrGame/ui/FactionState.cpp deleted file mode 100644 index c900bba4d70..00000000000 --- a/src/xrGame/ui/FactionState.cpp +++ /dev/null @@ -1,117 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : FactionState.cpp -// Created : 22.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Faction War state class implementation -//////////////////////////////////////////////////////////////////////////// - -#include "pch_script.h" -/* -#include "FactionState.h" - -#include "../actor.h" -#include "../character_community.h" -#include "../character_reputation.h" -#include "../relation_registry.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" - -using namespace luabind; - -FactionState::FactionState(): - member_count(0), - resource(0.0f), - power(0.0f), - m_actor_goodwill(0) -{ - m_id._set ( NULL ); - m_name._set ( NULL ); - m_icon._set ( NULL ); - m_icon_big._set ( NULL ); - m_target._set ( NULL ); - m_target_desc._set( NULL ); - m_location._set ( NULL ); - - ResetStates(); -} - -FactionState::FactionState( shared_str const& id ) -{ - FactionState(); - set_faction_id2( id ); -} - -FactionState::~FactionState() -{ -} - -void FactionState::ResetStates() -{ - for ( int i = 0; i < war_state_count ; ++i ) - { - m_war_state_str[i]._set( NULL ); - m_war_state_hint_str[i]._set( NULL ); - } - //for ( int i = 0; i < bonuses_count ; ++i ) - //{ - //bonuses_vs[i]._set( NULL ); - //} -} - -#pragma optimize("s",on) -void FactionState::script_register( lua_State* L ) -{ - module(L) - [ - class_("FactionState") - .def_readwrite( "member_count", &FactionState::member_count ) - .def_readwrite( "resource", &FactionState::resource ) - .def_readwrite( "power", &FactionState::power ) - .def_readwrite( "bonus", &FactionState::bonus ) - - .property( "faction_id", &FactionState::get_faction_id, &FactionState::set_faction_id ) - .property( "actor_goodwill", &FactionState::get_actor_goodwill,&FactionState::set_actor_goodwill ) - - .property( "name", &FactionState::get_name, &FactionState::set_name ) - .property( "icon", &FactionState::get_icon, &FactionState::set_icon ) - .property( "icon_big", &FactionState::get_icon_big, &FactionState::set_icon_big ) - .property( "target", &FactionState::get_target, &FactionState::set_target ) - .property( "target_desc", &FactionState::get_target_desc, &FactionState::set_target_desc ) - .property( "location", &FactionState::get_location, &FactionState::set_location ) - - .property( "war_state1", &FactionState::get_war_state1, &FactionState::set_war_state1 ) - .property( "war_state2", &FactionState::get_war_state2, &FactionState::set_war_state2 ) - .property( "war_state3", &FactionState::get_war_state3, &FactionState::set_war_state3 ) - .property( "war_state4", &FactionState::get_war_state4, &FactionState::set_war_state4 ) - .property( "war_state5", &FactionState::get_war_state5, &FactionState::set_war_state5 ) - - .property( "war_state_hint1", &FactionState::get_war_state_hint1, &FactionState::set_war_state_hint1 ) - .property( "war_state_hint2", &FactionState::get_war_state_hint2, &FactionState::set_war_state_hint2 ) - .property( "war_state_hint3", &FactionState::get_war_state_hint3, &FactionState::set_war_state_hint3 ) - .property( "war_state_hint4", &FactionState::get_war_state_hint4, &FactionState::set_war_state_hint4 ) - .property( "war_state_hint5", &FactionState::get_war_state_hint5, &FactionState::set_war_state_hint5 ) - ]; -} - -void FactionState::update_info() -{ - if ( m_id.size() == 0 ) - { - return; - } - m_actor_goodwill = 0; - CActor* pActor = smart_cast( Level().CurrentEntity() ); - if ( pActor ) - { - CHARACTER_COMMUNITY char_ñomm; - char_ñomm.set( m_id ); - m_actor_goodwill = RELATION_REGISTRY().GetCommunityGoodwill( char_ñomm.index(), pActor->object_id() ); - } - ResetStates(); - - luabind::functor m_functor; - R_ASSERT( ai().script_engine().functor( "pda.fill_faction_state", m_functor ) ); - m_functor( this ); -} - -*/ \ No newline at end of file diff --git a/src/xrGame/ui/FactionState.h b/src/xrGame/ui/FactionState.h deleted file mode 100644 index b54a8ac087a..00000000000 --- a/src/xrGame/ui/FactionState.h +++ /dev/null @@ -1,107 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : FactionState.h -// Created : 22.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Faction War state class -//////////////////////////////////////////////////////////////////////////// - -#pragma once -/* -#include "UIWindow.h" - -class FactionState -{ -public: - FactionState (); - FactionState ( shared_str const& id ); - ~FactionState (); - - IC int get_actor_goodwill ()const; - IC void set_actor_goodwill ( int gw ); - - IC LPCSTR get_faction_id () const; - IC shared_str const& get_faction_id2() const; - IC void set_faction_id ( LPCSTR id ); - IC void set_faction_id2 ( shared_str const& id ); - - IC LPCSTR get_name () const; - IC void set_name ( LPCSTR name ); - - IC LPCSTR get_icon () const; - IC void set_icon ( LPCSTR icon ); - - IC LPCSTR get_icon_big () const; - IC void set_icon_big ( LPCSTR icon_big ); - - IC LPCSTR get_target () const; - IC void set_target ( LPCSTR target ); - - IC LPCSTR get_target_desc () const; - IC void set_target_desc ( LPCSTR target_desc ); - - IC LPCSTR get_location () const; - IC void set_location ( LPCSTR location ); - - IC LPCSTR get_war_state ( u8 index ) const; - IC LPCSTR get_war_state_hint ( u8 index ) const; - - IC LPCSTR get_war_state1 () const; - IC void set_war_state1 ( LPCSTR icon ); - IC LPCSTR get_war_state2 () const; - IC void set_war_state2 ( LPCSTR icon ); - IC LPCSTR get_war_state3 () const; - IC void set_war_state3 ( LPCSTR icon ); - IC LPCSTR get_war_state4 () const; - IC void set_war_state4 ( LPCSTR icon ); - IC LPCSTR get_war_state5 () const; - IC void set_war_state5 ( LPCSTR icon ); - - IC LPCSTR get_war_state_hint1 () const; - IC void set_war_state_hint1 ( LPCSTR icon ); - IC LPCSTR get_war_state_hint2 () const; - IC void set_war_state_hint2 ( LPCSTR icon ); - IC LPCSTR get_war_state_hint3 () const; - IC void set_war_state_hint3 ( LPCSTR icon ); - IC LPCSTR get_war_state_hint4 () const; - IC void set_war_state_hint4 ( LPCSTR icon ); - IC LPCSTR get_war_state_hint5 () const; - IC void set_war_state_hint5 ( LPCSTR icon ); - - void update_info (); - void ResetStates (); - -public: - enum { war_state_count = 5 }; - enum { bonuses_count = 6 }; - - int member_count; - float resource; - float power; - - int bonus; - //shared_str bonuses[6]; - -private: - int m_actor_goodwill; - - shared_str m_id; - shared_str m_name; - shared_str m_icon; - shared_str m_icon_big; - shared_str m_target; - shared_str m_target_desc; - shared_str m_location; - - // int state_vs; - shared_str m_war_state_str[war_state_count]; - shared_str m_war_state_hint_str[war_state_count]; - - DECLARE_SCRIPT_REGISTER_FUNCTION -}; // struct FactionState - -add_to_type_list(FactionState) -#undef script_type_list -#define script_type_list save_type_list(FactionState) - -#include "FactionState_inline.h" -*/ \ No newline at end of file diff --git a/src/xrGame/ui/FactionState_inline.h b/src/xrGame/ui/FactionState_inline.h deleted file mode 100644 index 8586f1674aa..00000000000 --- a/src/xrGame/ui/FactionState_inline.h +++ /dev/null @@ -1,118 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : FactionState_inline.h -// Created : 23.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Faction War state class -//////////////////////////////////////////////////////////////////////////// - -#pragma once - -int FactionState::get_actor_goodwill() const -{ - return m_actor_goodwill; -} -void FactionState::set_actor_goodwill( int gw ) -{ - m_actor_goodwill = gw; -} -LPCSTR FactionState::get_faction_id() const -{ - return m_id.c_str(); -} -shared_str const& FactionState::get_faction_id2() const -{ - return m_id; -} -void FactionState::set_faction_id( LPCSTR id ) -{ - m_id._set( id ); -} -void FactionState::set_faction_id2( shared_str const& id ) -{ - m_id._set( id ); -} -LPCSTR FactionState::get_name() const -{ - return m_name.c_str(); -} -void FactionState::set_name( LPCSTR name ) -{ - m_name._set( name ); -} -LPCSTR FactionState::get_icon() const -{ - return m_icon.c_str(); -} -void FactionState::set_icon( LPCSTR icon ) -{ - m_icon._set( icon ); -} - -LPCSTR FactionState::get_icon_big() const -{ - return m_icon_big.c_str(); -} -void FactionState::set_icon_big( LPCSTR icon_b ) -{ m_icon_big._set( icon_b ); -} - -LPCSTR FactionState::get_target() const -{ - return m_target.c_str(); -} -void FactionState::set_target( LPCSTR target ) -{ - m_target._set( target ); -} - -LPCSTR FactionState::get_target_desc() const -{ - return m_target_desc.c_str(); -} -void FactionState::set_target_desc( LPCSTR target_desc ) -{ - m_target_desc._set( target_desc ); -} - -LPCSTR FactionState::get_location() const -{ - return m_location.c_str(); -} -void FactionState::set_location( LPCSTR location ) -{ - m_location._set( location ); -} - -LPCSTR FactionState::get_war_state( u8 index ) const -{ - VERIFY( 0 <= index && index < war_state_count ); - return m_war_state_str[index].c_str(); -} - -LPCSTR FactionState::get_war_state_hint( u8 index ) const -{ - VERIFY( 0 <= index && index < war_state_count ); - return m_war_state_hint_str[index].c_str(); -} - -LPCSTR FactionState::get_war_state1() const { return m_war_state_str[0].c_str(); } -void FactionState::set_war_state1( LPCSTR icon ) { m_war_state_str[0]._set( icon );} -LPCSTR FactionState::get_war_state2() const { return m_war_state_str[1].c_str(); } -void FactionState::set_war_state2( LPCSTR icon ) { m_war_state_str[1]._set( icon );} -LPCSTR FactionState::get_war_state3() const { return m_war_state_str[2].c_str(); } -void FactionState::set_war_state3( LPCSTR icon ) { m_war_state_str[2]._set( icon );} -LPCSTR FactionState::get_war_state4() const { return m_war_state_str[3].c_str(); } -void FactionState::set_war_state4( LPCSTR icon ) { m_war_state_str[3]._set( icon );} -LPCSTR FactionState::get_war_state5() const { return m_war_state_str[4].c_str(); } -void FactionState::set_war_state5( LPCSTR icon ) { m_war_state_str[4]._set( icon );} - -LPCSTR FactionState::get_war_state_hint1() const { return m_war_state_hint_str[0].c_str(); } -void FactionState::set_war_state_hint1( LPCSTR text ) { m_war_state_hint_str[0]._set( text );} -LPCSTR FactionState::get_war_state_hint2() const { return m_war_state_hint_str[1].c_str(); } -void FactionState::set_war_state_hint2( LPCSTR text ) { m_war_state_hint_str[1]._set( text );} -LPCSTR FactionState::get_war_state_hint3() const { return m_war_state_hint_str[2].c_str(); } -void FactionState::set_war_state_hint3( LPCSTR text ) { m_war_state_hint_str[2]._set( text );} -LPCSTR FactionState::get_war_state_hint4() const { return m_war_state_hint_str[3].c_str(); } -void FactionState::set_war_state_hint4( LPCSTR text ) { m_war_state_hint_str[3]._set( text );} -LPCSTR FactionState::get_war_state_hint5() const { return m_war_state_hint_str[4].c_str(); } -void FactionState::set_war_state_hint5( LPCSTR text ) { m_war_state_hint_str[4]._set( text );} diff --git a/src/xrGame/ui/FractionState.cpp b/src/xrGame/ui/FractionState.cpp deleted file mode 100644 index 13de50d23f9..00000000000 --- a/src/xrGame/ui/FractionState.cpp +++ /dev/null @@ -1,90 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : FractionState.cpp -// Created : 22.01.2008 -// Modified : 23.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Fraction War state class implementation -//////////////////////////////////////////////////////////////////////////// - -#include "pch_script.h" -#include "FractionState.h" - -#include "../actor.h" -#include "../character_community.h" -#include "../character_reputation.h" -#include "../relation_registry.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" - -using namespace luabind; - -FractionState::FractionState(): - member_count(0), - resource(0.0f), - power(0.0f), - state_vs(0), - m_actor_goodwill(0) -{ - m_id._set ( NULL ); - m_name._set ( NULL ); - m_icon._set ( NULL ); - m_icon_big._set ( NULL ); - m_target._set ( NULL ); - m_target_desc._set( NULL ); - m_location._set ( NULL ); -} - -FractionState::FractionState( shared_str const& id ) -{ - FractionState(); - set_fraction_id2( id ); -} - -FractionState::~FractionState() -{ -} - -#pragma optimize("s",on) -void FractionState::script_register( lua_State* L ) -{ - module(L) - [ - class_("FractionState") - .def_readwrite( "member_count", &FractionState::member_count ) - .def_readwrite( "resource", &FractionState::resource ) - .def_readwrite( "power", &FractionState::power ) - .def_readwrite( "state_vs", &FractionState::state_vs ) - .def_readwrite( "bonus", &FractionState::bonus ) - - .property( "fraction_id", &FractionState::get_fraction_id, &FractionState::set_fraction_id ) - .property( "actor_goodwill", &FractionState::get_actor_goodwill,&FractionState::set_actor_goodwill ) - - .property( "name", &FractionState::get_name, &FractionState::set_name ) - .property( "icon", &FractionState::get_icon, &FractionState::set_icon ) - .property( "icon_big", &FractionState::get_icon_big, &FractionState::set_icon_big ) - .property( "target", &FractionState::get_target, &FractionState::set_target ) - .property( "target_desc", &FractionState::get_target_desc, &FractionState::set_target_desc ) - .property( "location", &FractionState::get_location, &FractionState::set_location ) - - ]; -} - -void FractionState::update_info() -{ - if ( m_id.size() == 0 ) - { - return; - } - m_actor_goodwill = 0; - CActor* pActor = smart_cast( Level().CurrentEntity() ); - if ( pActor ) - { - CHARACTER_COMMUNITY char_ñmm; - char_ñmm.set( m_id ); - m_actor_goodwill = RELATION_REGISTRY().GetCommunityGoodwill( char_ñmm.index(), pActor->object_id() ); - } - - luabind::functor m_functor; - R_ASSERT( ai().script_engine().functor( "pda.fill_fraction_state", m_functor ) ); - m_functor( this ); -} diff --git a/src/xrGame/ui/FractionState.h b/src/xrGame/ui/FractionState.h deleted file mode 100644 index fedb3025ab5..00000000000 --- a/src/xrGame/ui/FractionState.h +++ /dev/null @@ -1,72 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : FractionState.h -// Created : 22.01.2008 -// Modified : 22.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Fraction War state class -//////////////////////////////////////////////////////////////////////////// - -#pragma once -#include "UIWindow.h" - -class FractionState -{ -public: - FractionState (); - FractionState ( shared_str const& id ); - ~FractionState (); - - IC int get_actor_goodwill ()const; - IC void set_actor_goodwill ( int gw ); - - IC LPCSTR get_fraction_id () const; - IC void set_fraction_id ( LPCSTR id ); - IC void set_fraction_id2 ( shared_str const& id ); - - IC LPCSTR get_name () const; - IC void set_name ( LPCSTR name ); - - IC LPCSTR get_icon () const; - IC void set_icon ( LPCSTR icon ); - - IC LPCSTR get_icon_big () const; - IC void set_icon_big ( LPCSTR icon_big ); - - IC LPCSTR get_target () const; - IC void set_target ( LPCSTR target ); - - IC LPCSTR get_target_desc () const; - IC void set_target_desc ( LPCSTR target_desc ); - - IC LPCSTR get_location () const; - IC void set_location ( LPCSTR location ); - - void update_info (); - -public: - int member_count; - float resource; - float power; - int state_vs; - int bonus; - //shared_str bonuses[6]; //int[6] - -private: - int m_actor_goodwill; - - shared_str m_id; - shared_str m_name; - shared_str m_icon; - shared_str m_icon_big; - shared_str m_target; - shared_str m_target_desc; - shared_str m_location; - - DECLARE_SCRIPT_REGISTER_FUNCTION -}; // struct FractionState - -add_to_type_list(FractionState) -#undef script_type_list -#define script_type_list save_type_list(FractionState) - -#include "FractionState_inline.h" diff --git a/src/xrGame/ui/FractionState_inline.h b/src/xrGame/ui/FractionState_inline.h deleted file mode 100644 index 2b735cfb91e..00000000000 --- a/src/xrGame/ui/FractionState_inline.h +++ /dev/null @@ -1,81 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : FractionState_inline.h -// Created : 23.01.2008 -// Modified : 23.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Fraction War state class -//////////////////////////////////////////////////////////////////////////// - -#pragma once - -int FractionState::get_actor_goodwill() const -{ - return m_actor_goodwill; -} -void FractionState::set_actor_goodwill( int gw ) -{ - m_actor_goodwill = gw; -} -LPCSTR FractionState::get_fraction_id() const -{ - return m_id.c_str(); -} -void FractionState::set_fraction_id( LPCSTR id ) -{ - m_id._set( id ); -} -void FractionState::set_fraction_id2( shared_str const& id ) -{ - m_id._set( id ); -} -LPCSTR FractionState::get_name() const -{ - return m_name.c_str(); -} -void FractionState::set_name( LPCSTR name ) -{ - m_name._set( name ); -} -LPCSTR FractionState::get_icon() const -{ - return m_icon.c_str(); -} -void FractionState::set_icon( LPCSTR icon ) -{ - m_icon._set( icon ); -} - -LPCSTR FractionState::get_icon_big() const -{ - return m_icon_big.c_str(); -} -void FractionState::set_icon_big( LPCSTR icon_b ) -{ m_icon_big._set( icon_b ); -} - -LPCSTR FractionState::get_target() const -{ - return m_target.c_str(); -} -void FractionState::set_target( LPCSTR target ) -{ - m_target._set( target ); -} - -LPCSTR FractionState::get_target_desc() const -{ - return m_target_desc.c_str(); -} -void FractionState::set_target_desc( LPCSTR target_desc ) -{ - m_target_desc._set( target_desc ); -} - -LPCSTR FractionState::get_location() const -{ - return m_location.c_str(); -} -void FractionState::set_location( LPCSTR location ) -{ - m_location._set( location ); -} diff --git a/src/xrGame/ui/IUWpnParams.cpp b/src/xrGame/ui/IUWpnParams.cpp deleted file mode 100644 index fb6aa9fe0c0..00000000000 --- a/src/xrGame/ui/IUWpnParams.cpp +++ /dev/null @@ -1,107 +0,0 @@ -#include "pch_script.h" -#include "UIWpnParams.h" -#include "UIXmlInit.h" -#include "../level.h" -#include "game_base_space.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" - -struct SLuaWpnParams{ - luabind::functor m_functorRPM; - luabind::functor m_functorAccuracy; - luabind::functor m_functorDamage; - luabind::functor m_functorDamageMP; - luabind::functor m_functorHandling; - SLuaWpnParams(); - ~SLuaWpnParams(); -}; - -SLuaWpnParams::SLuaWpnParams() -{ - bool functor_exists; - functor_exists = ai().script_engine().functor("ui_wpn_params.GetRPM" , m_functorRPM); VERIFY(functor_exists); - functor_exists = ai().script_engine().functor("ui_wpn_params.GetDamage" , m_functorDamage); VERIFY(functor_exists); - functor_exists = ai().script_engine().functor("ui_wpn_params.GetDamageMP" ,m_functorDamageMP); VERIFY(functor_exists); - functor_exists = ai().script_engine().functor("ui_wpn_params.GetHandling" ,m_functorHandling); VERIFY(functor_exists); - functor_exists = ai().script_engine().functor("ui_wpn_params.GetAccuracy" ,m_functorAccuracy); VERIFY(functor_exists); -} - -SLuaWpnParams::~SLuaWpnParams() -{ -} - -SLuaWpnParams* g_lua_wpn_params = NULL; - -void destroy_lua_wpn_params() -{ - if(g_lua_wpn_params) - xr_delete(g_lua_wpn_params); -} - -CUIWpnParams::CUIWpnParams(){ - AttachChild(&m_textAccuracy); - AttachChild(&m_textDamage); - AttachChild(&m_textHandling); - AttachChild(&m_textRPM); - - AttachChild(&m_progressAccuracy); - AttachChild(&m_progressDamage); - AttachChild(&m_progressHandling); - AttachChild(&m_progressRPM); -} - -CUIWpnParams::~CUIWpnParams() -{ -} - -void CUIWpnParams::InitFromXml(CUIXml& xml_doc){ - if (!xml_doc.NavigateToNode("wpn_params", 0)) return; - CUIXmlInit::InitWindow (xml_doc, "wpn_params", 0, this); - - CUIXmlInit::InitStatic (xml_doc, "wpn_params:cap_accuracy", 0, &m_textAccuracy); - CUIXmlInit::InitStatic (xml_doc, "wpn_params:cap_damage", 0, &m_textDamage); - CUIXmlInit::InitStatic (xml_doc, "wpn_params:cap_handling", 0, &m_textHandling); - CUIXmlInit::InitStatic (xml_doc, "wpn_params:cap_rpm", 0, &m_textRPM); - - CUIXmlInit::InitProgressBar (xml_doc, "wpn_params:progress_accuracy", 0, &m_progressAccuracy); - CUIXmlInit::InitProgressBar (xml_doc, "wpn_params:progress_damage", 0, &m_progressDamage); - CUIXmlInit::InitProgressBar (xml_doc, "wpn_params:progress_handling", 0, &m_progressHandling); - CUIXmlInit::InitProgressBar (xml_doc, "wpn_params:progress_rpm", 0, &m_progressRPM); - - m_progressAccuracy.SetRange (0, 100); - m_progressDamage.SetRange (0, 100); - m_progressHandling.SetRange (0, 100); - m_progressRPM.SetRange (0, 100); - -} - -void CUIWpnParams::SetInfo(const shared_str& wpn_section) -{ - - if(!g_lua_wpn_params) - g_lua_wpn_params = xr_new(); - - m_progressRPM.SetProgressPos (g_lua_wpn_params->m_functorRPM(*wpn_section)); - m_progressAccuracy.SetProgressPos (g_lua_wpn_params->m_functorAccuracy(*wpn_section)); - if (GameID() == GAME_SINGLE) - m_progressDamage.SetProgressPos (g_lua_wpn_params->m_functorDamage(*wpn_section)); - else - m_progressDamage.SetProgressPos (g_lua_wpn_params->m_functorDamageMP(*wpn_section)); - m_progressHandling.SetProgressPos (g_lua_wpn_params->m_functorHandling(*wpn_section)); -} - -bool CUIWpnParams::Check(const shared_str& wpn_section){ - if (pSettings->line_exist(wpn_section, "fire_dispersion_base")) - { - if (0==xr_strcmp(wpn_section, "wpn_addon_silencer")) - return false; - if (0==xr_strcmp(wpn_section, "wpn_binoc")) - return false; - if (0==xr_strcmp(wpn_section, "mp_wpn_binoc")) - return false; - - return true; - } - else - return false; -} \ No newline at end of file diff --git a/src/xrGame/ui/Restrictions.cpp b/src/xrGame/ui/Restrictions.cpp index f8122413620..076f6f01d78 100644 --- a/src/xrGame/ui/Restrictions.cpp +++ b/src/xrGame/ui/Restrictions.cpp @@ -2,10 +2,10 @@ #include "Restrictions.h" #ifdef DEBUG -# include "../../xrEngine/xr_ioconsole.h" -# include "../../xrEngine/xr_ioc_cmd.h" +# include "xrEngine/xr_ioconsole.h" +# include "xrEngine/xr_ioc_cmd.h" #endif //#ifdef DEBUG -#include "../string_table.h" +#include "string_table.h" CRestrictions g_mp_restrictions; shared_str g_ranks[_RANK_COUNT]; diff --git a/src/xrGame/ui/ServerList.cpp b/src/xrGame/ui/ServerList.cpp index 9877227701a..a46ad560827 100644 --- a/src/xrGame/ui/ServerList.cpp +++ b/src/xrGame/ui/ServerList.cpp @@ -1,17 +1,16 @@ #include "StdAfx.h" #include "ServerList.h" #include "UIXmlInit.h" -#include "../string_table.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "string_table.h" +#include "xrEngine/xr_ioconsole.h" #include "UIEditBox.h" #include "UIMessageBoxEx.h" #include "UIMessageBox.h" #include "TeamInfo.h" -#include "../MainMenu.h" -#include "../login_manager.h" -#include "../GameSpy/GameSpy_Full.h" -#include "../GameSpy/GameSpy_Browser.h" - +#include "MainMenu.h" +#include "login_manager.h" +#include "GameSpy/GameSpy_Full.h" +#include "GameSpy/GameSpy_Browser.h" LPCSTR GameTypeToString(EGameIDs gt, bool bShort); CGameSpy_Browser* g_gs_browser = NULL; diff --git a/src/xrGame/ui/TeamInfo.cpp b/src/xrGame/ui/TeamInfo.cpp index 374d84fe862..a328b2d8035 100644 --- a/src/xrGame/ui/TeamInfo.cpp +++ b/src/xrGame/ui/TeamInfo.cpp @@ -1,6 +1,6 @@ #include "StdAfx.h" #include "TeamInfo.h" -#include "../string_table.h" +#include "string_table.h" u32 CTeamInfo::team1_color; u32 CTeamInfo::team2_color; diff --git a/src/xrGame/ui/UIAchievements.cpp b/src/xrGame/ui/UIAchievements.cpp index e25464a94e0..b5e81bd05bc 100644 --- a/src/xrGame/ui/UIAchievements.cpp +++ b/src/xrGame/ui/UIAchievements.cpp @@ -6,9 +6,9 @@ #include "UIHint.h" #include "UIStatic.h" #include "UICursor.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" -#include "../string_table.h" +#include "ai_space.h" +#include "xrServerEntities/script_engine.h" +#include "string_table.h" CUIAchievements::CUIAchievements(CUIScrollView* parent):m_parent(parent) { diff --git a/src/xrGame/ui/UIActorInfo.cpp b/src/xrGame/ui/UIActorInfo.cpp deleted file mode 100644 index dcbf9d1ec45..00000000000 --- a/src/xrGame/ui/UIActorInfo.cpp +++ /dev/null @@ -1,318 +0,0 @@ -#include "StdAfx.h" -#include "UIActorInfo.h" -#include "UIXmlInit.h" -#include "../Level.h" -#include "../actor.h" - -#include "UIInventoryUtilities.h" -#include "UIFrameWindow.h" -#include "UIFrameLineWnd.h" -#include "UIAnimatedStatic.h" -#include "UIScrollView.h" -#include "UICharacterInfo.h" -#include "UI3tButton.h" -#include "UIInventoryUtilities.h" -#include "../actor_statistic_mgr.h" -#include "../character_community.h" -#include "../character_reputation.h" -#include "../relation_registry.h" -#include "../string_table.h" - -#define ACTOR_STATISTIC_XML "actor_statistic.xml" -#define ACTOR_CHARACTER_XML "pda_dialog_character.xml" - - -CUIActorInfoWnd::CUIActorInfoWnd() -{} - - -void CUIActorInfoWnd::Init() -{ - CUIXml uiXml; - CUIXmlInit xml_init; - uiXml.Load (CONFIG_PATH, UI_PATH,ACTOR_STATISTIC_XML); - - xml_init.InitWindow (uiXml, "main_wnd", 0, this); - - // Äåêîðàòèâíîå îôîðìëåíèå - UICharIconFrame = xr_new(); UICharIconFrame->SetAutoDelete (true); - xml_init.InitFrameWindow (uiXml, "chicon_frame_window", 0, UICharIconFrame); - AttachChild (UICharIconFrame); - - UICharIconHeader = xr_new(); UICharIconHeader->SetAutoDelete (true); - xml_init.InitFrameLine (uiXml, "chicon_frame_line", 0, UICharIconHeader); - UICharIconFrame->AttachChild (UICharIconHeader); - - UIAnimatedIcon = xr_new(); UIAnimatedIcon->SetAutoDelete (true); - xml_init.InitAnimatedStatic (uiXml, "a_static", 0, UIAnimatedIcon); - UICharIconHeader->AttachChild (UIAnimatedIcon); - - UIInfoFrame = xr_new(); UIInfoFrame->SetAutoDelete (true); - xml_init.InitFrameWindow (uiXml, "info_frame_window", 0, UIInfoFrame); - AttachChild (UIInfoFrame); - - UIInfoHeader = xr_new();UIInfoHeader ->SetAutoDelete(true); - xml_init.InitFrameLine (uiXml, "info_frame_line", 0, UIInfoHeader); - UIInfoFrame->AttachChild (UIInfoHeader); - - UIDetailList = xr_new();UIDetailList->SetAutoDelete(true); - UIInfoFrame->AttachChild (UIDetailList); - xml_init.InitScrollView (uiXml, "detail_list", 0, UIDetailList); - - UIMasterList = xr_new();UIMasterList->SetAutoDelete(true); - UICharIconFrame->AttachChild (UIMasterList); - xml_init.InitScrollView (uiXml, "master_list", 0, UIMasterList); - - UICharacterWindow = xr_new();UICharacterWindow->SetAutoDelete(true); - UICharIconFrame->AttachChild (UICharacterWindow); - xml_init.InitWindow (uiXml, "character_info", 0, UICharacterWindow); - - UICharacterInfo = xr_new(); UICharacterInfo->SetAutoDelete(true); - UICharacterWindow->AttachChild (UICharacterInfo); - UICharacterInfo->InitCharacterInfo (Fvector2().set(0,0),UICharacterWindow->GetWndSize(), ACTOR_CHARACTER_XML); - - //Ýëåìåíòû àâòîìàòè÷åñêîãî äîáàâëåíèÿ - xml_init.InitAutoStatic (uiXml, "right_auto_static", UICharIconFrame); - xml_init.InitAutoStatic (uiXml, "left_auto_static", UIInfoFrame); - -} - -void CUIActorInfoWnd::Show(bool status) -{ - inherited::Show(status); - if (!status) return; - - UICharacterInfo->InitCharacter (Actor()->ID()); -#pragma todo("implement this") -//. UICharIconHeader->UITitleText.SetText (Actor()->Name()); - FillPointsInfo (); -} - - -void CUIActorInfoWnd::FillPointsInfo () -{ - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH,ACTOR_STATISTIC_XML); - - UIMasterList->Clear (); - - const vStatSectionData& _storage = Actor()->StatisticMgr().GetCStorage(); - vStatSectionData::const_iterator it = _storage.begin(); - vStatSectionData::const_iterator it_e = _storage.end(); - - FillMasterPart (&uiXml, "foo"); - - for(; it!=it_e; ++it) - { - FillMasterPart (&uiXml, (*it).key); - } - FillMasterPart (&uiXml, "total"); - - UIMasterList->SetSelected(UIMasterList->GetItem(1) ); -} - -void CUIActorInfoWnd::FillMasterPart(CUIXml* xml, const shared_str& key_name) -{ - CUIActorStaticticHeader* itm = xr_new(this); - string128 buff; - strconcat (sizeof(buff), buff, "actor_stats_wnd:master_part_", key_name.c_str() ); - itm->Init (xml, buff, 0); - - if(key_name!="foo") - { - s32 _totl = Actor()->StatisticMgr().GetSectionPoints(key_name); - - if(_totl==-1) - { - itm->m_text2->SetTextST (""); - }else - { - sprintf_s (buff,"%d", _totl); - itm->m_text2->SetTextST (buff); - } - } - UIMasterList->AddWindow (itm, true); -} - -void CUIActorInfoWnd::FillPointsDetail(const shared_str& id) -{ - - UIDetailList->Clear (); - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH,ACTOR_STATISTIC_XML); - uiXml.SetLocalRoot (uiXml.NavigateToNode("actor_stats_wnd",0)); - - string512 path; - sprintf_s (path,"detail_part_%s",id.c_str()); - - XML_NODE* n = uiXml.NavigateToNode(path,0); - if(!n) - sprintf_s (path,"detail_part_def"); - -#pragma todo("implement this") -/* - string256 str; - sprintf_s (str,"st_detail_list_for_%s", id.c_str()); - UIInfoHeader->GetTitleStatic()->SetTextST (str); -*/ - SStatSectionData& section = Actor()-> StatisticMgr().GetSection(id); - vStatDetailData::const_iterator it = section.data.begin(); - vStatDetailData::const_iterator it_e = section.data.end(); - - int _cntr = 0; - string64 buff; - for(;it!=it_e;++it,++_cntr) - { - CUIActorStaticticDetail* itm = xr_new(); - itm->Init (&uiXml, path, 0); - - sprintf_s (buff,"%d.",_cntr); - itm->m_text0->SetText (buff); - - itm->m_text1->SetTextST (*CStringTable().translate((*it).key)); - itm->m_text1->AdjustHeightToText (); - - if( 0==(*it).str_value.size() ) - { - sprintf_s (buff,"x%d", (*it).int_count); - itm->m_text2->SetTextST (buff); - - sprintf_s (buff,"%d", (*it).int_points); - itm->m_text3->SetTextST (buff); - }else - { - itm->m_text2->SetTextST ((*it).str_value.c_str()); - itm->m_text3->SetTextST (""); - } - - Fvector2 sz = itm->GetWndSize(); - float _height; - _height = _max(sz.y, itm->m_text1->GetWndPos().y+itm->m_text1->GetWndSize().y+3); - sz.y = _height; - itm->SetWndSize (sz); - UIDetailList->AddWindow (itm, true); - } -} -void CUIActorInfoWnd::Reset() -{ - inherited::Reset(); -} - -void CUIActorInfoWnd::FillReputationDetails(CUIXml* xml, LPCSTR path) -{ - XML_NODE* _list_node = xml->NavigateToNode ("relation_communities_list",0); - int cnt = xml->GetNodesNum ("relation_communities_list",0,"r"); - - CHARACTER_COMMUNITY comm; - - - CHARACTER_REPUTATION rep_actor, rep_neutral; - rep_actor.set (Actor()->Reputation()); - rep_neutral.set (NEUTAL_REPUTATION); - - CHARACTER_GOODWILL d_neutral = CHARACTER_REPUTATION::relation(rep_actor.index(), rep_neutral.index()); - - - string64 buff; - for(int i=0;i(); - itm->Init (xml, path, 0); - comm.set (xml->Read(_list_node,"r",i,"unknown_community")); - itm->m_text1->SetTextST (*(comm.id())); - - CHARACTER_GOODWILL gw = RELATION_REGISTRY().GetCommunityGoodwill(comm.index(), Actor()->ID()); - gw += CHARACTER_COMMUNITY::relation(Actor()->Community(),comm.index()); - gw += d_neutral; - - itm->m_text2->SetTextST (InventoryUtilities::GetGoodwillAsText(gw)); - itm->m_text2->SetTextColor (InventoryUtilities::GetGoodwillColor(gw)); - - sprintf_s (buff,"%d", gw); - itm->m_text3->SetTextST (buff); - - UIDetailList->AddWindow (itm, true); - } -} - - -CUIActorStaticticHeader::CUIActorStaticticHeader(CUIActorInfoWnd* w) -:m_actorInfoWnd(w) -{} - - -void CUIActorStaticticHeader::Init (CUIXml* xml, LPCSTR path, int idx_in_xml) -{ - XML_NODE* _stored_root = xml->GetLocalRoot(); - - CUIXmlInit xml_init; - xml_init.InitWindow (*xml, path, idx_in_xml, this); - - xml->SetLocalRoot (xml->NavigateToNode(path,idx_in_xml)); - - m_text1 = xr_new(); m_text1->SetAutoDelete(true); - AttachChild (m_text1); - xml_init.InitStatic (*xml, "text_1", 0, m_text1); - - m_text2 = xr_new(); m_text2->SetAutoDelete(true); - AttachChild (m_text2); - xml_init.InitStatic (*xml, "text_2", 0, m_text2); - - xml_init.InitAutoStaticGroup (*xml, "auto", 0, this); - LPCSTR _id = strstr(path,"master_part_")+xr_strlen("master_part_"); - m_id = _id; - - m_stored_alpha = color_get_A(m_text1->GetTextColor()); - xml->SetLocalRoot (_stored_root); - -} - -bool CUIActorStaticticHeader::OnMouseDown (int mouse_btn) -{ - if(mouse_btn==MOUSE_1 && m_id!="total") - { - m_actorInfoWnd->MasterList().SetSelected (this); - return true; - }else - return true; -} - -void CUIActorStaticticHeader::SetSelected(bool b) -{ - CUISelectable::SetSelected(b); - m_text1->SetTextColor( subst_alpha(m_text1->GetTextColor(), b?255:m_stored_alpha )); - if(b){ - m_actorInfoWnd->FillPointsDetail (m_id); - } -} - - -void CUIActorStaticticDetail::Init (CUIXml* xml, LPCSTR path, int idx) -{ - XML_NODE* _stored_root = xml->GetLocalRoot(); - - CUIXmlInit xml_init; - xml_init.InitWindow (*xml, path, idx, this); - - xml->SetLocalRoot (xml->NavigateToNode(path,idx)); - - m_text0 = xr_new(); m_text0->SetAutoDelete(true); - AttachChild (m_text0); - xml_init.InitStatic (*xml, "text_0", 0, m_text0); - - m_text1 = xr_new(); m_text1->SetAutoDelete(true); - AttachChild (m_text1); - xml_init.InitStatic (*xml, "text_1", 0, m_text1); - - m_text2 = xr_new(); m_text2->SetAutoDelete(true); - AttachChild (m_text2); - xml_init.InitStatic (*xml, "text_2", 0, m_text2); - - m_text3 = xr_new(); m_text3->SetAutoDelete(true); - AttachChild (m_text3); - xml_init.InitStatic (*xml, "text_3", 0, m_text3); - - xml_init.InitAutoStaticGroup (*xml, "auto", 0, this); - - xml->SetLocalRoot (_stored_root); -} diff --git a/src/xrGame/ui/UIActorInfo.h b/src/xrGame/ui/UIActorInfo.h deleted file mode 100644 index 332971c40b5..00000000000 --- a/src/xrGame/ui/UIActorInfo.h +++ /dev/null @@ -1,70 +0,0 @@ -#pragma once - -#include "UIWindow.h" - -class CUIFrameWindow; -class CUIFrameLineWnd; -class CUIAnimatedStatic; -class CUIStatic; -class CUICharacterInfo; -class CUIScrollView; -class CUIXml; - -class CUIActorInfoWnd: public CUIWindow -{ - typedef CUIWindow inherited; - -public: - CUIActorInfoWnd (); - virtual void Init (); - virtual void Show (bool status); - CUIScrollView& DetailList () {return *UIDetailList;} - CUIScrollView& MasterList () {return *UIMasterList;} - void FillPointsDetail (const shared_str& idx); - virtual void Reset (); - -protected: - CUIFrameWindow* UIInfoFrame; - CUIFrameLineWnd* UIInfoHeader; - CUIFrameWindow* UICharIconFrame; - CUIFrameLineWnd* UICharIconHeader; - CUIAnimatedStatic* UIAnimatedIcon; - - CUIWindow* UICharacterWindow; - CUICharacterInfo* UICharacterInfo; - - CUIScrollView* UIMasterList; - CUIScrollView* UIDetailList; - void FillPointsInfo (); - void FillReputationDetails (CUIXml* xml, LPCSTR path); - void FillMasterPart (CUIXml* xml, const shared_str& key_name); -}; - -class CUIActorStaticticHeader :public CUIWindow, public CUISelectable -{ - CUIActorInfoWnd* m_actorInfoWnd; -protected: - u32 m_stored_alpha; -public: - CUIStatic* m_text1; - CUIStatic* m_text2; -public: - CUIActorStaticticHeader (CUIActorInfoWnd* w); - void Init (CUIXml* xml, LPCSTR path, int idx_in_xml); - virtual bool OnMouseDown (int mouse_btn); - virtual void SetSelected (bool b); - - shared_str m_id; -}; - -class CUIActorStaticticDetail :public CUIWindow -{ -protected: -public: - CUIStatic* m_text0; - CUIStatic* m_text1; - CUIStatic* m_text2; - CUIStatic* m_text3; -public: - void Init (CUIXml* xml, LPCSTR path, int xml_idx); -}; diff --git a/src/xrGame/ui/UIActorMenu.cpp b/src/xrGame/ui/UIActorMenu.cpp index 26f961c704e..656f1204a28 100644 --- a/src/xrGame/ui/UIActorMenu.cpp +++ b/src/xrGame/ui/UIActorMenu.cpp @@ -1,28 +1,26 @@ #include "stdafx.h" #include "UIActorMenu.h" #include "UIActorStateInfo.h" -#include "../actor.h" -#include "../uigamesp.h" -#include "../inventory.h" -#include "../inventory_item.h" -#include "../InventoryBox.h" +#include "Actor.h" +#include "UIGameSP.h" +#include "Inventory.h" +#include "inventory_item.h" +#include "InventoryBox.h" #include "object_broker.h" -#include "../ai/monsters/BaseMonster/base_monster.h" +#include "ai/monsters/BaseMonster/base_monster.h" #include "UIInventoryUtilities.h" #include "game_cl_base.h" - -#include "../Weapon.h" -#include "../WeaponMagazinedWGrenade.h" -#include "../WeaponAmmo.h" -#include "../Silencer.h" -#include "../Scope.h" -#include "../GrenadeLauncher.h" -#include "../trade_parameters.h" -#include "../ActorHelmet.h" -#include "../CustomOutfit.h" -#include "../CustomDetector.h" -#include "../eatable_item.h" - +#include "Weapon.h" +#include "WeaponMagazinedWGrenade.h" +#include "WeaponAmmo.h" +#include "Silencer.h" +#include "Scope.h" +#include "GrenadeLauncher.h" +#include "trade_parameters.h" +#include "ActorHelmet.h" +#include "CustomOutfit.h" +#include "CustomDetector.h" +#include "eatable_item.h" #include "UIProgressBar.h" #include "UICursor.h" #include "UICellItem.h" @@ -36,7 +34,7 @@ #include "UIMessageBoxEx.h" #include "UIPropertiesBox.h" #include "UIMainIngameWnd.h" -#include "../Trade.h" +#include "Trade.h" void CUIActorMenu::SetActor(CInventoryOwner* io) { diff --git a/src/xrGame/ui/UIActorMenu.h b/src/xrGame/ui/UIActorMenu.h index a4f21179196..03dafe692ac 100644 --- a/src/xrGame/ui/UIActorMenu.h +++ b/src/xrGame/ui/UIActorMenu.h @@ -2,7 +2,7 @@ #include "UIDialogWnd.h" #include "UIWndCallback.h" -#include "../../xrServerEntities/inventory_space.h" +#include "xrServerEntities/inventory_space.h" #include "UIHint.h" class CUICharacterInfo; diff --git a/src/xrGame/ui/UIActorMenuDeadBodySearch.cpp b/src/xrGame/ui/UIActorMenuDeadBodySearch.cpp index d502aa3ae91..43cd553d78b 100644 --- a/src/xrGame/ui/UIActorMenuDeadBodySearch.cpp +++ b/src/xrGame/ui/UIActorMenuDeadBodySearch.cpp @@ -7,16 +7,15 @@ #include "UICellItem.h" #include "UICellItemFactory.h" #include "UIFrameLineWnd.h" - #include "xrMessages.h" -#include "../alife_registry_wrappers.h" -#include "../GameObject.h" -#include "../InventoryOwner.h" -#include "../Inventory.h" -#include "../Inventory_item.h" -#include "../InventoryBox.h" -#include "../string_table.h" -#include "../ai/monsters/BaseMonster/base_monster.h" +#include "alife_registry_wrappers.h" +#include "GameObject.h" +#include "InventoryOwner.h" +#include "Inventory.h" +#include "Inventory_item.h" +#include "InventoryBox.h" +#include "string_table.h" +#include "ai/monsters/BaseMonster/base_monster.h" void move_item_from_to (u16 from_id, u16 to_id, u16 what_id) { diff --git a/src/xrGame/ui/UIActorMenuInitialize.cpp b/src/xrGame/ui/UIActorMenuInitialize.cpp index 7a99961c808..882ce534caa 100644 --- a/src/xrGame/ui/UIActorMenuInitialize.cpp +++ b/src/xrGame/ui/UIActorMenuInitialize.cpp @@ -22,7 +22,7 @@ #include "UIHelper.h" #include "UIProgressBar.h" #include "ui_base.h" -#include "../string_table.h" +#include "string_table.h" CUIActorMenu::CUIActorMenu() { diff --git a/src/xrGame/ui/UIActorMenuInventory.cpp b/src/xrGame/ui/UIActorMenuInventory.cpp index 0b37098b0c3..caab0a8a99e 100644 --- a/src/xrGame/ui/UIActorMenuInventory.cpp +++ b/src/xrGame/ui/UIActorMenuInventory.cpp @@ -1,10 +1,10 @@ #include "stdafx.h" #include "UIActorMenu.h" -#include "../inventory.h" -#include "../inventoryOwner.h" +#include "Inventory.h" +#include "inventoryOwner.h" #include "UIInventoryUtilities.h" #include "UIItemInfo.h" -#include "../Level.h" +#include "Level.h" #include "UICellItemFactory.h" #include "UIDragDropListEx.h" #include "UIDragDropReferenceList.h" @@ -16,26 +16,23 @@ #include "UIMainIngameWnd.h" #include "UIGameCustom.h" #include "eatable_item_object.h" - -#include "../silencer.h" -#include "../scope.h" -#include "../grenadelauncher.h" -#include "../Artefact.h" -#include "../eatable_item.h" -#include "../BottleItem.h" -#include "../WeaponMagazined.h" -#include "../Medkit.h" -#include "../Antirad.h" -#include "../CustomOutfit.h" -#include "../ActorHelmet.h" -#include "../UICursor.h" -#include "../MPPlayersBag.h" -#include "../player_hud.h" -#include "../CustomDetector.h" -#include "../PDA.h" - -#include "../actor_defs.h" - +#include "Silencer.h" +#include "Scope.h" +#include "GrenadeLauncher.h" +#include "Artefact.h" +#include "eatable_item.h" +#include "BottleItem.h" +#include "WeaponMagazined.h" +#include "Medkit.h" +#include "Antirad.h" +#include "CustomOutfit.h" +#include "ActorHelmet.h" +#include "UICursor.h" +#include "MPPlayersBag.h" +#include "player_hud.h" +#include "CustomDetector.h" +#include "PDA.h" +#include "actor_defs.h" void move_item_from_to(u16 from_id, u16 to_id, u16 what_id); @@ -963,7 +960,7 @@ void CUIActorMenu::PropertiesBoxForWeapon( CUICellItem* cell_item, PIItem item, } } } -#include "../string_table.h" +#include "string_table.h" void CUIActorMenu::PropertiesBoxForAddon( PIItem item, bool& b_show ) { //ïðèñîåäèíåíèå àääîíîâ ê àêòèâíîìó ñëîòó (2 èëè 3) diff --git a/src/xrGame/ui/UIActorMenuTrade.cpp b/src/xrGame/ui/UIActorMenuTrade.cpp index 4534332aff1..4e97350514d 100644 --- a/src/xrGame/ui/UIActorMenuTrade.cpp +++ b/src/xrGame/ui/UIActorMenuTrade.cpp @@ -1,4 +1,3 @@ -//#include "stdafx.h" #include "pch_script.h" #include "UIActorMenu.h" #include "UI3tButton.h" @@ -9,24 +8,21 @@ #include "UICellItem.h" #include "UIInventoryUtilities.h" #include "UICellItemFactory.h" - -#include "../InventoryOwner.h" -#include "../Inventory.h" -#include "../Trade.h" -#include "../Entity.h" -#include "../Actor.h" -#include "../Weapon.h" -#include "../trade_parameters.h" -#include "../inventory_item_object.h" -#include "../string_table.h" -#include "../ai/monsters/BaseMonster/base_monster.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" -#include "../UIGameSP.h" +#include "InventoryOwner.h" +#include "Inventory.h" +#include "Trade.h" +#include "Entity.h" +#include "Actor.h" +#include "Weapon.h" +#include "trade_parameters.h" +#include "inventory_item_object.h" +#include "string_table.h" +#include "ai/monsters/BaseMonster/base_monster.h" +#include "ai_space.h" +#include "xrServerEntities/script_engine.h" +#include "UIGameSP.h" #include "UITalkWnd.h" -// ------------------------------------------------- - void CUIActorMenu::InitTradeMode() { m_pInventoryBagList->Show (false); diff --git a/src/xrGame/ui/UIActorMenuUpgrade.cpp b/src/xrGame/ui/UIActorMenuUpgrade.cpp index ef604db247a..9b91f5b61f6 100644 --- a/src/xrGame/ui/UIActorMenuUpgrade.cpp +++ b/src/xrGame/ui/UIActorMenuUpgrade.cpp @@ -1,21 +1,17 @@ -//#include "stdafx.h" #include "pch_script.h" #include "UIActorMenu.h" #include "UIInventoryUpgradeWnd.h" #include "UIInvUpgradeInfo.h" - #include "UIDragDropListEx.h" #include "UIDragDropReferenceList.h" #include "UICharacterInfo.h" - -#include "../inventory_item.h" +#include "inventory_item.h" #include "UICellItem.h" -#include "../InventoryOwner.h" -#include "../Inventory.h" -#include "../actor.h" -#include "../uigamesp.h" +#include "InventoryOwner.h" +#include "Inventory.h" +#include "Actor.h" +#include "UIGameSP.h" #include "UI3tButton.h" - #include "inventory_upgrade.h" #include "UITalkWnd.h" diff --git a/src/xrGame/ui/UIActorMenu_action.cpp b/src/xrGame/ui/UIActorMenu_action.cpp index ed39827a8f0..e11706497b1 100644 --- a/src/xrGame/ui/UIActorMenu_action.cpp +++ b/src/xrGame/ui/UIActorMenu_action.cpp @@ -8,15 +8,14 @@ #include "stdafx.h" #include "UIActorMenu.h" #include "UIActorStateInfo.h" -#include "../actor.h" -#include "../uigamesp.h" -#include "../inventory.h" -#include "../inventory_item.h" -#include "../InventoryBox.h" +#include "Actor.h" +#include "UIGameSP.h" +#include "Inventory.h" +#include "inventory_item.h" +#include "InventoryBox.h" #include "object_broker.h" #include "UIInventoryUtilities.h" #include "game_cl_base.h" - #include "UICursor.h" #include "UICellItem.h" #include "UICharacterInfo.h" @@ -29,7 +28,6 @@ #include "UIPropertiesBox.h" #include "UIMainIngameWnd.h" - bool CUIActorMenu::AllowItemDrops(EDDListType from, EDDListType to) { xr_vector& v = m_allowed_drops[to]; diff --git a/src/xrGame/ui/UIActorMenu_script.cpp b/src/xrGame/ui/UIActorMenu_script.cpp index d4bba7677c4..6bf900a97c3 100644 --- a/src/xrGame/ui/UIActorMenu_script.cpp +++ b/src/xrGame/ui/UIActorMenu_script.cpp @@ -7,12 +7,11 @@ #include "pch_script.h" #include "UIActorMenu.h" - -#include "../actor.h" -#include "../inventory_item.h" +#include "Actor.h" +#include "inventory_item.h" #include "UICellItem.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" +#include "ai_space.h" +#include "xrServerEntities/script_engine.h" using namespace luabind; diff --git a/src/xrGame/ui/UIActorStateInfo.cpp b/src/xrGame/ui/UIActorStateInfo.cpp index 22f3ef1b9ef..842d83e0a63 100644 --- a/src/xrGame/ui/UIActorStateInfo.cpp +++ b/src/xrGame/ui/UIActorStateInfo.cpp @@ -14,25 +14,23 @@ #include "UIStatic.h" #include "UIXmlInit.h" #include "object_broker.h" - #include "UIHelper.h" #include "ui_arrow.h" #include "UIHudStatesWnd.h" - -#include "../Level.h" -#include "../location_manager.h" -#include "../player_hud.h" +#include "Level.h" +#include "location_manager.h" +#include "player_hud.h" #include "UIMainIngameWnd.h" -#include "../UIGameCustom.h" - -#include "../Actor.h" -#include "../ActorCondition.h" -#include "../EntityCondition.h" -#include "../CustomOutfit.h" -#include "../ActorHelmet.h" -#include "../Inventory.h" -#include "../Artefact.h" -#include "../string_table.h" +#include "UIGameCustom.h" +#include "Actor.h" +#include "ActorCondition.h" +#include "EntityCondition.h" +#include "CustomOutfit.h" +#include "ActorHelmet.h" +#include "Inventory.h" +#include "Artefact.h" +#include "string_table.h" + ui_actor_state_wnd::ui_actor_state_wnd() { } diff --git a/src/xrGame/ui/UIAnimatedStatic.cpp b/src/xrGame/ui/UIAnimatedStatic.cpp index 6ae74b1d77e..0cb64ffc244 100644 --- a/src/xrGame/ui/UIAnimatedStatic.cpp +++ b/src/xrGame/ui/UIAnimatedStatic.cpp @@ -98,10 +98,11 @@ void CUIAnimatedStatic::SetAnimPos(float pos){ //----------------------------------------------------------------------------------------- //Static for sleep control----------------------------------------------------------------- //----------------------------------------------------------------------------------------- -#include "../Actor_Flags.h" -#include "../Level.h" -#include "../date_time.h" +#include "Actor_Flags.h" +#include "Level.h" +#include "date_time.h" #include "UITextureMaster.h" + CUISleepStatic::CUISleepStatic():m_cur_time(0) { }; diff --git a/src/xrGame/ui/UIBoosterInfo.cpp b/src/xrGame/ui/UIBoosterInfo.cpp index e6d4ddea966..56877fafb4a 100644 --- a/src/xrGame/ui/UIBoosterInfo.cpp +++ b/src/xrGame/ui/UIBoosterInfo.cpp @@ -2,12 +2,12 @@ #include "UIBoosterInfo.h" #include "UIStatic.h" #include "object_broker.h" -#include "../EntityCondition.h" -#include "..\actor.h" -#include "../ActorCondition.h" +#include "EntityCondition.h" +#include "Actor.h" +#include "ActorCondition.h" #include "UIXmlInit.h" #include "UIHelper.h" -#include "../string_table.h" +#include "string_table.h" CUIBoosterInfo::CUIBoosterInfo() { diff --git a/src/xrGame/ui/UIBoosterInfo.h b/src/xrGame/ui/UIBoosterInfo.h index 95c75aa25f9..9a48f21d4a8 100644 --- a/src/xrGame/ui/UIBoosterInfo.h +++ b/src/xrGame/ui/UIBoosterInfo.h @@ -1,6 +1,6 @@ #pragma once #include "UIWindow.h" -#include "../EntityCondition.h" +#include "EntityCondition.h" class CUIXml; class CUIStatic; diff --git a/src/xrGame/ui/UIButton.cpp b/src/xrGame/ui/UIButton.cpp index 8a564581cee..9e957841cd8 100644 --- a/src/xrGame/ui/UIButton.cpp +++ b/src/xrGame/ui/UIButton.cpp @@ -3,7 +3,7 @@ #include "UIBtnHint.h" #include "UICursor.h" #include "ui_base.h" -#include "../../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" #include "xr_level_controller.h" #define PUSH_OFFSET_RIGHT 1 diff --git a/src/xrGame/ui/UIButton.h b/src/xrGame/ui/UIButton.h index e29a6b6ac7d..5e6e79fb4ec 100644 --- a/src/xrGame/ui/UIButton.h +++ b/src/xrGame/ui/UIButton.h @@ -1,7 +1,7 @@ #pragma once #include "UIStatic.h" -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" class CUIButton : public CUIStatic diff --git a/src/xrGame/ui/UICDkey.cpp b/src/xrGame/ui/UICDkey.cpp index 057b41ab9e5..c8d4be567d8 100644 --- a/src/xrGame/ui/UICDkey.cpp +++ b/src/xrGame/ui/UICDkey.cpp @@ -1,19 +1,15 @@ - #include "stdafx.h" #include "UICDkey.h" #include "UILines.h" -#include "../../xrEngine/line_edit_control.h" -#include "../MainMenu.h" - -#include "../../xrEngine/xr_IOConsole.h" -#include "../RegistryFuncs.h" -#include "../../xrGameSpy/xrGameSpy_MainDefs.h" +#include "xrEngine/line_edit_control.h" +#include "MainMenu.h" +#include "xrEngine/xr_IOConsole.h" +#include "RegistryFuncs.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" #include "player_name_modifyer.h" - #include "gamespy/GameSpy_GP.h" - #include -#include "../xrCore/os_clipboard.h" +#include "xrCore/os_clipboard.h" extern string64 gsCDKey; LPCSTR AddHyphens( LPCSTR c ); diff --git a/src/xrGame/ui/UICarBodyWnd.cpp b/src/xrGame/ui/UICarBodyWnd.cpp deleted file mode 100644 index 5b624285483..00000000000 --- a/src/xrGame/ui/UICarBodyWnd.cpp +++ /dev/null @@ -1,607 +0,0 @@ -#include "pch_script.h" - -/* -#include "UICarBodyWnd.h" -#include "xrUIXmlParser.h" -#include "UIXmlInit.h" -#include "../HUDManager.h" -#include "../level.h" -#include "UICharacterInfo.h" -#include "UIDragDropListEx.h" -#include "UIFrameWindow.h" -#include "UIItemInfo.h" -#include "UIPropertiesBox.h" -#include "../ai/monsters/BaseMonster/base_monster.h" -#include "../inventory.h" -#include "UIInventoryUtilities.h" -#include "UICellItem.h" -#include "UICellItemFactory.h" -#include "../WeaponMagazined.h" -#include "../Actor.h" -#include "../eatable_item.h" -#include "../alife_registry_wrappers.h" -#include "UI3tButton.h" -#include "UIListBoxItem.h" -#include "../InventoryBox.h" -#include "../game_object_space.h" -#include "../script_callback_ex.h" -#include "../script_game_object.h" -#include "../BottleItem.h" - -void move_item (u16 from_id, u16 to_id, u16 what_id); - -CUICarBodyWnd::CUICarBodyWnd() -{ - m_pInventoryBox = NULL; - Init (); - Hide (); - m_b_need_update = false; -} - -CUICarBodyWnd::~CUICarBodyWnd() -{ - m_pUIOurBagList->ClearAll (true); - m_pUIOthersBagList->ClearAll (true); -} - -void CUICarBodyWnd::Init() -{ - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH, "carbody_new.xml"); - - CUIXmlInit xml_init; - - xml_init.InitWindow (uiXml, "main", 0, this); - - m_pUIStaticTop = xr_new(); m_pUIStaticTop->SetAutoDelete(true); - AttachChild (m_pUIStaticTop); - xml_init.InitStatic (uiXml, "top_background", 0, m_pUIStaticTop); - - - m_pUIStaticBottom = xr_new(); m_pUIStaticBottom->SetAutoDelete(true); - AttachChild (m_pUIStaticBottom); - xml_init.InitStatic (uiXml, "bottom_background", 0, m_pUIStaticBottom); - - m_pUIOurIcon = xr_new(); m_pUIOurIcon->SetAutoDelete(true); - AttachChild (m_pUIOurIcon); - xml_init.InitStatic (uiXml, "static_icon", 0, m_pUIOurIcon); - - m_pUIOthersIcon = xr_new(); m_pUIOthersIcon->SetAutoDelete(true); - AttachChild (m_pUIOthersIcon); - xml_init.InitStatic (uiXml, "static_icon", 1, m_pUIOthersIcon); - - - m_pUICharacterInfoLeft = xr_new(); m_pUICharacterInfoLeft->SetAutoDelete(true); - m_pUIOurIcon->AttachChild (m_pUICharacterInfoLeft); - m_pUICharacterInfoLeft->InitCharacterInfo(Fvector2().set(0,0), m_pUIOurIcon->GetWndSize(), "trade_character.xml"); - - - m_pUICharacterInfoRight = xr_new(); m_pUICharacterInfoRight->SetAutoDelete(true); - m_pUIOthersIcon->AttachChild (m_pUICharacterInfoRight); - m_pUICharacterInfoRight->InitCharacterInfo(Fvector2().set(0,0), m_pUIOthersIcon->GetWndSize(), "trade_character.xml"); - - m_pUIOurBagWnd = xr_new(); m_pUIOurBagWnd->SetAutoDelete(true); - AttachChild (m_pUIOurBagWnd); - xml_init.InitStatic (uiXml, "our_bag_static", 0, m_pUIOurBagWnd); - - - m_pUIOthersBagWnd = xr_new(); m_pUIOthersBagWnd->SetAutoDelete(true); - AttachChild (m_pUIOthersBagWnd); - xml_init.InitStatic (uiXml, "others_bag_static", 0, m_pUIOthersBagWnd); - - m_pUIOurBagList = xr_new(); m_pUIOurBagList->SetAutoDelete(true); - m_pUIOurBagWnd->AttachChild (m_pUIOurBagList); - xml_init.InitDragDropListEx (uiXml, "dragdrop_list_our", 0, m_pUIOurBagList); - - m_pUIOthersBagList = xr_new(); m_pUIOthersBagList->SetAutoDelete(true); - m_pUIOthersBagWnd->AttachChild (m_pUIOthersBagList); - xml_init.InitDragDropListEx (uiXml, "dragdrop_list_other", 0, m_pUIOthersBagList); - - - //èíôîðìàöèÿ î ïðåäìåòå - m_pUIDescWnd = xr_new(); m_pUIDescWnd->SetAutoDelete(true); - AttachChild (m_pUIDescWnd); - xml_init.InitFrameWindow (uiXml, "frame_window", 0, m_pUIDescWnd); - - m_pUIStaticDesc = xr_new(); m_pUIStaticDesc->SetAutoDelete(true); - m_pUIDescWnd->AttachChild (m_pUIStaticDesc); - xml_init.InitStatic (uiXml, "descr_static", 0, m_pUIStaticDesc); - - m_pUIItemInfo = xr_new(); m_pUIItemInfo->SetAutoDelete(true); - m_pUIDescWnd->AttachChild (m_pUIItemInfo); - m_pUIItemInfo->InitItemInfo (Fvector2().set(0,0), m_pUIDescWnd->GetWndSize(), "carbody_item.xml"); - - - xml_init.InitAutoStatic (uiXml, "auto_static", this); - - m_pUIPropertiesBox = xr_new(); m_pUIPropertiesBox->SetAutoDelete(true); - AttachChild (m_pUIPropertiesBox); - m_pUIPropertiesBox->InitPropertiesBox(Fvector2().set(0,0), Fvector2().set(300,300) ); - m_pUIPropertiesBox->Hide (); - - SetCurrentItem (NULL); - m_pUIStaticDesc->SetText (NULL); - - m_pUITakeAll = xr_new(); m_pUITakeAll->SetAutoDelete(true); - AttachChild (m_pUITakeAll); - xml_init.Init3tButton (uiXml, "take_all_btn", 0, m_pUITakeAll); - - BindDragDropListEnents (m_pUIOurBagList); - BindDragDropListEnents (m_pUIOthersBagList); - - -} - -void CUICarBodyWnd::InitCarBody(CInventoryOwner* pOur, CInventoryBox* pInvBox) -{ - m_pOurObject = pOur; - m_pOthersObject = NULL; - m_pInventoryBox = pInvBox; - m_pInventoryBox->m_in_use = true; - - u16 our_id = smart_cast(m_pOurObject)->ID(); - m_pUICharacterInfoLeft->InitCharacter (our_id); - m_pUIOthersIcon->Show (false); - m_pUICharacterInfoRight->ClearInfo (); - m_pUIPropertiesBox->Hide (); - EnableAll (); - UpdateLists (); - -} - -void CUICarBodyWnd::InitCarBody(CInventoryOwner* pOur, CInventoryOwner* pOthers) -{ - - m_pOurObject = pOur; - m_pOthersObject = pOthers; - m_pInventoryBox = NULL; - - u16 our_id = smart_cast(m_pOurObject)->ID(); - u16 other_id = smart_cast(m_pOthersObject)->ID(); - - m_pUICharacterInfoLeft->InitCharacter (our_id); - m_pUIOthersIcon->Show (true); - - CBaseMonster *monster = NULL; - if(m_pOthersObject) { - monster = smart_cast(m_pOthersObject); - if (monster || m_pOthersObject->use_simplified_visual() ) - { - m_pUICharacterInfoRight->ClearInfo (); - if(monster) - { - shared_str monster_tex_name = pSettings->r_string(monster->cNameSect(),"icon"); - m_pUICharacterInfoRight->UIIcon().InitTexture(monster_tex_name.c_str()); - m_pUICharacterInfoRight->UIIcon().SetStretchTexture(true); - } - }else - { - m_pUICharacterInfoRight->InitCharacter (other_id); - } - } - - m_pUIPropertiesBox->Hide (); - EnableAll (); - UpdateLists (); - - if(!monster){ - CInfoPortionWrapper *known_info_registry = xr_new(); - known_info_registry->registry().init (other_id); - KNOWN_INFO_VECTOR& known_info = known_info_registry->registry().objects(); - - KNOWN_INFO_VECTOR_IT it = known_info.begin(); - for(int i=0;it!=known_info.end();++it,++i){ - (*it).info_id; - NET_Packet P; - CGameObject::u_EventGen (P,GE_INFO_TRANSFER, our_id); - P.w_u16 (0);//not used - P.w_stringZ ((*it).info_id); //ñîîáùåíèå - P.w_u8 (1); //äîáàâëåíèå ñîîáùåíèÿ - CGameObject::u_EventSend (P); - } - known_info.clear (); - xr_delete (known_info_registry); - } -} - -void CUICarBodyWnd::UpdateLists_delayed() -{ - m_b_need_update = true; -} - -#include "UIInventoryUtilities.h" - -void CUICarBodyWnd::Hide() -{ - InventoryUtilities::SendInfoToActor ("ui_car_body_hide"); - m_pUIOurBagList->ClearAll (true); - m_pUIOthersBagList->ClearAll (true); - inherited::Hide (); - if(m_pInventoryBox) - m_pInventoryBox->m_in_use = false; -} - -void CUICarBodyWnd::UpdateLists() -{ - TIItemContainer ruck_list; - m_pUIOurBagList->ClearAll (true); - m_pUIOthersBagList->ClearAll (true); - - ruck_list.clear (); - m_pOurObject->inventory().AddAvailableItems (ruck_list, true); - std::sort (ruck_list.begin(),ruck_list.end(),InventoryUtilities::GreaterRoomInRuck); - - //Íàø ðþêçàê - TIItemContainer::iterator it; - for(it = ruck_list.begin(); ruck_list.end() != it; ++it) - { - CUICellItem* itm = create_cell_item(*it); - m_pUIOurBagList->SetItem (itm); - } - - - ruck_list.clear (); - if(m_pOthersObject) - m_pOthersObject->inventory().AddAvailableItems (ruck_list, false); - else - m_pInventoryBox->AddAvailableItems (ruck_list); - - std::sort (ruck_list.begin(),ruck_list.end(),InventoryUtilities::GreaterRoomInRuck); - - //×óæîé ðþêçàê - for(it = ruck_list.begin(); ruck_list.end() != it; ++it) - { - CUICellItem* itm = create_cell_item(*it); - m_pUIOthersBagList->SetItem (itm); - } - -// InventoryUtilities::UpdateWeight (*m_pUIOurBagWnd); - m_b_need_update = false; -} - -void CUICarBodyWnd::SendMessage(CUIWindow *pWnd, s16 msg, void *pData) -{ - if (BUTTON_CLICKED == msg && m_pUITakeAll == pWnd) - { - TakeAll (); - } - else if(pWnd == m_pUIPropertiesBox && msg == PROPERTY_CLICKED) - { - if(m_pUIPropertiesBox->GetClickedItem()) - { - switch(m_pUIPropertiesBox->GetClickedItem()->GetTAG()) - { - case INVENTORY_EAT_ACTION: //ñúåñòü îáúåêò - EatItem(); - break; - case INVENTORY_UNLOAD_MAGAZINE: - { - CUICellItem * itm = CurrentItem(); - (smart_cast((CWeapon*)itm->m_pData))->UnloadMagazine(); - for(u32 i=0; iChildsCount(); ++i) - { - CUICellItem * child_itm = itm->Child(i); - (smart_cast((CWeapon*)child_itm->m_pData))->UnloadMagazine(); - } - }break; - } - } - } - - inherited::SendMessage (pWnd, msg, pData); -} - -void CUICarBodyWnd::Draw() -{ - inherited::Draw (); -} - - -void CUICarBodyWnd::Update() -{ - if( m_b_need_update|| - m_pOurObject->inventory().ModifyFrame()==Device.dwFrame || - (m_pOthersObject&&m_pOthersObject->inventory().ModifyFrame()==Device.dwFrame)) - - UpdateLists (); - - - if(m_pOthersObject && (smart_cast(m_pOurObject))->Position().distance_to((smart_cast(m_pOthersObject))->Position()) > 3.0f) - { - GetHolder()->StartStopMenu(this,true); - } - inherited::Update(); -} - - -void CUICarBodyWnd::Show() -{ - InventoryUtilities::SendInfoToActor ("ui_car_body"); - inherited::Show (); - SetCurrentItem (NULL); -// InventoryUtilities::UpdateWeight (*m_pUIOurBagWnd); -} - -void CUICarBodyWnd::DisableAll() -{ - m_pUIOurBagWnd->Enable (false); - m_pUIOthersBagWnd->Enable (false); -} - -void CUICarBodyWnd::EnableAll() -{ - m_pUIOurBagWnd->Enable (true); - m_pUIOthersBagWnd->Enable (true); -} - -CUICellItem* CUICarBodyWnd::CurrentItem() -{ - return m_pCurrentCellItem; -} - -PIItem CUICarBodyWnd::CurrentIItem() -{ - return (m_pCurrentCellItem)?(PIItem)m_pCurrentCellItem->m_pData : NULL; -} - -void CUICarBodyWnd::SetCurrentItem(CUICellItem* itm) -{ - if(m_pCurrentCellItem == itm) return; - m_pCurrentCellItem = itm; - m_pUIItemInfo->InitItem(CurrentIItem()); -} - -void CUICarBodyWnd::TakeAll() -{ - u32 cnt = m_pUIOthersBagList->ItemsCount(); - u16 tmp_id = 0; - if(m_pInventoryBox){ - tmp_id = (smart_cast(m_pOurObject))->ID(); - } - - for(u32 i=0; iGetItemIdx(i); - for(u32 j=0; jChildsCount(); ++j) - { - PIItem _itm = (PIItem)(ci->Child(j)->m_pData); - if(m_pOthersObject) - TransferItem (_itm, m_pOthersObject, m_pOurObject, false); - else{ - move_item (m_pInventoryBox->ID(), tmp_id, _itm->object().ID()); -//. Actor()->callback(GameObject::eInvBoxItemTake)( m_pInventoryBox->lua_game_object(), _itm->object().lua_game_object() ); - } - - } - PIItem itm = (PIItem)(ci->m_pData); - if(m_pOthersObject) - TransferItem (itm, m_pOthersObject, m_pOurObject, false); - else{ - move_item (m_pInventoryBox->ID(), tmp_id, itm->object().ID()); -//. Actor()->callback(GameObject::eInvBoxItemTake)(m_pInventoryBox->lua_game_object(), itm->object().lua_game_object() ); - } - - } -} - - -#include "../xr_level_controller.h" - -bool CUICarBodyWnd::OnKeyboard(int dik, EUIMessages keyboard_action) -{ - if( inherited::OnKeyboard(dik,keyboard_action) )return true; - - if(keyboard_action==WINDOW_KEY_PRESSED && is_binded(kUSE, dik)) - { - GetHolder()->StartStopMenu(this,true); - return true; - } - return false; -} - -#include "../Medkit.h" -#include "../Antirad.h" - -void CUICarBodyWnd::ActivatePropertiesBox() -{ - if(m_pInventoryBox) return; - - m_pUIPropertiesBox->RemoveAll(); - -//. CWeaponMagazined* pWeapon = smart_cast(CurrentIItem()); - CEatableItem* pEatableItem = smart_cast(CurrentIItem()); - CMedkit* pMedkit = smart_cast (CurrentIItem()); - CAntirad* pAntirad = smart_cast (CurrentIItem()); - CBottleItem* pBottleItem = smart_cast (CurrentIItem()); - bool b_show = false; - - LPCSTR _action = NULL; - if(pMedkit || pAntirad) - { - _action = "st_use"; - b_show = true; - } - else if(pEatableItem) - { - if(pBottleItem) - _action = "st_drink"; - else - _action = "st_eat"; - b_show = true; - } - if(_action) - m_pUIPropertiesBox->AddItem(_action, NULL, INVENTORY_EAT_ACTION); - - - if(b_show){ - m_pUIPropertiesBox->AutoUpdateSize (); - m_pUIPropertiesBox->BringAllToTop (); - - Fvector2 cursor_pos; - Frect vis_rect; - - GetAbsoluteRect (vis_rect); - cursor_pos = GetUICursor()->GetCursorPosition(); - cursor_pos.sub (vis_rect.lt); - m_pUIPropertiesBox->Show (vis_rect, cursor_pos); - } -} - -void CUICarBodyWnd::EatItem() -{ - CActor *pActor = smart_cast(Level().CurrentEntity()); - if(!pActor) return; - - NET_Packet P; - CGameObject::u_EventGen (P, GEG_PLAYER_ITEM_EAT, Actor()->ID()); - P.w_u16 (CurrentIItem()->object().ID()); - CGameObject::u_EventSend (P); - -} - - -bool CUICarBodyWnd::OnItemDrop(CUICellItem* itm) -{ - CUIDragDropListEx* old_owner = itm->OwnerList(); - CUIDragDropListEx* new_owner = CUIDragDropListEx::m_drag_item->BackList(); - - if(old_owner==new_owner || !old_owner || !new_owner || (false&&new_owner==m_pUIOthersBagList&&m_pInventoryBox)) - return true; - - if(m_pOthersObject) - { - if( TransferItem ( CurrentIItem(), - (old_owner==m_pUIOthersBagList)?m_pOthersObject:m_pOurObject, - (old_owner==m_pUIOurBagList)?m_pOthersObject:m_pOurObject, - (old_owner==m_pUIOurBagList) - ) - ) - { - CUICellItem* ci = old_owner->RemoveItem(CurrentItem(), false); - new_owner->SetItem (ci); - } - }else - { - u16 tmp_id = (smart_cast(m_pOurObject))->ID(); - - bool bMoveDirection = (old_owner==m_pUIOthersBagList); - - move_item ( - bMoveDirection?m_pInventoryBox->ID():tmp_id, - bMoveDirection?tmp_id:m_pInventoryBox->ID(), - CurrentIItem()->object().ID()); - - -// Actor()->callback (GameObject::eInvBoxItemTake)(m_pInventoryBox->lua_game_object(), CurrentIItem()->object().lua_game_object() ); - - CUICellItem* ci = old_owner->RemoveItem(CurrentItem(), false); - new_owner->SetItem (ci); - } - SetCurrentItem (NULL); - - return true; -} - -bool CUICarBodyWnd::OnItemStartDrag(CUICellItem* itm) -{ - return false; //default behaviour -} - -bool CUICarBodyWnd::OnItemDbClick(CUICellItem* itm) -{ - CUIDragDropListEx* old_owner = itm->OwnerList(); - CUIDragDropListEx* new_owner = (old_owner==m_pUIOthersBagList)?m_pUIOurBagList:m_pUIOthersBagList; - - if(m_pOthersObject) - { - if( TransferItem ( CurrentIItem(), - (old_owner==m_pUIOthersBagList)?m_pOthersObject:m_pOurObject, - (old_owner==m_pUIOurBagList)?m_pOthersObject:m_pOurObject, - (old_owner==m_pUIOurBagList) - ) - ) - { - CUICellItem* ci = old_owner->RemoveItem(CurrentItem(), false); - new_owner->SetItem (ci); - } - }else - { - if(false && old_owner==m_pUIOurBagList) return true; - bool bMoveDirection = (old_owner==m_pUIOthersBagList); - - u16 tmp_id = (smart_cast(m_pOurObject))->ID(); - move_item ( - bMoveDirection?m_pInventoryBox->ID():tmp_id, - bMoveDirection?tmp_id:m_pInventoryBox->ID(), - CurrentIItem()->object().ID()); -//. Actor()->callback (GameObject::eInvBoxItemTake)(m_pInventoryBox->lua_game_object(), CurrentIItem()->object().lua_game_object() ); - - } - SetCurrentItem (NULL); - - return true; -} - -bool CUICarBodyWnd::OnItemSelected(CUICellItem* itm) -{ - SetCurrentItem (itm); - return false; -} - -bool CUICarBodyWnd::OnItemRButtonClick(CUICellItem* itm) -{ - SetCurrentItem (itm); - ActivatePropertiesBox (); - return false; -} - -void move_item (u16 from_id, u16 to_id, u16 what_id) -{ - NET_Packet P; - CGameObject::u_EventGen ( P, - GE_OWNERSHIP_REJECT, - from_id - ); - - P.w_u16 (what_id); - CGameObject::u_EventSend (P); - - //äðóãîìó èíâåíòàðþ - âçÿòü âåùü - CGameObject::u_EventGen ( P, - GE_OWNERSHIP_TAKE, - to_id - ); - P.w_u16 (what_id); - CGameObject::u_EventSend (P); - -} - -bool CUICarBodyWnd::TransferItem(PIItem itm, CInventoryOwner* owner_from, CInventoryOwner* owner_to, bool b_check) -{ - VERIFY (NULL==m_pInventoryBox); - CGameObject* go_from = smart_cast(owner_from); - CGameObject* go_to = smart_cast(owner_to); - - if(smart_cast(go_to)) return false; - if(b_check) - { - float invWeight = owner_to->inventory().CalcTotalWeight(); - float maxWeight = owner_to->inventory().GetMaxWeight(); - float itmWeight = itm->Weight(); - if(invWeight+itmWeight >=maxWeight) return false; - } - - move_item(go_from->ID(), go_to->ID(), itm->object().ID()); - - return true; -} - -void CUICarBodyWnd::BindDragDropListEnents(CUIDragDropListEx* lst) -{ - lst->m_f_item_drop = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUICarBodyWnd::OnItemDrop); - lst->m_f_item_start_drag = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUICarBodyWnd::OnItemStartDrag); - lst->m_f_item_db_click = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUICarBodyWnd::OnItemDbClick); - lst->m_f_item_selected = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUICarBodyWnd::OnItemSelected); - lst->m_f_item_rbutton_click = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUICarBodyWnd::OnItemRButtonClick); -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UICarBodyWnd.h b/src/xrGame/ui/UICarBodyWnd.h deleted file mode 100644 index 6c7decb025d..00000000000 --- a/src/xrGame/ui/UICarBodyWnd.h +++ /dev/null @@ -1,99 +0,0 @@ -#pragma once - -#include "UIDialogWnd.h" -#include "UIEditBox.h" -#include "../../xrServerEntities/inventory_space.h" -/* -class CUIDragDropListEx; -class CUIItemInfo; -class CUICharacterInfo; -class CUIPropertiesBox; -class CUI3tButton; -class CUICellItem; -class CInventoryBox; -class CInventoryOwner; - -class CUICarBodyWnd: public CUIDialogWnd -{ -private: - typedef CUIDialogWnd inherited; - bool m_b_need_update; -public: - CUICarBodyWnd (); - virtual ~CUICarBodyWnd (); - - virtual void Init (); - virtual bool StopAnyMove (){return true;} - - virtual void SendMessage (CUIWindow *pWnd, s16 msg, void *pData); - - void InitCarBody (CInventoryOwner* pOurInv, CInventoryOwner* pOthersInv); - void InitCarBody (CInventoryOwner* pOur, CInventoryBox* pInvBox); - virtual void Draw (); - virtual void Update (); - - virtual void Show (); - virtual void Hide (); - - void DisableAll (); - void EnableAll (); - virtual bool OnKeyboard (int dik, EUIMessages keyboard_action); - - void UpdateLists_delayed (); - -protected: - CInventoryOwner* m_pOurObject; - - CInventoryOwner* m_pOthersObject; - CInventoryBox* m_pInventoryBox; - - CUIDragDropListEx* m_pUIOurBagList; - CUIDragDropListEx* m_pUIOthersBagList; - - CUIStatic* m_pUIStaticTop; - CUIStatic* m_pUIStaticBottom; - - CUIFrameWindow* m_pUIDescWnd; - CUIStatic* m_pUIStaticDesc; - CUIItemInfo* m_pUIItemInfo; - - CUIStatic* m_pUIOurBagWnd; - CUIStatic* m_pUIOthersBagWnd; - - //èíôîðìàöèÿ î ïåðñîíàæàõ - CUIStatic* m_pUIOurIcon; - CUIStatic* m_pUIOthersIcon; - CUICharacterInfo* m_pUICharacterInfoLeft; - CUICharacterInfo* m_pUICharacterInfoRight; - CUIPropertiesBox* m_pUIPropertiesBox; - CUI3tButton* m_pUITakeAll; - - CUICellItem* m_pCurrentCellItem; - - void UpdateLists (); - - void ActivatePropertiesBox (); - void EatItem (); - - bool ToOurBag (); - bool ToOthersBag (); - - void SetCurrentItem (CUICellItem* itm); - CUICellItem* CurrentItem (); - PIItem CurrentIItem (); - - // Âçÿòü âñå - void TakeAll (); - - - bool xr_stdcall OnItemDrop (CUICellItem* itm); - bool xr_stdcall OnItemStartDrag (CUICellItem* itm); - bool xr_stdcall OnItemDbClick (CUICellItem* itm); - bool xr_stdcall OnItemSelected (CUICellItem* itm); - bool xr_stdcall OnItemRButtonClick (CUICellItem* itm); - - bool TransferItem (PIItem itm, CInventoryOwner* owner_from, CInventoryOwner* owner_to, bool b_check); - void BindDragDropListEnents (CUIDragDropListEx* lst); - -}; -*/ diff --git a/src/xrGame/ui/UICellCustomItems.cpp b/src/xrGame/ui/UICellCustomItems.cpp index 08477d66768..b310952008e 100644 --- a/src/xrGame/ui/UICellCustomItems.cpp +++ b/src/xrGame/ui/UICellCustomItems.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "UICellCustomItems.h" #include "UIInventoryUtilities.h" -#include "../Weapon.h" +#include "Weapon.h" #include "UIDragDropListEx.h" #include "UIProgressBar.h" @@ -193,7 +193,7 @@ CUIWeaponCellItem::CUIWeaponCellItem(CWeapon* itm) m_addon_offset[eLauncher].set(object()->GetGrenadeLauncherX(), object()->GetGrenadeLauncherY()); } -#include "../xrServerEntities/object_broker.h" +#include "xrServerEntities/object_broker.h" CUIWeaponCellItem::~CUIWeaponCellItem() { } diff --git a/src/xrGame/ui/UICellCustomItems.h b/src/xrGame/ui/UICellCustomItems.h index 97f7c901e4f..279c2c75e8b 100644 --- a/src/xrGame/ui/UICellCustomItems.h +++ b/src/xrGame/ui/UICellCustomItems.h @@ -1,6 +1,6 @@ #pragma once #include "UICellItem.h" -#include "../Weapon.h" +#include "Weapon.h" class CUIInventoryCellItem :public CUICellItem diff --git a/src/xrGame/ui/UICellItem.cpp b/src/xrGame/ui/UICellItem.cpp index 32d27032c11..14a0d570efe 100644 --- a/src/xrGame/ui/UICellItem.cpp +++ b/src/xrGame/ui/UICellItem.cpp @@ -1,15 +1,14 @@ #include "stdafx.h" #include "UICellItem.h" #include "uicursor.h" -#include "../inventory_item.h" +#include "inventory_item.h" #include "UIDragDropListEx.h" -#include "../xr_level_controller.h" -#include "../../xrEngine/xr_input.h" -#include "../level.h" +#include "xr_level_controller.h" +#include "xrEngine/xr_input.h" +#include "Level.h" #include "object_broker.h" #include "UIXmlInit.h" #include "UIProgressBar.h" - #include "Weapon.h" #include "CustomOutfit.h" #include "ActorHelmet.h" diff --git a/src/xrGame/ui/UIChangeMap.cpp b/src/xrGame/ui/UIChangeMap.cpp index 7a095ae0189..26bb2195ea0 100644 --- a/src/xrGame/ui/UIChangeMap.cpp +++ b/src/xrGame/ui/UIChangeMap.cpp @@ -5,14 +5,13 @@ #include "UI3tButton.h" #include "UIListBox.h" #include "UIListBoxItem.h" -#include "../level.h" -#include "../game_cl_teamdeathmatch.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "Level.h" +#include "game_cl_teamdeathmatch.h" +#include "xrEngine/xr_ioconsole.h" #include "UIMapList.h" - #include "object_broker.h" -#include "../UIGameCustom.h" -#include "../UIDialogHolder.h" +#include "UIGameCustom.h" +#include "UIDialogHolder.h" xr_token game_types []; @@ -140,7 +139,7 @@ void CUIChangeMap::OnBtnOk() HideDialog (); } } -#include "../string_table.h" +#include "string_table.h" void CUIChangeMap::FillUpList() { lst->Clear (); diff --git a/src/xrGame/ui/UICharacterInfo.cpp b/src/xrGame/ui/UICharacterInfo.cpp index ae471e3d690..8d87630f502 100644 --- a/src/xrGame/ui/UICharacterInfo.cpp +++ b/src/xrGame/ui/UICharacterInfo.cpp @@ -3,11 +3,11 @@ #include "UIInventoryUtilities.h" #include "uicharacterinfo.h" -#include "../actor.h" -#include "../level.h" -#include "../../xrServerEntities/character_info.h" -#include "../string_table.h" -#include "../relation_registry.h" +#include "Actor.h" +#include "Level.h" +#include "xrServerEntities/character_info.h" +#include "string_table.h" +#include "relation_registry.h" #include "xrUIXmlParser.h" #include "UIXmlInit.h" @@ -16,11 +16,11 @@ #include "UIScrollView.h" -#include "../alife_simulator.h" -#include "../ai_space.h" -#include "../alife_object_registry.h" -#include "../xrServer.h" -#include "../../xrServerEntities/xrServer_Objects_ALife_Monsters.h" +#include "alife_simulator.h" +#include "ai_space.h" +#include "alife_object_registry.h" +#include "xrServer.h" +#include "xrServerEntities/xrServer_Objects_ALife_Monsters.h" using namespace InventoryUtilities; diff --git a/src/xrGame/ui/UICharacterInfo.h b/src/xrGame/ui/UICharacterInfo.h index 9fbd1f153c9..a6d9851ef55 100644 --- a/src/xrGame/ui/UICharacterInfo.h +++ b/src/xrGame/ui/UICharacterInfo.h @@ -4,7 +4,7 @@ #pragma once #include "uiwindow.h" -#include "../../xrServerEntities/alife_space.h" +#include "xrServerEntities/alife_space.h" #include "character_info_defs.h" class CUIStatic; diff --git a/src/xrGame/ui/UIChatWnd.cpp b/src/xrGame/ui/UIChatWnd.cpp index 7402300fd0d..635d8b1ee73 100644 --- a/src/xrGame/ui/UIChatWnd.cpp +++ b/src/xrGame/ui/UIChatWnd.cpp @@ -6,9 +6,9 @@ #include "UIHelper.h" #include "xrUIXmlParser.h" #include "UIDialogHolder.h" -#include "../game_cl_base.h" -#include "../xr_level_controller.h" -#include "../Level.h" +#include "game_cl_base.h" +#include "xr_level_controller.h" +#include "Level.h" CUIChatWnd::CUIChatWnd() : sendNextMessageToAll (true) diff --git a/src/xrGame/ui/UICheckButton.cpp b/src/xrGame/ui/UICheckButton.cpp index dbbb7c87af1..e1f9f90d0db 100644 --- a/src/xrGame/ui/UICheckButton.cpp +++ b/src/xrGame/ui/UICheckButton.cpp @@ -6,7 +6,7 @@ #include ".\uicheckbutton.h" #include "UIXmlInit.h" #include "UIHint.h" -#include "../../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" CUICheckButton::CUICheckButton() { diff --git a/src/xrGame/ui/UIComboBox.cpp b/src/xrGame/ui/UIComboBox.cpp index 0364655c83a..d4e258f2b56 100644 --- a/src/xrGame/ui/UIComboBox.cpp +++ b/src/xrGame/ui/UIComboBox.cpp @@ -3,7 +3,7 @@ #include "UITextureMaster.h" #include "UIScrollBar.h" #include "uilistboxitem.h" -#include "../string_table.h" +#include "string_table.h" #define CB_HEIGHT 20.0f diff --git a/src/xrGame/ui/UICustomEdit.cpp b/src/xrGame/ui/UICustomEdit.cpp index 2bee5e0ff2d..b2fe9fadadd 100644 --- a/src/xrGame/ui/UICustomEdit.cpp +++ b/src/xrGame/ui/UICustomEdit.cpp @@ -3,8 +3,8 @@ #include "UICustomEdit.h" #include "UILines.h" -#include "../../xrEngine/line_edit_control.h" -#include "../../xrEngine/xr_input.h" +#include "xrEngine/line_edit_control.h" +#include "xrEngine/xr_input.h" CUICustomEdit::CUICustomEdit() { diff --git a/src/xrGame/ui/UIDebugFonts.cpp b/src/xrGame/ui/UIDebugFonts.cpp index 48b30502a32..af2ea5392b3 100644 --- a/src/xrGame/ui/UIDebugFonts.cpp +++ b/src/xrGame/ui/UIDebugFonts.cpp @@ -33,7 +33,7 @@ bool CUIDebugFonts::OnKeyboardAction(int dik, EUIMessages keyboard_action){ return true; } -#include "../string_table.h" +#include "string_table.h" void CUIDebugFonts::FillUpList(){ CFontManager::FONTS_VEC& v = UI().Font().m_all_fonts; diff --git a/src/xrGame/ui/UIDemoPlayControl.cpp b/src/xrGame/ui/UIDemoPlayControl.cpp index e4050beb689..03ef7a23e9e 100644 --- a/src/xrGame/ui/UIDemoPlayControl.cpp +++ b/src/xrGame/ui/UIDemoPlayControl.cpp @@ -8,9 +8,9 @@ #include #include "UIDemoPlayControl.h" #include "UICursor.h" -#include "../xrEngine/XR_IOConsole.h" +#include "xrEngine/XR_IOConsole.h" #include "string_table.h" -#include "level.h" +#include "Level.h" #include "demoinfo.h" #include "demoplay_control.h" diff --git a/src/xrGame/ui/UIDialogWnd.h b/src/xrGame/ui/UIDialogWnd.h index a67c99f203f..39d460be4a2 100644 --- a/src/xrGame/ui/UIDialogWnd.h +++ b/src/xrGame/ui/UIDialogWnd.h @@ -1,7 +1,7 @@ #pragma once - #include "uiwindow.h" -#include "../UIDialogHolder.h" +#include "UIDialogHolder.h" + class CDialogHolder; class CUIDialogWnd : public CUIWindow diff --git a/src/xrGame/ui/UIDiaryWnd2.cpp b/src/xrGame/ui/UIDiaryWnd2.cpp deleted file mode 100644 index 9dea97bd1d1..00000000000 --- a/src/xrGame/ui/UIDiaryWnd2.cpp +++ /dev/null @@ -1,274 +0,0 @@ -#include "stdafx.h" -#include "UIDiaryWnd.h" - -/* -#include "UIFrameWindow.h" -#include "UIFrameLineWnd.h" -#include "UINewsWnd.h" -#include "UIAnimatedStatic.h" -#include "UIXmlInit.h" -#include "object_broker.h" -#include "UITabControl.h" -#include "UIScrollView.h" -#include "UIListWnd.h" -#include "UITreeViewItem.h" -#include "UIEncyclopediaArticleWnd.h" -#include "../level.h" -#include "../actor.h" -#include "../alife_registry_wrappers.h" -#include "../encyclopedia_article.h" - -extern u32 g_pda_info_state; - -CUIDiaryWnd::CUIDiaryWnd() -{ -} - -CUIDiaryWnd::~CUIDiaryWnd() -{ - delete_data(m_UINewsWnd); - delete_data(m_SrcListWnd); - delete_data(m_DescrView); - delete_data(m_ArticlesDB); - delete_data(m_updatedSectionImage); - delete_data(m_oldSectionImage); -} - -void CUIDiaryWnd::Show(bool status) -{ - inherited::Show (status); - if(status) - Reload( m_FilterTab->GetActiveId() ); -} - -void RearrangeTabButtons(CUITabControl* pTab);//, xr_vector& vec_sign_places); - -void CUIDiaryWnd::Init() -{ - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH, "events_new.xml"); - CUIXmlInit xml_init; - - xml_init.InitWindow (uiXml, "main_wnd", 0, this); - - m_UILeftFrame = xr_new(); m_UILeftFrame->SetAutoDelete(true); - xml_init.InitFrameWindow (uiXml,"main_wnd:left_frame",0,m_UILeftFrame); - AttachChild (m_UILeftFrame); - - m_UILeftHeader = xr_new(); m_UILeftHeader->SetAutoDelete(true); - xml_init.InitFrameLine (uiXml, "main_wnd:left_frame:left_frame_header", 0, m_UILeftHeader); - m_UILeftFrame->AttachChild (m_UILeftHeader); - - m_FilterTab = xr_new();m_FilterTab->SetAutoDelete(true); - m_UILeftHeader->AttachChild (m_FilterTab); - xml_init.InitTabControl (uiXml, "main_wnd:left_frame:left_frame_header:filter_tab", 0, m_FilterTab); - m_FilterTab->SetWindowName ("filter_tab"); - Register (m_FilterTab); - AddCallback ("filter_tab",TAB_CHANGED,CUIWndCallback::void_function(this,&CUIDiaryWnd::OnFilterChanged)); - - m_UIAnimation = xr_new(); m_UIAnimation->SetAutoDelete(true); - xml_init.InitAnimatedStatic (uiXml, "main_wnd:left_frame:left_frame_header:anim_static", 0, m_UIAnimation); - m_UILeftHeader->AttachChild (m_UIAnimation); - - - m_UILeftWnd = xr_new(); m_UILeftWnd->SetAutoDelete(true); - xml_init.InitWindow (uiXml, "main_wnd:left_frame:work_area", 0, m_UILeftWnd); - m_UILeftFrame->AttachChild (m_UILeftWnd); - - m_SrcListWnd = xr_new(); m_SrcListWnd->SetAutoDelete(false); - xml_init.InitListWnd (uiXml, "main_wnd:left_frame:work_area:src_list", 0, m_SrcListWnd); - m_SrcListWnd->SetWindowName ("src_list"); - Register (m_SrcListWnd); - AddCallback ("src_list",LIST_ITEM_CLICKED,CUIWndCallback::void_function(this,&CUIDiaryWnd::OnSrcListItemClicked)); - - xml_init.InitFont (uiXml, "main_wnd:left_frame:work_area:src_list:tree_item_font", 0, m_uTreeItemColor, m_pTreeItemFont); - R_ASSERT (m_pTreeItemFont); - xml_init.InitFont (uiXml, "main_wnd:left_frame:work_area:src_list:tree_root_font", 0, m_uTreeRootColor, m_pTreeRootFont); - R_ASSERT (m_pTreeRootFont); - - m_UIRightFrame = xr_new(); m_UIRightFrame->SetAutoDelete(true); - xml_init.InitFrameWindow (uiXml,"main_wnd:right_frame",0,m_UIRightFrame); - AttachChild (m_UIRightFrame); - - m_UIRightHeader = xr_new(); m_UIRightHeader->SetAutoDelete(true); - xml_init.InitFrameLine (uiXml, "main_wnd:right_frame:right_frame_header", 0, m_UIRightHeader); - m_UIRightFrame->AttachChild (m_UIRightHeader); - - m_UIRightWnd = xr_new(); m_UIRightWnd->SetAutoDelete(true); - xml_init.InitWindow (uiXml, "main_wnd:right_frame:work_area", 0, m_UIRightWnd); - m_UIRightFrame->AttachChild (m_UIRightWnd); - - m_UINewsWnd = xr_new();m_UINewsWnd->SetAutoDelete(false); - m_UINewsWnd->Init (); - - m_DescrView = xr_new(); m_DescrView->SetAutoDelete(false); - xml_init.InitScrollView (uiXml, "main_wnd:right_frame:work_area:scroll_view", 0, m_DescrView); - - m_updatedSectionImage = xr_new(); - xml_init.InitStatic (uiXml, "updated_section_static", 0, m_updatedSectionImage); - - m_oldSectionImage = xr_new(); - xml_init.InitStatic (uiXml, "old_section_static", 0, m_oldSectionImage); - - RearrangeTabButtons (m_FilterTab);//, m_sign_places); -} - -void CUIDiaryWnd::SendMessage (CUIWindow* pWnd, s16 msg, void* pData) -{ - CUIWndCallback::OnEvent(pWnd, msg, pData); -} - -void CUIDiaryWnd::OnFilterChanged (CUIWindow* w, void*) -{ - Reload( m_FilterTab->GetActiveId() ); -} - -void CUIDiaryWnd::Reload (const shared_str& new_filter) -{ - if(m_currFilter=="eJournal") - { - UnloadJournalTab (); - }else - if(m_currFilter=="eNews") - { - UnloadNewsTab (); - }; - - m_currFilter = new_filter; - - if(m_currFilter=="eJournal") - { - LoadJournalTab (ARTICLE_DATA::eJournalArticle); - }else - if(m_currFilter=="eNews") - { - LoadNewsTab (); - }; -} - -void CUIDiaryWnd::AddNews () -{ - m_UINewsWnd->AddNews (); -} - -void CUIDiaryWnd::MarkNewsAsRead (bool status) -{ - -} - -void CUIDiaryWnd::UnloadJournalTab () -{ - m_UILeftWnd->DetachChild (m_SrcListWnd); - m_SrcListWnd->RemoveAll (); - m_SrcListWnd->Show (false); - - m_UIRightWnd->DetachChild (m_DescrView); - m_DescrView->Show (false); - delete_data (m_ArticlesDB); - m_DescrView->Clear (); -} - -void CUIDiaryWnd::LoadJournalTab (ARTICLE_DATA::EArticleType _type) -{ - delete_data (m_ArticlesDB); - - m_UILeftWnd->AttachChild (m_SrcListWnd); - m_SrcListWnd->Show (true); - - m_UIRightWnd->AttachChild (m_DescrView); - m_DescrView->Show (true); - - if(Actor()->encyclopedia_registry->registry().objects_ptr()) - { - ARTICLE_VECTOR::const_iterator it = Actor()->encyclopedia_registry->registry().objects_ptr()->begin(); - for(; it != Actor()->encyclopedia_registry->registry().objects_ptr()->end(); it++) - { - if (_type == it->article_type) - - { - m_ArticlesDB.resize(m_ArticlesDB.size() + 1); - CEncyclopediaArticle*& a = m_ArticlesDB.back(); - a = xr_new(); - a->Load(it->article_id); - - bool bReaded = false; - CreateTreeBranch(a->data()->group, a->data()->name, m_SrcListWnd, m_ArticlesDB.size()-1, - m_pTreeRootFont, m_uTreeRootColor, m_pTreeItemFont, m_uTreeItemColor, bReaded); - } - } - } -//. g_pda_info_state &= !pda_section::journal; -} - -void CUIDiaryWnd::UnloadInfoTab () -{ - UnloadJournalTab (); -} - -void CUIDiaryWnd::LoadInfoTab () -{ - LoadJournalTab (ARTICLE_DATA::eInfoArticle); -//. g_pda_info_state &= ~pda_section::info; -} - - -void CUIDiaryWnd::UnloadNewsTab () -{ - m_UIRightWnd->DetachChild (m_UINewsWnd); - m_UINewsWnd->Show (false); -} - -void CUIDiaryWnd::LoadNewsTab () -{ - m_UIRightWnd->AttachChild (m_UINewsWnd); - m_UINewsWnd->Show (true); -//. g_pda_info_state &= ~pda_section::news; -} - -void CUIDiaryWnd::OnSrcListItemClicked (CUIWindow* w,void* p) -{ - CUITreeViewItem* pSelItem = (CUITreeViewItem*)p; - m_DescrView->Clear (); - if (!pSelItem->IsRoot()) - { - CUIEncyclopediaArticleWnd* article_info = xr_new(); - article_info->Init ("encyclopedia_item.xml","encyclopedia_wnd:objective_item"); - article_info->SetArticle (m_ArticlesDB[pSelItem->GetValue()]); - m_DescrView->AddWindow (article_info, true); - } -} - -void draw_sign(CUIStatic* s, Fvector2& pos); -void CUIDiaryWnd::Draw() -{ - inherited::Draw (); -/* - m_updatedSectionImage->Update (); - m_oldSectionImage->Update (); - - Fvector2 tab_pos; - m_FilterTab->GetAbsolutePos (tab_pos); - - Fvector2 pos; - pos = m_sign_places[eNews]; - pos.add(tab_pos); - if(g_pda_info_state&pda_section::news) - draw_sign (m_updatedSectionImage, pos); - else - draw_sign (m_oldSectionImage, pos); - - - pos = m_sign_places[eJournal]; - pos.add(tab_pos); - if(g_pda_info_state&pda_section::journal) - draw_sign (m_updatedSectionImage, pos); - else - draw_sign (m_oldSectionImage, pos); -* -} - -void CUIDiaryWnd::Reset() -{ - inherited::Reset (); -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIDragDropReferenceList.cpp b/src/xrGame/ui/UIDragDropReferenceList.cpp index 09e7e68708f..98a358d3818 100644 --- a/src/xrGame/ui/UIDragDropReferenceList.cpp +++ b/src/xrGame/ui/UIDragDropReferenceList.cpp @@ -3,13 +3,13 @@ #include "UICellItem.h" #include "UICellItemFactory.h" #include "UIStatic.h" -#include "../inventory.h" -#include "../inventoryOwner.h" -#include "../actor.h" -#include "../actor_defs.h" +#include "Inventory.h" +#include "inventoryOwner.h" +#include "Actor.h" +#include "actor_defs.h" #include "UIInventoryUtilities.h" -#include "../../xrEngine/xr_input.h" -#include "../UICursor.h" +#include "xrEngine/xr_input.h" +#include "UICursor.h" #include "UICellItemFactory.h" CUIDragDropReferenceList::CUIDragDropReferenceList() diff --git a/src/xrGame/ui/UIDragDropReferenceList.h b/src/xrGame/ui/UIDragDropReferenceList.h index cede0d362e8..dea1c2a684f 100644 --- a/src/xrGame/ui/UIDragDropReferenceList.h +++ b/src/xrGame/ui/UIDragDropReferenceList.h @@ -1,6 +1,6 @@ #pragma once #include "UIDragDropListEx.h" -#include "../../xrServerEntities/inventory_space.h" +#include "xrServerEntities/inventory_space.h" class CInventoryOwner; class CUIDragDropReferenceList : public CUIDragDropListEx diff --git a/src/xrGame/ui/UIEditBox.h b/src/xrGame/ui/UIEditBox.h index 6c017ac7c9f..9bfd5b7f5ed 100644 --- a/src/xrGame/ui/UIEditBox.h +++ b/src/xrGame/ui/UIEditBox.h @@ -1,5 +1,5 @@ #pragma once -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" #include "UIOptionsItem.h" #include "UICustomEdit.h" class CUIFrameLineWnd; diff --git a/src/xrGame/ui/UIEditKeyBind.cpp b/src/xrGame/ui/UIEditKeyBind.cpp index fb661031c2f..cd70891b953 100644 --- a/src/xrGame/ui/UIEditKeyBind.cpp +++ b/src/xrGame/ui/UIEditKeyBind.cpp @@ -1,9 +1,9 @@ #include "stdafx.h" #include "UIEditKeyBind.h" -#include "../xr_level_controller.h" +#include "xr_level_controller.h" #include "object_broker.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" CUIEditKeyBind::CUIEditKeyBind(bool bPrim) { diff --git a/src/xrGame/ui/UIEncyclopediaArticleWnd.cpp b/src/xrGame/ui/UIEncyclopediaArticleWnd.cpp deleted file mode 100644 index bc3bb0e1bd0..00000000000 --- a/src/xrGame/ui/UIEncyclopediaArticleWnd.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "stdafx.h" -#include "UIEncyclopediaArticleWnd.h" -#include "UIStatic.h" -#include "../encyclopedia_article.h" -#include "UIXmlInit.h" -#include "../string_table.h" -#include "../../Include/xrRender/UIShader.h" - -CUIEncyclopediaArticleWnd::CUIEncyclopediaArticleWnd () -:m_Article(NULL) -{ -} - -CUIEncyclopediaArticleWnd::~CUIEncyclopediaArticleWnd () -{ -} - -void CUIEncyclopediaArticleWnd::Init(LPCSTR xml_name, LPCSTR start_from) -{ - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH, xml_name); - - CUIXmlInit xml_init; - - string512 str; - - strcpy_s (str,sizeof(str),start_from); - xml_init.InitWindow (uiXml,str,0,this); - - strconcat (sizeof(str),str,start_from,":image"); - m_UIImage = xr_new(); m_UIImage->SetAutoDelete(true); - xml_init.InitStatic (uiXml,str,0,m_UIImage); - AttachChild (m_UIImage); - - strconcat (sizeof(str),str,start_from,":text_cont"); - m_UIText = xr_new(); m_UIText->SetAutoDelete(true); - xml_init.InitStatic (uiXml,str,0,m_UIText); - AttachChild (m_UIText); -} - -void CUIEncyclopediaArticleWnd::SetArticle(CEncyclopediaArticle* article) -{ - if( article->data()->image.GetShader() && article->data()->image.GetShader()->inited()) - { - m_UIImage->SetShader (article->data()->image.GetShader()); - m_UIImage->SetOriginalRect (article->data()->image.GetStaticItem()->GetOriginalRect()); - m_UIImage->SetWndSize (article->data()->image.GetWndSize()); - - float img_x = (GetWidth()-m_UIImage->GetWidth())/2.0f; - img_x = _max(0.0f, img_x); - m_UIImage->SetWndPos (Fvector2().set(img_x ,m_UIImage->GetWndPos().y) ); - }; - m_UIText->SetText (*CStringTable().translate(article->data()->text.c_str())); - m_UIText->AdjustHeightToText (); - - AdjustLauout (); -} - -void CUIEncyclopediaArticleWnd::AdjustLauout() -{ - m_UIText->SetWndPos (Fvector2().set(m_UIText->GetWndPos().x, m_UIImage->GetWndPos().y + m_UIImage->GetHeight())); - SetHeight (m_UIImage->GetWndPos().y + m_UIImage->GetHeight()+m_UIText->GetHeight()); -} - -void CUIEncyclopediaArticleWnd::SetArticle(LPCSTR article) -{ - CEncyclopediaArticle A; - A.Load (article); - SetArticle (&A); -} diff --git a/src/xrGame/ui/UIEncyclopediaArticleWnd.h b/src/xrGame/ui/UIEncyclopediaArticleWnd.h deleted file mode 100644 index ba472a86c60..00000000000 --- a/src/xrGame/ui/UIEncyclopediaArticleWnd.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -#include "UIWindow.h" - -class CUIStatic; -class CEncyclopediaArticle; - -class CUIEncyclopediaArticleWnd :public CUIWindow -{ -typedef CUIWindow inherited; - -CUIStatic* m_UIImage; -CUIStatic* m_UIText; -CEncyclopediaArticle* m_Article; - -protected: - void AdjustLauout (); - -public: - CUIEncyclopediaArticleWnd (); - virtual ~CUIEncyclopediaArticleWnd (); - void Init (LPCSTR xml_name, LPCSTR start_from); - void SetArticle (CEncyclopediaArticle*); - void SetArticle (LPCSTR); -}; \ No newline at end of file diff --git a/src/xrGame/ui/UIEncyclopediaWnd.cpp b/src/xrGame/ui/UIEncyclopediaWnd.cpp deleted file mode 100644 index 5d4c72f4de9..00000000000 --- a/src/xrGame/ui/UIEncyclopediaWnd.cpp +++ /dev/null @@ -1,252 +0,0 @@ -//============================================================================= -// Filename: UIEncyclopediaWnd.cpp -// Created by Roman E. Marchenko, vortex@gsc-game.kiev.ua -// Copyright 2004. GSC Game World -// --------------------------------------------------------------------------- -// Encyclopedia window -//============================================================================= - -#include "StdAfx.h" -#include "UIEncyclopediaWnd.h" -/*#include "UIXmlInit.h" -#include "UIFrameWindow.h" -#include "UIFrameLineWnd.h" -#include "UIAnimatedStatic.h" -#include "UIListWnd.h" -#include "UIScrollView.h" -#include "UITreeViewItem.h" -#include "UIEncyclopediaArticleWnd.h" -#include "../encyclopedia_article.h" -#include "../alife_registry_wrappers.h" -#include "../actor.h" -#include "object_broker.h" - -#define ENCYCLOPEDIA_DIALOG_XML "encyclopedia.xml" - -CUIEncyclopediaWnd::CUIEncyclopediaWnd() -{ - prevArticlesCount = 0; -} - -CUIEncyclopediaWnd::~CUIEncyclopediaWnd() -{ - DeleteArticles(); -} - - -void CUIEncyclopediaWnd::Init() -{ - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH, ENCYCLOPEDIA_DIALOG_XML); - - CUIXmlInit xml_init; - - xml_init.InitWindow (uiXml, "main_wnd", 0, this); - - // Load xml data - UIEncyclopediaIdxBkg = xr_new(); UIEncyclopediaIdxBkg->SetAutoDelete(true); - AttachChild(UIEncyclopediaIdxBkg); - xml_init.InitFrameWindow(uiXml, "right_frame_window", 0, UIEncyclopediaIdxBkg); - - xml_init.InitFont(uiXml, "tree_item_font", 0, m_uTreeItemColor, m_pTreeItemFont); - R_ASSERT(m_pTreeItemFont); - xml_init.InitFont(uiXml, "tree_root_font", 0, m_uTreeRootColor, m_pTreeRootFont); - R_ASSERT(m_pTreeRootFont); - - - UIEncyclopediaIdxHeader = xr_new(); UIEncyclopediaIdxHeader->SetAutoDelete(true); - UIEncyclopediaIdxBkg->AttachChild(UIEncyclopediaIdxHeader); - xml_init.InitFrameLine(uiXml, "right_frame_line", 0, UIEncyclopediaIdxHeader); - - UIAnimation = xr_new(); UIAnimation->SetAutoDelete(true); - UIEncyclopediaIdxHeader->AttachChild(UIAnimation); - xml_init.InitAnimatedStatic(uiXml, "a_static", 0, UIAnimation); - - UIEncyclopediaInfoBkg = xr_new();UIEncyclopediaInfoBkg->SetAutoDelete(true); - AttachChild(UIEncyclopediaInfoBkg); - xml_init.InitFrameWindow(uiXml, "left_frame_window", 0, UIEncyclopediaInfoBkg); - - UIEncyclopediaInfoHeader = xr_new();UIEncyclopediaInfoHeader->SetAutoDelete(true); - UIEncyclopediaInfoBkg->AttachChild(UIEncyclopediaInfoHeader); - -#pragma todo("implement this") -//. UIEncyclopediaInfoHeader->UITitleText.SetEllipsis(CUIStatic::eepBegin, 20); - xml_init.InitFrameLine(uiXml, "left_frame_line", 0, UIEncyclopediaInfoHeader); - - UIArticleHeader = xr_new(); UIArticleHeader->SetAutoDelete(true); - UIEncyclopediaInfoBkg->AttachChild(UIArticleHeader); - xml_init.InitStatic(uiXml, "article_header_static", 0, UIArticleHeader); - - UIIdxList = xr_new(); UIIdxList->SetAutoDelete(true); - UIEncyclopediaIdxBkg->AttachChild(UIIdxList); - xml_init.InitListWnd(uiXml, "idx_list", 0, UIIdxList); - UIIdxList->SetMessageTarget(this); - UIIdxList->EnableScrollBar(true); - - UIInfoList = xr_new(); UIInfoList->SetAutoDelete(true); - UIEncyclopediaInfoBkg->AttachChild(UIInfoList); - xml_init.InitScrollView(uiXml, "info_list", 0, UIInfoList); - - xml_init.InitAutoStatic(uiXml, "left_auto_static", UIEncyclopediaInfoBkg); - xml_init.InitAutoStatic(uiXml, "right_auto_static", UIEncyclopediaIdxBkg); -} - -#include "../string_table.h" -void CUIEncyclopediaWnd::SendMessage(CUIWindow *pWnd, s16 msg, void* pData) -{ - if (UIIdxList == pWnd && LIST_ITEM_CLICKED == msg) - { - CUITreeViewItem *pTVItem = static_cast(pData); - R_ASSERT (pTVItem); - - if( pTVItem->vSubItems.size() ) - { - CEncyclopediaArticle* A = m_ArticlesDB[pTVItem->vSubItems[0]->GetValue()]; - - xr_string caption = "# "; - caption += "/"; - caption += CStringTable().translate(A->data()->group).c_str(); - -#pragma todo("implement this") -//. UIEncyclopediaInfoHeader->UITitleText.SetText(caption.c_str()); - - UIArticleHeader->SetTextST(*(A->data()->group)); - SetCurrentArtice (NULL); - }else - { - CEncyclopediaArticle* A = m_ArticlesDB[pTVItem->GetValue()]; - -#pragma todo("implement this") -/* xr_string caption = "# "; - caption += "/"; - caption += CStringTable().translate(A->data()->group).c_str(); - caption += "/"; - caption += CStringTable().translate(A->data()->name).c_str(); - UIEncyclopediaInfoHeader->UITitleText.SetText(caption.c_str()); -* - SetCurrentArtice (pTVItem); - UIArticleHeader->SetTextST(*(A->data()->name)); - } - } - - inherited::SendMessage(pWnd, msg, pData); -} - -void CUIEncyclopediaWnd::Draw() -{ - -if( m_flags.test(eNeedReload )){ - if(Actor()->encyclopedia_registry->registry().objects_ptr() && Actor()->encyclopedia_registry->registry().objects_ptr()->size() > prevArticlesCount) - { - ARTICLE_VECTOR::const_iterator it = Actor()->encyclopedia_registry->registry().objects_ptr()->begin(); - std::advance(it, prevArticlesCount); - for(; it != Actor()->encyclopedia_registry->registry().objects_ptr()->end(); it++) - { - if (ARTICLE_DATA::eEncyclopediaArticle == it->article_type) - { - AddArticle(it->article_id, it->readed); - } - } - prevArticlesCount = Actor()->encyclopedia_registry->registry().objects_ptr()->size(); - } - - m_flags.set(eNeedReload, FALSE); - } - - inherited::Draw(); -} - -void CUIEncyclopediaWnd::ReloadArticles() -{ - m_flags.set(eNeedReload, TRUE); -} - - -void CUIEncyclopediaWnd::Show(bool status) -{ - if (status) - ReloadArticles(); - - inherited::Show(status); -} - - -bool CUIEncyclopediaWnd::HasArticle(shared_str id) -{ - ReloadArticles(); - for(std::size_t i = 0; iId() == id) return true; - } - return false; -} - - -void CUIEncyclopediaWnd::DeleteArticles() -{ - UIIdxList->RemoveAll(); - delete_data (m_ArticlesDB); -} - -void CUIEncyclopediaWnd::SetCurrentArtice(CUITreeViewItem *pTVItem) -{ - UIInfoList->ScrollToBegin(); - UIInfoList->Clear(); - - if(!pTVItem) return; - - // äëÿ íà÷àëà ïðîâåðèì, ÷òî íàæàòûé ýëåìåíò íå ðóòîâûé - if (!pTVItem->IsRoot()) - { - - CUIEncyclopediaArticleWnd* article_info = xr_new(); - article_info->Init ("encyclopedia_item.xml","encyclopedia_wnd:objective_item"); - article_info->SetArticle (m_ArticlesDB[pTVItem->GetValue()]); - UIInfoList->AddWindow (article_info, true); - - // Ïîìåòèì êàê ïðî÷èòàííóþ - if (!pTVItem->IsArticleReaded()) - { - if(Actor()->encyclopedia_registry->registry().objects_ptr()) - { - for(ARTICLE_VECTOR::iterator it = Actor()->encyclopedia_registry->registry().objects().begin(); - it != Actor()->encyclopedia_registry->registry().objects().end(); it++) - { - if (ARTICLE_DATA::eEncyclopediaArticle == it->article_type && - m_ArticlesDB[pTVItem->GetValue()]->Id() == it->article_id) - { - it->readed = true; - break; - } - } - } - } - } -} - -void CUIEncyclopediaWnd::AddArticle(shared_str article_id, bool bReaded) -{ - for(std::size_t i = 0; iId() == article_id) return; - } - - // Äîáàâëÿåì ýëåìåíò - m_ArticlesDB.resize(m_ArticlesDB.size() + 1); - CEncyclopediaArticle*& a = m_ArticlesDB.back(); - a = xr_new(); - a->Load(article_id); - - - // Òåïåðü ñîçäàåì èåðàðõèþ âåùè ïî çàäàííîìó ïóòè - - CreateTreeBranch(a->data()->group, a->data()->name, UIIdxList, m_ArticlesDB.size() - 1, - m_pTreeRootFont, m_uTreeRootColor, m_pTreeItemFont, m_uTreeItemColor, bReaded); -} - -void CUIEncyclopediaWnd::Reset() -{ - inherited::Reset (); - ReloadArticles (); -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIEncyclopediaWnd.h b/src/xrGame/ui/UIEncyclopediaWnd.h deleted file mode 100644 index b077b338f93..00000000000 --- a/src/xrGame/ui/UIEncyclopediaWnd.h +++ /dev/null @@ -1,71 +0,0 @@ -//============================================================================= -// Filename: UIEncyclopediaWnd.h -// Created by Roman E. Marchenko, vortex@gsc-game.kiev.ua -// Copyright 2004. GSC Game World -// --------------------------------------------------------------------------- -// Encyclopedia window -//============================================================================= - -#pragma once - -#include "UIWindow.h" -/* -#include "../encyclopedia_article_defs.h" - -class CEncyclopediaArticle; -class CUIFrameWindow; -class CUIFrameLineWnd; -class CUIAnimatedStatic; -class CUIStatic; -class CUIListWnd; -class CUIEncyclopediaCore; -class CUIScrollView; -class CUITreeViewItem; - -class CUIEncyclopediaWnd: public CUIWindow -{ -private: - typedef CUIWindow inherited; - enum {eNeedReload=(1<<0),}; - Flags16 m_flags; -public: - CUIEncyclopediaWnd (); - virtual ~CUIEncyclopediaWnd (); - - virtual void Init (); - virtual void Show (bool status); - virtual void SendMessage (CUIWindow *pWnd, s16 msg, void* pData = NULL); - virtual void Draw (); - - void AddArticle (shared_str, bool bReaded); - void DeleteArticles (); - bool HasArticle (shared_str); - - void ReloadArticles (); - virtual void Reset (); -protected: - u32 prevArticlesCount; - // Ýëåìåíòû ãðàôè÷åñêîãî îôîðìëåíèÿ - CUIFrameWindow* UIEncyclopediaIdxBkg; - CUIFrameWindow* UIEncyclopediaInfoBkg; - CUIFrameLineWnd* UIEncyclopediaIdxHeader; - CUIFrameLineWnd* UIEncyclopediaInfoHeader; - CUIAnimatedStatic* UIAnimation; - CUIStatic* UIArticleHeader; - - // Õðàíèëèùå ñòàòåé - typedef xr_vector ArticlesDB; - typedef ArticlesDB::iterator ArticlesDB_it; - - ArticlesDB m_ArticlesDB; - CGameFont* m_pTreeRootFont; - u32 m_uTreeRootColor; - CGameFont* m_pTreeItemFont; - u32 m_uTreeItemColor; - - CUIListWnd* UIIdxList; - CUIScrollView* UIInfoList; - - void SetCurrentArtice(CUITreeViewItem *pTVItem); -}; -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIEventsWnd.cpp b/src/xrGame/ui/UIEventsWnd.cpp deleted file mode 100644 index 60949277f46..00000000000 --- a/src/xrGame/ui/UIEventsWnd.cpp +++ /dev/null @@ -1,303 +0,0 @@ -#include "pch_script.h" -#include "UIEventsWnd.h" -#include "UIFrameWindow.h" -#include "UIFrameLineWnd.h" -#include "UIAnimatedStatic.h" -#include "UIMapWnd.h" -#include "UIScrollView.h" -#include "UITabControl.h" -#include "UITaskDescrWnd.h" -#include "UI3tButton.h" -#include "../HUDManager.h" -#include "../level.h" -#include "../actor.h" -#include "../gametaskmanager.h" -#include "../gametask.h" -#include "../map_manager.h" -#include "../map_location.h" -#include "../string_table.h" -#include "UITaskItem.h" -#include "../alife_registry_wrappers.h" -#include "../encyclopedia_article.h" - -CUIEventsWnd::CUIEventsWnd () -{ - m_flags.zero (); -} - -CUIEventsWnd::~CUIEventsWnd () -{ - delete_data (m_UIMapWnd); - delete_data (m_UITaskInfoWnd); -} - -void CUIEventsWnd::Init () -{ - CUIXml uiXml; - bool xml_result = uiXml.Init(CONFIG_PATH, UI_PATH, "pda_events.xml"); - R_ASSERT3 (xml_result, "xml file not found", "pda_events.xml"); - - CUIXmlInit xml_init; - xml_init.InitWindow (uiXml, "main_wnd", 0, this); - - - m_UILeftFrame = xr_new(); m_UILeftFrame->SetAutoDelete(true); - AttachChild (m_UILeftFrame); - xml_init.InitFrameWindow (uiXml, "main_wnd:left_frame", 0, m_UILeftFrame); - - - m_UILeftHeader = xr_new(); m_UILeftHeader->SetAutoDelete(true); - m_UILeftFrame->AttachChild (m_UILeftHeader); - xml_init.InitFrameLine (uiXml, "main_wnd:left_frame:left_frame_header", 0, m_UILeftHeader); - -//. xml_init.InitAutoStaticGroup (uiXml, "main_wnd:left_frame",m_UILeftFrame); - - m_UIAnimation = xr_new(); m_UIAnimation->SetAutoDelete(true); - xml_init.InitAnimatedStatic (uiXml, "main_wnd:left_frame:left_frame_header:anim_static", 0, m_UIAnimation); - m_UILeftHeader->AttachChild (m_UIAnimation); - - m_UIRightWnd = xr_new(); m_UIRightWnd->SetAutoDelete(true); - AttachChild (m_UIRightWnd); - xml_init.InitWindow (uiXml, "main_wnd:right_frame", 0, m_UIRightWnd); - - m_UIMapWnd = xr_new(); m_UIMapWnd->SetAutoDelete(false); - m_UIMapWnd->Init ("pda_events.xml","main_wnd:right_frame:map_wnd"); - - m_UITaskInfoWnd = xr_new(); m_UITaskInfoWnd->SetAutoDelete(false); - m_UITaskInfoWnd->Init (&uiXml,"main_wnd:right_frame:task_descr_view"); - - - m_ListWnd = xr_new(); m_ListWnd->SetAutoDelete(true); - m_UILeftFrame->AttachChild (m_ListWnd); - xml_init.InitScrollView (uiXml, "main_wnd:left_frame:list", 0, m_ListWnd); - - m_TaskFilter = xr_new(); m_TaskFilter->SetAutoDelete(true); - m_UILeftFrame->AttachChild (m_TaskFilter); - xml_init.InitTabControl (uiXml, "main_wnd:left_frame:filter_tab", 0, m_TaskFilter); - m_TaskFilter->SetWindowName ("filter_tab"); - Register (m_TaskFilter); - AddCallback ("filter_tab",TAB_CHANGED,CUIWndCallback::void_function(this,&CUIEventsWnd::OnFilterChanged)); -/* - m_primary_or_all_filter_btn = xr_new(); m_primary_or_all_filter_btn->SetAutoDelete(true); - m_UILeftFrame->AttachChild (m_primary_or_all_filter_btn); - xml_init.Init3tButton (uiXml, "main_wnd:left_frame:primary_or_all", 0, m_primary_or_all_filter_btn); - - Register (m_primary_or_all_filter_btn); - m_primary_or_all_filter_btn-> SetWindowName("btn_primary_or_all"); - AddCallback ("btn_primary_or_all",BUTTON_CLICKED,boost::bind(&CUIEventsWnd::OnFilterChanged,this,_1,_2)); -*/ - m_currFilter = eActiveTask; - SetDescriptionMode (true); - - m_ui_task_item_xml.Init (CONFIG_PATH, UI_PATH, "job_item.xml"); -} - -void CUIEventsWnd::Update () -{ - if(m_flags.test(flNeedReload) ){ - ReloadList(false); - m_flags.set(flNeedReload,FALSE ); - } - inherited::Update (); -} - -void CUIEventsWnd::Draw () -{ - inherited::Draw (); -} - -void CUIEventsWnd::SendMessage (CUIWindow* pWnd, s16 msg, void* pData) -{ - CUIWndCallback::OnEvent(pWnd, msg, pData); -} - -void CUIEventsWnd::OnFilterChanged (CUIWindow* w, void*) -{ - m_currFilter =(ETaskFilters)m_TaskFilter->GetActiveIndex(); - ReloadList (false); - if(!GetDescriptionMode()) - SetDescriptionMode (true); -} - -void CUIEventsWnd::Reload () -{ - m_flags.set(flNeedReload,TRUE ); -} - -void CUIEventsWnd::ReloadList(bool bClearOnly) -{ - m_ListWnd->Clear (); - if(bClearOnly) return; - - if(!g_actor) return; - GameTasks& tasks = Actor()->GameTaskManager().GameTasks(); - GameTasks::iterator it = tasks.begin(); - CGameTask* task = NULL; - - for(;it!=tasks.end();++it) - { - task = (*it).game_task; - R_ASSERT (task); - R_ASSERT (task->m_Objectives.size() > 0); - - if( !Filter(task) ) continue; - CUITaskItem* pTaskItem = NULL; -/* - if(task->m_Objectives[0].TaskState()==eTaskUserDefined) - { - VERIFY (task->m_Objectives.size()==1); - pTaskItem = xr_new(this); - pTaskItem->SetGameTask (task, 0); - m_ListWnd->AddWindow (pTaskItem,true); - }else -*/ - for (u16 i = 0; i < task->m_Objectives.size(); ++i) - { - if(i==0){ - pTaskItem = xr_new(this); - }else{ - pTaskItem = xr_new(this); - } - pTaskItem->SetGameTask (task, i); - m_ListWnd->AddWindow (pTaskItem,true); - } - - } - -} - -void CUIEventsWnd::Show(bool status) -{ - inherited::Show (status); - m_UIMapWnd->Show (status); - m_UITaskInfoWnd->Show (status); - - ReloadList (status == false); - -} - -bool CUIEventsWnd::Filter(CGameTask* t) -{ - ETaskState task_state = t->m_Objectives[0].TaskState(); -// bool bprimary_only = m_primary_or_all_filter_btn->GetCheck(); - - return (false/*m_currFilter==eOwnTask && task_state==eTaskUserDefined*/ ) || - ( - ( true/*!bprimary_only || (bprimary_only && t->m_is_task_general)*/ ) && - ( - (m_currFilter==eAccomplishedTask && task_state==eTaskStateCompleted )|| - (m_currFilter==eFailedTask && task_state==eTaskStateFail )|| - (m_currFilter==eActiveTask && task_state==eTaskStateInProgress ) - ) - ); -} - - -void CUIEventsWnd::SetDescriptionMode (bool bMap) -{ - if(bMap){ - m_UIRightWnd->DetachChild (m_UITaskInfoWnd); - m_UIRightWnd->AttachChild (m_UIMapWnd); - }else{ - m_UIRightWnd->DetachChild (m_UIMapWnd); - m_UIRightWnd->AttachChild (m_UITaskInfoWnd); - } - m_flags.set(flMapMode, bMap); -} - -bool CUIEventsWnd::GetDescriptionMode () -{ - return !!m_flags.test(flMapMode); -} - -void CUIEventsWnd::ShowDescription (CGameTask* t, int idx) -{ - if(GetDescriptionMode()){//map - SGameTaskObjective& o = t->Objective(idx); - CMapLocation* ml = o.LinkedMapLocation(); - - if(ml&&ml->SpotEnabled()) - m_UIMapWnd->SetTargetMap(ml->LevelName(), ml->Position(), true); - }else - {//articles - SGameTaskObjective& o = t->Objective(0); - idx = 0; - - m_UITaskInfoWnd->ClearAll (); - - if(Actor()->encyclopedia_registry->registry().objects_ptr()) - { - string512 need_group; - if(0==idx){ - strcpy_s(need_group,*t->m_ID); - }else - if(o.article_key.size()) - { - sprintf_s(need_group, "%s/%s", *t->m_ID, *o.article_key); - }else - { - sprintf_s(need_group, "%s/%d", *t->m_ID, idx); - } - - ARTICLE_VECTOR::const_iterator it = Actor()->encyclopedia_registry->registry().objects_ptr()->begin(); - - for(; it != Actor()->encyclopedia_registry->registry().objects_ptr()->end(); ++it) - { - if (ARTICLE_DATA::eTaskArticle == it->article_type) - { - CEncyclopediaArticle A; - A.Load (it->article_id); - - const shared_str& group = A.data()->group; - - if( strstr(group.c_str(), need_group)== group.c_str() ) - { - u32 sz = xr_strlen(need_group); - if ( group.size()== sz || group.c_str()[sz]=='/' ) - m_UITaskInfoWnd->AddArticle(&A); - }else - if(o.article_id.size() && it->article_id ==o.article_id) - { - CEncyclopediaArticle A; - A.Load (it->article_id); - m_UITaskInfoWnd->AddArticle (&A); - } - } - } - } - } - - int sz = m_ListWnd->GetSize (); - - for(int i=0; iGetItem(i); - - if((itm->GameTask()==t) && (itm->ObjectiveIdx()==idx) ) - itm->MarkSelected (true); - else - itm->MarkSelected (false); - } -} - -bool CUIEventsWnd::ItemHasDescription(CUITaskItem* itm) -{ - if(itm->ObjectiveIdx()==0)// root - { - bool bHasLocation = itm->GameTask()->HasLinkedMapLocations(); - return bHasLocation; - }else - { - SGameTaskObjective *obj = itm->Objective(); - CMapLocation* ml = obj->LinkedMapLocation(); - bool bHasLocation = (NULL != ml); - bool bIsMapMode = GetDescriptionMode(); - bool b = (bIsMapMode&&bHasLocation&&ml->SpotEnabled()); - return b; - } -} -void CUIEventsWnd::Reset() -{ - inherited::Reset (); - Reload (); -} diff --git a/src/xrGame/ui/UIEventsWnd.h b/src/xrGame/ui/UIEventsWnd.h deleted file mode 100644 index f40996d444c..00000000000 --- a/src/xrGame/ui/UIEventsWnd.h +++ /dev/null @@ -1,63 +0,0 @@ -#pragma once - -#include "UIWindow.h" -#include "UIWndCallback.h" -#include "UIXmlInit.h" - -class CUIFrameWindow; -class CUIFrameLineWnd; -class CUIAnimatedStatic; -class CUIMapWnd; -class CUI3tButton; -class CUITabControl; -class CGameTask; -class CUITaskDescrWnd; -class CUIScrollView; -class CUITaskItem; - -class CUIEventsWnd :public CUIWindow, public CUIWndCallback{ - typedef CUIWindow inherited; - enum ETaskFilters{ eActiveTask = 0, - eAccomplishedTask, - eFailedTask, -//. eOwnTask, - eMaxTask}; - enum EEventWndFlags{ - flNeedReload =(1<<0), - flMapMode =(1<<1), - }; - Flags16 m_flags; - ETaskFilters m_currFilter; - CUIFrameWindow* m_UILeftFrame; - CUIWindow* m_UIRightWnd; - CUIFrameLineWnd* m_UILeftHeader; - CUIAnimatedStatic* m_UIAnimation; - CUIMapWnd* m_UIMapWnd; - CUITaskDescrWnd* m_UITaskInfoWnd; - CUIScrollView* m_ListWnd; - CUITabControl* m_TaskFilter; - - bool Filter (CGameTask* t); - void __stdcall OnFilterChanged (CUIWindow*,void*); - void ReloadList (bool bClearOnly); - -public: - void SetDescriptionMode (bool bMap); - bool GetDescriptionMode (); - void ShowDescription (CGameTask* t, int idx); - bool ItemHasDescription (CUITaskItem*); -public: - - CUIEventsWnd (); - virtual ~CUIEventsWnd (); - virtual void SendMessage (CUIWindow* pWnd, s16 msg, void* pData); - void Init (); - virtual void Update (); - virtual void Draw (); - virtual void Show (bool status); - void Reload (); - virtual void Reset (); - - CUIXml m_ui_task_item_xml; - -}; diff --git a/src/xrGame/ui/UIFactionWarWnd.cpp b/src/xrGame/ui/UIFactionWarWnd.cpp deleted file mode 100644 index 3737dcb25c7..00000000000 --- a/src/xrGame/ui/UIFactionWarWnd.cpp +++ /dev/null @@ -1,403 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : UIFactionWarWnd.cpp -// Created : 26.12.2007 -// Author : Evgeniy Sokolov -// Description : UI Faction War window class implementation -//////////////////////////////////////////////////////////////////////////// - -#include "pch_script.h" -/* -#include "UIFactionWarWnd.h" - -#include "UIXmlInit.h" -#include "UIProgressBar.h" -#include "UIFrameLineWnd.h" -#include "UIHelper.h" - -#include "FactionState.h" -#include "UIPdaWnd.h" -#include "UICharacterInfo.h" - -#include "../actor.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" - -#define PDA_FACTION_WAR_XML "pda_fraction_war.xml" - -CUIFactionWarWnd::CUIFactionWarWnd() -{ - Reset(); -} - -CUIFactionWarWnd::~CUIFactionWarWnd() -{ -} - -void CUIFactionWarWnd::Reset() -{ - m_previous_time = Device.dwTimeGlobal; - m_update_delay = 3000; - m_max_member_count = 100; - m_max_resource = 100; - m_max_power = 100; - m_war_states_dx = 0.0f; - hint_wnd = NULL; - m_tc_pos.set ( 0.0f, 0.0f ); - m_td_pos.set ( 0.0f, 0.0f ); -} - -void CUIFactionWarWnd::Init() -{ - CUIXml xml; - xml.Load( CONFIG_PATH, UI_PATH, PDA_FACTION_WAR_XML ); - - CUIXmlInit::InitWindow( xml, "main_wnd", 0, this ); - - m_background = UIHelper::CreateFrameLine( xml, "background", this ); - - m_center_background = UIHelper::CreateStatic( xml, "center_background", this ); - - m_target_static = UIHelper::CreateStatic( xml, "target_static", this ); - m_target_caption = UIHelper::CreateStatic( xml, "target_caption", this ); - //m_target_caption->SetElipsis( 1, 0 ); - m_tc_pos = m_target_caption->GetWndPos(); - - m_target_desc = UIHelper::CreateStatic( xml, "target_decs", this ); - m_td_pos = m_target_desc->GetWndPos(); - - m_state_static = UIHelper::CreateStatic( xml, "state_static", this ); - - m_our_icon = UIHelper::CreateStatic( xml, "static_our_icon", this ); - m_our_icon_over = UIHelper::CreateStatic( xml, "static_our_icon_over", this ); - m_our_name = UIHelper::CreateStatic( xml, "static_our_name", this ); - m_st_our_frac_info = UIHelper::CreateStatic( xml, "static_our_frac_info", this ); - m_st_our_mem_count = UIHelper::CreateStatic( xml, "static_our_mem_count", this ); - m_st_our_resource = UIHelper::CreateStatic( xml, "static_our_resource", this ); - - m_pb_our_state = UIHelper::CreateProgressBar( xml, "progress_our_state", this ); - m_pb_our_mem_count = UIHelper::CreateProgressBar( xml, "progress_our_mem_count", this ); - m_pb_our_resource = UIHelper::CreateProgressBar( xml, "progress_our_resource", this ); - - m_enemy_icon = UIHelper::CreateStatic( xml, "static_enemy_icon", this ); - m_enemy_icon_over = UIHelper::CreateStatic( xml, "static_enemy_icon_over", this ); - m_enemy_name = UIHelper::CreateStatic( xml, "static_enemy_name", this ); - m_st_enemy_frac_info = UIHelper::CreateStatic( xml, "static_enemy_frac_info", this ); - m_st_enemy_mem_count = UIHelper::CreateStatic( xml, "static_enemy_mem_count", this ); - m_st_enemy_resource = UIHelper::CreateStatic( xml, "static_enemy_resource", this ); - - m_pb_enemy_state = UIHelper::CreateProgressBar( xml, "progress_enemy_state", this ); - m_pb_enemy_mem_count = UIHelper::CreateProgressBar( xml, "progress_enemy_mem_count", this ); - m_pb_enemy_resource = UIHelper::CreateProgressBar( xml, "progress_enemy_resource", this ); - - m_static_line1 = UIHelper::CreateFrameLine( xml, "static_line1", this ); - m_static_line2 = UIHelper::CreateFrameLine( xml, "static_line2", this ); - m_static_line3 = UIHelper::CreateFrameLine( xml, "static_line3", this ); - m_static_line4 = UIHelper::CreateFrameLine( xml, "static_line4", this ); - m_static_line_left = UIHelper::CreateFrameLine( xml, "static_line_left", this ); - m_static_line_right = UIHelper::CreateFrameLine( xml, "static_line_right", this ); - - VERIFY( hint_wnd ); - m_war_states_parent = xr_new(); - m_war_states_parent->SetAutoDelete( true ); - AttachChild( m_war_states_parent ); - Fvector2 pos; - pos.x = xml.ReadAttribFlt( "static_vs_state", 0, "x" ); - pos.y = xml.ReadAttribFlt( "static_vs_state", 0, "y" ); - m_war_states_parent->SetWndPos( pos ); - - for ( u8 i = 0; i < max_war_state; ++i ) - { - m_war_state[i] = xr_new(); - m_war_state[i]->InitXML( xml, "static_vs_state", m_war_states_parent ); - m_war_state[i]->set_hint_wnd( hint_wnd ); - } - - float dx = xml.ReadAttribFlt( "static_vs_state", 0, "dx" ); - m_war_states_dx = dx; - m_war_states_xcenter = xml.ReadAttribFlt( "static_vs_state", 0, "xcenter", 511.0f ); - - pos.set( 0.0f, 0.0f ); - m_war_state[0]->SetWndPos( pos ); - for ( u8 i = 1; i < max_war_state; ++i ) - { - pos.x += m_war_state[i-1]->GetWndSize().x + dx; - m_war_state[i]->SetWndPos( pos ); - } - - for ( u8 i = 0; i < max_bonuce; ++i ) - { - m_our_bonuces[i] = UIHelper::CreateStatic( xml, "static_our_bonuce", this ); - } - dx = xml.ReadAttribFlt( "static_our_bonuce", 0, "dx" ); - pos = m_our_bonuces[0]->GetWndPos(); - for ( u8 i = 1; i < max_bonuce; ++i ) - { - pos.x += m_our_bonuces[i-1]->GetWndSize().x + dx; - m_our_bonuces[i]->SetWndPos( pos ); - } - - for ( u8 i = 0; i < max_bonuce; ++i ) - { - m_enemy_bonuces[i] = UIHelper::CreateStatic( xml, "static_enemy_bonuce", this ); - } - dx = xml.ReadAttribFlt( "static_enemy_bonuce", 0, "dx" ); - pos = m_enemy_bonuces[0]->GetWndPos(); - for ( u8 i = 1; i < max_bonuce; ++i ) - { - pos.x += m_enemy_bonuces[i-1]->GetWndSize().x + dx; - m_enemy_bonuces[i]->SetWndPos( pos ); - } - int delay = xml.ReadAttribInt( "main_wnd", 0, "update_delay", 3000 ); - m_update_delay = (0 < delay)? (u32)delay : 0; -} - -void CUIFactionWarWnd::ShowInfo( bool status ) -{ -// m_target_static->Show( status ); -// m_target_caption->Show( status ); -// m_target_desc->Show( status ); - m_state_static->Show( status ); - -// m_static_line1->Show( status ); - m_static_line2->Show( status ); - m_static_line3->Show( status ); - m_static_line4->Show( status ); - m_static_line_left->Show( status ); - m_static_line_right->Show( status ); - - m_our_icon->Show( status ); - m_our_icon_over->Show( status ); - m_our_name->Show( status ); - m_st_our_frac_info->Show( status ); - m_st_our_mem_count->Show( status ); - m_st_our_resource->Show( status ); - - m_pb_our_state->Show( status ); - m_pb_our_mem_count->Show( status ); - m_pb_our_resource->Show( status ); - - m_enemy_icon->Show( status ); - m_enemy_icon_over->Show( status ); - m_enemy_name->Show( status ); - m_st_enemy_frac_info->Show( status ); - m_st_enemy_mem_count->Show( status ); - m_st_enemy_resource->Show( status ); - - m_pb_enemy_state->Show( status ); - m_pb_enemy_mem_count->Show( status ); - m_pb_enemy_resource->Show( status ); - - m_war_states_parent->Show( status ); - - for ( u8 i = 0; i < max_bonuce; ++i ) - { - m_our_bonuces[i]->Show( status ); - m_enemy_bonuces[i]->Show( status ); - } -} - -void CUIFactionWarWnd::SendMessage( CUIWindow* pWnd, s16 msg, void* pData ) -{ - CUIWndCallback::OnEvent( pWnd, msg, pData ); -} - -void CUIFactionWarWnd::Show( bool status ) -{ - if ( status ) - { - InitFactions(); - } - for ( u8 i = 0; i < max_war_state; ++i ) - { - m_war_state[i]->ClearInfo(); - } - inherited::Show( status ); -} - -void CUIFactionWarWnd::Update() -{ - inherited::Update(); - if ( !IsShown() ) - { - Reset(); - } - if ( Device.dwTimeGlobal - m_previous_time > m_update_delay ) - { - m_previous_time = Device.dwTimeGlobal; - UpdateInfo(); - } -} - -bool CUIFactionWarWnd::InitFactions() -{ - shared_str our, enemy; - if ( !CUICharacterInfo::get_actor_community( &our, &enemy ) ) - { - return false; - } - - - /* - shared_str const& actor_team = Actor()->CharacterInfo().Community().id(); - - LPCSTR vs_teams = pSettings->r_string( "actor_communities", actor_team.c_str() ); - if ( _GetItemCount( vs_teams ) != 2 ) - { - return false; - } - u32 size_temp = (xr_strlen(vs_teams) + 1) * sizeof(char); - PSTR our_fract = (PSTR)_alloca( size_temp ); - PSTR enemy_fract = (PSTR)_alloca( size_temp ); - _GetItem( vs_teams, 0, our_fract ); - _GetItem( vs_teams, 1, enemy_fract ); - - if ( xr_strlen(our_fract) == 0 || xr_strlen(enemy_fract) == 0 ) - { - return false; - }* - m_our_faction.set_faction_id2( our ); - m_enemy_faction.set_faction_id2( enemy ); - - UpdateInfo(); - return true; -} - -void CUIFactionWarWnd::UpdateInfo() -{ - if ( m_our_faction.get_faction_id2().size() == 0 ) - { - if ( !InitFactions() ) - { - R_ASSERT2( 0, "Actor`s faction is unknown!" ); - } - } - m_max_member_count = get_max_member_count(); - m_max_resource = get_max_resource(); - m_max_power = get_max_power(); - - m_our_faction.update_info(); - - m_target_caption->SetText( m_our_faction.get_target() ); - m_target_caption->AdjustHeightToText(); - - Fvector2 pos = m_td_pos; - pos.y = m_target_caption->GetWndPos().y + m_target_caption->GetHeight() + 8.0f; - m_target_desc->SetWndPos( pos ); - m_target_desc->SetText( m_our_faction.get_target_desc() ); - - if ( m_enemy_faction.get_faction_id2().size() == 0 || m_our_faction.member_count == 0 || xr_strlen( m_our_faction.get_name() )==0 ) - { - ShowInfo( false ); - return; - } - m_enemy_faction.update_info(); - ShowInfo( true ); - - UpdateWarStates( m_our_faction ); - - //our - m_our_name->SetTextST( m_our_faction.get_name() ); - m_our_icon->InitTexture( m_our_faction.get_icon_big() ); - - - m_pb_our_state->SetRange( 0.0f, m_max_power ); - m_pb_our_state->SetProgressPos( m_our_faction.power ); - - m_pb_our_mem_count->SetRange( 0.0f, (float)m_max_member_count ); - m_pb_our_mem_count->SetProgressPos( (float)m_our_faction.member_count ); - - m_pb_our_resource->SetRange( 0.0f, m_max_resource ); - m_pb_our_resource->SetProgressPos( m_our_faction.resource ); - set_amount_our_bonus( m_our_faction.bonus ); - - //enemy - m_enemy_name->SetTextST( m_enemy_faction.get_name() ); - m_enemy_icon->InitTexture( m_enemy_faction.get_icon_big() ); - - m_pb_enemy_state->SetRange( 0.0f, m_max_power ); - m_pb_enemy_state->SetProgressPos( m_enemy_faction.power ); - - m_pb_enemy_mem_count->SetRange( 0.0f, (float)m_max_member_count ); - m_pb_enemy_mem_count->SetProgressPos( (float)m_enemy_faction.member_count ); - - m_pb_enemy_resource->SetRange( 0.0f, m_max_resource ); - m_pb_enemy_resource->SetProgressPos( m_enemy_faction.resource ); - - set_amount_enemy_bonus( m_enemy_faction.bonus ); -} - -void CUIFactionWarWnd::UpdateWarStates( FactionState const& faction ) -{ - Fvector2 pos; - pos = m_war_states_parent->GetWndPos(); - - float sx = 0.0f; - u8 cnt = 0; - for ( u8 i = 0; i < max_war_state; ++i ) - { - if ( !m_war_state[i]->UpdateInfo( faction.get_war_state(i), faction.get_war_state_hint(i) ) ) - { - break; // for i - } - ++cnt; - sx += m_war_state[i]->GetWndSize().x + m_war_states_dx; - } - if ( cnt == 0 ) - { - m_war_states_parent->SetWndPos( pos ); - return; - } - sx -= m_war_states_dx; - - pos.x = m_war_states_xcenter - sx * 0.5f; - m_war_states_parent->SetWndPos( pos ); -} - -void CUIFactionWarWnd::set_amount_our_bonus( int value ) -{ - for ( u32 i = 0; i < max_bonuce; ++i ) - { - m_our_bonuces[i]->SetColor( color_rgba( 255, 255, 255, 70) ); - } - u32 cr = color_rgba( 0, 255, 0, 255); - for ( int i = 0; i < value; ++i ) - { - m_our_bonuces[i]->SetColor( cr ); - } -} - -void CUIFactionWarWnd::set_amount_enemy_bonus( int value ) -{ - for ( u32 i = 0; i < max_bonuce; ++i ) - { - m_enemy_bonuces[i]->SetColor( color_rgba( 255, 255, 255, 70) ); - } - u32 cr = color_rgba( 0, 255, 0, 255); - for ( int i = 0; i < value; ++i ) - { - m_enemy_bonuces[i]->SetColor( cr ); - } -} - -// ------------------------------------------------------------------------------------------------- -int CUIFactionWarWnd::get_max_member_count() -{ - luabind::functor funct; - R_ASSERT( ai().script_engine().functor( "pda.get_max_member_count", funct ) ); - return funct(); -} - -float CUIFactionWarWnd::get_max_resource() -{ - luabind::functor funct; - R_ASSERT( ai().script_engine().functor( "pda.get_max_resource", funct ) ); - return funct(); -} - -float CUIFactionWarWnd::get_max_power() -{ - luabind::functor funct; - R_ASSERT( ai().script_engine().functor( "pda.get_max_power", funct ) ); - return funct(); -} -*/ diff --git a/src/xrGame/ui/UIFactionWarWnd.h b/src/xrGame/ui/UIFactionWarWnd.h deleted file mode 100644 index 4443e285e76..00000000000 --- a/src/xrGame/ui/UIFactionWarWnd.h +++ /dev/null @@ -1,115 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : UIFactionWarWnd.h -// Created : 26.12.2007 -// Author : Evgeniy Sokolov -// Description : UI Faction War window class -//////////////////////////////////////////////////////////////////////////// - -#pragma once -/* -#include "UIWindow.h" -#include "UIWndCallback.h" -#include "FactionState.h" -#include "UIWarState.h" - -class CUIStatic; -class CGameTask; -class CUIXml; -class CUIProgressBar; -class CUIFrameLineWnd; - -class CUIFactionWarWnd : public CUIWindow, public CUIWndCallback -{ -private: - typedef CUIWindow inherited; - - CUIFrameLineWnd* m_background; - CUIStatic* m_center_background; - - CUIStatic* m_target_static; - CUIStatic* m_target_caption; // our - Fvector2 m_tc_pos; - CUIStatic* m_target_desc; - Fvector2 m_td_pos; - CUIStatic* m_state_static; - - CUIFrameLineWnd* m_static_line1; - CUIFrameLineWnd* m_static_line2; - CUIFrameLineWnd* m_static_line3; - CUIFrameLineWnd* m_static_line4; - CUIFrameLineWnd* m_static_line_left; - CUIFrameLineWnd* m_static_line_right; - - CUIStatic* m_our_icon; - CUIStatic* m_our_icon_over; - CUIStatic* m_our_name; - CUIStatic* m_st_our_frac_info; - CUIStatic* m_st_our_mem_count; - CUIStatic* m_st_our_resource; - - CUIProgressBar* m_pb_our_state; - CUIProgressBar* m_pb_our_mem_count; - CUIProgressBar* m_pb_our_resource; - - CUIStatic* m_enemy_icon; - CUIStatic* m_enemy_icon_over; - CUIStatic* m_enemy_name; - CUIStatic* m_st_enemy_frac_info; - CUIStatic* m_st_enemy_mem_count; - CUIStatic* m_st_enemy_resource; - - CUIProgressBar* m_pb_enemy_state; - CUIProgressBar* m_pb_enemy_mem_count; - CUIProgressBar* m_pb_enemy_resource; - - CUIWindow* m_war_states_parent; - float m_war_states_dx; - float m_war_states_xcenter; - enum { max_war_state = FactionState::war_state_count }; - UIWarState* m_war_state[max_war_state]; - - enum { max_bonuce = 6 }; - CUIStatic* m_our_bonuces[max_bonuce]; - CUIStatic* m_enemy_bonuces[max_bonuce]; - - // ---------------------------------------- - //shared_str m_our_faction_id; - //shared_str m_enemy_faction_id; - u32 m_update_delay; - u32 m_previous_time; - - FactionState m_our_faction; - FactionState m_enemy_faction; - - int m_max_member_count; - float m_max_resource; - float m_max_power; - -public: - CUIFactionWarWnd (); - virtual ~CUIFactionWarWnd (); - - virtual void SendMessage ( CUIWindow* pWnd, s16 msg, void* pData ); - virtual void Show ( bool status ); - virtual void Update (); - - void ShowInfo ( bool status ); - - void Reset (); - void Init (); - - bool InitFactions (); - void UpdateInfo (); - void UpdateWarStates ( FactionState const& faction ); -// void set_amount_state_vs ( int value ); - void set_amount_our_bonus ( int value ); - void set_amount_enemy_bonus ( int value ); - - UIHint* hint_wnd; -protected: - int get_max_member_count (); - float get_max_resource (); - float get_max_power (); - -}; // class CUIFactionWarWnd -*/ diff --git a/src/xrGame/ui/UIFixedScrollBar.cpp b/src/xrGame/ui/UIFixedScrollBar.cpp index fc054c047b3..bbf599d11ce 100644 --- a/src/xrGame/ui/UIFixedScrollBar.cpp +++ b/src/xrGame/ui/UIFixedScrollBar.cpp @@ -132,7 +132,9 @@ void CUIFixedScrollBar::ClampByViewRect() m_IncButton->GetWndPos().y - m_ScrollBox->GetHeight()-m_ScrollBoxOffset.y)); } } -#include "../uicursor.h" + +#include "UICursor.h" + u32 last_hold_tm =0; bool CUIFixedScrollBar::OnKeyboardHold(int dik) { diff --git a/src/xrGame/ui/UIGameTutorial.cpp b/src/xrGame/ui/UIGameTutorial.cpp index 26078aa4d94..5732ce5ca84 100644 --- a/src/xrGame/ui/UIGameTutorial.cpp +++ b/src/xrGame/ui/UIGameTutorial.cpp @@ -4,12 +4,12 @@ #include "UIStatic.h" #include "UIXmlInit.h" #include "object_broker.h" -#include "../../xrEngine/xr_input.h" -#include "../xr_level_controller.h" -#include "../../xrServerEntities/script_engine.h" -#include "../ai_space.h" -#include "../../xrEngine/xr_ioconsole.h" -#include "../UIGameCustom.h" +#include "xrEngine/xr_input.h" +#include "xr_level_controller.h" +#include "xrServerEntities/script_engine.h" +#include "ai_space.h" +#include "xrEngine/xr_ioconsole.h" +#include "UIGameCustom.h" #include "UIActorMenu.h" #include "UIPdaWnd.h" diff --git a/src/xrGame/ui/UIGameTutorialSimpleItem.cpp b/src/xrGame/ui/UIGameTutorialSimpleItem.cpp index 3d1c892ca9a..1911e7fa86f 100644 --- a/src/xrGame/ui/UIGameTutorialSimpleItem.cpp +++ b/src/xrGame/ui/UIGameTutorialSimpleItem.cpp @@ -4,16 +4,16 @@ #include "uicursor.h" #include "UIXmlInit.h" #include "object_broker.h" -#include "../../xrEngine/xr_input.h" -#include "../xr_level_controller.h" -#include "../UIGameSp.h" -#include "../level.h" +#include "xrEngine/xr_input.h" +#include "xr_level_controller.h" +#include "UIGameSP.h" +#include "Level.h" #include "UIPdaWnd.h" #include "UIActorMenu.h" #include "UITalkWnd.h" -#include "../MainMenu.h" -#include "../../xrServerEntities/script_engine.h" -#include "../ai_space.h" +#include "MainMenu.h" +#include "xrServerEntities/script_engine.h" +#include "ai_space.h" extern ENGINE_API BOOL bShowPauseString; diff --git a/src/xrGame/ui/UIGameTutorialVideoItem.cpp b/src/xrGame/ui/UIGameTutorialVideoItem.cpp index aba9d348561..bebbdd85163 100644 --- a/src/xrGame/ui/UIGameTutorialVideoItem.cpp +++ b/src/xrGame/ui/UIGameTutorialVideoItem.cpp @@ -4,12 +4,12 @@ #include "UIStatic.h" #include "UIXmlInit.h" #include "object_broker.h" -#include "../../xrEngine/xr_input.h" -#include "../xr_level_controller.h" +#include "xrEngine/xr_input.h" +#include "xr_level_controller.h" -#include "../Include/xrRender/UISequenceVideoItem.h" -#include "../Include/xrRender/UIShader.h" -#include "../Include/xrRender/UIRender.h" +#include "Include/xrRender/UISequenceVideoItem.h" +#include "Include/xrRender/UIShader.h" +#include "Include/xrRender/UIRender.h" #include "uicursor.h" extern ENGINE_API BOOL bShowPauseString; diff --git a/src/xrGame/ui/UIHint.cpp b/src/xrGame/ui/UIHint.cpp index 88e48cce6d9..48be58abc3b 100644 --- a/src/xrGame/ui/UIHint.cpp +++ b/src/xrGame/ui/UIHint.cpp @@ -12,7 +12,7 @@ #include "UIFrameWindow.h" #include "UIXmlInit.h" #include "UIHelper.h" -#include "../string_table.h" +#include "string_table.h" UIHint::UIHint() { diff --git a/src/xrGame/ui/UIHudStatesWnd.cpp b/src/xrGame/ui/UIHudStatesWnd.cpp index af30663cf44..ba74749c197 100644 --- a/src/xrGame/ui/UIHudStatesWnd.cpp +++ b/src/xrGame/ui/UIHudStatesWnd.cpp @@ -1,14 +1,12 @@ #include "stdafx.h" #include "UIHudStatesWnd.h" - -#include "../Actor.h" -#include "../ActorCondition.h" -#include "../EntityCondition.h" -#include "../CustomOutfit.h" -#include "../ActorHelmet.h" -#include "../inventory.h" -#include "../RadioactiveZone.h" - +#include "Actor.h" +#include "ActorCondition.h" +#include "EntityCondition.h" +#include "CustomOutfit.h" +#include "ActorHelmet.h" +#include "Inventory.h" +#include "RadioactiveZone.h" #include "UIStatic.h" #include "UIProgressBar.h" #include "UIProgressShape.h" @@ -17,8 +15,8 @@ #include "ui_arrow.h" #include "UIInventoryUtilities.h" #include "CustomDetector.h" -#include "../ai/monsters/basemonster/base_monster.h" -#include "../PDA.h" +#include "ai/Monsters/BaseMonster/base_monster.h" +#include "PDA.h" #include "WeaponMagazinedWGrenade.h" CUIHudStatesWnd::CUIHudStatesWnd() diff --git a/src/xrGame/ui/UIHudStatesWnd.h b/src/xrGame/ui/UIHudStatesWnd.h index d8e2c6cb994..6f4a3567834 100644 --- a/src/xrGame/ui/UIHudStatesWnd.h +++ b/src/xrGame/ui/UIHudStatesWnd.h @@ -1,9 +1,8 @@ #pragma once - #include "UIWindow.h" -#include "..\..\xrServerEntities\alife_space.h" -#include "..\..\xrServerEntities\inventory_space.h" -#include "..\actor_defs.h" +#include "xrServerEntities/alife_space.h" +#include "xrServerEntities/inventory_space.h" +#include "actor_defs.h" class CUIStatic; class CUITextWnd; diff --git a/src/xrGame/ui/UIInvUpgrade.cpp b/src/xrGame/ui/UIInvUpgrade.cpp index 2d8f64cebbc..bd29e89272b 100644 --- a/src/xrGame/ui/UIInvUpgrade.cpp +++ b/src/xrGame/ui/UIInvUpgrade.cpp @@ -8,7 +8,7 @@ #include "pch_script.h" #include "object_broker.h" -#include "../string_table.h" +#include "string_table.h" #include "UIInvUpgrade.h" diff --git a/src/xrGame/ui/UIInvUpgradeInfo.cpp b/src/xrGame/ui/UIInvUpgradeInfo.cpp index 46bca1b0744..f1069828fb2 100644 --- a/src/xrGame/ui/UIInvUpgradeInfo.cpp +++ b/src/xrGame/ui/UIInvUpgradeInfo.cpp @@ -8,8 +8,8 @@ #include "pch_script.h" #include "UIInvUpgradeInfo.h" -#include "../string_table.h" -#include "../Actor.h" +#include "string_table.h" +#include "Actor.h" #include "UIStatic.h" #include "UIXmlInit.h" diff --git a/src/xrGame/ui/UIInventoryUpgradeWnd.cpp b/src/xrGame/ui/UIInventoryUpgradeWnd.cpp index c2325e2cd61..e0de84cea5a 100644 --- a/src/xrGame/ui/UIInventoryUpgradeWnd.cpp +++ b/src/xrGame/ui/UIInventoryUpgradeWnd.cpp @@ -12,31 +12,26 @@ #include "xrUIXmlParser.h" #include "UIXmlInit.h" -#include "../string_table.h" - -#include "../actor.h" -#include "../../xrServerEntities/script_process.h" -#include "../inventory.h" - +#include "string_table.h" +#include "Actor.h" +#include "xrServerEntities/script_process.h" +#include "Inventory.h" #include "ai_space.h" #include "alife_simulator.h" #include "inventory_upgrade_manager.h" #include "inventory_upgrade.h" #include "inventory_upgrade_property.h" - #include "UIInventoryUtilities.h" #include "UIActorMenu.h" #include "UIItemInfo.h" #include "UIFrameLineWnd.h" #include "UI3tButton.h" #include "UIHelper.h" -#include "../ui_defs.h" -#include "../Weapon.h" -#include "../WeaponRPG7.h" -#include "../CustomOutfit.h" -#include "../ActorHelmet.h" - -// ----- +#include "ui_defs.h" +#include "Weapon.h" +#include "WeaponRPG7.h" +#include "CustomOutfit.h" +#include "ActorHelmet.h" const LPCSTR g_inventory_upgrade_xml = "inventory_upgrade.xml"; diff --git a/src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp b/src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp index ff10595d876..a1854171211 100644 --- a/src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp +++ b/src/xrGame/ui/UIInventoryUpgradeWnd_add.cpp @@ -11,7 +11,7 @@ #include "UIInventoryUpgradeWnd.h" #include "xrUIXmlParser.h" #include "UIXmlInit.h" -#include "../string_table.h" +#include "string_table.h" void CUIInventoryUpgradeWnd::LoadCellsBacks( CUIXml& uiXml ) { diff --git a/src/xrGame/ui/UIInventoryUtilities.cpp b/src/xrGame/ui/UIInventoryUtilities.cpp index 3902a9b068b..ff859ebddc1 100644 --- a/src/xrGame/ui/UIInventoryUtilities.cpp +++ b/src/xrGame/ui/UIInventoryUtilities.cpp @@ -1,24 +1,20 @@ - #include "pch_script.h" #include "UIInventoryUtilities.h" -#include "../WeaponAmmo.h" -#include "../UIStaticItem.h" +#include "WeaponAmmo.h" +#include "UIStaticItem.h" #include "UIStatic.h" -#include "../eatable_item.h" -#include "../Level.h" -#include "../date_time.h" -#include "../string_table.h" -#include "../Inventory.h" -#include "../InventoryOwner.h" - -#include "../InfoPortion.h" +#include "eatable_item.h" +#include "Level.h" +#include "date_time.h" +#include "string_table.h" +#include "Inventory.h" +#include "InventoryOwner.h" +#include "InfoPortion.h" #include "game_base_space.h" -#include "../actor.h" - -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" - -#include "../Include/xrRender/UIShader.h" +#include "Actor.h" +#include "ai_space.h" +#include "xrServerEntities/script_engine.h" +#include "Include/xrRender/UIShader.h" #define BUY_MENU_TEXTURE "ui\\ui_mp_buy_menu" #define CHAR_ICONS "ui\\ui_icons_npc" diff --git a/src/xrGame/ui/UIInventoryUtilities.h b/src/xrGame/ui/UIInventoryUtilities.h index 2d7aec3102e..9fdfed26a3f 100644 --- a/src/xrGame/ui/UIInventoryUtilities.h +++ b/src/xrGame/ui/UIInventoryUtilities.h @@ -1,8 +1,6 @@ #pragma once - -#include "../inventory_item.h" +#include "inventory_item.h" #include "character_info_defs.h" - #include "ui_defs.h" class CUITextWnd; diff --git a/src/xrGame/ui/UIInventoryWnd.cpp b/src/xrGame/ui/UIInventoryWnd.cpp deleted file mode 100644 index c78849ed897..00000000000 --- a/src/xrGame/ui/UIInventoryWnd.cpp +++ /dev/null @@ -1,500 +0,0 @@ -#include "pch_script.h" -#include "UIInventoryWnd.h" -/* -#include "xrUIXmlParser.h" -#include "UIXmlInit.h" -#include "../string_table.h" - -#include "../actor.h" -#include "../uigamesp.h" -#include "../hudmanager.h" - -#include "../CustomOutfit.h" - -#include "../weapon.h" - -#include "../../xrServerEntities/script_process.h" - -#include "../eatable_item.h" -#include "../inventory.h" - -#include "UIInventoryUtilities.h" -using namespace InventoryUtilities; - - -#include "../InfoPortion.h" -#include "../level.h" -#include "game_base_space.h" -#include "../entitycondition.h" - -#include "../game_cl_base.h" -#include "../ActorCondition.h" -#include "UIDragDropListEx.h" -#include "UIOutfitSlot.h" -#include "UI3tButton.h" - -#define INVENTORY_ITEM_XML "inventory_item.xml" -#define INVENTORY_XML "inventory_new.xml" - - - -CUIInventoryWnd* g_pInvWnd = NULL; - -CUIInventoryWnd::CUIInventoryWnd() -{ - m_iCurrentActiveSlot = NO_ACTIVE_SLOT; - UIRank = NULL; - Init (); - SetCurrentItem (NULL); - - g_pInvWnd = this; - m_b_need_reinit = false; - Hide (); -} - -void CUIInventoryWnd::Init() -{ - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH, INVENTORY_XML); - - CUIXmlInit xml_init; - - xml_init.InitWindow (uiXml, "main", 0, this); - - AttachChild (&UIBeltSlots); - xml_init.InitStatic (uiXml, "belt_slots", 0, &UIBeltSlots); - - AttachChild (&UIBack); - xml_init.InitStatic (uiXml, "back", 0, &UIBack); - - AttachChild (&UIStaticBottom); - xml_init.InitStatic (uiXml, "bottom_static", 0, &UIStaticBottom); - - AttachChild (&UIBagWnd); - xml_init.InitStatic (uiXml, "bag_static", 0, &UIBagWnd); - - AttachChild (&UIMoneyWnd); - xml_init.InitStatic (uiXml, "money_static", 0, &UIMoneyWnd); - - AttachChild (&UIDescrWnd); - xml_init.InitStatic (uiXml, "descr_static", 0, &UIDescrWnd); - - - UIDescrWnd.AttachChild (&UIItemInfo); - UIItemInfo.InitItemInfo (Fvector2().set(0,0), UIDescrWnd.GetWndSize(), INVENTORY_ITEM_XML); - - AttachChild (&UIPersonalWnd); - xml_init.InitFrameWindow (uiXml, "character_frame_window", 0, &UIPersonalWnd); - - AttachChild (&UIProgressBack); - xml_init.InitStatic (uiXml, "progress_background", 0, &UIProgressBack); - - if (GameID() != eGameIDSingle){ - AttachChild (&UIProgressBack_rank); - xml_init.InitStatic (uiXml, "progress_back_rank", 0, &UIProgressBack_rank); - - UIProgressBack_rank.AttachChild (&UIProgressBarRank); - xml_init.InitProgressBar (uiXml, "progress_bar_rank", 0, &UIProgressBarRank); - UIProgressBarRank.SetProgressPos(100); - - } - - - UIProgressBack.AttachChild (&UIProgressBarHealth); - xml_init.InitProgressBar (uiXml, "progress_bar_health", 0, &UIProgressBarHealth); - - UIProgressBack.AttachChild (&UIProgressBarPsyHealth); - xml_init.InitProgressBar (uiXml, "progress_bar_psy", 0, &UIProgressBarPsyHealth); - - UIProgressBack.AttachChild (&UIProgressBarRadiation); - xml_init.InitProgressBar (uiXml, "progress_bar_radiation", 0, &UIProgressBarRadiation); - - UIPersonalWnd.AttachChild (&UIStaticPersonal); - xml_init.InitStatic (uiXml, "static_personal",0, &UIStaticPersonal); - - AttachChild (&UIOutfitInfo); - UIOutfitInfo.InitFromXml (uiXml); - - //Ýëåìåíòû àâòîìàòè÷åñêîãî äîáàâëåíèÿ - xml_init.InitAutoStatic (uiXml, "auto_static", this); - - - if (!IsGameTypeSingle()) - { - UIRankFrame = xr_new (); - UIRankFrame->SetAutoDelete (true); - UIRank = xr_new (); - UIRank->SetAutoDelete (true); - - CUIXmlInit::InitStatic (uiXml, "rank", 0, UIRankFrame); - CUIXmlInit::InitStatic (uiXml, "rank:pic", 0, UIRank); - AttachChild (UIRankFrame); - UIRankFrame->AttachChild (UIRank); - } - - m_pUIBagList = xr_new(); UIBagWnd.AttachChild(m_pUIBagList); m_pUIBagList->SetAutoDelete(true); - xml_init.InitDragDropListEx (uiXml, "dragdrop_bag", 0, m_pUIBagList); - BindDragDropListEnents (m_pUIBagList); - - m_pUIBeltList = xr_new(); AttachChild(m_pUIBeltList); m_pUIBeltList->SetAutoDelete(true); - xml_init.InitDragDropListEx (uiXml, "dragdrop_belt", 0, m_pUIBeltList); - BindDragDropListEnents (m_pUIBeltList); - - m_pUIOutfitList = xr_new(); AttachChild(m_pUIOutfitList); m_pUIOutfitList->SetAutoDelete(true); - xml_init.InitDragDropListEx (uiXml, "dragdrop_outfit", 0, m_pUIOutfitList); - BindDragDropListEnents (m_pUIOutfitList); - - m_pUIPistolList = xr_new(); AttachChild(m_pUIPistolList); m_pUIPistolList->SetAutoDelete(true); - xml_init.InitDragDropListEx (uiXml, "dragdrop_pistol", 0, m_pUIPistolList); - BindDragDropListEnents (m_pUIPistolList); - - m_pUIAutomaticList = xr_new(); AttachChild(m_pUIAutomaticList); m_pUIAutomaticList->SetAutoDelete(true); - xml_init.InitDragDropListEx (uiXml, "dragdrop_automatic", 0, m_pUIAutomaticList); - BindDragDropListEnents (m_pUIAutomaticList); - - //pop-up menu - AttachChild (&UIPropertiesBox); - UIPropertiesBox.InitPropertiesBox (Fvector2().set(0,0),Fvector2().set(300,300)); - UIPropertiesBox.Hide (); - - AttachChild (&UIStaticTime); - xml_init.InitStatic (uiXml, "time_static", 0, &UIStaticTime); - - UIStaticTime.AttachChild (&UIStaticTimeString); - xml_init.InitStatic (uiXml, "time_static_str", 0, &UIStaticTimeString); - - UIExitButton = xr_new();UIExitButton->SetAutoDelete(true); - AttachChild (UIExitButton); - xml_init.Init3tButton (uiXml, "exit_button", 0, UIExitButton); - -//Load sounds - - XML_NODE* stored_root = uiXml.GetLocalRoot (); - uiXml.SetLocalRoot (uiXml.NavigateToNode ("action_sounds",0)); - ::Sound->create (sounds[eInvSndOpen], uiXml.Read("snd_open", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvSndClose], uiXml.Read("snd_close", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvItemToSlot], uiXml.Read("snd_item_to_slot", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvItemToBelt], uiXml.Read("snd_item_to_belt", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvItemToRuck], uiXml.Read("snd_item_to_ruck", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvProperties], uiXml.Read("snd_properties", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvDropItem], uiXml.Read("snd_drop_item", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvAttachAddon], uiXml.Read("snd_attach_addon", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvDetachAddon], uiXml.Read("snd_detach_addon", 0, NULL),st_Effect,sg_SourceType); - ::Sound->create (sounds[eInvItemUse], uiXml.Read("snd_item_use", 0, NULL),st_Effect,sg_SourceType); - - uiXml.SetLocalRoot (stored_root); -} - -EListType CUIInventoryWnd::GetType(CUIDragDropListEx* l) -{ - if(l==m_pUIBagList) return iwActorBag; - if(l==m_pUIBeltList) return iwActorBelt; - - if(l==m_pUIAutomaticList) return iwActorSlot; - if(l==m_pUIPistolList) return iwActorSlot; - if(l==m_pUIOutfitList) return iwActorSlot; - - NODEFAULT; -#ifdef DEBUG - return iwActorSlot; -#endif // DEBUG -} - -void CUIInventoryWnd::PlaySnd(eInventorySndAction a) -{ - if (sounds[a]._handle()) - sounds[a].play (NULL, sm_2D); -} - -CUIInventoryWnd::~CUIInventoryWnd() -{ -//. ClearDragDrop(m_vDragDropItems); - ClearAllLists (); -} - -bool CUIInventoryWnd::OnMouse(float x, float y, EUIMessages mouse_action) -{ - if(m_b_need_reinit) - return true; - - //âûçîâ äîïîëíèòåëüíîãî ìåíþ ïî ïðàâîé êíîïêå - if(mouse_action == WINDOW_RBUTTON_DOWN) - { - if(UIPropertiesBox.IsShown()) - { - UIPropertiesBox.Hide (); - return true; - } - } - - CUIWindow::OnMouse (x, y, mouse_action); - - return true; // always returns true, because ::StopAnyMove() == true; -} - -void CUIInventoryWnd::Draw() -{ - CUIWindow::Draw (); -} - - -void CUIInventoryWnd::Update() -{ - if(m_b_need_reinit) - InitInventory (); - - - CEntityAlive *pEntityAlive = smart_cast(Level().CurrentEntity()); - - if(pEntityAlive) - { - float v = pEntityAlive->conditions().GetHealth()*100.0f; - UIProgressBarHealth.SetProgressPos (v); - - v = pEntityAlive->conditions().GetPsyHealth()*100.0f; - UIProgressBarPsyHealth.SetProgressPos (v); - - v = pEntityAlive->conditions().GetRadiation()*100.0f; - UIProgressBarRadiation.SetProgressPos (v); - - CInventoryOwner* pOurInvOwner = smart_cast(pEntityAlive); - u32 _money = 0; - - if (GameID() != eGameIDSingle){ - game_PlayerState* ps = Game().GetPlayerByGameID(pEntityAlive->ID()); - if (ps){ - UIProgressBarRank.SetProgressPos(ps->experience_D*100); - _money = ps->money_for_round; - } - }else - { - _money = pOurInvOwner->get_money(); - } - // update money - string64 sMoney; - sprintf_s (sMoney,"%d RU", _money); - UIMoneyWnd.SetText (sMoney); - - // update outfit parameters - CCustomOutfit* outfit = smart_cast(pOurInvOwner->inventory().m_slots[OUTFIT_SLOT].m_pIItem); - UIOutfitInfo.Update (outfit); - } - - UIStaticTimeString.SetText(*InventoryUtilities::GetGameTimeAsString(InventoryUtilities::etpTimeToMinutes)); - - CUIWindow::Update (); -} - -void CUIInventoryWnd::Show() -{ - InitInventory (); - inherited::Show (); - - if (!IsGameTypeSingle()) - { - CActor *pActor = smart_cast(Level().CurrentEntity()); - if(!pActor) return; - - pActor->SetWeaponHideState(INV_STATE_INV_WND, true); - - //rank icon - int team = Game().local_player->team; - int rank = Game().local_player->rank; - string256 _path; - - u32 gameid = GameID(); - if ((gameid == eGameIDTeamDeathmatch) || (gameid == eGameIDArtefactHunt)) - { - if (1==team) - sprintf_s(_path, "ui_hud_status_green_0%d", rank+1); - else - sprintf_s(_path, "ui_hud_status_blue_0%d", rank+1); - } else - { - if (team == 0) - sprintf_s(_path, "ui_hud_status_green_0%d", rank+1); - else - sprintf_s(_path, "ui_hud_status_blue_0%d", rank+1); - } - - UIRank->InitTexture(_path); - } - - SendInfoToActor ("ui_inventory"); - - Update (); - PlaySnd (eInvSndOpen); -} - -void CUIInventoryWnd::Hide() -{ - PlaySnd (eInvSndClose); - inherited::Hide (); - - SendInfoToActor ("ui_inventory_hide"); - ClearAllLists (); - - //äîñòàòü âåùü â àêòèâíûé ñëîò - CActor *pActor = smart_cast(Level().CurrentEntity()); - if(pActor && m_iCurrentActiveSlot != NO_ACTIVE_SLOT && - pActor->inventory().m_slots[m_iCurrentActiveSlot].m_pIItem) - { - pActor->inventory().Activate(m_iCurrentActiveSlot); - m_iCurrentActiveSlot = NO_ACTIVE_SLOT; - } - - if (!IsGameTypeSingle()) - { - CActor *pActor = smart_cast(Level().CurrentEntity()); - if(!pActor) return; - - pActor->SetWeaponHideState(INV_STATE_INV_WND, false); - } -} - -void CUIInventoryWnd::AttachAddon(PIItem item_to_upgrade) -{ - PlaySnd (eInvAttachAddon); - R_ASSERT (item_to_upgrade); - if (OnClient()) - { - NET_Packet P; - item_to_upgrade->object().u_EventGen (P, GE_ADDON_ATTACH, item_to_upgrade->object().ID()); - P.w_u16 (CurrentIItem()->object().ID()); - item_to_upgrade->object().u_EventSend (P); - }; - - item_to_upgrade->Attach (CurrentIItem(), true); - - - //ñïðÿòàòü âåùü èç àêòèâíîãî ñëîòà â èíâåíòàðü íà âðåìÿ âûçîâà ìåíþøêè - CActor *pActor = smart_cast(Level().CurrentEntity()); - if(pActor && item_to_upgrade == pActor->inventory().ActiveItem()) - { - m_iCurrentActiveSlot = pActor->inventory().GetActiveSlot(); - pActor->inventory().Activate (NO_ACTIVE_SLOT); - } - SetCurrentItem (NULL); -} - -void CUIInventoryWnd::DetachAddon(const char* addon_name) -{ - PlaySnd (eInvDetachAddon); - if (OnClient()) - { - NET_Packet P; - CurrentIItem()->object().u_EventGen (P, GE_ADDON_DETACH, CurrentIItem()->object().ID()); - P.w_stringZ (addon_name); - CurrentIItem()->object().u_EventSend (P); - }; - CurrentIItem()->Detach (addon_name, true); - - //ñïðÿòàòü âåùü èç àêòèâíîãî ñëîòà â èíâåíòàðü íà âðåìÿ âûçîâà ìåíþøêè - CActor *pActor = smart_cast(Level().CurrentEntity()); - if(pActor && CurrentIItem() == pActor->inventory().ActiveItem()) - { - m_iCurrentActiveSlot = pActor->inventory().GetActiveSlot(); - pActor->inventory().Activate (NO_ACTIVE_SLOT); - } -} - - -void CUIInventoryWnd::SendEvent_ActivateSlot(PIItem pItem) -{ - NET_Packet P; - pItem->object().u_EventGen (P, GEG_PLAYER_ACTIVATE_SLOT, pItem->object().H_Parent()->ID()); - P.w_u32 (pItem->GetSlot()); - pItem->object().u_EventSend (P); -} - -void CUIInventoryWnd::SendEvent_Item2Slot(PIItem pItem) -{ - NET_Packet P; - pItem->object().u_EventGen (P, GEG_PLAYER_ITEM2SLOT, pItem->object().H_Parent()->ID()); - P.w_u16 (pItem->object().ID()); - pItem->object().u_EventSend (P); - g_pInvWnd->PlaySnd (eInvItemToSlot); -}; - -void CUIInventoryWnd::SendEvent_Item2Belt(PIItem pItem) -{ - NET_Packet P; - pItem->object().u_EventGen (P, GEG_PLAYER_ITEM2BELT, pItem->object().H_Parent()->ID()); - P.w_u16 (pItem->object().ID()); - pItem->object().u_EventSend (P); - g_pInvWnd->PlaySnd (eInvItemToBelt); -}; - -void CUIInventoryWnd::SendEvent_Item2Ruck(PIItem pItem) -{ - NET_Packet P; - pItem->object().u_EventGen (P, GEG_PLAYER_ITEM2RUCK, pItem->object().H_Parent()->ID()); - P.w_u16 (pItem->object().ID()); - pItem->object().u_EventSend (P); - - g_pInvWnd->PlaySnd (eInvItemToRuck); -}; - -void CUIInventoryWnd::SendEvent_Item_Drop(PIItem pItem) -{ - pItem->SetDropManual (TRUE); - g_pInvWnd->PlaySnd (eInvDropItem); -}; - -void CUIInventoryWnd::SendEvent_Item_Eat(PIItem pItem) -{ - NET_Packet P; - pItem->object().u_EventGen (P, GEG_PLAYER_ITEM_EAT, pItem->object().H_Parent()->ID()); - P.w_u16 (pItem->object().ID()); - pItem->object().u_EventSend (P); -}; - - -void CUIInventoryWnd::BindDragDropListEnents(CUIDragDropListEx* lst) -{ - lst->m_f_item_drop = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUIInventoryWnd::OnItemDrop); - lst->m_f_item_start_drag = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUIInventoryWnd::OnItemStartDrag); - lst->m_f_item_db_click = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUIInventoryWnd::OnItemDbClick); - lst->m_f_item_selected = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUIInventoryWnd::OnItemSelected); - lst->m_f_item_rbutton_click = CUIDragDropListEx::DRAG_DROP_EVENT(this,&CUIInventoryWnd::OnItemRButtonClick); -} - - -#include "../xr_level_controller.h" -#include - -bool CUIInventoryWnd::OnKeyboard(int dik, EUIMessages keyboard_action) -{ - if(m_b_need_reinit) - return true; - - if (UIPropertiesBox.GetVisible()) - UIPropertiesBox.OnKeyboard(dik, keyboard_action); - - if ( is_binded(kDROP, dik) ) - { - if(WINDOW_KEY_PRESSED==keyboard_action) - DropCurrentItem(false); - return true; - } - - if (WINDOW_KEY_PRESSED == keyboard_action) - { -#ifdef DEBUG - if(DIK_NUMPAD7 == dik && CurrentIItem()) - { - CurrentIItem()->ChangeCondition(-0.05f); - UIItemInfo.InitItem(CurrentIItem()); - } - else if(DIK_NUMPAD8 == dik && CurrentIItem()) - { - CurrentIItem()->ChangeCondition(0.05f); - UIItemInfo.InitItem(CurrentIItem()); - } -#endif - } - if( inherited::OnKeyboard(dik,keyboard_action) )return true; - - return false; -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIInventoryWnd.h b/src/xrGame/ui/UIInventoryWnd.h deleted file mode 100644 index 7b3526339ef..00000000000 --- a/src/xrGame/ui/UIInventoryWnd.h +++ /dev/null @@ -1,163 +0,0 @@ -#error unused file - -#pragma once -/* -class CInventory; - -#include "UIDialogWnd.h" -#include "UIStatic.h" - -#include "UIProgressBar.h" - -#include "UIPropertiesBox.h" -#include "UIOutfitSlot.h" - -#include "UIOutfitInfo2.h" -#include "UIItemInfo.h" -#include "../../xrServerEntities/inventory_space.h" - -class CArtefact; -class CUI3tButton; -class CUIDragDropListEx; -class CUICellItem; - -enum EListType{ - iwActorSlot, - iwActorBag, - iwActorBelt -}; - -class CUIInventoryWnd: public CUIDialogWnd -{ -private: - typedef CUIDialogWnd inherited; - bool m_b_need_reinit; -public: - CUIInventoryWnd (); - virtual ~CUIInventoryWnd (); - - virtual void Init (); - - void InitInventory (); - void InitInventory_delayed (); - virtual bool StopAnyMove () {return false;} - - virtual void SendMessage (CUIWindow *pWnd, s16 msg, void *pData); - virtual bool OnMouse (float x, float y, EUIMessages mouse_action); - virtual bool OnKeyboard (int dik, EUIMessages keyboard_action); - - - IC CInventory* GetInventory () {return m_pInv;} - - virtual void Update (); - virtual void Draw (); - - virtual void Show (); - virtual void Hide (); - - void AddItemToBag (PIItem pItem); - -protected: - enum eInventorySndAction{ eInvSndOpen =0, - eInvSndClose, - eInvItemToSlot, - eInvItemToBelt, - eInvItemToRuck, - eInvProperties, - eInvDropItem, - eInvAttachAddon, - eInvDetachAddon, - eInvItemUse, - eInvSndMax}; - - ref_sound sounds [eInvSndMax]; - void PlaySnd (eInventorySndAction a); - - CUIStatic UIBeltSlots; - CUIStatic UIBack; - CUIStatic* UIRankFrame; - CUIStatic* UIRank; - - CUIStatic UIBagWnd; - CUIStatic UIMoneyWnd; - CUIStatic UIDescrWnd; - CUIFrameWindow UIPersonalWnd; - - CUI3tButton* UIExitButton; - - CUIStatic UIStaticBottom; - CUIStatic UIStaticTime; - CUIStatic UIStaticTimeString; - - CUIStatic UIStaticPersonal; - - CUIDragDropListEx* m_pUIBagList; - CUIDragDropListEx* m_pUIBeltList; - CUIDragDropListEx* m_pUIPistolList; - CUIDragDropListEx* m_pUIAutomaticList; - CUIOutfitDragDropList* m_pUIOutfitList; - void ClearAllLists (); - void BindDragDropListEnents (CUIDragDropListEx* lst); - - EListType GetType (CUIDragDropListEx* l); - CUIDragDropListEx* GetSlotList (u32 slot_idx); - - bool xr_stdcall OnItemDrop (CUICellItem* itm); - bool xr_stdcall OnItemStartDrag (CUICellItem* itm); - bool xr_stdcall OnItemDbClick (CUICellItem* itm); - bool xr_stdcall OnItemSelected (CUICellItem* itm); - bool xr_stdcall OnItemRButtonClick (CUICellItem* itm); - - - CUIStatic UIProgressBack; - CUIStatic UIProgressBack_rank; - CUIProgressBar UIProgressBarHealth; - CUIProgressBar UIProgressBarPsyHealth; - CUIProgressBar UIProgressBarRadiation; - CUIProgressBar UIProgressBarRank; - - CUIPropertiesBox UIPropertiesBox; - - //èíôîðìàöèÿ î ïåðñîíàæå - CUIOutfitInfo2 UIOutfitInfo; - CUIItemInfo UIItemInfo; - - CInventory* m_pInv; - - CUICellItem* m_pCurrentCellItem; - - bool DropItem (PIItem itm, CUIDragDropListEx* lst); - bool TryUseItem (PIItem itm); - //---------------------- ----------------------------------------------- - void SendEvent_Item2Slot (PIItem pItem); - void SendEvent_Item2Belt (PIItem pItem); - void SendEvent_Item2Ruck (PIItem pItem); - void SendEvent_Item_Drop (PIItem pItem); - void SendEvent_Item_Eat (PIItem pItem); - void SendEvent_ActivateSlot (PIItem pItem); - - //--------------------------------------------------------------------- - - void ProcessPropertiesBoxClicked (); - void ActivatePropertiesBox (); - - void DropCurrentItem (bool b_all); - void EatItem (PIItem itm); - - bool ToSlot (CUICellItem* itm, bool force_place); - bool ToBag (CUICellItem* itm, bool b_use_cursor_pos); - bool ToBelt (CUICellItem* itm, bool b_use_cursor_pos); - - - void AttachAddon (PIItem item_to_upgrade); - void DetachAddon (const char* addon_name); - - void SetCurrentItem (CUICellItem* itm); - CUICellItem* CurrentItem (); - PIItem CurrentIItem (); - - TIItemContainer ruck_list; - u32 m_iCurrentActiveSlot; - -}; -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIInventoryWnd3.cpp b/src/xrGame/ui/UIInventoryWnd3.cpp deleted file mode 100644 index c88090d92a7..00000000000 --- a/src/xrGame/ui/UIInventoryWnd3.cpp +++ /dev/null @@ -1,302 +0,0 @@ -#include "stdafx.h" -#include "UIInventoryWnd.h" -/* -#include "../actor.h" -#include "../silencer.h" -#include "../scope.h" -#include "../grenadelauncher.h" -#include "../Artefact.h" -#include "../eatable_item.h" -#include "../BottleItem.h" -#include "../WeaponMagazined.h" -#include "../inventory.h" -#include "../game_base.h" -#include "../game_cl_base.h" -#include "../xr_level_controller.h" -#include "UICellItem.h" -#include "UIListBoxItem.h" -#include "../CustomOutfit.h" -#include "../UICursor.h" - - -void CUIInventoryWnd::EatItem(PIItem itm) -{ - SetCurrentItem (NULL); - if(!itm->Useful()) return; - CActor *pActor = smart_cast(Level().CurrentEntity()); - if(!pActor) return; - - - SendEvent_Item_Eat (itm); - - PlaySnd (eInvItemUse); -} - -#include "../Medkit.h" -#include "../Antirad.h" -void CUIInventoryWnd::ActivatePropertiesBox() -{ - // Ôëàã-ïðèçíàê äëÿ íåâëþ÷åíèÿ ïóíêòà êîíòåêñòíîãî ìåíþ: Dreess Outfit, åñëè êîñòþì óæå íàäåò - bool bAlreadyDressed = false; - - - UIPropertiesBox.RemoveAll(); - - CMedkit* pMedkit = smart_cast (CurrentIItem()); - CAntirad* pAntirad = smart_cast (CurrentIItem()); - CEatableItem* pEatableItem = smart_cast (CurrentIItem()); - CCustomOutfit* pOutfit = smart_cast (CurrentIItem()); -//. CArtefact* pArtefact = smart_cast (CurrentIItem()); - CWeapon* pWeapon = smart_cast (CurrentIItem()); - CScope* pScope = smart_cast (CurrentIItem()); - CSilencer* pSilencer = smart_cast (CurrentIItem()); - CGrenadeLauncher* pGrenadeLauncher = smart_cast (CurrentIItem()); - CBottleItem* pBottleItem = smart_cast (CurrentIItem()); - - bool b_show = false; - - - if(!pOutfit && CurrentIItem()->GetSlot()!=NO_ACTIVE_SLOT && !m_pInv->m_slots[CurrentIItem()->GetSlot()].m_bPersistent && m_pInv->CanPutInSlot(CurrentIItem())) - { - UIPropertiesBox.AddItem("st_move_to_slot", NULL, INVENTORY_TO_SLOT_ACTION); - b_show = true; - } - if(CurrentIItem()->Belt() && m_pInv->CanPutInBelt(CurrentIItem())) - { - UIPropertiesBox.AddItem("st_move_on_belt", NULL, INVENTORY_TO_BELT_ACTION); - b_show = true; - } - - if(CurrentIItem()->Ruck() && m_pInv->CanPutInRuck(CurrentIItem()) && (CurrentIItem()->GetSlot()==u32(-1) || !m_pInv->m_slots[CurrentIItem()->GetSlot()].m_bPersistent) ) - { - if(!pOutfit) - UIPropertiesBox.AddItem("st_move_to_bag", NULL, INVENTORY_TO_BAG_ACTION); - else - UIPropertiesBox.AddItem("st_undress_outfit", NULL, INVENTORY_TO_BAG_ACTION); - bAlreadyDressed = true; - b_show = true; - } - if(pOutfit && !bAlreadyDressed ) - { - UIPropertiesBox.AddItem("st_dress_outfit", NULL, INVENTORY_TO_SLOT_ACTION); - b_show = true; - } - - //îòñîåäèíåíèå àääîíîâ îò âåùè - if(pWeapon) - { - if(pWeapon->GrenadeLauncherAttachable() && pWeapon->IsGrenadeLauncherAttached()) - { - UIPropertiesBox.AddItem("st_detach_gl", NULL, INVENTORY_DETACH_GRENADE_LAUNCHER_ADDON); - b_show = true; - } - if(pWeapon->ScopeAttachable() && pWeapon->IsScopeAttached()) - { - UIPropertiesBox.AddItem("st_detach_scope", NULL, INVENTORY_DETACH_SCOPE_ADDON); - b_show = true; - } - if(pWeapon->SilencerAttachable() && pWeapon->IsSilencerAttached()) - { - UIPropertiesBox.AddItem("st_detach_silencer", NULL, INVENTORY_DETACH_SILENCER_ADDON); - b_show = true; - } - if(smart_cast(pWeapon) && IsGameTypeSingle()) - { - bool b = (0!=pWeapon->GetAmmoElapsed()); - - if(!b) - { - CUICellItem * itm = CurrentItem(); - for(u32 i=0; iChildsCount(); ++i) - { - pWeapon = smart_cast((CWeapon*)itm->Child(i)->m_pData); - if(pWeapon->GetAmmoElapsed()) - { - b = true; - break; - } - } - } - - if(b){ - UIPropertiesBox.AddItem("st_unload_magazine", NULL, INVENTORY_UNLOAD_MAGAZINE); - b_show = true; - } - } - } - - //ïðèñîåäèíåíèå àääîíîâ ê àêòèâíîìó ñëîòó (2 èëè 3) - if(pScope) - { - if(m_pInv->m_slots[PISTOL_SLOT].m_pIItem != NULL && - m_pInv->m_slots[PISTOL_SLOT].m_pIItem->CanAttach(pScope)) - { - PIItem tgt = m_pInv->m_slots[PISTOL_SLOT].m_pIItem; - UIPropertiesBox.AddItem("st_attach_scope_to_pistol", (void*)tgt, INVENTORY_ATTACH_ADDON); - b_show = true; - } - if(m_pInv->m_slots[RIFLE_SLOT].m_pIItem != NULL && - m_pInv->m_slots[RIFLE_SLOT].m_pIItem->CanAttach(pScope)) - { - PIItem tgt = m_pInv->m_slots[RIFLE_SLOT].m_pIItem; - UIPropertiesBox.AddItem("st_attach_scope_to_rifle", (void*)tgt, INVENTORY_ATTACH_ADDON); - b_show = true; - } - } - else if(pSilencer) - { - if(m_pInv->m_slots[PISTOL_SLOT].m_pIItem != NULL && - m_pInv->m_slots[PISTOL_SLOT].m_pIItem->CanAttach(pSilencer)) - { - PIItem tgt = m_pInv->m_slots[PISTOL_SLOT].m_pIItem; - UIPropertiesBox.AddItem("st_attach_silencer_to_pistol", (void*)tgt, INVENTORY_ATTACH_ADDON); - b_show = true; - } - if(m_pInv->m_slots[RIFLE_SLOT].m_pIItem != NULL && - m_pInv->m_slots[RIFLE_SLOT].m_pIItem->CanAttach(pSilencer)) - { - PIItem tgt = m_pInv->m_slots[RIFLE_SLOT].m_pIItem; - UIPropertiesBox.AddItem("st_attach_silencer_to_rifle", (void*)tgt, INVENTORY_ATTACH_ADDON); - b_show = true; - } - } - else if(pGrenadeLauncher) - { - if(m_pInv->m_slots[RIFLE_SLOT].m_pIItem != NULL && - m_pInv->m_slots[RIFLE_SLOT].m_pIItem->CanAttach(pGrenadeLauncher)) - { - PIItem tgt = m_pInv->m_slots[RIFLE_SLOT].m_pIItem; - UIPropertiesBox.AddItem("st_attach_gl_to_rifle", (void*)tgt, INVENTORY_ATTACH_ADDON); - b_show = true; - } - - } - LPCSTR _action = NULL; - - if(pMedkit || pAntirad) - { - _action = "st_use"; - } - else if(pEatableItem) - { - if(pBottleItem) - _action = "st_drink"; - else - _action = "st_eat"; - } - - if(_action){ - UIPropertiesBox.AddItem(_action, NULL, INVENTORY_EAT_ACTION); - b_show = true; - } - - if(!CurrentIItem()->IsQuestItem()){ - UIPropertiesBox.AddItem("st_drop", NULL, INVENTORY_DROP_ACTION); - b_show = true; - - if(CurrentItem()->ChildsCount()) - UIPropertiesBox.AddItem("st_drop_all", (void*)33, INVENTORY_DROP_ACTION); - } - - if(b_show) - { - UIPropertiesBox.AutoUpdateSize (); - UIPropertiesBox.BringAllToTop (); - - Fvector2 cursor_pos; - Frect vis_rect; - GetAbsoluteRect (vis_rect); - GetUICursor()->GetPosition (cursor_pos.x, cursor_pos.y); - cursor_pos.sub (vis_rect.lt); - UIPropertiesBox.Show (vis_rect, cursor_pos); - PlaySnd (eInvProperties); - } -} - -void CUIInventoryWnd::ProcessPropertiesBoxClicked () -{ - if(UIPropertiesBox.GetClickedItem()) - { - switch(UIPropertiesBox.GetClickedItem()->GetTAG()) - { - case INVENTORY_TO_SLOT_ACTION: - ToSlot(CurrentItem(), true); - break; - case INVENTORY_TO_BELT_ACTION: - ToBelt(CurrentItem(),false); - break; - case INVENTORY_TO_BAG_ACTION: - ToBag(CurrentItem(),false); - break; - case INVENTORY_DROP_ACTION: - { - void* d = UIPropertiesBox.GetClickedItem()->GetData(); - bool b_all = (d==(void*)33); - - DropCurrentItem(b_all); - }break; - case INVENTORY_EAT_ACTION: - EatItem(CurrentIItem()); - break; - case INVENTORY_ATTACH_ADDON: - AttachAddon((PIItem)(UIPropertiesBox.GetClickedItem()->GetData())); - break; - case INVENTORY_DETACH_SCOPE_ADDON: - DetachAddon(*(smart_cast(CurrentIItem()))->GetScopeName()); - break; - case INVENTORY_DETACH_SILENCER_ADDON: - DetachAddon(*(smart_cast(CurrentIItem()))->GetSilencerName()); - break; - case INVENTORY_DETACH_GRENADE_LAUNCHER_ADDON: - DetachAddon(*(smart_cast(CurrentIItem()))->GetGrenadeLauncherName()); - break; - case INVENTORY_RELOAD_MAGAZINE: - (smart_cast(CurrentIItem()))->Action(kWPN_RELOAD, CMD_START); - break; - case INVENTORY_UNLOAD_MAGAZINE: - { - CUICellItem * itm = CurrentItem(); - (smart_cast((CWeapon*)itm->m_pData))->UnloadMagazine(); - for(u32 i=0; iChildsCount(); ++i) - { - CUICellItem * child_itm = itm->Child(i); - (smart_cast((CWeapon*)child_itm->m_pData))->UnloadMagazine(); - } - }break; - } - } -} - -bool CUIInventoryWnd::TryUseItem(PIItem itm) -{ - CBottleItem* pBottleItem = smart_cast (itm); - CMedkit* pMedkit = smart_cast (itm); - CAntirad* pAntirad = smart_cast (itm); - CEatableItem* pEatableItem = smart_cast (itm); - - if(pMedkit || pAntirad || pEatableItem || pBottleItem) - { - EatItem(itm); - return true; - } - return false; -} - -bool CUIInventoryWnd::DropItem(PIItem itm, CUIDragDropListEx* lst) -{ - if(lst==m_pUIOutfitList) - { - EatItem (CurrentIItem()); - return true; - } - CUICellItem* _citem = lst->ItemsCount() ? lst->GetItemIdx(0) : NULL; - PIItem _iitem = _citem ? (PIItem)_citem->m_pData : NULL; - - if(!_iitem) return false; - if(!_iitem->CanAttach(itm)) return false; - AttachAddon (_iitem); - - - return true; -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIItemInfo.cpp b/src/xrGame/ui/UIItemInfo.cpp index 56da187e0e0..2c7e3d927a1 100644 --- a/src/xrGame/ui/UIItemInfo.cpp +++ b/src/xrGame/ui/UIItemInfo.cpp @@ -1,28 +1,25 @@ #include "pch_script.h" - #include "uiiteminfo.h" #include "uistatic.h" #include "UIXmlInit.h" - #include "UIProgressBar.h" #include "UIScrollView.h" #include "UIFrameWindow.h" - #include "ai_space.h" #include "alife_simulator.h" -#include "../string_table.h" -#include "../Inventory_Item.h" +#include "string_table.h" +#include "Inventory_Item.h" #include "UIInventoryUtilities.h" -#include "../PhysicsShellHolder.h" +#include "PhysicsShellHolder.h" #include "UIWpnParams.h" #include "ui_af_params.h" #include "UIInvUpgradeProperty.h" #include "UIOutfitInfo.h" #include "UIBoosterInfo.h" -#include "../Weapon.h" -#include "../CustomOutfit.h" -#include "../ActorHelmet.h" -#include "../eatable_item.h" +#include "Weapon.h" +#include "CustomOutfit.h" +#include "ActorHelmet.h" +#include "eatable_item.h" #include "UICellItem.h" extern const LPCSTR g_inventory_upgrade_xml; diff --git a/src/xrGame/ui/UIKeyBinding.cpp b/src/xrGame/ui/UIKeyBinding.cpp index cad8f3cc646..799bbd60029 100644 --- a/src/xrGame/ui/UIKeyBinding.cpp +++ b/src/xrGame/ui/UIKeyBinding.cpp @@ -4,8 +4,8 @@ #include "xrUIXmlParser.h" #include "UIEditKeyBind.h" #include "UIScrollView.h" -#include "../xr_level_controller.h" -#include "../string_table.h" +#include "xr_level_controller.h" +#include "string_table.h" CUIKeyBinding::CUIKeyBinding() { diff --git a/src/xrGame/ui/UIKickPlayer.cpp b/src/xrGame/ui/UIKickPlayer.cpp index 9f1cd21b792..bbb065e5597 100644 --- a/src/xrGame/ui/UIKickPlayer.cpp +++ b/src/xrGame/ui/UIKickPlayer.cpp @@ -1,5 +1,4 @@ #include "StdAfx.h" - #include "UIKickPlayer.h" #include "UIVotingCategory.h" #include "UIXmlInit.h" @@ -8,10 +7,10 @@ #include "UIListBoxItem.h" #include "UISpinNum.h" #include "UIGameCustom.h" -#include "../level.h" -#include "../game_cl_base.h" -#include "../game_cl_teamdeathmatch.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "Level.h" +#include "game_cl_base.h" +#include "game_cl_teamdeathmatch.h" +#include "xrEngine/xr_ioconsole.h" CUIKickPlayer::CUIKickPlayer() { diff --git a/src/xrGame/ui/UILanimController.cpp b/src/xrGame/ui/UILanimController.cpp index 08efc6d3f28..cb679a6b98e 100644 --- a/src/xrGame/ui/UILanimController.cpp +++ b/src/xrGame/ui/UILanimController.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "UILanimController.h" -#include "../../xrEngine/LightAnimLibrary.h" +#include "xrEngine/LightAnimLibrary.h" color_animation::color_animation() :m_lanim(NULL), m_lanim_start_time(-1.0f),m_lanim_delay_time(0.0f) diff --git a/src/xrGame/ui/UILanimController.h b/src/xrGame/ui/UILanimController.h index 84ebbf22dd4..525461afb68 100644 --- a/src/xrGame/ui/UILanimController.h +++ b/src/xrGame/ui/UILanimController.h @@ -1,7 +1,7 @@ #pragma once #include "uiwindow.h" -#include "../../xrEngine/LightAnimLibrary.h" +#include "xrEngine/LightAnimLibrary.h" class CLAItem; diff --git a/src/xrGame/ui/UILines.cpp b/src/xrGame/ui/UILines.cpp index a605dc1a94a..2ca6aa18007 100644 --- a/src/xrGame/ui/UILines.cpp +++ b/src/xrGame/ui/UILines.cpp @@ -11,7 +11,7 @@ #include "UILines.h" #include "UIXmlInit.h" #include "uilinestd.h" -#include "../string_table.h" +#include "string_table.h" CUILines::CUILines() diff --git a/src/xrGame/ui/UIListBox.cpp b/src/xrGame/ui/UIListBox.cpp index 7b0edac99b5..7d939aad2fd 100644 --- a/src/xrGame/ui/UIListBox.cpp +++ b/src/xrGame/ui/UIListBox.cpp @@ -39,7 +39,7 @@ bool CUIListBox::OnMouseAction(float x, float y, EUIMessages mouse_action) return false; } -#include "../string_table.h" +#include "string_table.h" CUIListBoxItem* CUIListBox::AddTextItem(LPCSTR text) { CUIListBoxItem* pItem = AddItem(); diff --git a/src/xrGame/ui/UIListItemServer.cpp b/src/xrGame/ui/UIListItemServer.cpp index 973f87f29be..ef92507c9fb 100644 --- a/src/xrGame/ui/UIListItemServer.cpp +++ b/src/xrGame/ui/UIListItemServer.cpp @@ -100,7 +100,7 @@ void CUIListItemServer::InitItemServer(LIST_SRV_ITEM& params) m_srv_info = params; } -#include "../string_table.h" +#include "string_table.h" u32 cut_string_by_length(CGameFont* pFont, LPCSTR src, LPSTR dst, u32 dst_size, float length); void CUIListItemServer::SetParams(LIST_SRV_ITEM& params) diff --git a/src/xrGame/ui/UILogsWnd.cpp b/src/xrGame/ui/UILogsWnd.cpp index b8881e09314..f0defdccdfa 100644 --- a/src/xrGame/ui/UILogsWnd.cpp +++ b/src/xrGame/ui/UILogsWnd.cpp @@ -7,7 +7,6 @@ #include "stdafx.h" #include "UILogsWnd.h" - #include "UIXmlInit.h" #include "UIProgressBar.h" #include "UIFrameLineWnd.h" @@ -19,15 +18,13 @@ #include "UIHelper.h" #include "UICharacterInfo.h" #include "UIInventoryUtilities.h" - -#include "../actor.h" -#include "../game_news.h" -#include "../alife_time_manager.h" -#include "../alife_registry_wrappers.h" -#include "../string_table.h" +#include "Actor.h" +#include "game_news.h" +#include "alife_time_manager.h" +#include "alife_registry_wrappers.h" +#include "string_table.h" #include "UINewsItemWnd.h" -#include "../../xrEngine/xr_input.h" - +#include "xrEngine/xr_input.h" #define PDA_LOGS_XML "pda_logs.xml" diff --git a/src/xrGame/ui/UILogsWnd.h b/src/xrGame/ui/UILogsWnd.h index b00a5d0c2a6..6f49e46042e 100644 --- a/src/xrGame/ui/UILogsWnd.h +++ b/src/xrGame/ui/UILogsWnd.h @@ -11,8 +11,8 @@ #include "UIWindow.h" #include "UIWndCallback.h" -#include "../ai_space.h" -#include "../../xrServerEntities/alife_space.h" +#include "ai_space.h" +#include "xrServerEntities/alife_space.h" #include "xrUIXmlParser.h" class CUIStatic; diff --git a/src/xrGame/ui/UIMMShniaga.cpp b/src/xrGame/ui/UIMMShniaga.cpp index 6ff269b20f1..559695c7ae8 100644 --- a/src/xrGame/ui/UIMMShniaga.cpp +++ b/src/xrGame/ui/UIMMShniaga.cpp @@ -1,5 +1,4 @@ #include "StdAfx.h" - #include "UIMMShniaga.h" #include "UICursor.h" #include "UIStatic.h" @@ -7,14 +6,14 @@ #include "UIXmlInit.h" #include "MMsound.h" #include "game_base_space.h" -#include "../level.h" +#include "Level.h" #include "object_broker.h" #include -#include "../Actor.h" -#include "../saved_game_wrapper.h" -#include "../login_manager.h" +#include "Actor.h" +#include "saved_game_wrapper.h" +#include "login_manager.h" #include "MainMenu.h" -#include "../gamespy/GameSpy_Full.h" +#include "gamespy/GameSpy_Full.h" extern string_path g_last_saved_game; diff --git a/src/xrGame/ui/UIMPAdminMenu.cpp b/src/xrGame/ui/UIMPAdminMenu.cpp index 286637e3317..d023ed43b9c 100644 --- a/src/xrGame/ui/UIMPAdminMenu.cpp +++ b/src/xrGame/ui/UIMPAdminMenu.cpp @@ -10,7 +10,7 @@ #include "UI3tButton.h" #include "UIMessageBox.h" #include "UIMessageBoxEx.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" #include CUIMpAdminMenu::CUIMpAdminMenu() diff --git a/src/xrGame/ui/UIMPChangeMapAdm.cpp b/src/xrGame/ui/UIMPChangeMapAdm.cpp index 743a9514871..7a629dfbd53 100644 --- a/src/xrGame/ui/UIMPChangeMapAdm.cpp +++ b/src/xrGame/ui/UIMPChangeMapAdm.cpp @@ -6,10 +6,10 @@ #include "UIStatic.h" #include "UI3tButton.h" #include "UIDialogWnd.h" -#include "../Level.h" -#include "../../xrEngine/xr_ioconsole.h" -#include "../UIGameCustom.h" -#include "../string_table.h" +#include "Level.h" +#include "xrEngine/xr_ioconsole.h" +#include "UIGameCustom.h" +#include "string_table.h" CUIMpChangeMapAdm::CUIMpChangeMapAdm() { diff --git a/src/xrGame/ui/UIMPPlayersAdm.cpp b/src/xrGame/ui/UIMPPlayersAdm.cpp index a7f1e85f61c..9310e98e6bf 100644 --- a/src/xrGame/ui/UIMPPlayersAdm.cpp +++ b/src/xrGame/ui/UIMPPlayersAdm.cpp @@ -7,12 +7,12 @@ #include "UI3tButton.h" #include "UITrackBar.h" #include "UIComboBox.h" -#include "../Level.h" -#include "../xrServer.h" -#include "../game_cl_base.h" -#include "../game_cl_mp.h" -#include "../../xrEngine/xr_ioconsole.h" -#include "../string_table.h" +#include "Level.h" +#include "xrServer.h" +#include "game_cl_base.h" +#include "game_cl_mp.h" +#include "xrEngine/xr_ioconsole.h" +#include "string_table.h" extern int g_sv_adm_menu_ping_limit; xr_token g_ban_times[] = { diff --git a/src/xrGame/ui/UIMPServerAdm.cpp b/src/xrGame/ui/UIMPServerAdm.cpp index 0cabfb4b76d..2ee10fa05fc 100644 --- a/src/xrGame/ui/UIMPServerAdm.cpp +++ b/src/xrGame/ui/UIMPServerAdm.cpp @@ -5,7 +5,7 @@ #include "UIEditBox.h" #include "UISpinNum.h" #include "UICheckButton.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" #include "UIDialogWnd.h" CUIMpServerAdm::CUIMpServerAdm() diff --git a/src/xrGame/ui/UIMainIngameWnd.cpp b/src/xrGame/ui/UIMainIngameWnd.cpp index da147e99613..82ab625a1e5 100644 --- a/src/xrGame/ui/UIMainIngameWnd.cpp +++ b/src/xrGame/ui/UIMainIngameWnd.cpp @@ -1,54 +1,44 @@ #include "stdafx.h" - #include "UIMainIngameWnd.h" #include "UIMessagesWindow.h" -#include "../UIZoneMap.h" - - +#include "UIZoneMap.h" #include -#include "../actor.h" -#include "../ActorCondition.h" -#include "../EntityCondition.h" -#include "../CustomOutfit.h" -#include "../ActorHelmet.h" -#include "../PDA.h" -#include "../xrServerEntities/character_info.h" -#include "../inventory.h" -#include "../UIGameSP.h" -#include "../weaponmagazined.h" -#include "../missile.h" -#include "../Grenade.h" -#include "../xrServerEntities/xrServer_objects_ALife.h" -#include "../alife_simulator.h" -#include "../alife_object_registry.h" -#include "../game_cl_base.h" -#include "../level.h" -#include "../seniority_hierarchy_holder.h" - -#include "../date_time.h" -#include "../xrServerEntities/xrServer_Objects_ALife_Monsters.h" -#include "../../xrEngine/LightAnimLibrary.h" - +#include "Actor.h" +#include "ActorCondition.h" +#include "EntityCondition.h" +#include "CustomOutfit.h" +#include "ActorHelmet.h" +#include "PDA.h" +#include "xrServerEntities/character_info.h" +#include "Inventory.h" +#include "UIGameSP.h" +#include "WeaponMagazined.h" +#include "Missile.h" +#include "Grenade.h" +#include "xrServerEntities/xrServer_objects_ALife.h" +#include "alife_simulator.h" +#include "alife_object_registry.h" +#include "game_cl_base.h" +#include "Level.h" +#include "seniority_hierarchy_holder.h" +#include "date_time.h" +#include "xrServerEntities/xrServer_Objects_ALife_Monsters.h" +#include "xrEngine/LightAnimLibrary.h" #include "UIInventoryUtilities.h" #include "UIHelper.h" #include "UIMotionIcon.h" - #include "UIXmlInit.h" #include "UIPdaMsgListItem.h" #include "UIPdaWnd.h" -#include "../alife_registry_wrappers.h" - -#include "../string_table.h" - +#include "alife_registry_wrappers.h" +#include "string_table.h" #ifdef DEBUG -# include "../attachable_item.h" -# include "../../xrEngine/xr_input.h" +#include "attachable_item.h" +#include "xrEngine/xr_input.h" #endif - #include "UIScrollView.h" #include "map_hint.h" -#include "../game_news.h" - +#include "game_news.h" #include "static_cast_checked.hpp" #include "game_cl_capture_the_artefact.h" #include "UIHudStatesWnd.h" @@ -57,7 +47,7 @@ void test_draw (); void test_key (int dik); -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" using namespace InventoryUtilities; diff --git a/src/xrGame/ui/UIMainIngameWnd.h b/src/xrGame/ui/UIMainIngameWnd.h index 394626695c3..5e4f85886bb 100644 --- a/src/xrGame/ui/UIMainIngameWnd.h +++ b/src/xrGame/ui/UIMainIngameWnd.h @@ -1,9 +1,8 @@ #pragma once #include "UIGameLog.h" - -#include "../hudsound.h" -#include "../../xrServerEntities/alife_space.h" -#include "../EntityCondition.h" +#include "hudsound.h" +#include "xrServerEntities/alife_space.h" +#include "EntityCondition.h" class CUIPdaMsgListItem; class CLAItem; diff --git a/src/xrGame/ui/UIMap.cpp b/src/xrGame/ui/UIMap.cpp index 7185a4aa13c..d21c058b4cd 100644 --- a/src/xrGame/ui/UIMap.cpp +++ b/src/xrGame/ui/UIMap.cpp @@ -1,11 +1,11 @@ #include "stdafx.h" -#include "../level.h" -#include "../map_location.h" -#include "../map_manager.h" -#include "../map_spot.h" +#include "Level.h" +#include "map_location.h" +#include "map_manager.h" +#include "map_spot.h" #include "UIMap.h" #include "UIMapWnd.h" -#include "../../xrEngine/xr_input.h" //remove me !!! +#include "xrEngine/xr_input.h" //remove me !!! const u32 activeLocalMapColor = 0xffffffff;//0xffc80000; const u32 inactiveLocalMapColor = 0xffffffff;//0xff438cd1; diff --git a/src/xrGame/ui/UIMapDesc.cpp b/src/xrGame/ui/UIMapDesc.cpp index 4bca8fcddee..86fb78f773a 100644 --- a/src/xrGame/ui/UIMapDesc.cpp +++ b/src/xrGame/ui/UIMapDesc.cpp @@ -1,5 +1,4 @@ #include "stdafx.h" - #include "UIMapDesc.h" #include "UIStatic.h" #include "UICursor.h" @@ -7,12 +6,11 @@ #include "UIXmlInit.h" #include "UI3tButton.h" #include "UIGameCustom.h" -#include "../level.h" -#include "../game_cl_teamdeathmatch.h" +#include "Level.h" +#include "game_cl_teamdeathmatch.h" #include "UIMapInfo.h" -#include "../xr_level_controller.h" +#include "xr_level_controller.h" #include - #include "UIStatsPlayerList.h" CUIMapDesc::CUIMapDesc(){ diff --git a/src/xrGame/ui/UIMapInfo.cpp b/src/xrGame/ui/UIMapInfo.cpp index 8eabad94dec..3ddace788cd 100644 --- a/src/xrGame/ui/UIMapInfo.cpp +++ b/src/xrGame/ui/UIMapInfo.cpp @@ -3,7 +3,7 @@ #include "UIScrollView.h" #include "UIXmlInit.h" #include "UIStatic.h" -#include "../string_table.h" +#include "string_table.h" CUIMapInfo::CUIMapInfo(){ m_view = xr_new(); diff --git a/src/xrGame/ui/UIMapInfo.h b/src/xrGame/ui/UIMapInfo.h index 15f62d1e801..0ea29b296c9 100644 --- a/src/xrGame/ui/UIMapInfo.h +++ b/src/xrGame/ui/UIMapInfo.h @@ -1,7 +1,7 @@ #pragma once #include "UIWindow.h" -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" class CUIScrollView; diff --git a/src/xrGame/ui/UIMapLegend.cpp b/src/xrGame/ui/UIMapLegend.cpp index 65e04dc0844..ef0fc83a4b6 100644 --- a/src/xrGame/ui/UIMapLegend.cpp +++ b/src/xrGame/ui/UIMapLegend.cpp @@ -21,8 +21,8 @@ #include "UIHint.h" #include "UIInventoryUtilities.h" -#include "../string_table.h" -#include "../level.h" +#include "string_table.h" +#include "Level.h" UIMapLegend::UIMapLegend() diff --git a/src/xrGame/ui/UIMapList.cpp b/src/xrGame/ui/UIMapList.cpp index 36fa1b18c67..b7f96e5a982 100644 --- a/src/xrGame/ui/UIMapList.cpp +++ b/src/xrGame/ui/UIMapList.cpp @@ -9,12 +9,10 @@ #include "UIMapInfo.h" #include "UIComboBox.h" #include "UIListBoxItem.h" -#include "../../xrEngine/xr_ioconsole.h" -#include "../string_table.h" - +#include "xrEngine/xr_ioconsole.h" +#include "string_table.h" #include "object_broker.h" #include "game_base.h" - #include "ui/UICDkey.h" extern ENGINE_API string512 g_sLaunchOnExit_app; @@ -243,7 +241,7 @@ const char* CUIMapList::GetCommandLine(LPCSTR player_name){ return m_command.c_str(); } -#include "../UIGameCustom.h" +#include "UIGameCustom.h" void CUIMapList::LoadMapList() { const auto& weathers = gMapListHelper.GetGameWeathers(); diff --git a/src/xrGame/ui/UIMapList.h b/src/xrGame/ui/UIMapList.h index 1c38b8037c3..d1e19d550e0 100644 --- a/src/xrGame/ui/UIMapList.h +++ b/src/xrGame/ui/UIMapList.h @@ -1,8 +1,7 @@ #pragma once - #include "UIWindow.h" #include "gametype_chooser.h" -#include "..\uiGameCustom.h" +#include "uiGameCustom.h" class CUIListBox; class CUIListBoxItem; diff --git a/src/xrGame/ui/UIMapWnd.cpp b/src/xrGame/ui/UIMapWnd.cpp index e9b559a72b0..69197e776ad 100644 --- a/src/xrGame/ui/UIMapWnd.cpp +++ b/src/xrGame/ui/UIMapWnd.cpp @@ -2,13 +2,11 @@ #include "UIMapWnd.h" #include "UIMap.h" #include "UIXmlInit.h" - -#include "../Actor.h" -#include "../map_manager.h" +#include "Actor.h" +#include "map_manager.h" #include "UIInventoryUtilities.h" -#include "../map_spot.h" -#include "../map_location.h" - +#include "map_spot.h" +#include "map_location.h" #include "UIFixedScrollBar.h" #include "UIFrameWindow.h" #include "UIFrameLineWnd.h" @@ -19,8 +17,7 @@ #include "UIHint.h" #include "map_hint.h" #include "uicursor.h" - -#include "../../xrEngine/xr_input.h" //remove me !!! +#include "xrEngine/xr_input.h" //remove me !!! CUIMapWnd* g_map_wnd = NULL; // quick temporary solution -( CUIMapWnd* GetMapWnd() @@ -690,10 +687,10 @@ void CUIMapWnd::Reset() ResetActionPlanner (); } -#include "../gametaskmanager.h" -#include "../actor.h" -#include "../map_spot.h" -#include "../gametask.h" +#include "GametaskManager.h" +#include "Actor.h" +#include "map_spot.h" +#include "GameTask.h" void CUIMapWnd::SpotSelected( CUIWindow* w ) { diff --git a/src/xrGame/ui/UIMapWnd2.cpp b/src/xrGame/ui/UIMapWnd2.cpp index 33ade703e26..78992c2d99d 100644 --- a/src/xrGame/ui/UIMapWnd2.cpp +++ b/src/xrGame/ui/UIMapWnd2.cpp @@ -2,7 +2,6 @@ #include "UIMapWnd.h" #include "UIMap.h" #include "UIXmlInit.h" - #include "UI3tButton.h" #include "UIHelper.h" #include "UITaskWnd.h" diff --git a/src/xrGame/ui/UIMapWndActions.h b/src/xrGame/ui/UIMapWndActions.h index 42c3b9ac33e..e4902e9898d 100644 --- a/src/xrGame/ui/UIMapWndActions.h +++ b/src/xrGame/ui/UIMapWndActions.h @@ -1,12 +1,11 @@ #pragma once -#include "../action_planner.h" -#include "../property_evaluator_const.h" +#include "action_planner.h" +#include "property_evaluator_const.h" class CUIMapWnd; class CUICustomMap; class CUILevelMap; - class CMapActionPlanner :public CActionPlanner { private: typedef CActionPlanner inherited; diff --git a/src/xrGame/ui/UIMessageBox.cpp b/src/xrGame/ui/UIMessageBox.cpp index 6e407b8bea9..c5e61764217 100644 --- a/src/xrGame/ui/UIMessageBox.cpp +++ b/src/xrGame/ui/UIMessageBox.cpp @@ -3,7 +3,7 @@ #include "UIXmlInit.h" #include "UI3tButton.h" #include "UIEditBox.h" -#include "../string_table.h" +#include "string_table.h" CUIMessageBox::CUIMessageBox() { diff --git a/src/xrGame/ui/UIMessageBox.h b/src/xrGame/ui/UIMessageBox.h index eef5ba611ce..109d7c1af17 100644 --- a/src/xrGame/ui/UIMessageBox.h +++ b/src/xrGame/ui/UIMessageBox.h @@ -2,7 +2,7 @@ #include "UIStatic.h" -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" class CUI3tButton; class CUIEditBox; diff --git a/src/xrGame/ui/UIMessageBoxEx.cpp b/src/xrGame/ui/UIMessageBoxEx.cpp index a7617651d34..037e61982d6 100644 --- a/src/xrGame/ui/UIMessageBoxEx.cpp +++ b/src/xrGame/ui/UIMessageBoxEx.cpp @@ -1,8 +1,7 @@ #include "stdafx.h" - #include "UIMessageBox.h" #include "UIMessageBoxEx.h" -#include "../UIDialogHolder.h" +#include "UIDialogHolder.h" #include CUIMessageBoxEx::CUIMessageBoxEx(){ diff --git a/src/xrGame/ui/UIMessagesWindow.cpp b/src/xrGame/ui/UIMessagesWindow.cpp index 5c011445853..6cb9db2a294 100644 --- a/src/xrGame/ui/UIMessagesWindow.cpp +++ b/src/xrGame/ui/UIMessagesWindow.cpp @@ -14,7 +14,7 @@ bool IsGameTypeSingle(); #include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "UIInventoryUtilities.h" -#include "../game_news.h" +#include "game_news.h" #include "UIPdaMsgListItem.h" CUIMessagesWindow::CUIMessagesWindow() diff --git a/src/xrGame/ui/UIMpItemsStoreWnd.h b/src/xrGame/ui/UIMpItemsStoreWnd.h index df5b83c50b1..b93a5edffbb 100644 --- a/src/xrGame/ui/UIMpItemsStoreWnd.h +++ b/src/xrGame/ui/UIMpItemsStoreWnd.h @@ -1,5 +1,5 @@ #pragma once -#include "../../xrServerEntities/object_interfaces.h" +#include "xrServerEntities/object_interfaces.h" #include "UIBuyWndShared.h" class CUIXml; diff --git a/src/xrGame/ui/UIMpTradeWnd.cpp b/src/xrGame/ui/UIMpTradeWnd.cpp index ea77dc43a40..26d4bf581a6 100644 --- a/src/xrGame/ui/UIMpTradeWnd.cpp +++ b/src/xrGame/ui/UIMpTradeWnd.cpp @@ -1,15 +1,12 @@ #include "stdafx.h" #include "UIMpTradeWnd.h" - #include "UIMpItemsStoreWnd.h" #include "UITabButtonMP.h" #include "UITabControl.h" #include "UIDragDropListEx.h" #include "UICellItem.h" - -#include "../UIDialogHolder.h" -#include "../game_cl_deathmatch.h" - +#include "UIDialogHolder.h" +#include "game_cl_deathmatch.h" void CUIMpTradeWnd::OnBtnOkClicked(CUIWindow* w, void* d) { @@ -49,7 +46,7 @@ void CUIMpTradeWnd::TryUsePreset(ETradePreset idx) ApplyPreset (idx); } -#include "../../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" void CUIMpTradeWnd::OnBtnPreset1Clicked(CUIWindow* w, void* d) { CheckDragItemToDestroy (); @@ -216,7 +213,7 @@ void CUIMpTradeWnd::FillUpSubLevelItems() } } -#include "../actor.h" +#include "Actor.h" void CUIMpTradeWnd::Show(bool status) { inherited::Show (status); diff --git a/src/xrGame/ui/UIMpTradeWnd_items.cpp b/src/xrGame/ui/UIMpTradeWnd_items.cpp index b273d8488be..269f3202b30 100644 --- a/src/xrGame/ui/UIMpTradeWnd_items.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_items.cpp @@ -1,15 +1,14 @@ #include "stdafx.h" #include "UIMpTradeWnd.h" -#include "../inventory_item.h" -#include "../PhysicsShellHolder.h" +#include "inventory_item.h" +#include "PhysicsShellHolder.h" #include "object_broker.h" #include "UICellItem.h" #include "UIDragDropListEx.h" -#include "../string_table.h" +#include "string_table.h" #include "UIMpItemsStoreWnd.h" - -#include "../Weapon.h" -#include "../WeaponMagazinedWGrenade.h" +#include "Weapon.h" +#include "WeaponMagazinedWGrenade.h" #include "UICellCustomItems.h" extern "C" diff --git a/src/xrGame/ui/UIMpTradeWnd_misc.cpp b/src/xrGame/ui/UIMpTradeWnd_misc.cpp index 2781ba3e4ed..95356a1d347 100644 --- a/src/xrGame/ui/UIMpTradeWnd_misc.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_misc.cpp @@ -1,18 +1,15 @@ #include "stdafx.h" #include "UIMpTradeWnd.h" #include "UIMpItemsStoreWnd.h" - #include "UICellItem.h" #include "UITabControl.h" #include "UIDragDropListEx.h" #include "UIItemInfo.h" #include "UI3tButton.h" - -#include "../inventory_item.h" -#include "../PhysicsShellHolder.h" +#include "inventory_item.h" +#include "PhysicsShellHolder.h" #include "object_broker.h" #include - #include "UICellCustomItems.h" bool CUIMpTradeWnd::OnKeyboardAction(int dik, EUIMessages keyboard_action) diff --git a/src/xrGame/ui/UIMpTradeWnd_trade.cpp b/src/xrGame/ui/UIMpTradeWnd_trade.cpp index 279d49bf848..521c42666c0 100644 --- a/src/xrGame/ui/UIMpTradeWnd_trade.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_trade.cpp @@ -197,7 +197,7 @@ bool CUIMpTradeWnd::TryToBuyItem(SBuyItemInfo* buy_itm, u32 buy_flags, SBuyItemI } return true; } -#include "../string_table.h" +#include "string_table.h" bool CUIMpTradeWnd::CheckBuyPossibility(const shared_str& sect_name, u32 buy_flags, bool b_silent) { string256 info_buffer; diff --git a/src/xrGame/ui/UIMpTradeWnd_wpn.cpp b/src/xrGame/ui/UIMpTradeWnd_wpn.cpp index 2a7f6375d07..7505365ff31 100644 --- a/src/xrGame/ui/UIMpTradeWnd_wpn.cpp +++ b/src/xrGame/ui/UIMpTradeWnd_wpn.cpp @@ -2,8 +2,8 @@ #include "UIMpTradeWnd.h" #include "UIDragDropListEx.h" #include "UICellItem.h" -#include "../weaponmagazinedwgrenade.h" -#include "../../xrEngine/xr_input.h" +#include "WeaponMagazinedWGrenade.h" +#include "xrEngine/xr_input.h" #include "UIMpItemsStoreWnd.h" void CUIMpTradeWnd::OnBtnPistolAmmoClicked(CUIWindow* w, void* d) diff --git a/src/xrGame/ui/UIMultiTextStatic.cpp b/src/xrGame/ui/UIMultiTextStatic.cpp deleted file mode 100644 index c734285b6ee..00000000000 --- a/src/xrGame/ui/UIMultiTextStatic.cpp +++ /dev/null @@ -1,197 +0,0 @@ -//============================================================================= -// Filename: UIMultiTextStatic.cpp -// Created by Roman E. Marchenko, vortex@gsc-game.kiev.ua -// Copyright 2004. GSC Game World -// --------------------------------------------------------------------------- -// Ñòàòèê êîíòðîë íà êîòîðîì ìîæíî âûâîäèòü ìíîæåñòâî íàäïèñåé ðàçëè÷íûìè -// øðèôòàìè, öâåòàìè è äàæå ñ àíèìàöèåé -//============================================================================= - -#include "stdafx.h" -#include "UIMultiTextStatic.h" -#include "../../xrEngine/CustomHUD.h" - -////////////////////////////////////////////////////////////////////////// -CUIMultiTextStatic::CUIMultiTextStatic () -{ - m_vPhrases.clear(); -}; - -CUIMultiTextStatic::~CUIMultiTextStatic () -{ -} - -CUIMultiTextStatic::SinglePhrase * CUIMultiTextStatic::AddPhrase() -{ - m_vPhrases.resize(m_vPhrases.size() + 1); - return &m_vPhrases.back(); -} - -void CUIMultiTextStatic::RemovePhraseByIndex(u32 idx) -{ - Phrases_it it = m_vPhrases.begin(); - std::advance(it, idx); - m_vPhrases.erase(it); -} - -////////////////////////////////////////////////////////////////////////// - -void CUIMultiTextStatic::Draw() -{ - Fvector2 p; - GetAbsolutePos (p); - - for (Phrases_it it = m_vPhrases.begin(); it != m_vPhrases.end(); ++it) - { - it->effect.Out(it->outX + p.x, it->outY + p.y, *it->str); - } - - inherited::Draw(); -} - -////////////////////////////////////////////////////////////////////////// - -void CUIMultiTextStatic::Update() -{ - for (Phrases_it it = m_vPhrases.begin(); it != m_vPhrases.end(); ++it) - { - it->effect.Update(); - } - - inherited::Update(); -} - -////////////////////////////////////////////////////////////////////////// - -CUIMultiTextStatic::SinglePhrase * CUIMultiTextStatic::GetPhraseByIndex(u32 idx) -{ - R_ASSERT(idx < m_vPhrases.size()); - - return &m_vPhrases[idx]; -} - - - -////////////////////////////////////////////////////////////////////////// - -//-----------------------------------------------------------------------------/ -// SinglePhrase struct -//-----------------------------------------------------------------------------/ - -////////////////////////////////////////////////////////////////////////// - -CUIMultiTextStatic::SPh::SPh() - :maxWidth (-1.0f) -{ - effect.SetStyleParams(CUITextBanner::tbsNone); - effect.StopAnimation(); -} - -////////////////////////////////////////////////////////////////////////// - -void CUIMultiTextStatic::SPh::SetText(const char *fmt, ...) -{ - va_list Print; - string512 msg; - xr_string buf; - - va_start( Print , fmt ); - vsprintf_s( msg , fmt , Print ); - va_end( Print ); - - buf += msg; - msg[0] = '\n'; - - str = buf.c_str(); - - /*if (maxWidth > 0 && elipsisPos != CUIStatic::eepNone) - { - STRING s; - CUIStatic::SetText(*str, s); - - Frect r; - r.left = 0; - r.right = maxWidth; - r.top = 0; - r.bottom = 0; - - CUIStatic::Elipsis(s, r, elipsisPos, effect.GetFont()); - - str = &s.front(); - }*/ -} - -#include "../string_table.h" - -void CUICaption::addCustomMessage(const shared_str& msg_name, float x, float y, float font_size, - CGameFont *pFont, CGameFont::EAligment al, u32 color, LPCSTR def_str) -{ -// R_ASSERT2( (m_indices.find(msg_name) == m_indices.end()),"message already defined !!!" ); - R_ASSERT2( u32(-1)==findIndexOf_(msg_name),"message already defined !!!" ); - - SinglePhrase * sp = AddPhrase(); - sp->outX = x; - sp->outY = y; - sp->effect.SetFontSize(font_size); - sp->effect.SetFont(pFont); - sp->effect.SetTextColor(color); - sp->effect.SetFontAlignment(al); - - sp->str = *CStringTable().translate(def_str); - sp->key = msg_name; - -// m_indices[msg_name] = m_vPhrases.size()-1; - -} - -u32 CUICaption::findIndexOf_(const shared_str& key_) -{ - for (Phrases_it it = m_vPhrases.begin(); it != m_vPhrases.end(); ++it) - { - if((*it).key==key_) return (u32)std::distance(m_vPhrases.begin(),it); - } - return u32(-1); -} - -u32 CUICaption::findIndexOf(const shared_str& key_) -{ - u32 res = findIndexOf_(key_); - R_ASSERT3(res!=u32(-1),"cannot find msg ",*key_); - return res; -} - -void CUICaption::removeCustomMessage(const shared_str& msg_name) -{ -// R_ASSERT2( (m_indices.find(msg_name) != m_indices.end()),"message not defined !!!" ); - RemovePhraseByIndex(findIndexOf(msg_name)); -// m_indices.erase(msg_name); -} - -EffectParams* CUICaption::customizeMessage(const shared_str& msg_name, const CUITextBanner::TextBannerStyles styleName) -{ -// R_ASSERT2( (m_indices.find(msg_name) != m_indices.end()),"message not defined !!!" ); - - SinglePhrase * sp = GetPhraseByIndex( findIndexOf(msg_name) ); - sp->effect.PlayAnimation(); - return sp->effect.SetStyleParams(styleName); - -} - -void CUICaption::setCaption(const shared_str& msg_name, LPCSTR message_to_out, u32 color, bool replaceColor) -{ -// R_ASSERT2( (m_indices.find(msg_name) != m_indices.end()),"message not defined !!!" ); - SinglePhrase * sp = GetPhraseByIndex(findIndexOf(msg_name)); - sp->str = *CStringTable().translate(message_to_out); - - if(replaceColor) - sp->effect.SetTextColor(color); -} - -void CUICaption::Draw() -{ - if (psHUD_Flags.is(HUD_DRAW|HUD_DRAW_RT)) - { - inherited::Draw(); - inherited::Update(); - } -} diff --git a/src/xrGame/ui/UIMultiTextStatic.h b/src/xrGame/ui/UIMultiTextStatic.h deleted file mode 100644 index 1a253cd1639..00000000000 --- a/src/xrGame/ui/UIMultiTextStatic.h +++ /dev/null @@ -1,68 +0,0 @@ -//============================================================================= -// Filename: UIMultiTextStatic.cpp -// Created by Roman E. Marchenko, vortex@gsc-game.kiev.ua -// Copyright 2004. GSC Game World -// --------------------------------------------------------------------------- -// Ñòàòèê êîíòðîë íà êîòîðîì ìîæíî âûâîäèòü ìíîæåñòâî íàäïèñåé ðàçëè÷íûìè -// øðèôòàìè, öâåòàìè è äàæå ñ àíèìàöèåé -//============================================================================= - -#ifndef UI_MULTITEXT_STATIC_H_ -#define UI_MULTITEXT_STATIC_H_ - -#pragma once - -#include "UITextBanner.h" - -class CUIMultiTextStatic: public CUIStatic -{ - typedef CUIStatic inherited; -public: - typedef struct SPh - { - float outX; - float outY; - float maxWidth; - CUITextBanner effect; - shared_str str; - - void SetText (const char *fmt, ...); - - // Ctor - SPh (); - shared_str key; - } SinglePhrase; - - typedef xr_vector Phrases; - typedef Phrases::iterator Phrases_it; -protected: - Phrases m_vPhrases; -public: - - CUIMultiTextStatic (); - virtual ~CUIMultiTextStatic (); - - virtual void Draw(); - virtual void Update(); - // Äîáàâèòü íàäïèñü - // Return: Óêàçàòåëü íà äîáàâëåííóþ çàïèñü - SinglePhrase * AddPhrase(); - // Ïîëó÷èòü çàïèñü ïî íîìåðó - SinglePhrase * GetPhraseByIndex(u32 idx); - void RemovePhraseByIndex(u32 idx); -}; - -class CUICaption :protected CUIMultiTextStatic -{ - typedef CUIMultiTextStatic inherited; - - u32 findIndexOf(const shared_str& key); - u32 findIndexOf_(const shared_str& key); -public: - virtual void Draw(); - void addCustomMessage(const shared_str& msg_name, float x, float y, float font_size, CGameFont *pFont, CGameFont::EAligment al, u32 color, LPCSTR def_str=""); - EffectParams* customizeMessage(const shared_str& msg_name, const CUITextBanner::TextBannerStyles styleName); - void setCaption(const shared_str& msg_name, LPCSTR message_to_out, u32 color=0, bool replaceColor=false); - void removeCustomMessage(const shared_str& msg_name); -}; -#endif //UI_MULTITEXT_STATIC_H_ \ No newline at end of file diff --git a/src/xrGame/ui/UINewsItemWnd.cpp b/src/xrGame/ui/UINewsItemWnd.cpp index a989531975a..e5ba1064705 100644 --- a/src/xrGame/ui/UINewsItemWnd.cpp +++ b/src/xrGame/ui/UINewsItemWnd.cpp @@ -2,8 +2,8 @@ #include "UINewsItemWnd.h" #include "UIXmlInit.h" #include "UIStatic.h" -#include "../game_news.h" -#include "../date_time.h" +#include "game_news.h" +#include "date_time.h" #include "UIInventoryUtilities.h" #include "UIHelper.h" diff --git a/src/xrGame/ui/UINewsItemWnd.h b/src/xrGame/ui/UINewsItemWnd.h index 318248093b6..4ce958ac0be 100644 --- a/src/xrGame/ui/UINewsItemWnd.h +++ b/src/xrGame/ui/UINewsItemWnd.h @@ -1,7 +1,7 @@ #pragma once - #include "UIWindow.h" #include "xrUIXmlParser.h" + class CUIStatic; class CUITextWnd; struct GAME_NEWS_DATA; diff --git a/src/xrGame/ui/UINewsWnd.cpp b/src/xrGame/ui/UINewsWnd.cpp deleted file mode 100644 index 34d91b437aa..00000000000 --- a/src/xrGame/ui/UINewsWnd.cpp +++ /dev/null @@ -1,109 +0,0 @@ -#include "stdafx.h" - -#include "UINewsWnd.h" -/* -#include "xrUIXmlParser.h" -#include "UIXmlInit.h" -#include "../UI.h" -#include "../HUDManager.h" -#include "../level.h" -#include "../game_news.h" -#include "../actor.h" -#include "../alife_registry_wrappers.h" -#include "UIInventoryUtilities.h" -#include "UINewsItemWnd.h" -#include "UIScrollView.h" - -#define NEWS_XML "news.xml" - -#define NEWS_TO_SHOW 50 - -CUINewsWnd::CUINewsWnd() -{} - -CUINewsWnd::~CUINewsWnd() -{} - -void CUINewsWnd::Init(LPCSTR xml_name, LPCSTR start_from) -{ - string512 pth; - - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH, xml_name); - CUIXmlInit xml_init; - - strconcat (sizeof(pth),pth,start_from,"list"); - xml_init.InitWindow (uiXml, pth, 0, this); - UIScrollWnd = xr_new();UIScrollWnd->SetAutoDelete(true); - AttachChild (UIScrollWnd); - xml_init.InitScrollView (uiXml, pth, 0, UIScrollWnd); -} - -void CUINewsWnd::Init() -{ - Init (NEWS_XML,""); -} - -void CUINewsWnd::LoadNews() -{ - UIScrollWnd->Clear(); - - if (Actor()) - { - GAME_NEWS_VECTOR& news_vector = Actor()->game_news_registry->registry().objects(); - - // Ïîêàçàòü òîëüêî NEWS_TO_SHOW ïîñëåäíèõ íüþñîâ - int currentNews = 0; - - for (GAME_NEWS_VECTOR::reverse_iterator it = news_vector.rbegin(); it != news_vector.rend() && currentNews < NEWS_TO_SHOW ; ++it) - { - AddNewsItem(*it); - ++currentNews; - } - } - m_flags.set(eNeedAdd,FALSE); -} - -void CUINewsWnd::Update() -{ - inherited::Update (); - if(m_flags.test(eNeedAdd)) - LoadNews (); -} - -void CUINewsWnd::AddNews() -{ - m_flags.set(eNeedAdd,TRUE); -} - -void CUINewsWnd::AddNewsItem(GAME_NEWS_DATA& news_data) -{ - CUIWindow* itm = NULL; - switch(news_data.m_type){ - case GAME_NEWS_DATA::eNews:{ - CUINewsItemWnd* _itm = xr_new(); - _itm->Init (NEWS_XML,"news_item"); - _itm->Setup (news_data); - itm = _itm; - }break; - case GAME_NEWS_DATA::eTalk:{ - CUINewsItemWnd* _itm = xr_new(); - _itm->Init (NEWS_XML,"talk_item"); - _itm->Setup (news_data); - itm = _itm; - }break; - }; - UIScrollWnd->AddWindow (itm, true); -} - - -void CUINewsWnd::Show(bool status) -{ - if (status) - LoadNews(); - else - InventoryUtilities::SendInfoToActor("ui_pda_news_hide"); - inherited::Show(status); - -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UINewsWnd.h b/src/xrGame/ui/UINewsWnd.h deleted file mode 100644 index 5f74b6696b9..00000000000 --- a/src/xrGame/ui/UINewsWnd.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include "UIWindow.h" -/* -class CUIScrollView; -struct GAME_NEWS_DATA; - -class CUINewsWnd: public CUIWindow -{ - typedef CUIWindow inherited; - enum eFlag{eNeedAdd=(1<<0),}; - Flags16 m_flags; -public: - CUINewsWnd (); - virtual ~CUINewsWnd (); - - void Init (); - void Init (LPCSTR xml_name, LPCSTR start_from); - void AddNews (); - virtual void Show (bool status); - virtual void Update (); - - CUIScrollView* UIScrollWnd; - - -private: - void LoadNews (); - void AddNewsItem (GAME_NEWS_DATA& news_data); -}; -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIOptConCom.cpp b/src/xrGame/ui/UIOptConCom.cpp index 61fee5411b0..aa7881bbcde 100644 --- a/src/xrGame/ui/UIOptConCom.cpp +++ b/src/xrGame/ui/UIOptConCom.cpp @@ -1,15 +1,12 @@ #include "StdAfx.h" -#include "../../xrEngine/xr_ioconsole.h" -#include "../../xrEngine/xr_ioc_cmd.h" +#include "xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioc_cmd.h" #include "UIOptConCom.h" -#include "../../xrcore/xrCore.h" -//#include "game_base_space.h" +#include "xrCore/xrCore.h" #include "gametype_chooser.h" -#include "../RegistryFuncs.h" -#include "../../xrGameSpy/xrGameSpy_MainDefs.h" - +#include "RegistryFuncs.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" #include "gamespy/GameSpy_GP.h" - #include "ui/UICDkey.h" xr_token g_GameModes [] = { diff --git a/src/xrGame/ui/UIOptionsItem.cpp b/src/xrGame/ui/UIOptionsItem.cpp index 41612b06727..fbb6f19a7be 100644 --- a/src/xrGame/ui/UIOptionsItem.cpp +++ b/src/xrGame/ui/UIOptionsItem.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "UIOptionsItem.h" #include "UIOptionsManager.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" CUIOptionsManager CUIOptionsItem::m_optionsManager; diff --git a/src/xrGame/ui/UIOptionsManager.cpp b/src/xrGame/ui/UIOptionsManager.cpp index 94cd3020cff..e11f6d35190 100644 --- a/src/xrGame/ui/UIOptionsManager.cpp +++ b/src/xrGame/ui/UIOptionsManager.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "UIOptionsManager.h" #include "UIOptionsItem.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" CUIOptionsManager::CUIOptionsManager() :m_restart_flags(0) diff --git a/src/xrGame/ui/UIOptionsManagerScript.h b/src/xrGame/ui/UIOptionsManagerScript.h index e4f290b60af..62d09dd74ea 100644 --- a/src/xrGame/ui/UIOptionsManagerScript.h +++ b/src/xrGame/ui/UIOptionsManagerScript.h @@ -1,6 +1,6 @@ #pragma once -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" class CUIOptionsManagerScript { diff --git a/src/xrGame/ui/UIOutfitInfo.cpp b/src/xrGame/ui/UIOutfitInfo.cpp index 9897d741bfe..c87b24d3feb 100644 --- a/src/xrGame/ui/UIOutfitInfo.cpp +++ b/src/xrGame/ui/UIOutfitInfo.cpp @@ -3,14 +3,12 @@ #include "UIXmlInit.h" #include "UIStatic.h" #include "UIDoubleProgressBar.h" - -#include "..\CustomOutfit.h" -#include "..\ActorHelmet.h" -#include "..\string_table.h" -#include "..\actor.h" -#include "..\ActorCondition.h" -#include "..\player_hud.h" - +#include "CustomOutfit.h" +#include "ActorHelmet.h" +#include "string_table.h" +#include "actor.h" +#include "ActorCondition.h" +#include "player_hud.h" LPCSTR immunity_names[]= { diff --git a/src/xrGame/ui/UIOutfitInfo.h b/src/xrGame/ui/UIOutfitInfo.h index 3482f517165..7fa03f8f681 100644 --- a/src/xrGame/ui/UIOutfitInfo.h +++ b/src/xrGame/ui/UIOutfitInfo.h @@ -1,8 +1,7 @@ #pragma once - #include "UIWindow.h" #include "UIDoubleProgressBar.h" -#include "..\..\xrServerEntities\alife_space.h" +#include "xrServerEntities/alife_space.h" class CCustomOutfit; class CHelmet; diff --git a/src/xrGame/ui/UIOutfitInfo2.cpp b/src/xrGame/ui/UIOutfitInfo2.cpp deleted file mode 100644 index c33667a617a..00000000000 --- a/src/xrGame/ui/UIOutfitInfo2.cpp +++ /dev/null @@ -1,124 +0,0 @@ -#include "StdAfx.h" -#include "UIOutfitInfo2.h" -/* -#include "UIXmlInit.h" -#include "UIStatic.h" -#include "UIScrollView.h" -#include "../actor.h" -#include "../CustomOutfit.h" -#include "../string_table.h" - -CUIOutfitInfo2::CUIOutfitInfo2() -{ - Memory.mem_fill (m_items, 0, sizeof(m_items)); -} - -CUIOutfitInfo2::~CUIOutfitInfo2() -{ - for(u32 i=_item_start; i<_max_item_index; ++i) - { - CUIStatic* _s = m_items[i]; - xr_delete (_s); - } -} - -LPCSTR _imm_names []={ - "burn_immunity", - "strike_immunity", - "shock_immunity", - "wound_immunity", - "radiation_immunity", - "telepatic_immunity", - "chemical_burn_immunity", - "explosion_immunity", - "fire_wound_immunity", -}; - -LPCSTR _imm_st_names[]={ - "ui_inv_outfit_burn_protection", - "ui_inv_outfit_shock_protection", - "ui_inv_outfit_strike_protection", - "ui_inv_outfit_wound_protection", - "ui_inv_outfit_radiation_protection", - "ui_inv_outfit_telepatic_protection", - "ui_inv_outfit_chemical_burn_protection", - "ui_inv_outfit_explosion_protection", - "ui_inv_outfit_fire_wound_protection", -}; - -void CUIOutfitInfo2::InitFromXml(CUIXml& xml_doc) -{ - LPCSTR _base = "outfit_info"; - - string256 _buff; - CUIXmlInit::InitWindow (xml_doc, _base, 0, this); - - m_listWnd = xr_new(); m_listWnd->SetAutoDelete(true); - AttachChild (m_listWnd); - strconcat (sizeof(_buff),_buff, _base, ":scroll_view"); - CUIXmlInit::InitScrollView (xml_doc, _buff, 0, m_listWnd); - - for(u32 i=ALife::eHitTypeBurn; i<= ALife::eHitTypeFireWound; ++i) - { - m_items[i] = xr_new(); - CUIStatic* _s = m_items[i]; - _s->SetAutoDelete (false); - strconcat (sizeof(_buff),_buff, _base, ":static_", _imm_names[i]); - CUIXmlInit::InitStatic (xml_doc, _buff, 0, _s); - } - -} - -void CUIOutfitInfo2::Update(CCustomOutfit* outfit) -{ - m_outfit = outfit; - - SetItem(ALife::eHitTypeBurn, false); - SetItem(ALife::eHitTypeShock, false); - SetItem(ALife::eHitTypeStrike, false); - SetItem(ALife::eHitTypeWound, false); - SetItem(ALife::eHitTypeRadiation, false); - SetItem(ALife::eHitTypeTelepatic, false); - SetItem(ALife::eHitTypeChemicalBurn,false); - SetItem(ALife::eHitTypeExplosion, false); - SetItem(ALife::eHitTypeFireWound, false); -} - -void CUIOutfitInfo2::SetItem(u32 hitType, bool force_add) -{ - string128 _buff; - float _val_outfit = 0.0f; - float _val_af = 0.0f; - - CUIStatic* _s = m_items[hitType]; - - _val_outfit = m_outfit ? m_outfit->GetDefHitTypeProtection(ALife::EHitType(hitType)) : 1.0f; - _val_outfit = 1.0f - _val_outfit; - - - _val_af = smart_cast(Level().CurrentControlEntity())->HitArtefactsOnBelt(1.0f,ALife::EHitType(hitType)); - _val_af = 1.0f - _val_af; - - if(fsimilar(_val_outfit, 0.0f) && fsimilar(_val_af, 0.0f) && !force_add) - { - if(_s->GetParent()!=NULL) - m_listWnd->RemoveWindow(_s); - return; - } - -// LPCSTR _clr_outfit, _clr_af; - LPCSTR _imm_name = *CStringTable().translate(_imm_st_names[hitType]); - - int _sz = sprintf_s (_buff,sizeof(_buff),"%s ", _imm_name); - _sz += sprintf_s (_buff+_sz,sizeof(_buff)-_sz,"%s %+3.0f%%", (_val_outfit>0.0f)?"%c[green]":"%c[red]", _val_outfit*100.0f); - - if( !fsimilar(_val_af, 0.0f) ) - { - _sz += sprintf_s (_buff+_sz,sizeof(_buff)-_sz,"%s %+3.0f%%", (_val_af>0.0f)?"%c[green]":"%c[red]", _val_af*100.0f); - } - _s->SetText (_buff); - - if(_s->GetParent()==NULL) - m_listWnd->AddWindow(_s, false); -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIOutfitInfo2.h b/src/xrGame/ui/UIOutfitInfo2.h deleted file mode 100644 index 7f78ae90ca9..00000000000 --- a/src/xrGame/ui/UIOutfitInfo2.h +++ /dev/null @@ -1,42 +0,0 @@ -#error unused file - -#pragma once -/* -#include "UIWindow.h" - -class CUIScrollView; -class CCustomOutfit; -class CUIStatic; -class CUIXml; - -class CUIOutfitInfo2 : public CUIWindow -{ -CCustomOutfit* m_outfit; -public: - CUIOutfitInfo2 (); - virtual ~CUIOutfitInfo2 (); - - void Update (CCustomOutfit* outfit); - void InitFromXml (CUIXml& xml_doc); -protected: - void SetItem (u32 hitType, bool force_add); - - CUIScrollView* m_listWnd; - - enum{ - _item_start = 0, - _item_burn_immunity = _item_start, - _item_strike_immunity, - _item_shock_immunity, - _item_wound_immunity, - _item_radiation_immunity, - _item_telepatic_immunity, - _item_chemical_burn_immunity, - _item_explosion_immunit, - _item_fire_wound_immunity, - - _max_item_index, - }; - CUIStatic* m_items[_max_item_index]; -}; -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UIOutfitSlot.cpp b/src/xrGame/ui/UIOutfitSlot.cpp deleted file mode 100644 index 969b610c1dc..00000000000 --- a/src/xrGame/ui/UIOutfitSlot.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include "stdafx.h" -#include "UIOutfitSlot.h" -#include "UIStatic.h" -#include "UICellItem.h" -#include "../CustomOutfit.h" -#include "../actor.h" -#include "UIInventoryUtilities.h" - -CUIOutfitDragDropList::CUIOutfitDragDropList() -{ - m_background = xr_new(); - m_background->SetAutoDelete (true); - AttachChild (m_background); - m_default_outfit = "npc_icon_without_outfit"; -} - -CUIOutfitDragDropList::~CUIOutfitDragDropList() -{ -} - -#include "../level.h" -#include "game_base_space.h" - -void CUIOutfitDragDropList::SetOutfit(CUICellItem* itm) -{ - m_background->SetWndPos (Fvector2().set(0,0)); - m_background->SetWndSize (Fvector2().set(GetWidth(), GetHeight())); - - m_background->SetStretchTexture (true); - - - if ((!IsGameTypeSingle()) && !itm) - { - CObject *pActor = NULL; - - pActor = smart_cast(Level().CurrentEntity()); - - xr_string a; - if (pActor) - a = *pActor->cNameVisual(); - else - a = *m_default_outfit; - - xr_string::iterator it = std::find(a.rbegin(), a.rend(), '\\').base(); - - // Cut leading full path - if (it != a.begin()) - a.erase(a.begin(), it); - // Cut trailing ".ogf" - R_ASSERT(xr_strlen(a.c_str()) > 4); - if ('.' == a[a.size() - 4]) - a.erase(a.size() - 4); - - m_background->InitTexture(a.c_str()); - } - else { - if(itm) - { - PIItem _iitem = (PIItem)itm->m_pData; - CCustomOutfit* pOutfit = smart_cast(_iitem); VERIFY(pOutfit); - /* - r.lt = pOutfit->GetIconPos(); - r.x1 *= ICON_GRID_WIDTH; - r.y1 *= ICON_GRID_HEIGHT; - */ - m_background->InitTexture (pOutfit->GetFullIconName().c_str()); - }else - { - m_background->InitTexture ("npc_icon_without_outfit"); - } - /* - r.x2 = r.x1+CHAR_ICON_FULL_WIDTH*ICON_GRID_WIDTH; - r.y2 = r.y1+CHAR_ICON_FULL_HEIGHT*ICON_GRID_HEIGHT; - - m_background->SetShader (InventoryUtilities::GetCharIconsShader()); - m_background->SetOriginalRect (r); - */ - } - - m_background->TextureOn (); -// m_background->RescaleRelative2Rect (r); -} - -void CUIOutfitDragDropList::SetDefaultOutfit(LPCSTR default_outfit){ - m_default_outfit = default_outfit; -} - -void CUIOutfitDragDropList::SetItem(CUICellItem* itm) -{ - if(itm) inherited::SetItem (itm); - SetOutfit (itm); -} - -void CUIOutfitDragDropList::SetItem(CUICellItem* itm, Fvector2 abs_pos) -{ - if(itm) inherited::SetItem (itm, abs_pos); - SetOutfit (itm); -} - -void CUIOutfitDragDropList::SetItem(CUICellItem* itm, Ivector2 cell_pos) -{ - if(itm) inherited::SetItem (itm, cell_pos); - SetOutfit (itm); -} - -CUICellItem* CUIOutfitDragDropList::RemoveItem(CUICellItem* itm, bool force_root) -{ - VERIFY (!force_root); - CUICellItem* ci = inherited::RemoveItem(itm, force_root); - SetOutfit (NULL); - return ci; -} - - -void CUIOutfitDragDropList::Draw() -{ - m_background->Draw (); -//. inherited::Draw (); -} \ No newline at end of file diff --git a/src/xrGame/ui/UIOutfitSlot.h b/src/xrGame/ui/UIOutfitSlot.h deleted file mode 100644 index 4f0f4cedef6..00000000000 --- a/src/xrGame/ui/UIOutfitSlot.h +++ /dev/null @@ -1,23 +0,0 @@ -#error unused file - -#pragma once -#include "UIDragDropListEx.h" - -class CUIOutfitDragDropList :public CUIDragDropListEx -{ - typedef CUIDragDropListEx inherited; - CUIStatic* m_background; - shared_str m_default_outfit; - void SetOutfit (CUICellItem* itm); - -public: - CUIOutfitDragDropList (); - virtual ~CUIOutfitDragDropList (); - - virtual void SetItem (CUICellItem* itm); //auto - virtual void SetItem (CUICellItem* itm, Fvector2 abs_pos); // start at cursor pos - virtual void SetItem (CUICellItem* itm, Ivector2 cell_pos); // start at cell - virtual CUICellItem* RemoveItem (CUICellItem* itm, bool force_root); - virtual void Draw (); - void SetDefaultOutfit (LPCSTR default_outfit); -}; diff --git a/src/xrGame/ui/UIPdaContactsWnd.cpp b/src/xrGame/ui/UIPdaContactsWnd.cpp deleted file mode 100644 index 24dec6ac385..00000000000 --- a/src/xrGame/ui/UIPdaContactsWnd.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include "stdafx.h" -#include "UIPdaContactsWnd.h" -#include "../Pda.h" -#include "UIXmlInit.h" -#include "../actor.h" -#include "UIFrameWindow.h" -#include "UIFrameLineWnd.h" -#include "UIAnimatedStatic.h" -#include "UIScrollView.h" -#include "../actor.h" -#include "../string_table.h" - -#define PDA_CONTACT_HEIGHT 70 - -CUIPdaContactsWnd::CUIPdaContactsWnd() -{ - m_flags.zero(); -} - -CUIPdaContactsWnd::~CUIPdaContactsWnd() -{ -} - -void CUIPdaContactsWnd::Show(bool status) -{ - inherited::Show(status); - if(status) UIDetailsWnd->Clear(); - -} - -void CUIPdaContactsWnd::Init() -{ - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH, "pda_contacts_new.xml"); - - CUIXmlInit xml_init; - - xml_init.InitWindow (uiXml, "main_wnd", 0, this); - - UIFrameContacts = xr_new();UIFrameContacts->SetAutoDelete(true); - AttachChild (UIFrameContacts); - xml_init.InitFrameWindow (uiXml, "left_frame_window", 0, UIFrameContacts); - - - UIContactsHeader = xr_new();UIContactsHeader->SetAutoDelete(true); - UIFrameContacts->AttachChild (UIContactsHeader); - xml_init.InitFrameLine (uiXml, "left_frame_line", 0, UIContactsHeader); - - UIRightFrame = xr_new();UIRightFrame->SetAutoDelete(true); - AttachChild (UIRightFrame); - xml_init.InitFrameWindow (uiXml, "right_frame_window", 0, UIRightFrame); - - UIRightFrameHeader = xr_new();UIRightFrameHeader->SetAutoDelete(true); - UIRightFrame->AttachChild (UIRightFrameHeader); - xml_init.InitFrameLine (uiXml, "right_frame_line", 0, UIRightFrameHeader); - - UIAnimation = xr_new();UIAnimation->SetAutoDelete(true); - UIContactsHeader->AttachChild (UIAnimation); - xml_init.InitAnimatedStatic (uiXml, "a_static", 0, UIAnimation); - - UIListWnd = xr_new();UIListWnd->SetAutoDelete(true); - UIFrameContacts->AttachChild (UIListWnd); - xml_init.InitScrollView (uiXml, "list", 0, UIListWnd); - - UIDetailsWnd = xr_new();UIDetailsWnd->SetAutoDelete(true); - UIRightFrame->AttachChild (UIDetailsWnd); - xml_init.InitScrollView (uiXml, "detail_list", 0, UIDetailsWnd); - - - xml_init.InitAutoStatic (uiXml, "left_auto_static", UIFrameContacts); - xml_init.InitAutoStatic (uiXml, "right_auto_static", UIRightFrame); -} - - -void CUIPdaContactsWnd::Update() -{ - if(TRUE==m_flags.test(flNeedUpdate)){ - RemoveAll (); - - CPda* pPda = Actor()->GetPDA (); - if(!pPda) return; - - pPda->ActivePDAContacts (m_pda_list); - - xr_vector::iterator it = m_pda_list.begin(); - - for(; it!=m_pda_list.end();++it){ - AddContact(*it); - } - m_flags.set(flNeedUpdate, FALSE); - } - inherited::Update(); -} - -void CUIPdaContactsWnd::AddContact(CPda* pda) -{ - VERIFY(pda); - - - CUIPdaContactItem* pItem = NULL; - pItem = xr_new(this); - UIListWnd->AddWindow (pItem, true); - pItem->InitPdaListItem (Fvector2().set(0,0), Fvector2().set(UIListWnd->GetWidth(),85.0f)); - pItem->InitCharacter (pda->GetOriginalOwner()); - pItem->m_data = (void*)pda; -} - -void CUIPdaContactsWnd::RemoveContact(CPda* pda) -{ - u32 cnt = UIListWnd->GetSize(); - - for(u32 i=0 ; iGetItem(i); - CUIPdaContactItem* itm = (CUIPdaContactItem*)(w); - - if(itm->m_data==(void*)pda){ - if(itm->GetSelected()) - UIDetailsWnd->Clear(); - UIListWnd->RemoveWindow(w); - return; - } - } -} - -//óäàëèòü âñå êîíòàêòû èç ñïèñêà -void CUIPdaContactsWnd::RemoveAll() -{ - UIListWnd->Clear (); - UIDetailsWnd->Clear (); -} - -void CUIPdaContactsWnd::Reload() -{ - m_flags.set(flNeedUpdate,TRUE); -} - -void CUIPdaContactsWnd::Reset() -{ - inherited::Reset (); - Reload (); -} - -CUIPdaContactItem::~CUIPdaContactItem() -{ -} - -extern CSE_ALifeTraderAbstract* ch_info_get_from_id (u16 id); - -#include "UICharacterInfo.h" - -void CUIPdaContactItem::SetSelected (bool b) -{ - CUISelectable::SetSelected(b); - if(b){ - m_cw->UIDetailsWnd->Clear (); - CCharacterInfo chInfo; - CSE_ALifeTraderAbstract* T = ch_info_get_from_id(UIInfo->OwnerID()); - chInfo.Init (T); - -//. ADD_TEXT_TO_VIEW2( *(chInfo.Bio()), m_cw->UIDetailsWnd); - } -} - -bool CUIPdaContactItem::OnMouseDown(int mouse_btn) -{ - if(mouse_btn==MOUSE_1){ - m_cw->UIListWnd->SetSelected(this); - return true; - } - return false; -} diff --git a/src/xrGame/ui/UIPdaContactsWnd.h b/src/xrGame/ui/UIPdaContactsWnd.h deleted file mode 100644 index b452a98653e..00000000000 --- a/src/xrGame/ui/UIPdaContactsWnd.h +++ /dev/null @@ -1,58 +0,0 @@ - -#pragma once - -#include "UIWindow.h" - - -class CUIFrameWindow; -class CUIFrameLineWnd; -class CUIStatic; -class CUIAnimatedStatic; -class CUIScrollView; -class CPda; - -class CUIPdaContactsWnd: public CUIWindow -{ -private: - typedef CUIWindow inherited; - enum {flNeedUpdate =(1<<0),}; - Flags8 m_flags; - xr_vector m_pda_list; -public: - CUIPdaContactsWnd (); - virtual ~CUIPdaContactsWnd (); - - void Init (); - - - virtual void Update (); - virtual void Reset (); - - virtual void Show (bool status); - - void AddContact (CPda* pda); - void RemoveContact (CPda* pda); - void RemoveAll (); - void Reload (); - - CUIScrollView* UIListWnd; - CUIScrollView* UIDetailsWnd; - -protected: - CUIFrameWindow* UIFrameContacts; - CUIFrameLineWnd* UIContactsHeader; - CUIFrameWindow* UIRightFrame; - CUIFrameLineWnd* UIRightFrameHeader; - CUIAnimatedStatic* UIAnimation; -}; - -#include "UIPdaListItem.h" -class CUIPdaContactItem :public CUIPdaListItem, public CUISelectable -{ - CUIPdaContactsWnd* m_cw; -public: - CUIPdaContactItem (CUIPdaContactsWnd* cw) {m_cw = cw;} - virtual ~CUIPdaContactItem (); - virtual void SetSelected (bool b); - virtual bool OnMouseDown (int mouse_btn); -}; \ No newline at end of file diff --git a/src/xrGame/ui/UIPdaKillMessage.cpp b/src/xrGame/ui/UIPdaKillMessage.cpp index 2e11be7704a..8c78e989279 100644 --- a/src/xrGame/ui/UIPdaKillMessage.cpp +++ b/src/xrGame/ui/UIPdaKillMessage.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "UIPdaKillMessage.h" #include "UIInventoryUtilities.h" -#include "../Include/xrRender/UIShader.h" +#include "Include/xrRender/UIShader.h" const int INDENT = 3; diff --git a/src/xrGame/ui/UIPdaListItem.cpp b/src/xrGame/ui/UIPdaListItem.cpp deleted file mode 100644 index 02634fa5a6c..00000000000 --- a/src/xrGame/ui/UIPdaListItem.cpp +++ /dev/null @@ -1,50 +0,0 @@ -#include "stdafx.h" - -#include "UIPdaListItem.h" -#include "../actor.h" -#include "UIInventoryUtilities.h" -#include "../string_table.h" - -#include "xrUIXmlParser.h" -#include "UIXmlInit.h" - -#include "../../xrServerEntities/character_info.h" - -#include "UIFrameWindow.h" -#include "../InventoryOwner.h" -#include "UICharacterInfo.h" -#include "UIStatic.h" - -#define PDA_CONTACT_CHAR "pda_character.xml" - -CUIPdaListItem::CUIPdaListItem() -{ - UIInfo = NULL; -} - -CUIPdaListItem::~CUIPdaListItem() -{ -} - -void CUIPdaListItem::InitPdaListItem(Fvector2 pos, Fvector2 size) -{ - inherited::SetWndPos (pos); - inherited::SetWndSize (size); - - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH, PDA_CONTACT_CHAR); - - CUIXmlInit xml_init; - UIInfo = xr_new (); - UIInfo->SetAutoDelete (true); - AttachChild (UIInfo); - UIInfo->InitCharacterInfo (Fvector2().set(0,0), size, PDA_CONTACT_CHAR); - - xml_init.InitAutoStaticGroup (uiXml,"pda_char_auto_statics", 0, this); -} - -void CUIPdaListItem::InitCharacter(CInventoryOwner* pInvOwner) -{ - VERIFY (pInvOwner); - UIInfo->InitCharacter (pInvOwner->object_id()); -} diff --git a/src/xrGame/ui/UIPdaListItem.h b/src/xrGame/ui/UIPdaListItem.h deleted file mode 100644 index 84111e79804..00000000000 --- a/src/xrGame/ui/UIPdaListItem.h +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once -#include "UIWindow.h" - -class CUIFrameWindow; -class CUICharacterInfo; -class CInventoryOwner; - -class CUIPdaListItem : public CUIWindow -{ -private: - typedef CUIWindow inherited; -public: - CUIPdaListItem (); - virtual ~CUIPdaListItem (); - void InitPdaListItem (Fvector2 pos, Fvector2 size); - virtual void InitCharacter (CInventoryOwner* pInvOwner); - - void* m_data; -protected: - //èíôîðìàöèÿ î ïåðñîíàæå - CUICharacterInfo* UIInfo; -}; \ No newline at end of file diff --git a/src/xrGame/ui/UIPdaWnd.cpp b/src/xrGame/ui/UIPdaWnd.cpp index 507e87343ba..0beb0481cf7 100644 --- a/src/xrGame/ui/UIPdaWnd.cpp +++ b/src/xrGame/ui/UIPdaWnd.cpp @@ -1,12 +1,12 @@ #include "stdafx.h" #include "UIPdaWnd.h" -#include "../Pda.h" +#include "PDA.h" #include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "UIInventoryUtilities.h" -#include "../level.h" +#include "Level.h" #include "UIGameCustom.h" #include "UIStatic.h" diff --git a/src/xrGame/ui/UIPdaWnd.h b/src/xrGame/ui/UIPdaWnd.h index a75053571e9..1becaa36880 100644 --- a/src/xrGame/ui/UIPdaWnd.h +++ b/src/xrGame/ui/UIPdaWnd.h @@ -1,7 +1,6 @@ #pragma once - #include "UIDialogWnd.h" -#include "../encyclopedia_article_defs.h" +#include "encyclopedia_article_defs.h" class CInventoryOwner; class CUIFrameLineWnd; diff --git a/src/xrGame/ui/UIProgressBar.h b/src/xrGame/ui/UIProgressBar.h index 04ea382c887..e7075006f4a 100644 --- a/src/xrGame/ui/UIProgressBar.h +++ b/src/xrGame/ui/UIProgressBar.h @@ -2,7 +2,7 @@ #include "uiwindow.h" #include "uibutton.h" -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" class CUIProgressBar : public CUIWindow { diff --git a/src/xrGame/ui/UIProgressShape.cpp b/src/xrGame/ui/UIProgressShape.cpp index 05147c421ff..1996d011982 100644 --- a/src/xrGame/ui/UIProgressShape.cpp +++ b/src/xrGame/ui/UIProgressShape.cpp @@ -2,8 +2,8 @@ #include "UIProgressShape.h" #include "UIStatic.h" -#include "../Include/xrRender/UIShader.h" -#include "../Include/xrRender/UIRender.h" +#include "Include/xrRender/UIShader.h" +#include "Include/xrRender/UIRender.h" CUIProgressShape::CUIProgressShape() { diff --git a/src/xrGame/ui/UIPropertiesBox.cpp b/src/xrGame/ui/UIPropertiesBox.cpp index d2e7ab02d2d..1deed264fc3 100644 --- a/src/xrGame/ui/UIPropertiesBox.cpp +++ b/src/xrGame/ui/UIPropertiesBox.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "UIPropertiesBox.h" -#include "../level.h" +#include "Level.h" #include "UIListBoxItem.h" #include "UIXmlInit.h" diff --git a/src/xrGame/ui/UIPropertiesBox.h b/src/xrGame/ui/UIPropertiesBox.h index fb69c073fc2..78adb58e9a6 100644 --- a/src/xrGame/ui/UIPropertiesBox.h +++ b/src/xrGame/ui/UIPropertiesBox.h @@ -4,7 +4,7 @@ #include "uiframewindow.h" #include "uilistbox.h" -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" class CUIPropertiesBox: public CUIFrameWindow, diff --git a/src/xrGame/ui/UIRankFaction.cpp b/src/xrGame/ui/UIRankFaction.cpp deleted file mode 100644 index 9fcf3c7b1ed..00000000000 --- a/src/xrGame/ui/UIRankFaction.cpp +++ /dev/null @@ -1,164 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : UIRankFaction.cpp -// Created : 22.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Rank Faction info window class implementation -//////////////////////////////////////////////////////////////////////////// - -#include "pch_script.h" -#include "UIRankFaction.h" - -#include "UIXmlInit.h" -#include "UIProgressBar.h" -#include "UIHelper.h" - -#include "../actor.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" -#include "../character_community.h" -#include "../character_reputation.h" -#include "../relation_registry.h" - -u32 const color_green = 0xff00FF00; -u32 const color_red = 0xffFF0000; -u32 const color_clear = 0xffEEEEFF; - -CUIRankFaction::CUIRankFaction() : m_prev_sn(0xff) -{ -} - -CUIRankFaction::CUIRankFaction( shared_str const& faction_id ) - : m_faction_state( faction_id ), m_prev_sn(0xff) -{ -} - -CUIRankFaction::~CUIRankFaction() -{ -} - -float CUIRankFaction::get_faction_power() -{ - return m_faction_state.power; -} - -void CUIRankFaction::init_from_xml( CUIXml& xml ) -{ - CUIXmlInit::InitWindow( xml, "fraction_stand_wnd", 0, this ); - - m_sn = UIHelper::CreateTextWnd( xml, "serial_number", this ); - m_name = UIHelper::CreateTextWnd( xml, "name", this ); - m_icon = UIHelper::CreateStatic( xml, "icon", this ); - m_icon_over = UIHelper::CreateStatic( xml, "icon_over", this ); - m_location_static = UIHelper::CreateTextWnd( xml, "location_static", this ); - m_location_value = UIHelper::CreateTextWnd( xml, "location_value", this ); - m_power_static = UIHelper::CreateTextWnd( xml, "power_static", this ); - m_power_value = UIHelper::CreateTextWnd( xml, "power_value", this ); - - m_relation_minus = UIHelper::CreateProgressBar( xml, "relation_minus", this ); - m_relation_center_minus = UIHelper::CreateProgressBar( xml, "relation_center_minus", this ); - m_relation_center_plus = UIHelper::CreateProgressBar( xml, "relation_center_plus", this ); - m_relation_plus = UIHelper::CreateProgressBar( xml, "relation_plus", this ); - - m_origin_static = UIHelper::CreateStatic( xml, "origin_static", this ); - m_border_minus = UIHelper::CreateStatic( xml, "border_minus", this ); - m_border_plus = UIHelper::CreateStatic( xml, "border_plus", this ); - m_enemy_static = UIHelper::CreateTextWnd( xml, "enemy_static", this ); - m_frined_static = UIHelper::CreateTextWnd( xml, "frined_static", this ); - - m_rating_up = UIHelper::CreateStatic( xml, "rating_up", this ); - m_rating_down = UIHelper::CreateStatic( xml, "rating_down", this ); - - Fvector2 pos; - m_location_static->AdjustWidthToText(); - pos.x = m_location_static->GetWndPos().x + m_location_static->GetWidth() + 10.0f; - pos.y = m_location_value->GetWndPos().y; - m_location_value->SetWndPos( pos ); - - m_power_static->AdjustWidthToText(); - pos.x = m_power_static->GetWndPos().x + m_power_static->GetWidth() + 10.0f; - pos.y = m_power_value->GetWndPos().y; - m_power_value->SetWndPos( pos ); - - rating(0); -} - -void CUIRankFaction::rating( u8 new_sn, bool force ) -{ - if ( force || m_prev_sn == 0xff ) - { - m_rating_up->SetTextureColor( color_clear ); - m_rating_down->SetTextureColor( color_clear ); - } - - if ( m_prev_sn < new_sn ) - { - m_rating_up->SetTextureColor( color_clear ); - m_rating_down->SetTextureColor( color_red ); - m_prev_sn = new_sn; - } - else if ( m_prev_sn > new_sn ) - { - m_rating_up->SetTextureColor( color_green ); - m_rating_down->SetTextureColor( color_clear ); - m_prev_sn = new_sn; - } -} - -void CUIRankFaction::update_info( u8 sn ) -{ - m_faction_state.update_info(); - - string32 buf; - sprintf_s( buf, sizeof(buf), "%d", sn ); - m_sn->SetText( buf ); - - m_name->SetText( m_faction_state.get_name() ); - m_icon->InitTexture( m_faction_state.get_icon() ); - - m_location_value->SetText( m_faction_state.get_location() ); - - sprintf_s( buf, sizeof(buf), "%.0f", m_faction_state.power ); - m_power_value->SetText( buf ); - - float gw = (float)m_faction_state.get_actor_goodwill(); - if ( gw > 0.0f ) - { - m_relation_center_minus->SetProgressPos( 0.0f ); - m_relation_minus->SetProgressPos( 0.0f ); - - m_relation_center_plus->SetProgressPos( gw ); - float gw_plus = m_relation_center_plus->GetRange_max(); - if ( gw > gw_plus ) - { - m_relation_plus->SetProgressPos( gw - gw_plus ); - } - else - { - m_relation_plus->SetProgressPos( 0.0f ); - } - } - else if ( gw < 0.0f ) - { - m_relation_center_plus->SetProgressPos( 0.0f ); - m_relation_plus->SetProgressPos( 0.0f ); - - m_relation_center_minus->SetProgressPos( -gw ); - float gw_minus = -1.0f * m_relation_center_minus->GetRange_max(); - if ( gw < gw_minus ) - { - m_relation_minus->SetProgressPos( gw_minus - gw ); - } - else - { - m_relation_minus->SetProgressPos( 0.0f ); - } - } - else - { - m_relation_minus->SetProgressPos( 0.0f ); - m_relation_center_minus->SetProgressPos( 0.0f ); - m_relation_center_plus->SetProgressPos( 0.0f ); - m_relation_plus->SetProgressPos( 0.0f ); - } - -} \ No newline at end of file diff --git a/src/xrGame/ui/UIRankFaction.h b/src/xrGame/ui/UIRankFaction.h deleted file mode 100644 index 0f70b26b241..00000000000 --- a/src/xrGame/ui/UIRankFaction.h +++ /dev/null @@ -1,59 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : UIRankFaction.h -// Created : 22.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Rank Faction info window class -//////////////////////////////////////////////////////////////////////////// - -#pragma once -#include "UIWindow.h" -#include "FactionState.h" - -class CUIXml; -class CUIStatic; -class CUITextWnd; -class CUIProgressBar; -class CActor; - -class CUIRankFaction : public CUIWindow -{ -private: - FactionState m_faction_state; - - CUITextWnd* m_sn; - CUITextWnd* m_name; - CUIStatic* m_icon; - CUIStatic* m_icon_over; - CUITextWnd* m_location_static; - CUITextWnd* m_location_value; - CUITextWnd* m_power_static; - CUITextWnd* m_power_value; - - CUIProgressBar* m_relation_minus; - CUIProgressBar* m_relation_center_minus; - CUIProgressBar* m_relation_center_plus; - CUIProgressBar* m_relation_plus; - - CUIStatic* m_origin_static; - CUIStatic* m_border_minus; - CUIStatic* m_border_plus; - CUITextWnd* m_enemy_static; - CUITextWnd* m_frined_static; - - CUIStatic* m_rating_up; - CUIStatic* m_rating_down; - - u8 m_prev_sn; - -public: - CUIRankFaction (); - CUIRankFaction ( shared_str const& faction_id ); - virtual ~CUIRankFaction (); - - void init_from_xml ( CUIXml& xml ); - void rating ( u8 new_sn, bool force = false ); - void update_info ( u8 sn ); - float get_faction_power (); - IC u8 get_cur_sn () { return m_prev_sn; } - -}; // class CUIRankFaction diff --git a/src/xrGame/ui/UIRankFraction.cpp b/src/xrGame/ui/UIRankFraction.cpp deleted file mode 100644 index e53a4ab301e..00000000000 --- a/src/xrGame/ui/UIRankFraction.cpp +++ /dev/null @@ -1,112 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : UIRankFraction.cpp -// Created : 22.01.2008 -// Modified : 22.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Rank Fraction info window class implementation -//////////////////////////////////////////////////////////////////////////// - -#include "pch_script.h" -#include "UIRankFraction.h" - -#include "UIXmlInit.h" -#include "UIProgressBar.h" -#include "UIHelper.h" - -#include "../actor.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" -#include "../character_community.h" -#include "../character_reputation.h" -#include "../relation_registry.h" - -CUIRankFraction::CUIRankFraction() -{ -} - -CUIRankFraction::CUIRankFraction( shared_str const& fraction_id ) - : m_fraction_state( fraction_id ) -{ -} - -CUIRankFraction::~CUIRankFraction() -{ -} - -float CUIRankFraction::get_fraction_power() -{ - return m_fraction_state.power; -} - -void CUIRankFraction::init_from_xml( CUIXml& xml ) -{ - CUIXmlInit::InitWindow( xml, "fraction_stand_wnd", 0, this ); - - m_sn = UIHelper::CreateStatic( xml, "serial_number", this ); - m_name = UIHelper::CreateStatic( xml, "name", this ); - m_icon = UIHelper::CreateStatic( xml, "icon", this ); - m_location_static = UIHelper::CreateStatic( xml, "location_static", this ); - m_location_value = UIHelper::CreateStatic( xml, "location_value", this ); - m_power_static = UIHelper::CreateStatic( xml, "power_static", this ); - m_power_value = UIHelper::CreateStatic( xml, "power_value", this ); - - m_relation_minus = UIHelper::CreateProgressBar( xml, "relation_minus", this ); - m_relation_center_minus = UIHelper::CreateProgressBar( xml, "relation_center_minus", this ); - m_relation_center_plus = UIHelper::CreateProgressBar( xml, "relation_center_plus", this ); - m_relation_plus = UIHelper::CreateProgressBar( xml, "relation_plus", this ); - - m_origin_static = UIHelper::CreateStatic( xml, "origin_static", this ); - m_border_minus = UIHelper::CreateStatic( xml, "border_minus", this ); - m_border_plus = UIHelper::CreateStatic( xml, "border_plus", this ); - m_enemy_static = UIHelper::CreateStatic( xml, "enemy_static", this ); - m_frined_static = UIHelper::CreateStatic( xml, "frined_static", this ); - - Fvector2 pos; - m_location_static->AdjustWidthToText(); - pos.x = m_location_static->GetWndPos().x + m_location_static->GetWidth() + 10.0f; - pos.y = m_location_value->GetWndPos().y; - m_location_value->SetWndPos( pos ); - - m_power_static->AdjustWidthToText(); - pos.x = m_power_static->GetWndPos().x + m_power_static->GetWidth() + 10.0f; - pos.y = m_power_value->GetWndPos().y; - m_power_value->SetWndPos( pos ); -} - -void CUIRankFraction::update_info( u8 sn ) -{ - m_fraction_state.update_info(); - - string32 buf; - xr_sprintf( buf, sizeof(buf), "%d", sn ); - m_sn->SetText( buf ); - - m_name->SetText( m_fraction_state.get_name() ); - m_icon->InitTexture( m_fraction_state.get_icon() ); - - m_location_value->SetText( m_fraction_state.get_location() ); - - xr_sprintf( buf, sizeof(buf), "%.0f", m_fraction_state.power ); - m_power_value->SetText( buf ); - - float gw = (float)m_fraction_state.get_actor_goodwill(); - if ( gw > 0.0f ) - { - m_relation_center_plus->SetProgressPos( gw ); - float gw_plus = m_relation_center_plus->GetRange_max(); - if ( gw > gw_plus ) - { - m_relation_plus->SetProgressPos( gw - gw_plus ); - } - } - else if ( gw < 0.0f ) - { - m_relation_center_minus->SetProgressPos( -gw ); - float gw_minus = -1.0f * m_relation_center_minus->GetRange_max(); - if ( gw < gw_minus ) - { - m_relation_minus->SetProgressPos( gw_minus - gw ); - } - } - -} \ No newline at end of file diff --git a/src/xrGame/ui/UIRankFraction.h b/src/xrGame/ui/UIRankFraction.h deleted file mode 100644 index d22c107ed8e..00000000000 --- a/src/xrGame/ui/UIRankFraction.h +++ /dev/null @@ -1,51 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : UIRankFraction.h -// Created : 22.01.2008 -// Modified : 22.01.2008 -// Author : Evgeniy Sokolov -// Description : UI Rank Fraction info window class -//////////////////////////////////////////////////////////////////////////// - -#pragma once -#include "UIWindow.h" -#include "FractionState.h" - -class CUIXml; -class CUIStatic; -class CUIProgressBar; -class CActor; - -class CUIRankFraction : public CUIWindow -{ -private: - FractionState m_fraction_state; - - CUIStatic* m_sn; - CUIStatic* m_name; - CUIStatic* m_icon; - CUIStatic* m_location_static; - CUIStatic* m_location_value; - CUIStatic* m_power_static; - CUIStatic* m_power_value; - - CUIProgressBar* m_relation_minus; - CUIProgressBar* m_relation_center_minus; - CUIProgressBar* m_relation_center_plus; - CUIProgressBar* m_relation_plus; - - CUIStatic* m_origin_static; - CUIStatic* m_border_minus; - CUIStatic* m_border_plus; - CUIStatic* m_enemy_static; - CUIStatic* m_frined_static; - -public: - CUIRankFraction (); - CUIRankFraction ( shared_str const& fraction_id ); - virtual ~CUIRankFraction (); - - void init_from_xml ( CUIXml& xml ); - void update_info ( u8 sn ); - float get_fraction_power (); - -}; // class CUIRankFraction diff --git a/src/xrGame/ui/UIRankingWnd.cpp b/src/xrGame/ui/UIRankingWnd.cpp index 504846aa981..0b3443906b5 100644 --- a/src/xrGame/ui/UIRankingWnd.cpp +++ b/src/xrGame/ui/UIRankingWnd.cpp @@ -7,7 +7,6 @@ #include "pch_script.h" #include "UIRankingWnd.h" - #include "UIFixedScrollBar.h" #include "UIXmlInit.h" #include "UIProgressBar.h" @@ -15,16 +14,14 @@ #include "UIScrollView.h" #include "UIHelper.h" #include "UIInventoryUtilities.h" - -#include "../actor.h" -#include "../ai_space.h" -#include "../alife_simulator.h" - -#include "../../xrServerEntities/script_engine.h" -#include "../character_community.h" -#include "../character_reputation.h" -#include "../relation_registry.h" -#include "../string_table.h" +#include "Actor.h" +#include "ai_space.h" +#include "alife_simulator.h" +#include "xrServerEntities/script_engine.h" +#include "character_community.h" +#include "character_reputation.h" +#include "relation_registry.h" +#include "string_table.h" #include "UICharacterInfo.h" #include "ui_base.h" diff --git a/src/xrGame/ui/UIScriptWnd.cpp b/src/xrGame/ui/UIScriptWnd.cpp index 568dfb9eedf..c6b642a1ac2 100644 --- a/src/xrGame/ui/UIScriptWnd.cpp +++ b/src/xrGame/ui/UIScriptWnd.cpp @@ -1,8 +1,7 @@ #include "pch_script.h" #include "UIScriptWnd.h" #include "object_broker.h" -#include "../callback_info.h" - +#include "callback_info.h" CUIDialogWndEx::CUIDialogWndEx() {} diff --git a/src/xrGame/ui/UIScriptWnd.h b/src/xrGame/ui/UIScriptWnd.h index 9941352cffd..04d8a6d00b7 100644 --- a/src/xrGame/ui/UIScriptWnd.h +++ b/src/xrGame/ui/UIScriptWnd.h @@ -1,8 +1,8 @@ #pragma once #include "UIDialogWnd.h" -#include "../../xrServerEntities/script_space_forward.h" -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_space_forward.h" +#include "xrServerEntities/script_export_space.h" struct SCallbackInfo; diff --git a/src/xrGame/ui/UIScrollBar.cpp b/src/xrGame/ui/UIScrollBar.cpp index ab081e373f0..9a2d8a0a7e7 100644 --- a/src/xrGame/ui/UIScrollBar.cpp +++ b/src/xrGame/ui/UIScrollBar.cpp @@ -181,7 +181,8 @@ void CUIScrollBar::UpdateScrollBar() ClampByViewRect(); } -#include "../uicursor.h" +#include "UICursor.h" + u32 last_hold_time =0; bool CUIScrollBar::OnKeyboardHold(int dik) diff --git a/src/xrGame/ui/UIScrollBox.cpp b/src/xrGame/ui/UIScrollBox.cpp index 35fff98f3a4..5518dd127a0 100644 --- a/src/xrGame/ui/UIScrollBox.cpp +++ b/src/xrGame/ui/UIScrollBox.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" -#include "uiscrollbox.h" -#include "../uicursor.h" +#include "UIScrollBox.h" +#include "UICursor.h" CUIScrollBox::CUIScrollBox() { diff --git a/src/xrGame/ui/UIScrollView.cpp b/src/xrGame/ui/UIScrollView.cpp index 510a461e287..3a9354fee93 100644 --- a/src/xrGame/ui/UIScrollView.cpp +++ b/src/xrGame/ui/UIScrollView.cpp @@ -2,9 +2,9 @@ #include "UIScrollView.h" #include "UIScrollBar.h" #include "UIFixedScrollBar.h" -#include "../ui_base.h" -#include "../UICursor.h" -#include "../../xrEngine/xr_input.h" +#include "ui_base.h" +#include "UICursor.h" +#include "xrEngine/xr_input.h" CUIScrollView::CUIScrollView() { diff --git a/src/xrGame/ui/UISecondTaskWnd.cpp b/src/xrGame/ui/UISecondTaskWnd.cpp index c0e911dbfc3..07b54d22218 100644 --- a/src/xrGame/ui/UISecondTaskWnd.cpp +++ b/src/xrGame/ui/UISecondTaskWnd.cpp @@ -7,11 +7,9 @@ #include "stdafx.h" #include "UISecondTaskWnd.h" - #include "xrUIXmlParser.h" #include "UIXmlInit.h" #include "UIHelper.h" - #include "UIFrameWindow.h" #include "UIScrollView.h" #include "UIStatic.h" @@ -21,16 +19,14 @@ #include "UIFixedScrollBar.h" #include "UIHint.h" #include "UITaskWnd.h" - -#include "../GameTaskDefs.h" -#include "../gametask.h" -#include "../map_location.h" +#include "GameTaskDefs.h" +#include "GameTask.h" +#include "map_location.h" #include "UIInventoryUtilities.h" -#include "../string_table.h" -#include "../level.h" -#include "../gametaskmanager.h" -#include "../actor.h" - +#include "string_table.h" +#include "Level.h" +#include "GametaskManager.h" +#include "Actor.h" UITaskListWnd::UITaskListWnd() { diff --git a/src/xrGame/ui/UIServerInfo.cpp b/src/xrGame/ui/UIServerInfo.cpp index da53c7d1385..8ba37f7ce6f 100644 --- a/src/xrGame/ui/UIServerInfo.cpp +++ b/src/xrGame/ui/UIServerInfo.cpp @@ -1,14 +1,13 @@ #include "stdafx.h" #include "UIServerInfo.h" - #include "UIStatic.h" #include "UICursor.h" #include "UIScrollView.h" #include "UIXmlInit.h" #include "UI3tButton.h" #include "UIGameCustom.h" -#include "../level.h" -#include "../game_cl_mp.h" +#include "Level.h" +#include "game_cl_mp.h" #include #include "ximage.h" #include "xmemfile.h" diff --git a/src/xrGame/ui/UISkinSelector.cpp b/src/xrGame/ui/UISkinSelector.cpp index e8232bafb7a..055cfba396a 100644 --- a/src/xrGame/ui/UISkinSelector.cpp +++ b/src/xrGame/ui/UISkinSelector.cpp @@ -5,12 +5,11 @@ #include "UIAnimatedStatic.h" #include "UI3tButton.h" #include "UIStatix.h" -#include "uicursor.h" -#include "../UIGameCustom.h" -#include "../game_cl_deathmatch.h" -#include "../xr_level_controller.h" -#include "../level.h" - +#include "UICursor.h" +#include "UIGameCustom.h" +#include "game_cl_deathmatch.h" +#include "xr_level_controller.h" +#include "Level.h" #include "object_broker.h" CUISkinSelectorWnd::CUISkinSelectorWnd(const char* strSectionName, s16 team) diff --git a/src/xrGame/ui/UISpawnWnd.cpp b/src/xrGame/ui/UISpawnWnd.cpp index a925ea8459d..e6c1bf17974 100644 --- a/src/xrGame/ui/UISpawnWnd.cpp +++ b/src/xrGame/ui/UISpawnWnd.cpp @@ -2,12 +2,12 @@ #include #include "UISpawnWnd.h" #include "UIXmlInit.h" -#include "../level.h" -#include "../game_cl_teamdeathmatch.h" +#include "Level.h" +#include "game_cl_teamdeathmatch.h" #include "UIStatix.h" #include "UIScrollView.h" #include "UI3tButton.h" -#include "../xr_level_controller.h" +#include "xr_level_controller.h" #include "uicursor.h" #include "uigamecustom.h" diff --git a/src/xrGame/ui/UISpeechMenu.cpp b/src/xrGame/ui/UISpeechMenu.cpp index 2d048f15939..44e043f6d6a 100644 --- a/src/xrGame/ui/UISpeechMenu.cpp +++ b/src/xrGame/ui/UISpeechMenu.cpp @@ -4,10 +4,10 @@ #include "UIStatic.h" #include "UIGameCustom.h" #include "UIXmlInit.h" -#include "../game_cl_mp.h" +#include "game_cl_mp.h" #include -#include "../level.h" -#include "../string_table.h" +#include "Level.h" +#include "string_table.h" CUISpeechMenu::CUISpeechMenu(LPCSTR section_name) { diff --git a/src/xrGame/ui/UISpinText.cpp b/src/xrGame/ui/UISpinText.cpp index 5914493c155..b24033304e9 100644 --- a/src/xrGame/ui/UISpinText.cpp +++ b/src/xrGame/ui/UISpinText.cpp @@ -1,7 +1,7 @@ #include "StdAfx.h" #include "UISpinText.h" #include "UILines.h" -#include "../string_table.h" +#include "string_table.h" CUISpinText::CUISpinText() :m_curItem(-1) diff --git a/src/xrGame/ui/UIStalkersRankingWnd.cpp b/src/xrGame/ui/UIStalkersRankingWnd.cpp deleted file mode 100644 index e4f7d946cbf..00000000000 --- a/src/xrGame/ui/UIStalkersRankingWnd.cpp +++ /dev/null @@ -1,290 +0,0 @@ -#include "StdAfx.h" -#include "UIStalkersRankingWnd.h" - -#include "UIXmlInit.h" -#include "UIFrameWindow.h" -#include "UIFrameLineWnd.h" -#include "UIPdaListItem.h" -#include "UIAnimatedStatic.h" -#include "UIScrollView.h" -#include "UICharacterInfo.h" -#include "../InventoryOwner.h" -#include "../Level.h" -#include "../pda.h" -#include "../actor.h" -#include "../../xrServerEntities/xrServer_Objects_ALife_Monsters.h" - -#define STALKERS_RANKING_XML "stalkers_ranking.xml" -#define STALKERS_RANKING_CHARACTER_XML "stalkers_ranking_character.xml" - -struct SStatData{ - u16 id; - CSE_ALifeTraderAbstract* trader; - bool operator == (const SStatData& d1){return (id==d1.id) ;} -}; - -typedef xr_vector TOP_LIST; -TOP_LIST g_all_statistic_humans; - -void CUIStalkersRankingWnd::Init() -{ - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH,STALKERS_RANKING_XML); - - CUIXmlInit xml_init; - - xml_init.InitWindow (uiXml, "main_wnd", 0, this); - - UICharIconFrame = xr_new(); UICharIconFrame->SetAutoDelete(true); - AttachChild (UICharIconFrame); - xml_init.InitFrameWindow (uiXml, "chicon_frame_window", 0, UICharIconFrame); - - UICharIconHeader = xr_new(); UICharIconHeader->SetAutoDelete(true); - UICharIconFrame->AttachChild (UICharIconHeader); - xml_init.InitFrameLine (uiXml, "chicon_frame_line", 0, UICharIconHeader); - - - UIInfoFrame = xr_new(); UIInfoFrame->SetAutoDelete(true); - AttachChild (UIInfoFrame); - xml_init.InitFrameWindow (uiXml, "info_frame_window", 0, UIInfoFrame); - - UIInfoHeader = xr_new(); UIInfoHeader->SetAutoDelete(true); - UIInfoFrame->AttachChild (UIInfoHeader); - xml_init.InitFrameLine (uiXml, "info_frame_line", 0, UIInfoHeader); - - UIAnimatedIcon = xr_new(); UIAnimatedIcon->SetAutoDelete(true); - UIInfoHeader->AttachChild (UIAnimatedIcon); - xml_init.InitAnimatedStatic (uiXml, "a_static", 0, UIAnimatedIcon); - - UIList = xr_new(); UIList->SetAutoDelete(true); - UIInfoFrame->AttachChild (UIList); - xml_init.InitScrollView (uiXml, "list", 0, UIList); - - UICharacterWindow = xr_new(); UICharacterWindow->SetAutoDelete(true); - UICharIconFrame->AttachChild (UICharacterWindow); - xml_init.InitWindow (uiXml, "character_info", 0, UICharacterWindow); - - UICharacterInfo = xr_new(); UICharacterInfo->SetAutoDelete(true); - UICharacterWindow->AttachChild (UICharacterInfo); - UICharacterInfo->InitCharacterInfo (Fvector2().set(0,0),UICharacterWindow->GetWndSize(), STALKERS_RANKING_CHARACTER_XML); - - xml_init.InitAutoStaticGroup (uiXml, "left_auto", 0, UIInfoFrame); - xml_init.InitAutoStaticGroup (uiXml, "right_auto", 0, UICharIconFrame); -} - - -void CUIStalkersRankingWnd::Show(bool status) -{ - inherited::Show(status); - if (status) - FillList (); -} - -bool GreaterRankPred(const SStatData& h1, const SStatData& h2) -{ - return (h1.trader->m_rank > h2.trader->m_rank); -} - -extern CSE_ALifeTraderAbstract* ch_info_get_from_id (u16 id); - -int get_actor_ranking() -{ - std::sort (g_all_statistic_humans.begin(),g_all_statistic_humans.end(),GreaterRankPred); - CSE_ALifeTraderAbstract* pActorAbstract = ch_info_get_from_id(Actor()->ID()); - SStatData d; - d.id = Actor()->ID(); - d.trader = pActorAbstract; - - TOP_LIST::iterator it = std::find(g_all_statistic_humans.begin(),g_all_statistic_humans.end(),d); - if(it!=g_all_statistic_humans.end()) - return (int)std::distance(g_all_statistic_humans.begin(), it); - else - return 1; -} - -void CUIStalkersRankingWnd::FillList() -{ - - CUIXml uiXml; - uiXml.Load (CONFIG_PATH, UI_PATH,STALKERS_RANKING_XML); - - UIList->Clear (); - - uiXml.SetLocalRoot (uiXml.NavigateToNode("stalkers_list",0)); - - if(g_all_statistic_humans.size()) - { - CSE_ALifeTraderAbstract* pActorAbstract = ch_info_get_from_id(Actor()->ID()); - int actor_place = get_actor_ranking(); - - int sz = _min(g_all_statistic_humans.size(),20); - for(int i=0; i19) ){ - AddActorItem (&uiXml, actor_place+1, pActorAbstract); - }else{ - AddStalkerItem (&uiXml, i+1, pT); - } - } - - UIList->SetSelected (UIList->GetItem(0) ); - }else{ - CUIStalkerRankingInfoItem* itm = xr_new(this); - itm->Init (&uiXml, "no_items", 0); - UIList->AddWindow (itm, true); - } -} - -void CUIStalkersRankingWnd::ShowHumanInfo(u16 id) -{ - UICharacterInfo->InitCharacter(id); -} - -void CUIStalkersRankingWnd::AddStalkerItem(CUIXml* xml, int num, CSE_ALifeTraderAbstract* t) -{ - string64 buff; - CUIStalkerRankingInfoItem* itm = xr_new(this); - itm->Init (xml, "item_human", 0); - - sprintf_s (buff,"%d.",num); - itm->m_text1->SetText (buff); - - sprintf_s (buff,"%s",t->m_character_name.c_str()); - itm->m_text2->SetText (buff); - - sprintf_s (buff,"%d",t->m_rank); - itm->m_text3->SetText (buff); - itm->m_humanID = t->object_id(); - UIList->AddWindow (itm, true); - -} - -void CUIStalkersRankingWnd::AddActorItem(CUIXml* xml, int num, CSE_ALifeTraderAbstract* t) -{ - string64 buff; - CUIStalkerRankingInfoItem* itm; - if(num>19){ - itm = xr_new(this); - itm->Init (xml, "item_ellipsis", 0); - UIList->AddWindow (itm, true); - } - - itm = xr_new(this); - itm->Init (xml, "item_actor", 0); - - sprintf_s (buff,"%d.",num); - itm->m_text1->SetText (buff); - - - sprintf_s (buff,"%s", t->m_character_name.c_str()); - itm->m_text2->SetText (buff); - - sprintf_s (buff,"%d",t->m_rank); - itm->m_text3->SetText (buff); - - itm->m_humanID = t->object_id(); - UIList->AddWindow (itm, true); -} - -void CUIStalkersRankingWnd::Reset() -{ - inherited::Reset (); -} - -void add_human_to_top_list(u16 id) -{ - CSE_ALifeTraderAbstract* t = ch_info_get_from_id(id); - SStatData d; - d.id = id; - d.trader = t; - - TOP_LIST::iterator it = std::find(g_all_statistic_humans.begin(),g_all_statistic_humans.end(),d); - - if(it!=g_all_statistic_humans.end()) - g_all_statistic_humans.erase (it); - - g_all_statistic_humans.push_back (d); - - -// t->m_rank = ::Random.randI(20000); -} - -void remove_human_from_top_list(u16 id) -{ - CSE_ALifeTraderAbstract* t = ch_info_get_from_id(id); - SStatData d; - d.id = id; - d.trader = t; - TOP_LIST::iterator it = std::find(g_all_statistic_humans.begin(),g_all_statistic_humans.end(),d); - if(it!=g_all_statistic_humans.end()) - g_all_statistic_humans.erase (it); -} - - -CUIStalkerRankingInfoItem::CUIStalkerRankingInfoItem(CUIStalkersRankingWnd* w) -:m_StalkersRankingWnd(w),m_humanID(u16(-1)) -{ -} - -void CUIStalkerRankingInfoItem::Init (CUIXml* xml, LPCSTR path, int idx) -{ - XML_NODE* _stored_root = xml->GetLocalRoot(); - - CUIXmlInit xml_init; - xml_init.InitWindow (*xml, path, idx, this); - - xml->SetLocalRoot (xml->NavigateToNode(path,idx)); - - m_text1 = xr_new(); m_text1->SetAutoDelete(true); - AttachChild (m_text1); - xml_init.InitStatic (*xml, "text_1", 0, m_text1); - - m_text2 = xr_new(); m_text2->SetAutoDelete(true); - AttachChild (m_text2); - xml_init.InitStatic (*xml, "text_2", 0, m_text2); - - m_text3 = xr_new(); m_text3->SetAutoDelete(true); - AttachChild (m_text3); - xml_init.InitStatic (*xml, "text_3", 0, m_text3); - - xml_init.InitAutoStaticGroup (*xml, "auto", 0, this); - - m_stored_alpha = color_get_A(m_text2->GetTextColor()); - xml->SetLocalRoot (_stored_root); -} - -void CUIStalkerRankingInfoItem::SetSelected (bool b) -{ - CUISelectable::SetSelected (b); - m_text1->SetTextColor( subst_alpha(m_text1->GetTextColor(), b?255:m_stored_alpha )); - m_text2->SetTextColor( subst_alpha(m_text2->GetTextColor(), b?255:m_stored_alpha )); - m_text3->SetTextColor( subst_alpha(m_text3->GetTextColor(), b?255:m_stored_alpha )); - if(b){ - m_StalkersRankingWnd->ShowHumanInfo (m_humanID); - } - -} - -bool CUIStalkerRankingInfoItem::OnMouseDown (int mouse_btn) -{ - if(mouse_btn==MOUSE_1) - { - m_StalkersRankingWnd->GetTopList().SetSelected (this); - return true; - }else - return false; -} - -CUIStalkerRankingElipsisItem::CUIStalkerRankingElipsisItem(CUIStalkersRankingWnd* w) -:inherited(w) -{} - -void CUIStalkerRankingElipsisItem::SetSelected(bool b) -{ - return; -} - -bool CUIStalkerRankingElipsisItem::OnMouseDown(int mouse_btn) -{ - return false; -} diff --git a/src/xrGame/ui/UIStalkersRankingWnd.h b/src/xrGame/ui/UIStalkersRankingWnd.h deleted file mode 100644 index 35e6f05af75..00000000000 --- a/src/xrGame/ui/UIStalkersRankingWnd.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once -#include "UIWindow.h" - -class CUIFrameWindow; -class CUIFrameLineWnd; -class CUIAnimatedStatic; -class CUIStatic; -class CUICharacterInfo; -class CUIScrollView; -class CUIXml; -class CSE_ALifeTraderAbstract; - -class CUIStalkersRankingWnd: public CUIWindow -{ - typedef CUIWindow inherited; -public: - void Init (); - virtual void Show (bool status); - void ShowHumanDetails (); -protected: - CUIFrameWindow* UIInfoFrame; - CUIFrameWindow* UICharIconFrame; - CUIFrameLineWnd* UIInfoHeader; - CUIFrameLineWnd* UICharIconHeader; - CUIAnimatedStatic* UIAnimatedIcon; - // èíôîðìàöèÿ î ïåðñîíàæå - CUIWindow* UICharacterWindow; - CUICharacterInfo* UICharacterInfo; - void FillList (); - CUIScrollView* UIList; - void AddStalkerItem (CUIXml* xml, int num, CSE_ALifeTraderAbstract* t); - void AddActorItem (CUIXml* xml, int num, CSE_ALifeTraderAbstract* t); - -public: - CUIScrollView& GetTopList () {return *UIList;} - void ShowHumanInfo (u16 id); - virtual void Reset (); -}; - -class CUIStalkerRankingInfoItem :public CUIWindow, public CUISelectable -{ - CUIStalkersRankingWnd* m_StalkersRankingWnd; - u32 m_stored_alpha; -public: - u16 m_humanID; - CUIStatic* m_text1; - CUIStatic* m_text2; - CUIStatic* m_text3; -public: - CUIStalkerRankingInfoItem(CUIStalkersRankingWnd*); - - void Init (CUIXml* xml, LPCSTR path, int idx); - virtual void SetSelected (bool b); - virtual bool OnMouseDown (int mouse_btn); -}; - -class CUIStalkerRankingElipsisItem :public CUIStalkerRankingInfoItem -{ - typedef CUIStalkerRankingInfoItem inherited; -public: - CUIStalkerRankingElipsisItem(CUIStalkersRankingWnd*); - virtual void SetSelected (bool b); - virtual bool OnMouseDown (int mouse_btn); -}; diff --git a/src/xrGame/ui/UIStatic.cpp b/src/xrGame/ui/UIStatic.cpp index 74b4dce5f9e..7f5b74e0c49 100644 --- a/src/xrGame/ui/UIStatic.cpp +++ b/src/xrGame/ui/UIStatic.cpp @@ -2,11 +2,11 @@ #include "uistatic.h" #include "UIXmlInit.h" #include "UITextureMaster.h" -#include "../../xrEngine/LightAnimLibrary.h" +#include "xrEngine/LightAnimLibrary.h" #include "uilines.h" -#include "../ui_base.h" +#include "ui_base.h" -#include "../Include/xrRender/UIRender.h" +#include "Include/xrRender/UIRender.h" #include "UIBtnHint.h" #include "UICursor.h" @@ -101,7 +101,7 @@ void CUIStatic::DrawText() g_statHint->Draw_(); } -#include "../../Include/xrRender/UIShader.h" +#include "Include/xrRender/UIShader.h" void CUIStatic::DrawTexture() { diff --git a/src/xrGame/ui/UIStatic.h b/src/xrGame/ui/UIStatic.h index 52d1ab0983e..c99919dbecf 100644 --- a/src/xrGame/ui/UIStatic.h +++ b/src/xrGame/ui/UIStatic.h @@ -1,9 +1,8 @@ #pragma once - #include "UILanimController.h" -#include "../uistaticitem.h" -#include "../../xrServerEntities/script_export_space.h" -#include "uilines.h" +#include "UIStaticItem.h" +#include "xrServerEntities/script_export_space.h" +#include "UILines.h" class CUIFrameWindow; class CLAItem; diff --git a/src/xrGame/ui/UIStats.cpp b/src/xrGame/ui/UIStats.cpp index c7d0621cba6..def0fc89672 100644 --- a/src/xrGame/ui/UIStats.cpp +++ b/src/xrGame/ui/UIStats.cpp @@ -5,7 +5,7 @@ #include "UIStatsPlayerList.h" #include "UIStatic.h" #include "UIFrameWindow.h" -#include "../level.h" +#include "Level.h" #include "game_base_space.h" diff --git a/src/xrGame/ui/UIStatsIcon.cpp b/src/xrGame/ui/UIStatsIcon.cpp index 9031efc315b..33003c2a95c 100644 --- a/src/xrGame/ui/UIStatsIcon.cpp +++ b/src/xrGame/ui/UIStatsIcon.cpp @@ -3,7 +3,7 @@ #include "UITextureMaster.h" #include "UIInventoryUtilities.h" -#include "../Include/xrRender/UIShader.h" +#include "Include/xrRender/UIShader.h" CUIStatsIcon::TEX_INFO CUIStatsIcon::m_tex_info[MAX_DEF_TEX][2]; diff --git a/src/xrGame/ui/UIStatsPlayerInfo.cpp b/src/xrGame/ui/UIStatsPlayerInfo.cpp index 240574db552..04c3b1cc106 100644 --- a/src/xrGame/ui/UIStatsPlayerInfo.cpp +++ b/src/xrGame/ui/UIStatsPlayerInfo.cpp @@ -1,12 +1,11 @@ #include "StdAfx.h" - #include "UIStatsPlayerInfo.h" #include "UIStatic.h" -#include "../game_cl_base.h" +#include "game_cl_base.h" #include "UIStatsIcon.h" -#include "../game_cl_artefacthunt.h" -#include "../level.h" -#include "../string_table.h" +#include "game_cl_artefacthunt.h" +#include "Level.h" +#include "string_table.h" CUIStatsPlayerInfo::CUIStatsPlayerInfo(xr_vector* info, CGameFont* pF, u32 text_col) { diff --git a/src/xrGame/ui/UIStatsPlayerList.cpp b/src/xrGame/ui/UIStatsPlayerList.cpp index e69c4a32d51..9e1dcf3f3cc 100644 --- a/src/xrGame/ui/UIStatsPlayerList.cpp +++ b/src/xrGame/ui/UIStatsPlayerList.cpp @@ -1,11 +1,11 @@ #include "StdAfx.h" #include "UIStatsPlayerList.h" -#include "../game_cl_base.h" -#include "../game_cl_artefacthunt.h" +#include "game_cl_base.h" +#include "game_cl_artefacthunt.h" #include "UIStatsPlayerInfo.h" #include "UIStatsIcon.h" -#include "../string_table.h" -#include "../level.h" +#include "string_table.h" +#include "Level.h" #include "UIStatic.h" #include "UIXmlInit.h" diff --git a/src/xrGame/ui/UIStatsWnd.cpp b/src/xrGame/ui/UIStatsWnd.cpp deleted file mode 100644 index 0c76f2db343..00000000000 --- a/src/xrGame/ui/UIStatsWnd.cpp +++ /dev/null @@ -1,172 +0,0 @@ -#include "stdafx.h" - -#include "UIStatsWnd.h" -#include "UIXmlInit.h" -#include "../UI.h" -#include "../string_table.h" - -////////////////////////////////////////////////////////////////////////// - -const char * const STATS_XML = "stats.xml"; - -CUIStatsWnd::CUIStatsWnd(LPCSTR XML) - : m_uHighlightedItem(0xffffffff) -{ - Init(XML); -} - -CUIStatsWnd::~CUIStatsWnd() -{ - -} - -void CUIStatsWnd::Init(LPCSTR XML) -{ - CUIXml uiXml; - if (XML) strcpy_s(XML_NAME, XML); - else strcpy_s(XML_NAME, STATS_XML); - - uiXml.Load(CONFIG_PATH, UI_PATH, XML_NAME); - - CUIXmlInit xml_init; - Fvector2 pos, size; - pos.set (CUIXmlInit::ApplyAlignX(0, alCenter),CUIXmlInit::ApplyAlignY(0, alCenter)); - size.set (UI_BASE_WIDTH, UI_BASE_HEIGHT); - CUIWindow::SetWndPos(pos); - CUIWindow::SetWndSize(size); - // ×èòàåì èç xml ôàéëà ïàðàìåòðû îêíà è êîíòðîëîâ - AttachChild(&UIFrameWnd); - xml_init.InitFrameWindow(uiXml, "frame_window", 0, &UIFrameWnd); - - UIFrameWnd.AttachChild(&UIStatsList); - xml_init.InitListWnd(uiXml, "list", 0, &UIStatsList); - UIStatsList.SetMessageTarget(this); - UIStatsList.EnableScrollBar(true); - - xml_init.InitMultiTextStatic(uiXml, "headers_mt_static", 0, &UIHeader); - UIFrameWnd.AttachChild(&UIHeader); -} - -////////////////////////////////////////////////////////////////////////// - -CUIStatsListItem * CUIStatsWnd::AddItem() -{ - CUIStatsListItem *pNewItem = xr_new(); - UIStatsList.AddItem(pNewItem); - UIStatsList.ScrollToBegin(); - - CUIXml uiXml; - uiXml.Load(CONFIG_PATH, UI_PATH, XML_NAME); - - pNewItem->XmlInit("list", uiXml); -// pNewItem->SetMessageTarget(this); - return pNewItem; -} - -////////////////////////////////////////////////////////////////////////// - -CUIStatsListItem * CUIStatsWnd::FindFrom(const u32 beg_pos, const char *strCaption) -{ - for (int i = 0; i < UIStatsList.GetItemsCount(); ++i) - { - CUIStatsListItem *pSLItem = smart_cast(UIStatsList.GetItem(i)); - R_ASSERT(beg_pos < pSLItem->FieldsVector.size()); - for (FIELDS_VECTOR_it it = pSLItem->FieldsVector.begin() + beg_pos; it < pSLItem->FieldsVector.end(); ++it) - { - if (0 == xr_strcmp(strCaption, (*it)->GetText())) - { - return pSLItem; - } - } - } - return NULL; -} - -////////////////////////////////////////////////////////////////////////// - -void CUIStatsWnd::RemoveItemFrom(const u32 beg_pos, const char *strCaption) -{ - if (CUIStatsListItem *pSLItem = FindFrom(beg_pos, strCaption)) - { - UIStatsList.RemoveItem(pSLItem->GetIndex()); - } -} - -////////////////////////////////////////////////////////////////////////// - -void CUIStatsWnd::HighlightItem(const u32 uItem) -{ - R_ASSERT(static_cast(uItem) < UIStatsList.GetItemsCount()); - if (m_uHighlightedItem != uItem) - { - if (m_uHighlightedItem != 0xffffffff) - smart_cast(UIStatsList.GetItem(m_uHighlightedItem))->Highlight(false); - if (uItem != 0xffffffff) - smart_cast(UIStatsList.GetItem(uItem))->Highlight(true); - m_uHighlightedItem = uItem; - } -} - -////////////////////////////////////////////////////////////////////////// - -void CUIStatsWnd::SelectItem(const u32 uItem) -{ - R_ASSERT(static_cast(uItem) < UIStatsList.GetItemsCount()); - UIStatsList.SetFocusedItem(static_cast(uItem)); -} - -////////////////////////////////////////////////////////////////////////// - -void CUIStatsWnd::SetHeaderColumnText(const u32 headerItem, const shared_str &text) -{ - UIHeader.GetPhraseByIndex(headerItem)->str = CStringTable().translate(text); -} - -////////////////////////////////////////////////////////////////////////// -// CUIStatsListItem - êëàññ ýëåìåíòà ñïèñêà â ëèñòå -////////////////////////////////////////////////////////////////////////// - -void CUIStatsListItem::XmlInit(const char *path, CUIXml &uiXml) -{ - CUIXmlInit xml_init; -// CUIStatic *pStatic; - CUIButton *pButton; - - string256 buf; - strconcat(sizeof(buf),buf, path, ":static"); - - int tabsCount = uiXml.GetNodesNum(path, 0, "static"); - - XML_NODE* tab_node = uiXml.NavigateToNode(path,0); - uiXml.SetLocalRoot(tab_node); - - for (int i = 0; i < tabsCount; ++i) - { - pButton = xr_new(); - pButton->SetAutoDelete(true); - xml_init.InitStatic(uiXml, "static", i, pButton); - pButton->SetTextAlignment(CGameFont::alLeft); - AttachChild(pButton); - FieldsVector.push_back(pButton); - } - - FieldsVector[0]->SetEllipsis(1, 0); -} - -////////////////////////////////////////////////////////////////////////// - -void CUIStatsListItem::Highlight(bool bHighlight) -{ - for (FIELDS_VECTOR_it it = FieldsVector.begin(); it != FieldsVector.end(); ++it) - { - (*it)->HighlightItem(bHighlight); - } -} - -////////////////////////////////////////////////////////////////////////// - -void CUIStatsListItem::SetSubItemColor(u32 uItemIndex, u32 uColor) -{ - R_ASSERT(uItemIndex < FieldsVector.size()); - FieldsVector[uItemIndex]->SetTextColor(uColor); -} \ No newline at end of file diff --git a/src/xrGame/ui/UIStatsWnd.h b/src/xrGame/ui/UIStatsWnd.h deleted file mode 100644 index 070cdae2219..00000000000 --- a/src/xrGame/ui/UIStatsWnd.h +++ /dev/null @@ -1,72 +0,0 @@ -#pragma once - -#include "UIDialogWnd.h" -#include "UIFrameWindow.h" -#include "UIListWnd.h" -#include "UIListItem.h" -#include "UIXmlInit.h" -#include "UIButton.h" -#include "UIMultiTextStatic.h" - -DEF_VECTOR (FIELDS_VECTOR, CUIButton*) - -// Êëàññ äëÿ îïðåäåëåíèÿ íîâîãî ÷ëåíà ñïèñêà -class CUIStatsListItem: public CUIListItem -{ - typedef CUIListItem inherited; -public: - virtual ~CUIStatsListItem() {}; - void XmlInit(const char *path, CUIXml &uiXml); - void Highlight(bool bHighlight); - void SetSubItemColor(u32 uItemIndex, u32 uColor); - - // ïîëÿ çàïèñè - FIELDS_VECTOR FieldsVector; -}; - -class CUIStatsWnd: public CUIDialogWnd -{ -private: - typedef CUIDialogWnd inherited; - - string1024 XML_NAME; -public: - CUIStatsWnd(LPCSTR XML = NULL); - virtual ~CUIStatsWnd(); - - virtual void Init(LPCSTR XML = NULL); -// virtual void SendMessage(CUIWindow* pWnd, s16 msg, void* pData); - - // Äîáàâèòü 1 ýëåìåíò. Çàïîëíèòü ïîëÿ íåîáõîäèìî ñàìîñòîÿòåëüíî. Âîçâðàùàåò óêàçàòåëü - // íà äîáàâëåííûé ýëåìåíò - CUIStatsListItem * AddItem(); - // Ïîëó÷èòü ýëåìåíò, ïðè ï îìîùè ïîèñêà â ïîëÿõ ïî ñòðîêå. Ìîæíî èñêàòü - // ýëåìåíò íà÷èíàÿ ñ çàäàííîãî íîìåðà - CUIStatsListItem * FindFrom(u32 beg_pos, const char *strCaption); - // Óäàëèòü ýëåìåíò â êîòîðîì åñòü ñòàòèê ñ òåêñòîì strCaption.  êàæäîì Item'å ïîèñê - // íà÷àòü ñ ïîçèöèè beg_pos - void RemoveItemFrom(u32 beg_pos, const char *strCaption); - // Ïîäñâåòèòü íóæíûé ýëåìåíò - void HighlightItem(u32 uItem); - // Ïîëó÷èòü íîìåð ïîäñâå÷åíîãî ýë-òà - u32 GetHighlightedItem() { return m_uHighlightedItem; } - // Âûäåëèòü íóæíûé ýëåìåíò - void SelectItem(u32 uItem); - // Óñòàíîâèòü òåêñò çàãîëîâêà íóæíîé êîëîíêè - void SetHeaderColumnText(u32 headerItem, const shared_str &text); - - Frect GetFrameRect () { return UIFrameWnd.GetWndRect();}; - void RemoveItem (const u32 Index) {UIStatsList.RemoveItem(Index);}; - - CUIFrameWindow* GetFrameWindow () {return &UIFrameWnd;}; -protected: -// CUIButton UIBtn; - // Ôðåéì - îáîëî÷êà - CUIFrameWindow UIFrameWnd; - // Ëèñò äëÿ îòîáðàæåíèÿ ñïèñêà ñòàòè÷òèêè èãðîêîâ - CUIListWnd UIStatsList; - // Ïîäñâå÷åíûé ýëåìåíò - u32 m_uHighlightedItem; - // Çàãîëîâîê - CUIMultiTextStatic UIHeader; -}; diff --git a/src/xrGame/ui/UISubLine.cpp b/src/xrGame/ui/UISubLine.cpp index 82e2a57e509..45b853102a5 100644 --- a/src/xrGame/ui/UISubLine.cpp +++ b/src/xrGame/ui/UISubLine.cpp @@ -9,7 +9,7 @@ #include "StdAfx.h" #include "UISubLine.h" #include "uilinestd.h" -#include "../ui_base.h" +#include "ui_base.h" //#define LOG_ALL_LINES #ifdef LOG_ALL_LINES diff --git a/src/xrGame/ui/UITabControl.h b/src/xrGame/ui/UITabControl.h index d98f313508f..6c607620b7b 100644 --- a/src/xrGame/ui/UITabControl.h +++ b/src/xrGame/ui/UITabControl.h @@ -1,7 +1,7 @@ #pragma once #include "uiwindow.h" -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" #include "UIOptionsItem.h" class CUITabButton; diff --git a/src/xrGame/ui/UITalkDialogWnd.cpp b/src/xrGame/ui/UITalkDialogWnd.cpp index c0ff9505322..31e84ffccf1 100644 --- a/src/xrGame/ui/UITalkDialogWnd.cpp +++ b/src/xrGame/ui/UITalkDialogWnd.cpp @@ -9,10 +9,10 @@ #include "UIInventoryUtilities.h" #include "UIBtnHint.h" -#include "../game_news.h" -#include "../level.h" -#include "../actor.h" -#include "../alife_registry_wrappers.h" +#include "game_news.h" +#include "Level.h" +#include "Actor.h" +#include "alife_registry_wrappers.h" #include "dinput.h" #define TALK_XML "talk.xml" diff --git a/src/xrGame/ui/UITalkDialogWnd.h b/src/xrGame/ui/UITalkDialogWnd.h index b96bb6db933..e53482c2bd1 100644 --- a/src/xrGame/ui/UITalkDialogWnd.h +++ b/src/xrGame/ui/UITalkDialogWnd.h @@ -1,15 +1,10 @@ #pragma once - - #include "UIStatic.h" #include "UI3tButton.h" #include "UIFrameLineWnd.h" - -#include "../InfoPortion.h" - +#include "InfoPortion.h" #include "UICharacterInfo.h" #include "UIItemInfo.h" - #include "UIWndCallback.h" class CUIScrollView; diff --git a/src/xrGame/ui/UITalkWnd.cpp b/src/xrGame/ui/UITalkWnd.cpp index 791df5e6eb7..0c7ae457f65 100644 --- a/src/xrGame/ui/UITalkWnd.cpp +++ b/src/xrGame/ui/UITalkWnd.cpp @@ -1,22 +1,18 @@ #include "stdafx.h" #include "UITalkWnd.h" - #include "UITalkDialogWnd.h" - -#include "../actor.h" -#include "../trade.h" -#include "../UIGameSP.h" -#include "../PDA.h" -#include "../../xrServerEntities/character_info.h" -#include "../level.h" - -#include "../PhraseDialog.h" -#include "../PhraseDialogManager.h" - -#include "../game_cl_base.h" -#include "../string_table.h" -#include "../xr_level_controller.h" -#include "../../xrEngine/cameraBase.h" +#include "Actor.h" +#include "Trade.h" +#include "UIGameSP.h" +#include "PDA.h" +#include "xrServerEntities/character_info.h" +#include "Level.h" +#include "PhraseDialog.h" +#include "PhraseDialogManager.h" +#include "game_cl_base.h" +#include "string_table.h" +#include "xr_level_controller.h" +#include "xrEngine/cameraBase.h" #include "UIXmlInit.h" #include "UI3tButton.h" diff --git a/src/xrGame/ui/UITalkWnd.h b/src/xrGame/ui/UITalkWnd.h index 21fb69b8af5..4d5e6f44ea6 100644 --- a/src/xrGame/ui/UITalkWnd.h +++ b/src/xrGame/ui/UITalkWnd.h @@ -1,14 +1,10 @@ #pragma once - #include "UIDialogWnd.h" #include "UIStatic.h" #include "UIButton.h" #include "UIEditBox.h" -//#include "UIListWnd.h" #include "UIFrameWindow.h" - - -#include "../PhraseDialogDefs.h" +#include "PhraseDialogDefs.h" class CActor; class CInventoryOwner; diff --git a/src/xrGame/ui/UITaskDescrWnd.cpp b/src/xrGame/ui/UITaskDescrWnd.cpp deleted file mode 100644 index 68179f85005..00000000000 --- a/src/xrGame/ui/UITaskDescrWnd.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include "stdafx.h" -#include "UITaskDescrWnd.h" -#include "UIXmlInit.h" -#include "UIFrameWindow.h" -#include "UIFrameLineWnd.h" -#include "UIScrollView.h" -#include "UIEncyclopediaArticleWnd.h" -#include "../encyclopedia_article.h" - - -CUITaskDescrWnd::CUITaskDescrWnd () -{} - -CUITaskDescrWnd::~CUITaskDescrWnd () -{} - -void CUITaskDescrWnd::Init (CUIXml* doc, LPCSTR start_from) -{ - CUIXmlInit xml_init; - - xml_init.InitWindow (*doc,start_from,0,this); - - string512 str; - - m_UIMainFrame = xr_new(); m_UIMainFrame->SetAutoDelete(true); - AttachChild (m_UIMainFrame); - - strconcat (sizeof(str),str,start_from,":main_frame"); - xml_init.InitFrameWindow(*doc,str,0,m_UIMainFrame); - -//. strconcat (str,start_from,":main_frame"); -//. xml_init.InitAutoStaticGroup(*doc, str, m_UIMainFrame); - - m_UIMainHeader = xr_new();m_UIMainHeader->SetAutoDelete(true); - m_UIMainFrame->AttachChild(m_UIMainHeader); - strconcat (sizeof(str),str,start_from,":main_frame:header_frame_line"); - xml_init.InitFrameLine (*doc,str,0,m_UIMainHeader); - - m_UITaskInfoWnd = xr_new(); m_UITaskInfoWnd->SetAutoDelete(true); - m_UIMainFrame->AttachChild(m_UITaskInfoWnd); - strconcat (sizeof(str),str,start_from,":main_frame:scroll_view"); - xml_init.InitScrollView (*doc,str,0,m_UITaskInfoWnd); - -} - -void CUITaskDescrWnd::Draw () -{ - inherited::Draw (); -} - -void CUITaskDescrWnd::ClearAll () -{ - m_UITaskInfoWnd->Clear (); -} - -void CUITaskDescrWnd::AddArticle (LPCSTR article) -{ - CUIEncyclopediaArticleWnd* article_info = xr_new(); - article_info->Init ("encyclopedia_item.xml","events_wnd:objective_item"); - article_info->SetArticle (article); - m_UITaskInfoWnd->AddWindow (article_info, true); -} - -void CUITaskDescrWnd::AddArticle (CEncyclopediaArticle* article) -{ - CUIEncyclopediaArticleWnd* article_info = xr_new(); - article_info->Init ("encyclopedia_item.xml","events_wnd:objective_item"); - article_info->SetArticle (article); - m_UITaskInfoWnd->AddWindow (article_info, true); -} \ No newline at end of file diff --git a/src/xrGame/ui/UITaskDescrWnd.h b/src/xrGame/ui/UITaskDescrWnd.h deleted file mode 100644 index 5f0b97ef840..00000000000 --- a/src/xrGame/ui/UITaskDescrWnd.h +++ /dev/null @@ -1,28 +0,0 @@ -#pragma once -#error "deprecated" - -#include "UIWindow.h" - -class CUIScrollView; -class CUIFrameWindow; -class CUIFrameLineWnd; -class CUIXml; -class CEncyclopediaArticle; - -class CUITaskDescrWnd:public CUIWindow -{ - typedef CUIWindow inherited; -protected: - CUIScrollView* m_UITaskInfoWnd; - CUIFrameWindow* m_UIMainFrame; - CUIFrameLineWnd* m_UIMainHeader; - -public: - CUITaskDescrWnd (); - virtual ~CUITaskDescrWnd (); - virtual void Draw (); - void Init (CUIXml* doc, LPCSTR start_from); - void ClearAll (); - void AddArticle (LPCSTR article); - void AddArticle (CEncyclopediaArticle* article); -}; \ No newline at end of file diff --git a/src/xrGame/ui/UITaskItem.cpp b/src/xrGame/ui/UITaskItem.cpp deleted file mode 100644 index 7a8b0c6c102..00000000000 --- a/src/xrGame/ui/UITaskItem.cpp +++ /dev/null @@ -1,504 +0,0 @@ -#include "pch_script.h" - -#include "UITaskItem.h" -/* -#include "UIXmlInit.h" -#include "UI3tButton.h" -#include "../gametask.h" -#include "../string_table.h" -#include "UIEventsWnd.h" -#include "UIEditBoxEx.h" -#include "UIEditBox.h" -#include "UIInventoryUtilities.h" -#include "../map_location.h" -#include "../map_manager.h" -#include "../level.h" -#include "../actor.h" -#include "../gametaskmanager.h" - -CUITaskItem::CUITaskItem (CUIEventsWnd* w) -:m_GameTask (NULL), -m_TaskObjectiveIdx(u16(-1)), -m_EventsWnd(w) -{ -} - -CUITaskItem::~CUITaskItem () -{} - -void CUITaskItem::SetGameTask(CGameTask* gt, u16 obj_idx) -{ - m_GameTask = gt; - m_TaskObjectiveIdx = obj_idx; -} - -void CUITaskItem::SendMessage (CUIWindow* pWnd, s16 msg, void* pData) -{ - CUIWndCallback::OnEvent(pWnd, msg, pData); -} - -SGameTaskObjective* CUITaskItem::Objective () -{ - return &m_GameTask->m_Objectives[m_TaskObjectiveIdx]; -} - - -void CUITaskItem::Init () -{ - SetWindowName ("job_item"); - Register (this); - AddCallback ("job_item",BUTTON_CLICKED,CUIWndCallback::void_function(this,&CUITaskItem::OnItemClicked)); -} - -void CUITaskItem::OnItemClicked(CUIWindow*, void*) -{ - m_EventsWnd->ShowDescription (GameTask(), ObjectiveIdx()); -} - - -CUITaskRootItem::CUITaskRootItem (CUIEventsWnd* w) -:inherited(w) -{ - Init(); -} - -CUITaskRootItem::~CUITaskRootItem () -{} - -void CUITaskRootItem::Init () -{ - inherited::Init (); - - m_taskImage = xr_new(); m_taskImage->SetAutoDelete(true); AttachChild(m_taskImage); - m_captionStatic = xr_new(); m_captionStatic->SetAutoDelete(true); AttachChild(m_captionStatic); - m_remTimeStatic = xr_new(); m_remTimeStatic->SetAutoDelete(true); AttachChild(m_remTimeStatic); - - m_switchDescriptionBtn = xr_new(); m_switchDescriptionBtn->SetAutoDelete(true); AttachChild(m_switchDescriptionBtn); - m_captionTime = xr_new(); m_captionTime->SetAutoDelete(true); AttachChild(m_captionTime); - - m_switchDescriptionBtn->SetWindowName("m_switchDescriptionBtn"); - Register (m_switchDescriptionBtn); - AddCallback ("m_switchDescriptionBtn",BUTTON_CLICKED,CUIWndCallback::void_function(this, &CUITaskRootItem::OnSwitchDescriptionClicked)); - - CUIXmlInit xml_init; - CUIXml& uiXml = m_EventsWnd->m_ui_task_item_xml; - xml_init.InitWindow (uiXml,"task_root_item",0,this); - - xml_init.InitStatic (uiXml, "task_root_item:image", 0, m_taskImage); - xml_init.InitStatic (uiXml, "task_root_item:caption", 0, m_captionStatic); - xml_init.InitStatic (uiXml, "task_root_item:caption_time", 0, m_captionTime); - xml_init.InitStatic (uiXml, "task_root_item:rem_time", 0, m_remTimeStatic); - - xml_init.Init3tButton (uiXml,"task_root_item:switch_description_btn",0,m_switchDescriptionBtn); -} - - -void CUITaskRootItem::SetGameTask(CGameTask* gt, u16 obj_idx) -{ - inherited::SetGameTask(gt, obj_idx); - - CStringTable stbl; - SGameTaskObjective *obj = &m_GameTask->m_Objectives[m_TaskObjectiveIdx]; - - m_taskImage->InitTexture (*obj->icon_texture_name); - - Frect r = obj->icon_rect; - m_taskImage->SetOriginalRect (r.x1, r.y1, r.x2, r.y2); - m_taskImage->ClipperOn (); - m_taskImage->SetStretchTexture (true); - - m_captionStatic->SetText (*stbl.translate(m_GameTask->m_Title)); - m_captionStatic->AdjustHeightToText (); - - xr_string txt =""; - txt += *(InventoryUtilities::GetDateAsString(gt->m_ReceiveTime, InventoryUtilities::edpDateToDay)); - txt += " "; - txt += *(InventoryUtilities::GetTimeAsString(gt->m_ReceiveTime, InventoryUtilities::etpTimeToMinutes)); - - m_captionTime->SetText (txt.c_str()); - m_captionTime->SetWndPos(m_captionTime->GetWndPos().x,m_captionStatic->GetWndPos().y+m_captionStatic->GetHeight()+3.0f); - - float h = _max (m_taskImage->GetWndPos().y+m_taskImage->GetHeight(),m_captionTime->GetWndPos().y+m_captionTime->GetHeight()); - h = _max(h,m_switchDescriptionBtn->GetWndPos().y+m_switchDescriptionBtn->GetHeight()); - SetHeight (h); - - - m_curr_descr_mode = m_EventsWnd->GetDescriptionMode(); - if(m_curr_descr_mode) - m_switchDescriptionBtn->InitTexture ("ui_icons_newPDA_showtext"); - else - m_switchDescriptionBtn->InitTexture ("ui_icons_newPDA_showmap"); - - m_remTimeStatic->Show ( GameTask()->Objective(0).TaskState()==eTaskStateInProgress && - (GameTask()->m_ReceiveTime!=GameTask()->m_TimeToComplete) ); - - if( m_remTimeStatic->IsShown() ) - { - float _height = GetWndSize().y; - Fvector2 _pos = m_captionTime->GetWndPos(); - _pos.y += m_captionTime->GetWndSize().y; - _pos.x = m_remTimeStatic->GetWndPos().x; - - m_remTimeStatic->SetWndPos(_pos); - - _height = _max(_height, _pos.y+m_remTimeStatic->GetWndSize().y); - SetHeight (_height); - } -} - -void CUITaskRootItem::Update () -{ - inherited::Update (); - - if( m_curr_descr_mode != m_EventsWnd->GetDescriptionMode() ){ - m_curr_descr_mode = m_EventsWnd->GetDescriptionMode(); - if(m_curr_descr_mode) - m_switchDescriptionBtn->InitTexture ("ui_icons_newPDA_showtext"); - else - m_switchDescriptionBtn->InitTexture ("ui_icons_newPDA_showmap"); - } - - m_switchDescriptionBtn->SetButtonMode(m_EventsWnd->GetDescriptionMode() ? CUIButton::BUTTON_NORMAL : CUIButton::BUTTON_PUSHED); - - if(m_remTimeStatic->IsShown()) - { - string512 buff, buff2; - InventoryUtilities::GetTimePeriodAsString (buff, sizeof(buff), Level().GetGameTime(), GameTask()->m_TimeToComplete); - sprintf_s (buff2,"%s %s", *CStringTable().translate("ui_st_time_remains"), buff); - m_remTimeStatic->SetText (buff2); - - } -} - -bool CUITaskRootItem::OnDbClick () -{ - return true; -} - -void CUITaskRootItem::OnSwitchDescriptionClicked (CUIWindow*, void*) -{ - m_switchDescriptionBtn->SetButtonMode(m_EventsWnd->GetDescriptionMode() ? CUIButton::BUTTON_PUSHED : CUIButton::BUTTON_NORMAL); - - m_EventsWnd->SetDescriptionMode (!m_EventsWnd->GetDescriptionMode()); - OnItemClicked (this, NULL); -} - -void CUITaskRootItem::MarkSelected (bool b) -{ -} - - -CUITaskSubItem::CUITaskSubItem (CUIEventsWnd* w) -:inherited(w) -{ - Init(); -} - -CUITaskSubItem::~CUITaskSubItem () -{} - -void CUITaskSubItem::Init () -{ - inherited::Init (); - CUIXml& uiXml = m_EventsWnd->m_ui_task_item_xml; - - m_stateStatic = xr_new(); m_stateStatic->SetAutoDelete(true); AttachChild(m_stateStatic); - m_descriptionStatic = xr_new(); m_descriptionStatic->SetAutoDelete(true); AttachChild(m_descriptionStatic); - m_ActiveObjectiveStatic = xr_new(); m_ActiveObjectiveStatic->SetAutoDelete(true); AttachChild(m_ActiveObjectiveStatic); - m_showDescriptionBtn = xr_new(); m_showDescriptionBtn->SetAutoDelete(true); AttachChild(m_showDescriptionBtn); - - m_showDescriptionBtn->SetWindowName ("m_showDescriptionBtn"); - Register (m_showDescriptionBtn); - - AddCallback ("m_showDescriptionBtn",BUTTON_CLICKED,CUIWndCallback::void_function(this, &CUITaskSubItem::OnShowDescriptionClicked)); - - - CUIXmlInit xml_init; - xml_init.InitWindow (uiXml, "task_sub_item", 0, this); - xml_init.InitStatic (uiXml, "task_sub_item:state_image", 0, m_stateStatic); - xml_init.InitStatic (uiXml, "task_sub_item:description", 0, m_descriptionStatic); - xml_init.InitStatic (uiXml, "task_sub_item:active_objecttive_image", 0, m_ActiveObjectiveStatic); - xml_init.Init3tButton (uiXml, "task_sub_item:show_descr_btn", 0, m_showDescriptionBtn); - - - m_active_color = xml_init.GetColor(uiXml, "task_sub_item:description:text_colors:active", 0, 0x00); - m_failed_color = xml_init.GetColor(uiXml, "task_sub_item:description:text_colors:failed", 0, 0x00); - m_accomplished_color = xml_init.GetColor(uiXml, "task_sub_item:description:text_colors:accomplished",0, 0x00); -} - -void CUITaskSubItem::SetGameTask (CGameTask* gt, u16 obj_idx) -{ - inherited::SetGameTask (gt, obj_idx); - - CStringTable stbl; - SGameTaskObjective *obj = &m_GameTask->m_Objectives[m_TaskObjectiveIdx]; - - m_descriptionStatic->SetText (*stbl.translate(obj->description)); - m_descriptionStatic->AdjustHeightToText (); - float h = _max( m_ActiveObjectiveStatic->GetWndPos().y+m_ActiveObjectiveStatic->GetHeight(), - m_descriptionStatic->GetWndPos().y+ m_descriptionStatic->GetHeight()); - SetHeight (h); - switch (obj->TaskState()) - { -//. case eTaskUserDefined: - case eTaskStateInProgress: - m_stateStatic->InitTexture ("ui_icons_PDA_subtask_active"); - m_descriptionStatic->SetTextColor (m_active_color); - break; - case eTaskStateFail: - m_stateStatic->InitTexture ("ui_icons_PDA_subtask_failed"); - m_descriptionStatic->SetTextColor (m_failed_color); - break; - case eTaskStateCompleted: - m_stateStatic->InitTexture ("ui_icons_PDA_subtask_accomplished"); - m_descriptionStatic->SetTextColor (m_accomplished_color); - break; - default: - NODEFAULT; - }; -} - -void CUITaskSubItem::Update () -{ - inherited::Update (); - SGameTaskObjective *obj = &m_GameTask->m_Objectives[m_TaskObjectiveIdx]; - bool bIsActive = (Actor()->GameTaskManager().ActiveObjective() == obj); - m_ActiveObjectiveStatic->Show (bIsActive); - m_showDescriptionBtn->Show (m_EventsWnd->ItemHasDescription(this)); - -} - -bool CUITaskSubItem::OnDbClick() -{ - SGameTaskObjective *obj = &m_GameTask->m_Objectives[m_TaskObjectiveIdx]; - if(obj->TaskState()!=eTaskStateInProgress) return true; - - bool bIsActive = (Actor()->GameTaskManager().ActiveObjective() == obj); - Actor()->GameTaskManager().SetActiveTask((!bIsActive)?m_GameTask->m_ID:"", m_TaskObjectiveIdx); - return true; -} - -void CUITaskSubItem::OnActiveObjectiveClicked() -{ - m_EventsWnd->ShowDescription (GameTask(), ObjectiveIdx()); -} - -void CUITaskSubItem::OnShowDescriptionClicked (CUIWindow*, void*) -{ - m_EventsWnd->ShowDescription (GameTask(), ObjectiveIdx()); -} - -void CUITaskSubItem::MarkSelected (bool b) -{ - m_showDescriptionBtn->SetButtonMode (b ? CUIButton::BUTTON_PUSHED : CUIButton::BUTTON_NORMAL); -} - -/* -CUIUserTaskItem::CUIUserTaskItem(CUIEventsWnd* w) -:inherited(w) -{ - m_edtWnd = NULL; - Init(); -} - -CUIUserTaskItem::~CUIUserTaskItem () -{ - delete_data (m_edtWnd); -} - -void CUIUserTaskItem::Init () -{ - inherited::Init (); - CUIXml& uiXml = m_EventsWnd->m_ui_task_item_xml; - - m_image = xr_new(); m_image->SetAutoDelete(true); AttachChild(m_image); - - m_descriptionStatic = xr_new(); m_descriptionStatic->SetAutoDelete(true); AttachChild(m_descriptionStatic); - - m_captionStatic = xr_new(); m_captionStatic->SetAutoDelete(true); AttachChild(m_captionStatic); - - - m_showLocationBtn = xr_new(); m_showLocationBtn->SetAutoDelete(true); AttachChild(m_showLocationBtn); - m_showLocationBtn-> SetWindowName("m_showLocationBtn"); - Register (m_showLocationBtn); - AddCallback (m_showLocationBtn->WindowName(),BUTTON_CLICKED,boost::bind(&CUIUserTaskItem::OnShowLocationClicked,this)); - - m_showPointerBtn = xr_new(); m_showPointerBtn->SetAutoDelete(true); AttachChild(m_showPointerBtn); - m_showPointerBtn-> SetWindowName("m_showPointerBtn"); - Register (m_showPointerBtn); - AddCallback (m_showPointerBtn->WindowName(),BUTTON_CLICKED,boost::bind(&CUIUserTaskItem::OnShowPointerClicked,this)); - - - m_editTextBtn = xr_new(); m_editTextBtn->SetAutoDelete(true); AttachChild(m_editTextBtn); - m_editTextBtn-> SetWindowName("m_editTextBtn"); - Register (m_editTextBtn); - AddCallback (m_editTextBtn->WindowName(), BUTTON_CLICKED,boost::bind(&CUIUserTaskItem::OnEditTextClicked,this)); - - m_removeBtn = xr_new(); m_removeBtn->SetAutoDelete(true); AttachChild(m_removeBtn); - m_removeBtn-> SetWindowName("m_removeBtn"); - Register (m_removeBtn); - AddCallback (m_removeBtn->WindowName(), BUTTON_CLICKED,boost::bind(&CUIUserTaskItem::OnRemoveClicked,this)); - - - CUIXmlInit xml_init; - xml_init.InitWindow (uiXml,"task_user_item",0,this); - - xml_init.InitStatic (uiXml,"task_user_item:image",0,m_image); - xml_init.InitStatic (uiXml,"task_user_item:description",0,m_descriptionStatic); - xml_init.InitStatic (uiXml,"task_user_item:caption",0,m_captionStatic); - xml_init.Init3tButton (uiXml,"task_user_item:location_btn",0,m_showLocationBtn); - xml_init.Init3tButton (uiXml,"task_user_item:show_pointer_btn",0,m_showPointerBtn); - xml_init.Init3tButton (uiXml,"task_user_item:edit_text_btn",0,m_editTextBtn); - xml_init.Init3tButton (uiXml,"task_user_item:remove_btn",0,m_removeBtn); - -} - -void CUIUserTaskItem::Update () -{ - inherited::Update (); - SGameTaskObjective *obj = &m_GameTask->m_Objectives[m_TaskObjectiveIdx]; - CMapLocation* ml = obj->LinkedMapLocation(); - bool bHasLocation = (NULL != ml); - m_showPointerBtn->Show (bHasLocation && ml->SpotEnabled()); - if(bHasLocation) - { - bool bPointer = (Actor()->GameTaskManager().ActiveObjective() == obj); - m_showPointerBtn->SetButtonMode (bPointer ? CUIButton::BUTTON_PUSHED : CUIButton::BUTTON_NORMAL); -//. bool bShown = m_GameTask->ShownLocations(); - bool bShown = true; - m_showLocationBtn->SetButtonMode (bShown ? CUIButton::BUTTON_PUSHED : CUIButton::BUTTON_NORMAL); - } -} - -void CUIUserTaskItem::SetGameTask (CGameTask* gt, u16 obj_idx) -{ - inherited::SetGameTask (gt, obj_idx); - CStringTable stbl; - SGameTaskObjective *obj = &m_GameTask->m_Objectives[m_TaskObjectiveIdx]; - - m_image->InitTexture (*obj->icon_texture_name); - Frect r = obj->icon_rect; - m_image->SetOriginalRect (r.x1, r.y1, r.x2, r.y2); - m_image->ClipperOn (); - m_image->SetStretchTexture (true); - - m_captionStatic->SetText (*stbl.translate(gt->m_Title)); - m_captionStatic->AdjustHeightToText (); - - float h1 = _max( m_image->GetWndPos().y+m_image->GetHeight(), - m_captionStatic->GetWndPos().y + m_captionStatic->GetHeight() ); - m_descriptionStatic->SetWndPos (m_descriptionStatic->GetWndPos().x, h1+4.0f); - - m_descriptionStatic->SetText (*stbl.translate(obj->description)); - m_descriptionStatic->AdjustHeightToText (); - - float h = _max( m_image->GetWndPos().y+m_image->GetHeight(), - m_descriptionStatic->GetWndPos().y+ m_descriptionStatic->GetHeight()); - - SetHeight (h+10.0f); -} - -void CUIUserTaskItem::OnShowPointerClicked () -{ - bool bPushed = m_showPointerBtn->GetCheck(); - if(bPushed) - Actor()->GameTaskManager().SetActiveTask((bPushed)?m_GameTask->m_ID:"", m_TaskObjectiveIdx); -//. m_GameTask->HighlightSpotOnMap (m_TaskObjectiveIdx,bPushed); -} - -void CUIUserTaskItem::OnShowLocationClicked () -{ -//. bool bPushed = m_showLocationBtn->GetCheck (); -//. m_GameTask->ShowLocations (bPushed); -} - -void CUIUserTaskItem::MarkSelected (bool b) -{ -} - -void CUIUserTaskItem::OnDescriptionChanged () -{ - Objective()->description = m_descriptionStatic->GetText(); -} - -void CUIUserTaskItem::OnEditTextClicked () -{ - delete_data (m_edtWnd); - m_edtWnd = xr_new(this); - m_edtWnd->Start (); -} - -void CUIUserTaskItem::OnRemoveClicked () -{ - Level().MapManager().RemoveMapLocation(Objective()->LinkedMapLocation()); -} - - -CUIUserTaskEditWnd::CUIUserTaskEditWnd (CUIUserTaskItem* itm) -{ - m_userTask = itm; - Init(); -} - -void CUIUserTaskEditWnd::SendMessage (CUIWindow* pWnd, s16 msg, void* pData) -{ - CUIWndCallback::OnEvent(pWnd, msg, pData); -} - -void CUIUserTaskEditWnd::Start() -{ - CStringTable stbl; - -//. m_userTask = itm; - m_editCaption->SetText (*stbl.translate(m_userTask->GameTask()->m_Title)); - m_editDescription->SetText (*stbl.translate(m_userTask->Objective()->description)); - HUD().GetUI()->StartStopMenu (this,true); -} - -void CUIUserTaskEditWnd::OnOk () -{ - m_userTask->GameTask()->m_Title = m_editCaption->GetText(); - m_userTask->Objective()->description = m_editDescription->GetText(); - m_userTask->Objective()->LinkedMapLocation ()->SetHint(m_editDescription->GetText()); - m_userTask->m_EventsWnd->Reload (); - - GetHolder()->StartStopMenu (this, false); -} - -void CUIUserTaskEditWnd::OnCancel () -{ - GetHolder()->StartStopMenu(this, false); -} - -void CUIUserTaskEditWnd::Init () -{ - Hide (); - CUIXml& uiXml = m_userTask->m_EventsWnd->m_ui_task_item_xml; - - m_background = xr_new(); m_background->SetAutoDelete(true); - AttachChild (m_background); - - m_btnOk = xr_new(); m_btnOk->SetAutoDelete(true); m_background->AttachChild(m_btnOk); - m_btnOk->SetWindowName("m_btnOk"); - Register (m_btnOk); - AddCallback (m_btnOk->WindowName(),BUTTON_CLICKED,boost::bind(&CUIUserTaskEditWnd::OnOk,this)); - - m_btnCancel = xr_new(); m_btnCancel->SetAutoDelete(true); m_background->AttachChild(m_btnCancel); - m_btnCancel->SetWindowName("m_btnCancel"); - Register (m_btnCancel); - AddCallback (m_btnCancel->WindowName(),BUTTON_CLICKED,boost::bind(&CUIUserTaskEditWnd::OnCancel,this)); - - m_editCaption = xr_new(); m_editCaption->SetAutoDelete(true); m_background->AttachChild(m_editCaption); - m_editDescription = xr_new(); m_editDescription->SetAutoDelete(true); m_background->AttachChild(m_editDescription); - - - CUIXmlInit xml_init; - xml_init.InitWindow (uiXml,"edit_user_item",0, this); - xml_init.InitFrameWindow (uiXml,"edit_user_item:background",0, m_background); - xml_init.Init3tButton (uiXml,"edit_user_item:background:ok_btn",0, m_btnOk); - xml_init.Init3tButton (uiXml,"edit_user_item:background:cancel_btn",0, m_btnCancel); - xml_init.InitEditBox (uiXml,"edit_user_item:background:edit_caption",0, m_editCaption); - xml_init.InitEditBoxEx (uiXml,"edit_user_item:background:edit_description",0, m_editDescription); - -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UITaskItem.h b/src/xrGame/ui/UITaskItem.h deleted file mode 100644 index 65458e4b51d..00000000000 --- a/src/xrGame/ui/UITaskItem.h +++ /dev/null @@ -1,133 +0,0 @@ -#pragma once - -#error "deprecated" -/* -#include "UIDialogWnd.h" -#include "UIListItem.h" -#include "UIWndCallback.h" - -class CGameTask; -class CUIStatic; -class CUIButton; -class SGameTaskObjective; -class CUIEventsWnd; -class CUIEditBoxEx; -class CUIEditBox; - -class CUITaskItem :public CUIListItem, public CUIWndCallback -{ - typedef CUIListItem inherited; -protected: - CGameTask* m_GameTask; - u16 m_TaskObjectiveIdx; - void __stdcall OnItemClicked (CUIWindow*, void*); - void Init (); -public: - CUITaskItem (CUIEventsWnd* w); - virtual ~CUITaskItem (); - virtual void SendMessage (CUIWindow* pWnd, s16 msg, void* pData = NULL); - - virtual void SetGameTask (CGameTask* gt, u16 obj_idx); - - CGameTask* GameTask () {return m_GameTask;} - u16 ObjectiveIdx () {return m_TaskObjectiveIdx;} - SGameTaskObjective* Objective (); - - CUIEventsWnd* m_EventsWnd; -}; - -class CUITaskRootItem :public CUITaskItem -{ - typedef CUITaskItem inherited; -protected: - CUIStatic* m_taskImage; - CUIStatic* m_captionStatic; - CUIStatic* m_captionTime; - CUIStatic* m_remTimeStatic; - CUI3tButton* m_switchDescriptionBtn; - bool m_curr_descr_mode; - void Init (); -public: - CUITaskRootItem (CUIEventsWnd* w); - virtual ~CUITaskRootItem (); - virtual void Update (); - virtual void SetGameTask (CGameTask* gt, u16 obj_idx); - void __stdcall OnSwitchDescriptionClicked(CUIWindow*, void*); - - virtual void MarkSelected (bool b); - virtual bool OnDbClick (); -}; - -class CUITaskSubItem :public CUITaskItem -{ - typedef CUITaskItem inherited; - u32 m_active_color; - u32 m_failed_color; - u32 m_accomplished_color; -protected: - CUIStatic* m_ActiveObjectiveStatic; - CUI3tButton* m_showDescriptionBtn; - CUIStatic* m_descriptionStatic; - CUIStatic* m_stateStatic; - - void Init (); - -public: - CUITaskSubItem (CUIEventsWnd* w); - virtual ~CUITaskSubItem (); - virtual void Update (); - virtual void SetGameTask (CGameTask* gt, u16 obj_idx); - void OnActiveObjectiveClicked(); - void __stdcall OnShowDescriptionClicked(CUIWindow*, void*); - virtual void MarkSelected (bool b); - virtual bool OnDbClick (); -}; -/* -class CUIUserTaskEditWnd; -class CUIUserTaskItem :public CUITaskItem -{ - typedef CUITaskItem inherited; -protected: - CUI3tButton* m_showPointerBtn; - CUI3tButton* m_showLocationBtn; - CUI3tButton* m_editTextBtn; - CUI3tButton* m_removeBtn; - CUIStatic* m_captionStatic; - CUIStatic* m_descriptionStatic; - CUIStatic* m_image; - CUIUserTaskEditWnd* m_edtWnd; - void Init (); - -public: - CUIUserTaskItem (CUIEventsWnd* w); - virtual ~CUIUserTaskItem (); - virtual void Update (); - virtual void SetGameTask (CGameTask* gt, u16 obj_idx); - void OnShowLocationClicked (); - void OnShowPointerClicked (); - void OnDescriptionChanged (); - void OnEditTextClicked (); - void OnRemoveClicked (); - - virtual bool OnDbClick () {return true;}; - virtual void MarkSelected (bool b); -}; - -class CUIUserTaskEditWnd : public CUIDialogWnd, public CUIWndCallback -{ - CUIUserTaskItem* m_userTask; - CUI3tButton* m_btnOk; - CUI3tButton* m_btnCancel; - CUIFrameWindow* m_background; - - CUIEditBox* m_editCaption; - CUIEditBoxEx* m_editDescription; -protected: - void OnOk (); - void OnCancel (); - void Init (); -public: - CUIUserTaskEditWnd (CUIUserTaskItem* itm); - virtual void SendMessage (CUIWindow* pWnd, s16 msg, void* pData = NULL); - void Start (); -};*/ \ No newline at end of file diff --git a/src/xrGame/ui/UITaskWnd.cpp b/src/xrGame/ui/UITaskWnd.cpp index 8fb5e523acb..72fd30dd76e 100644 --- a/src/xrGame/ui/UITaskWnd.cpp +++ b/src/xrGame/ui/UITaskWnd.cpp @@ -10,16 +10,15 @@ #include "UIMapLegend.h" #include "UIHelper.h" #include "UIHint.h" - -#include "../gametask.h" -#include "../map_location.h" -#include "../map_location_defs.h" -#include "../map_manager.h" +#include "GameTask.h" +#include "map_location.h" +#include "map_location_defs.h" +#include "map_manager.h" #include "UIInventoryUtilities.h" -#include "../string_table.h" -#include "../level.h" -#include "../gametaskmanager.h" -#include "../actor.h" +#include "string_table.h" +#include "Level.h" +#include "GametaskManager.h" +#include "Actor.h" #include "UICheckButton.h" CUITaskWnd::CUITaskWnd() diff --git a/src/xrGame/ui/UITaskWnd.h b/src/xrGame/ui/UITaskWnd.h index 1a6863074a9..aea4594330c 100644 --- a/src/xrGame/ui/UITaskWnd.h +++ b/src/xrGame/ui/UITaskWnd.h @@ -1,8 +1,8 @@ #pragma once #include "UIWindow.h" #include "UIWndCallback.h" -#include "../../xrServerEntities/associative_vector.h" -#include "../GameTaskDefs.h" +#include "xrServerEntities/associative_vector.h" +#include "GameTaskDefs.h" #include "UICheckButton.h" class CUIMapWnd; diff --git a/src/xrGame/ui/UITextVote.cpp b/src/xrGame/ui/UITextVote.cpp index dd0cfdf30b0..30bc47c6b9d 100644 --- a/src/xrGame/ui/UITextVote.cpp +++ b/src/xrGame/ui/UITextVote.cpp @@ -5,14 +5,9 @@ #include "UIXmlInit.h" #include "UI3tButton.h" #include "UIEditboxEx.h" - -//#include "UIMapList.h" -#include "../level.h" -//#include "../game_cl_base.h" -#include "../game_cl_teamdeathmatch.h" -#include "../../xrEngine/xr_ioconsole.h" - - +#include "Level.h" +#include "game_cl_teamdeathmatch.h" +#include "xrEngine/xr_ioconsole.h" CUITextVote::CUITextVote(){ bkgrnd = xr_new(); bkgrnd->SetAutoDelete(true); diff --git a/src/xrGame/ui/UITextureMaster.cpp b/src/xrGame/ui/UITextureMaster.cpp index 66d9e0fece6..8eab0b193fd 100644 --- a/src/xrGame/ui/UITextureMaster.cpp +++ b/src/xrGame/ui/UITextureMaster.cpp @@ -13,7 +13,7 @@ #include "UIStaticItem.h" #include "uiabstract.h" #include "xrUIXmlParser.h" -#include "../Include/xrRender/UIShader.h" +#include "Include/xrRender/UIShader.h" xr_map CUITextureMaster::m_textures; xr_map CUITextureMaster::m_shaders; diff --git a/src/xrGame/ui/UITrackBar.cpp b/src/xrGame/ui/UITrackBar.cpp index 41eb9667837..ee3c40c3709 100644 --- a/src/xrGame/ui/UITrackBar.cpp +++ b/src/xrGame/ui/UITrackBar.cpp @@ -3,7 +3,7 @@ #include "UITrackBar.h" #include "UI3tButton.h" #include "UITextureMaster.h" -#include "../../xrEngine/xr_input.h" +#include "xrEngine/xr_input.h" #define DEF_CONTROL_HEIGHT 16.0f diff --git a/src/xrGame/ui/UITrackBar.h b/src/xrGame/ui/UITrackBar.h index 82ef0aea8ba..92b788ea553 100644 --- a/src/xrGame/ui/UITrackBar.h +++ b/src/xrGame/ui/UITrackBar.h @@ -4,11 +4,9 @@ #include "UI_IB_Static.h" class CUI3tButton; -class CUITrackButton; class CUITrackBar : public CUI_IB_FrameLineWnd, public CUIOptionsItem { - friend class CUITrackButton; public: CUITrackBar (); // CUIOptionsItem diff --git a/src/xrGame/ui/UITrackButton.cpp b/src/xrGame/ui/UITrackButton.cpp deleted file mode 100644 index dfddfeda6fb..00000000000 --- a/src/xrGame/ui/UITrackButton.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include "stdafx.h" -/* -#include "UITrackButton.h" -#include "UITrackBar.h" -#include "../../xr_input.h" - -bool CUITrackButton::OnMouseAction(float x, float y, EUIMessages mouse_action){ - CUI3tButton::OnMouseAction(x,y,mouse_action); - - if (false && m_bCursorOverWindow) - { - if (pInput->iGetAsyncBtnState(0)) - m_pOwner->UpdatePosRelativeToMouse(); - } - return false; -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UITrackButton.h b/src/xrGame/ui/UITrackButton.h deleted file mode 100644 index 778bbd2412f..00000000000 --- a/src/xrGame/ui/UITrackButton.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once -/* -#include "UI3tButton.h" - -class CUITrackBar; - -class CUITrackButton : public CUI3tButton -{ -public: - virtual bool OnMouseAction (float x, float y, EUIMessages mouse_action); - void SetOwner (CUITrackBar* owner) {m_pOwner = owner;}; - - CUITrackBar* m_pOwner; -}; -*/ \ No newline at end of file diff --git a/src/xrGame/ui/UITreeViewItem.cpp b/src/xrGame/ui/UITreeViewItem.cpp deleted file mode 100644 index 7b2c9bcef98..00000000000 --- a/src/xrGame/ui/UITreeViewItem.cpp +++ /dev/null @@ -1,589 +0,0 @@ -//============================================================================= -// Filename: UITreeViewItem.cpp -// Created by Roman E. Marchenko, vortex@gsc-game.kiev.ua -// Copyright 2004. GSC Game World -// --------------------------------------------------------------------------- -// TreeView Item class -//============================================================================= - -#include "stdafx.h" -#include "UITreeViewItem.h" -//#include "UIListWnd.h" -#include "../string_table.h" - - -#define UNREAD_COLOR 0xff00ff00 -#define READ_COLOR 0xffffffff - -////////////////////////////////////////////////////////////////////////// - -// Ñìåùåíèå îòíîñèòåëüíî ðîäèòåëÿ -const int subShift = 1; -const char * const treeItemBackgroundTexture = "ui\\ui_pda_over_list"; -// Öâåò íåïðî÷èòàííîãî ýëåìåíòà -static const u32 unreadColor = 0xff00ff00; - -////////////////////////////////////////////////////////////////////////// - -CUITreeViewItem::CUITreeViewItem() - : isRoot (false), - isOpened (false), - iTextShift (0), - pOwner (NULL), - m_uUnreadedColor (UNREAD_COLOR), - m_uReadedColor (READ_COLOR) -{ - AttachChild(&UIBkg); - UIBkg.InitTexture(treeItemBackgroundTexture); - UIBkg.TextureOff(); - UIBkg.SetTextureOffset(-20, 0); - UIBkg.EnableTextHighlighting(false); - - m_bManualSetColor = false; -} - -////////////////////////////////////////////////////////////////////////// - -CUITreeViewItem::~CUITreeViewItem() -{ - DeleteAllSubItems(); -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::OnRootChanged() -{ - xr_string str; - if (isRoot) - { - // Âñòàâëÿåì ïîñëå ïîñëåäíåãî ïðîáåëà ïåðåä òåêñòîì çíàê + èëè - - str = GetText(GetSelectedIDX()); - - xr_string::size_type pos = str.find_first_not_of(" "); - if (xr_string::npos == pos) pos = 0; - - if (pos == 0) - { - ++iTextShift; - str.insert(0, " "); - } - else - --pos; - - if (isOpened) - // Add minus sign - str.replace(pos, 1, "-"); - else - // Add plus sign - str.replace(pos, 1, "+"); - -// inherited::SetText(str.c_str()); - GetSelectedItem()->m_text.SetText(str.c_str()); - } - else - { - str = GetText(GetSelectedIDX()); - // Remove "+/-" sign - xr_string::size_type pos = str.find_first_of("+-"); - - if (pos == 0) - { - for (int i = 0; i < iTextShift; ++i) - str.insert(pos, " "); - } - else - str.replace(pos, 1, " "); - -// inherited::SetText(str.c_str()); - GetSelectedItem()->m_text.SetText(str.c_str()); - } -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::OnOpenClose() -{ - // Åñëè ìû íå ÿâëÿåìñÿ óçëîì äåðåâà, çíà÷èò íè÷åãî íå äåëàåì - if (!isRoot) return; - - xr_string str; - - str = GetText(GetSelectedIDX()); - xr_string::size_type pos = str.find_first_of("+-"); - - if (xr_string::npos != pos) - { - if (isOpened) - // Change minus sign to plus - str.replace(pos, 1, "-"); - else - // Change plus sign to minus - str.replace(pos, 1, "+"); - } - -// inherited::SetText(str.c_str()); - GetSelectedItem()->m_text.SetText(str.c_str()); -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::Open() -{ - // Åñëè íå ðóò èëè óæå îòêðûòû, òî íè÷åãî íå äåëàåì - if (!isRoot || isOpened) return; - isOpened = true; - - // Èçìåíÿåì ñîñòîÿíèå - OnOpenClose(); - - // Àòòà÷èì âñå ïîäýëåìåíòû ê ðîäòåëüñêîìó ëèñòáîêñó -// CUIListWnd *pList = smart_cast(GetParent()); - CUIListBox *pList = smart_cast(GetParent()); - - R_ASSERT(pList); - if (!pList) return; - -// int pos = pList->GetItemPos(this); - - for (SubItems_it it = vSubItems.begin(); it != vSubItems.end(); ++it) - { -// pList->AddItem(*it, ++pos); - pList->AddWindow(*it, true); - } -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::Close() -{ - // Åñëè íå ðóò èëè óæå îòêðûòû, òî íè÷åãî íå äåëàåì - if (!isRoot || !isOpened) return; - isOpened = false; - - // Èçìåíÿåì ñîñòîÿíèå - OnOpenClose(); - - // Äåòà÷èì âñå ïîäýëåìåíòû -// CUIListWnd *pList = smart_cast(GetParent()); - CUIListBox *pList = smart_cast(GetParent()); - - R_ASSERT(pList); - if (!pList) return; - -// int pos; - - // Ñíà÷àëà âñå çàêðûòü - for (SubItems_it it = vSubItems.begin(); it != vSubItems.end(); ++it) - { - (*it)->Close(); - } - - // Çàòåì âñå äàòà÷èì - for (SubItems_it it = vSubItems.begin(); it != vSubItems.end(); ++it) - { -// pos = pList->GetItemPos(*it); -// pList->RemoveItem(pos); - pList->RemoveWindow(*it); - } -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::AddItem(CUITreeViewItem *pItem) -{ - R_ASSERT(pItem); - if (!pItem) return; - - pItem->SetTextShift(subShift + iTextShift); - - vSubItems.push_back(pItem); - pItem->SetAutoDelete(false); - - pItem->SetOwner(this); -// pItem->SetText(pItem->GetText()); - pItem->SetText(pItem->GetSelectedText()); -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::DeleteAllSubItems() -{ - for (SubItems_it it = vSubItems.begin(); it != vSubItems.end(); ++it) - { - CUIWindow *pWindow = (*it)->GetParent(); - - if (pWindow) - pWindow->DetachChild(*it); - - xr_delete(*it); - } - - vSubItems.clear(); -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::SetRoot(bool set) -{ - if (isRoot) return; - - isRoot = set; - OnRootChanged(); -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::SetText(LPCSTR str) -{ - xr_string s = str; - xr_string::size_type pos = s.find_first_not_of(" +-"); - - if (pos < static_cast(iTextShift)) - { - for (u32 i = 0; i < iTextShift - pos; ++i) - s.insert(0, " "); - } - else if (pos > static_cast(iTextShift)) - { - s.erase(0, pos - iTextShift); - } - -// inherited::SetText(s.c_str()); - GetSelectedItem()->m_text.SetText(s.c_str()); -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::SendMessage(CUIWindow* pWnd, s16 msg, void* pData) -{ - static CUITreeViewItem *pPrevFocusedItem = NULL; - - if (pWnd == this && BUTTON_CLICKED == msg) - { - if (IsRoot()) - { - IsOpened() ? Close() : Open(); - } - else - { - MarkArticleAsRead(true); - } - } - else if (pWnd == this && STATIC_FOCUS_RECEIVED == msg) - { - UIBkg.TextureOn(); - - if (pPrevFocusedItem) - { - pPrevFocusedItem->UIBkg.TextureOff(); - } - pPrevFocusedItem = this; - } - else if (pWnd == this && STATIC_FOCUS_LOST == msg) - { - UIBkg.TextureOff(); - pPrevFocusedItem = NULL; - } - else - inherited::SendMessage(pWnd, msg, pData); -} - -////////////////////////////////////////////////////////////////////////// - -CUITreeViewItem * CUITreeViewItem::Find(LPCSTR text) const -{ - // Ïðîáåãàåìñÿ ïî ñïèñêó ïîä÷èíåííûõ ýëåìåíòîâ, è èùåì ýëåìåíò ñ çàäàííûì òåêñòîì - // Åñëè ñðåäè ïîä÷. ýë-òîâ åñòü root'û, òî èùåì ðåêóðñèâíî â íèõ - CUITreeViewItem *pResult = NULL; - xr_string caption; - - for (SubItems::const_iterator it = vSubItems.begin(); it != vSubItems.end(); ++it) - { -// caption = (*it)->GetText(); - caption = (*it)->GetSelectedText(); - xr_string::size_type pos = caption.find_first_not_of(" +-"); - if (pos != xr_string::npos) - { - caption.erase(0, pos); - } - - if (xr_strcmp(caption.c_str(), text) == 0) - pResult = *it; - - if ((*it)->IsRoot() && !pResult) - pResult = (*it)->Find(text); - - if (pResult) break; - } - - return pResult; -} - -////////////////////////////////////////////////////////////////////////// - -CUITreeViewItem * CUITreeViewItem::Find(int value) const -{ - CUITreeViewItem *pResult = NULL; - - for (SubItems::const_iterator it = vSubItems.begin(); it != vSubItems.end(); ++it) - { -// if ((*it)->GetValue() == value) pResult = *it; - if ((*it)->GetSelectedItem()->GetTAG() == (u32)value) pResult = *it; - - if ((*it)->IsRoot() && !pResult) - pResult = (*it)->Find(value); - - if (pResult) break; - } - - return pResult; -} - -////////////////////////////////////////////////////////////////////////// - -CUITreeViewItem * CUITreeViewItem::Find(CUITreeViewItem * pItem) const -{ - CUITreeViewItem *pResult = NULL; - - for (SubItems::const_iterator it = vSubItems.begin(); it != vSubItems.end(); ++it) - { - if ((*it)->IsRoot() && !pResult) - pResult = (*it)->Find(pItem); - else - if (pItem == *it) pResult = *it; - - if (pResult) break; - } - - return pResult; -} - -////////////////////////////////////////////////////////////////////////// - -xr_string CUITreeViewItem::GetHierarchyAsText() -{ - xr_string name; - - if (GetOwner()) - { - name = GetOwner()->GetHierarchyAsText(); - } - - xr_string::size_type prevPos = name.size() + 1; -// name += static_cast("/") + static_cast(GetText()); - name += static_cast("/") + static_cast(GetSelectedText()); - - // Óäàëÿåì ìóñîð: [ +-] - xr_string::size_type pos = name.find_first_not_of("/ +-", prevPos); - if (xr_string::npos != pos) - { - name.erase(prevPos, pos - prevPos); - } - - return name; -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::MarkArticleAsRead(bool value) -{ - // Åñëè ýëåìåíò ðóòîâûé, òî ìû åãî ìàðêàåì åãî, è âñå ÷èëäû - if (IsRoot()) - { - m_bArticleRead = value; - if(!m_bManualSetColor) - SetItemColor(); - - for (SubItems_it it = vSubItems.begin(); it != vSubItems.end(); ++it) - { - (*it)->m_bArticleRead = value; - (*it)->SetItemColor(); - if ((*it)->IsRoot()) - (*it)->MarkArticleAsRead(value); - } - } - else - { - // Åñëè æå íåò, òî ìàðêàåì ñåáÿ è ãîâîðèì ïðîâåðèòü ñâîé ïàðåíòîâûé ýëåìåíò - m_bArticleRead = value; - if(!m_bManualSetColor) - SetItemColor(); - CheckParentMark(GetOwner()); - } -} - -////////////////////////////////////////////////////////////////////////// - -void CUITreeViewItem::CheckParentMark(CUITreeViewItem *pOwner) -{ - // Áåðåì ðóòà, ñìîòðèì íà åãî ÷èëäîâ, è åñëè ñðåäè íèõ åñòü õîòü 1 - // íåïðî÷èòàííûé, òî ìàðêàåì ñåáÿ êàê íåïðî÷èòàííûé, è ãîâîðèì ïðîâåðèòüñÿ âûøå. - bool f = false; - if (pOwner && pOwner->IsRoot()) - { - for (SubItems_it it = pOwner->vSubItems.begin(); it != pOwner->vSubItems.end(); ++it) - { - if (!(*it)->IsArticleReaded()) - { - pOwner->m_bArticleRead = false; - pOwner->SetItemColor(); - f = true; - } - } - - if (!f) - { - // Åñëè ìû òóò, òî âñå àðòèêëû ïðî÷èòàííû, è ìîæíî ìàðêíóòü ñåáÿ êàê ïðî÷èòàííàÿ âåòâü - pOwner->m_bArticleRead = true; - pOwner->SetItemColor(); - } - - pOwner->CheckParentMark(pOwner->GetOwner()); - } -} - -////////////////////////////////////////////////////////////////////////// -// Standalone function for tree hierarchy creation -////////////////////////////////////////////////////////////////////////// - -void CreateTreeBranch(shared_str nesting, shared_str leafName, CUIListBox *pListToAdd, int leafProperty, - CGameFont *pRootFont, u32 rootColor, CGameFont *pLeafFont, u32 leafColor, bool markRead) -{ - // Nested function emulation - class AddTreeTail_ - { - private: - CGameFont *pRootFnt; - u32 rootItemColor; - public: - AddTreeTail_(CGameFont *f, u32 cl) - : pRootFnt (f), - rootItemColor (cl) - {} - - CUITreeViewItem * operator () (GroupTree_it it, GroupTree &cont, CUITreeViewItem *pItemToIns) - { - // Âñòàâëÿåì èåðàðõèþ ðàçäåëîâ â ýíöèêëîïåäèþ - CUITreeViewItem *pNewItem = NULL; - - for (GroupTree_it it2 = it; it2 != cont.end(); ++it2) - { - pNewItem = xr_new(); - pItemToIns->AddItem(pNewItem); - pNewItem->SetFont(pRootFnt); - pNewItem->SetText(*(*it2)); - pNewItem->SetReadedColor(rootItemColor); - pNewItem->SetRoot(true); - pItemToIns = pNewItem; - } - - return pNewItem; - } - } AddTreeTail(pRootFont, rootColor); - - //----------------------------------------------------------------------------- - // Function body - //----------------------------------------------------------------------------- - - // Íà÷èíàåì àëãîðèòì îïðåäåëåíèÿ ãðóïïû âåùè â èåðàðõèè ýíöèêëîïåäèè - R_ASSERT(*nesting); - R_ASSERT(pListToAdd); - R_ASSERT(pLeafFont); - R_ASSERT(pRootFont); - xr_string group = *nesting; - - // Ïàðñèì ñòðîêó ãðóïïû äëÿ îïðåäåëåíèÿ âëîæåííîñòè - GroupTree groupTree; - - xr_string::size_type pos; - xr_string oneLevel; - - while (true) - { - pos = group.find('/'); - if (pos != xr_string::npos) - { - oneLevel.assign(group, 0, pos); - shared_str str(oneLevel.c_str()); - groupTree.push_back(CStringTable().translate(str)); - group.erase(0, pos + 1); - } - else - { - groupTree.push_back(CStringTable().translate(group.c_str())); - break; - } - } - - // Òåïåðü èùåì íåò ëè çàòðåáîâàííûõ ãðóïï óæå â íàëè÷èè - CUITreeViewItem *pTVItem = NULL, *pTVItemChilds = NULL; - bool status = false; - - // Äëÿ âñåõ ðóòîâûõ ýëåìåíòîâ -// for (int i = 0; i < pListToAdd->GetItemsCount(); ++i) - for (u32 i = 0; i < pListToAdd->GetSize(); ++i) - { - pTVItem = smart_cast(pListToAdd->GetItem(i)); - R_ASSERT(pTVItem); - - pTVItem->Close(); - -// xr_string caption = pTVItem->GetText(); - xr_string caption = pTVItem->GetText(i); - // Remove "+" sign - caption.erase(0, 1); - - // Èùåì íå ñîäåðæèò ëè îí äàííîé èåðàðõèè è äîáàâëÿåì íîâûå ýëåìåíòû åñëè íå íàéäåíî - if (0 == xr_strcmp(caption.c_str(), *groupTree.front())) - { - // Óæå ñîäåðæèò. Íàäî èñêàòü ãëóáæå - pTVItemChilds = pTVItem; - for (GroupTree_it it = groupTree.begin() + 1; it != groupTree.end(); ++it) - { - pTVItem = pTVItemChilds->Find(*(*it)); - // Íå íàøëè, íàäî âñòàâëÿòü õâîñò ñïèñêà âëîæåííîñòè - if (!pTVItem) - { - pTVItemChilds = AddTreeTail(it, groupTree, pTVItemChilds); - status = true; - break; - } - pTVItemChilds = pTVItem; - } - } - - if (status) break; - } - - // Ïðîøëè âñå ñóùåñòâóþùåå äåðåâî, è íå íàøëè? Òîãäà äîáàâëÿåì íîâóþ èåðàðõèþ - if (!pTVItemChilds) - { - pTVItemChilds = xr_new(); - pTVItemChilds->SetFont(pRootFont); - pTVItemChilds->SetText(*groupTree.front()); - pTVItemChilds->SetReadedColor(rootColor); - pTVItemChilds->SetRoot(true); -// pListToAdd->AddItem(pTVItemChilds); - pListToAdd->AddWindow(pTVItemChilds, true); - - // Åñëè â ñïèñêå âëîæåííîñòè 1 ýëåìåíò, òî õâîñòà íåò, è ñîîòâåòñòâåííî íè÷åãî íå äîáàâëÿåì - if (groupTree.size() > 1) - pTVItemChilds = AddTreeTail(groupTree.begin() + 1, groupTree, pTVItemChilds); - } - - // Ê ýòîìó ìîìåíòó pTVItemChilds îáÿçàòåëüíî äîëæíà áûòü íå NULL - R_ASSERT(pTVItemChilds); - - // Cíà÷àëà ïðîâåðÿåì íåò ëè çàïèñè ñ òàêèì íàçâàíèåì, è äîáàâëÿåì åñëè íåò - // if (!pTVItemChilds->Find(*name)) - // { - pTVItem = xr_new(); - pTVItem->SetFont(pLeafFont); - pTVItem->SetReadedColor(leafColor); - pTVItem->SetText(*CStringTable().translate(*leafName)); -// pTVItem->SetValue(leafProperty); - pTVItem->SetSelectedTAG(leafProperty); - pTVItemChilds->AddItem(pTVItem); - pTVItem->MarkArticleAsRead(markRead); - // } -} \ No newline at end of file diff --git a/src/xrGame/ui/UITreeViewItem.h b/src/xrGame/ui/UITreeViewItem.h deleted file mode 100644 index 0dcb72249e8..00000000000 --- a/src/xrGame/ui/UITreeViewItem.h +++ /dev/null @@ -1,128 +0,0 @@ -//============================================================================= -// Filename: UITreeViewItem.h -// Created by Roman E. Marchenko, vortex@gsc-game.kiev.ua -// Copyright 2004. GSC Game World -// --------------------------------------------------------------------------- -// TreeView Item class -//============================================================================= - -#ifndef UI_TREE_VIEW_ITEM_H_ -#define UI_TREE_VIEW_ITEM_H_ - -#pragma once - -#include "UIListBox.h" -#include "UIListBoxItem.h" -#include "UIStatic.h" - -class CUITreeViewItem: public CUIListBox -{ - typedef CUIListBox inherited; - // ßâëÿåìñÿ ëè ìû íà÷àëîì ïîäûåðàðõèè - bool isRoot; - // Åñëè ìû ðóò, òî ýòîò ôëàã ïîêàçûâàåò îòêðûòà íàøà ïîäûåðàðõèÿ èëè íåò - bool isOpened; - // Ñìåùåíèå â ïðîáåëàõ - int iTextShift; - // Êîìó ìû ïðåíàäëåæèì - CUITreeViewItem *pOwner; -public: - void SetRoot(bool set); - bool IsRoot() const { return isRoot; } - - // Óñòàíàâëèâàåì ñìåùåíèå òåêñòà - void SetTextShift(int delta) { iTextShift += delta; } - - // Âëàäåëåö - CUITreeViewItem * GetOwner() const { return pOwner; } - void SetOwner(CUITreeViewItem *owner) { pOwner = owner; } -protected: - // Ôóíêöèÿ âûçûâàåìàÿ ïðè èçìåíåíèè ñâîéñòâà ðóòà - // äëÿ èçìåíåíèÿ âèçóàëüíîãî ïðåäñòàâëåíèÿ ñåáÿ - virtual void OnRootChanged(); -public: - // Ðàêñðûòü/ñâåðíóòü ëîêàëüíöþ èåðàðõèþ - void Open(); - void Close(); - bool IsOpened() const { return isOpened; } -protected: - // Ôóíêöèÿ âûçûâàåìàÿ ïðè èçìåíåíèè cîñòîÿíèÿ îòêðûòî/çàêðûòî - // äëÿ èçìåíåíèÿ âèçóàëüíîãî ïðåäñòàâëåíèÿ ñåáÿ - virtual void OnOpenClose(); -public: - - // Ñïèñîê ýëåìåíòîâ, êîòîðûå óðîâíåì íèæå íàñ - typedef xr_vector SubItems; - typedef SubItems::iterator SubItems_it; - SubItems vSubItems; - - CUIStatic UIBkg; - - // Äîáàâèòü ýëåìåíò - void AddItem(CUITreeViewItem *pItem); - // Óäàëèòü âñå - void DeleteAllSubItems(); - // Íàéòè ýëåìåíò ñ çàäàííûì èìåíåì - // Return: óêàçàòåëü íà ýëåìåíò, åñëè íàøëè, ëèáî NULL â ïðîòèâíîì ñëó÷àå - CUITreeViewItem * Find(LPCSTR text) const; - // Íàéòè ýëåìåíò ñ çàäàííûì çíà÷åíèåì - // Return: óêàçàòåëü íà ýëåìåíò, åñëè íàøëè, ëèáî NULL â ïðîòèâíîì ñëó÷àå - CUITreeViewItem * Find(int value) const; - // Íàéòè çàäàííûé ýëåìåíò - // Return: óêàçàòåëü íà ýëåìåíò, åñëè íàøëè, ëèáî NULL â ïðîòèâíîì ñëó÷àå - CUITreeViewItem * Find(CUITreeViewItem *pItem) const; - // Âåðíóòü èåðàðõèþ îò âåðõà äî òåêóùåãî ýëåìåíòà â âèäå ñòðîêè-ïóòè - // Ðóòîâûå ýëåìåíòû çàêàí÷èâàþòñÿ ñèìâîëîì "/" - xr_string GetHierarchyAsText(); - - // Redefine some stuff - // ATTENTION! Äëÿ êîððåêòíîãî ôóíêöèîíèðîâàíèÿ çíà÷êîâ [+-] âûçîâ SetText - // Äîëæåí ïðåäøåñòâîâàòü SetRoot - virtual void SetText(LPCSTR str); - virtual void SendMessage(CUIWindow* pWnd, s16 msg, void* pData); - - // Ctor and Dtor - CUITreeViewItem(); - virtual ~CUITreeViewItem(); - - // Óñòàíàâëèâàåì öâåò òåêñòà â çàâèñèìîñòè îò òîãî, ïðî÷èòàí ëè àðòèêë - void MarkArticleAsRead(bool value); - bool IsArticleReaded() { return m_bArticleRead; } - // Öâåò òåêñòà êîãäà àðòèêë íå ïðî÷èòàí è íå ïðî÷èòàí - void SetReadedColor(u32 cl) { m_uReadedColor = cl; } - void SetUnreadedColor(u32 cl) { m_uUnreadedColor = cl; } - void SetManualSetColor(bool val) { m_bManualSetColor = val; } - // Óñòàíàâëèâàåì öâåò â çàâèñèìîñòè îò ñîñòîÿíèÿ ýëåìåíòà - void SetItemColor() - { - m_bArticleRead ? SetTextColor(m_uReadedColor) :SetTextColor(m_uUnreadedColor); - } - -private: - friend class CUITreeViewItem; - - // Ïðèìåíèòü ñîñòîÿíèå ââåðõ ïî èåðàðõèè - void CheckParentMark(CUITreeViewItem *pOwner); - // Öâåò òåêñòà êîãäà àðòèêë íå ïðî÷èòàí - u32 m_uUnreadedColor; - // Öâåò òåêñòà êîãäà àðòèêë íå ïðî÷èòàí - u32 m_uReadedColor; - // Ôëàæåê ñîñòîÿíèÿ ïðî÷èòêè - bool m_bArticleRead; - // Åñëè true, òî MarkArticleAsRead íå áóäåò âûçûâàòü - // SetItemColor() - bool m_bManualSetColor; -}; - -////////////////////////////////////////////////////////////////////////// -// Function for automatic tree hierarchy creation -////////////////////////////////////////////////////////////////////////// - -DEF_VECTOR(GroupTree, shared_str); - -////////////////////////////////////////////////////////////////////////// - -void CreateTreeBranch(shared_str nestingTree, shared_str leafName, CUIListBox *pListToAdd, int leafProperty, - CGameFont *pRootFont, u32 rootColor, CGameFont *pLeafFont, u32 leafColor, bool markRead); - -#endif //UI_TREE_VIEW_ITEM_H_ \ No newline at end of file diff --git a/src/xrGame/ui/UIVideoPlayerWnd.cpp b/src/xrGame/ui/UIVideoPlayerWnd.cpp deleted file mode 100644 index 0f527f45b8a..00000000000 --- a/src/xrGame/ui/UIVideoPlayerWnd.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include "stdafx.h" -#include "UIVideoPlayerWnd.h" -#include "UITabControl.h" -#include "UIStatic.h" -#include "UIXmlInit.h" -#include "../level.h" -#include "../hudmanager.h" -#include - -void CUIVideoPlayerWnd::SendMessage (CUIWindow* pWnd, s16 msg, void* pData) -{ - CUIWndCallback::OnEvent (pWnd, msg, pData); -} - -void CUIVideoPlayerWnd::Init (LPCSTR file_name) -{ - CUIXml uiXml; - bool xml_result = uiXml.Init(CONFIG_PATH, UI_PATH, "video_templ.xml"); - R_ASSERT3 (xml_result, "xml file not found", "video_templ.xml"); - Init (&uiXml,"video_player"); - SetFile (file_name); -} - -void CUIVideoPlayerWnd::Init (CUIXml* doc, LPCSTR start_from) -{ - m_flags.zero (); - CUIXmlInit xml_init; - string512 str; - strcpy (str,start_from); - xml_init.InitWindow (*doc, str, 0, this); - - - strconcat (sizeof(str),str,start_from,":surface"); - m_surface = xr_new(); m_surface->SetAutoDelete(true); - AttachChild (m_surface); - xml_init.InitStatic (*doc, str, 0, m_surface); - - strconcat (sizeof(str),str,start_from,":buttons_tab"); - m_tabControl = xr_new(); m_tabControl->SetAutoDelete(true); - AttachChild (m_tabControl); - xml_init.InitTabControl (*doc, str, 0, m_tabControl); - m_tabControl->SetWindowName ("buttons_tab"); - Register (m_tabControl); - - - AddCallback ("buttons_tab", TAB_CHANGED, CUIWndCallback::void_function(this, &CUIVideoPlayerWnd::OnTabChanged) ); -//. AddCallback ("buttons_tab",TAB_CHANGED,boost::bind(&CUIVideoPlayerWnd::OnTabChanged,this,_1,_2)); - - int flag =doc->ReadAttribInt(start_from, 0, "looped", 0); - m_flags.set (eLooped, flag?true:false); - - SetFile ( doc->ReadAttrib(start_from, 0, "file", 0) ); - Hide (); -} - -void CUIVideoPlayerWnd::SetFile (LPCSTR fn) -{ - m_fn = fn; - if(fn && fn[0]){ - VERIFY(!m_surface->GetShader()); - m_surface->InitTexture (fn); - - if(FS.exist("$game_sounds$",fn)) - ::Sound->create(m_sound, fn,st_Effect,sg_SourceType); - } -} - -void CUIVideoPlayerWnd::Draw () -{ - inherited::Draw (); - if(!m_texture && m_surface->GetShader()){ - RCache.set_Shader (m_surface->GetShader()); - m_texture = RCache.get_ActiveTexture (0); - m_texture->video_Stop (); - } -} - -void CUIVideoPlayerWnd::Update () -{ - inherited::Update (); - - if(m_flags.test(ePlaying) && m_texture && !m_texture->video_IsPlaying()){ - m_texture->video_Play (m_flags.test(eLooped)); - m_flags.set (ePlaying,FALSE); - }; - if(m_flags.test(eStoping) && m_texture && m_texture->video_IsPlaying()){ - m_texture->video_Stop (); - m_flags.set (eStoping,FALSE); - }; -} - -void CUIVideoPlayerWnd::OnTabChanged (CUIWindow* pWnd, void* pData) -{ - if(m_tabControl->GetCommandName( m_tabControl->GetActiveIndex())=="play_btn" ){ - Play (); - }else - if(m_tabControl->GetCommandName( m_tabControl->GetActiveIndex())=="stop_btn" ){ - Stop (); - } -} - -void CUIVideoPlayerWnd::Play () -{ - if (m_sound._handle()) - m_sound.play(NULL, sm_2D); - - if(m_texture){ - if(!m_texture->video_IsPlaying()) - m_texture->video_Play (m_flags.test(eLooped)); - }else - m_flags.set(ePlaying, TRUE);//deffered -} - -void CUIVideoPlayerWnd::Stop () -{ - if (m_sound._handle()) - m_sound.stop(); - - if(m_texture){ - if(m_texture->video_IsPlaying()) - m_texture->video_Stop (); - }else - m_flags.set(eStoping, TRUE);//deffered -} - -bool CUIVideoPlayerWnd::IsPlaying () -{ - return m_texture && m_texture->video_IsPlaying(); -} - -void CUIActorSleepVideoPlayer::Activate () -{ - if(!IsShown()) - HUD().GetUI()->StartStopMenu (this,true); -} - -void CUIActorSleepVideoPlayer::DeActivate () -{ - if(IsShown()){ - Stop (); - HUD().GetUI()->StartStopMenu (this,true); - } -} - -bool CUIActorSleepVideoPlayer::OnKeyboard(int dik, EUIMessages keyboard_action) -{ - if(keyboard_action==WINDOW_KEY_PRESSED){ - if(dik==DIK_ESCAPE){ - DeActivate (); - return true; - } - } - return inherited::OnKeyboard(dik, keyboard_action); -} diff --git a/src/xrGame/ui/UIVideoPlayerWnd.h b/src/xrGame/ui/UIVideoPlayerWnd.h deleted file mode 100644 index f05c9c5d8ff..00000000000 --- a/src/xrGame/ui/UIVideoPlayerWnd.h +++ /dev/null @@ -1,45 +0,0 @@ -#pragma once -#include "UIDialogWnd.h" -#include "UIWndCallback.h" - -class CUITabControl; -class CUIStatic; -class CUIXml; - -class CUIVideoPlayerWnd :public CUIDialogWnd, public CUIWndCallback -{ - typedef CUIDialogWnd inherited; - CUITabControl* m_tabControl; - CUIStatic* m_surface; -protected: - ref_sound m_sound; -// Igor ref_texture m_texture; - shared_str m_fn; - Flags8 m_flags; - enum {eStoping=(1<<0),ePlaying=(1<<1),eLooped=(1<<2)}; -private: - void OnBtnPlayClicked (); - void OnBtnPauseClicked (); - void __stdcall OnTabChanged (CUIWindow* pWnd, void* pData); -public: - void Init (CUIXml* doc, LPCSTR start_from); - void Init (LPCSTR name); - virtual void SendMessage (CUIWindow* pWnd, s16 msg, void* pData); - void SetFile (LPCSTR fn); - - virtual void Draw (); - virtual void Update (); - void Play (); - void Stop (); - bool IsPlaying (); -}; - -class CUIActorSleepVideoPlayer : public CUIVideoPlayerWnd -{ - typedef CUIVideoPlayerWnd inherited; -public: - void Activate (); - void DeActivate (); - virtual bool NeedCursor () const {return false;} - virtual bool OnKeyboard (int dik, EUIMessages keyboard_action); -}; \ No newline at end of file diff --git a/src/xrGame/ui/UIVote.cpp b/src/xrGame/ui/UIVote.cpp index 0f3370684dc..5579ed0b4c9 100644 --- a/src/xrGame/ui/UIVote.cpp +++ b/src/xrGame/ui/UIVote.cpp @@ -5,10 +5,10 @@ #include "UIListBox.h" #include "UIFrameWindow.h" #include "UIXmlInit.h" -#include "../level.h" -#include "../game_cl_base.h" -#include "../game_cl_teamdeathmatch.h" -#include "../../xrEngine/xr_ioconsole.h" +#include "Level.h" +#include "game_cl_base.h" +#include "game_cl_teamdeathmatch.h" +#include "xrEngine/xr_ioconsole.h" CUIVote::CUIVote() { diff --git a/src/xrGame/ui/UIVotingCategory.cpp b/src/xrGame/ui/UIVotingCategory.cpp index 160783f6ad5..712934358b7 100644 --- a/src/xrGame/ui/UIVotingCategory.cpp +++ b/src/xrGame/ui/UIVotingCategory.cpp @@ -6,10 +6,8 @@ #include "UIChangeMap.h" #include "ChangeWeatherDialog.hpp" #include "UIGameCustom.h" - -#include "../game_cl_teamdeathmatch.h" -#include "../game_sv_mp_vote_flags.h" - +#include "game_cl_teamdeathmatch.h" +#include "game_sv_mp_vote_flags.h" CUIVotingCategory::CUIVotingCategory() { @@ -105,7 +103,7 @@ bool CUIVotingCategory::OnKeyboardAction(int dik, EUIMessages keyboard_action) return false; } -#include "../../xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_ioconsole.h" void CUIVotingCategory::OnBtn(int i) { diff --git a/src/xrGame/ui/UIWarState.cpp b/src/xrGame/ui/UIWarState.cpp deleted file mode 100644 index 267d0c43285..00000000000 --- a/src/xrGame/ui/UIWarState.cpp +++ /dev/null @@ -1,88 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : UIWarState.cpp -// Created : 15.04.2008 -// Author : Evgeniy Sokolov -// Description : UI war state (PDA) window class implementation -//////////////////////////////////////////////////////////////////////////// - -#include "stdafx.h" -/* -#include "UIWarState.h" -#include "UIStatic.h" -#include "UIXmlInit.h" -#include "UIHelper.h" - -UIWarState::UIWarState() -{ -// m_installed = false; -// m_def_texture._set( NULL ); -} - -void UIWarState::InitXML( CUIXml& xml, LPCSTR att_name, CUIWindow* parent ) -{ - VERIFY( parent ); - parent->AttachChild( this ); - SetAutoDelete( true ); - string256 buf; - - CUIXmlInit::InitWindow( xml, att_name, 0, this ); - - strconcat( sizeof(buf), buf, att_name, ":img" ); - m_static = UIHelper::CreateStatic( xml, buf, this ); - -// strconcat( sizeof(buf), buf, att_name, ":img:texture" ); -// m_def_texture._set( xml.Read( buf, 0, NULL ) ); -// VERIFY( m_def_texture.size() ); - - set_hint_delay( (u32)xml.ReadAttribInt( att_name, 0, "delay", 0 ) ); - -// ui_war_state_no_hint = xml.ReadAttrib( att_name, 0, "hint_disable" ); -} - -void UIWarState::ClearInfo() -{ - //m_installed = false; -// m_static->SetVisible( false ); - SetVisible( false ); - set_hint_text_ST( "" ); - - //m_static->InitTexture( m_def_texture.c_str() ); -} - -bool UIWarState::UpdateInfo( LPCSTR icon, LPCSTR hint_text ) -{ - if ( !icon || !xr_strlen(icon) ) - { - return false; - } - -// m_installed = true; -// m_static->SetVisible( true ); - SetVisible( true ); - m_static->InitTexture( icon ); - - if ( !hint_text || !xr_strlen(hint_text) ) - { - set_hint_text_ST( "" ); - } - else - { - set_hint_text_ST( hint_text ); - } - return true; -} - -void UIWarState::Draw() -{ - if( IsShown() ) - { - inherited::Draw(); - } - -// if ( GetVisible() ) -// { -// inherited::Draw(); -// m_static->Draw(); -// } -} -*/ diff --git a/src/xrGame/ui/UIWarState.h b/src/xrGame/ui/UIWarState.h deleted file mode 100644 index 14e9a77a73f..00000000000 --- a/src/xrGame/ui/UIWarState.h +++ /dev/null @@ -1,39 +0,0 @@ -//////////////////////////////////////////////////////////////////////////// -// Module : UIWarState.h -// Created : 15.04.2008 -// Author : Evgeniy Sokolov -// Description : UI war state (PDA) window class -//////////////////////////////////////////////////////////////////////////// -/* -#ifndef UI_WAR_STATE_H_INCLUDED -#define UI_WAR_STATE_H_INCLUDED - -#include "UIHint.h" - -class CUIXml; -class CUIStatic; - -class UIWarState : public UIHintWindow -{ -private: - typedef UIHintWindow inherited; - - CUIStatic* m_static; -// shared_str m_def_texture; -// bool m_installed; - -public: - UIWarState (); - virtual ~UIWarState () {}; - - void InitXML ( CUIXml& xml, LPCSTR att_name, CUIWindow* parent ); - void ClearInfo (); - bool UpdateInfo ( LPCSTR icon, LPCSTR hint_text ); - virtual void Draw (); - -protected: - -}; // class UIWarState - -#endif // UI_WAR_STATE_H_INCLUDED -*/ diff --git a/src/xrGame/ui/UIWindow.cpp b/src/xrGame/ui/UIWindow.cpp index 33d7ec5447b..27182ec3538 100644 --- a/src/xrGame/ui/UIWindow.cpp +++ b/src/xrGame/ui/UIWindow.cpp @@ -1,10 +1,9 @@ #include "stdafx.h" #include "UIWindow.h" -#include "../UICursor.h" -#include "../MainMenu.h" - -#include "../Include/xrRender/DebugRender.h" -#include "../Include/xrRender/UIRender.h" +#include "UICursor.h" +#include "MainMenu.h" +#include "Include/xrRender/DebugRender.h" +#include "Include/xrRender/UIRender.h" poolSS< _12b, 128> ui_allocator; diff --git a/src/xrGame/ui/UIWindow.h b/src/xrGame/ui/UIWindow.h index 4d2061d5004..53c12e4ffab 100644 --- a/src/xrGame/ui/UIWindow.h +++ b/src/xrGame/ui/UIWindow.h @@ -1,5 +1,5 @@ #pragma once -#include "../xr_level_controller.h" +#include "xr_level_controller.h" class CUIWindow; struct _12b { DWORD _[3]; }; @@ -65,7 +65,7 @@ template inline bool operator!=(const uialloc<_Ty>&, co ////////////////////////////////////////////////////////////////////////// #include "UIMessages.h" -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" #include "uiabstract.h" diff --git a/src/xrGame/ui/UIWindow_script.cpp b/src/xrGame/ui/UIWindow_script.cpp index 05a41af3338..4a22a07a698 100644 --- a/src/xrGame/ui/UIWindow_script.cpp +++ b/src/xrGame/ui/UIWindow_script.cpp @@ -4,7 +4,7 @@ #include "UIFrameLineWnd.h" #include "UIDialogWnd.h" #include "UIDialogHolder.h" -#include "../GamePersistent.h" +#include "GamePersistent.h" #include "UILabel.h" #include "UIMMShniaga.h" #include "UITextureMaster.h" diff --git a/src/xrGame/ui/UIWndCallback.cpp b/src/xrGame/ui/UIWndCallback.cpp index 3232dd6c0d4..f5873667ee4 100644 --- a/src/xrGame/ui/UIWndCallback.cpp +++ b/src/xrGame/ui/UIWndCallback.cpp @@ -2,7 +2,7 @@ #include "UIWndCallback.h" #include "UIWindow.h" #include "object_broker.h" -#include "../callback_info.h" +#include "callback_info.h" bool event_comparer::operator ()(SCallbackInfo* i) { diff --git a/src/xrGame/ui/UIWpnParams.cpp b/src/xrGame/ui/UIWpnParams.cpp index f8d059b4f31..37cb1264cec 100644 --- a/src/xrGame/ui/UIWpnParams.cpp +++ b/src/xrGame/ui/UIWpnParams.cpp @@ -1,10 +1,10 @@ #include "pch_script.h" #include "UIWpnParams.h" #include "UIXmlInit.h" -#include "../level.h" +#include "Level.h" #include "game_base_space.h" -#include "../ai_space.h" -#include "../../xrServerEntities/script_engine.h" +#include "ai_space.h" +#include "xrServerEntities/script_engine.h" #include "inventory_item_object.h" #include "UIInventoryUtilities.h" #include "Weapon.h" diff --git a/src/xrGame/ui/UIWpnParams.h b/src/xrGame/ui/UIWpnParams.h index cd07d4006a8..f3536d6ece1 100644 --- a/src/xrGame/ui/UIWpnParams.h +++ b/src/xrGame/ui/UIWpnParams.h @@ -6,7 +6,7 @@ class CUIXml; class CInventoryItem; -#include "../../xrServerEntities/script_export_space.h" +#include "xrServerEntities/script_export_space.h" struct SLuaWpnParams; diff --git a/src/xrGame/ui/UIXmlInit.cpp b/src/xrGame/ui/UIXmlInit.cpp index 2079eab6a9d..1f0416a4083 100644 --- a/src/xrGame/ui/UIXmlInit.cpp +++ b/src/xrGame/ui/UIXmlInit.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "UIXmlInit.h" -#include "../level.h" -#include "../string_table.h" +#include "Level.h" +#include "string_table.h" #include "UIFrameWindow.h" #include "UICheckButton.h" #include "UICustomSpin.h" diff --git a/src/xrGame/ui/map_hint.cpp b/src/xrGame/ui/map_hint.cpp index c5dae396880..9c42a262627 100644 --- a/src/xrGame/ui/map_hint.cpp +++ b/src/xrGame/ui/map_hint.cpp @@ -2,13 +2,13 @@ #include "map_hint.h" #include "UIStatic.h" #include "UIXmlInit.h" -#include "../map_location.h" -#include "../map_spot.h" -#include "../actor.h" -#include "../gametaskmanager.h" -#include "../gametask.h" +#include "map_location.h" +#include "map_spot.h" +#include "Actor.h" +#include "GametaskManager.h" +#include "GameTask.h" #include "UIInventoryUtilities.h" -#include "../string_table.h" +#include "string_table.h" CUIStatic* init_static_field(CUIXml& uiXml, LPCSTR path, LPCSTR path2) { diff --git a/src/xrGame/ui/map_hint.h b/src/xrGame/ui/map_hint.h index 1d1a4170542..9d307a94d4a 100644 --- a/src/xrGame/ui/map_hint.h +++ b/src/xrGame/ui/map_hint.h @@ -1,6 +1,6 @@ #pragma once #include "UIFrameWindow.h" -#include "..\../xrServerEntities/associative_vector.h" +#include "xrServerEntities/associative_vector.h" class CUIStatic; class CUITextWnd; diff --git a/src/xrGame/ui/ui_af_params.cpp b/src/xrGame/ui/ui_af_params.cpp index 7d2b82ee28a..98c13dbc7c7 100644 --- a/src/xrGame/ui/ui_af_params.cpp +++ b/src/xrGame/ui/ui_af_params.cpp @@ -1,13 +1,12 @@ #include "stdafx.h" #include "ui_af_params.h" #include "UIStatic.h" - -#include "..\actor.h" -#include "..\ActorCondition.h" +#include "Actor.h" +#include "ActorCondition.h" #include "object_broker.h" #include "UIXmlInit.h" #include "UIHelper.h" -#include "../string_table.h" +#include "string_table.h" u32 const red_clr = color_argb(255,210,50,50); u32 const green_clr = color_argb(255,170,170,170); diff --git a/src/xrGame/ui/ui_af_params.h b/src/xrGame/ui/ui_af_params.h index dede71681d4..df1e6e003f0 100644 --- a/src/xrGame/ui/ui_af_params.h +++ b/src/xrGame/ui/ui_af_params.h @@ -1,7 +1,6 @@ #pragma once #include "UIWindow.h" -#include "..\..\xrServerEntities\alife_space.h" - +#include "xrServerEntities/alife_space.h" class CUIXml; class CUIStatic; diff --git a/src/xrGame/ui/uiabstract.h b/src/xrGame/ui/uiabstract.h index 21075c0519b..68ec7d0295f 100644 --- a/src/xrGame/ui/uiabstract.h +++ b/src/xrGame/ui/uiabstract.h @@ -3,7 +3,7 @@ #pragma warning (disable : 4511 ) #pragma warning (disable : 4512 ) -#include "../ui_base.h" +#include "ui_base.h" #include typedef CGameFont::EAligment ETextAlignment; diff --git a/src/xrGame/ui/uiinventorywnd2.cpp b/src/xrGame/ui/uiinventorywnd2.cpp deleted file mode 100644 index a40417e33e3..00000000000 --- a/src/xrGame/ui/uiinventorywnd2.cpp +++ /dev/null @@ -1,363 +0,0 @@ -#include "stdafx.h" -#include "UIInventoryWnd.h" -/* -#include "../level.h" -#include "../actor.h" -#include "../ActorCondition.h" -#include "../hudmanager.h" -#include "../inventory.h" -#include "UIInventoryUtilities.h" - -#include "UICellItem.h" -#include "UICellItemFactory.h" -#include "UIDragDropListEx.h" -#include "UI3tButton.h" - -CUICellItem* CUIInventoryWnd::CurrentItem() -{ - return m_pCurrentCellItem; -} - -PIItem CUIInventoryWnd::CurrentIItem() -{ - return (m_pCurrentCellItem)?(PIItem)m_pCurrentCellItem->m_pData : NULL; -} - -void CUIInventoryWnd::SetCurrentItem(CUICellItem* itm) -{ - if(m_pCurrentCellItem == itm) return; - m_pCurrentCellItem = itm; - UIItemInfo.InitItem (CurrentIItem()); -} - -void CUIInventoryWnd::SendMessage(CUIWindow *pWnd, s16 msg, void *pData) -{ - if(pWnd == &UIPropertiesBox && msg==PROPERTY_CLICKED) - { - ProcessPropertiesBoxClicked (); - }else - if (UIExitButton == pWnd && BUTTON_CLICKED == msg) - { - GetHolder()->StartStopMenu (this,true); - } - - CUIWindow::SendMessage(pWnd, msg, pData); -} - - -void CUIInventoryWnd::InitInventory_delayed() -{ - m_b_need_reinit = true; -} - -void CUIInventoryWnd::InitInventory() -{ - CInventoryOwner *pInvOwner = smart_cast(Level().CurrentEntity()); - if(!pInvOwner) return; - - m_pInv = &pInvOwner->inventory(); - - UIPropertiesBox.Hide (); - ClearAllLists (); - m_pMouseCapturer = NULL; - SetCurrentItem (NULL); - - //Slots - PIItem _itm = m_pInv->m_slots[PISTOL_SLOT].m_pIItem; - if(_itm) - { - CUICellItem* itm = create_cell_item(_itm); - m_pUIPistolList->SetItem (itm); - } - - - _itm = m_pInv->m_slots[RIFLE_SLOT].m_pIItem; - if(_itm) - { - CUICellItem* itm = create_cell_item(_itm); - m_pUIAutomaticList->SetItem (itm); - } - - PIItem _outfit = m_pInv->m_slots[OUTFIT_SLOT].m_pIItem; - CUICellItem* outfit = (_outfit)?create_cell_item(_outfit):NULL; - m_pUIOutfitList->SetItem (outfit); - - TIItemContainer::iterator it, it_e; - for(it=m_pInv->m_belt.begin(),it_e=m_pInv->m_belt.end(); it!=it_e; ++it) - { - CUICellItem* itm = create_cell_item(*it); - m_pUIBeltList->SetItem (itm); - } - - - - ruck_list = m_pInv->m_ruck; - std::sort (ruck_list.begin(),ruck_list.end(),InventoryUtilities::GreaterRoomInRuck); - - int i=1; - for(it=ruck_list.begin(),it_e=ruck_list.end(); it!=it_e; ++it,++i) - { - CUICellItem* itm = create_cell_item(*it); - m_pUIBagList->SetItem (itm); - } - //fake - _itm = m_pInv->m_slots[GRENADE_SLOT].m_pIItem; - if(_itm) - { - CUICellItem* itm = create_cell_item(_itm); - m_pUIBagList->SetItem (itm); - } - -// InventoryUtilities::UpdateWeight (UIBagWnd, true); - - m_b_need_reinit = false; -} - -void CUIInventoryWnd::DropCurrentItem(bool b_all) -{ - - CActor *pActor = smart_cast(Level().CurrentEntity()); - if(!pActor) return; - - if(!b_all && CurrentIItem() && !CurrentIItem()->IsQuestItem()) - { - SendEvent_Item_Drop (CurrentIItem()); - SetCurrentItem (NULL); -// InventoryUtilities::UpdateWeight (UIBagWnd, true); - return; - } - - if(b_all && CurrentIItem() && !CurrentIItem()->IsQuestItem()) - { - u32 cnt = CurrentItem()->ChildsCount(); - - for(u32 i=0; iPopChild(NULL); - PIItem iitm = (PIItem)itm->m_pData; - SendEvent_Item_Drop (iitm); - } - - SendEvent_Item_Drop (CurrentIItem()); - SetCurrentItem (NULL); -// InventoryUtilities::UpdateWeight (UIBagWnd, true); - return; - } -} - -//------------------------------------------ - -bool CUIInventoryWnd::ToSlot(CUICellItem* itm, bool force_place) -{ - CUIDragDropListEx* old_owner = itm->OwnerList(); - PIItem iitem = (PIItem)itm->m_pData; - u32 _slot = iitem->GetSlot(); - - if(GetInventory()->CanPutInSlot(iitem)){ - CUIDragDropListEx* new_owner = GetSlotList(_slot); - - if(_slot==GRENADE_SLOT && !new_owner )return true; //fake, sorry ((( - - bool result = GetInventory()->Slot(iitem); - VERIFY (result); - - CUICellItem* i = old_owner->RemoveItem(itm, (old_owner==new_owner) ); - - new_owner->SetItem (i); - - SendEvent_Item2Slot (iitem); - - SendEvent_ActivateSlot (iitem); - - return true; - }else - { // in case slot is busy - if(!force_place || _slot==NO_ACTIVE_SLOT || GetInventory()->m_slots[_slot].m_bPersistent) return false; - - PIItem _iitem = GetInventory()->m_slots[_slot].m_pIItem; - CUIDragDropListEx* slot_list = GetSlotList(_slot); - VERIFY (slot_list->ItemsCount()==1); - - CUICellItem* slot_cell = slot_list->GetItemIdx(0); - VERIFY (slot_cell && ((PIItem)slot_cell->m_pData)==_iitem); - - bool result = ToBag(slot_cell, false); - VERIFY (result); - - return ToSlot (itm, false); - } -} - -bool CUIInventoryWnd::ToBag(CUICellItem* itm, bool b_use_cursor_pos) -{ - PIItem iitem = (PIItem)itm->m_pData; - - if(GetInventory()->CanPutInRuck(iitem)) - { - CUIDragDropListEx* old_owner = itm->OwnerList(); - CUIDragDropListEx* new_owner = NULL; - if(b_use_cursor_pos){ - new_owner = CUIDragDropListEx::m_drag_item->BackList(); - VERIFY (new_owner==m_pUIBagList); - }else - new_owner = m_pUIBagList; - - - bool result = GetInventory()->Ruck(iitem); - VERIFY (result); - CUICellItem* i = old_owner->RemoveItem(itm, (old_owner==new_owner) ); - - if(b_use_cursor_pos) - new_owner->SetItem (i,old_owner->GetDragItemPosition()); - else - new_owner->SetItem (i); - - SendEvent_Item2Ruck (iitem); - return true; - } - return false; -} - -bool CUIInventoryWnd::ToBelt(CUICellItem* itm, bool b_use_cursor_pos) -{ - PIItem iitem = (PIItem)itm->m_pData; - - if(GetInventory()->CanPutInBelt(iitem)) - { - CUIDragDropListEx* old_owner = itm->OwnerList(); - CUIDragDropListEx* new_owner = NULL; - if(b_use_cursor_pos){ - new_owner = CUIDragDropListEx::m_drag_item->BackList(); - VERIFY (new_owner==m_pUIBeltList); - }else - new_owner = m_pUIBeltList; - - bool result = GetInventory()->Belt(iitem); - VERIFY (result); - CUICellItem* i = old_owner->RemoveItem(itm, (old_owner==new_owner) ); - - //. UIBeltList.RearrangeItems(); - if(b_use_cursor_pos) - new_owner->SetItem (i,old_owner->GetDragItemPosition()); - else - new_owner->SetItem (i); - - SendEvent_Item2Belt (iitem); - return true; - } - return false; -} - -void CUIInventoryWnd::AddItemToBag(PIItem pItem) -{ - CUICellItem* itm = create_cell_item(pItem); - m_pUIBagList->SetItem (itm); -} - -bool CUIInventoryWnd::OnItemStartDrag(CUICellItem* itm) -{ - return false; //default behaviour -} - -bool CUIInventoryWnd::OnItemSelected(CUICellItem* itm) -{ - SetCurrentItem (itm); - return false; -} - -bool CUIInventoryWnd::OnItemDrop(CUICellItem* itm) -{ - CUIDragDropListEx* old_owner = itm->OwnerList(); - CUIDragDropListEx* new_owner = CUIDragDropListEx::m_drag_item->BackList(); - if(old_owner==new_owner || !old_owner || !new_owner) - return false; - - EListType t_new = GetType(new_owner); - EListType t_old = GetType(old_owner); - if(t_new == t_old) return true; - - switch(t_new){ - case iwActorSlot:{ - if(GetSlotList(CurrentIItem()->GetSlot())==new_owner) - ToSlot (itm, true); - }break; - case iwActorBag:{ - ToBag (itm, true); - }break; - case iwActorBelt:{ - ToBelt (itm, true); - }break; - }; - - DropItem (CurrentIItem(), new_owner); - - return true; -} - -bool CUIInventoryWnd::OnItemDbClick(CUICellItem* itm) -{ - if(TryUseItem((PIItem)itm->m_pData)) - return true; - - CUIDragDropListEx* old_owner = itm->OwnerList(); - EListType t_old = GetType(old_owner); - - switch(t_old){ - case iwActorSlot:{ - ToBag (itm, false); - }break; - - case iwActorBag:{ - if(!ToSlot(itm, false)){ - if( !ToBelt(itm, false) ) - ToSlot (itm, true); - } - }break; - - case iwActorBelt:{ - ToBag (itm, false); - }break; - }; - - return true; -} - - -bool CUIInventoryWnd::OnItemRButtonClick(CUICellItem* itm) -{ - SetCurrentItem (itm); - ActivatePropertiesBox (); - return false; -} - -CUIDragDropListEx* CUIInventoryWnd::GetSlotList(u32 slot_idx) -{ - if(slot_idx == NO_ACTIVE_SLOT || GetInventory()->m_slots[slot_idx].m_bPersistent) return NULL; - switch (slot_idx) - { - case PISTOL_SLOT: - return m_pUIPistolList; - break; - - case RIFLE_SLOT: - return m_pUIAutomaticList; - break; - - case OUTFIT_SLOT: - return m_pUIOutfitList; - break; - - }; - return NULL; -} - - - -void CUIInventoryWnd::ClearAllLists() -{ - m_pUIBagList->ClearAll (true); - m_pUIBeltList->ClearAll (true); - m_pUIOutfitList->ClearAll (true); - m_pUIPistolList->ClearAll (true); - m_pUIAutomaticList->ClearAll (true); -} -*/ \ No newline at end of file diff --git a/src/xrGame/ui/xrUIXmlParser.cpp b/src/xrGame/ui/xrUIXmlParser.cpp index ff8bc81252f..57aee756079 100644 --- a/src/xrGame/ui/xrUIXmlParser.cpp +++ b/src/xrGame/ui/xrUIXmlParser.cpp @@ -2,7 +2,7 @@ #include "xrUIXmlParser.h" #ifdef XRGAME_EXPORTS - #include "../ui_base.h" + #include "ui_base.h" #endif shared_str CUIXml::correct_file_name (LPCSTR path, LPCSTR fn) diff --git a/src/xrGame/ui/xrUIXmlParser.h b/src/xrGame/ui/xrUIXmlParser.h index 83e9431930b..fc02de8709a 100644 --- a/src/xrGame/ui/xrUIXmlParser.h +++ b/src/xrGame/ui/xrUIXmlParser.h @@ -1,8 +1,7 @@ #pragma once +#include "xrXMLParser/xrXMLParser.h" -#include "../../xrXMLParser/xrXMLParser.h" - -class CUIXml :public CXml +class CUIXml : public CXml { int m_dbg_id; public: diff --git a/src/xrGame/ui_defs.h b/src/xrGame/ui_defs.h index bcae9b44f39..2880286323c 100644 --- a/src/xrGame/ui_defs.h +++ b/src/xrGame/ui_defs.h @@ -1,8 +1,8 @@ #pragma once -#include "../Include/xrRender/FactoryPtr.h" -#include "../Include/xrRender/UIRender.h" -#include "../Include/xrRender/UIShader.h" +#include "Include/xrRender/FactoryPtr.h" +#include "Include/xrRender/UIRender.h" +#include "Include/xrRender/UIShader.h" typedef FactoryPtr ui_shader; #define UI_BASE_WIDTH 1024.0f diff --git a/src/xrGame/vision_client.h b/src/xrGame/vision_client.h index 69091354767..b6d3b203076 100644 --- a/src/xrGame/vision_client.h +++ b/src/xrGame/vision_client.h @@ -9,7 +9,7 @@ #ifndef VISION_CLIENT_H #define VISION_CLIENT_H -#include "../xrEngine/feel_vision.h" +#include "xrEngine/feel_vision.h" class CObject; class CEntity; diff --git a/src/xrGame/visual_memory_manager.cpp b/src/xrGame/visual_memory_manager.cpp index 3e921e7d3f2..ceeca5141d2 100644 --- a/src/xrGame/visual_memory_manager.cpp +++ b/src/xrGame/visual_memory_manager.cpp @@ -10,7 +10,7 @@ #include "visual_memory_manager.h" #include "ai/stalker/ai_stalker.h" #include "memory_space_impl.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ai_object_location.h" #include "level_graph.h" #include "stalker_movement_manager_smart_cover.h" @@ -20,7 +20,7 @@ #include "ai_space.h" #include "profiler.h" #include "actor.h" -#include "../xrEngine/camerabase.h" +#include "xrEngine/camerabase.h" #include "gamepersistent.h" #include "actor_memory.h" #include "client_spawn_manager.h" diff --git a/src/xrGame/wallmark_manager.cpp b/src/xrGame/wallmark_manager.cpp index a261788712e..ac7ebd4a768 100644 --- a/src/xrGame/wallmark_manager.cpp +++ b/src/xrGame/wallmark_manager.cpp @@ -2,7 +2,7 @@ #include "wallmark_manager.h" #include "Level.h" #include "xrEngine/GameMtlLib.h" -#include "../xrphysics/CalculateTriangle.h" +#include "xrPhysics/CalculateTriangle.h" #include "profiler.h" #ifdef DEBUG #include "phdebug.h" diff --git a/src/xrGame/xrGame.vcxproj b/src/xrGame/xrGame.vcxproj index 1b78832c756..46176d259be 100644 --- a/src/xrGame/xrGame.vcxproj +++ b/src/xrGame/xrGame.vcxproj @@ -1609,7 +1609,6 @@ - @@ -1654,8 +1653,6 @@ - - @@ -1696,7 +1693,6 @@ - @@ -1758,9 +1754,6 @@ - - true - @@ -1791,11 +1784,9 @@ - - @@ -1833,6 +1824,7 @@ + @@ -3687,10 +3679,6 @@ - - pch_script.h - $(IntDir)$(ProjectName)_script.pch - @@ -3762,10 +3750,6 @@ $(IntDir)$(ProjectName)_script.pch - - pch_script.h - $(IntDir)$(ProjectName)_script.pch - @@ -3885,9 +3869,6 @@ $(IntDir)$(ProjectName)_script.pch - - true - pch_script.h @@ -3939,11 +3920,9 @@ - - pch_script.h diff --git a/src/xrGame/xrGame.vcxproj.filters b/src/xrGame/xrGame.vcxproj.filters index 0de3496fee4..7f80cea0190 100644 --- a/src/xrGame/xrGame.vcxproj.filters +++ b/src/xrGame/xrGame.vcxproj.filters @@ -2218,9 +2218,6 @@ {ddf96ea9-ef48-422b-9ac9-d1c7aafa5cd6} - - {73dc453e-a9d1-4200-83b7-3564dbf9fc80} - {88b2008c-d91b-4387-b903-9223e6800188} @@ -4062,9 +4059,6 @@ AI\AMonsters\common\steering behaviours\base - - AI\AMonsters\common\steering behaviours\manager - AI\AMonsters\common\trajectories @@ -6735,18 +6729,6 @@ UI\Common\PDA\Tasks - - UI\Common\PDA\FactionWar - - - UI\Common\PDA\FactionWar - - - UI\Common\PDA\FactionWar - - - UI\Common\PDA\FactionWar - UI\Common\PDA\logs @@ -6954,9 +6936,6 @@ UI\UIWindows\TrackBar - - UI\UIWindows\TrackBar - UI\UIWindows\ScrollView @@ -7365,6 +7344,9 @@ UI\Multiplayer\Voting + + Core\Client\Objects\items & weapons\Weapons + @@ -10319,9 +10301,6 @@ UI\Common\PDA\Statistics & Rankings - - UI\Common\PDA\Statistics & Rankings - UI\Common\PDA\Statistics & Rankings @@ -10334,15 +10313,6 @@ UI\Common\PDA\Tasks - - UI\Common\PDA\FactionWar - - - UI\Common\PDA\FactionWar - - - UI\Common\PDA\FactionWar - UI\Common\PDA\logs @@ -10589,9 +10559,6 @@ UI\UIWindows\TrackBar - - UI\UIWindows\TrackBar - UI\UIWindows\ScrollView @@ -11029,8 +10996,5 @@ Core\Client\Objects\items & weapons\Explosives - - UI\Common\PDA\Statistics & Rankings - \ No newline at end of file diff --git a/src/xrGame/xrGameSpyServer.cpp b/src/xrGame/xrGameSpyServer.cpp index 2104e80ed2f..59f695c7d06 100644 --- a/src/xrGame/xrGameSpyServer.cpp +++ b/src/xrGame/xrGameSpyServer.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "xrMessages.h" #include "xrGameSpyServer.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" #include "GameSpy/GameSpy_Base_Defs.h" #include "GameSpy/GameSpy_Available.h" diff --git a/src/xrGame/xrGameSpyServer_callbacks.cpp b/src/xrGame/xrGameSpyServer_callbacks.cpp index 82867eac25f..7df9574b322 100644 --- a/src/xrGame/xrGameSpyServer_callbacks.cpp +++ b/src/xrGame/xrGameSpyServer_callbacks.cpp @@ -1,5 +1,5 @@ #include "stdafx.h" #include "xrGameSpyServer.h" #include "xrGameSpyServer_callbacks.h" -#include "../xrEngine/igame_persistent.h" +#include "xrEngine/igame_persistent.h" diff --git a/src/xrGame/xrServer.cpp b/src/xrGame/xrServer.cpp index 44a22692392..a5f02467bff 100644 --- a/src/xrGame/xrServer.cpp +++ b/src/xrGame/xrServer.cpp @@ -6,16 +6,16 @@ #include "xrServer.h" #include "xrMessages.h" #include "xrServer_Objects_ALife_All.h" -#include "level.h" +#include "Level.h" #include "game_cl_base.h" #include "game_sv_mp.h" #include "game_cl_base_weapon_usage_statistic.h" #include "ai_space.h" -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" #include "string_table.h" #include "object_broker.h" -#include "../xrEngine/XR_IOConsole.h" +#include "xrEngine/XR_IOConsole.h" #include "ui/UIInventoryUtilities.h" #include "file_transfer.h" #include "screenshot_server.h" diff --git a/src/xrGame/xrServer.h b/src/xrGame/xrServer.h index c51dfe1cc60..d03d20fe2a2 100644 --- a/src/xrGame/xrServer.h +++ b/src/xrGame/xrServer.h @@ -7,10 +7,10 @@ #define AFX_XRSERVER_H__65728A25_16FC_4A7B_8CCE_D798CA5EC64E__INCLUDED_ #pragma once -#include "../xrNetServer/net_server.h" +#include "xrNetServer/net_server.h" #include "game_sv_base.h" #include "id_generator.h" -#include "../xrEngine/mp_logging.h" +#include "xrEngine/mp_logging.h" #include "secure_messaging.h" #include "xrServer_updates_compressor.h" #include "xrClientsPool.h" diff --git a/src/xrGame/xrServer_CL_disconnect.cpp b/src/xrGame/xrServer_CL_disconnect.cpp index c7915c6e55e..b764ffacfb5 100644 --- a/src/xrGame/xrServer_CL_disconnect.cpp +++ b/src/xrGame/xrServer_CL_disconnect.cpp @@ -3,7 +3,7 @@ #include "game_sv_single.h" #include "alife_simulator.h" #include "xrserver_objects.h" -#include "level.h" +#include "Level.h" void xrServer::OnCL_Disconnected (IClient* CL) { diff --git a/src/xrGame/xrServer_Connect.cpp b/src/xrGame/xrServer_Connect.cpp index c576d588ff7..54c1b681e46 100644 --- a/src/xrGame/xrServer_Connect.cpp +++ b/src/xrGame/xrServer_Connect.cpp @@ -8,10 +8,10 @@ #include "game_cl_artefacthunt.h" #include "game_cl_single.h" #include "MainMenu.h" -#include "../xrEngine/x_ray.h" +#include "xrEngine/x_ray.h" #include "file_transfer.h" #include "screenshot_server.h" -#include "../xrNetServer/NET_AuthCheck.h" +#include "xrNetServer/NET_AuthCheck.h" #pragma warning(push) #pragma warning(disable:4995) #include diff --git a/src/xrGame/xrServer_info.cpp b/src/xrGame/xrServer_info.cpp index 8ba527d3e9f..67b9ce3cb0a 100644 --- a/src/xrGame/xrServer_info.cpp +++ b/src/xrGame/xrServer_info.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "xrServer_info.h" -#include "level.h" +#include "Level.h" #include "xrserver.h" #define SERVER_LOGO_FN "server_logo.jpg" diff --git a/src/xrGame/xrServer_info.h b/src/xrGame/xrServer_info.h index 1f2d5ab620a..9731cd12d7c 100644 --- a/src/xrGame/xrServer_info.h +++ b/src/xrGame/xrServer_info.h @@ -2,7 +2,7 @@ #define SERVER_INFO_UPLOADER #include -#include "../xrCore/fastdelegate.h" +#include "xrCore/fastdelegate.h" #include "file_transfer.h" typedef fastdelegate::FastDelegate svinfo_upload_complete_cb; diff --git a/src/xrGame/xrServer_updates_compressor.cpp b/src/xrGame/xrServer_updates_compressor.cpp index 2ebea0076ef..b70f1b0ee64 100644 --- a/src/xrGame/xrServer_updates_compressor.cpp +++ b/src/xrGame/xrServer_updates_compressor.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" -#include "level.h" +#include "Level.h" #include "xrServer_updates_compressor.h" -#include "../xrCore/ppmd_compressor.h" -#include "../xrServerEntities/object_broker.h" +#include "xrCore/ppmd_compressor.h" +#include "xrServerEntities/object_broker.h" #include "xrMessages.h" BOOL g_sv_write_updates_bin = FALSE; diff --git a/src/xrGame/xr_dsa_signer.h b/src/xrGame/xr_dsa_signer.h index d011cea97e2..d4765f35619 100644 --- a/src/xrGame/xr_dsa_signer.h +++ b/src/xrGame/xr_dsa_signer.h @@ -1,7 +1,7 @@ #ifndef XR_DSA_SIGNER_INCLUDED #define XR_DSA_SIGNER_INCLUDED -#include "../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" typedef fastdelegate::FastDelegate1< long > sha_process_yielder; diff --git a/src/xrGame/xr_dsa_verifyer.h b/src/xrGame/xr_dsa_verifyer.h index 831ccbafa58..c440bbde2f6 100644 --- a/src/xrGame/xr_dsa_verifyer.h +++ b/src/xrGame/xr_dsa_verifyer.h @@ -1,7 +1,7 @@ #ifndef XR_DSA_VERIFYER_INCLUDED #define XR_DSA_VERIFYER_INCLUDED -#include "../3rd party/crypto/crypto.h" +#include "3rd party/crypto/crypto.h" class xr_dsa_verifyer { diff --git a/src/xrGame/xr_level_controller.cpp b/src/xrGame/xr_level_controller.cpp index ded12019d43..30e30355b2a 100644 --- a/src/xrGame/xr_level_controller.cpp +++ b/src/xrGame/xr_level_controller.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include -#include "../xrEngine/xr_ioconsole.h" -#include "../xrEngine/xr_input.h" -#include "../xrEngine/xr_ioc_cmd.h" +#include "xrEngine/xr_ioconsole.h" +#include "xrEngine/xr_input.h" +#include "xrEngine/xr_ioc_cmd.h" #include "xr_level_controller.h" #include "string_table.h" diff --git a/src/xrGame/xr_time.cpp b/src/xrGame/xr_time.cpp index a0eceb65cc2..2b8cbb3dc0e 100644 --- a/src/xrGame/xr_time.cpp +++ b/src/xrGame/xr_time.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #include "xr_time.h" #include "ui/UIInventoryUtilities.h" -#include "level.h" +#include "Level.h" #include "date_time.h" #include "ai_space.h" #include "alife_simulator.h" diff --git a/src/xrGame/xrgame_dll_detach.cpp b/src/xrGame/xrgame_dll_detach.cpp index aa3f1cac422..dc759d11900 100644 --- a/src/xrGame/xrgame_dll_detach.cpp +++ b/src/xrGame/xrgame_dll_detach.cpp @@ -42,7 +42,7 @@ extern void CreateUIGeom (); extern void DestroyUIGeom (); extern void InitHudSoundSettings (); -#include "../xrEngine/IGame_Persistent.h" +#include "xrEngine/IGame_Persistent.h" void init_game_globals() { CreateUIGeom (); diff --git a/src/xrGame/zone_effector.cpp b/src/xrGame/zone_effector.cpp index 19e20bd369b..723f490e9e5 100644 --- a/src/xrGame/zone_effector.cpp +++ b/src/xrGame/zone_effector.cpp @@ -1,8 +1,8 @@ #include "stdafx.h" #include "zone_effector.h" -#include "level.h" -#include "../xrEngine/xr_object.h" -#include "../xrEngine/cameramanager.h" +#include "Level.h" +#include "xrEngine/xr_object.h" +#include "xrEngine/cameramanager.h" #include "actor.h" #include "actoreffector.h" #include "postprocessanimator.h" diff --git a/src/xrGame/zone_effector.h b/src/xrGame/zone_effector.h index f6c503b874d..c062fb7ff78 100644 --- a/src/xrGame/zone_effector.h +++ b/src/xrGame/zone_effector.h @@ -1,6 +1,6 @@ #pragma once -#include "../xrServerEntities/alife_space.h" +#include "xrServerEntities/alife_space.h" class CActor; class CPostprocessAnimatorLerp; diff --git a/src/xrNetServer/NET_Client.cpp b/src/xrNetServer/NET_Client.cpp index b8264a622bd..2f834ca1a89 100644 --- a/src/xrNetServer/NET_Client.cpp +++ b/src/xrNetServer/NET_Client.cpp @@ -5,7 +5,7 @@ #include "net_messages.h" #include "NET_Log.h" -#include "../xrGameSpy/xrGameSpy_MainDefs.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" #pragma warning(push) #pragma warning(disable:4995) diff --git a/src/xrNetServer/NET_Compressor.cpp b/src/xrNetServer/NET_Compressor.cpp index 6906209eb13..fd472c3a725 100644 --- a/src/xrNetServer/NET_Compressor.cpp +++ b/src/xrNetServer/NET_Compressor.cpp @@ -26,7 +26,7 @@ # define ENCODE rtc9_compress # define DECODE rtc9_decompress # else // NET_USE_LZO_COMPRESSION -# include "../xrCore/ppmd_compressor.h" +# include "xrCore/ppmd_compressor.h" # define ENCODE ppmd_compress # define DECODE ppmd_decompress # endif // NET_USE_LZO_COMPRESSION diff --git a/src/xrNetServer/NET_Compressor.h b/src/xrNetServer/NET_Compressor.h index 60e441ef2a5..773c7a73583 100644 --- a/src/xrNetServer/NET_Compressor.h +++ b/src/xrNetServer/NET_Compressor.h @@ -2,7 +2,7 @@ #define AFX_NET_COMPRESSOR_H__21E1ED1C_BF92_4BF0_94A8_18A27486EBFD__INCLUDED_ #pragma once -#include "../xrcore/xrSyncronize.h" +#include "xrCore/xrSyncronize.h" class XRNETSERVER_API NET_Compressor { diff --git a/src/xrNetServer/NET_PlayersMonitor.h b/src/xrNetServer/NET_PlayersMonitor.h index cf2d033b91d..f3c7155a5d8 100644 --- a/src/xrNetServer/NET_PlayersMonitor.h +++ b/src/xrNetServer/NET_PlayersMonitor.h @@ -3,7 +3,7 @@ #include "net_shared.h" #include "NET_Common.h" -#include "../xrCore/fastdelegate.h" +#include "xrCore/fastdelegate.h" class IClient; diff --git a/src/xrNetServer/NET_Server.cpp b/src/xrNetServer/NET_Server.cpp index 3f1ccbe84ba..778503280bd 100644 --- a/src/xrNetServer/NET_Server.cpp +++ b/src/xrNetServer/NET_Server.cpp @@ -5,7 +5,7 @@ #include #include "NET_Log.h" -#include "../xrGameSpy/xrGameSpy_MainDefs.h" +#include "xrGameSpy/xrGameSpy_MainDefs.h" #pragma warning(push) #pragma warning(disable:4995) diff --git a/src/xrNetServer/NET_Shared.h b/src/xrNetServer/NET_Shared.h index 43f4e5071bf..ad1058d9356 100644 --- a/src/xrNetServer/NET_Shared.h +++ b/src/xrNetServer/NET_Shared.h @@ -9,7 +9,7 @@ #endif #endif -#include "../xrCore/net_utils.h" +#include "xrCore/net_utils.h" #include #include "net_messages.h" diff --git a/src/xrNetServer/ip_filter.cpp b/src/xrNetServer/ip_filter.cpp index 6fb70ad4314..dc99523c73b 100644 --- a/src/xrNetServer/ip_filter.cpp +++ b/src/xrNetServer/ip_filter.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "ip_filter.h" -#include "..\xrCore\xr_ini.h" +#include "xrCore/xr_ini.h" ip_filter::ip_filter() { diff --git a/src/xrNetServer/stdafx.h b/src/xrNetServer/stdafx.h index 3538a250393..98b01009066 100644 --- a/src/xrNetServer/stdafx.h +++ b/src/xrNetServer/stdafx.h @@ -9,7 +9,7 @@ #pragma once -#include "../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #pragma warning(push) #pragma warning(disable:4995) diff --git a/src/xrParticles/stdafx.h b/src/xrParticles/stdafx.h index 2112ae2a02f..e4023822a1b 100644 --- a/src/xrParticles/stdafx.h +++ b/src/xrParticles/stdafx.h @@ -9,7 +9,7 @@ #pragma once -#include "../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #include "psystem.h" diff --git a/src/xrPhysics/ActorCameraCollision.cpp b/src/xrPhysics/ActorCameraCollision.cpp index cf1a3a8bb36..7ca49961663 100644 --- a/src/xrPhysics/ActorCameraCollision.cpp +++ b/src/xrPhysics/ActorCameraCollision.cpp @@ -3,7 +3,7 @@ //#include "Actor.h" #include "actorcameracollision.h" -#include "../xrEngine/CameraBase.h" +#include "xrEngine/CameraBase.h" #include "xrEngine/GameMtlLib.h" #include "phworld.h" diff --git a/src/xrPhysics/CalculateTriangle.h b/src/xrPhysics/CalculateTriangle.h index 530d70bec15..75d551e9733 100644 --- a/src/xrPhysics/CalculateTriangle.h +++ b/src/xrPhysics/CalculateTriangle.h @@ -3,9 +3,9 @@ //#include "Level.h" #include "Geometry.h" #include "tri-colliderknoopc/dtricollidermath.h" -//#include "../xrengine/IGame_Level.h" +//#include "xrEngine/IGame_Level.h" #include "ode_redefine.h" -#include "../xrcdb/xr_area.h" +#include "xrCDB/xr_area.h" //#include "phworld.h" #pragma warning(disable:4995) #pragma warning(disable:4267) diff --git a/src/xrPhysics/ElevatorState.cpp b/src/xrPhysics/ElevatorState.cpp index 1bf10d4ba6b..8289a61f394 100644 --- a/src/xrPhysics/ElevatorState.cpp +++ b/src/xrPhysics/ElevatorState.cpp @@ -4,9 +4,9 @@ #include "PHCharacter.h" #include "MathUtils.h" #include "PHWorld.h" -#include "../xrengine/device.h" +#include "xrEngine/device.h" #ifdef DEBUG -#include "../xrEngine/Statgraph.h" +#include "xrEngine/Statgraph.h" #include "debug_output.h" #endif static const float getting_on_dist =0.3f; diff --git a/src/xrPhysics/ExtendedGeom.h b/src/xrPhysics/ExtendedGeom.h index 569e440c615..e4bbca39b33 100644 --- a/src/xrPhysics/ExtendedGeom.h +++ b/src/xrPhysics/ExtendedGeom.h @@ -6,8 +6,8 @@ #endif #include "PHObject.h" //#include "ode_include.h" -#include "../3rd party/ode/include/ode/common.h" -#include "../3rd party/ode/include/ode/collision.h" +#include "3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/collision.h" #include "physicscommon.h" #include "MathUtils.h" #ifdef DEBUG diff --git a/src/xrPhysics/Geometry.h b/src/xrPhysics/Geometry.h index 6fc5ff2f9dc..0aaa3178fea 100644 --- a/src/xrPhysics/Geometry.h +++ b/src/xrPhysics/Geometry.h @@ -3,7 +3,7 @@ #include "PhysicsCommon.h" #include "ExtendedGeom.h" #include "mathutilsode.h" -#include "../xrEngine/iphysicsgeometry.h" +#include "xrEngine/iphysicsgeometry.h" //this is equivalent dMULTIPLYOP0_333 whith consequent transposion of A #define dMULTIPLYOP3_333(A,op,B,C) \ diff --git a/src/xrPhysics/MathUtils.cpp b/src/xrPhysics/MathUtils.cpp index bceaf4c01c5..887aeea1985 100644 --- a/src/xrPhysics/MathUtils.cpp +++ b/src/xrPhysics/MathUtils.cpp @@ -1,6 +1,6 @@ #include "stdafx.h" #include "mathutils.h" -#include "../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" XRPHYSICS_API const float phInfinity = dInfinity; /* #include "MathUtils.h" diff --git a/src/xrPhysics/MathUtilsOde.h b/src/xrPhysics/MathUtilsOde.h index 5d40bc4d285..29e7320dbc8 100644 --- a/src/xrPhysics/MathUtilsOde.h +++ b/src/xrPhysics/MathUtilsOde.h @@ -2,13 +2,13 @@ #pragma warning(disable:4995) #pragma warning(disable:4267) -#include "../3rd party/ode/include/ode/common.h" -#include "../3rd party/ode/include/ode/odemath.h" -#include "../3rd party/ode/include/ode/objects.h" -#include "../3rd party/ode/include/ode/rotation.h" -#include "../3rd party/ode/include/ode/compatibility.h" -#include "../3rd party/ode/include/ode/collision.h" -#include "../3rd party/ode/include/ode/matrix.h" +#include "3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/odemath.h" +#include "3rd party/ode/include/ode/objects.h" +#include "3rd party/ode/include/ode/rotation.h" +#include "3rd party/ode/include/ode/compatibility.h" +#include "3rd party/ode/include/ode/collision.h" +#include "3rd party/ode/include/ode/matrix.h" #include "mathutils.h" #include "ode_redefine.h" diff --git a/src/xrPhysics/PHAICharacter.cpp b/src/xrPhysics/PHAICharacter.cpp index 4eca3a77990..4e261cffc0c 100644 --- a/src/xrPhysics/PHAICharacter.cpp +++ b/src/xrPhysics/PHAICharacter.cpp @@ -8,10 +8,10 @@ #include "tri-colliderKNoOPC\__aabb_tri.h" #include "phaicharacter.h" -#include "../xrengine/device.h" +#include "xrEngine/device.h" #ifdef DEBUG -//# include "../xrEngine/StatGraph.h" +//# include "xrEngine/StatGraph.h" # include "debug_output.h" //# include "level.h" //# include "debug_renderer.h" diff --git a/src/xrPhysics/PHActivationShape.cpp b/src/xrPhysics/PHActivationShape.cpp index 9180d1ee0ef..b5c82189afc 100644 --- a/src/xrPhysics/PHActivationShape.cpp +++ b/src/xrPhysics/PHActivationShape.cpp @@ -11,15 +11,15 @@ #include "xrEngine/GameMtlLib.h" //#include "Level.h" #include "PHWorld.h" -#include "../3rd party/ode/ode/src/util.h" +#include "3rd party/ode/ode/src/util.h" #ifdef DEBUG # include "debug_output.h" #endif // DEBUG #include "PHDynamicData.h" -#include "../xrserverentities/PHSynchronize.h" -#include "../xrserverentities/phnetstate.h" +#include "xrServerEntities/PHSynchronize.h" +#include "xrServerEntities/phnetstate.h" static float max_depth =0.f; static float friction_factor =0.f; static const float cfm =1.e-10f; diff --git a/src/xrPhysics/PHBaseBodyEffector.h b/src/xrPhysics/PHBaseBodyEffector.h index 7423b89e715..499957358b8 100644 --- a/src/xrPhysics/PHBaseBodyEffector.h +++ b/src/xrPhysics/PHBaseBodyEffector.h @@ -2,7 +2,7 @@ #define PH_BASE_BODY_EFFECTOR_H //#include "ode_include.h" -#include "../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" class CPHBaseBodyEffector { protected: diff --git a/src/xrPhysics/PHCapture.cpp b/src/xrPhysics/PHCapture.cpp index 98979a9e8e5..219bafe4660 100644 --- a/src/xrPhysics/PHCapture.cpp +++ b/src/xrPhysics/PHCapture.cpp @@ -8,10 +8,10 @@ //#include "entity_alive.h" //#include "phmovementcontrol.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "iphysicsshellholder.h" #include "xrCore/Animation/Bone.hpp" -#include "../xrengine/device.h" +#include "xrEngine/device.h" #include "mathutilsode.h" #include "phelement.h" diff --git a/src/xrPhysics/PHCapture.h b/src/xrPhysics/PHCapture.h index 9b05c7bf830..edff6f58833 100644 --- a/src/xrPhysics/PHCapture.h +++ b/src/xrPhysics/PHCapture.h @@ -7,7 +7,7 @@ //#include "gameobject.h" //#include "physicsshellholder.h" #include "phisland.h" -#include "../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" #include "iphcapture.h" class IPhysicsShellHolder; class CPHCharacter; diff --git a/src/xrPhysics/PHCaptureInit.cpp b/src/xrPhysics/PHCaptureInit.cpp index a9567a98cfa..6210874c3bf 100644 --- a/src/xrPhysics/PHCaptureInit.cpp +++ b/src/xrPhysics/PHCaptureInit.cpp @@ -6,13 +6,13 @@ #include "PHCapture.h" //#include "Entity.h" //#include "inventory_item.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" //#include "Actor.h" //#include "Inventory.h" //#include "CaptureBoneCallback.h" #include "iphysicsshellholder.h" #include "xrCore/Animation/Bone.hpp" -#include "../xrengine/device.h" +#include "xrEngine/device.h" extern class CPHWorld *ph_world; /////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////// diff --git a/src/xrPhysics/PHCharacter.cpp b/src/xrPhysics/PHCharacter.cpp index 8503a2acdb1..3d03a506424 100644 --- a/src/xrPhysics/PHCharacter.cpp +++ b/src/xrPhysics/PHCharacter.cpp @@ -10,7 +10,7 @@ #include "xrEngine/GameMtlLib.h" #include "tri-colliderKNoOPC\__aabb_tri.h" -#include "../3rd party/ode/ode/src/util.h" +#include "3rd party/ode/ode/src/util.h" #include "ph_valid_ode.h" #include "Phaicharacter.h" #include "phactorcharacter.h" diff --git a/src/xrPhysics/PHCharacter.h b/src/xrPhysics/PHCharacter.h index 1145f5a9bef..c564caacb8b 100644 --- a/src/xrPhysics/PHCharacter.h +++ b/src/xrPhysics/PHCharacter.h @@ -4,10 +4,10 @@ #endif #include "PHObject.h" #include "PHInterpolation.h" -#include "../xrserverentities/PHSynchronize.h" +#include "xrServerEntities/PHSynchronize.h" #include "PHDisabling.h" -#include "../xrEngine/iphysicsshell.h" +#include "xrEngine/iphysicsshell.h" class IPhysicsShellHolder; diff --git a/src/xrPhysics/PHContactBodyEffector.h b/src/xrPhysics/PHContactBodyEffector.h index a1889ac6d57..043645a599f 100644 --- a/src/xrPhysics/PHContactBodyEffector.h +++ b/src/xrPhysics/PHContactBodyEffector.h @@ -1,7 +1,7 @@ #ifndef PH_CONTACT_BODY_EFFECTOR_H #define PH_CONTACT_BODY_EFFECTOR_H #include "PHBaseBodyEffector.h" -#include "../3rd party/ode/include/ode/contact.h" +#include "3rd party/ode/include/ode/contact.h" struct SGameMtl; class CPHContactBodyEffector : public CPHBaseBodyEffector { diff --git a/src/xrPhysics/PHDisabling.h b/src/xrPhysics/PHDisabling.h index b6f2aa5b3a1..136b439a733 100644 --- a/src/xrPhysics/PHDisabling.h +++ b/src/xrPhysics/PHDisabling.h @@ -3,7 +3,7 @@ #include "DisablingParams.h" //#include "ode_include.h" -#include "../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" struct SDisableVector { diff --git a/src/xrPhysics/PHDynamicData.h b/src/xrPhysics/PHDynamicData.h index 463d14f8aa6..3822f99ed88 100644 --- a/src/xrPhysics/PHDynamicData.h +++ b/src/xrPhysics/PHDynamicData.h @@ -4,7 +4,7 @@ //#include "ode_include.h" -//#include "../3rd party/ode/include/ode/common.h" +//#include "3rd party/ode/include/ode/common.h" #include "PHInterpolation.h" #include "MathUtilsOde.h" #if !defined(AFX_PHDynamicData_H__ACC01646_B581_4639_B78C_30311432021B__INCLUDED_) diff --git a/src/xrPhysics/PHElement.cpp b/src/xrPhysics/PHElement.cpp index 2259a75f7cc..d851de2b0ff 100644 --- a/src/xrPhysics/PHElement.cpp +++ b/src/xrPhysics/PHElement.cpp @@ -9,10 +9,10 @@ #include "IPhysicsShellHolder.h" #include "ph_valid_ode.h" //#include "game_object_space.h" -//#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/Kinematics.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "../3rd party/ode/ode/src/util.h" +//#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "3rd party/ode/ode/src/util.h" #ifdef DEBUG # include "debug_output.h" @@ -23,7 +23,7 @@ #pragma warning(disable:4995) #pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/collision_kernel.h" +#include "3rd party/ode/ode/src/collision_kernel.h" #pragma warning(default:4267) diff --git a/src/xrPhysics/PHElement.h b/src/xrPhysics/PHElement.h index a3877ba8be3..2d257efa7bf 100644 --- a/src/xrPhysics/PHElement.h +++ b/src/xrPhysics/PHElement.h @@ -5,7 +5,7 @@ #include "Geometry.h" #include "phdefs.h" #include "PhysicsCommon.h" -#include "../xrserverentities/PHSynchronize.h" +#include "xrServerEntities/PHSynchronize.h" #include "PHDisabling.h" #include "PHGeometryOwner.h" #include "PHInterpolation.h" diff --git a/src/xrPhysics/PHFracture.cpp b/src/xrPhysics/PHFracture.cpp index c4336c3a026..2fb19e98afd 100644 --- a/src/xrPhysics/PHFracture.cpp +++ b/src/xrPhysics/PHFracture.cpp @@ -5,13 +5,13 @@ #include "PHShell.h" #include "console_vars.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "ph_valid_ode.h" #include "xrCore/Animation/Bone.hpp" #pragma warning(disable:4995) #pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/joint.h" +#include "3rd party/ode/ode/src/joint.h" #pragma warning(default:4995) #pragma warning(default:4267) extern class CPHWorld *ph_world; diff --git a/src/xrPhysics/PHFracture.h b/src/xrPhysics/PHFracture.h index 3a6dec4927a..190543ceeac 100644 --- a/src/xrPhysics/PHFracture.h +++ b/src/xrPhysics/PHFracture.h @@ -6,8 +6,8 @@ #include "PHDefs.h" #include "PHImpact.h" //#include "ode_include.h" -#include "../3rd party/ode/include/ode/common.h" -#include "../3rd party/ode/include/ode/mass.h" +#include "3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/mass.h" class CPHFracture; class CPHElement; diff --git a/src/xrPhysics/PHGeometryOwner.cpp b/src/xrPhysics/PHGeometryOwner.cpp index a1079c6d5c9..13e55ab2c54 100644 --- a/src/xrPhysics/PHGeometryOwner.cpp +++ b/src/xrPhysics/PHGeometryOwner.cpp @@ -2,7 +2,7 @@ #include "PHGeometryOwner.h" #include "phworld.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "xrCore/Animation/Bone.hpp" CPHGeometryOwner::CPHGeometryOwner() diff --git a/src/xrPhysics/PHInterpolation.h b/src/xrPhysics/PHInterpolation.h index 81e8bd8a8c5..e993cbcdb92 100644 --- a/src/xrPhysics/PHInterpolation.h +++ b/src/xrPhysics/PHInterpolation.h @@ -3,7 +3,7 @@ #define PHINTERPOLATON_H //#include "ode_include.h" -#include "../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" class CPHInterpolation { diff --git a/src/xrPhysics/PHIsland.h b/src/xrPhysics/PHIsland.h index 70fe433eb5b..80815b47f4a 100644 --- a/src/xrPhysics/PHIsland.h +++ b/src/xrPhysics/PHIsland.h @@ -3,12 +3,12 @@ #pragma warning(disable:4995) #pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/objects.h" -#include "../3rd party/ode/ode/src/joint.h" +#include "3rd party/ode/ode/src/objects.h" +#include "3rd party/ode/ode/src/joint.h" #pragma warning(default:4995) #pragma warning(default:4267) -#include "../3rd party/ode/include/ode/objects.h" +#include "3rd party/ode/include/ode/objects.h" #include "PhysicsCommon.h" diff --git a/src/xrPhysics/PHJoint.cpp b/src/xrPhysics/PHJoint.cpp index 353306fd2a5..25ae0b2e49a 100644 --- a/src/xrPhysics/PHJoint.cpp +++ b/src/xrPhysics/PHJoint.cpp @@ -5,7 +5,7 @@ #include "PHJointDestroyInfo.h" /////////////////////////////////////////////////////////////// ///#pragma warning(disable:4995) -////#include "../xrEngine/ode/src/collision_kernel.h" +////#include "xrEngine/ode/src/collision_kernel.h" //#include <../ode/src/joint.h> //#include <../ode/src/objects.h> diff --git a/src/xrPhysics/PHJoint.h b/src/xrPhysics/PHJoint.h index 583d25fedfb..f77ef196199 100644 --- a/src/xrPhysics/PHJoint.h +++ b/src/xrPhysics/PHJoint.h @@ -3,7 +3,7 @@ #ifndef PH_JOINT #define PH_JOINT #include "PhysicsShell.h" -#include "../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" #include "physics_scripted.h" class CPHJointDestroyInfo; class CPHJoint: diff --git a/src/xrPhysics/PHJointDestroyInfo.h b/src/xrPhysics/PHJointDestroyInfo.h index 3537d41a139..705eb3a76db 100644 --- a/src/xrPhysics/PHJointDestroyInfo.h +++ b/src/xrPhysics/PHJointDestroyInfo.h @@ -2,7 +2,7 @@ #define PHJOINT_DESTROY_INFO_H //#include "ode_include.h" -#include "../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" class CPHJointDestroyInfo { friend class CPHShellSplitterHolder; diff --git a/src/xrPhysics/PHMoveStorage.cpp b/src/xrPhysics/PHMoveStorage.cpp index c0c15f67730..2166370da97 100644 --- a/src/xrPhysics/PHMoveStorage.cpp +++ b/src/xrPhysics/PHMoveStorage.cpp @@ -2,7 +2,7 @@ #include "phmovestorage.h" #pragma warning(disable:4995) #pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/collision_kernel.h" +#include "3rd party/ode/ode/src/collision_kernel.h" #pragma warning(default:4995) #pragma warning(default:4267) struct dxGeomTransform : public dxGeom { diff --git a/src/xrPhysics/PHObject.h b/src/xrPhysics/PHObject.h index 276b78cc8dc..b9e95cfa0fa 100644 --- a/src/xrPhysics/PHObject.h +++ b/src/xrPhysics/PHObject.h @@ -1,7 +1,7 @@ #pragma once #ifndef CPHOBJECT #define CPHOBJECT -#include "../xrcdb/ispatial.h" +#include "xrCDB/ispatial.h" #include "PHItemList.h" #include "PHIsland.h" typedef u32 CLClassBits; diff --git a/src/xrPhysics/PHShell.cpp b/src/xrPhysics/PHShell.cpp index 91a92981d89..8787c0f50cf 100644 --- a/src/xrPhysics/PHShell.cpp +++ b/src/xrPhysics/PHShell.cpp @@ -10,21 +10,21 @@ #include "SpaceUtils.h" #include "MathUtils.h" #include "iPhysicsShellHolder.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "PHCollideValidator.h" -#include "../xrCore/animation/Bone.hpp" +#include "xrCore/animation/Bone.hpp" #include "xrEngine/GameMtlLib.h" //#include "game_object_space.h" //#pragma warning(disable:4995) //#pragma warning(disable:4267) -//#include "../3rd party/ode/ode/src/collision_kernel.h" +//#include "3rd party/ode/ode/src/collision_kernel.h" //#pragma warning(default:4995) //#pragma warning(default:4267) /////////////////////////////////////////////////////////////// ///#pragma warning(disable:4995) -//#include "../3rd party/ode/ode/src/joint.h" -//#include "../3rd party/ode/ode/src/objects.h" +//#include "3rd party/ode/ode/src/joint.h" +//#include "3rd party/ode/ode/src/objects.h" //#pragma warning(default:4995) /////////////////////////////////////////////////////////////////// diff --git a/src/xrPhysics/PHShellActivate.cpp b/src/xrPhysics/PHShellActivate.cpp index d0d0994c2e1..e8ea69c7b75 100644 --- a/src/xrPhysics/PHShellActivate.cpp +++ b/src/xrPhysics/PHShellActivate.cpp @@ -9,13 +9,13 @@ //#include "Level.h" #include "iphysicsshellholder.h" #include "PhysicsShellAnimator.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" /////////////////////////////////////////////////////////////// ///#pragma warning(disable:4995) -//#include "../3rd party/ode/ode/src/collision_kernel.h" -//#include "../3rd party/ode/ode/src/joint.h" -//#include "../3rd party/ode/ode/src/objects.h" +//#include "3rd party/ode/ode/src/collision_kernel.h" +//#include "3rd party/ode/ode/src/joint.h" +//#include "3rd party/ode/ode/src/objects.h" //#pragma warning(default:4995) /////////////////////////////////////////////////////////////////// diff --git a/src/xrPhysics/PHShellSplitter.cpp b/src/xrPhysics/PHShellSplitter.cpp index 817e679c9ae..082a3ffc08e 100644 --- a/src/xrPhysics/PHShellSplitter.cpp +++ b/src/xrPhysics/PHShellSplitter.cpp @@ -6,7 +6,7 @@ #include "PHJointDestroyInfo.h" #include "Geometry.h" #include "MathUtils.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "PHCollideValidator.h" #include "ph_valid_ode.h" CPHShellSplitterHolder::CPHShellSplitterHolder(CPHShell* shell) diff --git a/src/xrPhysics/PHSimpleCharacter.cpp b/src/xrPhysics/PHSimpleCharacter.cpp index 713a02a3554..bb2c31b8f31 100644 --- a/src/xrPhysics/PHSimpleCharacter.cpp +++ b/src/xrPhysics/PHSimpleCharacter.cpp @@ -3,7 +3,7 @@ #include "PHDynamicData.h" #include "ExtendedGeom.h" #include "xrCDB/Intersect.hpp" -#include "../xrEngine/xr_object_list.h" +#include "xrEngine/xr_object_list.h" #include "tri-colliderKNoOPC\__aabb_tri.h" #include "PHSimpleCharacter.h" #include "PHContactBodyEffector.h" @@ -16,7 +16,7 @@ #include "xrEngine/GameMtlLib.h" //#include "gameobject.h" #include "iphysicsshellholder.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "PHSimpleCharacterInline.h" #include "DamageSource.h" #include "PHCollideValidator.h" @@ -27,7 +27,7 @@ //#include "phvalide.h" #include "xrCore/Animation/Bone.hpp" -#include "../xrengine/xr_object.h" +#include "xrEngine/xr_object.h" #include "ph_valid_ode.h" IC bool PhOutOfBoundaries (const Fvector& v) diff --git a/src/xrPhysics/PHStaticGeomShell.cpp b/src/xrPhysics/PHStaticGeomShell.cpp index cbb144c5103..95d9fe4e753 100644 --- a/src/xrPhysics/PHStaticGeomShell.cpp +++ b/src/xrPhysics/PHStaticGeomShell.cpp @@ -6,9 +6,9 @@ #include "phcharacter.h" #include "iclimableobject.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/Kinematics.h" #include "PHCollideValidator.h" -#include "../xrengine/xr_object.h" +#include "xrEngine/xr_object.h" #include "xrCore/Animation/Bone.hpp" //#include "game_object_space.h" diff --git a/src/xrPhysics/PHWorld.cpp b/src/xrPhysics/PHWorld.cpp index 390d4394d76..da1ccd0f4d1 100644 --- a/src/xrPhysics/PHWorld.cpp +++ b/src/xrPhysics/PHWorld.cpp @@ -15,14 +15,14 @@ #endif //#include "PHCommander.h" //#include "PHSimpleCalls.h" -#include "../xrserverentities/PHSynchronize.h" -#include "../xrserverentities/phnetstate.h" +#include "xrServerEntities/PHSynchronize.h" +#include "xrServerEntities/phnetstate.h" #include "geometrybits.h" #include "console_vars.h" -#include "../xrengine/device.h" -#include "../xrengine/defines.h" -#include "../xrcdb/xr_area.h" -#include "../xrcore/fs_internal.h" +#include "xrEngine/device.h" +#include "xrEngine/defines.h" +#include "xrCDB/xr_area.h" +#include "xrCore/fs_internal.h" #ifdef DEBUG // void DBG_ObjAfterPhDataUpdate ( CPHObject *obj ); // void DBG_ObjBeforePhDataUpdate ( CPHObject *obj ); diff --git a/src/xrPhysics/PHWorld.h b/src/xrPhysics/PHWorld.h index 05778d1d236..404c2a48f5e 100644 --- a/src/xrPhysics/PHWorld.h +++ b/src/xrPhysics/PHWorld.h @@ -5,7 +5,7 @@ #include "IPHWorld.h" #include #include "physics_scripted.h" -#include "../xrEngine/pure.h" +#include "xrEngine/pure.h" // refs struct SGameMtlPair; //class CPHCommander; diff --git a/src/xrPhysics/Physics.cpp b/src/xrPhysics/Physics.cpp index a4db7f8f0b7..dc66e97c3be 100644 --- a/src/xrPhysics/Physics.cpp +++ b/src/xrPhysics/Physics.cpp @@ -13,9 +13,9 @@ /////////////////////////////////////////////////////////////// #pragma warning(disable:4995) #pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/collision_kernel.h" -#include "../3rd party/ode/ode/src/joint.h" -#include "../3rd party/ode/ode/src/objects.h" +#include "3rd party/ode/ode/src/collision_kernel.h" +#include "3rd party/ode/ode/src/joint.h" +#include "3rd party/ode/ode/src/objects.h" #pragma warning(default:4267) #pragma warning(default:4995) diff --git a/src/xrPhysics/Physics.h b/src/xrPhysics/Physics.h index ea34ecb92a7..7d6e3d625eb 100644 --- a/src/xrPhysics/Physics.h +++ b/src/xrPhysics/Physics.h @@ -6,7 +6,7 @@ #include "PhysicsShell.h" #include "PHObject.h" #include "PHInterpolation.h" -#include "../xrcore/_cylinder.h" +#include "xrCore/_cylinder.h" #include "BlockAllocator.h" #include "PhysicsCommon.h" #include "PHWorld.h" diff --git a/src/xrPhysics/PhysicsCommon.h b/src/xrPhysics/PhysicsCommon.h index ca7cb4c1eff..4edc17c5b15 100644 --- a/src/xrPhysics/PhysicsCommon.h +++ b/src/xrPhysics/PhysicsCommon.h @@ -4,7 +4,7 @@ #include "DisablingParams.h" #include "physicsexternalcommon.h" //#include "ode_include.h" -//#include "../3rd party/ode/include/ode/common.h" +//#include "3rd party/ode/include/ode/common.h" extern XRPHYSICS_API const float default_l_limit ; extern XRPHYSICS_API const float default_w_limit ; diff --git a/src/xrPhysics/PhysicsShell.cpp b/src/xrPhysics/PhysicsShell.cpp index 698a93038fa..26419be2cc9 100644 --- a/src/xrPhysics/PhysicsShell.cpp +++ b/src/xrPhysics/PhysicsShell.cpp @@ -15,8 +15,8 @@ //#include "objectdump.h" #include "phvalide.h" -#include "../Include/xrRender/Kinematics.h" -#include "../xrengine/xr_object.h" +#include "Include/xrRender/Kinematics.h" +#include "xrEngine/xr_object.h" #include "xrCore/Animation/Bone.hpp" extern CPHWorld *ph_world; diff --git a/src/xrPhysics/PhysicsShell.h b/src/xrPhysics/PhysicsShell.h index e644f38fdf6..dd501cc2792 100644 --- a/src/xrPhysics/PhysicsShell.h +++ b/src/xrPhysics/PhysicsShell.h @@ -5,9 +5,9 @@ #include "PHDefs.h" #include "PhysicsCommon.h" #include "icollidevalidator.h" -#include "../xrserverentities/alife_space.h" +#include "xrServerEntities/alife_space.h" //#include "script_export_space.h" -#include "../xrEngine/iphysicsshell.h" +#include "xrEngine/iphysicsshell.h" #include "iphysics_scripted.h" class CPhysicsJoint; class CPhysicsElement; diff --git a/src/xrPhysics/PhysicsShellAnimator.cpp b/src/xrPhysics/PhysicsShellAnimator.cpp index f0cc76c8530..f3772c69e4b 100644 --- a/src/xrPhysics/PhysicsShellAnimator.cpp +++ b/src/xrPhysics/PhysicsShellAnimator.cpp @@ -1,8 +1,8 @@ #include "StdAfx.h" #include "PhysicsShellAnimator.h" #include "PhysicsShellAnimatorBoneData.h" -#include "../Include/xrRender/KinematicsAnimated.h" -#include "../Include/xrRender/Kinematics.h" +#include "Include/xrRender/KinematicsAnimated.h" +#include "Include/xrRender/Kinematics.h" #include "PHDynamicData.h" //#include "game_object_space.h" #include "IPhysicsShellHolder.h" diff --git a/src/xrPhysics/dRayMotions.cpp b/src/xrPhysics/dRayMotions.cpp index a79ed3a7592..3ebd7656b83 100644 --- a/src/xrPhysics/dRayMotions.cpp +++ b/src/xrPhysics/dRayMotions.cpp @@ -4,13 +4,13 @@ struct dContactGeom; int dCollideCylRay(dxGeom *o1, dxGeom *o2, int flags,dContactGeom *contact, int skip); //#pragma warning(disable:4995) //#pragma warning(disable:4267) -//#include "../3rd party/ode/ode/src/collision_kernel.h" +//#include "3rd party/ode/ode/src/collision_kernel.h" //#pragma warning(default:4995) //#pragma warning(default:4267) #pragma warning(disable:4995) #pragma warning(disable:4267) -#include "../3rd party/ode/ode/src/collision_std.h" +#include "3rd party/ode/ode/src/collision_std.h" #pragma warning(default:4995) #pragma warning(default:4267) struct dxRayMotions diff --git a/src/xrPhysics/dcylinder/dCylinder.h b/src/xrPhysics/dcylinder/dCylinder.h index 3582fe61d3a..e228e57a053 100644 --- a/src/xrPhysics/dcylinder/dCylinder.h +++ b/src/xrPhysics/dcylinder/dCylinder.h @@ -4,7 +4,7 @@ -#include "../../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" struct dxCylinder; extern int dCylinderClassUser; diff --git a/src/xrPhysics/ode_include.h b/src/xrPhysics/ode_include.h index b9b4cedc121..fa341aac65b 100644 --- a/src/xrPhysics/ode_include.h +++ b/src/xrPhysics/ode_include.h @@ -3,7 +3,7 @@ #endif #pragma warning(disable:4995) #pragma warning(disable:4267) -#include "../3rd party/ode/include/ode/ode.h" +#include "3rd party/ode/include/ode/ode.h" #pragma warning(default:4995) #pragma warning(default:4267) #include "ode_redefine.h" \ No newline at end of file diff --git a/src/xrPhysics/ph_valid_ode.h b/src/xrPhysics/ph_valid_ode.h index ee67a1f1fd0..175a8006881 100644 --- a/src/xrPhysics/ph_valid_ode.h +++ b/src/xrPhysics/ph_valid_ode.h @@ -1,9 +1,9 @@ #pragma once //#include "ode_include.h" -#include "../3rd party/ode/include/ode/common.h" -#include "../3rd party/ode/include/ode/mass.h" -#include "../3rd party/ode/include/ode/objects.h" +#include "3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/mass.h" +#include "3rd party/ode/include/ode/objects.h" IC BOOL dV_valid (const dReal * v) { return _valid(v[0])&&_valid(v[1])&&_valid(v[2]); diff --git a/src/xrPhysics/stdafx.h b/src/xrPhysics/stdafx.h index 37e1696bb39..60cef54b877 100644 --- a/src/xrPhysics/stdafx.h +++ b/src/xrPhysics/stdafx.h @@ -5,25 +5,25 @@ #define ENGINE_API #define DLL_API #define ECORE_API -//#include "../xrEngine/stdafx.h" +//#include "xrEngine/stdafx.h" -#include "../xrCore/xrCore.h" +#include "xrCore/xrCore.h" -#include "../xrServerEntities/smart_cast.h" -//#include "../xrEngine/pure.h" -//#include "../xrEngine/engineapi.h" -//#include "../xrEngine/eventapi.h" +#include "xrServerEntities/smart_cast.h" +//#include "xrEngine/pure.h" +//#include "xrEngine/engineapi.h" +//#include "xrEngine/eventapi.h" -#include "../xrcdb/xrcdb.h" -#include "../xrsound/sound.h" -//#include "../xrengine/IGame_Level.h" +#include "xrCDB/xrCDB.h" +#include "xrSound/sound.h" +//#include "xrEngine/IGame_Level.h" #pragma comment( lib, "xrCore.lib" ) #include "xrPhysics.h" -#include "../include/xrapi/xrapi.h" +#include "Include/xrAPI/xrapi.h" #ifdef DEBUG #include "d3d9types.h" #endif diff --git a/src/xrPhysics/tri-colliderknoopc/dSortTriPrimitive.h b/src/xrPhysics/tri-colliderknoopc/dSortTriPrimitive.h index a40f094f2b7..aff6ac25c8d 100644 --- a/src/xrPhysics/tri-colliderknoopc/dSortTriPrimitive.h +++ b/src/xrPhysics/tri-colliderknoopc/dSortTriPrimitive.h @@ -7,7 +7,7 @@ #include "../MathUtils.h" #include "../console_vars.h" #include "../phworld.h" -#include "../../xrcdb/xr_area.h" +#include "xrCDB/xr_area.h" #include "xrEngine/GameMtlLib.h" #ifdef DEBUG #include "../debug_output.h" diff --git a/src/xrPhysics/tri-colliderknoopc/dTriColliderCommon.h b/src/xrPhysics/tri-colliderknoopc/dTriColliderCommon.h index 628a63e7bff..95c124ef802 100644 --- a/src/xrPhysics/tri-colliderknoopc/dTriColliderCommon.h +++ b/src/xrPhysics/tri-colliderknoopc/dTriColliderCommon.h @@ -3,7 +3,7 @@ //#include "../ode_include.h" -#include "../../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" #include "../ExtendedGeom.h" #include "dTriColliderMath.h" diff --git a/src/xrPhysics/tri-colliderknoopc/dTriColliderMath.h b/src/xrPhysics/tri-colliderknoopc/dTriColliderMath.h index b1c9abaa745..73e3c08fc5f 100644 --- a/src/xrPhysics/tri-colliderknoopc/dTriColliderMath.h +++ b/src/xrPhysics/tri-colliderknoopc/dTriColliderMath.h @@ -2,7 +2,7 @@ #define D_TRI_COLLIDER_MATH_H #include "__aabb_tri.h" //#include "../ode_include.h" -#include "../../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" #include "../mathutilsode.h" #include "dcTriangle.h" diff --git a/src/xrPhysics/tri-colliderknoopc/dTriCylinder.cpp b/src/xrPhysics/tri-colliderknoopc/dTriCylinder.cpp index 79b515e3993..c2eba456ec6 100644 --- a/src/xrPhysics/tri-colliderknoopc/dTriCylinder.cpp +++ b/src/xrPhysics/tri-colliderknoopc/dTriCylinder.cpp @@ -5,7 +5,7 @@ #include "../MathUtils.h" #include "dcTrilistCollider.h" #include "../phworld.h" -#include "../../xrcdb/xr_area.h" +#include "xrCDB/xr_area.h" ////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////// diff --git a/src/xrPhysics/tri-colliderknoopc/dTriList.h b/src/xrPhysics/tri-colliderknoopc/dTriList.h index 28ae70eaeab..3be14c04f90 100644 --- a/src/xrPhysics/tri-colliderknoopc/dTriList.h +++ b/src/xrPhysics/tri-colliderknoopc/dTriList.h @@ -1,6 +1,6 @@ //#include "stdafx.h" //#include "ode_include.h" -#include "../../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" /* Class ID */ diff --git a/src/xrPhysics/tri-colliderknoopc/dTriSphere.cpp b/src/xrPhysics/tri-colliderknoopc/dTriSphere.cpp index 84c91d9ddb7..724d86c8a0b 100644 --- a/src/xrPhysics/tri-colliderknoopc/dTriSphere.cpp +++ b/src/xrPhysics/tri-colliderknoopc/dTriSphere.cpp @@ -4,7 +4,7 @@ #include "dTriSphere.h" #include "dctrilistcollider.h" #include "../phworld.h" -#include "../../xrcdb/xr_area.h" +#include "xrCDB/xr_area.h" //////////////////////////////////////////////////////////////////////////// IC dReal dcTriListCollider::PointSphereTest(const dReal* center, const dReal radius, const dReal* pt,dReal* norm) diff --git a/src/xrPhysics/tri-colliderknoopc/dxTriList.h b/src/xrPhysics/tri-colliderknoopc/dxTriList.h index 3f019d1cd3f..9bfbd1bc434 100644 --- a/src/xrPhysics/tri-colliderknoopc/dxTriList.h +++ b/src/xrPhysics/tri-colliderknoopc/dxTriList.h @@ -5,7 +5,7 @@ //#include "../ode_include.h" -#include "../../3rd party/ode/include/ode/common.h" +#include "3rd party/ode/include/ode/common.h" diff --git a/src/xrPhysics/xrPhysics.cpp b/src/xrPhysics/xrPhysics.cpp index af3c8366adc..0d8cffda7c1 100644 --- a/src/xrPhysics/xrPhysics.cpp +++ b/src/xrPhysics/xrPhysics.cpp @@ -4,7 +4,7 @@ #include "stdafx.h" #include "xrPhysics.h" -#include "../3rd party/ode/include/ode/memory.h" +#include "3rd party/ode/include/ode/memory.h" #pragma comment(lib,"ode.lib") #pragma comment(lib,"xrCDB.lib") diff --git a/src/xrServerEntities/PHSynchronize.h b/src/xrServerEntities/PHSynchronize.h index d090b690fe5..cad32b32a7d 100644 --- a/src/xrServerEntities/PHSynchronize.h +++ b/src/xrServerEntities/PHSynchronize.h @@ -1,7 +1,7 @@ #ifndef PH_SYNCHRONIZE_H #define PH_SYNCHRONIZE_H -#include "../xrserverentities/PHNetState.h" +#include "xrServerEntities/PHNetState.h" class NET_Packet; diff --git a/src/xrServerEntities/PropertiesListTypes.h b/src/xrServerEntities/PropertiesListTypes.h index 3ed61012386..cb2bf864a47 100644 --- a/src/xrServerEntities/PropertiesListTypes.h +++ b/src/xrServerEntities/PropertiesListTypes.h @@ -49,7 +49,7 @@ class PropItem; DEFINE_VECTOR (PropItem*,PropItemVec,PropItemIt); //------------------------------------------------------------------------------ -#include "../xrcore/ChooseTypes.H" +#include "xrCore/ChooseTypes.H" //------------------------------------------------------------------------------ typedef fastdelegate::FastDelegate2 TOnDrawTextEvent; typedef fastdelegate::FastDelegate1 TOnClick; diff --git a/src/xrServerEntities/alife_human_brain.cpp b/src/xrServerEntities/alife_human_brain.cpp index 07c0206b8cb..623859d977e 100644 --- a/src/xrServerEntities/alife_human_brain.cpp +++ b/src/xrServerEntities/alife_human_brain.cpp @@ -26,7 +26,7 @@ # include "alife_time_manager.h" # include "date_time.h" # ifdef DEBUG -# include "level.h" +# include "Level.h" # include "map_location.h" # include "map_manager.h" # endif diff --git a/src/xrServerEntities/alife_monster_brain.cpp b/src/xrServerEntities/alife_monster_brain.cpp index 800f5c3ed4d..b627f48e90a 100644 --- a/src/xrServerEntities/alife_monster_brain.cpp +++ b/src/xrServerEntities/alife_monster_brain.cpp @@ -25,7 +25,7 @@ # include "alife_time_manager.h" # include "date_time.h" # ifdef DEBUG -# include "level.h" +# include "Level.h" # include "map_location.h" # include "map_manager.h" # endif diff --git a/src/xrServerEntities/alife_space.h b/src/xrServerEntities/alife_space.h index 5543e1310c1..a5a830c9a1e 100644 --- a/src/xrServerEntities/alife_space.h +++ b/src/xrServerEntities/alife_space.h @@ -8,7 +8,7 @@ #ifndef XRAY_ALIFE_SPACE #define XRAY_ALIFE_SPACE -//#include "../xrcore/_std_extensions.h" +//#include "xrCore/_std_extensions.h" // ALife objects, events and tasks #define ALIFE_VERSION 0x0006 diff --git a/src/xrServerEntities/game_graph_space.h b/src/xrServerEntities/game_graph_space.h index 7a72325329c..00bf1da89f1 100644 --- a/src/xrServerEntities/game_graph_space.h +++ b/src/xrServerEntities/game_graph_space.h @@ -11,9 +11,9 @@ #include "associative_vector.h" #ifdef XRGAME_EXPORTS -# include "../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #else -# include "../../xrEngine/xrLevel.h" +# include "xrEngine/xrLevel.h" #endif namespace GameGraph { diff --git a/src/xrServerEntities/object_factory_register.cpp b/src/xrServerEntities/object_factory_register.cpp index ab7a1050e77..fe8522aaa24 100644 --- a/src/xrServerEntities/object_factory_register.cpp +++ b/src/xrServerEntities/object_factory_register.cpp @@ -18,8 +18,8 @@ // client entities includes #ifndef NO_XR_GAME -# include "../xrEngine/std_classes.h" -# include "level.h" +# include "xrEngine/std_classes.h" +# include "Level.h" # include "gamepersistent.h" # include "hudmanager.h" # include "actor.h" @@ -51,7 +51,7 @@ # include "ai/crow/ai_crow.h" # ifdef DEBUG -# include "../xrEngine/StatGraph.h" +# include "xrEngine/StatGraph.h" # include "PHDebug.h" # endif // DEBUG diff --git a/src/xrServerEntities/script_debugger.cpp b/src/xrServerEntities/script_debugger.cpp index ea9c003bc9b..2b97c79aedd 100644 --- a/src/xrServerEntities/script_debugger.cpp +++ b/src/xrServerEntities/script_debugger.cpp @@ -2,7 +2,7 @@ #include "script_debugger.h" #include "script_lua_helper.h" #include "mslotutils.h" -// #include "../xrEngine/XR_IOConsole.h" +// #include "xrEngine/XR_IOConsole.h" //CScriptDebugger* CScriptDebugger::m_pDebugger = NULL; diff --git a/src/xrServerEntities/script_engine_export.h b/src/xrServerEntities/script_engine_export.h index eb07754e872..b7593b3b7e8 100644 --- a/src/xrServerEntities/script_engine_export.h +++ b/src/xrServerEntities/script_engine_export.h @@ -146,7 +146,6 @@ # include "space_restrictor.h" # include "physicobject.h" # include "smart_cover_object.h" -# include "ui/FactionState.h" # include "actor.h" # include "login_manager.h" # include "account_manager.h" diff --git a/src/xrServerEntities/script_storage.cpp b/src/xrServerEntities/script_storage.cpp index dcb69002070..0af7cd78c72 100644 --- a/src/xrServerEntities/script_storage.cpp +++ b/src/xrServerEntities/script_storage.cpp @@ -10,7 +10,7 @@ #include "script_storage.h" #include "script_thread.h" #include -#include "../xrCore/doug_lea_allocator.h" +#include "xrCore/doug_lea_allocator.h" #ifndef DEBUG # include "opt.lua.h" @@ -81,7 +81,7 @@ static void *lua_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { } #else // USE_DL_ALLOCATOR -#include "../xrCore/memory_allocator_options.h" +#include "xrCore/memory_allocator_options.h" #ifdef USE_ARENA_ALLOCATOR static const u32 s_arena_size = 96*1024*1024; diff --git a/src/xrServerEntities/smart_cast.cpp b/src/xrServerEntities/smart_cast.cpp index b7091ddb34d..6cdd27b859f 100644 --- a/src/xrServerEntities/smart_cast.cpp +++ b/src/xrServerEntities/smart_cast.cpp @@ -10,7 +10,7 @@ #ifndef PURE_DYNAMIC_CAST # ifdef XRGAME_EXPORTS -# include "../include/xrRender/rendervisual.h" +# include "Include/xrRender/rendervisual.h" # include "alife_space.h" # include "hit.h" # include "actor.h" diff --git a/src/xrServerEntities/smart_cast_impl0.h b/src/xrServerEntities/smart_cast_impl0.h index 0edc90f69ec..7127f617eb8 100644 --- a/src/xrServerEntities/smart_cast_impl0.h +++ b/src/xrServerEntities/smart_cast_impl0.h @@ -8,7 +8,7 @@ #pragma once -#include "../xrcore/_type_traits.h" +#include "xrCore/_type_traits.h" #include "object_type_traits.h" namespace SmartDynamicCast { diff --git a/src/xrServerEntities/smart_cast_impl1.h b/src/xrServerEntities/smart_cast_impl1.h index bc45840a7dd..9a051c1bc74 100644 --- a/src/xrServerEntities/smart_cast_impl1.h +++ b/src/xrServerEntities/smart_cast_impl1.h @@ -8,7 +8,7 @@ #pragma once -#include "../xrcore/_type_traits.h" +#include "xrCore/_type_traits.h" #include "object_type_traits.h" #ifdef DEBUG diff --git a/src/xrServerEntities/xrServer_Object_Base.h b/src/xrServerEntities/xrServer_Object_Base.h index 6a959d0ee44..4898ab047a2 100644 --- a/src/xrServerEntities/xrServer_Object_Base.h +++ b/src/xrServerEntities/xrServer_Object_Base.h @@ -12,7 +12,7 @@ #include "object_interfaces.h" #include "script_value_container.h" #include "alife_space.h" -#include "../xrCore/client_id.h" +#include "xrCore/client_id.h" class NET_Packet; class xrClientData; diff --git a/src/xrServerEntities/xrServer_Objects_ALife.cpp b/src/xrServerEntities/xrServer_Objects_ALife.cpp index 60828a80c23..7a54efd93bd 100644 --- a/src/xrServerEntities/xrServer_Objects_ALife.cpp +++ b/src/xrServerEntities/xrServer_Objects_ALife.cpp @@ -24,7 +24,7 @@ # include "defines.h" LPCSTR GAME_CONFIG = "game.ltx"; #else // XRGAME_EXPORTS -# include "../xrEngine/render.h" +# include "xrEngine/render.h" #endif // XRGAME_EXPORTS #ifdef XRSE_FACTORY_EXPORTS diff --git a/src/xrServerEntities/xrServer_Objects_Abstract.h b/src/xrServerEntities/xrServer_Objects_Abstract.h index de6f3ae7ad3..a0d3a796ba1 100644 --- a/src/xrServerEntities/xrServer_Objects_Abstract.h +++ b/src/xrServerEntities/xrServer_Objects_Abstract.h @@ -11,7 +11,7 @@ #pragma pack(push,4) #include "xrServer_Space.h" -# include "../xrCDB/xrCDB.h" +#include "xrCDB/xrCDB.h" #include "ShapeData.h" #include "gametype_chooser.h" @@ -19,23 +19,16 @@ class NET_Packet; class CDUInterface; #ifndef _EDITOR - #ifndef XRGAME_EXPORTS - #include "../xrSound/Sound.h" - #endif +#ifndef XRGAME_EXPORTS +#include "xrSound/Sound.h" +#endif #endif #include "xrEProps.h" - -#ifndef XRGAME_EXPORTS - #include "..\..\Include\xrRender\DrawUtils.h" -#else - #include "..\Include\xrRender\DrawUtils.h" -#endif +#include "Include\xrRender\DrawUtils.h" #pragma warning(push) #pragma warning(disable:4005) - - class ISE_Shape{ public: virtual void __stdcall assign_shapes (CShapeData::shape_def* shapes, u32 cnt)=0; diff --git a/src/xrSound/Sound.h b/src/xrSound/Sound.h index 042f38aca7a..ba291ed64dd 100644 --- a/src/xrSound/Sound.h +++ b/src/xrSound/Sound.h @@ -2,7 +2,7 @@ #define SoundH #pragma once -//#include "../include/xrapi/xrapi.h" +//#include "Include/xrAPI/xrapi.h" #ifdef XRSOUND_EXPORTS #define XRSOUND_API __declspec(dllexport) diff --git a/src/xrSound/SoundRender_Core.cpp b/src/xrSound/SoundRender_Core.cpp index 810900e8519..495fe576a4b 100644 --- a/src/xrSound/SoundRender_Core.cpp +++ b/src/xrSound/SoundRender_Core.cpp @@ -1,7 +1,7 @@ #include "stdafx.h" #pragma hdrstop -#include "../xrEngine/xrLevel.h" +#include "xrEngine/xrLevel.h" #include "soundrender_core.h" #include "soundrender_source.h" #include "soundrender_emitter.h" diff --git a/src/xrSound/stdafx.h b/src/xrSound/stdafx.h index c56ebe5df2c..12ae8706f3f 100644 --- a/src/xrSound/stdafx.h +++ b/src/xrSound/stdafx.h @@ -6,7 +6,7 @@ #define stdafxH #pragma once -#include "../xrCore/xrCore.h" +#include "xrCore/xrCore.h" // mmsystem.h #define MMNOSOUND @@ -27,12 +27,12 @@ #include #include -#include "../xrCDB/xrCDB.h" +#include "xrCDB/xrCDB.h" #include "sound.h" #define ENGINE_API -#include "../xrcore/xr_resource.h" +#include "xrCore/xr_resource.h" #ifdef _EDITOR # include "ETools.h" diff --git a/src/xrXMLParser/stdafx.h b/src/xrXMLParser/stdafx.h index 16d73d202bd..f93b6933657 100644 --- a/src/xrXMLParser/stdafx.h +++ b/src/xrXMLParser/stdafx.h @@ -9,7 +9,7 @@ #pragma once -#include "../xrCore/xrCore.h" +#include "xrCore/xrCore.h" #include "xrXMLParser.h"