Переглянути джерело

* 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 роки тому
джерело
коміт
c3c7f2e5e3
2 змінених файлів з 32 додано та 5 видалено
  1. +1
    -0
      pipi/pipi_internals.h
  2. +31
    -5
      pipi/pipi_template.h

+ 1
- 0
pipi/pipi_internals.h Переглянути файл

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


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


/* pipi_image_t: the image structure. This is probably going to be the most /* 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 * complex structure in the library, but right now it only has fairly normal


+ 31
- 5
pipi/pipi_template.h Переглянути файл

@@ -46,20 +46,46 @@
# include __FILE__ # include __FILE__
# undef FLAG_WRAP # 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 #else
/* FIXME: I couldn't find a way to do this in one preprocessor pass, /* FIXME: I couldn't find a way to do this in one preprocessor pass,
* too many levels of indirection seem to be needed. */ * too many levels of indirection seem to be needed. */
# if FLAG_GRAY
# if FLAG_8BIT
# if FLAG_WRAP # 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 # else
# define SUFFIX(x) x##_gray
# if FLAG_GRAY
# define SUFFIX(x) x##_gray_8bit
# else
# define SUFFIX(x) x##_8bit
# endif
# endif # endif
# else # else
# if FLAG_WRAP # 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 # else
# define SUFFIX(x) x
# if FLAG_GRAY
# define SUFFIX(x) x##_gray
# else
# define SUFFIX(x) x
# endif
# endif # endif
# endif # endif
# include TEMPLATE_FILE # include TEMPLATE_FILE


Завантаження…
Відмінити
Зберегти