remove FMODex from Torque3D

The current version of FMod in Torque3D uses the legacy ex plugin, which hasn't been around for a long time.
This commit is contained in:
Jeff Hutchinson 2021-09-11 14:53:28 -04:00
parent 772c0ae25b
commit 41bd5ef6b6
34 changed files with 13 additions and 5317 deletions

View file

@ -216,26 +216,18 @@ function sfxCompareProvider( %providerA, %providerB )
switch$( %providerA )
{
// Always prefer FMOD over anything else.
case "FMOD":
return 1;
// Prefer OpenAL over anything but FMOD.
case "OpenAL":
if( %providerB $= "FMOD" )
return -1;
else
return 1;
// choose XAudio over DirectSound
case "XAudio":
if( %providerB $= "FMOD" || %providerB $= "OpenAL" )
if( %providerB $= "OpenAL" )
return -1;
else
return 0;
case "DirectSound":
if( %providerB !$= "FMOD" && %providerB !$= "OpenAL" && %providerB !$= "XAudio" )
if( %providerB !$= "OpenAL" && %providerB !$= "XAudio" )
return 1;
else
return -1;

View file

@ -25,7 +25,6 @@
// Preferences.
$pref::GuiMusicPlayer::filePattern = "*.ogg\t*.wav";
$pref::GuiMusicPlayer::filePatternFMOD = "*.aiff\t*.asf\t*.flac\t*.it\t*.mid\t*.mod\t*.mp2\t*.mp3\t*.ogg\t*.s3m\t*.vag\t*.wav\t*.wma\t*.xm";
$pref::GuiMusicPlayer::fadeTime = "3.0";
//---------------------------------------------------------------------------------------------

View file

@ -192,8 +192,7 @@ function sfxMetricsCallback()
{
return " | SFX |" @
" Sounds: " @ $SFX::numSounds @
" Lists: " @ ( $SFX::numSources - $SFX::numSounds - $SFX::Device::fmodNumEventSource ) @
" Events: " @ $SFX::fmodNumEventSources @
" Lists: " @ ( $SFX::numSources - $SFX::numSounds ) @
" Playing: " @ $SFX::numPlaying @
" Culled: " @ $SFX::numCulled @
" Voices: " @ $SFX::numVoices @

View file

@ -223,11 +223,7 @@ function DatablockEditorPlugin::isExcludedDatablockType( %this, %className )
case "SimDatablock":
return true;
case "SFXTrack": // Abstract.
return true;
case "SFXFMODEvent": // Internally created.
return true;
case "SFXFMODEventGroup": // Internally created.
return true;
return true;
}
return false;
}
@ -754,8 +750,7 @@ function DatablockEditorPlugin::canBeClientSideDatablock( %className )
"SFXAmbience" or
"SFXEnvironment" or
"SFXState" or
"SFXDescription" or
"SFXFMODProject":
"SFXDescription":
return true;
default:

View file

@ -1,7 +0,0 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="AddFMODProjectDlg,EditorGuiGroup"
scriptFile="@assetFile=AddFMODProjectDlg.ed.gui"
GUIFile="@assetFile=AddFMODProjectDlg.ed.gui"
VersionId="1" />

View file

