PixelMagic.CodeGenContext.LoadConst C# (CSharp) Method

LoadConst() private method

private LoadConst ( int num ) : void
num int
return void
        internal void LoadConst(int num)
        {
            if (constMap.ContainsKey (num))
                throw new Exception (String.Format ("constant {0} already defined", num));

            LocalBuilder lb = DeclareLocal (typeof (Vector4f), "const_" + num);
            constMap [num] = lb;

            ilgen.Emit (OpCodes.Ldarg_0);
            ilgen.Emit (OpCodes.Ldc_I4, num);
            ilgen.Emit (OpCodes.Call, typeof (ShaderData).GetMethod ("GetConstantOrZero"));
            ilgen.Emit (OpCodes.Stloc, lb);
        }