public void Start() { string defName = fileResolver.Resolve(@"fonts/Roboto-Regular.ttf"); string icoName = fileResolver.Resolve(@"fonts/entypo.ttf"); string tpzName = fileResolver.Resolve(@"fonts/Topaz.ttf"); fonts.Init(defName, 12, tpzName, 12, icoName, 16); state = EngineState.Run; SwitchToSplashScreen(); }
public string Save(IFile file) { var fullFileName = string.Format("{0}.{1}", Guid.NewGuid(), file.Extension); var physicalPath = string.Concat(_fileResolver.Resolve(_destinationPath), fullFileName); using (var fileStream = System.IO.File.Create(physicalPath)) { file.Stream.Seek(0, SeekOrigin.Begin); file.Stream.CopyTo(fileStream); } return(fullFileName); }
public override Texture GetTexture(string textureId, IFileResolver fileResolver) { string assetName = fileResolver.Resolve(textureId); var bmp = game.Content.Load <Microsoft.Xna.Framework.Graphics.Texture2D>(assetName); return(new MONOTexture(textureId, bmp)); }
public override Texture GetTexture(string textureId, IFileResolver fileResolver) { string assetName = fileResolver.Resolve(textureId); IntPtr tex = SDL_image.IMG_LoadTexture(game.ren, assetName); return(new SDLTexture(textureId, tex)); }
public override Sound GetSound(string fileId, IFileResolver fileResolver) { IntPtr chunk = SDL_mixer.Mix_LoadWAV(fileResolver.Resolve(fileId)); if (!chunk.Equals(IntPtr.Zero)) { return(new SDLSound(fileId, chunk)); } return(null); }
public override Music GetMusic(string fileId, IFileResolver fileResolver) { IntPtr chunk = SDL_mixer.Mix_LoadMUS(fileResolver.Resolve(fileId)); if (!chunk.Equals(IntPtr.Zero)) { return(new SDLMusic(fileId, chunk)); } return(null); }
/// <summary> /// Agrega un archivo al zip /// </summary> /// <param name="identifier">Identificador del Zip</param> /// <param name="entryName">Nombre del elemento en el zip</param> /// <param name="FileInBytes">Informacion en Bytes que corresponde al elemento a subir</param> /// <param name="fileMode">Modo del archivo</param> public void AddOrUpdateFile(int identifier, EFileContainer fileContainer, string entryName, byte[] fileInBytes, FileMode fileMode) { var fullFileName = string.Format("{0}_{1}.zip", identifier, fileContainer); var physicalPath = string.Concat(_fileResolver.Resolve(_destinationPath + fileContainer + "/"), fullFileName); using (FileStream zipToOpen = new FileStream(physicalPath, fileMode)) { using (ZipArchive archive = new ZipArchive(zipToOpen, ZipArchiveMode.Update)) { ZipArchiveEntry readmeEntry = archive.GetEntry(entryName); if (readmeEntry == null) { readmeEntry = archive.CreateEntry(entryName); } using (BufferedStream writer = new BufferedStream(readmeEntry.Open())) { writer.Write(fileInBytes, 0, fileInBytes.Length); } } } }
public string Save(IFile file, EFileContainer fileContainer, int identifier) { var fullFileName = string.Format("{0}_{1}.{2}", identifier, fileContainer, file.Extension); var physicalPath = string.Concat(_fileResolver.Resolve(_destinationPath + fileContainer + "/"), fullFileName); using (var fileStream = System.IO.File.Create(physicalPath)) { file.Stream.Seek(0, SeekOrigin.Begin); file.Stream.CopyTo(fileStream); } return(fullFileName); }
public override Texture GetTexture(string textureId, IFileResolver fileResolver) { string fileName = fileResolver.Resolve(textureId); return(LoadTexture(textureId, fileName)); }