public override bool Build(CompileMessages errors, bool forceRebuild) { if (!base.Build(errors, forceRebuild)) { return(false); } Factory.AGSEditor.SetMODMusicFlag(); DeleteAnyExistingSplitResourceFiles(); if (!DataFileWriter.SaveThisGameToFile(AGSEditor.COMPILED_DTA_FILE_NAME, Factory.AGSEditor.CurrentGame, errors)) { return(false); } string errorMsg = DataFileWriter.MakeDataFile(ConstructFileListForDataFile(errors), Factory.AGSEditor.CurrentGame.Settings.SplitResources * 1000000, Factory.AGSEditor.BaseGameFileName, true); if (errorMsg != null) { errors.Add(new CompileError(errorMsg)); } File.Delete(AGSEditor.COMPILED_DTA_FILE_NAME); CreateAudioVOXFile(forceRebuild); // Update config file with current game parameters Factory.AGSEditor.WriteConfigFile(GetCompiledPath()); return(true); }
private void RebuildVOXFile(string voxFileName, string[] filesOnDisk) { Utilities.TryDeleteFile(voxFileName); if (filesOnDisk.Length > 0) { // Register speech assets under names = relative paths inside a Speech folder; // e.g. Speech/cEgo1.ogg => cEgo1.ogg; // Speech/French/cEgo1.ogg => French/cEgo1.ogg; var assets = filesOnDisk.Select( f => new Tuple <string, string>(f.Substring(SPEECH_DIRECTORY.Length + 1), f)).ToArray(); DataFileWriter.MakeDataFile(assets, 0, voxFileName, false); } }
public override bool Build(CompileMessages errors, bool forceRebuild) { if (!base.Build(errors, forceRebuild)) { return(false); } Factory.AGSEditor.SetMODMusicFlag(); DeleteAnyExistingSplitResourceFiles(); if (Factory.AGSEditor.Preferences.UseLegacyCompiler) { Factory.NativeProxy.CompileGameToDTAFile(Factory.AGSEditor.CurrentGame, AGSEditor.COMPILED_DTA_FILE_NAME); // if using the legacy compiler, make sure engine EXE is copied before calling CreateGameEXE string newExeName = GetCompiledPath(Factory.AGSEditor.BaseGameFileName + ".exe"); string sourceEXE = Path.Combine(Factory.AGSEditor.EditorDirectory, AGSEditor.ENGINE_EXE_FILE_NAME); File.Copy(sourceEXE, newExeName, true); BuildTargetWindows targetWindows = (BuildTargetsInfo.FindBuildTargetByName("Windows") as BuildTargetWindows); // updating the Vista game explorer resources after the EXE is fully created is deleting the data file, // corrupting the game resources targetWindows.UpdateWindowsEXE(newExeName, errors); // the above all needs to be done here anyway, so finish up by creating the setup EXE and copying plugins targetWindows.CreateCompiledSetupProgram(); targetWindows.CopyPlugins(errors); Factory.NativeProxy.CreateGameEXE(ConstructFileListForDataFile(), Factory.AGSEditor.CurrentGame, Factory.AGSEditor.BaseGameFileName); } else { if (!DataFileWriter.SaveThisGameToFile(AGSEditor.COMPILED_DTA_FILE_NAME, Factory.AGSEditor.CurrentGame, errors)) { return(false); } string errorMsg = DataFileWriter.MakeDataFile(ConstructFileListForDataFile(), Factory.AGSEditor.CurrentGame.Settings.SplitResources * 1000000, Factory.AGSEditor.BaseGameFileName, true); if (errorMsg != null) { errors.Add(new CompileError(errorMsg)); } } File.Delete(AGSEditor.COMPILED_DTA_FILE_NAME); CreateAudioVOXFile(forceRebuild); // Update config file with current game parameters Factory.AGSEditor.WriteConfigFile(AGSEditor.OUTPUT_DIRECTORY); return(true); }
public void CreateTemplateFile(string templateFileName, string[] fileList) { DataFileWriter.MakeDataFile(fileList, 0, templateFileName, false); }