public bool LoadMemory(string text, string name, int startLine) { if(this.IsLoaded == true) { idConsole.Error("idLexer.LoadMemory: another script is already loaded"); return false; } _fileName = name; _fileTime = DateTime.Now; _buffer = text; _length = text.Length; _scriptPosition = 0; _lastScriptPosition = 0; _endPosition = _buffer.Length; _tokenAvailable = false; _line = startLine; _lastLine = startLine; _allocated = false; _loaded = true; return true; }
public Texture2D ParseImageProgram(string source, ref DateTime timeStamp, ref TextureDepth depth) { _lexer = new idLexer(LexerOptions.NoFatalErrors | LexerOptions.NoStringConcatination | LexerOptions.NoStringEscapeCharacters | LexerOptions.AllowPathNames); _lexer.LoadMemory(source, source); return ParseImageProgram(ref timeStamp, ref depth, false); }