Class PowerOfTwo
Provides static power of two calculations.
Namespace: DaggerfallConnect.Utility
Assembly: Assembly-CSharp.dll
Syntax
public static class PowerOfTwo
Methods
| Improve this Doc View SourceIsPowerOfTwo(Int32)
Check if value is a power of 2.
Declaration
public static bool IsPowerOfTwo(int x)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | Value to check. |
Returns
Type | Description |
---|---|
Boolean | True if power of 2. |
MipMapCount(Int32)
Gets count of mipmap levels for value.
Declaration
public static int MipMapCount(int x)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | Value. |
Returns
Type | Description |
---|---|
Int32 | Number of mipmap levels. |
MipMapSize(Int32, Int32)
Gets size of mipmap from value x at level. Value x must already be a power of 2. Never returns lower than 1.
Declaration
public static int MipMapSize(int x, int level)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | Value. |
Int32 | level | MipMap level. |
Returns
Type | Description |
---|---|
Int32 | Size of mipmap at level. |
NextPowerOfTwo(Int32)
Finds next power of 2 size for value.
Declaration
public static int NextPowerOfTwo(int x)
Parameters
Type | Name | Description |
---|---|---|
Int32 | x | Value. |
Returns
Type | Description |
---|---|
Int32 | Next power of 2. |