From 17418316eade4d652a8fba8bf3e41b3a87535775 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 6 Jul 2009 03:51:43 +0000 Subject: [PATCH] - Added support for FMOD Ex 4.25.01+, which added a geometry parameter to getCPUUsage(). SVN r1710 (trunk) --- src/sound/fmod_wrap.h | 4 ++++ src/sound/fmodsound.cpp | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/sound/fmod_wrap.h b/src/sound/fmod_wrap.h index aa298311c..3068c41d9 100644 --- a/src/sound/fmod_wrap.h +++ b/src/sound/fmod_wrap.h @@ -131,7 +131,11 @@ namespace FMOD FMOD_RESULT getOutputHandle (void **handle) { return FMOD_System_GetOutputHandle(this, handle); } FMOD_RESULT getChannelsPlaying (int *channels) { return FMOD_System_GetChannelsPlaying(this, channels); } FMOD_RESULT getHardwareChannels (int *num2d, int *num3d, int *total) { return FMOD_System_GetHardwareChannels(this, num2d, num3d, total); } +#if FMOD_VERSION < 0x42501 FMOD_RESULT getCPUUsage (float *dsp, float *stream, float *update, float *total) { return FMOD_System_GetCPUUsage(this, dsp, stream, update, total); } +#else + FMOD_RESULT getCPUUsage (float *dsp, float *stream, float *geometry, float *update, float *total) { return FMOD_System_GetCPUUsage(this, dsp, stream, geometry, update, total); } +#endif FMOD_RESULT getSoundRAM (int *currentalloced, int *maxalloced, int *total) { return FMOD_System_GetSoundRAM(this, currentalloced, maxalloced, total); } FMOD_RESULT getNumCDROMDrives (int *numdrives) { return FMOD_System_GetNumCDROMDrives(this, numdrives); } FMOD_RESULT getCDROMDriveName (int drive, char *drivename, int drivenamelen, char *scsiname, int scsinamelen, char *devicename, int devicenamelen) { return FMOD_System_GetCDROMDriveName(this, drive, drivename, drivenamelen, scsiname, scsinamelen, devicename, devicenamelen); } diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index f347f9051..72fe3988d 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -1279,19 +1279,24 @@ void FMODSoundRenderer::PrintDriversList() FString FMODSoundRenderer::GatherStats() { int channels; - float dsp, stream, update, total; + float dsp, stream, update, geometry, total; FString out; channels = 0; - total = update = stream = dsp = 0; + total = update = geometry = stream = dsp = 0; Sys->getChannelsPlaying(&channels); - Sys->getCPUUsage(&dsp, &stream, &update, &total); + Sys->getCPUUsage(&dsp, &stream, +#if FMOD_VERSION >= 0x42501 + &geometry, +#endif + &update, &total); out.Format ("%d channels,"TEXTCOLOR_YELLOW"%5.2f"TEXTCOLOR_NORMAL"%% CPU " "(DSP:"TEXTCOLOR_YELLOW"%2.2f"TEXTCOLOR_NORMAL"%% " "Stream:"TEXTCOLOR_YELLOW"%2.2f"TEXTCOLOR_NORMAL"%% " + "Geometry:"TEXTCOLOR_YELLOW"%2.2f"TEXTCOLOR_NORMAL"%% " "Update:"TEXTCOLOR_YELLOW"%2.2f"TEXTCOLOR_NORMAL"%%)", - channels, total, dsp, stream, update); + channels, total, dsp, stream, geometry, update); return out; }