Example #1
0
            public NewTex2dArgs(OpsParsedStatement statement)
            {
                OpsParsedArgument nameArg = statement.FindArgument("dst");

                if (nameArg == null)
                {
                    nameArg = statement.FindArgument("");
                    if (nameArg == null)
                    {
                        throw OpsException.ArgRequired("dst");
                    }
                }
                Name = nameArg.Value;

                OpsParsedArgument formatArg = statement.FindArgument("Format");

                if (formatArg == null)
                {
                    throw OpsException.ArgRequired("format");
                }
                this.Format = OpsFormatHelper.FindByFormat(formatArg.Value).Format;

                OpsParsedArgument widthArg = statement.FindArgument("Width");

                if (widthArg == null)
                {
                    throw OpsException.ArgRequired("width");
                }
                Width = int.Parse(widthArg.Value);

                OpsParsedArgument heightArg = statement.FindArgument("Height");

                if (heightArg == null)
                {
                    throw OpsException.ArgRequired("height");
                }
                Height = int.Parse(heightArg.Value);

                if (Width > 4096 || Height > 4096)
                {
                    throw new OpsException("Dimensions must not exceed 4k");
                }


                OpsParsedArgument mipsArg = statement.FindArgument("Mips");

                if (mipsArg != null)
                {
                    Mips = int.Parse(mipsArg.Value);
                }

                OpsParsedArgument srcArg = statement.FindArgument("Src");

                Src = (srcArg == null) ? null : srcArg.Value;
            }
            public TexFormatArgs(OpsParsedStatement statement)
            {
                OpsParsedArgument formatArg = statement.FindArgument("format");

                if (formatArg == null)
                {
                    formatArg = statement.FindArgument("");
                    if (formatArg == null)
                    {
                        throw OpsException.ArgRequired("format");
                    }
                }
                this.Format = OpsFormatHelper.FindByFormat(formatArg.Value).Format;
            }
Example #3
0
            public NewTexCubeArgs(OpsParsedStatement statement)
            {
                OpsParsedArgument nameArg = statement.FindArgument("dst");

                if (nameArg == null)
                {
                    nameArg = statement.FindArgument("");
                    if (nameArg == null)
                    {
                        throw OpsException.ArgRequired("dst");
                    }
                }
                Name = nameArg.Value;

                OpsParsedArgument formatArg = statement.FindArgument("Format");

                if (formatArg == null)
                {
                    throw OpsException.ArgRequired("format");
                }
                this.Format = OpsFormatHelper.FindByFormat(formatArg.Value).Format;

                OpsParsedArgument sizeArg = statement.FindArgument("Size");

                if (sizeArg == null)
                {
                    throw OpsException.ArgRequired("size");
                }
                Size = int.Parse(sizeArg.Value);

                if (Size > 4096)
                {
                    throw new OpsException("Dimensions must not exceed 4k");
                }

                OpsParsedArgument mipsArg = statement.FindArgument("Mips");

                if (mipsArg != null)
                {
                    Mips = int.Parse(mipsArg.Value);
                }

                OpsParsedArgument srcxpArg = statement.FindArgument("SrcXP");

                SrcXP = (srcxpArg == null) ? null : srcxpArg.Value;

                OpsParsedArgument srcxmArg = statement.FindArgument("SrcXM");

                SrcXM = (srcxmArg == null) ? null : srcxmArg.Value;

                OpsParsedArgument srcypArg = statement.FindArgument("SrcYP");

                SrcYP = (srcypArg == null) ? null : srcypArg.Value;

                OpsParsedArgument srcymArg = statement.FindArgument("SrcYM");

                SrcYM = (srcymArg == null) ? null : srcymArg.Value;

                OpsParsedArgument srczpArg = statement.FindArgument("SrcZP");

                SrcZP = (srcypArg == null) ? null : srczpArg.Value;

                OpsParsedArgument srczmArg = statement.FindArgument("SrcZM");

                SrcZM = (srczmArg == null) ? null : srczmArg.Value;
            }