mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-05-31 08:50:54 +00:00
+ id style gltf2 parser
+ initial attempt to dmap glb/gltf [!] added blend file and glb for debugging purposes # Conflicts: # neo/idlib/containers/List.h
This commit is contained in:
parent
1d62816a77
commit
c1c5917cda
19 changed files with 3874 additions and 32 deletions
|
@ -1553,6 +1553,7 @@ bool idMapFile::Parse( const char* filename, bool ignoreRegion, bool osPath )
|
|||
idMapEntity* mapEnt;
|
||||
int i, j, k;
|
||||
|
||||
idStr extension;
|
||||
name = filename;
|
||||
name.StripFileExtension();
|
||||
name.StripFileExtension(); // RB: there might be .map.map
|
||||
|
@ -1572,6 +1573,18 @@ bool idMapFile::Parse( const char* filename, bool ignoreRegion, bool osPath )
|
|||
}
|
||||
}
|
||||
|
||||
bool isGTLF = false;
|
||||
if ( !src.IsLoaded( ) ) {
|
||||
// HVG: try loading a .gltf/glb second
|
||||
fullName.SetFileExtension( "glb" );
|
||||
isGTLF = src.LoadFile( fullName, osPath );
|
||||
if ( !isGTLF )
|
||||
{
|
||||
fullName.SetFileExtension( "gltf" );
|
||||
isGTLF = src.LoadFile( fullName, osPath );
|
||||
}
|
||||
}
|
||||
|
||||
if( !src.IsLoaded() )
|
||||
{
|
||||
// now try a .map file
|
||||
|
@ -1588,17 +1601,11 @@ bool idMapFile::Parse( const char* filename, bool ignoreRegion, bool osPath )
|
|||
fileTime = src.GetFileTime();
|
||||
entities.DeleteContents( true );
|
||||
|
||||
if( !src.ReadToken( &token ) )
|
||||
if(!isGTLF && !src.ReadToken( &token ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// RB: TODO check for JSON in another way
|
||||
//if( token == "{" )
|
||||
//{
|
||||
// isJSON = true;
|
||||
//}
|
||||
|
||||
if( isJSON )
|
||||
{
|
||||
while( true )
|
||||
|
@ -1661,7 +1668,11 @@ bool idMapFile::Parse( const char* filename, bool ignoreRegion, bool osPath )
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else if ( isGTLF )
|
||||
{
|
||||
gltfParser->Load( fullName );
|
||||
idMapEntity::GetEntities(gltfParser->currentAsset,entities,0);
|
||||
}else
|
||||
{
|
||||
if( token == "Version" )
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue