Browse Source

* Fix broken Imlib2 support in cacaview.

tags/v0.99.beta14
Sam Hocevar sam 18 years ago
parent
commit
d1f55fbe8f
3 changed files with 7 additions and 6 deletions
  1. +1
    -0
      configure.ac
  2. +1
    -1
      src/cacaview.c
  3. +5
    -5
      src/common-image.c

+ 1
- 0
configure.ac View File

@@ -278,6 +278,7 @@ if test "${enable_imlib2}" != "no"; then
if test "${IMLIB2}" = no; then if test "${IMLIB2}" = no; then
AC_MSG_ERROR([[cannot find Imlib2 development files. Without Imlib2, cacaview will only open BMP files; if this is really what you want, re-run configure with '--disable-imlib2'.]]) AC_MSG_ERROR([[cannot find Imlib2 development files. Without Imlib2, cacaview will only open BMP files; if this is really what you want, re-run configure with '--disable-imlib2'.]])
fi fi
AC_DEFINE(USE_IMLIB2, 1, Define to 1 to use Imlib2)
fi fi


# Build development tools? # Build development tools?


+ 1
- 1
src/cacaview.c View File

@@ -334,7 +334,7 @@ int main(int argc, char **argv)
} }
else if(!im) else if(!im)
{ {
#if defined(HAVE_IMLIB2_H)
#if defined(USE_IMLIB2)
# define ERROR_STRING " Error loading `%s'. " # define ERROR_STRING " Error loading `%s'. "
#else #else
# define ERROR_STRING " Error loading `%s'. Only BMP is supported. " # define ERROR_STRING " Error loading `%s'. Only BMP is supported. "


+ 5
- 5
src/common-image.c View File

@@ -20,7 +20,7 @@
# include <stdlib.h> # include <stdlib.h>
#endif #endif


#if defined(HAVE_IMLIB2_H)
#if defined(USE_IMLIB2)
# include <Imlib2.h> # include <Imlib2.h>
#else #else
# if !defined(__KERNEL__) # if !defined(__KERNEL__)
@@ -31,7 +31,7 @@
#include "cucul.h" #include "cucul.h"
#include "common-image.h" #include "common-image.h"


#if !defined(HAVE_IMLIB2_H)
#if !defined(USE_IMLIB2)
static unsigned int u32fread(FILE *); static unsigned int u32fread(FILE *);
static unsigned int u16fread(FILE *); static unsigned int u16fread(FILE *);
static unsigned int u8fread(FILE *); static unsigned int u8fread(FILE *);
@@ -42,7 +42,7 @@ struct image * load_image(char const * name)
struct image * im = malloc(sizeof(struct image)); struct image * im = malloc(sizeof(struct image));
unsigned int depth, bpp, rmask, gmask, bmask, amask; unsigned int depth, bpp, rmask, gmask, bmask, amask;


#if defined(HAVE_IMLIB2_H)
#if defined(USE_IMLIB2)
Imlib_Image image; Imlib_Image image;


/* Load the new image */ /* Load the new image */
@@ -264,7 +264,7 @@ struct image * load_image(char const * name)


void unload_image(struct image * im) void unload_image(struct image * im)
{ {
#if defined(HAVE_IMLIB2_H)
#if defined(USE_IMLIB2)
/* Imlib_Image image = (Imlib_Image)im->priv; */ /* Imlib_Image image = (Imlib_Image)im->priv; */
imlib_free_image(); imlib_free_image();
#else #else
@@ -273,7 +273,7 @@ void unload_image(struct image * im)
cucul_free_dither(im->dither); cucul_free_dither(im->dither);
} }


#if !defined(HAVE_IMLIB2_H)
#if !defined(USE_IMLIB2)
static unsigned int u32fread(FILE *fp) static unsigned int u32fread(FILE *fp)
{ {
unsigned char buffer[4]; unsigned char buffer[4];


Loading…
Cancel
Save