shared_ptr -> std::shared_ptr
This is one of the first commits in a plan to remove all `using namespace std;` lines in the entire codebase as it is considered anti-pattern today.
This commit is contained in:
@@ -7,7 +7,7 @@ BlazeModel::BlazeModel() : Model()
|
||||
{
|
||||
upperBodyParts = ModelPartArray(12);
|
||||
|
||||
for (unsigned int i = 0; i < upperBodyParts.length; i++)
|
||||
for (unsigned int i = 0; i < upperBodyParts.length; i++)
|
||||
{
|
||||
upperBodyParts[i] = new ModelPart(this, 0, 16);
|
||||
upperBodyParts[i]->addBox(0, 0, 0, 2, 8, 2);
|
||||
@@ -18,34 +18,34 @@ BlazeModel::BlazeModel() : Model()
|
||||
|
||||
// 4J added - compile now to avoid random performance hit first time cubes are rendered
|
||||
// 4J Stu - Not just performance, but alpha+depth tests don't work right unless we compile here
|
||||
for (unsigned int i = 0; i < upperBodyParts.length; i++)
|
||||
for (unsigned int i = 0; i < upperBodyParts.length; i++)
|
||||
{
|
||||
upperBodyParts[i]->compile(1.0f/16.0f);
|
||||
}
|
||||
head->compile(1.0f/16.0f);
|
||||
}
|
||||
|
||||
int BlazeModel::modelVersion()
|
||||
int BlazeModel::modelVersion()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
void BlazeModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
void BlazeModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
{
|
||||
setupAnim(time, r, bob, yRot, xRot, scale);
|
||||
|
||||
head->render(scale,usecompiled);
|
||||
for (unsigned int i = 0; i < upperBodyParts.length; i++)
|
||||
for (unsigned int i = 0; i < upperBodyParts.length; i++)
|
||||
{
|
||||
upperBodyParts[i]->render(scale, usecompiled);
|
||||
}
|
||||
}
|
||||
|
||||
void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim)
|
||||
void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim)
|
||||
{
|
||||
|
||||
float angle = bob * PI * -.1f;
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
upperBodyParts[i]->y = -2 + Mth::cos((i * 2 + bob) * .25f);
|
||||
upperBodyParts[i]->x = Mth::cos(angle) * 9.0f;
|
||||
@@ -53,7 +53,7 @@ void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRo
|
||||
angle += PI * 0.5f;
|
||||
}
|
||||
angle = .25f * PI + bob * PI * .03f;
|
||||
for (int i = 4; i < 8; i++)
|
||||
for (int i = 4; i < 8; i++)
|
||||
{
|
||||
upperBodyParts[i]->y = 2 + Mth::cos((i * 2 + bob) * .25f);
|
||||
upperBodyParts[i]->x = Mth::cos(angle) * 7.0f;
|
||||
@@ -62,7 +62,7 @@ void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRo
|
||||
}
|
||||
|
||||
angle = .15f * PI + bob * PI * -.05f;
|
||||
for (int i = 8; i < 12; i++)
|
||||
for (int i = 8; i < 12; i++)
|
||||
{
|
||||
upperBodyParts[i]->y = 11 + Mth::cos((i * 1.5f + bob) * .5f);
|
||||
upperBodyParts[i]->x = Mth::cos(angle) * 5.0f;
|
||||
|
||||
Reference in New Issue
Block a user