Surface: Removed duplicate constructor.

There were two constructors that took an image path, skin name and alpha flag
as their arguments, but in different orders. We need only one of them.
This commit is contained in:
Maarten ter Huurne committed 2011-06-02 04:57:21 +02:00
1 parent b2896d6bac
commit 52c89d6005
3 files changed
+5 -14

No files matched your search

+2 -10
View File
@@ -42,10 +42,9 @@ Surface::Surface() {
dblbuffer = NULL;
}
Surface::Surface(const string &img, bool alpha, const string &skin) {
raw = NULL;
Surface::Surface(Surface *s) {
dblbuffer = NULL;
load(img, alpha, skin);
raw = SDL_DisplayFormat(s->raw);
halfW = raw->w/2;
halfH = raw->h/2;
}
@@ -58,13 +57,6 @@ Surface::Surface(const string &img, const string &skin, bool alpha) {
halfH = raw->h/2;
}
Surface::Surface(Surface *s) {
dblbuffer = NULL;
raw = SDL_DisplayFormat(s->raw);
halfW = raw->w/2;
halfH = raw->h/2;
}
Surface::~Surface() {
free();
}
+1 -2
View File
@@ -40,9 +40,8 @@ RGBAColor strtorgba(const string &strColor);
class Surface {
public:
Surface();
Surface(const string &img, const string &skin="", bool alpha=true);
Surface(const string &img, bool alpha, const string &skin="");
Surface(Surface *s);
Surface(const string &img, const string &skin="", bool alpha=true);
~Surface();
void enableVirtualDoubleBuffer(SDL_Surface *surface);
+2 -2
View File
@@ -80,7 +80,7 @@ Surface *SurfaceCollection::add(const string &path, bool alpha) {
return NULL;
} else if (!fileExists(filePath)) return NULL;
Surface *s = new Surface(filePath,alpha);
Surface *s = new Surface(filePath, "", alpha);
surfaces[path] = s;
return s;
}
@@ -94,7 +94,7 @@ Surface *SurfaceCollection::addSkinRes(const string &path, bool alpha) {
string skinpath = getSkinFilePath(path);
if (skinpath.empty())
return NULL;
Surface *s = new Surface(skinpath,alpha);
Surface *s = new Surface(skinpath, "", alpha);
if (s != NULL)
surfaces[path] = s;
return s;