locale independent util::parse_double

This commit is contained in:
MihailRis
2024-02-02 20:02:30 +03:00
parent 84e8fd1af6
commit bc72742ee3
20 changed files with 140 additions and 48 deletions
+14
View File
@@ -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;
+8
View File
@@ -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();