mirror of
https://github.com/love2d/love.git
synced 2026-08-12 08:30:56 +02:00
Drop old require syntax (no more .lua extension)
This commit is contained in:
@@ -244,15 +244,10 @@ namespace physfs
|
||||
const char * filename = lua_tostring(L, -1);
|
||||
|
||||
std::string tmp(filename);
|
||||
tmp += ".lua";
|
||||
|
||||
int size = tmp.size();
|
||||
|
||||
if(size <= 4 || strcmp(filename + (size-4), ".lua") != 0)
|
||||
{
|
||||
tmp.append(".lua");
|
||||
size = tmp.size();
|
||||
}
|
||||
|
||||
for(int i=0;i<size-4;i++)
|
||||
{
|
||||
if(tmp[i] == '.')
|
||||
@@ -291,7 +286,7 @@ namespace physfs
|
||||
}
|
||||
}
|
||||
|
||||
lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", tmp.c_str());
|
||||
lua_pushfstring(L, "\n\tno file \"%s\" in LOVE game directories.\n", (tmp + ".lua").c_str());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -254,7 +254,7 @@ function love.init()
|
||||
|
||||
-- If config file exists, load it and allow it to update config table.
|
||||
if not love.conf and love.filesystem and love.filesystem.exists("conf.lua") then
|
||||
require("conf.lua")
|
||||
require("conf")
|
||||
end
|
||||
|
||||
-- Yes, conf.lua might not exist, but there are other ways of making
|
||||
@@ -303,7 +303,7 @@ function love.init()
|
||||
if love.filesystem then
|
||||
love.filesystem.setRelease(c.release and is_fused_game)
|
||||
if c.identity then love.filesystem.setIdentity(c.identity) end
|
||||
if love.filesystem.exists("main.lua") then require("main.lua") end
|
||||
if love.filesystem.exists("main.lua") then require("main") end
|
||||
end
|
||||
|
||||
if no_game_code then
|
||||
|
||||
@@ -419,8 +419,7 @@ const unsigned char boot_lua[] =
|
||||
0x6d, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73,
|
||||
0x74, 0x65, 0x6d, 0x2e, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c,
|
||||
0x75, 0x61, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x0a,
|
||||
0x09, 0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c, 0x75,
|
||||
0x61, 0x22, 0x29, 0x0a,
|
||||
0x09, 0x09, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22, 0x63, 0x6f, 0x6e, 0x66, 0x22, 0x29, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,0x0a,
|
||||
0x09, 0x2d, 0x2d, 0x20, 0x59, 0x65, 0x73, 0x2c, 0x20, 0x63, 0x6f, 0x6e, 0x66, 0x2e, 0x6c, 0x75, 0x61, 0x20,
|
||||
0x6d, 0x69, 0x67, 0x68, 0x74, 0x20, 0x6e, 0x6f, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x2c, 0x20, 0x62,
|
||||
@@ -513,7 +512,7 @@ const unsigned char boot_lua[] =
|
||||
0x09, 0x09, 0x69, 0x66, 0x20, 0x6c, 0x6f, 0x76, 0x65, 0x2e, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x79, 0x73, 0x74,
|
||||
0x65, 0x6d, 0x2e, 0x65, 0x78, 0x69, 0x73, 0x74, 0x73, 0x28, 0x22, 0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x6c, 0x75,
|
||||
0x61, 0x22, 0x29, 0x20, 0x74, 0x68, 0x65, 0x6e, 0x20, 0x72, 0x65, 0x71, 0x75, 0x69, 0x72, 0x65, 0x28, 0x22,
|
||||
0x6d, 0x61, 0x69, 0x6e, 0x2e, 0x6c, 0x75, 0x61, 0x22, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x6d, 0x61, 0x69, 0x6e, 0x22, 0x29, 0x20, 0x65, 0x6e, 0x64, 0x0a,
|
||||
0x09, 0x65, 0x6e, 0x64, 0x0a,0x0a,
|
||||
0x09, 0x69, 0x66, 0x20, 0x6e, 0x6f, 0x5f, 0x67, 0x61, 0x6d, 0x65, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x20, 0x74,
|
||||
0x68, 0x65, 0x6e, 0x0a,
|
||||
|
||||
Reference in New Issue
Block a user