Freeciv-3.3
|
#include "log.h"
#include "mem.h"
#include "shared.h"
#include "colors.h"
#include "mapview.h"
#include "sprite.h"
Go to the source code of this file.
Macros | |
#define | MAX_FILE_EXTENSIONS 50 |
#define | MULTI_UNc(a, b) ((a * b - (b / 2)) / 0xFF) |
#define | DIV_UNc(a, b) (((guint16) (a) * 0xFF + ((b) / 2)) / (b)) |
#define MULTI_UNc | ( | a, | |
b | |||
) | ((a * b - (b / 2)) / 0xFF) |
GdkPixbuf * create_extra_pixbuf | ( | const struct extra_type * | pextra | ) |
struct sprite * crop_sprite | ( | struct sprite * | source, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height, | ||
struct sprite * | mask, | ||
int | mask_offset_x, | ||
int | mask_offset_y, | ||
float | scale, | ||
bool | smooth | ||
) |
Create a new sprite by cropping and taking only the given portion of the image.
source gives the sprite that is to be cropped.
x,y, width, height gives the rectangle to be cropped. The pixel at position of the source sprite will be at (0,0) in the new sprite, and the new sprite will have dimensions (width, height).
mask gives an additional mask to be used for clipping the new sprite.
mask_offset_x, mask_offset_y is the offset of the mask relative to the origin of the source image. The pixel at (mask_offset_x,mask_offset_y) in the mask image will be used to clip pixel (0,0) in the source image which is pixel (-x,-y) in the new image.
scale gives scale of new tileset smooth means if scaling might be bilinear, if set to false use nearest neighbor
Load the given graphics file into a sprite. This function loads an entire image file, which may later be broken up into individual sprites with crop_sprite().
GtkWidget * picture_new_from_surface | ( | cairo_surface_t * | surf | ) |
Create a GtkPicture from cairo surface.
Definition at line 526 of file sprite.c.
Referenced by setup_widgets().
void picture_set_from_surface | ( | GtkPicture * | pic, |
cairo_surface_t * | surf | ||
) |
Set a GtkPicture from cairo surface.
Definition at line 544 of file sprite.c.
Referenced by city_dialog_update_citizens(), create_diplomacy_dialog(), put_unit_picture(), put_unit_picture_city_overlays(), refresh_feeling_surface(), set_help_tile_from_extra(), set_help_tile_from_sprite(), set_help_tile_from_terrain(), set_indicator_icons(), and update_info_label().