[Scummvm-git-logs] scummvm master -> 1c94550496fab38687844df5f2624fa04b1844c0

sev- noreply at scummvm.org
Tue May 21 06:59:16 UTC 2024


This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a7482534d9 DIRECTOR: DEBUGGER: Attempt to put combo box to the Score header
d9c2fd0e96 DIRECTOR: DEBUGGER: Improved Scroe window usability
f1c92c7ec0 DIRECTOR: DEBUGGER: Render different Score modes
1c94550496 DIRECTOR: DEBUGGER: Improve Score extended mode and implemented rest of the modes


Commit: a7482534d94bdc8c90d21f7b24c7f90a0d039dc0
    https://github.com/scummvm/scummvm/commit/a7482534d94bdc8c90d21f7b24c7f90a0d039dc0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-21T08:58:51+02:00

Commit Message:
DIRECTOR: DEBUGGER: Attempt to put combo box to the Score header

Changed paths:
    engines/director/debugtools.cpp


diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index 9c1c3f4a44d..5a68531d565 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -119,6 +119,8 @@ typedef struct ImGuiState {
 		int frame = -1;
 		int channel = -1;
 	} _selectedScoreCast;
+
+	int _scoreMode = 0;
 } ImGuiState;
 
 ImGuiState *_state = nullptr;
