Skip to content

Commit 7124ea7

Browse files
ShokerStlkXottab-DUTY
authored andcommitted
SWM: Ported xrEngine
1 parent be8a221 commit 7124ea7

27 files changed

+180
-12
lines changed

src/Layers/xrRender/SkeletonRigid.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ void CKinematics::LL_ClearAdditionalTransform(u16 bone_id)
171171
}
172172

173173
void CKinematics::BuildBoneMatrix(
174-
const CBoneData* bd, CBoneInstance& bi, const Fmatrix* parent, u8 /*channel_mask = (1<<0)*/)
174+
const CBoneData* bd, CBoneInstance& bi, const Fmatrix* parent, u8 channel_mask /*= (1<<0)*/)
175175
{
176176
bi.mTransform.mul_43(*parent, bd->bind_transform);
177177
CalculateBonesAdditionalTransforms(bd, bi, parent, channel_mask); //--#SM+#--
@@ -182,18 +182,14 @@ void CKinematics::CalculateBonesAdditionalTransforms(
182182
const CBoneData* bd, CBoneInstance& bi, const Fmatrix* parent, u8 channel_mask /* = (1<<0)*/)
183183
{
184184
// bi.mTransform.c - содержит смещение относительно первой кости модели\центра сцены (0, 0, 0)
185-
BONE_TRANSFORM_VECTOR_IT it = m_bones_offsets.begin();
186-
while (it != m_bones_offsets.end())
185+
for (auto& it : m_bones_offsets)
187186
{
188-
if (it->m_bone_id == bd->GetSelfID())
187+
if (it.m_bone_id == bd->GetSelfID())
189188
{
190-
Fvector vOldPos = bi.mTransform.c;
191-
bi.mTransform.mulB_43(it->m_transform); // Rotation
192-
bi.mTransform.c.add(vOldPos, it->m_transform.c); // Translation
189+
const Fvector vOldPos = bi.mTransform.c;
190+
bi.mTransform.mulB_43(it.m_transform); // Rotation
191+
bi.mTransform.c.add(vOldPos, it.m_transform.c); // Translation
193192
}
194-
195-
// next
196-
++it;
197193
}
198194
}
199195

src/Layers/xrRender/r__dsgraph_render.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ class hud_transform_helper
357357
FTold = Device.mFullTransform;
358358

359359
// XXX: Xottab_DUTY: custom FOV. Implement it someday
360-
// It should something like this:
360+
// It should be something like this:
361361
// float customFOV;
362362
// if (isCustomFOV)
363363
// customFOV = V->getVisData().obj_data->m_hud_custom_fov;

src/Layers/xrRenderPC_GL/rgl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,8 @@ void CRender::OnFrame()
468468
}
469469
}
470470

471+
void CRender::BeforeWorldRender() {}
472+
void CRender::AfterWorldRender() {}
471473

472474
// Implementation
473475
IRender_ObjectSpecific* CRender::ros_create(IRenderable* parent) { return new CROS_impl(); }

src/Layers/xrRenderPC_GL/rgl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,9 @@ class CRender : public D3DXRenderBase
368368
void ScreenshotAsyncEnd(CMemoryWriter& memory_writer) override;
369369
void OnFrame() override;
370370

371+
void BeforeWorldRender() override; //--#SM+#-- +SecondVP+ Вызывается перед началом рендера мира и пост-эффектов
372+
void AfterWorldRender() override; //--#SM+#-- +SecondVP+ Вызывается после рендера мира и перед UI
373+
371374
// Render mode
372375
void rmNear() override;
373376
void rmFar() override;

src/Layers/xrRenderPC_R1/FStaticRender.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ void CRender::OnFrame()
149149
Models->DeleteQueue();
150150
}
151151

152+
void CRender::BeforeWorldRender() {}
153+
void CRender::AfterWorldRender() {}
154+
152155
// Implementation
153156
IRender_ObjectSpecific* CRender::ros_create(IRenderable* parent) { return new CROS_impl(); }
154157
void CRender::ros_destroy(IRender_ObjectSpecific*& p) { xr_delete(p); }

src/Layers/xrRenderPC_R1/FStaticRender.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ class CRender : public D3DXRenderBase
188188
virtual void ScreenshotAsyncEnd(CMemoryWriter& memory_writer) override;
189189
virtual void OnFrame() override;
190190

191+
void BeforeWorldRender() override; //--#SM+#-- +SecondVP+ Вызывается перед началом рендера мира и пост-эффектов
192+
void AfterWorldRender() override; //--#SM+#-- +SecondVP+ Вызывается после рендера мира и перед UI
193+
191194
// Render mode
192195
virtual void rmNear() override;
193196
virtual void rmFar() override;

src/Layers/xrRenderPC_R2/r2.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ void CRender::OnFrame()
421421
}
422422
}
423423

424+
void CRender::BeforeWorldRender() {}
425+
void CRender::AfterWorldRender() {}
426+
424427
// Implementation
425428
IRender_ObjectSpecific* CRender::ros_create(IRenderable* parent) { return new CROS_impl(); }
426429
void CRender::ros_destroy(IRender_ObjectSpecific*& p) { xr_delete(p); }

src/Layers/xrRenderPC_R2/r2.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@ class CRender : public D3DXRenderBase
313313
virtual void ScreenshotAsyncEnd(CMemoryWriter& memory_writer);
314314
virtual void OnFrame();
315315

316+
void BeforeWorldRender() override; //--#SM+#-- +SecondVP+ Вызывается перед началом рендера мира и пост-эффектов
317+
void AfterWorldRender() override; //--#SM+#-- +SecondVP+ Вызывается после рендера мира и перед UI
318+
316319
// Render mode
317320
virtual void rmNear();
318321
virtual void rmFar();

src/Layers/xrRenderPC_R3/r3.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,9 @@ void CRender::OnFrame()
545545
}
546546
}
547547

548+
void CRender::BeforeWorldRender() {}
549+
void CRender::AfterWorldRender() {}
550+
548551
// Implementation
549552
IRender_ObjectSpecific* CRender::ros_create(IRenderable* parent) { return new CROS_impl(); }
550553
void CRender::ros_destroy(IRender_ObjectSpecific*& p) { xr_delete(p); }

src/Layers/xrRenderPC_R3/r3.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,9 @@ class CRender : public D3DXRenderBase
351351
virtual void ScreenshotAsyncEnd(CMemoryWriter& memory_writer);
352352
virtual void OnFrame();
353353

354+
void BeforeWorldRender() override; //--#SM+#-- +SecondVP+ Вызывается перед началом рендера мира и пост-эффектов
355+
void AfterWorldRender() override; //--#SM+#-- +SecondVP+ Вызывается после рендера мира и перед UI
356+
354357
// Render mode
355358
virtual void rmNear();
356359
virtual void rmFar();

0 commit comments

Comments
 (0)