From caebeef0ca63761f8b7aca0727acfc4f36b206f3 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Fri, 21 Jun 2024 20:45:35 +0200 Subject: [PATCH] Added rbdmap -t or -nogui option because pdcurdes does not work with TB --- neo/tools/compilers/aas/AASBuild.cpp | 6 ++-- neo/tools/compilers/dmap/dmap.cpp | 2 +- neo/tools/compilers/dmap/map.cpp | 17 +++++----- neo/tools/compilers/main.cpp | 47 +++++++++++++++++----------- 4 files changed, 42 insertions(+), 30 deletions(-) diff --git a/neo/tools/compilers/aas/AASBuild.cpp b/neo/tools/compilers/aas/AASBuild.cpp index 3977715e..93b9b90e 100644 --- a/neo/tools/compilers/aas/AASBuild.cpp +++ b/neo/tools/compilers/aas/AASBuild.cpp @@ -839,8 +839,6 @@ bool idAASBuild::Build( const idStr& fileName, const idAASSettings* settings ) return false; } - common->DmapPacifierFilename( name, "Compiling AAS files" ); - // check if this map has any entities that use this AAS file if( !CheckForEntities( mapFile, entityClassNames ) ) { @@ -849,6 +847,10 @@ bool idAASBuild::Build( const idStr& fileName, const idAASSettings* settings ) return true; } + name.SetFileExtension( aasSettings->fileExtension ); + common->DmapPacifierFilename( name, "Compiling AAS" ); + name.SetFileExtension( "map" ); + // load map file brushes brushList = AddBrushesForMapFile( mapFile, brushList ); diff --git a/neo/tools/compilers/dmap/dmap.cpp b/neo/tools/compilers/dmap/dmap.cpp index 6d3c1421..52494cbd 100644 --- a/neo/tools/compilers/dmap/dmap.cpp +++ b/neo/tools/compilers/dmap/dmap.cpp @@ -159,7 +159,7 @@ bool ProcessModels() common->DmapPacifierInfo( "Current entity : %s", entity->mapEntity->epairs.GetString( "name" ) ); } - //common->Printf( "############### entity %i ###############\n", dmapGlobals.entityNum ); + common->VerbosePrintf( "############### entity %i ###############\n", dmapGlobals.entityNum ); // if we leaked, stop without any more processing if( !ProcessModel( entity, ( bool )( dmapGlobals.entityNum == 0 ) ) ) diff --git a/neo/tools/compilers/dmap/map.cpp b/neo/tools/compilers/dmap/map.cpp index 957450f4..1f655465 100644 --- a/neo/tools/compilers/dmap/map.cpp +++ b/neo/tools/compilers/dmap/map.cpp @@ -351,16 +351,17 @@ static void ParseBrush( const idMapBrush* mapBrush, int primitiveNum ) // RB: we don't need this info if we are actually compiling maps in the original format // we only load this for the engine in the case we want to convert it to the Valve 220 format -#if !defined( DMAP ) - s->texSize = ms->GetTextureSize(); - - idImage* image = s->material->GetEditorImage(); - if( image != NULL ) + if( s->texValve220 ) { - s->texSize.x = image->GetUploadWidth(); - s->texSize.y = image->GetUploadHeight(); + s->texSize = ms->GetTextureSize(); + + idImage* image = s->material->GetEditorImage(); + if( image != NULL ) + { + s->texSize.x = image->GetUploadWidth(); + s->texSize.y = image->GetUploadHeight(); + } } -#endif // RB end // remove any integral shift, which will help with grouping diff --git a/neo/tools/compilers/main.cpp b/neo/tools/compilers/main.cpp index fbfc149d..35f0f1a8 100644 --- a/neo/tools/compilers/main.cpp +++ b/neo/tools/compilers/main.cpp @@ -1085,14 +1085,10 @@ int com_editors = 0; ============================================================== */ -#if 0 - -void idCommonLocal::UpdateScreen( bool captureToImage, bool releaseMouse ) +int Dmap_NoGui( int argc, char** argv ) { -} + commonLocal.com_refreshOnPrint = false; -int main( int argc, char** argv ) -{ idLib::common = common; idLib::cvarSystem = cvarSystem; idLib::fileSystem = fileSystem; @@ -1116,6 +1112,9 @@ int main( int argc, char** argv ) i += 2; } + else if( idStr::Icmp( argv[ i ], "-t" ) == 0 || idStr::Icmp( argv[ i ], "-nogui" ) == 0 ) + { + } else { args.AppendArg( argv[i] ); @@ -1130,6 +1129,17 @@ int main( int argc, char** argv ) return 0; } +#if 0 + +void idCommonLocal::UpdateScreen( bool captureToImage, bool releaseMouse ) +{ +} + +int main( int argc, char** argv ) +{ + return Dmap_NoGui( argc, argv ); +} + #elif 1 @@ -1157,22 +1167,14 @@ void idCommonLocal::UpdateScreen( bool captureToImage, bool releaseMouse ) //idStr title = va( "RBDMAP version %s %s", ENGINE_VERSION, BUILD_STRING ); idStr title = va( "RBDMAP version %s %s %s %s", ENGINE_VERSION, BUILD_STRING, __DATE__, __TIME__ ); - //std::string title = "RBDMAP " + UI::kContentStr[window.content] + ")##" + std::to_string( windowId ); ImGui::Begin( title.c_str(), nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoScrollbar ); - - //ImGui::BeginChild( "Current Log:", ImVec2( 0, 0 ), false, ImGuiWindowFlags_NoDecoration ); - - // Actually call in the regular Log helper (which will Begin() into the same window as we just did) tuiLog.Draw( "Current Log:", &conOpen ); - //ImGui::EndChild(); - - //ShowExampleAppConsole( &conOpen ); //ImTui::ShowDemoWindow( &demo ); @@ -1190,8 +1192,6 @@ void idCommonLocal::UpdateScreen( bool captureToImage, bool releaseMouse ) ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove ); - //ImGui::Text( " API requests : %d / %d B (next update in %d s)", stateHN.nFetches, ( int ) stateHN.totalBytesDownloaded, stateHN.nextUpdate ); - if( stateUI.progress < 1.0f ) { ImGui::ProgressBar( stateUI.progress, ImVec2( 0.0f, 0.0f ) ); @@ -1212,6 +1212,14 @@ void idCommonLocal::UpdateScreen( bool captureToImage, bool releaseMouse ) int main( int argc, char** argv ) { + for( int i = 0; i < argc; i++ ) + { + if( idStr::Icmp( argv[ i ], "-t" ) == 0 || idStr::Icmp( argv[ i ], "-nogui" ) == 0 ) + { + return Dmap_NoGui( argc, argv ); + } + } + IMGUI_CHECKVERSION(); ImGui::CreateContext(); @@ -1220,8 +1228,6 @@ int main( int argc, char** argv ) stateUI.ChangeColorScheme( false ); - common->Printf( "Test log print\n" ); - idLib::common = common; idLib::cvarSystem = cvarSystem; idLib::fileSystem = fileSystem; @@ -1245,6 +1251,9 @@ int main( int argc, char** argv ) i += 2; } + else if( idStr::Icmp( argv[ i ], "-t" ) == 0 || idStr::Icmp( argv[ i ], "-nogui" ) == 0 ) + { + } else { args.AppendArg( argv[i] ); @@ -1256,7 +1265,7 @@ int main( int argc, char** argv ) Dmap_f( args ); -#if 1 +#if 0 while( true ) { bool captureToImage = false;