Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
MachContinentMap: Fix transparency blending on map save-load
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaffeine committed Apr 24, 2023
1 parent 5d1609c commit 6ff7fce
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libdev/machgui/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1918,8 +1918,15 @@ void MachContinentMap::saveGame(PerOstream& outStream)
mapVisibleArea_.width() / MachGui::uiScaleFactor(),
mapVisibleArea_.height() / MachGui::uiScaleFactor(),
mapVisibleArea_);
visibleArea.filledRectangle(RenSurface::Rect(0, 0, visibleArea.width(), visibleArea.height()), Gui::BLACK());

GLint blendSrc, blendDst;
glGetIntegerv(GL_BLEND_SRC_ALPHA, &blendSrc);
glGetIntegerv(GL_BLEND_DST_ALPHA, &blendDst);
glBlendFunc(GL_ONE, GL_ZERO);

visibleArea.stretchBlit(mapVisibleArea_);
glBlendFunc(blendSrc, blendDst);
visibleArea.write(outStream);
}
}
Expand Down

0 comments on commit 6ff7fce

Please sign in to comment.