Browse Source

* pixels.c: fix a typo in the dithering method that could cause crashes.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2636 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 years ago
parent
commit
36da8b05dd
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      pipi/pixels.c

+ 2
- 2
pipi/pixels.c View File

@@ -135,7 +135,7 @@ pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type)
src[4 * (y * img->w + x + 1) + i] += e * .4375;
if(y < img->h - 1)
{
if(x < img->w - 1)
if(x > 0)
src[4 * ((y + 1) * img->w + x - 1) + i] += e * .1875;
src[4 * ((y + 1) * img->w + x) + i] += e * .3125;
if(x < img->w - 1)
@@ -171,7 +171,7 @@ pipi_pixels_t *pipi_getpixels(pipi_image_t *img, pipi_format_t type)
src[4 * (y * img->w + x + 1) + i] += e * .4375;
if(y < img->h - 1)
{
if(x < img->w - 1)
if(x > 0)
src[4 * ((y + 1) * img->w + x - 1) + i] += e * .1875;
src[4 * ((y + 1) * img->w + x) + i] += e * .3125;
if(x < img->w - 1)


Loading…
Cancel
Save