[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/draw gradient.cpp,1.3.6.5,1.3.6.6
From: |
Alexander Pipelka <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/draw gradient.cpp,1.3.6.5,1.3.6.6 |
Date: |
Sat, 29 Mar 2003 16:30:56 -0500 |
Update of /cvsroot/paragui/paragui/src/draw
In directory subversions:/tmp/cvs-serv31898/src/draw
Modified Files:
Tag: devel-1-0
gradient.cpp
Log Message:
reverted experimental (by accident) checking (gradient.cpp)
Index: gradient.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/draw/gradient.cpp,v
retrieving revision 1.3.6.5
retrieving revision 1.3.6.6
diff -C2 -r1.3.6.5 -r1.3.6.6
*** gradient.cpp 29 Mar 2003 21:26:40 -0000 1.3.6.5
--- gradient.cpp 29 Mar 2003 21:30:54 -0000 1.3.6.6
***************
*** 68,83 ****
}
- static const Sint32 DitherMatrix4[4][4] = {
- 1/*(0/16.)*256*/, (16./8.)*256, (16./2.)*256, (16./10.)*256,
- (16./12.)*256, (16./4.)*256, (16./14.)*256, (16./6.)*256,
- (16./3.)*256, (16./11.)*256, (16./1.)*256, (16./9.)*256,
- (16./15.)*256, (16./7.)*256, (16./13.)*256, (16./5.)*256
- };
-
- static const float DitherMatrix2[2][2] = {
- 0/16., 8/16.,
- 12/16., 4/16.,
- };
-
void PG_Draw::DrawGradient(SDL_Surface * surface, const PG_Rect& rect, const
SDL_Color & ul, const SDL_Color & ur, const SDL_Color & dl, const SDL_Color &
dr) {
Sint32 v00,v01,v02;
--- 68,71 ----
***************
*** 167,175 ****
register Uint32 pixel = 0;
- Sint32 mx;
- Sint32 my;
- Sint32 conv = ((bpp*8)*256 / 255*256);
- Sint32 rd,gd,bd;
-
for (register Sint32 x = 0; x < drawrect.w; x++) {
--- 155,158 ----
***************
*** 195,209 ****
case 2:
! mx = x & 3;
! my = y & 3;
! //PG_LogMSG("mx: %i, my: %i", mx, my);
! rd = ((r / conv) +
DitherMatrix4[my][mx]) * conv;
! gd = ((g / conv) +
DitherMatrix4[my][mx]) * conv;
! bd = ((b / conv) +
DitherMatrix4[my][mx]) * conv;
! //PG_LogMSG("rd: %i, gd: %i, bd: %i",
rd, gd, bd);
!
! pixel = (rd>>Rloss) << Rshift
! | (gd>>Gloss) <<
Gshift
! | (bd>>Bloss) <<
Bshift;
*((Uint16 *) (bits)) = (Uint16) pixel;
--- 178,184 ----
case 2:
! pixel = (r>>Rloss) << Rshift
! | (g>>Gloss) <<
Gshift
! | (b>>Bloss) <<
Bshift;
*((Uint16 *) (bits)) = (Uint16) pixel;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/draw gradient.cpp,1.3.6.5,1.3.6.6,
Alexander Pipelka <address@hidden> <=