aboutsummaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authorJoost Peters2006-05-30 21:22:52 +0000
committerJoost Peters2006-05-30 21:22:52 +0000
commit6ea375b8907374fba6b3594c207eba91c9ef7622 (patch)
tree6a9924c8d4ba73ba9ef402aff2fa44413483a9d9 /backends
parent4bdef42007daa757cbfb31ca6f2b85925064c26a (diff)
downloadscummvm-rg350-6ea375b8907374fba6b3594c207eba91c9ef7622.tar.gz
scummvm-rg350-6ea375b8907374fba6b3594c207eba91c9ef7622.tar.bz2
scummvm-rg350-6ea375b8907374fba6b3594c207eba91c9ef7622.zip
free old buffers when changing resolution in the non-GU backend (not that it's ever used, but anyway)
svn-id: r22787
Diffstat (limited to 'backends')
-rw-r--r--backends/psp/osys_psp.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/backends/psp/osys_psp.cpp b/backends/psp/osys_psp.cpp
index 1d5712e226..9bac3f28c6 100644
--- a/backends/psp/osys_psp.cpp
+++ b/backends/psp/osys_psp.cpp
@@ -115,8 +115,15 @@ int OSystem_PSP::getGraphicsMode() const {
void OSystem_PSP::initSize(uint width, uint height) {
_overlayWidth = _screenWidth = width;
_overlayHeight = _screenHeight = height;
+
+ if (_offscreen)
+ free(_offscreen);
+
_offscreen = (byte *)malloc(width * height);
+ if (_overlayBuffer)
+ free(_overlayBuffer);
+
_overlayBuffer = (OverlayColor *)malloc(_overlayWidth * _overlayHeight * sizeof(OverlayColor));
bzero(_offscreen, width * height);
clearOverlay();