NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
inlines.hpp
1#pragma once
2#include <types.h>
3
4namespace nw4r {
5namespace ut {
6
7 /// @brief Gets the smaller of the two given values.
8 template <typename T>
9 inline T Min(T a, T b) {
10 return (a > b) ? b : a;
11 }
12
13 /// @brief Gets the larger of the two given values.
14 template <typename T>
15 inline T Max(T a, T b) {
16 return (a < b) ? b : a;
17 }
18
19 /// @brief Rounds @p x up to a multiple of @p base.
20 template <typename T>
21 inline T RoundUp(T x, u32 base) {
22 return (T)((x + (base - 1)) & ~(base - 1));
23 }
24
25} // namespace ut
26} // namespace nw4r
Debugging library which includes various utilities used by the rest of nw4r.
Definition list.cpp:4
T RoundUp(T x, u32 base)
Rounds x up to a multiple of base.
Definition inlines.hpp:21
T Min(T a, T b)
Gets the smaller of the two given values.
Definition inlines.hpp:9
T Max(T a, T b)
Gets the larger of the two given values.
Definition inlines.hpp:15