Thread Rating:
  • 3 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Release 2.7.0 - sprite list order, sprite masking
#1
Release 2.7.0 introduces two new features inspired on the Sega Genesis/MegaDrive and some tweaks & bugfixes

Sprite list order
Until now, sprites were drawn based in their order ID so when overlapping, sprite 0 was always under sprite 1, and sprite 2 was always on top of sprite 1. This release introduces the ability to change sprite ordering based on internal link list. Function TLN_SetFirstSprite() sets the index of the beggining of list, and TLN_SetNextSprite() tells which sprite follows which one. If you want that sprite 1 is drawn after sprite 4 (on top of it), you call TLN_SetNextSprite(4, 1).

Sprite masking
Now it's possible to define a horizontal region to mask out selected sprites with TLN_SetSpritesMaskRegion(top, bottom), setting a top and bottom scanline. Sprites flagged with TLN_EnableSpriteMasking() won't be drawn when crossing this region. The Sega Genesis had a cumbersome way to enable this feature, using specially positioned sprites on the screen and inside the sprite list order, but Tilengine does the same in a straightforward way.

Other tweaks and fixes include:
  • Fixes crashes when closing window and strange input behavior due to compiler-induced bugs with optimizations enabled for 64-bit builds
  • When CRT effect is disabled, sharp nearest-neighbour scaling is always used
  • Parameter "count" has been removed from TLN_CreateSpriteAnimation(), now is obtained automatically from sprite names inside spriteset.
  • Reworked some samples that used old and messy .sqx files for sprite animations, and replaced with newer spriteset-based sequences.
Check out in GitHub
#2
Hi again. Will you reimplement SetAnimationDelay()?
#3
(04-28-2020, 01:38 AM)mycats Wrote: Hi again. Will you reimplement SetAnimationDelay()?
Maybe, why not? The issue here is to define conflicting behaviors. Each frame has its own delay, so what happens when you set a global delay? Does it override individual delays? And how do you return to standard per-frame delay? Maybe calling the function with a special value (like 0) that disables global delay?

If you make a small specification about desired behavior, of course it can be implemented


Forum Jump:


Users browsing this thread: 1 Guest(s)