Skip to content

Commit

Permalink
Merge branch 'XP12_Sound'
Browse files Browse the repository at this point in the history
  • Loading branch information
TwinFan committed Jan 7, 2024
2 parents c3ee909 + febb699 commit b0b029e
Show file tree
Hide file tree
Showing 22 changed files with 20 additions and 7,577 deletions.
25 changes: 9 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,9 @@ else()
endif()

project(XPMP2-Sample
VERSION 3.1.0
VERSION 3.3.0
DESCRIPTION "XPMP2-Sample X-Plane plugin")

# Provide compile macros from the above project version definition
add_compile_definitions(
XPMP2_VERSION="${PROJECT_VERSION}"
XPMP2_VER_MAJOR=${PROJECT_VERSION_MAJOR}
XPMP2_VER_MINOR=${PROJECT_VERSION_MINOR}
)

message ("== Building: ${PROJECT_NAME} ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH} ==")
message ("Compiler Info:")
message ("CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}")
Expand All @@ -59,9 +52,9 @@ if (WIN32)
set(ENV{platform} "win")
endif()
elseif(APPLE)
set(CMAKE_OSX_DEPLOYMENT_TARGET 11.0)
add_compile_options(-mmacosx-version-min=11.0)
add_link_options(-mmacosx-version-min=11.0)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.15)
add_compile_options(-mmacosx-version-min=10.15)
add_link_options(-mmacosx-version-min=10.15)
endif()

################################################################################
Expand All @@ -77,7 +70,7 @@ set_property(GLOBAL PROPERTY CXX_STANDARD 17)
################################################################################

# Enable all X-Plane SDK APIs up to the newest version.
add_compile_definitions(XPLM200=1 XPLM210=1 XPLM300=1 XPLM301=1 XPLM303=1)
add_compile_definitions(XPLM200=1 XPLM210=1 XPLM300=1 XPLM301=1 XPLM303=1 XPLM400=1)

