//Get a resource given an id // the id is coming from TILEART -> TEXTURES // or TERRAINDEF -> TEXTURES public static UOResource getResource(Tileart tileart) { UOResource resource = null; //WorldArt Texture if (tileart.textures[0].texturePresent == 1) { resource = getResource(tileart.textures[0].texturesArray[0], ShaderTypes.Sprite); } //LegacyTexture if (resource == null && tileart.textures[1].texturePresent == 1) { resource = getLegacyResource(tileart.textures[1].texturesArray[0]); } //EnhancedTexture //Is this really necessary? //Light Texture if (resource != null && tileart.textures[3].texturePresent == 1) { //TODO: light texture load } // if (resource == null) { UOConsole.Fatal("texture is not present {0}", tileart.id); tileart = UOResourceManager.getTileart(1); resource = getResource(tileart.textures[0].texturesArray[0], ShaderTypes.Sprite); } return(resource); }
public UOSprite(uint spriteID) { tileart = UOResourceManager.getTileart(spriteID); resource = UOResourceManager.getResource(tileart); if (resource.isLegacy) { _imageOffset = tileart.offset2D; } else { _imageOffset = tileart.offsetEC; } _drawOffsetX = tileart.offsetEC.offX / UOEC_SIZE; _drawOffsetY = tileart.offsetEC.offY / UOEC_SIZE; }