GrafX2 2.9.3227
The ultimate 256-color painting program
|
#include <stdlib.h>
#include <string.h>
#include "struct.h"
#include "global.h"
#include "graph.h"
#include "screen.h"
#include "engine.h"
#include "windows.h"
#include "input.h"
#include "misc.h"
#include "osdep.h"
#include "tiles.h"
Macros | |
#define | TILE_FOR_COORDS(x, y) (((y)-Snap_offset_Y)/Snap_height*Main.tilemap_width+((x)-Snap_offset_X)/Snap_width) |
#define | TILE_AT(x, y) (y)*Main.tilemap_width+(x) |
#define | TILE_X(t) (((t)%Main.tilemap_width)*Snap_width+Snap_offset_X) |
#define | TILE_Y(t) (((t)/Main.tilemap_width)*Snap_height+Snap_offset_Y) |
Enumerations | |
enum | TILE_FLIPPED { TILE_FLIPPED_NONE = 0 , TILE_FLIPPED_X = 1 , TILE_FLIPPED_Y = 2 , TILE_FLIPPED_XY = 3 } |
Functions | |
void | Tilemap_draw (word x, word y, byte color) |
Draw a pixel while Tilemap mode is active : This will paint on all similar tiles of the layer, visible on the screen or not. More... | |
int | Tile_is_same (int t1, int t2) |
int | Tile_is_same_flipped_x (int t1, int t2) |
int | Tile_is_same_flipped_y (int t1, int t2) |
int | Tile_is_same_flipped_xy (int t1, int t2) |
void | Tilemap_update (void) |
Create or update a tilemap based on current screen (layer)'s pixels. More... | |
void | Disable_tilemap (T_Document *doc) |
Clears all tilemap data and settings Safe to call again. More... | |
#define TILE_FOR_COORDS | ( | x, | |
y | |||
) | (((y)-Snap_offset_Y)/Snap_height*Main.tilemap_width+((x)-Snap_offset_X)/Snap_width) |
#define TILE_AT | ( | x, | |
y | |||
) | (y)*Main.tilemap_width+(x) |
#define TILE_X | ( | t | ) | (((t)%Main.tilemap_width)*Snap_width+Snap_offset_X) |
#define TILE_Y | ( | t | ) | (((t)/Main.tilemap_width)*Snap_height+Snap_offset_Y) |
enum TILE_FLIPPED |
Draw a pixel while Tilemap mode is active : This will paint on all similar tiles of the layer, visible on the screen or not.
References T_Tile::Flipped, Limit_left, Limit_right, Limit_top, Main, T_Tile::Next, Pixel_in_current_screen, Pixel_in_current_screen_with_preview, Snap_height, Snap_offset_X, Snap_offset_Y, Snap_width, TILE_FOR_COORDS, T_Document::tilemap, T_Document::tilemap_height, T_Document::tilemap_width, and Update_rect().
Referenced by Capture_brush(), Capture_brush_with_lasso(), and Display_pixel().
int Tile_is_same | ( | int | t1, |
int | t2 | ||
) |
References T_Document::backups, T_Document::current_layer, T_Page::Image, T_Document::image_width, Main, T_List_of_pages::Pages, T_Image::Pixels, Snap_height, Snap_width, TILE_X, and TILE_Y.
Referenced by Tilemap_update().
int Tile_is_same_flipped_x | ( | int | t1, |
int | t2 | ||
) |
References T_Document::backups, T_Document::current_layer, T_Page::Image, T_Document::image_width, Main, T_List_of_pages::Pages, T_Image::Pixels, Snap_height, Snap_width, TILE_X, and TILE_Y.
Referenced by Tilemap_update().
int Tile_is_same_flipped_y | ( | int | t1, |
int | t2 | ||
) |
References T_Document::backups, T_Document::current_layer, T_Page::Image, T_Document::image_width, Main, T_List_of_pages::Pages, T_Image::Pixels, Snap_height, Snap_width, TILE_X, and TILE_Y.
Referenced by Tilemap_update().
int Tile_is_same_flipped_xy | ( | int | t1, |
int | t2 | ||
) |
References T_Document::backups, T_Document::current_layer, T_Page::Image, T_Document::image_width, Main, T_List_of_pages::Pages, T_Image::Pixels, Snap_height, Snap_width, TILE_X, and TILE_Y.
Referenced by Tilemap_update().
void Tilemap_update | ( | void | ) |
Create or update a tilemap based on current screen (layer)'s pixels.
Create or update a tilemap based on current screen pixels.
References Close_window(), Config, Cursor_shape, CURSOR_SHAPE_HOURGLASS, Disable_tilemap(), Display_cursor(), T_Tile::Flipped, Get_input(), GFX2_GetTicks(), Hide_cursor, T_Document::image_height, T_Document::image_width, Main, MC_Black, MC_Light, T_Tile::Next, NULL, Num2str, Open_window(), T_Tile::Previous, Print_in_window(), Snap_height, Snap_offset_X, Snap_offset_Y, Snap_width, TILE_FLIPPED_X, TILE_FLIPPED_XY, TILE_FLIPPED_Y, Tile_is_same(), Tile_is_same_flipped_x(), Tile_is_same_flipped_xy(), Tile_is_same_flipped_y(), T_Document::tilemap, T_Config::Tilemap_allow_flipped_x, T_Config::Tilemap_allow_flipped_y, T_Document::tilemap_height, T_Document::tilemap_mode, T_Config::Tilemap_show_count, T_Document::tilemap_width, Update_window_area, Window_height, and Window_width.
Referenced by Button_Grid_menu(), Button_Load(), Button_Reload(), Button_Resolution(), Button_Tilemap_menu(), Button_Tilemap_mode(), Button_Transform_menu(), Redo(), Scroll_0_5(), and Undo().
void Disable_tilemap | ( | T_Document * | doc | ) |
Clears all tilemap data and settings Safe to call again.
References NULL, T_Document::tilemap, T_Document::tilemap_height, T_Document::tilemap_mode, and T_Document::tilemap_width.
Referenced by Button_Copy_page(), Button_Grid_menu(), and Tilemap_update().