mirror of
https://github.com/love2d/love.git
synced 2026-08-20 12:40:20 +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:
@@ -579,7 +579,6 @@
|
|||||||
53C6151E07FB1E3471590CB9 /* ltn12.lua.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ltn12.lua.h; sourceTree = "<group>"; };
|
53C6151E07FB1E3471590CB9 /* ltn12.lua.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ltn12.lua.h; sourceTree = "<group>"; };
|
||||||
53EE57FF4DBD52BB22701160 /* ParticleSystem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ParticleSystem.h; sourceTree = "<group>"; };
|
53EE57FF4DBD52BB22701160 /* ParticleSystem.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ParticleSystem.h; sourceTree = "<group>"; };
|
||||||
54A13C2209F945671BC27974 /* FileData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FileData.h; sourceTree = "<group>"; };
|
54A13C2209F945671BC27974 /* FileData.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FileData.h; sourceTree = "<group>"; };
|
||||||
54CC34F563B7405046FF1E43 /* audio.lua.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = audio.lua.h; sourceTree = "<group>"; };
|
|
||||||
54E653E84E8873D467C750FC /* mime.lua.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mime.lua.h; sourceTree = "<group>"; };
|
54E653E84E8873D467C750FC /* mime.lua.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = mime.lua.h; sourceTree = "<group>"; };
|
||||||
54E85987318206E93DC8189F /* PolygonShape.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PolygonShape.cpp; sourceTree = "<group>"; };
|
54E85987318206E93DC8189F /* PolygonShape.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = PolygonShape.cpp; sourceTree = "<group>"; };
|
||||||
55A759CE711E157339930E58 /* b2BlockAllocator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2BlockAllocator.cpp; sourceTree = "<group>"; };
|
55A759CE711E157339930E58 /* b2BlockAllocator.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = b2BlockAllocator.cpp; sourceTree = "<group>"; };
|
||||||
@@ -739,7 +738,6 @@
|
|||||||
FA577A8616C71CF000860150 /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = "<group>"; };
|
FA577A8616C71CF000860150 /* Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Shader.h; sourceTree = "<group>"; };
|
||||||
FA577A8716C71CF000860150 /* wrap_Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Shader.cpp; sourceTree = "<group>"; };
|
FA577A8716C71CF000860150 /* wrap_Shader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wrap_Shader.cpp; sourceTree = "<group>"; };
|
||||||
FA577A8816C71CF000860150 /* wrap_Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Shader.h; sourceTree = "<group>"; };
|
FA577A8816C71CF000860150 /* wrap_Shader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Shader.h; sourceTree = "<group>"; };
|
||||||
FA577A8B16C71D3600860150 /* audio.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = audio.lua; sourceTree = "<group>"; };
|
|
||||||
FA577A8C16C71D3600860150 /* auto.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = auto.lua; sourceTree = "<group>"; };
|
FA577A8C16C71D3600860150 /* auto.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = auto.lua; sourceTree = "<group>"; };
|
||||||
FA577A8D16C71D3600860150 /* boot.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = boot.lua; sourceTree = "<group>"; };
|
FA577A8D16C71D3600860150 /* boot.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = boot.lua; sourceTree = "<group>"; };
|
||||||
FA577A8E16C71D3600860150 /* graphics.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = graphics.lua; sourceTree = "<group>"; };
|
FA577A8E16C71D3600860150 /* graphics.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = graphics.lua; sourceTree = "<group>"; };
|
||||||
@@ -1208,8 +1206,6 @@
|
|||||||
352E6C5F6F8A681766EB5299 /* scripts */ = {
|
352E6C5F6F8A681766EB5299 /* scripts */ = {
|
||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
FA577A8B16C71D3600860150 /* audio.lua */,
|
|
||||||
54CC34F563B7405046FF1E43 /* audio.lua.h */,
|
|
||||||
FA577A8C16C71D3600860150 /* auto.lua */,
|
FA577A8C16C71D3600860150 /* auto.lua */,
|
||||||
FA577A8D16C71D3600860150 /* boot.lua */,
|
FA577A8D16C71D3600860150 /* boot.lua */,
|
||||||
503971A86B7167A91B670FBA /* boot.lua.h */,
|
503971A86B7167A91B670FBA /* boot.lua.h */,
|
||||||
|
|||||||
@@ -24,8 +24,6 @@
|
|||||||
#include "openal/Audio.h"
|
#include "openal/Audio.h"
|
||||||
#include "null/Audio.h"
|
#include "null/Audio.h"
|
||||||
|
|
||||||
#include "scripts/audio.lua.h"
|
|
||||||
|
|
||||||
#include "common/runtime.h"
|
#include "common/runtime.h"
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
@@ -41,8 +39,23 @@ int w_getSourceCount(lua_State *L)
|
|||||||
return 1;
|
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;
|
Source *t = 0;
|
||||||
|
|
||||||
if (luax_istype(L, 1, SOUND_SOUND_DATA_T))
|
if (luax_istype(L, 1, SOUND_SOUND_DATA_T))
|
||||||
@@ -56,9 +69,7 @@ int w_newSource1(lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return luaL_error(L, "No matching overload");
|
return luax_typerror(L, 1, "Decoder or SoundData");
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int w_play(lua_State *L)
|
int w_play(lua_State *L)
|
||||||
@@ -263,7 +274,7 @@ int w_getDistanceModel(lua_State *L)
|
|||||||
static const luaL_Reg functions[] =
|
static const luaL_Reg functions[] =
|
||||||
{
|
{
|
||||||
{ "getSourceCount", w_getSourceCount },
|
{ "getSourceCount", w_getSourceCount },
|
||||||
{ "newSource1", w_newSource1 },
|
{ "newSource", w_newSource },
|
||||||
{ "play", w_play },
|
{ "play", w_play },
|
||||||
{ "stop", w_stop },
|
{ "stop", w_stop },
|
||||||
{ "pause", w_pause },
|
{ "pause", w_pause },
|
||||||
@@ -333,9 +344,6 @@ extern "C" int luaopen_love_audio(lua_State *L)
|
|||||||
|
|
||||||
int n = luax_register_module(L, w);
|
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;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ namespace audio
|
|||||||
{
|
{
|
||||||
|
|
||||||
int w_getSourceCount(lua_State *L);
|
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_play(lua_State *L);
|
||||||
int w_stop(lua_State *L);
|
int w_stop(lua_State *L);
|
||||||
int w_pause(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);
|
Source *t = luax_checksource(L, 1);
|
||||||
float offset = (float)luaL_checknumber(L, 2);
|
float offset = (float)luaL_checknumber(L, 2);
|
||||||
if (offset < 0)
|
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);
|
t->seek(offset, u);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -112,9 +114,12 @@ int w_Source_seek(lua_State *L)
|
|||||||
int w_Source_tell(lua_State *L)
|
int w_Source_tell(lua_State *L)
|
||||||
{
|
{
|
||||||
Source *t = luax_checksource(L, 1);
|
Source *t = luax_checksource(L, 1);
|
||||||
const char *unit = luaL_optstring(L, 2, "seconds");
|
|
||||||
Source::Unit u;
|
Source::Unit u = Source::UNIT_SECONDS;
|
||||||
t->getConstant(unit, u);
|
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));
|
lua_pushnumber(L, t->tell(u));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -186,8 +186,8 @@ int w_newFileData(lua_State *L)
|
|||||||
|
|
||||||
FileData::Decoder decoder = FileData::FILE;
|
FileData::Decoder decoder = FileData::FILE;
|
||||||
|
|
||||||
if (decstr)
|
if (decstr && !FileData::getConstant(decstr, decoder))
|
||||||
FileData::getConstant(decstr, decoder);
|
return luaL_error(L, "Invalid FileData decoder: %s", decstr);
|
||||||
|
|
||||||
FileData *t = 0;
|
FileData *t = 0;
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ int w_newFileData(lua_State *L)
|
|||||||
t = instance->newFileData(str, filename);
|
t = instance->newFileData(str, filename);
|
||||||
break;
|
break;
|
||||||
default:
|
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);
|
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;
|
SpriteBatch::UsageHint usage = SpriteBatch::USAGE_DYNAMIC;
|
||||||
if (lua_gettop(L) > 2)
|
if (lua_gettop(L) > 2)
|
||||||
{
|
{
|
||||||
if (!SpriteBatch::getConstant(luaL_checkstring(L, 3), usage))
|
const char *usagestr = luaL_checkstring(L, 3);
|
||||||
usage = SpriteBatch::USAGE_DYNAMIC;
|
if (!SpriteBatch::getConstant(usagestr, usage))
|
||||||
|
return luaL_error(L, "Invalid SpriteBatch usage: %s", usagestr);
|
||||||
}
|
}
|
||||||
SpriteBatch *t = NULL;
|
SpriteBatch *t = NULL;
|
||||||
try
|
try
|
||||||
|
|||||||
@@ -68,11 +68,14 @@ int w_newBody(lua_State *L)
|
|||||||
World *world = luax_checktype<World>(L, 1, "World", PHYSICS_WORLD_T);
|
World *world = luax_checktype<World>(L, 1, "World", PHYSICS_WORLD_T);
|
||||||
float x = (float)luaL_optnumber(L, 2, 0.0);
|
float x = (float)luaL_optnumber(L, 2, 0.0);
|
||||||
float y = (float)luaL_optnumber(L, 3, 0.0);
|
float y = (float)luaL_optnumber(L, 3, 0.0);
|
||||||
const char *type = luaL_optstring(L, 4, "static");
|
|
||||||
Body::Type bodyType;
|
Body::Type btype = Body::BODY_STATIC;
|
||||||
Body::getConstant(type, bodyType);
|
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;
|
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);
|
luax_newtype(L, "Body", PHYSICS_BODY_T, (void *)body);
|
||||||
return 1;
|
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