1 /* Generated by GOB (v2.0.6) on Thu Jan 8 22:51:44 2004
2 (do not edit directly) */
4 /* End world hunger, donate to the World Food Programme, http://www.wfp.org */
6 #define GOB_VERSION_MAJOR 2
7 #define GOB_VERSION_MINOR 0
8 #define GOB_VERSION_PATCHLEVEL 6
10 #define selfp (self->_priv)
12 #include "gliv-image.h"
15 #define ___GOB_LIKELY(expr) G_LIKELY(expr)
16 #define ___GOB_UNLIKELY(expr) G_UNLIKELY(expr)
17 #else /* ! G_LIKELY */
18 #define ___GOB_LIKELY(expr) (expr)
19 #define ___GOB_UNLIKELY(expr) (expr)
22 #line 1 "../tools/gliv-image.gob"
27 #include "gl_widget.h"
30 static int nb_images
= 0;
33 #line 34 "gliv-image.c"
35 #line 12 "../tools/gliv-image.gob"
37 #include "texture_map.h"
39 #line 40 "gliv-image.c"
40 /* self casting macros */
41 #define SELF(x) GLIV_IMAGE(x)
42 #define SELF_CONST(x) GLIV_IMAGE_CONST(x)
43 #define IS_SELF(x) GLIV_IS_IMAGE(x)
44 #define TYPE_SELF GLIV_TYPE_IMAGE
45 #define SELF_CLASS(x) GLIV_IMAGE_CLASS(x)
47 #define SELF_GET_CLASS(x) GLIV_IMAGE_GET_CLASS(x)
50 typedef GlivImage Self
;
51 typedef GlivImageClass SelfClass
;
53 /* here are local prototypes */
54 static void gliv_image_init (GlivImage
* o
) G_GNUC_UNUSED
;
55 static void gliv_image_class_init (GlivImageClass
* c
) G_GNUC_UNUSED
;
56 static void ___2_gliv_image_finalize (GObject
* self
) G_GNUC_UNUSED
;
58 /* pointer to the class of our parent */
59 static GObjectClass
*parent_class
= NULL
;
61 /* Short form macros */
62 #if defined(__GNUC__) && !defined(__STRICT_ANSI__)
63 #define self_new() gliv_image_new()
64 #endif /* __GNUC__ && !__STRICT_ANSI__ */
66 /* Short form pointers */
67 static GlivImage
* (* const self_new
) (void) = gliv_image_new
;
70 gliv_image_get_type (void)
72 static GType type
= 0;
74 if ___GOB_UNLIKELY(type
== 0) {
75 static const GTypeInfo info
= {
76 sizeof (GlivImageClass
),
78 (GBaseFinalizeFunc
) NULL
,
79 (GClassInitFunc
) gliv_image_class_init
,
80 (GClassFinalizeFunc
) NULL
,
81 NULL
/* class_data */,
84 (GInstanceInitFunc
) gliv_image_init
,
87 type
= g_type_register_static (G_TYPE_OBJECT
, "GlivImage", &info
, (GTypeFlags
)0);
93 /* a macro for creating a new object of our type */
94 #define GET_NEW ((GlivImage *)g_object_new(gliv_image_get_type(), NULL))
96 /* a function for creating a new object of our type */
98 static GlivImage
* GET_NEW_VARG (const char *first
, ...) G_GNUC_UNUSED
;
100 GET_NEW_VARG (const char *first
, ...)
104 va_start (ap
, first
);
105 ret
= (GlivImage
*)g_object_new_valist (gliv_image_get_type (), first
, ap
);
111 gliv_image_init (GlivImage
* o
)
113 #define __GOB_FUNCTION__ "Gliv:Image::init"
117 #undef __GOB_FUNCTION__
119 gliv_image_class_init (GlivImageClass
* c
)
121 #define __GOB_FUNCTION__ "Gliv:Image::class_init"
122 GObjectClass
*g_object_class
= (GObjectClass
*)c
;
124 parent_class
= g_type_class_ref (G_TYPE_OBJECT
);
126 #line 35 "../tools/gliv-image.gob"
127 g_object_class
->finalize
= ___2_gliv_image_finalize
;
128 #line 129 "gliv-image.c"
132 #undef __GOB_FUNCTION__
136 #line 26 "../tools/gliv-image.gob"
138 gliv_image_new (void)
139 #line 140 "gliv-image.c"
141 #define __GOB_FUNCTION__ "Gliv:Image::new"
143 #line 27 "../tools/gliv-image.gob"
147 printf("There are more than 4 images: %d images\n", nb_images
);
151 #line 152 "gliv-image.c"
152 #undef __GOB_FUNCTION__
154 #line 35 "../tools/gliv-image.gob"
156 ___2_gliv_image_finalize (GObject
* self
)
157 #line 158 "gliv-image.c"
158 #define PARENT_HANDLER(___self) \
159 { if(G_OBJECT_CLASS(parent_class)->finalize) \
160 (* G_OBJECT_CLASS(parent_class)->finalize)(___self); }
162 #define __GOB_FUNCTION__ "Gliv:Image::finalize"
164 #line 36 "../tools/gliv-image.gob"
168 GlivImage
*im
= GLIV_IMAGE(self
);
170 for (level
= 0; level
< im
->nb_maps
; level
++) {
171 map
= im
->maps
+ level
;
173 glDeleteTextures(map
->nb_tiles
, map
->tex_ids
);
174 g_free(map
->tex_ids
);
176 glDeleteLists(map
->list
, map
->nb_tiles
);
183 PARENT_HANDLER(self
);
186 #line 187 "gliv-image.c"
187 #undef __GOB_FUNCTION__
188 #undef PARENT_HANDLER
191 #if (!defined __GNUC__) || (defined __GNUC__ && defined __STRICT_ANSI__)
193 This is to avoid unused warnings if you don't call
194 some method. I need to find a better way to do
195 this, not needed in GCC since we use some gcc
196 extentions to make saner, faster code */
198 ___gliv_image_really_bad_hack_to_avoid_warnings(void)
200 ((void (*)(void))GET_NEW_VARG
)();
201 ((void (*)(void))self_new
)();
202 ___gliv_image_really_bad_hack_to_avoid_warnings();
204 #endif /* !__GNUC__ || (__GNUC__ && __STRICT_ANSI__) */