Browse Source

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

tags/v0.99.beta14
Sam Hocevar sam 19 years ago
parent
commit
d549d07c0a
3 changed files with 15 additions and 19 deletions
  1. +0
    -6
      cucul/cucul.c
  2. +0
    -4
      cucul/cucul_internals.h
  3. +15
    -9
      cucul/dither.c

+ 0
- 6
cucul/cucul.c View File

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


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

return cv; return cv;


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


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

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


+ 0
- 4
cucul/cucul_internals.h View File

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


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

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




+ 15
- 9
cucul/dither.c View File

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


static int const hsv_palette[] = 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, static void get_rgba_default(cucul_dither_t const *, uint8_t *, int, int,
unsigned int *); unsigned int *);
static int init_lookup(void);


/* Dithering methods */ /* Dithering methods */
static void init_no_dither(int); static void init_no_dither(int);
@@ -284,6 +286,15 @@ cucul_dither_t *cucul_create_dither(unsigned int bpp, unsigned int w,
return NULL; 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->bpp = bpp;
d->has_palette = 0; d->has_palette = 0;
d->has_alpha = amask ? 1 : 0; d->has_alpha = amask ? 1 : 0;
@@ -1372,8 +1383,10 @@ static void increment_random_dither(void)
return; return;
} }


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


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


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



Loading…
Cancel
Save