rm compat;

This commit is contained in:
bjorn 2019-05-12 22:27:17 -07:00
parent 7c2a119324
commit 51ce0c1418
5 changed files with 491 additions and 582 deletions

View File

@ -1,7 +1,6 @@
#include "api.h"
#include "version.h"
#include "resources/logo.png.h"
#include "resources/compat.lua.h"
#include "lib/lua-cjson/lua_cjson.h"
#include "lib/lua-enet/enet.h"
@ -82,7 +81,5 @@ int luaopen_lovr(lua_State* L) {
luaL_register(L, NULL, lovr);
lua_pushlstring(L, (const char*) logo_png, logo_png_len);
lua_setfield(L, -2, "_logo");
lua_pushlstring(L, (const char*) compat_lua, compat_lua_len);
lua_setfield(L, -2, "_compat");
return 1;
}

View File

@ -50,7 +50,6 @@ end
function lovr.boot()
local conf = {
version = '0.12.0',
compat = false,
modules = {
audio = true,
data = true,
@ -99,10 +98,6 @@ function lovr.boot()
end
end
if conf.compat then
assert(loadstring(lovr._compat))(conf.version)
end
lovr.handlers = setmetatable({}, { __index = lovr })
if not confOk then error(confError) end
if hasMain then require 'main' end

File diff suppressed because it is too large Load Diff

View File

@ -1,25 +0,0 @@
local function parseVersion(version)
return version:match('(%d+)%.(%d+)%.(%d+)')
end
local targetMajor, targetMinor, targetPatch = parseVersion(...)
local shims = {
['master'] = function()
--
end
}
for version, shim in pairs(shims) do
if version == 'master' then
shim()
else
local major, minor, patch = parseVersion(version)
if major > targetMajor or
(major == targetMajor and minor > targetMinor) or
(major == targetMajor and minor == targetMinor and patch >= targetPatch)
then
shim()
end
end
end

View File

@ -1,50 +0,0 @@
unsigned char compat_lua[] = {
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
0x6f, 0x6e, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x56, 0x65, 0x72, 0x73,
0x69, 0x6f, 0x6e, 0x28, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x29,
0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x65,
0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x6d, 0x61, 0x74, 0x63, 0x68, 0x28,
0x27, 0x28, 0x25, 0x64, 0x2b, 0x29, 0x25, 0x2e, 0x28, 0x25, 0x64, 0x2b,
0x29, 0x25, 0x2e, 0x28, 0x25, 0x64, 0x2b, 0x29, 0x27, 0x29, 0x0a, 0x65,
0x6e, 0x64, 0x0a, 0x0a, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x74, 0x61,
0x72, 0x67, 0x65, 0x74, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x2c, 0x20, 0x74,
0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x6f, 0x72, 0x2c, 0x20,
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x63, 0x68, 0x20,
0x3d, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x56, 0x65, 0x72, 0x73, 0x69,
0x6f, 0x6e, 0x28, 0x2e, 0x2e, 0x2e, 0x29, 0x0a, 0x0a, 0x6c, 0x6f, 0x63,
0x61, 0x6c, 0x20, 0x73, 0x68, 0x69, 0x6d, 0x73, 0x20, 0x3d, 0x20, 0x7b,
0x0a, 0x20, 0x20, 0x5b, 0x27, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x27,
0x5d, 0x20, 0x3d, 0x20, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x28, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2d, 0x2d, 0x0a, 0x20, 0x20,
0x65, 0x6e, 0x64, 0x0a, 0x7d, 0x0a, 0x0a, 0x66, 0x6f, 0x72, 0x20, 0x76,
0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x2c, 0x20, 0x73, 0x68, 0x69, 0x6d,
0x20, 0x69, 0x6e, 0x20, 0x70, 0x61, 0x69, 0x72, 0x73, 0x28, 0x73, 0x68,
0x69, 0x6d, 0x73, 0x29, 0x20, 0x64, 0x6f, 0x0a, 0x20, 0x20, 0x69, 0x66,
0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x3d, 0x20,
0x27, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x27, 0x20, 0x74, 0x68, 0x65,
0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x73, 0x68, 0x69, 0x6d, 0x28, 0x29,
0x0a, 0x20, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x20, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x2c,
0x20, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x2c, 0x20, 0x70, 0x61, 0x74, 0x63,
0x68, 0x20, 0x3d, 0x20, 0x70, 0x61, 0x72, 0x73, 0x65, 0x56, 0x65, 0x72,
0x73, 0x69, 0x6f, 0x6e, 0x28, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,
0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x6d, 0x61, 0x6a,
0x6f, 0x72, 0x20, 0x3e, 0x20, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d,
0x61, 0x6a, 0x6f, 0x72, 0x20, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x28, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x3d, 0x3d, 0x20,
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x20,
0x61, 0x6e, 0x64, 0x20, 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x20, 0x3e, 0x20,
0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x6f, 0x72, 0x29,
0x20, 0x6f, 0x72, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x28, 0x6d,
0x61, 0x6a, 0x6f, 0x72, 0x20, 0x3d, 0x3d, 0x20, 0x74, 0x61, 0x72, 0x67,
0x65, 0x74, 0x4d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x64, 0x20,
0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x20, 0x3d, 0x3d, 0x20, 0x74, 0x61, 0x72,
0x67, 0x65, 0x74, 0x4d, 0x69, 0x6e, 0x6f, 0x72, 0x20, 0x61, 0x6e, 0x64,
0x20, 0x70, 0x61, 0x74, 0x63, 0x68, 0x20, 0x3e, 0x3d, 0x20, 0x74, 0x61,
0x72, 0x67, 0x65, 0x74, 0x50, 0x61, 0x74, 0x63, 0x68, 0x29, 0x0a, 0x20,
0x20, 0x20, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x73, 0x68, 0x69, 0x6d, 0x28, 0x29, 0x0a, 0x20, 0x20, 0x20,
0x20, 0x65, 0x6e, 0x64, 0x0a, 0x20, 0x20, 0x65, 0x6e, 0x64, 0x0a, 0x65,
0x6e, 0x64, 0x0a
};
unsigned int compat_lua_len = 555;