Просмотр исходного кода

test wav compiler in resource-compiler

mikymod 12 лет назад
Родитель
Сommit
4535c729ce
2 измененных файлов с 14 добавлено и 4 удалено
  1. 4 0
      tools/CMakeLists.txt
  2. 10 4
      tools/cli/resource-compiler.cpp

+ 4 - 0
tools/CMakeLists.txt

@@ -9,6 +9,7 @@ set (INCLUDES
 	${CMAKE_SOURCE_DIR}/tools/core/strings
 	${CMAKE_SOURCE_DIR}/tools/compilers
 	${CMAKE_SOURCE_DIR}/tools/compilers/tga
+	${CMAKE_SOURCE_DIR}/tools/compilers/wav
 )
 
 set (CORE_SRC
@@ -23,6 +24,7 @@ set (CORE_HEADERS
 	core/formats/PixelFormat.h
 	core/formats/ResourceFormat.h
 	core/formats/TextureFormat.h
+	core/formats/SoundFormat.h
 
 	core/strings/StringUtils.h
 	core/strings/Hash.h
@@ -32,6 +34,7 @@ set (CORE_HEADERS
 set (COMPILERS_SRC
 	compilers/Compiler.cpp
 	compilers/tga/TGACompiler.cpp
+	compilers/wav/WAVCompiler.cpp
 #	compilers/ps/PSCompiler.cpp
 #	compilers/vs/VSCompiler.cpp
 )
@@ -39,6 +42,7 @@ set (COMPILERS_SRC
 set (COMPILER_HEADERS
 	compilers/Compiler.h
 	compilers/tga/TGACompiler.h
+	compilers/wav/WAVCompiler.h
 #	compilers/ps/PSCompiler.h
 #	compilers/vs/VSCompiler.h
 )

+ 10 - 4
tools/cli/resource-compiler.cpp

@@ -31,6 +31,7 @@ OTHER DEALINGS IN THE SOFTWARE.
 #include "StringUtils.h"
 #include "Hash.h"
 #include "TGACompiler.h"
+#include "WAVCompiler.h"
 
 using namespace crown;
 
@@ -64,9 +65,7 @@ int main(int argc, char** argv)
 
 
 	TGACompiler tga;
-	// TXTCompiler txt(root_path, dest_path);
-	// VSCompiler vs(root_path, dest_path);
-	// PSCompiler ps(root_path, dest_path);
+	WAVCompiler wav;
 
 	char out_name[1024];
 	char resource_name[1024];
@@ -83,7 +82,14 @@ int main(int argc, char** argv)
 
 		printf("%s <= %s\n", out_name, argv[first_resource + i]);
 
-		tga.compile(root_path, dest_path, argv[first_resource + i], out_name);
+		if (string::strcmp(resource_type, "tga") == 0)
+		{
+			tga.compile(root_path, dest_path, argv[first_resource + i], out_name);
+		}
+		else if (string::strcmp(resource_type, "wav") == 0)
+		{
+			wav.compile(root_path, dest_path, argv[first_resource + i], out_name);
+		}
 	}
 
 	return 0;