Fixed non-positional bridge sound in canyon
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@8338 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
ef35220f48
commit
cdc61fda1e
@ -43,7 +43,6 @@ SFXBuffer::SFXBuffer(const std::string& file,
|
|||||||
m_buffer = 0;
|
m_buffer = 0;
|
||||||
m_gain = 1.0f;
|
m_gain = 1.0f;
|
||||||
m_rolloff = 0.1f;
|
m_rolloff = 0.1f;
|
||||||
m_positional = false;
|
|
||||||
m_loaded = false;
|
m_loaded = false;
|
||||||
m_file = file;
|
m_file = file;
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#include "audio/music_manager.hpp"
|
#include "audio/music_manager.hpp"
|
||||||
|
#include "audio/sfx_buffer.hpp"
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -264,12 +265,14 @@ SFXBase* SFXManager::createSoundSource(SFXBuffer* buffer,
|
|||||||
positional = buffer->isPositional();
|
positional = buffer->isPositional();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//printf("CREATING %s (%x), positional = %i (race_manager->getNumLocalPlayers() = %i, buffer->isPositional() = %i)\n",
|
||||||
|
// buffer->getFileName().c_str(), (unsigned int)buffer,
|
||||||
|
// positional,
|
||||||
|
// race_manager->getNumLocalPlayers(), buffer->isPositional());
|
||||||
|
|
||||||
assert( alIsBuffer(buffer->getBuffer()) );
|
assert( alIsBuffer(buffer->getBuffer()) );
|
||||||
SFXBase* sfx = new SFXOpenAL(buffer, positional, buffer->getGain());
|
SFXBase* sfx = new SFXOpenAL(buffer, positional, buffer->getGain());
|
||||||
|
|
||||||
// debugging
|
|
||||||
/*printf("newSfx(): id:%d buffer:%p, rolloff:%f, gain:%f %p\n", id, m_sfx_buffers[id], m_sfx_rolloff[id], m_sfx_gain[id], p);*/
|
|
||||||
|
|
||||||
sfx->volume(m_master_gain);
|
sfx->volume(m_master_gain);
|
||||||
|
|
||||||
if (add_to_SFX_list) m_all_sfx.push_back(sfx);
|
if (add_to_SFX_list) m_all_sfx.push_back(sfx);
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef HEADER_SFX_MANAGER_HPP
|
#ifndef HEADER_SFX_MANAGER_HPP
|
||||||
#define HEADER_SFX_MANAGER_HPP
|
#define HEADER_SFX_MANAGER_HPP
|
||||||
|
|
||||||
#include "audio/sfx_buffer.hpp"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -35,6 +34,7 @@
|
|||||||
#include "utils/vec3.hpp"
|
#include "utils/vec3.hpp"
|
||||||
|
|
||||||
class SFXBase;
|
class SFXBase;
|
||||||
|
class SFXBuffer;
|
||||||
class XMLNode;
|
class XMLNode;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
//
|
//
|
||||||
// SuperTuxKart - a fun racing game with go-kart
|
// SuperTuxKart - a fun racing game with go-kart
|
||||||
// Copyright (C) 2006 Patrick Ammann <pammann@aro.ch>
|
// Copyright (C) 2006 Patrick Ammann <pammann@aro.ch>
|
||||||
|
// 2009-2011 Marianne Gagnon
|
||||||
//
|
//
|
||||||
// This program is free software; you can redistribute it and/or
|
// This program is free software; you can redistribute it and/or
|
||||||
// modify it under the terms of the GNU General Public License
|
// modify it under the terms of the GNU General Public License
|
||||||
@ -20,7 +21,7 @@
|
|||||||
#if HAVE_OGGVORBIS
|
#if HAVE_OGGVORBIS
|
||||||
|
|
||||||
#include "audio/sfx_openal.hpp"
|
#include "audio/sfx_openal.hpp"
|
||||||
|
#include "audio/sfx_buffer.hpp"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -219,7 +220,16 @@ void SFXOpenAL::play()
|
|||||||
*/
|
*/
|
||||||
void SFXOpenAL::position(const Vec3 &position)
|
void SFXOpenAL::position(const Vec3 &position)
|
||||||
{
|
{
|
||||||
if(!m_ok||!m_positional) return;
|
if (!m_ok)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "WARNING, position called on non-ok SFX\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!m_positional)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "WARNING, position called on non-positional SFX\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
alSource3f(m_soundSource, AL_POSITION,
|
alSource3f(m_soundSource, AL_POSITION,
|
||||||
(float)position.getX(), (float)position.getY(), (float)position.getZ());
|
(float)position.getX(), (float)position.getY(), (float)position.getZ());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user