Example #1
0
            internal static unsafe void Invoke(IntPtr obj, float InFadeAmount, LinearColor Color, bool bInFadeAudio)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((float *)(b + 0))       = InFadeAmount;
                *((LinearColor *)(b + 4)) = Color;
                *((bool *)(b + 20))       = bInFadeAudio;
                Main.GetProcessEvent(obj, SetManualCameraFade_ptr, new IntPtr(p));;
            }
        }
            internal static unsafe void Invoke(UObject WorldContextObject, TextureRenderTarget2D TextureRenderTarget, LinearColor ClearColor)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))       = WorldContextObject;
                *((IntPtr *)(b + 8))       = TextureRenderTarget;
                *((LinearColor *)(b + 16)) = ClearColor;
                Main.GetProcessEvent(KismetRenderingLibrary.DefaultObject, ClearRenderTarget2D_ptr, new IntPtr(p));;
            }
        }
Example #3
0
            internal static unsafe byte /*TODO: text FText*/ Invoke(LinearColor InColor)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((LinearColor *)(b + 0)) = InColor;
                Main.GetProcessEvent(KismetTextLibrary.DefaultObject, Conv_ColorToText_ptr, new IntPtr(p));;
                //TODO: text FText ReturnValue
                return(UObject.NotImplemented <byte>() /*TODO: text FText*/);
            }
        }
Example #4
0
    public LinearColor GetColor(int hour, int minute, int second)
    {
        var nextHour       = (hour + 1) % 24;
        var fractionOfHour = (second + minute * 60) / 3600.0f;

        return(hour switch
        {
            6 => LinearColor.Lerp(_colorAtDawn, _colors[nextHour], fractionOfHour),
            18 => LinearColor.Lerp(_colorAtDusk, _colors[nextHour], fractionOfHour),
            _ => LinearColor.Lerp(_colors[hour], _colors[nextHour], fractionOfHour)
        });
Example #5
0
        public LinearColor ReadNextLinearColor(Stream src)
        {
            LinearColor c = new LinearColor();

            c.r = ReadNextFloat32(src);
            c.g = ReadNextFloat32(src);
            c.b = ReadNextFloat32(src);
            c.a = ReadNextFloat32(src);

            return(c);
        }
Example #6
0
            internal static unsafe bool Invoke(MaterialInstanceConstant Instance, Name ParameterName, LinearColor Value)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))       = Instance;
                *((Name *)(b + 8))         = ParameterName;
                *((LinearColor *)(b + 20)) = Value;
                Main.GetProcessEvent(MaterialEditingLibrary.DefaultObject, SetMaterialInstanceVectorParameterValue_ptr, new IntPtr(p));;
                return(*((bool *)(b + 36)));
            }
        }
            internal static unsafe bool Invoke(IntPtr obj, int InstanceIndex, LinearColor NewInstanceColor, bool bMarkRenderStateDirty)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((int *)(b + 0))         = InstanceIndex;
                *((LinearColor *)(b + 4)) = NewInstanceColor;
                *((bool *)(b + 20))       = bMarkRenderStateDirty;
                Main.GetProcessEvent(obj, UpdateInstanceColor_ptr, new IntPtr(p));;
                return(*((bool *)(b + 21)));
            }
        }
            internal static unsafe void Invoke(UObject WorldContextObject, MaterialParameterCollection Collection, Name ParameterName, LinearColor ParameterValue)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))       = WorldContextObject;
                *((IntPtr *)(b + 8))       = Collection;
                *((Name *)(b + 16))        = ParameterName;
                *((LinearColor *)(b + 28)) = ParameterValue;
                Main.GetProcessEvent(KismetMaterialLibrary.DefaultObject, SetVectorParameterValue_ptr, new IntPtr(p));;
            }
        }
Example #9
0
            internal static unsafe void Invoke(IntPtr obj, Vector2D ScreenPosition, Vector2D ScreenSize, float Thickness, LinearColor RenderColor)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((Vector2D *)(b + 0))     = ScreenPosition;
                *((Vector2D *)(b + 8))     = ScreenSize;
                *((float *)(b + 16))       = Thickness;
                *((LinearColor *)(b + 20)) = RenderColor;
                Main.GetProcessEvent(obj, K2_DrawBox_ptr, new IntPtr(p));;
            }
        }
Example #10
0
        public void SetShadowAll(LinearColor col)
        {
            BrushMask bm = Cfg.brushConfig.mask;//glob.getBrush().brushMask;
            Color     c  = col.ToGamma();

            foreach (MeshPoint v in meshPoints)
            {
                bm.Transfer(ref v.shadowBake, c);
            }

            Dirty = true;
        }
