Skip to content

Commit

Permalink
Fix xrGameLA, part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
St4lker0k765 committed Dec 8, 2024
1 parent 7762b8a commit 43b4d1e
Show file tree
Hide file tree
Showing 65 changed files with 532 additions and 563 deletions.
42 changes: 21 additions & 21 deletions src/xrGameLA/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ CActor::CActor() : CEntityAlive()
fPrevCamPos = 0.0f;
vPrevCamDir.set (0.f,0.f,1.f);
fCurAVelocity = 0.0f;
// ýôôåêòîðû
// эффекторы
pCamBobbing = 0;
m_pSleepEffector = NULL;
m_pSleepEffectorPP = NULL;
Expand Down Expand Up @@ -147,7 +147,7 @@ CActor::CActor() : CEntityAlive()
Device.seqRender.Add (this,REG_PRIORITY_LOW);
#endif

//ðàçðåøèòü èñïîëüçîâàíèå ïîÿñà â inventory
//разрешить использование пояса в inventory
inventory().SetBeltUseful(true);

m_pPersonWeLookingAt = NULL;
Expand Down Expand Up @@ -350,14 +350,14 @@ void CActor::Load (LPCSTR section )

character_physics_support()->in_Load (section);

//çàãðóçèòü ïàðàìåòðû ýôôåêòîðà
//загрузить параметры эффектора
// LoadShootingEffector ("shooting_effector");
LoadSleepEffector ("sleep_effector");

//çàãðóçèòü ïàðàìåòðû ñìåùåíèÿ firepoint
//загрузить параметры смещения firepoint
m_vMissileOffset = pSettings->r_fvector3(section,"missile_throw_offset");

//Weapons = xr_new<CWeaponList> (this);
//Weapons = new CWeaponList (this);

if(!g_dedicated_server)
{
Expand Down Expand Up @@ -390,7 +390,7 @@ if(!g_dedicated_server)
// sheduler
shedule.t_min = shedule.t_max = 1;

// íàñòðîéêè äèñïåðñèè ñòðåëüáû
// настройки дисперсии стрельбы
m_fDispBase = pSettings->r_float (section,"disp_base" );
m_fDispBase = deg2rad(m_fDispBase);

Expand Down Expand Up @@ -697,7 +697,7 @@ void CActor::Die(CObject* who)
};


///!!! ÷èñòêà ïîÿñà
///!!! чистка пояса
TIItemContainer &l_blist = inventory().m_belt;
while (!l_blist.empty())
inventory().Ruck(l_blist.front());
Expand Down Expand Up @@ -983,7 +983,7 @@ void CActor::shedule_Update (u32 DT)

}

//îáíîâëåíèå èíâåíòàðÿ
//обновление инвентаря
UpdateInventoryOwner (DT);
if (GameID() == GAME_SINGLE)
GameTaskManager().UpdateTasks ();
Expand Down Expand Up @@ -1061,7 +1061,7 @@ void CActor::shedule_Update (u32 DT)
g_bAutoApplySprint += 1;
}
}
if (g_bAutoApplySprint == 10)//ïðèìåíèò áåã íà 10é êàäð
if (g_bAutoApplySprint == 10)//применит бег на 10й кадр
{
mstate_wishful |= mcSprint;
g_bAutoApplySprint = 0;
Expand Down Expand Up @@ -1109,7 +1109,7 @@ void CActor::shedule_Update (u32 DT)

inherited::shedule_Update (DT);

//ýôôåêòîð âêëþ÷àåìûé ïðè õîäüáå
//эффектор включаемый при ходьбе
if (psActorFlags.test(AF_HEAD_BOBBING))
{
if (!pCamBobbing)
Expand All @@ -1125,7 +1125,7 @@ void CActor::shedule_Update (u32 DT)
pCamBobbing = nullptr;
}

//çâóê òÿæåëîãî äûõàíèÿ ïðè óòàëîñòè è õðîìàíèè
//звук тяжелого дыхания при уталости и хромании
if(this==Level().CurrentControlEntity() && !g_dedicated_server )
{
if(conditions().IsLimping() && g_Alive())
Expand Down Expand Up @@ -1179,13 +1179,13 @@ void CActor::shedule_Update (u32 DT)
}
}

//åñëè â ðåæèìå HUD, òî ñàìà ìîäåëü àêòåðà íå ðèñóåòñÿ
//если в режиме HUD, то сама модель актера не рисуется
if(!character_physics_support()->IsRemoved())
if (m_bDrawLegs && ((!psDeviceFlags.test(rsR2) && !psDeviceFlags.test(rsR3) && !psDeviceFlags.test(rsR4) && !m_bActorShadows) || ((psDeviceFlags.test(rsR2) || psDeviceFlags.test(rsR3) || psDeviceFlags.test(rsR4)) && m_bActorShadows)))
setVisible (TRUE);
else
setVisible (!HUDview ());
//÷òî àêòåð âèäèò ïåðåä ñîáîé
//что актер видит перед собой
collide::rq_result& RQ = HUD().GetCurrentRayQuery();

