Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/utils/xrQSlim/MxQSlim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ void MxEdgeQSlim::apply_mesh_penalties(MxQSlimEdge* info)
if (nfailed)
bias += nfailed * meshing_penalty;

static u32 a = 0;
// if (a)
{
double Nmin1 = check_local_inversion(info->v1, info->v2, info->vnew);
Expand Down Expand Up @@ -481,7 +480,7 @@ void MxEdgeQSlim::update_pre_contract(const MxPairContraction& conx)
if (u == v1 || varray_find(star, u))
{
// This is a useless link --- kill it
bool found = varray_find(edge_links(u), e, &j);
[[maybe_unused]] bool found = varray_find(edge_links(u), e, &j);
VERIFY(found);
edge_links(u).remove(j);
heap.remove(e);
Expand Down
5 changes: 2 additions & 3 deletions src/utils/xrQSlim/MxStdModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ MxVertexID MxStdModel::alloc_vertex(float x, float y, float z)
vertex_mark_valid(id);

face_links.add(xr_new<MxFaceList>());
unsigned int l = face_links.last_id();
VERIFY(l == id);
VERIFY(face_links.last_id() == id);
VERIFY(neighbors(id).length() == 0);

return id;
Expand Down Expand Up @@ -560,7 +559,7 @@ void MxStdModel::apply_expansion(const MxPairExpansion& conx)
MxFaceID fid = conx.delta_faces(i);
face(fid).remap_vertex(v1, v2);
neighbors(v2).add(fid);
bool found = varray_find(neighbors(v1), fid, &j);
[[maybe_unused]] bool found = varray_find(neighbors(v1), fid, &j);
VERIFY(found);
neighbors(v1).remove(j);
}
Expand Down
3 changes: 1 addition & 2 deletions src/xrAICore/Navigation/PatrolPath/patrol_path_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ void CPatrolPathStorage::load_raw(

shared_str patrol_name;
sub_chunk->r_stringZ(patrol_name);
const_iterator I = m_registry.find(patrol_name);
VERIFY3(I == m_registry.end(), "Duplicated patrol path found", *patrol_name);
VERIFY3(m_registry.find(patrol_name) == m_registry.end(), "Duplicated patrol path found", *patrol_name);
m_registry.emplace(
patrol_name, &(xr_new<CPatrolPath>(patrol_name))->load_raw(level_graph, cross, game_graph, *sub_chunk)
);
Expand Down
6 changes: 2 additions & 4 deletions src/xrAICore/Navigation/graph_vertex_inline.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@ IC typename _graph_type::CEdge* CSGraphVertex::edge(const _vertex_id_type& verte
TEMPLATE_SPECIALIZATION
IC void CSGraphVertex::add_edge(CGraphVertex* vertex, const typename _graph_type::CEdge::edge_weight_type& edge_weight)
{
typename EDGES::iterator I = std::find(m_edges.begin(), m_edges.end(), vertex->vertex_id());
VERIFY(m_edges.end() == I);
VERIFY(m_edges.end() == std::find(m_edges.begin(), m_edges.end(), vertex->vertex_id()));
vertex->on_edge_addition(this);
m_edges.push_back(typename _graph_type::CEdge(edge_weight, vertex));
++*m_edge_count;
Expand All @@ -86,8 +85,7 @@ IC void CSGraphVertex::remove_edge(const _vertex_id_type& vertex_id)
TEMPLATE_SPECIALIZATION
IC void CSGraphVertex::on_edge_addition(CGraphVertex* vertex)
{
typename VERTICES::const_iterator I = std::find(m_vertices.begin(), m_vertices.end(), vertex);
VERIFY(I == m_vertices.end());
VERIFY(std::find(m_vertices.begin(), m_vertices.end(), vertex) == m_vertices.end());
m_vertices.push_back(vertex);
}

Expand Down
12 changes: 6 additions & 6 deletions src/xrEngine/Rain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
#endif

// Warning: duplicated in dxRainRender
static const int max_desired_items = 2500;
static const float source_radius = 12.5f;
//static const int max_desired_items = 2500;
//static const float source_radius = 12.5f;
static const float source_offset = 40.f;
static const float max_distance = source_offset * 1.25f;
static const float sink_offset = -(max_distance - source_offset);
static const float drop_length = 5.f;
static const float drop_width = 0.30f;
//static const float sink_offset = -(max_distance - source_offset);
//static const float drop_length = 5.f;
//static const float drop_width = 0.30f;
static const float drop_angle = 3.0f;
static const float drop_max_angle = deg2rad(10.f);
static const float drop_max_wind_vel = 20.0f;
static const float drop_speed_min = 40.f;
static const float drop_speed_max = 80.f;

const int max_particles = 1000;
const int particles_cache = 400;
//const int particles_cache = 400;
const float particles_time = .3f;

//////////////////////////////////////////////////////////////////////
Expand Down
3 changes: 1 addition & 2 deletions src/xrEngine/XR_IOConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@
#include "GameFont.h"

#include "Include/xrRender/UIRender.h"
#include "xrUICore/ui_defs.h"

static float const UI_BASE_WIDTH = 1024.0f;
static float const UI_BASE_HEIGHT = 768.0f;
static float const LDIST = 0.05f;
static u32 const cmd_history_max = 64;

Expand Down
3 changes: 3 additions & 0 deletions src/xrEngine/xrSheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,10 @@ void CSheduler::ProcessStep()
{
// Normal priority
const u32 dwTime = Device.dwTimeGlobal;

#ifdef DEBUG
CTimer eTimer;
#endif

for (int i = 0; !Items.empty() && Top().dwTimeForExecute < dwTime; ++i)
{
Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
#include "ui/UIDragDropReferenceList.h"
#include "xrCore/xr_token.h"

const u32 patch_frames = 50;
const float respawn_delay = 1.f;
const float respawn_auto = 7.f;
//const u32 patch_frames = 50;
//const float respawn_delay = 1.f;
//const float respawn_auto = 7.f;

constexpr float default_feedback_duration = 0.2f;

Expand Down
3 changes: 2 additions & 1 deletion src/xrGame/ActorAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,11 @@ CMotion* FindMotionKeys(MotionID motion_ID, IRenderVisual* V)

#ifdef DEBUG
BOOL g_ShowAnimationInfo = FALSE;
#endif // DEBUG
constexpr pcstr mov_state[] = {
"idle", "walk", "run", "sprint",
};
#endif // DEBUG

void CActor::g_SetAnimation(u32 mstate_rl)
{
if (!g_Alive())
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ContextMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "ContextMenu.h"
#include "../xrEngine/GameFont.h"

const float fade_speed = 8.0f;
//const float fade_speed = 8.0f;

CContextMenu::~CContextMenu()
{
Expand Down
5 changes: 3 additions & 2 deletions src/xrGame/LevelGraphDebugRender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,12 @@ void LevelGraphDebugRender::DrawGameGraph()
IGameObject* entity = Level().CurrentEntity();
if (!entity)
return;

// draw back plane
#if 0 // XXX: disabled in original, reenable?
const Fmatrix& xform = entity->XFORM();
Fvector center = {0.f, 5.f, 0.f};
Fvector bounds = {3.f, 0.f, 3.f};
// draw back plane
#if 0 // XXX: disabled in original, reenable?
Fvector vertices[4];
xform.transform_tiny(vertices[0], {center.x-bounds.x, center.y+bounds.y, center.z+bounds.z});
xform.transform_tiny(vertices[1], {center.x+bounds.x, center.y+bounds.y, center.z+bounds.z});
Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/Level_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ void CLevel::IR_OnKeyboardPress(int key)
// Lain: added
case SDL_SCANCODE_F5:
{
if (CBaseMonster* pBM = smart_cast<CBaseMonster*>(CurrentEntity()))
if (smart_cast<CBaseMonster*>(CurrentEntity()))
{
DBG().log_debug_info();
}
Expand Down Expand Up @@ -483,7 +483,7 @@ void CLevel::IR_OnKeyboardHold(int key)
static u32 time = Device.dwTimeGlobal;
if (Device.dwTimeGlobal - time > 20)
{
if (CBaseMonster* pBM = smart_cast<CBaseMonster*>(CurrentEntity()))
if (smart_cast<CBaseMonster*>(CurrentEntity()))
{
DBG().debug_info_up();
time = Device.dwTimeGlobal;
Expand All @@ -495,7 +495,7 @@ void CLevel::IR_OnKeyboardHold(int key)
static u32 time = Device.dwTimeGlobal;
if (Device.dwTimeGlobal - time > 20)
{
if (CBaseMonster* pBM = smart_cast<CBaseMonster*>(CurrentEntity()))
if (smart_cast<CBaseMonster*>(CurrentEntity()))
{
DBG().debug_info_down();
time = Device.dwTimeGlobal;
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/Level_network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ const int ConnectionTimeOut = 60000; // 1 min

bool CLevel::Connect2Server(const char* options)
{
NET_Packet P;
//NET_Packet P;
m_bConnectResultReceived = false;
m_bConnectResult = true;

Expand Down
2 changes: 2 additions & 0 deletions src/xrGame/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ extern ENGINE_API bool bShowPauseString;

//#define DEMO_BUILD

#ifdef XR_PLATFORM_WINDOWS
constexpr cpcstr ErrMsgBoxTemplate[] =
{
"message_box_invalid_pass",
Expand All @@ -65,6 +66,7 @@ constexpr cpcstr ErrMsgBoxTemplate[] =
"msg_box_error_loading",
"message_box_download_level"
};
#endif

extern bool b_shniaganeed_pp;

Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/PHMovementControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define def_Y_SIZE_2 0.8f
#define def_Z_SIZE_2 0.35f

const u64 after_creation_collision_hit_block_steps_number = 100;
//const u64 after_creation_collision_hit_block_steps_number = 100;

CPHMovementControl::CPHMovementControl(IGameObject* parent)
{
Expand Down
4 changes: 2 additions & 2 deletions src/xrGame/Tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include "Include/xrRender/UIRender.h"
#include "xrCore/_fbox2.h"

const u32 MAX_TRACERS = (1024 * 5);
const float TRACER_SIZE = 0.13f;
//const u32 MAX_TRACERS = (1024 * 5);
//const float TRACER_SIZE = 0.13f;

CTracer::CTracer()
{
Expand Down
3 changes: 2 additions & 1 deletion src/xrGame/UIDialogHolder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,8 @@ bool CDialogHolder::IR_UIOnControllerHold(int dik, float x, float y)

bool CDialogHolder::FillDebugTree(const CUIDebugState& debugState)
{
ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow;
// XXX: Was this meant to be used somewhere here? Because currently its unused and could also be constexpr
//ImGuiTreeNodeFlags flags = ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_OpenOnArrow;

if (m_input_receivers.empty())
ImGui::BulletText("Input receivers: 0");
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ai/monsters/anim_triple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "anim_triple.h"
#include "control_manager.h"

constexpr pcstr dbg_states[] = { "eStatePrepare", "eStateExecute", "eStateFinalize", "eStateNone" };
//constexpr pcstr dbg_states[] = { "eStatePrepare", "eStateExecute", "eStateFinalize", "eStateNone" };

void CAnimationTriple::reset_data() { m_data.capture_type = 0; }
void CAnimationTriple::on_capture()
Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ namespace detail::bloodsucker
{
// default hit settings
float const default_critical_hit_chance = 0.25f;
float const default_hit_camera_effector_angle = 0;
float const default_critical_hit_camera_effector_angle = 3.1415f / 6;
//float const default_hit_camera_effector_angle = 0;
//float const default_critical_hit_camera_effector_angle = 3.1415f / 6;

float const default_camera_effector_move_angular_speed = 1.5f;
//float const default_camera_effector_move_angular_speed = 1.5f;
u32 const default_visibility_state_change_min_delay = 1000;

float const default_full_visibility_radius = 5;
Expand Down
2 changes: 2 additions & 0 deletions src/xrGame/ai/monsters/control_animation_base_update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#include "ai/monsters/control_path_builder_base.h"

// DEBUG purpose only
#if 0
constexpr pcstr dbg_anim_name_table[] = {"eAnimStandIdle", "eAnimStandTurnLeft", "eAnimStandTurnRight",

"eAnimSitIdle", "eAnimLieIdle",
Expand Down Expand Up @@ -52,6 +53,7 @@ constexpr pcstr dbg_anim_name_table[] = {"eAnimStandIdle", "eAnimStandTurnLeft",
"eAnimTeleRaise", "eAnimTeleFire", "eAnimGraviPrepare", "eAnimGraviFire",

"eAnimCount", "eAnimUndefined"};
#endif

//////////////////////////////////////////////////////////////////////////
// m_tAction processing
Expand Down
2 changes: 0 additions & 2 deletions src/xrGame/ai/stalker/ai_stalker_debug.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1129,8 +1129,6 @@ void CAI_Stalker::dbg_draw_visibility_rays()

xr_vector<Fmatrix> g_stalker_skeleton;

static Fvector s_spine_bone;

static Fmatrix aim_on_actor(Fvector const& bone_position, Fvector const& weapon_position,
Fvector const& weapon_direction, Fvector const& target, bool const& debug_draw)
{
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/ai/stalker/ai_stalker_fire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static float const FLOOR_DISTANCE = 2.f;
static float const NEAR_DISTANCE = 2.5f;
static u32 const FIRE_MAKE_SENSE_INTERVAL = 10000;

static float const min_throw_distance = 10.f;
//static float const min_throw_distance = 10.f;

float CAI_Stalker::GetWeaponAccuracy() const
{
Expand Down
20 changes: 10 additions & 10 deletions src/xrGame/ik/IKLimb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ int ik_blend_free_foot = 1;
int ik_local_blending = 0;
int ik_collide_blend = 0;

const Matrix Midentity = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}; //. in XGlobal
//const Matrix Midentity = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0}; //. in XGlobal

const Matrix IKLocalJoint = {0, 0, 1, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1}; //. in XGlobal
const Fmatrix XLocalJoint = {0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};
//const Matrix IKLocalJoint = {0, 0, 1, 0, -1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1}; //. in XGlobal
//const Fmatrix XLocalJoint = {0, -1, 0, 0, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};

const Fmatrix xm2im = {0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1};

const Fvector xgproj_axis = {0, 1, 0};
const Fvector xgpos_axis = {0, 0, 1};
//const Fvector xgproj_axis = {0, 1, 0};
//const Fvector xgpos_axis = {0, 0, 1};

const Fvector xlproj_axis = {1, 0, 0};
const Fvector xlpos_axis = {0, 0, 1};
//const Fvector xlproj_axis = {1, 0, 0};
//const Fvector xlpos_axis = {0, 0, 1};
typedef float IVektor[3];

const IVektor lproj_vector = {0, 0, 1};
const IVektor lpos_vector = {-1, 0, 0};
//const IVektor lproj_vector = {0, 0, 1};
//const IVektor lpos_vector = {-1, 0, 0};

const IVektor gproj_vector = {0, 0, 1}; //. in XGlobal
const IVektor gpos_vector = {1, 0, 0};
Expand Down Expand Up @@ -845,7 +845,7 @@ void CIKLimb::ToeTimeDiff(Fvector& v, const SCalculateData& cd) const

void CIKLimb::ToeTimeDiffPredict(Fvector& v) const { v.set(0, -1, 0); }
static const float pick_dir_mix_in_factor = 0.01f;
static const float pick_dir_mix_in_doun_factor = 0.01f;
//static const float pick_dir_mix_in_doun_factor = 0.01f;
void pick_dir_update(Fvector& v, const Fvector& previous_dir, const Fvector& new_dir)
{
Fvector dir = new_dir;
Expand Down
2 changes: 2 additions & 0 deletions src/xrGame/movement_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

using namespace MovementManager;

#ifdef USE_FREE_IN_RESTRICTIONS
const float verify_distance = 15.f;
#endif

CMovementManager::CMovementManager(CCustomMonster* object)
{
Expand Down
2 changes: 2 additions & 0 deletions src/xrGame/profile_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,13 @@ void profile_store::onlylog_completion(bool const result, char const* err_descr)
Msg("* Profile loading successfully complete");
}

#ifdef XR_PLATFORM_WINDOWS
#ifdef DEBUG
static u32 const actuality_update_time = 120;
#else
static u32 const actuality_update_time = 3600;
#endif //#ifdef DEBUG
#endif //#ifdef XR_PLATFORM_WINDOWS

void profile_store::check_sake_actuality()
{
Expand Down
2 changes: 1 addition & 1 deletion src/xrGame/space_restriction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "xrCore/xrDebug_macros.h"
#include "xrCore/buffer_vector.h"

const float dependent_distance = 100.f;
//const float dependent_distance = 100.f;

template <bool a>
struct CMergeInOutPredicate
Expand Down
1 change: 0 additions & 1 deletion src/xrGame/stalker_animation_legs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
const float right_forward_angle = PI_DIV_4;
const float left_forward_angle = PI_DIV_4;
// const float standing_turn_angle = PI_DIV_6;
const float epsilon = EPS_L;

const u32 direction_switch_interval = 500;

Expand Down
6 changes: 3 additions & 3 deletions src/xrGame/ui/UIMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
#include "xrEngine/xr_input.h" //remove me !!!
#include "xrCore/_fbox2.h"

const u32 activeLocalMapColor = 0xffffffff; // 0xffc80000;
const u32 inactiveLocalMapColor = 0xffffffff; // 0xff438cd1;
const u32 ourLevelMapColor = 0xffffffff;
//const u32 activeLocalMapColor = 0xffffffff; // 0xffc80000;
//const u32 inactiveLocalMapColor = 0xffffffff; // 0xff438cd1;
//const u32 ourLevelMapColor = 0xffffffff;

CUICustomMap::CUICustomMap() : CUIStatic("Custom Map")
{
Expand Down
Loading