mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-02-18 12:04:42 +02:00
The skin images will now be loaded using SurfaceCollection::getSkinFilePath().
This commit is contained in:
parent
114fe594d0
commit
fe25cf341d
@ -26,6 +26,7 @@ using namespace std;
|
|||||||
#include "surface.h"
|
#include "surface.h"
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
#include "surfacecollection.h"
|
||||||
|
|
||||||
RGBAColor strtorgba(const string &strColor) {
|
RGBAColor strtorgba(const string &strColor) {
|
||||||
RGBAColor c = {0,0,0,255};
|
RGBAColor c = {0,0,0,255};
|
||||||
@ -116,13 +117,10 @@ void Surface::load(const string &img, bool alpha, const string &skin) {
|
|||||||
free();
|
free();
|
||||||
|
|
||||||
string skinpath;
|
string skinpath;
|
||||||
if (!skin.empty() && !img.empty() && img[0]!='/') {
|
if (!skin.empty() && !img.empty() && img[0]!='/')
|
||||||
skinpath = "skins/"+skin+"/"+img;
|
skinpath = SurfaceCollection::getSkinFilePath(skin, img);
|
||||||
if (!fileExists(skinpath))
|
else
|
||||||
skinpath = "skins/Default/"+img;
|
skinpath = img;
|
||||||
} else {
|
|
||||||
skinpath = img;
|
|
||||||
}
|
|
||||||
|
|
||||||
SDL_Surface *buf = IMG_Load(skinpath.c_str());
|
SDL_Surface *buf = IMG_Load(skinpath.c_str());
|
||||||
if (buf!=NULL) {
|
if (buf!=NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user