[Scummvm-git-logs] scummvm master -> 29d6b3f28602e4711bc9f51809552c735a49c28b
sev-
noreply at scummvm.org
Tue Sep 10 22:49:51 UTC 2024
This automated email contains information about 6 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
85184c6b46 QDENGINE: Remove obsolete STUB warning
6b09e7da88 QDENGINE: DT: Implement QDA rewinding and jumping to the last frame
ffe2238c16 QDENGINE: DT: Added total frame number to display
d1d0a0e58d QDENGINE: DT: Refactor browser for preps for different file types
3171b7ad10 QDENGINE: Fix names in qdSprite
29d6b3f286 QDENGINE: DT: Implement TGA image browsing
Commit: 85184c6b46cd01f8f5aae6f7c14dcb4abbb05a98
https://github.com/scummvm/scummvm/commit/85184c6b46cd01f8f5aae6f7c14dcb4abbb05a98
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-10T23:57:26+02:00
Commit Message:
QDENGINE: Remove obsolete STUB warning
Changed paths:
engines/qdengine/qdcore/qd_game_object_moving.cpp
diff --git a/engines/qdengine/qdcore/qd_game_object_moving.cpp b/engines/qdengine/qdcore/qd_game_object_moving.cpp
index a5316e58b60..913dae4c411 100644
--- a/engines/qdengine/qdcore/qd_game_object_moving.cpp
+++ b/engines/qdengine/qdcore/qd_game_object_moving.cpp
@@ -1911,7 +1911,6 @@ bool qdGameObjectMoving::keyboard_move() {
if (!is_control_disabled() && has_control_type(CONTROL_KEYBOARD)) {
bool keypress = false;
- warning("STUB: qdGameObjectMoving::keyboard_move()");
static int vkeys[6] = { VK_DOWN, VK_RIGHT, VK_UP, VK_LEFT, VK_DOWN, VK_RIGHT };
Commit: 6b09e7da880208947867f82d9f3dfaf52af071e2
https://github.com/scummvm/scummvm/commit/6b09e7da880208947867f82d9f3dfaf52af071e2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-11T00:01:40+02:00
Commit Message:
QDENGINE: DT: Implement QDA rewinding and jumping to the last frame
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 7e41a329eac..0c769530db3 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -232,7 +232,10 @@ void showArchives() {
if (ImGui::BeginTabItem("Animation")) {
- ImGui::Button("\ue020"); // Fast Rewind // fast_rewind
+ if (ImGui::Button("\ue020")) { // Fast Rewind // fast_rewind
+ _state->_qdaToDisplayFrame = 0;
+ _state->_qdaIsPlaying = false;
+ }
ImGui::SameLine();
if (ImGui::Button("\ue045")) { // Skip Previous // skip_previous
@@ -248,8 +251,13 @@ void showArchives() {
_state->_qdaToDisplayFrame += 1;
_state->_qdaToDisplayFrame %= totalFrames;
}
+
ImGui::SameLine();
- ImGui::Button("\ue01f"); // Fast Forward // fast_forward
+ if (ImGui::Button("\ue01f")) { // Fast Forward // fast_forward
+ _state->_qdaToDisplayFrame = totalFrames - 1;
+ _state->_qdaIsPlaying = false;
+ }
+
ImGui::SameLine();
// Frame Count
Commit: ffe2238c16619cdfbce833a98c4b3d5060daab9f
https://github.com/scummvm/scummvm/commit/ffe2238c16619cdfbce833a98c4b3d5060daab9f
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-11T00:04:09+02:00
Commit Message:
QDENGINE: DT: Added total frame number to display
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 0c769530db3..17f60642d05 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -221,8 +221,8 @@ void showArchives() {
if (!_state->_qdaToDisplay.empty()) {
imgID = getImageID(_state->_qdaToDisplay, _state->_qdaToDisplayFrame);
- ImGui::Text("Frame %s: %d [%d x %d]", transCyrillic(_state->_qdaToDisplay.toString()), _state->_qdaToDisplayFrame,
- imgID.width, imgID.height);
+ ImGui::Text("Frame %s: %d of %d [%d x %d]", transCyrillic(_state->_qdaToDisplay.toString()), _state->_qdaToDisplayFrame + 1,
+ totalFrames, imgID.width, imgID.height);
} else {
ImGui::Text("Frame <none>");
}
Commit: d1d0a0e58db40db0825bb817bf8a914f00f4e47e
https://github.com/scummvm/scummvm/commit/d1d0a0e58db40db0825bb817bf8a914f00f4e47e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-11T00:13:43+02:00
Commit Message:
QDENGINE: DT: Refactor browser for preps for different file types
Changed paths:
engines/qdengine/debugger/debugtools.cpp
engines/qdengine/debugger/dt-internal.h
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 17f60642d05..3b684e339bf 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -159,6 +159,94 @@ void populateFileList() {
Common::sort(_state->_files.begin(), _state->_files.end());
}
+static void displayQDA() {
+ int totalFrames = _state->_qdaToDisplayFrameCount;
+
+ ImGuiImage imgID;
+ if (!_state->_fileToDisplay.empty()) {
+ imgID = getImageID(_state->_fileToDisplay, _state->_qdaToDisplayFrame);
+
+ ImGui::Text("Frame %s: %d of %d [%d x %d]", transCyrillic(_state->_fileToDisplay.toString()), _state->_qdaToDisplayFrame + 1,
+ totalFrames, imgID.width, imgID.height);
+ } else {
+ ImGui::Text("Frame <none>");
+ }
+
+ ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
+ if (ImGui::BeginTabBar("FrameTabBar", tab_bar_flags)) {
+
+ if (ImGui::BeginTabItem("Animation")) {
+
+ if (ImGui::Button("\ue020")) { // Fast Rewind // fast_rewind
+ _state->_qdaToDisplayFrame = 0;
+ _state->_qdaIsPlaying = false;
+ }
+
+ ImGui::SameLine();
+ if (ImGui::Button("\ue045")) { // Skip Previous // skip_previous
+ _state->_qdaToDisplayFrame = _state->_qdaToDisplayFrame + totalFrames - 1;
+ _state->_qdaToDisplayFrame %= totalFrames;
+ }
+ ImGui::SameLine();
+ if (ImGui::Button("\ue037")) // Play // play_arrow
+ _state->_qdaIsPlaying = !_state->_qdaIsPlaying;
+
+ ImGui::SameLine();
+ if (ImGui::Button("\ue044")) { // Skip Next // skip_next
+ _state->_qdaToDisplayFrame += 1;
+ _state->_qdaToDisplayFrame %= totalFrames;
+ }
+
+ ImGui::SameLine();
+ if (ImGui::Button("\ue01f")) { // Fast Forward // fast_forward
+ _state->_qdaToDisplayFrame = totalFrames - 1;
+ _state->_qdaIsPlaying = false;
+ }
+
+ ImGui::SameLine();
+
+ // Frame Count
+ char buf[6];
+ snprintf(buf, 6, "%d", _state->_qdaToDisplayFrame);
+
+ ImGui::SetNextItemWidth(35);
+ ImGui::InputText("##frame", buf, 5, ImGuiInputTextFlags_CharsDecimal);
+ ImGui::SetItemTooltip("Frame");
+
+ ImGui::Separator();
+
+ if (!_state->_fileToDisplay.empty()) {
+ showImage(imgID, (char *)transCyrillic(_state->_fileToDisplay.toString()), 2.0);
+ } else {
+ ImGui::InvisibleButton("##canvas", ImVec2(32.f, 32.f));
+ }
+
+ ImGui::SameLine();
+
+ imgID = getImageID(_state->_fileToDisplay, -_state->_qdaToDisplayFrame - 1);
+
+ showImage(imgID, (char *)transCyrillic(_state->_fileToDisplay.toString()), 2.0);
+
+ ImGui::EndTabItem();
+ }
+
+ if (ImGui::BeginTabItem("Tiles")) {
+ if (!_state->_fileToDisplay.empty()) {
+ imgID = getImageID(_state->_fileToDisplay, TILES_ID);
+
+ showImage(imgID, (char *)transCyrillic(_state->_fileToDisplay.toString()), 1.0);
+ } else {
+ ImGui::InvisibleButton("##canvas", ImVec2(32.f, 32.f));
+ }
+
+ ImGui::EndTabItem();
+ }
+
+ ImGui::EndTabBar();
+ }
+}
+
+
void showArchives() {
if (!_state->_showArchives)
return;
@@ -197,11 +285,16 @@ void showArchives() {
for (auto &it : _state->_files) {
const char *fileName = (char *)transCyrillic(it.baseName());
if (_state->_nameFilter.PassFilter(fileName)) {
- if (ImGui::Selectable(fileName, _state->_qdaToDisplay == it)) {
+ if (ImGui::Selectable(fileName, _state->_fileToDisplay == it)) {
+ _state->_fileToDisplay = it;
+
if (it.baseName().hasSuffixIgnoreCase(".qda")) {
- _state->_qdaToDisplay = it;
_state->_qdaToDisplayFrame = 0;
_state->_qdaIsPlaying = false;
+
+ _state->_displayMode = kDisplayQDA;
+ } else {
+ _state->_displayMode = -1;
}
}
}
@@ -214,90 +307,8 @@ void showArchives() {
{ // Right pane
ImGui::BeginChild("ChildR", ImVec2(ImGui::GetContentRegionAvail().x, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_Border);
- int totalFrames = _state->_qdaToDisplayFrameCount;
-
-
- ImGuiImage imgID;
- if (!_state->_qdaToDisplay.empty()) {
- imgID = getImageID(_state->_qdaToDisplay, _state->_qdaToDisplayFrame);
-
- ImGui::Text("Frame %s: %d of %d [%d x %d]", transCyrillic(_state->_qdaToDisplay.toString()), _state->_qdaToDisplayFrame + 1,
- totalFrames, imgID.width, imgID.height);
- } else {
- ImGui::Text("Frame <none>");
- }
-
- ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
- if (ImGui::BeginTabBar("FrameTabBar", tab_bar_flags)) {
-
- if (ImGui::BeginTabItem("Animation")) {
-
- if (ImGui::Button("\ue020")) { // Fast Rewind // fast_rewind
- _state->_qdaToDisplayFrame = 0;
- _state->_qdaIsPlaying = false;
- }
-
- ImGui::SameLine();
- if (ImGui::Button("\ue045")) { // Skip Previous // skip_previous
- _state->_qdaToDisplayFrame = _state->_qdaToDisplayFrame + totalFrames - 1;
- _state->_qdaToDisplayFrame %= totalFrames;
- }
- ImGui::SameLine();
- if (ImGui::Button("\ue037")) // Play // play_arrow
- _state->_qdaIsPlaying = !_state->_qdaIsPlaying;
-
- ImGui::SameLine();
- if (ImGui::Button("\ue044")) { // Skip Next // skip_next
- _state->_qdaToDisplayFrame += 1;
- _state->_qdaToDisplayFrame %= totalFrames;
- }
-
- ImGui::SameLine();
- if (ImGui::Button("\ue01f")) { // Fast Forward // fast_forward
- _state->_qdaToDisplayFrame = totalFrames - 1;
- _state->_qdaIsPlaying = false;
- }
-
- ImGui::SameLine();
-
- // Frame Count
- char buf[6];
- snprintf(buf, 6, "%d", _state->_qdaToDisplayFrame);
-
- ImGui::SetNextItemWidth(35);
- ImGui::InputText("##frame", buf, 5, ImGuiInputTextFlags_CharsDecimal);
- ImGui::SetItemTooltip("Frame");
-
- ImGui::Separator();
-
- if (!_state->_qdaToDisplay.empty()) {
- showImage(imgID, (char *)transCyrillic(_state->_qdaToDisplay.toString()), 2.0);
- } else {
- ImGui::InvisibleButton("##canvas", ImVec2(32.f, 32.f));
- }
-
- ImGui::SameLine();
-
- imgID = getImageID(_state->_qdaToDisplay, -_state->_qdaToDisplayFrame - 1);
-
- showImage(imgID, (char *)transCyrillic(_state->_qdaToDisplay.toString()), 2.0);
-
- ImGui::EndTabItem();
- }
-
- if (ImGui::BeginTabItem("Tiles")) {
- if (!_state->_qdaToDisplay.empty()) {
- imgID = getImageID(_state->_qdaToDisplay, TILES_ID);
-
- showImage(imgID, (char *)transCyrillic(_state->_qdaToDisplay.toString()), 1.0);
- } else {
- ImGui::InvisibleButton("##canvas", ImVec2(32.f, 32.f));
- }
-
- ImGui::EndTabItem();
- }
-
- ImGui::EndTabBar();
+ if (_state->_displayMode == kDisplayQDA) {
+ displayQDA();
}
ImGui::EndChild();
diff --git a/engines/qdengine/debugger/dt-internal.h b/engines/qdengine/debugger/dt-internal.h
index 3ebee5e4eda..34be48fb577 100644
--- a/engines/qdengine/debugger/dt-internal.h
+++ b/engines/qdengine/debugger/dt-internal.h
@@ -30,12 +30,18 @@ typedef struct ImGuiImage {
int height;
} ImGuiImage;
+enum {
+ kDisplayQDA,
+ kDisplayTGA,
+};
+
typedef struct ImGuiState {
bool _showArchives = false;
Common::HashMap<Common::String, ImGuiImage> _frames;
- Common::Path _qdaToDisplay;
+ Common::Path _fileToDisplay;
+
int _qdaToDisplayFrame = -1;
int _qdaToDisplayFrameCount = 0;
bool _qdaIsPlaying = false;
@@ -44,6 +50,8 @@ typedef struct ImGuiState {
ImGuiTextFilter _nameFilter;
Common::List<Common::Path> _files;
+
+ int _displayMode = -1;
} ImGuiState;
extern ImGuiState *_state;
Commit: 3171b7ad105820b7dd778462c5219e415c51bcf8
https://github.com/scummvm/scummvm/commit/3171b7ad105820b7dd778462c5219e415c51bcf8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-11T00:24:08+02:00
Commit Message:
QDENGINE: Fix names in qdSprite
Changed paths:
engines/qdengine/qdcore/qd_sprite.h
diff --git a/engines/qdengine/qdcore/qd_sprite.h b/engines/qdengine/qdcore/qd_sprite.h
index 8ad9dfce1e3..fa7ee77a2c7 100644
--- a/engines/qdengine/qdcore/qd_sprite.h
+++ b/engines/qdengine/qdcore/qd_sprite.h
@@ -174,8 +174,8 @@ public:
}
//! УÑÑÐ°Ð½Ð°Ð²Ð»Ð¸Ð²Ð°ÐµÑ Ð¸Ð¼Ñ Ñайла, в коÑоÑом Ñ
ÑанÑÑÑÑ Ð´Ð°Ð½Ð½Ñе ÑеÑÑÑÑа.
- void set_resource_file(const Common::Path _filename) {
- set_file(_filename);
+ void set_resource_file(const Common::Path filename) {
+ set_file(filename);
}
//! ÐозвÑаÑÐ°ÐµÑ Ð¸Ð¼Ñ Ñайла, в коÑоÑом Ñ
ÑанÑÑÑÑ Ð´Ð°Ð½Ð½Ñе ÑеÑÑÑÑа.
/**
Commit: 29d6b3f28602e4711bc9f51809552c735a49c28b
https://github.com/scummvm/scummvm/commit/29d6b3f28602e4711bc9f51809552c735a49c28b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-11T00:49:18+02:00
Commit Message:
QDENGINE: DT: Implement TGA image browsing
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 3b684e339bf..473615e5645 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -76,51 +76,67 @@ ImGuiImage getImageID(Common::Path filename, int frameNum) {
if (_state->_frames.contains(key))
return _state->_frames[key];
- // Load the animation
- qdAnimation *animation = new qdAnimation();
- animation->qda_load(filename);
-
- _state->_qdaToDisplayFrameCount = animation->num_frames();
-
int sx = 10, sy = 10;
Graphics::ManagedSurface *surface = nullptr;
- if (frameNum == TILES_ID) {
- if (animation->tileAnimation()) {
- surface = animation->tileAnimation()->dumpTiles(25);
+ if (_state->_displayMode == kDisplayQDA) {
+ // Load the animation
+ qdAnimation *animation = new qdAnimation();
+ animation->qda_load(filename);
- sx = surface->w;
- sy = surface->h;
- }
- } else if (frameNum < 0) { // Tiles
- if (animation->tileAnimation()) {
- surface = animation->tileAnimation()->dumpFrameTiles(-frameNum + 1, 0.91670f);
+ _state->_qdaToDisplayFrameCount = animation->num_frames();
- sx = surface->w;
- sy = surface->h;
- }
- } else {
- if (animation->tileAnimation()) {
- Vect2i size = animation->tileAnimation()->frameSize();
+ if (frameNum == TILES_ID) {
+ if (animation->tileAnimation()) {
+ surface = animation->tileAnimation()->dumpTiles(25);
+
+ sx = surface->w;
+ sy = surface->h;
+ }
+ } else if (frameNum < 0) { // Tiles
+ if (animation->tileAnimation()) {
+ surface = animation->tileAnimation()->dumpFrameTiles(-frameNum + 1, 0.91670f);
- sx = size.x;
- sy = size.y;
+ sx = surface->w;
+ sy = surface->h;
+ }
} else {
- qdAnimationFrame *frame = animation->get_frame(frameNum);
+ if (animation->tileAnimation()) {
+ Vect2i size = animation->tileAnimation()->frameSize();
+
+ sx = size.x;
+ sy = size.y;
+ } else {
+ qdAnimationFrame *frame = animation->get_frame(frameNum);
- if (frame) {
- sx = frame->size_x();
- sy = frame->size_y();
+ if (frame) {
+ sx = frame->size_x();
+ sy = frame->size_y();
+ }
}
- }
- surface = new Graphics::ManagedSurface(sx, sy, g_engine->_pixelformat);
+ surface = new Graphics::ManagedSurface(sx, sy, g_engine->_pixelformat);
- animation->set_cur_frame(frameNum);
+ animation->set_cur_frame(frameNum);
- grDispatcher::instance()->surfaceOverride(surface);
- animation->redraw(sx / 2, sy / 2, 0, 0.91670f, 0);
- grDispatcher::instance()->resetSurfaceOverride();
+ grDispatcher::instance()->surfaceOverride(surface);
+ animation->redraw(sx / 2, sy / 2, 0, 0.91670f, 0);
+ grDispatcher::instance()->resetSurfaceOverride();
+ }
+ } else if (_state->_displayMode == kDisplayTGA) {
+ qdSprite *sprite = new qdSprite();
+ if (sprite->load(filename)) {
+ sx = sprite->size_x();
+ sy = sprite->size_y();
+
+ surface = new Graphics::ManagedSurface(sx, sy, g_engine->_pixelformat);
+
+ grDispatcher::instance()->surfaceOverride(surface);
+ sprite->redraw(sx / 2, sy / 2, 0);
+ grDispatcher::instance()->resetSurfaceOverride();
+ } else {
+ warning("Error loading TGA file '%s'", transCyrillic(filename.toString()));
+ }
}
if (surface)
@@ -246,6 +262,17 @@ static void displayQDA() {
}
}
+static void displayTGA() {
+ ImGuiImage imgID;
+
+ imgID = getImageID(_state->_fileToDisplay, 0);
+
+ ImGui::Text("TGA %s: [%d x %d]", transCyrillic(_state->_fileToDisplay.toString()), imgID.width, imgID.height);
+
+ ImGui::Separator();
+
+ showImage(imgID, (char *)transCyrillic(_state->_fileToDisplay.toString()), 1.0);
+}
void showArchives() {
if (!_state->_showArchives)
@@ -293,6 +320,8 @@ void showArchives() {
_state->_qdaIsPlaying = false;
_state->_displayMode = kDisplayQDA;
+ } else if (it.baseName().hasSuffixIgnoreCase(".tga")) {
+ _state->_displayMode = kDisplayTGA;
} else {
_state->_displayMode = -1;
}
@@ -309,6 +338,8 @@ void showArchives() {
if (_state->_displayMode == kDisplayQDA) {
displayQDA();
+ } else if (_state->_displayMode == kDisplayTGA) {
+ displayTGA();
}
ImGui::EndChild();
More information about the Scummvm-git-logs
mailing list