Skip to content

Commit

Permalink
Wwise stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
andykorth committed Jun 13, 2015
1 parent e1951d1 commit 05ad2a9
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 32 deletions.
22 changes: 15 additions & 7 deletions cocos2d-tests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,10 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D30DD78F1A326DD40029014B /* ImageIO.framework in Frameworks */,
75D092A51AB5184B004519D8 /* AudioUnit.framework in Frameworks */,
75D0929D1AB39A2F004519D8 /* CoreAudio.framework in Frameworks */,
D3763DDD19E73667006C050D /* AppKit.framework in Frameworks */,
D3763DDB19E7364F006C050D /* OpenGL.framework in Frameworks */,
75D092781AB39A12004519D8 /* libAkAACDecoder.a in Frameworks */,
75D092791AB39A12004519D8 /* libAkAudioInputSource.a in Frameworks */,
75D0927A1AB39A12004519D8 /* libAkCompressorFX.a in Frameworks */,
Expand Down Expand Up @@ -823,10 +826,7 @@
75D0929A1AB39A12004519D8 /* libMcDSPFutzBoxFX.a in Frameworks */,
75D0929B1AB39A12004519D8 /* libMcDSPLimiterFX.a in Frameworks */,
75D0929F1AB510F4004519D8 /* libCommunicationCentral.a in Frameworks */,
75D092A51AB5184B004519D8 /* AudioUnit.framework in Frameworks */,
75D0929D1AB39A2F004519D8 /* CoreAudio.framework in Frameworks */,
D3763DDD19E73667006C050D /* AppKit.framework in Frameworks */,
D3763DDB19E7364F006C050D /* OpenGL.framework in Frameworks */,
D30DD78F1A326DD40029014B /* ImageIO.framework in Frameworks */,
D3763DD919E735CB006C050D /* libcocos2d-mac.a in Frameworks */,
D3763BFD19E73188006C050D /* GLKit.framework in Frameworks */,
D3763C0019E73188006C050D /* QuartzCore.framework in Frameworks */,
Expand Down Expand Up @@ -2150,6 +2150,10 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks",
);
GCC_DYNAMIC_NO_PIC = NO;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -2174,7 +2178,7 @@
Metal,
);
PRODUCT_NAME = "cocos2d-tests-mac";
SDKROOT = macosx;
SDKROOT = macosx10.9;
WRAPPER_EXTENSION = app;
};
name = Debug;
Expand All @@ -2185,6 +2189,10 @@
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ENABLE_OBJC_ARC = YES;
COPY_PHASE_STRIP = YES;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(DEVELOPER_DIR)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks",
);
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREPROCESSOR_DEFINITIONS = (
NDEBUG,
Expand All @@ -2207,7 +2215,7 @@
Metal,
);
PRODUCT_NAME = "cocos2d-tests-mac";
SDKROOT = macosx;
SDKROOT = macosx10.9;
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = app;
};
Expand Down
4 changes: 2 additions & 2 deletions cocos2d.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -4017,7 +4017,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.8;
MTL_ENABLE_DEBUG_INFO = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SDKROOT = macosx10.9;
SKIP_INSTALL = YES;
};
name = Debug;
Expand Down Expand Up @@ -4049,7 +4049,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.8;
MTL_ENABLE_DEBUG_INFO = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = macosx;
SDKROOT = macosx10.9;
SKIP_INSTALL = YES;
};
name = Release;
Expand Down
29 changes: 6 additions & 23 deletions cocos2d/Support/CCWwise.mm
Original file line number Diff line number Diff line change
Expand Up @@ -3,42 +3,25 @@
*
* Copyright (c) 2015 Andy Korth or Cocos2D Authors
*
* 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.
*/

#import <Cocoa/Cocoa.h>
#import "CCWwise.h"

// C++ shit
// C++ stuff
#include <cmath>
#include <cstdio>
#include <cassert>

// Apparently wwise needs these
// I thin wwise needs these
#include <AvailabilityMacros.h>
#include <AudioToolbox/AudioToolbox.h>

#include <CoreAudio/CoreAudioTypes.h>
#include <AK/SoundEngine/Common/AkTypes.h>
#include <AK/Tools/Common/AkPlatformFuncs.h>

// No sensible defaults, so I provide my own sensible defaults.
//Need to provide sensible defaults.
namespace AK
{
void * AllocHook( size_t in_size )
Expand All @@ -51,7 +34,7 @@ void FreeHook( void * in_ptr )
}
}

// Gotta add more shit to config the init.
// Gotta add more stuff to config the init.
#include <AK/SoundEngine/Common/AkMemoryMgr.h> // Memory Manager
#include <AK/SoundEngine/Common/AkModule.h> // Default memory and stream managers

Expand All @@ -60,7 +43,7 @@ void FreeHook( void * in_ptr )
#include <AK/MusicEngine/Common/AkMusicEngine.h> // Music Engine
#include <AK/SoundEngine/Common/AkStreamMgrModule.h> // AkStreamMgrModule

// The only one MY code needs.
// This is the only thing I need out of cocos2d, for the Wwise game object.
#import "CCNode.h"

// needed for CAkFilePackageLowLevelIOBlocking definition.
Expand Down Expand Up @@ -183,12 +166,12 @@ - (void) terminate
AK::MemoryMgr::Term();
}

// My code here:
- (void) RenderAudio
{
AK::SoundEngine::RenderAudio();
}

// now my shit is here
- (void) registerGameObject:(CCNode *) n
{
AK::SoundEngine::RegisterGameObj( (AkGameObjectID) n, [n.name UTF8String] );
Expand Down

0 comments on commit 05ad2a9

Please sign in to comment.