SaturnRingLibrary 0.9.1
SGL wrapper
 
Loading...
Searching...
No Matches

◆ SpriteEffect

enum class SRL::Scene2D::SpriteEffect : uint8_t
strong

List of all available sprite effects.

Enumerator
Gouraud 

Gouraud shading.

Enables/disables gouraud shading for sprites.
Expected parameter is zero based index (uint16_t) to a gouraud shading table to enable shading, or negative or no value to disable it.

// 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:680
@ Gouraud
Gouraud shading.
Definition srl_scene2d.hpp:66
ScreenDoors 

Screen doors effect.

Enables/disables screen door effect.
Expects boolean value as parameter.

HalfTransparency 

Half transparency effect.

Enables/disables half transparency effect.
Expects boolean value as parameter.

Clipping 

Sprite clipping effect.

Enables/disables clipping effect.
Expects SRL::Scene2D::ClippingEffect enum.
Use SRL::Scene2D::SetClippingRectangle() function to set the clipping rectangle.

// Disable flip
// or
// Enable flip
@ Clipping
Sprite clipping effect.
Definition srl_scene2d.hpp:108
@ NoClipping
Disable sprite clipping.
Definition srl_scene2d.hpp:20
@ ClipInside
Display sprite only on the outside of the clipping rectangle.
Definition srl_scene2d.hpp:28
Flip 

Flip sprite effect.

Allows to set sprite texture read direction (making sprite flipped).

// Disable flipping
// or
// Enable clipping
// Enable flip in both directions
@ Flip
Flip sprite effect.
Definition srl_scene2d.hpp:125
@ NoFlip
Do not flip sprite.
Definition srl_scene2d.hpp:37
@ HorizontalFlip
Flip sprite horizontally.
Definition srl_scene2d.hpp:41
@ VerticalFlip
Flip sprite vertically.
Definition srl_scene2d.hpp:45
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:
@ OpacityBank
VDP2 color calculation effect.
Definition srl_scene2d.hpp:135
Note
Only applies to palette color modes
EnableHSS 

Enables textured sprite high speed shrink.

When EnableHSS is specified, lines drawn with magnification of less than 1 are drawn by sampling only even or odd pixels of the original data.

// Disable effect
// or
// Enable effect
@ EnableHSS
Enables textured sprite high speed shrink.
Definition srl_scene2d.hpp:150
Note
Applies only to textured polygons
EnableECD 

Enables end code character for textured sprites.

Drawing in horizontal direction is terminated, when an end code is read twice.

Color mode EndCode
16 colors (CRAM) 0xf
16 colors (CLUT) 0xf
64 colors (CRAM) 0xff
128 colors (CRAM) 0xff
256 colors (CRAM) 0xff
16bit RGB 0x7fff

Behaviour in combination with EnableHSS

HSS ECD Behaviour
OFF ON End code enabled, drawing in horizontal direction is disabled when second ECD is read and ECD becomes transparent
OFF OFF End code disabled, ECD is not processed, color of the code is drawn
ON & enlarge ON End code enabled, drawing in horizontal direction is disabled when second ECD is read and ECD becomes transparent
ON & reduce ON End code disabled, ECD is not processed, color of the code is drawn
ON OFF End code disabled, ECD is not processed, color of the code is drawn
// Disable effect
// or
// Enable effect
@ EnableECD
Enables end code character for textured sprites.
Definition srl_scene2d.hpp:181
Note
Applies only to textured polygons
DisablePreClip 

Disables pre-clipping of textured sprite.

Drawing commands comprise of group of several lines, and perspective lines compris of a number of dots. Each dot is drawn based on drawing area specified by CPU. For lines completely outside or not fully inside drawing area, enabled pre-clipping can improve performance. If lines are fully within drawing area, disabling pre-clipping can improve performance.

Note
By default, PreClip is enabled
Applies only to textured polygons