From bc81ca2f4330d2a287289317837b7ad8058cb591 Mon Sep 17 00:00:00 2001 From: Alessandro Pignotti Date: Sun, 10 Jun 2012 19:54:54 +0200 Subject: [PATCH] [BitmapContainer] Add ::reset --- src/scripting/flash/display/BitmapContainer.cpp | 9 +++++++++ src/scripting/flash/display/BitmapContainer.h | 1 + 2 files changed, 10 insertions(+) diff --git a/src/scripting/flash/display/BitmapContainer.cpp b/src/scripting/flash/display/BitmapContainer.cpp index fa480a0..e057db2 100644 --- a/src/scripting/flash/display/BitmapContainer.cpp +++ b/src/scripting/flash/display/BitmapContainer.cpp @@ -80,3 +80,12 @@ bool BitmapContainer::fromPNG(std::istream &s) return fromRGB(rgb, (int32_t)w, (int32_t)h, false); } +void BitmapContainer::reset() +{ + data.clear(); + data.shrink_to_fit(); + stride=0; + dataSize=0; + width=0; + height=0; +} diff --git a/src/scripting/flash/display/BitmapContainer.h b/src/scripting/flash/display/BitmapContainer.h index fb0912d..69a363d 100644 --- a/src/scripting/flash/display/BitmapContainer.h +++ b/src/scripting/flash/display/BitmapContainer.h @@ -45,6 +45,7 @@ class BitmapContainer bool fromPNG(std::istream& s); int getWidth() const { return width; } int getHeight() const { return height; } + void reset(); }; }; -- 1.7.10