mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
parent
64c1777023
commit
13bad20803
3 changed files with 12 additions and 14 deletions
|
@ -140,7 +140,6 @@ void InitPickup(ObjectInfo* object, int objectNumber, std::function<ControlFunct
|
|||
if (object->loaded)
|
||||
{
|
||||
object->Initialize = InitializePickup;
|
||||
|
||||
object->collision = PickupCollision;
|
||||
object->control = (func != nullptr) ? func : PickupControl;
|
||||
object->isPickup = true;
|
||||
|
@ -156,7 +155,6 @@ void InitFlare(ObjectInfo* object, int objectNumber)
|
|||
object->collision = PickupCollision;
|
||||
object->control = FlareControl;
|
||||
object->pivotLength = 256;
|
||||
object->HitPoints = 256; // Time.
|
||||
object->usingDrawAnimatingItem = false;
|
||||
object->isPickup = true;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace TEN::Scripting
|
|||
// @treturn Time A new Time object initialized with the given frame count.
|
||||
Time::Time(int gameFrames)
|
||||
{
|
||||
_frameCount = gameFrames;
|
||||
_frameCount = std::clamp(gameFrames, 0, INT_MAX);
|
||||
}
|
||||
|
||||
/// Create a Time object from a formatted string.
|
||||
|
@ -194,18 +194,18 @@ namespace TEN::Scripting
|
|||
|
||||
Time& Time::operator -=(const Time& time)
|
||||
{
|
||||
_frameCount -= time._frameCount;
|
||||
_frameCount = std::clamp(_frameCount - time._frameCount, 0, INT_MAX);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Time Time::operator +(int frameCount) const
|
||||
{
|
||||
return Time(frameCount + _frameCount);
|
||||
return Time(_frameCount + frameCount);
|
||||
}
|
||||
|
||||
Time Time::operator -(int frameCount) const
|
||||
{
|
||||
return Time(frameCount - _frameCount);
|
||||
return Time(std::clamp(_frameCount - frameCount, 0, INT_MAX));
|
||||
}
|
||||
|
||||
Time Time::operator +(const Time& time) const
|
||||
|
@ -215,17 +215,17 @@ namespace TEN::Scripting
|
|||
|
||||
Time Time::operator -(const Time& time) const
|
||||
{
|
||||
return Time(_frameCount - time._frameCount);
|
||||
return Time(std::clamp(_frameCount - time._frameCount, 0, INT_MAX));
|
||||
}
|
||||
|
||||
Time Time::operator <(const Time& time) const
|
||||
bool Time::operator <(const Time& time) const
|
||||
{
|
||||
return Time(_frameCount < time._frameCount);
|
||||
return _frameCount < time._frameCount;
|
||||
}
|
||||
|
||||
Time Time::operator <=(const Time& time) const
|
||||
bool Time::operator <=(const Time& time) const
|
||||
{
|
||||
return Time(_frameCount <= time._frameCount);
|
||||
return _frameCount <= time._frameCount;
|
||||
}
|
||||
|
||||
bool Time::operator ==(const Time& time) const
|
||||
|
|
|
@ -42,13 +42,13 @@ namespace TEN::Scripting
|
|||
|
||||
// Operators
|
||||
|
||||
bool operator <(const Time& time) const;
|
||||
bool operator <=(const Time& time) const;
|
||||
bool operator ==(const Time& time) const;
|
||||
Time operator +(int frameCount) const;
|
||||
Time operator -(int frameCount) const;
|
||||
Time operator +(const Time& time) const;
|
||||
Time operator -(const Time& time) const;
|
||||
Time operator <(const Time& time) const;
|
||||
Time operator <=(const Time& time) const;
|
||||
bool operator ==(const Time& time) const;
|
||||
Time& operator +=(const Time& time);
|
||||
Time& operator -=(const Time& time);
|
||||
Time& Time::operator ++();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue