|
From: <dv...@us...> - 2008-04-25 22:18:26
|
Revision: 157
http://dunelegacy.svn.sourceforge.net/dunelegacy/?rev=157&view=rev
Author: dvalin
Date: 2008-04-25 15:18:04 -0700 (Fri, 25 Apr 2008)
Log Message:
-----------
use shared ptr
Modified Paths:
--------------
branches/dunks/include/pakfile/Cpsfile.h
branches/dunks/src/pakfile/Cpsfile.cpp
Modified: branches/dunks/include/pakfile/Cpsfile.h
===================================================================
--- branches/dunks/include/pakfile/Cpsfile.h 2008-04-24 22:22:22 UTC (rev 156)
+++ branches/dunks/include/pakfile/Cpsfile.h 2008-04-25 22:18:04 UTC (rev 157)
@@ -1,9 +1,15 @@
#ifndef CPSFILE_H_INCLUDED
#define CPSFILE_H_INCLUDED
+#include "Gfx.h"
#include "pakfile/Decode.h"
#include "SDL.h"
+#include <boost/shared_ptr.hpp>
+
+class Cpsfile;
+typedef boost::shared_ptr<Cpsfile> CpsfilePtr;
+
class Cpsfile : public Decode
{
public:
@@ -11,7 +17,7 @@
~Cpsfile();
- SDL_Surface * getPicture();
+ Image * getPicture();
private:
unsigned char* Filedata;
Modified: branches/dunks/src/pakfile/Cpsfile.cpp
===================================================================
--- branches/dunks/src/pakfile/Cpsfile.cpp 2008-04-24 22:22:22 UTC (rev 156)
+++ branches/dunks/src/pakfile/Cpsfile.cpp 2008-04-25 22:18:04 UTC (rev 157)
@@ -20,7 +20,7 @@
;
}
-SDL_Surface* Cpsfile::getPicture()
+Image * Cpsfile::getPicture()
{
unsigned char * ImageOut;
SDL_Surface *pic = NULL;
@@ -61,8 +61,10 @@
}
SDL_UnlockSurface(pic);
+
+ Image * img = new Image(pic);
+
+// free(ImageOut);
- free(ImageOut);
-
- return pic;
+ return img;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|