mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 22:50:45 +00:00
Fixed compile errors
This commit is contained in:
parent
ad78435446
commit
f1d7f2ff9e
2 changed files with 28 additions and 27 deletions
|
@ -340,7 +340,7 @@ idRenderModel* idRenderModelManagerLocal::GetModel( const char* _modelName, bool
|
|||
{
|
||||
if( isGLTF )
|
||||
{
|
||||
model->InitFromFile( canonical );
|
||||
model->InitFromFile( canonical, options );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -371,7 +371,7 @@ idRenderModel* idRenderModelManagerLocal::GetModel( const char* _modelName, bool
|
|||
// determine which subclass of idRenderModel to initialize
|
||||
|
||||
idRenderModel* model = NULL;
|
||||
bool isGLTF = false;
|
||||
|
||||
// HvG: GLTF 2 support
|
||||
if( isGLTF )
|
||||
{
|
||||
|
@ -661,25 +661,26 @@ void idRenderModelManagerLocal::ReloadModels( bool forceAll )
|
|||
{
|
||||
continue;
|
||||
}
|
||||
bool isGltf = false;
|
||||
idStr name = model->Name();
|
||||
|
||||
bool isGLTF = false;
|
||||
idStr filename = model->Name();
|
||||
idStr extension;
|
||||
idStr assetName = name;
|
||||
idStr assetName = filename;
|
||||
assetName.ExtractFileExtension( extension );
|
||||
isGltf = extension.Icmp( "glb" ) == 0 || extension.Icmp( "gltf" ) == 0;
|
||||
isGLTF = extension.Icmp( "glb" ) == 0 || extension.Icmp( "gltf" ) == 0;
|
||||
if( !forceAll )
|
||||
{
|
||||
// check timestamp
|
||||
ID_TIME_T current;
|
||||
|
||||
if( isGltf )
|
||||
if( isGLTF )
|
||||
{
|
||||
idStr meshName;
|
||||
int meshID = -1;
|
||||
gltfManager::ExtractIdentifier( name, meshID, meshName );
|
||||
gltfManager::ExtractIdentifier( filename, meshID, meshName );
|
||||
}
|
||||
|
||||
fileSystem->ReadFile( name, NULL, ¤t );
|
||||
fileSystem->ReadFile( filename, NULL, ¤t );
|
||||
if( current <= model->Timestamp() )
|
||||
{
|
||||
continue;
|
||||
|
@ -688,9 +689,10 @@ void idRenderModelManagerLocal::ReloadModels( bool forceAll )
|
|||
|
||||
common->DPrintf( "^1Reloading %s.\n", model->Name() );
|
||||
|
||||
if( isGltf )
|
||||
if( isGLTF )
|
||||
{
|
||||
model->InitFromFile( model->Name() );
|
||||
// RB: we don't have the options here so make sure this only applies to static models
|
||||
model->InitFromFile( model->Name(), NULL );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -163,13 +163,13 @@ void idRenderModelGLTF::InitFromFile( const char* fileName, const idImportOption
|
|||
bounds.Clear();
|
||||
|
||||
int sceneId = data->DefaultScene();
|
||||
idassert( sceneId >= 0 );
|
||||
assert( sceneId >= 0 );
|
||||
|
||||
auto scene = data->SceneList()[sceneId];
|
||||
idassert( scene );
|
||||
assert( scene );
|
||||
|
||||
auto nodes = data->NodeList();
|
||||
idassert( nodes.Num() );
|
||||
assert( nodes.Num() );
|
||||
|
||||
//determine root node
|
||||
if( !meshName[0] )
|
||||
|
@ -213,7 +213,7 @@ void idRenderModelGLTF::InitFromFile( const char* fileName, const idImportOption
|
|||
if( tmpNode->skin >= 0 )
|
||||
{
|
||||
currentSkin = data->SkinList()[tmpNode->skin];
|
||||
idassert( currentSkin );
|
||||
assert( currentSkin );
|
||||
if( currentSkin->joints.Num() )
|
||||
{
|
||||
bones.Append( currentSkin->joints );
|
||||
|
@ -258,7 +258,6 @@ void idRenderModelGLTF::InitFromFile( const char* fileName, const idImportOption
|
|||
// derive mikktspace tangents from normals
|
||||
FinishSurfaces( true );
|
||||
|
||||
|
||||
LoadModel();
|
||||
UpdateMd5Joints();
|
||||
|
||||
|
@ -373,7 +372,7 @@ const idMD5Joint* idRenderModelGLTF::FindMD5Joint( const idStr& name ) const
|
|||
return &joint;
|
||||
}
|
||||
}
|
||||
idassert( 0 );
|
||||
assert( 0 );
|
||||
static idMD5Joint staticJoint;
|
||||
return &staticJoint;
|
||||
}
|
||||
|
@ -506,7 +505,7 @@ static bool GatherBoneInfo( gltfData* data, gltfAnimation* gltfAnim, const idLis
|
|||
{
|
||||
skin = data->GetSkin( targetNode );
|
||||
}
|
||||
idassert( skin );
|
||||
assert( skin );
|
||||
bones.Append( skin->joints );
|
||||
}
|
||||
else
|
||||
|
@ -604,7 +603,7 @@ static int CopyBones( gltfData* data, const idList<int>& bones, idList<gltfNode>
|
|||
|
||||
idFile_Memory* idRenderModelGLTF::GetAnimBin( const idStr& animName, const ID_TIME_T sourceTimeStamp, const idImportOptions* options )
|
||||
{
|
||||
idassert( lastMeshFromFile );
|
||||
assert( lastMeshFromFile );
|
||||
|
||||
//keep in sync with game!
|
||||
static const byte B_ANIM_MD5_VERSION = 101;
|
||||
|
@ -723,7 +722,7 @@ idFile_Memory* idRenderModelGLTF::GetAnimBin( const idStr& animName, const ID_TI
|
|||
for( int i = 0; i < numFrames; i++ )
|
||||
{
|
||||
int totalCopied = CopyBones( data, bones, animBones[i] );
|
||||
idassert( totalCopied );
|
||||
assert( totalCopied );
|
||||
}
|
||||
|
||||
gameLocal.Printf( "Total bones %i \n", bones.Num() );
|
||||
|
@ -849,7 +848,7 @@ idFile_Memory* idRenderModelGLTF::GetAnimBin( const idStr& animName, const ID_TI
|
|||
}
|
||||
}
|
||||
|
||||
idassert( componentFrames.Num() == ( componentFrameIndex + 1 ) );
|
||||
assert( componentFrames.Num() == ( componentFrameIndex + 1 ) );
|
||||
|
||||
bounds.SetGranularity( 1 );
|
||||
bounds.AssureSize( numFrames );
|
||||
|
@ -1101,7 +1100,7 @@ void idRenderModelGLTF::PurgeModel()
|
|||
|
||||
void idRenderModelGLTF::LoadModel()
|
||||
{
|
||||
idassert( data );
|
||||
assert( data );
|
||||
|
||||
int num;
|
||||
auto& accessors = data->AccessorList();
|
||||
|
@ -1110,7 +1109,7 @@ void idRenderModelGLTF::LoadModel()
|
|||
if( !fileExclusive )
|
||||
{
|
||||
meshRoot = data->GetNode( gltf_ModelSceneName.GetString(), meshName );
|
||||
idassert( meshRoot );
|
||||
assert( meshRoot );
|
||||
}
|
||||
|
||||
gltfSkin* skin = nullptr;
|
||||
|
@ -1518,8 +1517,8 @@ idRenderModel* idRenderModelGLTF::InstantiateDynamicModel( const struct renderEn
|
|||
idRenderModelStatic* staticModel;
|
||||
if( cachedModel != NULL )
|
||||
{
|
||||
idassert( dynamic_cast< idRenderModelStatic* >( cachedModel ) != NULL );
|
||||
idassert( idStr::Icmp( cachedModel->Name(), GLTF_SnapshotName ) == 0 );
|
||||
assert( dynamic_cast< idRenderModelStatic* >( cachedModel ) != NULL );
|
||||
assert( idStr::Icmp( cachedModel->Name(), GLTF_SnapshotName ) == 0 );
|
||||
staticModel = static_cast< idRenderModelStatic* >( cachedModel );
|
||||
}
|
||||
else
|
||||
|
@ -1557,7 +1556,7 @@ idRenderModel* idRenderModelGLTF::InstantiateDynamicModel( const struct renderEn
|
|||
}
|
||||
else
|
||||
{
|
||||
idassert( staticModel->numInvertedJoints == numInvertedJoints );
|
||||
assert( staticModel->numInvertedJoints == numInvertedJoints );
|
||||
}
|
||||
|
||||
TransformJointsFast( staticModel->jointsInverted, md5joints.Num(), ent->joints, invertedDefaultPose.Ptr() );
|
||||
|
@ -1586,7 +1585,7 @@ idRenderModel* idRenderModelGLTF::InstantiateDynamicModel( const struct renderEn
|
|||
}
|
||||
|
||||
UpdateSurface( ent, ent->joints, staticModel->jointsInverted, &surf, surfaces[surfIdx++] );
|
||||
idassert( surf.geometry != NULL );
|
||||
assert( surf.geometry != NULL );
|
||||
surf.geometry->staticModelWithJoints = staticModel;
|
||||
staticModel->bounds.AddBounds( surf.geometry->bounds );
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue