You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
125 lines
1.8 KiB
Plaintext
125 lines
1.8 KiB
Plaintext
Blitter - Memo
|
|
|
|
|
|
|
|
Am besten wäre es wenn es zwei Typen von Funktionen gibt.
|
|
|
|
Typ 1: Engine typ
|
|
Bleibt logisch auf eine ebene vor dem hardware blitter und nach dem clipper
|
|
|
|
Typ 2: Driver typ
|
|
Treiber basierender Code. Kann dadurch einfach für die Zielplatform optimiert werden.
|
|
|
|
|
|
|
|
Typ1:
|
|
|
|
SRC_COLORKEY
|
|
DST_COLORKEY
|
|
|
|
|
|
SRC_ALPHA
|
|
FIX_ALPHA
|
|
|
|
|
|
Blit->clipper->driver->drv_blit_srcalpha
|
|
Blit->clipper->driver->drv_blit_fixalpha
|
|
|
|
Stretch + srcalpha
|
|
|
|
|
|
Pass1:
|
|
|
|
Wenn STRETCH,ROTATE, geflagged sind,
|
|
dann dimension vom ergebnis gegen maxwert testen.
|
|
|
|
Alles was.z.b breiter als llgfx_displaywidth ist -> ist typ 1
|
|
Alles darunter ist Typ2 und wird gecached
|
|
|
|
if( ! stretchbuffer )
|
|
{
|
|
blittype:
|
|
// rotate: rotate im cache ? -> Pass2
|
|
// zoom: zoom im cache ? -> Pass2
|
|
// rotozoom: rotate + zoom im cache ? -> Pass2
|
|
|
|
drv->Stretch();
|
|
drv->Rotate();
|
|
|
|
// Addcache( gfx, srcrect/frame, zoom/zoom_precision, rotate/rotate_precision );
|
|
}
|
|
else
|
|
{
|
|
drv->roto_zoom mit boundstest -> stretchbuffer
|
|
}
|
|
|
|
|
|
|
|
Pass2:
|
|
Clipper
|
|
drv->CopyBits( BLT_COPY, BLIT_SRC_ALPHA, BLIT_FIX_ALPHA );
|
|
|
|
|
|
|
|
cache * frames[1] = min1 frame
|
|
cache->angle
|
|
cache->zoom_x
|
|
cache->zoom_y
|
|
cache->gfxnum
|
|
|
|
--
|
|
cache wird später eingebaut
|
|
|
|
|
|
|
|
+++++++++
|
|
Clipper
|
|
|
|
|
|
|
|
|
|
|
|
#########
|
|
Blit rotate mit shear
|
|
|
|
|
|
|
|
How about this :
|
|
I have this bitmap :
|
|
|
|
a-----b
|
|
| |
|
|
| |
|
|
| |
|
|
c-----d
|
|
|
|
I want to rotate it with 10 degree.
|
|
|
|
i make an horizontal skew at 10 degree :
|
|
a-----b
|
|
\ \
|
|
->\ \
|
|
\ \
|
|
--> c-----d
|
|
|
|
i make a vertical skew at -10 degree :
|
|
|
|
/\b
|
|
/ \
|
|
/ \
|
|
a/ \d
|
|
\ /
|
|
\ /
|
|
\ /
|
|
c\/
|
|
and that's the bitmap rotated .
|
|
|
|
we only have to calculate (worst case) the cos and sin once per every row and once per every column.
|
|
I think is much faster.
|
|
I will try it today.
|
|
Good bye!http://www.codeguru.com/cpp/g-m/gdi/comments.php/c3693/?thread=7203
|
|
|
|
|
|
|
|
|