@@ -1879,7 +1881,39 @@ static void showScore() {
 			for (uint i = 0; i < tableColumns; i++)
 				ImGui::TableSetupColumn(Common::String::format("%-2d", i + 1).c_str(), flags);
 
-			ImGui::TableHeadersRow();
+			ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
+			ImGui::TableNextRow(0);
+			ImGui::PushID(0);
+
+			const char *modes[] = { "Member", "Behavior", "Location", "Ink", "Blend", "Extended" };
+			enum { kModeMember, kModeBehavior, kModeLocation, kModeInk, kModeBlend, kModeExtended };
+
+			const char *selMode = modes[_state->_scoreMode];
+
+			if (ImGui::BeginCombo("modeCombo", selMode)) {
+				for (int n = 0; n < ARRAYSIZE(modes); n++) {
+					const bool selected = (_state->_scoreMode == n);
+					if (ImGui::Selectable(modes[n], selected))
+						_state->_scoreMode = n;
+
+					if (selected)
+						ImGui::SetItemDefaultFocus();
+				}
+				ImGui::EndCombo();
+
+				ImGui::TableHeader("##");
+			}
+			ImGui::PopID();
+
+			for (uint i = 0; i < tableColumns; i++) {
+				ImGui::TableSetColumnIndex(i + 1);
+				const char *column_name = ImGui::TableGetColumnName(i + 1);
+				ImGui::PushID(i + 1);
+				ImGui::TableHeader(column_name);
+				ImGui::PopID();
+			}
+
+			//ImGui::TableHeadersRow();
 			for (int ch = 0; ch < (int)numChannels - 1; ch++) {
 				ImGui::TableNextRow();
 


Commit: d9c2fd0e9642befeb72de3f0acc6b9e9ea2efef0
    https://github.com/scummvm/scummvm/commit/d9c2fd0e9642befeb72de3f0acc6b9e9ea2efef0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-21T08:58:55+02:00

Commit Message:
DIRECTOR: DEBUGGER: Improved Scroe window usability

Changed paths:
    engines/director/debugtools.cpp


diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index 5a68531d565..753eb6f012f 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -1867,30 +1867,36 @@ static void showScore() {
 		}
 
 		uint numChannels = score->_scoreCache[0]->_sprites.size();
-		uint tableColumns = MAX(numFrames, 25U); // Set minimal table width to 25
+		uint tableColumns = MAX(numFrames + 5, 25U); // Set minimal table width to 25
 
 		uint currentFrameNum = score->getCurrentFrameNum();
 		ImU32 cell_bg_color = ImGui::GetColorU32(ImVec4(0.7f, 0.7f, 0.0f, 0.65f));
 
 		if (ImGui::BeginTable("Score", tableColumns + 1,
-					ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedSame |
+					ImGuiTableFlags_Borders | ImGuiTableFlags_HighlightHoveredColumn |
 					ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg)) {
 			ImGuiTableFlags flags = ImGuiTableColumnFlags_WidthFixed;
 
+			ImGui::TableSetupScrollFreeze(1, 1);
+
 			ImGui::TableSetupColumn("##", flags);
 			for (uint i = 0; i < tableColumns; i++)
-				ImGui::TableSetupColumn(Common::String::format("%-2d", i + 1).c_str(), flags);
+				ImGui::TableSetupColumn(((i + 1) % 5 ? " " : Common::String::format("%-2d", i + 1).c_str()), flags);
 
 			ImGui::TableNextRow(ImGuiTableRowFlags_Headers);
 			ImGui::TableNextRow(0);
+
+			ImGui::TableSetColumnIndex(0);
 			ImGui::PushID(0);
 
+			ImGui::SetNextItemWidth(50);
+
 			const char *modes[] = { "Member", "Behavior", "Location", "Ink", "Blend", "Extended" };
 			enum { kModeMember, kModeBehavior, kModeLocation, kModeInk, kModeBlend, kModeExtended };
 
 			const char *selMode = modes[_state->_scoreMode];
 
-			if (ImGui::BeginCombo("modeCombo", selMode)) {
+			if (ImGui::BeginCombo("##", selMode)) {
 				for (int n = 0; n < ARRAYSIZE(modes); n++) {
 					const bool selected = (_state->_scoreMode == n);
 					if (ImGui::Selectable(modes[n], selected))
@@ -1909,16 +1915,18 @@ static void showScore() {
 				ImGui::TableSetColumnIndex(i + 1);
 				const char *column_name = ImGui::TableGetColumnName(i + 1);
 				ImGui::PushID(i + 1);
+
+				ImGui::SetNextItemWidth(20);
 				ImGui::TableHeader(column_name);
 				ImGui::PopID();
 			}
 
-			//ImGui::TableHeadersRow();
 			for (int ch = 0; ch < (int)numChannels - 1; ch++) {
 				ImGui::TableNextRow();
 
 				ImGui::TableNextColumn();
 				ImGui::Text("%-3d", ch + 1);
+				ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImGui::GetColorU32(ImGuiCol_TableHeaderBg));
 
 				for (uint f = 0; f < numFrames; f++) {
 					Sprite &sprite = *score->_scoreCache[f]->_sprites[ch + 1];
@@ -1931,13 +1939,14 @@ static void showScore() {
 					if (f == _state->_selectedScoreCast.frame && ch == _state->_selectedScoreCast.channel - 1)
 						ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImGui::GetColorU32(ImVec4(0.7f, 0.7f, 0.7f, 0.3f)));
 
-					if (sprite._castId.member) {
+					if (sprite._castId.member)
 						ImGui::Text("%d", sprite._castId.member);
+					else
+						ImGui::Text("  ");
 
-						if (ImGui::IsItemClicked(0)) {
-							_state->_selectedScoreCast.frame = f;
-							_state->_selectedScoreCast.channel = ch + 1;
-						}
+					if (ImGui::IsItemClicked(0)) {
+						_state->_selectedScoreCast.frame = f;
+						_state->_selectedScoreCast.channel = ch + 1;
 					}
 				}
 			}


Commit: f1c92c7ec0f8f0d2e706651cbbae50fc8be7532b
    https://github.com/scummvm/scummvm/commit/f1c92c7ec0f8f0d2e706651cbbae50fc8be7532b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-21T08:58:55+02:00

Commit Message:
DIRECTOR: DEBUGGER: Render different Score modes

Changed paths:
    engines/director/debugtools.cpp


diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index 753eb6f012f..39392d339e9 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -1696,6 +1696,69 @@ static void showBreakpointList() {
 	ImGui::End();
 }
 
+enum { kModeMember, kModeBehavior, kModeLocation, kModeInk, kModeBlend, kModeExtended };
+const char *modes[] = { "Member", "Behavior", "Location", "Ink", "Blend", "Extended" };
+
+static void displayScoreChannel(int ch, int mode, int modeSel) {
+	Score *score = g_director->getCurrentMovie()->getScore();
+	const uint numFrames = score->_scoreCache.size();
+
+	const uint currentFrameNum = score->getCurrentFrameNum();
+	const ImU32 cell_bg_color = ImGui::GetColorU32(ImVec4(0.7f, 0.7f, 0.0f, 0.65f));
+
+	ImGui::TableNextRow();
+
+	{
+		ImGui::TableNextColumn();
+		ImGui::Indent();
+
+		if (modeSel != kModeExtended || mode == kModeExtended)
+			ImGui::Text("%3d", ch);
+		else
+			ImGui::Text(modes[mode]);
+
+		ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImGui::GetColorU32(ImGuiCol_TableHeaderBg));
+		ImGui::Unindent();
+	}
+
+	for (uint f = 0; f < numFrames; f++) {
+		Sprite &sprite = *score->_scoreCache[f]->_sprites[ch];
+
+		if (f == currentFrameNum)
+			ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, cell_bg_color);
+
+		ImGui::TableNextColumn();
+
+		if (f == _state->_selectedScoreCast.frame && ch == _state->_selectedScoreCast.channel - 1)
+			ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImGui::GetColorU32(ImVec4(0.7f, 0.7f, 0.7f, 0.3f)));
+
+		switch (mode) {
+		case kModeMember:
+			if (sprite._castId.member)
+				ImGui::Text("%d", sprite._castId.member);
+			else
+				ImGui::Text("  ");
+			break;
+
+		case kModeLocation:
+			if (sprite._castId.member)
+				ImGui::Text("%d, %d", sprite._startPoint.x, sprite._startPoint.y);
+			else
+				ImGui::Text("  ");
+			break;
+
+		case kModeExtended: // Render empty row
+		default:
+			ImGui::Text("  ");
+		}
+
+		if (ImGui::IsItemClicked(0)) {
+			_state->_selectedScoreCast.frame = f;
+			_state->_selectedScoreCast.channel = ch;
+		}
+	}
+}
+
 static void showScore() {
 	if (!_state->_w.score)
 		return;
@@ -1869,9 +1932,6 @@ static void showScore() {
 		uint numChannels = score->_scoreCache[0]->_sprites.size();
 		uint tableColumns = MAX(numFrames + 5, 25U); // Set minimal table width to 25
 
-		uint currentFrameNum = score->getCurrentFrameNum();
-		ImU32 cell_bg_color = ImGui::GetColorU32(ImVec4(0.7f, 0.7f, 0.0f, 0.65f));
-
 		if (ImGui::BeginTable("Score", tableColumns + 1,
 					ImGuiTableFlags_Borders | ImGuiTableFlags_HighlightHoveredColumn |
 					ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg)) {
@@ -1891,9 +1951,6 @@ static void showScore() {
 
 			ImGui::SetNextItemWidth(50);
 
-			const char *modes[] = { "Member", "Behavior", "Location", "Ink", "Blend", "Extended" };
-			enum { kModeMember, kModeBehavior, kModeLocation, kModeInk, kModeBlend, kModeExtended };
-
 			const char *selMode = modes[_state->_scoreMode];
 
 			if (ImGui::BeginCombo("##", selMode)) {
@@ -1921,34 +1978,26 @@ static void showScore() {
 				ImGui::PopID();
 			}
 
-			for (int ch = 0; ch < (int)numChannels - 1; ch++) {
-				ImGui::TableNextRow();
-
-				ImGui::TableNextColumn();
-				ImGui::Text("%-3d", ch + 1);
-				ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImGui::GetColorU32(ImGuiCol_TableHeaderBg));
+			int mode = _state->_scoreMode;
 
-				for (uint f = 0; f < numFrames; f++) {
-					Sprite &sprite = *score->_scoreCache[f]->_sprites[ch + 1];
+			for (int ch = 0; ch < (int)numChannels - 1; ch++) {
+				if (mode == kModeExtended) // This will render empty row
+					displayScoreChannel(ch + 1, kModeExtended, _state->_scoreMode);
 
-					if (f == currentFrameNum)
-						ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, cell_bg_color);
+				if (mode == kModeMember || mode == kModeExtended)
+					displayScoreChannel(ch + 1, kModeMember, _state->_scoreMode);
 
-					ImGui::TableNextColumn();
+				if (mode == kModeBehavior || mode == kModeExtended)
+					displayScoreChannel(ch + 1, kModeBehavior, _state->_scoreMode);
 
-					if (f == _state->_selectedScoreCast.frame && ch == _state->_selectedScoreCast.channel - 1)
-						ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImGui::GetColorU32(ImVec4(0.7f, 0.7f, 0.7f, 0.3f)));
+				if (mode == kModeInk || mode == kModeExtended)
+					displayScoreChannel(ch + 1, kModeInk, _state->_scoreMode);
 
-					if (sprite._castId.member)
-						ImGui::Text("%d", sprite._castId.member);
-					else
-						ImGui::Text("  ");
+				if (mode == kModeBlend || mode == kModeExtended)
+					displayScoreChannel(ch + 1, kModeBlend, _state->_scoreMode);
 
-					if (ImGui::IsItemClicked(0)) {
-						_state->_selectedScoreCast.frame = f;
-						_state->_selectedScoreCast.channel = ch + 1;
-					}
-				}
+				if (mode == kModeLocation || mode == kModeExtended)
+					displayScoreChannel(ch + 1, kModeLocation, _state->_scoreMode);
 			}
 			ImGui::EndTable();
 		}


Commit: 1c94550496fab38687844df5f2624fa04b1844c0
    https://github.com/scummvm/scummvm/commit/1c94550496fab38687844df5f2624fa04b1844c0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-05-21T08:58:55+02:00

Commit Message:
DIRECTOR: DEBUGGER: Improve Score extended mode and implemented rest of the modes

Changed paths:
    engines/director/debugtools.cpp


diff --git a/engines/director/debugtools.cpp b/engines/director/debugtools.cpp
index 39392d339e9..08bbc7f2122 100644
--- a/engines/director/debugtools.cpp
+++ b/engines/director/debugtools.cpp
@@ -1708,6 +1708,9 @@ static void displayScoreChannel(int ch, int mode, int modeSel) {
 
 	ImGui::TableNextRow();
 
+	if (modeSel == kModeExtended && mode == kModeExtended)
+		ImGui::TableSetBgColor(ImGuiTableBgTarget_RowBg0, ImGui::GetColorU32(ImGuiCol_TableRowBgAlt));
+
 	{
 		ImGui::TableNextColumn();
 		ImGui::Indent();
@@ -1729,7 +1732,7 @@ static void displayScoreChannel(int ch, int mode, int modeSel) {
 
 		ImGui::TableNextColumn();
 
-		if (f == _state->_selectedScoreCast.frame && ch == _state->_selectedScoreCast.channel - 1)
+		if (f == _state->_selectedScoreCast.frame && ch == _state->_selectedScoreCast.channel)
 			ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ImGui::GetColorU32(ImVec4(0.7f, 0.7f, 0.7f, 0.3f)));
 
 		switch (mode) {
@@ -1740,11 +1743,25 @@ static void displayScoreChannel(int ch, int mode, int modeSel) {
 				ImGui::Text("  ");
 			break;
 
+		case kModeInk:
+			ImGui::Text("%s", inkType2str(sprite._ink));
+			break;
+
 		case kModeLocation:
-			if (sprite._castId.member)
-				ImGui::Text("%d, %d", sprite._startPoint.x, sprite._startPoint.y);
-			else
-				ImGui::Text("  ");
+			ImGui::Text("%d, %d", sprite._startPoint.x, sprite._startPoint.y);
+			break;
+
+		case kModeBlend:
+			ImGui::Text("%d", sprite._blendAmount);
+			break;
+
+		case kModeBehavior:
+			if (sprite._scriptId.member) {
+				ImGui::TextColored(ImVec4(0.5f, 0.5f, 1.0f, 1.0f), "%s", sprite._scriptId.asString().c_str());
+
+				if (ImGui::IsItemClicked(0))
+					addScriptCastToDisplay(sprite._scriptId);
+			}
 			break;
 
 		case kModeExtended: // Render empty row
@@ -1819,7 +1836,7 @@ static void showScore() {
 			if (castMember) {
 				ImGui::Text("%s", inkType2str(sprite->_ink)); ImGui::SameLine();
 				ImGui::SetItemTooltip("Ink");
-				ImGui::Text("0x%x", sprite->_blendAmount);  ImGui::SameLine();
+				ImGui::Text("%d", sprite->_blendAmount);  ImGui::SameLine();
 				ImGui::SetItemTooltip("Blend");
 			}
 			ImGui::PopStyleColor();
@@ -1932,9 +1949,11 @@ static void showScore() {
 		uint numChannels = score->_scoreCache[0]->_sprites.size();
 		uint tableColumns = MAX(numFrames + 5, 25U); // Set minimal table width to 25
 
+		ImGuiTableFlags addonFlags = _state->_scoreMode == kModeExtended ? 0 : ImGuiTableFlags_RowBg;
+
 		if (ImGui::BeginTable("Score", tableColumns + 1,
 					ImGuiTableFlags_Borders | ImGuiTableFlags_HighlightHoveredColumn |
-					ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | ImGuiTableFlags_RowBg)) {
+					ImGuiTableFlags_ScrollX | ImGuiTableFlags_ScrollY | addonFlags)) {
 			ImGuiTableFlags flags = ImGuiTableColumnFlags_WidthFixed;
 
 			ImGui::TableSetupScrollFreeze(1, 1);




More information about the Scummvm-git-logs mailing list