[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21533] branches/soundsystem: * fixed error of msvc complaining about empty structs in C
Jörg Müller
nexyon at gmail.com
Sat Jul 11 20:39:07 CEST 2009
Revision: 21533
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21533
Author: nexyon
Date: 2009-07-11 20:39:07 +0200 (Sat, 11 Jul 2009)
Log Message:
-----------
* fixed error of msvc complaining about empty structs in C
* fixed bug of non stopping sound actuator on replay
Modified Paths:
--------------
branches/soundsystem/intern/audaspace/AUD_C-API.h
branches/soundsystem/intern/audaspace/intern/AUD_IDevice.h
branches/soundsystem/intern/audaspace/intern/AUD_Space.h
branches/soundsystem/source/gameengine/Ketsji/KX_SoundActuator.cpp
Modified: branches/soundsystem/intern/audaspace/AUD_C-API.h
===================================================================
--- branches/soundsystem/intern/audaspace/AUD_C-API.h 2009-07-11 17:29:53 UTC (rev 21532)
+++ branches/soundsystem/intern/audaspace/AUD_C-API.h 2009-07-11 18:39:07 UTC (rev 21533)
@@ -33,7 +33,8 @@
#include "intern/AUD_Space.h"
#ifndef AUD_CAPI_IMPLEMENTATION
- typedef struct {} AUD_Sound;
+ typedef void AUD_Sound;
+ typedef void AUD_Handle;
#endif
/**
Modified: branches/soundsystem/intern/audaspace/intern/AUD_IDevice.h
===================================================================
--- branches/soundsystem/intern/audaspace/intern/AUD_IDevice.h 2009-07-11 17:29:53 UTC (rev 21532)
+++ branches/soundsystem/intern/audaspace/intern/AUD_IDevice.h 2009-07-11 18:39:07 UTC (rev 21533)
@@ -29,6 +29,11 @@
#include "AUD_Space.h"
class AUD_IFactory;
+/// Handle structure, for inherition.
+typedef struct
+{
+} AUD_Handle;
+
/**
* This class represents an output device for sound sources.
* Output devices may be several backends such as plattform independand like
Modified: branches/soundsystem/intern/audaspace/intern/AUD_Space.h
===================================================================
--- branches/soundsystem/intern/audaspace/intern/AUD_Space.h 2009-07-11 17:29:53 UTC (rev 21532)
+++ branches/soundsystem/intern/audaspace/intern/AUD_Space.h 2009-07-11 18:39:07 UTC (rev 21533)
@@ -168,9 +168,4 @@
// void* userData; - for the case it is needed someday
} AUD_Exception;
-/// Handle structure.
-typedef struct
-{
-} AUD_Handle;
-
#endif //AUD_ENUMS
Modified: branches/soundsystem/source/gameengine/Ketsji/KX_SoundActuator.cpp
===================================================================
--- branches/soundsystem/source/gameengine/Ketsji/KX_SoundActuator.cpp 2009-07-11 17:29:53 UTC (rev 21532)
+++ branches/soundsystem/source/gameengine/Ketsji/KX_SoundActuator.cpp 2009-07-11 18:39:07 UTC (rev 21533)
@@ -210,6 +210,8 @@
case KX_SOUNDACT_LOOPEND:
case KX_SOUNDACT_LOOPSTOP:
{
+ if(m_handle)
+ AUD_stop(m_handle);
m_handle = AUD_play(m_sound, AUD_BEHAVIOUR_LOOP, 0);
m_isplaying = true;
result = true;
@@ -218,6 +220,8 @@
case KX_SOUNDACT_PLAYSTOP:
case KX_SOUNDACT_PLAYEND:
{
+ if(m_handle)
+ AUD_stop(m_handle);
m_handle = AUD_play(m_sound, AUD_BEHAVIOUR_STOP, 0);
m_isplaying = true;
result = true;
@@ -359,6 +363,8 @@
AUD_resume(m_handle);
break;
default:
+ if(m_handle)
+ AUD_stop(m_handle);
m_handle = AUD_play(m_sound, AUD_BEHAVIOUR_STOP, 0);
}
Py_RETURN_NONE;
More information about the Bf-blender-cvs
mailing list