MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / LS_Load

Method LS_Load

ogsr_engine/Layers/xrRender/ResourceManager_Scripting.cpp:500–593  ·  view source on GitHub ↗

export

Source from the content-addressed store, hash-verified

498
499// export
500void CResourceManager::LS_Load()
501{
502 //**************************************************************//
503 // Msg("[CResourceManager] Starting LuaJIT");
504 R_ASSERT2(!LSVM, "! LuaJIT is already running"); //На всякий случай
505 //
506#ifdef LUABIND_09
507 luabind::disable_super_deprecation();
508#else
509 luabind::allocator = &luabind_allocator; //Аллокатор инитится только здесь и только один раз!
510 luabind::allocator_parameter = nullptr;
511#endif
512 LSVM = luaL_newstate(); //Запускаем LuaJIT. Память себе он выделит сам.
513 luaL_openlibs(LSVM); //Инициализация функций LuaJIT
514 R_ASSERT2(LSVM, "! ERROR : Cannot initialize LUA VM!"); //Надо проверить, случается ли такое.
515 luabind::open(LSVM); //Запуск луабинда
516 //
517 //--------------Установка калбеков------------------//
518#ifdef LUABIND_NO_EXCEPTIONS
519 luabind::set_error_callback(LuaError); //Калбек на ошибки.
520 luabind::set_cast_failed_callback(lua_cast_failed);
521#endif
522 luabind::set_pcall_callback(lua_pcall_failed); // KRodin: НЕ ЗАКОММЕНТИРОВАТЬ НИ В КОЕМ СЛУЧАЕ!!!
523 lua_atpanic(LSVM, lua_panic);
524 // Msg("[CResourceManager] LuaJIT Started!");
525 //-----------------------------------------------------//
526 //***************************************************************//
527
528 using namespace luabind;
529
530 module(LSVM)[def("log", &LuaLog),
531
532 class_<adopt_sampler>("_sampler")
533 .def(constructor<const adopt_sampler&>())
534 .def("texture", &adopt_sampler::_texture, return_reference_to<1>())
535 .def("project", &adopt_sampler::_projective, return_reference_to<1>())
536 .def("clamp", &adopt_sampler::_clamp, return_reference_to<1>())
537 .def("wrap", &adopt_sampler::_wrap, return_reference_to<1>())
538 .def("mirror", &adopt_sampler::_mirror, return_reference_to<1>())
539 .def("f_anisotropic", &adopt_sampler::_f_anisotropic, return_reference_to<1>())
540 .def("f_trilinear", &adopt_sampler::_f_trilinear, return_reference_to<1>())
541 .def("f_bilinear", &adopt_sampler::_f_bilinear, return_reference_to<1>())
542 .def("f_linear", &adopt_sampler::_f_linear, return_reference_to<1>())
543 .def("f_point", &adopt_sampler::_f_point, return_reference_to<1>())
544 .def("f_none", &adopt_sampler::_f_none, return_reference_to<1>())
545 .def("fmin_none", &adopt_sampler::_fmin_none, return_reference_to<1>())
546 .def("fmin_point", &adopt_sampler::_fmin_point, return_reference_to<1>())
547 .def("fmin_linear", &adopt_sampler::_fmin_linear, return_reference_to<1>())
548 .def("fmin_aniso", &adopt_sampler::_fmin_aniso, return_reference_to<1>())
549 .def("fmip_none", &adopt_sampler::_fmip_none, return_reference_to<1>())
550 .def("fmip_point", &adopt_sampler::_fmip_point, return_reference_to<1>())
551 .def("fmip_linear", &adopt_sampler::_fmip_linear, return_reference_to<1>())
552 .def("fmag_none", &adopt_sampler::_fmag_none, return_reference_to<1>())
553 .def("fmag_point", &adopt_sampler::_fmag_point, return_reference_to<1>())
554 .def("fmag_linear", &adopt_sampler::_fmag_linear, return_reference_to<1>()),
555
556 class_<adopt_compiler>("_compiler")
557 .def(constructor<const adopt_compiler&>())

Callers

nothing calls this directly

Calls 15

openFunction · 0.85
set_error_callbackFunction · 0.85
set_cast_failed_callbackFunction · 0.85
set_pcall_callbackFunction · 0.85
moduleFunction · 0.85
defFunction · 0.85
valueClass · 0.85
strextFunction · 0.85
enum_Method · 0.80
file_list_openMethod · 0.80
getShaderPathMethod · 0.80
file_list_closeMethod · 0.80

Tested by

no test coverage detected