|
Crossfire Client, Trunk
R18666
|
#include <config.h>#include <stdlib.h>#include <sys/stat.h>#include <unistd.h>#include <png.h>#include <gtk/gtk.h>#include <glade/glade.h>#include <gdk/gdkx.h>#include <gdk/gdkkeysyms.h>#include "client-types.h"#include "client.h"#include "image.h"#include "main.h"#include "mapdata.h"#include "gtk2proto.h"#include "../../pixmaps/question.xpm"
Go to the source code of this file.
Defines | |
| #define | BPP 4 |
| #define | MAX_ICON_SPACES 10 |
| #define | ROTATE_RIGHT(c) if ((c) & 01) (c) = ((c) >>1) + 0x80000000; else (c) >>= 1; |
Functions | |
| int | create_and_rescale_image_from_data (Cache_Entry *ce, int pixmap_num, uint8 *rgba_data, int width, int height) |
| void | addsmooth (uint16 face, uint16 smooth_face) |
| int | associate_cache_entry (Cache_Entry *ce, int pixnum) |
| void | reset_image_data (void) |
| void | image_update_download_status (int start, int end, int total) |
| void | get_map_image_size (int face, uint8 *w, uint8 *h) |
| void | init_image_cache_data (void) |
Variables | |
| const char *const | rcsid_gtk2_image_c = "$Id: image.c 12987 2010-04-27 03:50:58Z kbulgrien $" |
| GtkWidget * | window_root |
| int | image_size = DEFAULT_IMAGE_SIZE |
| struct { | |
| char * name | |
| uint32 checksum | |
| uint8 * png_data | |
| uint32 width | |
| uint32 height | |
| } | private_cache [MAXPIXMAPNUM] |
| PixmapInfo * | pixmaps [MAXPIXMAPNUM] |
| int | last_face_num = 0 |
| int | have_new_image = 0 |
Contains highlevel image related functions and mostly deals with the image caching, processing the image commands from the server, etc. It is gtk-specific as it returns gtk pixmaps.
Definition in file image.c.
| #define MAX_ICON_SPACES 10 |
| #define ROTATE_RIGHT | ( | c | ) | if ((c) & 01) (c) = ((c) >>1) + 0x80000000; else (c) >>= 1; |
Referenced from common/commands.c
| face | |
| smooth_face |
Definition at line 426 of file image.c.

| int associate_cache_entry | ( | Cache_Entry * | ce, |
| int | pixnum | ||
| ) |
This functions associates image_data in the cache entry with the specific pixmap number. Currently, there is no failure condition, but there is the potential that in the future, we want to more closely look at the data and if it isn't valid, return the failure code.
Definition at line 439 of file image.c.

| int create_and_rescale_image_from_data | ( | Cache_Entry * | ce, |
| int | pixmap_num, | ||
| uint8 * | rgba_data, | ||
| int | width, | ||
| int | height | ||
| ) |
Takes the pixmap to put the data into, as well as the rgba data (ie, already loaded with png_to_data). Scales and stores the relevant data into the pixmap structure.
| ce | can be NULL |
| pixmap_num | |
| rgba_data | |
| width | |
| height |
Definition at line 297 of file image.c.


| void get_map_image_size | ( | int | face, |
| uint8 * | w, | ||
| uint8 * | h | ||
| ) |
| void image_update_download_status | ( | int | start, |
| int | end, | ||
| int | total | ||
| ) |
Draws a status bar showing where we our in terms of downloading all the image data. A few hacks: If start is 1, this is the first batch, so it means we need to create the appropriate status window. If start = end = total, it means were finished, so destroy the gui element.
| start | The start value just sent to the server. |
| end | |
| total | The total number of images. |
Definition at line 486 of file image.c.


| void init_image_cache_data | ( | void | ) |
Initializes the data for image caching Create question mark to display in each supported rendering mode when an image is not cached. When image caching is enabled, if a needed image is not yet in the cache, a question mark image is displayed instead. The image displayed is unique to the display mode. This function creates the image to use when OpenGL mode is in effect.
Definition at line 566 of file image.c.


| void reset_image_data | ( | void | ) |
Connecting to different servers, try to clear out any old images. Try to free the data to prevent memory leaks. This could be more clever, ie, if we're caching images and go to a new server and get a name, we should try to re-arrange our cache or the like.
Definition at line 451 of file image.c.


| int have_new_image = 0 |
| int image_size = DEFAULT_IMAGE_SIZE |
| int last_face_num = 0 |
| struct { ... } private_cache[MAXPIXMAPNUM] |
| const char* const rcsid_gtk2_image_c = "$Id: image.c 12987 2010-04-27 03:50:58Z kbulgrien $" |
| GtkWidget* window_root |
1.7.6.1