public void LoadScene(RmdScene rmdScene) { if (!mCanRender) { return; } Console.WriteLine("loading scene"); Console.WriteLine("num textures: {0} ", rmdScene.TextureDictionary != null ? rmdScene.TextureDictionary.TextureCount : 0); LoadTextures(rmdScene.TextureDictionary); foreach (var clump in rmdScene.Clumps) { LoadModel(clump); } }
private void ExtractRMD(string file) { RmdScene rmd = new RmdScene(file); foreach (var texture in rmd.TextureDictionary.Textures) { string output = txtBox_OutputDir.Text; if (chkBox_KeepFolderStructure.Checked) { output += Path.DirectorySeparatorChar + Path.GetDirectoryName(file).Substring(txtBox_SearchDir.Text.Length + 1); } if (chkBox_NameAfterContainers.Checked) { output += Path.DirectorySeparatorChar + Path.GetFileName(file) + "_extracted"; } Directory.CreateDirectory(output); var bitmap = texture.GetBitmap(); bitmap.Save(output + Path.DirectorySeparatorChar + Path.ChangeExtension(texture.Name, "png")); txtBox_Log.Text += $"Saving texture: {texture.Name}\n"; } }