Moved modified HL SDK to trunk
This commit is contained in:
108
hlsdk/utils/studiomdl/bmpread.c
Normal file
108
hlsdk/utils/studiomdl/bmpread.c
Normal file
@ -0,0 +1,108 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
****/
|
||||
|
||||
#if defined _MSC_VER && _MSC_VER >= 1400
|
||||
#ifndef _CRT_SECURE_NO_DEPRECATE
|
||||
#define _CRT_SECURE_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#pragma warning(disable: 4996) // deprecated functions
|
||||
#endif
|
||||
|
||||
|
||||
#include <windows.h>
|
||||
#include <STDIO.H>
|
||||
|
||||
|
||||
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 = malloc(cbBmpBits);
|
||||
if (fread(pbBmpBits, cbBmpBits, 1/*count*/, pfile) != 1)
|
||||
{ rc = -7; goto GetOut; }
|
||||
|
||||
// Set output parameters
|
||||
*ppbPalette = 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;
|
||||
}
|
||||
|
156
hlsdk/utils/studiomdl/msvc6/studiomdl.dsp
Normal file
156
hlsdk/utils/studiomdl/msvc6/studiomdl.dsp
Normal file
@ -0,0 +1,156 @@
|
||||
# Microsoft Developer Studio Project File - Name="studiomdl" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Console Application" 0x0103
|
||||
|
||||
CFG=studiomdl - Win32 Release
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "studiomdl.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "studiomdl.mak" CFG="studiomdl - Win32 Release"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "studiomdl - Win32 Release" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE "studiomdl - Win32 Debug" (based on "Win32 (x86) Console Application")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/SDKSrc/Tools/utils/studiomdl", IVGBAAAA"
|
||||
# PROP Scc_LocalPath "."
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "studiomdl - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir ".\Release"
|
||||
# PROP BASE Intermediate_Dir ".\Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir ".\Release"
|
||||
# PROP Intermediate_Dir ".\Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\common" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386
|
||||
|
||||
!ELSEIF "$(CFG)" == "studiomdl - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir ".\Debug"
|
||||
# PROP BASE Intermediate_Dir ".\Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir ".\Debug"
|
||||
# PROP Intermediate_Dir ".\Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\..\common" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LINK32=link.exe
|
||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386
|
||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "studiomdl - Win32 Release"
|
||||
# Name "studiomdl - Win32 Debug"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\bmpread.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\cmdlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\lbmlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\mathlib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\scriplib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\studiomdl.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\trilib.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\tristrip.c
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\write.c
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
# PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\cmdlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\lbmlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\mathlib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\scriplib.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\studiomdl.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\common\trilib.h
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Resource Files"
|
||||
|
||||
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
37
hlsdk/utils/studiomdl/msvc6/studiomdl.dsw
Normal file
37
hlsdk/utils/studiomdl/msvc6/studiomdl.dsw
Normal file
@ -0,0 +1,37 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "studiomdl"=.\studiomdl.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
"$/SDKSrc/Tools/utils/studiomdl", IVGBAAAA
|
||||
.
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
begin source code control
|
||||
"$/SDKSrc/Tools/utils/studiomdl", IVGBAAAA
|
||||
.
|
||||
end source code control
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
359
hlsdk/utils/studiomdl/msvc7/studiomdl.vcproj
Normal file
359
hlsdk/utils/studiomdl/msvc7/studiomdl.vcproj
Normal file
@ -0,0 +1,359 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="7.10"
|
||||
Name="studiomdl"
|
||||
ProjectGUID="{80D0DE38-DF1C-44BF-A7B8-4BAC84937B88}"
|
||||
SccProjectName=""$/SDKSrc/Tools/utils/studiomdl", IVGBAAAA"
|
||||
SccLocalPath=".">
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"/>
|
||||
</Platforms>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\common"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="TRUE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="TRUE"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Release/studiomdl.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/studiomdl.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
ProgramDatabaseFile=".\Release/studiomdl.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/studiomdl.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="FALSE">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\common"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
PrecompiledHeaderFile=".\Debug/studiomdl.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="TRUE"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/studiomdl.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
GenerateDebugInformation="TRUE"
|
||||
ProgramDatabaseFile=".\Debug/studiomdl.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/studiomdl.tlb"
|
||||
HeaderFileName=""/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"/>
|
||||
<Tool
|
||||
Name="VCManagedWrapperGeneratorTool"/>
|
||||
<Tool
|
||||
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90">
|
||||
<File
|
||||
RelativePath="..\bmpread.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\cmdlib.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\lbmlib.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\mathlib.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\scriplib.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\studiomdl.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\trilib.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\tristrip.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\write.c">
|
||||
<FileConfiguration
|
||||
Name="Release|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32">
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;fi;fd">
|
||||
<File
|
||||
RelativePath="..\..\common\cmdlib.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\lbmlib.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\mathlib.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\scriplib.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\studiomdl.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\trilib.h">
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe">
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
475
hlsdk/utils/studiomdl/msvc8/studiomdl.vcproj
Normal file
475
hlsdk/utils/studiomdl/msvc8/studiomdl.vcproj
Normal file
@ -0,0 +1,475 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="studiomdl"
|
||||
ProjectGUID="{80D0DE38-DF1C-44BF-A7B8-4BAC84937B88}"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory=".\Release"
|
||||
IntermediateDirectory=".\Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Release/studiomdl.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="..\..\common"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\Release/studiomdl.pch"
|
||||
AssemblerListingLocation=".\Release/"
|
||||
ObjectFile=".\Release/"
|
||||
ProgramDataBaseFileName=".\Release/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Release/studiomdl.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
ProgramDatabaseFile=".\Release/studiomdl.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory=".\Debug"
|
||||
IntermediateDirectory=".\Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||
UseOfMFC="0"
|
||||
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TypeLibraryName=".\Debug/studiomdl.tlb"
|
||||
HeaderFileName=""
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\common"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="0"
|
||||
PrecompiledHeaderFile=".\Debug/studiomdl.pch"
|
||||
AssemblerListingLocation=".\Debug/"
|
||||
ObjectFile=".\Debug/"
|
||||
ProgramDataBaseFileName=".\Debug/"
|
||||
BrowseInformation="1"
|
||||
WarningLevel="3"
|
||||
SuppressStartupBanner="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG"
|
||||
Culture="1033"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile=".\Debug/studiomdl.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="true"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile=".\Debug/studiomdl.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\bmpread.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\cmdlib.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\lbmlib.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\mathlib.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\scriplib.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\studiomdl.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\trilib.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\tristrip.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\write.c"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Release|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Win32"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""
|
||||
PreprocessorDefinitions=""
|
||||
BrowseInformation="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;fi;fd"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\common\cmdlib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\lbmlib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\mathlib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\scriplib.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\studiomdl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\common\trilib.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
3379
hlsdk/utils/studiomdl/studiomdl.c
Normal file
3379
hlsdk/utils/studiomdl/studiomdl.c
Normal file
File diff suppressed because it is too large
Load Diff
403
hlsdk/utils/studiomdl/studiomdl.h
Normal file
403
hlsdk/utils/studiomdl/studiomdl.h
Normal file
@ -0,0 +1,403 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
****/
|
||||
|
||||
/*
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#define STUDIO_VERSION 10
|
||||
|
||||
#define IDSTUDIOHEADER (('T'<<24)+('S'<<16)+('D'<<8)+'I')
|
||||
// little-endian "IDST"
|
||||
#define IDSTUDIOSEQHEADER (('Q'<<24)+('S'<<16)+('D'<<8)+'I')
|
||||
// little-endian "IDSQ"
|
||||
|
||||
#ifndef EXTERN
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
EXTERN char outname[1024];
|
||||
EXTERN qboolean cdset;
|
||||
EXTERN char cdpartial[256];
|
||||
EXTERN char cddir[256];
|
||||
EXTERN int cdtextureset;
|
||||
EXTERN char cdtexture[16][256];
|
||||
|
||||
EXTERN char pivotname[32][256]; // names of the pivot points
|
||||
|
||||
EXTERN float default_scale;
|
||||
EXTERN float scale_up;
|
||||
EXTERN float defaultzrotation;
|
||||
EXTERN float zrotation;
|
||||
|
||||
|
||||
EXTERN char defaulttexture[16][256];
|
||||
EXTERN char sourcetexture[16][256];
|
||||
|
||||
EXTERN int numrep;
|
||||
|
||||
EXTERN int tag_reversed;
|
||||
EXTERN int tag_normals;
|
||||
EXTERN int flip_triangles;
|
||||
EXTERN float normal_blend;
|
||||
EXTERN int dump_hboxes;
|
||||
EXTERN int ignore_warnings;
|
||||
|
||||
EXTERN vec3_t eyeposition;
|
||||
EXTERN int gflags;
|
||||
EXTERN vec3_t bbox[2];
|
||||
EXTERN vec3_t cbox[2];
|
||||
|
||||
EXTERN int maxseqgroupsize;
|
||||
|
||||
EXTERN int split_textures;
|
||||
EXTERN int clip_texcoords;
|
||||
|
||||
#define ROLL 2
|
||||
#define PITCH 0
|
||||
#define YAW 1
|
||||
|
||||
|
||||
extern vec_t Q_rint (vec_t in);
|
||||
|
||||
extern void WriteFile (void);
|
||||
void *kalloc( int num, int size );
|
||||
|
||||
typedef struct {
|
||||
int vertindex;
|
||||
int normindex; // index into normal array
|
||||
int s,t;
|
||||
float u,v;
|
||||
} s_trianglevert_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int bone; // bone transformation index
|
||||
vec3_t org; // original position
|
||||
} s_vertex_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int skinref;
|
||||
int bone; // bone transformation index
|
||||
vec3_t org; // original position
|
||||
} s_normal_t;
|
||||
|
||||
|
||||
//============================================================================
|
||||
|
||||
|
||||
// dstudiobone_t bone[MAXSTUDIOBONES];
|
||||
typedef struct
|
||||
{
|
||||
vec3_t worldorg;
|
||||
float m[3][4];
|
||||
float im[3][4];
|
||||
float length;
|
||||
} s_bonefixup_t;
|
||||
EXTERN s_bonefixup_t bonefixup[MAXSTUDIOSRCBONES];
|
||||
|
||||
int numbones;
|
||||
typedef struct
|
||||
{
|
||||
char name[32]; // bone name for symbolic links
|
||||
int parent; // parent bone
|
||||
int bonecontroller; // -1 == 0
|
||||
int flags; // X, Y, Z, XR, YR, ZR
|
||||
// short value[6]; // default DoF values
|
||||
vec3_t pos; // default pos
|
||||
vec3_t posscale; // pos values scale
|
||||
vec3_t rot; // default pos
|
||||
vec3_t rotscale; // rotation values scale
|
||||
int group; // hitgroup
|
||||
vec3_t bmin, bmax; // bounding box
|
||||
} s_bonetable_t;
|
||||
EXTERN s_bonetable_t bonetable[MAXSTUDIOSRCBONES];
|
||||
|
||||
int numrenamedbones;
|
||||
typedef struct
|
||||
{
|
||||
char from[32];
|
||||
char to[32];
|
||||
} s_renamebone_t;
|
||||
EXTERN s_renamebone_t renamedbone[MAXSTUDIOSRCBONES];
|
||||
|
||||
int numhitboxes;
|
||||
typedef struct
|
||||
{
|
||||
char name[32]; // bone name
|
||||
int bone;
|
||||
int group; // hitgroup
|
||||
int model;
|
||||
vec3_t bmin, bmax; // bounding box
|
||||
} s_bbox_t;
|
||||
EXTERN s_bbox_t hitbox[MAXSTUDIOSRCBONES];
|
||||
|
||||
int numhitgroups;
|
||||
typedef struct
|
||||
{
|
||||
int models;
|
||||
int group;
|
||||
char name[32]; // bone name
|
||||
} s_hitgroup_t;
|
||||
EXTERN s_hitgroup_t hitgroup[MAXSTUDIOSRCBONES];
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[32];
|
||||
int bone;
|
||||
int type;
|
||||
int index;
|
||||
float start;
|
||||
float end;
|
||||
} s_bonecontroller_t;
|
||||
|
||||
s_bonecontroller_t bonecontroller[MAXSTUDIOSRCBONES];
|
||||
int numbonecontrollers;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[32];
|
||||
char bonename[32];
|
||||
int index;
|
||||
int bone;
|
||||
int type;
|
||||
vec3_t org;
|
||||
} s_attachment_t;
|
||||
|
||||
s_attachment_t attachment[MAXSTUDIOSRCBONES];
|
||||
int numattachments;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[64];
|
||||
int parent;
|
||||
int mirrored;
|
||||
} s_node_t;
|
||||
|
||||
EXTERN char mirrored[MAXSTUDIOSRCBONES][64];
|
||||
EXTERN int nummirrored;
|
||||
|
||||
EXTERN int numani;
|
||||
typedef struct
|
||||
{
|
||||
char name[64];
|
||||
int startframe;
|
||||
int endframe;
|
||||
int flags;
|
||||
int numbones;
|
||||
s_node_t node[MAXSTUDIOSRCBONES];
|
||||
int bonemap[MAXSTUDIOSRCBONES];
|
||||
int boneimap[MAXSTUDIOSRCBONES];
|
||||
vec3_t *pos[MAXSTUDIOSRCBONES];
|
||||
vec3_t *rot[MAXSTUDIOSRCBONES];
|
||||
int numanim[MAXSTUDIOSRCBONES][6];
|
||||
mstudioanimvalue_t *anim[MAXSTUDIOSRCBONES][6];
|
||||
} s_animation_t;
|
||||
EXTERN s_animation_t *panimation[MAXSTUDIOANIMATIONS];
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int event;
|
||||
int frame;
|
||||
char options[64];
|
||||
} s_event_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int index;
|
||||
vec3_t org;
|
||||
int start;
|
||||
int end;
|
||||
} s_pivot_t;
|
||||
|
||||
EXTERN int numseq;
|
||||
typedef struct
|
||||
{
|
||||
int motiontype;
|
||||
vec3_t linearmovement;
|
||||
|
||||
char name[64];
|
||||
int flags;
|
||||
float fps;
|
||||
int numframes;
|
||||
|
||||
int activity;
|
||||
int actweight;
|
||||
|
||||
int frameoffset; // used to adjust frame numbers
|
||||
|
||||
int numevents;
|
||||
s_event_t event[MAXSTUDIOEVENTS];
|
||||
|
||||
int numpivots;
|
||||
s_pivot_t pivot[MAXSTUDIOPIVOTS];
|
||||
|
||||
int numblends;
|
||||
s_animation_t *panim[MAXSTUDIOGROUPS];
|
||||
float blendtype[2];
|
||||
float blendstart[2];
|
||||
float blendend[2];
|
||||
|
||||
vec3_t automovepos[MAXSTUDIOANIMATIONS];
|
||||
vec3_t automoveangle[MAXSTUDIOANIMATIONS];
|
||||
|
||||
int seqgroup;
|
||||
int animindex;
|
||||
|
||||
vec3_t bmin;
|
||||
vec3_t bmax;
|
||||
|
||||
int entrynode;
|
||||
int exitnode;
|
||||
int nodeflags;
|
||||
} s_sequence_t;
|
||||
EXTERN s_sequence_t sequence[MAXSTUDIOSEQUENCES];
|
||||
|
||||
|
||||
EXTERN int numseqgroups;
|
||||
typedef struct {
|
||||
char label[32];
|
||||
char name[64];
|
||||
} s_sequencegroup_t;
|
||||
EXTERN s_sequencegroup_t sequencegroup[MAXSTUDIOSEQUENCES];
|
||||
|
||||
EXTERN int numxnodes;
|
||||
EXTERN int xnode[100][100];
|
||||
|
||||
typedef struct {
|
||||
byte r, g, b;
|
||||
} rgb_t;
|
||||
typedef struct {
|
||||
byte b, g, r, x;
|
||||
} rgb2_t;
|
||||
|
||||
// FIXME: what about texture overrides inline with loading models
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[64];
|
||||
int flags;
|
||||
int srcwidth;
|
||||
int srcheight;
|
||||
byte *ppicture;
|
||||
rgb_t *ppal;
|
||||
|
||||
float max_s;
|
||||
float min_s;
|
||||
float max_t;
|
||||
float min_t;
|
||||
int skintop;
|
||||
int skinleft;
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
float fskintop;
|
||||
float fskinleft;
|
||||
float fskinwidth;
|
||||
float fskinheight;
|
||||
|
||||
int size;
|
||||
void *pdata;
|
||||
|
||||
int parent;
|
||||
} s_texture_t;
|
||||
EXTERN s_texture_t texture[MAXSTUDIOSKINS];
|
||||
EXTERN int numtextures;
|
||||
EXTERN float gamma;
|
||||
EXTERN int numskinref;
|
||||
EXTERN int numskinfamilies;
|
||||
EXTERN int skinref[256][MAXSTUDIOSKINS]; // [skin][skinref], returns texture index
|
||||
EXTERN int numtexturegroups;
|
||||
EXTERN int numtexturelayers[32];
|
||||
EXTERN int numtexturereps[32];
|
||||
EXTERN int texturegroup[32][32][32];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int alloctris;
|
||||
int numtris;
|
||||
s_trianglevert_t (*triangle)[3];
|
||||
|
||||
int skinref;
|
||||
int numnorms;
|
||||
} s_mesh_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
vec3_t pos;
|
||||
vec3_t rot;
|
||||
} s_bone_t;
|
||||
|
||||
|
||||
typedef struct s_model_s
|
||||
{
|
||||
char name[64];
|
||||
|
||||
int numbones;
|
||||
s_node_t node[MAXSTUDIOSRCBONES];
|
||||
s_bone_t skeleton[MAXSTUDIOSRCBONES];
|
||||
int boneref[MAXSTUDIOSRCBONES]; // is local bone (or child) referenced with a vertex
|
||||
int bonemap[MAXSTUDIOSRCBONES]; // local bone to world bone mapping
|
||||
int boneimap[MAXSTUDIOSRCBONES]; // world bone to local bone mapping
|
||||
|
||||
vec3_t boundingbox[MAXSTUDIOSRCBONES][2];
|
||||
|
||||
s_mesh_t *trimesh[MAXSTUDIOTRIANGLES];
|
||||
int trimap[MAXSTUDIOTRIANGLES];
|
||||
|
||||
int numverts;
|
||||
s_vertex_t vert[MAXSTUDIOVERTS];
|
||||
|
||||
int numnorms;
|
||||
s_normal_t normal[MAXSTUDIOVERTS];
|
||||
|
||||
int nummesh;
|
||||
s_mesh_t *pmesh[MAXSTUDIOMESHES];
|
||||
|
||||
float boundingradius;
|
||||
|
||||
int numframes;
|
||||
float interval;
|
||||
struct s_model_s *next;
|
||||
} s_model_t;
|
||||
|
||||
EXTERN int nummodels;
|
||||
EXTERN s_model_t *model[MAXSTUDIOMODELS];
|
||||
|
||||
|
||||
|
||||
EXTERN vec3_t adjust;
|
||||
EXTERN vec3_t defaultadjust;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char name[32];
|
||||
int nummodels;
|
||||
int base;
|
||||
s_model_t *pmodel[MAXSTUDIOMODELS];
|
||||
} s_bodypart_t;
|
||||
|
||||
EXTERN int numbodyparts;
|
||||
EXTERN s_bodypart_t bodypart[MAXSTUDIOBODYPARTS];
|
||||
|
||||
|
||||
extern int BuildTris (s_trianglevert_t (*x)[3], s_mesh_t *y, byte **ppdata );
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
352
hlsdk/utils/studiomdl/tristrip.c
Normal file
352
hlsdk/utils/studiomdl/tristrip.c
Normal file
@ -0,0 +1,352 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
****/
|
||||
|
||||
// tristrip - convert triangle list into tristrips and fans
|
||||
|
||||
#pragma warning( disable : 4244 )
|
||||
#pragma warning( disable : 4237 )
|
||||
#pragma warning( disable : 4305 )
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "cmdlib.h"
|
||||
#include "lbmlib.h"
|
||||
#include "scriplib.h"
|
||||
#include "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] ; j<pmesh->numtris ; 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 ; j<pmesh->numtris ; 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 ; j<pmesh->numtris ; 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 ; i<pmesh->numtris ; 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 ; i<pmesh->numtris; 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 ; i<pmesh->numtris ;)
|
||||
{
|
||||
// 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<bestlen ; j++)
|
||||
{
|
||||
besttris[j] = striptris[j];
|
||||
bestverts[j] = stripverts[j];
|
||||
}
|
||||
// printf("%d %d\n", k, bestlen );
|
||||
}
|
||||
if (len > 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 ; j<bestlen ; j++)
|
||||
used[besttris[j]] = 1;
|
||||
|
||||
if (besttype == 1)
|
||||
commands[numcommands++] = -bestlen;
|
||||
else
|
||||
commands[numcommands++] = bestlen;
|
||||
|
||||
for (j=0 ; j<bestlen ; j++)
|
||||
{
|
||||
s_trianglevert_t *tri;
|
||||
|
||||
tri = &triangles[besttris[j]][bestverts[j]];
|
||||
|
||||
commands[numcommands++] = tri->vertindex;
|
||||
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 );
|
||||
}
|
||||
|
649
hlsdk/utils/studiomdl/write.c
Normal file
649
hlsdk/utils/studiomdl/write.c
Normal file
@ -0,0 +1,649 @@
|
||||
/***
|
||||
*
|
||||
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
|
||||
*
|
||||
* This product contains software technology licensed from Id
|
||||
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
****/
|
||||
|
||||
//
|
||||
// write.c: writes a studio .mdl file
|
||||
//
|
||||
|
||||
|
||||
|
||||
#pragma warning( disable : 4244 )
|
||||
#pragma warning( disable : 4237 )
|
||||
#pragma warning( disable : 4305 )
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "cmdlib.h"
|
||||
#include "lbmlib.h"
|
||||
#include "scriplib.h"
|
||||
#include "mathlib.h"
|
||||
#include "..\..\engine\studio.h"
|
||||
#include "studiomdl.h"
|
||||
|
||||
|
||||
int totalframes = 0;
|
||||
float totalseconds = 0;
|
||||
extern int numcommandnodes;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
============
|
||||
WriteModel
|
||||
============
|
||||
*/
|
||||
byte *pData;
|
||||
byte *pStart;
|
||||
studiohdr_t *phdr;
|
||||
studioseqhdr_t *pseqhdr;
|
||||
|
||||
#define ALIGN( a ) a = (byte *)((int)((byte *)a + 3) & ~ 3)
|
||||
void WriteBoneInfo( )
|
||||
{
|
||||
int i, j;
|
||||
mstudiobone_t *pbone;
|
||||
mstudiobonecontroller_t *pbonecontroller;
|
||||
mstudioattachment_t *pattachment;
|
||||
mstudiobbox_t *pbbox;
|
||||
|
||||
// save bone info
|
||||
pbone = (mstudiobone_t *)pData;
|
||||
phdr->numbones = numbones;
|
||||
phdr->boneindex = (pData - pStart);
|
||||
|
||||
for (i = 0; i < numbones; i++)
|
||||
{
|
||||
strcpy( pbone[i].name, bonetable[i].name );
|
||||
pbone[i].parent = bonetable[i].parent;
|
||||
pbone[i].flags = bonetable[i].flags;
|
||||
pbone[i].value[0] = bonetable[i].pos[0];
|
||||
pbone[i].value[1] = bonetable[i].pos[1];
|
||||
pbone[i].value[2] = bonetable[i].pos[2];
|
||||
pbone[i].value[3] = bonetable[i].rot[0];
|
||||
pbone[i].value[4] = bonetable[i].rot[1];
|
||||
pbone[i].value[5] = bonetable[i].rot[2];
|
||||
pbone[i].scale[0] = bonetable[i].posscale[0];
|
||||
pbone[i].scale[1] = bonetable[i].posscale[1];
|
||||
pbone[i].scale[2] = bonetable[i].posscale[2];
|
||||
pbone[i].scale[3] = bonetable[i].rotscale[0];
|
||||
pbone[i].scale[4] = bonetable[i].rotscale[1];
|
||||
pbone[i].scale[5] = bonetable[i].rotscale[2];
|
||||
}
|
||||
pData += numbones * sizeof( mstudiobone_t );
|
||||
ALIGN( pData );
|
||||
|
||||
// map bonecontroller to bones
|
||||
for (i = 0; i < numbones; i++) {
|
||||
for (j = 0; j < 6; j++) {
|
||||
pbone[i].bonecontroller[j] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < numbonecontrollers; i++) {
|
||||
j = bonecontroller[i].bone;
|
||||
switch( bonecontroller[i].type & STUDIO_TYPES )
|
||||
{
|
||||
case STUDIO_X:
|
||||
pbone[j].bonecontroller[0] = i;
|
||||
break;
|
||||
case STUDIO_Y:
|
||||
pbone[j].bonecontroller[1] = i;
|
||||
break;
|
||||
case STUDIO_Z:
|
||||
pbone[j].bonecontroller[2] = i;
|
||||
break;
|
||||
case STUDIO_XR:
|
||||
pbone[j].bonecontroller[3] = i;
|
||||
break;
|
||||
case STUDIO_YR:
|
||||
pbone[j].bonecontroller[4] = i;
|
||||
break;
|
||||
case STUDIO_ZR:
|
||||
pbone[j].bonecontroller[5] = i;
|
||||
break;
|
||||
default:
|
||||
printf("unknown bonecontroller type\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// save bonecontroller info
|
||||
pbonecontroller = (mstudiobonecontroller_t *)pData;
|
||||
phdr->numbonecontrollers = numbonecontrollers;
|
||||
phdr->bonecontrollerindex = (pData - pStart);
|
||||
|
||||
for (i = 0; i < numbonecontrollers; i++) {
|
||||
pbonecontroller[i].bone = bonecontroller[i].bone;
|
||||
pbonecontroller[i].index = bonecontroller[i].index;
|
||||
pbonecontroller[i].type = bonecontroller[i].type;
|
||||
pbonecontroller[i].start = bonecontroller[i].start;
|
||||
pbonecontroller[i].end = bonecontroller[i].end;
|
||||
}
|
||||
pData += numbonecontrollers * sizeof( mstudiobonecontroller_t );
|
||||
ALIGN( pData );
|
||||
|
||||
// save attachment info
|
||||
pattachment = (mstudioattachment_t *)pData;
|
||||
phdr->numattachments = numattachments;
|
||||
phdr->attachmentindex = (pData - pStart);
|
||||
|
||||
for (i = 0; i < numattachments; i++) {
|
||||
pattachment[i].bone = attachment[i].bone;
|
||||
VectorCopy( attachment[i].org, pattachment[i].org );
|
||||
}
|
||||
pData += numattachments * sizeof( mstudioattachment_t );
|
||||
ALIGN( pData );
|
||||
|
||||
|
||||
// save bbox info
|
||||
pbbox = (mstudiobbox_t *)pData;
|
||||
phdr->numhitboxes = numhitboxes;
|
||||
phdr->hitboxindex = (pData - pStart);
|
||||
|
||||
for (i = 0; i < numhitboxes; i++) {
|
||||
pbbox[i].bone = hitbox[i].bone;
|
||||
pbbox[i].group = hitbox[i].group;
|
||||
VectorCopy( hitbox[i].bmin, pbbox[i].bbmin );
|
||||
VectorCopy( hitbox[i].bmax, pbbox[i].bbmax );
|
||||
}
|
||||
pData += numhitboxes * sizeof( mstudiobbox_t );
|
||||
ALIGN( pData );
|
||||
|
||||
}
|
||||
|
||||
|
||||
void WriteSequenceInfo( )
|
||||
{
|
||||
int i, j;
|
||||
|
||||
mstudioseqgroup_t *pseqgroup;
|
||||
mstudioseqdesc_t *pseqdesc;
|
||||
mstudioseqdesc_t *pbaseseqdesc;
|
||||
mstudioevent_t *pevent;
|
||||
mstudiopivot_t *ppivot;
|
||||
byte *ptransition;
|
||||
|
||||
// save sequence info
|
||||
pseqdesc = (mstudioseqdesc_t *)pData;
|
||||
pbaseseqdesc = pseqdesc;
|
||||
phdr->numseq = numseq;
|
||||
phdr->seqindex = (pData - pStart);
|
||||
pData += numseq * sizeof( mstudioseqdesc_t );
|
||||
|
||||
for (i = 0; i < numseq; i++, pseqdesc++)
|
||||
{
|
||||
strcpy( pseqdesc->label, sequence[i].name );
|
||||
pseqdesc->numframes = sequence[i].numframes;
|
||||
pseqdesc->fps = sequence[i].fps;
|
||||
pseqdesc->flags = sequence[i].flags;
|
||||
|
||||
pseqdesc->numblends = sequence[i].numblends;
|
||||
|
||||
pseqdesc->blendtype[0] = sequence[i].blendtype[0];
|
||||
pseqdesc->blendtype[1] = sequence[i].blendtype[1];
|
||||
pseqdesc->blendstart[0] = sequence[i].blendstart[0];
|
||||
pseqdesc->blendend[0] = sequence[i].blendend[0];
|
||||
pseqdesc->blendstart[1] = sequence[i].blendstart[1];
|
||||
pseqdesc->blendend[1] = sequence[i].blendend[1];
|
||||
|
||||
pseqdesc->motiontype = sequence[i].motiontype;
|
||||
pseqdesc->motionbone = 0; // sequence[i].motionbone;
|
||||
VectorCopy( sequence[i].linearmovement, pseqdesc->linearmovement );
|
||||
|
||||
pseqdesc->seqgroup = sequence[i].seqgroup;
|
||||
|
||||
pseqdesc->animindex = sequence[i].animindex;
|
||||
|
||||
pseqdesc->activity = sequence[i].activity;
|
||||
pseqdesc->actweight = sequence[i].actweight;
|
||||
|
||||
VectorCopy( sequence[i].bmin, pseqdesc->bbmin );
|
||||
VectorCopy( sequence[i].bmax, pseqdesc->bbmax );
|
||||
|
||||
pseqdesc->entrynode = sequence[i].entrynode;
|
||||
pseqdesc->exitnode = sequence[i].exitnode;
|
||||
pseqdesc->nodeflags = sequence[i].nodeflags;
|
||||
|
||||
totalframes += sequence[i].numframes;
|
||||
totalseconds += sequence[i].numframes / sequence[i].fps;
|
||||
|
||||
// save events
|
||||
pevent = (mstudioevent_t *)pData;
|
||||
pseqdesc->numevents = sequence[i].numevents;
|
||||
pseqdesc->eventindex = (pData - pStart);
|
||||
pData += pseqdesc->numevents * sizeof( mstudioevent_t );
|
||||
for (j = 0; j < sequence[i].numevents; j++)
|
||||
{
|
||||
pevent[j].frame = sequence[i].event[j].frame - sequence[i].frameoffset;
|
||||
pevent[j].event = sequence[i].event[j].event;
|
||||
memcpy( pevent[j].options, sequence[i].event[j].options, sizeof( pevent[j].options ) );
|
||||
}
|
||||
ALIGN( pData );
|
||||
|
||||
// save pivots
|
||||
ppivot = (mstudiopivot_t *)pData;
|
||||
pseqdesc->numpivots = sequence[i].numpivots;
|
||||
pseqdesc->pivotindex = (pData - pStart);
|
||||
pData += pseqdesc->numpivots * sizeof( mstudiopivot_t );
|
||||
for (j = 0; j < sequence[i].numpivots; j++)
|
||||
{
|
||||
VectorCopy( sequence[i].pivot[j].org, ppivot[j].org );
|
||||
ppivot[j].start = sequence[i].pivot[j].start - sequence[i].frameoffset;
|
||||
ppivot[j].end = sequence[i].pivot[j].end - sequence[i].frameoffset;
|
||||
}
|
||||
ALIGN( pData );
|
||||
}
|
||||
|
||||
// save sequence group info
|
||||
pseqgroup = (mstudioseqgroup_t *)pData;
|
||||
phdr->numseqgroups = numseqgroups;
|
||||
phdr->seqgroupindex = (pData - pStart);
|
||||
pData += phdr->numseqgroups * sizeof( mstudioseqgroup_t );
|
||||
ALIGN( pData );
|
||||
|
||||
for (i = 0; i < numseqgroups; i++)
|
||||
{
|
||||
strcpy( pseqgroup[i].label, sequencegroup[i].label );
|
||||
strcpy( pseqgroup[i].name, sequencegroup[i].name );
|
||||
}
|
||||
|
||||
// save transition graph
|
||||
ptransition = (byte *)pData;
|
||||
phdr->numtransitions = numxnodes;
|
||||
phdr->transitionindex = (pData - pStart);
|
||||
pData += numxnodes * numxnodes * sizeof( byte );
|
||||
ALIGN( pData );
|
||||
for (i = 0; i < numxnodes; i++)
|
||||
{
|
||||
for (j = 0; j < numxnodes; j++)
|
||||
{
|
||||
*ptransition++ = xnode[i][j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
byte *WriteAnimations( byte *pData, byte *pStart, int group )
|
||||
{
|
||||
int i, j, k;
|
||||
int q, n;
|
||||
|
||||
mstudioanim_t *panim;
|
||||
mstudioanimvalue_t *panimvalue;
|
||||
|
||||
// hack for seqgroup 0
|
||||
// pseqgroup->data = (pData - pStart);
|
||||
|
||||
for (i = 0; i < numseq; i++)
|
||||
{
|
||||
if (sequence[i].seqgroup == group)
|
||||
{
|
||||
// save animations
|
||||
panim = (mstudioanim_t *)pData;
|
||||
sequence[i].animindex = (pData - pStart);
|
||||
pData += sequence[i].numblends * numbones * sizeof( mstudioanim_t );
|
||||
ALIGN( pData );
|
||||
|
||||
panimvalue = (mstudioanimvalue_t *)pData;
|
||||
for (q = 0; q < sequence[i].numblends; q++)
|
||||
{
|
||||
// save animation value info
|
||||
for (j = 0; j < numbones; j++)
|
||||
{
|
||||
for (k = 0; k < 6; k++)
|
||||
{
|
||||
if (sequence[i].panim[q]->numanim[j][k] == 0)
|
||||
{
|
||||
panim->offset[k] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
panim->offset[k] = ((byte *)panimvalue - (byte *)panim);
|
||||
for (n = 0; n < sequence[i].panim[q]->numanim[j][k]; n++)
|
||||
{
|
||||
panimvalue->value = sequence[i].panim[q]->anim[j][k][n].value;
|
||||
panimvalue++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (((byte *)panimvalue - (byte *)panim) > 65535)
|
||||
Error("sequence \"%s\" is greate than 64K\n", sequence[i].name );
|
||||
panim++;
|
||||
}
|
||||
}
|
||||
|
||||
// printf("raw bone data %d : %s\n", (byte *)panimvalue - pData, sequence[i].name);
|
||||
pData = (byte *)panimvalue;
|
||||
ALIGN( pData );
|
||||
}
|
||||
}
|
||||
return pData;
|
||||
}
|
||||
|
||||
void WriteTextures( )
|
||||
{
|
||||
int i, j;
|
||||
mstudiotexture_t *ptexture;
|
||||
short *pref;
|
||||
|
||||
// save bone info
|
||||
ptexture = (mstudiotexture_t *)pData;
|
||||
phdr->numtextures = numtextures;
|
||||
phdr->textureindex = (pData - pStart);
|
||||
pData += numtextures * sizeof( mstudiotexture_t );
|
||||
ALIGN( pData );
|
||||
|
||||
phdr->skinindex = (pData - pStart);
|
||||
phdr->numskinref = numskinref;
|
||||
phdr->numskinfamilies = numskinfamilies;
|
||||
pref = (short *)pData;
|
||||
|
||||
for (i = 0; i < phdr->numskinfamilies; i++)
|
||||
{
|
||||
for (j = 0; j < phdr->numskinref; j++)
|
||||
{
|
||||
*pref = skinref[i][j];
|
||||
pref++;
|
||||
}
|
||||
}
|
||||
pData = (byte *)pref;
|
||||
ALIGN( pData );
|
||||
|
||||
phdr->texturedataindex = (pData - pStart); // must be the end of the file!
|
||||
|
||||
for (i = 0; i < numtextures; i++) {
|
||||
strcpy( ptexture[i].name, texture[i].name );
|
||||
ptexture[i].flags = texture[i].flags;
|
||||
ptexture[i].width = texture[i].skinwidth;
|
||||
ptexture[i].height = texture[i].skinheight;
|
||||
ptexture[i].index = (pData - pStart);
|
||||
memcpy( pData, texture[i].pdata, texture[i].size );
|
||||
pData += texture[i].size;
|
||||
}
|
||||
ALIGN( pData );
|
||||
}
|
||||
|
||||
|
||||
void WriteModel( )
|
||||
{
|
||||
int i, j, k;
|
||||
|
||||
mstudiobodyparts_t *pbodypart;
|
||||
mstudiomodel_t *pmodel;
|
||||
// vec3_t *bbox;
|
||||
byte *pbone;
|
||||
vec3_t *pvert;
|
||||
vec3_t *pnorm;
|
||||
mstudiomesh_t *pmesh;
|
||||
s_trianglevert_t *psrctri;
|
||||
int cur;
|
||||
int total_tris = 0;
|
||||
int total_strips = 0;
|
||||
|
||||
pbodypart = (mstudiobodyparts_t *)pData;
|
||||
phdr->numbodyparts = numbodyparts;
|
||||
phdr->bodypartindex = (pData - pStart);
|
||||
pData += numbodyparts * sizeof( mstudiobodyparts_t );
|
||||
|
||||
pmodel = (mstudiomodel_t *)pData;
|
||||
pData += nummodels * sizeof( mstudiomodel_t );
|
||||
|
||||
for (i = 0, j = 0; i < numbodyparts; i++)
|
||||
{
|
||||
strcpy( pbodypart[i].name, bodypart[i].name );
|
||||
pbodypart[i].nummodels = bodypart[i].nummodels;
|
||||
pbodypart[i].base = bodypart[i].base;
|
||||
pbodypart[i].modelindex = ((byte *)&pmodel[j]) - pStart;
|
||||
j += bodypart[i].nummodels;
|
||||
}
|
||||
ALIGN( pData );
|
||||
|
||||
cur = (int)pData;
|
||||
for (i = 0; i < nummodels; i++)
|
||||
{
|
||||
int normmap[MAXSTUDIOVERTS];
|
||||
int normimap[MAXSTUDIOVERTS];
|
||||
int n = 0;
|
||||
|
||||
strcpy( pmodel[i].name, model[i]->name );
|
||||
|
||||
// save bbox info
|
||||
|
||||
// remap normals to be sorted by skin reference
|
||||
for (j = 0; j < model[i]->nummesh; j++)
|
||||
{
|
||||
for (k = 0; k < model[i]->numnorms; k++)
|
||||
{
|
||||
if (model[i]->normal[k].skinref == model[i]->pmesh[j]->skinref)
|
||||
{
|
||||
normmap[k] = n;
|
||||
normimap[n] = k;
|
||||
n++;
|
||||
model[i]->pmesh[j]->numnorms++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// save vertice bones
|
||||
pbone = pData;
|
||||
pmodel[i].numverts = model[i]->numverts;
|
||||
pmodel[i].vertinfoindex = (pData - pStart);
|
||||
for (j = 0; j < pmodel[i].numverts; j++)
|
||||
{
|
||||
*pbone++ = model[i]->vert[j].bone;
|
||||
}
|
||||
ALIGN( pbone );
|
||||
|
||||
// save normal bones
|
||||
pmodel[i].numnorms = model[i]->numnorms;
|
||||
pmodel[i].norminfoindex = ((byte *)pbone - pStart);
|
||||
for (j = 0; j < pmodel[i].numnorms; j++)
|
||||
{
|
||||
*pbone++ = model[i]->normal[normimap[j]].bone;
|
||||
}
|
||||
ALIGN( pbone );
|
||||
|
||||
pData = pbone;
|
||||
|
||||
// save group info
|
||||
pvert = (vec3_t *)pData;
|
||||
pData += model[i]->numverts * sizeof( vec3_t );
|
||||
pmodel[i].vertindex = ((byte *)pvert - pStart);
|
||||
ALIGN( pData );
|
||||
|
||||
pnorm = (vec3_t *)pData;
|
||||
pData += model[i]->numnorms * sizeof( vec3_t );
|
||||
pmodel[i].normindex = ((byte *)pnorm - pStart);
|
||||
ALIGN( pData );
|
||||
|
||||
for (j = 0; j < model[i]->numverts; j++)
|
||||
{
|
||||
VectorCopy( model[i]->vert[j].org, pvert[j] );
|
||||
}
|
||||
|
||||
for (j = 0; j < model[i]->numnorms; j++)
|
||||
{
|
||||
VectorCopy( model[i]->normal[normimap[j]].org, pnorm[j] );
|
||||
}
|
||||
printf("vertices %6d bytes (%d vertices, %d normals)\n", pData - cur, model[i]->numverts, model[i]->numnorms);
|
||||
cur = (int)pData;
|
||||
|
||||
// save mesh info
|
||||
pmesh = (mstudiomesh_t *)pData;
|
||||
pmodel[i].nummesh = model[i]->nummesh;
|
||||
pmodel[i].meshindex = (pData - pStart);
|
||||
pData += pmodel[i].nummesh * sizeof( mstudiomesh_t );
|
||||
ALIGN( pData );
|
||||
|
||||
total_tris = 0;
|
||||
total_strips = 0;
|
||||
for (j = 0; j < model[i]->nummesh; j++)
|
||||
{
|
||||
int numCmdBytes;
|
||||
byte *pCmdSrc;
|
||||
|
||||
pmesh[j].numtris = model[i]->pmesh[j]->numtris;
|
||||
pmesh[j].skinref = model[i]->pmesh[j]->skinref;
|
||||
pmesh[j].numnorms = model[i]->pmesh[j]->numnorms;
|
||||
|
||||
psrctri = (s_trianglevert_t *)(model[i]->pmesh[j]->triangle);
|
||||
for (k = 0; k < pmesh[j].numtris * 3; k++)
|
||||
{
|
||||
psrctri->normindex = normmap[psrctri->normindex];
|
||||
psrctri++;
|
||||
}
|
||||
|
||||
numCmdBytes = BuildTris( model[i]->pmesh[j]->triangle, model[i]->pmesh[j], &pCmdSrc );
|
||||
|
||||
pmesh[j].triindex = (pData - pStart);
|
||||
memcpy( pData, pCmdSrc, numCmdBytes );
|
||||
pData += numCmdBytes;
|
||||
ALIGN( pData );
|
||||
total_tris += pmesh[j].numtris;
|
||||
total_strips += numcommandnodes;
|
||||
}
|
||||
printf("mesh %6d bytes (%d tris, %d strips)\n", pData - cur, total_tris, total_strips);
|
||||
cur = (int)pData;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#define FILEBUFFER (2 * 1024 * 1024)
|
||||
|
||||
|
||||
void WriteFile (void)
|
||||
{
|
||||
FILE *modelouthandle;
|
||||
int total = 0;
|
||||
int i;
|
||||
|
||||
pStart = kalloc( 1, FILEBUFFER );
|
||||
|
||||
StripExtension (outname);
|
||||
|
||||
for (i = 1; i < numseqgroups; i++)
|
||||
{
|
||||
// write the non-default sequence group data to separate files
|
||||
char groupname[128], localname[128];
|
||||
|
||||
sprintf( groupname, "%s%02d.mdl", outname, i );
|
||||
|
||||
printf ("writing %s:\n", groupname);
|
||||
modelouthandle = SafeOpenWrite (groupname);
|
||||
|
||||
pseqhdr = (studioseqhdr_t *)pStart;
|
||||
pseqhdr->id = IDSTUDIOSEQHEADER;
|
||||
pseqhdr->version = STUDIO_VERSION;
|
||||
|
||||
pData = pStart + sizeof( studioseqhdr_t );
|
||||
|
||||
pData = WriteAnimations( pData, pStart, i );
|
||||
|
||||
ExtractFileBase( groupname, localname );
|
||||
sprintf( sequencegroup[i].name, "models\\%s.mdl", localname );
|
||||
strcpy( pseqhdr->name, sequencegroup[i].name );
|
||||
pseqhdr->length = pData - pStart;
|
||||
|
||||
printf("total %6d\n", pseqhdr->length );
|
||||
|
||||
SafeWrite( modelouthandle, pStart, pseqhdr->length );
|
||||
|
||||
fclose (modelouthandle);
|
||||
memset( pStart, 0, pseqhdr->length );
|
||||
}
|
||||
|
||||
if (split_textures)
|
||||
{
|
||||
// write textures out to a separate file
|
||||
char texname[128];
|
||||
|
||||
sprintf( texname, "%sT.mdl", outname );
|
||||
|
||||
printf ("writing %s:\n", texname);
|
||||
modelouthandle = SafeOpenWrite (texname);
|
||||
|
||||
phdr = (studiohdr_t *)pStart;
|
||||
phdr->id = IDSTUDIOHEADER;
|
||||
phdr->version = STUDIO_VERSION;
|
||||
|
||||
pData = (byte *)phdr + sizeof( studiohdr_t );
|
||||
|
||||
WriteTextures( );
|
||||
|
||||
phdr->length = pData - pStart;
|
||||
printf("textures %6d bytes\n", phdr->length );
|
||||
|
||||
SafeWrite( modelouthandle, pStart, phdr->length );
|
||||
|
||||
fclose (modelouthandle);
|
||||
memset( pStart, 0, phdr->length );
|
||||
pData = pStart;
|
||||
}
|
||||
|
||||
//
|
||||
// write the model output file
|
||||
//
|
||||
strcat (outname, ".mdl");
|
||||
|
||||
printf ("---------------------\n");
|
||||
printf ("writing %s:\n", outname);
|
||||
modelouthandle = SafeOpenWrite (outname);
|
||||
|
||||
phdr = (studiohdr_t *)pStart;
|
||||
|
||||
phdr->id = IDSTUDIOHEADER;
|
||||
phdr->version = STUDIO_VERSION;
|
||||
strcpy( phdr->name, outname );
|
||||
VectorCopy( eyeposition, phdr->eyeposition );
|
||||
VectorCopy( bbox[0], phdr->min );
|
||||
VectorCopy( bbox[1], phdr->max );
|
||||
VectorCopy( cbox[0], phdr->bbmin );
|
||||
VectorCopy( cbox[1], phdr->bbmax );
|
||||
|
||||
phdr->flags = gflags;
|
||||
|
||||
pData = (byte *)phdr + sizeof( studiohdr_t );
|
||||
|
||||
WriteBoneInfo( );
|
||||
printf("bones %6d bytes (%d)\n", pData - pStart - total, numbones );
|
||||
total = pData - pStart;
|
||||
|
||||
pData = WriteAnimations( pData, pStart, 0 );
|
||||
|
||||
WriteSequenceInfo( );
|
||||
printf("sequences %6d bytes (%d frames) [%d:%02d]\n", pData - pStart - total, totalframes, (int)totalseconds / 60, (int)totalseconds % 60 );
|
||||
total = pData - pStart;
|
||||
|
||||
WriteModel( );
|
||||
printf("models %6d bytes\n", pData - pStart - total );
|
||||
total = pData - pStart;
|
||||
|
||||
if (!split_textures)
|
||||
{
|
||||
WriteTextures( );
|
||||
printf("textures %6d bytes\n", pData - pStart - total );
|
||||
}
|
||||
|
||||
phdr->length = pData - pStart;
|
||||
|
||||
printf("total %6d\n", phdr->length );
|
||||
|
||||
SafeWrite( modelouthandle, pStart, phdr->length );
|
||||
|
||||
fclose (modelouthandle);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user