Migrate mjtByte to mjtBool for boolean-valued fields.
PiperOrigin-RevId: 921408093 Change-Id: Icb00457836359779f0f72fc02d6a7c0dc9f6bd23
This commit is contained in:
committed by
Copybara-Service
parent
3cabb2eb8e
commit
393c1e4217
@@ -103,6 +103,14 @@ void ImGui_DataPtrTable::DataPtr(const char* label, const mjtByte* ptr,
|
||||
}
|
||||
}
|
||||
|
||||
void ImGui_DataPtrTable::DataPtr(const char* label, const mjtBool* ptr,
|
||||
int index, int n) {
|
||||
for (int i = 0; i < n; ++i) {
|
||||
MakeLabel(label, i, n);
|
||||
ImGui::Text("%s", ptr[index + i] ? "true" : "false");
|
||||
}
|
||||
}
|
||||
|
||||
void ImGui_DataPtrTable::DataPtr(const char* label, const mjtSize* ptr,
|
||||
int index, int n) {
|
||||
Numeric(label, ptr, index, n);
|
||||
|
||||
@@ -174,6 +174,7 @@ class ImGui_DataPtrTable {
|
||||
// dimensionality of n.
|
||||
void DataPtr(const char* label, const char* ptr, int index, int n);
|
||||
void DataPtr(const char* label, const mjtByte* ptr, int index, int n);
|
||||
void DataPtr(const char* label, const mjtBool* ptr, int index, int n);
|
||||
void DataPtr(const char* label, const mjtSize* ptr, int index, int n);
|
||||
void DataPtr(const char* label, const int* ptr, int index, int n);
|
||||
void DataPtr(const char* label, const float* ptr, int index, int n);
|
||||
@@ -299,7 +300,7 @@ class ImGui_SpecElementTable : public ImGui_DataPtrTable {
|
||||
|
||||
ImGui::PushID(&val);
|
||||
ImGui::SetNextItemWidth(-1.0f);
|
||||
if constexpr (std::is_same_v<T, mjtByte>) {
|
||||
if constexpr (std::is_same_v<T, mjtByte> || std::is_same_v<T, mjtBool>) {
|
||||
if (read_only_) {
|
||||
ImGui::Text("%s", val ? "true" : "false");
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user