Rename single color image function

This commit is contained in:
Emma Broman
2021-02-03 08:33:55 +01:00
parent f2eb81a450
commit 0b9b42e0bf
3 changed files with 11 additions and 8 deletions

View File

@@ -1,6 +1,9 @@
local assetHelper = asset.require('util/asset_helper')
local singeColorTexturePath = openspace.createPixelImage("example_ring_color", {0.0, 1.0, 1.0})
local color = {0.0, 1.0, 1.0}
-- @TODO (emmbr 2020-02-03) Potential threading issue later on? This will run on the main thread
local singeColorTexturePath = openspace.createSingeColorImage("example_ring_color", color)
local BasicDisc = {
Identifier = "BasicDisc",
@@ -17,6 +20,6 @@ local BasicDisc = {
}
}
assetHelper.registerSceneGraphNodesAndExport(asset, {
assetHelper.registerSceneGraphNodesAndExport(asset, {
BasicDisc
})

View File

@@ -1540,8 +1540,8 @@ scripting::LuaLibrary OpenSpaceEngine::luaLibrary() {
"Removes a tag (second argument) from a scene graph node (first argument)"
},
{
"createPixelImage",
&luascriptfunctions::createPixelImage,
"createSingeColorImage",
&luascriptfunctions::createSingeColorImage,
{},
"string, vec3",
"Creates a 1 pixel image with a certain color in the cache folder and "

View File

@@ -294,11 +294,11 @@ int downloadFile(lua_State* L) {
/**
* \ingroup LuaScripts
* createPixelImage():
* Creates a one pixel image with a given color and returns the p
* createSingeColorImage():
* Creates a one pixel image with a given color and returns the path to the cached file
*/
int createPixelImage(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::createPixelImage");
int createSingeColorImage(lua_State* L) {
ghoul::lua::checkArgumentsAndThrow(L, 2, "lua::createSingeColorImage");
const std::string& name = ghoul::lua::value<std::string>(L, 1);
const ghoul::Dictionary& d = ghoul::lua::value<ghoul::Dictionary>(L, 2);