initial
This commit is contained in:
58
tools/vmt/_vpc_/manifest_vmt/win32/manifest.txt
Normal file
58
tools/vmt/_vpc_/manifest_vmt/win32/manifest.txt
Normal file
@@ -0,0 +1,58 @@
|
||||
// ----------------------------------------- //
|
||||
// File generated by VPC //
|
||||
// ----------------------------------------- //
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\common\debug_dll_check.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\common\debug_dll_check.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\common\debug_dll_check.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\public\interpolatortypes.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\public\interpolatortypes.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\public\interpolatortypes.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\public\tier0\memoverride.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\public\movieobjects\movieobjects.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\public\movieobjects\movieobjects.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\public\movieobjects\movieobjects.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\public\registry.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\public\registry.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\public\registry.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\public\sentence.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\public\sentence.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\public\sentence.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\public\vgui_controls\vgui_controls.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\public\vgui_controls\vgui_controls.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\public\vgui_controls\vgui_controls.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\tools\vmt\vmtdoc.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\tools\vmt\vmtdoc.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\tools\vmt\vmtdoc.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
Source file: F:\csgo_64\cstrike15_src\tools\vmt\vmttool.cpp
|
||||
Debug output file: F:\csgo_64\cstrike15_src\tools\vmt\vmttool.cpp
|
||||
Release output file: F:\csgo_64\cstrike15_src\tools\vmt\vmttool.cpp
|
||||
Containing unity file:
|
||||
PCH file:
|
||||
|
||||
62
tools/vmt/vmt.vpc
Normal file
62
tools/vmt/vmt.vpc
Normal file
@@ -0,0 +1,62 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
// VMT.VPC
|
||||
//
|
||||
// Project Script
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
$Macro SRCDIR "..\.."
|
||||
$Macro OUTBINDIR "$SRCDIR\..\game\bin\tools"
|
||||
|
||||
$Include "$SRCDIR\vpc_scripts\source_dll_win32_base.vpc"
|
||||
|
||||
$Configuration
|
||||
{
|
||||
$Compiler
|
||||
{
|
||||
$AdditionalIncludeDirectories "$BASE,../common"
|
||||
}
|
||||
|
||||
$Linker
|
||||
{
|
||||
$AdditionalDependencies "$BASE Psapi.lib"
|
||||
}
|
||||
}
|
||||
|
||||
$Project "Vmt"
|
||||
{
|
||||
$Folder "Source Files"
|
||||
{
|
||||
$File "$SRCDIR\public\interpolatortypes.cpp"
|
||||
$File "$SRCDIR\public\movieobjects\movieobjects.cpp"
|
||||
$File "$SRCDIR\public\registry.cpp"
|
||||
$File "$SRCDIR\public\vgui_controls\vgui_controls.cpp"
|
||||
$File "$SRCDIR\public\sentence.cpp"
|
||||
$File "vmtdoc.cpp"
|
||||
$File "vmttool.cpp"
|
||||
}
|
||||
|
||||
$Folder "Header Files"
|
||||
{
|
||||
$File "$SRCDIR\public\interpolatortypes.h"
|
||||
$File "vmtdoc.h"
|
||||
$File "vmttool.h"
|
||||
}
|
||||
|
||||
$Folder "Link Libraries"
|
||||
{
|
||||
$File "$SRCDIR\lib\public\bitmap.lib"
|
||||
$File "$SRCDIR\lib\public\bonesetup.lib"
|
||||
$File "$SRCDIR\lib\public\datamodel.lib"
|
||||
$File "$SRCDIR\lib\public\dmxloader.lib"
|
||||
$File "$SRCDIR\lib\public\dme_controls.lib"
|
||||
$File "$SRCDIR\lib\public\dmserializers.lib"
|
||||
$File "$SRCDIR\lib\public\mathlib.lib"
|
||||
$File "$SRCDIR\lib\public\matsys_controls.lib"
|
||||
$File "$SRCDIR\lib\public\movieobjects.lib"
|
||||
$File "$SRCDIR\lib\public\particles.lib"
|
||||
$File "$SRCDIR\lib\public\tier2.lib"
|
||||
$File "$SRCDIR\lib\public\tier3.lib"
|
||||
$File "$SRCDIR\lib\public\toolutils.lib"
|
||||
$File "$SRCDIR\lib\public\vgui_controls.lib"
|
||||
}
|
||||
}
|
||||
13
tools/vmt/vmt.vpc.vpc_cache
Normal file
13
tools/vmt/vmt.vpc.vpc_cache
Normal file
@@ -0,0 +1,13 @@
|
||||
"vpc_cache"
|
||||
{
|
||||
"CacheVersion" "1"
|
||||
"win32"
|
||||
{
|
||||
"CRCFile" "vmt.vcxproj.vpc_crc"
|
||||
"OutputFiles"
|
||||
{
|
||||
"0" "vmt.vcxproj"
|
||||
"1" "vmt.vcxproj.filters"
|
||||
}
|
||||
}
|
||||
}
|
||||
1084
tools/vmt/vmtdoc.cpp
Normal file
1084
tools/vmt/vmtdoc.cpp
Normal file
File diff suppressed because it is too large
Load Diff
133
tools/vmt/vmtdoc.h
Normal file
133
tools/vmt/vmtdoc.h
Normal file
@@ -0,0 +1,133 @@
|
||||
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======//
|
||||
//
|
||||
// Purpose:
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//
|
||||
//===========================================================================//
|
||||
|
||||
#ifndef VMTDOC_H
|
||||
#define VMTDOC_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
#include "dme_controls/inotifyui.h"
|
||||
#include "datamodel/dmehandle.h"
|
||||
#include "materialsystem/materialsystemutil.h"
|
||||
#include "tier1/utlstring.h"
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Forward declarations
|
||||
//-----------------------------------------------------------------------------
|
||||
class IVMTDocCallback;
|
||||
class IShader;
|
||||
enum ShaderParamType_t;
|
||||
class IMaterial;
|
||||
class IShader;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Contains all editable state
|
||||
//-----------------------------------------------------------------------------
|
||||
class CVMTDoc : public IDmNotify
|
||||
{
|
||||
public:
|
||||
CVMTDoc( IVMTDocCallback *pCallback );
|
||||
~CVMTDoc();
|
||||
|
||||
// Inherited from INotifyUI
|
||||
virtual void NotifyDataChanged( const char *pReason, int nNotifySource, int nNotifyFlags );
|
||||
|
||||
// Sets/Gets the file name
|
||||
const char *GetFileName();
|
||||
void SetFileName( const char *pFileName );
|
||||
|
||||
// Dirty bits (has it changed since the last time it was saved?)
|
||||
void SetDirty( bool bDirty );
|
||||
bool IsDirty() const;
|
||||
|
||||
// Creates a new act busy list
|
||||
void CreateNew();
|
||||
|
||||
// Saves/loads from file
|
||||
bool LoadFromFile( const char *pFileName );
|
||||
bool SaveToFile( );
|
||||
|
||||
// Returns the root object
|
||||
CDmElement *GetRootObject();
|
||||
|
||||
// Called when data changes (see INotifyUI for flags)
|
||||
void OnDataChanged( const char *pReason, int nNotifySource, int nNotifyFlags );
|
||||
|
||||
// Sets the shader in the material
|
||||
void SetShader( const char *pShaderName );
|
||||
|
||||
// Gets the preview material
|
||||
IMaterial *GetPreviewMaterial();
|
||||
|
||||
// Sets shader parameters to the default for that shader
|
||||
void SetParamsToDefault();
|
||||
|
||||
private:
|
||||
// Creates the root element
|
||||
bool CreateRootElement();
|
||||
|
||||
// Add attribute for shader parameter
|
||||
CDmAttribute* AddAttributeForShaderParameter( CDmElement *pMaterial, const char *pParamName, ShaderParamType_t paramType );
|
||||
|
||||
// Add a single shader parameter if it doesn't exist
|
||||
void AddNewShaderParam( CDmElement *pMaterial, const char *pParamName, ShaderParamType_t paramType, const char *pValue );
|
||||
|
||||
// Add all shader parameters that don't currently exist
|
||||
void AddNewShaderParams( CDmElement *pMaterial, IShader *pShader );
|
||||
|
||||
// Is this attribute a shader parameter?
|
||||
bool IsShaderParam( CDmAttribute* pAttribute );
|
||||
|
||||
// Remove all shader parameters that don't exist in the new shader
|
||||
void RemoveUnusedShaderParams( CDmElement *pMaterial, IShader *pShader, IShader *pOldShader );
|
||||
|
||||
// Remove all shader parameters
|
||||
void RemoveAllShaderParams( CDmElement *pMaterial );
|
||||
|
||||
// Finds a shader
|
||||
IShader *FindShader( const char *pShaderName );
|
||||
|
||||
// Updates the preview material
|
||||
void UpdatePreviewMaterial();
|
||||
|
||||
// Copies VMT parameters into the root
|
||||
void CopyParamsFromVMT( CDmElement *pVMT );
|
||||
|
||||
// A couple methods to set param values from strings (OLD METHOD!)
|
||||
bool SetVMatrixParamValue( CDmAttribute *pAttribute, const char *pValue );
|
||||
bool SetVector2DParamValue( CDmAttribute *pAttribute, const char *pValue );
|
||||
bool SetVector3DParamValue( CDmAttribute *pAttribute, const char *pValue );
|
||||
bool SetVector4DParamValue( CDmAttribute *pAttribute, const char *pValue );
|
||||
bool SetColorParamValue( CDmAttribute *pAttribute, const char *pValue );
|
||||
|
||||
// Sets an attribute value from the shader param default
|
||||
void SetAttributeValueFromDefault( CDmElement *pMaterial, CDmAttribute *pAttribute, const char *pValue );
|
||||
|
||||
// Hooks the preview to an existing material, if there is one
|
||||
void SetupPreviewMaterial( );
|
||||
|
||||
// Prior to saving to disk, extract all shader parameters which == the default
|
||||
CDmElement* ExtractDefaultParameters( );
|
||||
|
||||
IVMTDocCallback *m_pCallback;
|
||||
CMaterialReference m_pScratchMaterial;
|
||||
CMaterialReference m_pPreviewMaterial;
|
||||
CDmeHandle< CDmElement > m_hRoot;
|
||||
CUtlString m_CurrentShader;
|
||||
IShader *m_pCurrentIShader;
|
||||
char m_pFileName[512];
|
||||
bool m_bDirty;
|
||||
};
|
||||
|
||||
|
||||
#endif // VMTDOC_H
|
||||
1349
tools/vmt/vmttool.cpp
Normal file
1349
tools/vmt/vmttool.cpp
Normal file
File diff suppressed because it is too large
Load Diff
50
tools/vmt/vmttool.h
Normal file
50
tools/vmt/vmttool.h
Normal file
@@ -0,0 +1,50 @@
|
||||
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======
|
||||
//
|
||||
// Purpose: VMT tool; main UI smarts class
|
||||
//
|
||||
//=============================================================================
|
||||
|
||||
#ifndef VMTTOOL_H
|
||||
#define VMTTOOL_H
|
||||
|
||||
#ifdef _WIN32
|
||||
#pragma once
|
||||
#endif
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Forward declarations
|
||||
//-----------------------------------------------------------------------------
|
||||
class CDmeEditorTypeDictionary;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Singleton interfaces
|
||||
//-----------------------------------------------------------------------------
|
||||
extern CDmeEditorTypeDictionary *g_pEditorTypeDict;
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Allows the doc to call back into the VMT editor tool
|
||||
//-----------------------------------------------------------------------------
|
||||
class IVMTDocCallback
|
||||
{
|
||||
public:
|
||||
// Called by the doc when the data changes
|
||||
virtual void OnDocChanged( const char *pReason, int nNotifySource, int nNotifyFlags ) = 0;
|
||||
|
||||
// Update the editor dict based on the current material parameters
|
||||
virtual void AddShaderParameter( const char *pParam, const char *pWidget, const char *pTextType ) = 0;
|
||||
|
||||
// Update the editor dict based on the current material parameters
|
||||
virtual void RemoveShaderParameter( const char *pParam ) = 0;
|
||||
|
||||
// Adds flags, tool parameters
|
||||
virtual void AddFlagParameter( const char *pParam ) = 0;
|
||||
virtual void AddToolParameter( const char *pParam, const char *pWidget = NULL, const char *pTextType = NULL ) = 0;
|
||||
virtual void RemoveAllFlagParameters() = 0;
|
||||
virtual void RemoveAllToolParameters() = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // VMTTOOL_H
|
||||
Reference in New Issue
Block a user