# zlib and libpng configuration flags
LIBFLAGS = -DDYNAMIC_CRC_TABLE -DPNG_NO_CONSOLE_IO \
- -DPNG_NO_MNG_FEATURES -DPNG_NO_FLOATING_POINT_SUPPORTED \
- -DPNG_NO_WRITE_FLUSH -DPNG_NO_WRITE_tIME -DPNG_NO_READ_tIME
+ -FPNG_NO_WRITE_SUPPORTED \
+ -DPNG_NO_MNG_FEATURES \
+ -DPNG_NO_READ_tIME -DPNG_NO_WRITE_tIME
+
+# We need some features in libpng which apparently aren't available in the
+# fixed-point versions. It's OK, because we have to have a non-graphical
+# fallback anyway, just use that on old machines...
+# LIBFLAGS += -DPNG_NO_FLOATING_POINT_SUPPORTED
REQFLAGS = -g -m32 -mregparm=3 -DREGPARM=3 -D__COM32__ -I. -I./sys -I../include
OPTFLAGS = -Os -march=i386 -falign-functions=0 -falign-jumps=0 \
- -falign-labels=0
+ -falign-labels=0 -ffast-math
WARNFLAGS = -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
CFLAGS = -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d $(OPTFLAGS) \
zlib/uncompr.o zlib/deflate.o zlib/trees.o zlib/zutil.o \
zlib/inflate.o zlib/infback.o zlib/inftrees.o zlib/inffast.o \
\
- libpng/png.o libpng/pngset.o libpng/pngrutil.o \
+ libpng/png.o libpng/pngset.o libpng/pngget.o libpng/pngrutil.o \
libpng/pngtrans.o libpng/pngwutil.o libpng/pngread.o \
libpng/pngrio.o libpng/pngwio.o libpng/pngwrite.o \
libpng/pngrtran.o libpng/pngwtran.o libpng/pngmem.o \
- libpng/pngerror.o libpng/pngpread.o
+ libpng/pngerror.o libpng/pngpread.o \
+ \
+ math/pow.o
BINDIR = /usr/bin
LIBDIR = /usr/lib
png_infop end_ptr = NULL;
png_color_16p image_background;
static const png_color_16 my_background = {0,0,0,0,0};
- double gamma;
- const double screen_gamma = 2.2;
png_bytep row_pointers[VIDEO_Y_SIZE];
int passes;
int i;
png_set_bgr(png_ptr);
+ if (info_ptr->bit_depth == 16)
+ png_set_strip_16(png_ptr);
+ else if (info_ptr->bit_depth < 8)
+ png_set_packing(png_ptr);
+
if (png_get_bKGD(png_ptr, info_ptr, &image_background))
png_set_background(png_ptr, image_background,
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
png_set_background(png_ptr, &my_background,
PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0);
-
- if (info_ptr->bit_depth == 16)
- png_set_strip_16(png_ptr);
- else if (info_ptr->bit_depth < 8)
- png_set_packing(png_ptr);
-
- if (png_get_gAMA(png_ptr, info_ptr, &gamma))
- png_set_gamma(png_ptr, screen_gamma, gamma);
- else
- png_set_gamma(png_ptr, screen_gamma, 0.45455);
-
/* Whew! Now we should get the stuff we want... */
for (i = 0; i < info_ptr->height; i++)
row_pointers[i] = (png_bytep *)__vesacon_background[i];