float dist_to_obj = RQ.range;
Expand Down Expand Up @@ -1258,7 +1258,7 @@ void CActor::shedule_Update (u32 DT)

// UpdateSleep ();

//äëÿ ñâîéñò àðòåôàêòîâ, íàõîäÿùèõñÿ íà ïîÿñå
//для свойст артефактов, находящихся на поясе
UpdateArtefactsOnBeltAndOutfit ();
m_pPhysics_support->in_shedule_Update (DT);
Check_for_AutoPickUp ();
Expand Down Expand Up @@ -1584,7 +1584,7 @@ void CActor::MoveArtefactBelt(const CArtefact* artefact, bool on_belt)
{
VERIFY(artefact);

//ïîâåñèòü àðòåôàêò íà ïîÿñ
//повесить артефакт на пояс
if(on_belt)
{
VERIFY(m_ArtefactsOnBelt.end() == std::find(m_ArtefactsOnBelt.begin(), m_ArtefactsOnBelt.end(), artefact));
Expand Down Expand Up @@ -1637,14 +1637,14 @@ void CActor::UpdateArtefactsOnBeltAndOutfit()
conditions().ChangeRadiation (artefact->m_fRadiationRestoreSpeed*f_update_time);
conditions().ChangePsyHealth (artefact->m_fPsyhealthRestoreSpeed*f_update_time);

//ñëîæèì áîíóñû ñêîðîñòè îò àðòèôàêòîâ íà ïîÿñå
//сложим бонусы скорости от артифактов на поясе
run_koef_additional += artefact->m_additional_run_coef;
sprint_koef_additional += artefact->m_additional_sprint_koef;
jump_koef_additional += artefact->m_additional_jump_speed;
}
}

//ïðîâåðèì íå ïðåâûñèëè ëè ëèìèò óêàçàíûé â àêòîð ëòõ. òîëüêî äëÿ àðòîâ. äëÿ êîñòþìîâ íå ïðîâåðÿåì
//проверим не превысили ли лимит указаный в актор лтх. только для артов. для костюмов не проверяем

if (run_koef_additional > m_fRunFactorAdditionalLimit)
run_koef_additional = m_fRunFactorAdditionalLimit;
Expand All @@ -1662,15 +1662,15 @@ void CActor::UpdateArtefactsOnBeltAndOutfit()
conditions().ChangeSatiety (outfit->GetSatietyRestoreSpeed() * f_update_time);
conditions().ChangeRadiation(outfit->GetRadiationRestoreSpeed() * f_update_time);

//äîáàâèì áîíóñû îò êîñòþìà
//добавим бонусы от костюма
run_koef_additional += outfit->m_additional_run_coef;
sprint_koef_additional += outfit->m_additional_sprint_koef;
jump_koef_additional += outfit->m_additional_jump_speed;
}

m_fSprintFactorAdditional = sprint_koef_additional;
m_fRunFactorAdditional = run_koef_additional;
//äëÿ ïðûæêà íåìíîãî ïîäðóãîìó
//для прыжка немного подругому
character_physics_support()->movement()->SetJumpUpVelocity(m_fJumpSpeed + jump_koef_additional);
}

Expand Down Expand Up @@ -1826,11 +1826,11 @@ bool CActor::can_attach(const CInventoryItem *inventory_item) const
if (!item || (item && !item->can_be_attached()))/*(!item->enabled() || !item->can_be_attached()))*/
return (false);

//ìîæíî ëè ïðèñîåäèíÿòü îáúåêòû òàêîãî òèïà
//можно ли присоединять объекты такого типа
if( m_attach_item_sections.end() == std::find(m_attach_item_sections.begin(),m_attach_item_sections.end(),inventory_item->object().cNameSect()) )
return false;

//åñëè óæå åñòü ïðèñîåäèííåíûé îáúåò òàêîãî òèïà
//если уже есть присоединненый объет такого типа
if(attached(inventory_item->object().cNameSect()))
return false;

