Hello sdl,
screen is 16bpp+ hw/sw surface with doublebuf
i alloc small surface for sprite like this
fsObrazKlatki[ulLicznikKlatek] =
SDL_CreateRGBSurface(SDL_SWSURFACE,
uiSzerokoscKlatki[ulLicznikKlatek],
uiWysokoscKlatki[ulLicznikKlatek],16,0,0,0,0); // tutaj obraz
first, i copy bitmap from buffer
for (a1=0; a1<uiWysokoscKlatki[ulLicznikKlatek]; a1++)
{
for (a2=0,a3=0; a3<uiSzerokoscKlatki[ulLicznikKlatek]; a2+=4,a3++)
{
SDL_pixelRGBA(fsObrazKlatki[ulLicznikKlatek], (short)a3,(short)a1,
ucTempBuffer[ulOffset+(a1*(4*uiSzerokoscKlatki[ulLicznikKlatek]))+a2+2],
ucTempBuffer[ulOffset+(a1*(4*uiSzerokoscKlatki[ulLicznikKlatek]))+a2+1],
ucTempBuffer[ulOffset+(a1*(4*uiSzerokoscKlatki[ulLicznikKlatek]))+a2],
ucTempBuffer[ulOffset+(a1*(4*uiSzerokoscKlatki[ulLicznikKlatek]))+a2+3]);
}
}
i am sure about last alpha value (it is correct).
when i flip to screen i have black pixels when bgra = 0,0,0,0…
fliping method looks like this
SDL_Rect frRectangle;
frRectangle.x=(short)ulXScreen; frRectangle.y=(short)ulYScreen;
frRectangle.w=uiSzerokoscKlatki[ulFrame];
frRectangle.h=uiWysokoscKlatki[ulFrame];
SDL_BlitSurface((SDL_Surface*)fsObrazKlatki[ulFrame],NULL,fsDestination,&frRectangle);
and finally screen init looks like this…
screen = SDL_SetVideoMode(800, 600, 16,
(SDL_SWSURFACE|SDL_ASYNCBLIT|SDL_DOUBLEBUF));
and i have no fuckin’ idea why diz doesn’t work. when using loop
with table and direct pixelRGBA instead of SDL_BlitSurface -
everything goes right way…
i was looking up for some answers in sdl sources but i didn’t find
any blit with alpha surface (ver 1.2.3)…
please help me ;)–
Best regards,
firefox mailto:@palpetine
–
Okresl Swoje potrzeby - my znajdziemy oferte za Ciebie!
[ http://oferty.onet.pl ]