mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Sources are now NOT useless.
This commit is contained in:
+2
-2
@@ -134,8 +134,8 @@ int main(int argc, char ** argv)
|
||||
// which gets everything started.
|
||||
|
||||
// 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);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace audio
|
||||
* Creates 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.
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace null
|
||||
return new Music(decoder);
|
||||
}
|
||||
|
||||
love::audio::Source * Audio::newSource()
|
||||
love::audio::Source * Audio::newSource(Audible * audible)
|
||||
{
|
||||
return new Source();
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ namespace null
|
||||
// Implements Audio.
|
||||
love::audio::Sound * newSound(love::sound::SoundData * data);
|
||||
love::audio::Music * newMusic(love::sound::Decoder * decoder);
|
||||
love::audio::Source * newSource();
|
||||
love::audio::Source * newSource(Audible * audible);
|
||||
int getNumSources() const;
|
||||
int getMaxSources() const;
|
||||
void play(love::audio::Source * source);
|
||||
|
||||
@@ -89,9 +89,9 @@ namespace openal
|
||||
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
|
||||
|
||||
@@ -79,7 +79,7 @@ namespace openal
|
||||
// Implements Audio.
|
||||
love::audio::Sound * newSound(love::sound::SoundData * data);
|
||||
love::audio::Music * newMusic(love::sound::Decoder * decoder);
|
||||
love::audio::Source * newSource();
|
||||
love::audio::Source * newSource(Audible * audible);
|
||||
int getNumSources() const;
|
||||
int getMaxSources() const;
|
||||
void play(love::audio::Source * source);
|
||||
|
||||
@@ -69,7 +69,8 @@ namespace audio
|
||||
|
||||
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);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -105,6 +105,9 @@ function love.boot()
|
||||
-- Sets the source for the game.
|
||||
if love.__args[1] and love.__args[1] ~= "" then
|
||||
love.filesystem.setSource(love.path.getfull(love.__args[1]))
|
||||
else
|
||||
-- Do not set a source, load the default game.
|
||||
love.defaultscreen()
|
||||
end
|
||||
|
||||
end
|
||||
@@ -195,7 +198,7 @@ end
|
||||
|
||||
function love.defaultscreen()
|
||||
|
||||
-- Main loop goes here.
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user