Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit a522544

Browse files
committed
Fix screenshots saving in original resolution after change
1 parent 80a634a commit a522544

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Managers/FrameMan.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,9 @@ namespace RTE {
312312
m_PlayerScreenWidth = m_PlayerScreen->w;
313313
m_PlayerScreenHeight = m_PlayerScreen->h;
314314
}
315+
316+
m_ScreenDumpBuffer = create_bitmap_ex(24, screen->w, screen->h);
317+
315318
return 0;
316319
}
317320

@@ -774,7 +777,10 @@ namespace RTE {
774777
break;
775778
case ScreenDump:
776779
if (screen) {
777-
if (!m_ScreenDumpBuffer) { m_ScreenDumpBuffer = create_bitmap_ex(24, screen->w, screen->h); }
780+
if (m_ScreenDumpBuffer->w != screen->w || m_ScreenDumpBuffer->h != screen->h) {
781+
destroy_bitmap(m_ScreenDumpBuffer);
782+
m_ScreenDumpBuffer = create_bitmap_ex(24, screen->w, screen->h);
783+
}
778784
blit(screen, m_ScreenDumpBuffer, 0, 0, 0, 0, screen->w, screen->h);
779785
// nullptr for the PALETTE parameter here because we're saving a 24bpp file and it's irrelevant.
780786
if (save_png(fullFileName, m_ScreenDumpBuffer, nullptr) == 0) {

0 commit comments

Comments
 (0)