Skip to content

Commit

Permalink
Revert "Fix warnings in xrGame"
Browse files Browse the repository at this point in the history
This reverts commit 5449a97.
  • Loading branch information
Drombeys committed Dec 15, 2023
1 parent abf9d3f commit dce3d5f
Show file tree
Hide file tree
Showing 162 changed files with 839 additions and 828 deletions.
12 changes: 6 additions & 6 deletions src/xr_3da/xrGame/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
};

Expand Down
2 changes: 1 addition & 1 deletion src/xr_3da/xrGame/ActorAnimation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<CKinematicsAnimated*>(Visual())->PlayCycle(M_legs,TRUE,legs_play_callback,this);
if ((!(mstate_old&mcAnyMove))&&(mstate_real&mcAnyMove))
pos = 0.5f*Random.randI(2);
Expand Down
16 changes: 8 additions & 8 deletions src/xr_3da/xrGame/ActorCameras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) ;
}
}

Expand All @@ -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);
Expand Down Expand Up @@ -245,11 +245,11 @@ void CActor::cam_Update(float dt, float fFOV)
}
else
{
xr_vector<ISpatial*> 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_.size(); o_it++)
xr_vector<ISpatial*> 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.size(); o_it++)
{
CPHShell* pCPHS= smart_cast<CPHShell*>(ISpatialResult_[o_it]);
CPHShell* pCPHS= smart_cast<CPHShell*>(ISpatialResult[o_it]);
if (pCPHS)
{
_viewport_near = 0.01f;
Expand Down
18 changes: 9 additions & 9 deletions src/xr_3da/xrGame/Actor_Events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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<CGameObject*>(m_holder);
VERIFY (id_==GO->ID());
VERIFY (id==GO->ID());
use_Holder (NULL);
}break;
case GEG_PLAYER_PLAY_HEADSHOT_PARTICLE:
Expand Down
14 changes: 7 additions & 7 deletions src/xr_3da/xrGame/Actor_Feel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,18 +160,18 @@ void CActor::PickupModeUpdate_COD ()
CInventoryItem* pNearestItem = NULL;
for (u32 o_it=0; o_it<ISpatialResult.size(); o_it++)
{
ISpatial* spatial_ = ISpatialResult[o_it];
CInventoryItem* pIItem = smart_cast<CInventoryItem*> (spatial_->dcast_CObject ());
ISpatial* spatial = ISpatialResult[o_it];
CInventoryItem* pIItem = smart_cast<CInventoryItem*> (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<CGrenade*> (spatial_->dcast_CObject ());
CGrenade* pGrenade = smart_cast<CGrenade*> (spatial->dcast_CObject ());
if (pGrenade && !pGrenade->Useful()) continue;

CMissile* pMissile = smart_cast<CMissile*> (spatial_->dcast_CObject ());
CMissile* pMissile = smart_cast<CMissile*> (spatial->dcast_CObject ());
if (pMissile && !pMissile->Useful()) continue;

Fvector A, B, tmp;
Expand All @@ -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;
}

Expand Down
10 changes: 5 additions & 5 deletions src/xr_3da/xrGame/Actor_Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ISpatial*> ISpatialResult_;
g_SpatialSpace->q_box (ISpatialResult_,0,STYPE_COLLIDEABLE,bc,m_AutoPickUp_AABB);
xr_vector<ISpatial*> 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<ISpatialResult_.size(); o_it++)
for (u32 o_it=0; o_it<ISpatialResult.size(); o_it++)
{
ISpatial* spatial_ = ISpatialResult_[o_it];
CInventoryItem* pIItem = smart_cast<CInventoryItem*> (spatial_->dcast_CObject ());
ISpatial* spatial = ISpatialResult[o_it];
CInventoryItem* pIItem = smart_cast<CInventoryItem*> (spatial->dcast_CObject ());
if (0 == pIItem) continue;
if (!pIItem->CanTake()) continue;
if (Level().m_feel_deny.is_object_denied(pIItem->cast_game_object()) ) continue;
Expand Down
14 changes: 7 additions & 7 deletions src/xr_3da/xrGame/Car.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -950,9 +950,9 @@ void CCar::Init()
i->second.CDamagableHealthItem::Init(float(atof(*item.second)),2);
else
{
xr_map <u16,SDoor>::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 <u16,SDoor>::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);
}

}
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/xr_3da/xrGame/CarWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions src/xr_3da/xrGame/CarWheels.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
8 changes: 4 additions & 4 deletions src/xr_3da/xrGame/EffectorShot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 ();
}
Expand Down
2 changes: 1 addition & 1 deletion src/xr_3da/xrGame/GameTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 8 additions & 8 deletions src/xr_3da/xrGame/GametaskManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,16 @@ void CGameTaskManager::UpdateTasks ()
for (I = tasks; I != E; ++I)
{
CGameTask *t = (*I).game_task;
for(u16 i_=0; i_<t->m_Objectives.size() ;++i_)
for(u16 i=0; i<t->m_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);
}
}

Expand Down Expand Up @@ -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; (i<t->m_Objectives.size())&&(!bDone) ;++i)
Expand Down
8 changes: 4 additions & 4 deletions src/xr_3da/xrGame/HUDTarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,14 +153,14 @@ void CHUDTarget::Render()

if (psHUD_Flags.test(HUD_INFO)){
if (RQ.O){
CEntityAlive* E_ = smart_cast<CEntityAlive*> (RQ.O);
CEntityAlive* E = smart_cast<CEntityAlive*> (RQ.O);
CEntityAlive* pCurEnt = smart_cast<CEntityAlive*> (Level().CurrentEntity());
PIItem l_pI = smart_cast<PIItem> (RQ.O);

if (IsGameTypeSingle())
{
CInventoryOwner* our_inv_owner = smart_cast<CInventoryOwner*>(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<CInventoryOwner*>(pCurEnt);
CInventoryOwner* others_inv_owner = smart_cast<CInventoryOwner*>(E);
Expand Down Expand Up @@ -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()){
Expand Down
2 changes: 1 addition & 1 deletion src/xr_3da/xrGame/HelicopterWeapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/xr_3da/xrGame/HudItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
12 changes: 6 additions & 6 deletions src/xr_3da/xrGame/Level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,22 +690,22 @@ 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<CAI_Stalker*>(object);
if (!stalker_)
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(object);
if (!stalker)
continue;
stalker_->dbg_draw_vision ();
stalker->dbg_draw_vision ();
}
}


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<CAI_Stalker*>(object);
if (!stalker_)
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(object);
if (!stalker)
continue;

stalker_->dbg_draw_visibility_rays ();
stalker->dbg_draw_visibility_rays ();
}
}
#endif
Expand Down
6 changes: 3 additions & 3 deletions src/xr_3da/xrGame/Level_Bullet_Manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void CBulletManager::UpdateWorkload()
m_Lock.Leave ();
}

bool CBulletManager::CalcBullet (collide::rq_results & rq_storage_, xr_vector<ISpatial*>& rq_spatial_, SBullet* bullet, u32 delta_time)
bool CBulletManager::CalcBullet (collide::rq_results & rq_storage, xr_vector<ISpatial*>& rq_spatial, SBullet* bullet, u32 delta_time)
{
VERIFY (bullet);

Expand All @@ -246,11 +246,11 @@ bool CBulletManager::CalcBullet (collide::rq_results & rq_storage_, xr_vector<IS
collide::ray_defs RD (bullet->pos, 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);

Expand Down
Loading

0 comments on commit dce3d5f

Please sign in to comment.