public ActorFace(Resource.ResourceManager content, string actorCode) { _actorCode = actorCode; _faceDefinition = FaceDefinitions.GetFaceDefinition(actorCode); if (_faceDefinition == null) { // some actors don't have faces (like the chicken) _isEmptyFace = true; return; } _baseFace = content.Load <Graphics.TextureResource>(_faceDefinition.FaceName + ".BMP"); _mouths = new Graphics.TextureResource[8]; _mouths[0] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH00.BMP"); _mouths[1] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH01.BMP"); _mouths[2] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH02.BMP"); _mouths[3] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH03.BMP"); _mouths[4] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH04.BMP"); _mouths[5] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH05.BMP"); _mouths[6] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH06.BMP"); _mouths[7] = content.Load <Graphics.TextureResource>(actorCode + "_MOUTH07.BMP"); _smiles = new Graphics.TextureResource[2]; _smiles[0] = content.Load <Graphics.TextureResource>(actorCode + "_SMILE_01.BMP"); _smiles[1] = content.Load <Graphics.TextureResource>(actorCode + "_SMILE_02.BMP"); if (Graphics.RendererManager.CurrentRenderer.RenderToTextureSupported) { _renderTarget = Graphics.RendererManager.CurrentRenderer.CreateRenderTarget(_baseFace.Width, _baseFace.Height); _generatedFace = _renderTarget.Texture; } else { _generatedFace = Graphics.RendererManager.CurrentRenderer.CreateUpdatableTexture(actorCode + "_FACE", _baseFace.Width, _baseFace.Height); } updateTexture(false); }
public static void Load() { _verbs = new VerbDefinitions("verbs.txt", FileSystem.Open("verbs.txt")); _strings = new LocalizedStrings("estrings.txt", FileSystem.Open("estrings.txt")); FaceDefinitions.Load(); }