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

Method LS_Load

ogsr_engine/Layers/xrRenderDX10/dx10ResourceManager_Scripting.cpp:459–583  ·  view source on GitHub ↗

export

Source from the content-addressed store, hash-verified

457
458// export
459void CResourceManager::LS_Load()
460{
461 // Msg("[CResourceManager] Starting LuaJIT");
462
463 R_ASSERT(!LSVM, "! LuaJIT is already running"); //На всякий случай
464
465 luabind::allocator = &luabind_allocator; // Аллокатор инитится только здесь и только один раз!
466 luabind::allocator_parameter = nullptr;
467
468 LSVM = luaL_newstate(); //Запускаем LuaJIT. Память себе он выделит сам.
469 luaL_openlibs(LSVM); //Инициализация функций LuaJIT
470 R_ASSERT(LSVM, "! ERROR : Cannot initialize LUA VM!"); //Надо проверить, случается ли такое.
471 luabind::open(LSVM); //Запуск луабинда
472
473 //--------------Установка калбеков------------------//
474#ifdef LUABIND_NO_EXCEPTIONS
475 luabind::set_error_callback(lua_error2); // Калбек на ошибки.
476 luabind::set_cast_failed_callback(lua_cast_failed);
477#endif
478 luabind::set_pcall_callback(lua_pcall_failed); // KRodin: НЕ ЗАКОММЕНТИРОВАТЬ НИ В КОЕМ СЛУЧАЕ!!!
479
480 lua_atpanic(LSVM, lua_panic);
481
482 // Msg("[CResourceManager] LuaJIT Started!");
483
484 using namespace luabind;
485
486 module(LSVM)[(def("log", &ScriptLuaLog),
487
488 class_<adopt_dx10options>("_dx10options")
489 .def("getLevel", [](adopt_dx10options*) { return g_pGameLevel->name().c_str(); })
490 .def("hudElement", [](adopt_dx10options* O) { return O->HudElement(); }),
491
492 class_<adopt_compiler>("_compiler")
493 //.def(constructor<const adopt_compiler&>())
494 .def("begin", &adopt_compiler::_passCS, return_reference_to<1>())
495 .def("begin", &adopt_compiler::_pass, return_reference_to<1>())
496 .def("begin", &adopt_compiler::_passgs, return_reference_to<1>())
497 .def("begin", &adopt_compiler::_passеttess, return_reference_to<1>())
498 .def("sorting", &adopt_compiler::_options, return_reference_to<1>())
499 .def("emissive", &adopt_compiler::_o_emissive, return_reference_to<1>())
500 .def("distort", &adopt_compiler::_o_distort, return_reference_to<1>())
501 .def("wmark", &adopt_compiler::_o_wmark, return_reference_to<1>())
502 .def("fog", &adopt_compiler::_fog, return_reference_to<1>())
503 .def("zb", &adopt_compiler::_ZB, return_reference_to<1>())
504 .def("zb", &adopt_compiler::_ZBinvert, return_reference_to<1>())
505 .def("blend", &adopt_compiler::_blend, return_reference_to<1>())
506 .def("aref", &adopt_compiler::_aref, return_reference_to<1>())
507 .def("scopelense", &adopt_compiler::_o_scopelense, return_reference_to<1>())
508
509 // For compatibility only
510 .def("dx10color_write_enable", &adopt_compiler::_dx10color_write_enable, return_reference_to<1>())
511 .def("color_write_enable", &adopt_compiler::_dx10color_write_enable, return_reference_to<1>())
512 .def("dx10texture", &adopt_compiler::_dx10texture, return_reference_to<1>())
513 .def("dx10stencil", &adopt_compiler::_dx10Stencil, return_reference_to<1>())
514 .def("dx10stencil_ref", &adopt_compiler::_dx10StencilRef, return_reference_to<1>())
515 .def("dx10cullmode", &adopt_compiler::_dx10CullMode, return_reference_to<1>())
516 .def("dx10atoc", &adopt_compiler::_dx10ATOC, return_reference_to<1>())

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
HudElementMethod · 0.80
enum_Method · 0.80
file_list_openMethod · 0.80
getShaderPathMethod · 0.80

Tested by

no test coverage detected