Skip to Content
The Alchemy Project

include/battle/blitter.h

How battle effects draw a picture onto their canvas: the blitter btEffectBuildBlitter builds, the edges it clips at, how it mirrors and how its pixels combine with the canvas's.

Included by battle_internal.h, battle_effect_internal.h, lucky_wheels.c and battle_effect.h.

Typedefs

NameDescription
typedef Sint32 (*DRAW_RECTANGLE )(void *destination, const void *source, Sint32 x, Sint32 y, Sint32 width, Sint32 height);A blitter btEffectBuildBlitter writes into a heap slot: it draws a width by height picture from source onto the destination canvas with its top left at (x, y), in pixels.

Enumerations

NameDescription
enumanonymous enum { BLITTER_CLIP_X, BLITTER_CLIP_Y, COMPOSITE_FLIP_X, COMPOSITE_ … }btEffectBuildBlitter's flags: which edges the built blitter clips at and how it mirrors the picture.
enumanonymous enum { COMPOSITE_COPY, COMPOSITE_TRANSPARENT, COMPOSITE_LIGHTEN, CO … }btEffectBuildBlitter's modes: how a picture's pixels combine with the canvas's (the fragments in blitter_fragments.c).

Description

How battle effects draw a picture onto their canvas: the blitter btEffectBuildBlitter builds, the edges it clips at, how it mirrors and how its pixels combine with the canvas's.

Typedefs in detail

DRAW_RECTANGLE

typedef Sint32 (*DRAW_RECTANGLE)(void *destination, const void *source, Sint32 x, Sint32 y, Sint32 width, Sint32 height);

A blitter btEffectBuildBlitter writes into a heap slot: it draws a width by height picture from source onto the destination canvas with its top left at (x, y), in pixels.

Referenced by btEffectRunAnnihilation(), btEffectRunAttackSlash(), btEffectRunBladeRain(), btEffectRunBoreas(), btEffectRunBreak(), btEffectRunCastingImpact(), btEffectRunCriticalHit(), btEffectRunDouse(), btEffectRunDragonCloud(), btEffectRunDrain(), btEffectRunFlare(), btEffectRunFlashingStrike(), btEffectRunGrowingColumns(), btEffectRunHelmSplitter(), btEffectRunImpactBurst(), btEffectRunJudgment(), btEffectRunKirin(), btEffectRunNeptune(), btEffectRunProcne(), btEffectRunQuake(), btEffectRunRagnarok(), btEffectRunRamses(), btEffectRunSleep(), btEffectRunSpire(), btEffectRunStarfieldFall(), btEffectRunStreakVolley(), btEffectRunTargetBursts(), btEffectRunTargetStrike(), btEffectRunThor(), btEffectRunThorn(), btEffectRunTitanBlade(), btEffectRunTorch(), btEffectRunUndeadSword(), btElementGlowUpdateStarField() and fdLuckyWheelsRun().

Definition at line 38 of file blitter.h.

Enumerations in detail

anonymous enum

enum { BLITTER_CLIP_X, BLITTER_CLIP_Y, COMPOSITE_FLIP_X, COMPOSITE_FLIP_Y, … }

btEffectBuildBlitter's flags: which edges the built blitter clips at and how it mirrors the picture.

EnumeratorValueDescription
BLITTER_CLIP_X1skips columns outside the canvas; without it a width mask wraps x
BLITTER_CLIP_Y2skips rows outside the canvas's height
COMPOSITE_FLIP_X4mirrors the picture left to right
COMPOSITE_FLIP_Y8mirrors the picture top to bottom
COMPOSITE_FLIPCOMPOSITE_FLIP_X | COMPOSITE_FLIP_Y

Definition at line 15 of file blitter.h.

anonymous enum

enum { COMPOSITE_COPY, COMPOSITE_TRANSPARENT, COMPOSITE_LIGHTEN, COMPOSITE_ADDITIVE }

btEffectBuildBlitter's modes: how a picture's pixels combine with the canvas's (the fragments in blitter_fragments.c).

EnumeratorValueDescription
COMPOSITE_COPYwrites every pixel
COMPOSITE_TRANSPARENTwrites every nonzero pixel
COMPOSITE_LIGHTENkeeps the brighter of the two
COMPOSITE_ADDITIVEadds the two, capped at 63

Definition at line 27 of file blitter.h.