Browse Source

Sources are now NOT useless.

rude 16 years ago
parent
commit
3d76667ca3

+ 2 - 2
src/love.cpp

@@ -134,8 +134,8 @@ int main(int argc, char ** argv)
 	// which gets everything started.
 	// which gets everything started.
 
 
 	// TODO: This is obviously test code.
 	// TODO: This is obviously test code.
-	//luaL_dofile(L, "../../src/scripts/boot.lua");
-#	include "scripts/boot.lua.h"
+	luaL_dofile(L, "../../src/scripts/boot.lua");
+//#	include "scripts/boot.lua.h"
 
 
 	lua_close(L);
 	lua_close(L);
 
 

+ 1 - 1
src/modules/audio/Audio.h

@@ -59,7 +59,7 @@ namespace audio
 		* Creates a new Source.
 		* Creates a new Source.
 		* @returns A new Source.
 		* @returns A new Source.
 		**/
 		**/
-		virtual Source * newSource() = 0;
+		virtual Source * newSource(Audible * audible) = 0;
 
 
 		/**
 		/**
 		* Gets the current number of simulatenous playing sources.
 		* Gets the current number of simulatenous playing sources.

+ 1 - 1
src/modules/audio/null/Audio.cpp

@@ -49,7 +49,7 @@ namespace null
 		return new Music(decoder);
 		return new Music(decoder);
 	}
 	}
 
 
-	love::audio::Source * Audio::newSource()
+	love::audio::Source * Audio::newSource(Audible * audible)
 	{
 	{
 		return new Source();
 		return new Source();
 	}
 	}

+ 1 - 1
src/modules/audio/null/Audio.h

@@ -49,7 +49,7 @@ namespace null
 		// Implements Audio.
 		// Implements Audio.
 		love::audio::Sound * newSound(love::sound::SoundData * data);
 		love::audio::Sound * newSound(love::sound::SoundData * data);
 		love::audio::Music * newMusic(love::sound::Decoder * decoder);
 		love::audio::Music * newMusic(love::sound::Decoder * decoder);
-		love::audio::Source * newSource();
+		love::audio::Source * newSource(Audible * audible);
 		int getNumSources() const;
 		int getNumSources() const;
 		int getMaxSources() const;
 		int getMaxSources() const;
 		void play(love::audio::Source * source);
 		void play(love::audio::Source * source);

+ 2 - 2
src/modules/audio/openal/Audio.cpp

@@ -89,9 +89,9 @@ namespace openal
 		return new Music(pool, decoder);
 		return new Music(pool, decoder);
 	}
 	}
 
 
-	love::audio::Source * Audio::newSource()
+	love::audio::Source * Audio::newSource(Audible * audible)
 	{
 	{
-		return new Source(pool);
+		return new Source(pool, audible);
 	}
 	}
 
 
 	int Audio::getNumSources() const
 	int Audio::getNumSources() const

+ 1 - 1
src/modules/audio/openal/Audio.h

@@ -79,7 +79,7 @@ namespace openal
 		// Implements Audio.
 		// Implements Audio.
 		love::audio::Sound * newSound(love::sound::SoundData * data);
 		love::audio::Sound * newSound(love::sound::SoundData * data);
 		love::audio::Music * newMusic(love::sound::Decoder * decoder);
 		love::audio::Music * newMusic(love::sound::Decoder * decoder);
-		love::audio::Source * newSource();
+		love::audio::Source * newSource(Audible * audible);
 		int getNumSources() const;
 		int getNumSources() const;
 		int getMaxSources() const;
 		int getMaxSources() const;
 		void play(love::audio::Source * source);
 		void play(love::audio::Source * source);

+ 2 - 1
src/modules/audio/wrap_Audio.cpp

@@ -69,7 +69,8 @@ namespace audio
 
 
 	int _wrap_newSource(lua_State * L)
 	int _wrap_newSource(lua_State * L)
 	{
 	{
-		Source * t = instance->newSource();
+		Audible * a = luax_checktype<Audible>(L, 1, "Audible", LOVE_AUDIO_AUDIBLE_BITS);
+		Source * t = instance->newSource(a);
 		luax_newtype(L, "Source", LOVE_AUDIO_SOURCE_BITS, (void*)t);
 		luax_newtype(L, "Source", LOVE_AUDIO_SOURCE_BITS, (void*)t);
 		return 1;
 		return 1;
 	}
 	}

+ 4 - 1
src/scripts/boot.lua

@@ -105,6 +105,9 @@ function love.boot()
 	-- Sets the source for the game.
 	-- Sets the source for the game.
 	if love.__args[1] and love.__args[1] ~= "" then
 	if love.__args[1] and love.__args[1] ~= "" then
 		love.filesystem.setSource(love.path.getfull(love.__args[1]))
 		love.filesystem.setSource(love.path.getfull(love.__args[1]))
+	else
+		-- Do not set a source, load the default game.
+		love.defaultscreen()
 	end
 	end
 	
 	
 end
 end
@@ -195,7 +198,7 @@ end
 
 
 function love.defaultscreen()
 function love.defaultscreen()
 
 
-	-- Main loop goes here.
+
 
 
 end
 end