[Scummvm-git-logs] scummvm master -> d7a45e8d5f8e7121fc5142dc7501212dc48b847b
bluegr
noreply at scummvm.org
Thu Dec 26 16:42:48 UTC 2024
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
5ca7c20121 CREATE_PROJECT: Add components based features dynamically
d7a45e8d5f CONFIGURE: Improve components descriptions
Commit: 5ca7c20121d113a7becc926e97181f97d518f883
https://github.com/scummvm/scummvm/commit/5ca7c20121d113a7becc926e97181f97d518f883
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-12-26T18:42:44+02:00
Commit Message:
CREATE_PROJECT: Add components based features dynamically
Cleanup the uneeded static features.
Changed paths:
devtools/create_project/create_project.cpp
devtools/create_project/create_project.h
diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 948ad50bf54..62a5054d706 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -1188,11 +1188,7 @@ const Feature s_features[] = {
{ "16bit", "USE_RGB_COLOR", false, true, "16bit color support" },
{ "3d", "", false, true, "3D rendering" },
{ "highres", "USE_HIGHRES", false, true, "high resolution" },
- { "imgui", "USE_IMGUI", false, true, "Dear ImGui based debugger" },
- { "lua", "USE_LUA", false, true, "Lua" },
- { "mt32emu", "USE_MT32EMU", false, true, "integrated MT-32 emulator" },
{ "nasm", "USE_NASM", false, true, "IA-32 assembly support" }, // This feature is special in the regard, that it needs additional handling.
- { "tinygl", "USE_TINYGL", false, true, "TinyGL support" },
{ "opengl", "USE_OPENGL", false, true, "OpenGL support" },
{"opengl_game_classic", "USE_OPENGL_GAME", false, true, "OpenGL support (classic) in 3d games" },
{"opengl_game_shaders", "USE_OPENGL_SHADERS", false, true, "OpenGL support (shaders) in 3d games" },
@@ -1244,6 +1240,35 @@ const char *s_msvc_config_names[] = {"arm64", "Win32", "x64"};
// clang-format on
} // End of anonymous namespace
+// An array of buffers for the features
+// created out of the components (which use char pointers)
+std::list<std::string> s_stash_features;
+FeatureList::iterator addDynamicFeature(FeatureList &features, const std::string &name, const std::string &description, const std::string &define) {
+ // Add a new entry in our stash and fill it
+ s_stash_features.push_back(std::string());
+ std::string &buffer = s_stash_features.back();
+
+ buffer += name;
+ buffer += '\0';
+ buffer += define;
+ buffer += '\0';
+ buffer += description;
+
+ // Starting from now the buffer must be read-only
+
+ const char *ptr = buffer.c_str();
+ Feature feature = {
+ ptr,
+ ptr + name.size() + 1,
+ false,
+ true,
+ ptr + name.size() + define.size() + 2
+ };
+
+ features.push_back(feature);
+ return --features.end();
+}
+
std::string getMSVCArchName(MSVC_Architecture arch) {
return s_msvc_arch_names[arch];
}
@@ -1307,7 +1332,8 @@ ComponentList getAllComponents(const std::string &srcDir, FeatureList &features)
FeatureList::iterator itr = std::find(features.begin(), features.end(), name);
if (itr == features.end()) {
- error("Missing matching feature for component " + name);
+ // Create a new feature on the fly
+ itr = addDynamicFeature(features, name, description, define);
}
Component comp = { name, define, *itr, description, false };
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index 9e9c378d4c0..4a64e3af274 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -32,7 +32,6 @@
#include <list>
#include <map>
-#include <map>
#include <string>
#include <vector>
Commit: d7a45e8d5f8e7121fc5142dc7501212dc48b847b
https://github.com/scummvm/scummvm/commit/d7a45e8d5f8e7121fc5142dc7501212dc48b847b
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2024-12-26T18:42:44+02:00
Commit Message:
CONFIGURE: Improve components descriptions
Changed paths:
configure
diff --git a/configure b/configure
index 9b1a7ae1785..8fc6bf40eb5 100755
--- a/configure
+++ b/configure
@@ -315,13 +315,13 @@ add_feature zlib "zlib" "_zlib"
add_feature test_cxx11 "Test C++11" "_test_cxx11"
# Components are features which may be disabled if unused by the engines
-add_component hnm "hnm" "_hnm" "USE_HNM"
-add_component imgui "ImGui" "_imgui" "USE_IMGUI"
-add_component indeo "indeo" "_indeo" "USE_INDEO"
-add_component lua "lua" "_lua" "USE_LUA"
+add_component hnm "HNM" "_hnm" "USE_HNM"
+add_component imgui "Dear ImGui based debugger" "_imgui" "USE_IMGUI"
+add_component indeo "Indeo" "_indeo" "USE_INDEO"
+add_component lua "Lua" "_lua" "USE_LUA"
add_component vpx "libvpx" "_vpx" "USE_VPX"
add_component theoradec "libtheoradec" "_theoradec" "USE_THEORADEC"
-add_component mt32emu "mt32emu" "_mt32emu" "USE_MT32EMU"
+add_component mt32emu "integrated MT-32 emulator" "_mt32emu" "USE_MT32EMU"
add_component tinygl "TinyGL" "_tinygl" "USE_TINYGL"
# The following list of features cannot be declared as components
More information about the Scummvm-git-logs
mailing list