Go to the source code of this file.
Classes | |
struct | _MapeTextureMapClass |
struct | _MapeTextureMap |
Macros | |
#define | MAPE_TYPE_TEXTURE_MAP (mape_texture_map_get_type()) |
#define | MAPE_TEXTURE_MAP(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), MAPE_TYPE_TEXTURE_MAP, MapeTextureMap)) |
#define | MAPE_TEXTURE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), MAPE_TYPE_TEXTURE_MAP, MapeTextureMapClass)) |
#define | MAPE_IS_TEXTURE_MAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAPE_TYPE_TEXTURE_MAP)) |
#define | MAPE_IS_TEXTURE_MAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), MAPE_TYPE_TEXTURE_MAP)) |
#define | MAPE_TEXTURE_MAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), MAPE_TYPE_TEXTURE_MAP, MapeTextureMapClass)) |
Typedefs | |
typedef struct _MapeTextureMap | MapeTextureMap |
typedef struct _MapeTextureMapClass | MapeTextureMapClass |
typedef enum _MapeTextureMapError | MapeTextureMapError |
Enumerations | |
enum | _MapeTextureMapError { MAPE_TEXTURE_MAP_ERROR_LOAD } |
struct _MapeTextureMapClass |
struct _MapeTextureMap |
MapeTextureMap:
MapeTextureMap is an opaque data type. You should only access it via the public API functions.
Class Members | ||
---|---|---|
GObject | parent |
#define MAPE_IS_TEXTURE_MAP | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAPE_TYPE_TEXTURE_MAP)) |
#define MAPE_IS_TEXTURE_MAP_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_TYPE((klass), MAPE_TYPE_TEXTURE_MAP)) |
#define MAPE_TEXTURE_MAP | ( | obj | ) | (G_TYPE_CHECK_INSTANCE_CAST((obj), MAPE_TYPE_TEXTURE_MAP, MapeTextureMap)) |
#define MAPE_TEXTURE_MAP_CLASS | ( | klass | ) | (G_TYPE_CHECK_CLASS_CAST((klass), MAPE_TYPE_TEXTURE_MAP, MapeTextureMapClass)) |
#define MAPE_TEXTURE_MAP_GET_CLASS | ( | obj | ) | (G_TYPE_INSTANCE_GET_CLASS((obj), MAPE_TYPE_TEXTURE_MAP, MapeTextureMapClass)) |
#define MAPE_TYPE_TEXTURE_MAP (mape_texture_map_get_type()) |
typedef struct _MapeTextureMap MapeTextureMap |
typedef struct _MapeTextureMapClass MapeTextureMapClass |
typedef enum _MapeTextureMapError MapeTextureMapError |
MapeTextureMapError: @MAPE_TEXTURE_MAP_ERROR_LOAD: An error occured when loading the texture map.
These errors are from the MAPE_TEXTURE_MAP_ERROR error domain. They can occur when operating on texture maps.
enum _MapeTextureMapError |
MapeTextureMapError: @MAPE_TEXTURE_MAP_ERROR_LOAD: An error occured when loading the texture map.
These errors are from the MAPE_TEXTURE_MAP_ERROR error domain. They can occur when operating on texture maps.
Enumerator | |
---|---|
MAPE_TEXTURE_MAP_ERROR_LOAD |
Definition at line 43 of file texture.h.
guint32 mape_texture_map_get_average_texture_color | ( | MapeTextureMap * | texture_map, |
const gchar * | name | ||
) |
Definition at line 580 of file texture.c.
References c4_texture_handle_get_average_texture_color(), _MapeTextureMapPrivate::handle, MAPE_IS_TEXTURE_MAP, and MAPE_TEXTURE_MAP_PRIVATE.
const gchar* mape_texture_map_get_material_name_from_mapping | ( | MapeTextureMap * | texture_map, |
guint | index | ||
) |
mape_texture_map_get_material_name_from_mapping: @texture_map: A MapeTextureMap. @index: A material-texture combination index.
Returns the name of the material which corresponds to the given index in the material-texture mapping. The function returns NULL if the corresponding entry is empty. The mapping must be loaded with the function mape_texture_map_load_map() before this function can be used.
Returns: The name of the material which corresponds to the given index, or NULL.
Definition at line 536 of file texture.c.
References c4_texture_handle_get_entry_material_name(), _MapeTextureMapPrivate::handle, MAPE_IS_TEXTURE_MAP, and MAPE_TEXTURE_MAP_PRIVATE.
gboolean mape_texture_map_get_overload_materials | ( | MapeTextureMap * | texture_map | ) |
mape_texture_map_get_overload_materials: @texture_map: A MapeTextureMap.
Returns whether the OverloadMaterials flag is set in the mapping. This flag is initialized by calling mape_texture_map_load_map().
Returns: Whether the OverloadMaterials flag is set in the mapping.
Definition at line 427 of file texture.c.
References MAPE_IS_TEXTURE_MAP, and MAPE_TEXTURE_MAP_PRIVATE.
gboolean mape_texture_map_get_overload_textures | ( | MapeTextureMap * | texture_map | ) |
mape_texture_map_get_overload_textures: @texture_map: A MapeTextureMap.
Returns whether the OverloadTextures flag is set in the mapping. This flag is initialized by calling mape_texture_map_load_map().
Returns: Whether the OverloadTextures flag is set in the mapping.
Definition at line 443 of file texture.c.
References MAPE_IS_TEXTURE_MAP, and MAPE_TEXTURE_MAP_PRIVATE.
guint mape_texture_map_get_texture_count | ( | MapeTextureMap * | texture_map | ) |
mape_texture_map_get_texture_count: @texture_map: A MapeTextureMap.
Returns the number of textures loaded. This will only be non-zero after mape_texture_map_load_textures() was called.
Returns: The number of textures loaded.
Definition at line 459 of file texture.c.
References MAPE_IS_TEXTURE_MAP, MAPE_TEXTURE_MAP_PRIVATE, and _MapeTextureMapPrivate::texture_table.
Referenced by mape_mat_tex_view_reload(), and mape_texture_map_get_texture_name().
const gchar* mape_texture_map_get_texture_name | ( | MapeTextureMap * | texture_map, |
guint | index | ||
) |
mape_texture_map_get_texture_name: @texture_map: A MapeTextureMap. @index: The index of the texture whose name to retrieve.
Returns the name of the @index<– -->th material in @texture_map. Allowed values for @index range from 0 to mape_texture_map_get_texture_count() - 1.
Returns: The texture name of the texture corresponding to @index.
Definition at line 478 of file texture.c.
References c4_texture_map_handle_get_texture(), _MapeTextureMapPrivate::handle, MAPE_IS_TEXTURE_MAP, mape_texture_map_get_texture_count(), and MAPE_TEXTURE_MAP_PRIVATE.
Referenced by mape_mat_tex_view_reload().
const gchar* mape_texture_map_get_texture_name_from_mapping | ( | MapeTextureMap * | texture_map, |
guint | index | ||
) |
mape_texture_map_get_texture_name_from_mapping: @texture_map: A MapeTextureMap. @index: A material-texture combination index.
Returns the name of the texture which corresponds to the given index in the material-texture mapping. The function returns NULL if the corresponding entry is empty. The mapping must be loaded with the function mape_texture_map_load_map() before this function can be used.
Returns: The name of the texture which corresponds to the given index, or NULL.
Definition at line 559 of file texture.c.
References c4_texture_handle_get_entry_texture_name(), _MapeTextureMapPrivate::handle, MAPE_IS_TEXTURE_MAP, and MAPE_TEXTURE_MAP_PRIVATE.
GType mape_texture_map_get_type | ( | void | ) |
gboolean mape_texture_map_load_map | ( | MapeTextureMap * | texture_map, |
MapeGroup * | group, | ||
GError ** | error | ||
) |
mape_texture_map_load_map: @texture_map: A MapeTextureMap. @group: A MapeGroup to load the material mappings from. @error: Location to store error information, if any.
Loads the mappings of material-texture combinations to palette indices from the group's TexMap.txt. This should only be loaded once per group. If an error occurs, @error is set and the function returns FALSE.
Returns: TRUE if the mapping could be loaded or FALSE otherwise.
Definition at line 265 of file texture.c.
References _mape_group_get_handle(), c4_texture_map_handle_load_map(), _MapeTextureMapPrivate::handle, MAPE_IS_GROUP, MAPE_IS_TEXTURE_MAP, MAPE_TEXTURE_MAP_PRIVATE, _MapeTextureMapPrivate::overload_materials, and _MapeTextureMapPrivate::overload_textures.
Referenced by mape_mat_tex_view_reload().
gboolean mape_texture_map_load_textures | ( | MapeTextureMap * | texture_map, |
MapeGroup * | group, | ||
GError ** | error | ||
) |
mape_texture_map_load_textures: @texture_map: A MapeTextureMap. @group: The group to load textures from. @error: Location to store error information, if any.
Loads all textures in @group. If this includes textures which are already contained in @texture_map, then these textures will not be loaded. If an error occurs, @error is set and the function returns FALSE.
Returns: TRUE if the textures could be loaded or FALSE otherwise.
Definition at line 304 of file texture.c.
References c4_texture_map_handle_add_texture(), _MapeTextureMapPrivate::handle, mape_group_get_next_entry(), mape_group_load_entry(), mape_group_rewind(), MAPE_IS_GROUP, MAPE_IS_TEXTURE_MAP, MAPE_TEXTURE_MAP_PRIVATE, and _MapeTextureMapPrivate::texture_table.
Referenced by mape_mat_tex_view_reload().
GdkPixbuf* mape_texture_map_lookup_texture | ( | MapeTextureMap * | texture_map, |
const gchar * | name | ||
) |
Definition at line 504 of file texture.c.
References MAPE_IS_TEXTURE_MAP, MAPE_TEXTURE_MAP_PRIVATE, and _MapeTextureMapPrivate::texture_table.
Referenced by mape_mat_tex_view_reload().
MapeTextureMap* mape_texture_map_new | ( | void | ) |
mape_texture_map_new:
Creates a new MapeTextureMap. The map is initially empty. Use mape_texture_map_load_map() to load mappings and mape_texture_map_load_textures() from a Material.ocg group file.
Return Value: A new MapeTextureMap. Free with g_object_unref().
Definition at line 247 of file texture.c.
References MAPE_TEXTURE_MAP, and MAPE_TYPE_TEXTURE_MAP.