Expand Down
2 changes: 1 addition & 1 deletion src/xrGameLA/ActorCameras.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void CActor::LoadShootingEffector (LPCSTR section)
{
if(!m_pShootingEffector)
m_pShootingEffector = xr_new<SShootingEffector>();
m_pShootingEffector = new SShootingEffector();
m_pShootingEffector->ppi.duality.h = pSettings->r_float(section,"duality_h");
Expand Down
4 changes: 2 additions & 2 deletions src/xrGameLA/ActorFollowers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ CActorFollowerMngr::CActorFollowerMngr()
CUIXml uiXml;
uiXml.Init(CONFIG_PATH, UI_PATH, "follower_panel.xml");
m_uiPanel = xr_new<CUIFollowerPanel> ();
m_uiPanel = new CUIFollowerPanel ();
m_uiPanel->Init (&uiXml,"followers_panel",0);
CurrentGameUI()->AddDialogToRender(m_uiPanel);
m_uiPanel->Show (false);
Expand Down Expand Up @@ -66,7 +66,7 @@ void CActorFollowerMngr::SendCommand(int cmd)
CActorFollowerMngr& CActor::Followers()
{
if(!m_followers)
m_followers = xr_new<CActorFollowerMngr>();
m_followers = new CActorFollowerMngr();
return *m_followers;
}
Expand Down
18 changes: 9 additions & 9 deletions src/xrGameLA/Actor_Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ BOOL CActor::net_Spawn (CSE_Abstract* DC)
m_current_torso.invalidate ();
m_current_head.invalidate ();
//-------------------------------------
// èíèöèàëèçàöèÿ ðååñòðîâ, èñïîëüçóåìûõ àêòåðîì
// инициализация реестров, используемых актером
encyclopedia_registry->registry().init(ID());
game_news_registry->registry().init(ID());

Expand All @@ -531,7 +531,7 @@ BOOL CActor::net_Spawn (CSE_Abstract* DC)
CSE_ALifeTraderAbstract *pTA = smart_cast<CSE_ALifeTraderAbstract*>(e);
set_money (pTA->m_dwMoney, false);

//óáðàòü âñå àðòåôàêòû ñ ïîÿñà
//убрать все артефакты с пояса
m_ArtefactsOnBelt.clear();
//. if( TRUE == E->s_flags.test(M_SPAWN_OBJECT_LOCAL) && TRUE == E->s_flags.is(M_SPAWN_OBJECT_ASPLAYER))
//. CurrentGameUI()->UIMainIngameWnd->m_artefactPanel->InitIcons(m_ArtefactsOnBelt);
Expand Down Expand Up @@ -605,7 +605,7 @@ BOOL CActor::net_Spawn (CSE_Abstract* DC)
if (!pStatGraph)
{
static g_Y = 0;
pStatGraph = xr_new<CStatGraph>();
pStatGraph = new CStatGraph();
pStatGraph->SetRect(0, g_Y, Device.dwWidth, 100, 0xff000000, 0xff000000);
g_Y += 110;
if (g_Y > 700) g_Y = 100;
Expand Down Expand Up @@ -638,7 +638,7 @@ BOOL CActor::net_Spawn (CSE_Abstract* DC)
K->PlayCycle("death_init");


//îñòàíîâèòü çâóê òÿæåëîãî äûõàíèÿ
//остановить звук тяжелого дыхания
m_HeavyBreathSnd.stop();
}

Expand Down Expand Up @@ -1052,10 +1052,10 @@ void CActor::CalculateInterpolationParams()
for (u32 k=0; k<3; k++)
{
SP0[k] = c*(c*(c*SCoeff[k][0]+SCoeff[k][1])+SCoeff[k][2])+SCoeff[k][3];
SP1[k] = (c*c*SCoeff[k][0]*3+c*SCoeff[k][1]*2+SCoeff[k][2])/3; // ñîêðîñòü èç ôîðìóëû â 3 ðàçà ïðåâûøàåò ñêîðîñòü ïðè ðàñ÷åòå êîýôôèöèåíòîâ !!!!
SP1[k] = (c*c*SCoeff[k][0]*3+c*SCoeff[k][1]*2+SCoeff[k][2])/3; // сокрость из формулы в 3 раза превышает скорость при расчете коэффициентов !!!!

HP0[k] = c*(c*(c*HCoeff[k][0]+HCoeff[k][1])+HCoeff[k][2])+HCoeff[k][3];
HP1[k] = (c*c*HCoeff[k][0]*3+c*HCoeff[k][1]*2+HCoeff[k][2]); // ñîêðîñòü èç ôîðìóëû â 3 ðàçà ïðåâûøàåò ñêîðîñòü ïðè ðàñ÷åòå êîýôôèöèåíòîâ !!!!
HP1[k] = (c*c*HCoeff[k][0]*3+c*HCoeff[k][1]*2+HCoeff[k][2]); // сокрость из формулы в 3 раза превышает скорость при расчете коэффициентов !!!!
};

SP1.add(SP0);
Expand Down Expand Up @@ -1227,7 +1227,7 @@ void CActor::make_Interpolation ()
case 1:
{
for (int k=0; k<3; k++)
SpeedVector[k] = (factor*factor*SCoeff[k][0]*3+factor*SCoeff[k][1]*2+SCoeff[k][2])/3; // ñîêðîñòü èç ôîðìóëû â 3 ðàçà ïðåâûøàåò ñêîðîñòü ïðè ðàñ÷åòå êîýôôèöèåíòîâ !!!!
SpeedVector[k] = (factor*factor*SCoeff[k][0]*3+factor*SCoeff[k][1]*2+SCoeff[k][2])/3; // сокрость из формулы в 3 раза превышает скорость при расчете коэффициентов !!!!

ResPosition.set(IPosS);
}break;
Expand Down Expand Up @@ -1515,7 +1515,7 @@ void CActor::OnRender_Network()
point1S[k] = c*(c*(c*SCoeff[k][0]+SCoeff[k][1])+SCoeff[k][2])+SCoeff[k][3];
point1H[k] = c*(c*(c*HCoeff[k][0]+HCoeff[k][1])+HCoeff[k][2])+HCoeff[k][3];

tS[k] = (c*c*SCoeff[k][0]*3+c*SCoeff[k][1]*2+SCoeff[k][2])/3; // ñîêðîñòü èç ôîðìóëû â 3 ðàçà ïðåâûøàåò ñêîðîñòü ïðè ðàñ÷åòå êîýôôèöèåíòîâ !!!!
tS[k] = (c*c*SCoeff[k][0]*3+c*SCoeff[k][1]*2+SCoeff[k][2])/3; // сокрость из формулы в 3 раза превышает скорость при расчете коэффициентов !!!!
tH[k] = (c*c*HCoeff[k][0]*3+c*HCoeff[k][1]*2+HCoeff[k][2]);
};

