[Scummvm-git-logs] scummvm master -> 988dbf3fa0e081246beddfe7866fa40c694beabf
sev-
noreply at scummvm.org
Wed May 22 22:50:55 UTC 2024
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
988dbf3fa0 DIRECTOR: DEBUGGER: Restrict max number of columns to 511
Commit: 988dbf3fa0e081246beddfe7866fa40c694beabf
https://github.com/scummvm/scummvm/commit/988dbf3fa0e081246beddfe7866fa40c694beabf
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-23T00:50:43+02:00
Commit Message:
DIRECTOR: DEBUGGER: Restrict max number of columns to 511
This is currntly a hard limit of ImGui
Changed paths:
engines/director/debugtools.cpp
diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index c0bdb86aeae..773400b1d47 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -55,6 +55,8 @@
namespace Director {
+#define kMaxColumnsInTable 512
+
typedef struct ImGuiImage {
ImTextureID id;
int16 width;
@@ -2380,7 +2382,7 @@ const char *modes2[] = {
static void displayScoreChannel(int ch, int mode, int modeSel) {
Score *score = g_director->getCurrentMovie()->getScore();
- const uint numFrames = score->_scoreCache.size();
+ const uint numFrames = MIN(score->_scoreCache.size(), (uint)(kMaxColumnsInTable - 2));
const uint currentFrameNum = score->getCurrentFrameNum();
const ImU32 cell_bg_color = ImGui::GetColorU32(ImVec4(0.7f, 0.7f, 0.0f, 0.65f));
@@ -2700,6 +2702,9 @@ static void showScore() {
uint numChannels = score->_scoreCache[0]->_sprites.size();
uint tableColumns = MAX(numFrames + 5, 25U); // Set minimal table width to 25
+ if (tableColumns > kMaxColumnsInTable - 2) // Current restriction of ImGui
+ tableColumns = numFrames = 510;
+
ImGuiTableFlags addonFlags = _state->_scoreMode == kModeExtended ? 0 : ImGuiTableFlags_RowBg;
if (ImGui::BeginTable("Score", tableColumns + 1,
More information about the Scummvm-git-logs
mailing list