Example #11
0
            internal static unsafe void Invoke(IntPtr obj, LinearColor RectColor, float ScreenX, float ScreenY, float ScreenW, float ScreenH)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((LinearColor *)(b + 0)) = RectColor;
                *((float *)(b + 16))      = ScreenX;
                *((float *)(b + 20))      = ScreenY;
                *((float *)(b + 24))      = ScreenW;
                *((float *)(b + 28))      = ScreenH;
                Main.GetProcessEvent(obj, DrawRect_ptr, new IntPtr(p));;
            }
        }
Example #12
0
            internal static unsafe void Invoke(PaintContext Context, Vector2D PositionA, Vector2D PositionB, LinearColor Tint, bool bAntiAlias)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((PaintContext *)(b + 0)) = Context;
                *((Vector2D *)(b + 48))    = PositionA;
                *((Vector2D *)(b + 56))    = PositionB;
                *((LinearColor *)(b + 64)) = Tint;
                *((bool *)(b + 80))        = bAntiAlias;
                Main.GetProcessEvent(WidgetBlueprintLibrary.DefaultObject, DrawLine_ptr, new IntPtr(p));;
            }
        }
            internal static unsafe void Invoke(StaticMeshComponent StaticMeshComponent, LinearColor StartColor, LinearColor EndColor, EVertexPaintAxis Axis, bool bConvertToSRGB)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))       = StaticMeshComponent;
                *((LinearColor *)(b + 8))  = StartColor;
                *((LinearColor *)(b + 24)) = EndColor;
                *(b + 40)           = (byte)Axis;
                *((bool *)(b + 41)) = bConvertToSRGB;
                Main.GetProcessEvent(MeshVertexPainterKismetLibrary.DefaultObject, PaintVerticesLerpAlongAxis_ptr, new IntPtr(p));;
            }
        }
Example #14
0
        protected override void Update(TimeSpan gameTime)
        {
            if (animating)
            {
                animation_time += (float)gameTime.TotalSeconds;

                LinearColor c = new LinearColor(materialDecorator.Parameters_Color);
                c.R = 0.5f + (float)Math.Sin(animation_time * 2.0f) * 0.5f;
                c.G = 1.0f - c.R;
                c.B = 0.0f;
                materialDecorator.Parameters_Color = c.AsVector3;
            }
        }
Example #15
0
            internal static unsafe void Invoke(PaintContext Context, byte Points /*TODO: array TArray */, LinearColor Tint, bool bAntiAlias)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((PaintContext *)(b + 0)) = Context;
                throw new NotImplementedException(); //TODO: array TArray Points
                *((LinearColor *)(b + 64)) = Tint;
                *((bool *)(b + 80))        = bAntiAlias;
                Main.GetProcessEvent(WidgetBlueprintLibrary.DefaultObject, DrawLines_ptr, new IntPtr(p));;
                //TODO: array TArray Points
            }
        }
Example #16
0
            internal static unsafe void Invoke(PaintContext Context, Vector2D Position, Vector2D Size, SlateBrushAsset Brush, LinearColor Tint)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((PaintContext *)(b + 0)) = Context;
                *((Vector2D *)(b + 48))    = Position;
                *((Vector2D *)(b + 56))    = Size;
                *((IntPtr *)(b + 64))      = Brush;
                *((LinearColor *)(b + 72)) = Tint;
                Main.GetProcessEvent(WidgetBlueprintLibrary.DefaultObject, DrawBox_ptr, new IntPtr(p));;
            }
        }
Example #17
0
            internal static unsafe void Invoke(IntPtr obj, Texture RenderTexture, Vector2D ScreenPosition, Vector2D Radius, int NumberOfSides, LinearColor RenderColor)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))       = RenderTexture;
                *((Vector2D *)(b + 8))     = ScreenPosition;
                *((Vector2D *)(b + 16))    = Radius;
                *((int *)(b + 24))         = NumberOfSides;
                *((LinearColor *)(b + 28)) = RenderColor;
                Main.GetProcessEvent(obj, K2_DrawPolygon_ptr, new IntPtr(p));;
            }
        }
            internal static unsafe int Invoke(IntPtr obj, Transform Transform, PaperSprite Sprite, bool bWorldSpace, LinearColor Color)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((Transform *)(b + 0))    = Transform;
                *((IntPtr *)(b + 48))      = Sprite;
                *((bool *)(b + 56))        = bWorldSpace;
                *((LinearColor *)(b + 60)) = Color;
                Main.GetProcessEvent(obj, AddInstance_ptr, new IntPtr(p));;
                return(*((int *)(b + 76)));
            }
        }
