Freeciv-3.3
|
Go to the source code of this file.
Data Structures | |
struct | sdl2_data |
struct | gui_layer |
Macros | |
#define | RECT_LIMIT 80 |
#define | USE_DUFFS_LOOP |
#define | DUFFS_LOOP8(pixel_copy_increment, width) |
#define | DUFFS_LOOP4(pixel_copy_increment, width) |
#define | DUFFS_LOOP_DOUBLE2(pixel_copy_increment, double_pixel_copy_increment, width) |
#define | DUFFS_LOOP_QUATRO2(pixel_copy_increment, double_pixel_copy_increment, quatro_pixel_copy_increment, width) |
#define | DUFFS_LOOP(pixel_copy_increment, width) DUFFS_LOOP8(pixel_copy_increment, width) |
#define | DEFAULT_ZOOM 1.0 |
#define | adj_surf(surf) copy_surface(surf) |
#define | map_rgba(format, color) SDL_MapRGBA(format, (color).r, (color).g, (color).b, (color).a) |
#define | crop_rect_from_screen(rect) crop_rect_from_surface(main_data.screen, &rect) |
#define | FREESURFACE(ptr) |
#define | lock_surf(surf) |
#define | unlock_surf(surf) |
#define | lock_screen() lock_surf(main_data.screen) |
#define | unlock_screen() unlock_surf(main_data.screen) |
#define | putpixel(surf, x, y, pixel) |
#define | ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB) |
#define | ALPHA_BLEND128(sR, sG, sB, dR, dG, dB) |
Variables | |
struct sdl2_data | main_data |
#define adj_surf | ( | surf | ) | copy_surface(surf) |
Definition at line 200 of file graphics.h.
Definition at line 400 of file graphics.h.
#define crop_rect_from_screen | ( | rect | ) | crop_rect_from_surface(main_data.screen, &rect) |
Definition at line 318 of file graphics.h.
#define DEFAULT_ZOOM 1.0 |
Definition at line 198 of file graphics.h.
#define DUFFS_LOOP | ( | pixel_copy_increment, | |
width | |||
) | DUFFS_LOOP8(pixel_copy_increment, width) |
Definition at line 140 of file graphics.h.
#define DUFFS_LOOP4 | ( | pixel_copy_increment, | |
width | |||
) |
Definition at line 83 of file graphics.h.
#define DUFFS_LOOP8 | ( | pixel_copy_increment, | |
width | |||
) |
Definition at line 60 of file graphics.h.
#define DUFFS_LOOP_DOUBLE2 | ( | pixel_copy_increment, | |
double_pixel_copy_increment, | |||
width | |||
) |
Definition at line 98 of file graphics.h.
#define DUFFS_LOOP_QUATRO2 | ( | pixel_copy_increment, | |
double_pixel_copy_increment, | |||
quatro_pixel_copy_increment, | |||
width | |||
) |
Definition at line 117 of file graphics.h.
#define FREESURFACE | ( | ptr | ) |
Definition at line 322 of file graphics.h.
Definition at line 354 of file graphics.h.
#define lock_surf | ( | surf | ) |
Definition at line 333 of file graphics.h.
Definition at line 315 of file graphics.h.
Definition at line 361 of file graphics.h.
#define RECT_LIMIT 80 |
Definition at line 45 of file graphics.h.
#define unlock_screen | ( | ) | unlock_surf(main_data.screen) |
Definition at line 359 of file graphics.h.
#define unlock_surf | ( | surf | ) |
Definition at line 344 of file graphics.h.
#define USE_DUFFS_LOOP |
Definition at line 54 of file graphics.h.
Buffer allocation function. This function is call by "create_window(...)" function and allocate buffer layer for this function.
Pointer for this buffer is put in buffer array on last position that flush functions will draw this layer last.
Definition at line 110 of file graphics.c.
int alphablit | ( | SDL_Surface * | src, |
SDL_Rect * | srcrect, | ||
SDL_Surface * | dst, | ||
SDL_Rect * | dstrect, | ||
unsigned char | alpha_mod | ||
) |
Execute alphablit.
Definition at line 197 of file graphics.c.
int blit_entire_src | ( | SDL_Surface * | psrc, |
SDL_Surface * | pdest, | ||
Sint16 | dest_x, | ||
Sint16 | dest_y | ||
) |
Blit entire src [SOURCE] surface to destination [DEST] surface on position : [dest_x],[dest_y] using it's actual alpha and color key settings.
Definition at line 415 of file graphics.c.
int clear_surface | ( | SDL_Surface * | surf, |
SDL_Rect * | dstrect | ||
) |
Fill surface with (0, 0, 0, 0), so the next blitting operation can set the per pixel alpha
Definition at line 398 of file graphics.c.
SDL_Surface * convert_surf | ( | SDL_Surface * | surf_in | ) |
Convert surface to the main window format.
Definition at line 357 of file graphics.c.
SDL_Surface * copy_surface | ( | SDL_Surface * | src | ) |
Return copy of the surface
Definition at line 1307 of file graphics.c.
Make rectangle region sane. Return TRUE if result is sane.
Definition at line 886 of file graphics.c.
SDL_Surface * create_filled_surface | ( | Uint16 | w, |
Uint16 | h, | ||
Uint32 | flags, | ||
SDL_Color * | pcolor | ||
) |
Create an surface with screen format and fill with color. If pcolor == NULL surface is filled with transparent white A = 128
Definition at line 366 of file graphics.c.
Referenced by redraw_widget_info_label().
void create_frame | ( | SDL_Surface * | dest, |
Sint16 | left, | ||
Sint16 | top, | ||
Sint16 | width, | ||
Sint16 | height, | ||
SDL_Color * | pcolor | ||
) |
Create colored frame
Definition at line 1332 of file graphics.c.
void create_line | ( | SDL_Surface * | dest, |
Sint16 | x0, | ||
Sint16 | y0, | ||
Sint16 | x1, | ||
Sint16 | y1, | ||
SDL_Color * | pcolor | ||
) |
Create single colored line
Definition at line 1363 of file graphics.c.
SDL_Surface * create_surf | ( | int | width, |
int | height, | ||
Uint32 | flags | ||
) |
Create surface with the same format as main window
Definition at line 349 of file graphics.c.
Referenced by add_gui_layer(), canvas_create(), convert_iconlabel_to_themeiconlabel2(), create_bcgnd_surf(), create_filled_surface(), create_filled_surface(), create_horizontal_surface(), create_icon_theme_surf(), create_select_tech_icon(), create_surfaces(), create_themelabel2(), create_unit_surface(), create_utf8_multi_surf(), create_utf8_surf(), create_vertical_surface(), economy_report_dialog_popup(), fill_rect_alpha(), load_cursors(), option_dialog_worklist(), popup_advanced_terrain_dialog(), popup_impr_info(), popup_minimap_window(), popup_races_dialog(), popup_sabotage_dialog(), popup_unit_info(), popup_unitinfo_window(), popup_worklist_editor(), redraw_unit_info_label(), resize_surface_box(), resize_window(), setup_auxiliary_tech_icons(), and tilespec_setup_city_icons().
SDL_Surface * create_surf_with_format | ( | SDL_PixelFormat * | pf, |
int | width, | ||
int | height, | ||
Uint32 | flags | ||
) |
Create an surface with format MUST NOT BE USED IF NO SDLSCREEN IS SET
Definition at line 326 of file graphics.c.
Referenced by create_surf(), create_surf(), create_utf8_multi_surf(), and crop_rect_from_surface().
Create new main window surfaces.
Definition at line 554 of file graphics.c.
SDL_Surface * crop_rect_from_surface | ( | SDL_Surface * | psource, |
SDL_Rect * | prect | ||
) |
Create new surface (prect->w x prect->h size) and copy prect area of psource. if prect == NULL then create copy of entire psource.
Definition at line 234 of file graphics.c.
SDL_Surface * crop_visible_part_from_surface | ( | SDL_Surface * | psrc | ) |
Create new surface that is just visible part of source surface.
Definition at line 1223 of file graphics.c.
int fill_rect_alpha | ( | SDL_Surface * | surf, |
SDL_Rect * | prect, | ||
SDL_Color * | pcolor | ||
) |
Fill rectangle with color with alpha channel.
Definition at line 863 of file graphics.c.
Uint32 get_first_pixel | ( | SDL_Surface * | surf | ) |
Get first pixel Return the pixel value at (0, 0) NOTE: The surface must be locked before calling this!
Definition at line 466 of file graphics.c.
struct gui_layer * get_gui_layer | ( | SDL_Surface * | surface | ) |
Get surface gui_layer.
Definition at line 88 of file graphics.c.
Uint32 get_pixel | ( | SDL_Surface * | surf, |
int | x, | ||
int | y | ||
) |
Get pixel Return the pixel value at (x, y) NOTE: The surface must be locked before calling this!
Definition at line 428 of file graphics.c.
void get_smaller_surface_rect | ( | SDL_Surface * | surf, |
SDL_Rect * | rect | ||
) |
Get visible rectangle from surface.
Definition at line 934 of file graphics.c.
Free resources associated with gui_layer.
Definition at line 79 of file graphics.c.
struct gui_layer * gui_layer_new | ( | int | x, |
int | y, | ||
SDL_Surface * | surface | ||
) |
Allocate new gui_layer.
Definition at line 64 of file graphics.c.
Initialize sdl with Flags
Definition at line 504 of file graphics.c.
Return whether coordinates are in rectangle.
Definition at line 923 of file graphics.c.
Translate dest_rect from gui_layer's to global screen coordinates.
Definition at line 183 of file graphics.c.
SDL_Surface * load_surf | ( | const char * | fname | ) |
Load a surface from file putting it in software mem.
Definition at line 305 of file graphics.c.
Return height of the main window
Definition at line 691 of file graphics.c.
Return width of the main window
Definition at line 683 of file graphics.c.
SDL_Surface * mask_surface | ( | SDL_Surface * | src, |
SDL_Surface * | mask, | ||
int | mask_offset_x, | ||
int | mask_offset_y | ||
) |
Reduce the alpha of the final surface proportional to the alpha of the mask. Thus if the mask has 50% alpha the final image will be reduced by 50% alpha.
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.
Definition at line 260 of file graphics.c.
Free screen buffers
Definition at line 620 of file graphics.c.
Free buffer layer ( call by popdown_window_group_dialog(...) func ) Func. Free buffer layer and clear buffer array entry.
Definition at line 146 of file graphics.c.
SDL_Surface * resize_surface | ( | const SDL_Surface * | psrc, |
Uint16 | new_width, | ||
Uint16 | new_height, | ||
int | smooth | ||
) |
Scale surface.
Definition at line 1235 of file graphics.c.
SDL_Surface * resize_surface_box | ( | const SDL_Surface * | psrc, |
Uint16 | new_width, | ||
Uint16 | new_height, | ||
int | smooth, | ||
bool | scale_up, | ||
bool | absolute_dimensions | ||
) |
Resize a surface to fit into a box with the dimensions 'new_width' and a 'new_height'. If 'scale_up' is FALSE, a surface that already fits into the box will not be scaled up to the boundaries of the box. If 'absolute_dimensions' is TRUE, the function returns a surface with the dimensions of the box and the scaled/original surface centered in it.
Definition at line 1255 of file graphics.c.
int screen_blit | ( | SDL_Surface * | src, |
SDL_Rect * | srcrect, | ||
SDL_Rect * | dstrect, | ||
unsigned char | alpha_mod | ||
) |
Execute alphablit to the main surface
Definition at line 221 of file graphics.c.
Translate dest_rect from global screen to gui_layer's coordinates.
Definition at line 171 of file graphics.c.
Switch to given video mode.
Definition at line 634 of file graphics.c.
Render from main surface with screen renderer.
Definition at line 667 of file graphics.c.
Definition at line 55 of file graphics.c.