[Scummvm-git-logs] scummvm master -> 06db2b426bacfdafdd2206c0f8f5cf36ceba634f
sev-
noreply at scummvm.org
Tue Sep 30 15:55:38 UTC 2025
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
a8e17996a2 WAGE: DT: Show list of scenes
2464d324cf WAGE: DT: Show scene scripts
5eb8e22f90 WAGE: DT: Enlist characters, objects and sounds
06db2b426b WAGE: DT: Initial code for object displaying
Commit: a8e17996a2224f29824dca4aa296de99e3ca0f34
https://github.com/scummvm/scummvm/commit/a8e17996a2224f29824dca4aa296de99e3ca0f34
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-30T16:01:11+02:00
Commit Message:
WAGE: DT: Show list of scenes
Changed paths:
engines/wage/debugtools.cpp
engines/wage/dt-internal.h
diff --git a/engines/wage/debugtools.cpp b/engines/wage/debugtools.cpp
index 54d3b21d4b3..4498ff71a1f 100644
--- a/engines/wage/debugtools.cpp
+++ b/engines/wage/debugtools.cpp
@@ -166,14 +166,58 @@ static void showWorld() {
if (!_state->_showWorld)
return;
- ImGui::SetNextWindowPos(ImVec2(20, 20), ImGuiCond_FirstUseEver);
- ImGui::SetNextWindowSize(ImVec2(300, 250), ImGuiCond_FirstUseEver);
+ // Calculate the viewport size
+ ImVec2 viewportSize = ImGui::GetMainViewport()->Size;
+
+ // Calculate the window size
+ ImVec2 windowSize = ImVec2(
+ viewportSize.x * 0.9f,
+ viewportSize.y * 0.9f
+ );
+
+ // Calculate the centered position
+ ImVec2 centeredPosition = ImVec2(
+ (viewportSize.x - windowSize.x) * 0.5f,
+ (viewportSize.y - windowSize.y) * 0.5f
+ );
- if (ImGui::Begin("Scene Objects", &_state->_showWorld)) {
+ // Set the next window position and size
+ ImGui::SetNextWindowPos(centeredPosition, ImGuiCond_FirstUseEver);
+ ImGui::SetNextWindowSize(windowSize, ImGuiCond_FirstUseEver);
+
+ if (ImGui::Begin("World", &_state->_showWorld)) {
ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
+
if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) {
if (ImGui::BeginTabItem("Scenes")) {
- ImGui::Text("This is the Avocado tab!\nblah blah blah blah blah");
+
+ { // Left pane
+ ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.4f, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_None);
+
+ if (ImGui::BeginListBox("##listbox scenes", ImVec2(-FLT_MIN, ImGui::GetContentRegionAvail().y))) {
+ for (int n = 0; n < g_wage->_world->_orderedScenes.size(); n++) {
+ const bool is_selected = (_state->_selectedScene == n);
+ if (ImGui::Selectable(g_wage->_world->_orderedScenes[n]->_name.c_str(), is_selected))
+ _state->_selectedScene = n;
+
+ // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
+ if (is_selected)
+ ImGui::SetItemDefaultFocus();
+ }
+ ImGui::EndListBox();
+ }
+
+ ImGui::EndChild();
+ }
+
+ { // Right pane
+ ImGui::BeginChild("ChildR", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_Borders);
+
+ ImGui::Text("Resource");
+
+ ImGui::EndChild();
+ }
+
ImGui::EndTabItem();
}
if (ImGui::BeginTabItem("Objects")) {
diff --git a/engines/wage/dt-internal.h b/engines/wage/dt-internal.h
index a7dff6829ec..3f4c7d320d3 100644
--- a/engines/wage/dt-internal.h
+++ b/engines/wage/dt-internal.h
@@ -40,8 +40,7 @@ typedef struct ImGuiState {
ImGuiTextFilter _nameFilter;
-
- int _displayMode = -1;
+ int _selectedScene = -1;
} ImGuiState;
extern ImGuiState *_state;
Commit: 2464d324cfa57e062e5a93dcb41891966449e063
https://github.com/scummvm/scummvm/commit/2464d324cfa57e062e5a93dcb41891966449e063
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-30T16:01:12+02:00
Commit Message:
WAGE: DT: Show scene scripts
Changed paths:
engines/wage/debugtools.cpp
engines/wage/dt-internal.h
diff --git a/engines/wage/debugtools.cpp b/engines/wage/debugtools.cpp
index 4498ff71a1f..204c977c8bb 100644
--- a/engines/wage/debugtools.cpp
+++ b/engines/wage/debugtools.cpp
@@ -81,63 +81,6 @@ static void displayTGA() {
showImage(imgID, (char *)transCyrillic(_state->_fileToDisplay.toString()), 1.0);
}
-void showArchives() {
- if (!_state->_showArchives)
- return;
-
- // Calculate the viewport size
- ImVec2 viewportSize = ImGui::GetMainViewport()->Size;
-
- // Calculate the window size
- ImVec2 windowSize = ImVec2(
- viewportSize.x * 0.9f,
- viewportSize.y * 0.9f
- );
-
- // Calculate the centered position
- ImVec2 centeredPosition = ImVec2(
- (viewportSize.x - windowSize.x) * 0.5f,
- (viewportSize.y - windowSize.y) * 0.5f
- );
-
- // Set the next window position and size
- ImGui::SetNextWindowPos(centeredPosition, ImGuiCond_FirstUseEver);
- ImGui::SetNextWindowSize(windowSize, ImGuiCond_FirstUseEver);
-
- if (ImGui::Begin("Archives", &_state->_showArchives)) {
- ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.4f, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_None);
-
- ImGui::Button(ICON_MS_FILTER_ALT);
- ImGui::SameLine();
-
- _state->_nameFilter.Draw();
- ImGui::Separator();
-
- if (_state->_files.children.empty())
- populateFileList();
-
- displayTree(&_state->_files);
-
- ImGui::EndChild();
-
- ImGui::SameLine();
-
- { // Right pane
- ImGui::BeginChild("ChildR", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_Borders);
-
- if (_state->_displayMode == kDisplayQDA) {
- displayQDA();
- } else if (_state->_displayMode == kDisplayTGA) {
- displayTGA();
- }
-
- ImGui::EndChild();
- }
-
- }
- ImGui::End();
-}
-
void showSceneObjects() {
if (!_state->_showSceneObjects)
return;
@@ -188,7 +131,7 @@ static void showWorld() {
if (ImGui::Begin("World", &_state->_showWorld)) {
ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
- if (ImGui::BeginTabBar("MyTabBar", tab_bar_flags)) {
+ if (ImGui::BeginTabBar("MainTabBar", tab_bar_flags)) {
if (ImGui::BeginTabItem("Scenes")) {
{ // Left pane
@@ -210,10 +153,32 @@ static void showWorld() {
ImGui::EndChild();
}
+ ImGui::SameLine();
+
{ // Right pane
ImGui::BeginChild("ChildR", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_Borders);
- ImGui::Text("Resource");
+ if (ImGui::BeginTabBar("SceneTabBar", tab_bar_flags)) {
+ if (ImGui::BeginTabItem("Script")) {
+ if (g_wage->_world->_orderedScenes[_state->_selectedScene]->_script && g_wage->_world->_orderedScenes[_state->_selectedScene]->_script->_scriptText.size()) {
+ for (auto &t : g_wage->_world->_orderedScenes[_state->_selectedScene]->_script->_scriptText) {
+ ImGui::Text("[%4d]", t->offset);
+ ImGui::SameLine();
+ ImGui::Text("%s", t->line.c_str());
+ }
+ } else {
+ ImGui::Text("No script");
+ }
+ ImGui::EndTabItem();
+ }
+
+ if (ImGui::BeginTabItem("Design")) {
+ ImGui::Text("This is the Broccoli tab!\nblah blah blah blah blah");
+ ImGui::EndTabItem();
+ }
+
+ ImGui::EndTabBar();
+ }
ImGui::EndChild();
}
diff --git a/engines/wage/dt-internal.h b/engines/wage/dt-internal.h
index 3f4c7d320d3..25a3f2c0f9e 100644
--- a/engines/wage/dt-internal.h
+++ b/engines/wage/dt-internal.h
@@ -40,7 +40,7 @@ typedef struct ImGuiState {
ImGuiTextFilter _nameFilter;
- int _selectedScene = -1;
+ int _selectedScene = 0;
} ImGuiState;
extern ImGuiState *_state;
Commit: 5eb8e22f90080f08c3e6d926aae24b294966a0f2
https://github.com/scummvm/scummvm/commit/5eb8e22f90080f08c3e6d926aae24b294966a0f2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-30T17:08:52+02:00
Commit Message:
WAGE: DT: Enlist characters, objects and sounds
Changed paths:
engines/wage/debugtools.cpp
engines/wage/dt-internal.h
diff --git a/engines/wage/debugtools.cpp b/engines/wage/debugtools.cpp
index 204c977c8bb..8185d532f04 100644
--- a/engines/wage/debugtools.cpp
+++ b/engines/wage/debugtools.cpp
@@ -33,6 +33,7 @@
#include "wage/wage.h"
#include "wage/dt-internal.h"
#include "wage/script.h"
+#include "wage/sound.h"
#include "wage/world.h"
namespace Wage {
@@ -140,7 +141,8 @@ static void showWorld() {
if (ImGui::BeginListBox("##listbox scenes", ImVec2(-FLT_MIN, ImGui::GetContentRegionAvail().y))) {
for (int n = 0; n < g_wage->_world->_orderedScenes.size(); n++) {
const bool is_selected = (_state->_selectedScene == n);
- if (ImGui::Selectable(g_wage->_world->_orderedScenes[n]->_name.c_str(), is_selected))
+ Common::String label = Common::String::format("%s##%d", g_wage->_world->_orderedScenes[n]->_name.c_str(), n);
+ if (ImGui::Selectable(label.c_str(), is_selected))
_state->_selectedScene = n;
// Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
@@ -185,18 +187,108 @@ static void showWorld() {
ImGui::EndTabItem();
}
+
if (ImGui::BeginTabItem("Objects")) {
- ImGui::Text("This is the Broccoli tab!\nblah blah blah blah blah");
+ { // Left pane
+ ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.4f, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_None);
+
+ if (ImGui::BeginListBox("##listbox objects", ImVec2(-FLT_MIN, ImGui::GetContentRegionAvail().y))) {
+ for (int n = 0; n < g_wage->_world->_orderedObjs.size(); n++) {
+ const bool is_selected = (_state->_selectedObj == n);
+ Common::String label = Common::String::format("%s##%d", g_wage->_world->_orderedObjs[n]->_name.c_str(), n);
+ if (ImGui::Selectable(label.c_str(), is_selected))
+ _state->_selectedObj = n;
+
+ // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
+ if (is_selected)
+ ImGui::SetItemDefaultFocus();
+ }
+ ImGui::EndListBox();
+ }
+
+ ImGui::EndChild();
+ }
+
+ ImGui::SameLine();
+
+ { // Right pane
+ ImGui::BeginChild("ChildR", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_Borders);
+
+ ImGui::Text("Object design");
+
+ ImGui::EndChild();
+ }
+
ImGui::EndTabItem();
}
+
if (ImGui::BeginTabItem("Characters")) {
- ImGui::Text("This is the Cucumber tab!\nblah blah blah blah blah");
+ { // Left pane
+ ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.4f, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_None);
+
+ if (ImGui::BeginListBox("##listbox characters", ImVec2(-FLT_MIN, ImGui::GetContentRegionAvail().y))) {
+ for (int n = 0; n < g_wage->_world->_orderedChrs.size(); n++) {
+ const bool is_selected = (_state->_selectedChr == n);
+ Common::String label = Common::String::format("%s##%d", g_wage->_world->_orderedChrs[n]->_name.c_str(), n);
+ if (ImGui::Selectable(label.c_str(), is_selected))
+ _state->_selectedChr = n;
+
+ // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
+ if (is_selected)
+ ImGui::SetItemDefaultFocus();
+ }
+ ImGui::EndListBox();
+ }
+
+ ImGui::EndChild();
+ }
+
+ ImGui::SameLine();
+
+ { // Right pane
+ ImGui::BeginChild("ChildR", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_Borders);
+
+ ImGui::Text("Character design");
+
+ ImGui::EndChild();
+ }
+
ImGui::EndTabItem();
}
+
if (ImGui::BeginTabItem("Sounds")) {
- ImGui::Text("This is the Sounds tab!\nblah blah blah blah blah");
+ { // Left pane
+ ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.4f, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_None);
+
+ if (ImGui::BeginListBox("##listbox sounds", ImVec2(-FLT_MIN, ImGui::GetContentRegionAvail().y))) {
+ for (int n = 0; n < g_wage->_world->_orderedSounds.size(); n++) {
+ const bool is_selected = (_state->_selectedSound == n);
+ Common::String label = Common::String::format("%s##%d", g_wage->_world->_orderedSounds[n]->_name.c_str(), n);
+ if (ImGui::Selectable(label.c_str(), is_selected))
+ _state->_selectedSound = n;
+
+ // Set the initial focus when opening the combo (scrolling + keyboard navigation focus)
+ if (is_selected)
+ ImGui::SetItemDefaultFocus();
+ }
+ ImGui::EndListBox();
+ }
+
+ ImGui::EndChild();
+ }
+
+ ImGui::SameLine();
+
+ { // Right pane
+ ImGui::BeginChild("ChildR", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_Borders);
+
+ ImGui::Text("Sound playback");
+
+ ImGui::EndChild();
+ }
ImGui::EndTabItem();
}
+
if (ImGui::BeginTabItem("Global Script")) {
for (auto &t : g_wage->_world->_globalScript->_scriptText) {
ImGui::Text("[%4d]", t->offset);
@@ -205,6 +297,7 @@ static void showWorld() {
}
ImGui::EndTabItem();
}
+
if (ImGui::BeginTabItem("World")) {
ImGui::Text("This is the Global Script tab!\nblah blah blah blah blah");
ImGui::EndTabItem();
diff --git a/engines/wage/dt-internal.h b/engines/wage/dt-internal.h
index 25a3f2c0f9e..ade4d3c3360 100644
--- a/engines/wage/dt-internal.h
+++ b/engines/wage/dt-internal.h
@@ -41,6 +41,9 @@ typedef struct ImGuiState {
ImGuiTextFilter _nameFilter;
int _selectedScene = 0;
+ int _selectedObj = 0;
+ int _selectedChr = 0;
+ int _selectedSound = 0;
} ImGuiState;
extern ImGuiState *_state;
Commit: 06db2b426bacfdafdd2206c0f8f5cf36ceba634f
https://github.com/scummvm/scummvm/commit/06db2b426bacfdafdd2206c0f8f5cf36ceba634f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2025-09-30T17:55:02+02:00
Commit Message:
WAGE: DT: Initial code for object displaying
Changed paths:
engines/wage/debugtools.cpp
engines/wage/dt-internal.h
diff --git a/engines/wage/debugtools.cpp b/engines/wage/debugtools.cpp
index 8185d532f04..c57b7ed8e78 100644
--- a/engines/wage/debugtools.cpp
+++ b/engines/wage/debugtools.cpp
@@ -32,6 +32,7 @@
#include "wage/wage.h"
#include "wage/dt-internal.h"
+#include "wage/design.h"
#include "wage/script.h"
#include "wage/sound.h"
#include "wage/world.h"
@@ -40,25 +41,23 @@ namespace Wage {
ImGuiState *_state = nullptr;
-ImGuiImage getImageID(Common::Path filename, int frameNum) {
- Common::String key = Common::String::format("%s:%d", filename.toString().c_str(), frameNum);
+ImGuiImage getImageID(Designed *d, const char *type) {
+ Common::String key = Common::String::format("%s:%s", d->_name.c_str(), type);
- if (_state->_frames.contains(key))
- return _state->_frames[key];
+ if (_state->_images.contains(key))
+ return _state->_images[key];
- int sx = 10, sy = 10;
- Graphics::ManagedSurface *surface = nullptr;
+ int sx = d->_design->getBounds()->width(), sy = d->_design->getBounds()->height();
+ Graphics::ManagedSurface surface(sx, sy);
- if (surface)
- _state->_frames[key] = { (ImTextureID)g_system->getImGuiTexture(*surface->surfacePtr()), sx, sy };
+ d->_design->paint(&surface, *g_wage->_world->_patterns, 0, 0);
- delete surface;
+ _state->_images[key] = { (ImTextureID)g_system->getImGuiTexture(*surface.surfacePtr()), sx, sy };
- return _state->_frames[key];
+ return _state->_images[key];
}
-#if 0
-void showImage(const ImGuiImage &image, const char *name, float scale) {
+void showImage(const ImGuiImage &image, float scale) {
ImVec2 size = { (float)image.width * scale, (float)image.height * scale };
ImGui::BeginGroup();
@@ -67,9 +66,9 @@ void showImage(const ImGuiImage &image, const char *name, float scale) {
ImGui::Image(image.id, size);
ImGui::EndGroup();
- //setToolTipImage(image, name);
}
+#if 0
static void displayTGA() {
ImGuiImage imgID;
@@ -214,7 +213,9 @@ static void showWorld() {
{ // Right pane
ImGui::BeginChild("ChildR", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_Borders);
- ImGui::Text("Object design");
+ //ImGuiImage imgID = getImageID(g_wage->_world->_orderedObjs[_state->_selectedObj], "obj");
+
+ //showImage(imgID, 1.0);
ImGui::EndChild();
}
diff --git a/engines/wage/dt-internal.h b/engines/wage/dt-internal.h
index ade4d3c3360..b76902e3ab0 100644
--- a/engines/wage/dt-internal.h
+++ b/engines/wage/dt-internal.h
@@ -33,10 +33,7 @@ typedef struct ImGuiImage {
typedef struct ImGuiState {
bool _showWorld = false;
- Common::HashMap<Common::String, ImGuiImage> _frames;
-
- Common::Path _fileToDisplay;
- Common::String _objectToDisplay;
+ Common::HashMap<Common::String, ImGuiImage> _images;
ImGuiTextFilter _nameFilter;
More information about the Scummvm-git-logs
mailing list