Esempio n. 1
0
        public void SetChannel3DVolume(ScriptThread thread)
        {
            ISampleBuffer sound = ((NativeObject)thread.GetObjectParameter(0)).Object as ISampleBuffer;

            if (sound == null)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called SetChannel3DPosition with an invalid object.", LogAlertLevel.Error);
                return;
            }
            sound.Position3D = new Vector(thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetFloatParameter(3));
        }
Esempio n. 2
0
        public void TileImageB(ScriptThread thread)
        {
            Image image = ((NativeObject)thread.GetObjectParameter(0)).Object as Image;

            if (image == null)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called TileImage with an invalid object.", LogAlertLevel.Error);
                return;
            }
            GraphicsManager.TileImage(image, thread.GetFloatParameter(0), thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetIntegerParameter(3));
        }
Esempio n. 3
0
        public void SetChannelRadius(ScriptThread thread)
        {
            ISampleBuffer sound = ((NativeObject)thread.GetObjectParameter(0)).Object as ISampleBuffer;

            if (sound == null)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called SetChannelRadius with an invalid object.", LogAlertLevel.Error);
                return;
            }
            sound.InnerRadius = thread.GetFloatParameter(1);
            sound.OuterRadius = thread.GetFloatParameter(2);
        }
Esempio n. 4
0
        public void NodeAtPoint(ScriptThread thread)
        {
            CollisionPolygon polygon = CollisionManager.PolygonAtPoint((int)thread.GetFloatParameter(0), (int)thread.GetFloatParameter(1));

            if (polygon == null || polygon.MetaData == null)
            {
                return;
            }
            thread.SetReturnValue(new SceneNodeScriptObject(polygon.MetaData as SceneNode));
        }
Esempio n. 5
0
        public void StreamWriteF(ScriptThread thread)
        {
            ScriptStream stream = ((NativeObject)thread.GetObjectParameter(0)).Object as ScriptStream;

            if (stream == null)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called StreamWrite with an invalid object.", LogAlertLevel.Error);
                return;
            }
            stream.Writer.Write(thread.GetFloatParameter(1));
        }
Esempio n. 6
0
        public void RenderEntity(ScriptThread thread)
        {
            EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;

            if (entity == null)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called RenderEntity with an invalid object.", LogAlertLevel.Error);
                return;
            }
            Transformation transformation = entity.CalculateTransformation();

            entity.Render(new Transformation(thread.GetFloatParameter(1) - transformation.X, thread.GetFloatParameter(2) - transformation.Y, thread.GetFloatParameter(3), 0.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f), null, entity.DepthLayer);
        }
Esempio n. 7
0
 public void RandomA(ScriptThread thread)
 {
     thread.SetReturnValue(MathMethods.Random(thread.GetFloatParameter(0), thread.GetFloatParameter(1)));
 }
Esempio n. 8
0
 public void SetScaleFactor(ScriptThread thread)
 {
     GraphicsManager.ScaleFactor = new float[3] {
         thread.GetFloatParameter(0), thread.GetFloatParameter(1), thread.GetFloatParameter(2)
     };
 }
Esempio n. 9
0
 public void SetRotationAngle(ScriptThread thread)
 {
     GraphicsManager.RotationAngle[0] = thread.GetFloatParameter(0);
     GraphicsManager.RotationAngle[1] = thread.GetFloatParameter(1);
     GraphicsManager.RotationAngle[2] = thread.GetFloatParameter(2);
 }
Esempio n. 10
0
        public void CreateBoundryProcessA(ScriptThread thread)
        {
            EntityNode entity = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;

            if (entity == null)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CreateBoundryProcess with an invalid object.", LogAlertLevel.Error);
                return;
            }
            thread.SetReturnValue(new ProcessScriptObject(new EntityBoundryProcess(entity, new RectangleF(thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetFloatParameter(3), thread.GetFloatParameter(4)))));
        }
Esempio n. 11
0
 public void RenderDashedRectangleB(ScriptThread thread)
 {
     GraphicsManager.RenderDashedRectangle(thread.GetFloatParameter(0), thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetFloatParameter(3), thread.GetFloatParameter(4), thread.GetIntegerParameter(5));
 }
Esempio n. 12
0
 public void RenderRectangleB(ScriptThread thread)
 {
     GraphicsManager.RenderRectangle(thread.GetFloatParameter(0), thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetFloatParameter(3), thread.GetFloatParameter(4), thread.GetBooleanParameter(5));
 }
Esempio n. 13
0
 public void RenderOvalA(ScriptThread thread)
 {
     GraphicsManager.RenderOval(thread.GetFloatParameter(0), thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetFloatParameter(3), thread.GetFloatParameter(4));
 }
Esempio n. 14
0
 public void SetOffset(ScriptThread thread)
 {
     GraphicsManager.Offset = new float[3] {
         thread.GetFloatParameter(0), thread.GetFloatParameter(1), thread.GetFloatParameter(2)
     };
 }
Esempio n. 15
0
 public void CheckForCollisionB(ScriptThread thread)
 {
     thread.SetReturnValue(CollisionManager.HitTest(new CollisionRectangle(new Transformation(thread.GetFloatParameter(0), thread.GetFloatParameter(1), 0, 0, 0, 0, 1.0f, 1.0f, 1.0f), thread.GetFloatParameter(2), thread.GetFloatParameter(3))));
 }
Esempio n. 16
0
        public void CreateMoveToProcessB(ScriptThread thread)
        {
            EntityNode entity     = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
            EntityNode moveEntity = ((NativeObject)thread.GetObjectParameter(3)).Object as EntityNode;

            if (entity == null || moveEntity == null)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CreateMoveToProcess with an invalid object.", LogAlertLevel.Error);
                return;
            }
            thread.SetReturnValue(new ProcessScriptObject(new EntityMoveToProcess(entity, moveEntity.Transformation.X + ((moveEntity.BoundingRectangle.Width / 2.0f) * moveEntity.Transformation.ScaleX), moveEntity.Transformation.Y + ((moveEntity.BoundingRectangle.Height / 2.0f) * moveEntity.Transformation.ScaleY), new StartFinishF(thread.GetFloatParameter(1), thread.GetFloatParameter(2)))));
        }
Esempio n. 17
0
 public void RenderPixel(ScriptThread thread)
 {
     GraphicsManager.RenderPixel(thread.GetFloatParameter(0), thread.GetFloatParameter(1), thread.GetFloatParameter(2));
 }
Esempio n. 18
0
 public void CreateChannelFadeProcess(ScriptThread thread)
 {
     Audio.ISampleBuffer sound = ((NativeObject)thread.GetObjectParameter(0)).Object as ISampleBuffer;
     if (sound == null)
     {
         DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CreateChannelFadeProcess with an invalid object.", LogAlertLevel.Error);
         return;
     }
     thread.SetReturnValue(new ProcessScriptObject(new ChannelFadeProcess(sound, thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetIntegerParameter(3))));
 }
Esempio n. 19
0
 public void RenderBitmapTextB(ScriptThread thread)
 {
     GraphicsManager.RenderText(thread.GetStringParameter(0), thread.GetFloatParameter(1), thread.GetFloatParameter(2), thread.GetFloatParameter(3), thread.GetBooleanParameter(4));
 }