add LSL llLinear2sRGB and llsRGB2Linear

This commit is contained in:
UbitUmarov
2023-04-28 01:55:35 +01:00
parent 549ebc1025
commit 7dbedecd88
4 changed files with 37 additions and 112 deletions

View File

@@ -18281,6 +18281,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return src;
}
}
public LSL_Vector llLinear2sRGB(LSL_Vector src)
{
return new LSL_Vector(Util.LinearTosRGB((float)src.x), Util.LinearTosRGB((float)src.y), Util.LinearTosRGB((float)src.z));
}
public LSL_Vector llsRGB2Linear(LSL_Vector src)
{
return new LSL_Vector(Util.sRGBtoLinear((float)src.x), Util.sRGBtoLinear((float)src.y), Util.sRGBtoLinear((float)src.z));
}
}
public class NotecardCache

View File

@@ -495,5 +495,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
void llLinkPlaySound(LSL_Integer linknumber, string sound, double volume);
void llLinkSetSoundQueueing(int linknumber, int queue);
void llLinkSetSoundRadius(int linknumber, double radius);
LSL_Vector llLinear2sRGB(LSL_Vector src);
LSL_Vector llsRGB2Linear(LSL_Vector src);
}
}

View File

@@ -2682,5 +2682,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
m_LSL_Functions.llLinkSetSoundRadius(linknumber, radius);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Vector llLinear2sRGB(LSL_Vector src)
{
return m_LSL_Functions.llLinear2sRGB(src);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public LSL_Vector llsRGB2Linear(LSL_Vector src)
{
return m_LSL_Functions.llsRGB2Linear(src);
}
}
}