diff --git a/src/xrAICore/Navigation/PatrolPath/patrol_point_inline.h b/src/xrAICore/Navigation/PatrolPath/patrol_point_inline.h index 70af8d4d30f..860916f6afd 100644 --- a/src/xrAICore/Navigation/PatrolPath/patrol_point_inline.h +++ b/src/xrAICore/Navigation/PatrolPath/patrol_point_inline.h @@ -16,33 +16,27 @@ inline bool CPatrolPoint::operator==(const CPatrolPoint& rhs) const IC const Fvector& CPatrolPoint::position() const { -#ifdef DEBUG VERIFY(m_initialized); -#endif return (m_position); } IC const u32& CPatrolPoint::flags() const { -#ifdef DEBUG VERIFY(m_initialized); -#endif return (m_flags); } IC const shared_str& CPatrolPoint::name() const { -#ifdef DEBUG VERIFY(m_initialized); -#endif return (m_name); } IC const u32& CPatrolPoint::level_vertex_id( const CLevelGraph* level_graph, const CGameLevelCrossTable* cross, const CGameGraph* game_graph) const { -#ifdef DEBUG VERIFY(m_initialized); +#ifdef DEBUG verify_vertex_id(level_graph, cross, game_graph); #endif return (m_level_vertex_id); @@ -51,8 +45,8 @@ IC const u32& CPatrolPoint::level_vertex_id( IC const GameGraph::_GRAPH_ID& CPatrolPoint::game_vertex_id( const CLevelGraph* level_graph, const CGameLevelCrossTable* cross, const CGameGraph* game_graph) const { -#ifdef DEBUG VERIFY(m_initialized); +#ifdef DEBUG verify_vertex_id(level_graph, cross, game_graph); #endif return (m_game_vertex_id); diff --git a/src/xrCore/xrDebug_macros.h b/src/xrCore/xrDebug_macros.h index 9b11c18f300..5a5a45821aa 100644 --- a/src/xrCore/xrDebug_macros.h +++ b/src/xrCore/xrDebug_macros.h @@ -196,10 +196,10 @@ } while (false) #define NODEFAULT XR_ASSUME(0) -#define VERIFY(expr) XR_ASSUME(expr) -#define VERIFY2(expr, desc) XR_ASSUME(expr) -#define VERIFY3(expr, desc, arg1) XR_ASSUME(expr) -#define VERIFY4(expr, desc, arg1, arg2) XR_ASSUME(expr) +#define VERIFY(expr) do {} while (false) +#define VERIFY2(expr, desc) do {} while (false) +#define VERIFY3(expr, desc, arg1) do {} while (false) +#define VERIFY4(expr, desc, arg1, arg2) do {} while (false) #define CHK_DX(expr) expr #define CHK_GL(expr) expr #endif // DEBUG diff --git a/src/xrEngine/xr_collide_form.cpp b/src/xrEngine/xr_collide_form.cpp index ed72ebc0ec1..7aacab80a6d 100644 --- a/src/xrEngine/xr_collide_form.cpp +++ b/src/xrEngine/xr_collide_form.cpp @@ -130,10 +130,8 @@ void CCF_Skeleton::BuildState() Fmatrix ME, T, TW; const Fmatrix& Mbone = K->LL_GetTransform(I->elem_id); -#ifdef DEBUG VERIFY2(DET(Mbone) > EPS, (make_string("0 scale bone matrix, %d \n", I->elem_id) + dbg_object_full_dump_string(owner)).c_str()); -#endif switch (I->type) { diff --git a/src/xrEngine/xr_object_list.cpp b/src/xrEngine/xr_object_list.cpp index 488c12921cf..6e4c0fbd425 100644 --- a/src/xrEngine/xr_object_list.cpp +++ b/src/xrEngine/xr_object_list.cpp @@ -143,9 +143,7 @@ void CObjectList::SingleUpdate(IGameObject* O) O->UpdateCL(); -#ifdef DEBUG VERIFY3(O->GetDbgUpdateFrame() == Device.dwFrame, "Broken sequence of calls to 'UpdateCL'", *O->cName()); -#endif #if 0 // ndef DEBUG __try { @@ -587,10 +585,7 @@ bool CObjectList::dump_all_objects() void CObjectList::register_object_to_destroy(IGameObject* object_to_destroy) { -#ifdef DEBUG VERIFY(!registered_object_to_destroy(object_to_destroy)); -#endif - // Msg("CObjectList::register_object_to_destroy [%x]", object_to_destroy); destroy_queue.push_back(object_to_destroy); diff --git a/src/xrGame/Actor_Network.cpp b/src/xrGame/Actor_Network.cpp index 0d5e95cd7a3..6c8187dd9ca 100644 --- a/src/xrGame/Actor_Network.cpp +++ b/src/xrGame/Actor_Network.cpp @@ -513,9 +513,7 @@ void CActor::net_Import_Physic(NET_Packet& P) } else { -#ifdef DEBUG VERIFY(valid_pos(N_A.State.position, ph_boundaries())); -#endif NET_A.push_back(N_A); if (NET_A.size() > 5) NET_A.pop_front(); diff --git a/src/xrGame/Car.cpp b/src/xrGame/Car.cpp index 31c02f0773e..04a78c15375 100644 --- a/src/xrGame/Car.cpp +++ b/src/xrGame/Car.cpp @@ -125,9 +125,7 @@ void CCar::reload(LPCSTR section) void CCar::cb_Steer(CBoneInstance* B) { -#ifdef DEBUG VERIFY2(fsimilar(DET(B->mTransform), 1.f, DET_CHECK_EPS), "Bones receive returns 0 matrix"); -#endif CCar* C = static_cast(B->callback_param()); Fmatrix m; diff --git a/src/xrGame/CarCameras.cpp b/src/xrGame/CarCameras.cpp index a351d32d87d..620e482f93d 100644 --- a/src/xrGame/CarCameras.cpp +++ b/src/xrGame/CarCameras.cpp @@ -18,9 +18,7 @@ bool CCar::HUDView() const { return active_camera->tag == ectFirst; } void CCar::cam_Update(float dt, float fov) { -#ifdef DEBUG VERIFY(!physics_world()->Processing()); -#endif Fvector P, Da; Da.set(0, 0, 0); // bool owner = !!Owner(); diff --git a/src/xrGame/DestroyablePhysicsObject.cpp b/src/xrGame/DestroyablePhysicsObject.cpp index 0886579b96c..a1fec21abfe 100644 --- a/src/xrGame/DestroyablePhysicsObject.cpp +++ b/src/xrGame/DestroyablePhysicsObject.cpp @@ -89,10 +89,7 @@ void CDestroyablePhysicsObject::Hit(SHit* pHDS) } void CDestroyablePhysicsObject::Destroy() { -#ifdef DEBUG VERIFY(!physics_world()->Processing()); -#endif - const CGameObject* who_object = smart_cast(FatalHit().initiator()); callback(GameObject::eDeath)(lua_game_object(), who_object ? who_object->lua_game_object() : 0); CPHDestroyable::Destroy(ID(), "physic_destroyable_object"); diff --git a/src/xrGame/GameObject.cpp b/src/xrGame/GameObject.cpp index e49c9924c73..06079182634 100644 --- a/src/xrGame/GameObject.cpp +++ b/src/xrGame/GameObject.cpp @@ -1039,10 +1039,8 @@ void CGameObject::setDestroy(bool _destroy) Msg("cl setDestroy [%d][%d]", ID(), Device.dwFrame); #endif //#ifdef MP_LOGGING } -#ifdef DEBUG else VERIFY(!g_pGameLevel->Objects.registered_object_to_destroy(this)); -#endif } Fvector CGameObject::get_new_local_point_on_mesh(u16& bone_id) const diff --git a/src/xrGame/Level_Bullet_Manager.cpp b/src/xrGame/Level_Bullet_Manager.cpp index ca623c9e8ea..f04b2b09ae6 100644 --- a/src/xrGame/Level_Bullet_Manager.cpp +++ b/src/xrGame/Level_Bullet_Manager.cpp @@ -185,9 +185,7 @@ void CBulletManager::AddBullet(const Fvector& position, const Fvector& direction // Always called in Primary thread // Uncomment below if you will change the behaviour // if (!g_mt_config.test(mtBullets)) -#ifdef DEBUG VERIFY(m_thread_id == std::this_thread::get_id()); -#endif VERIFY(u16(-1) != cartridge.bullet_material_idx); // u32 CurID = Level().CurrentControlEntity()->ID(); @@ -207,9 +205,7 @@ void CBulletManager::UpdateWorkload() { ZoneScoped; -#ifdef DEBUG VERIFY(g_mt_config.test(mtBullets) || m_thread_id == std::this_thread::get_id()); -#endif rq_storage.r_clear(); diff --git a/src/xrGame/Level_network.cpp b/src/xrGame/Level_network.cpp index 07f3ae30157..eda2d6e3688 100644 --- a/src/xrGame/Level_network.cpp +++ b/src/xrGame/Level_network.cpp @@ -98,9 +98,7 @@ void CLevel::remove_objects() #endif // DEBUG if (!GEnv.isDedicatedServer) { -#ifdef DEBUG VERIFY(client_spawn_manager().registry().empty()); -#endif client_spawn_manager().clear(); } diff --git a/src/xrGame/PHDestroyable.cpp b/src/xrGame/PHDestroyable.cpp index 8aa6f628029..b569cd83a67 100644 --- a/src/xrGame/PHDestroyable.cpp +++ b/src/xrGame/PHDestroyable.cpp @@ -337,9 +337,7 @@ void CPHDestroyable::NotificatePart(CPHDestroyableNotificate* dn) void CPHDestroyable::NotificateDestroy(CPHDestroyableNotificate* dn) { VERIFY(m_depended_objects); -#ifdef DEBUG VERIFY(!physics_world()->Processing()); -#endif m_depended_objects--; PhysicallyRemovePart(dn); m_notificate_objects.push_back(dn); diff --git a/src/xrGame/attachable_item.cpp b/src/xrGame/attachable_item.cpp index 9d7f6da8ee0..df0800bc954 100644 --- a/src/xrGame/attachable_item.cpp +++ b/src/xrGame/attachable_item.cpp @@ -114,17 +114,13 @@ bool CAttachableItem::can_be_attached() const void CAttachableItem::afterAttach() { -#ifdef DEBUG VERIFY(m_valid); -#endif object().processing_activate(); } void CAttachableItem::afterDetach() { -#ifdef DEBUG VERIFY(m_valid); -#endif object().processing_deactivate(); } diff --git a/src/xrGame/attachable_item_inline.h b/src/xrGame/attachable_item_inline.h index 75aba328a91..c63bf2b884f 100644 --- a/src/xrGame/attachable_item_inline.h +++ b/src/xrGame/attachable_item_inline.h @@ -22,33 +22,25 @@ IC CAttachableItem::CAttachableItem() IC shared_str CAttachableItem::bone_name() const { -#ifdef DEBUG VERIFY(m_valid); -#endif return (m_bone_name); } IC const Fmatrix& CAttachableItem::offset() const { -#ifdef DEBUG VERIFY(m_valid); -#endif return (m_offset); } IC u16 CAttachableItem::bone_id() const { -#ifdef DEBUG VERIFY(m_valid); -#endif return (m_bone_id); } IC void CAttachableItem::set_bone_id(u16 bone_id) { -#ifdef DEBUG VERIFY(m_valid); -#endif m_bone_id = bone_id; } diff --git a/src/xrGame/ik/IKLimb.cpp b/src/xrGame/ik/IKLimb.cpp index 93bedae999b..327059483ec 100644 --- a/src/xrGame/ik/IKLimb.cpp +++ b/src/xrGame/ik/IKLimb.cpp @@ -494,10 +494,8 @@ void CIKLimb::SetNewGoal(const SIKCollideData& cld, SCalculateData& cd) cd.state.foot_step = m_foot.GetFootStepMatrix(cd.state.goal, cd, cld, true, !!ik_allign_free_foot) && cd.state.foot_step; -#ifdef DEBUG VERIFY2(fsimilar(1.f, DET(cd.state.goal.get()), det_tolerance), dump_string("cd.state.goal", cd.state.goal.get()).c_str()); -#endif cd.state.blend_to = cd.state.goal; sv_state.get_calculate_state(cd.state); @@ -673,36 +671,27 @@ void CIKLimb::Blending(SCalculateData& cd) { blend_speed_accel(cd); ik_goal_matrix m; - -#ifdef DEBUG VERIFY(fsimilar(1.f, DET(sv_state.goal(m).get()), det_tolerance)); VERIFY(fsimilar(1.f, DET(sv_state.blend_to(m).get()), det_tolerance)); -#endif Fmatrix diff; diff.mul_43(Fmatrix().invert(sv_state.blend_to(m).get()), Fmatrix(sv_state.goal(m).get())); -#ifdef DEBUG VERIFY(fsimilar(1.f, DET(diff), det_tolerance)); -#endif Fmatrix blend = Fidentity; // cd.state.blend_to; cd.state.blending = !clamp_change(blend, diff, cd.l, cd.a, linear_tolerance, angualar_tolerance); // 0.01f //0.005f -#ifdef DEBUG VERIFY(fsimilar(1.f, DET(blend), det_tolerance)); VERIFY(fsimilar(1.f, DET(cd.state.blend_to.get()), det_tolerance)); -#endif Fmatrix fm = Fmatrix().mul_43(cd.state.blend_to.get(), blend); if (ik_collide_blend) m_foot.GetFootStepMatrix(cd.state.goal, fm, collide_data, true, true); else cd.state.goal.set(fm, cd.state.blend_to.collide_state()); -#ifdef DEBUG VERIFY(fsimilar(DET(cd.state.goal.get()), 1.f, det_tolerance)); -#endif } else { diff --git a/src/xrGame/moving_objects.cpp b/src/xrGame/moving_objects.cpp index 02012ec3c60..8529493cbe4 100644 --- a/src/xrGame/moving_objects.cpp +++ b/src/xrGame/moving_objects.cpp @@ -23,10 +23,10 @@ void moving_objects::on_level_load() void moving_objects::register_object(moving_object* moving_object) { -#ifdef DEBUG VERIFY2(m_objects.find(moving_object) == m_objects.end(), make_string("moving object %s is registers twice", *moving_object->id())); +#ifdef DEBUG m_objects.insert(moving_object); #endif // DEBUG @@ -36,10 +36,10 @@ void moving_objects::register_object(moving_object* moving_object) void moving_objects::unregister_object(moving_object* moving_object) { -#ifdef DEBUG VERIFY2(m_objects.find(moving_object) != m_objects.end(), make_string("moving object %s is not yet registered or unregisters twice", *moving_object->id())); +#ifdef DEBUG m_objects.erase(m_objects.find(moving_object)); #endif // DEBUG @@ -49,10 +49,8 @@ void moving_objects::unregister_object(moving_object* moving_object) void moving_objects::on_object_move(moving_object* moving_object) { -#ifdef DEBUG VERIFY2(m_objects.find(moving_object) != m_objects.end(), make_string("moving object %s is not yet registered", *moving_object->id())); -#endif #pragma todo("this place can be optimized in case of slowdowns") VERIFY(m_tree); diff --git a/src/xrGame/xrServer.cpp b/src/xrGame/xrServer.cpp index 38f9a71c88d..f14defc3308 100644 --- a/src/xrGame/xrServer.cpp +++ b/src/xrGame/xrServer.cpp @@ -200,9 +200,7 @@ void xrServer::Update() stats.Update.Begin(); NET_Packet Packet; -#ifdef DEBUG VERIFY(verify_entities()); -#endif ProceedDelayedPackets(); // game update @@ -233,9 +231,7 @@ void xrServer::Update() if (game->sv_force_sync) Perform_game_export(); -#ifdef DEBUG VERIFY(verify_entities()); -#endif //----------------------------------------------------- PerformCheckClientsForMaxPing(); @@ -359,9 +355,7 @@ void xrServer::SendUpdatesToAll() #endif if (game->sv_force_sync) Perform_game_export(); -#ifdef DEBUG VERIFY(verify_entities()); -#endif m_last_update_time = Device.dwTimeGlobal; } if (m_file_transfers) @@ -380,9 +374,7 @@ u32 xrServer::OnDelayedMessage(NET_Packet& P, ClientID sender) // Non-Zero means // csPlayers.Enter (); -#ifdef DEBUG VERIFY(verify_entities()); -#endif xrClientData* CL = ID_to_client(sender); // R_ASSERT2 (CL, make_string("packet type [%d]",type).c_str()); @@ -433,9 +425,7 @@ u32 xrServer::OnDelayedMessage(NET_Packet& P, ClientID sender) // Non-Zero means } break; } -#ifdef DEBUG VERIFY(verify_entities()); -#endif // csPlayers.Leave (); return 0; @@ -455,9 +445,7 @@ u32 xrServer::OnMessage(NET_Packet& P, ClientID sender) // Non-Zero means broadc u16 type; P.r_begin(type); -#ifdef DEBUG VERIFY(verify_entities()); -#endif xrClientData* CL = ID_to_client(sender); switch (type) @@ -465,9 +453,7 @@ u32 xrServer::OnMessage(NET_Packet& P, ClientID sender) // Non-Zero means broadc case M_UPDATE: { Process_update(P, sender); // No broadcast -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_SPAWN: @@ -475,17 +461,13 @@ u32 xrServer::OnMessage(NET_Packet& P, ClientID sender) // Non-Zero means broadc if (CL->flags.bLocal) Process_spawn(P, sender); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_EVENT: { Process_event(P, sender); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_EVENT_PACK: @@ -515,9 +497,7 @@ u32 xrServer::OnMessage(NET_Packet& P, ClientID sender) // Non-Zero means broadc //------------------------------------------------------------------- if (SV_Client) SendTo(SV_Client->ID, P, net_flags(TRUE, TRUE)); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_MOVE_PLAYERS_RESPOND: @@ -537,34 +517,26 @@ u32 xrServer::OnMessage(NET_Packet& P, ClientID sender) // Non-Zero means broadc CL->net_Ready = TRUE; if (SV_Client) SendTo(SV_Client->ID, P, net_flags(TRUE, TRUE)); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_GAMEMESSAGE: { SendBroadcast(BroadcastCID, P, net_flags(TRUE, TRUE)); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_CLIENTREADY: { game->OnPlayerConnectFinished(sender); // game->signal_Syncronize (); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_SWITCH_DISTANCE: { game->switch_distance(P, sender); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_CHANGE_LEVEL: @@ -573,42 +545,32 @@ u32 xrServer::OnMessage(NET_Packet& P, ClientID sender) // Non-Zero means broadc { SendBroadcast(BroadcastCID, P, net_flags(TRUE, TRUE)); } -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_SAVE_GAME: { game->save_game(P, sender); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_LOAD_GAME: { game->load_game(P, sender); SendBroadcast(BroadcastCID, P, net_flags(TRUE, TRUE)); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_RELOAD_GAME: { SendBroadcast(BroadcastCID, P, net_flags(TRUE, TRUE)); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_SAVE_PACKET: { Process_save(P, sender); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case M_CLIENT_REQUEST_CONNECTION_DATA: { AddDelayedPacket(P, sender); @@ -736,9 +698,7 @@ u32 xrServer::OnMessage(NET_Packet& P, ClientID sender) // Non-Zero means broadc break; } -#ifdef DEBUG VERIFY(verify_entities()); -#endif return IPureServer::OnMessage(P, sender); } diff --git a/src/xrGame/xrServer_process_event.cpp b/src/xrGame/xrServer_process_event.cpp index 8bcc0842768..64e0037dca5 100644 --- a/src/xrGame/xrServer_process_event.cpp +++ b/src/xrGame/xrServer_process_event.cpp @@ -91,17 +91,13 @@ void xrServer::Process_event(NET_Packet& P, ClientID sender) case GE_OWNERSHIP_TAKE: { Process_event_ownership(P, sender, timestamp, destination); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case GE_OWNERSHIP_TAKE_MP_FORCED: { Process_event_ownership(P, sender, timestamp, destination, TRUE); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case GE_TRADE_SELL: @@ -109,17 +105,13 @@ void xrServer::Process_event(NET_Packet& P, ClientID sender) case GE_LAUNCH_ROCKET: { Process_event_reject(P, sender, timestamp, destination, P.r_u16()); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case GE_DESTROY: { Process_event_destroy(P, sender, timestamp, destination, NULL); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case GE_TRANSFER_AMMO: @@ -141,9 +133,7 @@ void xrServer::Process_event(NET_Packet& P, ClientID sender) // Perfrom real destroy entity_Destroy(e_entity); -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case GE_HIT: @@ -264,9 +254,7 @@ void xrServer::Process_event(NET_Packet& P, ClientID sender) } ////////////////////////////////////////////////////////////////////////// -#ifdef DEBUG VERIFY(verify_entities()); -#endif } break; case GE_ADDON_ATTACH: diff --git a/src/xrUICore/XML/UIXmlInitBase.cpp b/src/xrUICore/XML/UIXmlInitBase.cpp index 553bd14b0b7..9a5d4dea7dc 100644 --- a/src/xrUICore/XML/UIXmlInitBase.cpp +++ b/src/xrUICore/XML/UIXmlInitBase.cpp @@ -789,9 +789,7 @@ bool CUIXmlInitBase::InitFrameLine(CUIXml& xml_doc, pcstr path, int index, CUIFr strconcat(buf, path, ":texture"); const shared_str base_name = xml_doc.Read(buf, index, nullptr); -#ifdef DEBUG VERIFY(base_name); -#endif const u32 color = GetColor(xml_doc, buf, index, 0xff); pWnd->SetTextureColor(color);