Expand Down Expand Up @@ -1872,7 +1872,7 @@ void CActor::OnPlayHeadShotParticle(NET_Packet P)
if (!m_sHeadShotParticle.size()) return;
Fmatrix pos;
CParticlesPlayer::MakeXFORM(this,element,HitDir,HitPos,pos);
// óñòàíîâèòü particles
// установить particles
CParticlesObject* ps = NULL;

ps = CParticlesObject::Create(m_sHeadShotParticle.c_str(),TRUE);
Expand Down
22 changes: 12 additions & 10 deletions src/xrGameLA/CustomDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
#include "hudsound.h"

class CCustomZone;
//îïèñàíèå òèïà çîíû
//описание типа зоны
struct ZONE_TYPE
{
//èíòåðâàë ÷àñòîò îòûãðûâàíèÿ çâóêà
//интервал частот отыгрывания звука
float min_freq;
float max_freq;
//çâóê ðåàêöèè äåòåêòîðà íà êîíêðåòíóþ çîíó
//звук реакции детектора на конкретную зону
// ref_sound detect_snd;
HUD_SOUND_ITEM detect_snds;

shared_str zone_map_location;
};

//îïèñàíèå çîíû, îáíàðóæåííîé äåòåêòîðîì
//описание зоны, обнаруженной детектором
struct ZONE_INFO
{
u32 snd_time;
//òåêóùàÿ ÷àñòîòà ðàáîòû äàò÷èêà
//текущая частота работы датчика
float cur_freq;
//particle for night-vision mode
CParticlesObject* pParticle;
Expand Down Expand Up @@ -72,16 +72,18 @@ class CCustomDetector :

float m_fRadius;

//åñëè õîçÿèí òåêóùèé àêòåð
//если хозяин текущий актер
CActor* m_pCurrentActor;
CInventoryOwner* m_pCurrentInvOwner;

//èíôîðìàöèÿ îá îíàðóæèâàåìûõ çîíàõ
DEFINE_MAP(CLASS_ID, ZONE_TYPE, ZONE_TYPE_MAP, ZONE_TYPE_MAP_IT);
//информация об онаруживаемых зонах
using ZONE_TYPE_MAP = xr_map<CLASS_ID, ZONE_TYPE>;
using ZONE_TYPE_MAP_IT = ZONE_TYPE_MAP::iterator;
ZONE_TYPE_MAP m_ZoneTypeMap;

//ñïèñîê îáíàðóæåííûõ çîí è èíôîðìàöèÿ î íèõ
DEFINE_MAP(CCustomZone*, ZONE_INFO, ZONE_INFO_MAP, ZONE_INFO_MAP_IT);
//список обнаруженных зон и информация о них
using ZONE_INFO_MAP = xr_map<CCustomZone*, ZONE_INFO>;
using ZONE_INFO_MAP_IT = ZONE_INFO_MAP::iterator;
ZONE_INFO_MAP m_ZoneInfoMap;

shared_str m_nightvision_particle;
Expand Down
Loading

0 comments on commit 43b4d1e

Please sign in to comment.