Browse Source

Properly handle multiple defines in a shader

BearishSun 9 years ago
parent
commit
621d0f7d33
2 changed files with 6 additions and 5 deletions
  1. 4 4
      Source/BansheeSL/Include/BsSLImporter.h
  2. 2 1
      Source/BansheeSL/Source/BsASTFX.c

+ 4 - 4
Source/BansheeSL/Include/BsSLImporter.h

@@ -22,16 +22,16 @@ namespace BansheeEngine
 		virtual ~SLImporter();
 
 		/** @copydoc SpecificImporter::isExtensionSupported */
-		virtual bool isExtensionSupported(const WString& ext) const override;
+		bool isExtensionSupported(const WString& ext) const override;
 
 		/** @copydoc SpecificImporter::isMagicNumberSupported */
-		virtual bool isMagicNumberSupported(const UINT8* magicNumPtr, UINT32 numBytes) const override;
+		bool isMagicNumberSupported(const UINT8* magicNumPtr, UINT32 numBytes) const override;
 
 		/** @copydoc SpecificImporter::import */
-		virtual SPtr<Resource> import(const Path& filePath, SPtr<const ImportOptions> importOptions) override;
+		SPtr<Resource> import(const Path& filePath, SPtr<const ImportOptions> importOptions) override;
 
 		/** @copydoc SpecificImporter::createImportOptions */
-		virtual SPtr<ImportOptions> createImportOptions() const override;
+		SPtr<ImportOptions> createImportOptions() const override;
 	};
 
 	/** @} */

+ 2 - 1
Source/BansheeSL/Source/BsASTFX.c

@@ -225,8 +225,9 @@ void beginCodeBlock(ParseState* parseState)
 		{
 			appendCodeBlock(parseState, " ", 1);
 			appendCodeBlock(parseState, parseState->defines[i].expr, (int)strlen(parseState->defines[i].expr));
-			appendCodeBlock(parseState, "\n", 1);
 		}
+
+		appendCodeBlock(parseState, "\n", 1);
 	}
 }