# Define platform macros.
add_compile_definitions(APL=$<BOOL:${APPLE}> IBM=$<BOOL:${WIN32}> LIN=$<AND:$<BOOL:${UNIX}>,$<NOT:$<BOOL:${APPLE}>>>)
Expand Down Expand Up @@ -136,7 +129,7 @@ add_library(XPMP2-Sample MODULE
# Header include directories
target_include_directories(XPMP2-Sample PRIVATE
${ADDITIONAL_INCLUDES}
${CMAKE_CURRENT_SOURCE_DIR}/lib/SDK/CHeaders/XPLM
${CMAKE_CURRENT_SOURCE_DIR}/lib/XPMP2/lib/SDK/CHeaders/XPLM
${CMAKE_CURRENT_SOURCE_DIR}/lib/XPMP2/inc
)

Expand All @@ -149,16 +142,16 @@ target_include_directories(XPMP2-Sample PRIVATE
# XPMP2 path is hard-coded. Couldn't convince find_library to distinguish libXPMP2.a from XPMP2.lib in Mingw vs MSVC build.
if (APPLE)
list(APPEND CMAKE_FRAMEWORK_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/lib/SDK/Libraries/Mac")
"${CMAKE_CURRENT_SOURCE_DIR}/lib/XPMP2/lib/SDK/Libraries/Mac")
else ()
list(APPEND CMAKE_LIBRARY_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/lib/SDK/Libraries/Win")
"${CMAKE_CURRENT_SOURCE_DIR}/lib/XPMP2/lib/SDK/Libraries/Win")
endif ()

# FMOD Library only if requested
if(INCLUDE_FMOD_SOUND)
# Compile options
add_compile_definitions(INCLUDE_FMOD_SOUND)
add_compile_definitions(INCLUDE_FMOD_SOUND=1)

# Link Options (only for Win/Mac)
if(WIN32 OR APPLE)
Expand Down
4 changes: 2 additions & 2 deletions XPMP2-Sample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void CBPlaneNotifier(XPMPPlaneID inPlaneID,
}
}

#if defined(DEBUG) && defined(INCLUDE_FMOD_SOUND)
#if defined(DEBUG) && (INCLUDE_FMOD_SOUND + 0 >= 1)
/// Just for purposes of testing this functionality, we list all loaded sounds
void DebugListLoadedSoundNames()
{
Expand Down Expand Up @@ -1014,7 +1014,7 @@ PLUGIN_API int XPluginEnable(void)
LogMsg("XPMP2-Sample: Error while loading CSL packages: %s", res);
}

#if defined(DEBUG) && defined(INCLUDE_FMOD_SOUND)
#if defined(DEBUG) && (INCLUDE_FMOD_SOUND + 0 >= 1)
// Just for purposes of testing this functionality, we list all loaded sounds
// (This is likely not required in your plugin)
DebugListLoadedSoundNames();
Expand Down
16 changes: 8 additions & 8 deletions XPMP2-Sample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
objects = {

/* Begin PBXBuildFile section */
254A0B7A2918533F004CA228 /* XPLM.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 254A0B792918533F004CA228 /* XPLM.framework */; };
254A0B7C29185357004CA228 /* libfmod.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 254A0B7B29185357004CA228 /* libfmod.dylib */; };
254A0B89291853EF004CA228 /* XPMP2.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 254A0B84291853CD004CA228 /* XPMP2.framework */; };
2572C40623D88802006A7726 /* XPMP2-Sample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2572C40523D88802006A7726 /* XPMP2-Sample.cpp */; };
25F4A2E72A3F9CF8002509C3 /* XPLM.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 25F4A2E62A3F9CF8002509C3 /* XPLM.framework */; };
D6A7BDC116A1DEC000D1426A /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D6A7BDC016A1DEC000D1426A /* CoreFoundation.framework */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -54,11 +54,11 @@
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
254A0B792918533F004CA228 /* XPLM.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XPLM.framework; path = lib/SDK/Libraries/Mac/XPLM.framework; sourceTree = "<group>"; };
254A0B7B29185357004CA228 /* libfmod.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libfmod.dylib; path = lib/fmod/libfmod.dylib; sourceTree = "<group>"; };
254A0B7D291853CD004CA228 /* XPMP2.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = XPMP2.xcodeproj; path = lib/XPMP2/XPMP2.xcodeproj; sourceTree = "<group>"; };
2572C40523D88802006A7726 /* XPMP2-Sample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "XPMP2-Sample.cpp"; sourceTree = "<group>"; };
25A0F27323E8B906007D6B6E /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = "<group>"; };
25F4A2E62A3F9CF8002509C3 /* XPLM.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XPLM.framework; path = lib/XPMP2/lib/SDK/Libraries/Mac/XPLM.framework; sourceTree = "<group>"; };
D607B19909A556E400699BC3 /* XPMP2-Sample.xpl */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = "XPMP2-Sample.xpl"; sourceTree = BUILT_PRODUCTS_DIR; };
D6A7BDA916A1DEA200D1426A /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
D6A7BDC016A1DEC000D1426A /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
Expand All @@ -71,7 +71,7 @@
files = (
D6A7BDC116A1DEC000D1426A /* CoreFoundation.framework in Frameworks */,
254A0B7C29185357004CA228 /* libfmod.dylib in Frameworks */,
254A0B7A2918533F004CA228 /* XPLM.framework in Frameworks */,
25F4A2E72A3F9CF8002509C3 /* XPLM.framework in Frameworks */,
254A0B89291853EF004CA228 /* XPMP2.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -116,9 +116,9 @@
D6A7BDAD16A1DEA700D1426A /* Frameworks */ = {
isa = PBXGroup;
children = (
25F4A2E62A3F9CF8002509C3 /* XPLM.framework */,
254A0B7D291853CD004CA228 /* XPMP2.xcodeproj */,
254A0B7B29185357004CA228 /* libfmod.dylib */,
254A0B792918533F004CA228 /* XPLM.framework */,
D6A7BDC016A1DEC000D1426A /* CoreFoundation.framework */,
D6A7BDA916A1DEA200D1426A /* OpenGL.framework */,
);
Expand Down Expand Up @@ -251,7 +251,7 @@
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
EXECUTABLE_EXTENSION = xpl;
FRAMEWORK_SEARCH_PATHS = lib/SDK/Libraries/Mac;
FRAMEWORK_SEARCH_PATHS = lib/XPMP2/lib/SDK/Libraries/Mac;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
Expand Down Expand Up @@ -286,7 +286,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
lib/SDK/CHeaders/XPLM,
lib/XPMP2/lib/SDK/CHeaders/XPLM,
lib/XPMP2/inc,
"$(HEADER_SEARCH_PATHS)",
);
Expand Down Expand Up @@ -356,7 +356,7 @@
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
EXECUTABLE_EXTENSION = xpl;
FRAMEWORK_SEARCH_PATHS = lib/SDK/Libraries/Mac;
FRAMEWORK_SEARCH_PATHS = lib/XPMP2/lib/SDK/Libraries/Mac;
GCC_C_LANGUAGE_STANDARD = c11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand Down Expand Up @@ -390,7 +390,7 @@
GCC_WARN_UNUSED_PARAMETER = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
lib/SDK/CHeaders/XPLM,
lib/XPMP2/lib/SDK/CHeaders/XPLM,
lib/XPMP2/inc,
"$(HEADER_SEARCH_PATHS)",
);
Expand Down
167 changes: 0 additions & 167 deletions lib/SDK/CHeaders/XPLM/XPLMCamera.h

This file was deleted.

Loading

0 comments on commit b0b029e

Please sign in to comment.