summaryrefslogtreecommitdiff
path: root/utils/xbox/MakeGameData/MakeTextures.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /utils/xbox/MakeGameData/MakeTextures.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'utils/xbox/MakeGameData/MakeTextures.cpp')
-rw-r--r--utils/xbox/MakeGameData/MakeTextures.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/utils/xbox/MakeGameData/MakeTextures.cpp b/utils/xbox/MakeGameData/MakeTextures.cpp
new file mode 100644
index 0000000..f267367
--- /dev/null
+++ b/utils/xbox/MakeGameData/MakeTextures.cpp
@@ -0,0 +1,45 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: .360.VTF Creation
+//
+//=====================================================================================//
+
+#include "MakeGameData.h"
+#include "vtf/vtf.h"
+
+//-----------------------------------------------------------------------------
+// Purpose: Create the 360 VTF, use the library!
+//-----------------------------------------------------------------------------
+bool CreateTargetFile_VTF( const char *pSourceName, const char *pTargetName, bool bWriteToZip )
+{
+ CUtlBuffer sourceBuffer;
+ CUtlBuffer targetBuffer;
+
+ if ( !scriptlib->ReadFileToBuffer( pSourceName, sourceBuffer ) )
+ {
+ return false;
+ }
+
+ // using library conversion routine
+ bool bSuccess = ConvertVTFTo360Format( pSourceName, sourceBuffer, targetBuffer, CompressCallback );
+ if ( bSuccess )
+ {
+ bSuccess = WriteBufferToFile( pTargetName, targetBuffer, bWriteToZip, g_WriteModeForConversions );
+ }
+
+ return bSuccess;
+}
+
+//-----------------------------------------------------------------------------
+// Get the preload data for a vtf file
+//-----------------------------------------------------------------------------
+bool GetPreloadData_VTF( const char *pFilename, CUtlBuffer &fileBufferIn, CUtlBuffer &preloadBufferOut )
+{
+ if ( !GetVTFPreload360Data( pFilename, fileBufferIn, preloadBufferOut ) )
+ {
+ Msg( "Can't preload: '%s', has bad version\n", pFilename );
+ return false;
+ }
+
+ return true;
+} \ No newline at end of file