1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-07-04 20:52:56 +03:00

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 2011-06-02 04:57:21 +02:00
parent b2896d6bac
commit 52c89d6005
3 changed files with 5 additions and 14 deletions

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();
}

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);

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;