Example #19
0
            internal static unsafe void Invoke(IntPtr obj, float StartScreenX, float StartScreenY, float EndScreenX, float EndScreenY, LinearColor LineColor, float LineThickness)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((float *)(b + 0))        = StartScreenX;
                *((float *)(b + 4))        = StartScreenY;
                *((float *)(b + 8))        = EndScreenX;
                *((float *)(b + 12))       = EndScreenY;
                *((LinearColor *)(b + 16)) = LineColor;
                *((float *)(b + 32))       = LineThickness;
                Main.GetProcessEvent(obj, DrawLine_ptr, new IntPtr(p));;
            }
        }
        internal bool _v_LinearColor(Property obj)
        {
            LinearColor col = obj as LinearColor;

            if (!(_IsValid(col.R, 0.0f, 1.0f) &&
                  _IsValid(col.G, 0.0f, 1.0f) &&
                  _IsValid(col.B, 0.0f, 1.0f) &&
                  _IsValid(col.A, 0.0f, 1.0f)))
            {
                _AddError(obj, string.Format("{0} | {1} | {2} | {3}", col.R, col.G, col.B, col.A));
                return(false);
            }
            return(true);
        }
Example #21
0
            internal static unsafe void Invoke(IntPtr obj, float FromAlpha, float ToAlpha, float Duration, LinearColor Color, bool bShouldFadeAudio, bool bHoldWhenFinished)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((float *)(b + 0))        = FromAlpha;
                *((float *)(b + 4))        = ToAlpha;
                *((float *)(b + 8))        = Duration;
                *((LinearColor *)(b + 12)) = Color;
                *((bool *)(b + 28))        = bShouldFadeAudio;
                *((bool *)(b + 29))        = bHoldWhenFinished;
                Main.GetProcessEvent(obj, StartCameraFade_ptr, new IntPtr(p));;
            }
        }
Example #22
0
        public void PaintAll(LinearColor col)
        {
            BrushMask bm = Cfg.brushConfig.mask;//glob.getBrush().brushMask;
            Color     c  = col.ToGamma();

            foreach (MeshPoint v in meshPoints)
            {
                foreach (Vertex uv in v.uvpoints)
                {
                    bm.Transfer(ref uv._color, c);
                }
            }
            //Debug.Log("Dirty");
            Dirty = true;
        }
Example #23
0
            internal static unsafe void Invoke(PaintContext Context, byte Text /*TODO: text FText */, Vector2D Position, Font Font, int FontSize, Name FontTypeFace, LinearColor Tint)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((PaintContext *)(b + 0)) = Context;
                throw new NotImplementedException(); //TODO: text FText Text
                *((Vector2D *)(b + 72))     = Position;
                *((IntPtr *)(b + 80))       = Font;
                *((int *)(b + 88))          = FontSize;
                *((Name *)(b + 92))         = FontTypeFace;
                *((LinearColor *)(b + 104)) = Tint;
                Main.GetProcessEvent(WidgetBlueprintLibrary.DefaultObject, DrawTextFormatted_ptr, new IntPtr(p));;
                //TODO: text FText Text
            }
        }
Example #24
0
            internal static unsafe void Invoke(PaintContext Context, string InString, Vector2D Position, LinearColor Tint)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((PaintContext *)(b + 0)) = Context;
                var InString_handle = GCHandle.Alloc(InString, GCHandleType.Pinned);

                *(IntPtr *)(b + 48)                = InString_handle.AddrOfPinnedObject();
                *(int *)(b + IntPtr.Size + 48)     = InString.Length;
                *(int *)(b + IntPtr.Size + 4 + 48) = InString.Length;
                *((Vector2D *)(b + 64))            = Position;
                *((LinearColor *)(b + 72))         = Tint;
                Main.GetProcessEvent(WidgetBlueprintLibrary.DefaultObject, DrawText_ptr, new IntPtr(p));;
                InString_handle.Free();
            }
        }
Example #25
0
            internal static unsafe void Invoke(IntPtr obj, Texture RenderTexture, Vector2D ScreenPosition, Vector2D ScreenSize, Vector2D CoordinatePosition, Vector2D CoordinateSize, LinearColor RenderColor, byte BlendMode, float Rotation, Vector2D PivotPoint)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))       = RenderTexture;
                *((Vector2D *)(b + 8))     = ScreenPosition;
                *((Vector2D *)(b + 16))    = ScreenSize;
                *((Vector2D *)(b + 24))    = CoordinatePosition;
                *((Vector2D *)(b + 32))    = CoordinateSize;
                *((LinearColor *)(b + 40)) = RenderColor;
                *(b + 56)               = BlendMode;
                *((float *)(b + 60))    = Rotation;
                *((Vector2D *)(b + 64)) = PivotPoint;
                Main.GetProcessEvent(obj, K2_DrawTexture_ptr, new IntPtr(p));;
            }
        }
