First cleanup of image loading code

This commit is contained in:
Manuel Reimer
2014-10-28 16:54:37 +01:00
parent abd8fd8db0
commit 943c899288
5 changed files with 16 additions and 103 deletions

View File

@@ -711,8 +711,10 @@ void cView::DoDrawImage(int num, cTemplateFunction *func, int x0, int y0) {
break; }
case itImage: {
cImageLoader imgLoader;
if (imgLoader.LoadImage(path.c_str(), width, height)) {
DrawImage(num, pos, imgLoader.GetImage());
if (imgLoader.LoadImage(path.c_str())) {
cImage *image = imgLoader.GetImage(width, height);
DrawImage(num, pos, *image);
delete(image);
}
break; }
default: