Rendering of VDP1 sprites and shapes.
#include <srl_scene2d.hpp>
Public Types | |
enum | ClippingEffect : uint8_t { NoClipping = 0 , ClipOutside = 2 , ClipInside = 3 } |
Clipping effect mode. More... | |
enum | FlipEffect : uint8_t { NoFlip = 0 , HorizontalFlip = 1 , VerticalFlip = 2 } |
Sprite flip effect. More... | |
enum | SpriteEffect : uint8_t { Gouraud = 0 , ScreenDoors = 1 , HalfTransparency = 2 , Clipping = 3 , Flip = 4 , OpacityBank = 5 } |
List of all available sprite effects. More... | |
Draw functions | |
static bool | DrawSprite (const uint16_t texture, SRL::CRAM::Palette *texturePalette, const Types::Vector2D points[4], const Types::Fxp depth) |
Draw sprite from 4 points. | |
static bool | DrawSprite (const uint16_t texture, const Types::Vector2D points[4], const Types::Fxp depth) |
Draw sprite from 4 points. | |
static bool | DrawSprite (const uint16_t texture, SRL::CRAM::Palette *texturePalette, const Types::Vector3D &location, const Types::Angle &angle=Types::Angle::FromRaw(0), const Types::Vector2D &scale=Types::Vector2D(1.0, 1.0)) |
Draw simple sprite. | |
static bool | DrawSprite (const uint16_t texture, const Types::Vector3D &location, const Types::Angle &angle=Types::Angle::FromRaw(0), const Types::Vector2D &scale=Types::Vector2D(1.0, 1.0)) |
Draw simple sprite. | |
static bool | DrawSprite (const uint16_t texture, const Types::Vector3D &location, const Types::Vector2D &scale) |
Draw simple sprite. | |
static bool | DrawSprite (const uint16_t texture, SRL::CRAM::Palette *texturePalette, const Types::Vector3D &location, const Types::Vector2D &scale) |
Draw simple sprite. | |
static bool | DrawLine (const Types::Vector2D &start, const Types::Vector2D &end, const Types::HighColor &color, const Types::Fxp sort) |
Draws a Line. | |
static bool | DrawPolygon (const Types::Vector2D points[4], const bool fill, const Types::HighColor &color, const Types::Fxp sort) |
Draws a generic polygon. | |
Sprite effect functions | |
static bool | SetClippingRectangle (const Types::Vector3D &location, const Types::Vector2D &size) |
Set the Clipping rectangle. | |
static void | SetEffect (const SpriteEffect effect, const int32_t data=-1) |
Set sprite effect. | |
static int32_t | GetEffect (const SpriteEffect effect) |
Get currently set effect value. | |
enum SRL::Scene2D::ClippingEffect : uint8_t |
enum SRL::Scene2D::FlipEffect : uint8_t |
enum SRL::Scene2D::SpriteEffect : uint8_t |
List of all available sprite effects.
Enumerator | |
---|---|
Gouraud | Gouraud shading. Enables/disables gouraud shading for sprites. // Disable shading
// or
// Enable shading, use 16th entry in the table
static void SetEffect(const SpriteEffect effect, const int32_t data=-1) Set sprite effect. Definition srl_scene2d.hpp:468 |
ScreenDoors | Screen doors effect. Enables/disables screen door effect. // Disable effect
// or
// Enable effect
|
HalfTransparency | Half transparency effect. Enables/disables half transparency effect. // Disable effect
// or
// Enable effect
@ HalfTransparency Half transparency effect. Definition srl_scene2d.hpp:232 |
Clipping | Sprite clipping effect. Enables/disables clipping effect. // Disable flip
SRL::Scene2D::SetEffect(SRL::Scene2D::SpriteEffect::Clipping, SRL::Scene2D::ClippingEffect::NoClipping);
// or
// Enable flip
SRL::Scene2D::SetEffect(SRL::Scene2D::SpriteEffect::Clipping, SRL::Scene2D::ClippingEffect::ClipInside);
@ ClipInside Display sprite only on the outside of the clipping rectangle. Definition srl_scene2d.hpp:166 |
Flip | Flip sprite effect. Allows to set sprite texture read direction (making sprite flipped) // Disable flipping
// or
// Enable clipping
SRL::Scene2D::SetEffect(SRL::Scene2D::SpriteEffect::Flip, SRL::Scene2D::FlipEffect::HorizontalFlip);
// Enable flip in both directions
|
OpacityBank | VDP2 color calculation effect. Set sprites Color Calculation Ratio to one of 8 stored opacities (Banks 0-7) //Set sprite to use ratio stored in opacity bank 1:
|
|
inlinestatic |
Draws a Line.
start | start point |
end | end point |
color | color of the line |
sort | Z order |
|
inlinestatic |
Draws a generic polygon.
points | Points of the polygon |
fill | Indicates whether polygon is filled or if it is just a poly-line |
color | Polygon color |
sort | Z order |
|
inlinestatic |
Draw sprite from 4 points.
texture | Sprite texture |
points | Corners of the sprite in screen coordinates |
depth | Depth sort value |
|
inlinestatic |
Draw simple sprite.
texture | Sprite texture |
location | Location of the sprite (Z coordinate is used for sorting) |
angle | Sprite rotation angle |
scale | Scale of the sprite |
|
inlinestatic |
Draw simple sprite.
texture | Sprite texture |
location | Location of the sprite (Z coordinate is used for sorting) |
scale | Scale of the sprite |
|
inlinestatic |
Draw sprite from 4 points.
texture | Sprite texture |
texturePalette | Sprite texture color palette override |
points | Corners of the sprite in screen coordinates |
depth | Depth sort value |
|
inlinestatic |
Draw simple sprite.
texture | Sprite texture |
texturePalette | Sprite texture color palette override |
location | Location of the sprite (Z coordinate is used for sorting) |
angle | Sprite rotation angle |
scale | Scale of the sprite |
|
inlinestatic |
Draw simple sprite.
texture | Sprite texture |
texturePalette | Sprite texture color palette override |
location | Location of the sprite (Z coordinate is used for sorting) |
scale | Scale of the sprite |
|
inlinestatic |
Get currently set effect value.
See SRL::Scene2D::SpriteEffect for valid effect data
effect | Effect id |
|
inlinestatic |
Set the Clipping rectangle.
location | Rectangle top left corner location in screen coordinates, where top left corner of the screen is (0,0) |
size | Rectangle size |
|
inlinestatic |
Set sprite effect.
See SRL::Scene2D::SpriteEffect for valid effect data
effect | Effect id |
data | Effect parameter |