Previous implementation had to create a new surface every time srcRect
has been changed and as a bonus, it would (harmlessly but still) do a
read-modify-write past the screen buffer.
- Introduce AtariSurface: a surface which represents either a
bitplane-based or pixel-based surface (on SuperVidel, as an inherited
SuperVidelSurface). Screen::surf / Screen::offsettedSurf are its
instances.
- Graphics::Surface::create / free now handle all Atari-related surfaces
via dlmalloc: ST RAM (TT/Falcon), VRAM (SuperVidel - 0xA0xxxxxx) and
VRAM for generic surfaces (SuperBlitter - 0xA1xxxxxx or ST/TT RAM).
This allowed me to remove all the hacky stuff from atari-graphics and
atari-superblitter.h.
- blit-atari.cpp now contains only blitting code
(SuperBlitter/move16/fallback), SV code is in
atari-supervidel.{cpp,h}.
- Take advantage of Common::ScopedPtr and Graphics::ManagedSurface's
dispose flag for Screen::surf as well Graphics::ManagedSurface's
ownership for Screen::offsettedSurf.
- Improve recoverability if an error/assert happens in
AtariGraphicsManager's c-tor/d-tor.
It causes more harm than good and I don't think it helps with
performance that much either. Its only semi-valid use case was C2P
direct rendering for sprites (which nobody uses). However, direct
rendering in its current form is about to be removed in a near future,
so...
- leftovers after highlighted dirty rectangle
- not updating _surface if moving to fast left/right from screen borders
(_width == _srcRect.width())
- not drawing cursor if repeatedly intersecting with a refreshing dirty
rect
- leftover rectangle when leaving game overlay to the launcher
- massive simplification
This shaves off a good 800 KB from all the engines. However, do keep
local atari debug messages for diagnostic purposes.
Also, use natfeats for debug output when possible else the classic
stdout/stderr (not both as before).
- optimize fillScreen(): Eco Quest calls it way too often with 1x1 rects
- don't disable Cursor::isChanged() flags on !isVisible(), that leads to
skipping of _surface creation in some cases
- handle properly any number of parameters between beginGFXTransaction
and endGFXTransaction
- clear the work buffer when exiting a game to avoid showing it when
next game shows an error upon startup
Instead of having one globally in AtariGraphicsManager. This simplifies
code and cleans up a lot of dark corners in AtariGraphicsManager.
A slight disadvantage is that now the cursor surface has be to converted
for each buffer.