mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
18 lines
458 B
C++
18 lines
458 B
C++
#include "api_lua.hpp"
|
|
|
|
#include "../../../content/Content.hpp"
|
|
#include "../../../world/Level.hpp"
|
|
|
|
using namespace scripting;
|
|
|
|
int l_index(lua::State* L) {
|
|
auto name = lua::require_string(L, 1);
|
|
auto& indices = content->getIndices(ResourceType::CAMERA);
|
|
std::cout << "index: " << name << std::endl;
|
|
return lua::pushinteger(L, indices.indexOf(name));
|
|
}
|
|
|
|
const luaL_Reg cameralib [] = {
|
|
{"index", lua::wrap<l_index>},
|
|
{NULL, NULL}
|
|
};
|