A flexible API to facilitate tile-based views using hardware acceleration where available.
More...
|
#define | retroflat_screen_colors() |
|
#define | retroflat_viewport_world_x() |
| Return the current viewport X position in the world in pixels.
|
|
#define | retroflat_viewport_world_y() |
| Return the current viewport Y position in the world in pixels.
|
|
#define | retroflat_viewport_world_tile_x() |
|
#define | retroflat_viewport_world_tile_y() |
|
#define | retroflat_viewport_world_w() |
| Return the current width of the world in pixels.
|
|
#define | retroflat_viewport_world_h() |
| Return the current height of the world in pixels.
|
|
#define | retroflat_viewport_screen_tile_w() |
| Return the current width of the world in tiles.
|
|
#define | retroflat_viewport_screen_tile_h() |
| Return the current height of the world in tiles.
|
|
#define | retroflat_viewport_screen_w() |
| Return the width of the viewport in pixels.
|
|
#define | retroflat_viewport_screen_h() |
| Return the height of the viewport in pixels.
|
|
#define | retroflat_viewport_screen_w_remainder() |
| Return the difference in pixels between the viewport X + width and the screen width.
|
|
#define | retroflat_viewport_screen_h_remainder() |
| Return the difference in pixels between the viewport Y + height and the screen height.
|
|
#define | retroflat_viewport_set_world(w, h) |
| Set the pixel width and height of the world so the viewport knows how far it may scroll.
|
|
#define | retroflat_viewport_set_world_pos(x, y) |
| Set the position of the viewport in the world in pixels.
|
|
#define | retroflat_viewport_set_pos_size(x_px, y_px, w_px, h_px) |
| Set the pixel width and height of the viewport, as well as some other dependent values frequently used in screen updates.
|
|
#define | retroflat_viewport_lock_refresh() |
| Lock access to RETROFLAT_VIEWPORT::refresh_grid in memory.
|
|
#define | retroflat_viewport_unlock_refresh() |
| Unlock access to RETROFLAT_VIEWPORT::refresh_grid in memory.
|
|
#define | retroflat_viewport_set_refresh(x, y, tid) |
| Set the tile at the given screen pixel coordinates to the given tile ID.
|
|
#define | retroflat_viewport_focus(x1, y1, range, speed) |
| Move the viewport in a direction or combination thereof so that it's focusing the given x1/y1 within the given range.
|
|
#define | retroflat_viewport_screen_x(world_x) |
| Return the screenspace X coordinate at which something at the given world coordinate should be drawn.
|
|
#define | retroflat_viewport_screen_y(world_y) |
| Return the screenspace Y coordinate at which something at the given world coordinate should be drawn.
|
|
#define | retroflat_viewport_move_x(x) |
|
#define | retroflat_viewport_move_y(y) |
|
A flexible API to facilitate tile-based views using hardware acceleration where available.
If no hardware acceleration is available on the platform, then the platform API header should define RETROFLAT_SOFT_VIEWPORT to enable the _generic functions and suffixes for this functionality.
#define retroflat_viewport_set_refresh |
( |
| x, |
|
|
| y, |
|
|
| tid ) |
|
related |
Value: retroflat_viewport_set_refresh_generic( x, y, tid )
Set the tile at the given screen pixel coordinates to the given tile ID.
If these coordinates are from the world, they should subtract retroflat_viewport_screen_x()/retroflat_viewport_screen_y() first!
When the viewport is redrawn, e.g. with retrotile_topdown_draw(), it will not redraw this tile if the tile ID is still the same.