Changeset 521 for abuse/trunk
- Timestamp:
- Apr 21, 2011, 9:03:06 PM (12 years ago)
- Location:
- abuse/trunk/src/imlib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/imlib/image.cpp
r519 r521 1447 1447 } 1448 1448 1449 void image::make_color(uint8_t color)1450 {1451 uint8_t *sl;1452 int y, x;1453 Lock();1454 for (y=0; y<m_size.y; y++)1455 {1456 sl=scan_line(y);1457 for (x=m_size.x; x; x--, sl++)1458 if (*sl)1459 *sl=color;1460 }1461 Unlock();1462 } -
abuse/trunk/src/imlib/image.h
r518 r521 200 200 void flip_x(); 201 201 void flip_y(); 202 void make_color(uint8_t color);203 202 uint8_t darkest_color(palette *pal, int16_t noblack = 0); 204 203 }; -
abuse/trunk/src/imlib/timage.cpp
r520 r521 15 15 #include "timage.h" 16 16 17 void trans_image::make_color(int c)18 {19 uint8_t *dp=data;20 int y,x;21 for (y=0; y<h; y++)22 {23 x=0;24 while(x<w)25 {26 x+=*(dp++);27 if (x<w)28 {29 int run=*(dp++);30 memset(dp,c,run);31 x+=run;32 dp+=run;33 }34 }35 }36 }37 38 17 image *trans_image::make_image() 39 18 { -
abuse/trunk/src/imlib/timage.h
r520 r521 56 56 void put_scan_line(image *screen, int x, int y, int line); // always transparent 57 57 unsigned char *t_data() { return data; } 58 void make_color(int c);59 58 int size(); 60 59 image *make_image();
Note: See TracChangeset
for help on using the changeset viewer.