@ -1,284 +0,0 @@
//--- OBJECT WRITE BEGIN ---
$guiContent = new GuiControl(AddFMODProjectDlg,EditorGuiGroup) {
isContainer = "1";
Profile = "ToolsGuiOverlayProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "0 0";
Extent = "1024 768";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "1";
new GuiWindowCtrl() {
resizeWidth = "0";
resizeHeight = "0";
canMove = "1";
canClose = "1";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "AddFMODProjectDlg.onCancel();";
EdgeSnap = "1";
text = "Add FMOD Designer Audio";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "1";
Profile = "ToolsGuiWindowProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "361 196";
Extent = "303 236";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
internalName = "window";
new GuiBitmapBorderCtrl() {
isContainer = "1";
Profile = "ToolsGuiGroupBorderProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "5 26";
Extent = "291 160";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
new GuiTextCtrl() {
text = "Path to the compiled event file (.fev):";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiAutoSizeTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "8 51";
Extent = "176 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl() {
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
passwordMask = "•";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "7 72";
Extent = "254 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
internalName = "fileNameField";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl() {
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
passwordMask = "•";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "7 127";
Extent = "254 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
internalName = "mediaPathField";
canSaveDynamicFields = "0";
};
new GuiTextCtrl() {
text = "Name for the SFXFMODProject object:";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiAutoSizeTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "8 10";
Extent = "189 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiTextEditCtrl() {
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
passwordMask = "•";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "7 30";
Extent = "277 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
internalName = "projectNameField";
canSaveDynamicFields = "0";
};
new GuiMLTextCtrl() {
lineSpacing = "2";
allowColorChars = "0";
maxChars = "-1";
text = "Path to the project\'s media files (leave empty if files are in same directory as the project file):";
useURLMouseCursor = "0";
isContainer = "0";
Profile = "ToolsGuiMLTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "8 96";
Extent = "276 26";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "...";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "266 72";
Extent = "18 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
command = "AddFMODProjectDlg.onSelectFile();";
};
new GuiButtonCtrl() {
text = "...";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "266 127";
Extent = "18 17";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
command = "AddFMODProjectDlg.onSelectMediaPath();";
};
};
new GuiButtonCtrl() {
text = "Cancel";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "206 196";
Extent = "90 30";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "AddFMODProjectDlg.onCancel();";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
new GuiButtonCtrl() {
text = "OK";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "112 196";
Extent = "90 30";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "AddFMODProjectDlg.onOK();";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
canSaveDynamicFields = "0";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -40,7 +40,6 @@ function initializeWorldEditor()
exec("./gui/ManageBookmarksWindow.ed.gui");
exec("./gui/ManageSFXParametersWindow.ed.gui" );
exec("./gui/TimeAdjustGui.ed.gui");
exec("./gui/AddFMODProjectDlg.ed.gui");
exec("./gui/SelectObjectsWindow.ed.gui");
exec("./gui/ProceduralTerrainPainterGui.gui" );
exec("tools/gui/renderTargetVisualizer.ed.gui");
@ -65,7 +64,6 @@ function initializeWorldEditor()
exec("./scripts/EditorChooseLevelGui.ed." @ $TorqueScriptFileExtension);
exec("./scripts/cameraBookmarks.ed." @ $TorqueScriptFileExtension);
exec("./scripts/ManageSFXParametersWindow.ed." @ $TorqueScriptFileExtension);
exec("./scripts/AddFMODProjectDlg.ed." @ $TorqueScriptFileExtension);
exec("./scripts/SelectObjectsWindow.ed." @ $TorqueScriptFileExtension);
exec("./scripts/cameraCommands.ed." @ $TorqueScriptFileExtension);
exec("./scripts/probeBake.ed." @ $TorqueScriptFileExtension);

View file

@ -1,253 +0,0 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//=============================================================================
// AddFMODProjectDlg.
//=============================================================================
//-----------------------------------------------------------------------------
function AddFMODProjectDlg::show( %this )
{
if( $platform $= "macos" )
{
%fmodex = "libfmodex.dylib";
%fmodevent = "libfmodevent.dylib";
}
else
{
%fmodex = "fmodex.dll";
%fmodevent = "fmod_event.dll";
}
// Make sure we have FMOD running.
if( getField( sfxGetDeviceInfo(), $SFX::DEVICE_INFO_PROVIDER ) !$= "FMOD" )
{
toolsMessageBoxOK( "Error",
"You do not currently have FMOD selected as your sound system." NL
"" NL
"To install FMOD, place the FMOD DLLs (" @ %fmodex @ " and " @ %fmodevent @ ")" SPC
"in your game/ folder alongside your game executable" SPC
"and restart Torque." NL
"" NL
"To select FMOD as your sound system, choose it as the sound provider in" SPC
"the audio tab of the Game Options dialog."
);
return;
}
// Make sure we have the FMOD Event DLL loaded.
%deviceCaps = getField( sfxGetDeviceInfo(), $SFX::DEVICE_INFO_CAPS );
if( !( %deviceCaps & $SFX::DEVICE_CAPS_FMODDESIGNER ) )
{
toolsMessageBoxOK( "Error",
"You do not have the requisite FMOD Event DLL in place." NL
"" NL
"Please copy " @ %fmodevent @ " into your game/ folder and restart Torque."
);
return;
}
// Show it.
Canvas.pushDialog( %this, 0, true );
}
//-----------------------------------------------------------------------------
function AddFMODProjectDlg::onWake( %this )
{
%this.persistenceMgr = new PersistenceManager();
}
//-----------------------------------------------------------------------------
function AddFMODProjectDlg::onSleep( %this )
{
%this.persistenceMgr.delete();
}
//-----------------------------------------------------------------------------
function AddFMODProjectDlg::onCancel( %this )
{
Canvas.popDialog( %this );
}
//-----------------------------------------------------------------------------
function AddFMODProjectDlg::onOK( %this )
{
%objName = %this-->projectNameField.getText();
%fileName = %this-->fileNameField.getText();
%mediaPath = %this-->mediaPathField.getText();
// Make sure the object name is valid.
if( !Editor::validateObjectName( %objName, true ))
return;
// Make sure the .fev file exists.
if( %fileName $= "" )
{
toolsMessageBoxOK( "Error",
"Please enter a project file name."
);
return;
}
if( !isFile( %fileName ) )
{
toolsMessageBoxOK( "Error",
"'" @ %fileName @ "' is not a valid file."
);
return;
}
// Make sure the media path exists.
if( !isDirectory( %mediaPath ) )
{
toolsMessageBoxOK( "Error",
"'" @ %mediaPath @ "' is not a valid directory."
);
return;
}
// If an event script exists from a previous instantiation,
// delete it first.
%eventFileName = %fileName @ "." @ $TorqueScriptFileExtension;
if( isFile( %eventFileName ) )
fileDelete( %eventFileName );
// Create the FMOD project object.
pushInstantGroup();
eval( "new SFXFMODProject( " @ %objName @ ") {" NL
"fileName = \"" @ %fileName @ "\";" NL
"mediaPath = \"" @ %mediaPath @ "\";" NL
"};" );
popInstantGroup();
if( !isObject( %objName ) )
{
toolsMessageBoxOK( "Error",
"Failed to create the object. Please take a look at the log for details."
);
return;
}
else
{
// Save the object.
%objName.setFileName( "scripts/client/audioData." @ $TorqueScriptFileExtension );
%this.persistenceMgr.setDirty( %objName );
%this.persistenceMgr.saveDirty();
}
Canvas.popDialog( %this );
// Trigger a reinit on the datablock editor, just in case.
if( isObject( DatablockEditorPlugin ) )
DatablockEditorPlugin.populateTrees();
}
//-----------------------------------------------------------------------------
function AddFMODProjectDlg::onSelectFile( %this )
{
if( $pref::WorldEditor::AddFMODProjectDlg::lastPath $= "" )
$pref::WorldEditor::AddFMODProjectDlg::lastPath = getMainDotCsDir();
%dlg = new OpenFileDialog()
{
Title = "Select Compiled FMOD Designer Event File...";
Filters = "Compiled Event Files (*.fev)|*.fev|All Files (*.*)|*.*|";
DefaultPath = $pref::WorldEditor::AddFMODProjectDlg::lastPath;
DefaultFile = fileName( %this-->fileNameField.getText() );
MustExit = true;
ChangePath = false;
};
%ret = %dlg.execute();
if( %ret )
{
%file = %dlg.fileName;
$pref::WorldEditor::AddFMODProjectDlg::lastPath = filePath( %file );
}
%dlg.delete();
if( !%ret )
return;
%file = makeRelativePath( %file, getMainDotCsDir() );
%this-->fileNameField.setText( %file );
if( %this-->projectNameField.getText() $= "" )
{
%projectName = "fmod" @ fileBase( %file );
if( isValidObjectName( %projectName ) )
%this-->projectNameField.setText( %projectName );
}
}
//-----------------------------------------------------------------------------
function AddFMODProjectDlg::onSelectMediaPath( %this )
{
%defaultPath = %this-->mediaPathField.getText();
if( %defaultPath $= "" )
{
%defaultPath = filePath( %this-->fileNameField.getText() );
if( %defaultPath $= "" )
%defaultPath = getMainDotCsDir();
else
%defaultPath = makeFullPath( %defaultPath );
}
%dlg = new OpenFolderDialog()
{
Title = "Select Media Path...";
DefaultPath = %defaultPath;
MustExit = true;
ChangePath = false;
};
%ret = %dlg.execute();
if( %ret )
%file = %dlg.fileName;
%dlg.delete();
if( !%ret )
return;
%file = makeRelativePath( %file, getMainDotCsDir() );
%this-->mediaPathField.setText( %file );
}

View file

@ -167,10 +167,7 @@ function EditorGui::buildMenus(%this)
//item[6] = "Import Texture Data..." TAB "" TAB "Texture::import();";
//item[7] = "-";
//item[8] = "Export Terraform Data..." TAB "" TAB "Heightfield::saveBitmap(\"\");";
%fileMenu.appendItem( "-" );
%fileMenu.appendItem( "Add FMOD Designer Audio..." TAB "" TAB "AddFMODProjectDlg.show();" );
%fileMenu.appendItem("-");
%fileMenu.appendItem("Play Level" TAB "F11" TAB "Editor.close(ProjectSettings.value(\"UI/playGUIName\"));");