/// <summary> /// Tests if index is definied /// </summary> /// <param name="index"></param> /// <returns></returns> public static bool IsValidIndex(int index) { if (m_FileIndex == null) { return(false); } if (m_Cache[index] != null) { return(true); } int length, extra; if (!m_FileIndex.Valid(index, out length, out extra)) { return(false); } if (extra == -1) { return(false); } int width = (extra >> 16) & 0xFFFF; int height = extra & 0xFFFF; if (width <= 0 || height <= 0) { return(false); } return(true); }
public static bool IsValidLand(int index) { index &= 0x3FFF; if (m_Cache[index] != null) { return(true); } int length, extra; return(m_FileIndex.Valid(index, out length, out extra)); }
public static bool IsValidTexture(int index) { index &= 0x3FFF; if (m_Cache[index] != null) { return(true); } int length, extra; bool valid = m_FileIndex.Valid(index, out length, out extra); if ((!valid) || (length == 0)) { return(false); } return(true); }