aboutsummaryrefslogtreecommitdiff
path: root/modules/libvideo
diff options
context:
space:
mode:
authorneonloop2021-10-20 14:54:27 +0000
committerneonloop2021-10-20 14:54:27 +0000
commitea1947ffcc606d757357398b24e74a3f4ecefa07 (patch)
tree2031b8d4fc4c61063c710a7148378f57e662efbd /modules/libvideo
downloadbennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.tar.gz
bennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.tar.bz2
bennugd-ea1947ffcc606d757357398b24e74a3f4ecefa07.zip
Initial commit from steward-fu releasemain
Diffstat (limited to 'modules/libvideo')
-rw-r--r--modules/libvideo/Makefile618
-rw-r--r--modules/libvideo/Makefile.am14
-rw-r--r--modules/libvideo/Makefile.in618
-rw-r--r--modules/libvideo/g_regions.c211
-rw-r--r--modules/libvideo/g_regions.h52
-rw-r--r--modules/libvideo/g_video.c601
-rw-r--r--modules/libvideo/g_video.h114
-rw-r--r--modules/libvideo/libvideo.h36
-rw-r--r--modules/libvideo/libvideo_exports.h121
9 files changed, 2385 insertions, 0 deletions
diff --git a/modules/libvideo/Makefile b/modules/libvideo/Makefile
new file mode 100644
index 0000000..dd05d0d
--- /dev/null
+++ b/modules/libvideo/Makefile
@@ -0,0 +1,618 @@
+# Makefile.in generated by automake 1.12.1 from Makefile.am.
+# libvideo/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 = libvideo
+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 =
+libvideo_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_libvideo_la_OBJECTS = libvideo_la-g_video.lo \
+ libvideo_la-g_regions.lo
+libvideo_la_OBJECTS = $(am_libvideo_la_OBJECTS)
+libvideo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libvideo_la_CFLAGS) \
+ $(CFLAGS) $(libvideo_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 = $(libvideo_la_SOURCES)
+DIST_SOURCES = $(libvideo_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/libvideo
+abs_srcdir = /home/steward/Github/miyoo_src/bennugd/modules/libvideo
+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 = libvideo.la
+libvideo_la_SOURCES = g_video.c g_regions.c
+libvideo_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include -I$(BGD_PATH)/bgdrtm/include -I. -I../libgrbase/
+libvideo_la_LDFLAGS = -s -module -no-undefined -avoid-version
+libvideo_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm -L../libgrbase/.libs -lgrbase
+CLEANFILES = libvideo.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 libvideo/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu libvideo/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}; \
+ }
+libvideo.la: $(libvideo_la_OBJECTS) $(libvideo_la_DEPENDENCIES) $(EXTRA_libvideo_la_DEPENDENCIES)
+ $(libvideo_la_LINK) -rpath $(libdir) $(libvideo_la_OBJECTS) $(libvideo_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+include ./$(DEPDIR)/libvideo_la-g_regions.Plo
+include ./$(DEPDIR)/libvideo_la-g_video.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 $@ $<
+
+libvideo_la-g_video.lo: g_video.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvideo_la_CFLAGS) $(CFLAGS) -MT libvideo_la-g_video.lo -MD -MP -MF $(DEPDIR)/libvideo_la-g_video.Tpo -c -o libvideo_la-g_video.lo `test -f 'g_video.c' || echo '$(srcdir)/'`g_video.c
+ $(am__mv) $(DEPDIR)/libvideo_la-g_video.Tpo $(DEPDIR)/libvideo_la-g_video.Plo
+# source='g_video.c' object='libvideo_la-g_video.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvideo_la_CFLAGS) $(CFLAGS) -c -o libvideo_la-g_video.lo `test -f 'g_video.c' || echo '$(srcdir)/'`g_video.c
+
+libvideo_la-g_regions.lo: g_regions.c
+ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvideo_la_CFLAGS) $(CFLAGS) -MT libvideo_la-g_regions.lo -MD -MP -MF $(DEPDIR)/libvideo_la-g_regions.Tpo -c -o libvideo_la-g_regions.lo `test -f 'g_regions.c' || echo '$(srcdir)/'`g_regions.c
+ $(am__mv) $(DEPDIR)/libvideo_la-g_regions.Tpo $(DEPDIR)/libvideo_la-g_regions.Plo
+# source='g_regions.c' object='libvideo_la-g_regions.lo' libtool=yes \
+# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \
+# $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvideo_la_CFLAGS) $(CFLAGS) -c -o libvideo_la-g_regions.lo `test -f 'g_regions.c' || echo '$(srcdir)/'`g_regions.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/libvideo/Makefile.am b/modules/libvideo/Makefile.am
new file mode 100644
index 0000000..1a1df73
--- /dev/null
+++ b/modules/libvideo/Makefile.am
@@ -0,0 +1,14 @@
+## Process this file with automake to produce Makefile.in
+
+#AUTOMAKE_OPTIONS = no-dependencies foreign
+
+lib_LTLIBRARIES = libvideo.la
+
+libvideo_la_SOURCES = g_video.c g_regions.c
+libvideo_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include -I$(BGD_PATH)/bgdrtm/include -I. -I../libgrbase/
+libvideo_la_LDFLAGS = -s -module -no-undefined -avoid-version
+libvideo_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm -L../libgrbase/.libs -lgrbase
+
+## Make sure these will be cleaned even when they're not built by
+## default.
+CLEANFILES = libvideo.la
diff --git a/modules/libvideo/Makefile.in b/modules/libvideo/Makefile.in
new file mode 100644
index 0000000..5fcbe49
--- /dev/null
+++ b/modules/libvideo/Makefile.in
@@ -0,0 +1,618 @@
+# 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 = libvideo
+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 =
+libvideo_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
+am_libvideo_la_OBJECTS = libvideo_la-g_video.lo \
+ libvideo_la-g_regions.lo
+libvideo_la_OBJECTS = $(am_libvideo_la_OBJECTS)
+libvideo_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(libvideo_la_CFLAGS) \
+ $(CFLAGS) $(libvideo_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 = $(libvideo_la_SOURCES)
+DIST_SOURCES = $(libvideo_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 = libvideo.la
+libvideo_la_SOURCES = g_video.c g_regions.c
+libvideo_la_CFLAGS = $(COMMON_CFLAGS) $(SDL_CFLAGS) -I$(BGD_PATH)/include -I$(BGD_PATH)/bgdrtm/include -I. -I../libgrbase/
+libvideo_la_LDFLAGS = -s -module -no-undefined -avoid-version
+libvideo_la_LIBADD = $(COMMON_LDFLAGS) $(SDL_LIBS) -L$(BGD_PATH)/bgdrtm/src/.libs -lbgdrtm -L../libgrbase/.libs -lgrbase
+CLEANFILES = libvideo.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 libvideo/Makefile'; \
+ $(am__cd) $(top_srcdir) && \
+ $(AUTOMAKE) --gnu libvideo/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}; \
+ }
+libvideo.la: $(libvideo_la_OBJECTS) $(libvideo_la_DEPENDENCIES) $(EXTRA_libvideo_la_DEPENDENCIES)
+ $(libvideo_la_LINK) -rpath $(libdir) $(libvideo_la_OBJECTS) $(libvideo_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+ -rm -f *.$(OBJEXT)
+
+distclean-compile:
+ -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvideo_la-g_regions.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvideo_la-g_video.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 $@ $<
+
+libvideo_la-g_video.lo: g_video.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvideo_la_CFLAGS) $(CFLAGS) -MT libvideo_la-g_video.lo -MD -MP -MF $(DEPDIR)/libvideo_la-g_video.Tpo -c -o libvideo_la-g_video.lo `test -f 'g_video.c' || echo '$(srcdir)/'`g_video.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libvideo_la-g_video.Tpo $(DEPDIR)/libvideo_la-g_video.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='g_video.c' object='libvideo_la-g_video.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) $(libvideo_la_CFLAGS) $(CFLAGS) -c -o libvideo_la-g_video.lo `test -f 'g_video.c' || echo '$(srcdir)/'`g_video.c
+
+libvideo_la-g_regions.lo: g_regions.c
+@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libvideo_la_CFLAGS) $(CFLAGS) -MT libvideo_la-g_regions.lo -MD -MP -MF $(DEPDIR)/libvideo_la-g_regions.Tpo -c -o libvideo_la-g_regions.lo `test -f 'g_regions.c' || echo '$(srcdir)/'`g_regions.c
+@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libvideo_la-g_regions.Tpo $(DEPDIR)/libvideo_la-g_regions.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='g_regions.c' object='libvideo_la-g_regions.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) $(libvideo_la_CFLAGS) $(CFLAGS) -c -o libvideo_la-g_regions.lo `test -f 'g_regions.c' || echo '$(srcdir)/'`g_regions.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/libvideo/g_regions.c b/modules/libvideo/g_regions.c
new file mode 100644
index 0000000..1b9f496
--- /dev/null
+++ b/modules/libvideo/g_regions.c
@@ -0,0 +1,211 @@
+/*
+ * 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 "libvideo.h"
+
+/* --------------------------------------------------------------------------- */
+/* Gestión de regiones */
+
+REGION regions[ 32 ] ;
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : region_define
+ *
+ * Sets one of the 32 regions visible from the fenix
+ * language to the values given
+ *
+ * The region 0 is always equal to the whole screen
+ * and cannot be changed
+ *
+ * PARAMS :
+ * n Number of region to set (1 to 31)
+ * x, y Top-Left coordinates
+ * width Width in pixels
+ * height Height in pixels
+ *
+ * RETURN VALUE :
+ * None
+ */
+
+void region_define( int region, int x, int y, int width, int height )
+{
+ if ( region < 1 || region > 31 ) return ;
+#if 1
+ regions[ region ].x = x;
+ regions[ region ].y = y ;
+ regions[ region ].x2 = ( x + width ) - 1 ;
+ regions[ region ].y2 = ( y + height ) - 1 ;
+#else
+ regions[ region ].x = MAX( x, 0 ) ;
+ regions[ region ].y = MAX( y, 0 ) ;
+ regions[ region ].x2 = MIN( scr_width, x + width ) - 1 ;
+ regions[ region ].y2 = MIN( scr_height, y + height ) - 1 ;
+#endif
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : region_union
+ *
+ * Calculates a region as the intersection of another two
+ *
+ * PARAMS :
+ * dest First region, and the one to contain the result
+ * b Second region
+ *
+ * RETURN VALUE :
+ * None. The result will be stored in the first region
+ * used as parameter
+ *
+ */
+
+void region_union( REGION * dest, REGION * b )
+{
+ dest->x = MAX( dest->x, b->x ) ;
+ dest->y = MAX( dest->y, b->y ) ;
+ dest->y2 = MIN( dest->y2, b->y2 ) ;
+ dest->x2 = MIN( dest->x2, b->x2 ) ;
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : region_is_empty
+ *
+ * Returns TRUE if the region contains no pixels
+ *
+ * PARAMS :
+ * region Region to check
+ *
+ * RETURN VALUE :
+ * 1 if the region is empty, 0 otherwise
+ *
+ */
+
+int region_is_empty( REGION * a )
+{
+ return ( a->x2 < a->x ) || ( a->y2 < a->y ) ;
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : region_is_out
+ *
+ * Returns TRUE if two regions overlap
+ *
+ * PARAMS :
+ * a First region to check
+ * b Second region to check
+ *
+ * RETURN VALUE :
+ * 1 if there is at least one pixel in both regions, 0 otherwise
+ *
+ */
+
+int region_is_out( REGION * a, REGION * b )
+{
+ return ( b->x > a->x2 || b->y > a->y2 || b->x2 < a->x || b->y2 < a->y );
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : region_new
+ *
+ * Create a new region object. Only rectangular regions
+ * are supported in this library.
+ *
+ * PARAMS :
+ * x, y Coordinates of the top-left pixel
+ * width Width of the region in pixels
+ * height Height of the region in pixels
+ *
+ * RETURN VALUE :
+ * Returns a pointer to the new object
+ *
+ */
+
+REGION * region_new( int x, int y, int width, int height )
+{
+ REGION * region = malloc( sizeof( REGION ) ) ;
+#if 1
+ region->x = x ;
+ region->y = y ;
+ region->x2 = ( x + width ) - 1 ;
+ region->y2 = ( y + height ) - 1 ;
+#else
+ region->x = MAX( x, 0 ) ;
+ region->y = MAX( y, 0 ) ;
+ region->x2 = MIN( scr_width, x + width ) - 1 ;
+ region->y2 = MIN( scr_height, y + height ) - 1 ;
+#endif
+ return region ;
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : region_get
+ *
+ * Returns one of the 32 default regions visible from the fenix language
+ *
+ * PARAMS :
+ * n Number of the region (0-31)
+ *
+ * RETURN VALUE :
+ * Returns the region object
+ *
+ */
+
+REGION * region_get( int n )
+{
+ if ( n < 0 || n > 31 ) return 0 ;
+
+ return &regions[ n ] ;
+}
+
+/* --------------------------------------------------------------------------- */
+/*
+ * FUNCTION : region_destroy
+ *
+ * Free the memory allocated by a region
+ *
+ * PARAMS :
+ * region Pointer to the region object
+ *
+ * RETURN VALUE :
+ * None
+ *
+ */
+
+void region_destroy( REGION * region )
+{
+ free( region );
+}
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/libvideo/g_regions.h b/modules/libvideo/g_regions.h
new file mode 100644
index 0000000..d4cda74
--- /dev/null
+++ b/modules/libvideo/g_regions.h
@@ -0,0 +1,52 @@
+/*
+ * 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 __REGIONS_H
+#define __REGIONS_H
+
+/* --------------------------------------------------------------------------- */
+
+#include "g_region.h"
+
+/* --------------------------------------------------------------------------- */
+
+extern REGION regions[ 32 ] ;
+
+/* --------------------------------------------------------------------------- */
+
+extern void region_define( int region, int x, int y, int width, int height ) ;
+extern void region_union( REGION * a, REGION * b ) ;
+extern int region_is_empty( REGION * a ) ;
+extern int region_is_out( REGION * a, REGION * b ) ;
+extern REGION * region_new( int x, int y, int width, int height );
+extern void region_destroy( REGION * );
+extern REGION * region_get( int n );
+
+/* --------------------------------------------------------------------------- */
+
+#endif
diff --git a/modules/libvideo/g_video.c b/modules/libvideo/g_video.c
new file mode 100644
index 0000000..ac791d9
--- /dev/null
+++ b/modules/libvideo/g_video.c
@@ -0,0 +1,601 @@
+/*
+ * 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 "bgdrtm.h"
+
+#include "bgddl.h"
+#include "dlvaracc.h"
+
+#include "libvideo.h"
+
+#ifdef _WIN32
+#include <initguid.h>
+#include "ddraw.h"
+#endif
+
+/* --------------------------------------------------------------------------- */
+
+GRAPH * icon = NULL ;
+
+SDL_Surface * screen = NULL ;
+SDL_Surface * scale_screen = NULL ;
+
+char * apptitle = NULL ;
+
+int scr_width = 0 ;
+int scr_height = 0 ;
+
+int scr_initialized = 0 ;
+
+int enable_16bits = 0 ;
+int enable_32bits = 0 ;
+int enable_scale = 0 ;
+int full_screen = 0 ;
+int double_buffer = 0 ;
+int hardware_scr = 0 ;
+int grab_input = 0 ;
+int frameless = 0 ;
+int scale_mode = SCALE_NONE ;
+int waitvsync = 0 ;
+
+int scale_resolution = -1 ;
+int * scale_resolution_table_w = NULL;
+int * scale_resolution_table_h = NULL;
+int scale_resolution_aspectratio = 0;
+int scale_resolution_orientation = 0;
+
+int scale_resolution_aspectratio_offx = 0;
+int scale_resolution_aspectratio_offy = 0;
+
+/* --------------------------------------------------------------------------- */
+
+enum {
+ GRAPH_MODE = 0,
+ SCALE_MODE,
+ FULL_SCREEN,
+ SCALE_RESOLUTION,
+ SCALE_RESOLUTION_ASPECTRATIO,
+ SCALE_RESOLUTION_ORIENTATION
+};
+
+/* --------------------------------------------------------------------------- */
+/* Son las variables que se desea acceder. */
+/* El interprete completa esta estructura, si la variable existe. */
+/* (usada en tiempo de ejecucion) */
+
+DLVARFIXUP __bgdexport( libvideo, globals_fixup )[] =
+{
+ /* Nombre de variable global, puntero al dato, tama�o del elemento, cantidad de elementos */
+ { "graph_mode" , NULL, -1, -1 },
+ { "scale_mode" , NULL, -1, -1 },
+ { "full_screen" , NULL, -1, -1 },
+ { "scale_resolution", NULL, -1, -1 },
+
+ /* new vars for use with scale_resolution */
+ { "scale_resolution_aspectratio", NULL, -1, -1 },
+ { "scale_resolution_orientation", NULL, -1, -1 },
+
+ { NULL , NULL, -1, -1 }
+};
+
+/* --------------------------------------------------------------------------- */
+
+#ifdef _WIN32
+/* Based allegro */
+
+LPDIRECTDRAW2 directdraw = NULL;
+DDCAPS ddcaps;
+
+HRESULT WINAPI( *_DirectDrawCreate )( GUID FAR *lpGUID, LPDIRECTDRAW FAR *lplpDD, IUnknown FAR *pUnkOuter );
+
+/* --------------------------------------------------------------------------- */
+
+int init_dx( void )
+{
+ HINSTANCE handle;
+ LPDIRECTDRAW directdraw1;
+ HRESULT hr;
+ LPVOID temp;
+
+ handle = LoadLibrary( "DDRAW.DLL" );
+ if ( handle == NULL ) return -1;
+
+ _DirectDrawCreate = GetProcAddress( handle, "DirectDrawCreate" );
+
+ hr = _DirectDrawCreate( NULL, &directdraw1, NULL );
+ if ( FAILED( hr ) ) return -1;
+
+ hr = IDirectDraw_QueryInterface( directdraw1, &IID_IDirectDraw2, &directdraw );
+ if ( FAILED( hr ) ) return -1;
+
+ IDirectDraw_Release( directdraw1 );
+
+ hr = IDirectDraw2_SetCooperativeLevel( directdraw, NULL, DDSCL_NORMAL );
+ if ( FAILED( hr ) ) return -1;
+
+ /* get capabilities */
+ ddcaps.dwSize = sizeof( ddcaps );
+ hr = IDirectDraw2_GetCaps( directdraw, &ddcaps, NULL );
+ if ( FAILED( hr ) ) return -1;
+
+ return 0;
+}
+#endif
+
+/* --------------------------------------------------------------------------- */
+
+void gr_wait_vsync()
+{
+#ifdef _WIN32
+ if ( directdraw ) IDirectDraw2_WaitForVerticalBlank( directdraw, DDWAITVB_BLOCKBEGIN, NULL );
+#endif
+}
+
+/* --------------------------------------------------------------------------- */
+
+void gr_set_caption( char * title )
+{
+ SDL_WM_SetCaption( apptitle = title, "" ) ;
+}
+
+/* --------------------------------------------------------------------------- */
+
+int gr_set_icon( GRAPH * map )
+{
+ if (( icon = map ))
+ {
+ SDL_Surface *ico = NULL;
+ if ( icon->format->depth == 8 )
+ {
+ SDL_Color palette[256];
+ if ( sys_pixel_format && sys_pixel_format->palette )
+ {
+ int n ;
+ 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;
+ }
+ }
+
+ ico = SDL_CreateRGBSurfaceFrom( icon->data, 32, 32, 8, 32, 0x00, 0x00, 0x00, 0x00 ) ;
+ SDL_SetPalette( ico, SDL_LOGPAL, palette, 0, 256 );
+ }
+ else
+ {
+ ico = SDL_CreateRGBSurfaceFrom( icon->data, 32, 32, icon->format->depth, icon->pitch, icon->format->Rmask, icon->format->Gmask, icon->format->Bmask, icon->format->Amask ) ;
+ }
+
+ SDL_SetColorKey( ico, SDL_SRCCOLORKEY, SDL_MapRGB( ico->format, 0, 0, 0 ) ) ;
+ SDL_WM_SetIcon( ico, NULL );
+ SDL_FreeSurface( ico ) ;
+ }
+
+ return 1 ;
+}
+
+/* --------------------------------------------------------------------------- */
+
+int gr_set_mode( int width, int height, int depth )
+{
+ int n ;
+ int sdl_flags = 0;
+ int surface_width = width;
+ int surface_height = height;
+ char * e;
+
+ enable_scale = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_2XSCALE ) ? 1 : 0 ;
+ full_screen = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_FULLSCREEN ) ? 1 : 0 ;
+ double_buffer = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_DOUBLEBUFFER ) ? 1 : 0 ;
+ hardware_scr = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_HARDWARE ) ? 1 : 0 ;
+ grab_input = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_MODAL ) ? 1 : 0 ;
+ frameless = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_FRAMELESS ) ? 1 : 0 ;
+ waitvsync = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_WAITVSYNC ) ? 1 : 0 ;
+ scale_mode = GLODWORD( libvideo, SCALE_MODE );
+ full_screen |= GLODWORD( libvideo, FULL_SCREEN );
+
+ scale_resolution = GLODWORD( libvideo, SCALE_RESOLUTION );
+
+ if ( GLOEXISTS( libvideo, SCALE_RESOLUTION_ASPECTRATIO ) ) scale_resolution_aspectratio = GLODWORD( libvideo, SCALE_RESOLUTION_ASPECTRATIO );
+ if ( GLOEXISTS( libvideo, SCALE_RESOLUTION_ORIENTATION ) ) scale_resolution_orientation = GLODWORD( libvideo, SCALE_RESOLUTION_ORIENTATION );
+
+ /* Overwrite all params */
+
+ if ( ( e = getenv( "SCALE_RESOLUTION" ) ) ) scale_resolution = atol( e );
+ if ( ( e = getenv( "SCALE_RESOLUTION_ASPECTRATIO" ) ) ) scale_resolution_aspectratio = atol( e );
+ if ( ( e = getenv( "SCALE_RESOLUTION_ORIENTATION" ) ) ) scale_resolution_orientation = atol( e );
+
+ if ( scale_resolution_orientation < 0 || scale_resolution_orientation > 4 ) scale_resolution_orientation = 0;
+
+ if ( !depth )
+ {
+ enable_32bits = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_32BITS ) ? 1 : 0 ;
+ if ( !enable_32bits )
+ enable_16bits = ( GLODWORD( libvideo, GRAPH_MODE ) & MODE_16BITS ) ? 1 : 0 ;
+ else
+ enable_16bits = 0;
+ depth = enable_32bits ? 32 : ( enable_16bits ? 16 : 8 );
+ }
+ else if ( depth == 16 )
+ {
+ enable_16bits = 1;
+ enable_32bits = 0;
+ }
+ else if ( depth == 32 )
+ {
+ enable_16bits = 0;
+ enable_32bits = 1;
+ }
+
+ if ( scale_resolution_table_w )
+ {
+ free( scale_resolution_table_w );
+ scale_resolution_table_w = NULL;
+ }
+
+ if ( scale_resolution_table_h )
+ {
+ free( scale_resolution_table_h );
+ scale_resolution_table_h = NULL;
+ }
+
+ if ( scale_resolution != -1 )
+ {
+ surface_width = scale_resolution / 10000 ;
+ surface_height = scale_resolution % 10000 ;
+ }
+ else
+ {
+ if ( scale_mode != SCALE_NONE ) enable_scale = 1;
+ if ( enable_scale && scale_mode == SCALE_NONE ) scale_mode = SCALE_SCALE2X;
+
+ if ( enable_scale )
+ {
+ enable_16bits = 1;
+ depth = 16;
+
+ surface_width *= 2;
+ surface_height *= 2;
+ }
+ }
+
+ /* Inicializa el modo gr�fico */
+
+ if ( scrbitmap )
+ {
+ bitmap_destroy( scrbitmap ) ;
+ scrbitmap = NULL ;
+ }
+
+ /* Setup the SDL Video Mode */
+
+ sdl_flags = SDL_HWPALETTE;
+ if ( double_buffer ) sdl_flags |= SDL_DOUBLEBUF;
+ if ( full_screen ) sdl_flags |= SDL_FULLSCREEN;
+ if ( frameless ) sdl_flags |= SDL_NOFRAME;
+
+ sdl_flags |= hardware_scr ? SDL_HWSURFACE : SDL_SWSURFACE;
+
+ if ( scale_screen )
+ {
+ SDL_FreeSurface( scale_screen );
+ scale_screen = NULL;
+ }
+ if ( screen )
+ {
+ SDL_FreeSurface( screen );
+ screen = NULL;
+ }
+
+ if ( scale_resolution != -1 )
+ {
+ switch ( scale_resolution_orientation )
+ {
+ case SRO_LEFT:
+ case SRO_RIGHT:
+ {
+ int aux = surface_width;
+ surface_width = surface_height;
+ surface_height = aux;
+ break;
+ }
+ }
+
+ scale_screen = SDL_SetVideoMode( surface_width, surface_height, depth, sdl_flags );
+
+ if ( !scale_screen ) return -1;
+
+ if ( !width && !height )
+ {
+ width = scale_screen->w;
+ height = scale_screen->h;
+ }
+
+ screen = SDL_CreateRGBSurface( sdl_flags,
+ width,
+ height,
+ scale_screen->format->BitsPerPixel,
+ scale_screen->format->Rmask,
+ scale_screen->format->Gmask,
+ scale_screen->format->Bmask,
+ scale_screen->format->Amask
+ );
+
+ /* scale tables */
+
+ int lim_w = 0, lim_h = 0, pitch_w = 0, pitch_h = 0;
+ double fw = 0.0, fh = 0.0, fx = 0.0, fy = 0.0;
+ int h, w;
+ int start_w = 0, start_h = 0, fix = 1;
+
+ scale_resolution_aspectratio_offx = 0;
+ scale_resolution_aspectratio_offy = 0;
+
+ switch ( scale_resolution_orientation )
+ {
+ case SRO_NORMAL:
+ case SRO_DOWN:
+ lim_w = screen->w;
+ lim_h = screen->h;
+
+ pitch_w = 1;
+ pitch_h = screen->pitch;
+
+ fw = (double)screen->w / (double)scale_screen->w;
+ fh = (double)screen->h / (double)scale_screen->h;
+ break;
+
+ case SRO_LEFT:
+ case SRO_RIGHT:
+ lim_w = screen->h;
+ lim_h = screen->w;
+
+ pitch_w = screen->pitch;
+ pitch_h = 1;
+
+ fh = (double)screen->w / (double)scale_screen->h;
+ fw = (double)screen->h / (double)scale_screen->w;
+ break;
+ }
+
+ switch ( scale_resolution_orientation )
+ {
+ case SRO_NORMAL:
+ case SRO_LEFT:
+ start_w = 0;
+ start_h = 0;
+ fix = -1;
+ break;
+
+ case SRO_DOWN:
+ case SRO_RIGHT:
+ start_w = scale_screen->w - 1;
+ start_h = scale_screen->h - 1;
+ fix = 1;
+ break;
+ }
+
+ if ( scale_resolution_aspectratio == SRA_PRESERVE )
+ {
+ if ( scale_screen->w > scale_screen->h )
+ {
+ fw = fh;
+ scale_resolution_aspectratio_offx = ( scale_screen->w - lim_w / fw ) / 2 ;
+ scale_resolution_aspectratio_offy = 0;
+ }
+ else
+ {
+ fh = fw;
+ scale_resolution_aspectratio_offx = 0;
+ scale_resolution_aspectratio_offy = ( scale_screen->h - lim_h / fh ) / 2 ;
+ }
+ }
+
+ if ( !( scale_resolution_table_w = malloc( scale_screen->w * sizeof( int ) ) ) ) return -1;
+ if ( !( scale_resolution_table_h = malloc( scale_screen->h * sizeof( int ) ) ) ) return -1;
+
+ for ( w = 0; w < scale_screen->w; w++ )
+ {
+ if ( w < scale_resolution_aspectratio_offx )
+ scale_resolution_table_w[ start_w - w * fix ] = -1;
+ else
+ {
+ scale_resolution_table_w[ start_w - w * fix ] = ( fx < lim_w ) ? pitch_w * ( int ) fx : -1 ;
+ fx += fw;
+ }
+ }
+
+ for ( h = 0; h < scale_screen->h; h++ )
+ {
+ if ( h < scale_resolution_aspectratio_offy )
+ scale_resolution_table_h[ start_h - h * fix ] = -1;
+ else
+ {
+ scale_resolution_table_h[ start_h - h * fix ] = ( fy < lim_h ) ? pitch_h * ( int ) fy : -1 ;
+ fy += fh;
+ }
+ }
+ }
+ else
+ {
+ screen = SDL_SetVideoMode( surface_width, surface_height, depth, sdl_flags );
+ }
+
+ if ( !screen ) return -1;
+
+ SDL_WM_GrabInput( grab_input ? SDL_GRAB_ON : SDL_GRAB_OFF ) ;
+
+ /* Set window title */
+ gr_set_caption( apptitle ) ;
+
+ if ( !sys_pixel_format )
+ {
+ sys_pixel_format = bitmap_create_format( depth );
+ }
+ else
+ {
+ PALETTE * p = sys_pixel_format->palette;
+
+ free( sys_pixel_format );
+ sys_pixel_format = bitmap_create_format( depth );
+
+ if ( p )
+ {
+ sys_pixel_format->palette = p;
+ pal_refresh( sys_pixel_format->palette ) ;
+ }
+ }
+
+ if ( sys_pixel_format->depth == 16 )
+ {
+ for ( n = 0 ; n < 65536 ; n++ )
+ {
+ colorghost[ n ] =
+ ((( n & screen->format->Rmask ) >> 1 ) & screen->format->Rmask ) +
+ ((( n & screen->format->Gmask ) >> 1 ) & screen->format->Gmask ) +
+ ((( n & screen->format->Bmask ) >> 1 ) & screen->format->Bmask ) ;
+ }
+// bitmap_16bits_conversion();
+ }
+
+ scr_initialized = 1 ;
+
+ SDL_ShowCursor( 0 ) ;
+
+ pal_refresh( NULL ) ;
+ palette_changed = 1 ;
+
+// gr_make_trans_table();
+/*
+ if ( scale_resolution == -1 && enable_scale )
+ {
+ surface_width = screen->w * 2;
+ surface_height = screen->h * 2;
+ }
+*/
+ /* Bitmaps de fondo */
+
+ scr_width = screen->w / ( scale_mode != 0 ? 2 : 1 ) ;
+ scr_height = screen->h / ( scale_mode != 0 ? 2 : 1 ) ;
+
+ /* Only allow background with same properties that video mode */
+ if (
+ !background ||
+ scr_width != screen->w || scr_height != screen->h ||
+ sys_pixel_format->depth != background->format->depth )
+ {
+ if ( background ) bitmap_destroy( background );
+ background = bitmap_new( 0, scr_width, scr_height, sys_pixel_format->depth ) ;
+ if ( background )
+ {
+ gr_clear( background ) ;
+ bitmap_add_cpoint( background, 0, 0 ) ;
+ }
+ }
+
+ regions[0].x = 0 ;
+ regions[0].y = 0 ;
+ regions[0].x2 = scr_width - 1 ;
+ regions[0].y2 = scr_height - 1 ;
+
+ // Finalmente seteamos icono de aplicacion
+ // Necesitamos crear una surface a partir de un MAP generico de 16x16...
+ gr_set_icon( icon );
+
+ if ( background ) background->modified = 1;
+
+// gr_rects_clear();
+
+ return 0;
+}
+
+/* --------------------------------------------------------------------------- */
+
+int gr_init( int width, int height )
+{
+ return gr_set_mode( width, height, 0 );
+}
+
+/* --------------------------------------------------------------------------- */
+
+void __bgdexport( libvideo, module_initialize )()
+{
+ char * e;
+
+ GLODWORD( libvideo, SCALE_RESOLUTION ) = -1; // hack for backward compatibility
+
+ if ( !SDL_WasInit( SDL_INIT_VIDEO ) ) SDL_InitSubSystem( SDL_INIT_VIDEO );
+
+#ifdef _WIN32
+ if ( !directdraw ) init_dx();
+#endif
+ apptitle = appname;
+
+ if ( ( e = getenv( "VIDEO_WIDTH" ) ) ) scr_width = atoi(e);
+ if ( ( e = getenv( "VIDEO_HEIGHT" ) ) ) scr_height = atoi(e);
+ if ( ( e = getenv( "VIDEO_DEPTH" ) ) )
+ GLODWORD( libvideo, GRAPH_MODE ) = atoi(e);
+ else
+ GLODWORD( libvideo, GRAPH_MODE ) = MODE_16BITS;
+ if ( ( e = getenv( "VIDEO_FULLSCREEN" ) ) ) GLODWORD( libvideo, GRAPH_MODE ) |= atoi(e) ? MODE_FULLSCREEN : 0;
+
+ gr_init( scr_width, scr_height ) ;
+}
+
+/* --------------------------------------------------------------------------- */
+
+void __bgdexport( libvideo, module_finalize )()
+{
+#ifdef _WIN32
+ if ( directdraw )
+ {
+ /* set cooperative level back to normal */
+ IDirectDraw2_SetCooperativeLevel( directdraw, NULL, DDSCL_NORMAL );
+
+ /* release DirectDraw interface */
+ IDirectDraw2_Release( directdraw );
+
+ directdraw = NULL;
+ }
+#endif
+ if ( SDL_WasInit( SDL_INIT_VIDEO ) ) SDL_QuitSubSystem( SDL_INIT_VIDEO );
+}
+
+/* --------------------------------------------------------------------------- */
+/* exports */
+/* --------------------------------------------------------------------------- */
+
+#include "libvideo_exports.h"
+
+/* --------------------------------------------------------------------------- */
diff --git a/modules/libvideo/g_video.h b/modules/libvideo/g_video.h
new file mode 100644
index 0000000..7d2fc6b
--- /dev/null
+++ b/modules/libvideo/g_video.h
@@ -0,0 +1,114 @@
+/*
+ * 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_VIDEO_H
+#define __G_VIDEO_H
+
+/* --------------------------------------------------------------------------- */
+
+#ifndef __BGDC__
+#include <SDL.h>
+
+#include "libgrbase.h"
+#endif
+
+/* --------------------------------------------------------------------------- */
+/* Graph Mode */
+#define MODE_WINDOW 0x0000
+#define MODE_16BITS 0x0010
+#define MODE_32BITS 0x0020
+#define MODE_2XSCALE 0x0100
+#define MODE_FULLSCREEN 0x0200
+#define MODE_DOUBLEBUFFER 0x0400
+#define MODE_HARDWARE 0x0800
+#define MODE_MODAL 0x1000
+#define MODE_FRAMELESS 0x2000
+#define MODE_WAITVSYNC 0x4000
+
+/* Scaler */
+#define SCALE_NONE 0x0000
+#define SCALE_SCALE2X 0x0001
+
+/* Scale resolution orientation */
+#define SRO_NORMAL 0
+#define SRO_LEFT 1
+#define SRO_DOWN 2
+#define SRO_RIGHT 3
+
+/* Scale resolution aspectratio */
+#define SRA_STRETCH 0
+#define SRA_PRESERVE 1
+
+/* --------------------------------------------------------------------------- */
+
+#ifndef __BGDC__
+extern GRAPH * icon ;
+
+extern SDL_Surface * screen ;
+extern SDL_Surface * scale_screen ;
+
+extern char * apptitle ;
+
+extern int scr_width ;
+extern int scr_height ;
+
+extern int scr_initialized ;
+
+extern int enable_16bits ;
+extern int enable_scale ;
+extern int full_screen ;
+extern int double_buffer ;
+extern int hardware_scr ;
+extern int grab_input ;
+extern int frameless ;
+extern int scale_mode ;
+
+extern int waitvsync ;
+
+extern int scale_resolution ;
+extern int * scale_resolution_table_w;
+extern int * scale_resolution_table_h;
+
+extern int scale_resolution_aspectratio;
+extern int scale_resolution_orientation;
+
+extern int scale_resolution_aspectratio_offx;
+extern int scale_resolution_aspectratio_offy;
+
+/* --------------------------------------------------------------------------- */
+
+extern int gr_init( int width, int height );
+extern void gr_set_caption( char * title );
+extern int gr_set_icon( GRAPH * map );
+extern int gr_set_mode( int width, int height, int depth );
+extern void gr_wait_vsync();
+
+/* --------------------------------------------------------------------------- */
+
+#endif
+#endif
diff --git a/modules/libvideo/libvideo.h b/modules/libvideo/libvideo.h
new file mode 100644
index 0000000..ef2804e
--- /dev/null
+++ b/modules/libvideo/libvideo.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 __VIDEO_H
+#define __VIDEO_H
+
+#include "libgrbase.h"
+#include "g_video.h"
+#include "g_regions.h"
+
+#endif
diff --git a/modules/libvideo/libvideo_exports.h b/modules/libvideo/libvideo_exports.h
new file mode 100644
index 0000000..be3185d
--- /dev/null
+++ b/modules/libvideo/libvideo_exports.h
@@ -0,0 +1,121 @@
+/*
+ * 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 __LIBVIDEO_EXPORTS
+#define __LIBVIDEO_EXPORTS
+
+/* --------------------------------------------------------------------------- */
+
+#include "bgddl.h"
+
+/* --------------------------------------------------------------------------- */
+
+#if defined(__BGDC__) || !defined(__STATIC__)
+
+/* --------------------------------------------------------------------------- */
+
+#include "g_video.h"
+
+/* --------------------------------------------------------------------------- */
+
+DLCONSTANT __bgdexport( libvideo, constants_def )[] =
+{
+ { "M320X200" , TYPE_DWORD , 3200200 },
+ { "M320X240" , TYPE_DWORD , 3200240 },
+ { "M320X400" , TYPE_DWORD , 3200400 },
+ { "M360X240" , TYPE_DWORD , 3600240 },
+ { "M376X282" , TYPE_DWORD , 3760282 },
+ { "M400X300" , TYPE_DWORD , 4000300 },
+ { "M512X384" , TYPE_DWORD , 5120384 },
+ { "M640X400" , TYPE_DWORD , 6400400 },
+ { "M640X480" , TYPE_DWORD , 6400480 },
+ { "M800X600" , TYPE_DWORD , 8000600 },
+ { "M1024X768" , TYPE_DWORD , 10240768 },
+ { "M1280X1024" , TYPE_DWORD , 12801024 },
+
+ { "MODE_WINDOW" , TYPE_DWORD , MODE_WINDOW },
+ { "MODE_2XSCALE" , TYPE_DWORD , MODE_2XSCALE },
+ { "MODE_FULLSCREEN" , TYPE_DWORD , MODE_FULLSCREEN },
+ { "MODE_DOUBLEBUFFER" , TYPE_DWORD , MODE_DOUBLEBUFFER },
+ { "MODE_HARDWARE" , TYPE_DWORD , MODE_HARDWARE },
+
+ { "MODE_WAITVSYNC" , TYPE_DWORD , MODE_WAITVSYNC },
+ { "WAITVSYNC" , TYPE_DWORD , MODE_WAITVSYNC },
+
+ { "DOUBLE_BUFFER" , TYPE_DWORD , MODE_DOUBLEBUFFER }, /* Obsolete */
+ { "HW_SURFACE" , TYPE_DWORD , MODE_HARDWARE }, /* Obsolete */
+
+ { "MODE_8BITS" , TYPE_DWORD , 8 },
+ { "MODE_16BITS" , TYPE_DWORD , 16 },
+ { "MODE_32BITS" , TYPE_DWORD , 32 },
+
+ { "MODE_8BPP" , TYPE_DWORD , 8 },
+ { "MODE_16BPP" , TYPE_DWORD , 16 },
+ { "MODE_32BPP" , TYPE_DWORD , 32 },
+
+ { "MODE_MODAL" , TYPE_DWORD , MODE_MODAL }, /* GRAB INPU */
+ { "MODE_FRAMELESS" , TYPE_DWORD , MODE_FRAMELESS }, /* FRAMELESS window */
+
+ { "SCALE_NONE" , TYPE_DWORD , SCALE_NONE },
+
+ { "SRO_NORMAL" , TYPE_DWORD , SRO_NORMAL },
+ { "SRO_LEFT" , TYPE_DWORD , SRO_LEFT },
+ { "SRO_DOWN" , TYPE_DWORD , SRO_DOWN },
+ { "SRO_RIGHT" , TYPE_DWORD , SRO_RIGHT },
+
+ { "SRA_STRETCH" , TYPE_DWORD , SRA_STRETCH },
+ { "SRA_PRESERVE" , TYPE_DWORD , SRA_PRESERVE },
+
+ { NULL , 0 , 0 }
+} ;
+
+/* --------------------------------------------------------------------------- */
+/* Definicion de variables globales (usada en tiempo de compilacion) */
+
+char * __bgdexport( libvideo, globals_def ) =
+ "graph_mode = 0;\n"
+ "scale_mode = 0;\n"
+ "full_screen = 0;\n"
+ "scale_resolution = -1;\n"
+ "scale_resolution_aspectratio = 0;\n"
+ "scale_resolution_orientation = 0;\n"
+ ;
+
+#endif
+
+/* --------------------------------------------------------------------------- */
+
+char * __bgdexport( libvideo, modules_dependency )[] =
+{
+ "libgrbase",
+ NULL
+};
+
+/* --------------------------------------------------------------------------- */
+
+#endif