|
maug
Quick and dirty C mini-augmentation library.
|
A flexible API to facilitate tile-based views using hardware acceleration where available. More...

Data Structures | |
| struct | RETROFLAT_VIEWPORT |
| The viewport data struct. More... | |
Macros | |
| #define | retroflat_screen_colors() (g_retroflat_state->screen_colors) |
| #define | retroflat_viewport_world_tile_x() retroflat_viewport_world_tile_x_generic() |
| #define | retroflat_viewport_world_tile_y() retroflat_viewport_world_tile_y_generic() |
| #define | retroflat_viewport_focus(x1, y1, range, speed) retroflat_viewport_focus_generic( 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. More... | |
| #define | retroflat_viewport_screen_x(world_x) retroflat_viewport_screen_x_generic( 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) retroflat_viewport_screen_y_generic( world_y ) |
| Return the screenspace Y coordinate at which something at the given world coordinate should be drawn. | |
| #define | retroflat_viewport_move_x(x) retroflat_viewport_move_x_generic( x ) |
| #define | retroflat_viewport_move_y(y) retroflat_viewport_move_y_generic( 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_focus | ( | x1, | |
| y1, | |||
| range, | |||
| speed | |||
| ) | retroflat_viewport_focus_generic( 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.
| x1 | The X coordinate to focus on. |
| y1 | The Y coordinate to focus on. |
| range | The number of pixels from the center of the screen to keep the given X and Y inside. |
| speed | The increment by which to move the viewport if the given X and Y are not in focus. |