Go to the source code of this file.
Classes | |
struct | _MapeMaterialMapClass |
struct | _MapeMaterialMap |
Macros | |
#define | MAPE_TYPE_MATERIAL_MAP (mape_material_map_get_type()) |
#define | MAPE_MATERIAL_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMap)) |
#define | MAPE_MATERIAL_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMapClass)) |
#define | MAPE_IS_MATERIAL_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAPE_TYPE_MATERIAL_MAP)) |
#define | MAPE_IS_MATERIAL_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MAPE_TYPE_MATERIAL_MAP)) |
#define | MAPE_MATERIAL_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMapClass)) |
#define | MAPE_TYPE_MATERIAL (mape_material_get_type()) |
Typedefs | |
typedef struct _MapeMaterial | MapeMaterial |
typedef struct _MapeMaterialMap | MapeMaterialMap |
typedef struct _MapeMaterialMapClass | MapeMaterialMapClass |
typedef enum _MapeMaterialMapError | MapeMaterialMapError |
Enumerations | |
enum | _MapeMaterialMapError { MAPE_MATERIAL_MAP_ERROR_LOAD } |
Functions | |
GType | mape_material_get_type (void) G_GNUC_CONST |
GType | mape_material_map_get_type (void) G_GNUC_CONST |
MapeMaterialMap * | mape_material_map_new (void) |
gboolean | mape_material_map_load (MapeMaterialMap *map, MapeGroup *from, GError **error) |
guint | mape_material_map_get_material_count (MapeMaterialMap *map) |
void | mape_material_map_set_default_textures (MapeMaterialMap *matmap, MapeTextureMap *texmap) |
const MapeMaterial * | mape_material_map_get_material (MapeMaterialMap *map, guint index) |
MapeMaterial * | mape_material_map_get_material_by_name (MapeMaterialMap *map, const gchar *name) |
const gchar * | mape_material_get_name (const MapeMaterial *material) |
const gchar * | mape_material_get_texture_overlay (const MapeMaterial *material) |
struct _MapeMaterialMapClass |
MapeMaterialMapClass:
This structure does not contain any public fields.
Definition at line 56 of file material.h.
Class Members | ||
---|---|---|
GObjectClass | parent_class |
struct _MapeMaterialMap |
MapeMaterialMap:
MapeMaterialMap is an opaque data type. You should only access it via the public API functions.
Definition at line 67 of file material.h.
Class Members | ||
---|---|---|
GObject | parent |
#define MAPE_IS_MATERIAL_MAP | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAPE_TYPE_MATERIAL_MAP)) |
Definition at line 29 of file material.h.
#define MAPE_IS_MATERIAL_MAP_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_TYPE((klass), MAPE_TYPE_MATERIAL_MAP)) |
Definition at line 30 of file material.h.
#define MAPE_MATERIAL_MAP | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_CAST((obj), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMap)) |
Definition at line 27 of file material.h.
#define MAPE_MATERIAL_MAP_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_CAST((klass), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMapClass)) |
Definition at line 28 of file material.h.
#define MAPE_MATERIAL_MAP_GET_CLASS | ( | obj | ) | (G_TYPE_INSTANCE_GET_CLASS((obj), MAPE_TYPE_MATERIAL_MAP, MapeMaterialMapClass)) |
Definition at line 31 of file material.h.
#define MAPE_TYPE_MATERIAL (mape_material_get_type()) |
Definition at line 33 of file material.h.
#define MAPE_TYPE_MATERIAL_MAP (mape_material_map_get_type()) |
Definition at line 26 of file material.h.
typedef struct _MapeMaterial MapeMaterial |
Definition at line 24 of file material.h.
typedef struct _MapeMaterialMap MapeMaterialMap |
Definition at line 24 of file material.h.
typedef struct _MapeMaterialMapClass MapeMaterialMapClass |
Definition at line 24 of file material.h.
typedef enum _MapeMaterialMapError MapeMaterialMapError |
MapeMaterialMapError: @MAPE_MATERIAL_MAP_ERROR_LOAD: An error occured when loading a material map.
These errors are from the MAPE_MATERIAL_MAP_ERROR error domain. They can occur when operating on material maps.
MapeMaterialMapError: @MAPE_MATERIAL_MAP_ERROR_LOAD: An error occured when loading a material map.
These errors are from the MAPE_MATERIAL_MAP_ERROR error domain. They can occur when operating on material maps.
Enumerator | |
---|---|
MAPE_MATERIAL_MAP_ERROR_LOAD |
Definition at line 47 of file material.h.
const gchar* mape_material_get_name | ( | const MapeMaterial * | material | ) |
mape_material_get_name: @material: A MapeMaterial.
Returns the material's name.
Return Value: The name of the material. The string is owned by the MapeMaterial and must not be freed by the user.
Definition at line 371 of file material.c.
References c4_material_handle_get_name().
Referenced by mape_mat_tex_view_reload().
const gchar* mape_material_get_texture_overlay | ( | const MapeMaterial * | material | ) |
mape_material_get_texture_overlay: @material: A MapeMaterial.
Returns the material's texture overlay as a string. This can be used to make a texture lookup in a corresponding MapeTextureMap.
Return Value: The texture overlay of the material. The string is owned by the MapeMaterial and must not be freed by the user.
Definition at line 388 of file material.c.
References c4_material_handle_get_texture_overlay().
GType mape_material_get_type | ( | void | ) |
Definition at line 194 of file material.c.
const MapeMaterial* mape_material_map_get_material | ( | MapeMaterialMap * | map, |
guint | index | ||
) |
mape_material_map_get_material: @map: A MapeMaterialMap. @index: A material index.
Returns the entry with the given index in the map.
Returns: A MapeMaterial representing the indexed material. It is owned by #map and must not be used anymore after the map is finalized.
Definition at line 310 of file material.c.
References c4_material_map_handle_get_num(), _MapeMaterialMapPrivate::handle, MAPE_IS_MATERIAL_MAP, and MAPE_MATERIAL_MAP_PRIVATE.
Referenced by mape_mat_tex_view_reload().
MapeMaterial* mape_material_map_get_material_by_name | ( | MapeMaterialMap * | map, |
const gchar * | name | ||
) |
Definition at line 336 of file material.c.
References c4_material_handle_get_name(), c4_material_map_handle_get_material(), c4_material_map_handle_get_num(), _MapeMaterialMapPrivate::handle, MAPE_IS_MATERIAL_MAP, and MAPE_MATERIAL_MAP_PRIVATE.
guint mape_material_map_get_material_count | ( | MapeMaterialMap * | map | ) |
mape_material_map_get_material_count: @map: A MapeMaterialMap.
Returns the number of materials contained in @map.
Return Value: The number of materials in @map.
Definition at line 274 of file material.c.
References c4_material_map_handle_get_num(), MAPE_IS_MATERIAL_MAP, and MAPE_MATERIAL_MAP_PRIVATE.
Referenced by mape_mat_tex_view_reload().
GType mape_material_map_get_type | ( | void | ) |
gboolean mape_material_map_load | ( | MapeMaterialMap * | map, |
MapeGroup * | from, | ||
GError ** | error | ||
) |
mape_material_map_load: @map: A MapeMaterialMap. @from: An open MapeGroup to load materials from. @error: Location to store error information, if any.
Loads all the material files (*.c4m) from the group @from. If this includes materials with the same name as materials already contained in @map, then the new materials will not be loaded. If an error occurs while loading the material map the function returns FALSE and @error is set.
Returns: TRUE on success, FALSE on failure.
Definition at line 242 of file material.c.
References _mape_group_get_handle(), c4_material_map_handle_load(), _MapeMaterialMapPrivate::handle, mape_group_is_open(), MAPE_IS_GROUP, MAPE_IS_MATERIAL_MAP, and MAPE_MATERIAL_MAP_PRIVATE.
Referenced by mape_mat_tex_view_reload().
MapeMaterialMap* mape_material_map_new | ( | void | ) |
mape_material_map_new:
Creates a new MapeMaterialMap. The map is initially empty. Use mape_material_map_load() to load materials from one or more Material.ocg group files.
Return Value: A new MapeMaterialMap. Free with g_object_unref().
Definition at line 223 of file material.c.
References MAPE_MATERIAL_MAP, and MAPE_TYPE_MATERIAL_MAP.
Referenced by mape_mat_tex_view_reload().
void mape_material_map_set_default_textures | ( | MapeMaterialMap * | matmap, |
MapeTextureMap * | texmap | ||
) |
mape_material_map_set_default_textures: @mapmap: A MapeMaterialMap. @texmap: A MapeTextureMap to load textures from.
Sets the default textures for the materials in @matmap by looking up the texture overlay specified in the material file in @texmap.
Definition at line 290 of file material.c.
References _mape_texture_map_get_handle(), c4_material_map_crossmap_materials(), and MAPE_MATERIAL_MAP_PRIVATE.
Referenced by mape_mat_tex_view_reload().