Debian Codegraph @

src/image.cpp

raw symbols ◀ ▶ SCIP
1 Debian patch touch this file
1 /***************************************************************************
2 image.cpp - description
3 -------------------
4 begin : Sat Aug 19 2000
5 copyright : (C) 2000 by Waldemar Baraldi
6 email : [email protected]
7 ***************************************************************************/
8
9 /***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18 #include "image.h"
19 #include "SDL_image.h"
20 #include <stdio.h>
21
•22 Image::Image(Str * filename):Graphic(){
23 if (filename) load(filename);
24 }
25
26 Image::Image(Image * im):Graphic(im){}
27
28 void Image::load(Str * filename){
29 SDL_Surface * aux_surface;
30
31 IMG_InvertAlpha(1);
32 if (surface) SDL_FreeSurface(surface);
33 aux_surface=IMG_Load(filename->get());
34 if (!aux_surface){
35 printf("Fatal Error : File %s not found\n", filename->get());
36 exit(-1);
37 }
38 surface=SDL_DisplayFormatAlpha(aux_surface);
39 SDL_FreeSurface(aux_surface);
40 delete filename;
41 }
42