You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AI-assisted issue. Filed by agent driven by @Cervator via GDD.
Context
During the DI migration review (#5299), the black save preview screenshot was identified as a known issue. Investigation found two contributing causes — one now fixed, one remaining.
Problem / Current State
Save game preview images are always black. Two issues were involved:
ScreenGrabber not visible from CoreRegistry (fixed):ScreenGrabber was registered only in WorldRendererImpl's private child context. ReadWriteStorageManager.saveGamePreviewImage() resolves it via CoreRegistry.get(ScreenGrabber.class), which returned null. Fixed by propagating the instance to CoreRegistry in WorldRendererImpl.init().
Framebuffer empty at capture time (remaining): The save and screenshot capture happen during StateIngame.dispose() (line 133), after the game's render loop has stopped updating the framebuffer. ScreenGrabber.saveScreenshot() reads sceneFinalFbo.getColorBufferRawData() which returns stale or cleared data. The screenshot file IS written to disk but contains a black image.
Acceptance Criteria
Save preview images show an actual in-game screenshot when loading a saved game
Technical Notes
StateIngame.dispose() calls storageManager.waitForCompletionOfPreviousSaveAndStartSaving() at line 133
startSaving() calls saveGamePreviewImage() at line 432
ScreenGrabber.saveScreenshot() reads the FBO at line 101 — the buffer is empty because no render pass has occurred since the game loop stopped
The world renderer is still alive at save time (disposed at line 146-149, after save) but is no longer actively rendering
Likely fix: trigger a final render pass before the dispose/save sequence, or capture the screenshot earlier (e.g., on the last frame before exit)
Context
During the DI migration review (#5299), the black save preview screenshot was identified as a known issue. Investigation found two contributing causes — one now fixed, one remaining.
Problem / Current State
Save game preview images are always black. Two issues were involved:
ScreenGrabber not visible from CoreRegistry (fixed):
ScreenGrabberwas registered only inWorldRendererImpl's private child context.ReadWriteStorageManager.saveGamePreviewImage()resolves it viaCoreRegistry.get(ScreenGrabber.class), which returned null. Fixed by propagating the instance to CoreRegistry inWorldRendererImpl.init().Framebuffer empty at capture time (remaining): The save and screenshot capture happen during
StateIngame.dispose()(line 133), after the game's render loop has stopped updating the framebuffer.ScreenGrabber.saveScreenshot()readssceneFinalFbo.getColorBufferRawData()which returns stale or cleared data. The screenshot file IS written to disk but contains a black image.Acceptance Criteria
Technical Notes
StateIngame.dispose()callsstorageManager.waitForCompletionOfPreviousSaveAndStartSaving()at line 133startSaving()callssaveGamePreviewImage()at line 432ScreenGrabber.saveScreenshot()reads the FBO at line 101 — the buffer is empty because no render pass has occurred since the game loop stoppedRelated