[Scummvm-git-logs] scummvm master -> f448363bb0321371b254898868d019818ce32962
sev-
noreply at scummvm.org
Thu Sep 5 15:00:35 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:
f448363bb0 QDENGINE: More fixes to frame rendering
Commit: f448363bb0321371b254898868d019818ce32962
https://github.com/scummvm/scummvm/commit/f448363bb0321371b254898868d019818ce32962
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2024-09-05T17:00:15+02:00
Commit Message:
QDENGINE: More fixes to frame rendering
Changed paths:
engines/qdengine/debugger/debugtools.cpp
diff --git a/engines/qdengine/debugger/debugtools.cpp b/engines/qdengine/debugger/debugtools.cpp
index 688585cbb3d..147d9ce417b 100644
--- a/engines/qdengine/debugger/debugtools.cpp
+++ b/engines/qdengine/debugger/debugtools.cpp
@@ -82,7 +82,7 @@ ImGuiImage getImageID(Common::Path filename, int frameNum) {
int sx = 10, sy = 10;
if (frame) {
sx = frame->size_x();
- sy = frame->size_x();
+ sy = frame->size_y();
}
Graphics::ManagedSurface surface(sx, sy, g_engine->_pixelformat);
@@ -100,18 +100,12 @@ ImGuiImage getImageID(Common::Path filename, int frameNum) {
}
void showImage(const ImGuiImage &image, const char *name, float thumbnailSize) {
- ImVec2 size;
- if (image.width > image.height) {
- size = {thumbnailSize - 2, (thumbnailSize - 2) * image.height / image.width};
- } else {
- size = {(thumbnailSize - 2) * image.width / image.height, thumbnailSize - 2};
- }
+ ImVec2 size = { (float)image.width * 2, (float)image.height * 2 };
+
ImGui::BeginGroup();
ImVec2 screenPos = ImGui::GetCursorScreenPos();
- ImGui::GetWindowDrawList()->AddRect(screenPos, screenPos + ImVec2(thumbnailSize, thumbnailSize), 0xFFFFFFFF);
- ImVec2 pos = ImGui::GetCursorPos();
- ImVec2 imgPos = pos + ImVec2(1 + (thumbnailSize - 2 - size.x) * 0.5f, 1 + (thumbnailSize - 2 - size.y) * 0.5f);
- ImGui::SetCursorPos(imgPos);
+ ImGui::GetWindowDrawList()->AddRect(screenPos, screenPos + ImVec2(size.x, size.y), 0xFFFFFFFF);
+
ImGui::Image(image.id, size);
ImGui::EndGroup();
//setToolTipImage(image, name);
More information about the Scummvm-git-logs
mailing list