mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Improved error checking for some enum strings (resolves issue #690).
Also moved love.audio.newSource from Lua code into C++ code
This commit is contained in:
@@ -24,8 +24,6 @@
|
||||
#include "openal/Audio.h"
|
||||
#include "null/Audio.h"
|
||||
|
||||
#include "scripts/audio.lua.h"
|
||||
|
||||
#include "common/runtime.h"
|
||||
|
||||
namespace love
|
||||
@@ -41,8 +39,23 @@ int w_getSourceCount(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
|
||||
int w_newSource1(lua_State *L)
|
||||
int w_newSource(lua_State *L)
|
||||
{
|
||||
if (lua_isstring(L, 1) || luax_istype(L, 1, FILESYSTEM_FILE_T))
|
||||
luax_convobj(L, 1, "filesystem", "newFileData");
|
||||
|
||||
if (luax_istype(L, 1, FILESYSTEM_FILE_DATA_T))
|
||||
luax_convobj(L, 1, "sound", "newDecoder");
|
||||
|
||||
Source::Type stype = Source::TYPE_STREAM;
|
||||
|
||||
const char *stypestr = lua_isnoneornil(L, 2) ? 0 : lua_tostring(L, 2);
|
||||
if (stypestr && !Source::getConstant(stypestr, stype))
|
||||
return luaL_error(L, "Invalid source type: %s", stypestr);
|
||||
|
||||
if (stype == Source::TYPE_STATIC && luax_istype(L, 1, SOUND_DECODER_T))
|
||||
luax_convobj(L, 1, "sound", "newSoundData");
|
||||
|
||||
Source *t = 0;
|
||||
|
||||
if (luax_istype(L, 1, SOUND_SOUND_DATA_T))
|
||||
@@ -56,9 +69,7 @@ int w_newSource1(lua_State *L)
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
return luaL_error(L, "No matching overload");
|
||||
|
||||
return 0;
|
||||
return luax_typerror(L, 1, "Decoder or SoundData");
|
||||
}
|
||||
|
||||
int w_play(lua_State *L)
|
||||
@@ -263,7 +274,7 @@ int w_getDistanceModel(lua_State *L)
|
||||
static const luaL_Reg functions[] =
|
||||
{
|
||||
{ "getSourceCount", w_getSourceCount },
|
||||
{ "newSource1", w_newSource1 },
|
||||
{ "newSource", w_newSource },
|
||||
{ "play", w_play },
|
||||
{ "stop", w_stop },
|
||||
{ "pause", w_pause },
|
||||
@@ -333,9 +344,6 @@ extern "C" int luaopen_love_audio(lua_State *L)
|
||||
|
||||
int n = luax_register_module(L, w);
|
||||
|
||||
if (luaL_loadbuffer(L, (const char *)audio_lua, sizeof(audio_lua), "audio.lua") == 0)
|
||||
lua_call(L, 0, 0);
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace audio
|
||||
{
|
||||
|
||||
int w_getSourceCount(lua_State *L);
|
||||
int w_newSource1(lua_State *L);
|
||||
int w_newSource(lua_State *L);
|
||||
int w_play(lua_State *L);
|
||||
int w_stop(lua_State *L);
|
||||
int w_pause(lua_State *L);
|
||||
|
||||
@@ -100,11 +100,13 @@ int w_Source_seek(lua_State *L)
|
||||
Source *t = luax_checksource(L, 1);
|
||||
float offset = (float)luaL_checknumber(L, 2);
|
||||
if (offset < 0)
|
||||
return luaL_error(L, "Can't seek to a negative position");
|
||||
return luaL_argerror(L, 2, "can't seek to a negative position");
|
||||
|
||||
Source::Unit u = Source::UNIT_SECONDS;
|
||||
const char *unit = lua_isnoneornil(L, 3) ? 0 : lua_tostring(L, 3);
|
||||
if (unit && !t->getConstant(unit, u))
|
||||
return luaL_error(L, "Invalid Source time unit: %s", unit);
|
||||
|
||||
const char *unit = luaL_optstring(L, 3, "seconds");
|
||||
Source::Unit u;
|
||||
t->getConstant(unit, u);
|
||||
t->seek(offset, u);
|
||||
return 0;
|
||||
}
|
||||
@@ -112,9 +114,12 @@ int w_Source_seek(lua_State *L)
|
||||
int w_Source_tell(lua_State *L)
|
||||
{
|
||||
Source *t = luax_checksource(L, 1);
|
||||
const char *unit = luaL_optstring(L, 2, "seconds");
|
||||
Source::Unit u;
|
||||
t->getConstant(unit, u);
|
||||
|
||||
Source::Unit u = Source::UNIT_SECONDS;
|
||||
const char *unit = lua_isnoneornil(L, 2) ? 0 : lua_tostring(L, 2);
|
||||
if (unit && !t->getConstant(unit, u))
|
||||
return luaL_error(L, "Invalid Source time unit: %s", unit);
|
||||
|
||||
lua_pushnumber(L, t->tell(u));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -186,8 +186,8 @@ int w_newFileData(lua_State *L)
|
||||
|
||||
FileData::Decoder decoder = FileData::FILE;
|
||||
|
||||
if (decstr)
|
||||
FileData::getConstant(decstr, decoder);
|
||||
if (decstr && !FileData::getConstant(decstr, decoder))
|
||||
return luaL_error(L, "Invalid FileData decoder: %s", decstr);
|
||||
|
||||
FileData *t = 0;
|
||||
|
||||
@@ -200,7 +200,7 @@ int w_newFileData(lua_State *L)
|
||||
t = instance->newFileData(str, filename);
|
||||
break;
|
||||
default:
|
||||
return luaL_error(L, "Unrecognized FileData decoder: %s", decstr);
|
||||
return luaL_error(L, "Invalid FileData decoder: %s", decstr);
|
||||
}
|
||||
|
||||
luax_newtype(L, "FileData", FILESYSTEM_FILE_DATA_T, (void *)t);
|
||||
|
||||
@@ -433,8 +433,9 @@ int w_newSpriteBatch(lua_State *L)
|
||||
SpriteBatch::UsageHint usage = SpriteBatch::USAGE_DYNAMIC;
|
||||
if (lua_gettop(L) > 2)
|
||||
{
|
||||
if (!SpriteBatch::getConstant(luaL_checkstring(L, 3), usage))
|
||||
usage = SpriteBatch::USAGE_DYNAMIC;
|
||||
const char *usagestr = luaL_checkstring(L, 3);
|
||||
if (!SpriteBatch::getConstant(usagestr, usage))
|
||||
return luaL_error(L, "Invalid SpriteBatch usage: %s", usagestr);
|
||||
}
|
||||
SpriteBatch *t = NULL;
|
||||
try
|
||||
|
||||
@@ -68,11 +68,14 @@ int w_newBody(lua_State *L)
|
||||
World *world = luax_checktype<World>(L, 1, "World", PHYSICS_WORLD_T);
|
||||
float x = (float)luaL_optnumber(L, 2, 0.0);
|
||||
float y = (float)luaL_optnumber(L, 3, 0.0);
|
||||
const char *type = luaL_optstring(L, 4, "static");
|
||||
Body::Type bodyType;
|
||||
Body::getConstant(type, bodyType);
|
||||
|
||||
Body::Type btype = Body::BODY_STATIC;
|
||||
const char *typestr = lua_isnoneornil(L, 4) ? 0 : lua_tostring(L, 4);
|
||||
if (typestr && !Body::getConstant(typestr, btype))
|
||||
return luaL_error(L, "Invalid Body type: %s", typestr);
|
||||
|
||||
Body *body;
|
||||
ASSERT_GUARD(body = instance->newBody(world, x, y, bodyType);)
|
||||
ASSERT_GUARD(body = instance->newBody(world, x, y, btype);)
|
||||
luax_newtype(L, "Body", PHYSICS_BODY_T, (void *)body);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
--[[
|
||||
Copyright (c) 2006-2013 LOVE Development Team
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
--]]
|
||||
|
||||
function love.audio.newSource(a, b)
|
||||
if type(a) == "string" then
|
||||
local err
|
||||
a, err = love.filesystem.newFileData(a)
|
||||
if not a then
|
||||
error(err, 2)
|
||||
end
|
||||
end
|
||||
if type(a) == "userdata" then
|
||||
if a:typeOf("File") or a:typeOf("FileData") then
|
||||
a = love.sound.newDecoder(a)
|
||||
end
|
||||
|
||||
if a:typeOf("Decoder") then
|
||||
if b == "static" then
|
||||
a = love.sound.newSoundData(a)
|
||||
end
|
||||
return love.audio.newSource1(a)
|
||||
end
|
||||
if a:typeOf("SoundData") then
|
||||
return love.audio.newSource1(a)
|
||||
end
|
||||
end
|
||||
error("No matching function overload", 2)
|
||||
end
|
||||
@@ -1,124 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2006-2013 LOVE Development Team
|
||||
*
|
||||
* This software is provided 'as-is', without any express or implied
|
||||
* warranty. In no event will the authors be held liable for any damages
|
||||
* arising from the use of this software.
|
||||
*
|
||||
* Permission is granted to anyone to use this software for any purpose,
|
||||
* including commercial applications, and to alter it and redistribute it
|
||||
* freely, subject to the following restrictions:
|
||||
*
|
||||
* 1. The origin of this software must not be misrepresented; you must not
|
||||
* claim that you wrote the original software. If you use this software
|
||||
* in a product, an acknowledgment in the product documentation would be
|
||||
* appreciated but is not required.
|
||||
* 2. Altered source versions must be plainly marked as such, and must not be
|
||||
* misrepresented as being the original software.
|
||||
* 3. This notice may not be removed or altered from any source distribution.
|
||||
**/
|
||||
|
||||
namespace love
|
||||
{
|
||||
|
||||
// [audio.lua]
|
||||
const unsigned char audio_lua[] =
|
||||
{
|
||||
|
||||
0x2d, 0x2d, 0x5b, 0x5b, 0x0a,
|
||||
0x43, 0x6f, 0x70, 0x79, 0x72, 0x69, 0x67, 0x68, 0x74, 0x20, 0x28, 0x63, 0x29, 0x20, 0x32, 0x30, 0x30, 0x36,
|
||||
0x2d, 0x32, 0x30, 0x31, 0x33, 0x20, 0x4c, 0x4f, 0x56, 0x45, 0x20, 0x44, 0x65, 0x76, 0x65, 0x6c, 0x6f, 0x70,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x20, 0x54, 0x65, 0x61, 0x6d, 0x0a,
|
||||
0x54, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x69, 0x73, 0x20, 0x70,
|
||||
0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x64, 0x20, 0x27, 0x61, 0x73, 0x2d, 0x69, 0x73, 0x27, 0x2c, 0x20, 0x77,
|
||||
0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x65, 0x78, 0x70, 0x72, 0x65, 0x73, 0x73,
|
||||
0x20, 0x6f, 0x72, 0x20, 0x69, 0x6d, 0x70, 0x6c, 0x69, 0x65, 0x64, 0x0a,
|
||||
0x77, 0x61, 0x72, 0x72, 0x61, 0x6e, 0x74, 0x79, 0x2e, 0x20, 0x20, 0x49, 0x6e, 0x20, 0x6e, 0x6f, 0x20, 0x65,
|
||||
0x76, 0x65, 0x6e, 0x74, 0x20, 0x77, 0x69, 0x6c, 0x6c, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x75, 0x74, 0x68,
|
||||
0x6f, 0x72, 0x73, 0x20, 0x62, 0x65, 0x20, 0x68, 0x65, 0x6c, 0x64, 0x20, 0x6c, 0x69, 0x61, 0x62, 0x6c, 0x65,
|
||||
0x20, 0x66, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x73, 0x0a,
|
||||
0x61, 0x72, 0x69, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x74, 0x68, 0x65, 0x20, 0x75,
|
||||
0x73, 0x65, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72,
|
||||
0x65, 0x2e, 0x0a,
|
||||
0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x73, 0x20, 0x67, 0x72, 0x61, 0x6e,
|
||||
0x74, 0x65, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6e, 0x79, 0x6f, 0x6e, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x75,
|
||||
0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x66,
|
||||
0x6f, 0x72, 0x20, 0x61, 0x6e, 0x79, 0x20, 0x70, 0x75, 0x72, 0x70, 0x6f, 0x73, 0x65, 0x2c, 0x0a,
|
||||
0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x69, 0x6e, 0x67, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x72, 0x63, 0x69,
|
||||
0x61, 0x6c, 0x20, 0x61, 0x70, 0x70, 0x6c, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2c, 0x20, 0x61,
|
||||
0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x20, 0x69, 0x74, 0x20, 0x61, 0x6e, 0x64,
|
||||
0x20, 0x72, 0x65, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x69, 0x74, 0x0a,
|
||||
0x66, 0x72, 0x65, 0x65, 0x6c, 0x79, 0x2c, 0x20, 0x73, 0x75, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x20, 0x74, 0x6f,
|
||||
0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6f, 0x6c, 0x6c, 0x6f, 0x77, 0x69, 0x6e, 0x67, 0x20, 0x72, 0x65, 0x73,
|
||||
0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a,
|
||||
0x31, 0x2e, 0x20, 0x54, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x20, 0x6f, 0x66, 0x20, 0x74,
|
||||
0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20,
|
||||
0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x6d, 0x69, 0x73, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e,
|
||||
0x74, 0x65, 0x64, 0x3b, 0x20, 0x79, 0x6f, 0x75, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x20, 0x74, 0x68, 0x61, 0x74, 0x20, 0x79, 0x6f, 0x75, 0x20,
|
||||
0x77, 0x72, 0x6f, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x61, 0x6c,
|
||||
0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x20, 0x49, 0x66, 0x20, 0x79, 0x6f, 0x75, 0x20,
|
||||
0x75, 0x73, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x69, 0x6e, 0x20, 0x61, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2c, 0x20, 0x61,
|
||||
0x6e, 0x20, 0x61, 0x63, 0x6b, 0x6e, 0x6f, 0x77, 0x6c, 0x65, 0x64, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x69,
|
||||
0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x20, 0x64, 0x6f, 0x63, 0x75,
|
||||
0x6d, 0x65, 0x6e, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x77, 0x6f, 0x75, 0x6c, 0x64, 0x20, 0x62, 0x65, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x61, 0x70, 0x70, 0x72, 0x65, 0x63, 0x69, 0x61, 0x74, 0x65, 0x64, 0x20, 0x62, 0x75, 0x74,
|
||||
0x20, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x64, 0x2e, 0x0a,
|
||||
0x32, 0x2e, 0x20, 0x41, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20,
|
||||
0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x62, 0x65, 0x20, 0x70,
|
||||
0x6c, 0x61, 0x69, 0x6e, 0x6c, 0x79, 0x20, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x64, 0x20, 0x61, 0x73, 0x20, 0x73,
|
||||
0x75, 0x63, 0x68, 0x2c, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6d, 0x75, 0x73, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x20,
|
||||
0x62, 0x65, 0x0a,
|
||||
0x20, 0x20, 0x20, 0x6d, 0x69, 0x73, 0x72, 0x65, 0x70, 0x72, 0x65, 0x73, 0x65, 0x6e, 0x74, 0x65, 0x64, 0x20,
|
||||
0x61, 0x73, 0x20, 0x62, 0x65, 0x69, 0x6e, 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x6f, 0x72, 0x69, 0x67, 0x69,
|
||||
0x6e, 0x61, 0x6c, 0x20, 0x73, 0x6f, 0x66, 0x74, 0x77, 0x61, 0x72, 0x65, 0x2e, 0x0a,
|
||||
0x33, 0x2e, 0x20, 0x54, 0x68, 0x69, 0x73, 0x20, 0x6e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x20, 0x6d, 0x61, 0x79,
|
||||
0x20, 0x6e, 0x6f, 0x74, 0x20, 0x62, 0x65, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x20, 0x6f, 0x72,
|
||||
0x20, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x65, 0x64, 0x20, 0x66, 0x72, 0x6f, 0x6d, 0x20, 0x61, 0x6e, 0x79, 0x20,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x0a,
|
||||
0x2d, 0x2d, 0x5d, 0x5d, 0x0a,
|
||||
0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64, 0x69,
|
||||
0x6f, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x28, 0x61, 0x2c, 0x20, 0x62, 0x29, 0x0a,
|
||||
0x09, 0x69, 0x66, 0x20, 0x74, 0x79, 0x70, 0x65, 0x28, 0x61, 0x29, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x73, 0x74,
|
||||
0x72, 0x69, 0x6e, 0x67, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x65, 0x72, 0x72, 0x0a,
|
||||
0x09, 0x09, 0x61, 0x2c, 0x20, 0x65, 0x72, 0x72, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69,
|
||||
0x6c, 0x65, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x6e, 0x65, 0x77, 0x46, 0x69, 0x6c, 0x65, 0x44, 0x61,
|
||||
0x74, 0x61, 0x28, 0x61, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x61, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x65, 0x72, 0x72, 0x2c, 0x20, 0x32, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x69, 0x66, 0x20, 0x74, 0x79, 0x70, 0x65, 0x28, 0x61, 0x29, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x75, 0x73,
|
||||
0x65, 0x72, 0x64, 0x61, 0x74, 0x61, 0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x69, 0x66, 0x20, 0x61, 0x3a, 0x74, 0x79, 0x70, 0x65, 0x4f, 0x66, 0x28, 0x22, 0x46, 0x69, 0x6c,
|
||||
0x65, 0x22, 0x29, 0x20, 0x6f, 0x72, 0x20, 0x61, 0x3a, 0x74, 0x79, 0x70, 0x65, 0x4f, 0x66, 0x28, 0x22, 0x46,
|
||||
0x69, 0x6c, 0x65, 0x44, 0x61, 0x74, 0x61, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x61, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x73, 0x6f, 0x75, 0x6e, 0x64, 0x2e,
|
||||
0x6e, 0x65, 0x77, 0x44, 0x65, 0x63, 0x6f, 0x64, 0x65, 0x72, 0x28, 0x61, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x09, 0x0a,
|
||||
0x09, 0x09, 0x69, 0x66, 0x20, 0x61, 0x3a, 0x74, 0x79, 0x70, 0x65, 0x4f, 0x66, 0x28, 0x22, 0x44, 0x65, 0x63,
|
||||
0x6f, 0x64, 0x65, 0x72, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x69, 0x66, 0x20, 0x62, 0x20, 0x3d, 0x3d, 0x20, 0x22, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63,
|
||||
0x22, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x09, 0x61, 0x20, 0x3d, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x73, 0x6f, 0x75, 0x6e, 0x64,
|
||||
0x2e, 0x6e, 0x65, 0x77, 0x53, 0x6f, 0x75, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x28, 0x61, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64,
|
||||
0x69, 0x6f, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x31, 0x28, 0x61, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x09, 0x69, 0x66, 0x20, 0x61, 0x3a, 0x74, 0x79, 0x70, 0x65, 0x4f, 0x66, 0x28, 0x22, 0x53, 0x6f, 0x75,
|
||||
0x6e, 0x64, 0x44, 0x61, 0x74, 0x61, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x09, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x61, 0x75, 0x64,
|
||||
0x69, 0x6f, 0x2e, 0x6e, 0x65, 0x77, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x31, 0x28, 0x61, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x28, 0x22, 0x4e, 0x6f, 0x20, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x69, 0x6e,
|
||||
0x67, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x6c, 0x6f, 0x61,
|
||||
0x64, 0x22, 0x2c, 0x20, 0x32, 0x29, 0x0a,
|
||||
0x65, 0x6e, 0x64, 0x0a,
|
||||
}; // [audio.lua]
|
||||
} // love
|
||||
Reference in New Issue
Block a user