converted all tabs to 4 spaces

This commit is contained in:
Yehonal
2016-06-26 19:23:57 +02:00
parent 52f305111c
commit f6eefedcd5
717 changed files with 132388 additions and 132388 deletions

View File

@@ -47,7 +47,7 @@ namespace Movement
Result_Arrived = 0x02,
Result_NextCycle = 0x04,
Result_NextSegment = 0x08,
Result_JustArrived = 0x10,
Result_JustArrived = 0x10,
};
friend class PacketBuilder;
protected:
@@ -81,8 +81,8 @@ namespace Movement
int32 segment_time_elapsed() const { return next_timestamp() - time_passed; }
public:
int32 timeElapsed() const { return Duration() - time_passed; } // xinef: moved to public for waypoint movegen
int32 timePassed() const { return time_passed; } // xinef: moved to public for waypoint movegen
int32 timeElapsed() const { return Duration() - time_passed; } // xinef: moved to public for waypoint movegen
int32 timePassed() const { return time_passed; } // xinef: moved to public for waypoint movegen
int32 Duration() const { return spline.length(); }
MySpline const& _Spline() const { return spline; }
int32 _currentSplineIdx() const { return point_Idx; }

View File

@@ -124,15 +124,15 @@ namespace Movement
data << int8(unit->GetTransSeat());
}
Movement::SplineBase::ControlArray* visualPoints = const_cast<Movement::SplineBase::ControlArray*>(move_spline._Spline().allocateVisualPoints());
visualPoints->resize(move_spline._Spline().getPointCount());
// Xinef: Apply hover in creature movement packet
if (unit->IsHovering())
std::transform(move_spline._Spline().getPoints(false).begin(), move_spline._Spline().getPoints(false).end(), visualPoints->begin(), HoverMovementTransform(unit->GetHoverHeight()));
else
std::copy(move_spline._Spline().getPoints(false).begin(), move_spline._Spline().getPoints(false).end(), visualPoints->begin());
Movement::SplineBase::ControlArray* visualPoints = const_cast<Movement::SplineBase::ControlArray*>(move_spline._Spline().allocateVisualPoints());
visualPoints->resize(move_spline._Spline().getPointCount());
// Xinef: Apply hover in creature movement packet
if (unit->IsHovering())
std::transform(move_spline._Spline().getPoints(false).begin(), move_spline._Spline().getPoints(false).end(), visualPoints->begin(), HoverMovementTransform(unit->GetHoverHeight()));
else
std::copy(move_spline._Spline().getPoints(false).begin(), move_spline._Spline().getPoints(false).end(), visualPoints->begin());
PacketBuilder::WriteMonsterMove(move_spline, data);
PacketBuilder::WriteMonsterMove(move_spline, data);
unit->SendMessageToSet(&data,true);
return move_spline.Duration();
@@ -178,8 +178,8 @@ namespace Movement
data << int8(unit->GetTransSeat());
}
// Xinef: increase z position in packet
loc.z += unit->GetHoverHeight();
// Xinef: increase z position in packet
loc.z += unit->GetHoverHeight();
PacketBuilder::WriteStopMovement(loc, args.splineId, data);
unit->SendMessageToSet(&data, true);
}

View File

@@ -26,8 +26,8 @@ class Unit;
namespace Movement
{
// xinef: moved declaration here so it can be accessed out of MoveSplineInit.cpp
UnitMoveType SelectSpeedType(uint32 moveFlags);
// xinef: moved declaration here so it can be accessed out of MoveSplineInit.cpp
UnitMoveType SelectSpeedType(uint32 moveFlags);
enum AnimType
{
@@ -50,20 +50,20 @@ namespace Movement
bool _transformForTransport;
};
// Xinef: transforms z coordinate with hover offset
class HoverMovementTransform
{
public:
HoverMovementTransform(float z_offset) : _offset(z_offset) { }
Vector3 operator()(Vector3 input)
{
input.z += _offset;
return input;
}
// Xinef: transforms z coordinate with hover offset
class HoverMovementTransform
{
public:
HoverMovementTransform(float z_offset) : _offset(z_offset) { }
Vector3 operator()(Vector3 input)
{
input.z += _offset;
return input;
}
private:
float _offset;
};
private:
float _offset;
};
/* Initializes and launches spline movement
*/

View File

@@ -44,7 +44,7 @@ namespace Movement
struct MoveSplineInitArgs
{
MoveSplineInitArgs(size_t path_capacity = 16) : path_Idx_offset(0), velocity(0.f),
parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f),
parabolic_amplitude(0.f), time_perc(0.f), splineId(0), initialOrientation(0.f),
HasVelocity(false), TransformForTransport(true)
{
path.reserve(path_capacity);

View File

@@ -70,9 +70,9 @@ namespace Movement
}
// add fake Enter_Cycle flag - needed for client-side cyclic movement (client will erase first spline vertex after first cycle done)
// Xinef: this flag breaks cycle for ground movement, client teleports npc between last and first point instead of using smooth movement
if (splineflags & MoveSplineFlag::Flying)
splineflags.enter_cycle = move_spline.isCyclic();
// Xinef: this flag breaks cycle for ground movement, client teleports npc between last and first point instead of using smooth movement
if (splineflags & MoveSplineFlag::Flying)
splineflags.enter_cycle = move_spline.isCyclic();
data << uint32(splineflags & uint32(~MoveSplineFlag::Mask_No_Monster_Move));
if (splineflags.animation)
@@ -129,16 +129,16 @@ namespace Movement
{
uint32 count = spline.getPointCount() - 3;
data << uint32(count+1);
if (flying)
{
data << spline.getPoint(1, true); // fake point, client will erase it from the spline after first cycle done
data.append<Vector3>(&spline.getPoint(2, true), count);
}
else
{
data.append<Vector3>(&spline.getPoint(2, true), count);
data << Vector3::zero(); //Xinef: fake point
}
if (flying)
{
data << spline.getPoint(1, true); // fake point, client will erase it from the spline after first cycle done
data.append<Vector3>(&spline.getPoint(2, true), count);
}
else
{
data.append<Vector3>(&spline.getPoint(2, true), count);
data << Vector3::zero(); //Xinef: fake point
}
}
void PacketBuilder::WriteMonsterMove(const MoveSpline& move_spline, ByteBuffer& data)
@@ -150,7 +150,7 @@ namespace Movement
if (splineflags & MoveSplineFlag::Mask_CatmullRom)
{
if (splineflags.cyclic)
WriteCatmullRomCyclicPath(spline, data, splineflags & MoveSplineFlag::Flying);
WriteCatmullRomCyclicPath(spline, data, splineflags & MoveSplineFlag::Flying);
else
WriteCatmullRomPath(spline, data);
}

View File

@@ -286,7 +286,7 @@ void SplineBase::clear()
index_lo = 0;
index_hi = 0;
points.clear();
pointsVisual.clear();
pointsVisual.clear();
}
std::string SplineBase::ToString() const