From 52aada22e106b6fd36b6b94fb3064510ac3ee40c Mon Sep 17 00:00:00 2001 From: Treeki Date: Sun, 13 Feb 2011 04:03:59 +0100 Subject: it converts textures too, now! some formats missing, I'll add them later. --- NW4RTools/Misc.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 NW4RTools/Misc.cs (limited to 'NW4RTools/Misc.cs') diff --git a/NW4RTools/Misc.cs b/NW4RTools/Misc.cs new file mode 100644 index 0000000..c42b185 --- /dev/null +++ b/NW4RTools/Misc.cs @@ -0,0 +1,21 @@ +using System; +namespace NW4RTools { + public static class Misc { + public static int AlignUp(int val, int to) { + return (val + (to - 1)) & ~(to - 1); + } + + public static uint AlignUp(uint val, uint to) { + return (val + (to - 1)) & ~(to - 1); + } + + public static int AlignDown(int val, int to) { + return val & ~(to - 1); + } + + public static uint AlignDown(uint val, uint to) { + return val & ~(to - 1); + } + } +} + -- cgit v1.2.3