/[paragui]/paragui/src/draw/gradient.cpp
ViewVC logotype

Diff of /paragui/src/draw/gradient.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3.6.6 by braindead, Sat Mar 29 21:30:54 2003 UTC revision 1.3.6.6.2.1 by braindead, Mon Nov 24 09:17:21 2003 UTC
# Line 43  SDL_Surface* PG_Draw::CreateGradient(con Line 43  SDL_Surface* PG_Draw::CreateGradient(con
43                     gradient.colors[3]);                     gradient.colors[3]);
44  }  }
45    
46  SDL_Surface* PG_Draw::CreateGradient(const PG_Rect& r, SDL_Color & ul, SDL_Color & ur, SDL_Color & dl, SDL_Color & dr) {  SDL_Surface* PG_Draw::CreateGradient(const PG_Rect& r, const PG_Color& ul, const PG_Color& ur, const PG_Color& dl, const PG_Color& dr) {
47          SDL_Surface* screen = SDL_GetVideoSurface();          SDL_Surface* screen = SDL_GetVideoSurface();
48    
49          assert(screen);          assert(screen);
# Line 67  void PG_Draw::DrawGradient(SDL_Surface* Line 67  void PG_Draw::DrawGradient(SDL_Surface*
67              gradient.colors[3]);              gradient.colors[3]);
68  }  }
69    
70  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) {  void PG_Draw::DrawGradient(SDL_Surface * surface, const PG_Rect& rect, const PG_Color& ul, const PG_Color& ur, const PG_Color& dl, const PG_Color& dr) {
71          Sint32 v00,v01,v02;          Sint32 v00,v01,v02;
72          Sint32 v10,v11,v12;          Sint32 v10,v11,v12;
73    
# Line 83  void PG_Draw::DrawGradient(SDL_Surface * Line 83  void PG_Draw::DrawGradient(SDL_Surface *
83      if (w > surface->w || h > surface->h)      if (w > surface->w || h > surface->h)
84              return;              return;
85    
86          Uint32 c1 = SDL_MapRGB(surface->format, ul.r, ul.g, ul.b);          Uint32 c1 = ul.MapRGB(surface->format);
87          Uint32 c2 = SDL_MapRGB(surface->format, ur.r, ur.g, ur.b);          Uint32 c2 = ur.MapRGB(surface->format);
88          Uint32 c3 = SDL_MapRGB(surface->format, dl.r, dl.g, dl.b);          Uint32 c3 = dl.MapRGB(surface->format);
89          Uint32 c4 = SDL_MapRGB(surface->format, dr.r, dr.g, dr.b);          Uint32 c4 = dr.MapRGB(surface->format);
90    
91          // solid color gradient ?          // solid color gradient ?
92          if((c1 == c2) && (c2 == c3) && (c3 == c4)) {          if((c1 == c2) && (c2 == c3) && (c3 == c4)) {

Legend:
Removed from v.1.3.6.6  
changed lines
  Added in v.1.3.6.6.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26