[Scummvm-cvs-logs] CVS: residual costume.cpp,1.4,1.5

Daniel Schepler dschepler at users.sourceforge.net
Tue Aug 19 19:06:03 CEST 2003


Update of /cvsroot/scummvm/residual
In directory sc8-pr-cvs1:/tmp/cvs-serv26761

Modified Files:
	costume.cpp 
Log Message:
Fixed crash when exiting a room with bitmapped objects.


Index: costume.cpp
===================================================================
RCS file: /cvsroot/scummvm/residual/costume.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- costume.cpp	19 Aug 2003 17:51:36 -0000	1.4
+++ costume.cpp	20 Aug 2003 01:15:36 -0000	1.5
@@ -34,7 +34,6 @@
   BitmapComponent(Costume::Component *parent, int parentID,
 		 const char *filename);
   BitmapComponent *copy(Costume::Component *newParent);
-  ~BitmapComponent();
 
   void update();
   void draw();
@@ -42,8 +41,8 @@
 private:
   std::string filename_;
   std::string zbuf_filename_;
-  Bitmap *bitmap_;
-  Bitmap *zbuffer_;
+  ResPtr<Bitmap> bitmap_;
+  ResPtr<Bitmap> zbuffer_;
 };
 
 class ModelComponent : public Costume::Component {
@@ -102,19 +101,10 @@
 
 BitmapComponent::BitmapComponent(Costume::Component *parent, int parentID,
 			       const char *filename) :
-  Costume::Component(parent, parentID), filename_(filename), bitmap_(NULL),
-  zbuffer_(NULL) {
+  Costume::Component(parent, parentID), filename_(filename) {
 
   bitmap_ = ResourceLoader::instance()->loadBitmap(filename);
   warning("Instanced BitmapComponenet from Costume renderer: NOT IMPLEMENTED YET");
-}
-
-BitmapComponent::~BitmapComponent() {
-  if (bitmap_)
-	delete[] bitmap_;
-
-  if (zbuffer_)
-	delete[] zbuffer_;
 }
 
 BitmapComponent *BitmapComponent::copy(Costume::Component *newParent) {





More information about the Scummvm-git-logs mailing list