Bläddra i källkod

* 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 år sedan
förälder
incheckning
36da8b05dd
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. +2
    -2
      pipi/pixels.c

+ 2
- 2
pipi/pixels.c Visa fil

@@ -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)


Laddar…
Avbryt
Spara