git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
copy lists, not list identities... should fix saving of non-default values
[enigma2.git]
/
lib
/
gdi
/
gpixmap.cpp
diff --git
a/lib/gdi/gpixmap.cpp
b/lib/gdi/gpixmap.cpp
index dbf53838087fa3dc81b836dd6ceeecc33fb0c773..e44ee0fa4997a67330ba17f4448b01930b91c0a8 100644
(file)
--- a/
lib/gdi/gpixmap.cpp
+++ b/
lib/gdi/gpixmap.cpp
@@
-182,6
+182,7
@@
void gPixmap::blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flag
eRect area=eRect(pos, src.size());
area&=clip.rects[i];
area&=eRect(ePoint(0, 0), size());
eRect area=eRect(pos, src.size());
area&=clip.rects[i];
area&=eRect(ePoint(0, 0), size());
+
if ((area.width()<0) || (area.height()<0))
continue;
if ((area.width()<0) || (area.height()<0))
continue;
@@
-309,7
+310,7
@@
void gPixmap::blit(const gPixmap &src, ePoint pos, const gRegion &clip, int flag
// use duff's device here!
while (width--)
{
// use duff's device here!
while (width--)
{
- if (
!*src
)
+ if (
*src==0x01
)
{
src++;
dst++;
{
src++;
dst++;
@@
-378,7
+379,7
@@
void gPixmap::line(const gRegion &clip, ePoint start, ePoint dst, gColor color)
if (clip.rects.empty())
return;
if (clip.rects.empty())
return;
- __u32 col;
+ __u32 col
= 0
;
if (surface->bpp == 8)
{
srf8 = (__u8*)surface->data;
if (surface->bpp == 8)
{
srf8 = (__u8*)surface->data;
@@
-437,7
+438,7
@@
void gPixmap::line(const gRegion &clip, ePoint start, ePoint dst, gColor color)
do
{
++a;
do
{
++a;
- if (a == clip.rects.size())
+ if (
(unsigned int)
a == clip.rects.size())
a = 0;
if (a == lasthit)
{
a = 0;
if (a == lasthit)
{
@@
-469,6
+470,10
@@
fail:
gColor gPalette::findColor(const gRGB &rgb) const
{
gColor gPalette::findColor(const gRGB &rgb) const
{
+ /* grayscale? */
+ if (!data)
+ return (rgb.r + rgb.g + rgb.b) / 3;
+
int difference=1<<30, best_choice=0;
for (int t=0; t<colors; t++)
{
int difference=1<<30, best_choice=0;
for (int t=0; t<colors; t++)
{