aboutsummaryrefslogtreecommitdiff
path: root/mp/src/utils/vtfdiff
diff options
context:
space:
mode:
authorJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
committerJoe Ludwig <[email protected]>2013-06-26 15:22:04 -0700
commit39ed87570bdb2f86969d4be821c94b722dc71179 (patch)
treeabc53757f75f40c80278e87650ea92808274aa59 /mp/src/utils/vtfdiff
downloadsource-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.tar.xz
source-sdk-2013-39ed87570bdb2f86969d4be821c94b722dc71179.zip
First version of the SOurce SDK 2013
Diffstat (limited to 'mp/src/utils/vtfdiff')
-rw-r--r--mp/src/utils/vtfdiff/vtfdiff-2010.vcxproj244
-rw-r--r--mp/src/utils/vtfdiff/vtfdiff-2010.vcxproj.filters53
-rw-r--r--mp/src/utils/vtfdiff/vtfdiff.cpp438
3 files changed, 735 insertions, 0 deletions
diff --git a/mp/src/utils/vtfdiff/vtfdiff-2010.vcxproj b/mp/src/utils/vtfdiff/vtfdiff-2010.vcxproj
new file mode 100644
index 00000000..06d0e26e
--- /dev/null
+++ b/mp/src/utils/vtfdiff/vtfdiff-2010.vcxproj
@@ -0,0 +1,244 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectName>Vtfdiff</ProjectName>
+ <ProjectGuid>{81EE9F71-4DFD-8670-B3EA-7B4E931E9845}</ProjectGuid>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <TargetName>vtfdiff</TargetName>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>Application</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <TargetName>vtfdiff</TargetName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\win32\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">.\Debug\win32\</IntDir>
+ <ExecutablePath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\devtools\vstools;$(ExecutablePath);$(Path)</ExecutablePath>
+ <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</PreBuildEventUseInBuild>
+ <PreLinkEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</PreLinkEventUseInBuild>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</GenerateManifest>
+ <PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</PostBuildEventUseInBuild>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\win32\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">.\Release\win32\</IntDir>
+ <ExecutablePath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\devtools\vstools;$(ExecutablePath);$(Path)</ExecutablePath>
+ <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</PreBuildEventUseInBuild>
+ <PreLinkEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</PreLinkEventUseInBuild>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+ <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</GenerateManifest>
+ <PostBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</PostBuildEventUseInBuild>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <PreBuildEvent>
+ <Command>if EXIST ..\..\..\game\bin\$(TargetFileName) for /f &quot;delims=&quot; %%A in (&apos;attrib &quot;..\..\..\game\bin\$(TargetFileName)&quot;&apos;) do set valveTmpIsReadOnly=&quot;%%A&quot;&#x0D;&#x0A;set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%&#x0D;&#x0A;if &quot;%valveTmpIsReadOnlyLetter%&quot;==&quot;R&quot; del /q &quot;$(TargetDir)&quot;$(TargetFileName)&#x0D;&#x0A;if exist ..\..\devtools\bin\vpc.exe ..\..\devtools\bin\vpc.exe -crc2 vtfdiff.vcxproj&#x0D;&#x0A;if ERRORLEVEL 1 exit 1</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <AdditionalOptions> /MP</AdditionalOptions>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>..\..\common;..\..\public;..\..\public\tier0;..\..\public\tier1</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>_HAS_ITERATOR_DEBUGGING=0;WIN32;_WIN32;_DEBUG;DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;RAD_TELEMETRY_DISABLED;COMPILER_MSVC32;VPCGAMECAPS=VALVE;PROJECTDIR=D:\dev\games\rel\hl2\src\utils\vtfdiff;_DLL_EXT=.dll;VPCGAME=valve</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>false</ExceptionHandling>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <BufferSecurityCheck>true</BufferSecurityCheck>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
+ <OpenMPSupport>false</OpenMPSupport>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <ExpandAttributedSource>false</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)/</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)/</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)/</ProgramDataBaseFileName>
+ <BrowseInformation>false</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <BrowseInformationFile>$(IntDir)/</BrowseInformationFile>
+ <ErrorReporting>Prompt</ErrorReporting>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE</PreprocessorDefinitions>
+ <Culture>1033</Culture>
+ </ResourceCompile>
+ <PreLinkEvent>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions> /NXCOMPAT /ignore:4221</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <ShowProgress>NotSet</ShowProgress>
+ <OutputFile>$(OutDir)\vtfdiff.exe</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>libc;libcd;libcmt</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)/$(TargetName).pdb</ProgramDatabaseFile>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>$(IntDir)/$(TargetName).map</MapFileName>
+ <SubSystem>Console</SubSystem>
+ <BaseAddress> </BaseAddress>
+ <TargetMachine>MachineX86</TargetMachine>
+ <LinkErrorReporting>PromptImmediately</LinkErrorReporting>
+ <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
+ </Link>
+ <Manifest>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Manifest>
+ <Xdcmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Xdcmake>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(OutDir)/vtfdiff.bsc</OutputFile>
+ </Bscmake>
+ <PostBuildEvent>
+ <Message>Publishing to ..\..\..\game\bin</Message>
+ <Command>if not exist &quot;..\..\..\game\bin&quot; mkdir &quot;..\..\..\game\bin&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;$(TargetFileName) ..\..\..\game\bin\$(TargetFileName)&#x0D;&#x0A;if ERRORLEVEL 1 goto BuildEventFailed&#x0D;&#x0A;if exist &quot;$(TargetDir)&quot;$(TargetName).map copy &quot;$(TargetDir)&quot;$(TargetName).map ..\..\..\game\bin\$(TargetName).map&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;$(TargetName).pdb ..\..\..\game\bin\$(TargetName).pdb&#x0D;&#x0A;if ERRORLEVEL 1 goto BuildEventFailed&#x0D;&#x0A;goto BuildEventOK&#x0D;&#x0A;:BuildEventFailed&#x0D;&#x0A;echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***&#x0D;&#x0A;del /q &quot;$(TargetDir)&quot;$(TargetFileName)&#x0D;&#x0A;exit 1&#x0D;&#x0A;:BuildEventOK&#x0D;&#x0A;</Command>
+ </PostBuildEvent>
+ <CustomBuildStep>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <PreBuildEvent>
+ <Command>if EXIST ..\..\..\game\bin\$(TargetFileName) for /f &quot;delims=&quot; %%A in (&apos;attrib &quot;..\..\..\game\bin\$(TargetFileName)&quot;&apos;) do set valveTmpIsReadOnly=&quot;%%A&quot;&#x0D;&#x0A;set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%&#x0D;&#x0A;if &quot;%valveTmpIsReadOnlyLetter%&quot;==&quot;R&quot; del /q &quot;$(TargetDir)&quot;$(TargetFileName)&#x0D;&#x0A;if exist ..\..\devtools\bin\vpc.exe ..\..\devtools\bin\vpc.exe -crc2 vtfdiff.vcxproj&#x0D;&#x0A;if ERRORLEVEL 1 exit 1</Command>
+ </PreBuildEvent>
+ <ClCompile>
+ <AdditionalOptions> /MP /d2Zi+</AdditionalOptions>
+ <Optimization>MaxSpeed</Optimization>
+ <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+ <IntrinsicFunctions>true</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>..\..\common;..\..\public;..\..\public\tier0;..\..\public\tier1</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_WIN32;NDEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;RAD_TELEMETRY_DISABLED;COMPILER_MSVC32;VPCGAMECAPS=VALVE;PROJECTDIR=D:\dev\games\rel\hl2\src\utils\vtfdiff;_DLL_EXT=.dll;VPCGAME=valve</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <ExceptionHandling>false</ExceptionHandling>
+ <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+ <BufferSecurityCheck>false</BufferSecurityCheck>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <EnableEnhancedInstructionSet>StreamingSIMDExtensions</EnableEnhancedInstructionSet>
+ <FloatingPointModel>Fast</FloatingPointModel>
+ <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
+ <ForceConformanceInForLoopScope>true</ForceConformanceInForLoopScope>
+ <RuntimeTypeInfo>true</RuntimeTypeInfo>
+ <OpenMPSupport>false</OpenMPSupport>
+ <PrecompiledHeader>NotUsing</PrecompiledHeader>
+ <ExpandAttributedSource>false</ExpandAttributedSource>
+ <AssemblerOutput>NoListing</AssemblerOutput>
+ <AssemblerListingLocation>$(IntDir)/</AssemblerListingLocation>
+ <ObjectFileName>$(IntDir)/</ObjectFileName>
+ <ProgramDataBaseFileName>$(IntDir)/</ProgramDataBaseFileName>
+ <BrowseInformation>false</BrowseInformation>
+ <WarningLevel>Level4</WarningLevel>
+ <TreatWarningAsError>true</TreatWarningAsError>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <CompileAs>CompileAsCpp</CompileAs>
+ <BrowseInformationFile>$(IntDir)/</BrowseInformationFile>
+ <ErrorReporting>Prompt</ErrorReporting>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE</PreprocessorDefinitions>
+ <Culture>1033</Culture>
+ </ResourceCompile>
+ <PreLinkEvent>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalOptions> /DYNAMICBASE /NXCOMPAT /ignore:4221</AdditionalOptions>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
+ <ShowProgress>NotSet</ShowProgress>
+ <OutputFile>$(OutDir)\vtfdiff.exe</OutputFile>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <IgnoreSpecificDefaultLibraries>libc;libcd;libcmtd</IgnoreSpecificDefaultLibraries>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(IntDir)/$(TargetName).pdb</ProgramDatabaseFile>
+ <GenerateMapFile>false</GenerateMapFile>
+ <MapFileName>$(IntDir)/$(TargetName).map</MapFileName>
+ <SubSystem>Console</SubSystem>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ <BaseAddress> </BaseAddress>
+ <TargetMachine>MachineX86</TargetMachine>
+ <LinkErrorReporting>PromptImmediately</LinkErrorReporting>
+ </Link>
+ <Manifest>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Manifest>
+ <Xdcmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ </Xdcmake>
+ <Bscmake>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <OutputFile>$(OutDir)/vtfdiff.bsc</OutputFile>
+ </Bscmake>
+ <PostBuildEvent>
+ <Message>Publishing to ..\..\..\game\bin</Message>
+ <Command>if not exist &quot;..\..\..\game\bin&quot; mkdir &quot;..\..\..\game\bin&quot;&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;$(TargetFileName) ..\..\..\game\bin\$(TargetFileName)&#x0D;&#x0A;if ERRORLEVEL 1 goto BuildEventFailed&#x0D;&#x0A;if exist &quot;$(TargetDir)&quot;$(TargetName).map copy &quot;$(TargetDir)&quot;$(TargetName).map ..\..\..\game\bin\$(TargetName).map&#x0D;&#x0A;copy &quot;$(TargetDir)&quot;$(TargetName).pdb ..\..\..\game\bin\$(TargetName).pdb&#x0D;&#x0A;if ERRORLEVEL 1 goto BuildEventFailed&#x0D;&#x0A;goto BuildEventOK&#x0D;&#x0A;:BuildEventFailed&#x0D;&#x0A;echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***&#x0D;&#x0A;del /q &quot;$(TargetDir)&quot;$(TargetFileName)&#x0D;&#x0A;exit 1&#x0D;&#x0A;:BuildEventOK&#x0D;&#x0A;</Command>
+ </PostBuildEvent>
+ <CustomBuildStep>
+ </CustomBuildStep>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <Library Include="..\..\lib\public\bitmap.lib" />
+ <Library Include="..\..\lib\public\mathlib.lib" />
+ <Library Include="..\..\lib\public\tier0.lib" />
+ <Library Include="..\..\lib\public\tier1.lib" />
+ <Library Include="..\..\lib\public\tier2.lib" />
+ <Library Include="..\..\lib\public\vstdlib.lib" />
+ <Library Include="..\..\lib\public\vtf.lib" />
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\public\tier0\memoverride.cpp">
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
+ <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
+ </ClCompile>
+ <ClCompile Include="vtfdiff.cpp" />
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\public\tier0\pointeroverride.asm">
+ <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Compiling pointeroverride.asm</Message>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">&quot;$(VCInstallDir)bin\ml.exe&quot; /c /Cp /Zi /Fo&quot;$(IntDir)\%(Filename).obj&quot; &quot;%(FullPath)&quot;</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)\%(Filename).obj</Outputs>
+ <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Compiling pointeroverride.asm</Message>
+ <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">&quot;$(VCInstallDir)bin\ml.exe&quot; /c /Cp /Zi /Fo&quot;$(IntDir)\%(Filename).obj&quot; &quot;%(FullPath)&quot;</Command>
+ <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)\%(Filename).obj</Outputs>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project>
diff --git a/mp/src/utils/vtfdiff/vtfdiff-2010.vcxproj.filters b/mp/src/utils/vtfdiff/vtfdiff-2010.vcxproj.filters
new file mode 100644
index 00000000..59996012
--- /dev/null
+++ b/mp/src/utils/vtfdiff/vtfdiff-2010.vcxproj.filters
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Link Libraries">
+ <UniqueIdentifier>{C5D73B3A-C648-896C-B7CE-F174808E5BA5}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{BA03E055-4FA2-FCE3-8A1C-D348547D379C}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <Library Include="..\..\lib\public\bitmap.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\mathlib.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\tier0.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\tier1.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\tier2.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\vstdlib.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ <Library Include="..\..\lib\public\vtf.lib">
+ <Filter>Link Libraries</Filter>
+ </Library>
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\..\public\tier0\memoverride.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="vtfdiff.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="..\..\public\tier0\pointeroverride.asm">
+ <Filter>Source Files</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ </ItemGroup>
+</Project>
diff --git a/mp/src/utils/vtfdiff/vtfdiff.cpp b/mp/src/utils/vtfdiff/vtfdiff.cpp
new file mode 100644
index 00000000..bee0d777
--- /dev/null
+++ b/mp/src/utils/vtfdiff/vtfdiff.cpp
@@ -0,0 +1,438 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//
+//=============================================================================//
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include "vtf/vtf.h"
+#include "tier1/UtlBuffer.h"
+#include "tier1/utlmap.h"
+#include "bitmap/imageformat.h"
+#include "mathlib/vector.h"
+#include <conio.h>
+
+void Usage( void )
+{
+ printf( "Usage: vtfdiff file1.vtf file2.vtf\n" );
+}
+
+bool LoadFileIntoBuffer( const char *pFileName, CUtlBuffer &buf )
+{
+ struct _stat statBuf;
+ if( _stat( pFileName, &statBuf ) != 0 )
+ {
+ goto error;
+ }
+
+ buf.EnsureCapacity( statBuf.st_size );
+ FILE *fp;
+ fp = fopen( pFileName, "rb" );
+ if( !fp )
+ {
+ goto error;
+ }
+
+ int nBytesRead = fread( buf.Base(), 1, statBuf.st_size, fp );
+ fclose( fp );
+
+ buf.SeekPut( CUtlBuffer::SEEK_HEAD, nBytesRead );
+ return true;
+
+error:
+ printf( "Can't find file %s\n", pFileName );
+ return false;
+}
+
+char const * ResourceToString( uint32 uiResType )
+{
+ static char chBuffer[256];
+
+ switch ( uiResType )
+ {
+ case VTF_LEGACY_RSRC_LOW_RES_IMAGE:
+ return "VTF_LEGACY_RSRC_LOW_RES_IMAGE";
+ case VTF_LEGACY_RSRC_IMAGE:
+ return "VTF_LEGACY_RSRC_IMAGE";
+ case VTF_RSRC_SHEET:
+ return "VTF_RSRC_SHEET";
+ case MK_VTF_RSRC_ID( 'C','R','C' ):
+ return "CRC";
+ case VTF_RSRC_TEXTURE_LOD_SETTINGS:
+ return "VTF_RSRC_TEXTURE_LOD_SETTINGS";
+
+ default:
+ sprintf( chBuffer, "0x%08X", uiResType );
+ return chBuffer;
+ }
+
+ return chBuffer;
+}
+
+void PrintFlags( int flags )
+{
+#define PRNFLAG( flagname ) \
+ if ( ( flags & (flagname) ) == (flagname) ) \
+ { \
+ flags &=~ (flagname); \
+ printf( "%s%s", #flagname + strlen("TEXTUREFLAGS_"), flags ? "|" : "" ); \
+ } \
+
+
+ PRNFLAG( TEXTUREFLAGS_POINTSAMPLE )
+ PRNFLAG( TEXTUREFLAGS_TRILINEAR )
+ PRNFLAG( TEXTUREFLAGS_CLAMPS )
+ PRNFLAG( TEXTUREFLAGS_CLAMPT )
+ PRNFLAG( TEXTUREFLAGS_ANISOTROPIC )
+ PRNFLAG( TEXTUREFLAGS_HINT_DXT5 )
+ PRNFLAG( TEXTUREFLAGS_SRGB )
+ PRNFLAG( TEXTUREFLAGS_NORMAL )
+ PRNFLAG( TEXTUREFLAGS_NOMIP )
+ PRNFLAG( TEXTUREFLAGS_NOLOD )
+ PRNFLAG( TEXTUREFLAGS_ALL_MIPS )
+ PRNFLAG( TEXTUREFLAGS_PROCEDURAL )
+ PRNFLAG( TEXTUREFLAGS_ONEBITALPHA )
+ PRNFLAG( TEXTUREFLAGS_EIGHTBITALPHA )
+ PRNFLAG( TEXTUREFLAGS_ENVMAP )
+ PRNFLAG( TEXTUREFLAGS_RENDERTARGET )
+ PRNFLAG( TEXTUREFLAGS_DEPTHRENDERTARGET )
+ PRNFLAG( TEXTUREFLAGS_NODEBUGOVERRIDE )
+ PRNFLAG( TEXTUREFLAGS_SINGLECOPY )
+ PRNFLAG( TEXTUREFLAGS_UNUSED_00080000 )
+ PRNFLAG( TEXTUREFLAGS_UNUSED_00100000 )
+ PRNFLAG( TEXTUREFLAGS_UNUSED_00200000 )
+ PRNFLAG( TEXTUREFLAGS_UNUSED_00400000 )
+ PRNFLAG( TEXTUREFLAGS_NODEPTHBUFFER )
+ PRNFLAG( TEXTUREFLAGS_UNUSED_01000000 )
+ PRNFLAG( TEXTUREFLAGS_CLAMPU )
+ PRNFLAG( TEXTUREFLAGS_VERTEXTEXTURE )
+ PRNFLAG( TEXTUREFLAGS_SSBUMP )
+ PRNFLAG( TEXTUREFLAGS_UNUSED_10000000 )
+ PRNFLAG( TEXTUREFLAGS_BORDER )
+ PRNFLAG( TEXTUREFLAGS_UNUSED_40000000 )
+ PRNFLAG( TEXTUREFLAGS_UNUSED_80000000 )
+
+#undef PRNFLAG
+
+ if ( flags )
+ {
+ printf( "0x%08X", flags );
+ }
+}
+
+int main( int argc, char **argv )
+{
+ if( argc != 3 )
+ {
+ Usage();
+ return 10;
+ }
+
+ CUtlBuffer file1;
+ CUtlBuffer file2;
+
+ if ( !LoadFileIntoBuffer( argv[1], file1 ) )
+ return 21;
+ if ( !LoadFileIntoBuffer( argv[2], file2 ) )
+ return 22;
+
+ IVTFTexture *pTexture1 = CreateVTFTexture();
+ IVTFTexture *pTexture2 = CreateVTFTexture();
+
+ IVTFTexture *arrTextures[2] = { pTexture1, pTexture2 };
+
+ bool bMatch = true;
+
+ if( !pTexture1->Unserialize( file1 ) )
+ {
+ printf( "error loading %s\n", argv[1] );
+ return 31;
+ }
+ if( !pTexture2->Unserialize( file2 ) )
+ {
+ printf( "error loading %s\n", argv[2] );
+ return 32;
+ }
+
+ if( pTexture1->Width() != pTexture2->Width() ||
+ pTexture1->Height() != pTexture2->Height() ||
+ pTexture1->Depth() != pTexture2->Depth() )
+ {
+ printf( "%s dimensions differ: %dx%dx%d != %dx%dx%d\n",
+ argv[1],
+ ( int )pTexture1->Width(), ( int )pTexture1->Height(), ( int )pTexture1->Depth(),
+ ( int )pTexture2->Width(), ( int )pTexture2->Height(), ( int )pTexture2->Depth() );
+ bMatch = false;
+ }
+
+ if( pTexture1->LowResWidth() != pTexture2->LowResWidth() ||
+ pTexture1->LowResHeight() != pTexture2->LowResHeight() )
+ {
+ printf( "%s lowres dimensions differ: %dx%d != %dx%d\n",
+ argv[1],
+ ( int )pTexture1->LowResWidth(), ( int )pTexture1->LowResHeight(),
+ ( int )pTexture2->LowResWidth(), ( int )pTexture2->LowResHeight() );
+ bMatch = false;
+ }
+
+ if( pTexture1->MipCount() != pTexture2->MipCount() )
+ {
+ printf( "%s differing mipcounts: %d != %d\n",
+ argv[1],
+ ( int )pTexture1->MipCount(), ( int )pTexture2->MipCount() );
+ bMatch = false;
+ }
+
+ if( pTexture1->FaceCount() != pTexture2->FaceCount() )
+ {
+ printf( "%s differing facecount: %d != %d\n",
+ argv[1],
+ ( int )pTexture1->FaceCount(), ( int )pTexture2->FaceCount() );
+ bMatch = false;
+ }
+
+ if( pTexture1->FrameCount() != pTexture2->FrameCount() )
+ {
+ printf( "%s differing framecount: %d != %d\n",
+ argv[1],
+ ( int )pTexture1->FrameCount(), ( int )pTexture2->FrameCount() );
+ bMatch = false;
+ }
+
+ if( pTexture1->Flags() != pTexture2->Flags() )
+ {
+ printf( "%s differing flags: \"",
+ argv[1] );
+ PrintFlags( pTexture1->Flags() );
+ printf( "\" != \"" );
+ PrintFlags( pTexture2->Flags() );
+ printf( "\"\n" );
+ bMatch = false;
+ }
+
+ if( pTexture1->BumpScale() != pTexture2->BumpScale() )
+ {
+ printf( "%s differing bumpscale: %f != %f\n",
+ argv[1],
+ ( float )pTexture1->BumpScale(), ( float )pTexture2->BumpScale() );
+ bMatch = false;
+ }
+
+ if( pTexture1->Format() != pTexture2->Format() )
+ {
+ printf( "%s differing image format: %s != %s\n",
+ argv[1],
+ ImageLoader::GetName( pTexture1->Format() ),
+ ImageLoader::GetName( pTexture2->Format() ) );
+ bMatch = false;
+ }
+
+ if( pTexture1->LowResFormat() != pTexture2->LowResFormat() )
+ {
+ Assert(0);
+ printf( "%s differing lowres image format: %s != %s\n",
+ argv[1],
+ ImageLoader::GetName( pTexture1->LowResFormat() ),
+ ImageLoader::GetName( pTexture2->LowResFormat() ) );
+ bMatch = false;
+ }
+
+ const Vector &vReflectivity1 = pTexture1->Reflectivity();
+ const Vector &vReflectivity2 = pTexture2->Reflectivity();
+ if( !VectorsAreEqual( vReflectivity1, vReflectivity2, 0.0001f ) )
+ {
+ printf( "%s differing reflectivity: [%f,%f,%f] != [%f,%f,%f]\n",
+ argv[1],
+ ( float )pTexture1->Reflectivity()[0],
+ ( float )pTexture1->Reflectivity()[1],
+ ( float )pTexture1->Reflectivity()[2],
+ ( float )pTexture2->Reflectivity()[0],
+ ( float )pTexture2->Reflectivity()[1],
+ ( float )pTexture2->Reflectivity()[2] );
+ bMatch = false;
+ }
+
+ if ( pTexture1->ComputeTotalSize() != pTexture2->ComputeTotalSize() )
+ {
+ printf( "%s differing image data size: %d != %d\n",
+ argv[1],
+ ( int )pTexture1->ComputeTotalSize(), ( int )pTexture2->ComputeTotalSize() );
+ bMatch = false;
+ }
+
+ if ( bMatch )
+ {
+ unsigned char const *pData1 = pTexture1->ImageData();
+ unsigned char const *pData2 = pTexture2->ImageData();
+
+ int const iSize = pTexture1->ComputeTotalSize();
+
+ if( memcmp( pData1, pData2, iSize) != 0 )
+ {
+ printf( "%s image data different\n", argv[1] );
+
+ if (( pTexture1->Format() == IMAGE_FORMAT_DXT1 ) || ( pTexture1->Format() == IMAGE_FORMAT_DXT3 ) ||
+ ( pTexture1->Format() == IMAGE_FORMAT_DXT5 ) || ( pTexture1->Format() == IMAGE_FORMAT_ATI2N ) ||
+ ( pTexture1->Format() == IMAGE_FORMAT_ATI1N ) )
+ {
+ int i, numOffsetsComplained = 0;
+ for( i = 0; i < iSize; i++ )
+ {
+ if( pData1[i] != pData2[i] )
+ {
+ printf( "image data at offset %d different\n", i );
+ if ( numOffsetsComplained ++ > 10 )
+ {
+ printf( "image data significantly differs!\n" );
+ break;
+ }
+ }
+ }
+ }
+ else
+ {
+ for( int iFrame = 0; iFrame < pTexture1->FrameCount(); ++iFrame )
+ {
+ for ( int iMipLevel = 0; iMipLevel < pTexture1->MipCount(); ++iMipLevel )
+ {
+ int nMipWidth, nMipHeight, nMipDepth;
+ pTexture1->ComputeMipLevelDimensions( iMipLevel, &nMipWidth, &nMipHeight, &nMipDepth );
+
+ for (int iCubeFace = 0; iCubeFace < pTexture1->FrameCount(); ++iCubeFace)
+ {
+ for ( int z = 0; z < nMipDepth; ++z )
+ {
+ pData1 = pTexture1->ImageData( iFrame, iCubeFace, iMipLevel, 0, 0, z );
+ pData2 = pTexture2->ImageData( iFrame, iCubeFace, iMipLevel, 0, 0, z );
+
+ int nMipSize = pTexture1->ComputeMipSize( iMipLevel );
+ if ( memcmp( pData1, pData2, nMipSize ) )
+ {
+ bool bBreak = false;
+
+ for ( int y = 0; y < nMipHeight; ++y )
+ {
+ for ( int x = 0; x < nMipWidth; ++x )
+ {
+ unsigned char const *pData1a = pTexture1->ImageData( iFrame, iCubeFace, iMipLevel, x, y, z );
+ unsigned char const *pData2a = pTexture2->ImageData( iFrame, iCubeFace, iMipLevel, x, y, z );
+
+ if ( memcmp( pData1a, pData2a, ImageLoader::SizeInBytes( pTexture1->Format() ) ) )
+ {
+ printf( "Frame %d Mip level %d Face %d Z-slice %d texel (%d,%d) different!\n",
+ iFrame, iMipLevel, iCubeFace, z, x, y );
+ bBreak = true;
+ break;
+ }
+ }
+
+ if ( bBreak )
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ bMatch = false;
+ }
+ }
+
+ // Lowres data
+ {
+ int iDummy, iSize1, iSize2;
+ pTexture1->LowResFileInfo( &iDummy, &iSize1 );
+ pTexture2->LowResFileInfo( &iDummy, &iSize2 );
+
+ if ( iSize1 != iSize2 )
+ {
+ printf( "%s differing low res image data size: %d != %d\n", argv[1], iSize1, iSize2 );
+ bMatch = false;
+ }
+
+ if ( bMatch )
+ {
+ if ( memcmp( pTexture1->LowResImageData(), pTexture2->LowResImageData(), iSize1 ) != 0 )
+ {
+ printf( "%s differing low res image data\n",
+ argv[1] );
+ bMatch = false;
+ }
+ }
+ }
+
+ // Check other resources
+ {
+ int numRes1 = pTexture1->GetResourceTypes( NULL, 0 );
+ int numRes2 = pTexture2->GetResourceTypes( NULL, 0 );
+
+ // List of resource types checked or insignificant diffs
+ typedef CUtlMap< int, bool > MapResTypes;
+ MapResTypes mapTypes( DefLessFunc( int ) );
+ mapTypes.Insert( VTF_LEGACY_RSRC_LOW_RES_IMAGE, true );
+ mapTypes.Insert( VTF_LEGACY_RSRC_IMAGE, true );
+ mapTypes.Insert( MK_VTF_RSRC_ID( 'C','R','C' ), true );
+
+ uint32 *puiresbuffer = ( uint32 * ) stackalloc( ( numRes1 + numRes2 ) * sizeof( uint32 ) );
+
+ int arrNums[2] = { numRes1, numRes2 };
+
+ for ( int itx = 0; itx < 2; ++ itx )
+ {
+ arrTextures[itx]->GetResourceTypes( puiresbuffer, arrNums[itx] );
+ while ( arrNums[itx] --> 0 )
+ {
+ uint32 uiResType = puiresbuffer[ arrNums[itx] ];
+ if ( mapTypes.Find( uiResType ) != mapTypes.InvalidIndex() )
+ continue;
+
+ mapTypes.Insert( uiResType, true );
+
+ size_t numBytes1, numBytes2;
+ void const *pvResData1 = pTexture1->GetResourceData( uiResType, &numBytes1 );
+ void const *pvResData2 = pTexture2->GetResourceData( uiResType, &numBytes2 );
+
+ if ( !pvResData1 != !pvResData2 )
+ {
+ printf( "%s different resource %s %s\n",
+ argv[1],
+ ResourceToString( uiResType ),
+ pvResData1 ? "present" : "missing" );
+ bMatch = false;
+ }
+ else if ( numBytes1 != numBytes2 )
+ {
+ printf( "%s different resource %s size %lld != %lld\n",
+ argv[1],
+ ResourceToString( uiResType ),
+ (long long)numBytes1, (long long)numBytes2 );
+ bMatch = false;
+ }
+ else if ( memcmp( pvResData1, pvResData2, numBytes1 ) != 0 )
+ {
+ printf( "%s different resource %s data\n",
+ argv[1],
+ ResourceToString( uiResType ) );
+ bMatch = false;
+ }
+ }
+ }
+ }
+
+
+
+ if( bMatch )
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+}