gzdoom-last-svn/src/sound/fmod_wrap.h

613 lines
53 KiB
C
Raw Normal View History

#ifndef FMOD_WRAP_H
#define FMOD_WRAP_H
#if !defined(_WIN32) || defined(_MSC_VER)
// Use the real C++ interface if it's supported on this platform.
#include "fmod.hpp"
#else
// Use a wrapper C++ interface for non-Microsoft compilers on Windows.
#include "fmod.h"
// Create fake definitions for these structs so they can be subclassed.
struct FMOD_SYSTEM {};
struct FMOD_SOUND {};
struct FMOD_CHANNEL {};
struct FMOD_CHANNELGROUP {};
struct FMOD_SOUNDGROUP {};
struct FMOD_REVERB {};
struct FMOD_DSP {};
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
struct FMOD_DSPCONNECTION {};
struct FMOD_POLYGON {};
struct FMOD_GEOMETRY {};
struct FMOD_SYNCPOINT {};
/*
Constant and defines
*/
/*
FMOD Namespace
*/
namespace FMOD
{
class System;
class Sound;
class Channel;
class ChannelGroup;
class SoundGroup;
class Reverb;
class DSP;
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
class DSPConnection;
class Geometry;
/*
FMOD global system functions (optional).
*/
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
inline FMOD_RESULT Memory_Initialize(void *poolmem, int poollen, FMOD_MEMORY_ALLOCCALLBACK useralloc, FMOD_MEMORY_REALLOCCALLBACK userrealloc, FMOD_MEMORY_FREECALLBACK userfree, FMOD_MEMORY_TYPE memtypeflags = (FMOD_MEMORY_NORMAL | FMOD_MEMORY_XBOX360_PHYSICAL)) { return FMOD_Memory_Initialize(poolmem, poollen, useralloc, userrealloc, userfree, memtypeflags); }
//inline FMOD_RESULT Memory_GetStats(int *currentalloced, int *maxalloced) { return FMOD_Memory_GetStats(currentalloced, maxalloced); }
inline FMOD_RESULT Debug_SetLevel(FMOD_DEBUGLEVEL level) { return FMOD_Debug_SetLevel(level); }
inline FMOD_RESULT Debug_GetLevel(FMOD_DEBUGLEVEL *level) { return FMOD_Debug_GetLevel(level); }
inline FMOD_RESULT File_SetDiskBusy(int busy) { return FMOD_File_SetDiskBusy(busy); }
inline FMOD_RESULT File_GetDiskBusy(int *busy) { return FMOD_File_GetDiskBusy(busy); }
/*
FMOD System factory functions.
*/
inline FMOD_RESULT System_Create(System **system) { return FMOD_System_Create((FMOD_SYSTEM **)system); }
/*
'System' API
*/
class System : FMOD_SYSTEM
{
private:
System(); /* Constructor made private so user cannot statically instance a System class.
System_Create must be used. */
public:
FMOD_RESULT release () { return FMOD_System_Release(this); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Pre-init functions.
FMOD_RESULT setOutput (FMOD_OUTPUTTYPE output) { return FMOD_System_SetOutput(this, output); }
FMOD_RESULT getOutput (FMOD_OUTPUTTYPE *output) { return FMOD_System_GetOutput(this, output); }
FMOD_RESULT getNumDrivers (int *numdrivers) { return FMOD_System_GetNumDrivers(this, numdrivers); }
FMOD_RESULT getDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid) { return FMOD_System_GetDriverInfo(this, id, name, namelen, guid); }
FMOD_RESULT getDriverCaps (int id, FMOD_CAPS *caps, int *minfrequency, int *maxfrequency, FMOD_SPEAKERMODE *controlpanelspeakermode) { return FMOD_System_GetDriverCaps(this, id, caps, minfrequency, maxfrequency, controlpanelspeakermode); }
FMOD_RESULT setDriver (int driver) { return FMOD_System_SetDriver(this, driver); }
FMOD_RESULT getDriver (int *driver) { return FMOD_System_GetDriver(this, driver); }
FMOD_RESULT setHardwareChannels (int min2d, int max2d, int min3d, int max3d) { return FMOD_System_SetHardwareChannels(this, min2d, max2d, min3d, max3d); }
FMOD_RESULT setSoftwareChannels (int numsoftwarechannels) { return FMOD_System_SetSoftwareChannels(this, numsoftwarechannels); }
FMOD_RESULT getSoftwareChannels (int *numsoftwarechannels) { return FMOD_System_GetSoftwareChannels(this, numsoftwarechannels); }
FMOD_RESULT setSoftwareFormat (int samplerate, FMOD_SOUND_FORMAT format, int numoutputchannels, int maxinputchannels, FMOD_DSP_RESAMPLER resamplemethod) { return FMOD_System_SetSoftwareFormat(this, samplerate, format, numoutputchannels, maxinputchannels, resamplemethod); }
FMOD_RESULT getSoftwareFormat (int *samplerate, FMOD_SOUND_FORMAT *format, int *numoutputchannels, int *maxinputchannels, FMOD_DSP_RESAMPLER *resamplemethod, int *bits) { return FMOD_System_GetSoftwareFormat(this, samplerate, format, numoutputchannels, maxinputchannels, resamplemethod, bits); }
FMOD_RESULT setDSPBufferSize (unsigned int bufferlength, int numbuffers) { return FMOD_System_SetDSPBufferSize(this, bufferlength, numbuffers); }
FMOD_RESULT getDSPBufferSize (unsigned int *bufferlength, int *numbuffers) { return FMOD_System_GetDSPBufferSize(this, bufferlength, numbuffers); }
FMOD_RESULT setFileSystem (FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek, int blockalign) { return FMOD_System_SetFileSystem(this, useropen, userclose, userread, userseek, blockalign); }
FMOD_RESULT attachFileSystem (FMOD_FILE_OPENCALLBACK useropen, FMOD_FILE_CLOSECALLBACK userclose, FMOD_FILE_READCALLBACK userread, FMOD_FILE_SEEKCALLBACK userseek) { return FMOD_System_AttachFileSystem(this, useropen, userclose, userread, userseek); }
FMOD_RESULT setAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings) { return FMOD_System_SetAdvancedSettings(this, settings); }
FMOD_RESULT getAdvancedSettings (FMOD_ADVANCEDSETTINGS *settings) { return FMOD_System_GetAdvancedSettings(this, settings); }
FMOD_RESULT setSpeakerMode (FMOD_SPEAKERMODE speakermode) { return FMOD_System_SetSpeakerMode(this, speakermode); }
FMOD_RESULT getSpeakerMode (FMOD_SPEAKERMODE *speakermode) { return FMOD_System_GetSpeakerMode(this, speakermode); }
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
FMOD_RESULT setCallback (FMOD_SYSTEM_CALLBACK callback) { return FMOD_System_SetCallback(this, callback); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Plug-in support
FMOD_RESULT setPluginPath (const char *path) { return FMOD_System_SetPluginPath(this, path); }
- Fixed: The trace code could pass a temporary sector struct with its result. Update to ZDoom r1271: - Added native variables to expression evaluator and replaced the previous handling of actor variables in expressions with it. - Added support for floating point constants to DECORATE expression evaluator. - Rewrote the SeePastShootableLines check in P_SightCheckLine() to be more readable. - Commented out the MugShot state nulling in DSBarInfo::AttachToPlayer() so that fiddling with player options does not reset the mug shot. - Fixed: SetMugShotState ACS command did not pop the stack. - Added a global symbol table and changed DECORATE parser to put its global symbols there instead of into AActor. - Changed the expression evaluator's floating point precision to double. - Started rewriting the DECORATE expression evaluator to allow more flexibility. All the operators use the new functionality but functions, variables and constants are yet to be redone. While doing this rewrite I noticed that random2 was always evaluated as const. This got fixed automatically. - This may or may not be a problem, but GCC warned that FStateDefinitions:: AddStateDefines() does not initialize def.FStateDefine::DefineFlags, so I fixed that. - Fixed: The three-argument version of AActor::FindState() initialized a two-entry array for passing to the main FindState() routine, but did not actually pass it, passing the original primary label instead. - Fixed: SDL builds did not shutdown the sound system at exit. - Fixed: ThingCountSector and ThingCountNameSector did not remove enough entries from the stack, and did not put the result in the right slot. - Fixed: Teleport lines were prioritized over secret lines when deciding what color to draw them on the automap. - Fixed: Death-reverting morphs did not remove the morph item from the player's inventory when death caused the morph to revert. - Updated fmod_wrap.h for FMOD Ex 4.18. - Fixed: The TEXTURES parser could copy beyond the end of a string when parsing a 'define' definition. - Fixed: Cheats in demos must not access the weapon slots. - Fixed: S_ChannelEnded didn't check for a NULL SfxInfo. - Fixed: R_InitTables did a typecast to angle_t instead of fixed_t. - Fixed: PowerProtection and PowerDamage applied their defaults incorrectly. - Fixed: The damage type property didn't properly read its factor. - Finally has the right idea how to restore Doom's original clipping of projectiles against decorations without breaking anything newer: Added a new 'projectilepassheight' property that defines an alternative height that is only used when checking a projectile's movement against this actor. If the value is positive it is used regardless of other settings, if it is negative, its absolute will be used if a new compatibility option is enabled and if it is 0 the normal height will be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@187 b0f79afe-0144-0410-b225-9a4edf0717df
2008-10-19 22:24:34 +00:00
FMOD_RESULT loadPlugin (const char *filename, unsigned int *handle, unsigned int priority = 0) { return FMOD_System_LoadPlugin(this, filename, handle, priority); }
FMOD_RESULT unloadPlugin (unsigned int handle) { return FMOD_System_UnloadPlugin(this, handle); }
FMOD_RESULT getNumPlugins (FMOD_PLUGINTYPE plugintype, int *numplugins) { return FMOD_System_GetNumPlugins(this, plugintype, numplugins); }
- Fixed: The trace code could pass a temporary sector struct with its result. Update to ZDoom r1271: - Added native variables to expression evaluator and replaced the previous handling of actor variables in expressions with it. - Added support for floating point constants to DECORATE expression evaluator. - Rewrote the SeePastShootableLines check in P_SightCheckLine() to be more readable. - Commented out the MugShot state nulling in DSBarInfo::AttachToPlayer() so that fiddling with player options does not reset the mug shot. - Fixed: SetMugShotState ACS command did not pop the stack. - Added a global symbol table and changed DECORATE parser to put its global symbols there instead of into AActor. - Changed the expression evaluator's floating point precision to double. - Started rewriting the DECORATE expression evaluator to allow more flexibility. All the operators use the new functionality but functions, variables and constants are yet to be redone. While doing this rewrite I noticed that random2 was always evaluated as const. This got fixed automatically. - This may or may not be a problem, but GCC warned that FStateDefinitions:: AddStateDefines() does not initialize def.FStateDefine::DefineFlags, so I fixed that. - Fixed: The three-argument version of AActor::FindState() initialized a two-entry array for passing to the main FindState() routine, but did not actually pass it, passing the original primary label instead. - Fixed: SDL builds did not shutdown the sound system at exit. - Fixed: ThingCountSector and ThingCountNameSector did not remove enough entries from the stack, and did not put the result in the right slot. - Fixed: Teleport lines were prioritized over secret lines when deciding what color to draw them on the automap. - Fixed: Death-reverting morphs did not remove the morph item from the player's inventory when death caused the morph to revert. - Updated fmod_wrap.h for FMOD Ex 4.18. - Fixed: The TEXTURES parser could copy beyond the end of a string when parsing a 'define' definition. - Fixed: Cheats in demos must not access the weapon slots. - Fixed: S_ChannelEnded didn't check for a NULL SfxInfo. - Fixed: R_InitTables did a typecast to angle_t instead of fixed_t. - Fixed: PowerProtection and PowerDamage applied their defaults incorrectly. - Fixed: The damage type property didn't properly read its factor. - Finally has the right idea how to restore Doom's original clipping of projectiles against decorations without breaking anything newer: Added a new 'projectilepassheight' property that defines an alternative height that is only used when checking a projectile's movement against this actor. If the value is positive it is used regardless of other settings, if it is negative, its absolute will be used if a new compatibility option is enabled and if it is 0 the normal height will be used. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@187 b0f79afe-0144-0410-b225-9a4edf0717df
2008-10-19 22:24:34 +00:00
FMOD_RESULT getPluginHandle (FMOD_PLUGINTYPE plugintype, int index, unsigned int *handle) { return FMOD_System_GetPluginHandle(this, plugintype, index, handle); }
FMOD_RESULT getPluginInfo (unsigned int handle, FMOD_PLUGINTYPE *plugintype, char *name, int namelen, unsigned int *version) { return FMOD_System_GetPluginInfo(this, handle, plugintype, name, namelen, version); }
FMOD_RESULT setOutputByPlugin (unsigned int handle) { return FMOD_System_SetOutputByPlugin(this, handle); }
FMOD_RESULT getOutputByPlugin (unsigned int *handle) { return FMOD_System_GetOutputByPlugin(this, handle); }
FMOD_RESULT createCodec (FMOD_CODEC_DESCRIPTION *description, unsigned int priority = 0) { return FMOD_System_CreateCodec(this, description, priority); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Init/Close
FMOD_RESULT init (int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata) { return FMOD_System_Init(this, maxchannels, flags, extradriverdata); }
FMOD_RESULT close () { return FMOD_System_Close(this); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// General post-init system functions
FMOD_RESULT update () /* IMPORTANT! CALL THIS ONCE PER FRAME! */ { return FMOD_System_Update(this); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
FMOD_RESULT set3DSettings (float dopplerscale, float distancefactor, float rolloffscale) { return FMOD_System_Set3DSettings(this, dopplerscale, distancefactor, rolloffscale); }
FMOD_RESULT get3DSettings (float *dopplerscale, float *distancefactor, float *rolloffscale) { return FMOD_System_Get3DSettings(this, dopplerscale, distancefactor, rolloffscale); }
FMOD_RESULT set3DNumListeners (int numlisteners) { return FMOD_System_Set3DNumListeners(this, numlisteners); }
FMOD_RESULT get3DNumListeners (int *numlisteners) { return FMOD_System_Get3DNumListeners(this, numlisteners); }
FMOD_RESULT set3DListenerAttributes(int listener, const FMOD_VECTOR *pos, const FMOD_VECTOR *vel, const FMOD_VECTOR *forward, const FMOD_VECTOR *up) { return FMOD_System_Set3DListenerAttributes(this, listener, pos, vel, forward, up); }
FMOD_RESULT get3DListenerAttributes(int listener, FMOD_VECTOR *pos, FMOD_VECTOR *vel, FMOD_VECTOR *forward, FMOD_VECTOR *up) { return FMOD_System_Get3DListenerAttributes(this, listener, pos, vel, forward, up); }
FMOD_RESULT set3DRolloffCallback (FMOD_3D_ROLLOFFCALLBACK callback) { return FMOD_System_Set3DRolloffCallback(this, callback); }
FMOD_RESULT set3DSpeakerPosition (FMOD_SPEAKER speaker, float x, float y, bool active) { return FMOD_System_Set3DSpeakerPosition(this, speaker, x, y, active); }
FMOD_RESULT get3DSpeakerPosition (FMOD_SPEAKER speaker, float *x, float *y, bool *active) { FMOD_BOOL b; FMOD_RESULT res = FMOD_System_Get3DSpeakerPosition(this, speaker, x, y, &b); *active = b; return res; }
FMOD_RESULT setStreamBufferSize (unsigned int filebuffersize, FMOD_TIMEUNIT filebuffersizetype) { return FMOD_System_SetStreamBufferSize(this, filebuffersize, filebuffersizetype); }
FMOD_RESULT getStreamBufferSize (unsigned int *filebuffersize, FMOD_TIMEUNIT *filebuffersizetype) { return FMOD_System_GetStreamBufferSize(this, filebuffersize, filebuffersizetype); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// System information functions.
FMOD_RESULT getVersion (unsigned int *version) { return FMOD_System_GetVersion(this, version); }
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); }
FMOD_RESULT getSpectrum (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype) { return FMOD_System_GetSpectrum(this, spectrumarray, numvalues, channeloffset, windowtype); }
FMOD_RESULT getWaveData (float *wavearray, int numvalues, int channeloffset) { return FMOD_System_GetWaveData(this, wavearray, numvalues, channeloffset); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Sound/DSP/Channel/FX creation and retrieval.
FMOD_RESULT createSound (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound) { return FMOD_System_CreateSound(this, name_or_data, mode, exinfo, (FMOD_SOUND **)sound); }
FMOD_RESULT createStream (const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, Sound **sound) { return FMOD_System_CreateStream(this, name_or_data, mode, exinfo, (FMOD_SOUND **)sound); }
FMOD_RESULT createDSP (FMOD_DSP_DESCRIPTION *description, DSP **dsp) { return FMOD_System_CreateDSP(this, description, (FMOD_DSP **)dsp); }
FMOD_RESULT createDSPByType (FMOD_DSP_TYPE type, DSP **dsp) { return FMOD_System_CreateDSPByType(this, type, (FMOD_DSP **)dsp); }
FMOD_RESULT createChannelGroup (const char *name, ChannelGroup **channelgroup) { return FMOD_System_CreateChannelGroup(this, name, (FMOD_CHANNELGROUP **)channelgroup); }
FMOD_RESULT createSoundGroup (const char *name, SoundGroup **soundgroup) { return FMOD_System_CreateSoundGroup(this, name, (FMOD_SOUNDGROUP **)soundgroup); }
FMOD_RESULT createReverb (Reverb **reverb) { return FMOD_System_CreateReverb(this, (FMOD_REVERB **)reverb); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
FMOD_RESULT playSound (FMOD_CHANNELINDEX channelid, Sound *sound, bool paused, Channel **channel) { return FMOD_System_PlaySound(this, channelid, (FMOD_SOUND *)sound, paused, (FMOD_CHANNEL **)channel); }
FMOD_RESULT playDSP (FMOD_CHANNELINDEX channelid, DSP *dsp, bool paused, Channel **channel) { return FMOD_System_PlayDSP(this, channelid, (FMOD_DSP *)dsp, paused, (FMOD_CHANNEL **)channel); }
FMOD_RESULT getChannel (int channelid, Channel **channel) { return FMOD_System_GetChannel(this, channelid, (FMOD_CHANNEL **)channel); }
FMOD_RESULT getMasterChannelGroup (ChannelGroup **channelgroup) { return FMOD_System_GetMasterChannelGroup(this, (FMOD_CHANNELGROUP **)channelgroup); }
FMOD_RESULT getMasterSoundGroup (SoundGroup **soundgroup) { return FMOD_System_GetMasterSoundGroup(this, (FMOD_SOUNDGROUP **)soundgroup); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Reverb API
FMOD_RESULT setReverbProperties (const FMOD_REVERB_PROPERTIES *prop) { return FMOD_System_SetReverbProperties(this, prop); }
FMOD_RESULT getReverbProperties (FMOD_REVERB_PROPERTIES *prop) { return FMOD_System_GetReverbProperties(this, prop); }
FMOD_RESULT setReverbAmbientProperties(FMOD_REVERB_PROPERTIES *prop) { return FMOD_System_SetReverbAmbientProperties(this, prop); }
FMOD_RESULT getReverbAmbientProperties(FMOD_REVERB_PROPERTIES *prop) { return FMOD_System_GetReverbAmbientProperties(this, prop); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// System level DSP access.
FMOD_RESULT getDSPHead (DSP **dsp) { return FMOD_System_GetDSPHead(this, (FMOD_DSP **)dsp); }
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
FMOD_RESULT addDSP (DSP *dsp, DSPConnection **connection) { return FMOD_System_AddDSP(this, (FMOD_DSP *)dsp, (FMOD_DSPCONNECTION**)dsp); }
FMOD_RESULT lockDSP () { return FMOD_System_LockDSP(this); }
FMOD_RESULT unlockDSP () { return FMOD_System_UnlockDSP(this); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
FMOD_RESULT getDSPClock (unsigned int *hi, unsigned int *lo) { return FMOD_System_GetDSPClock(this, hi, lo); }
// Recording API.
FMOD_RESULT getRecordNumDrivers (int *numdrivers) { return FMOD_System_GetRecordNumDrivers(this, numdrivers); }
FMOD_RESULT getRecordDriverInfo (int id, char *name, int namelen, FMOD_GUID *guid) { return FMOD_System_GetRecordDriverInfo(this, id, name, namelen, guid); }
FMOD_RESULT getRecordDriverCaps (int id, FMOD_CAPS *caps, int *minfrequency, int *maxfrequency) { return FMOD_System_GetRecordDriverCaps(this, id, caps, minfrequency, maxfrequency); }
FMOD_RESULT getRecordPosition (int id, unsigned int *position) { return FMOD_System_GetRecordPosition(this, id, position); }
FMOD_RESULT recordStart (int id, Sound *sound, bool loop) { return FMOD_System_RecordStart(this, id, (FMOD_SOUND *)sound, loop); }
FMOD_RESULT recordStop (int id) { return FMOD_System_RecordStop(this, id); }
FMOD_RESULT isRecording (int id, bool *recording) { FMOD_BOOL b; FMOD_RESULT res = FMOD_System_IsRecording(this, id, &b); *recording = b; return res; }
// Geometry API.
FMOD_RESULT createGeometry (int maxpolygons, int maxvertices, Geometry **geometry) { return FMOD_System_CreateGeometry(this, maxpolygons, maxvertices, (FMOD_GEOMETRY **)geometry); }
FMOD_RESULT setGeometrySettings (float maxworldsize) { return FMOD_System_SetGeometrySettings(this, maxworldsize); }
FMOD_RESULT getGeometrySettings (float *maxworldsize) { return FMOD_System_GetGeometrySettings(this, maxworldsize); }
FMOD_RESULT loadGeometry (const void *data, int datasize, Geometry **geometry) { return FMOD_System_LoadGeometry(this, data, datasize, (FMOD_GEOMETRY **)geometry); }
// Network functions.
FMOD_RESULT setNetworkProxy (const char *proxy) { return FMOD_System_SetNetworkProxy(this, proxy); }
FMOD_RESULT getNetworkProxy (char *proxy, int proxylen) { return FMOD_System_GetNetworkProxy(this, proxy, proxylen); }
FMOD_RESULT setNetworkTimeout (int timeout) { return FMOD_System_SetNetworkTimeout(this, timeout); }
FMOD_RESULT getNetworkTimeout (int *timeout) { return FMOD_System_GetNetworkTimeout(this, timeout); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_System_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_System_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_System_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
};
/*
'Sound' API
*/
class Sound : FMOD_SOUND
{
private:
Sound(); /* Constructor made private so user cannot statically instance a Sound class.
Appropriate Sound creation or retrieval function must be used. */
public:
FMOD_RESULT release () { return FMOD_Sound_Release(this); }
FMOD_RESULT getSystemObject (System **system) { return FMOD_Sound_GetSystemObject(this, (FMOD_SYSTEM **)system); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Standard sound manipulation functions.
FMOD_RESULT lock (unsigned int offset, unsigned int length, void **ptr1, void **ptr2, unsigned int *len1, unsigned int *len2) { return FMOD_Sound_Lock(this, offset, length, ptr1, ptr2, len1, len2); }
FMOD_RESULT unlock (void *ptr1, void *ptr2, unsigned int len1, unsigned int len2) { return FMOD_Sound_Unlock(this, ptr1, ptr2, len1, len2); }
FMOD_RESULT setDefaults (float frequency, float volume, float pan, int priority) { return FMOD_Sound_SetDefaults(this, frequency, volume, pan, priority); }
FMOD_RESULT getDefaults (float *frequency, float *volume, float *pan, int *priority) { return FMOD_Sound_GetDefaults(this, frequency, volume, pan, priority); }
FMOD_RESULT setVariations (float frequencyvar, float volumevar, float panvar) { return FMOD_Sound_SetVariations(this, frequencyvar, volumevar, panvar); }
FMOD_RESULT getVariations (float *frequencyvar, float *volumevar, float *panvar) { return FMOD_Sound_GetVariations(this, frequencyvar, volumevar, panvar); }
FMOD_RESULT set3DMinMaxDistance (float min, float max) { return FMOD_Sound_Set3DMinMaxDistance(this, min, max); }
FMOD_RESULT get3DMinMaxDistance (float *min, float *max) { return FMOD_Sound_Get3DMinMaxDistance(this, min, max); }
FMOD_RESULT set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume) { return FMOD_Sound_Set3DConeSettings(this, insideconeangle, outsideconeangle, outsidevolume); }
FMOD_RESULT get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume) { return FMOD_Sound_Get3DConeSettings(this, insideconeangle, outsideconeangle, outsidevolume); }
FMOD_RESULT set3DCustomRolloff (FMOD_VECTOR *points, int numpoints) { return FMOD_Sound_Set3DCustomRolloff(this, points, numpoints); }
FMOD_RESULT get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints) { return FMOD_Sound_Get3DCustomRolloff(this, points, numpoints); }
FMOD_RESULT setSubSound (int index, Sound *subsound) { return FMOD_Sound_SetSubSound(this, index, subsound); }
FMOD_RESULT getSubSound (int index, Sound **subsound) { return FMOD_Sound_GetSubSound(this, index, (FMOD_SOUND **)subsound); }
FMOD_RESULT setSubSoundSentence (int *subsoundlist, int numsubsounds) { return FMOD_Sound_SetSubSoundSentence(this, subsoundlist, numsubsounds); }
FMOD_RESULT getName (char *name, int namelen) { return FMOD_Sound_GetName(this, name, namelen); }
FMOD_RESULT getLength (unsigned int *length, FMOD_TIMEUNIT lengthtype) { return FMOD_Sound_GetLength(this, length, lengthtype); }
FMOD_RESULT getFormat (FMOD_SOUND_TYPE *type, FMOD_SOUND_FORMAT *format, int *channels, int *bits) { return FMOD_Sound_GetFormat(this, type, format, channels, bits); }
FMOD_RESULT getNumSubSounds (int *numsubsounds) { return FMOD_Sound_GetNumSubSounds(this, numsubsounds); }
FMOD_RESULT getNumTags (int *numtags, int *numtagsupdated) { return FMOD_Sound_GetNumTags(this, numtags, numtagsupdated); }
FMOD_RESULT getTag (const char *name, int index, FMOD_TAG *tag) { return FMOD_Sound_GetTag(this, name, index, tag); }
FMOD_RESULT getOpenState (FMOD_OPENSTATE *openstate, unsigned int *percentbuffered, bool *starving) { FMOD_BOOL b; FMOD_RESULT res = FMOD_Sound_GetOpenState(this, openstate, percentbuffered, &b); *starving = b; return res; }
FMOD_RESULT readData (void *buffer, unsigned int lenbytes, unsigned int *read) { return FMOD_Sound_ReadData(this, buffer, lenbytes, read); }
FMOD_RESULT seekData (unsigned int pcm) { return FMOD_Sound_SeekData(this, pcm); }
FMOD_RESULT setSoundGroup (SoundGroup *soundgroup) { return FMOD_Sound_SetSoundGroup(this, (FMOD_SOUNDGROUP *)soundgroup); }
FMOD_RESULT getSoundGroup (SoundGroup **soundgroup) { return FMOD_Sound_GetSoundGroup(this, (FMOD_SOUNDGROUP **)soundgroup); }
// Synchronization point API. These points can come from markers embedded in wav files, and can also generate channel callbacks.
FMOD_RESULT getNumSyncPoints (int *numsyncpoints) { return FMOD_Sound_GetNumSyncPoints(this, numsyncpoints); }
FMOD_RESULT getSyncPoint (int index, FMOD_SYNCPOINT **point) { return FMOD_Sound_GetSyncPoint(this, index, point); }
FMOD_RESULT getSyncPointInfo (FMOD_SYNCPOINT *point, char *name, int namelen, unsigned int *offset, FMOD_TIMEUNIT offsettype) { return FMOD_Sound_GetSyncPointInfo(this, point, name, namelen, offset, offsettype); }
FMOD_RESULT addSyncPoint (unsigned int offset, FMOD_TIMEUNIT offsettype, const char *name, FMOD_SYNCPOINT **point) { return FMOD_Sound_AddSyncPoint(this, offset, offsettype, name, point); }
FMOD_RESULT deleteSyncPoint (FMOD_SYNCPOINT *point) { return FMOD_Sound_DeleteSyncPoint(this, point); }
// Functions also in Channel class but here they are the 'default' to save having to change it in Channel all the time.
FMOD_RESULT setMode (FMOD_MODE mode) { return FMOD_Sound_SetMode(this, mode); }
FMOD_RESULT getMode (FMOD_MODE *mode) { return FMOD_Sound_GetMode(this, mode); }
FMOD_RESULT setLoopCount (int loopcount) { return FMOD_Sound_SetLoopCount(this, loopcount); }
FMOD_RESULT getLoopCount (int *loopcount) { return FMOD_Sound_GetLoopCount(this, loopcount); }
FMOD_RESULT setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype) { return FMOD_Sound_SetLoopPoints(this, loopstart, loopstarttype, loopend, loopendtype); }
FMOD_RESULT getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype) { return FMOD_Sound_GetLoopPoints(this, loopstart, loopstarttype, loopend, loopendtype); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_Sound_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_Sound_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_Sound_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
};
/*
'Channel' API.
*/
class Channel : FMOD_CHANNEL
{
private:
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
Channel(); /* Constructor made private so user cannot statically instance a Channel class.
Appropriate Channel creation or retrieval function must be used. */
public:
FMOD_RESULT getSystemObject (System **system) { return FMOD_Channel_GetSystemObject(this, (FMOD_SYSTEM **)system); }
FMOD_RESULT stop () { return FMOD_Channel_Stop(this); }
FMOD_RESULT setPaused (bool paused) { return FMOD_Channel_SetPaused(this, paused); }
FMOD_RESULT getPaused (bool *paused) { FMOD_BOOL b; FMOD_RESULT res = FMOD_Channel_GetPaused(this, &b); *paused = b; return res; }
FMOD_RESULT setVolume (float volume) { return FMOD_Channel_SetVolume(this, volume); }
FMOD_RESULT getVolume (float *volume) { return FMOD_Channel_GetVolume(this, volume); }
FMOD_RESULT setFrequency (float frequency) { return FMOD_Channel_SetFrequency(this, frequency); }
FMOD_RESULT getFrequency (float *frequency) { return FMOD_Channel_GetFrequency(this, frequency); }
FMOD_RESULT setPan (float pan) { return FMOD_Channel_SetPan(this, pan); }
FMOD_RESULT getPan (float *pan) { return FMOD_Channel_GetPan(this, pan); }
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
FMOD_RESULT setDelay (FMOD_DELAYTYPE delaytype, unsigned int delayhi, unsigned int delaylo) { return FMOD_Channel_SetDelay(this, delaytype, delayhi, delaylo); }
FMOD_RESULT getDelay (FMOD_DELAYTYPE delaytype, unsigned int *delayhi, unsigned int *delaylo) { return FMOD_Channel_GetDelay(this, delaytype, delayhi, delaylo); }
FMOD_RESULT setSpeakerMix (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright) { return FMOD_Channel_SetSpeakerMix(this, frontleft, frontright, center, lfe, backleft, backright, sideleft, sideright); }
FMOD_RESULT getSpeakerMix (float *frontleft, float *frontright, float *center, float *lfe, float *backleft, float *backright, float *sideleft, float *sideright) { return FMOD_Channel_GetSpeakerMix(this, frontleft, frontright, center, lfe, backleft, backright, sideleft, sideright); }
FMOD_RESULT setSpeakerLevels (FMOD_SPEAKER speaker, float *levels, int numlevels) { return FMOD_Channel_SetSpeakerLevels(this, speaker, levels, numlevels); }
FMOD_RESULT getSpeakerLevels (FMOD_SPEAKER speaker, float *levels, int numlevels) { return FMOD_Channel_GetSpeakerLevels(this, speaker, levels, numlevels); }
FMOD_RESULT setInputChannelMix (float *levels, int numlevels) { return FMOD_Channel_SetInputChannelMix(this, levels, numlevels); }
FMOD_RESULT getInputChannelMix (float *levels, int numlevels) { return FMOD_Channel_GetInputChannelMix(this, levels, numlevels); }
FMOD_RESULT setMute (bool mute) { return FMOD_Channel_SetMute(this, mute); }
FMOD_RESULT getMute (bool *mute) { FMOD_BOOL b; FMOD_RESULT res = FMOD_Channel_GetMute(this, &b); *mute = b; return res; }
FMOD_RESULT setPriority (int priority) { return FMOD_Channel_SetPriority(this, priority); }
FMOD_RESULT getPriority (int *priority) { return FMOD_Channel_GetPriority(this, priority); }
FMOD_RESULT setPosition (unsigned int position, FMOD_TIMEUNIT postype) { return FMOD_Channel_SetPosition(this, position, postype); }
FMOD_RESULT getPosition (unsigned int *position, FMOD_TIMEUNIT postype) { return FMOD_Channel_GetPosition(this, position, postype); }
FMOD_RESULT setReverbProperties (const FMOD_REVERB_CHANNELPROPERTIES *prop) { return FMOD_Channel_SetReverbProperties(this, prop); }
FMOD_RESULT getReverbProperties (FMOD_REVERB_CHANNELPROPERTIES *prop) { return FMOD_Channel_GetReverbProperties(this, prop); }
FMOD_RESULT setChannelGroup (ChannelGroup *channelgroup) { return FMOD_Channel_SetChannelGroup(this, (FMOD_CHANNELGROUP *)channelgroup); }
FMOD_RESULT getChannelGroup (ChannelGroup **channelgroup) { return FMOD_Channel_GetChannelGroup(this, (FMOD_CHANNELGROUP **)channelgroup); }
FMOD_RESULT setCallback (FMOD_CHANNEL_CALLBACK callback) { return FMOD_Channel_SetCallback(this, callback); }
FMOD_RESULT setLowPassGain (float gain) { return FMOD_Channel_SetLowPassGain(this, gain); }
FMOD_RESULT getLowPassGain (float *gain) { return FMOD_Channel_GetLowPassGain(this, gain); }
// 3D functionality.
FMOD_RESULT set3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel) { return FMOD_Channel_Set3DAttributes(this, pos, vel); }
FMOD_RESULT get3DAttributes (FMOD_VECTOR *pos, FMOD_VECTOR *vel) { return FMOD_Channel_Get3DAttributes(this, pos, vel); }
FMOD_RESULT set3DMinMaxDistance (float mindistance, float maxdistance) { return FMOD_Channel_Set3DMinMaxDistance(this, mindistance, maxdistance); }
FMOD_RESULT get3DMinMaxDistance (float *mindistance, float *maxdistance) { return FMOD_Channel_Get3DMinMaxDistance(this, mindistance, maxdistance); }
FMOD_RESULT set3DConeSettings (float insideconeangle, float outsideconeangle, float outsidevolume) { return FMOD_Channel_Set3DConeSettings(this, insideconeangle, outsideconeangle, outsidevolume); }
FMOD_RESULT get3DConeSettings (float *insideconeangle, float *outsideconeangle, float *outsidevolume) { return FMOD_Channel_Get3DConeSettings(this, insideconeangle, outsideconeangle, outsidevolume); }
FMOD_RESULT set3DConeOrientation (FMOD_VECTOR *orientation) { return FMOD_Channel_Set3DConeOrientation(this, orientation); }
FMOD_RESULT get3DConeOrientation (FMOD_VECTOR *orientation) { return FMOD_Channel_Get3DConeOrientation(this, orientation); }
FMOD_RESULT set3DCustomRolloff (FMOD_VECTOR *points, int numpoints) { return FMOD_Channel_Set3DCustomRolloff(this, points, numpoints); }
FMOD_RESULT get3DCustomRolloff (FMOD_VECTOR **points, int *numpoints) { return FMOD_Channel_Get3DCustomRolloff(this, points, numpoints); }
FMOD_RESULT set3DOcclusion (float directocclusion, float reverbocclusion) { return FMOD_Channel_Set3DOcclusion(this, directocclusion, reverbocclusion); }
FMOD_RESULT get3DOcclusion (float *directocclusion, float *reverbocclusion) { return FMOD_Channel_Get3DOcclusion(this, directocclusion, reverbocclusion); }
FMOD_RESULT set3DSpread (float angle) { return FMOD_Channel_Set3DSpread(this, angle); }
FMOD_RESULT get3DSpread (float *angle) { return FMOD_Channel_Get3DSpread(this, angle); }
FMOD_RESULT set3DPanLevel (float level) { return FMOD_Channel_Set3DPanLevel(this, level); }
FMOD_RESULT get3DPanLevel (float *level) { return FMOD_Channel_Get3DPanLevel(this, level); }
FMOD_RESULT set3DDopplerLevel (float level) { return FMOD_Channel_Set3DDopplerLevel(this, level); }
FMOD_RESULT get3DDopplerLevel (float *level) { return FMOD_Channel_Get3DDopplerLevel(this, level); }
// DSP functionality only for channels playing sounds created with FMOD_SOFTWARE.
FMOD_RESULT getDSPHead (DSP **dsp) { return FMOD_Channel_GetDSPHead(this, (FMOD_DSP **)dsp); }
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
FMOD_RESULT addDSP (DSP *dsp, DSPConnection **connection) { return FMOD_Channel_AddDSP(this, (FMOD_DSP *)dsp, (FMOD_DSPCONNECTION **)connection); }
// Information only functions.
FMOD_RESULT isPlaying (bool *isplaying) { FMOD_BOOL b; FMOD_RESULT res = FMOD_Channel_IsPlaying(this, &b); *isplaying = b; return res; }
FMOD_RESULT isVirtual (bool *isvirtual) { FMOD_BOOL b; FMOD_RESULT res = FMOD_Channel_IsVirtual(this, &b); *isvirtual = b; return res; }
FMOD_RESULT getAudibility (float *audibility) { return FMOD_Channel_GetAudibility(this, audibility); }
FMOD_RESULT getCurrentSound (Sound **sound) { return FMOD_Channel_GetCurrentSound(this, (FMOD_SOUND **)sound); }
FMOD_RESULT getSpectrum (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype) { return FMOD_Channel_GetSpectrum(this, spectrumarray, numvalues, channeloffset, windowtype); }
FMOD_RESULT getWaveData (float *wavearray, int numvalues, int channeloffset) { return FMOD_Channel_GetWaveData(this, wavearray, numvalues, channeloffset); }
FMOD_RESULT getIndex (int *index) { return FMOD_Channel_GetIndex(this, index); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Functions also found in Sound class but here they can be set per channel.
FMOD_RESULT setMode (FMOD_MODE mode) { return FMOD_Channel_SetMode(this, mode); }
FMOD_RESULT getMode (FMOD_MODE *mode) { return FMOD_Channel_GetMode(this, mode); }
FMOD_RESULT setLoopCount (int loopcount) { return FMOD_Channel_SetLoopCount(this, loopcount); }
FMOD_RESULT getLoopCount (int *loopcount) { return FMOD_Channel_GetLoopCount(this, loopcount); }
FMOD_RESULT setLoopPoints (unsigned int loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int loopend, FMOD_TIMEUNIT loopendtype) { return FMOD_Channel_SetLoopPoints(this, loopstart, loopstarttype, loopend, loopendtype); }
FMOD_RESULT getLoopPoints (unsigned int *loopstart, FMOD_TIMEUNIT loopstarttype, unsigned int *loopend, FMOD_TIMEUNIT loopendtype) { return FMOD_Channel_GetLoopPoints(this, loopstart, loopstarttype, loopend, loopendtype); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_Channel_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_Channel_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_Channel_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
};
/*
'ChannelGroup' API
*/
class ChannelGroup : FMOD_CHANNELGROUP
{
private:
ChannelGroup(); /* Constructor made private so user cannot statically instance a ChannelGroup class.
Appropriate ChannelGroup creation or retrieval function must be used. */
public:
FMOD_RESULT release () { return FMOD_ChannelGroup_Release(this); }
FMOD_RESULT getSystemObject (System **system) { return FMOD_ChannelGroup_GetSystemObject(this, (FMOD_SYSTEM **)system); }
// Channelgroup scale values. (changes attributes relative to the channels, doesn't overwrite them)
FMOD_RESULT setVolume (float volume) { return FMOD_ChannelGroup_SetVolume(this, volume); }
FMOD_RESULT getVolume (float *volume) { return FMOD_ChannelGroup_GetVolume(this, volume); }
FMOD_RESULT setPitch (float pitch) { return FMOD_ChannelGroup_SetPitch(this, pitch); }
FMOD_RESULT getPitch (float *pitch) { return FMOD_ChannelGroup_GetPitch(this, pitch); }
FMOD_RESULT set3DOcclusion (float directocclusion, float reverbocclusion) { return FMOD_ChannelGroup_Set3DOcclusion(this, directocclusion, reverbocclusion); }
FMOD_RESULT get3DOcclusion (float *directocclusion, float *reverbocclusion) { return FMOD_ChannelGroup_Get3DOcclusion(this, directocclusion, reverbocclusion); }
FMOD_RESULT setPaused (bool paused) { return FMOD_ChannelGroup_SetPaused(this, paused); }
FMOD_RESULT getPaused (bool *paused) { FMOD_BOOL b; FMOD_RESULT res = FMOD_ChannelGroup_GetPaused(this, &b); *paused = b; return res; }
FMOD_RESULT setMute (bool mute) { return FMOD_ChannelGroup_SetMute(this, mute); }
FMOD_RESULT getMute (bool *mute) { FMOD_BOOL b; FMOD_RESULT res = FMOD_ChannelGroup_GetMute(this, &b); *mute = b; return res; }
// Channelgroup override values. (recursively overwrites whatever settings the channels had)
FMOD_RESULT stop () { return FMOD_ChannelGroup_Stop(this); }
FMOD_RESULT overrideVolume (float volume) { return FMOD_ChannelGroup_OverrideVolume(this, volume); }
FMOD_RESULT overrideFrequency (float frequency) { return FMOD_ChannelGroup_OverrideFrequency(this, frequency); }
FMOD_RESULT overridePan (float pan) { return FMOD_ChannelGroup_OverridePan(this, pan); }
FMOD_RESULT overrideReverbProperties(const FMOD_REVERB_CHANNELPROPERTIES *prop) { return FMOD_ChannelGroup_OverrideReverbProperties(this, prop); }
FMOD_RESULT override3DAttributes (const FMOD_VECTOR *pos, const FMOD_VECTOR *vel) { return FMOD_ChannelGroup_Override3DAttributes(this, pos, vel); }
FMOD_RESULT overrideSpeakerMix (float frontleft, float frontright, float center, float lfe, float backleft, float backright, float sideleft, float sideright) { return FMOD_ChannelGroup_OverrideSpeakerMix(this, frontleft, frontright, center, lfe, backleft, backright, sideleft, sideright); }
// Nested channel groups.
FMOD_RESULT addGroup (ChannelGroup *group) { return FMOD_ChannelGroup_AddGroup(this, group); }
FMOD_RESULT getNumGroups (int *numgroups) { return FMOD_ChannelGroup_GetNumGroups(this, numgroups); }
FMOD_RESULT getGroup (int index, ChannelGroup **group) { return FMOD_ChannelGroup_GetGroup(this, index, (FMOD_CHANNELGROUP **)group); }
FMOD_RESULT getParentGroup (ChannelGroup **group) { return FMOD_ChannelGroup_GetParentGroup(this, (FMOD_CHANNELGROUP **)group); }
// DSP functionality only for channel groups playing sounds created with FMOD_SOFTWARE.
FMOD_RESULT getDSPHead (DSP **dsp) { return FMOD_ChannelGroup_GetDSPHead(this, (FMOD_DSP **)dsp); }
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
FMOD_RESULT addDSP (DSP *dsp, DSPConnection **connection) { return FMOD_ChannelGroup_AddDSP(this, (FMOD_DSP *)dsp, (FMOD_DSPCONNECTION **)connection); }
// Information only functions.
FMOD_RESULT getName (char *name, int namelen) { return FMOD_ChannelGroup_GetName(this, name, namelen); }
FMOD_RESULT getNumChannels (int *numchannels) { return FMOD_ChannelGroup_GetNumChannels(this, numchannels); }
FMOD_RESULT getChannel (int index, Channel **channel) { return FMOD_ChannelGroup_GetChannel(this, index, (FMOD_CHANNEL **)channel); }
FMOD_RESULT getSpectrum (float *spectrumarray, int numvalues, int channeloffset, FMOD_DSP_FFT_WINDOW windowtype) { return FMOD_ChannelGroup_GetSpectrum(this, spectrumarray, numvalues, channeloffset, windowtype); }
FMOD_RESULT getWaveData (float *wavearray, int numvalues, int channeloffset) { return FMOD_ChannelGroup_GetWaveData(this, wavearray, numvalues, channeloffset) ;}
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_ChannelGroup_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_ChannelGroup_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_ChannelGroup_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
};
/*
'SoundGroup' API
*/
class SoundGroup : FMOD_SOUNDGROUP
{
private:
SoundGroup(); /* Constructor made private so user cannot statically instance a SoundGroup class.
Appropriate SoundGroup creation or retrieval function must be used. */
public:
FMOD_RESULT release () { return FMOD_SoundGroup_Release(this); }
FMOD_RESULT getSystemObject (System **system) { return FMOD_SoundGroup_GetSystemObject(this, (FMOD_SYSTEM **)system); }
// SoundGroup control functions.
FMOD_RESULT setMaxAudible (int maxaudible) { return FMOD_SoundGroup_SetMaxAudible(this, maxaudible); }
FMOD_RESULT getMaxAudible (int *maxaudible) { return FMOD_SoundGroup_GetMaxAudible(this, maxaudible); }
FMOD_RESULT setMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR behavior) { return FMOD_SoundGroup_SetMaxAudibleBehavior(this, behavior); }
FMOD_RESULT getMaxAudibleBehavior (FMOD_SOUNDGROUP_BEHAVIOR *behavior) { return FMOD_SoundGroup_GetMaxAudibleBehavior(this, behavior); }
FMOD_RESULT setMuteFadeSpeed (float speed) { return FMOD_SoundGroup_SetMuteFadeSpeed(this, speed); }
FMOD_RESULT getMuteFadeSpeed (float *speed) { return FMOD_SoundGroup_GetMuteFadeSpeed(this, speed); }
FMOD_RESULT setVolume (float volume) { return FMOD_SoundGroup_SetVolume(this, volume); }
FMOD_RESULT getVolume (float *volume) { return FMOD_SoundGroup_GetVolume(this, volume); }
FMOD_RESULT stop () { return FMOD_SoundGroup_Stop(this); }
// Information only functions.
FMOD_RESULT getName (char *name, int namelen) { return FMOD_SoundGroup_GetName(this, name, namelen); }
FMOD_RESULT getNumSounds (int *numsounds) { return FMOD_SoundGroup_GetNumSounds(this, numsounds); }
FMOD_RESULT getSound (int index, Sound **sound) { return FMOD_SoundGroup_GetSound(this, index, (FMOD_SOUND **)sound); }
FMOD_RESULT getNumPlaying (int *numplaying) { return FMOD_SoundGroup_GetNumPlaying(this, numplaying); }
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_SoundGroup_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_SoundGroup_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_SoundGroup_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
};
/*
'DSP' API
*/
class DSP : FMOD_DSP
{
private:
DSP(); /* Constructor made private so user cannot statically instance a DSP class.
Appropriate DSP creation or retrieval function must be used. */
public:
FMOD_RESULT release () { return FMOD_DSP_Release(this); }
FMOD_RESULT getSystemObject (System **system) { return FMOD_DSP_GetSystemObject(this, (FMOD_SYSTEM **)system); }
// Connection / disconnection / input and output enumeration.
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
FMOD_RESULT addInput (DSP *target, DSPConnection **connection) { return FMOD_DSP_AddInput(this, target, (FMOD_DSPCONNECTION **)connection); }
FMOD_RESULT disconnectFrom (DSP *target) { return FMOD_DSP_DisconnectFrom(this, target); }
FMOD_RESULT disconnectAll (bool inputs, bool outputs) { return FMOD_DSP_DisconnectAll(this, inputs, outputs); }
FMOD_RESULT remove () { return FMOD_DSP_Remove(this); }
FMOD_RESULT getNumInputs (int *numinputs) { return FMOD_DSP_GetNumInputs(this, numinputs); }
FMOD_RESULT getNumOutputs (int *numoutputs) { return FMOD_DSP_GetNumOutputs(this, numoutputs); }
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
FMOD_RESULT getInput (int index, DSP **input, DSPConnection **inputconnection) { return FMOD_DSP_GetInput(this, index, (FMOD_DSP **)input, (FMOD_DSPCONNECTION **)inputconnection); }
FMOD_RESULT getOutput (int index, DSP **output, DSPConnection **outputconnection) { return FMOD_DSP_GetOutput(this, index, (FMOD_DSP **)output, (FMOD_DSPCONNECTION **)outputconnection); }
// DSP unit control.
FMOD_RESULT setActive (bool active) { return FMOD_DSP_SetActive(this, active); }
FMOD_RESULT getActive (bool *active) { FMOD_BOOL b; FMOD_RESULT res = FMOD_DSP_GetActive(this, &b); *active = b; return res; }
FMOD_RESULT setBypass (bool bypass) { return FMOD_DSP_SetBypass(this, bypass); }
FMOD_RESULT getBypass (bool *bypass) { FMOD_BOOL b; FMOD_RESULT res = FMOD_DSP_GetBypass(this, &b); *bypass = b; return res; }
Update to ZDoom r1033: - Fixed: The UDMF parser stored plane rotation angles as fixed_t, not angle_t. - Grouped the sector plane texture transformation values into a separate structure and replaced all access to them with wrapper functions. - Add environment 255, 255 as a way to get the software underwater effect in any zone you want. - Using a too-recent version of FMOD now gives an error, since there may be breaking changes to the API from one version to the next (excluding revisions in stable branches, which only represent bug fixes). - Updated fmod_wrap.h for FMOD 4.16 and corrected a bug that had gone unnoticed before: The delayhi and delaylo parameters for Channel::setDelay() and getDelay() were swapped. - Fixed: P_ChangeSector could incorrectly block movement when checking for mid textures linked to a moving floor. - Fixed AActor's bouncefactor definitions which I accidentally changed when adding wallbouncefactor. - Fixed: A_SpawnItemEx added the floorclip offset to the z coordinate instead of subtracting it. - Fixed: SBARINFO's popup code used 1-based indices to address a C++ array. - Fixed: ACS's ChangeSky command didn't clean up the stack. - Fixed: Wall scrolling interpolations incremented their reference count twice. - Fixed: Before a level's thinkers are loaded all previous interpolations must be cleared. - Fixed: deleted interpolations didn't NULL the pointer in the interpolated object. Also added all interpolation pointers to DSectorMarker to ensure that they are properyl processed by the garbage collector. - Added scaling to double size for idmypos display. - Changed: Players don't telefrag when they are spawned now but after all actors have been spawned to avoid accidental voodoo doll telefragging. - Fixed: ACS scripts for non-existent maps were started on the current one. - Added a 'wallbouncefactor' property to AActor. - Reverted forceunderwater change from r1026 and fixed the problem for real: SECF_FORCEDUNDERWATER only has meaning when coming from the heightsec. So the initial check of the current sector in AActor::UpdateWaterLevel must only check for SECF_UNDERWATER, not SECF_UNDERWATERMASK. - Dehacked fix discovered by entryway: Dehacked only changes the blue armor's armortype. It does not touch the armor given by the megasphere. - Changed forcewater handling so that only control sectors created by one- sided lines become swimmable, since there's a good chance that a two-sided line is creating the control sector out of a normal, accessible portion of the map. (See e.g. linedef 29242 of zdoomcmp1.) - Added self-modifying code notifications for Valgrind. Build with make VALGRIND=1 to turn them on. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@121 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-14 15:37:17 +00:00
FMOD_RESULT setSpeakerActive (FMOD_SPEAKER speaker, bool active) { return FMOD_DSP_SetSpeakerActive(this, speaker, active); }
FMOD_RESULT getSpeakerActive (FMOD_SPEAKER speaker, bool *active) { FMOD_BOOL b; FMOD_RESULT res = FMOD_DSP_GetSpeakerActive(this, speaker, &b); *active = b; return res; }
FMOD_RESULT reset () { return FMOD_DSP_Reset(this); }
// DSP parameter control.
FMOD_RESULT setParameter (int index, float value) { return FMOD_DSP_SetParameter(this, index, value); }
FMOD_RESULT getParameter (int index, float *value, char *valuestr, int valuestrlen) { return FMOD_DSP_GetParameter(this, index, value, valuestr, valuestrlen); }
FMOD_RESULT getNumParameters (int *numparams) { return FMOD_DSP_GetNumParameters(this, numparams); }
FMOD_RESULT getParameterInfo (int index, char *name, char *label, char *description, int descriptionlen, float *min, float *max) { return FMOD_DSP_GetParameterInfo(this, index, name, label, description, descriptionlen, min, max); }
FMOD_RESULT showConfigDialog (void *hwnd, bool show) { return FMOD_DSP_ShowConfigDialog(this, hwnd, show); }
// DSP attributes.
FMOD_RESULT getInfo (char *name, unsigned int *version, int *channels, int *configwidth, int *configheight) { return FMOD_DSP_GetInfo(this, name, version, channels, configwidth, configheight); }
FMOD_RESULT getType (FMOD_DSP_TYPE *type) { return FMOD_DSP_GetType(this, type); }
FMOD_RESULT setDefaults (float frequency, float volume, float pan, int priority) { return FMOD_DSP_SetDefaults(this, frequency, volume, pan, priority); }
FMOD_RESULT getDefaults (float *frequency, float *volume, float *pan, int *priority) { return FMOD_DSP_GetDefaults(this, frequency, volume, pan, priority) ;}
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_DSP_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_DSP_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_DSP_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
};
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
/*
'DSPConnection' API
*/
class DSPConnection : FMOD_DSPCONNECTION
{
private:
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
DSPConnection(); /* Constructor made private so user cannot statically instance a DSPConnection class.
Appropriate DSPConnection creation or retrieval function must be used. */
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
public:
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
FMOD_RESULT getInput (DSP **input) { return FMOD_DSPConnection_GetInput(this, (FMOD_DSP **)input); }
FMOD_RESULT getOutput (DSP **output) { return FMOD_DSPConnection_GetOutput(this, (FMOD_DSP **)output); }
FMOD_RESULT setMix (float volume) { return FMOD_DSPConnection_SetMix(this, volume); }
FMOD_RESULT getMix (float *volume) { return FMOD_DSPConnection_GetMix(this, volume); }
FMOD_RESULT setLevels (FMOD_SPEAKER speaker, float *levels, int numlevels) { return FMOD_DSPConnection_SetLevels(this, speaker, levels, numlevels); }
FMOD_RESULT getLevels (FMOD_SPEAKER speaker, float *levels, int numlevels) { return FMOD_DSPConnection_GetLevels(this, speaker, levels, numlevels); }
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_DSPConnection_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_DSPConnection_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_DSPConnection_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
};
Update to ZDoom r922: - Added Martin Howe's fixes for morphing and DECORATE function prototypes. - Minor fixes in texture code. - Fixed: The FMOD::System object was never released, only closed, so snd_reset would eventually run into the hard limit on the total number of FMOD::System objects that can be created concurrently (currently 15). - Added proper error checks to the FMOD initialization process. - Updated fmod_wrap.h for FMOD 4.14. - Set note velocity back to using a linear sounding volume curve, although it's now used to scale channel volume and expression, so recompute_amp() is still only doing one volume curve lookup. - Fixed: TimidityMIDIDevice caused a crash at the end of a non-looping song. - Made translation support for multipatch textures operational. - Added support for the GUS patch format's scale_frequency and scale_factor parameters. These seem to be used primarily to restrict percussion instruments to specific notes. - Changed note velocity to not use the volume curve in recompute_amp(), since this sounds closer to TiMidity++, although I don't believe it's correct MIDI behavior. Also changed expression so that it scales the channel volume before going through the curve. - Reworked load_instrument() to be less opaque. - Went through the TiMidity code and removed pretty much all of the SDL_mixer extensions. The only exception would be kill_others(), which I reworked into a kill_key_group() function, which should be useful for DLS instruments in the future. - Added translation support to multipatch textures. Not tested yet! - Added Martin Howe's morph weapon update. - Changed true color texture creation to use a newly defined Bitmap class instead of having the copy functions in the frame buffer class. - Fixed: The WolfSS didn't have its obituary defined. - Added submission for ACS CheckPlayerCamera ACS function. - Removed FRadiusThingsIterator after discovering that VC++ misoptimized it in P_CheckPosition. Now FBlockThingsIterator is used with the distance check being done manually. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@94 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-17 20:58:50 +00:00
/*
'Geometry' API
*/
class Geometry : FMOD_GEOMETRY
{
private:
Geometry(); /* Constructor made private so user cannot statically instance a Geometry class.
Appropriate Geometry creation or retrieval function must be used. */
- Fixed: Using sprites as wall textures used incorrect texture offsets because sprites are being offset by one pixel to make texture filtering look better. Now two sets of coordinates are maintained for native GL textures, one for sprites, one for textures. Update to ZDoom r930: - Fixed: MugShotFrame::getTexture() allocated space for the sprite name that it never freed. I'm not sure it's a good assumption that 9 characters is always long enough, either, since you can have longer file names than that inside a zip. - Fixed: DSBarInfo::DrawGem() crashed if chain or gem was NULL. - Fixed: Sound sequences are not thinkers, therefore they must be explicitly marked as roots for the GC. - Reduced the range that area sounds require to interpolate between 2D and 3D panning. - The listener's velocity is now set at 0 for the sound engine. The player moves so fast that you can hear the doppler shift just by running around, otherwise. - Changed the sound code so that all sounds that start playing on a single tic actually start playing at the exact same sample position. - Added the writewave command to write the internal TiMidity's output to a wave file. - Changed the default channel velocity for MUS files from 64 to 100 to better match apparent MIDI practice. (Would like to know what this is supposed to be.) - Changed the mus2midi channel assignments to match the internal player's. - Fixed: apply_envelope_to_amp() should clamp the mix levels to 0. - Made the maximum number of TiMidity voices configurable through the timidity_voices cvar. - Added stats lines for the OPL and Timidity MIDI devices. - Completely changed the way TiMidity volume calculations are done. It should now be extremely close to the output a real GUS would produce with its official MIDI player (excepting where TiMidity normalizes sample volumes). The new equations more closely match what is specified by the DLS and SF2 specs (but not quite), so I presume it's also more musically correct than what TiMidity (and TiMidity++) do. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@97 b0f79afe-0144-0410-b225-9a4edf0717df
2008-04-20 10:26:25 +00:00
public:
FMOD_RESULT release () { return FMOD_Geometry_Release(this); }
// Polygon manipulation.
FMOD_RESULT addPolygon (float directocclusion, float reverbocclusion, bool doublesided, int numvertices, const FMOD_VECTOR *vertices, int *polygonindex) { return FMOD_Geometry_AddPolygon(this, directocclusion, reverbocclusion, doublesided, numvertices, vertices, polygonindex); }
FMOD_RESULT getNumPolygons (int *numpolygons) { return FMOD_Geometry_GetNumPolygons(this, numpolygons); }
FMOD_RESULT getMaxPolygons (int *maxpolygons, int *maxvertices) { return FMOD_Geometry_GetMaxPolygons(this, maxpolygons, maxvertices); }
FMOD_RESULT getPolygonNumVertices (int index, int *numvertices) { return FMOD_Geometry_GetPolygonNumVertices(this, index, numvertices); }
FMOD_RESULT setPolygonVertex (int index, int vertexindex, const FMOD_VECTOR *vertex) { return FMOD_Geometry_SetPolygonVertex(this, index, vertexindex, vertex); }
FMOD_RESULT getPolygonVertex (int index, int vertexindex, FMOD_VECTOR *vertex) { return FMOD_Geometry_GetPolygonVertex(this, index, vertexindex, vertex); }
FMOD_RESULT setPolygonAttributes (int index, float directocclusion, float reverbocclusion, bool doublesided) { return FMOD_Geometry_SetPolygonAttributes(this, index, directocclusion, reverbocclusion, doublesided); }
FMOD_RESULT getPolygonAttributes (int index, float *directocclusion, float *reverbocclusion, bool *doublesided) { FMOD_BOOL b; FMOD_RESULT res = FMOD_Geometry_GetPolygonAttributes(this, index, directocclusion, reverbocclusion, &b); *doublesided = b; return res; }
// Object manipulation.
FMOD_RESULT setActive (bool active) { return FMOD_Geometry_SetActive(this, active); }
FMOD_RESULT getActive (bool *active) { FMOD_BOOL b; FMOD_RESULT res = FMOD_Geometry_GetActive(this, &b); *active = b; return res; }
FMOD_RESULT setRotation (const FMOD_VECTOR *forward, const FMOD_VECTOR *up) { return FMOD_Geometry_SetRotation(this, forward, up); }
FMOD_RESULT getRotation (FMOD_VECTOR *forward, FMOD_VECTOR *up) { return FMOD_Geometry_GetRotation(this, forward, up); }
FMOD_RESULT setPosition (const FMOD_VECTOR *position) { return FMOD_Geometry_SetPosition(this, position); }
FMOD_RESULT getPosition (FMOD_VECTOR *position) { return FMOD_Geometry_GetPosition(this, position); }
FMOD_RESULT setScale (const FMOD_VECTOR *scale) { return FMOD_Geometry_SetScale(this, scale); }
FMOD_RESULT getScale (FMOD_VECTOR *scale) { return FMOD_Geometry_GetScale(this, scale); }
FMOD_RESULT save (void *data, int *datasize) { return FMOD_Geometry_Save(this, data, datasize); }
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_Geometry_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_Geometry_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_Geometry_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
};
/*
'Reverb' API
*/
class Reverb : FMOD_REVERB
{
private:
Reverb(); /* Constructor made private so user cannot statically instance a Reverb class.
Appropriate Reverb creation or retrieval function must be used. */
public:
FMOD_RESULT release () { return FMOD_Reverb_Release(this); }
// Reverb manipulation.
FMOD_RESULT set3DAttributes (const FMOD_VECTOR *position, float mindistance, float maxdistance) { return FMOD_Reverb_Set3DAttributes(this, position, mindistance, maxdistance); }
FMOD_RESULT get3DAttributes (FMOD_VECTOR *position, float *mindistance, float *maxdistance) { return FMOD_Reverb_Get3DAttributes(this, position, mindistance, maxdistance); }
FMOD_RESULT setProperties (const FMOD_REVERB_PROPERTIES *properties) { return FMOD_Reverb_SetProperties(this, properties); }
FMOD_RESULT getProperties (FMOD_REVERB_PROPERTIES *properties) { return FMOD_Reverb_GetProperties(this, properties); }
FMOD_RESULT setActive (bool active) { return FMOD_Reverb_SetActive(this, active); }
FMOD_RESULT getActive (bool *active) { FMOD_BOOL b; FMOD_RESULT res = FMOD_Reverb_GetActive(this, &b); *active = b; return res; }
// Userdata set/get.
FMOD_RESULT setUserData (void *userdata) { return FMOD_Reverb_SetUserData(this, userdata); }
FMOD_RESULT getUserData (void **userdata) { return FMOD_Reverb_GetUserData(this, userdata); }
FMOD_RESULT getMemoryInfo (unsigned int memorybits, unsigned int event_memorybits, unsigned int *memoryused, unsigned int *memoryused_array) { return FMOD_Reverb_GetMemoryInfo(this, memorybits, event_memorybits, memoryused, memoryused_array); }
};
}
#endif
#endif