Beispiel #1
0
        public void Implode(ScriptThread thread)
        {
            int    arrayMemoryIndex = thread.GetArrayParameter(0);
            int    arrayLength      = thread.GetArrayLength(arrayMemoryIndex);
            string implodedString   = "";

            for (int i = 0; i < arrayLength; i++)
            {
                implodedString += thread.GetStringArrayElement(arrayMemoryIndex, i);
            }

            thread.SetReturnValue(implodedString);
        }
Beispiel #2
0
        public void CreateAnimationProcessD(ScriptThread thread)
        {
            EntityNode entity      = ((NativeObject)thread.GetObjectParameter(0)).Object as EntityNode;
            int        memoryIndex = thread.GetArrayParameter(3);

            if (entity == null || memoryIndex == 0)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called CreateAnimationProcess with an invalid object.", LogAlertLevel.Error);
                return;
            }
            int arrayLength = thread.GetArrayLength(memoryIndex);

            int[] frames = new int[arrayLength];
            for (int i = 0; i < arrayLength; i++)
            {
                frames[i] = thread.GetIntArrayElement(memoryIndex, i);
            }
            thread.SetReturnValue(new ProcessScriptObject(new AnimationProcess(entity, (AnimationMode)thread.GetIntegerParameter(1), thread.GetIntegerParameter(2), frames)));
        }
Beispiel #3
0
        public void RenderPolygonB(ScriptThread thread)
        {
            int arrayIndex = thread.GetArrayParameter(0);

            if (arrayIndex == 0)
            {
                DebugLogger.WriteLog((thread.Process.Url != null && thread.Process.Url != "" ? thread.Process.Url : "A script") + " called RenderPolygon with an invalid object.", LogAlertLevel.Error);
                return;
            }
            int arrayLength = thread.GetArrayLength(arrayIndex);

            Vertex[] vertexs = new Vertex[(arrayLength / 3)];
            for (int i = 0; i < (arrayLength / 3); i++)
            {
                vertexs[i] = new Vertex(thread.GetFloatArrayElement(arrayIndex, (i * 3)),
                                        thread.GetFloatArrayElement(arrayIndex, (i * 3) + 1),
                                        thread.GetFloatArrayElement(arrayIndex, (i * 3) + 2));
            }

            GraphicsManager.RenderPolygon(vertexs, thread.GetBooleanParameter(1));
        }
Beispiel #4
0
 public void LengthH(ScriptThread thread)
 {
     thread.SetReturnValue(thread.GetArrayLength(thread.GetArrayParameter(0)));
 }