From dce3d5f152b81c269f39c0644613bfd1a17eb448 Mon Sep 17 00:00:00 2001 From: Drombeys Date: Fri, 15 Dec 2023 17:29:58 +0300 Subject: [PATCH] Revert "Fix warnings in xrGame" This reverts commit 5449a97fd30cb1237d7501d8fedf222e6ab8eba3. --- src/xr_3da/xrGame/Actor.cpp | 12 +- src/xr_3da/xrGame/ActorAnimation.cpp | 2 +- src/xr_3da/xrGame/ActorCameras.cpp | 16 +- src/xr_3da/xrGame/Actor_Events.cpp | 18 +- src/xr_3da/xrGame/Actor_Feel.cpp | 14 +- src/xr_3da/xrGame/Actor_Network.cpp | 10 +- src/xr_3da/xrGame/Car.cpp | 14 +- src/xr_3da/xrGame/CarWeapon.cpp | 2 +- src/xr_3da/xrGame/CarWheels.cpp | 6 +- src/xr_3da/xrGame/EffectorShot.cpp | 8 +- src/xr_3da/xrGame/GameTask.cpp | 2 +- src/xr_3da/xrGame/GametaskManager.cpp | 16 +- src/xr_3da/xrGame/HUDTarget.cpp | 8 +- src/xr_3da/xrGame/HelicopterWeapon.cpp | 2 +- src/xr_3da/xrGame/HudItem.cpp | 4 +- src/xr_3da/xrGame/Level.cpp | 12 +- src/xr_3da/xrGame/Level_Bullet_Manager.cpp | 6 +- .../xrGame/Level_bullet_manager_firetrace.cpp | 14 +- src/xr_3da/xrGame/Level_load.cpp | 4 +- src/xr_3da/xrGame/Level_network.cpp | 14 +- src/xr_3da/xrGame/Level_network_messages.cpp | 4 +- src/xr_3da/xrGame/MathUtils.cpp | 48 ++--- src/xr_3da/xrGame/MathUtils.h | 2 +- src/xr_3da/xrGame/Missile.cpp | 6 +- src/xr_3da/xrGame/NET_Queue.h | 4 +- src/xr_3da/xrGame/PHAICharacter.cpp | 2 +- src/xr_3da/xrGame/PHCharacter.h | 2 +- src/xr_3da/xrGame/PHDebug.cpp | 16 +- src/xr_3da/xrGame/PHElement.cpp | 6 +- src/xr_3da/xrGame/PHItemList.h | 2 +- src/xr_3da/xrGame/PHJoint.cpp | 4 +- src/xr_3da/xrGame/PHMovementControl.cpp | 6 +- src/xr_3da/xrGame/PHShellActivate.cpp | 4 +- src/xr_3da/xrGame/PHSimpleCharacter.cpp | 16 +- src/xr_3da/xrGame/PHStaticGeomShell.cpp | 4 +- src/xr_3da/xrGame/PhraseDialog.cpp | 2 +- src/xr_3da/xrGame/PhysicsShellHolder.cpp | 2 +- src/xr_3da/xrGame/Torch.cpp | 2 +- src/xr_3da/xrGame/UIFrameRect.cpp | 12 +- src/xr_3da/xrGame/WeaponFire.cpp | 2 +- src/xr_3da/xrGame/actor_statistic_mgr.cpp | 6 +- src/xr_3da/xrGame/agent_enemy_manager.cpp | 52 +++--- src/xr_3da/xrGame/agent_location_manager.cpp | 8 +- src/xr_3da/xrGame/ai/crow/ai_crow.cpp | 4 +- .../bloodsucker/bloodsucker_vampire_inline.h | 4 +- src/xr_3da/xrGame/ai/monsters/burer/burer.cpp | 8 +- .../xrGame/ai/monsters/control_animation.cpp | 2 +- .../xrGame/ai/monsters/control_jump.cpp | 4 +- .../ai/monsters/monster_corpse_manager.cpp | 8 +- .../ai/monsters/monster_enemy_manager.cpp | 12 +- .../xrGame/ai/monsters/monster_sound_memory.h | 4 +- .../ai/monsters/pseudodog/psy_dog_aura.cpp | 10 +- .../psy_dog_state_psy_attack_hide_inline.h | 8 +- src/xr_3da/xrGame/ai/monsters/snork/snork.cpp | 2 +- .../states/monster_state_eat_inline.h | 16 +- .../states/monster_state_rest_fun_inline.h | 12 +- .../xrGame/ai/stalker/ai_stalker_debug.cpp | 18 +- .../xrGame/ai/stalker/ai_stalker_events.cpp | 8 +- .../xrGame/ai/stalker/ai_stalker_fire.cpp | 4 +- src/xr_3da/xrGame/ai/trader/ai_trader.cpp | 8 +- src/xr_3da/xrGame/alife_anomalous_zone.cpp | 4 +- src/xr_3da/xrGame/alife_combat_manager.cpp | 4 +- .../xrGame/alife_communication_manager.cpp | 4 +- src/xr_3da/xrGame/alife_graph_registry.cpp | 8 +- .../xrGame/alife_interaction_manager.cpp | 4 +- .../alife_monster_movement_manager_script.cpp | 8 +- ...ife_monster_patrol_path_manager_script.cpp | 6 +- src/xr_3da/xrGame/alife_simulator_base.cpp | 4 +- src/xr_3da/xrGame/alife_simulator_script.cpp | 100 +++++------ .../xrGame/alife_storage_manager_inline.h | 4 +- .../xrGame/alife_surge_manager_inline.h | 4 +- .../xrGame/alife_switch_manager_inline.h | 4 +- src/xr_3da/xrGame/alife_update_manager.cpp | 4 +- src/xr_3da/xrGame/associative_vector_inline.h | 10 +- .../xrGame/base_client_classes_wrappers.h | 4 +- .../data_storage_double_linked_list_inline.h | 2 +- src/xr_3da/xrGame/dcylinder/dCylinder.cpp | 164 +++++++++--------- src/xr_3da/xrGame/ef_storage_script.cpp | 52 +++--- .../xrGame/game_cl_deathmatch_buywnd.cpp | 2 +- src/xr_3da/xrGame/game_graph_script.cpp | 12 +- .../xrGame/game_location_selector_inline.h | 14 +- src/xr_3da/xrGame/game_sv_deathmatch.cpp | 10 +- src/xr_3da/xrGame/game_sv_mp.cpp | 34 ++-- src/xr_3da/xrGame/game_sv_single.cpp | 2 +- src/xr_3da/xrGame/graph_abstract_inline.h | 16 +- src/xr_3da/xrGame/id_generator.h | 6 +- src/xr_3da/xrGame/ik/Dof7control.cpp | 4 +- src/xr_3da/xrGame/ik/IKLimb.cpp | 2 +- src/xr_3da/xrGame/ik/eqn.cxx | 4 +- src/xr_3da/xrGame/ik/eqn.h | 2 +- src/xr_3da/xrGame/ik/eulersolver.cxx | 12 +- src/xr_3da/xrGame/ik/jtlimits.cxx | 8 +- src/xr_3da/xrGame/ik/jtlimits.h | 8 +- src/xr_3da/xrGame/ik/math3d.cpp | 4 +- src/xr_3da/xrGame/ik/mathTrig.cpp | 4 +- src/xr_3da/xrGame/ik_anim_state.cpp | 2 +- src/xr_3da/xrGame/ini_table_loader.h | 2 +- src/xr_3da/xrGame/level_graph_debug.cpp | 28 +-- src/xr_3da/xrGame/level_graph_inline.h | 8 +- src/xr_3da/xrGame/level_graph_vertex.cpp | 32 ++-- src/xr_3da/xrGame/level_script.cpp | 10 +- src/xr_3da/xrGame/map_location.cpp | 16 +- src/xr_3da/xrGame/memory_space_script.cpp | 20 +-- src/xr_3da/xrGame/movement_manager_physic.cpp | 4 +- src/xr_3da/xrGame/object_cloner.h | 12 +- src/xr_3da/xrGame/object_interfaces.h | 3 - src/xr_3da/xrGame/operator_abstract_inline.h | 32 ++-- .../xrGame/path_manager_game_vertex_inline.h | 6 +- .../xrGame/patrol_path_params_script.cpp | 6 +- src/xr_3da/xrGame/physics_game.cpp | 4 +- src/xr_3da/xrGame/problem_solver.h | 2 +- src/xr_3da/xrGame/problem_solver_inline.h | 8 +- src/xr_3da/xrGame/profiler.cpp | 16 +- src/xr_3da/xrGame/profiler.h | 4 +- src/xr_3da/xrGame/quadtree_inline.h | 4 +- .../xrGame/saved_game_wrapper_script.cpp | 8 +- src/xr_3da/xrGame/script_effector_script.cpp | 12 +- src/xr_3da/xrGame/script_engine_script.cpp | 12 +- src/xr_3da/xrGame/script_entity.cpp | 4 +- src/xr_3da/xrGame/script_fmatrix_script.cpp | 8 +- src/xr_3da/xrGame/script_ini_file_script.cpp | 10 +- src/xr_3da/xrGame/script_lua_helper.cpp | 4 +- .../xrGame/script_net_packet_script.cpp | 20 +-- src/xr_3da/xrGame/script_reader_script.cpp | 16 +- .../xrGame/script_render_device_script.cpp | 6 +- src/xr_3da/xrGame/script_sound.cpp | 2 +- src/xr_3da/xrGame/script_sound.h | 2 +- src/xr_3da/xrGame/sound_player.cpp | 12 +- .../xrGame/space_restriction_bridge_inline.h | 8 +- .../xrGame/space_restriction_holder.cpp | 8 +- src/xr_3da/xrGame/stalker_combat_actions.cpp | 12 +- .../xrGame/tri-colliderknoopc/dTriBox.cpp | 14 +- .../tri-colliderknoopc/dTriCylinder.cpp | 12 +- .../xrGame/tri-colliderknoopc/dTriSphere.cpp | 8 +- src/xr_3da/xrGame/ui/Restrictions.cpp | 8 +- src/xr_3da/xrGame/ui/UIBagWnd.cpp | 6 +- src/xr_3da/xrGame/ui/UIBuyWnd.cpp | 8 +- src/xr_3da/xrGame/ui/UICarBodyWnd.cpp | 8 +- src/xr_3da/xrGame/ui/UIEditKeyBind.cpp | 4 +- src/xr_3da/xrGame/ui/UIEventsWnd.cpp | 6 +- src/xr_3da/xrGame/ui/UIInventoryWnd.cpp | 6 +- src/xr_3da/xrGame/ui/UIInventoryWnd3.cpp | 8 +- src/xr_3da/xrGame/ui/UIListWnd.cpp | 4 +- src/xr_3da/xrGame/ui/UIMapWnd.cpp | 6 +- src/xr_3da/xrGame/ui/UIMotionIcon.cpp | 6 +- src/xr_3da/xrGame/ui/UIMpTradeWnd_items.cpp | 4 +- src/xr_3da/xrGame/ui/UIScrollBar.cpp | 6 +- src/xr_3da/xrGame/ui/UITalkWnd.cpp | 2 +- src/xr_3da/xrGame/ui/UITreeViewItem.cpp | 16 +- src/xr_3da/xrGame/ui/UIVote.cpp | 4 +- src/xr_3da/xrGame/ui/UIWindow.cpp | 10 +- src/xr_3da/xrGame/visual_memory_manager.cpp | 8 +- src/xr_3da/xrGame/xml_str_id_loader.h | 4 +- src/xr_3da/xrGame/xrGame.vcxproj | 12 +- src/xr_3da/xrGame/xrServer.cpp | 34 ++-- src/xr_3da/xrGame/xrServer_Object_Base.cpp | 4 +- src/xr_3da/xrGame/xrServer_Object_Base.h | 2 +- src/xr_3da/xrGame/xrServer_Objects_ALife.cpp | 8 +- .../xrServer_Objects_ALife_Monsters.cpp | 6 +- .../xrGame/xrServer_perform_sls_save.cpp | 8 +- src/xr_3da/xrGame/xrServer_process_spawn.cpp | 6 +- src/xr_3da/xrGame/xr_level_controller.cpp | 4 +- 162 files changed, 839 insertions(+), 828 deletions(-) diff --git a/src/xr_3da/xrGame/Actor.cpp b/src/xr_3da/xrGame/Actor.cpp index 4ea27282..78eb96cc 100644 --- a/src/xr_3da/xrGame/Actor.cpp +++ b/src/xr_3da/xrGame/Actor.cpp @@ -463,16 +463,16 @@ void CActor::Hit (SHit* pHDS) CParticlesPlayer::MakeXFORM(this,HDS.bone(),HDS.dir,HDS.p_in_bone_space,pos); - // установить particles - CParticlesObject* ps_ = NULL; + // particles + CParticlesObject* ps = NULL; if (eacFirstEye == cam_active && this == Level().CurrentEntity()) - ps_ = CParticlesObject::Create(invincibility_fire_shield_1st,TRUE); + ps = CParticlesObject::Create(invincibility_fire_shield_1st,TRUE); else - ps_ = CParticlesObject::Create(invincibility_fire_shield_3rd,TRUE); + ps = CParticlesObject::Create(invincibility_fire_shield_3rd,TRUE); - ps_->UpdateParent(pos,Fvector().set(0.f,0.f,0.f)); - GamePersistent().ps_needtoplay.push_back(ps_); + ps->UpdateParent(pos,Fvector().set(0.f,0.f,0.f)); + GamePersistent().ps_needtoplay.push_back(ps); }; }; diff --git a/src/xr_3da/xrGame/ActorAnimation.cpp b/src/xr_3da/xrGame/ActorAnimation.cpp index b6ababb5..4d50d635 100644 --- a/src/xr_3da/xrGame/ActorAnimation.cpp +++ b/src/xr_3da/xrGame/ActorAnimation.cpp @@ -534,7 +534,7 @@ void CActor::g_SetAnimation( u32 mstate_rl ) float pos = 0.f; VERIFY (!m_current_legs_blend || !fis_zero(m_current_legs_blend->timeTotal)); if ((mstate_real&mcAnyMove)&&(mstate_old&mcAnyMove)&&m_current_legs_blend) - pos = (float) fmod(m_current_legs_blend->timeCurrent,m_current_legs_blend->timeTotal)/m_current_legs_blend->timeTotal; + pos = fmod(m_current_legs_blend->timeCurrent,m_current_legs_blend->timeTotal)/m_current_legs_blend->timeTotal; m_current_legs_blend = smart_cast(Visual())->PlayCycle(M_legs,TRUE,legs_play_callback,this); if ((!(mstate_old&mcAnyMove))&&(mstate_real&mcAnyMove)) pos = 0.5f*Random.randI(2); diff --git a/src/xr_3da/xrGame/ActorCameras.cpp b/src/xr_3da/xrGame/ActorCameras.cpp index 38e76470..d8f3d0e9 100644 --- a/src/xr_3da/xrGame/ActorCameras.cpp +++ b/src/xr_3da/xrGame/ActorCameras.cpp @@ -74,9 +74,9 @@ void CActor::camUpdateLadder(float dt) { float &cam_pitch = cameras[eacFirstEye]->pitch; const float ldown_pitch = cameras[eacFirstEye]->lim_pitch.y; - float delta_ = angle_difference_signed(ldown_pitch,cam_pitch); - if(delta_>0.f) - cam_pitch += delta_* _min(dt*10.f,1.f) ; + float delta = angle_difference_signed(ldown_pitch,cam_pitch); + if(delta>0.f) + cam_pitch += delta* _min(dt*10.f,1.f) ; } } @@ -96,7 +96,7 @@ float CActor::CameraHeight() IC float viewport_near(float& w, float& h) { - w = 2.f*VIEWPORT_NEAR* (float) tan(deg2rad(Device.fFOV)/2.f); + w = 2.f*VIEWPORT_NEAR*tan(deg2rad(Device.fFOV)/2.f); h = w*Device.fASPECT; float c = _sqrt (w*w + h*h); return _max(_max(VIEWPORT_NEAR,_max(w,h)),c); @@ -245,11 +245,11 @@ void CActor::cam_Update(float dt, float fFOV) } else { - xr_vector ISpatialResult_; - g_SpatialSpacePhysic->q_box(ISpatialResult_, 0, STYPE_PHYSIC, point, Fvector().set(VIEWPORT_NEAR,VIEWPORT_NEAR,VIEWPORT_NEAR)); - for (u32 o_it=0; o_it ISpatialResult; + g_SpatialSpacePhysic->q_box(ISpatialResult, 0, STYPE_PHYSIC, point, Fvector().set(VIEWPORT_NEAR,VIEWPORT_NEAR,VIEWPORT_NEAR)); + for (u32 o_it=0; o_it(ISpatialResult_[o_it]); + CPHShell* pCPHS= smart_cast(ISpatialResult[o_it]); if (pCPHS) { _viewport_near = 0.01f; diff --git a/src/xr_3da/xrGame/Actor_Events.cpp b/src/xr_3da/xrGame/Actor_Events.cpp index 87ee0d7b..a96a8e56 100644 --- a/src/xr_3da/xrGame/Actor_Events.cpp +++ b/src/xr_3da/xrGame/Actor_Events.cpp @@ -83,10 +83,10 @@ void CActor::OnEvent (NET_Packet& P, u16 type) } else { - NET_Packet P_; - u_EventGen(P_,GE_OWNERSHIP_REJECT,ID()); - P_.w_u16(u16(O->ID())); - u_EventSend(P_); + NET_Packet P; + u_EventGen(P,GE_OWNERSHIP_REJECT,ID()); + P.w_u16(u16(O->ID())); + u_EventSend(P); } } break; @@ -205,10 +205,10 @@ void CActor::OnEvent (NET_Packet& P, u16 type) }break; case GEG_PLAYER_ATTACH_HOLDER: { - u32 id_ = P.r_u32(); - CObject* O = Level().Objects.net_Find (id_); + u32 id = P.r_u32(); + CObject* O = Level().Objects.net_Find (id); if (!O){ - Msg("! Error: No object to attach holder [%d]", id_); + Msg("! Error: No object to attach holder [%d]", id); break; } VERIFY(m_holder==NULL); @@ -219,9 +219,9 @@ void CActor::OnEvent (NET_Packet& P, u16 type) case GEG_PLAYER_DETACH_HOLDER: { if (!m_holder) break; - u32 id_ = P.r_u32(); + u32 id = P.r_u32(); CGameObject* GO = smart_cast(m_holder); - VERIFY (id_==GO->ID()); + VERIFY (id==GO->ID()); use_Holder (NULL); }break; case GEG_PLAYER_PLAY_HEADSHOT_PARTICLE: diff --git a/src/xr_3da/xrGame/Actor_Feel.cpp b/src/xr_3da/xrGame/Actor_Feel.cpp index 537211fc..2cc515b9 100644 --- a/src/xr_3da/xrGame/Actor_Feel.cpp +++ b/src/xr_3da/xrGame/Actor_Feel.cpp @@ -160,18 +160,18 @@ void CActor::PickupModeUpdate_COD () CInventoryItem* pNearestItem = NULL; for (u32 o_it=0; o_it (spatial_->dcast_CObject ()); + ISpatial* spatial = ISpatialResult[o_it]; + CInventoryItem* pIItem = smart_cast (spatial->dcast_CObject ()); if (0 == pIItem) continue; if (pIItem->object().H_Parent() != NULL) continue; if (!pIItem->CanTake()) continue; if (pIItem->object().CLS_ID == CLSID_OBJECT_G_RPG7 || pIItem->object().CLS_ID == CLSID_OBJECT_G_FAKE) continue; - CGrenade* pGrenade = smart_cast (spatial_->dcast_CObject ()); + CGrenade* pGrenade = smart_cast (spatial->dcast_CObject ()); if (pGrenade && !pGrenade->Useful()) continue; - CMissile* pMissile = smart_cast (spatial_->dcast_CObject ()); + CMissile* pMissile = smart_cast (spatial->dcast_CObject ()); if (pMissile && !pMissile->Useful()) continue; Fvector A, B, tmp; @@ -192,9 +192,9 @@ void CActor::PickupModeUpdate_COD () if(pNearestItem) { - CFrustum frustum_; - frustum_.CreateFromMatrix (Device.mFullTransform,FRUSTUM_P_LRTB|FRUSTUM_P_FAR); - if (!CanPickItem(frustum_,Device.vCameraPosition,&pNearestItem->object())) + CFrustum frustum; + frustum.CreateFromMatrix (Device.mFullTransform,FRUSTUM_P_LRTB|FRUSTUM_P_FAR); + if (!CanPickItem(frustum,Device.vCameraPosition,&pNearestItem->object())) pNearestItem = NULL; } diff --git a/src/xr_3da/xrGame/Actor_Network.cpp b/src/xr_3da/xrGame/Actor_Network.cpp index 3f6ab947..57bf748a 100644 --- a/src/xr_3da/xrGame/Actor_Network.cpp +++ b/src/xr_3da/xrGame/Actor_Network.cpp @@ -1726,14 +1726,14 @@ void CActor::Check_for_AutoPickUp() Fbox APU_Box; APU_Box.set(Fvector().sub(bc, m_AutoPickUp_AABB), Fvector().add(bc, m_AutoPickUp_AABB)); - xr_vector ISpatialResult_; - g_SpatialSpace->q_box (ISpatialResult_,0,STYPE_COLLIDEABLE,bc,m_AutoPickUp_AABB); + xr_vector ISpatialResult; + g_SpatialSpace->q_box (ISpatialResult,0,STYPE_COLLIDEABLE,bc,m_AutoPickUp_AABB); // Determine visibility for dynamic part of scene - for (u32 o_it=0; o_it (spatial_->dcast_CObject ()); + ISpatial* spatial = ISpatialResult[o_it]; + CInventoryItem* pIItem = smart_cast (spatial->dcast_CObject ()); if (0 == pIItem) continue; if (!pIItem->CanTake()) continue; if (Level().m_feel_deny.is_object_denied(pIItem->cast_game_object()) ) continue; diff --git a/src/xr_3da/xrGame/Car.cpp b/src/xr_3da/xrGame/Car.cpp index 02705ee1..71693e2b 100644 --- a/src/xr_3da/xrGame/Car.cpp +++ b/src/xr_3da/xrGame/Car.cpp @@ -950,9 +950,9 @@ void CCar::Init() i->second.CDamagableHealthItem::Init(float(atof(*item.second)),2); else { - xr_map ::iterator i_=m_doors.find(index); - R_ASSERT3(i_!=m_doors.end(),"only wheel and doors bones allowed for damage defs",*item.first); - i_->second.CDamagableHealthItem::Init(float(atof(*item.second)),1); + xr_map ::iterator i=m_doors.find(index); + R_ASSERT3(i!=m_doors.end(),"only wheel and doors bones allowed for damage defs",*item.first); + i->second.CDamagableHealthItem::Init(float(atof(*item.second)),1); } } @@ -1688,10 +1688,10 @@ void CCar::OnEvent(NET_Packet& P, u16 type) else { if (!O || !O->H_Parent() || (this != O->H_Parent())) return; - NET_Packet P_; - u_EventGen(P_,GE_OWNERSHIP_REJECT,ID()); - P_.w_u16(u16(O->ID())); - u_EventSend(P_); + NET_Packet P; + u_EventGen(P,GE_OWNERSHIP_REJECT,ID()); + P.w_u16(u16(O->ID())); + u_EventSend(P); } }break; case GE_OWNERSHIP_REJECT: diff --git a/src/xr_3da/xrGame/CarWeapon.cpp b/src/xr_3da/xrGame/CarWeapon.cpp index c0b76907..74da5c10 100644 --- a/src/xr_3da/xrGame/CarWeapon.cpp +++ b/src/xr_3da/xrGame/CarWeapon.cpp @@ -196,7 +196,7 @@ float CCarWeapon::FireDirDiff() Fvector d1,d2; d1.set(m_cur_x_rot,m_cur_y_rot,0).normalize_safe(); d2.set(m_tgt_x_rot,m_tgt_y_rot,0).normalize_safe(); - return (float) rad2deg( acos(d1.dotproduct(d2)) ); + return rad2deg( acos(d1.dotproduct(d2)) ); } const Fvector& CCarWeapon::get_CurrentFirePoint() diff --git a/src/xr_3da/xrGame/CarWheels.cpp b/src/xr_3da/xrGame/CarWheels.cpp index 6845127d..99c7183b 100644 --- a/src/xr_3da/xrGame/CarWheels.cpp +++ b/src/xr_3da/xrGame/CarWheels.cpp @@ -238,9 +238,9 @@ void CCar::SWheelSteer::Init() } pos_right=pos_right>0.f ? -1.f : 1.f; - float steering_torque_=pKinematics->LL_UserData()->r_float("car_definition","steering_torque"); - pwheel->ApplySteerAxisTorque(steering_torque_); - dJointSetHinge2Param(pwheel->joint->GetDJoint(), dParamFudgeFactor, 0.005f/steering_torque_); + float steering_torque=pKinematics->LL_UserData()->r_float("car_definition","steering_torque"); + pwheel->ApplySteerAxisTorque(steering_torque); + dJointSetHinge2Param(pwheel->joint->GetDJoint(), dParamFudgeFactor, 0.005f/steering_torque); pwheel->ApplySteerAxisVel(0.f); limited=false; } diff --git a/src/xr_3da/xrGame/EffectorShot.cpp b/src/xr_3da/xrGame/EffectorShot.cpp index 9a81ed1b..295135fe 100644 --- a/src/xr_3da/xrGame/EffectorShot.cpp +++ b/src/xr_3da/xrGame/EffectorShot.cpp @@ -185,15 +185,15 @@ CCameraShotEffector::~CCameraShotEffector() BOOL CCameraShotEffector::Process (Fvector &p, Fvector &d, Fvector &n, float& fFov, float& fFar, float& fAspect) { if (bActive){ - float h,p_; - d.getHP (h,p_); + float h,p; + d.getHP (h,p); if (bSingleShoot) { if (bSSActive) - d.setHP (h+fLastDeltaHorz,p_+fLastDeltaVert); + d.setHP (h+fLastDeltaHorz,p+fLastDeltaVert); } else - d.setHP (h+fAngleHorz,p_+fAngleVert); + d.setHP (h+fAngleHorz,p+fAngleVert); Update (); } diff --git a/src/xr_3da/xrGame/GameTask.cpp b/src/xr_3da/xrGame/GameTask.cpp index 1085379d..24100063 100644 --- a/src/xr_3da/xrGame/GameTask.cpp +++ b/src/xr_3da/xrGame/GameTask.cpp @@ -127,7 +127,7 @@ void CGameTask::Load(const TASK_ID& id) { objective.icon_texture_name = g_gameTaskXml->Read(g_gameTaskXml->GetLocalRoot(), "icon", 0, NULL); if( objective.icon_texture_name.size() && - 0 != _stricmp(*objective.icon_texture_name, "ui\\ui_icons_task") ) + 0 != stricmp(*objective.icon_texture_name, "ui\\ui_icons_task") ) { objective.icon_rect = CUITextureMaster::GetTextureRect(*objective.icon_texture_name); objective.icon_rect.rb.sub(objective.icon_rect.rb, objective.icon_rect.lt); diff --git a/src/xr_3da/xrGame/GametaskManager.cpp b/src/xr_3da/xrGame/GametaskManager.cpp index ac3e3abd..93345d0c 100644 --- a/src/xr_3da/xrGame/GametaskManager.cpp +++ b/src/xr_3da/xrGame/GametaskManager.cpp @@ -197,16 +197,16 @@ void CGameTaskManager::UpdateTasks () for (I = tasks; I != E; ++I) { CGameTask *t = (*I).game_task; - for(u16 i_=0; i_m_Objectives.size() ;++i_) + for(u16 i=0; im_Objectives.size() ;++i) { - SGameTaskObjective& obj = t->Objective(i_); - if(obj.TaskState()!=eTaskStateInProgress && i_==0) break; + SGameTaskObjective& obj = t->Objective(i); + if(obj.TaskState()!=eTaskStateInProgress && i==0) break; if(obj.TaskState()!=eTaskStateInProgress) continue; ETaskState state = obj.UpdateState(); if( (state==eTaskStateFail || state==eTaskStateCompleted)) - SetTaskState(t, i_, state); + SetTaskState(t, i, state); } } @@ -264,12 +264,12 @@ void CGameTaskManager::UpdateActiveTask () if( !bHasSpotPointer ) { bool bDone =false; - GameTasks::iterator it_ = GameTasks().begin(); - GameTasks::iterator it_e_ = GameTasks().end(); + GameTasks::iterator it = GameTasks().begin(); + GameTasks::iterator it_e = GameTasks().end(); - for( ;(it_!=it_e_)&&(!bDone); ++it_ ) + for( ;(it!=it_e)&&(!bDone); ++it ) { - CGameTask* t = (*it_).game_task; + CGameTask* t = (*it).game_task; if(t->Objective(0).TaskState()!=eTaskStateInProgress) continue; for(u16 i=0; (im_Objectives.size())&&(!bDone) ;++i) diff --git a/src/xr_3da/xrGame/HUDTarget.cpp b/src/xr_3da/xrGame/HUDTarget.cpp index 6b6db15d..335de029 100644 --- a/src/xr_3da/xrGame/HUDTarget.cpp +++ b/src/xr_3da/xrGame/HUDTarget.cpp @@ -153,14 +153,14 @@ void CHUDTarget::Render() if (psHUD_Flags.test(HUD_INFO)){ if (RQ.O){ - CEntityAlive* E_ = smart_cast (RQ.O); + CEntityAlive* E = smart_cast (RQ.O); CEntityAlive* pCurEnt = smart_cast (Level().CurrentEntity()); PIItem l_pI = smart_cast (RQ.O); if (IsGameTypeSingle()) { CInventoryOwner* our_inv_owner = smart_cast(pCurEnt); - if (E_ && E_->g_Alive() && !E_->cast_base_monster()) + if (E && E->g_Alive() && !E->cast_base_monster()) { //. CInventoryOwner* our_inv_owner = smart_cast(pCurEnt); CInventoryOwner* others_inv_owner = smart_cast(E); @@ -199,12 +199,12 @@ void CHUDTarget::Render() } else { - if (E_ && (E_->GetfHealth()>0)) + if (E && (E->GetfHealth()>0)) { if (pCurEnt && GameID() == GAME_SINGLE){ if (GameID() == GAME_DEATHMATCH) C = C_ON_ENEMY; else{ - if (E_->g_Team() != pCurEnt->g_Team()) C = C_ON_ENEMY; + if (E->g_Team() != pCurEnt->g_Team()) C = C_ON_ENEMY; else C = C_ON_FRIEND; }; if (RQ.range >= recon_mindist() && RQ.range <= recon_maxdist()){ diff --git a/src/xr_3da/xrGame/HelicopterWeapon.cpp b/src/xr_3da/xrGame/HelicopterWeapon.cpp index 643423ad..c94cf397 100644 --- a/src/xr_3da/xrGame/HelicopterWeapon.cpp +++ b/src/xr_3da/xrGame/HelicopterWeapon.cpp @@ -162,7 +162,7 @@ void CHelicopter::MGunFireStart() //calc min firetrail length float h = fp.y-ep.y; if(h>0.0f){ - float dl =h* (float) tan(m_lim_x_rot.y); + float dl =h*tan(m_lim_x_rot.y); float ds = fp.distance_to_xz(ep); if(ds>dl){ float half_trail = ds-dl; diff --git a/src/xr_3da/xrGame/HudItem.cpp b/src/xr_3da/xrGame/HudItem.cpp index c80d4ac2..b02f49b6 100644 --- a/src/xr_3da/xrGame/HudItem.cpp +++ b/src/xr_3da/xrGame/HudItem.cpp @@ -289,8 +289,8 @@ void CHudItem::animGet (MotionSVec& lst, LPCSTR prefix) { string128 sh_anim; sprintf_s (sh_anim,"%s%d",prefix,i); - const MotionID &M_ = m_pHUD->animGet(sh_anim); - if (M_) lst.push_back(M_); + const MotionID &M = m_pHUD->animGet(sh_anim); + if (M) lst.push_back(M); } R_ASSERT2 (!lst.empty(),prefix); } diff --git a/src/xr_3da/xrGame/Level.cpp b/src/xr_3da/xrGame/Level.cpp index 16f2d141..95245b90 100644 --- a/src/xr_3da/xrGame/Level.cpp +++ b/src/xr_3da/xrGame/Level.cpp @@ -690,10 +690,10 @@ void CLevel::OnRender() if (psAI_Flags.is(aiVision)) { for (u32 I=0; I < Level().Objects.o_count(); I++) { CObject *object = Objects.o_get_by_iterator(I); - CAI_Stalker *stalker_ = smart_cast(object); - if (!stalker_) + CAI_Stalker *stalker = smart_cast(object); + if (!stalker) continue; - stalker_->dbg_draw_vision (); + stalker->dbg_draw_vision (); } } @@ -701,11 +701,11 @@ void CLevel::OnRender() if (psAI_Flags.test(aiDrawVisibilityRays)) { for (u32 I=0; I < Level().Objects.o_count(); I++) { CObject *object = Objects.o_get_by_iterator(I); - CAI_Stalker *stalker_ = smart_cast(object); - if (!stalker_) + CAI_Stalker *stalker = smart_cast(object); + if (!stalker) continue; - stalker_->dbg_draw_visibility_rays (); + stalker->dbg_draw_visibility_rays (); } } #endif diff --git a/src/xr_3da/xrGame/Level_Bullet_Manager.cpp b/src/xr_3da/xrGame/Level_Bullet_Manager.cpp index d509b595..3ec431f6 100644 --- a/src/xr_3da/xrGame/Level_Bullet_Manager.cpp +++ b/src/xr_3da/xrGame/Level_Bullet_Manager.cpp @@ -222,7 +222,7 @@ void CBulletManager::UpdateWorkload() m_Lock.Leave (); } -bool CBulletManager::CalcBullet (collide::rq_results & rq_storage_, xr_vector& rq_spatial_, SBullet* bullet, u32 delta_time) +bool CBulletManager::CalcBullet (collide::rq_results & rq_storage, xr_vector& rq_spatial, SBullet* bullet, u32 delta_time) { VERIFY (bullet); @@ -246,11 +246,11 @@ bool CBulletManager::CalcBullet (collide::rq_results & rq_storage_, xr_vectorpos, bullet->dir, range, CDB::OPT_CULL, collide::rqtBoth); BOOL result = FALSE; VERIFY (!fis_zero(RD.dir.square_magnitude())); - result = Level().ObjectSpace.RayQuery(rq_storage_, RD, firetrace_callback, &bullet_data, test_callback, NULL); + result = Level().ObjectSpace.RayQuery(rq_storage, RD, firetrace_callback, &bullet_data, test_callback, NULL); if (result && bullet_data.bStopTracing) { - range = (rq_storage_.r_begin()+rq_storage_.r_count()-1)->range; + range = (rq_storage.r_begin()+rq_storage.r_count()-1)->range; } range = _max (EPS_L,range); diff --git a/src/xr_3da/xrGame/Level_bullet_manager_firetrace.cpp b/src/xr_3da/xrGame/Level_bullet_manager_firetrace.cpp index 196007bb..22379cc8 100644 --- a/src/xr_3da/xrGame/Level_bullet_manager_firetrace.cpp +++ b/src/xr_3da/xrGame/Level_bullet_manager_firetrace.cpp @@ -77,9 +77,9 @@ BOOL CBulletManager::test_callback(const collide::ray_defs& rd, CObject* object, } # else float game_difficulty_hit_probability = actor->HitProbability(); - CAI_Stalker *stalker_ = smart_cast(initiator); - if (stalker_) - hpf = stalker_->SpecificCharacter().hit_probability_factor(); + CAI_Stalker *stalker = smart_cast(initiator); + if (stalker) + hpf = stalker->SpecificCharacter().hit_probability_factor(); float dist_factor = 1.f; CObject *weapon_object = Level().Objects.net_Find (bullet->weapon_id); @@ -475,10 +475,10 @@ std::pair CBulletManager::ObjectHit (SBullet* bullet, const Fvect //уменьшить скорость в зависимости от простреливаемости bullet->speed *= (1-mtl->fShootFactor)*scale; - //сколько энергии в процентах потеряла пуля при столкновении - float energy_lost_ = 1.f - bullet->speed/old_speed; - //импульс переданный объекту равен прямопропорционален потерянной энергии - impulse = bullet->hit_impulse*speed_factor*energy_lost_; + // + float energy_lost = 1.f - bullet->speed/old_speed; + // + impulse = bullet->hit_impulse*speed_factor*energy_lost; #ifdef DEBUG bullet_state = 0; diff --git a/src/xr_3da/xrGame/Level_load.cpp b/src/xr_3da/xrGame/Level_load.cpp index d3f11190..821581e6 100644 --- a/src/xr_3da/xrGame/Level_load.cpp +++ b/src/xr_3da/xrGame/Level_load.cpp @@ -44,12 +44,12 @@ BOOL CLevel::Load_GameSpecific_After() u32 chunk = 0; string256 ref_name; Fmatrix transform; - Fvector zero_vel_={0.f,0.f,0.f}; + Fvector zero_vel={0.f,0.f,0.f}; for (IReader *OBJ = F->open_chunk_iterator(chunk); OBJ; OBJ = F->open_chunk_iterator(chunk,OBJ)) { OBJ->r_stringZ (ref_name,sizeof(ref_name)); OBJ->r (&transform,sizeof(Fmatrix));transform.c.y+=0.01f; pStaticParticles = CParticlesObject::Create(ref_name,FALSE,false); - pStaticParticles->UpdateParent (transform,zero_vel_); + pStaticParticles->UpdateParent (transform,zero_vel); pStaticParticles->Play (); m_StaticParticles.push_back (pStaticParticles); } diff --git a/src/xr_3da/xrGame/Level_network.cpp b/src/xr_3da/xrGame/Level_network.cpp index ed1c7c52..5fb0eca2 100644 --- a/src/xr_3da/xrGame/Level_network.cpp +++ b/src/xr_3da/xrGame/Level_network.cpp @@ -303,15 +303,15 @@ BOOL CLevel::Connect2Server (LPCSTR options) u32 CurTime = GetTickCount(); if (CurTime > EndTime) { - NET_Packet P_; - P_.B.count = 0; - P_.r_pos = 0; + NET_Packet P; + P.B.count = 0; + P.r_pos = 0; - P_.w_u8(0); - P_.w_u8(0); - P_.w_stringZ("Data verification failed. Cheater? [1]"); + P.w_u8(0); + P.w_u8(0); + P.w_stringZ("Data verification failed. Cheater? [1]"); - OnConnectResult(&P_); + OnConnectResult(&P); } if (net_isFails_Connect()) { diff --git a/src/xr_3da/xrGame/Level_network_messages.cpp b/src/xr_3da/xrGame/Level_network_messages.cpp index 44d39051..8765d6b9 100644 --- a/src/xr_3da/xrGame/Level_network_messages.cpp +++ b/src/xr_3da/xrGame/Level_network_messages.cpp @@ -150,12 +150,12 @@ void CLevel::ClientReceive() u8 Count = P->r_u8(); for (u8 i=0; ir_u16(); + u16 ID = P->r_u16(); Fvector NewPos, NewDir; P->r_vec3(NewPos); P->r_vec3(NewDir); - CActor* OActor = smart_cast(Objects.net_Find (ID_)); + CActor* OActor = smart_cast(Objects.net_Find (ID)); if (0 == OActor) break; OActor->MoveActor(NewPos, NewDir); }; diff --git a/src/xr_3da/xrGame/MathUtils.cpp b/src/xr_3da/xrGame/MathUtils.cpp index 1660dc53..af3c7dd0 100644 --- a/src/xr_3da/xrGame/MathUtils.cpp +++ b/src/xr_3da/xrGame/MathUtils.cpp @@ -255,8 +255,8 @@ IC bool RAYvsCYLINDER(const Fcylinder& c_cylinder, const Fvector &S, const Fvect float sq_sphere_dist=sq_sin*tc_h*tc_h; //if(sq_sphere_dist>sq_horde)return false ; float tr_c=tr-tc_h*cs ; - float diff_=_sqrt(sq_horde-sq_sphere_dist) ; - tr2=tr_c+diff_ ; + float diff=_sqrt(sq_horde-sq_sphere_dist) ; + tr2=tr_c+diff ; if(tr2<0.f) return false ;// if(tr2EPS) k*= (float) acos(cosinus) / _sqrt(sinus_2); + if(sinus_2>EPS) k*=acos(cosinus)/_sqrt(sinus_2); w.mul(k); } diff --git a/src/xr_3da/xrGame/Missile.cpp b/src/xr_3da/xrGame/Missile.cpp index 9ce36acb..45834318 100644 --- a/src/xr_3da/xrGame/Missile.cpp +++ b/src/xr_3da/xrGame/Missile.cpp @@ -608,9 +608,9 @@ void CMissile::activate_physic_shell() CEntityAlive *entity_alive = smart_cast(H_Root()); if (entity_alive && entity_alive->character_physics_support()){ - Fvector parent_vel_; - entity_alive->character_physics_support()->movement()->GetCharacterVelocity(parent_vel_); - l_vel.add (parent_vel_); + Fvector parent_vel; + entity_alive->character_physics_support()->movement()->GetCharacterVelocity(parent_vel); + l_vel.add (parent_vel); } VERIFY (!m_pPhysicsShell); diff --git a/src/xr_3da/xrGame/NET_Queue.h b/src/xr_3da/xrGame/NET_Queue.h index 7b2e52e0..c23b7a70 100644 --- a/src/xr_3da/xrGame/NET_Queue.h +++ b/src/xr_3da/xrGame/NET_Queue.h @@ -47,8 +47,8 @@ class NET_Event } void export_ (NET_Packet& P) { - u16 ID_ = M_EVENT; - P.w_begin (ID_ ); + u16 ID = M_EVENT; + P.w_begin (ID ); P.w_u32 (timestamp ); P.w_u16 (type ); P.w_u16 (destination); diff --git a/src/xr_3da/xrGame/PHAICharacter.cpp b/src/xr_3da/xrGame/PHAICharacter.cpp index d704cc6d..b595e216 100644 --- a/src/xr_3da/xrGame/PHAICharacter.cpp +++ b/src/xr_3da/xrGame/PHAICharacter.cpp @@ -46,7 +46,7 @@ bool CPHAICharacter::TryPosition(Fvector pos,bool exact_state){ float rest = 0.f; float parts = disp_mag / disp_pstep ; - fsteps_num = (float) floor ( parts ); + fsteps_num = floor ( parts ); steps_num = iFloor ( parts ); if( steps_num > max_steps ) { diff --git a/src/xr_3da/xrGame/PHCharacter.h b/src/xr_3da/xrGame/PHCharacter.h index 0c60f65f..d9f0efab 100644 --- a/src/xr_3da/xrGame/PHCharacter.h +++ b/src/xr_3da/xrGame/PHCharacter.h @@ -10,7 +10,7 @@ class ICollisionDamageInfo; class CElevatorState; class CPHActorCharacter; class CPHAICharacter; -enum EEnvironment + static enum EEnvironment { peOnGround, peAtWall, diff --git a/src/xr_3da/xrGame/PHDebug.cpp b/src/xr_3da/xrGame/PHDebug.cpp index 94057fb4..2c7183e9 100644 --- a/src/xr_3da/xrGame/PHDebug.cpp +++ b/src/xr_3da/xrGame/PHDebug.cpp @@ -361,11 +361,11 @@ void DBG_PHAbstructRender() } if(dbg_ph_draw_mode!=dmCashed) { - PHABS_DBG_I i_,e_; - i_=dbg_draw_cashed.begin();e_=dbg_draw_cashed.end(); - for(;e_!=i_;++i_) + PHABS_DBG_I i,e; + i=dbg_draw_cashed.begin();e=dbg_draw_cashed.end(); + for(;e!=i;++i) { - (*i_)->render(); + (*i)->render(); } if(cash_draw_remove_timerender(); + (*i)->render(); } clear_vector(dbg_draw_simple); } diff --git a/src/xr_3da/xrGame/PHElement.cpp b/src/xr_3da/xrGame/PHElement.cpp index ca6b21e8..93c0c773 100644 --- a/src/xr_3da/xrGame/PHElement.cpp +++ b/src/xr_3da/xrGame/PHElement.cpp @@ -1169,12 +1169,12 @@ void CPHElement::add_Mass(const SBoneShape& shape,const Fmatrix& offset,const Fv l.sub(pos,mass_center); dMassSetCylinder(&m,1.f,2,shape.cylinder.m_radius,shape.cylinder.m_height); dMassAdjust(&m,mass); - dMatrix3 DMatx_; + 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_); + PHDynamicData::FMX33toDMX(m33,DMatx); + dMassRotate(&m,DMatx); dMassTranslate(&m,l.x,l.y,l.z); break; } diff --git a/src/xr_3da/xrGame/PHItemList.h b/src/xr_3da/xrGame/PHItemList.h index 584a3f22..c598ccca 100644 --- a/src/xr_3da/xrGame/PHItemList.h +++ b/src/xr_3da/xrGame/PHItemList.h @@ -32,7 +32,7 @@ template public: class iterator; - class iterator + typedef class iterator { T *my_ptr; diff --git a/src/xr_3da/xrGame/PHJoint.cpp b/src/xr_3da/xrGame/PHJoint.cpp index e0bcfc04..c99eda0c 100644 --- a/src/xr_3da/xrGame/PHJoint.cpp +++ b/src/xr_3da/xrGame/PHJoint.cpp @@ -1187,7 +1187,7 @@ void CPHJoint::GetAxisDirDynamic(int num,Fvector& axis) axis.set(result[0],result[1],result[2]); } -void CPHJoint::GetAnchorDynamic(Fvector& anchor_) +void CPHJoint::GetAnchorDynamic(Fvector& anchor) { dVector3 result; @@ -1202,7 +1202,7 @@ void CPHJoint::GetAnchorDynamic(Fvector& anchor_) break; case slider: R_ASSERT2(false,"position of slider joint is undefinite"); } - anchor_.set(result[0],result[1],result[2]); + anchor.set(result[0],result[1],result[2]); } CPHJoint::SPHAxis::SPHAxis(){ diff --git a/src/xr_3da/xrGame/PHMovementControl.cpp b/src/xr_3da/xrGame/PHMovementControl.cpp index 256a478b..7fa4e5b2 100644 --- a/src/xr_3da/xrGame/PHMovementControl.cpp +++ b/src/xr_3da/xrGame/PHMovementControl.cpp @@ -239,9 +239,9 @@ void CPHMovementControl::Calculate(const xr_vectorEPS) { - Fvector _d_ = GetPathDir(); - _d_.mul(1.f/m_path_distance); - SetPathDir(_d_); + Fvector _d = GetPathDir(); + _d.mul(1.f/m_path_distance); + SetPathDir(_d); } near_line=false; } diff --git a/src/xr_3da/xrGame/PHShellActivate.cpp b/src/xr_3da/xrGame/PHShellActivate.cpp index 59921123..3fcd994e 100644 --- a/src/xr_3da/xrGame/PHShellActivate.cpp +++ b/src/xr_3da/xrGame/PHShellActivate.cpp @@ -91,8 +91,8 @@ void CPHShell::Activate(const Fmatrix &transform,const Fvector& lin_vel,const Fv } { - JOINT_I i_=joints.begin(),e=joints.end(); - for(;i_!=e;++i_) (*i_)->Activate(); + JOINT_I i=joints.begin(),e=joints.end(); + for(;i!=e;++i) (*i)->Activate(); } if(PKinematics()) diff --git a/src/xr_3da/xrGame/PHSimpleCharacter.cpp b/src/xr_3da/xrGame/PHSimpleCharacter.cpp index fe067661..8d724ee2 100644 --- a/src/xr_3da/xrGame/PHSimpleCharacter.cpp +++ b/src/xr_3da/xrGame/PHSimpleCharacter.cpp @@ -805,13 +805,13 @@ bool CPHSimpleCharacter::ValidateWalkOnObject() } bool CPHSimpleCharacter::ValidateWalkOnMesh() { - Fvector AABB_,AABB_forbid,center,center_forbid,accel_add,accel; + Fvector AABB,AABB_forbid,center,center_forbid,accel_add,accel; - AABB_.x=m_radius; - AABB_.y=m_radius; - AABB_.z=m_radius; + AABB.x=m_radius; + AABB.y=m_radius; + AABB.z=m_radius; - AABB_forbid.set(AABB_); + AABB_forbid.set(AABB); //AABB_forbid.x*=0.7f; //AABB_forbid.z*=0.7f; AABB_forbid.y+=m_radius; @@ -824,7 +824,7 @@ bool CPHSimpleCharacter::ValidateWalkOnMesh() accel_add.mul(CHWON_ACCLEL_SHIFT/mag); accel.set(accel_add); accel.div(CHWON_ACCLEL_SHIFT); - AABB_.mul(CHWON_AABB_FACTOR); + AABB.mul(CHWON_AABB_FACTOR); GetPosition(center); center.add(accel_add); center_forbid.set(center); @@ -837,7 +837,7 @@ bool CPHSimpleCharacter::ValidateWalkOnMesh() query.set (center_forbid,center_forbid); query.grow (AABB_forbid ); tmp.set (center,center ); - tmp.grow (AABB_ ); + tmp.grow (AABB ); query.merge (tmp); query.get_CD (q_c,q_d); @@ -901,7 +901,7 @@ bool CPHSimpleCharacter::ValidateWalkOnMesh() 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(__aabb_tri(Point((float*)¢er),Point((float*)&AABB),vertices)){ if(test_sides(center,sd_dir,accel,obb,Res->id)) { #ifdef DEBUG diff --git a/src/xr_3da/xrGame/PHStaticGeomShell.cpp b/src/xr_3da/xrGame/PHStaticGeomShell.cpp index fa4bb7a1..0e9b5f26 100644 --- a/src/xr_3da/xrGame/PHStaticGeomShell.cpp +++ b/src/xr_3da/xrGame/PHStaticGeomShell.cpp @@ -7,8 +7,8 @@ #include "PHCollideValidator.h" void CPHStaticGeomShell::get_spatial_params() { - Fvector AABB_; - spatialParsFromDGeom (dSpacedGeometry(),spatial.sphere.P,AABB_,spatial.sphere.R); + Fvector AABB; + spatialParsFromDGeom (dSpacedGeometry(),spatial.sphere.P,AABB,spatial.sphere.R); } void CPHStaticGeomShell::PhDataUpdate (dReal step) diff --git a/src/xr_3da/xrGame/PhraseDialog.cpp b/src/xr_3da/xrGame/PhraseDialog.cpp index f7ec0a92..8511637f 100644 --- a/src/xr_3da/xrGame/PhraseDialog.cpp +++ b/src/xr_3da/xrGame/PhraseDialog.cpp @@ -124,7 +124,7 @@ bool CPhraseDialog::SayPhrase (DIALOG_SHARED_PTR& phrase_dialog, const shared_st if(psAI_Flags.test(aiDialogs)){ LPCSTR phrase_text = next_phrase_vertex->data()->GetText(); shared_str id = next_phrase_vertex->data()->GetID(); - Msg("----added phrase text [%s]phrase_id=[%s] id=[%s] to dialog [%s]",phrase_text, phrase_id.c_str(), id.c_str(), *phrase_dialog->m_DialogId.c_str()); + Msg("----added phrase text [%s]phrase_id=[%s] id=[%s] to dialog [%s]",phrase_text, phrase_id, id, *phrase_dialog->m_DialogId); } #endif } diff --git a/src/xr_3da/xrGame/PhysicsShellHolder.cpp b/src/xr_3da/xrGame/PhysicsShellHolder.cpp index e5b6af1a..67162dde 100644 --- a/src/xr_3da/xrGame/PhysicsShellHolder.cpp +++ b/src/xr_3da/xrGame/PhysicsShellHolder.cpp @@ -31,7 +31,7 @@ void CPhysicsShellHolder::net_Destroy() xr_delete (m_pPhysicsShell); } -enum EEnableState +static enum EEnableState { stEnable =0 , stDisable , diff --git a/src/xr_3da/xrGame/Torch.cpp b/src/xr_3da/xrGame/Torch.cpp index 7921173b..371294a7 100644 --- a/src/xr_3da/xrGame/Torch.cpp +++ b/src/xr_3da/xrGame/Torch.cpp @@ -260,7 +260,7 @@ BOOL CTorch::net_Spawn(CSE_Abstract* DC) SwitchNightVision (false); - m_delta_h = PI_DIV_2- (float) atan((range*0.5f)/_abs(TORCH_OFFSET.x)); + m_delta_h = PI_DIV_2-atan((range*0.5f)/_abs(TORCH_OFFSET.x)); return (TRUE); } diff --git a/src/xr_3da/xrGame/UIFrameRect.cpp b/src/xr_3da/xrGame/UIFrameRect.cpp index 00e0ddb0..b75cb824 100644 --- a/src/xr_3da/xrGame/UIFrameRect.cpp +++ b/src/xr_3da/xrGame/UIFrameRect.cpp @@ -98,8 +98,8 @@ void CUIFrameRect::UpdateSize() // ts.set (_bk.x,_bk.y); - rem_x = (float) fmod(size_top,ts.x); - rem_y = (float) fmod(size_left,ts.y); + rem_x = fmod(size_top,ts.x); + rem_y = fmod(size_left,ts.y); tile_x = iFloor(size_top/ts.x); tile_x=_max(tile_x, 0); tile_y = iFloor(size_left/ts.y); tile_y=_max(tile_y, 0); @@ -108,26 +108,26 @@ void CUIFrameRect::UpdateSize() // ts.set (_t.x,_t.y); - rem_x = (float) fmod(size_top,ts.x); + rem_x = fmod(size_top,ts.x); tile_x = iFloor(size_top/ts.x); tile_x=_max(tile_x, 0); frame[fmT].SetPos (wnd_pos.x+_lt.x,wnd_pos.y); frame[fmT].SetTile (tile_x,1,rem_x,0); ts.set (_b.x,_b.y); - rem_x = (float) fmod(size_bottom,ts.x); + rem_x = fmod(size_bottom,ts.x); tile_x = iFloor(size_bottom/ts.x); tile_x=_max(tile_x, 0); frame[fmB].SetPos (wnd_pos.x+_lb.x,wnd_pos.y+m_wndSize.y-ts.y); frame[fmB].SetTile (tile_x,1,rem_x,0); ts.set (_l.x,_l.y); - rem_y = (float) fmod(size_left,ts.y); + rem_y = fmod(size_left,ts.y); tile_y = iFloor(size_left/ts.y); tile_y=_max(tile_y, 0); frame[fmL].SetPos (wnd_pos.x, wnd_pos.y+_lt.y); frame[fmL].SetTile (1,tile_y,0,rem_y); ts.set (_r.x,_r.y); - rem_y = (float) fmod(size_right,ts.y); + rem_y = fmod(size_right,ts.y); tile_y = iFloor(size_right/ts.y); tile_y=_max(tile_y, 0); frame[fmR].SetPos (wnd_pos.x+m_wndSize.x-ts.x,wnd_pos.y+_rt.y); frame[fmR].SetTile (1,tile_y,0,rem_y); diff --git a/src/xr_3da/xrGame/WeaponFire.cpp b/src/xr_3da/xrGame/WeaponFire.cpp index 5583fab5..14281318 100644 --- a/src/xr_3da/xrGame/WeaponFire.cpp +++ b/src/xr_3da/xrGame/WeaponFire.cpp @@ -37,7 +37,7 @@ void random_dir(Fvector& tgt_dir, const Fvector& src_dir, float dispersion) float sigma = dispersion/3.f; float alpha = clampr (_nrand(sigma),-dispersion,dispersion); float theta = Random.randF (0,PI); - float r = (float) tan(alpha); + float r = tan (alpha); Fvector U,V,T; Fvector::generate_orthonormal_basis (src_dir,U,V); U.mul (r*_sin(theta)); diff --git a/src/xr_3da/xrGame/actor_statistic_mgr.cpp b/src/xr_3da/xrGame/actor_statistic_mgr.cpp index cd437dc0..9895a873 100644 --- a/src/xr_3da/xrGame/actor_statistic_mgr.cpp +++ b/src/xr_3da/xrGame/actor_statistic_mgr.cpp @@ -77,17 +77,17 @@ void SStatSectionData::load(IReader &stream) load_data (key, stream); }; -SStatDetailBData& SStatSectionData::GetData (const shared_str& key_) +SStatDetailBData& SStatSectionData::GetData (const shared_str& key) { vStatDetailData::iterator it = data.begin(); vStatDetailData::iterator it_e = data.end(); for(;it!=it_e;++it){ - if((*it).key == key_) + if((*it).key == key) return *it; } data.resize (data.size()+1); - data.back ().key = key_; + data.back ().key = key; data.back ().int_count = 0; data.back ().int_points = 0; return data.back (); diff --git a/src/xr_3da/xrGame/agent_enemy_manager.cpp b/src/xr_3da/xrGame/agent_enemy_manager.cpp index 602763e9..df4a49f7 100644 --- a/src/xr_3da/xrGame/agent_enemy_manager.cpp +++ b/src/xr_3da/xrGame/agent_enemy_manager.cpp @@ -233,9 +233,9 @@ void CAgentEnemyManager::assign_enemies () (*I).m_probability *= 1.f - best; // recovering sort order - for (u32 i_=0, n = m_enemies.size() - 1; i_processed()) + if ((*I)->processed()) continue; - float best = (*I_)->object().Position().distance_to(m_enemies[(*I_)->selected_enemy()].m_object->Position()); + float best = (*I)->object().Position().distance_to(m_enemies[(*I)->selected_enemy()].m_object->Position()); bool found = false; - xr_vector::const_iterator i = (*I_)->enemies().begin(); - xr_vector::const_iterator e = (*I_)->enemies().end(); + xr_vector::const_iterator i = (*I)->enemies().begin(); + xr_vector::const_iterator e = (*I)->enemies().end(); for ( ; i != e; ++i) { - if ((*I_)->selected_enemy() == *i) + if ((*I)->selected_enemy() == *i) continue; - float my_distance = (*I_)->object().Position().distance_to(m_enemies[*i].m_object->Position()); + float my_distance = (*I)->object().Position().distance_to(m_enemies[*i].m_object->Position()); if (my_distance < best) { // check if we can exchange enemies squad_mask_type J = m_enemies[*i].m_distribute_mask.get(), K; @@ -301,7 +301,7 @@ void CAgentEnemyManager::permutate_enemies () for ( ; J; J &= J - 1) { K = (J & (J - 1)) ^ J; CAgentMemberManager::iterator j = object().member().member(K); - xr_vector::iterator ii = std::find((*j)->enemies().begin(),(*j)->enemies().end(),(*I_)->selected_enemy()); + xr_vector::iterator ii = std::find((*j)->enemies().begin(),(*j)->enemies().end(),(*I)->selected_enemy()); // check if member can my current enemy if (ii == (*j)->enemies().end()) continue; @@ -312,12 +312,12 @@ void CAgentEnemyManager::permutate_enemies () continue; // check if our effectiveness is near the same - float my_to_his = evaluate(&(*I_)->object(),m_enemies[(*j)->selected_enemy()].m_object); - float his_to_my = evaluate(&(*j)->object(),m_enemies[(*I_)->selected_enemy()].m_object); - if (!fsimilar(my_to_his,(*j)->probability()) || !fsimilar(his_to_my,(*I_)->probability())) + float my_to_his = evaluate(&(*I)->object(),m_enemies[(*j)->selected_enemy()].m_object); + float his_to_my = evaluate(&(*j)->object(),m_enemies[(*I)->selected_enemy()].m_object); + if (!fsimilar(my_to_his,(*j)->probability()) || !fsimilar(his_to_my,(*I)->probability())) continue; - exchange_enemies (**I_,**j); + exchange_enemies (**I,**j); found = true; best = my_distance; @@ -330,7 +330,7 @@ void CAgentEnemyManager::permutate_enemies () } if (!found) { - (*I_)->processed (true); + (*I)->processed (true); continue; } @@ -341,14 +341,14 @@ void CAgentEnemyManager::permutate_enemies () VERIFY (!m_enemies.empty()); if (!m_only_wounded_left) { - CAgentMemberManager::iterator I_ = object().member().combat_members().begin(); - CAgentMemberManager::iterator E_ = object().member().combat_members().end(); - for ( ; I_ != E_; ++I_) { + CAgentMemberManager::iterator I = object().member().combat_members().begin(); + CAgentMemberManager::iterator E = object().member().combat_members().end(); + for ( ; I != E; ++I) { ENEMIES::iterator i = m_enemies.begin(); ENEMIES::iterator e = m_enemies.end(); for ( ; i != e; ++i) - if ((*I_)->object().memory().visual().visible_now((*i).m_object)) - (*i).m_distribute_mask.assign((*i).m_distribute_mask.get() | object().member().mask(&(*I_)->object())); + if ((*I)->object().memory().visual().visible_now((*i).m_object)) + (*i).m_distribute_mask.assign((*i).m_distribute_mask.get() | object().member().mask(&(*I)->object())); } } } @@ -475,12 +475,12 @@ void CAgentEnemyManager::assign_wounded () J &= (assigned ^ squad_mask_type(-1)); for ( ; J; J &= J - 1) { squad_mask_type K = (J & (J - 1)) ^ J; - CAgentMemberManager::iterator i_ = object().member().member(K); - float distance_sqr = (*i_)->object().Position().distance_to_sqr((*I).m_object->Position()); + CAgentMemberManager::iterator i = object().member().member(K); + float distance_sqr = (*i)->object().Position().distance_to_sqr((*I).m_object->Position()); if (distance_sqr < best_distance_sqr) { best_distance_sqr = distance_sqr; enemy = &*I; - processor = &(*i_)->object(); + processor = &(*i)->object(); } } } diff --git a/src/xr_3da/xrGame/agent_location_manager.cpp b/src/xr_3da/xrGame/agent_location_manager.cpp index 56d44895..ae0d8f85 100644 --- a/src/xr_3da/xrGame/agent_location_manager.cpp +++ b/src/xr_3da/xrGame/agent_location_manager.cpp @@ -90,10 +90,10 @@ bool CAgentLocationManager::suitable (CAI_Stalker *object, const CCoverPoint *lo } if (use_enemy_info) { - CAgentEnemyManager::ENEMIES::const_iterator I_ = this->object().enemy().enemies().begin(); - CAgentEnemyManager::ENEMIES::const_iterator E_ = this->object().enemy().enemies().end(); - for ( ; I_ != E_; ++I_) - if ((*I_).m_enemy_position.distance_to_sqr(location->position()) < _sqr(MIN_SUITABLE_ENEMY_DISTANCE)) + CAgentEnemyManager::ENEMIES::const_iterator I = this->object().enemy().enemies().begin(); + CAgentEnemyManager::ENEMIES::const_iterator E = this->object().enemy().enemies().end(); + for ( ; I != E; ++I) + if ((*I).m_enemy_position.distance_to_sqr(location->position()) < _sqr(MIN_SUITABLE_ENEMY_DISTANCE)) return (false); } diff --git a/src/xr_3da/xrGame/ai/crow/ai_crow.cpp b/src/xr_3da/xrGame/ai/crow/ai_crow.cpp index dff64649..6b66d53d 100644 --- a/src/xr_3da/xrGame/ai/crow/ai_crow.cpp +++ b/src/xr_3da/xrGame/ai/crow/ai_crow.cpp @@ -20,8 +20,8 @@ void CAI_Crow::SAnim::Load (CKinematicsAnimated* visual, LPCSTR prefix) for (int i=0; (iID_Cycle_Safe(sh_anim); - if (M_) m_Animations.push_back(M_); + const MotionID &M = visual->ID_Cycle_Safe(sh_anim); + if (M) m_Animations.push_back(M); } R_ASSERT (m_Animations.size()); } diff --git a/src/xr_3da/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h b/src/xr_3da/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h index 1b5f1579..6641c8a1 100644 --- a/src/xr_3da/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h +++ b/src/xr_3da/xrGame/ai/monsters/bloodsucker/bloodsucker_vampire_inline.h @@ -106,8 +106,8 @@ bool CStateBloodsuckerVampireAbstract::check_start_conditions() if (object->berserk_always) return false; // - const CEntityAlive *enemy_ = object->EnemyMan.get_enemy(); - if (enemy_->CLS_ID != CLSID_OBJECT_ACTOR) return false; + const CEntityAlive *enemy = object->EnemyMan.get_enemy(); + if (enemy->CLS_ID != CLSID_OBJECT_ACTOR) return false; if (!object->EnemyMan.see_enemy_now()) return false; if (object->CControlledActor::is_controlling()) return false; diff --git a/src/xr_3da/xrGame/ai/monsters/burer/burer.cpp b/src/xr_3da/xrGame/ai/monsters/burer/burer.cpp index 480ad558..56c06f63 100644 --- a/src/xr_3da/xrGame/ai/monsters/burer/burer.cpp +++ b/src/xr_3da/xrGame/ai/monsters/burer/burer.cpp @@ -260,10 +260,10 @@ void CBurer::UpdateGraviObject() CPhysicsShellHolder *obj = smart_cast(m_nearest[i]); if (!obj || !obj->m_pPhysicsShell) continue; - Fvector dir_; - dir_.sub(obj->Position(), m_gravi_object.cur_pos); - dir_.normalize(); - obj->m_pPhysicsShell->applyImpulse(dir_,m_gravi_impulse_to_objects * obj->m_pPhysicsShell->getMass()); + Fvector dir; + dir.sub(obj->Position(), m_gravi_object.cur_pos); + dir.normalize(); + obj->m_pPhysicsShell->applyImpulse(dir,m_gravi_impulse_to_objects * obj->m_pPhysicsShell->getMass()); } // diff --git a/src/xr_3da/xrGame/ai/monsters/control_animation.cpp b/src/xr_3da/xrGame/ai/monsters/control_animation.cpp index a1ad53b4..bf7e5349 100644 --- a/src/xr_3da/xrGame/ai/monsters/control_animation.cpp +++ b/src/xr_3da/xrGame/ai/monsters/control_animation.cpp @@ -105,7 +105,7 @@ void CControlAnimation::play_part(SAnimationPart &part, PlayCallback callback) // initialize synchronization of prev and current animation float pos = -1.f; if (part.blend && !part.blend->stop_at_end) - pos = (float) fmod(part.blend->timeCurrent,part.blend->timeTotal)/part.blend->timeTotal; + pos = fmod(part.blend->timeCurrent,part.blend->timeTotal)/part.blend->timeTotal; #ifdef DEBUG //CKinematicsAnimated * K = m_object->Visual()->dcast_PKinematicsAnimated(); //Msg ("%6d Playing animation : %s , %s , Object %s",Device.dwTimeGlobal, K->LL_MotionDefName_dbg(part.motion).first,K->LL_MotionDefName_dbg(part.motion).second, *(m_object->cName())); diff --git a/src/xr_3da/xrGame/ai/monsters/control_jump.cpp b/src/xr_3da/xrGame/ai/monsters/control_jump.cpp index 9ef0b4eb..8ac3a465 100644 --- a/src/xr_3da/xrGame/ai/monsters/control_jump.cpp +++ b/src/xr_3da/xrGame/ai/monsters/control_jump.cpp @@ -453,11 +453,11 @@ bool CControlJump::can_jump(CObject *target) float time = m_man->animation().motion_time(m_data.state_prepare_in_move.motion, m_object->Visual()); // set acceleration and velocity SVelocityParam &vel = m_object->move().get_velocity(m_data.state_prepare_in_move.velocity_mask); - float dist_ = time * vel.velocity.linear; + float dist = time * vel.velocity.linear; // check nodes in direction Fvector target_point; - target_point.mad(m_object->Position(), m_object->Direction(), dist_); + target_point.mad(m_object->Position(), m_object->Direction(), dist); if (m_man->path_builder().accessible(target_point)) { // ? diff --git a/src/xr_3da/xrGame/ai/monsters/monster_corpse_manager.cpp b/src/xr_3da/xrGame/ai/monsters/monster_corpse_manager.cpp index ea696c77..1aaf6c4a 100644 --- a/src/xr_3da/xrGame/ai/monsters/monster_corpse_manager.cpp +++ b/src/xr_3da/xrGame/ai/monsters/monster_corpse_manager.cpp @@ -38,11 +38,11 @@ void CMonsterCorpseManager::update() } } -void CMonsterCorpseManager::force_corpse(const CEntityAlive *corpse_) +void CMonsterCorpseManager::force_corpse(const CEntityAlive *corpse) { - this->corpse = corpse_; - position = corpse_->Position(); - vertex = corpse_->ai_location().level_vertex_id(); + this->corpse = corpse; + position = corpse->Position(); + vertex = corpse->ai_location().level_vertex_id(); time_last_seen = Device.dwTimeGlobal; forced = true; diff --git a/src/xr_3da/xrGame/ai/monsters/monster_enemy_manager.cpp b/src/xr_3da/xrGame/ai/monsters/monster_enemy_manager.cpp index 4a658a66..293ec6cb 100644 --- a/src/xr_3da/xrGame/ai/monsters/monster_enemy_manager.cpp +++ b/src/xr_3da/xrGame/ai/monsters/monster_enemy_manager.cpp @@ -125,11 +125,11 @@ void CMonsterEnemyManager::update() -void CMonsterEnemyManager::force_enemy (const CEntityAlive *enemy_) +void CMonsterEnemyManager::force_enemy (const CEntityAlive *enemy) { - this->enemy = enemy_; - position = enemy_->Position(); - vertex = enemy_->ai_location().level_vertex_id(); + this->enemy = enemy; + position = enemy->Position(); + vertex = enemy->ai_location().level_vertex_id(); time_last_seen = time(); forced = true; @@ -176,9 +176,9 @@ void CMonsterEnemyManager::reinit() } -void CMonsterEnemyManager::add_enemy(const CEntityAlive *enemy_) +void CMonsterEnemyManager::add_enemy(const CEntityAlive *enemy) { - monster->EnemyMemory.add_enemy(enemy_); + monster->EnemyMemory.add_enemy(enemy); } diff --git a/src/xr_3da/xrGame/ai/monsters/monster_sound_memory.h b/src/xr_3da/xrGame/ai/monsters/monster_sound_memory.h index 5c3bf0b7..bea0f397 100644 --- a/src/xr_3da/xrGame/ai/monsters/monster_sound_memory.h +++ b/src/xr_3da/xrGame/ai/monsters/monster_sound_memory.h @@ -53,8 +53,8 @@ typedef struct tagSoundElement bool operator < (const tagSoundElement &s) const { return (value < s.value); } - IC void SetConvert(const CObject* who_, int eType, const Fvector &position_, float power_, TTime time_) { - this->who = who_; type = ConvertSoundType((ESoundTypes)eType); this->position = position_; this->power = power_; this->time = time_; + IC void SetConvert(const CObject* who, int eType, const Fvector &position, float power, TTime time) { + this->who = who; type = ConvertSoundType((ESoundTypes)eType); this->position = position; this->power = power; this->time = time; } TSoundDangerValue ConvertSoundType(ESoundTypes stype); diff --git a/src/xr_3da/xrGame/ai/monsters/pseudodog/psy_dog_aura.cpp b/src/xr_3da/xrGame/ai/monsters/pseudodog/psy_dog_aura.cpp index ca77e545..4490c613 100644 --- a/src/xr_3da/xrGame/ai/monsters/pseudodog/psy_dog_aura.cpp +++ b/src/xr_3da/xrGame/ai/monsters/pseudodog/psy_dog_aura.cpp @@ -77,11 +77,11 @@ void CPsyDogAura::update_schedule() if ((*it)->EnemyMan.get_enemy() == m_actor) m_time_phantom_saw_actor = time(); else { - ENEMIES_MAP::const_iterator I_ = (*it)->EnemyMemory.get_memory().begin(); - ENEMIES_MAP::const_iterator E_ = (*it)->EnemyMemory.get_memory().end(); - for (; I_ != E_; ++I_) { - if (I_->first == m_actor) { - m_time_phantom_saw_actor = I_->second.time; + ENEMIES_MAP::const_iterator I = (*it)->EnemyMemory.get_memory().begin(); + ENEMIES_MAP::const_iterator E = (*it)->EnemyMemory.get_memory().end(); + for (; I != E; ++I) { + if (I->first == m_actor) { + m_time_phantom_saw_actor = I->second.time; break; } } diff --git a/src/xr_3da/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide_inline.h b/src/xr_3da/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide_inline.h index c322bc72..55ba7c26 100644 --- a/src/xr_3da/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide_inline.h +++ b/src/xr_3da/xrGame/ai/monsters/pseudodog/psy_dog_state_psy_attack_hide_inline.h @@ -54,10 +54,10 @@ void CStatePsyDogHideAbstract::select_target_point() target.node = point->level_vertex_id (); target.position = point->position (); } else { - const CCoverPoint *point_ = object->CoverMan->find_cover(object->Position(),10.f,30.f); - if (point_ && (object->Position().distance_to(point_->position()) > 2.f)) { - target.node = point_->level_vertex_id (); - target.position = point_->position (); + const CCoverPoint *point = object->CoverMan->find_cover(object->Position(),10.f,30.f); + if (point && (object->Position().distance_to(point->position()) > 2.f)) { + target.node = point->level_vertex_id (); + target.position = point->position (); } else { target.node = 0; target.position = ai().level_graph().vertex_position(target.node); diff --git a/src/xr_3da/xrGame/ai/monsters/snork/snork.cpp b/src/xr_3da/xrGame/ai/monsters/snork/snork.cpp index 00d38a35..60aa94db 100644 --- a/src/xr_3da/xrGame/ai/monsters/snork/snork.cpp +++ b/src/xr_3da/xrGame/ai/monsters/snork/snork.cpp @@ -184,7 +184,7 @@ bool CSnork::trace_geometry(const Fvector &d, float &range) range = trace (d); if (range > TRACE_RANGE) return false; - float angle = (float) asin(1.f / range); + float angle = asin(1.f / range); // trace center ray dir = d; diff --git a/src/xr_3da/xrGame/ai/monsters/states/monster_state_eat_inline.h b/src/xr_3da/xrGame/ai/monsters/states/monster_state_eat_inline.h index b13f7a45..d1e21c8a 100644 --- a/src/xr_3da/xrGame/ai/monsters/states/monster_state_eat_inline.h +++ b/src/xr_3da/xrGame/ai/monsters/states/monster_state_eat_inline.h @@ -127,10 +127,10 @@ void CStateMonsterEatAbstract::setup_substates() // Fvector nearest_bone_pos; - const CEntityAlive *corpse_ = object->CorpseMan.get_corpse(); - if ((corpse_->m_pPhysicsShell == NULL) || (!corpse_->m_pPhysicsShell->isActive())) { - nearest_bone_pos = corpse_->Position(); - } else nearest_bone_pos = object->character_physics_support()->movement()->PHCaptureGetNearestElemPos(corpse_); + const CEntityAlive *corpse = object->CorpseMan.get_corpse(); + if ((corpse->m_pPhysicsShell == NULL) || (!corpse->m_pPhysicsShell->isActive())) { + nearest_bone_pos = corpse->Position(); + } else nearest_bone_pos = object->character_physics_support()->movement()->PHCaptureGetNearestElemPos(corpse); #ifdef _DEBUG DBG().level_info(this).clear (); @@ -204,10 +204,10 @@ void CStateMonsterEatAbstract::setup_substates() // Fvector nearest_bone_pos; - const CEntityAlive *corpse_ = object->CorpseMan.get_corpse(); - if ((corpse_->m_pPhysicsShell == NULL) || (!corpse_->m_pPhysicsShell->isActive())) { - nearest_bone_pos = corpse_->Position(); - } else nearest_bone_pos = object->character_physics_support()->movement()->PHCaptureGetNearestElemPos(corpse_); + const CEntityAlive *corpse = object->CorpseMan.get_corpse(); + if ((corpse->m_pPhysicsShell == NULL) || (!corpse->m_pPhysicsShell->isActive())) { + nearest_bone_pos = corpse->Position(); + } else nearest_bone_pos = object->character_physics_support()->movement()->PHCaptureGetNearestElemPos(corpse); SStateDataMoveToPoint data; data.point = nearest_bone_pos; diff --git a/src/xr_3da/xrGame/ai/monsters/states/monster_state_rest_fun_inline.h b/src/xr_3da/xrGame/ai/monsters/states/monster_state_rest_fun_inline.h index 33cf4a76..654c439f 100644 --- a/src/xr_3da/xrGame/ai/monsters/states/monster_state_rest_fun_inline.h +++ b/src/xr_3da/xrGame/ai/monsters/states/monster_state_rest_fun_inline.h @@ -55,17 +55,17 @@ void CStateMonsterRestFunAbstract::execute() CPhysicsShellHolder *target = smart_cast (corpse); if (target && target->m_pPhysicsShell) { - Fvector dir_; - dir_.add (Fvector().sub(target->Position(), object->Position()), object->Direction()); + Fvector dir; + dir.add (Fvector().sub(target->Position(), object->Position()), object->Direction()); float h,p; - dir_.getHP (h,p); - dir_.setHP (h, p + 5 * PI / 180); - dir_.normalize (); + dir.getHP (h,p); + dir.setHP (h, p + 5 * PI / 180); + dir.normalize (); // for (u32 i=0; im_pPhysicsShell->Elements().size();i++) { - target->m_pPhysicsShell->Elements()[i]->applyImpulse(dir_, IMPULSE_TO_CORPSE * target->m_pPhysicsShell->getMass() / target->m_pPhysicsShell->Elements().size()); + target->m_pPhysicsShell->Elements()[i]->applyImpulse(dir, IMPULSE_TO_CORPSE * target->m_pPhysicsShell->getMass() / target->m_pPhysicsShell->Elements().size()); } time_last_hit = Device.dwTimeGlobal; diff --git a/src/xr_3da/xrGame/ai/stalker/ai_stalker_debug.cpp b/src/xr_3da/xrGame/ai/stalker/ai_stalker_debug.cpp index c8acfc2d..ee9141fb 100644 --- a/src/xr_3da/xrGame/ai/stalker/ai_stalker_debug.cpp +++ b/src/xr_3da/xrGame/ai/stalker/ai_stalker_debug.cpp @@ -479,13 +479,13 @@ void CAI_Stalker::OnHUDDraw (CCustomHUD *hud) if (inventory().ActiveItem()) { HUD().Font().pFontStat->OutNext ("%s%sactive item",indent,indent); HUD().Font().pFontStat->OutNext ("%s%s%sobject : %s",indent,indent,indent,inventory().ActiveItem() ? *inventory().ActiveItem()->object().cName() : ""); - CWeapon *weapon_ = smart_cast(inventory().ActiveItem()); - if (weapon_) { - HUD().Font().pFontStat->OutNext("%s%s%sstrapped : %s",indent,indent,indent,weapon_strapped(weapon_) ? "+" : "-"); - HUD().Font().pFontStat->OutNext("%s%s%sunstrapped : %s",indent,indent,indent,weapon_unstrapped(weapon_) ? "+" : "-"); - HUD().Font().pFontStat->OutNext("%s%s%sammo : %d",indent,indent,indent,weapon_->GetAmmoElapsed()); - HUD().Font().pFontStat->OutNext("%s%s%smagazine : %d",indent,indent,indent,weapon_->GetAmmoMagSize()); - HUD().Font().pFontStat->OutNext("%s%s%stotal ammo : %d",indent,indent,indent,weapon_->GetAmmoCurrent()); + CWeapon *weapon = smart_cast(inventory().ActiveItem()); + if (weapon) { + HUD().Font().pFontStat->OutNext("%s%s%sstrapped : %s",indent,indent,indent,weapon_strapped(weapon) ? "+" : "-"); + HUD().Font().pFontStat->OutNext("%s%s%sunstrapped : %s",indent,indent,indent,weapon_unstrapped(weapon) ? "+" : "-"); + HUD().Font().pFontStat->OutNext("%s%s%sammo : %d",indent,indent,indent,weapon->GetAmmoElapsed()); + HUD().Font().pFontStat->OutNext("%s%s%smagazine : %d",indent,indent,indent,weapon->GetAmmoMagSize()); + HUD().Font().pFontStat->OutNext("%s%s%stotal ammo : %d",indent,indent,indent,weapon->GetAmmoCurrent()); } } @@ -1058,8 +1058,8 @@ void CAI_Stalker::dbg_draw_visibility_rays () const CEntityAlive *enemy = memory().enemy().selected(); if (enemy) { if (memory().visual().visible_now(enemy)) { - collide::rq_results rq_storage_; - draw_visiblity_rays (this,enemy,rq_storage_); + collide::rq_results rq_storage; + draw_visiblity_rays (this,enemy,rq_storage); } } } diff --git a/src/xr_3da/xrGame/ai/stalker/ai_stalker_events.cpp b/src/xr_3da/xrGame/ai/stalker/ai_stalker_events.cpp index d794d8db..aaffcb64 100644 --- a/src/xr_3da/xrGame/ai/stalker/ai_stalker_events.cpp +++ b/src/xr_3da/xrGame/ai/stalker/ai_stalker_events.cpp @@ -54,10 +54,10 @@ void CAI_Stalker::OnEvent (NET_Packet& P, u16 type) } else { // DropItemSendMessage(O); - NET_Packet P_; - u_EventGen (P_,GE_OWNERSHIP_REJECT,ID()); - P_.w_u16 (u16(O->ID())); - u_EventSend (P_); + NET_Packet P; + u_EventGen (P,GE_OWNERSHIP_REJECT,ID()); + P.w_u16 (u16(O->ID())); + u_EventSend (P); #ifndef SILENCE Msg("TAKE - can't take! - Dropping for valid server information %s (%d)", *O->cName(),O->ID()); diff --git a/src/xr_3da/xrGame/ai/stalker/ai_stalker_fire.cpp b/src/xr_3da/xrGame/ai/stalker/ai_stalker_fire.cpp index 3ec4d8fe..f0c875c7 100644 --- a/src/xr_3da/xrGame/ai/stalker/ai_stalker_fire.cpp +++ b/src/xr_3da/xrGame/ai/stalker/ai_stalker_fire.cpp @@ -545,7 +545,7 @@ IC BOOL ray_query_callback (collide::rq_result& result, LPVOID params) return (false); } -void CAI_Stalker::can_kill_entity (const Fvector &position, const Fvector &direction, float distance, collide::rq_results& rq_storage_) +void CAI_Stalker::can_kill_entity (const Fvector &position, const Fvector &direction, float distance, collide::rq_results& rq_storage) { VERIFY (!fis_zero(direction.square_magnitude())); @@ -554,7 +554,7 @@ void CAI_Stalker::can_kill_entity (const Fvector &position, const Fvector &dire ray_query_param params(this,memory().visual().transparency_threshold(),distance); - Level().ObjectSpace.RayQuery (rq_storage_,ray_defs,ray_query_callback,¶ms,NULL,this); + Level().ObjectSpace.RayQuery (rq_storage,ray_defs,ray_query_callback,¶ms,NULL,this); m_can_kill_enemy = m_can_kill_enemy || params.m_can_kill_enemy; m_can_kill_member = m_can_kill_member || params.m_can_kill_member; m_pick_distance = _max(m_pick_distance,params.m_pick_distance); diff --git a/src/xr_3da/xrGame/ai/trader/ai_trader.cpp b/src/xr_3da/xrGame/ai/trader/ai_trader.cpp index de8138b1..e3325277 100644 --- a/src/xr_3da/xrGame/ai/trader/ai_trader.cpp +++ b/src/xr_3da/xrGame/ai/trader/ai_trader.cpp @@ -180,10 +180,10 @@ void CAI_Trader::OnEvent (NET_Packet& P, u16 type) inventory().Take(smart_cast(Obj), false, false); }else { - NET_Packet P_; - u_EventGen (P_,GE_OWNERSHIP_REJECT,ID()); - P_.w_u16 (u16(Obj->ID())); - u_EventSend (P_); + NET_Packet P; + u_EventGen (P,GE_OWNERSHIP_REJECT,ID()); + P.w_u16 (u16(Obj->ID())); + u_EventSend (P); } break; case GE_TRADE_SELL: diff --git a/src/xr_3da/xrGame/alife_anomalous_zone.cpp b/src/xr_3da/xrGame/alife_anomalous_zone.cpp index f609c221..222b47b4 100644 --- a/src/xr_3da/xrGame/alife_anomalous_zone.cpp +++ b/src/xr_3da/xrGame/alife_anomalous_zone.cpp @@ -104,11 +104,11 @@ void CSE_ALifeAnomalousZone::spawn_artefacts () ai().alife().spawns().assign_artefact_position(this,i); Fvector t = i->o_Position ; - u32 p_ = i->m_tNodeID ; + u32 p = i->m_tNodeID ; float q = i->m_fDistance ; alife().graph().change(i,m_tGraphID,i->m_tGraphID); i->o_Position = t; - i->m_tNodeID = p_; + i->m_tNodeID = p; i->m_fDistance = q; CSE_ALifeItemArtefact *l_tpALifeItemArtefact = smart_cast(i); diff --git a/src/xr_3da/xrGame/alife_combat_manager.cpp b/src/xr_3da/xrGame/alife_combat_manager.cpp index fe43cbff..6522534e 100644 --- a/src/xr_3da/xrGame/alife_combat_manager.cpp +++ b/src/xr_3da/xrGame/alife_combat_manager.cpp @@ -38,7 +38,9 @@ void print_time(LPCSTR S, _TIME_ID tTimeID) } /**/ -CALifeCombatManager::CALifeCombatManager (xrServer *server, LPCSTR section) { +CALifeCombatManager::CALifeCombatManager (xrServer *server, LPCSTR section) : + CALifeSimulatorBase (server,section) +{ /** seed (u32(CPU::QPC() & 0xffffffff)); m_dwMaxCombatIterationCount = pSettings->r_u32 (section,"max_combat_iteration_count"); diff --git a/src/xr_3da/xrGame/alife_communication_manager.cpp b/src/xr_3da/xrGame/alife_communication_manager.cpp index c2ef3ae3..0e5bd03c 100644 --- a/src/xr_3da/xrGame/alife_communication_manager.cpp +++ b/src/xr_3da/xrGame/alife_communication_manager.cpp @@ -78,7 +78,9 @@ class CSortByOwnerPredicate { }; /**/ -CALifeCommunicationManager::CALifeCommunicationManager (xrServer *server, LPCSTR section) { +CALifeCommunicationManager::CALifeCommunicationManager (xrServer *server, LPCSTR section) : + CALifeSimulatorBase (server,section) +{ // m_tpItems1.reserve (MAX_STACK_DEPTH); // m_tpItems2.reserve (MAX_STACK_DEPTH); // m_tpBlockedItems1.reserve (MAX_STACK_DEPTH); diff --git a/src/xr_3da/xrGame/alife_graph_registry.cpp b/src/xr_3da/xrGame/alife_graph_registry.cpp index 82a06075..9e15d796 100644 --- a/src/xr_3da/xrGame/alife_graph_registry.cpp +++ b/src/xr_3da/xrGame/alife_graph_registry.cpp @@ -124,10 +124,10 @@ void CALifeGraphRegistry::detach (CSE_Abstract &object, CSE_ALifeInventoryItem * if (alife_query) add (smart_cast(item),game_vertex_id); else { - CSE_ALifeDynamicObject *object_ = smart_cast(item); - VERIFY (object_); - object_->m_tGraphID = game_vertex_id; - level().add (object_); + CSE_ALifeDynamicObject *object = smart_cast(item); + VERIFY (object); + object->m_tGraphID = game_vertex_id; + level().add (object); } CSE_ALifeDynamicObject *dynamic_object = smart_cast(&object); diff --git a/src/xr_3da/xrGame/alife_interaction_manager.cpp b/src/xr_3da/xrGame/alife_interaction_manager.cpp index aac7d0b1..27e92820 100644 --- a/src/xr_3da/xrGame/alife_interaction_manager.cpp +++ b/src/xr_3da/xrGame/alife_interaction_manager.cpp @@ -18,7 +18,9 @@ using namespace ALife; /**/ CALifeInteractionManager::CALifeInteractionManager (xrServer*server, LPCSTR section) : CALifeCombatManager (server,section), - CALifeCommunicationManager (server,section) { + CALifeCommunicationManager (server,section), + CALifeSimulatorBase (server,section) +{ /** m_inventory_slot_count = pSettings->r_u32("inventory","slots"); m_temp_weapons.resize (m_inventory_slot_count); diff --git a/src/xr_3da/xrGame/alife_monster_movement_manager_script.cpp b/src/xr_3da/xrGame/alife_monster_movement_manager_script.cpp index 649e1a01..3ed3045d 100644 --- a/src/xr_3da/xrGame/alife_monster_movement_manager_script.cpp +++ b/src/xr_3da/xrGame/alife_monster_movement_manager_script.cpp @@ -13,14 +13,14 @@ using namespace luabind; -CALifeMonsterDetailPathManager *get_detail(const CALifeMonsterMovementManager *self_) +CALifeMonsterDetailPathManager *get_detail(const CALifeMonsterMovementManager *self) { - return (&self_->detail()); + return (&self->detail()); } -CALifeMonsterPatrolPathManager *get_patrol(const CALifeMonsterMovementManager *self_) +CALifeMonsterPatrolPathManager *get_patrol(const CALifeMonsterMovementManager *self) { - return (&self_->patrol()); + return (&self->patrol()); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/alife_monster_patrol_path_manager_script.cpp b/src/xr_3da/xrGame/alife_monster_patrol_path_manager_script.cpp index f66bb5ba..ea0f8083 100644 --- a/src/xr_3da/xrGame/alife_monster_patrol_path_manager_script.cpp +++ b/src/xr_3da/xrGame/alife_monster_patrol_path_manager_script.cpp @@ -11,10 +11,10 @@ using namespace luabind; -Fvector CALifeMonsterPatrolPathManager__target_position (CALifeMonsterPatrolPathManager *self_) +Fvector CALifeMonsterPatrolPathManager__target_position (CALifeMonsterPatrolPathManager *self) { - THROW (self_); - return (self_->target_position()); + THROW (self); + return (self->target_position()); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/alife_simulator_base.cpp b/src/xr_3da/xrGame/alife_simulator_base.cpp index 62390b59..a8ae718d 100644 --- a/src/xr_3da/xrGame/alife_simulator_base.cpp +++ b/src/xr_3da/xrGame/alife_simulator_base.cpp @@ -109,7 +109,7 @@ CSE_Abstract *CALifeSimulatorBase::spawn_item (LPCSTR section, const Fvector &po if (abstract->ID < 10) strcat (s_name_replace,"0"); string16 S1; - strcat (s_name_replace,_itoa(abstract->ID,S1,10)); + strcat (s_name_replace,itoa(abstract->ID,S1,10)); abstract->set_name_replace (s_name_replace); CSE_ALifeDynamicObject *dynamic_object = smart_cast(abstract); @@ -165,7 +165,7 @@ CSE_Abstract *CALifeSimulatorBase::create(CSE_ALifeGroupAbstract *tpALifeGroupAb if (k->ID < 10) strcat (s_name_replace,"0"); string16 S1; - strcat (s_name_replace,_itoa(k->ID,S1,10)); + strcat (s_name_replace,itoa(k->ID,S1,10)); k->set_name_replace (s_name_replace); register_object (k,true); diff --git a/src/xr_3da/xrGame/alife_simulator_script.cpp b/src/xr_3da/xrGame/alife_simulator_script.cpp index 5584e954..21ad3acf 100644 --- a/src/xr_3da/xrGame/alife_simulator_script.cpp +++ b/src/xr_3da/xrGame/alife_simulator_script.cpp @@ -34,23 +34,23 @@ CALifeSimulator *alife () return (const_cast(ai().get_alife())); } -CSE_ALifeDynamicObject *alife_object (const CALifeSimulator *self_, ALife::_OBJECT_ID object_id) +CSE_ALifeDynamicObject *alife_object (const CALifeSimulator *self, ALife::_OBJECT_ID object_id) { - VERIFY (self_); - return (self_->objects().object(object_id,true)); + VERIFY (self); + return (self->objects().object(object_id,true)); } -bool valid_object_id (const CALifeSimulator *self_, ALife::_OBJECT_ID object_id) +bool valid_object_id (const CALifeSimulator *self, ALife::_OBJECT_ID object_id) { - VERIFY (self_); + VERIFY (self); return (object_id != 0xffff); } -CSE_ALifeDynamicObject *alife_object (const CALifeSimulator *self_, LPCSTR name) +CSE_ALifeDynamicObject *alife_object (const CALifeSimulator *self, LPCSTR name) { - VERIFY (self_); + VERIFY (self); - for (CALifeObjectRegistry::OBJECT_REGISTRY::const_iterator it = self_->objects().objects().begin(); it != self_->objects().objects().end(); it++) { + for (CALifeObjectRegistry::OBJECT_REGISTRY::const_iterator it = self->objects().objects().begin(); it != self->objects().objects().end(); it++) { CSE_ALifeDynamicObject *obj = it->second; if (xr_strcmp(obj->name_replace(),name) == 0) return (it->second); @@ -60,15 +60,15 @@ CSE_ALifeDynamicObject *alife_object (const CALifeSimulator *self_, LPCSTR name } -CSE_ALifeDynamicObject *alife_object (const CALifeSimulator *self_, ALife::_OBJECT_ID id, bool no_assert) +CSE_ALifeDynamicObject *alife_object (const CALifeSimulator *self, ALife::_OBJECT_ID id, bool no_assert) { - VERIFY (self_); - return (self_->objects().object(id,no_assert)); + VERIFY (self); + return (self->objects().object(id,no_assert)); } -CSE_ALifeDynamicObject *alife_story_object (const CALifeSimulator *self_, ALife::_STORY_ID id) +CSE_ALifeDynamicObject *alife_story_object (const CALifeSimulator *self, ALife::_STORY_ID id) { - return (self_->story_objects().object(id,true)); + return (self->story_objects().object(id,true)); } template @@ -140,12 +140,12 @@ void remove_out_restriction (CALifeSimulator *alife, CSE_ALifeMonsterAbstract *m alife->remove_restriction (monster->ID,id,RestrictionSpace::eRestrictorTypeOut); } -u32 get_level_id(CALifeSimulator *self_) +u32 get_level_id(CALifeSimulator *self) { - return (self_->graph().level().level_id()); + return (self->graph().level().level_id()); } -CSE_ALifeDynamicObject *CALifeSimulator__create (CALifeSimulator *self_, ALife::_SPAWN_ID spawn_id) +CSE_ALifeDynamicObject *CALifeSimulator__create (CALifeSimulator *self, ALife::_SPAWN_ID spawn_id) { const CALifeSpawnRegistry::SPAWN_GRAPH::CVertex *vertex = ai().alife().spawns().spawns().vertex(spawn_id); THROW2 (vertex,"Invalid spawn id!"); @@ -154,21 +154,21 @@ CSE_ALifeDynamicObject *CALifeSimulator__create (CALifeSimulator *self_, ALife:: THROW (spawn); CSE_ALifeDynamicObject *object; - self_->create (object,spawn,spawn_id); + self->create (object,spawn,spawn_id); return (object); } -CSE_Abstract *CALifeSimulator__spawn_item (CALifeSimulator *self_, LPCSTR section, const Fvector &position, u32 level_vertex_id, GameGraph::_GRAPH_ID game_vertex_id) +CSE_Abstract *CALifeSimulator__spawn_item (CALifeSimulator *self, LPCSTR section, const Fvector &position, u32 level_vertex_id, GameGraph::_GRAPH_ID game_vertex_id) { - THROW (self_); - return (self_->spawn_item(section,position,level_vertex_id,game_vertex_id,ALife::_OBJECT_ID(-1))); + THROW (self); + return (self->spawn_item(section,position,level_vertex_id,game_vertex_id,ALife::_OBJECT_ID(-1))); } -CSE_Abstract *CALifeSimulator__spawn_item2 (CALifeSimulator *self_, LPCSTR section, const Fvector &position, u32 level_vertex_id, GameGraph::_GRAPH_ID game_vertex_id, ALife::_OBJECT_ID id_parent) +CSE_Abstract *CALifeSimulator__spawn_item2 (CALifeSimulator *self, LPCSTR section, const Fvector &position, u32 level_vertex_id, GameGraph::_GRAPH_ID game_vertex_id, ALife::_OBJECT_ID id_parent) { if (id_parent == ALife::_OBJECT_ID(-1)) - return (self_->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent)); + return (self->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent)); CSE_ALifeDynamicObject *object = ai().alife().objects().object(id_parent,true); if (!object) { @@ -177,15 +177,15 @@ CSE_Abstract *CALifeSimulator__spawn_item2 (CALifeSimulator *self_, LPCSTR sect } if (!object->m_bOnline) - return (self_->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent)); + return (self->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent)); NET_Packet packet; packet.w_begin (M_SPAWN); packet.w_stringZ (section); - CSE_Abstract *item = self_->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent,false); + CSE_Abstract *item = self->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent,false); item->Spawn_Write (packet,FALSE); - self_->server().FreeID (item->ID,0); + self->server().FreeID (item->ID,0); F_entity_Destroy (item); ClientID clientID; @@ -194,10 +194,10 @@ CSE_Abstract *CALifeSimulator__spawn_item2 (CALifeSimulator *self_, LPCSTR sect u16 dummy; packet.r_begin (dummy); VERIFY (dummy == M_SPAWN); - return (self_->server().Process_spawn(packet,clientID)); + return (self->server().Process_spawn(packet,clientID)); } -CSE_Abstract *CALifeSimulator__spawn_ammo (CALifeSimulator *self_, LPCSTR section, const Fvector &position, u32 level_vertex_id, GameGraph::_GRAPH_ID game_vertex_id, ALife::_OBJECT_ID id_parent, int ammo_to_spawn) +CSE_Abstract *CALifeSimulator__spawn_ammo (CALifeSimulator *self, LPCSTR section, const Fvector &position, u32 level_vertex_id, GameGraph::_GRAPH_ID game_vertex_id, ALife::_OBJECT_ID id_parent, int ammo_to_spawn) { // if (id_parent == ALife::_OBJECT_ID(-1)) // return (self->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent)); @@ -211,7 +211,7 @@ CSE_Abstract *CALifeSimulator__spawn_ammo (CALifeSimulator *self_, LPCSTR secti } if (!object || !object->m_bOnline) { - CSE_Abstract *item = self_->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent); + CSE_Abstract *item = self->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent); CSE_ALifeItemAmmo *ammo = smart_cast(item); THROW (ammo); @@ -225,7 +225,7 @@ CSE_Abstract *CALifeSimulator__spawn_ammo (CALifeSimulator *self_, LPCSTR secti packet.w_begin (M_SPAWN); packet.w_stringZ (section); - CSE_Abstract *item = self_->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent,false); + CSE_Abstract *item = self->spawn_item(section,position,level_vertex_id,game_vertex_id,id_parent,false); CSE_ALifeItemAmmo *ammo = smart_cast(item); THROW (ammo); @@ -233,7 +233,7 @@ CSE_Abstract *CALifeSimulator__spawn_ammo (CALifeSimulator *self_, LPCSTR secti ammo->a_elapsed = (u16)ammo_to_spawn; item->Spawn_Write (packet,FALSE); - self_->server().FreeID (item->ID,0); + self->server().FreeID (item->ID,0); F_entity_Destroy (item); ClientID clientID; @@ -242,24 +242,24 @@ CSE_Abstract *CALifeSimulator__spawn_ammo (CALifeSimulator *self_, LPCSTR secti u16 dummy; packet.r_begin (dummy); VERIFY (dummy == M_SPAWN); - return (self_->server().Process_spawn(packet,clientID)); + return (self->server().Process_spawn(packet,clientID)); } -ALife::_SPAWN_ID CALifeSimulator__spawn_id (CALifeSimulator *self_, ALife::_SPAWN_STORY_ID spawn_story_id) +ALife::_SPAWN_ID CALifeSimulator__spawn_id (CALifeSimulator *self, ALife::_SPAWN_STORY_ID spawn_story_id) { - return (((const CALifeSimulator *)self_)->spawns().spawn_id(spawn_story_id)); + return (((const CALifeSimulator *)self)->spawns().spawn_id(spawn_story_id)); } -void CALifeSimulator__release (CALifeSimulator *self_, CSE_Abstract *object, bool) +void CALifeSimulator__release (CALifeSimulator *self, CSE_Abstract *object, bool) { - VERIFY (self_); + VERIFY (self); // self->release (object,true); THROW (object); CSE_ALifeObject *alife_object = smart_cast(object); THROW (alife_object); if (!alife_object->m_bOnline) { - self_->release (object,true); + self->release (object,true); return; } @@ -272,22 +272,22 @@ void CALifeSimulator__release (CALifeSimulator *self_, CSE_Abstract *object, Level().Send (packet,net_flags(TRUE,TRUE)); } -LPCSTR get_level_name (const CALifeSimulator *self_, int level_id) +LPCSTR get_level_name (const CALifeSimulator *self, int level_id) { - LPCSTR result_ = *ai().game_graph().header().level((GameGraph::_LEVEL_ID)level_id).name(); - return (result_); + LPCSTR result = *ai().game_graph().header().level((GameGraph::_LEVEL_ID)level_id).name(); + return (result); } -CSE_ALifeCreatureActor *get_actor (const CALifeSimulator *self_) +CSE_ALifeCreatureActor *get_actor (const CALifeSimulator *self) { - THROW (self_); - return (self_->graph().actor()); + THROW (self); + return (self->graph().actor()); } -KNOWN_INFO_VECTOR *registry (const CALifeSimulator *self_, const ALife::_OBJECT_ID &id) +KNOWN_INFO_VECTOR *registry (const CALifeSimulator *self, const ALife::_OBJECT_ID &id) { - THROW (self_); - return (self_->registry(info_portions).object(id, true)); + THROW (self); + return (self->registry(info_portions).object(id, true)); } class CFindByIDPred @@ -299,9 +299,9 @@ class CFindByIDPred shared_str element; }; -bool has_info (const CALifeSimulator *self_, const ALife::_OBJECT_ID &id, LPCSTR info_id) +bool has_info (const CALifeSimulator *self, const ALife::_OBJECT_ID &id, LPCSTR info_id) { - const KNOWN_INFO_VECTOR *known_info = registry(self_,id); + const KNOWN_INFO_VECTOR *known_info = registry(self,id); if (!known_info) return (false); @@ -311,11 +311,11 @@ bool has_info (const CALifeSimulator *self_, const ALife::_OBJECT_ID &id return (true); } -bool dont_has_info (const CALifeSimulator *self_, const ALife::_OBJECT_ID &id, LPCSTR info_id) +bool dont_has_info (const CALifeSimulator *self, const ALife::_OBJECT_ID &id, LPCSTR info_id) { - THROW (self_); + THROW (self); // absurdly, but only because of scriptwriters needs - return (!has_info(self_,id,info_id)); + return (!has_info(self,id,info_id)); } //void disable_info_portion (const CALifeSimulator *self, const ALife::_OBJECT_ID &id) diff --git a/src/xr_3da/xrGame/alife_storage_manager_inline.h b/src/xr_3da/xrGame/alife_storage_manager_inline.h index ddee24bf..c7f29c61 100644 --- a/src/xr_3da/xrGame/alife_storage_manager_inline.h +++ b/src/xr_3da/xrGame/alife_storage_manager_inline.h @@ -8,7 +8,9 @@ #pragma once -IC CALifeStorageManager::CALifeStorageManager (xrServer *server, LPCSTR section) { +IC CALifeStorageManager::CALifeStorageManager (xrServer *server, LPCSTR section) : + inherited (server,section) +{ m_section = section; strcpy (m_save_name,""); } diff --git a/src/xr_3da/xrGame/alife_surge_manager_inline.h b/src/xr_3da/xrGame/alife_surge_manager_inline.h index 5ffc6d50..80ca8c30 100644 --- a/src/xr_3da/xrGame/alife_surge_manager_inline.h +++ b/src/xr_3da/xrGame/alife_surge_manager_inline.h @@ -8,5 +8,7 @@ #pragma once -IC CALifeSurgeManager::CALifeSurgeManager (xrServer *server, LPCSTR section) { +IC CALifeSurgeManager::CALifeSurgeManager (xrServer *server, LPCSTR section) : + inherited (server,section) +{ } diff --git a/src/xr_3da/xrGame/alife_switch_manager_inline.h b/src/xr_3da/xrGame/alife_switch_manager_inline.h index e62c95e0..3b49e3a1 100644 --- a/src/xr_3da/xrGame/alife_switch_manager_inline.h +++ b/src/xr_3da/xrGame/alife_switch_manager_inline.h @@ -8,7 +8,9 @@ #pragma once -IC CALifeSwitchManager::CALifeSwitchManager (xrServer *server, LPCSTR section) { +IC CALifeSwitchManager::CALifeSwitchManager (xrServer *server, LPCSTR section) : + inherited (server,section) +{ m_switch_distance = pSettings->r_float(section,"switch_distance"); m_switch_factor = pSettings->r_float(section,"switch_factor"); set_switch_distance (m_switch_distance); diff --git a/src/xr_3da/xrGame/alife_update_manager.cpp b/src/xr_3da/xrGame/alife_update_manager.cpp index 8909b382..4b01d5b4 100644 --- a/src/xr_3da/xrGame/alife_update_manager.cpp +++ b/src/xr_3da/xrGame/alife_update_manager.cpp @@ -55,7 +55,9 @@ class CSwitchPredicate { CALifeUpdateManager::CALifeUpdateManager (xrServer *server, LPCSTR section) : CALifeSwitchManager (server,section), CALifeSurgeManager (server,section), - CALifeStorageManager (server,section) { + CALifeStorageManager (server,section), + CALifeSimulatorBase (server,section) +{ shedule.t_min = pSettings->r_s32 (section,"schedule_min"); shedule.t_max = pSettings->r_s32 (section,"schedule_max"); shedule_register (); diff --git a/src/xr_3da/xrGame/associative_vector_inline.h b/src/xr_3da/xrGame/associative_vector_inline.h index 8890d845..37591cb9 100644 --- a/src/xr_3da/xrGame/associative_vector_inline.h +++ b/src/xr_3da/xrGame/associative_vector_inline.h @@ -37,7 +37,7 @@ IC _associative_vector::associative_vector (const key_compare &predi TEMPLATE_SPECIALIZATION template -IC _associative_vector::associative_vector (_iterator_type first, _iterator_type last, const key_compare &predicate, const allocator_type &allocator) : +IC _associative_vector::associative_vector (_iterator_type first, _iterator_type last, const key_compare &predicate = key_compare(), const allocator_type &allocator = allocator_type()) : // inherited (first,last,allocator), inherited (first,last), value_compare (predicate) @@ -198,16 +198,16 @@ TEMPLATE_SPECIALIZATION IC typename _associative_vector::iterator _associative_vector::lower_bound (const key_type &key) { actualize (); - value_compare &self_ = *this; - return (std::lower_bound(begin(),end(),key,self_)); + value_compare &self = *this; + return (std::lower_bound(begin(),end(),key,self)); } TEMPLATE_SPECIALIZATION IC typename _associative_vector::const_iterator _associative_vector::lower_bound (const key_type &key) const { actualize (); - const value_compare &self_ = *this; - return (std::lower_bound(begin(),end(),key,self_)); + const value_compare &self = *this; + return (std::lower_bound(begin(),end(),key,self)); } TEMPLATE_SPECIALIZATION diff --git a/src/xr_3da/xrGame/base_client_classes_wrappers.h b/src/xr_3da/xrGame/base_client_classes_wrappers.h index ccf771c7..fdf850d1 100644 --- a/src/xr_3da/xrGame/base_client_classes_wrappers.h +++ b/src/xr_3da/xrGame/base_client_classes_wrappers.h @@ -47,9 +47,9 @@ class DLL_PureWrapper : public heritage::result { return (call_member(this,"_construct")); } - static DLL_Pure* _construct_static (base *self_) + static DLL_Pure* _construct_static (base *self) { - return (self_->base::_construct()); + return (self->base::_construct()); } }; diff --git a/src/xr_3da/xrGame/data_storage_double_linked_list_inline.h b/src/xr_3da/xrGame/data_storage_double_linked_list_inline.h index 7864263a..f1ed106a 100644 --- a/src/xr_3da/xrGame/data_storage_double_linked_list_inline.h +++ b/src/xr_3da/xrGame/data_storage_double_linked_list_inline.h @@ -18,7 +18,7 @@ #define CDoubleLinkedList CDataStorageDoubleLinkedList::CDataStorage<_data_storage,_vertex> TEMPLATE_SPECIALIZATION -IC CDoubleLinkedList::CDataStorage (const u32 vertex_count, const _dist_type _max_distance) : +IC CDoubleLinkedList::CDataStorage (const u32 vertex_count, const _dist_type _max_distance = _dist_type(u32(-1))) : inherited (vertex_count) { m_switch_factor = _dist_type(1); diff --git a/src/xr_3da/xrGame/dcylinder/dCylinder.cpp b/src/xr_3da/xrGame/dcylinder/dCylinder.cpp index c4d94214..71a9ec3e 100644 --- a/src/xr_3da/xrGame/dcylinder/dCylinder.cpp +++ b/src/xr_3da/xrGame/dcylinder/dCylinder.cpp @@ -464,35 +464,35 @@ TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(_sin*radius+_cos*hlz+boxProj),Ax[0],Ax[1] if (*code > 7) { //find point on the cylinder pa deepest along normal dVector3 pa; - dReal sign, cos1_,cos3_,factor; + 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 = dDOT14(normal,R1+0); + cos3 = dDOT14(normal,R1+2) ; + factor=dSqrt(cos1*cos1+cos3*cos3); - cos1_/=factor; - cos3_/=factor; + cos1/=factor; + cos3/=factor; - for (i=0; i<3; ++i) pa[i] += cos1_ * radius * R1[i*4]; + 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]; + 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]; + 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]; + 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]; + 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]; + for (i=0; i<3; ++i) pb[i] += sign * B3 * R2[i*4+2]; dReal alpha,beta; @@ -500,11 +500,11 @@ TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(_sin*radius+_cos*hlz+boxProj),Ax[0],Ax[1] 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); + 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) pb[i] += ub[i]*beta; - for (i=0; i<3; ++i) contact[0].pos[i] = REAL(0.5)*(pa[i]+pb_[i]); + for (i=0; i<3; ++i) contact[0].pos[i] = REAL(0.5)*(pa[i]+pb[i]); contact[0].depth = *depth; return 1; } @@ -531,19 +531,19 @@ TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(_sin*radius+_cos*hlz+boxProj),Ax[0],Ax[1] } else { - dReal sign,cos1_,cos3_,factor; + dReal sign,cos1,cos3,factor; dVector3 center; - cos1_ = dDOT14(normal,R1+0) ; - cos3_ = dDOT14(normal,R1+2); - factor=dSqrt(cos1_*cos1_+cos3_*cos3_); + 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; + 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]; + 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) { @@ -572,8 +572,8 @@ TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(_sin*radius+_cos*hlz+boxProj),Ax[0],Ax[1] { centerDepth=*depth-radius*sQ2; - A1=(-cos1_*M_COS_PI_3-cos3_*M_SIN_PI_3)*radius; - A3=(-cos3_*M_COS_PI_3+cos1_*M_SIN_PI_3)*radius; + 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]; @@ -581,8 +581,8 @@ TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],(_sin*radius+_cos*hlz+boxProj),Ax[0],Ax[1] 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; + 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]; @@ -793,7 +793,7 @@ dVector3 point; 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; + dVector3 tAx,tAx1; circleIntersection(R1+1,ca,radius1,R2+1,cb,radius2,point); Ax[0]=point[0]-ca[0]; @@ -803,9 +803,9 @@ dVector3 point; 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]; + 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]; @@ -818,7 +818,7 @@ dVector3 point; 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); + dCROSS(Ax,=,tAx,tAx1); @@ -886,57 +886,57 @@ TEST(p[0]*Ax[0]+p[1]*Ax[1]+p[2]*Ax[2],cyl1Pr+cyl2Pr,Ax[0],Ax[1],Ax[2],5); } if (*code == 6) { - dVector3 pa_; - dReal sign, cos1_,cos3_,factor; + dVector3 pa; + dReal sign, cos1,cos3,factor; - for (i=0; i<3; ++i) pa_[i] = p1[i]; + 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 = dDOT14(normal,R1+0); + cos3 = dDOT14(normal,R1+2) ; + factor=dSqrt(cos1*cos1+cos3*cos3); if(factor>0.f) { - cos1_/=factor; - cos3_/=factor; + cos1/=factor; + cos3/=factor; } - for (i=0; i<3; ++i) pa_[i] += cos1_ * radius1 * R1[i*4]; + 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] += sign * hlz1 * R1[i*4+1]; - for (i=0; i<3; ++i) pa_[i] += cos3_ * radius1 * R1[i*4+2]; + 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_); + 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; + cos1/=factor; + cos3/=factor; } - for (i=0; i<3; ++i) pb_[i] -= cos1_ * radius2 * R2[i*4]; + 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] -= sign * hlz2 * R2[i*4+1]; - for (i=0; i<3; ++i) pb_[i] -= cos3_ * radius2 * R2[i*4+2]; + 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; + 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]); + for (i=0; i<3; ++i) contact[0].pos[i] = REAL(0.5)*(pa[i]+pb[i]); contact[0].depth = *depth; return 1; } @@ -953,32 +953,32 @@ if (*code == 6) { if (*code == 0) { // flat face from cylinder 1 touches a edge/face from cylinder 2. - dReal sign,cos1_,cos3_,factor; + 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_); + cos1 = dDOT14(normal,R2+0) ; + cos3 = dDOT14(normal,R2+2); + factor=dSqrt(cos1*cos1+cos3*cos3); if(factor>0.f) { - cos1_/=factor; - cos3_/=factor; + 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] =center[i]- cos1 * radius2 * R2[i*4]; - for (i=0; i<3; ++i) vertex[i] -=cos3_ * radius2 * R2[i*4+2]; + 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; + 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]; @@ -986,8 +986,8 @@ if (*code == 6) { 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; + 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]; @@ -998,15 +998,15 @@ if (*code == 6) { } else { // flat face from cylinder 2 touches a edge/face from cylinder 1. - dReal sign,cos1_,cos3_,factor; + 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_); + cos1 = dDOT14(normal,R1+0) ; + cos3 = dDOT14(normal,R1+2); + factor=dSqrt(cos1*cos1+cos3*cos3); if(factor>0.f) { - cos1_/=factor; - cos3_/=factor; + cos1/=factor; + cos3/=factor; } dVector3 center; @@ -1015,8 +1015,8 @@ if (*code == 6) { 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]; + 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; @@ -1024,8 +1024,8 @@ if (*code == 6) { 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; + 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]; @@ -1033,8 +1033,8 @@ if (*code == 6) { 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; + 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]; diff --git a/src/xr_3da/xrGame/ef_storage_script.cpp b/src/xr_3da/xrGame/ef_storage_script.cpp index 3f6e175e..6354269f 100644 --- a/src/xr_3da/xrGame/ef_storage_script.cpp +++ b/src/xr_3da/xrGame/ef_storage_script.cpp @@ -22,7 +22,7 @@ CEF_Storage *ef_storage() return (&ai().ef_storage()); } -float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *object0, CScriptGameObject *object1, CScriptGameObject *object2, CScriptGameObject *object3) +float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *_0, CScriptGameObject *_1, CScriptGameObject *_2, CScriptGameObject *_3) { ef_storage->alife_evaluation(false); @@ -32,32 +32,32 @@ float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *obje return (0.f); } - ef_storage->non_alife().member() = smart_cast(object0 ? &object0->object() : 0); - if (object0 && !ef_storage->non_alife().member()) { - ai().script_engine().script_log(eLuaMessageTypeError,"object %s is not herited from CSE_ALifeSchedulable!",*object0->cName()); + ef_storage->non_alife().member() = smart_cast(_0 ? &_0->object() : 0); + if (_0 && !ef_storage->non_alife().member()) { + ai().script_engine().script_log(eLuaMessageTypeError,"object %s is not herited from CSE_ALifeSchedulable!",*_0->cName()); return (0.f); } - ef_storage->non_alife().enemy() = smart_cast(object1 ? &object1->object() : 0); - if (object1 && !ef_storage->non_alife().enemy()) { - ai().script_engine().script_log(eLuaMessageTypeError,"object %s is not herited from CSE_ALifeSchedulable!",*object1->cName()); + ef_storage->non_alife().enemy() = smart_cast(_1 ? &_1->object() : 0); + if (_1 && !ef_storage->non_alife().enemy()) { + ai().script_engine().script_log(eLuaMessageTypeError,"object %s is not herited from CSE_ALifeSchedulable!",*_1->cName()); return (0.f); } - ef_storage->non_alife().member_item() = &object2->object(); - ef_storage->non_alife().enemy_item() = &object3->object(); + ef_storage->non_alife().member_item() = &_2->object(); + ef_storage->non_alife().enemy_item() = &_3->object(); return (f->ffGetValue()); } -float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *object0, CScriptGameObject *object1, CScriptGameObject *object2) +float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *_0, CScriptGameObject *_1, CScriptGameObject *_2) { - return (evaluate(ef_storage,function,object0,object1,object2,0)); + return (evaluate(ef_storage,function,_0,_1,_2,0)); } -float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *object0, CScriptGameObject *object1) +float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *_0, CScriptGameObject *_1) { - return (evaluate(ef_storage,function,object0,object1,0,0)); + return (evaluate(ef_storage,function,_0,_1,0,0)); } float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *_0) @@ -65,7 +65,7 @@ float evaluate(CEF_Storage *ef_storage, LPCSTR function, CScriptGameObject *_0) return (evaluate(ef_storage,function,_0,0,0,0)); } -float evaluate(CEF_Storage *ef_storage, LPCSTR function, CSE_ALifeObject *object0, CSE_ALifeObject *object1, CSE_ALifeObject *object2, CSE_ALifeObject *object3) +float evaluate(CEF_Storage *ef_storage, LPCSTR function, CSE_ALifeObject *_0, CSE_ALifeObject *_1, CSE_ALifeObject *_2, CSE_ALifeObject *_3) { ef_storage->alife_evaluation(true); @@ -75,32 +75,32 @@ float evaluate(CEF_Storage *ef_storage, LPCSTR function, CSE_ALifeObject *object return (0.f); } - ef_storage->alife().member() = smart_cast(object0); - if (object0 && !ef_storage->alife().member()) { - ai().script_engine().script_log(eLuaMessageTypeError,"object %s is not herited from CSE_ALifeSchedulable!",object1->name_replace()); + ef_storage->alife().member() = smart_cast(_0); + if (_0 && !ef_storage->alife().member()) { + ai().script_engine().script_log(eLuaMessageTypeError,"object %s is not herited from CSE_ALifeSchedulable!",_1->name_replace()); return (0.f); } - ef_storage->alife().enemy() = smart_cast(object1); - if (object1 && !ef_storage->alife().enemy()) { - ai().script_engine().script_log(eLuaMessageTypeError,"object %s is not herited from CSE_ALifeSchedulable!",object1->name_replace()); + ef_storage->alife().enemy() = smart_cast(_1); + if (_1 && !ef_storage->alife().enemy()) { + ai().script_engine().script_log(eLuaMessageTypeError,"object %s is not herited from CSE_ALifeSchedulable!",_1->name_replace()); return (0.f); } - ef_storage->alife().member_item() = object2; - ef_storage->alife().enemy_item() = object3; + ef_storage->alife().member_item() = _2; + ef_storage->alife().enemy_item() = _3; return (f->ffGetValue()); } -float evaluate(CEF_Storage *ef_storage, LPCSTR function, CSE_ALifeObject *object0, CSE_ALifeObject *object1, CSE_ALifeObject *object2) +float evaluate(CEF_Storage *ef_storage, LPCSTR function, CSE_ALifeObject *_0, CSE_ALifeObject *_1, CSE_ALifeObject *_2) { - return (evaluate(ef_storage,function,object0,object1,object2,0)); + return (evaluate(ef_storage,function,_0,_1,_2,0)); } -float evaluate(CEF_Storage *ef_storage, LPCSTR function, CSE_ALifeObject *object0, CSE_ALifeObject *object1) +float evaluate(CEF_Storage *ef_storage, LPCSTR function, CSE_ALifeObject *_0, CSE_ALifeObject *_1) { - return (evaluate(ef_storage,function,object0,object1,0,0)); + return (evaluate(ef_storage,function,_0,_1,0,0)); } float evaluate(CEF_Storage *ef_storage, LPCSTR function, CSE_ALifeObject *_0) diff --git a/src/xr_3da/xrGame/game_cl_deathmatch_buywnd.cpp b/src/xr_3da/xrGame/game_cl_deathmatch_buywnd.cpp index de04f5aa..85d686e5 100644 --- a/src/xr_3da/xrGame/game_cl_deathmatch_buywnd.cpp +++ b/src/xr_3da/xrGame/game_cl_deathmatch_buywnd.cpp @@ -368,7 +368,7 @@ void game_cl_Deathmatch::LoadDefItemsForRank(IBuyWnd* pBuyMenu) char tmp[5]; for (int i=1; i<=local_player->rank; i++) { - strconcat(sizeof(RankStr),RankStr,"rank_", _itoa(i,tmp,10)); + strconcat(sizeof(RankStr),RankStr,"rank_",itoa(i,tmp,10)); if (!pSettings->section_exist(RankStr)) continue; for (u32 it=0; itheader()); + return (&self->header()); } -bool get_accessible1 (const CGameGraph *self_, const u32 &vertex_id) +bool get_accessible1 (const CGameGraph *self, const u32 &vertex_id) { - return (self_->accessible(vertex_id)); + return (self->accessible(vertex_id)); } -void get_accessible2 (const CGameGraph *self_, const u32 &vertex_id, bool value) +void get_accessible2 (const CGameGraph *self, const u32 &vertex_id, bool value) { - self_->accessible (vertex_id,value); + self->accessible (vertex_id,value); } Fvector CVertex__level_point (const CGameGraph::CVertex *vertex) diff --git a/src/xr_3da/xrGame/game_location_selector_inline.h b/src/xr_3da/xrGame/game_location_selector_inline.h index 0bda5bfe..787701ad 100644 --- a/src/xr_3da/xrGame/game_location_selector_inline.h +++ b/src/xr_3da/xrGame/game_location_selector_inline.h @@ -46,7 +46,7 @@ IC void CGameLocationSelector::reinit (const CGameGraph *graph) } TEMPLATE_SPECIALIZATION -IC void CGameLocationSelector::select_location (const _vertex_id_type start_vertex_id, _vertex_id_type &dest_vertex_id_) +IC void CGameLocationSelector::select_location (const _vertex_id_type start_vertex_id, _vertex_id_type &dest_vertex_id) { switch (m_selection_type) { case eSelectionTypeMask : { @@ -58,8 +58,8 @@ IC void CGameLocationSelector::select_location (const _vertex_id_type start_vert } case eSelectionTypeRandomBranching : { if (m_graph) - select_random_location(start_vertex_id,dest_vertex_id_); - m_failed = m_failed && (start_vertex_id == dest_vertex_id_); + select_random_location(start_vertex_id,dest_vertex_id); + m_failed = m_failed && (start_vertex_id == dest_vertex_id); break; } default : NODEFAULT; @@ -67,7 +67,7 @@ IC void CGameLocationSelector::select_location (const _vertex_id_type start_vert } TEMPLATE_SPECIALIZATION -IC void CGameLocationSelector::select_random_location(const _vertex_id_type start_vertex_id, _vertex_id_type &dest_vertex_id_) +IC void CGameLocationSelector::select_random_location(const _vertex_id_type start_vertex_id, _vertex_id_type &dest_vertex_id) { VERIFY (m_graph); VERIFY (m_graph->valid_vertex_id(start_vertex_id)); @@ -106,9 +106,9 @@ IC void CGameLocationSelector::select_random_location(const _vertex_id_type star if (!branch_factor) { if ((start_vertex_id != m_previous_vertex_id) && accessible(m_previous_vertex_id)) - dest_vertex_id_ = m_previous_vertex_id; + dest_vertex_id = m_previous_vertex_id; else - dest_vertex_id_ = start_vertex_id; + dest_vertex_id = start_vertex_id; } else { u32 choice = ::Random.randI(0,branch_factor); @@ -138,7 +138,7 @@ IC void CGameLocationSelector::select_random_location(const _vertex_id_type star continue; } - dest_vertex_id_ = (*i).vertex_id(); + dest_vertex_id = (*i).vertex_id(); found = true; break; } diff --git a/src/xr_3da/xrGame/game_sv_deathmatch.cpp b/src/xr_3da/xrGame/game_sv_deathmatch.cpp index a4d629df..13825f3a 100644 --- a/src/xr_3da/xrGame/game_sv_deathmatch.cpp +++ b/src/xr_3da/xrGame/game_sv_deathmatch.cpp @@ -899,9 +899,9 @@ void game_sv_Deathmatch::OnPlayerBuyFinished (ClientID id_who, NET_Packet& P) xr_vector::iterator EDI = ItemsToDelete.end(); for ( ; IDI != EDI; ++IDI) { - NET_Packet P_; - u_EventGen (P_,GE_DESTROY,*IDI); - Level().Send(P_,net_flags(TRUE,TRUE)); + NET_Packet P; + u_EventGen (P,GE_DESTROY,*IDI); + Level().Send(P,net_flags(TRUE,TRUE)); }; }; @@ -1829,8 +1829,8 @@ BOOL game_sv_Deathmatch::Is_Anomaly_InLists(CSE_Abstract* E) for (u32 j=0; jbegin(), Anomalies->end(),E->name_replace()); - if (It_ != Anomalies->end()) + ANOMALIES_it It = std::find(Anomalies->begin(), Anomalies->end(),E->name_replace()); + if (It != Anomalies->end()) { return TRUE; }; diff --git a/src/xr_3da/xrGame/game_sv_mp.cpp b/src/xr_3da/xrGame/game_sv_mp.cpp index bbf371ee..682edc86 100644 --- a/src/xr_3da/xrGame/game_sv_mp.cpp +++ b/src/xr_3da/xrGame/game_sv_mp.cpp @@ -1030,11 +1030,11 @@ void game_sv_mp::OnPlayerChangeName (NET_Packet& P, ClientID sender) { Msg( "Player \"%s\" try to change name on \"%s\" at protected server.", ps->getName(), NewName ); - NET_Packet P_; - GenerateGameMessage (P_); - P_.w_u32 (GAME_EVENT_SERVER_STRING_MESSAGE); - P_.w_stringZ ("Server is protected. Can\'t change player name!"); - m_server->SendTo( sender, P_ ); + NET_Packet P; + GenerateGameMessage (P); + P.w_u32 (GAME_EVENT_SERVER_STRING_MESSAGE); + P.w_stringZ ("Server is protected. Can\'t change player name!"); + m_server->SendTo( sender, P ); return; } @@ -1045,21 +1045,21 @@ void game_sv_mp::OnPlayerChangeName (NET_Packet& P, ClientID sender) if (pClient->owner) { - NET_Packet P_; - GenerateGameMessage(P_); - P_.w_u32(GAME_EVENT_PLAYER_NAME); - P_.w_u16(pClient->owner->ID); - P_.w_s16(ps->team); - P_.w_stringZ(ps->getName()); - P_.w_stringZ(NewName); + NET_Packet P; + GenerateGameMessage(P); + P.w_u32(GAME_EVENT_PLAYER_NAME); + P.w_u16(pClient->owner->ID); + P.w_s16(ps->team); + P.w_stringZ(ps->getName()); + P.w_stringZ(NewName); //--------------------------------------------------- u32 cnt = get_players_count(); for(u32 it=0; itclient_Get (it); - game_PlayerState* ps_ = l_pC->ps; - if (!l_pC || !l_pC->net_Ready || !ps_) continue; - m_server->SendTo(l_pC->ID, P_); + game_PlayerState* ps = l_pC->ps; + if (!l_pC || !l_pC->net_Ready || !ps) continue; + m_server->SendTo(l_pC->ID, P); }; //--------------------------------------------------- pClient->owner->set_name_replace(NewName); @@ -1094,8 +1094,8 @@ void game_sv_mp::OnPlayerSpeechMessage (NET_Packet& P, ClientID sender) for(u32 it=0; itclient_Get (it); - game_PlayerState* ps_ = l_pC->ps; - if (!l_pC || !l_pC->net_Ready || !ps_) continue; + game_PlayerState* ps = l_pC->ps; + if (!l_pC || !l_pC->net_Ready || !ps) continue; m_server->SendTo(l_pC->ID, NP, net_flags(TRUE, TRUE, TRUE)); }; }; diff --git a/src/xr_3da/xrGame/game_sv_single.cpp b/src/xr_3da/xrGame/game_sv_single.cpp index d22739d6..6db02916 100644 --- a/src/xr_3da/xrGame/game_sv_single.cpp +++ b/src/xr_3da/xrGame/game_sv_single.cpp @@ -143,7 +143,7 @@ void game_sv_Single::OnDetach(u16 eid_who, u16 eid_what) #ifdef DEBUG else if (psAI_Flags.test(aiALife)) { - Msg ("Cannot detach object [%s][%s][%d] from object [%s][%s][%d]",l_tpALifeInventoryItem->base()->name_replace(),*l_tpALifeInventoryItem->base()->s_name.c_str(), l_tpALifeInventoryItem->base()->ID, l_tpDynamicObject->base()->name_replace(), l_tpDynamicObject->base()->s_name.c_str(), l_tpDynamicObject->ID); + Msg ("Cannot detach object [%s][%s][%d] from object [%s][%s][%d]",l_tpALifeInventoryItem->base()->name_replace(),*l_tpALifeInventoryItem->base()->s_name,l_tpALifeInventoryItem->base()->ID,l_tpDynamicObject->base()->name_replace(),l_tpDynamicObject->base()->s_name,l_tpDynamicObject->ID); } #endif } diff --git a/src/xr_3da/xrGame/graph_abstract_inline.h b/src/xr_3da/xrGame/graph_abstract_inline.h index 7a45b936..ef192cba 100644 --- a/src/xr_3da/xrGame/graph_abstract_inline.h +++ b/src/xr_3da/xrGame/graph_abstract_inline.h @@ -236,17 +236,17 @@ IC void CAbstractGraph::save (IWriter &stream) stream.open_chunk (2); { - const_vertex_iterator I_ = vertices().begin(); - const_vertex_iterator E_ = vertices().end(); - for ( ; I_ != E_; ++I_) { - if ((*I_).second->edges().empty()) + const_vertex_iterator I = vertices().begin(); + const_vertex_iterator E = vertices().end(); + for ( ; I != E; ++I) { + if ((*I).second->edges().empty()) continue; - save_data ((*I_).second->vertex_id(),stream); + save_data ((*I).second->vertex_id(),stream); - stream.w_u32 ((u32)(*I_).second->edges().size()); - const_iterator i = (*I_).second->edges().begin(); - const_iterator e = (*I_).second->edges().end(); + stream.w_u32 ((u32)(*I).second->edges().size()); + const_iterator i = (*I).second->edges().begin(); + const_iterator e = (*I).second->edges().end(); for ( ; i != e; ++i) { save_data ((*i).vertex_id(),stream); save_data ((*i).weight(),stream); diff --git a/src/xr_3da/xrGame/id_generator.h b/src/xr_3da/xrGame/id_generator.h index e0b7d58a..976e3cb9 100644 --- a/src/xr_3da/xrGame/id_generator.h +++ b/src/xr_3da/xrGame/id_generator.h @@ -90,9 +90,9 @@ class CID_Generator { return (tfGetFromBlock(m_tppBlocks[tfGetBlockByValue(tValueID)],tValueID)); R_ASSERT2 (m_available_count,"Not enough IDs"); - SID_Block* I_ = std::min_element(m_tppBlocks,m_tppBlocks + m_tBlockCount); - VERIFY (I_ != m_tppBlocks + m_tBlockCount); - return (tfGetFromBlock(*I_,tValueID)); + SID_Block* I = std::min_element(m_tppBlocks,m_tppBlocks + m_tBlockCount); + VERIFY (I != m_tppBlocks + m_tBlockCount); + return (tfGetFromBlock(*I,tValueID)); } IC void vfFreeID (VALUE_ID tValueID, TIME_ID tTimeID) diff --git a/src/xr_3da/xrGame/ik/Dof7control.cpp b/src/xr_3da/xrGame/ik/Dof7control.cpp index 92f288b9..6fcf0534 100644 --- a/src/xr_3da/xrGame/ik/Dof7control.cpp +++ b/src/xr_3da/xrGame/ik/Dof7control.cpp @@ -720,7 +720,7 @@ static void get_aim_circle_equation(const float g[3], unitize(t2); vecmult(t1, (float *) a, Ry); - float alpha = (float) acos(DOT(t1,t2)); + float alpha = acos(DOT(t1,t2)); // @@ -729,7 +729,7 @@ static void get_aim_circle_equation(const float g[3], float L4 = _sqrt(DOT(g,g)); float beta = M_PI - alpha; - float delta = (float) asin(_sin(beta)*L3/L4); + float delta = asin(_sin(beta)*L3/L4); if (delta < 0) delta = - delta; float gamma = M_PI - delta - beta; diff --git a/src/xr_3da/xrGame/ik/IKLimb.cpp b/src/xr_3da/xrGame/ik/IKLimb.cpp index e9f6d01f..925e5710 100644 --- a/src/xr_3da/xrGame/ik/IKLimb.cpp +++ b/src/xr_3da/xrGame/ik/IKLimb.cpp @@ -675,7 +675,7 @@ void CIKLimb::Collide( SIKCollideData &cld, CGameObject *O, const Fmatrix &foot, DBG_DrawLine(pos,p,D3DCOLOR_XRGB( 255, 0, 0 ) ); if( tri ) { - Fvector p_ = pos;p_.add( Fvector( ).mul( pick_v, l_pick_dist ) ); + Fvector p = pos;p.add( Fvector( ).mul( pick_v, l_pick_dist ) ); DBG_DrawTri( tri,Level( ).ObjectSpace.GetStaticVerts( ), D3DCOLOR_XRGB( 255, 0, 0 ) ); } } diff --git a/src/xr_3da/xrGame/ik/eqn.cxx b/src/xr_3da/xrGame/ik/eqn.cxx index dfe4d202..ac1f6c63 100644 --- a/src/xr_3da/xrGame/ik/eqn.cxx +++ b/src/xr_3da/xrGame/ik/eqn.cxx @@ -64,7 +64,7 @@ static int solve_trig1_aux(float c, if (temp < 0.0f) return 0; - temp = (float) atan2(_sqrt(temp), c); + temp = atan2(_sqrt(temp), c); num = (_abs(temp) > 1e-6f) ? 2 : 1; theta[0] = atan2ba; @@ -97,7 +97,7 @@ static int solve_trig1_aux(float c, static int solve_trig1(float a, float b, float c, float theta[2]) { - return solve_trig1_aux(c, a*a+b*b, (float) atan2(b,a), theta); + return solve_trig1_aux(c, a*a+b*b, atan2(b,a), theta); } #if 0 diff --git a/src/xr_3da/xrGame/ik/eqn.h b/src/xr_3da/xrGame/ik/eqn.h index dfeccc2f..d6c62951 100644 --- a/src/xr_3da/xrGame/ik/eqn.h +++ b/src/xr_3da/xrGame/ik/eqn.h @@ -79,7 +79,7 @@ struct PsiEquation { alpha = a; beta = b; xi = x; a2b2 = a*a + b*b; - atan2ba = (float) atan2(b,a); + atan2ba = atan2(b,a); num_crits = num_roots = status = 0; status_ptr = &status; num_roots_ptr = &num_roots; diff --git a/src/xr_3da/xrGame/ik/eulersolver.cxx b/src/xr_3da/xrGame/ik/eulersolver.cxx index f654629a..a6edebd1 100644 --- a/src/xr_3da/xrGame/ik/eulersolver.cxx +++ b/src/xr_3da/xrGame/ik/eulersolver.cxx @@ -150,16 +150,16 @@ void euler_extract(const EulerTableEntry &E, // Family1 cos(v) > 0 *t[0] = asin1(v); - *t[1] = angle_normalize((float) atan2(y[0],x[0])); - *t[2] = angle_normalize((float) atan2(y[1],x[1])); + *t[1] = angle_normalize(atan2(y[0],x[0])); + *t[2] = angle_normalize(atan2(y[1],x[1])); } else { // Family2 cos(v) < 0 *t[0] = asin2(v); - *t[1] = angle_normalize((float) atan2(-y[0],-x[0])); - *t[2] = angle_normalize((float) atan2(-y[1],-x[1])); + *t[1] = angle_normalize(atan2(-y[0],-x[0])); + *t[2] = angle_normalize(atan2(-y[1],-x[1])); } } else @@ -208,8 +208,8 @@ void euler_extract2(const EulerTableEntry &E, // Family1 cos(v) > 0 *t1[0] = asin1(v); - *t1[1] = angle_normalize((float) atan2(y[0],x[0])); - *t1[2] = angle_normalize((float) atan2(y[1],x[1])); + *t1[1] = angle_normalize(atan2(y[0],x[0])); + *t1[2] = angle_normalize(atan2(y[1],x[1])); *t2[0] = angle_normalize( M_PI - *t1[0] ); *t2[1] = angle_normalize( *t1[1] + M_PI ); diff --git a/src/xr_3da/xrGame/ik/jtlimits.cxx b/src/xr_3da/xrGame/ik/jtlimits.cxx index 6626a359..39947ff4 100644 --- a/src/xr_3da/xrGame/ik/jtlimits.cxx +++ b/src/xr_3da/xrGame/ik/jtlimits.cxx @@ -391,7 +391,7 @@ inline float mytan(float v) else v = 3*M_PI/2 - big_eps; } - return (float) tan(v); + return tan(v); } @@ -435,12 +435,12 @@ static AngleInt PosCos(-M_PI/2,M_PI/2); float ComplexJtLimit::theta1(float v) const { - return angle_normalize((float) atan2(sin_eq.eval(v), cos_eq.eval(v))); + return angle_normalize(atan2(sin_eq.eval(v), cos_eq.eval(v))); } float ComplexJtLimit::theta2(float v) const { - return angle_normalize((float) atan2(-sin_eq.eval(v), -cos_eq.eval(v))); + return angle_normalize(atan2(-sin_eq.eval(v), -cos_eq.eval(v))); } float ComplexJtLimit::theta(int family, float psi) const @@ -733,7 +733,7 @@ void ComplexJtLimit::store_intersections(int n, sort(n2, f2); } -const float tan_0 = (float) tan(eps/2.0f); +const float tan_0 = tan(eps/2.0f); const float tan_two_pi = (2*M_PI-eps/2.0f); diff --git a/src/xr_3da/xrGame/ik/jtlimits.h b/src/xr_3da/xrGame/ik/jtlimits.h index 7f1b423a..2a7a26e3 100644 --- a/src/xr_3da/xrGame/ik/jtlimits.h +++ b/src/xr_3da/xrGame/ik/jtlimits.h @@ -47,7 +47,7 @@ inline float asin1(float x) // printf("Domain error in asin1 %lf\n", x); x = (x > 0.f) ? 1.0f : -1.0f; } - return angle_normalize((float) asin(x)); + return angle_normalize(asin(x)); } // Pi/2 to -Pi/2 (quadrants II,III) @@ -58,7 +58,7 @@ inline float asin2(float x) // printf("Domain error in asin2 %lf\n", x); x = (x > 0) ? 1.0f : -1.0f; } - return angle_normalize(M_PI - (float) asin(x)); + return angle_normalize(M_PI - asin(x)); } @@ -70,7 +70,7 @@ inline float acos1(float x) // printf("Domain error in acos1 %lf\n", x); x = (x > 0) ? 1.0f : -1.0f; } - return angle_normalize((float) acos(x)); + return angle_normalize(acos(x)); } // Pi to 2Pi (quadrants III,IV) @@ -81,7 +81,7 @@ inline float acos2(float x) // printf("Domain error in acos2 %lf\n", x); x = (x > 0) ? 1.0f : -1.0f; } - return angle_normalize(-(float) acos(x)); + return angle_normalize(- acos(x)); } diff --git a/src/xr_3da/xrGame/ik/math3d.cpp b/src/xr_3da/xrGame/ik/math3d.cpp index 9c74fe05..9ea7d2e5 100644 --- a/src/xr_3da/xrGame/ik/math3d.cpp +++ b/src/xr_3da/xrGame/ik/math3d.cpp @@ -470,7 +470,7 @@ float angle_between_vectors(float u[3], float v[3], float n[3]) project_plane(up, u, n); project_plane(vp, v, n); crossproduct(uv, up, vp); - return (float) atan2(DOT(n, uv), DOT(up, vp)); + return atan2(DOT(n, uv), DOT(up, vp)); #endif } @@ -737,7 +737,7 @@ void rotation_matrix_to_axis(const Matrix R, float axis[], float &angle) { const float eps = 1e-7f; - angle = (float) acos((R[0][0] + R[1][1] + R[2][2] - 1) / 2.0f); + angle = acos((R[0][0] + R[1][1] + R[2][2] - 1) / 2.0f); // Close to identity. Arbitrarily set solution to z axis rotation of 0 diff --git a/src/xr_3da/xrGame/ik/mathTrig.cpp b/src/xr_3da/xrGame/ik/mathTrig.cpp index d2bdfbe4..08a35874 100644 --- a/src/xr_3da/xrGame/ik/mathTrig.cpp +++ b/src/xr_3da/xrGame/ik/mathTrig.cpp @@ -136,7 +136,7 @@ int myacos(float x, float solns[2]) if (_abs(x) > 1) return 0; - solns[0] = angle_normalize_signed((float) acos(x)); + solns[0] = angle_normalize_signed(acos(x)); if (iszero(solns[0])) return 1; @@ -154,7 +154,7 @@ int myasin(float x, float solns[2]) if (_abs(x) > 1) return 0; - solns[0] = (float)angle_normalize_signed((float) asin(x)); + solns[0] = (float)angle_normalize_signed(asin(x)); if (iszero(solns[0])) return 1; diff --git a/src/xr_3da/xrGame/ik_anim_state.cpp b/src/xr_3da/xrGame/ik_anim_state.cpp index e6ec0d9e..ef5f081f 100644 --- a/src/xr_3da/xrGame/ik_anim_state.cpp +++ b/src/xr_3da/xrGame/ik_anim_state.cpp @@ -18,7 +18,7 @@ bool blend_in( const CBlend &b, const motion_marks& marks ) VERIFY (!fis_zero(b.timeTotal)); float blend_time = ( b.timeCurrent/b.timeTotal ) ; - blend_time -= (float) floor( blend_time ); + blend_time -= floor( blend_time ); return marks.pick_mark ( blend_time * b.timeTotal ); //. return is_in( interval , blend_time ); diff --git a/src/xr_3da/xrGame/ini_table_loader.h b/src/xr_3da/xrGame/ini_table_loader.h index 1c9d398d..0afa0c0c 100644 --- a/src/xr_3da/xrGame/ini_table_loader.h +++ b/src/xr_3da/xrGame/ini_table_loader.h @@ -116,7 +116,7 @@ typename CSIni_Table::ITEM_TABLE& CSIni_Table::table () T_INI_LOADER::index_type cur_index = T_INI_LOADER::IdToIndex((*i).first, type_max(T_INI_LOADER::index_type)); if(type_max(T_INI_LOADER::index_type) == cur_index) - Debug.fatal(DEBUG_INFO,"wrong community %s in section [%s]", (*i).first.c_str(), table_sect); + Debug.fatal(DEBUG_INFO,"wrong community %s in section [%s]", (*i).first, table_sect); (*m_pTable)[cur_index].resize(cur_table_width); for(std::size_t j=0; j(object); @@ -226,15 +226,15 @@ void CLevelGraph::draw_stalkers (const int &vertex_id) if (!first_time) continue; - Fvector position_ = convert_position(graph.vertex(stalker->m_tGraphID)->game_point()); - render.draw_aabb (position_,radius,radius,radius,color); + Fvector position = convert_position(graph.vertex(stalker->m_tGraphID)->game_point()); + render.draw_aabb (position,radius,radius,radius,color); first_time = false; continue; } } - const_iterator_ I = objects.objects().begin(); - const_iterator_ E = objects.objects().end(); + const_iterator I = objects.objects().begin(); + const_iterator E = objects.objects().end(); for (; I != E; ++I) { CSE_ALifeDynamicObject *object = (*I).second; CSE_ALifeHumanStalker *stalker = smart_cast(object); @@ -345,15 +345,15 @@ void CLevelGraph::draw_objects (const int &vertex_id) } typedef CALifeGraphRegistry::OBJECT_REGISTRY OBJECT_REGISTRY; - typedef OBJECT_REGISTRY::_const_iterator const_iterator_; + typedef OBJECT_REGISTRY::_const_iterator const_iterator; typedef CALifeMonsterDetailPathManager::PATH PATH; const OBJECT_REGISTRY &objects = ai().alife().graph().objects()[vertex_id].objects(); CDebugRenderer &render = Level().debug_renderer(); if (show_text) { bool first_time = true; - const_iterator_ I = objects.objects().begin(); - const_iterator_ E = objects.objects().end(); + const_iterator I = objects.objects().begin(); + const_iterator E = objects.objects().end(); for (; I != E; ++I) { CSE_ALifeDynamicObject *object = (*I).second; CSE_ALifeMonsterAbstract*monster = smart_cast(object); @@ -370,15 +370,15 @@ void CLevelGraph::draw_objects (const int &vertex_id) if (!first_time) continue; - Fvector position_ = convert_position(graph.vertex(monster->m_tGraphID)->game_point()); - render.draw_aabb (position_,radius,radius,radius,color); + Fvector position = convert_position(graph.vertex(monster->m_tGraphID)->game_point()); + render.draw_aabb (position,radius,radius,radius,color); first_time = false; continue; } } - const_iterator_ I = objects.objects().begin(); - const_iterator_ E = objects.objects().end(); + const_iterator I = objects.objects().begin(); + const_iterator E = objects.objects().end(); for (; I != E; ++I) { CSE_ALifeDynamicObject *object = (*I).second; CSE_ALifeMonsterAbstract*monster = smart_cast(object); diff --git a/src/xr_3da/xrGame/level_graph_inline.h b/src/xr_3da/xrGame/level_graph_inline.h index 4b44f583..04278a01 100644 --- a/src/xr_3da/xrGame/level_graph_inline.h +++ b/src/xr_3da/xrGame/level_graph_inline.h @@ -441,10 +441,10 @@ IC bool CLevelGraph::create_straight_path (u32 start_vertex_id, const Fvector2 & box.min = box.max = temp; box.grow (identity); if (box.pick_exact(start,dir)) { - Fvector2 temp_; - temp_.add (box.min,box.max); - temp_.mul (.5f); - float dist = _sqr(temp_.x - dest.x) + _sqr(temp_.y - dest.y); + Fvector2 temp; + temp.add (box.min,box.max); + temp.mul (.5f); + float dist = _sqr(temp.x - dest.x) + _sqr(temp.y - dest.y); if ((dist > cur_sqr) && (dest_xz != v->position().xz())) continue; diff --git a/src/xr_3da/xrGame/level_graph_vertex.cpp b/src/xr_3da/xrGame/level_graph_vertex.cpp index 347e4653..46b27cf9 100644 --- a/src/xr_3da/xrGame/level_graph_vertex.cpp +++ b/src/xr_3da/xrGame/level_graph_vertex.cpp @@ -259,10 +259,10 @@ u32 CLevelGraph::check_position_in_direction_slow (u32 start_vertex_id, const F if (dest_xz == v->position().xz()) { return (is_accessible(next_vertex_id) ? next_vertex_id : u32(-1)); } - Fvector2 temp_; - temp_.add (box.min,box.max); - temp_.mul (.5f); - float dist = _sqr(temp_.x - dest.x) + _sqr(temp_.y - dest.y); + Fvector2 temp; + temp.add (box.min,box.max); + temp.mul (.5f); + float dist = _sqr(temp.x - dest.x) + _sqr(temp.y - dest.y); if (dist > cur_sqr) continue; @@ -312,10 +312,10 @@ bool CLevelGraph::check_vertex_in_direction_slow (u32 start_vertex_id, const Fve if (next_vertex_id == finish_vertex_id) { return (is_accessible(next_vertex_id)); } - Fvector2 temp_; - temp_.add (box.min,box.max); - temp_.mul (.5f); - float dist = _sqr(temp_.x - dest.x) + _sqr(temp_.y - dest.y); + Fvector2 temp; + temp.add (box.min,box.max); + temp.mul (.5f); + float dist = _sqr(temp.x - dest.x) + _sqr(temp.y - dest.y); if (dist > cur_sqr) continue; @@ -388,10 +388,10 @@ bool CLevelGraph::create_straight_path(u32 start_vertex_id, const Fvector2 &star box.min = box.max = temp; box.grow (identity); if (box.pick_exact(start,dir)) { - Fvector2 temp_; - temp_.add (box.min,box.max); - temp_.mul (.5f); - float dist = _sqr(temp_.x - dest.x) + _sqr(temp_.y - dest.y); + Fvector2 temp; + temp.add (box.min,box.max); + temp.mul (.5f); + float dist = _sqr(temp.x - dest.x) + _sqr(temp.y - dest.y); if (dist > cur_sqr) continue; @@ -503,10 +503,10 @@ bool CLevelGraph::neighbour_in_direction (const Fvector &direction, u32 start_ve box.min = box.max = temp; box.grow (identity); if (box.pick_exact(start,dir)) { - Fvector2 temp_; - temp_.add (box.min,box.max); - temp_.mul (.5f); - float dist = _sqr(temp_.x - dest.x) + _sqr(temp_.y - dest.y); + Fvector2 temp; + temp.add (box.min,box.max); + temp.mul (.5f); + float dist = _sqr(temp.x - dest.x) + _sqr(temp.y - dest.y); if (dist > cur_sqr) continue; return (true); diff --git a/src/xr_3da/xrGame/level_script.cpp b/src/xr_3da/xrGame/level_script.cpp index a21bbc6f..95e3e534 100644 --- a/src/xr_3da/xrGame/level_script.cpp +++ b/src/xr_3da/xrGame/level_script.cpp @@ -168,9 +168,9 @@ u32 vertex_in_direction(u32 level_vertex_id, Fvector direction, float max_distan direction.mul (max_distance); Fvector start_position = ai().level_graph().vertex_position(level_vertex_id); Fvector finish_position = Fvector(start_position).add(direction); - u32 result_ = u32(-1); - ai().level_graph().farthest_vertex_in_direction(level_vertex_id,start_position,finish_position,result_,0); - return (ai().level_graph().valid_vertex_id(result_) ? result_ : level_vertex_id); + u32 result = u32(-1); + ai().level_graph().farthest_vertex_in_direction(level_vertex_id,start_position,finish_position,result,0); + return (ai().level_graph().valid_vertex_id(result) ? result : level_vertex_id); } Fvector vertex_position(u32 level_vertex_id) @@ -343,9 +343,9 @@ CEnvironment *environment() return (g_pGamePersistent->pEnvironment); } -CEnvDescriptor *current_environment(CEnvironment *self_) +CEnvDescriptor *current_environment(CEnvironment *self) { - return (&self_->CurrentEnv); + return (&self->CurrentEnv); } extern bool g_bDisableAllInput; void disable_input() diff --git a/src/xr_3da/xrGame/map_location.cpp b/src/xr_3da/xrGame/map_location.cpp index 7b30f720..ceb3dd98 100644 --- a/src/xr_3da/xrGame/map_location.cpp +++ b/src/xr_3da/xrGame/map_location.cpp @@ -404,17 +404,17 @@ void CMapLocation::UpdateSpot(CUICustomMap* map, CMapSpot* sp ) if(!bDone&&bbb){ Msg("Error. Path from actor to selected map spot does not contain level changer :("); Msg("Path:"); - xr_vector::iterator it_ = map_point_path.begin(); - xr_vector::iterator it_e_ = map_point_path.end(); - for(; it_!=it_e_;++it_){ + xr_vector::iterator it = map_point_path.begin(); + xr_vector::iterator it_e = map_point_path.end(); + for(; it!=it_e;++it){ // Msg("%d-%s",(*it),ai().game_graph().vertex(*it)); - Msg("[%d] level[%s]",(*it_),*ai().game_graph().header().level(ai().game_graph().vertex(*it_)->level_id()).name()); + Msg("[%d] level[%s]",(*it),*ai().game_graph().header().level(ai().game_graph().vertex(*it)->level_id()).name()); } Msg("Available LevelChangers:"); - xr_vector::iterator lit_,lit_e_; - lit_e_ = g_lchangers.end(); - for(lit_=g_lchangers.begin();lit_!=lit_e_; ++lit_){ - GameGraph::_GRAPH_ID gid = (*lit_)->ai_location().game_vertex_id(); + xr_vector::iterator lit,lit_e; + lit_e = g_lchangers.end(); + for(lit=g_lchangers.begin();lit!=lit_e; ++lit){ + GameGraph::_GRAPH_ID gid = (*lit)->ai_location().game_vertex_id(); Msg("[%d]",gid); Fvector p = ai().game_graph().vertex(gid)->level_point(); Msg("lch_name=%s pos=%f %f %f",*ai().game_graph().header().level(ai().game_graph().vertex(gid)->level_id()).name(), p.x, p.y, p.z); diff --git a/src/xr_3da/xrGame/memory_space_script.cpp b/src/xr_3da/xrGame/memory_space_script.cpp index 6053d10b..57eecdb5 100644 --- a/src/xr_3da/xrGame/memory_space_script.cpp +++ b/src/xr_3da/xrGame/memory_space_script.cpp @@ -31,26 +31,26 @@ CScriptGameObject *get_memory_object(const MemorySpace::CMemoryObject &memory return (memory_object.m_object->lua_game_object()); } -CScriptGameObject *CDangerObject_object(const CDangerObject *self_) +CScriptGameObject *CDangerObject_object(const CDangerObject *self) { - VERIFY (self_); - return (self_->object() ? self_->object()->lua_game_object() : 0); + VERIFY (self); + return (self->object() ? self->object()->lua_game_object() : 0); } -CScriptGameObject *CDangerObject_dependent_object(const CDangerObject *self_) +CScriptGameObject *CDangerObject_dependent_object(const CDangerObject *self) { - VERIFY (self_); - if (!self_->dependent_object()) + VERIFY (self); + if (!self->dependent_object()) return (0); - const CGameObject *game_object = smart_cast(self_->dependent_object()); + const CGameObject *game_object = smart_cast(self->dependent_object()); return (game_object ? game_object->lua_game_object() : 0); } -Fvector CDangerObject__position (const CDangerObject *self_) +Fvector CDangerObject__position (const CDangerObject *self) { - THROW (self_); - return (self_->position()); + THROW (self); + return (self->position()); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/movement_manager_physic.cpp b/src/xr_3da/xrGame/movement_manager_physic.cpp index 15a40582..fdaae501 100644 --- a/src/xr_3da/xrGame/movement_manager_physic.cpp +++ b/src/xr_3da/xrGame/movement_manager_physic.cpp @@ -222,8 +222,8 @@ void CMovementManager::move_along_path (CPHMovementControl *movement_control, Fv // Физика устанавливает позицию в соответствии с нулевой скоростью if (detail().completed(dest_position,true)) { if(!movement_control->PhyssicsOnlyMode()) { - Fvector velocity_ = {0.f,0.f,0.f}; - movement_control->SetVelocity (velocity_); + Fvector velocity = {0.f,0.f,0.f}; + movement_control->SetVelocity (velocity); m_speed = 0.f; } } diff --git a/src/xr_3da/xrGame/object_cloner.h b/src/xr_3da/xrGame/object_cloner.h index f9ec6bcc..6f4ccbe4 100644 --- a/src/xr_3da/xrGame/object_cloner.h +++ b/src/xr_3da/xrGame/object_cloner.h @@ -25,19 +25,19 @@ struct CCloner { } }; - IC static void clone(LPCSTR source, LPCSTR& destination) + IC static void clone(LPCSTR _1, LPCSTR &_2) { - destination = source; + _2 = _1; } - IC static void clone(LPSTR source, LPSTR & destination) + IC static void clone(LPSTR _1, LPSTR &_2) { - destination = xr_strdup(source); + _2 = xr_strdup(_1); } - IC static void clone(const shared_str& source, shared_str& destination) + IC static void clone(const shared_str &_1, shared_str &_2) { - destination = source; + _2 = _1; } template diff --git a/src/xr_3da/xrGame/object_interfaces.h b/src/xr_3da/xrGame/object_interfaces.h index 334511c6..cdd2ffe6 100644 --- a/src/xr_3da/xrGame/object_interfaces.h +++ b/src/xr_3da/xrGame/object_interfaces.h @@ -19,14 +19,12 @@ template class IPureLadableObject { public: virtual void load(_storage_type &storage) = 0; - virtual ~IPureLadableObject() = default; }; template class IPureSavableObject { public: virtual void save(_storage_type &storage) = 0; - virtual ~IPureSavableObject() = default; }; template @@ -45,5 +43,4 @@ class IPureServerObject : public IPureSerializeObject { class IPureSchedulableObject { public: virtual void update () = 0; - virtual ~IPureSchedulableObject() = default; }; diff --git a/src/xr_3da/xrGame/operator_abstract_inline.h b/src/xr_3da/xrGame/operator_abstract_inline.h index 92b25b57..1cb13500 100644 --- a/src/xr_3da/xrGame/operator_abstract_inline.h +++ b/src/xr_3da/xrGame/operator_abstract_inline.h @@ -149,9 +149,9 @@ IC bool CAbstractOperator::applicable_reverse (const CSConditionState &condition } TEMPLATE_SPECIALIZATION -IC bool CAbstractOperator::apply_reverse (const CSConditionState &condition, const CSConditionState &start, CSConditionState &result_, const CSConditionState &self_condition) const +IC bool CAbstractOperator::apply_reverse (const CSConditionState &condition, const CSConditionState &start, CSConditionState &result, const CSConditionState &self_condition) const { - result_.clear (); + result.clear (); bool changed = false; xr_vector::const_iterator i = self_condition.conditions().begin(); xr_vector::const_iterator e = self_condition.conditions().end(); @@ -169,18 +169,18 @@ IC bool CAbstractOperator::apply_reverse (const CSConditionState &condition, con ++J; } else - result_.add_condition_back(*I); + result.add_condition_back(*I); ++I; } else if ((*I).condition() > (*i).condition()) { - result_.add_condition_back(*i); + result.add_condition_back(*i); ++i; } else { if ((*I).value() != (*i).value()) changed = true; - result_.add_condition_back(*i); + result.add_condition_back(*i); ++I; ++i; } @@ -189,7 +189,7 @@ IC bool CAbstractOperator::apply_reverse (const CSConditionState &condition, con if (!changed) return (false); for ( ; (i != e); ++i) - result_.add_condition_back(*i); + result.add_condition_back(*i); return (true); } @@ -198,7 +198,7 @@ IC bool CAbstractOperator::apply_reverse (const CSConditionState &condition, con ++J; else if ((*J).condition() > (*I).condition()) { - result_.add_condition_back(*I); + result.add_condition_back(*I); ++I; } else { @@ -213,7 +213,7 @@ IC bool CAbstractOperator::apply_reverse (const CSConditionState &condition, con if ((J == EE) && (I != E)) for ( ; (I != E); ++I) - result_.add_condition_back(*I); + result.add_condition_back(*I); return (true); } @@ -338,40 +338,40 @@ IC const typename CAbstractOperator::CSConditionState &CAbstractOperator::apply } TEMPLATE_SPECIALIZATION -IC const typename CAbstractOperator::CSConditionState &CAbstractOperator::apply (const CSConditionState &condition, const CSConditionState &self_condition, CSConditionState &result_) const +IC const typename CAbstractOperator::CSConditionState &CAbstractOperator::apply (const CSConditionState &condition, const CSConditionState &self_condition, CSConditionState &result) const { - result_.clear (); + result.clear (); xr_vector::const_iterator i = self_condition.conditions().begin(); xr_vector::const_iterator e = self_condition.conditions().end(); xr_vector::const_iterator I = condition.conditions().begin(); xr_vector::const_iterator E = condition.conditions().end(); for ( ; (I != E) && (i != e); ) if ((*I).condition() < (*i).condition()) { - result_.add_condition_back(*I); + result.add_condition_back(*I); ++I; } else if ((*I).condition() > (*i).condition()) { - result_.add_condition_back(*i); + result.add_condition_back(*i); ++i; } else { VERIFY ((*I).condition() == (*i).condition()); - result_.add_condition_back(*i); + result.add_condition_back(*i); ++I; ++i; } if (i == e) { for ( ; I != E; ++I) - result_.add_condition_back(*I); + result.add_condition_back(*I); } else { for ( ; i != e; ++i) - result_.add_condition_back(*i); + result.add_condition_back(*i); } - return (result_); + return (result); } TEMPLATE_SPECIALIZATION diff --git a/src/xr_3da/xrGame/path_manager_game_vertex_inline.h b/src/xr_3da/xrGame/path_manager_game_vertex_inline.h index 97d89a38..3248dc37 100644 --- a/src/xr_3da/xrGame/path_manager_game_vertex_inline.h +++ b/src/xr_3da/xrGame/path_manager_game_vertex_inline.h @@ -61,14 +61,14 @@ IC bool CGameVertexPathManager::is_accessible (const _index_type &vertex_id) con if (!m_start_is_accessible) return (true); - typedef _Parameters::VERTEX_TYPES::const_iterator const_iterator_; + typedef _Parameters::VERTEX_TYPES::const_iterator const_iterator; #ifdef DEBUG if (m_evaluator->m_vertex_types->empty()) { Msg ("! warning : empty vertex types"); } #endif - const_iterator_ I = m_evaluator->m_vertex_types->begin(); - const_iterator_ E = m_evaluator->m_vertex_types->end(); + const_iterator I = m_evaluator->m_vertex_types->begin(); + const_iterator E = m_evaluator->m_vertex_types->end(); for ( ; I != E; ++I) if (graph->mask((*I).tMask,graph->vertex(vertex_id)->vertex_type())) return (true); diff --git a/src/xr_3da/xrGame/patrol_path_params_script.cpp b/src/xr_3da/xrGame/patrol_path_params_script.cpp index 386b5a38..5ef45f1e 100644 --- a/src/xr_3da/xrGame/patrol_path_params_script.cpp +++ b/src/xr_3da/xrGame/patrol_path_params_script.cpp @@ -11,10 +11,10 @@ using namespace luabind; -Fvector CPatrolPathParams__point(const CPatrolPathParams *self_, u32 index) +Fvector CPatrolPathParams__point(const CPatrolPathParams *self, u32 index) { - THROW (self_); - return (self_->point(index)); + THROW (self); + return (self->point(index)); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/physics_game.cpp b/src/xr_3da/xrGame/physics_game.cpp index 4cb83dd5..3e2741b3 100644 --- a/src/xr_3da/xrGame/physics_game.cpp +++ b/src/xr_3da/xrGame/physics_game.cpp @@ -38,12 +38,12 @@ dContactGeom c; CParticlesObject* ps = CParticlesObject::Create(ps_name,TRUE); Fmatrix pos; - Fvector zero_vel_ = {0.f,0.f,0.f}; + Fvector zero_vel = {0.f,0.f,0.f}; pos.k.set(*((Fvector*)c.normal)); Fvector::generate_orthonormal_basis(pos.k, pos.j, pos.i); pos.c.set(*((Fvector*)c.pos)); - ps->UpdateParent(pos,zero_vel_); + ps->UpdateParent(pos,zero_vel); GamePersistent().ps_needtoplay.push_back(ps); }; virtual bool obsolete ()const{return false;} diff --git a/src/xr_3da/xrGame/problem_solver.h b/src/xr_3da/xrGame/problem_solver.h index 6bb10933..43d23f2c 100644 --- a/src/xr_3da/xrGame/problem_solver.h +++ b/src/xr_3da/xrGame/problem_solver.h @@ -102,7 +102,7 @@ class CProblemSolver { private: template struct helper { - static IC _edge_value_type estimate_edge_weight_impl( self_type const& self_, const _index_type &vertex_index) {return self_.estimate_edge_weight_impl(vertex_index);} + static IC _edge_value_type estimate_edge_weight_impl( self_type const& self, const _index_type &vertex_index) {return self.estimate_edge_weight_impl(vertex_index);} }; // struct helper template <> diff --git a/src/xr_3da/xrGame/problem_solver_inline.h b/src/xr_3da/xrGame/problem_solver_inline.h index 372702d2..6a565e28 100644 --- a/src/xr_3da/xrGame/problem_solver_inline.h +++ b/src/xr_3da/xrGame/problem_solver_inline.h @@ -388,14 +388,14 @@ TEMPLATE_SPECIALIZATION IC typename CProblemSolverAbstract::_edge_value_type CProblemSolverAbstract::estimate_edge_weight_impl (const _index_type &condition) const { STATIC_CHECK (!reverse_search,This_function_cannot_be_used_in_the_REVERSE_search); - _edge_value_type result_ = 0; + _edge_value_type result = 0; xr_vector::const_iterator I = target_state().conditions().begin(); xr_vector::const_iterator E = target_state().conditions().end(); xr_vector::const_iterator i = condition.conditions().begin(); xr_vector::const_iterator e = condition.conditions().end(); for ( ; (I != E) && (i != e); ) if ((*I).condition() < (*i).condition()) { - ++result_; + ++result; ++I; } else @@ -403,11 +403,11 @@ IC typename CProblemSolverAbstract::_edge_value_type CProblemSolverAbstract::est ++i; else { if ((*I).value() != (*i).value()) - ++result_; + ++result; ++I; ++i; } - return (result_ + _edge_value_type(E - I)); + return (result + _edge_value_type(E - I)); } TEMPLATE_SPECIALIZATION diff --git a/src/xr_3da/xrGame/profiler.cpp b/src/xr_3da/xrGame/profiler.cpp index 1c41b7e1..94c0521b 100644 --- a/src/xr_3da/xrGame/profiler.cpp +++ b/src/xr_3da/xrGame/profiler.cpp @@ -200,14 +200,14 @@ void CProfiler::show_stats (CGameFont *game_font, bool show) if (!m_actual) { u32 max_string_size = 0; - TIMERS::iterator I_ = m_timers.begin(); - TIMERS::iterator E_ = m_timers.end(); - for ( ; I_ != E_; ++I_) - max_string_size = _max(max_string_size,compute_string_length(*(*I_).first)); - - I_ = m_timers.begin(); - for ( ; I_ != E_; ++I_) - convert_string (*(*I_).first,(*I_).second.m_name,max_string_size); + TIMERS::iterator I = m_timers.begin(); + TIMERS::iterator E = m_timers.end(); + for ( ; I != E; ++I) + max_string_size = _max(max_string_size,compute_string_length(*(*I).first)); + + I = m_timers.begin(); + for ( ; I != E; ++I) + convert_string (*(*I).first,(*I).second.m_name,max_string_size); m_actual = true; } diff --git a/src/xr_3da/xrGame/profiler.h b/src/xr_3da/xrGame/profiler.h index 7f125776..27175573 100644 --- a/src/xr_3da/xrGame/profiler.h +++ b/src/xr_3da/xrGame/profiler.h @@ -49,9 +49,9 @@ struct CProfileStats { class CProfiler { private: struct pred_rstr { - IC bool operator() (const shared_str& object1, const shared_str& object2) const + IC bool operator() (const shared_str &_1, const shared_str &_2) const { - return (xr_strcmp(*object1, *object2) < 0); + return (xr_strcmp(*_1,*_2) < 0); } }; protected: diff --git a/src/xr_3da/xrGame/quadtree_inline.h b/src/xr_3da/xrGame/quadtree_inline.h index 28fd62fe..eb89f0ce 100644 --- a/src/xr_3da/xrGame/quadtree_inline.h +++ b/src/xr_3da/xrGame/quadtree_inline.h @@ -21,7 +21,7 @@ IC CSQuadTree::CQuadTree (const Fbox &box, float min_cell_size, u32 max_node_co VERIFY (!fis_zero(min_cell_size)); VERIFY (m_radius > min_cell_size); - m_max_depth = iFloor((float) log(2.f*m_radius/min_cell_size)/ (float) log(2.f) + .5f); + m_max_depth = iFloor(log(2.f*m_radius/min_cell_size)/log(2.f) + .5f); m_nodes = xr_new(max_node_count); m_list_items = xr_new(max_list_item_count); @@ -282,7 +282,7 @@ IC void CSQuadTree::all (xr_vector<_object_type*> &objects, CQuadNode *node, in } TEMPLATE_SPECIALIZATION -IC void CSQuadTree::all (xr_vector<_object_type*> &objects, bool clear) const +IC void CSQuadTree::all (xr_vector<_object_type*> &objects, bool clear = true) const { if (clear) objects.clear (); diff --git a/src/xr_3da/xrGame/saved_game_wrapper_script.cpp b/src/xr_3da/xrGame/saved_game_wrapper_script.cpp index 7b30d771..44668fd2 100644 --- a/src/xr_3da/xrGame/saved_game_wrapper_script.cpp +++ b/src/xr_3da/xrGame/saved_game_wrapper_script.cpp @@ -14,14 +14,14 @@ using namespace luabind; -xrTime CSavedGameWrapper__game_time (const CSavedGameWrapper *self_) +xrTime CSavedGameWrapper__game_time (const CSavedGameWrapper *self) { - return (xrTime(self_->game_time())); + return (xrTime(self->game_time())); } -LPCSTR CSavedGameWrapper__level_name (const CSavedGameWrapper *self_) +LPCSTR CSavedGameWrapper__level_name (const CSavedGameWrapper *self) { - return (*ai().game_graph().header().level(self_->level_id()).name()); + return (*ai().game_graph().header().level(self->level_id()).name()); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/script_effector_script.cpp b/src/xr_3da/xrGame/script_effector_script.cpp index 4f23bcca..ad68dd9e 100644 --- a/src/xr_3da/xrGame/script_effector_script.cpp +++ b/src/xr_3da/xrGame/script_effector_script.cpp @@ -12,19 +12,19 @@ using namespace luabind; -void SPPInfo_assign(SPPInfo *self_, SPPInfo *obj) +void SPPInfo_assign(SPPInfo *self, SPPInfo *obj) { - *self_ = *obj; + *self = *obj; } -void add_effector(CScriptEffector *self_) +void add_effector(CScriptEffector *self) { - self_->Add (); + self->Add (); } -void remove_effector(CScriptEffector *self_) +void remove_effector(CScriptEffector *self) { - self_->Remove (); + self->Remove (); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/script_engine_script.cpp b/src/xr_3da/xrGame/script_engine_script.cpp index 9a6aa6b9..91482542 100644 --- a/src/xr_3da/xrGame/script_engine_script.cpp +++ b/src/xr_3da/xrGame/script_engine_script.cpp @@ -154,18 +154,18 @@ struct profile_timer_script { IC float time () const { FPU::m64r (); - float result_ = (float(double(m_accumulator)/double(CPU::clk_per_second))*1000000.f); + float result = (float(double(m_accumulator)/double(CPU::clk_per_second))*1000000.f); FPU::m24r (); - return (result_); + return (result); } }; IC profile_timer_script operator+ (const profile_timer_script &portion0, const profile_timer_script &portion1) { - profile_timer_script result_; - result_.m_accumulator = portion0.m_accumulator + portion1.m_accumulator; - result_.m_count = portion0.m_count + portion1.m_count; - return (result_); + profile_timer_script result; + result.m_accumulator = portion0.m_accumulator + portion1.m_accumulator; + result.m_count = portion0.m_count + portion1.m_count; + return (result); } //IC std::ostream& operator<<(std::ostream &stream, profile_timer_script &timer) diff --git a/src/xr_3da/xrGame/script_entity.cpp b/src/xr_3da/xrGame/script_entity.cpp index 7a8bf41b..9d50978f 100644 --- a/src/xr_3da/xrGame/script_entity.cpp +++ b/src/xr_3da/xrGame/script_entity.cpp @@ -403,8 +403,8 @@ bool CScriptEntity::bfAssignParticles(CScriptEntityAction *tpEntityAction) if (true/** !l_tParticleAction.m_tpParticleSystem/**/) if (!l_tParticleAction.m_bStartedToPlay) { const Fmatrix &l_tMatrix = GetUpdatedMatrix(*l_tParticleAction.m_caBoneName,l_tParticleAction.m_tParticlePosition,l_tParticleAction.m_tParticleAngles); - Fvector zero_vel_={0.f,0.f,0.f}; - l_tParticleAction.m_tpParticleSystem->UpdateParent(l_tMatrix,zero_vel_); + Fvector zero_vel={0.f,0.f,0.f}; + l_tParticleAction.m_tpParticleSystem->UpdateParent(l_tMatrix,zero_vel); l_tParticleAction.m_tpParticleSystem->play_at_pos(l_tMatrix.c); l_tParticleAction.m_bStartedToPlay = true; } diff --git a/src/xr_3da/xrGame/script_fmatrix_script.cpp b/src/xr_3da/xrGame/script_fmatrix_script.cpp index 20163514..6337a9b5 100644 --- a/src/xr_3da/xrGame/script_fmatrix_script.cpp +++ b/src/xr_3da/xrGame/script_fmatrix_script.cpp @@ -10,13 +10,13 @@ #include "script_fmatrix.h" using namespace luabind; -void get_matrix_hpb(Fmatrix* self_, float* h, float* p, float* b) +void get_matrix_hpb(Fmatrix* self, float* h, float* p, float* b) { - self_->getHPB (*h, *p, *b); + self->getHPB (*h, *p, *b); } -void matrix_transform (Fmatrix* self_, Fvector* v) +void matrix_transform (Fmatrix* self, Fvector* v) { - self_->transform (*v); + self->transform (*v); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/script_ini_file_script.cpp b/src/xr_3da/xrGame/script_ini_file_script.cpp index e4b34a6a..e2b164a2 100644 --- a/src/xr_3da/xrGame/script_ini_file_script.cpp +++ b/src/xr_3da/xrGame/script_ini_file_script.cpp @@ -23,17 +23,17 @@ CScriptIniFile *get_game_ini() } #endif // XRGAME_EXPORTS -bool r_line(CScriptIniFile *self_, LPCSTR S, int L, xr_string &N, xr_string &V) +bool r_line(CScriptIniFile *self, LPCSTR S, int L, xr_string &N, xr_string &V) { - THROW3 (self_->section_exist(S),"Cannot find section",S); - THROW2 ((int)self_->line_count(S) > L,"Invalid line number"); + THROW3 (self->section_exist(S),"Cannot find section",S); + THROW2 ((int)self->line_count(S) > L,"Invalid line number"); N = ""; V = ""; LPCSTR n,v; - bool result_ = !!self_->r_line(S,L,&n,&v); - if (!result_) + bool result = !!self->r_line(S,L,&n,&v); + if (!result) return (false); N = n; diff --git a/src/xr_3da/xrGame/script_lua_helper.cpp b/src/xr_3da/xrGame/script_lua_helper.cpp index 9b533581..33dfeaea 100644 --- a/src/xr_3da/xrGame/script_lua_helper.cpp +++ b/src/xr_3da/xrGame/script_lua_helper.cpp @@ -46,10 +46,10 @@ void CDbgLuaHelper::PrepareLuaBind() } -int CDbgLuaHelper::OutputTop(lua_State* L_) +int CDbgLuaHelper::OutputTop(lua_State* L) { if(!m_pThis)return 0; - m_pThis->debugger()->Write(luaL_checkstring(L_, -1)); + m_pThis->debugger()->Write(luaL_checkstring(L, -1)); m_pThis->debugger()->Write("\n"); return 0; } diff --git a/src/xr_3da/xrGame/script_net_packet_script.cpp b/src/xr_3da/xrGame/script_net_packet_script.cpp index 431a0b99..2c455b41 100644 --- a/src/xr_3da/xrGame/script_net_packet_script.cpp +++ b/src/xr_3da/xrGame/script_net_packet_script.cpp @@ -12,32 +12,32 @@ using namespace luabind; -bool r_eof(NET_Packet *self_) +bool r_eof(NET_Packet *self) { - return (!!self_->r_eof()); + return (!!self->r_eof()); } -LPCSTR r_stringZ(NET_Packet *self_) +LPCSTR r_stringZ(NET_Packet *self) { shared_str temp; - self_->r_stringZ (temp); + self->r_stringZ (temp); return (*temp); } -void w_bool(NET_Packet *self_, bool value) +void w_bool(NET_Packet *self, bool value) { - self_->w_u8 (value ? 1 : 0); + self->w_u8 (value ? 1 : 0); } -bool r_bool(NET_Packet *self_) +bool r_bool(NET_Packet *self) { - return (!!self_->r_u8()); + return (!!self->r_u8()); } -ClientID r_clientID(NET_Packet *self_) +ClientID r_clientID(NET_Packet *self) { ClientID clientID; - self_->r_clientID(clientID); + self->r_clientID(clientID); return clientID; } diff --git a/src/xr_3da/xrGame/script_reader_script.cpp b/src/xr_3da/xrGame/script_reader_script.cpp index aa6e8452..2e8439f0 100644 --- a/src/xr_3da/xrGame/script_reader_script.cpp +++ b/src/xr_3da/xrGame/script_reader_script.cpp @@ -11,26 +11,26 @@ using namespace luabind; -bool r_eof(IReader *self_) +bool r_eof(IReader *self) { - return (!!self_->eof()); + return (!!self->eof()); } -LPCSTR r_stringZ(IReader *self_) +LPCSTR r_stringZ(IReader *self) { shared_str temp; - self_->r_stringZ (temp); + self->r_stringZ (temp); return (*temp); } -bool r_bool(IReader *self_) +bool r_bool(IReader *self) { - return (!!self_->r_u8()); + return (!!self->r_u8()); } -void r_fvector3(IReader *self_, Fvector *arg0) +void r_fvector3(IReader *self, Fvector *arg0) { - self_->r_fvector3(*arg0); + self->r_fvector3(*arg0); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/script_render_device_script.cpp b/src/xr_3da/xrGame/script_render_device_script.cpp index 88a41f32..d2687b52 100644 --- a/src/xr_3da/xrGame/script_render_device_script.cpp +++ b/src/xr_3da/xrGame/script_render_device_script.cpp @@ -27,10 +27,10 @@ bool is_app_ready() return !!g_appLoaded; } -u32 time_global(const CRenderDevice *self_) +u32 time_global(const CRenderDevice *self) { - THROW (self_); - return (self_->dwTimeGlobal); + THROW (self); + return (self->dwTimeGlobal); } #pragma optimize("s",on) diff --git a/src/xr_3da/xrGame/script_sound.cpp b/src/xr_3da/xrGame/script_sound.cpp index 86b2d76e..9eb25dcf 100644 --- a/src/xr_3da/xrGame/script_sound.cpp +++ b/src/xr_3da/xrGame/script_sound.cpp @@ -27,7 +27,7 @@ CScriptSound::CScriptSound (LPCSTR caSoundName, ESoundTypes sound_type) } } -CScriptSound::~CScriptSound () noexcept(false) +CScriptSound::~CScriptSound () { THROW3 (!m_sound._feedback(),"playing sound is not completed, but is destroying",m_sound._handle() ? m_sound._handle()->file_name() : "unknown"); m_sound.destroy (); diff --git a/src/xr_3da/xrGame/script_sound.h b/src/xr_3da/xrGame/script_sound.h index 02db2069..4a746211 100644 --- a/src/xr_3da/xrGame/script_sound.h +++ b/src/xr_3da/xrGame/script_sound.h @@ -21,7 +21,7 @@ class CScriptSound { public: CScriptSound (LPCSTR caSoundName, ESoundTypes sound_type = SOUND_TYPE_NO_SOUND); - virtual ~CScriptSound () noexcept(false); + virtual ~CScriptSound (); IC u32 Length (); IC void Play (CScriptGameObject *object); IC void Play (CScriptGameObject *object, float delay); diff --git a/src/xr_3da/xrGame/sound_player.cpp b/src/xr_3da/xrGame/sound_player.cpp index 3051d941..b297783d 100644 --- a/src/xr_3da/xrGame/sound_player.cpp +++ b/src/xr_3da/xrGame/sound_player.cpp @@ -249,17 +249,17 @@ CSoundPlayer::CSoundCollection::CSoundCollection (const CSoundCollectionParams & _GetItem (*params.m_sound_prefix,j,temp); strconcat (sizeof(s),S,*params.m_sound_player_prefix,temp); if (FS.exist(fn,"$game_sounds$",S,".ogg")) { - ref_sound *temp_ = add(params.m_type,S); - if (temp_) - m_sounds.push_back (temp_); + ref_sound *temp = add(params.m_type,S); + if (temp) + m_sounds.push_back (temp); } for (u32 i=0; ipos[2] = pos[2]; contact->depth = outDepth; //} - for (u32 i_=0; i_g1 = 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; + 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/xr_3da/xrGame/tri-colliderknoopc/dTriCylinder.cpp b/src/xr_3da/xrGame/tri-colliderknoopc/dTriCylinder.cpp index 27a4f2b9..82ac2cd1 100644 --- a/src/xr_3da/xrGame/tri-colliderknoopc/dTriCylinder.cpp +++ b/src/xr_3da/xrGame/tri-colliderknoopc/dTriCylinder.cpp @@ -14,19 +14,19 @@ bool dcTriListCollider::circleLineIntersection(const dReal* cn,const dReal* cp,d 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 A,B,C,B_A,B_A_2,D; dReal t1,t2; A=dDOT(lv,lv); - B_=dDOT(LC,lv); + B=dDOT(LC,lv); C=dDOT(LC,LC)-r*r; - B_A=B_/A; + 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_; + point[0]=lp[0]-lv[0]*B; + point[1]=lp[1]-lv[1]*B; + point[2]=lp[2]-lv[2]*B; return false; } diff --git a/src/xr_3da/xrGame/tri-colliderknoopc/dTriSphere.cpp b/src/xr_3da/xrGame/tri-colliderknoopc/dTriSphere.cpp index b0ae884e..5cdbb0fd 100644 --- a/src/xr_3da/xrGame/tri-colliderknoopc/dTriSphere.cpp +++ b/src/xr_3da/xrGame/tri-colliderknoopc/dTriSphere.cpp @@ -128,7 +128,7 @@ int dcTriListCollider::dSortedTriSphere(const dReal* /**v1/**/,const dReal* /**v CDB::TRI* T, dReal dist, dxGeom* Sphere, - dxGeom* Geometry_, + dxGeom* Geometry, int Flags, dContactGeom* Contacts, int skip @@ -158,7 +158,7 @@ int dcTriListCollider::dSortedTriSphere(const dReal* /**v1/**/,const dReal* /**v Contacts->pos[0]=ContactPos[0]; Contacts->pos[1]=ContactPos[1]; Contacts->pos[2]=ContactPos[2]; - Contacts->g1 = Geometry_; + Contacts->g1 = Geometry; Contacts->g2 = Sphere; ((dxGeomUserData*)dGeomGetData(Sphere))->tri_material=T->material; if(dGeomGetUserData(Sphere)->callback)dGeomGetUserData(Sphere)->callback(T,Contacts); @@ -174,7 +174,7 @@ int dcTriListCollider::dSortedTriSphere(const dReal* /**v1/**/,const dReal* /**v int dcTriListCollider::dTriSphere(const dReal* v0,const dReal* v1,const dReal* v2, Triangle* T, - dxGeom* Sphere,dxGeom* Geometry_, int Flags, + dxGeom* Sphere,dxGeom* Geometry, int Flags, dContactGeom* Contacts,int /**skip/**/) { @@ -242,7 +242,7 @@ int dcTriListCollider::dTriSphere(const dReal* v0,const dReal* v1,const dReal* v 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->g1 = Geometry; Contacts->g2 = Sphere; ((dxGeomUserData*)dGeomGetData(Sphere))->tri_material=T->T->material; if(dGeomGetUserData(Sphere)->callback)dGeomGetUserData(Sphere)->callback(T->T,Contacts); diff --git a/src/xr_3da/xrGame/ui/Restrictions.cpp b/src/xr_3da/xrGame/ui/Restrictions.cpp index 0dd1ee44..73db67d3 100644 --- a/src/xr_3da/xrGame/ui/Restrictions.cpp +++ b/src/xr_3da/xrGame/ui/Restrictions.cpp @@ -241,16 +241,16 @@ void CRestrictions::Dump() const for(u32 i=0; i<_RANK_COUNT+1; ++i) { const rank_rest_vec& v = m_restrictions[i]; - rank_rest_vec::const_iterator it_ = v.begin(); - rank_rest_vec::const_iterator it_e_ = v.end(); + rank_rest_vec::const_iterator it = v.begin(); + rank_rest_vec::const_iterator it_e = v.end(); if(i<_RANK_COUNT) Msg("--- for rank %d ---count=[%d]", i, v.size()); else Msg("--- base restrictions ---count=[%d]", v.size()); - for(;it_!=it_e_;++it_) + for(;it!=it_e;++it) { - Msg(" [%s]:[%d]", (*it_).first.c_str(), (*it_).second); + Msg(" [%s]:[%d]", (*it).first.c_str(), (*it).second); } Msg("-----------------------------------------"); } diff --git a/src/xr_3da/xrGame/ui/UIBagWnd.cpp b/src/xr_3da/xrGame/ui/UIBagWnd.cpp index cde56c79..0145f318 100644 --- a/src/xr_3da/xrGame/ui/UIBagWnd.cpp +++ b/src/xr_3da/xrGame/ui/UIBagWnd.cpp @@ -312,7 +312,7 @@ void CUIBagWnd::FillUpGroup(const u32 group) CUICellItem* itm = CreateItem(sect); // Set custom draw - _itoa (j+1, tmp_str ,10); + itoa (j+1, tmp_str ,10); CBuyItemCustomDrawCell* p = xr_new(tmp_str,UI()->Font()->pFontLetterica16Russian); itm->SetCustomDraw (p); @@ -358,9 +358,9 @@ void CUIBagWnd::ReloadItemsPrices () m_info[itm->m_index].price = pSettings->r_u32(m_sectionPrice, ItemCostStr); - for (u32 i_=1; i_<=g_mp_restrictions.GetRank(); ++i_) + for (u32 i=1; i<=g_mp_restrictions.GetRank(); ++i) { - sprintf_s (RankStr, "rank_%d", i_); + sprintf_s (RankStr, "rank_%d", i); if (!pSettings->line_exist (RankStr, ItemCostStr)) continue; m_info[itm->m_index].price = pSettings->r_u32(RankStr, ItemCostStr); } diff --git a/src/xr_3da/xrGame/ui/UIBuyWnd.cpp b/src/xr_3da/xrGame/ui/UIBuyWnd.cpp index 68884bc5..799c4163 100644 --- a/src/xr_3da/xrGame/ui/UIBuyWnd.cpp +++ b/src/xr_3da/xrGame/ui/UIBuyWnd.cpp @@ -930,13 +930,13 @@ void CUIBuyWnd::ActivatePropertiesBox() m_propertiesBox.AutoUpdateSize (); m_propertiesBox.BringAllToTop (); - Fvector2 cursor_pos_; + Fvector2 cursor_pos; Frect vis_rect; GetAbsoluteRect (vis_rect); - cursor_pos_ = GetUICursor()->GetCursorPosition(); - cursor_pos_.sub (vis_rect.lt); - m_propertiesBox.Show (vis_rect, cursor_pos_); + cursor_pos = GetUICursor()->GetCursorPosition(); + cursor_pos.sub (vis_rect.lt); + m_propertiesBox.Show (vis_rect, cursor_pos); } diff --git a/src/xr_3da/xrGame/ui/UICarBodyWnd.cpp b/src/xr_3da/xrGame/ui/UICarBodyWnd.cpp index 2f95e18f..8698dfd2 100644 --- a/src/xr_3da/xrGame/ui/UICarBodyWnd.cpp +++ b/src/xr_3da/xrGame/ui/UICarBodyWnd.cpp @@ -438,13 +438,13 @@ void CUICarBodyWnd::ActivatePropertiesBox() m_pUIPropertiesBox->AutoUpdateSize (); m_pUIPropertiesBox->BringAllToTop (); - Fvector2 cursor_pos_; + 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_); + cursor_pos = GetUICursor()->GetCursorPosition(); + cursor_pos.sub (vis_rect.lt); + m_pUIPropertiesBox->Show (vis_rect, cursor_pos); } } diff --git a/src/xr_3da/xrGame/ui/UIEditKeyBind.cpp b/src/xr_3da/xrGame/ui/UIEditKeyBind.cpp index 10dd0921..5a668fb8 100644 --- a/src/xr_3da/xrGame/ui/UIEditKeyBind.cpp +++ b/src/xr_3da/xrGame/ui/UIEditKeyBind.cpp @@ -68,9 +68,9 @@ void CUIEditKeyBind::Init(float x, float y, float width, float height) InitTexture ("ui_options_string"); } -void CUIEditKeyBind::InitTexture(LPCSTR texture, bool bHorizontal_) +void CUIEditKeyBind::InitTexture(LPCSTR texture, bool bHorizontal) { - CUILabel::InitTexture(texture,bHorizontal_); + CUILabel::InitTexture(texture,bHorizontal); } void CUIEditKeyBind::OnFocusLost() diff --git a/src/xr_3da/xrGame/ui/UIEventsWnd.cpp b/src/xr_3da/xrGame/ui/UIEventsWnd.cpp index 75e29591..5120a2f1 100644 --- a/src/xr_3da/xrGame/ui/UIEventsWnd.cpp +++ b/src/xr_3da/xrGame/ui/UIEventsWnd.cpp @@ -258,9 +258,9 @@ void CUIEventsWnd::ShowDescription (CGameTask* t, int idx) }else if(o.article_id.size() && it->article_id ==o.article_id) { - CEncyclopediaArticle A_; - A_.Load (it->article_id); - m_UITaskInfoWnd->AddArticle (&A_); + CEncyclopediaArticle A; + A.Load (it->article_id); + m_UITaskInfoWnd->AddArticle (&A); } } } diff --git a/src/xr_3da/xrGame/ui/UIInventoryWnd.cpp b/src/xr_3da/xrGame/ui/UIInventoryWnd.cpp index 148ee89e..6fefd1ff 100644 --- a/src/xr_3da/xrGame/ui/UIInventoryWnd.cpp +++ b/src/xr_3da/xrGame/ui/UIInventoryWnd.cpp @@ -340,10 +340,10 @@ void CUIInventoryWnd::Hide() if (!IsGameTypeSingle()) { - CActor *pActor_ = smart_cast(Level().CurrentEntity()); - if(!pActor_) return; + CActor *pActor = smart_cast(Level().CurrentEntity()); + if(!pActor) return; - pActor_->SetWeaponHideState(INV_STATE_INV_WND, false); + pActor->SetWeaponHideState(INV_STATE_INV_WND, false); } } diff --git a/src/xr_3da/xrGame/ui/UIInventoryWnd3.cpp b/src/xr_3da/xrGame/ui/UIInventoryWnd3.cpp index 23471a8e..f953213f 100644 --- a/src/xr_3da/xrGame/ui/UIInventoryWnd3.cpp +++ b/src/xr_3da/xrGame/ui/UIInventoryWnd3.cpp @@ -202,12 +202,12 @@ void CUIInventoryWnd::ActivatePropertiesBox() UIPropertiesBox.AutoUpdateSize (); UIPropertiesBox.BringAllToTop (); - Fvector2 cursor_pos_; + Fvector2 cursor_pos; Frect vis_rect; GetAbsoluteRect (vis_rect); - cursor_pos_ = GetUICursor()->GetCursorPosition(); - cursor_pos_.sub (vis_rect.lt); - UIPropertiesBox.Show (vis_rect, cursor_pos_); + cursor_pos = GetUICursor()->GetCursorPosition(); + cursor_pos.sub (vis_rect.lt); + UIPropertiesBox.Show (vis_rect, cursor_pos); PlaySnd (eInvProperties); } } diff --git a/src/xr_3da/xrGame/ui/UIListWnd.cpp b/src/xr_3da/xrGame/ui/UIListWnd.cpp index 54afe4c1..bdfd5981 100644 --- a/src/xr_3da/xrGame/ui/UIListWnd.cpp +++ b/src/xr_3da/xrGame/ui/UIListWnd.cpp @@ -150,9 +150,9 @@ void CUIListWnd::RemoveItem(int index) // int i=0; - for(LIST_ITEM_LIST_it it_=m_ItemList.begin(); m_ItemList.end() != it_; ++it_,i++) + for(LIST_ITEM_LIST_it it=m_ItemList.begin(); m_ItemList.end() != it; ++it,i++) { - (*it_)->SetIndex(i); + (*it)->SetIndex(i); } } diff --git a/src/xr_3da/xrGame/ui/UIMapWnd.cpp b/src/xr_3da/xrGame/ui/UIMapWnd.cpp index 892db11a..e86de46d 100644 --- a/src/xr_3da/xrGame/ui/UIMapWnd.cpp +++ b/src/xr_3da/xrGame/ui/UIMapWnd.cpp @@ -394,9 +394,9 @@ bool CUIMapWnd::OnKeyboard (int dik, EUIMessages keyboard_action) bool CUIMapWnd::OnMouse(float x, float y, EUIMessages mouse_action) { if(inherited::OnMouse(x,y,mouse_action)) return true; - Fvector2 cursor_pos_ = GetUICursor()->GetCursorPosition(); + Fvector2 cursor_pos = GetUICursor()->GetCursorPosition(); - if(GlobalMap() && !GlobalMap()->Locked() && ActiveMapRect().in( cursor_pos_ ) ){ + if(GlobalMap() && !GlobalMap()->Locked() && ActiveMapRect().in( cursor_pos ) ){ switch (mouse_action) { case WINDOW_MOUSE_MOVE: @@ -465,7 +465,7 @@ bool CUIMapWnd::OnMouse(float x, float y, EUIMessages mouse_action) if(!fsimilar(_prev_zoom, GetZoom())) { - m_tgtCenter = cursor_pos_; + m_tgtCenter = cursor_pos; Fvector2 _p; gm->GetAbsolutePos(_p); m_tgtCenter.sub (_p); m_tgtCenter.div (gm->GetCurrentZoom()); diff --git a/src/xr_3da/xrGame/ui/UIMotionIcon.cpp b/src/xr_3da/xrGame/ui/UIMotionIcon.cpp index ee6ef768..13204a8e 100644 --- a/src/xr_3da/xrGame/ui/UIMotionIcon.cpp +++ b/src/xr_3da/xrGame/ui/UIMotionIcon.cpp @@ -143,9 +143,9 @@ void CUIMotionIcon::SetActorVisibility (u16 who_id, float value) if(it==m_npc_visibility.end() && value!=0) { m_npc_visibility.resize (m_npc_visibility.size()+1); - _npc_visibility& v_ = m_npc_visibility.back(); - v_.id = who_id; - v_.value = value; + _npc_visibility& v = m_npc_visibility.back(); + v.id = who_id; + v.value = value; } else if( fis_zero(value) ) { diff --git a/src/xr_3da/xrGame/ui/UIMpTradeWnd_items.cpp b/src/xr_3da/xrGame/ui/UIMpTradeWnd_items.cpp index 272549a7..d1e900b3 100644 --- a/src/xr_3da/xrGame/ui/UIMpTradeWnd_items.cpp +++ b/src/xr_3da/xrGame/ui/UIMpTradeWnd_items.cpp @@ -470,9 +470,9 @@ void CUIMpTradeWnd::ApplyPreset(ETradePreset idx) { if(_one.addon_state) { - for(u32 i_=0; i_<3; ++i_) + for(u32 i=0; i<3; ++i) { - item_addon_type at = (i_==0)?at_scope : ((i_==1)?at_glauncher : at_silencer); + item_addon_type at = (i==0)?at_scope : ((i==1)?at_glauncher : at_silencer); if(!(_one.addon_state&at) ) continue; diff --git a/src/xr_3da/xrGame/ui/UIScrollBar.cpp b/src/xr_3da/xrGame/ui/UIScrollBar.cpp index 1d9be984..5577833f 100644 --- a/src/xr_3da/xrGame/ui/UIScrollBar.cpp +++ b/src/xr_3da/xrGame/ui/UIScrollBar.cpp @@ -161,19 +161,19 @@ bool CUIScrollBar::OnKeyboardHold(int dik) { if(dik==MOUSE_1 && (last_hold_time+100)GetCursorPosition(); + Fvector2 cursor_pos = GetUICursor()->GetCursorPosition(); Frect dec_rect; Frect inc_rect; m_DecButton->GetAbsoluteRect(dec_rect); m_IncButton->GetAbsoluteRect(inc_rect); - if(dec_rect.in(cursor_pos_)) + if(dec_rect.in(cursor_pos)) { TryScrollDec (); last_hold_time = Device.dwTimeContinual; return true; }else - if(inc_rect.in(cursor_pos_)) + if(inc_rect.in(cursor_pos)) { TryScrollInc (); last_hold_time = Device.dwTimeContinual; diff --git a/src/xr_3da/xrGame/ui/UITalkWnd.cpp b/src/xr_3da/xrGame/ui/UITalkWnd.cpp index 70441bf5..e8099968 100644 --- a/src/xr_3da/xrGame/ui/UITalkWnd.cpp +++ b/src/xr_3da/xrGame/ui/UITalkWnd.cpp @@ -291,7 +291,7 @@ void CUITalkWnd::AskQuestion() { string128 s; - sprintf_s (s,"ID = [%s] of selected question is out of range of available dialogs ",UITalkDialogWnd->m_ClickedQuestionID.c_str()); + sprintf_s (s,"ID = [%s] of selected question is out of range of available dialogs ",UITalkDialogWnd->m_ClickedQuestionID); VERIFY2(FALSE, s); } diff --git a/src/xr_3da/xrGame/ui/UITreeViewItem.cpp b/src/xr_3da/xrGame/ui/UITreeViewItem.cpp index 3248746d..db81510c 100644 --- a/src/xr_3da/xrGame/ui/UITreeViewItem.cpp +++ b/src/xr_3da/xrGame/ui/UITreeViewItem.cpp @@ -402,19 +402,19 @@ void CUITreeViewItem::MarkArticleAsRead(bool value) ////////////////////////////////////////////////////////////////////////// -void CUITreeViewItem::CheckParentMark(CUITreeViewItem *pOwner_) +void CUITreeViewItem::CheckParentMark(CUITreeViewItem *pOwner) { // , , 1 // , , . bool f = false; - if (pOwner_ && pOwner_->IsRoot()) + if (pOwner && pOwner->IsRoot()) { - for (SubItems_it it = pOwner_->vSubItems.begin(); it != pOwner_->vSubItems.end(); ++it) + for (SubItems_it it = pOwner->vSubItems.begin(); it != pOwner->vSubItems.end(); ++it) { if (!(*it)->IsArticleReaded()) { - pOwner_->m_bArticleRead = false; - pOwner_->SetItemColor(); + pOwner->m_bArticleRead = false; + pOwner->SetItemColor(); f = true; } } @@ -422,11 +422,11 @@ void CUITreeViewItem::CheckParentMark(CUITreeViewItem *pOwner_) if (!f) { // , , - pOwner_->m_bArticleRead = true; - pOwner_->SetItemColor(); + pOwner->m_bArticleRead = true; + pOwner->SetItemColor(); } - pOwner_->CheckParentMark(pOwner_->GetOwner()); + pOwner->CheckParentMark(pOwner->GetOwner()); } } diff --git a/src/xr_3da/xrGame/ui/UIVote.cpp b/src/xr_3da/xrGame/ui/UIVote.cpp index 92a78677..33c9a6f7 100644 --- a/src/xr_3da/xrGame/ui/UIVote.cpp +++ b/src/xr_3da/xrGame/ui/UIVote.cpp @@ -99,9 +99,9 @@ void CUIVote::Update() } } -void CUIVote::SendMessage(CUIWindow* pWnd, s16 msg_, void* pData) +void CUIVote::SendMessage(CUIWindow* pWnd, s16 msg, void* pData) { - if (BUTTON_CLICKED == msg_) + if (BUTTON_CLICKED == msg) { if (btn_yes == pWnd) OnBtnYes(); diff --git a/src/xr_3da/xrGame/ui/UIWindow.cpp b/src/xr_3da/xrGame/ui/UIWindow.cpp index e4bc80b6..7ed5636a 100644 --- a/src/xr_3da/xrGame/ui/UIWindow.cpp +++ b/src/xr_3da/xrGame/ui/UIWindow.cpp @@ -197,9 +197,9 @@ void CUIWindow::Update() cursor_on_window = !!r.in(temp); #ifndef NDEBUG if(cursor_on_window&&g_show_wnd_rect){ - Frect r_; - GetAbsoluteRect(r_); - add_rect_to_draw(r_); + Frect r; + GetAbsoluteRect(r); + add_rect_to_draw(r); } #endif // RECEIVE and LOST focus @@ -345,8 +345,8 @@ bool CUIWindow::OnMouse(float x, float y, EUIMessages mouse_action) for(; it!=m_ChildWndList.rend(); ++it) { CUIWindow* w = (*it); - Frect wndRect_ = w->GetWndRect(); - if (wndRect_.in(cursor_pos) ) + Frect wndRect = w->GetWndRect(); + if (wndRect.in(cursor_pos) ) { if(w->IsEnabled()) { diff --git a/src/xr_3da/xrGame/visual_memory_manager.cpp b/src/xr_3da/xrGame/visual_memory_manager.cpp index 605b3b24..2469f7fa 100644 --- a/src/xr_3da/xrGame/visual_memory_manager.cpp +++ b/src/xr_3da/xrGame/visual_memory_manager.cpp @@ -222,8 +222,8 @@ float CVisualMemoryManager::object_visible_distance(const CGameObject *game_obje } else { Fvector dummy; - float float0,float1; - m_client->camera (eye_position,eye_direction,dummy,object_fov,float0,float1,object_range); + float _0,_1; + m_client->camera (eye_position,eye_direction,dummy,object_fov,_0,_1,object_range); } Fvector object_direction; @@ -255,8 +255,8 @@ float CVisualMemoryManager::object_luminocity (const CGameObject *game_object) c if (game_object->CLS_ID != CLSID_OBJECT_ACTOR) return (1.f); float luminocity = const_cast(game_object)->ROS()->get_luminocity(); - float power = (float) log(luminocity > .001f ? luminocity : .001f)*current_state().m_luminocity_factor; - return ((float) exp(power)); + float power = log(luminocity > .001f ? luminocity : .001f)*current_state().m_luminocity_factor; + return (exp(power)); } float CVisualMemoryManager::get_object_velocity (const CGameObject *game_object, const CNotYetVisibleObject ¬_yet_visible_object) const diff --git a/src/xr_3da/xrGame/xml_str_id_loader.h b/src/xr_3da/xrGame/xml_str_id_loader.h index 080ca264..d80405cf 100644 --- a/src/xr_3da/xrGame/xml_str_id_loader.h +++ b/src/xr_3da/xrGame/xml_str_id_loader.h @@ -106,8 +106,8 @@ const typename ITEM_DATA* CSXML_IdToIndex::GetById (const shared_str& str_id, bo if(m_pItemDataVector->end() == it) { int i=0; - for(T_VECTOR::iterator it_ = m_pItemDataVector->begin(); m_pItemDataVector->end() != it_; it_++,i++) - Msg("[%d]=[%s]",i,*(*it_).id ); + for(T_VECTOR::iterator it = m_pItemDataVector->begin(); m_pItemDataVector->end() != it; it++,i++) + Msg("[%d]=[%s]",i,*(*it).id ); R_ASSERT3(no_assert, "item not found, id", *str_id); return NULL; diff --git a/src/xr_3da/xrGame/xrGame.vcxproj b/src/xr_3da/xrGame/xrGame.vcxproj index e5149171..9c004da9 100644 --- a/src/xr_3da/xrGame/xrGame.vcxproj +++ b/src/xr_3da/xrGame/xrGame.vcxproj @@ -110,21 +110,21 @@ *.idb%3b*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b$(TargetPath) true true - $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(SolutionDir)src\xr_3da\xrGame;$(IncludePath) + $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(IncludePath) $(SolutionDir)lib;$(LibraryPath) $(SolutionDir)bin\ $(SolutionDir)obj\$(ProjectName)\$(Configuration)\ true - $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(SolutionDir)src\xr_3da\xrGame;$(IncludePath) + $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(IncludePath) $(SolutionDir)lib;$(LibraryPath) $(SolutionDir)bin\ $(SolutionDir)obj\$(ProjectName)\$(Configuration)\ false - $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(SolutionDir)src\xr_3da\xrGame;$(IncludePath) + $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(IncludePath) $(SolutionDir)lib;$(LibraryPath) @@ -133,21 +133,21 @@ *.idb%3b*.obj%3b*.ilk%3b*.pdb%3b*.tlb%3b*.tli%3b*.tlh%3b*.tmp%3b*.rsp%3b*.bat%3b$(TargetPath) true true - $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(SolutionDir)src\xr_3da\xrGame;$(IncludePath) + $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(IncludePath) $(SolutionDir)lib;$(LibraryPath) $(SolutionDir)bin\ $(SolutionDir)obj\$(ProjectName)\$(Configuration)\ true - $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(SolutionDir)src\xr_3da\xrGame;$(IncludePath) + $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(IncludePath) $(SolutionDir)lib;$(LibraryPath) $(SolutionDir)bin\ $(SolutionDir)obj\$(ProjectName)\$(Configuration)\ false - $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(SolutionDir)src\xr_3da\xrGame;$(IncludePath) + $(SolutionDir)sdk\DPlay;$(SolutionDir)src\xrCore;$(SolutionDir)sdk\loki;$(SolutionDir)src\xrLua\src;$(SolutionDir)sdk\luabind\luabind;$(SolutionDir)sdk\boost_1_30_0;$(IncludePath) $(SolutionDir)lib;$(LibraryPath) diff --git a/src/xr_3da/xrGame/xrServer.cpp b/src/xr_3da/xrGame/xrServer.cpp index 5a264148..ff3b72c0 100644 --- a/src/xr_3da/xrGame/xrServer.cpp +++ b/src/xr_3da/xrGame/xrServer.cpp @@ -525,14 +525,14 @@ u32 xrServer::OnMessage (NET_Packet& P, ClientID sender) // Non-Zero means bro }break; case M_CL_UPDATE: { - xrClientData* CL_ = ID_to_client (sender); - if (!CL_) break; - CL_->net_Ready = TRUE; + xrClientData* CL = ID_to_client (sender); + if (!CL) break; + CL->net_Ready = TRUE; - if (!CL_->net_PassUpdates) + if (!CL->net_PassUpdates) break; //------------------------------------------------------------------- - u32 ClientPing = CL_->stats.getPing(); + u32 ClientPing = CL->stats.getPing(); P.w_seek(P.r_tell()+2, &ClientPing, 4); //------------------------------------------------------------------- if (SV_Client) @@ -541,16 +541,16 @@ u32 xrServer::OnMessage (NET_Packet& P, ClientID sender) // Non-Zero means bro }break; case M_MOVE_PLAYERS_RESPOND: { - xrClientData* CL_ = ID_to_client (sender); - if (!CL_) break; - CL_->net_Ready = TRUE; - CL_->net_PassUpdates = TRUE; + xrClientData* CL = ID_to_client (sender); + if (!CL) break; + CL->net_Ready = TRUE; + CL->net_PassUpdates = TRUE; }break; //------------------------------------------------------------------- case M_CL_INPUT: { - xrClientData* CL_ = ID_to_client (sender); - if (CL_) CL_->net_Ready = TRUE; + xrClientData* CL = ID_to_client (sender); + if (CL) CL->net_Ready = TRUE; if (SV_Client) SendTo (SV_Client->ID, P, net_flags(TRUE, TRUE)); VERIFY (verify_entities()); }break; @@ -561,18 +561,18 @@ u32 xrServer::OnMessage (NET_Packet& P, ClientID sender) // Non-Zero means bro }break; case M_CLIENTREADY: { - xrClientData* CL_ = ID_to_client(sender); - if ( CL_ ) + xrClientData* CL = ID_to_client(sender); + if ( CL ) { - CL_->net_Ready = TRUE; - CL_->ps->DeathTime = Device.dwTimeGlobal; + CL->net_Ready = TRUE; + CL->ps->DeathTime = Device.dwTimeGlobal; game->OnPlayerConnectFinished(sender); - CL_->ps->setName( CL_->name.c_str() ); + CL->ps->setName( CL->name.c_str() ); #ifdef BATTLEYE if ( g_pGameLevel && Level().battleye_system.server ) { - Level().battleye_system.server->AddConnected_OnePlayer( CL_ ); + Level().battleye_system.server->AddConnected_OnePlayer( CL ); } #endif // BATTLEYE }; diff --git a/src/xr_3da/xrGame/xrServer_Object_Base.cpp b/src/xr_3da/xrGame/xrServer_Object_Base.cpp index 7dc0e092..52c0497a 100644 --- a/src/xr_3da/xrGame/xrServer_Object_Base.cpp +++ b/src/xr_3da/xrGame/xrServer_Object_Base.cpp @@ -288,8 +288,8 @@ BOOL CSE_Abstract::Spawn_Read (NET_Packet &tNetPacket) if (m_wVersion > 83) { tNetPacket.r_u32 ();//m_spawn_flags.assign(tNetPacket.r_u32()); - xr_string temp_; - tNetPacket.r_stringZ (temp_);//tNetPacket.r_stringZ(m_spawn_control); + xr_string temp; + tNetPacket.r_stringZ (temp);//tNetPacket.r_stringZ(m_spawn_control); tNetPacket.r_u32 ();//m_max_spawn_count); // this stuff we do not need even in case of uncomment tNetPacket.r_u32 ();//m_spawn_count); diff --git a/src/xr_3da/xrGame/xrServer_Object_Base.h b/src/xr_3da/xrGame/xrServer_Object_Base.h index 5cbc8cf0..20e8f4dc 100644 --- a/src/xr_3da/xrGame/xrServer_Object_Base.h +++ b/src/xr_3da/xrGame/xrServer_Object_Base.h @@ -126,7 +126,7 @@ SERVER_ENTITY_DECLARE_BEGIN3(CSE_Abstract,ISE_Abstract,CPureServerObject,CScript virtual ISE_Shape* __stdcall shape (); virtual CSE_Motion* __stdcall motion (); virtual bool __stdcall validate (); - virtual void __stdcall on_render (CDUInterface* du, ISE_AbstractLEOwner* owner_, bool bSelected, const Fmatrix& parent,int priority, bool strictB2F){} + virtual void __stdcall on_render (CDUInterface* du, ISE_AbstractLEOwner* owner, bool bSelected, const Fmatrix& parent,int priority, bool strictB2F){} // IC const Fvector &Position () const {return o_Position;}; diff --git a/src/xr_3da/xrGame/xrServer_Objects_ALife.cpp b/src/xr_3da/xrGame/xrServer_Objects_ALife.cpp index d0f98acb..778b8c77 100644 --- a/src/xr_3da/xrGame/xrServer_Objects_ALife.cpp +++ b/src/xr_3da/xrGame/xrServer_Objects_ALife.cpp @@ -1150,16 +1150,16 @@ void CSE_ALifeObjectHangingLamp::FillProps (LPCSTR pref, PropItemVec& values) } #define VIS_RADIUS 0.25f -void CSE_ALifeObjectHangingLamp::on_render(CDUInterface* du, ISE_AbstractLEOwner* owner_, bool bSelected, const Fmatrix& parent,int priority, bool strictB2F) +void CSE_ALifeObjectHangingLamp::on_render(CDUInterface* du, ISE_AbstractLEOwner* owner, bool bSelected, const Fmatrix& parent,int priority, bool strictB2F) { - inherited1::on_render (du,owner_,bSelected,parent,priority,strictB2F); + inherited1::on_render (du,owner,bSelected,parent,priority,strictB2F); if ((1==priority)&&(false==strictB2F)){ u32 clr = bSelected?0x00FFFFFF:0x00FFFF00; Fmatrix main_xform, ambient_xform; - owner_->get_bone_xform (*light_main_bone,main_xform); + owner->get_bone_xform (*light_main_bone,main_xform); main_xform.mulA_43 (parent); if(flags.is(flPointAmbient) ){ - owner_->get_bone_xform (*light_ambient_bone,ambient_xform); + owner->get_bone_xform (*light_ambient_bone,ambient_xform); ambient_xform.mulA_43 (parent); } if (bSelected){ diff --git a/src/xr_3da/xrGame/xrServer_Objects_ALife_Monsters.cpp b/src/xr_3da/xrGame/xrServer_Objects_ALife_Monsters.cpp index e1b3a421..16a30fcc 100644 --- a/src/xr_3da/xrGame/xrServer_Objects_ALife_Monsters.cpp +++ b/src/xr_3da/xrGame/xrServer_Objects_ALife_Monsters.cpp @@ -43,14 +43,14 @@ void setup_location_types_section(GameGraph::TERRAIN_VECTOR &m_vertex_types, CIn CInifile::SectCIt E = sect.Data.end(); for ( ; I != E; ++I) { LPCSTR S = *(*I).first; - string16 I_; + string16 I; u32 N = _GetItemCount(S); if (N != GameGraph::LOCATION_TYPE_COUNT) continue; for (u32 j=0; jsecond; + CSE_Abstract* E = I->second; fs.open_chunk (C); // Spawn - E_->Spawn_Write (P,TRUE); + E->Spawn_Write (P,TRUE); fs.w_u16 (u16(P.B.count)); fs.w (P.B.data,P.B.count); // Update P.w_begin (M_UPDATE); - P.w_u16 (E_->ID); + P.w_u16 (E->ID); P.w_chunk_open8 (position); - E_->UPDATE_Write (P); + E->UPDATE_Write (P); P.w_chunk_close8 (position); fs.w_u16 (u16(P.B.count)); diff --git a/src/xr_3da/xrGame/xrServer_process_spawn.cpp b/src/xr_3da/xrGame/xrServer_process_spawn.cpp index 38d8e690..19136e60 100644 --- a/src/xr_3da/xrGame/xrServer_process_spawn.cpp +++ b/src/xr_3da/xrGame/xrServer_process_spawn.cpp @@ -90,9 +90,9 @@ CSE_Abstract* xrServer::Process_spawn(NET_Packet& P, ClientID sender, BOOL bSpaw if (bSpawnWithClientsMainEntityAsParent) { R_ASSERT (CL); - CSE_Abstract* P_ = CL->owner; - R_ASSERT (P_); - E->ID_Parent = P_->ID; + CSE_Abstract* P = CL->owner; + R_ASSERT (P); + E->ID_Parent = P->ID; } E->ID = PerformIDgen(E->ID); E->owner = CL; diff --git a/src/xr_3da/xrGame/xr_level_controller.cpp b/src/xr_3da/xrGame/xr_level_controller.cpp index 6eb01ee0..a64de42f 100644 --- a/src/xr_3da/xrGame/xr_level_controller.cpp +++ b/src/xr_3da/xrGame/xr_level_controller.cpp @@ -243,7 +243,7 @@ _action* action_name_to_ptr(LPCSTR _name) int idx = 0; while( actions[idx].action_name ) { - if( !_stricmp(_name,actions[idx].action_name) ) + if( !stricmp(_name,actions[idx].action_name) ) return &actions[idx]; ++idx; } @@ -287,7 +287,7 @@ _keyboard* keyname_to_ptr(LPCSTR _name) while(keyboards[idx].key_name) { _keyboard& kb = keyboards[idx]; - if( !_stricmp(_name, kb.key_name) ) + if( !stricmp(_name, kb.key_name) ) return &keyboards[idx]; ++idx; }