Example #26
0
            public override bool Decode(string tag, string data)
            {
                switch (tag)
                {
                case "ch": data.DecodeInto(out channel); break;

                case "c": isColor = data.ToBool(); break;

                case "n": name = data; break;

                case "b": bumpStrength = data.ToFloat(); break;

                case "fc": fillColor = data.ToLinearColor(); break;

                default: return(false);
                }
                return(true);
            }
Example #27
0
            internal static unsafe void Invoke(IntPtr obj, MaterialInterface Material, Vector2D V0_Pos, Vector2D V1_Pos, Vector2D V2_Pos, Vector2D V0_UV, Vector2D V1_UV, Vector2D V2_UV, LinearColor V0_Color, LinearColor V1_Color, LinearColor V2_Color)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0))       = Material;
                *((Vector2D *)(b + 8))     = V0_Pos;
                *((Vector2D *)(b + 16))    = V1_Pos;
                *((Vector2D *)(b + 24))    = V2_Pos;
                *((Vector2D *)(b + 32))    = V0_UV;
                *((Vector2D *)(b + 40))    = V1_UV;
                *((Vector2D *)(b + 48))    = V2_UV;
                *((LinearColor *)(b + 56)) = V0_Color;
                *((LinearColor *)(b + 72)) = V1_Color;
                *((LinearColor *)(b + 88)) = V2_Color;
                Main.GetProcessEvent(obj, DrawMaterialTriangle_ptr, new IntPtr(p));;
            }
        }
            internal static unsafe void Invoke(UObject WorldContextObject, Box BoxShape, string Text, LinearColor ObjectColor, Name LogCategory, bool bAddToMessageLog)
            {
                long *p = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b = (byte *)p;

                *((IntPtr *)(b + 0)) = WorldContextObject;
                *((Box *)(b + 8))    = BoxShape;
                var Text_handle = GCHandle.Alloc(Text, GCHandleType.Pinned);

                *(IntPtr *)(b + 40)                = Text_handle.AddrOfPinnedObject();
                *(int *)(b + IntPtr.Size + 40)     = Text.Length;
                *(int *)(b + IntPtr.Size + 4 + 40) = Text.Length;
                *((LinearColor *)(b + 56))         = ObjectColor;
                *((Name *)(b + 72))                = LogCategory;
                *((bool *)(b + 84))                = bAddToMessageLog;
                Main.GetProcessEvent(VisualLoggerKismetLibrary.DefaultObject, LogBox_ptr, new IntPtr(p));;
                Text_handle.Free();
            }
        }
Example #29
0
        public static void LoadCommonParams(this Material self, glTFMaterial material, List <Texture> textures)
        {
            var pbr = material.pbrMetallicRoughness;

            if (pbr.baseColorFactor != null)
            {
                self.BaseColorFactor = LinearColor.FromLiner(pbr.baseColorFactor);
            }
            var baseColorTexture = pbr.baseColorTexture;

            if (baseColorTexture != null && baseColorTexture.index.TryGetValidIndex(textures.Count, out int index))
            {
                self.BaseColorTexture = new TextureInfo(textures[index]);
            }

            self.AlphaMode   = EnumUtil.Parse <VrmLib.AlphaModeType>(material.alphaMode);
            self.AlphaCutoff = material.alphaCutoff;
            self.DoubleSided = material.doubleSided;
        }
Example #30
0
            internal static unsafe void Invoke(IntPtr obj, string Text, LinearColor TextColor, float ScreenX, float ScreenY, Font Font, float Scale, bool bScalePosition)
            {
                long *p           = stackalloc long[] { 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L };
                byte *b           = (byte *)p;
                var   Text_handle = GCHandle.Alloc(Text, GCHandleType.Pinned);

                *(IntPtr *)(b + 0)                = Text_handle.AddrOfPinnedObject();
                *(int *)(b + IntPtr.Size + 0)     = Text.Length;
                *(int *)(b + IntPtr.Size + 4 + 0) = Text.Length;
                *((LinearColor *)(b + 16))        = TextColor;
                *((float *)(b + 32))              = ScreenX;
                *((float *)(b + 36))              = ScreenY;
                *((IntPtr *)(b + 40))             = Font;
                *((float *)(b + 48))              = Scale;
                *((bool *)(b + 52))               = bScalePosition;
                Main.GetProcessEvent(obj, DrawText_ptr, new IntPtr(p));;
                Text_handle.Free();
            }
        }