1. rude
  2. love

Commits

Alex Szpakowski  committed 45435ff

Removed love.audio.newSource(source) (see issue #319)

  • Participants
  • Parent commits 6c2a645
  • Branches default

Comments (0)

Files changed (3)

File src/modules/audio/openal/Source.cpp

View file
  • Ignore whitespace
 	setFloatv(direction, z);
 }
 
-Source::Source(Source *s)
-	: love::audio::Source(s->type)
-	, pool(s->pool)
+Source::Source(const Source &s)
+	: love::audio::Source(s.type)
+	, pool(s.pool)
 	, valid(false)
-	, staticBuffer(s->staticBuffer)
-	, pitch(s->pitch)
-	, volume(s->volume)
-	, relative(s->relative)
-	, looping(s->looping)
+	, staticBuffer(s.staticBuffer)
+	, pitch(s.pitch)
+	, volume(s.volume)
+	, relative(s.relative)
+	, looping(s.looping)
 	, paused(false)
-	, minVolume(s->minVolume)
-	, maxVolume(s->maxVolume)
-	, referenceDistance(s->referenceDistance)
-	, rolloffFactor(s->rolloffFactor)
-	, maxDistance(s->maxDistance)
-	, cone(s->cone)
+	, minVolume(s.minVolume)
+	, maxVolume(s.maxVolume)
+	, referenceDistance(s.referenceDistance)
+	, rolloffFactor(s.rolloffFactor)
+	, maxDistance(s.maxDistance)
+	, cone(s.cone)
 	, offsetSamples(0)
 	, offsetSeconds(0)
-	, channels(s->channels)
+	, channels(s.channels)
 	, decoder(nullptr)
 	, toLoop(0)
 {
 	if (type == TYPE_STREAM)
 	{
-		if (s->decoder)
-			decoder = s->decoder->clone();
+		if (s.decoder)
+			decoder = s.decoder->clone();
 
 		alGenBuffers(MAX_BUFFERS, streamBuffers);
 	}
 	else
 		staticBuffer->retain();
 
-	setFloatv(position, s->position);
-	setFloatv(velocity, s->velocity);
-	setFloatv(direction, s->direction);
+	setFloatv(position, s.position);
+	setFloatv(velocity, s.velocity);
+	setFloatv(direction, s.direction);
 }
 
 Source::~Source()
 
 love::audio::Source *Source::clone()
 {
-	return new Source(this);
+	return new Source(*this);
 }
 
 void Source::play()

File src/modules/audio/openal/Source.h

View file
  • Ignore whitespace
 
 	Source(Pool *pool, love::sound::SoundData *soundData);
 	Source(Pool *pool, love::sound::Decoder *decoder);
-	Source(Source *s);
+	Source(const Source &s);
 	virtual ~Source();
 
 	virtual love::audio::Source *clone();

File src/modules/audio/wrap_Audio.cpp

View file
  • Ignore whitespace
 
 int w_newSource(lua_State *L)
 {
-	if (luax_istype(L, 1, AUDIO_SOURCE_T))
-	{
-		Source *t = luax_checksource(L, 1);
-		Source *clone = 0;
-		EXCEPT_GUARD(clone = t->clone();)
-		luax_pushtype(L, "Source", AUDIO_SOURCE_T, clone);
-		return 1;
-	}
-
 	if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T))
 		luax_convobj(L, 1, "filesystem", "newFileData");