Selaa lähdekoodia

* Got rid of very old _cucul_init_dither() function call.

tags/v0.99.beta14
Sam Hocevar sam 19 vuotta sitten
vanhempi
commit
d549d07c0a
3 muutettua tiedostoa jossa 15 lisäystä ja 19 poistoa
  1. +0
    -6
      cucul/cucul.c
  2. +0
    -4
      cucul/cucul_internals.h
  3. +15
    -9
      cucul/dither.c

+ 0
- 6
cucul/cucul.c Näytä tiedosto

@@ -97,9 +97,6 @@ cucul_canvas_t * cucul_create_canvas(unsigned int width, unsigned int height)
return NULL;
}

/* FIXME: this shouldn't happen here */
_cucul_init_dither();

return cv;

nomem:
@@ -200,9 +197,6 @@ int cucul_free_canvas(cucul_canvas_t *cv)
return -1;
}

/* FIXME: this shouldn't be here either (see above) */
_cucul_end_dither();

for(f = 0; f < cv->framecount; f++)
{
free(cv->allchars[f]);


+ 0
- 4
cucul/cucul_internals.h Näytä tiedosto

@@ -45,10 +45,6 @@ struct cucul_buffer
int user_data;
};

/* Bitmap functions */
extern int _cucul_init_dither(void);
extern int _cucul_end_dither(void);

/* Canvas functions */
extern int _cucul_set_canvas_size(cucul_canvas_t *, unsigned int, unsigned int);



+ 15
- 9
cucul/dither.c Näytä tiedosto

@@ -46,6 +46,7 @@
#endif
static unsigned char hsv_distances[LOOKUP_VAL][LOOKUP_SAT][LOOKUP_HUE];
static uint16_t lookup_colors[8];
static int lookup_initialised = 0;

static int const hsv_palette[] =
{
@@ -171,6 +172,7 @@ static float gammapow(float x, float y);

static void get_rgba_default(cucul_dither_t const *, uint8_t *, int, int,
unsigned int *);
static int init_lookup(void);

/* Dithering methods */
static void init_no_dither(int);
@@ -284,6 +286,15 @@ cucul_dither_t *cucul_create_dither(unsigned int bpp, unsigned int w,
return NULL;
}

if(!lookup_initialised)
{
/* XXX: because we do not wish to be thread-safe, there is a slight
* chance that the following code will be executed twice. It is
* totally harmless. */
init_lookup();
lookup_initialised = 1;
}

d->bpp = bpp;
d->has_palette = 0;
d->has_alpha = amask ? 1 : 0;
@@ -1372,8 +1383,10 @@ static void increment_random_dither(void)
return;
}

#if !defined(_DOXYGEN_SKIP_ME)
int _cucul_init_dither(void)
/*
* Lookup tables
*/
static int init_lookup(void)
{
unsigned int v, s, h;

@@ -1431,10 +1444,3 @@ int _cucul_init_dither(void)
return 0;
}

int _cucul_end_dither(void)
{
return 0;
}
#endif /* _DOXYGEN_SKIP_ME */



Ladataan…
Peruuta
Tallenna