[Scummvm-git-logs] scummvm master -> d385b74f52c3f362581a8ffda57f4555a8566ec5
sev-
noreply at scummvm.org
Thu Sep 5 11:58:23 UTC 2024
This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c94a7d1985 QDENGINE: DT: Remove redundant TreeNode from the debugger file list
d1edd65007 QDENGINE: DT: Add a call to transCyrillic while rendering file list
295ca488ec QDENGINE: DT: Add support to icons
883561c204 QDENGINE: DT: Add a Search Filter to the file list
6f303f0af6 QDENGINE: DT: Add methods to set and reset `_surfaceOverride`
f699d08a53 QDENGINE: DT: Add a check for which graphics surface to write to
717c8c5e00 QDENGINE: DT: Load selected animation from filelist
d385b74f52 QDENGINE: DT: Restructure the debugger
Commit: c94a7d1985fd2ce938b716bf8cbfe5e695652dac
https://github.com/scummvm/scummvm/commit/c94a7d1985fd2ce938b716bf8cbfe5e695652dac
Author: kunxl-gg (tiwari.25 at iitj.ac.in)
Date: 2024-09-05T13:58:17+02:00
Commit Message:
QDENGINE: DT: Remove redundant TreeNode from the debugger file list
Signed-off-by: kunxl-gg <tiwari.25 at iitj.ac.in>
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 9020184db91..48b2f4d1f51 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -85,13 +85,10 @@ void showArchives() {
if (archive && ImGui::TreeNode(Common::String::format("Resource/resource%d.pak", i).c_str())) {
for (auto &it : members) {
- if (ImGui::TreeNode(Common::String::format("%s", transCyrillic(it->getFileName().c_str())).c_str())) {
- if (ImGui::Selectable(Common::String::format("%d", i).c_str())) {
- }
-
- ImGui::TreePop();
+ if (ImGui::Selectable(Common::String::format("%s", it->getFileName().c_str()).c_str())) {
}
+
}
ImGui::TreePop();
Commit: d1edd65007f380a819439ef943e8575b4e0a8bfd
https://github.com/scummvm/scummvm/commit/d1edd65007f380a819439ef943e8575b4e0a8bfd
Author: kunxl-gg (tiwari.25 at iitj.ac.in)
Date: 2024-09-05T13:58:17+02:00
Commit Message:
QDENGINE: DT: Add a call to transCyrillic while rendering file list
Signed-off-by: kunxl-gg <tiwari.25 at iitj.ac.in>
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 48b2f4d1f51..2546dd0c3e2 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -86,7 +86,8 @@ void showArchives() {
for (auto &it : members) {
- if (ImGui::Selectable(Common::String::format("%s", it->getFileName().c_str()).c_str())) {
+ if (ImGui::Selectable(Common::String::format("%s", transCyrillic(it->getFileName().c_str())).c_str())) {
+
}
}
Commit: 295ca488ecba1e9b2dfdfb3f544f03bd55ee0881
https://github.com/scummvm/scummvm/commit/295ca488ecba1e9b2dfdfb3f544f03bd55ee0881
Author: kunxl-gg (tiwari.25 at iitj.ac.in)
Date: 2024-09-05T13:58:17+02:00
Commit Message:
QDENGINE: DT: Add support to icons
Signed-off-by: kunxl-gg <tiwari.25 at iitj.ac.in>
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 2546dd0c3e2..2978b0a938e 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -115,6 +115,7 @@ static void showScore() {
void onImGuiInit() {
ImGuiIO &io = ImGui::GetIO();
+ io.Fonts->AddFontDefault();
static const ImWchar cyrillic_ranges[] = {
0x0020, 0x00FF, // Basic Latin + Latin Supplement
@@ -124,6 +125,16 @@ void onImGuiInit() {
io.FontDefault = ImGui::addTTFFontFromArchive("FreeSans.ttf", 16.0f, nullptr, cyrillic_ranges);;
+ ImFontConfig icons_config;
+ icons_config.MergeMode = true;
+ icons_config.PixelSnapH = false;
+ icons_config.OversampleH = 3;
+ icons_config.OversampleV = 3;
+ icons_config.GlyphOffset = {0, 4};
+
+ static const ImWchar icons_ranges[] = {0xE000, 0xF8FF, 0};
+ ImGui::addTTFFontFromArchive("MaterialSymbolsSharp.ttf", 16.f, &icons_config, icons_ranges);
+
_state = new ImGuiState();
memset(_state, 0, sizeof(ImGuiState));
}
Commit: 883561c2043bc61ffb567caabb0c052dfa0e4ce2
https://github.com/scummvm/scummvm/commit/883561c2043bc61ffb567caabb0c052dfa0e4ce2
Author: kunxl-gg (tiwari.25 at iitj.ac.in)
Date: 2024-09-05T13:58:17+02:00
Commit Message:
QDENGINE: DT: Add a Search Filter to the file list
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 2978b0a938e..dc7c670d70b 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -74,6 +74,13 @@ void showArchives() {
if (ImGui::Begin("Archives", &_state->_showArchives)) {
ImGui::BeginChild("ChildL", ImVec2(ImGui::GetContentRegionAvail().x * 0.3f, ImGui::GetContentRegionAvail().y), ImGuiChildFlags_None);
+ ImGui::Button("\uef4f"); // Filter // filter_alt
+ ImGui::SameLine();
+
+ ImGuiTextFilter nameFilter;
+ nameFilter.Draw();
+ ImGui::Separator();
+
// Iterate through the 3 resource pak files
for (int i = 0; i < 3; i++) {
Common::Archive *archive = qdFileManager::instance().get_package(i);
@@ -86,7 +93,8 @@ void showArchives() {
for (auto &it : members) {
- if (ImGui::Selectable(Common::String::format("%s", transCyrillic(it->getFileName().c_str())).c_str())) {
+ const char *fileName = it->getFileName().c_str();
+ if (nameFilter.PassFilter(fileName) && ImGui::Selectable(Common::String::format("%s", transCyrillic(it->getFileName().c_str())).c_str())) {
}
Commit: 6f303f0af609baf8d3544cd8270fc0b11745007b
https://github.com/scummvm/scummvm/commit/6f303f0af609baf8d3544cd8270fc0b11745007b
Author: kunxl-gg (tiwari.25 at iitj.ac.in)
Date: 2024-09-05T13:58:17+02:00
Commit Message:
QDENGINE: DT: Add methods to set and reset `_surfaceOverride`
Signed-off-by: kunxl-gg <tiwari.25 at iitj.ac.in>
Changed paths:
engines/qdengine/system/graphics/gr_dispatcher.cpp
engines/qdengine/system/graphics/gr_dispatcher.h
diff --git a/engines/qdengine/system/graphics/gr_dispatcher.cpp b/engines/qdengine/system/graphics/gr_dispatcher.cpp
index 91e64fed791..2d7826e50dd 100644
--- a/engines/qdengine/system/graphics/gr_dispatcher.cpp
+++ b/engines/qdengine/system/graphics/gr_dispatcher.cpp
@@ -350,6 +350,14 @@ void grDispatcher::erase(int x, int y, int sx, int sy, int col) {
return;
}
+void grDispatcher::surfaceOverride(Graphics::ManagedSurface *target) {
+ _surfaceOverride = target;
+}
+
+void grDispatcher::resetSurfaceOverride() {
+ _surfaceOverride = nullptr;
+}
+
void grDispatcher::setPixel(int x, int y, int col) {
if (_clipMode && !clipCheck(x, y)) return;
diff --git a/engines/qdengine/system/graphics/gr_dispatcher.h b/engines/qdengine/system/graphics/gr_dispatcher.h
index bfb8c371ed4..509326a6c65 100644
--- a/engines/qdengine/system/graphics/gr_dispatcher.h
+++ b/engines/qdengine/system/graphics/gr_dispatcher.h
@@ -238,6 +238,9 @@ public:
void setPixel(int x, int y, int r, int g, int b);
+ void surfaceOverride(Graphics::ManagedSurface *target);
+ void resetSurfaceOverride();
+
void getPixel(int x, int y, uint16 &col);
void getPixel(int x, int y, byte &r, byte &g, byte &b);
@@ -496,6 +499,7 @@ protected:
void *_hWnd;
Graphics::ManagedSurface *_screenBuf = nullptr;
+ Graphics::ManagedSurface * _surfaceOverride = nullptr;
int *_yTable;
Commit: f699d08a53ea01a9db0844bbc946a0055a185492
https://github.com/scummvm/scummvm/commit/f699d08a53ea01a9db0844bbc946a0055a185492
Author: kunxl-gg (tiwari.25 at iitj.ac.in)
Date: 2024-09-05T13:58:17+02:00
Commit Message:
QDENGINE: DT: Add a check for which graphics surface to write to
Signed-off-by: kunxl-gg <tiwari.25 at iitj.ac.in>
Changed paths:
engines/qdengine/system/graphics/gr_draw_sprite.cpp
engines/qdengine/system/graphics/gr_draw_sprite_rle.cpp
diff --git a/engines/qdengine/system/graphics/gr_draw_sprite.cpp b/engines/qdengine/system/graphics/gr_draw_sprite.cpp
index d8aa24c0e74..6b3866ceafa 100644
--- a/engines/qdengine/system/graphics/gr_draw_sprite.cpp
+++ b/engines/qdengine/system/graphics/gr_draw_sprite.cpp
@@ -165,9 +165,12 @@ void grDispatcher::putSpr_a(int x, int y, int sx, int sy, const byte *p, int mod
sx <<= 2;
px <<= 2;
+ Graphics::ManagedSurface *target = _surfaceOverride ? _surfaceOverride : _screenBuf;
+ if (target == _surfaceOverride)
+ debugC(3, kDebugImGui, "grDispatcher::putSpr_a(): _surfaceOverride: %p", (void *)target);
const byte *data_ptr = p + py * sx;
for (int i = 0; i < psy; i++) {
- uint16 *scr_buf = reinterpret_cast<uint16 *>(_screenBuf->getBasePtr(x, y));
+ uint16 *scr_buf = reinterpret_cast<uint16 *>(target->getBasePtr(x, y));
const byte *data_line = data_ptr + px;
for (int j = 0; j < psx; j++) {
@@ -614,6 +617,7 @@ void grDispatcher::putSpr(int x, int y, int sx, int sy, const byte *p, int mode,
} else
dy = 1;
+ Graphics::ManagedSurface *target = _surfaceOverride ? _surfaceOverride : _screenBuf;
if (spriteFormat == GR_RGB888) {
sx *= 3;
px *= 3;
@@ -621,7 +625,7 @@ void grDispatcher::putSpr(int x, int y, int sx, int sy, const byte *p, int mode,
const byte *data_ptr = p + py * sx;
for (int i = 0; i < psy; i++) {
- uint16 *scr_buf = reinterpret_cast<uint16 *>(_screenBuf->getBasePtr(x, y));
+ uint16 *scr_buf = reinterpret_cast<uint16 *>(target->getBasePtr(x, y));
const byte *data_line = data_ptr + px;
for (int j = 0; j < psx; j++) {
@@ -641,7 +645,7 @@ void grDispatcher::putSpr(int x, int y, int sx, int sy, const byte *p, int mode,
const byte *data_ptr = p + py * sx;
for (int i = 0; i < psy; i++) {
- uint16 *scr_buf = reinterpret_cast<uint16 *>(_screenBuf->getBasePtr(x, y));
+ uint16 *scr_buf = reinterpret_cast<uint16 *>(target->getBasePtr(x, y));
const byte *data_line = data_ptr + px;
for (int j = 0; j < psx; j++) {
diff --git a/engines/qdengine/system/graphics/gr_draw_sprite_rle.cpp b/engines/qdengine/system/graphics/gr_draw_sprite_rle.cpp
index 0d74aed3005..fa94cc40d92 100644
--- a/engines/qdengine/system/graphics/gr_draw_sprite_rle.cpp
+++ b/engines/qdengine/system/graphics/gr_draw_sprite_rle.cpp
@@ -57,8 +57,14 @@ void grDispatcher::putSpr_rle(int x, int y, int sx, int sy, const class RLEBuffe
} else
dy = 1;
+ Graphics::ManagedSurface *target = _surfaceOverride ? _surfaceOverride : _screenBuf;
+ if (target == _surfaceOverride) {
+ debugC(3, kDebugImGui, "grDispatcher::putSpr_rle(): %p", (void *)target);
+ debugC(3, kDebugImGui, "grDispatcher::putSpr_rle(%d, %d, %d, %d)", x, y, sx, sy);
+ }
+
for (int i = 0; i < psy; i++) {
- uint16 *scr_buf = reinterpret_cast<uint16 *>(_screenBuf->getBasePtr(x, y));
+ uint16 *scr_buf = reinterpret_cast<uint16 *>(target->getBasePtr(x, y));
const char *rle_header = p->header_ptr(py + i);
const uint32 *rle_data = p->data_ptr(py + i);
Commit: 717c8c5e0024f11ba12ba6f2001a30eaec8831ba
https://github.com/scummvm/scummvm/commit/717c8c5e0024f11ba12ba6f2001a30eaec8831ba
Author: kunxl-gg (tiwari.25 at iitj.ac.in)
Date: 2024-09-05T13:58:17+02:00
Commit Message:
QDENGINE: DT: Load selected animation from filelist
Signed-off-by: kunxl-gg <tiwari.25 at iitj.ac.in>
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index dc7c670d70b..c969dd37486 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -27,9 +27,15 @@
#include "common/debug.h"
#include "common/path.h"
-#include "qdengine/qdengine.h"
+#include "graphics/managed_surface.h"
+
#include "qdengine/debugger/debugtools.h"
+#include "qdengine/qd_fwd.h"
+#include "qdengine/qdcore/qd_animation.h"
+#include "qdengine/qdcore/qd_animation_frame.h"
#include "qdengine/qdcore/qd_file_manager.h"
+#include "qdengine/qdengine.h"
+#include "qdengine/system/graphics/gr_dispatcher.h"
namespace QDEngine {
@@ -93,8 +99,27 @@ void showArchives() {
for (auto &it : members) {
- const char *fileName = it->getFileName().c_str();
- if (nameFilter.PassFilter(fileName) && ImGui::Selectable(Common::String::format("%s", transCyrillic(it->getFileName().c_str())).c_str())) {
+ const char *fileName = (char *)transCyrillic(it->getFileName().c_str());
+ if (nameFilter.PassFilter(fileName) && ImGui::Selectable(fileName)) {
+ Common::Path fpath = Common::Path(it->getName());
+
+ // Load the animation
+ qdAnimation *animation = new qdAnimation();
+ animation->qda_load(fpath);
+
+ qdAnimationFrame *firstFrame = animation->get_frame(0);
+ debugC(3, kDebugImGui, "showArchives(): %p %d %d", (void *)firstFrame, firstFrame->size_x(), firstFrame->size_y());
+
+ Graphics::ManagedSurface *surface = new Graphics::ManagedSurface(800, 600);
+ grDispatcher::instance()->surfaceOverride(surface);
+
+ firstFrame->redraw(400, 300, 0);
+ grDispatcher::instance()->resetSurfaceOverride();
+
+ if (surface) {
+ int x = 390, y = 390;
+ debugC(3, kDebugImGui, "showArchives(): Pixel at (%d, %d): %d", x, y, surface->getPixel(390, 390));;
+ }
}
Commit: d385b74f52c3f362581a8ffda57f4555a8566ec5
https://github.com/scummvm/scummvm/commit/d385b74f52c3f362581a8ffda57f4555a8566ec5
Author: kunxl-gg (tiwari.25 at iitj.ac.in)
Date: 2024-09-05T13:58:17+02:00
Commit Message:
QDENGINE: DT: Restructure the debugger
Signed-off-by: kunxl-gg <tiwari.25 at iitj.ac.in>
Changed paths:
A engines/qdengine/debugger/debugger.h
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugger.h b/engines/qdengine/debugger/debugger.h
new file mode 100644
index 00000000000..a222346c6a8
--- /dev/null
+++ b/engines/qdengine/debugger/debugger.h
@@ -0,0 +1,52 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef QDENGINE_DEBUGGER_H
+#define QDENGINE_DEBUGGER_H
+
+#define IMGUI_DEFINE_MATH_OPERATORS
+
+#include "backends/imgui/imgui.h"
+#include "graphics/managed_surface.h"
+#include "graphics/surface.h"
+
+namespace QDEngine {
+
+// debugarchive.cpp
+typedef struct ImGuiState {
+ bool _showCallStack = false;
+ bool _showVars = false;
+ bool _showScore = false;
+ bool _showArchives = false;
+} ImGuiState;
+
+typedef struct ImGuiImage {
+ ImTextureID id;
+ int width;
+ int height;
+} ImGuiImage;
+
+extern ImGuiState *_state;
+extern Graphics::ManagedSurface *_surface;
+
+}
+
+#endif // QDENGINE_DEBUGGER_H
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index c969dd37486..253c073aecf 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -19,7 +19,6 @@
*
*/
-#include "backends/imgui/imgui.h"
#include "backends/imgui/imgui_fonts.h"
#include "common/archive.h"
@@ -27,9 +26,9 @@
#include "common/debug.h"
#include "common/path.h"
-#include "graphics/managed_surface.h"
-
+#include "qdengine/debugger/debugger.h"
#include "qdengine/debugger/debugtools.h"
+
#include "qdengine/qd_fwd.h"
#include "qdengine/qdcore/qd_animation.h"
#include "qdengine/qdcore/qd_animation_frame.h"
@@ -39,14 +38,8 @@
namespace QDEngine {
-typedef struct ImGuiState {
- bool _showCallStack = false;
- bool _showVars = false;
- bool _showScore = false;
- bool _showArchives = false;
-} ImGuiState;
-
ImGuiState *_state = nullptr;
+Graphics::ManagedSurface *_surface = nullptr;
static void showCallStack() {
}
@@ -110,17 +103,18 @@ void showArchives() {
qdAnimationFrame *firstFrame = animation->get_frame(0);
debugC(3, kDebugImGui, "showArchives(): %p %d %d", (void *)firstFrame, firstFrame->size_x(), firstFrame->size_y());
- Graphics::ManagedSurface *surface = new Graphics::ManagedSurface(800, 600);
- grDispatcher::instance()->surfaceOverride(surface);
+ grDispatcher::instance()->surfaceOverride(_surface);
firstFrame->redraw(400, 300, 0);
grDispatcher::instance()->resetSurfaceOverride();
- if (surface) {
+ if (_surface) {
int x = 390, y = 390;
- debugC(3, kDebugImGui, "showArchives(): Pixel at (%d, %d): %d", x, y, surface->getPixel(390, 390));;
+ debugC(3, kDebugImGui, "showArchives(): Pixel at (%d, %d): %d", x, y, _surface->getPixel(390, 390));;
}
+ _surface->clear(0);
+
}
}
@@ -170,6 +164,8 @@ void onImGuiInit() {
_state = new ImGuiState();
memset(_state, 0, sizeof(ImGuiState));
+
+ _surface = new Graphics::ManagedSurface(800, 600);
}
void onImGuiRender() {
More information about the Scummvm-git-logs
mailing list