summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2009-04-05 18:09:33 (GMT)
committer Jaromil <jaromil@dyne.org>2009-04-05 18:09:33 (GMT)
commit83dd526649b42d3f38c6a23b20a97bd9cf66e447 (patch)
treeb0d6cb05949e02cdedef3b689f94fe43efb5497a
parent26e70231a4ec6ee922b5a1bdd6029eb68068470d (diff)
some more compile fixes
-rw-r--r--mufhd0/.gitignore12
-rw-r--r--mufhd0/Makefile493
-rw-r--r--mufhd0/mufhd0.cpp2
-rw-r--r--mufhd0/water.cpp615
-rw-r--r--mufhd0/water.h25
-rw-r--r--mufhd0/water/water.cpp4
6 files changed, 471 insertions, 680 deletions
diff --git a/mufhd0/.gitignore b/mufhd0/.gitignore
new file mode 100644
index 0000000..90a7ef0
--- /dev/null
+++ b/mufhd0/.gitignore
@@ -0,0 +1,12 @@
+*.o
+*.a
+.deps
+autom4te.cache
+config.cache
+config.log
+config.status
+depcomp
+mufhd0
+water/.deps/
+water/Makefile
+
diff --git a/mufhd0/Makefile b/mufhd0/Makefile
index 5d86371..39c906c 100644
--- a/mufhd0/Makefile
+++ b/mufhd0/Makefile
@@ -1,58 +1,475 @@
-# why not autoconf/automake here?
-# i love simplicity
-# i'm still looking for a simple person loving me!
+# Generated automatically from Makefile.in by configure.
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
-CC = gcc
-CPP = g++
-INSTALL = install -c
-PREFIX = /usr/local
-DATADIR = $(PREFIX)/share/mufhd0
+# Copyright (C) 1994, 1995-8, 1999 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.
-#debug flags
-#CFLAGS = -pipe -ggdb \
-# -DDATADIR=\"$(DATADIR)\"
+# 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.
-# very shamanic lubrifications
-# -fno-inline -fno-loop-optimize -fexpensive-optimizations -fpeephole2
-CFLAGS = -fPIC -pipe -Wall -O2 -ffast-math -fomit-frame-pointer -DDATADIR=\"$(DATADIR)\"
+SHELL = /bin/sh
-# choose your compilation architecture
-CFLAGS += -DARCH_X86
-CFLAGS += -DHAVE_MMX
-#CFLAGS += -DARCH_PPC
-CFLAGS += -DHAVE_64BIT
+srcdir = .
+top_srcdir = .
+prefix = /usr/local
+exec_prefix = ${prefix}
+bindir = ${exec_prefix}/bin
+sbindir = ${exec_prefix}/sbin
+libexecdir = ${exec_prefix}/libexec
+datadir = ${prefix}/share
+sysconfdir = ${prefix}/etc
+sharedstatedir = ${prefix}/com
+localstatedir = ${prefix}/var
+libdir = ${exec_prefix}/lib
+infodir = ${prefix}/info
+mandir = ${prefix}/man
+includedir = ${prefix}/include
+oldincludedir = /usr/include
+DESTDIR =
+pkgdatadir = $(datadir)/mufhd0
+pkglibdir = $(libdir)/mufhd0
+pkgincludedir = $(includedir)/mufhd0
+top_builddir = .
+ACLOCAL = aclocal
+AUTOCONF = autoconf
+AUTOMAKE = automake
+AUTOHEADER = autoheader
-INCLUDE = -I. `sdl-config --cflags` \
- `pkg-config --cflags libpng12` \
- `libmikmod-config --cflags`
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL} $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_SCRIPT = ${INSTALL_PROGRAM}
+transform = s,x,x,
-LIBS = `sdl-config --libs` \
- `pkg-config --libs libpng12` \
- `libmikmod-config --libs`
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+host_alias = i686-pc-linux
+host_triplet = i686-pc-linux
+CXX = c++
+MAKEINFO = /home/jaromil/devel/demoscene/mufhd0/missing makeinfo
+PACKAGE = mufhd0
+RANLIB = ranlib
+SDL_CFLAGS = -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
+SDL_CONFIG = /usr/bin/sdl-config
+SDL_LIBS = -lSDL -lpthread
+VERSION = 1.0
-all: mufhd0 water.so
+SUFFIXES = .asm
-mufhd0: mufhd0.o water.o fixsin.o
- $(CPP) -o mufhd0 fixsin.o water.o mufhd0.o $(LIBS)
+NASM = nasm -f elf
-water.so: water.o
- ld -E -z now -shared water.o -o water.so
+SUBDIRS = water
-%.o: %.cpp
- $(CPP) $(INCLUDE) $(CFLAGS) -c -o $@ $<
+bin_PROGRAMS = mufhd0
+
+mufhd0_SOURCES = mufhd0.cpp
+
+mufhd0_LDADD = water/libwater.a -lmikmod
+
+EXTRA_DIST = README data/misfu-anaurale.xm data/misfu-kaligari.xm data/moody.bmp data/parasfuma.bmp data/oldschool.bmp
+
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+CONFIG_CLEAN_FILES =
+PROGRAMS = $(bin_PROGRAMS)
+
+
+DEFS = -DPACKAGE=\"mufhd0\" -DVERSION=\"1.0\" -DSTDC_HEADERS=1 -I. -I$(srcdir)
+CPPFLAGS =
+LDFLAGS =
+LIBS = -lSDL -lpthread
+mufhd0_OBJECTS = mufhd0.o
+mufhd0_DEPENDENCIES = water/libwater.a
+mufhd0_LDFLAGS =
+CXXFLAGS = -g -O2 -I/usr/X11R6/include -I/usr/local/include -O3 -fomit-frame-pointer -ffast-math -march=i686 -mcpu=i686 -finline-functions -malign-double -funroll-loops -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
+CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+CFLAGS = -g -O2 -I/usr/X11R6/include -I/usr/local/include -O3 -fomit-frame-pointer -ffast-math -march=i686 -mcpu=i686 -finline-functions -malign-double -funroll-loops -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT
+COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON = README AUTHORS COPYING INSTALL Makefile.am Makefile.in \
+acinclude.m4 aclocal.m4 config.guess config.sub configure configure.in \
+install-sh missing mkinstalldirs
+
+
+DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+
+TAR = tar
+GZIP_ENV = --best
+DEP_FILES = .deps/mufhd0.P
+SOURCES = $(mufhd0_SOURCES)
+OBJECTS = $(mufhd0_OBJECTS)
+
+all: all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .asm .c .cpp .o .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
+
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
+ cd $(top_builddir) \
+ && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4): configure.in acinclude.m4
+ cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+ $(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+ cd $(srcdir) && $(AUTOCONF)
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ if test -f $$p; then \
+ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ else :; fi; \
+ done
+
+uninstall-binPROGRAMS:
+ @$(NORMAL_UNINSTALL)
+ list='$(bin_PROGRAMS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ done
+
+.s.o:
+ $(COMPILE) -c $<
+
+.S.o:
+ $(COMPILE) -c $<
+
+mostlyclean-compile:
+ -rm -f *.o core *.core
+
+clean-compile:
+
+distclean-compile:
+ -rm -f *.tab.c
+
+maintainer-clean-compile:
+
+mufhd0: $(mufhd0_OBJECTS) $(mufhd0_DEPENDENCIES)
+ @rm -f mufhd0
+ $(CXXLINK) $(mufhd0_LDFLAGS) $(mufhd0_OBJECTS) $(mufhd0_LDADD) $(LIBS)
+.cpp.o:
+ $(CXXCOMPILE) -c $<
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+# (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+
+
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ target=`echo $@ | sed s/-recursive//`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ dot_seen=yes; \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done; \
+ if test "$$dot_seen" = "no"; then \
+ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+ fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+ @set fnord $(MAKEFLAGS); amf=$$2; \
+ dot_seen=no; \
+ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+ rev="$$subdir $$rev"; \
+ test "$$subdir" = "." && dot_seen=yes; \
+ done; \
+ test "$$dot_seen" = "no" && rev=". $$rev"; \
+ target=`echo $@ | sed s/-recursive//`; \
+ for subdir in $$rev; do \
+ echo "Making $$target in $$subdir"; \
+ if test "$$subdir" = "."; then \
+ local_target="$$target-am"; \
+ else \
+ local_target="$$target"; \
+ fi; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+ || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ done && test -z "$$fail"
+tags-recursive:
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+ done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SUBDIRS)'; for subdir in $$list; do \
+ if test "$$subdir" = .; then :; else \
+ test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+ fi; \
+ done; \
+ list='$(SOURCES) $(HEADERS)'; \
+ unique=`for i in $$list; do echo $$i; done | \
+ awk ' { files[$$0] = 1; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+
+# This target untars the dist file and tries a VPATH configuration. Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+ -rm -rf $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+ mkdir $(distdir)/=build
+ mkdir $(distdir)/=inst
+ dc_install_base=`cd $(distdir)/=inst && pwd`; \
+ cd $(distdir)/=build \
+ && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ && $(MAKE) $(AM_MAKEFLAGS) \
+ && $(MAKE) $(AM_MAKEFLAGS) dvi \
+ && $(MAKE) $(AM_MAKEFLAGS) check \
+ && $(MAKE) $(AM_MAKEFLAGS) install \
+ && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+ && $(MAKE) $(AM_MAKEFLAGS) dist
+ -rm -rf $(distdir)
+ @banner="$(distdir).tar.gz is ready for distribution"; \
+ dashes=`echo "$$banner" | sed s/./=/g`; \
+ echo "$$dashes"; \
+ echo "$$banner"; \
+ echo "$$dashes"
+dist: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+dist-all: distdir
+ -chmod -R a+r $(distdir)
+ GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+ -rm -rf $(distdir)
+distdir: $(DISTFILES)
+ -rm -rf $(distdir)
+ mkdir $(distdir)
+ -chmod 777 $(distdir)
+ here=`cd $(top_builddir) && pwd`; \
+ top_distdir=`cd $(distdir) && pwd`; \
+ distdir=`cd $(distdir) && pwd`; \
+ cd $(top_srcdir) \
+ && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile
+ $(mkinstalldirs) $(distdir)/data
+ @for file in $(DISTFILES); do \
+ d=$(srcdir); \
+ if test -d $$d/$$file; then \
+ cp -pr $$/$$file $(distdir)/$$file; \
+ else \
+ test -f $(distdir)/$$file \
+ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+ || cp -p $$d/$$file $(distdir)/$$file || :; \
+ fi; \
+ done
+ for subdir in $(SUBDIRS); do \
+ if test "$$subdir" = .; then :; else \
+ test -d $(distdir)/$$subdir \
+ || mkdir $(distdir)/$$subdir \
+ || exit 1; \
+ chmod 777 $(distdir)/$$subdir; \
+ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+ || exit 1; \
+ fi; \
+ done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+ -rm -rf .deps
+
+maintainer-clean-depend:
%.o: %.c
- $(CC) $(INCLUDE) $(CFLAGS) -c -o $@ $<
+ @echo '$(COMPILE) -c $<'; \
+ $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.c
+ @echo '$(LTCOMPILE) -c $<'; \
+ $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+
+%.o: %.cpp
+ @echo '$(CXXCOMPILE) -c $<'; \
+ $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-cp .deps/$(*F).pp .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm .deps/$(*F).pp
+
+%.lo: %.cpp
+ @echo '$(LTCXXCOMPILE) -c $<'; \
+ $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+ @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
+ < .deps/$(*F).pp > .deps/$(*F).P; \
+ tr ' ' '\012' < .deps/$(*F).pp \
+ | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+ >> .deps/$(*F).P; \
+ rm -f .deps/$(*F).pp
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+ @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am: uninstall-binPROGRAMS
+uninstall: uninstall-recursive
+all-am: Makefile $(PROGRAMS)
+all-redirect: all-recursive
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+ $(mkinstalldirs) $(DESTDIR)$(bindir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+ -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
+ mostlyclean-tags mostlyclean-depend mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \
+ clean-generic mostlyclean-am
+
+clean: clean-recursive
+
+distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \
+ distclean-depend distclean-generic clean-am
+
+distclean: distclean-recursive
+ -rm -f config.status
+
+maintainer-clean-am: maintainer-clean-binPROGRAMS \
+ maintainer-clean-compile maintainer-clean-tags \
+ maintainer-clean-depend maintainer-clean-generic \
+ distclean-am
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+ -rm -f config.status
+
+.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile install-data-recursive \
+uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-am install-data install-am install uninstall-am uninstall \
+all-redirect all-am all installdirs-am installdirs mostlyclean-generic \
+distclean-generic clean-generic maintainer-clean-generic clean \
+mostlyclean distclean maintainer-clean
+
-install: all
- $(INSTALL) -s mufhd0 $(PREFIX)/bin
- $(INSTALL) data/* $(DATADIR)
+.asm.o:
+ $(NASM) $<
-clean:
- rm -f mufhd0 *.o *.so
+# 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/mufhd0/mufhd0.cpp b/mufhd0/mufhd0.cpp
index c6fdd91..486864c 100644
--- a/mufhd0/mufhd0.cpp
+++ b/mufhd0/mufhd0.cpp
@@ -40,7 +40,7 @@
#include <SDL/SDL_thread.h>
#include <mikmod.h>
-#include "water.h"
+#include "water/water.h"
#include "font_6x11.h"
#define W 512
diff --git a/mufhd0/water.cpp b/mufhd0/water.cpp
deleted file mode 100644
index 763bd27..0000000
--- a/mufhd0/water.cpp
+++ /dev/null
@@ -1,615 +0,0 @@
-/*
- Water lib 0.1
- (C)2000 Denis Roio - aka jaromil
-
- Thanks go to Federico 'pix' Feroldi for the original
- water algorithm idea...
- Some optimizations added by Jason Hood.
- Some other optimizations by Scott Scriven.
- Further optimizations followed...
-*/
-
-#include <iostream>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-#include <SDL/SDL.h>
-#include "datatype.h"
-#include "fixsin.h"
-
-using namespace std;
-
-#define MAXWATERWIDTH 768
-#define MAXWATERHEIGHT 768
-
-/* water physics */
-#define WATER 1
-#define JELLY 2
-#define SLUDGE 3
-#define SUPER_SLUDGE 4
-
-/* The Height field... Two pages, so that the filter will work correctly */
-int Height[2][MAXWATERHEIGHT * MAXWATERHEIGHT];
-
-/* Yes, I've got three copies of the background, all next to each other.
- Press 's' a bunch of times to see why...
- */
-
-static byte BkGdImagePre[MAXWATERWIDTH * MAXWATERHEIGHT];
-static byte BkGdImage[MAXWATERWIDTH * MAXWATERHEIGHT];
-static byte BkGdImagePost[MAXWATERWIDTH * MAXWATERHEIGHT];
-
-byte *bufptr;
-int waterwidth;
-int waterheight;
-
-// water effect variables
-int Hpage = 0;
-int xang, yang;
-int swirlangle;
-int x, y, ox = 80, oy = 60;
-int done = 0;
-int mode=0x4000;
-
-/* density: water density (step 1)
- pheight: splash height (step 40)
- radius: waterdrop radius (step 1)
- light: light level (step 1)
-*/
-int density = 4, pheight = 600, radius = 30;
-int movement=1;
-int light=0;
-int offset;
-
-int water_surfacesize;
-int calc_optimization;
-
-/* *** clear:
- memset(Height[0], 0, sizeof(int)*waterwidth*waterheight);
- memset(Height[1], 0, sizeof(int)*waterwidth*waterheight);
- *** distort /exaggerate water:
- memset(Height[Hpage], 0, sizeof(int)*waterwidth*waterheight);
- *** water physics
- mode |= 0x40000;
- density=4; light=1; pheight=600;
- *** jelly physics
- mode &= 0xBFFF;
- density=3; pheight=400;
- *** sludge physics
- mode &= 0xBFFF;
- density=8; pheight=400;
- *** super sludge physics
- mode &= 0xBFFF;
- density=8; pheight=400;
-*/
-
-void DrawWaterNoLight(int page);
-void DrawWaterWithLight(int page, int LightModifier);
-void CalcWater(int npage, int density);
-void SmoothWater(int npage);
-
-void HeightBlob(int x, int y, int radius, int height, int page);
-void HeightBox (int x, int y, int radius, int height, int page);
-
-void WarpBlob(int x, int y, int radius, int height, int page);
-void SineBlob(int x, int y, int radius, int height, int page);
-
-SDL_Surface *water_init(char *imagefile, SDL_Surface *screen) {
- SDL_Palette *palette;
- SDL_Surface *image;
-
- randomize();
- image = SDL_LoadBMP(imagefile);
- if (image == NULL) {
- cout << "! Error loading water imagefile\n";
- cout << "!!! Sorry, exiting.\n";
- exit(1);
- }
-
- palette = image->format->palette;
-
- if ((image->format->BitsPerPixel != 8) || (palette == NULL))
- {
- cout << "! Water imagefile must have 8bit depth and have a palette\n";
- cout << "!!! Sorry, exiting.\n";
- exit(1);
- }
-
- if ((image->format->BitsPerPixel != 8) || (image->format->palette == NULL))
- {
- cout << "! Screen for water effect must have 8 bit depth and have a palette\n";
- cout << "!!! Sorry, exiting.\n";
- exit(1);
- }
-
- waterwidth = image->w;
- waterheight = image->h;
-
- FCreateSines();
-
- // misc optimization variables
- water_surfacesize = sizeof(int)*waterwidth*waterheight;
- calc_optimization = (waterheight-1)*waterwidth;
-
- /* Fill the extra palette entries with white and set the display palette */
- {
- int nwhite;
-
- nwhite = 256-palette->ncolors;
- memset(&palette->colors[palette->ncolors], 255, nwhite*sizeof(SDL_Color));
- SDL_SetColors(screen, palette->colors, 0, 256);
- }
-
- xang = rand()%2048;
- yang = rand()%2048;
- swirlangle = rand()%2048;
-
- memset(Height[0], 0, water_surfacesize);
- memset(Height[1], 0, water_surfacesize);
-
- bufptr = (unsigned char*)image->pixels;
- memcpy(BkGdImagePre, bufptr, waterwidth*waterheight);
- memcpy(BkGdImage, bufptr, waterwidth*waterheight);
- memcpy(BkGdImagePost, bufptr, waterwidth*waterheight);
-
- return(image);
-}
-
-void water_clear() {
- memset(Height[0], 0, water_surfacesize);
- memset(Height[1], 0, water_surfacesize);
-}
-
-void water_distort() {
- if(movement)
- memset(Height[Hpage], 0, water_surfacesize);
- else
- SmoothWater(Hpage);
-}
-
-void water_setphysics(int physics) {
- switch(physics) {
- case WATER:
- mode |= 0x4000;
- density=4;
- light=1;
- pheight=600;
- break;
- case JELLY:
- mode &= 0xBFFF;
- density=3;
- pheight=400;
- break;
- case SLUDGE:
- mode &= 0xBFFF;
- density=6;
- pheight=400;
- break;
- case SUPER_SLUDGE:
- mode &=0xBFFF;
- density=8;
- pheight=400;
- break;
- }
-}
-
-void water_update() {
- if(light)
- DrawWaterWithLight(Hpage, light-1);
- else
- DrawWaterNoLight(Hpage);
-
- CalcWater(Hpage^1, density);
- Hpage ^=1 ;
-}
-
-void water_drop(int x, int y) {
- Height[Hpage][y*waterwidth + x] = rand()%(pheight<<2);
-}
-
-void water_bigsplash(int x, int y) {
- if(mode & 0x4000)
- HeightBlob(x, y, (radius>>1), pheight, Hpage);
- else
- SineBlob(x, y, radius, -pheight*6, Hpage);
-}
-
-void water_surfer() {
- x = (waterwidth>>1)
- + ((
- (
- (FSin( (xang* 65) >>8) >>8) *
- (FSin( (xang*349) >>8) >>8)
- ) * ((waterwidth-8)>>1)
- ) >> 16);
- y = (waterheight>>1)
- + ((
- (
- (FSin( (yang*377) >>8) >>8) *
- (FSin( (yang* 84) >>8) >>8)
- ) * ((waterheight-8)>>1)
- ) >> 16);
- xang += 13;
- yang += 12;
-
- if(mode & 0x4000)
- {
- offset = (oy+y)/2*waterwidth + ((ox+x)>>1);
- Height[Hpage][offset] = pheight;
- Height[Hpage][offset + 1] =
- Height[Hpage][offset - 1] =
- Height[Hpage][offset + waterwidth] =
- Height[Hpage][offset - waterwidth] = pheight >> 1;
-
- offset = y*waterwidth + x;
- Height[Hpage][offset] = pheight<<1;
- Height[Hpage][offset + 1] =
- Height[Hpage][offset - 1] =
- Height[Hpage][offset + waterwidth] =
- Height[Hpage][offset - waterwidth] = pheight;
- }
- else
- {
- SineBlob(((ox+x)>>1), ((oy+y)>>1), 3, -1200, Hpage);
- SineBlob(x, y, 4, -2000, Hpage);
- }
-
- ox = x;
- oy = y;
-}
-
-void water_swirl() {
- x = (waterwidth>>1)
- + ((
- (FCos(swirlangle)) * (25)
- ) >> 16);
- y = (waterheight>>1)
- + ((
- (FSin(swirlangle)) * (25)
- ) >> 16);
- swirlangle += 50;
- if(mode & 0x4000)
- HeightBlob(x,y, radius>>2, pheight, Hpage);
- else
- WarpBlob(x, y, radius, pheight, Hpage);
-}
-
-void DrawWaterNoLight(int page)
-{
-
- int dx, dy;
- int x, y;
- int c;
-
- int offset=waterwidth + 1;
-
- int *ptr = &Height[page][0];
-
- for (y = calc_optimization; offset < y; offset += 2)
- {
- for (x = offset+waterwidth-2; offset < x; offset++)
- {
- dx = ptr[offset] - ptr[offset+1];
- dy = ptr[offset] - ptr[offset+waterwidth];
- c = BkGdImage[offset + waterwidth*(dy>>3) + (dx>>3)];
-
- /* If anyone knows a better/faster way to do this, please tell me... */
- bufptr[offset] = (c < 0) ? 0 : (c > 255) ? 255 : c;
-
- offset++;
- dx = ptr[offset] - ptr[offset+1];
- dy = ptr[offset] - ptr[offset+waterwidth];
- c = BkGdImage[offset + waterwidth*(dy>>3) + (dx>>3)];
- bufptr[offset] = (c < 0) ? 0 : (c > 255) ? 255 : c;
-
- }
- }
-}
-
-void DrawWaterWithLight(int page, int LightModifier)
-{
-
- int dx, dy;
- int x, y;
- int c;
-
- int offset=waterwidth + 1;
-
- int *ptr = &Height[page][0];
-
-
- for (y = calc_optimization; offset < y; offset += 2)
- {
- for (x = offset+waterwidth-2; offset < x; offset++)
- {
- dx = ptr[offset] - ptr[offset+1];
- dy = ptr[offset] - ptr[offset+waterwidth];
-
- c = BkGdImage[offset + waterwidth*(dy>>3) + (dx>>3)] - (dx>>LightModifier);
-
- /* If anyone knows a better/faster way to do this, please tell me... */
- bufptr[offset] = (c < 0) ? 0 : (c > 255) ? 255 : c;
-
- offset++;
- dx = ptr[offset] - ptr[offset+1];
- dy = ptr[offset] - ptr[offset+waterwidth];
- c = BkGdImage[offset + waterwidth*(dy>>3) + (dx>>3)] - (dx>>LightModifier);
- bufptr[offset] = (c < 0) ? 0 : (c > 255) ? 255 : c;
-
- }
- }
-}
-
-void CalcWater(int npage, int density)
-{
- int newh;
- int count = waterwidth + 1;
-
- int *newptr = &Height[npage][0];
- int *oldptr = &Height[npage^1][0];
-
- int x, y;
-
- /* Sorry, this function might not be as readable as I'd like, because
- I optimized it somewhat. (enough to make me feel satisfied with it)
- */
- for (y = calc_optimization; count < y; count += 2)
- {
- for (x = count+waterwidth-2; count < x; count++)
- {
-/* This does the eight-pixel method. It looks much better. */
-
- newh = ((oldptr[count + waterwidth]
- + oldptr[count - waterwidth]
- + oldptr[count + 1]
- + oldptr[count - 1]
- + oldptr[count - waterwidth - 1]
- + oldptr[count - waterwidth + 1]
- + oldptr[count + waterwidth - 1]
- + oldptr[count + waterwidth + 1]
- ) >> 2 )
- - newptr[count];
-
-
- newptr[count] = newh - (newh >> density);
- }
- }
-}
-
-void SmoothWater(int npage)
-{
- int newh;
- int count = waterwidth + 1;
-
- int *newptr = &Height[npage][0];
- int *oldptr = &Height[npage^1][0];
-
- int x, y;
-
- /* Sorry, this function might not be as readable as I'd like, because
- I optimized it somewhat. (enough to make me feel satisfied with it)
- */
-
- for(y=1; y<waterheight-1; y++)
- {
- for(x=1; x<waterwidth-1; x++)
- {
-/* This does the eight-pixel method. It looks much better. */
-
- newh = ((oldptr[count + waterwidth]
- + oldptr[count - waterwidth]
- + oldptr[count + 1]
- + oldptr[count - 1]
- + oldptr[count - waterwidth - 1]
- + oldptr[count - waterwidth + 1]
- + oldptr[count + waterwidth - 1]
- + oldptr[count + waterwidth + 1]
- ) >> 3 )
- + newptr[count];
-
-
- newptr[count] = newh>>1;
- count++;
- }
- count += 2;
- }
-}
-
-void CalcWaterBigFilter(int npage, int density)
-{
- int newh;
- int count = (waterwidth<<1) + 2;
-
- int *newptr = &Height[npage][0];
- int *oldptr = &Height[npage^1][0];
-
- int x, y;
-
- /* Sorry, this function might not be as readable as I'd like, because
- I optimized it somewhat. (enough to make me feel satisfied with it)
- */
-
- for(y=2; y<waterheight-2; y++)
- {
- for(x=2; x<waterwidth-2; x++)
- {
-/* This does the 25-pixel method. It looks much okay. */
-
- newh = (
- (
- (
- (oldptr[count + waterwidth]
- + oldptr[count - waterwidth]
- + oldptr[count + 1]
- + oldptr[count - 1]
- )<<1)
- + ((oldptr[count - waterwidth - 1]
- + oldptr[count - waterwidth + 1]
- + oldptr[count + waterwidth - 1]
- + oldptr[count + waterwidth + 1]))
- + ( (
- oldptr[count - (waterwidth<<1)]
- + oldptr[count + (waterwidth<<1)]
- + oldptr[count - 2]
- + oldptr[count + 2]
- ) >> 1 )
- + ( (
- oldptr[count - (waterwidth<<1) - 1]
- + oldptr[count - (waterwidth<<1) + 1]
- + oldptr[count + (waterwidth<<1) - 1]
- + oldptr[count + (waterwidth<<1) + 1]
- + oldptr[count - 2 - waterwidth]
- + oldptr[count - 2 + waterwidth]
- + oldptr[count + 2 - waterwidth]
- + oldptr[count + 2 + waterwidth]
- ) >> 2 )
- )
- >> 3)
- - (newptr[count]);
-
-
- newptr[count] = newh - (newh >> density);
- count++;
- }
- count += 4;
- }
-}
-
-void HeightBlob(int x, int y, int radius, int height, int page)
-{
- int rquad;
- int cx, cy, cyq;
- int left, top, right, bottom;
-
-
- rquad = radius * radius;
-
- /* Make a randomly-placed blob... */
- if(x<0) x = 1+radius+ rand()%(waterwidth-2*radius-1);
- if(y<0) y = 1+radius+ rand()%(waterheight-2*radius-1);
-
- left=-radius; right = radius;
- top=-radius; bottom = radius;
-
- /* Perform edge clipping... */
- if(x - radius < 1) left -= (x-radius-1);
- if(y - radius < 1) top -= (y-radius-1);
- if(x + radius > waterwidth-1) right -= (x+radius-waterwidth+1);
- if(y + radius > waterheight-1) bottom-= (y+radius-waterheight+1);
-
-
- for(cy = top; cy < bottom; cy++)
- {
- cyq = cy*cy;
- for(cx = left; cx < right; cx++)
- {
- if(cx*cx + cyq < rquad)
- Height[page][waterwidth*(cy+y) + (cx+x)] += height;
- }
- }
-}
-
-
-void HeightBox (int x, int y, int radius, int height, int page)
-{
- int cx, cy;
- int left, top, right, bottom;
-
-
- if(x<0) x = 1+radius+ rand()%(waterwidth-2*radius-1);
- if(y<0) y = 1+radius+ rand()%(waterheight-2*radius-1);
-
- left=-radius; right = radius;
- top=-radius; bottom = radius;
-
- /* Perform edge clipping... */
- if(x - radius < 1) left -= (x-radius-1);
- if(y - radius < 1) top -= (y-radius-1);
- if(x + radius > waterwidth-1) right -= (x+radius-waterwidth+1);
- if(y + radius > waterheight-1) bottom-= (y+radius-waterheight+1);
-
- for(cy = top; cy < bottom; cy++)
- {
- for(cx = left; cx < right; cx++)
- {
- Height[page][waterwidth*(cy+y) + (cx+x)] = height;
- }
- }
-
-}
-
-void WarpBlob(int x, int y, int radius, int height, int page)
-{
- int cx, cy;
- int left,top,right,bottom;
- int square;
- int radsquare = radius * radius;
-
- radsquare = (radius*radius);
-
- height = height>>5;
-
- left=-radius; right = radius;
- top=-radius; bottom = radius;
-
- /* Perform edge clipping... */
- if(x - radius < 1) left -= (x-radius-1);
- if(y - radius < 1) top -= (y-radius-1);
- if(x + radius > waterwidth-1) right -= (x+radius-waterwidth+1);
- if(y + radius > waterheight-1) bottom-= (y+radius-waterheight+1);
-
- for(cy = top; cy < bottom; cy++)
- {
- for(cx = left; cx < right; cx++)
- {
- square = cy*cy + cx*cx;
- if(square < radsquare)
- {
- Height[page][waterwidth*(cy+y) + cx+x]
- += (int)((radius-sqrt(square))*(float)(height));
- }
- }
- }
-}
-
-void SineBlob(int x, int y, int radius, int height, int page)
-{
- int cx, cy;
- int left,top,right,bottom;
- int square, dist;
- int radsquare = radius * radius;
- float length = (1024.0/(float)radius)*(1024.0/(float)radius);
-
- if(x<0) x = 1+radius+ rand()%(waterwidth-2*radius-1);
- if(y<0) y = 1+radius+ rand()%(waterheight-2*radius-1);
-
-
- radsquare = (radius*radius);
-
-
- left=-radius; right = radius;
- top=-radius; bottom = radius;
-
-
- /* Perform edge clipping... */
- if(x - radius < 1) left -= (x-radius-1);
- if(y - radius < 1) top -= (y-radius-1);
- if(x + radius > waterwidth-1) right -= (x+radius-waterwidth+1);
- if(y + radius > waterheight-1) bottom-= (y+radius-waterheight+1);
-
- for(cy = top; cy < bottom; cy++)
- {
- for(cx = left; cx < right; cx++)
- {
- square = cy*cy + cx*cx;
- if(square < radsquare)
- {
- dist = (int)(sqrt(square*length));
- Height[page][waterwidth*(cy+y) + cx+x]
- += (int)((FCos(dist)+0xffff)*(height)) >> 19;
- }
- }
- }
-}
-
diff --git a/mufhd0/water.h b/mufhd0/water.h
deleted file mode 100644
index 5af003a..0000000
--- a/mufhd0/water.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#ifndef WATER_H
-#define WATER_H
-
-#include "fixsin.h"
-
-#define WATERWID 768
-#define WATERHGT 768
-
-/* water physics */
-#define WATER 1
-#define JELLY 2
-#define SLUDGE 3
-#define SUPER_SLUDGE 4
-
-SDL_Surface *water_init(char *imagefile, SDL_Surface *screen);
-void water_clear();
-void water_distort();
-void water_setphysics(int physics);
-void water_update();
-void water_drop(int x, int y);
-void water_bigsplash(int x, int y);
-void water_surfer();
-void water_swirl();
-
-#endif
diff --git a/mufhd0/water/water.cpp b/mufhd0/water/water.cpp
index 4b32f7d..763bd27 100644
--- a/mufhd0/water/water.cpp
+++ b/mufhd0/water/water.cpp
@@ -9,7 +9,7 @@
Further optimizations followed...
*/
-#include <iostream.h>
+#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -18,6 +18,8 @@
#include "datatype.h"
#include "fixsin.h"
+using namespace std;
+
#define MAXWATERWIDTH 768
#define MAXWATERHEIGHT 768