From 403b060ef9a5db2b0082ed9075f4f17764e29554 Mon Sep 17 00:00:00 2001 From: Er2 Date: Thu, 11 May 2023 21:08:32 +0300 Subject: [PATCH] WIP studiomdl port --- movieobjects/dmeanimationset.cpp | 4 +- movieobjects/dmeclip.cpp | 6 +- movieobjects/dmefaceset.cpp | 4 +- movieobjects/dmekeyboardinput.cpp | 4 +- movieobjects/dmelog.cpp | 8 + movieobjects/dmemouseinput.cpp | 4 +- movieobjects/dmeparticlesystemdefinition.cpp | 6 +- movieobjects/wscript | 95 +++++ public/appframework/AppFramework.h | 12 +- public/movieobjects/dmeanimationset.h | 1 + public/movieobjects/dmeclip.h | 1 + public/movieobjects/dmelog.h | 8 +- public/movieobjects/dmetimeselection.h | 3 +- public/movieobjects/dmetrackgroup.h | 3 +- utils/studiomdl/bmpread.cpp | 98 ------ utils/studiomdl/dmxsupport.cpp | 3 +- utils/studiomdl/hardwarematrixstate.cpp | 9 +- utils/studiomdl/hardwarevertexcache.cpp | 2 +- utils/studiomdl/optimize.cpp | 13 +- utils/studiomdl/perfstats.cpp | 4 +- utils/studiomdl/studiomdl.cpp | 32 +- utils/studiomdl/studiomdl.h | 4 +- utils/studiomdl/tristrip.cpp | 350 ------------------- utils/studiomdl/write.cpp | 54 +-- utils/studiomdl/wscript | 93 +++++ waf | 2 +- wscript | 17 +- 27 files changed, 302 insertions(+), 538 deletions(-) create mode 100755 movieobjects/wscript delete mode 100644 utils/studiomdl/bmpread.cpp delete mode 100644 utils/studiomdl/tristrip.cpp create mode 100644 utils/studiomdl/wscript diff --git a/movieobjects/dmeanimationset.cpp b/movieobjects/dmeanimationset.cpp index 926de451..85487508 100644 --- a/movieobjects/dmeanimationset.cpp +++ b/movieobjects/dmeanimationset.cpp @@ -10,7 +10,7 @@ #include "datamodel/dmelementfactoryhelper.h" #include "datamodel/dmehandle.h" #include "phonemeconverter.h" -#include "tier1/utlstringmap.h" +#include "tier1/UtlStringMap.h" #include "tier2/tier2.h" #include "filesystem.h" #include "studio.h" @@ -602,7 +602,7 @@ bool CDmePresetGroup::ExportToTXT( const char *pFileName, CDmeAnimationSet *pAni #ifdef ALIGN4 #undef ALIGN4 #endif // #ifdef ALIGN4 -#define ALIGN4( a ) a = (byte *)((int)((byte *)a + 3) & ~ 3) +#define ALIGN4( a ) a = (byte *)((size_t)((byte *)a + 3) & ~ 3) //----------------------------------------------------------------------------- diff --git a/movieobjects/dmeclip.cpp b/movieobjects/dmeclip.cpp index b97c5cbf..2ce86665 100644 --- a/movieobjects/dmeclip.cpp +++ b/movieobjects/dmeclip.cpp @@ -1025,10 +1025,12 @@ void CDmeFilmClip::OnElementUnserialized( ) // Backward compat conversion // If this is an older file with an overlay attribute, strip it out into materialoverlay CDmAttribute *pOverlayAttribute = GetAttribute( "overlay" ); + CDmAttribute *pOverlayAlphaAttribute; + const char *pName; if ( !pOverlayAttribute ) goto cleanUp; - const char *pName = pOverlayAttribute->GetValueString(); + pName = pOverlayAttribute->GetValueString(); if ( !pName || !pName[0] ) goto cleanUp; @@ -1041,7 +1043,7 @@ void CDmeFilmClip::OnElementUnserialized( ) m_MaterialOverlayEffect->SetOverlayEffect( pName ); // If this is an older file with an overlayalpha attribute, strip it out into materialoverlay - CDmAttribute *pOverlayAlphaAttribute = GetAttribute( "overlayalpha" ); + pOverlayAlphaAttribute = GetAttribute( "overlayalpha" ); if ( pOverlayAlphaAttribute ) { float alpha = pOverlayAlphaAttribute->GetValue(); diff --git a/movieobjects/dmefaceset.cpp b/movieobjects/dmefaceset.cpp index 5fecdfd7..a8aba03c 100644 --- a/movieobjects/dmefaceset.cpp +++ b/movieobjects/dmefaceset.cpp @@ -6,7 +6,7 @@ #include "movieobjects/dmefaceset.h" #include "movieobjects/dmematerial.h" #include "tier0/dbg.h" -#include "UtlBuffer.h" +#include "utlbuffer.h" #include "datamodel/dmelementfactoryhelper.h" // memdbgon must be the last include file in a .cpp file!!! @@ -184,4 +184,4 @@ int CDmeFaceSet::GetFaceCount() const } return nFaceCount; -} \ No newline at end of file +} diff --git a/movieobjects/dmekeyboardinput.cpp b/movieobjects/dmekeyboardinput.cpp index 0fcea716..36923f46 100644 --- a/movieobjects/dmekeyboardinput.cpp +++ b/movieobjects/dmekeyboardinput.cpp @@ -8,8 +8,8 @@ #include "movieobjects_interfaces.h" #include "datamodel/dmelementfactoryhelper.h" -#include "vgui/iinput.h" -#include "vgui/keycode.h" +#include "vgui/IInput.h" +#include "vgui/KeyCode.h" #include "tier3/tier3.h" #include "tier0/dbg.h" diff --git a/movieobjects/dmelog.cpp b/movieobjects/dmelog.cpp index 6eb5e513..1ee66b7e 100644 --- a/movieobjects/dmelog.cpp +++ b/movieobjects/dmelog.cpp @@ -759,6 +759,7 @@ Quaternion Add( const Quaternion& v1, const Quaternion& v2 ) IMPLEMENT_ABSTRACT_ELEMENT( DmeLogLayer, CDmeLogLayer ); +/* IMPLEMENT_ELEMENT_FACTORY( DmeIntLogLayer, CDmeIntLogLayer ); IMPLEMENT_ELEMENT_FACTORY( DmeFloatLogLayer, CDmeFloatLogLayer ); IMPLEMENT_ELEMENT_FACTORY( DmeBoolLogLayer, CDmeBoolLogLayer ); @@ -770,6 +771,7 @@ IMPLEMENT_ELEMENT_FACTORY( DmeQAngleLogLayer, CDmeQAngleLogLayer ); IMPLEMENT_ELEMENT_FACTORY( DmeQuaternionLogLayer, CDmeQuaternionLogLayer ); IMPLEMENT_ELEMENT_FACTORY( DmeVMatrixLogLayer, CDmeVMatrixLogLayer ); IMPLEMENT_ELEMENT_FACTORY( DmeStringLogLayer, CDmeStringLogLayer ); +*/ //----------------------------------------------------------------------------- // explicit template instantiation @@ -789,6 +791,7 @@ template class CDmeTypedLogLayer; IMPLEMENT_ABSTRACT_ELEMENT( DmeCurveInfo, CDmeCurveInfo ); +/* IMPLEMENT_ELEMENT_FACTORY( DmeIntCurveInfo, CDmeIntCurveInfo ); IMPLEMENT_ELEMENT_FACTORY( DmeFloatCurveInfo, CDmeFloatCurveInfo ); IMPLEMENT_ELEMENT_FACTORY( DmeBoolCurveInfo, CDmeBoolCurveInfo ); @@ -800,6 +803,7 @@ IMPLEMENT_ELEMENT_FACTORY( DmeQAngleCurveInfo, CDmeQAngleCurveInfo ); IMPLEMENT_ELEMENT_FACTORY( DmeQuaternionCurveInfo, CDmeQuaternionCurveInfo ); IMPLEMENT_ELEMENT_FACTORY( DmeVMatrixCurveInfo, CDmeVMatrixCurveInfo ); IMPLEMENT_ELEMENT_FACTORY( DmeStringCurveInfo, CDmeStringCurveInfo ); +*/ //----------------------------------------------------------------------------- // explicit template instantiation @@ -822,6 +826,7 @@ template class CDmeTypedCurveInfo; //----------------------------------------------------------------------------- IMPLEMENT_ABSTRACT_ELEMENT( DmeLog, CDmeLog ); +/* IMPLEMENT_ELEMENT_FACTORY( DmeIntLog, CDmeIntLog ); IMPLEMENT_ELEMENT_FACTORY( DmeFloatLog, CDmeFloatLog ); IMPLEMENT_ELEMENT_FACTORY( DmeBoolLog, CDmeBoolLog ); @@ -833,6 +838,7 @@ IMPLEMENT_ELEMENT_FACTORY( DmeQAngleLog, CDmeQAngleLog ); IMPLEMENT_ELEMENT_FACTORY( DmeQuaternionLog, CDmeQuaternionLog ); IMPLEMENT_ELEMENT_FACTORY( DmeVMatrixLog, CDmeVMatrixLog ); IMPLEMENT_ELEMENT_FACTORY( DmeStringLog, CDmeStringLog ); +*/ //----------------------------------------------------------------------------- @@ -854,6 +860,7 @@ template class CDmeTypedLog; //----------------------------------------------------------------------------- // instantiate and initialize static vars //----------------------------------------------------------------------------- +/* float CDmeIntLog::s_defaultThreshold = 0.0f; float CDmeFloatLog::s_defaultThreshold = 0.0f; float CDmeBoolLog::s_defaultThreshold = 0.0f; @@ -865,6 +872,7 @@ float CDmeQAngleLog::s_defaultThreshold = 0.0f; float CDmeQuaternionLog::s_defaultThreshold = 0.0f; float CDmeVMatrixLog::s_defaultThreshold = 0.0f; float CDmeStringLog::s_defaultThreshold = 0.0f; +*/ void CDmeLogLayer::OnConstruction() diff --git a/movieobjects/dmemouseinput.cpp b/movieobjects/dmemouseinput.cpp index 6215d2a2..8cb57067 100644 --- a/movieobjects/dmemouseinput.cpp +++ b/movieobjects/dmemouseinput.cpp @@ -8,8 +8,8 @@ #include "movieobjects_interfaces.h" #include "datamodel/dmelementfactoryhelper.h" -#include "vgui/iinput.h" -#include "vgui/ipanel.h" +#include "vgui/IInput.h" +#include "vgui/IPanel.h" #include "tier3/tier3.h" #include "tier0/dbg.h" diff --git a/movieobjects/dmeparticlesystemdefinition.cpp b/movieobjects/dmeparticlesystemdefinition.cpp index d279d448..426d48f9 100644 --- a/movieobjects/dmeparticlesystemdefinition.cpp +++ b/movieobjects/dmeparticlesystemdefinition.cpp @@ -12,9 +12,9 @@ #include "tier1/utlbuffer.h" #include "tier1/convar.h" #include "particles/particles.h" -#include "dme_controls/attributeintchoicepanel.h" -#include "dme_controls/attributeboolchoicepanel.h" -#include "dme_controls/attributestringchoicepanel.h" +#include "dme_controls/AttributeIntChoicePanel.h" +#include "dme_controls/AttributeBoolChoicePanel.h" +#include "dme_controls/AttributeStringChoicePanel.h" // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" diff --git a/movieobjects/wscript b/movieobjects/wscript new file mode 100755 index 00000000..427ced6c --- /dev/null +++ b/movieobjects/wscript @@ -0,0 +1,95 @@ +#! /usr/bin/env python +# encoding: utf-8 +# vim: noexpandtab + +from waflib import Utils +import os + +top = '.' +PROJECT_NAME = 'movieobjects' + +def options(opt): + # stub + return + +def configure(conf): + return + +def build(bld): + source = [ + 'dmeanimationlist.cpp', + 'dmeanimationset.cpp', + 'dmeattachment.cpp', + 'dmebalancetostereocalculatoroperator.cpp', + 'dmebookmark.cpp', + 'dmecamera.cpp', + 'dmechannel.cpp', + 'dmeclip.cpp', + 'dmecombinationoperator.cpp', + 'dmedag.cpp', + 'dmedccmakefile.cpp', + 'dmeeditortypedictionary.cpp', + 'dmeexpressionoperator.cpp', + 'dmefaceset.cpp', + 'dmegamemodel.cpp', + 'dmegamemodelinput.cpp', + 'dmeinput.cpp', + 'dmejoint.cpp', + 'dmekeyboardinput.cpp', + 'dmelight.cpp', +# 'dmelog.cpp', + 'dmemakefile.cpp', + 'dmemakefileutils.cpp', + 'dmematerial.cpp', + 'dmematerialoverlayfxclip.cpp', + 'dmemdl.cpp', + 'dmemdlmakefile.cpp', +# 'dmemesh.cpp', + 'dmemodel.cpp', + 'dmemorphoperator.cpp', + 'dmemouseinput.cpp', + 'dmeoperator.cpp', + 'dmepackoperators.cpp', + 'dmeparticlesystemdefinition.cpp', + 'dmephonememapping.cpp', + 'dmeselection.cpp', + 'dmeshape.cpp', + 'dmesound.cpp', + 'dmetimeframe.cpp', + 'dmetimeselection.cpp', + 'dmetrack.cpp', + 'dmetrackgroup.cpp', + 'dmetransform.cpp', + 'dmetransforminput.cpp', + 'dmetransformlist.cpp', + 'dmetransformoperator.cpp', + 'dmeunpackoperators.cpp', + 'dmevertexdata.cpp', + 'dmobjserializer.cpp', + 'movieobjects_interfaces.cpp', + '../public/phonemeconverter.cpp', + ] + + includes = [ + '.', + '../public', + '../public/tier0', + '../public/tier1', + ] + + defines = [] + + libs = [] + + bld.stlib( + source = source, + target = PROJECT_NAME, + name = PROJECT_NAME, + features = 'c cxx', + includes = includes, + defines = defines, + use = libs, + subsystem = bld.env.MSVC_SUBSYSTEM, + idx = bld.get_taskgen_count() + ) + diff --git a/public/appframework/AppFramework.h b/public/appframework/AppFramework.h index 4df8a2b8..5d175d19 100644 --- a/public/appframework/AppFramework.h +++ b/public/appframework/AppFramework.h @@ -54,19 +54,11 @@ void AppShutdown( CAppSystemGroup *pAppSystemGroup ); { \ return AppMain( hInstance, hPrevInstance, lpCmdLine, nCmdShow, &_globalVarName ); \ } -#elif defined( OSX ) +#elif defined( POSIX ) #define DEFINE_WINDOWED_APPLICATION_OBJECT_GLOBALVAR( _globalVarName ) \ int main( int argc, char **argv ) \ { \ - extern int ValveCocoaMain( int argc, char **argv, CAppSystemGroup *pAppSystemGroup ); \ - return ValveCocoaMain( argc, argv, &_globalVarName ); \ - } -#elif defined( LINUX ) || defined(PLATFORM_BSD) -#define DEFINE_WINDOWED_APPLICATION_OBJECT_GLOBALVAR( _globalVarName ) \ - int main( int argc, char **argv ) \ - { \ - extern int ValveLinuxWindowedMain( int argc, char **argv, CAppSystemGroup *pAppSystemGroup ); \ - return ValveLinuxWindowedMain( argc, argv, &_globalVarName ); \ + return AppMain( argc, argv, &_globalVarName ); \ } #else #error diff --git a/public/movieobjects/dmeanimationset.h b/public/movieobjects/dmeanimationset.h index ad7678b1..30969a8b 100644 --- a/public/movieobjects/dmeanimationset.h +++ b/public/movieobjects/dmeanimationset.h @@ -13,6 +13,7 @@ #include "datamodel/dmelement.h" #include "datamodel/dmattribute.h" #include "datamodel/dmattributevar.h" +#include "movieobjects/dmeclip.h" #include "movieobjects/dmephonememapping.h" #include "movieobjects/timeutils.h" #include "movieobjects/proceduralpresets.h" diff --git a/public/movieobjects/dmeclip.h b/public/movieobjects/dmeclip.h index 51cd3379..e6a71cb6 100644 --- a/public/movieobjects/dmeclip.h +++ b/public/movieobjects/dmeclip.h @@ -11,6 +11,7 @@ #endif #include "datamodel/dmelement.h" +#include "datamodel/dmelementfactoryhelper.h" #include "datamodel/dmattribute.h" #include "datamodel/dmattributevar.h" #include "datamodel/dmehandle.h" diff --git a/public/movieobjects/dmelog.h b/public/movieobjects/dmelog.h index a0e85b09..e5f35b3c 100644 --- a/public/movieobjects/dmelog.h +++ b/public/movieobjects/dmelog.h @@ -404,7 +404,7 @@ protected: template< class T > class CDmeTypedCurveInfo : public CDmeCurveInfo { - DEFINE_ELEMENT( CDmeTypedCurveInfo, CDmeCurveInfo ); +// DEFINE_ELEMENT( CDmeTypedCurveInfo, CDmeCurveInfo ); public: // For "faceposer" style left/right edges, this controls whether interpolators try to mimic faceposer left/right edge behavior @@ -447,7 +447,7 @@ template< class T > class CDmeTypedLog; template< class T > class CDmeTypedLogLayer : public CDmeLogLayer { - DEFINE_ELEMENT( CDmeTypedLogLayer, CDmeLogLayer ); +// DEFINE_ELEMENT( CDmeTypedLogLayer, CDmeLogLayer ); public: virtual void CopyLayer( const CDmeLogLayer *src ); @@ -529,7 +529,7 @@ protected: template< class T > class CDmeTypedLog : public CDmeLog { - DEFINE_ELEMENT( CDmeTypedLog, CDmeLog ); +// DEFINE_ELEMENT( CDmeTypedLog, CDmeLog ); public: @@ -836,7 +836,7 @@ template<> void CDmeTypedLogLayer< Vector >::GetValueUsingCurveInfoSkippingKey( template<> void CDmeTypedLogLayer< Quaternion >::GetValueUsingCurveInfo( DmeTime_t time, Quaternion& out ) const; template<> void CDmeTypedLogLayer< Quaternion >::GetValueUsingCurveInfoSkippingKey( int nKeyToSkip, Quaternion& out ) const; -template void CDmeTypedLogLayer< T >::CurveSimplify_R( float thresholdSqr, int startPoint, int endPoint, CDmeTypedLogLayer< T > *output ); +//template void CDmeTypedLogLayer< T >::CurveSimplify_R( float thresholdSqr, int startPoint, int endPoint, CDmeTypedLogLayer< T > *output ); template<> void CDmeTypedLogLayer< bool >::CurveSimplify_R( float thresholdSqr, int startPoint, int endPoint, CDmeTypedLogLayer< bool > *output ); template<> void CDmeTypedLogLayer< int >::CurveSimplify_R( float thresholdSqr, int startPoint, int endPoint, CDmeTypedLogLayer< int > *output ); template<> void CDmeTypedLogLayer< Color >::CurveSimplify_R( float thresholdSqr, int startPoint, int endPoint, CDmeTypedLogLayer< Color > *output ); diff --git a/public/movieobjects/dmetimeselection.h b/public/movieobjects/dmetimeselection.h index 5eb1d938..e533863b 100644 --- a/public/movieobjects/dmetimeselection.h +++ b/public/movieobjects/dmetimeselection.h @@ -11,11 +11,10 @@ #endif #include "datamodel/dmelement.h" +#include "dme_controls/RecordingState.h" #include "movieobjects/timeutils.h" #include "movieobjects/dmetimeselectiontimes.h" -enum RecordingState_t; - class CDmeTimeSelection : public CDmElement { DEFINE_ELEMENT( CDmeTimeSelection, CDmElement ); diff --git a/public/movieobjects/dmetrackgroup.h b/public/movieobjects/dmetrackgroup.h index 8e029c33..167a73e3 100644 --- a/public/movieobjects/dmetrackgroup.h +++ b/public/movieobjects/dmetrackgroup.h @@ -15,6 +15,7 @@ #include "datamodel/dmattribute.h" #include "datamodel/dmattributevar.h" #include "datamodel/dmehandle.h" +#include "movieobjects/dmeclip.h" #include "movieobjects/timeutils.h" @@ -24,8 +25,6 @@ class CDmeClip; class CDmeFilmClip; class CDmeTrack; -enum DmeClipType_t; -enum DmeClipSkipFlag_t; //----------------------------------------------------------------------------- diff --git a/utils/studiomdl/bmpread.cpp b/utils/studiomdl/bmpread.cpp deleted file mode 100644 index 24663fe0..00000000 --- a/utils/studiomdl/bmpread.cpp +++ /dev/null @@ -1,98 +0,0 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: -// -// $NoKeywords: $ -// -//=============================================================================// - - -#include -#include - - -int -ReadBmpFile( - char* szFile, - unsigned char** ppbPalette, - unsigned char** ppbBits, - int *pwidth, - int *pheight) - { - int rc = 0; - FILE *pfile = NULL; - BITMAPFILEHEADER bmfh; - BITMAPINFOHEADER bmih; - RGBQUAD rgrgbPalette[256]; - ULONG cbPalBytes; - ULONG cbBmpBits; - BYTE* pbBmpBits; - - // Bogus parameter check - if (!(ppbPalette != NULL && ppbBits != NULL)) - { rc = -1000; goto GetOut; } - - // File exists? - if ((pfile = fopen(szFile, "rb")) == NULL) - { rc = -1; goto GetOut; } - - // Read file header - if (fread(&bmfh, sizeof bmfh, 1/*count*/, pfile) != 1) - { rc = -2; goto GetOut; } - - // Bogus file header check - if (!(bmfh.bfReserved1 == 0 && bmfh.bfReserved2 == 0)) - { rc = -2000; goto GetOut; } - - // Read info header - if (fread(&bmih, sizeof bmih, 1/*count*/, pfile) != 1) - { rc = -3; goto GetOut; } - - // Bogus info header check - if (!(bmih.biSize == sizeof bmih && bmih.biPlanes == 1)) - { rc = -3000; goto GetOut; } - - // Bogus bit depth? Only 8-bit supported. - if (bmih.biBitCount != 8) - { rc = -4; goto GetOut; } - - // Bogus compression? Only non-compressed supported. - if (bmih.biCompression != BI_RGB) - { rc = -5; goto GetOut; } - - // Figure out how many entires are actually in the table - if (bmih.biClrUsed == 0) - { - cbPalBytes = (1 << bmih.biBitCount) * sizeof( RGBQUAD ); - } - else - { - cbPalBytes = bmih.biClrUsed * sizeof( RGBQUAD ); - } - - // Read palette (256 entries) - if (fread(rgrgbPalette, cbPalBytes, 1/*count*/, pfile) != 1) - { rc = -6; goto GetOut; } - - // Read bitmap bits (remainder of file) - cbBmpBits = bmfh.bfSize - ftell(pfile); - pbBmpBits = (BYTE *)malloc(cbBmpBits); - if (fread(pbBmpBits, cbBmpBits, 1/*count*/, pfile) != 1) - { rc = -7; goto GetOut; } - - // Set output parameters - *ppbPalette = (BYTE *)malloc(sizeof rgrgbPalette); - memcpy(*ppbPalette, rgrgbPalette, cbPalBytes); - *ppbBits = pbBmpBits; - - - *pwidth = bmih.biWidth; - *pheight = bmih.biHeight; - - printf("w %d h %d s %d\n",bmih.biWidth, bmih.biHeight, cbBmpBits ); - -GetOut: - if (pfile) fclose(pfile); - return rc; - } - diff --git a/utils/studiomdl/dmxsupport.cpp b/utils/studiomdl/dmxsupport.cpp index 2e83255e..dcf4bf8a 100644 --- a/utils/studiomdl/dmxsupport.cpp +++ b/utils/studiomdl/dmxsupport.cpp @@ -1142,6 +1142,7 @@ int Load_DMX( s_source_t *pSource ) CDmeDag *pSkeleton = pRoot->GetValueElement< CDmeDag >( "skeleton" ); CDmeModel *pModel = pRoot->GetValueElement< CDmeModel >( "model" ); CDmeCombinationOperator *pCombinationOperator = pRoot->GetValueElement< CDmeCombinationOperator >( "combinationOperator" ); + CDmeAnimationList *pAnimationList; if ( !pSkeleton ) goto dmxError; @@ -1175,7 +1176,7 @@ int Load_DMX( s_source_t *pSource ) AddCombination( pSource, pCombinationOperator ); } - CDmeAnimationList *pAnimationList = pRoot->GetValueElement< CDmeAnimationList >( "animationList" ); + pAnimationList = pRoot->GetValueElement< CDmeAnimationList >( "animationList" ); if ( pAnimationList ) { LoadAnimations( pSource, pAnimationList, g_currentscale, boneMap ); diff --git a/utils/studiomdl/hardwarematrixstate.cpp b/utils/studiomdl/hardwarematrixstate.cpp index b49430c1..c524a2d1 100644 --- a/utils/studiomdl/hardwarematrixstate.cpp +++ b/utils/studiomdl/hardwarematrixstate.cpp @@ -5,8 +5,7 @@ // $NoKeywords: $ //=============================================================================// -#include -#include "HardwareMatrixState.h" +#include "hardwarematrixstate.h" #include #include #include @@ -197,7 +196,8 @@ void CHardwareMatrixState::DumpState( void ) return; //#endif - OutputDebugString( "DumpState\n:" ); +#if 0 + Msg( "DumpState:\n" ); for( i = 0; i < m_NumMatrices; i++ ) { if( m_matrixState[i].allocated ) @@ -207,9 +207,10 @@ void CHardwareMatrixState::DumpState( void ) m_matrixState[i].allocated ? "true " : "false", m_matrixState[i].lastUsageID, m_matrixState[i].globalMatrixID ); - OutputDebugString( buf ); + Msg( buf ); } } +#endif } int CHardwareMatrixState::FindHardwareMatrix( int globalMatrixID ) diff --git a/utils/studiomdl/hardwarevertexcache.cpp b/utils/studiomdl/hardwarevertexcache.cpp index 1c5a41c3..7c1d1db3 100644 --- a/utils/studiomdl/hardwarevertexcache.cpp +++ b/utils/studiomdl/hardwarevertexcache.cpp @@ -7,7 +7,7 @@ #include #include -#include "HardwareVertexCache.h" +#include "hardwarevertexcache.h" CHardwareVertexCache::CHardwareVertexCache() { diff --git a/utils/studiomdl/optimize.cpp b/utils/studiomdl/optimize.cpp index 88f6d0f7..eea9d239 100644 --- a/utils/studiomdl/optimize.cpp +++ b/utils/studiomdl/optimize.cpp @@ -17,7 +17,7 @@ //#define IGNORE_BONES -#define NVTRISTRIP +//#define NVTRISTRIP #define EMIT_TRILISTS @@ -28,12 +28,11 @@ #include "cmdlib.h" #include "studio.h" #include "studiomdl.h" -#include "HardwareMatrixState.h" -#include "HardwareVertexCache.h" +#include "hardwarematrixstate.h" +#include "hardwarevertexcache.h" #include "optimize.h" -#include -#include -#include "FileBuffer.h" +//#include "nvtristrip.h" +#include "filebuffer.h" #include "tier1/utlvector.h" #include "materialsystem/imaterial.h" #include "tier1/utllinkedlist.h" @@ -352,7 +351,7 @@ private: // Memory optimize the strip data void PostProcessStripGroup( mstudiomodel_t *pStudioModel, mstudiomesh_t *pStudioMesh, StripGroup_t *pStripGroup ); - void COptimizedModel::ZeroNumBones( void ); + void ZeroNumBones( void ); // // Methods associated with writing VTX files diff --git a/utils/studiomdl/perfstats.cpp b/utils/studiomdl/perfstats.cpp index 815ff980..c2ea6daf 100644 --- a/utils/studiomdl/perfstats.cpp +++ b/utils/studiomdl/perfstats.cpp @@ -202,8 +202,8 @@ void SpewPerfStats( studiohdr_t *pStudioHdr, const char *pFilename, unsigned int } // studio render will request these through cache interface - pStudioHdr->pVertexBase = (void *)pVvdHdr; - pStudioHdr->pIndexBase = (void *)pVtxHdr; + pStudioHdr->SetVertexBase((void *)pVvdHdr); + pStudioHdr->SetIndexBase((void *)pVtxHdr); g_pStudioRender->LoadModel( pStudioHdr, pVtxHdr, &studioHWData ); diff --git a/utils/studiomdl/studiomdl.cpp b/utils/studiomdl/studiomdl.cpp index 44416176..b5f06db8 100644 --- a/utils/studiomdl/studiomdl.cpp +++ b/utils/studiomdl/studiomdl.cpp @@ -12,22 +12,23 @@ // models/.mdl. // - +#ifdef _WIN32 #pragma warning( disable : 4244 ) #pragma warning( disable : 4237 ) #pragma warning( disable : 4305 ) #include +#include #undef GetCurrentDirectory #include // PathCanonicalize #pragma comment( lib, "shlwapi" ) +#endif #include #include #include #include -#include #include "istudiorender.h" #include "filesystem_tools.h" #include "tier2/fileutils.h" @@ -45,9 +46,9 @@ #include "bspflags.h" #include "tier0/icommandline.h" #include "utldict.h" -#include "tier1/utlsortvector.h" +#include "tier1/UtlSortVector.h" #include "bitvec.h" -#include "appframework/appframework.h" +#include "appframework/AppFramework.h" #include "datamodel/idatamodel.h" #include "materialsystem/materialsystem_config.h" #include "vstdlib/cvar.h" @@ -67,6 +68,10 @@ #include "perfstats.h" #include "worldsize.h" +#ifdef POSIX +#define _stat stat +#endif + bool g_collapse_bones = false; bool g_collapse_bones_aggressive = false; bool g_quiet = false; @@ -195,6 +200,7 @@ void EnsureDependencyFileCheckedIn( const char *pFileName ) if ( g_bNoP4 ) return; +#ifdef _WIN32 char pFullPath[MAX_PATH]; if ( !GetGlobalFilePath( pFileName, pFullPath, sizeof(pFullPath) ) ) { @@ -206,6 +212,7 @@ void EnsureDependencyFileCheckedIn( const char *pFileName ) char bufCanonicalPath[ MAX_PATH ] = {0}; PathCanonicalize( bufCanonicalPath, pFullPath ); CP4AutoAddFile p4_add_dep_file( bufCanonicalPath ); +#endif } void StudioMdl_ScriptLoadedCallback( char const *pFilenameLoaded, char const *pIncludedFromFileName, int nIncludeLineNumber ) @@ -385,15 +392,17 @@ SpewRetval_t MdlSpewOutputFunc( SpewType_t type, char const *pMsg ) { MdlWarning( "%s", pMsg ); } +#if 0 else { return CmdLib_SpewOutputFunc( type, pMsg ); } +#endif return SPEW_CONTINUE; } - +#ifdef _WIN32 #ifndef _DEBUG void MdlHandleCrash( const char *pMessage, bool bAssert ) @@ -471,6 +480,7 @@ void MdlExceptionFilter( unsigned long code ) TerminateProcess( GetCurrentProcess(), 1 ); } +#endif #endif /* @@ -490,7 +500,7 @@ void *kalloc( int num, int size ) nMemSize += 511; void *ptr = malloc( nMemSize ); memset( ptr, 0, nMemSize ); - ptr = (byte *)((int)((byte *)ptr + 511) & ~511); + ptr = (byte *)((size_t)((byte *)ptr + 511) & ~511); return ptr; } @@ -2297,9 +2307,11 @@ int Option_Activity( s_sequence_t *psequence ) int Option_ActivityModifier( s_sequence_t *psequence ) { +#if 0 GetToken(false); V_strcpy_safe( psequence->activitymodifier[ psequence->numactivitymodifiers++ ].name, token ); +#endif return 0; } @@ -8366,7 +8378,7 @@ bool GetGlobalFilePath( const char *pSrc, char *pFullPath, int nMaxLen ) struct _stat buf; int rt = _stat( tmp, &buf ); - if ( rt != -1 && ( buf.st_size > 0 ) && ( ( buf.st_mode & _S_IFDIR ) == 0 ) ) + if ( rt != -1 && ( buf.st_size > 0 ) && ( ( buf.st_mode & S_IFDIR ) == 0 ) ) { Q_strncpy( pFullPath, tmp, nMaxLen ); return true; @@ -8377,7 +8389,7 @@ bool GetGlobalFilePath( const char *pSrc, char *pFullPath, int nMaxLen ) struct _stat buf; int rt = _stat( pFileName, &buf ); - if ( rt != -1 && ( buf.st_size > 0 ) && ( ( buf.st_mode & _S_IFDIR ) == 0 ) ) + if ( rt != -1 && ( buf.st_size > 0 ) && ( ( buf.st_mode & S_IFDIR ) == 0 ) ) { Q_strncpy( pFullPath, pFileName, nMaxLen ); return true; @@ -9463,6 +9475,7 @@ void UsageAndExit() ); } +#ifdef _WIN32 #ifndef _DEBUG LONG __stdcall VExceptionFilter( struct _EXCEPTION_POINTERS *ExceptionInfo ) @@ -9471,6 +9484,7 @@ LONG __stdcall VExceptionFilter( struct _EXCEPTION_POINTERS *ExceptionInfo ) return EXCEPTION_EXECUTE_HANDLER; // (never gets here anyway) } +#endif #endif /* ============== @@ -9545,8 +9559,10 @@ bool CStudioMDLApp::Create() MathLib_Init( 2.2f, 2.2f, 0.0f, 2.0f, false, false, false, false ); +#ifdef _WIN32 #ifndef _DEBUG SetUnhandledExceptionFilter( VExceptionFilter ); +#endif #endif if ( CommandLine()->ParmCount() == 1 ) diff --git a/utils/studiomdl/studiomdl.h b/utils/studiomdl/studiomdl.h index 413860e8..4df819c0 100644 --- a/utils/studiomdl/studiomdl.h +++ b/utils/studiomdl/studiomdl.h @@ -130,9 +130,9 @@ public: template< typename T > inline T& CUtlVectorAuto::operator[]( int i ) { - EnsureCount( i + 1 ); + this->EnsureCount( i + 1 ); Assert( IsValidIndex(i) ); - return Base()[i]; + return this->Base()[i]; } // -------------------------------------------------------------------- diff --git a/utils/studiomdl/tristrip.cpp b/utils/studiomdl/tristrip.cpp deleted file mode 100644 index 2a428365..00000000 --- a/utils/studiomdl/tristrip.cpp +++ /dev/null @@ -1,350 +0,0 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: -// -// $NoKeywords: $ -// -//=============================================================================// - -// tristrip - convert triangle list into tristrips and fans - -#pragma warning( disable : 4244 ) -#pragma warning( disable : 4237 ) -#pragma warning( disable : 4305 ) - - -#include -#include -#include - -#include "cmdlib.h" -#include "lbmlib.h" -#include "scriplib.h" -#include "mathlib/mathlib.h" -#include "..\..\engine\studio.h" -#include "studiomdl.h" - -int used[MAXSTUDIOTRIANGLES]; - -// the command list holds counts and s/t values that are valid for -// every frame -short commands[MAXSTUDIOTRIANGLES * 13]; -int numcommands; - -// all frames will have their vertexes rearranged and expanded -// so they are in the order expected by the command list - -int allverts, alltris; - -int stripverts[MAXSTUDIOTRIANGLES+2]; -int striptris[MAXSTUDIOTRIANGLES+2]; -int stripcount; - -int neighbortri[MAXSTUDIOTRIANGLES][3]; -int neighboredge[MAXSTUDIOTRIANGLES][3]; - - -s_trianglevert_t (*triangles)[3]; -s_mesh_t *pmesh; - - -void FindNeighbor (int starttri, int startv) -{ - s_trianglevert_t m1, m2; - int j; - s_trianglevert_t *last, *check; - int k; - - // used[starttri] |= (1 << startv); - - last = &triangles[starttri][0]; - - m1 = last[(startv+1)%3]; - m2 = last[(startv+0)%3]; - - for (j=starttri+1, check=&triangles[starttri+1][0] ; jnumtris ; j++, check += 3) - { - if (used[j] == 7) - continue; - for (k=0 ; k<3 ; k++) - { - if (memcmp(&check[k],&m1,sizeof(m1))) - continue; - if (memcmp(&check[ (k+1)%3 ],&m2,sizeof(m2))) - continue; - - neighbortri[starttri][startv] = j; - neighboredge[starttri][startv] = k; - - neighbortri[j][k] = starttri; - neighboredge[j][k] = startv; - - used[starttri] |= (1 << startv); - used[j] |= (1 << k); - return; - } - } -} - - -/* -================ -StripLength -================ -*/ -int StripLength (int starttri, int startv) -{ - int j; - int k; - - used[starttri] = 2; - - stripverts[0] = (startv)%3; - stripverts[1] = (startv+1)%3; - stripverts[2] = (startv+2)%3; - - striptris[0] = starttri; - striptris[1] = starttri; - striptris[2] = starttri; - stripcount = 3; - - while( 1 ) - { - if (stripcount & 1) - { - j = neighbortri[starttri][(startv+1)%3]; - k = neighboredge[starttri][(startv+1)%3]; - } - else - { - j = neighbortri[starttri][(startv+2)%3]; - k = neighboredge[starttri][(startv+2)%3]; - } - if (j == -1 || used[j]) - goto done; - - stripverts[stripcount] = (k+2)%3; - striptris[stripcount] = j; - stripcount++; - - used[j] = 2; - - starttri = j; - startv = k; - } - -done: - - // clear the temp used flags - for (j=0 ; jnumtris ; j++) - if (used[j] == 2) - used[j] = 0; - - return stripcount; -} - -/* -=========== -FanLength -=========== -*/ -int FanLength (int starttri, int startv) -{ - int j; - int k; - - used[starttri] = 2; - - stripverts[0] = (startv)%3; - stripverts[1] = (startv+1)%3; - stripverts[2] = (startv+2)%3; - - striptris[0] = starttri; - striptris[1] = starttri; - striptris[2] = starttri; - stripcount = 3; - - while( 1 ) - { - j = neighbortri[starttri][(startv+2)%3]; - k = neighboredge[starttri][(startv+2)%3]; - - if (j == -1 || used[j]) - goto done; - - stripverts[stripcount] = (k+2)%3; - striptris[stripcount] = j; - stripcount++; - - used[j] = 2; - - starttri = j; - startv = k; - } - -done: - - // clear the temp used flags - for (j=0 ; jnumtris ; j++) - if (used[j] == 2) - used[j] = 0; - - return stripcount; -} - - -/* -================ -BuildTris - -Generate a list of trifans or strips -for the model, which holds for all frames -================ -*/ -int numcommandnodes; - -int BuildTris (s_trianglevert_t (*x)[3], s_mesh_t *y, byte **ppdata ) -{ - int i, j, k, m; - int startv; - int len, bestlen, besttype; - int bestverts[MAXSTUDIOTRIANGLES]; - int besttris[MAXSTUDIOTRIANGLES]; - int peak[MAXSTUDIOTRIANGLES]; - int type; - int total = 0; - long t; - int maxlen; - - triangles = x; - pmesh = y; - - - t = time( NULL ); - - for (i=0 ; inumtris ; i++) - { - neighbortri[i][0] = neighbortri[i][1] = neighbortri[i][2] = -1; - used[i] = 0; - peak[i] = pmesh->numtris; - } - - // printf("finding neighbors\n"); - for (i=0 ; inumtris; i++) - { - for (k = 0; k < 3; k++) - { - if (used[i] & (1 << k)) - continue; - - FindNeighbor( i, k ); - } - // printf("%d", used[i] ); - } - // printf("\n"); - - // - // build tristrips - // - numcommandnodes = 0; - numcommands = 0; - memset (used, 0, sizeof(used)); - - for (i=0 ; inumtris ;) - { - // pick an unused triangle and start the trifan - if (used[i]) - { - i++; - continue; - } - - maxlen = 9999; - bestlen = 0; - m = 0; - for (k = i; k < pmesh->numtris && bestlen < 127; k++) - { - int localpeak = 0; - - if (used[k]) - continue; - - if (peak[k] <= bestlen) - continue; - - m++; - for (type = 0 ; type < 2 ; type++) - { - for (startv =0 ; startv < 3 ; startv++) - { - if (type == 1) - len = FanLength (k, startv); - else - len = StripLength (k, startv); - if (len > 127) - { - // skip these, they are too long to encode - } - else if (len > bestlen) - { - besttype = type; - bestlen = len; - for (j=0 ; j localpeak) - localpeak = len; - } - } - peak[k] = localpeak; - if (localpeak == maxlen) - break; - } - total += (bestlen - 2); - - // printf("%d (%d) %d\n", bestlen, pmesh->numtris - total, i ); - - maxlen = bestlen; - - // mark the tris on the best strip as used - for (j=0 ; jvertindex; - commands[numcommands++] = tri->normindex; - commands[numcommands++] = tri->s; - commands[numcommands++] = tri->t; - } - // printf("%d ", bestlen - 2 ); - numcommandnodes++; - - if (t != time(NULL)) - { - printf("%2d%%\r", (total * 100) / pmesh->numtris ); - t = time(NULL); - } - } - - commands[numcommands++] = 0; // end of list marker - - *ppdata = (byte *)commands; - - // printf("%d %d %d\n", numcommandnodes, numcommands, pmesh->numtris ); - return numcommands * sizeof( short ); -} - diff --git a/utils/studiomdl/write.cpp b/utils/studiomdl/write.cpp index d3867f40..92a880f2 100644 --- a/utils/studiomdl/write.cpp +++ b/utils/studiomdl/write.cpp @@ -10,12 +10,14 @@ // write.c: writes a studio .mdl file // +#ifdef _WIN32 #pragma warning( disable : 4244 ) #pragma warning( disable : 4237 ) #pragma warning( disable : 4305 ) - #include +#endif + #include #include #include @@ -64,11 +66,11 @@ static byte *pBlockStart; #undef ALIGN4 #undef ALIGN16 #undef ALIGN32 -#define ALIGN4( a ) a = (byte *)((int)((byte *)a + 3) & ~ 3) -#define ALIGN16( a ) a = (byte *)((int)((byte *)a + 15) & ~ 15) -#define ALIGN32( a ) a = (byte *)((int)((byte *)a + 31) & ~ 31) -#define ALIGN64( a ) a = (byte *)((int)((byte *)a + 63) & ~ 63) -#define ALIGN512( a ) a = (byte *)((int)((byte *)a + 511) & ~ 511) +#define ALIGN4( a ) a = (byte *)((size_t)((byte *)a + 3) & ~ 3) +#define ALIGN16( a ) a = (byte *)((size_t)((byte *)a + 15) & ~ 15) +#define ALIGN32( a ) a = (byte *)((size_t)((byte *)a + 31) & ~ 31) +#define ALIGN64( a ) a = (byte *)((size_t)((byte *)a + 63) & ~ 63) +#define ALIGN512( a ) a = (byte *)((size_t)((byte *)a + 511) & ~ 511) // make sure kalloc aligns to maximum alignment size #define FILEBUFFER (8 * 1024 * 1024) @@ -1736,12 +1738,12 @@ static void WriteBoneTransforms( studiohdr2_t *phdr, mstudiobone_t *pBone ) pLinearBone->numbones = g_numbones; #define WRITE_BONE_BLOCK( type, srcfield, dest, destindex ) \ - type *##dest = (type *)pData; \ - pLinearBone->##destindex = pData - (byte *)pLinearBone; \ - pData += g_numbones * sizeof( *##dest ); \ + type *dest = (type *)pData; \ + pLinearBone->destindex = pData - (byte *)pLinearBone; \ + pData += g_numbones * sizeof( *dest ); \ ALIGN4( pData ); \ for ( int i = 0; i < g_numbones; i++) \ - dest##[i] = pBone[i].##srcfield; + dest[i] = pBone[i].srcfield; WRITE_BONE_BLOCK( int, flags, pFlags, flagsindex ); WRITE_BONE_BLOCK( int, parent, pParent, parentindex ); @@ -1881,7 +1883,7 @@ static void WriteVertices( studiohdr_t *phdr ) // save vertices ALIGN16( pData ); - cur = (int)pData; + cur = (size_t)pData; mstudiovertex_t *pVert = (mstudiovertex_t *)pData; pData += pLodData->numvertices * sizeof( mstudiovertex_t ); for (j = 0; j < pLodData->numvertices; j++) @@ -1908,7 +1910,7 @@ static void WriteVertices( studiohdr_t *phdr ) if (!g_quiet) { - printf( "vertices %7d bytes (%d vertices)\n", (int)(pData - cur), pLodData->numvertices ); + printf( "vertices %7d bytes (%d vertices)\n", (size_t)(pData - cur), pLodData->numvertices ); } } @@ -1925,7 +1927,7 @@ static void WriteVertices( studiohdr_t *phdr ) // save tangent space S ALIGN4( pData ); - cur = (int)pData; + cur = (size_t)pData; Vector4D *ptangents = (Vector4D *)pData; pData += pLodData->numvertices * sizeof( Vector4D ); for (j = 0; j < pLodData->numvertices; j++) @@ -1939,7 +1941,7 @@ static void WriteVertices( studiohdr_t *phdr ) if (!g_quiet) { - printf( "tangents %7d bytes (%d vertices)\n", (int)(pData - cur), pLodData->numvertices ); + printf( "tangents %7d bytes (%d vertices)\n", (size_t)(pData - cur), pLodData->numvertices ); } } @@ -2060,7 +2062,7 @@ static void WriteModel( studiohdr_t *phdr ) mstudiovertanim_t *pvertanim; s_vertanim_t *pvanim; - int cur = (int)pData; + int cur = (size_t)pData; // vertex data is written to external file, offsets kept internal // track expected external base to store proper offsets @@ -2362,9 +2364,9 @@ static void WriteModel( studiohdr_t *phdr ) if( !g_quiet ) { - printf("ik/pose %7d bytes\n", (int)(pData - cur) ); + printf("ik/pose %7d bytes\n", (size_t)(pData - cur) ); } - cur = (int)pData; + cur = (size_t)pData; const float flVertAnimFixedPointScale = ComputeVertAnimFixedPointScale( phdr ); @@ -2424,15 +2426,15 @@ static void WriteModel( studiohdr_t *phdr ) // set expected base offsets to external data ALIGN16( externalVertexIndex ); - pmodel[i].vertexindex = (int)externalVertexIndex; + pmodel[i].vertexindex = (size_t)externalVertexIndex; externalVertexIndex += pmodel[i].numvertices * sizeof(mstudiovertex_t); // set expected base offsets to external data ALIGN4( externalTangentsIndex ); - pmodel[i].tangentsindex = (int)externalTangentsIndex; + pmodel[i].tangentsindex = (size_t)externalTangentsIndex; externalTangentsIndex += pmodel[i].numvertices * sizeof( Vector4D ); - cur = (int)pData; + cur = (size_t)pData; // save eyeballs mstudioeyeball_t *peyeball; @@ -2470,11 +2472,11 @@ static void WriteModel( studiohdr_t *phdr ) if ( !g_quiet ) { - printf("eyeballs %7d bytes (%d eyeballs)\n", (int)(pData - cur), g_model[i]->numeyeballs ); + printf("eyeballs %7d bytes (%d eyeballs)\n", (size_t)(pData - cur), g_model[i]->numeyeballs ); } // move flexes into individual meshes - cur = (int)pData; + cur = (size_t)pData; for (m = 0; m < pmodel[i].nummeshes; m++) { int numflexkeys[MAXSTUDIOFLEXKEYS]; @@ -2581,9 +2583,9 @@ static void WriteModel( studiohdr_t *phdr ) if( !g_quiet ) { - printf("flexes %7d bytes (%d flexes)\n", (int)(pData - cur), g_numflexkeys ); + printf("flexes %7d bytes (%d flexes)\n", (size_t)(pData - cur), g_numflexkeys ); } - cur = (int)pData; + cur = (size_t)pData; } @@ -3188,7 +3190,7 @@ typedef struct lodMeshInfo_t lodMeshInfo; } vertexPool_t; -#define ALIGN(b,s) (((unsigned int)(b)+(s)-1)&~((s)-1)) +#define ALIGN(b,s) (((size_t)(b)+(s)-1)&~((s)-1)) //----------------------------------------------------------------------------- // FindVertexOffsets @@ -4583,4 +4585,4 @@ void WriteAllSwappedFiles( const char *filename ) Q_strcat( outname, ".360.mdl", sizeof( outname ) ); WriteSwappedFile( srcname, outname, StudioByteSwap::ByteswapMDL ); -} \ No newline at end of file +} diff --git a/utils/studiomdl/wscript b/utils/studiomdl/wscript new file mode 100644 index 00000000..c8d10d35 --- /dev/null +++ b/utils/studiomdl/wscript @@ -0,0 +1,93 @@ +#! /usr/bin/env python +# encoding: utf-8 +# vim: noexpandtab + +from waflib import Utils +import os + +top = '.' +PROJECT_NAME = 'studiomdl' + +def options(opt): + # stub + return + +def configure(conf): + conf.define('PROTECTED_THINGS_DISABLE', 1) + return + +def build(bld): + source = [ + 'UnifyLODs.cpp', + 'checkuv.cpp', + 'collisionmodel.cpp', + 'dmxsupport.cpp', + 'hardwarematrixstate.cpp', + 'hardwarevertexcache.cpp', + 'mrmsupport.cpp', + 'objsupport.cpp', + 'optimize.cpp', + 'perfstats.cpp', + 'simplify.cpp', + 'studiomdl.cpp', + 'v1support.cpp', + 'write.cpp', + '../common/cmdlib.cpp', + '../common/filesystem_tools.cpp', + '../common/physdll.cpp', + '../common/scriplib.cpp', + '../../filesystem/linux_support.cpp', + '../../public/filesystem_helpers.cpp', + '../../public/filesystem_init.cpp', + '../../public/bone_setup.cpp', + '../../public/collisionutils.cpp', + '../../public/interpolatortypes.cpp', + '../../public/mdlobjects/mdlobjects.cpp', + '../../public/movieobjects/movieobjects_compiletools.cpp', + '../../public/studio.cpp', + '../../common/studiobyteswap.cpp', + ] + + includes = [ + '.', + '../common', + '../../public', + '../../public/tier0', + '../../public/tier1', + '../../public/tier2', + '../../public/tier3', + '../../public/vstdlib', + ] + + defines = [] + + libs = [ + 'tier0', 'tier1', 'tier2', 'tier3', + 'appframework', + 'datamodel', + 'dmserializers', + 'mathlib', + 'mdlobjects', + 'movieobjects', +# 'nvtristrip', + 'vstdlib', + ] + + if bld.env.DEST_OS == 'win32': + libs += ['USER32'] + + install_path = bld.env.BINDIR + + bld( + source = source, + target = PROJECT_NAME, + name = PROJECT_NAME, + features = 'c cxx cxxprogram', + includes = includes, + defines = defines, + use = libs, + install_path = install_path, + subsystem = bld.env.MSVC_SUBSYSTEM, + idx = bld.get_taskgen_count() + ) + diff --git a/waf b/waf index b2f4c6f4..f754d112 100755 --- a/waf +++ b/waf @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding: latin-1 # Thomas Nagy, 2005-2018 # diff --git a/wscript b/wscript index 2ec9ec50..ddf8b9f3 100644 --- a/wscript +++ b/wscript @@ -123,6 +123,8 @@ projects={ 'fgdlib', 'raytrace', 'vphysics', + 'movieobjects', +# 'hammer_launcher', 'ivp/havana', 'ivp/havana/havok/hk_base', 'ivp/havana/havok/hk_math', @@ -131,17 +133,18 @@ projects={ 'materialsystem', 'materialsystem/shaderapiempty', 'materialsystem/shaderlib', - 'utils/vtex', - 'utils/lzma', 'utils/bsppack', + 'utils/lzma', +# 'utils/studiomdl', + 'utils/vbsp', 'utils/vbspinfo', - 'utils/xbox/xbspinfo', - 'utils/vvis', - 'utils/vvis_launcher', + 'utils/vpk', 'utils/vrad', 'utils/vrad_launcher', - 'utils/vbsp', - 'utils/vpk', + 'utils/vtex', + 'utils/vvis', + 'utils/vvis_launcher', + 'utils/xbox/xbspinfo', ], }