mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-05-13 05:57:05 +03:00
Use reference instead of pointer
This commit is contained in:
parent
df152aa391
commit
004e9d1651
3 changed files with 14 additions and 16 deletions
|
@ -580,7 +580,7 @@ Vector3i GetLaraJointPosition(int jointIndex, const Vector3i& offset)
|
|||
jointIndex = LM_HEAD;
|
||||
|
||||
auto pos = offset.ToVector3();
|
||||
g_Renderer.GetLaraAbsBonePosition(&pos, jointIndex);
|
||||
g_Renderer.GetLaraAbsBonePosition(pos, jointIndex);
|
||||
return Vector3i(pos);
|
||||
}
|
||||
|
||||
|
|
|
@ -629,8 +629,7 @@ namespace TEN::Renderer
|
|||
bool IsFullsScreen();
|
||||
void RenderTitleImage();
|
||||
void AddLine2D(int x1, int y1, int x2, int y2, byte r, byte g, byte b, byte a);
|
||||
void AddLine3D(Vector3 start, Vector3 end,
|
||||
Vector4 color);
|
||||
void AddLine3D(Vector3 start, Vector3 end, Vector4 color);
|
||||
void AddBox(Vector3 min, Vector3 max, Vector4 color);
|
||||
void AddBox(Vector3* corners, Vector4 color);
|
||||
void AddDebugBox(BoundingOrientedBox box, Vector4 color, RENDERER_DEBUG_PAGE page);
|
||||
|
@ -642,12 +641,11 @@ namespace TEN::Renderer
|
|||
void ResetAnimations();
|
||||
void UpdateLaraAnimations(bool force);
|
||||
void UpdateItemAnimations(int itemNumber, bool force);
|
||||
void GetLaraAbsBonePosition(Vector3* pos, int joint);
|
||||
void GetItemAbsBonePosition(int itemNumber, Vector3* pos, int joint);
|
||||
void GetLaraAbsBonePosition(Vector3& pos, int jointIndex);
|
||||
void GetItemAbsBonePosition(int itemNumber, Vector3* pos, int jointIndex);
|
||||
int GetSpheres(short itemNumber, BoundingSphere* ptr, char worldSpace, Matrix local);
|
||||
void GetBoneMatrix(short itemNumber, int joint, Matrix* outMatrix);
|
||||
void DrawObjectOn2DPosition(short x, short y, short objectNum, short rotX, short rotY, short rotZ,
|
||||
float scale1);
|
||||
void DrawObjectOn2DPosition(short x, short y, short objectNum, short rotX, short rotY, short rotZ, float scale1);
|
||||
void SetLoadingScreen(std::wstring& fileName);
|
||||
void SetTextureOrDefault(Texture2D& texture, std::wstring path);
|
||||
std::string GetDefaultAdapterName();
|
||||
|
|
|
@ -384,17 +384,17 @@ namespace TEN::Renderer
|
|||
return m_meshes[meshIndex];
|
||||
}
|
||||
|
||||
void Renderer11::GetLaraAbsBonePosition(Vector3 *pos, int joint)
|
||||
void Renderer11::GetLaraAbsBonePosition(Vector3& pos, int jointIndex)
|
||||
{
|
||||
if (joint >= MAX_BONES)
|
||||
joint = 0;
|
||||
if (jointIndex >= MAX_BONES)
|
||||
jointIndex = 0;
|
||||
|
||||
auto world = m_moveableObjects[ID_LARA]->AnimationTransforms[joint];
|
||||
auto world = m_moveableObjects[ID_LARA]->AnimationTransforms[jointIndex];
|
||||
world = world * m_LaraWorldMatrix;
|
||||
*pos = Vector3::Transform(*pos, world);
|
||||
pos = Vector3::Transform(pos, world);
|
||||
}
|
||||
|
||||
void Renderer11::GetItemAbsBonePosition(int itemNumber, Vector3 *pos, int joint)
|
||||
void Renderer11::GetItemAbsBonePosition(int itemNumber, Vector3* pos, int jointIndex)
|
||||
{
|
||||
auto* rendererItem = &m_items[itemNumber];
|
||||
auto* nativeItem = &g_Level.Items[itemNumber];
|
||||
|
@ -412,10 +412,10 @@ namespace TEN::Renderer
|
|||
UpdateItemAnimations(itemNumber, false);
|
||||
}
|
||||
|
||||
if (joint >= MAX_BONES)
|
||||
joint = 0;
|
||||
if (jointIndex >= MAX_BONES)
|
||||
jointIndex = 0;
|
||||
|
||||
auto world = rendererItem->AnimationTransforms[joint] * rendererItem->World;
|
||||
auto world = rendererItem->AnimationTransforms[jointIndex] * rendererItem->World;
|
||||
*pos = Vector3::Transform(*pos, world);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue