Skip to content

Commit

Permalink
Downgrade FMOD version, use the version shipped with X-Plane
Browse files Browse the repository at this point in the history
  • Loading branch information
justinshannon committed Feb 10, 2022
1 parent cc5a9bd commit ae173c6
Show file tree
Hide file tree
Showing 25 changed files with 3,616 additions and 1,652 deletions.
11 changes: 1 addition & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ jobs:
mkdir -p ${{ github.workspace }}/xPilot/lin_x64
cp ${{ env.PLUGIN_DIR }}/build/lin_x64/xPilot.xpl ${{ github.workspace }}/xPilot/lin_x64
cp ${{ env.PLUGIN_DIR }}/build/lin_x64/xPilot.debug ${{ github.workspace }}/xPilot/lin_x64
cp -R ${{ github.workspace }}/plugin/externals/fmod/lin/libfmod* ${{ github.workspace }}/xPilot/lin_x64
cp -R ${{ github.workspace }}/plugin/Resources ${{ github.workspace }}/xPilot/
### Build Client ###
Expand Down Expand Up @@ -228,7 +227,7 @@ jobs:
- name: Install plugin conan packages
working-directory: ${{ env.PLUGIN_DIR }}/build
run: |
conan install .. -s compiler.runtime=MT -o openal:shared=True --build=missing
conan install .. -s compiler.runtime=MT --build=missing
- name: Plugin CMake
working-directory: ${{ env.PLUGIN_DIR }}/build
Expand All @@ -245,7 +244,6 @@ jobs:
mkdir -p ${{ github.workspace }}/xPilot/win_x64
cp ${{ env.PLUGIN_DIR }}/build/win_x64/xPilot.xpl ${{ github.workspace }}/xPilot/win_x64
cp ${{ env.PLUGIN_DIR }}/build/win_x64/xPilot.pdb ${{ github.workspace }}/xPilot/win_x64
cp ${{ github.workspace }}/plugin/externals/fmod/win/fmod.dll ${{ github.workspace }}/xPilot/win_x64
cp -R ${{ github.workspace }}/plugin/Resources ${{ github.workspace }}/xPilot/
### Build Client ###
Expand Down Expand Up @@ -396,14 +394,7 @@ jobs:
mkdir -p ${{ github.workspace }}/xPilot/mac_x64
cp ${{ env.PLUGIN_DIR }}/build/mac_x64/xPilot.xpl ${{ github.workspace }}/xPilot/mac_x64
cp -R ${{ env.PLUGIN_DIR }}/build/mac_x64/xPilot.dSYM ${{ github.workspace }}/xPilot/mac_x64
cp ${{ github.workspace }}/plugin/externals/fmod/mac/libfmod.dylib ${{ github.workspace }}/xPilot/mac_x64
cp -R ${{ github.workspace }}/plugin/Resources ${{ github.workspace }}/xPilot/
- name: Fix FMOD shared library install name
working-directory: ${{ github.workspace }}/xPilot/mac_x64
run: |
install_name_tool -id @executable_path/../../../Resources/plugins/xPilot/mac_x64/libfmod.dylib libfmod.dylib
install_name_tool -change @rpath/libfmod.dylib @executable_path/../../../Resources/plugins/xPilot/mac_x64/libfmod.dylib xPilot.xpl
### Build Client ###

Expand Down
18 changes: 18 additions & 0 deletions installer/project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,24 @@
</setInstallerVariable>
</readyToInstallActionList>
<postInstallationActionList>
<deleteFile>
<path>${xplanepath}/Resources/plugins/xPilot/win_x64/fmod.dll</path>
<ruleList>
<platformTest type="windows"/>
</ruleList>
</deleteFile>
<deleteFile>
<path>${xplanepath}/Resources/plugins/xPilot/mac_x64/libfmod.dylib</path>
<ruleList>
<platformTest type="osx"/>
</ruleList>
</deleteFile>
<deleteFile>
<path>${xplanepath}/Resources/plugins/xPilot/lin_x64/libfmod.*</path>
<ruleList>
<platformTest type="linux"/>
</ruleList>
</deleteFile>
<writeFile>
<encoding>utf-8</encoding>
<path>${desktop_prefix}/xPilot.desktop</path>
Expand Down
11 changes: 3 additions & 8 deletions plugin/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
cmake_minimum_required(VERSION 3.16)
project(xpilot LANGUAGES C CXX VERSION 2.0.0)

set(CONAN_DISABLE_CHECK_COMPILER TRUE)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

set(CMAKE_CXX_STANDARD 17)
set_property(GLOBAL PROPERTY CXX_STANDARD_REQUIRED 17)
set_property(GLOBAL PROPERTY CXX_STANDARD 17)

if(UNIX AND NOT APPLE)
# fix rpath on linux
SET(CMAKE_SKIP_BUILD_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH "\$ORIGIN")
endif()

file(READ ${CMAKE_SOURCE_DIR}/../xpilot.json XPILOT_JSON)
string(JSON IS_BETA_VERSION GET ${XPILOT_JSON} is_beta)
string(JSON BETA_NUMBER GET ${XPILOT_JSON} beta_number)
Expand Down Expand Up @@ -133,7 +128,7 @@ message ("XPMP2_LIBRARY = ${XPMP2_LIBRARY}")
target_link_libraries(${PROJECT_NAME} ${XPMP2_LIBRARY})

if(WIN32)
find_library(FMOD_LIBRARY NAMES fmod_vc.lib REQUIRED)
find_library(FMOD_LIBRARY NAMES fmod64_vc.lib REQUIRED)
message ("FMOD_LIBRARY = ${FMOD_LIBRARY}")
target_link_libraries(${PROJECT_NAME} ${FMOD_LIBRARY})
elseif(APPLE)
Expand Down
113 changes: 83 additions & 30 deletions plugin/externals/fmod/include/fmod.h

Large diffs are not rendered by default.

36 changes: 18 additions & 18 deletions plugin/externals/fmod/include/fmod.hpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
/* ======================================================================================== */
/* FMOD Core API - C++ header file. */
/* Copyright (c), Firelight Technologies Pty, Ltd. 2004-2021. */
/* */
/* Use this header in conjunction with fmod_common.h (which contains all the constants / */
/* callbacks) to develop using the C++ language. */
/* */
/* For more detail visit: */
/* https://fmod.com/resources/documentation-api?version=2.0&page=core-api.html */
/* ======================================================================================== */
/* ========================================================================================== */
/* FMOD Studio - C++ header file. Copyright (c), Firelight Technologies Pty, Ltd. 2004-2018. */
/* */
/* Use this header in conjunction with fmod_common.h (which contains all the constants / */
/* callbacks) to develop using C++ classes. */
/* ========================================================================================== */

#ifndef _FMOD_HPP
#define _FMOD_HPP

#include "fmod_common.h"
#include "fmod.h"

/*
Constant and defines
*/

/*
FMOD Namespace
*/
Expand All @@ -38,12 +39,11 @@ namespace FMOD
inline FMOD_RESULT Debug_Initialize (FMOD_DEBUG_FLAGS flags, FMOD_DEBUG_MODE mode = FMOD_DEBUG_MODE_TTY, FMOD_DEBUG_CALLBACK callback = 0, const char *filename = 0) { return FMOD_Debug_Initialize(flags, mode, callback, filename); }
inline FMOD_RESULT File_SetDiskBusy (int busy) { return FMOD_File_SetDiskBusy(busy); }
inline FMOD_RESULT File_GetDiskBusy (int *busy) { return FMOD_File_GetDiskBusy(busy); }
inline FMOD_RESULT Thread_SetAttributes (FMOD_THREAD_TYPE type, FMOD_THREAD_AFFINITY affinity = FMOD_THREAD_AFFINITY_GROUP_DEFAULT, FMOD_THREAD_PRIORITY priority = FMOD_THREAD_PRIORITY_DEFAULT, FMOD_THREAD_STACK_SIZE stacksize = FMOD_THREAD_STACK_SIZE_DEFAULT) { return FMOD_Thread_SetAttributes(type, affinity, priority, stacksize); }

/*
FMOD System factory functions.
*/
inline FMOD_RESULT System_Create (System **system, unsigned int headerversion = FMOD_VERSION) { return FMOD_System_Create((FMOD_SYSTEM **)system, headerversion); }
inline FMOD_RESULT System_Create (System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }

/*
'System' API
Expand Down Expand Up @@ -123,8 +123,9 @@ namespace FMOD
FMOD_RESULT F_API getVersion (unsigned int *version);
FMOD_RESULT F_API getOutputHandle (void **handle);
FMOD_RESULT F_API getChannelsPlaying (int *channels, int *realchannels = 0);
FMOD_RESULT F_API getCPUUsage (FMOD_CPU_USAGE *usage);
FMOD_RESULT F_API getCPUUsage (float *dsp, float *stream, float *geometry, float *update, float *total);
FMOD_RESULT F_API getFileUsage (long long *sampleBytesRead, long long *streamBytesRead, long long *otherBytesRead);
FMOD_RESULT F_API getSoundRAM (int *currentalloced, int *maxalloced, int *total);

// Sound/DSP/Channel/FX creation and retrieval.
FMOD_RESULT F_API createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound);
Expand All @@ -138,7 +139,6 @@ namespace FMOD
FMOD_RESULT F_API playSound (Sound *sound, ChannelGroup *channelgroup, bool paused, Channel **channel);
FMOD_RESULT F_API playDSP (DSP *dsp, ChannelGroup *channelgroup, bool paused, Channel **channel);
FMOD_RESULT F_API getChannel (int channelid, Channel **channel);
FMOD_RESULT F_API getDSPInfoByType (FMOD_DSP_TYPE type, const FMOD_DSP_DESCRIPTION **description);
FMOD_RESULT F_API getMasterChannelGroup (ChannelGroup **channelgroup);
FMOD_RESULT F_API getMasterSoundGroup (SoundGroup **soundgroup);

Expand Down Expand Up @@ -216,7 +216,7 @@ namespace FMOD
FMOD_RESULT F_API getNumTags (int *numtags, int *numtagsupdated);
FMOD_RESULT F_API getTag (const char *name, int index, FMOD_TAG *tag);
FMOD_RESULT F_API getOpenState (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving, bool *diskbusy);
FMOD_RESULT F_API readData (void *buffer, unsigned int length, unsigned int *read);
FMOD_RESULT F_API readData (void *buffer, unsigned int lenbytes, unsigned int *read);
FMOD_RESULT F_API seekData (unsigned int pcm);

FMOD_RESULT F_API setSoundGroup (SoundGroup *soundgroup);
Expand Down Expand Up @@ -311,10 +311,11 @@ namespace FMOD
FMOD_RESULT F_API getNumDSPs (int *numdsps);
FMOD_RESULT F_API setDSPIndex (DSP *dsp, int index);
FMOD_RESULT F_API getDSPIndex (DSP *dsp, int *index);
FMOD_RESULT F_API overridePanDSP (DSP *pan);

// 3D functionality.
FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel);
FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel);
FMOD_RESULT F_API set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *alt_pan_pos = 0);
FMOD_RESULT F_API get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *alt_pan_pos = 0);
FMOD_RESULT F_API set3DMinMaxDistance (float mindistance, float maxdistance);
FMOD_RESULT F_API get3DMinMaxDistance (float *mindistance, float *maxdistance);
FMOD_RESULT F_API set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume);
Expand Down Expand Up @@ -501,7 +502,6 @@ namespace FMOD
FMOD_RESULT F_API setMeteringEnabled (bool inputEnabled, bool outputEnabled);
FMOD_RESULT F_API getMeteringEnabled (bool *inputEnabled, bool *outputEnabled);
FMOD_RESULT F_API getMeteringInfo (FMOD_DSP_METERING_INFO *inputInfo, FMOD_DSP_METERING_INFO *outputInfo);
FMOD_RESULT F_API getCPUUsage (unsigned int *exclusive, unsigned int *inclusive);
};


Expand Down
Loading

0 comments on commit ae173c6

Please sign in to comment.