aboutsummaryrefslogtreecommitdiff
path: root/modules/librender
diff options
context:
space:
mode:
Diffstat (limited to 'modules/librender')
-rw-r--r--modules/librender/Makefile697
-rw-r--r--modules/librender/Makefile.am15
-rw-r--r--modules/librender/Makefile.in697
-rw-r--r--modules/librender/g_fade.c164
-rw-r--r--modules/librender/g_fade.h43
-rw-r--r--modules/librender/g_frame.c323
-rw-r--r--modules/librender/g_frame.h54
-rw-r--r--modules/librender/g_instance.c409
-rw-r--r--modules/librender/g_instance.h42
-rw-r--r--modules/librender/g_object.c363
-rw-r--r--modules/librender/g_object.h80
-rw-r--r--modules/librender/g_rects.c207
-rw-r--r--modules/librender/g_rects.h39
-rw-r--r--modules/librender/g_screen.c523
-rw-r--r--modules/librender/g_screen.h36
-rw-r--r--modules/librender/librender.c128
-rw-r--r--modules/librender/librender.h135
-rw-r--r--modules/librender/librender_exports.h155
-rw-r--r--modules/librender/scaler.h39
-rw-r--r--modules/librender/scaler_hq2x.c2675
-rw-r--r--modules/librender/scaler_hq2x.h38
-rw-r--r--modules/librender/scaler_normal.c61
-rw-r--r--modules/librender/scaler_normal.h36
-rw-r--r--modules/librender/scaler_scale2x.c159
-rw-r--r--modules/librender/scaler_scale2x.h36
-rw-r--r--modules/librender/scaler_scanline.c65
-rw-r--r--modules/librender/scaler_scanline.h36
27 files changed, 7255 insertions, 0 deletions
diff --git a/modules/librender/Makefile b/modules/librender/Makefile
new file mode 100644
index 0000000..5f7293b
--- /dev/null
+++ b/modules/librender/Makefile
@@ -0,0 +1,697 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# librender/Makefile. Generated from Makefile.in by configure.
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+
+#AUTOMAKE_OPTIONS = no-dependencies foreign
+
+
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
+pkgdatadir = $(datadir)/bennu
+pkgincludedir = $(includedir)/bennu
+pkglibdir = $(libdir)/bennu
+pkglibexecdir = $(libexecdir)/bennu
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = x86_64-pc-none
+host_triplet = arm-unknown-linux-gnu
+target_triplet = arm-unknown-linux-gnu
+subdir = librender
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(libdir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+librender_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_librender_la_OBJECTS = librender_la-librender.lo \
+ librender_la-g_fade.lo librender_la-g_frame.lo \
+ librender_la-g_instance.lo librender_la-g_object.lo \
+ librender_la-g_rects.lo librender_la-g_screen.lo \
+ librender_la-scaler_hq2x.lo librender_la-scaler_normal.lo \
+ librender_la-scaler_scale2x.lo librender_la-scaler_scanline.lo
+librender_la_OBJECTS = $(am_librender_la_OBJECTS)
+librender_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(librender_la_CFLAGS) \
+ $(CFLAGS) $(librender_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(librender_la_SOURCES)
+DIST_SOURCES = $(librender_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run aclocal-1.12
+AMTAR = $${TAR-tar}
+AR = /opt/miyoo/usr/bin/arm-linux-ar
+AS = as
+AUTOCONF = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run autoconf
+AUTOHEADER = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run autoheader
+AUTOMAKE = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run automake-1.12
+AWK = mawk
+BGD_PATH = /home/steward/Github/miyoo_src/bennugd/modules/../core
+CC = /opt/miyoo/usr/bin/arm-linux-gcc
+CCDEPMODE = depmode=gcc3
+CFLAGS = -DTARGET_MIYOO -mcpu=arm926ej-s -mtune=arm926ej-s -O3 -DARM -D_ARM_ASSEM_ -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL -O2 -finline-functions -fno-strict-aliasing -Wall -DTARGET_LINUX -DUSE_LIBDES -DTARGET_MIYOO -mcpu=arm926ej-s -mtune=arm926ej-s -O3 -DARM -D_ARM_ASSEM_ -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL -I/home/steward/Github/miyoo_src/bennugd/modules/../3rdparty/des-4.04b
+COMMON_CFLAGS = -Wall -DTARGET_LINUX -DUSE_LIBDES -DTARGET_MIYOO -mcpu=arm926ej-s -mtune=arm926ej-s -O3 -DARM -D_ARM_ASSEM_ -I/opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/include/SDL -I/home/steward/Github/miyoo_src/bennugd/modules/../3rdparty/des-4.04b
+COMMON_LDFLAGS = -lc -ldl -D_REENTRANT -L/home/steward/Github/miyoo_src/bennugd/modules/../3rdparty/des-4.04b -ldes
+CPP = /opt/miyoo/usr/bin/arm-linux-gcc -E
+CPPFLAGS =
+CYGPATH_W = echo
+DEFS = -DPACKAGE_NAME=\"bennu\" -DPACKAGE_TARNAME=\"bennu\" -DPACKAGE_VERSION=\"1.0.0\" -DPACKAGE_STRING=\"bennu\ 1.0.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DPACKAGE=\"bennu\" -DVERSION=\"1.0.0\" -DHAVE_LIBM=1
+DEPDIR = .deps
+DESLIBS =
+DLLTOOL = false
+DSYMUTIL =
+DUMPBIN =
+ECHO_C =
+ECHO_N = -n
+ECHO_T =
+EGREP = /bin/grep -E
+EXEEXT =
+FGREP = /bin/grep -F
+GREP = /bin/grep
+INSTALL = /usr/bin/install -c
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_SCRIPT = ${INSTALL}
+INSTALL_STRIP_PROGRAM = $(install_sh) -c -s
+LD = /opt/miyoo/usr/bin/arm-linux-ld
+LDFLAGS = -D_REENTRANT
+LIBOBJS =
+LIBS = -lm
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIPO =
+LN_S = ln -s
+LTLIBOBJS =
+MAINT = #
+MAKEINFO = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/missing --run makeinfo
+MANIFEST_TOOL = :
+MKDIR_P = /bin/mkdir -p
+NM = /opt/miyoo/bin//arm-linux-nm -B
+NMEDIT =
+OBJDUMP = arm-linux-objdump
+OBJEXT = o
+OTOOL =
+OTOOL64 =
+PACKAGE = bennu
+PACKAGE_BUGREPORT =
+PACKAGE_NAME = bennu
+PACKAGE_STRING = bennu 1.0.0
+PACKAGE_TARNAME = bennu
+PACKAGE_URL =
+PACKAGE_VERSION = 1.0.0
+PATH_SEPARATOR = :
+PKG_CONFIG = /usr/bin/pkg-config
+PKG_CONFIG_LIBDIR = /opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/lib/pkgconfig
+PKG_CONFIG_PATH = /opt/miyoo/arm-miyoo-linux-uclibcgnueabi/sysroot/usr/lib/pkgconfig
+PNGLIBS =
+PNG_CFLAGS = -I/usr/include/libpng16
+PNG_LIBS = -lpng16 -lz
+RANLIB = /opt/miyoo/usr/bin/arm-linux-ranlib
+SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
+SDL_LIBS = -lSDL -lpthread
+SDL_mixer_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
+SDL_mixer_LIBS = -lSDL_mixer -lSDL -lpthread
+SED = /bin/sed
+SET_MAKE =
+SHELL = /bin/bash
+STRIP = /opt/miyoo/usr/bin/arm-linux-strip
+VERSION = 1.0.0
+WINDRES =
+X11LIBS = -lX11
+ZLIBS =
+ZLIB_CFLAGS =
+ZLIB_LIBS = -lz
+abs_builddir = /home/steward/Github/miyoo_src/bennugd/modules/librender
+abs_srcdir = /home/steward/Github/miyoo_src/bennugd/modules/librender
+abs_top_builddir = /home/steward/Github/miyoo_src/bennugd/modules
+abs_top_srcdir = /home/steward/Github/miyoo_src/bennugd/modules
+ac_ct_AR =
+ac_ct_CC =
+ac_ct_DUMPBIN =
+am__include = include
+am__leading_dot = .
+am__quote =
+am__tar = $${TAR-tar} chof - "$$tardir"
+am__untar = $${TAR-tar} xf -
+bindir = ${exec_prefix}/bin
+build = x86_64-pc-none
+build_alias = x86_64
+build_cpu = x86_64
+build_os = none
+build_vendor = pc
+builddir = .
+datadir = ${datarootdir}
+datarootdir = ${prefix}/share
+docdir = ${datarootdir}/doc/${PACKAGE_TARNAME}
+dvidir = ${docdir}
+exec_prefix = ${prefix}
+host = arm-unknown-linux-gnu
+host_alias = arm-linux
+host_cpu = arm
+host_os = linux-gnu
+host_vendor = unknown
+htmldir = ${docdir}
+includedir = ${prefix}/include
+infodir = ${datarootdir}/info
+install_sh = ${SHELL} /home/steward/Github/miyoo_src/bennugd/modules/install-sh
+libdir = ${exec_prefix}/lib
+libexecdir = ${exec_prefix}/libexec
+localedir = ${datarootdir}/locale
+localstatedir = ${prefix}/var
+mandir = ${datarootdir}/man
+mkdir_p = /bin/mkdir -p
+oldincludedir = /usr/include
+pdfdir = ${docdir}
+prefix = /opt/miyoo/usr
+program_transform_name = s&^&arm-linux-&
+psdir = ${docdir}
+sbindir = ${exec_prefix}/sbin
+sharedstatedir = ${prefix}/com
+srcdir = .
+sysconfdir = ${prefix}/etc
+target = arm-unknown-linux-gnu
+target_alias = arm-linux
+target_cpu = arm
+target_os = linux-gnu
+target_vendor = unknown
+top_build_prefix = ../
+top_builddir = ..
+top_srcdir = ..
+lib_LTLIBRARIES = librender.la
+librender_la_SOURCES = librender.c g_fade.c g_frame.c g_instance.c g_object.c g_rects.c g_screen.c \
+ scaler_hq2x.c scaler_normal.c scaler_scale2x.c scaler_scanline.c
+
+librender_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include -I$(BGD_PATH)/bgdrtm/include -I. -I../libgrbase/ -I../libvideo/ -I../libblit/ -D__LIBRENDER
+librender_la_LDFLAGS = -s -module -no-undefined -avoid-version
+librender_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm -L../libvideo/.libs -lvideo -L../libblit/.libs -lblit -L../libgrbase/.libs -lgrbase
+CLEANFILES = librender.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu librender/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu librender/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: # $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): # $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+librender.la: $(librender_la_OBJECTS) $(librender_la_DEPENDENCIES) $(EXTRA_librender_la_DEPENDENCIES)
+ $(librender_la_LINK) -rpath $(libdir) $(librender_la_OBJECTS) $(librender_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include ./$(DEPDIR)/librender_la-g_fade.Plo
+include ./$(DEPDIR)/librender_la-g_frame.Plo
+include ./$(DEPDIR)/librender_la-g_instance.Plo
+include ./$(DEPDIR)/librender_la-g_object.Plo
+include ./$(DEPDIR)/librender_la-g_rects.Plo
+include ./$(DEPDIR)/librender_la-g_screen.Plo
+include ./$(DEPDIR)/librender_la-librender.Plo
+include ./$(DEPDIR)/librender_la-scaler_hq2x.Plo
+include ./$(DEPDIR)/librender_la-scaler_normal.Plo
+include ./$(DEPDIR)/librender_la-scaler_scale2x.Plo
+include ./$(DEPDIR)/librender_la-scaler_scanline.Plo
+
+.c.o:
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(COMPILE) -c $<
+
+.c.obj:
+ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+# source='$<' object='$@' libtool=no \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+# source='$<' object='$@' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LTCOMPILE) -c -o $@ $<
+
+librender_la-librender.lo: librender.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-librender.lo -MD -MP -MF $(DEPDIR)/librender_la-librender.Tpo -c -o librender_la-librender.lo `test -f 'librender.c' || echo '$(srcdir)/'`librender.c
+ $(am__mv) $(DEPDIR)/librender_la-librender.Tpo $(DEPDIR)/librender_la-librender.Plo
+# source='librender.c' object='librender_la-librender.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-librender.lo `test -f 'librender.c' || echo '$(srcdir)/'`librender.c
+
+librender_la-g_fade.lo: g_fade.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_fade.lo -MD -MP -MF $(DEPDIR)/librender_la-g_fade.Tpo -c -o librender_la-g_fade.lo `test -f 'g_fade.c' || echo '$(srcdir)/'`g_fade.c
+ $(am__mv) $(DEPDIR)/librender_la-g_fade.Tpo $(DEPDIR)/librender_la-g_fade.Plo
+# source='g_fade.c' object='librender_la-g_fade.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_fade.lo `test -f 'g_fade.c' || echo '$(srcdir)/'`g_fade.c
+
+librender_la-g_frame.lo: g_frame.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_frame.lo -MD -MP -MF $(DEPDIR)/librender_la-g_frame.Tpo -c -o librender_la-g_frame.lo `test -f 'g_frame.c' || echo '$(srcdir)/'`g_frame.c
+ $(am__mv) $(DEPDIR)/librender_la-g_frame.Tpo $(DEPDIR)/librender_la-g_frame.Plo
+# source='g_frame.c' object='librender_la-g_frame.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_frame.lo `test -f 'g_frame.c' || echo '$(srcdir)/'`g_frame.c
+
+librender_la-g_instance.lo: g_instance.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_instance.lo -MD -MP -MF $(DEPDIR)/librender_la-g_instance.Tpo -c -o librender_la-g_instance.lo `test -f 'g_instance.c' || echo '$(srcdir)/'`g_instance.c
+ $(am__mv) $(DEPDIR)/librender_la-g_instance.Tpo $(DEPDIR)/librender_la-g_instance.Plo
+# source='g_instance.c' object='librender_la-g_instance.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_instance.lo `test -f 'g_instance.c' || echo '$(srcdir)/'`g_instance.c
+
+librender_la-g_object.lo: g_object.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_object.lo -MD -MP -MF $(DEPDIR)/librender_la-g_object.Tpo -c -o librender_la-g_object.lo `test -f 'g_object.c' || echo '$(srcdir)/'`g_object.c
+ $(am__mv) $(DEPDIR)/librender_la-g_object.Tpo $(DEPDIR)/librender_la-g_object.Plo
+# source='g_object.c' object='librender_la-g_object.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_object.lo `test -f 'g_object.c' || echo '$(srcdir)/'`g_object.c
+
+librender_la-g_rects.lo: g_rects.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_rects.lo -MD -MP -MF $(DEPDIR)/librender_la-g_rects.Tpo -c -o librender_la-g_rects.lo `test -f 'g_rects.c' || echo '$(srcdir)/'`g_rects.c
+ $(am__mv) $(DEPDIR)/librender_la-g_rects.Tpo $(DEPDIR)/librender_la-g_rects.Plo
+# source='g_rects.c' object='librender_la-g_rects.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_rects.lo `test -f 'g_rects.c' || echo '$(srcdir)/'`g_rects.c
+
+librender_la-g_screen.lo: g_screen.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_screen.lo -MD -MP -MF $(DEPDIR)/librender_la-g_screen.Tpo -c -o librender_la-g_screen.lo `test -f 'g_screen.c' || echo '$(srcdir)/'`g_screen.c
+ $(am__mv) $(DEPDIR)/librender_la-g_screen.Tpo $(DEPDIR)/librender_la-g_screen.Plo
+# source='g_screen.c' object='librender_la-g_screen.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_screen.lo `test -f 'g_screen.c' || echo '$(srcdir)/'`g_screen.c
+
+librender_la-scaler_hq2x.lo: scaler_hq2x.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-scaler_hq2x.lo -MD -MP -MF $(DEPDIR)/librender_la-scaler_hq2x.Tpo -c -o librender_la-scaler_hq2x.lo `test -f 'scaler_hq2x.c' || echo '$(srcdir)/'`scaler_hq2x.c
+ $(am__mv) $(DEPDIR)/librender_la-scaler_hq2x.Tpo $(DEPDIR)/librender_la-scaler_hq2x.Plo
+# source='scaler_hq2x.c' object='librender_la-scaler_hq2x.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-scaler_hq2x.lo `test -f 'scaler_hq2x.c' || echo '$(srcdir)/'`scaler_hq2x.c
+
+librender_la-scaler_normal.lo: scaler_normal.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-scaler_normal.lo -MD -MP -MF $(DEPDIR)/librender_la-scaler_normal.Tpo -c -o librender_la-scaler_normal.lo `test -f 'scaler_normal.c' || echo '$(srcdir)/'`scaler_normal.c
+ $(am__mv) $(DEPDIR)/librender_la-scaler_normal.Tpo $(DEPDIR)/librender_la-scaler_normal.Plo
+# source='scaler_normal.c' object='librender_la-scaler_normal.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-scaler_normal.lo `test -f 'scaler_normal.c' || echo '$(srcdir)/'`scaler_normal.c
+
+librender_la-scaler_scale2x.lo: scaler_scale2x.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-scaler_scale2x.lo -MD -MP -MF $(DEPDIR)/librender_la-scaler_scale2x.Tpo -c -o librender_la-scaler_scale2x.lo `test -f 'scaler_scale2x.c' || echo '$(srcdir)/'`scaler_scale2x.c
+ $(am__mv) $(DEPDIR)/librender_la-scaler_scale2x.Tpo $(DEPDIR)/librender_la-scaler_scale2x.Plo
+# source='scaler_scale2x.c' object='librender_la-scaler_scale2x.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-scaler_scale2x.lo `test -f 'scaler_scale2x.c' || echo '$(srcdir)/'`scaler_scale2x.c
+
+librender_la-scaler_scanline.lo: scaler_scanline.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-scaler_scanline.lo -MD -MP -MF $(DEPDIR)/librender_la-scaler_scanline.Tpo -c -o librender_la-scaler_scanline.lo `test -f 'scaler_scanline.c' || echo '$(srcdir)/'`scaler_scanline.c
+ $(am__mv) $(DEPDIR)/librender_la-scaler_scanline.Tpo $(DEPDIR)/librender_la-scaler_scanline.Plo
+# source='scaler_scanline.c' object='librender_la-scaler_scanline.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-scaler_scanline.lo `test -f 'scaler_scanline.c' || echo '$(srcdir)/'`scaler_scanline.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-libLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/modules/librender/Makefile.am b/modules/librender/Makefile.am
new file mode 100644
index 0000000..e6754f2
--- /dev/null
+++ b/modules/librender/Makefile.am
@@ -0,0 +1,15 @@
+## Process this file with automake to produce Makefile.in
+
+#AUTOMAKE_OPTIONS = no-dependencies foreign
+
+lib_LTLIBRARIES = librender.la
+
+librender_la_SOURCES = librender.c g_fade.c g_frame.c g_instance.c g_object.c g_rects.c g_screen.c \
+ scaler_hq2x.c scaler_normal.c scaler_scale2x.c scaler_scanline.c
+librender_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include -I$(BGD_PATH)/bgdrtm/include -I. -I../libgrbase/ -I../libvideo/ -I../libblit/ -D__LIBRENDER
+librender_la_LDFLAGS = -s -module -no-undefined -avoid-version
+librender_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm -L../libvideo/.libs -lvideo -L../libblit/.libs -lblit -L../libgrbase/.libs -lgrbase
+
+## Make sure these will be cleaned even when they're not built by
+## default.
+CLEANFILES = librender.la
diff --git a/modules/librender/Makefile.in b/modules/librender/Makefile.in
new file mode 100644
index 0000000..f16393e
--- /dev/null
+++ b/modules/librender/Makefile.in
@@ -0,0 +1,697 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2012 Free Software Foundation, Inc.
+
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+#AUTOMAKE_OPTIONS = no-dependencies foreign
+
+VPATH = @srcdir@
+am__make_dryrun = \
+ { \
+ am__dry=no; \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \
+ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+ *) \
+ for am__flg in $$MAKEFLAGS; do \
+ case $$am__flg in \
+ *=*|--*) ;; \
+ *n*) am__dry=yes; break;; \
+ esac; \
+ done;; \
+ esac; \
+ test $$am__dry = yes; \
+ }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = librender
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+ $(top_srcdir)/depcomp
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.in
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+ $(ACLOCAL_M4)
+mkinstalldirs = $(install_sh) -d
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+ for p in $$list; do echo "$$p $$p"; done | \
+ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+ if (++n[$$2] == $(am__install_max)) \
+ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+ END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
+am__installdirs = "$(DESTDIR)$(libdir)"
+LTLIBRARIES = $(lib_LTLIBRARIES)
+am__DEPENDENCIES_1 =
+librender_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
+ $(am__DEPENDENCIES_1)
+am_librender_la_OBJECTS = librender_la-librender.lo \
+ librender_la-g_fade.lo librender_la-g_frame.lo \
+ librender_la-g_instance.lo librender_la-g_object.lo \
+ librender_la-g_rects.lo librender_la-g_screen.lo \
+ librender_la-scaler_hq2x.lo librender_la-scaler_normal.lo \
+ librender_la-scaler_scale2x.lo librender_la-scaler_scanline.lo
+librender_la_OBJECTS = $(am_librender_la_OBJECTS)
+librender_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(librender_la_CFLAGS) \
+ $(CFLAGS) $(librender_la_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I.@am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+ $(LDFLAGS) -o $@
+SOURCES = $(librender_la_SOURCES)
+DIST_SOURCES = $(librender_la_SOURCES)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+BGD_PATH = @BGD_PATH@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+COMMON_CFLAGS = @COMMON_CFLAGS@
+COMMON_LDFLAGS = @COMMON_LDFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DESLIBS = @DESLIBS@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PKG_CONFIG = @PKG_CONFIG@
+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
+PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
+PNGLIBS = @PNGLIBS@
+PNG_CFLAGS = @PNG_CFLAGS@
+PNG_LIBS = @PNG_LIBS@
+RANLIB = @RANLIB@
+SDL_CFLAGS = @SDL_CFLAGS@
+SDL_LIBS = @SDL_LIBS@
+SDL_mixer_CFLAGS = @SDL_mixer_CFLAGS@
+SDL_mixer_LIBS = @SDL_mixer_LIBS@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+VERSION = @VERSION@
+WINDRES = @WINDRES@
+X11LIBS = @X11LIBS@
+ZLIBS = @ZLIBS@
+ZLIB_CFLAGS = @ZLIB_CFLAGS@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+lib_LTLIBRARIES = librender.la
+librender_la_SOURCES = librender.c g_fade.c g_frame.c g_instance.c g_object.c g_rects.c g_screen.c \
+ scaler_hq2x.c scaler_normal.c scaler_scale2x.c scaler_scanline.c
+
+librender_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include -I$(BGD_PATH)/bgdrtm/include -I. -I../libgrbase/ -I../libvideo/ -I../libblit/ -D__LIBRENDER
+librender_la_LDFLAGS = -s -module -no-undefined -avoid-version
+librender_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm -L../libvideo/.libs -lvideo -L../libblit/.libs -lblit -L../libgrbase/.libs -lgrbase
+CLEANFILES = librender.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
+ @for dep in $?; do \
+ case '$(am__configure_deps)' in \
+ *$$dep*) \
+ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+ && { if test -f $@; then exit 0; else break; fi; }; \
+ exit 1;; \
+ esac; \
+ done; \
+ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu librender/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu librender/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+ @case '$?' in \
+ *config.status*) \
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+ *) \
+ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+ esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+ @$(NORMAL_INSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ list2=; for p in $$list; do \
+ if test -f $$p; then \
+ list2="$$list2 $$p"; \
+ else :; fi; \
+ done; \
+ test -z "$$list2" || { \
+ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+ }
+
+uninstall-libLTLIBRARIES:
+ @$(NORMAL_UNINSTALL)
+ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+ for p in $$list; do \
+ $(am__strip_dir) \
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+ done
+
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; \
+ locs=`for p in $$list; do echo $$p; done | \
+ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+ sort -u`; \
+ test -z "$$locs" || { \
+ echo rm -f $${locs}; \
+ rm -f $${locs}; \
+ }
+librender.la: $(librender_la_OBJECTS) $(librender_la_DEPENDENCIES) $(EXTRA_librender_la_DEPENDENCIES)
+ $(librender_la_LINK) -rpath $(libdir) $(librender_la_OBJECTS) $(librender_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-g_fade.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-g_frame.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-g_instance.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-g_object.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-g_rects.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-g_screen.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-librender.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-scaler_hq2x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-scaler_normal.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-scaler_scale2x.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/librender_la-scaler_scanline.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+
+librender_la-librender.lo: librender.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-librender.lo -MD -MP -MF $(DEPDIR)/librender_la-librender.Tpo -c -o librender_la-librender.lo `test -f 'librender.c' || echo '$(srcdir)/'`librender.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-librender.Tpo $(DEPDIR)/librender_la-librender.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='librender.c' object='librender_la-librender.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-librender.lo `test -f 'librender.c' || echo '$(srcdir)/'`librender.c
+
+librender_la-g_fade.lo: g_fade.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_fade.lo -MD -MP -MF $(DEPDIR)/librender_la-g_fade.Tpo -c -o librender_la-g_fade.lo `test -f 'g_fade.c' || echo '$(srcdir)/'`g_fade.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-g_fade.Tpo $(DEPDIR)/librender_la-g_fade.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='g_fade.c' object='librender_la-g_fade.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_fade.lo `test -f 'g_fade.c' || echo '$(srcdir)/'`g_fade.c
+
+librender_la-g_frame.lo: g_frame.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_frame.lo -MD -MP -MF $(DEPDIR)/librender_la-g_frame.Tpo -c -o librender_la-g_frame.lo `test -f 'g_frame.c' || echo '$(srcdir)/'`g_frame.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-g_frame.Tpo $(DEPDIR)/librender_la-g_frame.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='g_frame.c' object='librender_la-g_frame.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_frame.lo `test -f 'g_frame.c' || echo '$(srcdir)/'`g_frame.c
+
+librender_la-g_instance.lo: g_instance.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_instance.lo -MD -MP -MF $(DEPDIR)/librender_la-g_instance.Tpo -c -o librender_la-g_instance.lo `test -f 'g_instance.c' || echo '$(srcdir)/'`g_instance.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-g_instance.Tpo $(DEPDIR)/librender_la-g_instance.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='g_instance.c' object='librender_la-g_instance.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_instance.lo `test -f 'g_instance.c' || echo '$(srcdir)/'`g_instance.c
+
+librender_la-g_object.lo: g_object.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_object.lo -MD -MP -MF $(DEPDIR)/librender_la-g_object.Tpo -c -o librender_la-g_object.lo `test -f 'g_object.c' || echo '$(srcdir)/'`g_object.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-g_object.Tpo $(DEPDIR)/librender_la-g_object.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='g_object.c' object='librender_la-g_object.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_object.lo `test -f 'g_object.c' || echo '$(srcdir)/'`g_object.c
+
+librender_la-g_rects.lo: g_rects.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_rects.lo -MD -MP -MF $(DEPDIR)/librender_la-g_rects.Tpo -c -o librender_la-g_rects.lo `test -f 'g_rects.c' || echo '$(srcdir)/'`g_rects.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-g_rects.Tpo $(DEPDIR)/librender_la-g_rects.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='g_rects.c' object='librender_la-g_rects.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_rects.lo `test -f 'g_rects.c' || echo '$(srcdir)/'`g_rects.c
+
+librender_la-g_screen.lo: g_screen.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-g_screen.lo -MD -MP -MF $(DEPDIR)/librender_la-g_screen.Tpo -c -o librender_la-g_screen.lo `test -f 'g_screen.c' || echo '$(srcdir)/'`g_screen.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-g_screen.Tpo $(DEPDIR)/librender_la-g_screen.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='g_screen.c' object='librender_la-g_screen.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-g_screen.lo `test -f 'g_screen.c' || echo '$(srcdir)/'`g_screen.c
+
+librender_la-scaler_hq2x.lo: scaler_hq2x.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-scaler_hq2x.lo -MD -MP -MF $(DEPDIR)/librender_la-scaler_hq2x.Tpo -c -o librender_la-scaler_hq2x.lo `test -f 'scaler_hq2x.c' || echo '$(srcdir)/'`scaler_hq2x.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-scaler_hq2x.Tpo $(DEPDIR)/librender_la-scaler_hq2x.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scaler_hq2x.c' object='librender_la-scaler_hq2x.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-scaler_hq2x.lo `test -f 'scaler_hq2x.c' || echo '$(srcdir)/'`scaler_hq2x.c
+
+librender_la-scaler_normal.lo: scaler_normal.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-scaler_normal.lo -MD -MP -MF $(DEPDIR)/librender_la-scaler_normal.Tpo -c -o librender_la-scaler_normal.lo `test -f 'scaler_normal.c' || echo '$(srcdir)/'`scaler_normal.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-scaler_normal.Tpo $(DEPDIR)/librender_la-scaler_normal.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scaler_normal.c' object='librender_la-scaler_normal.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-scaler_normal.lo `test -f 'scaler_normal.c' || echo '$(srcdir)/'`scaler_normal.c
+
+librender_la-scaler_scale2x.lo: scaler_scale2x.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-scaler_scale2x.lo -MD -MP -MF $(DEPDIR)/librender_la-scaler_scale2x.Tpo -c -o librender_la-scaler_scale2x.lo `test -f 'scaler_scale2x.c' || echo '$(srcdir)/'`scaler_scale2x.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-scaler_scale2x.Tpo $(DEPDIR)/librender_la-scaler_scale2x.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scaler_scale2x.c' object='librender_la-scaler_scale2x.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-scaler_scale2x.lo `test -f 'scaler_scale2x.c' || echo '$(srcdir)/'`scaler_scale2x.c
+
+librender_la-scaler_scanline.lo: scaler_scanline.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -MT librender_la-scaler_scanline.lo -MD -MP -MF $(DEPDIR)/librender_la-scaler_scanline.Tpo -c -o librender_la-scaler_scanline.lo `test -f 'scaler_scanline.c' || echo '$(srcdir)/'`scaler_scanline.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/librender_la-scaler_scanline.Tpo $(DEPDIR)/librender_la-scaler_scanline.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='scaler_scanline.c' object='librender_la-scaler_scanline.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(librender_la_CFLAGS) $(CFLAGS) -c -o librender_la-scaler_scanline.lo `test -f 'scaler_scanline.c' || echo '$(srcdir)/'`scaler_scanline.c
+
+mostlyclean-libtool:
+ -rm -f *.lo
+
+clean-libtool:
+ -rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ mkid -fID $$unique
+tags: TAGS
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ set x; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ shift; \
+ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ if test $$# -gt 0; then \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ "$$@" $$unique; \
+ else \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$unique; \
+ fi; \
+ fi
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
+ test -z "$(CTAGS_ARGS)$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$unique
+
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && $(am__cd) $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) "$$here"
+
+cscopelist: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS) $(LISP)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
+
+distclean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test -d "$(distdir)/$$file"; then \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+ fi; \
+ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+ else \
+ test -f "$(distdir)/$$file" \
+ || cp -p $$d/$$file "$(distdir)/$$file" \
+ || exit 1; \
+ fi; \
+ done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+ for dir in "$(DESTDIR)$(libdir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
+mostlyclean-generic:
+
+clean-generic:
+ -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+ -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+ mostlyclean-am
+
+distclean: distclean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+ distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-libLTLIBRARIES
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+ -rm -rf ./$(DEPDIR)
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-libLTLIBRARIES
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool cscopelist ctags distclean \
+ distclean-compile distclean-generic distclean-libtool \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am \
+ install-libLTLIBRARIES install-man install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-libLTLIBRARIES
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/modules/librender/g_fade.c b/modules/librender/g_fade.c
new file mode 100644
index 0000000..1fcafbe
--- /dev/null
+++ b/modules/librender/g_fade.c
@@ -0,0 +1,164 @@
+/*
+ * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include <string.h>
+#include <stdlib.h>
+
+#include "librender.h"
+
+/* -------------------------------------------------------------------------- */
+
+SDL_Color vpalette[ 256 ] ;
+
+int fade_inc = 0 ;
+int fade_on = 0 ;
+int fade_set = 0 ;
+int fade_step = 64 ;
+
+SDL_Color fade_from ;
+SDL_Color fade_to ;
+SDL_Color fade_pos = { 100, 100, 100 };
+
+/* -------------------------------------------------------------------------- */
+
+static void activate_vpalette()
+{
+ int n ;
+
+ if ( !screen ) return ;
+
+ if (( sys_pixel_format ) && ( sys_pixel_format->palette ) )
+ {
+ if ( sys_pixel_format->depth > 8 )
+ {
+ for ( n = 0 ; n < 256 ; n++ )
+ sys_pixel_format->palette->colorequiv[ n ] = SDL_MapRGB( screen->format, sys_pixel_format->palette->rgb[ n ].r, sys_pixel_format->palette->rgb[ n ].g, sys_pixel_format->palette->rgb[ n ].b ) ;
+ }
+ else
+ {
+ for ( n = 0 ; n < 256 ; n++ )
+ {
+ if ( fade_pos.r <= 100 )
+ vpalette[ n ].r = sys_pixel_format->palette->rgb[ n ].r * fade_pos.r / 100;
+ else
+ vpalette[ n ].r = sys_pixel_format->palette->rgb[ n ].r + ( 255 - sys_pixel_format->palette->rgb[ n ].r ) * ( fade_pos.r - 100 ) / 100;
+
+ if ( fade_pos.g <= 100 )
+ vpalette[ n ].g = sys_pixel_format->palette->rgb[ n ].g * fade_pos.g / 100;
+ else
+ vpalette[ n ].g = sys_pixel_format->palette->rgb[ n ].g + ( 255 - sys_pixel_format->palette->rgb[ n ].g ) * ( fade_pos.g - 100 ) / 100;
+
+ if ( fade_pos.b <= 100 )
+ vpalette[ n ].b = sys_pixel_format->palette->rgb[ n ].b * fade_pos.b / 100;
+ else
+ vpalette[ n ].b = sys_pixel_format->palette->rgb[ n ].b + ( 255 - sys_pixel_format->palette->rgb[ n ].b ) * ( fade_pos.b - 100 ) / 100;
+ }
+
+ if ( scale_screen )
+ SDL_SetColors( scale_screen, vpalette, 0, 256 ) ;
+ else
+ SDL_SetColors( screen, vpalette, 0, 256 ) ;
+ }
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+
+void gr_fade_init( int r, int g, int b, int speed )
+{
+ if ( fade_pos.r == r && fade_pos.g == g && fade_pos.b == b )
+ {
+ GLODWORD( librender, FADING ) = 0 ;
+ fade_on = 0 ;
+ return ;
+ }
+
+ fade_inc = speed;
+ fade_step = 0;
+ fade_on = 1 ;
+ fade_from = fade_pos;
+ fade_to.r = ( r > 200 ) ? 200 : r ;
+ fade_to.g = ( g > 200 ) ? 200 : g ;
+ fade_to.b = ( b > 200 ) ? 200 : b ;
+
+ GLODWORD( librender, FADING ) = 1 ;
+}
+
+/* -------------------------------------------------------------------------- */
+
+void gr_fade_step()
+{
+ if ( fade_on )
+ {
+ fade_set = 1 ;
+ GLODWORD( librender, FADING ) = 1 ;
+
+ fade_step += fade_inc ;
+ if ( fade_step < 0 )
+ {
+ GLODWORD( librender, FADING ) = 0 ;
+ fade_step = 0 ;
+ fade_on = 0 ;
+ }
+
+ if ( fade_step >= 64 )
+ {
+ GLODWORD( librender, FADING ) = 0 ;
+ fade_step = 64 ;
+ fade_on = 0 ;
+ }
+
+ fade_pos.r = ( fade_to.r * fade_step + fade_from.r * ( 64 - fade_step ) ) / 64;
+ fade_pos.g = ( fade_to.g * fade_step + fade_from.g * ( 64 - fade_step ) ) / 64;
+ fade_pos.b = ( fade_to.b * fade_step + fade_from.b * ( 64 - fade_step ) ) / 64;
+
+ if (
+ ( fade_step + fade_inc < 0 || fade_step + fade_inc > 64 ) &&
+ ( fade_pos.r == 100 && fade_pos.g == 100 && fade_pos.b == 100 ) )
+ {
+ GLODWORD( librender, FADING ) = 0 ;
+ fade_step = 100 ;
+ fade_on = 0;
+ }
+ }
+
+ if ( fade_set )
+ {
+ if ( !fade_on && fade_to.r == 100 && fade_to.g == 100 && fade_to.b == 100 ) fade_set = 0;
+
+ activate_vpalette() ;
+
+ if ( scrbitmap->format->depth > 8 )
+ {
+ gr_fade16( scrbitmap, fade_pos.r, fade_pos.g, fade_pos.b );
+ }
+ }
+}
+
+/* -------------------------------------------------------------------------- */
+
diff --git a/modules/librender/g_fade.h b/modules/librender/g_fade.h
new file mode 100644
index 0000000..6d255c5
--- /dev/null
+++ b/modules/librender/g_fade.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __FADE_H
+#define __FADE_H
+
+#include <SDL.h>
+
+extern int fade_on ; /* ¿Hay un fade activo? */
+extern int fade_set ; /* ¿Hay un fade seteado pero inactivo? */
+extern int fade_step ; /* Si lo hay, posición (0=off) */
+
+extern SDL_Color vpalette[ 256 ] ;
+
+extern void gr_fade_init( int pr, int pg, int pb, int speed ) ;
+extern void gr_fade_step() ;
+
+#endif
diff --git a/modules/librender/g_frame.c b/modules/librender/g_frame.c
new file mode 100644
index 0000000..d84cd87
--- /dev/null
+++ b/modules/librender/g_frame.c
@@ -0,0 +1,323 @@
+/*
+ * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+
+#define FPS_INTIAL_VALUE 25
+#define FPS_INTIAL_SKIP 2
+
+/* --------------------------------------------------------------------------- */
+
+int fps_value = FPS_INTIAL_VALUE ;
+int max_jump = FPS_INTIAL_SKIP ;
+float frame_ms = 1000.0 / FPS_INTIAL_VALUE ; /* 40.0 ; */
+
+uint32_t frame_count = 0 ;
+int last_frame_ticks = 0 ;
+int jump = 0 ;
+
+int FPS_count = 0 ;
+int FPS_init = 0 ;
+
+int FPS_count_sync = 0 ;
+int FPS_init_sync = 0 ;
+
+float ticks_per_frame = 0;
+float fps_partial = 0;
+
+/* --------------------------------------------------------------------------- */
+/* Inicialización y controles de tiempo */
+/* --------------------------------------------------------------------------- */
+
+/*
+ * FUNCTION : gr_set_fps
+ *
+ * Change the game fps and frameskip values
+ *
+ * PARAMS :
+ * fps New number of frames per second
+ * jump New value of maximum frameskip
+ *
+ * RETURN VALUE :
+ * None
+ */
+
+void gr_set_fps( int fps, int skip )
+{
+ if ( fps == fps_value && skip == max_jump ) return ;
+
+ frame_ms = fps ? 1000.0 / ( float ) fps : 0.0 ;
+ max_jump = skip ;
+ fps_value = ( int ) fps;
+
+ FPS_init_sync = FPS_init = 0 ;
+ FPS_count_sync = FPS_count = 0 ;
+
+ jump = 0;
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : gr_wait_frame
+ *
+ * Wait for the next frame start.
+ *
+ * PARAMS :
+ * None
+ *
+ * RETURN VALUE :
+ * None
+ */
+
+void gr_wait_frame()
+{
+ int frame_ticks ;
+
+ frame_count++ ;
+
+ /* -------------- */
+
+ /* Tomo Tick actual */
+#if defined(TARGET_GP2X_WIZ) || defined(TARGET_CAANOO)
+ frame_ticks = bgdrtm_ptimer_get_ticks_us() / 1000L;
+#else
+ frame_ticks = SDL_GetTicks() ;
+#endif
+ if ( !FPS_init_sync )
+ {
+#if defined(TARGET_GP2X_WIZ) || defined(TARGET_CAANOO)
+ FPS_init_sync = FPS_init = bgdrtm_ptimer_get_ticks_us() / 1000L;
+#else
+ FPS_init_sync = FPS_init = SDL_GetTicks() ;
+#endif
+ FPS_count_sync = FPS_count = 0 ;
+ jump = 0;
+
+ /* Tiempo inicial del nuevo frame */
+ last_frame_ticks = frame_ticks ;
+
+ return;
+ }
+
+ /* Tiempo transcurrido total del ejecucion del ultimo frame (Frame time en ms) */
+ * ( float * ) &GLODWORD( librender, FRAME_TIME ) = ( frame_ticks - last_frame_ticks ) / 1000.0f ;
+
+ /* -------------- */
+
+ FPS_count++ ;
+
+ /* -------------- */
+
+ if ( fps_value )
+ {
+ FPS_count_sync++ ;
+
+ ticks_per_frame = ( ( float ) ( frame_ticks - FPS_init_sync ) ) / ( float ) FPS_count_sync ;
+ fps_partial = 1000.0 / ticks_per_frame ;
+
+ if ( fps_partial == fps_value )
+ {
+ FPS_init_sync = frame_ticks ;
+ FPS_count_sync = 0 ;
+ jump = 0;
+ }
+ else if ( fps_partial > fps_value )
+ {
+ int delay = FPS_count_sync * frame_ms - ( frame_ticks - FPS_init_sync ) ;
+
+ if ( delay > 0 )
+ {
+#if defined(TARGET_GP2X_WIZ) || defined(TARGET_CAANOO)
+ {
+ unsigned long ta = bgdrtm_ptimer_get_ticks_us(), te = ta + delay * 1000;
+ if ( ta > te ) while ( bgdrtm_ptimer_get_ticks_us() > te );
+ while ( bgdrtm_ptimer_get_ticks_us() < te );
+ }
+#else
+ SDL_Delay( delay );
+#endif
+ /* Reajust after delay */
+#if defined(TARGET_GP2X_WIZ) || defined(TARGET_CAANOO)
+ frame_ticks = bgdrtm_ptimer_get_ticks_us() / 1000L;
+#else
+ frame_ticks = SDL_GetTicks() ;
+#endif
+ ticks_per_frame = ( ( float ) ( frame_ticks - FPS_init_sync ) ) / ( float ) FPS_count_sync ;
+ fps_partial = 1000.0 / ticks_per_frame ;
+ }
+
+ jump = 0 ;
+ }
+ else
+ {
+ if ( jump < max_jump ) /* Como no me alcanza el tiempo, voy a hacer skip */
+ jump++ ; /* No dibujar el frame */
+ else
+ {
+ FPS_init_sync = frame_ticks ;
+ FPS_count_sync = 0 ;
+ jump = 0 ;
+ }
+ }
+ }
+
+ /* Si paso 1 segundo o mas desde la ultima lectura */
+ if ( frame_ticks - FPS_init >= 1000 )
+ {
+ if ( fps_value )
+ {
+ GLODWORD( librender, SPEED_GAUGE ) = FPS_count /*fps_partial*/ * 100.0 / fps_value ;
+ }
+ else
+ {
+ GLODWORD( librender, SPEED_GAUGE ) = 100 ;
+ }
+
+ GLODWORD( librender, FPS ) = FPS_count ;
+
+ FPS_init = frame_ticks ;
+ FPS_count = 0 ;
+ }
+
+ /* Tiempo inicial del nuevo frame */
+ last_frame_ticks = frame_ticks ;
+}
+
+/* --------------------------------------------------------------------------- */
+
+static SDL_Color palette[256];
+
+void gr_refresh_palette()
+{
+ int n ;
+
+ if ( sys_pixel_format->depth > 8 )
+ {
+ if ( sys_pixel_format->palette )
+ {
+ for ( n = 0 ; n < 256 ; n++ )
+ {
+ sys_pixel_format->palette->colorequiv[ n ] = _rgb(
+ sys_pixel_format,
+ sys_pixel_format->palette->rgb[ n ].r,
+ sys_pixel_format->palette->rgb[ n ].g,
+ sys_pixel_format->palette->rgb[ n ].b
+ ) ;
+ }
+ }
+ }
+ else if ( sys_pixel_format->depth == 8 )
+ {
+ if ( sys_pixel_format->palette )
+ {
+ for ( n = 0 ; n < 256 ; n++ )
+ {
+ palette[ n ].r = sys_pixel_format->palette->rgb[ n ].r;
+ palette[ n ].g = sys_pixel_format->palette->rgb[ n ].g;
+ palette[ n ].b = sys_pixel_format->palette->rgb[ n ].b;
+ }
+ }
+ else
+ {
+ uint8_t * pal = default_palette;
+ for ( n = 0 ; n < 256 ; n++ )
+ {
+ palette[ n ].r = *pal++;
+ palette[ n ].g = *pal++;
+ palette[ n ].b = *pal++;
+ }
+ }
+ if ( scale_screen )
+ SDL_SetColors( scale_screen, palette, 0, 256 ) ;
+ else
+ SDL_SetColors( screen, palette, 0, 256 ) ;
+ }
+
+ palette_changed = 0;
+ trans_table_updated = 0 ;
+}
+
+/* --------------------------------------------------------------------------- */
+
+void gr_draw_frame()
+{
+ if ( jump ) return ;
+
+ /* Actualiza paleta */
+
+ if ( palette_changed ) gr_refresh_palette();
+
+ if ( !trans_table_updated ) gr_make_trans_table();
+
+ /* Bloquea el bitmap de pantalla */
+
+ if ( gr_lock_screen() < 0 ) return ;
+
+ /* Dibuja la pantalla */
+
+ gr_draw_screen( scrbitmap, GLODWORD( librender, RESTORETYPE ), GLODWORD( librender, DUMPTYPE ) );
+
+ /* Fading */
+
+ if ( fade_on || fade_set )
+ {
+ gr_fade_step() ;
+ if ( background ) background->modified = 1 ;
+ }
+
+ /* Actualiza la paleta y la pantalla */
+
+ gr_unlock_screen() ;
+
+}
+
+/* --------------------------------------------------------------------------- */
+
+void __bgdexport( librender, module_initialize )()
+{
+#ifndef TARGET_DINGUX_A320
+ if ( !SDL_WasInit( SDL_INIT_TIMER ) ) SDL_InitSubSystem( SDL_INIT_TIMER );
+#endif
+}
+
+/* --------------------------------------------------------------------------- */
+
+void __bgdexport( librender, module_finalize )()
+{
+#ifndef TARGET_DINGUX_A320
+ if ( SDL_WasInit( SDL_INIT_TIMER ) ) SDL_QuitSubSystem( SDL_INIT_TIMER );
+#endif
+}
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/librender/g_frame.h b/modules/librender/g_frame.h
new file mode 100644
index 0000000..df65b95
--- /dev/null
+++ b/modules/librender/g_frame.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __FRAME_H
+#define __FRAME_H
+
+/* --------------------------------------------------------------------------- */
+
+extern uint32_t frame_count ;
+extern int last_frame_ticks ;
+extern int next_frame_ticks ;
+extern float frame_ms ;
+extern int max_jump ;
+extern int current_jump ;
+extern int jump ;
+extern int FPS_count ;
+extern int FPS_init ;
+
+/* --------------------------------------------------------------------------- */
+
+extern void gr_set_fps( int fps, int jump );
+extern void gr_wait_frame();
+extern void gr_draw_frame();
+
+extern void gr_refresh_palette();
+
+/* --------------------------------------------------------------------------- */
+
+#endif
diff --git a/modules/librender/g_instance.c b/modules/librender/g_instance.c
new file mode 100644
index 0000000..62c1635
--- /dev/null
+++ b/modules/librender/g_instance.c
@@ -0,0 +1,409 @@
+/*
+ * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* --------------------------------------------------------------------------- */
+
+#ifdef __GNUC__
+#define _inline inline
+#endif
+
+/* --------------------------------------------------------------------------- */
+
+#include "librender.h"
+#include "resolution.h"
+
+#include "sysprocs_st.h"
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : instance_graph
+ *
+ * Returns the instance graphic or NULL if there is none
+ *
+ * PARAMS :
+ * i Pointer to the instance
+ *
+ * RETURN VALUE :
+ * Pointer to the graphic or NULL if none
+ */
+
+GRAPH * instance_graph( INSTANCE * i )
+{
+ int * xgraph, c, a ;
+
+ if (( xgraph = ( int * ) LOCDWORD( librender, i, XGRAPH ) ) ) // Get offset of XGRAPH table
+ {
+ c = *xgraph++; // Get number of graphs ids in XGRAPH table
+ if ( c )
+ {
+ // Normalize ANGLE
+ a = LOCINT32( librender, i, ANGLE ) % 360000 ;
+ if ( a < 0 ) a += 360000 ;
+
+ // Get graph id in XGRAPH table to draw
+ c = xgraph[a * c / 360000] ;
+
+ // If graph id value is negative, then graphic must be mirrored
+ if ( c < 0 )
+ {
+ c = -c;
+ LOCDWORD( librender, i, XGRAPH_FLAGS ) = B_HMIRROR;
+ }
+ else
+ {
+ LOCDWORD( librender, i, XGRAPH_FLAGS ) = 0;
+ }
+
+ // Get GRAPH * to draw
+ return bitmap_get( LOCDWORD( librender, i, FILEID ), c ) ;
+ }
+ }
+
+ // Get GRAPH * to draw
+ if (( c = LOCDWORD( librender, i, GRAPHID ) ) )
+ {
+ return bitmap_get( LOCDWORD( librender, i, FILEID ), c ) ;
+ }
+
+ return 0 ; // No graph to draw
+}
+
+void instance_get_bbox( INSTANCE * i, GRAPH * gr, REGION * dest )
+{
+ REGION *region;
+ int x, y, r ;
+ int scalex, scaley ;
+
+ r = LOCINT32( librender, i, REGIONID ) ;
+ if ( r > 0 && r < 32 )
+ region = &regions[ r ] ;
+ else
+ region = &regions[ 0 ];
+
+ x = LOCINT32( librender, i, COORDX ) ;
+ y = LOCINT32( librender, i, COORDY ) ;
+
+ RESOLXY( librender, i, x, y );
+
+ scalex = LOCINT32( librender, i, GRAPHSIZEX );
+ scaley = LOCINT32( librender, i, GRAPHSIZEY );
+
+ if ( scalex == 100 && scaley == 100 ) scalex = scaley = LOCINT32( librender, i, GRAPHSIZE );
+
+ gr_get_bbox( dest,
+ region,
+ x,
+ y,
+ LOCDWORD( librender, i, FLAGS ) ^ LOCDWORD( librender, i, XGRAPH_FLAGS ),
+ LOCDWORD( librender, i, XGRAPH ) ? 0 : LOCINT32( librender, i, ANGLE ),
+ scalex,
+ scaley,
+ gr
+ ) ;
+}
+
+/* ---------------------------------------------------------------------- */
+
+void draw_instance_at( INSTANCE * i, REGION * region, int x, int y, GRAPH * dest )
+{
+ GRAPH * map ;
+ int16_t * blend_table = NULL ;
+ int flags ;
+ int scalex, scaley ;
+ int alpha ;
+ int blendop;
+ PALETTE * palette = NULL;
+ int paletteid;
+
+ map = instance_graph( i ) ;
+ if ( !map ) return ;
+
+ flags = ( LOCDWORD( librender, i, FLAGS ) ^ LOCDWORD( librender, i, XGRAPH_FLAGS ) );
+
+ if (( alpha = LOCDWORD( librender, i, ALPHA ) ) != 255 )
+ {
+ if ( alpha <= 0 ) return ;
+ else if ( alpha < 255 )
+ flags |= B_ALPHA | ( alpha << B_ALPHA_SHIFT );
+ }
+
+ scalex = LOCINT32( librender, i, GRAPHSIZEX );
+ scaley = LOCINT32( librender, i, GRAPHSIZEY );
+ if ( scalex == 100 && scaley == 100 ) scalex = scaley = LOCINT32( librender, i, GRAPHSIZE );
+
+ if (( blendop = LOCDWORD( librender, i, BLENDOP ) ) )
+ {
+ blend_table = map->blend_table;
+ map->blend_table = ( int16_t * ) blendop;
+ }
+
+ if (( paletteid = LOCDWORD( librender, i, PALETTEID ) ) )
+ {
+ palette = map->format->palette ;
+ map->format->palette = ( PALETTE * ) paletteid;
+ }
+
+ /* XGRAPH does not rotate destination graphic.
+ WARNING: don't remove "scalex != 100 || scaley != 100 ||" from begin the next condition */
+ if ( scalex != 100 || scaley != 100 || ( LOCINT32( librender, i, ANGLE ) && !LOCDWORD( librender, i, XGRAPH ) ) )
+ gr_rotated_blit( dest, region, x, y, flags, LOCDWORD( librender, i, XGRAPH ) ? 0 : LOCINT32( librender, i, ANGLE ), scalex, scaley, map ) ;
+ else
+ gr_blit( dest, region, x, y, flags, map ) ;
+
+ if ( paletteid ) map->format->palette = palette;
+ if ( blendop ) map->blend_table = blend_table;
+
+}
+
+/* --------------------------------------------------------------------------- */
+/* Rutinas gráficas de alto nivel */
+
+void draw_instance( INSTANCE * i, REGION * clip )
+{
+ GRAPH * map ;
+ int16_t * blend_table = NULL ;
+ int flags;
+ int scalex, scaley;
+ REGION region;
+ int alpha ;
+ int blendop = 0 ;
+ PALETTE * palette = NULL ;
+ int paletteid;
+
+ /* Difference with draw_instance_at from here */
+ int x, y, r ;
+ /* Difference with draw_instance_at to here */
+
+// map = instance_graph( i ) ;
+ map = ( GRAPH * ) LOCDWORD( librender, i, GRAPHPTR );
+ if ( !map ) return ;
+
+ flags = ( LOCDWORD( librender, i, FLAGS ) ^ LOCDWORD( librender, i, XGRAPH_FLAGS ) );
+
+ if (( alpha = LOCDWORD( librender, i, ALPHA ) ) != 255 )
+ {
+ if ( alpha <= 0 ) return ;
+ else if ( alpha < 255 )
+ flags |= B_ALPHA | ( alpha << B_ALPHA_SHIFT );
+ }
+
+ scalex = LOCINT32( librender, i, GRAPHSIZEX );
+ scaley = LOCINT32( librender, i, GRAPHSIZEY );
+ if ( scalex == 100 && scaley == 100 ) scalex = scaley = LOCINT32( librender, i, GRAPHSIZE );
+
+ if (( blendop = LOCDWORD( librender, i, BLENDOP ) ) )
+ {
+ blend_table = map->blend_table;
+ map->blend_table = ( int16_t * ) blendop;
+ }
+
+ if (( paletteid = LOCDWORD( librender, i, PALETTEID ) ) )
+ {
+ palette = map->format->palette ;
+ map->format->palette = ( PALETTE * ) paletteid;
+ }
+
+ /* Difference with draw_instance_at from here */
+
+ x = LOCINT32( librender, i, COORDX ) ;
+ y = LOCINT32( librender, i, COORDY ) ;
+
+ RESOLXY( librender, i, x, y );
+
+ r = LOCINT32( librender, i, REGIONID ) ;
+ if ( r > 0 && r < 32 )
+ region = regions[ r ] ;
+ else
+ region = regions[ 0 ];
+
+ if ( clip ) region_union( &region, clip );
+ /* Difference with draw_instance_at to here */
+
+ /* XGRAPH does not rotate destination graphic.
+ WARNING: don't remove "scalex != 100 || scaley != 100 ||" from begin the next condition */
+ if ( scalex != 100 || scaley != 100 || ( LOCINT32( librender, i, ANGLE ) && !LOCDWORD( librender, i, XGRAPH ) ) )
+ gr_rotated_blit( 0, &region, x, y, flags, LOCDWORD( librender, i, XGRAPH ) ? 0 : LOCINT32( librender, i, ANGLE ), scalex, scaley, map ) ;
+ else
+ gr_blit( 0, &region, x, y, flags, map ) ;
+
+ if ( paletteid ) map->format->palette = palette;
+ if ( blendop ) map->blend_table = blend_table;
+
+ if ( map->modified ) map->modified = 0;
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : draw_instance_info
+ *
+ * Compares the internal position variables of the instance with its
+ * currents values, and returns 1 if there is any difference. Used
+ * to detect changes in a visible process's aspect or position.
+ *
+ * PARAMS :
+ * i Pointer to the instance
+ *
+ * RETURN VALUE :
+ * 1 if there is any change, 0 otherwise
+ */
+
+int draw_instance_info( INSTANCE * i, REGION * region, int * z, int * drawme )
+{
+ GRAPH * graph;
+
+ * drawme = 0;
+
+ LOCDWORD( librender, i, GRAPHPTR ) = ( int )( graph = instance_graph( i ) );
+ if ( !graph )
+ {
+ /*
+ region->x = -2; region->y = -2;
+ region->x2 = -2; region->y2 = -2;
+ */
+ return 0;
+ }
+
+ int changed;
+ int status;
+ int coordz, coordx, coordy;
+
+ status = ( LOCDWORD( librender, i, STATUS ) & ~STATUS_WAITING_MASK ) ;
+
+ coordz = LOCINT32( librender, i, COORDZ );
+
+ /* Si tiene grafico o xgraph o (ctype == 0 y esta corriendo o congelado) */
+
+ if ( LOCDWORD( librender, i, CTYPE ) == C_SCREEN && ( status == STATUS_RUNNING || status == STATUS_FROZEN ) )
+ * drawme = 1;
+
+
+ coordx = LOCINT32( librender, i, COORDX );
+ coordy = LOCINT32( librender, i, COORDY );
+
+ RESOLXY( librender, i, coordx, coordy );
+
+ changed =
+ graph->modified ||
+ LOCINT32( librender, i, SAVED_COORDX ) != coordx ||
+ LOCINT32( librender, i, SAVED_COORDY ) != coordy ||
+ LOCINT32( librender, i, SAVED_COORDZ ) != coordz ||
+ LOCDWORD( librender, i, SAVED_GRAPHID ) != LOCDWORD( librender, i, GRAPHID ) ||
+ LOCINT32( librender, i, SAVED_ANGLE ) != LOCINT32( librender, i, ANGLE ) ||
+ LOCDWORD( librender, i, SAVED_ALPHA ) != LOCDWORD( librender, i, ALPHA ) ||
+ LOCDWORD( librender, i, SAVED_BLENDOP ) != LOCDWORD( librender, i, BLENDOP ) ||
+ LOCINT32( librender, i, SAVED_GRAPHSIZE ) != LOCINT32( librender, i, GRAPHSIZE ) ||
+ LOCINT32( librender, i, SAVED_GRAPHSIZEX ) != LOCINT32( librender, i, GRAPHSIZEX ) ||
+ LOCINT32( librender, i, SAVED_GRAPHSIZEY ) != LOCINT32( librender, i, GRAPHSIZEY ) ||
+ LOCDWORD( librender, i, SAVED_FLAGS ) != LOCDWORD( librender, i, FLAGS ) ||
+ LOCDWORD( librender, i, SAVED_FILEID ) != LOCDWORD( librender, i, FILEID ) ||
+ LOCDWORD( librender, i, SAVED_XGRAPH ) != LOCDWORD( librender, i, XGRAPH ) ||
+ (
+ graph->ncpoints &&
+ (
+ LOCDWORD( librender, i, SAVED_CENTERX ) != graph->cpoints[0].x ||
+ LOCDWORD( librender, i, SAVED_CENTERY ) != graph->cpoints[0].y
+ )
+ )
+ ;
+
+ if ( changed )
+ {
+ /* Update key */
+
+ * z = coordz;
+
+ LOCINT32( librender, i, SAVED_COORDX ) = coordx;
+ LOCINT32( librender, i, SAVED_COORDY ) = coordy;
+ LOCINT32( librender, i, SAVED_COORDZ ) = coordz;
+ LOCDWORD( librender, i, SAVED_GRAPHID ) = LOCDWORD( librender, i, GRAPHID );
+ LOCINT32( librender, i, SAVED_ANGLE ) = LOCINT32( librender, i, ANGLE );
+ LOCDWORD( librender, i, SAVED_ALPHA ) = LOCDWORD( librender, i, ALPHA );
+ LOCDWORD( librender, i, SAVED_BLENDOP ) = LOCDWORD( librender, i, BLENDOP );
+ LOCINT32( librender, i, SAVED_GRAPHSIZE ) = LOCINT32( librender, i, GRAPHSIZE );
+ LOCINT32( librender, i, SAVED_GRAPHSIZEX ) = LOCINT32( librender, i, GRAPHSIZEX );
+ LOCINT32( librender, i, SAVED_GRAPHSIZEY ) = LOCINT32( librender, i, GRAPHSIZEY );
+ LOCDWORD( librender, i, SAVED_FLAGS ) = LOCDWORD( librender, i, FLAGS );
+ LOCDWORD( librender, i, SAVED_FILEID ) = LOCDWORD( librender, i, FILEID );
+ LOCDWORD( librender, i, SAVED_XGRAPH ) = LOCDWORD( librender, i, XGRAPH );
+ if ( graph->ncpoints )
+ {
+ LOCDWORD( librender, i, SAVED_CENTERX ) = graph->cpoints[0].x;
+ LOCDWORD( librender, i, SAVED_CENTERY ) = graph->cpoints[0].y;
+ }
+ else
+ {
+ LOCDWORD( librender, i, SAVED_CENTERX ) = CPOINT_UNDEFINED;
+ LOCDWORD( librender, i, SAVED_CENTERY ) = CPOINT_UNDEFINED;
+ }
+
+ instance_get_bbox( i, graph, region );
+ return 1;
+ }
+
+ return changed;
+}
+
+
+/* ----------------------------------------------------------------------
+ Dlls Hooks
+ ---------------------------------------------------------------------- */
+
+/*
+ * FUNCTION : instance_create_hook
+ *
+ * PARAMS :
+ * r Pointer to the instance
+ *
+ * RETURN VALUE :
+ * None
+ */
+
+void __bgdexport( librender, instance_create_hook )( INSTANCE * r )
+{
+ /* COORZ is 0 when a new instance is created */
+ LOCDWORD( librender, r, OBJECTID ) = gr_new_object( /* LOCINT32( librender, r, COORDZ ) */ 0, draw_instance_info, draw_instance, r );
+}
+
+/*
+ * FUNCTION : instance_destroy_hook
+ *
+ * PARAMS :
+ * r Pointer to the instance
+ *
+ * RETURN VALUE :
+ * None
+ */
+
+void __bgdexport( librender, instance_destroy_hook )( INSTANCE * r )
+{
+ if ( LOCDWORD( librender, r, OBJECTID ) ) gr_destroy_object( LOCDWORD( librender, r, OBJECTID ) );
+}
diff --git a/modules/librender/g_instance.h b/modules/librender/g_instance.h
new file mode 100644
index 0000000..7b84535
--- /dev/null
+++ b/modules/librender/g_instance.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __G_INSTANCE_H
+#define __G_INSTANCE_H
+
+#include <bgddl.h>
+#include <g_bitmap.h>
+
+extern void instance_get_bbox( INSTANCE * i, GRAPH * gr, REGION * dest );
+extern void draw_instance_at( INSTANCE * i, REGION * r, int x, int y, GRAPH * dest ) ;
+extern void draw_instance( INSTANCE * i, REGION * clip ) ;
+extern void instance_update_bbox( INSTANCE * i ) ;
+extern GRAPH * instance_graph( INSTANCE * i ) ;
+extern int instance_visible( INSTANCE * i );
+
+#endif
diff --git a/modules/librender/g_object.c b/modules/librender/g_object.c
new file mode 100644
index 0000000..63dcb16
--- /dev/null
+++ b/modules/librender/g_object.c
@@ -0,0 +1,363 @@
+/*
+ * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include <stdlib.h>
+#include <string.h>
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+
+static int sequencer = 0;
+
+CONTAINER * sorted_object_list = NULL;
+
+/* --------------------------------------------------------------------------- */
+
+CONTAINER * search_container( int key )
+{
+ CONTAINER * ctr = NULL;
+
+ if ( !sorted_object_list ) return NULL;
+
+ for ( ctr = sorted_object_list; ctr && ctr->key > key; ctr = ctr->next );
+
+ if ( ctr && ctr->key == key ) return ctr;
+
+ return NULL;
+}
+
+/* --------------------------------------------------------------------------- */
+
+CONTAINER * get_container( int key )
+{
+ CONTAINER * ctr = NULL, * prev_ctr = NULL, * new_ctr = NULL;
+
+ if ( sorted_object_list )
+ {
+ for ( ctr = sorted_object_list; ctr && ctr->key > key; ctr = ctr->next )
+ {
+ prev_ctr = ctr;
+ }
+ if ( ctr && ctr->key == key ) return ctr;
+ }
+
+ new_ctr = ( CONTAINER * ) malloc( sizeof( CONTAINER ) );
+ if ( !new_ctr ) return NULL;
+
+ new_ctr->key = key;
+ new_ctr->first_in_key = NULL;
+
+ if ( ctr == sorted_object_list )
+ {
+ if ( !sorted_object_list )
+ {
+ /* Only happen "!sorted_object_list" when "ctr == sorted_object_list" (NULL) */
+ sorted_object_list = new_ctr;
+ new_ctr->next = NULL;
+ new_ctr->prev = NULL;
+
+ return new_ctr;
+ }
+
+ sorted_object_list = new_ctr;
+ }
+
+ if ( ctr )
+ {
+ new_ctr->next = ctr;
+ new_ctr->prev = ctr->prev;
+ if ( ctr->prev ) ctr->prev->next = new_ctr;
+ ctr->prev = new_ctr;
+ }
+ else
+ {
+ // prev_ctr implicit exist
+ new_ctr->next = NULL;
+ new_ctr->prev = prev_ctr;
+ prev_ctr->next = new_ctr;
+ }
+
+ return new_ctr;
+}
+
+/* --------------------------------------------------------------------------- */
+
+void destroy_container( CONTAINER * ctr )
+{
+ if ( ctr->next ) ctr->next->prev = ctr->prev;
+ if ( ctr->prev ) ctr->prev->next = ctr->next;
+ if ( ctr == sorted_object_list ) sorted_object_list = ctr->next ;
+
+ free( ctr );
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : gr_new_object
+ *
+ * Register a visible object with a Z coordinate to be drawn
+ * by an user-defined function.
+ *
+ * If your DLL does some screen operations, you should register
+ * a draw-type hook or an object. Any access to the screen
+ * surface outside those are invalid.
+ *
+ * PARAMS :
+ * z Z value of the object to be drawn
+ * info Pointer to the object information function
+ * (fills bounding box, returns 1 if changed since last frame)
+ * draw Pointer to the object drawing function
+ * what User-defined parameter that will be passed to "draw"
+ *
+ * RETURN VALUE :
+ * An integer ID that uniquely identifies the object,
+ * or 0 if not enough memory
+ */
+
+int gr_new_object( int z, OBJ_INFO * info, OBJ_DRAW * draw, void * what )
+{
+ CONTAINER * ctr ;
+ OBJECT * object = ( OBJECT * ) malloc( sizeof( OBJECT ) );
+
+ if ( !object ) return 0;
+
+ ctr = get_container( z );
+ if ( !ctr )
+ {
+ free( object );
+ return 0;
+ }
+
+ object->z = z;
+ object->info = info;
+ object->draw = draw;
+ object->what = what;
+ object->ready = 0;
+ object->bbox.x = -2;
+ object->bbox.y = -2;
+ object->bbox.x2 = -2;
+ object->bbox.y2 = -2;
+ object->bbox_saved.x = -2;
+ object->bbox_saved.y = -2;
+ object->bbox_saved.x2 = -2;
+ object->bbox_saved.y2 = -2;
+ object->seq = 0;
+ object->prev = NULL;
+
+ if ( ctr->first_in_key )
+ {
+ ctr->first_in_key->prev = object;
+ object->next = ctr->first_in_key;
+ }
+ else
+ {
+ object->next = NULL;
+ }
+
+ ctr->first_in_key = object;
+
+ return ( int ) object;
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : gr_destroy_object
+ *
+ * Unregister and remove a given object created by gr_new_object from memory
+ *
+ * PARAMS :
+ * id ID returned by gr_new_object
+ *
+ * RETURN VALUE :
+ * None
+ */
+
+void gr_destroy_object( int id )
+{
+ CONTAINER * ctr ;
+ OBJECT * object = ( OBJECT * ) id ;
+
+ if ( !object ) return ;
+
+ ctr = search_container( object->z );
+ if ( !ctr ) return;
+
+ if ( object->next ) object->next->prev = object->prev;
+ if ( object->prev ) object->prev->next = object->next;
+ if ( object == ctr->first_in_key ) ctr->first_in_key = object->next;
+ if ( !ctr->first_in_key ) destroy_container( ctr );
+
+ /* Rects */
+ if ( object->bbox.x >= 0 || object->bbox.y >= 0 || object->bbox.x2 >= 0 || object->bbox.y2 >= 0 )
+ gr_mark_rect( object->bbox.x, object->bbox.y, object->bbox.x2 - object->bbox.x + 1, object->bbox.y2 - object->bbox.y + 1 );
+
+ free( object );
+}
+
+/* --------------------------------------------------------------------------- */
+
+void gr_update_objects_mark_rects( int restore, int dump )
+{
+ CONTAINER * ctr = NULL, * next_ctr, * fix_ctr;
+ OBJECT * object, * next_object ;
+ int ready, key;
+
+ if ( !sorted_object_list ) return ;
+
+ sequencer++;
+
+ next_ctr = sorted_object_list;
+ while (( ctr = next_ctr ) )
+ {
+ /* Get Next Container */
+ next_ctr = ctr->next ;
+
+ key = ctr->key;
+
+ next_object = ctr->first_in_key;
+ while (( object = next_object ) )
+ {
+ next_object = object->next ;
+
+ if ( object->seq != sequencer )
+ {
+ /* Mark object as already proceed */
+ object->seq = sequencer;
+
+ /* Update key & get_info */
+ ready = object->ready;
+
+ /* NOTE: Returned bbox must be ordered !!! */
+ object->changed = ( *object->info )( object->what, &object->bbox, &object->z, &object->ready );
+
+ /* Move to correct container */
+ if ( object->z != key )
+ {
+ /* Remove from list */
+ if ( object->next ) object->next->prev = object->prev;
+ if ( object->prev ) object->prev->next = object->next;
+ if ( object == ctr->first_in_key ) ctr->first_in_key = object->next;
+
+ if ( !ctr->first_in_key ) destroy_container( ctr );
+
+ /* Get new or exist container */
+ fix_ctr = get_container( object->z );
+ if ( !fix_ctr ) continue; /* Error */
+
+ /* Put new object first */
+ if ( fix_ctr->first_in_key ) fix_ctr->first_in_key->prev = object;
+
+ object->prev = NULL;
+ object->next = fix_ctr->first_in_key;
+
+ fix_ctr->first_in_key = object;
+ }
+
+ if (
+ ( object->z != key ) ||
+ ( object->ready ^ ready ) ||
+ object->changed ||
+ object->bbox.x2 != object->bbox_saved.x2 || object->bbox.x != object->bbox_saved.x ||
+ object->bbox.y2 != object->bbox_saved.y2 || object->bbox.y != object->bbox_saved.y
+ )
+ {
+ if ( restore == 0 )
+ gr_mark_rect( object->bbox_saved.x, object->bbox_saved.y, object->bbox_saved.x2 - object->bbox_saved.x + 1, object->bbox_saved.y2 - object->bbox_saved.y + 1 );
+
+ object->bbox_saved = object->bbox ;
+ }
+
+ if (
+ !object->ready ||
+ object->bbox.x2 < 0 || object->bbox.x > scr_width - 1 ||
+ object->bbox.y2 < 0 || object->bbox.y > scr_height - 1 ) continue;
+
+ if ( dump == 0 && object->changed && ( object->bbox.x >= 0 || object->bbox.y >= 0 || object->bbox.x2 >= 0 || object->bbox.y2 >= 0 ) )
+ {
+ gr_mark_rect( object->bbox.x, object->bbox.y, object->bbox.x2 - object->bbox.x + 1, object->bbox.y2 - object->bbox.y + 1 );
+ }
+ }
+ }
+ }
+}
+
+/* --------------------------------------------------------------------------- */
+
+void gr_draw_objects( REGION * updaterects, int count )
+{
+ CONTAINER * ctr = NULL;
+ OBJECT * object;
+ REGION * prect;
+ int n;
+
+ ctr = sorted_object_list;
+ while ( ctr )
+ {
+ object = ctr->first_in_key;
+ while ( object )
+ {
+ if ( object->ready )
+ {
+ prect = updaterects;
+ for ( n = count; n--; prect++ )
+ {
+ if (
+ object->bbox.x2 < prect->x || object->bbox.x > prect->x2 ||
+ object->bbox.y2 < prect->y || object->bbox.y > prect->y2
+ )
+ continue;
+ ( *object->draw )( object->what, prect ) ;
+ }
+ }
+ object = object->next ;
+ }
+ ctr = ctr->next ;
+ }
+}
+
+/* --------------------------------------------------------------------------- */
+
+void gr_draw_objects_complete( void )
+{
+ CONTAINER * ctr = NULL;
+ OBJECT * object;
+
+ ctr = sorted_object_list;
+ while ( ctr )
+ {
+ object = ctr->first_in_key;
+ while ( object )
+ {
+ if ( object->ready )
+ ( *object->draw )( object->what, NULL ) ;
+ object = object->next ;
+ }
+ ctr = ctr->next ;
+ }
+}
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/librender/g_object.h b/modules/librender/g_object.h
new file mode 100644
index 0000000..f5ba317
--- /dev/null
+++ b/modules/librender/g_object.h
@@ -0,0 +1,80 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __OBJECT_H
+#define __OBJECT_H
+
+/* --------------------------------------------------------------------------- */
+
+typedef int ( OBJ_INFO )( void * what, REGION * clip, int * key, int * ready );
+typedef void ( OBJ_DRAW )( void * what, REGION * clip );
+
+typedef struct _object
+{
+ int z ;
+ OBJ_INFO * info ;
+ OBJ_DRAW * draw ;
+ void * what ;
+ int changed ;
+ int ready ; /* Ready to draw */
+ REGION bbox ;
+ REGION bbox_saved ;
+
+ int seq;
+
+ struct _object * prev ;
+ struct _object * next ;
+}
+OBJECT ;
+
+typedef struct _container
+{
+ int key ;
+ OBJECT * first_in_key ;
+
+ struct _container * prev ;
+ struct _container * next ;
+}
+CONTAINER ;
+
+/* --------------------------------------------------------------------------- */
+
+//extern CONTAINER * sorted_object_list;
+
+/* --------------------------------------------------------------------------- */
+
+extern CONTAINER * search_container( int key ) ;
+extern CONTAINER * get_container( int key ) ;
+extern void destroy_container( CONTAINER * ctr ) ;
+extern int gr_new_object( int z, OBJ_INFO * info, OBJ_DRAW * draw, void * what );
+extern void gr_destroy_object( int id ) ;
+extern void gr_update_objects_mark_rects( int restore, int dump ) ;
+extern void gr_draw_objects( REGION * updaterects, int count ) ;
+extern void gr_draw_objects_complete( void ) ;
+
+/* --------------------------------------------------------------------------- */
+
+#endif
diff --git a/modules/librender/g_rects.c b/modules/librender/g_rects.c
new file mode 100644
index 0000000..8b6ef4c
--- /dev/null
+++ b/modules/librender/g_rects.c
@@ -0,0 +1,207 @@
+/*
+ * Copyright � 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright � 2002-2006 Fenix Team (Fenix)
+ * Copyright � 1999-2002 Jos� Luis Cebri�n Pag�e (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include "librender.h"
+#include "fmath.h"
+
+/* --------------------------------------------------------------------------- */
+
+//uint8_t zonearray[ 128 / 8 ];
+#ifdef __USE_BIT_MASK
+static uint32_t zonearray[ /* DIRTYROWS * */ DIRTYCOLS ];
+#else
+static uint32_t zonearray[ DIRTYROWS ][ DIRTYCOLS ];
+#endif
+
+/* --------------------------------------------------------------------------- */
+
+void gr_rects_clear()
+{
+ memset( zonearray, 0, sizeof( zonearray ) );
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : gr_mark_rect
+ *
+ * Updates the given rectangle as a dirty zone at the 128-bits array
+ *
+ * PARAMS :
+ * x, y Top-left coordinate
+ * width Width in pixels
+ * height Height in pixels
+ *
+ * RETURN VALUE :
+ * None
+ */
+
+void gr_mark_rect( int x, int y, int width, int height )
+{
+#ifdef __USE_BIT_MASK
+ int cx, cy;
+ int w, h;
+ int iy, lx, ly;
+
+ w = scr_width / DIRTYCOLS;
+ h = scr_height / DIRTYROWS;
+
+ width = ABS( width ) - 1;
+ height = ABS( height ) - 1;
+
+ x = MIN( x, x + width );
+ y = MIN( y, y + height );
+
+ iy = MAX( y / h, 0 );
+
+ lx = MIN(( x + width ) / w, DIRTYCOLS - 1 );
+ ly = MIN(( y + height ) / h, DIRTYROWS - 1 );
+
+ for ( cx = MAX( x / w, 0 ); cx <= lx; cx++ )
+ for ( cy = iy; cy <= ly; cy++ )
+ zonearray[ cx ] |= ( 1 << cy );
+#else
+ int cx, cy;
+ int w, h;
+ int iy, lx, ly;
+
+ w = scr_width / DIRTYCOLS;
+ h = scr_height / DIRTYROWS;
+
+ if ( w * DIRTYCOLS != scr_width ) w++;
+ if ( h * DIRTYROWS != scr_height ) h++;
+
+ width = ABS( width ) - 1;
+ height = ABS( height ) - 1;
+
+ x = MIN( x, x + width );
+ y = MIN( y, y + height );
+
+ iy = MAX( y / h, 0 );
+
+ lx = MIN(( x + width ) / w, DIRTYCOLS - 1 );
+ ly = MIN(( y + height ) / h, DIRTYROWS - 1 );
+
+ for ( cx = MAX( x / w, 0 ); cx <= lx; cx++ )
+ for ( cy = iy; cy <= ly; cy++ )
+ zonearray[ cy ][ cx ] = 1;
+#endif
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : gr_mark_rects
+ *
+ * Given a 128-bits array of dirty screen zones, create an array of SDL_Rect regions
+ *
+ * PARAMS :
+ * zonearray Pointer to a 128-bits array with dirty screen zones = 1
+ * rects Pointer to a 128 REGION array
+ *
+ * RETURN VALUE :
+ * Number of rects filled
+ */
+
+int gr_mark_rects( REGION * rects )
+{
+ int count = 0, x, y;
+ int w, h, cw, ch, x2;
+
+ w = scr_width / DIRTYCOLS;
+ h = scr_height / DIRTYROWS;
+
+ if ( w * DIRTYCOLS != scr_width ) w++;
+ if ( h * DIRTYROWS != scr_height ) h++;
+
+ for ( x = 0; x < DIRTYCOLS; x++ )
+ {
+#ifdef __USE_BIT_MASK
+ if ( zonearray[ x ] )
+ {
+ for ( y = 0; y < DIRTYROWS; y++ )
+ {
+ if ( zonearray[ x ] & ( 1 << y ) )
+ {
+ zonearray[ x ] &= ~( 1 << y );
+ for ( cw = x + 1; ( cw < DIRTYCOLS ) && ( zonearray[ cw ] & ( 1 << y ) ); cw++ )
+ zonearray[ cw ] &= ~( 1 << y );
+
+ for ( ch = y + 1; ch < DIRTYROWS; ch++ )
+ {
+ /* Si hay algun hueco en el ancho de las siguiente lineas, corto aca,
+ y deja esta linea para otra recta */
+ for ( x2 = x; ( x2 < cw ) && ( zonearray[ x2 ] & ( 1 << ch ) ); x2++ );
+
+ if ( x2 < cw ) break;
+
+ /* Limpio bitmap de la recta actual */
+ for ( x2 = x; x2 < cw; x2++ )
+ zonearray[ x2 ] &= ~( 1 << ch );
+ }
+ rects[ count ].x = w * x;
+ rects[ count ].y = h * y;
+ rects[ count ].x2 = w * cw - 1 /* + rects[ count ].x */;
+ rects[ count ].y2 = h * ch - 1 /* + rects[ count ].y */;
+ count++;
+ }
+ }
+ }
+#else
+ for ( y = 0; y < DIRTYROWS; y++ )
+ {
+ if ( zonearray[ y ][ x ] )
+ {
+ zonearray[ y ][ x ] = 0;
+ for ( cw = x + 1; ( cw < DIRTYCOLS ) && ( zonearray[ y ][ cw ] ); cw++ ) zonearray[ y ][ cw ] = 0;
+
+ for ( ch = y + 1; ch < DIRTYROWS; ch++ )
+ {
+ /* Si hay algun hueco en el ancho de las siguiente lineas, corto aca,
+ y deja esta linea para otra recta */
+ for ( x2 = x; ( x2 < cw ) && ( zonearray[ ch ][ x2 ] ); x2++ );
+
+ if ( x2 < cw ) break;
+
+ /* Limpio bitmap de la recta actual */
+ for ( x2 = x; x2 < cw; x2++ ) zonearray[ ch ][ x2 ] = 0;
+ }
+
+ rects[ count ].x = w * x;
+ rects[ count ].y = h * y;
+ rects[ count ].x2 = MIN( w * cw - 1, scr_width - 1 );
+ rects[ count ].y2 = MIN( h * ch - 1, scr_height - 1 );
+
+ count++;
+ }
+ }
+#endif
+ }
+
+ return count;
+}
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/librender/g_rects.h b/modules/librender/g_rects.h
new file mode 100644
index 0000000..9d5565a
--- /dev/null
+++ b/modules/librender/g_rects.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __G_RECTS
+#define __G_RECTS
+
+#define DIRTYCOLS 32 /* max: 32 */
+#define DIRTYROWS 16 /* max: 32 */
+
+void gr_mark_rect( int x, int y, int width, int height ) ;
+int gr_mark_rects( REGION * rects ) ;
+void gr_rects_clear() ;
+
+#endif
diff --git a/modules/librender/g_screen.c b/modules/librender/g_screen.c
new file mode 100644
index 0000000..4d319fe
--- /dev/null
+++ b/modules/librender/g_screen.c
@@ -0,0 +1,523 @@
+/*
+ * Copyright � 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright � 2002-2006 Fenix Team (Fenix)
+ * Copyright � 1999-2002 Jos� Luis Cebri�n Pag�e (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+
+static GRAPH * scrbitmap_extra = NULL ;
+
+static int updaterects_count = 0;
+static REGION updaterects[ DIRTYCOLS * DIRTYROWS ];
+static SDL_Rect rects[ DIRTYCOLS * DIRTYROWS ];
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : gr_draw_screen
+ *
+ * Draw the current screen, using the given restore_type / dump_type parameters
+ *
+ * PARAMS :
+ * dest Destination graphic (MUST have a correct size)
+ *
+ * restore_type
+ * -1 No background restore
+ * 0 Partial (old process bounding box) background restore
+ * 1 Full background restore
+ *
+ * dump_type
+ * 0 Partial (new process bounding box) drawing
+ * 1 Full drawing
+ *
+ * RETURN VALUE :
+ * None
+ */
+
+void gr_draw_screen( GRAPH * dest, int restore_type, int dump_type )
+{
+ int a ;
+ GRAPH * orig_scrbitmap = scrbitmap;
+
+ scrbitmap = dest ;
+
+ if ( background && background->modified )
+ {
+ restore_type = 1;
+ dump_type = 1;
+ }
+
+ /* Update the object list */
+ gr_update_objects_mark_rects( restore_type, dump_type );
+
+ /* Restore the background */
+ if ( !dump_type || !restore_type )
+ {
+ updaterects_count = gr_mark_rects( updaterects );
+ }
+ else
+ {
+ updaterects_count = 1;
+ updaterects[ 0 ].x = 0;
+ updaterects[ 0 ].y = 0;
+ updaterects[ 0 ].x2 = scr_width - 1;
+ updaterects[ 0 ].y2 = scr_height - 1;
+ }
+
+ if ( !restore_type )
+ {
+ /* PARTIAL_RESTORE */
+ if ( background->info_flags & GI_CLEAN )
+ {
+ for ( a = 0; a < updaterects_count; a++ )
+ gr_clear_region( scrbitmap, &updaterects[ a ] );
+ }
+ else
+ {
+ for ( a = 0; a < updaterects_count; a++ )
+ gr_blit( scrbitmap, &updaterects[ a ], 0, 0, B_NOCOLORKEY, background );
+ }
+ }
+ else if ( restore_type == 1 )
+ {
+ /* COMPLETE_RESTORE */
+ if ( background->info_flags & GI_CLEAN )
+ gr_clear( scrbitmap ) ;
+ else
+ gr_blit( scrbitmap, NULL, 0, 0, B_NOCOLORKEY, background );
+
+ updaterects_count = 1;
+ updaterects[ 0 ].x = 0;
+ updaterects[ 0 ].y = 0;
+ updaterects[ 0 ].x2 = scr_width - 1;
+ updaterects[ 0 ].y2 = scr_height - 1;
+ }
+
+ /* Dump the objects */
+ if ( dump_type == 0 )
+ {
+ /* Dump only changed & enabled objects */
+ gr_draw_objects( updaterects, updaterects_count );
+ }
+ else
+ {
+ /* Dump everything */
+ gr_draw_objects_complete();
+ }
+
+ /* Reset the zone-to-update array for the next frame */
+ gr_rects_clear();
+
+ if ( background && background->modified ) background->modified = 0;
+ if ( scrbitmap && scrbitmap->modified ) scrbitmap->modified = 0;
+
+ scrbitmap = orig_scrbitmap;
+}
+
+/* --------------------------------------------------------------------------- */
+
+static int screen_locked = 0 ;
+
+int gr_lock_screen()
+{
+ if ( screen_locked ) return 1 ;
+
+ screen_locked = 1 ;
+
+ if ( scale_resolution != -1 )
+ {
+ if ( SDL_MUSTLOCK( scale_screen ) ) SDL_LockSurface( scale_screen ) ;
+ }
+ else
+ {
+ if ( SDL_MUSTLOCK( screen ) ) SDL_LockSurface( screen ) ;
+ }
+
+ if ( enable_scale || scale_mode != SCALE_NONE )
+ {
+ if ( scrbitmap && ( scrbitmap->info_flags & GI_EXTERNAL_DATA ) )
+ {
+ bitmap_destroy( scrbitmap ) ;
+ scrbitmap = NULL ;
+ }
+
+ if ( !scrbitmap )
+ {
+ scrbitmap = bitmap_new( 0, screen->w / 2, screen->h / 2, sys_pixel_format->depth ) ;
+ bitmap_add_cpoint( scrbitmap, 0, 0 ) ;
+ }
+ }
+ else
+ {
+ if ( !scrbitmap || !( scrbitmap->info_flags & GI_EXTERNAL_DATA ) )
+ {
+ if ( scrbitmap ) bitmap_destroy( scrbitmap ) ;
+ scrbitmap = bitmap_new_ex( 0, screen->w, screen->h, screen->format->BitsPerPixel, screen->pixels, screen->pitch );
+ bitmap_add_cpoint( scrbitmap, 0, 0 ) ;
+ }
+ }
+
+ return 1 ;
+}
+
+/* --------------------------------------------------------------------------- */
+
+void gr_unlock_screen()
+{
+ if ( !screen_locked || !screen->pixels ) return ;
+
+ screen_locked = 0 ;
+
+ if ( scale_resolution != -1 )
+ {
+ uint8_t * src8 = screen->pixels, * dst8 = scale_screen->pixels , * pdst = scale_screen->pixels ;
+ uint16_t * src16 = screen->pixels, * dst16 = scale_screen->pixels ;
+ uint32_t * src32 = screen->pixels, * dst32 = scale_screen->pixels ;
+ int h, w;
+
+ switch ( scale_screen->format->BitsPerPixel )
+ {
+ case 8:
+ if ( scale_resolution_orientation == 1 || scale_resolution_orientation == 3 )
+ {
+ if ( scale_resolution_aspectratio )
+ {
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ if ( scale_resolution_table_w[w] != -1 )
+ {
+ src8 = screen->pixels + scale_resolution_table_w[w];
+ for ( h = scale_screen->h - 1; h-- ; )
+ {
+ if ( scale_resolution_table_h[h] != -1 ) *dst8 = src8[scale_resolution_table_h[h]];
+ dst8 += scale_screen->pitch ;
+ }
+ }
+ dst8 = pdst += scale_screen->format->BytesPerPixel ;
+ }
+ }
+ else
+ {
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ src8 = screen->pixels + scale_resolution_table_w[w];
+ for ( h = scale_screen->h - 1; h-- ; )
+ {
+ *dst8 = src8[scale_resolution_table_h[h]];
+ dst8 += scale_screen->pitch ;
+ }
+ }
+ dst8 = pdst += scale_screen->format->BytesPerPixel ;
+ }
+ }
+ else
+ {
+ if ( scale_resolution_aspectratio )
+ {
+ for ( h = 0; h < scale_screen->h; h++ )
+ {
+ if ( scale_resolution_table_h[h] != -1 )
+ {
+ src8 = screen->pixels + scale_resolution_table_h[h];
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ if ( scale_resolution_table_w[w] != -1 ) *dst8 = src8[scale_resolution_table_w[w]];
+ dst8++;
+ }
+ }
+ dst8 = pdst += scale_screen->pitch ;
+ }
+ }
+ else
+ {
+ for ( h = 0; h < scale_screen->h; h++ )
+ {
+ src8 = screen->pixels + scale_resolution_table_h[h];
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ *dst8 = src8[scale_resolution_table_w[w]];
+ dst8++;
+ }
+ dst8 = pdst += scale_screen->pitch ;
+ }
+ }
+ }
+ break;
+
+ case 16:
+ if ( scale_resolution_orientation == 1 || scale_resolution_orientation == 3 )
+ {
+ if ( scale_resolution_aspectratio )
+ {
+ int inc = scale_screen->pitch / scale_screen->format->BytesPerPixel;
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ if ( scale_resolution_table_w[w] != -1 )
+ {
+ src16 = screen->pixels + scale_resolution_table_w[w];
+ for ( h = scale_screen->h - 1; h-- ; )
+ {
+ if ( scale_resolution_table_h[h] != -1 ) *dst16 = src16[scale_resolution_table_h[h]];
+ dst16 += inc;
+ }
+ }
+ dst16 = ( uint16_t * ) ( pdst += scale_screen->format->BytesPerPixel ) ;
+ }
+ }
+ else
+ {
+ int inc = scale_screen->pitch / scale_screen->format->BytesPerPixel;
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ src16 = screen->pixels + scale_resolution_table_w[w];
+ for ( h = scale_screen->h - 1; h-- ; )
+ {
+ *dst16 = src16[scale_resolution_table_h[h]];
+ dst16 += inc;
+ }
+ dst16 = ( uint16_t * ) ( pdst += scale_screen->format->BytesPerPixel ) ;
+ }
+ }
+ }
+ else
+ {
+ if ( scale_resolution_aspectratio )
+ {
+ for ( h = 0; h < scale_screen->h; h++ )
+ {
+ if ( scale_resolution_table_h[h] != -1 )
+ {
+ src16 = screen->pixels + scale_resolution_table_h[h];
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ if ( scale_resolution_table_w[w] != -1 ) *dst16 = src16[scale_resolution_table_w[w]];
+ dst16++;
+ }
+ }
+ dst16 = ( uint16_t * ) ( pdst += scale_screen->pitch ) ;
+ }
+ }
+ else
+ {
+ for ( h = 0; h < scale_screen->h; h++ )
+ {
+ src16 = screen->pixels + scale_resolution_table_h[h];
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ *dst16 = src16[scale_resolution_table_w[w]];
+ dst16++;
+ }
+ dst16 = ( uint16_t * ) ( pdst += scale_screen->pitch ) ;
+ }
+ }
+ }
+ break;
+
+ case 32:
+ if ( scale_resolution_orientation == 1 || scale_resolution_orientation == 3 )
+ {
+ if ( scale_resolution_aspectratio )
+ {
+ int inc = scale_screen->pitch / scale_screen->format->BytesPerPixel;
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ if ( scale_resolution_table_w[w] != -1 )
+ {
+ src32 = screen->pixels + scale_resolution_table_w[w];
+ for ( h = scale_screen->h - 1; h-- ; )
+ {
+ if ( scale_resolution_table_h[h] != -1 ) *dst32 = src32[scale_resolution_table_h[h]];
+ dst32 += inc;
+ }
+ }
+ dst32 = ( uint32_t * ) ( pdst += scale_screen->format->BytesPerPixel ) ;
+ }
+ }
+ else
+ {
+ int inc = scale_screen->pitch / scale_screen->format->BytesPerPixel;
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ src32 = screen->pixels + scale_resolution_table_w[w];
+ for ( h = scale_screen->h - 1; h-- ; )
+ {
+ *dst32 = src32[scale_resolution_table_h[h]];
+ dst32 += inc;
+ }
+ dst32 = ( uint32_t * ) ( pdst += scale_screen->format->BytesPerPixel ) ;
+ }
+ }
+ }
+ else
+ {
+ if ( scale_resolution_aspectratio )
+ {
+ for ( h = 0; h < scale_screen->h; h++ )
+ {
+ if ( scale_resolution_table_h[h] != -1 )
+ {
+ src32 = screen->pixels + scale_resolution_table_h[h];
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ if ( scale_resolution_table_w[w] != -1 ) *dst32 = src32[scale_resolution_table_w[w]];
+ dst32++;
+ }
+ }
+ dst32 = ( uint32_t * ) ( pdst += scale_screen->pitch ) ;
+ }
+ }
+ else
+ {
+ for ( h = 0; h < scale_screen->h; h++ )
+ {
+ src32 = screen->pixels + scale_resolution_table_h[h];
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ *dst32 = src32[scale_resolution_table_w[w]];
+ dst32++;
+ }
+ dst32 = ( uint32_t * ) ( pdst += scale_screen->pitch ) ;
+ }
+ }
+ }
+ break;
+ }
+
+ if ( SDL_MUSTLOCK( scale_screen ) ) SDL_UnlockSurface( scale_screen ) ;
+ if ( waitvsync ) gr_wait_vsync();
+ SDL_Flip( scale_screen ) ;
+ }
+ else if ( enable_scale )
+ {
+ GRAPH * scr;
+
+ if ( scrbitmap->format->depth == 8 )
+ {
+ uint8_t * original, * poriginal;
+ uint16_t * extra, * pextra;
+ int n = scrbitmap->height, length;
+
+ if (
+ !scrbitmap_extra ||
+ scrbitmap_extra->width != scrbitmap->width ||
+ scrbitmap_extra->height != scrbitmap->height
+ )
+ {
+ if ( scrbitmap_extra ) bitmap_destroy( scrbitmap_extra );
+ scrbitmap_extra = bitmap_new( 0, scrbitmap->width, scrbitmap->height, 16 );
+ }
+
+ poriginal = scrbitmap->data;
+ pextra = scrbitmap_extra->data;
+
+ while ( n-- )
+ {
+ original = poriginal;
+ extra = pextra;
+ length = scrbitmap->width;
+ while ( length-- ) *extra++ = sys_pixel_format->palette->colorequiv[ *original++ ];
+ poriginal += scrbitmap->pitch;
+ pextra = ( uint16_t * )((( uint8_t * ) pextra ) + scrbitmap_extra->pitch );
+ }
+
+ scr = scrbitmap_extra;
+ }
+ else
+ {
+ scr = scrbitmap;
+ }
+
+ /* Esto podria ir en un modulo aparte */
+ switch ( scale_mode )
+ {
+ case SCALE_SCALE2X:
+ scale2x( scr->data, scr->pitch, screen->pixels, screen->pitch, scr->width, scr->height );
+ break;
+
+ case SCALE_HQ2X:
+ hq2x( scr->data, scr->pitch, screen->pixels, screen->pitch, scr->width, scr->height );
+ break;
+
+ case SCALE_SCANLINE2X:
+ scanline2x( scr->data, scr->pitch, screen->pixels, screen->pitch, scr->width, scr->height );
+ break;
+
+ case SCALE_NOFILTER:
+ scale_normal2x( scr->data, scr->pitch, screen->pixels, screen->pitch, scr->width, scr->height );
+ break;
+
+ case SCALE_NONE:
+ // No usado
+ break;
+ }
+
+ if ( SDL_MUSTLOCK( screen ) ) SDL_UnlockSurface( screen ) ;
+ if ( waitvsync ) gr_wait_vsync();
+ SDL_Flip( screen ) ;
+ }
+ else if ( scrbitmap->info_flags & GI_EXTERNAL_DATA )
+ {
+ if ( double_buffer ||
+ (
+ updaterects_count == 1 &&
+ updaterects[0].x == 0 &&
+ updaterects[0].y == 0 &&
+ updaterects[0].x2 == scr_width - 1 &&
+ updaterects[0].y2 == scr_height - 1
+ )
+ )
+ {
+ if ( SDL_MUSTLOCK( screen ) ) SDL_UnlockSurface( screen ) ;
+ if ( waitvsync ) gr_wait_vsync();
+ SDL_Flip( screen ) ;
+ }
+ else
+ {
+ if ( updaterects_count )
+ {
+ int i;
+
+ for ( i = 0 ; i < updaterects_count ; i++ )
+ {
+ rects[ i ].x = updaterects[ i ].x;
+ rects[ i ].y = updaterects[ i ].y;
+ rects[ i ].w = ( updaterects[ i ].x2 - rects[ i ].x + 1 );
+ rects[ i ].h = ( updaterects[ i ].y2 - rects[ i ].y + 1 );
+ }
+ if ( SDL_MUSTLOCK( screen ) ) SDL_UnlockSurface( screen ) ;
+ if ( waitvsync ) gr_wait_vsync();
+ SDL_UpdateRects( screen, updaterects_count, rects ) ;
+ }
+ }
+ }
+}
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/librender/g_screen.h b/modules/librender/g_screen.h
new file mode 100644
index 0000000..aaee2b1
--- /dev/null
+++ b/modules/librender/g_screen.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __SCREEN_H
+#define __SCREEN_H
+
+extern void gr_draw_screen( GRAPH * dest, int restore_type, int dump_type ) ;
+extern int gr_lock_screen() ;
+extern void gr_unlock_screen() ;
+
+#endif
diff --git a/modules/librender/librender.c b/modules/librender/librender.c
new file mode 100644
index 0000000..7d991f0
--- /dev/null
+++ b/modules/librender/librender.c
@@ -0,0 +1,128 @@
+/*
+ * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+/* --------------------------------------------------------------------------- */
+
+#include <stdlib.h>
+
+/* --------------------------------------------------------------------------- */
+
+#include "bgddl.h"
+#include "dlvaracc.h"
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+/* Son las variables que se desea acceder. */
+/* El interprete completa esta estructura, si la variable existe. */
+/* (usada en tiempo de ejecucion) */
+
+DLVARFIXUP __bgdexport( librender, globals_fixup )[] =
+{
+ /* Nombre de variable global, puntero al dato, tamaño del elemento, cantidad de elementos */
+ { "fps" , NULL, -1, -1 },
+ { "speed_gauge" , NULL, -1, -1 },
+ { "frame_time" , NULL, -1, -1 },
+
+ { "scale_mode" , NULL, -1, -1 },
+ { "restore_type" , NULL, -1, -1 },
+ { "dump_type" , NULL, -1, -1 },
+
+ { "fading" , NULL, -1, -1 },
+ { "alpha_steps" , NULL, -1, -1 },
+
+ { NULL , NULL, -1, -1 }
+};
+
+DLVARFIXUP __bgdexport( librender, locals_fixup )[] =
+{
+ { "ctype" , NULL, -1, -1 }, // 0 CTYPE 0
+ { "cnumber" , NULL, -1, -1 }, // 1 CNUMBER 1
+
+ { "x" , NULL, -1, -1 }, // 2 COORDX 2
+ { "y" , NULL, -1, -1 }, // 3 COORDY 3
+ { "z" , NULL, -1, -1 }, // 4 COORDZ 4
+ { "file" , NULL, -1, -1 }, // 5 FILEID 5
+ { "graph" , NULL, -1, -1 }, // 6 GRAPHID 6
+ { "size" , NULL, -1, -1 }, // 7 GRAPHSIZE 7
+ { "angle" , NULL, -1, -1 }, // 8 ANGLE 8
+ { "flags" , NULL, -1, -1 }, // 9 FLAGS 9
+ { "alpha" , NULL, -1, -1 }, // 10 ALPHA 10
+ { "palette" , NULL, -1, -1 }, // 11 PALETTEID 11
+ { "region" , NULL, -1, -1 }, // 12 REGIONID 12
+ { "resolution" , NULL, -1, -1 }, // 13 RESOLUTION 13
+ { "size_x" , NULL, -1, -1 }, // 14 GRAPHSIZEX 14
+ { "size_y" , NULL, -1, -1 }, // 15 GRAPHSIZEY 15
+ { "blendop" , NULL, -1, -1 }, // 16 BLENDOP 16
+ { "xgraph" , NULL, -1, -1 }, // 17 XGRAPH 17
+
+ { "_render_reserved_.object_id" , NULL, -1, -1 }, // 18 OBJECTID 18
+ { "_render_reserved_.graph_ptr" , NULL, -1, -1 }, // 19 GRAPHPTR 19
+ { "_render_reserved_.xgraph_flags" , NULL, -1, -1 }, // 20 XGRAPH_FLAGS 20
+
+ { "_render_reserved_._saved_.x" , NULL, -1, -1 }, // 21 SAVED_COORDX 21
+ { "_render_reserved_._saved_.y" , NULL, -1, -1 }, // 22 SAVED_COORDY 22
+ { "_render_reserved_._saved_.z" , NULL, -1, -1 }, // 23 SAVED_COORDZ 23
+ { "_render_reserved_._saved_.file" , NULL, -1, -1 }, // 24 SAVED_FILEID 24
+ { "_render_reserved_._saved_.graph" , NULL, -1, -1 }, // 25 SAVED_GRAPHID 25
+ { "_render_reserved_._saved_.size" , NULL, -1, -1 }, // 26 SAVED_GRAPHSIZE 26
+ { "_render_reserved_._saved_.angle" , NULL, -1, -1 }, // 27 SAVED_ANGLE 27
+ { "_render_reserved_._saved_.flags" , NULL, -1, -1 }, // 28 SAVED_FLAGS 28
+ { "_render_reserved_._saved_.alpha" , NULL, -1, -1 }, // 29 SAVED_ALPHA 29
+ { "_render_reserved_._saved_.palette" , NULL, -1, -1 }, // 30 SAVED_PALETTE 30
+ { "_render_reserved_._saved_.size_x" , NULL, -1, -1 }, // 31 SAVED_GRAPHSIZEX 31
+ { "_render_reserved_._saved_.size_y" , NULL, -1, -1 }, // 32 SAVED_GRAPHSIZEY 32
+ { "_render_reserved_._saved_.blendop" , NULL, -1, -1 }, // 33 SAVED_BLENDOP 33
+ { "_render_reserved_._saved_.xgraph" , NULL, -1, -1 }, // 34 SAVED_XGRAPH 34
+ { "_render_reserved_._saved_.centerx" , NULL, -1, -1 }, // 35 SAVED_COORDX 35
+ { "_render_reserved_._saved_.centery" , NULL, -1, -1 }, // 36 SAVED_COORDY 36
+
+ { "reserved.status" , NULL, -1, -1 }, // 37 STATUS 37
+
+ { NULL , NULL, -1, -1 }
+};
+
+/* --------------------------------------------------------------------------- */
+
+/* Bigest priority first execute
+ Lowest priority last execute */
+
+HOOK __bgdexport( librender, handler_hooks )[] =
+{
+ { 9500, gr_wait_frame },
+ { 9000, gr_draw_frame },
+ { 0, NULL }
+} ;
+
+/* --------------------------------------------------------------------------- */
+/* exports */
+/* --------------------------------------------------------------------------- */
+
+#include "librender_exports.h"
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/librender/librender.h b/modules/librender/librender.h
new file mode 100644
index 0000000..8aa4112
--- /dev/null
+++ b/modules/librender/librender.h
@@ -0,0 +1,135 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __RENDER_H
+#define __RENDER_H
+
+/* --------------------------------------------------------------------------- */
+
+#ifdef __LIBRENDER
+#include "bgdrtm.h"
+
+#include "dlvaracc.h"
+#include "bgddl.h"
+
+#include "libgrbase.h"
+#include "libvideo.h"
+#include "libblit.h"
+#endif
+
+#ifndef __BGDC__
+#include "g_fade.h"
+#include "g_frame.h"
+#include "g_instance.h"
+#include "g_object.h"
+#include "g_rects.h"
+#include "g_screen.h"
+#endif
+
+#include "scaler.h"
+
+/* --------------------------------------------------------------------------- */
+
+#define C_SCREEN 0
+
+/* --------------------------------------------------------------------------- */
+
+#ifdef __LIBRENDER
+
+/* Globals */
+
+enum {
+ FPS = 0,
+ SPEED_GAUGE,
+ FRAME_TIME,
+
+ SCALE_MODE,
+ RESTORETYPE,
+ DUMPTYPE,
+
+ FADING,
+ ALPHA_STEPS
+};
+
+/* Locals */
+
+enum {
+ CTYPE = 0,
+ CNUMBER,
+
+ COORDX,
+ COORDY,
+ COORDZ,
+ FILEID,
+ GRAPHID,
+ GRAPHSIZE,
+ ANGLE,
+ FLAGS,
+ ALPHA,
+ PALETTEID,
+ REGIONID,
+ RESOLUTION,
+ GRAPHSIZEX,
+ GRAPHSIZEY,
+ BLENDOP,
+ XGRAPH,
+
+ OBJECTID,
+ GRAPHPTR,
+ XGRAPH_FLAGS,
+
+ SAVED_COORDX,
+ SAVED_COORDY,
+ SAVED_COORDZ,
+ SAVED_FILEID,
+ SAVED_GRAPHID,
+ SAVED_GRAPHSIZE,
+ SAVED_ANGLE,
+ SAVED_FLAGS,
+ SAVED_ALPHA,
+ SAVED_PALETTE,
+ SAVED_GRAPHSIZEX,
+ SAVED_GRAPHSIZEY,
+ SAVED_BLENDOP,
+ SAVED_XGRAPH,
+ SAVED_CENTERX,
+ SAVED_CENTERY,
+
+ STATUS
+};
+
+/* --------------------------------------------------------------------------- */
+
+extern DLVARFIXUP __bgdexport( librender, globals_fixup )[];
+extern DLVARFIXUP __bgdexport( librender, locals_fixup )[];
+
+/* --------------------------------------------------------------------------- */
+#endif
+
+#endif
+
diff --git a/modules/librender/librender_exports.h b/modules/librender/librender_exports.h
new file mode 100644
index 0000000..5930fd6
--- /dev/null
+++ b/modules/librender/librender_exports.h
@@ -0,0 +1,155 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __LIBRENDER_EXPORTS
+#define __LIBRENDER_EXPORTS
+
+/* --------------------------------------------------------------------------- */
+
+#include "bgddl.h"
+
+/* --------------------------------------------------------------------------- */
+
+#if defined(__BGDC__) || !defined(__STATIC__)
+
+/* --------------------------------------------------------------------------- */
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+
+DLCONSTANT __bgdexport( librender, constants_def )[] =
+{
+ { "C_SCREEN", TYPE_DWORD, C_SCREEN },
+
+ { "PARTIAL_DUMP", TYPE_DWORD, 0 },
+ { "COMPLETE_DUMP", TYPE_DWORD, 1 },
+ { "NO_RESTORE", TYPE_DWORD, -1 },
+ { "PARTIAL_RESTORE", TYPE_DWORD, 0 },
+ { "COMPLETE_RESTORE", TYPE_DWORD, 1 },
+
+ { "BACKGROUND", TYPE_DWORD, 0 },
+ { "SCREEN", TYPE_DWORD, -1 },
+
+ { "SCALE_SCALE2X", TYPE_DWORD, SCALE_SCALE2X },
+ { "SCALE_HQ2X", TYPE_DWORD, SCALE_HQ2X },
+ { "SCALE_SCANLINE2X", TYPE_DWORD, SCALE_SCANLINE2X },
+ { "SCALE_NORMAL2X", TYPE_DWORD, SCALE_NOFILTER },
+ { "SCALE_NOFILTER", TYPE_DWORD, SCALE_NOFILTER },
+
+ { NULL , 0 , 0 }
+} ;
+
+/* --------------------------------------------------------------------------- */
+/* Definicion de variables globales (usada en tiempo de compilacion) */
+
+char * __bgdexport( librender, globals_def ) =
+
+ /* Frame */
+
+ "fps;\n"
+ "speed_gauge = 0;\n"
+ "FLOAT frame_time = 0;\n"
+
+ /* Screen */
+
+ "restore_type;\n"
+ "dump_type;\n"
+
+ /* Fade */
+
+ "fading;\n"
+ "alpha_steps = 16;\n"
+ ;
+
+/* --------------------------------------------------------------------------- */
+
+char * __bgdexport( librender, locals_def ) =
+
+ /* Render */
+
+ "ctype;\n"
+ "cnumber;\n"
+
+ "x;\n"
+ "y;\n"
+ "z;\n"
+ "file;\n"
+ "graph;\n"
+ "size=100;\n"
+ "angle;\n"
+ "flags;\n"
+ "alpha=255;\n"
+ "palette=0;\n"
+ "region;\n"
+ "resolution;\n"
+ "size_x=100;\n"
+ "size_y=100;\n"
+ "blendop=0;\n"
+ "pointer xgraph;\n"
+
+ "STRUCT _render_reserved_\n"
+ "object_id=0;\n"
+ "graph_ptr=0;\n"
+ "xgraph_flags;\n"
+ "STRUCT _saved_\n"
+ "x;\n"
+ "y;\n"
+ "z;\n"
+ "file;\n"
+ "graph;\n"
+ "size;\n"
+ "angle;\n"
+ "flags;\n"
+ "alpha;\n"
+ "palette;\n"
+ "size_x;\n"
+ "size_y;\n"
+ "blendop;\n"
+ "pointer xgraph;\n"
+ "centerx;\n"
+ "centery;\n"
+ "END\n"
+ "END\n"
+ ;
+
+#endif
+
+/* --------------------------------------------------------------------------- */
+
+char * __bgdexport( librender, modules_dependency )[] =
+{
+ "libgrbase",
+ "libvideo",
+ "libblit",
+ NULL
+};
+
+/* --------------------------------------------------------------------------- */
+
+#endif
diff --git a/modules/librender/scaler.h b/modules/librender/scaler.h
new file mode 100644
index 0000000..dee1d43
--- /dev/null
+++ b/modules/librender/scaler.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __SCALER_H
+#define __SCALER_H
+
+#define SCALE_NONE 0x0000
+
+#include "scaler_scale2x.h"
+#include "scaler_hq2x.h"
+#include "scaler_scanline.h"
+#include "scaler_normal.h"
+
+#endif
diff --git a/modules/librender/scaler_hq2x.c b/modules/librender/scaler_hq2x.c
new file mode 100644
index 0000000..dbea6df
--- /dev/null
+++ b/modules/librender/scaler_hq2x.c
@@ -0,0 +1,2675 @@
+/*
+ * Copyright © 2003 MaxSt (maxst@hiend3d.com)
+ *
+ * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+/* --------------------------------------------------------------------------- */
+
+#include <stdlib.h>
+#include <string.h>
+
+/* --------------------------------------------------------------------------- */
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+
+#define PIXEL00_0 *(q) = w5;
+#define PIXEL00_10 *(q) = interpolate16_2(3,1,w5, w1);
+#define PIXEL00_11 *(q) = interpolate16_2(3,1,w5, w4);
+#define PIXEL00_12 *(q) = interpolate16_2(3,1,w5, w2);
+#define PIXEL00_20 *(q) = interpolate16_3(2,1,1,w5, w4, w2);
+#define PIXEL00_21 *(q) = interpolate16_3(2,1,1,w5, w1, w2);
+#define PIXEL00_22 *(q) = interpolate16_3(2,1,1,w5, w1, w4);
+#define PIXEL00_60 *(q) = interpolate16_3(5,2,1,w5, w2, w4);
+#define PIXEL00_61 *(q) = interpolate16_3(5,2,1,w5, w4, w2);
+#define PIXEL00_70 *(q) = interpolate16_3(6,1,1,w5, w4, w2);
+#define PIXEL00_90 *(q) = interpolate16_3(2,3,3,w5, w4, w2);
+#define PIXEL00_100 *(q) = interpolate16_3(14,1,1,w5, w4, w2);
+
+#define PIXEL01_0 *(q+1) = w5;
+#define PIXEL01_10 *(q+1) = interpolate16_2(3,1,w5, w3);
+#define PIXEL01_11 *(q+1) = interpolate16_2(3,1,w5, w2);
+#define PIXEL01_12 *(q+1) = interpolate16_2(3,1,w5, w6);
+#define PIXEL01_20 *(q+1) = interpolate16_3(2,1,1,w5, w2, w6);
+#define PIXEL01_21 *(q+1) = interpolate16_3(2,1,1,w5, w3, w6);
+#define PIXEL01_22 *(q+1) = interpolate16_3(2,1,1,w5, w3, w2);
+#define PIXEL01_60 *(q+1) = interpolate16_3(5,2,1,w5, w6, w2);
+#define PIXEL01_61 *(q+1) = interpolate16_3(5,2,1,w5, w2, w6);
+#define PIXEL01_70 *(q+1) = interpolate16_3(6,1,1,w5, w2, w6);
+#define PIXEL01_90 *(q+1) = interpolate16_3(2,3,3,w5, w2, w6);
+#define PIXEL01_100 *(q+1) = interpolate16_3(14,1,1,w5, w2, w6);
+
+#define PIXEL10_0 *(q+nextlineDst) = w5;
+#define PIXEL10_10 *(q+nextlineDst) = interpolate16_2(3,1,w5, w7);
+#define PIXEL10_11 *(q+nextlineDst) = interpolate16_2(3,1,w5, w8);
+#define PIXEL10_12 *(q+nextlineDst) = interpolate16_2(3,1,w5, w4);
+#define PIXEL10_20 *(q+nextlineDst) = interpolate16_3(2,1,1,w5, w8, w4);
+#define PIXEL10_21 *(q+nextlineDst) = interpolate16_3(2,1,1,w5, w7, w4);
+#define PIXEL10_22 *(q+nextlineDst) = interpolate16_3(2,1,1,w5, w7, w8);
+#define PIXEL10_60 *(q+nextlineDst) = interpolate16_3(5,2,1,w5, w4, w8);
+#define PIXEL10_61 *(q+nextlineDst) = interpolate16_3(5,2,1,w5, w8, w4);
+#define PIXEL10_70 *(q+nextlineDst) = interpolate16_3(6,1,1,w5, w8, w4);
+#define PIXEL10_90 *(q+nextlineDst) = interpolate16_3(2,3,3,w5, w8, w4);
+#define PIXEL10_100 *(q+nextlineDst) = interpolate16_3(14,1,1,w5, w8, w4);
+
+#define PIXEL11_0 *(q+1+nextlineDst) = w5;
+#define PIXEL11_10 *(q+1+nextlineDst) = interpolate16_2(3,1,w5, w9);
+#define PIXEL11_11 *(q+1+nextlineDst) = interpolate16_2(3,1,w5, w6);
+#define PIXEL11_12 *(q+1+nextlineDst) = interpolate16_2(3,1,w5, w8);
+#define PIXEL11_20 *(q+1+nextlineDst) = interpolate16_3(2,1,1,w5, w6, w8);
+#define PIXEL11_21 *(q+1+nextlineDst) = interpolate16_3(2,1,1,w5, w9, w8);
+#define PIXEL11_22 *(q+1+nextlineDst) = interpolate16_3(2,1,1,w5, w9, w6);
+#define PIXEL11_60 *(q+1+nextlineDst) = interpolate16_3(5,2,1,w5, w8, w6);
+#define PIXEL11_61 *(q+1+nextlineDst) = interpolate16_3(5,2,1,w5, w6, w8);
+#define PIXEL11_70 *(q+1+nextlineDst) = interpolate16_3(6,1,1,w5, w6, w8);
+#define PIXEL11_90 *(q+1+nextlineDst) = interpolate16_3(2,3,3,w5, w6, w8);
+#define PIXEL11_100 *(q+1+nextlineDst) = interpolate16_3(14,1,1,w5, w6, w8);
+
+#define YUV(x) RGBtoYUV[w ## x]
+
+/* --------------------------------------------------------------------------- */
+
+int hq2xinited = 0;
+
+#define RGBtoYUV _RGBtoYUV
+#define LUT16to32 _LUT16to32
+
+static uint32_t *LUT16to32;
+static uint32_t *RGBtoYUV;
+
+/* --------------------------------------------------------------------------- */
+/**
+ * Interpolate two 16 bit pixels with the weights specified in the template
+ * parameters. Used by the hq scaler family.
+ * @note w1 and w2 must sum up to 2, 4, 8 or 16.
+ */
+
+static inline uint16_t interpolate16_2( int w1, int w2, uint16_t p1, uint16_t p2 )
+{
+ return (((( p1 & ( sys_pixel_format->Rmask | sys_pixel_format->Bmask ) ) * w1 + ( p2 & ( sys_pixel_format->Rmask | sys_pixel_format->Bmask ) ) * w2 ) / ( w1 + w2 ) ) & ( sys_pixel_format->Rmask | sys_pixel_format->Bmask ) ) |
+ (((( p1 & sys_pixel_format->Gmask ) * w1 + ( p2 & sys_pixel_format->Gmask ) * w2 ) / ( w1 + w2 ) ) & sys_pixel_format->Gmask );
+}
+
+/* --------------------------------------------------------------------------- */
+/**
+ * Interpolate three 16 bit pixels with the weights specified in the template
+ * parameters. Used by the hq scaler family.
+ * @note w1, w2 and w3 must sum up to 2, 4, 8 or 16.
+ */
+
+static inline uint16_t interpolate16_3( int w1, int w2, int w3, uint16_t p1, uint16_t p2, uint16_t p3 )
+{
+ return (((( p1 & ( sys_pixel_format->Rmask | sys_pixel_format->Bmask ) ) * w1 + ( p2 & ( sys_pixel_format->Rmask | sys_pixel_format->Bmask ) ) * w2 + ( p3 & ( sys_pixel_format->Rmask | sys_pixel_format->Bmask ) ) * w3 ) / ( w1 + w2 + w3 ) ) & ( sys_pixel_format->Rmask | sys_pixel_format->Bmask ) ) |
+ (((( p1 & sys_pixel_format->Gmask ) * w1 + ( p2 & sys_pixel_format->Gmask ) * w2 + ( p3 & sys_pixel_format->Gmask ) * w3 ) / ( w1 + w2 + w3 ) ) & sys_pixel_format->Gmask );
+}
+
+/* --------------------------------------------------------------------------- */
+/**
+ * Compare two YUV values (encoded 8-8-8) and check if they differ by more than
+ * a certain hard coded threshold. Used by the hq scaler family.
+ */
+static inline int diffYUV( int yuv1, int yuv2 )
+{
+ static const int Ymask = 0x00FF0000;
+ static const int Umask = 0x0000FF00;
+ static const int Vmask = 0x000000FF;
+ static const int trY = 0x00300000;
+ static const int trU = 0x00000700;
+ static const int trV = 0x00000006;
+
+ int diff;
+ int mask;
+
+ diff = (( yuv1 & Ymask ) - ( yuv2 & Ymask ) );
+ mask = diff >> 31; // -1 if value < 0, 0 otherwise
+ diff = ( diff ^ mask ) - mask; //-1: ~value + 1; 0: value
+ if ( diff > trY ) return -1;
+
+ diff = (( yuv1 & Umask ) - ( yuv2 & Umask ) );
+ mask = diff >> 31; // -1 if value < 0, 0 otherwise
+ diff = ( diff ^ mask ) - mask; //-1: ~value + 1; 0: value
+ if ( diff > trU ) return -1;
+
+ diff = (( yuv1 & Vmask ) - ( yuv2 & Vmask ) );
+ mask = diff >> 31; // -1 if value < 0, 0 otherwise
+ diff = ( diff ^ mask ) - mask; //-1: ~value + 1; 0: value
+ if ( diff > trV ) return -1;
+
+ return 0;
+ /*
+ return
+ ((ABS((yuv1 & Ymask) - (yuv2 & Ymask)) > trY) ||
+ (ABS((yuv1 & Umask) - (yuv2 & Umask)) > trU) ||
+ (ABS((yuv1 & Vmask) - (yuv2 & Vmask)) > trV));
+ */
+}
+
+/* --------------------------------------------------------------------------- */
+
+static void inline hq2x_main( int w1, int w2, int w3, int w4, int w5, int w6, int w7, int w8, int w9,
+ uint32_t nextlineSrc, uint32_t nextlineDst, uint16_t *p, uint16_t *q, int skiplastline )
+{
+ int pattern = 0;
+
+ const int yuv5 = YUV( 5 );
+
+ if ( w5 != w1 && diffYUV( yuv5, YUV( 1 ) ) ) pattern |= 0x0001;
+ if ( w5 != w2 && diffYUV( yuv5, YUV( 2 ) ) ) pattern |= 0x0002;
+ if ( w5 != w3 && diffYUV( yuv5, YUV( 3 ) ) ) pattern |= 0x0004;
+ if ( w5 != w4 && diffYUV( yuv5, YUV( 4 ) ) ) pattern |= 0x0008;
+ if ( w5 != w6 && diffYUV( yuv5, YUV( 6 ) ) ) pattern |= 0x0010;
+ if ( w5 != w7 && diffYUV( yuv5, YUV( 7 ) ) ) pattern |= 0x0020;
+ if ( w5 != w8 && diffYUV( yuv5, YUV( 8 ) ) ) pattern |= 0x0040;
+ if ( w5 != w9 && diffYUV( yuv5, YUV( 9 ) ) ) pattern |= 0x0080;
+
+ switch ( pattern )
+ {
+ case 0:
+ case 1:
+ case 4:
+ case 32:
+ case 128:
+ case 5:
+ case 132:
+ case 160:
+ case 33:
+ case 129:
+ case 36:
+ case 133:
+ case 164:
+ case 161:
+ case 37:
+ case 165:
+ PIXEL00_20
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 2:
+ case 34:
+ case 130:
+ case 162:
+ PIXEL00_22
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 16:
+ case 17:
+ case 48:
+ case 49:
+ PIXEL00_20
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 64:
+ case 65:
+ case 68:
+ case 69:
+ PIXEL00_20
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 8:
+ case 12:
+ case 136:
+ case 140:
+ PIXEL00_21
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 3:
+ case 35:
+ case 131:
+ case 163:
+ PIXEL00_11
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 6:
+ case 38:
+ case 134:
+ case 166:
+ PIXEL00_22
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 20:
+ case 21:
+ case 52:
+ case 53:
+ PIXEL00_20
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 144:
+ case 145:
+ case 176:
+ case 177:
+ PIXEL00_20
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 192:
+ case 193:
+ case 196:
+ case 197:
+ PIXEL00_20
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 96:
+ case 97:
+ case 100:
+ case 101:
+ PIXEL00_20
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 40:
+ case 44:
+ case 168:
+ case 172:
+ PIXEL00_21
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 9:
+ case 13:
+ case 137:
+ case 141:
+ PIXEL00_12
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 18:
+ case 50:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 80:
+ case 81:
+ PIXEL00_20
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_21
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 72:
+ case 76:
+ PIXEL00_21
+ PIXEL01_20
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 10:
+ case 138:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 66:
+ PIXEL00_22
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 24:
+ PIXEL00_21
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 7:
+ case 39:
+ case 135:
+ PIXEL00_11
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 148:
+ case 149:
+ case 180:
+ PIXEL00_20
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 224:
+ case 228:
+ case 225:
+ PIXEL00_20
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 41:
+ case 169:
+ case 45:
+ PIXEL00_12
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 22:
+ case 54:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 208:
+ case 209:
+ PIXEL00_20
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_21
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 104:
+ case 108:
+ PIXEL00_21
+ PIXEL01_20
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 11:
+ case 139:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 19:
+ case 51:
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL00_11
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL00_60
+ PIXEL01_90
+ }
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 146:
+ case 178:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ if ( !skiplastline ) PIXEL11_12
+ }
+ else
+ {
+ PIXEL01_90
+ if ( !skiplastline ) PIXEL11_61
+ }
+ if ( !skiplastline ) PIXEL10_20
+ break;
+ case 84:
+ case 85:
+ PIXEL00_20
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ PIXEL01_60
+ if ( !skiplastline ) PIXEL11_90
+ }
+ if ( !skiplastline ) PIXEL10_21
+ break;
+ case 112:
+ case 113:
+ PIXEL00_20
+ PIXEL01_22
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_61
+ if ( !skiplastline ) PIXEL11_90
+ }
+ break;
+ case 200:
+ case 204:
+ PIXEL00_21
+ PIXEL01_20
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ if ( !skiplastline ) PIXEL11_11
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_90
+ if ( !skiplastline ) PIXEL11_60
+ }
+ break;
+ case 73:
+ case 77:
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ PIXEL00_12
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ PIXEL00_61
+ if ( !skiplastline ) PIXEL10_90
+ }
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 42:
+ case 170:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ if ( !skiplastline ) PIXEL10_11
+ }
+ else
+ {
+ PIXEL00_90
+ if ( !skiplastline ) PIXEL10_60
+ }
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 14:
+ case 142:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ PIXEL01_12
+ }
+ else
+ {
+ PIXEL00_90
+ PIXEL01_61
+ }
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 67:
+ PIXEL00_11
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 70:
+ PIXEL00_22
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 28:
+ PIXEL00_21
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 152:
+ PIXEL00_21
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 194:
+ PIXEL00_22
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 98:
+ PIXEL00_22
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 56:
+ PIXEL00_21
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 25:
+ PIXEL00_12
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 26:
+ case 31:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 82:
+ case 214:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_21
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 88:
+ case 248:
+ PIXEL00_21
+ PIXEL01_22
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 74:
+ case 107:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_21
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 27:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_10
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 86:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 216:
+ PIXEL00_21
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_10
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 106:
+ PIXEL00_10
+ PIXEL01_21
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 30:
+ PIXEL00_10
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 210:
+ PIXEL00_22
+ PIXEL01_10
+ if ( !skiplastline ) PIXEL10_21
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 120:
+ PIXEL00_21
+ PIXEL01_22
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 75:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_10
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 29:
+ PIXEL00_12
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 198:
+ PIXEL00_22
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 184:
+ PIXEL00_21
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 99:
+ PIXEL00_11
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 57:
+ PIXEL00_12
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 71:
+ PIXEL00_11
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 156:
+ PIXEL00_21
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 226:
+ PIXEL00_22
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 60:
+ PIXEL00_21
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 195:
+ PIXEL00_11
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 102:
+ PIXEL00_22
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 153:
+ PIXEL00_12
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 58:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 83:
+ PIXEL00_11
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_21
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 92:
+ PIXEL00_21
+ PIXEL01_11
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 202:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ PIXEL01_21
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 78:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ PIXEL01_12
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 154:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 114:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_12
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 89:
+ PIXEL00_12
+ PIXEL01_22
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 90:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 55:
+ case 23:
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL00_11
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL00_60
+ PIXEL01_90
+ }
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 182:
+ case 150:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ if ( !skiplastline ) PIXEL11_12
+ }
+ else
+ {
+ PIXEL01_90
+ if ( !skiplastline ) PIXEL11_61
+ }
+ if ( !skiplastline ) PIXEL10_20
+ break;
+ case 213:
+ case 212:
+ PIXEL00_20
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ PIXEL01_60
+ if ( !skiplastline ) PIXEL11_90
+ }
+ if ( !skiplastline ) PIXEL10_21
+ break;
+ case 241:
+ case 240:
+ PIXEL00_20
+ PIXEL01_22
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_61
+ if ( !skiplastline ) PIXEL11_90
+ }
+ break;
+ case 236:
+ case 232:
+ PIXEL00_21
+ PIXEL01_20
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ if ( !skiplastline ) PIXEL11_11
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_90
+ if ( !skiplastline ) PIXEL11_60
+ }
+ break;
+ case 109:
+ case 105:
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ PIXEL00_12
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ PIXEL00_61
+ if ( !skiplastline ) PIXEL10_90
+ }
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 171:
+ case 43:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ if ( !skiplastline ) PIXEL10_11
+ }
+ else
+ {
+ PIXEL00_90
+ if ( !skiplastline ) PIXEL10_60
+ }
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 143:
+ case 15:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ PIXEL01_12
+ }
+ else
+ {
+ PIXEL00_90
+ PIXEL01_61
+ }
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 124:
+ PIXEL00_21
+ PIXEL01_11
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 203:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_10
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 62:
+ PIXEL00_10
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 211:
+ PIXEL00_11
+ PIXEL01_10
+ if ( !skiplastline ) PIXEL10_21
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 118:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 217:
+ PIXEL00_12
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_10
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 110:
+ PIXEL00_10
+ PIXEL01_12
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 155:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_10
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 188:
+ PIXEL00_21
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 185:
+ PIXEL00_12
+ PIXEL01_22
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 61:
+ PIXEL00_12
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 157:
+ PIXEL00_12
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 103:
+ PIXEL00_11
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 227:
+ PIXEL00_11
+ PIXEL01_21
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 230:
+ PIXEL00_22
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 199:
+ PIXEL00_11
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_21
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 220:
+ PIXEL00_21
+ PIXEL01_11
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 158:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 234:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ PIXEL01_21
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 242:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_12
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 59:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 121:
+ PIXEL00_12
+ PIXEL01_22
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 87:
+ PIXEL00_11
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_21
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 79:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_12
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 122:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 94:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 218:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 91:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 229:
+ PIXEL00_20
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 167:
+ PIXEL00_11
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 173:
+ PIXEL00_12
+ PIXEL01_20
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 181:
+ PIXEL00_20
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 186:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 115:
+ PIXEL00_11
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_12
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 93:
+ PIXEL00_12
+ PIXEL01_11
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 206:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ PIXEL01_12
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 205:
+ case 201:
+ PIXEL00_12
+ PIXEL01_20
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_70
+ }
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 174:
+ case 46:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_10
+ }
+ else
+ {
+ PIXEL00_70
+ }
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 179:
+ case 147:
+ PIXEL00_11
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_10
+ }
+ else
+ {
+ PIXEL01_70
+ }
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 117:
+ case 116:
+ PIXEL00_20
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_12
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_10
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_70
+ }
+ break;
+ case 189:
+ PIXEL00_12
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 231:
+ PIXEL00_11
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 126:
+ PIXEL00_10
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 219:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_10
+ if ( !skiplastline ) PIXEL10_10
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 125:
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ PIXEL00_12
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ PIXEL00_61
+ if ( !skiplastline ) PIXEL10_90
+ }
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 221:
+ PIXEL00_12
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ PIXEL01_60
+ if ( !skiplastline ) PIXEL11_90
+ }
+ if ( !skiplastline ) PIXEL10_10
+ break;
+ case 207:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ PIXEL01_12
+ }
+ else
+ {
+ PIXEL00_90
+ PIXEL01_61
+ }
+ if ( !skiplastline ) PIXEL10_10
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 238:
+ PIXEL00_10
+ PIXEL01_12
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ if ( !skiplastline ) PIXEL11_11
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_90
+ if ( !skiplastline ) PIXEL11_60
+ }
+ break;
+ case 190:
+ PIXEL00_10
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ if ( !skiplastline ) PIXEL11_12
+ }
+ else
+ {
+ PIXEL01_90
+ if ( !skiplastline ) PIXEL11_61
+ }
+ if ( !skiplastline ) PIXEL10_11
+ break;
+ case 187:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ if ( !skiplastline ) PIXEL10_11
+ }
+ else
+ {
+ PIXEL00_90
+ if ( !skiplastline ) PIXEL10_60
+ }
+ PIXEL01_10
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 243:
+ PIXEL00_11
+ PIXEL01_10
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_61
+ if ( !skiplastline ) PIXEL11_90
+ }
+ break;
+ case 119:
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL00_11
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL00_60
+ PIXEL01_90
+ }
+ if ( !skiplastline ) PIXEL10_12
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 237:
+ case 233:
+ PIXEL00_12
+ PIXEL01_20
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_100
+ }
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 175:
+ case 47:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_100
+ }
+ PIXEL01_12
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_20
+ break;
+ case 183:
+ case 151:
+ PIXEL00_11
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_100
+ }
+ if ( !skiplastline ) PIXEL10_20
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 245:
+ case 244:
+ PIXEL00_20
+ PIXEL01_11
+ if ( !skiplastline ) PIXEL10_12
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_100
+ }
+ break;
+ case 250:
+ PIXEL00_10
+ PIXEL01_10
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 123:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_10
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 95:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_10
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 222:
+ PIXEL00_10
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_10
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 252:
+ PIXEL00_21
+ PIXEL01_11
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_100
+ }
+ break;
+ case 249:
+ PIXEL00_12
+ PIXEL01_22
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_100
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 235:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_21
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_100
+ }
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 111:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_100
+ }
+ PIXEL01_12
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_22
+ break;
+ case 63:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_100
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_21
+ break;
+ case 159:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_100
+ }
+ if ( !skiplastline ) PIXEL10_22
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 215:
+ PIXEL00_11
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_100
+ }
+ if ( !skiplastline ) PIXEL10_21
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 246:
+ PIXEL00_22
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( !skiplastline ) PIXEL10_12
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_100
+ }
+ break;
+ case 254:
+ PIXEL00_10
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_100
+ }
+ break;
+ case 253:
+ PIXEL00_12
+ PIXEL01_11
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_100
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_100
+ }
+ break;
+ case 251:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ PIXEL01_10
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_100
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 239:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_100
+ }
+ PIXEL01_12
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_100
+ }
+ if ( !skiplastline ) PIXEL11_11
+ break;
+ case 127:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_100
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_20
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_20
+ }
+ if ( !skiplastline ) PIXEL11_10
+ break;
+ case 191:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_100
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_100
+ }
+ if ( !skiplastline ) PIXEL10_11
+ if ( !skiplastline ) PIXEL11_12
+ break;
+ case 223:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_20
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_100
+ }
+ if ( !skiplastline ) PIXEL10_10
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_20
+ }
+ break;
+ case 247:
+ PIXEL00_11
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_100
+ }
+ if ( !skiplastline ) PIXEL10_12
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_100
+ }
+ break;
+ case 255:
+ if ( diffYUV( YUV( 4 ), YUV( 2 ) ) )
+ {
+ PIXEL00_0
+ }
+ else
+ {
+ PIXEL00_100
+ }
+ if ( diffYUV( YUV( 2 ), YUV( 6 ) ) )
+ {
+ PIXEL01_0
+ }
+ else
+ {
+ PIXEL01_100
+ }
+ if ( diffYUV( YUV( 8 ), YUV( 4 ) ) )
+ {
+ if ( !skiplastline ) PIXEL10_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL10_100
+ }
+ if ( diffYUV( YUV( 6 ), YUV( 8 ) ) )
+ {
+ if ( !skiplastline ) PIXEL11_0
+ }
+ else
+ {
+ if ( !skiplastline ) PIXEL11_100
+ }
+ break;
+ }
+}
+
+/* --------------------------------------------------------------------------- */
+
+void InitLUT()
+{
+ int r, g, b;
+ int Y, u, v;
+ int color;
+
+ // Allocate the YUV/LUT buffers on the fly if needed.
+ if ( RGBtoYUV == 0 ) RGBtoYUV = ( uint32_t * )malloc( 65536 * sizeof( uint32_t ) );
+
+ if ( LUT16to32 == 0 ) LUT16to32 = ( uint32_t * )malloc( 65536 * sizeof( uint32_t ) );
+
+ for ( color = 0; color < 65536; ++color )
+ {
+ r = (( color & sys_pixel_format->Rmask ) >> sys_pixel_format->Rshift ) << sys_pixel_format->Rloss;
+ g = (( color & sys_pixel_format->Gmask ) >> sys_pixel_format->Gshift ) << sys_pixel_format->Gloss;
+ b = (( color & sys_pixel_format->Bmask ) >> sys_pixel_format->Bshift ) << sys_pixel_format->Bloss;
+ LUT16to32[color] = ( r << 16 ) | ( g << 8 ) | b;
+
+ Y = ( r + g + b ) >> 2;
+ u = 128 + (( r - b ) >> 2 );
+ v = 128 + (( -r + 2 * g - b ) >> 3 );
+ RGBtoYUV[color] = ( Y << 16 ) | ( u << 8 ) | v;
+ }
+}
+
+/* --------------------------------------------------------------------------- */
+
+void hq2x( uint8_t *srcPtr, uint32_t srcPitch, uint8_t *dstPtr, uint32_t dstPitch, int width, int height )
+{
+ register int w1, w2, w3, w4, w5, w6, w7, w8, w9;
+
+ const uint32_t nextlineSrc = srcPitch / sizeof( uint16_t );
+ uint16_t *p = ( uint16_t * )srcPtr;
+ const uint32_t nextlineDst = dstPitch / sizeof( uint16_t );
+ uint16_t *q = ( uint16_t * )dstPtr;
+
+ int tmpWidth;
+
+ if ( !hq2xinited )
+ {
+ InitLUT();
+ hq2xinited = 1;
+ }
+
+ // +----+----+----+
+ // | | | |
+ // | w1 | w2 | w3 |
+ // +----+----+----+
+ // | | | |
+ // | w4 | w5 | w6 |
+ // +----+----+----+
+ // | | | |
+ // | w7 | w8 | w9 |
+ // +----+----+----+
+
+
+ /********************* Primera fila **************************/
+ w1 = 0; w4 = 0; w7 = 0;
+ w2 = 0; w5 = *( p ); w8 = *( p + nextlineSrc );
+
+ tmpWidth = width - 1;
+ while ( tmpWidth-- )
+ {
+ p++;
+
+ w3 = 0; w6 = *( p ); w9 = *( p + nextlineSrc );
+
+ hq2x_main( w1, w2, w3, w4, w5, w6, w7, w8, w9, nextlineSrc, nextlineDst, p, q, 0 );
+
+ w1 = w2; w4 = w5; w7 = w8;
+ w2 = w3; w5 = w6; w8 = w9;
+
+ q += 2;
+ }
+
+ /* Ultima columna de la primera fila */
+ p++;
+
+ w3 = 0; w6 = 0; w9 = 0;
+
+ hq2x_main( w1, w2, w3, w4, w5, w6, w7, w8, w9, nextlineSrc, nextlineDst, p, q, 0 );
+
+ w1 = w2; w4 = w5; w7 = w8;
+ w2 = w3; w5 = w6; w8 = w9;
+
+ q += 2;
+
+ /* Proxima linea */
+ p += nextlineSrc - width;
+ q += ( nextlineDst - width ) * 2;
+
+ height -= 2;
+
+ /********************* cuerpo principal **************************/
+
+ while ( height-- )
+ {
+// w1 = *(p - 1 - nextlineSrc); w4 = *(p - 1); w7 = *(p - 1 + nextlineSrc);
+ w1 = 0; w4 = 0; w7 = 0;
+ w2 = *( p - nextlineSrc ); w5 = *( p ); w8 = *( p + nextlineSrc );
+
+ tmpWidth = width - 1;
+ while ( tmpWidth-- )
+ {
+ p++;
+
+ w3 = *( p - nextlineSrc ); w6 = *( p ); w9 = *( p + nextlineSrc );
+
+ hq2x_main( w1, w2, w3, w4, w5, w6, w7, w8, w9, nextlineSrc, nextlineDst, p, q, 0 );
+
+ w1 = w2; w4 = w5; w7 = w8;
+ w2 = w3; w5 = w6; w8 = w9;
+
+ q += 2;
+ }
+
+ /* Ultima columna de la fila N */
+ p++;
+
+ w3 = 0; w6 = 0; w9 = 0;
+
+ hq2x_main( w1, w2, w3, w4, w5, w6, w7, w8, w9, nextlineSrc, nextlineDst, p, q, 0 );
+
+ w1 = w2; w4 = w5; w7 = w8;
+ w2 = w3; w5 = w6; w8 = w9;
+
+ q += 2;
+
+ p += nextlineSrc - width;
+ q += ( nextlineDst - width ) * 2;
+ }
+
+ /********************* ultima linea **************************/
+
+ w1 = 0; w4 = 0; w7 = 0;
+ w2 = *( p - nextlineSrc ); w5 = *( p ); w8 = 0;
+
+ tmpWidth = width - 1;
+ while ( tmpWidth-- )
+ {
+ p++;
+
+ w3 = *( p - nextlineSrc ); w6 = *( p ); w9 = 0;
+
+ hq2x_main( w1, w2, w3, w4, w5, w6, w7, w8, w9, nextlineSrc, nextlineDst, p, q, 0 );
+
+ w1 = w2; w4 = w5; w7 = w8;
+ w2 = w3; w5 = w6; w8 = w9;
+
+ q += 2;
+ }
+
+ /* Ultima columna de la utima fila */
+ p++;
+
+ w3 = 0; w6 = 0; w9 = 0;
+
+ hq2x_main( w1, w2, w3, w4, w5, w6, w7, w8, w9, nextlineSrc, nextlineDst, p, q, 1 );
+}
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/librender/scaler_hq2x.h b/modules/librender/scaler_hq2x.h
new file mode 100644
index 0000000..2570738
--- /dev/null
+++ b/modules/librender/scaler_hq2x.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __SCALER_HQ2X_H
+#define __SCALER_HQ2X_H
+
+/* Rutinas del ScummVM's HQ2x algorithm */
+
+extern void hq2x( uint8_t *srcPtr, uint32_t srcPitch, uint8_t *dstPtr, uint32_t dstPitch, int width, int height );
+
+#define SCALE_HQ2X 0x0002
+
+#endif
diff --git a/modules/librender/scaler_normal.c b/modules/librender/scaler_normal.c
new file mode 100644
index 0000000..e6734ed
--- /dev/null
+++ b/modules/librender/scaler_normal.c
@@ -0,0 +1,61 @@
+/*
+ * Copyright � 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright � 2002-2006 Fenix Team (Fenix)
+ * Copyright � 1999-2002 Jos� Luis Cebri�n Pag�e (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+/* By Splinter 2007 */
+
+/* --------------------------------------------------------------------------- */
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+
+void scale_normal2x( uint8_t *srcPtr, uint32_t srcPitch, uint8_t *dstPtr, uint32_t dstPitch, int width, int height )
+{
+ const uint32_t nextlineSrc = srcPitch / sizeof( uint16_t );
+ const uint16_t *p = ( const uint16_t * )srcPtr;
+
+ const uint32_t nextlineDst = dstPitch / sizeof( uint16_t );
+ uint16_t *q = ( uint16_t * )dstPtr;
+
+ while ( height-- )
+ {
+ int tmpWidth = width;
+ while ( tmpWidth-- )
+ {
+ *( q + nextlineDst ) = *q = *p;
+ q++;
+ *( q + nextlineDst ) = *q = *p;
+ q++;
+ p++;
+ }
+ p += nextlineSrc - width;
+ q += ( nextlineDst - width ) * 2;
+ }
+}
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/librender/scaler_normal.h b/modules/librender/scaler_normal.h
new file mode 100644
index 0000000..dcaf3ed
--- /dev/null
+++ b/modules/librender/scaler_normal.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __SCALER_NORMAL2X_H
+#define __SCALER_NORMAL2X_H
+
+extern void scale_normal2x( uint8_t *srcPtr, uint32_t srcPitch, uint8_t *dstPtr, uint32_t dstPitch, int width, int height );
+
+#define SCALE_NOFILTER 0x0004
+
+#endif
diff --git a/modules/librender/scaler_scale2x.c b/modules/librender/scaler_scale2x.c
new file mode 100644
index 0000000..992dc3f
--- /dev/null
+++ b/modules/librender/scaler_scale2x.c
@@ -0,0 +1,159 @@
+/*
+ * Copyright © 2001, 2002, 2003, 2004 Andrea Mazzoleni
+ *
+ * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+/*
+ * You can find an high level description of the effect at :
+ *
+ * http://scale2x.sourceforge.net/scale2x.html
+ *
+ * Alternatively at the previous license terms, you are allowed to use this
+ * code in your program with these conditions:
+ * - the program is not used in commercial activities.
+ * - the whole source code of the program is released with the binary.
+ * - derivative works of the program are allowed.
+ */
+
+/* --------------------------------------------------------------------------- */
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+
+static void internal_scale2x_16_def( uint16_t *dst0, uint16_t* dst1, const uint16_t* src0, const uint16_t* src1, const uint16_t* src2, unsigned count )
+{
+ /* first pixel */
+ dst0[0] = src1[0];
+ dst1[0] = src1[0];
+
+ if ( src1[1] == src0[0] && src2[0] != src0[0] )
+ dst0[1] = src0[0];
+ else
+ dst0[1] = src1[0];
+
+ if ( src1[1] == src2[0] && src0[0] != src2[0] )
+ dst1[1] = src2[0];
+ else
+ dst1[1] = src1[0];
+
+ ++src0;
+ ++src1;
+ ++src2;
+
+ dst0 += 2;
+ dst1 += 2;
+
+ /* central pixels */
+ count -= 2;
+ while ( count )
+ {
+ if ( src1[-1] == src0[0] && src2[0] != src0[0] && src1[1] != src0[0] )
+ dst0[0] = src0[0];
+ else
+ dst0[0] = src1[0];
+
+ if ( src1[1] == src0[0] && src2[0] != src0[0] && src1[-1] != src0[0] )
+ dst0[1] = src0[0];
+ else
+ dst0[1] = src1[0];
+
+ if ( src1[-1] == src2[0] && src0[0] != src2[0] && src1[1] != src2[0] )
+ dst1[0] = src2[0];
+ else
+ dst1[0] = src1[0];
+
+ if ( src1[1] == src2[0] && src0[0] != src2[0] && src1[-1] != src2[0] )
+ dst1[1] = src2[0];
+ else
+ dst1[1] = src1[0];
+
+ ++src0;
+ ++src1;
+ ++src2;
+
+ dst0 += 2;
+ dst1 += 2;
+
+ --count;
+ }
+
+ /* last pixel */
+ if ( src1[-1] == src0[0] && src2[0] != src0[0] )
+ dst0[0] = src0[0];
+ else
+ dst0[0] = src1[0];
+
+ if ( src1[-1] == src2[0] && src0[0] != src2[0] )
+ dst1[0] = src2[0];
+ else
+ dst1[0] = src1[0];
+
+ dst0[1] = src1[0];
+ dst1[1] = src1[0];
+}
+
+/* --------------------------------------------------------------------------- */
+
+void scale2x( uint8_t *srcPtr, uint32_t srcPitch, uint8_t *dstPtr, uint32_t dstPitch, int width, int height )
+{
+ uint16_t *dst0 = ( uint16_t * )dstPtr;
+ uint16_t *dst1 = dst0 + ( dstPitch / 2 );
+
+ uint16_t *src0 = ( uint16_t * )srcPtr;
+ uint16_t *src1 = src0 + ( srcPitch / 2 );
+ uint16_t *src2 = src1 + ( srcPitch / 2 );
+
+ int count;
+
+ internal_scale2x_16_def( dst0, dst1, src0, src0, src1, width );
+
+ count = height;
+
+ count -= 2;
+ while ( count )
+ {
+ dst0 += dstPitch;
+ dst1 += dstPitch;
+
+ internal_scale2x_16_def( dst0, dst1, src0, src1, src2, width );
+
+ src0 = src1;
+ src1 = src2;
+ src2 += srcPitch / 2;
+
+ --count;
+ }
+ dst0 += dstPitch;
+ dst1 += dstPitch;
+
+ internal_scale2x_16_def( dst0, dst1, src0, src1, src1, width );
+}
+
+/* --------------------------------------------------------------------------- */
+
diff --git a/modules/librender/scaler_scale2x.h b/modules/librender/scaler_scale2x.h
new file mode 100644
index 0000000..0a43797
--- /dev/null
+++ b/modules/librender/scaler_scale2x.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __SCALER_SCALE2X_H
+#define __SCALER_SCALE2X_H
+
+/* Rutinas del Mame's 2xScale algorithm */
+
+extern void scale2x( uint8_t *srcPtr, uint32_t srcPitch, uint8_t *dstPtr, uint32_t dstPitch, int width, int height );
+
+#endif
diff --git a/modules/librender/scaler_scanline.c b/modules/librender/scaler_scanline.c
new file mode 100644
index 0000000..93242f2
--- /dev/null
+++ b/modules/librender/scaler_scanline.c
@@ -0,0 +1,65 @@
+/*
+ * Copyright © 2006-2016 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+/* By Splinter 2007 */
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+
+/* --------------------------------------------------------------------------- */
+
+#include "librender.h"
+
+/* --------------------------------------------------------------------------- */
+
+void scanline2x( uint8_t *srcPtr, uint32_t srcPitch, uint8_t *dstPtr, uint32_t dstPitch, int width, int height )
+{
+ const uint32_t nextlineSrc = srcPitch / sizeof( uint16_t );
+ const uint16_t *p = ( const uint16_t * )srcPtr;
+
+ const uint32_t nextlineDst = dstPitch / sizeof( uint16_t );
+ uint16_t *q = ( uint16_t * )dstPtr;
+
+ while ( height-- )
+ {
+ int tmpWidth = width;
+ while ( tmpWidth-- )
+ {
+ *q = *p;
+ *( q + nextlineDst ) = 0;
+ q++;
+ *q = *p;
+ *( q + nextlineDst ) = 0;
+ q++;
+ p++;
+ }
+ p += nextlineSrc - width;
+ q += ( nextlineDst - width ) * 2;
+ }
+}
diff --git a/modules/librender/scaler_scanline.h b/modules/librender/scaler_scanline.h
new file mode 100644
index 0000000..480a68c
--- /dev/null
+++ b/modules/librender/scaler_scanline.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright © 2006-2013 SplinterGU (Fenix/Bennugd)
+ * Copyright © 2002-2006 Fenix Team (Fenix)
+ * Copyright © 1999-2002 José Luis Cebrián Pagüe (Fenix)
+ *
+ * This file is part of Bennu - Game Development
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ * claim that you wrote the original software. If you use this software
+ * in a product, an acknowledgment in the product documentation would be
+ * appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ * misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *
+ */
+
+#ifndef __SCALER_SCANLINE2X_H
+#define __SCALER_SCANLINE2X_H
+
+extern void scanline2x( uint8_t *srcPtr, uint32_t srcPitch, uint8_t *dstPtr, uint32_t dstPitch, int width, int height );
+
+#define SCALE_SCANLINE2X 0x0003
+
+#endif