CDConfig.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /*
  2. Copyright (c) 2010 Steve Oldmeadow
  3. Permission is hereby granted, free of charge, to any person obtaining a copy
  4. of this software and associated documentation files (the "Software"), to deal
  5. in the Software without restriction, including without limitation the rights
  6. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. copies of the Software, and to permit persons to whom the Software is
  8. furnished to do so, subject to the following conditions:
  9. The above copyright notice and this permission notice shall be included in
  10. all copies or substantial portions of the Software.
  11. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  12. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  13. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  14. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  15. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  16. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  17. THE SOFTWARE.
  18. $Id$
  19. */
  20. #define COCOSDENSHION_VERSION "Aphex.rc"
  21. /**
  22. If enabled code useful for debugging such as parameter check assertions will be performed.
  23. If you experience any problems you should enable this and test your code with a debug build.
  24. */
  25. //#define CD_DEBUG 1
  26. /**
  27. The total number of sounds/buffers that can be loaded assuming memory is sufficient
  28. */
  29. //Number of buffers slots that will be initially created
  30. #define CD_BUFFERS_START 64
  31. //Number of buffers that will be added
  32. #define CD_BUFFERS_INCREMENT 16
  33. /**
  34. If enabled, OpenAL code will use static buffers. When static buffers are used the audio
  35. data is managed outside of OpenAL, this eliminates a memcpy operation which leads to
  36. higher performance when loading sounds.
  37. However, the downside is that when the audio data is freed you must
  38. be certain that it is no longer being accessed otherwise your app will crash. Testing on OS 2.2.1
  39. and 3.1.2 has shown that this may occur if a buffer is being used by a source with state = AL_PLAYING
  40. when the buffer is deleted. If the data is freed too quickly after the source is stopped then
  41. a crash will occur. The implemented workaround is that when static buffers are used the unloadBuffer code will wait for
  42. any playing sources to finish playing before the associated buffer and data are deleted, however, this delay may negate any
  43. performance gains that are achieved during loading.
  44. Performance tests on a 1st gen iPod running OS 2.2.1 loading the CocosDenshionDemo sounds were ~0.14 seconds without
  45. static buffers and ~0.12 seconds when using static buffers.
  46. */
  47. //#define CD_USE_STATIC_BUFFERS 1