summaryrefslogtreecommitdiff
path: root/NW4RTools/Misc.cs
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2011-02-13 04:03:59 +0100
committerTreeki <treeki@gmail.com>2011-02-13 04:03:59 +0100
commit52aada22e106b6fd36b6b94fb3064510ac3ee40c (patch)
tree5cf5eb6866e33b023bfdaaf94ab1deb4b8ff71ab /NW4RTools/Misc.cs
parent8b48608d45c8266b765e8ee29e612fb18376aa65 (diff)
downloadnw4rtools-52aada22e106b6fd36b6b94fb3064510ac3ee40c.tar.gz
nw4rtools-52aada22e106b6fd36b6b94fb3064510ac3ee40c.zip
it converts textures too, now! some formats missing, I'll add them later.
Diffstat (limited to 'NW4RTools/Misc.cs')
-rw-r--r--NW4RTools/Misc.cs21
1 files changed, 21 insertions, 0 deletions
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);
+ }
+ }
+}
+