1 /* Generated by GOB (v2.0.15) (do not edit directly) */
3 /* End world hunger, donate to the World Food Programme, http://www.wfp.org */
5 #define GOB_VERSION_MAJOR 2
6 #define GOB_VERSION_MINOR 0
7 #define GOB_VERSION_PATCHLEVEL 15
9 #define selfp (self->_priv)
11 #include <string.h> /* memset() */
13 #include "gliv-image.h"
16 #define ___GOB_LIKELY(expr) G_LIKELY(expr)
17 #define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
18 #else /* ! G_LIKELY */
19 #define ___GOB_LIKELY(expr) (expr)
20 #define ___GOB_UNLIKELY(expr) (expr)
23 #line 1 "../tools/gliv-image.gob"
29 extern options_struct
*options
;
31 static int nb_images
= 0;
34 #line 35 "gliv-image.c"
36 #line 12 "../tools/gliv-image.gob"
38 #include "texture_map.h"
40 #line 41 "gliv-image.c"
41 /* self casting macros */
42 #define SELF(x) GLIV_IMAGE(x)
43 #define SELF_CONST(x) GLIV_IMAGE_CONST(x)
44 #define IS_SELF(x) GLIV_IS_IMAGE(x)
45 #define TYPE_SELF GLIV_TYPE_IMAGE
46 #define SELF_CLASS(x) GLIV_IMAGE_CLASS(x)
48 #define SELF_GET_CLASS(x) GLIV_IMAGE_GET_CLASS(x)
51 typedef GlivImage Self
;
52 typedef GlivImageClass SelfClass
;
54 /* here are local prototypes */
55 static void gliv_image_init (GlivImage
* o
) G_GNUC_UNUSED
;
56 static void gliv_image_class_init (GlivImageClass
* c
) G_GNUC_UNUSED
;
57 static void ___2_gliv_image_finalize (GObject
* self
) G_GNUC_UNUSED
;
59 /* pointer to the class of our parent */
60 static GObjectClass
*parent_class
= NULL
;
62 /* Short form macros */
63 #define self_new gliv_image_new
65 gliv_image_get_type (void)
67 static GType type
= 0;
69 if ___GOB_UNLIKELY(type
== 0) {
70 static const GTypeInfo info
= {
71 sizeof (GlivImageClass
),
73 (GBaseFinalizeFunc
) NULL
,
74 (GClassInitFunc
) gliv_image_class_init
,
75 (GClassFinalizeFunc
) NULL
,
76 NULL
/* class_data */,
79 (GInstanceInitFunc
) gliv_image_init
,
83 type
= g_type_register_static (G_TYPE_OBJECT
, "GlivImage", &info
, (GTypeFlags
)0);
89 /* a macro for creating a new object of our type */
90 #define GET_NEW ((GlivImage *)g_object_new(gliv_image_get_type(), NULL))
92 /* a function for creating a new object of our type */
94 static GlivImage
* GET_NEW_VARG (const char *first
, ...) G_GNUC_UNUSED
;
96 GET_NEW_VARG (const char *first
, ...)
100 va_start (ap
, first
);
101 ret
= (GlivImage
*)g_object_new_valist (gliv_image_get_type (), first
, ap
);
107 gliv_image_init (GlivImage
* o G_GNUC_UNUSED
)
109 #define __GOB_FUNCTION__ "Gliv:Image::init"
111 #undef __GOB_FUNCTION__
113 gliv_image_class_init (GlivImageClass
* c G_GNUC_UNUSED
)
115 #define __GOB_FUNCTION__ "Gliv:Image::class_init"
116 GObjectClass
*g_object_class
= (GObjectClass
*)c
;
118 parent_class
= g_type_class_ref (G_TYPE_OBJECT
);
120 #line 42 "../tools/gliv-image.gob"
121 g_object_class
->finalize
= ___2_gliv_image_finalize
;
122 #line 123 "gliv-image.c"
124 #undef __GOB_FUNCTION__
128 #line 27 "../tools/gliv-image.gob"
130 gliv_image_new (void)
131 #line 132 "gliv-image.c"
133 #define __GOB_FUNCTION__ "Gliv:Image::new"
135 #line 28 "../tools/gliv-image.gob"
137 /* This is used to detect bugs */
140 g_printerr("There are more than 4 images: %d images\n", nb_images
);
142 else if (options
->one_image
&& nb_images
> 2)
143 /* We can have two images : the displayed one and the just loaded */
144 g_printerr("There are more than 2 images: %d images\n", nb_images
);
149 #line 150 "gliv-image.c"
150 #undef __GOB_FUNCTION__
152 #line 42 "../tools/gliv-image.gob"
154 ___2_gliv_image_finalize (GObject
* self G_GNUC_UNUSED
)
155 #line 156 "gliv-image.c"
156 #define PARENT_HANDLER(___self) \
157 { if(G_OBJECT_CLASS(parent_class)->finalize) \
158 (* G_OBJECT_CLASS(parent_class)->finalize)(___self); }
160 #define __GOB_FUNCTION__ "Gliv:Image::finalize"
162 #line 43 "../tools/gliv-image.gob"
166 GlivImage
*im
= GLIV_IMAGE(self
);
168 for (level
= 0; level
< im
->nb_maps
; level
++) {
169 map
= im
->maps
+ level
;
171 glDeleteTextures(map
->nb_tiles
, map
->tex_ids
);
172 g_free(map
->tex_ids
);
174 glDeleteLists(map
->list
, map
->nb_tiles
);
181 PARENT_HANDLER(self
);
184 #line 185 "gliv-image.c"
185 #undef __GOB_FUNCTION__
186 #undef PARENT_HANDLER