aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMarck2010-11-27 10:59:14 +0100
committerMarck2010-11-27 10:59:14 +0100
commitd71d4f96e32a674c86eb4b20af7c10d382443ce4 (patch)
tree0d84b72253ea99d6ce4164fb34a5f350ad84239a
parentMake gatekeeper's address check case-insensitive. (diff)
downloadopensim-SC-d71d4f96e32a674c86eb4b20af7c10d382443ce4.zip
opensim-SC-d71d4f96e32a674c86eb4b20af7c10d382443ce4.tar.gz
opensim-SC-d71d4f96e32a674c86eb4b20af7c10d382443ce4.tar.bz2
opensim-SC-d71d4f96e32a674c86eb4b20af7c10d382443ce4.tar.xz
Amend GetLinkPrimitiveParams with implementations for PRIM_TEXGEN, PRIM_BUMP_SHINY, PRIM_FULLBRIGHT, and PRIM_GLOW
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs86
1 files changed, 76 insertions, 10 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index d06b134..3c5f2d0 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -7759,24 +7759,59 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7759 break; 7759 break;
7760 7760
7761 case (int)ScriptBaseClass.PRIM_BUMP_SHINY: 7761 case (int)ScriptBaseClass.PRIM_BUMP_SHINY:
7762 // TODO--------------
7763 if (remain < 1) 7762 if (remain < 1)
7764 return res; 7763 return res;
7765 7764
7766 face=(int)rules.GetLSLIntegerItem(idx++); 7765 face=(int)rules.GetLSLIntegerItem(idx++);
7767 7766
7768 res.Add(new LSL_Integer(0)); 7767 tex = part.Shape.Textures;
7769 res.Add(new LSL_Integer(0)); 7768 if (face == ScriptBaseClass.ALL_SIDES)
7769 {
7770 for (face = 0; face < GetNumberOfSides(part); face++)
7771 {
7772 Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
7773 // Convert Shininess to PRIM_SHINY_*
7774 res.Add(new LSL_Integer((uint)texface.Shiny >> 6));
7775 // PRIM_BUMP_*
7776 res.Add(new LSL_Integer((int)texface.Bump));
7777 }
7778 }
7779 else
7780 {
7781 if (face >= 0 && face < GetNumberOfSides(part))
7782 {
7783 Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
7784 // Convert Shininess to PRIM_SHINY_*
7785 res.Add(new LSL_Integer((uint)texface.Shiny >> 6));
7786 // PRIM_BUMP_*
7787 res.Add(new LSL_Integer((int)texface.Bump));
7788 }
7789 }
7770 break; 7790 break;
7771 7791
7772 case (int)ScriptBaseClass.PRIM_FULLBRIGHT: 7792 case (int)ScriptBaseClass.PRIM_FULLBRIGHT:
7773 // TODO--------------
7774 if (remain < 1) 7793 if (remain < 1)
7775 return res; 7794 return res;
7776 7795
7777 face=(int)rules.GetLSLIntegerItem(idx++); 7796 face=(int)rules.GetLSLIntegerItem(idx++);
7778 7797
7779 res.Add(new LSL_Integer(0)); 7798 tex = part.Shape.Textures;
7799 if (face == ScriptBaseClass.ALL_SIDES)
7800 {
7801 for (face = 0; face < GetNumberOfSides(part); face++)
7802 {
7803 Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
7804 res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0));
7805 }
7806 }
7807 else
7808 {
7809 if (face >= 0 && face < GetNumberOfSides(part))
7810 {
7811 Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
7812 res.Add(new LSL_Integer(texface.Fullbright ? 1 : 0));
7813 }
7814 }
7780 break; 7815 break;
7781 7816
7782 case (int)ScriptBaseClass.PRIM_FLEXIBLE: 7817 case (int)ScriptBaseClass.PRIM_FLEXIBLE:
@@ -7797,14 +7832,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7797 break; 7832 break;
7798 7833
7799 case (int)ScriptBaseClass.PRIM_TEXGEN: 7834 case (int)ScriptBaseClass.PRIM_TEXGEN:
7800 // TODO--------------
7801 // (PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR)
7802 if (remain < 1) 7835 if (remain < 1)
7803 return res; 7836 return res;
7804 7837
7805 face=(int)rules.GetLSLIntegerItem(idx++); 7838 face=(int)rules.GetLSLIntegerItem(idx++);
7806 7839
7807 res.Add(new LSL_Integer(0)); 7840 tex = part.Shape.Textures;
7841 if (face == ScriptBaseClass.ALL_SIDES)
7842 {
7843 for (face = 0; face < GetNumberOfSides(part); face++)
7844 {
7845 MappingType texgen = tex.GetFace((uint)face).TexMapType;
7846 // Convert MappingType to PRIM_TEXGEN_DEFAULT, PRIM_TEXGEN_PLANAR etc.
7847 res.Add(new LSL_Integer((uint)texgen >> 1));
7848 }
7849 }
7850 else
7851 {
7852 if (face >= 0 && face < GetNumberOfSides(part))
7853 {
7854 MappingType texgen = tex.GetFace((uint)face).TexMapType;
7855 res.Add(new LSL_Integer((uint)texgen >> 1));
7856 }
7857 }
7808 break; 7858 break;
7809 7859
7810 case (int)ScriptBaseClass.PRIM_POINT_LIGHT: 7860 case (int)ScriptBaseClass.PRIM_POINT_LIGHT:
@@ -7823,14 +7873,30 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7823 break; 7873 break;
7824 7874
7825 case (int)ScriptBaseClass.PRIM_GLOW: 7875 case (int)ScriptBaseClass.PRIM_GLOW:
7826 // TODO--------------
7827 if (remain < 1) 7876 if (remain < 1)
7828 return res; 7877 return res;
7829 7878
7830 face=(int)rules.GetLSLIntegerItem(idx++); 7879 face=(int)rules.GetLSLIntegerItem(idx++);
7831 7880
7832 res.Add(new LSL_Float(0)); 7881 tex = part.Shape.Textures;
7882 if (face == ScriptBaseClass.ALL_SIDES)
7883 {
7884 for (face = 0; face < GetNumberOfSides(part); face++)
7885 {
7886 Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
7887 res.Add(new LSL_Float(texface.Glow));
7888 }
7889 }
7890 else
7891 {
7892 if (face >= 0 && face < GetNumberOfSides(part))
7893 {
7894 Primitive.TextureEntryFace texface = tex.GetFace((uint)face);
7895 res.Add(new LSL_Float(texface.Glow));
7896 }
7897 }
7833 break; 7898 break;
7899
7834 case (int)ScriptBaseClass.PRIM_TEXT: 7900 case (int)ScriptBaseClass.PRIM_TEXT:
7835 Color4 textColor = part.GetTextColor(); 7901 Color4 textColor = part.GetTextColor();
7836 res.Add(part.Text); 7902 res.Add(part.Text);