First version of the SOurce SDK 2013
This commit is contained in:
261
mp/src/utils/vtf2tga/vtf2tga-2010.vcxproj
Normal file
261
mp/src/utils/vtf2tga/vtf2tga-2010.vcxproj
Normal file
@@ -0,0 +1,261 @@
|
||||
<?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>Vtf2tga</ProjectName>
|
||||
<ProjectGuid>{6B017447-F682-A137-8DF4-4608281F2C9F}</ProjectGuid>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<TargetName>vtf2tga</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<TargetName>vtf2tga</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 "delims=" %%A in ('attrib "..\..\..\game\bin\$(TargetFileName)"') do set valveTmpIsReadOnly="%%A"
set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%
if "%valveTmpIsReadOnlyLetter%"=="R" del /q "$(TargetDir)"$(TargetFileName)
if exist ..\..\devtools\bin\vpc.exe ..\..\devtools\bin\vpc.exe -crc2 vtf2tga.vcxproj
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\vtf2tga;_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)\vtf2tga.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)/vtf2tga.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<PostBuildEvent>
|
||||
<Message>Publishing to ..\..\..\game\bin</Message>
|
||||
<Command>if not exist "..\..\..\game\bin" mkdir "..\..\..\game\bin"
copy "$(TargetDir)"$(TargetFileName) ..\..\..\game\bin\$(TargetFileName)
if ERRORLEVEL 1 goto BuildEventFailed
if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map ..\..\..\game\bin\$(TargetName).map
copy "$(TargetDir)"$(TargetName).pdb ..\..\..\game\bin\$(TargetName).pdb
if ERRORLEVEL 1 goto BuildEventFailed
goto BuildEventOK
:BuildEventFailed
echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***
del /q "$(TargetDir)"$(TargetFileName)
exit 1
:BuildEventOK
</Command>
|
||||
</PostBuildEvent>
|
||||
<CustomBuildStep>
|
||||
</CustomBuildStep>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<PreBuildEvent>
|
||||
<Command>if EXIST ..\..\..\game\bin\$(TargetFileName) for /f "delims=" %%A in ('attrib "..\..\..\game\bin\$(TargetFileName)"') do set valveTmpIsReadOnly="%%A"
set valveTmpIsReadOnlyLetter=%valveTmpIsReadOnly:~6,1%
if "%valveTmpIsReadOnlyLetter%"=="R" del /q "$(TargetDir)"$(TargetFileName)
if exist ..\..\devtools\bin\vpc.exe ..\..\devtools\bin\vpc.exe -crc2 vtf2tga.vcxproj
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\vtf2tga;_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)\vtf2tga.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)/vtf2tga.bsc</OutputFile>
|
||||
</Bscmake>
|
||||
<PostBuildEvent>
|
||||
<Message>Publishing to ..\..\..\game\bin</Message>
|
||||
<Command>if not exist "..\..\..\game\bin" mkdir "..\..\..\game\bin"
copy "$(TargetDir)"$(TargetFileName) ..\..\..\game\bin\$(TargetFileName)
if ERRORLEVEL 1 goto BuildEventFailed
if exist "$(TargetDir)"$(TargetName).map copy "$(TargetDir)"$(TargetName).map ..\..\..\game\bin\$(TargetName).map
copy "$(TargetDir)"$(TargetName).pdb ..\..\..\game\bin\$(TargetName).pdb
if ERRORLEVEL 1 goto BuildEventFailed
goto BuildEventOK
:BuildEventFailed
echo *** ERROR! PostBuildStep FAILED for $(ProjectName)! EXE or DLL is probably running. ***
del /q "$(TargetDir)"$(TargetFileName)
exit 1
:BuildEventOK
</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>
|
||||
<ClInclude Include="..\..\public\mathlib\amd3dx.h" />
|
||||
<ClInclude Include="..\..\public\tier0\basetypes.h" />
|
||||
<ClInclude Include="..\..\public\tier0\commonmacros.h" />
|
||||
<ClInclude Include="..\..\public\tier0\dbg.h" />
|
||||
<ClInclude Include="..\..\public\tier0\fasttimer.h" />
|
||||
<ClInclude Include="..\..\public\mathlib\mathlib.h" />
|
||||
<ClInclude Include="..\..\public\tier0\memdbgon.h" />
|
||||
<ClInclude Include="..\..\public\tier0\platform.h" />
|
||||
<ClInclude Include="..\..\public\tier0\protected_things.h" />
|
||||
<ClInclude Include="..\..\public\string_t.h" />
|
||||
<ClInclude Include="..\..\public\tier1\strtools.h" />
|
||||
<ClInclude Include="..\..\public\tier1\utlbuffer.h" />
|
||||
<ClInclude Include="..\..\public\tier1\utlmemory.h" />
|
||||
<ClInclude Include="..\..\public\mathlib\vector.h" />
|
||||
<ClInclude Include="..\..\public\mathlib\vector2d.h" />
|
||||
<ClInclude Include="..\..\public\vstdlib\vstdlib.h" />
|
||||
<ClInclude Include="..\..\public\vtf\vtf.h" />
|
||||
</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="vtf2tga.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'">"$(VCInstallDir)bin\ml.exe" /c /Cp /Zi /Fo"$(IntDir)\%(Filename).obj" "%(FullPath)"</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'">"$(VCInstallDir)bin\ml.exe" /c /Cp /Zi /Fo"$(IntDir)\%(Filename).obj" "%(FullPath)"</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>
|
||||
107
mp/src/utils/vtf2tga/vtf2tga-2010.vcxproj.filters
Normal file
107
mp/src/utils/vtf2tga/vtf2tga-2010.vcxproj.filters
Normal file
@@ -0,0 +1,107 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{1680C80B-FF1E-EA4D-9817-CC12254F2E40}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<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>
|
||||
<ClInclude Include="..\..\public\mathlib\amd3dx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier0\basetypes.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier0\commonmacros.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier0\dbg.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier0\fasttimer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\mathlib\mathlib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier0\memdbgon.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier0\platform.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier0\protected_things.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\string_t.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier1\strtools.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier1\utlbuffer.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\tier1\utlmemory.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\mathlib\vector.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\mathlib\vector2d.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\vstdlib\vstdlib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\public\vtf\vtf.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\public\tier0\memoverride.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="vtf2tga.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>
|
||||
316
mp/src/utils/vtf2tga/vtf2tga.cpp
Normal file
316
mp/src/utils/vtf2tga/vtf2tga.cpp
Normal file
@@ -0,0 +1,316 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#include <direct.h>
|
||||
#include "mathlib/mathlib.h"
|
||||
#include "bitmap/tgawriter.h"
|
||||
#include "tier1/strtools.h"
|
||||
#include "vtf/vtf.h"
|
||||
#include "tier1/UtlBuffer.h"
|
||||
#include "tier0/dbg.h"
|
||||
#include "tier0/icommandline.h"
|
||||
#include "tier1/utlbuffer.h"
|
||||
#include "tier2/tier2.h"
|
||||
#include "filesystem.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// HDRFIXME: move this somewhere else.
|
||||
//-----------------------------------------------------------------------------
|
||||
static void PFMWrite( float *pFloatImage, const char *pFilename, int width, int height )
|
||||
{
|
||||
FILE *fp;
|
||||
fp = fopen( pFilename, "wb" );
|
||||
fprintf( fp, "PF\n%d %d\n-1.000000\n", width, height );
|
||||
int i;
|
||||
for( i = height-1; i >= 0; i-- )
|
||||
{
|
||||
float *pRow = &pFloatImage[3 * width * i];
|
||||
fwrite( pRow, width * sizeof( float ) * 3, 1, fp );
|
||||
}
|
||||
fclose( fp );
|
||||
}
|
||||
|
||||
SpewRetval_t VTF2TGAOutputFunc( SpewType_t spewType, char const *pMsg )
|
||||
{
|
||||
printf( pMsg );
|
||||
fflush( stdout );
|
||||
|
||||
if (spewType == SPEW_ERROR)
|
||||
return SPEW_ABORT;
|
||||
return (spewType == SPEW_ASSERT) ? SPEW_DEBUGGER : SPEW_CONTINUE;
|
||||
}
|
||||
|
||||
static void Usage( void )
|
||||
{
|
||||
Error( "Usage: vtf2tga -i <input vtf> [-o <output tga>] [-mip]\n" );
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
int main( int argc, char **argv )
|
||||
{
|
||||
SpewOutputFunc( VTF2TGAOutputFunc );
|
||||
CommandLine()->CreateCmdLine( argc, argv );
|
||||
MathLib_Init( 2.2f, 2.2f, 0.0f, 1.0f, false, false, false, false );
|
||||
InitDefaultFileSystem();
|
||||
|
||||
const char *pVTFFileName = CommandLine()->ParmValue( "-i" );
|
||||
const char *pTGAFileName = CommandLine()->ParmValue( "-o" );
|
||||
bool bGenerateMipLevels = CommandLine()->CheckParm( "-mip" ) != NULL;
|
||||
if ( !pVTFFileName )
|
||||
{
|
||||
Usage();
|
||||
}
|
||||
|
||||
if ( !pTGAFileName )
|
||||
{
|
||||
pTGAFileName = pVTFFileName;
|
||||
}
|
||||
|
||||
char pCurrentDirectory[MAX_PATH];
|
||||
if ( _getcwd( pCurrentDirectory, sizeof(pCurrentDirectory) ) == NULL )
|
||||
{
|
||||
fprintf( stderr, "Unable to get the current directory\n" );
|
||||
return -1;
|
||||
}
|
||||
Q_StripTrailingSlash( pCurrentDirectory );
|
||||
|
||||
char pBuf[MAX_PATH];
|
||||
if ( !Q_IsAbsolutePath( pTGAFileName ) )
|
||||
{
|
||||
Q_snprintf( pBuf, sizeof(pBuf), "%s\\%s", pCurrentDirectory, pTGAFileName );
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_strncpy( pBuf, pTGAFileName, sizeof(pBuf) );
|
||||
}
|
||||
Q_FixSlashes( pBuf );
|
||||
|
||||
char pOutFileNameBase[MAX_PATH];
|
||||
Q_StripExtension( pBuf, pOutFileNameBase, MAX_PATH );
|
||||
|
||||
char pActualVTFFileName[MAX_PATH];
|
||||
Q_strncpy( pActualVTFFileName, pVTFFileName, MAX_PATH );
|
||||
if ( !Q_strstr( pActualVTFFileName, ".vtf" ) )
|
||||
{
|
||||
Q_strcat( pActualVTFFileName, ".vtf", MAX_PATH );
|
||||
}
|
||||
|
||||
FILE *vtfFp = fopen( pActualVTFFileName, "rb" );
|
||||
if( !vtfFp )
|
||||
{
|
||||
Error( "Can't open %s\n", pActualVTFFileName );
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
fseek( vtfFp, 0, SEEK_END );
|
||||
int srcVTFLength = ftell( vtfFp );
|
||||
fseek( vtfFp, 0, SEEK_SET );
|
||||
|
||||
CUtlBuffer buf;
|
||||
buf.EnsureCapacity( srcVTFLength );
|
||||
int nBytesRead = fread( buf.Base(), 1, srcVTFLength, vtfFp );
|
||||
fclose( vtfFp );
|
||||
buf.SeekPut( CUtlBuffer::SEEK_HEAD, nBytesRead );
|
||||
|
||||
IVTFTexture *pTex = CreateVTFTexture();
|
||||
if (!pTex->Unserialize( buf ))
|
||||
{
|
||||
Error( "*** Error reading in .VTF file %s\n", pActualVTFFileName );
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
Msg( "vtf width: %d\n", pTex->Width() );
|
||||
Msg( "vtf height: %d\n", pTex->Height() );
|
||||
Msg( "vtf numFrames: %d\n", pTex->FrameCount() );
|
||||
|
||||
Msg( "TEXTUREFLAGS_POINTSAMPLE=%s\n", ( pTex->Flags() & TEXTUREFLAGS_POINTSAMPLE ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_TRILINEAR=%s\n", ( pTex->Flags() & TEXTUREFLAGS_TRILINEAR ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_CLAMPS=%s\n", ( pTex->Flags() & TEXTUREFLAGS_CLAMPS ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_CLAMPT=%s\n", ( pTex->Flags() & TEXTUREFLAGS_CLAMPT ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_CLAMPU=%s\n", ( pTex->Flags() & TEXTUREFLAGS_CLAMPU ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_BORDER=%s\n", ( pTex->Flags() & TEXTUREFLAGS_BORDER ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_ANISOTROPIC=%s\n", ( pTex->Flags() & TEXTUREFLAGS_ANISOTROPIC ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_HINT_DXT5=%s\n", ( pTex->Flags() & TEXTUREFLAGS_HINT_DXT5 ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_SRGB=%s\n", ( pTex->Flags() & TEXTUREFLAGS_SRGB ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_NORMAL=%s\n", ( pTex->Flags() & TEXTUREFLAGS_NORMAL ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_NOMIP=%s\n", ( pTex->Flags() & TEXTUREFLAGS_NOMIP ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_NOLOD=%s\n", ( pTex->Flags() & TEXTUREFLAGS_NOLOD ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_ALL_MIPS=%s\n", ( pTex->Flags() & TEXTUREFLAGS_ALL_MIPS ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_PROCEDURAL=%s\n", ( pTex->Flags() & TEXTUREFLAGS_PROCEDURAL ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_ONEBITALPHA=%s\n", ( pTex->Flags() & TEXTUREFLAGS_ONEBITALPHA ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_EIGHTBITALPHA=%s\n", ( pTex->Flags() & TEXTUREFLAGS_EIGHTBITALPHA ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_ENVMAP=%s\n", ( pTex->Flags() & TEXTUREFLAGS_ENVMAP ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_RENDERTARGET=%s\n", ( pTex->Flags() & TEXTUREFLAGS_RENDERTARGET ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_DEPTHRENDERTARGET=%s\n", ( pTex->Flags() & TEXTUREFLAGS_DEPTHRENDERTARGET ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_NODEBUGOVERRIDE=%s\n", ( pTex->Flags() & TEXTUREFLAGS_NODEBUGOVERRIDE ) ? "true" : "false" );
|
||||
Msg( "TEXTUREFLAGS_SINGLECOPY=%s\n", ( pTex->Flags() & TEXTUREFLAGS_SINGLECOPY ) ? "true" : "false" );
|
||||
|
||||
Vector vecReflectivity = pTex->Reflectivity();
|
||||
Msg( "vtf reflectivity: %f %f %f\n", vecReflectivity[0], vecReflectivity[1], vecReflectivity[2] );
|
||||
Msg( "transparency: " );
|
||||
if( pTex->Flags() & TEXTUREFLAGS_EIGHTBITALPHA )
|
||||
{
|
||||
Msg( "eightbitalpha\n" );
|
||||
}
|
||||
else if( pTex->Flags() & TEXTUREFLAGS_ONEBITALPHA )
|
||||
{
|
||||
Msg( "onebitalpha\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
Msg( "noalpha\n" );
|
||||
}
|
||||
ImageFormat srcFormat = pTex->Format();
|
||||
Msg( "vtf format: %s\n", ImageLoader::GetName( srcFormat ) );
|
||||
|
||||
int iTGANameLen = Q_strlen( pOutFileNameBase );
|
||||
|
||||
int iFaceCount = pTex->FaceCount();
|
||||
int nFrameCount = pTex->FrameCount();
|
||||
bool bIsCubeMap = pTex->IsCubeMap();
|
||||
|
||||
int iLastMipLevel = bGenerateMipLevels ? pTex->MipCount() - 1 : 0;
|
||||
for( int iFrame = 0; iFrame < nFrameCount; ++iFrame )
|
||||
{
|
||||
for ( int iMipLevel = 0; iMipLevel <= iLastMipLevel; ++iMipLevel )
|
||||
{
|
||||
int iWidth, iHeight, iDepth;
|
||||
pTex->ComputeMipLevelDimensions( iMipLevel, &iWidth, &iHeight, &iDepth );
|
||||
|
||||
for (int iCubeFace = 0; iCubeFace < iFaceCount; ++iCubeFace)
|
||||
{
|
||||
for ( int z = 0; z < iDepth; ++z )
|
||||
{
|
||||
// Construct output filename
|
||||
char *pTempNameBuf = (char *)stackalloc( iTGANameLen + 13 );
|
||||
Q_strncpy( pTempNameBuf, pOutFileNameBase, iTGANameLen + 1 );
|
||||
char *pExt = Q_strrchr( pTempNameBuf, '.' );
|
||||
if ( pExt )
|
||||
{
|
||||
pExt = 0;
|
||||
}
|
||||
|
||||
if ( bIsCubeMap )
|
||||
{
|
||||
Assert( pTex->Depth() == 1 ); // shouldn't this be 1 instead of 0?
|
||||
static const char *pCubeFaceName[7] = { "rt", "lf", "bk", "ft", "up", "dn", "sph" };
|
||||
Q_strcat( pTempNameBuf, pCubeFaceName[iCubeFace], iTGANameLen + 13 );
|
||||
}
|
||||
|
||||
if ( nFrameCount > 1 )
|
||||
{
|
||||
char pTemp[4];
|
||||
Q_snprintf( pTemp, 4, "%03d", iFrame );
|
||||
Q_strcat( pTempNameBuf, pTemp, iTGANameLen + 13 );
|
||||
}
|
||||
|
||||
if ( iLastMipLevel != 0 )
|
||||
{
|
||||
char pTemp[8];
|
||||
Q_snprintf( pTemp, 8, "_mip%d", iMipLevel );
|
||||
Q_strcat( pTempNameBuf, pTemp, iTGANameLen + 13 );
|
||||
}
|
||||
|
||||
if ( pTex->Depth() > 1 )
|
||||
{
|
||||
char pTemp[6];
|
||||
Q_snprintf( pTemp, 6, "_z%03d", z );
|
||||
Q_strcat( pTempNameBuf, pTemp, iTGANameLen + 13 );
|
||||
}
|
||||
|
||||
if( srcFormat == IMAGE_FORMAT_RGBA16161616F )
|
||||
{
|
||||
Q_strcat( pTempNameBuf, ".pfm", iTGANameLen + 13 );
|
||||
}
|
||||
else
|
||||
{
|
||||
Q_strcat( pTempNameBuf, ".tga", iTGANameLen + 13 );
|
||||
}
|
||||
|
||||
unsigned char *pSrcImage = pTex->ImageData( iFrame, iCubeFace, iMipLevel, 0, 0, z );
|
||||
|
||||
ImageFormat dstFormat;
|
||||
if( srcFormat == IMAGE_FORMAT_RGBA16161616F )
|
||||
{
|
||||
dstFormat = IMAGE_FORMAT_RGB323232F;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( ImageLoader::IsTransparent( srcFormat ) || (srcFormat == IMAGE_FORMAT_ATI1N ) || (srcFormat == IMAGE_FORMAT_ATI2N ))
|
||||
{
|
||||
dstFormat = IMAGE_FORMAT_BGRA8888;
|
||||
}
|
||||
else
|
||||
{
|
||||
dstFormat = IMAGE_FORMAT_BGR888;
|
||||
}
|
||||
}
|
||||
// dstFormat = IMAGE_FORMAT_RGBA8888;
|
||||
// dstFormat = IMAGE_FORMAT_RGB888;
|
||||
// dstFormat = IMAGE_FORMAT_BGRA8888;
|
||||
// dstFormat = IMAGE_FORMAT_BGR888;
|
||||
// dstFormat = IMAGE_FORMAT_BGRA5551;
|
||||
// dstFormat = IMAGE_FORMAT_BGR565;
|
||||
// dstFormat = IMAGE_FORMAT_BGRA4444;
|
||||
// printf( "dstFormat: %s\n", ImageLoader::GetName( dstFormat ) );
|
||||
unsigned char *pDstImage = new unsigned char[ImageLoader::GetMemRequired( iWidth, iHeight, 1, dstFormat, false )];
|
||||
if( !ImageLoader::ConvertImageFormat( pSrcImage, srcFormat,
|
||||
pDstImage, dstFormat, iWidth, iHeight, 0, 0 ) )
|
||||
{
|
||||
Error( "Error converting from %s to %s\n",
|
||||
ImageLoader::GetName( srcFormat ), ImageLoader::GetName( dstFormat ) );
|
||||
exit( -1 );
|
||||
}
|
||||
|
||||
if( dstFormat != IMAGE_FORMAT_RGB323232F )
|
||||
{
|
||||
if( ImageLoader::IsTransparent( dstFormat ) && ( dstFormat != IMAGE_FORMAT_RGBA8888 ) )
|
||||
{
|
||||
unsigned char *tmpImage = pDstImage;
|
||||
pDstImage = new unsigned char[ImageLoader::GetMemRequired( iWidth, iHeight, 1, IMAGE_FORMAT_RGBA8888, false )];
|
||||
if( !ImageLoader::ConvertImageFormat( tmpImage, dstFormat, pDstImage, IMAGE_FORMAT_RGBA8888,
|
||||
iWidth, iHeight, 0, 0 ) )
|
||||
{
|
||||
Error( "Error converting from %s to %s\n",
|
||||
ImageLoader::GetName( dstFormat ), ImageLoader::GetName( IMAGE_FORMAT_RGBA8888 ) );
|
||||
}
|
||||
dstFormat = IMAGE_FORMAT_RGBA8888;
|
||||
}
|
||||
else if( !ImageLoader::IsTransparent( dstFormat ) && ( dstFormat != IMAGE_FORMAT_RGB888 ) )
|
||||
{
|
||||
unsigned char *tmpImage = pDstImage;
|
||||
pDstImage = new unsigned char[ImageLoader::GetMemRequired( iWidth, iHeight, 1, IMAGE_FORMAT_RGB888, false )];
|
||||
if( !ImageLoader::ConvertImageFormat( tmpImage, dstFormat, pDstImage, IMAGE_FORMAT_RGB888,
|
||||
iWidth, iHeight, 0, 0 ) )
|
||||
{
|
||||
Error( "Error converting from %s to %s\n",
|
||||
ImageLoader::GetName( dstFormat ), ImageLoader::GetName( IMAGE_FORMAT_RGB888 ) );
|
||||
}
|
||||
dstFormat = IMAGE_FORMAT_RGB888;
|
||||
}
|
||||
|
||||
CUtlBuffer outBuffer;
|
||||
TGAWriter::WriteToBuffer( pDstImage, outBuffer, iWidth, iHeight,
|
||||
dstFormat, dstFormat );
|
||||
if ( !g_pFullFileSystem->WriteFile( pTempNameBuf, NULL, outBuffer ) )
|
||||
{
|
||||
fprintf( stderr, "unable to write %s\n", pTempNameBuf );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
PFMWrite( ( float * )pDstImage, pTempNameBuf, iWidth, iHeight );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// leak leak leak leak leak, leak leak, leak leak (Blue Danube)
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user