Sfoglia il codice sorgente

* Add "8bit" to the list of supported template flags.

git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2794 92316355-f0b4-4df1-b90c-862c8a59935f
remotes/tiles
sam 16 anni fa
parent
commit
c3c7f2e5e3
2 ha cambiato i file con 32 aggiunte e 5 eliminazioni
  1. +1
    -0
      pipi/pipi_internals.h
  2. +31
    -5
      pipi/pipi_template.h

+ 1
- 0
pipi/pipi_internals.h Vedi File

@@ -21,6 +21,7 @@

#define SET_FLAG_GRAY 0x00000001
#define SET_FLAG_WRAP 0x00000002
#define SET_FLAG_8BIT 0x00000004

/* pipi_image_t: the image structure. This is probably going to be the most
* complex structure in the library, but right now it only has fairly normal


+ 31
- 5
pipi/pipi_template.h Vedi File

@@ -46,20 +46,46 @@
# include __FILE__
# undef FLAG_WRAP

#elif !defined FLAG_8BIT
# if (TEMPLATE_FLAGS) & SET_FLAG_8BIT
# define FLAG_8BIT 1
# include __FILE__
# undef FLAG_8BIT
# endif
# define FLAG_8BIT 0
# include __FILE__
# undef FLAG_8BIT

#else
/* FIXME: I couldn't find a way to do this in one preprocessor pass,
* too many levels of indirection seem to be needed. */
# if FLAG_GRAY
# if FLAG_8BIT
# if FLAG_WRAP
# define SUFFIX(x) x##_gray_wrap
# if FLAG_GRAY
# define SUFFIX(x) x##_gray_wrap_8bit
# else
# define SUFFIX(x) x##_wrap_8bit
# endif
# else
# define SUFFIX(x) x##_gray
# if FLAG_GRAY
# define SUFFIX(x) x##_gray_8bit
# else
# define SUFFIX(x) x##_8bit
# endif
# endif
# else
# if FLAG_WRAP
# define SUFFIX(x) x##_wrap
# if FLAG_GRAY
# define SUFFIX(x) x##_gray_wrap
# else
# define SUFFIX(x) x##_wrap
# endif
# else
# define SUFFIX(x) x
# if FLAG_GRAY
# define SUFFIX(x) x##_gray
# else
# define SUFFIX(x) x
# endif
# endif
# endif
# include TEMPLATE_FILE


Caricamento…
Annulla
Salva