mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-23 20:50:59 -05:00
Move the LuaLibrary definition into its own file
This commit is contained in:
@@ -77,6 +77,7 @@ set(OPENSPACE_SOURCE
|
||||
${OPENSPACE_BASE_DIR}/src/scene/scene_lua.inl
|
||||
${OPENSPACE_BASE_DIR}/src/scene/scenegraph.cpp
|
||||
${OPENSPACE_BASE_DIR}/src/scene/scenegraphnode.cpp
|
||||
${OPENSPACE_BASE_DIR}/src/scripting/lualibrary.cpp
|
||||
${OPENSPACE_BASE_DIR}/src/scripting/scriptengine.cpp
|
||||
${OPENSPACE_BASE_DIR}/src/scripting/scriptengine_lua.inl
|
||||
${OPENSPACE_BASE_DIR}/src/util/blockplaneintersectiongeometry.cpp
|
||||
@@ -158,6 +159,7 @@ set(OPENSPACE_HEADER
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/scene/scene.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/scene/scenegraph.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/scene/scenegraphnode.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/scripting/lualibrary.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/scripting/script_helper.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/scripting/scriptengine.h
|
||||
${OPENSPACE_BASE_DIR}/include/openspace/util/blockplaneintersectiongeometry.h
|
||||
|
||||
@@ -82,7 +82,7 @@ std::vector<OpenSpaceModule*> ModuleEngine::modules() const {
|
||||
return result;
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary ModuleEngine::luaLibrary() {
|
||||
scripting::LuaLibrary ModuleEngine::luaLibrary() {
|
||||
return {
|
||||
"modules",
|
||||
{
|
||||
|
||||
@@ -967,7 +967,7 @@ void OpenSpaceEngine::toggleShutdownMode() {
|
||||
}
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary OpenSpaceEngine::luaLibrary() {
|
||||
scripting::LuaLibrary OpenSpaceEngine::luaLibrary() {
|
||||
return {
|
||||
"",
|
||||
{
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
|
||||
namespace openspace {
|
||||
namespace luascriptfunctions {
|
||||
|
||||
|
||||
@@ -493,7 +493,7 @@ void InteractionHandler::bindKey(Key key, KeyModifier modifier, std::string lua)
|
||||
});
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary InteractionHandler::luaLibrary() {
|
||||
scripting::LuaLibrary InteractionHandler::luaLibrary() {
|
||||
return {
|
||||
"",
|
||||
{
|
||||
@@ -1173,7 +1173,7 @@ void InteractionHandler::writeKeyboardDocumentation(const std::string& type, con
|
||||
}
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary InteractionHandler::luaLibrary() {
|
||||
scripting::LuaLibrary InteractionHandler::luaLibrary() {
|
||||
return{
|
||||
"",
|
||||
{
|
||||
|
||||
@@ -398,7 +398,7 @@ void LuaConsole::toggleVisibility() {
|
||||
_isVisible = !_isVisible;
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary LuaConsole::luaLibrary() {
|
||||
scripting::LuaLibrary LuaConsole::luaLibrary() {
|
||||
return {
|
||||
"console",
|
||||
{
|
||||
|
||||
@@ -1100,7 +1100,7 @@ int ParallelConnection::headerSize(){
|
||||
return 2 * sizeof(uint8_t) + 2 + sizeof(uint32_t);
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary ParallelConnection::luaLibrary() {
|
||||
scripting::LuaLibrary ParallelConnection::luaLibrary() {
|
||||
return {
|
||||
"parallel",
|
||||
{
|
||||
|
||||
@@ -677,7 +677,7 @@ void RenderEngine::setNAaSamples(int nAaSamples) {
|
||||
}
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary RenderEngine::luaLibrary() {
|
||||
scripting::LuaLibrary RenderEngine::luaLibrary() {
|
||||
return {
|
||||
"",
|
||||
{
|
||||
|
||||
+1
-1
@@ -555,7 +555,7 @@ void Scene::writePropertyDocumentation(const std::string& filename, const std::s
|
||||
LERROR("Undefined type '" << type << "' for Property documentation");
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary Scene::luaLibrary() {
|
||||
scripting::LuaLibrary Scene::luaLibrary() {
|
||||
return {
|
||||
"",
|
||||
{
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2016 *
|
||||
* *
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
|
||||
* software and associated documentation files (the "Software"), to deal in the Software *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <openspace/scripting/lualibrary.h>
|
||||
|
||||
namespace openspace {
|
||||
namespace scripting {
|
||||
|
||||
bool LuaLibrary::operator<(const LuaLibrary& rhs) const {
|
||||
return name < rhs.name;
|
||||
}
|
||||
|
||||
} // namespace scripting
|
||||
} // namespace openspace
|
||||
@@ -54,10 +54,6 @@ namespace {
|
||||
|
||||
}
|
||||
|
||||
bool ScriptEngine::LuaLibrary::operator<(const LuaLibrary& rhs) const {
|
||||
return name < rhs.name;
|
||||
}
|
||||
|
||||
void ScriptEngine::initialize() {
|
||||
LDEBUG("Adding base library");
|
||||
addBaseLibrary();
|
||||
@@ -208,7 +204,7 @@ bool ScriptEngine::shouldScriptBeSent(const std::string& library, const std::str
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<scripting::ScriptEngine::LuaLibrary::Function>::const_iterator funcit;
|
||||
std::vector<scripting::LuaLibrary::Function>::const_iterator funcit;
|
||||
//library was found
|
||||
if (libit != _registeredLibraries.cend()){
|
||||
for (funcit = libit->functions.cbegin();
|
||||
|
||||
+2
-3
@@ -240,8 +240,8 @@ bool Time::paused() const {
|
||||
return _timePaused;
|
||||
}
|
||||
|
||||
scripting::ScriptEngine::LuaLibrary Time::luaLibrary() {
|
||||
scripting::ScriptEngine::LuaLibrary timeLibrary = {
|
||||
scripting::LuaLibrary Time::luaLibrary() {
|
||||
return {
|
||||
"time",
|
||||
{
|
||||
{
|
||||
@@ -307,7 +307,6 @@ scripting::ScriptEngine::LuaLibrary Time::luaLibrary() {
|
||||
}
|
||||
}
|
||||
};
|
||||
return timeLibrary;
|
||||
}
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
Reference in New Issue
Block a user