The EXIF orientation information is now honored.
[gliv.git] / tools / gliv-image.gob
blob574a5d746ea30c767a06cdd9bf5ec0c9816169f5
1 %{
2 #include "gliv.h"
3 #include "opengl.h"
4 #include "options.h"
6 extern options_struct *options;
8 static int nb_images = 0;
12 %a{
13 #include "texture_map.h"
16 class Gliv:Image from G:Object {
17     public GList *node;
18     public gint number;
19     public gchar *ident;
20     public gint width;
21     public gint height;
22     public gint nb_maps;
23     public texture_map *maps;
24     public gboolean has_alpha;
25     public gboolean first_image;
26     public gfloat initial_angle;
27     public gboolean initial_h_flip;
29     public GlivImage *new(void)
30     {
31         /* This is used to detect bugs */
32         nb_images++;
33         if (nb_images > 4)
34             g_printerr("There are more than 4 images: %d images\n", nb_images);
36         else if (options->one_image && nb_images > 2)
37             /* We can have two images : the displayed one and the just loaded */
38             g_printerr("There are more than 2 images: %d images\n", nb_images);
41         return GET_NEW;
42     }
44     override (G:Object) void finalize(GObject * self)
45     {
46         gint level;
47         texture_map *map;
48         GlivImage *im = GLIV_IMAGE(self);
50         for (level = 0; level < im->nb_maps; level++) {
51             map = im->maps + level;
53             glDeleteTextures(map->nb_tiles, map->tex_ids);
54             g_free(map->tex_ids);
56             glDeleteLists(map->list, map->nb_tiles);
57             g_free(map->tiles);
58         }
60         g_free(im->maps);
61         g_free(im->ident);
63         PARENT_HANDLER(self);
64         nb_images--;
65     }