nsxiv6851d5c
Removed im member from img struct
+4 −5
2 files changed
| @@ -40,16 +40,18 @@ void imlib_destroy() { | |||
| 40 | 40 | } | |
| 41 | 41 | ||
| 42 | 42 | void img_load(img_t *img, const char *filename) { | |
| 43 | + | Imlib_Image *im; | |
| 44 | + | ||
| 43 | 45 | if (!img || !filename) | |
| 44 | 46 | return; | |
| 45 | 47 | ||
| 46 | 48 | if (imlib_context_get_image()) | |
| 47 | 49 | imlib_free_image(); | |
| 48 | 50 | ||
| 49 | − | if (!(img->im = imlib_load_image(filename))) | |
| 51 | + | if (!(im = imlib_load_image(filename))) | |
| 50 | 52 | DIE("could not open image: %s", filename); | |
| 51 | 53 | ||
| 52 | − | imlib_context_set_image(img->im); | |
| 54 | + | imlib_context_set_image(im); | |
| 53 | 55 | ||
| 54 | 56 | img->w = imlib_image_get_width(); | |
| 55 | 57 | img->h = imlib_image_get_height(); | |
| @@ -19,8 +19,6 @@ | |||
| 19 | 19 | #ifndef IMAGE_H | |
| 20 | 20 | #define IMAGE_H | |
| 21 | 21 | ||
| 22 | − | #include <Imlib2.h> | |
| 23 | − | ||
| 24 | 22 | #include "window.h" | |
| 25 | 23 | ||
| 26 | 24 | typedef enum scalemode_e { | |
| @@ -36,7 +34,6 @@ typedef struct img_s { | |||
| 36 | 34 | int h; | |
| 37 | 35 | int x; | |
| 38 | 36 | int y; | |
| 39 | − | Imlib_Image *im; | |
| 40 | 37 | } img_t; | |
| 41 | 38 | ||
| 42 | 39 | void imlib_init(win_t*); | |