mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
locale independent util::parse_double
This commit is contained in:
parent
84e8fd1af6
commit
bc72742ee3
20 changed files with 140 additions and 48 deletions
|
|
@ -101,6 +101,20 @@ void scripting::initialize(Engine* engine) {
|
|||
load_script(fs::path("stdlib.lua"));
|
||||
}
|
||||
|
||||
// todo: luaL state check
|
||||
runnable scripting::create_runnable(
|
||||
const std::string& filename,
|
||||
const std::string& src
|
||||
) {
|
||||
return [=](){
|
||||
if (luaL_loadbuffer(L, src.c_str(), src.length(), filename.c_str())) {
|
||||
handleError(L);
|
||||
return;
|
||||
}
|
||||
call_func(L, 0, filename);
|
||||
};
|
||||
}
|
||||
|
||||
void scripting::on_world_load(Level* level, BlocksController* blocks) {
|
||||
scripting::level = level;
|
||||
scripting::content = level->content;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#include <string>
|
||||
#include <filesystem>
|
||||
|
||||
#include "../../delegates.h"
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
class Engine;
|
||||
|
|
@ -20,6 +22,12 @@ namespace scripting {
|
|||
extern BlocksController* blocks;
|
||||
|
||||
void initialize(Engine* engine);
|
||||
|
||||
runnable create_runnable(
|
||||
const std::string& filename,
|
||||
const std::string& source
|
||||
);
|
||||
|
||||
void on_world_load(Level* level, BlocksController* blocks);
|
||||
void on_world_save();
|
||||
void on_world_quit();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue