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 class | CommandType : uint16_t { StandardSprite = 0x0 , RectangleSprite = 0x1 , Texture = 0x2 , Polygon = 0x4 , PolyLine = 0x5 , LineSegment = 0x6 , SystemClip = 0x9 , UserClip = 0x8 , BasePosition = 0xA , End = 0x80 } |
| Command control type. More... | |
| enum | FlipEffect : uint8_t { NoFlip = 0 , HorizontalFlip = 1 , VerticalFlip = 2 } |
| Sprite flip effect. More... | |
| enum class | SpriteEffect : uint8_t { Gouraud = 0 , ScreenDoors = 1 , HalfTransparency = 2 , Clipping = 3 , Flip = 4 , OpacityBank = 5 , EnableHSS = 6 , EnableECD = 7 , DisablePreClip = 8 } |
| List of all available sprite effects. More... | |
| enum | ZoomPoint : uint8_t { UpperLeft = 0x5 , CenterLeft = 0x9 , BottomLeft = 0xd , TopCenter = 0x6 , Center = 0xa , BottomCenter = 0xe , UpperRight = 0x7 , CenterRight = 0xb , BottomRight = 0xf } |
| Scaled sprite zoom point. More... | |
Static Public Member Functions | |
Sprite/Shape command creation | |
| static constexpr SPRITE | GetSpriteCommand (Scene2D::CommandType type, Types::HighColor color) |
| Generates sprite command based on current effect flags. | |
| static constexpr SPR_ATTR | GetSpriteAttribute (const uint16_t texture, SRL::CRAM::Palette *texturePalette, const Scene2D::ZoomPoint zoomPoint=Scene2D::ZoomPoint::Center) |
| Generates sprite attributes struct based on current effect flags. | |
Draw functions | |
| static bool | Draw (SPRITE *command, const SRL::Math::Types::Fxp &depth) |
| Draw sprite by using a custom command. | |
| static bool | Draw (SPR_ATTR *attributes, const SRL::Math::Types::Fxp *arguments) |
| Draw sprite by using custom attributes. | |
| static bool | Draw (SPR_ATTR *attributes, const SRL::Math::Types::Vector2D points[4], const SRL::Math::Types::Fxp depth) |
| Draw sprite by using custom attributes and 4 points. | |
| static bool | DrawSprite (const uint16_t texture, SRL::CRAM::Palette *texturePalette, const SRL::Math::Types::Vector2D points[4], const SRL::Math::Types::Fxp depth) |
| Draw sprite from 4 points. | |
| static bool | DrawSprite (const uint16_t texture, const SRL::Math::Types::Vector2D points[4], const SRL::Math::Types::Fxp depth) |
| Draw sprite from 4 points. | |
| static bool | DrawSprite (const uint16_t texture, SRL::CRAM::Palette *texturePalette, const SRL::Math::Types::Vector3D &location, const SRL::Math::Types::Angle &angle=SRL::Math::Types::Angle(), const SRL::Math::Types::Vector2D &scale=SRL::Math::Types::Vector2D(1.0, 1.0), const Scene2D::ZoomPoint zoomPoint=Scene2D::ZoomPoint::Center) |
| Draw simple sprite. | |
| static bool | DrawSprite (const uint16_t texture, const SRL::Math::Types::Vector3D &location, const SRL::Math::Types::Angle &angle=SRL::Math::Types::Angle::Zero(), const SRL::Math::Types::Vector2D &scale=SRL::Math::Types::Vector2D(1.0, 1.0), const Scene2D::ZoomPoint zoomPoint=Scene2D::ZoomPoint::Center) |
| Draw simple sprite. | |
| static bool | DrawSprite (const uint16_t texture, const SRL::Math::Types::Vector3D &location, const SRL::Math::Types::Vector2D &scale, const Scene2D::ZoomPoint zoomPoint=Scene2D::ZoomPoint::Center) |
| Draw simple sprite. | |
| static bool | DrawSprite (const uint16_t texture, SRL::CRAM::Palette *texturePalette, const SRL::Math::Types::Vector3D &location, const SRL::Math::Types::Vector2D &scale, const Scene2D::ZoomPoint zoomPoint=Scene2D::ZoomPoint::Center) |
| Draw simple sprite. | |
| static bool | DrawLine (const SRL::Math::Types::Vector2D &start, const SRL::Math::Types::Vector2D &end, const Types::HighColor &color, const SRL::Math::Types::Fxp sort) |
| Draws a Line. | |
| static bool | DrawPolygon (SRL::Math::Types::Vector2D points[4], const bool fill, const Types::HighColor &color, const SRL::Math::Types::Fxp sort) |
| Draws a generic polygon. | |
Sprite effect functions | |
| static bool | SetClippingRectangle (const SRL::Math::Types::Vector3D &location, const SRL::Math::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. | |