From 7234a42c58f7949a600c8c9bd7fd0822b0bb9d6f Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Sat, 22 Jun 2024 15:55:25 +0200 Subject: [PATCH] Added ncurses dep to Linux rbdmap --- neo/CMakeLists.txt | 7 ++- neo/imgui/BFGimgui.h | 27 ++++++++++ neo/imgui/BFGimguiImpl.cpp | 37 ++++++++++---- neo/tools/compilers/CMakeLists.txt | 14 +++++- neo/tools/compilers/main.cpp | 79 ++---------------------------- 5 files changed, 76 insertions(+), 88 deletions(-) diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 95fb99ee..e8a5cb96 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -420,7 +420,12 @@ if(OPTICK) endif() add_subdirectory(idlib) -add_subdirectory(tools/compilers) + +# RB: there haven't been requests for a separate map compiler executable by macOS users +# and it is ok to not support it until someone also supports TrenchBroomBFG on macOS +if(NOT APPLE) + add_subdirectory(tools/compilers) +endif() file(GLOB NATVIS_SOURCES .natvis) diff --git a/neo/imgui/BFGimgui.h b/neo/imgui/BFGimgui.h index d1f0724f..06017def 100644 --- a/neo/imgui/BFGimgui.h +++ b/neo/imgui/BFGimgui.h @@ -1,3 +1,30 @@ +/* +=========================================================================== + +Doom 3 BFG Edition GPL Source Code +Copyright (C) 2015 Daniel Gibson + +This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). + +Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Doom 3 BFG Edition Source Code. If not, see . + +In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. + +If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. + +=========================================================================== +*/ #ifndef NEO_IMGUI_BFGIMGUI_H_ #define NEO_IMGUI_BFGIMGUI_H_ diff --git a/neo/imgui/BFGimguiImpl.cpp b/neo/imgui/BFGimguiImpl.cpp index 883b41e8..2f001136 100644 --- a/neo/imgui/BFGimguiImpl.cpp +++ b/neo/imgui/BFGimguiImpl.cpp @@ -1,15 +1,32 @@ /* - * ImGui integration into Doom3BFG/OpenTechEngine. - * Based on ImGui SDL and OpenGL3 examples. - * Copyright (c) 2014-2015 Omar Cornut and ImGui contributors - * - * Doom3-specific Code (and ImGui::DragXYZ(), based on ImGui::DragFloatN()) - * Copyright (C) 2015 Daniel Gibson - * Copyright (C) 2016-2023 Robert Beckebans - * - * This file is under MIT License, like the original code from ImGui. - */ +=========================================================================== +Doom 3 BFG Edition GPL Source Code +Copyright (c) 2014-2015 Omar Cornut and ImGui contributors +Copyright (C) 2015 Daniel Gibson +Copyright (C) 2016-2023 Robert Beckebans + +This file is part of the Doom 3 BFG Edition GPL Source Code ("Doom 3 BFG Edition Source Code"). + +Doom 3 BFG Edition Source Code is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +Doom 3 BFG Edition Source Code is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Doom 3 BFG Edition Source Code. If not, see . + +In addition, the Doom 3 BFG Edition Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 BFG Edition Source Code. If not, please request a copy in writing from id Software at the address below. + +If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA. + +=========================================================================== +*/ #include "precompiled.h" #pragma hdrstop diff --git a/neo/tools/compilers/CMakeLists.txt b/neo/tools/compilers/CMakeLists.txt index 4aad6500..2a8895de 100644 --- a/neo/tools/compilers/CMakeLists.txt +++ b/neo/tools/compilers/CMakeLists.txt @@ -142,6 +142,18 @@ if(MSVC) target_link_libraries(imtui-pdcurses PUBLIC winmm ) +else() + find_package(Curses REQUIRED) + CHECK_LIBRARY_EXISTS("${CURSES_NCURSES_LIBRARY}" + nodelay "" CURSES_NCURSES_HAS_NODELAY) + if(NOT CURSES_NCURSES_HAS_NODELAY) + find_library(CURSES_EXTRA_LIBRARY tinfo) + CHECK_LIBRARY_EXISTS("${CURSES_EXTRA_LIBRARY}" + nodelay "" CURSES_TINFO_HAS_NODELAY) + endif() + if(CURSES_EXTRA_LIBRARY) + set(CURSES_LIBRARIES ${CURSES_LIBRARIES} ${CURSES_EXTRA_LIBRARY}) + endif() endif() set(MC_INCLUDES_ALL @@ -274,7 +286,7 @@ else() endif() add_executable(rbdmap ${MC_SOURCES_ALL} ${MC_INCLUDES_ALL}) - add_dependencies(rbdmap idlib) + add_dependencies(rbdmap idlib ${CURSES_LIBRARIES}) if (USE_PRECOMPILED_HEADERS) add_dependencies(rbdmap precomp_header_rbdmap) endif() diff --git a/neo/tools/compilers/main.cpp b/neo/tools/compilers/main.cpp index 55dd7dd6..8772764a 100644 --- a/neo/tools/compilers/main.cpp +++ b/neo/tools/compilers/main.cpp @@ -48,10 +48,6 @@ idEventLoop* eventLoop; // [SECTION] Example App: Debug Log / ShowExampleAppLog() //----------------------------------------------------------------------------- -// Usage: -// static ExampleAppLog my_log; -// my_log.AddLog("Hello %d world\n", 123); -// my_log.Draw("title"); struct MyAppLog { ImGuiTextBuffer Buf; @@ -566,14 +562,6 @@ idSys* sys = &idSysLocal; ============================================================== */ -/* -#include -#include -#include -#include -#include -*/ - namespace UI { @@ -582,7 +570,6 @@ enum class ColorScheme : int Default, Dark, Green, - Jungle, COUNT, }; @@ -655,68 +642,6 @@ struct State break; } - case ColorScheme::Jungle: - { - // based on BlackDevil style by Naeemullah1 from ImThemes - colors[ImGuiCol_Text] = ImVec4( 0.78f, 0.78f, 0.78f, 1.00f ); - colors[ImGuiCol_TextDisabled] = ImVec4( 0.44f, 0.41f, 0.31f, 1.00f ); - colors[ImGuiCol_WindowBg] = ImVec4( 0.12f, 0.14f, 0.16f, 0.87f ); - colors[ImGuiCol_ChildBg] = ImVec4( 0.06f, 0.12f, 0.16f, 0.78f ); - colors[ImGuiCol_PopupBg] = ImVec4( 0.08f, 0.08f, 0.08f, 0.78f ); - //colors[ImGuiCol_Border] = ImVec4(0.39f, 0.00f, 0.00f, 0.78f); the red is a bit too aggressive - colors[ImGuiCol_Border] = ImVec4( 0.24f, 0.27f, 0.32f, 0.78f ); - colors[ImGuiCol_BorderShadow] = ImVec4( 0.00f, 0.00f, 0.00f, 0.00f ); - colors[ImGuiCol_FrameBg] = ImVec4( 0.06f, 0.12f, 0.16f, 0.78f ); - colors[ImGuiCol_FrameBgHovered] = ImVec4( 0.12f, 0.24f, 0.35f, 0.78f ); - colors[ImGuiCol_FrameBgActive] = ImVec4( 0.35f, 0.35f, 0.12f, 0.78f ); - colors[ImGuiCol_TitleBg] = ImVec4( 0.06f, 0.12f, 0.16f, 0.78f ); - colors[ImGuiCol_TitleBgActive] = ImVec4( 0.06f, 0.12f, 0.16f, 0.78f ); - colors[ImGuiCol_TitleBgCollapsed] = ImVec4( 0.06f, 0.12f, 0.16f, 0.20f ); - colors[ImGuiCol_MenuBarBg] = ImVec4( 0.08f, 0.08f, 0.08f, 0.78f ); - colors[ImGuiCol_ScrollbarBg] = ImVec4( 0.06f, 0.12f, 0.16f, 0.78f ); - colors[ImGuiCol_ScrollbarGrab] = ImVec4( 0.12f, 0.35f, 0.24f, 0.78f ); - colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4( 0.12f, 0.35f, 0.35f, 0.78f ); - colors[ImGuiCol_ScrollbarGrabActive] = ImVec4( 0.12f, 0.59f, 0.24f, 0.78f ); - colors[ImGuiCol_CheckMark] = ImVec4( 0.12f, 0.59f, 0.24f, 0.78f ); - colors[ImGuiCol_SliderGrab] = ImVec4( 0.12f, 0.35f, 0.24f, 0.78f ); - colors[ImGuiCol_SliderGrabActive] = ImVec4( 0.12f, 0.59f, 0.24f, 0.78f ); - colors[ImGuiCol_Button] = ImVec4( 0.35f, 0.35f, 0.12f, 0.78f ); - colors[ImGuiCol_ButtonHovered] = ImVec4( 0.35f, 0.47f, 0.24f, 0.78f ); - colors[ImGuiCol_ButtonActive] = ImVec4( 0.59f, 0.35f, 0.24f, 0.78f ); - colors[ImGuiCol_Header] = ImVec4( 0.06f, 0.12f, 0.16f, 0.78f ); - colors[ImGuiCol_HeaderHovered] = ImVec4( 0.12f, 0.35f, 0.35f, 0.78f ); - colors[ImGuiCol_HeaderActive] = ImVec4( 0.12f, 0.59f, 0.24f, 0.78f ); - colors[ImGuiCol_Separator] = ImVec4( 0.35f, 0.35f, 0.24f, 0.78f ); - colors[ImGuiCol_SeparatorHovered] = ImVec4( 0.12f, 0.35f, 0.35f, 0.78f ); - colors[ImGuiCol_SeparatorActive] = ImVec4( 0.59f, 0.35f, 0.24f, 0.78f ); - colors[ImGuiCol_ResizeGrip] = ImVec4( 0.06f, 0.12f, 0.16f, 0.78f ); - colors[ImGuiCol_ResizeGripHovered] = ImVec4( 0.59f, 0.35f, 0.35f, 0.78f ); - colors[ImGuiCol_ResizeGripActive] = ImVec4( 0.59f, 0.24f, 0.24f, 0.78f ); - colors[ImGuiCol_Tab] = ImVec4( 0.35f, 0.35f, 0.12f, 0.78f ); - colors[ImGuiCol_TabHovered] = ImVec4( 0.35f, 0.47f, 0.24f, 0.78f ); - colors[ImGuiCol_TabActive] = ImVec4( 0.59f, 0.35f, 0.24f, 0.78f ); - colors[ImGuiCol_TabUnfocused] = ImVec4( 0.06f, 0.12f, 0.16f, 0.78f ); - colors[ImGuiCol_TabUnfocusedActive] = ImVec4( 0.59f, 0.35f, 0.35f, 0.78f ); - // colors[ImGuiCol_DockingPreview] = ImVec4( 0.26f, 0.59f, 0.98f, 0.70f ); - // colors[ImGuiCol_DockingEmptyBg] = ImVec4( 0.20f, 0.20f, 0.20f, 1.00f ); - colors[ImGuiCol_PlotLines] = ImVec4( 0.39f, 0.78f, 0.39f, 0.78f ); - colors[ImGuiCol_PlotLinesHovered] = ImVec4( 1.00f, 0.43f, 0.35f, 0.78f ); - colors[ImGuiCol_PlotHistogram] = ImVec4( 0.00f, 0.35f, 0.39f, 0.78f ); - colors[ImGuiCol_PlotHistogramHovered] = ImVec4( 0.20f, 0.59f, 0.59f, 0.78f ); - colors[ImGuiCol_TableHeaderBg] = ImVec4( 0.19f, 0.19f, 0.20f, 0.78f ); - colors[ImGuiCol_TableBorderStrong] = ImVec4( 0.31f, 0.31f, 0.35f, 0.78f ); - colors[ImGuiCol_TableBorderLight] = ImVec4( 0.23f, 0.23f, 0.25f, 0.78f ); - colors[ImGuiCol_TableRowBg] = ImVec4( 0.00f, 0.00f, 0.00f, 0.78f ); - colors[ImGuiCol_TableRowBgAlt] = ImVec4( 1.00f, 1.00f, 1.00f, 0.06f ); - colors[ImGuiCol_TextSelectedBg] = ImVec4( 0.39f, 0.35f, 0.39f, 0.39f ); - colors[ImGuiCol_DragDropTarget] = ImVec4( 1.00f, 1.00f, 0.00f, 0.90f ); - colors[ImGuiCol_NavHighlight] = ImVec4( 0.26f, 0.59f, 0.98f, 1.00f ); - colors[ImGuiCol_NavWindowingHighlight] = ImVec4( 1.00f, 1.00f, 1.00f, 0.70f ); - colors[ImGuiCol_NavWindowingDimBg] = ImVec4( 0.80f, 0.80f, 0.80f, 0.20f ); - colors[ImGuiCol_ModalWindowDimBg] = ImVec4( 0.80f, 0.80f, 0.80f, 0.35f ); - break; - } - default: { } @@ -1227,14 +1152,16 @@ void idCommonLocal::UpdateScreen( bool captureToImage, bool releaseMouse ) ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove ); + auto wSize = ImGui::GetIO().DisplaySize; if( stateUI.progress < 1.0f ) { - ImGui::ProgressBar( stateUI.progress, ImVec2( 0.0f, 0.0f ) ); + ImGui::ProgressBar( stateUI.progress, ImVec2( wSize.x, 0.0f ) ); } else { ImGui::Text( " " ); } + ImGui::Text( " %s", stateUI.statusActiveTool.c_str() ); ImGui::Text( " Source code : https://github.com/RobertBeckebans/RBDOOM-3-BFG" ); ImGui::End();