mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-22 13:29:42 +02: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:
parent
b2896d6bac
commit
52c89d6005
@ -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();
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user