Add data writing for IPaks

This commit is contained in:
Jan committed 2023-10-15 18:12:23 +02:00
1 parent 2d0ef40335
commit abbb697d7c
5 files changed
+157 -18

No files matched your search

+9 -1
View File
@@ -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;
}
}