mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-11 07:18:11 -05:00
Add data writing for IPaks
This commit is contained in:
@ -3,10 +3,18 @@
|
||||
namespace utils
|
||||
{
|
||||
template <typename T>
|
||||
constexpr T Align(T value, T toNext)
|
||||
constexpr T Align(const T value, const T toNext)
|
||||
{
|
||||
if (toNext > 0)
|
||||
return (value + toNext - 1) / toNext * toNext;
|
||||
return value;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
constexpr T AlignToPrevious(const T value, const T toPrevious)
|
||||
{
|
||||
if (toPrevious > 0)
|
||||
return value / toPrevious * toPrevious;
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user