Panagiotis Christopoulos Charitos 15 лет назад
Родитель
Сommit
47265156f1
3 измененных файлов с 66 добавлено и 16 удалено
  1. 1 1
      shaders/BsRefract.glsl
  2. 1 2
      src/Renderer/Bs.cpp
  3. 64 13
      src/Util/Tokenizer/Scanner.h

+ 1 - 1
shaders/BsRefract.glsl

@@ -10,5 +10,5 @@ varying vec2 texCoords;
 
 void main()
 {
-	gl_FragData[0].rgb = texture2D(fai, texCoords).rgb;
+	gl_FragData[0] = texture2D(fai, texCoords);
 }

+ 1 - 2
src/Renderer/Bs.cpp

@@ -29,8 +29,6 @@ void Renderer::Bs::createFbo()
 //======================================================================================================================
 void Renderer::Bs::createRefractFbo()
 {
-	refractFai.createEmpty2D(r.width, r.height, GL_RGBA8, GL_RGBA, GL_FLOAT, false);
-
 	refractFbo.create();
 	refractFbo.bind();
 
@@ -52,6 +50,7 @@ void Renderer::Bs::createRefractFbo()
 void Renderer::Bs::init()
 {
 	createFbo();
+	refractFai.createEmpty2D(r.width, r.height, GL_RGBA8, GL_RGBA, GL_FLOAT, false);
 	createRefractFbo();
 
 	refractSProg = Resource::shaders.load("shaders/BsRefract.glsl");

+ 64 - 13
src/Util/Tokenizer/Scanner.h

@@ -89,10 +89,10 @@ class Scanner
 				 * @name Accessors
 				 */
 				/**@{*/
-				char        getChar()   const { return char_; }  ///< Access the data as C char
-				ulong       getInt()    const { return int_; }   ///< Access the data as unsigned int
-				float       getFloat()  const { return float_; } ///< Access the data as double
-				const char* getString() const { return string; } ///< Access the data as C string
+				char getChar() const; ///< Access the data as C char
+				ulong getInt() const; ///< Access the data as unsigned int
+				float getFloat() const; ///< Access the data as double
+				const char* getString() const; ///< Access the data as C string
 				/**@}*/
 		}; // end class TokenDataVal
 
@@ -111,7 +111,7 @@ class Scanner
 			public:
 				Token(): code(TC_ERROR) {}
 				Token(const Token& b);
-				const char* getString() const { return asString; }
+				const char* getString() const;
 				string getInfoStr() const; ///< Get a string with the info of the token
 				void print() const; ///< Print info of the token
 
@@ -185,19 +185,18 @@ class Scanner
 
 		/**
 		 * Accessor for the current token
-		 * @return
 		 */
-		const Token& getCrntToken() const { return crntToken; }
+		const Token& getCrntToken() const;
 
 		/**
 		 * Get the name of the input stream
 		 */
-		const char* getScriptName() const { return scriptName; }
+		const char* getScriptName() const;
 
 		/**
 		 * Get the current line the Scanner is processing
 		 */
-		int getLineNumber() const { return lineNmbr; }
+		int getLineNumber() const;
 
 
 	//====================================================================================================================
@@ -206,20 +205,20 @@ class Scanner
 	protected:
 		static char eofChar; ///< Special end of file character
 
-		static AsciiFlag asciiLookupTable []; ///< The array contains one AsciiFlag for every symbol of the ASCII table
+		static AsciiFlag asciiLookupTable[]; ///< The array contains one AsciiFlag for every symbol of the ASCII table
 
 		/**
 		 * @name Reserved words
 		 * Groups of ResWord grouped by the length of the ResWord::string
 		 */
 		/**@{*/
-		static ResWord rw2 [], rw3 [], rw4 [], rw5 [], rw6 [], rw7 [];
+		static ResWord rw2[], rw3[], rw4[], rw5[], rw6[], rw7[];
 		/**@}*/
 
-		static ResWord* rwTable []; ///< The array contains all the groups of ResWord
+		static ResWord* rwTable[]; ///< The array contains all the groups of ResWord
 
 		Token crntToken; ///< The current token
-		char  line [MAX_SCRIPT_LINE_LEN]; ///< In contains the current line's text
+		char  line[MAX_SCRIPT_LINE_LEN]; ///< In contains the current line's text
 		char* pchar; ///< Points somewhere to @ref line
 		int   lineNmbr; ///< The number of the current line
 
@@ -287,4 +286,56 @@ class Scanner
 		}
 }; // end class Scanner
 
+
+//======================================================================================================================
+// Inlines                                                                                                             =
+//======================================================================================================================
+
+inline char Scanner::TokenDataVal::getChar() const
+{
+	return char_;
+}
+
+
+inline ulong Scanner::TokenDataVal::getInt() const
+{
+	return int_;
+}
+
+
+inline float Scanner::TokenDataVal::getFloat() const
+{
+	return float_;
+}
+
+
+inline const char* Scanner::TokenDataVal::getString() const
+{
+	return string;
+}
+
+
+inline const Scanner::Token& Scanner::getCrntToken() const
+{
+	return crntToken;
+}
+
+
+inline const char* Scanner::getScriptName() const
+{
+	return scriptName;
+}
+
+
+inline int Scanner::getLineNumber() const
+{
+	return lineNmbr;
+}
+
+
+inline const char* Scanner::Token::getString() const
+{
+	return asString;
+}
+
 #endif