Skip to content

Commit 1823e0d

Browse files
committed
chore: add author log line and guard RGBA helper stocks
1 parent 6b7cbdc commit 1823e0d

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

omp_easing.inc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,16 @@ stock Float:easeInOutBounce(Float:t) return GetEasingValue(t, EASE_IN_OUT_BOUNCE
112112
stock Float:easeNone(Float:t) return GetEasingValue(t, EASE_NONE);
113113

114114
// helper function to get color from RGBA
115-
stock GetColorFromRGBA(red, green, blue, alpha = 255)
116-
{
117-
return ((red & 0xFF) << 24) | ((green & 0xFF) << 16) | ((blue & 0xFF) << 8) | (alpha & 0xFF);
118-
}
115+
#if !defined GetColorFromRGBA
116+
stock GetColorFromRGBA(red, green, blue, alpha = 255)
117+
{
118+
return ((red & 0xFF) << 24) | ((green & 0xFF) << 16) | ((blue & 0xFF) << 8) | (alpha & 0xFF);
119+
}
120+
#endif
119121

120-
stock GetRGBAFromColor(color, &red, &green, &blue, &alpha)
121-
{
122-
red = (color >> 24) & 0xFF; green = (color >> 16) & 0xFF; blue = (color >> 8) & 0xFF; alpha = color & 0xFF;
123-
}
122+
#if !defined GetRGBAFromColor
123+
stock GetRGBAFromColor(color, &red, &green, &blue, &alpha)
124+
{
125+
red = (color >> 24) & 0xFF; green = (color >> 16) & 0xFF; blue = (color >> 8) & 0xFF; alpha = color & 0xFF;
126+
}
127+
#endif

src/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ class EasingComponent final : public IComponent, public PawnEventHandler, public
651651
core->printLn(" Animation Pool: dynamic (starts at %d, grows on demand)", Config::initialAnimCapacity);
652652
core->printLn(" Update Rate: %d FPS (%d ms)", Config::updateRateFps, intervalMs);
653653
core->printLn(" Batch Limit: %d per frame", Config::batchProcessLimit);
654+
core->printLn(" Author: Fanorisky (https://github.com/Fanorisky/omp-easing-functions)");
654655
core->printLn(" ");
655656

656657
setAmxLookups(core);

0 commit comments

Comments
 (0)